/* ---- shared within views ---- */
.timeline { display: inline-flex; align-items: center; gap: 10px; min-width: 220px; flex: 1; max-width: 520px; }
.timeline.wide { max-width: none; }
.timeline input { flex: 1; min-width: 120px; }
.when { color: var(--ink-2); font-size: 14px; white-space: nowrap; font-variant-numeric: tabular-nums; min-width: 8em; }
.sub-head { margin-top: 40px; }
.sub-head h3 { margin: 0; font-size: 20px; font-weight: 650; }
.sub-head .lede { margin: 6px 0 0; color: var(--ink-2); }
.fresh { color: var(--muted); font-size: 13px; }

/* ---- 01 tide ---- */
.chart.tide .readout text { paint-order: stroke; stroke: var(--bg); stroke-width: 6px; stroke-linejoin: round; }
.chart.tide .readout .r-date { fill: var(--muted); font-size: 13px; }
.chart.tide .readout .r-val { fill: var(--ink); font-size: 22px; font-weight: 650; }
.chart.tide .in-tick { paint-order: stroke; stroke: var(--bg); stroke-width: 3px; }
.chart.tide .playhead line { stroke: #ffffff; stroke-width: 1.5; filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.9)); }
.chart.tide .hair { stroke: var(--ink-2); stroke-opacity: 0.7; pointer-events: none; }
.chart.tide .in-label { font-size: 12px; font-weight: 600; letter-spacing: 0.01em; }
.chart.tide path { transition: fill-opacity 160ms ease; }

/* ---- 02 stars ---- */
.chart.stars { position: relative; }
.chart.stars canvas, .chart.stars .stars-over { position: absolute; left: 0; top: 0; }
.stars-axes .era { fill: rgba(240, 239, 236, 0.10); font-size: clamp(40px, 7vw, 84px); font-weight: 700; letter-spacing: -0.02em; }
.stars-axes .era.small { font-size: 30px; fill: rgba(240, 239, 236, 0.16); }
.axis-title { fill: var(--muted); font-size: 12px; }
.stars-over .front { fill: none; stroke: #ffffff; stroke-width: 1.5; stroke-opacity: 0.9; pointer-events: none; }
.stars-over .front-glow { fill: none; stroke: #ffffff; stroke-width: 6; stroke-opacity: 0.12; filter: blur(3px); pointer-events: none; }
.stars-over .front-labels text { fill: var(--ink); font-size: 12px; font-weight: 600; paint-order: stroke; stroke: var(--bg); stroke-width: 3px; stroke-linejoin: round; pointer-events: none; }
.stars-over .ring { fill: none; stroke: #ffffff; stroke-width: 2; pointer-events: none; }

/* ---- 03 router ---- */
.router-readout { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin: 4px 0 8px; }
.router-readout .r-date { color: var(--ink-2); font-size: 15px; font-variant-numeric: tabular-nums; }
.router-readout .r-val { font-size: 28px; font-weight: 700; }
.router-readout .r-sub { color: var(--muted); font-size: 14px; }
.chart.router { position: relative; }
.chart.router canvas { position: absolute; left: 0; top: 0; pointer-events: none; }
.chart.router .links path { mix-blend-mode: screen; }
.chart.router .links path:hover { stroke-opacity: 0.6; }
.chart.router .nl { fill: var(--ink); font-size: 12px; paint-order: stroke; stroke: var(--bg); stroke-width: 3px; stroke-linejoin: round; pointer-events: none; }
.chart.router .nl.router { font-size: 13px; font-weight: 650; }
.chart.router .nl.provider { fill: var(--ink-2); }

/* ---- 04 race ---- */
.lanes { display: grid; gap: 8px; transition: opacity 200ms; }
.lanes.dim { opacity: 0.45; }
.lane {
  display: grid;
  grid-template-columns: 170px 1fr 210px 124px;
  align-items: center;
  gap: 14px;
  padding: 8px 12px;
  border-radius: 12px;
  background: var(--bg-2);
  border: 1px solid var(--ring);
}
.lane .who .name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lane .who .detail { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lane .track { position: relative; height: 34px; border-radius: 8px; background: #0c0e13; overflow: hidden; }
.lane .fill {
  position: absolute; inset: 0 auto 0 0; width: 0;
  background: linear-gradient(90deg, rgba(57, 135, 229, 0.10), rgba(57, 135, 229, 0.38));
  border-right: 2px solid var(--s1);
  box-shadow: 6px 0 14px -4px rgba(57, 135, 229, 0.9);
}
.lane .stream {
  position: absolute; inset: 0 10px 0 10px;
  display: flex; align-items: center; justify-content: flex-end;
  overflow: hidden; white-space: nowrap;
  color: var(--ink); font-size: 14px; letter-spacing: 0.02em;
  mask-image: linear-gradient(90deg, transparent, #000 18%);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 18%);
}
.lane .wait { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 13px; }
.lane .wait::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 8px; border-radius: 50%; background: var(--warning); animation: pulse 1s ease-in-out infinite; vertical-align: 1px; }
.lane.writing .wait, .lane.finished .wait { display: none; }
.lane .stat .big { font-size: 22px; font-weight: 700; line-height: 1.1; }
.lane .stat .small { color: var(--muted); font-size: 12px; white-space: nowrap; }
.lane .done { text-align: right; font-weight: 650; font-variant-numeric: tabular-nums; color: var(--ink-2); white-space: nowrap; }
.lane.finished .stream { opacity: 0.3; transition: opacity 600ms; }
.lane.winner { border-color: rgba(255, 255, 255, 0.35); }
.lane.winner .fill { background: linear-gradient(90deg, rgba(240, 239, 236, 0.06), rgba(240, 239, 236, 0.28)); border-right-color: #ffffff; box-shadow: 6px 0 16px -4px rgba(255, 255, 255, 0.9); }
.lane.winner .done { color: var(--ink); }
@keyframes pulse { 50% { opacity: 0.25; } }

/* ---- 05 health ---- */
.status-key { font-size: 12px; width: 12px; text-align: center; }
.health-grid svg { display: block; }
.health-grid .h-name { fill: var(--ink); font-size: 13px; font-weight: 600; }
.health-grid .h-author { fill: var(--muted); font-size: 12px; }
.health-grid .h-ep { fill: var(--ink-2); font-size: 12px; }
.health-grid .h-axis { fill: var(--muted); font-size: 12px; }
.health-grid rect.flash { animation: cellflash 1.6s ease-out 2; }
@keyframes cellflash { 0% { fill: #ffffff; } 100% { } }

/* ---- 06 apps ---- */
.race-bars .race-week { fill: rgba(240, 239, 236, 0.16); font-size: clamp(26px, 4.4vw, 52px); font-weight: 700; }
.race-bars .race-total { fill: var(--muted); font-size: 13px; }
.race-bars .bar-name { fill: var(--ink); font-size: 13px; }
.race-bars .bar-val { fill: var(--ink-2); font-size: 12px; font-variant-numeric: tabular-nums; }
.board-total { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin: 8px 0 14px; }
.board-total .value { font-size: clamp(48px, 8vw, 80px); font-weight: 700; line-height: 1; letter-spacing: -0.02em; }
.board-total .unit { color: var(--ink-2); font-size: 16px; }
.share-bar { display: flex; gap: 2px; height: 30px; margin-bottom: 18px; }
.share-bar .seg-part { position: relative; min-width: 2px; border-radius: 3px; overflow: visible; }
.share-bar .seg-part:first-child { border-radius: 4px 3px 3px 4px; }
.share-bar .seg-label { position: absolute; left: 8px; top: 50%; transform: translateY(-50%); font-size: 12px; font-weight: 600; color: #ffffff; white-space: nowrap; pointer-events: none; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); }
ol.board { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
ol.board li {
  display: grid;
  grid-template-columns: 34px 28px minmax(0, 1fr) minmax(120px, 38%);
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 10px;
}
ol.board li:nth-child(odd) { background: rgba(255, 255, 255, 0.025); }
@media (min-width: 1200px) {
  ol.board { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-flow: column; grid-template-rows: repeat(var(--rows, 10), auto); column-gap: 36px; }
}
ol.board li.flash { animation: rowflash 2.4s ease-out; }
@keyframes rowflash { 0% { background: rgba(255, 255, 255, 0.16); } }
ol.board .rank { color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; }
ol.board .ico { width: 24px; height: 24px; border-radius: 6px; object-fit: cover; background: #1b1f27; }
ol.board .ico.ph { position: relative; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: var(--ink-2); }
ol.board .ico.ph img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
ol.board .ico.ph.loaded { color: transparent; }
ol.board .who { display: flex; flex-direction: column; min-width: 0; }
ol.board .title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
ol.board .cat { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; flex-wrap: wrap; }
ol.board .cat-dot { width: 8px; height: 8px; border-radius: 2px; }
ol.board .grow { color: var(--good); }
ol.board .amount { display: grid; gap: 4px; }
ol.board .amount .v { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
ol.board .track { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.05); overflow: hidden; }
ol.board .track .bar { display: block; height: 100%; border-radius: 0 3px 3px 0; }

@media (max-width: 720px) {
  .timeline { flex: 1 1 100%; min-width: 0; }
  .lane { grid-template-columns: 1fr auto; grid-template-areas: "who done" "track track" "stat stat"; gap: 6px 10px; }
  .lane .who { grid-area: who; }
  .lane .track { grid-area: track; }
  .lane .stat { grid-area: stat; display: flex; align-items: baseline; gap: 8px; }
  .lane .stat .big { font-size: 18px; }
  .lane .done { grid-area: done; }
  ol.board li { grid-template-columns: 26px 24px minmax(0, 1fr) 96px; gap: 8px; padding: 8px 4px; }
}
