/* Road to Nice — "Night session" design system (see DESIGN.md). */

:root {
  --bg: #09090b;
  --card: #131316;
  --card-2: #1a1a1e;
  --card-3: #222227;
  --line: rgba(255, 255, 255, .07);
  --line-2: rgba(255, 255, 255, .14);
  --text: #f4f4f5;
  --muted: #8b8b94;
  --faint: #5b5b63;
  --accent: #ff6b2c;
  --accent-soft: rgba(255, 107, 44, .14);
  --good: #3ddc97; --warn: #ffb020; --bad: #ff4d5e;
  --swim: #4f8cff; --bike: #ffb020; --run: #ff6b2c; --strength: #a78bfa; --test: #3ddc97; --other: #5b5b63;
  --z1: #3a3a42; --z2: #4f8cff; --z3: #ffb020; --z4: #ff6b2c; --z5: #ff4d5e;
  /* names the chart code uses */
  --ink: var(--text); --surface: var(--card-2); --surface-2: var(--card-3); --ok: var(--good);

  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --tight: 'Inter Tight', 'Inter', system-ui, sans-serif;
  --r: 20px; --r-sm: 12px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --rail: 76px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 15px; line-height: 1.5; font-feature-settings: 'cv11', 'ss01'; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button, input { font: inherit; color: inherit; }
::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.num { font-family: var(--tight); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.muted { color: var(--muted); }
.accent { color: var(--accent); }

/* ---------- buttons & pills ---------- */
.btn { display: inline-flex; align-items: center; gap: 10px; height: 46px; padding: 0 20px; border-radius: 999px; border: 0; background: var(--accent); color: #fff; font-weight: 500; font-size: 15px; cursor: pointer; transition: transform .25s var(--ease), background-color .25s, box-shadow .25s; box-shadow: 0 8px 30px -8px rgba(255, 107, 44, .6); }
.btn:hover { transform: translateY(-2px); background: #ff7d45; }
.btn:active { transform: none; }
.btn.ghost { background: rgba(255, 255, 255, .08); box-shadow: none; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1px solid var(--line-2); }
.btn.ghost:hover { background: rgba(255, 255, 255, .14); }
.btn svg { width: 16px; height: 16px; transition: transform .25s var(--ease); }
.btn:hover svg { transform: translateX(3px); }
.pill { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 14px; border-radius: 999px; background: rgba(255, 255, 255, .06); border: 1px solid var(--line); font-size: 13px; color: var(--muted); white-space: nowrap; }
.pill b { color: var(--text); font-weight: 500; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 0 rgba(61, 220, 151, .6); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(61, 220, 151, 0); } 100% { box-shadow: 0 0 0 0 rgba(61, 220, 151, 0); } }

/* ---------- app shell ---------- */
.rail { position: fixed; inset: 0 auto 0 0; width: var(--rail); display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 20px 0; z-index: 30; }
.rail .logo { width: 44px; height: 44px; border-radius: 14px; background: var(--accent); display: grid; place-items: center; font-family: var(--tight); font-weight: 700; font-size: 20px; color: #fff; margin-bottom: 18px; box-shadow: 0 8px 24px -6px rgba(255, 107, 44, .6); }
.rail a.nav { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); border: 1px solid var(--line); background: var(--card); position: relative; transition: color .2s, background-color .2s, border-color .2s, transform .2s var(--ease); }
.rail a.nav:hover { color: var(--text); border-color: var(--line-2); transform: translateY(-1px); }
.rail a.nav[aria-current="page"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.rail a.nav svg { width: 19px; height: 19px; }
.rail a.nav .tip-l { position: absolute; left: 56px; background: var(--card-3); color: var(--text); font-size: 13px; padding: 6px 10px; border-radius: 8px; white-space: nowrap; opacity: 0; transform: translateX(-4px); pointer-events: none; transition: opacity .15s, transform .15s; }
.rail a.nav:hover .tip-l { opacity: 1; transform: none; }
.rail .spacer { flex: 1; }
.app { margin-left: var(--rail); padding: 20px 28px 64px 12px; min-height: 100vh; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 4px 0 24px; flex-wrap: wrap; }
.topbar h1 { font-family: var(--tight); font-weight: 600; font-size: clamp(26px, 3vw, 38px); letter-spacing: -.03em; line-height: 1.1; }
.topbar h1 span { color: var(--muted); font-weight: 500; }
.topbar .right { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 820px) {
  .rail { inset: auto 0 0 0; width: auto; height: 68px; flex-direction: row; justify-content: space-around; padding: 0 10px env(safe-area-inset-bottom); background: rgba(9, 9, 11, .88); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--line); gap: 0; }
  .rail .logo, .rail .spacer, .rail a.signout { display: none; }
  .rail a.nav { border: 0; background: transparent; width: 52px; }
  .rail a.nav[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
  .rail a.nav .tip-l { display: none; }
  .app { margin-left: 0; padding: 16px 14px 96px; }
}

/* ---------- tabs (segmented) ---------- */
.tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); margin-bottom: 20px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { border: 0; background: transparent; color: var(--muted); height: 36px; padding: 0 16px; border-radius: 999px; cursor: pointer; font-size: 14px; white-space: nowrap; transition: color .2s, background-color .2s; }
.tabs button:hover { color: var(--text); }
.tabs button[aria-selected="true"] { background: var(--text); color: var(--bg); font-weight: 500; }
.panel[hidden] { display: none !important; }

/* ---------- bento & cards ---------- */
.bento { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px; }
.c3 { grid-column: span 3; } .c4 { grid-column: span 4; } .c5 { grid-column: span 5; } .c6 { grid-column: span 6; } .c7 { grid-column: span 7; } .c8 { grid-column: span 8; } .c12 { grid-column: 1 / -1; }
@media (max-width: 1180px) { .c3 { grid-column: span 6; } .c4, .c5, .c7, .c8 { grid-column: span 12; } .c6 { grid-column: span 12; } }
@media (max-width: 1180px) and (min-width: 821px) { .c4.half { grid-column: span 6; } }
@media (max-width: 560px) { .c3 { grid-column: span 6; } .kpi .card-h .lbl, .kpi .card-h .info { display: none; } .kpi .card-h h3 { font-size: 14px; } .kpi.card { padding: 14px; } .kpi .chip { width: 30px; height: 30px; } .kpi .big { font-size: 28px; } }
@media (max-width: 340px) { .c3 { grid-column: 1 / -1; } }

.card { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 18px 20px; min-width: 0; transition: border-color .25s, transform .35s var(--ease), background-color .25s; overflow: hidden; }
.card:hover { border-color: var(--line-2); }
.card.lift:hover { transform: translateY(-2px); }
.card-h { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; min-height: 36px; }
.chip { width: 36px; height: 36px; border-radius: var(--r-sm); display: grid; place-items: center; background: var(--card-3); flex: none; color: var(--text); }
.chip svg { width: 18px; height: 18px; }
.chip.ember { background: var(--accent-soft); color: var(--accent); }
.chip.blue { background: rgba(79, 140, 255, .14); color: var(--swim); }
.chip.amber { background: rgba(255, 176, 32, .14); color: var(--bike); }
.chip.green { background: rgba(61, 220, 151, .14); color: var(--good); }
.chip.violet { background: rgba(167, 139, 250, .14); color: var(--strength); }
.card-h h3 { font-size: 15px; font-weight: 500; letter-spacing: -.01em; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-h .lbl { font-size: 12px; color: var(--muted); white-space: nowrap; }
.info { width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line); background: transparent; color: var(--muted); display: grid; place-items: center; cursor: pointer; flex: none; font-size: 12px; font-family: var(--tight); font-weight: 600; transition: color .2s, border-color .2s, background-color .2s; }
.info:hover, .info[aria-expanded="true"] { color: var(--text); border-color: var(--line-2); background: var(--card-3); }
.explain { font-size: 13px; line-height: 1.5; color: var(--muted); background: var(--card-2); border-radius: var(--r-sm); padding: 12px 14px; margin: -4px 0 14px; display: none; }
.card.open .explain { display: block; animation: drop .25s var(--ease); }
@keyframes drop { from { opacity: 0; transform: translateY(-4px); } }
.big { font-family: var(--tight); font-size: 34px; font-weight: 600; letter-spacing: -.035em; line-height: 1; font-variant-numeric: tabular-nums; }
.big .u { font-size: 15px; font-weight: 500; color: var(--muted); margin-left: 4px; letter-spacing: 0; }
.sub { font-size: 13px; color: var(--muted); margin-top: 8px; display: flex; align-items: center; gap: 6px; }
.delta { font-weight: 500; }
.delta.up { color: var(--good); } .delta.down { color: var(--bad); }
.state-good .big { color: var(--good); } .state-warn .big { color: var(--warn); } .state-bad .big { color: var(--bad); }
.kpi { display: grid; grid-template-rows: auto auto 1fr; }
.kpi .mini { height: 46px; margin-top: 14px; }
.kpi .mini svg { width: 100%; height: 100%; overflow: visible; }

.section-t { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 34px 2px 14px; }
.section-t h2 { font-family: var(--tight); font-size: 20px; font-weight: 600; letter-spacing: -.02em; }
.section-t a, .section-t span { font-size: 13px; color: var(--muted); }
.section-t a:hover { color: var(--text); }

/* alert banner */
.banner { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); font-size: 14px; margin-bottom: 14px; }
.banner .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); flex: none; }
.banner.on { background: rgba(255, 77, 94, .08); border-color: rgba(255, 77, 94, .25); }
.banner.on .dot { background: var(--bad); box-shadow: 0 0 12px var(--bad); }
.banner + .banner { margin-top: -6px; }

