/* Layout: a field-guide board. Grid of specimens → one specimen with its screens on the left
   and a notes-and-feedback panel on the right → a full-screen mark-up table for drawing and pins. */
:root {
  --paper: #edefe9;
  --card: #f8f9f5;
  --ink: #1c2420;
  --muted: #59645d;
  --line: #d2d8ce;
  --gum: #3c5c49;
  --gum-soft: #e2eadd;
  --wattle: #e2b33c;
  --wattle-ink: #2a2310;
  --avoid: #983a2c;
  --pen-good: #2e9a5c;
  --pen-bad: #d9442f;
  --scrim: rgb(14 20 17 / .62);
  --shadow: 0 1px 2px rgb(28 36 32 / .06), 0 12px 32px -12px rgb(28 36 32 / .22);

  --display: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;
  --body: "Source Serif 4", Georgia, "Times New Roman", serif;
  --mono: "Spline Sans Mono", ui-monospace, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #131916; --card: #1b2320; --ink: #e6ebe3; --muted: #9ba79f; --line: #2d3832;
    --gum: #8fbb9f; --gum-soft: #21302a; --wattle: #e2b33c; --wattle-ink: #2a2310; --avoid: #e48f7c;
    --pen-good: #4cc27c; --pen-bad: #ff6a54;
    --scrim: rgb(0 0 0 / .72);
    --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 12px 32px -12px rgb(0 0 0 / .6);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--paper); color: var(--ink);
  font-family: var(--body); font-size: 17px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--gum); }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--gum); outline-offset: 3px; border-radius: 4px; }
[hidden] { display: none !important; }
.wrap { max-width: 1320px; margin-inline: auto; padding-inline: 20px; }
.boot { padding: 80px 20px; text-align: center; font-family: var(--mono); color: var(--muted); }
.gate { max-width: 460px; margin-inline: auto; }
.code-form { display: grid; gap: 12px; margin-top: 24px; text-align: left; }

