/* Colours come from the XP Training logo: lime X (weights), off-white P (Pilates), on a dark ground. */
:root {
  --bg:#101210; --surface:#1A1D19; --raised:#252923; --line:#363B33; --ink:#F2F3EF; --muted:#A9AFA3;
  --w:#CDF270; --w-soft:#2B3417; --w-on:#141A06;
  --p:#F2F2F2; --p-soft:#30322F; --p-on:#141513;
  --warn:#F2C166; --warn-soft:#3A2D13; --bad:#FF8F85; --bad-soft:#42201C;
  --scrim:rgba(0,0,0,.68);
  --display:"Sofia Sans Extra Condensed","Arial Narrow",Arial,sans-serif;
  --body:"Commissioner","Segoe UI",Roboto,Arial,sans-serif;
  --d:var(--w); --d-soft:var(--w-soft); --d-on:var(--w-on);
  color-scheme:dark;
  padding-top:env(safe-area-inset-top,0px);
}
* { box-sizing:border-box; }
body { margin:0; background:var(--bg); color:var(--ink); font:400 15px/1.45 var(--body); }
button,input,select { font:inherit; color:inherit; }
button { cursor:pointer; }
button:disabled { opacity:.5; cursor:default; }
:focus-visible { outline:2px solid var(--d); outline-offset:2px; }
h1,h2,h3,p { margin:0; }
[hidden] { display:none !important; }
a { color:var(--d); }
.d-w { --d:var(--w); --d-soft:var(--w-soft); --d-on:var(--w-on); }
.d-p { --d:var(--p); --d-soft:var(--p-soft); --d-on:var(--p-on); }

.wrap { max-width:560px; margin:0 auto; padding-block:12px 96px; padding-left:max(16px,env(safe-area-inset-left,0px)); padding-right:max(16px,env(safe-area-inset-right,0px)); display:grid; gap:14px; }
.wrap > * { min-width:0; }
.wrap.bare { padding-bottom:32px; }
.wrap.wide { max-width:820px; }
.linkbtn { background:none; border:0; padding:4px 0; color:var(--muted); text-decoration:underline; font-size:13px; }
.seg { display:grid; grid-auto-flow:column; grid-auto-columns:1fr; gap:3px; padding:3px; background:var(--raised); border:1px solid var(--line); border-radius:10px; }
.seg button { border:0; background:none; padding:8px 4px; border-radius:7px; font-weight:600; font-size:14px; color:var(--muted); }
.seg button[aria-pressed="true"] { background:var(--surface); color:var(--ink); box-shadow:0 1px 2px rgba(0,0,0,.3); }
.seg.big button { padding:11px 4px; font-size:16px; }
.seg.big button[aria-pressed="true"] { background:var(--d); color:var(--d-on); }

