:root {
  color-scheme: light;
  --bg: #F7F6F2;
  --surface: #FFFFFF;
  --surface-2: #F1F0EB;
  --surface-3: #EFEEE9;
  --text: #242422;
  --muted: #6F706C;
  --pale: #969791;
  --line: #E4E2DC;
  --line-strong: #CCC9C1;
  --accent: #526D82;
  --accent-strong: #3E5669;
  --accent-soft: #E8EDF0;
  --danger: #A94747;
  --danger-soft: #FAEEEE;
  --success: #4F725F;
  --success-soft: #EEF5F1;
  --warning: #87652E;
  --warning-soft: #F8F2E7;
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --shadow-sm: none;
  --shadow-md: 0 18px 60px rgba(45, 48, 44, .08);
  --sidebar: 232px;
  --content: 1180px;
  --reading: 720px;
  --ui-font: Inter, "Noto Sans TC", "Noto Sans JP", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --reading-font: "Noto Serif TC", "Noto Serif JP", "Songti TC", Georgia, serif;
  --ease: cubic-bezier(.2,.7,.2,1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: var(--ui-font);
  font-size: 18.08px;
  line-height: 1.728;
  text-rendering: optimizeLegibility;
  font-variant-numeric: lining-nums tabular-nums;
}
body[data-page-route="reading"] { --content: 1500px; }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
button { color: inherit; }
a { color: var(--accent); text-underline-offset: 3px; }
img, svg { display: block; max-width: 100%; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
button:disabled { cursor: not-allowed; opacity: .45; }
::selection { background: color-mix(in srgb, var(--accent) 22%, white); }

.skip-link { position: fixed; left: 16px; top: -90px; z-index: 200; padding: 10px 14px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); }
.skip-link:focus { top: 16px; }
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
.ui-icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* App frame */
.app-shell { min-height: 100dvh; display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); }
.app-sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 40;
  width: var(--sidebar); padding: 28px 20px 22px;
  display: flex; flex-direction: column;
  background: #FBFAF7; border-right: 1px solid var(--line);
}
.app-main { min-width: 0; grid-column: 2; display: flex; min-height: 100dvh; flex-direction: column; }
.sidebar-spacer { flex: 1; }
.sidebar-note { margin: 18px 8px 0; color: var(--pale); font-size: 13.56px; line-height: 1.674; }
.brand { display: inline-flex; align-items: center; gap: 12px; border: 0; background: transparent; padding: 0; text-align: left; }
.brand-mark { width: 38px; height: 38px; color: var(--accent); flex: 0 0 auto; }
.brand-mark svg { width: 100%; height: 100%; fill: none; stroke: currentColor; }
.brand-word strong { display: block; font-size: 19.21px; line-height: 1.242; letter-spacing: -.035em; font-weight: 650; }
.brand-word small { display: block; margin-top: 4px; color: var(--pale); font-size: 11.3px; letter-spacing: .04em; }
.desktop-nav, .sidebar-secondary { display: grid; gap: 4px; margin-top: 40px; }
.sidebar-secondary { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.desktop-nav button, .sidebar-secondary button {
  min-height: 44px; display: flex; align-items: center; gap: 12px;
  padding: 0 12px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--muted); text-align: left;
  transition: color 170ms var(--ease), background 170ms var(--ease);
}
.desktop-nav button:hover, .sidebar-secondary button:hover { background: var(--surface-3); color: var(--text); }
.desktop-nav button.active { background: var(--accent-soft); color: var(--accent-strong); font-weight: 650; }
.desktop-nav svg, .sidebar-secondary svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }

.topbar {
  position: sticky; top: 0; z-index: 30; min-height: 66px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 10px 30px; border-bottom: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
}
.mobile-brand { display: none; }
.topbar-context { display: flex; align-items: center; gap: 8px; color: var(--pale); font-size: 13.56px; letter-spacing: .02em; }
.quiet-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); opacity: .62; }
.top-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.language-switch select, .account-button {
  min-height: 40px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: color-mix(in srgb, var(--surface) 88%, transparent); color: var(--text);
}
.language-switch select { padding: 0 32px 0 12px; }
.account-button { display: inline-flex; align-items: center; gap: 8px; padding: 0 12px; }
.account-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.65; }

.main-content { width: min(100%, var(--content)); margin: 0 auto; padding: 42px 44px 72px; flex: 1; }
.bottom-nav { display: none; }

/* Typography */
h1, h2, h3, p { overflow-wrap: anywhere; }
h1, h2, h3 { margin: 0; }
.page-title { max-width: 780px; margin: 0 0 36px; }
.page-title h1, .home-primary h1, .reader-title, .article-body h1, .article-body h2, .section-title {
  font-family: var(--reading-font);
  font-weight: 500;
  letter-spacing: -.025em;
}
.page-title h1 { font-size: clamp(38.42px, 4.52vw, 58.76px); line-height: 1.188; }
.page-title p { max-width: 680px; margin: 12px 0 0; color: var(--muted); line-height: 1.944; }
.eyebrow, .section-kicker { color: var(--accent); font-size: 12.43px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.muted { color: var(--muted); }
.pale { color: var(--pale); }
.center { text-align: center; }
.small { font-size: 15.82px; }
.top-gap { margin-top: 18px; }
.spaced { margin-top: 22px; }
.full { width: 100%; }
.divider { height: 1px; background: var(--line); margin: 26px 0; }

/* Buttons */
.primary-button, .secondary-button, .ghost-button, .text-button, .danger-button, .icon-button, .back-button {
  min-height: 44px; border-radius: var(--radius-sm); font-weight: 600; transition: transform 160ms var(--ease), background 160ms var(--ease), border-color 160ms var(--ease), color 160ms var(--ease);
}
.primary-button { border: 1px solid var(--accent); background: var(--accent); color: white; padding: 0 18px; }
.primary-button:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.secondary-button { border: 1px solid var(--line-strong); background: transparent; color: var(--text); padding: 0 16px; }
.secondary-button:hover { background: var(--surface-3); }
.ghost-button, .text-button, .back-button { border: 0; background: transparent; color: var(--accent-strong); padding: 0 4px; }
.text-button { display: inline-flex; align-items: center; gap: 7px; }
.back-button { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); }
.danger-button { border: 1px solid color-mix(in srgb, var(--danger) 36%, var(--line)); background: var(--danger-soft); color: var(--danger); padding: 0 16px; }
.icon-button { width: 44px; display: inline-grid; place-items: center; border: 1px solid var(--line); background: transparent; }
.primary-button:active, .secondary-button:active, .icon-button:active { transform: translateY(1px); }
.button-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.icon-text-button { display: inline-flex; align-items: center; gap: 8px; }

/* General sections */
.section { margin-top: 56px; }
.section-header { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.section-header h2, .section h2 { margin-top: 5px; font-family: var(--reading-font); font-size: clamp(29.38px, 3.39vw, 38.42px); font-weight: 500; letter-spacing: -.02em; }
.section-header p { margin: 7px 0 0; color: var(--muted); }
.lesson-shell { max-width: 880px; margin: 0 auto; }
.reading-column { max-width: 760px; margin: 0 auto; }
.content-panel { padding: 28px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.notice, .feedback { padding: 16px 18px; border-left: 3px solid var(--accent); background: color-mix(in srgb, var(--accent-soft) 58%, white); color: var(--muted); }
.notice strong, .feedback strong { color: var(--text); }
.badge, .language-pill, .source-note { display: inline-flex; align-items: center; min-height: 26px; padding: 0 9px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 13.56px; }
.lesson-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 30px; }

/* Home */
.home-shell { max-width: 1120px; margin: 0 auto; }
.home-primary { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(260px, .65fr); gap: 42px; align-items: stretch; }
.continue-reading {
  min-height: 400px; display: flex; flex-direction: column; justify-content: flex-end;
  padding: 42px; border-radius: var(--radius-lg); overflow: hidden; position: relative;
  background: linear-gradient(145deg, #FFFFFF 0%, #F2F0EA 100%); border: 1px solid var(--line);
}
.continue-reading::after { content: ""; position: absolute; width: 300px; height: 300px; right: -90px; top: -120px; border: 38px solid color-mix(in srgb, var(--accent) 12%, transparent); border-radius: 50%; }
.continue-reading > * { position: relative; z-index: 1; }
.continue-reading h1 { margin: 12px 0 14px; max-width: 700px; font-size: clamp(42.94px, 5.65vw, 70.06px); line-height: 1.145; }
.continue-reading p { max-width: 610px; margin: 0; color: var(--muted); font-size: 19.21px; line-height: 1.944; }
.continue-meta { display: flex; flex-wrap: wrap; gap: 10px 18px; margin-top: 22px; color: var(--pale); font-size: 14.69px; }
.continue-actions { display: flex; align-items: center; gap: 12px; margin-top: 26px; }
.home-today { padding: 30px 0 12px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.home-today h2 { margin: 9px 0 8px; font-family: var(--reading-font); font-weight: 500; font-size: 33.9px; }
.home-today p { margin: 0; color: var(--muted); }
.today-count { margin: 34px 0 20px; font-family: var(--reading-font); font-size: 81.36px; line-height: 0.972; color: var(--accent-strong); }
.today-count small { font-family: var(--ui-font); font-size: 15.82px; color: var(--pale); }
.progress-track { height: 5px; overflow: hidden; border-radius: 999px; background: var(--surface-3); }
.progress-fill { height: 100%; border-radius: inherit; background: var(--accent); transition: width 240ms var(--ease); }
.home-list { border-top: 1px solid var(--line); }
.home-list-item { width: 100%; display: grid; grid-template-columns: 96px minmax(0,1fr) auto; gap: 20px; align-items: center; padding: 20px 0; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; }
.home-list-item:hover { background: color-mix(in srgb, var(--surface-3) 72%, transparent); }
.home-list-media { aspect-ratio: 4 / 3; border-radius: var(--radius-sm); background: var(--surface-3); overflow: hidden; }
.home-list-media img { width: 100%; height: 100%; object-fit: cover; }
.home-list-copy strong { display: block; font-family: var(--reading-font); font-size: 22.6px; font-weight: 500; }
.home-list-copy small { display: block; margin-top: 5px; color: var(--muted); }
.home-list-action { color: var(--accent); }
.home-progress-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.home-progress-row div { padding: 20px 16px; border-right: 1px solid var(--line); }
.home-progress-row div:last-child { border-right: 0; }
.home-progress-row span { display: block; color: var(--pale); font-size: 13.56px; }
.home-progress-row strong { display: block; margin-top: 6px; font-family: var(--reading-font); font-weight: 500; font-size: 29.38px; }

/* Editorial module lists */
.module-list, .path-list, .settings-list { border-top: 1px solid var(--line); }
.module-card, .path-item, .settings-list > button {
  width: 100%; min-height: 92px; display: flex; align-items: center; gap: 18px;
  padding: 18px 0; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left;
}
.module-card:hover, .path-item:hover, .settings-list > button:hover { background: color-mix(in srgb, var(--surface-3) 70%, transparent); }
.module-mark { width: 42px; height: 42px; flex: 0 0 auto; display: grid; place-items: center; color: var(--accent); }
.module-icon { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.55; stroke-linecap: round; stroke-linejoin: round; }
.module-copy { min-width: 0; flex: 1; }
.module-copy strong, .path-item strong, .settings-list strong { display: block; font-size: 20.34px; font-weight: 620; }
.module-copy small, .path-item em, .settings-list small { display: block; margin-top: 4px; color: var(--muted); font-style: normal; }
.module-arrow, .mode-arrow, .path-action { color: var(--accent); margin-left: auto; }
.home-module-grid, .learning-module-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); column-gap: 42px; border-top: 0; }
.home-module-grid .module-card, .learning-module-grid .module-card { border-top: 1px solid var(--line); }
.stat-line { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; padding: 16px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stat-line span { color: var(--muted); }
.stat-line strong { font-family: var(--reading-font); font-size: 33.9px; font-weight: 500; }

/* Reader */
.reader-page { max-width: 1320px; margin: 0 auto; }
.reading-progress-rail { position: fixed; z-index: 60; top: 0; left: var(--sidebar); right: 0; height: 2px; background: transparent; pointer-events: none; }
.reading-progress-rail > span { display: block; width: 0; height: 100%; background: var(--accent); transition: width 100ms linear; }
.reader-layout { display: grid; grid-template-columns: minmax(0, var(--reading)) 0; justify-content: center; gap: 0; transition: grid-template-columns 220ms var(--ease), gap 220ms var(--ease); }
.reader-layout.panel-open { grid-template-columns: minmax(0, var(--reading)) 320px; gap: 56px; }
.reader-document { min-width: 0; }
.reader-topline { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 42px; }
.reader-top-actions { display: flex; gap: 6px; }
.reader-top-actions button { width: 40px; height: 40px; display: grid; place-items: center; border: 0; background: transparent; color: var(--muted); border-radius: var(--radius-sm); }
.reader-top-actions button:hover { background: var(--surface-3); color: var(--text); }
.reader-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--pale); font-size: 14.69px; }
.reader-title { max-width: 720px; margin: 18px 0 20px; font-size: clamp(40.68px, 5.65vw, 56.5px); line-height: 1.231; }
.reader-deck { max-width: 670px; margin: 0 0 38px; color: var(--muted); font-size: 20.34px; line-height: 1.89; }
.reader-copy {
  color: #2B2B28; font-family: var(--reading-font); font-size: 21.47px; line-height: 2.03; letter-spacing: .005em;
}
.reader-copy p { margin: 0 0 22px; }
.reader-copy button.reader-word { display: inline; border: 0; padding: 0 1px; margin: 0; border-radius: 2px; background: transparent; color: inherit; font: inherit; line-height: inherit; text-align: inherit; }
.reader-copy button.reader-word:hover, .reader-copy button.reader-word:focus-visible { background: color-mix(in srgb, var(--accent) 13%, transparent); }
.reader-copy button.reader-word.learned { text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 48%, transparent); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.reader-tools-inline { display: flex; align-items: center; gap: 10px; margin: 26px 0 34px; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.reader-tools-inline button { min-height: 38px; }
.reader-question { margin-top: 52px; padding-top: 34px; border-top: 1px solid var(--line); }
.reader-question h2 { margin: 9px 0 18px; font-family: var(--reading-font); font-weight: 500; font-size: 30.51px; }
.reader-study-panel { position: sticky; top: 94px; align-self: start; height: max-content; opacity: 0; transform: translateX(14px); pointer-events: none; transition: opacity 200ms var(--ease), transform 200ms var(--ease); }
.reader-layout.panel-open .reader-study-panel { opacity: 1; transform: none; pointer-events: auto; }
.reader-panel-card { padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-md); }
.reader-panel-head { display: flex; justify-content: space-between; gap: 16px; align-items: center; }
.reader-panel-head button { width: 36px; height: 36px; display: grid; place-items: center; border: 0; background: transparent; border-radius: var(--radius-sm); color: var(--muted); }
.reader-panel-word { margin: 20px 0 4px; font-family: var(--reading-font); font-size: 33.9px; font-weight: 500; }
.reader-panel-reading { color: var(--pale); font-size: 14.69px; }
.reader-panel-meaning { margin: 20px 0 0; font-size: 19.21px; }
.reader-panel-definition { margin: 12px 0 0; color: var(--muted); font-size: 15.82px; line-height: 1.836; }
.reader-panel-example { margin: 18px 0 0; padding: 15px 0 0; border-top: 1px solid var(--line); color: var(--muted); font-family: var(--reading-font); line-height: 1.858; }
.reader-panel-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 20px; }
.reader-panel-actions button { min-height: 42px; }
.reader-panel-empty { color: var(--muted); font-size: 15.82px; line-height: 1.836; }
.article-end-nav { margin-top: 48px; display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); }
.article-end-nav button { min-height: 92px; border: 0; background: transparent; text-align: left; padding: 18px 0; }
.article-end-nav button:last-child { text-align: right; }

