/* Clubhouse — components (SPEC §7.6). Class names are the contract; markup mirrors the Direction B mock. */

/* ---------- Ring (§7.3) — tile 78, hero 120, mini 28 ---------- */
.ring { position: relative; width: 78px; height: 78px; flex: 0 0 auto; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.ring .track { stroke: var(--track); fill: none; stroke-width: 8.5; }
.ring .fill {
  stroke: var(--volt); fill: none; stroke-width: 8.5; stroke-linecap: round;
  stroke-dasharray: 100 101; stroke-dashoffset: 100; /* 101 gap: no zero-length dash (dot) at the path end when p = 0 */
  transition: stroke-dashoffset 1.1s var(--ease-out);
  filter: drop-shadow(0 0 6px rgba(212, 255, 63, .35));
}
.is-ready .ring .fill { stroke-dashoffset: calc(100 * (1 - var(--p, 0))); }
.ring.live .fill { transition-duration: .7s; }
.ring .fill.zero { stroke-linecap: butt; filter: none; }
.ring.empty .track { stroke-dasharray: 1.1 1.4; stroke: var(--line-strong); } /* = SPEC's 2 4 dotted track, tiled exactly: pathLength 100 → 40 ticks */
.ring .num {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font: 700 30px/1 var(--display); letter-spacing: -0.02em;
}
.ring .num small { font-size: 14px; color: var(--ink-3); margin-left: 1px; font-weight: 600; letter-spacing: 0; }
.ring .over {
  position: absolute; left: -6px; top: -4px; min-width: 26px; height: 20px; padding: 0 6px; border-radius: 999px;
  background: var(--volt-dim); border: 1px solid var(--volt-line); color: var(--volt);
  font: 700 13px/18px var(--display); letter-spacing: .02em; text-align: center;
}
.ring.hero { width: 120px; height: 120px; }
.ring.hero .track, .ring.hero .fill { stroke-width: 7.7; }
.ring.hero .num { font-size: 40px; }
.ring.hero .num small { font-size: 17px; }
.ring.mini { width: 28px; height: 28px; }
.ring.mini .track, .ring.mini .fill { stroke-width: 18; }
.ring.mini .fill { filter: none; }
@media (prefers-reduced-motion: reduce) { .ring .fill { filter: none; } }

/* ---------- Ring tiles (Home hero) ---------- */
.rings { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ring-tile { display: block; padding: 11px 12px 12px; min-width: 0; }
.ring-tile .glyph {
  position: absolute; right: 12px; top: 12px; width: 34px; height: 34px; border-radius: 11px;
  background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; color: var(--ink-2);
}
.ring-tile .glyph svg { width: 18px; height: 18px; }
.ring-tile .pillar { margin-top: 9px; font: 700 17px/1 var(--display); text-transform: uppercase; letter-spacing: .06em; }
.ring-tile .goal { margin-top: 5px; font: 500 12.5px/1.2 var(--body); color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ring-tile .note { margin-top: 6px; font: 600 13px/1.2 var(--body); color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 4px; }
.ring-tile .note svg { width: 11px; height: 11px; flex: 0 0 auto; }
.ring-tile .note span { overflow: hidden; text-overflow: ellipsis; }
.ring-tile .note.up { color: var(--volt); }
.ring-tile .note.warm { color: var(--amber); }
.ring-tile .note.go { color: var(--ink-2); }
.ring-tile .note.go svg { color: var(--ink-3); width: 12px; height: 12px; }

/* ---------- Week strip ---------- */
.week-strip {
  display: flex; justify-content: space-between; align-items: center; padding: 10px 14px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 16px;
}
.week-strip .day { display: flex; flex-direction: column; align-items: center; gap: 6px; font: 600 11px/1 var(--body); color: var(--ink-3); letter-spacing: .04em; }
.week-strip .day .d { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--line-strong); font: 700 13px/1 var(--display); color: var(--ink-2); }
.week-strip .day .d svg { width: 12px; height: 12px; }
.week-strip .day.hit .d { background: var(--volt); border-color: var(--volt); color: var(--on-volt); }
.week-strip .day.today .d { border-color: var(--ink); color: var(--ink); border-style: dashed; }
.week-strip .day.today { color: var(--ink-2); }
.week-strip .day.today.hit .d { border-style: solid; border-color: var(--volt); box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--volt); }
.week-strip .day.future .d { border-style: dotted; opacity: .6; }

/* ---------- Streak pill + icon buttons ---------- */
.streak-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 11px 7px 9px;
  border-radius: var(--r-chip); background: var(--surface-2); border: 1px solid var(--line);
  font: 600 13px/1 var(--body); white-space: nowrap;
}
.streak-pill svg { width: 14px; height: 14px; }
.streak-pill b { font: 700 16px/1 var(--display); color: var(--volt); }
.icon-btn {
  position: relative; width: 36px; height: 36px; border-radius: 50%; flex: 0 0 auto;
  display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2);
}
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn::after { content: ""; position: absolute; inset: -4px; }
.icon-btn:active { transform: scale(.94); }

