/* ===== SUMMIT · app.css — alpine/summit design system ===== */
@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,400..800&family=Schibsted+Grotesk:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root {
  --bg:        #f1efe8;   /* warm alpine paper */
  --bg-deep:   #181c19;   /* charcoal sidebar */
  --surface:   #ffffff;
  --surface-2: #f5f3ec;
  --tile:      #ece7da;   /* beige metric tile (Garmin) */
  --ink:       #1b211c;
  --muted:     #5e665e;
  --faint:     #8b9189;
  --line:      #e6e2d7;
  --line-2:    #d8d3c5;

  --accent:    #159a82;   /* summit emerald */
  --accent-ink:#0c6f5d;
  --accent-soft:#e1f2ed;
  --sun:       #e8743b;   /* summit sunrise */
  --sun-soft:  #fbeadf;
  --good:      #1f8a4c;
  --good-soft: #e6f4ec;
  --bad:       #c2433a;
  --bad-soft:  #fbeae8;
  --warn:      #b9791f;
  --warn-soft: #faf1e0;

  --radius:   16px;
  --radius-sm:11px;
  --shadow:   0 1px 2px rgba(16,33,43,.05), 0 8px 24px rgba(16,33,43,.06);
  --shadow-sm:0 1px 2px rgba(16,33,43,.06);

  --sans: 'Schibsted Grotesk', system-ui, -apple-system, sans-serif;
  --disp: 'Bricolage Grotesque', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

/* topographic backdrop */
.topo {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-color: var(--bg);
  background-image:
    radial-gradient(120% 90% at 100% 0%, rgba(21,154,130,.06), transparent 55%),
    radial-gradient(110% 80% at 0% 100%, rgba(232,116,59,.05), transparent 55%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='800' height='800' viewBox='0 0 800 800'%3E%3Cg fill='none' stroke='%23159a82' stroke-opacity='0.05' stroke-width='1.2'%3E%3Cpath d='M400 400m-40 0a40 40 0 1 0 80 0a40 40 0 1 0 -80 0'/%3E%3Cpath d='M400 400m-90 0a90 90 0 1 0 180 0a90 90 0 1 0 -180 0'/%3E%3Cpath d='M400 400m-150 0a150 150 0 1 0 300 0a150 150 0 1 0 -300 0'/%3E%3Cpath d='M400 400m-220 0a220 220 0 1 0 440 0a220 220 0 1 0 -440 0'/%3E%3Cpath d='M400 400m-300 0a300 300 0 1 0 600 0a300 300 0 1 0 -600 0'/%3E%3Cpath d='M400 400m-390 0a390 390 0 1 0 780 0a390 390 0 1 0 -780 0'/%3E%3C/g%3E%3C/svg%3E");
  background-size: cover, cover, 760px 760px;
}

/* Garmin / metric tile (beige, as in mockup) */
.tile { background: var(--tile); border-radius: 11px; padding: 11px 12px; }
.tile .tl { font-size: 11px; color: var(--muted); font-weight: 500; line-height: 1.25; }
.tile .tv { font-family: var(--disp); font-weight: 700; font-size: 19px; margin-top: 4px; line-height: 1; }
.tile .tv small { font-family: var(--sans); font-size: 11px; font-weight: 500; color: var(--faint); }
.tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px,1fr)); gap: 9px; }

