/* WashStop app stylesheet.

   Built from the mockups (design/ux/ux.css) and the brand tokens (design/brand/tokens.css). The
   tokens are COPIED below because the app is served on its own and cannot reach design/; when
   design/brand/build.py changes a colour, copy the :root blocks across. Light and dark follow the
   phone's setting.

   Bump the ?v= on styles.css in index.html (and CACHE_VERSION in sw.js) whenever this changes. */

/* ---- Brand tokens (copied from design/brand/tokens.css) ------------------------------------- */
:root {
  color-scheme: light dark;
  --primary: #2f55d4;
  --primary-strong: #2241ad;
  --on-primary: #ffffff;
  --accent: #0d97ac;
  --on-accent: #0b1730;
  --bg: #f4f7fd;
  --surface: #ffffff;
  --text: #17213b;
  --muted: #566283;
  --border: #d3dbee;
  --success: #17794c;
  --warning: #9a5700;
  --danger: #c2311f;
  /* DropStop's font stack (owner decision 1): the phone's own system font, no download. */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --radius: 16px;
  --radius-small: 10px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --primary: #8ba7ff;
    --primary-strong: #a9beff;
    --on-primary: #0b1730;
    --accent: #5fd9e8;
    --on-accent: #0b1730;
    --bg: #0d1528;
    --surface: #172238;
    --text: #e7ecf8;
    --muted: #9ba8c4;
    --border: #2d3a5a;
    --success: #5fd39a;
    --warning: #f5b84a;
    --danger: #ff8a7a;
  }
}

/* ---- Tokens added by the mockups (design/ux/README.md lists their contrast) ------------------- */
:root {
  --primary-soft: color-mix(in srgb, var(--primary) 12%, var(--surface));
  --accent-soft: color-mix(in srgb, var(--accent) 10%, var(--surface));
  --success-soft: color-mix(in srgb, var(--success) 12%, var(--surface));
  --warning-soft: color-mix(in srgb, var(--warning) 12%, var(--surface));
  --danger-soft: color-mix(in srgb, var(--danger) 10%, var(--surface));
  --scrim: rgba(11, 23, 48, 0.55);
  /* The water inside the porthole: two depths of the brand colour. */
  --water-back: color-mix(in srgb, var(--primary) 32%, var(--surface));
  --water-front: color-mix(in srgb, var(--primary) 58%, var(--surface));
  --focus: var(--primary);
}
@supports not (color: color-mix(in srgb, red 50%, blue)) {
  :root {
    --primary-soft: var(--surface); --accent-soft: var(--surface); --success-soft: var(--surface);
    --warning-soft: var(--surface); --danger-soft: var(--surface);
    --water-back: var(--border); --water-front: var(--primary);
  }
}

