:root {
  --ink: #132c33;
  --muted: #61747a;
  --paper: #f5f8f7;
  --card: #ffffff;
  --line: #dce6e3;
  --brand: #0f4c5c;
  --brand-2: #177387;
  --accent: #f4b942;
  --success: #237a57;
  --success-soft: #e9f6ef;
  --danger: #ba4c4c;
  --danger-soft: #fff0ef;
  --shadow: 0 18px 50px rgba(15, 76, 92, 0.11);
}

.quick-chapter-picker { display:grid; gap:8px; margin:24px 0; padding:18px; border:1px solid var(--line); border-radius:16px; background:var(--surface); }
.quick-chapter-picker>span { color:var(--muted); font-size:12px; font-weight:800; letter-spacing:.08em; text-transform:uppercase; }
.quick-chapter-picker select { width:100%; min-height:48px; padding:0 42px 0 13px; border:1px solid var(--line); border-radius:12px; color:var(--ink); background:var(--surface); font:inherit; font-weight:700; }
.quick-chapter-picker small { color:var(--muted); font-size:13px; line-height:1.45; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; color: var(--ink); background: var(--paper); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", sans-serif; }
button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
button:focus-visible, label:focus-within { outline: 3px solid rgba(23,115,135,.25); outline-offset: 2px; }
[hidden] { display: none !important; }

.topbar { min-height: 74px; padding: 0 clamp(18px,4vw,56px); display: flex; align-items: center; gap: 28px; background: rgba(255,255,255,.9); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; backdrop-filter: blur(16px); }
.brand { display: flex; align-items: center; gap: 11px; border: 0; background: none; color: var(--ink); text-align: left; cursor: pointer; padding: 0; }
.brand-mark { display: grid; place-items: center; width: 40px; height: 40px; flex: 0 0 auto; color: white; background: var(--brand); border-radius: 12px; font-weight: 900; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 15px; letter-spacing: .01em; }
.brand small { color: var(--muted); font-size: 12px; margin-top: 2px; }
.topnav { margin-left: auto; display: flex; align-self: stretch; }
.topnav button { position: relative; border: 0; background: transparent; color: var(--muted); padding: 0 15px; cursor: pointer; font-weight: 750; }
.topnav button.active { color: var(--brand); }
.topnav button.active::after { content: ""; position: absolute; height: 3px; border-radius: 4px 4px 0 0; background: var(--brand); left: 15px; right: 15px; bottom: 0; }
.topnav button span { min-width: 20px; height: 20px; padding: 0 6px; display: inline-grid; place-items: center; border-radius: 99px; color: var(--brand); background: #e7f0f0; font-size: 11px; }
.year-chip, .status-chip, .topic-chip, .result-status { display: inline-flex; align-items: center; border-radius: 999px; font-size: 13px; font-weight: 800; }
.site-signature { width: min(100% - 40px,1100px); display: flex; align-items: baseline; justify-content: flex-end; gap: 9px; margin: -38px auto 0; padding: 22px 2px 28px; border-top: 1px solid var(--line); color: var(--muted); }
.site-signature span { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.site-signature strong { color: var(--brand); font-family: Georgia,"Times New Roman",serif; font-size: 22px; font-style: italic; letter-spacing: .025em; }
.site-signature small { padding-left: 8px; border-left: 1px solid var(--line); color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }

.home-wrap, .vocab-wrap, .result-wrap { max-width: 1100px; margin: 0 auto; padding: clamp(28px,5vw,68px) 20px 70px; }
.home-heading { display: grid; grid-template-columns: 1fr auto; gap: 40px; align-items: center; margin-bottom: 32px; }
.eyebrow { display: inline-flex; color: var(--brand-2); font-size: 13px; font-weight: 850; text-transform: uppercase; letter-spacing: .1em; }
.home-heading h1 { margin: 10px 0 14px; font-size: clamp(40px,6vw,68px); line-height: .98; letter-spacing: -.055em; }
.home-heading p { max-width: 670px; margin: 0; color: var(--muted); font-size: 18px; line-height: 1.65; }
.home-stat { width: 146px; height: 146px; border-radius: 50%; display: grid; place-content: center; text-align: center; color: white; background: var(--brand); box-shadow: 0 0 0 13px #d9e8e8; }
.home-stat strong { font-size: 45px; line-height: 1; }
.home-stat span { margin-top: 6px; max-width: 90px; font-size: 12px; line-height: 1.3; opacity: .8; }
.home-grid { display: grid; grid-template-columns: minmax(0,1.55fr) minmax(280px,.8fr); gap: 22px; align-items: stretch; }
.exam-list { display: grid; gap: 16px; }
.multi-exam .quick-panel { align-self: start; position: sticky; top: 94px; }
.exam-card, .quick-panel, .question-panel, .result-details { background: var(--card); border: 1px solid var(--line); border-radius: 25px; box-shadow: var(--shadow); }
.exam-card { padding: clamp(24px,4vw,38px); }
.exam-card.active-exam { border-color: #a9c9c5; box-shadow: 0 18px 50px rgba(15,76,92,.14); }
.exam-card__head { display: flex; justify-content: space-between; align-items: center; }
.year-chip { padding: 8px 12px; color: white; background: var(--brand); }
.status-chip { padding: 7px 11px; color: #80600f; background: #fff4d6; }
.exam-card h2 { margin: 24px 0 5px; font-size: clamp(27px,4vw,38px); }
.jp-title { color: var(--muted); margin: 0; font-size: 16px; }
.exam-meta { display: flex; gap: 24px; flex-wrap: wrap; margin: 28px 0 24px; color: var(--muted); }
.exam-meta b { color: var(--ink); }
.progress-label { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 9px; color: var(--muted); font-size: 13px; }
.progress-label b { color: var(--brand); }
.progress-line { height: 8px; overflow: hidden; background: #edf1f0; border-radius: 99px; margin-bottom: 23px; }
.progress-line span { display: block; height: 100%; background: var(--accent); border-radius: inherit; }
.exam-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.review-inline { min-height: 48px; padding: 0 6px; }
.primary-action, .secondary-action { min-height: 48px; border-radius: 13px; padding: 0 18px; font-weight: 800; cursor: pointer; transition: .18s ease; }
.primary-action { border: 0; color: white; background: var(--brand); display: inline-flex; align-items: center; justify-content: center; gap: 30px; }
.primary-action:hover { background: var(--brand-2); transform: translateY(-1px); }
.primary-action.submit { background: #ba5c38; }
.secondary-action { border: 1px solid var(--line); background: white; color: var(--ink); }
.secondary-action:hover { border-color: var(--brand-2); color: var(--brand); }
button:disabled { cursor: not-allowed; opacity: .42; transform: none !important; }
.quick-panel { padding: 10px; display: flex; flex-direction: column; }
.quick-card { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 18px 12px; border-bottom: 1px solid var(--line); }
.quick-icon { width: 43px; height: 43px; display: grid; place-items: center; border-radius: 13px; font-weight: 900; }
.wrong-icon { color: #a0493e; background: var(--danger-soft); }
.vocab-icon { color: var(--brand); background: #e8f2f2; }
.quick-card strong, .quick-card small { display: block; }
.quick-card strong { font-size: 14px; }
.quick-card small { color: var(--muted); line-height: 1.35; margin-top: 4px; }
.quick-card > button { width: 36px; height: 36px; border: 0; border-radius: 11px; color: var(--brand); background: #edf4f4; cursor: pointer; }
.backup-card { margin: auto 8px 8px; padding: 18px; border-radius: 16px; color: white; background: var(--brand); }
.backup-card p { margin: 7px 0 13px; color: rgba(255,255,255,.72); font-size: 13px; line-height: 1.5; }
.backup-card div { display: flex; gap: 15px; }
.text-action { border: 0; background: transparent; color: var(--brand-2); padding: 0; font-weight: 800; cursor: pointer; }
.backup-card .text-action { color: white; font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }
.text-action.danger { color: var(--danger); }
.history-section { margin-top: 50px; }
.section-title { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.section-title h1, .section-title h2 { margin: 5px 0 0; letter-spacing: -.035em; }
.section-title h2 { font-size: 28px; }
.history-list { display: grid; gap: 9px; }
.history-list > div { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 14px 18px; background: white; border: 1px solid var(--line); border-radius: 15px; }
.history-list p { margin: 0; }
.history-list strong, .history-list small { display: block; }
.history-list small, .history-list > div > span:last-child { color: var(--muted); font-size: 13px; margin-top: 3px; }
.score-badge { width: 43px; height: 43px; display: grid; place-items: center; border-radius: 12px; font-weight: 900; }
.score-badge.pass { color: var(--success); background: var(--success-soft); }
.score-badge.fail { color: var(--danger); background: var(--danger-soft); }

.quiz-layout { max-width: 1280px; margin: 0 auto; padding: 28px 22px 75px; display: grid; grid-template-columns: 250px minmax(0,1fr); gap: 28px; }
.quiz-side { align-self: start; position: sticky; top: 102px; }
.text-button { color: var(--brand); border: 0; background: transparent; padding: 8px 0; font-weight: 800; cursor: pointer; }
.side-title { margin: 22px 0 14px; display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 12px; }
.side-title strong { color: var(--ink); }
.number-grid, .drawer-number-grid { display: grid; grid-template-columns: repeat(5,1fr); gap: 8px; }
.number-grid button, .drawer-number-grid button { aspect-ratio: 1; position: relative; border: 1px solid var(--line); border-radius: 10px; background: white; color: var(--muted); cursor: pointer; font-size: 13px; }
.number-grid button.answered, .drawer-number-grid button.answered { color: var(--brand); background: #e9f2f2; border-color: #c8dddd; font-weight: 850; }
.number-grid button.flagged::after, .drawer-number-grid button.flagged::after { content: ""; position: absolute; width: 7px; height: 7px; right: 3px; top: 3px; border-radius: 50%; background: var(--accent); }
.number-grid button.current, .drawer-number-grid button.current { color: white; background: var(--brand); border-color: var(--brand); opacity: 1; }
.grid-legend { display: grid; gap: 7px; margin-top: 15px; color: var(--muted); font-size: 12px; }
.grid-legend span { display: flex; align-items: center; gap: 7px; }
.grid-legend i { width: 8px; height: 8px; border-radius: 50%; }
.grid-legend .done { background: #8fc2bc; }
.grid-legend .mark { background: var(--accent); }
.mobile-question-toggle, .question-drawer, .question-drawer-backdrop { display: none; }
.question-panel { padding: clamp(22px,4vw,42px); }
.question-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.question-toolbar > div { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.question-count { color: var(--brand-2); font-size: 13px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.topic-chip { padding: 6px 9px; color: var(--muted); background: #eff3f2; font-size: 12px; }
.toolbar-actions { justify-content: flex-end; }
.timer { padding: 9px 13px; color: var(--brand); background: #edf4f4; border-radius: 10px; font-variant-numeric: tabular-nums; font-weight: 850; }
.timer.calm { color: var(--muted); font-size: 12px; }
.flag-button { min-height: 37px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); background: white; cursor: pointer; font-size: 12px; font-weight: 750; }
.flag-button.active { color: #8b6815; border-color: #ebcf82; background: #fff7df; }
.tap-hint { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; margin-bottom: 18px; }
.tap-hint span { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 8px; color: var(--brand); background: #e8f2f2; font-weight: 900; }
.jp-content h1 { margin: 0; font-size: clamp(19px,2.3vw,26px); line-height: 1.82; font-weight: 700; white-space: normal; }
.word-token { display: inline; margin: 0; padding: 1px 0; border: 0; color: inherit; background: transparent; border-radius: 3px; cursor: pointer; font: inherit; line-height: inherit; text-align: inherit; }
.word-token:hover, .word-token.known:hover { color: var(--brand-2); background: #e7f1f1; }
.word-token.known { text-decoration: underline dotted rgba(23,115,135,.45); text-underline-offset: 4px; }
.translation-toggle { margin-top: 17px; }
.translation-toggle button { border: 0; background: transparent; color: var(--brand-2); padding: 5px 0; cursor: pointer; font-weight: 800; }
.translation-toggle button span { display: inline-block; transition: transform .2s; }
.translation-toggle button.open span { transform: rotate(180deg); }
.translation-toggle p { margin: 9px 0 0; padding: 13px 15px; color: #485f65; background: #eef5f4; border-left: 3px solid var(--brand-2); border-radius: 0 10px 10px 0; line-height: 1.65; }
.options { display: grid; gap: 12px; margin: 28px 0; }
.all-option-translations-toggle { display: inline-flex; align-items: center; gap: 7px; margin-top: 22px; padding: 9px 13px; border: 1px solid #cbdedb; border-radius: 10px; color: var(--brand-2); background: #f4f9f8; cursor: pointer; font-size: 13px; font-weight: 850; }
.all-option-translations-toggle:hover { border-color: var(--brand-2); background: #eaf4f3; }
.all-option-translations-toggle span { display: inline-block; transition: transform .2s; }
.all-option-translations-toggle.open span { transform: rotate(180deg); }
.all-option-translations-toggle + .options { margin-top: 12px; }
.option-wrap { display: grid; }
.option { width: 100%; display: grid; grid-template-columns: 45px minmax(0,1fr) auto; gap: 12px; align-items: center; min-height: 66px; padding: 13px 14px; text-align: left; color: var(--ink); background: white; border: 1px solid var(--line); border-radius: 14px; cursor: pointer; transition: .16s ease; }
.option > span { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: #eef4f4; color: var(--brand); font-weight: 900; }
.option b { font-size: 16px; line-height: 1.65; font-weight: 620; }
.option em { color: var(--muted); font-size: 12px; font-style: normal; font-weight: 800; }
.option:hover, .option.selected { border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(23,115,135,.1); }
.option.selected > span { color: white; background: var(--brand); }
.option.correct { border-color: #6bb18f; background: var(--success-soft); box-shadow: 0 0 0 3px rgba(35,122,87,.09); opacity: 1; }
.option.correct > span { color: white; background: var(--success); }
.option.wrong { border-color: #dc8c84; background: var(--danger-soft); box-shadow: none; opacity: 1; }
.option.wrong > span { color: white; background: var(--danger); }
.option-translation { margin: 3px 7px 2px 55px; padding: 10px 12px; color: #385058; background: #eef5f4; border-left: 3px solid var(--brand-2); border-radius: 0 10px 10px 0; line-height: 1.6; }
.explanation-card { margin: 24px 0; padding: 22px; border: 1px solid #cddfdb; border-radius: 17px; background: #f2f8f6; }
.explanation-card.wrong { border-color: #ecd0cd; background: #fff8f7; }
.explanation-title { display: flex; align-items: center; gap: 12px; }
.explanation-title > span { width: 39px; height: 39px; display: grid; place-items: center; border-radius: 12px; color: white; background: var(--success); font-weight: 900; }
.explanation-card.wrong .explanation-title > span { background: var(--danger); }
.explanation-card.neutral .explanation-title > span { background: var(--brand); }
.explanation-title small { color: var(--muted); font-size: 11px; font-weight: 850; text-transform: uppercase; letter-spacing: .08em; }
.explanation-title h2 { margin: 1px 0 0; font-size: 20px; }
.keyword-box { margin: 17px 0 2px; padding: 14px; border: 1px solid #d8e4e1; border-radius: 13px; background: rgba(255,255,255,.75); }
.keyword-box > strong { display: block; margin-bottom: 9px; color: var(--brand-2); font-size: 12px; letter-spacing: .04em; text-transform: uppercase; }
.keyword-box > div { display: flex; flex-wrap: wrap; gap: 8px; }
.keyword-box span { display: inline-flex; align-items: baseline; gap: 7px; padding: 7px 10px; border-radius: 10px; color: #385058; background: #edf4f3; }
.keyword-box b { color: var(--ink); font-size: 14px; }
.keyword-box small { color: var(--muted); font-size: 11px; }
.explanation-card > p { margin: 16px 0; line-height: 1.75; color: #385058; }
.answer-translation, .knowledge-note { margin: 14px 0; padding: 15px 16px; border-radius: 13px; }
.answer-translation { border-left: 4px solid var(--brand-2); background: white; }
.knowledge-note { border: 1px solid #d8e4e1; background: rgba(232,242,240,.72); }
.answer-translation strong, .knowledge-note strong { display: block; margin-bottom: 7px; color: var(--brand); font-size: 12px; letter-spacing: .035em; text-transform: uppercase; }
.answer-translation p, .knowledge-note p { margin: 0; color: #385058; line-height: 1.72; }
.bilingual-knowledge { display: grid; gap: 12px; }
.knowledge-pair { padding: 12px 13px; background: rgba(255,255,255,.78); border: 1px solid #dbe7e4; border-radius: 10px; }
.knowledge-pair .knowledge-ja { color: #203f47; font-weight: 650; }
.knowledge-pair .knowledge-vi { margin-top: 7px; padding-top: 7px; border-top: 1px dashed #c8d8d4; color: #52676d; }
.source-ref { margin: 10px 0 16px !important; color: var(--muted) !important; font-size: 12px; }
.answer-comparison { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.answer-comparison > div { display: grid; grid-template-columns: 28px 1fr; gap: 8px; align-items: start; padding: 10px; border-radius: 10px; color: var(--muted); background: rgba(255,255,255,.7); font-size: 12px; line-height: 1.45; }
.answer-comparison b { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 7px; color: var(--brand); background: #e7f0f0; }
.answer-comparison .answer-key b { color: white; background: var(--success); }
.answer-comparison .user-key b { color: white; background: var(--danger); }
.question-footer { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; padding-top: 8px; }
.question-footer > span { color: var(--muted); font-size: 13px; text-align: center; }
.question-footer > button:last-child { justify-self: end; }

.term-popover { position: fixed; z-index: 70; max-height: calc(100vh - 24px); overflow-y: auto; padding: 18px; border: 1px solid #cadcda; border-radius: 17px; color: var(--ink); background: white; box-shadow: 0 22px 60px rgba(9,50,59,.22); }
.term-head { display: flex; align-items: center; justify-content: space-between; color: var(--brand-2); font-size: 11px; font-weight: 850; text-transform: uppercase; letter-spacing: .08em; }
.term-head button { width: 34px; height: 34px; flex: 0 0 auto; border: 0; border-radius: 9px; background: #eff4f3; color: var(--muted); cursor: pointer; font-size: 20px; line-height: 1; }
.term-head button:hover { color: white; background: var(--brand); }
.term-popover h2 { margin: 8px 0 2px; font-size: 30px; }
.term-reading { margin: 0; color: var(--brand-2); font-weight: 750; }
.term-reading small { display: block; margin-top: 2px; color: var(--muted); font-weight: 500; }
.term-meaning { margin: 14px 0; padding-top: 13px; border-top: 1px solid var(--line); line-height: 1.55; }
.ask-chatgpt { display: flex; width: 100%; min-height: 46px; align-items: center; justify-content: center; gap: 8px; margin: 0 0 8px; border: 1px solid #9cc5be; border-radius: 11px; color: #0e5c55; background: #eaf7f4; cursor: pointer; font-weight: 850; }
.ask-chatgpt:hover { border-color: var(--brand-2); background: #dff2ed; }
.ask-chatgpt span { font-size: 18px; }
.chatgpt-note { margin: 0 2px 13px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.save-term { width: 100%; min-height: 42px; border: 0; border-radius: 11px; color: white; background: var(--brand); cursor: pointer; font-weight: 850; }
.save-term.saved { color: var(--success); background: var(--success-soft); }
.toast { position: fixed; left: 50%; bottom: 25px; z-index: 90; transform: translateX(-50%); padding: 11px 17px; border-radius: 12px; color: white; background: #18363d; box-shadow: var(--shadow); font-size: 14px; font-weight: 750; }

.result-wrap { max-width: 1050px; }
.result-hero { display: grid; grid-template-columns: auto 1fr; gap: 40px; align-items: center; padding: 10px 10px 50px; }
.score-ring { width: 190px; height: 190px; padding: 14px; border-radius: 50%; background: conic-gradient(var(--brand) var(--score-angle), #dce6e3 0); }
.score-ring > div { width: 100%; height: 100%; display: grid; place-content: center; text-align: center; border-radius: 50%; background: var(--paper); }
.score-ring strong { display: block; font-size: 54px; line-height: 1; }
.score-ring span { margin-top: 7px; color: var(--muted); font-size: 13px; }
.result-status { padding: 7px 11px; }
.result-status.pass { color: var(--success); background: var(--success-soft); }
.result-status.fail { color: var(--danger); background: var(--danger-soft); }
.result-copy h1 { margin: 13px 0 7px; font-size: clamp(32px,5vw,52px); letter-spacing: -.045em; }
.result-copy p { color: var(--muted); font-size: 17px; }
.result-copy > div { display: flex; gap: 10px; margin-top: 22px; }
.result-details { padding: clamp(22px,4vw,38px); }
.result-filters { display: flex; gap: 7px; margin: 22px 0; }
.result-filters button { min-height: 38px; padding: 0 13px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); background: white; cursor: pointer; font-weight: 750; }
.result-filters button.active { color: white; border-color: var(--brand); background: var(--brand); }
.result-list { display: grid; gap: 9px; }
.result-item { border: 1px solid var(--line); border-radius: 13px; background: #fbfcfc; overflow: hidden; }
.result-item summary { list-style: none; display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; padding: 14px; cursor: pointer; }
.result-item summary::-webkit-details-marker { display: none; }
.result-item summary > span { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; color: var(--brand); background: #e8f1f1; font-weight: 900; }
.result-item summary strong, .result-item summary small { display: block; }
.result-item summary small { color: var(--muted); margin-top: 3px; }
.result-item summary i { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; font-style: normal; font-weight: 900; }
.result-item.is-correct summary i { color: var(--success); background: var(--success-soft); }
.result-item.is-wrong summary i { color: var(--danger); background: var(--danger-soft); }
.result-answer { padding: 4px 20px 22px 66px; }
.result-answer p { line-height: 1.68; }
.jp-result { color: var(--ink); white-space: pre-line; }
.vi-result { padding: 12px; color: #486067; background: #eef5f4; border-radius: 10px; }
.result-answer h3 { margin: 20px 0 0; font-size: 14px; color: var(--brand-2); }

.vocab-title { align-items: center; margin-bottom: 34px; }
.vocab-title h1 { font-size: clamp(36px,5vw,56px); }
.vocab-title p { color: var(--muted); }
.vocab-total { width: 90px; height: 90px; display: grid; place-content: center; text-align: center; border-radius: 50%; color: white; background: var(--brand); font-size: 30px; font-weight: 900; }
.vocab-total small { display: block; font-size: 11px; font-weight: 600; opacity: .75; }
.vocab-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; }
.vocab-card { position: relative; min-height: 250px; padding: 20px; border: 1px solid var(--line); border-radius: 18px; background: white; box-shadow: 0 10px 30px rgba(15,76,92,.06); }
.vocab-card > div { display: flex; justify-content: space-between; }
.priority-dot { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 8px; font-size: 11px; font-weight: 900; }
.priority-dot.a { color: #8a6110; background: #fff2ca; }
.priority-dot.b { color: var(--brand); background: #e8f2f2; }
.remove-term { width: 28px; height: 28px; border: 0; border-radius: 8px; color: var(--muted); background: #f1f4f3; cursor: pointer; }
.vocab-card h2 { margin: 18px 0 2px; font-size: 28px; }
.vocab-card p { margin: 0; }
.vocab-card .reading { color: var(--brand-2); font-weight: 750; }
.vocab-card .romaji { color: var(--muted); font-size: 13px; margin-top: 2px; }
.vocab-card .meaning { margin-top: 18px; padding-top: 15px; border-top: 1px solid var(--line); line-height: 1.55; }
.vocab-hub { max-width: 1180px; }
.vocab-hub-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.vocab-hub-heading h1 { margin: 8px 0 8px; font-size: clamp(38px,5vw,60px); line-height: 1; letter-spacing: -.045em; }
.vocab-hub-heading p { margin: 0; color: var(--muted); line-height: 1.55; }
.vocab-progress-summary { flex: 0 0 auto; padding: 15px 18px; border: 1px solid #cfe1de; border-radius: 16px; color: var(--muted); background: white; }
.vocab-progress-summary strong { color: var(--brand); font-size: 24px; }
.vocab-tabs { display: flex; gap: 6px; margin-bottom: 20px; padding: 6px; overflow-x: auto; border: 1px solid var(--line); border-radius: 15px; background: #eaf1f0; scrollbar-width: none; }
.vocab-tabs::-webkit-scrollbar { display: none; }
.vocab-tabs button { flex: 1 0 auto; min-height: 42px; padding: 0 15px; border: 0; border-radius: 10px; color: var(--muted); background: transparent; cursor: pointer; font-weight: 850; }
.vocab-tabs button.active { color: white; background: var(--brand); box-shadow: 0 5px 14px rgba(15,76,92,.18); }
.vocab-tabs button span { display: inline-grid; min-width: 20px; height: 20px; place-items: center; margin-left: 4px; padding: 0 5px; border-radius: 99px; color: var(--brand); background: white; font-size: 11px; }
.vocab-loading { min-height: 420px; display: grid; place-content: center; justify-items: center; color: var(--muted); }
.vocab-loading span { width: 62px; height: 62px; display: grid; place-items: center; border-radius: 20px; color: white; background: var(--brand); font-size: 28px; font-weight: 900; }
.vocab-study-toolbar { display: grid; grid-template-columns: auto minmax(230px,1fr); gap: 12px; margin-bottom: 16px; }
.vocab-scope { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: #e4eceb; }
.vocab-scope button { min-height: 40px; padding: 0 12px; border: 0; border-radius: 9px; color: var(--muted); background: transparent; cursor: pointer; font-weight: 800; }
.vocab-scope button.active { color: var(--brand); background: white; box-shadow: 0 3px 10px rgba(15,76,92,.1); }
.vocab-study-toolbar select { min-height: 48px; padding: 0 40px 0 14px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: white; font: inherit; outline: none; }
.vocab-study-stage { display: grid; grid-template-columns: minmax(0,1fr) 250px; gap: 18px; align-items: stretch; }
.study-flashcard { position: relative; min-height: 505px; display: flex; flex-direction: column; padding: clamp(25px,5vw,48px); overflow: hidden; border: 1px solid rgba(15,76,92,.1); border-radius: 28px; background: white; box-shadow: var(--shadow); cursor: pointer; touch-action: pan-y; }
.study-flashcard::before { content: ""; position: absolute; inset: 0 0 auto; height: 7px; background: linear-gradient(90deg,var(--brand-2),var(--accent)); }
.study-flashcard-top { display: flex; justify-content: space-between; gap: 15px; align-items: center; color: var(--muted); }
.study-flashcard-top > div { display: flex; align-items: center; gap: 8px; }
.vocab-category-badge { max-width: min(440px,45vw); overflow: hidden; padding: 6px 9px; border-radius: 999px; color: var(--brand); background: #e8f2f2; font-size: 12px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.study-word-area { flex: 1; display: grid; place-content: center; padding: 36px 0 24px; text-align: center; }
.study-word-area h2 { margin: 0; font-family: "Noto Sans JP","Hiragino Sans",sans-serif; font-size: clamp(3.2rem,9vw,6.4rem); line-height: 1.15; letter-spacing: .01em; }
.study-han-viet { margin: 12px 0 0; color: #a45d20; font-size: 14px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.study-reading { min-height: 30px; margin: 16px 0 0; color: var(--brand-2); font-size: clamp(1.05rem,2.5vw,1.4rem); font-weight: 800; opacity: 0; transform: translateY(5px); transition: .18s ease; }
.study-reading.visible { opacity: 1; transform: none; }
.study-answer { padding-top: 20px; border-top: 1px solid var(--line); opacity: 0; transform: translateY(8px); pointer-events: none; transition: .18s ease; }
.study-answer.visible { opacity: 1; transform: none; pointer-events: auto; }
.study-meaning { margin: 0; font-size: clamp(1.2rem,2.5vw,1.65rem); font-weight: 850; line-height: 1.4; }
.study-romaji { margin: 7px 0 0; color: var(--muted); font-style: italic; }
.study-answer ul { display: grid; gap: 6px; margin: 15px 0 0; padding: 0; list-style: none; }
.study-answer li { padding-left: 11px; border-left: 3px solid var(--accent); color: #486067; line-height: 1.45; }
.vocab-study-sidebar { display: flex; flex-direction: column; gap: 11px; }
.vocab-control-panel { padding: 15px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,.86); }
.vocab-control-panel > p { margin: 0 0 11px; color: var(--muted); font-size: 12px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.vocab-control-panel > small { display: block; margin-top: 8px; color: var(--muted); font-size: 12px; }
.vocab-control-stack { display: grid; gap: 8px; }
.vocab-control-stack .primary-action,.vocab-control-stack .secondary-action,.vocab-auto-panel .primary-action { width: 100%; }
.vocab-control-stack > div { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.vocab-control-stack > div button { min-height: 42px; border: 0; border-radius: 11px; color: var(--brand); background: #e7f0f0; cursor: pointer; font-weight: 800; }
.vocab-memory-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.vocab-memory-actions button { min-height: 43px; border: 0; border-radius: 11px; color: #98531b; background: #fff1e4; cursor: pointer; font-weight: 800; }
.vocab-memory-actions button.known { color: var(--success); background: var(--success-soft); }
.vocab-known-progress { height: 7px; margin-top: 12px; overflow: hidden; border-radius: 99px; background: #e5ecea; }
.vocab-known-progress span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg,var(--brand-2),var(--accent)); }
.vocab-speed { display: grid; grid-template-columns: repeat(3,1fr); gap: 5px; margin-bottom: 9px; }
.vocab-speed button { min-height: 35px; padding: 0 4px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); background: white; cursor: pointer; font-size: 12px; font-weight: 800; }
.vocab-speed button.active { color: #855f11; border-color: #e9ce7f; background: #fff6d9; }
.vocab-hint { margin: 13px 0 0; color: var(--muted); text-align: center; font-size: 12px; }
.dictionary-controls { display: flex; align-items: center; gap: 18px; margin-bottom: 18px; }
.dictionary-controls label { min-height: 50px; flex: 1; display: flex; align-items: center; gap: 10px; padding: 0 15px; border: 1px solid var(--line); border-radius: 14px; background: white; box-shadow: 0 8px 25px rgba(15,76,92,.05); }
.dictionary-controls label:focus-within { border-color: var(--brand-2); }
.dictionary-controls label > span { color: var(--brand-2); font-size: 24px; line-height: 1; }
.dictionary-controls input { width: 100%; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 16px; }
.dictionary-controls > small { min-width: 135px; color: var(--muted); text-align: right; }
.dictionary-list { display: grid; gap: 8px; }
.dictionary-row { display: grid; grid-template-columns: minmax(180px, .7fr) minmax(260px, 1.35fr) auto; gap: 22px; align-items: center; padding: 15px 17px; border: 1px solid var(--line); border-radius: 15px; background: white; }
.dictionary-jp h2 { margin: 0; font-size: 22px; }
.dictionary-jp p { margin: 4px 0 0; color: var(--brand-2); font-size: 14px; font-weight: 750; }
.dictionary-jp small { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; font-weight: 500; }
.dictionary-meaning { margin: 0; color: #385058; line-height: 1.55; }
.dictionary-save { min-width: 84px; min-height: 38px; border: 1px solid var(--line); border-radius: 10px; color: var(--brand); background: #edf4f4; cursor: pointer; font-size: 13px; font-weight: 800; }
.dictionary-save.saved { color: var(--success); border-color: #c9e6d8; background: var(--success-soft); }
.load-more { display: flex; margin: 22px auto 0; align-items: center; justify-content: center; }
.empty-state.compact { min-height: 260px; }
.empty-state { min-height: 360px; display: grid; place-items: center; align-content: center; text-align: center; padding: 40px; border: 1px dashed #bdcecb; border-radius: 22px; background: white; }
.empty-state > span { width: 72px; height: 72px; display: grid; place-items: center; border-radius: 22px; color: var(--brand); background: #e8f2f2; font-size: 32px; font-weight: 900; }
.empty-state h2 { margin: 18px 0 5px; }
.empty-state p { max-width: 420px; margin: 0 0 20px; color: var(--muted); }

.study-home { max-width: 1180px; margin: 0 auto; padding: clamp(24px,4vw,54px) 20px 74px; }
.study-dashboard { min-height: 340px; display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 42px; align-items: center; padding: clamp(30px,5vw,60px); color: white; background: linear-gradient(125deg,#0b3d49 0%,#0f5e69 58%,#177b80 100%); border-radius: 32px; box-shadow: 0 24px 70px rgba(15,76,92,.2); overflow: hidden; }
.study-dashboard__copy { position: relative; z-index: 1; }
.study-dashboard .eyebrow { color: #9ee2de; }
.study-dashboard h1 { max-width: 700px; margin: 12px 0 16px; font-size: clamp(42px,6vw,70px); line-height: .98; letter-spacing: -.055em; }
.study-dashboard p { max-width: 640px; margin: 0; color: rgba(255,255,255,.78); font-size: 18px; line-height: 1.65; }
.study-dashboard .study-continue { margin-top: 27px; color: var(--ink); background: var(--accent); }
.study-dashboard .study-continue:hover { background: #ffd26b; }
.study-progress-ring { width: 190px; height: 190px; flex: 0 0 auto; padding: 14px; border-radius: 50%; background: conic-gradient(var(--accent) var(--study-progress),rgba(255,255,255,.14) 0); box-shadow: 0 0 0 1px rgba(255,255,255,.13),0 18px 50px rgba(3,35,42,.28); }
.study-progress-ring > div { width: 100%; height: 100%; display: grid; place-content: center; text-align: center; border-radius: 50%; background: #0d4a56; }
.study-progress-ring strong { display: block; font-size: 42px; line-height: 1; }
.study-progress-ring span { display: block; max-width: 90px; margin-top: 8px; color: rgba(255,255,255,.7); font-size: 12px; line-height: 1.35; }
.study-loop { display: grid; grid-template-columns: repeat(3,1fr); gap: 1px; margin: 20px 0 48px; overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: var(--line); }
.study-loop > div { display: grid; grid-template-columns: auto 1fr; gap: 13px; align-items: center; padding: 18px 20px; background: white; }
.study-loop > div > span { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px; color: var(--brand); background: #e7f1f1; font-weight: 900; }
.study-loop p,.study-loop strong,.study-loop small { display: block; margin: 0; }
.study-loop small { margin-top: 3px; color: var(--muted); line-height: 1.35; }
.chapter-section .section-title { align-items: center; }
.chapter-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 15px; }
.chapter-card { padding: 24px; border: 1px solid var(--line); border-radius: 20px; background: white; box-shadow: 0 12px 36px rgba(15,76,92,.07); transition: transform .18s ease,border-color .18s ease; }
.chapter-card:hover { transform: translateY(-2px); border-color: #9bc5c1; }
.chapter-card.complete { border-color: #b9dbc9; }
.chapter-card__top,.chapter-card__foot { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.chapter-card__top > span { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; color: white; background: var(--brand); font-weight: 900; }
.chapter-card__top small,.chapter-card__foot small { color: var(--muted); }
.chapter-card > p { margin: 20px 0 4px; color: var(--brand-2); font-weight: 750; }
.chapter-card h3 { margin: 0; font-size: 22px; }
.chapter-progress { height: 6px; margin: 22px 0 15px; overflow: hidden; border-radius: 99px; background: #edf2f1; }
.chapter-progress span { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.chapter-card__foot button { border: 0; color: var(--brand); background: transparent; cursor: pointer; font-weight: 900; }
.source-note { margin-top: 24px; padding: 20px 24px; border-left: 4px solid var(--accent); border-radius: 0 16px 16px 0; background: #fff9e9; }
.source-note p { margin: 5px 0 0; color: #6a5d3e; line-height: 1.55; }

.study-layout { max-width: 1280px; margin: 0 auto; padding: 28px 22px 76px; display: grid; grid-template-columns: 285px minmax(0,1fr); gap: 28px; }
.chapter-rail { position: sticky; top: 101px; align-self: start; }
.chapter-kicker { margin: 15px 0 5px; color: var(--brand-2); font-size: 12px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.chapter-rail h2 { margin: 0; font-size: 25px; line-height: 1.2; }
.chapter-rail > p:not(.chapter-kicker) { margin: 7px 0 22px; color: var(--muted); }
.unit-nav { display: grid; gap: 7px; }
.unit-nav button { position: relative; width: 100%; display: grid; grid-template-columns: 42px 1fr 18px; gap: 9px; align-items: center; min-height: 58px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 13px; color: #40575d; background: white; text-align: left; cursor: pointer; line-height: 1.35; }
.unit-nav button > span { color: var(--brand-2); font-weight: 900; }
.unit-nav button i { color: var(--success); font-style: normal; font-weight: 900; }
.unit-nav button.active { color: white; border-color: var(--brand); background: var(--brand); box-shadow: 0 10px 25px rgba(15,76,92,.2); }
.unit-nav button.active span,.unit-nav button.active i { color: var(--accent); }
.study-lesson { padding: clamp(23px,4vw,46px); border: 1px solid var(--line); border-radius: 28px; background: white; box-shadow: var(--shadow); }
.lesson-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.lesson-meta span { padding: 7px 10px; border-radius: 999px; color: var(--muted); background: #eef3f2; font-size: 12px; font-weight: 750; }
.lesson-meta span:first-child { color: var(--brand); background: #e4f0ef; }
.curriculum-panel { min-width: 0; margin: 0 0 24px; border: 1px solid #bfd7d3; border-radius: 20px; background: linear-gradient(135deg,#f8fcfb,#edf6f4); overflow: hidden; }
.curriculum-complete > summary { list-style: none; }
.curriculum-complete > summary::-webkit-details-marker,.curriculum-tier > summary::-webkit-details-marker,.focus-topic > summary::-webkit-details-marker { display: none; }
.curriculum-panel__head { min-height: 84px; display: grid; grid-template-columns: minmax(0,1fr) auto 22px; gap: 14px; align-items: center; padding: 18px 20px; cursor: pointer; }
.curriculum-panel__head > div > strong { display: block; margin-top: 5px; color: var(--ink); font-size: 17px; line-height: 1.35; }
.curriculum-panel__head > span { padding: 7px 10px; border-radius: 999px; color: var(--brand); background: #dcefed; font-size: 12px; font-weight: 850; white-space: nowrap; }
.curriculum-panel__head > i,.curriculum-tier summary > i,.focus-topic summary > i { color: var(--brand); font-style: normal; font-size: 18px; transition: transform .2s ease; }
.curriculum-complete[open] > .curriculum-panel__head > i,.curriculum-tier[open] > summary > i,.focus-topic[open] > summary > i { transform: rotate(180deg); }
.curriculum-panel__body { padding: 0 20px 22px; border-top: 1px solid rgba(15,76,92,.12); }
.curriculum-overview { display: flex; justify-content: space-between; gap: 16px; align-items: center; padding: 17px 0; }
.curriculum-overview p { margin: 0; color: var(--brand); font-weight: 800; }
.curriculum-overview > div { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.curriculum-overview span,.focus-topic__meta span { padding: 5px 8px; border-radius: 999px; color: #52686c; background: rgba(255,255,255,.86); font-size: 11px; font-weight: 750; }
.curriculum-section { padding-top: 19px; border-top: 1px solid rgba(15,76,92,.12); }
.curriculum-section + .curriculum-section { margin-top: 22px; }
.curriculum-section__title { display: flex; justify-content: space-between; gap: 18px; align-items: end; margin-bottom: 12px; }
.curriculum-section__title h2 { margin: 4px 0 0; font-size: 20px; }
.curriculum-section__title > small { color: var(--muted); font-size: 11px; }
.curriculum-tier-list,.focus-topic-list { display: grid; gap: 9px; }
.curriculum-tier,.focus-topic { border: 1px solid rgba(15,76,92,.14); border-radius: 14px; background: rgba(255,255,255,.83); overflow: hidden; }
.curriculum-tier summary { display: grid; grid-template-columns: 36px minmax(0,1fr) 18px; gap: 11px; align-items: center; padding: 13px 14px; cursor: pointer; }
.curriculum-tier summary > span,.focus-priority { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; color: white; background: var(--brand); font-size: 13px; font-weight: 950; }
.curriculum-tier--a summary > span,.focus-priority--a { color: #5d3c06; background: #f4c45a; }
.curriculum-tier--b summary > span,.focus-priority--b { background: #2b8190; }
.curriculum-tier--c summary > span,.focus-priority--c { background: #73878b; }
.curriculum-tier summary strong,.curriculum-tier summary small,.focus-topic summary strong,.focus-topic summary small { display: block; }
.curriculum-tier summary strong { color: var(--ink); }
.curriculum-tier summary small { margin-top: 2px; color: var(--muted); line-height: 1.35; }
.curriculum-point-list { display: grid; gap: 0; margin: 0; padding: 0 14px 12px 56px; list-style: none; counter-reset: curriculum-point; }
.curriculum-point-list li { position: relative; padding: 12px 0; border-top: 1px solid rgba(15,76,92,.1); counter-increment: curriculum-point; }
.curriculum-point-list li::before { content: counter(curriculum-point,decimal-leading-zero); position: absolute; left: -40px; top: 14px; color: #7a9597; font-size: 10px; font-weight: 900; }
.curriculum-point-list p { min-width: 0; margin: 0; overflow-wrap: anywhere; word-break: normal; line-height: 1.62; }
.curriculum-point-jp { color: #173a40; font-weight: 700; }
.curriculum-point-vi { margin-top: 5px !important; color: #4a6065; }
.curriculum-point-list small { display: inline-block; margin-top: 7px; padding: 3px 7px; border-radius: 7px; color: #5d777a; background: #e9f2f0; font-size: 10px; font-weight: 750; }
.curriculum-support { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.curriculum-support section { padding: 15px 16px; border-radius: 13px; }
.curriculum-support section > span { display: block; margin-bottom: 8px; font-size: 11px; font-weight: 900; letter-spacing: .05em; text-transform: uppercase; }
.curriculum-support ul { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; }
.curriculum-support li,.curriculum-support p { min-width: 0; margin: 0; overflow-wrap: anywhere; line-height: 1.55; }
.curriculum-formulas { color: #244f53; background: #dceeea; }
.curriculum-formulas li { padding-left: 16px; font-weight: 700; }
.curriculum-formulas li::before { content: "▸"; margin-left: -16px; margin-right: 6px; color: var(--brand-2); }
.curriculum-trap { color: #6e4c20; background: #fff2cf; }
.curriculum-checklist { grid-column: 1 / -1; color: #315a51; background: #e8f3ee; }
.curriculum-checklist ul { grid-template-columns: 1fr 1fr; column-gap: 18px; }
.curriculum-checklist li { padding-left: 19px; }
.curriculum-checklist li::before { content: "☐"; margin-left: -19px; margin-right: 6px; color: var(--brand-2); font-weight: 900; }
.focus-topic summary { display: grid; grid-template-columns: 36px minmax(0,1fr) auto 18px; gap: 11px; align-items: center; padding: 13px 14px; cursor: pointer; }
.focus-topic summary b { padding: 5px 8px; border-radius: 999px; color: #70500f; background: #fff0bf; font-size: 11px; white-space: nowrap; }
.focus-topic summary small { margin-top: 3px; color: var(--muted); line-height: 1.35; }
.focus-topic__body { padding: 0 14px 14px 61px; }
.focus-topic__meta { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
.focus-point-list { display: grid; gap: 7px; }
.focus-point-list article { padding: 11px 12px; border-left: 3px solid #85b9b3; border-radius: 0 10px 10px 0; background: #f7fbfa; }
.focus-point-list p { min-width: 0; margin: 0; overflow-wrap: anywhere; line-height: 1.58; }
.focus-point-list p:first-child { color: #173c43; font-weight: 680; }
.focus-point-list p + p { margin-top: 4px; color: #50666a; }
.focus-refs { margin: 11px 0 0; color: #687d81; font-size: 11px; line-height: 1.6; }
.focus-refs b { color: var(--brand-2); }
.lesson-heading { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: start; margin-bottom: 28px; }
.lesson-heading h1 { margin: 7px 0 6px; font-size: clamp(30px,4vw,48px); line-height: 1.07; letter-spacing: -.045em; }
.lesson-heading p { margin: 0; color: var(--brand-2); font-size: 18px; font-weight: 750; }
.recall-toggle { min-height: 44px; display: inline-flex; align-items: center; gap: 8px; padding: 0 14px; border: 1px solid #a8cbc7; border-radius: 12px; color: var(--brand); background: #edf7f5; cursor: pointer; font-weight: 850; }
.recall-toggle.active { color: white; border-color: var(--brand); background: var(--brand); }
.study-points { display: grid; gap: 13px; }
.study-point-card { width: 100%; display: grid; grid-template-columns: 42px 1fr 1fr; gap: 18px; align-items: start; padding: 20px; border: 1px solid var(--line); border-radius: 17px; color: var(--ink); background: #fbfdfc; text-align: left; cursor: default; }
.study-point-card .point-number { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px; color: var(--brand); background: #e5f0ef; font-size: 12px; font-weight: 900; }
.study-jp,.study-vi { font-size: 16px; line-height: 1.72; }
.study-jp { font-weight: 680; }
.study-vi { padding-left: 18px; border-left: 1px solid var(--line); color: #405a61; transition: filter .2s ease,opacity .2s ease; }
.study-point-card small { display: none; grid-column: 2 / -1; color: var(--muted); }
.study-points.recall-mode .study-point-card { cursor: pointer; }
.study-points.recall-mode .study-vi { filter: blur(8px); opacity: .25; user-select: none; }
.study-points.recall-mode .study-point-card.revealed .study-vi { filter: none; opacity: 1; user-select: auto; }
.study-points.recall-mode .study-point-card small { display: block; }
.lesson-support-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; margin: 18px 0 36px; }
.lesson-support-grid article { padding: 19px; border-radius: 16px; }
.lesson-support-grid article > span { display: block; margin-bottom: 9px; font-size: 12px; font-weight: 900; letter-spacing: .07em; text-transform: uppercase; }
.lesson-support-grid p { margin: 0; line-height: 1.65; }
.term-focus { color: #35545a; border: 1px solid #cfe1de; background: #eff7f5; }
.term-focus > span { color: var(--brand-2); }
.trap-focus { color: #6a4b28; border: 1px solid #ead6ae; background: #fff9ec; }
.trap-focus > span { color: #9b641c; }
.trap-focus p + p { margin-top: 7px; padding-top: 7px; border-top: 1px solid rgba(155,100,28,.16); }
.related-questions { padding-top: 30px; border-top: 1px solid var(--line); }
.related-questions .section-title { align-items: end; }
.related-questions .section-title small { color: var(--muted); }
.question-ref-list { display: grid; gap: 8px; }
.question-ref-list button { display: grid; grid-template-columns: 1fr auto; gap: 6px 14px; padding: 15px 17px; border: 1px solid var(--line); border-radius: 14px; color: var(--ink); background: #fbfcfc; text-align: left; cursor: pointer; }
.question-ref-list button:hover { border-color: #9fc8c4; background: #f4faf9; }
.question-ref-list span { color: var(--brand-2); font-size: 13px; font-weight: 900; }
.question-ref-list p { grid-column: 1; margin: 0; color: #425c62; line-height: 1.5; }
.question-ref-list i { grid-column: 2; grid-row: 1 / 3; align-self: center; color: var(--brand); font-style: normal; font-weight: 900; }
.lesson-footer { display: flex; justify-content: space-between; gap: 12px; margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line); }
.lesson-footer .is-complete { color: var(--success); border-color: #b9ddcc; background: var(--success-soft); }

.modal-overlay { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: rgba(9,31,36,.55); backdrop-filter: blur(5px); }
.confirm-dialog { width: min(440px,100%); padding: 28px; border-radius: 22px; background: white; box-shadow: 0 30px 90px rgba(0,0,0,.25); text-align: center; }
.dialog-icon { width: 48px; height: 48px; display: grid; place-items: center; margin: 0 auto; border-radius: 15px; color: var(--brand); background: #e8f2f2; font-size: 22px; font-weight: 900; }
.confirm-dialog h2 { margin: 16px 0 8px; font-size: 21px; line-height: 1.4; }
.confirm-dialog p { margin: 0 0 22px; color: var(--muted); font-size: 14px; }
.confirm-dialog > div { display: flex; justify-content: center; gap: 10px; }

@media (max-width: 900px) {
  .home-grid { grid-template-columns: 1fr; }
  .multi-exam .quick-panel { position: static; }
  .quick-panel { display: grid; grid-template-columns: 1fr 1fr; }
  .quick-card { border-bottom: 0; }
  .backup-card { grid-column: 1 / -1; }
  .vocab-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .study-layout { grid-template-columns: 230px minmax(0,1fr); gap: 18px; }
  .study-point-card { grid-template-columns: 38px 1fr; }
  .study-vi { grid-column: 2; padding: 14px 0 0; border-left: 0; border-top: 1px solid var(--line); }
}

@media (max-width: 760px) {
  .topbar { min-height: 66px; padding: 0 14px; gap: 10px; }
  .brand small { display: none; }
  .brand-mark { width: 37px; height: 37px; }
  .topnav { margin-left: auto; }
  .topnav { overflow-x: auto; scrollbar-width: none; }
  .topnav::-webkit-scrollbar { display: none; }
  .topnav button { flex: 0 0 auto; padding: 0 9px; font-size: 13px; white-space: nowrap; }
  .topnav button span { display: none; }
  .topnav button.active::after { left: 8px; right: 8px; }
  .site-signature { width: calc(100% - 28px); margin-top: -30px; padding-bottom: 22px; }
  .home-wrap, .vocab-wrap, .result-wrap { padding: 26px 14px 55px; }
  .home-heading { grid-template-columns: 1fr; }
  .home-heading h1 { font-size: 43px; }
  .home-heading p { font-size: 16px; }
  .home-stat { display: none; }
  .vocab-hub-heading { align-items: flex-start; }
  .vocab-progress-summary { padding: 11px 13px; }
  .vocab-progress-summary strong { font-size: 20px; }
  .vocab-progress-summary span { display: block; font-size: 11px; }
  .vocab-tabs button { padding: 0 12px; font-size: 13px; }
  .vocab-study-toolbar { grid-template-columns: 1fr; }
  .vocab-scope { overflow-x: auto; scrollbar-width: none; }
  .vocab-scope::-webkit-scrollbar { display: none; }
  .vocab-scope button { flex: 1 0 auto; }
  .vocab-study-stage { grid-template-columns: 1fr; }
  .study-flashcard { min-height: 390px; padding: 25px 21px; border-radius: 22px; }
  .study-word-area { padding: 24px 0 18px; }
  .study-word-area h2 { font-size: clamp(3rem,17vw,5.4rem); }
  .vocab-study-sidebar { display: grid; grid-template-columns: 1fr 1fr; }
  .vocab-auto-panel { grid-column: 1 / -1; }
  .vocab-hint { display: none; }
  .dictionary-controls { display: grid; gap: 8px; }
  .dictionary-controls > small { min-width: 0; text-align: left; }
  .dictionary-row { grid-template-columns: minmax(0,1fr) auto; gap: 10px 14px; }
  .dictionary-meaning { grid-column: 1 / -1; grid-row: 2; padding-top: 10px; border-top: 1px solid var(--line); }
  .dictionary-save { grid-column: 2; grid-row: 1; }
  .exam-actions > button { width: 100%; }
  .review-inline { min-height: 40px; }
  .quick-panel { display: block; }
  .backup-card { margin-top: 8px; }
  .history-list > div { grid-template-columns: auto 1fr; }
  .history-list > div > span:last-child { grid-column: 2; }
  .quiz-layout { display: block; padding: 12px 9px 45px; }
  .quiz-side { display: none; }
  .mobile-question-toggle { display: flex; position: fixed; left: 0; top: 50%; z-index: 45; width: 43px; min-height: 66px; padding: 8px 5px; border: 0; border-radius: 0 14px 14px 0; transform: translateY(-50%); flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: white; background: var(--brand); box-shadow: 4px 8px 24px rgba(15,76,92,.24); cursor: pointer; }
  .mobile-question-toggle span { font-size: 20px; line-height: 1; }
  .mobile-question-toggle b { min-width: 24px; height: 20px; display: grid; place-items: center; border-radius: 8px; color: var(--brand); background: white; font-size: 11px; }
  .question-drawer-backdrop { display: block; position: fixed; inset: 0; z-index: 54; background: rgba(7,29,34,.48); backdrop-filter: blur(2px); }
  .question-drawer { display: block; position: fixed; inset: 0 auto 0 0; z-index: 55; width: min(86vw,340px); overflow-y: auto; padding: calc(20px + env(safe-area-inset-top)) 18px calc(24px + env(safe-area-inset-bottom)); color: var(--ink); background: #f7faf9; box-shadow: 12px 0 38px rgba(8,42,49,.22); transform: translateX(-105%); transition: transform .24s ease; }
  .question-drawer.open { transform: translateX(0); }
  .question-drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
  .question-drawer-head small, .question-drawer-head strong { display: block; }
  .question-drawer-head small { color: var(--muted); font-size: 12px; }
  .question-drawer-head strong { margin-top: 3px; color: var(--brand); font-size: 15px; }
  .question-drawer-head button { width: 39px; height: 39px; border: 1px solid var(--line); border-radius: 12px; color: var(--brand); background: white; cursor: pointer; font-size: 24px; line-height: 1; }
  .question-drawer-back { margin: 8px 0 18px; padding: 5px 0; border: 0; color: var(--brand-2); background: transparent; cursor: pointer; font-size: 13px; font-weight: 800; }
  .drawer-number-grid { gap: 9px; }
  .drawer-number-grid button { min-width: 0; font-size: 13px; }
  .drawer-legend { display: flex; gap: 16px; margin-top: 18px; color: var(--muted); font-size: 12px; }
  .drawer-legend span { display: flex; align-items: center; gap: 6px; }
  .drawer-legend i { width: 8px; height: 8px; border-radius: 50%; }
  .drawer-legend .done { background: #8fc2bc; }
  .drawer-legend .mark { background: var(--accent); }
  body.question-drawer-open { overflow: hidden; }
  .question-panel { margin-top: 7px; padding: 20px 15px; border-radius: 18px; }
  .question-toolbar { align-items: flex-start; }
  .flag-button { font-size: 0; width: 38px; }
  .flag-button::first-letter { font-size: 15px; }
  .timer { font-size: 13px; }
  .tap-hint { font-size: 12px; line-height: 1.4; }
  .jp-content h1 { font-size: 18px; line-height: 1.72; }
  .option { grid-template-columns: 40px minmax(0,1fr); padding: 12px 10px; }
  .option > span { width: 36px; height: 36px; }
  .option b { font-size: 15px; }
  .option em { grid-column: 2; }
  .option-translation { margin-left: 49px; }
  .answer-comparison { grid-template-columns: 1fr; }
  .keyword-box span { width: 100%; justify-content: space-between; }
  .term-popover { max-width: calc(100vw - 24px); }
  .question-footer { grid-template-columns: 1fr 1fr; }
  .question-footer > span { display: none; }
  .question-footer > button { width: 100%; padding: 0 9px; }
  .result-hero { grid-template-columns: 1fr; justify-items: center; text-align: center; gap: 24px; }
  .score-ring { width: 160px; height: 160px; }
  .result-copy > div { justify-content: center; flex-wrap: wrap; }
  .result-details { padding: 18px 12px; }
  .result-answer { padding: 4px 14px 18px; }
  .vocab-grid { grid-template-columns: 1fr; }
  .vocab-title { align-items: flex-start; }
  .vocab-total { width: 72px; height: 72px; font-size: 25px; }
  .section-title { align-items: flex-start; }
  .study-home { padding: 14px 12px 55px; }
  .study-dashboard { min-height: 0; grid-template-columns: 1fr; padding: 28px 23px; border-radius: 22px; }
  .study-dashboard h1 { font-size: 43px; }
  .study-dashboard p { font-size: 16px; }
  .study-progress-ring { width: 116px; height: 116px; padding: 9px; position: absolute; opacity: .18; right: 20px; top: 84px; }
  .study-progress-ring strong { font-size: 27px; }
  .study-progress-ring span { display: none; }
  .study-loop { grid-template-columns: 1fr; }
  .chapter-grid { grid-template-columns: 1fr; }
  .chapter-section .section-title { align-items: flex-start; }
  .study-layout { display: block; padding: 12px 9px 50px; }
  .chapter-rail { position: static; padding: 0 7px; }
  .chapter-rail h2,.chapter-rail > p:not(.chapter-kicker) { display: none; }
  .unit-nav { display: flex; gap: 7px; margin: 8px 0 14px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
  .unit-nav::-webkit-scrollbar { display: none; }
  .unit-nav button { width: auto; min-width: 126px; grid-template-columns: 1fr 15px; min-height: 44px; padding: 8px 10px; font-size: 12px; }
  .unit-nav button > span { grid-column: 1; }
  .unit-nav button i { grid-column: 2; grid-row: 1; }
  .study-lesson { padding: 21px 15px; border-radius: 20px; }
  .curriculum-panel__head { grid-template-columns: minmax(0,1fr) 18px; min-height: 72px; padding: 15px; }
  .curriculum-panel__head > span { grid-column: 1; grid-row: 2; justify-self: start; }
  .curriculum-panel__head > i { grid-column: 2; grid-row: 1 / 3; }
  .curriculum-panel__body { padding: 0 13px 15px; }
  .curriculum-overview { display: block; }
  .curriculum-overview > div { justify-content: flex-start; margin-top: 9px; }
  .curriculum-section__title { display: block; }
  .curriculum-section__title > small { display: block; margin-top: 4px; }
  .curriculum-tier summary { grid-template-columns: 34px minmax(0,1fr) 16px; padding: 11px; }
  .curriculum-point-list { padding: 0 11px 10px 49px; }
  .curriculum-point-list li::before { left: -35px; }
  .curriculum-support { grid-template-columns: 1fr; }
  .curriculum-checklist { grid-column: auto; }
  .curriculum-checklist ul { grid-template-columns: 1fr; }
  .focus-topic summary { grid-template-columns: 34px minmax(0,1fr) 16px; padding: 11px; }
  .focus-topic summary b { grid-column: 2; justify-self: start; }
  .focus-topic summary > i { grid-column: 3; grid-row: 1 / 3; }
  .focus-topic__body { padding: 0 11px 11px; }
  .lesson-heading { grid-template-columns: 1fr; gap: 15px; }
  .recall-toggle { justify-self: start; }
  .study-point-card { padding: 16px 13px; gap: 12px; }
  .study-jp,.study-vi { font-size: 15px; }
  .lesson-support-grid { grid-template-columns: 1fr; }
  .related-questions .section-title { display: block; }
  .related-questions .section-title small { display: block; margin-top: 6px; }
  .lesson-footer { flex-direction: column; }
  .lesson-footer button { width: 100%; }
}

@media (max-width: 420px) {
  .brand > span:last-child { display: none; }
  .vocab-hub-heading { display: block; }
  .vocab-progress-summary { display: inline-flex; align-items: baseline; gap: 4px; margin-top: 12px; }
  .vocab-progress-summary span { display: inline; }
  .vocab-study-sidebar { grid-template-columns: 1fr; }
  .vocab-auto-panel { grid-column: auto; }
  .vocab-category-badge { max-width: 210px; }
  .question-toolbar > div:first-child { max-width: 52%; }
  .timer.calm { display: none; }
  .question-footer { gap: 7px; }
  .question-footer button { font-size: 13px; }
  .result-filters { overflow-x: auto; }
}

@media (prefers-reduced-motion: no-preference) {
  .exam-card, .question-panel, .result-hero, .vocab-card { animation: rise .4s ease both; }
  @keyframes rise { from { opacity: 0; transform: translateY(10px); } }
}

/* V2 — calm, mobile-first study surface */
:root { --ink:#172b31; --muted:#687a7e; --paper:#f7f9f8; --line:#e1e8e6; --brand:#0f4c5c; --shadow:none; }
body { background:var(--paper); }
.topbar { min-height:58px; padding:0 max(16px,calc((100vw - 1100px)/2)); background:rgba(247,249,248,.94); }
.brand-mark { width:30px; height:30px; border-radius:9px; font-size:15px; }.brand strong { font-size:14px; }.topnav button { min-width:64px; font-size:14px; }.app-menu { margin-left:8px; position:relative; }.app-menu summary { list-style:none; width:40px; height:40px; display:grid; place-items:center; cursor:pointer; border-radius:10px; font-weight:900; font-size:22px; }.app-menu summary::-webkit-details-marker { display:none; }.app-menu[open] summary { background:#eaf1f0; }.app-menu>div { position:absolute; right:0; top:46px; width:196px; padding:7px; border:1px solid var(--line); border-radius:12px; background:white; box-shadow:0 10px 28px rgba(15,76,92,.12); }.app-menu button,.app-menu label { width:100%; display:block; border:0; padding:11px; border-radius:8px; color:var(--ink); background:transparent; text-align:left; cursor:pointer; font-size:13px; }.app-menu button:hover,.app-menu label:hover { background:#f0f5f4; }
.sync-status { display:block; margin:2px 5px 5px; padding:7px 8px; border-radius:8px; color:var(--muted); background:var(--sage-soft); font-size:11px; font-weight:700; }
.sync-bootstrap { min-height:55vh; display:grid; place-items:center; color:var(--muted); font-size:14px; }
.bottom-nav { display:none; }.site-signature { width:min(100% - 32px,760px); margin:0 auto; padding:24px 0 32px; justify-content:flex-start; flex-direction:column; gap:5px; }.site-signature strong { color:var(--ink); font:600 13px inherit; }.site-signature span { font-size:12px; text-transform:none; letter-spacing:0; }
.study-home,.chapter-page,.practice-home,.exam-detail,.quick-start { width:min(100% - 32px,760px); margin:0 auto; padding:32px 0 56px; }.study-welcome { max-width:620px; }.study-welcome h1,.practice-home h1,.exam-detail h1,.quick-start h1 { margin:7px 0 8px; font-size:30px; letter-spacing:-.035em; }.study-welcome p,.practice-home>p,.quick-start>p,.exam-detail>p { margin:0; color:var(--muted); font-size:16px; line-height:1.65; }.compact-progress { margin:22px 0 16px; }.compact-progress span { display:block; margin-bottom:8px; color:var(--muted); font-size:13px; }.compact-progress b { color:var(--brand); }.compact-progress i { display:block; height:6px; overflow:hidden; border-radius:99px; background:#e5ecea; }.compact-progress i b { display:block; height:100%; background:var(--brand); border-radius:inherit; }.primary-action,.secondary-action { min-height:46px; border-radius:12px; box-shadow:none; }.chapter-section { margin-top:42px; }.chapter-section .section-title h2 { font-size:20px; }.chapter-list,.unit-list,.exam-compact-list { border-top:1px solid var(--line); }.chapter-row,.unit-list button,.exam-compact-list button { width:100%; display:grid; grid-template-columns:42px 1fr auto 18px; gap:10px; align-items:center; padding:13px 2px; border:0; border-bottom:1px solid var(--line); color:var(--ink); background:transparent; text-align:left; cursor:pointer; }.chapter-row>b { color:var(--brand); font-size:13px; }.chapter-row strong,.chapter-row small { display:block; }.chapter-row strong { font-size:16px; }.chapter-row small { margin-top:3px; color:var(--muted); font-size:13px; }.chapter-row>span i { display:block; height:3px; margin-top:8px; overflow:hidden; border-radius:8px; background:#e5ecea; }.chapter-row>span i em { display:block; height:100%; background:#8db9b4; }.chapter-row>small { color:var(--muted); font-size:12px; }.chapter-row>i,.exam-compact-list i { font-size:25px; font-style:normal; color:var(--brand); }.chapter-page h1 { margin:5px 0; font-size:28px; }.chapter-page>p { margin:0; color:var(--muted); }.unit-list button { grid-template-columns:44px 1fr auto; min-height:54px; }.unit-list span { color:var(--brand); font-weight:800; }.unit-list strong { font-size:15px; }.unit-list i { color:var(--muted); font-style:normal; }.study-layout { max-width:1040px; grid-template-columns:205px minmax(0,1fr); padding-top:24px; }.study-lesson { border-radius:16px; box-shadow:none; }.lesson-meta { display:none; }.lesson-heading h1 { font-size:26px; }.lesson-heading p { font-size:16px; }.study-points { display:none; }.lesson-core { display:grid; gap:12px; }.lesson-core .curriculum-tier { border-radius:12px; }.lesson-core .curriculum-tier summary { cursor:default; }.lesson-core .curriculum-tier summary i { display:none; }.lesson-core .curriculum-tier--a { background:#fff8e7; border-color:#f0dfad; }.lesson-core .curriculum-tier--b { background:#eef7f6; border-color:#d6e9e6; }.lesson-core .curriculum-tier--c { background:#f3f5f5; }.lesson-formula,.lesson-trap { padding:15px; border-radius:12px; }.lesson-formula { border:1px solid #d5e2df; background:white; }.lesson-trap { background:#fff7e8; }.lesson-formula strong,.lesson-trap strong,.term-focus>span { font-size:12px; letter-spacing:.06em; }.lesson-formula p,.lesson-trap p { margin:8px 0 0; line-height:1.6; }.lesson-full { border-top:1px solid var(--line); }.lesson-full>summary { padding:18px 0; color:var(--brand); cursor:pointer; font-weight:750; }.lesson-full>summary span { float:right; }.curriculum-panel { margin:0; }.lesson-support-grid { margin:18px 0 28px; }.lesson-support-grid article { padding:15px; border-radius:12px; }.related-questions { padding-top:20px; }.question-ref-list button { border:0; border-bottom:1px solid var(--line); border-radius:0; background:transparent; padding:13px 0; }.lesson-footer { position:sticky; bottom:0; margin:20px -2px -2px; padding:12px 2px calc(12px + env(safe-area-inset-bottom)); background:rgba(255,255,255,.94); }
.practice-home h1 { margin-bottom:22px; }.practice-actions { display:grid; gap:10px; margin-bottom:40px; }.practice-actions button { justify-content:space-between; text-align:left; }.practice-actions .secondary-action small { margin-left:auto; color:var(--muted); }.exam-compact-list h2 { font-size:18px; margin:0; padding:0 0 12px; }.exam-compact-list button { grid-template-columns:1fr auto 18px; }.exam-compact-list span,.exam-compact-list small { display:block; }.exam-compact-list span { font-weight:700; }.exam-compact-list small { color:var(--muted); font-size:12px; }.exam-detail-actions { display:grid; gap:10px; margin-top:28px; }.exam-detail-meta { margin-top:18px!important; padding:12px; background:#eef5f4; border-radius:10px; font-size:14px!important; }.quick-scope { display:grid; gap:8px; margin:24px 0; }.quick-scope button { min-height:46px; padding:0 14px; border:1px solid var(--line); border-radius:11px; color:var(--ink); background:white; text-align:left; cursor:pointer; }.quick-scope button.active { color:var(--brand); border-color:var(--brand); background:#eef6f5; }
.quiz-layout { padding-bottom:96px; }.question-panel { border-radius:16px; box-shadow:none; }.question-footer { position:fixed; right:0; bottom:0; left:0; z-index:30; padding:10px max(14px,calc((100vw - 900px)/2)) calc(10px + env(safe-area-inset-bottom)); background:rgba(247,249,248,.96); border-top:1px solid var(--line); }.question-footer>button { min-height:46px; }.question-footer>span { font-weight:800; }.score-ring { display:none; }.result-hero { display:block; padding:0 0 24px; }.result-copy h1 { font-size:30px; }.result-copy p { font-size:15px; }.result-details { box-shadow:none; border-radius:14px; }
.vocab-hub-heading h1 { font-size:30px; }.vocab-hub-heading p { display:none; }.vocab-tabs { display:grid; grid-template-columns:1fr 1fr; gap:8px; border:0; }.vocab-tabs button { min-height:46px; border:1px solid var(--line); border-radius:11px; }.vocab-tabs button.active { background:var(--brand); color:white; }.vocab-tabs button:nth-child(2) { display:none; }.vocab-study-toolbar { display:block; }.vocab-scope { margin-bottom:10px; }.study-flashcard { min-height:370px; border-radius:16px; box-shadow:none; }.vocab-study-stage { grid-template-columns:1fr; }.vocab-study-sidebar { display:grid; grid-template-columns:1fr 1fr; }.vocab-control-panel:first-child { grid-column:1/-1; }.vocab-control-panel:first-child .vocab-control-stack { display:grid; grid-template-columns:1fr auto auto; align-items:center; }.vocab-control-panel:first-child .vocab-control-stack>div { display:contents; }.vocab-control-panel:first-child #vocabShuffle { display:none; }.vocab-control-panel:first-child #vocabSpeak { min-width:46px; font-size:0; }.vocab-control-panel:first-child #vocabSpeak::first-letter { font-size:17px; }.vocab-memory-actions { grid-template-columns:1fr 1fr; }.dictionary-row { border:0; border-bottom:1px solid var(--line); border-radius:0; box-shadow:none; }
@media (max-width:760px) { body { padding-bottom:64px; }.topbar { position:sticky; }.brand>span:last-child small { display:none; }.topnav { display:none; }.app-menu { margin-left:auto; }.bottom-nav { position:fixed; right:0; bottom:0; left:0; z-index:60; display:grid; grid-template-columns:repeat(3,1fr); min-height:64px; padding-bottom:env(safe-area-inset-bottom); border-top:1px solid var(--line); background:rgba(255,255,255,.96); }.bottom-nav button { border:0; color:var(--muted); background:transparent; font-weight:750; cursor:pointer; }.bottom-nav button.active { color:var(--brand); }.site-signature { margin-bottom:30px; }.study-home,.chapter-page,.practice-home,.exam-detail,.quick-start { width:calc(100% - 28px); padding:24px 0 32px; }.study-welcome h1,.practice-home h1,.exam-detail h1,.quick-start h1 { font-size:27px; }.chapter-row { grid-template-columns:34px 1fr auto 14px; }.chapter-row>small { white-space:nowrap; }.study-layout { padding:10px 10px 75px; }.chapter-rail { display:none; }.study-lesson { padding:20px 14px; }.lesson-heading { margin-bottom:18px; }.lesson-heading h1 { font-size:24px; }.recall-toggle { display:none; }.curriculum-tier summary { grid-template-columns:32px minmax(0,1fr); }.curriculum-point-list { padding-left:45px; }.question-panel { padding:18px 13px; }.quiz-layout { padding-bottom:102px; }.question-footer { gap:8px; }.question-footer>span { display:block; font-size:12px; }.question-footer button { padding:0 10px; font-size:13px; }.question-footer button:first-child { text-align:left; }.question-footer button:last-child { text-align:right; }.vocab-wrap { padding-bottom:28px; }.vocab-hub-heading { margin-bottom:18px; }.vocab-study-sidebar { grid-template-columns:1fr; }.vocab-control-panel:first-child { grid-column:auto; }.vocab-control-panel:first-child .vocab-control-stack { grid-template-columns:1fr auto auto; }.study-word-area h2 { font-size:clamp(42px,15vw,68px); } }

/* QC: unit notes are the lesson's primary surface; chapter curriculum stays in one disclosure. */
.lesson-core > .curriculum-tier,.lesson-core > .lesson-formula,.lesson-core > .lesson-trap { display:none; }
.study-points { display:grid; gap:0; border-top:1px solid var(--line); }
.study-point-card { grid-template-columns:34px 1fr; gap:10px; padding:14px 0; border:0; border-bottom:1px solid var(--line); border-radius:0; background:transparent; }
.study-point-card .point-number { width:28px; height:28px; border-radius:8px; font-size:10px; }.study-point-card .study-vi { grid-column:2; padding:5px 0 0; border:0; color:var(--muted); }.study-point-card small { display:none!important; }
.vocab-home-filters { display:flex; flex-wrap:wrap; gap:8px; margin:10px 0 18px; }.vocab-home-filters button { min-height:36px; padding:0 11px; border:1px solid var(--line); border-radius:999px; color:var(--muted); background:white; cursor:pointer; font-size:12px; font-weight:700; }

/* V2 interaction polish */
:root { --gold:#e8b84a; --sage:#dcebe6; --ivory:#f8f4ec; }
button { transition:transform .18s ease, background-color .18s ease, border-color .18s ease, box-shadow .18s ease; }
button:active { transform:scale(.98); }
.study-welcome,.practice-actions,.exam-compact-list { position:relative; }.study-welcome::before,.practice-actions::before { content:""; position:absolute; top:-8px; left:0; width:42px; height:3px; border-radius:9px; background:var(--gold); }
.practice-actions button { min-height:68px; align-items:center; padding:13px 15px; }.practice-actions b,.practice-actions small { display:block; }.practice-actions b { color:var(--ink); font-size:15px; }.practice-actions button i { color:var(--brand); font-size:24px; font-style:normal; }
.vocab-tabs { grid-template-columns:repeat(3,1fr); background:var(--ivory); }.vocab-tabs button:nth-child(2),.vocab-control-panel:first-child #vocabShuffle { display:inline-flex; align-items:center; justify-content:center; }.vocab-tabs button.active { box-shadow:0 2px 0 rgba(15,76,92,.12),0 6px 16px rgba(15,76,92,.12); }
.study-flashcard { min-height:390px; background:linear-gradient(180deg,#fff 0%,#fbfcfb 100%); box-shadow:0 8px 24px rgba(15,76,92,.06); transition:transform .22s ease, opacity .22s ease, box-shadow .22s ease; }.study-flashcard:hover { box-shadow:0 10px 28px rgba(15,76,92,.1); }.study-flashcard.is-revealed .study-word-area { transform:translateY(-4px); }.study-word-area { transition:transform .2s ease; }.study-answer { transition:opacity .22s ease,transform .22s ease; }.study-flashcard.slide-next { animation:card-in-next .22s ease both; }.study-flashcard.slide-prev { animation:card-in-prev .22s ease both; }
.vocab-control-stack { grid-template-columns:auto auto 1fr!important; }.vocab-control-stack>div { display:flex!important; gap:8px; justify-content:flex-end; }.vocab-control-stack>div button { min-height:42px; border:1px solid var(--line); border-radius:10px; color:var(--brand); background:#fff; font-weight:750; }.vocab-control-panel:first-child #vocabSpeak { font-size:inherit; }.vocab-control-panel:first-child #vocabSpeak::first-letter { font-size:inherit; }.vocab-auto-panel { background:var(--ivory); border-color:#eadfca; }.vocab-speed button.active { color:#5b4410; background:#fff3ce; border-color:#e9ca78; }
@keyframes card-in-next { from { opacity:.3; transform:translateX(18px); } to { opacity:1; transform:translateX(0); } } @keyframes card-in-prev { from { opacity:.3; transform:translateX(-18px); } to { opacity:1; transform:translateX(0); } }
@media (max-width:760px) { .vocab-tabs { grid-template-columns:repeat(3,1fr); }.vocab-tabs button:nth-child(2) { display:inline-flex; }.study-flashcard { min-height:330px; padding:21px 18px; }.vocab-control-panel:first-child #vocabShuffle { display:inline-flex; font-size:13px; }.vocab-control-panel:first-child #vocabSpeak { font-size:13px; min-width:auto; }.vocab-control-stack { grid-template-columns:1fr 1fr!important; }.vocab-control-stack>div { grid-column:1/-1; justify-content:stretch; }.vocab-control-stack>div button { flex:1; }.vocab-study-sidebar { gap:8px; } }
@media (prefers-reduced-motion:reduce) { *,*::before,*::after { scroll-behavior:auto!important; animation-duration:.01ms!important; transition-duration:.01ms!important; } }

/* V3 — modern Japanese study companion */
:root {
  --teal-900:#123e49;
  --teal-700:#0f5b68;
  --teal-500:#2c8088;
  --paper:#f7f8f5;
  --surface:#fff;
  --gold:#e6b44a;
  --gold-soft:#fff2cf;
  --sage:#cfe3db;
  --sage-soft:#edf5f1;
  --ivory:#faf4e8;
  --terracotta:#c87555;
  --terracotta-soft:#f9ebe4;
  --ink:#172b31;
  --muted:#6c7d80;
  --subtle:#92a0a2;
  --line:#dee7e4;
  --brand:var(--teal-900);
  --brand-2:var(--teal-700);
}
html { background:var(--paper); }
body { min-height:100svh; color:var(--ink); background:var(--paper); }
#app { min-height:calc(100svh - 58px); }
.eyebrow { color:var(--teal-700); font-size:12px; letter-spacing:.105em; }
.topbar { border-bottom-color:rgba(18,62,73,.08); background:rgba(247,248,245,.91); backdrop-filter:saturate(1.25) blur(14px); }
.brand-mark { border-radius:10px 10px 10px 3px; background:var(--teal-900); box-shadow:0 4px 12px rgba(18,62,73,.12); }
.brand strong { line-height:1.12; }
.brand small { margin-top:2px; color:var(--subtle); font-size:10px; font-weight:560; line-height:1.1; letter-spacing:.025em; }
.primary-action { border-color:var(--teal-900); background:var(--teal-900); box-shadow:0 7px 18px rgba(18,62,73,.12); }
.secondary-action { border-color:var(--line); background:var(--surface); }
button:not(:disabled) { transition:transform .16s ease,background-color .16s ease,border-color .16s ease,box-shadow .16s ease,color .16s ease; }
@media (hover:hover) {
  button:not(:disabled):hover { transform:translateY(-1px); }
  .chapter-row:hover,.exam-compact-list button:hover { padding-right:8px; padding-left:8px; background:rgba(255,255,255,.72); }
  .home-quick-actions button:hover,.practice-actions button:hover { border-color:#c6d9d5; box-shadow:0 9px 26px rgba(18,62,73,.075); }
}
button:not(:disabled):active { transform:translateY(1px) scale(.98); }
button:focus-visible,.study-flashcard:focus-visible,select:focus-visible,input:focus-visible { outline:3px solid rgba(44,128,136,.25); outline-offset:3px; }

/* Home */
.study-home { padding-top:28px; }
.study-welcome { position:relative; max-width:none; display:grid; grid-template-columns:minmax(0,1.12fr) minmax(250px,.88fr); gap:24px 32px; padding:30px; overflow:hidden; border:1px solid #eadfca; border-radius:24px; background:var(--ivory); box-shadow:0 12px 34px rgba(23,43,49,.045); }
.study-welcome::before { top:0; left:0; width:4px; height:100%; border-radius:0; background:var(--gold); }
.study-welcome::after { content:""; position:absolute; right:26px; top:22px; width:44px; height:44px; border-top:1px solid rgba(200,117,85,.24); border-right:1px solid rgba(200,117,85,.24); pointer-events:none; }
.welcome-copy { align-self:center; }
.study-welcome h1 { max-width:460px; margin:8px 0 9px; color:var(--teal-900); font-size:clamp(28px,4vw,34px); font-weight:760; line-height:1.18; }
.study-welcome p { max-width:480px; color:#596e72; line-height:1.7; }
.home-progress-card { align-self:center; padding:20px; border:1px solid #d7e7e0; border-radius:18px; background:var(--sage-soft); }
.home-progress-card>div { display:flex; align-items:end; justify-content:space-between; gap:14px; }
.home-progress-card span,.home-progress-card small { display:block; }
.home-progress-card span>b { color:var(--teal-900); font-size:29px; line-height:1; letter-spacing:-.04em; }
.home-progress-card span>small { margin-top:5px; color:var(--teal-700); font-size:12px; font-weight:750; }
.home-progress-card em { color:var(--muted); font-size:12px; font-style:normal; }
.home-progress-card>i { display:block; height:7px; margin-top:18px; overflow:hidden; border-radius:99px; background:rgba(18,62,73,.09); }
.home-progress-card>i>b { display:block; height:100%; border-radius:inherit; background:linear-gradient(90deg,var(--teal-500),var(--gold)); }
.study-continue { grid-column:1/-1; width:100%; display:flex; align-items:center; justify-content:space-between; padding:0 17px; }
.study-continue i { font-style:normal; }
.home-today { margin-top:32px; }
.home-today .section-title { margin-bottom:12px; }
.home-today h2 { margin-top:4px; font-size:20px; font-weight:720; }
.home-quick-actions { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.home-quick-actions button { min-width:0; min-height:74px; display:grid; grid-template-columns:42px minmax(0,1fr) 16px; align-items:center; gap:12px; padding:12px 14px; border:1px solid var(--line); border-radius:16px; color:var(--ink); background:var(--surface); text-align:left; cursor:pointer; box-shadow:0 5px 18px rgba(23,43,49,.035); }
.home-quick-actions button>span { width:40px; height:40px; display:grid; place-items:center; border-radius:12px; color:var(--teal-900); background:var(--sage-soft); font-family:"Noto Sans JP","Hiragino Sans",sans-serif; font-weight:800; }
.home-quick-actions button:last-child>span { color:#775611; background:var(--gold-soft); }
.home-quick-actions b,.home-quick-actions small { display:block; }
.home-quick-actions b { font-size:15px; }
.home-quick-actions small { margin-top:3px; overflow:hidden; color:var(--muted); font-size:12px; text-overflow:ellipsis; white-space:nowrap; }
.home-quick-actions i { color:var(--teal-700); font-size:22px; font-style:normal; }
.chapter-section { margin-top:40px; }
.chapter-list { border-top-color:#cedbd7; }
.chapter-row { min-height:76px; transition:padding .18s ease,background-color .18s ease; }
.chapter-row { text-decoration:none; }
.chapter-row>b { width:30px; height:30px; display:grid; place-items:center; border:1px solid #d1e1dd; border-radius:9px; color:var(--teal-700); background:var(--sage-soft); }
.chapter-row.complete>b { color:#55746c; border-color:#cadfd7; background:var(--sage); }
.chapter-row>span i { height:2px; }
.chapter-row>span i em { background:var(--gold); }

/* Practice hub and exam detail */
.practice-home { padding-top:36px; }
.practice-home h1 { max-width:540px; margin-bottom:8px; color:var(--teal-900); font-size:clamp(28px,4vw,34px); line-height:1.22; }
.practice-home>p { margin-bottom:26px; }
.practice-actions { gap:12px; margin-bottom:44px; }
.practice-actions::before { display:none; }
.practice-actions button { position:relative; min-height:78px; display:flex; align-items:center; justify-content:space-between; gap:14px; padding:14px 18px 14px 21px; overflow:hidden; border-radius:17px; box-shadow:0 5px 18px rgba(23,43,49,.035); }
.practice-actions button::before { content:""; position:absolute; inset:0 auto 0 0; width:4px; background:var(--gold); }
.practice-actions button:nth-child(2)::before { background:#85b2a2; }
.practice-actions button:nth-child(3)::before { background:var(--teal-500); }
.practice-actions button:first-child { color:var(--ink); border:1px solid #eedb9f; background:linear-gradient(90deg,var(--gold-soft),#fffaf0); }
.practice-actions button:nth-child(2) { background:var(--sage-soft); }
.practice-actions button:nth-child(3) { background:var(--surface); }
.practice-actions b { font-size:16px; font-weight:760; }
.practice-actions small { margin-top:4px; color:var(--muted); font-size:12px; }
.practice-actions>button>small { min-width:34px; height:28px; display:grid; place-items:center; margin:0; border-radius:99px; color:var(--teal-900); background:rgba(255,255,255,.72); font-weight:800; }
.exam-compact-list::before { display:none; }
.exam-compact-list h2 { color:var(--teal-900); font-size:20px; }
.exam-compact-list button { min-height:68px; transition:padding .18s ease,background-color .18s ease; }
.exam-compact-list span { font-size:15px; }
.exam-detail { min-height:calc(100svh - 190px); }
.exam-detail>.text-button { margin-bottom:28px; }
.exam-detail-heading { position:relative; padding:25px 25px 22px; border:1px solid #eadfca; border-radius:20px 20px 8px 20px; background:var(--ivory); }
.exam-detail-heading::before { content:""; position:absolute; inset:0 auto 0 0; width:4px; border-radius:20px 0 0 20px; background:var(--gold); }
.exam-detail-heading h1 { color:var(--teal-900); }
.exam-detail-heading p { margin:0; color:var(--muted); line-height:1.6; }
.exam-facts { display:grid; grid-template-columns:repeat(3,1fr); gap:1px; margin-top:14px; overflow:hidden; border:1px solid var(--line); border-radius:15px; background:var(--line); }
.exam-facts span { min-height:65px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:3px; padding:10px; color:var(--muted); background:var(--surface); font-size:12px; text-align:center; }
.exam-facts b { color:var(--teal-900); font-size:17px; }
.exam-detail-actions .text-action { min-height:44px; color:var(--teal-700); }

/* Vocabulary navigation and filters */
.vocab-wrap { max-width:940px; }
.vocab-hub-heading h1 { color:var(--teal-900); font-size:32px; }
.vocab-progress-summary { border-color:#d3e3dd; background:var(--sage-soft); }
.vocab-tabs { gap:4px; padding:5px; border:1px solid #e5dcc9; border-radius:15px; background:var(--ivory); }
.vocab-tabs button { min-width:0; min-height:42px; padding:0 10px; border:0; border-radius:10px; font-size:13px; }
.vocab-tabs button.active { color:#fff; background:var(--teal-900); box-shadow:0 5px 14px rgba(18,62,73,.14); }
.vocab-home-filters { align-items:center; margin:12px 0 22px; }
.vocab-home-filters>span { margin-right:2px; color:var(--subtle); font-size:11px; font-weight:750; }
.vocab-home-filters button { min-height:34px; background:transparent; }
.vocab-home-filters button.active { color:var(--teal-900); border-color:#a9cbc1; background:var(--sage-soft); }
.vocab-study-toolbar { display:grid; grid-template-columns:minmax(0,auto) minmax(210px,1fr); align-items:end; gap:16px; padding:14px 16px; border:1px solid var(--line); border-radius:16px; background:rgba(255,255,255,.72); }
.vocab-filter-group>span,.vocab-category-select>span { display:block; margin-bottom:7px; color:var(--subtle); font-size:11px; font-weight:750; }
.vocab-scope { margin:0; }
.vocab-scope button { min-height:39px; border-radius:9px; }
.vocab-category-select { display:block; }
.vocab-category-select select { width:100%; min-height:39px; border-radius:9px; }

/* Flashcard */
.vocab-study-stage { gap:14px; }
.study-flashcard { min-height:390px; padding:22px 26px 28px; overflow:hidden; border-color:#dbe5e2; border-radius:25px; background:var(--surface); box-shadow:0 10px 30px rgba(23,43,49,.055); touch-action:pan-y; user-select:none; -webkit-user-select:none; will-change:transform,opacity; }
.study-flashcard::before { height:3px; background:var(--gold); }
.study-flashcard.is-revealed::before { background:var(--teal-500); }
.study-flashcard-top { position:relative; z-index:2; min-height:29px; }
.study-flashcard-top>small { font-variant-numeric:tabular-nums; }
.priority-dot { border:0; }
.priority-dot.a { color:#71520e; background:var(--gold-soft); }
.priority-dot.b { color:#496961; background:var(--sage-soft); }
.vocab-category-badge { max-width:min(52vw,360px); color:#4f696d; background:#f0f4f3; }
.flashcard-face { flex:1; min-height:290px; place-content:center; padding:25px 10px 10px; text-align:center; }
.flashcard-face h2 { margin:0; color:var(--teal-900); font-family:"Noto Sans JP","Hiragino Sans","Yu Gothic",sans-serif; font-size:clamp(52px,10vw,78px); font-weight:680; line-height:1.22; letter-spacing:.01em; overflow-wrap:anywhere; }
.flashcard-back { display:none; animation:answer-reveal .23s cubic-bezier(.2,.7,.25,1) both; }
.study-flashcard.is-revealed .flashcard-front { display:none; }
.study-flashcard.is-revealed .flashcard-back { display:grid; }
.flashcard-back h2 { font-size:clamp(36px,7vw,56px); }
.flashcard-back .study-reading { margin:13px 0 0; color:var(--teal-700); font-family:"Noto Sans JP","Hiragino Sans",sans-serif; font-size:clamp(18px,3vw,22px); font-weight:650; opacity:1; transform:none; }
.flashcard-back .study-meaning { margin:18px auto 0; padding-top:17px; border-top:1px solid var(--line); color:var(--ink); font-size:clamp(20px,3vw,24px); font-weight:720; line-height:1.42; }
.flashcard-back .study-romaji { margin:8px 0 0; color:var(--muted); font-size:14px; font-style:italic; }
.flashcard-back .study-han-viet { margin:5px 0 0; color:var(--subtle); font-size:12px; letter-spacing:.05em; }
.flashcard-back ul { display:grid; gap:5px; margin:16px auto 0; padding:12px 0 0; border-top:1px dashed var(--line); list-style:none; color:var(--muted); font-size:13px; line-height:1.45; }
.study-flashcard.is-dragging { cursor:grabbing; transition:none!important; box-shadow:0 16px 38px rgba(23,43,49,.09); }
.study-flashcard.is-snapping { transition:transform .23s cubic-bezier(.2,.8,.25,1.18),opacity .2s ease!important; }
.study-flashcard.is-leaving { pointer-events:none; transition:transform .23s cubic-bezier(.4,0,.7,.2),opacity .2s ease!important; }
.study-flashcard.slide-next { animation:card-in-next .24s cubic-bezier(.2,.75,.25,1) both; }
.study-flashcard.slide-prev { animation:card-in-prev .24s cubic-bezier(.2,.75,.25,1) both; }
@keyframes answer-reveal { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }
@keyframes card-in-next { from { opacity:.6; transform:translateX(34px) rotate(.35deg); } to { opacity:1; transform:translateX(0) rotate(0); } }
@keyframes card-in-prev { from { opacity:.6; transform:translateX(-34px) rotate(-.35deg); } to { opacity:1; transform:translateX(0) rotate(0); } }
.vocab-study-sidebar { gap:10px; }
.vocab-control-panel { border-radius:16px; background:rgba(255,255,255,.82); }
.vocab-control-panel>p { font-size:11px; }
.vocab-control-panel:first-child .vocab-control-stack { gap:8px; }
.vocab-control-stack button,.vocab-memory-actions button,.vocab-auto-panel>.primary-action { min-height:42px; border-radius:10px; }
.vocab-control-stack>div button { background:var(--ivory); }
.vocab-memory-actions .known { color:#2f6659; border-color:#bdd8ce; background:var(--sage-soft); }
.vocab-auto-panel { background:var(--ivory); }
.vocab-speed { padding:3px; border-radius:11px; background:rgba(230,180,74,.1); }
.vocab-hint { color:var(--subtle); }
.site-signature { margin-top:auto; }
.quiz-context-back { display:none; }

/* Bottom navigation */
@media (max-width:760px) {
  body { padding-bottom:calc(68px + env(safe-area-inset-bottom)); }
  #app { min-height:calc(100svh - 126px - env(safe-area-inset-bottom)); }
  .bottom-nav { min-height:66px; padding:5px 8px env(safe-area-inset-bottom); border-top-color:rgba(18,62,73,.1); background:rgba(255,255,255,.94); box-shadow:0 -8px 28px rgba(18,62,73,.055); backdrop-filter:saturate(1.3) blur(16px); }
  .bottom-nav button { position:relative; min-height:54px; border-radius:13px; font-size:12px; }
  .bottom-nav button::before { content:""; position:absolute; top:3px; left:50%; width:18px; height:3px; border-radius:99px; background:transparent; transform:translateX(-50%) scaleX(.5); transition:transform .18s ease,background-color .18s ease; }
  .bottom-nav button.active { color:var(--teal-900); background:var(--sage-soft); }
  .bottom-nav button.active::before { background:var(--teal-500); transform:translateX(-50%) scaleX(1); }
  .brand { gap:9px; }
  .brand>span:last-child { display:block!important; }
  .brand>span:last-child small { display:block!important; margin-top:1px; font-size:10px; }
  .brand strong { font-size:13px; }
  .site-signature { width:calc(100% - 36px); margin:0 auto 12px; padding:20px 0 28px; }
  .study-home,.chapter-page,.practice-home,.exam-detail,.quick-start { width:calc(100% - 32px); padding-top:22px; }
  .study-welcome { display:block; padding:24px 20px 20px; border-radius:21px; }
  .study-welcome::after { right:18px; top:17px; width:34px; height:34px; }
  .study-welcome h1 { padding-right:18px; font-size:28px; }
  .study-welcome p { font-size:15px; }
  .home-progress-card { margin-top:22px; padding:16px; }
  .home-progress-card span>b { font-size:27px; }
  .study-continue { min-height:48px; margin-top:12px; }
  .home-today { margin-top:28px; }
  .home-today h2 { font-size:19px; }
  .home-quick-actions { gap:9px; }
  .home-quick-actions button { grid-template-columns:36px minmax(0,1fr) 12px; gap:9px; min-height:70px; padding:10px; border-radius:14px; }
  .home-quick-actions button>span { width:35px; height:35px; border-radius:10px; }
  .home-quick-actions small { max-width:112px; }
  .chapter-section { margin-top:34px; }
  .chapter-row { min-height:74px; padding-top:12px; padding-bottom:12px; }
  .chapter-row>small { font-size:11px; }
  .practice-home { padding-top:28px; }
  .practice-home h1 { font-size:29px; }
  .practice-actions { margin-top:2px; margin-bottom:38px; }
  .practice-actions button { min-height:76px; padding:13px 15px 13px 19px; }
  .exam-detail { min-height:calc(100svh - 184px); }
  .exam-detail>.text-button { margin-bottom:20px; }
  .exam-detail-heading { padding:22px 19px 19px; }
  .exam-facts span { min-height:61px; padding:8px 5px; }
  .exam-detail-actions { margin-top:20px; }
  .quiz-context-back { min-height:44px; display:inline-flex; align-items:center; margin:-6px 0 8px; padding:0 3px; border:0; color:var(--teal-700); background:transparent; cursor:pointer; font-size:13px; font-weight:800; }
  .mobile-question-toggle { top:46%; width:40px; min-height:62px; border-radius:0 13px 13px 0; box-shadow:4px 7px 20px rgba(18,62,73,.2); }
  .mobile-question-toggle b { min-width:23px; height:20px; font-variant-numeric:tabular-nums; }
  .vocab-wrap { padding-right:16px; padding-left:16px; }
  .vocab-hub-heading { margin-bottom:15px; }
  .vocab-hub-heading h1 { font-size:29px; }
  .vocab-tabs { position:sticky; top:66px; z-index:8; margin-right:-2px; margin-left:-2px; }
  .vocab-tabs button { min-height:40px; padding:0 5px; font-size:12px; white-space:nowrap; }
  .vocab-home-filters { flex-wrap:nowrap; margin:10px -16px 17px; padding:0 16px 3px; overflow-x:auto; scrollbar-width:none; scroll-snap-type:x proximity; }
  .vocab-home-filters::-webkit-scrollbar { display:none; }
  .vocab-home-filters>* { flex:0 0 auto; scroll-snap-align:start; }
  .vocab-study-toolbar { grid-template-columns:1fr; gap:10px; padding:12px; }
  .vocab-filter-group { min-width:0; }
  .vocab-scope { overflow:visible; }
  .vocab-scope button { min-width:0; }
  .study-flashcard { min-height:360px; padding:19px 17px 22px; border-radius:23px; }
  .study-flashcard-top>div { min-width:0; }
  .vocab-category-badge { max-width:205px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .flashcard-face { min-height:270px; padding:20px 5px 5px; }
  .flashcard-face h2 { font-size:clamp(52px,15vw,72px); }
  .flashcard-back h2 { font-size:clamp(34px,10vw,48px); }
  .flashcard-back .study-reading { margin-top:10px; font-size:19px; }
  .flashcard-back .study-meaning { margin-top:14px; padding-top:14px; font-size:21px; }
  .flashcard-back ul { max-width:100%; margin-top:12px; }
  .vocab-study-sidebar { gap:8px; }
  .vocab-control-panel { padding:12px; }
  .vocab-control-stack { display:grid!important; grid-template-columns:1fr 1fr!important; gap:8px; }
  .vocab-control-stack>button { width:100%; }
  .vocab-control-stack>div { grid-column:1/-1; }
  .vocab-control-stack>div button { min-height:44px; }
  .vocab-memory-actions button { min-height:45px; }
}

@media (max-width:400px) {
  .home-quick-actions { grid-template-columns:1fr; }
  .home-quick-actions small { max-width:none; }
  .chapter-row { grid-template-columns:32px minmax(0,1fr) 14px; }
  .chapter-row>small { grid-column:2; margin:0; }
  .chapter-row>i { grid-column:3; grid-row:1/3; }
  .vocab-category-badge { max-width:170px; }
  .study-flashcard { min-height:350px; }
}

@media (min-width:1024px) {
  .study-home,.practice-home,.exam-detail { width:min(100% - 48px,820px); }
  .vocab-study-stage { grid-template-columns:minmax(0,1fr) 260px; }
  .vocab-study-sidebar { display:flex; flex-direction:column; }
  .vocab-control-panel:first-child { grid-column:auto; }
  .vocab-control-panel:first-child .vocab-control-stack { display:grid; grid-template-columns:1fr 1fr!important; gap:8px; }
  .vocab-control-panel:first-child .vocab-control-stack>div { display:contents!important; }
  .vocab-control-panel:first-child .vocab-control-stack button { width:100%; min-width:0; padding-right:8px; padding-left:8px; }
}

@media (prefers-reduced-motion:reduce) {
  .study-flashcard.is-dragging { transition:none!important; }
  .bottom-nav button::before { transition:none; }
}

/* Desktop responsive polish */
.exam-compact-list span>em,.exam-compact-list small>em { display:none; }
.exam-compact-list span>b { font:inherit; font-weight:700; }

@media (min-width:768px) and (max-width:1023px) {
  .study-home,.chapter-page,.practice-home,.exam-detail,.quick-start { width:calc(100% - 48px); max-width:920px; }
  .home-quick-actions { grid-template-columns:1fr 1fr; }
  .practice-actions { grid-template-columns:1fr 1fr; }
  .practice-actions button:last-child { grid-column:1/-1; }
  .exam-desktop-grid { display:grid; grid-template-columns:1fr 1fr; gap:0 24px; }
  .question-footer { position:static; margin-top:28px; padding:18px 0 0; border-top:1px solid var(--line); background:transparent; }
}

@media (min-width:1024px) {
  #app { min-height:100dvh; display:flex; flex-direction:column; }
  #app>main { flex:1 0 auto; }
  .topbar { min-height:68px; padding-right:max(32px,calc((100vw - 1240px)/2)); padding-left:max(32px,calc((100vw - 1240px)/2)); }
  .brand { gap:12px; }
  .brand-mark { width:38px; height:38px; font-size:17px; }
  .brand strong { font-size:15px; }
  .brand small { margin-top:3px; font-size:10px; }
  .topnav { gap:8px; }
  .topnav button { min-width:78px; padding:0 18px; font-size:14px; }
  .topnav button.active::after { right:18px; left:18px; height:2px; }
  .app-menu { margin-left:12px; }

  .study-home,.chapter-page,.practice-home,.exam-detail,.quick-start { width:calc(100% - 64px); max-width:1240px; padding:48px 0 68px; }
  .vocab-wrap,.result-wrap { width:calc(100% - 64px); max-width:1240px; padding:48px 0 68px; }
  .site-signature { width:calc(100% - 64px); max-width:1240px; flex-direction:row; align-items:baseline; justify-content:space-between; margin:0 auto; padding:24px 0 30px; }
  .site-signature strong { font-size:14px; }
  .site-signature span { font-size:12px; }

  .study-welcome { min-height:292px; grid-template-columns:minmax(0,1.7fr) minmax(300px,.8fr); grid-template-rows:1fr auto; gap:22px 48px; padding:38px 42px; }
  .welcome-copy { grid-column:1; grid-row:1; align-self:center; }
  .study-welcome h1 { max-width:680px; margin:10px 0 14px; font-size:clamp(40px,3.4vw,48px); line-height:1.1; }
  .study-welcome p { max-width:650px; font-size:17px; }
  .home-progress-card { grid-column:2; grid-row:1/3; align-self:stretch; display:flex; flex-direction:column; justify-content:center; padding:28px; }
  .home-progress-card span>b { font-size:42px; }
  .home-progress-card span>small { font-size:13px; }
  .home-progress-card>i { height:8px; margin-top:24px; }
  .study-continue { grid-column:1; grid-row:2; width:min(100%,390px); min-height:50px; }
  .home-today { margin-top:48px; }
  .home-today h2,.chapter-section .section-title h2 { font-size:28px; }
  .home-quick-actions { grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px; }
  .home-quick-actions button { min-height:92px; grid-template-columns:48px minmax(0,1fr) 18px; padding:17px 20px; border-radius:18px; }
  .home-quick-actions button>span { width:46px; height:46px; border-radius:13px; font-size:18px; }
  .home-quick-actions b { font-size:17px; }
  .home-quick-actions small { margin-top:5px; font-size:13px; }
  .chapter-section { margin-top:48px; }
  .chapter-list { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px 18px; border:0; }
  .chapter-row { min-height:112px; grid-template-columns:42px minmax(0,1fr) auto 16px; gap:14px; padding:18px; border:1px solid var(--line); border-radius:18px; background:rgba(255,255,255,.82); box-shadow:0 8px 24px rgba(23,43,49,.035); }
  .chapter-row>b { width:36px; height:36px; border-radius:10px; }
  .chapter-row strong { font-size:18px; }
  .chapter-row small { font-size:13px; }
  .chapter-row>span i { height:3px; margin-top:11px; }

  .practice-home { padding-top:54px; }
  .practice-home h1 { max-width:760px; margin:10px 0 10px; font-size:42px; }
  .practice-home>p { margin-bottom:32px; font-size:16px; }
  .practice-actions { grid-template-columns:repeat(3,minmax(0,1fr)); gap:18px; margin-bottom:54px; }
  .practice-actions button { min-height:142px; align-items:flex-start; padding:24px 24px 22px 28px; border-radius:19px; }
  .practice-actions button>span:first-child { align-self:stretch; display:flex; flex-direction:column; }
  .practice-actions .secondary-action span small { margin-left:0; }
  .practice-actions b { font-size:19px; line-height:1.25; }
  .practice-actions small { margin-top:9px; font-size:13px; line-height:1.45; }
  .practice-actions button>i { align-self:center; }
  .exam-compact-list { border:0; }
  .exam-compact-list h2 { padding-bottom:18px; font-size:28px; }
  .exam-desktop-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px 18px; }
  .exam-compact-list button { min-height:108px; grid-template-columns:minmax(0,1fr) auto 18px; gap:14px; padding:18px 20px; border:1px solid var(--line); border-radius:17px; background:rgba(255,255,255,.84); box-shadow:0 7px 20px rgba(23,43,49,.032); }
  .exam-compact-list span>b,.exam-compact-list span>em,.exam-compact-list small>em { display:block; }
  .exam-compact-list span>b { color:var(--teal-900); font-size:17px; font-weight:760; }
  .exam-compact-list span>em { margin-top:6px; overflow:hidden; color:var(--muted); font-size:12px; font-style:normal; text-overflow:ellipsis; white-space:nowrap; }
  .exam-compact-list button>small { color:var(--teal-700); font-size:12px; font-weight:750; text-align:right; }
  .exam-compact-list small>em { margin-top:7px; color:var(--subtle); font-size:11px; font-style:normal; font-weight:550; }

  .exam-detail { min-height:calc(100dvh - 166px); display:grid; grid-template-columns:minmax(0,1.65fr) minmax(320px,.75fr); grid-template-rows:auto auto auto; align-content:start; gap:18px 32px; }
  .exam-detail>.text-button { grid-column:1/-1; margin:0 0 8px; justify-self:start; }
  .exam-detail-heading { grid-column:1; grid-row:2; min-height:232px; display:flex; flex-direction:column; justify-content:center; padding:36px 40px; }
  .exam-detail-heading h1 { margin:11px 0 10px; font-size:40px; }
  .exam-detail-heading p { font-size:17px; }
  .exam-facts { grid-column:1; grid-row:3; align-self:start; margin-top:0; }
  .exam-facts span { min-height:78px; }
  .exam-detail-actions { grid-column:2; grid-row:2/4; align-self:stretch; display:flex; flex-direction:column; justify-content:center; gap:12px; margin:0; padding:28px; border:1px solid var(--line); border-radius:19px; background:var(--surface); box-shadow:0 10px 28px rgba(23,43,49,.045); }
  .exam-detail-actions button { width:100%; min-height:50px; }

  .vocab-hub-heading { margin-bottom:26px; }
  .vocab-hub-heading h1 { font-size:42px; }
  .vocab-progress-summary { min-width:170px; padding:17px 20px; }
  .vocab-tabs { margin-bottom:16px; }
  .vocab-tabs button { min-height:46px; font-size:14px; }
  .vocab-home-filters { margin-bottom:18px; }
  .vocab-study-toolbar { grid-template-columns:auto minmax(340px,1fr); gap:24px; padding:14px 18px; }
  .vocab-study-stage { grid-template-columns:minmax(0,2.15fr) minmax(290px,.85fr); gap:18px; align-items:start; }
  .study-flashcard { min-height:500px; padding:28px 34px 34px; }
  .flashcard-face { min-height:390px; }
  .vocab-study-sidebar { gap:12px; }
  .vocab-control-panel { padding:18px; }
  .vocab-control-panel:first-child .vocab-control-stack { grid-template-columns:1fr 1fr!important; }
  .vocab-control-stack button,.vocab-memory-actions button,.vocab-auto-panel>.primary-action { min-height:46px; }
  .dictionary-list { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:0 28px; }
  .dictionary-row { min-height:106px; }

  .quiz-layout { width:calc(100% - 64px); max-width:1240px; grid-template-columns:260px minmax(0,1fr); gap:30px; padding:36px 0 58px; }
  .quiz-side { top:92px; }
  .question-panel { width:100%; max-width:900px; justify-self:start; padding:34px 38px; border-radius:20px; }
  .question-toolbar { margin-bottom:22px; }
  .jp-content h1 { font-size:24px; line-height:1.82; }
  .option { padding:15px 16px; }
  .question-footer { position:static; margin-top:30px; padding:20px 0 0; border-top:1px solid var(--line); background:transparent; }
  .question-footer>button { min-width:180px; }
  .mobile-question-toggle,.question-drawer,.question-drawer-backdrop { display:none!important; }

  .chapter-page h1 { font-size:42px; }
  .chapter-page>p { font-size:17px; }
  .chapter-page>.compact-progress { max-width:680px; margin:24px 0 30px; }
  .unit-list { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px 18px; border:0; }
  .unit-list button { min-height:78px; padding:16px 18px; border:1px solid var(--line); border-radius:16px; background:var(--surface); box-shadow:0 6px 18px rgba(23,43,49,.03); }
  .study-layout { width:calc(100% - 64px); max-width:1240px; grid-template-columns:250px minmax(0,850px); justify-content:center; gap:32px; padding:42px 0 70px; }
  .chapter-rail { top:94px; }
  .study-lesson { width:100%; padding:34px 38px; border-radius:20px; }
  .lesson-heading h1 { font-size:34px; }
  .study-jp,.study-vi { font-size:16px; }
  .lesson-footer { position:static; margin:26px 0 0; padding:20px 0 0; background:transparent; }
}

@media (min-width:1440px) {
  .topbar { padding-right:max(40px,calc((100vw - 1280px)/2)); padding-left:max(40px,calc((100vw - 1280px)/2)); }
  .study-home,.chapter-page,.practice-home,.exam-detail,.quick-start,.vocab-wrap,.result-wrap,.site-signature,.quiz-layout,.study-layout { max-width:1280px; }
  .study-welcome { grid-template-columns:minmax(0,1.8fr) minmax(330px,.72fr); }
  .chapter-list,.exam-desktop-grid { column-gap:22px; }
  .quiz-layout { grid-template-columns:270px minmax(0,1fr); gap:36px; }
}

@media (hover:hover) and (min-width:1024px) {
  .chapter-row:hover,.exam-compact-list button:hover,.unit-list button:hover { padding-right:18px; padding-left:18px; border-color:#bad1cb; background:#fff; box-shadow:0 12px 28px rgba(23,43,49,.065); transform:translateY(-2px); }
  .practice-actions button:hover,.home-quick-actions button:hover { transform:translateY(-2px); box-shadow:0 12px 28px rgba(23,43,49,.075); }
  .dictionary-row:hover { background:rgba(237,245,241,.7); }
}

/* Final visual polish — shared mobile and desktop system */
:root {
  --teal-900:#103f49;
  --teal-700:#176773;
  --teal-500:#2c8088;
  --gold:#e1ad3f;
  --gold-soft:#f8e7b6;
  --sage:#bed8ce;
  --sage-soft:#e6f0eb;
  --ivory:#f7efe1;
  --paper:#f4f6f3;
  --surface:#fff;
  --ink:#142a30;
  --muted:#5f7276;
  --subtle:#87979a;
  --line:#d5e0dd;
  --success-soft:#e6f3eb;
  --danger-soft:#fcebe8;
  --brand:var(--teal-900);
  --brand-2:var(--teal-700);
}

body { color:var(--ink); background:var(--paper); }
.topbar {
  border-bottom:1px solid rgba(16,63,73,.13);
  background:rgba(255,255,255,.94);
  box-shadow:0 3px 14px rgba(20,42,48,.035);
}
.brand-mark { background:var(--teal-900); box-shadow:0 5px 15px rgba(16,63,73,.16); }
.brand strong { color:var(--ink); font-weight:740; letter-spacing:.005em; }
.brand small { color:var(--muted); font-weight:580; }
.topnav button { color:#53696d; font-weight:680; }
.topnav button.active { color:var(--teal-900); }
.topnav button.active::after { background:var(--teal-500); }
.app-menu summary { color:var(--teal-900); }
.primary-action { background:var(--teal-900); box-shadow:0 7px 18px rgba(16,63,73,.13); }
.primary-action:hover { background:var(--teal-700); }
.secondary-action { border-color:var(--line); }
button:disabled { opacity:.54; color:#758589; }

/* Shared page depth */
.study-welcome {
  border-color:#e4d3b5;
  background:var(--ivory);
  box-shadow:0 13px 34px rgba(20,42,48,.065);
}
.study-welcome::before { width:5px; background:var(--gold); }
.study-welcome p,.practice-home>p { color:var(--muted); }
.home-progress-card { border-color:#c7ddd5; background:var(--sage-soft); box-shadow:inset 0 1px 0 rgba(255,255,255,.7); }
.home-progress-card>i { background:rgba(16,63,73,.12); }
.home-progress-card>i>b { background:linear-gradient(90deg,var(--teal-500),var(--gold)); }
.home-quick-actions button {
  border-color:#cedbd8;
  box-shadow:0 7px 20px rgba(20,42,48,.055);
}
.home-quick-actions button>span { background:var(--sage-soft); box-shadow:inset 0 0 0 1px rgba(16,63,73,.045); }
.home-quick-actions button:last-child>span { background:var(--gold-soft); }
.home-quick-actions b { color:var(--ink); font-weight:750; }
.home-quick-actions small { color:#66777a; }
.chapter-list { border-top-color:#c7d5d2; }
.chapter-row { border-bottom-color:#d2ddda; }
.chapter-row>b { border-color:#c1d7d0; color:var(--teal-700); background:var(--sage-soft); font-weight:800; }
.chapter-row strong { color:var(--ink); font-weight:720; }
.chapter-row small,.chapter-row>small { color:#65777a; }
.chapter-row>span i { background:#dfe7e4; }
.chapter-row>span i em { background:var(--gold); }

/* Practice hub and exam detail */
.practice-actions button { border-color:#d4dfdc; box-shadow:0 7px 20px rgba(20,42,48,.055); }
.practice-actions button:first-child { border-color:#dfc77f; background:linear-gradient(100deg,var(--gold-soft),#fffaf0); }
.practice-actions button:nth-child(2) { border-color:#c5dcd3; background:var(--sage-soft); }
.practice-actions button:nth-child(3) { border-color:#c4d8d9; background:#edf5f4; }
.practice-actions button::before { width:5px; }
.practice-actions button:nth-child(2)::before { background:#6f9f90; }
.practice-actions button:nth-child(3)::before { background:var(--teal-700); }
.practice-actions b { color:var(--ink); font-weight:760; }
.practice-actions small { color:#617477; }
.exam-compact-list button { border-bottom-color:#d2ddda; }
.exam-detail-heading { border-color:#e3d1b0; background:var(--ivory); box-shadow:0 8px 24px rgba(20,42,48,.04); }
.exam-facts { border-color:#cfdcda; background:#cfdcda; }
.exam-facts span { color:#607276; }
.exam-detail-actions { border-color:#cfdcda; }

/* Vocabulary navigation, card and controls */
.vocab-tabs { border-color:#dfd1b8; background:var(--ivory); box-shadow:inset 0 1px 2px rgba(20,42,48,.035); }
.vocab-tabs button { color:#52676b; font-weight:700; }
.vocab-tabs button.active { background:var(--teal-900); box-shadow:0 5px 15px rgba(16,63,73,.18); }
.vocab-home-filters button { color:#596d71; border-color:#cfdad8; }
.vocab-home-filters button.active { color:var(--teal-900); border-color:#97bdb1; background:var(--sage-soft); }
.vocab-study-toolbar { border-color:#cfdbd8; background:rgba(255,255,255,.86); box-shadow:0 5px 16px rgba(20,42,48,.025); }
.vocab-scope { background:#dfe9e5; }
.vocab-scope button { color:#5a6e72; }
.vocab-scope button.active { color:var(--teal-900); box-shadow:0 3px 10px rgba(16,63,73,.1); }
.vocab-study-toolbar select { border-color:#cbd8d5; }
.study-flashcard {
  border-color:#cfdcd9;
  background:linear-gradient(165deg,#fff 0%,#fff 67%,#fbf8f1 100%);
  box-shadow:0 12px 32px rgba(20,42,48,.075);
}
.study-flashcard::before { background:var(--gold); }
.vocab-category-badge { color:#496166; background:#edf2f0; }
.flashcard-back .study-meaning { border-top-color:#d5e0dd; }
.vocab-control-panel { border-color:#cfdbd8; background:rgba(255,255,255,.92); box-shadow:0 5px 16px rgba(20,42,48,.03); }
.vocab-control-panel>p { color:#6b7b7e; }
.vocab-control-stack>div button { border-color:#d5ddd7; background:var(--ivory); }
.vocab-memory-actions button { border:1px solid #ead8c7; }
.vocab-memory-actions .known { border-color:#aaccc0; background:var(--sage-soft); }
.vocab-auto-panel { border-color:#e1d2b8; background:var(--ivory); }
.vocab-speed button { border-color:#d8d4c8; }
.vocab-speed button.active { border-color:#d4b45d; background:var(--gold-soft); }

/* Quiz surfaces and feedback */
.question-panel {
  border-color:#ccd9d6;
  background:var(--surface);
  box-shadow:0 12px 34px rgba(20,42,48,.065);
}
.topic-chip { color:#566b6f; background:#eaf0ee; }
.timer { color:var(--teal-900); background:var(--sage-soft); }
.tap-hint { color:#65777a; }
.tap-hint span { color:var(--teal-900); background:var(--sage-soft); }
.translation-toggle button,.all-option-translations-toggle { color:var(--teal-700); }
.all-option-translations-toggle { border-color:#bcd3ce; background:#f1f7f5; }
.translation-toggle p,.option-translation { color:#405a60; background:#eaf2ef; border-left-color:var(--teal-700); }
.option { border-color:#cfdad8; box-shadow:0 2px 8px rgba(20,42,48,.018); }
.option>span { color:var(--teal-900); background:#e8efed; }
.option:hover,.option.selected { border-color:var(--teal-700); box-shadow:0 0 0 3px rgba(23,103,115,.1); }
.option.correct { border-color:#68a889; background:var(--success-soft); }
.option.wrong { border-color:#d98d82; background:var(--danger-soft); }
.explanation-card { border-color:#bdd5cf; background:#edf6f2; }
.explanation-card.wrong { border-color:#e6c4be; background:#fff7f5; }
.number-grid button,.drawer-number-grid button { border-color:#cdd9d6; }
.number-grid button.answered,.drawer-number-grid button.answered { border-color:#b8d2cc; background:#e5f0ed; }
.quiz-context-back { color:var(--teal-700); }
.question-footer { border-top-color:#ccd9d6; }

/* Footer is a deliberate closing surface, not floating text */
.site-signature {
  width:100%; max-width:none; margin:0; padding:28px max(20px,calc((100vw - 1240px)/2));
  border-top:1px solid #cedbd8; color:var(--muted); background:var(--ivory);
}
.site-signature strong { color:var(--teal-900); font-size:18px; font-weight:720; }
.site-signature span { font-size:14px; }
.site-signature strong { font-family:inherit; font-style:normal; letter-spacing:0; }
.practice-actions button:disabled { opacity:.7; }

@media (max-width:760px) {
  body { padding-bottom:calc(70px + env(safe-area-inset-bottom)); }
  .topbar { min-height:69px; padding:0 16px; gap:10px; background:rgba(255,255,255,.96); }
  .brand { gap:10px; }
  .brand-mark { width:38px; height:38px; border-radius:11px 11px 11px 4px; font-size:17px; }
  .brand strong { font-size:17px; line-height:1.08; }
  .brand>span:last-child small { margin-top:3px; font-size:11px; }
  .app-menu summary { width:42px; height:42px; font-size:23px; }
  .bottom-nav { min-height:68px; padding:5px 8px env(safe-area-inset-bottom); border-top-color:#cbd8d5; box-shadow:0 -8px 26px rgba(20,42,48,.07); }
  .bottom-nav button { min-height:56px; color:#596d71; font-size:15px; font-weight:680; }
  .bottom-nav button::before { top:2px; width:22px; height:3px; }
  .bottom-nav button.active { color:var(--teal-900); background:var(--sage-soft); }

  .study-home,.chapter-page,.practice-home,.exam-detail,.quick-start { width:calc(100% - 32px); }
  .study-welcome { padding:22px 20px 20px; border-radius:24px; }
  .study-welcome h1 { font-size:29px; }
  .study-welcome p { color:#52696d; font-size:15px; line-height:1.65; }
  .home-progress-card { margin-top:19px; padding:15px; }
  .study-continue { min-height:48px; }
  .home-quick-actions button { min-height:78px; border-color:#cbd9d6; }
  .home-quick-actions small { color:#607377; }
  .chapter-row { min-height:72px; }

  .practice-home h1 { margin-bottom:9px; }
  .practice-home>p { margin-bottom:23px; }
  .practice-actions { gap:11px; }
  .practice-actions button { min-height:98px; padding:17px 16px 17px 21px; }
  .practice-actions b { font-size:16px; }
  .practice-actions small { font-size:13px; }
  .exam-detail-heading { border-radius:20px; }
  .exam-detail-actions .secondary-action { border-color:#bdcdca; }

  .vocab-tabs { border-radius:14px; }
  .vocab-tabs button { min-height:43px; font-size:15px; }
  .vocab-home-filters button { min-height:36px; }
  .study-flashcard { min-height:370px; border-radius:24px; box-shadow:0 10px 26px rgba(20,42,48,.07); }
  .flashcard-face { min-height:275px; }
  .vocab-control-panel { border-radius:14px; }
  .vocab-control-stack button,.vocab-memory-actions button,.vocab-auto-panel>.primary-action { min-height:46px; border-radius:12px; }

  .quiz-layout { padding-top:16px; }
  .question-panel { padding:18px 14px; border-radius:18px; box-shadow:0 8px 24px rgba(20,42,48,.055); animation:none; }
  .quiz-context-back { margin:-3px 0 8px; color:var(--teal-700); font-size:14px; }
  .option { min-height:68px; border-color:#c8d5d2; }
  .mobile-question-toggle { width:41px; min-height:62px; color:#fff; background:var(--teal-900); box-shadow:4px 8px 22px rgba(16,63,73,.24); }
  .mobile-question-toggle b { color:var(--teal-900); background:#fff; font-size:12px; font-weight:850; }
  .question-drawer { background:var(--paper); }
  .question-footer { grid-template-columns:minmax(0,1fr) auto minmax(0,1fr); gap:8px; padding:10px 14px calc(10px + env(safe-area-inset-bottom)); background:rgba(244,246,243,.97); box-shadow:0 -8px 22px rgba(20,42,48,.045); }
  .question-footer>span { display:block; min-width:36px; font-size:12px; font-variant-numeric:tabular-nums; }
  .question-footer>button { width:100%; min-width:0; min-height:48px; padding:0 8px; font-size:13px; white-space:nowrap; }

  .site-signature { width:100%; margin:0; padding:24px 18px calc(25px + env(safe-area-inset-bottom)); gap:5px; background:var(--ivory); }
  .site-signature strong { font-size:17px; }
  .site-signature span { font-size:14px; line-height:1.55; }
}

@media (max-width:400px) {
  .home-quick-actions { grid-template-columns:1fr; }
  .practice-actions button { min-height:96px; }
  .vocab-tabs button { padding-right:3px; padding-left:3px; font-size:14px; }
}

@media (min-width:768px) and (max-width:1023px) {
  .topbar { min-height:72px; }
  .brand strong { font-size:17px; }
  .brand small { font-size:11px; }
  .topnav button { font-size:15px; }
  .site-signature { padding-right:24px; padding-left:24px; }
}

@media (min-width:1024px) {
  .topbar { min-height:76px; }
  .brand-mark { width:43px; height:43px; border-radius:12px 12px 12px 4px; font-size:20px; }
  .brand strong { font-size:19px; }
  .brand small { font-size:12px; }
  .topnav { gap:14px; }
  .topnav button { min-width:88px; padding:0 20px; font-size:16px; }
  .topnav button.active::after { right:20px; left:20px; height:3px; }
  .app-menu { margin-left:16px; }

  .study-welcome { box-shadow:0 14px 38px rgba(20,42,48,.07); }
  .home-quick-actions button,.chapter-row,.practice-actions button,.exam-compact-list button { border-color:#ccd9d6; }
  .chapter-row,.exam-compact-list button { box-shadow:0 8px 24px rgba(20,42,48,.045); }
  .practice-actions button { box-shadow:0 9px 26px rgba(20,42,48,.055); }
  .exam-detail-heading { box-shadow:0 10px 30px rgba(20,42,48,.055); }
  .exam-detail-actions { box-shadow:0 11px 30px rgba(20,42,48,.06); }

  .vocab-tabs button { min-height:47px; font-size:16px; }
  .study-flashcard { min-height:480px; }
  .flashcard-face { min-height:370px; }
  .vocab-control-panel { box-shadow:0 7px 20px rgba(20,42,48,.04); }

  .quiz-side { top:100px; }
  .question-panel { max-width:900px; box-shadow:0 14px 38px rgba(20,42,48,.07); }
  .option { max-width:820px; }
  .question-footer { max-width:820px; }

  .site-signature { padding-top:31px; padding-bottom:33px; }
  .site-signature strong { font-size:19px; }
  .site-signature span { font-size:15px; }
}

@media (hover:hover) {
  .topnav button:not(.active):hover { color:var(--teal-700); background:rgba(230,240,235,.62); }
  .vocab-tabs button:not(.active):hover { color:var(--teal-900); background:rgba(255,255,255,.62); }
  .option:hover { transform:translateY(-1px); box-shadow:0 6px 16px rgba(20,42,48,.06); }
}

/* Interaction and editorial polish */
.brand strong {
  font-family:"Avenir Next","SF Pro Display",Inter,ui-sans-serif,system-ui,sans-serif;
  font-weight:760;
  letter-spacing:-.025em;
}
.brand small { letter-spacing:.045em; }
.site-signature strong {
  position:relative;
  padding-left:17px;
  font-family:"Avenir Next","SF Pro Display",Inter,ui-sans-serif,system-ui,sans-serif;
  font-weight:760;
  letter-spacing:-.018em;
}
.site-signature strong::before {
  content:"";
  position:absolute;
  top:.3em;
  bottom:.28em;
  left:0;
  width:3px;
  border-radius:99px;
  background:var(--gold);
}
.site-signature span { color:#687a7d; line-height:1.55; }

button,[role="button"],summary,.study-flashcard {
  touch-action:manipulation;
  -webkit-tap-highlight-color:rgba(16,63,73,.085);
}
.study-flashcard { touch-action:pan-y; }
button:not(:disabled) {
  transition:transform .11s ease-out,background-color .16s ease,border-color .16s ease,box-shadow .16s ease,color .16s ease;
}
button:not(:disabled):active { transform:translateY(1px) scale(.982); transition-duration:.045s; }
.chapter-row,.unit-list button,.exam-row,.dictionary-row { touch-action:manipulation; }

.context-back {
  min-height:44px;
  display:inline-flex;
  align-items:center;
  gap:6px;
  margin:0 0 16px;
  padding:0 10px;
  border:1px solid transparent;
  border-radius:12px;
  color:var(--teal-700);
  font-size:14px;
  font-weight:760;
}
.context-back:hover { border-color:#c9d9d5; background:var(--sage-soft); }
.study-context-back { margin:-8px 0 14px -10px; }

.eyebrow {
  color:var(--teal-700);
  font-size:12px;
  font-weight:820;
  letter-spacing:.13em;
}
.section-title h2,.chapter-section .section-title h2,.exam-compact-list h2 {
  color:var(--ink);
  font-weight:750;
  letter-spacing:-.035em;
}
.chapter-row strong,.unit-list strong,.exam-row-copy b {
  font-family:"Noto Sans JP","Hiragino Sans","Yu Gothic",ui-sans-serif,system-ui,sans-serif;
}

/* Scannable original-exam cards */
.exam-compact-list { border:0; }
.exam-compact-list>.eyebrow { display:block; margin-bottom:4px; }
.exam-compact-list h2 { padding-bottom:15px; }
.exam-desktop-grid { display:grid; gap:10px; }
.exam-compact-list .exam-row {
  min-height:84px;
  grid-template-columns:minmax(0,1fr) auto 18px;
  gap:12px;
  padding:15px 16px;
  border:1px solid #ccd9d6;
  border-radius:16px;
  background:rgba(255,255,255,.9);
  box-shadow:0 6px 18px rgba(20,42,48,.04);
}
.exam-row-copy { min-width:0; }
.exam-row-copy b { display:block; color:var(--teal-900); font-size:16px; font-weight:760; }
.exam-row-copy em {
  display:block;
  margin-top:5px;
  overflow:hidden;
  color:#65777a;
  font-size:12px;
  font-style:normal;
  line-height:1.45;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.exam-compact-list .exam-row-copy>em { display:block; }
.exam-row-status { min-width:92px; text-align:right; }
.exam-row-status strong {
  display:inline-flex;
  min-height:25px;
  align-items:center;
  padding:0 9px;
  border-radius:999px;
  color:#5e7074;
  background:#edf1ef;
  font-size:11px;
  font-weight:760;
  white-space:nowrap;
}
.exam-row-status strong.is-done { color:#315f54; background:var(--sage-soft); }
.exam-row-status em { display:block; margin-top:6px; color:var(--muted); font-size:11px; font-style:normal; white-space:nowrap; }
.exam-compact-list .exam-row-status>em { display:block; }
.exam-row>i { align-self:center; color:var(--teal-700); font-size:24px; }

/* Lesson hierarchy */
.lesson-heading { padding-bottom:20px; border-bottom:1px solid var(--line); }
.lesson-heading h1 {
  color:var(--teal-900);
  font-family:"Noto Sans JP","Hiragino Sans","Yu Gothic",ui-sans-serif,system-ui,sans-serif;
  font-weight:720;
  letter-spacing:-.025em;
}
.lesson-heading p { color:#5c7074; }
.curriculum-tier,.lesson-formula,.lesson-trap,.lesson-support-grid article { border-color:#cfdcd9; }
.curriculum-tier summary strong,.lesson-formula strong,.lesson-trap strong { font-weight:780; }
.point-number {
  border:1px solid #c5d8d2;
  border-radius:9px;
  color:var(--teal-700);
  background:var(--sage-soft);
}
.lesson-footer .secondary-action { border-color:#bdcfca; }
.lesson-footer .secondary-action:active { background:var(--sage-soft); }

/* Flashcard gesture feedback */
.study-flashcard.is-dragging {
  animation:none!important;
  cursor:grabbing;
  transition:none!important;
  box-shadow:0 17px 40px rgba(20,42,48,.105);
}
.study-flashcard.is-snapping {
  transition:transform .24s cubic-bezier(.22,.88,.28,1),opacity .18s ease!important;
}
.study-flashcard.is-leaving {
  transition:transform .24s cubic-bezier(.36,.02,.65,.28),opacity .19s ease!important;
}

@media (max-width:760px) {
  .brand strong { font-size:18px; }
  .brand small { font-size:11px; letter-spacing:.035em; }
  .site-signature strong { font-size:18px; }

  .context-back { margin-bottom:13px; padding:0 8px; font-size:14px; }
  .study-context-back { margin:-7px 0 10px -7px; }
  .lesson-heading { padding-bottom:17px; }
  .lesson-heading h1 { font-size:25px; line-height:1.38; }
  .lesson-heading p { margin-top:7px; font-size:15px; }
  .lesson-footer button { min-height:48px; }

  .exam-compact-list h2 { padding-bottom:13px; font-size:23px; }
  .exam-desktop-grid { gap:10px; }
  .exam-compact-list .exam-row { min-height:88px; padding:14px 13px 14px 15px; }
  .exam-row-copy b { font-size:16px; }
  .exam-row-copy em { max-width:190px; font-size:12px; }
  .exam-row-status { min-width:86px; }
  .exam-row-status strong { padding:0 8px; }
  .exam-row>i { font-size:22px; }
}

@media (max-width:400px) {
  .exam-compact-list .exam-row { grid-template-columns:minmax(0,1fr) 18px; }
  .exam-row-status { grid-column:1; grid-row:2; min-width:0; display:flex!important; align-items:center; gap:7px; text-align:left; }
  .exam-row-status em { margin:0; }
  .exam-row>i { grid-column:2; grid-row:1/3; }
  .exam-row-copy em { max-width:280px; }
}

@media (min-width:1024px) {
  .brand strong { font-size:20px; }
  .brand small { font-size:12px; }
  .site-signature strong { font-size:20px; }
  .exam-desktop-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:13px 18px; }
  .exam-compact-list .exam-row { min-height:98px; padding:17px 19px; }
  .exam-row-copy b { font-size:18px; }
  .exam-row-copy em { margin-top:7px; font-size:12px; }
  .exam-row-status { min-width:142px; }
  .exam-row-status strong { font-size:12px; }
}

@media (hover:hover) {
  .exam-compact-list .exam-row:hover {
    padding-right:19px;
    padding-left:19px;
    border-color:#aac7c0;
    background:#fff;
    box-shadow:0 11px 27px rgba(20,42,48,.075);
    transform:translateY(-2px);
  }
}

/* Premium Japanese Study SaaS — preview polish */
:root {
  --paper:#f4f6f2;
  --surface:#fffdfa;
  --surface-cool:#f8faf8;
  --ink:#172d33;
  --muted:#65777a;
  --subtle:#8b999a;
  --line:#dbe4e1;
  --teal-900:#123e49;
  --teal-700:#0f5f6b;
  --teal-500:#38858c;
  --champagne:#d7b66f;
  --champagne-soft:#f7edd8;
  --sage:#d9e8e1;
  --sage-soft:#edf4f0;
  --ivory:#faf5ea;
  --danger:#a9574c;
  --danger-soft:#f9eeeb;
  --success:#36745f;
  --success-soft:#eaf4ee;
  --radius-sm:12px;
  --radius-md:18px;
  --radius-lg:26px;
  --shadow-sm:0 5px 18px rgba(18,62,73,.045);
  --shadow-md:0 14px 42px rgba(18,62,73,.075);
}

html { background:var(--paper); }
body {
  color:var(--ink);
  background:
    radial-gradient(circle at 88% 0,rgba(215,182,111,.08),transparent 25rem),
    var(--paper);
  font-feature-settings:"kern" 1,"palt" 1;
  text-rendering:optimizeLegibility;
}
body::before {
  content:"";
  position:fixed;
  inset:0 0 auto;
  z-index:-1;
  height:220px;
  pointer-events:none;
  background:linear-gradient(180deg,rgba(255,253,250,.85),transparent);
}

.topbar {
  min-height:70px;
  padding-inline:max(18px,calc((100vw - 1280px)/2));
  border-bottom:1px solid rgba(18,62,73,.09);
  background:rgba(250,252,249,.91);
  box-shadow:none;
  backdrop-filter:saturate(1.15) blur(18px);
}
.brand-mark {
  width:38px;
  height:38px;
  border-radius:11px 11px 11px 4px;
  background:var(--teal-900);
  box-shadow:0 5px 14px rgba(18,62,73,.15);
  font-family:"Noto Sans JP","Hiragino Sans",sans-serif;
}
.brand strong { font-size:17px; font-weight:760; letter-spacing:-.025em; }
.brand small { margin-top:1px; color:#758487; font-size:10.5px; letter-spacing:.06em; }
.topnav { gap:4px; }
.topnav button { align-self:center; min-height:42px; border-radius:12px; font-size:14px; }
.topnav button.active { background:var(--sage-soft); }
.topnav button.active::after { right:28%; bottom:3px; left:28%; height:2px; }
.app-menu summary { border:1px solid transparent; }
.app-menu[open] summary { border-color:var(--line); background:var(--surface); }
.app-menu>div { padding:9px; border-color:var(--line); border-radius:16px; box-shadow:var(--shadow-md); }
.app-menu>div { width:min(300px,calc(100vw - 24px)); }
.account-entry { position:relative; flex:0 0 auto; margin-left:8px; }
.account-entry--guest { display:grid; grid-template-columns:minmax(170px,1fr) 230px; align-items:center; gap:14px; min-height:58px; padding:7px 8px 7px 15px; border:1px solid var(--line); border-radius:16px; background:var(--surface); box-shadow:var(--shadow-sm); }
.guest-login-copy { min-width:0; padding-left:10px; border-left:2px solid var(--champagne); }
.guest-login-copy strong,.guest-login-copy small { display:block; }
.guest-login-copy strong { color:var(--ink); font-size:12px; line-height:1.3; letter-spacing:-.01em; }
.guest-login-copy small { margin-top:3px; color:var(--muted); font-size:10px; line-height:1.35; }
.guest-google-action { display:block; width:230px; min-width:0; }
.account-entry--google summary { display:flex; align-items:center; gap:9px; min-height:46px; padding:5px 10px 5px 6px; border:1px solid var(--line); border-radius:14px; background:var(--surface); cursor:pointer; list-style:none; }
.account-entry--google summary::-webkit-details-marker { display:none; }
.account-entry--google summary img,.account-avatar-fallback { width:34px; height:34px; flex:0 0 auto; border-radius:50%; object-fit:cover; }
.account-avatar-fallback { display:grid; place-items:center; color:#fff; background:var(--teal-700); font-weight:800; }
.account-entry--google summary strong,.account-entry--google summary small { display:block; max-width:150px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.account-entry--google summary strong { color:var(--ink); font-size:11px; }
.account-entry--google summary small { margin-top:2px; color:var(--success); font-size:10px; font-weight:700; }
.account-popover { position:absolute; z-index:70; right:0; top:calc(100% + 8px); width:min(280px,calc(100vw - 24px)); padding:14px; border:1px solid var(--line); border-radius:15px; background:var(--surface); box-shadow:var(--shadow-md); }
.account-popover>strong,.account-popover>small { display:block; overflow:hidden; text-overflow:ellipsis; }
.account-popover>strong { color:var(--ink); font-size:13px; }
.account-popover>small { margin-top:3px; color:var(--muted); font-size:11px; white-space:nowrap; }
.account-sync-detail { display:block; margin:12px 0 8px; padding:9px 10px; border-radius:9px; color:var(--success); background:var(--sage-soft); font-size:11px; font-weight:700; }
.account-popover button { width:100%; min-height:42px; padding:8px 10px; border:0; border-radius:9px; color:var(--ink); background:transparent; text-align:left; cursor:pointer; }
.account-popover button:hover { background:var(--soft); }
.google-signin { position:relative; display:flex; align-items:center; justify-content:center; width:100%; min-width:0; min-height:44px; overflow:visible; color-scheme:light; }
.google-signin:not(.is-ready)::before { content:"Đang tải đăng nhập…"; color:var(--muted); font-size:11px; }
.google-signin.is-ready::before { content:none; }
.google-signin>div { max-width:100%; }
.google-signin iframe { display:block; max-width:100%; filter:none; opacity:1; }
.google-config-note { white-space:normal!important; line-height:1.4; }

@media(max-width:760px) {
  .topbar { flex-wrap:wrap; gap:8px; padding-block:8px; }
  .brand { order:1; }
  .account-entry--google { order:2; margin-left:auto; }
  .app-menu { order:3; margin-left:0; }
  .account-entry--guest { order:4; grid-template-columns:minmax(0,1fr) 190px; flex-basis:100%; width:100%; margin:0; padding:8px 9px 8px 12px; border-radius:14px; }
  .guest-login-copy { padding-left:8px; }
  .guest-login-copy strong { font-size:11.5px; }
  .guest-login-copy small { font-size:9.5px; }
  .guest-google-action { width:190px; }
  .account-entry--google summary { min-height:42px; padding:4px 7px 4px 4px; }
  .account-entry--google summary img,.account-avatar-fallback { width:32px; height:32px; }
  .account-entry--google summary strong { max-width:82px; font-size:10px; }
  .account-entry--google summary small { max-width:82px; margin-top:1px; font-size:9px; }
  .account-popover { right:-48px; }
}

.study-home,.chapter-page,.practice-home,.exam-detail,.quick-start {
  width:min(calc(100% - 40px),1120px);
  padding-top:38px;
}
.eyebrow { color:var(--teal-700); font-size:11px; font-weight:780; letter-spacing:.16em; }
.section-title { align-items:center; margin-bottom:16px; }
.section-title h2,.chapter-section .section-title h2,.exam-compact-list h2 { margin-top:6px; font-size:24px; font-weight:720; letter-spacing:-.035em; }

/* Home */
.study-welcome {
  grid-template-columns:minmax(0,1.12fr) minmax(265px,.88fr);
  gap:18px 32px;
  padding:30px 32px;
  border:1px solid #e8ddc9;
  border-radius:var(--radius-lg);
  background:
    linear-gradient(105deg,rgba(255,255,255,.3),transparent 48%),
    var(--ivory);
  box-shadow:var(--shadow-md);
}
.study-welcome::before { width:4px; background:var(--champagne); }
.study-welcome::after { right:24px; top:22px; border-color:rgba(18,62,73,.12); }
.study-welcome h1 { margin:10px 0 12px; font-size:34px; font-weight:720; letter-spacing:-.04em; }
.study-welcome h1 span { display:block; margin-top:4px; color:var(--teal-700); font-size:.72em; font-weight:600; letter-spacing:-.025em; }
.study-welcome p { max-width:440px; color:#53696e; font-size:15px; line-height:1.72; }
.home-progress-card {
  border-color:#cddfd7;
  border-radius:20px;
  background:rgba(237,244,240,.94);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.8);
}
.home-progress-card span>b { font-size:34px; font-variant-numeric:tabular-nums; }
.home-progress-card>i { height:6px; }
.home-progress-card>i>b { background:linear-gradient(90deg,var(--teal-700),#79a99a); }
.study-continue { min-height:50px; border-radius:14px; box-shadow:0 9px 20px rgba(18,62,73,.14); }
.home-today { margin-top:34px; }
.home-quick-actions { grid-template-columns:repeat(3,minmax(0,1fr)); gap:11px; }
.home-quick-actions button {
  min-height:78px;
  border-color:#d4dfdc;
  border-radius:var(--radius-md);
  background:rgba(255,253,250,.92);
  box-shadow:var(--shadow-sm);
}
.home-quick-actions button>span { color:var(--teal-900); background:var(--sage-soft); }
.home-quick-actions button:nth-child(2)>span { color:#75591c; background:var(--champagne-soft); }
.home-quick-actions button:nth-child(3)>span { color:#586a70; background:#edf0ef; }
.chapter-section { margin-top:38px; }
.chapter-list { display:grid; gap:8px; border:0; }
.chapter-row {
  min-height:78px;
  padding:12px 14px;
  border:1px solid transparent;
  border-bottom-color:var(--line);
  border-radius:14px;
  background:rgba(255,253,250,.48);
}
.chapter-row>b { width:38px; height:38px; display:grid; place-items:center; border:0; border-radius:11px; background:#edf2ef; }
.chapter-row>span i { height:3px; margin-top:7px; }
.chapter-row>span i em { background:var(--teal-500); }
.chapter-row.complete { border-color:#d2e1da; background:var(--sage-soft); }
.chapter-row.complete>b { color:var(--success); background:#dcebe3; }
.chapter-row.current { border-color:#bcd3ce; background:#f1f7f4; box-shadow:inset 3px 0 var(--teal-500); }

/* Chapter and lesson */
.chapter-page>.context-back { margin-left:-9px; }
.chapter-page>h1 { margin-top:9px; color:var(--teal-900); font-size:36px; font-weight:720; letter-spacing:-.035em; }
.chapter-page>p { font-size:16px; }
.compact-progress { max-width:680px; padding:15px 17px; border:1px solid #d6e4df; border-radius:15px; background:var(--sage-soft); }
.compact-progress i { height:5px; }
.unit-list { margin-top:20px; border-top:0; }
.unit-list button {
  min-height:66px;
  margin-bottom:7px;
  padding:12px 14px;
  border:1px solid var(--line);
  border-radius:14px;
  background:rgba(255,253,250,.8);
}
.unit-list button:focus-visible { border-color:#b8d1ca; background:#eff6f3; }
.unit-list span { font-variant-numeric:tabular-nums; }
.study-layout { align-items:start; }
.chapter-rail { padding:18px 16px; border:1px solid var(--line); border-radius:18px; background:rgba(255,253,250,.76); }
.study-lesson { border-color:#d7e1de; border-radius:22px; background:var(--surface); box-shadow:var(--shadow-sm); }
.lesson-heading h1 { font-size:30px; line-height:1.45; }
.lesson-heading p { color:var(--muted); font-size:16px; }
.curriculum-tier,.lesson-formula,.lesson-trap,.lesson-support-grid article { border-radius:14px; }
.curriculum-tier--a { background:#fbf3df!important; border-color:#ead6a5!important; }
.curriculum-tier--b { background:#eef5f3!important; }
.lesson-trap,.trap-focus { background:#fbf1e8!important; border-color:#ead2c2!important; }
.lesson-footer { border-top:1px solid var(--line); }

/* Practice */
.practice-home h1 { margin-top:10px; font-size:36px; font-weight:720; }
.practice-actions { grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.practice-actions .practice-mode {
  position:relative;
  min-height:116px;
  display:grid;
  grid-template-columns:44px minmax(0,1fr) auto;
  align-items:center;
  gap:13px;
  padding:18px;
  overflow:hidden;
  border:1px solid var(--line);
  border-radius:20px;
  color:var(--ink);
  background:var(--surface);
  text-align:left;
  box-shadow:var(--shadow-sm);
  cursor:pointer;
}
.practice-actions .practice-mode::before { content:""; position:absolute; inset:0 auto 0 0; width:3px; }
.practice-mode--quick::before { background:var(--champagne)!important; }
.practice-mode--mistakes::before { background:#86ad9d!important; }
.practice-mode--mock::before { background:var(--teal-500)!important; }
.practice-mode--original::before { background:#879699!important; }
.practice-mode-icon { width:42px; height:42px; display:grid!important; place-items:center; border-radius:12px; color:var(--teal-900); background:var(--sage-soft); font-family:"Noto Sans JP",sans-serif; font-size:17px; font-weight:800; }
.practice-mode--quick .practice-mode-icon { color:#785a18; background:var(--champagne-soft); }
.practice-mode b,.practice-mode small { display:block; }
.practice-mode b { font-size:17px; font-weight:740; }
.practice-mode small { margin-top:5px; color:var(--muted); font-size:12px; }
.practice-mode>i { color:var(--teal-700); font-size:22px; font-style:normal; }
.practice-count { min-width:30px; height:30px; display:grid!important; place-items:center; margin:0!important; border-radius:50%; background:rgba(255,255,255,.78); font-weight:800; }
.exam-compact-list { scroll-margin-top:90px; }
.exam-compact-list h2 { font-size:25px; }
.exam-compact-list .exam-row { background:rgba(255,253,250,.84); }

/* Quiz */
.quiz-layout { grid-template-columns:230px minmax(0,900px); justify-content:center; gap:24px; }
.quiz-side { padding:16px; border:1px solid var(--line); border-radius:18px; background:rgba(255,253,250,.72); }
.question-panel { border-radius:24px; box-shadow:var(--shadow-md); }
.quiz-context-back { min-height:44px; padding:0 10px; border-radius:11px; }
.quiz-context-back:hover { background:var(--sage-soft); }
.question-toolbar { padding-bottom:15px; border-bottom:1px solid var(--line); }
.question-count { color:var(--teal-900); font-size:12px; }
.topic-chip { border:1px solid #d8e2df; background:#f0f4f2; }
.jp-content h1 { color:#18353c; font-size:clamp(20px,2.2vw,27px); line-height:1.9; }
.options { gap:10px; }
.option { min-height:70px; border-radius:15px; background:#fffefc; box-shadow:none; }
.option>span { border-radius:10px; }
.option.selected { border-color:var(--teal-700); background:#f0f7f5; }
.question-footer { margin-top:32px; padding-top:18px; border-top:1px solid var(--line); }

/* Results */
.result-wrap { max-width:980px; }
.result-hero { position:relative; gap:34px; padding:30px; border:1px solid #d6e1dd; border-radius:26px; background:var(--surface); box-shadow:var(--shadow-md); }
.result-hero::before { content:""; position:absolute; inset:0 auto 0 0; width:4px; border-radius:26px 0 0 26px; background:var(--champagne); }
.score-ring { width:164px; height:164px; padding:9px; background:conic-gradient(var(--teal-700) var(--score-angle),#e4ebe8 0); }
.score-ring strong { font-size:46px; }
.result-copy h1 { font-size:40px; }
.result-status { border:1px solid #cde0d7; }
.result-details { margin-top:18px; border-radius:22px; box-shadow:var(--shadow-sm); }

/* Vocabulary */
.vocab-hub-heading h1 { color:var(--teal-900); font-size:44px; font-weight:720; }
.vocab-progress-summary { border:1px solid #d3e1dc; background:var(--sage-soft); }
.vocab-tabs { max-width:620px; padding:4px; border-color:#e3d8c3; border-radius:16px; }
.vocab-tabs button { border-radius:12px; }
.vocab-study-toolbar { border-radius:17px; }
.study-flashcard { border-color:#d5dfdc; border-radius:26px; background:linear-gradient(165deg,#fffefa,#fff 74%); box-shadow:var(--shadow-md); }
.study-flashcard::after { content:""; position:absolute; right:22px; bottom:20px; width:46px; height:46px; border-right:1px solid rgba(18,62,73,.09); border-bottom:1px solid rgba(18,62,73,.09); pointer-events:none; }
.flashcard-front h2 { color:var(--teal-900); }
.vocab-control-panel { border-radius:16px; box-shadow:var(--shadow-sm); }
.vocab-hint { color:var(--subtle); }

.site-signature { border-top-color:#d8e0dd; background:#f8f3e8; }
.site-signature strong::before { background:var(--champagne); }

@media (max-width:760px) {
  body { padding-bottom:calc(74px + env(safe-area-inset-bottom)); }
  .topbar { min-height:62px; padding:0 14px; }
  .brand { gap:9px; }
  .brand-mark { width:34px; height:34px; border-radius:10px 10px 10px 4px; font-size:15px; }
  .brand strong { font-size:16px; }
  .brand>span:last-child small { display:block; font-size:9.5px; }
  .app-menu summary { width:40px; height:40px; }
  .bottom-nav { min-height:70px; grid-template-columns:repeat(3,1fr); padding:4px 8px env(safe-area-inset-bottom); background:rgba(252,253,250,.96); }
  .bottom-nav button { min-height:57px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:2px; border-radius:12px; font-size:10.5px; font-weight:720; }
  .bottom-nav button>span { display:block; font-family:"Noto Sans JP",sans-serif; font-size:17px; line-height:1.1; font-weight:700; }
  .bottom-nav button.active { background:var(--sage-soft); }
  .bottom-nav button::before { top:1px; }

  .study-home,.chapter-page,.practice-home,.exam-detail,.quick-start { width:calc(100% - 28px); padding-top:18px; }
  .study-welcome { padding:21px 18px 18px; border-radius:22px; box-shadow:0 10px 28px rgba(18,62,73,.065); }
  .study-welcome h1 { margin-top:9px; font-size:28px; }
  .study-welcome h1 span { margin-top:2px; }
  .study-welcome p { padding-right:12px; font-size:14px; line-height:1.65; }
  .home-progress-card { margin-top:18px; padding:15px; border-radius:16px; }
  .home-progress-card span>b { font-size:30px; }
  .study-continue { width:100%; margin-top:12px; }
  .home-today { margin-top:29px; }
  .section-title h2,.chapter-section .section-title h2 { font-size:21px; }
  .home-quick-actions { grid-template-columns:repeat(3,minmax(0,1fr)); gap:7px; }
  .home-quick-actions button { min-height:94px; display:flex; flex-direction:column; align-items:flex-start; gap:6px; padding:10px; border-radius:14px; }
  .home-quick-actions button>span { width:32px; height:32px; border-radius:9px; }
  .home-quick-actions button>div { min-width:0; width:100%; }
  .home-quick-actions b { font-size:13px; }
  .home-quick-actions small { max-width:100%; font-size:10.5px; }
  .home-quick-actions i { display:none; }
  .chapter-section { margin-top:34px; }
  .chapter-list { gap:6px; }
  .chapter-row { min-height:76px; grid-template-columns:38px minmax(0,1fr) auto 10px; padding:10px 9px; border-radius:12px; }
  .chapter-row>b { width:34px; height:34px; }
  .chapter-row strong { font-size:15px; }
  .chapter-row>small { font-size:11px; }

  .chapter-page>h1 { font-size:29px; line-height:1.38; }
  .compact-progress { margin:20px 0 16px; padding:13px 14px; }
  .unit-list button { min-height:64px; }
  .study-lesson { padding:19px 15px; border-radius:18px; }
  .lesson-heading h1 { font-size:25px; }
  .lesson-support-grid { gap:9px; }

  .practice-home { padding-top:23px; }
  .practice-home h1 { font-size:29px; }
  .practice-actions { grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; margin-bottom:39px; }
  .practice-actions .practice-mode { min-height:128px; display:flex; flex-direction:column; align-items:flex-start; justify-content:flex-start; gap:8px; padding:14px; border-radius:17px; }
  .practice-mode-icon { width:38px; height:38px; border-radius:11px; }
  .practice-mode b { font-size:15px; }
  .practice-mode small { font-size:11px; line-height:1.35; }
  .practice-mode>i,.practice-count { position:absolute; right:12px; top:15px; }
  .exam-compact-list h2 { font-size:22px; }

  .quiz-layout { display:block; padding:12px 10px 102px; }
  .question-panel { padding:15px 13px 20px; border-radius:18px; box-shadow:0 7px 22px rgba(18,62,73,.055); }
  .quiz-context-back { margin:0 0 7px -5px; }
  .question-toolbar { align-items:flex-start; margin-bottom:14px; padding-bottom:12px; }
  .question-toolbar>div:first-child { gap:6px; }
  .topic-chip { max-width:170px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .timer { padding:7px 9px; }
  .tap-hint { padding:10px; border-radius:11px; background:#f3f6f4; font-size:11px; line-height:1.45; }
  .jp-content h1 { font-size:19px; line-height:1.82; }
  .options { margin:22px 0; }
  .option { min-height:64px; grid-template-columns:40px minmax(0,1fr) auto; gap:9px; padding:10px; }
  .option>span { width:36px; height:36px; }
  .option b { font-size:15px; }
  .question-footer { right:0; bottom:0; left:0; margin:0; border-radius:0; }
  .mobile-question-toggle { top:auto; bottom:82px; height:62px; }

  .result-wrap { padding:19px 14px 34px; }
  .result-hero { display:block; padding:24px 20px; border-radius:21px; }
  .score-ring { width:126px; height:126px; margin:0 auto 22px; }
  .score-ring strong { font-size:38px; }
  .result-copy { text-align:center; }
  .result-copy h1 { font-size:30px; }
  .result-copy>div { justify-content:center; flex-wrap:wrap; }
  .result-details { padding:18px 14px; }

  .vocab-wrap { padding:22px 14px 28px; }
  .vocab-hub-heading { align-items:center; }
  .vocab-hub-heading h1 { font-size:30px; }
  .vocab-tabs { max-width:none; }
  .vocab-tabs button { min-height:42px; font-size:13px; }
  .vocab-home-filters { gap:6px; }
  .vocab-study-toolbar { padding:12px; }
  .study-flashcard { min-height:348px; border-radius:22px; }
  .flashcard-face { min-height:250px; }
  .study-word-area h2,.flashcard-face h2 { font-size:clamp(44px,14vw,64px); }
  .vocab-control-panel { border-radius:14px; }
  .site-signature { padding-bottom:24px; }
}

@media (max-width:380px) {
  .brand strong { font-size:15px; }
  .study-welcome { padding-inline:16px; }
  .home-quick-actions button { padding:9px 8px; }
  .home-quick-actions b { font-size:12px; }
  .chapter-row { grid-template-columns:36px minmax(0,1fr) 10px; }
  .chapter-row>small { grid-column:2; }
  .practice-actions .practice-mode { min-height:124px; padding:12px; }
}

@media (min-width:1024px) {
  .study-home,.chapter-page,.practice-home,.exam-detail,.quick-start { width:calc(100% - 80px); max-width:1240px; }
  .study-welcome { min-height:270px; grid-template-columns:minmax(0,1.55fr) minmax(310px,.72fr); padding:38px 42px; }
  .study-welcome h1 { font-size:44px; }
  .home-progress-card { grid-column:2; grid-row:1/3; }
  .home-quick-actions { gap:16px; }
  .practice-actions { grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; }
  .practice-actions .practice-mode { min-height:140px; display:flex; flex-direction:column; align-items:flex-start; justify-content:flex-start; }
  .practice-mode>i,.practice-count { position:absolute; right:18px; top:19px; }
  .exam-desktop-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}

@media (hover:hover) {
  .chapter-row:hover,.unit-list button:hover,.exam-row:hover { border-color:#bfd2cd; background:#fffefa; box-shadow:var(--shadow-sm); transform:translateY(-1px); }
  .practice-mode:hover,.home-quick-actions button:hover { border-color:#bcd2cc; box-shadow:0 6px 18px rgba(18,62,73,.05); transform:translateY(-1px); }
}

/* Editorial hierarchy and focused question navigation. */
.study-welcome { background:transparent; border:0; box-shadow:none; padding:12px 0 0; gap:24px; }
.study-welcome::before,.study-welcome::after { display:none; }
.study-welcome h1 { font-size:30px; line-height:1.3; letter-spacing:-.035em; font-weight:650; }
.home-progress-card { background:var(--teal-900); color:#fff; padding:24px; border:1px solid var(--teal-900); border-radius:20px; box-shadow:var(--shadow-sm); }
.home-progress-card span>b { color:#fff; font-size:42px; font-weight:600; letter-spacing:-.05em; }
.home-progress-card small,.home-progress-card span>small,.home-progress-card em { color:#d0dfdc; }
.home-progress-card>i { background:#365963; height:5px; margin-top:20px; }
.home-progress-card>i>b { background:var(--champagne); }
.study-welcome .next-study-label { color:#e0eae7; font-size:13px; line-height:1.6; margin:18px 0 14px; padding:0; }
.home-progress-card .study-continue { width:100%; margin:0; background:#f8f2e5; color:var(--teal-900); border:0; min-height:48px; box-shadow:none; font-weight:650; }
.section-title h2 { font-weight:650; letter-spacing:-.025em; }
.chapter-row strong { font-weight:650; }
.chapter-row>small { font-variant-numeric:tabular-nums; }
.chapter-page .compact-progress { margin:24px 0; padding:20px; background:var(--sage-soft); border-radius:14px; }
.unit-list button { min-height:80px; }
.study-lesson { line-height:1.8; }
.lesson-footer { position:static; margin-top:32px; background:transparent; box-shadow:none; padding:20px 0; }
.exam-detail-heading h1 { font-weight:650; letter-spacing:-.035em; }
.exam-facts { background:var(--sage-soft); border:1px solid var(--line); box-shadow:none; }
.exam-detail-actions { max-width:560px; }
.quiz-heading { display:flex; justify-content:space-between; align-items:center; gap:12px; margin-bottom:16px; }
.quiz-heading .quiz-context-back { margin:0; min-height:44px; }
.question-progress { height:3px; background:var(--line); margin:0 0 24px; overflow:hidden; border-radius:2px; }
.question-progress>span { display:block; height:100%; background:var(--teal-500); transition:width 180ms ease; }
.quiz-heading .mobile-question-toggle { position:static; inset:auto; height:44px; min-height:44px; width:auto; min-width:64px; padding:0 12px; flex-direction:row; gap:8px; border-radius:10px; box-shadow:none; background:var(--sage-soft); color:var(--teal-900); }
.quiz-heading .mobile-question-toggle { transform:none; }
.quiz-heading .mobile-question-toggle b { background:transparent; color:inherit; }
.question-panel .jp-content h1 { font-weight:550; line-height:1.85; }
.option>b { font-weight:500; line-height:1.85; }
.tap-hint { font-size:12px; }
.study-flashcard { box-shadow:0 8px 24px rgba(18,62,73,.045); }
@media (max-width:767px) {
  .study-welcome { padding:4px 0 0; border-radius:0; box-shadow:none; }
  .study-welcome h1 { font-size:28px; }
  .home-progress-card { margin-top:20px; padding:20px; }
  .home-progress-card span>b { font-size:38px; }
  .question-panel .jp-content h1 { font-size:19px; }
  .question-panel { padding-bottom:24px; }
  .bottom-nav button.active { box-shadow:none; border-radius:8px; }
  .vocab-hub-heading { display:flex; flex-direction:row; align-items:center; gap:12px; margin-bottom:16px; }
  .vocab-hub-heading h1 { font-size:26px; }
  .vocab-hub-heading .eyebrow { font-size:10px; }
  .vocab-progress-summary { padding:8px 10px; margin:0; white-space:nowrap; }
  .vocab-study-toolbar { margin-bottom:16px; }
  .vocab-home-filters { display:flex; flex-wrap:wrap; width:100%; min-width:0; max-width:100%; }
  .vocab-home-filters button { min-height:44px; }
}
@media (min-width:1024px) {
  .study-welcome { padding:20px 0; min-height:240px; grid-template-columns:minmax(0,1fr) minmax(350px,.9fr); align-items:center; }
  .study-welcome h1 { font-size:36px; }
  .home-progress-card { grid-row:auto; margin:0; }
}

@media (prefers-reduced-motion:reduce) {
  *,*::before,*::after { scroll-behavior:auto!important; transition-duration:.01ms!important; animation-duration:.01ms!important; animation-iteration-count:1!important; }
}

/* Controlled dark palette. Explicit theme and OS preference share identical rules.
   Keep this presentation-only block separate from the approved light palette. */
:root { color-scheme:light; }
html[data-theme="dark"] {

.unit-nav button,.curriculum-panel { background:var(--surface); color:var(--muted); border-color:var(--line); }
.unit-nav button.active { background:var(--teal-soft); color:var(--ink); border-color:var(--teal-500); box-shadow:none; }
.unit-nav button.active span,.unit-nav button.active i { color:var(--teal-700); }


.home-quick-actions small,.chapter-row small,.topnav button,.bottom-nav button,.site-signature span { color:var(--muted); }
.bottom-nav button.active { color:var(--teal-700); }
.all-option-translations-toggle,.dictionary-save,.curriculum-panel__head>span,.curriculum-overview span,.focus-topic__meta span,.exam-row-status strong { background:var(--soft); color:var(--muted); border-color:var(--line); }
.dictionary-save.saved,.exam-row-status strong.is-done { background:var(--success-soft); color:var(--success); }
.option.selected>span { background:var(--teal-700); color:var(--on-action); }
.option.correct>span { background:var(--success); color:var(--on-action); }
.option.wrong>span { background:var(--danger); color:var(--on-action); }
.curriculum-tier--c summary>span,.focus-priority--c { background:var(--soft); color:var(--ink); }

color-scheme: dark;
--paper:#111a1d; --surface:#192629; --surface-cool:#141f22; --elevated:#1e2e32; --soft:#223338; --header:#10191c;
--ink:#f1f4f1; --muted:#b2bfbd; --subtle:#9baead; --line:#304247;
--teal-900:#8ac7ca; --teal-700:#63b3b8; --teal-500:#4b969f; --teal-soft:#20383c;
--champagne:#d6b570; --champagne-soft:#3a3222; --sage:#69ad8f; --sage-soft:#20382e; --ivory:#1e2e32;
--success:#80bea1; --success-soft:#20382e; --danger:#e5948b; --danger-soft:#402927;
--card:var(--surface); --brand:var(--teal-700); --brand-2:var(--teal-700); --accent:var(--champagne); --gold:var(--champagne); --gold-soft:var(--champagne-soft);
--shadow-sm:0 5px 18px #00000018; --shadow-md:0 14px 42px #00000024; --shadow:var(--shadow-md);
--progress-surface:#184450; --on-action:#10272c; --progress-cta:#f8f2e5;

body { background:var(--paper); }
body::before { background:none; }
.topbar,.bottom-nav { background:var(--header); border-color:var(--line); }
.brand-mark { background:var(--progress-surface); color:var(--ink); box-shadow:none; }
.brand small,.study-welcome p,.exam-facts span,.exam-row-copy em,.practice-mode small,.tap-hint,.vocab-tabs button,.vocab-scope button,.vocab-control-panel>p { color:var(--muted); }
.study-welcome { background:transparent; }
.home-progress-card { background:var(--progress-surface); border-color:var(--teal-500); }
.home-progress-card .study-continue { background:var(--progress-cta); color:var(--on-action); }
.home-progress-card>i { background:#42646c; }
.home-quick-actions button,.chapter-row,.unit-list button,.chapter-rail,.quiz-side,.exam-compact-list .exam-row,.history-list>div,.result-item,.dictionary-row,.vocab-card { background:var(--surface); border-color:var(--line); box-shadow:var(--shadow-sm); }
.home-quick-actions button>span,.home-quick-actions button:nth-child(3)>span,.chapter-row>b,.option>span,.practice-mode-icon,.vocab-category-badge { background:var(--teal-soft); color:var(--teal-700); }
.home-quick-actions button:nth-child(2)>span,.practice-mode--quick .practice-mode-icon,.priority-dot.a,.flag-button.active,.vocab-speed button.active { background:var(--champagne-soft); color:var(--champagne); border-color:var(--champagne); }
.chapter-row.current,.unit-list button:focus-visible { background:var(--teal-soft); border-color:var(--teal-500); }
.chapter-row.complete,.chapter-row.complete>b { background:var(--success-soft); border-color:var(--line); color:var(--success); }
.chapter-row>span i,.compact-progress i,.progress-line,.vocab-known-progress { background:var(--line); }
.compact-progress,.chapter-page .compact-progress,.exam-facts,.vocab-progress-summary { background:var(--teal-soft); border-color:var(--line); }
.study-lesson,.question-panel,.result-hero,.result-details { background:var(--surface); border-color:var(--line); box-shadow:var(--shadow-sm); }
.curriculum-tier--a { background:var(--champagne-soft)!important; border-color:var(--line)!important; }
.curriculum-tier--b { background:var(--teal-soft)!important; border-color:var(--line)!important; }
.curriculum-tier--c,.lesson-formula,.lesson-support-grid article { background:var(--elevated); border-color:var(--line); }
.lesson-trap,.trap-focus { background:var(--danger-soft)!important; border-color:var(--line)!important; }
.practice-actions .practice-mode,.exam-detail-heading { background:var(--elevated); border-color:var(--line); box-shadow:var(--shadow-sm); }
.practice-count,.topic-chip,.timer,.tap-hint,.tap-hint span { background:var(--soft); color:var(--muted); border-color:var(--line); }
.primary-action,.save-term,.vocab-tabs button.active,.number-grid button.current,.drawer-number-grid button.current,.result-filters button.active { background:var(--teal-700); color:var(--on-action); border-color:var(--teal-700); box-shadow:none; }
.primary-action:hover { background:var(--teal-900); }
.secondary-action,.flag-button,.number-grid button,.drawer-number-grid button,.result-filters button,.vocab-speed button,.vocab-study-toolbar select,.vocab-home-filters button { background:var(--surface); color:var(--ink); border-color:var(--line); }
.topnav button.active,.bottom-nav button.active,.vocab-home-filters button.active,.vocab-scope button.active,.number-grid button.answered,.drawer-number-grid button.answered,.quiz-heading .mobile-question-toggle { background:var(--teal-soft); color:var(--teal-700); border-color:var(--teal-500); }
.number-grid button.current,.drawer-number-grid button.current { background:var(--teal-700); color:var(--on-action); }
.jp-content h1,.flashcard-front h2,.flashcard-back h2,.study-word-area h2,.knowledge-pair .knowledge-ja { color:var(--ink); }
.option { background:var(--elevated); border-color:var(--line); }
.option.selected { background:var(--teal-soft); border-color:var(--teal-700); box-shadow:none; }
.option.correct { background:var(--success-soft); border-color:var(--success); box-shadow:none; }
.option.wrong { background:var(--danger-soft); border-color:var(--danger); }
.option.selected>span,.option.correct>span,.option.wrong>span,.explanation-title>span { color:var(--on-action); }
.translation-toggle p,.option-translation,.vi-result,.answer-translation,.knowledge-note,.knowledge-pair,.keyword-box,.answer-comparison>div { background:var(--soft); color:var(--muted); border-color:var(--line); }
.explanation-card { background:var(--success-soft); border-color:var(--line); }
.explanation-card.wrong { background:var(--danger-soft); border-color:var(--line); }
.explanation-card>p,.answer-translation p,.knowledge-note p,.knowledge-pair .knowledge-vi,.study-answer li { color:var(--muted); border-color:var(--line); }
.keyword-box span,.answer-comparison b,.result-item summary>span { background:var(--teal-soft); color:var(--teal-700); }
.question-footer,.question-drawer,.term-popover,.app-menu>div,.account-popover,.account-entry--guest,.account-entry--google summary { background:var(--surface); border-color:var(--line); box-shadow:var(--shadow-sm); }
.lesson-footer { background:transparent; }
.score-ring { background:conic-gradient(var(--teal-700) var(--score-angle),var(--line) 0); }
.result-status { border-color:var(--line); }
.vocab-tabs,.vocab-scope,.vocab-study-toolbar,.vocab-control-panel,.vocab-auto-panel,.dictionary-controls label { background:var(--surface); border-color:var(--line); box-shadow:none; }
.study-flashcard { background:var(--elevated); border-color:var(--line); box-shadow:var(--shadow-md); }
.study-flashcard::after { border-color:var(--line); }
.flashcard-back .study-meaning { color:var(--ink); border-color:var(--line); }
.vocab-control-stack>div button { background:var(--soft); color:var(--teal-700); border-color:var(--line); }
.vocab-memory-actions button { background:var(--danger-soft); color:var(--danger); border-color:var(--line); }
.vocab-memory-actions button.known { background:var(--success-soft); color:var(--success); border-color:var(--line); }
.study-han-viet { color:var(--champagne); }
.site-signature { background:var(--paper); border-color:var(--line); }
.term-head button,.remove-term { background:var(--soft); color:var(--muted); }
.ask-chatgpt,.word-token:hover,.word-token.known:hover { background:var(--teal-soft); color:var(--teal-700); border-color:var(--line); }
button:focus-visible,label:focus-within { outline-color:var(--teal-700); }
button:disabled { opacity:.6; }

.study-welcome h1,.study-jp,.curriculum-point-jp,.focus-point-list p:first-child { color:var(--ink); }
.study-vi,.curriculum-point-vi,.focus-point-list p+p,.question-ref-list p,.term-focus,.trap-focus,.lesson-trap,.lesson-formula { color:var(--muted); }
.study-point-card,.question-ref-list button,.focus-point-list article,.confirm-dialog,.focus-topic { background:var(--surface); border-color:var(--line); }
.study-point-card .point-number,.curriculum-point-list small,.dialog-icon,.question-drawer-head button,.recall-toggle { background:var(--teal-soft); color:var(--teal-700); border-color:var(--line); }
.curriculum-formulas,.curriculum-checklist { background:var(--teal-soft); color:var(--ink); }
.curriculum-trap { background:var(--danger-soft); color:var(--ink); }
.trap-focus>span { color:var(--danger); }
.focus-topic summary b { background:var(--champagne-soft); color:var(--champagne); }
.focus-refs { color:var(--muted); }
.curriculum-point-list li,.curriculum-point-list small { border-color:var(--line); }

@media(hover:hover) {
 .chapter-row:hover,.unit-list button:hover,.exam-compact-list .exam-row:hover,.dictionary-row:hover,.home-quick-actions button:hover,.practice-actions .practice-mode:hover { background:var(--elevated); border-color:var(--teal-500); box-shadow:var(--shadow-sm); }
}

}
@media(prefers-color-scheme:dark) {
 html:not([data-theme="light"]) {

.unit-nav button,.curriculum-panel { background:var(--surface); color:var(--muted); border-color:var(--line); }
.unit-nav button.active { background:var(--teal-soft); color:var(--ink); border-color:var(--teal-500); box-shadow:none; }
.unit-nav button.active span,.unit-nav button.active i { color:var(--teal-700); }


.home-quick-actions small,.chapter-row small,.topnav button,.bottom-nav button,.site-signature span { color:var(--muted); }
.bottom-nav button.active { color:var(--teal-700); }
.all-option-translations-toggle,.dictionary-save,.curriculum-panel__head>span,.curriculum-overview span,.focus-topic__meta span,.exam-row-status strong { background:var(--soft); color:var(--muted); border-color:var(--line); }
.dictionary-save.saved,.exam-row-status strong.is-done { background:var(--success-soft); color:var(--success); }
.option.selected>span { background:var(--teal-700); color:var(--on-action); }
.option.correct>span { background:var(--success); color:var(--on-action); }
.option.wrong>span { background:var(--danger); color:var(--on-action); }
.curriculum-tier--c summary>span,.focus-priority--c { background:var(--soft); color:var(--ink); }

color-scheme: dark;
--paper:#111a1d; --surface:#192629; --surface-cool:#141f22; --elevated:#1e2e32; --soft:#223338; --header:#10191c;
--ink:#f1f4f1; --muted:#b2bfbd; --subtle:#9baead; --line:#304247;
--teal-900:#8ac7ca; --teal-700:#63b3b8; --teal-500:#4b969f; --teal-soft:#20383c;
--champagne:#d6b570; --champagne-soft:#3a3222; --sage:#69ad8f; --sage-soft:#20382e; --ivory:#1e2e32;
--success:#80bea1; --success-soft:#20382e; --danger:#e5948b; --danger-soft:#402927;
--card:var(--surface); --brand:var(--teal-700); --brand-2:var(--teal-700); --accent:var(--champagne); --gold:var(--champagne); --gold-soft:var(--champagne-soft);
--shadow-sm:0 5px 18px #00000018; --shadow-md:0 14px 42px #00000024; --shadow:var(--shadow-md);
--progress-surface:#184450; --on-action:#10272c; --progress-cta:#f8f2e5;

body { background:var(--paper); }
body::before { background:none; }
.topbar,.bottom-nav { background:var(--header); border-color:var(--line); }
.brand-mark { background:var(--progress-surface); color:var(--ink); box-shadow:none; }
.brand small,.study-welcome p,.exam-facts span,.exam-row-copy em,.practice-mode small,.tap-hint,.vocab-tabs button,.vocab-scope button,.vocab-control-panel>p { color:var(--muted); }
.study-welcome { background:transparent; }
.home-progress-card { background:var(--progress-surface); border-color:var(--teal-500); }
.home-progress-card .study-continue { background:var(--progress-cta); color:var(--on-action); }
.home-progress-card>i { background:#42646c; }
.home-quick-actions button,.chapter-row,.unit-list button,.chapter-rail,.quiz-side,.exam-compact-list .exam-row,.history-list>div,.result-item,.dictionary-row,.vocab-card { background:var(--surface); border-color:var(--line); box-shadow:var(--shadow-sm); }
.home-quick-actions button>span,.home-quick-actions button:nth-child(3)>span,.chapter-row>b,.option>span,.practice-mode-icon,.vocab-category-badge { background:var(--teal-soft); color:var(--teal-700); }
.home-quick-actions button:nth-child(2)>span,.practice-mode--quick .practice-mode-icon,.priority-dot.a,.flag-button.active,.vocab-speed button.active { background:var(--champagne-soft); color:var(--champagne); border-color:var(--champagne); }
.chapter-row.current,.unit-list button:focus-visible { background:var(--teal-soft); border-color:var(--teal-500); }
.chapter-row.complete,.chapter-row.complete>b { background:var(--success-soft); border-color:var(--line); color:var(--success); }
.chapter-row>span i,.compact-progress i,.progress-line,.vocab-known-progress { background:var(--line); }
.compact-progress,.chapter-page .compact-progress,.exam-facts,.vocab-progress-summary { background:var(--teal-soft); border-color:var(--line); }
.study-lesson,.question-panel,.result-hero,.result-details { background:var(--surface); border-color:var(--line); box-shadow:var(--shadow-sm); }
.curriculum-tier--a { background:var(--champagne-soft)!important; border-color:var(--line)!important; }
.curriculum-tier--b { background:var(--teal-soft)!important; border-color:var(--line)!important; }
.curriculum-tier--c,.lesson-formula,.lesson-support-grid article { background:var(--elevated); border-color:var(--line); }
.lesson-trap,.trap-focus { background:var(--danger-soft)!important; border-color:var(--line)!important; }
.practice-actions .practice-mode,.exam-detail-heading { background:var(--elevated); border-color:var(--line); box-shadow:var(--shadow-sm); }
.practice-count,.topic-chip,.timer,.tap-hint,.tap-hint span { background:var(--soft); color:var(--muted); border-color:var(--line); }
.primary-action,.save-term,.vocab-tabs button.active,.number-grid button.current,.drawer-number-grid button.current,.result-filters button.active { background:var(--teal-700); color:var(--on-action); border-color:var(--teal-700); box-shadow:none; }
.primary-action:hover { background:var(--teal-900); }
.secondary-action,.flag-button,.number-grid button,.drawer-number-grid button,.result-filters button,.vocab-speed button,.vocab-study-toolbar select,.vocab-home-filters button { background:var(--surface); color:var(--ink); border-color:var(--line); }
.topnav button.active,.bottom-nav button.active,.vocab-home-filters button.active,.vocab-scope button.active,.number-grid button.answered,.drawer-number-grid button.answered,.quiz-heading .mobile-question-toggle { background:var(--teal-soft); color:var(--teal-700); border-color:var(--teal-500); }
.number-grid button.current,.drawer-number-grid button.current { background:var(--teal-700); color:var(--on-action); }
.jp-content h1,.flashcard-front h2,.flashcard-back h2,.study-word-area h2,.knowledge-pair .knowledge-ja { color:var(--ink); }
.option { background:var(--elevated); border-color:var(--line); }
.option.selected { background:var(--teal-soft); border-color:var(--teal-700); box-shadow:none; }
.option.correct { background:var(--success-soft); border-color:var(--success); box-shadow:none; }
.option.wrong { background:var(--danger-soft); border-color:var(--danger); }
.option.selected>span,.option.correct>span,.option.wrong>span,.explanation-title>span { color:var(--on-action); }
.translation-toggle p,.option-translation,.vi-result,.answer-translation,.knowledge-note,.knowledge-pair,.keyword-box,.answer-comparison>div { background:var(--soft); color:var(--muted); border-color:var(--line); }
.explanation-card { background:var(--success-soft); border-color:var(--line); }
.explanation-card.wrong { background:var(--danger-soft); border-color:var(--line); }
.explanation-card>p,.answer-translation p,.knowledge-note p,.knowledge-pair .knowledge-vi,.study-answer li { color:var(--muted); border-color:var(--line); }
.keyword-box span,.answer-comparison b,.result-item summary>span { background:var(--teal-soft); color:var(--teal-700); }
.question-footer,.question-drawer,.term-popover,.app-menu>div,.account-popover,.account-entry--guest,.account-entry--google summary { background:var(--surface); border-color:var(--line); box-shadow:var(--shadow-sm); }
.lesson-footer { background:transparent; }
.score-ring { background:conic-gradient(var(--teal-700) var(--score-angle),var(--line) 0); }
.result-status { border-color:var(--line); }
.vocab-tabs,.vocab-scope,.vocab-study-toolbar,.vocab-control-panel,.vocab-auto-panel,.dictionary-controls label { background:var(--surface); border-color:var(--line); box-shadow:none; }
.study-flashcard { background:var(--elevated); border-color:var(--line); box-shadow:var(--shadow-md); }
.study-flashcard::after { border-color:var(--line); }
.flashcard-back .study-meaning { color:var(--ink); border-color:var(--line); }
.vocab-control-stack>div button { background:var(--soft); color:var(--teal-700); border-color:var(--line); }
.vocab-memory-actions button { background:var(--danger-soft); color:var(--danger); border-color:var(--line); }
.vocab-memory-actions button.known { background:var(--success-soft); color:var(--success); border-color:var(--line); }
.study-han-viet { color:var(--champagne); }
.site-signature { background:var(--paper); border-color:var(--line); }
.term-head button,.remove-term { background:var(--soft); color:var(--muted); }
.ask-chatgpt,.word-token:hover,.word-token.known:hover { background:var(--teal-soft); color:var(--teal-700); border-color:var(--line); }
button:focus-visible,label:focus-within { outline-color:var(--teal-700); }
button:disabled { opacity:.6; }

.study-welcome h1,.study-jp,.curriculum-point-jp,.focus-point-list p:first-child { color:var(--ink); }
.study-vi,.curriculum-point-vi,.focus-point-list p+p,.question-ref-list p,.term-focus,.trap-focus,.lesson-trap,.lesson-formula { color:var(--muted); }
.study-point-card,.question-ref-list button,.focus-point-list article,.confirm-dialog,.focus-topic { background:var(--surface); border-color:var(--line); }
.study-point-card .point-number,.curriculum-point-list small,.dialog-icon,.question-drawer-head button,.recall-toggle { background:var(--teal-soft); color:var(--teal-700); border-color:var(--line); }
.curriculum-formulas,.curriculum-checklist { background:var(--teal-soft); color:var(--ink); }
.curriculum-trap { background:var(--danger-soft); color:var(--ink); }
.trap-focus>span { color:var(--danger); }
.focus-topic summary b { background:var(--champagne-soft); color:var(--champagne); }
.focus-refs { color:var(--muted); }
.curriculum-point-list li,.curriculum-point-list small { border-color:var(--line); }

@media(hover:hover) {
 .chapter-row:hover,.unit-list button:hover,.exam-compact-list .exam-row:hover,.dictionary-row:hover,.home-quick-actions button:hover,.practice-actions .practice-mode:hover { background:var(--elevated); border-color:var(--teal-500); box-shadow:var(--shadow-sm); }
}

 }
}

/* Public privacy policy */
.site-signature a,.privacy-footer a { color:var(--teal-700); font-size:12px; font-weight:700; text-decoration:underline; text-decoration-color:color-mix(in srgb,var(--teal-700) 35%,transparent); text-underline-offset:3px; }
.privacy-body { min-height:100vh; padding:0; background:var(--paper); }
.privacy-header { position:sticky; z-index:20; top:0; display:flex; align-items:center; justify-content:space-between; gap:16px; min-height:70px; padding-inline:max(18px,calc((100vw - 980px)/2)); border-bottom:1px solid var(--line); background:color-mix(in srgb,var(--header) 94%,transparent); backdrop-filter:blur(16px); }
.privacy-brand { display:flex; align-items:center; gap:10px; color:var(--ink); text-decoration:none; }
.privacy-brand>span:last-child strong,.privacy-brand>span:last-child small { display:block; }
.privacy-brand>span:last-child strong { font-size:16px; letter-spacing:-.02em; }
.privacy-brand>span:last-child small { margin-top:1px; color:var(--muted); font-size:10px; letter-spacing:.05em; }
.privacy-back { min-height:44px; display:flex; align-items:center; padding:8px 12px; border:1px solid var(--line); border-radius:12px; color:var(--teal-700); background:var(--surface); font-size:13px; font-weight:750; text-decoration:none; }
.privacy-page { width:min(calc(100% - 36px),880px); margin:0 auto; padding:48px 0 56px; }
.privacy-intro { padding:32px; border:1px solid var(--line); border-radius:26px; background:var(--ivory); box-shadow:var(--shadow-sm); }
.privacy-intro>span { color:var(--teal-700); font-size:11px; font-weight:800; letter-spacing:.15em; }
.privacy-intro h1 { margin:9px 0 12px; color:var(--ink); font-size:clamp(32px,6vw,46px); line-height:1.12; letter-spacing:-.045em; }
.privacy-intro p { max-width:720px; margin:0; color:var(--muted); font-size:16px; line-height:1.75; }
.privacy-intro small { display:block; margin-top:18px; color:var(--subtle); font-size:12px; }
.privacy-content { max-width:760px; margin:38px auto 0; }
.privacy-content section { padding:25px 0; border-bottom:1px solid var(--line); }
.privacy-content section:first-child { padding-top:0; }
.privacy-content h2 { margin:0 0 12px; color:var(--ink); font-size:20px; line-height:1.35; letter-spacing:-.025em; }
.privacy-content p,.privacy-content li { color:var(--muted); font-size:15px; line-height:1.8; }
.privacy-content p { margin:0; }
.privacy-content p+p,.privacy-content ul+p { margin-top:12px; }
.privacy-content ul { margin:12px 0; padding-left:22px; }
.privacy-content code { padding:2px 5px; border-radius:5px; color:var(--teal-700); background:var(--teal-soft); font:600 13px ui-monospace,SFMono-Regular,monospace; }
.privacy-contact { display:inline-flex; min-height:44px; align-items:center; margin-top:12px; padding:8px 13px; border:1px solid var(--line); border-radius:11px; color:var(--teal-700); background:var(--surface); font-weight:750; text-decoration:none; }
.privacy-footer { display:flex; width:min(calc(100% - 36px),880px); margin:0 auto; padding:24px 0 max(32px,env(safe-area-inset-bottom)); border-top:1px solid var(--line); flex-direction:column; gap:5px; }
.privacy-footer strong { color:var(--ink); font-size:13px; }
.privacy-footer span { color:var(--muted); font-size:12px; }
.home-resources { width:min(100%,980px); margin:38px auto 0; }
.home-resources nav { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:10px; }
.home-resources a { min-width:0; min-height:86px; display:flex; flex-direction:column; justify-content:center; padding:14px; border:1px solid var(--line); border-radius:15px; color:var(--ink); background:var(--surface); text-decoration:none; }
.home-resources strong { color:var(--teal-700); font-size:13px; line-height:1.4; }
.home-resources small { margin-top:5px; color:var(--muted); font-size:11px; line-height:1.45; }
@media(max-width:560px) {
  .privacy-header { min-height:62px; padding-inline:14px; }
  .privacy-header .brand-mark { width:34px; height:34px; }
  .privacy-back { padding-inline:10px; font-size:12px; }
  .privacy-page { width:calc(100% - 28px); padding:22px 0 38px; }
  .privacy-intro { padding:23px 18px; border-radius:20px; }
  .privacy-intro h1 { font-size:31px; }
  .privacy-intro p { font-size:14.5px; line-height:1.7; }
  .privacy-content { margin-top:24px; }
  .privacy-content section { padding:21px 2px; }
  .privacy-content h2 { font-size:18px; }
  .privacy-content p,.privacy-content li { font-size:14px; line-height:1.75; }
  .privacy-footer { width:calc(100% - 28px); }
  .home-resources { margin-top:28px; }
  .home-resources nav { grid-template-columns:1fr; gap:8px; }
  .home-resources a { min-height:66px; }
}
