/* Hallmark · v2.0.0 · redesign: full · scope: app · theme: brand · shape: app screen · signature: the paper review card · genre: modern-minimal */
/* Critique: quiet charcoal chrome gives the learner’s material room; large activity rows make study modes a first-class destination. */
/* Unslop by Damir Sokolovsky (@heydamir), CC BY 4.0. Applied to spacing, type, controls and restraint. */
:root {
  color-scheme: dark;
  --sidebar-width: 256px;
  --font-ui: "Segoe UI", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --font-figures: ui-monospace, "SFMono-Regular", Consolas, monospace;
  --bg: #111110;
  --shell: #151514;
  --panel: #1b1b19;
  --panel-2: #232320;
  --panel-3: #2b2b27;
  --line: #30302c;
  --line-2: #474740;
  --text: #f4f1e9;
  --muted: #b2b0a6;
  --subtle: #929288;
  --orange: #ff8b4d;
  --orange-2: #ffab7c;
  --orange-soft: #34241a;
  --orange-line: #6b432b;
  --on-accent: #211207;
  --paper: #f1eadb;
  --paper-ink: #26231c;
  --paper-muted: #68604f;
  --paper-line: #c5bcaa;
  --green: #9cceb1;
  --green-bg: #202f26;
  --green-line: #456b51;
  --red: #f5a598;
  --red-bg: #382321;
  --red-line: #835049;
  --yellow: #dcc28a;
  --overlay: #000000b3;
  --shadow: 0 16px 48px #00000040;
  --radius: 16px;
  --radius-control: 10px;
  --duration: 160ms;
  --ease: cubic-bezier(.22, 1, .36, 1);
  font-family: var(--font-ui);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}