/* legends & charts */
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--muted); margin: -4px 0 12px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.legend i.line { width: 14px; height: 2px; border-radius: 2px; }
.chart { position: relative; width: 100%; }
.chart svg { width: 100%; height: auto; overflow: visible; }
.chart .axis text { font-family: var(--sans); font-size: 11px; fill: var(--faint); }
.chart .axis path, .chart .axis line { display: none; }
.chart .grid line { stroke: var(--line); stroke-width: 1; }
.chart .ref { stroke: var(--muted); stroke-dasharray: 3 4; stroke-width: 1; opacity: .7; }
.chart .ref-label { font-size: 11px; fill: var(--muted); }
.chart .today-line { stroke: var(--accent); stroke-width: 1.5; stroke-dasharray: 2 3; }
.tip { position: absolute; pointer-events: none; background: rgba(26, 26, 30, .96); border: 1px solid var(--line-2); color: var(--text); padding: 9px 11px; font-size: 12.5px; line-height: 1.45; border-radius: 10px; opacity: 0; transform: translateY(4px); transition: opacity .12s, transform .12s; z-index: 5; white-space: nowrap; box-shadow: 0 12px 30px -10px rgba(0, 0, 0, .7); }
.tip.on { opacity: 1; transform: none; }
.tip b { font-weight: 600; }