/* ---------- Coach insights ---------- */
.insight { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; padding: 14px; }
.insight .glyph {
  width: 40px; height: 40px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line);
  display: grid; place-items: center; color: var(--ink);
}
.insight .glyph svg { width: 20px; height: 20px; }
.insight .glyph.warm { background: var(--amber-dim); border-color: var(--amber-line); color: var(--amber); }
.insight .glyph.good { background: var(--volt-dim); border-color: var(--volt-line); color: var(--volt); }
.insight .body { min-width: 0; }
.insight .kicker { font: 600 11px/1 var(--body); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 5px; }
.insight .kicker b { color: var(--ink-2); }
.insight h3 { margin: 0; font: 600 15.5px/1.3 var(--body); letter-spacing: -0.005em; }
.insight h3 strong { color: var(--volt); font-weight: 700; }
.insight h3 .warn { color: var(--amber); font-weight: 700; }
.insight .sub { margin-top: 4px; font: 500 13px/1.3 var(--body); color: var(--ink-3); }
.insight .actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.insight.no-viz { grid-template-columns: 40px 1fr; }
.insight .viz { width: 72px; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.insight .viz .delta { font: 700 20px/1 var(--display); letter-spacing: -0.01em; display: inline-flex; align-items: center; gap: 3px; }
.insight .viz .delta svg { width: 12px; height: 12px; }
.insight .viz .delta.good { color: var(--volt); }
.insight .viz .delta.warm { color: var(--amber); }
.insight .viz .cap { font: 600 10.5px/1 var(--body); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); white-space: nowrap; }
.spark { width: 72px; height: 28px; overflow: visible; }
.spark .l { fill: none; stroke: var(--ink-2); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.spark .l.hi { stroke: var(--volt); }
.spark .dot { fill: var(--volt); stroke: var(--surface); stroke-width: 2; }
.spark .area { fill: url(#sparkFill); }
.dots7 { display: flex; gap: 4px; }
.dots7 i { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--line-strong); display: block; }
.dots7 i.on { background: var(--volt); border-color: var(--volt); }
.dots7 i.today { border-color: var(--ink); border-style: dashed; }
.bottles { display: flex; gap: 5px; align-items: flex-end; height: 30px; }
.bottles i { display: block; width: 13px; height: 30px; border-radius: 3px 3px 2px 2px; background: var(--surface-3); border: 1px solid var(--line-strong); position: relative; overflow: hidden; }
.bottles i::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: var(--lvl); background: var(--amber); }
.bottles i.wait::after { background: repeating-linear-gradient(135deg, var(--amber) 0 3px, rgba(255, 181, 71, .45) 3px 6px); }

/* ---------- Next game ---------- */
.game { padding: 14px 14px 12px; }
.game .row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
.game .team { display: flex; align-items: center; gap: 10px; min-width: 0; }
.game .team.away { justify-content: flex-start; }
.game .team.home { justify-content: flex-end; text-align: right; }
.game .badge {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; flex: 0 0 auto;
  font: 700 15px/1 var(--display); letter-spacing: .04em; border: 1px solid var(--line-strong); background: var(--surface-2);
}
.game .badge.buf { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.game .name { font: 700 17px/1 var(--display); text-transform: uppercase; letter-spacing: .02em; }
.game .rec { font: 500 12px/1 var(--body); color: var(--ink-3); margin-top: 4px; white-space: nowrap; }
.game .when { text-align: center; }
.game .when b { display: block; font: 700 22px/1 var(--display); letter-spacing: -0.01em; }
.game .when span { display: block; font: 600 11px/1 var(--body); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin-top: 4px; white-space: nowrap; }
.game .foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); font: 500 12.5px/1 var(--body); color: var(--ink-3); }
.game .foot b { color: var(--ink-2); font-weight: 600; }
.game .tag { display: inline-flex; align-items: center; gap: 5px; padding: 5px 9px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font: 600 11px/1 var(--body); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); white-space: nowrap; }
.game .tag i { width: 6px; height: 6px; border-radius: 50%; background: var(--volt); display: block; }
.game .next2 { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 10px; padding: 10px 12px; border-radius: 14px; background: var(--surface-2); font: 500 13px/1 var(--body); color: var(--ink-2); }
.game .next2 b { color: var(--ink); font-weight: 600; }
.game .next2 span:last-child { color: var(--ink-3); font-size: 12px; white-space: nowrap; }

