/* The default study environment: quiet charcoal, lifted cards, restrained accents. */
:root {
  color-scheme: dark;
  --canvas: #171d1b;
  --sidebar: #1b221f;
  --surface: #202924;
  --surface-raised: #27322b;
  --surface-hover: #303e33;
  --line: #3c4c3f;
  --line-soft: #334035;
  --text: #dce3d8;
  --muted: #adbaa3;
  --subtle: #9eae93;
  --accent: #9eb9ff;
  --accent-surface: #253454;
  --green: #b0cd99;
  --green-surface: #2b3b29;
  --amber: #dec18d;
  --amber-surface: #3a3225;
  --rose: #e4a6b9;
  --rose-surface: #3c2c31;
  --blue: #9dbef0;
}
html, body { background: var(--canvas); color: var(--text); }
body { scrollbar-color: #586b51 var(--canvas); }
::selection { background: #405c8a; color: #edf2ff; }
input, textarea { caret-color: var(--accent); }
:focus-visible { outline-color: var(--accent); }
a { text-underline-offset: .25em; }
.sidebar { background: var(--sidebar); border-color: var(--line-soft); }
.topbar, footer, .filter-bar { border-color: var(--line-soft); }
.brand b, .intro h1, .daily-plan h3, .setting-block h3,
.dialog-header h2, .editor-dialog h3, .plan-item b { color: var(--text); }
.brand-icon { background: #3962c9; color: #f4f6ff; }
.plant, footer i { color: var(--green); }
.brand-icon > span { color: #eff2d3; }
.sidebar-label, .brand small, .book-link small, .sidebar-bottom > p,
.sidebar-bottom .text-button, .intro p, .breadcrumb, .breadcrumb > strong,
.local-badge, .date-badge, .date-badge .icon, .eyebrow, footer,
footer > span:first-child { color: var(--muted); }
.sidebar-bottom .text-button { border-color: var(--line); }
.local-badge > i { background: var(--green); }
.nav-item { color: var(--muted); }
.nav-item:hover, .book-link:hover, .book-link.selected { background: var(--surface-raised); }
.nav-item.active { background: var(--accent-surface); color: var(--accent); }
.nav-dot { background: var(--accent); }
.nav-count { border-color: var(--line); }
.book-link > .icon { color: var(--muted); }
.level-a1 { background: #493729; color: #e2b48f; }
.level-a2 { background: #34412c; color: #b9cf9d; }
.level-b1 { background: #2c3d45; color: #a5c7d9; }
.book-chip { border-right-color: #ffffff16; }
.intro h1 > span { color: var(--accent); }
.stat { background: var(--surface); border-color: var(--line-soft); }
.stat > div > b { color: var(--text); font-variant-numeric: tabular-nums; }
.stat > div > span, .stat b > small, .stat-hint { color: var(--muted); }
.stat-icon.blue { background: var(--accent-surface); color: var(--accent); }
.stat-icon.amber { background: var(--amber-surface); color: var(--amber); }
.goal-ring { background: conic-gradient(from 0deg, #91ac79 var(--progress), #3b4935 0); }
.goal-ring::before { background: var(--surface); }
.goal-ring > span { color: var(--green) !important; }
.goal-done { color: var(--green); }
.level-tabs, .tense-tabs { background: var(--surface); }
.level-tabs button, .tense-tabs button { color: var(--muted); }
.level-tabs button.active, .tense-tabs button.active {
  background: var(--surface-hover); color: #e2eadc; box-shadow: none;
}
.filter-selects select, .setting-row select {
  background: var(--surface); color: var(--text); border-color: var(--line);
}
select option { background: var(--surface); color: var(--text); }
.mode-tabs button, .toolbar-actions .text-button, .text-button,
.study-heading h2 > span, .study-heading > span, .study-heading i,
.keyboard-hint, .card-tags { color: var(--muted); }
.mode-tabs button.active { color: var(--green); border-color: var(--green); }
.text-button:hover { color: var(--accent); }
.study-heading h2 > span { border-color: var(--line); }
.session-progress, .long-progress { background: var(--line-soft); }
.session-progress > span, .long-progress i { background: #92ad7b; }
.flashcard, .word-tile, .panel {
  background: var(--surface); border-color: var(--line); box-shadow: none;
}
.flashcard::before { border-color: var(--line); }
.level-tag { background: var(--surface-raised); color: var(--muted); }
.tag-divider { background: var(--line); }
.icon-button { color: var(--muted); }
.icon-button:hover { background: var(--surface-hover); color: var(--accent); }
.bookmark-button.saved { color: var(--amber); }
.bookmark-button.saved svg { fill: #dec18d24; }
.front-eyebrow { color: var(--subtle); }
.front-word, .back-word strong, .tile-open > strong { color: var(--accent); }
.front-instruction, .card-front-footer, .card-front-footer > span:last-child { color: var(--muted); }
.card-front-footer, .tile-footer { border-color: var(--line); }
.reveal-cta { background: var(--accent-surface); color: var(--accent); border-color: #526a9d; }
.card-front:hover .reveal-cta { background: #2e416c; }
.rating-title, .rating-title .text-button { color: var(--muted); }
.rating-1 { background: #3c2d28; color: #e2b39e; border-color: #7e5846; }
.rating-2 { background: var(--amber-surface); color: var(--amber); border-color: #776548; }
.rating-3 { background: var(--green-surface); color: var(--green); border-color: #5d7749; }
.rating-4 { background: var(--accent-surface); color: var(--accent); border-color: #526a9d; }
.rating:enabled:hover { box-shadow: 0 5px 12px #00000030; filter: brightness(1.1); }
kbd { background: var(--surface-raised); border-color: #677a5c; color: var(--muted); }
.rating kbd { opacity: .7; }
.encouragement { background: #263323; }
.encouragement h3 { color: #d6e6c7; }
.encouragement p, .tiny-label { color: #b0c39d; }
.ill-card { background: #35462e; border-color: #658153; color: #b0cd99; box-shadow: 0 3px 6px #00000025; }
.ill-two { background: #3d3c2a; color: #d9c28c; }
.ill-three { background: #2f3c30; color: #b8cc9b; }
.ill-spark { color: #a9c58f; }
.section-mini-title .icon, .plan-item small, .article-guide h3,
.article-guide > div > span:not(.gender-dot), .coverage-note { color: var(--muted); }
.plan-item > span { background: var(--surface); border-color: #627954; color: var(--green); }
.plan-item.done > span { background: var(--green-surface); color: var(--green); border-color: #78965e; }
.plan-item:not(:last-child)::after { background: var(--line); }
.article-guide { border-color: var(--line); }
.gender-dot.der { background: var(--blue); }
.gender-dot.die { background: var(--rose); }
.gender-dot.das { background: var(--green); }
.back-word h2 { color: var(--text); }
.article-der { color: var(--blue) !important; }
.article-die { color: var(--rose) !important; }
.article-das { color: var(--green) !important; }
.pronunciation > span, .section-mini-title > span { color: var(--muted); }
.listen-button { color: var(--green); }
.grammar-pills > span, .past-forms > div {
  background: var(--surface-raised); color: var(--muted); border-color: var(--line);
}
.grammar-pills b, .past-forms strong { color: var(--text); }
.past-forms span, .conjugation .section-mini-title h3, .examples h3 { color: var(--muted); }
.conjugation-grid > div { border-color: var(--line-soft); }
.conjugation-grid span { color: var(--muted); }
.conjugation-grid strong { color: var(--text); }
.grammar-note { background: var(--amber-surface); color: var(--amber); }
.examples, .example { border-color: var(--line-soft); }
.example p[lang=de] { color: var(--text); }
.example p:not([lang]), .example-number, .source-line { color: var(--muted); }
.button.primary { background: #3862cb; color: #f5f7ff; border-color: #6b8be0; }
.button.primary:hover { background: #3d66cf; }
.button.secondary { background: var(--surface-raised); border-color: #627755; color: #d6e3cb; }
.button.secondary:hover { background: var(--surface-hover); }
.empty-state > span { color: var(--green); }
.empty-state h2 { color: var(--text); }
.empty-state p, .library-note, .result-count { color: var(--muted); }
.search-box { background: var(--surface); border-color: var(--line); }
.search-box:focus-within { outline-color: #89aaf2; }
.search-box .icon, .search-box input, .tile-open > span, .tile-footer { color: var(--muted); }
.search-box input::placeholder { color: var(--muted); opacity: 1; }
.word-tile:hover { border-color: #718960; box-shadow: none; }
.panel h2, .mastery-number { color: var(--green); }
.chart-track { border-color: var(--line); }
.chart-track > i { background: #536a45; }
.chart-track > i.today { background: #a3bf88; }
.chart-column > span, .chart-column > small, .mastery-number small,
.mastery-panel > p, .mastery-legend, .level-progress-row > span:last-child,
.review-history > div > span:nth-child(2), .review-history time, .no-history { color: var(--muted); }
.review-history > div { border-color: var(--line-soft); }
.review-history strong { color: var(--text); }
.grade-1 { background: #3c2d28; color: #e2b39e; }
.grade-2 { background: var(--amber-surface); color: var(--amber); }
.grade-3 { background: var(--green-surface); color: var(--green); }
.grade-4 { background: var(--accent-surface); color: var(--accent); }
.loading > span { color: var(--green); }
.loading p { color: var(--muted); }
dialog { background: var(--surface); color: var(--text); border-color: #6e8560; box-shadow: none; }
dialog::backdrop { background: #080d0bd9; backdrop-filter: none; }
.dialog-bottom, .setting-row { border-color: var(--line); color: var(--muted); }
.setting-row small, .setting-block > p, .form-field { color: var(--muted); }
.form-field > input, .form-field > select, .form-field > textarea {
  background: var(--canvas); color: var(--text); border-color: #627754;
}
.form-field input::placeholder, .form-field textarea::placeholder { color: var(--muted); opacity: 1; }
.form-error { color: #efb09a; }
.example-fields { border-color: var(--line); }
.toast { background: #34462c; color: #e2edd9; border-color: #748e5f; box-shadow: 0 6px 22px #00000055; }
/* Small metadata stays legible against the dark surfaces, including on phones. */
.sidebar-label, .brand small, .book-link small, .sidebar-bottom > p,
.sidebar-bottom .text-button, .local-badge, .date-badge, .stat > div > span,
.stat b > small, .stat-hint, .goal-done, .mode-tabs button,
.toolbar-actions .text-button, .study-heading > span, .card-tags,
.level-tag, .front-eyebrow, .front-instruction, .card-front-footer,
.card-front-footer > span:last-child, .rating-title, .rating > small,
.study-bottom .text-button, .keyboard-hint, kbd, .tiny-label, .plan-item small,
.article-guide h3, .article-guide > div > span:not(.gender-dot),
.coverage-note, .listen-button, .grammar-pills > span, .past-forms span,
.section-mini-title > span, .example-number, .source-line,
.word-tile .card-tags, .tile-footer, .library-note, .chart-column > span,
.chart-column > small, .mastery-number small, .mastery-legend,
.review-history time, .history-grade, .setting-row small,
.setting-block .button, .dialog-bottom, .dialog-bottom .button,
.form-field, .toast, footer, footer > span:first-child { font-size: 11px; }
.eyebrow, .dialog-header .eyebrow { font-size: 11px; letter-spacing: .04em; }
.front-eyebrow { letter-spacing: .04em; }
.card-front-footer > span:last-child { letter-spacing: .04em; }
.setting-block > p, .mastery-panel > p, .empty-state p { font-size: 12px; }
.goal-ring > span { font-size: 11px !important; }
.filter-selects select, .setting-row select, .search-box { border-color: #6e8560; }
@media (max-width: 720px) { .sidebar.open { box-shadow: -20px 0 100px #00000066; } }

/* Shared finishing rules for the study, library, dialogs and navigation. */
:root { --radius: 14px; --control-height: 42px; --space-unit: 8px; }
html { scrollbar-gutter: stable; scrollbar-color: #627455 var(--canvas); }
body { line-height: 1.9; }
body.menu-open, html:has(dialog[open]) { overflow: hidden; }
button, input, select, textarea { touch-action: manipulation; }
button, .button { transition: background-color 140ms ease-out, border-color 140ms ease-out, color 140ms ease-out; }
button:active:not(:disabled) { transform: translateY(1px); }
button:disabled { opacity: .48; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
#page-title:focus, #content:focus { outline: none; }
.skip-link { position: fixed; inset-block-start: 12px; inset-inline-start: 12px; transform: translateY(-200%); background: var(--accent-surface); color: #e5ecff; border: 1px solid var(--accent); border-radius: 8px; padding: 10px 18px; z-index: 150; }
.skip-link:focus { transform: translateY(0); }
.menu-backdrop { position: fixed; inset: 0; z-index: 19; background: #080d0bc9; }
.sidebar { overflow-y: auto; scrollbar-width: thin; }
.sidebar-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 32px; }
.sidebar-heading .brand { margin: 0; }
.brand-icon { display: block; object-fit: contain; flex-shrink: 0; }
#sidebar-close { display: none; }
.brand b { letter-spacing: -.025em; }
.plant .icon { width: 32px; height: 32px; }
footer i .icon { width: 13px; height: 13px; }
.topbar { height: 64px; }
.workspace { padding-top: 26px; }
.intro { margin-bottom: 24px; }
.intro h1 { font-size: 29px; margin-top: 0; line-height: 1.65; letter-spacing: -.025em; text-wrap: balance; }
.intro p { margin-top: 6px; max-width: 70ch; line-height: 1.9; }
.stats-strip { margin-bottom: 24px; }
.stat { min-height: 80px; padding: 15px 20px; border-radius: var(--radius); }
.stat>div>b { line-height: 1.45; }
.filter-bar { padding-bottom: 16px; }
.filter-selects select { height: var(--control-height); font-size: 12px; padding-inline: 12px; }
.level-tabs { padding: 4px; gap: 4px; }
.level-tabs button { min-height: 34px; font-size: 12px; }
.practice-toolbar { margin: 12px 0 20px; min-height: 36px; }
.mode-tabs { gap: 18px; }
.mode-tabs button { min-height: 36px; font-size: 12px; }
.toolbar-actions .text-button { min-height: 36px; font-size: 11px; }
.icon-button { width: 38px; height: 38px; }
.study-heading { gap: 12px; margin-bottom: 12px; }
.study-heading h2 { min-width: 0; flex-wrap: wrap; font-size: 13px; }
.study-heading h2>span { font-size: 12px; overflow-wrap: anywhere; }
.study-heading>span { flex-shrink: 0; font-variant-numeric: tabular-nums; }
.flashcard, .word-tile, .panel, dialog { border-radius: var(--radius); }
.flashcard::before { display: none; }
.flashcard:focus-visible { outline-offset: 5px; }
.card-top { padding: 14px 22px; }
.card-tags { flex-wrap: wrap; row-gap: 4px; }
.card-front { min-height: 244px; padding: 14px 24px 28px; }
.front-word { letter-spacing: -.025em; margin-top: 0; font-size: clamp(36px,4.2vw,62px); }
.front-instruction { font-size: 12px; }
.reveal-cta { min-height: 42px; margin-top: 24px; padding: 8px 20px; font-size: 12px; }
.card-front-footer { gap: 12px; line-height: 1.8; }
.card-front-footer>span:last-child { white-space: nowrap; }
.rating-area { margin-top: 22px; }
.rating-title { min-height: 26px; gap: 12px; }
.rating-buttons { gap: 10px; }
.rating { min-height: 78px; padding: 12px; border-radius: 10px; }
.rating>span { font-size: 13px; }
.rating>small { font-size: 11px; }
.rating:enabled:hover { box-shadow: none; filter: none; border-color: currentColor; }
.study-bottom { flex-wrap: wrap; gap: 12px; }
.keyboard-hint { font-size: 11px; }
.study-bottom .text-button { min-height: 36px; }
.back-content { padding: 4px 26px 16px; }
.back-word strong { font-size: 34px; letter-spacing: -.02em; }
.back-word h2 { font-size: 19px; line-height: 1.9; }
.pronunciation { gap: 14px; }
.listen-button { min-height: 36px; font-size: 12px; }
.grammar-pills { flex-wrap: wrap; }
.grammar-pills>span { font-size: 12px; padding: 7px 12px; }
.past-forms>div { min-width: 0; }
.past-forms strong { overflow-wrap: anywhere; line-height: 1.6; }
.section-mini-title { flex-wrap: wrap; }
.conjugation .section-mini-title h3, .examples h3 { font-size: 13px; }
.tense-tabs button { min-height: 34px; padding: 5px 9px; }
.conjugation-grid { grid-template-rows: repeat(3,auto); grid-auto-flow: column; column-gap: 24px; }
.conjugation-grid>div { min-width: 0; gap: 12px; min-height: 41px; }
.conjugation-grid strong { overflow-wrap: anywhere; }
.grammar-note { padding: 12px 14px; font-size: 12px; line-height: 2; }
.example { gap: 12px; padding-block: 18px; }
.example-number { min-width: 15px; }
.example p[lang=de] { font-size: 17px; line-height: 1.75; overflow-wrap: anywhere; }
.example p:not([lang]) { font-size: 13px; margin-top: 8px; }
.example .icon-button { width: 36px; height: 36px; }
.example .icon { width: 16px; height: 16px; }
.source-line { flex-wrap: wrap; font-size: 11px; line-height: 1.9; }
.encouragement { border-radius: var(--radius); }
.ill-spark .icon { width: 24px; height: 24px; }
.plan-item:not(:last-child)::after { height: 20px; }
.empty-state { padding: 48px 24px; }
.empty-symbol .icon, .loading>span .icon { width: 48px; height: 48px; }
.empty-state p { font-size: 13px; max-width: 50ch; }
.button { min-height: var(--control-height); font-size: 12px; padding: 9px 16px; }
.search-box { width: min(390px,100%); min-height: var(--control-height); }
.search-box input { font-size: 13px; }
.library-toolbar { margin: 22px 0; }
.result-count { font-variant-numeric: tabular-nums; }
.word-tile .card-top { padding: 12px 14px 4px; }
.tile-open { min-height: 124px; padding: 12px 18px 22px; }
.tile-open>strong { font-size: 26px; line-height: 1.45; }
.tile-open>span { font-size: 13px; line-height: 1.9; }
.tile-footer { padding-block: 6px; font-size: 11px; }
.load-more .button { min-width: 210px; }
.panel { padding: 26px; }
.panel h2 { font-size: 17px; }
.activity-chart { margin-top: 28px; }
.chart-column>span, .chart-column>small { font-size: 11px; font-variant-numeric: tabular-nums; }
.level-progress-row { gap: 20px; }
.review-history>div { grid-template-columns: minmax(0,1.2fr) minmax(0,1.5fr) 96px 120px; }
.review-history strong, .review-history>div>span { overflow-wrap: anywhere; }
dialog { padding: 26px; scrollbar-width: thin; max-height: min(90dvh,950px); }
.dialog-header { position: sticky; top: -26px; margin: -2px -2px 18px; padding: 2px 2px 14px; background: var(--surface); border-bottom: 1px solid var(--line-soft); z-index: 2; }
.dialog-header h2 { margin: 0; font-size: 21px; }
.dialog-bottom { line-height: 1.9; }
.setting-row label { font-size: 14px; }
.setting-row small { font-size: 12px; max-width: 42ch; }
.setting-row select { min-height: var(--control-height); }
.setting-block h3 { font-size: 15px; }
.setting-block>p { font-size: 13px; max-width: 70ch; }
.setting-block .button { font-size: 12px; }
.form-grid { gap: 14px 18px; }
.form-field { font-size: 12px; margin-bottom: 12px; }
.form-field>input, .form-field>select { min-height: 44px; font-size: 14px; }
.form-field>textarea { font-size: 14px; resize: vertical; }
.editor-dialog h3 { margin-top: 12px; padding-bottom: 16px; font-size: 14px; }
.form-error { font-size: 13px; }
.form-error:not(:empty) { margin-block: 16px; padding: 12px; background: var(--rose-surface); border-radius: 8px; }
.storage-unavailable { color: var(--amber); }
.storage-unavailable>i { background: var(--amber); }
.topbar .local-badge { font-size: 11px; }
.toast { font-size: 12px; line-height: 1.9; box-shadow: none; }
footer { align-items: center; gap: 20px; line-height: 1.8; }
@media(min-width:1550px) { .card-front { min-height: 280px; } }
@media(max-width:1100px) {
  .workspace { padding-inline: 28px; } .topbar { margin-inline: 28px; }
  .stat { padding: 14px; } .stat-icon { width: 32px; height: 32px; }
  .rating kbd { display: none; } .rating { padding: 12px 9px; }
  .review-history>div { grid-template-columns: minmax(0,1fr) minmax(0,1.2fr) 85px 100px; }
}
@media(max-width:980px) {
  .study-aside { margin-top: 24px; } .conjugation-grid { column-gap: 18px; }
  .level-progress-row { gap: 14px; } .level-progress-row>b { min-width: 110px; }
}
@media(max-width:720px) {
  :root { --control-height: 44px; }
  .sidebar { width: min(300px,86vw); padding: 24px 20px; z-index: 30; }
  .sidebar-heading { margin-bottom: 25px; }
  #sidebar-close { display: inline-flex; }
  .sidebar.open { box-shadow: none; }
  .sidebar-bottom { padding-top: 24px; }
  .topbar { height: 58px; margin-inline: 18px; }
  .workspace { padding: 20px 18px 0; }
  .intro { margin-bottom: 18px; }
  .intro h1 { font-size: 25px; line-height: 1.7; }
  .intro p { font-size: 12px; line-height: 1.9; }
  body[data-view=practice] .intro p { display: none; }
  .stats-strip { margin-bottom: 18px; gap: 8px; }
  .stat { min-height: 74px; padding: 10px; gap: 6px; flex-wrap: nowrap; }
  .stat-icon { display: none; }
  .stat>div>span { font-size: 11px; }
  .stat>div>b { font-size: 21px; }
  .stat b>small { font-size: 11px; }
  .goal-ring { width: 29px; height: 29px; }
  .goal-stat { justify-content: center; }
  .goal-ring>span { font-size: 11px!important; }
  .goal-stat>div>b { font-size: 19px; }
  .filter-bar { display: grid; grid-template-columns: 1fr; gap: 10px; padding-bottom: 12px; }
  .level-tabs { width: 100%; }
  .level-tabs button { min-height: 36px; flex: 1; font-size: 12px; }
  .filter-selects { display: grid; grid-template-columns: minmax(0,1.5fr) minmax(0,1fr); gap: 8px; width: 100%; }
  .filter-selects .sr-only { display: none; }
  .filter-selects select { width: 100%; min-width: 0; max-width: none; font-size: 12px; }
  .practice-toolbar { align-items: center; gap: 6px; margin: 6px 0 15px; }
  .mode-tabs { gap: 12px; }
  .mode-tabs button { min-height: 44px; font-size: 11px; }
  .toolbar-actions { gap: 2px; }
  .toolbar-actions .text-button { font-size: 11px; min-height: 44px; }
  .icon-button { width: 44px; height: 44px; }
  .toolbar-actions .icon-button { width: 36px; }
  .study-heading { align-items: flex-start; margin-bottom: 10px; }
  .study-heading h2 { font-size: 12px; gap: 7px; }
  .study-heading h2>span { font-size: 12px; }
  .study-heading>span { font-size: 11px; }
  .session-progress { margin-bottom: 13px; }
  .card-top { padding: 10px 15px; }
  .card-front { min-height: 214px; padding: 10px 18px 24px; }
  .front-word { font-size: 46px; }
  .front-word.persian-word { font-size: 29px; }
  .reveal-cta { margin-top: 22px; }
  .flashcard { min-height: 0; }
  .card-front-footer { margin-inline: 18px; font-size: 11px; padding: 13px 0; flex-wrap: wrap; }
  .card-front-footer>span:last-child { font-size: 11px; }
  .rating-area { margin-top: 18px; }
  .rating-title { font-size: 11px; }
  .rating-title .text-button { font-size: 11px; min-height: 36px; }
  .rating-buttons { gap: 7px; }
  .rating { min-height: 82px; padding: 10px 6px; text-align: center; }
  .rating>span { font-size: 12px; }
  .rating>small { font-size: 11px; line-height: 1.8; }
  .study-bottom .text-button { min-height: 44px; font-size: 11px; }
  .back-content { padding: 0 18px 14px; }
  .back-word strong { font-size: 31px; }
  .back-word h2 { font-size: 18px; }
  .pronunciation { gap: 12px; }
  .grammar-pills>span { padding: 6px 10px; }
  .past-forms strong { font-size: 16px; }
  .conjugation .section-mini-title { align-items: center; gap: 10px; }
  .tense-tabs { flex-shrink: 0; }
  .tense-tabs button { min-height: 40px; padding: 6px 8px; font-size: 11px; }
  .conjugation-grid { column-gap: 14px; }
  .conjugation-grid>div { font-size: 14px; flex-wrap: wrap; justify-content: flex-start; row-gap: 4px; padding-block: 10px; }
  .conjugation-grid span { width: 100%; font-size: 11px; }
  .conjugation-grid strong { font-size: 15px; }
  .example { gap: 8px; padding-block: 17px; }
  .example p[lang=de] { font-size: 16px; }
  .example p:not([lang]) { font-size: 13px; }
  .example .icon-button { width: 38px; height: 44px; }
  .grammar-note { font-size: 12px; }
  .source-line { font-size: 11px; }
  .study-aside { grid-template-columns: 1fr; gap: 18px; }
  .study-aside .daily-plan { display: none; }
  .encouragement { display: grid; grid-template-columns: 70px 1fr; padding: 18px; text-align: right; gap: 5px 14px; }
  .encouragement .tiny-label { display: none; }
  .encouragement .illustration { grid-column: 1; grid-row: 1/3; width: 70px; height: 80px; margin: 0; transform: none; }
  .ill-card { width: 33px; height: 46px; top: 17px; font-size: 13px; }
  .ill-one { left: 0; } .ill-two { left: 20px; top: 13px; } .ill-three { left: 40px; }
  .ill-spark { display: none; }
  .encouragement h3 { font-size: 13px; margin: 0; align-self: end; }
  .encouragement p { font-size: 12px; line-height: 1.9; }
  .coverage-note { font-size: 11px; }
  .library-toolbar { gap: 14px; margin: 18px 0; }
  .search-box { width: 100%; }
  .library-grid { gap: 10px; }
  .word-tile .card-top { padding: 8px 10px 0; }
  .word-tile .card-tags { font-size: 11px; gap: 5px; }
  .word-tile .card-tags .tag-divider { display: none; }
  .word-tile .card-tags>span:last-child { font-size: 11px; }
  .word-tile .icon-button { width: 36px; height: 44px; }
  .tile-open { min-height: 124px; padding: 12px; }
  .tile-open>strong { font-size: 23px; }
  .tile-open>span { font-size: 12px; }
  .tile-footer { margin-inline: 12px; font-size: 11px; }
  .panel { padding: 20px; }
  .panel h2 { font-size: 16px; }
  .activity-chart { gap: 7px; }
  .level-progress-row { gap: 10px; }
  .level-progress-row>.long-progress { flex-basis: 100%; }
  .review-history>div { grid-template-columns: minmax(0,1fr) minmax(0,1fr) 76px; gap: 10px; }
  .review-history time { grid-column: 1/-1; }
  dialog { width: calc(100vw - 24px); max-height: calc(100dvh - 32px); padding: 20px; }
  .dialog-header { top: -20px; }
  .dialog-header h2 { font-size: 19px; }
  .detail-dialog .back-content { padding-inline: 0; }
  .dialog-header .card-tags { max-width: 70%; }
  .setting-row { gap: 16px; }
  .setting-row label { font-size: 13px; }
  .setting-row select { font-size: 12px; min-width: 105px; }
  .setting-block>p { font-size: 13px; }
  .setting-block .button { font-size: 12px; }
  .form-grid { grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 12px; }
  .form-field { font-size: 12px; }
  .form-field>input, .form-field>select, .form-field>textarea { font-size: 14px; }
  .toast { bottom: 16px; width: max-content; font-size: 12px; }
  footer { flex-wrap: wrap; justify-content: center; margin-top: 24px; padding-block: 20px; }
}
@media(max-width:420px) {
  .practice-toolbar { flex-wrap: wrap; }
  .mode-tabs { width: 100%; justify-content: space-between; gap: 8px; }
  .toolbar-actions { width: 100%; justify-content: flex-end; margin-top: -3px; }
  .toolbar-actions .text-button { min-height: 32px; }
  .toolbar-actions .icon-button { height: 32px; }
  .stat { padding-inline: 8px; } .goal-ring { display: none; }
  .goal-stat { justify-content: flex-start; }
  .intro h1 { font-size: 24px; }
  .form-grid { grid-template-columns: minmax(0,1fr); }
  .word-tile .card-tags>span:last-child { display: none; }
  .tile-open>strong { font-size: 22px; }
  .rating-buttons { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .rating { min-height: 66px; text-align: right; padding: 10px 13px; }
}
@media(prefers-reduced-motion:reduce) { *, *::before, *::after { animation: none!important; transition: none!important; scroll-behavior: auto!important; } }
