:root {
  --bg: #0A0F0D;
  --surface: #121A17;
  --surface-2: #18221E;
  --surface-3: #1F2B26;
  --line: #24302B;
  --line-strong: #31403A;
  --text: #EEF3EF;
  --muted: #94A39C;
  --volt: #C9F25C;
  --volt-hover: #D6F77A;
  --volt-press: #B5DE4A;
  --volt-ink: #0A0F0D;
  --volt-tint: #1F2A1A;
  --volt-edge: #3D5A22;
  --aqua: #6CCFE6;
  --amber: #F5B544;
  --danger: #FF6B5B;
  --danger-tint: #2A1714;
  --danger-edge: #5A2A24;

  --display: 'Bricolage Grotesque', ui-sans-serif, system-ui, sans-serif;
  --body: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --t-2: .694rem;
  --t-1: .833rem;
  --t0: 1rem;
  --t1: 1.2rem;
  --t2: 1.44rem;
  --t3: 1.728rem;
  --t4: 2.074rem;
  --t5: 2.488rem;

  --r-card: 22px;
  --r-input: 14px;
  --gutter: 16px;
  --tab-h: 64px;
  --rail-w: 232px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-bottom: 120px; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: 400 var(--t0)/1.5 var(--body);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, h4 { font-family: var(--display); font-weight: 700; letter-spacing: -.025em; line-height: 1.08; margin: 0; }
h1 { font-size: var(--t4); font-weight: 800; }
h2 { font-size: var(--t1); letter-spacing: -.015em; }
h3 { font-size: var(--t0); font-weight: 600; letter-spacing: -.01em; }
p { margin: 0; }
a { color: inherit; }
button { font: inherit; color: inherit; }
svg { display: block; }
[hidden] { display: none !important; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { padding: 0; margin-bottom: 8px; }
summary { list-style: none; }
summary::-webkit-details-marker { display: none; }

:focus { outline: none; }
:focus-visible { outline: 2px solid var(--volt); outline-offset: 2px; border-radius: 8px; }

.num, .stat-v, td, .delta { font-variant-numeric: tabular-nums; }
.u { font-size: .72em; font-weight: 500; color: var(--muted); margin-left: .18em; letter-spacing: 0; }
.muted { color: var(--muted); }
.small { font-size: var(--t-1); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.delta { font-weight: 600; white-space: nowrap; }
.delta.pos { color: var(--volt); }
.warn { color: var(--amber); font-weight: 600; }
.over { color: var(--danger); font-weight: 600; }
.delta.neg { color: var(--danger); }
.delta.zero { color: var(--muted); }
.arrow { color: var(--muted); margin: 0 .3em; font-weight: 400; }

/* ---------------------------------------------------------------- shell */

.rail { position: fixed; z-index: 20; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 800 1.5rem/1 var(--display); letter-spacing: -.04em; }
.brand-mark { width: 26px; height: 26px; color: var(--volt); }
.nav { display: grid; gap: 4px; }
.nav a {
  display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: 14px;
  color: var(--muted); text-decoration: none; font-weight: 500; font-size: 15px;
  transition: color .15s, background .15s;
}
.nav a:hover { color: var(--text); }
.nav a[aria-current="page"] { color: var(--text); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.nav a[aria-current="page"] svg { color: var(--volt); }
.nav svg { width: 22px; height: 22px; flex: none; }
.rail-foot { margin-top: auto; display: grid; gap: 4px; font-size: var(--t-1); color: var(--muted); }
.rail-foot button { justify-content: flex-start; padding: 0 12px; }

main { outline: none; position: relative; z-index: 1; }
.view { max-width: 1440px; margin-inline: auto; }
#pulse { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.view.enter { animation: view-in .16s var(--ease); }

@media (max-width: 767px) {
  .rail {
    left: 0; right: 0; bottom: 0;
    height: calc(var(--tab-h) + env(safe-area-inset-bottom));
    padding: 0 max(8px, env(safe-area-inset-left)) env(safe-area-inset-bottom);
    background: var(--surface);
    box-shadow: inset 0 1px 0 var(--line);
  }
  .rail .brand, .rail .rail-log, .rail .rail-foot { display: none; }
  .nav { grid-template-columns: repeat(5, 1fr); height: var(--tab-h); gap: 0; }
  .nav a { flex-direction: column; justify-content: center; gap: 3px; padding: 0; font-size: 11px; border-radius: 0; background: none !important; box-shadow: none !important; }
  main {
    padding: calc(20px + env(safe-area-inset-top)) max(var(--gutter), env(safe-area-inset-right)) calc(var(--tab-h) + 104px + env(safe-area-inset-bottom)) max(var(--gutter), env(safe-area-inset-left));
  }
  body.focus .rail { display: none; }
  body.focus main { padding-bottom: calc(112px + env(safe-area-inset-bottom)); }
  h1 { font-size: var(--t3); }
}
@media (min-width: 768px) {
  .rail {
    top: 0; bottom: 0; left: 0; width: 88px;
    padding: 24px 12px; display: flex; flex-direction: column; align-items: stretch; gap: 24px;
    background: var(--bg); box-shadow: inset -1px 0 0 var(--line);
  }
  main { margin-left: 88px; padding: 40px 40px 96px; }
  .fab { display: none !important; }
  .rail .brand span, .rail-log span, .rail-foot { display: none; }
  .rail .brand { justify-content: center; }
  .nav a { flex-direction: column; gap: 4px; padding: 8px 0; font-size: 11px; justify-content: center; }
  .rail-log { padding: 0; width: 56px; height: 56px; margin: 0 auto; }
}
@media (min-width: 1100px) {
  .rail { width: var(--rail-w); padding: 28px 16px; }
  main { margin-left: var(--rail-w); padding: 48px 56px 96px; }
  .rail .brand { justify-content: flex-start; padding-left: 8px; }
  .rail .brand span, .rail-log span, .rail-foot { display: revert; }
  .rail-foot { display: grid; }
  .nav a { flex-direction: row; font-size: 15px; padding: 0 12px; justify-content: flex-start; }
  .rail-log { width: auto; height: 48px; margin: 0; }
}

body.bare .rail, body.bare .fab { display: none; }
body.bare main { margin: 0 auto; max-width: 880px; padding: calc(32px + env(safe-area-inset-top)) var(--gutter) 64px; }

.fab {
  position: fixed; z-index: 25;
  right: max(var(--gutter), env(safe-area-inset-right));
  bottom: calc(var(--tab-h) + 16px + env(safe-area-inset-bottom));
  height: 56px; padding: 0 22px 0 18px; border-radius: 999px;
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--volt); color: var(--volt-ink); font-weight: 600; text-decoration: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .55), 0 2px 6px rgba(0, 0, 0, .4);
  transition: transform .12s var(--ease);
}
.fab:active { transform: scale(.97); }
.fab svg { width: 22px; height: 22px; }

/* ---------------------------------------------------------------- page structure */

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 28px; flex-wrap: wrap; }
.page-head .lede { color: var(--muted); margin-top: 8px; }
.eyebrow { color: var(--muted); font-size: var(--t-1); font-weight: 500; margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.eyebrow a { text-decoration: none; display: inline-flex; align-items: center; gap: 4px; min-height: 32px; }
.eyebrow a:hover { color: var(--text); }
.section { margin-top: 32px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-head h2 { display: flex; align-items: center; gap: 6px; }
.stack { display: grid; gap: 12px; }
.stack-lg { display: grid; gap: 24px; }
@media (min-width: 768px) { .stack-lg { gap: 32px; } }
.row-flex { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

.card {
  background: var(--surface);
  border-radius: var(--r-card);
  box-shadow: inset 0 0 0 1px var(--line);
  padding: 20px;
  min-width: 0;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 4px 12px; margin-bottom: 16px; flex-wrap: wrap; }
.card-head h2, .stat-k, .ring-label, .eb {
  font: 500 11px/1.3 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
}
.card-head h2 { white-space: nowrap; display: flex; align-items: center; gap: 8px; }
.eb-sep { color: var(--line-strong); margin: 0 .35em; }
.card-head .muted { font-size: var(--t-1); }
@media (max-width: 767px) { .card { padding: 16px; } }
@media (min-width: 768px) { .card { padding: 24px; } }

.empty { color: var(--muted); padding: 20px 0; }
.card .empty { padding: 8px 0; }

/* ---------------------------------------------------------------- controls */

.btn {
  appearance: none; border: 0; cursor: pointer; text-decoration: none; white-space: nowrap;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 20px; border-radius: 999px;
  font: 600 15px/1 var(--body);
  color: var(--text); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line);
  transition: transform .12s var(--ease), background .15s, color .15s;
}
.btn:hover { background: var(--surface-3); }
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .5; cursor: default; transform: none; }
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--volt); color: var(--volt-ink); box-shadow: none; }
.btn-primary:hover { background: var(--volt-hover); }
.btn-primary:active { background: var(--volt-press); }
.btn-ghost { background: transparent; box-shadow: none; color: var(--muted); padding: 0 12px; }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { background: var(--danger-tint); color: var(--danger); box-shadow: inset 0 0 0 1px var(--danger-edge); }
.btn-danger:hover { background: #351C18; }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: 14px; }
.btn-block { width: 100%; }
@media (pointer: coarse) { .btn-sm { min-height: 44px; } }

.icon-btn {
  appearance: none; border: 0; background: transparent; color: var(--muted); cursor: pointer;
  width: 44px; height: 44px; border-radius: 999px; display: inline-grid; place-items: center; flex: none;
  transition: background .15s, color .15s, transform .12s var(--ease);
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn:active { transform: scale(.94); }
.icon-btn svg { width: 20px; height: 20px; }

.info {
  appearance: none; border: 0; background: none; padding: 0; cursor: help; color: var(--muted);
  width: 18px; height: 18px; display: inline-grid; place-items: center; position: relative; flex: none;
}
.info::after { content: ''; position: absolute; inset: -13px; }
.info:hover, .info:focus-visible { color: var(--muted); }
.info svg { width: 16px; height: 16px; }

.field { display: grid; gap: 6px; min-width: 0; }
.field > span, .label { font-size: var(--t-1); font-weight: 500; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.field .hint { font-size: var(--t-1); color: var(--muted); }
.input {
  width: 100%; min-height: 48px; padding: 0 14px;
  border: 0; border-radius: var(--r-input);
  background: var(--surface-2); color: var(--text);
  box-shadow: inset 0 0 0 1px var(--line);
  font: 400 16px/1.4 var(--body);
  transition: box-shadow .15s;
}
.input::placeholder { color: var(--muted); }
.input:hover { box-shadow: inset 0 0 0 1px var(--line-strong); }
.input:focus-visible, .input:focus { outline: none; box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--volt); }
textarea.input { padding: 12px 14px; min-height: 96px; resize: vertical; }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
input[type="date"].input { color-scheme: dark; }
input[type="search"].input { padding-left: 44px; }
.search { position: relative; }
.search svg { position: absolute; left: 14px; top: 50%; width: 18px; height: 18px; margin-top: -9px; color: var(--muted); pointer-events: none; }

.form-grid { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; }
.form-grid > .full { grid-column: 1 / -1; }
@media (max-width: 479px) { .form-grid { grid-template-columns: 1fr; } }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 20px; }
.form-error { color: var(--danger); font-size: var(--t-1); margin-top: 10px; }
.form-error:empty { display: none; }

.stepper {
  display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; align-items: center;
  background: var(--surface-2); border-radius: var(--r-input); box-shadow: inset 0 0 0 1px var(--line);
}
.stepper:focus-within { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--volt); }
.stepper .input { background: transparent; box-shadow: none !important; text-align: center; padding: 0 4px; font-variant-numeric: tabular-nums; }
.stepper button { appearance: none; border: 0; background: none; color: var(--muted); height: 48px; cursor: pointer; display: grid; place-items: center; border-radius: var(--r-input); }
.stepper button:hover { color: var(--text); }
.stepper button:active { transform: scale(.92); }
.stepper svg { width: 18px; height: 18px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px;
  font-size: 12px; font-weight: 500; color: var(--muted);
  background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); white-space: nowrap;
}
.chip.warn { color: var(--danger); background: var(--danger-tint); box-shadow: inset 0 0 0 1px var(--danger-edge); }