/* ---------- Streak chips ---------- */
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 16px 4px; margin-left: -16px; margin-right: -16px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px; padding: 9px 12px 9px 10px;
  border-radius: 14px; background: var(--surface); border: 1px solid var(--line); font: 500 13px/1 var(--body); color: var(--ink-2);
}
.chip b { font: 700 22px/1 var(--display); color: var(--ink); }
.chip svg { width: 16px; height: 16px; color: var(--volt); }
.chip.warm svg { color: var(--amber); }
button.chip, a.chip { min-height: 44px; }

/* ---------- Weekly recap ---------- */
.recap { padding: 14px; }
.recap .grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; }
.recap .stat { padding: 10px 10px 8px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); min-width: 0; }
.recap .stat .k { font: 600 10.5px/1 var(--body); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.recap .stat .v { font: 700 24px/1 var(--display); margin-top: 6px; letter-spacing: -0.01em; }
.recap .stat .v small { font-size: 12px; color: var(--ink-3); font-weight: 600; letter-spacing: 0; }
.recap .stat .bar { margin-top: 8px; height: 6px; border-radius: 3px; background: var(--track); overflow: hidden; position: relative; }
.recap .stat .bar::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--w, 0%); background: var(--volt); border-radius: 3px; transition: width .9s var(--ease-out) .3s; }
.recap .stat .cmp { font: 500 11px/1 var(--body); color: var(--ink-3); margin-top: 6px; display: flex; align-items: center; gap: 3px; white-space: nowrap; overflow: hidden; }
.recap .stat .cmp.good { color: var(--volt); }
.recap .stat .cmp svg { width: 9px; height: 9px; flex: 0 0 auto; }
.recap .line { margin: 0; font: 500 13.5px/1.4 var(--body); color: var(--ink-2); }
.recap .line strong { color: var(--ink); font-weight: 600; }

/* ---------- Eat (reserved, not in v1) ---------- */
.eat { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; }
.eat .l { display: flex; align-items: center; gap: 10px; min-width: 0; }
.eat .l svg { width: 18px; height: 18px; color: var(--ink-2); flex: 0 0 auto; }
.eat .l .t { font: 600 14px/1.2 var(--body); }
.eat .l .s { font: 500 12px/1.2 var(--body); color: var(--ink-3); margin-top: 3px; }
.eat .score { font: 700 22px/1 var(--display); display: inline-flex; align-items: baseline; gap: 2px; }
.eat .score small { font-size: 12px; color: var(--ink-3); }

/* ---------- Buttons: pills and CTAs ---------- */
.pill {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 34px; padding: 8px 13px; border-radius: 999px; border: 1.5px solid var(--line-strong);
  font: 600 13px/1 var(--body); color: var(--ink-2); background: transparent; white-space: nowrap;
  transition: transform .12s var(--ease-out), background-color .15s, color .15s;
}
.pill::after { content: ""; position: absolute; inset: -5px -2px; }
.pill:active { transform: scale(.96); }
.pill svg { width: 14px; height: 14px; }
.pill.sel { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.pill.volt { background: var(--volt); color: var(--on-volt); border-color: var(--volt); }
.pill.amber { background: var(--amber); color: var(--on-volt); border-color: var(--amber); }
.pill.quiet { border-color: var(--line); background: var(--surface-2); color: var(--ink); }
.pill[disabled] { opacity: .4; pointer-events: none; }

.cta {
  position: relative; width: 100%; min-height: 54px; padding: 0 16px; border-radius: 16px; background: var(--volt); color: var(--on-volt);
  font: 700 19px/1 var(--display); letter-spacing: .06em; text-transform: uppercase;
  display: flex; align-items: center; justify-content: center; gap: 8px; text-align: center;
  transition: transform .12s var(--ease-out), opacity .15s;
}
.cta:active { transform: scale(.985); }
.cta svg { width: 18px; height: 18px; flex: 0 0 auto; }
.cta small { font: 600 12px/1 var(--body); letter-spacing: 0; text-transform: none; opacity: .75; }
.cta.amber { background: var(--amber); color: var(--on-volt); }
.cta.ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line-strong); }
.cta.quiet { background: var(--surface-2); color: var(--ink); border: 1px solid var(--line-strong); }
.cta.sm { min-height: 44px; font-size: 16px; border-radius: 14px; }
.cta[disabled], .cta.busy { opacity: .5; pointer-events: none; }

