/* Poo at Work — base styles. Phone first; wider screens get more breathing room. */

:root {
  --bg: #FFF8EE;
  --surface: #FFFFFF;
  --surface-2: #F6EBDC;
  --text: #2A1E14;
  --text-muted: #6E5A48;
  --brand: #7A4B24;
  --money: #15803D;
  --accent: #2F6FDB;
  --border: #EADBC6;
  --danger: #B42318;
  --warn-bg: #FFF4D6;
  --warn-border: #F2C94C;
  --on-brand: #FFFFFF;
  --on-money: #FFFFFF;
  --shadow: 0 6px 24px rgba(74, 45, 20, 0.10);
  /* Map: one hue (brand brown), light -> dark = few -> many. Gray = no data. */
  --map-none: #E6E2DD;
  --seq-0: #F3E3CC;
  --seq-1: #E2BE8F;
  --seq-2: #C98F55;
  --seq-3: #9C6232;
  --seq-4: #6B3F1C;
  --grid: #EFE4D5;
  --radius: 20px;
  --gutter: 16px;
  --max-width: 560px;
  --font: ui-rounded, "SF Pro Rounded", "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-num: ui-rounded, "SF Pro Rounded", "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #17120E;
    --surface: #231B15;
    --surface-2: #2E241C;
    --text: #F5EBDD;
    --text-muted: #BFA88F;
    --brand: #D9A066;
    --money: #4ADE80;
    --accent: #7FA8F5;
    --border: #3A2E24;
    --danger: #FF8A80;
    --warn-bg: #3A2F12;
    --warn-border: #8A6D1E;
    --on-brand: #1A120B;
    --on-money: #0B2414;
    --shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
    --map-none: #45413D;
    --seq-0: #5C4128;
    --seq-1: #845A32;
    --seq-2: #AE7A48;
    --seq-3: #D6A266;
    --seq-4: #F2CB94;
    --grid: #33291F;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #17120E;
  --surface: #231B15;
  --surface-2: #2E241C;
  --text: #F5EBDD;
  --text-muted: #BFA88F;
  --brand: #D9A066;
  --money: #4ADE80;
  --accent: #7FA8F5;
  --border: #3A2E24;
  --danger: #FF8A80;
  --warn-bg: #3A2F12;
  --warn-border: #8A6D1E;
  --on-brand: #1A120B;
  --on-money: #0B2414;
  --shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
  --map-none: #45413D;
  --seq-0: #5C4128;
  --seq-1: #845A32;
  --seq-2: #AE7A48;
  --seq-3: #D6A266;
  --seq-4: #F2CB94;
  --grid: #33291F;
  color-scheme: dark;
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.5;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }

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

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  padding: 8px 14px;
  background: var(--surface);
  color: var(--text);
  border-radius: 10px;
  z-index: 10;
}
.skip-link:focus { top: 12px; }

/* Header */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: max(12px, env(safe-area-inset-top)) var(--gutter) 12px;
  max-width: var(--max-width);
  width: 100%;
  margin: 0 auto;
}
.header-controls { display: flex; align-items: center; gap: 4px; flex: none; }

.mode-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
}
.mode-switch:hover { background: var(--surface-2); }
.switch-track {
  position: relative;
  width: 40px;
  height: 24px;
  border-radius: 999px;
  background: var(--border);
  transition: background .2s;
  flex: none;
}
.switch-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
  transition: transform .2s;
}
.mode-switch[aria-checked="true"] .switch-track { background: var(--brand); }
.mode-switch[aria-checked="true"] .switch-knob { transform: translateX(16px); }
.sound-btn { font-size: 1.25rem; }

.brand-name { white-space: nowrap; }
.brand { min-width: 0; }

@media (max-width: 420px) {
  .brand { gap: 6px; }
  .brand-mark { width: 32px; height: 32px; }
  .brand-name { font-size: 1.0625rem; }
  .mode-switch { padding: 6px; gap: 6px; font-size: 0.8125rem; }
  .switch-track { width: 34px; height: 20px; }
  .switch-knob { width: 14px; height: 14px; }
  .mode-switch[aria-checked="true"] .switch-knob { transform: translateX(14px); }
  .sound-btn { width: 36px; height: 36px; }
}

@media (max-width: 340px) {
  .switch-text { display: none; }
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}
.brand-mark { width: 40px; height: 40px; }
.brand-name {
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
  color: var(--brand);
}