/* ---- Base ------------------------------------------------------------------------------------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; height: 100%; }
body {
  margin: 0; min-height: 100%;
  background: var(--bg); color: var(--text);
  font: 400 16px/1.5 var(--font-sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, p, ul, ol, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--primary); }
svg { display: block; }
[hidden] { display: none !important; }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--font-mono); font-variant-numeric: slashed-zero; font-feature-settings: "zero" 1; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); border: 0; white-space: nowrap; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.btn:focus-visible { outline-offset: 3px; }

/* ---- The shell: app bar, one view, the action zone, tabs -------------------------------------- */
.app {
  position: fixed; inset: 0;
  display: flex; flex-direction: column;
  max-width: 560px; margin: 0 auto;
  padding-top: env(safe-area-inset-top);
}
.appbar { flex: none; display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 6px 16px; }
.appbar .word { font: 700 20px/1 var(--font-display); letter-spacing: -0.01em; }
.appbar .word span, .splash .word span { color: var(--primary); }
.appbar h1 { font: 700 22px/1.2 var(--font-display); }
.appbar .spacer { flex: 1; }
.appbar .back, .appbar .link {
  display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 0 8px 0 2px; margin-left: -6px;
  border: 0; background: none; color: var(--primary); font-weight: 600; text-decoration: none;
}
.appbar .link { margin-left: 0; padding: 0 4px; gap: 6px; }
.appbar .me { border: 0; padding: 0; background: none; border-radius: 50%; }
.logo { flex: none; width: 30px; height: 30px; border-radius: 7px; }
.ico { flex: none; width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ico.sm { width: 18px; height: 18px; }
.ico.lg { width: 44px; height: 44px; stroke-width: 1.6; }
.ico .f { fill: currentColor; stroke: none; }

.body { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 12px; padding: 4px 16px 16px; overflow-y: auto; overscroll-behavior: contain; }
.body.center { align-items: center; text-align: center; }
.body.fixed { overflow: hidden; } /* Home never scrolls */
.body > * { flex: none; }
.push { margin-top: auto; }
.start { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.start .hint { text-align: center; }
.action { flex: none; display: flex; flex-direction: column; gap: 10px; padding: 4px 16px 14px; }
.action:empty { display: none; }
.action .hint { text-align: center; }

.tabs { flex: none; display: flex; border-top: 1px solid var(--border); background: var(--surface); padding-bottom: env(safe-area-inset-bottom); }
.tabs .tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 60px; border: 0; background: none; color: var(--muted); font-size: 12px; font-weight: 600; text-decoration: none;
}
.tabs .tab[aria-current] { color: var(--primary); }
.app.bare .tabs, .app.bare .appbar { display: none; }
.app.bare { padding-bottom: env(safe-area-inset-bottom); }

/* ---- Pieces ----------------------------------------------------------------------------------- */
.hint { font-size: 14px; line-height: 1.4; color: var(--muted); }
.title { font: 700 27px/1.2 var(--font-display); letter-spacing: -0.01em; overflow-wrap: anywhere; }
.sub { color: var(--muted); }
.sub b, .hint b { color: var(--text); font-weight: 600; }
.sub .late { color: var(--warning); font-weight: 600; }
.section { margin-top: 8px; font-size: 13px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.lede { margin-top: -6px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 10px 18px;
  border: 1.5px solid var(--muted); border-radius: var(--radius-small);
  background: var(--surface); color: var(--text); font-weight: 600; line-height: 1.25; text-align: center; text-decoration: none;
}
.btn.block { display: flex; width: 100%; }
.btn.primary { border-color: var(--primary); background: var(--primary); color: var(--on-primary); }
.btn.primary:active { border-color: var(--primary-strong); background: var(--primary-strong); }
.btn.big { min-height: 68px; border-radius: var(--radius); font: 700 20px/1.2 var(--font-display); }
.btn.danger { border-color: var(--danger); color: var(--danger); }
.btn.quiet { min-height: 44px; border-color: transparent; background: none; color: var(--primary); }
.btn.quiet.danger { color: var(--danger); }
.btn.small { min-height: 36px; padding: 4px 12px; font-size: 14px; }
.btn[disabled], .btn[aria-busy="true"] { opacity: 0.6; cursor: default; }
.btn .ico { margin-left: -2px; }

.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border); color: var(--muted);
  font-size: 13px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
}
.pill.run { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.pill.done { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.pill.ok { background: var(--success-soft); border-color: var(--success); color: var(--success); }
.pill.warn { background: var(--warning-soft); border-color: var(--warning); color: var(--warning); }
.pill.bad { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }

.av {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--surface); border: 1.5px solid var(--muted); color: var(--text);
  font: 700 15px/1 var(--font-display);
}
.av.me { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.av.none { border-style: dashed; color: var(--muted); }
.av.sm { width: 28px; height: 28px; font-size: 13px; }
.av.duo { position: relative; }
.av-pair { display: inline-flex; flex: none; }
.av-pair .av + .av { margin-left: -12px; box-shadow: 0 0 0 2px var(--surface); }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.card.flush { padding: 0; }
.card h3 { font: 700 16px/1.3 var(--font-display); }
.card > .hint { margin-top: 4px; }
.row { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 10px 16px; text-align: left; color: inherit; text-decoration: none; }
.row + .row { border-top: 1px solid var(--border); }
.row .grow { flex: 1; min-width: 0; }
.row .l1 { display: block; font-weight: 600; }
.row .l2 { display: block; font-size: 14px; line-height: 1.35; color: var(--muted); overflow-wrap: anywhere; }
.row .chev { color: var(--muted); }
.row .ico.lead { color: var(--primary); }
button.row { width: 100%; border: 0; background: none; }
.tag {
  display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; vertical-align: 1px;
  background: var(--accent-soft); border: 1px solid var(--accent); color: var(--text); font-size: 12px; font-weight: 600;
}
.ok-text { color: var(--success); font-weight: 600; }
.warn-text { color: var(--warning); font-weight: 600; }
.danger-text { color: var(--danger); font-weight: 600; }

.banner { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); text-align: left; }
.banner .ico { margin-top: 1px; }
.banner .grow { flex: 1; min-width: 0; }
.banner.warn { border-color: var(--warning); background: var(--warning-soft); }
.banner.warn > .ico, .banner.warn b { color: var(--warning); }
.banner.bad { border-color: var(--danger); background: var(--danger-soft); }
.banner.bad > .ico, .banner.bad b { color: var(--danger); }
.banner.good { border-color: var(--success); background: var(--success-soft); }
.banner.good > .ico, .banner.good b { color: var(--success); }
.banner.info { border-color: var(--primary); background: var(--primary-soft); }
.banner.info > .ico, .banner.info b { color: var(--primary); }
.banner p { font-size: 15px; line-height: 1.4; }
.banner b { display: block; }
.banner .btn { margin-top: 10px; }

/* A one-line nudge under the app bar ("Notifications are off on this phone"). */
.nudge { display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 12px; border-radius: var(--radius-small); border: 1px solid var(--warning); background: var(--warning-soft); font-size: 14px; line-height: 1.3; text-align: left; }
.nudge > .ico { color: var(--warning); width: 20px; height: 20px; }
.nudge .grow { flex: 1; min-width: 0; }
.nudge .btn { flex: none; min-height: 36px; }

.note { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--radius); background: var(--primary-soft); border: 1px solid var(--primary); text-align: left; line-height: 1.35; }
.note .ico { color: var(--primary); }