/* Questions and practice */
.answer-grid { display: grid; gap: 10px; margin-top: 18px; }
.answer-button { min-height: 54px; padding: 13px 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); text-align: left; }
.answer-button:hover { border-color: var(--line-strong); background: var(--surface-3); }
.answer-button.correct { border-color: var(--success); background: var(--success-soft); }
.answer-button.wrong { border-color: var(--danger); background: var(--danger-soft); }
.question-panel { margin-top: 30px; }
.question-panel h2 { margin-top: 7px; font-family: var(--reading-font); font-weight: 500; }

/* Vocabulary */
.vocab-proof { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin: 26px 0; padding: 24px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.vocab-proof strong { display: block; margin-top: 4px; font-family: var(--reading-font); font-size: 42.94px; font-weight: 500; }
.vocab-proof p { margin: 4px 0 0; color: var(--muted); }
.path-item { min-height: 106px; }
.path-item > span:first-child { min-width: 0; flex: 1; }
.path-item small { display: block; color: var(--accent); font-size: 12.43px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.path-item.selected { background: color-mix(in srgb, var(--accent-soft) 52%, transparent); }
.search-box { display: grid; gap: 8px; }
.search-box label { color: var(--muted); font-size: 14.69px; }
.search-box input, .form-group input, .form-group select, .form-group textarea, .admin-filterbar input, .admin-filterbar select {
  width: 100%; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); padding: 11px 12px;
}
.search-results { margin-top: 12px; border-top: 1px solid var(--line); }
.search-results > button { width: 100%; display: grid; grid-template-columns: minmax(0,1fr) minmax(220px,.7fr); gap: 18px; padding: 16px 0; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; }
.search-results strong { font-size: 19.21px; }
.search-results small, .search-results em { display: block; color: var(--muted); font-style: normal; }
.study-card { padding: 46px 34px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); text-align: center; background: transparent; }
.study-card.compact { padding-block: 30px; }
.card-meta { display: flex; justify-content: space-between; gap: 12px; color: var(--pale); font-size: 13.56px; }
.study-word { margin: 44px 0 10px; font-family: var(--reading-font); font-size: clamp(56.5px, 9.04vw, 83.62px); line-height: 1.08; }
.kana-word { font-size: 99.44px; }
.phonetic { color: var(--muted); }
.audio-button { margin: 26px auto 0; display: inline-flex; align-items: center; gap: 8px; border: 0; background: transparent; color: var(--accent); }
.answer-reveal { max-width: 620px; margin: 34px auto 0; text-align: left; }
.meaning { font-size: 23.73px; }
.definition { color: var(--muted); }
.definition span { margin-right: 8px; color: var(--pale); font-size: 12.43px; }
.answer-reveal blockquote { margin: 24px 0 0; padding: 18px 0 0; border-top: 1px solid var(--line); font-family: var(--reading-font); font-size: 20.34px; line-height: 1.836; }
.answer-reveal blockquote small { display: block; margin-top: 8px; color: var(--muted); font-family: var(--ui-font); font-size: 14.69px; }
.rating-row { display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; margin-top: 18px; }
.rating-row button { min-height: 66px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: transparent; }
.rating-row strong, .rating-row small { display: block; }
.rating-row small { color: var(--muted); font-size: 12.43px; }