/* Main column */
.container {
  flex: 1;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gutter) 32px;
}

/* Hero */
.hero {
  text-align: center;
  padding: 8px 0 24px;
}
.hero-mascot {
  width: 140px;
  height: 140px;
  margin: 0 auto 4px;
  animation: bob 3.2s ease-in-out infinite;
}
.hero-title {
  margin: 0;
  font-size: clamp(2rem, 9vw, 2.75rem);
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.hero-sub {
  margin: 8px 0 0;
  color: var(--text-muted);
}

.hero-art { position: relative; width: 140px; margin: 0 auto; }
.stink {
  position: absolute;
  left: 50%;
  top: -34px;
  width: 110px;
  transform: translateX(-50%);
  overflow: visible;
  fill: none;
  stroke: var(--text-muted);
  stroke-width: 4;
  stroke-linecap: round;
  opacity: 0;
  transition: opacity .3s;
}
[data-mode="unfiltered"] .stink { opacity: .6; animation: waft 2.4s ease-in-out infinite; }
[data-mode="unfiltered"] .hero { padding-top: 30px; }

@keyframes waft {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, -6px); }
}

/* Result + share */
.btn-share { margin-top: 14px; width: 100%; max-width: 360px; }
.btn-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.share-dialog {
  width: min(440px, calc(100vw - 2 * var(--gutter)));
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
  overflow: auto;
}
.share-dialog::backdrop { background: rgba(20, 12, 6, .6); }
.share-inner { padding: 18px; text-align: center; }
.share-title { margin: 0 0 12px; font-size: 1.25rem; font-weight: 800; }
.share-img {
  width: 100%;
  max-height: 55dvh;
  object-fit: contain;
  border-radius: 14px;
  background: var(--surface-2);
  -webkit-touch-callout: default;
}
.share-hold { margin: 10px 0 14px; font-size: 0.875rem; color: var(--text-muted); }
.share-error { margin: 10px 0; color: var(--danger); font-weight: 600; }

@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-6px) rotate(2deg); }
}

@media (prefers-reduced-motion: reduce) {
  .hero-mascot,
  [data-mode="unfiltered"] .stink { animation: none; }
}

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px 20px;
  text-align: center;
}
.card-label {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}
.money-display {
  margin: 4px 0 0;
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  font-size: clamp(2.75rem, 14vw, 4rem);
  line-height: 1.05;
  color: var(--money);
  overflow-wrap: anywhere;
}
.time-display {
  margin: 4px 0 0;
  font-variant-numeric: tabular-nums;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-muted);
}
.card-note {
  margin: 16px 0 0;
  padding: 10px 12px;
  background: var(--surface-2);
  border-radius: 12px;
  font-size: 0.9375rem;
  color: var(--text-muted);
}

.card + .card,
.card + .tabs,
.tabs + .card { margin-top: 16px; }

[hidden] { display: none !important; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* Form fields */
.pay-card { text-align: left; }

.field-label {
  display: block;
  font-weight: 700;
  margin-bottom: 8px;
}

.money-input {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 16px;
  background: var(--surface-2);
  border: 2px solid transparent;
  border-radius: 14px;
  transition: border-color .15s;
}
.money-input:focus-within { border-color: var(--accent); }
.money-input[data-invalid] { border-color: var(--danger); }
.money-input-prefix {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-muted);
}
.money-input input {
  flex: 1;
  min-width: 0;
  padding: 14px 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 1.5rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.money-input input:focus { outline: none; }
.money-input input:disabled { opacity: .6; }
.money-input input::placeholder { color: var(--text-muted); opacity: .6; font-weight: 500; }

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin: 12px 0 0;
  padding: 4px;
  border: 0;
  background: var(--surface-2);
  border-radius: 14px;
}
.segmented label { position: relative; }
.segmented input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}
.segmented span {
  display: block;
  padding: 10px 8px;
  text-align: center;
  font-weight: 700;
  border-radius: 10px;
  color: var(--text-muted);
  transition: background .15s, color .15s;
}
.segmented input:checked + span {
  background: var(--brand);
  color: var(--on-brand);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .12);
}
.segmented input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.segmented input:disabled { cursor: not-allowed; }
.segmented input:disabled + span { opacity: .6; }

