/* Davomla — direction D: B's fonts and road on a plain white square grid. */
:root {
  color-scheme: light;
  --ink: #17153B;
  --ink-2: #3A3670;
  --muted: #5E5A85;
  --faint: #6B6890;
  --line: #D5D3E6;
  --card-line: #E4E2F0;
  --track: #DAD8EA;
  --dash: #CFCCE3;
  --paper: #FFFFFF;
  --saffron: #F2B544;
  --saffron-soft: #FFF8E6;
  --amber-text: #8A5A00;
  --red: #C42B45;
  --red-soft: #F6D3D9;
  --display: "Onest", system-ui, sans-serif;
  --text: "Manrope", system-ui, sans-serif;
  --pill: 999px;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  color: var(--ink);
  font-family: var(--text);
  font-size: 16px;
  line-height: 1.5;
  background-color: var(--paper);
  background-image:
    linear-gradient(rgba(17, 17, 17, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17, 17, 17, 0.06) 1px, transparent 1px),
    radial-gradient(circle at 82% 22%, #F1F0EA 0, #FAF9F6 31%, var(--paper) 64%);
  background-size: 39px 39px, 39px 39px, auto;
  background-attachment: fixed;
}

::selection { background: var(--saffron); color: var(--ink); }

a { color: var(--ink); }

h1, h2, h3, p, ol, ul, fieldset, figure { margin: 0; }
fieldset { border: 0; padding: 0; min-width: 0; }
legend { padding: 0; }
button, input, textarea { font: inherit; color: inherit; }
input[type="radio"], input[type="checkbox"] { accent-color: var(--ink); width: 18px; height: 18px; margin: 0; flex: none; }

:focus-visible { outline: 3px solid var(--saffron); outline-offset: 2px; }
label:has(input:focus-visible) { outline: 3px solid var(--ink); outline-offset: 2px; }
label input:focus-visible { outline: none; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- page ---------- */

#app {
  width: 100%;
  max-width: 480px;
  min-height: 100dvh;
  margin: 0 auto;
  padding: 28px 24px 32px;
  display: flex;
  flex-direction: column;
  outline: none;
}

.top { display: flex; justify-content: space-between; align-items: center; min-height: 44px; gap: 12px; }
.brand { font-family: var(--display); font-weight: 800; font-size: 19px; letter-spacing: -0.01em; }
.brand { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); }
.brand img { width: 26px; height: 26px; flex: none; }
.wm { display: inline-flex; align-items: baseline; }
.wm svg { width: 0.66em; height: 0.66em; margin: 0 0.03em; overflow: visible; }
.wm path { fill: none; stroke: var(--saffron); stroke-width: 22; stroke-linecap: round; stroke-linejoin: round; }
.meta { font-size: 13px; color: var(--muted); text-align: right; }

.icon-btn {
  width: 44px; height: 44px; margin-left: -10px; border: 0; background: none; padding: 0;
  display: flex; align-items: center; justify-content: center; color: var(--ink); cursor: pointer; border-radius: 50%;
}

.langs { display: flex; gap: 2px; padding: 3px; background: var(--paper); border: 1.5px solid var(--card-line); border-radius: 20px; }
.langs button {
  min-height: 32px; padding: 0 12px; border: 0; border-radius: 16px; background: transparent;
  color: var(--muted); font-weight: 700; font-size: 12px; cursor: pointer;
}
.langs button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

.eyebrow {
  margin-top: 64px; display: flex; align-items: center; gap: 10px;
  font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
}
.eyebrow::before { content: ""; width: 28px; height: 2px; background: var(--saffron); }