.toggles { display: flex; flex-wrap: wrap; gap: 8px; }
.toggle { position: relative; }
.toggle input, .seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.toggle span {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: 999px;
  background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); color: var(--muted); font-size: 14px; font-weight: 500;
  transition: background .15s, color .15s;
}
.toggle input:checked + span { background: var(--volt-tint); color: var(--volt); box-shadow: inset 0 0 0 1px var(--volt-edge); }
.toggle input:focus-visible + span, .seg input:focus-visible + span { outline: 2px solid var(--volt); outline-offset: 2px; }

.seg { display: inline-flex; padding: 4px; gap: 2px; background: var(--surface-2); border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg label { position: relative; flex: 1 0 auto; }
.seg span { display: flex; align-items: center; justify-content: center; min-height: 36px; padding: 0 14px; border-radius: 999px; color: var(--muted); font-size: 14px; font-weight: 500; white-space: nowrap; transition: background .15s, color .15s; }
.seg input:checked + span { background: var(--surface-3); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-strong); }
.seg .count { color: var(--muted); margin-left: 6px; font-variant-numeric: tabular-nums; }

.tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; margin: 28px 0 20px; box-shadow: inset 0 -1px 0 var(--line); }
.tabs::-webkit-scrollbar, .seg::-webkit-scrollbar { display: none; }
.tab {
  appearance: none; border: 0; background: none; cursor: pointer; white-space: nowrap;
  min-height: 44px; padding: 0 14px; color: var(--muted); font-weight: 500; font-size: 15px;
  box-shadow: inset 0 -2px 0 transparent; transition: color .15s, box-shadow .15s;
}
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--text); box-shadow: inset 0 -2px 0 var(--volt); }
@media (max-width: 399px) { .tab { padding: 0 10px; font-size: 14px; } }