.field-hint {
  margin: 10px 0 0;
  font-size: 0.9375rem;
  color: var(--text-muted);
}
.field-hint[data-error] { color: var(--danger); font-weight: 600; }

/* Tabs */
.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.tabs button {
  padding: 12px;
  border: 2px solid var(--border);
  border-radius: 14px;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.tabs button[aria-selected="true"] {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--on-brand);
}

/* Timer */
.rate-line {
  min-height: 1.5em;
  margin: 6px 0 0;
  font-size: 0.9375rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.timer-hint {
  margin: 12px 0 0;
  color: var(--text-muted);
}

.check-in {
  margin: 16px 0 0;
  padding: 16px;
  background: var(--warn-bg);
  border: 2px solid var(--warn-border);
  border-radius: 16px;
}
.check-in-title { margin: 0; font-weight: 800; font-size: 1.125rem; }
.check-in-body { margin: 4px 0 12px; color: var(--text-muted); }

.result { margin: 16px 0 0; }
.result-title { margin: 0; font-size: 1.25rem; font-weight: 800; }
.result-sub { margin: 4px 0 0; color: var(--text-muted); }

.button-row {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}
.main-actions { margin-top: 20px; }

.btn {
  flex: 1 1 0;
  min-height: 48px;
  padding: 12px 18px;
  border: 0;
  border-radius: 14px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: transform .08s, filter .15s;
}
.btn:active { transform: scale(.97); }
.btn:hover { filter: brightness(1.05); }
.btn-big { min-height: 60px; font-size: 1.25rem; max-width: 360px; }
.btn-primary { background: var(--money); color: var(--on-money); }
.btn-secondary { background: var(--surface-2); color: var(--text); }
.btn-flush { background: var(--accent); color: #fff; }

/* Calculator */
.panel[data-calc] { text-align: center; }
.panel[data-calc] .field-label { text-align: center; }

.stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.stepper input {
  width: 6ch;
  padding: 10px 4px;
  border: 2px solid transparent;
  border-radius: 14px;
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: 2rem;
  font-weight: 800;
  text-align: center;
  font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
  appearance: textfield;
}
.stepper input::-webkit-outer-spin-button,
.stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper input:focus { outline: none; border-color: var(--accent); }
.stepper-btn {
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text);
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}
.stepper-btn:active { transform: scale(.94); }
.stepper-unit { margin: 6px 0 12px; color: var(--text-muted); }
.calc-sentence { margin: 6px 0 0; color: var(--text-muted); }

/* Fun units */
.units { text-align: left; }
.units-title {
  margin: 0 0 12px;
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}
.units-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.units-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--surface-2);
  border-radius: 12px;
  font-weight: 600;
}
.units-emoji { font-size: 1.5rem; line-height: 1; flex: none; }
.units-note {
  margin: 12px 0 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

#main:focus, .history-title:focus { outline: none; }

.calc-hint:empty { display: none; }
.calc-hint {
  margin: 8px 0 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Calculator logging */
.calc-logged {
  min-height: 1.5em;
  margin: 8px 0 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--money);
}

/* Ad slot: fixed height so a real ad later never shifts the page */
.ad-slot {
  margin-top: 16px;
  min-height: 100px;
  padding: 10px 14px 14px;
  border: 1px dashed var(--border);
  border-radius: 16px;
  text-align: left;
}
.ad-label {
  margin: 0 0 6px;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}
.ad-house { display: flex; align-items: center; gap: 12px; }
.ad-emoji { font-size: 2rem; line-height: 1; }
.ad-title { margin: 0; font-weight: 800; }
.ad-body { margin: 2px 0 0; font-size: 0.875rem; color: var(--text-muted); }
.ad-cta { display: inline-block; margin-top: 4px; font-size: 0.875rem; font-weight: 700; color: var(--brand); }

/* Section titles shared by projection and stats */
.section-title {
  margin: 0 0 8px;
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

/* Projection */
.projection { text-align: center; }
.proj-basis { margin: 4px 0 0; font-size: 0.9375rem; color: var(--text-muted); }
.proj-fun {
  margin: 14px 0 0;
  padding: 12px;
  background: var(--surface-2);
  border-radius: 12px;
  font-weight: 600;
}
.inline-stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 14px;
  font-weight: 600;
}
.inline-stepper-controls { display: flex; align-items: center; gap: 10px; }
.inline-stepper output {
  min-width: 2ch;
  font-size: 1.375rem;
  font-weight: 800;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.stepper-btn.small { width: 40px; height: 40px; font-size: 1.375rem; }

/* Stats */
.stats { text-align: left; }
.stats .section-title { text-align: center; }
.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 8px 0 0;
}
.stat-grid > div {
  padding: 12px;
  background: var(--surface-2);
  border-radius: 12px;
  min-width: 0;
}
.stat-grid dt { font-size: 0.8125rem; color: var(--text-muted); font-weight: 600; }
.stat-grid dd {
  margin: 2px 0 0;
  font-size: 1.25rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.stat-grid dd[data-stat="total"],
.stat-grid dd[data-stat="best"] { color: var(--money); }

.history-title {
  margin: 20px 0 8px;
  font-size: 1rem;
  font-weight: 800;
}
.history {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.history li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 8px 8px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  min-height: 52px;
}
.history-main { flex: 1; min-width: 0; }
.history-when { display: block; font-size: 0.8125rem; color: var(--text-muted); }
.history-what { display: block; font-weight: 700; font-variant-numeric: tabular-nums; }
.history-what .money { color: var(--money); }
.history-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  font-size: 0.6875rem;
  font-weight: 700;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-muted);
  vertical-align: 1px;
}
.icon-btn {
  flex: none;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.05rem;
  cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.history-edit {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.history-edit input {
  width: 4.5ch;
  padding: 6px 4px;
  border: 2px solid var(--accent);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-weight: 700;
  text-align: center;
}
.btn-small { flex: none; min-height: 36px; padding: 6px 12px; font-size: 0.875rem; border-radius: 10px; }
.history-more { margin: 8px 0 0; font-size: 0.875rem; color: var(--text-muted); }

/* Privacy row */
.privacy-row { text-align: center; }
.link-btn {
  margin-top: 6px;
  padding: 6px 8px;
  border: 0;
  background: none;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.875rem;
  text-decoration: underline;
  cursor: pointer;
}
.link-btn:hover { color: var(--danger); }

.privacy-note {
  margin: 20px 0 0;
  text-align: center;
  font-size: 0.9375rem;
  color: var(--text-muted);
}

/* Text pages (privacy) */
.prose { line-height: 1.65; }
.prose h1 { font-size: 2rem; margin: 8px 0 4px; letter-spacing: -0.01em; }
.prose h2 { font-size: 1.125rem; margin: 28px 0 6px; }
.prose p, .prose ul { margin: 0 0 12px; }
.prose ul { padding-left: 1.25em; }
.prose-lead { font-size: 1.125rem; color: var(--text-muted); }
.prose-updated { margin-top: 28px !important; font-size: 0.875rem; color: var(--text-muted); }
.prose .btn-link { max-width: 260px; margin-top: 8px; }

/* Sponsor page form */
.sponsor-card { text-align: left; margin: 28px 0 20px; }
.sponsor-card h2 { margin-top: 0; }
.sponsor-form { display: grid; gap: 14px; }
.sponsor-form .btn { width: 100%; max-width: 360px; }
.sponsor-form .field-hint { margin: 0; }
.form-field .field-label { margin-bottom: 6px; }
.form-field input,
.form-field select,
.form-field textarea {
  display: block;
  width: 100%;
  padding: 12px 14px;
  border: 2px solid transparent;
  border-radius: 14px;
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  transition: border-color .15s;
}
.form-field textarea { resize: vertical; min-height: 6.5em; }
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus { outline: none; border-color: var(--accent); }
.form-field input::placeholder,
.form-field textarea::placeholder { color: var(--text-muted); opacity: .7; }

/* Privacy page: count-my-visits switch */
.count-switch {
  margin: 4px 0 12px;
  padding: 10px 14px 10px 10px;
  background: var(--surface-2);
}
.count-switch:hover { background: var(--surface-2); filter: brightness(0.97); }
.count-switch:disabled { cursor: not-allowed; opacity: .7; }
.count-status { font-size: 0.9375rem; color: var(--text-muted); }

/* 404 */
.error-code {
  margin: 8px 0 0;
  font-size: 0.875rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  color: var(--text-muted);
}
.hero .btn-link { max-width: 300px; margin: 16px auto 0; }

/* Footer */
.site-footer {
  padding: 20px var(--gutter) max(20px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-muted);
}
.site-footer p { margin: 0; }
.site-footer a { color: var(--text-muted); }
.site-footer p + p { margin-top: 4px; }
.site-footer .footer-stats a { color: var(--brand); font-weight: 700; }

@media (min-width: 720px) {
  .hero { padding: 24px 0 32px; }
  .hero-art { width: 160px; }
  .hero-mascot { width: 160px; height: 160px; }
  .card { padding: 32px 28px; }
}

/* Public stats page */
.stats-page { max-width: 760px; }
.stats-title { font-size: 2rem; margin: 8px 0 4px; letter-spacing: -0.01em; text-align: center; }
.stats-lead { margin: 0 0 12px; text-align: center; color: var(--text-muted); font-size: 1.0625rem; }
.stats-status { text-align: center; color: var(--text-muted); margin: 8px 0 16px; }
.stat-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0 0 16px; }
.stat-tile {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 12px 14px; display: flex; flex-direction: column; gap: 2px;
}
.stat-tile b { font-family: var(--font-num); font-size: 1.5rem; font-variant-numeric: tabular-nums; color: var(--text); }
.stat-tile span { font-size: 0.8125rem; color: var(--text-muted); }
.stats-card { position: relative; text-align: left; margin-bottom: 16px; }
.stats-card h2 { font-size: 1.0625rem; margin: 0 0 10px; }
.stats-card-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.stats-card-head h2 { margin: 0; }

.map-frame { position: relative; aspect-ratio: 975 / 610; width: 100%; touch-action: manipulation; }
.map { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.map[hidden] { display: none; }
.map-us { transition: opacity 0.3s ease; }
.map-us.fading { opacity: 0; pointer-events: none; }
.map path {
  stroke: var(--surface); stroke-width: 0.75; vector-effect: non-scaling-stroke; stroke-linejoin: round;
  transition: fill 0.2s ease;
}
.map path:hover { stroke: var(--text); stroke-width: 1.5; }
.seq-none { fill: var(--map-none); background: var(--map-none); }
.seq-0 { fill: var(--seq-0); background: var(--seq-0); }
.seq-1 { fill: var(--seq-1); background: var(--seq-1); }
.seq-2 { fill: var(--seq-2); background: var(--seq-2); }
.seq-3 { fill: var(--seq-3); background: var(--seq-3); }
.seq-4 { fill: var(--seq-4); background: var(--seq-4); }

.legend { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 0; margin: 10px 0 0; font-size: 0.8125rem; color: var(--text-muted); }
.legend li { display: inline-flex; align-items: center; gap: 6px; }
.swatch { width: 14px; height: 14px; border-radius: 4px; border: 1px solid var(--border); }
.stats-note { font-size: 0.8125rem; color: var(--text-muted); margin: 8px 0 0; }
.stats-contact a { color: inherit; }

.chart-tip {
  position: absolute; z-index: 2; pointer-events: none; max-width: 220px;
  background: var(--text); color: var(--bg); border-radius: 8px; padding: 6px 10px;
  font-size: 0.8125rem; line-height: 1.35; box-shadow: var(--shadow);
}
.chart-tip b { display: block; font-weight: 700; }

.bars { width: 100%; min-height: 190px; }
.bars svg { display: block; width: 100%; height: auto; overflow: visible; }
.bars .bar { fill: var(--brand); }
.bars .grid { stroke: var(--grid); stroke-width: 1; }
.bars .baseline { stroke: var(--border); stroke-width: 1; }
.bars .axis { fill: var(--text-muted); font-size: 11px; font-family: var(--font); }
.bars .hit { fill: transparent; }
.bars .hit:hover { fill: var(--text); fill-opacity: 0.05; }
.stats-empty { color: var(--text-muted); text-align: center; padding: 64px 0; margin: 0; }

.stats-table { margin-top: 10px; font-size: 0.875rem; }
.stats-table summary { cursor: pointer; color: var(--text-muted); font-weight: 600; }
.stats-table table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.stats-table th, .stats-table td { padding: 5px 6px; border-bottom: 1px solid var(--border); text-align: left; }
.stats-table .n { text-align: right; font-variant-numeric: tabular-nums; }
.stats-privacy { text-align: center; margin: 8px 0 12px; }
.stats-cta { display: flex; justify-content: center; margin: 0 0 24px; }
.stats-cta .btn-link { width: 100%; max-width: 300px; }

@media (min-width: 600px) {
  .stat-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
