/* Momo Mysteries. A dark desk, paper exhibits on top of it. */

:root {
  --desk: #14201d;
  --desk-2: #1b2b27;
  --desk-3: #24372f;
  --desk-line: #33493f;
  --paper: #f4eddd;
  --paper-2: #ebe2cd;
  --paper-line: #d3c7aa;
  --ink: #1d1b16;
  --ink-2: #4d4739;
  --ink-3: #736b5a;
  --stamp: #b3261e;
  --brass: #d9a53a;
  --ok: #2f7d4f;
  --warn: #a8690d;
  --on-desk: #ece7d9;
  --on-desk-2: #a8b6ad;
  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --typed: 'Courier Prime', 'Courier New', ui-monospace, monospace;
  --sans: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --radius: 6px;
  --shadow: 0 1px 0 rgba(0, 0, 0, .25), 0 10px 24px -10px rgba(0, 0, 0, .6);
  --bar: 56px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--desk) radial-gradient(1200px 600px at 20% -10%, #21352e 0, transparent 60%);
  color: var(--on-desk);
  font: 16px/1.5 var(--sans);
}
body.has-modal { overflow: hidden; }
h1, h2, h3, h4, p, ol, ul, dl, dd, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; }
b { font-weight: 700; }
small { font-size: .8em; }
.muted { color: var(--ink-3); }
:focus-visible { outline: 3px solid var(--brass); outline-offset: 2px; border-radius: 3px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 12px; top: 12px; z-index: 50; background: var(--paper); color: var(--ink); padding: 8px 12px; border-radius: var(--radius); }
.noscript { padding: 40px; text-align: center; }

