:root {
  --bg: #0A0A08; --panel: #13130D; --panel-2: #1B1A10; --panel-3: #11110B; --line: #3A3714; --line-2: #2A2810;
  --yellow: #FCEE0A; --yellow-hi: #FFF68A; --cyan: #00F0FF; --cyan-dim: #1F5A5E; --cyan-bg: #0B1C1D; --red: #FF3B5C; --red-dim: #5A1F2A; --red-bg: #1A0C0F;
  --text: #F3F0DA; --muted: #ABA68A; --dim: #8A856A; --faint: #6B6740;
  --display: 'Chakra Petch', 'Rajdhani', sans-serif; --mono: 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;
  --cut: 12px; --nav-h: 68px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--mono); font-size: 14px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
a { color: var(--yellow); text-decoration: none; }
a:hover { color: var(--yellow-hi); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; letter-spacing: .04em; margin: 0; }
.boot { min-height: 100vh; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- shell ---------- */
.shell { min-height: 100vh; display: flex; }
main { flex: 1; min-width: 0; outline: none; padding-bottom: calc(var(--nav-h) + 24px + env(safe-area-inset-bottom)); }
.sidenav { display: none; }
.bottomnav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); background: var(--bg); border-top: 1px solid var(--line); padding: 8px 6px calc(10px + env(safe-area-inset-bottom)); }
.bottomnav a { display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 44px; color: var(--muted); font-size: 10px; letter-spacing: .08em; }
.bottomnav a.active { color: var(--yellow); font-weight: 700; }
.ico { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: square; stroke-linejoin: miter; flex: none; }
.ico.fill { fill: currentColor; stroke: none; }