/* Review & progress */
.review-hero { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 28px; padding-bottom: 34px; border-bottom: 1px solid var(--line); }
.review-number { font-family: var(--reading-font); font-size: 103.96px; line-height: 0.864; color: var(--accent-strong); }
.review-number small { display: block; margin-top: 12px; color: var(--pale); font-family: var(--ui-font); font-size: 14.69px; }
.review-actions { display: grid; gap: 10px; margin-top: 28px; }
.summary-grid { display: grid; grid-template-columns: repeat(3,1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.summary-grid > div { padding: 20px; border-right: 1px solid var(--line); }
.summary-grid > div:last-child { border-right: 0; }
.summary-grid span { display: block; color: var(--pale); font-size: 13.56px; }
.summary-grid strong { display: block; margin-top: 6px; font-family: var(--reading-font); font-size: 33.9px; font-weight: 500; }
.progress-page-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; }
.progress-chart { min-height: 260px; display: flex; align-items: end; gap: 14px; padding: 24px 0; border-bottom: 1px solid var(--line); }
.progress-chart span { flex: 1; min-height: 8px; background: var(--accent-soft); border-top: 2px solid var(--accent); }
.progress-chart small { display: block; margin-top: 8px; color: var(--pale); font-size: 11.3px; }
.progress-stat-list { border-top: 1px solid var(--line); }
.progress-stat-list div { display: flex; justify-content: space-between; gap: 20px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.progress-stat-list span { color: var(--muted); }

/* Complete / empty / loading */
.result-panel { max-width: 650px; margin: 50px auto 0; text-align: center; }
.result-level { margin: 20px 0 12px; font-family: var(--reading-font); font-size: 85.88px; line-height: 1.08; color: var(--accent-strong); }
.result-level small { font-size: 22.6px; color: var(--pale); }
.result-panel p { color: var(--muted); line-height: 1.944; }
.completion-summary { display: grid; grid-template-columns: repeat(3,1fr); margin: 34px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.completion-summary div { padding: 18px; border-right: 1px solid var(--line); }
.completion-summary div:last-child { border-right: 0; }
.completion-summary span { display: block; color: var(--pale); font-size: 13.56px; }
.completion-summary strong { display: block; margin-top: 5px; font-size: 27.12px; font-weight: 550; }
.empty-state { padding: 52px 20px; text-align: center; color: var(--muted); }
.empty-state h2 { margin: 18px 0 8px; color: var(--text); font-family: var(--reading-font); font-weight: 500; }
.empty-mark { width: 48px; height: 48px; margin: 0 auto; display: grid; place-items: center; color: var(--accent); }
.empty-inline { padding: 18px 0; color: var(--muted); }
.skeleton-card, .admin-loading { padding: 24px 0; }
.skeleton-line { height: 12px; margin: 12px 0; border-radius: 3px; background: linear-gradient(90deg, var(--surface-3), white, var(--surface-3)); background-size: 200% 100%; animation: shimmer 1.3s infinite linear; }
.skeleton-line.wide { width: 78%; }
.skeleton-line.short { width: 42%; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* Method explanation */
.method-why { margin: 38px 0; padding: 24px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.method-why h2 { margin: 7px 0 10px; font-family: var(--reading-font); font-weight: 500; }
.method-why p { margin: 0; color: var(--muted); line-height: 1.922; }
.method-why small { display: block; margin-top: 12px; color: var(--pale); }
.difficulty-switch { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 24px 0; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.difficulty-switch-copy strong, .difficulty-switch-copy small { display: block; }
.difficulty-switch-copy small { color: var(--muted); }
.difficulty-options { display: flex; gap: 4px; padding: 3px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.difficulty-options button { min-height: 34px; border: 0; border-radius: 4px; background: transparent; padding: 0 10px; color: var(--muted); }
.difficulty-options button.active { background: var(--accent-soft); color: var(--accent-strong); }

/* Shadowing / Army */
.shadow-mode-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 18px; }
.shadow-mode-card { min-height: 190px; display: flex; align-items: flex-end; gap: 18px; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); text-align: left; }
.shadow-mode-card:hover { border-color: var(--line-strong); }
.shadow-mode-card strong, .shadow-mode-card small, .shadow-mode-card em { display: block; }
.shadow-mode-card strong { margin-top: 5px; font-family: var(--reading-font); font-size: 27.12px; font-weight: 500; }
.shadow-mode-card small { color: var(--accent); }
.shadow-mode-card em { margin-top: 6px; color: var(--muted); font-style: normal; }
.shadow-mode-icon { width: 40px; height: 40px; display: grid; place-items: center; color: var(--accent); }
.method-strip { display: grid; grid-template-columns: repeat(4,1fr); margin-top: 30px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.method-strip > div { padding: 18px; border-right: 1px solid var(--line); }
.method-strip > div:last-child { border-right: 0; }
.method-strip strong, .method-strip span, .method-strip small { display: block; }
.method-strip strong { color: var(--accent); font-size: 13.56px; }
.method-strip span { margin-top: 8px; font-weight: 650; }
.method-strip small { margin-top: 4px; color: var(--muted); }
.shadow-stage, .army-stage, .listening-stage { padding: 34px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); text-align: center; }
.shadow-text, .army-prompt { margin: 26px auto 12px; max-width: 760px; font-family: var(--reading-font); font-size: clamp(31.64px,5.65vw,47.46px); line-height: 1.458; }
.shadow-toolbar, .shadow-actions, .army-controls, .record-actions, .audio-controls { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.segmented { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.segmented button { min-height: 34px; border: 0; background: transparent; border-radius: 4px; padding: 0 10px; }
.segmented button.active { background: var(--accent-soft); color: var(--accent-strong); }
.loop-settings, .record-panel { margin-top: 20px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }

/* Blog */
.blog-hub { max-width: 1180px; margin: 0 auto; }
.blog-toolbar { display: grid; grid-template-columns: minmax(260px, 1fr) auto; gap: 20px; align-items: center; margin: 28px 0; }
.blog-search { position: relative; }
.blog-search input { width: 100%; min-height: 48px; padding: 0 16px 0 44px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.blog-search svg { position: absolute; left: 15px; top: 14px; color: var(--pale); }
.blog-category-row { display: flex; flex-wrap: wrap; gap: 6px; }
.blog-category-row button { min-height: 36px; border: 1px solid var(--line); border-radius: 999px; background: transparent; padding: 0 12px; color: var(--muted); }
.blog-category-row button.active { border-color: var(--accent); color: var(--accent-strong); background: var(--accent-soft); }
.blog-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 28px 24px; }
.blog-card { min-width: 0; }
.blog-card-link { display: block; color: inherit; text-decoration: none; }
.blog-card-media { aspect-ratio: 16/10; overflow: hidden; border-radius: var(--radius); background: var(--surface-3); }
.blog-card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 260ms var(--ease); }
.blog-card:hover .blog-card-media img { transform: scale(1.018); }
.blog-card-body { padding: 17px 2px 0; }
.blog-card-meta { display: flex; gap: 10px; color: var(--pale); font-size: 13.56px; }
.blog-card h2 { margin: 9px 0 8px; font-family: var(--reading-font); font-weight: 500; font-size: 25.99px; line-height: 1.458; }
.blog-card p { margin: 0; color: var(--muted); }
.blog-card-action { display: inline-flex; align-items: center; gap: 7px; margin-top: 15px; color: var(--accent-strong); font-weight: 600; font-size: 15.82px; }
.blog-detail { max-width: 780px; margin: 0 auto; }
.blog-hero-cover { width: 100%; aspect-ratio: 16/8; object-fit: cover; border-radius: var(--radius-lg); margin: 28px 0 38px; }
.blog-detail-meta { display: flex; flex-wrap: wrap; gap: 10px 18px; color: var(--pale); font-size: 14.69px; }
.article-body { font-family: var(--reading-font); font-size: 21.47px; line-height: 2.009; }
.article-body h1 { margin: 0 0 20px; font-size: 47.46px; line-height: 1.296; }
.article-body h2 { margin: 48px 0 16px; font-size: 32.77px; }
.article-body p { margin: 0 0 22px; }
.article-body li { margin: 8px 0; }
.article-tool-cta { margin-top: 42px; padding: 24px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.tool-link-grid { display: grid; gap: 10px; }

/* Forms / account */
.form-group { display: grid; gap: 7px; margin-bottom: 16px; }
.form-group label, .form-group > span { color: var(--muted); font-size: 14.69px; }
.form-group textarea { resize: vertical; min-height: 120px; }
.form-grid, .auth-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 18px; }
.auth-panel { padding: 26px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.auth-panel h2 { font-family: var(--reading-font); font-weight: 500; }
.checkbox-field, .contact-consent { display: flex; align-items: flex-start; gap: 9px; color: var(--muted); }
.contact-form { max-width: 760px; }
.settings-list > button > span:first-child { flex: 1; }

/* CMS */
.admin-shell { max-width: 1240px; margin: 0 auto; }
.admin-tabs { display: flex; gap: 4px; overflow-x: auto; padding: 4px 0 14px; border-bottom: 1px solid var(--line); scrollbar-width: thin; }
.admin-tabs button { min-height: 38px; flex: 0 0 auto; border: 0; background: transparent; border-radius: var(--radius-sm); padding: 0 12px; color: var(--muted); }
.admin-tabs button.active { background: var(--accent-soft); color: var(--accent-strong); }
.admin-toolbar { display: flex; justify-content: space-between; gap: 20px; align-items: center; padding: 22px 0 16px; }
.admin-toolbar strong, .admin-toolbar small { display: block; }
.admin-toolbar small { margin-top: 3px; color: var(--pale); }
.admin-filterbar { display: grid; grid-template-columns: 1fr 190px; gap: 10px; margin-bottom: 14px; }
.admin-filterbar label { position: relative; }
.admin-filterbar label svg { position: absolute; left: 12px; top: 12px; color: var(--pale); }
.admin-filterbar label input { padding-left: 40px; }
.admin-table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.admin-table { width: 100%; border-collapse: collapse; min-width: 760px; font-size: 15.82px; }
.admin-table th { padding: 13px 14px; background: var(--surface-2); color: var(--muted); font-weight: 600; text-align: left; position: sticky; top: 0; }
.admin-table td { padding: 14px; border-top: 1px solid var(--line); vertical-align: top; }
.admin-table tr:hover td { background: color-mix(in srgb, var(--surface-3) 56%, white); }
.admin-thumb { width: 64px; aspect-ratio: 16/10; object-fit: cover; border-radius: 4px; }
.admin-row-actions { display: flex; gap: 8px; white-space: nowrap; }
.admin-pagination { display: flex; justify-content: center; align-items: center; gap: 14px; margin-top: 18px; }
.admin-editor { display: grid; grid-template-columns: minmax(0,1fr) 280px; gap: 38px; margin-top: 28px; }
.admin-editor-title { display: flex; justify-content: space-between; gap: 18px; align-items: start; margin-bottom: 24px; }
.admin-editor-title h2 { margin-top: 4px; font-family: var(--reading-font); font-weight: 500; }
.autosave-status { color: var(--pale); font-size: 13.56px; }
.admin-editor-side { position: sticky; top: 90px; align-self: start; padding: 20px; border-left: 1px solid var(--line); color: var(--muted); font-size: 14.69px; }
.schedule-box { margin: 26px 0; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); }
.schedule-fields { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; }
.sticky-editor-actions { position: sticky; bottom: 16px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(12px); }
.admin-status { display: flex; gap: 14px; align-items: center; padding: 16px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.admin-status span { color: var(--accent); }

/* Theme Studio */
.theme-studio { max-width: 1180px; margin: 0 auto; }
.theme-workspace { display: grid; grid-template-columns: minmax(0,1fr) 370px; gap: 42px; margin-top: 28px; }
.theme-section { padding: 24px 0; border-bottom: 1px solid var(--line); }
.theme-color-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 10px; }
.theme-color-field { display: grid; grid-template-columns: 1fr 42px auto; gap: 10px; align-items: center; padding: 10px 0; }
.theme-color-field input { width: 42px; height: 32px; border: 0; background: transparent; }
.theme-color-field code { color: var(--pale); }
.theme-select-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 12px; }
.theme-preview { position: sticky; top: 90px; align-self: start; }
.theme-preview-card { margin: 12px 0 24px; padding: 26px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.theme-preview-card h2 { margin: 9px 0; font-family: var(--reading-font); font-weight: 500; }

/* Footer / notices */
.site-footer { margin-top: auto; border-top: 1px solid var(--line); background: #FBFAF7; }
.footer-inner { max-width: var(--content); margin: 0 auto; padding: 40px 44px; }
.footer-brand { display: grid; grid-template-columns: 180px minmax(0,520px); gap: 24px; align-items: start; }
.footer-brand strong { font-size: 20.34px; }
.footer-brand p { margin: 0; color: var(--muted); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 28px; }
.site-footer nav button { border: 0; background: transparent; padding: 0; color: var(--muted); font-size: 14.69px; }
.footer-note { display: flex; justify-content: space-between; gap: 20px; margin-top: 32px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--pale); font-size: 12.43px; }
.toast { position: fixed; z-index: 120; right: 24px; bottom: 24px; max-width: 360px; padding: 12px 15px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--text); color: white; opacity: 0; transform: translateY(8px); pointer-events: none; transition: opacity 180ms var(--ease), transform 180ms var(--ease); }
.toast.show { opacity: 1; transform: none; }
.cookie-banner { position: fixed; z-index: 110; left: calc(var(--sidebar) + 24px); right: 24px; bottom: 24px; display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-md); }
.cookie-banner[hidden] { display: none; }
.cookie-banner p { margin: 0; color: var(--muted); }
.cookie-banner div { display: flex; flex: 0 0 auto; gap: 8px; }

/* Misc existing components */
.commerce-panel, .account-bar, .category-feature, .category-index, .category-list, .category-row, .sentence-library-summary, .shadow-word-start, .army-principle, .principle-grid, .army-summary { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 20px 0; }
.category-row, .category-list button { width: 100%; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; padding: 16px 0; }
.principle-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 20px; }
.principle-mark { color: var(--accent); }
.audio-main { width: 74px; height: 74px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); }
.audio-main small { display: block; font-size: 11.3px; }

/* Responsive */
@media (max-width: 1180px) {
  :root { --sidebar: 204px; }
  .main-content { padding-inline: 30px; }
  .home-primary { grid-template-columns: 1fr; }
  .home-today { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 24px; }
  .today-count { margin: 0; }
  .reader-layout.panel-open { grid-template-columns: minmax(0, var(--reading)) 300px; gap: 32px; }
}

@media (max-width: 900px) {
  .app-shell { display: block; padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
  .app-sidebar { display: none; }
  .app-main { min-height: 100dvh; }
  .topbar { padding: 9px 18px; min-height: 60px; }
  .mobile-brand { display: block; }
  .mobile-brand .brand-word small { display: none; }
  .mobile-brand .brand-mark { width: 32px; height: 32px; }
  .topbar-context { display: none; }
  .account-button span { display: none; }
  .account-button { width: 40px; padding: 0; justify-content: center; }
  .main-content { padding: 28px 20px 56px; }
  .bottom-nav {
    position: fixed; z-index: 70; left: 0; right: 0; bottom: 0; min-height: 66px;
    display: grid; grid-template-columns: repeat(5,1fr); padding-bottom: env(safe-area-inset-bottom);
    border-top: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(16px);
  }
  .bottom-nav button { min-height: 60px; border: 0; background: transparent; color: var(--pale); }
  .bottom-nav button span { display: grid; place-items: center; }
  .bottom-nav svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.65; }
  .bottom-nav small { display: block; margin-top: 3px; font-size: 11.3px; }
  .bottom-nav button.active { color: var(--accent-strong); }
  body[data-page-route="reading"] .bottom-nav { transform: translateY(110%); pointer-events: none; }
  .reading-progress-rail { left: 0; }
  .footer-inner { padding: 34px 20px 110px; }
  .cookie-banner { left: 14px; right: 14px; bottom: calc(78px + env(safe-area-inset-bottom)); flex-direction: column; align-items: stretch; }
  .cookie-banner div { flex-wrap: wrap; }
  .home-progress-row { grid-template-columns: repeat(2,1fr); }
  .home-progress-row div:nth-child(2) { border-right: 0; }
  .home-progress-row div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .home-module-grid, .learning-module-grid { grid-template-columns: 1fr; }
  .reader-layout, .reader-layout.panel-open { display: block; }
  .reader-study-panel {
    position: fixed; z-index: 100; left: 0; right: 0; bottom: 0; top: auto; opacity: 0; transform: translateY(102%); pointer-events: none;
    padding: 12px 12px calc(12px + env(safe-area-inset-bottom)); transition: opacity 220ms var(--ease), transform 220ms var(--ease);
  }
  .reader-layout.panel-open .reader-study-panel { opacity: 1; transform: none; pointer-events: auto; }
  .reader-panel-card { max-height: min(68dvh, 620px); overflow: auto; border-radius: 16px 16px 10px 10px; }
  .reader-panel-card::before { content:""; display:block; width:42px; height:4px; border-radius:999px; margin:0 auto 16px; background:var(--line-strong); }
  .reader-copy { font-size: 20.34px; line-height: 2.009; }
  .reader-title { font-size: 40.68px; }
  .reader-topline { margin-bottom: 30px; }
  .blog-grid { grid-template-columns: repeat(2,1fr); }
  .progress-page-grid, .theme-workspace, .admin-editor { grid-template-columns: 1fr; }
  .admin-editor-side, .theme-preview { position: static; border-left: 0; border-top: 1px solid var(--line); padding: 20px 0; }
  .schedule-fields { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .topbar { padding-inline: 14px; }
  .language-switch select { max-width: 118px; min-height: 38px; }
  .main-content { padding: 22px 20px 50px; }
  .page-title { margin-bottom: 28px; }
  .page-title h1 { font-size: 38.42px; }
  .continue-reading { min-height: 390px; padding: 28px 24px; }
  .continue-reading h1 { font-size: 44.07px; }
  .continue-actions { align-items: stretch; flex-direction: column; }
  .continue-actions button { width: 100%; }
  .home-today { display: block; }
  .today-count { margin: 28px 0 16px; font-size: 72.32px; }
  .home-list-item { grid-template-columns: 74px minmax(0,1fr); }
  .home-list-action { display: none; }
  .home-list-copy strong { font-size: 20.34px; }
  .summary-grid, .completion-summary { grid-template-columns: 1fr; }
  .summary-grid > div, .completion-summary div { border-right: 0; border-bottom: 1px solid var(--line); }
  .summary-grid > div:last-child, .completion-summary div:last-child { border-bottom: 0; }
  .rating-row { grid-template-columns: repeat(2,1fr); }
  .difficulty-switch { align-items: stretch; flex-direction: column; }
  .difficulty-options { display: grid; grid-template-columns: repeat(3,1fr); }
  .shadow-mode-grid, .blog-grid, .form-grid, .auth-grid, .theme-color-grid, .theme-select-grid, .principle-grid { grid-template-columns: 1fr; }
  .method-strip { grid-template-columns: repeat(2,1fr); }
  .method-strip > div:nth-child(2) { border-right: 0; }
  .method-strip > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .blog-toolbar { grid-template-columns: 1fr; }
  .article-body { font-size: 20.34px; }
  .article-body h1 { font-size: 38.42px; }
  .reader-tools-inline { overflow-x: auto; justify-content: flex-start; }
  .reader-meta { gap: 6px 12px; }
  .reader-topline { position: sticky; top: 58px; z-index: 15; margin-inline: -20px; padding: 8px 20px; background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(12px); }
  .article-end-nav { grid-template-columns: 1fr; }
  .article-end-nav button:last-child { text-align: left; border-top: 1px solid var(--line); }
  .admin-filterbar { grid-template-columns: 1fr; }
  .admin-toolbar { align-items: flex-start; flex-direction: column; }
  .footer-brand { grid-template-columns: 1fr; }
  .footer-note { flex-direction: column; }
  .toast { left: 14px; right: 14px; bottom: calc(80px + env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
.reader-page[data-font-scale="large"] .reader-copy { font-size: 23.73px; }
.reader-page[data-font-scale="extra"] .reader-copy { font-size: 25.99px; line-height: 2.074; }
.reader-panel-example small { display:block; margin-top:8px; color:var(--pale); font-family:var(--ui-font); font-size:13.56px; }
.progress-chart > div { flex:1; display:flex; flex-direction:column; justify-content:flex-end; min-height:160px; }
.progress-chart > div > span { width:100%; height:100%; }

/* =========================================================
   LexiLoop v5 — Calm Editorial Learning
   Reading-first desktop + purpose-built mobile layouts
   ========================================================= */
:root {
  --bg: #F7F6F2;
  --surface: #FFFFFF;
  --surface-2: #F2F0EA;
  --surface-3: #EFEEE9;
  --text: #242422;
  --muted: #6F706C;
  --pale: #969791;
  --line: #E4E2DC;
  --line-strong: #CBC8BF;
  --accent: #526D82;
  --accent-strong: #3F586B;
  --accent-soft: #E8EDF0;
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --sidebar: 224px;
  --content: 1240px;
  --reading: 720px;
  --ui-font: Inter, "Noto Sans TC", "Noto Sans JP", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --reading-font: "Noto Serif TC", "Noto Serif JP", "Source Han Serif TC", "Songti TC", Georgia, serif;
}

body { letter-spacing: .002em; }
h1, h2, h3 { text-wrap: balance; }
.primary-button, .secondary-button, .danger-button, .icon-button { border-radius: var(--radius-sm); }
.primary-button { box-shadow: none; }
.primary-button:hover { background: #334B5D; }
.main-content { padding-top: 38px; }
.app-sidebar { background: #F2F0EA; padding-inline: 18px; }
.app-sidebar .brand { padding: 2px 8px 18px; }
.brand-mark { width: 36px; height: 36px; }
.brand-mark svg { color: var(--accent); }
.desktop-nav { margin-top: 24px; }
.desktop-nav button, .sidebar-secondary button { border-radius: 6px; padding-inline: 10px; }
.desktop-nav button.active { background: rgba(82,109,130,.09); }
.topbar { background: rgba(255,255,255,.94); box-shadow: none; }
.site-footer { background: #F2F0EA; }

/* Home — editorial hierarchy, not a dashboard */
.editorial-home { max-width: 1120px; }
.home-masthead {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  gap: 80px;
  align-items: end;
  padding: 24px 0 48px;
  border-bottom: 1px solid var(--line);
}
.home-masthead h1 {
  max-width: 760px;
  margin: 12px 0 18px;
  font-family: var(--reading-font);
  font-size: clamp(51.98px, 6.215vw, 85.88px);
  font-weight: 500;
  line-height: 1.166;
  letter-spacing: -.045em;
}
.home-masthead > div:first-child > p { max-width: 620px; margin: 0; color: var(--muted); font-size: 19.21px; line-height: 1.944; }
.home-level-note { padding: 0 0 4px 24px; border-left: 1px solid var(--line); }
.home-level-note > span, .home-level-note > small { display: block; color: var(--pale); font-size: 13.56px; }
.home-level-note > strong { display: block; margin: 8px 0 4px; font-family: var(--reading-font); font-size: 42.94px; font-weight: 500; color: var(--accent-strong); }
.home-level-note .text-button { margin-top: 16px; font-size: 14.69px; }

.continue-editorial {
  display: grid;
  grid-template-columns: minmax(250px, .72fr) minmax(0, 1.28fr);
  gap: 64px;
  align-items: center;
  padding: 64px 0;
  border-bottom: 1px solid var(--line);
}
.continue-cover { margin: 0; }
.continue-cover img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border: 1px solid var(--line); }
.continue-cover figcaption { margin-top: 10px; color: var(--pale); font-size: 13.56px; letter-spacing: .04em; text-transform: uppercase; }
.continue-story h2 { max-width: 690px; margin: 12px 0 18px; font-family: var(--reading-font); font-size: clamp(42.94px, 4.52vw, 65.54px); font-weight: 500; line-height: 1.21; letter-spacing: -.035em; }
.continue-story > p { max-width: 650px; color: var(--muted); font-size: 19.21px; line-height: 1.998; }
.continue-story .progress-track { margin-top: 18px; }
.continue-story .continue-meta { margin-top: 22px; }

.today-brief {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
}
.today-brief h2 { margin: 4px 0; font-family: var(--reading-font); font-size: 29.38px; font-weight: 500; }
.today-brief p { margin: 0; color: var(--muted); }
.editorial-section { margin-top: 64px; }
.editorial-reading-list { border-top: 1px solid var(--line); }
.editorial-reading-row {
  width: 100%;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  min-height: 92px;
  padding: 17px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
  transition: background 170ms var(--ease), padding 170ms var(--ease);
}
.editorial-reading-row:hover { padding-inline: 12px; background: rgba(239,238,233,.72); }
.reading-index { color: var(--pale); font-family: var(--reading-font); font-size: 18.08px; }
.reading-row-copy strong { display: block; font-family: var(--reading-font); font-size: 24.86px; font-weight: 500; }
.reading-row-copy small { display: block; margin-top: 5px; color: var(--muted); }
.reading-row-arrow { color: var(--accent); }
.recommendation-strip { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 26px; }
.recommendation-item { display: block; border: 0; padding: 0; background: transparent; text-align: left; }
.recommendation-cover { display: block; aspect-ratio: 4 / 3; overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); }
.recommendation-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform 220ms var(--ease); }
.recommendation-item:hover img { transform: scale(1.015); }
.recommendation-item small { display: block; margin-top: 14px; color: var(--pale); }
.recommendation-item strong { display: block; margin-top: 5px; font-family: var(--reading-font); font-size: 23.73px; font-weight: 500; line-height: 1.458; }
.recommendation-item em { display: inline-flex; align-items: center; gap: 7px; margin-top: 12px; color: var(--accent); font-style: normal; font-size: 14.69px; }

/* Learning hub */
.learning-hub { max-width: 1120px; margin: 0 auto; }
.learning-resume {
  display: grid;
  grid-template-columns: 210px minmax(0,1fr);
  gap: 40px;
  align-items: center;
  padding: 28px 0 44px;
  border-bottom: 1px solid var(--line);
}
.learning-resume-art img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border: 1px solid var(--line); }
.learning-resume-copy h2 { margin: 10px 0 12px; font-family: var(--reading-font); font-size: 42.94px; font-weight: 500; }
.learning-resume-copy p { max-width: 650px; margin: 0; color: var(--muted); line-height: 1.944; }
.learning-resume-copy .button-row { margin-top: 22px; }
.learning-hub-layout { display: grid; grid-template-columns: minmax(0,1fr) 300px; gap: 72px; align-items: start; margin-top: 54px; }
.learning-group + .learning-group { margin-top: 58px; }
.learning-group-head { display: flex; align-items: baseline; gap: 18px; margin-bottom: 14px; }
.learning-group-head > span { color: var(--pale); font-family: var(--reading-font); font-size: 16.95px; }
.learning-group-head small { display: block; color: var(--pale); font-size: 12.43px; letter-spacing: .12em; text-transform: uppercase; }
.learning-group-head h2 { margin: 2px 0 0; font-family: var(--reading-font); font-size: 33.9px; font-weight: 500; }
.learning-tool-list { border-top: 1px solid var(--line); }
.learning-tool-row {
  width: 100%;
  display: grid;
  grid-template-columns: 44px minmax(0,1fr) auto 24px;
  gap: 16px;
  align-items: center;
  min-height: 92px;
  padding: 16px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
  transition: background 170ms var(--ease), padding 170ms var(--ease);
}
.learning-tool-row:hover { padding-inline: 10px; background: rgba(239,238,233,.7); }
.learning-tool-icon { width: 38px; height: 38px; display: grid; place-items: center; color: var(--accent); }
.learning-tool-icon svg { width: 21px; height: 21px; }
.learning-tool-copy strong { display: block; font-size: 19.21px; font-weight: 620; }
.learning-tool-copy small { display: block; margin-top: 4px; color: var(--muted); }
.learning-tool-meta { color: var(--pale); font-size: 13.56px; white-space: nowrap; }
.learning-tool-arrow { color: var(--accent); }
.learning-plan-aside { position: sticky; top: 96px; padding-left: 28px; border-left: 1px solid var(--line); }
.learning-level { display: flex; align-items: end; justify-content: space-between; margin: 12px 0 20px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.learning-level small { color: var(--pale); }
.learning-level strong { font-family: var(--reading-font); font-size: 42.94px; font-weight: 500; color: var(--accent-strong); }
.learning-plan-aside .difficulty-switch { display: block; padding: 0 0 22px; border: 0; border-bottom: 1px solid var(--line); }
.learning-plan-aside .difficulty-options { margin-top: 13px; display: grid; grid-template-columns: repeat(3,1fr); }
.learning-plan-stats { padding: 18px 0; border-bottom: 1px solid var(--line); }
.learning-plan-stats > div { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; }
.learning-plan-stats span { color: var(--muted); }
.learning-plan-stats strong { font-weight: 620; }
.learning-plan-note { padding-top: 20px; }
.learning-plan-note p { color: var(--muted); font-size: 14.69px; line-height: 1.836; }

/* Practice pages — focused main task + quiet principle */
.practice-page { max-width: 1080px; margin: 0 auto; }
.practice-layout { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 68px; align-items: start; }
.practice-layout-wide { grid-template-columns: minmax(0, 1fr) 300px; }
.practice-main { min-width: 0; }
.practice-aside { position: sticky; top: 96px; padding-left: 24px; border-left: 1px solid var(--line); }
.practice-aside h2 { margin: 8px 0 12px; font-family: var(--reading-font); font-size: 27.12px; font-weight: 500; line-height: 1.404; }
.practice-aside p { color: var(--muted); font-size: 15.82px; line-height: 1.944; }
.practice-fit { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }
.practice-fit strong, .practice-fit span { display: block; }
.practice-fit strong { font-size: 13.56px; letter-spacing: .08em; text-transform: uppercase; }
.practice-fit span { margin-top: 5px; color: var(--muted); font-size: 14.69px; line-height: 1.836; }
.practice-aside-meta { display: grid; grid-template-columns: 1fr auto; gap: 8px 18px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.practice-aside-meta span { color: var(--pale); font-size: 13.56px; }
.practice-aside-meta strong { font-weight: 620; }
.practice-progress { margin-bottom: 26px; }
.practice-progress > span { display: block; margin-bottom: 9px; color: var(--muted); font-size: 14.69px; }
.editorial-study-card { min-height: 430px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 42px; border: 1px solid var(--line); background: var(--surface); }
.editorial-study-card .study-word { font-family: var(--reading-font); font-size: clamp(54.24px,7.91vw,88.14px); font-weight: 500; letter-spacing: -.035em; }
.editorial-study-card .phonetic { margin-top: 12px; color: var(--muted); }
.editorial-study-card .audio-button { margin-top: 26px; }
.editorial-study-card .answer-reveal { width: min(100%, 610px); margin-top: 34px; padding-top: 26px; border-top: 1px solid var(--line); }
.editorial-question { min-height: 260px; display: flex; flex-direction: column; justify-content: center; padding: 38px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: transparent; }
.editorial-question h2 { max-width: 720px; font-family: var(--reading-font); font-size: 38.42px; font-weight: 500; line-height: 1.566; }
.editorial-audio-stage { min-height: 320px; display: flex; flex-direction: column; justify-content: center; border: 1px solid var(--line); background: var(--surface); }
.editorial-audio-stage h2 { margin: 8px 0; font-family: var(--reading-font); font-size: 38.42px; font-weight: 500; }
.editorial-audio-stage p { margin: 0; color: var(--muted); }
.answer-grid { margin-top: 18px; }
.answer-button { min-height: 58px; border-radius: 6px; }
.rating-row { margin-top: 14px; }
.rating-row button { border-radius: 6px; }

/* Method pages share the same calm learning language */
.learning-method-page { max-width: 1040px; }
.learning-method-page .method-why, .learning-method-page .method-principle { background: transparent; border: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); border-radius: 0; padding: 26px 0; }
.learning-method-page .shadow-mode-card { border-radius: 10px; box-shadow: none; }
.practice-session-page .shadow-stage, .practice-session-page .army-stage { background: var(--surface); border: 1px solid var(--line); padding-inline: 32px; }
.practice-session-page .record-panel { margin-top: 34px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

/* Reader refinements */
.reader-title { font-weight: 500; letter-spacing: -.035em; }
.reader-copy { text-wrap: pretty; }
.reader-study-panel .reader-panel-card { box-shadow: 0 18px 50px rgba(40,43,40,.07); }
.reader-panel-word { font-family: var(--reading-font); }
.reader-question .answer-grid { max-width: 720px; }

/* Brand assets display (available to CMS/about without changing main navigation) */
.brand-variant-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 20px; }
.brand-variant { padding: 24px; border: 1px solid var(--line); background: var(--surface); }
.brand-variant img { width: 72px; height: 72px; color: var(--accent); }

@media (max-width: 1180px) {
  .home-masthead { gap: 44px; }
  .continue-editorial { gap: 42px; }
  .learning-hub-layout { gap: 44px; }
  .practice-layout { gap: 42px; }
}

@media (max-width: 900px) {
  .main-content { padding-top: 24px; }
  .home-masthead { grid-template-columns: 1fr; gap: 28px; padding-top: 4px; }
  .home-level-note { display: grid; grid-template-columns: 1fr auto; align-items: end; padding: 18px 0 0; border-left: 0; border-top: 1px solid var(--line); }
  .home-level-note small, .home-level-note .text-button { grid-column: 1 / -1; }
  .continue-editorial { grid-template-columns: minmax(170px,.58fr) minmax(0,1.42fr); gap: 30px; }
  .recommendation-strip { gap: 18px; }
  .learning-hub-layout, .practice-layout, .practice-layout-wide { grid-template-columns: 1fr; gap: 40px; }
  .learning-plan-aside, .practice-aside { position: static; padding: 26px 0 0; border-left: 0; border-top: 1px solid var(--line); }
  .learning-resume { grid-template-columns: 160px minmax(0,1fr); gap: 26px; }
}

@media (max-width: 640px) {
  .home-masthead { padding-bottom: 34px; }
  .home-masthead h1 { font-size: 47.46px; line-height: 1.21; }
  .home-masthead > div:first-child > p { font-size: 18.08px; }
  .continue-editorial { display: block; padding: 38px 0; }
  .continue-cover { width: 46%; max-width: 190px; margin-bottom: 26px; }
  .continue-story h2 { font-size: 40.68px; }
  .continue-story > p { font-size: 18.08px; }
  .today-brief { align-items: stretch; flex-direction: column; }
  .today-brief button { width: 100%; }
  .editorial-section { margin-top: 48px; }
  .editorial-reading-row { grid-template-columns: 38px minmax(0,1fr) 20px; gap: 12px; }
  .reading-row-copy strong { font-size: 21.47px; }
  .recommendation-strip { grid-template-columns: 1fr; gap: 30px; }
  .recommendation-item { display: grid; grid-template-columns: 112px minmax(0,1fr); gap: 18px; align-items: center; }
  .recommendation-item small { margin-top: 0; }
  .recommendation-cover { aspect-ratio: 4 / 5; }
  .learning-resume { display: block; padding-top: 0; }
  .learning-resume-art { width: 42%; max-width: 160px; margin-bottom: 24px; }
  .learning-resume-copy h2 { font-size: 36.16px; }
  .learning-hub-layout { margin-top: 40px; }
  .learning-group + .learning-group { margin-top: 46px; }
  .learning-tool-row { grid-template-columns: 38px minmax(0,1fr) 22px; min-height: 86px; gap: 12px; }
  .learning-tool-meta { display: none; }
  .learning-tool-copy strong { font-size: 18.08px; }
  .practice-page .page-title h1 { font-size: 38.42px; }
  .practice-aside { order: 2; }
  .editorial-study-card { min-height: 390px; padding: 32px 22px; }
  .editorial-study-card .study-word { font-size: 58.76px; }
  .editorial-question { min-height: 220px; padding-block: 28px; }
  .editorial-question h2, .editorial-audio-stage h2 { font-size: 31.64px; }
  .editorial-audio-stage { min-height: 280px; padding-inline: 20px; }
  .practice-session-page .shadow-stage, .practice-session-page .army-stage { padding-inline: 18px; }
  .brand-variant-grid { grid-template-columns: 1fr; }
}
body[data-page-route="vocab"] .lesson-shell,
body[data-page-route="shadowing"] .lesson-shell,
body[data-page-route="army"] .lesson-shell,
body[data-page-route="review"] .lesson-shell,
body[data-page-route="progress"] .lesson-shell { max-width: 1040px; }

/* v5.1 product architecture and interaction repair */
html[data-signed-in="false"] .signed-in-only{display:none!important}.public-home,.dashboard-page,.language-portal,.start-page,.exam-page,.reading-library{max-width:1180px;margin:0 auto}.public-hero{display:grid;grid-template-columns:minmax(0,1.45fr) minmax(280px,.55fr);gap:64px;padding:64px 0 72px;border-bottom:1px solid var(--line)}.public-hero h1{font-family:var(--reading-font);font-weight:500;font-size:clamp(49.72px,5.876vw,81.36px);line-height:1.166;letter-spacing:-.035em;max-width:850px;margin:12px 0 24px}.public-hero p{font-size:21.47px;line-height:1.89;max-width:720px}.public-hero-note{align-self:end;border-left:1px solid var(--line);padding-left:32px}.public-hero-note ol{padding-left:20px;line-height:2.16}.vocab-test-cta{margin-top:32px;width:min(520px,100%);display:flex;gap:18px;align-items:center;text-align:left;padding:20px;border:1px solid var(--accent);background:var(--surface);border-radius:10px;color:var(--text)}.vocab-test-cta>span:first-child{display:grid;place-items:center;width:46px;height:46px;background:var(--accent-soft);color:var(--accent)}.vocab-test-cta .ui-icon{width:22px;height:22px}.vocab-test-cta>span:last-child{display:grid;gap:3px;flex:1}.vocab-test-cta em{color:var(--accent);font-style:normal}.public-methods,.public-features,.public-blog,.public-account-cta{padding:64px 0;border-bottom:1px solid var(--line)}.public-methods>div:last-child{display:grid;grid-template-columns:repeat(4,1fr);gap:32px}.public-methods article{padding-top:18px;border-top:1px solid var(--line)}.public-methods article>span{font-size:13.56px;color:var(--pale)}.public-methods h3{font-size:21.47px;margin:18px 0 10px}.public-methods p,.public-features p{color:var(--muted);line-height:1.836}.public-features{display:grid;grid-template-columns:1fr 1fr;gap:64px}.public-blog-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:24px}.public-blog-grid>button{background:none;border:0;border-top:1px solid var(--line);padding:22px 0;text-align:left}.public-blog-grid h3{font-family:var(--reading-font);font-weight:500;font-size:27.12px;line-height:1.458}.public-blog-grid p{color:var(--muted);line-height:1.782}.public-blog-grid span{color:var(--accent)}.public-account-cta{display:flex;justify-content:space-between;gap:32px;align-items:center}.public-account-cta p{max-width:760px;color:var(--muted)}
.sidebar-language-entries{display:grid;gap:8px;padding:20px 12px;border-top:1px solid var(--line);border-bottom:1px solid var(--line)}.sidebar-language-entries>span{font-size:12.43px;text-transform:uppercase;letter-spacing:.12em;color:var(--pale);padding:0 8px}.sidebar-language-entries button,.language-entry-buttons button,.language-mini-actions button,.dashboard-language-actions button{border:1px solid var(--line);background:var(--surface);color:var(--text);border-radius:6px}.sidebar-language-entries button{display:flex;align-items:center;gap:10px;padding:10px}.sidebar-language-entries button strong{display:grid;place-items:center;width:28px;height:28px;background:var(--surface-2);font-size:13.56px}.language-entry-buttons{display:flex;gap:6px}.language-entry-buttons button{padding:8px 12px}.sidebar-note{font-size:12.43px;color:var(--pale);line-height:1.62;padding:10px 18px}.dashboard-head{display:flex;justify-content:space-between;gap:32px;align-items:end;padding:28px 0 32px}.dashboard-head h1{font-family:var(--reading-font);font-weight:500;font-size:45.2px;margin:8px 0}.dashboard-language-actions{display:flex;gap:6px}.dashboard-language-actions button{padding:9px 14px}.dashboard-language-actions .active{background:var(--accent);border-color:var(--accent);color:#fff}.dashboard-grid{display:grid;grid-template-columns:minmax(0,1.5fr) minmax(260px,.5fr);gap:24px}.dashboard-grid>section,.dashboard-grid>aside{border:1px solid var(--line);background:var(--surface);padding:24px;border-radius:10px}.dashboard-trend{min-height:360px}.dashboard-today{display:flex;flex-direction:column}.dashboard-due-number{font-size:72.32px;font-family:var(--reading-font);margin:20px 0}.dashboard-due-number small{font-family:var(--ui-font);font-size:14.69px;color:var(--muted);margin-left:8px}.dashboard-chart{margin-top:24px}.dashboard-chart svg{width:100%;height:210px;overflow:visible}.dashboard-chart .chart-base{stroke:var(--line);stroke-width:.5}.dashboard-chart .chart-line{fill:none;stroke:var(--accent);stroke-width:1.8;vector-effect:non-scaling-stroke}.dashboard-chart circle{fill:var(--surface);stroke:var(--accent);stroke-width:1;vector-effect:non-scaling-stroke}.dashboard-chart>div{display:grid;grid-template-columns:repeat(7,1fr);gap:6px}.dashboard-chart>div span{display:grid;text-align:center;color:var(--muted)}.dashboard-chart strong{font-size:14.69px;color:var(--text)}.dashboard-next{grid-column:1/3;display:flex;justify-content:space-between;align-items:center}.dashboard-recent{grid-column:1/3}.dashboard-reading-list{display:grid;grid-template-columns:1fr 1fr;gap:0 24px}.dashboard-reading-list button{display:flex;justify-content:space-between;align-items:center;text-align:left;padding:16px 0;border:0;border-bottom:1px solid var(--line);background:none}.dashboard-reading-list span{display:grid;gap:4px}.dashboard-reading-list small{color:var(--muted)}.dashboard-locked{max-width:760px;margin:0 auto}.language-portal-hero{display:grid;grid-template-columns:minmax(0,1fr) 280px;gap:48px;padding:48px 0;border-bottom:1px solid var(--line)}.language-code.large{display:grid;place-items:center;width:52px;height:52px;border:1px solid var(--accent);color:var(--accent);font-weight:700}.language-portal-hero h2{font-family:var(--reading-font);font-weight:500;font-size:45.2px;line-height:1.35}.language-portal-hero p{font-size:20.34px;line-height:1.89;color:var(--muted)}.language-portal-hero aside{border-left:1px solid var(--line);padding-left:28px;display:flex;flex-direction:column;justify-content:center}.language-portal-hero aside strong{font-family:var(--reading-font);font-size:63.28px}.language-portal-tools{padding:48px 0}.language-portal-tools>div{display:grid;grid-template-columns:1fr 1fr}.language-portal-tools button{display:grid;grid-template-columns:36px 1fr 24px;align-items:center;text-align:left;gap:14px;padding:20px 0;border:0;border-bottom:1px solid var(--line);background:none}.language-portal-tools button>span{color:var(--accent)}.language-portal-tools button strong,.language-portal-tools button small{grid-column:2}.start-layout{display:grid;grid-template-columns:minmax(0,1fr) 300px;gap:64px}.start-layout>main{padding:32px 0}.start-layout>aside{border-left:1px solid var(--line);padding:32px 0 32px 32px}.start-icon{display:grid;place-items:center;width:48px;height:48px;border:1px solid var(--line);color:var(--accent);margin-bottom:28px}.start-layout main>h2{font-family:var(--reading-font);font-weight:500;font-size:40.68px;line-height:1.458}.start-facts{display:grid;grid-template-columns:repeat(3,1fr);gap:1px;background:var(--line);margin:32px 0}.start-facts>div{background:var(--surface);padding:18px;display:grid;gap:8px}.start-facts span{font-size:13.56px;color:var(--muted)}.start-options{margin:28px 0}.start-options label{display:flex;padding:16px 0;border-bottom:1px solid var(--line);gap:12px}.start-options label span{display:grid;gap:4px}.start-options small{color:var(--muted)}.start-actions{display:flex;gap:12px;margin-top:24px}.learning-tool-row{cursor:pointer}.reading-library-head,.exam-intro{display:flex;justify-content:space-between;gap:32px;align-items:start;padding:24px 0 32px}.reading-library-grid{display:grid;grid-template-columns:1fr 1fr;gap:0 36px}.reading-library-card{display:grid;grid-template-columns:42px 1fr;gap:18px;padding:28px 0;border-top:1px solid var(--line)}.reading-card-number{font-size:13.56px;color:var(--pale)}.reading-library-card h3{font-family:var(--reading-font);font-weight:500;font-size:27.12px}.reading-library-card p{color:var(--muted);line-height:1.782}.exam-form-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:16px}.exam-form-grid button{display:grid;text-align:left;padding:24px;border:1px solid var(--line);background:var(--surface);border-radius:10px;gap:8px}.exam-form-grid button>span{font-size:12.43px;letter-spacing:.12em;color:var(--pale)}.exam-form-grid button strong{font-family:var(--reading-font);font-size:27.12px}.exam-form-grid button small{color:var(--muted)}.exam-skill{margin-top:24px;color:var(--accent);font-size:13.56px;text-transform:uppercase;letter-spacing:.12em}.test-credentials-panel{display:grid;grid-template-columns:1fr auto;gap:10px 18px;align-items:center;margin:16px 0;padding:18px;border:1px solid var(--accent);background:var(--accent-soft);border-radius:8px}.test-credentials-panel strong,.test-credentials-panel small{grid-column:1/-1}.test-credentials-panel code{background:var(--surface);padding:8px 10px;overflow-wrap:anywhere}.difficulty-options button{cursor:pointer;position:relative;z-index:1}.difficulty-options button:focus-visible,.back-button:focus-visible,[data-route]:focus-visible,[data-action]:focus-visible{outline:3px solid color-mix(in srgb,var(--accent) 35%,transparent);outline-offset:2px}.back-button,[data-route],[data-action],[data-language-entry],[data-start-tool],[data-start-exam],[data-exam-answer]{touch-action:manipulation}.brand-mark svg{width:32px;height:32px}.brand-mark{overflow:visible}
@media(max-width:900px){.public-hero,.public-features,.language-portal-hero,.start-layout,.dashboard-grid{grid-template-columns:1fr}.public-methods>div:last-child,.public-blog-grid{grid-template-columns:1fr 1fr}.dashboard-next,.dashboard-recent{grid-column:auto}.dashboard-reading-list,.language-portal-tools>div,.reading-library-grid,.exam-form-grid{grid-template-columns:1fr}.start-layout>aside,.language-portal-hero aside{border-left:0;border-top:1px solid var(--line);padding-left:0}.language-entry-buttons{display:none}}
@media(max-width:640px){.public-home,.dashboard-page,.language-portal,.start-page,.exam-page,.reading-library{padding:0 20px}.public-hero{padding:32px 0 44px;gap:36px}.public-hero h1{font-size:45.2px}.public-methods,.public-features,.public-blog,.public-account-cta{padding:42px 0}.public-methods>div:last-child,.public-blog-grid{grid-template-columns:1fr}.public-account-cta,.dashboard-head,.dashboard-next,.reading-library-head,.exam-intro{align-items:stretch;flex-direction:column}.dashboard-head{display:flex}.dashboard-grid>section,.dashboard-grid>aside{padding:20px}.dashboard-chart svg{height:160px}.dashboard-reading-list{grid-template-columns:1fr}.start-facts{grid-template-columns:1fr}.start-actions{flex-direction:column}.language-portal-hero h2,.start-layout main>h2{font-size:35.03px}.exam-form-grid{grid-template-columns:1fr}.sidebar-language-entries{display:none}.test-credentials-panel{grid-template-columns:1fr}.bottom-nav{padding-bottom:env(safe-area-inset-bottom)}}

/* v5.2 — four-skill navigation and guided writing */
.home-skill-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 24px 0;
}
.skill-entry-card {
  min-height: 164px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: transform 180ms var(--ease), border-color 180ms var(--ease), box-shadow 180ms var(--ease);
}
.skill-entry-card:hover,
.skill-entry-card:focus-visible {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
}
.skill-entry-card > span {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--accent);
}
.skill-entry-card > span svg { width: 21px; height: 21px; }
.skill-entry-card strong { font-size: 19.21px; }
.skill-entry-card small { color: var(--muted); line-height: 1.728; }
.skill-entry-card em {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  font-size: 14.69px;
  font-style: normal;
  font-weight: 650;
}
.skill-entry-card em svg { width: 15px; height: 15px; }

.skill-hub-header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 30px;
  margin: 12px 0 28px;
  padding: 24px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.skill-hub-header h2 {
  margin: 5px 0 8px;
  font-family: var(--reading-font);
  font-size: clamp(31.64px, 4.52vw, 45.2px);
  font-weight: 500;
}
.skill-hub-header p { margin: 0; color: var(--muted); }
.dashboard-language-actions {
  display: inline-flex;
  gap: 6px;
  flex: 0 0 auto;
}
.dashboard-language-actions button {
  min-height: 40px;
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
}
.dashboard-language-actions button.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.writing-page { max-width: 1120px; margin: 0 auto; }
.writing-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 54px;
  align-items: start;
  margin-top: 30px;
}
.writing-prompt-list {
  position: sticky;
  top: 90px;
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line);
}
.writing-prompt-list > .section-kicker { padding: 16px 0 10px; }
.writing-prompt-button {
  width: 100%;
  min-height: 68px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 13px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  text-align: left;
}
.writing-prompt-button span { display: grid; gap: 3px; }
.writing-prompt-button small { color: var(--pale); }
.writing-prompt-button strong { font-weight: 620; }
.writing-prompt-button em { color: var(--accent); font-size: 13.56px; font-style: normal; }
.writing-prompt-button svg { width: 16px; height: 16px; color: var(--pale); }
.writing-prompt-button.active { color: var(--accent-strong); }
.writing-prompt-button.active strong { font-weight: 720; }
.writing-workspace { min-width: 0; }
.writing-brief {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}
.writing-brief > span { color: var(--accent); font-size: 13.56px; font-weight: 700; letter-spacing: .08em; }
.writing-brief h2 { margin: 8px 0 12px; font-family: var(--reading-font); font-size: 33.9px; font-weight: 500; }
.writing-brief p { color: var(--text); font-size: 19.21px; line-height: 1.89; }
.writing-brief ul { margin: 18px 0 0; padding-left: 20px; color: var(--muted); line-height: 1.89; }
.writing-editor { display: grid; gap: 10px; margin-top: 24px; }
.writing-editor > span { font-weight: 650; }
.writing-editor textarea {
  width: 100%;
  min-height: 300px;
  resize: vertical;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: 16px/1.8 var(--ui-font);
}
.writing-editor textarea:focus { outline: 3px solid color-mix(in srgb, var(--accent) 24%, transparent); border-color: var(--accent); }
.writing-editor small { color: var(--muted); }
.writing-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.writing-reference {
  margin-top: 30px;
  padding: 26px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.writing-reference p { color: var(--text); font-size: 18.08px; line-height: 2.052; }
.writing-reference small { color: var(--muted); }

[data-writing-prompt], [data-start-tool], [data-start-exam], [data-exam-answer] { touch-action: manipulation; }

@media (max-width: 900px) {
  .home-skill-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .skill-hub-header { align-items: start; flex-direction: column; }
  .writing-layout { grid-template-columns: 1fr; gap: 28px; }
  .writing-prompt-list { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
  .writing-prompt-list > .section-kicker { grid-column: 1 / -1; }

  .bottom-nav {
    display: flex;
    min-height: 68px;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    scroll-snap-type: x proximity;
  }
  .bottom-nav::-webkit-scrollbar { display: none; }
  .bottom-nav button {
    flex: 0 0 72px;
    min-width: 72px;
    scroll-snap-align: start;
  }
}

@media (max-width: 620px) {
  .home-skill-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .skill-entry-card { min-height: 150px; padding: 14px; }
  .writing-prompt-list { grid-template-columns: 1fr; }
  .writing-brief { padding: 20px; }
  .writing-actions { display: grid; grid-template-columns: 1fr; }
  .writing-actions button { width: 100%; }
}


/* v5.2.2 — global interaction hardening */
.app-main,
.main-content,
#routeView,
#routeView > * {
  position: relative;
  pointer-events: auto;
}
#routeView { isolation: isolate; z-index: 1; }
button,
[role="button"],
label,
input,
select,
textarea,
[data-route],
[data-action],
[data-language-entry],
[data-start-tool],
[data-start-exam],
[data-exam-answer],
[data-difficulty],
[data-writing-prompt] {
  pointer-events: auto !important;
  touch-action: manipulation;
}
button,
[role="button"],
[data-route],
[data-action],
[data-language-entry],
[data-start-tool],
[data-start-exam],
[data-exam-answer],
[data-difficulty],
[data-writing-prompt] {
  position: relative;
  z-index: 2;
}
button > *,
[data-route] > *,
[data-action] > * > *,
[data-language-entry] > *,
[data-start-tool] > *,
[data-start-exam] > *,
[data-exam-answer] > *,
[data-difficulty] > *,
[data-writing-prompt] > *,
button svg,
button use {
  pointer-events: none !important;
}
.content-panel,
.learning-tool-list,
.learning-tool-row,
.difficulty-options,
.auth-panel,
.form-group,
.start-actions,
.button-row {
  position: relative;
  z-index: 1;
  pointer-events: auto;
}
.learning-tool-row,
.difficulty-options button,
.auth-panel button,
.start-actions button,
.button-row button {
  -webkit-tap-highlight-color: rgba(82,109,130,.14);
}

@media (max-width: 900px) {
  html { scroll-padding-bottom: calc(104px + env(safe-area-inset-bottom)); }
  .app-shell { padding-bottom: calc(86px + env(safe-area-inset-bottom)); }
  .main-content { padding-bottom: calc(128px + env(safe-area-inset-bottom)); }
  .bottom-nav {
    height: calc(68px + env(safe-area-inset-bottom));
    max-height: calc(68px + env(safe-area-inset-bottom));
    align-items: stretch;
    contain: layout paint;
  }
  .bottom-nav button { height: 67px; max-height: 67px; }
  .learning-tool-row,
  .start-actions,
  .difficulty-switch,
  .auth-panel button,
  .writing-actions {
    scroll-margin-bottom: calc(100px + env(safe-area-inset-bottom));
  }
}

/* v5.2.3 — calmer Army Method overview and clearer account verification */
.learning-method-page { max-width: 1120px; }
.army-principle {
  margin: 30px 0 24px;
  padding: 38px !important;
  border: 1px solid var(--line) !important;
  border-radius: 18px !important;
  background: var(--surface) !important;
  box-shadow: 0 16px 42px rgba(36,36,34,.045);
}
.army-principle .principle-heading {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 22px;
}
.army-principle .principle-mark {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: var(--accent-soft);
  color: var(--accent-strong);
}
.army-principle .principle-mark svg { width: 23px; height: 23px; }
.army-principle .principle-heading h2 {
  max-width: 760px;
  margin: 7px 0 0;
  font-family: var(--reading-font);
  font-size: clamp(30.51px,3.39vw,42.94px);
  font-weight: 520;
  line-height: 1.382;
  letter-spacing: -.025em;
}
.army-principle > p {
  max-width: 880px;
  margin: 0 0 30px 64px;
  color: var(--muted);
  font-size: 18.08px;
  line-height: 2.106;
}
.army-principle .principle-grid {
  display: grid;
  grid-template-columns: repeat(4,minmax(0,1fr));
  gap: 12px;
  margin-top: 8px;
  padding: 0;
  border: 0;
}
.army-principle .principle-grid > div {
  min-height: 178px;
  padding: 21px 19px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-2);
}
.army-principle .principle-grid strong,
.army-principle .principle-grid span,
.army-principle .principle-grid small { display: block; }
.army-principle .principle-grid strong {
  color: var(--accent-strong);
  font-size: 13.56px;
  letter-spacing: .12em;
}
.army-principle .principle-grid span {
  margin-top: 17px;
  font-family: var(--reading-font);
  font-size: 25.99px;
  font-weight: 560;
}
.army-principle .principle-grid small {
  margin-top: 10px;
  color: var(--muted);
  font-size: 14.69px;
  line-height: 1.836;
}
.army-principle .method-fit {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-top: 18px;
}
.army-principle .method-fit > div {
  padding: 20px 22px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent-soft) 42%, var(--surface));
}
.army-principle .method-fit strong,
.army-principle .method-fit span { display: block; }
.army-principle .method-fit strong {
  margin-bottom: 7px;
  color: var(--accent-strong);
  font-size: 13.56px;
  letter-spacing: .08em;
}
.army-principle .method-fit span {
  color: var(--text);
  font-size: 15.82px;
  line-height: 1.89;
}
.army-summary {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 14px;
  margin: 0 0 52px;
  padding: 0;
  border: 0;
}
.army-summary > div {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  min-height: 112px;
  padding: 23px 24px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
}
.army-summary span { color: var(--muted); font-size: 14.69px; }
.army-summary strong {
  font-family: var(--reading-font);
  font-size: 42.94px;
  font-weight: 520;
  line-height: 1.08;
}
.learning-method-page > .section-header {
  margin: 0 0 22px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}
