:root {
  --story-width: 960px; --story-radius: 18px; --story-thumb: 80px; --story-title: clamp(28px, 5vw, 48px);
  --horse-portrait: 280px; --profile-title: 32px; --profile-body: 14px; --profile-meta: 12px;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s6: 24px; --s8: 32px; --s12: 48px; --control-height: 48px;
  --quiet: var(--muted);
}
.btn, .input, .tab { min-height: var(--control-height); }
.btn { white-space: normal; text-align: center; line-height: 1.35; }
.spur.is-hot small { color: var(--ink); }
.topbar-right { flex-wrap: wrap; justify-content: end; }
.topbar .wordmark { flex-shrink: 0; white-space: nowrap; }
.topbar .link { min-height: var(--control-height); display: inline-flex; align-items: center; }
.story-shell { max-width: var(--story-width); }
.story-main { display: grid; gap: var(--s6); padding-block: var(--s8); }
.story-heading { display: grid; gap: var(--s3); }
.story-heading h1 { font: 600 var(--story-title)/1.15 var(--display); letter-spacing: -.035em; overflow-wrap: anywhere; }
.moment-kicker { font: 500 12px/1.6 var(--sans); color: var(--orange-hi); letter-spacing: .06em; }
.moment-kicker time { display: inline-block; margin-left: var(--s3); color: var(--muted); letter-spacing: normal; }
.story-image { display: block; width: 100%; height: auto; aspect-ratio: 40 / 21; border: 1px solid var(--line); border-radius: var(--story-radius); background: var(--bg); }
.share-composer, .visit-panel { display: grid; gap: var(--s3); padding: var(--s6); background: var(--shell); border: 1px solid var(--line); border-radius: var(--story-radius); }
.share-composer textarea { resize: vertical; min-height: calc(var(--control-height) * 2); line-height: 1.6; }
.share-composer .row > * { flex: 1; }
.story-next { display: flex; flex-wrap: wrap; gap: var(--s3); }
.story-next .btn { flex: 1; }
.horse-record { display: flex; flex-wrap: wrap; gap: var(--s6); align-items: baseline; color: var(--muted); }
.horse-record b { font: 600 28px/1.2 var(--display); color: var(--text); }
.horse-profile { display: grid; grid-template-columns: var(--horse-portrait) minmax(0, 1fr); gap: var(--s6); align-items: center; padding: var(--s6); border: 1px solid var(--line); border-radius: var(--story-radius); background: var(--shell); }
.horse-portrait { display: block; width: var(--horse-portrait); max-width: 100%; height: auto; aspect-ratio: 1; image-rendering: pixelated; border-radius: var(--story-radius); }
.horse-profile-info { display: grid; gap: var(--s6); min-width: 0; }
.horse-profile h1 { font-size: var(--profile-title); }
.horse-profile .horse-record { gap: var(--s4); font-size: var(--profile-meta); }
.horse-profile .horse-record b { font-size: var(--s6); }
.profile-training { display: grid; gap: var(--s3); }
.profile-training h2 { font: 600 var(--profile-body)/1.5 var(--sans); }
.profile-stats { display: grid; gap: var(--s2); }
.profile-stat { display: grid; grid-template-columns: 1fr 2fr; gap: var(--s3); align-items: center; font-size: var(--profile-body); }
.profile-stat dd { display: flex; align-items: center; gap: var(--s3); min-width: 0; }
.profile-stat-level { flex-shrink: 0; color: var(--muted); font-size: var(--profile-meta); font-variant-numeric: tabular-nums; }
.profile-stat-level b { color: var(--text); font-size: var(--profile-body); }
.profile-stat-gauge { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); flex: 1; gap: var(--s1); }
.profile-stat-gauge i { height: var(--s2); background: var(--line); }
.profile-stat-gauge i.is-filled { background: var(--orange); }
.horse-traits { display: flex; flex-wrap: wrap; gap: var(--s1) var(--s3); list-style: none; color: var(--muted); font-size: var(--profile-meta); }
.visit-panel h2, .moment-section h2, .highlight-item h2 { font: 600 20px/1.3 var(--display); }
.visit-panel > .btn { justify-self: start; }
.moment-section { display: grid; gap: var(--s3); }
.moment-list { list-style: none; }
.moment-row { display: flex; align-items: center; gap: var(--s3); border-bottom: 1px solid var(--line); }
.moment-row > a { flex: 1; display: grid; gap: var(--s1); padding-block: var(--s4); text-decoration: none; min-width: 0; overflow-wrap: anywhere; }
.moment-row > a:hover strong { color: var(--orange-hi); }
.moment-arrow { color: var(--orange); pointer-events: none; }
.highlight-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s6); }
.highlight-item { display: grid; gap: var(--s3); align-content: start; min-width: 0; }
.highlight-item > a:first-child { display: grid; gap: var(--s2); text-decoration: none; overflow-wrap: anywhere; }
.race-visit { display: grid; gap: var(--s2); }
.race-visit p { margin: 0; }
.race-visit [data-entry-status] { color: var(--text); }
.saved-moments { margin-top: var(--s3); border-top: 1px solid var(--line); }
.saved-moments summary { padding-block: var(--s4); cursor: pointer; min-height: var(--control-height); color: var(--text); }
.saved-moments .moment-row > a { font-size: 14px; }
.moment-action { display: grid; gap: var(--s3); }
.moment-action .row > * { flex: 1; }
.race-timer { font-variant-numeric: tabular-nums; }
.followed-horse { padding: var(--s4); background: var(--shell-hi); border-radius: var(--story-radius); display: grid; gap: var(--s2); }
.followed-horse strong { overflow-wrap: anywhere; }
[hidden] { display: none !important; }
@media (max-width: 600px) {
  :root { --horse-portrait: 200px; --profile-title: 24px; }
  .story-main { padding-block: var(--s4); gap: var(--s4); }
  .share-composer, .visit-panel { padding: var(--s4); }
  .highlight-grid { grid-template-columns: minmax(0, 1fr); }
  .share-composer .row > * { flex-basis: 100%; }
  .moment-action .row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .moment-action .row > :last-child { grid-column: 1 / -1; }
  .moment-kicker time { display: block; margin-left: 0; }
  .story-shell .topbar { align-items: center; }
  .story-shell .topbar .btn { max-width: 48%; }
  .story-next .btn { flex-basis: 100%; }
  .race-visit + .row { display: grid; }
  .row .input { min-width: 0; }
  .horse-profile { grid-template-columns: minmax(0, 1fr); padding: var(--s4); gap: var(--s4); }
  .horse-portrait { justify-self: center; }
  .horse-profile-info { gap: var(--s4); }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* Round proof: the readable side of "Verify result". Hashes stay selectable, tables stay scrollable on a phone. */
.proof-panel { display: grid; gap: var(--s3); padding: var(--s6); background: var(--shell); border: 1px solid var(--line); border-radius: var(--story-radius); min-width: 0; }
.proof-panel h2 { font: 600 20px/1.3 var(--display); }
.proof-panel code { font: 400 12px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--text); overflow-wrap: anywhere; }
.proof-facts { display: grid; gap: var(--s3); }
.proof-facts > div { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: var(--s3); align-items: baseline; }
.proof-facts dt { color: var(--muted); font-size: var(--profile-meta); }
.proof-facts dd { min-width: 0; font-size: var(--profile-meta); }
.proof-method { display: grid; gap: var(--s2); padding-left: var(--s6); color: var(--muted); }
.proof-method li::marker { color: var(--orange); }
.proof-scroll { overflow-x: auto; }
.proof-table { width: 100%; border-collapse: collapse; font-size: var(--profile-meta); font-variant-numeric: tabular-nums; }
.proof-table caption { text-align: left; padding-block: var(--s3); color: var(--orange-hi); font: 500 12px/1.6 var(--sans); letter-spacing: .06em; }
.proof-table th { text-align: left; color: var(--muted); font-weight: 500; }
.proof-table th, .proof-table td { padding: var(--s2) var(--s3) var(--s2) 0; border-bottom: 1px solid var(--line); white-space: nowrap; }
.proof-table td:first-child, .proof-table th:first-child { padding-left: 0; }
.proof-horse { display: block; color: var(--text); overflow-wrap: anywhere; white-space: normal; }
.proof-wallet { display: block; color: var(--muted); font: 400 11px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; }
@media (max-width: 600px) { .proof-facts > div { grid-template-columns: minmax(0, 1fr); gap: var(--s1); } }
.proof-drift { display: block; margin-top: var(--s2); color: var(--orange-hi); font-weight: 500; }
