:root {
  color-scheme: dark;
  --bg: #0b1413;
  --surface: rgba(23, 38, 35, 0.82);
  --line: rgba(192, 222, 210, 0.12);
  --line-strong: rgba(192, 222, 210, 0.2);
  --text: #f1f6f3;
  --muted: #91a59e;
  --soft: #c7d5d0;
  --mint: #8cdbb7;
  --mint-bright: #b1f1ce;
  --lime: #d5e99a;
  --amber: #e8c879;
  --rose: #e58d87;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.28);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 4%, rgba(93, 158, 128, .13), transparent 30rem),
    radial-gradient(circle at 92% 16%, rgba(176, 205, 132, .08), transparent 26rem),
    var(--bg);
  overflow-x: hidden;
}
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }

.ambient { position: fixed; border-radius: 999px; filter: blur(80px); opacity: .08; pointer-events: none; }
.ambient-one { width: 22rem; height: 22rem; background: var(--mint); top: 35%; left: -16rem; }
.ambient-two { width: 18rem; height: 18rem; background: var(--lime); top: 5%; right: -13rem; }
.shell { width: min(1180px, calc(100% - 40px)); margin-inline: auto; position: relative; z-index: 1; }

.site-header { height: 88px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; }
.brand-mark { display: block; width: 40px; height: 40px; object-fit: cover; border: 1px solid var(--line-strong); border-radius: 13px; background: #edf1eb; }
.brand > span:last-child { display: grid; line-height: 1.04; }
.brand strong { font-size: 16px; letter-spacing: .01em; }
.brand small { color: var(--muted); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; margin-top: 3px; }
.account-actions { display: flex; align-items: center; gap: 8px; }
.account-chip { display: flex; align-items: center; gap: 9px; padding: 8px 12px 8px 9px; background: rgba(255,255,255,.035); border: 1px solid var(--line); border-radius: 999px; color: var(--soft); font-size: 13px; }
.account-chip img { width: 27px; height: 27px; object-fit: cover; border-radius: 50%; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 4px rgba(140,219,183,.1); }
.disconnect-button { display: inline-flex; align-items: center; gap: 7px; min-height: 37px; padding: 0 11px; color: var(--rose); background: rgba(229,141,135,.035); border: 1px solid rgba(229,141,135,.2); border-radius: 10px; cursor: pointer; font-size: 11px; font-weight: 650; }
.disconnect-button:hover { color: #f2aaa4; background: rgba(229,141,135,.08); }
.disconnect-button:disabled { opacity: .5; cursor: wait; }
.disconnect-button svg { width: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.state-screen { min-height: calc(100vh - 88px); display: grid; place-items: center; align-content: center; text-align: center; color: var(--muted); }
.loader-mark { width: 42px; height: 42px; border: 2px solid var(--line-strong); border-top-color: var(--mint); border-radius: 50%; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.connect-screen { max-width: 1080px; padding: 3vh 0 80px; }
.eyebrow, .section-kicker, .guidance-kicker { color: var(--mint); font-size: 11px; line-height: 1; font-weight: 700; text-transform: uppercase; letter-spacing: .19em; }
.eyebrow { display: flex; align-items: center; gap: 10px; margin: 0 0 22px; }
.eyebrow span { width: 28px; height: 1px; background: var(--mint); }
.connect-screen h1 { max-width: 780px; margin: 0; font-size: clamp(48px, 6.5vw, 72px); line-height: .96; letter-spacing: -.062em; font-weight: 640; }
.connect-screen h1 em { color: var(--mint); font-family: Georgia, "Times New Roman", serif; font-weight: 400; }
.connect-lead { max-width: 610px; margin: 18px 0 0; color: var(--soft); font-size: clamp(16px, 1.8vw, 19px); line-height: 1.5; }
.time-note { display: inline-flex; gap: 5px; margin-top: 14px; padding: 8px 11px; color: var(--muted); background: rgba(255,255,255,.025); border: 1px solid var(--line); border-radius: 999px; font-size: 11px; }
.time-note strong { color: var(--soft); }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 14px; min-height: 50px; padding: 0 20px; border: 0; border-radius: 12px; cursor: pointer; text-decoration: none; font-weight: 700; transition: transform .18s ease, background .18s ease; }
.button:hover { transform: translateY(-1px); }
.button-primary { color: #0b1713; background: var(--mint-bright); box-shadow: 0 10px 32px rgba(140,219,183,.12); }
.setup-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 0; margin: 34px 0 0; list-style: none; counter-reset: setup; }
.setup-step { min-width: 0; min-height: 285px; padding: 22px; background: rgba(18,32,29,.72); border: 1px solid var(--line); border-radius: 20px; }
.setup-step:first-child { background: rgba(18,32,29,.5); }
.setup-step.tracker-step { background: linear-gradient(145deg, rgba(29,49,43,.9), rgba(18,32,29,.76)); }
.setup-step.connect-final { background: linear-gradient(145deg, rgba(140,219,183,.13), rgba(18,32,29,.82)); border-color: rgba(140,219,183,.2); }
.step-number { display: grid; place-items: center; width: 29px; height: 29px; color: var(--mint); background: rgba(140,219,183,.08); border: 1px solid rgba(140,219,183,.17); border-radius: 50%; font-size: 11px; font-weight: 800; }
.step-copy { display: flex; min-height: 215px; flex-direction: column; align-items: flex-start; }
.step-kicker { margin-top: 18px; color: var(--mint); font-size: 9px; line-height: 1; font-weight: 750; text-transform: uppercase; letter-spacing: .16em; }
.step-copy h2 { margin: 9px 0 0; font-size: 22px; line-height: 1.12; letter-spacing: -.035em; }
.step-copy p { margin: 13px 0 18px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.step-copy p strong { color: var(--soft); font-weight: 650; }
.step-links { display: flex; gap: 16px; margin-top: auto; }
.text-link { color: var(--mint-bright); font-size: 11px; font-weight: 700; text-decoration: none; }
.text-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.text-link.quiet-link { color: var(--muted); }
.device-list { display: flex; flex-wrap: wrap; gap: 5px; margin: -1px 0 18px; }
.device-list span { padding: 5px 7px; color: var(--soft); background: rgba(255,255,255,.035); border: 1px solid var(--line); border-radius: 6px; font-size: 9px; line-height: 1; }
.button-secondary { min-height: 42px; margin-top: auto; padding-inline: 14px; color: var(--soft); background: rgba(255,255,255,.045); border: 1px solid var(--line-strong); font-size: 11px; }
.connect-final .button-primary { width: 100%; margin-top: auto; }
.onboarding-footnote { display: flex; align-items: center; justify-content: space-between; gap: 30px; margin-top: 19px; }
.mini-signals { display: flex; flex-wrap: wrap; gap: 17px; color: var(--muted); font-size: 10px; }
.mini-signals span { white-space: nowrap; }
.privacy-note { margin: 0; color: #6f827c; font-size: 10px; text-align: right; }

.error-screen { max-width: 560px; margin-inline: auto; }
.error-screen h1 { margin: 18px 0 10px; color: var(--text); font-size: 30px; letter-spacing: -.03em; }
.error-screen p { margin: 0 0 24px; }
.error-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: rgba(229,141,135,.12); color: var(--rose); font-weight: 800; }

.dashboard { padding: 52px 0 60px; }
.dashboard-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 30px; }
.dashboard-heading .eyebrow { margin-bottom: 12px; }
.dashboard-heading h1 { margin: 0; font-size: clamp(34px, 5vw, 58px); line-height: 1; letter-spacing: -.052em; font-weight: 620; }
.updated-label { margin: 12px 0 0; color: var(--muted); font-size: 12px; }
.icon-button { display: grid; place-items: center; width: 43px; height: 43px; color: var(--soft); background: rgba(255,255,255,.035); border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.icon-button:hover { background: rgba(255,255,255,.06); }
.icon-button:disabled { opacity: .45; cursor: wait; }
.icon-button svg { width: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.dashboard-loading { min-height: 520px; }
.dashboard-loading > p { color: var(--muted); text-align: center; font-size: 12px; }
.skeleton { min-height: 150px; border-radius: 22px; background: linear-gradient(110deg, rgba(255,255,255,.025) 8%, rgba(255,255,255,.06) 18%, rgba(255,255,255,.025) 33%); background-size: 200% 100%; animation: shimmer 1.5s linear infinite; border: 1px solid var(--line); }
.skeleton-hero { min-height: 260px; }
.skeleton-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 16px 0; }
@keyframes shimmer { to { background-position-x: -200%; } }

.hero-card { display: grid; grid-template-columns: 1.05fr .95fr; min-height: 262px; border: 1px solid var(--line); border-radius: 26px; overflow: hidden; background: linear-gradient(135deg, rgba(27,46,41,.92), rgba(15,29,26,.92)); box-shadow: var(--shadow); }
.score-wrap { display: flex; align-items: center; gap: clamp(22px, 4vw, 42px); padding: clamp(28px, 5vw, 54px); }
.score-ring { --ring-color: var(--mint); flex: 0 0 auto; display: grid; place-items: center; width: 150px; aspect-ratio: 1; border-radius: 50%; background: conic-gradient(var(--ring-color) calc(var(--score) * 1%), rgba(255,255,255,.075) 0); position: relative; box-shadow: 0 0 50px rgba(140,219,183,.07); }
.score-ring::before { content: ""; position: absolute; inset: 8px; border-radius: inherit; background: #13231f; }
.score-ring[data-tone="caution"] { --ring-color: var(--amber); }
.score-ring[data-tone="strained"] { --ring-color: var(--rose); }
.score-inner { position: relative; display: grid; text-align: center; }
.score-inner strong { font-size: 49px; line-height: 1; letter-spacing: -.06em; }
.score-inner span { margin-top: 5px; color: var(--muted); font-size: 10px; }
.score-copy p { margin: 0 0 8px; color: var(--muted); font-size: 12px; }
.score-copy h2 { margin: 0 0 8px; font-size: clamp(25px, 3vw, 36px); letter-spacing: -.04em; }
.score-copy > span { display: block; max-width: 260px; color: var(--soft); font-size: 12px; line-height: 1.55; }
.info-dot { width: 17px; height: 17px; padding: 0; color: var(--muted); background: transparent; border: 1px solid var(--line-strong); border-radius: 50%; font-size: 10px; cursor: help; }
.guidance-card { display: flex; flex-direction: column; justify-content: center; padding: clamp(28px, 5vw, 52px); background: linear-gradient(145deg, rgba(143,218,183,.12), rgba(143,218,183,.025)); border-left: 1px solid var(--line); }
.guidance-card h2 { max-width: 480px; margin: 13px 0 12px; font-size: clamp(21px, 2.5vw, 30px); line-height: 1.22; letter-spacing: -.034em; font-weight: 560; }
.guidance-card p { max-width: 500px; margin: 0; color: var(--soft); font-size: 13px; line-height: 1.6; }

.injury-alert { display: flex; align-items: center; gap: 14px; padding: 15px 18px; margin-top: 16px; color: #f2d6d2; background: rgba(229,141,135,.08); border: 1px solid rgba(229,141,135,.2); border-radius: 14px; }
.injury-alert > span { display: grid; place-items: center; flex: 0 0 auto; width: 28px; height: 28px; border-radius: 50%; background: rgba(229,141,135,.15); color: var(--rose); font-weight: 800; }
.injury-alert p { margin: 0; font-size: 12px; line-height: 1.5; }

.section-block { margin-top: 46px; }
.section-heading, .panel-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.section-heading h2, .panel-heading h2 { margin: 8px 0 0; font-size: 24px; letter-spacing: -.035em; }
.mode-badge, .form-chip { padding: 7px 10px; color: var(--mint); background: rgba(140,219,183,.07); border: 1px solid rgba(140,219,183,.15); border-radius: 999px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 17px; }
.metric-card { min-width: 0; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; backdrop-filter: blur(14px); }
.metric-icon { display: grid; place-items: center; width: 34px; height: 34px; margin-bottom: 20px; border-radius: 10px; color: var(--mint); background: rgba(140,219,183,.09); font-size: 17px; }
.sleep-icon { color: var(--lime); background: rgba(213,233,154,.08); }
.heart-icon { color: var(--rose); background: rgba(229,141,135,.08); }
.load-icon { color: var(--amber); background: rgba(232,200,121,.08); }
.metric-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--soft); font-size: 11px; }
.metric-label small { color: var(--muted); font-size: 9px; }
.metric-card > strong { display: block; margin: 11px 0 13px; font-size: clamp(26px, 3vw, 34px); letter-spacing: -.045em; white-space: nowrap; }
.meter, .load-track { height: 4px; background: rgba(255,255,255,.07); border-radius: 999px; overflow: hidden; }
.meter span, .load-track span { display: block; width: 0; height: 100%; background: var(--lime); border-radius: inherit; transition: width .7s ease; }
.metric-change { color: var(--muted); font-size: 10px; }
.metric-change.positive, .trend-summary.positive { color: var(--mint); }

.history-section { margin-top: 48px; }
.history-heading { align-items: center; }
.history-tabs { display: flex; gap: 6px; margin-top: 18px; overflow-x: auto; scrollbar-width: none; }
.history-tabs::-webkit-scrollbar { display: none; }
.history-tab { flex: 0 0 auto; padding: 9px 13px; color: var(--muted); background: transparent; border: 1px solid transparent; border-radius: 999px; cursor: pointer; font-size: 11px; font-weight: 650; }
.history-tab:hover { color: var(--soft); background: rgba(255,255,255,.025); }
.history-tab.active { color: #102019; background: var(--mint-bright); border-color: var(--mint-bright); }
.history-panel { min-height: 390px; margin-top: 10px; padding: 0; overflow: hidden; }
.history-summary { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--line); }
.history-summary > div { min-width: 0; padding: 19px 22px; border-right: 1px solid var(--line); }
.history-summary > div:last-child { border-right: 0; }
.history-summary span { display: block; color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .12em; }
.history-summary strong { display: block; margin-top: 7px; font-size: 20px; letter-spacing: -.035em; white-space: nowrap; }
.history-chart-wrap { display: grid; grid-template-columns: 48px 1fr; gap: 10px; padding: 25px 24px 0 13px; }
.history-scale { display: flex; flex-direction: column; justify-content: space-between; align-items: flex-end; padding: 2px 0 4px; color: #647870; font-size: 9px; }
.history-chart { height: 236px; }
.history-chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.history-grid { fill: none; stroke: rgba(255,255,255,.05); stroke-width: 1; vector-effect: non-scaling-stroke; }
.history-line { fill: none; stroke: var(--mint); stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.fitness-line { stroke: var(--mint); }
.fatigue-line { stroke: var(--amber); }
.history-axis { display: flex; justify-content: space-between; padding: 8px 24px 0 71px; color: #647870; font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.history-legend { display: flex; justify-content: center; gap: 22px; padding: 14px 24px 19px; color: var(--muted); font-size: 10px; }
.history-legend span { display: flex; align-items: center; gap: 7px; }
.history-legend i { width: 16px; height: 2px; background: var(--mint); border-radius: 99px; }
.history-legend .fatigue-key { background: var(--amber); }

.content-grid { display: grid; grid-template-columns: 1.35fr .65fr; gap: 12px; margin-top: 12px; }
.panel { min-width: 0; min-height: 310px; padding: 24px; background: rgba(18,32,29,.76); border: 1px solid var(--line); border-radius: 20px; }
.panel-heading { align-items: flex-start; }
.panel-heading h2 { font-size: 19px; }
.trend-summary { color: var(--rose); font-size: 13px; font-weight: 700; }
.chart { height: 190px; margin-top: 24px; }
.chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.grid-line { fill: none; stroke: rgba(255,255,255,.055); stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart-area { fill: url(#area-fill); }
.chart-line { fill: none; stroke: var(--mint); stroke-width: 2.4; vector-effect: non-scaling-stroke; }
.chart-point-halo { fill: rgba(140,219,183,.17); }
.chart-point { fill: var(--mint-bright); }
.chart-legend { display: flex; justify-content: space-between; color: #647870; font-size: 9px; text-transform: uppercase; letter-spacing: .11em; }
.empty-chart { display: grid; place-items: center; height: 100%; color: var(--muted); font-size: 12px; text-align: center; }
.form-chip[data-tone="fresh"] { color: var(--lime); border-color: rgba(213,233,154,.18); background: rgba(213,233,154,.07); }
.form-chip[data-tone="building"], .form-chip[data-tone="overreached"] { color: var(--amber); border-color: rgba(232,200,121,.18); background: rgba(232,200,121,.07); }
.load-row { display: grid; grid-template-columns: 88px 1fr 26px; align-items: center; gap: 10px; margin-top: 29px; }
.load-row > div:first-child { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 11px; color: var(--soft); }
.load-row strong { color: var(--text); font-size: 16px; }
.load-row small { color: var(--muted); font-size: 9px; }
.load-track { height: 6px; }
.load-track span { background: var(--mint); }
.load-track.fatigue span { background: var(--amber); }
.panel-note { margin: 30px 0 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.movement-panel > strong { display: block; margin-top: 40px; font-size: 52px; letter-spacing: -.06em; }
.movement-panel > span { color: var(--muted); font-size: 11px; }

.insights-section { margin-top: 40px; }
.insights-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 17px; }
.insight-item { display: grid; grid-template-columns: 9px 1fr; gap: 13px; padding: 17px 18px; background: rgba(18,32,29,.67); border: 1px solid var(--line); border-radius: 15px; }
.insight-dot { width: 7px; height: 7px; margin-top: 5px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 4px rgba(140,219,183,.07); }
.insight-item.watch .insight-dot { background: var(--amber); box-shadow: 0 0 0 4px rgba(232,200,121,.07); }
.insight-item.critical .insight-dot { background: var(--rose); box-shadow: 0 0 0 4px rgba(229,141,135,.07); }
.insight-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.insight-title strong { text-transform: capitalize; font-size: 12px; }
.insight-title small { color: var(--muted); font-size: 9px; }
.insight-item p { margin: 7px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.empty-insights { color: var(--muted); font-size: 12px; }
.dashboard-footer { display: flex; justify-content: space-between; gap: 30px; padding-top: 25px; margin-top: 42px; border-top: 1px solid var(--line); color: #647870; font-size: 10px; }
.dashboard-footer p { max-width: 620px; margin: 0; line-height: 1.55; }
.dashboard-footer a { color: var(--muted); text-decoration: none; white-space: nowrap; }

@media (max-width: 860px) {
  .hero-card, .content-grid { grid-template-columns: 1fr; }
  .guidance-card { border-left: 0; border-top: 1px solid var(--line); }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .setup-steps { grid-template-columns: 1fr; }
  .setup-step { min-height: 0; }
  .step-copy { min-height: 0; }
  .step-links, .button-secondary, .connect-final .button-primary { margin-top: 10px; }
}
@media (max-width: 560px) {
  .shell { width: min(100% - 28px, 1180px); }
  .site-header { height: 76px; }
  .account-chip #account-name { display: none; }
  .disconnect-button { width: 37px; padding: 0; justify-content: center; }
  .disconnect-button > span { display: none; }
  .connect-screen { padding-top: 5vh; }
  .connect-screen h1 { font-size: clamp(44px, 15vw, 64px); }
  .time-note { align-items: flex-start; flex-direction: column; border-radius: 12px; }
  .setup-steps { margin-top: 38px; }
  .setup-step { padding: 20px; }
  .onboarding-footnote { align-items: flex-start; flex-direction: column; gap: 13px; }
  .privacy-note { text-align: left; }
  .dashboard { padding-top: 32px; }
  .hero-card { border-radius: 21px; }
  .score-wrap { flex-direction: column; align-items: flex-start; }
  .score-ring { width: 132px; }
  .metric-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .metric-card { padding: 16px; }
  .metric-label { align-items: flex-start; flex-direction: column; }
  .metric-card > strong { font-size: 25px; }
  .history-heading { align-items: flex-start; }
  .history-heading .mode-badge { display: none; }
  .history-summary > div { padding: 15px 13px; }
  .history-summary strong { font-size: 16px; }
  .history-chart-wrap { grid-template-columns: 38px 1fr; padding-inline: 7px 14px; }
  .history-axis { padding-left: 55px; padding-right: 14px; }
  .insights-list { grid-template-columns: 1fr; }
  .dashboard-footer { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