/* ---- Home: the porthole ------------------------------------------------------------------------ */
.hero { display: flex; flex-direction: column; align-items: center; gap: 10px; padding-top: 6px; text-align: center; }
.hero .sub { max-width: 340px; }
.drum { --d: clamp(132px, 27vh, 204px); position: relative; flex: none; width: var(--d); height: var(--d); margin-bottom: 2px; }
.drum > svg { width: 100%; height: 100%; overflow: visible; }
.drum .ring { fill: none; stroke: var(--primary); stroke-width: 12; }
.drum .disc { fill: var(--surface); }
.drum .tick { fill: none; stroke: var(--success); stroke-width: 13; stroke-linecap: round; stroke-linejoin: round; }
.drum .txt { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0 14%; text-align: center; }
.drum .big { font: 700 calc(var(--d) * 0.2)/1.1 var(--font-display); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; white-space: nowrap; }
.drum .big.long { font-size: calc(var(--d) * 0.13); }
.drum .small { font-size: 14px; font-weight: 600; color: var(--muted); }
.drum.idle .ring { stroke: var(--border); }
.drum.idle .big { color: var(--muted); }
.drum.next .ring { stroke-dasharray: 14 12; }
.drum.next .disc, .drum.run .disc { fill: var(--primary-soft); }
.drum.solid .disc { fill: var(--primary); }
.drum.solid .txt, .drum.solid .small { color: var(--on-primary); }
.drum.late .ring { stroke: var(--warning); }
.drum.late.solid .disc { fill: var(--warning); }
.drum.late.solid .txt, .drum.late.solid .small { color: var(--surface); }
.drum.final .ring { stroke: var(--danger); }
.drum.final.solid .disc { fill: var(--danger); }
.drum.final.solid .txt, .drum.final.solid .small { color: var(--surface); }
.drum.gone .ring { stroke: var(--success); }
.drum.gone .disc { fill: var(--success-soft); }
.drum.off .ring { stroke: var(--muted); stroke-width: 7; stroke-dasharray: 0.1 15.6; stroke-linecap: round; }
.drum.off .txt { color: var(--muted); }
.drum .glyph { color: var(--primary); }
.drum.idle .glyph { color: var(--muted); }

/* The water. Two wave bands slide sideways at different speeds inside the porthole, the whole body
   of water rocks gently, and a few bubbles rise. Transforms and opacity only: no script, no canvas,
   nothing running while the page is hidden (.paused) or when the phone asks for less motion. */