.learning-method-page > .section-header h2 {
  margin-top: 7px;
  font-family: var(--reading-font);
  font-size: clamp(35.03px,4.52vw,51.98px);
  font-weight: 500;
  line-height: 1.296;
  letter-spacing: -.03em;
}
.army-category-list {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 16px;
  padding: 0;
  border: 0;
}
.army-category-list .category-row {
  display: grid;
  grid-template-columns: 46px minmax(0,1fr) auto;
  align-items: start;
  gap: 16px;
  min-height: 164px;
  padding: 23px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  transition: transform 160ms var(--ease), border-color 160ms var(--ease), box-shadow 160ms var(--ease);
}
.army-category-list .category-row:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: 0 14px 34px rgba(36,36,34,.055);
}
.army-category-list .category-index {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  border-radius: 11px;
  background: var(--surface-2);
  color: var(--accent-strong);
  font-size: 13.56px;
  font-weight: 700;
}
.army-category-list .category-row > span:nth-child(2) { min-width: 0; }
.army-category-list .category-row strong,
.army-category-list .category-row small,
.army-category-list .category-row em { display: block; }
.army-category-list .category-row strong {
  font-family: var(--reading-font);
  font-size: 24.86px;
  font-weight: 560;
  line-height: 1.458;
}
.army-category-list .category-row small {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14.69px;
  line-height: 1.782;
}
.army-category-list .category-row em {
  margin-top: 16px;
  color: var(--pale);
  font-size: 13.56px;
  font-style: normal;
}
.army-category-list .category-row > svg {
  width: 20px;
  height: 20px;
  margin-top: 4px;
  color: var(--accent);
}
.army-category-list .category-feature {
  align-self: start;
  padding: 6px 9px;
  border: 0;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 12.43px;
  white-space: nowrap;
}
.learning-method-page > .notice.top-gap {
  margin-top: 26px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
}