@media (min-width: 900px) {
  .bottomnav { display: none; }
  main { padding-bottom: 40px; }
  .sidenav { display: flex; flex-direction: column; gap: 4px; width: 240px; flex: none; border-right: 1px solid var(--line); padding: 22px 16px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
  .brand { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; font-family: var(--display); font-weight: 700; font-size: 22px; letter-spacing: .08em; }
  .side-link { display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 12px; color: var(--muted); font-size: 13px; letter-spacing: .08em; }
  .side-link:hover { color: var(--text); background: var(--panel); }
  .side-link.active { background: var(--yellow); color: var(--bg); font-weight: 700; }
  .side-admin { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
  .side-me { margin-top: auto; display: flex; gap: 10px; align-items: center; padding-top: 14px; border-top: 1px solid var(--line); }
  .side-me div { display: flex; flex-direction: column; min-width: 0; }
  .side-me b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .side-me div span { font-size: 11px; color: var(--muted); }
  .mobile-logo { display: none; }
}

/* ---------- page ---------- */
.page { padding: 16px; max-width: 1180px; display: flex; flex-direction: column; gap: 16px; }
@media (min-width: 900px) { .page { padding: 28px clamp(16px, 3vw, 40px); gap: 22px; } }
.topbar { display: flex; align-items: center; gap: 12px; padding: 16px 16px 4px; max-width: 1180px; }
@media (min-width: 900px) { .topbar { padding: 28px clamp(16px, 3vw, 40px) 0; } }
.topbar-title { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.topbar h1 { font-size: 30px; line-height: 1.05; }
.topbar h1::after { content: '_'; color: var(--yellow); }
@media (min-width: 900px) { .topbar h1 { font-size: 42px; } }
.eyebrow { font-size: 11px; letter-spacing: .16em; color: var(--muted); text-transform: uppercase; }
.eyebrow::before { content: '// '; }
.eyebrow.red { color: var(--red); }
.eyebrow.plain::before { content: ''; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.yellow { color: var(--yellow); } .cyan { color: var(--cyan); } .red { color: var(--red); }
.display { font-family: var(--display); font-weight: 700; letter-spacing: .03em; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.row-end { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.grid-kpi { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.stack-lg { display: flex; flex-direction: column; gap: 16px; }
.cols { display: flex; flex-wrap: wrap; gap: 16px; }
.cols > .col-main { flex: 2 1 420px; min-width: 0; }
.cols > .col-side { flex: 1 1 280px; min-width: 0; }

/* ---------- glitch (transform only) ---------- */
@keyframes glitchT { 0%, 90%, 100% { transform: translate(0, 0) skewX(0); } 91% { transform: translate(3px, 0) skewX(-8deg); } 93% { transform: translate(-2px, 0) skewX(4deg); } 95% { transform: translate(0, 0) skewX(0); } }
@keyframes glitchC { 0%, 86%, 100% { transform: translate(0, 0); } 88% { transform: translate(-4px, 1px); } 90% { transform: translate(3px, -1px); } 92% { transform: translate(-2px, 0); } 94% { transform: translate(0, 0); } }
@keyframes glitchR { 0%, 86%, 100% { transform: translate(0, 0); } 88% { transform: translate(4px, -1px); } 90% { transform: translate(-3px, 1px); } 92% { transform: translate(2px, 0); } 94% { transform: translate(0, 0); } }
.glitch { display: inline-block; animation: glitchT 4.2s steps(1, end) infinite; will-change: transform; }
.logo-mark .g-c { animation: glitchC 3.6s steps(1, end) infinite; }
.logo-mark .g-r { animation: glitchR 3.6s steps(1, end) infinite; }
@media (prefers-reduced-motion: reduce) { .glitch, .logo-mark .g-c, .logo-mark .g-r { animation: none; } }

/* ---------- panels ---------- */
.cut { clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut)); }
.cut-s { --cut: 8px; }
.panel { background: var(--panel); border: 1px solid var(--line); padding: 14px; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 10px; }
.panel.cyan { border: 1.5px solid var(--cyan); background: var(--cyan-bg); }
.panel.red { border: 1.5px solid var(--red); background: var(--red-bg); }
.hazard { height: 7px; width: 60px; background: repeating-linear-gradient(-45deg, var(--yellow) 0 6px, transparent 6px 12px); }
.hero { background: var(--yellow); color: var(--bg); padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.hero .eyebrow { color: var(--bg); font-weight: 700; }
.hero .eyebrow::before { content: ''; }
.hero h2 { font-size: 30px; line-height: 1; }
.hero .chip { border-color: var(--bg); color: var(--bg); }
.alert { border-left: 3px solid var(--yellow); background: #16150A; padding: 10px 12px; font-size: 12.5px; line-height: 1.5; }
.alert-red { border-color: var(--red); background: var(--red-bg); }
.alert-cyan { border-color: var(--cyan); background: var(--cyan-bg); }
.empty { border: 1px dashed var(--line); padding: 22px; text-align: center; color: var(--muted); display: flex; flex-direction: column; gap: 10px; align-items: center; }

/* ---------- controls ---------- */
.btn { --cut: 10px; white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border: 1px solid var(--line); background: transparent; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .08em; cursor: pointer; text-transform: uppercase; }
.btn:hover { color: var(--text); border-color: var(--faint); }
.btn.primary { background: var(--yellow); color: var(--bg); border: 0; font-family: var(--display); font-size: 16px; letter-spacing: .1em; clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut)); }
.btn.primary:hover { background: var(--yellow-hi); }
.btn.outline { border: 1.5px solid var(--yellow); color: var(--yellow); }
.btn.cyan { border: 1.5px solid var(--cyan); color: var(--cyan); }
.btn.cyan.solid { background: var(--cyan); color: var(--bg); }
.btn.danger { border: 1.5px solid var(--red); color: var(--red); }
.btn.danger.solid { background: var(--red); color: var(--bg); border: 0; }
.btn.ghost { border-color: transparent; }
.btn.dark { background: var(--bg); color: var(--yellow); border: 0; font-family: var(--display); font-size: 17px; letter-spacing: .1em; clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut)); }
.btn.block { width: 100%; }
.btn.lg { min-height: 52px; }
.btn.sm { min-height: 34px; padding: 0 10px; font-size: 11px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.icon-btn { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); background: transparent; color: var(--yellow); cursor: pointer; flex: none; }
.icon-btn:hover { border-color: var(--faint); }
.chip { display: inline-flex; align-items: center; font-size: 10px; font-weight: 700; letter-spacing: .08em; padding: 3px 7px; border: 1px solid var(--faint); color: var(--muted); text-transform: uppercase; }
.chip.y { background: var(--yellow); color: var(--bg); border-color: var(--yellow); }
.chip.c { background: var(--cyan); color: var(--bg); border-color: var(--cyan); }
.chip.r { background: var(--red); color: var(--bg); border-color: var(--red); }
.chip.oy { border-color: var(--yellow); color: var(--yellow); }
.chip.oc { border-color: var(--cyan); color: var(--cyan); }
.pills { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.pills::-webkit-scrollbar { display: none; }
.pill { flex: none; height: 34px; padding: 0 12px; border: 1px solid var(--line); background: transparent; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .06em; cursor: pointer; }
.pill[aria-pressed="true"], .pill.on { background: var(--yellow); color: var(--bg); border-color: var(--yellow); }
.tabs { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); border: 1px solid var(--line); }
.tabs button { height: 42px; border: 0; background: transparent; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .1em; cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--yellow); color: var(--bg); }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label { font-size: 11px; letter-spacing: .12em; color: var(--muted); text-transform: uppercase; }
.field .hint { font-size: 11px; color: var(--dim); }
input[type=text], input[type=password], input[type=email], input[type=number], input[type=url], input[type=date], input[type=time], input:not([type]), select, textarea {
  height: 44px; width: 100%; background: var(--panel); border: 1px solid var(--line); color: var(--text); padding: 0 12px; font-size: 14px; border-radius: 0; }
textarea { height: auto; min-height: 80px; padding: 10px 12px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--yellow); }
input::placeholder { color: var(--dim); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
.toggle-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 14px; border-bottom: 1px solid var(--line-2); }
.toggle-row:last-child { border-bottom: 0; }
.toggle-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.toggle-text b { font-size: 13px; }
.toggle-text span { font-size: 11px; color: var(--muted); }
.switch { width: 52px; height: 28px; flex: none; position: relative; border: 1px solid var(--line); background: var(--panel); cursor: pointer; padding: 0; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; background: var(--faint); transition: transform .15s ease-out; }
.switch[aria-checked="true"] { background: var(--yellow); border-color: var(--yellow); }
.switch[aria-checked="true"]::after { transform: translateX(24px); background: var(--bg); }
.list-box { border: 1px solid var(--line); }
.copy-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; border: 1px dashed var(--line); padding: 10px 12px; }
.copy-row code { flex: 1; min-width: 200px; color: var(--cyan); font-size: 13px; word-break: break-all; }

