/* Тренажёр финского — design variant A «Тетрадь» (design/*.dc.html, 390 × 844). */

:root {
  --paper: #F6F7F7;
  --ink: #1E2433;
  --muted: #545C6E;
  --rule: #CBD2DC;
  --rule2: #AEB6C2;
  --strong: #1F45B5;
  --weak: #BA4A0D;
  --grid: rgba(70, 110, 170, .09);
  --ru: 'Ysabeau Office', 'Trebuchet MS', sans-serif;
  --fi: 'Atkinson Hyperlegible Next', Verdana, sans-serif;
  --st: env(safe-area-inset-top, 0px);
  --sr: env(safe-area-inset-right, 0px);
  --sb: env(safe-area-inset-bottom, 0px);
  --sl: env(safe-area-inset-left, 0px);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 16px 16px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--ru);
  font-size: 16px;
  color: var(--ink);
  -webkit-tap-highlight-color: transparent;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
button:disabled { cursor: default; }
a { color: var(--ink); }
:focus-visible { outline: 2px solid var(--strong); outline-offset: 2px; }
[hidden] { display: none !important; }

.fi { font-family: var(--fi); }
.ru { font-family: var(--ru); }
.muted { color: var(--muted); }
.lbl {
  font-family: var(--ru);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Gradation marks: colour plus weight, so colour is never the only signal. */
.st { color: var(--strong); font-weight: bolder; }
.wk { color: var(--weak); font-weight: bolder; }
.gap0 {
  display: inline-block;
  width: 3px;
  height: .78em;
  margin: 0 .06em;
  vertical-align: -.02em;
  border-radius: 1px;
  background: var(--weak);
}
b, strong { font-weight: 700; }

/* ── the screen ──────────────────────────────────────────────────────────── */
#app { min-height: 100vh; min-height: 100dvh; }

.screen {
  --gap: 14px;
  --pt: 16px;
  --pb: 24px;
  max-width: 430px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  padding: calc(var(--pt) + var(--st)) calc(16px + var(--sr)) calc(var(--pb) + var(--sb)) calc(16px + var(--sl));
}
@media (min-width: 600px) and (min-height: 561px) {
  .screen { border-left: 1px solid var(--rule); border-right: 1px solid var(--rule); }
}

.pane { display: flex; flex-direction: column; gap: var(--gap); min-width: 0; }
.pane.answer { flex: 1; }
.part-answer, .part-feedback { display: flex; flex-direction: column; gap: var(--gap); min-width: 0; }
.part-answer:empty, .part-feedback:empty { display: none; }
.spacer { flex: 1; }

/* the bottom actions stay reachable when the content is taller than the screen */
.actions {
  position: sticky;
  bottom: 0;
  z-index: 2;
  display: flex;
  gap: 8px;
  margin: -10px calc(-16px - var(--sr)) calc(-12px - var(--sb)) calc(-16px - var(--sl));
  padding: 10px calc(16px + var(--sr)) calc(12px + var(--sb)) calc(16px + var(--sl));
}
.overflowing .actions { background: var(--paper); box-shadow: 0 -1px 0 var(--rule); }
.actions > .btn { flex: 1; }

/* ── headers ─────────────────────────────────────────────────────────────── */
.top { display: flex; align-items: center; gap: 6px; min-height: 44px; }
.top h1 { margin: 0; font-size: 20px; font-weight: 700; flex: 1; min-width: 0; }
.top .count { font-family: var(--fi); font-size: 16px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.top .timer { font-family: var(--fi); font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; }
.icon-btn {
  width: 44px;
  height: 44px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
}
a.icon-btn:hover, button.icon-btn:hover { color: var(--strong); }

/* ── progress squares ────────────────────────────────────────────────────── */
.sqs { display: flex; flex-wrap: wrap; gap: 2px; align-items: flex-start; }
.sq {
  flex: 0 1 13px;
  min-width: 5px;
  aspect-ratio: 1;
  border: 1.5px solid var(--rule2);
}
.sq.on { background: var(--ink); border-color: var(--ink); }
.sq.cur { border: 2px solid var(--ink); }
.sqs.small .sq { flex-basis: 10px; }

/* ── common blocks ───────────────────────────────────────────────────────── */
.card {
  background: #FFFFFF;
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.between { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.between.base { align-items: baseline; }
.tag {
  font-size: 13px;
  font-weight: 700;
  border: 1.5px solid var(--ink);
  border-radius: 4px;
  padding: 2px 8px;
  white-space: nowrap;
}
.tr { font-size: 16px; color: var(--muted); text-align: right; }
.word { margin: 0; font-family: var(--fi); font-weight: 800; line-height: 1.1; white-space: nowrap; overflow-wrap: normal; }
.w64 { font-size: 64px; line-height: 1; }
.w52 { font-size: 52px; }
.w46 { font-size: 46px; }
.w44 { font-size: 44px; }
.w40 { font-size: 40px; }
.prompt-line { margin: 0; font-size: 17px; }
.prompt-line .fi { font-weight: 700; }
.stack { display: flex; flex-direction: column; gap: 8px; }

.btn {
  height: 52px;
  border: 0;
  border-radius: 6px;
  padding: 0 14px;
  background: var(--ink);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--ru);
  font-size: 18px;
  font-weight: 700;
  text-decoration: none;
  text-align: center;
  line-height: 1.1;
}
.btn:hover { color: #FFFFFF; background: #2C3448; }
.btn.ghost { background: #FFFFFF; color: var(--ink); border: 1.5px solid var(--ink); }
.btn.ghost:hover { background: #EEF1F5; color: var(--ink); }
.btn.danger { background: var(--weak); }
.btn.ghost.danger { background: #FFFFFF; color: var(--weak); border-color: var(--weak); }
.btn.small { height: 44px; font-size: 16px; }
.btn:disabled { background: var(--rule2); color: #FFFFFF; border-color: var(--rule2); }
.btn.ghost:disabled { background: #FFFFFF; color: var(--rule2); }

.key {
  width: 52px;
  height: 52px;
  flex: none;
  padding: 0;
  border: 1.5px solid var(--ink);
  border-radius: 6px;
  background: #FFFFFF;
  color: var(--ink);
  font-family: var(--fi);
  font-size: 22px;
  font-weight: 700;
}
.key:active { background: #EEF1F5; }

/* the answer field and the checked answer */
.abox {
  min-height: 48px;
  margin: 0;
  border: 1.5px solid var(--ink);
  border-radius: 6px;
  background: #FFFFFF;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.abox:focus-within { box-shadow: 0 0 0 3px rgba(31, 69, 181, .16); }
.abox input {
  flex: 1;
  min-width: 0;
  height: 45px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-family: var(--fi);
  font-size: 20px;
}
.abox.bad { border-color: var(--rule2); }
.abox .res { font-family: var(--fi); font-size: 20px; font-weight: 700; padding: 6px 0; }
.abox .res.big { font-size: 22px; }
.abox .res-typed { font-size: 20px; color: var(--muted); padding: 6px 0; overflow-wrap: anywhere; }
.abox .side { display: flex; align-items: center; gap: 10px; font-size: 15px; color: var(--muted); text-align: right; }
.abox .side svg { flex: none; color: var(--ink); }

.near { margin: 0; font-size: 15px; line-height: 1.4; }
.rulebox {
  background: #FFFFFF;
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 15px;
  line-height: 1.4;
}
.rulebox p { margin: 0; }
.formula { font-family: var(--fi); font-weight: 700; }
.paradigm {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 16px;
  font-family: var(--fi);
  font-size: 16px;
}
.paradigm .asked { font-weight: 700; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.tip {
  margin: 0;
  font-size: 15px;
  line-height: 1.4;
  background: #FFFFFF;
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 10px 14px;
}

/* ── Сегодня ─────────────────────────────────────────────────────────────── */
.screen.today { --gap: 20px; --pt: 24px; }
.today-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.today-head .date { font-size: 14px; color: var(--muted); }
.today-head h1 { margin: 0; font-size: 32px; line-height: 1.1; font-weight: 700; }
.today-head nav { display: flex; gap: 2px; }
.titles { display: flex; flex-direction: column; gap: 2px; }
.streak { display: flex; flex-direction: column; gap: 8px; }
.streak .count { font-size: 16px; font-weight: 600; }
.days { display: grid; grid-template-columns: repeat(14, minmax(0, 18px)) auto; gap: 3px; align-items: center; }
.day { aspect-ratio: 1; border: 1.5px solid var(--rule2); }
.day.on { background: var(--ink); border: 0; }
.day.now { border: 2px solid var(--ink); }
.day.now.on { box-shadow: inset 0 0 0 2px #FFFFFF; }
.days .hint { font-size: 13px; color: var(--muted); margin-left: 6px; white-space: nowrap; }
.day-card { gap: 14px; }
.day-card h2 { margin: 0; font-size: 21px; font-weight: 700; }
.day-card .est { font-size: 15px; color: var(--muted); white-space: nowrap; }
.plan { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 16px; }
.plan li { display: flex; justify-content: space-between; gap: 12px; }
.plan .v { color: var(--muted); }
.plan-note { margin: 0; font-size: 15px; line-height: 1.4; color: var(--muted); }
.apart { display: flex; flex-direction: column; gap: 6px; }
.rows { display: flex; flex-direction: column; border-bottom: 1px solid var(--rule); }
.row-link {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--rule);
  color: var(--ink);
  text-decoration: none;
}
.row-link:hover { color: var(--strong); }
.row-link .t { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.row-link .name { font-size: 17px; font-weight: 600; }
.row-link .sub { font-size: 13px; color: var(--muted); }
.row-link svg { flex: none; }
.badge {
  min-width: 28px;
  height: 28px;
  padding: 0 4px;
  flex: none;
  border: 1.5px solid var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--fi);
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}

/* ── Спринт ──────────────────────────────────────────────────────────────── */
.screen.sprint { --gap: 16px; }
.sprint .pane.prompt { flex: 1; }
.sprint .pane.answer { flex: none; }
.stage {
  flex: 1;
  min-height: 150px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
}
.stage .word { max-width: 100%; }
.stage .sub { font-size: 17px; color: var(--muted); }
.types { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.types.merged { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ty {
  height: 92px;
  padding: 0 4px;
  border: 1.5px solid var(--ink);
  border-radius: 6px;
  background: #FFFFFF;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-family: var(--fi);
  user-select: none;
  -webkit-user-select: none;
}
.ty .n { font-size: 34px; font-weight: 800; line-height: 1; }
.ty .model { font-size: 14px; color: var(--muted); line-height: 1.2; }
.ty:active { background: #EEF1F5; }
.ty.hit { background: var(--ink); color: #FFFFFF; }
.ty.hit .model { color: #D5DAE2; }
.ty.miss { border-style: dashed; color: var(--muted); }
.last {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-top: 1px solid var(--rule);
  padding-top: 10px;
  min-height: 62px;
}
.last .line { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 15px; min-height: 20px; }
.last .what { display: flex; align-items: center; gap: 8px; min-width: 0; flex-wrap: wrap; }
.last .what .fi { font-weight: 700; }
.last .why { font-size: 14px; color: var(--muted); margin-top: -2px; }
.last .stats { display: flex; gap: 16px; font-size: 14px; color: var(--muted); flex-wrap: wrap; }
.hint { margin: 0; font-size: 13px; color: var(--muted); text-align: center; }
.result-big { font-family: var(--fi); font-size: 64px; font-weight: 800; line-height: 1; margin: 0; }

/* ── Формы, Форма → инфинитив, Имена ─────────────────────────────────────── */
.screen.reverse, .screen.nouns { --gap: 12px; }
.qcard.center { align-items: center; text-align: center; gap: 8px; }
.qcard.center .word { max-width: 100%; }
.qcard .form-line { font-size: 15px; color: var(--muted); }
.steps { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; border-top: 1px solid var(--rule); }
.steps li { display: flex; gap: 12px; align-items: baseline; padding: 6px 0; border-bottom: 1px solid var(--rule); }
.steps .num { font-family: var(--fi); font-size: 13px; font-weight: 700; color: var(--muted); }
.steps .body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.steps .main { font-family: var(--fi); font-size: 16px; font-weight: 700; }
.steps .sub { font-size: 14px; color: var(--muted); }
.noun-rule { margin: 0; font-size: 15px; line-height: 1.4; }
.related { margin: 0; display: grid; grid-template-columns: 112px minmax(0, 1fr); border-top: 1px solid var(--rule); font-family: var(--fi); }
.related dt { padding: 4px 0; border-bottom: 1px solid var(--rule); }
.related dt.cur { color: var(--ink); }
.related dd { margin: 0; padding: 4px 0; border-bottom: 1px solid var(--rule); font-size: 17px; }
.related dd.cur { font-weight: 700; }

/* ── Значение ────────────────────────────────────────────────────────────── */
.mean-q { padding: 20px 16px; gap: 14px; }
.mean-q .between .word { flex: 1; min-width: 0; }
.speak-slot { display: contents; }
.speak {
  width: 44px;
  height: 44px;
  flex: none;
  padding: 0;
  border: 1.5px solid var(--ink);
  border-radius: 22px;
  background: #FFFFFF;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
}
.speak:active { background: #EEF1F5; }
.ru-big { margin: 0; font-size: 32px; line-height: 1.15; font-weight: 700; overflow-wrap: anywhere; }
.dash { border-top: 1.5px dashed var(--rule2); }
.mean-a { padding: 20px 16px; gap: 14px; }
/* portrait: the revealed half continues the question card, as one card with a dashed rule */
.mean-q.joined { border-bottom: 0; border-radius: 6px 6px 0 0; padding-bottom: 0; }
.mean-a.joined { margin-top: calc(-1 * var(--gap)); border-top: 0; border-radius: 0 0 6px 6px; padding-top: 14px; }
.mean-a:not(.joined) > .dash { display: none; }
.keyforms { margin: 0; display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 8px 10px; align-items: baseline; }
.keyforms dd { margin: 0; font-family: var(--fi); font-size: 17px; }
.grades { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; flex: 1; }
.grade {
  height: 64px;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 0 6px;
  font-family: var(--ru);
}
.grade b { font-size: 17px; font-weight: 700; }
.grade small { font-size: 13px; }
.grade.no { border: 1.5px solid var(--ink); background: #FFFFFF; color: var(--ink); }
.grade.no small { color: var(--muted); }
.grade.yes { border: 0; background: var(--ink); color: #FFFFFF; }
.grade.yes small { color: #D5DAE2; }
.btn.tall { height: 64px; }

/* ── Итог ────────────────────────────────────────────────────────────────── */
.screen.summary { --pt: 28px; }
.valmis { margin: 0; font-family: var(--fi); font-size: 42px; line-height: 1.05; font-weight: 800; }
.summary-head { display: flex; flex-direction: column; gap: 4px; }
.summary-head .sub { font-size: 17px; color: var(--muted); }
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tile { background: #FFFFFF; border: 1px solid var(--rule); border-radius: 6px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tile .v { font-family: var(--fi); font-size: 28px; font-weight: 800; line-height: 1.1; white-space: nowrap; }
.tile .k { font-size: 13px; color: var(--muted); }
.bars {
  box-sizing: content-box;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
  align-items: end;
  height: 120px;
  border-bottom: 1.5px solid var(--ink);
  padding-bottom: 4px;
}
.bars > div { display: flex; justify-content: center; }
.bar { width: 16px; background: repeating-linear-gradient(to top, var(--ink) 0 8px, transparent 8px 10px); }
.bar-labels { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; text-align: center; }
.bar-labels > span { display: flex; flex-direction: column; }
.bar-labels .t { font-family: var(--fi); font-size: 16px; font-weight: 700; }
.bar-labels .s { font-size: 13px; color: var(--muted); }
.bar-labels .slow .t { font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }
.bar-labels .slow .s { color: var(--ink); font-weight: 700; }
.say { margin: 0; font-size: 15px; line-height: 1.4; }
.mistakes { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.mistakes li { min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--rule); padding: 4px 0; }
.mistakes .q { font-size: 16px; min-width: 0; }
.mistakes .a { font-size: 17px; font-weight: 700; text-align: right; }
.duo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.duo .btn { font-size: 17px; }

/* ── Словарь ─────────────────────────────────────────────────────────────── */
.screen.dict { --gap: 12px; --pb: 16px; }
.seg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1.5px solid var(--ink); border-radius: 6px; overflow: hidden; }
.seg.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.seg button { height: 42px; border: 0; background: #FFFFFF; color: var(--ink); font-family: var(--ru); font-size: 16px; font-weight: 700; }
.seg button + button { border-left: 1.5px solid var(--ink); }
.seg button[aria-pressed="true"] { background: var(--ink); color: #FFFFFF; }
.seg .fi { font-family: var(--fi); }
.in {
  height: 44px;
  width: 100%;
  min-width: 0;
  padding: 0 12px;
  border: 1.5px solid var(--ink);
  border-radius: 6px;
  background: #FFFFFF;
  font-size: 18px;
  color: var(--ink);
}
.in.fi { font-family: var(--fi); }
.in:focus { outline: none; box-shadow: 0 0 0 3px rgba(31, 69, 181, .16); }
.searchrow { display: flex; gap: 8px; }
.searchrow .in { flex: 1; }
.searchrow .btn { flex: none; height: 44px; font-size: 16px; padding: 0 12px; }
.newverb { background: #FFFFFF; border: 1.5px solid var(--ink); border-radius: 6px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.newverb h2 { margin: 0; font-size: 18px; font-weight: 700; }
.field { display: flex; flex-direction: column; gap: 4px; }
.analysis { display: flex; flex-direction: column; gap: 8px; border-top: 1px dashed var(--rule2); border-bottom: 1px dashed var(--rule2); padding: 10px 0; }
.arow { display: flex; align-items: baseline; gap: 10px; }
.arow > .lbl { width: 76px; flex: none; }
.atype { font-family: var(--fi); font-size: 22px; font-weight: 800; }
.awhy { font-size: 14px; color: var(--muted); flex: 1; }
.agrade { display: flex; flex-direction: column; gap: 2px; }
.agrade .why { font-size: 15px; }
.agrade .pre { font-family: var(--fi); font-size: 16px; }
.linkbtn { border: 0; background: none; padding: 4px 0; font-size: 14px; font-weight: 700; color: var(--strong); text-decoration: underline; text-underline-offset: 3px; flex: none; }
.note { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.4; }
.note.warn { font-size: 14px; }
.err { margin: 0; font-size: 15px; color: var(--weak); }
.vlist { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.vrow { min-height: 52px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--rule); color: var(--ink); text-decoration: none; padding: 4px 0; }
.vrow:hover .w .fi { color: var(--strong); }
.vrow .w { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.vrow .w .fi { font-size: 17px; font-weight: 700; }
.vrow .w .ru { font-size: 14px; color: var(--muted); }
.vtag { font-size: 13px; font-weight: 700; border: 1.5px solid var(--ink); border-radius: 4px; padding: 1px 7px; white-space: nowrap; }
.vtag.fi { font-family: var(--fi); }
.mast { display: flex; gap: 2px; }
.mq { width: 9px; height: 9px; border: 1.5px solid var(--rule2); }
.mq.on { background: var(--ink); border-color: var(--ink); }
.empty { margin: 0; padding: 16px 0; font-size: 15px; color: var(--muted); }
.own { font-size: 12px; color: var(--muted); }
.vcard-tenses { display: flex; flex-direction: column; gap: 14px; }
.vcard-tenses > section { display: flex; flex-direction: column; gap: 6px; }

/* ── Настройки ───────────────────────────────────────────────────────────── */
.screen.settings { --gap: 12px; }
.sgroup { display: flex; flex-direction: column; border-bottom: 1px solid var(--rule); }
.srow { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 12px 0; border-top: 1px solid var(--rule); }
.srow.col { flex-direction: column; align-items: stretch; gap: 10px; }
.srow .t { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.srow .name { font-size: 17px; font-weight: 600; }
.srow .cap { font-size: 14px; color: var(--muted); line-height: 1.4; }
.sync-code { font-family: var(--fi); font-size: 22px; font-weight: 700; letter-spacing: .04em; color: var(--ink); user-select: all; -webkit-user-select: all; padding: 2px 0; }
.joinrow { display: flex; gap: 8px; }
.joinrow[hidden] { display: none; }
.joinrow .in { flex: 1; font-family: var(--fi); }
.joinrow .btn { flex: none; padding: 0 14px; }
.check {
  appearance: none;
  -webkit-appearance: none;
  width: 28px;
  height: 28px;
  flex: none;
  margin: 2px 0 0;
  border: 1.5px solid var(--ink);
  border-radius: 4px;
  background: #FFFFFF;
  display: grid;
  place-content: center;
  cursor: pointer;
}
.check:checked { background: var(--ink); }
.check:checked::after {
  content: '';
  width: 13px;
  height: 7px;
  border: solid #FFFFFF;
  border-width: 0 0 2.5px 2.5px;
  transform: translateY(-2px) rotate(-45deg);
}

/* ── dialog, toast ───────────────────────────────────────────────────────── */
dialog.confirm {
  width: min(340px, calc(100vw - 32px));
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 16px;
  background: #FFFFFF;
  color: var(--ink);
  font-family: var(--ru);
}
dialog.confirm::backdrop { background: rgba(30, 36, 51, .35); }
dialog.confirm p { margin: 0 0 16px; font-size: 17px; line-height: 1.35; }
.toast {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(24px + var(--sb));
  z-index: 10;
  width: fit-content;
  max-width: 360px;
  margin-inline: auto;
  padding: 10px 14px;
  border-radius: 6px;
  background: var(--ink);
  color: #FFFFFF;
  font-size: 15px;
  transition: opacity .4s;
}
.toast.out { opacity: 0; }

/* ── narrow phones (360 px) ──────────────────────────────────────────────── */
@media (max-width: 374px) {
  .w64 { font-size: 56px; }
  .w52 { font-size: 46px; }
  .ty { height: 84px; }
  .ty .n { font-size: 30px; }
  .last .stats { gap: 10px; }
  .grade b { font-size: 16px; }
}

/* ── landscape phones: prompt and answer side by side ────────────────────── */
@media (min-width: 540px) and (max-height: 560px) {
  .screen.ex {
    --pt: 10px;
    --pb: 14px;
    max-width: 980px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: 24px;
    align-items: start;
  }
  .screen.ex > .pane.prompt { position: sticky; top: calc(10px + var(--st)); }
  .screen.ex > .pane.answer { padding-top: 4px; }
  .screen.ex .actions { order: 1; position: static; margin: 0; padding: 0; background: none; box-shadow: none; }
  .screen.ex .part-feedback { order: 2; }
  .screen.ex .spacer { display: none; }
  .screen.ex .w64 { font-size: 52px; }
  .screen.ex .w52 { font-size: 46px; }
  .screen.ex .w46, .screen.ex .w44 { font-size: 40px; }
  .screen.ex .w40 { font-size: 34px; }
  .screen.ex .qcard, .screen.ex .mean-q { padding: 14px 16px; }
  .screen.ex .mean-q.joined { border-bottom: 1px solid var(--rule); border-radius: 6px; padding-bottom: 14px; }
  .screen.ex .mean-a.joined { margin-top: 0; border-top: 1px solid var(--rule); border-radius: 6px; padding: 14px 16px; }
  .screen.ex .mean-a > .dash { display: none; }
  .sprint .stage { min-height: 0; padding: 8px 0; }
  .sprint .pane.answer { gap: 12px; }
  .ty { height: 72px; }
  .ty .n { font-size: 30px; }
}