/* ---------- Stepper (goals, sets) ---------- */
.stepper { display: inline-flex; align-items: center; gap: 4px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.stepper button { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: var(--ink); background: var(--surface-3); position: relative; }
.stepper button::after { content: ""; position: absolute; inset: -3px; }
.stepper button svg { width: 16px; height: 16px; }
.stepper button:active { transform: scale(.92); }
.stepper button[disabled] { opacity: .35; pointer-events: none; }
.stepper output { min-width: 34px; text-align: center; font: 700 22px/1 var(--display); }

/* ---------- Lists (settings, backups) ---------- */
.list { padding: 0; overflow: hidden; }
.list .li {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; min-height: 56px; padding: 10px 14px;
  border-top: 1px solid var(--line); width: 100%; text-align: left;
}
.list .li:first-child { border-top: 0; }
.list a.li:active, .list button.li:active { background: var(--surface-2); }
.list .li .lg { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); }
.list .li .lg svg { width: 17px; height: 17px; }
.list .li .lg.good { background: var(--volt-dim); border-color: var(--volt-line); color: var(--volt); }
.list .li .lg.warm { background: var(--amber-dim); border-color: var(--amber-line); color: var(--amber); }
.list .li .t { font: 600 14.5px/1.2 var(--body); min-width: 0; }
.list .li .t small { display: block; font: 500 12px/1.3 var(--body); color: var(--ink-3); margin-top: 3px; }
.list .li .end { display: flex; align-items: center; gap: 8px; color: var(--ink-3); font: 600 13px/1 var(--body); }
.list .li .end svg.chev { width: 14px; height: 14px; }

/* checkbox row — the check shape carries the state, not the colour */
.check { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--line-strong); color: transparent; }
.check svg { width: 13px; height: 13px; }
.on > .end .check, .check.on { background: var(--ink); border-color: var(--ink); color: var(--bg); }

/* ---------- Bottom nav ---------- */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  padding: 8px calc(8px + var(--sar)) calc(var(--sab) + 2px) calc(8px + var(--sal));
  background: rgba(14, 17, 21, .86); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(5, 1fr);
}
.nav a { display: flex; flex-direction: column; align-items: center; gap: 4px; height: var(--nav-h); justify-content: center; color: var(--ink-3); font: 600 10.5px/1 var(--body); letter-spacing: .06em; text-transform: uppercase; position: relative; }
.nav a svg { width: 24px; height: 24px; }
.nav a.on { color: var(--ink); }
.nav a.on::before { content: ""; position: absolute; top: 0; width: 28px; height: 3px; border-radius: 2px; background: var(--volt); }
.nav a.on svg { color: var(--volt); }

/* ---------- Quick-log FAB ---------- */
.fab {
  position: fixed; right: calc(16px + var(--sar)); bottom: calc(var(--nav-h) + var(--sab) + 14px); z-index: 25;
  display: inline-flex; align-items: center; gap: 8px; height: var(--fab-h); padding: 0 18px 0 14px;
  border-radius: 999px; background: var(--volt); color: var(--on-volt);
  font: 700 16px/1 var(--display); letter-spacing: .06em; text-transform: uppercase;
  box-shadow: 0 10px 28px rgba(212, 255, 63, .28), 0 2px 6px rgba(0, 0, 0, .4);
  transition: transform .15s var(--ease-out), opacity .2s;
}
.fab:active { transform: scale(.96); }
.fab svg { width: 20px; height: 20px; }
body.sheet-open .fab, body.no-fab .fab { opacity: 0; transform: translateY(16px) scale(.9); pointer-events: none; }

