/* ───────────────────────── Tokens ───────────────────────── */
:root {
  color-scheme: dark;
  --bg: #09090a;
  --surface: #121214;
  --surface-2: #18181b;
  --surface-3: #1f1f23;
  --line: rgba(212, 175, 55, 0.14);
  --line-soft: rgba(255, 255, 255, 0.06);
  --ink: #f3eee4;
  --ink-2: #c9c2b4;
  --muted: #8f897d;
  --gold: #d4af37;
  --gold-soft: #e6c873;
  --gold-deep: #9c7a22;
  --gold-grad: linear-gradient(135deg, #f6e3a1 0%, #d9b54a 42%, #a8831f 100%);
  --gold-tint: rgba(212, 175, 55, 0.1);
  --good: #6fbf73;
  --danger: #e5675f;

  /* Phase accents (validated for CVD on dark surface, timeline order) */
  --ph-volume: #c98500;
  --ph-deload: #3987e5;
  --ph-strength: #d95926;
  --ph-peak: #d55181;
  --ph-taper: #9085e9;

  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 20px 50px -24px rgba(0, 0, 0, 0.8);
  --font-display: "Cormorant Garamond", "Times New Roman", serif;
  --font-ui: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --nav-h: 68px;
}

/* ───────────────────────── Base ───────────────────────── */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1200px 520px at 50% -180px, rgba(212, 175, 55, 0.13), transparent 70%),
    radial-gradient(800px 400px at 100% 0, rgba(212, 175, 55, 0.04), transparent 70%),
    var(--bg);
  background-attachment: fixed;
  color: var(--ink);
  font: 15px/1.55 var(--font-ui);
  font-feature-settings: "tnum" 1;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: var(--gold-soft); text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 8px; }
h1, h2, h3 { margin: 0; font-weight: 600; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg.i { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ───────────────────────── Layout ───────────────────────── */
.wrap { width: 100%; max-width: 780px; margin: 0 auto; padding: 0 16px; }
main.wrap { padding-bottom: calc(var(--nav-h) + var(--safe-b) + 40px); }

.topbar {
  position: sticky; top: 0; z-index: 30;
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  background: rgba(9, 9, 10, 0.72);
  border-bottom: 1px solid var(--line-soft);
}
.topbar .wrap { display: flex; align-items: center; gap: 12px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); margin-right: auto; }
.brand-mark { width: 30px; height: 30px; }
.brand-name { font: 700 13px/1 var(--font-ui); letter-spacing: 0.32em; }
.brand-name b { background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand-sub { display: block; font-size: 10px; letter-spacing: 0.2em; color: var(--muted); margin-top: 4px; text-transform: uppercase; }
.icon-btn {
  width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px;
  color: var(--ink-2); border: 1px solid var(--line-soft); background: var(--surface);
  transition: border-color .2s, color .2s;
}
.icon-btn:hover { color: var(--gold-soft); border-color: var(--line); }

.topnav { display: none; gap: 4px; }
.topnav a { padding: 8px 14px; border-radius: 10px; color: var(--muted); font-weight: 600; font-size: 14px; }
.topnav a:hover { color: var(--ink); }
.topnav a.on { color: var(--gold-soft); background: var(--gold-tint); }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  padding-bottom: var(--safe-b);
  background: rgba(12, 12, 13, 0.9);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid var(--line);
}
.tabbar .wrap { display: grid; grid-template-columns: repeat(5, 1fr); height: var(--nav-h); padding: 0 6px; }
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .02em; }
.tabbar a.on { color: var(--gold-soft); }
.tabbar a.on svg.i { filter: drop-shadow(0 0 8px rgba(212, 175, 55, .45)); }

@media (min-width: 860px) {
  .topnav { display: flex; }
  .tabbar { display: none; }
  main.wrap { padding-bottom: 64px; }
  .wrap { max-width: 860px; }
}

/* ───────────────────────── Type helpers ───────────────────────── */
.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold); }
.display { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.01em; line-height: 1.02; }
.gold-text { background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; }

.section { margin-top: 28px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 2px 12px; }
.section-head h2 { font: 600 26px/1.1 var(--font-display); }
.section-head .muted { font-size: 13px; }

.rule { height: 1px; border: 0; margin: 18px 0; background: linear-gradient(90deg, transparent, var(--line), transparent); }

