:root {
  color-scheme: dark;
  --bg:#171719; --panel:#1f1f22; --raised:#252528; --border:#343437;
  --ink:#f6f3f0; --muted:#bcb8b7; --soft:#969195; --accent:#ff6368; --red:#cf202b;
  --line:#3e3b3d; --radius:15px;
  font: 16px/1.48 "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin:0; background:var(--bg); color:var(--ink); min-width:320px; }
button,input,select { font:inherit; }
button,a,input,select,summary { -webkit-tap-highlight-color:transparent; }
button { cursor:pointer; }
button:disabled { opacity:.5; cursor:wait; }
a { color:inherit; }
:focus-visible { outline:2px solid #ff8589; outline-offset:4px; }
img { max-width:100%; display:block; }
h1,h2,h3,p { margin:0; }
h2 { font-size:1.3rem; line-height:1.22; letter-spacing:-.032em; }
h3 { font-size:1rem; }
svg { flex:none; }
.skip-link { position:fixed; left:12px; top:12px; z-index:10; padding:10px; background:#fff; color:#111; transform:translateY(-150%); }
.skip-link:focus { transform:none; }
.loading { padding:12vh 24px; text-align:center; color:var(--muted); }
.wrap { width:min(1160px, calc(100% - 52px)); margin-inline:auto; }
.topbar { border-bottom:1px solid #303033; background:#1a1a1c; }
.topbar-inner { display:flex; min-height:76px; align-items:center; gap:28px; }
.brand { display:flex; align-items:center; gap:11px; text-decoration:none; flex:none; }
.brand img { width:41px; height:41px; object-fit:contain; border-radius:50%; }
.brand strong { display:block; font-size:.97rem; line-height:1.15; letter-spacing:-.015em; }
.brand small { color:var(--muted); display:block; font-size:.78rem; margin-top:4px; }
.nav { align-self:stretch; display:flex; gap:8px; margin-left:12px; }
.nav button { border:0; border-bottom:2px solid transparent; background:transparent; color:var(--muted); font-weight:650; padding:2px 15px 0; white-space:nowrap; }
.nav button:hover,.nav button[aria-current] { color:var(--ink); }
.nav button[aria-current] { border-bottom-color:var(--accent); }
.account { margin-left:auto; display:flex; align-items:center; gap:10px; white-space:nowrap; }
.avatar { min-width:35px; height:35px; display:grid; place-items:center; border:1px solid #6a3035; border-radius:9px; color:#ff9296; background:#412326; padding:0 6px; font-size:.8rem; font-weight:800; }
.icon-btn { display:inline-grid; place-items:center; color:var(--muted); border:1px solid var(--border); border-radius:8px; background:transparent; width:37px; height:37px; }
.icon-btn:hover { color:var(--ink); background:var(--raised); }
.main { padding:30px 0 50px; }
.hero { position:relative; isolation:isolate; min-height:280px; overflow:hidden; border:1px solid #454144; border-radius:18px; display:flex; align-items:center; background:#222125; }
.hero::before,.hero::after { content:""; position:absolute; inset:0; z-index:-1; }
.hero::before { background:url("/rink.jpg") center 45%/cover no-repeat; }
.hero::after { background:linear-gradient(90deg,#171719 0%,#171719ed 21%,#1717199c 46%,#17171919 79%),linear-gradient(0deg,#19191b80,transparent 43%); }
.hero-copy { padding:29px 38px; max-width:690px; }
.eyebrow { display:flex; align-items:center; gap:8px; color:var(--accent); font-weight:800; text-transform:uppercase; letter-spacing:.13em; font-size:.78rem; }
.hero h1,.page-title,.login h1 { font-family:"Arial Black","Segoe UI",system-ui,sans-serif; font-weight:950; font-size:clamp(2.2rem,5.5vw,4rem); letter-spacing:-.075em; line-height:.98; margin:10px 0 13px; }
.hero h1 { font-style:italic; overflow-wrap:anywhere; }
.hero p { color:#e1dcda; max-width:390px; font-size:1.06rem; }
.start-workout { min-height:53px; padding-inline:22px; margin-top:18px; font-size:1.06rem; }
.dashboard-links { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; margin-top:16px; }
.dashboard-link { display:flex; align-items:center; gap:12px; color:var(--ink); text-align:left; }
.dashboard-link:hover { background:var(--raised); border-color:#625052; }
.dashboard-link strong,.dashboard-link small { display:block; }
.dashboard-link small { color:var(--muted); margin-top:2px; }
.workout-page { max-width:680px; margin-inline:auto; }
.workout-page .section-head p { margin-top:5px; }
.tag { border:1px solid var(--line); padding:4px 8px; color:var(--muted); border-radius:7px; font-size:.78rem; font-weight:700; white-space:nowrap; }
.tag.hot { background:#442427; color:#ff9ca0; border-color:#6b3639; }
.grid { display:grid; grid-template-columns:minmax(0,1.65fr) minmax(0,1fr); gap:20px; margin-top:20px; align-items:start; }
.progress-grid .progress-sidebar { grid-area:1 / 2; }
.progress-grid .progress-history { grid-area:1 / 1; }
.stack { display:grid; gap:17px; min-width:0; }
.panel { background:var(--panel); border:1px solid var(--border); border-radius:var(--radius); padding:20px; min-width:0; }
.panel-head,.section-head,.spread { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.panel-head { margin-bottom:14px; }
.section-head { margin:0 0 16px; flex-wrap:wrap; }
.section-head h1 { margin:0; }
.subtle { color:var(--muted); }
.small { font-size:.88rem; }
.mini { font-size:.8rem; }
.meta { color:var(--muted); font-size:.88rem; margin-top:4px; }
.dot { display:inline-block; width:7px; height:7px; border-radius:50%; background:var(--accent); }
.glyph { display:grid; place-items:center; width:34px; height:34px; border-radius:9px; color:#ff8f94; background:#3a2527; border:1px solid #533336; }
.head-label { display:flex; gap:10px; align-items:center; }
.warmup { display:grid; grid-template-columns:39px 1fr; gap:11px; border:1px solid #4a3538; border-radius:11px; background:#2a2224; padding:15px; }
.warmup .glyph { width:37px; height:37px; }
.warmup p { color:var(--muted); margin-top:4px; }
.fold summary { cursor:pointer; color:var(--ink); font-weight:750; }
.fold summary::marker { color:var(--accent); }
.fold[open] summary { margin-bottom:6px; }
.fold p { color:var(--muted); font-size:.9rem; }
.set-block { border:1px solid var(--border); border-radius:11px; overflow:hidden; margin:0 0 11px; }
.set-head { display:flex; justify-content:space-between; align-items:center; gap:8px; padding:9px 12px; background:#29292c; }
.set-head .tag { border:0; padding:1px 0; }
.set-block > summary::after { content:"+"; color:var(--accent); font-size:1.1em; }
.set-block[open] > summary { margin-bottom:0; }
.set-block[open] > summary::after { content:"−"; }
.exercise-row { display:flex; justify-content:space-between; align-items:center; gap:8px; padding:8px 11px; min-height:54px; }
.exercise-row + .exercise-row { border-top:1px solid #313134; }
.exercise-row label { font-weight:700; font-size:.91rem; line-height:1.16; }
.exercise-row label span { color:var(--muted); display:block; font-weight:500; margin-top:3px; font-size:.8rem; }
.counter { display:flex; align-items:center; gap:4px; flex:none; }
.counter button,.counter input { color:var(--ink); background:#2b2b2e; border:1px solid #414145; border-radius:7px; height:44px; text-align:center; }
.counter button { width:44px; display:grid; place-items:center; }
.counter button:hover { background:#413439; }
.counter input { width:46px; padding:0 1px; font-weight:800; font-variant-numeric:tabular-nums; appearance:textfield; }
.counter input::-webkit-inner-spin-button,.counter input::-webkit-outer-spin-button { appearance:none; margin:0; }
.actions { display:flex; gap:9px; align-items:center; flex-wrap:wrap; }
.btn { min-height:43px; border-radius:8px; border:1px solid transparent; color:white; background:var(--red); padding:8px 15px; font-weight:750; display:inline-flex; align-items:center; justify-content:center; gap:7px; text-decoration:none; }
.btn:hover { background:#e02b36; }
.btn.secondary { background:var(--raised); color:var(--ink); border-color:var(--border); }
.btn.secondary:hover { background:#343437; }
.btn.ghost { background:transparent; color:var(--muted); border-color:var(--border); }
.btn.ghost:hover { color:var(--ink); background:var(--raised); }
.btn.compact { font-size:.85rem; min-height:35px; padding:4px 9px; }
.btn.full { width:100%; }
.workout .actions { margin-top:13px; }
.workout-save { display:grid; gap:6px; margin-top:14px; text-align:center; }
.workout-save .btn { min-height:49px; }
.saved { color:#f2cb94; font-weight:700; font-size:.87rem; }
.stats { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:7px; }
.stat { min-width:0; background:#262629; border:1px solid #343437; border-radius:9px; padding:9px 8px; }
.stat strong { display:block; font-size:clamp(1.04rem,2.3vw,1.55rem); letter-spacing:-.04em; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
.stat span { color:var(--muted); font-size:.8rem; line-height:1.1; display:block; margin-top:1px; }
.numline { margin:9px 0 9px; color:var(--muted); font-size:.9rem; }
.numline b { color:var(--ink); font-size:1.7rem; letter-spacing:-.05em; }
progress { display:block; width:100%; height:9px; border:0; border-radius:99px; background:#3a373a; overflow:hidden; appearance:none; }
progress::-webkit-progress-bar { background:#3a373a; }
progress::-webkit-progress-value { background:#ed3d46; border-radius:99px; }
progress::-moz-progress-bar { background:#ed3d46; border-radius:99px; }
.team-panel .spread:last-child { margin-top:10px; }
.weekrow { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:5px; text-align:center; }
.daytile { color:var(--muted); font-size:.74rem; min-width:0; }
.daytile i { background:#29292c; border:1px solid var(--border); width:100%; aspect-ratio:1.05; border-radius:8px; display:grid; place-items:center; margin-top:4px; font-style:normal; font-weight:750; }
.daytile.partial i { color:#ffd096; background:#493426; border-color:#6e4c32; }
.daytile.complete i { color:#ffa5a8; background:#4b2529; border-color:#823a42; }
.daytile.today i { outline:1px solid #bf7980; outline-offset:1px; }
.legend { display:flex; flex-wrap:wrap; gap:5px 12px; margin-top:10px; color:var(--muted); font-size:.79rem; }
.legend span::before { content:""; display:inline-block; width:8px; height:8px; border-radius:2px; background:#5b5558; margin-right:5px; }
.legend .partial::before { background:#d49a59; }
.legend .complete::before { background:#ee5e65; }
.badges { display:grid; gap:8px; }
.badge { display:flex; align-items:center; gap:10px; border:1px solid var(--border); border-radius:10px; padding:10px; }
.badge .glyph { border-radius:10px; width:39px; height:39px; flex:none; }
.badge.locked .glyph { color:#aaa3a6; background:#29292b; border-color:#424245; }
.badge.earned { background:linear-gradient(105deg,#392d24,#272322 75%); border-color:#69503a; }
.badge.earned .glyph { color:#ffcd85; background:#48321d; border-color:#84603a; }
.badge p { font-size:.84rem; color:var(--muted); }
.badge small { display:flex; flex:none; align-items:center; gap:4px; margin-left:auto; color:var(--muted); font-size:.78rem; }
.badge.earned small { color:#ffce91; }
.cool-list { display:grid; gap:7px; padding-left:0; margin:11px 0 14px; list-style:none; }
.cool-list li { display:grid; grid-template-columns:28px 1fr; align-items:center; gap:8px; }
.cool-list svg { color:var(--accent); }
.chart { min-height:164px; display:grid; grid-template-columns:repeat(14,minmax(0,1fr)); gap:5px; align-items:end; }
.chart-col { display:grid; grid-template-rows:135px auto; align-items:end; text-align:center; min-width:0; font-size:.72rem; color:var(--muted); }
.chart-stick { position:relative; height:130px; }
.chart-col progress { position:absolute; width:122px; height:clamp(8px,2vw,20px); top:50%; left:50%; transform:translate(-50%,-50%) rotate(-90deg); background:#303033; }
.chart-col progress::-webkit-progress-bar { background:#303033; }
.chart-col b { font-size:.72rem; color:var(--muted); }
.chart-shell { margin-top:15px; }
.log-list,.roster { padding:0; margin:0; list-style:none; }
.log-list li,.roster li { border-top:1px solid var(--border); padding:10px 0; }
.log-list li:first-child,.roster li:first-child { border-top:0; }
.log-list ul { margin:7px 0 0; padding-left:20px; }
.control,.field input,.field select { background:#29292c; color:var(--ink); border:1px solid #4a484c; border-radius:8px; min-height:41px; padding:7px 9px; min-width:0; }
.field { display:grid; gap:4px; margin:0; color:var(--muted); font-size:.88rem; min-width:0; }
.field input,.field select { width:100%; font-size:1rem; }
.fields { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:11px; margin:10px 0 12px; }
.fields.three { grid-template-columns:repeat(3,minmax(0,1fr)); }
.form { display:grid; gap:9px; }
.form .fields { margin:0; }
.login { display:grid; place-items:center; min-height:100svh; padding:22px; background:radial-gradient(ellipse at 57% 20%,#332327,transparent 55%),var(--bg); }
.login-card { width:min(480px,100%); background:var(--panel); border:1px solid var(--border); border-radius:19px; padding:28px; }
.login-card img { width:72px; border-radius:50%; margin-bottom:17px; }
.login h1 { font-size:clamp(2rem,9vw,3.3rem); margin-bottom:11px; }
.login .form,.login .actions { margin-top:18px; }
.login .hint { margin-top:12px; }
.login .demo { border-top:1px solid var(--border); margin-top:22px; padding-top:15px; }
.link-field { display:flex; gap:8px; margin-top:12px; }
.link-field input { flex:1; min-width:0; }
dialog { background:var(--panel); color:var(--ink); border:1px solid #604044; border-radius:16px; width:min(480px,calc(100% - 28px)); padding:23px; max-height:85svh; }
dialog::backdrop { background:#08080bd9; }
dialog h2 { margin:8px 0; }
dialog p { margin:8px 0; }
dialog .actions { margin-top:15px; }
.celebrate { border-color:#866042; background:radial-gradient(ellipse at top,#4b2a26 0%,var(--panel) 62%); text-align:center; }
.celebrate .eyebrow { justify-content:center; color:#ffce91; }
.celebrate h2 { font-size:clamp(1.7rem,7vw,2.25rem); }
.celebrate p { color:#ded8d4; }
.celebrate .badges { text-align:left; margin-top:12px; }
.celebrate form { margin-top:18px; }
.celebrate-art { position:relative; width:148px; height:91px; margin:0 auto; display:grid; place-items:center; }
.celebrate-art .glyph {
  position:relative; width:70px; height:70px; border-radius:18px; color:#ffdb9e; background:#4d3324;
  border:1px solid #ae784e; box-shadow:0 0 30px #ffbc5630; animation:badge-arrive 460ms ease-out both;
}
.celebrate-art .glyph svg { width:35px; height:35px; }
.sparks { position:absolute; inset:0; pointer-events:none; }
.sparks i { position:absolute; width:7px; height:7px; background:#ffc977; border-radius:1px; opacity:.7; animation:spark-arrive 650ms ease-out both; transform:rotate(30deg); }
.sparks i:nth-child(1) { top:15%; left:10%; }
.sparks i:nth-child(2) { top:52%; left:3%; background:#ff777c; }
.sparks i:nth-child(3) { top:81%; left:19%; width:5px; height:5px; }
.sparks i:nth-child(4) { top:8%; right:15%; width:6px; height:6px; }
.sparks i:nth-child(5) { top:43%; right:4%; background:#ff777c; }
.sparks i:nth-child(6) { top:79%; right:17%; width:5px; height:5px; }
@keyframes badge-arrive {
  from { opacity:0; transform:translateY(8px) scale(.8); }
  65% { opacity:1; transform:translateY(-2px) scale(1.04); }
  to { opacity:1; transform:none; }
}
@keyframes spark-arrive {
  from { opacity:0; transform:translateY(8px) rotate(10deg) scale(.2); }
  to { opacity:.7; transform:rotate(30deg); }
}
#notice:not(:empty) { position:fixed; bottom:16px; left:50%; transform:translateX(-50%); z-index:9; padding:10px 15px; border-radius:9px; border:1px solid #625052; background:#2e2326; color:var(--ink); width:max-content; max-width:calc(100% - 30px); box-shadow:0 8px 24px #0006; }
.error { color:#ff9da2; }
.empty { color:var(--muted); padding:8px 0; }
@media(max-width:850px) {
  .topbar-inner { gap:12px; }
  .nav { margin-left:0; gap:1px; }
  .nav button { padding-inline:9px; }
  .account .account-name { display:none; }
  .grid { grid-template-columns:minmax(0,1.4fr) minmax(0,1fr); gap:12px; }
  .panel { padding:15px; }
}
@media(max-width:650px) {
  .wrap { width:calc(100% - 24px); }
  .topbar-inner { flex-wrap:wrap; column-gap:12px; row-gap:0; padding-top:9px; min-height:0; }
  .brand { flex:1; }
  .brand img { width:37px; height:37px; }
  .account { order:1; }
  .nav { order:2; flex-basis:100%; justify-content:space-between; margin-top:3px; }
  .nav button { flex:1; min-height:43px; padding-inline:5px; font-size:.9rem; }
  .main { padding-top:14px; }
  .hero { min-height:225px; border-radius:13px; }
  .hero::before { background-position:69% 45%; }
  .hero::after { background:linear-gradient(90deg,#171719f5 0%,#171719bc 34%,#17171945 78%); }
  .hero-copy { padding:19px 17px; }
  .hero p { max-width:240px; font-size:.9rem; }
  .dashboard-links { grid-template-columns:minmax(0,1fr); gap:9px; margin-top:12px; }
  .dashboard-link { min-height:61px; }
  .grid { grid-template-columns:minmax(0,1fr); margin-top:12px; }
  .progress-grid .progress-sidebar,.progress-grid .progress-history { grid-area:auto; }
  .stack { gap:12px; }
  .panel { padding:14px; }
  .page-title { font-size:2.25rem; }
}
@media(prefers-reduced-motion:reduce) {
  *, *::before, *::after { scroll-behavior:auto !important; animation:none !important; transition:none !important; }
}