.account-auth-page { max-width: 980px; }
.account-auth-page .auth-grid { gap: 24px; }
.account-auth-page .auth-panel {
  padding: 32px;
  border-radius: 16px;
  box-shadow: 0 12px 34px rgba(36,36,34,.035);
}
.account-auth-page .auth-panel h2 {
  margin: 7px 0 25px;
  font-size: 35.03px;
}
.account-auth-page .auth-panel > small {
  display: block;
  margin-top: -3px;
  color: var(--muted);
  line-height: 1.782;
}
.verification-page { max-width: 720px; }
.verification-card {
  margin-top: 28px;
  padding: 46px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  text-align: center;
  box-shadow: 0 18px 44px rgba(36,36,34,.045);
}
.verification-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  margin: 0 auto 22px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-strong);
}
.verification-icon svg { width: 27px; height: 27px; }
.verification-card h1 {
  margin: 9px 0 14px;
  font-family: var(--reading-font);
  font-size: clamp(38.42px,5.65vw,54.24px);
  font-weight: 520;
}
.verification-card > p { max-width: 540px; margin: 0 auto 26px; color: var(--muted); line-height: 1.998; }
.verification-resend { max-width: 460px; margin: 26px auto 20px; text-align: left; }
.verification-card > .text-button { margin-top: 10px; }

