/* Pool Pay web app. Phone first (390 px), website layout from 900 px. All colours are tokens so dark mode is one block.
   The staff app and the customer's QR page (src/tablepage.js) share this file: the rules in "shared" and "table page" below
   are used by both, so change them with the customer page open too. */
:root {
  --bg: #f5f6f4;
  --card: #ffffff;
  --line: #e2e5e1;
  --line-soft: #eef0ec;
  --text: #121512;
  --text-2: #3d4048;
  --muted: #667068;
  --link-quiet: #4a4f58; /* small dark-grey link on the page background (test: signin-screen.test.js checks 4.5:1) */
  --accent: #0b6b34;
  --accent-text: #ffffff;
  --good-bg: #d6f2e0;
  --good-text: #0a6a33;
  --wait-bg: #fde4d4;
  --wait-text: #8a3a10;
  --off-bg: #eceeeb;
  --off-text: #566057;
  --bad-bg: #fde2e2;
  --bad-text: #9b1c1c;
  --focus: #1a73e8;
  --radius: 16px;
  --gutter: 16px;
  /* the staff app */
  --felt: #1c8a55;
  --felt-off: #8d939b;
  --rim: #7a4a2b;
  --pocket: #1a1a1a;
  --st-ready: #1c8a55;
  --st-wait: #e08a4a;
  --st-off: #c9ccd1;
  --tab-ready: #0b6b34;
  --tab-wait: #b45309;
  --tab-off: #5b6169;
  --tab-text: #ffffff;
  --panel-dark: #14171a;
  --panel-dark-text: #c9ccd1;
  --countdown: #5be39b;
  --seg-bg: #e8e9ec;
  --seg-on: #ffffff;
  --switch-off: #b9bdb6;
  --switch-locked: #8fb9a3;
  --knob: #ffffff;
  --btn-off-bg: #e8e9ec;
  --danger: #b3261e;
  --bar-track: #eef0ec;
  --bar-amber: #d9822b;
  --bar-grey: #5b6169;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101311;
    --card: #181c19;
    --line: #2b312c;
    --line-soft: #232824;
    --text: #eef1ee;
    --text-2: #c7cdc8;
    --muted: #9aa49c;
    --link-quiet: #aab1ab;
    --accent: #3fbf78;
    --accent-text: #06210f;
    --good-bg: #123a22;
    --good-text: #7be0a6;
    --wait-bg: #4a2a14;
    --wait-text: #ffc59d;
    --off-bg: #262b27;
    --off-text: #a8b1aa;
    --bad-bg: #4a1c1c;
    --bad-text: #ffb4b4;
    --focus: #7ab0ff;
    --felt: #1f9b60;
    --felt-off: #5a615b;
    --rim: #8a5a3a;
    --pocket: #050605;
    --st-ready: #2f9e66;
    --st-wait: #c97a3c;
    --st-off: #3a413b;
    --tab-ready: #3fbf78;
    --tab-wait: #e39a58;
    --tab-off: #4a524b;
    --tab-text: #06140b;
    --panel-dark: #07090a;
    --panel-dark-text: #aeb5af;
    --countdown: #5be39b;
    --seg-bg: #242925;
    --seg-on: #343b35;
    --switch-off: #4a524b;
    --switch-locked: #2d6b4a;
    --knob: #eef1ee;
    --btn-off-bg: #262b27;
    --danger: #ff9a94;
    --bar-track: #232824;
    --bar-amber: #e39a58;
    --bar-grey: #8a928b;
    --shadow: none;
    color-scheme: dark;
  }
}