input[type="range"].effort { -webkit-appearance: none; appearance: none; width: 100%; height: 44px; background: transparent; cursor: pointer; }
input[type="range"].effort::-webkit-slider-runnable-track { height: 6px; border-radius: 999px; background: linear-gradient(90deg, var(--volt) var(--p, 50%), var(--surface-3) var(--p, 50%)); }
input[type="range"].effort::-moz-range-track { height: 6px; border-radius: 999px; background: var(--surface-3); }
input[type="range"].effort::-moz-range-progress { height: 6px; border-radius: 999px; background: var(--volt); }
input[type="range"].effort::-webkit-slider-thumb { -webkit-appearance: none; width: 28px; height: 28px; margin-top: -11px; border-radius: 50%; background: var(--text); border: 6px solid var(--volt); }
input[type="range"].effort::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: var(--text); border: 6px solid var(--volt); }
input[type="range"].effort:focus-visible { outline: none; }
input[type="range"].effort:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--volt); }
.effort-out { font-variant-numeric: tabular-nums; color: var(--text); font-weight: 600; }

/* inline confirm */
.confirm { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.confirm-q { font-weight: 500; margin-right: 4px; }

/* ---------------------------------------------------------------- lists */

.list { display: grid; }
.row {
  display: flex; align-items: center; gap: 14px; min-height: 60px; padding: 12px 4px;
  color: inherit; text-decoration: none; box-shadow: inset 0 -1px 0 var(--line);
  background: none; border: 0; width: 100%; text-align: left; cursor: pointer; font: inherit;
  transition: background .15s;
}
.list > .row:last-child { box-shadow: none; }
a.row:hover, button.row:hover { background: rgba(255, 255, 255, .018); }
a.row:active, button.row:active { transform: scale(.995); }
.row-main { flex: 1; min-width: 0; display: grid; gap: 4px; }
.row-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-sub { color: var(--muted); font-size: var(--t-1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-end { text-align: right; flex: none; display: grid; gap: 2px; justify-items: end; font-variant-numeric: tabular-nums; }
.row-end .muted { font-size: var(--t-1); }
.list-month { font-size: var(--t-1); color: var(--muted); font-weight: 600; padding: 20px 4px 4px; letter-spacing: .02em; }
.list-month:first-child { padding-top: 0; }

/* ---------------------------------------------------------------- stats */

.stats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
@media (min-width: 768px) { .stats { gap: 16px; } }
.stat-k { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.stat-v { font: 600 var(--t4)/1 var(--display); letter-spacing: -.03em; display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 2px; font-variant-numeric: tabular-nums; }
.stat-v.warn { color: var(--amber); }
.stat-v.over { color: var(--danger); }
.stat-v .from { color: var(--muted); font-weight: 600; font-size: .62em; }
.stat-v .arrow { font-size: .5em; align-self: center; }
.stat-s { margin-top: 8px; font-size: var(--t-1); color: var(--muted); }
.stat-v.low { color: var(--danger); }
@media (max-width: 479px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .stats .stat.wide { grid-column: 1 / -1; }
  .stat-v { font-size: var(--t3); }
}

/* ---------------------------------------------------------------- today */

.secret {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px;
  margin-top: 14px; padding: 12px 14px; border-radius: var(--r-input);
  background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--volt-edge);
}
.secret-text { display: grid; gap: 2px; min-width: 0; }
.secret code { font: 600 17px/1.3 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--text); user-select: all; overflow-wrap: anywhere; }
.coach-row { display: grid; gap: 10px; padding: 14px 4px; box-shadow: inset 0 -1px 0 var(--line); }
.coach-row:last-child { box-shadow: none; }
.coach-id { display: grid; gap: 2px; min-width: 0; }
.coach-id .row-title, .coach-id .row-sub { white-space: normal; overflow-wrap: anywhere; }
.data-row { display: grid; gap: 12px; }
@media (min-width: 768px) {
  .coach-row { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
  .data-row { grid-template-columns: 1fr auto; align-items: center; }
}
@media (max-width: 767px) { .data-row .btn { width: 100%; } }
.lowpack { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin: -8px 0 24px; font-size: var(--t-1); color: var(--muted); }
.lowpack a { color: var(--amber); text-decoration: none; font-weight: 600; }
.lowpack a.over { color: var(--danger); }
.lowpack a:hover { text-decoration: underline; }
.cards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.cards.wide { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
@media (min-width: 768px) { .cards { gap: 16px; } }
.empty-card { display: grid; justify-items: start; gap: 16px; padding-block: 28px; }
.empty-card > svg { width: 100%; height: 72px; }
.empty-card p { color: var(--text); font-size: var(--t1); }
.client-card { display: grid; gap: 18px; text-decoration: none; color: inherit; transition: transform .12s var(--ease), box-shadow .15s; }
.client-card:hover { box-shadow: inset 0 0 0 1px var(--line-strong); }
.client-card:active { transform: scale(.98); }
.cc-top { display: flex; gap: 14px; align-items: center; }
.cc-id { min-width: 0; display: grid; gap: 6px; }
.cc-id h3 { font-size: var(--t1); font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-foot { display: grid; grid-template-columns: auto 1fr auto; align-items: end; gap: 14px; }
.cc-meta { display: grid; gap: 2px; font-size: var(--t-1); }
.cc-meta b { font-weight: 500; color: var(--text); }
.cc-spark { height: 34px; min-width: 0; }
.cc-spark svg { width: 100%; height: 34px; overflow: visible; }
.cc-index { text-align: right; display: grid; gap: 2px; font-size: var(--t-1); }
.cc-index b { font: 600 var(--t1)/1 var(--display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }

.ring { flex: none; position: relative; }
.ring svg { overflow: visible; }
.ring-n { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; line-height: 1; }
.ring-n b { font: 600 var(--t1)/1 var(--display); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.ring-n small { font-size: 10px; color: var(--muted); margin-top: 3px; letter-spacing: .02em; }
.ring.lg .ring-n b { font-size: var(--t4); }
.ring.lg .ring-n small { font-size: 12px; margin-top: 4px; }
.ring.low .ring-n b { color: var(--amber); }
.ring.over .ring-n b { color: var(--danger); }

/* ---------------------------------------------------------------- client page */

.client-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 420px); gap: 24px 40px; align-items: start; }
.head-log { margin-top: 24px; }
.client-head h1 { margin-bottom: 12px; }
.client-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--muted); font-size: var(--t-1); margin-top: 12px; }
.client-goal { margin-top: 14px; max-width: 60ch; color: var(--text); }
.client-goal::before { content: 'Goal'; display: block; font-size: var(--t-1); color: var(--muted); font-weight: 500; margin-bottom: 2px; }
.pack-card { display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: center; }
.pack-card .ring-label { display: flex; gap: 8px; align-items: center; }
.packs { display: grid; margin-top: 8px; }
.pack-row {
  appearance: none; border: 0; background: none; cursor: pointer; text-align: left; width: 100%;
  display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 8px; margin: 0 -8px; border-radius: 12px;
  font: 400 var(--t-1)/1.3 var(--body); color: var(--muted);
}
.pack-row:hover { background: var(--surface-2); }
.pack-row b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.pack-row svg { width: 16px; height: 16px; margin-left: auto; flex: none; }
.pack-fields { grid-template-columns: 1fr 1fr !important; }
.pack-left { margin: -4px 0 0; }
@media (max-width: 899px) { .client-head { grid-template-columns: 1fr; } }
@media (max-width: 767px) { .head-log { display: none; } }
@media (max-width: 479px) { .pack-card { gap: 16px; } .pack-card .ring, .pack-card .ring svg { width: 88px !important; height: 88px !important; } .pack-card .ring-n b { font-size: var(--t3); } }

@media (min-width: 1100px) { .lib-grid { grid-template-columns: 1fr 1fr; align-items: start; } }
.progress-grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 768px) { .progress-grid { gap: 24px; } }
@media (min-width: 1100px) { .progress-grid.two { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); } }
.chart { position: relative; width: 100%; min-width: 0; }
.chart svg { width: 100%; height: auto; overflow: visible; }
.chart text { font: 500 10.5px var(--mono); fill: var(--muted); }
.chart .t-label { font: 600 13px var(--body); fill: var(--text); }
.chart .t-sub { font: 400 12px var(--body); fill: var(--muted); }
.chart .t-delta { font: 600 13px var(--body); }
.chart .grid line { stroke: var(--line); stroke-width: 1; }
.chart .draw { transition: stroke-dashoffset 1.1s var(--ease); }
.chart .slide { transition: transform .9s var(--ease); }
.chart .fade { transition: opacity .6s .5s; }
.chart .grow { transition: transform .7s var(--ease); transform-box: fill-box; transform-origin: 50% 100%; }
.chart .hit:hover + .bar { fill: #3F4E47; }
.chart .pos { fill: var(--volt); }
.chart .neg { fill: var(--danger); }
.chart .zero { fill: var(--muted); }
.chart-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: var(--t-1); color: var(--muted); margin-top: 12px; }
.chart-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.chart-legend i.line { width: 14px; height: 2px; border-radius: 2px; vertical-align: 3px; }

.ex-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.ex-table th { text-align: left; font-weight: 500; color: var(--muted); font-size: var(--t-1); padding: 0 8px 8px 0; }
.ex-table td { padding: 10px 8px 10px 0; box-shadow: inset 0 -1px 0 var(--line); vertical-align: middle; }
.ex-table tr:last-child td { box-shadow: none; }
.ex-table .r { text-align: right; padding-right: 0; }

/* session detail */
.ex-block { padding: 14px 0; box-shadow: inset 0 -1px 0 var(--line); }
.ex-block:last-child { box-shadow: none; }
.ex-block-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; margin-bottom: 8px; }
.set-list { display: grid; gap: 4px; font-variant-numeric: tabular-nums; }
.set-line { display: flex; gap: 12px; color: var(--text); font-size: 15px; }
.set-line .set-no { color: var(--muted); width: 18px; }
.set-line .note { color: var(--muted); font-size: var(--t-1); }
.kv { display: flex; flex-wrap: wrap; gap: 6px 20px; color: var(--muted); font-size: var(--t-1); margin-bottom: 8px; }
.kv b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.notes { white-space: pre-wrap; color: var(--text); margin-top: 12px; }