.drum .water-back { fill: var(--water-back); }
.drum .water-front { fill: var(--water-front); }
.drum .bubble { fill: var(--surface); opacity: 0; }
/* The drum's perforations, turning slowly behind the water. */
.drum .holes { fill: none; stroke: var(--primary); stroke-opacity: 0.18; stroke-width: 5; stroke-linecap: round; stroke-dasharray: 0.1 13.7; }
.drum.small { --d: 120px; }
.drum.run .txt { color: var(--text); }
.drum.run .txt .big, .drum.run .txt .small { text-shadow: 0 0 6px var(--primary-soft), 0 0 2px var(--primary-soft); }
@media (prefers-reduced-motion: no-preference) {
  .drum.run .holes { animation: turn 7s linear infinite; transform-origin: 100px 100px; transform-box: view-box; }
  .drum.run .slosh { animation: slosh 4.2s ease-in-out infinite alternate; transform-origin: 100px 100px; transform-box: view-box; }
  .drum.run .wave { animation: wave 5.5s linear infinite; }
  .drum.run .wave.front { animation-duration: 3.6s; animation-direction: reverse; }
  .drum.run .bubble { animation: rise 3.4s ease-in infinite; }
  .drum.run .bubble.b2 { animation-delay: 1.1s; animation-duration: 2.9s; }
  .drum.run .bubble.b3 { animation-delay: 2.2s; animation-duration: 3.8s; }
  .drum.run .bubble.b4 { animation-delay: 0.6s; animation-duration: 3.1s; }
  .drum.next .ring { animation: wait-spin 14s linear infinite; transform-origin: 100px 100px; transform-box: view-box; }
}
@media (prefers-reduced-motion: reduce) {
  .drum.run .bubble { opacity: 0.5; }
}
.paused .drum *, .paused .drum { animation-play-state: paused !important; }
@keyframes slosh { from { transform: rotate(-6deg); } to { transform: rotate(6deg); } }
@keyframes wave { from { transform: translateX(0); } to { transform: translateX(-80px); } }
@keyframes rise {
  0% { transform: translateY(0); opacity: 0; }
  15% { opacity: 0.7; }
  80% { opacity: 0.5; }
  100% { transform: translateY(-46px); opacity: 0; }
}
@keyframes wait-spin { to { transform: rotate(360deg); } }
@keyframes turn { to { transform: rotate(360deg); } }

.mini { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); text-align: left; color: inherit; text-decoration: none; }
.mini .grow { flex: 1; min-width: 0; }
.mini .l1 { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini .l2 { display: block; font-size: 14px; line-height: 1.35; color: var(--muted); }
.mini .count { flex: none; min-width: 36px; text-align: center; font: 700 32px/1 var(--font-display); color: var(--accent); font-variant-numeric: tabular-nums; }
.mini .chev { color: var(--muted); }
.minis { display: flex; flex-direction: column; gap: 8px; }

/* Short phones: the Home screen must still fit without scrolling. */
@media (max-height: 700px) {
  .title { font-size: 24px; }
  .hero { gap: 8px; }
  .btn.big { min-height: 60px; }
  .tabs .tab { min-height: 54px; }
}
@media (max-height: 620px) {
  .minis .mini:nth-child(2) { display: none; }
  .hero .sub { font-size: 15px; line-height: 1.4; }
}

/* ---- Sheets (confirmations) and the toast ------------------------------------------------------ */
.scrim { position: fixed; inset: 0; z-index: 10; display: flex; align-items: flex-end; justify-content: center; background: var(--scrim); }
.sheet {
  width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 12px;
  padding: 12px 16px calc(24px + env(safe-area-inset-bottom)); border-radius: 24px 24px 0 0; background: var(--surface);
}
.sheet::before { content: ""; align-self: center; width: 40px; height: 4px; margin-bottom: 6px; border-radius: 2px; background: var(--border); }
.sheet h2 { font: 700 23px/1.25 var(--font-display); }
.sheet ol { display: flex; flex-direction: column; gap: 8px; padding-left: 0; }
.toast {
  position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 20; transform: translateX(-50%);
  width: max-content; max-width: calc(100% - 32px); padding: 12px 16px; border-radius: var(--radius-small);
  background: var(--text); color: var(--bg); font-size: 15px; line-height: 1.35; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
}

/* ---- Sign-in and first run --------------------------------------------------------------------- */
.splash { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; padding: 16px 0; }
.splash .logo { width: 104px; height: 104px; border-radius: 22px; }
.splash .word { font: 700 38px/1.1 var(--font-display); letter-spacing: -0.02em; }
.splash .tagline { max-width: 290px; font-size: 18px; color: var(--muted); }
.gmark { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: #ffffff; }
.gmark svg { width: 18px; height: 18px; }
.steps-dots { flex: none; display: flex; justify-content: center; gap: 8px; padding: 14px 0 4px; }
.steps-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--border); }
.steps-dots i.on { width: 24px; border-radius: 4px; background: var(--primary); }
.badge { display: flex; align-items: center; justify-content: center; width: 96px; height: 96px; margin: 12px auto 4px; border-radius: 50%; background: var(--primary-soft); border: 1px solid var(--primary); color: var(--primary); }
.badge.warn { background: var(--warning-soft); border-color: var(--warning); color: var(--warning); }
.howto { display: flex; flex-direction: column; width: 100%; text-align: left; }
.howto li { display: flex; align-items: center; gap: 12px; padding: 12px 16px; line-height: 1.4; }
.howto li + li { border-top: 1px solid var(--border); }
.howto .n { flex: none; display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: var(--primary); color: var(--on-primary); font-weight: 700; font-size: 14px; }
.howto .ico { display: inline-block; vertical-align: -5px; color: var(--primary); }
.howto b { font-weight: 600; }
.wide { width: 100%; }

