/* Shared controls and student workspace. All artwork is original OWEN vector art. */
body { background: var(--owen-bg); color: var(--owen-text); }
body :is(h1,h2,h3,.card-title,.workspace-header__brand,.student-auth-card__brand) { font-family: var(--font-display); }
body :is(button,input,select,textarea) { font: inherit; }
body :is(.btn,.icon-btn,.student-auth-tab,.library-year-tab) { transition: background-color 140ms ease, border-color 140ms ease, box-shadow 140ms ease; }
body :is(.btn-primary,.composer-send,.student-auth-submit) { background: var(--owen-accent); color: var(--owen-on-accent); border: 1px solid transparent; box-shadow: 0 3px 0 #11193620; }
body :is(.btn-primary,.composer-send,.student-auth-submit):hover:not(:disabled) { background: var(--owen-accent-hover); color: var(--owen-on-accent); }
body :is(.btn-ghost,.icon-btn) { color: var(--owen-text); }
body :is(.btn-ghost,.icon-btn):hover:not(:disabled) { background: var(--owen-tint); border-color: var(--owen-accent); }
body :is(input:not([type='checkbox']):not([type='radio']),select,textarea) { color: var(--owen-text); border-color: var(--owen-border); }
body :is(.sidebar-input,.sidebar-select,.conversation-search,.student-auth-form input,.student-auth-form select) { background: var(--owen-surface); border: 1px solid var(--owen-border); border-radius: 10px; }
body :is(input[type='checkbox'],input[type='radio'],progress) { accent-color: var(--owen-accent); }
body :is(button,a,input,select,textarea,summary,[tabindex]):focus-visible { outline: 3px solid var(--owen-focus); outline-offset: 3px; }
body :is(.status-pill,.meta-helper,.hint,.saved-placeholder) { color: var(--owen-muted); }
body :is(.status-pill.error,.status-pill.is-error,[data-tone='error']) { color: var(--owen-danger); }
body :is(.status-pill.success,.status-pill.is-success) { color: var(--owen-success); }
body :is(.modal-card,.modal-panel,.dialog-card,.practice-test-builder-dialog,.sources-drawer,.student-guided-overlay__card) { background: var(--owen-surface); color: var(--owen-text); border-color: var(--owen-border); border-radius: 22px; box-shadow: var(--shadow-lg); }
body :is(.practice-test-builder__header,.sources-drawer__header) { background: var(--owen-surface-soft); border-color: var(--owen-border); }
body :is(.practice-test-builder__title,.sources-drawer__title) { font-family: var(--font-display); font-weight: 700; }
body :is(.settings-section,.collectibles-settings,.source-card) { border-color: var(--owen-border); }
body :is(.settings-section-title,.settings-section-summary) { color: var(--owen-text); }
body :is(.settings-section-editor,.settings-compact-section,.settings-account) { background: var(--owen-surface); }
/* Account entry shares the science illustration while retaining all form states. */
body .student-auth-gate { background: var(--owen-navy); background-image: radial-gradient(circle at 20% 15%, #29265e 0, transparent 50%); }
body .student-auth-card { position: relative; overflow: hidden; background: var(--owen-surface); border: 1px solid var(--owen-border); border-radius: 26px; box-shadow: 0 24px 70px #04091855; }
body .student-auth-card__brand { padding: 10px 0 16px; font-weight: 700; letter-spacing: .06em; color: var(--owen-text); }
body .student-auth-card__brand::after { content: ''; display: inline-block; vertical-align: middle; margin-left: 20px; width: 70px; height: 62px; background: url('/ui/illustrations/ask.svg') center/contain no-repeat; }
body .student-auth-card__eyebrow { color: var(--owen-accent); font-weight: 700; }
body .student-auth-tabs { border-color: var(--owen-border); background: var(--owen-surface-soft); }
body .student-auth-tab.is-active { background: var(--owen-accent); color: var(--owen-on-accent); }
/* Landing: an illustrated world with two clear account entrances. */
body[data-route='landing'] .landing.landing--canvas { background: var(--owen-navy); color: #f5f7fc; }
body[data-route='landing'] .landing--canvas > .landing-canvas { max-width: 1500px; padding: 30px clamp(24px,5vw,80px) 44px; grid-template-columns: 1.1fr 1fr; gap: 30px 32px; }
body[data-route='landing'] .landing-canvas__header { padding-bottom: 20px; border-bottom: 1px solid #435078; display: flex; justify-content: space-between; align-items: center; }
body[data-route='landing'] .landing-wordmark { width: 158px; margin: 0; color: #f5f7fc; }
body[data-route='landing'] .landing-wordmark__lettering text { font-family: var(--font-display); font-weight: 700; letter-spacing: 3px; }
.illustrated-brand-note { font-size: .75rem; letter-spacing: .12em; color: #bac5e0; text-transform: uppercase; font-weight: 700; }
body[data-route='landing'] .landing-content { gap: 28px; }
body[data-route='landing'] .landing-tagline { font: 700 clamp(2.8rem,5.1vw,5.6rem)/1.05 var(--font-display); color: #f5f7fc; letter-spacing: -.025em; max-width: 12ch; }
body[data-route='landing'] .landing-tagline > span:last-child { color: var(--owen-cyan); }
.illustrated-landing-intro { color: #bac5e0; max-width: 39ch; font-size: 1.05rem; line-height: 1.7; margin: -8px 0 0; }
body[data-route='landing'] .landing-canvas__orbit { background: #29265e; opacity: .5; top: 55%; width: 580px; }
body[data-route='landing'] .landing-canvas__orbit-line { display: none; }
body[data-route='landing'] .landing-mascot { width: 100%; max-width: 620px; aspect-ratio: 520/480; }
.illustrated-landing-art { width: 100%; height: auto; }
body[data-route='landing'] .landing-actions { gap: 14px; }
body[data-route='landing'] .landing-actions .landing-button { aspect-ratio: auto; min-height: 170px; padding: 0; border: 1px solid #626595; border-radius: 22px; background: #29265e; box-shadow: none; transform: none; }
body[data-route='landing'] .landing-actions .landing-button:hover { background: #393479; border-color: #42c9e8; transform: translateY(-2px); }
body[data-route='landing'] .landing-actions .landing-button > .landing-button__card { display: flex; flex-direction: row; align-items: center; justify-content: center; gap: 12px; padding: 22px 16px; background: transparent; border: 0; box-shadow: none; }
body[data-route='landing'] .landing-button .landing-icon-wrapper { position: static; width: 76px; height: 80px; flex: 0 0 76px; transform: none; margin: 0; }
body[data-route='landing'] .landing-button .landing-icon { width: 76px; height: 80px; object-fit: contain; transform: none; filter: none; }
body[data-route='landing'] .landing-button .landing-text-group { position: static; transform: none; margin: 0; padding: 0; width: auto; max-width: none; }
body[data-route='landing'] .landing-button .landing-title { background: transparent; box-shadow: none; border: 0; padding: 0; color: #f5f7fc; font: 700 clamp(1rem,1.7vw,1.35rem)/1.25 var(--font-display); transform: none; }
/* Sidebar and conversation frame. */
body[data-route='student'] .student-workspace-grid { background: var(--owen-bg); }
body[data-route='student'] .student-sidebar { background: var(--owen-surface); border-color: var(--owen-border); box-shadow: none; }
body[data-route='student'] .sidebar-header { background: var(--owen-surface-soft); color: var(--owen-text); border-bottom: 1px solid var(--owen-border); }
/* MyStats keeps its existing shape; these explicit tokens override its legacy important aliases. */
body[data-route='student'] .sidebar-header .mystats-nav { background: var(--owen-surface) !important; color: var(--owen-text) !important; border-color: var(--owen-border) !important; }
body[data-route='student'] .sidebar-header .mystats-nav:is(:hover,[aria-expanded='true']) { background: var(--owen-tint) !important; color: var(--owen-accent) !important; border-color: var(--owen-accent) !important; }
body[data-route='student'] .sidebar-header .mystats-nav__arrow { color: var(--owen-accent); }
body[data-route='student'] .student-sidebar .sidebar-tabs .sidebar-section-tabs { gap: 6px; }
body[data-route='student'] .student-sidebar .sidebar-tabs .sidebar-section-tab { background: var(--owen-surface); color: var(--owen-text); border: 1px solid var(--owen-border); border-radius: 12px; padding: 9px 8px; min-height: 46px; box-shadow: none; }
body[data-route='student'] .student-sidebar .sidebar-tabs .sidebar-section-tab:hover:not(:disabled) { background: var(--owen-tint); color: var(--owen-text); border-color: var(--owen-accent); }
body[data-route='student'] .student-sidebar .sidebar-tabs .sidebar-section-tab:is(.is-active,[aria-pressed='true']) { background: var(--owen-tint); color: var(--owen-accent); border-color: var(--owen-accent); }
body[data-route='student'] .sidebar-header .icon-btn { background: var(--owen-surface); color: var(--owen-text); border-color: var(--owen-border); }
body[data-route='student'] .sidebar-header .icon-btn:hover:not(:disabled) { background: var(--owen-tint); border-color: var(--owen-accent); }
body[data-route='student'] .sidebar-card { background: var(--owen-surface); border: 0; border-radius: 14px; box-shadow: none; }
body[data-route='student'] .library-year-tabs { gap: 4px; background: var(--owen-surface-soft); border-radius: 12px; padding: 4px; }
body[data-route='student'] .library-year-tab { border-radius: 8px; color: var(--owen-muted); background: transparent; }
body[data-route='student'] .library-year-tab[aria-selected='true'] { background: var(--owen-accent); color: var(--owen-on-accent); box-shadow: none; }
body[data-route='student'] .student-library__action-dock { background: var(--owen-surface-soft); border: 1px solid var(--owen-border); border-radius: 14px; }
body[data-route='student'] .workspace-header { background: var(--owen-surface); border-bottom: 1px solid var(--owen-border); box-shadow: none; }
body[data-route='student'] .workspace-header__brand { color: var(--owen-text); font-family: var(--font-display); font-weight: 700; letter-spacing: .02em; }
body[data-route='student'] .workspace-header__brand::after { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--owen-coral); margin-left: 5px; }
body[data-route='student'] .conversation-lane { background: var(--owen-surface); border-color: var(--owen-border); }
body[data-route='student'] .chat-pane { background: var(--owen-bg); }
/* Welcome actions stay compact and use the shared reading typography. */
body[data-route='student'] .student-empty-state { padding: clamp(20px,3vw,42px); gap: 24px; background: var(--owen-surface); border-radius: 0; }
body[data-route='student'] .student-empty-state::before { display: none; }
body[data-route='student'] .student-empty-state__hero { display: grid; grid-template-columns: minmax(0,1fr); align-items: center; gap: 14px; width: 100%; }
body[data-route='student'] .student-empty-state__hero-copy { min-width: 0; gap: 14px; }
body[data-route='student'] .student-empty-state__eyebrow { margin: 0; color: var(--owen-accent); font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
body[data-route='student'] .student-empty-state__title { font-family: var(--font-display); font-size: clamp(1.8rem,2.6vw,3.05rem); font-weight: 700; line-height: 1.2; max-width: 30ch; color: var(--owen-text); }
body[data-route='student'] .student-empty-state__body { font-size: 1rem; color: var(--owen-muted); line-height: 1.6; }
body[data-route='student'] .student-empty-state__tutorial-callout { margin: 2px 0; }
body[data-route='student'] .student-empty-state__badge--tutorial { background: var(--owen-indigo); color: #f5f7fc; border: 1px solid #7864e8; min-height: 56px; min-width: 235px; border-radius: 14px; padding: 9px 14px; gap: 0 12px; box-shadow: none; }
body[data-route='student'] .student-empty-state__badge-label { font-size: .95rem; }
body[data-route='student'] .student-empty-state__badge-meta { font-size: .72rem; color: #d8d1ff; }
body[data-route='student'] .student-empty-state__play { width: 34px; height: 34px; border: 0; background: #7864e8; box-shadow: none; }
body[data-route='student'] .student-empty-state__actions { gap: 14px; grid-template-columns: repeat(2,minmax(0,1fr)); }
body[data-route='student'] .student-empty-state__actions .student-empty-state__action-btn { --module-color: var(--owen-cyan); position: relative; min-height: 112px; padding: 18px; gap: 14px; border: 1px solid var(--owen-border); border-left: 4px solid var(--module-color); border-radius: 18px; background: var(--owen-surface-soft); box-shadow: none; }
body[data-route='student'] .student-empty-state__actions .student-empty-state__action-btn:nth-child(2) { --module-color: var(--owen-violet); }
body[data-route='student'] .student-empty-state__actions .student-empty-state__action-btn:nth-child(3) { --module-color: var(--owen-coral); }
body[data-route='student'] .student-empty-state__actions .student-empty-state__action-btn:nth-child(4) { --module-color: var(--owen-teal); }
body[data-route='student'] .student-empty-state__actions .student-empty-state__action-btn:hover { background: var(--owen-tint); border-color: var(--owen-accent); box-shadow: var(--shadow-sm); }
body[data-route='student'] .student-empty-state__action-copy strong { font-family: var(--font-display); font-size: 1.1rem; color: var(--owen-text); font-weight: 700; }
body[data-route='student'] .student-empty-state__action-copy > span { font-size: .82rem; color: var(--owen-muted); }
body[data-route='student'] .student-empty-state__action-copy br { display: none; }
body[data-route='student'] .student-empty-state__action-icon { width: 64px; height: 64px; object-fit: contain; }
body[data-route='student'] .student-empty-state__action-arrow { font-size: 1.4rem; color: var(--owen-accent); }
/* Conversation, study dialogs and ancillary workflows inherit the same components. */
body[data-route='student'] .composer-card { background: var(--owen-surface); border: 1px solid var(--owen-border); border-radius: 18px; box-shadow: var(--shadow-sm); }
body[data-route='student'] .chat-input { background: transparent; color: var(--owen-text); }
body[data-route='student'] .bubble.user { background: var(--owen-tint); border-color: var(--owen-border); color: var(--owen-text); border-radius: 18px 18px 5px 18px; }
body[data-route='student'] .bubble.assistant { background: var(--owen-surface); color: var(--owen-text); }
body[data-route='student'] :is(.conversation-item,.library-nav-item,.library-item,.settings-section) { border-color: var(--owen-border); }
body[data-route='student'] :is(.conversation-item.is-active,.library-nav-item.is-selected) { background: var(--owen-tint); }
body :is(.mystats-workspace,.statistics-workspace,.collectibles-dialog) { background: var(--owen-surface); color: var(--owen-text); }
body :is(.mystats-card,.statistics-card,.collectible-card) { border-color: var(--owen-border); box-shadow: var(--shadow-sm); }
body .owen-lab-launch { background: var(--owen-tint); color: var(--owen-text); border-color: var(--owen-border); }
body .owen-lab-launch small { color: var(--owen-muted); }
@media (max-width: 1000px) {
 body[data-route='landing'] .landing--canvas > .landing-canvas { grid-template-columns: 1fr 1fr; gap: 24px; }
 body[data-route='landing'] .landing-actions .landing-button > .landing-button__card { flex-direction: column; gap: 8px; }
 body[data-route='landing'] .landing-tagline { font-size: clamp(2.4rem,5.8vw,4.4rem); }
}
@media (max-width: 700px) {
 body[data-route='landing'] .landing--canvas > .landing-canvas { grid-template-columns: 1fr; padding: 22px 22px 36px; }
 body[data-route='landing'] .landing-canvas__header { grid-column: 1; }
 body[data-route='landing'] .landing-content { grid-column: 1; grid-row: 2; gap: 23px; }
 body[data-route='landing'] .landing-mascot { grid-column: 1; grid-row: 3; max-width: 370px; margin: -8px auto 0; }
 body[data-route='landing'] .landing-wordmark { width: 125px; }
 .illustrated-brand-note { font-size: .62rem; max-width: 18ch; text-align: right; }
 body[data-route='landing'] .landing-tagline { font-size: clamp(2.6rem,10vw,4rem); }
 body[data-route='landing'] .landing-actions .landing-button { min-height: 150px; }
 body[data-route='landing'] .landing-button .landing-title { font-size: 1.05rem; }
 body[data-route='student'] .student-empty-state__hero { grid-template-columns: minmax(0,1fr); }
 body[data-route='student'] .student-empty-state__title { font-size: 1.9rem; }
 body[data-route='student'] .student-empty-state__actions { grid-template-columns: 1fr; }
 body[data-route='student'] .student-empty-state__actions .student-empty-state__action-btn { min-height: 94px; padding: 12px 14px; }
 body[data-route='student'] .student-empty-state__action-icon { width: 54px; height: 54px; }
}
@media (prefers-reduced-motion: reduce) {
 body *, body *::before, body *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
/* Retire the old masked monochrome icon and floating title-chip layers. */
body[data-route='landing'] .landing-button .landing-icon-wrapper::after,
body[data-route='landing'] .landing-button .landing-text-group::before { content: none; display: none; }
body[data-route='landing'] .landing-button .landing-icon--raster { opacity: 1; }
body[data-route='landing'] .landing-content { display: flex; }
body[data-route='landing'] .landing-button .landing-title__line { white-space: nowrap; }
body[data-route='landing'] .landing-button .landing-text-group { opacity: 1; }
@media (max-width: 700px) {
 body[data-route='landing'] .landing-actions { grid-row: auto; grid-column: auto; }
 body[data-route='landing'] .landing-mascot { grid-row: 3; }
}
@media (max-width: 360px) {
 body[data-route='landing'] .landing-actions { gap: 10px; }
 body[data-route='landing'] .landing-actions .landing-button > .landing-button__card { padding-inline: 8px; }
 body[data-route='landing'] .landing-button .landing-title { font-size: .9rem; }
}

/* Requested geometric wordmarks; preserve the original mascot and entrance symbols. */
body[data-route='landing'] .landing-wordmark__lettering text { font-family: var(--font-display); font-weight: 700; letter-spacing: 3px; }
body[data-route='student'] .workspace-header__brand { font-family: var(--font-display); font-weight: 700; letter-spacing: .01em; }
body[data-route='student'] .workspace-header__brand::after { content: none; }
body .student-auth-card__brand { font-family: var(--font-brand); font-weight: 700; }
body .student-auth-card__brand::after { content: none; }
body[data-route='landing'] .landing-mascot { aspect-ratio: 1; }
body[data-route='landing'] .landing-button .landing-icon { width: 100px; height: 66px; }
body[data-route='landing'] .landing-button .landing-icon-wrapper { position: relative; width: 100px; height: 76px; flex-basis: 100px; }
body[data-route='landing'] .landing-button .landing-icon-wrapper::after { content: ''; display: block; position: absolute; inset: 0; width: 100%; height: 100%; background: linear-gradient(145deg,#a0e1df 8%,#68c3c9 52%,#42c9e8 100%); mask-repeat: no-repeat; mask-position: center; mask-size: contain; -webkit-mask-repeat: no-repeat; -webkit-mask-position: center; -webkit-mask-size: contain; }
body[data-route='landing'] .landing-button .landing-icon--raster { opacity: 0; }
@media(max-width:1000px) { body[data-route='landing'] .landing-button .landing-icon-wrapper { flex-basis: 76px; } }
body[data-route='landing'] .landing-actions .landing-button.student { background: #29265e; border-color: #7864e8; }
body[data-route='landing'] .landing-actions .landing-button.faculty { background: #232e55; border-color: #596895; }
body[data-route='landing'] .landing-actions .landing-button:hover { background: #393479; border-color: #42c9e8; }
body[data-route='landing'] .landing-button .landing-title { color: #f5f7fc; }
body[data-route='landing'] .landing-button.student .landing-icon-wrapper::after { background: #42c9e8; }
body[data-route='landing'] .landing-button.faculty .landing-icon-wrapper::after { background: #ffd166; }

/* The student route's legacy send rule has higher specificity than shared buttons. */
body[data-route='student'] .composer-send,
body[data-route='student'] .composer-send:hover:not(:disabled),
body[data-route='student'] .composer-send:focus-visible { color: var(--owen-on-accent); }

/* Original front-page copy is retained verbatim; keep each phrase legible. */
body[data-route='landing'] .landing-tagline { max-width: 20ch; font-size: clamp(2rem,3.5vw,4rem); }
@media (max-width:700px) { body[data-route='landing'] .landing-tagline { font-size: clamp(1.8rem,7.5vw,3rem); } }