.title { font-family: var(--display); font-weight: 800; font-size: 28px; line-height: 1.15; letter-spacing: -0.015em; margin-top: 24px; text-wrap: balance; }
.title.xl { font-size: 31px; line-height: 1.15; margin-top: 16px; }
.title.sm { font-size: 22px; line-height: 1.25; margin-top: 28px; }
.lead { margin-top: 10px; font-size: 15px; line-height: 1.5; color: var(--muted); text-wrap: pretty; }
.lead.strong { margin-top: 16px; font-size: 16px; line-height: 1.55; color: var(--ink-2); }
.h2 { font-family: var(--display); font-weight: 700; font-size: 18px; margin-top: 40px; }
.label { margin-top: 28px; font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.q { margin-top: 28px; font-weight: 700; font-size: 16px; }
/* browsers ignore a legend's top margin: space the fieldset instead */
legend.q { margin-top: 0; }
fieldset:has(> legend.q) { margin-top: 28px; }
.hint { font-size: 13px; color: var(--muted); }
.note { margin-top: 10px; font-size: 12px; color: var(--muted); }

.card { background: var(--paper); border: 1.5px solid var(--card-line); border-radius: 20px; padding: 16px; }

.points { list-style: none; padding: 0; margin-top: 32px; display: flex; flex-direction: column; gap: 10px; }
.points li {
  display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 12px; align-items: center;
  background: var(--paper); border: 1.5px solid var(--card-line); border-radius: 16px; padding: 12px 14px; font-size: 15px; line-height: 1.4;
}
.num {
  font-family: var(--display); font-weight: 800; font-size: 15px; background: var(--saffron); border-radius: 10px;
  height: 36px; display: flex; align-items: center; justify-content: center;
}

/* self-assessment: one skill open at a time */
.self-list { margin-top: 28px; display: flex; flex-direction: column; gap: 8px; }
.self-open { margin: 4px 0 16px; }
.self-legend { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 700; font-size: 15px; }
.self-step { background: var(--saffron); border-radius: 8px; padding: 4px 8px; font-size: 12px; }
.self-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 16px; }
.self-name { font-family: var(--display); font-weight: 700; font-size: 13px; }
.self-sub { margin-top: 4px; font-size: 13px; color: var(--muted); }
.self-mark { width: 28px; height: 28px; border-radius: 50%; border: 1.5px dashed var(--dash); }
.self-change {
  min-height: 36px; padding: 0 12px; border-radius: var(--pill); border: 1.5px solid var(--line); background: var(--paper);
  font-size: 13px; font-weight: 700; cursor: pointer;
}

/* ---------- buttons ---------- */

.push { margin-top: auto; }
.actions { margin-top: 32px; display: flex; flex-direction: column; gap: 10px; }
.actions.push { margin-top: auto; padding-top: 32px; }
.actions.split { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; }

/* On test screens the Next row stays pinned to the bottom of the screen, so it is in view before and
   after the learner answers; it runs edge to edge over the page's side padding and sits in the bottom padding. */
:is(.actions, .bar-foot).dock {
  --app-pad-bottom: 32px;
  position: sticky; bottom: 0; z-index: 2;
  margin: auto -24px calc(-1 * var(--app-pad-bottom));
  padding: 12px 24px max(16px, env(safe-area-inset-bottom));
  background: var(--paper);
}
.dock::before {  /* a soft fade so options slide under the bar instead of being cut off */
  content: ""; position: absolute; left: 0; right: 0; bottom: 100%; height: 24px; pointer-events: none;
  background: linear-gradient(rgba(255, 255, 255, 0), var(--paper));
}
:has(+ .dock) { margin-bottom: 24px; }
html:has(.dock) { scroll-padding-bottom: 120px; }  /* tabbing to an option never leaves it hidden behind the bar */

.btn {
  display: flex; align-items: center; justify-content: center; min-height: 56px; padding: 0 24px;
  border-radius: var(--pill); border: 0; background: var(--ink); color: var(--paper); text-decoration: none;
  font-family: var(--display); font-weight: 700; font-size: 15px; cursor: pointer; text-align: center;
}
.btn:hover { background: var(--ink-2); }
.btn:disabled { background: var(--track); color: var(--muted); cursor: not-allowed; }
.btn.ghost {
  min-height: 52px; padding: 0 18px; background: var(--paper); border: 1.5px solid var(--line);
  color: var(--ink); font-family: var(--text); font-size: 14px;
}
.btn.ghost.muted { color: var(--muted); min-height: 56px; }
.btn.ghost:hover { border-color: var(--ink); }
.below-btn { margin-top: 12px; text-align: center; font-size: 13px; color: var(--muted); }
.wait { padding: 14px 16px; border-radius: 16px; background: var(--saffron-soft); font-size: 14px; line-height: 1.45; }