.top { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.logo { display:block; flex:none; }
.logo svg { display:block; height:62px; width:auto; }
.hello { color:var(--muted); font-size:14px; text-align:right; }
h1.page { font:800 34px/1.05 var(--display); letter-spacing:.01em; text-wrap:balance; }
h2.sec { font-size:12.5px; font-weight:700; letter-spacing:.07em; text-transform:uppercase; color:var(--muted); }
.stack { display:grid; gap:10px; }
.stack > * { min-width:0; }
.muted { color:var(--muted); }
.small { font-size:13px; }

.balance { display:flex; justify-content:space-between; align-items:center; gap:10px; flex-wrap:wrap; background:var(--d-soft); border-radius:10px; padding:10px 12px; }
.balance strong { font:800 25px/1 var(--display); color:var(--d); letter-spacing:.01em; }
.days { display:flex; gap:6px; overflow-x:auto; padding:2px; scrollbar-width:none; }
.days::-webkit-scrollbar { display:none; }
.days button { flex:0 0 54px; display:grid; justify-items:center; padding:7px 0 6px; border:1px solid var(--line); background:var(--surface); border-radius:9px; }
.days small { font-size:12px; color:var(--muted); }
.days span { font:800 24px/1.05 var(--display); font-variant-numeric:tabular-nums; }
.days button[aria-pressed="true"] { background:var(--d); border-color:var(--d); color:var(--d-on); }
.days button[aria-pressed="true"] small { color:inherit; }

.cls { display:grid; grid-template-columns:62px minmax(0,1fr); gap:4px 12px; background:var(--surface); border:1px solid var(--line); border-radius:12px; padding:12px; }
.cls.mine { border-color:var(--d); box-shadow:inset 0 0 0 1px var(--d); }
.cls.dim { opacity:.62; }
.time { font:800 30px/1 var(--display); font-variant-numeric:tabular-nums; color:var(--d); }
.cinfo { display:grid; gap:5px; min-width:0; }
.ctitle { font-weight:700; font-size:16px; line-height:1.25; }
.cmeta { font-size:13px; color:var(--muted); }
.pips { display:flex; flex-wrap:wrap; gap:3px; }
.pips i { width:13px; height:8px; border-radius:2px; background:var(--line); }
.pips i.on { background:var(--d); }
.count { font-size:13px; font-variant-numeric:tabular-nums; }
.count b { font-weight:700; }
.cact { grid-column:1 / -1; display:flex; align-items:center; justify-content:space-between; gap:8px; flex-wrap:wrap; margin-top:6px; }
.cact .hint { font-size:13px; color:var(--muted); flex:1 1 150px; }

.btn { border:1px solid transparent; border-radius:9px; padding:10px 14px; font-weight:700; font-size:14.5px; background:var(--d); color:var(--d-on); }
.btn.ghost { background:none; border-color:var(--line); color:var(--ink); }
.btn.danger { background:none; border-color:var(--bad); color:var(--bad); }
.btn.tiny { padding:6px 10px; font-size:13px; font-weight:600; }
.btn.full { width:100%; }
.btn.right { margin-left:auto; }
.pill { display:inline-block; font-size:12px; font-weight:700; padding:2px 8px; border-radius:99px; background:var(--raised); color:var(--muted); white-space:nowrap; }
.pill.warn { background:var(--warn-soft); color:var(--warn); }
.pill.bad { background:var(--bad-soft); color:var(--bad); }
.pill.d { background:var(--d-soft); color:var(--d); }

.notice { padding:11px 12px; border-radius:10px; background:var(--warn-soft); color:var(--warn); font-size:14px; }
.empty { text-align:center; padding:28px 16px; color:var(--muted); background:var(--surface); border:1px dashed var(--line); border-radius:12px; display:grid; gap:10px; justify-items:center; }
.panel { background:var(--surface); border:1px solid var(--line); border-radius:12px; padding:14px; display:grid; gap:10px; min-width:0; }
.panel > * { min-width:0; }
.plan { display:grid; gap:6px; border-left:4px solid var(--d); padding-left:12px; }
.plan strong { font:800 28px/1.05 var(--display); color:var(--d); }
.row { display:flex; justify-content:space-between; align-items:center; gap:10px; flex-wrap:wrap; }
.row > .grow { flex:1 1 150px; min-width:0; overflow-wrap:anywhere; }
.list { display:grid; }
.list > * { padding:10px 0; border-top:1px solid var(--line); }
.list > *:first-child { border-top:0; }
.memberbtn { display:flex; width:100%; justify-content:space-between; align-items:center; gap:10px; flex-wrap:wrap; background:none; border:0; border-top:1px solid var(--line); text-align:left; padding:11px 0; }
.memberbtn:first-child { border-top:0; }
.pills { display:flex; flex-wrap:wrap; gap:4px; }
.stats { grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; }
.stats div { display:grid; }
.stats b { font:800 32px/1 var(--display); font-variant-numeric:tabular-nums; }
.stats span { font-size:12.5px; color:var(--muted); }

.field { display:grid; gap:4px; min-width:0; }
.field label { font-size:13px; font-weight:600; }
.field input, .field select { width:100%; padding:10px 11px; background:var(--raised); border:1px solid var(--line); border-radius:8px; }
.err { color:var(--bad); font-size:13px; }
.grid2 { display:grid; grid-template-columns:repeat(auto-fit,minmax(130px,1fr)); gap:10px; }
.check { display:flex; gap:9px; align-items:flex-start; font-size:14px; }
.check input { margin-top:3px; width:17px; height:17px; flex:none; accent-color:var(--d); }
ol.steps { margin:0; padding-left:20px; display:grid; gap:3px; font-size:14px; }
.code { font:800 34px/1.1 var(--display); letter-spacing:.08em; color:var(--d); overflow-wrap:anywhere; }

.tablewrap { overflow-x:auto; border:1px solid var(--line); border-radius:10px; max-height:60vh; overflow-y:auto; }
table { border-collapse:collapse; width:100%; font-size:13.5px; font-variant-numeric:tabular-nums; }
th, td { padding:8px 10px; text-align:left; border-top:1px solid var(--line); white-space:nowrap; }
thead th { position:sticky; top:0; background:var(--raised); border-top:0; font-size:12.5px; }
td select { padding:6px 8px; background:var(--raised); border:1px solid var(--line); border-radius:7px; }

.nav { position:fixed; left:0; right:0; bottom:0; z-index:5; background:var(--surface); border-top:1px solid var(--line); padding-top:6px; padding-bottom:calc(6px + env(safe-area-inset-bottom,0px)); padding-left:max(16px,env(safe-area-inset-left,0px)); padding-right:max(16px,env(safe-area-inset-right,0px)); }
.nav div { max-width:528px; margin:0 auto; display:grid; grid-auto-flow:column; grid-auto-columns:1fr; gap:4px; }
.nav button { border:0; background:none; padding:11px 2px; border-radius:8px; font-weight:600; font-size:14px; color:var(--muted); }
.nav button[aria-current="page"] { background:var(--raised); color:var(--ink); }

.overlay { position:fixed; inset:0; z-index:20; background:var(--scrim); display:flex; align-items:flex-end; justify-content:center; }
.sheet { width:100%; max-width:540px; max-height:90%; overflow-y:auto; background:var(--surface); border-radius:16px 16px 0 0; padding-block:18px calc(18px + env(safe-area-inset-bottom,0px)); padding-left:max(16px,env(safe-area-inset-left,0px)); padding-right:max(16px,env(safe-area-inset-right,0px)); display:grid; gap:13px; }
.sheet > * { min-width:0; }
.sheet:focus { outline:none; }
.sheet h2 { font:800 29px/1.05 var(--display); letter-spacing:.01em; text-wrap:balance; }
.acts { display:flex; gap:8px; flex-wrap:wrap; }
.acts .btn { flex:1 1 130px; }
dl.facts { margin:0; display:grid; grid-template-columns:auto minmax(0,1fr); gap:3px 12px; font-size:14px; }
.facts dt { color:var(--muted); }
.facts dd { margin:0; font-weight:600; overflow-wrap:anywhere; }
#toast { position:fixed; z-index:30; left:50%; transform:translateX(-50%); bottom:calc(74px + env(safe-area-inset-bottom,0px)); width:min(92%,480px); pointer-events:none; }
#toast div { background:var(--ink); color:var(--bg); border-radius:10px; padding:11px 14px; font-weight:600; font-size:14px; text-align:center; }
@media (prefers-reduced-motion: no-preference) {
  #toast div, .sheet { animation:rise .18s ease-out; }
  @keyframes rise { from { transform:translateY(10px); opacity:.5; } to { transform:none; opacity:1; } }
}
@media (min-width:600px) {
  .overlay { align-items:center; }
  .sheet { border-radius:16px; }
}