/* ---------- avatars ---------- */
.avatar { object-fit: cover; flex: none; background: var(--panel); }
.avatar-txt { display: inline-flex; align-items: center; justify-content: center; background: var(--yellow); color: var(--bg); font-family: var(--display); font-weight: 700; clip-path: polygon(20% 0, 100% 0, 100% 80%, 80% 100%, 0 100%, 0 20%); }

/* ---------- today ---------- */
.week-strip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.week-day { display: flex; flex-direction: column; align-items: center; gap: 5px; font-size: 10px; color: var(--muted); }
.week-day .box { width: 100%; height: 34px; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; }
.box.done { background: var(--yellow); color: var(--bg); }
.box.today { border: 1.5px solid var(--yellow); color: var(--yellow); }
.box.plan { border: 1px dashed var(--faint); color: var(--muted); }
.box.miss { border: 1px solid var(--red-dim); color: var(--red); }
.box.off { background: var(--panel); color: var(--faint); }
.swap-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.swap { text-align: left; background: var(--panel); border: 1px solid var(--line); padding: 10px; display: flex; flex-direction: column; gap: 3px; cursor: pointer; min-height: 56px; }
.swap:hover { border-color: var(--faint); }
.swap b { font-family: var(--display); font-size: 14px; letter-spacing: .03em; }
.swap span { font-size: 10px; color: var(--muted); }
.act-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: var(--panel); border: 1px solid var(--line); }
.act-ico { width: 38px; height: 38px; border: 1.5px solid var(--cyan); color: var(--cyan); display: flex; align-items: center; justify-content: center; flex: none; }
.act-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.act-body b { font-size: 12.5px; }
.act-body span { font-size: 11px; color: var(--muted); }