/* ---------- Scrim + sheets (LOG sheet, confirm sheet) ---------- */
.scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, .55); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); z-index: 50; opacity: 0; pointer-events: none; transition: opacity .25s; }
.scrim.on { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; margin: 0 auto; max-width: 560px;
  max-height: 88vh; max-height: 88dvh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--surface); border-radius: 26px 26px 0 0;
  padding: 10px calc(16px + var(--sar)) calc(var(--sab) + 16px) calc(16px + var(--sal));
  border-top: 1px solid var(--line-strong);
  transform: translateY(105%); transition: transform .38s var(--ease-out);
  box-shadow: 0 -20px 60px rgba(0, 0, 0, .5);
}
.sheet.open { transform: translateY(0); }
.sheet.dragging { transition: none; }
.sheet-confirm { z-index: 70; }
.sheet .grab { width: 40px; height: 5px; border-radius: 3px; background: var(--line-strong); margin: 0 auto 14px; position: relative; }
.sheet .grab::after { content: ""; position: absolute; inset: -14px -60px; }
.sheet .h { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.sheet .h h2 { margin: 0; font: 700 26px/1 var(--display); text-transform: uppercase; letter-spacing: .01em; }
.sheet .h span { font: 500 13px/1 var(--body); color: var(--ink-3); white-space: nowrap; }
.sheet .grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.sheet .opt {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 12px; min-height: 92px; min-width: 0;
  border-radius: 16px; background: var(--surface-2); border: 1.5px solid var(--line); text-align: left;
  transition: transform .12s var(--ease-out), border-color .15s, background-color .15s;
}
.sheet .opt:active { transform: scale(.96); }
.sheet .opt > svg { width: 22px; height: 22px; color: var(--ink-2); }
.sheet .opt b { font: 700 16px/1 var(--display); text-transform: uppercase; letter-spacing: .04em; }
.sheet .opt .os { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; margin-top: 4px; font: 500 11.5px/1.2 var(--body); color: var(--ink-3); overflow: hidden; }
.sheet .opt > div { min-width: 0; max-width: 100%; }
.sheet .opt .tick { display: none; }
.sheet .opt.sel { border-color: var(--volt); background: var(--volt-dim); }
.sheet .opt.sel > svg { color: var(--volt); }
.sheet .opt.sel .tick { position: absolute; right: 8px; top: 8px; width: 18px; height: 18px; border-radius: 50%; background: var(--volt); color: var(--on-volt); display: grid; place-items: center; }
.sheet .opt.sel .tick svg { width: 10px; height: 10px; }
.sheet .detail { margin-top: 12px; padding: 12px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line); }
.sheet .detail .row { display: flex; gap: 8px; flex-wrap: wrap; }
.sheet .detail .row + .row { margin-top: 8px; }
.sheet .detail .lbl { font: 600 10.5px/1 var(--body); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 8px; }
.sheet .detail .lbl + .row { margin-top: 0; }
.sheet .detail .row + .lbl, .sheet .detail .field + .lbl, .sheet .detail .stepline + .lbl { margin-top: 12px; }
.sheet .detail .explain { margin: 0; font: 500 13.5px/1.45 var(--body); color: var(--ink-2); }
.sheet .detail .explain b { color: var(--ink); font-weight: 600; }
.sheet .detail .stepline { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sheet .detail .stepline .v { font: 700 22px/1 var(--display); }
.sheet .detail .stepline .v small { font: 600 12px/1 var(--body); color: var(--ink-3); margin-left: 4px; }
.sheet .detail .hint { margin: 10px 0 0; font: 500 12.5px/1.3 var(--body); color: var(--ink-3); }
.sheet .detail .checkrow { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; min-height: 48px; padding: 6px 2px; border-top: 1px solid var(--line); width: 100%; text-align: left; }
.sheet .detail .checkrow:first-of-type { border-top: 0; }
.sheet .detail .checkrow .t { font: 600 14px/1.2 var(--body); }
.sheet .detail .checkrow .t small { display: block; font: 500 12px/1.2 var(--body); color: var(--ink-3); margin-top: 3px; }
.sheet .detail .checkrow.on .check { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.sheet .cta { margin-top: 12px; }
.sheet .secondary { display: flex; justify-content: center; margin-top: 4px; }
.sheet .secondary button, .sheet .secondary a { min-height: 44px; padding: 0 12px; font: 600 14px/44px var(--body); color: var(--ink-2); display: inline-flex; align-items: center; gap: 4px; }
.sheet .secondary svg { width: 14px; height: 14px; }

.field { display: block; width: 100%; min-height: 44px; padding: 11px 13px; border-radius: 12px; background: var(--surface); border: 1.5px solid var(--line-strong); color: var(--ink); font: 500 16px/1.2 var(--body); }
.field::placeholder { color: var(--ink-3); }
.field:focus { border-color: var(--ink-2); outline: none; }

/* Confirm sheet */
.sheet-confirm .ttl { margin: 2px 0 0; font: 700 26px/1.05 var(--display); text-transform: uppercase; letter-spacing: .01em; }
.sheet-confirm .sub { margin: 8px 0 0; font: 500 14px/1.4 var(--body); color: var(--ink-2); }
.sheet-confirm .cmp-table { width: 100%; margin-top: 14px; border-collapse: separate; border-spacing: 0; background: var(--surface-2); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.sheet-confirm .cmp-table th, .sheet-confirm .cmp-table td { padding: 10px 12px; text-align: right; font: 600 14px/1.2 var(--body); border-top: 1px solid var(--line); }
.sheet-confirm .cmp-table thead th { border-top: 0; font: 600 10.5px/1 var(--body); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.sheet-confirm .cmp-table th:first-child, .sheet-confirm .cmp-table td:first-child { text-align: left; color: var(--ink-2); font-weight: 500; }
.sheet-confirm .cmp-table td.file { font: 700 18px/1 var(--display); }
.sheet-confirm .cmp-table td.now { font: 700 18px/1 var(--display); color: var(--ink-2); }
.sheet-confirm .cmp-table td.arrow { width: 22px; padding-left: 0; padding-right: 0; color: var(--ink-3); text-align: center; }
.sheet-confirm .cmp-table td.file .chg { font: 600 11px/1 var(--body); color: var(--amber); margin-left: 6px; letter-spacing: .02em; }
.sheet-confirm .note { display: flex; gap: 10px; align-items: flex-start; margin: 14px 0 0; padding: 12px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); font: 500 13px/1.4 var(--body); color: var(--ink-2); }
.sheet-confirm .note svg { width: 18px; height: 18px; color: var(--volt); flex: 0 0 auto; margin-top: 1px; }
.sheet-confirm .actions { display: grid; grid-template-columns: 1fr 1.5fr; gap: 10px; margin-top: 16px; }
.sheet-confirm .actions .cta { margin-top: 0; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; z-index: 80; left: 0; right: 0; margin: 0 auto; width: calc(100% - 32px); max-width: 420px;
  bottom: calc(var(--nav-h) + var(--sab) + 14px + var(--fab-h) + 12px);
  display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 50px; padding: 7px 7px 7px 16px;
  border-radius: 16px; background: var(--surface-3); border: 1px solid var(--line-strong); color: var(--ink);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .55);
  font: 600 14px/1.3 var(--body);
  opacity: 0; transform: translateY(16px); pointer-events: none;
  transition: opacity .22s var(--ease-out), transform .22s var(--ease-out);
}
.toast.show { opacity: 1; transform: none; pointer-events: auto; }
.toast .msg { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 6px 0; }
.toast .msg svg { width: 16px; height: 16px; flex: 0 0 auto; color: var(--volt); }
.toast .msg.warm svg { color: var(--amber); }
.toast .action { flex: 0 0 auto; min-height: 36px; padding: 0 14px; border-radius: 12px; background: var(--volt); color: var(--on-volt); font: 700 15px/36px var(--display); letter-spacing: .06em; text-transform: uppercase; position: relative; }
.toast .action::after { content: ""; position: absolute; inset: -4px; }
body.no-fab .toast { bottom: calc(var(--nav-h) + var(--sab) + 84px); }
body.sheet-open .toast { top: calc(max(var(--sat), 12px) + 8px); bottom: auto; transform: translateY(-16px); }
body.sheet-open .toast.show { transform: none; }

/* ---------- Empty state ---------- */
.empty:not(.ring) { display: grid; grid-template-columns: 40px 1fr; gap: 12px; align-items: start; }
.empty .glyph { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); }
.empty .glyph svg { width: 20px; height: 20px; }
.empty h3 { margin: 2px 0 0; font: 700 22px/1.05 var(--display); text-transform: uppercase; letter-spacing: .01em; }
.empty p { margin: 6px 0 0; font: 500 13.5px/1.4 var(--body); color: var(--ink-2); }
.empty .btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.empty.center:not(.ring) { grid-template-columns: 1fr; justify-items: center; text-align: center; padding: 8px 4px; }
.empty.center .btns { justify-content: center; }

/* ---------- Setup card (§7.10) ---------- */
.setup { padding: 12px 14px 4px; }
.setup .head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 2px; }
.setup .head h2 { margin: 0; font: 700 20px/1 var(--display); text-transform: uppercase; letter-spacing: .01em; display: flex; align-items: baseline; gap: 10px; }
.setup .head .n { font: 600 11px/1 var(--body); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.setup .step { display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 12px; min-height: 52px; padding: 7px 0; border-top: 1px solid var(--line); }
.setup .head + .step { border-top: 0; }
.setup .step .d { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; border: 2px dashed var(--line-strong); color: var(--ink-2); font: 700 13px/1 var(--display); }
.setup .step .d svg { width: 12px; height: 12px; }
.setup .step.done .d { background: var(--volt); border: 2px solid var(--volt); color: var(--on-volt); }
.setup .step .t { font: 600 14.5px/1.2 var(--body); min-width: 0; }
.setup .step .t small { display: block; margin-top: 3px; font: 500 12px/1.2 var(--body); color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.setup .step.done .t { color: var(--ink-3); text-decoration: line-through; text-decoration-color: var(--ink-3); }
.setup .step svg.go { width: 16px; height: 16px; color: var(--ink-3); }
.icon-btn.sm { width: 30px; height: 30px; }
.icon-btn.sm svg { width: 14px; height: 14px; }
.icon-btn.sm::after { inset: -7px; }

/* ---------- Stat card, trend, rounds, courses (golf.html components) ---------- */
.stats4 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.stat-card { padding: 14px 14px 12px; }
.stat-card .k { font: 600 11px/1 var(--body); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); display: flex; align-items: center; gap: 6px; }
.stat-card .k svg { width: 13px; height: 13px; }
.stat-card .v { font: 700 32px/1 var(--display); letter-spacing: -0.02em; margin-top: 8px; }
.stat-card .v small { font-size: 14px; color: var(--ink-3); font-weight: 600; letter-spacing: 0; }
.stat-card .meter { margin-top: 10px; height: 6px; border-radius: 3px; background: var(--track); position: relative; overflow: hidden; }
.stat-card .meter::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: var(--w, 0%); background: var(--ink-2); border-radius: 3px; transition: width .9s var(--ease-out) .2s; }
.stat-card .meter.good::after { background: var(--volt); }
.stat-card .meter .tgt { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--ink); left: var(--t); z-index: 1; }
.stat-card .cmp { margin-top: 8px; font: 500 12px/1.3 var(--body); color: var(--ink-3); display: flex; align-items: center; gap: 4px; }
.stat-card .cmp.good { color: var(--volt); }
.stat-card .cmp.warn { color: var(--amber); }
.stat-card .cmp svg { width: 10px; height: 10px; flex: 0 0 auto; }