* { box-sizing: border-box; }
html { min-width: 320px; overflow-x: clip; background: var(--bg); }
body { margin: 0; min-height: 100vh; overflow-x: clip; color: var(--text); background: var(--bg); font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button { color: inherit; cursor: pointer; }
button, a, input, select, textarea, [tabindex] { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--orange); outline-offset: 4px; }
button:disabled { opacity: .5; cursor: not-allowed; }
a { color: inherit; text-decoration: none; }
button, a { touch-action: manipulation; }
button { transition: background-color var(--duration) var(--ease), border-color var(--duration) var(--ease), color var(--duration) var(--ease); }
svg { display: block; width: 20px; height: 20px; flex-shrink: 0; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { text-wrap: balance; min-width: 0; overflow-wrap: break-word; font-weight: 600; color: var(--text); }
small { font-size: 12px; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.mono, .stat-value, .focus-time, .score-big { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--font-figures); }
.eyebrow, .section-kicker { display: none; }
.workspace-label, .small-label { font-size: 12px; font-family: var(--font-ui); color: var(--subtle); letter-spacing: 0; text-transform: none; }
.button { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; gap: 8px; padding: 12px 16px; border: 1px solid transparent; border-radius: var(--radius-control); font-size: 14px; font-weight: 600; line-height: 1.4; white-space: nowrap; }
.button-primary { background: var(--orange); color: var(--on-accent); }
.button-primary:hover { background: var(--orange-2); }
.button-secondary { border-color: var(--line-2); background: var(--panel-2); color: var(--text); }
.button-secondary:hover { border-color: var(--subtle); background: var(--panel-3); }
.button-ghost { background: transparent; color: var(--muted); }
.button-ghost:hover { background: var(--panel-2); color: var(--text); }
.button-danger { color: var(--red); background: var(--red-bg); border-color: var(--red-line); }
.button-danger:hover { color: var(--text); border-color: var(--red); }
.button-small { min-height: 44px; padding: 8px 12px; font-size: 13px; }
.button-wide { width: 100%; min-height: 52px; }
.icon-button, .icon-tiny { display: inline-flex; min-width: 44px; min-height: 44px; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: var(--radius-control); background: transparent; color: var(--muted); }
.icon-button:hover, .icon-tiny:hover { background: var(--panel-2); color: var(--text); border-color: var(--line-2); }
.text-button, .subtle-link { border: 0; background: none; color: var(--orange-2); padding: 12px 0; min-height: 44px; font-size: 14px; font-weight: 500; }
.text-button:hover, .subtle-link:hover { text-decoration: underline; text-underline-offset: 4px; }
.brand-lockup { display: inline-flex; align-items: center; gap: 12px; font-size: 24px; font-weight: 600; letter-spacing: -.5px; }
.brand-dot { color: var(--orange); }
.brand-mark { width: 36px; height: 36px; display: grid; place-items: center; flex-shrink: 0; border: 1px solid var(--orange); border-radius: 10px; background: transparent; color: var(--orange); font-size: 24px; line-height: 1; font-weight: 600; }
.brand-mark-large { width: 48px; height: 48px; font-size: 32px; border-radius: 12px; }
.boot-screen { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; z-index: 60; background: var(--bg); transition: opacity var(--duration) var(--ease); }
.boot-screen.hide { opacity: 0; pointer-events: none; }
.boot-screen p { color: var(--muted); font-size: 14px; }
.boot-track { width: 96px; height: 2px; overflow: clip; background: var(--line); }
.boot-track i { display: block; height: 100%; width: 40%; background: var(--orange); animation: loading 1.2s var(--ease) infinite; }
@keyframes loading { from { transform: translateX(-110%); } to { transform: translateX(360%); } }
.no-script { position: fixed; inset: 0; z-index: 70; display: grid; align-content: center; justify-items: center; background: var(--bg); padding: 32px; }
.no-script p { max-width: 480px; color: var(--muted); }
.auth-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(420px, .9fr); min-height: 100vh; }
.auth-story { display: flex; flex-direction: column; justify-content: space-between; gap: 64px; min-width: 0; padding: 48px 64px 32px; background: var(--shell); border-right: 1px solid var(--line); }
.auth-story-copy { max-width: 600px; padding: 32px 0; }
.auth-story-copy h1 { font-size: 88px; font-weight: 500; line-height: .98; letter-spacing: -4px; margin-bottom: 28px; }
.auth-story-copy h1::first-line { color: var(--orange); }
.auth-intro { font-size: 20px; line-height: 1.5; max-width: 420px; color: var(--muted); margin-bottom: 48px; }
.auth-methods { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; max-width: 420px; }
.auth-methods li { display: grid; grid-template-columns: 40px minmax(0, 1fr); padding: 16px 0; border-top: 1px solid var(--line); column-gap: 16px; }
.auth-methods span { grid-row: span 2; color: var(--subtle); font-family: var(--font-figures); font-size: 12px; padding-top: 4px; }
.auth-methods strong { font-size: 16px; font-weight: 500; }
.auth-methods p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.auth-foot { margin: 0; font-size: 12px; }
.auth-panel { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 56px 48px; }
.auth-card { width: min(100%, 400px); }
.auth-switch { display: flex; gap: 28px; border-bottom: 1px solid var(--line); margin-bottom: 40px; }
.auth-tab { min-height: 48px; padding: 12px 0; background: transparent; border: 0; border-bottom: 2px solid transparent; font-size: 14px; color: var(--muted); margin-bottom: -1px; }
.auth-tab.active { color: var(--text); border-color: var(--orange); }
.auth-heading { margin-bottom: 32px; }
.auth-heading h2 { font-size: 28px; font-weight: 500; line-height: 1.2; margin: 0 0 12px; letter-spacing: -.5px; }
.auth-heading p { font-size: 15px; margin: 0; line-height: 1.5; }
.auth-note { font-size: 12px; color: var(--subtle); margin: 24px 0 0; line-height: 1.6; }
.auth-panel-foot { position: absolute; bottom: 28px; display: flex; justify-content: space-between; gap: 16px; width: min(400px, calc(100% - 96px)); color: var(--subtle); font-size: 12px; }
.auth-mobile-brand { display: none; }
.form-stack, .create-form { display: grid; gap: 24px; }
.field { display: grid; gap: 8px; min-width: 0; }
.field > span, .field-row > span { font-size: 14px; font-weight: 500; color: var(--text); }
.field input, .field textarea, .field select, .select, .filter-select, .search-field input, .word-input { width: 100%; min-height: 48px; border: 1px solid var(--line-2); background: var(--bg); border-radius: var(--radius-control); padding: 12px 16px; color: var(--text); font-size: 15px; line-height: 1.4; }
.field input::placeholder, .field textarea::placeholder, .search-field input::placeholder, .word-input::placeholder { color: var(--subtle); opacity: 1; }
.field input:hover, .field textarea:hover, .field select:hover, .select:hover, .filter-select:hover { border-color: var(--subtle); }
.field input:focus-visible, .field textarea:focus-visible, .field select:focus-visible, .select:focus-visible, .filter-select:focus-visible, .search-field input:focus-visible { outline: 2px solid var(--orange); outline-offset: 4px; }
.field textarea { min-height: 168px; resize: vertical; line-height: 1.6; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.field-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.field-hint { font-size: 12px; line-height: 1.5; color: var(--subtle); }
.form-error { border: 1px solid var(--red-line); color: var(--red); background: var(--red-bg); border-radius: var(--radius-control); padding: 12px 16px; font-size: 14px; line-height: 1.5; }
.app-shell { display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); min-height: 100vh; }
.sidebar { display: flex; flex-direction: column; position: fixed; top: 0; left: 0; width: var(--sidebar-width); height: 100vh; padding: 28px 16px 16px; border-right: 1px solid var(--line); background: var(--shell); }
.app-brand { margin: 0 12px 40px; }
.workspace-label { margin: 0 12px 12px; }
.main-nav { display: grid; gap: 4px; }
.nav-item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; padding: 12px; border: 1px solid transparent; border-radius: var(--radius-control); background: transparent; color: var(--muted); text-align: left; font-size: 14px; line-height: 1.4; font-weight: 500; }
.nav-item:hover { color: var(--text); background: var(--panel-2); }
.nav-item.active { background: var(--panel-2); border-color: var(--line); color: var(--text); }
.nav-item.active .nav-icon { color: var(--orange); }
.nav-icon { width: 20px; height: 20px; display: grid; place-items: center; color: var(--subtle); }
.nav-count { margin-left: auto; font-size: 12px; font-variant-numeric: tabular-nums; color: var(--subtle); }
.sidebar-bottom { margin-top: auto; padding-top: 32px; }
.streak-mini { display: flex; gap: 12px; align-items: center; padding: 16px 12px; border-top: 1px solid var(--line); margin-bottom: 12px; }
.streak-flame { color: var(--muted); }
.streak-mini strong, .streak-mini small { display: block; }
.streak-mini strong { font-size: 14px; font-weight: 500; }
.streak-mini small { font-size: 12px; color: var(--subtle); margin-top: 4px; }
.profile-mini { display: flex; gap: 12px; align-items: center; width: 100%; background: transparent; border: 0; border-radius: var(--radius-control); min-height: 56px; padding: 8px 12px; text-align: left; }
.profile-mini:hover { background: var(--panel-2); }
.avatar { display: grid; place-items: center; flex-shrink: 0; width: 36px; height: 36px; border-radius: 50%; color: var(--orange-2); background: var(--orange-soft); border: 1px solid var(--orange-line); font-size: 14px; font-weight: 600; }
.profile-mini-copy { flex: 1; min-width: 0; }
.profile-mini-copy strong, .profile-mini-copy small { display: block; overflow: clip; text-overflow: ellipsis; white-space: nowrap; }
.profile-mini-copy strong { font-size: 14px; font-weight: 500; }
.profile-mini-copy small { color: var(--subtle); font-size: 12px; margin-top: 4px; }
.main-column { min-width: 0; grid-column: 2; }
.topbar { display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 10; min-height: 72px; padding: 12px 40px; border-bottom: 1px solid var(--line); background: var(--bg); }
.breadcrumbs { display: flex; gap: 12px; color: var(--subtle); font-size: 13px; }
.breadcrumbs strong { color: var(--muted); font-weight: 400; }
.crumb-slash { color: var(--line-2); }
.topbar-actions { display: flex; gap: 12px; align-items: center; }
.search-button { width: auto; gap: 20px; padding: 8px 12px; }
.search-button span { display: flex; }
.search-button kbd { font-family: var(--font-ui); font-size: 12px; color: var(--subtle); }
.avatar-small { width: 44px; height: 44px; cursor: pointer; }
.page-content { width: min(100%, 1400px); margin: 0 auto; padding: 40px 48px 80px; }
.mobile-brand, .mobile-nav { display: none; }
.section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 32px; }
.section-head h1, .hero-title { font-size: 32px; font-weight: 500; line-height: 1.2; margin: 0 0 12px; letter-spacing: -.6px; }
.section-head p { font-size: 15px; max-width: 600px; color: var(--muted); line-height: 1.6; margin: 0; }
.section-actions { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.home-hero { display: flex; justify-content: space-between; align-items: center; gap: 40px; min-height: 240px; margin-bottom: 40px; padding: 8px 0 32px; border-bottom: 1px solid var(--line); }
.hero-copy { min-width: 0; max-width: 680px; }
.hero-title { font-size: 44px; margin-bottom: 20px; max-width: 620px; letter-spacing: -1px; }
.hero-title em { font-style: normal; color: inherit; }
.hero-copy > p { font-size: 16px; line-height: 1.6; color: var(--muted); max-width: 560px; margin: 0 0 28px; }
.hero-action-row { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-art, .orbit-ring, .hero-spark, .quote-card, .online-dot { display: none; }
.stat-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin-bottom: 40px; border-bottom: 1px solid var(--line); padding-bottom: 28px; }
.stat-card { padding: 0 24px; border-left: 1px solid var(--line); }
.stat-card:first-child { padding-left: 0; border-left: 0; }
.stat-top { color: var(--muted); font-size: 13px; line-height: 1.4; }
.stat-top > span:last-child:not(:first-child) { display: none; }
.stat-value { font-variant-numeric: tabular-nums; font-size: 32px; line-height: 1.25; font-weight: 500; margin: 12px 0 8px; }
.stat-caption { color: var(--subtle); font-size: 12px; line-height: 1.4; }
.home-columns { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 32px; }
.panel { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.panel-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 24px; }
.panel-header h2 { font-size: 18px; margin: 0 0 8px; font-weight: 500; }
.panel-header p { font-size: 13px; margin: 0; line-height: 1.5; color: var(--muted); }
.panel-body { padding: 0 24px 24px; }
.deck-list { display: grid; }
.deck-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 16px; padding: 20px 0; border-top: 1px solid var(--line); }
.deck-cover { display: grid; place-items: center; align-self: stretch; min-height: 52px; border-left: 3px solid var(--orange); background: var(--panel-2); font-size: 13px; color: var(--muted); border-radius: 0 8px 8px 0; }
.deck-row h3 { font-size: 15px; font-weight: 500; margin: 0 0 4px; line-height: 1.5; }
.deck-row p { font-size: 12px; color: var(--subtle); margin: 0; }
.review-callout { display: flex; align-items: center; gap: 12px; padding: 16px 0 20px; }
.review-callout > div:nth-child(2) { flex: 1; }
.review-callout strong, .review-callout small { display: block; }
.review-callout strong { font-size: 14px; font-weight: 500; }
.review-callout small { font-size: 12px; color: var(--muted); margin-top: 4px; }
.review-icon { width: 32px; color: var(--orange); font-size: 24px; }
.focus-panel .panel-header { padding-bottom: 0; }
.focus-time { display: flex; justify-content: center; font-size: 48px; letter-spacing: -1px; padding: 32px 16px; line-height: 1; }
.focus-time > span:nth-child(2) { color: var(--subtle); padding: 0 4px; }
.focus-controls { display: flex; justify-content: center; gap: 4px; padding: 0 20px 24px; }
.quick-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-top: 32px; }
.quick-card { display: flex; align-items: flex-start; gap: 16px; min-height: 100px; border: 0; border-top: 1px solid var(--line); background: transparent; padding: 24px 0; color: var(--muted); text-align: left; }
.quick-card:hover { color: var(--text); border-color: var(--orange-line); }
.quick-card strong, .quick-card small { display: block; }
.quick-card strong { font-size: 15px; font-weight: 500; color: var(--text); }
.quick-card small { color: var(--subtle); font-size: 13px; margin-top: 8px; }
.quick-icon { width: 24px; color: var(--muted); font-size: 24px; line-height: 1.25; }
.empty-state { display: grid; justify-items: start; gap: 12px; padding: 40px 24px; min-height: 260px; align-content: center; }
.empty-symbol { color: var(--orange); font-size: 28px; margin-bottom: 4px; }
.empty-state strong { font-size: 20px; font-weight: 500; }
.empty-state p { max-width: 460px; color: var(--muted); font-size: 15px; line-height: 1.6; margin: 0 0 8px; }
.toolbar-row { display: flex; align-items: center; gap: 16px; margin-bottom: 28px; }
.search-field { flex: 1; min-width: 0; }
.search-field input { background: var(--panel); }
.filter-select { width: 220px; background: var(--panel); }
.deck-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.library-card { display: flex; flex-direction: column; min-height: 272px; padding: 24px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.library-card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 24px; }
.subject-chip { display: inline-flex; align-items: center; color: var(--muted); font-size: 12px; line-height: 1.5; }
.library-card h3 { font-size: 20px; font-weight: 500; line-height: 1.3; margin: 0 0 12px; }
.deck-description { font-size: 14px; color: var(--muted); line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: clip; margin: 0 0 24px; }
.library-card-bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line); }
.library-card-bottom small { font-size: 12px; color: var(--subtle); }
.card-actions { display: flex; gap: 4px; }
.content-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 32px; align-items: start; }
.create-card, .plan-create, .studio-form { padding: 28px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.create-side { display: grid; gap: 28px; }
.create-source-picker { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; padding: 4px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; }
.create-source-choice { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 8px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--muted); font-size: 14px; font-weight: 500; line-height: 1.3; }
.create-source-choice:hover { color: var(--text); background: var(--panel); }
.create-source-choice[aria-pressed="true"] { color: var(--text); background: var(--panel-2); border-color: var(--line-2); }
.create-source-choice[aria-pressed="true"] svg { color: var(--orange); }
.create-source-choice svg { width: 17px; height: 17px; }
.create-form #deck-topic { min-height: 60px; }
.studio-allowance { display: grid; gap: 4px; padding-top: 16px; border-top: 1px solid var(--line); }
.studio-allowance strong { color: var(--text); font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.side-note { padding: 0 0 24px; border-bottom: 1px solid var(--line); }
.side-note h3 { font-size: 16px; font-weight: 500; margin-bottom: 12px; }
.side-note p { font-size: 14px; color: var(--muted); line-height: 1.7; margin: 0; }
.format-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }
.format-pill { font-size: 12px; color: var(--subtle); }
.upload-zone { display: flex; gap: 16px; align-items: center; position: relative; min-height: 104px; padding: 20px; border: 1px dashed var(--line-2); border-radius: 12px; background: var(--bg); cursor: pointer; }
.upload-zone:hover { border-color: var(--orange); }
.upload-zone input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.upload-zone:focus-within { outline: 2px solid var(--orange); outline-offset: 4px; }
.upload-icon { color: var(--muted); font-size: 28px; }
.upload-copy { flex: 1; min-width: 0; }
.upload-copy strong, .upload-copy small { display: block; }
.upload-copy strong { font-size: 14px; font-weight: 500; }
.upload-copy small { font-size: 12px; color: var(--subtle); margin-top: 8px; }
.notice-inline { padding: 16px; border-left: 2px solid var(--orange-line); color: var(--muted); background: var(--panel); font-size: 13px; line-height: 1.7; }
.notice-inline strong { color: var(--text); font-weight: 500; }
.study-tools { display: flex; align-items: center; gap: 12px; margin: 0 0 24px !important; }
.study-tools .select { width: auto; min-width: 160px; background: var(--panel); }
.study-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 32px; align-items: start; }
.study-main { overflow: clip; }
.study-stage { padding: 28px; }
.progress-dots { display: flex; justify-content: center; gap: 4px; margin-bottom: 24px; }
.progress-dot { width: 20px; height: 3px; background: var(--line-2); border-radius: 2px; }
.progress-dot.active { background: var(--orange); }
.flashcard { display: grid; place-items: center; min-height: 340px; position: relative; padding: 40px; background: var(--paper); color: var(--paper-ink); border-left: 6px solid var(--orange); border-radius: 12px; cursor: pointer; perspective: 900px; }
.flashcard-inner { width: 100%; min-height: 200px; position: relative; display: grid; place-items: center; transform-style: preserve-3d; transition: transform 320ms var(--ease); }
.flashcard.flipped .flashcard-inner { transform: rotateY(180deg); }
.flash-face { width: 100%; backface-visibility: hidden; text-align: center; }
.flash-back { position: absolute; inset: 0; display: grid; place-items: center; transform: rotateY(180deg); }
.flashcard .small-label { color: var(--paper-muted); display: block; margin-bottom: 24px; }
.card-prompt { font-size: 28px; line-height: 1.5; font-weight: 500; color: var(--paper-ink); overflow-wrap: anywhere; }
.flash-hint { position: absolute; bottom: 20px; color: var(--paper-muted); font-size: 12px; }
.study-controls { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 24px; flex-wrap: wrap; }
.study-controls-left, .study-controls-right { display: flex; gap: 8px; align-items: center; }
.study-aside { display: grid; gap: 24px; }
.mode-card { padding: 20px; }
.mode-card h3 { font-size: 15px; font-weight: 500; margin: 0 0 20px; }
.game-grid { display: grid; gap: 4px; }
.game-tile { display: flex; align-items: center; gap: 12px; min-height: 48px; border: 1px solid transparent; background: transparent; border-radius: 8px; padding: 12px 8px; color: var(--muted); text-align: left; }
.game-tile:hover { background: var(--panel-2); border-color: var(--line); color: var(--text); }
.game-tile .tile-icon { color: var(--subtle); display: grid; place-items: center; width: 24px; }
.game-tile strong { font-size: 14px; font-weight: 500; }
.game-tile small { display: none; }
.mode-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.mode-row:last-child { border-bottom: 0; }
.mode-row > span:first-child { color: var(--subtle); width: 20px; }
.mode-row > span:last-child { margin-left: auto; color: var(--text); font-variant-numeric: tabular-nums; }
.question-card { padding: 8px 0 24px; margin-bottom: 16px; border-bottom: 1px solid var(--line); background: transparent; }
.question-card:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }
.question-number { font-size: 12px; color: var(--subtle); letter-spacing: 0; text-transform: none; }
.question-card h3 { font-size: 24px; line-height: 1.4; font-weight: 500; margin: 20px 0 28px; }
.answer-list { display: grid; gap: 12px; }
.answer-option { display: flex; align-items: center; gap: 16px; width: 100%; min-height: 56px; text-align: left; background: var(--bg); border: 1px solid var(--line-2); border-radius: 10px; color: var(--text); padding: 16px; font-size: 15px; line-height: 1.5; }
.answer-option + .answer-option { margin-top: 12px; }
.answer-list .answer-option + .answer-option { margin-top: 0; }
.answer-option:hover { border-color: var(--subtle); background: var(--panel-2); }
.answer-option.selected { border-color: var(--orange); background: var(--orange-soft); }
.answer-option.correct { border-color: var(--green-line); color: var(--green); background: var(--green-bg); }
.answer-option.incorrect { border-color: var(--red-line); color: var(--red); background: var(--red-bg); }
.option-key { width: 28px; height: 28px; flex-shrink: 0; display: grid; place-items: center; border: 1px solid var(--line-2); color: var(--muted); border-radius: 6px; font-size: 12px; }
.feedback-line { margin-top: 20px; padding: 16px; background: var(--panel-2); color: var(--muted); font-size: 14px; line-height: 1.7; border-radius: 10px; }
.feedback-line strong { font-weight: 500; }
.match-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.match-option { min-height: 96px; padding: 16px; border: 1px solid var(--line-2); background: var(--bg); border-radius: 10px; color: var(--text); text-align: left; font-size: 14px; line-height: 1.5; }
.match-option:hover { background: var(--panel-2); border-color: var(--subtle); }
.match-option.selected { border-color: var(--orange); background: var(--orange-soft); }
.match-option.matched { opacity: .3; pointer-events: none; border-color: var(--green-line); }
.match-option.incorrect { border-color: var(--red-line); color: var(--red); background: var(--red-bg); }
.word-input { text-align: center; min-height: 56px; }
.study-result { text-align: center; padding: 56px 32px; }
.result-medal { width: 64px; height: 64px; margin: 0 auto 28px; display: grid; place-items: center; border: 1px solid var(--orange-line); border-radius: 50%; color: var(--orange); font-size: 28px; }
.study-result h2 { font-size: 28px; font-weight: 500; margin-bottom: 16px; }
.study-result p { color: var(--muted); max-width: 460px; margin: 0 auto 24px; font-size: 15px; line-height: 1.7; }
.score-big { font-size: 48px; line-height: 1.2; color: var(--orange); margin-bottom: 32px; }
.block-stack { display: flex; flex-direction: column-reverse; gap: 8px; width: min(100%, 280px); margin: 24px auto 12px; }
.block-brick { display: block; height: 16px; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 4px; }
.block-brick.filled { background: var(--orange); border-color: var(--orange); }
.block-question, .blast-question { box-shadow: none; }
.game-status { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; text-align: center; color: var(--muted); }
.annoyance-flash::after { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 18; background: var(--orange); opacity: .04; animation: sensory-pulse 1.8s var(--ease) infinite; }
@keyframes sensory-pulse { 0%, 100% { opacity: .04; } 50% { opacity: .13; } }
.chat-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 32px; align-items: start; }
.chat-panel { display: flex; flex-direction: column; min-height: 640px; }
.chat-top { display: flex; align-items: center; gap: 12px; padding: 24px; border-bottom: 1px solid var(--line); }
.tutor-avatar { display: grid; place-items: center; width: 40px; height: 40px; color: var(--orange); border: 1px solid var(--line-2); border-radius: 10px; font-size: 20px; }
.chat-top strong, .chat-top small { display: block; }
.chat-top strong { font-size: 15px; font-weight: 500; }
.chat-top small { color: var(--subtle); font-size: 12px; margin-top: 4px; }
.chat-messages { display: flex; flex-direction: column; gap: 24px; padding: 28px 24px; flex: 1; min-height: 360px; max-height: 560px; overflow-y: auto; }
.chat-empty { text-align: left; max-width: 460px; margin: auto; }
.chat-empty .spark { color: var(--orange); font-size: 28px; }
.chat-empty h3 { font-size: 24px; margin: 20px 0 12px; font-weight: 500; }
.chat-empty p { color: var(--muted); line-height: 1.7; font-size: 15px; margin: 0 0 24px; }
.suggestion-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.suggestion-chip { min-height: 44px; padding: 12px; border: 1px solid var(--line-2); border-radius: 8px; background: transparent; color: var(--muted); font-size: 13px; }
.suggestion-chip:hover { border-color: var(--subtle); background: var(--panel-2); color: var(--text); }
.message { max-width: 90%; border-radius: 12px; padding: 16px 20px; font-size: 15px; line-height: 1.8; white-space: pre-wrap; overflow-wrap: anywhere; }
.message.assistant { align-self: flex-start; padding-left: 0; color: var(--text); }
.speech-allowance { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 12px; row-gap: 4px; padding: 14px clamp(16px, 3vw, 24px); border-bottom: 1px solid var(--line); font-size: 13px; line-height: 1.5; }
.speech-allowance strong { font-size: 14px; font-weight: 600; }
#speech-allowance-status { color: var(--orange-2); font-variant-numeric: tabular-nums; }
.speech-allowance small { flex-basis: 100%; color: var(--muted); }
.reply-speech { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 12px; max-width: 100%; white-space: normal; }
.reply-speech .speech-listen { min-height: 44px; }
.reply-speech audio { display: block; width: min(17rem, 100%); min-width: 0; max-width: 100%; height: 40px; }
.speech-parts { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; color: var(--muted); }
.speech-status:not(:empty) { flex-basis: 100%; }
.speech-status:empty { display: none; }
.message.user { align-self: flex-end; background: var(--panel-3); color: var(--text); }
.chat-composer { padding: 16px; border-top: 1px solid var(--line); }
.composer-wrap { display: flex; align-items: flex-end; gap: 8px; background: var(--bg); border: 1px solid var(--line-2); border-radius: 12px; padding: 8px; }
.composer-wrap:focus-within { border-color: var(--orange); }
.composer-wrap textarea { flex: 1; min-width: 0; min-height: 48px; max-height: 180px; border: 0; resize: vertical; padding: 12px; background: transparent; color: var(--text); font-size: 15px; line-height: 1.5; }
.composer-wrap button { min-width: 44px; min-height: 44px; border: 0; border-radius: 8px; background: var(--orange); color: var(--on-accent); font-size: 18px; }
.composer-meta { display: flex; justify-content: space-between; gap: 12px; padding: 12px 4px 0; color: var(--subtle); font-size: 12px; }
.chat-side { display: grid; align-content: start; gap: 24px; }
.memory-note { padding: 20px; }
.memory-note h3 { font-size: 16px; margin-bottom: 12px; font-weight: 500; }
.memory-note p { color: var(--muted); font-size: 14px; line-height: 1.6; margin-bottom: 0; }
.memory-note .field { margin-top: 20px; }
.memory-note .field select { min-height: 44px; font-size: 14px; }
.voice-button { width: 44px; height: 44px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--panel-2); color: var(--muted); }
.voice-button.listening { color: var(--orange); border-color: var(--orange); }
.plan-list { display: grid; gap: 24px; }
.plan-card { padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.plan-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.plan-head h3 { font-size: 20px; line-height: 1.4; font-weight: 500; margin: 0 0 8px; }
.plan-head small { font-size: 12px; color: var(--subtle); }
.plan-progress { height: 4px; background: var(--line); border-radius: 2px; margin: 24px 0; overflow: clip; }
.plan-progress i { display: block; height: 100%; background: var(--orange); }
.topic-list { display: grid; gap: 4px; }
.topic-item { display: flex; gap: 12px; align-items: center; min-height: 48px; font-size: 15px; color: var(--muted); padding: 8px 0; }
.topic-item input { width: 20px; height: 20px; accent-color: var(--orange); }
.topic-item.done span { color: var(--subtle); text-decoration: line-through; }
.calendar-count { padding: 24px; border: 1px solid var(--line); border-radius: 12px; }
.calendar-count strong, .calendar-count span { display: block; }
.calendar-count strong { font-variant-numeric: tabular-nums; font-size: 32px; color: var(--orange); font-weight: 500; }
.calendar-count span { color: var(--muted); font-size: 12px; }
.studio-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; align-items: start; }
.studio-preview { display: grid; place-items: center; position: relative; min-height: 560px; padding: 24px; overflow: clip; background: var(--panel); }
.studio-empty { max-width: 320px; color: var(--muted); text-align: center; }
.studio-empty > span { color: var(--orange); font-size: 40px; }
.studio-empty strong { display: block; font-size: 20px; line-height: 1.4; font-weight: 500; margin: 24px 0 12px; }
.studio-empty p { color: var(--subtle); font-size: 15px; line-height: 1.7; }
.visual-output { width: 100%; height: auto; min-height: 400px; max-height: 720px; object-fit: contain; border-radius: 8px; }
.visual-download { position: absolute; top: 16px; right: 16px; }
.visual-gallery { display: grid; gap: 8px; }
.visual-entry { display: flex; gap: 12px; width: 100%; min-height: 72px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--muted); text-align: left; }
.visual-entry:hover { border-color: var(--line-2); }
.visual-entry .thumb { width: 48px; height: 48px; flex-shrink: 0; border-radius: 6px; object-fit: cover; background: var(--panel-2); color: var(--subtle); }
.visual-entry > span:last-child { min-width: 0; }
.visual-entry strong, .visual-entry small { display: block; }
.visual-entry strong { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: clip; text-overflow: ellipsis; }
.visual-entry small { color: var(--subtle); font-size: 12px; margin-top: 8px; }
.profile-grid { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 32px; }
.profile-card { padding: 32px 24px; text-align: center; }
.profile-avatar-large { display: grid; place-items: center; width: 80px; height: 80px; margin: 0 auto 24px; border-radius: 50%; background: var(--orange-soft); color: var(--orange-2); border: 1px solid var(--orange-line); font-size: 28px; }
.profile-card h2 { font-size: 24px; font-weight: 500; line-height: 1.3; margin: 0 0 12px; }
.profile-card p { font-size: 14px; color: var(--muted); margin: 0 0 28px; overflow-wrap: anywhere; }
.profile-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding-top: 24px; border-top: 1px solid var(--line); }
.profile-stats strong, .profile-stats small { display: block; }
.profile-stats strong { font-size: 28px; font-weight: 500; font-variant-numeric: tabular-nums; }
.profile-stats small { color: var(--subtle); font-size: 12px; margin-top: 8px; }
.settings-list { display: grid; }
.settings-row { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 24px 0; border-bottom: 1px solid var(--line); }
.settings-row:last-child { border-bottom: 0; }
.settings-row strong, .settings-row small { display: block; }
.settings-row strong { font-size: 15px; font-weight: 500; }
.settings-row small { color: var(--muted); font-size: 13px; line-height: 1.6; margin-top: 8px; max-width: 440px; }
.settings-row .select { width: 140px !important; min-width: 140px; }
.activity-header { margin-bottom: 32px; }
.activity-header h1 { font-size: 36px; font-weight: 500; letter-spacing: -.7px; line-height: 1.2; margin: 0 0 16px; }
.activity-header p { color: var(--muted); font-size: 16px; line-height: 1.6; max-width: 600px; }
.activity-selection { display: grid; grid-template-columns: minmax(0, 1fr) 200px; gap: 20px; align-items: end; padding: 24px 0 32px; border-top: 1px solid var(--line); }
.activity-list { display: grid; gap: 12px; }
.activity-row { display: flex; align-items: center; gap: 24px; width: 100%; min-height: 104px; padding: 24px 28px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); text-align: left; color: var(--text); }
.activity-row:hover { border-color: var(--orange-line); background: var(--panel-2); }
.activity-icon { display: grid; place-items: center; flex-shrink: 0; width: 52px; height: 52px; border: 1px solid var(--line-2); border-radius: 12px; color: var(--orange); }
.activity-icon svg { width: 28px; height: 28px; }
.activity-copy { flex: 1; min-width: 0; }
.activity-title { display: block; font-size: 21px; line-height: 1.4; font-weight: 500; }
.activity-meta { display: block; color: var(--muted); font-size: 14px; line-height: 1.5; margin-top: 8px; }
.activity-arrow { color: var(--subtle); flex-shrink: 0; }
.activity-guide { padding: 24px 0; margin: 24px 0 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; line-height: 1.7; }
.activity-guide h2, .activity-list + h2 { font-size: 18px; font-weight: 500; margin: 32px 0 20px; }
.activity-section-title { font-size: 18px; font-weight: 500; margin: 32px 0 20px; }
.activity-empty { padding: 40px 0; border-top: 1px solid var(--line); }
.toast-region { display: grid; gap: 8px; position: fixed; right: 24px; bottom: 24px; z-index: 80; max-width: min(420px, calc(100% - 48px)); }
.toast { padding: 16px 20px; background: var(--panel-3); color: var(--text); border: 1px solid var(--line-2); border-radius: 12px; font-size: 14px; line-height: 1.6; }
.toast.error { border-color: var(--red-line); }
.toast.success { border-color: var(--green-line); }
.modal-backdrop { position: fixed; inset: 0; z-index: 70; background: var(--overlay); display: grid; place-items: center; padding: 24px; }
.modal { width: min(100%, 480px); background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.modal-head h2 { font-size: 22px; line-height: 1.3; font-weight: 500; margin: 0; }
.modal-close { display: grid; place-items: center; min-width: 44px; min-height: 44px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 24px; }
.modal-close:hover { background: var(--panel-2); }
.modal-body { font-size: 15px; color: var(--muted); line-height: 1.7; }
.modal-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 28px; }
.skeleton { background: var(--panel-2); border-radius: 8px; }
.spinner { display: inline-block; width: 20px; height: 20px; border: 2px solid var(--orange-line); border-top-color: var(--orange); border-radius: 50%; animation: spin 800ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-line { display: flex; align-items: center; gap: 12px; padding: 16px 0; color: var(--muted); font-size: 14px; }
code { font-family: var(--font-figures); color: var(--orange-2); }
.centered { display: grid; place-items: center; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: clip; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
/* Keep dynamic templates readable while their layout hooks remain unchanged. */
.page-content [style*="font-size:9px"], .page-content [style*="font-size:10px"], .page-content [style*="font-size:11px"] { font-size: 13px !important; }
.page-content [style*="font-size:12px"] { font-size: 14px !important; }
.page-content [style*="color:#aaa"], .page-content [style*="color:#999"], .page-content [style*="color:#888"] { color: var(--muted) !important; }
.page-content [style*="padding:18px"] { padding: 24px !important; }
@media (min-width: 1700px) { .auth-story { padding-inline: 10%; } .auth-panel { padding-inline: 80px; } }
@media (max-width: 1200px) {
  :root { --sidebar-width: 232px; }
  .page-content { padding: 32px; }
  .topbar { padding-inline: 32px; }
  .home-columns, .content-layout, .study-layout, .chat-layout { gap: 24px; grid-template-columns: minmax(0, 1fr) 240px; }
  .deck-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .auth-story { padding: 40px; }
  .auth-story-copy h1 { font-size: 72px; letter-spacing: -3px; }
  .auth-panel { padding-inline: 40px; }
}
@media (max-width: 960px) {
  .app-shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: none; }
  .main-column { grid-column: 1; }
  .mobile-brand { display: flex; }
  .mobile-nav { display: grid; position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; grid-template-columns: repeat(5, minmax(0, 1fr)); min-height: 80px; padding: 8px 12px max(8px, env(safe-area-inset-bottom)); background: var(--shell); border-top: 1px solid var(--line); }
  .mobile-nav-item { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 4px; min-height: 56px; padding: 8px 4px; background: transparent; border: 0; border-radius: 8px; color: var(--subtle); }
  .mobile-nav-item.active { color: var(--orange); }
  .mobile-nav-item span { display: flex; align-items: center; justify-content: center; }
  .mobile-nav-item small { font-size: 11px; line-height: 1.2; }
  .mobile-nav-item svg { width: 22px; height: 22px; }
  .breadcrumbs, .top-create { display: none; }
  .topbar { min-height: 72px; padding-inline: 24px; }
  .page-content { padding: 32px 24px 120px; }
  .home-columns { grid-template-columns: minmax(0, 1fr) 240px; }
  .content-layout, .study-layout, .chat-layout, .studio-layout { grid-template-columns: minmax(0, 1fr); }
  .create-side { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .study-aside { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .game-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chat-side { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .studio-preview { min-height: 440px; }
  .profile-grid { grid-template-columns: 260px minmax(0, 1fr); gap: 24px; }
  .auth-layout { grid-template-columns: minmax(0, 1fr) minmax(360px, 1fr); }
  .auth-story { padding: 32px; }
  .auth-story-copy h1 { font-size: 64px; }
  .auth-intro { font-size: 18px; }
  .auth-panel { padding-inline: 28px; }
  .auth-panel-foot { width: calc(100% - 56px); }
  .toast-region { bottom: 100px; }
}
@media (max-width: 700px) {
  .auth-layout { display: block; }
  .auth-story { display: none; }
  .auth-panel { min-height: 100vh; align-items: stretch; justify-content: flex-start; padding: 28px 24px; }
  .auth-mobile-brand { display: flex; margin-bottom: 56px; }
  .auth-card { width: 100%; max-width: 440px; margin: 0 auto; }
  .auth-switch { margin-bottom: 32px; }
  .auth-panel-foot { position: static; width: 100%; max-width: 440px; margin: auto auto 0; padding-top: 56px; }
  .auth-heading h2 { font-size: 28px; }
  .section-head { flex-direction: column; align-items: stretch; gap: 20px; }
  .section-actions { flex-wrap: wrap; }
  .section-head h1 { font-size: 28px; }
  .section-head p { font-size: 14px; }
  .home-hero { min-height: 0; padding: 0 0 32px; margin-bottom: 28px; }
  .hero-title { font-size: 36px; letter-spacing: -.7px; max-width: 420px; }
  .hero-copy > p { font-size: 15px; }
  .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 0; margin-bottom: 28px; padding-bottom: 24px; }
  .stat-card { padding: 0 20px; }
  .stat-card:nth-child(3) { padding-left: 0; border-left: 0; }
  .stat-value { font-size: 28px; margin: 8px 0; }
  .home-columns { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .focus-panel .panel-header { display: none; }
  .focus-panel { display: flex; align-items: center; justify-content: space-between; padding: 20px; }
  .focus-time { font-size: 32px; padding: 0; }
  .focus-controls { padding: 0; }
  .quick-row { grid-template-columns: minmax(0, 1fr); gap: 0; margin-top: 24px; }
  .quick-card { min-height: 88px; padding: 20px 0; }
  .quick-card small { margin-top: 4px; }
  .toolbar-row { flex-direction: column; align-items: stretch; gap: 12px; }
  .filter-select { width: 100%; }
  .deck-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .library-card { min-height: 240px; }
  .panel-header, .panel-body { padding-inline: 20px; }
  .panel-header { padding-top: 20px; }
  .panel-body { padding-bottom: 20px; }
  .panel-header h2 { font-size: 17px; }
  .panel-header p { font-size: 12px; }
  .deck-row { grid-template-columns: 36px minmax(0, 1fr) auto; gap: 12px; }
  .deck-row .button { padding-inline: 12px; }
  .deck-row h3 { font-size: 14px; }
  .review-callout { flex-wrap: wrap; }
  .create-card, .plan-create, .studio-form { padding: 20px; }
  .create-side, .form-grid, .chat-side, .profile-grid { grid-template-columns: minmax(0, 1fr); }
  .field-row { gap: 12px; flex-wrap: wrap; }
  .field-row > .field { min-width: 128px; }
  .create-form > .field-row:last-child { flex-direction: column; align-items: stretch; gap: 20px; }
  .upload-zone { gap: 12px; padding: 16px; }
  .upload-zone .button { display: none; }
  .study-tools { gap: 12px; }
  .study-tools .select { min-width: 0; width: 50%; }
  .study-stage { padding: 20px; }
  .flashcard { min-height: 320px; padding: 28px 20px; }
  .card-prompt { font-size: 24px; }
  .study-controls { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .study-controls-left, .study-controls-right { justify-content: space-between; }
  .study-controls-right .button { flex: 1; }
  .study-aside { grid-template-columns: minmax(0, 1fr); }
  .game-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .question-card h3 { font-size: 21px; }
  .answer-option { padding: 16px 12px; gap: 12px; font-size: 14px; }
  .match-option { padding: 12px; min-height: 100px; font-size: 13px; }
  .chat-panel { min-height: 580px; }
  .chat-top, .chat-messages { padding: 20px; }
  .chat-messages { max-height: 56vh; }
  .chat-empty h3 { font-size: 22px; }
  .message { font-size: 14px; max-width: 100%; }
  .composer-meta { font-size: 11px; }
  .composer-wrap textarea { font-size: 16px; }
  .settings-row { gap: 16px; padding: 20px 0; flex-wrap: wrap; }
  .settings-row small { font-size: 12px; }
  .studio-preview { min-height: 360px; }
  .visual-output { min-height: 280px; }
  .activity-header h1 { font-size: 30px; }
  .activity-header p { font-size: 15px; }
  .activity-selection { grid-template-columns: minmax(0, 1fr); gap: 20px; padding-bottom: 28px; }
  .activity-row { min-height: 100px; padding: 20px; gap: 20px; border-radius: 14px; }
  .activity-icon { width: 44px; height: 44px; border-radius: 10px; }
  .activity-icon svg { width: 24px; height: 24px; }
  .activity-title { font-size: 20px; }
  .activity-meta { font-size: 13px; }
  .activity-guide { font-size: 13px; }
}
@media (max-width: 380px) {
  .page-content { padding-inline: 16px; }
  .topbar { padding-inline: 16px; }
  .brand-lockup { font-size: 22px; }
  .search-button kbd { display: none; }
  .search-button { min-width: 44px; padding: 8px; }
  .hero-action-row .button { flex: 1; }
  .activity-row { gap: 16px; padding: 16px; }
  .activity-meta { font-size: 12px; }
  .focus-panel { flex-wrap: wrap; gap: 20px; }
  .deck-row { grid-template-columns: 32px minmax(0, 1fr); }
  .deck-row .button { grid-column: 2; justify-self: start; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Activity-specific product states */
.button:active:not(:disabled), .activity-row:active:not(:disabled), .game-tile:active:not(:disabled), .nav-item:active, .mobile-nav-item:active { transform: translateY(1px); }
.ui-icon { width: 20px; height: 20px; stroke-width: 1.7; flex-shrink: 0; }
.hero-material { position: relative; display: grid; place-items: center; width: 216px; height: 176px; flex-shrink: 0; padding: 16px 16px 8px 0; }
.material-page { display: grid; align-content: center; width: 176px; min-height: 156px; padding: 24px; border-left: 4px solid var(--orange); border-radius: 4px 12px 12px 4px; background: var(--paper); color: var(--paper-ink); font-size: 23px; line-height: 1.3; font-weight: 500; text-align: left; }
.material-tab { position: absolute; top: 24px; right: 4px; display: grid; place-items: center; width: 32px; height: 48px; border-radius: 0 6px 6px 0; background: var(--orange); color: var(--on-accent); font-size: 20px; font-weight: 600; }
.activity-sections { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; align-items: start; }
.activity-sections h2 { font-size: 18px; font-weight: 500; margin: 0 0 20px; }
.activity-sections .activity-row { padding: 20px; gap: 20px; }
.activity-sections .activity-title { font-size: 20px; }
.study-title { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; margin-bottom: 28px; }
.study-title h1 { font-size: 32px; font-weight: 500; line-height: 1.3; letter-spacing: -.5px; margin: 0 0 12px; }
.study-title p { color: var(--muted); font-size: 14px; margin: 0; }
.study-toolbar { display: flex; align-items: end; flex-wrap: wrap; gap: 16px; padding-bottom: 28px; }
.study-toolbar .field { min-width: 160px; }
.study-mode-icon { display: grid; place-items: center; width: 48px; height: 48px; border: 1px solid var(--orange-line); border-radius: 10px; color: var(--orange); margin-right: 8px; }
.game-hud { display: flex; flex-wrap: wrap; gap: 20px; padding-bottom: 24px; margin-bottom: 28px; border-bottom: 1px solid var(--line); }
.game-stat { display: flex; align-items: baseline; gap: 8px; color: var(--muted); font-size: 13px; }
.game-stat strong { color: var(--text); font-size: 24px; font-weight: 500; font-variant-numeric: tabular-nums; }
.blast-targets { display: flex; justify-content: center; gap: 12px; padding: 12px 0 28px; }
.blast-target { display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--line-2); color: var(--subtle); border-radius: 50%; }
.blast-target.hit { color: var(--green); border-color: var(--green-line); background: var(--green-bg); }
.blast-target.current { color: var(--orange); border-color: var(--orange); }
.blast-target.miss { color: var(--red); border-color: var(--red-line); }
.charms-collection { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; min-height: 76px; padding: 0 0 24px; }
.charm-token { display: grid; place-items: center; width: 48px; height: 48px; border: 1px solid var(--orange-line); border-radius: 12px; color: var(--orange); background: var(--orange-soft); }
@media (max-width: 1200px) { .hero-material { width: 176px; } }
@media (max-width: 960px) { .activity-sections { gap: 24px; } }
@media (max-width: 700px) {
  .hero-material { display: none; }
  .activity-sections { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .study-title { flex-direction: column; gap: 16px; }
  .study-title h1 { font-size: 28px; }
  .study-title > .button { padding-left: 0; }
  .study-toolbar { gap: 12px; }
  .study-mode-icon { display: none; }
  .study-toolbar .field { flex: 1; min-width: 128px; }
  .game-hud { gap: 16px; }
  .game-stat { font-size: 12px; gap: 8px; }
  .game-stat strong { font-size: 22px; }
  .blast-targets { gap: 8px; }
  .blast-target { width: 36px; height: 36px; }
}
/* Session and form states shared by every activity */
.study-card-count { display: block; color: var(--subtle); font-size: 12px; margin-bottom: 20px; text-align: center; font-variant-numeric: tabular-nums; }
.flashcard.flipped { background: var(--paper); border-left-color: var(--orange-2); }
.flashcard > .small-label { margin-bottom: 16px; }
.flashcard > .card-prompt { margin-bottom: 24px; }
.learn-summary { padding-bottom: 28px; margin-bottom: 28px; border-bottom: 1px solid var(--line); }
.learn-summary h2, .learn-topics h2 { font-size: 22px; font-weight: 500; margin-bottom: 16px; }
.learn-summary p { color: var(--muted); font-size: 16px; line-height: 1.8; margin: 0; }
.learn-topics .answer-list { margin-top: 20px; }
.challenge-intro { display: grid; justify-items: start; align-content: center; min-height: 380px; padding: 12px; }
.challenge-icon { display: grid; place-items: center; width: 56px; height: 56px; color: var(--orange); border: 1px solid var(--orange-line); border-radius: 12px; margin-bottom: 24px; }
.challenge-icon svg { width: 28px; height: 28px; }
.challenge-intro h2 { font-size: 28px; font-weight: 500; line-height: 1.3; margin: 0 0 20px; }
.challenge-intro > p { color: var(--muted); font-size: 15px; line-height: 1.7; max-width: 520px; margin: 0 0 24px; }
.challenge-toggle { display: flex; align-items: center; gap: 12px; min-height: 44px; color: var(--muted); font-size: 14px; margin-bottom: 24px; }
.challenge-toggle input { width: 20px; height: 20px; accent-color: var(--orange); }
.challenge-actions, .result-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.result-actions { justify-content: center; }
.question-next { display: flex; justify-content: flex-end; margin-top: 24px; }
.feedback-line.is-correct { border-left: 2px solid var(--green-line); }
.feedback-line.is-incorrect { border-left: 2px solid var(--red-line); }
.game-tile.active { color: var(--text); border-color: var(--line-2); background: var(--panel-2); }
.game-tile.active .tile-icon { color: var(--orange); }
.visual-history-section { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--line); }
.visual-history-section h3 { font-size: 16px; font-weight: 500; margin: 0 0 16px; }
progress.plan-progress { display: block; width: 100%; appearance: none; border: 0; border-radius: 2px; }
progress.plan-progress::-webkit-progress-bar { background: var(--line); border-radius: 2px; }
progress.plan-progress::-webkit-progress-value { background: var(--orange); border-radius: 2px; }
progress.plan-progress::-moz-progress-bar { background: var(--orange); border-radius: 2px; }
.panel, .library-card, .create-card, .plan-create, .studio-form, .plan-card { color: var(--text); }
.block-brick { color: var(--text); }
.modal { box-shadow: none; }
@media (max-width: 700px) {
  .challenge-intro { padding: 0; }
  .challenge-intro h2 { font-size: 24px; }
  .challenge-actions { align-items: stretch; width: 100%; }
  .challenge-actions .button { flex: 1; }
  .result-actions { flex-direction: column; align-items: stretch; }
  .learn-summary p { font-size: 15px; }
}
