:root {
  --bg: #14110f; --panel: #1f1a17; --panel2: #2a2420; --line: #3a322c;
  --text: #f4ede6; --muted: #a8998c; --accent: #c8946e; --accent-ink: #1b130d;
  --free: #2f9e5b; --busy: #c0453a; --held: #d79a2b; --off: #6b625b; --warn: #ff7a45;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.35 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
body { min-height: 100vh; padding-bottom: env(safe-area-inset-bottom); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.wrap { max-width: 720px; margin: 0 auto; padding: 12px 14px 96px; }
.top { display: flex; align-items: center; gap: 10px; padding: 10px 14px; position: sticky; top: 0; z-index: 5;
  background: rgba(20,17,15,.96); border-bottom: 1px solid var(--line); }
.top h1 { font-size: 17px; margin: 0; letter-spacing: .02em; }
.top .who { margin-left: auto; font-size: 13px; color: var(--muted); text-align: right; }
.brand { width: 30px; height: 30px; border-radius: 8px; background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center; font-weight: 800; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin: 12px 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.row { display: flex; gap: 8px; align-items: center; }
.row.wrapr { flex-wrap: wrap; }
.grow { flex: 1; }
label { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 4px; }
input, select, textarea { width: 100%; background: var(--panel2); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px; outline: none; }
input:focus, select:focus { border-color: var(--accent); }
.btn { border: 0; border-radius: 12px; padding: 13px 16px; font-weight: 700; background: var(--panel2);
  border: 1px solid var(--line); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.danger { background: var(--busy); border-color: var(--busy); color: #fff; }
.btn.ghost { background: transparent; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .45; }
.btn.big { padding: 18px; font-size: 18px; border-radius: 14px; }
.seg { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.seg button { padding: 10px 6px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel2); font-weight: 600; font-size: 14px; }
.seg button.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.stat { background: var(--panel2); border-radius: 10px; padding: 8px 6px; text-align: center; }
.stat b { display: block; font-size: 22px; }
.stat span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.stat.free b { color: var(--free); } .stat.busy b { color: var(--busy); } .stat.held b { color: var(--held); } .stat.off b { color: var(--off); }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); gap: 6px; }
.lk { border-radius: 10px; padding: 10px 2px; text-align: center; font-weight: 800; font-size: 15px; border: 2px solid transparent;
  background: var(--free); color: #fff; min-height: 52px; position: relative; }
.lk small { display: block; font-weight: 500; font-size: 10px; opacity: .9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 2px; }
.lk.occupied { background: var(--busy); } .lk.reserved { background: var(--held); color: #1b130d; }
.lk.out_of_order { background: var(--off); } .lk.over { box-shadow: 0 0 0 3px var(--warn) inset; }
.lk.sel { border-color: #fff; transform: scale(1.04); }
.lk:disabled { opacity: .35; }
.list .item { display: flex; gap: 10px; align-items: center; padding: 11px 4px; border-bottom: 1px solid var(--line); }
.list .item:last-child { border-bottom: 0; }
.pill { font-size: 12px; padding: 3px 8px; border-radius: 999px; background: var(--panel2); color: var(--muted); white-space: nowrap; }
.pill.busy { background: rgba(192,69,58,.2); color: #ff9a8f; } .pill.over { background: rgba(255,122,69,.2); color: var(--warn); }
.pill.ok { background: rgba(47,158,91,.2); color: #7be0a3; } .pill.held { background: rgba(215,154,43,.2); color: #f2c46d; }
.badge { min-width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; background: var(--panel2); }
.badge.busy { background: var(--busy); } .badge.held { background: var(--held); color: #1b130d; }
.steps { display: flex; gap: 6px; margin: 4px 0 10px; }
.steps i { flex: 1; height: 4px; border-radius: 4px; background: var(--line); }
.steps i.on { background: var(--accent); }
.big-tag { font-family: ui-monospace, Menlo, monospace; font-size: 20px; letter-spacing: .06em; }
.sheet-bg { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: 720px; background: var(--panel); border-radius: 18px 18px 0 0; padding: 16px 16px 24px; max-height: 92vh; overflow: auto;
  border-top: 1px solid var(--line); }
.sheet h2 { margin: 0 0 6px; font-size: 20px; }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 6px 10px; margin: 10px 0; font-size: 15px; }
.kv div:nth-child(odd) { color: var(--muted); }
.tabs { display: grid; grid-template-columns: repeat(3, 1fr); position: fixed; bottom: 0; left: 0; right: 0; z-index: 6;
  background: var(--panel); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tabs button { background: none; border: 0; padding: 12px 4px; color: var(--muted); font-weight: 600; font-size: 14px; }
.tabs button.on { color: var(--accent); }
#toast { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); z-index: 40; background: #000; color: #fff;
  padding: 12px 16px; border-radius: 12px; font-weight: 600; max-width: 90vw; opacity: 0; transition: opacity .2s; pointer-events: none; text-align: center; }
#toast.show { opacity: .95; } #toast.err { background: var(--busy); } #toast.ok { background: var(--free); }
.scanhint { display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px dashed var(--accent); border-radius: 12px; color: var(--accent); }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); animation: p 1.2s infinite; }
@keyframes p { 50% { opacity: .2; } }
.login { max-width: 380px; margin: 12vh auto 0; padding: 0 18px; }
.login .brand { width: 56px; height: 56px; font-size: 24px; border-radius: 14px; margin-bottom: 12px; }
video.cam { width: 100%; border-radius: 12px; background: #000; max-height: 50vh; object-fit: cover; }
.err { color: #ff9a8f; font-size: 14px; margin-top: 8px; }
/* member photo (GymMaster) — initials until / unless a photo loads */
.av { flex: none; width: 44px; height: 44px; border-radius: 50%; overflow: hidden; display: grid; place-items: center;
  background: var(--panel2); color: var(--muted); font-weight: 800; font-size: 15px; }
.av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.av.lg { width: 96px; height: 96px; font-size: 30px; }
/* checkout: waiting for the wristband re-tap */
.verify { margin-top: 12px; padding: 14px; border: 2px dashed var(--accent); border-radius: 14px; text-align: center; }
.verify .dot { display: inline-block; width: 14px; height: 14px; vertical-align: middle; margin-right: 6px; }