@media (max-width: 900px) {
  .army-principle .principle-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .army-category-list { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .army-principle { padding: 24px !important; border-radius: 14px !important; }
  .army-principle .principle-heading { gap: 13px; }
  .army-principle .principle-mark { width: 40px; height: 40px; flex-basis: 40px; }
  .army-principle > p { margin-left: 0; font-size: 16.95px; }
  .army-principle .principle-grid,
  .army-principle .method-fit { grid-template-columns: 1fr; }
  .army-principle .principle-grid > div { min-height: auto; }
  .army-summary { grid-template-columns: 1fr; gap: 10px; margin-bottom: 40px; }
  .army-summary > div { min-height: 82px; }
  .army-category-list .category-row { grid-template-columns: 42px minmax(0,1fr); min-height: 0; padding: 19px; }
  .army-category-list .category-row > svg,
  .army-category-list .category-feature { grid-column: 2; justify-self: start; }
  .account-auth-page .auth-panel { padding: 24px; }
  .verification-card { padding: 32px 22px; }
}


.mcq-row { margin-top: 18px; }
.mcq-row button { text-align: left; padding: 14px 16px; }
.mcq-row strong { font-size: 20.34px; margin-bottom: 8px; }
.mcq-row small { font-size: 15.82px; line-height: 1.674; color: var(--text); }
.mcq-row button.is-correct { border-color: var(--accent); background: color-mix(in srgb, var(--accent-soft) 68%, white); }
.mcq-row button.is-wrong { border-color: #c96b6b; background: #fff4f4; }
.mcq-row button:disabled { opacity: 1; }

/* v5.2.6 — spacious Army Method overview */
.army-overview {
  display: grid;
  grid-template-columns: minmax(0,1.05fr) minmax(420px,.95fr);
  gap: clamp(34px,5vw,76px);
  align-items: stretch;
  margin: 38px 0 34px;
  padding: clamp(34px,5vw,64px);
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 20px 54px rgba(36,36,34,.045);
}
.army-overview-copy { align-self: center; }
.army-overview-copy h2 {
  max-width: 680px;
  margin: 12px 0 22px;
  font-family: var(--reading-font);
  font-size: clamp(38.42px,5.198vw,65.54px);
  font-weight: 500;
  line-height: 1.231;
  letter-spacing: -.04em;
}
.army-overview-copy > p {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  font-size: 18.08px;
  line-height: 2.106;
}
.army-use-grid {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 14px;
  margin-top: 32px;
}
.army-use-grid > div {
  min-height: 126px;
  padding: 20px 21px;
  border-radius: 14px;
  background: var(--surface-2);
}
.army-use-grid span,
.army-use-grid strong { display: block; }
.army-use-grid span {
  margin-bottom: 11px;
  color: var(--accent-strong);
  font-size: 13.56px;
  font-weight: 700;
  letter-spacing: .09em;
}
.army-use-grid strong {
  font-size: 16.95px;
  font-weight: 600;
  line-height: 1.782;
}
.army-flow-map {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 13px;
  padding: 18px;
  border-radius: 18px;
  background: color-mix(in srgb, var(--accent-soft) 42%, var(--surface-2));
}
.army-flow-map > div {
  position: relative;
  min-height: 202px;
  padding: 22px;
  border: 1px solid color-mix(in srgb, var(--line) 76%, transparent);
  border-radius: 15px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
}
.army-flow-map small {
  position: absolute;
  top: 17px;
  right: 18px;
  color: var(--pale);
  font-size: 13.56px;
  font-weight: 700;
  letter-spacing: .12em;
}
.army-flow-map > div > span {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 24px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent-strong);
}
.army-flow-map svg { width: 22px; height: 22px; }
.army-flow-map strong {
  display: block;
  font-family: var(--reading-font);
  font-size: 28.25px;
  font-weight: 560;
}
.army-flow-map p {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 14.69px;
  line-height: 1.782;
}
.army-summary { margin-top: 0; }
.army-category-list { gap: 20px; }
.army-category-list .category-row { min-height: 184px; padding: 27px; }
.auth-panel button[disabled] { cursor: wait; opacity: .62; }
@media (max-width: 960px) {
  .army-overview { grid-template-columns: 1fr; padding: 34px; }
  .army-flow-map { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 620px) {
  .army-overview { margin-top: 24px; padding: 24px 20px; border-radius: 15px; }
  .army-overview-copy h2 { font-size: 40.68px; }
  .army-use-grid,
  .army-flow-map { grid-template-columns: 1fr; }
  .army-flow-map > div { min-height: 156px; }
}

/* v5.2.9 — independent vocabulary and grammar paths */
.home-core-paths {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 24px;
  padding: 64px 0;
  border-bottom: 1px solid var(--line);
}

.home-core-heading {
  padding-bottom: 8px;
}
.home-core-heading h2 {
  margin: 8px 0 10px;
  font-family: var(--reading-font);
  font-size: clamp(38.42px,4.52vw,58.76px);
  font-weight: 520;
  letter-spacing: -.035em;
}
.home-core-heading p {
  margin: 0;
  color: var(--muted);
  line-height: 1.836;
}

.home-core-card {
  min-height: 300px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 34px;
  padding: clamp(28px,4vw,46px);
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 16px 42px rgba(36,36,34,.035);
}
.home-core-card h2 {
  max-width: 580px;
  margin: 12px 0 18px;
  font-family: var(--reading-font);
  font-size: clamp(35.03px,3.503vw,50.85px);
  font-weight: 520;
  line-height: 1.274;
  letter-spacing: -.035em;
}
.home-core-card p {
  max-width: 600px;
  margin: 0;
  color: var(--muted);
  font-size: 16.95px;
  line-height: 1.998;
}
.home-level-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}
.home-level-tags span {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12.43px;
}
.home-core-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* Vocabulary library and difficulty browser */
.vocab-library-page { max-width: 1180px; }
.vocab-library-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 30px;
  margin: 32px 0 26px;
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}
.vocab-library-head h2 {
  margin: 8px 0 8px;
  font-family: var(--reading-font);
  font-size: clamp(35.03px,4.52vw,54.24px);
  font-weight: 520;
}
.vocab-library-head p { margin: 0; color: var(--muted); }
.vocab-library-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
.vocab-stage-tabs {
  display: grid;
  grid-template-columns: repeat(5,minmax(0,1fr));
  gap: 8px;
  margin: 0 0 24px;
}
.vocab-stage-tabs button {
  min-height: 92px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: transparent;
  text-align: left;
}
.vocab-stage-tabs button.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
}
.vocab-stage-tabs strong,
.vocab-stage-tabs span,
.vocab-stage-tabs small { display: block; }
.vocab-stage-tabs strong { font-size: 16.95px; }
.vocab-stage-tabs span { font-size: 13.56px; }
.vocab-stage-tabs small { color: var(--muted); font-size: 12.43px; }
.vocab-list-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin: 30px 0 14px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.vocab-list-toolbar > div { display: grid; gap: 4px; }
.vocab-list-toolbar small { color: var(--muted); }
.vocab-inline-search { min-width: min(390px,100%); display: grid; gap: 7px; }
.vocab-inline-search span { font-size: 13.56px; color: var(--muted); }
.vocab-inline-search input {
  width: 100%;
  min-height: 44px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
}
.vocab-inline-search em { min-height: 16px; color: var(--muted); font-size: 12.43px; font-style: normal; }
.vocab-search-overlay:not(:empty) {
  margin-bottom: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.vocab-browser-list {
  border-top: 1px solid var(--line);
}
.vocab-browser-row {
  display: grid;
  grid-template-columns: 62px minmax(150px,.7fr) minmax(260px,1.5fr) 126px 42px;
  gap: 18px;
  align-items: center;
  min-height: 84px;
  padding: 14px 4px;
  border-bottom: 1px solid var(--line);
}
.vocab-browser-rank {
  color: var(--pale);
  font-size: 12.43px;
  letter-spacing: .08em;
}
.vocab-browser-word { display: grid; gap: 3px; }
.vocab-browser-word strong {
  font-family: var(--reading-font);
  font-size: 25.99px;
  font-weight: 560;
}
.vocab-browser-word small { color: var(--muted); }
.vocab-browser-row p { margin: 0; color: var(--muted); line-height: 1.674; }
.vocab-browser-level {
  justify-self: start;
  padding: 6px 9px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--accent-strong);
  font-size: 12.43px;
  white-space: nowrap;
}
.vocab-browser-audio {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--accent);
}
.vocab-browser-audio svg { width: 17px; height: 17px; }
.vocab-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin: 28px 0;
}
.vocab-pagination button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 42px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: transparent;
}
.vocab-pagination button:disabled { opacity: .35; cursor: not-allowed; }
.vocab-pagination svg { width: 15px; height: 15px; }
.vocab-pagination span { color: var(--muted); font-size: 13.56px; }
.vocab-library-note {
  margin-top: 20px;
  padding: 22px 24px;
  border-left: 3px solid var(--accent);
  background: var(--surface-2);
}
.vocab-library-note p { margin: 7px 0 0; color: var(--muted); line-height: 1.836; }

