/* The signed-in shell and cross-subject study home. */
#workspace {
  --study-ink: #171833; --study-muted: #626782; --study-line: #dfe3ef; --study-purple: #5944cc;
  --study-page: #f8f9fc; --study-white: #fff; --study-tint: #f4f3fc;
  --study-navy: #1c203e; --study-gap: clamp(14px, 1.2vw, 24px);
}
.home-symbols { position: absolute; width: 0; height: 0; overflow: hidden; }
.sh-icon { flex: none; width: 1.3em; height: 1.3em; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tiplo-face {
  display: inline-block; flex: none; width: 42px; aspect-ratio: 1;
  background: url("/static/mascots/tiplo/other.webp") center 2% / 164% auto no-repeat;
  clip-path: ellipse(50% 50% at 50% 50%);
}
#workspace #sidebar {
  --side-ink: #f7f7ff; --side-muted: #acb4d6; --side-selected: #303651; --side-hover: #292e4d; --side-line: #3b415d;
  padding: 23px 15px 18px; gap: 0; height: 100dvh; color: var(--side-ink); background: var(--study-navy); border: none;
}
#workspace #sidebar .side-top { min-height: 44px; padding: 0 6px; }
#workspace #sidebar .brand { color: white; font: 680 clamp(21px,1.55vw,27px)/1.1 var(--sans); letter-spacing: -.055em; gap: 8px; white-space: nowrap; }
#workspace #new-question { justify-content: center; gap: 10px; margin: 24px 4px 26px; min-height: 46px; color: #262035; background: #ffe783; border: 1px solid #ffeb9d; border-radius: 10px; box-shadow: none; font: 650 15px/1.3 var(--sans); }
#workspace #new-question:hover { background: #ffdf57; }
#sidebar .side-nav .nav-item, #sidebar #nav-memory, #workspace .nb-folder-name {
  width: 100%; display: flex; align-items: center; gap: 13px; min-height: 46px; padding: 10px 12px;
  background: transparent; color: #f1f2ff; border: 0; border-radius: 9px; font: 520 15px/1.35 var(--sans); text-align: left;
}
#sidebar :is(#nav-memory,.nb-folder-name):hover { background: var(--side-hover); }
#sidebar :is(#nav-memory,.nb-folder-name)[aria-current="page"] { background: var(--side-selected); color: #fff; }
#workspace #sidebar .nb-folder-section { margin: 27px 0 16px; }
#workspace #sidebar .side-heading { padding: 0 12px 9px; }
#sidebar #nb-library-link { text-transform: uppercase; color: #acb4d6; font: 600 10px/1.2 var(--sans); letter-spacing: .17em; }
#nb-side-list { gap: 1px; }
.nb-folder-name::before { content: ""; flex: none; width: 20px; height: 20px; background: #92adff; mask: var(--subject-glyph) center/contain no-repeat; }
:is(.nb-folder,.lab-subject-icon)[data-subject="economics"] { --subject-glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='2' y='14' width='5' height='8' rx='1.4'/%3E%3Crect x='10' y='8' width='5' height='14' rx='1.4'/%3E%3Crect x='18' y='2' width='5' height='20' rx='1.4'/%3E%3C/svg%3E"); }
#sidebar #nav-memory { border-top: 1px solid var(--side-line); border-radius: 0; padding-block: 19px; }
#sidebar #nav-memory svg, .nb-folder[data-subject="maths"] .nb-folder-name::before { color: #80bdff; }
#workspace #sidebar .account { margin: auto 5px 0; padding: 17px 0 0; color: white; border-top: 1px solid var(--side-line); }
#sidebar #account-email { color: inherit; font-size: 14px; }
#sidebar #account-initial { width: 34px; height: 34px; color: #fff; background: #474c88; }
#workspace #sidebar #open-settings { color: #d9ddf5; border-color: transparent; background: transparent; }
#study-bottom-nav { display: none; }
#nb-subject-nav { min-width: 0; max-width: 100%; overflow-x: auto; }
#nb-subject-nav button { flex: none; }
#math-subject-tabs { padding: 4px clamp(16px,3vw,44px) 0; }
#math-tabs-status:empty { display: none; }
#math-subject-tabs nav { margin: 0; }
#worksheet-topics { margin-block: 16px; }
#worksheet-topics h2 { margin: 0 0 7px; font: 620 15px/1.4 var(--sans); }
#worksheet-topics ul { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; }
#worksheet-topics li { padding: 4px 10px; border: 1px solid var(--study-line); border-radius: 20px; font: 500 13px/1.4 var(--sans); }
#workspace[data-maths="true"] #home-revision-section { display: none; }
#workspace[data-maths="false"]:has(#home:not([hidden])) #main { background: var(--study-page); }
#workspace[data-maths="false"] #home {
  --ink: var(--study-ink); --muted: var(--study-muted); --surface: var(--study-white); --line: var(--study-line); --focus: #6351dc;
  color-scheme: light; width: 100%; max-width: 1740px; margin: 0 auto;
  padding: clamp(18px,1.55vw,32px) clamp(18px,1.9vw,38px) 42px; color: var(--ink); font-family: var(--sans);
}
#workspace #home .dashboard-head {
  min-height: 135px; padding: 8px clamp(19px,2.1vw,42px); margin: 0 0 var(--study-gap); gap: 12px; overflow: hidden;
  --tiplo-paper: #fff7e8; --tiplo-grid: #e8dfcd; --tiplo-ink: #161832; border-radius: 13px; background-size: auto, 22px 22px, 22px 22px;
}
#home .dashboard-head .home-heading { text-align: left; margin: 0; }
#home .study-kicker { margin: 0 0 7px; color: #656980; font: 640 10px/1.3 var(--sans); letter-spacing: .17em; text-transform: uppercase; }
#workspace #home .dashboard-head #greeting { max-width: none; margin: 0; color: #161832; font: 690 clamp(30px,2.85vw,52px)/1.07 var(--sans); letter-spacing: -.055em; overflow-wrap: anywhere; }
#home .dashboard-head #home-title { margin: 5px 0 0; color: #686e85; font: 440 clamp(19px,1.85vw,32px)/1.17 var(--sans); letter-spacing: -.033em; }
#home .study-home-portrait { display: flex; align-items: center; align-self: stretch; gap: 5px; }
#home .study-home-portrait img { width: clamp(120px,10.4vw,198px); height: clamp(118px,9vw,174px); object-fit: contain; }
#home .study-home-portrait figcaption { margin: 0 0 0 -4px; padding: 0; color: #43527f; background: none; transform: rotate(-6deg); font: italic 500 clamp(14px,1.15vw,20px)/1.12 Georgia,serif; text-align: left; }
#workspace[data-maths="false"] #home .dashboard-grid { grid-template-columns: minmax(0,3fr) minmax(0,2fr); gap: var(--study-gap); }
#home .study-card, #home .study-subject, #home .study-recent-card { min-width: 0; background: var(--study-white); border: 1px solid var(--study-line); border-radius: 13px; box-shadow: none; }
#home :is(.study-card,#nb-home-intake) { padding: clamp(19px,1.55vw,31px); }
#home #nb-home-intake h2, #home #home-chat h2 { margin: 0; color: var(--study-ink); font: 670 clamp(22px,1.88vw,35px)/1.13 var(--sans); letter-spacing: -.049em; }
#home .study-intro { margin: 5px 0 16px; color: var(--study-muted); font: 450 15px/1.42 var(--sans); }
#nb-home-intake { display: flex; flex-direction: column; }
#nb-intake { flex: 1; display: flex; flex-direction: column; align-items: stretch; }
#nb-intake #nb-text {
  flex: 1; width: 100%; min-height: 98px; padding: 15px 17px; margin: 0 0 15px; resize: vertical; box-shadow: none;
  color: var(--study-ink); background: #fdfdff; border: 1px dashed #a5a9ce; border-radius: 8px; font: 470 15px/1.5 var(--sans);
}
#nb-text::placeholder { color: #70758b; opacity: 1; }
#nb-intake:focus-within #nb-text, #nb-intake.dragging #nb-text { border-color: var(--study-purple); }
.capture-actions { display: flex; justify-content: space-between; gap: 8px; align-items: center; flex-wrap: wrap; }
#nb-intake .nb-file, #home #nb-study, #home #home-exam-setup {
  display: inline-flex; justify-content: center; align-items: center; gap: 8px; width: auto; min-height: 42px; padding: 8px 16px;
  background: var(--study-tint); color: #373265; border: 1px solid #c6c5df; border-radius: 9px; font: 620 14px/1.32 var(--sans); box-shadow: none; cursor: pointer;
}
#home #nb-study { background: var(--study-purple); color: #fff; border-color: transparent; }
#home #nb-study span { font-size: 20px; line-height: 1; }
#home #nb-study:hover { background: #4432b0; }
.capture-caption, #nb-filename { margin: 7px 0 0; color: var(--study-muted); font-size: 12px; }
#nb-filename:empty, #nb-home-status:empty, #next-step-meta:empty { display: none; }
#nb-home-status { margin: 8px 0 0; }
#home-chat-list { display: grid; align-content: start; gap: 9px; max-height: 230px; overflow-y: auto; }
.subject-chat-launch {
  display: flex; align-items: center; gap: 12px; min-height: 65px; padding: 10px 13px; color: var(--study-ink); background: white;
  border: 1px solid var(--study-line); border-radius: 10px; font-family: var(--sans); text-align: left; overflow-wrap: anywhere;
}
.subject-chat-launch::after { content: "→"; margin-left: auto; color: #636a94; font-size: 21px; }
.subject-chat-launch strong, .study-recent-copy strong { display: block; font-size: 16px; font-weight: 650; letter-spacing: -.025em; }
.subject-chat-launch small, .study-subject small, .study-recent-copy small { display: block; margin-top: 3px; color: var(--study-muted); font: 450 13px/1.35 var(--sans); }
#home :is(.subject-chat-launch,.study-subject,.study-recent-card):focus-within, .subject-chat-launch:hover, #home .study-subject:hover { border-color: #a9a4ce; }
#home #home-revision-section, #home #nb-library, #home #recent-questions-panel { margin: clamp(20px,1.65vw,32px) 0 0; }
#home .study-section-title, #home #nb-library h2 { margin: 0 0 8px; color: var(--study-ink); font: 650 clamp(18px,1.35vw,25px)/1.25 var(--sans); letter-spacing: -.035em; }
.study-revision-grid { display: grid; grid-template-columns: minmax(0,65fr) minmax(0,35fr); gap: var(--study-gap); }
#workspace #home .study-revision-grid .next-step {
  display: flex; flex-direction: row; align-items: center; justify-content: space-between; gap: 15px; min-height: 150px;
  padding: clamp(18px,1.55vw,30px); background: linear-gradient(112deg,#191d38,#242749); border-radius: 12px; box-shadow: none;
}
#home .study-revision-grid .next-step::before,#home .study-revision-grid .next-step::after { content: none; }
#home .study-revision-grid #next-step-subject { margin: 0; color: #d7dbf4; font: 600 10px/1.4 var(--sans); letter-spacing: .14em; text-transform: uppercase; }
#home .study-revision-grid #next-step-title { max-width: none; margin: 8px 0 0; padding: 0; color: white; font: 650 clamp(22px,1.9vw,32px)/1.15 var(--sans); letter-spacing: -.038em; }
#home .study-revision-grid #next-step-reason { max-width: 46ch; margin: 5px 0 0; color: #e3e5f4; font: 450 15px/1.4 var(--sans); }
#home #next-step-meta { margin: 8px 0 0; color: #c5cae4; font-size: 13px; }
.study-next-copy { min-width: 0; overflow-wrap: anywhere; }
.study-next-actions { overflow-wrap: anywhere; display: grid; justify-items: start; gap: 8px; }
.study-revision-grid .study-next-actions { flex: 0 1 auto; min-width: min(125px,35%); justify-items: center; }
#home .study-revision-grid #next-step-action { padding: 11px 17px; border: none; border-radius: 999px; color: #20213e; background: #fff; font-size: 14px; text-align: center; }
#home #next-step-action::after { color: inherit; }
#home .study-revision-grid #next-step-source { margin: 0; padding: 4px; color: #e5e7fa; text-align: center; font-size: 12px; }
.study-exam-setup { position: relative; }
.study-exam-setup h3 { margin: 0; padding-right: 31px; font: 650 clamp(17px,1.3vw,23px)/1.2 var(--sans); letter-spacing: -.032em; }
.study-exam-setup p { margin: 6px 0 12px; color: var(--study-muted); font-size: 13px; }
.setup-calendar { position: absolute; right: 15px; top: 15px; display: grid; place-items: center; width: 32px; height: 32px; color: #44466c; background: #f1f2f7; border-radius: 8px; }
#home #home-exam-setup { min-height: 36px; padding: 6px 13px; background: white; border-color: #a8a0cf; }
.study-subject-strip { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,224px),1fr)); gap: 10px; }
#nb-tiles { display: contents; }
.study-subject { position: relative; padding: 13px 14px 12px; display: flex; flex-direction: column; align-items: start; }
#home .study-subject .nb-tile { display: flex; flex-direction: row; align-items: center; justify-content: start; width: 100%; min-height: 40px; gap: 12px; padding: 0; border: 0; background: transparent; color: var(--study-ink); }
.subject-icon-box, .study-recent-icon { flex: none; display: grid; place-items: center; width: 43px; height: 43px; border-radius: 10px; background: #e8e1fb; color: #6251b5; }
.subject-icon-box[data-subject="maths"], .study-recent-icon { color: #256fbd; background: #dfedff; }
#home .nb-tile strong { display: block; font: 650 16px/1.2 var(--sans); letter-spacing: -.025em; }
.subject-chat-pill { margin: 7px 0 0 55px; padding: 3px 10px; border: 1px solid #e0def1; border-radius: 99px; color: #50447b; background: var(--study-tint); font: 600 12px/1.4 var(--sans); }
#nb-new { min-height: 76px; padding: 14px; background: #ffffff90; color: #626785; border: 1px dashed #bcc3d9; border-radius: 12px; font: 550 14px/1.4 var(--sans); }
#nb-new span { margin-right: 9px; font-size: 20px; vertical-align: -1px; }
#recent-questions, #memory-subjects { display: grid; gap: 8px; }
.study-recent-card, .memory-record-link { display: flex; align-items: center; gap: 14px; padding: 14px 18px; color: var(--study-ink); }
.study-recent-copy { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.study-recent-action { min-height: 37px; padding: 6px 14px; color: #403676; background: var(--study-tint); border: 1px solid #e2def4; border-radius: 8px; font: 620 13px/1.3 var(--sans); }
.study-mastery { display: inline-flex; margin-top: 5px; border-radius: 50px; padding: 2px 8px; color: #77500e; background: #fff0c8; font: 600 11px/1.5 var(--sans); }
.study-mastery[data-tone="green"] { background: #e4f3e9; color: #2a6446; }
#study-memory { max-width: 850px; margin: 0 auto; }
.memory-record-link { border: 1px solid var(--line); background: var(--surface); border-radius: 9px; color: var(--ink); text-align: left; }
.memory-record-link > span { margin-left: auto; font-size: 13px; }
@media (min-width: 861px) {
  #workspace { background: var(--study-navy); }
  #workspace #main { background-color: var(--page); }
  :root[data-theme] #workspace { grid-template-columns: clamp(205px,15.6vw,278px) minmax(0,1fr); }
}
@media (max-width: 1050px) {
  .study-revision-grid .next-step { flex-wrap: wrap; }
  .study-revision-grid .study-next-actions { display: flex; flex-wrap: wrap; align-items: center; }
}
@media (max-width: 860px) {
  #workspace #sidebar { display: none; }
  #workspace { --bottom-nav-height: calc(56px + env(safe-area-inset-bottom)); }
  #workspace .main { padding-bottom: calc(var(--bottom-nav-height) + 12px); }
  #workspace .learn-view.focused-learning .tutor-widget { --tutor-bottom: calc(var(--bottom-nav-height) + 10px); }
  #workspace :is(.dock,.syl-save) { bottom: var(--bottom-nav-height); }
  #study-bottom-nav { position: fixed; z-index: 20; inset: auto 0 0; display: grid; grid-template-columns: repeat(4,1fr); padding: 4px 7px calc(4px + env(safe-area-inset-bottom)); background: #1c203e; color: white; }
  #study-bottom-nav button { min-height: 48px; display: grid; justify-items: center; align-content: center; gap: 2px; font: 560 11px/1.2 var(--sans); color: #ccd1e9; background: transparent; border: 0; border-radius: 8px; }
  #study-bottom-nav button[aria-current="page"] { background: #303651; color: white; }
  #study-bottom-nav button[data-go="new"] { color: #ffe783; }
  #study-bottom-nav .sh-icon { width: 20px; height: 20px; }
  #workspace .topbar { padding: 5px 15px; min-height: 47px; justify-content: space-between; background: #f8f9fc; color: #171833; border-color: var(--study-line); }
  #workspace .topbar .brand { order: -1; font-size: 18px; letter-spacing: -.04em; }
  #workspace .topbar .tiplo-face { width: 28px; }
  #mobile-settings { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid #cbc7df; border-radius: 50%; color: #4d4376; background: #efedf6; font: 650 14px/1 var(--sans); text-transform: uppercase; }
  #workspace .study-subject-strip { display: flex; overflow-x: auto; scroll-snap-type: x proximity; padding: 2px 1px 7px; }
  .study-subject-strip :is(.study-subject,#nb-new) { flex: 0 0 clamp(210px,60vw,270px); scroll-snap-align: start; }
}
@media (max-width: 720px) {
  #workspace[data-maths="false"] #home { padding: 12px 14px 24px; }
  #workspace[data-maths="false"] #home .dashboard-grid, .study-revision-grid { grid-template-columns: minmax(0,1fr); }
  #workspace #home .dashboard-head { min-height: 106px; padding: 10px 14px; gap: 0; }
  #workspace #home .dashboard-head #greeting { font-size: clamp(24px,5.7vw,34px); }
  #home .dashboard-head #home-title { font-size: clamp(16px,3.6vw,21px); }
  #home .study-home-portrait img { width: clamp(76px,22vw,120px); height: 90px; }
  #home .study-home-portrait figcaption { display: none; }
  #home .study-card { padding: 17px; }
  #home-chat-list { max-height: 214px; }
  #home .study-revision-grid #next-step-action { min-height: 44px; }
  .subject-chat-pill { min-height: 30px; }
  #nb-subject-nav { gap: 3px; }
  #nb-subject-nav button { padding-inline: 9px; }
}
@media (max-width: 390px) {
  #nb-intake .nb-file, #home #nb-study { padding-inline: 10px; font-size: 13px; }
  .study-recent-card { flex-wrap: wrap; gap: 8px; }
}