/* ---------- workout ---------- */
.progress-segs { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; }
.progress-segs span { height: 4px; background: var(--line); }
.progress-segs span.done { background: var(--yellow); }
.progress-segs span.cur { background: var(--yellow); opacity: .55; }
.ex-card { background: var(--panel-3); border: 1px solid var(--line); display: flex; flex-direction: column; }
.ex-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 12px 12px 0; }
.ex-card-head h2 { font-size: 23px; line-height: 1.05; }
.ex-split { display: flex; align-items: stretch; flex-wrap: wrap; }
.ex-split .anim-box { flex: 1 1 180px; max-width: 260px; }
.ex-split .cues { flex: 1 1 160px; display: flex; flex-direction: column; gap: 7px; padding: 6px 12px 12px; min-width: 0; }
.cue { display: flex; gap: 8px; font-size: 11px; line-height: 1.4; }
.cue b { flex: none; }
.set-head, .set-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) 72px 60px 48px; gap: 6px; align-items: center; }
.set-head { font-size: 10px; letter-spacing: .12em; color: var(--muted); padding: 0 4px; }
.set-row { padding: 4px; }
.set-row.done { background: var(--panel-2); }
.set-row.next { outline: 1px solid var(--yellow); }
.set-row .n { font-family: var(--display); font-weight: 700; font-size: 16px; }
.set-row .prev { font-size: 12px; color: var(--muted); }
.set-row input { height: 38px; text-align: center; padding: 0 4px; background: var(--bg); }
.set-check { width: 48px; height: 38px; border: 1px solid var(--line); background: transparent; color: var(--faint); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.set-check.on { background: var(--yellow); color: var(--bg); border-color: var(--yellow); }
.rest { border: 1.5px solid var(--cyan); padding: 10px 12px; display: flex; align-items: center; gap: 12px; }
.rest .t { font-family: var(--display); font-weight: 700; font-size: 26px; color: var(--cyan); }
.rest .bar { height: 4px; background: #0E2A2C; overflow: hidden; }
.rest .bar > div { height: 4px; background: var(--cyan); transform-origin: 0 50%; }
.item-list { display: flex; flex-direction: column; gap: 6px; }
.item-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; background: var(--panel); border: 1px solid var(--line-2); cursor: pointer; text-align: left; width: 100%; color: var(--text); }
.item-row.cur { border-color: var(--yellow); }
.item-row.done { opacity: .6; }
.item-row.skip { opacity: .45; text-decoration: line-through; }
.item-row .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.item-row b { font-family: var(--display); font-size: 15px; letter-spacing: .02em; }
.item-row span { font-size: 11px; color: var(--muted); }
.block-label { font-size: 10px; font-weight: 700; letter-spacing: .12em; color: var(--bg); background: var(--cyan); padding: 3px 8px; align-self: flex-start; }
.wake { font-size: 10px; color: var(--dim); }

/* ---------- animation player ---------- */
.anim-box { position: relative; background: var(--panel-3); }
.anim svg { display: block; width: 100%; height: auto; max-height: 360px; }
.phase-label { position: relative; height: 18px; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; }
.phase-label .ph { position: absolute; inset: 0; opacity: 0; white-space: nowrap; }
.ph-yellow { color: var(--yellow); } .ph-cyan { color: var(--cyan); } .ph-red { color: var(--red); }
.anim-progress { height: 4px; background: var(--line-2); overflow: hidden; position: relative; }
.anim-progress > div { position: absolute; inset: 0; background: var(--yellow); opacity: .85; transform-origin: 0 50%; will-change: transform; }
.anim-segs { display: flex; font-size: 9px; color: var(--dim); margin-top: 3px; letter-spacing: .04em; }
.anim-segs span { white-space: nowrap; overflow: hidden; }
.anim-segs .seg-red { color: var(--red); }
.anim-controls { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; padding: 8px 12px 10px; }
.anim-controls .btn { min-height: 32px; padding: 0 9px; font-size: 10px; }
.anim-controls .play { width: 40px; min-height: 32px; background: var(--yellow); color: var(--bg); border: 0; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.anim-empty { aspect-ratio: 4 / 3; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--dim); font-size: 11px; letter-spacing: .1em; }
.checkpoints { display: flex; flex-direction: column; gap: 7px; }
.checkpoint { display: flex; gap: 9px; align-items: flex-start; font-size: 12px; line-height: 1.4; }
.badge-n { flex: none; width: 18px; height: 18px; border-radius: 50%; background: var(--yellow); color: var(--bg); font-weight: 700; font-size: 10px; display: flex; align-items: center; justify-content: center; }
.badge-n.cyan { background: var(--cyan); }

/* ---------- library ---------- */
.lib-row { display: flex; align-items: center; gap: 6px; background: var(--panel); border: 1px solid var(--line-2); min-height: 54px; }
.lib-row.sel { background: var(--panel-2); border-color: var(--yellow); }
.lib-check { width: 44px; align-self: stretch; display: flex; align-items: center; justify-content: center; background: transparent; border: 0; cursor: pointer; flex: none; }
.lib-check span { width: 20px; height: 20px; border: 1.5px solid var(--faint); display: flex; align-items: center; justify-content: center; color: var(--bg); }
.lib-row.sel .lib-check span { background: var(--yellow); border-color: var(--yellow); }
.lib-thumb { width: 42px; height: 42px; border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; flex: none; overflow: hidden; background: var(--panel-3); }
.lib-thumb svg { width: 40px; height: 40px; }
.lib-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; padding: 8px 0; color: var(--text); }
.lib-main b { font-family: var(--display); font-size: 15px; letter-spacing: .02em; }
.lib-main span { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lib-tag { font-size: 10px; font-weight: 700; color: var(--cyan); letter-spacing: .06em; flex: none; }
.lib-open { width: 40px; align-self: stretch; display: flex; align-items: center; justify-content: center; flex: none; }
.selbar { position: fixed; left: 12px; right: 12px; bottom: calc(var(--nav-h) + 12px + env(safe-area-inset-bottom)); z-index: 15; background: var(--yellow); color: var(--bg); display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px; clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px); }
.selbar span { flex: 1; font-size: 12px; font-weight: 700; }
.selbar button { min-height: 40px; }
@media (min-width: 900px) { .selbar { left: 264px; bottom: 20px; max-width: 760px; } }