/* ---------- shared (also used by the customer page) ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  overflow-x: hidden;
}
h1, h2, h3, p { margin: 0; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }

.wrap { width: 100%; max-width: 980px; margin: 0 auto; padding: 0 var(--gutter) 40px; }
.narrow { max-width: 440px; }
.stack { display: grid; gap: 16px; }
.stack-sm { display: grid; gap: 8px; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.center { text-align: center; }
.screen-title { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.01em; }
.section-title { font-size: 1.05rem; font-weight: 700; }
.noscript { padding: 24px var(--gutter); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 18px; box-shadow: var(--shadow); }
.pill { display: inline-block; padding: 3px 11px; border-radius: 999px; font-size: 0.8rem; font-weight: 700; white-space: nowrap; background: var(--off-bg); color: var(--off-text); }
.pill.good { background: var(--good-bg); color: var(--good-text); }
.pill.wait { background: var(--wait-bg); color: var(--wait-text); }

.btn {
  display: block; width: 100%; min-height: 52px; padding: 12px 18px; border: 0; border-radius: 14px;
  background: var(--accent); color: var(--accent-text); font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase;
  cursor: pointer; text-align: center; text-decoration: none;
}
.btn:hover { filter: brightness(1.06); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; filter: none; }
.btn.secondary { background: transparent; color: var(--text); border: 1.5px solid var(--line); }
.btn.secondary:hover { border-color: var(--muted); filter: none; }
.btn.danger { background: transparent; color: var(--bad-text); border: 1.5px solid var(--bad-text); }
.btn.small-btn { min-height: 44px; width: auto; padding: 8px 16px; font-size: 0.85rem; }
.btn.plain { background: transparent; color: var(--muted); font-weight: 600; text-transform: none; letter-spacing: 0; }
.link { background: none; border: 0; padding: 12px 4px; min-height: 44px; color: var(--accent); font-weight: 700; cursor: pointer; text-decoration: underline; }

.field { display: grid; gap: 6px; }
.field label { font-weight: 700; font-size: 0.9rem; }
.field .hint { color: var(--muted); font-size: 0.85rem; }
.input, select.input {
  width: 100%; min-height: 52px; padding: 12px 14px; border-radius: 12px; border: 1.5px solid var(--line);
  background: var(--bg); color: var(--text); font-size: 1rem;
}
.input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); }
.msg { padding: 12px 14px; border-radius: 12px; font-size: 0.95rem; font-weight: 600; background: var(--off-bg); color: var(--text); overflow-wrap: anywhere; }
.msg.good { background: var(--good-bg); color: var(--good-text); }
.msg.bad { background: var(--bad-bg); color: var(--bad-text); }
.msg.wait { background: var(--wait-bg); color: var(--wait-text); }

/* ---------- layout: phone first ---------- */
.app { min-height: 100vh; }
.main-col { min-width: 0; padding-bottom: calc(74px + env(safe-area-inset-bottom) + 20px); }
.app.no-bottom .main-col, .app.solo .main-col { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
.head { padding: 22px 20px 6px; display: grid; gap: 6px; max-width: 760px; }
.head-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand-word { font-size: 15px; font-weight: 800; letter-spacing: 0.1em; }
.head-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ht-text { min-width: 0; }
.sub { font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.h1 { font-size: 26px; font-weight: 800; line-height: 1.2; position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.h1:focus { outline: none; }
.h1.show { position: static; width: auto; height: auto; overflow: visible; clip-path: none; white-space: normal; font-size: 18px; }
.head-back { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.back-link { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding-right: 8px; font-size: 14px; font-weight: 600; color: var(--accent); text-decoration: none; }
.page { padding: 8px 20px 0; max-width: 760px; }
.page-narrow { max-width: 600px; }

.role-pill { display: inline-flex; align-items: center; gap: 5px; min-height: 28px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; text-decoration: none; white-space: nowrap; background: var(--off-bg); color: var(--text-2); }
a.role-pill { position: relative; padding-left: 12px; padding-right: 12px; }
a.role-pill::after { content: ""; position: absolute; inset: -8px -4px; } /* a 44 px touch target around the small pill */
.role-pill.rp-owner { background: var(--good-bg); color: var(--good-text); }
.role-pill.rp-barman { background: var(--wait-bg); color: var(--wait-text); }
.role-pill.rp-plain { background: var(--off-bg); color: var(--text-2); max-width: 60%; overflow: hidden; text-overflow: ellipsis; }

.conn { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--good-text); white-space: nowrap; }
.conn .dot { width: 8px; height: 8px; border-radius: 999px; background: var(--felt); display: block; }
.conn.lost { color: var(--wait-text); }
.conn.lost .dot { background: var(--st-wait); }

/* bottom bar on a phone, sidebar on a computer: the same <nav> */
.sidebar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--card); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.app.no-bottom .sidebar, .app.solo .sidebar { display: none; }
.app.solo .side-nav { display: none; } /* one page only: no one-item menu */
.side-brand, .side-foot { display: none; }
.side-nav { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); height: 74px; }
.side-nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 44px; color: var(--muted); font-size: 12px; font-weight: 600; text-decoration: none; }
.side-nav a[aria-current="page"] { color: var(--accent); font-weight: 700; }

.sec-label { font-size: 13px; font-weight: 700; letter-spacing: 0.06em; color: var(--muted); padding: 14px 0 8px; }
.sec-label.in-card { padding: 0; }
.pad { padding: 0 2px; }
.rule { border: 0; border-top: 1px solid var(--line); margin: 0; width: 100%; }
.stack-sm > .sec-label:first-child, .page .stack > .sec-label:first-child { padding-top: 6px; }

