:root {
  --bg: #090b0f;
  --panel: #10141b;
  --panel-2: #141924;
  --border: rgba(255,255,255,0.07);
  --border-strong: rgba(255,255,255,0.14);
  --text: #eef1f6;
  --text-dim: #8992a3;
  --text-faint: #545d6e;
  --lime: #c8f542;
  --lime-dim: #94b32e;
  --coral: #db7c6b;
  --coral-dim: #c05f4d;
  --cyan: #3fc6f1;
  --orange: #f2a33e;
  --red: #c65a63;
  --green-build: #7f9c4c;
  --amber-taper: #cf9a3e;
  --pink-speed: #d6577f;
  --slate-lift: #6b7690;
  --mono: "SF Mono", "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: radial-gradient(ellipse at top, #131826 0%, var(--bg) 55%);
  color: var(--text);
  font-family: var(--sans);
  min-height: 100vh;
}

/* app shell: sidebar + main column */
.app-shell { display: flex; min-height: 100vh; align-items: stretch; }

.sidebar {
  width: 220px; flex: none;
  background: var(--panel);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  padding: calc(14px + env(safe-area-inset-top)) 0 20px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.sidebar-brand {
  font-family: var(--mono); font-weight: 700; letter-spacing: 0.12em; font-size: 13.5px;
  display: flex; align-items: center; gap: 8px;
  padding: 6px 20px 22px;
}
.brand-dot {
  width: 8px; height: 8px; border-radius: 50%; flex: none;
  background: var(--coral);
  box-shadow: 0 0 10px var(--coral);
}
.nav-item {
  display: block; width: 100%; text-align: left; background: transparent;
  border: none; border-left: 3px solid transparent;
  color: var(--text-dim); font-family: var(--sans); font-size: 14px; font-weight: 600;
  padding: 13px 20px 13px 17px; cursor: pointer; transition: all .15s;
}
.nav-item:hover { background: rgba(255,255,255,0.03); color: var(--text); }
.nav-item.active { border-left-color: var(--coral); background: rgba(219,124,107,0.08); color: var(--text); }

.sidebar-backdrop { display: none; }

.main-col {
  flex: 1; min-width: 0; display: flex; flex-direction: column;
  padding-top: env(safe-area-inset-top);
}

/* topbar */
.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
}
.hamburger {
  display: none; flex: none; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 8px;
  background: transparent; border: 1px solid var(--border-strong); color: var(--text);
  font-size: 17px; cursor: pointer;
}
.topbar-title {
  display: block; font-family: var(--mono); font-weight: 700; letter-spacing: 0.1em;
  font-size: 14px; color: var(--text); flex: 1;
}
.topbar-countdown {
  flex: none; font-family: var(--mono); font-size: 12.5px; font-weight: 700;
  color: var(--lime); letter-spacing: 0.03em; white-space: nowrap;
  background: rgba(200,245,66,0.08); border: 1px solid rgba(200,245,66,0.25);
  border-radius: 999px; padding: 6px 12px;
}

