:root {
  color-scheme: light;
  --ink: #181d26; --body: #333840; --muted: #62656a; --line: #ddd; --soft: #f8fafc;
  --cream: #f5e9d4; --mint: #a8d8c4; --peach: #fcab79; --yellow: #f4d35e; --forest: #0a2e0e; --coral: #aa2d00;
  font-family: "Helvetica Neue", Helvetica, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  font-size: 15px; color: var(--body); background: #fff; font-synthesis: none;
}
* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; }
body { line-height: 1.5; }
button, input, select, textarea { font: inherit; color: inherit; }
button, input, select, textarea, a { -webkit-tap-highlight-color: transparent; }
button { min-height: 44px; padding: 9px 17px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); cursor: pointer; font-weight: 500; line-height: 1.35; }
button:hover:not(:disabled) { background: var(--soft); border-color: #b6b9bc; }
button:disabled { cursor: default; opacity: .45; }
button.primary { color: #fff; background: var(--ink); border-color: var(--ink); }
button.primary:hover:not(:disabled) { background: #333840; border-color: #333840; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible, summary:focus-visible { outline: 2px solid #0065ff; outline-offset: 3px; }
input, select, textarea { min-width: 0; width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
input[type="checkbox"] { flex: 0 0 17px; width: 17px; min-height: 17px; height: 17px; margin: 0; accent-color: var(--ink); }
textarea { resize: vertical; min-height: 88px; line-height: 1.55; }
label { display: grid; gap: 7px; font-size: 13px; }
svg { flex-shrink: 0; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
a { color: inherit; text-underline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { color: var(--ink); font-weight: 500; }
h1 { font-size: 22px; line-height: 1.25; letter-spacing: -.7px; }
h2 { font-size: 24px; letter-spacing: -.7px; }
h3, legend { font-size: 15px; color: var(--ink); font-weight: 500; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.muted { color: var(--muted); font-size: 13px; }
.eyebrow { font-size: 10px; letter-spacing: .5px; color: var(--muted); margin-bottom: 3px; }

.app-shell { height: 100vh; height: 100dvh; display: grid; grid-template-rows: 88px minmax(0, 1fr) 48px; overflow: hidden; }
.topbar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 0 40px; border-bottom: 1px solid #e9eaeb; gap: 24px; }
.brand { display: flex; align-items: center; gap: 13px; }
.brand-mark { display: block; position: relative; width: 29px; height: 34px; border: 1px solid #ddcfb6; border-radius: 4px; background: #fffcf5; transform: rotate(-7deg); }
.brand-mark::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 9px; background: var(--cream); border-radius: 3px 3px 0 0; }
.brand-mark span, .brand-mark span::after { position: absolute; width: 15px; height: 1px; background: #c6bba6; left: 6px; top: 17px; content: ""; }
.brand-mark span::after { left: 0; top: 5px; width: 11px; }
.tabs { display: flex; align-items: center; gap: 4px; }
button.tab { position: relative; border-color: transparent; border-radius: 8px; padding: 10px 19px; color: var(--muted); background: transparent; }
button.tab.active { color: var(--ink); background: #f3f4f5; }
.settings-button { display: flex; align-items: center; gap: 9px; justify-self: end; }
.header-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; min-width: 0; }
.account-button { max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: var(--soft); font-size: 13px; }
.layout { min-height: 0; padding: 14px 40px 0; }
.study-panel { height: 100%; min-height: 0; display: flex; flex-direction: column; max-width: 1120px; margin: 0 auto; }
.tab-view { display: none; flex: 1; min-height: 0; }
.tab-view.active { display: flex; flex-direction: column; }
.view-toolbar { display: flex; flex-shrink: 0; min-height: 52px; align-items: center; justify-content: space-between; gap: 16px; }
.view-summary { font-size: 13px; color: var(--muted); }
.toolbar-actions, .quiz-actions { display: flex; align-items: center; gap: 16px; }
.counter { color: var(--ink); font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
button.quiet-button { border-color: transparent; display: flex; align-items: center; gap: 8px; padding: 8px 11px; font-size: 13px; }
button.text-button { min-height: 44px; border-color: transparent; background: transparent; padding: 8px 0; font-size: 13px; text-decoration: underline; text-underline-offset: 4px; }
.status-card { flex-shrink: 0; max-height: 64px; overflow: auto; padding: 10px 14px; color: var(--forest); background: #eef7f2; border: 1px solid #d5e9dd; border-radius: 8px; font-size: 13px; }

.card-stage { flex: 1; min-height: 0; display: flex; justify-content: center; align-items: stretch; padding: 8px 12px 12px; overflow: hidden; }
.voca-card { --note-band: var(--cream); --paper: #fffcf5; flex-shrink: 1; position: relative; width: min(720px, 100%); min-height: 0; display: flex; flex-direction: column; background: var(--paper); border: 1px solid #e5ddcd; border-radius: 12px; box-shadow: 0 3px 5px #30271908, 0 14px 28px -19px #3027194d; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; cursor: pointer; }
.voca-card[data-tone="mint"] { --note-band: var(--mint); --paper: #f7fcf9; border-color: #cce2d6; }
.voca-card[data-tone="peach"] { --note-band: var(--peach); --paper: #fffaf6; border-color: #ead8cb; }
.source-line { display: flex; flex-shrink: 0; flex-wrap: wrap; align-items: center; column-gap: 13px; row-gap: 7px; min-height: 52px; padding: 12px 88px 12px 25px; margin: 0; font-size: 12px; order: -1; background: var(--note-band); color: #514a3d; border-bottom: 1px solid #181d2608; }
.source-line a { white-space: nowrap; }
.pill { font-size: 12px; }
.review { font-size: 11px; color: var(--coral); }
.source-link { color: #52554f; font-size: 12px; }
.word-line { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 28px 0; }
.word { font-family: "Bradley Hand", "Noteworthy", "Segoe Print", "Comic Sans MS", cursive; font-size: 38px; line-height: 1.22; font-weight: 400; color: #272b2d; overflow-wrap: anywhere; letter-spacing: -.6px; }
.stars { position: absolute; right: 24px; top: 16px; color: #6c5730; letter-spacing: 2px; font-size: 13px; line-height: 20px; }
.voca-card[data-view="word"] .word-line { flex: 1; justify-content: center; text-align: center; padding: 30px 32px; }
.voca-card[data-view="word"] .word { font-size: clamp(46px, 5.2vw, 76px); line-height: 1.25; }
.voca-card > .muted { flex-shrink: 0; text-align: center; font-size: 12px; padding: 16px 24px 26px; }
.sense-list { list-style: none; display: grid; grid-template-columns: 1fr; gap: 22px; padding: 22px 28px 30px; margin: 0; }
.sense { min-width: 0; display: grid; grid-template-columns: 22px minmax(0, 1fr); align-content: start; gap: 9px; }
.sense-number { font-size: 12px; line-height: 25px; color: #847661; }
.meaning { font-size: 18px; font-weight: 500; line-height: 1.5; color: var(--ink); word-break: keep-all; overflow-wrap: anywhere; }
.example { margin-top: 13px; font-size: 15px; line-height: 1.65; color: #41454d; overflow-wrap: anywhere; }
.synonyms { margin-top: 11px; font-size: 13px; color: #5b605c; line-height: 1.65; overflow-wrap: anywhere; }
.voca-card[data-sense-count="2"] .sense-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.voca-card[data-sense-count="3"] .sense-list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 19px; }
.voca-card[data-sense-count="3"] .sense { grid-template-columns: 1fr; gap: 3px; border-top: 1px solid #b7b1a344; padding-top: 9px; }
.voca-card[data-view="meanings"] .sense-list { flex: 1; align-content: center; grid-template-columns: 1fr; padding: 30px 40px; gap: 22px; }
.voca-card[data-view="meanings"] .sense { grid-template-columns: 22px minmax(0, 1fr); border: 0; padding: 0; }
.voca-card[data-view="meanings"] .meaning { font-size: 25px; }
.card-navigation { display: flex; justify-content: center; align-items: center; gap: 12px; flex-shrink: 0; }
.card-navigation button { min-width: 104px; }
.card-navigation .primary { min-width: 160px; }
.card-navigation button span { margin: 0 6px; }
.keyboard-hint { flex-shrink: 0; padding: 15px 0 12px; color: #7b7e81; text-align: center; font-size: 11px; }
.keyboard-hint span { padding: 0 6px; }
.app-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 40px; font-size: 11px; color: var(--muted); }
.summary-strip { display: flex; gap: 20px; font-variant-numeric: tabular-nums; }
.summary-strip span + span { position: relative; }
.summary-strip span + span::before { content: ""; height: 9px; width: 1px; background: #d6d8da; position: absolute; left: -10px; top: 4px; }

.quiz-toolbar { padding-bottom: 14px; min-height: 80px; }
.quiz-summary-block { min-width: 0; }
.quiz-summary-block .text-button { min-height: 28px; padding: 3px 0; font-size: 12px; }
.quiz-actions { gap: 8px; flex-shrink: 0; }
.quiz-actions button { font-size: 13px; }
.quiz-empty { flex: 1; min-height: 0; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: 17px; padding: 20px 16px 60px; overflow: auto; }
.quiz-empty h2 { font-size: 24px; }
.quiz-empty p { font-size: 14px; line-height: 1.8; color: var(--muted); }
.empty-note { width: 158px; min-height: 136px; padding: 31px 25px 24px; background: #fffcf5; border: 1px solid #e5ddcd; border-top: 26px solid var(--cream); border-radius: 9px; transform: rotate(-6deg); margin-bottom: 18px; box-shadow: 0 8px 17px -14px #30271977; }
.empty-note span { font-family: "Bradley Hand", "Noteworthy", cursive; font-size: 29px; color: #62533f; }
.empty-note i { display: block; height: 1px; width: 84%; background: #e2d8c5; margin-top: 12px; }
.empty-note i:last-child { width: 64%; }
.quiz-card { flex: 1; min-height: 0; width: min(850px, 100%); align-self: center; padding: 28px 32px 0; margin: 0 0 12px; overflow: auto; overscroll-behavior: contain; border: 1px solid var(--line); border-radius: 12px; scrollbar-width: thin; }
.question-top { display: flex; justify-content: space-between; gap: 14px; font-size: 12px; color: var(--muted); }
.prompt { font-size: 31px; color: var(--ink); line-height: 1.45; margin-top: 24px; overflow-wrap: anywhere; }
.context { color: var(--muted); font-size: 14px; margin-top: 12px; line-height: 1.6; }
.options { display: flex; flex-direction: column; gap: 10px; margin-top: 25px; counter-reset: choices; }
.option { display: flex; align-items: center; gap: 12px; min-height: 64px; text-align: left; font-size: 15px; font-weight: 400; padding: 14px 16px; overflow-wrap: anywhere; }
.option::before { counter-increment: choices; content: counter(choices, upper-alpha); display: grid; place-items: center; width: 25px; height: 25px; flex: 0 0 25px; border: 1px solid #d9dcdf; border-radius: 5px; font-size: 11px; color: var(--muted); }
.option.selected { border-color: var(--ink); background: #f5f5f4; box-shadow: inset 0 0 0 1px var(--ink); }
.option.correct { border-color: #7caa8b; background: #edf6ee; color: var(--forest); }
.option.correct::before { content: "✓"; border-color: #7caa8b; color: var(--forest); }
.option.wrong { border-color: #c78872; background: #fff1e9; color: var(--coral); }
.option.wrong::before { content: "×"; border-color: #c78872; color: var(--coral); }
.feedback { padding: 16px 18px; border-left: 3px solid #7caa8b; background: #f1f7f2; font-size: 14px; margin-top: 22px; overflow-wrap: anywhere; }
.feedback strong { font-weight: 500; color: var(--forest); }
.feedback.wrong { background: #fff6ef; border-color: #c78872; }
.feedback.wrong strong { color: var(--coral); }
.feedback p { margin-top: 7px; white-space: pre-line; line-height: 1.65; }
.nav-row { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 20px 0; }
.quiz-card .nav-row { position: sticky; bottom: 0; background: #fff; margin-top: 8px; }
.nav-row button { min-width: 90px; }
.quiz-card > .muted { padding: 10px 0 30px; font-size: 15px; }

.dictionary-toolbar { display: flex; align-items: center; gap: 12px; padding: 9px 0 22px; flex-shrink: 0; }
.dictionary-toolbar label { flex: 1; }
.dictionary-toolbar label:last-child { flex: 0 0 120px; }
.voca-card { touch-action: pan-y; }
.dictionary-toolbar input { background: var(--soft); }
.dictionary-toolbar button { flex-shrink: 0; font-size: 13px; }
.dictionary-list { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 0 8px 12px 0; margin-bottom: 12px; scrollbar-width: thin; }
.dictionary-count { padding: 2px 0 16px; font-size: 12px; color: var(--muted); }
.dict-entry { border-bottom: 1px solid #e6e7e8; }
.dict-entry:first-of-type { border-top: 1px solid #e6e7e8; }
.dict-entry summary { padding: 17px 16px; min-height: 58px; cursor: pointer; font-size: 19px; color: var(--ink); overflow-wrap: anywhere; }
.dict-entry summary::marker { color: #9caaa1; font-size: 13px; }
.dict-entry[open] { padding-bottom: 15px; background: #fafcfb; }
.dict-entry[open] summary { padding-bottom: 10px; }
.dict-meta { display: flex; flex-wrap: wrap; gap: 14px; padding: 0 18px 15px; color: var(--muted); }
.edit-grid { display: grid; grid-template-columns: 1fr 2fr; gap: 12px; margin: 0 18px 22px; padding-top: 16px; border-top: 1px solid #e1e7e3; }
.wide { grid-column: 1 / -1; }
.entry-actions { display: flex; align-items: center; gap: 8px; }
.entry-actions button { font-size: 13px; }

.settings-dialog { width: min(700px, calc(100% - 40px)); max-height: calc(100dvh - 48px); padding: 0; margin: auto; border: 1px solid #d9dcdf; border-radius: 14px; color: var(--body); background: #fff; box-shadow: 0 20px 80px #181d261a; overflow: hidden; }
.settings-dialog[open] { display: flex; flex-direction: column; }
.settings-dialog::backdrop { background: #181d264d; }
.dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 24px 28px 21px; border-bottom: 1px solid #e8eaec; flex-shrink: 0; }
.dialog-header h2 { font-size: 25px; }
.icon-button { display: grid; place-items: center; padding: 10px; width: 44px; height: 44px; border-color: transparent; }
.dialog-body { min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 0 28px; scrollbar-width: thin; }
.panel-section { padding: 22px 0; border-bottom: 1px solid #e9eaec; }
.panel-section:last-child { border-bottom: 0; }
.section-heading { display: flex; align-items: center; justify-content: space-between; margin-top: -9px; }
.day-selection-actions { display: flex; align-items: center; gap: 18px; }
.range-row { display: flex; align-items: end; gap: 12px; margin: 7px 0 16px; }
.range-row label { flex: 1; }
.range-row > span { line-height: 44px; color: #9b9da0; }
.day-grid { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 7px; }
.day-button { padding: 8px 0; min-height: 44px; font-size: 13px; border-radius: 8px; }
.day-button.active { color: var(--forest); background: #e1f1e9; border-color: #bbd7c8; }
.check-row { display: flex; flex-wrap: wrap; gap: 0 23px; margin-top: 8px; }
.check-row label, .switch { display: flex; align-items: center; gap: 8px; min-height: 44px; cursor: pointer; font-size: 13px; }
.importance-options label:not(:last-child) { color: #756039; }
.direction-section { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.direction-section .muted { font-size: 12px; margin-top: 4px; }
.switch { flex-shrink: 0; }
fieldset { padding: 0; margin: 0; border: 0; min-width: 0; }
legend { padding: 0; }
.quiz-settings-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 16px; }
.quiz-count-input { display: flex; gap: 7px; margin-top: 7px; }
.quiz-count-input input { flex: 1; }
.quiz-count-input button { flex-shrink: 0; padding: 9px 12px; }
.field-help { margin-top: 12px; font-size: 13px; line-height: 1.7; color: var(--muted); }
.meter { height: 5px; overflow: hidden; border-radius: 3px; background: #edf1ee; margin: 14px 0 10px; }
.meter span { display: block; height: 100%; width: 0; background: #8bb49d; border-radius: inherit; }
.source-status { margin-top: 13px; font-size: 11px; line-height: 1.7; color: #787b7f; }
.dialog-footer { display: flex; flex-shrink: 0; align-items: center; justify-content: space-between; gap: 16px; padding: 17px 28px; border-top: 1px solid #e8eaec; background: #fff; }
.dialog-footer span { font-size: 12px; color: var(--muted); }
.dialog-footer button { min-width: 94px; }
.auth-view { height: 100vh; height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 24px; overflow: auto; }
.auth-paper { width: min(440px, 100%); max-height: 100%; overflow: auto; border: 1px solid #e5ddcd; border-radius: 14px; background: #fff; }
.auth-heading { padding: 25px 28px 22px; background: var(--cream); border-bottom: 1px solid #e5ddcd; }
.auth-heading h1 { font-size: 28px; }
.auth-heading > p:last-child { margin-top: 10px; font-size: 14px; color: #625744; }
#authForm { padding: 22px 28px 10px; }
#authFields > label { font-size: 14px; margin-top: 16px; }
.password-field { position: relative; margin-top: 7px; }
.password-field input { padding-inline-end: 50px; }
.password-toggle { position: absolute; top: 0; inset-inline-end: 0; width: 44px; height: 100%; padding: 0; display: grid; place-items: center; border: 0; border-radius: 0 8px 8px 0; background: transparent; color: var(--muted); }
.password-toggle[aria-pressed="false"] .password-slash { display: none; }
.password-toggle[aria-pressed="true"] { color: var(--ink); }
.auth-mode { display: flex; gap: 8px; }
.auth-mode button { flex: 1; }
.auth-mode button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.auth-submit { width: 100%; margin-top: 22px; }
.auth-message { margin-top: 12px; min-height: 24px; font-size: 14px; color: var(--coral); }
.auth-local-note { padding: 0 28px 24px; font-size: 12px; color: var(--muted); }
.account-dialog { width: min(460px, calc(100% - 24px)); }
#accountDialogName { font-size: 22px; overflow-wrap: anywhere; }
#importLegacy { margin-top: 14px; }

@media (max-width: 760px) {
  .app-shell { grid-template-rows: calc(66px + env(safe-area-inset-top)) minmax(0, 1fr); padding-bottom: calc(65px + env(safe-area-inset-bottom)); }
  .topbar { padding: env(safe-area-inset-top) 18px 0; grid-template-columns: 1fr auto; grid-template-rows: 1fr; gap: 12px; }
  .brand { gap: 10px; }
  .brand-mark { width: 25px; height: 29px; }
  .brand-mark span { width: 12px; left: 5px; top: 15px; }
  h1 { font-size: 20px; }
  .eyebrow { font-size: 9px; }
  .tabs { position: fixed; bottom: 0; left: 0; right: 0; z-index: 10; min-height: calc(65px + env(safe-area-inset-bottom)); padding: 7px 12px calc(7px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
  button.tab { padding: 10px 5px; min-height: 50px; font-size: 14px; }
  .settings-button { grid-column: 2; grid-row: 1; padding: 9px 12px; font-size: 13px; }
  .header-actions { grid-column: 2; grid-row: 1; gap: 5px; }
  .account-button { max-width: 78px; padding: 9px; font-size: 12px; }
  .layout { padding: 7px 18px 0; }
  .view-toolbar { min-height: 49px; gap: 8px; }
  .view-summary { font-size: 11px; }
  .toolbar-actions { gap: 5px; }
  .counter { font-size: 11px; }
  button.quiet-button { font-size: 12px; padding: 8px 5px; gap: 5px; }
  .quiet-button svg { width: 17px; height: 17px; }
  .card-stage { padding: 3px 0 8px; }
  .voca-card { max-width: 540px; }
  .source-line { padding: 12px 67px 12px 18px; gap: 6px 10px; font-size: 11px; min-height: 48px; }
  .source-line .pill, .source-line .source-link { font-size: 11px; }
  .stars { right: 17px; top: 15px; font-size: 11px; letter-spacing: 1px; }
  .word-line { padding: 20px 22px 0; }
  .word { font-size: 34px; }
  .voca-card[data-view="word"] .word { font-size: clamp(44px, 10vw, 65px); }
  .voca-card > .muted { display: none; }
  .voca-card:not([data-view]) > .muted { display: block; }
  .sense-list, .voca-card[data-sense-count="2"] .sense-list, .voca-card[data-sense-count="3"] .sense-list { grid-template-columns: 1fr; padding: 22px; gap: 21px; }
  .voca-card[data-sense-count="3"] .sense { grid-template-columns: 22px minmax(0, 1fr); border: 0; padding: 0; gap: 8px; }
  .meaning { font-size: 17px; }
  .example { font-size: 14px; margin-top: 8px; }
  .synonyms { font-size: 12px; margin-top: 8px; }
  .voca-card[data-view="meanings"] .sense-list { padding: 24px; }
  .voca-card[data-view="meanings"] .meaning { font-size: 22px; }
  .card-navigation { gap: 9px; }
  .card-navigation button { min-width: 0; flex: 1; max-width: 115px; font-size: 13px; padding: 10px 9px; }
  .card-navigation .primary { min-width: 0; flex: 1.4; max-width: 155px; }
  .card-navigation button span { margin: 0 3px; }
  .keyboard-hint, .app-footer { display: none; }
  .card-navigation { padding-bottom: 7px; }
  .card-navigation #flipCard { display: none; }
  .footer-label { display: none; }
  .summary-strip { gap: 20px; }
  .quiz-toolbar { min-height: 85px; padding-bottom: 12px; }
  .quiz-summary-block .text-button { font-size: 11px; }
  .quiz-actions { gap: 6px; }
  .quiz-actions button { padding: 9px 10px; font-size: 12px; }
  .quiz-empty { padding: 12px 0 25px; gap: 13px; }
  .quiz-empty h2 { font-size: 20px; }
  .quiz-empty p { font-size: 13px; }
  .empty-note { width: 136px; min-height: 123px; padding: 21px 21px 19px; margin-bottom: 12px; }
  .quiz-card { padding: 20px 20px 0; margin-bottom: 6px; }
  .question-top { font-size: 11px; gap: 7px; }
  .prompt { font-size: 25px; margin-top: 21px; }
  .context { font-size: 13px; }
  .options { gap: 8px; margin-top: 16px; }
  .option { align-items: center; gap: 10px; }
  .option { min-height: 54px; padding: 11px 13px; font-size: 14px; }
  .feedback { padding: 12px; font-size: 13px; }
  .nav-row { padding: 14px 0; }
  .dictionary-toolbar { padding: 7px 0 16px; gap: 8px; }
  .dictionary-toolbar button { padding: 9px 10px; font-size: 12px; }
  .dictionary-toolbar input { font-size: 14px; }
  input, select, textarea { font-size: 16px; }
  .dict-entry summary { font-size: 18px; padding: 14px 10px; }
  .dict-meta { padding: 0 12px 13px; gap: 9px; }
  .edit-grid { grid-template-columns: 1fr; margin: 0 12px 20px; }
  .settings-dialog { width: calc(100% - 24px); max-height: calc(100dvh - 24px); border-radius: 12px; }
  .dialog-header { padding: 19px 20px 17px; }
  .dialog-header h2 { font-size: 23px; }
  .dialog-body { padding: 0 20px; }
  .day-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 7px; }
  .check-row { gap: 0 17px; }
  .quiz-type-options { display: grid; grid-template-columns: 1fr 1fr; }
  .direction-section { align-items: flex-start; flex-direction: column; gap: 7px; }
  .dialog-footer { padding: 14px 20px; }
  .dialog-footer span { font-size: 11px; }
  .auth-view { padding: calc(12px + env(safe-area-inset-top)) 12px calc(12px + env(safe-area-inset-bottom)); }
  .auth-heading { padding: 22px; }
  #authForm { padding: 18px 22px 8px; }
  .auth-local-note { padding: 0 22px 22px; }
}
@media (max-width: 370px) {
  .topbar { padding-left: 15px; padding-right: 15px; }
  .layout { padding-left: 12px; padding-right: 12px; }
  button.tab { padding-left: 16px; padding-right: 16px; }
  .card-toolbar { flex-wrap: wrap; gap: 0; min-height: 62px; }
  .card-toolbar .view-summary { flex-basis: 100%; }
  .card-toolbar .toolbar-actions { width: 100%; justify-content: space-between; }
  .card-toolbar .quiet-button { min-height: 30px; padding: 4px; }
  .card-stage { padding-top: 3px; padding-bottom: 8px; }
  .keyboard-hint { font-size: 9px; }
  .keyboard-hint span { padding: 0 3px; }
  .quiz-toolbar { align-items: flex-start; flex-direction: column; gap: 7px; padding-top: 6px; }
  .quiz-summary-block { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 8px; }
  .quiz-actions { width: 100%; justify-content: flex-end; }
  .quiz-card { padding-left: 16px; padding-right: 16px; }
  .quiz-empty h2 { font-size: 18px; }
  .quiz-empty p { font-size: 12px; }
  .empty-note { margin-top: 10px; }
  .source-line { padding-left: 15px; gap: 6px 8px; }
  .dialog-body { padding: 0 16px; }
  .dialog-header, .dialog-footer { padding-left: 16px; padding-right: 16px; }
}
@media (max-height: 660px) and (min-width: 761px) {
  .app-shell { grid-template-rows: 72px minmax(0, 1fr) 32px; }
  .layout { padding-top: 4px; }
  .card-stage { padding-top: 9px; padding-bottom: 17px; }
  .keyboard-hint { padding: 9px 0 3px; }
  .quiz-toolbar { min-height: 66px; }
  .empty-note { margin-bottom: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