/* ---------- tables screen ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 10px; padding: 8px 0 2px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px; min-width: 0; }
.tile-label { font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: 0.06em; }
.tile-label .l-long { display: none; }
.tile-num { font-size: 26px; font-weight: 800; margin-top: 4px; font-variant-numeric: tabular-nums; }
.tile-num.good { color: var(--good-text); }
.tile-num.wait { color: var(--wait-text); }
.tile-num .of { font-size: 14px; font-weight: 600; color: var(--muted); }
.tgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px 14px; padding: 8px 0 20px; }
.tcard { position: relative; background: var(--card); border: 2px solid var(--st-ready); border-radius: 18px; padding: 20px 10px 10px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.tcard.st-waiting { border-color: var(--st-wait); }
.tcard.st-getting { border-color: var(--st-wait); }
.tcard.st-offline { border-color: var(--st-off); }
.ttab { position: absolute; top: -11px; left: 14px; font-size: 11px; font-weight: 700; letter-spacing: 0.05em; border-radius: 999px; padding: 4px 10px; color: var(--tab-text); background: var(--tab-ready); white-space: nowrap; }
.st-waiting .ttab { background: var(--tab-wait); }
.st-getting .ttab { background: var(--tab-wait); }
.open-panel[data-stage="red"] .op-time, .open-panel[data-stage="pressed"] .op-time { color: #ff7a6b; }
.open-panel[data-stage="orange"] .op-time { color: #ffb04d; }
.st-offline .ttab { background: var(--tab-off); }
.trow { display: flex; align-items: flex-start; justify-content: space-between; gap: 6px; }
.tname { font-size: 16px; font-weight: 700; overflow-wrap: anywhere; }
.tsub { font-size: 12px; color: var(--muted); }
.tpic { flex: none; line-height: 0; }
.pool-rim { fill: var(--rim); }
.pool-felt { fill: var(--felt); }
.pool-felt.off { fill: var(--felt-off); }
.pool-pocket { fill: var(--pocket); }
.pool-ball.white { fill: #f4f4f0; }
.pool-ball.yellow { fill: #e7b416; }
.pool-ball.red { fill: #c8362d; }
.pool-ball.black { fill: #1b1b1b; }
.open-panel { background: var(--panel-dark); border-radius: 12px; padding: 10px 12px; display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.op-label { white-space: nowrap; font-size: 11px; font-weight: 600; color: var(--panel-dark-text); letter-spacing: 0.06em; }
.op-time { white-space: nowrap; font-size: 24px; font-weight: 800; color: var(--countdown); font-variant-numeric: tabular-nums; }
.off-block { padding: 6px 0 2px; }
.off-title { font-size: 15px; font-weight: 700; color: var(--muted); }
.off-sub { font-size: 12px; color: var(--muted); }
.left { display: flex; align-items: baseline; gap: 6px; }
.left-num { font-size: 34px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.left-label { font-size: 12px; color: var(--muted); }
.left.dim .left-num { color: var(--muted); }
.t-add, .t-off { display: flex; align-items: center; justify-content: center; height: 44px; border-radius: 12px; font-size: 13px; font-weight: 700; letter-spacing: 0.05em; text-decoration: none; }
.t-add, .t-off { margin-top: auto; }
.t-add { background: var(--accent); color: var(--accent-text); }
.t-add:hover { filter: brightness(1.08); }
.t-off { background: var(--btn-off-bg); color: var(--muted); }
.t-test { height: 44px; border-radius: 12px; border: 1.5px dashed var(--wait-text); background: transparent; color: var(--wait-text); font-size: 12px; font-weight: 700; letter-spacing: 0.04em; cursor: pointer; }
.t-test:disabled { opacity: 0.5; cursor: not-allowed; }
.t-test-msg { font-size: 12px; font-weight: 600; color: var(--wait-text); overflow-wrap: anywhere; }
.t-remove { height: 44px; border-radius: 12px; border: 1.5px solid var(--bad-text); background: transparent; color: var(--bad-text); font-size: 12px; font-weight: 700; letter-spacing: 0.05em; cursor: pointer; }
/* The shared confirm panel (confirm.js): the button turns into a question with a yes and a Cancel. */
.confirm-box { display: grid; gap: 8px; min-width: 0; }
.confirm-panel { display: flex; flex-direction: column; gap: 8px; scroll-margin-bottom: 100px; } /* clear of the fixed bottom bar (74px) */
.confirm-ask { font-size: 14px; font-weight: 700; overflow-wrap: anywhere; }
.confirm-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.confirm-actions .btn { flex: 1 1 auto; }
.confirm-msg:empty { display: none; }
.t-test-msg:empty { display: none; }
.msg.banner { display: flex; flex-wrap: wrap; align-items: center; column-gap: 6px; margin: 8px 0 4px; padding-top: 4px; padding-bottom: 4px; }
.msg.banner .link { color: inherit; padding: 11px 4px; min-height: 0; }
.empty { text-align: center; padding: 28px 12px; color: var(--muted); grid-column: 1 / -1; }