/* ---------- choices ---------- */

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chips.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.chip {
  position: relative; display: flex; align-items: center; justify-content: center; min-height: 44px; min-width: 56px; padding: 0 16px;
  border-radius: var(--pill); border: 1.5px solid var(--line); background: var(--paper); font-size: 14px; cursor: pointer; text-align: center;
}
.chip input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.chip.level { font-family: var(--display); font-size: 13px; }
.chip.soft { color: var(--muted); }
.chip:has(input:checked) { background: var(--saffron); border-color: var(--saffron); color: var(--ink); font-weight: 700; }
.chips.yesno .chip { min-height: 48px; font-size: 15px; }
.chips.yesno .chip:has(input:checked) { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.chip:has(input:focus-visible) { outline: 3px solid var(--ink); outline-offset: 2px; }

.options { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.option {
  display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 18px;
  border: 1.5px solid var(--line); background: var(--paper); border-radius: 26px; font-size: 15px; line-height: 1.35; cursor: pointer;
}
.option.lg { font-size: 17px; }
.option.box { border-radius: 16px; padding: 8px 16px; }
.option:has(input:checked) { background: var(--saffron); border-color: var(--saffron); font-weight: 700; }
.option.idk { min-height: 44px; padding: 0 18px; border-color: transparent; background: transparent; font-size: 14px; color: var(--muted); }
.option.idk:has(input:checked) { background: transparent; border-color: var(--line); color: var(--ink); }

.qlegend { font-size: 17px; line-height: 1.4; font-weight: 700; }
.qlegend .n { font-family: var(--display); color: var(--muted); font-size: 13px; margin-right: 6px; }
.qsets { margin-top: 28px; }
.qset + .qset { margin-top: 24px; }

/* ---------- road (test progress) ---------- */

.road { position: relative; margin-top: 28px; height: 52px; }
.road::before, .road .done-line {
  content: ""; position: absolute; left: calc(100% / (2 * var(--n, 6))); top: 9px; height: 2px;
}
.road::before { right: calc(100% / (2 * var(--n, 6))); background: var(--track); }
.road .done-line { background: var(--ink); }
.road ol {
  list-style: none; padding: 0; position: relative; display: grid; grid-template-columns: repeat(var(--n, 6), minmax(0, 1fr));
  text-align: center; font-size: 11px; color: var(--muted);
}
.road li { display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 0; }
.road li span:last-child { white-space: nowrap; font-size: 10.5px; letter-spacing: -0.01em; }
.dot { width: 20px; height: 20px; border-radius: 50%; background: var(--paper); border: 2px solid var(--track); }
.road li.passed .dot { background: var(--ink); border-color: var(--ink); }
.road li.current { color: var(--ink); font-weight: 700; }
.road li.current .dot { background: var(--saffron); border: 4px solid var(--ink); }

.qnum { margin-top: 44px; font-family: var(--display); font-weight: 800; font-size: 64px; line-height: 1; }
.qnum span { color: var(--saffron); }
.qnum + .label { margin-top: 6px; }
.qnum ~ fieldset { margin-top: 20px; }
.stem { font-size: 24px; line-height: 1.3; font-weight: 700; }

/* vocab */
.words { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 20px; }
.word {
  display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 14px; border-radius: 22px;
  background: var(--paper); border: 1.5px solid var(--line); font-size: 15px; cursor: pointer; min-width: 0; overflow-wrap: anywhere;
}
.word:has(input:checked) { background: var(--saffron); border-color: var(--saffron); font-weight: 700; }
.bar-foot { margin-top: auto; padding-top: 24px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.bar-foot .btn { padding: 0 28px; }

/* reading */
.passage { margin-top: 14px; padding: 20px 20px 22px; font-size: 16px; line-height: 1.65; white-space: pre-line; }

/* listening */
.player { margin-top: 14px; padding: 20px; }
.player-row { display: flex; align-items: center; gap: 16px; }
.play {
  flex: none; width: 72px; height: 72px; border-radius: 50%; border: 0; background: var(--saffron);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.play:disabled { background: var(--track); cursor: not-allowed; }
.wave { flex: 1; min-width: 0; display: flex; align-items: center; gap: 3px; height: 40px; overflow: hidden; }
.wave i { flex: none; width: 4px; border-radius: 2px; background: var(--dash); }
.wave.playing i { background: var(--ink); animation: bob 0.9s ease-in-out infinite alternate; }
.wave.playing i:nth-child(3n) { animation-delay: -0.3s; }
.wave.playing i:nth-child(3n + 1) { animation-delay: -0.6s; }
@keyframes bob { from { transform: scaleY(0.45); } to { transform: scaleY(1); } }
.player-foot {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--card-line); font-size: 13px;
}
.player-foot b { font-weight: 700; }
.notice { margin-top: 12px; font-size: 13px; color: var(--muted); }
.notice.warn { color: var(--red); font-weight: 700; }
.need-note { margin-top: 10px; color: var(--red); font-weight: 700; font-size: 14px; }
fieldset.need .chips.yesno .chip { border-color: var(--red); background: var(--red-soft); }

/* writing */
.prompt { margin-top: 10px; font-size: 18px; line-height: 1.45; font-weight: 700; }
.essay {
  margin-top: 18px; flex: 1; width: 100%; min-height: 220px; resize: vertical;
  border: 1.5px solid var(--line); border-radius: 20px; background: var(--paper); padding: 16px 18px;
  font-family: var(--text); font-size: 16px; line-height: 1.55;
}
.essay:focus { border-color: var(--ink); outline: none; }
.essay:focus-visible { box-shadow: 0 0 0 3px var(--saffron); }
.counter-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 10px; font-size: 13px; }
.count { font-weight: 700; }
.count span { background: var(--saffron); border-radius: 6px; padding: 2px 6px; }

/* speaking */
.recorder { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 32px 0; }
.timer { font-family: var(--display); font-weight: 800; font-size: 40px; line-height: 1; font-variant-numeric: tabular-nums; }
.timer small { font-size: 18px; color: var(--muted); font-weight: 500; }
.rec {
  width: 104px; height: 104px; border-radius: 50%; border: 8px solid var(--red-soft); background: var(--red);
  display: flex; align-items: center; justify-content: center; cursor: pointer; box-sizing: content-box;
}
.rec .shape { width: 34px; height: 34px; border-radius: 50%; background: var(--paper); }
.rec[aria-pressed="true"] .shape { width: 28px; height: 28px; border-radius: 6px; }
.rec:disabled { background: var(--track); border-color: var(--card-line); cursor: not-allowed; }
.rec-status { font-size: 14px; color: var(--muted); text-align: center; }
.recorder .wave { flex: none; justify-content: center; height: 44px; gap: 4px; }
.recorder .wave i { width: 5px; border-radius: 3px; }
.recorder .wave.playing i { background: var(--red); }
.recorder audio { width: 100%; }

/* checking */
.done-badge {
  margin-top: 72px; display: inline-flex; align-items: center; justify-content: center;
  width: 64px; height: 64px; border-radius: 18px; background: var(--saffron);
}
.steps { list-style: none; padding: 0; margin-top: 32px; display: flex; flex-direction: column; gap: 10px; }
.steps li {
  display: flex; align-items: center; gap: 14px; background: var(--paper); border: 1.5px solid var(--card-line);
  border-radius: 16px; padding: 14px 16px; font-size: 15px; color: var(--muted);
}
.steps .mark { flex: none; width: 24px; height: 24px; border-radius: 50%; border: 2px dashed var(--dash); display: flex; align-items: center; justify-content: center; }
.steps li.on { border-color: var(--ink); color: var(--ink); font-weight: 700; }
.steps li.on .mark { border: 3px solid var(--track); border-top-color: var(--ink); animation: spin 0.9s linear infinite; }
.steps li.ok { color: var(--ink); }
.steps li.ok .mark { border: 0; background: var(--ink); }
.steps li.off .mark { border: 2px solid var(--dash); }
.steps li.off .mark::after { content: ""; width: 10px; height: 2px; background: var(--muted); }
@keyframes spin { to { transform: rotate(360deg); } }

.loading { margin: auto 0; display: flex; flex-direction: column; align-items: center; gap: 16px; color: var(--muted); font-size: 15px; text-align: center; }
.spinner { width: 36px; height: 36px; border-radius: 50%; border: 4px solid var(--track); border-top-color: var(--ink); animation: spin 0.9s linear infinite; }

/* ---------- result ---------- */

.result-title { margin-top: 36px; font-size: 28px; line-height: 1.25; }
.hl-level { background: var(--saffron); padding: 0 8px; border-radius: 8px; }

.map { position: relative; margin-top: 28px; padding: 8px 16px; }
.map::before {
  content: ""; position: absolute; left: 39px; top: 24px; bottom: 24px; width: 3px;
  background: repeating-linear-gradient(to bottom, var(--dash) 0, var(--dash) 8px, transparent 8px, transparent 14px);
}
.map-row { position: relative; display: grid; grid-template-columns: 48px minmax(0, 1fr); align-items: center; min-height: 52px; column-gap: 12px; padding: 6px 0; }
.map-row .lv { width: 48px; text-align: center; font-family: var(--display); font-size: 13px; color: var(--faint); background: var(--paper); }
.map-row.has .lv { color: var(--ink); }
.map-row.here .lv {
  height: 48px; border-radius: 50%; background: var(--saffron); color: var(--ink);
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14px;
}
.map-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.skill-chip { font-size: 13px; font-weight: 700; background: var(--ink); color: var(--paper); border-radius: 16px; padding: 6px 12px; }
.skill-chip.behind { background: var(--red); }
.next-flag { justify-self: start; font-size: 13px; font-weight: 700; border: 1.5px dashed var(--ink); border-radius: 16px; padding: 5px 12px; }
.unassessed { margin-top: 12px; display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.unassessed b { color: var(--ink); }

.vbars { margin-top: 16px; display: flex; flex-direction: column; gap: 10px; }
.vbar { display: grid; grid-template-columns: 92px minmax(0, 1fr); align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.vbar div {
  height: 30px; border-radius: 15px; display: flex; align-items: center; padding: 0 12px; min-width: max-content;
  font-weight: 700; background: var(--ink); color: var(--paper); white-space: nowrap;
}
.vbar div.alt { background: var(--saffron); color: var(--ink); }

.gaps { margin-top: 16px; display: flex; flex-direction: column; gap: 10px; }
.gap { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 12px; }
.gap-title { font-weight: 700; font-size: 15px; }
.gap-badge { margin-top: 4px; font-size: 12px; font-weight: 700; color: var(--amber-text); }
.gap-ev { margin-top: 10px; font-size: 15px; line-height: 1.5; color: var(--ink-2); overflow-wrap: anywhere; }
.gap-ev del { color: var(--red); }
.gap-ev ins { text-decoration: none; font-weight: 700; color: var(--ink); }

.dark { margin-top: 28px; background: var(--ink); color: var(--paper); border-radius: 16px; padding: 16px; font-size: 15px; line-height: 1.5; }
.dark p + p { margin-top: 8px; }
.dark .hl { color: var(--saffron); }

.feedback p { margin-top: 8px; font-size: 15px; color: var(--ink-2); }
.feedback h3 { margin-top: 16px; font-family: var(--display); font-size: 14px; }

.rating { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.rating button {
  min-height: 48px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--paper);
  font-family: var(--display); font-size: 15px; cursor: pointer;
}
.rating button[aria-pressed="true"] { background: var(--saffron); border-color: var(--saffron); font-weight: 700; }

/* ---------- goal ---------- */

.goal-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 24px; }
.goal {
  position: relative; display: flex; flex-direction: column; justify-content: center; min-height: 72px; padding: 12px 14px;
  border-radius: 16px; border: 1.5px solid var(--line); background: var(--paper); font-size: 14px; font-weight: 700; line-height: 1.3; cursor: pointer;
}
.goal input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.goal small { font-weight: 500; font-size: 12px; color: var(--muted); }
.goal:has(input:checked) { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.goal:has(input:checked) small { color: #D6D3EE; }
.goal:has(input:focus-visible) { outline: 3px solid var(--saffron); outline-offset: 2px; }
.sub-card { margin-top: 20px; }
.sub-card .chips { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.sub-card .chips.skills { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sub-card .chip { min-width: 0; padding: 0 8px; }
.sub-card .sub-q + .chips + .sub-q { margin-top: 16px; }
.sub-q { font-weight: 700; font-size: 15px; }

.stepper { margin-top: 12px; display: grid; grid-template-columns: 56px minmax(0, 1fr) 56px; align-items: center; padding: 10px; }
.stepper button {
  width: 48px; height: 48px; border-radius: 50%; border: 1.5px solid var(--line); background: var(--paper); font-size: 22px; cursor: pointer;
}
.stepper button.plus { border: 0; background: var(--ink); color: var(--paper); }
.stepper button:disabled { opacity: 0.4; cursor: not-allowed; }
.stepper p { text-align: center; }
.stepper output { font-family: var(--display); font-weight: 800; font-size: 36px; }
.stepper span { font-size: 14px; color: var(--muted); }

.sub-card.cert { margin-top: 12px; }
.sub-card.cert .chips { display: flex; flex-wrap: wrap; }
.sub-card.cert .chip { min-width: 56px; padding: 0 12px; }
.sub-card.cert fieldset + fieldset { margin-top: 16px; }

/* ---------- plan ---------- */

.estimate { margin-top: 10px; font-family: var(--display); font-weight: 800; font-size: 46px; line-height: 1; }
.estimate small { font-size: 20px; font-weight: 700; }
.badge {
  margin-top: 14px; display: inline-flex; align-items: center; gap: 8px; align-self: flex-start;
  background: var(--saffron); border-radius: 12px; padding: 8px 12px; font-size: 14px; font-weight: 700;
}
.badge.bad { background: var(--red-soft); color: var(--red); }

.splits { margin-top: 16px; display: flex; flex-direction: column; gap: 12px; }
.split { display: grid; grid-template-columns: 92px minmax(0, 1fr) 58px; align-items: center; gap: 10px; font-size: 13px; }
.split .track { height: 12px; }
.split .fill { height: 12px; border-radius: 6px; background: var(--ink); min-width: 6px; }
.split .fill.behind { background: var(--red); }
.split .mins { text-align: right; color: var(--muted); }

.timeline { position: relative; margin-top: 18px; padding-left: 40px; list-style: none; }
.timeline::before {
  content: ""; position: absolute; left: 11px; top: 14px; bottom: 24px; width: 3px;
  background: repeating-linear-gradient(to bottom, var(--ink) 0, var(--ink) 8px, transparent 8px, transparent 14px);
}
.timeline li { position: relative; padding-bottom: 22px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline .pin { position: absolute; left: -40px; top: 0; width: 26px; height: 26px; border-radius: 50%; background: var(--paper); border: 3px solid var(--ink); }
.timeline li.now .pin { background: var(--saffron); border-width: 4px; }
.timeline li.check .pin { left: -36px; top: 2px; width: 18px; height: 18px; border-radius: 0; transform: rotate(45deg); border: 2.5px solid var(--red); }
.timeline li.flag .pin {
  left: -42px; top: -2px; width: 30px; height: 30px; border-radius: 8px; border: 0; background: var(--ink);
  color: var(--saffron); display: flex; align-items: center; justify-content: center; font-size: 16px;
}
.tl-when { font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase; }
.tl-what { margin-top: 4px; font-family: var(--display); font-weight: 700; font-size: 15px; }
.tl-desc { margin-top: 6px; font-size: 14px; line-height: 1.5; color: var(--ink-2); }
.timeline li.check p { font-size: 14px; font-weight: 700; color: var(--red); }
.timeline li.flag p { font-family: var(--display); font-weight: 800; font-size: 17px; }

.week { list-style: none; margin-top: 16px; padding: 0; overflow: hidden; }
.week li { display: grid; grid-template-columns: 36px minmax(0, 1fr) 32px; gap: 10px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--card-line); }
.week li:last-child { border-bottom: 0; }
.week li:has(input:checked) { background: var(--saffron-soft); }
.week .d { font-family: var(--display); font-weight: 700; font-size: 13px; }
.week .what { font-size: 14px; line-height: 1.4; min-width: 0; }
.week .what small { display: block; color: var(--muted); font-size: 12px; }
.week .what a { color: inherit; }
.week input { width: 22px; height: 22px; justify-self: end; }

@media (prefers-reduced-motion: reduce) {
  .wave.playing i, .steps li.on .mark, .spinner { animation: none; }
  .steps li.on .mark { border-color: var(--ink); }
}

@media (min-width: 720px) {
  #app { padding-top: 40px; padding-bottom: 48px; }
  :is(.actions, .bar-foot).dock { --app-pad-bottom: 48px; }
}

/* ---------- 4-week check-in ---------- */

.due { margin-top: 16px; }
.due-title { font-family: var(--display); font-weight: 700; font-size: 17px; }
.due .btn { margin-top: 14px; width: 100%; }
.btn.alt { background: var(--saffron); color: var(--ink); }
.btn.alt:hover { background: #F5C566; }

.tiles { margin-top: 20px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.tile { background: var(--ink); color: #D6D3EE; border-radius: 18px; padding: 16px; font-size: 13px; }
.tile.alt { background: var(--saffron); color: var(--ink); }
.tile-num { font-family: var(--display); font-weight: 800; font-size: 30px; line-height: 1; color: var(--paper); margin-bottom: 8px; }
.tile.alt .tile-num { color: var(--ink); }
.tile-num small { font-size: 16px; color: #B7B3D9; }

.ba { margin-top: 14px; padding: 0; overflow: hidden; }
.ba-row { display: grid; grid-template-columns: minmax(0, 1fr) 52px 24px 52px; align-items: center; gap: 6px; padding: 13px 16px; font-size: 14px; border-bottom: 1px solid var(--card-line); }
.ba-row:last-child { border-bottom: 0; }
.ba-before { font-family: var(--display); font-size: 13px; color: var(--faint); text-align: right; }
.ba-arrow { text-align: center; color: var(--faint); }
.ba-after { font-family: var(--display); font-weight: 700; font-size: 13px; text-align: center; padding: 3px 0; border-radius: 8px; }
.ba-after.up { background: var(--saffron); }
.ba-after.down { color: var(--red); }

.fixes { list-style: none; padding: 0; margin-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.fix { display: flex; align-items: center; gap: 10px; font-size: 15px; }
.fix-mark { flex: none; width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; border: 2px dashed var(--dash); }
.fix.fixed .fix-mark { background: var(--ink); border: 0; }
.fix.still .fix-mark { border-color: var(--red); }
.fix.still { color: var(--ink-2); }
.fix.not_checked { color: var(--muted); }

.replan { margin-top: 32px; border-color: var(--ink); padding: 18px; }
.replan .label { margin-top: 0; }
.replan-weeks { margin-top: 8px; font-family: var(--display); font-weight: 800; font-size: 28px; line-height: 1.1; }
.replan .lead { margin-top: 8px; font-size: 14px; }