.trend { padding: 14px 14px 12px; }
.trend .h { display: flex; justify-content: space-between; align-items: baseline; }
.trend .h h3 { margin: 0; font: 600 15.5px/1.3 var(--body); }
.trend .h h3 strong { color: var(--volt); font-weight: 700; }
.trend .legend { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 8px; font: 500 11.5px/1 var(--body); color: var(--ink-3); }
.trend .legend i { display: inline-block; width: 14px; height: 0; border-top: 2px solid var(--ink-2); vertical-align: middle; margin-right: 5px; }
.trend .legend i.avg { border-top: 2px dashed var(--volt); }
.trend .legend i.bar { width: 8px; height: 10px; border: 0; background: var(--ink-2); border-radius: 2px; }
.trend .chart { margin-top: 8px; }
.trend .chart svg { width: 100%; height: 170px; overflow: visible; }
.trend .chart .bar { fill: var(--ink-3); transition: fill .15s; }
.trend .chart .bar.hi { fill: var(--ink); }
.trend .chart .bar.sel { fill: var(--volt); }
.trend .chart .avg { fill: none; stroke: var(--volt); stroke-width: 2; stroke-dasharray: 5 4; stroke-linecap: round; }
.trend .chart .grid { stroke: var(--line); stroke-width: 1; }
.trend .chart .gl { font: 600 10px var(--body); fill: var(--ink-3); }
.trend .chart .xl { font: 600 10px var(--body); fill: var(--ink-3); text-anchor: middle; letter-spacing: .02em; }
.trend .chart .vl { font: 700 12px var(--display); fill: var(--ink); text-anchor: middle; paint-order: stroke; stroke: var(--surface); stroke-width: 4px; stroke-linejoin: round; }
.trend .chart .vl.sel { fill: var(--volt); }
.trend .chart .hit { fill: transparent; cursor: pointer; }
.trend .tip { margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 8px; font: 500 13px/1.2 var(--body); color: var(--ink-2); }
.trend .tip b { color: var(--ink); font-weight: 600; }
.trend .tip .sc { font: 700 20px/1 var(--display); color: var(--volt); }