/* ---------- add games ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; justify-content: center; min-width: 64px; min-height: 48px; padding: 0 14px;
  border-radius: 12px; border: 2px solid var(--line); background: var(--card); color: var(--text);
  font-size: 1.15rem; font-weight: 800; text-decoration: none; cursor: pointer; font-variant-numeric: tabular-nums;
}
.chip.small-text { font-size: 14px; }
.chip.on, .chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.chip:disabled { opacity: 0.5; cursor: not-allowed; }
.custom-box { display: grid; gap: 6px; }
.amount-big { font-size: 48px; font-weight: 800; line-height: 1.1; color: var(--accent); margin-top: 4px; font-variant-numeric: tabular-nums; }
.method-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.method { min-height: 52px; border-radius: 12px; font-size: 14px; font-weight: 700; letter-spacing: 0.05em; cursor: pointer; border: 2px solid var(--line); background: var(--card); color: var(--text); }
.method[aria-pressed="true"] { border-color: var(--accent); background: var(--good-bg); color: var(--good-text); }
.btn.big { min-height: 56px; font-size: 14px; }
.btn.light { background: var(--card); color: var(--good-text); min-height: 48px; font-size: 13px; margin-top: 8px; }
.btn.outline { background: var(--card); color: var(--accent); border: 2px solid var(--accent); min-height: 48px; font-size: 13px; }
.btn.outline.tiny { min-height: 44px; width: auto; font-size: 12px; padding: 0 12px; border-radius: 10px; color: var(--text); border-color: var(--line); flex: none; }
.btn.danger-outline { background: var(--card); color: var(--danger); border: 2px solid var(--danger); min-height: 48px; font-size: 13px; }
.btn.danger-solid { background: var(--danger); color: var(--card); }
.btn.block { width: 100%; }
.btn.fit { display: inline-block; width: auto; }
.sure { border: 2px solid var(--accent); }
.sure-title, .done-title { font-size: 18px; font-weight: 800; }
.sure-title:focus, .done-title:focus { outline: none; }
.kv { display: grid; gap: 6px; font-size: 14px; color: var(--text-2); }
.kv > div { display: flex; justify-content: space-between; gap: 12px; }
.kv strong { color: var(--text); text-align: right; overflow-wrap: anywhere; }
.done { background: var(--good-bg); border-color: transparent; }
.done-title, .done-text { color: var(--good-text); }
.done-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.done-actions .btn { flex: 1 1 140px; margin-top: 0; font-size: 13px; }
.done-text { font-size: 13px; line-height: 1.5; }

/* steppers and switches */
.stp { display: flex; align-items: center; justify-content: center; gap: 12px; }
.stp-btn { width: 48px; height: 48px; border-radius: 12px; border: 2px solid var(--line); background: var(--card); font-size: 24px; font-weight: 700; cursor: pointer; color: var(--text); line-height: 1; }
.stp-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.stp-num { flex: 1; text-align: center; font-size: 32px; font-weight: 800; font-variant-numeric: tabular-nums; }
.srow .stp { gap: 6px; flex: none; }
.srow .stp-btn { width: 44px; height: 44px; font-size: 22px; }
.srow .stp-num { flex: none; width: 48px; font-size: 20px; }
.switch { flex: none; width: 56px; height: 44px; border: 0; background: transparent; cursor: pointer; position: relative; padding: 0; }
.switch::before { content: ""; position: absolute; left: 0; top: 6px; width: 56px; height: 32px; border-radius: 999px; background: var(--switch-off); transition: background 0.15s; }
.switch[aria-checked="true"]::before { background: var(--accent); }
.switch:disabled { cursor: default; }
.switch:disabled[aria-checked="true"]::before { background: var(--switch-locked); }
.switch .knob { position: absolute; top: 10px; left: 4px; width: 24px; height: 24px; border-radius: 999px; background: var(--knob); transition: left 0.15s; }
.switch[aria-checked="true"] .knob { left: 28px; }

