:root { color-scheme: light; --ink: #19364a; --muted: #526878; --paper: #edf2f6; --blue: #096aab; --line: #d5e0e8; --amber: #80521c; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.55 Avenir, "Segoe UI", sans-serif; }
.brand { color: var(--ink); text-decoration: none; font-size: 24px; font-weight: 800; letter-spacing: -.8px; }
header span, .hint, .section-heading span, #owner { color: var(--muted); }
h1 { font-size: clamp(32px, 4vw, 52px); line-height: 1.12; letter-spacing: -1.7px; margin: 0 0 16px; font-weight: 700; }
h2 { font-size: 23px; letter-spacing: -.4px; margin: 0 0 12px; }
p { max-width: 72ch; margin: 8px 0 20px; }
.access { display: grid; grid-template-columns: 1.15fr 1fr; gap: 80px; align-items: center; min-height: 58vh; }
.access form { background: #fff; padding: 32px; border: 1px solid var(--line); border-radius: 12px; }
label { display: block; margin-bottom: 8px; font-weight: 600; }
input { width: 100%; padding: 12px; border: 1px solid #7894a8; border-radius: 5px; font: inherit; background: #fff; color: var(--ink); }
button { font: inherit; font-weight: 600; padding: 10px 18px; border-radius: 5px; border: 1px solid var(--blue); background: var(--blue); color: #fff; cursor: pointer; min-height: 44px; }
button:hover { filter: brightness(.93); }
button:disabled { cursor: wait; opacity: .65; }
.secondary { background: #fff; color: var(--blue); }
:focus-visible { outline: 3px solid #bf6418; outline-offset: 4px; }
.hint { font-size: 14px; }
.actions, .heading, .section-heading, .connection { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.actions { flex-wrap: wrap; }
.coverage { background: #fff4e3; color: #63451d; border-left: 5px solid #c88935; padding: 18px 22px; margin: 24px 0 36px; }
.coverage p { margin: 4px 0 0; }
section { margin-bottom: 36px; }
.connection { background: #fff; border-bottom: 1px solid var(--line); padding: 20px; }
.connection strong { display: block; }
.connection small { color: var(--muted); display: block; overflow-wrap: anywhere; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: #fff; font-size: 14px; text-align: left; }
th { background: #e7f0f6; font-weight: 600; }
th, td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
td { max-width: 35ch; overflow-wrap: anywhere; }
.empty { background: #edf3f7; padding: 22px; color: var(--muted); }
#notice:not(:empty) { padding: 14px 18px; border: 1px solid #bf6418; background: #fff8ee; }
#more { margin-top: 16px; }
footer { border-top: 1px solid var(--line); padding: 24px; text-align: center; color: var(--muted); font-size: 14px; }
[hidden] { display: none !important; }
@media (max-width: 760px) { header span { display: none; } main { padding-top: 28px; } .access { grid-template-columns: 1fr; gap: 24px; } .access form { padding: 24px; } .heading { align-items: flex-start; flex-direction: column; } .connection { align-items: flex-start; flex-direction: column; } h1 { letter-spacing: -1px; } }
/* Sporting timelines inherit the existing blue identity; discipline colors identify data. */
:root { --run: #087ba2; --ride: #865bb4; --swim: #137f70; --other: #927024; }
select { width: 100%; min-height: 46px; padding: 10px; font: inherit; background: #fff; color: var(--ink); border: 1px solid #7894a8; border-radius: 5px; }
h3 { font-size: 18px; line-height: 1.35; margin: 0 0 12px; }
.analysis-intro { max-width: 760px; margin-bottom: 24px; }
.analysis-intro h2 { font-size: 32px; }
#analytics-account { max-width: 640px; }
#analytics-status { font-size: 14px; color: var(--muted); padding: 16px 0; overflow-wrap: anywhere; }
.analysis-filters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; background: #e7f0f6; padding: 22px; border-radius: 8px; margin: 4px 0 28px; }
.analysis-filters label, .effort-selectors label { font-size: 14px; }
.analysis-filters > .actions, .comparison-filters { grid-column: 1 / -1; }
.filter-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 18px; }
summary { cursor: pointer; font-weight: 600; min-height: 36px; padding: 5px 0; }
details { margin: 12px 0; min-width: 0; }
caption { text-align: left; font-weight: 600; padding: 12px 0; }
.sport-summaries { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; margin-bottom: 44px; }
.sport-summary { border-top: 4px solid var(--line); padding: 16px 0 0; }
.sport-summary.run { border-color: var(--run); }.sport-summary.ride { border-color: var(--ride); }.sport-summary.swim { border-color: var(--swim); }.sport-summary.other { border-color: var(--other); }
.summary-value { font-size: 27px; font-weight: 650; margin-bottom: 6px; }
.effort-selectors { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin: 22px 0; }
.chart-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 28px; }
.chart-grid > details { grid-column: 1 / -1; }
.plot-panel { min-width: 0; padding: 20px 0 14px; border-top: 1px solid var(--line); }
.plot-panel svg { display: block; width: 100%; height: auto; background: #fff; border-radius: 6px; }
.plot-panel .hint { min-height: 44px; }
.grid-line { stroke: #d9e5ed; stroke-width: 1; }
.axis-label { fill: #4c6475; font-family: Avenir, "Segoe UI", sans-serif; font-size: 18px; font-variant-numeric: tabular-nums; }
.mark { opacity: .85; }.mark.run, .mark.cool-temp { fill: var(--run); }.mark.ride { fill: var(--ride); }.mark.swim { fill: var(--swim); }.mark.other, .mark.mild-temp { fill: var(--other); }.mark.hot-temp { fill: #c34c3c; }.mark.unknown-temp { fill: #7d8791; }.mark.rolling { fill: #163b56; stroke: white; stroke-width: 1; opacity: 1; }
#analytics-content > section { margin-bottom: 52px; }
@media (max-width: 760px) { .analysis-filters, .filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .sport-summaries { grid-template-columns: repeat(2, minmax(0, 1fr)); } .chart-grid { grid-template-columns: 1fr; } .effort-selectors { grid-template-columns: 1fr; gap: 10px; } .analysis-filters { padding: 16px; } .summary-value { font-size: 23px; } }
@media (max-width: 420px) { .analysis-filters, .filter-grid { grid-template-columns: 1fr; } }

@media (max-width: 480px) { .axis-label { font-size: 24px; } }

/* Training is the first visual anchor; navigation and explanatory copy stay secondary. */
.workspace-main { min-width: 0; }
.analysis-navigation { margin: 4px 0 8px 24px; border-left: 1px solid var(--line); padding-left: 12px; }
.analysis-navigation button { font-size: 14px; }
#workspace-title { font-size: clamp(24px, 3vw, 34px); letter-spacing: -.6px; margin: 0; }
.workspace-main > .heading { margin-bottom: 12px; }
.account-selection { display: flex; align-items: center; gap: 12px; margin: 0 0 10px; }
.account-selection label { font-size: 13px; margin: 0; }
#analytics-account { width: auto; max-width: 100%; min-width: 180px; min-height: 38px; padding: 6px 10px; font-size: 14px; }
#overview-status, #analytics-status { font-size: 12px; padding: 0; margin: 4px 0 20px; }
.timeline-period { padding: 28px 32px; background: #fff; border: 1px solid var(--line); border-radius: 16px; margin-bottom: 32px; box-shadow: 0 5px 18px #19364a06; }
.timeline-heading { display: flex; align-items: start; justify-content: space-between; gap: 16px; }
.timeline-heading h2 { margin-bottom: 4px; font-size: 27px; letter-spacing: -.8px; }
.timeline-heading p { margin: 0 0 16px; }
.timeline-controls { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.timeline-controls > div { flex: 0 1 230px; }
.timeline-controls label { font-size: 12px; margin-bottom: 3px; }
.timeline-controls select { font-size: 14px; padding: 6px 10px; min-height: 40px; }
.timeline-legend { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 8px; }
.series-toggle { border: 1px solid var(--line); background: #fff; color: var(--ink); padding: 6px 10px; min-height: 40px; font-size: 13px; }
.series-toggle::before { content: ""; display: inline-block; width: 8px; height: 8px; background: var(--series-color); border-radius: 50%; margin-right: 7px; }
.series-toggle[aria-pressed="true"] { background: #edf4f8; border-color: #9fb8c9; }
.series-toggle[aria-pressed="false"] { color: var(--muted); text-decoration: line-through; }
.series-toggle:disabled { cursor: default; }
.load { --series-color: #6c8fa9; }.fitness { --series-color: #166aa5; }.form { --series-color: #25785b; }.fatigue { --series-color: #9e5795; }.hours { --series-color: #9c5d12; }
.hrv { --series-color: #137f70; }.resting_hr { --series-color: #9b5475; }.mean { --series-color: #183b56; }
.timeline-main svg, .recovery-strip svg { width: 100%; height: auto; display: block; }
.timeline-axis { fill: var(--muted); font: 14px Avenir, "Segoe UI", sans-serif; font-variant-numeric: tabular-nums; }
.timeline-bar { fill: var(--series-color); opacity: .24; }
.timeline-line { stroke: var(--series-color); fill: none; stroke-width: 2.5; }
.timeline-line.hours, .timeline-line.mean { stroke-dasharray: 7 5; }
.timeline-dot { fill: var(--series-color); }
.timeline-zero { stroke: #708695; stroke-width: 1.2; }
.timeline-cursor { stroke: #708695; stroke-dasharray: 3 4; pointer-events: none; }
.timeline-main { margin-bottom: 20px; }
.timeline-empty { margin: 4px 0 12px; font-size: 13px; color: var(--muted); }
.timeline-period > h3 { margin: 8px 0 4px; }
.timeline-period > .hint { font-size: 12px; margin: 0 0 12px; max-width: 100%; }
.recovery-strip { margin: 0 0 10px; }
.recovery-strip h3 { font-size: 13px; margin: 0; }
.timeline-day { background: #eef4f7; border-radius: 10px; padding: 22px; margin-top: 20px; border-left: 3px solid #7b9eb5; }
.timeline-day h3 { font-size: 16px; margin: 0 0 12px; }
.day-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px 18px; margin: 0; }
.day-metric dt { font-size: 13px; color: var(--muted); }
.day-metric dd { font-size: 24px; letter-spacing: -.5px; margin: 0; font-weight: 650; font-variant-numeric: tabular-nums; }
.day-metric small { display: block; font-size: 11px; color: var(--muted); }
.timeline-day p { margin: 12px 0 0; }
.timeline-help, .reading-notes { font-size: 13px; }
.timeline-help p { margin: 8px 0; }
.timeline-period > details { margin-bottom: 0; }
.timeline-period > details > summary { font-size: 13px; }
.overview-aggregates { margin-top: 48px; }
.overview-aggregates > .summary-section { background: #fff; padding: 24px; border-radius: 12px; }
.summary-section { margin-bottom: 26px; }
.summary-section h3 { font-size: 17px; }
.period-comparison { table-layout: fixed; }
.period-comparison th:first-child { width: 38%; }
.period-comparison thead th:not(:first-child), .period-comparison td { text-align: right; }
.period-comparison tbody th { font-weight: 500; background: #fff; }
.period-comparison strong { display: block; font-size: 21px; font-variant-numeric: tabular-nums; }
.period-comparison small { display: block; color: var(--muted); font-size: 11px; }
.sport-comparison-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.sport-comparison { border-top: 3px solid var(--run); padding-top: 12px; min-width: 0; }
.sport-comparison.ride { border-color: var(--ride); }.sport-comparison.swim { border-color: var(--swim); }.sport-comparison.other { border-color: var(--other); }
.sport-comparison .summary-section { margin: 0; }
.sport-comparison th, .sport-comparison td { padding: 8px; font-size: 12px; }
.sport-comparison .period-comparison strong { font-size: 18px; }
.sport-comparison .hint { font-size: 12px; margin: 8px 0 20px; }
.plot-panel > .hint { min-height: 0; }
@media (max-width: 1100px) {
  .sport-comparison-grid { grid-template-columns: 1fr; }
  .day-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .workspace-main > .heading { flex-direction: row; align-items: center; }
  .heading > button { font-size: 12px; padding: 8px; }
  .timeline-period { padding: 16px 10px; border-radius: 8px; }
  .timeline-heading, .timeline-controls, .timeline-legend { padding: 0 4px; }
  .timeline-controls > div { flex: 1 1 130px; }
  .timeline-controls select { font-size: 12px; }
  .timeline-axis { font-size: 16px; }
  .day-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .day-metric dd { font-size: 18px; }
  .timeline-day { padding: 12px; }
  .timeline-legend { gap: 4px; }
  .series-toggle { font-size: 12px; min-height: 44px; padding: 6px 8px; }
  .period-comparison th, .period-comparison td { padding: 10px 6px; font-size: 12px; }
  .period-comparison strong { font-size: 18px; }
  #analytics-account { min-width: 0; flex: 1; }
  .timeline-main { overflow-x: auto; }
  .timeline-main svg, .recovery-strip svg { min-height: 100px; }
}

/* The drawer leaves the entire workspace to the athlete's timelines. */
main { max-width: 1360px; margin: auto; padding: 28px 32px; min-height: 80vh; }
.app-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 32px; background: #163b56; color: #fff; }
.app-header .brand { display: inline-flex; align-items: center; gap: 12px; color: #fff; font-size: 22px; }
.app-header > span { color: #c9dce8; font-size: 14px; }
.brand-symbol { width: 32px; height: 32px; fill: none; stroke: #81c5df; stroke-width: 2.5; stroke-linecap: round; }
#workspace { display: block; }
.page-heading { display: flex; align-items: center; gap: 16px; min-width: 0; }
.workspace-heading { padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.icon-button { display: inline-flex; flex: 0 0 44px; width: 44px; height: 44px; align-items: center; justify-content: center; padding: 10px; background: #fff; color: var(--ink); border: 1px solid var(--line); border-radius: 10px; }
.icon-button svg, .workspace-nav svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.navigation-drawer { position: fixed; inset: 0 auto 0 0; width: min(340px, calc(100vw - 32px)); height: 100dvh; max-height: 100dvh; max-width: none; margin: 0; padding: 0; border: 0; border-radius: 0 20px 20px 0; background: #fff; color: var(--ink); box-shadow: 12px 0 60px #163b5633; }
.navigation-drawer::backdrop { background: #102c4566; backdrop-filter: blur(3px); }
body:has(.navigation-drawer[open]) { overflow: hidden; }
.drawer-content { display: flex; flex-direction: column; min-height: 100%; padding: 28px 20px 20px; }
.drawer-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 28px; }
.drawer-heading h2 { margin: 0; font-size: 23px; }
.workspace-nav { display: flex; flex-direction: column; gap: 6px; }
.navigation-label { margin: 0 12px 8px; font-size: 12px; font-weight: 600; color: var(--muted); }
.workspace-nav button { display: flex; align-items: center; gap: 12px; text-align: left; width: 100%; min-height: 48px; border: 0; border-radius: 8px; padding: 12px; background: transparent; color: var(--ink); line-height: 1.4; }
.workspace-nav button:hover { background: #edf4f8; filter: none; }
.workspace-nav button[aria-pressed="true"] { background: #e3eff7; color: #075e96; box-shadow: inset 3px 0 #096aab; }
.analysis-navigation button { min-height: 44px; }
.navigation-management { margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--line); }
.drawer-account { margin-top: auto; padding: 32px 12px 0; }
#owner { font-size: 12px; overflow-wrap: anywhere; color: var(--muted); margin-bottom: 12px; }
.drawer-account button { width: 100%; }
#refresh { border-color: var(--line); border-radius: 8px; }
.account-selection { padding: 4px 0; }
#overview-status, #analytics-status { line-height: 1.6; }
.reading-notes > summary, .timeline-period > details > summary { color: #285d7e; }
@media (prefers-reduced-motion: no-preference) {
  .navigation-drawer[open] { animation: drawer-enter 180ms ease-out; }
  @keyframes drawer-enter { from { transform: translateX(-100%); } to { transform: translateX(0); } }
}
@media (max-width: 760px) {
  main { padding: 20px 16px; }
  .app-header { padding: 14px 20px; }
  .app-header .brand { font-size: 20px; }
  .page-heading { gap: 10px; }
  #workspace-title { overflow-wrap: anywhere; }
  .workspace-heading { gap: 10px; }
  #refresh { max-width: 105px; }
  .timeline-heading h2 { font-size: 24px; }
  .overview-aggregates > .summary-section { padding: 16px 10px; }
  .drawer-content { padding-top: 20px; }
}