.label {
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 8px;
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 500 13px/1 var(--mono); cursor: pointer; text-decoration: none;
  border: 1px solid var(--ink); background: var(--card); color: var(--ink);
  padding: 11px 16px; border-radius: 999px; min-height: 40px;
}
.btn:hover { background: var(--ink); color: var(--card); }
.btn.primary { background: var(--gum); border-color: var(--gum); color: var(--card); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.quiet { border-color: var(--line); color: var(--muted); }
.btn.quiet:hover { background: var(--paper); color: var(--ink); }
.btn { white-space: nowrap; }
.btn svg, .seg svg { width: 16px; height: 16px; flex: none; }

/* ---------- Top bar ---------- */
.top {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top, 0px);
}
.top .wrap { display: flex; align-items: center; gap: 12px 20px; flex-wrap: wrap; padding-block: 10px; }
.brand { background: none; border: 0; padding: 0; cursor: pointer; text-align: left; display: grid; }
.brand b { font-family: var(--display); font-weight: 800; font-size: 20px; letter-spacing: -.02em; line-height: 1.05; }
.brand span { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.tabs { display: flex; gap: 4px; }
.tabs button {
  background: none; border: 0; cursor: pointer; padding: 8px 12px; border-radius: 999px;
  font: 500 13px/1 var(--mono); color: var(--muted);
}
.tabs button[aria-current="page"] { background: var(--ink); color: var(--card); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.progress { display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.progress .short { display: none; }
.progress .bar { width: 90px; height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; }
.progress .bar i { display: block; height: 100%; background: var(--gum); border-radius: 99px; }
.me-chip {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 5px 12px 5px 5px;
  font: 500 13px/1 var(--mono);
}
.avatar {
  width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center; flex: none;
  font: 700 12px/1 var(--display); color: #fff; background: var(--gum);
}
.save-state { font-family: var(--mono); font-size: 11.5px; color: var(--muted); min-width: 9ch; }
.save-state.bad { color: var(--avoid); }
.role-badge { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; background: var(--wattle); color: var(--wattle-ink); padding: 4px 8px; border-radius: 6px; }

/* ---------- Intro ---------- */
.intro {
  margin-block: 28px 8px; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 24px 48px; align-items: start;
}
.intro h1 {
  font-family: var(--display); font-weight: 800; font-size: clamp(36px, 5vw, 64px);
  line-height: .95; letter-spacing: -.025em; margin: 0 0 14px; text-wrap: balance;
}
.intro p { margin: 0 0 10px; max-width: 58ch; color: var(--muted); font-size: 18px; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; counter-reset: step; }
.steps li {
  display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; align-items: start;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px;
  font-size: 15.5px; line-height: 1.45;
}
.steps li::before {
  counter-increment: step; content: counter(step);
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  font: 800 15px/1 var(--display); background: var(--ink); color: var(--card);
}
.steps b { font-weight: 600; }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; margin-inline: 2px; }
.swatch.good { background: var(--pen-good); }
.swatch.bad { background: var(--pen-bad); }

/* ---------- Filters ---------- */
.filters { display: grid; gap: 10px; margin-block: 24px 18px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip-row .label { margin: 0 6px 0 0; }
.chip {
  border: 1px solid var(--line); background: var(--card); color: var(--muted);
  font: 500 12.5px/1 var(--mono); padding: 8px 12px; border-radius: 999px; cursor: pointer; min-height: 34px;
}
.chip[aria-pressed="true"] { background: var(--ink); color: var(--card); border-color: var(--ink); }
.chip .n { opacity: .65; margin-left: 4px; font-variant-numeric: tabular-nums; }
.chip-row.page-types { padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.chip-row.page-types .chip { font-size: 13px; padding: 9px 13px; }
.page-tabs { margin: -2px 0 14px; }
.site-title .meta b { color: var(--ink); font-weight: 500; }

/* ---------- Grid ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.card {
  display: grid; grid-template-rows: auto 1fr; text-decoration: none; color: inherit;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
  transition: transform .15s ease, box-shadow .15s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.thumb { position: relative; aspect-ratio: 16 / 10; background: var(--paper); border-bottom: 1px solid var(--line); overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.thumb .num-badge {
  position: absolute; left: 8px; top: 8px; font: 800 14px/1 var(--display); background: var(--card); color: var(--ink);
  padding: 6px 8px; border-radius: 6px; font-variant-numeric: tabular-nums;
}
.thumb .start {
  position: absolute; right: 8px; top: 8px; font: 500 10.5px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase;
  background: var(--wattle); color: var(--wattle-ink); padding: 6px 8px; border-radius: 6px;
}
.card.unseen .thumb::after {
  content: "New"; position: absolute; left: 8px; bottom: 8px; font: 500 10.5px/1 var(--mono); letter-spacing: .06em;
  text-transform: uppercase; background: var(--ink); color: var(--card); padding: 5px 7px; border-radius: 6px;
}
.card-body { padding: 12px 14px 14px; display: grid; gap: 4px; align-content: start; }
.card h3 { font-family: var(--display); font-weight: 700; font-size: 18px; line-height: 1.15; margin: 0; letter-spacing: -.01em; }
.card .loc { margin: 0; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.reacts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; min-height: 24px; }
.react-pill {
  display: inline-flex; align-items: center; gap: 4px; font: 500 11.5px/1 var(--mono);
  padding: 4px 7px 4px 4px; border-radius: 999px; border: 1px solid var(--line);
}
.react-pill .avatar { width: 16px; height: 16px; font-size: 9px; }
.react-pill.love { background: var(--wattle); border-color: var(--wattle); color: var(--wattle-ink); }
.react-pill.like { background: var(--gum-soft); border-color: var(--gum-soft); }
.react-pill.no { color: var(--muted); }
.react-pill svg { width: 12px; height: 12px; }

.empty { padding: 40px 20px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 12px; }

.finds { margin-block: 48px 64px; }
.finds h2, .summary h2, .summary h3 { font-family: var(--display); font-weight: 700; letter-spacing: -.02em; margin: 0; }
.finds h2 { font-size: 28px; }
.finds-head { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: end; justify-content: space-between; margin-bottom: 16px; }
.finds-head p { margin: 4px 0 0; color: var(--muted); }
.find-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.find {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px;
  display: grid; gap: 6px; align-content: start; min-width: 0;
}
.find a.url { font-family: var(--mono); font-size: 13px; word-break: break-all; }
.find h3 { font-family: var(--display); font-size: 18px; margin: 0; }
.find p { margin: 0; font-size: 15px; }
.find .by { font-family: var(--mono); font-size: 11.5px; color: var(--muted); display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.link-btn { background: none; border: 0; padding: 0; cursor: pointer; color: var(--avoid); font: 500 11.5px/1 var(--mono); text-decoration: underline; }

/* ---------- Site view ---------- */
.site-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding-block: 18px 14px; }
.site-head .spacer { flex: 1; }
.site-title { display: grid; gap: 2px; min-width: 0; }
.site-title h1 { font-family: var(--display); font-weight: 800; font-size: clamp(26px, 3.4vw, 40px); line-height: 1; margin: 0; letter-spacing: -.02em; }
.site-title .meta { font-family: var(--mono); font-size: 12.5px; color: var(--muted); }
.site-title .num { color: var(--gum); }
.pager { display: flex; gap: 6px; }

.site-layout { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(320px, 1fr); gap: 22px; align-items: start; padding-bottom: 60px; }
.screens-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px; display: grid; gap: 14px; }
.screens { display: grid; grid-template-columns: minmax(0, 3.3fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.device-label { font-family: var(--mono); font-size: 11.5px; color: var(--muted); display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.browser { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--paper); }
.browser > .device-label { padding: 7px 12px; border-bottom: 1px solid var(--line); }
.window { position: relative; }
.browser .window { aspect-ratio: 16 / 10; }
.phone { border: 5px solid var(--ink); border-radius: 22px; overflow: hidden; background: var(--ink); }
.phone .window { aspect-ratio: 390 / 844; background: var(--card); }
.phone-col { display: grid; gap: 8px; }
.phone-col .device-label { justify-content: center; }
.scroller { position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; }
.page { position: relative; }
.page img { width: 100%; height: auto; }
.marks-svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.firstload-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top; opacity: 0; pointer-events: none; transition: opacity .3s; }
.screens-card[data-view="firstload"] .firstload-img { opacity: 1; pointer-events: auto; }
.clip-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: none; background: var(--ink); }
.screens-card[data-view="video"] .clip-video { display: block; }
.screens-card[data-view="video"] .scroll-cue { opacity: 0; }
.thumb .video-badge {
  position: absolute; right: 8px; bottom: 8px; font: 500 10.5px/1 var(--mono); letter-spacing: .04em;
  background: var(--ink); color: var(--card); padding: 6px 8px; border-radius: 6px;
}
.scroll-cue {
  position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); pointer-events: none; white-space: nowrap;
  font: 500 11.5px/1 var(--mono); color: var(--card); background: var(--ink); padding: 7px 11px; border-radius: 999px;
  box-shadow: var(--shadow); transition: opacity .3s;
}
.scroll-cue.gone, .screens-card[data-view="firstload"] .scroll-cue { opacity: 0; }
.screens-foot { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.screens-foot .spacer { flex: 1; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; gap: 2px; background: var(--paper); }
.seg button {
  font: 500 12.5px/1 var(--mono); color: var(--muted); background: none; border: 0; cursor: pointer;
  padding: 8px 12px; border-radius: 999px; display: inline-flex; gap: 6px; align-items: center; min-height: 34px;
  white-space: nowrap;
}
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--card); }
.caption { font-family: var(--mono); font-size: 11.5px; color: var(--muted); margin: 0; }
.view-note { font-size: 14.5px; color: var(--muted); margin: 0; }
.view-note strong { color: var(--avoid); font-weight: 600; }

