/* Heatchecked — thermometer rows, one column on phones, two from 900px. */
:root {
  --bg: #FAF6F0;
  --panel: #FFFFFF;
  --hi: #F3ECE3;
  --line: #E4D9CC;
  --track: #EFE7DC;
  --ink: #1B1712;
  --ink2: #574D43;
  --ink3: #74695D;
  --err: #B3261E;
  --scrim: rgba(27, 23, 18, 0.45);

  /* temperature bands: Freezing, Cold, Warm, Hot, Burning, Boiling (the word). Colour only ever means heat. */
  --t0: #3B5BD9; --t1: #1D77B0; --t2: #996000; --t3: #BF4D09; --t4: #BE2618; --t5: #D63E08;
  --boil: var(--t5); --onboil: #FFFFFF; --tint: 9%;
  --glow: none; --dotglow: 0 0 0 4px rgba(214, 62, 8, .18); --steam: rgba(214, 62, 8, .35);
  /* trivia rarity: Common, Uncommon, Rare, Deep Cut */
  --r1: #6B6157; --r2: #1A7D70; --r3: #6A4C9C; --r4: #B0307A;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14110E; --panel: #1C1814; --hi: #2A241E; --line: #332B23; --track: #2A241E;
    --ink: #F5EFE7; --ink2: #BDB2A4; --ink3: #958979; --err: #F48A90; --scrim: rgba(8, 6, 4, 0.72);
    --t0: #9DBDFF; --t1: #5FA8E6; --t2: #F2B544; --t3: #FF8A3D; --t4: #FF5A45; --t5: #FF6A1A;
    --onboil: #1A0D04; --tint: 11%;
    --glow: 0 0 44px rgba(255, 106, 26, .45), 0 0 12px rgba(255, 106, 26, .25);
    --dotglow: 0 0 18px rgba(255, 106, 26, .7); --steam: rgba(255, 150, 90, .55);
    --r1: #BDB2A4; --r2: #3FBFAA; --r3: #A98BEA; --r4: #EE6DB5;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #14110E; --panel: #1C1814; --hi: #2A241E; --line: #332B23; --track: #2A241E;
  --ink: #F5EFE7; --ink2: #BDB2A4; --ink3: #958979; --err: #F48A90; --scrim: rgba(8, 6, 4, 0.72);
  --t0: #9DBDFF; --t1: #5FA8E6; --t2: #F2B544; --t3: #FF8A3D; --t4: #FF5A45; --t5: #FF6A1A;
  --onboil: #1A0D04; --tint: 11%;
  --glow: 0 0 44px rgba(255, 106, 26, .45), 0 0 12px rgba(255, 106, 26, .25);
  --dotglow: 0 0 18px rgba(255, 106, 26, .7); --steam: rgba(255, 150, 90, .55);
  --r1: #BDB2A4; --r2: #3FBFAA; --r3: #A98BEA; --r4: #EE6DB5;
  color-scheme: dark;
}

.t0 { --c: var(--t0); } .t1 { --c: var(--t1); } .t2 { --c: var(--t2); }
.t3 { --c: var(--t3); } .t4 { --c: var(--t4); } .t5 { --c: var(--t5); }
.r1 { --c: var(--r1); } .r2 { --c: var(--r2); } .r3 { --c: var(--r3); } .r4 { --c: var(--r4); }
.r0 { --c: var(--ink3); }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; min-height: 100svh;
  background: var(--bg); color: var(--ink);
  font-family: Archivo, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px; line-height: 1.5;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
[hidden] { display: none !important; }
.num { font-variant-numeric: tabular-nums; }

.wrap { width: 100%; max-width: 560px; margin: 0 auto; padding-inline: 20px; }