.btn {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  border-radius: 8px;
  padding: 9px 14px;
  border: 1px solid var(--border-strong);
  background: var(--panel-2);
  color: var(--text);
  cursor: pointer;
  transition: border-color .15s, transform .1s, background .15s;
}
.btn:hover { border-color: rgba(255,255,255,0.3); background: #1a2029; }
.btn:active { transform: translateY(1px); }
.btn-ghost { background: transparent; }
.btn-primary {
  background: var(--coral);
  color: #180d0a;
  border-color: var(--coral);
  width: 100%;
  padding: 14px;
  font-size: 14px;
  letter-spacing: 0.08em;
  font-weight: 800;
  border-radius: 10px;
}
.btn-primary:hover { background: #e6917e; }
.btn-file { position: relative; overflow: hidden; }

/* generic card */
.card {
  background: linear-gradient(180deg, var(--panel) 0%, #0d1016 100%);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
}

.block-label {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  color: var(--text-faint);
  font-weight: 700;
  margin-bottom: 6px;
}

.dashboard {
  display: flex; flex-direction: column; gap: 16px;
  max-width: 1040px; width: 100%; margin: 0 auto;
  padding: 24px 24px calc(48px + env(safe-area-inset-bottom));
}

.view { display: none; }
.view.active { display: flex; flex-direction: column; gap: 16px; }

.current-week-title { font-size: 16px; font-weight: 700; margin: 4px 0 4px; }

.profile-card { max-width: 660px; }
.profile-title { font-size: 17px; font-weight: 700; margin: 4px 0 4px; }
.profile-body { display: flex; flex-direction: column; gap: 14px; margin: 18px 0 20px; }
.profile-actions { display: flex; gap: 10px; }
.profile-actions .btn-primary { flex: 1; }
.profile-placeholder-note { font-size: 13px; color: var(--text-dim); line-height: 1.6; margin: 16px 0 4px; }
.profile-placeholder-note b { color: var(--coral); }

.account-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: rgba(255,255,255,0.02); border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 14px;
}
.account-info { display: flex; flex-direction: column; gap: 3px; }
.account-info span { font-family: var(--mono); font-size: 9.5px; letter-spacing: .1em; color: var(--text-faint); font-weight: 700; }
.account-info b { font-size: 14px; color: var(--text); }
.lang-toggles { display: flex; gap: 8px; }
.lang-toggle {
  flex: 1; padding: 10px 0; border-radius: 8px; border: 1px solid var(--border-strong);
  background: rgba(255,255,255,0.03); color: var(--text-dim); font-family: var(--sans);
  font-size: 13px; font-weight: 600; cursor: pointer; transition: all .15s;
}
.lang-toggle:hover { border-color: rgba(255,255,255,0.3); }
.lang-toggle.active { background: var(--coral); border-color: var(--coral); color: #180d0a; }

/* login screen */
.login-screen {
  display: none; position: fixed; inset: 0; z-index: 100;
  align-items: center; justify-content: center; padding: 20px;
  background: radial-gradient(ellipse at top, #131826 0%, var(--bg) 55%);
}
.login-screen.active { display: flex; }
.login-card {
  width: 100%; max-width: 360px; background: linear-gradient(180deg, var(--panel) 0%, #0d1016 100%);
  border: 1px solid var(--border-strong); border-radius: 14px; padding: 28px;
  display: flex; flex-direction: column; gap: 14px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.5);
}
.login-brand {
  font-family: var(--mono); font-weight: 700; letter-spacing: 0.12em; font-size: 14px;
  display: flex; align-items: center; gap: 8px; justify-content: center; margin-bottom: 4px;
}
.login-title { font-size: 18px; font-weight: 700; text-align: center; margin-bottom: 6px; }
.login-error { font-size: 12.5px; color: var(--red); min-height: 16px; text-align: center; }
.onboarding-card { max-width: 420px; max-height: 90vh; overflow-y: auto; }
.onboarding-hint { font-size: 12.5px; color: var(--text-faint); line-height: 1.5; text-align: center; margin: -6px 0 4px; }

.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.stats-grid .zones-card { grid-column: 1 / -1; }

/* days off calendar */
.calendar-card { max-width: 480px; }
.calendar-title { font-size: 17px; font-weight: 700; margin: 4px 0 8px; }
.calendar-hint { font-size: 12px; color: var(--text-faint); line-height: 1.5; margin-bottom: 18px; }
.calendar-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.calendar-nav-btn { width: 38px; height: 38px; padding: 0; font-size: 18px; line-height: 1; flex: none; }
.calendar-month { font-family: var(--mono); font-weight: 700; font-size: 14px; letter-spacing: 0.04em; }
.calendar-weekday-row {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px;
  font-family: var(--mono); font-size: 10.5px; color: var(--text-faint); text-align: center;
  margin-bottom: 6px; font-weight: 700;
}
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.calendar-day {
  aspect-ratio: 1; border-radius: 8px; border: 1px solid var(--border);
  background: rgba(255,255,255,0.02); color: var(--text-dim); font-family: var(--mono);
  font-size: 12.5px; cursor: pointer; transition: all .12s; display: flex; align-items: center; justify-content: center;
}
.calendar-day:hover:not(.cal-disabled):not(.cal-empty) { border-color: var(--coral); color: var(--text); }
.calendar-day.cal-empty { visibility: hidden; cursor: default; }
.calendar-day.cal-disabled { color: var(--text-faint); opacity: 0.35; cursor: default; }
.calendar-day.cal-today { border-color: var(--cyan); color: var(--cyan); font-weight: 700; }
.calendar-day.cal-blocked-date { background: var(--coral); border-color: var(--coral); color: #180d0a; font-weight: 700; }
.calendar-day.cal-blocked-weekly { background: rgba(255,255,255,0.05); color: var(--text-faint); cursor: default; text-decoration: line-through; }
.calendar-legend { display: flex; gap: 16px; margin-top: 16px; font-size: 11px; color: var(--text-faint); flex-wrap: wrap; }
.calendar-legend span { display: flex; align-items: center; gap: 6px; }
.cal-swatch { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.cal-swatch-off { background: var(--coral); }
.cal-swatch-weekly { background: rgba(255,255,255,0.15); }

/* top row */
.row-top { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; align-items: stretch; }

.race-card { display: flex; flex-direction: column; justify-content: center; gap: 14px; }
.race-flag {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--lime);
  display: flex; align-items: center; gap: 8px;
}
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.dot-live { background: var(--lime); box-shadow: 0 0 8px var(--lime); animation: pulse 2s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.35} }

.race-countdown { display: flex; align-items: baseline; gap: 12px; }
.race-countdown span:first-child {
  font-family: var(--mono);
  font-size: 64px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
  background: linear-gradient(180deg, #ffffff, #b9c2d1);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.race-countdown-suffix { font-size: 19px; color: var(--text-dim); font-weight: 500; }

.race-title { font-family: var(--mono); font-size: 15px; font-weight: 700; letter-spacing: 0.03em; color: var(--text); }

.tag-row { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-faint);
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 11px;
  letter-spacing: 0.04em;
}
.pill b { color: var(--text); font-weight: 700; margin-left: 3px; }
.pill-phase b { color: var(--cyan); }

/* stat stack */
.stat-stack { display: flex; flex-direction: column; gap: 16px; }
.stat-card { display: flex; align-items: center; gap: 14px; padding: 16px; flex: 1; }
.stat-label { font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em; color: var(--text-faint); font-weight: 700; }
.stat-value { font-size: 22px; font-weight: 700; margin-top: 2px; }
.stat-value span { font-family: var(--mono); }
.stat-sub { font-size: 11.5px; color: var(--text-faint); margin-top: 2px; }

.ring {
  --pct: 0%;
  width: 52px; height: 52px; border-radius: 50%; flex: none;
  background: conic-gradient(var(--orange) var(--pct), rgba(255,255,255,0.08) 0);
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.ring::before {
  content: ""; position: absolute; inset: 5px; border-radius: 50%; background: #0d1016;
}
.ring span { position: relative; font-family: var(--mono); font-size: 11px; font-weight: 700; }
.ring-cyan { background: conic-gradient(var(--cyan) var(--pct), rgba(255,255,255,0.08) 0); }
.ring-flat { background: rgba(255,255,255,0.06); }
.ring-flat span { color: var(--text-faint); font-size: 16px; }

/* block distance */
.block-distance { }
.block-main { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.block-number { font-family: var(--mono); font-size: 46px; font-weight: 800; color: var(--lime); line-height: 1; }
.block-unit { font-size: 20px; color: var(--lime-dim); margin-left: 6px; font-weight: 600; }
.block-detail { flex: 1; min-width: 260px; }
.block-detail-line { font-size: 13px; color: var(--text-dim); margin-bottom: 8px; }
.block-detail-line b { color: var(--text); }
.block-detail-sub { font-size: 11.5px; color: var(--text-faint); margin-top: 8px; }
.progress-bar { height: 6px; border-radius: 4px; background: rgba(255,255,255,0.06); overflow: hidden; }
.progress-bar-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--lime-dim), var(--lime)); border-radius: 4px; transition: width .4s; }

/* timeline */
.timeline-head { display: flex; justify-content: space-between; align-items: baseline; }
.timeline-peak { font-family: var(--mono); font-size: 11px; color: var(--text-faint); }
.timeline-bars { display: flex; gap: 4px; height: 64px; align-items: flex-end; margin: 16px 0 10px; position: relative; }
.timeline-bar {
  flex: 1;
  border-radius: 3px 3px 2px 2px;
  min-width: 0;
  cursor: pointer;
  transition: opacity .12s, transform .12s;
  position: relative;
}
.timeline-bar:hover { opacity: 0.75; transform: translateY(-2px); }
.timeline-bar.foundation { background: var(--cyan); }
.timeline-bar.build { background: var(--green-build); }
.timeline-bar.peak { background: var(--red); }
.timeline-bar.taper { background: var(--amber-taper); }
.timeline-bar.week-done::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: -6px; height: 3px;
  background: var(--lime); border-radius: 2px;
}
.timeline-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 11.5px; color: var(--text-faint); align-items: center; }
.timeline-legend span { display: flex; align-items: center; gap: 6px; }
.timeline-hint { margin-left: auto; font-style: italic; opacity: .8; }
.swatch { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
.swatch-foundation { background: var(--cyan); }
.swatch-build { background: var(--green-build); }
.swatch-peak { background: var(--red); }
.swatch-taper { background: var(--amber-taper); }
.timeline-tooltip {
  position: absolute; display: none; pointer-events: none;
  background: #1a2029; border: 1px solid var(--border-strong); border-radius: 8px;
  padding: 8px 11px; font-size: 12px; font-family: var(--mono); z-index: 20;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4); white-space: nowrap;
}

/* main row */
.row-main { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; align-items: start; }
.side-stack { display: flex; flex-direction: column; gap: 16px; }

/* schedule */
.schedule-head { margin-bottom: 8px; }
.schedule-title { font-size: 16px; font-weight: 700; margin-top: 4px; }
.schedule-hint { font-size: 12px; color: var(--text-faint); margin-top: 6px; line-height: 1.5; }
.schedule-hint b { color: var(--text-dim); }

.week-list { margin-top: 14px; display: flex; flex-direction: column; gap: 6px; }
.week-row { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: rgba(255,255,255,0.015); }
.week-row-head {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px; cursor: pointer; user-select: none;
}
.week-row-head:hover { background: rgba(255,255,255,0.03); }
.week-caret { color: var(--text-faint); font-size: 11px; transition: transform .15s; flex: none; width: 12px; }
.week-row.open .week-caret { transform: rotate(90deg); }
.week-phase-chip { width: 6px; align-self: stretch; border-radius: 3px; flex: none; }
.week-title { font-weight: 700; font-size: 13.5px; flex: none; }
.week-meta { font-size: 11.5px; color: var(--text-faint); font-family: var(--mono); }
.week-progress-mini { margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--text-faint); display:flex; align-items:center; gap:8px; }
.week-km-chip { font-family: var(--mono); font-size: 11px; color: var(--text-dim); background: rgba(255,255,255,0.05); padding: 2px 8px; border-radius: 999px; }

.week-body { display: none; padding: 4px 14px 16px 34px; border-top: 1px solid var(--border); }
.week-row.open .week-body { display: block; }
.week-note { font-size: 12px; color: var(--text-dim); margin: 12px 0 14px; line-height: 1.5; }
.week-note b { color: var(--amber-taper); }
.adaptive-note {
  font-size: 11.5px; color: var(--amber-taper); background: rgba(207,154,62,0.1);
  border: 1px solid rgba(207,154,62,0.3); border-radius: 8px; padding: 8px 12px;
  margin: -4px 0 14px; line-height: 1.4;
}
.excused-chip {
  font-family: var(--mono); font-size: 9.5px; font-weight: 800; letter-spacing: .06em;
  color: var(--cyan); background: rgba(63,198,241,0.12); border: 1px solid rgba(63,198,241,0.3);
  border-radius: 999px; padding: 2px 8px; flex: none;
}
.excuse-toggle {
  display: block; width: 100%; margin: 0 0 16px; padding: 9px 12px; font-size: 11.5px;
  font-family: var(--sans); text-align: center; border-radius: 8px; cursor: pointer;
  background: transparent; border: 1px dashed var(--border-strong); color: var(--text-faint);
  transition: all .15s;
}
.excuse-toggle:hover { border-color: var(--cyan); color: var(--cyan); }
.excuse-toggle.active { border-style: solid; border-color: var(--cyan); color: var(--cyan); background: rgba(63,198,241,0.08); }

.day-group { padding: 10px 0; border-top: 1px solid var(--border); }
.day-group:first-child { border-top: none; }
.day-date { font-family: var(--mono); font-size: 10.5px; color: var(--text-faint); letter-spacing: .05em; margin-bottom: 8px; }

.session { display: flex; gap: 10px; padding: 6px 0; }
.session + .session { margin-top: 4px; }
.session-check {
  width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid var(--border-strong);
  flex: none; margin-top: 2px; cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: transparent; transition: all .15s; background: transparent;
}
.session-check:hover { border-color: var(--lime); }
.session.done .session-check { background: var(--lime); border-color: var(--lime); color: #10140a; }
.session-main { flex: 1; min-width: 0; }
.session-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tag {
  font-family: var(--mono); font-size: 9.5px; font-weight: 800; letter-spacing: .06em;
  padding: 2px 6px; border-radius: 4px; color: #0c0e12; flex: none;
}
.tag-speed { background: var(--pink-speed); }
.tag-lift { background: var(--slate-lift); color: #eef1f6; }
.tag-easy { background: #4fae7a; }
.tag-tempo { background: var(--amber-taper); }
.tag-rest { background: #3a4152; color: #b7bfd0; }
.tag-long { background: #8a6fd1; }
.tag-recovery { background: #4a90a4; }
.session-name { font-size: 13.5px; font-weight: 700; }
.session.done .session-name { color: var(--text-dim); text-decoration: line-through; text-decoration-color: var(--text-faint); }
.session-desc { font-size: 12px; color: var(--text-faint); margin-top: 2px; line-height: 1.5; }
.session-inputs { display: flex; gap: 8px; margin-top: 8px; }
.session-inputs input {
  background: rgba(255,255,255,0.03); border: 1px solid var(--border); border-radius: 7px;
  color: var(--text); font-family: var(--sans); font-size: 12.5px; padding: 7px 10px;
}
.session-km-input { width: 78px; font-family: var(--mono); }
.session-note-input { flex: 1; min-width: 0; }
.session-inputs input:focus { outline: none; border-color: var(--coral); }
.session-inputs input::placeholder { color: var(--text-faint); }

/* zones */
.zones-title { font-size: 14px; font-weight: 700; margin-bottom: 12px; }
.zones-list { display: flex; flex-direction: column; gap: 10px; }
.zone-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.zone-name { font-size: 12.5px; font-weight: 700; }
.zone-desc { font-size: 10.5px; color: var(--text-faint); margin-top: 1px; }
.zone-pace { font-family: var(--mono); font-size: 12.5px; color: var(--cyan); font-weight: 700; white-space: nowrap; }
.zones-note { font-size: 11px; color: var(--text-faint); line-height: 1.5; margin-top: 14px; border-top: 1px solid var(--border); padding-top: 12px; }

/* charts */
.chart-canvas-wrap { position: relative; height: 160px; margin-top: 10px; }
.chart-canvas-wrap canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; }
.chart-title { font-size: 13.5px; font-weight: 700; }
.chart-legend { display: flex; gap: 16px; margin-top: 8px; font-size: 11px; color: var(--text-faint); }
.chart-legend span { display: flex; align-items: center; gap: 6px; }
.line-swatch { width: 14px; height: 2px; display: inline-block; }
.line-solid { background: var(--lime); }
.line-dashed { background: repeating-linear-gradient(90deg, var(--text-faint) 0 4px, transparent 4px 7px); }
.chart-note { font-size: 11px; color: var(--text-faint); line-height: 1.5; margin-top: 10px; }
.chart-note b { color: var(--text-dim); }

/* checkin */
.checkin-title { font-size: 17px; font-weight: 700; margin: 4px 0 18px; }
.checkin-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field span { font-family: var(--mono); font-size: 10px; letter-spacing: .1em; color: var(--text-faint); font-weight: 700; }
.field input, .field select, .field textarea {
  background: rgba(255,255,255,0.03); border: 1px solid var(--border-strong); border-radius: 9px;
  color: var(--text); font-family: var(--sans); font-size: 13.5px; padding: 11px 12px;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--coral); }
.field input::placeholder, .field textarea::placeholder { color: var(--text-faint); }
.field-wide { grid-column: span 2; }
.field-notes textarea { resize: vertical; min-height: 44px; font-family: var(--sans); }
.field-pair { display: flex; gap: 8px; }
.field-pair input { width: 100%; }
.field-triple { display: flex; align-items: center; gap: 6px; }
.field-triple input { width: 100%; text-align: center; }
.field-sep { color: var(--text-faint); font-family: var(--mono); font-weight: 700; }
.field-readout {
  background: rgba(255,255,255,0.02); border: 1px dashed var(--border-strong); border-radius: 9px;
  color: var(--text-dim); font-family: var(--mono); font-size: 13.5px; padding: 11px 12px;
}

/* weekday toggles — default (untouched) = training day (active/coral);
   tapping a day marks it as a day off (dimmed), matching the "Training Days" label. */
.weekday-toggles { display: flex; gap: 6px; }
.day-toggle {
  flex: 1; padding: 10px 0; border-radius: 8px; border: 1px solid var(--coral);
  background: var(--coral); color: #180d0a; font-family: var(--mono);
  font-size: 12px; font-weight: 700; cursor: pointer; transition: all .15s;
}
.day-toggle:hover { opacity: 0.85; }
.day-toggle.off {
  background: rgba(255,255,255,0.03); border-color: var(--border-strong); color: var(--text-dim); opacity: 1;
}
.day-toggle.off:hover { border-color: rgba(255,255,255,0.3); }

/* blocked date ranges */
.blocked-ranges-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.blocked-range-row { display: flex; gap: 6px; align-items: center; }
.blocked-range-row input[type="date"] { flex: 1.1; min-width: 0; }
.blocked-range-row input[type="text"] { flex: 1; min-width: 0; }
.blocked-range-row .br-remove {
  flex: none; width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--border-strong);
  background: transparent; color: var(--text-faint); cursor: pointer; font-size: 14px;
}
.blocked-range-row .br-remove:hover { color: var(--coral); border-color: var(--coral); }
.blocked-ranges-empty { font-size: 12px; color: var(--text-faint); font-style: italic; padding: 4px 0; }
.btn-add-range { width: 100%; font-size: 12.5px; padding: 10px; }

/* modal */
.modal-backdrop {
  display: none; position: fixed; inset: 0; background: rgba(4,5,8,0.7);
  align-items: center; justify-content: center; z-index: 50; padding: 20px;
  backdrop-filter: blur(3px);
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--panel); border: 1px solid var(--border-strong); border-radius: 14px;
  width: 100%; max-width: 480px; max-height: 86vh; display: flex; flex-direction: column;
  box-shadow: 0 24px 60px rgba(0,0,0,0.5);
}
.modal-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 20px; border-bottom: 1px solid var(--border); font-weight: 700; font-size: 14px;
}
.modal-body { padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; overflow-y: auto; }
.modal-foot { padding: 16px 20px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: space-between; }
.modal-foot .btn-primary { width: auto; flex: 1; }

/* responsive */
@media (max-width: 900px) {
  .row-top { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr; }
  .checkin-grid { grid-template-columns: repeat(2, 1fr); }
  .race-countdown span:first-child { font-size: 48px; }
  .block-number { font-size: 36px; }
  .dashboard { padding: 18px 16px calc(40px + env(safe-area-inset-bottom)); }

  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; width: 260px; z-index: 60;
    transform: translateX(-100%); transition: transform .22s ease;
    box-shadow: 20px 0 40px rgba(0,0,0,0.4);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-backdrop {
    display: block; position: fixed; inset: 0; background: rgba(4,5,8,0.6);
    z-index: 50; opacity: 0; pointer-events: none; transition: opacity .22s ease;
  }
  .sidebar-backdrop.open { opacity: 1; pointer-events: auto; }
  .hamburger { display: flex; }
  .topbar-title { display: block; }
}
@media (max-width: 560px) {
  .checkin-grid { grid-template-columns: 1fr; }
  .field-wide { grid-column: span 1; }
  .session-inputs { flex-direction: column; }
  .session-km-input { width: 100%; }
}
@media (max-width: 480px) {
  .topbar { padding: 14px 16px; }
  .topbar-actions .btn { padding: 9px 11px; font-size: 12.5px; }
}