/* ---------- builder ---------- */
.block { border: 1px solid var(--line); background: var(--panel); }
.block.superset { border: 1.5px solid var(--cyan); background: transparent; }
.block-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 5px 10px; font-size: 10px; font-weight: 700; letter-spacing: .12em; }
.block.superset .block-head { background: var(--cyan); color: var(--bg); }
.block-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; padding: 10px; border-top: 1px solid var(--line-2); align-items: center; }
.block-item:first-of-type { border-top: 0; }
.block-item b { font-family: var(--display); font-size: 15px; }
.nums { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-top: 8px; grid-column: 1 / -1; }
.nums label { font-size: 9px; letter-spacing: .1em; color: var(--muted); display: flex; flex-direction: column; gap: 3px; }
.nums input { height: 36px; padding: 0 6px; text-align: center; }
.day-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.day-btn { height: 44px; border: 1px solid var(--line); background: transparent; color: var(--muted); font-size: 11px; font-weight: 700; cursor: pointer; }
.day-btn.has { border-color: var(--faint); color: var(--text); }
.day-btn[aria-pressed="true"] { background: var(--yellow); color: var(--bg); border-color: var(--yellow); }
.radio-opt { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); background: transparent; cursor: pointer; width: 100%; text-align: left; color: var(--text); min-height: 48px; }
.radio-opt[aria-pressed="true"] { border: 1.5px solid var(--yellow); background: var(--panel-2); }
.radio-opt .dot { width: 12px; height: 12px; border: 1.5px solid var(--faint); flex: none; }
.radio-opt[aria-pressed="true"] .dot { background: var(--yellow); border-color: var(--yellow); }
.radio-opt b { font-size: 13px; display: block; }
.radio-opt span.s { font-size: 11px; color: var(--muted); }

/* ---------- leaderboard ---------- */
.podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; align-items: end; }
.podium > div { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.podium .who { font-size: 11px; font-weight: 700; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium .step { width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.podium .step b { font-family: var(--display); font-size: 26px; }
.podium .step span { font-size: 10px; }
.podium .p1 .step { height: 96px; background: var(--yellow); color: var(--bg); }
.podium .p2 .step { height: 70px; background: var(--panel); border: 1px solid var(--cyan-dim); color: var(--cyan); }
.podium .p3 .step { height: 54px; background: var(--panel); border: 1px solid var(--red-dim); color: var(--red); }
.lb-head, .lb-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) 76px 64px; gap: 8px; align-items: center; padding: 0 10px; }
.lb-head { font-size: 10px; letter-spacing: .12em; color: var(--muted); }
.lb-row { height: 44px; background: var(--panel); border: 1px solid var(--line-2); font-size: 13px; }
.lb-row.me { background: var(--panel-2); outline: 1.5px solid var(--yellow); color: var(--yellow); }
.lb-row .r { font-family: var(--display); font-weight: 700; font-size: 15px; }
.lb-row .n { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- stats ---------- */
.kpi { background: var(--panel); border: 1px solid var(--line); padding: 14px; display: flex; flex-direction: column; gap: 3px; }
.kpi b { font-family: var(--display); font-size: 30px; line-height: 1.1; }
.kpi span { font-size: 11px; color: var(--muted); }
.bars { position: relative; height: 170px; display: flex; align-items: flex-end; gap: 6px; border-bottom: 1px solid var(--line); }
.bars .col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; height: 100%; min-width: 0; }
.bars .col span { font-size: 10px; color: var(--muted); }
.bars .col div { width: 100%; max-width: 40px; background: var(--faint); }
.bars .col div.met { background: var(--yellow); }
.bars .col div.cur { background: var(--cyan); }
.bars .goal { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--yellow); opacity: .6; }
.bar-labels { display: flex; gap: 6px; }
.bar-labels span { flex: 1; text-align: center; font-size: 9px; color: var(--muted); min-width: 0; overflow: hidden; }
.kv { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; border-bottom: 1px solid var(--line-2); padding: 8px 0; }
.kv:last-child { border-bottom: 0; }
.kv b { font-family: var(--display); font-size: 18px; color: var(--yellow); white-space: nowrap; }
.table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.table th { text-align: left; font-size: 10px; letter-spacing: .12em; color: var(--muted); font-weight: 400; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.table td { padding: 10px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); }