/* lists inside cards */
.rows { display: grid; gap: 2px; }
.row { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 10px 10px; border-radius: 12px; transition: background-color .2s; font-size: 14px; }
.row:hover { background: var(--card-2); }
.row .when { color: var(--muted); font-size: 12px; min-width: 64px; }
.row .what { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .what small { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .min { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.row.today .when { color: var(--accent); }
.row.key .what { font-weight: 500; }
.tag { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 999px; font-size: 11px; background: var(--accent-soft); color: var(--accent); margin-left: 6px; vertical-align: 1px; }
.dotc { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }

/* coach notes */
.notes { display: grid; gap: 10px; }
.note { padding: 14px; border-radius: 14px; background: var(--card-2); }
.note .area { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.note h4 { font-size: 14.5px; font-weight: 500; margin-bottom: 4px; }
.note p { font-size: 13px; color: var(--muted); line-height: 1.5; }
.note.warn .area { color: var(--accent); }

/* tables */
.table-box { overflow: auto; -webkit-overflow-scrolling: touch; border-radius: 12px; }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th { text-align: left; font-weight: 500; color: var(--muted); padding: 10px 12px; white-space: nowrap; background: var(--card); position: sticky; top: 0; z-index: 1; border-bottom: 1px solid var(--line); }
table.data th button { background: none; border: 0; padding: 0; cursor: pointer; color: inherit; font-weight: 500; }
table.data th button:hover { color: var(--text); }
table.data td { padding: 10px 12px; white-space: nowrap; border-bottom: 1px solid var(--line); }
table.data td.n, table.data th.n { text-align: right; font-variant-numeric: tabular-nums; }
table.data tr:hover td { background: var(--card-2); }
table.data td.wrap { white-space: normal; min-width: 22ch; color: var(--muted); }
.search { height: 40px; padding: 0 14px; border-radius: 999px; background: var(--card-2); border: 1px solid var(--line); width: min(320px, 100%); font-size: 14px; }
.search:focus { outline: none; border-color: var(--line-2); }

/* day columns */
.days { display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); gap: 6px; align-items: end; height: 190px; }
.day { display: flex; flex-direction: column-reverse; gap: 2px; height: 100%; position: relative; cursor: default; }
.day .seg { width: 100%; border-radius: 6px; transition: filter .2s, transform .4s var(--ease); transform-origin: bottom; }
.day:hover .seg { filter: brightness(1.2); }
.day .lbl { position: absolute; bottom: -34px; left: 0; right: 0; text-align: center; font-size: 11px; color: var(--faint); line-height: 1.25; white-space: pre; }
.day.today .lbl { color: var(--accent); }
.days-wrap { padding-bottom: 36px; }

/* ---------- predictions ---------- */
.seg-btns { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.seg-btns button { text-align: left; border: 1px solid var(--line); background: var(--card-2); border-radius: 14px; padding: 12px 14px; cursor: pointer; transition: border-color .2s, background-color .2s, transform .2s var(--ease); }
.seg-btns button:hover { border-color: var(--line-2); transform: translateY(-1px); }
.seg-btns button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.seg-btns .p { font-family: var(--tight); font-size: 20px; font-weight: 600; display: block; letter-spacing: -.02em; }
.seg-btns .n { font-size: 12px; color: var(--muted); }
@media (max-width: 700px) { .seg-btns { grid-template-columns: 1fr 1fr; } }
.slider { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; margin-top: 16px; font-size: 13px; color: var(--muted); }
.slider output { color: var(--text); font-family: var(--tight); font-weight: 600; min-width: 44px; text-align: right; }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 36px; background: transparent; cursor: pointer; }
input[type=range]::-webkit-slider-runnable-track { height: 6px; border-radius: 6px; background: linear-gradient(to right, var(--accent) var(--fill, 100%), var(--card-3) var(--fill, 100%)); }
input[type=range]::-moz-range-track { height: 6px; border-radius: 6px; background: var(--card-3); }
input[type=range]::-moz-range-progress { height: 6px; border-radius: 6px; background: var(--accent); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; margin-top: -8px; border-radius: 50%; background: #fff; border: 0; box-shadow: 0 0 0 6px rgba(255, 107, 44, .25); transition: transform .15s; }
input[type=range]::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 0; }
input[type=range]:active::-webkit-slider-thumb { transform: scale(1.12); }
.finish { font-family: var(--tight); font-weight: 600; font-size: clamp(64px, 10vw, 128px); letter-spacing: -.05em; line-height: .9; font-variant-numeric: tabular-nums; }
.finish .h { color: var(--accent); }
.split-bar { display: flex; height: 12px; border-radius: 999px; overflow: hidden; gap: 3px; margin: 20px 0 12px; }
.split-bar span { display: block; height: 100%; transition: flex-grow .6s var(--ease); }
.splits { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.splits div { background: var(--card-2); border-radius: 14px; padding: 12px 14px; }
.splits .k { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.splits .v { font-family: var(--tight); font-size: 22px; font-weight: 600; letter-spacing: -.02em; margin-top: 2px; }
.splits .p { font-size: 12px; color: var(--muted); }
@media (max-width: 700px) { .splits { grid-template-columns: 1fr 1fr; } }
.race-switch { display: inline-flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--card-2); border: 1px solid var(--line); }
.race-switch button { border: 0; background: transparent; color: var(--muted); height: 32px; padding: 0 14px; border-radius: 999px; cursor: pointer; font-size: 13px; }
.race-switch button[aria-pressed="true"] { background: var(--text); color: var(--bg); font-weight: 500; }
.compare { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.compare th, .compare td { padding: 11px 12px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--line); }
.compare th:first-child, .compare td:first-child { text-align: left; }
.compare thead th { color: var(--muted); font-weight: 500; }
.compare td.sel { color: var(--accent); font-weight: 600; }
dl.assume { display: grid; gap: 12px; }
dl.assume div { padding: 12px 14px; background: var(--card-2); border-radius: 12px; }
dl.assume dt { font-size: 13px; font-weight: 500; margin-bottom: 2px; }
dl.assume dd { font-size: 13px; color: var(--muted); }

/* ---------- journal ---------- */
.entry { display: grid; grid-template-columns: 92px 1fr; gap: 18px; }
.entry .date { text-align: center; background: var(--card-2); border-radius: 16px; padding: 12px 6px; align-self: start; }
.entry .date .d { font-family: var(--tight); font-size: 34px; font-weight: 600; letter-spacing: -.03em; line-height: 1; }
.entry .date .m { font-size: 12px; color: var(--muted); margin-top: 4px; }
.entry h3 { font-family: var(--tight); font-size: 20px; font-weight: 600; letter-spacing: -.02em; margin: 2px 0 8px; }
.entry .note-t { font-size: 15px; line-height: 1.6; color: #d4d4d8; }
.entry .meta { font-size: 12px; color: var(--muted); margin-bottom: 4px; display: flex; gap: 8px; align-items: center; }
.entry .coachline { margin-top: 12px; padding: 12px 14px; background: var(--accent-soft); border-radius: 12px; font-size: 13.5px; color: #ffd9c7; }
.entry .coachline b { color: var(--accent); font-weight: 600; }
@media (max-width: 560px) { .entry { grid-template-columns: 1fr; } .entry .date { display: flex; gap: 10px; align-items: baseline; justify-self: start; padding: 8px 12px; } .entry .date .d { font-size: 22px; } }
.filters { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.filters button { border: 1px solid var(--line); background: var(--card); color: var(--muted); height: 34px; padding: 0 14px; border-radius: 999px; cursor: pointer; font-size: 13px; transition: color .2s, border-color .2s; }
.filters button:hover { color: var(--text); border-color: var(--line-2); }
.filters button[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.timeline { display: grid; gap: 0; position: relative; }
.timeline li { display: grid; grid-template-columns: 18px 1fr auto; gap: 12px; padding: 10px 0; align-items: start; font-size: 14px; }
.timeline .pip { width: 10px; height: 10px; border-radius: 50%; background: var(--card-3); margin-top: 5px; justify-self: center; box-shadow: 0 0 0 4px var(--card); }
.timeline li.done .pip { background: var(--good); }
.timeline li.next .pip { background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.timeline small { display: block; color: var(--muted); font-size: 12.5px; }
.timeline .r { color: var(--muted); font-size: 12px; white-space: nowrap; }

/* ---------- plan ---------- */
.dayblock { display: grid; grid-template-columns: 110px 1fr; gap: 16px; padding: 14px 4px; border-bottom: 1px solid var(--line); }
.dayblock:last-child { border-bottom: 0; }
.dayblock .dl { font-family: var(--tight); font-weight: 600; font-size: 17px; letter-spacing: -.01em; }
.dayblock .dl small { display: block; font-family: var(--sans); font-weight: 400; color: var(--muted); font-size: 12px; margin-top: 2px; }
.dayblock.today .dl { color: var(--accent); }
.dayblock .ss { display: grid; gap: 6px; }
.sess { display: grid; grid-template-columns: 8px 1fr auto; gap: 12px; align-items: start; padding: 10px 12px; border-radius: 12px; background: var(--card-2); cursor: pointer; transition: background-color .2s; }
.sess:hover { background: var(--card-3); }
.sess .dotc { margin-top: 7px; }
.sess .t { font-size: 14px; font-weight: 500; }
.sess .t .tm { color: var(--muted); font-weight: 400; margin-right: 6px; }
.sess .m { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.sess .more { grid-column: 2 / -1; font-size: 13px; color: var(--muted); display: none; line-height: 1.5; }
.sess .more b { color: var(--text); font-weight: 500; }
.sess.open .more { display: block; }
@media (max-width: 560px) { .dayblock { grid-template-columns: 1fr; gap: 8px; } }

/* ---------- motion ---------- */
.rise { opacity: 0; transform: translateY(16px); transition: opacity .7s var(--ease), transform .7s var(--ease); transition-delay: var(--d, 0ms); }
.rise.in { opacity: 1; transform: none; }
.no-js .rise { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rise { opacity: 1 !important; transform: none !important; transition: none !important; }
  .live-dot { animation: none; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* =====================================================================
   GRIT LAYER — black-and-white editorial grunge (see DESIGN.md).
   Square corners, hairlines, uppercase micro-labels, grain over everything.
   ===================================================================== */
:root {
  --bg: #0b0b0b; --card: #111111; --card-2: #171717; --card-3: #222222;
  --line: rgba(255, 255, 255, .1); --line-2: rgba(255, 255, 255, .28);
  --text: #ecebe8; --muted: #8d8c88; --faint: #5a5956;
  --paper: #d8d5ce; --paper-ink: #0b0b0b;
  --tight: 'Archivo', 'Inter', system-ui, sans-serif;
  --r: 3px; --r-sm: 2px;
}
body { font-feature-settings: 'ss01'; }
/* film grain over the whole site */
body::after { content: ''; position: fixed; inset: -50%; z-index: 100; pointer-events: none; opacity: .09; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); animation: grain 1.2s steps(6) infinite; }
@keyframes grain { 0% { transform: translate(0, 0); } 20% { transform: translate(-3%, 2%); } 40% { transform: translate(2%, -3%); } 60% { transform: translate(-2%, -1%); } 80% { transform: translate(3%, 3%); } 100% { transform: translate(0, 0); } }
.lbl-u, .card-h .lbl, .pill, .tabs button, .legend, .sub, .note .area, .splits .k, table.data th, .compare thead th { text-transform: uppercase; letter-spacing: .08em; font-size: 11px; }
.sub { text-transform: none; letter-spacing: 0; font-size: 12.5px; }

/* buttons: rectangles, not bubbles */
.btn { border-radius: 0; height: 44px; padding: 0 20px; background: var(--text); color: var(--bg); box-shadow: none; text-transform: uppercase; letter-spacing: .1em; font-size: 12px; font-weight: 600; border: 1px solid var(--text); }
.btn:hover { background: transparent; color: var(--text); transform: none; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line-2); backdrop-filter: none; -webkit-backdrop-filter: none; }
.btn.ghost:hover { background: var(--text); color: var(--bg); }
.btn.ember { background: var(--accent); border-color: var(--accent); color: #0b0b0b; }
.btn.ember:hover { background: transparent; color: var(--accent); }
.pill { border-radius: 0; height: 28px; background: transparent; border: 1px solid var(--line); }
.tag { border-radius: 0; text-transform: uppercase; letter-spacing: .08em; font-size: 10px; }

/* rail & tabs */
.rail .logo { border-radius: 0; background: var(--text); color: var(--bg); box-shadow: none; font-family: var(--tight); font-weight: 800; font-stretch: 112%; }
.rail a.nav { border-radius: 0; background: transparent; }
.rail a.nav[aria-current="page"] { background: var(--text); color: var(--bg); }
.rail a.nav .tip-l { border-radius: 0; text-transform: uppercase; letter-spacing: .08em; font-size: 11px; }
.tabs { border-radius: 0; background: transparent; border: 0; border-bottom: 1px solid var(--line); padding: 0; gap: 0; display: flex; width: 100%; }
.tabs button { border-radius: 0; height: 42px; padding: 0 18px; position: relative; }
.tabs button[aria-selected="true"] { background: transparent; color: var(--text); }
.tabs button[aria-selected="true"]::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--accent); }
@media (max-width: 820px) { .rail a.nav[aria-current="page"] { background: transparent; color: var(--text); box-shadow: inset 0 2px 0 var(--accent); } .rail { background: rgba(11, 11, 11, .92); } }

/* type */
.topbar h1 { font-family: var(--tight); font-weight: 800; font-stretch: 112%; text-transform: uppercase; letter-spacing: -.02em; font-size: clamp(26px, 3.4vw, 46px); line-height: .95; }
.topbar h1 span { font-weight: 300; }
.big, .finish, .splits .v, .entry .date .d, .section-t h2, .entry h3, .dayblock .dl { font-family: var(--tight); }
.big { font-weight: 700; font-stretch: 105%; letter-spacing: -.03em; }
.section-t h2 { text-transform: uppercase; font-weight: 800; font-stretch: 112%; letter-spacing: -.01em; font-size: 18px; }
.card-h h3 { text-transform: uppercase; letter-spacing: .06em; font-size: 12px; font-weight: 600; }
.finish { font-weight: 800; font-stretch: 112%; }

/* cards & chips: square, hairline */
.card { border-radius: var(--r); background: var(--card); }
.card.lift:hover { transform: none; border-color: var(--line-2); }
.chip { border-radius: 0; width: 30px; height: 30px; background: transparent; border: 1px solid var(--line); color: var(--muted); }
.chip svg { width: 15px; height: 15px; }
.chip.ember, .chip.blue, .chip.amber, .chip.green, .chip.violet { background: transparent; }
.info { border-radius: 0; }
.explain, .note, .splits div, dl.assume div, .scen div, .sess, .entry .date, .entry .coachline, .banner, .seg-btns button, .race-switch, .race-switch button, .filters button, .search, .row, .day .seg, .tip { border-radius: 0 !important; }
.race-switch button[aria-pressed="true"], .filters button[aria-pressed="true"] { background: var(--text); color: var(--bg); }
.entry .coachline { background: transparent; border-left: 2px solid var(--accent); color: var(--text); }
.banner.on { background: transparent; border-color: rgba(255, 77, 94, .45); }
.seg-btns button[aria-pressed="true"] { background: transparent; border-color: var(--accent); }
input[type=range]::-webkit-slider-thumb { border-radius: 0; width: 14px; height: 24px; margin-top: -9px; box-shadow: none; }
input[type=range]::-moz-range-thumb { border-radius: 0; width: 14px; height: 24px; }
input[type=range]::-webkit-slider-runnable-track { border-radius: 0; }
.split-bar { border-radius: 0; height: 8px; }
.live-dot { border-radius: 0; width: 6px; height: 6px; }
.dotc { border-radius: 0; }
@media (prefers-reduced-motion: reduce) { body::after { animation: none; } }
/* data palette in the grit layer: monochrome, with ember for run and the hard zones */
:root { --swim: #8fa6bd; --bike: #ecebe8; --run: #ff6b2c; --strength: #707070; --test: #b5b5b0; --other: #444;
  --z1: #2c2c2c; --z2: #6b6b6b; --z3: #b3b2ae; --z4: #ff6b2c; --z5: #ff3b30; }

/* demo badge */
.demo-badge { position: fixed; right: 16px; bottom: 16px; z-index: 90; display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 14px; background: rgba(11, 11, 11, .92); border: 1px solid var(--line-2); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); font-size: 11px; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); animation: drop .5s var(--ease) both; }
.demo-badge b { color: var(--accent); font-weight: 600; }
.demo-badge .btn { height: 32px; padding: 0 14px; font-size: 11px; }
@media (max-width: 820px) { .demo-badge { left: 12px; right: 12px; bottom: 80px; justify-content: space-between; } .demo-badge .dd { font-size: 10px; } }
@media (max-width: 820px) { .is-demo .l-dummy { display: none; } }
body:not(:has(.rail)) .demo-badge { bottom: 12px; }

/* ---------- session page ---------- */
.link-u { text-transform: uppercase; letter-spacing: .09em; font-size: 11px; display: inline-flex; gap: 6px; color: var(--text); border-bottom: 1px solid transparent; padding-bottom: 2px; transition: border-color .25s; }
.link-u:hover { border-color: currentColor; }
.s-nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 2px; }
.s-nav span { display: flex; gap: 6px; }
.s-nav .btn { height: 34px; padding: 0 14px; font-size: 11px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.stat { padding: 16px 14px 14px 0; border-bottom: 1px solid var(--line); }
.stat .k { text-transform: uppercase; letter-spacing: .08em; font-size: 10.5px; color: var(--muted); }
.stat .v { font-family: var(--tight); font-weight: 700; font-size: 28px; letter-spacing: -.03em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat .v .u { font-size: 12px; font-weight: 500; color: var(--muted); margin-left: 4px; letter-spacing: 0; font-family: var(--sans); }
@media (max-width: 700px) { .stats { grid-template-columns: 1fr 1fr; } }
.p-name { font-family: var(--tight); font-weight: 700; font-size: 22px; letter-spacing: -.02em; margin-bottom: 14px; }
.cmp { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.cmp .k { display: block; text-transform: uppercase; letter-spacing: .08em; font-size: 10.5px; color: var(--muted); }
.cmp b { font-family: var(--tight); font-size: 20px; font-weight: 700; }
.bar-track2 { height: 3px; background: var(--card-3); margin-top: 12px; }
.bar-track2 i { display: block; height: 100%; background: var(--accent); }
.zones { display: grid; gap: 10px; }
.zr { display: grid; grid-template-columns: 100px 1fr 64px; gap: 12px; align-items: center; font-size: 12px; }
.zr .zl { color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-size: 10.5px; }
.zr .zt { height: 10px; background: var(--card-2); }
.zr .zt i { display: block; height: 100%; }
.zr .zm { text-align: right; }
.verdict { margin-top: 14px; padding: 10px 12px; font-size: 13px; border-left: 2px solid; }
.verdict.ok { border-color: var(--good); } .verdict.bad { border-color: var(--accent); }
.drows { display: grid; }
.dr { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.dr:last-child { border-bottom: 0; }
.dr .k { text-transform: uppercase; letter-spacing: .08em; font-size: 10.5px; color: var(--muted); align-self: center; }
.dr b { font-family: var(--tight); font-size: 22px; font-weight: 700; }
.dr p { grid-column: 1 / -1; font-size: 13px; color: var(--muted); }
table.data tr.go { cursor: pointer; }
/* ---------- records page ---------- */
.pbs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.pb { padding: 18px 16px 16px 0; border-top: 1px solid var(--line); display: grid; gap: 4px; color: inherit; }
a.pb:hover .v { color: var(--accent); }
.pb .k { text-transform: uppercase; letter-spacing: .08em; font-size: 10.5px; color: var(--muted); }
.pb .v { font-family: var(--tight); font-weight: 800; font-stretch: 108%; font-size: clamp(30px, 3.4vw, 46px); letter-spacing: -.04em; line-height: 1; font-variant-numeric: tabular-nums; transition: color .2s; }
.pb .s { font-size: 12px; color: var(--muted); }
@media (max-width: 900px) { .pbs { grid-template-columns: 1fr 1fr; } }
/* build 20261102T1635 */