/* ---------------------------------------------------------------- report */

.report-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.month-nav { display: inline-flex; align-items: center; gap: 2px; }
.month-nav strong { min-width: 9.5em; text-align: center; font: 700 var(--t1)/1 var(--display); letter-spacing: -.02em; }
.report { display: grid; gap: 16px; }
@media (min-width: 768px) { .report { gap: 24px; } }
.pr-row { display: flex; gap: 12px; align-items: center; min-height: 52px; box-shadow: inset 0 -1px 0 var(--line); }
.pr-row:last-child { box-shadow: none; }
.pr-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--volt); flex: none; }
.pr-row .row-main { gap: 2px; }
.coach-note { white-space: pre-wrap; font-size: var(--t1); line-height: 1.5; font-family: var(--body); max-width: 62ch; }
.public-brand { display: flex; align-items: center; justify-content: space-between; margin-bottom: 40px; color: var(--muted); font-size: var(--t-1); }
.public-brand .brand { font-size: 1.25rem; color: var(--text); }
.public-brand .brand-mark { width: 22px; height: 22px; }
.share { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ---------------------------------------------------------------- log form */

.log-layout { display: grid; gap: 16px; }
@media (min-width: 1100px) {
  .log-layout { grid-template-columns: 360px minmax(0, 1fr); gap: 24px; align-items: start; }
  .log-meta { position: sticky; top: 24px; }
}
.log-meta .form-grid { gap: 14px; }
.effort-row { display: flex; justify-content: space-between; align-items: baseline; }
.exb { padding: 16px 16px 8px; }
.exb-head { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 8px; }
.exb-head > div { flex: 1; min-width: 0; }
.exb-head h3 { font-size: var(--t1); font-weight: 700; }
.exb-head .muted { font-size: var(--t-1); margin-top: 2px; }
.sets { display: grid; max-width: 620px; }
.set { display: grid; grid-template-columns: 22px minmax(0, 1fr) 44px; gap: 8px; align-items: center; padding: 6px 0; }
.set-no { color: var(--muted); font-size: var(--t-1); font-variant-numeric: tabular-nums; text-align: center; }
.set-fields { display: flex; align-items: center; gap: 6px; min-width: 0; }
.set-fields .x { color: var(--muted); flex: none; }
.cell { position: relative; flex: 1; min-width: 0; }
.cell .input { min-height: 48px; padding: 0 34px 0 12px; font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.cell .input::placeholder { font-weight: 400; }
.cell .u { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); pointer-events: none; font-size: 12px; margin: 0; }
.cell.time { display: flex; align-items: center; gap: 2px; }
.cell.time .input { padding: 0 8px; text-align: center; }
.cell.time .colon { color: var(--muted); font-weight: 600; }
.adj { grid-column: 2 / 3; display: none; gap: 6px; flex-wrap: wrap; }
.set:focus-within .adj:not(:empty) { display: flex; }
.adj button {
  appearance: none; border: 0; cursor: pointer; min-width: 56px; min-height: 40px; padding: 0 12px; border-radius: 12px;
  background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); font-weight: 600; font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.adj button:active { transform: scale(.95); background: var(--surface-3); }
.exb-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 4px 0; }
.log-bar {
  position: sticky; bottom: 0; z-index: 15; margin: 24px calc(var(--gutter) * -1) 0; padding: 12px var(--gutter) calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--bg) 70%, rgba(10, 15, 13, 0));
  display: flex; gap: 8px; align-items: center;
}
.log-bar .btn-primary { flex: 1; min-height: 52px; font-size: 16px; }
@media (max-width: 767px) { .log-bar { position: fixed; left: 0; right: 0; margin: 0; } }
@media (min-width: 768px) { .log-bar { margin: 24px 0 0; padding: 12px 0; } .log-bar .btn-primary { flex: none; min-width: 220px; } }
.draft-note { font-size: var(--t-1); color: var(--muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }

.picker-list { display: grid; }
.picker-group { font-size: var(--t-1); color: var(--muted); font-weight: 600; padding: 16px 0 4px; }
.picker-item { display: flex; align-items: center; gap: 12px; min-height: 52px; width: 100%; padding: 6px 4px; background: none; border: 0; text-align: left; cursor: pointer; box-shadow: inset 0 -1px 0 var(--line); }
.picker-item:hover { background: rgba(255, 255, 255, .02); }
.picker-item[aria-disabled="true"] { opacity: .45; }
.picker-item .row-main { gap: 2px; }

/* ---------------------------------------------------------------- status */

.status-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.status-tile .stat-v { font-size: var(--t3); }
.status-tile .spark { height: 36px; margin-top: 14px; }
.status-tile .spark svg { width: 100%; height: 36px; }
.meter { height: 6px; border-radius: 999px; background: var(--surface-3); margin-top: 14px; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--volt); border-radius: inherit; transition: width .4s var(--ease); }
.meter.hot i { background: var(--amber); }
.live { display: inline-flex; align-items: center; gap: 8px; font-size: var(--t-1); color: var(--muted); }
.live i { width: 8px; height: 8px; border-radius: 50%; background: var(--volt); animation: pulse 2s infinite; }