/* ---- header ------------------------------------------------------------- */
.bar { border-bottom: 1px solid var(--line); }
.bar-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 16px; padding-bottom: 14px; }
.brand { min-width: 0; flex: 1 1 auto; display: flex; align-items: center; gap: 12px; }
.brand > div { min-width: 0; }
.logo { width: 36px; height: 36px; flex: none; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); display: inline-flex; align-items: center; justify-content: center; color: var(--boil); }
.logo svg { width: 20px; height: 20px; }
.mark { margin: 0; font-size: 22px; line-height: 1.05; font-weight: 800; font-stretch: 125%; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.edition { margin: 4px 0 0; font-size: 13px; color: var(--ink2); }
.tools { flex: none; display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 44px; height: 44px; flex: none; border-radius: 22px; border: 1px solid var(--line);
  background: transparent; font-size: 17px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}
.units {
  min-height: 44px; display: inline-flex; align-items: center; gap: 8px; padding: 0 6px 0 12px;
  border-radius: 22px; border: 1px solid var(--line); background: transparent;
  font-size: 13px; font-weight: 650; white-space: nowrap;
}
.icon-btn svg { width: 20px; height: 20px; }
.units-short { display: none; font-size: 14px; font-weight: 750; }
.sw { position: relative; width: 40px; height: 24px; flex: none; border-radius: 12px; background: var(--ink3); transition: background .15s; }
.sw i { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--bg); transition: left .15s; }
.units[aria-checked="true"] .sw { background: var(--boil); }
.units[aria-checked="true"] .sw i { left: 19px; }

/* ---- buttons, inputs ------------------------------------------------------ */
.btn {
  min-height: 52px; padding: 0 22px; border-radius: 14px; border: 1px solid var(--line);
  background: transparent; font-size: 17px; font-weight: 700;
}
.btn.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn:disabled { opacity: .55; cursor: default; }
.link-btn {
  min-height: 44px; padding: 0 6px; border: 0; background: transparent; color: var(--ink2);
  font-size: 15px; text-decoration: underline; text-underline-offset: 3px;
}
.field { display: flex; gap: 8px; }
.field input {
  flex: 1; min-width: 0; height: 60px; padding: 0 18px; border-radius: 14px;
  border: 1.5px solid var(--line); background: var(--panel);
  font-size: 22px; font-weight: 600;
}
.field input::placeholder { color: var(--ink3); font-weight: 400; }
.field input:focus { outline: none; border-color: var(--ink2); }
.field .btn { min-height: 60px; }
.field input[aria-invalid="true"] { border-color: var(--err); }
.field input:disabled { opacity: .6; }
/* Inline error under a field. Space is reserved so an error never shifts the layout. */
.field-err { margin: 0; min-height: 21px; font-size: 14px; font-weight: 600; line-height: 1.5; color: var(--err); }
.shake { animation: shake .35s ease-in-out; }
@keyframes shake {
  0%, 100% { transform: none; } 20% { transform: translateX(-6px); } 40% { transform: translateX(5px); }
  60% { transform: translateX(-3px); } 80% { transform: translateX(2px); }
}
.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; }

.eyebrow { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink2); }
.card { padding: 16px 18px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); }

/* ---- the page ------------------------------------------------------------- */
.page { padding-top: 28px; padding-bottom: 64px; }
.play { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; }
.act { display: flex; flex-direction: column; gap: 22px; min-width: 0; }