/* ───────────────────────── Cards ───────────────────────── */
.card {
  background: linear-gradient(180deg, rgba(255,255,255,0.018), transparent 40%), var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,0.03);
}
.card + .card { margin-top: 12px; }
.card.gold { border-color: var(--line); }

/* Greeting */
.greet { padding: 26px 2px 16px; }
.greet .eyebrow { color: var(--muted); }
.greet h1 { font: 600 40px/1.05 var(--font-display); margin-top: 6px; }

/* ───────────────────────── Hero ───────────────────────── */
.hero {
  position: relative; overflow: hidden;
  border-radius: 24px; padding: 22px;
  border: 1px solid rgba(212,175,55,.28);
  background:
    radial-gradient(500px 220px at 100% 0%, rgba(212,175,55,.16), transparent 70%),
    linear-gradient(160deg, #17150f 0%, #111113 55%, #0d0d0e 100%);
  box-shadow: 0 30px 80px -40px rgba(212,175,55,.35), var(--shadow);
}
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background: linear-gradient(115deg, transparent 30%, rgba(246,227,161,.06) 45%, transparent 60%);
}
.hero-top { display: flex; gap: 18px; align-items: flex-start; justify-content: space-between; }
.hero h2 { font: 600 44px/1 var(--font-display); margin: 10px 0 6px; }
.hero .sub { color: var(--ink-2); font-size: 15px; }
.hero .lift-line { margin-top: 16px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; }
.hero .lift-line .big { font: 700 30px/1 var(--font-ui); letter-spacing: -0.02em; }
.hero .meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; position: relative; z-index: 1; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; color: var(--ink-2);
  background: var(--surface-3); border: 1px solid var(--line-soft);
  white-space: nowrap;
}
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--c, var(--gold)); }
.chip.gold { color: var(--gold-soft); background: var(--gold-tint); border-color: var(--line); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 18px; border-radius: 12px;
  font-weight: 700; font-size: 14px; letter-spacing: .02em;
  border: 1px solid var(--line); color: var(--ink); background: var(--surface-2);
  transition: transform .15s, border-color .2s, background .2s;
}
.btn:hover { border-color: rgba(212,175,55,.4); }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--gold-grad); color: #1a1406; border: 0; box-shadow: 0 10px 30px -12px rgba(212,175,55,.6); }
.btn.ghost { background: transparent; }
.btn.sm { height: 36px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn.block { width: 100%; }

/* Progress ring */
.ring { position: relative; width: 92px; height: 92px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .track { stroke: rgba(255,255,255,.07); }
.ring .bar { stroke: url(#goldGrad); stroke-linecap: round; transition: stroke-dashoffset .6s cubic-bezier(.2,.8,.2,1); }
.ring .lbl { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring .lbl b { font-size: 22px; line-height: 1; }
.ring .lbl span { font-size: 10px; color: var(--muted); letter-spacing: .14em; text-transform: uppercase; margin-top: 4px; }

/* Countdown */
.countdown { display: flex; align-items: baseline; gap: 10px; margin-top: 8px; }
.countdown .n { font: 600 92px/0.9 var(--font-display); }
.countdown .u { font-size: 18px; color: var(--ink-2); }

/* ───────────────────────── Stat tiles ───────────────────────── */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; }
.stat { padding: 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line-soft); min-width: 0; }
.stat .k { font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.stat .v { font-size: 26px; font-weight: 700; margin-top: 6px; letter-spacing: -0.02em; line-height: 1; }
.stat .v small { font-size: 13px; color: var(--muted); font-weight: 600; letter-spacing: 0; }
.stat .s { font-size: 12px; color: var(--muted); margin-top: 6px; }

/* ───────────────────────── Phase timeline ───────────────────────── */
.timeline { margin-top: 12px; }
.tl-bar { display: grid; grid-template-columns: repeat(11, 1fr); gap: 3px; margin-top: 12px; }
.tl-seg { position: relative; height: 10px; border-radius: 4px; background: var(--c); opacity: .35; }
.tl-seg.past { opacity: .85; }
.tl-seg.now { opacity: 1; box-shadow: 0 0 0 2px var(--bg), 0 0 0 3px var(--gold-soft); }
.tl-seg .fill { position: absolute; inset: 0; border-radius: inherit; background: var(--c); }
.tl-labels { display: grid; grid-template-columns: repeat(11, 1fr); gap: 3px; margin-top: 8px; font-size: 10.5px; color: var(--muted); text-align: center; }
.tl-labels .on { color: var(--gold-soft); font-weight: 700; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 12px; font-size: 12px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; background: var(--c); }

/* ───────────────────────── Week strip ───────────────────────── */
.weekstrip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.wday {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 10px 2px; border-radius: 14px; color: var(--ink-2);
  background: var(--surface); border: 1px solid var(--line-soft);
  transition: border-color .2s, background .2s; min-width: 0;
}
.wday:hover { border-color: var(--line); }
.wday .dn { font-size: 10.5px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); font-weight: 700; }
.wday .dd { font-size: 18px; font-weight: 700; color: var(--ink); }
.wday .tag { font-size: 10px; font-weight: 700; letter-spacing: .06em; color: var(--muted); }
.wday .st { width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--muted); }
.wday.rest .st { border: 0; width: 10px; height: 2px; border-radius: 2px; background: var(--muted); opacity: .6; margin: 3px 0; }
.wday.done .st { background: var(--gold); border-color: var(--gold); box-shadow: 0 0 10px rgba(212,175,55,.6); }
.wday.partial .st { border-color: var(--gold); background: linear-gradient(90deg, var(--gold) 50%, transparent 50%); }
.wday.missed .st { border-color: var(--danger); opacity: .7; }
.wday.today { border-color: rgba(212,175,55,.55); background: linear-gradient(180deg, rgba(212,175,55,.14), rgba(212,175,55,.02)); }
.wday.today .dd { color: var(--gold-soft); }
.wday.sel { outline: 1px solid var(--gold-soft); }
.wday.test .tag { color: var(--gold-soft); }

/* Coach note */
.note { display: flex; gap: 12px; padding: 14px 16px; border-radius: 14px; background: var(--gold-tint); border: 1px solid var(--line); color: var(--ink-2); font-size: 14px; }
.note svg.i { color: var(--gold); margin-top: 2px; }
.note b { color: var(--ink); }

/* ───────────────────────── Session ───────────────────────── */
.group-label { display: flex; align-items: center; gap: 10px; margin: 22px 2px 10px; font-size: 11px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.group-label::after { content: ""; flex: 1; height: 1px; background: var(--line-soft); }

.ex {
  position: relative; border-radius: 16px; padding: 16px;
  background: var(--surface); border: 1px solid var(--line-soft);
  transition: border-color .25s, opacity .25s;
}
.ex + .ex { margin-top: 10px; }
.ex.main {
  border-color: rgba(212,175,55,.32);
  background: radial-gradient(400px 140px at 0 0, rgba(212,175,55,.09), transparent 70%), var(--surface);
}
.ex.complete { border-color: rgba(212,175,55,.45); }
.ex.complete .ex-name::after { content: " ✓"; color: var(--gold); }
.ex.off { opacity: .5; }
.ex.off .presc { text-decoration: line-through; text-decoration-color: var(--muted); }
.ex-head { display: flex; align-items: flex-start; gap: 12px; }
.ex-n { width: 28px; height: 28px; flex: none; display: grid; place-items: center; border-radius: 9px; font-size: 12px; font-weight: 800; color: var(--muted); background: var(--surface-3); }
.ex.main .ex-n { color: #1a1406; background: var(--gold-grad); }
.ex-title { flex: 1; min-width: 0; }
.ex-name { font-weight: 700; font-size: 16px; line-height: 1.3; }
.ex-detail { font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.presc { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-top: 10px; }
.presc .sets { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.presc .pct { color: var(--ink-2); font-weight: 600; }
.kg {
  display: inline-flex; align-items: baseline; gap: 3px; padding: 3px 10px; border-radius: 9px;
  font-weight: 800; color: var(--gold-soft); background: var(--gold-tint); border: 1px solid var(--line);
}
button.kg:hover { border-color: rgba(212,175,55,.5); }
.kg small { font-size: 11px; font-weight: 700; color: var(--gold); }
.kg.need { color: var(--muted); background: transparent; border-style: dashed; font-weight: 600; font-size: 12px; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 8px; font-size: 12px; font-weight: 600; color: var(--ink-2); background: var(--surface-3); }
.pill em { font-style: normal; color: var(--muted); font-weight: 700; font-size: 10.5px; letter-spacing: .08em; }
button.pill:hover { color: var(--gold-soft); }
button.pill svg.i { width: 14px; height: 14px; }

.sets-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.setb {
  min-width: 44px; height: 44px; padding: 0 10px; border-radius: 12px;
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  font-weight: 800; font-size: 14px; line-height: 1; color: var(--ink-2);
  border: 1.5px solid rgba(255,255,255,.12); background: var(--surface-2);
  transition: all .18s cubic-bezier(.2,.8,.2,1);
}
.setb small { font-size: 9px; font-weight: 700; letter-spacing: .08em; color: var(--muted); margin-top: 3px; text-transform: uppercase; }
.setb:hover { border-color: rgba(212,175,55,.5); }
.setb.on { color: #1a1406; background: var(--gold-grad); border-color: transparent; box-shadow: 0 6px 18px -8px rgba(212,175,55,.8); }
.setb.on small { color: #3b2e0a; }
.setb.top { border-style: dashed; border-color: rgba(212,175,55,.5); }
.setb.top.on { border-style: solid; }

.ex-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line-soft); }
.field { display: inline-flex; align-items: center; gap: 0; height: 38px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line-soft); overflow: hidden; }
.field:focus-within { border-color: rgba(212,175,55,.5); }
.field label { padding: 0 10px; font-size: 11px; font-weight: 700; letter-spacing: .08em; color: var(--muted); text-transform: uppercase; white-space: nowrap; }
.field input { width: 76px; height: 100%; border: 0; background: transparent; padding: 0 10px 0 0; outline: none; font-weight: 700; }
.field .u { padding-right: 10px; font-size: 12px; color: var(--muted); }
.last { font-size: 12.5px; color: var(--muted); }
.last b { color: var(--ink-2); }
.hint { font-size: 12.5px; color: var(--ink-2); }
.hint b { color: var(--gold-soft); }

.plates { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-top: 10px; font-size: 11.5px; color: var(--muted); }
.plate { padding: 2px 7px; border-radius: 6px; font-weight: 800; font-size: 11px; color: #1a1406; background: var(--gold-soft); }
.plate.p25, .plate.p45 { background: #e9cf7e; }
.plate.p20, .plate.p35 { background: #d4af37; }
.plate.p15, .plate.p25lb { background: #b8932c; color: #120e04; }
.plate.small { background: #8f7a45; color: #120e04; }

.why { margin-top: 18px; }

.session-foot { display: flex; gap: 10px; margin-top: 18px; }

/* Rest day */
.checklist { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; }
.checklist li { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: rgba(255,255,255,.025); border: 1px solid var(--line-soft); font-size: 14px; color: var(--ink-2); }
.checklist li svg.i { color: var(--gold); margin-top: 1px; }
.checklist li b { color: var(--ink); }

/* Up next */
.next { display: flex; align-items: center; gap: 14px; }
.next .when { text-align: center; padding: 8px 12px; border-radius: 12px; background: var(--surface-3); flex: none; }
.next .when b { display: block; font-size: 20px; line-height: 1; }
.next .when span { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.next .what { flex: 1; min-width: 0; }
.next .what b { font-size: 16px; }

/* ───────────────────────── Day view header ───────────────────────── */
.dayhead { display: flex; align-items: center; gap: 10px; padding: 22px 0 12px; }
.dayhead .t { flex: 1; text-align: center; min-width: 0; }
.dayhead h1 { font: 600 32px/1.1 var(--font-display); }

/* ───────────────────────── Week view ───────────────────────── */
.weekpick { display: flex; gap: 6px; overflow-x: auto; padding: 4px 2px 10px; scrollbar-width: none; }
.weekpick::-webkit-scrollbar { display: none; }
.weekpick a { flex: none; width: 46px; height: 52px; border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--ink-2); font-weight: 800; background: var(--surface); border: 1px solid var(--line-soft); }
.weekpick a i { width: 16px; height: 3px; border-radius: 2px; background: var(--c); }
.weekpick a.on { border-color: var(--gold-soft); color: var(--gold-soft); background: var(--gold-tint); }
.weekpick a.cur { box-shadow: inset 0 -2px 0 var(--gold); }
.dayrow { display: flex; align-items: center; gap: 14px; padding: 14px 16px; color: var(--ink); }
.dayrow + .dayrow { border-top: 1px solid var(--line-soft); }
.dayrow:hover { background: rgba(255,255,255,.02); }
.dayrow .dt { width: 48px; text-align: center; flex: none; }
.dayrow .dt b { display: block; font-size: 20px; line-height: 1.1; }
.dayrow .dt span { font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.dayrow .bd { flex: 1; min-width: 0; }
.dayrow .bd .tt { font-weight: 700; }
.dayrow .bd .ss { font-size: 13px; color: var(--muted); margin-top: 2px; }
.dayrow.rest .tt { color: var(--muted); font-weight: 600; }
.dayrow.today { background: linear-gradient(90deg, rgba(212,175,55,.1), transparent); }
.dayrow .stt { font-size: 12px; font-weight: 700; color: var(--muted); }
.dayrow .stt.done { color: var(--gold-soft); }
.list-card { padding: 0; overflow: hidden; }

/* ───────────────────────── Plan view ───────────────────────── */
.cal { display: grid; grid-template-columns: 34px repeat(7, 1fr); gap: 4px; font-size: 11px; }
.cal .h { text-align: center; color: var(--muted); font-weight: 700; letter-spacing: .1em; text-transform: uppercase; font-size: 10px; padding-bottom: 4px; }
.cal .wk { display: grid; place-items: center; color: var(--muted); font-weight: 800; border-left: 3px solid var(--c); border-radius: 4px; font-size: 12px; }
.cal a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 46px; border-radius: 9px; background: var(--surface); border: 1px solid var(--line-soft); color: var(--ink-2); padding: 3px 0; }
.cal a .c1 { font-weight: 800; font-size: 11.5px; letter-spacing: .02em; color: var(--ink); }
.cal a .c2 { font-size: 10px; color: var(--muted); }
.cal a.rest { background: transparent; }
.cal a.rest .c1 { color: var(--muted); font-weight: 600; }
.cal a.done { border-color: rgba(212,175,55,.45); }
.cal a.done .c2 { color: var(--gold-soft); }
.cal a.today { box-shadow: 0 0 0 2px var(--gold-soft); }
.cal a.test { background: var(--gold-grad); border: 0; }
.cal a.test .c1, .cal a.test .c2 { color: #1a1406; }

.phase-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.phase-card { border-left: 3px solid var(--c); }
.phase-card h3 { font: 600 22px/1.1 var(--font-display); }
.phase-card .wk { font-size: 12px; color: var(--muted); font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.phase-card p { margin: 8px 0 0; font-size: 13.5px; color: var(--ink-2); }
.phase-card dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; margin: 10px 0 0; font-size: 12.5px; }
.phase-card dt { color: var(--muted); }
.phase-card dd { margin: 0; color: var(--ink); }

/* Chart */
.chart { position: relative; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid { stroke: rgba(255,255,255,.06); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 11px; font-family: var(--font-ui); }
.chart .val { fill: var(--ink-2); font-size: 11px; font-weight: 700; font-family: var(--font-ui); }
.chart .hit { fill: transparent; cursor: pointer; }
.chart .bar { transition: opacity .2s; }
.chart.hovering .bar { opacity: .4; }
.chart.hovering .bar.hl { opacity: 1; }
.tip {
  position: absolute; pointer-events: none; z-index: 5; min-width: 150px;
  padding: 10px 12px; border-radius: 10px; font-size: 12.5px;
  background: #1c1b18; border: 1px solid var(--line); box-shadow: var(--shadow);
  transform: translate(-50%, calc(-100% - 10px)); opacity: 0; transition: opacity .12s;
}
.tip.show { opacity: 1; }
.tip b { color: var(--ink); }
.tip div { color: var(--ink-2); }

/* Tables */
.table-wrap { overflow-x: auto; border-radius: 14px; border: 1px solid var(--line-soft); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); font-weight: 700; padding: 11px 12px; background: rgba(212,175,55,.06); border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 11px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: top; color: var(--ink-2); }
tr:last-child td { border-bottom: 0; }
td:first-child { color: var(--ink); font-weight: 700; }
tr.cur td { background: rgba(212,175,55,.07); }
td .kgs { display: block; color: var(--gold-soft); font-weight: 700; margin-top: 3px; font-size: 12px; }

.seg { display: inline-flex; padding: 3px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line-soft); gap: 2px; }
.seg button { padding: 7px 14px; border-radius: 9px; font-size: 13px; font-weight: 700; color: var(--muted); }
.seg button.on { color: #1a1406; background: var(--gold-grad); }

/* ───────────────────────── Guide ───────────────────────── */
details.gsec { border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line-soft); }
details.gsec + details.gsec { margin-top: 10px; }
details.gsec > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px; padding: 16px 18px; }
details.gsec > summary::-webkit-details-marker { display: none; }
details.gsec > summary h3 { flex: 1; font: 600 22px/1.15 var(--font-display); }
details.gsec > summary .chev { transition: transform .2s; color: var(--gold); }
details.gsec[open] > summary .chev { transform: rotate(180deg); }
.gbody { padding: 0 18px 18px; color: var(--ink-2); font-size: 14.5px; }
.gbody p { margin: 0 0 12px; }
.gbody h4 { margin: 18px 0 10px; font: 600 19px var(--font-display); color: var(--ink); }
.gbody ul, .gbody ol { margin: 0 0 12px; padding-left: 20px; }
.gbody li { margin: 6px 0; }
.gbody li::marker { color: var(--gold); }
.gbody .table-wrap { margin: 8px 0 14px; }

/* ───────────────────────── Settings ───────────────────────── */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.fld { display: flex; flex-direction: column; gap: 6px; }
.fld > span { font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.fld input, .fld select {
  height: 48px; border-radius: 12px; padding: 0 14px; font-size: 16px; font-weight: 700;
  background: var(--surface-2); border: 1px solid var(--line-soft); outline: none; width: 100%;
}
.fld input:focus, .fld select:focus { border-color: rgba(212,175,55,.6); }
.fld small { color: var(--muted); font-size: 12px; }
.toggle-row { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-top: 1px solid var(--line-soft); }
.toggle-row:first-child { border-top: 0; padding-top: 0; }
.toggle-row .tx { flex: 1; }
.toggle-row .tx b { display: block; }
.toggle-row .tx span { font-size: 13px; color: var(--muted); }
.switch { position: relative; width: 50px; height: 30px; flex: none; }
.switch input { opacity: 0; width: 100%; height: 100%; margin: 0; position: absolute; cursor: pointer; z-index: 1; }
.switch i { position: absolute; inset: 0; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--line-soft); transition: background .2s; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--ink-2); transition: transform .2s, background .2s; }
.switch input:checked + i { background: var(--gold-deep); }
.switch input:checked + i::after { transform: translateX(20px); background: #fff7df; }
.switch input:focus-visible + i { outline: 2px solid var(--gold); outline-offset: 2px; }
.est-out { margin-top: 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.row-btns { display: flex; flex-wrap: wrap; gap: 10px; }

/* ───────────────────────── Test day ───────────────────────── */
.lift-tabs { margin-bottom: 14px; }
.ladder { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.rung { padding: 10px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line-soft); text-align: center; }
.rung b { display: block; font-size: 17px; }
.rung span { font-size: 11.5px; color: var(--muted); }
.attempt { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line-soft); }
.attempt + .attempt { margin-top: 8px; }
.attempt .at { font-weight: 800; }
.attempt .ar { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.attempt .ctrl { display: flex; gap: 6px; align-items: center; }
@media (max-width: 560px) { .attempt { grid-template-columns: 1fr; } }
.res { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; border: 1px solid var(--line-soft); background: var(--surface-3); font-weight: 800; color: var(--muted); }
.res.good.on { background: var(--good); color: #0b1a0c; border-color: transparent; }
.res.miss.on { background: var(--danger); color: #1f0806; border-color: transparent; }
.total { display: flex; align-items: baseline; gap: 10px; }
.total .n { font: 600 56px/1 var(--font-display); }

/* ───────────────────────── Rest timer ───────────────────────── */
.timer {
  position: fixed; left: 50%; z-index: 40; width: min(440px, calc(100% - 24px));
  bottom: calc(var(--nav-h) + var(--safe-b) + 12px);
  transform: translate(-50%, calc(100% + var(--nav-h) + 60px)); visibility: hidden;
  transition: transform .35s cubic-bezier(.2,.8,.2,1), visibility 0s .35s;
  display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 20px;
  background: rgba(22, 21, 18, 0.96); border: 1px solid rgba(212,175,55,.4);
  box-shadow: 0 24px 60px -20px rgba(0,0,0,.9), 0 0 40px -20px rgba(212,175,55,.5);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.timer.show { transform: translate(-50%, 0); visibility: visible; transition: transform .35s cubic-bezier(.2,.8,.2,1); }
.timer.done { border-color: var(--gold-soft); animation: pulse 1s ease-in-out 3; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(212,175,55,.25), 0 24px 60px -20px rgba(0,0,0,.9); } }
.timer .tr { width: 54px; height: 54px; flex: none; position: relative; }
.timer .tr svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.timer .tr .track { stroke: rgba(255,255,255,.08); }
.timer .tr .bar { stroke: var(--gold); stroke-linecap: round; }
.timer .tt { flex: 1; min-width: 0; }
.timer .tt .lab { font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.timer .tt .clock { font-size: 30px; font-weight: 800; line-height: 1.05; letter-spacing: -0.02em; }
.timer .tc { display: flex; gap: 6px; }
.timer .tc button { width: 40px; height: 40px; border-radius: 11px; background: var(--surface-3); border: 1px solid var(--line-soft); font-size: 12px; font-weight: 800; color: var(--ink-2); display: grid; place-items: center; }
.timer .tc button:hover { color: var(--gold-soft); }
@media (min-width: 860px) { .timer { bottom: 24px; } }

/* ───────────────────────── Modal ───────────────────────── */
.modal { position: fixed; inset: 0; z-index: 50; display: none; align-items: flex-end; justify-content: center; background: rgba(0,0,0,.6); backdrop-filter: blur(4px); }
.modal.show { display: flex; }
.sheet { width: min(520px, 100%); max-height: 88vh; overflow: auto; border-radius: 24px 24px 0 0; padding: 20px 18px calc(24px + var(--safe-b)); background: #141413; border: 1px solid var(--line); border-bottom: 0; animation: up .3s cubic-bezier(.2,.8,.2,1); }
@media (min-width: 600px) { .modal { align-items: center; } .sheet { border-radius: 24px; border-bottom: 1px solid var(--line); } }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.sheet-head h3 { font: 600 26px var(--font-display); }
.barviz { display: flex; align-items: center; justify-content: center; height: 120px; margin: 16px 0 10px; }
.barviz .shaft { height: 10px; width: 46px; background: linear-gradient(180deg, #d9d9d9, #8a8a8a); border-radius: 2px; }
.barviz .sleeve { height: 16px; width: 12px; background: linear-gradient(180deg, #e0e0e0, #8a8a8a); border-radius: 2px; }
.barviz .collar { height: 26px; width: 6px; background: #777; border-radius: 2px; }
.barviz .pl { width: 13px; border-radius: 3px; margin: 0 1px; background: var(--gold-grad); box-shadow: inset 0 0 0 1px rgba(0,0,0,.25); }
.plate-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }

/* ───────────────────────── Misc ───────────────────────── */
.empty { text-align: center; padding: 30px 16px; color: var(--muted); }
.toast { position: fixed; left: 50%; top: 74px; z-index: 60; transform: translate(-50%, -20px); opacity: 0; padding: 10px 16px; border-radius: 12px; background: #1d1b16; border: 1px solid var(--line); font-size: 14px; font-weight: 600; transition: all .25s; pointer-events: none; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.fade-in { animation: fade .35s ease both; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } }
.foot { text-align: center; color: var(--muted); font-size: 12px; margin-top: 40px; }
.foot b { letter-spacing: .3em; font-weight: 700; color: var(--ink-2); }

@media (max-width: 420px) {
  .greet h1 { font-size: 34px; }
  .hero h2 { font-size: 38px; }
  .hero .lift-line .big { font-size: 26px; }
  .ring { width: 78px; height: 78px; }
  .countdown .n { font-size: 76px; }
  .stat { padding: 12px 10px; }
  .stat .v { font-size: 22px; }
  .wday { padding: 8px 0; border-radius: 12px; }
  .wday .dd { font-size: 16px; }
  .cal { grid-template-columns: 26px repeat(7, 1fr); gap: 3px; }
  .cal a { min-height: 42px; }
  .cal a .c1 { font-size: 10.5px; }
  .timer .tc button { width: 36px; height: 36px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
.trophy { width: 72px; height: 72px; flex: none; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line); background: var(--gold-tint); color: var(--gold-soft); }
.trophy svg.i { width: 32px; height: 32px; }
.phase-cards .card + .card { margin-top: 0; }
