@font-face { font-family: Lexend; src: url(/fonts/Lexend.ttf) format("truetype"); font-weight: 100 900; font-display: swap; }

:root {
  --blue: #006AA7; --blue-soft: #e2eef6; --yellow: #FECC02; --yellow-soft: #fff6cc; --yellow-ink: #6b5200;
  --ink: #1d2b36; --muted: #6b7c88; --line: #dde4ea; --surface: #f3f6f8; --bg: #ffffff;
  --ok: #1b7f3b; --ok-soft: #e3f3e8; --err: #b3261e; --err-soft: #fbe9e7;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: Lexend, system-ui, sans-serif; -webkit-tap-highlight-color: transparent; -webkit-text-size-adjust: 100%; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
h1, h2 { font-weight: 500; margin: 0; text-wrap: balance; }
p { margin: 0; }

.screen { min-height: 100dvh; max-width: 520px; margin: 0 auto; display: flex; flex-direction: column;
  padding: calc(env(safe-area-inset-top) + 18px) 22px calc(env(safe-area-inset-bottom) + 24px); }
.center { justify-content: center; text-align: center; gap: 18px; }
.logo { width: 100%; max-width: 300px; margin: 0 auto 6px; }
.tagline { font-size: 17px; font-weight: 500; color: var(--blue); }
.lead { color: var(--muted); line-height: 1.5; }
.small { font-size: 13px; }
.muted { color: var(--muted); }
.link { background: none; border: 0; color: var(--blue); font-weight: 500; padding: 4px 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

.field { display: grid; gap: 6px; text-align: left; }
.field label { font-size: 14px; font-weight: 500; }
input[type="email"], input[type="text"], select, textarea {
  font: 400 18px/1.4 Lexend, system-ui, sans-serif; color: var(--ink); width: 100%;
  border: 2px solid var(--line); border-radius: 14px; padding: 12px 14px; outline: none; background: var(--bg);
}
input:focus, select:focus, textarea:focus { border-color: var(--blue); }
input.code { letter-spacing: .4em; text-align: center; font-size: 24px; }
.error-text { color: var(--err); font-size: 14px; min-height: 20px; }

.btn { min-height: 54px; text-align: center; line-height: 1.3; border-radius: 14px; border: 2px solid var(--blue); cursor: pointer; font-size: 16px; font-weight: 500;
  display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; }
.btn.primary { background: var(--blue); color: #fff; }
.btn.secondary { background: var(--bg); color: var(--blue); }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .5; cursor: default; }
.btns { display: flex; gap: 12px; margin-top: 18px; }
.btns .btn { flex: 1; }
.icon-btn { border: 0; background: none; padding: 8px; margin: -8px; color: var(--ink); cursor: pointer; display: flex; }

/* top bar */
.top { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); }
.top .brand, .menu-head .brand { display: flex; align-items: center; gap: 8px; color: var(--blue); font-size: 20px; font-weight: 500; letter-spacing: -.01em; }
.top .brand img, .menu-head .brand img { width: 58px; height: auto; }

/* exercise */
.step-label { margin: 18px 0 0; font-size: 13px; font-weight: 500; color: var(--muted); }
.instr { margin: 6px 0 0; padding: 14px 16px; border-radius: 14px; background: var(--blue); color: #fff; font-size: 18px; line-height: 1.4; font-weight: 500; min-height: 54px; }
.sent-wrap { margin-top: 24px; }
.illus { margin: 18px 0 0; display: flex; justify-content: center; }
.illus img { width: min(150px, 20dvh); aspect-ratio: 1; border-radius: 22px; display: block; }
.illus + .sent-wrap { margin-top: 14px; }
/* extra story */
.story .story-title { margin-top: 14px; font-size: 20px; text-align: center; }
.story-text { margin-top: 10px; font-size: 22px; line-height: 1.55; }
.story-text span span { border-radius: 6px; padding: 0 2px; margin: 0 -2px; transition: background-color .08s; }
.story-text span span.hl { background: var(--yellow); }
.story-tr { margin-top: 14px; font-size: 14px; line-height: 1.5; color: var(--muted); }
.extra { margin-top: 14px; border-radius: 20px; background: var(--yellow-soft); padding: 18px 20px; display: grid; gap: 10px; }
.extra h2 { font-size: 19px; }
.extra .meta { font-size: 14px; color: var(--yellow-ink); }
.extra .btn.primary { background: var(--yellow); border-color: var(--yellow); color: var(--ink); }
.sent { font-size: 27px; line-height: 1.45; }
.sent span { border-radius: 6px; padding: 0 2px; margin: 0 -2px; transition: background-color .08s; }
.sent span.hl { background: var(--yellow); }
.hidden-text { font-size: 27px; color: var(--line); letter-spacing: .3em; line-height: 1.2; }
.hidden-text span { font-size: 14px; letter-spacing: 0; color: var(--muted); }
.tr { margin-top: 12px; font-size: 15px; line-height: 1.5; color: var(--muted); }
.tr-toggle { margin-top: 10px; font-size: 14px; align-self: flex-start; }
.synth { margin-top: 10px; font-size: 12px; color: var(--yellow-ink); background: var(--yellow-soft); border-radius: 8px; padding: 4px 8px; align-self: flex-start; }
.bottom { margin-top: auto; padding-top: 20px; display: flex; flex-direction: column; }
.hint { min-height: 20px; margin-bottom: 12px; text-align: center; font-size: 14px; color: var(--muted); }
.hint.error { color: var(--err); }
.bubbles { display: flex; justify-content: center; align-items: flex-end; gap: 22px; }
.bubble { border: 0; background: none; padding: 0; cursor: pointer; width: 132px; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; transition: opacity .2s, transform .12s; }
.bubble img { display: block; width: 100%; pointer-events: none; }
.bubble:disabled { opacity: .3; cursor: default; }
.bubble.playing:disabled { opacity: 1; }
.bubble.playing { animation: breathe 1.2s ease-in-out infinite; }
.bubble.recording { transform: scale(.92); animation: rec 1s ease-in-out infinite; }
.bubble.cta { animation: nudge 1.6s ease-in-out infinite; }
@keyframes nudge { 50% { transform: scale(1.07); } }
@keyframes breathe { 50% { transform: scale(1.05); } }
@keyframes rec { 50% { transform: scale(.97); } }
@media (prefers-reduced-motion: reduce) { .bubble.cta, .bubble.playing, .bubble.recording { animation: none; } }

/* Recording: everything but the sentence, the big mic and the held button fades and blurs. */
.exercise .top, .exercise .step-label, .exercise .instr, .exercise .illus, .exercise .tr, .exercise .tr-toggle,
.exercise .synth, .exercise .hint, .exercise .bubble.listen { transition: filter .25s, opacity .25s; }
.exercise.is-recording .top, .exercise.is-recording .step-label, .exercise.is-recording .instr, .exercise.is-recording .illus,
.exercise.is-recording .tr, .exercise.is-recording .tr-toggle, .exercise.is-recording .synth, .exercise.is-recording .hint,
.exercise.is-recording .bubble.listen { filter: blur(6px); opacity: .35; }
.exercise.is-recording { -webkit-user-select: none; user-select: none; }
.exercise.is-recording .bubble.speak { transform: scale(1.06); }
.rec-overlay { position: fixed; inset: 0; z-index: 5; pointer-events: none; display: grid; place-items: center; align-content: center; gap: 18px;
  padding-top: 14vh; background: radial-gradient(circle at 50% 58%, rgba(254, 204, 2, .22), rgba(255, 255, 255, 0) 60%); }
.rec-pulse { position: relative; width: 128px; height: 128px; border-radius: 50%; background: var(--yellow); color: var(--blue);
  display: grid; place-items: center; box-shadow: 0 12px 32px rgba(0, 0, 0, .18); animation: rec-beat 1s ease-in-out infinite; }
.rec-pulse::before, .rec-pulse::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 4px solid var(--yellow); animation: rec-ring 1.6s ease-out infinite; }
.rec-pulse::after { animation-delay: .8s; }
.rec-label { display: flex; align-items: center; gap: 8px; font-weight: 500; font-size: 17px; color: var(--ink); background: rgba(255, 255, 255, .9);
  padding: 6px 14px; border-radius: 999px; font-variant-numeric: tabular-nums; }
.rec-label i { width: 10px; height: 10px; border-radius: 50%; background: #d93025; animation: rec-blink 1s steps(2, start) infinite; }
@keyframes rec-ring { from { transform: scale(1); opacity: .9; } to { transform: scale(2.3); opacity: 0; } }
@keyframes rec-beat { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }
@keyframes rec-blink { to { visibility: hidden; } }
@media (prefers-reduced-motion: reduce) { .rec-pulse, .rec-pulse::before, .rec-pulse::after, .rec-label i { animation: none; } .rec-pulse::before, .rec-pulse::after { display: none; } }
.segment { display: flex; border-radius: 999px; background: #f0f3f5; padding: 4px; }
.segment div { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 0; border-radius: 999px; font-size: 15px; font-weight: 500; color: #8a98a3; transition: background-color .2s, color .2s; }
.segment .you.on { background: var(--yellow); color: var(--ink); }
.segment .teacher.on { background: var(--blue); color: #fff; }
.eq { display: none; gap: 2px; align-items: flex-end; height: 14px; }
.on .eq { display: inline-flex; }
.eq i { width: 3px; height: 14px; background: currentColor; border-radius: 1px; transform-origin: bottom; animation: eq .8s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: -.3s; }
.eq i:nth-child(3) { animation-delay: -.55s; }
@keyframes eq { 0%, 100% { transform: scaleY(.35); } 50% { transform: scaleY(1); } }

/* writing */
.writer textarea { font-size: 22px; min-height: 96px; resize: vertical; }
.result { margin-top: 14px; display: grid; gap: 12px; }
.verdict { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.verdict .badge { border-radius: 999px; padding: 3px 12px; font-size: 14px; white-space: nowrap; }
.verdict.ok .badge { background: var(--ok-soft); color: var(--ok); }
.verdict.some .badge { background: var(--yellow); color: var(--ink); }
.verdict.many .badge { background: var(--err-soft); color: var(--err); }
.card { border-radius: 14px; padding: 12px 14px; background: #f5f7f9; }
.card.correct { background: var(--ok-soft); }
.card .label { font-size: 12px; font-weight: 500; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.line { font-size: 21px; line-height: 1.7; }
.w { border-radius: 5px; padding: 0 2px; }
.w.err { background: var(--err-soft); color: var(--err); text-decoration: underline wavy var(--err); text-underline-offset: 4px; }
.w.extra { color: var(--err); text-decoration: line-through; text-decoration-thickness: 2px; }
.w.fix { background: #c9ecd3; color: var(--ok); font-weight: 500; }
.w.add { color: var(--ok); font-weight: 500; text-decoration: underline dashed; text-underline-offset: 4px; }
.w.swap { background: #fff1b8; text-decoration: underline var(--yellow); text-decoration-thickness: 3px; text-underline-offset: 4px; }
.w.style { text-decoration: underline dotted var(--muted); text-underline-offset: 4px; }
.gap, .l-missing { color: var(--err); font-weight: 600; }
.l-missing { font-size: .8em; vertical-align: .35em; }
.l-wrong { color: var(--err); background: #f6c9c4; border-radius: 3px; }
.l-extra { color: var(--err); text-decoration: line-through; }
.l-fix { background: #c9ecd3; color: var(--ok); font-weight: 600; border-radius: 3px; }
.notes { margin: 0; padding-left: 18px; color: var(--muted); font-size: 14px; display: grid; gap: 2px; }

/* popup */
.popup { position: fixed; inset: 0; z-index: 20; background: rgba(16, 30, 42, .45); display: flex; align-items: center; justify-content: center; padding: 24px; }
.popup-card { background: #fff; border-radius: 20px; padding: 26px 22px 22px; max-width: 360px; width: 100%; text-align: center; display: grid; gap: 10px; }
.popup-card img { width: 84px; margin: 0 auto; }
.popup-title { font-size: 20px; font-weight: 500; }
.popup-card p { line-height: 1.5; }
.help { text-align: left; background: #fff8d6; border-radius: 14px; padding: 14px 16px; }
.help ol { margin: 6px 0 0; padding-left: 20px; line-height: 1.55; }

/* language and placement */
.list { display: grid; gap: 8px; margin-top: 16px; }
.choice { text-align: left; border: 2px solid var(--line); border-radius: 14px; padding: 12px 16px; background: var(--bg); cursor: pointer; display: grid; gap: 2px; }
.choice:hover, .choice:focus-visible { border-color: var(--blue); outline: none; }
.choice .big { font-size: 18px; font-weight: 500; }
.choice .sub { font-size: 13px; color: var(--muted); }
.level-card { border: 1px solid var(--line); border-radius: 16px; padding: 16px; display: grid; gap: 10px; }
.level-card h2 { font-size: 17px; }
.example { display: grid; grid-template-columns: 40px 1fr; gap: 10px; align-items: center; }
.play { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--blue); color: #fff; display: grid; place-items: center; cursor: pointer; }
.play svg { width: 18px; height: 18px; }
.example .sv { font-size: 17px; }
.example .tr { margin: 2px 0 0; font-size: 14px; }

/* home */
.today { margin-top: 22px; border-radius: 20px; background: var(--blue); color: #fff; padding: 20px; display: grid; gap: 12px; }
.today h2 { font-size: 22px; }
.today .btn.primary { background: #fff; color: var(--blue); border-color: #fff; }
.today.locked { background: var(--surface); color: var(--ink); }
.today .meta { opacity: .85; font-size: 14px; }
.course { margin-top: 26px; display: grid; gap: 6px; }
.course h3 { margin: 0 0 6px; font-size: 15px; font-weight: 500; color: var(--muted); }
.line-list { list-style: none; margin: 0; padding: 0; position: relative; }
.line-list::before { content: ""; position: absolute; left: 20px; top: 22px; bottom: 22px; width: 5px; border-radius: 2px; background: var(--line); }
.station { position: relative; display: grid; grid-template-columns: 46px 1fr; gap: 14px; padding: 9px 0; align-items: center; }
.station .dot { width: 46px; height: 46px; border-radius: 50%; background: #fff; border: 5px solid var(--line); z-index: 1; display: grid; place-items: center; font-size: 17px; font-weight: 600; color: var(--muted); }
.station.done .dot { background: var(--blue); border-color: var(--blue); color: #fff; }
.station.current .dot { border-color: var(--blue); color: var(--blue); box-shadow: 0 0 0 7px var(--blue-soft); }
.station .name { font-weight: 500; line-height: 1.3; font-size: 18px; }
.station .name small { display: block; font-weight: 400; color: var(--muted); font-size: 13px; }
.bar { margin-top: 6px; height: 6px; border-radius: 3px; background: var(--surface); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--yellow); border-radius: 3px; }

/* menu sheet */
.menu { position: fixed; inset: 0; background: rgba(16, 30, 42, .35); z-index: 10; display: flex; justify-content: flex-end; }
.menu-panel { width: min(88vw, 380px); height: 100%; background: #fff; overflow-y: auto; padding: calc(env(safe-area-inset-top) + 18px) 20px calc(env(safe-area-inset-bottom) + 20px); display: flex; flex-direction: column; gap: 18px; }
.menu-head { display: flex; justify-content: space-between; align-items: center; }
.menu-head img { width: 190px; }
.setting { display: grid; gap: 6px; }
.setting > span { font-size: 14px; font-weight: 500; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 15px; }
.switch input { width: 22px; height: 22px; accent-color: var(--blue); }
.danger { color: var(--err); }
.dev { border-top: 1px dashed var(--line); padding-top: 14px; display: grid; gap: 8px; }
.dev pre { white-space: pre-wrap; font-size: 12px; background: var(--surface); border-radius: 10px; padding: 10px; max-height: 260px; overflow: auto; }

/* level info */
.level-head { display: flex; align-items: center; gap: 8px; }
.info-btn { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--blue); background: var(--bg); color: var(--blue);
  font: italic 600 13px/1 Georgia, serif; display: inline-grid; place-items: center; padding: 0; cursor: pointer; vertical-align: 2px; flex: none; }
.info-btn[aria-expanded="true"] { background: var(--blue); color: #fff; }
.info-panel { margin: 6px 0 2px; font-size: 14px; line-height: 1.45; color: var(--ink); background: var(--blue-soft); border-radius: 10px; padding: 8px 10px; }
.station .info-btn { margin-left: 4px; }

.warn-plate { margin-top: 12px; padding: 12px 14px; border-radius: 14px; background: var(--yellow-soft); color: var(--yellow-ink); font-size: 15px; line-height: 1.45; }
.screen-title { margin-top: 28px; }

/* Quick mode: clearly marked, yellow-black stripes */
.quick-tag { display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #1d2b36;
  background: repeating-linear-gradient(-45deg, var(--yellow) 0 10px, #ffe36b 10px 20px); border-radius: 999px; padding: 3px 10px; }
.quick-panel { margin-top: 16px; border: 2px dashed var(--yellow); border-radius: 18px; padding: 14px 16px; display: grid; gap: 10px; background: var(--yellow-soft); }
.quick-row { display: flex; gap: 8px; }
.quick-row .btn { min-height: 44px; padding: 8px 14px; }
.quick-row input { width: 5.5em; text-align: center; font-size: 18px; padding: 8px; }
.quick-row #quickOpen { flex: 1; }
.quick-bar { margin-top: 10px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.quick-bar button { font: inherit; font-size: 13px; font-weight: 500; border: 1.5px solid var(--yellow-ink); background: var(--yellow-soft); color: var(--yellow-ink);
  border-radius: 999px; padding: 4px 10px; cursor: pointer; }

/* Word list */
.words-tools { display: flex; gap: 10px; margin-top: 16px; position: sticky; top: 0; background: var(--bg); padding: 8px 0; z-index: 2; }
.words-tools input { flex: 1; min-width: 0; min-height: 48px; padding: 0 14px; font: inherit; font-size: 17px; color: var(--ink); background: var(--bg); border: 2px solid var(--line); border-radius: 12px; }
.words-tools input:focus { outline: none; border-color: var(--blue); }
.words-tools .btn { min-height: 48px; }
.word-group h2 { margin-top: 22px; font-size: 20px; color: var(--blue); border-bottom: 2px solid var(--yellow); padding-bottom: 4px; }
.word-group dl { margin: 0; }
.word { padding: 10px 0; border-bottom: 1px solid var(--line); break-inside: avoid; }
.word dt .lemma { font-weight: 600; font-size: 18px; }
.word dt .pos { font-size: 12.5px; color: var(--muted); margin-left: 4px; }
.word dd { margin: 2px 0 0; }
.word .forms { font-size: 15px; }
.word .gloss { font-size: 15px; color: var(--muted); }
@media print {
  .no-print, .words-tools { display: none !important; }
  body { background: #fff; }
  .screen { max-width: none; min-height: 0; padding: 0; }
  .words-page .screen-title { margin-top: 0; font-size: 22px; }
  .words { columns: 2; column-gap: 28px; font-size: 11pt; }
  .word-group h2 { break-after: avoid; margin-top: 10px; font-size: 14pt; }
  .word { padding: 4px 0; }
  .word dt .lemma { font-size: 12pt; }
  .word .forms, .word .gloss { font-size: 10.5pt; }
  .word .gloss { color: #333; }
}
.quick-bar .quick-info { flex-basis: 100%; font-size: 12px; color: var(--yellow-ink); }
.remember { display: flex; align-items: center; gap: 10px; margin: 4px 0 12px; font-size: 15px; cursor: pointer; }
.remember input { width: 22px; height: 22px; accent-color: var(--blue); margin: 0; }

/* Brand header on every screen; centred screens keep it at the top. */
.screen { position: relative; }
.center > .top:first-child { position: absolute; top: calc(env(safe-area-inset-top) + 18px); left: 22px; right: 22px; }
.lesson-meta { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
/* Back to top */
.to-top { position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 50; width: 54px; height: 54px;
  border-radius: 50%; border: 0; background: #FECC02; color: #006AA7; display: grid; place-items: center; cursor: pointer;
  box-shadow: 0 6px 18px rgb(0 0 0 / .18); opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity .2s, transform .2s; }
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { background: #ffd83a; }
.to-top:focus-visible { outline: 3px solid #006AA7; outline-offset: 3px; }
@media print { .to-top { display: none; } }

/* Feedback dialog and header actions */
.top-actions { display: flex; align-items: center; gap: 4px; }
.feedback-dialog { position: fixed; inset: 0; z-index: 60; display: grid; place-items: end center; padding: 12px; background: rgb(16 36 47 / .5); }
@media (min-width: 600px) { .feedback-dialog { place-items: center; } }
.feedback-dialog .sheet { box-sizing: border-box; width: min(520px, 100%); background: var(--bg); border-radius: 22px; padding: 22px; display: grid; gap: 12px; box-shadow: 0 18px 50px rgb(0 0 0 / .25); }
.feedback-dialog h2 { margin: 0; font-size: 21px; color: var(--blue); }
.feedback-dialog textarea { box-sizing: border-box; width: 100%; font: inherit; font-size: 17px; padding: 12px; border: 2px solid var(--line); border-radius: 14px; resize: vertical; }
.feedback-dialog textarea:focus { outline: none; border-color: var(--blue); }
.feedback-dialog .btns { display: flex; gap: 10px; justify-content: flex-end; }
.feedback-dialog .btns .btn { flex: 0 1 auto; }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.ts:empty { display: none; }
/* Leave room for the header on centred screens so tall content never slides under it. */
.center:has(> .top:first-child) { padding-top: calc(env(safe-area-inset-top) + 84px); }

/* Language picker on the sign-in screen (same look as on the web site). */
.lang-picker { flex: none; max-width: 9.5em; font: 500 14px/1.2 Lexend, system-ui, sans-serif; color: var(--blue);
  background: #fff; border: 2px solid var(--line); border-radius: 999px; padding: 5px 10px; }
.top .brand { white-space: nowrap; }
.top:has(.lang-picker) .brand { font-size: 17px; }
.top:has(.lang-picker) .brand img { width: 46px; }
/* Word list sort buttons */
.words-sort { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 14px; }
.words-sort button { font: inherit; font-size: 14px; font-weight: 500; padding: 7px 12px; border-radius: 999px; border: 2px solid var(--line); background: var(--bg); color: var(--ink); cursor: pointer; }
.words-sort button[aria-pressed="true"] { background: var(--blue); border-color: var(--blue); color: #fff; }
.words-source { margin-top: 18px; }

/* Tell a friend (after the first fully trained sentence) */
.share { background: var(--yellow-soft); border-radius: 18px; padding: 16px 18px; text-align: left; display: grid; gap: 8px; }
.share h2 { margin: 0; font-size: 19px; color: var(--blue); }
.share p { margin: 0; color: var(--ink); }
.share .btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.share .btn { flex: 1 1 140px; }

/* ---------- Small screens: nothing wider than the screen, finger-sized targets ---------- */
/* Flex/grid children may shrink below their content; long words wrap instead of widening the page. */
.screen > *, .field > *, .list > *, .today > *, .extra > *, .share > * { min-width: 0; }
h1, h2, .lead, .tagline, .sent, .story-text, .tr, .line, .choice .sub, .word dd { overflow-wrap: break-word; }
.choice .big { overflow-wrap: anywhere; }
.ts { max-width: 100%; overflow: hidden; }
.ts iframe { max-width: 100%; }
.top .brand { min-width: 0; }
.lang-picker { min-height: 44px; }
/* Sign-in header: on the narrowest phones the language picker gets its own row. */
@media (max-width: 359px) {
  .top:has(.lang-picker) { flex-wrap: wrap; row-gap: 6px; }
  .top:has(.lang-picker) .lang-picker { margin-left: auto; }
  .center:has(> .top:first-child .lang-picker) { padding-top: calc(env(safe-area-inset-top) + 136px); }
}
/* Icon buttons: 44 px hit area, same visual position (negative margin = padding). */
.icon-btn { min-width: 44px; min-height: 44px; padding: 10px; margin: -10px; align-items: center; justify-content: center; }
.top-actions { gap: 0; margin-right: -10px; }
.top-actions .icon-btn { margin-block: -10px; margin-inline: 0; }
/* The small (i) button keeps its look but gets an invisible 44 px hit area. */
.info-btn { position: relative; }
.info-btn::after { content: ""; position: absolute; inset: -11px; border-radius: 50%; }
.example { grid-template-columns: 44px minmax(0, 1fr); }
.play { width: 44px; height: 44px; }
.remember { min-height: 44px; margin: 0 0 4px; }
.switch { min-height: 44px; }
.menu-panel > .link, .field .link { min-height: 44px; }
.tr-toggle { min-height: 44px; margin-top: 0; }
.words-sort button { min-height: 44px; padding: 8px 14px; }
/* Feedback dialog: the sheet never grows wider than the screen. */
.feedback-dialog { grid-template-columns: minmax(0, 1fr); }
.feedback-dialog .sheet { max-width: 100%; justify-self: center; }
/* Back-to-top: smaller on phones, and long pages end with room for it. */
@media (max-width: 719px) { .to-top { right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); width: 46px; height: 46px; } }
.words-page { padding-bottom: calc(env(safe-area-inset-bottom) + 84px); }
.feedback-dialog .sheet { grid-template-columns: minmax(0, 1fr); }
.feedback-dialog .btns { flex-wrap: wrap; }
/* Writing check: the verdict wraps instead of pushing the cards off screen. */
.result { grid-template-columns: minmax(0, 1fr); }
.verdict { min-width: 0; }
.verdict .badge { white-space: normal; border-radius: 14px; line-height: 1.35; }
#personas .choice .big { font-size: 15px; }
.menu-head { gap: 12px; }
