/* ==================================================================
   JIMMY RUNS — shared design system
   Loaded after each page's own <style> block, so this file is the
   single source of truth for tokens, components and the app shell.
   Page-specific layouts stay inline; anything reused lives here.
   ================================================================== */

/* ---------- 1. Tokens ---------- */
:root{
  --bg:#0b0d11;
  --surface:#13161c;
  --surface-2:#1a1e26;
  --line:#262b35;
  --text:#edeff3;
  --muted:#8d94a0;
  --muted-2:#5d6470;

  --font:'Inter', -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono:var(--font);           /* numbers use tabular figures, not a terminal font */
  --sans:var(--font);
  --body:var(--font);

  --accent:var(--hivis);
  --surface-elev:var(--surface-2);
  --text-1:var(--text);
  --text-2:var(--muted);
  --text-3:var(--muted-2);
  --border:color-mix(in srgb, var(--line) 75%, transparent);
  --border-strong:var(--line);
  --warning:var(--tier-mid);
  --danger:var(--tier-low);
  --success:var(--tier-high);

  --radius:12px;
  --r-sm:8px; --r-md:12px; --r-lg:16px;
  --shadow:none;
  --ease:cubic-bezier(.2,.7,.2,1);
  --sidebar-w:216px;
  --col-max:1080px;
}
html[data-theme="light"]{
  --bg:#ecebe7;            /* soft stone off-white, easier on the eyes than white */
  --surface:#f6f5f3;
  --surface-2:#e4e3df;
  --line:#d4d3d0;
  --text:#15171b;
  --muted:#5b6068;
  --muted-2:#8a8e95;
  --shadow:none;
}

/* ---------- 2. Base ---------- */
html, body{ font-family:var(--font); }
html{ background:var(--bg) !important; }
body{
  background:transparent !important; /* colour lives on <html> so the texture layer can sit between them */
  background-image:none !important;
  font-variant-numeric:tabular-nums;
  letter-spacing:-.003em;
  line-height:1.45;
}
.aurora-glow{ display:none !important; }
::selection{ background:color-mix(in srgb, var(--accent) 35%, transparent); color:var(--text); }
button, input, select, textarea{ font-family:var(--font); }

/* Legacy card system, flattened: sections are separated by hairlines and
   whitespace instead of floating rectangles. Real groupings opt back in
   with .jr-card. */
.sec{
  background:transparent !important; border:0 !important; border-top:1px solid var(--border) !important;
  border-radius:0 !important; box-shadow:none !important;
  padding:28px 2px !important; margin:0 !important;
}
.card:hover, .hero:hover, .sec:hover{ transform:none !important; box-shadow:none !important; }
.card::before, .hero::before, .sec::before,
.hero::after, .insight-card::after, .fitness-card::after{ display:none !important; }
.hero{
  background:var(--surface) !important; border:1px solid var(--border) !important;
  border-radius:var(--r-lg) !important; box-shadow:none !important;
}
.sec-head{ margin-bottom:18px; align-items:baseline; }
.sec-head h2{
  font-family:var(--font) !important; font-size:12px !important; font-weight:600 !important;
  letter-spacing:.12em !important; text-transform:uppercase; color:var(--text-2) !important;
  padding-left:0 !important;
}
.sec-head h2::before{ display:none !important; }
.sec-note{ font-size:12px; color:var(--text-3); }
.view-btn.active, .filter-pill.active, .week-pill.active, .day-pill.active,
.view-btn:hover, .filter-pill:hover, .week-pill:hover{ box-shadow:none !important; }
.gauge-fill-animated{ filter:none !important; }
.chart-caption{ color:var(--text-3); }

/* ---------- 3. Components ---------- */

/* Label — small uppercase, letter-spaced */
.jr-label{ font-size:11.5px; font-weight:600; letter-spacing:.12em; text-transform:uppercase; color:var(--text-2); }

/* Section */
.jr-section{ padding:30px 0 10px; border-top:1px solid var(--border); }
.jr-section-head{ display:flex; justify-content:space-between; align-items:baseline; gap:12px; margin-bottom:18px; }
.jr-section-head .jr-link{ font-size:12.5px; font-weight:600; color:var(--accent); text-decoration:none; background:none; border:0; cursor:pointer; padding:0; }

/* Card — only where grouping is genuine */
.jr-card{ background:var(--surface); border:1px solid var(--border); border-radius:var(--r-lg); padding:22px 20px; }

/* Metric — label / big number / context */
.jr-metric{ display:flex; flex-direction:column; min-width:0; }
.jr-metric .jr-label{ margin-bottom:6px; }
.jr-metric-val{ font-size:30px; font-weight:700; letter-spacing:-.02em; line-height:1.05; color:var(--text-1); }
.jr-metric-val small{ font-size:.5em; font-weight:600; color:var(--text-2); margin-left:3px; letter-spacing:0; }
.jr-metric-sub{ font-size:12.5px; color:var(--text-2); margin-top:6px; line-height:1.4; }
.jr-metric--sm .jr-metric-val{ font-size:20px; }
.jr-metric--xl .jr-metric-val{ font-size:56px; }

/* Metric group — a grid of metrics divided by hairlines, not boxed */
.jr-metric-group{ display:grid; grid-template-columns:repeat(2, minmax(0,1fr)); }
.jr-metric-group > *{ padding:16px 14px 16px 0; border-top:1px solid var(--border); }
.jr-metric-group > *:nth-child(2n){ padding-left:16px; border-left:1px solid var(--border); padding-right:0; }
.jr-metric-group.cols-4{ grid-template-columns:repeat(2, minmax(0,1fr)); }
@media (min-width:600px){
  .jr-metric-group.cols-4{ grid-template-columns:repeat(4, minmax(0,1fr)); }
  .jr-metric-group.cols-4 > *{ padding:14px 16px; border-left:1px solid var(--border); }
  .jr-metric-group.cols-4 > *:first-child{ border-left:0; padding-left:0; }
}

/* Delta — the "what does this number mean" line */
.jr-delta{ font-size:12px; font-weight:600; color:var(--text-2); white-space:nowrap; }
.jr-delta.good{ color:var(--accent); }
.jr-delta.bad{ color:var(--warning); }

/* Badge */
.jr-badge{ display:inline-flex; align-items:center; gap:5px; font-size:11px; font-weight:600; letter-spacing:.02em; padding:3px 9px; border-radius:999px; background:color-mix(in srgb, var(--accent) 13%, transparent); color:var(--accent); white-space:nowrap; }
.jr-badge.neutral{ background:var(--surface-2); color:var(--text-2); }
.jr-badge.warn{ background:color-mix(in srgb, var(--warning) 14%, transparent); color:var(--warning); }
.jr-badge.danger{ background:color-mix(in srgb, var(--danger) 14%, transparent); color:var(--danger); }

