@charset "UTF-8";

/* Neutral LingoLatvija palette sampled from the supplied Android screenshots.
   Dark: background #0c1323, cards #1a2332, primary buttons #c7c8cc.
   Light: background #f9fafc, cards and primary buttons #ffffff. */
:root {
  color-scheme:light;
  --bg:#f9fafc; --surface:#fff; --surface-raised:#f9fafc; --ink:#1f2937;
  --muted:#66707c; --line:#e5e7eb; --accent:#111827; --accent-ink:#fff;
  --tint:#e6ebf1; --control-line:#596570;
  --primary:#fff; --primary-ink:#000; --primary-line:#bfc0c3;
  --success:#216c4a; --success-tint:#eaf5ee; --error:#b42318; --error-tint:#f9fafc;
  --answer-wrong:#b42318;
  --warning:#74551b; --warning-tint:#fff3d8;
  --shadow:none;
  --radius:28px; --text-scale:1;
  --font:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  font-family:var(--font); font-size:calc(100% * var(--text-scale));
}
:root[data-theme="dark"] {
  color-scheme:dark;
  --bg:#0c1323; --surface:#1a2332; --surface-raised:#25303e; --ink:#fff;
  --muted:#8b9bb8; --line:#2b3443; --accent:#fff; --accent-ink:#111827;
  --tint:#25303e; --control-line:#8b9bb8;
  --primary:#c7c8cc; --primary-ink:#000; --primary-line:#b8bac0;
  --success:#91d6b1; --success-tint:#203c33; --error:#ff9b85; --error-tint:#25303e;
  --answer-wrong:#ff6b6b;
  --warning:#ebce91; --warning-tint:#3d3423;
  --shadow:none;
}
* { box-sizing:border-box; }
body { margin:0; background:var(--bg); color:var(--ink); min-height:100vh; min-height:100dvh; }
button,input,select { font:inherit; }
button { cursor:pointer; color:inherit; touch-action:manipulation; -webkit-tap-highlight-color:transparent; }
button:disabled { cursor:default; opacity:.45; }
button:focus-visible,input:focus-visible,select:focus-visible,summary:focus-visible { outline:3px solid var(--accent); outline-offset:4px; }
button { transition:background-color .15s,color .15s,border-color .15s,transform .12s; }
button:active:not(:disabled) { transform:scale(.985); }
svg { display:block; width:24px; height:24px; flex-shrink:0; }
.app-symbol { display:block; width:28px; height:28px; flex-shrink:0; object-fit:contain; pointer-events:none; }
[hidden] { display:none!important; }
p { line-height:1.55; }
main { min-width:0; outline:0; }
.app-shell { width:min(100%,720px); margin:auto; padding:env(safe-area-inset-top) max(16px,env(safe-area-inset-right)) max(24px,env(safe-area-inset-bottom)) max(16px,env(safe-area-inset-left)); }
.app-header { position:relative; display:flex; justify-content:space-between; align-items:center; gap:12px; padding:22px 0 26px; }
.brand { display:flex; align-items:center; gap:12px; min-width:0; min-height:50px; text-align:left; border:0; padding:0; background:none; font-weight:750; font-size:1.2rem; line-height:1.25; letter-spacing:-.025em; }
#brand-name { overflow-wrap:anywhere; }
.brand-mark,.back-mark { display:grid; place-items:center; width:50px; height:50px; flex-shrink:0; border-radius:50%; }
.brand-mark { background:none; }
.brand-flag { width:32px; height:32px; }
.back-mark { border:0; background:transparent; }
.icon-button { width:50px; height:50px; display:grid; place-items:center; border:1px solid var(--ink); background:var(--surface); border-radius:50%; flex-shrink:0; }
.icon-button svg { width:23px; height:23px; }
.heading-row { margin:0 2px 22px; }
.page-heading { margin:0; font-size:1.8rem; font-weight:750; line-height:1.22; letter-spacing:-.035em; overflow-wrap:anywhere; }
.muted { color:var(--muted); }
.small { font-size:.875rem; line-height:1.55; }
.panel { background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); padding:clamp(18px,5vw,28px); margin-bottom:16px; box-shadow:var(--shadow); }
.panel-title { display:flex; align-items:center; gap:10px; font-size:1.125rem; font-weight:700; line-height:1.35; margin:0 0 18px; min-width:0; overflow-wrap:anywhere; }
.section-icon { display:grid; place-items:center; width:36px; height:36px; flex-shrink:0; color:var(--accent); background:var(--tint); border-radius:50%; }
.section-icon svg { width:20px; height:20px; }
.panel-head { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:8px; margin-bottom:18px; }
.panel-head .panel-title { margin:0; }
.text-button { min-height:48px; border:0; border-radius:24px; padding:8px 12px; font-size:.875rem; font-weight:650; color:var(--accent); background:var(--tint); }
.selection-heading { margin:0 0 22px; color:var(--muted); font-size:1rem; font-weight:600; }
.selection-numbers { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; margin:0 0 24px; }
.selection-numbers>div { min-width:0; }
.selection-numbers strong { display:block; font-size:2.5rem; font-weight:750; line-height:1.15; letter-spacing:-.045em; font-variant-numeric:tabular-nums; }
.selection-numbers>div:first-child strong { color:var(--accent); }
.selection-numbers span { display:block; color:var(--muted); font-size:.875rem; line-height:1.4; margin-top:8px; overflow-wrap:anywhere; }
.selection-mode { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:8px; font-size:.875rem; border-top:1px solid var(--line); padding-top:18px; }
.badge { display:inline-block; border-radius:20px; background:var(--tint); color:var(--accent); padding:6px 12px; font-weight:600; font-size:.875rem; line-height:1.35; overflow-wrap:anywhere; }
.primary,.secondary,.quiet,.danger { border-radius:18px; border:1px solid transparent; min-height:56px; padding:14px 20px; font-size:1rem; font-weight:700; line-height:1.4; text-align:center; overflow-wrap:anywhere; }
.primary { background:var(--primary); color:var(--primary-ink); border-color:var(--primary-line); }
.secondary { border-color:var(--control-line); background:transparent; font-weight:600; }
.quiet { background:transparent; color:var(--muted); font-weight:500; }
.danger { background:var(--error-tint); color:var(--error); }
.wide { width:100%; }
.home-actions { display:grid; grid-template-columns:minmax(0,1fr); grid-auto-rows:1fr; gap:14px; }
.home-actions .nav-tile { min-width:0; min-height:62px; height:100%; padding-top:4px; padding-bottom:4px; }
.home-extra { margin-top:22px; padding-top:8px; text-align:left; }
.app-notice { margin-top:calc(32px + 2.61rem); text-align:left; }
.app-notice p { margin:0; text-indent:1.5em; font-size:.9rem; color:var(--muted); color:color-mix(in srgb,var(--muted) 82%,var(--bg)); }
.app-notice p+p { margin-top:12px; }
.useful-links-button { min-height:44px; max-width:100%; padding:8px 12px 8px 0; border:0; border-radius:22px; color:var(--ink); background:transparent; text-align:left; }
.nav-tile { display:flex; align-items:center; gap:16px; width:100%; min-height:104px; padding:22px; text-align:left; background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); box-shadow:var(--shadow); }
.tile-icon { display:grid; place-items:center; flex-shrink:0; width:52px; height:52px; border-radius:50%; background:var(--tint); color:var(--accent); }
.tile-icon svg { width:25px; height:25px; }
.tile-copy { display:block; min-width:0; }
.tile-title { display:block; font-size:1.2rem; font-weight:750; line-height:1.35; overflow-wrap:anywhere; }
.tile-description { display:block; font-size:1rem; line-height:1.45; margin-top:5px; color:var(--muted); overflow-wrap:anywhere; }
.start-tile { background:var(--surface); color:var(--ink); border-color:var(--line); }
.home-start-tile { position:relative; min-width:0; --tile-padding:22px; --tile-gap:16px; --tile-circle:52px; --tile-target:52px; }
.home-start-tile .start-tile { padding-right:calc(var(--tile-padding) + var(--tile-circle) + var(--tile-gap)); }
.home-start-tile .tile-copy { flex:1; }
.home-actions .tile-title,.home-actions .tile-description { white-space:normal; overflow:visible; text-overflow:clip; overflow-wrap:break-word; word-break:normal; }
.tile-settings-button { position:absolute; top:50%; right:calc(var(--tile-padding) + 1px + (var(--tile-circle) - var(--tile-target)) / 2); transform:translateY(-50%); width:var(--tile-target); height:var(--tile-target); padding:0; border:0; border-radius:50%; background:transparent; display:grid; place-items:center; }
.tile-settings-ring { position:relative; isolation:isolate; display:grid; place-items:center; width:var(--tile-circle); height:var(--tile-circle); border:1px solid var(--ink); border-radius:50%; background:var(--surface); }
.tile-settings-ring::after { content:""; position:absolute; inset:-1px; border:inherit; border-radius:inherit; pointer-events:none; z-index:1; }
.tile-settings-pencil { width:26px; height:26px; color:inherit; }
.tile-settings-button:active:not(:disabled) { transform:translateY(-50%) scale(.985); }
.notifications:empty { display:none; }
.notice { color:var(--warning); background:var(--warning-tint); border-radius:18px; padding:14px 18px; margin-bottom:16px; font-size:.875rem; line-height:1.5; overflow-wrap:anywhere; }
.selection-error { color:var(--error); font-size:.875rem; margin:14px 0 0; overflow-wrap:anywhere; }
.group-section+.group-section { margin-top:22px; }
.group-caption { color:var(--muted); font-size:.875rem; margin:0 0 10px; }
.group-options { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px; }
.group-options.adjective-genders { grid-template-columns:repeat(2,minmax(0,1fr)); }
.group-button { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:6px; min-width:0; min-height:74px; padding:12px 6px; border:1px solid var(--line); background:var(--surface-raised); border-radius:18px; font-weight:700; }
.group-button[aria-pressed="true"] { border-color:var(--accent); color:var(--accent); background:var(--tint); }
.group-name { display:flex; align-items:center; justify-content:center; gap:4px; max-width:100%; overflow-wrap:anywhere; }
.group-count { color:var(--muted); font-size:.875rem; font-weight:500; }
.group-check { font-size:.875rem; }
.matrix-wrap { margin-top:16px; }
.matrix { table-layout:fixed; border-collapse:separate; border-spacing:5px; margin:-5px; width:calc(100% + 10px); }
.matrix th { font-weight:500; }
.matrix th:first-child { width:34%; }
.matrix td,.matrix th { padding:0; }
.matrix button { width:100%; min-height:50px; padding:8px 4px; border:1px solid var(--line); border-radius:14px; background:var(--surface-raised); }
.matrix .matrix-heading { font-size:.875rem; line-height:1.35; overflow-wrap:anywhere; border-color:transparent; color:var(--muted); background:transparent; }
.matrix .matrix-person { text-align:left; padding-left:5px; }
.noun-matrix th:first-child { width:46%; }
.case-question { display:block; font-size:.75rem; margin-top:2px; }
.matrix .matrix-heading[aria-pressed="true"],.matrix .matrix-heading[aria-pressed="mixed"] { color:var(--accent); background:var(--tint); }
.matrix .matrix-heading[aria-pressed="mixed"] { box-shadow:inset 0 -2px var(--accent); }
.matrix .cell { color:var(--muted); font-size:1.125rem; }
.matrix .cell[aria-pressed="true"] { background:var(--accent); border-color:var(--accent); color:var(--accent-ink); }
.radio-options { display:grid; gap:10px; }
.radio-card { display:flex; align-items:flex-start; gap:12px; padding:16px; background:var(--surface-raised); border:1px solid var(--line); border-radius:20px; cursor:pointer; }
.radio-card>span { min-width:0; overflow-wrap:anywhere; }
.radio-card:has(input:checked) { border-color:var(--accent); background:var(--tint); }
input[type="radio"],input[type="checkbox"] { accent-color:var(--accent); width:22px; height:22px; margin:1px 0; flex-shrink:0; }
.radio-title { display:block; font-weight:650; line-height:1.4; }
.radio-description { display:block; margin-top:5px; color:var(--muted); font-size:.875rem; font-weight:400; line-height:1.5; }
.settings-footer { margin:20px 0 0; }
.settings-footer p { text-align:center; margin:0 0 12px; }
.preferences-panel { padding-top:8px; padding-bottom:8px; }
.setting-row { padding:20px 0; border-bottom:1px solid var(--line); }
.setting-row>label,.theme-setting legend { display:block; font-size:.875rem; color:var(--muted); font-weight:600; margin-bottom:10px; }
.setting-row select { width:100%; min-height:52px; padding:12px 14px; border:1px solid var(--line); border-radius:14px; color:var(--ink); background:var(--surface-raised); }
.active-count-input { width:100%; min-height:52px; padding:12px 14px; border:1px solid var(--line); border-radius:14px; color:var(--ink); background:var(--surface-raised); }
.theme-setting { border:0; border-bottom:1px solid var(--line); margin:20px 0 0; padding:0 0 20px; min-width:0; }
.theme-setting legend { padding:0; margin:0 0 12px; }
.theme-options { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; }
.theme-option { position:relative; display:block; min-width:0; cursor:pointer; }
.theme-option input { position:absolute; opacity:0; width:100%; height:100%; margin:0; }
.theme-choice { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:10px; min-height:98px; padding:16px 6px; border:1px solid var(--line); border-radius:20px; background:var(--surface-raised); font-size:.875rem; font-weight:600; line-height:1.4; text-align:center; overflow-wrap:anywhere; }
.theme-option input:checked+.theme-choice { border-color:var(--accent); color:var(--accent); background:var(--tint); }
.theme-option input:focus-visible+.theme-choice { outline:3px solid var(--accent); outline-offset:3px; }
.toggle-row { display:flex; justify-content:space-between; align-items:center; gap:16px; min-height:80px; padding:20px 0; cursor:pointer; }
.toggle-row>span { flex:1; font-weight:650; overflow-wrap:anywhere; }
.toggle-row input { appearance:none; position:relative; width:52px; height:32px; margin:6px 0; background:var(--surface-raised); border:2px solid var(--muted); border-radius:18px; cursor:pointer; transition:background .15s; }
.toggle-row input::before { content:""; position:absolute; width:20px; height:20px; top:4px; left:4px; border-radius:50%; background:var(--muted); transition:transform .15s; }
.toggle-row input:checked { border-color:var(--accent); background:var(--accent); }
.toggle-row input:checked::before { background:var(--accent-ink); transform:translateX(20px); }
details.help { padding:20px 24px; border:1px solid var(--line); border-radius:24px; background:var(--surface); }
details.help summary { cursor:pointer; min-height:24px; font-weight:650; line-height:1.45; }
details.help p { margin:14px 0 0; color:var(--muted); font-size:.875rem; }
.training-overview { display:grid; grid-template-columns:1.5fr 1fr 1.2fr; align-items:stretch; gap:8px; margin-bottom:16px; }
.stat { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:3px; min-width:0; padding:3px 8px; background:var(--surface); border:1px solid var(--line); border-radius:24px; text-align:center; }
.stat span { color:var(--muted); font-size:.875rem; line-height:1.3; overflow-wrap:anywhere; }
.stat strong { font-size:1.5rem; font-weight:750; line-height:1.2; font-variant-numeric:tabular-nums; }
#error-count { display:block; width:100%; height:1.8rem; line-height:1.8rem; white-space:nowrap; overflow:hidden; }
#answer-count-label { display:block; width:100%; height:1.1375rem; line-height:1.1375rem; white-space:nowrap; overflow:hidden; }
.stat-completed strong { color:var(--accent); }
:root[lang="ru"] .training-overview { grid-template-columns:minmax(max-content,1.5fr) minmax(0,1fr) minmax(0,1.2fr); }
:root[lang="ru"] .stat-completed>span { white-space:nowrap; overflow-wrap:normal; }
.stat .timer { font-size:1.25rem; letter-spacing:-.015em; overflow-wrap:anywhere; }
.practice-card { --divider-gap:16px; display:flex; flex-direction:column; min-height:clamp(0px,calc(var(--view-height,100dvh) - 17rem),40rem); margin-bottom:12px; }
.task-meta { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:8px; margin:0 0 26px; }
.meta-text { font-size:.875rem; line-height:1.45; color:var(--muted); overflow-wrap:anywhere; }
.infinitive { font-size:2.5rem; font-weight:750; margin:0; line-height:1.2; letter-spacing:-.035em; overflow-wrap:anywhere; text-align:center; }
.sentence,.noun-hint { font-size:1.65rem; }
.noun-hint { font-weight:300; color:inherit; }
.verb-translation { margin:8px 0 0; color:var(--muted); text-align:center; }
.progress-track { height:4px; border-radius:4px; overflow:hidden; background:var(--line); margin-top:var(--divider-gap); }
.progress-track span { display:block; width:0; height:100%; background:var(--accent); transition:width .2s ease; }
#answer-form { display:flex; flex-direction:column; flex:1; min-width:0; }
.question-body { display:flex; flex-direction:column; justify-content:flex-start; flex:1; min-width:0; padding:var(--divider-gap) 0 32px; }
.sentence { display:flex; justify-content:center; flex-wrap:wrap; align-items:baseline; column-gap:.22em; row-gap:8px; margin:0 0 20px; line-height:1.6; text-align:center; }
.sentence-part { overflow-wrap:anywhere; max-width:100%; }
.verb-entry { display:inline-flex; align-items:baseline; max-width:100%; min-width:0; border-bottom:2px solid var(--control-line); padding:0 2px 1px; color:var(--ink); }
.verb-entry input { width:8ch; min-width:3ch; max-width:100%; flex-shrink:0; min-height:44px; color:var(--ink); border:0; background:transparent; outline:0; padding:0; line-height:1.5; border-radius:0; }
.verb-entry input:focus-visible { outline:none; }
.verb-entry:focus-within { box-shadow:0 1px 0 var(--accent); }
.verb-entry.has-prefix input { width:4.5ch; }
.prefix { flex-shrink:1; min-width:0; overflow-wrap:anywhere; }
.verb-entry.is-correct { border-color:var(--success); color:var(--success); box-shadow:none; }
.verb-entry.is-wrong { border-color:var(--answer-wrong); color:var(--answer-wrong); box-shadow:none; }
.practice-card[data-feedback="correct"] .sentence,.practice-card[data-feedback="correct"] .verb-entry,.practice-card[data-feedback="correct"] .verb-entry input { color:var(--success); }
.practice-card[data-feedback="wrong"] .sentence,.practice-card[data-feedback="wrong"] .verb-entry,.practice-card[data-feedback="wrong"] .verb-entry input { color:var(--answer-wrong); }
.sentence-translation { margin:0 0 14px; color:var(--muted); text-align:center; }
.input-hints { display:grid; min-width:0; }
.input-hints>p { grid-area:1/1; align-self:center; min-width:0; overflow-wrap:anywhere; }
.input-hints #answer-correction { visibility:hidden; }
.practice-card[data-phase="wrong"] #input-hint { visibility:hidden; }
.practice-card[data-phase="wrong"] #answer-correction { visibility:visible; }
#answer-correction-form { color:var(--answer-wrong); }
.input-hint { margin:0; color:var(--muted); font-size:.875rem; line-height:1.5; text-align:center; }
.inline-error { font-size:.875rem; color:var(--error); margin:10px 0 0; text-align:center; }
.answer-button { display:grid; place-items:center; min-height:3.5rem; padding:5px 20px; }
.answer-status { display:block; font-size:.875rem; line-height:1.3; }
.answer-status:not(:empty) { margin-bottom:2px; }
.training-bottom { margin-bottom:8px; }
.training-bottom .secondary { min-height:52px; border-radius:26px; color:var(--muted); }
.waiting { text-align:center; padding:42px 24px; color:var(--muted); min-height:260px; }
.waiting-count { font-size:3rem; font-weight:750; color:var(--accent); font-variant-numeric:tabular-nums; margin:16px 0; }
.loading,.error-state { text-align:center; padding:60px 24px; line-height:1.6; }
.error-state h1 { font-size:1.5rem; }
.error-detail { color:var(--error); overflow-wrap:anywhere; }
dialog { color:var(--ink); background:var(--surface); border:1px solid var(--line); border-radius:32px; padding:28px; width:min(440px,calc(100vw - 32px)); max-height:calc(100dvh - 32px); overflow-y:auto; box-shadow:0 16px 80px rgb(0 0 0 / 20%); }
dialog::backdrop { background:rgb(5 12 23 / 60%); backdrop-filter:blur(5px); }
.summary-mark { display:grid; place-items:center; width:64px; height:64px; margin:0 auto 20px; border-radius:50%; color:var(--accent); background:var(--tint); }
.summary-mark svg { width:30px; height:30px; }
dialog h2 { font-size:1.5rem; line-height:1.3; letter-spacing:-.025em; margin:0 0 24px; text-align:center; overflow-wrap:anywhere; }
.summary-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin-bottom:24px; text-align:center; }
.summary-grid>div { padding:18px 10px; background:var(--surface-raised); border-radius:20px; }
.summary-grid>div:first-child { grid-column:1/-1; padding:0 0 20px; background:none; border-radius:0; border-bottom:1px solid var(--line); margin-bottom:6px; }
.summary-grid strong { display:block; font-size:1.8rem; font-weight:750; line-height:1.3; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
#summary-error-count { height:2.34rem; line-height:2.34rem; white-space:nowrap; overflow:hidden; }
.summary-grid>div:first-child strong { font-size:2.6rem; }
.summary-grid span { display:block; color:var(--muted); margin-top:6px; font-size:.875rem; line-height:1.4; overflow-wrap:anywhere; }
#summary-answer-count-label { height:1.225rem; line-height:1.225rem; white-space:nowrap; overflow:hidden; }
#error-count>span,#summary-error-count>span { display:inline; margin:0; font:inherit; color:inherit; overflow-wrap:normal; }
#error-count .count-correct,#summary-error-count .count-correct { color:var(--success); }
#error-count .count-error,#summary-error-count .count-error { color:var(--answer-wrong); }
.dialog-actions { display:grid; gap:10px; }
.useful-links-list { list-style:none; padding:0; margin:0 0 24px; }
.useful-links-list>li+li { margin-top:16px; padding-top:12px; border-top:1px solid var(--line); }
.useful-link-title { display:flex; align-items:center; justify-content:space-between; gap:12px; min-height:44px; color:var(--ink); font-size:1rem; font-weight:700; line-height:1.35; text-decoration:underline; text-underline-offset:4px; overflow-wrap:anywhere; }
.useful-link-title>span:first-child { min-width:0; }
.useful-link-title>span:last-child { flex-shrink:0; color:var(--muted); text-decoration:none; }
.useful-link-title:focus-visible { outline:3px solid var(--accent); outline-offset:4px; border-radius:4px; }
.useful-links-list p { margin:4px 0 0; color:var(--muted); font-size:.9375rem; line-height:1.55; overflow-wrap:anywhere; }
.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; }
@media (hover:hover) and (pointer:fine) {
  .secondary:hover,.icon-button:hover,.back-mark:hover { background:var(--surface-raised); }
  .tile-settings-button:hover .tile-settings-ring { background:var(--surface-raised); }
  .nav-tile:hover,.primary:hover { filter:brightness(.96); }
  .group-button:hover,.matrix button:hover { border-color:var(--accent); }
}
@media (min-width:600px) {
  .app-shell { padding-left:32px; padding-right:32px; }
  .app-header { padding-top:32px; padding-bottom:32px; }
  .brand { font-size:1.4rem; }
  .selection-panel { padding:30px; }
  .nav-tile { min-height:116px; padding:26px 30px; }
  .home-start-tile { --tile-padding:30px; }
  .tile-title { font-size:1.25rem; }
  .practice-card { padding:32px; }
  .sentence,.noun-hint { font-size:1.9rem; }
}
@media (max-width:380px) {
  .brand { font-size:1.1rem; gap:10px; }
  .app-header { padding-top:18px; padding-bottom:22px; }
  .brand-mark,.back-mark,.icon-button { width:48px; height:48px; }
  .selection-numbers { gap:10px; }
  .selection-numbers strong { font-size:2.2rem; }
  .nav-tile { gap:12px; padding:18px; }
  .tile-icon { width:46px; height:46px; }
  .home-start-tile { --tile-padding:18px; --tile-gap:12px; --tile-circle:46px; }
  .sentence,.noun-hint { font-size:1.5rem; }
  .infinitive { font-size:2.2rem; }
  .stat { padding:3px 6px; }
  .stat strong { font-size:1.35rem; }
  .stat .timer { font-size:1.125rem; }
  dialog { padding:22px; }
}
@media (max-width:22rem) {
  .group-options { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .theme-options { grid-template-columns:1fr; }
  .theme-choice { flex-direction:row; min-height:56px; padding:12px; }
}
/* Collapse spare card space when the keyboard reduces the visible viewport. */
@media (max-height:650px) {
  .practice-card { min-height:0; }
  .task-meta { margin-bottom:18px; }
  .question-body { padding-bottom:28px; }
}
@media (max-height:550px) and (orientation:landscape) {
  .app-header { padding-top:12px; padding-bottom:12px; }
  .training-overview { margin-bottom:12px; }
  .practice-card { padding:20px; }
  .task-meta { margin-bottom:12px; }
  .infinitive { font-size:1.8rem; }
  .question-body { padding-bottom:20px; }
}
@media (prefers-reduced-motion:reduce) { * { transition:none!important; animation:none!important; scroll-behavior:auto!important; } }

/* Only the new preposition screens need these additions. */
.preposition-options { grid-template-columns:repeat(auto-fit,minmax(min(100%,7rem),1fr)); }
.preposition-options .group-button { min-height:52px; padding:12px; }
.preposition-card[data-feedback="wrong"] .verb-entry.is-correct,
.preposition-card[data-feedback="wrong"] .verb-entry.is-correct input { color:var(--success); }

/* Quiet emphasis for the learning guide at the end of app settings. */
.training-guide { background:var(--surface-raised); border-inline-start:3px solid var(--muted); margin-top:20px; }
.training-guide h2 { margin:0; font-size:1.125rem; line-height:1.5; font-weight:700; min-width:0; overflow-wrap:break-word; }
.training-guide p { margin:14px 0 0; font-size:1rem; line-height:1.6; overflow-wrap:break-word; }
.training-guide .training-guide-reference { margin-top:18px; padding-top:16px; border-top:1px solid var(--line); }

.grammar-reference-button { --tile-circle:50px; display:grid; place-items:center; width:52px; height:52px; padding:0; border:0; border-radius:50%; background:transparent; flex-shrink:0; }
.grammar-reference-book { width:28px; height:28px; }
@media (hover:hover) { .grammar-reference-button:hover .tile-settings-ring { background:var(--surface-raised); } }

/* Home settings stay outside the header flow: the menu keeps its vertical position. */
:root[data-screen="home"] .brand { width:calc(100% - 68px); height:50px; }
.home-settings-button { --tile-circle:50px; position:absolute; right:0; top:calc(50% - 2px); transform:translateY(-50%); display:grid; place-items:center; width:52px; height:52px; padding:0; border:0; border-radius:50%; background:transparent; }
.home-settings-button:active:not(:disabled) { transform:translateY(-50%) scale(.985); }
.home-share-emoji { width:28px; height:28px; }
.home-settings-symbol { width:25px; height:25px; }
.brand-flag,.grammar-reference-book,.home-share-emoji,.support-coffee { transform:scale(1.3); transform-origin:center; }
.share-dialog-heading { display:grid; grid-template-columns:minmax(0,1fr) 44px; align-items:center; gap:12px; margin-bottom:12px; }
.share-dialog-heading h2 { margin:0; text-align:left; }
.share-close-button { display:grid; place-items:center; width:44px; height:44px; border:0; border-radius:50%; padding:0; background:var(--tint); }
.share-description { margin:0 0 18px; color:var(--muted); font-size:.9375rem; }
.share-services { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin-bottom:20px; }
.share-service { display:flex; align-items:center; gap:10px; min-width:0; min-height:64px; padding:10px 12px; border:1px solid var(--line); border-radius:18px; background:var(--surface-raised); color:var(--ink); font-size:.9375rem; font-weight:650; line-height:1.3; text-decoration:none; overflow-wrap:anywhere; }
.share-service-mark { display:grid; place-items:center; flex-shrink:0; width:30px; height:30px; }
.share-service-mark svg { width:26px; height:26px; }
.share-service:focus-visible { outline:3px solid var(--accent); outline-offset:3px; }
.share-service:active { background:var(--tint); }
.share-message-label { display:block; margin:0 0 8px; font-size:.875rem; font-weight:650; }
.share-message { display:block; width:100%; min-width:0; resize:none; padding:12px; border:1px solid var(--line); border-radius:16px; background:var(--surface-raised); color:var(--ink); font:inherit; font-size:1rem; line-height:1.45; overflow-wrap:anywhere; }
.share-message:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
.share-hint { color:var(--muted); font-size:.8125rem; margin:10px 0 18px; }
.share-status { margin:10px 0 0; min-height:1.45em; font-size:.875rem; line-height:1.45; color:var(--muted); }
.share-status[data-result="copied"] { color:var(--success); }
@media (min-width:600px) { .home-settings-button { top:50%; } }
@media (max-width:380px) { .share-service { gap:6px; padding:10px 8px; } }
@media (max-height:550px) and (orientation:landscape) { .home-settings-button { top:50%; } }
@media (hover:hover) and (pointer:fine) {
  .home-settings-button:hover .tile-settings-ring,.share-service:hover,.share-close-button:hover { background:var(--tint); }
}

.finish-dialog-actions { grid-template-columns:repeat(2,minmax(0,1fr)); }

.support-coffee { display:block; width:28px; height:28px; flex-shrink:0; object-fit:contain; }

/* Ko-fi support uses the app palette and a native external link. */
.support-panel { text-align:center; }
.support-title { display:flex; align-items:center; justify-content:center; gap:10px; margin:0 0 22px; font-size:1.45rem; font-weight:750; line-height:1.3; overflow-wrap:anywhere; }
.support-description { margin:0 auto 22px; max-width:34em; color:var(--muted); text-align:left; }
.support-description p { margin:0 0 16px; }
.support-description p:last-child { margin-bottom:0; }
.support-description strong { color:var(--ink); font-weight:700; }
.support-note { margin:0 0 24px; padding:14px 16px; border:1px solid var(--line); border-radius:18px; background:var(--surface-raised); color:var(--muted); font-size:.9375rem; line-height:1.5; }
.support-link { display:flex; align-items:center; justify-content:center; gap:12px; width:100%; text-decoration:none; touch-action:manipulation; }
.support-link svg { width:20px; height:20px; }
.support-link .support-coffee { width:22px; height:22px; flex-shrink:0; }
.support-link:focus-visible { outline:3px solid var(--accent); outline-offset:4px; }
.support-link:active { transform:scale(.985); }
.support-external { margin:12px 0 0; color:var(--muted); font-size:.8125rem; }
.support-domain { display:block; margin-top:4px; overflow-wrap:anywhere; }
.support-thanks { margin:22px 0 0; color:var(--muted); font-size:.9375rem; text-align:center; }
.support-email { margin:8px 0 0; color:var(--muted); font-size:.8125rem; line-height:1.45; text-align:center; -webkit-user-select:none; user-select:none; -webkit-touch-callout:none; overflow-wrap:anywhere; }

/* First-run choices remain inside the shared native dialog. */
dialog[data-onboarding] h2 { margin-bottom:14px; font-size:1.35rem; }
.onboarding-description { margin:0 0 18px; color:var(--muted); font-size:.9375rem; text-align:center; }
.onboarding-fieldset { min-width:0; margin:0 0 18px; padding:0; border:0; }
.onboarding-fieldset legend { margin-bottom:8px; padding:0; color:var(--muted); font-size:.875rem; font-weight:650; }
.onboarding-languages { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px; }
.onboarding-choice { min-width:0; min-height:44px; padding:9px 10px; border:1px solid var(--line); border-radius:14px; background:var(--surface-raised); color:var(--ink); font-size:.9375rem; font-weight:600; line-height:1.3; overflow-wrap:anywhere; }
.onboarding-choice[aria-pressed="true"] { border-color:var(--accent); background:var(--tint); }
.onboarding-languages .onboarding-choice:last-child { grid-column:1/-1; }
.onboarding-themes { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px; }
.onboarding-theme { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:6px; min-height:64px; padding:10px 4px; font-size:.8125rem; }
.onboarding-theme svg { width:20px; height:20px; }
.onboarding-welcome-text { color:var(--muted); }
.onboarding-welcome-text p { margin:0 0 16px; }
.onboarding-welcome-text p:last-child { margin-bottom:24px; color:var(--ink); }
@media (hover:hover) { .onboarding-choice:hover { background:var(--tint); } }
