/* ============================================================================================================================
   COROS skin for ClimbLoad, part 1 of 2 (colour tokens, type, components; coros-theme-hub.css restyles it for the shipped Training Hub look). Loads after style.css and only re-points its variables and re-styles components, so no page logic changes.
   Brand: Carbon Black #101820 · White #FFFFFF · Red #E52E3A (COROS mini guide), carbon tints from COROS VI 2023.
   Internal-tool extension (status hues, chart series, surfaces) follows the brand skill's ui-extension notes; these are not brand colours.
   Light is the default; dark is an option (data-theme="dark"). Grid: 12 px base unit, container radius 6, nested 3.
   ============================================================================================================================ */
:root, :root[data-theme="light"] {
  color-scheme: light;
  --coros-carbon: #101820; --coros-white: #ffffff; --coros-red: #e52e3a;
  --carbon-90: #282630; --carbon-70: #595960; --carbon-50: #8a8b8f; --carbon-30: #bbbabc;
  --font-display: "COROS DIN", "DIN-COROS", "Barlow", "Archivo", Arial, sans-serif;
  --font-body: "PF DIN Text Pro", "Barlow", "Archivo", Arial, sans-serif;

  --bg: #ffffff; --panel: #f5f6f7; --text: #101820; --muted: #595960; --line: #d9dce0;
  --accent: #101820; --accent-text: #ffffff; --danger: #e52e3a;
  --over: #c8202c; --over-bg: #fce9ea; --low: #1e6fa8; --low-bg: #e6f0f7;
  --ok: #1e8e5a; --ok-bg: #e6f4ec; --warn: #9a6410; --warn-bg: #fbf1de; --neutral-bg: #eceef0;
  --info: #1e6fa8; --info-bg: #e6f0f7;
  --chart-line: #595960; --chart-grid: #e3e5e8; --chart-bout: rgba(16, 24, 32, .08);
  /* zones read as one cool-to-hot ramp: blue, green, amber, brand red, violet (the status hues are the brand skill's UI extension) */
  --z0: #1e6fa8; --z1: #1e8e5a; --z2: #b8791a; --z3: #e52e3a; --z4: #5b4bb5;
  --grp-climb-c: #595960; --grp-load-c: #1e6fa8; --grp-stress-c: #b8791a; --grp-hr-c: #e52e3a; --grp-rec-c: #1e8e5a; --grp-smo2-c: #5b4bb5; --grp-breath-c: #1b8a8f;
  --st-thb: #101820; --st-desat: #1e6fa8; --st-vent: #1e8e5a; --st-hr: #e52e3a; --st-bad: #c8202c; --st-cheap: #1e8e5a;
  --zone-text-0: #ffffff; --zone-text-1: #ffffff; --zone-text-2: #ffffff; --zone-text-3: #ffffff; --zone-text-4: #ffffff;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101820; --panel: #1a222b; --text: #ffffff; --muted: #8a8b8f; --line: #2a343d;
  --accent: #ffffff; --accent-text: #101820; --danger: #ff6b75;
  --over: #ff7480; --over-bg: #3a1c21; --low: #6bb2e0; --low-bg: #16293a;
  --ok: #4cc791; --ok-bg: #153127; --warn: #e3aa4f; --warn-bg: #33270f; --neutral-bg: #232d37;
  --info: #6bb2e0; --info-bg: #16293a;
  --chart-line: #bbbabc; --chart-grid: #2a343d; --chart-bout: rgba(255, 255, 255, .10);
  --z0: #5aa6da; --z1: #4cc791; --z2: #e3aa4f; --z3: #e52e3a; --z4: #a08cf2;
  --grp-climb-c: #8a8b8f; --grp-load-c: #5aa6da; --grp-stress-c: #e3aa4f; --grp-hr-c: #e5636d; --grp-rec-c: #4cc791; --grp-smo2-c: #a08cf2; --grp-breath-c: #4fc3c7;
  --st-thb: #ffffff; --st-desat: #6bb2e0; --st-vent: #4cc791; --st-hr: #e52e3a; --st-bad: #ff7480; --st-cheap: #4cc791;
  --zone-text-0: #0f142c; --zone-text-1: #0f142c; --zone-text-2: #0f142c; --zone-text-3: #ffffff; --zone-text-4: #0f142c;
}