/* Buttons */
.jr-btn{ display:inline-flex; align-items:center; justify-content:center; gap:8px; min-height:44px; padding:0 18px; border-radius:var(--r-md); font-size:13.5px; font-weight:600; cursor:pointer; border:1px solid var(--border-strong); background:transparent; color:var(--text-1); text-decoration:none; transition:background .15s var(--ease), opacity .15s var(--ease); }
.jr-btn:hover{ background:var(--surface-2); }
.jr-btn.primary{ background:var(--accent); border-color:var(--accent); color:#0b0d11; }
.jr-btn.primary:hover{ opacity:.9; background:var(--accent); }
.jr-btn.block{ width:100%; }

/* Tabs / segmented control */
.jr-tabs{ display:flex; gap:2px; padding:3px; background:var(--surface-2); border-radius:10px; overflow-x:auto; scrollbar-width:none; }
.jr-tabs::-webkit-scrollbar{ display:none; }
.jr-tab{ flex:1 0 auto; min-height:34px; padding:0 12px; border:0; border-radius:8px; background:transparent; color:var(--text-2); font-size:12px; font-weight:600; letter-spacing:.04em; cursor:pointer; white-space:nowrap; transition:background .15s var(--ease), color .15s var(--ease); }
.jr-tab.active{ background:var(--surface); color:var(--text-1); box-shadow:0 1px 2px rgba(0,0,0,.25); }
.jr-tabs.plain{ background:transparent; padding:0; gap:18px; border-bottom:1px solid var(--border); border-radius:0; }
.jr-tabs.plain .jr-tab{ flex:0 0 auto; padding:0 0 10px; border-radius:0; background:none; box-shadow:none; border-bottom:2px solid transparent; margin-bottom:-1px; }
.jr-tabs.plain .jr-tab.active{ color:var(--text-1); border-bottom-color:var(--accent); }

/* Chart shell */
.jr-chart{ position:relative; }
.jr-chart svg{ display:block; width:100%; height:auto; overflow:visible; }

/* Activity row */
.jr-rows{ display:flex; flex-direction:column; }
.jr-row{ display:grid; grid-template-columns:minmax(0,1fr) auto; gap:14px; align-items:center; padding:14px 2px; border-top:1px solid var(--border); text-decoration:none; color:inherit; cursor:pointer; transition:background .15s var(--ease); border-radius:0; }
.jr-row:first-child{ border-top:0; }
.jr-row:hover{ background:color-mix(in srgb, var(--surface-2) 60%, transparent); }
.jr-row-title{ font-size:15px; font-weight:600; color:var(--text-1); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.jr-row-sub{ font-size:12.5px; color:var(--text-2); margin-top:3px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.jr-row-stats{ display:flex; gap:16px; text-align:right; }
.jr-row-stat{ font-size:14px; font-weight:600; color:var(--text-1); white-space:nowrap; }
.jr-row-stat small{ display:block; font-size:10.5px; font-weight:500; color:var(--text-3); margin-top:2px; letter-spacing:.03em; }
@media (max-width:420px){ .jr-row-stats{ gap:12px; } .jr-row-stat.hide-sm{ display:none; } }

/* Goal */
.jr-goal{ padding:18px 0; border-top:1px solid var(--border); }
.jr-goal:first-child{ border-top:0; padding-top:4px; }
.jr-goal-head{ display:flex; justify-content:space-between; align-items:baseline; gap:12px; }
.jr-goal-nums{ display:flex; align-items:baseline; gap:18px; margin-top:8px; }
.jr-goal-now{ font-size:28px; font-weight:700; letter-spacing:-.02em; }
.jr-goal-target{ font-size:13px; color:var(--text-2); }
.jr-goal-target b{ color:var(--text-1); font-weight:600; }
.jr-progress{ height:3px; border-radius:3px; background:var(--surface-2); margin-top:12px; overflow:hidden; }
.jr-progress > i{ display:block; height:100%; border-radius:3px; background:var(--accent); width:0; transition:width .9s var(--ease); }
.jr-goal-foot{ font-size:12px; color:var(--text-2); margin-top:8px; }

/* Ring */
.jr-ring{ position:relative; display:inline-flex; align-items:center; justify-content:center; }
.jr-ring svg{ display:block; }
.jr-ring-center{ position:absolute; inset:0; display:flex; flex-direction:column; align-items:center; justify-content:center; text-align:center; pointer-events:none; }
.jr-ring-arc{ transition:stroke-dashoffset 1.1s var(--ease); }

/* Collapsible group (keeps every older section available without the clutter) */
.jr-more{ border-top:1px solid var(--border); }
.jr-more > summary{ list-style:none; display:flex; align-items:center; gap:12px; padding:18px 2px; cursor:pointer; user-select:none; }
.jr-more > summary::-webkit-details-marker{ display:none; }
.jr-more-title{ font-size:15px; font-weight:600; color:var(--text-1); flex:1; }
.jr-more-count{ font-size:12.5px; color:var(--text-3); }
.jr-more-chev{ color:var(--text-3); transition:transform .2s var(--ease); }
.jr-more[open] > summary .jr-more-chev{ transform:rotate(90deg); }
.jr-more > .sec:first-of-type{ border-top:0 !important; padding-top:6px !important; }

/* Motion */
@keyframes jrFadeUp{ from{ opacity:0; transform:translateY(6px); } to{ opacity:1; transform:none; } }
.jr-enter{ animation:jrFadeUp .45s var(--ease) both; }
@media (prefers-reduced-motion: reduce){
  .jr-enter{ animation:none; }
  .jr-progress > i{ transition:none; }
}

/* Visually hidden (kept in DOM for existing scripts) */
.jr-hidden{ position:absolute !important; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; border:0; padding:0; margin:-1px; }

/* ---------- 4. App shell ---------- */
.app-sidebar{ display:none; }
.bottom-nav{
  position:fixed; left:0; right:0; bottom:0; z-index:90;
  display:flex; justify-content:space-around; align-items:stretch;
  background:color-mix(in srgb, var(--bg) 88%, transparent);
  border-top:1px solid var(--border);
  backdrop-filter:blur(18px) saturate(160%); -webkit-backdrop-filter:blur(18px) saturate(160%);
  padding:6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
}
.bnav-item{
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:4px;
  color:var(--text-3); text-decoration:none; font-size:10.5px; font-weight:600; letter-spacing:.02em;
  background:none; border:none; cursor:pointer; padding:6px 4px; flex:1; min-height:50px; font-family:var(--font);
}
.bnav-item svg{ width:22px; height:22px; }
.bnav-item.active{ color:var(--accent); }
#app{ padding-bottom:calc(96px + env(safe-area-inset-bottom, 0px)) !important; }

.sheet-overlay{
  position:fixed; inset:0; background:rgba(3,4,6,.55); z-index:120;
  display:flex; align-items:flex-end; justify-content:center;
  opacity:0; pointer-events:none; transition:opacity .22s var(--ease);
}
.sheet-overlay.open{ opacity:1; pointer-events:auto; }
.sheet-box{
  background:var(--surface); border:1px solid var(--border); border-bottom:0;
  border-radius:18px 18px 0 0; width:100%; max-width:480px; max-height:82vh; overflow-y:auto;
  padding:8px 8px calc(18px + env(safe-area-inset-bottom, 0px));
  transform:translateY(24px); transition:transform .26s var(--ease);
}
.sheet-overlay.open .sheet-box{ transform:none; }
.sheet-handle{ width:36px; height:4px; border-radius:2px; background:var(--line); margin:6px auto 12px; }
.sheet-label{ font-size:11px; font-weight:600; letter-spacing:.12em; text-transform:uppercase; color:var(--text-3); padding:10px 16px 4px; }
.sheet-link{
  display:flex; align-items:center; gap:14px; min-height:48px; padding:0 16px; border-radius:10px;
  color:var(--text-1); text-decoration:none; font-size:15px; font-weight:500; font-family:var(--font);
  background:none; border:none; width:100%; text-align:left; cursor:pointer;
}
.sheet-link:hover{ background:var(--surface-2); }
.sheet-link svg{ width:19px; height:19px; color:var(--text-2); flex-shrink:0; }
.sheet-link.active{ color:var(--accent); }
.sheet-link.active svg{ color:var(--accent); }
#refresh-data-btn.spinning svg{ animation:refreshSpin .8s linear infinite; }
@keyframes refreshSpin{ to{ transform:rotate(360deg); } }
.sheet-divider{ height:1px; background:var(--border); margin:8px 12px; }
.accent-row{ display:flex; gap:12px; padding:10px 16px 12px; flex-wrap:wrap; }
.accent-row .color-swatch-btn{ width:30px; height:30px; }


@media (min-width:900px){
  .app-sidebar{
    display:flex; flex-direction:column; position:fixed; top:0; left:0; bottom:0; width:var(--sidebar-w); z-index:80;
    background:var(--bg); border-right:1px solid var(--border);
    padding:30px 14px 18px; overflow-y:auto;
  }
  .sidebar-logo{ font-family:var(--font); font-weight:800; font-size:17px; line-height:1.05; letter-spacing:.04em; padding:0 12px; margin-bottom:36px; color:var(--text-1); text-decoration:none; display:block; }
  .sidebar-logo span{ display:block; }
  .sidebar-logo span:last-child{ color:var(--accent); }
  .sidebar-nav{ display:flex; flex-direction:column; gap:1px; }
  .sidebar-group-label{ font-size:10.5px; font-weight:600; letter-spacing:.14em; text-transform:uppercase; color:var(--text-3); padding:22px 12px 8px; }
  .sidebar-link{
    display:flex; align-items:center; gap:12px; min-height:38px; padding:0 12px; border-radius:9px;
    color:var(--text-2); text-decoration:none; font-size:12.5px; font-weight:600; letter-spacing:.08em; text-transform:uppercase;
    font-family:var(--font); background:none; border:0; width:100%; text-align:left; cursor:pointer;
    transition:background .15s var(--ease), color .15s var(--ease);
  }
  .sidebar-link svg{ width:17px; height:17px; flex-shrink:0; }
  .sidebar-link:hover{ background:var(--surface); color:var(--text-1); }
  .sidebar-link.active{ background:var(--surface); color:var(--accent); }
  .sidebar-spacer{ flex:1; min-height:24px; }
  .sidebar-footer{ border-top:1px solid var(--border); padding-top:10px; }
  .bottom-nav{ display:none; }

  /* Content column: offset by the sidebar and centred in the space that's left */
  #app{ max-width:none !important; margin:0 !important; padding:0 40px 48px calc(var(--sidebar-w) + 40px) !important; }
  #app > :not(.app-sidebar):not(.bottom-nav):not(.sheet-overlay):not(.modal-overlay):not(.app-loading-veil):not(script){
    max-width:var(--col-max); margin-left:auto !important; margin-right:auto !important;
  }
  .sheet-overlay{ align-items:center; }
  .sheet-box{ border-radius:18px; border-bottom:1px solid var(--border); max-width:420px; margin:20px; transform:translateY(8px) scale(.98); }
}
@media (min-width:1500px){ :root{ --col-max:1180px; } }

/* ---------- 5. Home ---------- */
.jr-hero{ padding:26px 0 8px; }
.jr-hero-top{ display:flex; justify-content:space-between; align-items:flex-start; gap:12px; }
.jr-greet{ font-size:22px; font-weight:700; letter-spacing:-.015em; color:var(--text-1); }
.jr-date{ font-size:13.5px; color:var(--text-2); margin-top:4px; }
.jr-rings{ display:grid; grid-template-columns:1fr auto 1fr; align-items:center; justify-items:center; gap:4px; margin:26px 0 8px; }
.jr-ring-btn{ background:none; border:0; padding:0; cursor:pointer; color:inherit; display:flex; flex-direction:column; align-items:center; gap:8px; font-family:var(--font); border-radius:50%; }
.jr-ring-btn:focus-visible{ outline:2px solid var(--accent); outline-offset:6px; }
.jr-ring-cap{ font-size:12px; color:var(--text-2); text-align:center; line-height:1.35; }
.jr-ring-cap b{ display:block; font-size:15px; color:var(--text-1); font-weight:700; }
.jr-ring-big-label{ font-size:11px; font-weight:600; letter-spacing:.14em; text-transform:uppercase; color:var(--text-2); }
.jr-ring-big-val{ font-size:52px; font-weight:800; letter-spacing:-.035em; line-height:1; color:var(--text-1); margin:4px 0 2px; }
.jr-ring-big-val small{ font-size:.42em; font-weight:700; margin-left:1px; }
.jr-ring-big-state{ font-size:13px; font-weight:600; color:var(--accent); }
.jr-ring-sm-val{ font-size:20px; font-weight:700; letter-spacing:-.02em; color:var(--text-1); }
@media (max-width:360px){ .jr-ring-big-val{ font-size:44px; } }

.jr-daystrip{ display:grid; grid-template-columns:repeat(7, minmax(0,1fr)); gap:6px; margin-top:22px; }
.jr-day{ display:flex; flex-direction:column; align-items:center; gap:3px; min-height:58px; justify-content:center; background:transparent; border:0; border-radius:10px; color:var(--text-3); cursor:pointer; font-family:var(--font); position:relative; }
.jr-day b{ font-size:17px; font-weight:700; color:var(--text-2); }
.jr-day span{ font-size:10.5px; font-weight:600; letter-spacing:.06em; text-transform:uppercase; }
.jr-day i{ position:absolute; bottom:6px; width:4px; height:4px; border-radius:50%; background:var(--accent); opacity:.85; }
.jr-day.active{ background:var(--surface); }
.jr-day.active b{ color:var(--text-1); }
.jr-day.active::after{ content:''; position:absolute; left:22%; right:22%; bottom:0; height:2px; border-radius:2px; background:var(--text-1); }
.jr-hero-note{ font-size:12.5px; color:var(--text-3); margin:14px 0 0; line-height:1.5; }
.jr-hero-note b{ color:var(--text-2); font-weight:600; }

.jr-training{ display:grid; gap:18px; }
.jr-training-name{ font-size:22px; font-weight:700; letter-spacing:-.015em; }
.jr-training-nums{ display:flex; flex-wrap:wrap; align-items:baseline; gap:6px 18px; margin-top:8px; }
.jr-training-dist{ font-size:40px; font-weight:800; letter-spacing:-.03em; line-height:1; }
.jr-training-dist small{ font-size:.4em; font-weight:700; color:var(--text-2); margin-left:3px; }
.jr-training-pace{ font-size:15px; font-weight:600; color:var(--text-2); }
.jr-training-actions{ display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.jr-training-why{ font-size:13px; color:var(--text-2); line-height:1.55; margin:0; }

.jr-week-graph{ margin-top:18px; }

.jr-fitness-controls{ display:flex; flex-direction:column; gap:10px; margin-bottom:18px; }
.jr-fitness-head{ display:flex; align-items:baseline; gap:12px; flex-wrap:wrap; margin-bottom:14px; }
.jr-fitness-val{ font-size:34px; font-weight:700; letter-spacing:-.025em; line-height:1; }
.jr-fitness-val small{ font-size:.45em; color:var(--text-2); font-weight:600; margin-left:3px; }
.jr-chart-empty{ font-size:13px; color:var(--text-2); padding:40px 0; text-align:center; }

.jr-coach-box{ display:flex; flex-direction:column; gap:14px; }
.jr-coach-hello{ font-size:22px; font-weight:700; letter-spacing:-.015em; }
.jr-chips{ display:flex; gap:8px; overflow-x:auto; padding-bottom:2px; scrollbar-width:none; }
.jr-chips::-webkit-scrollbar{ display:none; }
@media (min-width:900px){ .jr-chips{ flex-wrap:wrap; overflow:visible; } }
.jr-chip{ flex:0 0 auto; min-height:36px; padding:0 14px; border-radius:999px; border:1px solid var(--border-strong); background:transparent; color:var(--text-1); font-size:13px; font-weight:500; cursor:pointer; white-space:nowrap; font-family:var(--font); }
.jr-chip:hover{ background:var(--surface-2); }
.jr-thread{ display:flex; flex-direction:column; gap:14px; max-height:440px; overflow-y:auto; }
.jr-thread:empty{ display:none; }
.jr-msg-q{ align-self:flex-end; max-width:85%; background:var(--surface-2); border-radius:14px 14px 4px 14px; padding:10px 14px; font-size:14px; }
.jr-msg-a{ max-width:100%; font-size:14px; line-height:1.6; color:var(--text-1); padding-left:14px; border-left:2px solid var(--accent); }
.jr-msg-a p{ margin:0 0 8px; }
.jr-msg-a p:last-child{ margin-bottom:0; }
.jr-msg-a .jr-msg-stats{ display:flex; flex-wrap:wrap; gap:6px 18px; margin:6px 0 10px; }
.jr-msg-a .jr-msg-stats span{ font-size:12.5px; color:var(--text-2); }
.jr-msg-a .jr-msg-stats b{ display:block; font-size:17px; color:var(--text-1); font-weight:700; }
.jr-ask{ display:flex; gap:8px; }
.jr-ask input{ flex:1; min-width:0; min-height:46px; padding:0 14px; border-radius:var(--r-md); border:1px solid var(--border-strong); background:var(--surface); color:var(--text-1); font-size:15px; }
.jr-ask input:focus{ outline:none; border-color:var(--accent); }
.jr-ask button{ min-width:46px; min-height:46px; border-radius:var(--r-md); border:0; background:var(--accent); color:#0b0d11; cursor:pointer; display:flex; align-items:center; justify-content:center; }
.jr-note{ font-size:12px; color:var(--text-3); line-height:1.5; }

.jr-home-grid{ display:grid; grid-template-columns:minmax(0,1fr); }
@media (min-width:1100px){
  .jr-home-grid{ grid-template-columns:minmax(0,1fr) minmax(0,1fr); column-gap:56px; }
}

/* ---------- Home: responsive rings + clickable metrics ---------- */
.jr-rings{ grid-template-columns:minmax(0,1fr) minmax(0,1.95fr) minmax(0,1fr); }
.jr-ring-btn{ width:100%; }
.jr-ring-btn.sm .jr-ring{ width:100%; max-width:96px; }
.jr-ring-btn.big .jr-ring{ width:100%; max-width:188px; }
.jr-ring-btn .jr-ring svg{ width:100%; height:auto; }
.jr-ring-big-val{ font-size:clamp(34px, 11vw, 52px); }
@media (max-width:360px){ .jr-ring-big-val{ font-size:34px; } .jr-ring-big-label{ font-size:9.5px; } .jr-ring-sm-val{ font-size:16px; } }
.jr-metric-btn{ background:none; border:0; border-top:1px solid var(--border); font:inherit; color:inherit; text-align:left; cursor:default; }
button.jr-metric-btn{ cursor:pointer; }
button.jr-metric-btn:hover .jr-metric-val{ color:var(--accent); }
.jr-metric-group > .jr-metric-btn:nth-child(2n){ border-left:1px solid var(--border); }
#home-more > .jr-more:first-of-type{ border-top:0; }
#home-more .motivation-banner{ margin:0 0 6px; }
.jr-hero .jr-metric-group{ margin-top:18px; }
.jr-hero .jr-metric-val{ font-size:24px; }
@media (min-width:900px){ .jr-hero .jr-metric-val{ font-size:28px; } }
.jr-metric-sub .jr-delta{ white-space:normal; }
.jr-delta.bad{ color:var(--text-2); }

/* ---------- Races ---------- */
.jr-race-hero{ padding:6px 0 0; }
.jr-race-name{ font-size:clamp(28px, 7vw, 44px); font-weight:800; letter-spacing:-.03em; line-height:1.05; margin:10px 0 6px; color:var(--text-1); }
.jr-race-date{ font-size:14px; color:var(--text-2); }
.jr-race-count{ display:flex; align-items:baseline; gap:10px; margin:26px 0 22px; }
.jr-race-days{ font-size:clamp(64px, 20vw, 112px); font-weight:800; letter-spacing:-.05em; line-height:.9; color:var(--text-1); }
.jr-race-days-lbl{ font-size:14px; font-weight:600; color:var(--text-2); text-transform:uppercase; letter-spacing:.1em; }
.jr-race-target{ display:flex; flex-wrap:wrap; align-items:baseline; gap:6px 14px; }
.jr-race-target-val{ font:inherit; font-size:30px; font-weight:700; letter-spacing:-.02em; color:var(--accent); background:none; border:0; border-bottom:1px dashed var(--border-strong); padding:0 0 2px; cursor:pointer; }
.jr-race-actions{ display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-top:20px; max-width:460px; }
.jr-race-actions .jr-btn{ text-decoration:none; }
.jr-raceday{ text-align:center; padding:6px 0; }
.jr-raceday-name{ font-size:18px; font-weight:700; margin-top:8px; }
.jr-raceday-target{ font-size:clamp(56px, 17vw, 84px); font-weight:800; letter-spacing:-.04em; line-height:1; margin:18px 0 6px; }
.jr-raceday-pace{ font-size:15px; font-weight:600; color:var(--accent); }
.jr-raceday-splits{ display:grid; grid-template-columns:repeat(auto-fill, minmax(92px, 1fr)); gap:1px; margin:22px 0 16px; background:var(--border); border:1px solid var(--border); border-radius:var(--r-md); overflow:hidden; }
.jr-raceday-splits > div{ background:var(--surface); padding:10px 6px; display:flex; flex-direction:column; gap:2px; }
.jr-raceday-splits span{ font-size:11px; color:var(--text-3); text-transform:uppercase; letter-spacing:.06em; }
.jr-raceday-splits b{ font-size:16px; font-weight:700; }
.jr-raceday-tip{ font-size:13.5px; color:var(--text-2); line-height:1.55; text-align:left; margin:0 0 10px; }

/* ---------- Activity ---------- */
.act-filters{ margin:22px 0 6px; }
.act-row{ display:grid; grid-template-columns:auto minmax(0,1fr) auto; gap:14px; align-items:center; padding:14px 2px !important; border-top:1px solid var(--border); border-bottom:0 !important; cursor:pointer; }
.act-row:first-child{ border-top:0; }
.act-row:hover{ background:color-mix(in srgb, var(--surface-2) 60%, transparent) !important; }
.act-row:focus-visible{ outline:2px solid var(--accent); outline-offset:2px; }
.act-row:not(:has(.act-thumb)){ grid-template-columns:minmax(0,1fr) auto; }
.act-thumb{ width:44px; height:44px; border-radius:10px; background:var(--surface); display:flex; align-items:center; justify-content:center; overflow:hidden; }
.act-thumb svg{ width:36px; height:36px; }
.act-main{ min-width:0; }
.act-score{ font-weight:700; color:var(--accent); }
.act-score.low{ color:var(--text-2); }
#log-more{ display:block; }
/* activity detail */
.rm-head{ margin-bottom:14px; }
.rm-head .modal-title{ margin-top:6px; }
.rm-tabs{ margin-bottom:18px; }
.rm-panel[hidden]{ display:none !important; }
.rm-stats{ display:grid; grid-template-columns:repeat(2, minmax(0,1fr)); border-top:1px solid var(--border); margin:14px 0 18px; }
@media (min-width:560px){ .rm-stats{ grid-template-columns:repeat(3, minmax(0,1fr)); } }
.rm-stat{ display:flex; flex-direction:column; gap:5px; padding:14px 10px 14px 0; border-bottom:1px solid var(--border); min-width:0; }
.rm-stat-val{ font-size:24px; font-weight:700; letter-spacing:-.02em; color:var(--text-1); line-height:1.1; }
.rm-stat-val small{ font-size:.5em; color:var(--text-2); font-weight:600; margin-left:2px; }
.rm-stat .jr-delta, .rm-stat .jr-badge{ align-self:flex-start; }
.rm-score{ display:flex; gap:14px; align-items:flex-start; margin:0 0 14px; }
.rm-score .act-score{ font-size:30px; letter-spacing:-.02em; line-height:1; }
.rm-score .act-score small{ font-size:.45em; color:var(--text-2); }
.rm-score p{ margin:0; font-size:13.5px; color:var(--text-2); line-height:1.55; }
.rm-note{ font-size:14px; font-style:italic; color:var(--text-2); margin:0 0 16px; }
.rm-kv{ display:flex; flex-wrap:wrap; gap:10px 28px; margin-bottom:16px; }
.rm-kv > div{ display:flex; flex-direction:column; gap:4px; }
.rm-kv b{ font-size:20px; font-weight:700; letter-spacing:-.01em; }
.rm-laps{ display:flex; flex-direction:column; }
.rm-lap{ display:grid; grid-template-columns:34px 54px minmax(0,1fr) 40px 44px; gap:10px; align-items:center; padding:9px 0; border-top:1px solid var(--border); font-size:14px; font-variant-numeric:tabular-nums; }
.rm-lap-head{ border-top:0; font-size:10.5px; font-weight:600; letter-spacing:.1em; text-transform:uppercase; color:var(--text-3); }
.rm-lap > span:nth-child(n+4){ text-align:right; color:var(--text-2); }
.rm-lap-bar{ height:6px; background:var(--surface-2); border-radius:3px; overflow:hidden; }
.rm-lap-bar i{ display:block; height:100%; background:var(--text-3); border-radius:3px; }
.rm-lap.best .rm-lap-bar i{ background:var(--accent); }
.rm-lap.best > span:nth-child(2){ color:var(--accent); font-weight:700; }
.rm-score .act-score{ white-space:nowrap; }

/* ---------- Training calendar ---------- */
.cal-weeks{ margin-top:4px; }
.cal-summary{ grid-template-columns:repeat(2, minmax(0,1fr)); }
@media (min-width:700px){ .cal-summary{ grid-template-columns:repeat(5, minmax(0,1fr)); } .cal-summary > *{ border-left:1px solid var(--border); padding-left:14px !important; } .cal-summary > *:first-child{ border-left:0; padding-left:0 !important; } }
.cal-summary .jr-metric-val{ font-size:24px; }
.cal-days{ display:flex; flex-direction:column; margin-top:10px; }
.cal-day{ display:grid; grid-template-columns:52px minmax(0,1fr); gap:12px; padding:12px 0; border-top:1px solid var(--border); }
.cal-date{ display:flex; flex-direction:column; align-items:center; justify-content:flex-start; padding-top:6px; color:var(--text-3); }
.cal-date span{ font-size:11px; font-weight:600; letter-spacing:.08em; text-transform:uppercase; }
.cal-date b{ font-size:20px; font-weight:700; color:var(--text-2); line-height:1.2; }
.cal-date.today span, .cal-date.today b{ color:var(--accent); }
.cal-cards{ display:flex; flex-direction:column; gap:8px; min-width:0; }
.cal-card{ display:block; width:100%; text-align:left; font:inherit; color:inherit; text-decoration:none; background:var(--surface); border:1px solid var(--border); border-radius:var(--r-md); padding:12px 14px; cursor:pointer; box-sizing:border-box; }
.cal-card:hover{ border-color:var(--border-strong); }
.cal-card.planned{ background:transparent; border-style:dashed; }
.cal-card.missed{ opacity:.55; }
.cal-card.race{ border-color:color-mix(in srgb, var(--accent) 45%, var(--border)); cursor:default; }
.cal-card.race a{ color:var(--accent); }
.cal-card-top{ display:flex; justify-content:space-between; align-items:center; gap:10px; }
.cal-title{ font-size:15px; font-weight:600; color:var(--text-1); display:flex; align-items:center; gap:8px; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.cal-check{ width:20px; height:20px; border-radius:50%; background:var(--accent); color:#0b0d11; display:inline-flex; align-items:center; justify-content:center; flex:0 0 auto; }
.cal-sub{ font-size:12.5px; color:var(--text-2); margin-top:5px; }
.cal-rest{ font-size:13px; color:var(--text-3); padding:14px 0 10px; }
.jr-badge.hard{ background:transparent; border:1px solid var(--border-strong); color:var(--text-1); }

/* ---------- Recovery ---------- */
.rec-hero-ring{ display:flex; justify-content:center; margin:8px 0 0; }
.rec-hero-ring .jr-ring{ width:min(220px, 62vw); }
.rec-hero-ring .jr-ring svg{ width:100%; height:auto; }
.rec-hero-ring .jr-ring-big-val{ font-size:clamp(44px, 14vw, 60px); }

/* ---------- Tools list ---------- */
.jr-tools{ border-bottom:1px solid var(--border); }
.jr-tool > summary{ padding:18px 2px; }
.jr-tool-text{ display:flex; flex-direction:column; gap:3px; flex:1; min-width:0; }
.jr-tool-sub{ font-size:13px; color:var(--text-2); }
.jr-tool > .sec{ border-top:0 !important; padding-top:4px !important; }
.jr-tool > .sec .sec-head h2{ display:none; }
.jr-tool > .sec .sec-head{ margin-bottom:12px; }

/* ---------- Status bar: training status · fitness · data freshness ---------- */
#page-status{ display:none !important; }
.nav-sticky{
  position:sticky !important; top:0; z-index:70;
  display:flex !important; align-items:center; gap:12px;
  width:auto !important; margin:0 0 6px !important; padding:calc(10px + env(safe-area-inset-top, 0px)) 0 10px !important;
  background:color-mix(in srgb, var(--bg) 88%, transparent) !important;
  backdrop-filter:blur(12px); -webkit-backdrop-filter:blur(12px);
  box-shadow:none !important; border-bottom:1px solid var(--border);
}
.nav-sticky > .training-status-banner{
  flex:1 1 auto; min-width:0; max-width:none !important; margin:0 !important;
  display:flex !important; align-items:center; gap:14px;
  padding:0 !important; border:0 !important; background:none !important;
  font-family:var(--font) !important; font-size:13px !important; font-weight:600 !important; color:var(--text-1);
  cursor:pointer; white-space:nowrap; overflow:hidden;
}
.nav-sticky > .training-status-banner:focus-visible{ outline:2px solid var(--accent); outline-offset:4px; border-radius:8px; }
.tsb-status{ display:inline-flex; align-items:center; gap:7px; height:28px; padding:0 11px 0 10px; border-radius:999px; background:var(--surface-2); font-size:12px; font-weight:700; letter-spacing:.08em; text-transform:uppercase; color:var(--text-1); flex:0 0 auto; }
.tsb-status .tsb-dot{ width:7px !important; height:7px !important; border-radius:50%; margin:0 !important; box-shadow:none !important; animation:none !important; background:var(--text-2) !important; flex:0 0 auto; }
.tsb-status.building .tsb-dot{ background:var(--accent) !important; }
.tsb-status.maintaining .tsb-dot{ background:var(--text-2) !important; }
.tsb-status.recovering .tsb-dot{ background:var(--warning) !important; }
.tsb-fit{ display:inline-flex; align-items:baseline; gap:6px; min-width:0; overflow:hidden; text-overflow:ellipsis; }
.tsb-fit-lbl{ font-size:11px; font-weight:600; letter-spacing:.1em; text-transform:uppercase; color:var(--text-3); }
.tsb-fit b{ font-size:13px; font-weight:600; color:var(--text-1); }
.tsb-fit.up b{ color:var(--accent); }
.tsb-fit.down b{ color:var(--warning); }
.tsb-chev{ color:var(--text-3); flex:0 0 auto; margin-left:-6px; transition:transform .15s var(--ease); }
.training-status-banner:hover .tsb-chev{ transform:translateX(2px); color:var(--text-2); }
.nav-sticky > .status-strip{
  flex:0 0 auto; display:inline-flex !important; align-items:center; gap:7px; margin:0 !important; padding:0 !important; max-width:none !important;
  font-family:var(--font) !important; font-size:11.5px !important; font-weight:500; color:var(--text-3) !important; white-space:nowrap;
}
.nav-sticky > .status-strip .status-dot{ width:6px !important; height:6px !important; margin:0 !important; box-shadow:none !important; animation:none !important; flex:0 0 auto; }
.nav-sticky > .status-strip #status-strip-text{ max-width:380px; overflow:hidden; text-overflow:ellipsis; }
@media (max-width:699px){
  .nav-sticky > .status-strip #status-strip-text{ display:none; }
  .nav-sticky > .status-strip::after{ content:attr(data-short); }
}
@media (max-width:359px){ .tsb-fit-lbl{ display:none; } .tsb-status{ padding:0 9px; } }
/* status modal */
.tsb-modal-head{ display:flex; flex-wrap:wrap; gap:14px 36px; margin:14px 0 6px; }
.tsb-modal-big{ font-size:26px; font-weight:800; letter-spacing:-.02em; margin-top:4px; color:var(--text-1); }
.tsb-modal-big.building, .tsb-modal-big.fit-up{ color:var(--accent); }
.tsb-modal-big.recovering, .tsb-modal-big.fit-down{ color:var(--warning); }
.tsb-reasons{ margin:8px 0 18px; padding-left:18px; font-size:14px; line-height:1.6; color:var(--text-1); }
.tsb-reasons li{ margin-bottom:6px; }
.tsb-defs{ display:flex; flex-direction:column; gap:6px; padding-top:14px; border-top:1px solid var(--border); font-size:12.5px; color:var(--text-2); line-height:1.5; }
.tsb-defs b{ color:var(--text-1); margin-right:6px; }
.tsb-modal-stats{ grid-template-columns:repeat(3, minmax(0,1fr)) !important; } .tsb-modal-stats .rm-stat-val{ font-size:22px; }

/* ---------- Dial entrance: slide up + fill sweep ---------- */
@keyframes jrRise{ from{ opacity:0; transform:translateY(22px); } to{ opacity:1; transform:none; } }
@keyframes jrSweep{ from{ stroke-dasharray:0 var(--jr-c); } }
/* ring + gauge fills are animated from jr.js (Safari can't run var() keyframes) */
.jr-ring-arc{ transition:none !important; animation:none !important; }
path.gauge-fill-animated{ animation:none !important; }
.jr-ring, .dial-wrap, .race-dial-wrap, .modal-ring{ animation:jrRise .7s cubic-bezier(.22,.8,.26,1) both; }
.jr-rings > :nth-child(1) .jr-ring{ animation-delay:.12s; }
.jr-rings > :nth-child(2) .jr-ring{ animation-delay:0s; }
.jr-rings > :nth-child(3) .jr-ring{ animation-delay:.18s; }
.race-dials-grid > :nth-child(2) .race-dial-wrap, .race-dials-grid > :nth-child(2) .dial-wrap{ animation-delay:.07s; }
.race-dials-grid > :nth-child(3) .race-dial-wrap, .race-dials-grid > :nth-child(3) .dial-wrap{ animation-delay:.14s; }
.race-dials-grid > :nth-child(4) .race-dial-wrap, .race-dials-grid > :nth-child(4) .dial-wrap{ animation-delay:.21s; }
.modal-ring{ display:flex; justify-content:center; margin:10px 0 18px; }
.modal-ring .jr-ring{ width:176px; }
@media (prefers-reduced-motion: reduce){
  .jr-ring-arc, .jr-ring, .dial-wrap, .race-dial-wrap, .modal-ring{ animation:none !important; }
}
.tsb-fit .tsb-arrow{ font-size:17px; font-weight:700; line-height:1; }
.tsb-fit.flat .tsb-arrow{ color:var(--text-2); }
@media (max-width:359px){ .tsb-fit-lbl{ display:inline; } }

/* ---------- Home rings: 5-ring layout ---------- */
.jr-rings{ grid-template-columns:minmax(0,1fr) minmax(0,1.9fr) minmax(0,1fr); grid-template-areas:"sleep rec strain" "ready rec steps"; row-gap:14px; align-items:center; }
#hero-ring-sleep{ grid-area:sleep; } #hero-ring-recovery{ grid-area:rec; } #hero-ring-strain{ grid-area:strain; }
#hero-ring-readiness{ grid-area:ready; } #hero-ring-steps{ grid-area:steps; }
.jr-rings .jr-ring-btn.sm .jr-ring{ max-width:84px; }
.jr-rings .jr-ring-btn.sm{ gap:5px; }
.jr-rings .jr-ring-cap{ font-size:11.5px; }
.jr-rings .jr-ring-cap b{ font-size:13.5px; }
@media (min-width:700px){
  .jr-rings{ grid-template-columns:repeat(2, minmax(0,1fr)) minmax(0,1.6fr) repeat(2, minmax(0,1fr)); grid-template-areas:"ready sleep rec strain steps"; }
  .jr-rings .jr-ring-btn.sm .jr-ring{ max-width:100px; }
}
#hero-ring-sleep .jr-ring{ animation-delay:.1s; } #hero-ring-strain .jr-ring{ animation-delay:.14s; }
#hero-ring-readiness .jr-ring{ animation-delay:.2s; } #hero-ring-steps .jr-ring{ animation-delay:.24s; }

/* ---------- Race form ---------- */
.rc-links{ display:inline-flex; gap:16px; }
.rc-form{ display:flex; flex-direction:column; gap:16px; margin-top:16px; }
.rc-field{ display:flex; flex-direction:column; gap:7px; min-width:0; }
.rc-row{ display:grid; grid-template-columns:minmax(0,1.3fr) minmax(0,1fr); gap:12px; }
.rc-form input{ width:100%; box-sizing:border-box; min-height:46px; padding:0 14px; border-radius:var(--r-md); border:1px solid var(--border-strong); background:var(--surface); color:var(--text-1); font:inherit; font-size:15px; color-scheme:dark; }
:root[data-theme="light"] .rc-form input{ color-scheme:light; }
.rc-form input:focus{ outline:none; border-color:var(--accent); }
.rc-form input[hidden]{ display:none; }
.rc-dist{ display:flex; flex-wrap:wrap; gap:8px; }
.rc-dist .jr-chip.active{ background:var(--accent); border-color:var(--accent); color:#0b0d11; font-weight:600; }
.rc-error{ margin:0; min-height:1em; font-size:13px; color:var(--warning); }
.rc-error:empty{ display:none; }
.jr-chart-empty .jr-btn{ margin-top:12px; }

/* ---------- Background selector ---------- */
.bg-row{ display:grid; grid-template-columns:repeat(5, minmax(0,1fr)); gap:8px; padding:4px 4px 8px; }
.bg-swatch{ display:flex; flex-direction:column; align-items:center; gap:6px; background:none; border:0; padding:4px 0; cursor:pointer; color:var(--text-2); font:inherit; font-size:11px; font-weight:600; }
.bg-swatch i{ display:block; width:40px; height:40px; border-radius:50%; background:var(--swatch); border:1px solid var(--border-strong); box-shadow:inset 0 0 0 1px color-mix(in srgb, var(--text-1) 6%, transparent); }
.bg-swatch.active i{ outline:2px solid var(--accent); outline-offset:3px; }
.bg-swatch.active{ color:var(--text-1); }
.sync-status{ margin:-2px 0 6px 46px; font-size:12px; color:var(--text-3); }
.sync-status:empty{ display:none; }

/* ---------- Weight lost comparisons ---------- */
.wl-compare{ margin-top:18px; border-top:1px solid var(--border); padding-top:18px; }
.wl-compare[hidden]{ display:none; }
.wl-main{ display:flex; flex-direction:column; gap:8px; width:100%; text-align:left; background:none; border:0; padding:0; color:inherit; font:inherit; cursor:pointer; }
.wl-big{ font-size:clamp(26px, 7vw, 36px); font-weight:700; letter-spacing:-.02em; line-height:1.15; color:var(--text-1); }
.wl-big b{ color:var(--accent); font-weight:800; }
.wl-sub{ font-size:12.5px; color:var(--text-2); }
.wl-main:hover .wl-big b{ text-decoration:underline; text-decoration-thickness:2px; text-underline-offset:4px; }
.wl-others{ display:flex; flex-wrap:wrap; gap:8px; margin-top:14px; }
.wl-others span{ font-size:12.5px; color:var(--text-2); padding:6px 11px; border-radius:999px; background:var(--surface-2); }
.wl-others b{ color:var(--text-1); font-weight:700; }

/* ---------- Sleep coach ---------- */
.sc-head{ display:flex; justify-content:space-between; align-items:flex-end; gap:20px; flex-wrap:wrap; }
.sc-bed{ font-size:clamp(52px, 15vw, 76px); font-weight:800; letter-spacing:-.04em; line-height:1; margin:8px 0 8px; color:var(--text-1); }
.sc-wake{ position:relative; display:inline-block; font-weight:700; color:var(--accent); border-bottom:1px dashed currentColor; cursor:pointer; }
.sc-wake input{ position:absolute; inset:0; opacity:0; width:100%; cursor:pointer; }
.sc-bars{ display:flex; align-items:flex-end; gap:6px; height:70px; }
.sc-night{ display:flex; flex-direction:column; align-items:center; gap:4px; height:100%; justify-content:flex-end; }
.sc-night i{ display:block; width:10px; min-height:4px; border-radius:3px; background:var(--text-3); }
.sc-night i.ok{ background:var(--accent); }
.sc-night span{ font-size:10px; color:var(--text-3); }
.sc-stats{ margin-top:20px; }
.sc-reasons{ margin:14px 0 8px; padding-left:18px; font-size:13.5px; line-height:1.6; color:var(--text-2); }

/* ---------- Morning brief ---------- */
.brief-wrap{ display:block; padding-top:20px; max-width:720px !important; }
.brief-line{ font-size:clamp(20px, 5.4vw, 26px); font-weight:600; letter-spacing:-.015em; line-height:1.35; color:var(--text-1); margin:18px 0 8px; }
.brief-rings{ display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1.6fr) minmax(0,1fr); align-items:center; justify-items:center; gap:6px; margin:22px 0 10px; }
.brief-rings .jr-ring-btn{ text-decoration:none; }
.brief-rings .jr-ring-btn.sm .jr-ring{ width:100%; max-width:92px; }
.brief-rings .jr-ring-btn.big .jr-ring{ width:100%; max-width:170px; }
.brief-rings .jr-ring svg{ width:100%; height:auto; }
.brief-session-top{ display:flex; justify-content:space-between; align-items:center; gap:10px; }
.brief-session-title{ font-size:26px; font-weight:800; letter-spacing:-.02em; }
.brief-session-sub{ font-size:15px; font-weight:600; color:var(--text-2); margin-top:6px; }
.brief-bed{ display:flex; flex-direction:column; gap:6px; }
.brief-bed-time{ font-size:clamp(46px, 13vw, 64px); font-weight:800; letter-spacing:-.04em; line-height:1; }
.hero-brief-link{ display:inline-block; margin-top:8px; font-size:12.5px; }
.cal-garmin{ margin-top:14px; }

/* ---------- Background texture layer ---------- */
body::before{
  content:''; position:fixed; inset:0; z-index:-1; pointer-events:none;
  background:var(--jr-texture, none); background-size:var(--jr-texture-size, auto);
}
.tex-row{ display:grid; grid-template-columns:repeat(4, minmax(0,1fr)); gap:10px 8px; padding:4px 4px 8px; }
@media (min-width:420px){ .tex-row{ grid-template-columns:repeat(8, minmax(0,1fr)); } }
.tex-swatch{ display:flex; flex-direction:column; align-items:center; gap:6px; background:none; border:0; padding:2px 0; cursor:pointer; color:var(--text-2); font:inherit; font-size:11px; font-weight:600; }
.tex-swatch i{ display:block; width:42px; height:42px; border-radius:12px; border:1px solid var(--border-strong); }
.tex-swatch.active i{ outline:2px solid var(--accent); outline-offset:3px; }
.tex-swatch.active{ color:var(--text-1); }

/* ---------- Home: morning brief card ---------- */
.brief-card{
  display:grid; grid-template-columns:auto minmax(0,1fr) auto; align-items:center; gap:14px;
  margin:20px 0 4px; padding:14px 16px; border-radius:16px; text-decoration:none; color:inherit;
  background:linear-gradient(135deg, color-mix(in srgb, var(--accent) 11%, var(--surface)) 0%, var(--surface) 60%);
  border:1px solid color-mix(in srgb, var(--accent) 22%, var(--border));
  transition:transform .18s var(--ease), border-color .18s var(--ease);
}
.brief-card:hover{ transform:translateY(-1px); border-color:color-mix(in srgb, var(--accent) 45%, var(--border)); }
.brief-card:focus-visible{ outline:2px solid var(--accent); outline-offset:3px; }
.brief-card-icon{ width:44px; height:44px; border-radius:13px; display:flex; align-items:center; justify-content:center; color:var(--accent); background:color-mix(in srgb, var(--accent) 16%, transparent); }
.brief-card-text{ display:flex; flex-direction:column; gap:3px; min-width:0; }
.brief-card-title{ font-size:15px; font-weight:700; letter-spacing:-.01em; color:var(--text-1); }
.brief-card-line{ font-size:13px; color:var(--text-2); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.brief-card-line b{ color:var(--text-1); font-weight:600; }
.brief-card-go{ width:32px; height:32px; border-radius:50%; display:flex; align-items:center; justify-content:center; color:var(--text-1); background:var(--surface-2); transition:transform .18s var(--ease); }
.brief-card:hover .brief-card-go{ transform:translateX(2px); }
@media (min-width:900px){ .brief-card{ max-width:520px; } }

/* =================================================================
   Full-width status bar + raised data cards
   ================================================================= */
#app{ overflow-x:clip; }
.nav-sticky{
  background:transparent !important; border-bottom:0 !important;
  backdrop-filter:none !important; -webkit-backdrop-filter:none !important;
  margin-bottom:18px !important;
}
.nav-sticky::before{
  content:''; position:absolute; top:0; bottom:0; left:-100vw; right:-100vw; z-index:-1; pointer-events:none;
  background:color-mix(in srgb, var(--surface) 86%, transparent);
  backdrop-filter:blur(14px) saturate(140%); -webkit-backdrop-filter:blur(14px) saturate(140%);
  border-bottom:1px solid var(--border);
  box-shadow:0 8px 20px -14px rgba(0,0,0,.6);
}
html[data-theme="light"] .nav-sticky::before{ box-shadow:0 8px 20px -14px rgba(20,20,15,.25); }

:root{
  --card-bg:color-mix(in srgb, var(--bg) 55%, var(--surface)); /* barely lifted off the page: the shadow does the work */
  --card-shadow:0 1px 2px rgba(0,0,0,.35), 0 12px 30px -8px rgba(0,0,0,.6);
  --card-pad:22px 20px;
}
html[data-theme="light"]{
  --card-shadow:0 1px 2px rgba(20,20,15,.06), 0 12px 30px -10px rgba(20,20,15,.16);
}
@media (max-width:599px){ :root{ --card-pad:20px 16px; } }

.jr-page-head{ display:flex; justify-content:space-between; align-items:baseline; gap:12px; padding:6px 4px 14px; }

/* ---------- Weight to pace ---------- */
.w2p-big{ font-size:clamp(40px, 11vw, 56px); font-weight:800; letter-spacing:-.03em; line-height:1; margin:8px 0 8px; }
.w2p-big b{ color:var(--accent); }
.w2p-table{ margin-top:18px; display:flex; flex-direction:column; }
.w2p-row{ display:grid; grid-template-columns:minmax(0,1.3fr) repeat(3, minmax(0,1fr)) minmax(0,1.3fr); gap:8px; padding:11px 2px; border-top:1px solid var(--border); font-size:14px; font-variant-numeric:tabular-nums; align-items:baseline; }
.w2p-row > span:not(:first-child){ text-align:right; }
.w2p-row small{ color:var(--text-3); font-size:11px; margin-left:2px; }
.w2p-th{ border-top:0; font-size:10.5px; font-weight:600; letter-spacing:.1em; text-transform:uppercase; color:var(--text-3); }
.w2p-row.now{ color:var(--text-1); }
.w2p-row:not(.now):not(.w2p-th){ color:var(--text-2); }
.w2p-ok{ color:var(--accent); }
@media (max-width:420px){ .w2p-row{ grid-template-columns:minmax(0,1.25fr) repeat(2, minmax(0,1fr)) minmax(0,1.3fr); } .w2p-row > span:nth-child(4){ display:none; } }

/* ---------- Session builder ---------- */
.sb-types{ margin-bottom:12px; }
.jr-chip.active{ background:var(--accent); border-color:var(--accent); color:#0b0d11; font-weight:600; }
.sb-levels{ margin-bottom:16px; max-width:360px; }
.sb-card{ padding:16px 0 4px; border-top:1px solid var(--border); }
.sb-title{ font-size:clamp(26px, 7vw, 34px); font-weight:800; letter-spacing:-.025em; line-height:1.1; }
.sb-sub{ font-size:13.5px; color:var(--text-2); margin-top:6px; }
.sb-steps{ list-style:none; margin:10px 0 0; padding:0; counter-reset:sb; }
.sb-steps li{ display:grid; grid-template-columns:110px minmax(0,1fr); gap:10px; padding:10px 0; border-top:1px solid var(--border); font-size:14px; }
.sb-steps li b{ font-weight:600; color:var(--text-1); }
.sb-steps li span{ color:var(--text-2); }
.sb-check{ margin-top:18px; padding-top:16px; border-top:1px solid var(--border); }
.sb-check-head{ display:flex; justify-content:space-between; align-items:baseline; }
.sb-check-title{ font-size:18px; font-weight:700; margin:6px 0 12px; }
.sb-verdict{ font-size:22px; font-weight:800; letter-spacing:-.02em; margin-bottom:12px; }
.sb-verdict.hit{ color:var(--accent); } .sb-verdict.close{ color:var(--text-1); } .sb-verdict.miss{ color:var(--warning); } .sb-verdict.neutral{ font-size:17px; }
.sb-reps{ display:grid; grid-template-columns:repeat(auto-fill, minmax(76px, 1fr)); gap:8px; }
.sb-rep{ display:flex; flex-direction:column; gap:2px; padding:10px; border-radius:12px; background:var(--surface-2); }
.sb-rep span{ font-size:11px; color:var(--text-3); }
.sb-rep b{ font-size:17px; font-weight:700; }
.sb-rep small{ font-size:11px; font-weight:600; color:var(--text-2); }
.sb-rep.hit small, .sb-rep.done small{ color:var(--accent); }
.sb-rep.miss small, .sb-rep.fast small{ color:var(--warning); }
.cal-card.session{ border-color:color-mix(in srgb, var(--accent) 40%, var(--border)); }

/* ---------- Year in review ---------- */
.yr-wrap{ display:block; padding-top:12px; max-width:560px !important; }
.yr-tabs{ margin:0 0 16px; }
.yr-story{ position:relative; height:min(560px, 72vh); border-radius:24px; overflow:hidden; box-shadow:var(--card-shadow); outline:none; background:var(--surface); }
.yr-progress{ position:absolute; top:12px; left:14px; right:14px; display:flex; gap:4px; z-index:3; }
.yr-progress i{ flex:1; height:3px; border-radius:2px; background:color-mix(in srgb, var(--text-1) 18%, transparent); }
.yr-progress i.done, .yr-progress i.now{ background:var(--text-1); }
.yr-card{ position:absolute; inset:0; padding:56px 26px 30px; display:flex; flex-direction:column; justify-content:center; opacity:0; transform:translateY(14px); transition:opacity .35s var(--ease), transform .45s var(--ease); pointer-events:none; }
.yr-card.active{ opacity:1; transform:none; }
.yr-card.tone-a{ background:radial-gradient(120% 80% at 10% 0%, color-mix(in srgb, var(--accent) 28%, transparent), transparent 60%), var(--surface); }
.yr-card.tone-b{ background:radial-gradient(120% 80% at 100% 100%, color-mix(in srgb, var(--accent) 24%, transparent), transparent 62%), var(--surface); }
.yr-card.tone-c{ background:linear-gradient(160deg, color-mix(in srgb, var(--accent) 16%, var(--surface)), var(--surface) 70%); }
.yr-kicker{ font-size:12px; font-weight:700; letter-spacing:.14em; text-transform:uppercase; color:var(--accent); }
.yr-huge{ font-size:clamp(64px, 20vw, 104px); font-weight:800; letter-spacing:-.05em; line-height:.95; margin:14px 0 10px; color:var(--text-1); }
.yr-huge small{ font-size:.28em; letter-spacing:0; margin-left:6px; color:var(--text-2); font-weight:700; }
.yr-big{ font-size:clamp(34px, 10vw, 52px); font-weight:800; letter-spacing:-.035em; line-height:1.05; margin:14px 0 10px; color:var(--text-1); }
.yr-line{ font-size:16px; line-height:1.55; color:var(--text-2); margin:0; }
.yr-line b{ color:var(--text-1); }
.yr-bars{ display:flex; align-items:flex-end; gap:5px; height:120px; margin-top:22px; }
.yr-bar{ flex:1; display:flex; flex-direction:column; justify-content:flex-end; align-items:center; gap:5px; height:100%; }
.yr-bar i{ display:block; width:100%; border-radius:4px 4px 2px 2px; background:color-mix(in srgb, var(--text-1) 22%, transparent); }
.yr-bar.top i{ background:var(--accent); }
.yr-bar span{ font-size:10px; color:var(--text-3); }
.yr-grid{ display:grid; grid-template-columns:1fr 1fr; gap:18px 14px; margin-top:18px; }
.yr-grid b{ display:block; font-size:30px; font-weight:800; letter-spacing:-.03em; }
.yr-grid span{ font-size:12px; color:var(--text-2); text-transform:uppercase; letter-spacing:.08em; font-weight:600; }
.yr-nav{ position:absolute; top:0; bottom:0; width:38%; background:transparent; border:0; cursor:pointer; z-index:2; }
.yr-nav.prev{ left:0; } .yr-nav.next{ right:0; width:62%; }
.yr-count{ position:absolute; right:16px; bottom:12px; font-size:11px; color:var(--text-3); z-index:3; }
.brief-card[hidden]{ display:none !important; } .brief-tabs{ max-width:260px; margin-bottom:8px; }
.brief-session-top{ flex-wrap:wrap; row-gap:8px; } .brief-session-top .jr-badge{ white-space:nowrap; }

/* Session builder: save row + Garmin push */
.sb-push{ display:flex; align-items:center; gap:16px; flex-wrap:wrap; margin:4px 0 6px; }
.sb-push-main{ min-height:40px; padding:0 14px; font-size:13px; gap:8px; }
.sb-push-ok{ font-size:13.5px; font-weight:600; color:var(--accent); }
button.jr-link, .jr-link{ font:inherit; font-size:12.5px; font-weight:600; color:var(--accent); text-decoration:none; background:none; border:0; cursor:pointer; padding:0; }
.yr-share{ display:grid; grid-template-columns:1.4fr 1fr; gap:10px; margin:14px 0 4px; } .yr-share .jr-btn{ min-height:46px; }

/* ---------- Best time to run ---------- */
.bt-head{ display:flex; justify-content:space-between; align-items:flex-start; gap:14px; }
.bt-time{ font-size:clamp(40px, 11vw, 56px); font-weight:800; letter-spacing:-.035em; line-height:1; margin:8px 0 8px; }
.bt-time span{ font-size:.5em; color:var(--text-2); font-weight:700; margin-left:2px; }
.bt-score{ display:flex; flex-direction:column; align-items:center; justify-content:center; min-width:64px; height:64px; border-radius:16px; font-size:11px; font-weight:700; letter-spacing:.06em; text-transform:uppercase; background:var(--surface-2); color:var(--text-2); flex:0 0 auto; }
.bt-score b{ font-size:22px; letter-spacing:-.02em; color:var(--text-1); }
.bt-score.s-great, .bt-score.s-good{ background:color-mix(in srgb, var(--accent) 16%, transparent); color:var(--accent); }
.bt-score.s-poor{ background:color-mix(in srgb, var(--warning) 14%, transparent); color:var(--warning); }
.bt-strip{ display:flex; align-items:flex-end; gap:4px; height:92px; margin:18px 0 8px; }
.bt-hour{ flex:1; min-width:0; height:100%; display:flex; flex-direction:column; justify-content:flex-end; align-items:center; gap:5px; background:none; border:0; padding:0; cursor:pointer; color:var(--text-3); font:inherit; }
.bt-hour i{ display:block; width:100%; max-width:22px; border-radius:4px 4px 2px 2px; background:var(--text-3); opacity:.55; transition:opacity .15s; }
.bt-hour i.s-great, .bt-hour i.s-good{ background:var(--accent); }
.bt-hour i.s-poor{ background:var(--warning); }
.bt-hour.best i{ opacity:1; }
.bt-hour.sel i{ opacity:1; outline:2px solid var(--text-1); outline-offset:1px; }
.bt-hour span{ font-size:10px; font-weight:600; }
.bt-hour.best span{ color:var(--accent); }
.bt-detail{ font-size:13px; color:var(--text-2); line-height:1.5; margin:6px 0 8px; min-height:2.9em; }
.bt-foot{ display:flex; justify-content:space-between; align-items:center; gap:10px; flex-wrap:wrap; }
.brief-besttime{ margin-bottom:18px; }

/* Session builder: compact schedule row */
.sb-save{ display:flex; align-items:center; gap:8px; margin:14px 0 6px; padding-top:14px; border-top:1px solid var(--border); }
.sb-save-lbl{ flex:1; min-width:0; }
.sb-date{ display:inline-flex; align-items:center; gap:7px; height:36px; padding:0 10px; border-radius:10px; background:var(--surface-2); color:var(--text-2); cursor:pointer; }
.sb-date input{ border:0; background:transparent; color:var(--text-1); font:inherit; font-size:13.5px; font-weight:600; padding:0; width:auto; min-width:0; max-width:128px; color-scheme:dark; outline:none; }
html[data-theme="light"] .sb-date input{ color-scheme:light; }
.sb-date input::-webkit-calendar-picker-indicator{ display:none; }
.sb-save-btn{ display:inline-flex; align-items:center; gap:6px; height:36px; padding:0 14px; border-radius:999px; border:0; background:var(--accent); color:#0b0d11; font:inherit; font-size:13px; font-weight:700; cursor:pointer; white-space:nowrap; flex:0 0 auto; }
.sb-save-btn:hover{ opacity:.9; }
@media (max-width:359px){ .sb-save-lbl{ display:none; } .sb-date input{ max-width:112px; } }

/* ---------- Saturday parkrun forecast ---------- */
.prf-tabs{ margin-bottom:18px; }
.prf-dist{ width:100%; height:auto; max-width:100%; display:block; margin:16px 0 4px; overflow:visible; }

/* ---------- Kudos & social ---------- */
.kd-grid{ display:grid; grid-template-columns:minmax(0,1fr); gap:0 40px; }
@media (min-width:900px){ .kd-grid{ grid-template-columns:minmax(0,1.3fr) minmax(0,1fr); } }
.kd-bars{ display:flex; flex-direction:column; gap:12px; margin-top:4px; }
.kd-bar{ display:grid; grid-template-columns:84px minmax(0,1fr) 64px; align-items:center; gap:12px; font-size:13.5px; }
.kd-bar-lbl{ color:var(--text-2); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.kd-bar-track{ height:8px; border-radius:4px; background:var(--surface-2); overflow:hidden; }
.kd-bar-track i{ display:block; height:100%; border-radius:4px; background:var(--text-3); transform-origin:left; animation:kdGrow .9s cubic-bezier(.2,.8,.2,1) both; }
.kd-bar.top .kd-bar-track i{ background:var(--accent); }
.kd-bar.top .kd-bar-lbl{ color:var(--text-1); }
.kd-bar-val{ text-align:right; font-variant-numeric:tabular-nums; line-height:1.1; }
.kd-bar-val b{ display:block; font-size:15px; }
.kd-bar-val small{ color:var(--text-3); font-size:11px; }
@keyframes kdGrow{ from{ transform:scaleX(0); } to{ transform:scaleX(1); } }
.kd-insights{ list-style:none; padding:0; margin:22px 0 0; display:flex; flex-direction:column; gap:10px; }
.kd-insights li{ position:relative; padding-left:18px; color:var(--text-2); font-size:14px; line-height:1.5; }
.kd-insights li::before{ content:''; position:absolute; left:0; top:.55em; width:7px; height:7px; border-radius:50%; background:var(--accent); }
.kd-insights b{ color:var(--text-1); }
.kd-rank{ display:inline-block; width:20px; color:var(--text-3); font-variant-numeric:tabular-nums; }

/* ---------- Sync key (Settings) ---------- */
.sync-key{ display:flex; align-items:center; gap:8px; margin:2px 16px 8px 46px; }
.sync-key:empty{ display:none; }
.sync-key-on{ font-size:12px; color:var(--text-3); flex:1; }
.sync-key .jr-link{ font-size:12px; background:none; border:0; padding:0; cursor:pointer; }
.sync-key-input{ flex:1; min-width:0; height:36px; padding:0 12px; border-radius:10px; border:1px solid var(--border); background:var(--surface-2); color:var(--text-1); font:inherit; font-size:14px; }
.sync-key-input:focus{ outline:none; border-color:var(--accent); }
.sync-key-save{ height:36px; padding:0 14px; border-radius:10px; border:0; background:var(--accent); color:#000; font:inherit; font-size:13px; font-weight:700; cursor:pointer; }
.sync-key-save:disabled{ opacity:.6; }

/* Weight unit switch (Home → Fitness trend) */
.jr-tabs.fit-unit{ flex:0 0 auto; }
.jr-tabs.fit-unit .jr-tab{ padding:5px 10px; font-size:12px; }
.jr-tabs.fit-unit[hidden]{ display:none; }

/* ---------- Ghost runner ---------- */
.gh-tabs{ margin-bottom:10px; }
.gh-select{ width:100%; height:38px; margin:0 0 14px; padding:0 12px; border-radius:10px; border:1px solid var(--border); background:var(--surface-2); color:var(--text-1); font:inherit; font-size:13.5px; }
.gh-head{ margin:4px 0 8px; }
.gh-verdict{ font-size:clamp(24px, 6.5vw, 32px); font-weight:800; letter-spacing:-.02em; margin:6px 0 4px; }
.gh-verdict.win{ color:var(--accent); }
.gh-verdict.lose{ color:var(--warning); }
.gh-stage{ background:var(--surface-2); border-radius:14px; padding:6px; margin-top:10px; }
.gh-track{ width:100%; height:auto; display:block; }
.gh-controls{ display:flex; align-items:center; gap:12px; margin-top:12px; }
.gh-play{ flex:0 0 auto; width:44px; height:44px; border-radius:50%; border:0; background:var(--accent); color:#000; font-size:15px; font-weight:800; cursor:pointer; }
.gh-controls input[type=range]{ flex:1; min-width:0; accent-color:var(--accent); }
.gh-readout{ flex:0 0 100%; order:3; font-size:13px; color:var(--text-2); font-variant-numeric:tabular-nums; }
.gh-controls{ flex-wrap:wrap; }
.gh-gap{ width:100%; height:auto; display:block; }
.gh-splits{ margin-top:14px; display:flex; flex-direction:column; }
.gh-row{ display:grid; grid-template-columns:40px repeat(3, minmax(0,1fr)); gap:8px; padding:9px 2px; border-top:1px solid var(--border); font-size:14px; font-variant-numeric:tabular-nums; }
.gh-row > span:not(:first-child){ text-align:right; }
.gh-th{ border-top:0; font-size:10.5px; font-weight:600; letter-spacing:.1em; text-transform:uppercase; color:var(--text-3); }
.gh-row .up{ color:var(--accent); font-weight:700; }
.gh-row .down{ color:var(--warning); font-weight:700; }
.rm-tabs .jr-tab{ padding-left:9px; padding-right:9px; }
@media (max-width:420px){ .rm-tabs .jr-tab{ padding-left:6px; padding-right:6px; font-size:12.5px; } }

/* ---------- Ask (floating voice assistant) ---------- */
.jv-fab{ position:fixed; right:16px; bottom:calc(84px + env(safe-area-inset-bottom, 0px)); z-index:85; width:50px; height:50px; border-radius:50%; border:1px solid var(--border); background:color-mix(in srgb, var(--surface) 82%, transparent); backdrop-filter:blur(14px); -webkit-backdrop-filter:blur(14px); display:flex; align-items:center; justify-content:center; cursor:pointer; box-shadow:0 6px 22px rgba(0,0,0,.28); padding:0; transition:transform .15s ease; }
.jv-fab:active{ transform:scale(.94); }
@media (min-width:900px){ .jv-fab{ right:28px; bottom:28px; } }
.jv-orb{ position:relative; width:26px; height:26px; border-radius:50%; display:block; overflow:hidden; clip-path:circle(50%); isolation:isolate; background:color-mix(in srgb, var(--accent) 30%, #000); }
.jv-orb i{ position:absolute; inset:-20%; border-radius:50%; filter:blur(5px); mix-blend-mode:screen; animation:jvSpin 6s linear infinite; }
.jv-orb i:nth-child(1){ background:radial-gradient(circle at 30% 35%, var(--accent) 0 32%, transparent 55%); }
.jv-orb i:nth-child(2){ background:radial-gradient(circle at 70% 60%, #ffffff 0 18%, transparent 45%); opacity:.7; animation-duration:4.5s; animation-direction:reverse; }
.jv-orb i:nth-child(3){ background:radial-gradient(circle at 45% 75%, color-mix(in srgb, var(--accent) 55%, #7c5cff) 0 30%, transparent 55%); animation-duration:7.5s; }
@keyframes jvSpin{ to{ transform:rotate(360deg); } }
.jv-overlay{ position:fixed; inset:0; z-index:200; display:flex; align-items:center; justify-content:center; padding:20px; background:rgba(0,0,0,.45); backdrop-filter:blur(6px); -webkit-backdrop-filter:blur(6px); opacity:0; transition:opacity .2s ease; }
.jv-overlay[hidden]{ display:none; }
.jv-overlay.open{ opacity:1; }
.jv-box{ width:100%; max-width:420px; max-height:calc(100vh - 40px); overflow-y:auto; background:var(--surface); border:1px solid var(--border); border-radius:22px; padding:14px 18px 18px; text-align:center; transform:translateY(8px) scale(.98); transition:transform .2s ease; }
.jv-overlay.open .jv-box{ transform:none; }
.jv-top{ display:flex; justify-content:space-between; }
.jv-icon{ width:34px; height:34px; border-radius:50%; border:0; background:var(--surface-2); color:var(--text-2); font-size:14px; cursor:pointer; }
.jv-orb-btn{ display:block; margin:0 auto; background:none; border:0; padding:6px; cursor:pointer; border-radius:50%; }
.jv-orb-btn .jv-orb{ width:84px; height:84px; transition:transform .3s ease; }
.jv-orb-btn .jv-orb i{ filter:blur(12px); }
.jv-box.listening .jv-orb-btn .jv-orb{ animation:jvPulse 1.1s ease-in-out infinite; }
.jv-box.thinking .jv-orb-btn .jv-orb i{ animation-duration:1.4s; }
@keyframes jvPulse{ 0%,100%{ transform:scale(1); } 50%{ transform:scale(1.12); } }
.jv-status{ font-size:11px; font-weight:600; letter-spacing:.12em; text-transform:uppercase; color:var(--text-3); margin:10px 0 0; }
.jv-heard{ font-size:14px; color:var(--text-2); margin:8px 0 0; min-height:1em; }
.jv-heard:empty{ display:none; }
.jv-answer{ font-size:17px; line-height:1.45; font-weight:600; color:var(--text-1); margin:10px 0 0; text-align:left; }
.jv-answer:empty{ display:none; }
.jv-chips{ display:flex; flex-wrap:wrap; justify-content:center; gap:6px; margin:16px 0 12px; }
.jv-chip{ border:1px solid var(--border); background:none; color:var(--text-2); border-radius:999px; padding:7px 11px; font:inherit; font-size:12.5px; cursor:pointer; }
.jv-chip:hover{ color:var(--text-1); border-color:var(--text-3); }
.jv-form{ display:flex; gap:8px; }
.jv-form input{ flex:1; min-width:0; height:40px; padding:0 14px; border-radius:12px; border:1px solid var(--border); background:var(--surface-2); color:var(--text-1); font:inherit; font-size:15px; }
.jv-form input:focus{ outline:none; border-color:var(--accent); }
.jv-form button{ width:40px; height:40px; border-radius:12px; border:0; background:var(--accent); color:#000; font-size:17px; font-weight:800; cursor:pointer; }
@media (prefers-reduced-motion: reduce){ .jv-orb i, .jv-box.listening .jv-orb-btn .jv-orb{ animation:none; } }

/* ---------- Plan vs actual ---------- */
.pva-chart{ display:flex; align-items:stretch; gap:6px; height:190px; margin:22px 0 10px; }
.pva-col{ flex:1; min-width:0; display:flex; flex-direction:column; align-items:center; gap:6px; }
.pva-pct{ font-size:11px; font-weight:700; color:var(--text-3); font-variant-numeric:tabular-nums; min-height:14px; }
.pva-pct.on{ color:var(--accent); } .pva-pct.under, .pva-pct.over{ color:var(--warning); }
.pva-bars{ position:relative; flex:1; width:100%; max-width:34px; }
.pva-bars i{ position:absolute; bottom:0; left:0; right:0; border-radius:6px 6px 3px 3px; }
.pva-plan{ border:1.5px dashed var(--text-3); background:transparent; box-sizing:border-box; }
.pva-bars .pva-act{ left:5px; right:5px; transform-origin:bottom; animation:pvaGrow .8s cubic-bezier(.2,.8,.2,1) both; }
.pva-act{ background:var(--text-3); }
.pva-act.on{ background:var(--accent); } .pva-act.under{ background:color-mix(in srgb, var(--warning) 75%, transparent); } .pva-act.over{ background:var(--warning); }
.pva-col.cur .pva-act{ opacity:.75; }
.pva-lbl{ font-size:10.5px; color:var(--text-3); white-space:nowrap; }
@keyframes pvaGrow{ from{ transform:scaleY(0); } to{ transform:scaleY(1); } }
.pva-key{ display:flex; flex-wrap:wrap; gap:14px; font-size:12px; color:var(--text-3); margin-bottom:10px; }
.pva-key span{ display:inline-flex; align-items:center; gap:6px; }
.pva-key i{ display:inline-block; width:12px; height:12px; border-radius:3px; }
@media (max-width:420px){ .pva-chart{ gap:3px; } .pva-lbl{ font-size:9px; } .pva-pct{ font-size:9.5px; } }

/* ---------- Fitness, fatigue & form ---------- */
.pmc-range{ margin:20px 0 6px; width:max-content; max-width:100%; }
.pmc-wrap{ position:relative; }
.pmc-svg{ width:100%; height:auto; display:block; overflow:visible; touch-action:pan-y; }
.pmc-tip{ position:absolute; top:0; width:170px; padding:8px 10px; border-radius:10px; background:var(--surface-2); border:1px solid var(--border); font-size:12px; line-height:1.45; pointer-events:none; display:flex; flex-direction:column; color:var(--text-2); }
.pmc-tip[hidden]{ display:none; }
.pmc-tip b{ color:var(--text-1); }
.pmc-zone{ font-weight:700; }
.pmc-zone.z-fresh{ color:var(--accent); } .pmc-zone.z-optimal{ color:color-mix(in srgb, var(--accent) 70%, var(--text-1)); } .pmc-zone.z-risk{ color:var(--warning); } .pmc-zone.z-grey, .pmc-zone.z-transition{ color:var(--text-2); }

/* ---------- Goals ---------- */
.gl-summary{ display:flex; align-items:center; gap:18px; margin-top:6px; }
.gl-ring{ position:relative; width:84px; height:84px; flex:0 0 auto; }
.gl-ring > span{ position:absolute; inset:0; display:flex; align-items:center; justify-content:center; font-size:20px; font-weight:800; }
.gl-sum-title{ font-size:20px; font-weight:800; letter-spacing:-.01em; margin-bottom:4px; }
.gl-top{ display:flex; justify-content:space-between; align-items:flex-start; gap:12px; }
.gl-big{ font-size:clamp(30px, 8vw, 40px); font-weight:800; letter-spacing:-.03em; line-height:1.05; margin:8px 0 12px; font-variant-numeric:tabular-nums; }
.gl-big small{ font-size:14px; font-weight:600; color:var(--text-3); letter-spacing:0; }
.gl-tag{ flex:0 0 auto; font-size:11px; font-weight:700; letter-spacing:.06em; text-transform:uppercase; padding:5px 9px; border-radius:999px; background:var(--surface-2); color:var(--text-2); }
.gl-tag.on, .gl-tag.done{ background:color-mix(in srgb, var(--accent) 16%, transparent); color:var(--accent); }
.gl-tag.behind{ background:color-mix(in srgb, var(--warning) 15%, transparent); color:var(--warning); }
.gl-bar{ position:relative; height:10px; border-radius:5px; background:var(--surface-2); }
.gl-bar i{ position:absolute; left:0; top:0; bottom:0; border-radius:5px; background:var(--accent); animation:glGrow 1s cubic-bezier(.2,.8,.2,1) both; transform-origin:left; }
.gl-bar b{ position:absolute; top:-5px; bottom:-5px; width:2px; margin-left:-1px; background:var(--text-1); border-radius:1px; }
@keyframes glGrow{ from{ transform:scaleX(0); } to{ transform:scaleX(1); } }
.gl-foot{ display:flex; justify-content:space-between; flex-wrap:wrap; gap:4px 16px; margin-top:10px; font-size:13px; color:var(--text-2); }
.gl-foot b{ color:var(--text-1); } .gl-foot b.up{ color:var(--accent); } .gl-foot b.down{ color:var(--warning); }
.gl-race + .gl-race{ margin-top:22px; padding-top:18px; border-top:1px solid var(--border); }
.gl-weeks{ display:grid; grid-template-columns:repeat(12, minmax(0,1fr)); gap:5px; }
.gl-weeks span{ height:30px; border-radius:7px; background:var(--surface-2); display:flex; align-items:center; justify-content:center; font-size:12px; font-weight:700; color:var(--text-3); }
.gl-weeks span.part{ background:color-mix(in srgb, var(--accent) 22%, var(--surface-2)); color:var(--text-2); }
.gl-weeks span.hit{ background:var(--accent); color:#0b0d11; }
.gl-weeks span.cur{ outline:1.5px solid var(--text-2); outline-offset:1px; }
.gl-ed{ display:flex; flex-direction:column; gap:10px; margin-top:12px; }
.gl-ed label{ display:flex; flex-direction:column; gap:5px; font-size:12px; color:var(--text-3); }
.gl-ed-race{ display:grid; grid-template-columns:minmax(0,1.4fr) minmax(0,.9fr) minmax(0,.9fr) 30px; gap:6px; align-items:center; margin-bottom:6px; }
.gl-ed-race .gl-ed-by{ grid-column:1 / 4; }
.gl-ed-del{ width:30px; height:30px; border-radius:8px; border:0; background:var(--surface-2); color:var(--text-2); cursor:pointer; }
.gl-in{ height:38px; padding:0 10px; border-radius:10px; border:1px solid var(--border); background:var(--surface-2); color:var(--text-1); font:inherit; font-size:14px; min-width:0; width:100%; box-sizing:border-box; }
.gl-in:focus{ outline:none; border-color:var(--accent); }

/* ---------- Routes ---------- */
.rt-map{ height:360px; border-radius:14px; overflow:hidden; background:var(--surface-2); margin-top:4px; z-index:0; }
@media (min-width:900px){ .rt-map{ height:460px; } }
.rt-map-tabs .jr-tab{ padding:5px 10px; font-size:12px; }
.rt-row{ width:100%; display:grid; grid-template-columns:52px minmax(0,1fr) auto; gap:14px; align-items:center; padding:14px 0; border:0; border-top:1px solid var(--border); background:none; color:inherit; font:inherit; text-align:left; cursor:pointer; }
.rt-row:first-child{ border-top:0; }
.rt-thumb{ display:block; background:var(--surface-2); border-radius:10px; }
.rt-main{ min-width:0; display:flex; flex-direction:column; gap:3px; }
.rt-name{ font-weight:700; font-size:15px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.rt-sub{ font-size:12.5px; color:var(--text-3); }
.rt-stats{ display:flex; flex-direction:column; align-items:flex-end; gap:3px; }
.rt-best{ font-weight:800; font-size:16px; font-variant-numeric:tabular-nums; text-align:right; line-height:1.1; }
.rt-best small{ display:block; font-size:10.5px; font-weight:600; color:var(--text-3); }
.rt-spark{ display:block; }
.rt-trend{ font-size:11px; font-weight:700; color:var(--text-3); }
.rt-trend.up{ color:var(--accent); } .rt-trend.down{ color:var(--warning); }
@media (max-width:420px){ .rt-spark{ display:none; } }
.rt-title-row{ display:flex; align-items:baseline; justify-content:space-between; gap:10px; }
.rt-title-row .jr-link{ background:none; border:0; cursor:pointer; flex:0 0 auto; }
.rt-modal-thumb{ display:flex; justify-content:center; margin:6px 0 14px; }

/* Small status toast (full-history build) */
.jr-toast{ position:fixed; left:50%; bottom:calc(92px + env(safe-area-inset-bottom, 0px)); transform:translate(-50%, 20px); z-index:190; display:flex; align-items:center; gap:10px; max-width:calc(100vw - 32px); padding:10px 14px; border-radius:14px; background:var(--surface); border:1px solid var(--border); box-shadow:0 8px 28px rgba(0,0,0,.3); font-size:13px; color:var(--text-2); opacity:0; pointer-events:none; transition:opacity .2s ease, transform .2s ease; }
.jr-toast.show{ opacity:1; transform:translate(-50%, 0); pointer-events:auto; }
.jr-toast b{ color:var(--text-1); white-space:nowrap; }
.jr-toast span{ color:var(--text-3); }
.jr-toast-btn{ border:0; border-radius:9px; background:var(--accent); color:#0b0d11; font:inherit; font-size:12.5px; font-weight:700; padding:6px 12px; cursor:pointer; }
@media (min-width:900px){ .jr-toast{ bottom:28px; } }

/* ---------- Lifted sections + glowing dials ----------
   Every top-level section sits on a barely-lighter surface with a soft,
   faint shadow — no borders. Anything nested inside a section stays flat. */
:root{ --lift-bg:color-mix(in srgb, var(--bg) 62%, var(--surface)); --lift-shadow:0 1px 2px rgba(0,0,0,.22), 0 14px 34px -14px rgba(0,0,0,.55); }
:root[data-theme="light"]{ --lift-bg:var(--surface); --lift-shadow:0 1px 2px rgba(30,28,20,.05), 0 12px 30px -14px rgba(30,28,20,.16); }
.jr-section, .sec, .jr-hero, #app > details.jr-more{
  background:var(--lift-bg) !important; border:0 !important; border-radius:20px !important;
  box-shadow:var(--lift-shadow) !important; padding:22px 20px 18px !important; margin:0 0 16px !important;
}
#app > details.jr-more{ padding:0 18px !important; margin-bottom:10px !important; }
/* nested: flat, hairline dividers as before */
.jr-section .sec, .jr-section .jr-section, .jr-hero .jr-section, details .sec, .sec .sec{
  background:transparent !important; box-shadow:none !important; border-radius:0 !important;
  border-top:1px solid var(--border) !important; padding:26px 0 !important; margin:0 !important;
}
.jr-tool > .sec, details > .sec:first-of-type{ border-top:0 !important; padding-top:4px !important; }
.jr-section > details.jr-more:first-of-type{ margin-top:4px; }
.jr-page-head{ margin-bottom:14px; }
@media (max-width:420px){ .jr-section, .sec, .jr-hero{ padding:20px 16px 16px !important; border-radius:18px !important; } }
/* older gauge dials: a soft glow in the dial's own colour */
.gauge-fill-animated{ filter:drop-shadow(0 0 5px color-mix(in srgb, var(--accent) 45%, transparent)) !important; }
.jr-tools{ background:var(--lift-bg); border-radius:20px; box-shadow:var(--lift-shadow); padding:2px 18px; margin-bottom:16px; }
.jr-tools > details.jr-more:first-child{ border-top:0; }
:root[data-theme="light"] .jr-ring-glow{ opacity:.28; }

/* Settings → Notifications */
.push-row{ padding:2px 16px 8px 16px; }
.push-row .sync-status{ margin:6px 0 0; }
.push-enable{ width:100%; height:40px; }
.push-on{ display:flex; align-items:center; gap:14px; font-size:13px; color:var(--text-1); flex-wrap:wrap; }
.push-on span{ flex:1; min-width:150px; }
.push-on .jr-link{ font-size:12.5px; background:none; border:0; padding:0; cursor:pointer; }
.push-on .push-off{ color:var(--text-3); }
.push-opt{ display:flex; align-items:center; gap:10px; margin-top:10px; font-size:13.5px; color:var(--text-1); cursor:pointer; }
.push-opt input{ width:18px; height:18px; accent-color:var(--accent); margin:0; }
.push-opt span{ flex:1; }
.push-opt select{ height:30px; border-radius:8px; border:1px solid var(--border); background:var(--surface-2); color:var(--text-1); font:inherit; font-size:12.5px; padding:0 6px; }

/* ---------- Notification inbox ---------- */
.jn-bell{ position:relative; flex:0 0 auto; width:34px; height:34px; border-radius:50%; border:0; background:var(--surface-2); color:var(--text-2); display:inline-flex; align-items:center; justify-content:center; cursor:pointer; padding:0; transition:color .15s ease; }
.jn-bell:hover{ color:var(--text-1); }
.jn-badge{ position:absolute; top:-3px; right:-4px; min-width:17px; height:17px; padding:0 4px; border-radius:9px; background:var(--accent); color:#0b0d11; font-size:10.5px; font-weight:800; line-height:17px; text-align:center; box-shadow:0 0 0 2px var(--bg), 0 0 10px color-mix(in srgb, var(--accent) 60%, transparent); }
.jn-badge[hidden]{ display:none; }
.jn-overlay{ position:fixed; inset:0; z-index:210; display:flex; align-items:center; justify-content:center; padding:20px; background:rgba(0,0,0,.45); backdrop-filter:blur(6px); -webkit-backdrop-filter:blur(6px); opacity:0; transition:opacity .18s ease; }
.jn-overlay[hidden]{ display:none; }
.jn-overlay.open{ opacity:1; }
.jn-box{ width:100%; max-width:440px; max-height:min(640px, calc(100vh - 40px)); display:flex; flex-direction:column; background:var(--surface); border-radius:22px; box-shadow:0 20px 50px -20px rgba(0,0,0,.6); transform:translateY(8px) scale(.98); transition:transform .18s ease; overflow:hidden; }
.jn-overlay.open .jn-box{ transform:none; }
.jn-head{ display:flex; align-items:center; justify-content:space-between; padding:16px 16px 10px 20px; }
.jn-actions{ display:flex; align-items:center; gap:14px; }
.jn-actions .jr-link{ background:none; border:0; padding:0; cursor:pointer; font-size:12.5px; color:var(--text-3); }
.jn-list{ overflow-y:auto; padding:0 8px 10px; -webkit-overflow-scrolling:touch; }
.jn-item{ display:grid; grid-template-columns:36px minmax(0,1fr); gap:12px; padding:12px; border-radius:14px; text-decoration:none; color:inherit; position:relative; }
.jn-item:hover{ background:var(--surface-2); }
.jn-item.unread::after{ content:''; position:absolute; top:18px; right:12px; width:7px; height:7px; border-radius:50%; background:var(--accent); box-shadow:0 0 8px var(--accent); }
.jn-ico{ width:36px; height:36px; border-radius:11px; display:flex; align-items:center; justify-content:center; background:var(--surface-2); color:var(--text-2); }
.jn-ico.k-run{ color:var(--accent); background:color-mix(in srgb, var(--accent) 14%, var(--surface-2)); }
.jn-ico.k-morning{ color:#f5b942; } .jn-ico.k-evening{ color:#9aa7ff; } .jn-ico.k-race{ color:var(--warning); }
.jn-main{ min-width:0; display:flex; flex-direction:column; gap:3px; }
.jn-top{ display:flex; align-items:baseline; justify-content:space-between; gap:10px; padding-right:14px; }
.jn-top b{ font-size:14px; font-weight:700; color:var(--text-1); min-width:0; line-height:1.3; }
.jn-top time{ flex:0 0 auto; font-size:11.5px; color:var(--text-3); }
.jn-body{ font-size:13px; line-height:1.45; color:var(--text-2); }
.jn-item:not(.unread) .jn-top b{ font-weight:600; }
.jn-empty{ display:flex; flex-direction:column; align-items:center; text-align:center; gap:8px; padding:34px 20px 30px; color:var(--text-3); }
.jn-empty p{ margin:6px 0 0; font-weight:700; color:var(--text-1); }
.jn-empty span{ font-size:13px; line-height:1.5; max-width:280px; }
.jn-empty .jr-btn{ margin-top:10px; }
.cal-note{ margin-top:4px; font-size:11.5px; color:var(--accent); font-weight:600; }
.cal-card.missed .cal-note{ color:var(--warning); }

/* Status colours for dials */
:root{ --good:#22c55e; --ok:#eab308; --bad:#ef4444; }
:root[data-theme="light"]{ --good:#16a34a; --ok:#ca8a04; --bad:#dc2626; }
.jr-ring-big-state.t-good{ color:var(--good) !important; } .jr-ring-big-state.t-ok{ color:var(--ok) !important; } .jr-ring-big-state.t-bad{ color:var(--bad) !important; }

/* ---------- Year at a glance ---------- */
.yg-years{ margin-bottom:14px; width:max-content; max-width:100%; }
.yg-stats{ margin-bottom:18px; }
.yg-grid{ display:grid; grid-template-columns:repeat(3, minmax(0,1fr)); gap:16px 14px; }
@media (min-width:700px){ .yg-grid{ grid-template-columns:repeat(4, minmax(0,1fr)); } }
@media (min-width:1100px){ .yg-grid{ grid-template-columns:repeat(6, minmax(0,1fr)); } }
.yg-m{ display:flex; justify-content:space-between; align-items:baseline; font-size:11px; font-weight:700; letter-spacing:.08em; text-transform:uppercase; color:var(--text-2); margin-bottom:6px; }
.yg-m small{ font-size:10px; font-weight:600; letter-spacing:0; text-transform:none; color:var(--text-3); }
.yg-cells{ display:grid; grid-template-columns:repeat(7, minmax(0,1fr)); gap:2px; }
.yg-d, .yg-pad{ display:block; aspect-ratio:1; border-radius:3px; }
.yg-d{ background:var(--surface-2); }
.yg-d.future{ opacity:.35; }
.yg-d.l1{ background:color-mix(in srgb, var(--accent) 28%, var(--surface-2)); }
.yg-d.l2{ background:color-mix(in srgb, var(--accent) 52%, var(--surface-2)); }
.yg-d.l3{ background:color-mix(in srgb, var(--accent) 76%, var(--surface-2)); }
.yg-d.l4{ background:var(--accent); box-shadow:0 0 6px color-mix(in srgb, var(--accent) 60%, transparent); }
.yg-d[data-yg]{ cursor:pointer; }
.yg-d.today{ outline:1.5px solid var(--text-1); outline-offset:1px; }
.yg-d.sel{ outline:2px solid var(--text-1); outline-offset:1px; }
.yg-key{ display:flex; align-items:center; gap:4px; margin-top:16px; font-size:11px; color:var(--text-3); flex-wrap:wrap; }
.yg-key .yg-d{ width:11px; height:11px; }
.yg-key span{ margin:0 4px; }
.yg-key .yg-key-note{ margin-left:auto; }
.yg-detail:not(:empty){ margin-top:14px; padding-top:12px; border-top:1px solid var(--border); }
/* ---------- Streak flame ---------- */
.jr-streak{ flex:0 0 auto; display:inline-flex; align-items:center; gap:4px; height:34px; padding:0 11px 0 9px; border-radius:17px; border:0; background:var(--surface-2); color:var(--text-3); font:inherit; font-size:13px; cursor:pointer; }
.jr-streak b{ font-weight:800; color:var(--text-2); }
.jr-streak.lit{ color:#ff8a1f; }
.jr-streak.lit b{ color:var(--text-1); }
.jr-streak.hot svg{ filter:drop-shadow(0 0 5px rgba(255,138,31,.7)); animation:flameFlicker 2.4s ease-in-out infinite; transform-origin:50% 90%; }
@keyframes flameFlicker{ 0%,100%{ transform:scale(1) rotate(0); } 40%{ transform:scale(1.08) rotate(-3deg); } 70%{ transform:scale(.96) rotate(2deg); } }
.streak-head{ display:flex; align-items:center; gap:14px; }
.streak-flame{ color:var(--text-3); display:inline-flex; }
.streak-flame.lit{ color:#ff8a1f; filter:drop-shadow(0 0 10px rgba(255,138,31,.55)); }
.streak-weeks{ display:grid; grid-template-columns:repeat(12, minmax(0,1fr)); gap:5px; margin-top:18px; }
.streak-wk{ display:flex; flex-direction:column; align-items:center; gap:4px; font-size:9.5px; color:var(--text-3); }
.streak-wk i{ width:100%; aspect-ratio:1; max-width:22px; border-radius:6px; background:var(--surface-2); }
.streak-wk.hit i{ background:#ff8a1f; box-shadow:0 0 8px rgba(255,138,31,.45); }
.streak-wk.cur i{ outline:1.5px solid var(--text-2); outline-offset:1px; }
@media (max-width:380px){ .jr-streak{ padding:0 8px 0 7px; } }
@media (prefers-reduced-motion: reduce){ .jr-streak.hot svg{ animation:none; } }
/* ---------- This week ring (Home) ---------- */
.wk-ring{ display:flex; align-items:center; gap:14px; margin:18px 0 4px; padding:12px 14px; border-radius:16px; background:var(--surface-2); text-decoration:none; color:inherit; }
.wk-ring .jr-ring{ position:relative; width:64px; height:64px; flex:0 0 auto; }
.wk-ring .jr-ring-center{ position:absolute; inset:0; display:flex; align-items:center; justify-content:center; }
.wk-ring-pct{ font-size:15px; font-weight:800; }
.wk-ring-pct small{ font-size:10px; color:var(--text-3); }
.wk-ring-text{ flex:1; min-width:0; display:flex; flex-direction:column; gap:3px; }
.wk-ring-main{ font-size:14px; color:var(--text-2); }
.wk-ring-main b{ font-size:17px; color:var(--text-1); }
.wk-ring-chev{ color:var(--text-3); flex:0 0 auto; }
@media (max-width:440px){
  .nav-sticky{ gap:8px !important; }
  .tsb-fit-lbl{ display:none; }
  .nav-sticky > .training-status-banner{ gap:10px; }
  .jn-bell{ width:32px; height:32px; }
  .jr-streak{ height:32px; }
}

/* ---------- Time-of-day sky (Home hero) ---------- */
.jr-hero.sky{ position:relative; overflow:hidden; isolation:isolate; }
.jr-hero.sky > *:not(.sky-layer):not(.sky-stars){ position:relative; z-index:1; }
.sky-layer, .sky-stars{ position:absolute; inset:0; pointer-events:none; z-index:0; transition:opacity 1s ease; }
.sky-dawn .sky-layer{ background:radial-gradient(120% 70% at 15% -10%, rgba(255,170,120,.20), transparent 60%), radial-gradient(120% 80% at 90% -20%, rgba(120,170,255,.16), transparent 60%); }
.sky-day .sky-layer{ background:radial-gradient(140% 80% at 50% -30%, rgba(90,180,255,.16), transparent 62%); }
.sky-dusk .sky-layer{ background:radial-gradient(120% 70% at 85% -10%, rgba(255,120,80,.20), transparent 60%), radial-gradient(120% 80% at 10% -20%, rgba(170,90,255,.16), transparent 60%); }
.sky-night .sky-layer{ background:radial-gradient(130% 80% at 50% -30%, rgba(80,90,220,.18), transparent 62%); }
.sky-stars{ opacity:0; }
.sky-night .sky-stars{ opacity:1; }
.sky-stars i{ position:absolute; border-radius:50%; background:#fff; opacity:.5; animation:twinkle 3.5s ease-in-out infinite; }
@keyframes twinkle{ 0%,100%{ opacity:.15; } 50%{ opacity:.7; } }
html[data-theme="light"] .sky-dawn .sky-layer{ background:radial-gradient(120% 70% at 15% -10%, rgba(255,160,100,.22), transparent 60%), radial-gradient(120% 80% at 90% -20%, rgba(100,160,255,.18), transparent 60%); }
html[data-theme="light"] .sky-stars{ display:none; }
@media (prefers-reduced-motion: reduce){ .sky-stars i{ animation:none; } }
/* ---------- Route legend (run details) ---------- */
.route-legend{ display:flex; min-width:0; max-width:100%; align-items:center; gap:8px; margin:8px 0 2px; font-size:11.5px; color:var(--text-3); font-variant-numeric:tabular-nums; }
.route-legend:empty{ display:none; }
.route-legend-bar{ flex:1; height:6px; border-radius:3px; background:linear-gradient(90deg, rgb(34,197,94), rgb(234,179,8), rgb(239,68,68)); }
.route-legend em{ font-style:normal; margin-left:6px; }
/* ---------- Race countdown (Home) ---------- */
.cd-card{ display:block; text-decoration:none; color:inherit; }
.cd-name{ font-size:20px; font-weight:800; letter-spacing:-.01em; margin:6px 0 4px; }
.cd-clock{ display:grid; grid-template-columns:repeat(4, minmax(0,1fr)); gap:8px; margin:16px 0 14px; }
.cd-unit{ display:flex; flex-direction:column; align-items:center; padding:12px 4px 10px; border-radius:14px; background:var(--surface-2); }
.cd-unit b{ font-size:clamp(26px, 8vw, 34px); font-weight:800; letter-spacing:-.02em; font-variant-numeric:tabular-nums; line-height:1; }
.cd-unit small{ margin-top:6px; font-size:10.5px; font-weight:600; letter-spacing:.1em; text-transform:uppercase; color:var(--text-3); }
.cd-unit:first-child b{ color:var(--accent); text-shadow:0 0 18px color-mix(in srgb, var(--accent) 45%, transparent); }
.cd-go{ grid-column:1 / -1; text-align:center; font-size:22px; font-weight:800; color:var(--accent); padding:14px 0; }
.cd-bar{ height:8px; border-radius:4px; background:var(--surface-2); overflow:hidden; }
.cd-bar i{ display:block; height:100%; border-radius:4px; background:linear-gradient(90deg, color-mix(in srgb, var(--accent) 55%, transparent), var(--accent)); box-shadow:0 0 10px color-mix(in srgb, var(--accent) 50%, transparent); }
.cd-block-lbl{ display:flex; justify-content:space-between; margin-top:8px; font-size:12px; color:var(--text-3); }

/* ---------- Shoe tracker ---------- */
.shoe-grid{ display:grid; grid-template-columns:repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap:10px; }
.shoe-card{ display:block; width:100%; text-align:left; font:inherit; color:var(--text-1); background:var(--surface-2, rgba(255,255,255,.03)); border:0; border-radius:16px; padding:14px 14px 12px; cursor:pointer; box-shadow:0 1px 2px rgba(0,0,0,.18), 0 6px 18px rgba(0,0,0,.14); transition:transform .15s ease; min-width:0; }
.shoe-card:active{ transform:scale(.985); }
.shoe-card.retired{ opacity:.6; }
.shoe-top{ display:flex; align-items:center; justify-content:space-between; gap:8px; min-width:0; }
.shoe-name{ font-weight:700; font-size:15px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; min-width:0; }
.shoe-def{ flex:none; font-size:10.5px; font-weight:700; letter-spacing:.04em; text-transform:uppercase; color:var(--accent); background:color-mix(in srgb, var(--accent) 14%, transparent); padding:3px 8px; border-radius:999px; }
.shoe-km{ margin:8px 0 8px; font-variant-numeric:tabular-nums; }
.shoe-km b{ font-size:26px; font-weight:800; letter-spacing:-.02em; }
.shoe-km small{ font-size:13px; color:var(--text-3); }
.shoe-bar{ height:6px; border-radius:3px; background:color-mix(in srgb, var(--text-1) 10%, transparent); overflow:hidden; }
.shoe-bar i{ display:block; height:100%; border-radius:3px; transition:width .6s ease; }
.shoe-sub{ display:flex; justify-content:space-between; gap:8px; flex-wrap:wrap; margin-top:8px; font-size:12px; color:var(--text-3); font-variant-numeric:tabular-nums; }
.shoe-add{ margin-top:12px; }
.shoe-hint{ margin-top:8px; }
.shoe-retired{ margin-top:12px; }
.shoe-retired summary{ cursor:pointer; font-size:13px; font-weight:600; color:var(--text-2); padding:6px 0 10px; }
.shoe-overlay{ opacity:1; z-index:260; }
.shoe-dialog{ width:100%; max-width:400px; max-height:calc(100vh - 40px); overflow-y:auto; background:var(--surface); border-radius:22px; padding:16px 18px 18px; box-shadow:0 20px 60px rgba(0,0,0,.45); }
.shoe-dlg-head{ display:flex; align-items:center; justify-content:space-between; margin-bottom:10px; }
.shoe-x{ background:none; border:0; color:var(--text-2); font-size:24px; line-height:1; cursor:pointer; padding:2px 6px; }
.shoe-dlg-stats{ display:grid; grid-template-columns:repeat(3, minmax(0,1fr)); gap:8px; margin-bottom:14px; text-align:center; }
.shoe-dlg-stats div{ background:color-mix(in srgb, var(--text-1) 5%, transparent); border-radius:12px; padding:8px 4px; }
.shoe-dlg-stats b{ display:block; font-size:18px; font-variant-numeric:tabular-nums; }
.shoe-dlg-stats small{ font-size:11px; color:var(--text-3); }
.shoe-f{ display:flex; flex-direction:column; gap:5px; margin-bottom:12px; min-width:0; }
.shoe-f span{ font-size:12px; font-weight:600; color:var(--text-2); }
.shoe-f2{ display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.shoe-in{ width:100%; box-sizing:border-box; font:inherit; font-size:16px; color:var(--text-1); background:color-mix(in srgb, var(--text-1) 6%, transparent); border:1px solid transparent; border-radius:10px; padding:10px 12px; }
.shoe-in:focus{ outline:none; border-color:var(--accent); }
.shoe-chk{ display:flex; align-items:center; gap:10px; font-size:14px; color:var(--text-1); margin:2px 0 6px; cursor:pointer; }
.shoe-chk input{ width:18px; height:18px; accent-color:var(--accent); }
.shoe-chk small{ color:var(--text-3); }
.shoe-err{ min-height:16px; margin:0 0 6px; font-size:12px; color:var(--bad); }
.shoe-dlg-actions{ display:flex; justify-content:space-between; margin-top:12px; }
.shoe-link{ background:none; border:0; font:inherit; font-size:13px; font-weight:600; color:var(--text-2); cursor:pointer; padding:6px 2px; }
.shoe-link.danger{ color:var(--bad); }
/* picker in a run's details */
.run-shoes{ margin:0 0 16px; }
.rs-head{ display:flex; align-items:baseline; justify-content:space-between; gap:10px; flex-wrap:wrap; margin-bottom:8px; }
.rs-note{ font-size:12px; color:var(--text-3); font-variant-numeric:tabular-nums; }
.rs-chips{ display:flex; flex-wrap:wrap; gap:8px; }
.rs-chip{ font:inherit; font-size:13px; font-weight:600; color:var(--text-2); background:color-mix(in srgb, var(--text-1) 6%, transparent); border:1px solid transparent; border-radius:999px; padding:7px 13px; cursor:pointer; max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.rs-chip.on{ color:var(--accent); border-color:var(--accent); background:color-mix(in srgb, var(--accent) 12%, transparent); }
.rs-chip.none.on{ color:var(--text-1); border-color:var(--text-3); background:color-mix(in srgb, var(--text-1) 8%, transparent); }
.act-shoe{ color:var(--text-3); }

/* ---------- Pull to refresh ---------- */
@media (hover:none) and (pointer:coarse){ html, body{ overscroll-behavior-y:none; } }   /* phones only: mice and trackpads scroll normally */
.ptr{ position:fixed; left:50%; top:calc(env(safe-area-inset-top, 0px) + 58px); z-index:65; transform:translate(-50%, -56px); opacity:0; pointer-events:none; will-change:transform; }
.ptr.back{ transition:transform .25s ease, opacity .25s ease; }
.ptr-dot{ width:40px; height:40px; border-radius:50%; display:flex; align-items:center; justify-content:center; background:var(--surface); color:var(--text-3); box-shadow:0 4px 16px rgba(0,0,0,.35), 0 0 0 1px color-mix(in srgb, var(--text-1) 8%, transparent); transition:color .15s ease, box-shadow .15s ease; }
.ptr-dot svg{ transition:transform .05s linear; }
.ptr.ready .ptr-dot, .ptr.spin .ptr-dot{ color:var(--accent); box-shadow:0 4px 16px rgba(0,0,0,.35), 0 0 14px color-mix(in srgb, var(--accent) 45%, transparent); }
.ptr.spin{ transition:transform .2s ease; }
.ptr.spin svg{ animation:ptrSpin .8s linear infinite; }
@keyframes ptrSpin{ from{ transform:rotate(0deg); } to{ transform:rotate(360deg); } }
@media (prefers-reduced-motion: reduce){ .ptr.spin svg{ animation-duration:2.4s; } }

/* ---------- Loading screen (Home, first open of the app): the logo fills with colour ---------- */
@font-face{ font-family:'JR Word'; src:url(data:font/woff2;base64,d09GMgABAAAAAAO0AA4AAAAAB4AAAANgAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGhYbgTYcMAZgAFwRCAqDVIJnATYCJAMoCxYABCAFhCAHIBsIBgCeBTkZNY/FFp48+T1Tl4tajVIXD9Ve93bvUqr6OhPlq43xlK5B4xQ4lIslwjKehf93G3/u5QEYijOaHcEZihsaDNmULPH/H97TXsG0I3MTWSMdlIw+CF8AkP/zABPX5P+2sudvscfXN4x1WtFsN/qgBTbIwCc2TW+MPA8bjmw217ycVa/QA0XmshMKWAIksYkI5jZxKPucIh7Y3KqJOrB5xdQmsEEFfw73jb6pDpjwMoLl0th4E84UaDLB1hu/09bdjlCPQs1JsqSomokUQSwJklQBsHgi13YhkBvm5hez6JlE3gMZ+UkW/b/CbNshJRQQEQEAYkodHn63L0RhGazE7cH/GfTfjAEQIP68B7BFgYQGAwrBgOoB1horVgVKVOITF2ArX7EK3TfqaqfttthsQ4LDBxXmwBwYgBk8Ad8A6ABEoU0zdY4Fh0t34bCViIwtECK8dKSUJnicXBQjRn1NyhaxJbVxAFKDN+I8Po8tzLDUc/kqJFUYoqkIETSYJTiCEuR2CXjqi0m84OzmcYRKRJaOVLpOSyW+Arq7NGv32M5qfcCHbfuQWeX04R6Fw1isrKuKBb/dLX2HyW6HRzp2DxasJN888fS5ZBIcNFo6ntxyxa3BTtzEo5uuvDkI30thWkyB3/Oxnuf23AtBxnbsXqfA95z+MGA/eugDOL1YSEdWLT3XaIMvJSlx9x3N2kQVbi4bWbD0mMrSoJ/qeYzQZkPguy5xrNxm+uFNjScdayzuqy2E/67rF03C3cg3N4vSF4W7jgUgIPB2fzFNaZ70tTEoL+DSo7oKuOyIYP39/z0VB/sDTWUg8JEErj3wf7g+cuQLxKzzLAZJWADEAE6Z9V8bA3a58wFW/Ho3OOce6NkBZUgwd2M4N9RqjWHiRaHOAvwAnJfFDt5mF/hkeMaHPfz4bIToHooe8+FSr0G7JiZGGAIqQphwcVA8GD1UJoxatSZqqDJ6BC0suZvUq6KnHf8f0zUjYOo1waH8YAiEBrgEoUIZmRAwzTRCaNWrFapWlCZa4fRC51QGR0M8dOUflUuGejV0G65IUPOwyXMlRBj5aqJMWQqhEv34z5xgNKHTVWg/a5WAHpNN6tVBo3CjCAQD9XoF6y/WpA4Rbuk9vhj+EX6MgvoW1NYOAgAA) format('woff2'); font-weight:700; font-style:italic; font-display:block; }
.jr-loader{ position:fixed; inset:0; z-index:1000; display:flex; align-items:center; justify-content:center; background:var(--bg, #0b0d11); transition:opacity .45s ease, visibility .45s; }
.jr-loader.out{ opacity:0; visibility:hidden; pointer-events:none; }
.jr-loader.gone{ display:none; }
.jrl-box{ display:flex; flex-direction:column; align-items:center; gap:18px; transform:translateY(-4vh); transition:transform .45s ease; }
.jr-loader.out .jrl-box{ transform:translateY(-4vh) scale(1.08); }
.jrl-logo{ overflow:visible; transition:filter .4s ease; }
.jrl-ghost{ fill:var(--text-1, #fff); opacity:.07; }
.jrl-edge{ fill:none; stroke:var(--text-1, #fff); stroke-opacity:.16; stroke-width:.35; stroke-linejoin:round; }
.jrl-level{ transform:translateY(36px); }
.jrl-wave{ animation:jrlWave 1.1s linear infinite; }
@keyframes jrlWave{ from{ transform:translateX(0); } to{ transform:translateX(11px); } }
.jr-loader.full .jrl-logo{ filter:drop-shadow(0 0 14px color-mix(in srgb, var(--accent, #00d4ff) 60%, transparent)); }
.jrl-word{ font:italic 700 17px/1 'JR Word', 'Space Grotesk', system-ui, sans-serif; letter-spacing:.2em; padding-left:.2em; color:var(--text-3, #7a7f8a); opacity:0; animation:jrlWord .6s ease .25s forwards; }
@keyframes jrlWord{ to{ opacity:.9; } }
@media (prefers-reduced-motion: reduce){ .jrl-wave{ animation:none; } }

/* ---------- Page transitions ---------- */
@view-transition{ navigation:auto; }
html.jr-authed #app{ display:block; }
html.jr-authed #gate{ display:none; }
.nav-sticky{ view-transition-name:jr-top; }
.bottom-nav{ view-transition-name:jr-bnav; }
.app-sidebar{ view-transition-name:jr-side; }
::view-transition-group(root){ animation-duration:.34s; }
::view-transition-old(root){ animation:jrVtOutF .26s cubic-bezier(.4,0,1,1) both; }
::view-transition-new(root){ animation:jrVtInF .34s cubic-bezier(.2,.8,.2,1) both; }
html[data-vt="back"]::view-transition-old(root){ animation-name:jrVtOutB; }
html[data-vt="back"]::view-transition-new(root){ animation-name:jrVtInB; }
@keyframes jrVtOutF{ to{ opacity:0; transform:translateX(-28px); } }
@keyframes jrVtInF{ from{ opacity:0; transform:translateX(36px); } }
@keyframes jrVtOutB{ to{ opacity:0; transform:translateX(28px); } }
@keyframes jrVtInB{ from{ opacity:0; transform:translateX(-36px); } }
::view-transition-old(jr-top), ::view-transition-new(jr-top), ::view-transition-old(jr-bnav), ::view-transition-new(jr-bnav), ::view-transition-old(jr-side), ::view-transition-new(jr-side){ animation-duration:.2s; }
@media (prefers-reduced-motion: reduce){ ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*){ animation:none !important; } }

/* ---------- Elevation silhouettes on run rows ---------- */
.act-row{ position:relative; overflow:hidden; }
.act-row > *:not(.elev-sil){ position:relative; z-index:1; }
.elev-sil{ position:absolute; left:0; right:0; bottom:0; width:100%; height:22px; pointer-events:none; z-index:0; opacity:0; transform:translateY(6px); transition:opacity .6s ease, transform .6s ease; }
.elev-sil.in{ opacity:1; transform:none; }
.elev-fill{ fill:color-mix(in srgb, var(--accent) 9%, transparent); }
.elev-line{ fill:none; stroke:color-mix(in srgb, var(--accent) 38%, transparent); stroke-width:1.2; vector-effect:non-scaling-stroke; }

/* ---------- Year clock ---------- */
.yc-years{ margin-bottom:6px; }
.yc-wrap{ max-width:420px; margin:0 auto; touch-action:pan-y; }
.yc-svg{ display:block; width:100%; height:auto; overflow:visible; cursor:crosshair; -webkit-user-select:none; user-select:none; }
.yc-spike{ transform-origin:180px 180px; animation:ycGrow .7s cubic-bezier(.2,.9,.25,1.15) both; transition:opacity .15s ease; }
@keyframes ycGrow{ from{ transform:scale(.62); opacity:0; } }
.yc-svg.picking .yc-spike{ opacity:.35; }
.yc-svg.picking .yc-spike.hl{ opacity:1; stroke-width:3.2; }
.yc-legend{ display:flex; flex-wrap:wrap; justify-content:center; gap:6px 14px; margin-top:4px; font-size:11.5px; color:var(--text-2); }
.yc-legend span{ display:inline-flex; align-items:center; gap:6px; }
.yc-legend i{ width:10px; height:3px; border-radius:2px; display:inline-block; }
.yc-foot{ display:flex; justify-content:space-between; align-items:center; gap:10px; flex-wrap:wrap; margin-top:12px; font-size:12px; color:var(--text-3); font-variant-numeric:tabular-nums; }
@media (prefers-reduced-motion: reduce){ .yc-spike{ animation:none; } }