/* Before the first guess: just the question and the box, centred in the screen. */
body.empty .know, body.empty .hist { display: none; }
body.empty .page { padding-bottom: 22px; }
body.empty .act {
  width: 100%; max-width: 560px; margin: 0 auto;
  min-height: calc(100vh - 140px); min-height: calc(100svh - 140px); justify-content: center;
}
.hero { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.hero h2 { margin: 0; font-size: 44px; line-height: 1; font-weight: 850; font-stretch: 118%; letter-spacing: -0.02em; }
.hero p { margin: 0; font-size: 17px; color: var(--ink2); }
.act > .link-btn { align-self: center; }

.guess-form { display: flex; flex-direction: column; gap: 10px; }
.form-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.form-top label { font-size: 14px; font-weight: 700; }
.form-top span { font-size: 13px; color: var(--ink2); }

.latest { display: flex; align-items: center; gap: 16px; }
.latest .who { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.latest .who b { font-size: 30px; line-height: 1.1; font-weight: 800; font-stretch: 112%; overflow-wrap: anywhere; }
.latest .who span:last-child { font-size: 14px; color: var(--ink2); }
.latest .temp { display: flex; flex-direction: column; align-items: flex-end; color: var(--c); }
.latest .temp b { font-size: 42px; line-height: 1; font-weight: 850; font-variant-numeric: tabular-nums; }
.latest .temp span { font-size: 14px; font-weight: 700; }

/* ---- thermometer rows ------------------------------------------------------ */
.hist { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.rows { list-style: none; margin: 0; padding: 0; }
.row {
  display: grid; grid-template-columns: 24px minmax(0, 1fr) 80px; align-items: center; column-gap: 12px;
  padding: 11px 0; border-bottom: 1px solid var(--line);
}
.row .n { font-size: 12px; color: var(--ink3); font-variant-numeric: tabular-nums; }
.row .mid { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.row .line { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.row .word { font-size: 19px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .band { font-size: 12px; font-weight: 650; color: var(--c); }
.row .deg { text-align: right; font-size: 22px; font-weight: 800; color: var(--c); font-variant-numeric: tabular-nums; }
.tag { font-size: 11px; font-weight: 600; color: var(--ink2); border: 1px solid var(--line); border-radius: 999px; padding: 1px 7px; white-space: nowrap; }
.row .reading { grid-column: 2 / 4; margin-top: 8px; font-size: 14px; color: var(--ink2); }
.row .reading b { color: var(--ink); }
.row.fresh { animation: drop .45s ease-out; }
@keyframes drop { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

.meter { position: relative; height: 6px; border-radius: 3px; background: var(--track); overflow: hidden; }
.meter b { position: absolute; left: 0; top: 0; bottom: 0; background: var(--c); }
.meter i { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--bg); }
.meter i:nth-of-type(1) { left: 25%; } .meter i:nth-of-type(2) { left: 50%; }
.meter i:nth-of-type(3) { left: 72%; } .meter i:nth-of-type(4) { left: 88%; }

/* ---- what you know --------------------------------------------------------- */
.know { display: flex; flex-direction: column; gap: 12px; padding: 18px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); min-width: 0; }
.know-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.know h2 { margin: 0; font-size: 17px; font-weight: 800; }
.seams { display: flex; gap: 5px; }
.seams svg { width: 13px; height: 13px; }
.seams path { fill: none; stroke: var(--ink3); stroke-width: 1.4px; }
.seams .done path { fill: var(--c); stroke: var(--c); }
.seams .skipped path, .seams .missed path { stroke-dasharray: 2 2; }
.seams .open path { stroke: var(--ink); stroke-width: 2px; }
.empty-note { margin: 0; font-size: 15px; color: var(--ink2); }
.clue { display: flex; flex-direction: column; gap: 4px; padding-top: 12px; border-top: 1px solid var(--line); }
.clue .k { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--c); }
.clue.fresh { animation: drop .45s ease-out; }
.c-head { margin: 0; font-size: 20px; font-weight: 800; line-height: 1.25; }
.c-text { margin: 0; font-size: 16px; line-height: 1.45; }
.c-concept { margin: 0; font-size: 22px; font-weight: 800; font-stretch: 112%; }
.profile { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; align-items: center; font-size: 14px; }
.profile .lv { display: flex; gap: 3px; }
.profile .lv i { width: 18px; height: 6px; border-radius: 3px; background: var(--track); }
.profile .lv i.on { background: var(--c); }
.slots { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0 2px; }
.slots span {
  width: 30px; height: 36px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg);
  display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 17px;
}

/* ---- trivia ---------------------------------------------------------------- */
.trivia { display: flex; flex-direction: column; gap: 14px; }
.trivia .q { margin: 0; font-size: 26px; line-height: 1.2; font-weight: 800; font-stretch: 108%; }
.trivia .actions { display: flex; gap: 8px; }
.trivia .guess-form { gap: 8px; }
.tq-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.timer { font-size: 28px; line-height: 1; font-weight: 850; font-variant-numeric: tabular-nums; }
.clock { height: 6px; margin-top: -6px; border-radius: 3px; background: var(--track); overflow: hidden; }
.clock b { display: block; height: 100%; width: 100%; border-radius: 3px; background: var(--t3); transition: width .2s linear; }
.trivia.low .timer { color: var(--t4); }
.trivia.low .clock b { background: var(--t4); }
.prizes { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.prizes li { padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); display: flex; flex-direction: column; gap: 2px; }
.prizes .tier { font-size: 12px; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; color: var(--c); }
.prizes .what { font-size: 14px; }

.strike { display: flex; flex-direction: column; gap: 10px; border-color: var(--c); }
.strike .rarity { margin: 0; font-size: min(46px, 11vw); line-height: 1; font-weight: 900; font-stretch: 120%; color: var(--c); animation: pop .5s cubic-bezier(.2, 1.4, .4, 1); }
.strike .ans { margin: 0; font-size: 18px; font-weight: 650; }
.strike .earned { padding-top: 12px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.strike .earned .k { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--c); }
.strike .btn { align-self: flex-start; margin-top: 6px; }
@keyframes pop { from { opacity: 0; transform: scale(.85); } to { opacity: 1; transform: none; } }

/* ---- results --------------------------------------------------------------- */
.results { display: grid; grid-template-columns: minmax(0, 1fr); gap: 40px; }
.sum, .tabcol { display: flex; flex-direction: column; gap: 32px; min-width: 0; }
.res-hero { display: flex; flex-direction: column; gap: 10px; }
.res-eyebrow { display: flex; align-items: center; gap: 8px; }
.res-eyebrow.won { color: var(--boil); }
.res-eyebrow svg { width: 16px; height: 16px; flex: none; }
/* The word sizes to its column, not the window, so long words never spill into the chart. */
.word-wrap { position: relative; padding-top: 34px; container-type: inline-size; }
.answer-word {
  margin: 0; font-size: min(76px, calc(100cqi / (var(--len, 7) * 0.86)));
  line-height: .95; font-weight: 900; font-stretch: 118%; letter-spacing: -0.02em; white-space: nowrap; color: var(--ink);
}
.answer-word.won { color: var(--boil); text-shadow: var(--glow); }
.steam { position: absolute; left: 18px; top: 0; width: 190px; height: 44px; overflow: visible; }
.steam path { fill: none; stroke: var(--steam); stroke-width: 3; stroke-linecap: round; opacity: 0; animation: steam 3s ease-in-out infinite; }
.steam path:nth-child(2) { animation-delay: 1s; }
.steam path:nth-child(3) { animation-delay: 2s; }
@keyframes steam { 0% { opacity: 0; transform: translateY(8px); } 50% { opacity: 1; } 100% { opacity: 0; transform: translateY(-6px); } }
.def { margin: 8px 0 0; font-size: 17px; line-height: 1.55; color: var(--ink2); }

.mercury { display: flex; flex-direction: column; gap: 10px; }
.mercury .tube {
  position: relative; height: 12px; border-radius: 999px;
  background: linear-gradient(90deg, var(--t0) 0%, var(--t0) 12%, var(--t1) 37%, var(--t2) 61%, var(--t3) 80%, var(--t4) 93%, var(--t5) 100%);
}
.mercury .rest { position: absolute; top: 0; bottom: 0; right: 0; border-radius: 0 999px 999px 0; background: var(--track); }
.mercury i { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--bg); }
.mercury i:nth-of-type(1) { left: 25%; } .mercury i:nth-of-type(2) { left: 50%; }
.mercury i:nth-of-type(3) { left: 72%; } .mercury i:nth-of-type(4) { left: 88%; }
.mercury .bulb { position: absolute; top: 50%; width: 24px; height: 24px; margin: -12px 0 0 -12px; border-radius: 50%; background: var(--c); border: 3px solid var(--bg); }
.mercury .bulb.boil { box-shadow: var(--dotglow); }
.mercury .ends { display: flex; justify-content: space-between; font-size: 12px; font-weight: 650; color: var(--ink3); font-variant-numeric: tabular-nums; }
.mercury .ends b { color: var(--c); font-weight: 800; }

.stats { margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px 16px; }
.stats div { display: flex; flex-direction: column-reverse; gap: 6px; padding-top: 14px; border-top: 1px solid var(--line); }
.stats dt { font-size: 13px; color: var(--ink2); }
.stats dd { margin: 0; font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; }
.stats dd.txt { display: flex; flex-direction: column; gap: 6px; font-size: 17px; line-height: 1.2; }
.dia { display: block; width: 44px; height: 10px; flex: none; }
.share-row { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.btn.hot { display: inline-flex; align-items: center; gap: 10px; background: var(--boil); color: var(--onboil); border-color: var(--boil); font-weight: 800; }
.btn.hot svg { width: 18px; height: 18px; }
.next { margin: 0; font-size: 15px; color: var(--ink2); }
.next b { color: var(--ink); font-variant-numeric: tabular-nums; }

.tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; padding: 4px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); }
.tabs button { min-height: 44px; border: 0; border-radius: 10px; background: transparent; color: var(--ink2); font-size: 15px; font-weight: 750; }
.tabs button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.tabpanel { display: flex; flex-direction: column; gap: 18px; }
.tabpanel h3 { margin: 0; font-size: 21px; font-weight: 800; }
.tabpanel .sub { margin: -10px 0 0; font-size: 14px; line-height: 1.5; color: var(--ink2); }

/* Trail chart: band names sit outside the plot so they never collide with the curve. */
.chart-wrap { position: relative; padding: 58px 0 0 64px; }
.chart-axis { position: absolute; left: 0; top: 58px; width: 56px; height: 240px; font-size: 10px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
.chart-axis span { position: absolute; left: 0; transform: translateY(-50%); color: var(--c); }
.chart { position: relative; height: 240px; }
.chart .plot { position: absolute; inset: 0; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: var(--panel); }
.chart .stripe { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--line); background: color-mix(in srgb, var(--c) var(--tint), transparent); }
.chart .stripe:first-child { border-top: 0; }
.chart .seam { position: absolute; top: 0; bottom: 0; border-left: 1.5px dotted var(--ink3); }
.chart .seam span {
  position: absolute; top: -30px; left: 0; transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--bg); color: var(--ink2);
  font-size: 10px; font-weight: 750; letter-spacing: .05em; text-transform: uppercase; white-space: nowrap;
}
.chart .seam.hi span { top: -54px; } /* stagger neighbouring labels so they never collide */
.chart .seam .dia { width: 33px; height: 8px; }
.chart > svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.chart .curve { fill: none; stroke: var(--ink2); stroke-opacity: .55; stroke-width: 2.5px; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.chart .dot { position: absolute; width: 12px; height: 12px; transform: translate(-50%, -50%); border-radius: 50%; background: var(--c); border: 2px solid var(--panel); z-index: 1; }
.chart .dot.big { width: 18px; height: 18px; box-shadow: 0 0 0 6px color-mix(in srgb, var(--c) 24%, transparent); }
.slotnums { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); margin-top: 10px; }
.slotnums span { text-align: center; font-size: 11px; color: var(--ink3); font-variant-numeric: tabular-nums; }
.slotnums span.used { color: var(--ink); font-weight: 750; }