/* ---- type ---- */
body { font-family: var(--font-body); font-size: 14px; line-height: 1.5; background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
h1, h2, h3, .big, .card .value, .stat .v, .epg-card .v, .lt-state { font-family: var(--font-display); }
h1 { font-size: 28px; line-height: 36px; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; margin: 0 0 6px; }
h2 { font-size: 18px; line-height: 24px; font-weight: 700; margin: 0 0 12px; }
h3 { font-size: 14px; font-weight: 700; margin: 0 0 6px; }
.muted, .small { font-variant-numeric: tabular-nums; }
table, .card .value, .big { font-variant-numeric: tabular-nums; }
a { color: var(--text); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
code { border-radius: 3px; }

/* ---- header: Carbon Black bar, like coros.com ---- */
.topbar { height: 64px; padding: 0 24px; gap: 36px; background: #101820; border-bottom: 0; }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; font-family: var(--font-display); font-weight: 900; font-size: 15px; letter-spacing: .12em; text-transform: uppercase; }
.brand::before { content: "COROS logo"; display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border: 1px dashed #8a8b8f; border-radius: 3px;
  color: #bbbabc; font-family: var(--font-body); font-weight: 500; font-size: 10px; letter-spacing: .06em; text-transform: none; margin-right: 12px; }
.beta { background: transparent; color: #bbbabc; border: 1px solid #595960; border-radius: 3px; padding: 0 6px; letter-spacing: .1em; font-size: 10px; margin-left: 0; }
nav { gap: 0; align-self: stretch; }
nav a { display: flex; align-items: center; padding: 0 14px; border-radius: 0; color: #bbbabc; text-decoration: none; text-transform: uppercase; letter-spacing: .08em; font-size: 12px; font-weight: 600;
  border-bottom: 3px solid transparent; margin-top: 3px; }
nav a:hover { background: transparent; color: #fff; }
nav a.active { background: transparent; color: #fff; font-weight: 700; border-bottom-color: #e52e3a; }
.userbox .who, .userbox { color: #fff; }
.userbox button { background: transparent; color: #fff; border-color: #595960; }
.userbox button:hover:not(:disabled) { background: #282630; }
.viewbar { top: 64px; }
main { max-width: 1296px; padding: 36px 24px 72px; }

/* ---- containers: 6 px radius, nested containers 3 px ---- */
.panel, .card, .epg-card, .basis-box { border-radius: 6px; border-color: var(--line); background: var(--panel); }
.panel .card, .panel .panel, .panel .basis-box, .panel .stat, .panel .consent { border-radius: 3px; }
.panel.tint { background: var(--neutral-bg); }
.card .label, th, .st-legend, .stat .k, label.field { text-transform: uppercase; letter-spacing: .06em; font-size: 11px; font-weight: 600; }
label.field { text-transform: none; letter-spacing: 0; font-size: 12px; font-weight: 500; }
.card .value { font-size: 26px; font-weight: 700; letter-spacing: 0; }
.big { font-size: 36px; font-weight: 700; letter-spacing: 0; }
.stat .v { font-weight: 700; }
th { color: var(--muted); }
tbody tr:hover { background: var(--neutral-bg); }

/* ---- controls ---- */
input[type=text], input[type=number], input[type=password], select, textarea { background: var(--bg); border-radius: 3px; border-color: var(--line); }
button, a.btn { border-radius: 3px; background: var(--bg); font-weight: 600; border-color: var(--line); }
button:hover:not(:disabled), a.btn:hover { background: var(--neutral-bg); }
button.primary, a.btn.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
button.primary:hover:not(:disabled), a.btn.primary:hover { background: var(--carbon-90); filter: none; }
:root[data-theme="dark"] button.primary:hover:not(:disabled), :root[data-theme="dark"] a.btn.primary:hover { background: var(--carbon-30); }
button.danger { color: var(--over); }
button.link { background: none; color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
input:focus, select:focus, button:focus-visible, a:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.seg { border-radius: 3px; }
.seg button.on { background: var(--accent); color: var(--accent-text); }
.tabs a.active { color: var(--text); border-bottom-color: var(--coros-red); border-bottom-width: 3px; }
.tabs a { font-weight: 600; }
.badge, .chip, .lt-state, .conf { border-radius: 3px; }
.zone { border-radius: 3px; color: #fff; font-weight: 600; }
.zone.z0 { color: var(--zone-text-0); } .zone.z1 { color: var(--zone-text-1); } .zone.z2 { color: var(--zone-text-2); } .zone.z3 { color: var(--zone-text-3); } .zone.z4 { color: var(--zone-text-4); }
.zonebar { border-radius: 3px; }
.steps li a { border-radius: 3px; } .steps li .n { border-radius: 3px; }
.notice { border-radius: 3px; border-left-color: var(--carbon-70); background: var(--neutral-bg); }
.notice.info { border-left-color: var(--info); background: var(--info-bg); } .notice.ok { border-left-color: var(--ok); background: var(--ok-bg); } .notice.warn { border-left-color: var(--warn); background: var(--warn-bg); }
.modal { border-radius: 6px; box-shadow: none; border-color: var(--carbon-30); }
.overlay { background: rgba(16, 24, 32, .62); }
.toast { border-radius: 3px; background: var(--coros-carbon); color: #fff; box-shadow: none; }
:root[data-theme="dark"] .toast { background: #fff; color: #101820; }
.toast.error { background: var(--coros-red); color: #fff; }

/* ---- charts: heart rate stays brand red; other sensors use the documented status hues, always labelled ---- */
svg.chart .bout { fill: var(--chart-bout); stroke: var(--carbon-70); }
svg.chart .bout-label { fill: var(--text); }
svg.chart .pt, svg.chart .trend { fill: var(--text); stroke: var(--carbon-50); }
svg.chart .trend { fill: none; }
svg.chart .smo2-trace, svg.chart .smo2 { stroke: #1e6fa8; } svg.chart text.smo2-axis { fill: #1e6fa8; } .key-purple { color: #1e6fa8; }
svg.chart .breath-trace { stroke: #1e8e5a; } svg.chart text.breath-axis { fill: #1e8e5a; } .key-teal { color: #1e8e5a; }
svg.chart .lt-dot { stroke: var(--panel); }
.legend i, .st-legend i { border-radius: 2px; }
.steps li.on a { border-color: var(--coros-red); }
.epg-card.current, .basis-box.active { border-color: var(--text); box-shadow: none; }
nav a { white-space: nowrap; }
input[type=file]::file-selector-button { border: 1px solid var(--line); background: var(--bg); color: var(--text); border-radius: 3px; padding: 4px 10px; margin-right: 8px; font: inherit; font-weight: 600; cursor: pointer; }

/* ---- COROS logo: supplied horizontal lockup, used unaltered (/static/brand/coros-logo-horizontal-white.png). The wordmark is white, so
   dark backgrounds only. 32 px high in a 64 px header leaves 16 px above and below, the VI guide's clear space (50% of the logo's height). ---- */
.brand::before { content: ""; display: block; border: 0; border-radius: 0; padding: 0; margin-right: 20px; width: 126px; height: 32px;
  background: url("/static/brand/coros-logo-horizontal-white.png") center / contain no-repeat; }

/* Per-climb table: every group of columns is its own coloured block. The group heading has a coloured band and tint, the column headings a lighter tint,
   and a divider in the group's colour runs down the whole table before each group, so Load, Stress, Heart rate, Recovery, Muscle oxygen and Breathing
   are easy to tell apart. Colours are internal-tool extension colours (not brand colours), one per group. */
.grp-climb { --grp: var(--grp-climb-c); } .grp-load { --grp: var(--grp-load-c); } .grp-stress { --grp: var(--grp-stress-c); }
.grp-hr { --grp: var(--grp-hr-c); } .grp-rec { --grp: var(--grp-rec-c); } .grp-smo2 { --grp: var(--grp-smo2-c); } .grp-breath { --grp: var(--grp-breath-c); }
.bout-scroll th.group { border-top: 4px solid var(--grp); border-bottom: 1px solid var(--grp); font-weight: 700; letter-spacing: .02em; color: var(--text); }
.bout-scroll th.group:not(.frz-group) { background: color-mix(in srgb, var(--grp) 22%, var(--panel)); }
.bout-scroll thead tr:nth-child(2) th:not(.frz) { background: color-mix(in srgb, var(--grp) 9%, var(--panel)); border-bottom: 2px solid var(--grp); }
.bout-scroll th.grp-start, .bout-scroll td.grp-start { border-left: 3px solid var(--grp); }
/* The "Climb" heading spans six columns but only # and Grade stay frozen: left sticky it covered the next group's heading as the table scrolled sideways, so it scrolls away with its columns */
.bout-scroll th.group.frz-group { position: static; }