/* ---------- layout ---------- */
.layout { position: relative; z-index: 1; display: flex; min-height: 100vh; }
.sidebar {
  width: 232px; flex-shrink: 0; position: sticky; top: 0; height: 100vh;
  background: var(--bg-deep); color: #cfe0ec;
  display: flex; flex-direction: column; padding: 20px 14px;
}
.side-brand {
  text-decoration: none; display: flex; align-items: center; gap: 11px; padding: 6px 8px 20px;
}
.brand-logo {
  width: 40px; height: 40px; flex-shrink: 0; border-radius: 11px;
  background: linear-gradient(150deg, var(--accent), var(--accent-ink));
  display: grid; place-items: center; box-shadow: 0 4px 12px rgba(21,154,130,.35);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-text b { font-family: var(--disp); font-weight: 700; font-size: 20px; letter-spacing: .12em; color: #fff; }
.brand-text small { font-family: var(--mono); font-size: 9.5px; letter-spacing: .14em; color: var(--faint); margin-top: 3px; }
.brand-mark { color: var(--sun); }
.side-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-link {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px;
  color: #9fb4c2; text-decoration: none; border-radius: 10px; font-weight: 500;
  font-size: 14.5px; transition: background .15s, color .15s;
}
.nav-link:hover { background: rgba(255,255,255,.06); color: #eaf2f8; }
.nav-link.active { background: var(--accent); color: #fff; }
.nav-ic { width: 20px; text-align: center; font-size: 15px; }
.nav-logout { margin-top: 8px; color: #7d909e; }

.main { flex: 1; min-width: 0; padding: 30px 34px 90px; }

/* ---------- page header ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-title { font-family: var(--disp); font-weight: 700; font-size: 30px; letter-spacing: -.01em; margin: 0; line-height: 1.1; }
.page-sub { color: var(--muted); margin: 4px 0 0; font-size: 14.5px; }
.eyebrow { font-family: var(--mono); text-transform: uppercase; letter-spacing: .16em; font-size: 11px; color: var(--accent-ink); font-weight: 600; }

/* ---------- cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px;
}
.card-tight { padding: 16px; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card-h h2, .card-h h3 { margin: 0; font-family: var(--disp); font-weight: 600; }
.card-h h2 { font-size: 18px; }
.card-h h3 { font-size: 15.5px; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.col-span-2 { grid-column: span 2; }

/* ---------- stat cards ---------- */
.stat { display: flex; flex-direction: column; gap: 6px; }
.stat-label { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.stat-value { font-family: var(--disp); font-weight: 700; font-size: 30px; line-height: 1; letter-spacing: -.02em; }
.stat-value .unit { font-size: 14px; font-weight: 500; color: var(--faint); font-family: var(--sans); margin-left: 3px; }
.stat-delta { font-family: var(--mono); font-size: 12.5px; font-weight: 500; display: inline-flex; align-items: center; gap: 4px; }
.delta-good { color: var(--good); }
.delta-bad  { color: var(--bad); }
.delta-flat { color: var(--faint); }

/* ---------- badges / pills ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; font-family: var(--mono); padding: 3px 9px; border-radius: 999px; letter-spacing: .02em; }
.b-good { background: var(--good-soft); color: var(--good); }
.b-bad  { background: var(--bad-soft);  color: var(--bad); }
.b-warn { background: var(--warn-soft); color: var(--warn); }
.b-accent { background: var(--accent-soft); color: var(--accent-ink); }
.b-sun  { background: var(--sun-soft); color: var(--sun); }
.b-muted{ background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }

.tag { display: inline-flex; font-size: 11px; font-weight: 600; font-family: var(--mono); text-transform: uppercase; letter-spacing: .08em; padding: 2px 8px; border-radius: 6px; background: var(--accent-soft); color: var(--accent-ink); }
.tag.strength { background: #efeafc; color: #6b3fc4; }
.tag.cardio   { background: var(--accent-soft); color: var(--accent-ink); }
.tag.swim     { background: #e3f4f7; color: #167a8c; }
.tag.run      { background: var(--sun-soft); color: var(--sun); }
.tag.recovery { background: var(--good-soft); color: var(--good); }
.tag.mobility { background: #f0f0e6; color: #79762f; }

/* ---------- buttons ---------- */
.btn {
  font-family: var(--sans); font-size: 14.5px; font-weight: 600; cursor: pointer;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink);
  padding: 10px 16px; border-radius: 10px; text-decoration: none; display: inline-flex;
  align-items: center; gap: 8px; transition: transform .04s, box-shadow .15s, background .15s; line-height: 1;
}
.btn:hover { box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-ink); }
.btn-sun { background: var(--sun); border-color: var(--sun); color: #fff; }
.btn-ghost { background: transparent; }
.btn-block { width: 100%; justify-content: center; }
.btn-sm { padding: 7px 12px; font-size: 13px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--muted); }
input[type=text], input[type=password], input[type=number], input[type=date], select, textarea {
  font-family: var(--sans); font-size: 15px; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 12px; width: 100%;
}
textarea { resize: vertical; min-height: 90px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 120px; }

/* ---------- alerts ---------- */
.alert { padding: 11px 14px; border-radius: 10px; font-size: 14px; margin: 12px 0; border: 1px solid transparent; }
.alert-good { background: var(--good-soft); color: var(--good); border-color: #cce8d6; }
.alert-bad  { background: var(--bad-soft);  color: var(--bad);  border-color: #f1c9c5; }
.alert-warn { background: var(--warn-soft); color: var(--warn); border-color: #ecd9b3; }
.alert-info { background: var(--accent-soft); color: var(--accent-ink); border-color: #c5dded; }

/* ---------- misc ---------- */
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.mono  { font-family: var(--mono); }
.small { font-size: 13px; }
.tiny  { font-size: 11.5px; }
.center { text-align: center; }
.spacer { height: 16px; }
.divider { height: 1px; background: var(--line); margin: 16px 0; border: 0; }
.flex { display: flex; gap: 10px; align-items: center; }
.flex-between { display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.mt0{margin-top:0}.mb0{margin-bottom:0}

ul.clean { list-style: none; padding: 0; margin: 0; }

/* ---------- timeline / gantt ---------- */
.gantt { position: relative; }
.gantt-axis { display: flex; font-family: var(--mono); font-size: 11px; color: var(--faint); border-bottom: 1px dashed var(--line-2); padding-bottom: 6px; margin-bottom: 12px; }
.gantt-axis span { flex: 1; text-align: center; }
.gantt-row { display: flex; align-items: center; gap: 12px; margin: 12px 0; }
.gantt-name { width: 92px; flex-shrink: 0; font-size: 12.5px; font-weight: 600; }
.gantt-track { position: relative; flex: 1; height: 30px; background: var(--surface-2); border-radius: 8px; border: 1px solid var(--line); }
.gantt-bar { position: absolute; top: 4px; height: 22px; border-radius: 6px; display: flex; align-items: center; padding: 0 9px; font-size: 11.5px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; }
.gantt-bar.short  { background: linear-gradient(90deg,#1f6fa3,#2a86c2); }
.gantt-bar.medium { background: linear-gradient(90deg,#167a8c,#1ba0b6); }
.gantt-bar.long   { background: linear-gradient(90deg,#e8743b,#f0935f); }
.gantt-mile { position: absolute; top: -3px; width: 10px; height: 10px; background: var(--bg-deep); border: 2px solid #fff; border-radius: 50%; transform: translateX(-50%); box-shadow: var(--shadow-sm); }
.gantt-today { position: absolute; top: -6px; bottom: -6px; width: 2px; background: var(--sun); z-index: 3; }
.gantt-today::after { content: 'today'; position: absolute; top: -16px; left: 50%; transform: translateX(-50%); font-family: var(--mono); font-size: 9px; color: var(--sun); }

/* ---------- month cards ---------- */
.month-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px,1fr)); gap: 14px; }
.month-card { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px; background: var(--surface); }
.month-card h4 { margin: 0 0 4px; font-family: var(--disp); font-size: 15px; }
.month-targets { font-family: var(--mono); font-size: 12px; color: var(--accent-ink); margin: 6px 0; }

/* ---------- charts ---------- */
.chart-wrap { width: 100%; overflow: hidden; }
.chart-wrap svg { width: 100%; height: auto; display: block; }
.chart-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 8px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

/* ---------- plan day blocks ---------- */
.day-block { border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.day-head { background: var(--surface-2); padding: 10px 14px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); }
.day-head .d { font-family: var(--disp); font-weight: 600; font-size: 15px; }
.act-item { display: flex; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--line); }
.act-item:last-child { border-bottom: 0; }
.act-body { flex: 1; }
.act-title { font-weight: 600; font-size: 14.5px; }
.act-detail { font-size: 13px; color: var(--muted); margin-top: 2px; }
.act-title-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.act-check { width: 18px; height: 18px; border: 2px solid var(--line-2); border-radius: 6px; flex-shrink: 0; margin-top: 1px; cursor: pointer; transition: background .12s, border-color .12s; }
.act-check:hover { border-color: var(--accent); }
.act-check.on { background: var(--accent); border-color: var(--accent); position: relative; }
.act-check.on::after { content: '✓'; color: #fff; font-size: 12px; position: absolute; top: -2px; left: 2px; }
.act-item.done .act-title { text-decoration: line-through; color: var(--faint); }
.meal-list { padding: 6px 14px 12px; }
.meal-head { font-family: var(--mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--accent-ink); padding: 6px 0 4px; }
.meal-row { display: flex; gap: 8px; padding: 5px 0; font-size: 13.5px; }
.meal-k { font-family: var(--mono); font-size: 11px; text-transform: uppercase; color: var(--faint); width: 72px; flex-shrink: 0; padding-top: 2px; }

/* ---------- upload zone ---------- */
.dropzone { border: 2px dashed var(--line-2); border-radius: var(--radius); padding: 26px; text-align: center; color: var(--muted); cursor: pointer; transition: border-color .15s, background .15s; background: var(--surface-2); }
.dropzone:hover, .dropzone.drag { border-color: var(--accent); background: var(--accent-soft); }
.thumbs { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.thumb { position: relative; width: 78px; height: 78px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line-2); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb .rm { position: absolute; top: 2px; right: 2px; background: rgba(0,0,0,.6); color: #fff; border: 0; border-radius: 50%; width: 18px; height: 18px; cursor: pointer; font-size: 11px; line-height: 1; }

/* ---------- meter bars ---------- */
.meter { height: 9px; border-radius: 999px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--line); }
.meter > i { display: block; height: 100%; border-radius: 999px; background: var(--accent); }
.meter.over > i { background: var(--bad); }
.meter.sun > i { background: var(--sun); }
.meter.good > i { background: var(--good); }

/* ---------- progress bars (milestones) ---------- */
.prog { height: 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.prog > i { display: block; height: 100%; background: linear-gradient(90deg,var(--accent),var(--sun)); }

/* ---------- table ---------- */
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
table.tbl th { text-align: left; font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line-2); }
table.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--line); }
table.tbl tr:last-child td { border-bottom: 0; }
.num { font-family: var(--mono); }

/* ---------- chat ---------- */
.chat-stream { display: flex; flex-direction: column; gap: 12px; padding: 4px 2px 16px; }
.msg { max-width: 80%; padding: 11px 14px; border-radius: 14px; font-size: 14.5px; line-height: 1.5; white-space: pre-wrap; }
.msg.user { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.msg.assistant { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.chat-input { display: flex; gap: 10px; position: sticky; bottom: 0; background: var(--bg); padding: 10px 0; }

/* ---------- milestone list ---------- */
.mile { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--line); }
.mile:last-child { border-bottom: 0; }
.mile-dot { width: 12px; height: 12px; border-radius: 50%; margin-top: 4px; flex-shrink: 0; border: 2px solid var(--accent); background: #fff; }
.mile-dot.done { background: var(--good); border-color: var(--good); }
.mile-date { font-family: var(--mono); font-size: 12px; color: var(--accent-ink); }

/* ---------- anchor banner ---------- */
.anchor-banner { display: flex; align-items: center; gap: 10px; background: var(--bg-deep); color: #cfe0ec; padding: 12px 16px; border-radius: var(--radius); font-size: 13.5px; }
.anchor-banner b { color: #fff; }

/* ---------- login ---------- */
.login-body { display: grid; place-items: center; min-height: 100vh; }
.login-wrap { position: relative; z-index: 1; width: 100%; max-width: 380px; padding: 20px; }
.login-card { text-align: center; padding: 34px 28px; }
.login-card .brand-mark { font-size: 40px; display: block; margin-bottom: 4px; }
.brand-title { font-family: var(--disp); font-weight: 700; letter-spacing: .2em; font-size: 26px; margin: 0 0 4px; }

/* ---------- AI daily brief card (dark) ---------- */
.brief-card { background: linear-gradient(160deg, #1d2420, var(--bg-deep)); border-color: #2a322c; color: #d8e2dc; }
.brief-card h2 { color: #fff; }
.brief-spark { color: var(--accent); font-size: 16px; }
.brief-headline { font-family: var(--disp); font-weight: 700; font-size: 20px; color: #fff; line-height: 1.2; margin: 2px 0 8px; letter-spacing: -.01em; }
.brief-summary { color: #c2cec8; font-size: 14.5px; margin: 0 0 12px; }
.brief-callout { border-left: 3px solid var(--accent); background: rgba(21,154,130,.1); padding: 9px 13px; border-radius: 0 9px 9px 0; color: #e9f2ee; font-size: 13.5px; margin: 0 0 12px; }
.brief-lines { display: flex; flex-direction: column; gap: 6px; }
.brief-lines > div { font-size: 13.5px; color: #cfdad4; }
.brief-k { display: inline-block; font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: .1em; color: var(--accent); background: rgba(21,154,130,.14); padding: 2px 7px; border-radius: 5px; margin-right: 8px; vertical-align: middle; }
.brief-foot { font-family: var(--mono); font-size: 10.5px; color: #6f827b; margin-top: 12px; }
.brief-card .btn { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.16); color: #e8f0ec; }
.brief-card .btn:hover { background: rgba(255,255,255,.16); }

/* ---------- generic dark AI/insight card (matches mockup) ---------- */
.dark-card { background: linear-gradient(160deg, #1d2420, var(--bg-deep)); border: 1px solid #2a322c; border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; color: #d3ddd7; }
.dark-card h2, .dark-card h3 { color: #fff; }
.dark-eyebrow { font-family: var(--mono); text-transform: uppercase; letter-spacing: .16em; font-size: 11px; color: var(--accent); font-weight: 600; }
.dark-headline { font-family: var(--disp); font-weight: 700; font-size: 19px; color: #fff; line-height: 1.2; margin: 4px 0 8px; letter-spacing: -.01em; }
.dark-body { color: #c2cec8; font-size: 14px; margin: 0 0 12px; }
.dark-callout { border-left: 3px solid var(--accent); background: rgba(21,154,130,.1); padding: 9px 13px; border-radius: 0 9px 9px 0; color: #e9f2ee; font-size: 13.5px; margin: 0 0 12px; }
.dark-card ul { margin: 8px 0; padding-left: 0; list-style: none; }
.dark-card ul li { font-size: 13.5px; color: #cfdad4; padding: 3px 0 3px 16px; position: relative; }
.dark-card ul li::before { content: '›'; position: absolute; left: 2px; color: var(--accent); }
.dark-foot { font-family: var(--mono); font-size: 10.5px; color: #6f827b; margin-top: 12px; }
.dark-card .btn { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.16); color: #e8f0ec; }
.dark-card .btn:hover { background: rgba(255,255,255,.16); }
.dark-k { display: inline-block; font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: .1em; color: var(--accent); background: rgba(21,154,130,.14); padding: 2px 7px; border-radius: 5px; margin-right: 8px; }

/* phase number badges + milestone checklist (The Climb) */
.phase-num { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; font-family: var(--disp); font-weight: 700; color: #fff; flex-shrink: 0; }
.phase-num.short { background: var(--accent); }
.phase-num.medium { background: var(--sun); }
.phase-num.long { background: var(--bg-deep); }
.check-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 18px; margin: 4px 0; }
.check-item { display: flex; gap: 9px; align-items: flex-start; font-size: 13.5px; }
.check-dot { width: 17px; height: 17px; border-radius: 5px; border: 2px solid var(--line-2); flex-shrink: 0; margin-top: 1px; position: relative; }
.check-dot.done { background: var(--good); border-color: var(--good); }
.check-dot.done::after { content: '✓'; color: #fff; font-size: 11px; position: absolute; top: -2px; left: 2px; }
.anchor-banner.soft { background: var(--accent-soft); color: var(--accent-ink); }
.anchor-banner.soft b { color: var(--accent-ink); }
@media (max-width: 560px) { .check-grid { grid-template-columns: 1fr; } }

/* ---------- run progress bar ---------- */
.runbar { height: 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.runbar > i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--sun)); transition: width .35s ease; }
.runbar > i.ok { background: var(--good); }
.runbar > i.bad { background: var(--bad); }
.runbar-label { margin-top: 6px; font-family: var(--mono); font-size: 11.5px; }
.pulse { animation: sumpulse 1.3s ease-in-out infinite; }
@keyframes sumpulse { 0%,100% { opacity: .55 } 50% { opacity: 1 } }

/* ---------- activity tracker ---------- */
.filter-bar { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.filter-bar .field { margin-bottom: 0; }
.filter-bar input[type=date] { width: auto; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { font-family: var(--mono); font-size: 11.5px; font-weight: 600; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); cursor: pointer; color: var(--muted); }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }

.act-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px,1fr)); gap: 14px; }
.act-card { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px; background: var(--surface); position: relative; overflow: hidden; }
.act-card .ic { font-size: 20px; }
.act-card .nm { font-size: 12.5px; color: var(--muted); font-weight: 600; margin-top: 6px; }
.act-card .big { font-family: var(--disp); font-weight: 700; font-size: 23px; line-height: 1; margin-top: 4px; }
.act-card .sub { font-family: var(--mono); font-size: 12px; color: var(--accent-ink); margin-top: 5px; }
.act-card .accent-edge { position: absolute; left: 0; top: 0; bottom: 0; width: 4px; }

/* ACWR injury-risk gauge */
.gauge { display: flex; align-items: center; gap: 14px; }
.gauge-bar { flex: 1; height: 12px; border-radius: 999px; position: relative;
  background: linear-gradient(90deg,#c2433a 0 18%,#b9791f 18% 32%,#1f8a4c 32% 65%,#b9791f 65% 80%,#c2433a 80% 100%); }
.gauge-needle { position: absolute; top: -4px; width: 3px; height: 20px; background: var(--ink); border-radius: 2px; transform: translateX(-50%); box-shadow: 0 0 0 2px #fff; }
.gauge-val { font-family: var(--disp); font-weight: 700; font-size: 22px; min-width: 56px; }

/* ---------- bottom nav (mobile) ---------- */
.bottom-nav { display: none; }

/* ---------- mobile top bar + drawer (hidden on desktop) ---------- */
.mtopbar { display: none; }
.nav-scrim { display: none; }

/* ---------- responsive ---------- */
@media (max-width: 880px) {
  /* mobile top bar with hamburger */
  .mtopbar {
    display: flex; align-items: center; gap: 12px;
    position: fixed; top: 0; left: 0; right: 0; z-index: 40; height: 50px;
    background: var(--bg-deep); padding: 0 14px calc(0px + env(safe-area-inset-top));
    box-shadow: 0 1px 0 rgba(255,255,255,.06);
  }
  .nav-toggle {
    width: 38px; height: 38px; border: 0; border-radius: 9px; cursor: pointer;
    background: rgba(255,255,255,.08); color: #fff; font-size: 19px; line-height: 1;
    display: grid; place-items: center;
  }
  .mtopbar-brand { color: #fff; font-family: var(--disp, inherit); font-weight: 700; letter-spacing: .14em; font-size: 15px; }

  /* lift the whole drawer system above the top bar / bottom nav / topo when open */
  body.nav-open .layout { z-index: 70; }

  /* sidebar becomes a slide-in drawer holding EVERY menu item */
  .sidebar {
    display: flex; position: fixed; top: 0; bottom: 0; left: 0; width: min(82vw, 280px);
    z-index: 60; overflow-y: auto; transform: translateX(-100%);
    transition: transform .25s ease; box-shadow: 2px 0 24px rgba(0,0,0,.4);
  }
  body.nav-open .sidebar { transform: translateX(0); }
  body.nav-open .nav-scrim {
    display: block; position: fixed; inset: 0; z-index: 55; background: rgba(0,0,0,.5);
  }

  .main { padding: 64px 16px 96px; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .col-span-2 { grid-column: span 1; }
  .page-title { font-size: 24px; }
  .bottom-nav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 20;
    background: var(--bg-deep); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    justify-content: space-around;
  }
  .bn-link { display: flex; flex-direction: column; align-items: center; gap: 2px; color: #9fb4c2; text-decoration: none; font-size: 10px; padding: 4px 10px; border-radius: 9px; }
  .bn-link.active { color: #fff; }
  .bn-ic { font-size: 18px; }
}
@media (max-width: 480px) {
  .grid-4 { grid-template-columns: 1fr 1fr; }
}