.trail { list-style: none; margin: 0; padding: 0; }
.trail li {
  display: grid; grid-template-columns: 18px minmax(0, 1.2fr) minmax(0, 1fr) 58px 70px; align-items: center; column-gap: 14px;
  padding: 15px 12px; margin: 0 -12px; border-radius: 12px; border-bottom: 1px solid var(--line);
}
.trail li.found { background: color-mix(in srgb, var(--boil) 11%, transparent); }
.trail .n { font-size: 12px; color: var(--ink3); font-variant-numeric: tabular-nums; }
.trail .word { font-size: 18px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trail li.found .word { color: var(--boil); font-weight: 850; }
.trail .meter { display: block; height: 8px; border-radius: 999px; }
.trail .meter b { border-radius: 999px; min-width: 6px; }
.trail .delta { text-align: right; font-size: 13px; font-weight: 650; color: var(--ink3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.trail .deg { text-align: right; font-size: 18px; font-weight: 800; color: var(--c); font-variant-numeric: tabular-nums; white-space: nowrap; }

.rv { display: flex; flex-direction: column; gap: 14px; padding: 0; overflow: hidden; }
.rv-h { margin: 0; }
.rv-head {
  display: flex; flex-direction: column; gap: 10px; width: 100%; padding: 16px 18px; border: 0; background: transparent;
  text-align: left; color: inherit; font: inherit; cursor: pointer;
}
.rv-head:hover { background: color-mix(in srgb, var(--hi) 55%, transparent); }
.rv-head:focus-visible { outline: 2px solid var(--ink2); outline-offset: -2px; border-radius: 16px; }
.rv-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.rv-top .eyebrow { font-size: 12px; }
.pill { font-size: 12px; font-weight: 750; color: var(--c); border: 1px solid var(--c); border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.rv-q { display: block; font-size: 21px; line-height: 1.25; font-weight: 800; }
.rv .said { display: block; margin: 0; font-size: 15px; font-weight: 400; color: var(--ink2); }
.rv-chev { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 650; color: var(--ink2); }
.rv-chev svg { width: 18px; height: 18px; transition: transform .15s ease; }
.rv.open .rv-chev svg { transform: rotate(180deg); }
.rv-panel { display: flex; flex-direction: column; gap: 10px; padding: 0 18px 16px; margin-top: -4px; }
.rv-count { margin: 0; font-size: 13px; color: var(--ink3); }
/* The answer list scrolls inside its card so a 150-answer question doesn't swallow the page. */
.rv-pane {
  max-height: min(440px, 60vh); overflow-y: auto; overscroll-behavior: contain;
  margin: 0 -10px; padding: 0 10px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.rv-pane:focus-visible { outline: 2px solid var(--ink2); outline-offset: 2px; }
.rv-scale {
  position: sticky; top: 0; z-index: 1; display: flex; justify-content: space-between; padding: 10px 0 6px;
  background: var(--panel); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink3);
}
.rv ol { list-style: none; margin: 0; padding: 0 0 6px; }
.rv li { display: grid; grid-template-columns: minmax(0, 1fr) 80px; align-items: center; column-gap: 12px; padding: 9px 10px; margin: 0 -10px; border-radius: 10px; }
.rv li.mine { background: var(--hi); }
.rv li.none { display: block; font-size: 15px; color: var(--ink2); }
.rv li .mid { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.rv li .line { display: flex; align-items: center; gap: 8px; min-width: 0; }
.rv li .name { font-size: 16px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rv li.mine .name { font-weight: 800; }
.rv li .via { margin-top: -4px; font-size: 13px; color: var(--ink2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rv li .tier { text-align: right; font-size: 12px; font-weight: 750; color: var(--c); white-space: nowrap; }
.rv .meter { height: 5px; background: var(--bg); }
.rv .meter i { background: var(--panel); }
.rv .meter i:nth-of-type(3) { left: 75%; }
.rv li.mine .meter i { background: var(--hi); }
.unopened { padding: 16px 18px; border-radius: 16px; border: 1px dashed var(--line); font-size: 15px; color: var(--ink2); }

/* "Did you mean": shown in place of the error line, so nothing shifts. */
.suggest { margin: 0; min-height: 21px; font-size: 15px; line-height: 1.5; color: var(--ink2); }
.suggest .typed { text-decoration: line-through; text-decoration-color: var(--ink3); }
.suggest-btn {
  min-height: 32px; padding: 0 10px; margin: -4px 0; border-radius: 8px; border: 1px solid var(--line);
  background: var(--hi); color: var(--ink); font-weight: 800;
}
.suggest .hint { font-size: 13px; color: var(--ink3); }

/* Results: each opened question's own answer search. */
.rv-search { position: relative; }
.rv-search svg { position: absolute; left: 14px; top: 50%; width: 18px; height: 18px; margin-top: -9px; color: var(--ink3); pointer-events: none; }
.rv-search input {
  width: 100%; height: 44px; padding: 0 14px 0 42px; border-radius: 12px;
  border: 1.5px solid var(--line); background: var(--bg); font-size: 16px;
}
.rv-search input:focus { outline: none; border-color: var(--ink2); }

/* A day with nothing scheduled. */
.soon { display: flex; justify-content: center; }
.soon-card {
  display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center;
  max-width: 460px; min-height: calc(100svh - 220px); justify-content: center;
}
.soon-card h2 { margin: 0; font-size: 40px; line-height: 1.05; font-weight: 850; font-stretch: 115%; letter-spacing: -0.01em; }
.soon-mark { width: 64px; height: 64px; border-radius: 18px; background: var(--panel); border: 1px solid var(--line); display: inline-flex; align-items: center; justify-content: center; color: var(--t1); margin-bottom: 6px; }
.soon-mark svg { width: 34px; height: 34px; }
.soon-sub { margin: 0; font-size: 17px; color: var(--ink2); }

/* ---- help dialog, toast ------------------------------------------------------ */
.help {
  width: min(460px, calc(100vw - 32px)); max-height: calc(100vh - 32px); max-height: calc(100svh - 32px);
  padding: 0; border: 1px solid var(--line); border-radius: 20px; background: var(--panel); color: var(--ink);
}
.help::backdrop { background: var(--scrim); }
.help form { position: relative; display: flex; flex-direction: column; gap: 16px; padding: 26px 24px 24px; }
.help h2 { margin: 0; padding-right: 44px; font-size: 26px; line-height: 1.1; font-weight: 850; font-stretch: 115%; }
.help p { margin: 0; line-height: 1.55; }
.help .soft { color: var(--ink2); }
.help .fine { font-size: 14px; color: var(--ink3); }
.help b { color: var(--c); }
.help .close { position: absolute; top: 12px; right: 12px; border: 0; color: var(--ink2); }
.help .close path { fill: none; stroke: currentColor; stroke-width: 2px; stroke-linecap: round; }
.help .btn { margin-top: 4px; }
.legend { list-style: none; margin: 0; padding: 0; display: flex; gap: 3px; }
.legend li { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.legend li::before { content: ""; height: 6px; border-radius: 3px; background: var(--c); }
.legend b { font-size: 11px; font-weight: 700; color: var(--c); white-space: nowrap; }
.legend span { font-size: 11px; color: var(--ink3); font-variant-numeric: tabular-nums; white-space: nowrap; }

.toast {
  position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); z-index: 20;
  transform: translate(-50%, 16px); opacity: 0; pointer-events: none;
  max-width: calc(100vw - 32px); padding: 12px 18px; border-radius: 12px;
  background: var(--ink); color: var(--bg); font-size: 15px; font-weight: 600;
  transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---- phones: three header controls only fit beside the wordmark if the units label is short ---- */
@media (max-width: 639px) {
  .units-long { display: none; }
  .units-short { display: inline; }
  .units { gap: 6px; padding-left: 10px; }
}
@media (max-width: 519px) {
  .logo { display: none; }
}

/* ---- small phones: keep the wordmark and the switch on one line ----------------- */
@media (max-width: 420px) {
  .trail li { grid-template-columns: 16px minmax(0, 1fr) 44px 52px 60px; column-gap: 10px; }
  .mark { font-size: 19px; font-stretch: 105%; }
  .bar-inner { gap: 8px; }
  .tools { gap: 6px; }
  .icon-btn { width: 40px; height: 40px; }
  .units { min-height: 40px; padding-right: 5px; }
  .sw { width: 36px; }
  .units[aria-checked="true"] .sw i { left: 15px; }
}

/* ---- the narrowest phones: the switch alone, its meaning is in its label for screen readers ---- */
@media (max-width: 360px) {
  .wrap { padding-inline: 16px; }
  .mark { font-size: 18px; }
  .units-short { display: none; }
  .units { padding-left: 5px; }
}

/* ---- desktop ------------------------------------------------------------------- */
@media (min-width: 900px) {
  .wrap { max-width: 1120px; padding-inline: 40px; }
  .hero h2 { font-size: 60px; }
  body:not(.empty) .play { grid-template-columns: minmax(0, 1fr) 340px; gap: 28px 56px; align-items: start; }
  body:not(.empty) .act { grid-column: 1; grid-row: 1; }
  body:not(.empty) .hist { grid-column: 1; grid-row: 2; }
  body:not(.empty) .know { grid-column: 2; grid-row: 1 / span 2; position: sticky; top: 16px; }
  .page { padding-top: 40px; }
  .bar-inner { padding-top: 20px; padding-bottom: 18px; }
  .results { grid-template-columns: minmax(0, 380px) minmax(0, 1fr); gap: 32px 72px; align-items: start; }
  .sum { position: sticky; top: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .steam path { opacity: .7; }
}