/* ---------------------------------------------------------------- login */

.login { min-height: calc(100dvh - 96px); display: grid; align-content: center; justify-items: center; }
.login form { width: min(380px, 100%); display: grid; gap: 16px; }
.login .brand { font-size: 2.2rem; margin-bottom: 20px; justify-content: center; }
.login .brand-mark { width: 34px; height: 34px; }
.login .form-error { text-align: center; margin: 0; }

/* ---------------------------------------------------------------- dialog sheet */

dialog.sheet {
  border: 0; padding: 0; color: var(--text); background: var(--surface);
  width: min(560px, calc(100vw - 32px)); max-height: min(88dvh, 880px);
  border-radius: var(--r-card); box-shadow: inset 0 0 0 1px var(--line);
  overflow: hidden; display: none; flex-direction: column;
}
dialog.sheet[open] { display: flex; animation: sheet-in .22s var(--ease); }
dialog.sheet:focus { outline: none; }
dialog.sheet::backdrop { background: rgba(4, 9, 8, .66); }
.sheet-head { display: flex; align-items: center; gap: 8px; padding: 14px 10px 6px 20px; flex: none; }
.sheet-head h2 { flex: 1; font-size: var(--t1); outline: none; }
.sheet-body { padding: 6px 20px 20px; overflow-y: auto; overscroll-behavior: contain; }
.sheet-foot { padding: 12px 20px calc(16px + env(safe-area-inset-bottom)); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; box-shadow: inset 0 1px 0 var(--line); flex: none; }
@media (max-width: 767px) {
  dialog.sheet { width: 100%; max-width: 100%; margin: auto 0 0; border-radius: var(--r-card) var(--r-card) 0 0; max-height: 92dvh; }
  dialog.sheet[open] { animation: sheet-up .26s var(--ease); }
}