/* ---- Forms ------------------------------------------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: 6px; text-align: left; }
.field .lbl { font-size: 14px; font-weight: 600; }
.input {
  width: 100%; min-height: 48px; padding: 8px 14px;
  border: 1.5px solid var(--muted); border-radius: var(--radius-small); background: var(--surface); color: var(--text);
}
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
input[type="time"].input { min-width: 0; padding: 8px 10px; font: 700 18px/1 var(--font-display); font-variant-numeric: tabular-nums; }
select.input { appearance: auto; }
.pair { display: flex; gap: 12px; }
.pair > * { flex: 1; min-width: 0; }

.choice { display: flex; align-items: flex-start; gap: 12px; width: 100%; padding: 14px 16px; border: 1.5px solid var(--border); border-radius: var(--radius); background: var(--surface); text-align: left; }
.choice .radio { flex: none; width: 22px; height: 22px; margin-top: 1px; border: 2px solid var(--muted); border-radius: 50%; }
.choice[aria-checked="true"] { border-color: var(--primary); background: var(--primary-soft); }
.choice[aria-checked="true"] .radio { border: 7px solid var(--primary); background: var(--on-primary); }
.choice .grow { flex: 1; min-width: 0; }
.choice .l1 { display: block; font-weight: 600; }
.choice .l2 { display: block; font-size: 14px; line-height: 1.35; color: var(--muted); }
.choices { display: flex; flex-direction: column; gap: 8px; }

.switch { flex: none; position: relative; width: 52px; height: 32px; padding: 0; border-radius: 16px; background: var(--surface); border: 1.5px solid var(--muted); }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 23px; height: 23px; border-radius: 50%; background: var(--muted); transition: left 0.15s; }
.switch[aria-checked="true"] { background: var(--primary); border-color: var(--primary); }
.switch[aria-checked="true"]::after { left: 23px; background: var(--on-primary); }

.seg { display: flex; gap: 4px; padding: 4px; border-radius: var(--radius-small); background: var(--surface); border: 1px solid var(--border); }
.seg button { flex: 1; min-width: 0; min-height: 40px; padding: 0 4px; border: 0; border-radius: 7px; background: none; color: var(--muted); font-weight: 600; }
.seg button[aria-pressed="true"] { background: var(--primary); color: var(--on-primary); }

/* ---- Loads tab: counter, chart, tally ---------------------------------------------------------- */
.counter { display: flex; align-items: flex-end; gap: 12px; padding: 2px 4px; }
.counter .n { font: 700 76px/0.95 var(--font-display); letter-spacing: -0.03em; color: var(--accent); font-variant-numeric: tabular-nums; }
.counter .what { min-width: 0; padding-bottom: 6px; }
.counter .what b { display: block; font: 700 20px/1.2 var(--font-display); }
.counter .what .e { display: flex; align-items: center; gap: 4px; margin-top: 2px; color: var(--muted); font-size: 15px; flex-wrap: wrap; }
.counter .what .e b { display: inline; color: var(--text); font: inherit; font-weight: 700; font-variant-numeric: tabular-nums; }
.counter .what .e .ico { color: var(--accent); }
.periodnav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: -4px -8px 0; }
.periodnav .btn { min-height: 40px; padding: 0 8px; }
.periodnav .btn[disabled] { visibility: hidden; }