/* ---------- top bar */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 18px;
  min-height: var(--bar); padding: 8px 18px;
  background: rgba(16, 26, 23, .94); backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--desk-line);
}
.brand { display: flex; align-items: center; gap: 8px; color: var(--on-desk); text-decoration: none; font: 700 22px/1 var(--serif); letter-spacing: -.01em; }
.brand svg { width: 26px; height: 26px; --stamp: #e0473c; }
.caseline { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; color: var(--on-desk-2); font-size: 14px; white-space: nowrap; overflow: hidden; }
.caseline b { color: var(--on-desk); font-family: var(--typed); font-size: 15px; }
.caseline__title { color: var(--on-desk); overflow: hidden; text-overflow: ellipsis; }
.stars { color: var(--brass); letter-spacing: 1px; font-size: 13px; }
.stars i { font-style: normal; opacity: .28; }
.badge { background: var(--desk-3); border: 1px solid var(--desk-line); border-radius: 99px; padding: 2px 10px; color: var(--on-desk); font-size: 13px; }
.headtools { display: flex; align-items: center; gap: 6px; }
.timer { font: 700 16px/1 var(--typed); color: var(--on-desk); padding: 0 8px; font-variant-numeric: tabular-nums; }
.iconbtn { background: transparent; border: 1px solid transparent; border-radius: var(--radius); padding: 6px 10px; color: var(--on-desk-2); font-size: 14px; font-weight: 500; min-height: 36px; }
.iconbtn:hover { color: var(--on-desk); border-color: var(--desk-line); background: var(--desk-2); }

/* ---------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px;
  background: transparent; color: inherit;
  border: 1.5px solid currentColor; border-radius: var(--radius);
  font-weight: 600; font-size: 15px; line-height: 1.2;
  transition: transform .08s ease, background .15s ease;
}
.btn:hover:not(:disabled) { background: rgba(127, 127, 127, .14); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .45; }
.btn--primary { background: var(--stamp); border-color: var(--stamp); color: #fff; }
.btn--primary:hover:not(:disabled) { background: #9c1f18; }
.btn--small { min-height: 32px; padding: 4px 10px; font-size: 13px; border-width: 1px; }
.btn--wide { width: 100%; }
.btn--accuse[aria-pressed="true"] { background: var(--stamp); border-color: var(--stamp); color: #fff; }

/* ---------- cover */
.main--cover { display: grid; place-items: start center; padding: 36px 16px 64px; }
.cover { width: min(720px, 100%); }
.folder {
  position: relative; background: var(--paper); color: var(--ink);
  border-radius: 4px 14px 6px 6px; padding: 44px 40px 32px; box-shadow: var(--shadow);
  background-image: linear-gradient(transparent 0, transparent calc(100% - 1px), rgba(0, 0, 0, .04) 100%);
  background-size: 100% 28px;
}
.folder__tab {
  position: absolute; top: -26px; left: 0;
  background: var(--paper); color: var(--ink-2);
  font: 700 14px/1 var(--typed); letter-spacing: .08em; text-transform: uppercase;
  padding: 9px 18px 8px; border-radius: 8px 8px 0 0;
}
.cover__meta { color: var(--ink-3); font-size: 14px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.cover .stars { color: #b07c12; }
.cover h1 { font: 700 clamp(34px, 6vw, 52px)/1.05 var(--serif); letter-spacing: -.02em; margin: 8px 0 16px; }
.cover__lede { font: 17px/1.55 var(--typed); color: var(--ink); max-width: 56ch; }
.cover__coop { margin-top: 14px; padding: 10px 14px; background: var(--paper-2); border-left: 4px solid var(--brass); border-radius: 0 var(--radius) var(--radius) 0; font-size: 15px; }
.proofbox { position: relative; margin: 26px 0 24px; padding: 18px 20px; border: 1.5px dashed var(--ink-3); border-radius: var(--radius); }
.proofbox h2 { font: 700 13px/1 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 10px; }
.proofbox li { position: relative; padding-left: 22px; margin: 5px 0; font-size: 15px; max-width: 52ch; }
.proofbox li::before { content: '✓'; position: absolute; left: 0; color: var(--ok); font-weight: 700; }
.cover__actions { display: flex; flex-wrap: wrap; gap: 12px; }
.cover__foot { margin-top: 16px; color: var(--ink-3); font-size: 14px; }

.stamp {
  display: inline-block; padding: 6px 14px 4px;
  border: 3px solid currentColor; border-radius: 6px;
  font: 700 18px/1 var(--typed); letter-spacing: .14em; text-transform: uppercase;
  transform: rotate(-7deg); opacity: .88;
  -webkit-mask-image: radial-gradient(circle at 30% 40%, #000 55%, rgba(0, 0, 0, .7) 70%, #000 85%);
          mask-image: radial-gradient(circle at 30% 40%, #000 55%, rgba(0, 0, 0, .7) 70%, #000 85%);
}
.stamp--proved { color: var(--ok); }
.stamp--no { color: var(--stamp); }
.proofbox .stamp { position: absolute; right: 16px; top: -18px; background: var(--paper); }

/* ---------- desk layout */
.main--desk {
  display: grid; grid-template-columns: minmax(0, 1fr) clamp(420px, 38vw, 560px);
  height: calc(100dvh - var(--bar)); overflow: hidden;
}
.panel { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.panel--bench { background: var(--desk-2); border-left: 1px solid var(--desk-line); }
.scroll { flex: 1; overflow-y: auto; padding: 18px 20px 40px; scrollbar-color: var(--desk-line) transparent; }
.switch { display: none; }

.tabs { display: flex; gap: 2px; padding: 10px 14px 0; border-bottom: 1px solid var(--desk-line); overflow-x: auto; scrollbar-width: none; flex: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: none; background: transparent; border: 1px solid transparent; border-bottom: 0;
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 9px 14px 8px; min-height: 40px; color: var(--on-desk-2); font-weight: 600; font-size: 14.5px; white-space: nowrap;
}
.tab:hover { color: var(--on-desk); }
.tab[aria-selected="true"] { background: var(--paper); color: var(--ink); }
.count { display: inline-block; min-width: 20px; padding: 0 5px; margin-left: 4px; border-radius: 99px; background: rgba(127, 127, 127, .28); font: 700 12px/20px var(--typed); text-align: center; }

.section-title { font: 700 13px/1.2 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--on-desk-2); margin: 26px 0 12px; }
.section-title small { text-transform: none; letter-spacing: 0; font-weight: 500; margin-left: 6px; }

/* ---------- paper */
.paper {
  background: var(--paper); color: var(--ink);
  padding: 22px 24px; border-radius: 3px; box-shadow: var(--shadow);
}
.paper--typed { font: 16px/1.6 var(--typed); }
.paper--typed p + p { margin-top: 10px; }
.paper--typed b { background: linear-gradient(transparent 62%, rgba(217, 165, 58, .45) 0); }
.paper__head { font: 700 13px/1.3 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); }
.paper__ref { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 14px; color: var(--ink-3); border-bottom: 1.5px solid var(--ink); padding: 4px 0 8px; margin-bottom: 14px; }
.paper__note { margin-top: 12px; font: 13.5px/1.45 var(--sans); color: var(--ink-2); }
.paper--printout { font: 15px/1.5 var(--typed); background: #f7f7f1 repeating-linear-gradient(#f7f7f1 0 27px, #e9efe6 27px 54px); }

.brief { max-width: 760px; }
.rules { max-width: 760px; margin-top: 16px; padding: 16px 20px; border: 1px solid var(--desk-line); border-radius: var(--radius); background: var(--desk-2); }
.rules h3 { font: 700 13px/1 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--brass); margin-bottom: 10px; }
.rules ol { counter-reset: r; }
.rules li { counter-increment: r; position: relative; padding-left: 28px; margin: 6px 0; font-size: 15px; color: var(--on-desk-2); }
.rules li b { color: var(--on-desk); }
.rules li::before { content: counter(r); position: absolute; left: 0; top: 1px; width: 20px; height: 20px; border-radius: 50%; background: var(--desk-3); color: var(--on-desk); font: 700 12px/20px var(--typed); text-align: center; }

.suspects { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.suspect { display: flex; gap: 14px; background: var(--paper); color: var(--ink); padding: 14px; border-radius: 3px; box-shadow: var(--shadow); }
.suspect h4 { font: 700 19px/1.15 var(--serif); }
.suspect__role { color: var(--ink-3); font-size: 14px; margin-bottom: 8px; }
.portrait { width: 64px; height: 64px; flex: none; border-radius: 6px; display: block; }
.portrait--witness { display: grid; place-items: center; background: var(--paper-2); border: 1.5px dashed var(--ink-3); color: var(--ink-3); font: 700 22px/1 var(--serif); }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px 14px; font-size: 14px; }
.facts div { display: flex; justify-content: space-between; gap: 8px; border-bottom: 1px dotted var(--paper-line); }
.facts dt { color: var(--ink-3); }
.facts dd { font: 700 14px/1.5 var(--typed); text-align: right; }
.facts--tight { display: flex; flex-wrap: wrap; gap: 2px 12px; font-size: 12.5px; margin-top: 8px; }
.facts--tight dd { white-space: nowrap; }
.facts--tight div { border: 0; justify-content: flex-start; gap: 4px; }
.facts--tight dd { font-size: 13px; }

/* ---------- exhibits */
.exhibits { display: grid; gap: 22px; max-width: 820px; }
.exhibit__head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.exhibit__head h3 { font: 600 16px/1.2 var(--sans); color: var(--on-desk); }
.tag { flex: none; background: var(--brass); color: #1d1b16; font: 700 14px/1 var(--typed); padding: 5px 8px 3px; border-radius: 3px; }
.exhibit__cite { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; color: var(--on-desk-2); font-size: 13.5px; }
.exhibit__used { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.citemenu { flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 10px 12px; background: var(--desk-2); border: 1px solid var(--desk-line); border-radius: var(--radius); }
.citemenu p { margin-right: 4px; color: var(--on-desk); }
.locked { padding: 18px 20px; border: 1.5px dashed var(--desk-line); border-radius: var(--radius); color: var(--on-desk-2); background: repeating-linear-gradient(135deg, transparent 0 12px, rgba(255, 255, 255, .025) 12px 24px); }

.log { width: 100%; border-collapse: collapse; margin-bottom: 14px; }
.log th { width: 5.5ch; text-align: left; vertical-align: top; padding: 4px 14px 4px 0; font-weight: 700; white-space: nowrap; }
.log td { padding: 4px 0; border-bottom: 1px dotted var(--paper-line); }
.scroll-x { overflow-x: auto; }
.calls { width: 100%; border-collapse: collapse; white-space: nowrap; }
.calls th { text-align: left; font: 700 12px/1.3 var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); padding: 0 14px 6px 0; border-bottom: 1.5px solid var(--ink); }
.calls td { padding: 0 14px 0 0; height: 27px; }
.calls td:nth-child(2) { text-align: right; }
.calls td:nth-child(4) { color: var(--ink-3); font-size: 13px; }

.print { background: #fbfaf6; padding: 10px 10px 0; border-radius: 2px; box-shadow: var(--shadow); max-width: 680px; }
.print__img { display: block; width: 100%; padding: 0; border: 0; background: #111; cursor: zoom-in; }
.photo-art { display: block; width: 100%; height: auto; }
.print figcaption { padding: 12px 6px 14px; color: var(--ink); font: 14.5px/1.5 var(--typed); }

.transcript__who { display: flex; align-items: center; gap: 12px; padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1.5px solid var(--ink); font-family: var(--sans); line-height: 1.35; }
.transcript__who span { color: var(--ink-3); font-size: 14px; }
.transcript__who b { background: none; font-size: 17px; }
.transcript dl { display: grid; grid-template-columns: 2.6ch minmax(0, 1fr); gap: 4px 8px; }
.transcript dt { font-weight: 700; color: var(--ink-3); }
.transcript dd.q { color: var(--ink-2); font-style: italic; }
.transcript dd:not(.q) { margin-bottom: 8px; }

/* ---------- pills and chips */
.pill {
  display: inline-flex; align-items: baseline; gap: 6px;
  min-height: 32px; padding: 4px 10px; border-radius: 99px;
  background: transparent; border: 1px solid var(--desk-line); color: var(--on-desk); font-size: 13.5px; font-weight: 600;
}
.pill small { font-weight: 400; color: var(--on-desk-2); max-width: 15ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill:hover:not(:disabled) { border-color: var(--brass); }
.pill.is-on { background: var(--brass); border-color: var(--brass); color: #1d1b16; }
.pill.is-on small { color: #3d3420; }
.pill:disabled { opacity: .35; }
.chip { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 4px; background: var(--brass); color: #1d1b16; font: 700 13px/1.5 var(--typed); border: 0; }
.chip--x:hover:not(:disabled) { background: #f0c260; }

/* ---------- accusation sheet */
.sheet__hint { color: var(--on-desk-2); font-size: 14px; margin-bottom: 14px; }
.sheet__list { display: grid; gap: 10px; }
.srow { background: var(--paper); color: var(--ink); border-radius: 3px; padding: 12px 14px; box-shadow: var(--shadow); border-left: 5px solid transparent; }
.srow.is-accused, .srow.is-guilty { border-left-color: var(--stamp); background: #f6e4dc; }
.srow.is-ruled { opacity: .82; }
.srow.is-ruled .srow__who b { text-decoration: line-through; text-decoration-thickness: 2px; text-decoration-color: var(--ink-3); }
.srow__top { display: flex; align-items: center; gap: 12px; }
.srow__top .portrait { width: 44px; height: 44px; }
.srow__who { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.srow__who b { font: 700 17px/1.2 var(--serif); }
.srow__who span { color: var(--ink-3); font-size: 13px; }
.srow__who em { color: var(--ok); font-style: normal; font-weight: 600; }
.srow__cites { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; padding-top: 10px; border-top: 1px dotted var(--paper-line); font-size: 13.5px; }
.srow__label { color: var(--ink-3); margin-right: 2px; }
.srow__cites .btn { margin-left: auto; }
.srow__accused { margin-top: 10px; padding-top: 10px; border-top: 1px dotted var(--paper-line); color: var(--stamp); font: 700 14px/1.3 var(--typed); letter-spacing: .06em; text-transform: uppercase; }
.picker { margin-top: 10px; padding: 10px; border-radius: var(--radius); background: var(--desk); display: grid; gap: 8px; }
.picker__group { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.picker__group > span { flex-basis: 100%; color: var(--on-desk-2); font: 700 11px/1 var(--sans); letter-spacing: .1em; text-transform: uppercase; }
.judged { margin-top: 8px; padding: 8px 10px; border-radius: 4px; font-size: 13.5px; line-height: 1.45; background: var(--paper-2); }
.judged--airtight { box-shadow: inset 3px 0 0 var(--ok); }
.judged--padded { box-shadow: inset 3px 0 0 var(--warn); }
.judged--unsound, .judged--none { box-shadow: inset 3px 0 0 var(--ink-3); }
.sheet__foot { position: sticky; bottom: -40px; margin: 16px -20px -40px; padding: 14px 20px 20px; background: linear-gradient(transparent, var(--desk-2) 18px); display: grid; gap: 10px; }
.pips { display: flex; gap: 6px; justify-content: center; }
.pip { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--on-desk-2); }
.pip.is-wrong { background: var(--stamp); border-color: var(--stamp); }
.pip.is-right { background: #3fa869; border-color: #3fa869; }
.histories { display: grid; gap: 6px; }
.history { background: var(--desk-3); border: 1px solid var(--desk-line); border-radius: var(--radius); padding: 8px 12px; text-align: left; font-size: 14px; min-height: 40px; }
.history:hover { border-color: var(--brass); }
.squares { letter-spacing: 1px; margin-left: 6px; }

/* ---------- map */
.mapframe { border-radius: 3px; overflow-x: auto; box-shadow: var(--shadow); background: #efe6cf; }
.map-art { display: block; width: 100%; min-width: 440px; height: auto; }
.map__paper { fill: #efe6cf; }
.map__grid path { stroke: rgba(90, 80, 50, .12); stroke-width: 1; fill: none; }
.road__case { stroke: #b6a67f; stroke-width: 15; stroke-linecap: round; fill: none; }
.road__fill { stroke: #fffaf0; stroke-width: 9; stroke-linecap: round; fill: none; }
.road.is-hot .road__fill { stroke: var(--stamp); }
.road__badge { fill: #fffaf0; stroke: #6b6250; stroke-width: 2; }
.road.is-hot .road__badge { fill: var(--stamp); stroke: #7d1711; }
.road__min { font: 700 19px/1 var(--sans); fill: var(--ink); }
.road.is-hot .road__min { fill: #fff; }
.place { cursor: pointer; }
.place__dot { fill: #fffaf0; stroke: var(--ink); stroke-width: 3; }
.place.is-scene .place__dot { stroke: var(--stamp); stroke-width: 6; }
.place.is-picked .place__dot { fill: #ffd97a; }
.place:focus-visible { outline: none; }
.place:focus-visible .place__dot { stroke: var(--brass); stroke-width: 7; }
.place__icon { font-size: 30px; }
.place__label { font: 700 23px/1 var(--sans); fill: var(--ink); paint-order: stroke; stroke: #efe6cf; stroke-width: 7px; stroke-linejoin: round; }
.place__flag { fill: var(--stamp); }
.place__flagtext { font: 700 14px/1 var(--sans); letter-spacing: .12em; fill: #fff; }
.map__readout { margin-top: 12px; padding: 10px 12px; background: var(--desk-3); border-radius: var(--radius); font-size: 14.5px; color: var(--on-desk-2); min-height: 44px; }
.map__readout b { color: var(--on-desk); }
.toscene { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 4px 18px; }
.toscene li { display: flex; justify-content: space-between; gap: 8px; padding: 5px 0; border-bottom: 1px dotted var(--desk-line); font-size: 14.5px; }
.toscene b { font-family: var(--typed); }

.notes { display: grid; gap: 8px; height: 100%; grid-template-rows: auto 1fr; }
.notes label { color: var(--on-desk-2); font-size: 14px; }
.notes textarea { width: 100%; min-height: 320px; resize: vertical; padding: 16px; border: 0; border-radius: 3px; background: var(--paper) repeating-linear-gradient(transparent 0 27px, rgba(60, 90, 140, .18) 27px 28px); color: var(--ink); font: 16px/28px var(--typed); }

/* ---------- modal */
.modal { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 16px; }
.modal[hidden] { display: none; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(8, 13, 11, .72); }
.modal__card {
  position: relative; width: min(640px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto;
  background: var(--paper); color: var(--ink); border-radius: 8px; padding: 32px 32px 28px; box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
  animation: rise .18s ease-out;
}
.modal__card:focus { outline: none; }
.modal__card--zoom { width: min(980px, 100%); }
.modal__card--result, .modal__card--verdict { width: min(700px, 100%); }
@keyframes rise { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal__x { position: absolute; top: 8px; right: 10px; width: 40px; height: 40px; border: 0; background: transparent; color: var(--ink-3); font-size: 28px; line-height: 1; border-radius: 50%; }
.modal__x:hover { background: var(--paper-2); color: var(--ink); }
.modal__kicker { font: 700 12.5px/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 8px; }
.modal__card h2 { font: 700 30px/1.1 var(--serif); letter-spacing: -.01em; margin-bottom: 12px; }
.modal__card h3 { font: 700 13px/1 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); margin: 24px 0 10px; }
.modal__card p { max-width: 62ch; }
.modal__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 22px; }
.modal__card .stamp { float: right; margin: 4px 30px 8px 12px; }

.steps { counter-reset: s; display: grid; gap: 10px; margin-top: 6px; }
.steps li { counter-increment: s; position: relative; padding-left: 38px; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: var(--paper); font: 700 14px/26px var(--typed); text-align: center; }
.plain li, .legend li { padding: 3px 0 3px 18px; position: relative; }
.plain li::before { content: '–'; position: absolute; left: 0; color: var(--ink-3); }
.legend li { padding-left: 0; }
.howto .muted { margin-top: 14px; font-size: 14px; }

.vrows { display: grid; gap: 8px; margin-top: 16px; }
.vrow { display: flex; gap: 10px; padding: 10px 12px; background: var(--paper-2); border-radius: var(--radius); }
.vrow__mark { font-size: 18px; line-height: 1.4; }
.vrow__status { color: var(--ink-3); font: 700 13px/1 var(--typed); margin-left: 4px; }
.vrow p { font-size: 14.5px; color: var(--ink-2); margin-top: 2px; }

.result__score { font: 700 64px/1 var(--serif); margin: 2px 0 14px; }
.result__score span { font-size: 24px; color: var(--ink-3); }
.breakdown { display: flex; flex-wrap: wrap; gap: 8px; }
.breakdown div { flex: 1 1 96px; background: var(--paper-2); border-radius: var(--radius); padding: 10px 12px; }
.breakdown dt { font: 700 11.5px/1 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 6px; }
.breakdown dd { font: 700 24px/1 var(--typed); }
.breakdown small { font-size: 13px; color: var(--ink-3); }
.sharebox { margin-top: 16px; padding: 16px; background: var(--desk); color: var(--on-desk); border-radius: var(--radius); }
.sharebox pre { margin: 0; font: 16px/1.5 var(--typed); white-space: pre-wrap; }
.sharebox .modal__actions { margin-top: 14px; }
.sharebox__note { color: var(--on-desk-2); font-size: 13.5px; }
.story { display: flex; gap: 14px; align-items: flex-start; }
.story p + p { margin-top: 6px; }
.proof { display: grid; gap: 10px; }
.proof li { padding-bottom: 10px; border-bottom: 1px dotted var(--paper-line); }
.proof p { font-size: 14.5px; color: var(--ink-2); margin-top: 2px; }
.tagline { font: 700 13px/1 var(--typed); background: var(--brass); padding: 3px 6px 1px; border-radius: 3px; margin-left: 6px; }
.result__next { margin-top: 20px; font-size: 15px; }
.result__next b { font-family: var(--typed); }

.archive__list { display: grid; gap: 6px; margin-top: 14px; }
.archive__row { width: 100%; display: grid; grid-template-columns: 44px minmax(0, 1fr) auto 96px; align-items: center; gap: 10px; padding: 10px 12px; background: var(--paper-2); border: 1.5px solid transparent; border-radius: var(--radius); text-align: left; min-height: 56px; }
.archive__row:hover { border-color: var(--ink); }
.archive__row.is-current { border-color: var(--brass); }
.archive__no { font: 700 16px/1 var(--typed); }
.archive__title { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.archive__title b { font: 700 17px/1.2 var(--serif); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.archive__title small { color: var(--ink-3); }
.archive .stars { color: #b07c12; }
.archive__state { text-align: right; font: 700 13.5px/1.2 var(--typed); color: var(--ink-2); }

.linkbox { display: grid; gap: 6px; margin-top: 18px; font: 700 12.5px/1 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.linkbox input { width: 100%; padding: 12px; border: 1.5px solid var(--ink); border-radius: var(--radius); background: #fff; color: var(--ink); font: 14px/1.2 var(--typed); letter-spacing: 0; text-transform: none; }
.confirm__who { display: flex; gap: 14px; align-items: center; }
.zoom .photo-art { border-radius: 3px; margin: 6px 0 12px; }
.zoom p:last-of-type { font: 15px/1.5 var(--typed); }

.toast { position: fixed; left: 50%; bottom: 28px; z-index: 60; transform: translate(-50%, 20px); padding: 12px 18px; background: var(--paper); color: var(--ink); border-radius: var(--radius); box-shadow: var(--shadow); font-weight: 600; font-size: 15px; opacity: 0; pointer-events: none; transition: opacity .18s ease, transform .18s ease; max-width: calc(100vw - 32px); }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- small screens: one pane at a time */
@media (max-width: 940px) {
  /* Phone header: name and menu on the first row, case line and clock on the second. */
  .topbar { position: relative; gap: 2px 4px; padding: 6px 12px 8px; flex-wrap: wrap; }
  .brand { order: 1; font-size: 17px; gap: 6px; }
  .brand svg { width: 20px; height: 20px; }
  .headtools { display: contents; }
  .iconbtn { order: 2; padding: 6px 4px; font-size: 13px; }
  .headtools .iconbtn:first-of-type { margin-left: auto; }
  .caseline { order: 3; flex: 1 1 calc(100% - 64px); font-size: 13px; }
  .caseline__date { display: none; }
  .timer { order: 4; margin-left: auto; padding: 0; font-size: 15px; }
  .main--desk { display: block; height: auto; overflow: visible; padding-bottom: 72px; }
  .panel { display: none; }
  .show-file .panel--file, .show-bench .panel--bench { display: flex; }
  .panel--bench { border-left: 0; min-height: calc(100dvh - 160px); }
  .scroll { overflow: visible; padding: 16px 14px 32px; }
  .tabs { position: sticky; top: 0; background: var(--desk); z-index: 5; padding: 8px 10px 0; }
  .panel--bench .tabs { background: var(--desk-2); }
  .switch { position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); background: rgba(16, 26, 23, .96); border-top: 1px solid var(--desk-line); }
  .switch button { min-height: 46px; border-radius: var(--radius); border: 1.5px solid var(--desk-line); background: transparent; color: var(--on-desk-2); font-weight: 600; font-size: 14.5px; }
  .switch button[aria-pressed="true"] { background: var(--paper); border-color: var(--paper); color: var(--ink); }
  .sheet__foot { position: static; margin: 16px 0 0; padding: 0; background: none; }
  .paper { padding: 18px 16px; }
  .paper--typed { font-size: 15px; }
  .folder { padding: 36px 22px 26px; }
  .modal__card { padding: 28px 20px 22px; }
  .modal__card .stamp { margin-right: 26px; font-size: 15px; }
  .map-art { min-width: 620px; }
  .zoom .photo-art { min-width: 0; }
  .archive__row { grid-template-columns: 38px minmax(0, 1fr) 84px; }
  .archive__row .stars { display: none; }
  .result__score { font-size: 52px; }
  .toast { bottom: 84px; }
}

@media (max-width: 420px) {
  .brand svg { display: none; }
}

@media (max-width: 345px) {
  .brand { font-size: 15px; }
  .iconbtn { font-size: 12px; padding: 6px 3px; }
}

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

a.btn { text-decoration: none; }