/* ---------- settings ---------- */
.settings { display: flex; flex-wrap: wrap; min-height: calc(100vh - 0px); }
.settings-nav { flex: 1 1 200px; max-width: 240px; min-width: 180px; border-right: 1px solid var(--line); padding: 22px 14px; display: flex; flex-direction: column; gap: 4px; }
.settings-nav a { display: flex; justify-content: space-between; align-items: center; gap: 8px; height: 44px; padding: 0 12px; color: var(--muted); font-size: 12px; letter-spacing: .08em; }
.settings-nav a.active { background: var(--yellow); color: var(--bg); font-weight: 700; }
.settings-nav a .st { font-size: 9px; font-weight: 700; }
.settings-body { flex: 999 1 520px; min-width: 0; }
@media (max-width: 700px) { .settings-nav { max-width: none; border-right: 0; border-bottom: 1px solid var(--line); flex-direction: row; overflow-x: auto; padding: 10px 12px; } .settings-nav a { flex: none; } .settings-nav .eyebrow { display: none; } }

/* ---------- login ---------- */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 40px 20px; }
.auth-card { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 22px; }
.auth-logo { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.auth-logo span { font-family: var(--display); font-weight: 700; font-size: 34px; letter-spacing: .08em; color: var(--yellow); }
.or { display: flex; align-items: center; gap: 10px; color: var(--faint); font-size: 11px; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.strength { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
.strength span { height: 4px; background: var(--line); }
.strength span.on { background: var(--cyan); }
.step-link { display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); padding: 12px; color: var(--text); }
.step-link.first { border: 1.5px solid var(--yellow); }
.step-link .num { font-family: var(--display); font-weight: 700; font-size: 20px; color: var(--muted); }
.step-link.first .num { color: var(--yellow); }
.step-link .t { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.step-link .t span { font-size: 11px; color: var(--muted); }
.step-link .ok { color: var(--cyan); font-size: 10px; font-weight: 700; }

/* ---------- sheet & toast ---------- */
dialog.sheet { border: 0; padding: 0; margin: auto auto 0; width: 100%; max-width: 560px; background: var(--panel); color: var(--text); border-top: 2px solid var(--yellow); max-height: 88vh; }
dialog.sheet.wide { max-width: 760px; }
dialog.sheet::backdrop { background: rgba(10, 10, 8, .78); }
@media (min-width: 900px) { dialog.sheet { margin: auto; border: 1px solid var(--line); border-top: 2px solid var(--yellow); } }
.sheet-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 16px 16px 0; }
.sheet-head h2 { font-size: 22px; }
.sheet-body { padding: 14px 16px 22px; display: flex; flex-direction: column; gap: 14px; overflow-y: auto; max-height: calc(88vh - 70px); }
.toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 20px); transform: translate(-50%, 20px); opacity: 0; transition: opacity .2s, transform .2s; z-index: 50; padding: 12px 16px; font-size: 12.5px; font-weight: 700; max-width: calc(100vw - 32px); pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast-ok { border: 1.5px solid var(--cyan); background: var(--cyan-bg); color: var(--cyan); }
.toast-error { border: 1.5px solid var(--red); background: var(--red-bg); color: var(--red); }
@media (min-width: 900px) { .toast { bottom: 28px; } }
@media (min-width: 900px) { .hide-wide { display: none !important; } }
main:focus, main:focus-visible { outline: none; }