.panel { display: grid; gap: 14px; position: sticky; top: 76px; max-height: calc(100vh - 92px); overflow-y: auto; scrollbar-width: thin; padding-bottom: 8px; }
.box { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px; display: grid; gap: 14px; }
.box h2 { font-family: var(--display); font-weight: 700; font-size: 20px; margin: 0; letter-spacing: -.01em; }
.why { margin: 0; font-style: italic; font-size: 17px; line-height: 1.45; }
.note p { margin: 0; font-size: 15.5px; }
.note.borrow { background: var(--gum-soft); border-radius: 10px; padding: 12px 14px; }
.note.borrow .label { color: var(--gum); }
.note.avoid .label { color: var(--avoid); }
.visit { font-family: var(--mono); font-size: 13px; }

.reactions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.reaction {
  display: grid; justify-items: center; gap: 6px; padding: 12px 6px; border-radius: 12px; cursor: pointer;
  border: 1px solid var(--line); background: var(--paper); font: 500 12.5px/1.1 var(--mono); color: var(--ink); text-align: center;
}
.reaction svg { width: 22px; height: 22px; }
.reaction[aria-pressed="true"].love { background: var(--wattle); border-color: var(--wattle); color: var(--wattle-ink); }
.reaction[aria-pressed="true"].like { background: var(--gum); border-color: var(--gum); color: var(--card); }
.reaction[aria-pressed="true"].no { background: var(--avoid); border-color: var(--avoid); color: var(--card); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
textarea, input[type="text"], input[type="url"] {
  width: 100%; font: 16px/1.45 var(--body); color: var(--ink); background: var(--paper);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
}
textarea { min-height: 96px; resize: vertical; }
textarea:focus, input:focus { outline: 2px solid var(--gum); outline-offset: 0; border-color: transparent; }
.markup-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.markup-row .count { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.pin-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.pin-list li { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 10px; align-items: start; font-size: 15px; }
.pin-list button { background: none; border: 0; padding: 0; cursor: pointer; text-align: left; font: inherit; color: inherit; }
.pin-dot {
  width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; flex: none;
  font: 700 12px/1 var(--display); background: var(--ink); color: var(--card);
}
.pin-list .where { font-family: var(--mono); font-size: 11px; color: var(--muted); display: block; }
.other { border-top: 1px solid var(--line); padding-top: 12px; display: grid; gap: 8px; }
.other:first-of-type { border-top: 0; padding-top: 0; }
.other-head { display: flex; align-items: center; gap: 8px; font: 500 13px/1 var(--mono); }
.other p { margin: 0; font-size: 15px; }
.other .tags .chip { cursor: default; }

/* ---------- Mark-up table ---------- */
.markup:focus { outline: none; }
.markup { position: fixed; inset: 0; z-index: 60; background: var(--paper); display: grid; grid-template-rows: auto minmax(0, 1fr); grid-template-columns: minmax(0, 1fr); }
.mk-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 14px;
  padding-top: calc(10px + env(safe-area-inset-top, 0px));
  background: var(--card); border-bottom: 1px solid var(--line);
}
.mk-title { font-family: var(--display); font-weight: 700; font-size: 18px; margin-right: auto; min-width: 10ch; }
.mk-title span { display: block; font: 400 11.5px/1.3 var(--mono); color: var(--muted); }
.tool-good[aria-pressed="true"] { background: var(--pen-good) !important; color: #fff !important; }
.tool-bad[aria-pressed="true"] { background: var(--pen-bad) !important; color: #fff !important; }
.tool-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.mk-stage { overflow: auto; padding: 18px; -webkit-overflow-scrolling: touch; }
.mk-page { position: relative; margin-inline: auto; box-shadow: var(--shadow); border-radius: 8px; overflow: hidden; background: var(--card); }
.mk-page img { width: 100%; height: auto; user-select: none; -webkit-user-select: none; -webkit-user-drag: none; }
.mk-svg { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: auto; }
.markup[data-tool="good"] .mk-svg, .markup[data-tool="bad"] .mk-svg, .markup[data-tool="pin"] .mk-svg { touch-action: none; cursor: crosshair; }
.markup[data-tool="scroll"] .mk-svg { pointer-events: none; }
.pin {
  position: absolute; transform: translate(-50%, -100%); cursor: pointer; border: 0; padding: 0; background: none;
  filter: drop-shadow(0 2px 3px rgb(0 0 0 / .35));
}
.pin span {
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50% 50% 50% 4px; transform: rotate(-45deg);
  background: var(--ink); color: var(--card); border: 2px solid var(--card);
}
.pin span b { transform: rotate(45deg); font: 700 13px/1 var(--display); }
.pin.theirs span { background: var(--card); color: var(--ink); border-color: var(--ink); }
.pin.open span { background: var(--wattle); color: var(--wattle-ink); }
.mk-hint {
  position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 61;
  font: 500 12.5px/1.3 var(--mono); background: var(--ink); color: var(--card); padding: 9px 14px; border-radius: 999px;
  box-shadow: var(--shadow); max-width: calc(100vw - 32px); text-align: center; pointer-events: none;
}
.popover {
  position: fixed; z-index: 70; width: min(320px, calc(100vw - 24px));
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 12px; display: grid; gap: 10px;
}
.popover .who { font: 500 12px/1 var(--mono); color: var(--muted); display: flex; align-items: center; gap: 8px; }
.popover p { margin: 0; font-size: 15px; }
.popover textarea { min-height: 80px; }
.popover .row { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }

/* ---------- Modal ---------- */
.modal-back { position: fixed; inset: 0; z-index: 80; background: var(--scrim); display: grid; place-items: center; padding: 16px; }
.modal {
  width: min(520px, 100%); max-height: calc(100vh - 32px); overflow-y: auto;
  background: var(--card); border-radius: 16px; box-shadow: var(--shadow); padding: 24px; display: grid; gap: 16px;
}
.modal h2 { font-family: var(--display); font-weight: 800; font-size: 28px; line-height: 1.05; letter-spacing: -.02em; margin: 0; }
.modal p { margin: 0; color: var(--muted); }
.modal .row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.modal .people { display: flex; gap: 8px; flex-wrap: wrap; }
.field { display: grid; gap: 6px; }
.field span { font: 500 12px/1 var(--mono); color: var(--muted); }
.error { color: var(--avoid); font-size: 14px; margin: 0; }

/* ---------- Summary ---------- */
.summary { padding-block: 28px 64px; display: grid; gap: 28px; }
.summary-head { display: flex; flex-wrap: wrap; gap: 14px 20px; align-items: end; justify-content: space-between; }
.summary h2 { font-size: clamp(30px, 4vw, 48px); line-height: 1; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.stat b { display: block; font: 800 32px/1 var(--display); font-variant-numeric: tabular-nums; }
.stat span { font: 500 11.5px/1.2 var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.tally { display: grid; gap: 6px; max-width: 640px; }
.tally-row { display: grid; grid-template-columns: 150px minmax(0, 1fr) 36px; gap: 10px; align-items: center; font: 500 13px/1 var(--mono); }
.tally-row .track { height: 12px; background: var(--line); border-radius: 99px; overflow: hidden; }
.tally-row .track i { display: block; height: 100%; background: var(--gum); border-radius: 99px; }
.tally-row .n { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }
.summary h3 { font-size: 24px; display: flex; gap: 10px; align-items: baseline; }
.summary h3 .n { font: 500 13px/1 var(--mono); color: var(--muted); }
.sum-list { display: grid; gap: 12px; }
.sum-item {
  display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 16px; align-items: start;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px;
}
.sum-item .thumb { border-radius: 8px; border: 1px solid var(--line); }
.sum-item h4 { font-family: var(--display); font-size: 19px; margin: 0; }
.sum-item h4 a { color: inherit; text-decoration: none; }
.sum-item h4 a:hover { text-decoration: underline; }
.sum-body { display: grid; gap: 8px; min-width: 0; }
.sum-entry { display: grid; gap: 6px; padding-top: 8px; border-top: 1px dashed var(--line); }
.sum-entry:first-of-type { border-top: 0; padding-top: 0; }
.sum-entry .who { display: flex; align-items: center; gap: 8px; font: 500 12.5px/1 var(--mono); }
.sum-entry p { margin: 0; font-size: 15px; }
.sum-entry ol { margin: 0; padding-left: 20px; font-size: 14.5px; }
.compact-list { display: grid; gap: 6px; }
.compact-list li { font-size: 15px; }
.share { background: var(--gum-soft); border-radius: 12px; padding: 16px; display: grid; gap: 10px; }
.share code { font-family: var(--mono); font-size: 13px; word-break: break-all; background: var(--card); padding: 8px 10px; border-radius: 8px; display: block; }

.toast {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 90;
  background: var(--ink); color: var(--card); font: 500 13px/1.3 var(--mono); padding: 10px 16px; border-radius: 999px; box-shadow: var(--shadow);
}

/* ---------- Narrow ---------- */
@media (max-width: 1000px) {
  .site-layout { grid-template-columns: minmax(0, 1fr); }
  .panel { position: static; max-height: none; overflow: visible; }
  .intro { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .wrap { padding-inline: 16px; }
  .top { position: static; }
  .top .wrap { gap: 8px 10px; padding-block: 8px; }
  .brand b { font-size: 17px; }
  .brand span, .top .role-badge, .save-state:empty { display: none; }
  .top-right { gap: 8px; }
  .progress .long { display: none; }
  .progress .short { display: inline; }
  .me-chip { padding: 4px 10px 4px 4px; }
  body { font-size: 16px; }
  .screens { grid-template-columns: minmax(0, 1fr); }
  .phone-col { width: min(62%, 240px); justify-self: center; }
  .progress .bar { width: 60px; }
  .tabs button { padding: 8px 10px; }
  .sum-item { grid-template-columns: minmax(0, 1fr); }
  .tally-row { grid-template-columns: 110px minmax(0, 1fr) 30px; }
  .mk-stage { padding: 8px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
  .card h3 { font-size: 16px; }
}
@media (max-width: 760px) {
  .mk-bar { gap: 8px; padding-inline: 10px; }
  .mk-title { order: 0; flex: 1; font-size: 16px; }
  .mk-done { order: 1; }
  .mk-bar > .seg:not(.mk-tools) { order: 2; }
  .mk-small { order: 3; min-height: 34px; padding: 8px 12px; font-size: 12px; }
  .mk-tools {
    position: fixed; z-index: 62; left: 8px; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--card); box-shadow: var(--shadow); border-radius: 16px;
  }
  .mk-tools button { justify-content: center; flex-direction: column; gap: 4px; font-size: 11.5px; padding: 8px 4px; border-radius: 12px; min-height: 52px; }
  .mk-stage { padding-bottom: 96px; }
  .mk-hint { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); font-size: 11.5px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