/* ---------- Day / Week / Month, reports ---------- */
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; padding: 4px; background: var(--seg-bg); border-radius: 14px; margin: 6px 0 14px; }
.seg button { min-height: 44px; border: 0; border-radius: 10px; background: transparent; color: var(--text-2); font-weight: 700; font-size: 14px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--seg-on); color: var(--accent); }
.big-card { padding: 18px; }
.big-label { font-size: 12px; font-weight: 600; letter-spacing: 0.06em; color: var(--muted); }
.big-num { font-size: 44px; font-weight: 800; line-height: 1.1; margin-top: 6px; color: var(--accent); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.big-sub { font-size: 14px; color: var(--text-2); margin-top: 2px; }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; min-width: 0; }
.stat-label { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; }
.stat-label.qr { color: var(--good-text); }
.stat-label.staff { color: var(--wait-text); }
.stat-label .dot { width: 8px; height: 8px; border-radius: 999px; background: var(--felt); display: block; }
.stat-label.staff .dot { background: var(--st-wait); }
.stat-num { font-size: 24px; font-weight: 800; margin-top: 6px; font-variant-numeric: tabular-nums; }
.stat-sub { font-size: 12px; color: var(--muted); }
.list { padding: 4px 16px; display: flex; flex-direction: column; }
.brow { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line-soft); }
.brow:first-child, .trow2:first-child, .mrow:first-child { border-top: 0; }
.brow-name { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.brow > .brow-name { width: 72px; flex: none; }
.brow-num { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.brow > .brow-num { width: 48px; flex: none; }
.bar-track { flex: 1; height: 10px; border-radius: 999px; background: var(--bar-track); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; background: var(--felt); }
.bar-fill.amber { background: var(--bar-amber); }
.bar-fill.grey { background: var(--bar-grey); }
.mrow { padding: 13px 0; border-top: 1px solid var(--line-soft); display: grid; gap: 8px; }
.mrow .bar-track { flex: none; height: 8px; }
.mrow-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mrow-name { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; }
.mrow-name .dot { width: 10px; height: 10px; border-radius: 999px; background: var(--felt); display: block; flex: none; }
.mrow-name .dot.amber { background: var(--bar-amber); }
.mrow-name .dot.grey { background: var(--bar-grey); }
.mrow-rand { font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }
.trow2 { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line-soft); }
.btn.csv { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 4px; }

/* ---------- settings, people, roles ---------- */
.rows { padding: 4px 16px; }
.srow { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; padding: 6px 0; border-top: 1px solid var(--line-soft); }
.srow:first-child { border-top: 0; }
.srow.col { flex-direction: column; align-items: stretch; padding: 14px 0; gap: 12px; }
.srow-text { min-width: 0; }
.srow-title { font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.srow-sub { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.srow-end { display: flex; align-items: center; gap: 4px; flex: none; }
.srow-value { font-size: 20px; font-weight: 800; flex: none; font-variant-numeric: tabular-nums; }
.srow-edit { padding: 0 0 12px; }
.srow-edit:empty, .srow-edit > div:empty { display: none; }
.row-edit { min-height: 44px; padding: 0 10px; border: 0; background: none; color: var(--accent); font-weight: 700; font-size: 13px; cursor: pointer; text-decoration: underline; }
.row-edit.danger { color: var(--danger); }
.opt-wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.opt-chip { display: flex; align-items: center; height: 44px; border-radius: 12px; border: 2px solid var(--accent); background: var(--good-bg); color: var(--good-text); font-size: 16px; font-weight: 800; padding: 0 14px; }
.opt-chip:has(.opt-x) { padding-right: 0; }
.opt-x { width: 44px; height: 44px; border: 0; background: transparent; color: inherit; font-size: 20px; cursor: pointer; }
.opt-add { height: 44px; border-radius: 12px; border: 2px dashed var(--accent); background: var(--card); color: var(--accent); font-size: 14px; font-weight: 700; padding: 0 14px; cursor: pointer; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.body-text { font-size: 13px; color: var(--text-2); line-height: 1.5; }
.link-list { padding-top: 6px; }
.link-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; padding: 8px 16px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); text-decoration: none; color: var(--muted); }
.link-row .lr-text { display: flex; flex-direction: column; color: var(--text); }
.lr-title { font-size: 15px; font-weight: 600; }
.lr-sub { font-size: 12px; color: var(--muted); }
.link-row.flat { border: 0; border-radius: 0; border-top: 1px solid var(--line-soft); padding-left: 0; padding-right: 0; }
.link-row.flat:first-child { border-top: 0; }
.prow { padding: 6px 0 4px; border-top: 1px solid var(--line-soft); display: grid; gap: 2px; }
.prow:first-child { border-top: 0; }
.prow-main { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; }
.prow-text { min-width: 0; }
.prow-actions { display: flex; gap: 4px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.person-name { font-weight: 700; overflow-wrap: anywhere; }
.person-email { color: var(--muted); font-size: 0.9rem; overflow-wrap: anywhere; }
.code-box {
  font: 800 1.7rem/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: 0.12em;
  padding: 16px; text-align: center; border: 2px dashed var(--accent); border-radius: 14px; background: var(--bg);
  overflow-wrap: anywhere; user-select: all;
}
.rtabs { display: flex; flex-wrap: wrap; gap: 8px; padding-bottom: 6px; }
.rtab { min-height: 44px; padding: 0 16px; border-radius: 999px; font-size: 14px; font-weight: 700; cursor: pointer; border: 2px solid var(--line); background: var(--card); color: var(--text); }
.rtab[aria-pressed="true"] { border-color: var(--accent); background: var(--accent); color: var(--accent-text); }
.rtab.new { border: 2px dashed var(--accent); color: var(--accent); }
.meta-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.meta-row p:focus { outline: none; }

/* ---------- sign in, create account, picker ---------- */
.auth-wrap { max-width: 440px; margin: 0 auto; padding: max(28px, 7vh) 24px 40px; display: grid; gap: 24px; }
.auth-head { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.auth-brand { font-size: 22px; font-weight: 800; letter-spacing: 0.12em; }
.auth-tag { font-size: 14px; color: var(--muted); text-align: center; }
.auth-title { font-size: 1.4rem; font-weight: 800; text-align: center; }
.auth-card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 20px; }
.auth-links { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.auth-link { display: flex; align-items: center; min-height: 44px; color: var(--accent); font-weight: 600; font-size: 14px; text-decoration: none; background: none; border: 0; cursor: pointer; padding: 0 8px; }
.auth-link.quiet { color: var(--muted); font-weight: 400; }
.auth-signup { display: grid; gap: 2px; justify-items: center; }
.auth-signup .btn { width: 100%; }
.auth-link.invite { color: var(--link-quiet); font-weight: 500; font-size: 13px; }
.venue-btn { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 64px; padding: 12px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); text-align: left; cursor: pointer; }
.venue-name { font-weight: 700; overflow-wrap: anywhere; }

/* ---------- SnapScan setup ---------- */
.step-head { display: flex; align-items: center; gap: 12px; }
.step-mark {
  flex: 0 0 auto; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  border: 1.5px solid var(--line); color: var(--muted); font-weight: 800; font-size: 0.9rem;
}
.step.done .step-mark { background: var(--good-bg); border-color: var(--good-text); color: var(--good-text); }
.bullets { margin: 0; padding-left: 20px; display: grid; gap: 2px; }
.email-box { min-height: 0; font: 0.85rem/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; resize: vertical; }
.btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; filter: none; }
.read-first > summary { display: flex; align-items: center; min-height: 44px; color: var(--accent); font-weight: 700; cursor: pointer; }
.read-first[open] > summary { margin-bottom: 8px; }
.pill.status { white-space: normal; border-radius: 14px; padding: 6px 12px; line-height: 1.3; }

/* ---------- table page (the customer's QR page): shared, keep as it was ---------- */
.brand { padding-top: 18px; font-size: 0.9rem; font-weight: 800; letter-spacing: 0.1em; }
.label { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.label.good { color: var(--good-text); }
.custom { display: grid; gap: 6px; }
.custom label { font-size: 0.85rem; color: var(--muted); }
.row { display: flex; gap: 8px; align-items: stretch; }
.row .input { flex: 1; min-width: 0; }
.amount { font-size: 3rem; font-weight: 800; line-height: 1.1; color: var(--accent); }
.confirm { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); display: grid; gap: 12px; }
.confirm-title { font-size: 1.25rem; font-weight: 800; }
.privacy { padding: 0 6px; }
/* player account pages (src/playerweb.js): sign in, create account, My games. Classes only, so the page policy keeps no inline styles. */
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 0.9rem; line-height: 1.4; }
.check input { flex: none; width: 22px; height: 22px; margin-top: 1px; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 0.85rem; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.hist { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.hist li { display: grid; gap: 2px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.hist li:last-child { border-bottom: 0; padding-bottom: 0; }
.who { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 12px; }
.who p { margin: 0; flex: 1 1 auto; min-width: 0; }
.who form { margin: 0; flex: none; }
.who .btn { display: inline-flex; align-items: center; width: auto; min-height: 44px; padding: 0 2px; white-space: nowrap; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; word-break: break-word; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
details.fold > summary { cursor: pointer; font-weight: 700; min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 8px; list-style: none; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::after { content: ""; flex: none; width: 9px; height: 9px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); margin: -4px 4px 0 0; transition: transform 0.15s; }
details.fold[open] > summary::after { transform: rotate(-135deg); margin-top: 4px; }
details.fold[open] > summary { margin-bottom: 8px; }
/* Links in running text on the player pages and the table page take the theme's accent, in light and dark. */
.pp a:not(.btn):not(.chip) { color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }

/* ---------- a computer: left sidebar, content in a column, tables in a grid ---------- */
@media (min-width: 900px) {
  .app { display: grid; grid-template-columns: 232px minmax(0, 1fr); align-items: start; }
  .main-col, .app.no-bottom .main-col, .app.solo .main-col { padding-bottom: 40px; }
  .sidebar, .app.no-bottom .sidebar, .app.solo .sidebar {
    display: flex; flex-direction: column; gap: 6px; position: sticky; top: 0; left: auto; right: auto; bottom: auto; height: 100vh; z-index: 1;
    padding: 24px 16px; border-top: 0; border-right: 1px solid var(--line);
  }
  .side-brand { display: block; font-size: 16px; font-weight: 800; letter-spacing: 0.1em; padding: 0 8px 18px; }
  .side-nav { display: flex; flex-direction: column; gap: 6px; height: auto; }
  .side-nav a { flex-direction: row; justify-content: flex-start; gap: 10px; height: 44px; padding: 0 12px; border-radius: 12px; font-size: 14px; color: var(--text-2); }
  .side-nav a:hover { background: var(--off-bg); }
  .side-nav a[aria-current="page"] { background: var(--good-bg); color: var(--good-text); }
  .side-foot { display: grid; gap: 2px; margin-top: auto; padding: 12px; border-top: 1px solid var(--line); }
  .sf-email { font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
  .sf-role { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
  .sf-links { display: flex; flex-wrap: wrap; gap: 4px 14px; padding-top: 4px; }
  .sf-link, .sf-signout { display: inline-flex; align-items: center; min-height: 36px; font-size: 13px; font-weight: 600; color: var(--accent); text-decoration: none; background: none; border: 0; padding: 0; cursor: pointer; }
  .sf-link[aria-current="page"] { text-decoration: underline; }
  .sf-signout { color: var(--muted); text-align: left; }

  .head { max-width: 1120px; padding: 28px 32px 0; }
  .head-top { display: none; }
  .head-title { flex-wrap: wrap; }
  .h1 { position: static; width: auto; height: auto; overflow: visible; clip-path: none; white-space: normal; }
  .h1.show { font-size: 26px; }
  .sub { font-size: 14px; }
  .page { padding: 18px 32px 0; max-width: 1120px; }
  .page-narrow { max-width: 760px; margin: 0; }
  .conn { background: var(--good-bg); border-radius: 999px; padding: 6px 12px; font-size: 13px; }
  .conn.lost { background: var(--wait-bg); }
  .tile-label .l-short { display: none; }
  .tile-label .l-long { display: inline; }
  .tiles { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
  .tile { padding: 16px; }
  .tile-num { font-size: 32px; }
  .tile-num .of { font-size: 16px; }
  .tgrid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 26px 16px; padding-top: 10px; }
  .tcard { padding: 22px 14px 14px; gap: 12px; }
  .tname { font-size: 17px; }
  .tpic svg { width: 84px; height: 50px; }
  .op-time { font-size: 26px; }
  .left-num { font-size: 38px; }
  .left-label { font-size: 13px; }
  .off-title { font-size: 16px; }
  .back-link { margin-left: -6px; }
}
@media (min-width: 900px) and (max-width: 1100px) { .tgrid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); } }
@media (max-width: 360px) {
  .tgrid { gap: 26px 8px; }
  .head, .page { padding-left: 14px; padding-right: 14px; }
  .tname { font-size: 14px; }
  .ttab { font-size: 10px; left: 8px; }
}
@media (prefers-reduced-motion: reduce) { .switch::before, .switch .knob { transition: none; } }

/* ---------- trend charts (Games and Revenue) ---------- */
.chart-panel { padding: 14px 14px 12px; }
.chart-svg { width: 100%; height: auto; display: block; margin-top: 8px; touch-action: manipulation; }
.chart-axis { stroke: var(--line); stroke-width: 1; }
.chart-grid { stroke: var(--line-soft); stroke-width: 1; }
.chart-tick, .chart-x { fill: var(--muted); font-size: 12px; font-family: inherit; }
.chart-hit { fill: transparent; }
.cbar { cursor: pointer; outline: none; }
.cbar:focus-visible .chart-hit, .cbar:hover .chart-hit { fill: var(--line-soft); }
.cseg.green { fill: var(--st-ready); }
.cseg.amber { fill: var(--bar-amber); }
.cseg.grey { fill: var(--bar-grey); }
.chart-read { margin-top: 6px; font-size: 14px; min-height: 1.4em; }
.legend { display: flex; gap: 14px; margin-top: 6px; font-size: 13px; color: var(--muted); }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.legend .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.legend .dot.green { background: var(--st-ready); }
.legend .dot.amber { background: var(--bar-amber); }
.legend .dot.grey { background: var(--bar-grey); }
@media (min-width: 900px) {
  /* On a computer the figures sit on the left and the trend chart fills the right, instead of leaving it empty. */
  .report-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); column-gap: 24px; align-items: start; }
  .report-grid > * { grid-column: 1; }
  .report-grid > .chart-panel { grid-column: 2; grid-row: 1 / span 6; position: sticky; top: 12px; }
}

/* ---------- report range: earlier / later, and clickable bars ---------- */
.range-nav { display: flex; align-items: center; gap: 8px; margin: -4px 0 12px; }
.range-nav .range-label { flex: 1; text-align: center; font-weight: 700; font-size: 15px; }
.range-step { width: 44px; min-height: 44px; padding: 0; font-size: 22px; flex: none; }
.range-step:disabled { opacity: 0.35; cursor: default; }
.range-today { width: auto; min-height: 44px; padding: 0 14px; font-size: 13px; flex: none; }
.cbar.sel .cseg { filter: brightness(1.12); }
.chart-open { display: block; margin-top: 6px; padding: 8px 0; min-height: 44px; border: 0; background: transparent; color: var(--accent); font-weight: 700; font-size: 14px; cursor: pointer; text-align: left; }
.week-row { width: 100%; text-align: left; background: transparent; border: 0; border-bottom: 1px solid var(--line-soft); min-height: 48px; padding: 0 14px; display: flex; align-items: center; justify-content: space-between; gap: 10px; font: inherit; color: var(--text); cursor: pointer; }
.week-row:last-child { border-bottom: 0; }
.week-row:hover { background: var(--line-soft); }
.week-row .brow-num { font-weight: 700; }

.wk-part { display: block; }

/* ---------- Pool Pay's contact details (pay page, player pages, owner sign-in) ---------- */
.contact-card { margin-top: 22px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; display: flex; flex-direction: column; gap: 10px; }
.contact-title { margin: 0; font-weight: 800; font-size: 15px; }
.contact-btn { display: flex; align-items: center; justify-content: center; text-align: center; text-decoration: none; word-break: break-word; }
.contact-soon { opacity: 0.55; cursor: default; }
.auth-contact { text-align: center; margin: 14px 0 0; }

/* ---------- No-refund notice on the pay steps (player pages) ---------- */
.notice-big { padding: 16px; border-radius: 14px; border: 2px solid var(--wait-text); background: var(--wait-bg); color: var(--wait-text); display: grid; gap: 8px; font-size: 1.05rem; line-height: 1.4; }
.notice-big p { margin: 0; }
.notice-title { font-weight: 800; font-size: 1.2rem; text-transform: uppercase; letter-spacing: 0.04em; }
.notice-line { margin: 0; text-align: center; font-weight: 700; font-size: 0.95rem; }
.check.subtle { font-size: 0.82rem; color: var(--muted, inherit); opacity: 0.85; }

/* Wi-Fi signal: five bars, filled up to the current step */
.sig-row { display: flex; align-items: flex-end; gap: 16px; }
.sigbars { display: flex; align-items: flex-end; gap: 4px; height: 36px; }
.sigbar { width: 10px; height: 12px; border-radius: 2px; background: #c9cfca; }
.sigbar:nth-child(2) { height: 18px; }
.sigbar:nth-child(3) { height: 24px; }
.sigbar:nth-child(4) { height: 30px; }
.sigbar:nth-child(5) { height: 36px; }
.sigbars.s1 .sigbar.on, .sigbars.s2 .sigbar.on { background: var(--bad-text); }
.sigbars.s3 .sigbar.on { background: var(--wait-text); }
.sigbars.s4 .sigbar.on, .sigbars.s5 .sigbar.on { background: var(--good-text); }
.sig-dbm { font-size: 22px; font-weight: 700; line-height: 1.1; }
.sig-word { color: var(--muted); font-size: 14px; }

/* Restart and Wi-Fi of one table: the nearby networks the table reported */
.netlist { display: grid; gap: 6px; }
.net-btn { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 44px; padding: 8px 12px; background: transparent; color: var(--text); border: 1.5px solid var(--line); border-radius: 12px; font: inherit; text-align: left; cursor: pointer; }
.net-btn:hover { border-color: var(--muted); }
.net-name { font-weight: 600; overflow-wrap: anywhere; min-width: 0; }
.net-sig { color: var(--muted); font-size: 0.85rem; flex: none; }
.saved-net { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 6px 0; }
/* Firmware 1.0: a saved network row with its actions, the network picked from the scan, and the "Last change" box */
.saved-row { display: grid; gap: 6px; padding: 8px 0; border-top: 1px solid var(--line-soft); }
.saved-row:first-of-type { border-top: 0; }
.saved-row .saved-net { padding: 0; }
.net-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; }
.net-actions .confirm-box { flex: 1 1 140px; }
.net-actions .btn { width: 100%; }
.net-btn.selected { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.net-lock { color: var(--muted); font-size: 0.8rem; margin-left: 6px; font-weight: 400; }
.net-pick { display: grid; gap: 10px; padding: 12px; border: 1.5px solid var(--accent); border-radius: 12px; }
.last-change { display: grid; gap: 6px; padding: 12px; border: 1.5px solid var(--line); border-radius: 12px; }
.last-change .what { font-weight: 600; overflow-wrap: anywhere; }
.tech { color: var(--muted); font-size: 0.75rem; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; overflow-wrap: anywhere; }

/* Admin's table list: a small signal read-out beside each table */
.sigbars.mini { height: 18px; gap: 2px; }
.sigbars.mini .sigbar { width: 5px; height: 6px; }
.sigbars.mini .sigbar:nth-child(2) { height: 9px; }
.sigbars.mini .sigbar:nth-child(3) { height: 12px; }
.sigbars.mini .sigbar:nth-child(4) { height: 15px; }
.sigbars.mini .sigbar:nth-child(5) { height: 18px; }
