/* Project ATHLETE v3 — responsive, dependency-free interface. */
:root {
  color-scheme: dark;
  --bg: #0b111b;
  --sidebar: #101824;
  --surface: #151f2d;
  --surface-raised: #1a2737;
  --surface-soft: #111b28;
  --line: #293748;
  --line-soft: #223040;
  --text: #edf3f8;
  --muted: #a1b1c2;
  --subtle: #91a4b8;
  --mint: #8be4c5;
  --mint-soft: #17392f;
  --blue: #83b9ff;
  --blue-soft: #1b2f48;
  --purple: #c0a8f5;
  --purple-soft: #30273f;
  --amber: #efc48c;
  --amber-soft: #3a3023;
  --red: #f6a8ad;
  --radius: 20px;
  --shadow: 0 12px 32px rgb(0 0 0 / 12%);
  --font: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { min-width: 320px; min-height: 100%; scroll-behavior: smooth; scrollbar-color: #425268 var(--bg); }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); font: 400 16px/1.5 var(--font); -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%; }
button, input, select, textarea { font: inherit; }
button, input, select, textarea, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button, a, input, select, textarea, summary { touch-action: manipulation; }
button:disabled { cursor: wait; opacity: .55; }
a { color: var(--mint); text-underline-offset: 3px; }
a:hover { color: #b4f4dc; }
a.button { text-decoration: none; }
button { color: inherit; }
svg { display: block; flex-shrink: 0; }
img { max-width: 100%; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { line-height: 1.2; }
h1 { font-size: clamp(1.85rem, 2.6vw, 2.25rem); font-weight: 750; letter-spacing: -.045em; margin-bottom: 8px; }
h2 { font-size: 1.125rem; letter-spacing: -.02em; font-weight: 660; }
h3 { font-size: 1.0625rem; letter-spacing: -.01em; font-weight: 650; }
p { margin-bottom: 16px; }
small { font-size: .8125rem; }
::selection { background: #476b63; color: white; }
:focus-visible { outline: 3px solid var(--mint); outline-offset: 4px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.app-shell { min-height: 100vh; }
.sidebar { position: fixed; z-index: 20; inset: 0 auto 0 0; width: 222px; padding: 30px 18px 24px; background: var(--sidebar); border-right: 1px solid var(--line-soft); display: flex; flex-direction: column; }
.brand, .logo-lockup { display: flex; align-items: center; gap: 12px; }
.brand { padding: 0 12px; margin-bottom: 47px; color: var(--text); text-decoration: none; }
.brand > span { min-width: 0; }
.brand:hover, .mobile-brand:hover { color: var(--text); }
.brand-mark { width: 38px; height: 38px; border-radius: 12px; background: var(--mint); color: #11332b; display: grid; place-items: center; flex: 0 0 auto; }
img.brand-mark { object-fit: contain; background: transparent; }
.brand-mark svg { width: 26px; height: 26px; }
.brand-name { font-size: 1.0625rem; letter-spacing: .12em; font-weight: 760; }
.version { display: block; color: var(--muted); font-size: .75rem; letter-spacing: .03em; font-weight: 450; margin-top: 2px; }
.brand .version { max-width: 135px; font-size: .625rem; line-height: 1.45; letter-spacing: .035em; }
.nav-list { display: flex; flex-direction: column; gap: 7px; }
.nav-item { position: relative; display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 12px 15px; width: 100%; background: transparent; border: 1px solid transparent; border-radius: 12px; text-decoration: none; color: var(--muted); font-size: .9375rem; font-weight: 520; text-align: left; transition: background .15s, color .15s; }
.nav-item svg { width: 21px; height: 21px; }
.nav-item:hover { background: #192635; color: var(--text); }
.nav-item.active { background: #1a342f; border-color: #284b41; color: var(--mint); font-weight: 650; }
.sidebar-footer { margin-top: auto; padding: 18px 12px 0; color: var(--muted); font-size: .8125rem; }
.sidebar-footer a { display: inline-flex; gap: 8px; align-items: center; padding: 10px 0; }
.workspace { margin-left: 222px; min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 15; min-height: 75px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px clamp(20px, 3.6vw, 48px); background: rgb(11 17 27 / 94%); backdrop-filter: blur(16px); border-bottom: 1px solid var(--line-soft); }
.topbar-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.mobile-brand { display: none; align-items: center; gap: 9px; font-weight: 750; letter-spacing: .08em; font-size: .875rem; color: var(--text); text-decoration: none; }
.mobile-brand > img { flex-shrink: 0; }
.mobile-brand > .badge { font-size: .625rem; letter-spacing: 0; padding: 3px 5px; }
.mobile-brand .brand-mark { width: 29px; height: 29px; border-radius: 9px; }
.mobile-brand .brand-mark svg { width: 20px; height: 20px; }
.connection-chip { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: .8125rem; min-width: 0; }
.connection-chip::before { content: ""; width: 6px; height: 6px; background: var(--subtle); border-radius: 50%; flex: 0 0 auto; }
.connection-chip.connected::before { background: var(--mint); }
.connection-chip.disconnected::before, .connection-chip.pending::before { background: var(--subtle); }
.connection-chip.error::before { background: var(--red); }
.main { max-width: 1236px; padding: 34px clamp(20px, 3.6vw, 48px) 52px; margin: 0 auto; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
.eyebrow { display: block; font-size: .75rem; font-weight: 650; letter-spacing: .1em; text-transform: uppercase; color: var(--mint); margin: 0 0 10px; }
.subtitle { color: var(--muted); font-size: .9375rem; max-width: 55ch; margin-bottom: 0; }
.heading-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; flex-shrink: 0; }
.button, .icon-button, .close-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 11px 17px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-raised); color: var(--text); font-size: .875rem; line-height: 1.4; font-weight: 600; transition: background .15s, border-color .15s, transform .15s; }
.button svg { width: 18px; height: 18px; }
.button:hover, .icon-button:hover, .close-button:hover { background: #233347; border-color: #425368; }
.button:active, .icon-button:active { transform: translateY(1px); }
.button.primary { color: #092a21; background: var(--mint); border-color: var(--mint); }
.button.primary:hover { background: #a5f0d6; border-color: #a5f0d6; }
.button.secondary { background: #172531; border-color: #344957; color: #c9f1e5; }
.button.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.button.ghost:hover { background: var(--surface-raised); color: var(--text); }
.button.danger { background: #38212a; border-color: #69404a; color: #ffb9bf; }
.button.small { min-height: 44px; padding: 9px 12px; font-size: .8125rem; }
.button.full { width: 100%; }
.icon-button, .close-button { width: 44px; height: 44px; padding: 0; flex-shrink: 0; }
.icon-button svg, .close-button svg { width: 20px; height: 20px; }
.icon-button { background: transparent; }
.icon-button.busy svg { animation: rotate 1.2s linear infinite; }
.dashboard-grid, .grid-2, .grid-3, .grid-4 { display: grid; gap: 18px; margin-bottom: 20px; min-width: 0; }
.dashboard-grid, .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.full-width { grid-column: 1 / -1; }
.hero-card { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 210px; padding: 28px 30px; margin-bottom: 22px; border: 1px solid #2a4a43; border-radius: 24px; background: linear-gradient(110deg, #193730 0%, #142b2c 55%, #162332 100%); overflow: hidden; }
.hero-copy { min-width: 0; max-width: 600px; position: relative; z-index: 1; }
.hero-card .eyebrow { color: #a0ddc7; }
.hero-title { font-size: clamp(1.5rem, 2.7vw, 2rem); letter-spacing: -.035em; font-weight: 700; margin: 10px 0; }
.hero-card p { color: #b9cec8; max-width: 55ch; font-size: .9375rem; margin-bottom: 15px; }
.hero-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 9px 15px; color: #aecbc0; font-size: .8125rem; }
.hero-visual { flex-shrink: 0; }
.readiness-ring { width: 145px; height: 145px; position: relative; display: grid; align-content: center; justify-items: center; }
.readiness-ring > svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.ring-value { font-size: 2.625rem; font-weight: 700; letter-spacing: -.06em; line-height: 1.1; z-index: 1; }
.ring-label { font-size: .75rem; margin-top: 3px; color: #c1d7ce; z-index: 1; }
.card { min-width: 0; padding: 22px; background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius); box-shadow: var(--shadow); }
.card + .section-heading { margin-top: 28px; }
.card-heading { display: flex; align-items: center; gap: 10px; margin-bottom: 21px; min-width: 0; }
.card-heading h2 { margin: 0; flex: 1; min-width: 0; display: flex; align-items: center; gap: 9px; }
.card-heading .badge { flex-shrink: 0; }
.card-action { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 6px 10px; margin: -8px -9px -8px auto; color: var(--mint); border: 0; background: transparent; border-radius: 9px; text-decoration: none; font-size: .8125rem; font-weight: 600; white-space: nowrap; }
.card-action:hover { background: rgb(139 228 197 / 8%); }
.icon-badge, .activity-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 11px; background: var(--mint-soft); color: var(--mint); flex-shrink: 0; }
.icon-badge svg { width: 18px; height: 18px; }
.icon-badge.blue, .activity-icon.blue, .activity-icon.cycling { color: var(--blue); background: var(--blue-soft); }
.icon-badge.purple, .activity-icon.purple, .activity-icon.strength { color: var(--purple); background: var(--purple-soft); }
.icon-badge.amber, .activity-icon.amber, .activity-icon.running { color: var(--amber); background: var(--amber-soft); }
.icon-badge.mint, .activity-icon.mint, .activity-icon.swimming { color: var(--mint); background: var(--mint-soft); }
.metric-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 18px; }
.metric { min-width: 0; }
.metric-label, .stat-label { display: block; color: var(--muted); font-size: .8125rem; margin-bottom: 7px; }
.metric-value { font-size: 1.7rem; letter-spacing: -.04em; font-weight: 680; line-height: 1.2; overflow-wrap: break-word; }
.metric-value.small { font-size: 1.125rem; letter-spacing: -.015em; line-height: 1.5; }
.metric-value .unit, .unit { font-size: .8125rem; font-weight: 450; color: var(--muted); letter-spacing: 0; margin-left: 4px; }
.metric-note { display: block; font-size: .75rem; line-height: 1.5; color: var(--subtle); margin-top: 5px; }
.metric-divider { height: 1px; background: var(--line-soft); margin: 20px 0; }
.summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat-card { padding: 20px; background: var(--surface); border: 1px solid var(--line-soft); border-radius: 16px; min-width: 0; }
.stat-value { font-size: clamp(1.65rem, 2.5vw, 2rem); font-weight: 700; line-height: 1.15; letter-spacing: -.045em; display: inline; }
.stat-unit { color: var(--muted); font-size: .8125rem; margin-left: 4px; }
.stat-card .metric-note { margin-top: 9px; }
.section-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin: 26px 0 14px; }
.section-heading h2 { margin: 0; }
.section-heading p { color: var(--muted); font-size: .8125rem; margin: 0; }
.filter-bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px; margin-bottom: 20px; }
.select-field { display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: .8125rem; min-width: 150px; }
.select-field.grow { flex: 1; }
.segmented { display: flex; padding: 4px; background: #111b28; border: 1px solid var(--line); border-radius: 12px; max-width: 100%; }
.segmented button { flex: 1; padding: 10px 14px; min-height: 44px; color: var(--muted); border: 0; border-radius: 8px; background: transparent; font-size: .875rem; line-height: 1.4; font-weight: 550; }
.segmented button:hover { color: var(--text); }
.segmented button.active { background: #28394a; color: #f3f7fb; box-shadow: 0 2px 5px rgb(0 0 0 / 12%); }
.date-navigation { display: flex; gap: 6px; align-items: center; }
.date-navigation input { flex: 1; min-width: 0; }
.filter-description { color: var(--muted); font-size: .875rem; margin: -3px 0 18px; }
.activity-list { display: flex; flex-direction: column; gap: 0; }
.activity-row { display: flex; align-items: center; gap: 13px; width: 100%; min-width: 0; padding: 17px 0; text-align: left; color: var(--text); border: 0; border-bottom: 1px solid var(--line-soft); background: transparent; border-radius: 0; }
.activity-row:first-child { padding-top: 0; }
.activity-row:last-child { border-bottom: 0; padding-bottom: 0; }
button.activity-row:hover { background: rgb(139 228 197 / 4%); }
.activity-row > button { display: flex; align-items: center; gap: 13px; border: 0; background: transparent; text-align: left; color: inherit; width: 100%; padding: 0; min-width: 0; }
.activity-icon { width: 42px; height: 42px; border-radius: 13px; }
.activity-icon svg { width: 23px; height: 23px; }
.activity-info { flex: 1; min-width: 0; }
.activity-title { display: block; font-size: .9375rem; font-weight: 620; line-height: 1.4; overflow-wrap: anywhere; }
.activity-meta { display: block; color: var(--muted); font-size: .8125rem; margin-top: 3px; }
.activity-stats { text-align: right; flex-shrink: 0; max-width: 38%; }
.activity-distance { display: block; font-size: .9375rem; font-weight: 620; font-variant-numeric: tabular-nums; }
.activity-duration { display: block; color: var(--muted); font-size: .8125rem; margin-top: 3px; }
.activity-group-label { color: var(--muted); font-size: .8125rem; font-weight: 550; margin: 22px 0 13px; }
.activity-group-label:first-child { margin-top: 0; }
.badge { display: inline-flex; align-items: center; gap: 5px; border-radius: 7px; padding: 4px 8px; color: var(--mint); background: var(--mint-soft); font-size: .75rem; line-height: 1.4; font-weight: 550; max-width: 100%; }
.badge.mint { color: var(--mint); background: var(--mint-soft); }
.badge.blue { color: var(--blue); background: var(--blue-soft); }
.badge.amber { color: var(--amber); background: var(--amber-soft); }
.badge.purple { color: var(--purple); background: var(--purple-soft); }
.badge.muted { color: #b8c6d5; background: #253243; }
.badge.error { color: var(--red); background: #3b2632; }
.notice { padding: 14px 16px; margin: 0 0 20px; border: 1px solid #2d4559; border-radius: 13px; background: #142636; color: #bfd4e7; font-size: .875rem; line-height: 1.6; overflow-wrap: anywhere; }
.notice p:last-child { margin-bottom: 0; }
.notice.warning { color: #e9cfac; background: #2c261f; border-color: #4c3e2c; }
.notice.error { color: #f0c3c8; background: #30212c; border-color: #583240; }
.notice.success { color: #b5e5d4; background: #163029; border-color: #2d5144; }
.notice strong { color: inherit; }
.notice .button { margin-top: 10px; }
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 32px 16px; min-height: 190px; }
.empty-state > svg { width: 36px; height: 36px; color: var(--muted); margin: 0 0 15px; }
.empty-state h3 { margin: 0 0 9px; font-size: 1.0625rem; }
.empty-state p { color: var(--muted); max-width: 39ch; font-size: .875rem; margin: 0 0 17px; }
.empty-state p:last-child { margin-bottom: 0; }
.chart-wrap { min-width: 0; width: 100%; overflow: hidden; margin: 8px 0 0; }
.chart-wrap > svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart-wrap text { font-family: var(--font); fill: var(--muted); font-size: 16px; }
.chart-labels { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: .75rem; padding-top: 8px; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 12px 18px; margin: 17px 0 0; font-size: .8125rem; color: var(--muted); }
.chart-legend > span { display: inline-flex; align-items: center; gap: 7px; }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--mint); display: inline-block; flex-shrink: 0; }
.table-scroll { overflow-x: auto; max-width: 100%; scrollbar-width: thin; }
.data-table { width: 100%; border-collapse: collapse; font-size: .875rem; text-align: left; }
.data-table th, .data-table td { padding: 12px 10px; border-bottom: 1px solid var(--line-soft); }
.data-table th { font-size: .8125rem; color: var(--muted); font-weight: 500; white-space: nowrap; }
.data-table td { font-variant-numeric: tabular-nums; }
.data-table td:first-child, .data-table th:first-child { padding-left: 0; }
.data-table td:last-child, .data-table th:last-child { padding-right: 0; }
.data-table tr:last-child td { border-bottom: 0; }
.plan-list { display: flex; flex-direction: column; gap: 14px; }
.plan-row { display: flex; align-items: flex-start; gap: 16px; border: 1px solid var(--line-soft); padding: 19px; border-radius: 15px; background: var(--surface-soft); }
.plan-date { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; width: 46px; min-height: 55px; background: #223140; border-radius: 11px; color: var(--muted); font-size: .75rem; flex-shrink: 0; }
.plan-date strong { font-size: 1.3rem; line-height: 1.2; color: var(--text); }
.plan-body { flex: 1; min-width: 0; }
.plan-body h3 { margin-bottom: 6px; }
.plan-body p { margin-bottom: 9px; font-size: .875rem; color: var(--muted); overflow-wrap: anywhere; }
.plan-body .badge { margin-right: 7px; }
.plan-actions { display: flex; gap: 7px; margin-top: 12px; }
.source-text { margin: 16px 0 0; color: var(--subtle); font-size: .75rem; line-height: 1.55; overflow-wrap: anywhere; }
.source-text a { color: #b7d9d0; }
.loading-state { display: grid; justify-items: center; align-content: center; min-height: 320px; gap: 18px; color: var(--muted); text-align: center; }
.spinner { width: 30px; height: 30px; border-radius: 50%; border: 3px solid #263b43; border-top-color: var(--mint); animation: rotate .8s linear infinite; }
.login-view { display: grid; grid-template-columns: 1.1fr 1fr; gap: 45px; align-items: center; max-width: 950px; margin: clamp(15px, 6vh, 70px) auto; }
.login-card { max-width: 510px; min-width: 0; }
.login-card .logo-lockup { margin-bottom: 28px; }
.login-card h1 { font-size: clamp(2.1rem, 3.2vw, 3rem); line-height: 1.12; margin: 0 0 18px; }
.login-card > p { color: var(--muted); font-size: 1rem; line-height: 1.65; }
.login-card .button.primary { min-height: 50px; padding: 13px 20px; }
.feature-list { display: grid; gap: 16px; margin: 28px 0; }
.feature-item { display: flex; align-items: flex-start; gap: 12px; color: var(--muted); font-size: .875rem; }
.feature-item svg { width: 20px; height: 20px; color: var(--mint); margin-top: 1px; }
.feature-item strong { color: var(--text); font-weight: 600; display: block; margin-bottom: 3px; }
.login-preview { position: relative; min-height: 380px; padding: 28px; background: radial-gradient(ellipse at 50% 35%, #224b4133, transparent 65%), #121d29; border: 1px solid var(--line); border-radius: 30px; overflow: hidden; }
.preview-orbit { position: relative; margin: 10px auto 25px; width: 220px; height: 220px; display: grid; place-items: center; }
.preview-orbit::before, .preview-orbit::after { content: ""; position: absolute; inset: 0; border: 2px solid #29473f; border-radius: 50%; }
.preview-orbit::after { inset: 23px; border-color: #35516d; }
.preview-orbit .brand-mark { width: 95px; height: 95px; border-radius: 27px; box-shadow: 0 0 70px rgb(139 228 197 / 9%); }
.preview-orbit .brand-mark svg { width: 60px; height: 60px; }
.preview-label { text-align: center; color: var(--muted); font-size: .875rem; }
.login-preview .metric-grid { background: #172737; padding: 18px; border-radius: 17px; }
.connect-banner { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 17px 20px; border: 1px solid #294a40; background: #142b26; border-radius: 15px; margin-bottom: 22px; }
.connect-banner p { margin: 0; font-size: .875rem; color: #c0dbd0; }
.toast { position: fixed; z-index: 110; bottom: 26px; left: calc(50% + 110px); transform: translateX(-50%); width: max-content; max-width: calc(100vw - 42px); padding: 14px 20px; color: #d9f8ed; background: #24483c; border: 1px solid #4f7969; border-radius: 13px; box-shadow: 0 8px 45px rgb(0 0 0 / 30%); font-size: .875rem; }
.toast.error { background: #442d35; border-color: #78505b; color: #ffe0e5; }
.status-bar { margin-top: 25px; color: var(--subtle); font-size: .75rem; display: flex; flex-wrap: wrap; gap: 8px 20px; }
.status-bar a { color: var(--muted); }
.workspace > .status-bar { max-width: 1236px; margin: 0 auto; padding: 0 clamp(20px, 3.6vw, 48px) 24px; }
#network-notice { margin: 18px clamp(20px, 3.6vw, 48px) 0; }
.skip-link { position: fixed; z-index: 150; top: 12px; left: 12px; transform: translateY(-200%); background: var(--mint); color: #092a21; padding: 12px 17px; border-radius: 10px; font-weight: 650; text-decoration: none; }
.skip-link:focus { transform: translateY(0); }
#main:focus { outline: none; }
dialog.modal { position: fixed; max-width: 640px; width: calc(100% - 40px); max-height: min(90dvh, 900px); padding: 0; margin: auto; border: 1px solid #3a4b5d; border-radius: 23px; color: var(--text); background: var(--surface); box-shadow: 0 30px 100px rgb(0 0 0 / 45%); overflow: auto; overscroll-behavior: contain; }
dialog.modal::backdrop { background: rgb(1 6 14 / 76%); backdrop-filter: blur(5px); }
.modal-header { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 24px 18px; background: var(--surface); border-bottom: 1px solid var(--line-soft); }
.modal-header h2, .modal-header h3 { margin: 0; font-size: 1.25rem; }
.modal-body { padding: 24px; }
.modal-footer { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 10px; padding: 18px 24px; background: var(--surface); border-top: 1px solid var(--line); }
.modal-footer .button { min-width: 100px; }
.close-button { background: transparent; border-color: transparent; border-radius: 50%; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 18px; }
.form-grid > .full { grid-column: 1 / -1; }
.field { min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field label, .field > span:first-child { display: block; color: #d2dde8; font-size: .875rem; font-weight: 530; margin-bottom: 8px; }
input, select, textarea { display: block; min-width: 0; width: 100%; border: 1px solid #3a4c5f; border-radius: 10px; padding: 11px 12px; min-height: 46px; font-size: 16px; line-height: 1.4; background: #0f1a27; color: var(--text); box-shadow: none; }
input:hover, select:hover, textarea:hover { border-color: #586e83; }
input:focus, select:focus, textarea:focus { outline: 2px solid #71bea5; outline-offset: 1px; border-color: #71bea5; }
input::placeholder, textarea::placeholder { color: #8196aa; opacity: 1; }
input[type="checkbox"] { display: inline-block; width: 20px; height: 20px; min-height: 0; padding: 0; accent-color: var(--mint); vertical-align: middle; flex-shrink: 0; }
.checkbox-field { display: flex; align-items: center; gap: 10px; min-height: 44px; color: var(--muted); font-size: .875rem; }
select { appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='m2 4 4 4 4-4' fill='none' stroke='%23a1b1c2' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 13px center; background-size: 12px; }
textarea { resize: vertical; min-height: 100px; }
input[type="date"], input[type="time"] { appearance: none; min-height: 46px; }
input[type="date"]::-webkit-date-and-time-value { text-align: left; }
.field-help { color: var(--subtle); font-size: .75rem; line-height: 1.55; margin: 6px 0 0; }
.field > .field-help { display: block; }
.field > .field-help + .form-grid { margin-top: 12px; }
.modal-body > .subtitle { margin-bottom: 24px; }
.modal-body > .logo-lockup { margin-bottom: 20px; }
#entry-error { margin-top: 22px; margin-bottom: 0; }
.activity-detail-metrics { margin: 24px 0; }
.source-block { margin-top: 22px; padding-top: 21px; border-top: 1px solid var(--line); }
.source-block h3 { margin-bottom: 11px; font-size: .9375rem; }
.source-block p { font-size: .875rem; color: var(--muted); line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
.form-intro { color: var(--muted); font-size: .875rem; margin: 0 0 23px; }
.form-error { margin-top: 20px; }
.save-summary { border: 1px solid var(--line); border-radius: 13px; overflow: hidden; margin: 18px 0; }
.change-row { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 12px; padding: 13px 16px; font-size: .875rem; border-bottom: 1px solid var(--line-soft); overflow-wrap: anywhere; }
.change-row:last-child { border: 0; }
.change-label { color: #cfdae7; }
.change-before { color: var(--muted); }
.change-after { color: var(--mint); font-weight: 550; }
.change-row.header { background: var(--surface-soft); font-size: .75rem; color: var(--muted); }
details.details-panel { border-top: 1px solid var(--line-soft); margin-top: 20px; padding-top: 4px; }
details.details-panel summary { cursor: pointer; min-height: 44px; padding: 13px 0; font-size: .875rem; font-weight: 550; color: #c3d4e3; }
details.details-panel[open] summary { margin-bottom: 10px; }
details.details-panel p, details.details-panel li { color: var(--muted); font-size: .875rem; }
details.details-panel ul { padding-left: 20px; }
.coach-summary textarea { min-height: 290px; font-size: .875rem; line-height: 1.7; color: #c4d2e0; }
.coach-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.privacy-note { color: var(--subtle); font-size: .75rem; line-height: 1.6; margin: 18px 0 0; }
.quiet-text { color: var(--muted); font-size: .875rem; }
.text-mint { color: var(--mint); }
.text-blue { color: var(--blue); }
.text-purple { color: var(--purple); }
.text-amber { color: var(--amber); }
.spacer { height: 20px; }
.main > .card { margin-bottom: 20px; }
.main > .card:last-child { margin-bottom: 0; }
.dashboard-grid > .hero-card { margin-bottom: 0; padding: 23px; gap: 12px; }
.hero-card .metric-grid { margin-top: 20px; gap: 16px; }
.hero-card .metric-value { font-size: 1.5rem; }
.hero-card .metric-label { color: #bdd3ca; }
.hero-card .hero-copy > .button { margin-top: 22px; }
.hero-visual { display: flex; flex-direction: column; align-items: center; min-width: 0; }
.hero-visual > .source-text { display: block; max-width: 122px; margin-top: 4px; color: #a9c9bc; font-size: .75rem; line-height: 1.45; text-align: center; }
.readiness-ring { color: var(--mint); }
.ring-value { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: var(--text); }
.ring-value > .ring-label { display: block; width: 96px; font-weight: 450; line-height: 1.35; font-size: .75rem; letter-spacing: 0; margin-top: 5px; }
.stat-label { display: flex; align-items: center; gap: 7px; }
.stat-label > svg { width: 16px; height: 16px; }
.action-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 21px; }
.nutrition-macros { margin-top: 21px; padding-top: 20px; border-top: 1px solid var(--line-soft); }
.nutrition-macros .metric-value { font-size: 1.4rem; }
.fitness-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.fitness-metrics .metric:nth-child(1) .metric-value { color: var(--mint); }
.fitness-metrics .metric:nth-child(2) .metric-value { color: var(--purple); }
.fitness-metrics .metric:nth-child(3) .metric-value { color: var(--blue); }
.card-heading + .source-text { margin: -7px 0 19px; }
.filter-description { display: flex; align-items: flex-start; gap: 8px; }
.filter-description > svg { width: 16px; height: 16px; margin-top: 2px; }
.activity-row.is-excluded .activity-title, .activity-row.is-excluded .activity-distance { color: var(--muted); }
.activity-row.is-excluded .activity-icon { color: #adbac9; background: #26323e; }
.activity-title > .badge { margin-left: 6px; vertical-align: middle; font-weight: 450; }
.activity-list + .button { margin-top: 20px; width: 100%; }
.week-strip { display: grid; grid-template-columns: repeat(7, minmax(44px, 1fr)); gap: 8px; overflow-x: auto; padding-bottom: 5px; margin: 0 0 24px; scrollbar-width: thin; }
.week-day { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 8px; min-height: 102px; min-width: 44px; padding: 13px 5px 11px; background: var(--surface); color: var(--muted); border: 1px solid var(--line); border-radius: 13px; }
.week-day > span:first-child { font-size: .8125rem; line-height: 1.2; }
.week-day strong { font-size: 1.4rem; line-height: 1.2; font-weight: 650; color: var(--text); }
.week-day .day-indicator { font-size: .6875rem; line-height: 1.3; min-height: 15px; color: var(--subtle); }
.week-day:hover { background: #213244; border-color: #436075; }
.week-day.active { background: #1b3930; border-color: #6bb79c; color: #c6f0de; }
.week-day.active strong { color: var(--mint); }
.week-day.active .day-indicator { color: #badcca; }
.plan-row > .plan-actions { margin-top: -5px; margin-right: -8px; }
.plan-row > .plan-actions .button { padding: 9px; }
.checkin-notes { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 18px; }
.checkin-notes p { margin-bottom: 0; font-size: .9375rem; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.coach-intro { display: grid; grid-template-columns: 43px 1fr; gap: 10px 12px; margin-bottom: 23px; }
.coach-intro > .icon-badge { width: 42px; height: 42px; border-radius: 13px; grid-row: 1 / span 2; }
.coach-intro h2 { font-size: 1.375rem; letter-spacing: -.025em; margin: 3px 0 0; }
.coach-intro p { grid-column: 2; font-size: .9375rem; color: var(--muted); line-height: 1.65; margin: 0; max-width: 65ch; }
.coach-summary { margin-top: 25px; }
.coach-summary > label { display: block; font-size: .8125rem; color: var(--muted); margin-bottom: 10px; }
.coach-summary + .button { margin-top: 9px; }
.feature-item p { margin-bottom: 0; line-height: 1.6; }
.review-note { margin-bottom: 23px; }
.review-note:last-child { margin-bottom: 0; }
.review-note h3 { margin-bottom: 7px; font-size: .9375rem; color: #d4e2ec; }
.review-note p { white-space: pre-wrap; line-height: 1.75; overflow-wrap: anywhere; margin-bottom: 0; }
.orbit-word { position: relative; z-index: 1; color: var(--mint); font-size: 1.8rem; font-weight: 730; letter-spacing: -.035em; line-height: 1.25; text-align: center; }
.login-preview > p { text-align: center; color: var(--muted); line-height: 1.7; font-size: .9375rem; margin-bottom: 0; }
.preview-orbit::before { border-left-color: #76bda1; border-top-color: #76bda1; transform: rotate(-35deg); }
.preview-orbit::after { border-right-color: #6b8eb6; transform: rotate(15deg); }
.chart-legend i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.chart-wrap > .chart-legend { margin: 19px 0 5px; }
.chart-note { color: var(--subtle); font-size: .75rem; line-height: 1.6; margin: 13px 0 0; }
.chart-axis-title { color: #c3d4e1; font-size: .8125rem; line-height: 1.5; margin: 17px 0 7px; }
.chart-axis-title .muted { color: var(--muted); }
.chart-empty-mark { display: block; color: #6b849d; font-size: 2rem; letter-spacing: .1em; margin: 0 0 13px; }
.chart-empty.empty-state { min-height: 220px; }
.chart-empty p { margin-bottom: 8px; }
.chart-empty p strong { font-size: 1rem; color: var(--text); font-weight: 550; }
.chart-data { margin-top: 13px; border-top: 1px solid var(--line-soft); }
.chart-data > summary { cursor: pointer; min-height: 44px; padding: 13px 0; font-size: .8125rem; font-weight: 550; color: #b9d4ce; }
.chart-data table { width: 100%; border-collapse: collapse; font-size: .8125rem; text-align: left; }
.chart-data th, .chart-data td { padding: 12px 9px; border-bottom: 1px solid var(--line-soft); font-variant-numeric: tabular-nums; }
.chart-data th:first-child, .chart-data td:first-child { padding-left: 0; }
.chart-data th:last-child, .chart-data td:last-child { padding-right: 0; }
.chart-data thead th { color: var(--muted); font-weight: 450; }
.chart-data tbody th { font-weight: 450; white-space: nowrap; }
.chart-data tr:last-child th, .chart-data tr:last-child td { border-bottom: 0; }
.chart-data .table-scroll { padding-bottom: 3px; }
@keyframes rotate { to { transform: rotate(360deg); } }
@media (min-width: 1500px) { .sidebar { width: 242px; padding-left: 24px; padding-right: 24px; } .workspace { margin-left: 242px; } }
@media (max-width: 1100px) {
  .sidebar { width: 190px; padding: 28px 12px; }
  .workspace { margin-left: 190px; }
  .brand { padding: 0 7px; gap: 9px; }
  .brand-name { font-size: .9375rem; }
  .nav-item { padding: 12px; gap: 10px; }
  .main { padding: 28px 24px 48px; }
  .topbar { padding: 14px 24px; }
  .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .summary-grid { gap: 10px; }
  .stat-card { padding: 17px 15px; }
  .page-heading { align-items: flex-start; }
  .heading-actions { justify-content: flex-end; max-width: 230px; }
  .hero-card { padding: 25px; }
  .dashboard-grid > .hero-card { padding: 20px; }
  .dashboard-grid .readiness-ring { width: 114px; height: 114px; }
  .dashboard-grid .ring-value { font-size: 2.1rem; }
  .dashboard-grid .ring-label { width: 78px; font-size: .6875rem; }
  .dashboard-grid .hero-visual > .source-text { max-width: 102px; }
  .login-view { gap: 28px; }
}
@media (max-width: 800px) {
  .sidebar { position: fixed; inset: auto 0 0 0; top: auto; right: 0; bottom: 0; left: 0; width: 100%; height: auto; min-height: 0; max-height: calc(90px + env(safe-area-inset-bottom, 0px)); flex: none; padding: 7px 8px calc(7px + env(safe-area-inset-bottom, 0px)); background: rgb(17 27 40 / 98%); border: 0; border-top: 1px solid #2a394b; backdrop-filter: blur(20px); }
  .sidebar > .brand, .sidebar-footer { display: none; }
  .nav-list { flex: 0 0 auto; flex-direction: row; gap: 3px; justify-content: space-around; min-height: 55px; }
  .nav-item { flex: 1; flex-direction: column; justify-content: center; gap: 4px; min-width: 0; min-height: 55px; padding: 6px 1px; border-radius: 10px; border: 0; font-size: .75rem; line-height: 1.25; font-weight: 520; }
  .nav-item svg { width: 21px; height: 21px; }
  .nav-item.active { background: #203b35; color: #a3ecd2; }
  .nav-item .nav-label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
  .workspace { margin-left: 0; }
  .topbar { min-height: 64px; padding: 10px 20px; }
  .mobile-brand { display: flex; }
  .topbar .connection-chip { margin-left: auto; font-size: .75rem; gap: 6px; }
  .topbar-actions { gap: 4px; }
  .topbar-actions .button.small { padding: 8px 10px; font-size: .75rem; }
  .main { max-width: 720px; padding: 26px 20px calc(102px + env(safe-area-inset-bottom, 0px)); }
  .workspace > .status-bar { padding: 0 20px calc(90px + env(safe-area-inset-bottom, 0px)); }
  .workspace > .main { padding-bottom: 32px; }
  .page-heading { gap: 14px; margin-bottom: 22px; }
  .heading-actions { max-width: none; }
  .summary-grid { gap: 12px; }
  .stat-value { font-size: 1.7rem; }
  .hero-card { min-height: 200px; padding: 24px; }
  .hero-title { font-size: 1.65rem; }
  .readiness-ring { width: 126px; height: 126px; }
  .ring-value { font-size: 2.25rem; }
  .toast { left: 50%; bottom: calc(90px + env(safe-area-inset-bottom, 0px)); }
  .login-view { margin-top: 16px; gap: 25px; }
  .login-preview { padding: 22px; min-height: 340px; }
  .preview-orbit { width: 190px; height: 190px; }
}
@media (max-width: 600px) {
  .topbar { padding: 9px 16px; }
  .topbar .connection-chip { display: none; }
  .topbar-actions { margin-left: auto; }
  .main { padding: 24px 16px calc(98px + env(safe-area-inset-bottom, 0px)); }
  .workspace > .status-bar { padding-left: 16px; padding-right: 16px; }
  #network-notice { margin-left: 16px; margin-right: 16px; }
  .page-heading { flex-wrap: wrap; margin-bottom: 20px; }
  .heading-actions { justify-content: flex-start; gap: 8px; }
  .page-heading .heading-actions:has(> .select-field) { width: 100%; }
  .page-heading .select-field { width: auto; flex: 1; min-width: 0; }
  h1 { font-size: 1.875rem; }
  .eyebrow { font-size: .6875rem; margin-bottom: 8px; }
  .subtitle { font-size: .875rem; }
  .dashboard-grid, .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; gap: 15px; margin-bottom: 16px; }
  .span-2 { grid-column: auto; }
  .hero-card { gap: 12px; padding: 22px 18px; min-height: 190px; border-radius: 20px; margin-bottom: 18px; }
  .hero-title { font-size: 1.5rem; line-height: 1.2; }
  .hero-card p { font-size: .875rem; }
  .hero-meta { gap: 7px 11px; font-size: .75rem; }
  .readiness-ring { width: 103px; height: 103px; }
  .dashboard-grid .readiness-ring { width: 103px; height: 103px; }
  .dashboard-grid .ring-value { font-size: 2rem; }
  .ring-value > .ring-label, .dashboard-grid .ring-label { width: 74px; font-size: .6875rem; }
  .hero-visual > .source-text, .dashboard-grid .hero-visual > .source-text { max-width: 103px; font-size: .6875rem; }
  .hero-card .metric-value { font-size: 1.375rem; }
  .hero-card .metric-label { font-size: .75rem; }
  .hero-card .metric-grid { gap: 12px; }
  .ring-value { font-size: 2rem; }
  .ring-label { font-size: .6875rem; }
  .hero-copy { flex: 1; }
  .card { padding: 19px; border-radius: 18px; }
  .card-heading { margin-bottom: 20px; gap: 9px; }
  .card-heading h2 { font-size: 1.0625rem; }
  .metric-grid { gap: 20px 18px; }
  .metric-value { font-size: 1.65rem; }
  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 17px; }
  .stat-card { padding: 17px 16px; border-radius: 15px; }
  .stat-value { font-size: 1.85rem; }
  .stat-label { font-size: .8125rem; }
  .filter-bar { gap: 12px; }
  .filter-bar > .segmented { order: -1; width: 100%; }
  .filter-bar > .select-field { flex: 1; min-width: 130px; }
  .filter-bar > .date-navigation { flex: 0 0 auto; min-width: 0; margin-left: auto; }
  .segmented button { padding: 9px 7px; min-height: 44px; font-size: .8125rem; }
  .activity-row { gap: 10px; padding: 17px 0; }
  .activity-icon { width: 38px; height: 38px; border-radius: 11px; }
  .activity-icon svg { width: 21px; height: 21px; }
  .activity-title { font-size: .875rem; }
  .activity-meta { font-size: .75rem; }
  .activity-distance { font-size: .875rem; }
  .activity-duration { font-size: .75rem; }
  .activity-stats { max-width: 37%; }
  .badge { font-size: .75rem; padding: 4px 7px; }
  .chart-legend { gap: 9px 14px; font-size: .75rem; }
  .chart-wrap text { font-size: 22px; }
  .chart-axis-title { font-size: .75rem; }
  .week-strip { gap: 5px; margin-bottom: 20px; }
  .week-day { gap: 7px; padding: 12px 2px 9px; border-radius: 10px; min-height: 94px; }
  .week-day > span:first-child { font-size: .75rem; }
  .week-day strong { font-size: 1.25rem; }
  .week-day .day-indicator { font-size: .625rem; min-height: 25px; }
  .checkin-notes { grid-template-columns: 1fr; gap: 18px; }
  .coach-intro { grid-template-columns: 37px 1fr; gap: 10px; }
  .coach-intro > .icon-badge { width: 35px; height: 35px; border-radius: 11px; }
  .coach-intro h2 { font-size: 1.125rem; line-height: 1.3; margin-top: 3px; }
  .coach-intro p { grid-column: 1 / -1; font-size: .875rem; margin-top: 4px; }
  .action-row > .button { flex: 1; padding-left: 12px; padding-right: 12px; }
  .fitness-metrics { gap: 10px; }
  .fitness-metrics .metric-value { font-size: 1.6rem; }
  .notice { padding: 13px 14px; font-size: .8125rem; }
  .plan-row { gap: 12px; padding: 16px 14px; }
  .plan-date { width: 42px; }
  .plan-body h3 { font-size: 1rem; }
  .section-heading { margin-top: 24px; }
  .login-view { grid-template-columns: 1fr; gap: 24px; margin: 12px auto; }
  .login-card { max-width: none; }
  .login-card h1 { font-size: 2.3rem; max-width: 12ch; }
  .login-card > p { font-size: .9375rem; }
  .login-card .button.primary { width: 100%; }
  .login-preview { display: none; }
  .feature-list { margin: 25px 0; gap: 17px; }
  .connect-banner { flex-direction: column; align-items: stretch; }
  .connect-banner .button { width: 100%; }
  dialog.modal { width: 100%; max-width: 100%; max-height: 94dvh; margin: auto 0 0; border: 1px solid #3a4b5d; border-bottom: 0; border-radius: 22px 22px 0 0; }
  .modal-header { padding: 16px 19px 14px; }
  .modal-header h2, .modal-header h3 { font-size: 1.125rem; }
  .modal-body { padding: 21px 19px; }
  .modal-footer { padding: 16px 19px calc(18px + env(safe-area-inset-bottom, 0px)); }
  .modal-footer .button { flex: 1; }
  .form-grid { gap: 19px 14px; }
  .field label { font-size: .8125rem; }
  .change-row { grid-template-columns: 1.1fr 1fr 1fr; gap: 10px; padding: 12px; font-size: .8125rem; }
  .coach-actions .button { flex: 1; }
  .coach-summary textarea { font-size: 16px; }
}
@media (max-width: 360px) {
  .main { padding-left: 12px; padding-right: 12px; }
  .topbar { padding-left: 12px; padding-right: 12px; }
  .mobile-brand { font-size: .8125rem; gap: 7px; }
  .topbar-actions .button.small { font-size: .6875rem; padding: 7px; }
  .hero-card { padding: 19px 15px; gap: 8px; }
  .hero-title { font-size: 1.375rem; }
  .readiness-ring { width: 86px; height: 86px; }
  .dashboard-grid .readiness-ring { width: 86px; height: 86px; }
  .dashboard-grid .ring-value { font-size: 1.75rem; }
  .ring-value > .ring-label, .dashboard-grid .ring-label { width: 63px; font-size: .625rem; }
  .hero-visual > .source-text, .dashboard-grid .hero-visual > .source-text { max-width: 90px; }
  .week-strip { gap: 4px; }
  .ring-value { font-size: 1.75rem; }
  .ring-label { font-size: .625rem; }
  .card { padding: 16px; }
  .card-heading { gap: 8px; }
  .card-heading .badge { max-width: 85px; }
  .activity-icon { width: 32px; height: 34px; }
  .activity-icon svg { width: 19px; height: 19px; }
  .activity-row { gap: 8px; }
  .activity-stats { max-width: 36%; }
  .form-grid { gap: 17px 11px; }
  .metric-grid { gap: 18px 13px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
@media print {
  body { color: #14202d; background: white; }
  .sidebar, .topbar, .heading-actions, .filter-bar, .toast, .button, .card-action { display: none !important; }
  .workspace { margin: 0; }
  .main { padding: 0; max-width: none; }
  .card, .hero-card, .stat-card { color: #14202d; border: 1px solid #ccd4dd; background: white; box-shadow: none; break-inside: avoid; }
  .metric-label, .metric-note, .stat-label, .source-text, .subtitle, .unit, .activity-meta, .activity-duration, .status-bar { color: #4a5a69; }
}