.chart .plot { display: flex; align-items: flex-end; height: 100px; margin-top: 10px; border-bottom: 1px solid var(--border); }
.chart .col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; min-width: 0; }
.chart .col i { display: block; flex: none; width: 24px; max-width: 70%; border-radius: 4px 4px 0 0; background: var(--primary); }
.chart .col .v { font-size: 13px; font-weight: 600; line-height: 1.3; font-variant-numeric: tabular-nums; white-space: nowrap; }
.chart .axis { display: flex; margin-top: 4px; }
.chart .axis span { flex: 1; min-width: 0; text-align: center; font-size: 12px; color: var(--muted); white-space: nowrap; }
.chart .axis span.now { color: var(--text); font-weight: 700; }
.chart.dense .col i { width: 6px; max-width: none; border-radius: 3px 3px 0 0; }
.chart.dense .axis span { overflow: visible; }
.chart.mid .col i { width: 14px; }

.tally { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.tally li { display: flex; align-items: center; gap: 10px; }
.tally .nm { flex: none; width: 76px; font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tally .track { flex: 1; height: 12px; }
.tally .track i { display: block; height: 100%; min-width: 4px; border-radius: 0 4px 4px 0; background: var(--accent); }
.tally li.nobody .track i { background: var(--muted); }
.tally li.nobody .nm { color: var(--muted); font-weight: 400; }
.tally .ct { flex: none; width: 34px; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.champ { display: flex; align-items: center; gap: 8px; }
.champ .ico { color: var(--accent); }
.funfact { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); font-size: 14px; line-height: 1.35; color: var(--muted); }
.funfact b { color: var(--text); }
.funfact + .funfact { margin-top: 6px; padding-top: 0; border-top: 0; }

/* History */
.day { margin-top: 6px; font-size: 13px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.load { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 14px; border: 0; background: none; text-align: left; color: inherit; text-decoration: none; }
.load + .load { border-top: 1px solid var(--border); }
.load .grow { flex: 1; min-width: 0; }
.load .l1 { display: flex; justify-content: space-between; gap: 8px; font-weight: 600; }
.load .l1 .t { flex: none; color: var(--muted); font-weight: 400; font-size: 14px; font-variant-numeric: tabular-nums; }
.load .l2 { display: block; font-size: 14px; line-height: 1.35; color: var(--muted); }
.load .chev { color: var(--muted); }

.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fact { padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius-small); background: var(--surface); text-align: left; min-width: 0; }
.fact span { display: block; font-size: 13px; color: var(--muted); }
.fact b { display: block; font: 700 19px/1.3 var(--font-display); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.timeline { display: flex; flex-direction: column; margin-top: 10px; }
.timeline li { position: relative; display: flex; gap: 12px; padding: 0 0 12px 22px; font-size: 15px; line-height: 1.4; }
.timeline li::before { content: ""; position: absolute; left: 0; top: 5px; width: 11px; height: 11px; border-radius: 50%; background: var(--surface); border: 2px solid var(--primary); }
.timeline li::after { content: ""; position: absolute; left: 4.5px; top: 20px; bottom: 0; width: 2px; background: var(--border); }
.timeline li:last-child { padding-bottom: 0; }
.timeline li:last-child::after { display: none; }
.timeline li.end::before { background: var(--success); border-color: var(--success); }
.timeline li.bad::before { background: var(--warning); border-color: var(--warning); }
.timeline .t { flex: none; min-width: 66px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.timeline .q { color: var(--muted); }

/* People: the invite link */
.linkbox { display: block; width: 100%; padding: 10px 12px; border-radius: var(--radius-small); border: 1px dashed var(--muted); background: var(--bg); font-size: 14px; overflow-wrap: anywhere; text-align: left; }
.btnrow { display: flex; gap: 8px; flex-wrap: wrap; }
.btnrow .btn { flex: 1 1 auto; min-width: 0; white-space: nowrap; }

.loading { padding: 40px 0; text-align: center; color: var(--muted); }
.foot { text-align: center; font-size: 12px; color: var(--muted); }