.rounds { padding: 4px 0; }
.rounds .r { display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; padding: 11px 14px; border-top: 1px solid var(--line); transition: background .15s; width: 100%; text-align: left; }
.rounds .r:first-child { border-top: 0; }
.rounds .r.sel { background: var(--volt-dim); }
.rounds .r .date { text-align: center; }
.rounds .r .date b { display: block; font: 700 19px/1 var(--display); }
.rounds .r .date span { display: block; font: 600 10px/1 var(--body); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin-top: 3px; }
.rounds .r .course { font: 600 14.5px/1.2 var(--body); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rounds .r .meta { font: 500 12px/1.2 var(--body); color: var(--ink-3); margin-top: 3px; }
.rounds .r .score { text-align: right; }
.rounds .r .score b { display: block; font: 700 26px/1 var(--display); letter-spacing: -0.02em; }
.rounds .r.sel .score b { color: var(--volt); }
.rounds .r .score span { display: block; font: 600 11px/1 var(--body); color: var(--ink-3); margin-top: 3px; }
.rounds .r .score span.best { color: var(--volt); }
.badge-pr { display: inline-flex; align-items: center; gap: 3px; padding: 4px 7px; border-radius: 999px; background: var(--volt-dim); border: 1px solid var(--volt-line); color: var(--volt); font: 700 12px/1 var(--display); letter-spacing: .06em; }
.badge-pr svg { width: 10px; height: 10px; }

.courses { padding: 6px 14px 8px; }
.courses .c { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line); }
.courses .c:first-child { border-top: 0; }
.courses .c .n { font: 600 14px/1.2 var(--body); }
.courses .c .n span { font: 500 12px/1.2 var(--body); color: var(--ink-3); margin-left: 6px; }
.courses .c .bar { grid-column: 1 / -1; height: 6px; border-radius: 3px; background: var(--track); position: relative; margin-top: -2px; }
.courses .c .bar::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: var(--w); background: var(--ink-2); border-radius: 3px; }
.courses .c.best .bar::after { background: var(--volt); }
.courses .c .v { font: 700 20px/1 var(--display); }
.courses .c.best .v { color: var(--volt); }