/* ---------------------------------------------------------------- tooltip, toast, skeleton */

#tip {
  position: fixed; z-index: 100; left: 0; top: 0; max-width: min(280px, calc(100vw - 16px));
  padding: 8px 11px; border-radius: 10px; background: var(--surface-3); color: var(--text);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  font-size: 13px; line-height: 1.45; pointer-events: none; opacity: 0; transition: opacity .12s;
  font-variant-numeric: tabular-nums;
}
#tip.on { opacity: 1; }
#tip b { font-weight: 600; }
#tip .muted { font-size: 12px; }

#toasts { position: fixed; z-index: 90; left: 50%; transform: translateX(-50%); bottom: calc(var(--tab-h) + 88px + env(safe-area-inset-bottom)); display: grid; gap: 8px; width: min(420px, calc(100vw - 32px)); pointer-events: none; }
@media (min-width: 768px) { #toasts { bottom: 32px; } }
.toast {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 14px;
  background: var(--surface-3); box-shadow: inset 0 0 0 1px var(--line-strong); font-size: 15px; font-weight: 500;
  animation: toast-in .2s var(--ease);
}
.toast::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--volt); flex: none; }
.toast.error::before { background: var(--danger); }
.toast.out { opacity: 0; transition: opacity .3s; }

.skel { position: relative; overflow: hidden; background: var(--surface); border-radius: 12px; box-shadow: inset 0 0 0 1px var(--line); }
.skel::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .035), transparent); transform: translateX(-100%); animation: shimmer 1.3s infinite; }
.skel.card { border-radius: var(--r-card); }
.skel.line { height: 14px; border-radius: 7px; box-shadow: none; background: var(--surface-2); }
.skel.title { height: 34px; width: 40%; border-radius: 10px; box-shadow: none; background: var(--surface-2); }

@keyframes shimmer { to { transform: translateX(100%); } }
@keyframes view-in { from { opacity: 0; transform: translateY(4px); } }
@keyframes sheet-in { from { opacity: 0; transform: translateY(8px) scale(.99); } }
@keyframes sheet-up { from { transform: translateY(40px); opacity: .4; } }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } }
@keyframes pulse { 50% { opacity: .35; } }

::view-transition-old(root), ::view-transition-new(root) { animation-duration: .16s; animation-timing-function: var(--ease); }
::view-transition-old(root) { animation-name: vt-out; }
::view-transition-new(root) { animation-name: view-in; }
@keyframes vt-out { to { opacity: 0; } }
.rail { view-transition-name: rail; }
.fab { view-transition-name: fab; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}