/* Stable vocabulary answer layout: no vertical jump after choosing */
.vocab-question-card {
  height: 430px;
  min-height: 430px;
  justify-content: center;
}
.vocab-next-slot {
  width: min(260px,100%);
  height: 50px;
  display: grid;
  place-items: center;
  margin-top: 15px;
}
.vocab-next-inline {
  width: 100%;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
}
.vocab-next-inline svg { width: 17px; height: 17px; }
.vocab-next-placeholder { display: block; width: 100%; height: 48px; visibility: hidden; }
.vocab-feedback-shell {
  height: 164px;
  min-height: 164px;
  margin-top: 16px;
  padding: 16px 18px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}
.vocab-feedback-shell .feedback { padding: 10px 12px; }
.vocab-feedback-shell .answer-reveal {
  width: 100%;
  max-width: none;
  margin: 12px 0 0;
  padding: 0;
  text-align: left;
}
.vocab-feedback-shell .answer-reveal .meaning { font-size: 20.34px; }
.vocab-feedback-shell .answer-reveal .definition,
.vocab-feedback-shell .answer-reveal blockquote { margin-top: 10px; font-size: 14.69px; line-height: 1.728; }
.vocab-feedback-wait {
  display: grid;
  place-items: center;
  height: 100%;
  margin: 0;
  color: var(--pale);
  text-align: center;
}

@media (max-width: 900px) {
  .home-core-paths { grid-template-columns: 1fr; }
  .home-core-card { min-height: 0; }
  .vocab-stage-tabs { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .vocab-browser-row { grid-template-columns: 48px minmax(130px,.8fr) minmax(200px,1.4fr) 40px; }
  .vocab-browser-level { grid-column: 2 / 4; }
}
@media (max-width: 640px) {
  .home-core-paths { padding: 42px 0; }
  .home-core-card { padding: 26px 22px; border-radius: 14px; }
  .home-core-actions > button { width: 100%; }
  .vocab-library-head { align-items: stretch; flex-direction: column; padding: 24px 20px; }
  .vocab-library-actions > button { width: 100%; }
  .vocab-stage-tabs { display: flex; overflow-x: auto; padding-bottom: 5px; }
  .vocab-stage-tabs button { min-width: 145px; }
  .vocab-list-toolbar { align-items: stretch; flex-direction: column; }
  .vocab-inline-search { min-width: 0; }
  .vocab-browser-row {
    grid-template-columns: 42px minmax(0,1fr) 38px;
    gap: 12px;
    min-height: 96px;
  }
  .vocab-browser-row p { grid-column: 2 / 4; }
  .vocab-browser-level { grid-column: 2; }
  .vocab-browser-audio { grid-column: 3; grid-row: 1; }
  .vocab-question-card { height: 390px; min-height: 390px; }
  .vocab-feedback-shell { height: 178px; min-height: 178px; }
  .vocab-pagination { gap: 8px; }
  .vocab-pagination button { padding-inline: 10px; }
}

.public-hero-method-image{align-self:stretch;border-left:0;padding-left:0;display:flex;align-items:flex-end}
.public-hero-method-image img{display:block;width:100%;height:auto;max-height:520px;object-fit:contain;object-position:center bottom;border:1px solid var(--line);background:var(--surface)}
@media (max-width:900px){.public-hero-method-image{align-items:center}.public-hero-method-image img{max-height:none;width:min(100%,620px);margin-inline:auto}}

/* v5.3.2 — larger editorial method visual with a soft lifted shadow */
@media (min-width: 901px) {
  .public-hero {
    grid-template-columns: minmax(0, .88fr) minmax(500px, 1.12fr);
    gap: clamp(42px, 4.5vw, 72px);
    align-items: center;
  }
  .public-hero-method-image {
    align-self: center;
    align-items: center;
  }
  .public-hero-method-image img {
    width: 100%;
    max-height: none;
    aspect-ratio: 1122 / 1402;
    object-fit: cover;
    object-position: center;
    border: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
    border-radius: 3px;
    box-shadow: 0 26px 58px rgba(30, 47, 61, .11), 0 4px 14px rgba(30, 47, 61, .055);
  }
}
@media (max-width: 900px) {
  .public-hero-method-image img {
    width: min(100%, 720px);
    border-radius: 3px;
    box-shadow: 0 18px 42px rgba(30, 47, 61, .10), 0 3px 10px rgba(30, 47, 61, .05);
  }
}

/* v5.3.3 — frameless method visual; ambient foliage shadow only */
.public-hero {
  position: relative;
  isolation: isolate;
}
.public-hero > * {
  position: relative;
  z-index: 1;
}
.public-hero::before {
  content: "";
  position: absolute;
  z-index: 0;
  pointer-events: none;
  left: -7%;
  bottom: -4%;
  width: 360px;
  height: 310px;
  opacity: .16;
  filter: blur(14px);
  transform: rotate(-13deg);
  background:
    radial-gradient(ellipse 35px 80px at 25% 72%, rgba(77,88,72,.48) 0 42%, transparent 47%),
    radial-gradient(ellipse 34px 76px at 42% 55%, rgba(77,88,72,.42) 0 42%, transparent 47%),
    radial-gradient(ellipse 31px 69px at 57% 39%, rgba(77,88,72,.34) 0 42%, transparent 47%),
    radial-gradient(ellipse 28px 64px at 70% 24%, rgba(77,88,72,.28) 0 42%, transparent 47%),
    linear-gradient(70deg, transparent 46%, rgba(77,88,72,.22) 48% 51%, transparent 53%);
}
.public-hero-method-image img {
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
}
@media (max-width: 900px) {
  .public-hero::before {
    left: -20%;
    bottom: 0;
    width: 280px;
    height: 230px;
    opacity: .11;
  }
}


/* v5.3.6 — responsive hero and global type rhythm */
@media (max-width: 1480px) {
  .public-hero {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 48px !important;
    align-items: start !important;
  }
  .public-hero > div {
    width: min(100%, 920px);
  }
  .public-hero h1 {
    max-width: 880px;
    font-size: clamp(50px, 6.1vw, 76px);
    line-height: 1.1664;
    overflow-wrap: normal;
    word-break: keep-all;
  }
  .public-hero p {
    max-width: 860px;
  }
  .public-hero-method-image {
    width: min(100%, 860px);
    justify-self: center;
    align-self: start;
  }
  .public-hero-method-image img {
    width: 100% !important;
    max-height: none !important;
    aspect-ratio: auto !important;
    object-fit: contain !important;
  }
}
@media (max-width: 900px) {
  .public-hero {
    gap: 38px !important;
  }
  .public-hero h1 {
    max-width: 760px;
    font-size: clamp(43px, 8.2vw, 64px);
    line-height: 1.1664;
  }
}
@media (max-width: 640px) {
  .public-hero h1 {
    font-size: clamp(40px, 11.5vw, 54px) !important;
    line-height: 1.188;
    word-break: normal;
  }
  .public-hero p {
    font-size: 18px;
  }
}


/* v5.3.7 — mobile navigation completeness and compact hero */
@media (max-width: 640px) {
  .public-hero-method-image {
    display: none !important;
  }
  .public-hero {
    gap: 0 !important;
  }
}

/* v5.4.0: expanded Japanese learning methods and content library */
.japanese-method-page { max-width: 1180px; margin-inline: auto; }
.japanese-method-summary { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; margin:22px 0 28px; }
.japanese-method-summary > div { padding:20px; border:1px solid var(--line); background:var(--surface); border-radius:10px; }
.japanese-method-summary span,.japanese-method-summary small { display:block; color:var(--muted); }
.japanese-method-summary strong { display:block; margin:6px 0; font-family:var(--reading-font); font-size:clamp(30px,4vw,48px); font-weight:600; }
.japanese-method-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; }
.japanese-method-grid > button { position:relative; min-height:230px; padding:26px; border:1px solid var(--line); border-radius:12px; background:var(--surface); text-align:left; display:flex; flex-direction:column; align-items:flex-start; transition:transform .18s ease,border-color .18s ease,box-shadow .18s ease; }
.japanese-method-grid > button:hover { transform:translateY(-2px); border-color:var(--accent); box-shadow:0 14px 32px rgb(32 42 58 / .08); }
.japanese-method-grid > button > span:first-child { width:48px; height:48px; display:grid; place-items:center; border-radius:50%; background:var(--accent-soft); color:var(--accent); }
.japanese-method-grid > button > span:first-child svg { width:24px; height:24px; }
.japanese-method-grid small { margin-top:18px; color:var(--muted); letter-spacing:.08em; text-transform:uppercase; }
.japanese-method-grid strong { margin-top:7px; font-family:var(--reading-font); font-size:clamp(25px,3vw,36px); font-weight:600; }
.japanese-method-grid p { margin:12px 0 20px; color:var(--muted); line-height:1.75; }
.japanese-method-grid em { margin-top:auto; display:flex; align-items:center; gap:8px; color:var(--accent); font-style:normal; font-weight:700; }
.japanese-method-route { margin-top:28px; padding:28px; display:grid; grid-template-columns:1.1fr .9fr; gap:26px; border-top:1px solid var(--line); border-bottom:1px solid var(--line); }
.japanese-method-route ol { margin:0; padding-left:1.3em; display:grid; gap:10px; color:var(--muted); }
.japanese-cue-card,.dictation-card { padding:30px; border:1px solid var(--line); border-radius:10px; background:var(--surface); }
.japanese-cue-card h2,.dictation-card h2 { margin:10px 0 14px; font-family:var(--reading-font); font-size:clamp(26px,4vw,44px); line-height:1.35; }
.japanese-model-answer { margin-top:22px; padding:20px; border-top:1px solid var(--line); background:color-mix(in srgb,var(--accent-soft) 35%,transparent); }
.japanese-model-answer span,.japanese-model-answer small { display:block; color:var(--muted); }
.japanese-model-answer strong { display:block; margin:8px 0 14px; font-size:clamp(21px,3vw,32px); line-height:1.55; }
.ja-self-rating { display:grid; grid-template-columns:1.2fr repeat(3,1fr); gap:8px; margin-top:14px; align-items:stretch; }
.ja-self-rating span { display:flex; align-items:center; padding:12px 14px; color:var(--muted); }
.ja-self-rating button { min-height:58px; padding:10px; border:1px solid var(--line); border-radius:8px; background:var(--surface); }
.dictation-card label { display:grid; gap:8px; margin:22px 0 16px; }
.dictation-card textarea { width:100%; resize:vertical; min-height:120px; padding:16px; border:1px solid var(--line); border-radius:8px; background:var(--background); color:var(--text); font:inherit; line-height:1.7; }
.japanese-ondoku { margin:24px 0; }
.japanese-method-entry { border-color:color-mix(in srgb,var(--accent) 35%,var(--line)); }