/* ---------- repair 2026-09-28 (additive; design/build/repair.md) ---------- */
/* Next up: a team name stays on its one line (home.js teamName() falls back to the nickname's last word) */
.game .row { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
.game .team > div:not(.badge) { min-width: 0; }
.game .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 44 px hit areas shell-wide (SPEC 8.A.9): section links, the toast's Undo, goal steppers */
.section-h a.meta::after, .section-h button.meta::after { inset: -16px -8px; }
.section-h { position: relative; z-index: 1; } /* its link's hit area overlaps the next card's top padding; paint it above */
/* a ::after inset is measured from the padding box, so the pill's 1.5 px border ate 3 px: 31 + 14 = 45 px tall */
.pill::after { inset: -7px -2px; }
.toast .action::after { inset: -7px -6px; }
.stepper button::after { inset: -4px; }
/* a toast hidden because a sheet opened goes at once — it never fades out over the header behind the scrim */
body.sheet-open .toast:not(.show) { transition: none; }
/* at SE widths (< 360 px) the one-line slot is narrower than one team word: keep the original wrapping layout there */
@media (max-width: 359px) {
  .game .row { grid-template-columns: 1fr auto 1fr; }
  .game .team > div:not(.badge) { min-width: auto; }
  .game .name { white-space: normal; overflow: visible; }
}