@media (max-width: 900px) {
  .japanese-method-summary { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .japanese-method-route { grid-template-columns:1fr; }
}
@media (max-width: 640px) {
  .japanese-method-grid { grid-template-columns:1fr; }
  .japanese-method-grid > button { min-height:0; }
  .japanese-method-summary { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .ja-self-rating { grid-template-columns:1fr; }
  .japanese-cue-card,.dictation-card { padding:20px; }
}

/* v5.4.1 — separated English/Japanese spaces and real level paths */
.nav-divider { display:block; height:1px; margin:9px 10px; background:var(--line); }
.dashboard-language-actions { display:none !important; }

.language-hub { width:min(100%,var(--content)); margin:0 auto; padding:24px 42px 76px; }
.language-hub-hero {
  display:grid; grid-template-columns:minmax(0,1.35fr) minmax(300px,.65fr); gap:40px; align-items:end;
  margin:18px 0 34px; padding:34px 0; border-top:1px solid var(--line); border-bottom:1px solid var(--line);
}
.language-hub-hero h2 { margin:8px 0 0; max-width:780px; font-family:var(--reading-font); font-size:clamp(30px,3vw,50px); line-height:1.24; letter-spacing:-.035em; font-weight:520; }
.language-hub-stats { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; }
.language-hub-stats div { min-width:0; padding:18px 14px; border:1px solid var(--line); background:color-mix(in srgb,var(--surface) 82%,transparent); }
.language-hub-stats strong,.language-hub-stats span { display:block; }
.language-hub-stats strong { font-size:28px; line-height:1.1; }
.language-hub-stats span { margin-top:7px; color:var(--muted); font-size:13px; }
.language-skill-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.language-skill-card,
.language-feature-card {
  width:100%; display:grid; grid-template-columns:48px minmax(0,1fr) 22px; gap:18px; align-items:center;
  padding:24px; border:1px solid var(--line); border-radius:var(--radius); background:var(--surface); text-align:left;
  transition:transform .18s var(--ease),border-color .18s var(--ease),background .18s var(--ease);
}
.language-skill-card:hover,.language-feature-card:hover { transform:translateY(-2px); border-color:var(--line-strong); background:#fff; }
.language-skill-card>svg:first-child,.language-feature-card>svg:first-child { width:34px; height:34px; color:var(--accent); }
.language-skill-card>svg:last-child,.language-feature-card>svg:last-child { width:18px; height:18px; color:var(--pale); }
.language-skill-card strong,.language-feature-card strong { display:block; font-size:20px; line-height:1.25; }
.language-skill-card p,.language-feature-card p { margin:7px 0 0; color:var(--muted); font-size:14px; line-height:1.55; }
.language-feature-card { margin-top:12px; background:color-mix(in srgb,var(--accent-soft) 42%,var(--surface)); }
.language-feature-card small { display:block; margin-bottom:4px; color:var(--accent-strong); font-size:11px; text-transform:uppercase; letter-spacing:.08em; }
.language-quick-actions { display:flex; flex-wrap:wrap; gap:10px; margin-top:24px; }
.language-article-preview { margin-top:58px; padding-top:42px; border-top:1px solid var(--line); }

.level-path-tabs { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:8px; margin:22px 0; }
.level-path-tabs button { min-width:0; min-height:86px; padding:14px 12px; border:1px solid var(--line); border-radius:var(--radius-sm); background:var(--surface); text-align:left; }
.level-path-tabs button.active { border-color:var(--accent); background:var(--accent-soft); color:var(--accent-strong); }
.level-path-tabs strong,.level-path-tabs small { display:block; }
.level-path-tabs strong { font-size:18px; line-height:1.2; }
.level-path-tabs small { margin-top:6px; color:var(--muted); font-size:11px; line-height:1.35; }
.level-difficulty-note { display:flex; align-items:center; gap:12px; margin:12px 0 20px; padding:13px 16px; border-left:3px solid var(--accent); background:color-mix(in srgb,var(--accent-soft) 62%,white); }
.level-difficulty-note strong { min-width:42px; font-size:18px; }
.level-difficulty-note span { color:var(--muted); font-size:14px; }

@media (max-width: 1080px) {
  .language-hub-hero { grid-template-columns:1fr; align-items:start; }
  .language-hub-stats { max-width:620px; }
}
@media (max-width: 900px) {
  .language-hub { padding:18px 28px 70px; }
  .language-skill-grid { grid-template-columns:1fr; }
  .level-path-tabs { display:flex; overflow-x:auto; padding-bottom:4px; scroll-snap-type:x proximity; }
  .level-path-tabs button { flex:0 0 172px; scroll-snap-align:start; }
}
@media (max-width: 640px) {
  .language-hub { padding:8px 20px 92px; }
  .language-hub-hero { gap:22px; margin-top:8px; padding:24px 0; }
  .language-hub-stats { grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px; }
  .language-hub-stats div { padding:14px 9px; }
  .language-hub-stats strong { font-size:22px; }
  .language-hub-stats span { font-size:10px; }
  .language-skill-card,.language-feature-card { grid-template-columns:40px minmax(0,1fr) 18px; gap:13px; padding:19px 16px; }
  .language-skill-card strong,.language-feature-card strong { font-size:18px; }
  .language-quick-actions { display:grid; grid-template-columns:1fr 1fr; }
  .language-quick-actions button { width:100%; }
  .level-difficulty-note { align-items:flex-start; }
}


/* v5.4.2: keep Army Method category title and description on separate lines. */
.army-category-list .category-copy { min-width: 0; }
.army-category-list .category-detail-line {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
  margin-top: 8px;
  color: var(--muted);
}
.army-category-list .category-detail-line small {
  min-width: 0;
  margin: 0;
  flex: 1 1 auto;
}
.army-category-list .category-detail-line em {
  flex: 0 0 auto;
  margin: 0;
  color: var(--pale);
  white-space: nowrap;
}
.army-category-list .category-detail-line svg {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  color: var(--accent);
}

@media (max-width: 640px) {
  .army-category-list .category-row {
    grid-template-columns: 1fr;
    gap: 7px;
    padding: 20px 4px;
    border-width: 0 0 1px;
    border-radius: 0;
    background: transparent;
  }
  .army-category-list .category-index {
    display: inline;
    width: auto;
    height: auto;
    margin-right: 5px;
    background: transparent;
    color: var(--text);
    font-family: var(--reading-font);
    font-size: 22px;
    font-weight: 500;
  }
  .army-category-list .category-copy {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: baseline;
  }
  .army-category-list .category-copy > strong {
    grid-column: 2;
    font-size: 22px;
    line-height: 1.35;
  }
  .army-category-list .category-row > .category-index {
    grid-row: 1;
  }
  .army-category-list .category-detail-line {
    grid-column: 1 / -1;
    margin-top: 7px;
    gap: 8px;
    line-height: 1.55;
  }
  .army-category-list .category-detail-line small {
    font-size: 16px;
    line-height: 1.55;
  }
  .army-category-list .category-detail-line em {
    font-size: 15px;
  }
  .army-category-list .category-feature {
    grid-column: 1 / -1;
    margin-top: 4px;
  }
}


/* v5.4.3: two-line mobile category layout — number/title above, detail/count/arrow below. */
.shadow-category-list .category-copy,
.army-category-list .category-copy { min-width: 0; }
.shadow-category-list .category-detail-line,
.army-category-list .category-detail-line {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
  margin-top: 8px;
  color: var(--muted);
}
.shadow-category-list .category-detail-line small,
.army-category-list .category-detail-line small { min-width: 0; flex: 1 1 auto; margin: 0; }
.shadow-category-list .category-detail-line em,
.army-category-list .category-detail-line em { flex: 0 0 auto; margin: 0; white-space: nowrap; color: var(--pale); }
.shadow-category-list .category-detail-line svg,
.army-category-list .category-detail-line svg { flex: 0 0 auto; width: 18px; height: 18px; color: var(--accent); }

@media (max-width: 640px) {
  .shadow-category-list .category-row,
  .army-category-list .category-row {
    display: grid;
    grid-template-columns: auto minmax(0,1fr);
    align-items: start;
    column-gap: 8px;
    row-gap: 0;
    min-height: 0;
    padding: 20px 4px;
    border-width: 0 0 1px;
    border-radius: 0;
    background: transparent;
  }
  .shadow-category-list .category-index,
  .army-category-list .category-index {
    grid-column: 1;
    grid-row: 1;
    display: inline;
    width: auto;
    height: auto;
    margin: 0;
    background: transparent;
    color: var(--text);
    font-family: var(--reading-font);
    font-size: 22px;
    font-weight: 500;
    line-height: 1.35;
  }
  .shadow-category-list .category-copy,
  .army-category-list .category-copy {
    grid-column: 2;
    grid-row: 1;
    display: block;
    min-width: 0;
  }
  .shadow-category-list .category-copy > strong,
  .army-category-list .category-copy > strong {
    display: block;
    font-size: 22px;
    line-height: 1.35;
  }
  .shadow-category-list .category-detail-line,
  .army-category-list .category-detail-line {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-top: 7px;
    line-height: 1.55;
  }
  .shadow-category-list .category-detail-line small,
  .army-category-list .category-detail-line small {
    font-size: 16px;
    line-height: 1.55;
  }
  .shadow-category-list .category-detail-line em,
  .army-category-list .category-detail-line em { font-size: 15px; }
  .shadow-category-list .category-feature,
  .army-category-list .category-feature { grid-column: 2; margin-top: 8px; }
}

/* Home page language chooser: the site teaches two languages, so the entry
   point asks which one instead of defaulting to English. */
.public-hero-choose { margin-top: 18px; color: var(--muted); font-size: .95rem; }
.language-choice { padding-top: 8px; }
.language-choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.language-choice-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
  padding: 26px 26px 22px; text-align: left; cursor: pointer;
  border: 1px solid var(--line); border-radius: 16px; background: var(--surface);
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.language-choice-card:hover, .language-choice-card:focus-visible {
  border-color: var(--accent); box-shadow: 0 10px 28px rgba(36,36,34,.08); transform: translateY(-2px);
}
.language-choice-icon { display: inline-flex; margin-bottom: 6px; color: var(--accent); }
.language-choice-icon svg { width: 30px; height: 30px; }
.language-choice-card strong { font-size: 1.45rem; line-height: 1.2; }
.language-choice-card small { color: var(--pale); font-size: .85rem; letter-spacing: .04em; }
.language-choice-card p { margin: 8px 0 0; color: var(--muted); font-size: .92rem; line-height: 1.65; }
.language-choice-card em {
  margin-top: 14px; display: inline-flex; align-items: center; gap: 7px;
  font-style: normal; font-weight: 600; font-size: .9rem; color: var(--accent-strong);
}
.language-choice-note { margin: 16px 0 0; color: var(--muted); font-size: .88rem; }
.text-button.inline { padding: 0; font-size: inherit; color: var(--accent-strong); text-decoration: underline; }
@media (max-width: 720px) {
  .language-choice-grid { grid-template-columns: 1fr; gap: 14px; }
  .language-choice-card { padding: 22px 20px 18px; }
}

/* .desktop-nav / .bottom-nav buttons set display:flex, which overrides the
   [hidden] attribute's default display:none. Without this the current zone's
   own language button stays visible next to the switch. */
.desktop-nav button[hidden], .bottom-nav button[hidden] { display: none !important; }

/* Answer feedback used to render from nothing, so the page grew the moment a
   question was answered and the action button landed wherever the reflow put
   it — often below the fold on a phone. Every drill now reserves the space up
   front, and on small screens the active button sticks above the bottom nav so
   it is reachable without scrolling. */
#feedback {
  display: block;
  min-height: 132px;
}
#feedback:empty::after {
  content: "作答後，這裡會顯示解析與下一題。";
  display: block;
  padding: 16px 18px;
  color: var(--pale);
  font-size: .88rem;
  border-left: 3px solid var(--line);
  background: var(--bg);
}
.practice-feedback-shell {
  display: block;
  min-height: 132px;
}
.practice-feedback-wait {
  margin: 0;
  padding: 16px 18px;
  color: var(--pale);
  font-size: .88rem;
  border-left: 3px solid var(--line);
  background: var(--bg);
}
/* the action button sits at the bottom of the white card, same slot every time */
.practice-action-slot {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  min-height: 64px;
  display: flex;
  align-items: center;
}
.practice-action-slot .primary-button,
.practice-action-slot .text-button { width: 100%; justify-content: center; }
.practice-action-placeholder { display: block; width: 100%; height: 48px; visibility: hidden; }

@media (max-width: 720px) {
  #feedback, .practice-feedback-shell { min-height: 156px; }
  /* A practice page runs about three screens tall on a phone, so the answered
     state's button sat far below the fold. sticky cannot help once its whole
     container is off-screen, so the button is pinned to the viewport instead
     and sits just above the bottom nav. */
  .feedback .text-button,
  .practice-action-slot .primary-button,
  .practice-action-slot .text-button {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(var(--bottom-nav-height, 64px) + 10px);
    z-index: 40;
    width: auto;
    justify-content: center;
    padding: 14px 18px;
    border-radius: 12px;
    background: var(--accent-strong);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 8px 24px rgba(36,36,34,.22);
  }
  .feedback .text-button svg,
  .practice-action-slot .text-button svg { color: #fff; }
}

/* Matches .bottom-nav button min-height plus the iOS home-indicator inset, so
   the sticky action button clears the nav instead of covering it. */
@media (max-width: 720px) {
  :root { --bottom-nav-height: calc(60px + env(safe-area-inset-bottom, 0px)); }
}

/* The fixed action button overlays the page, so practice pages need room at the
   end for it plus the bottom nav; otherwise it covers the last card. */
@media (max-width: 720px) {
  .practice-page, .lesson-shell {
    padding-bottom: calc(var(--bottom-nav-height, 64px) + 92px);
  }
}

/* Five fixed destinations share the width evenly, so the bar no longer scrolls. */
@media (max-width: 720px) {
  .bottom-nav {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    overflow-x: visible;
  }
  .bottom-nav button { min-width: 0; padding-inline: 2px; }
  .bottom-nav small { white-space: nowrap; }
}
/* Language switch lives in the top bar: low-frequency, so it does not deserve
   a permanent slot in the bottom bar. */
.language-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
}
.language-switch:hover { border-color: var(--accent); color: var(--accent-strong); }
.language-switch svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.language-switch[hidden] { display: none !important; }
.top-actions { display: flex; align-items: center; gap: 8px; }
/* Keeping the label matters here: the icon alone (a kana glyph) reads as
   "Japanese", which is misleading while standing in the English zone. */
@media (max-width: 480px) {
  .language-switch { padding: 7px 10px; font-size: .78rem; }
  .language-switch svg { width: 15px; height: 15px; }
}

/* Inside a drill the heading is orientation, not instruction. The "how to do
   this" line is already shown on the pre-start screen, so repeating it above
   every question just pushes the answer options further down — on a phone the
   options already started around 950px. Title stays (you need to know where
   you are after navigating back); the repeated instruction goes. */
.practice-page .page-title,
.japanese-method-page .page-title {
  margin-bottom: 14px;
}
.practice-page .page-title h1,
.japanese-method-page .page-title h1 {
  font-size: clamp(1.35rem, 3.2vw, 1.75rem);
  line-height: 1.25;
}
.practice-page .page-title p,
.japanese-method-page .page-title p {
  display: none;
}
@media (max-width: 720px) {
  .practice-page .page-title,
  .japanese-method-page .page-title { margin-bottom: 10px; }
  .practice-page .page-title h1,
  .japanese-method-page .page-title h1 { font-size: 1.25rem; }
  .practice-page .lesson-head,
  .japanese-method-page .lesson-head { margin-bottom: 8px; }
}

/* The question card reserves 430px minimum plus 42px padding, which is fine on
   a desktop but on a phone it pushed the answer options past the fold — you
   had to scroll before you could answer. Tightened on small screens only; the
   word stays large enough to read kanji strokes clearly. */
@media (max-width: 720px) {
  .editorial-study-card { min-height: 0; padding: 22px 18px; }
  .study-card { padding: 24px 18px; }
  .study-card.compact { padding-block: 18px; }
  .study-word { margin: 14px 0 6px; }
  .editorial-study-card .study-word { font-size: clamp(44px, 13vw, 62px); }
  .kana-word { font-size: clamp(52px, 16vw, 76px); }
  .audio-button { margin-top: 14px; }
  .difficulty-switch { margin: 14px 0; padding: 10px 0; }
}
