/* DinkBook */
:root {
  --brand: #16794c;
  --ink: #17201b;
  --muted: #56605a;
  --line: #e3e8e4;
  --bg: #f4f6f3;
  --card: #fff;
  --ok: #16794c;
  --warn: #b7791f;
  --err: #c53030;
  --radius: 12px;
  --paddle: #16191a;   /* logo black */
  --ball: #8ae40f;     /* logo lime */
  --ball-soft: #eefbd9;
  --link: #3c7a0c;
  --display: "Barlow Semi Condensed", "Barlow", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.5 "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-variant-numeric: tabular-nums; color: var(--ink); background: var(--bg); }
a { color: var(--brand); }
h1 { font: 700 26px/1.15 var(--display); margin: 0 0 8px; letter-spacing: -.005em; }
h2 { font: 700 19px/1.2 var(--display); margin: 26px 0 10px; }
h3 { font-size: 16px; margin: 0 0 10px; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
code { background: #eef1ee; padding: 1px 5px; border-radius: 4px; font-size: .9em; word-break: break-all; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
[hidden] { display: none !important; }

.wrap { max-width: 760px; margin: 0 auto; padding: 20px 16px 48px; }
.wrap.wide { max-width: 1180px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 14px; }
.card.narrow { max-width: 420px; margin: 40px auto; }
.card > h2:first-child { margin-top: 0; }

.logo { font-weight: 800; font-size: 20px; color: var(--ink); text-decoration: none; letter-spacing: -.02em; }
.logo b { color: var(--brand); }
.logo.big { font-size: 30px; margin-bottom: 12px; }
.logo img { height: 24px; width: auto; display: inline-block; vertical-align: middle; }
.brand-icon { width: 128px; height: auto; display: inline-block; margin-bottom: 6px; }
.brand-icon.big { width: 200px; }
.brand-wordmark { height: 40px; width: auto; max-width: 100%; margin: 4px auto 14px; display: inline-block; }

/* Buttons */
.btn { display: inline-block; background: var(--brand); color: #fff; border: 0; border-radius: 10px; padding: 11px 18px;
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; text-align: center; }
.btn:hover { filter: brightness(1.05); }
.btn:disabled { opacity: .55; cursor: wait; }
.btn.block { display: block; width: 100%; margin-top: 12px; padding: 14px; font-size: 16px; }
.btn.ghost { background: transparent; color: var(--brand); border: 1.5px solid var(--brand); }
.btn.danger { background: var(--err); }
.link { background: none; border: 0; color: var(--brand); font: inherit; cursor: pointer; padding: 0; text-decoration: underline; }

/* Forms */
.form label { display: block; font-weight: 600; font-size: 13px; margin: 0 0 12px; }
.form label.check { font-weight: 400; font-size: 15px; display: flex; gap: 8px; align-items: center; }
input, select, textarea { width: 100%; font: inherit; padding: 10px 12px; border: 1px solid #cfd6d1; border-radius: 8px; background: #fff; color: var(--ink); margin-top: 4px; }
input[type=checkbox], input[type=radio] { width: auto; margin: 0; }
input[type=color] { height: 42px; padding: 4px; max-width: 120px; }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--brand) 40%, transparent); border-color: var(--brand); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid2 .full { grid-column: 1 / -1; }
.row-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.row-form label { flex: 1 1 160px; margin: 0; }
.row { display: flex; gap: 8px; align-items: center; }
.row input { margin: 0; }
.inline { display: inline-flex; gap: 6px; align-items: center; }
.inline input { margin: 0; }
.prefix { display: flex; align-items: center; margin-top: 4px; }
.prefix span { color: var(--muted); font-weight: 400; white-space: nowrap; padding-right: 4px; font-size: 13px; }
.prefix input { margin: 0; }
.checks { list-style: none; padding: 0; }
.checks .pass { color: var(--ok); }
.checks .fail { color: var(--err); font-weight: 600; }

/* Messages */
.flash { padding: 12px 14px; border-radius: 10px; margin-bottom: 14px; background: #e7f4ec; border: 1px solid #b9dfc8; }
.flash.err { background: #fdecec; border-color: #f2b8b8; color: #8f1d1d; }
.flash.warn { background: #fff6e0; border-color: #f0d38f; color: #6b4a05; }
.notice { background: color-mix(in srgb, var(--brand) 8%, #fff); border: 1px solid color-mix(in srgb, var(--brand) 25%, #fff); padding: 12px 14px; border-radius: 10px; margin: 12px 0; font-size: 14px; }
.error { color: var(--err); min-height: 1.2em; margin-top: 10px; font-size: 14px; }
.tag { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: #eef1ee; color: var(--muted); vertical-align: middle; }
.tag.ok { background: #e1f3e8; color: var(--ok); }
.tag.warn { background: #fff1d1; color: #8a5a00; }

.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.back { display: inline-block; margin-bottom: 10px; text-decoration: none; font-size: 14px; }

/* Tables */
table { width: 100%; border-collapse: collapse; }
.list th { text-align: left; font-size: 13px; color: var(--muted); font-weight: 600; padding: 8px; border-bottom: 1px solid var(--line); }
.list td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.list tr:last-child td { border-bottom: 0; }
.list tr.off td { opacity: .55; }
.card:has(> .list) { overflow-x: auto; }
.kv td { padding: 7px 0; border-bottom: 1px solid #eef1ee; vertical-align: top; }
.kv td:first-child { color: var(--muted); width: 42%; padding-right: 12px; }
.files { max-height: 260px; overflow: auto; font-family: ui-monospace, monospace; font-size: 13px; }

/* Tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin: 12px 0; }
.tile { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.tile small { display: block; color: var(--muted); font-size: 12px; }
.tile b { font-size: 24px; }

/* Status pills */
.status { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; background: #eef1ee; }
.status.booked { background: #e3eefc; color: #1f4f99; }
.status.checked_in { background: #e1f3e8; color: var(--ok); }
.status.no_show { background: #fdecec; color: var(--err); }
.status.cancelled_owner, .status.late_conflict { background: #fff1d1; color: #8a5a00; }
.status.expired { color: var(--muted); }

/* Public venue page */
body.public { background: #fafbfa; }
.venue { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 12px; }
.banner { height: 160px; background: center / cover no-repeat; }
.banner.plain { height: 70px; background: linear-gradient(120deg, var(--brand), color-mix(in srgb, var(--brand) 60%, #000)); }
.venue-head { display: flex; gap: 14px; align-items: center; padding: 14px 16px 6px; }
.venue-logo { width: 68px; height: 68px; border-radius: 14px; object-fit: cover; border: 3px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.12); margin-top: -40px; background: #fff; }
.venue h1 { margin: 0; font-size: 22px; }
.venue-desc { padding: 0 16px 14px; margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.chips { display: flex; gap: 8px; margin: 12px 0; flex-wrap: wrap; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.chip { flex: 0 0 auto; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--ink); text-decoration: none; font-size: 14px; text-align: center; }
.chip small { display: block; color: var(--muted); font-size: 11px; }
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip.on small { color: rgba(255,255,255,.8); }
.loc-title { margin: 22px 0 8px; font-size: 17px; color: var(--muted); }
.court-head { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.slot { border: 1.5px solid var(--line); background: #fff; border-radius: 10px; padding: 8px 4px; font: inherit; cursor: pointer; color: var(--ink); }
.slot b { display: block; font-size: 14px; }
.slot small { display: block; font-size: 11px; color: var(--muted); }
.slot.open { border-color: color-mix(in srgb, var(--brand) 55%, #fff); }
.slot.open small { color: var(--brand); font-weight: 600; }
.slot.open:hover { background: color-mix(in srgb, var(--brand) 8%, #fff); }
.slot:disabled { cursor: not-allowed; background: #f3f5f3; }
.slot.held { background: #fff6e0; border-color: #f0d38f; }
.slot.booked, .slot.blocked, .slot.past { opacity: .6; }
.recent a { display: block; margin-top: 6px; }
.powered { text-align: center; padding: 10px 0 30px; }
.powered a { color: var(--muted); font-size: 12px; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.powered img { height: 13px; width: auto; }

/* Checkout + receipt */
.checkout { max-width: 460px; margin: 0 auto; }
.summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.timer { font: 700 26px ui-monospace, monospace; color: var(--brand); }
.timer.low { color: var(--err); }
.pay-row { padding: 12px 0 0; border-top: 1px solid var(--line); margin-top: 6px; }
.big-amount { font-size: 28px; font-weight: 800; }
.code-box { margin-top: 14px; }
.code-box summary { cursor: pointer; color: var(--brand); font-weight: 600; }
.code-box .row { margin-top: 10px; }
.code-box .btn { white-space: nowrap; }
.qr { width: 260px; max-width: 100%; margin: 8px auto; display: block; image-rendering: pixelated; }
.steps { text-align: left; background: #f6f8f6; border-radius: 10px; padding: 10px 14px; font-size: 14px; margin: 10px 0; }
.steps ol { margin: 6px 0 0; padding-left: 20px; }
.badge { width: 54px; height: 54px; border-radius: 50%; color: #fff; font-size: 28px; line-height: 54px; margin: 0 auto 8px; font-weight: 700; }
.badge.ok { background: var(--ok); }
.badge.warn { background: var(--warn); }
.ok-text { color: var(--ok); margin: 0; }
.ref { margin: 16px 0; padding: 12px; border: 2px dashed #cfd6d1; border-radius: 10px; text-align: center; }
.ref b { display: block; font-size: 22px; letter-spacing: 2px; margin-top: 2px; word-break: break-all; }
.ref b.long { font-size: 15px; letter-spacing: 0; font-family: ui-monospace, monospace; }
.mini-qr { display: flex; justify-content: center; margin: 14px 0 4px; }
.saved-img { width: 100%; border-radius: 10px; box-shadow: 0 2px 10px rgba(0,0,0,.1); }
.thumb { max-width: 90px; max-height: 90px; border-radius: 8px; border: 1px solid var(--line); display: block; margin: 4px 0; }
.thumb.wide { max-width: 220px; }

.result { display: block; text-decoration: none; color: var(--ink) !important; line-height: 1.45; }
.result b { font: 700 18px var(--display); }
.result.today { border: 2px solid var(--paddle); box-shadow: inset 5px 0 0 var(--ball); }
.result .tag.ok { background: var(--ball); color: var(--paddle); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; align-items: center; }
.log-row { padding: 7px 0; border-bottom: 1px solid #eef1ee; font-size: 14px; }
.log-row:last-child { border-bottom: 0; }

.hero { text-align: center; padding: 70px 10px; }
.hero h1 { font-size: 32px; }
.hero p { max-width: 520px; margin: 10px auto 24px; }

@media (max-width: 640px) {
  .grid2 { grid-template-columns: 1fr; }
  .stats { margin-left: 0; width: 100%; }
  .banner { height: 120px; }
  h1 { font-size: 21px; }
}

/* Recent bookings on this device */
.recent-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.recent-row:first-of-type { margin-top: 8px; }
.recent-when { font-weight: 700; }
.btn.small-btn { padding: 8px 12px; font-size: 13px; white-space: nowrap; }
.pill { font-size: 13px; font-weight: 600; padding: 6px 10px; border-radius: 99px; background: #e3eefc; color: #1f4f99; text-decoration: none; white-space: nowrap; }
.pill.checked_in { background: #e1f3e8; color: var(--ok); }
.pill.cancelled_owner, .pill.late_conflict { background: #fff1d1; color: #8a5a00; }
.pill.expired { background: #eef1ee; color: var(--muted); }


/* ============ Dashboards (owner + admin) ============
   The venue desk: one-thumb use on a phone, logo black + ball lime. */
body.has-tabbar { --brand: var(--paddle); background: #f3f5f0; }
body.has-tabbar a { color: var(--link); }
body.has-tabbar .btn { background: var(--paddle); color: #fff; border-radius: 12px; }
body.has-tabbar .btn.ghost { background: #fff; color: var(--paddle); border: 1.5px solid #cfd5cb; }
body.has-tabbar .btn.danger { background: var(--err); color: #fff; }
body.has-tabbar input:focus, body.has-tabbar select:focus, body.has-tabbar textarea:focus { outline: 3px solid color-mix(in srgb, var(--ball) 55%, transparent); border-color: var(--paddle); }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--ball) 70%, var(--paddle)); outline-offset: 2px; }
.desk-only { display: none !important; }
.wrap { scroll-margin-top: 70px; }

.topbar { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.topbar-in { max-width: 1180px; margin: 0 auto; padding: 10px 16px; display: flex; gap: 12px; align-items: center; }
.topbar .logo img { height: 20px; }
.venue-name { font: 600 15px var(--display); color: var(--muted); padding-left: 12px; border-left: 1px solid var(--line); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 1; }
.desk-nav { display: none; }
.who { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.mode-dot { font-size: 12px; font-weight: 600; color: #7a5300; background: #fff1d1; padding: 3px 9px; border-radius: 99px; }
.me { position: relative; }
.me summary { list-style: none; cursor: pointer; }
.me summary::-webkit-details-marker { display: none; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--paddle); color: var(--ball); display: grid; place-items: center; font: 700 16px var(--display); }
.me-menu { position: absolute; right: 0; top: 44px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 30px rgba(22,25,26,.14); min-width: 220px; padding: 6px; z-index: 30; }
.me-menu a, .me-name { display: block; padding: 10px 12px; border-radius: 10px; text-decoration: none; color: var(--ink) !important; }
.me-menu a:hover { background: #f3f5f0; }
.me-name { font-weight: 600; border-bottom: 1px solid var(--line); border-radius: 0; margin-bottom: 4px; }
.me-name small { display: block; font-weight: 400; color: var(--muted); }

/* Phone bottom tab bar */
body.has-tabbar { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr);
  background: var(--paddle); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); }
.tabbar .tab { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 0 5px; border-radius: 12px; color: #aab2ac !important; text-decoration: none; font-size: 11.5px; white-space: nowrap; min-width: 0; font-weight: 600; }
.tabbar .tab.on { color: var(--paddle) !important; background: var(--ball); }
.tabbar details.tab { position: static; }
.tabbar details.tab > summary { list-style: none; display: flex; flex-direction: column; align-items: center; gap: 2px; cursor: pointer; width: 100%; }
.tabbar details.tab > summary::-webkit-details-marker { display: none; }
.tabbar details.tab.on > summary { color: var(--paddle); }
.sheet { position: fixed; left: 8px; right: 8px; bottom: calc(76px + env(safe-area-inset-bottom)); background: #fff; border-radius: 18px; padding: 8px;
  box-shadow: 0 -8px 40px rgba(22,25,26,.25); display: grid; }
.sheet a { padding: 14px 14px; font-size: 16px; font-weight: 600; color: var(--ink) !important; text-decoration: none; border-radius: 12px; }
.sheet a.on { background: var(--ball-soft); }
.sheet a.sheet-out { color: var(--err) !important; border-top: 1px solid var(--line); border-radius: 0 0 12px 12px; margin-top: 4px; }

@media (min-width: 900px) {
  body.has-tabbar { padding-bottom: 0; }
  .tabbar { display: none; }
  .desk-only { display: revert !important; }
  .desk-nav { display: flex; gap: 2px; flex: 1; }
  .venue-name { flex: 0 1 auto; max-width: 220px; }
  .desk-nav a { padding: 7px 11px; border-radius: 10px; color: var(--ink) !important; text-decoration: none; font-size: 14px; font-weight: 500; }
  .desk-nav a:hover { background: #f3f5f0; }
  .desk-nav a.on { background: var(--paddle); color: #fff !important; }
}

/* Schedule */
.day-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 4px 0 12px; flex-wrap: wrap; }
.day-nav { display: flex; align-items: center; gap: 6px; }
.icon-btn { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; background: #fff; border: 1px solid var(--line); color: var(--ink) !important; text-decoration: none; font-size: 24px; line-height: 1; }
.day-title { position: relative; display: flex; flex-direction: column; padding: 0 6px; cursor: pointer; min-width: 0; }
.day-title input { position: absolute; inset: 0; opacity: 0; cursor: pointer; margin: 0; }
.day-name { font: 800 italic 26px/1 var(--display); letter-spacing: -.01em; }
.day-date { font-size: 13px; color: var(--muted); margin-top: 3px; }
.today-link { font-size: 13px; font-weight: 600; margin-left: 4px; }
.find-inline input { width: 240px; }
.day-stats { display: flex; gap: 8px; align-items: stretch; margin-bottom: 14px; flex-wrap: wrap; }
.day-stats > div { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 7px 12px; display: flex; align-items: baseline; gap: 6px; white-space: nowrap; }
.day-stats b { font: 700 20px var(--display); }
.day-stats span { font-size: 13px; color: var(--muted); }
.day-tools { display: flex; gap: 8px; align-items: center; }
a.share { text-decoration: none; color: var(--ink) !important; }
.share { display: inline-flex; align-items: center; gap: 6px; height: 42px; border: 1.5px dashed #b9c2b5; background: transparent; border-radius: 12px; padding: 0 12px; font: 600 13px "Barlow", sans-serif; color: var(--ink); cursor: pointer; white-space: nowrap; }

.court-switch { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px 12px; padding: 2px 16px 4px; scrollbar-width: none; }
.court-switch::-webkit-scrollbar { display: none; }
.court-switch button { flex: 0 0 auto; text-align: left; background: #fff; border: 1.5px solid var(--line); border-radius: 14px; padding: 8px 14px; font: 700 16px var(--display); color: var(--ink); cursor: pointer; }
.court-switch button small { display: block; font: 500 12px "Barlow", sans-serif; color: var(--muted); }
.court-switch button .count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; margin-left: 6px; padding: 0 5px; border-radius: 99px; background: var(--paddle); color: var(--ball); font: 700 12px "Barlow", sans-serif; vertical-align: 2px; }
.court-switch button.on { background: var(--paddle); border-color: var(--paddle); color: #fff; }
.court-switch button.on small { color: #b9c2b5; }
.court-switch button.on .count { background: var(--ball); color: var(--paddle); }

.sched { display: grid; gap: 14px; }
.sched-court { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 6px 12px 10px; }
.court-switch ~ .sched .sched-court:not(.on) { display: none; }
.sched-court > header { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 8px 2px 10px; flex-wrap: wrap; }
.sched-court > header h3 { margin: 0; font: 700 18px var(--display); }
.slot-row { display: flex; gap: 10px; align-items: stretch; padding: 4px 0; border-top: 1px solid #eef1ec; min-height: 56px; position: relative; }
.slot-row .t { width: 46px; flex: 0 0 46px; display: flex; flex-direction: column; align-items: flex-end; justify-content: center; padding-right: 2px; }
.slot-row .t b { font: 700 22px/1 var(--display); }
.slot-row .t span { font-size: 11px; font-weight: 600; color: var(--muted); }
.slot-row.past .t { opacity: .45; }
.slot-row.now { border-top-color: transparent; }
.slot-row.now .t b { color: var(--paddle); }
.slot-row.now .t span { font-size: 0; margin-top: 4px; }
.slot-row.now .t span::before { content: "Now"; font-size: 11px; font-weight: 700; background: var(--ball); color: var(--paddle); border-radius: 99px; padding: 1px 7px; }
.bk { flex: 1; display: flex; justify-content: space-between; align-items: center; gap: 10px; border-radius: 12px; padding: 9px 12px; text-decoration: none; color: var(--ink) !important; min-width: 0; }
.bk-main { display: flex; flex-direction: column; min-width: 0; font-size: 14px; }
.bk-main b { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bk-main span { color: var(--muted); font-size: 13px; }
.bk-status { font-size: 12px; font-weight: 700; padding: 4px 9px; border-radius: 99px; background: rgba(255,255,255,.75); white-space: nowrap; }
a.bk { background: #e6eefc; box-shadow: inset 4px 0 0 #3d6fd1; }
a.bk.checked_in { background: var(--ball-soft); box-shadow: inset 4px 0 0 var(--ball); }
a.bk.no_show { background: #fdeeee; box-shadow: inset 4px 0 0 var(--err); }
.bk.held { background: repeating-linear-gradient(-45deg, #fff6df 0 10px, #fff1cf 10px 20px); color: #7a5300 !important; }
.bk.blocked { background: repeating-linear-gradient(-45deg, #f1f3ef 0 10px, #e9ece6 10px 20px); }
.bk.free { border: 1.5px dashed #dfe4dc; }
.bk.free .bk-main { color: #9aa49c; font-weight: 600; }
.slot-row.past .bk.free { border-color: transparent; }
.slot-row.past:has(.bk.free) { min-height: 34px; padding: 0; }
.slot-row.past:has(.bk.free) .t { flex-direction: row; align-items: baseline; justify-content: flex-end; gap: 2px; }
.slot-row.past:has(.bk.free) .t b { font-size: 15px; }
.slot-row.past:has(.bk.free) .t span { font-size: 10px; }

@media (min-width: 900px) {
  .sched { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
  .court-switch { display: none; }
  .court-switch ~ .sched .sched-court:not(.on) { display: block; }
}

/* Booking detail */
.bk-detail { padding: 18px; }
.bk-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.bk-top h1 { font-size: 28px; margin-bottom: 6px; }
.call { display: inline-flex; align-items: center; gap: 6px; background: var(--paddle); color: var(--ball) !important; text-decoration: none; padding: 10px 14px; border-radius: 12px; font-weight: 700; white-space: nowrap; }
.bk-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 18px 0 8px; }
.bk-facts > div { background: #f5f7f3; border-radius: 12px; padding: 10px; display: flex; flex-direction: column; min-width: 0; }
.bk-facts span { font-size: 12px; color: var(--muted); }
.bk-facts b { font: 700 18px/1.2 var(--display); overflow-wrap: anywhere; }
.bk-facts small { font-size: 12px; color: var(--muted); }
.bk-facts .collect { background: var(--paddle); color: #fff; }
.bk-facts .collect span, .bk-facts .collect small { color: #b9c2b5; }
.bk-facts .collect b { color: var(--ball); white-space: nowrap; overflow-wrap: normal; }
.action-bar { position: sticky; bottom: calc(80px + env(safe-area-inset-bottom)); background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 12px; margin: 14px 0; box-shadow: 0 8px 30px rgba(22,25,26,.12); z-index: 5; }
.btn.block-btn { display: block; width: 100%; padding: 15px; font-size: 17px; }
.action-more { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.action-more > form, .action-more > details { flex: 1; }
.action-more .btn { width: 100%; }
.cancel-box summary { list-style: none; display: block; }
.cancel-box summary::-webkit-details-marker { display: none; }
.danger-text { color: var(--err) !important; }
.cancel-box[open] { flex-basis: 100%; }
.cancel-form { margin-top: 10px; display: grid; gap: 8px; }
.cancel-form label { font-size: 13px; font-weight: 600; }
@media (min-width: 900px) { .action-bar { position: static; box-shadow: none; } }

.card.empty { text-align: center; padding: 30px 18px; }

/* Tables become stacked cards on phones (labels filled in by layout script) */
@media (max-width: 700px) {
  .list, .list tbody, .list tr, .list td { display: block; width: 100%; }
  .list tr:first-child:has(th) { display: none; }
  .list tr { padding: 10px 0; border-bottom: 1px solid var(--line); }
  .list tr:last-child { border-bottom: 0; }
  .list td { border: 0; padding: 3px 0; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  .list td::before { content: attr(data-label); color: var(--muted); font-size: 13px; text-align: left; flex: 0 0 auto; }
  .list td:first-child { text-align: left; font-size: 16px; }
  .list td:first-child::before { display: none; }
  .list td[data-label=""]::before { display: none; }
  .list td:empty { display: none; }
  .card:has(> .list) { padding-top: 4px; padding-bottom: 4px; }
  .grid2 { grid-template-columns: 1fr; }
  body.has-tabbar input, body.has-tabbar select, body.has-tabbar textarea { font-size: 16px; padding: 12px; }
  body.has-tabbar .form .btn { width: 100%; padding: 14px; }
  .bk-facts { grid-template-columns: 1fr 1fr; }
  .bk-facts .collect { grid-column: 1 / -1; flex-direction: row; align-items: baseline; gap: 8px; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }

/* Share page + QR poster */
.share-grid { display: grid; gap: 16px; }
.poster { width: 340px; max-width: 100%; margin: 0 auto; background: #fff; border-radius: 22px; overflow: hidden; border: 1px solid var(--line); }
.poster-top { background: var(--venue); color: #fff; text-align: center; padding: 22px 18px 18px; }
.poster-logo { width: 64px; height: 64px; object-fit: cover; border-radius: 14px; border: 3px solid #fff; background: #fff; margin-bottom: 8px; }
.poster-name { font: 800 italic 28px/1.05 var(--display); }
.poster-addr { font-size: 13px; opacity: .85; margin-top: 4px; }
.poster-body { text-align: center; padding: 18px 18px 16px; }
.poster-call { font: 700 20px var(--display); margin-bottom: 12px; }
.poster-qr { display: flex; justify-content: center; padding: 12px; border: 3px solid var(--paddle); border-radius: 18px; width: max-content; margin: 0 auto; }
.poster-qr img, .poster-qr canvas { display: block; }
.poster-url { font: 700 16px var(--display); margin-top: 12px; word-break: break-all; }
.poster-foot { font-size: 13px; color: var(--muted); margin-top: 4px; }
.poster-brand { height: 14px; margin-top: 14px; opacity: .9; }
.link-box { display: flex; gap: 8px; }
.link-box input { margin: 0; font-size: 14px; }
.share-actions .btn.block-btn { margin-top: 8px; }
@media (min-width: 900px) { .share-grid { grid-template-columns: auto 1fr; align-items: start; } }

/* GCash button */
.btn.gcash-btn { background: #005ce6; display: flex; align-items: center; justify-content: center; gap: 10px; }
.gcash-mark { width: 26px; height: 26px; border-radius: 50%; background: #fff; color: #005ce6; font: 800 16px/26px "Barlow", sans-serif; display: inline-block; }
.btn-sub { display: block; font-size: 12px; font-weight: 500; opacity: .75; }

/* Finished hours with nothing in them are tucked away */
.sched-court:not(.show-earlier) .slot-row.earlier { display: none; }
.earlier-toggle { display: block; width: 100%; margin: 0 0 6px; padding: 9px; border: 0; border-radius: 10px; background: #f3f5f0; color: var(--muted); font: 600 13px "Barlow", sans-serif; cursor: pointer; }
.earlier-toggle .hide-txt, .show-earlier .earlier-toggle .show-txt { display: none; }
.show-earlier .earlier-toggle .hide-txt { display: inline; }
.sched-empty { margin: 4px 2px 10px; color: var(--muted); }

/* Confirm before holding a slot */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(15,18,16,.45); z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.confirm-sheet { background: #fff; width: 100%; max-width: 460px; border-radius: 20px 20px 0 0; padding: 20px 18px calc(18px + env(safe-area-inset-bottom)); }
.confirm-sheet h2 { margin: 0 0 10px; }
.cf-when { display: flex; flex-direction: column; background: color-mix(in srgb, var(--brand) 8%, #fff); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; }
.cf-when b { font: 700 20px var(--display); }
.cf-when span { color: var(--muted); font-size: 14px; }
.cf-actions { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; margin-top: 6px; }
.cf-actions .btn { padding: 14px; font-size: 16px; }
@media (min-width: 600px) { .sheet-backdrop { align-items: center; } .confirm-sheet { border-radius: 20px; } }

/* Player cancels their hold */
.release { text-align: center; margin: 6px 0 18px; display: flex; flex-direction: column; gap: 2px; align-items: center; }
.link-btn { background: none; border: 0; padding: 8px 12px; font: 600 15px "Barlow", sans-serif; color: var(--err); text-decoration: underline; cursor: pointer; }
.link-btn:disabled { opacity: .6; cursor: wait; }

/* Small grey text stays readable on bright screens and thin fonts */
.muted, .chip small, .venue .muted, .venue-desc, .court-head .muted, .slot small { font-weight: 500; }

/* Check-in with court fee */
.checkin-form { display: grid; gap: 10px; }
.collect-field { font-size: 13px; font-weight: 600; }
.peso { display: flex; align-items: center; border: 1.5px solid var(--paddle); border-radius: 12px; margin-top: 6px; padding-left: 14px; background: #fff; }
.peso span { font: 700 24px var(--display); }
.peso input { border: 0; margin: 0; font: 700 24px var(--display); padding: 10px 12px 10px 6px; outline: none; }
.fee-reason { display: grid; gap: 8px; }
.fee-reason label { font-size: 13px; font-weight: 600; }
.late-note { margin: 0; background: #fff4e0; color: #6b4a05; border-radius: 10px; padding: 10px 12px; font-size: 14px; }

.bk-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.bk-fee { font-size: 12px; font-weight: 700; white-space: nowrap; }
.bk-fee.due { color: var(--paddle); background: var(--ball); padding: 2px 8px; border-radius: 99px; }
.bk-fee.paid { color: #2f6b0a; }
.updated { font-size: 12px; color: var(--muted); margin-left: 4px; align-self: flex-end; padding-bottom: 4px; }

/* Owner orientation */
.guide { max-width: 680px; }
.guide section { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; margin: 12px 0; }
.guide section h2 { margin: 0 0 8px; }
.guide ul { padding-left: 20px; margin: 0; }
.guide li { margin: 6px 0; }
.guide-key { background: var(--paddle) !important; color: #fff; border-color: var(--paddle) !important; }
.guide-key h2 { color: var(--ball); }
.guide-key b { color: var(--ball); }
.guide-done { margin: 18px 0 30px; }

/* ---------- Wait animation: the DinkBook paddle hits the ball ---------- */
.dbl { position: fixed; inset: 0; z-index: 9999; display: grid; place-items: center; padding: 16px;
  background: rgba(255, 255, 255, .78); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  visibility: hidden; opacity: 0; transition: opacity .18s ease, visibility 0s linear .18s; }
.dbl.on { visibility: visible; opacity: 1; transition: opacity .18s ease; }
.dbl-card { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px 26px 16px;
  background: #fff; border-radius: 22px; box-shadow: 0 12px 40px rgba(22, 25, 26, .16); min-width: 180px; max-width: 280px; text-align: center; }
.dbl-art { position: relative; width: 104px; height: 104px; }
.dbl-art img { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; user-select: none; }
.dbl-label { font-weight: 700; color: var(--paddle, #16191a); font-size: 1rem; }
.dbl-sub { color: var(--muted, #56605a); font-size: .82rem; min-height: 1em; }
.dbl-dots::after { content: ''; display: inline-block; width: 1.1em; text-align: left; animation: dbl-dots 1.2s steps(4) infinite; }
.dbl-hop { position: absolute; inset: 0; }
.dbl.on .dbl-hop { transform-origin: 50% 88%; animation: dbl-hop 1.2s infinite; }
.dbl.on .dbl-ball { transform-origin: 67.6% 64%; animation: dbl-roll 1.2s cubic-bezier(.45, 0, .25, 1) infinite; }
.dbl.on .dbl-shadow { transform-origin: 66% 85%; animation: dbl-shadow 1.2s infinite; }
.dbl.on .dbl-rays { transform-origin: 82% 40%; animation: dbl-rays 1.2s infinite; }
/* The whole logo moves as one piece, so the paddle and ball never separate. */
@keyframes dbl-hop {
  0% { transform: translateY(0) scale(1, 1); animation-timing-function: ease-out; }
  12% { transform: translateY(0) scale(1.05, .93); animation-timing-function: ease-out; }
  45% { transform: translateY(-13%) rotate(-5deg) scale(.98, 1.03); animation-timing-function: ease-in; }
  78% { transform: translateY(0) rotate(0) scale(1, 1); }
  86% { transform: translateY(0) scale(1.04, .95); }
  100% { transform: translateY(0) scale(1, 1); }
}
@keyframes dbl-roll { from { transform: rotate(0) } to { transform: rotate(360deg) } }
@keyframes dbl-shadow { 0%, 12%, 78%, 100% { transform: scale(1); opacity: 1 } 45% { transform: scale(.68); opacity: .35 } }
@keyframes dbl-rays { 0%, 74% { opacity: 0; transform: scale(.6) } 82% { opacity: 1; transform: scale(1.1) } 92% { opacity: 1; transform: scale(1) } 100% { opacity: 0; transform: scale(1.15) } }
@keyframes dbl-dots { 0% { content: '' } 25% { content: '.' } 50% { content: '..' } 75% { content: '...' } }
/* Small inline version for buttons and boxes: <span class="dbl-mini"></span> */
.dbl-mini { display: inline-block; width: 1.25em; height: 1.25em; vertical-align: -.25em; background: url(loader/ball.png) center / contain no-repeat; animation: dbl-spin .8s linear infinite; }
@keyframes dbl-spin { to { transform: rotate(360deg) } }
@media (prefers-reduced-motion: reduce) {
  .dbl.on .dbl-hop, .dbl.on .dbl-ball, .dbl.on .dbl-shadow, .dbl-mini { animation: none; }
  .dbl.on .dbl-rays { animation: dbl-pulse 1.6s ease-in-out infinite; }
  .dbl-dots::after { animation: none; content: '…'; }
  @keyframes dbl-pulse { 0%, 100% { opacity: .25 } 50% { opacity: 1 } }
}

/* ---------- DinkBook public site: main page, About, Contact ---------- */
body.site { background: #fff; --brand: var(--paddle); }
body.site .wrap { max-width: 1120px; padding: 0 16px 0; }
body.site h1, body.site h2 { font-family: var(--display); }
.btn.small { padding: 8px 14px; font-size: 14px; border-radius: 9px; }
body.site .btn { background: var(--paddle); color: #fff; }
body.site .btn.ghost { background: transparent; color: var(--paddle); border: 1.5px solid var(--paddle); }
.site-top { position: sticky; top: 0; z-index: 50; background: rgba(255, 255, 255, .92); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.site-top-in { max-width: 1120px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 18px; }
.site-logo img { height: 26px; width: auto; display: block; }
.site-nav { display: flex; gap: 4px; margin-left: auto; }
.site-nav a { color: var(--ink); text-decoration: none; font-weight: 600; padding: 7px 12px; border-radius: 8px; }
.site-nav a:hover { background: #f0f2ef; }
.site-nav a.on { background: var(--ball-soft); color: var(--paddle); box-shadow: inset 0 -2px 0 var(--ball); }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: 12px; font-weight: 700; color: var(--link); margin: 0 0 8px; }
.sh-lead { font-size: 17px; color: #3d4640; max-width: 560px; margin: 0 0 20px; }

.site-hero { margin: 18px 0 8px; padding: 40px 36px; border-radius: 24px; background: var(--paddle); color: #fff; display: grid; grid-template-columns: 1fr 260px; gap: 20px; align-items: center; overflow: hidden; position: relative; }
.site-hero::after { content: ''; position: absolute; right: -80px; bottom: -120px; width: 360px; height: 360px; border-radius: 50%; background: radial-gradient(circle, rgba(138, 228, 15, .22), transparent 65%); pointer-events: none; }
.site-hero .eyebrow { color: var(--ball); }
.site-hero h1 { font-size: 46px; line-height: 1.02; margin: 0 0 14px; font-style: italic; font-weight: 800; letter-spacing: -.01em; }
.site-hero h1 span { color: var(--ball); }
.site-hero .sh-lead { color: #cfd6d0; }
.sh-art { width: 100%; max-width: 260px; justify-self: end; position: relative; z-index: 1; filter: drop-shadow(0 18px 30px rgba(0, 0, 0, .35)); }
.venue-search { display: flex; align-items: center; gap: 8px; background: #fff; border-radius: 14px; padding: 6px 6px 6px 14px; max-width: 560px; color: var(--muted); box-shadow: 0 8px 24px rgba(0, 0, 0, .18); }
.venue-search input { flex: 1; min-width: 0; border: 0; outline: 0; font: inherit; font-size: 16px; padding: 10px 2px; color: var(--ink); background: transparent; }
body.site .venue-search .btn { background: var(--ball); color: var(--paddle); font-weight: 700; padding: 11px 20px; }

.venues { margin-top: 34px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-head h2 { font-size: 26px; margin: 0; }
.section-head > span { white-space: nowrap; }
.venue-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.venue-card { --vc: #16794c; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: #fff; color: var(--ink); text-decoration: none; transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
.venue-card:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(22, 25, 26, .12); border-color: #cfd5cb; }
.venue-card:focus-visible { outline: 3px solid var(--ball); outline-offset: 2px; }
.vc-banner { position: relative; height: 120px; background: var(--vc) center / cover no-repeat; background-image: linear-gradient(135deg, var(--vc), color-mix(in srgb, var(--vc) 60%, #000)); }
.vc-logo { position: absolute; left: 16px; bottom: -26px; width: 58px; height: 58px; border-radius: 14px; object-fit: cover; background: #fff; border: 3px solid #fff; box-shadow: 0 4px 12px rgba(0, 0, 0, .15); }
.vc-initial { display: grid; place-items: center; font: 800 26px var(--display); color: var(--vc); }
.vc-body { padding: 34px 16px 14px; display: flex; flex-direction: column; flex: 1; }
.vc-body h3 { font: 700 20px/1.15 var(--display); margin: 0 0 4px; }
.vc-place { display: flex; gap: 5px; align-items: flex-start; color: var(--muted); font-size: 14px; margin: 0 0 10px; }
.vc-place svg { flex: none; margin-top: 3px; }
.vc-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.vc-tags span { font-size: 12px; font-weight: 600; background: #f1f4ef; color: #3d4640; padding: 3px 9px; border-radius: 99px; }
.vc-foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--line); padding-top: 11px; font-size: 14px; color: var(--muted); }
.vc-foot b { color: var(--ink); }
.vc-go { font-weight: 700; color: var(--link); }
.venue-card:hover .vc-go { text-decoration: underline; }
.venue-empty { text-align: center; padding: 40px 16px; border: 1.5px dashed #d6dcd3; border-radius: 18px; }
.venue-empty h3 { font: 700 20px var(--display); }
.venue-empty a, .owner-cta a:not(.btn), .page-hero a { color: var(--link); }

.how-steps { margin: 44px 0 0; }
.how-steps h2 { font-size: 26px; }
.how-steps ol { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; counter-reset: s; }
.how-steps li { counter-increment: s; background: #f7f9f6; border-radius: 16px; padding: 18px; display: flex; flex-direction: column; gap: 4px; }
.how-steps li::before { content: counter(s); width: 34px; height: 34px; border-radius: 50%; background: var(--ball); color: var(--paddle); display: grid; place-items: center; font: 800 18px var(--display); margin-bottom: 6px; }
.how-steps li b { font-size: 16px; }
.how-steps li span { color: var(--muted); font-size: 14px; }

.owner-cta { margin: 44px 0 0; padding: 28px; border-radius: 20px; background: var(--ball-soft); display: flex; align-items: center; justify-content: space-between; gap: 20px; border: 1px solid #d9efbb; }
.owner-cta h2 { margin: 0 0 6px; font-size: 24px; }
.owner-cta p { margin: 0; color: #3d4640; max-width: 620px; }
.owner-cta .btn { flex: none; }

.page-hero { padding: 48px 0 10px; max-width: 760px; }
.page-hero h1 { font-size: 42px; line-height: 1.05; font-style: italic; font-weight: 800; }
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 18px; }
.about-card { border: 1px solid var(--line); border-radius: 18px; padding: 22px; }
.about-card h2 { margin-top: 0; font-size: 22px; }
.about-card ul { margin: 0; padding-left: 0; list-style: none; display: grid; gap: 9px; }
.about-card li { padding-left: 22px; position: relative; }
.about-card li::before { content: ''; position: absolute; left: 0; top: .5em; width: 10px; height: 10px; border-radius: 50%; background: var(--ball); box-shadow: 0 0 0 2px var(--paddle) inset; }
.about-rules { margin-top: 40px; }
.about-rules h2 { font-size: 26px; }
.rules { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.rules > div { background: #f7f9f6; border-radius: 16px; padding: 16px; }
.rules p { margin: 6px 0 0; color: var(--muted); font-size: 14px; }

.contact-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-top: 18px; }
.contact-card { display: flex; align-items: center; gap: 14px; padding: 18px; border: 1px solid var(--line); border-radius: 18px; color: var(--ink); text-decoration: none; background: #fff; min-width: 0; }
a.contact-card:hover { border-color: #cfd5cb; box-shadow: 0 10px 24px rgba(22, 25, 26, .08); }
.contact-card > span:last-child { min-width: 0; }
.contact-card small { display: block; color: var(--muted); font-size: 13px; }
.contact-card b { display: block; font-size: 17px; overflow-wrap: anywhere; }
.cc-icon { flex: none; width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--ball-soft); color: var(--paddle); }
.contact-card.fb { background: var(--paddle); color: #fff; border-color: var(--paddle); }
.contact-card.fb small { color: #b9c2bb; }
.contact-card.fb .cc-icon { background: #1877f2; color: #fff; }

.site-foot { margin-top: 56px; background: var(--paddle); color: #cfd6d0; }
.site-foot-in { max-width: 1120px; margin: 0 auto; padding: 36px 16px 10px; display: grid; grid-template-columns: 1.4fr 1fr 1.2fr; gap: 24px; }
.site-foot h4 { color: #fff; margin: 0 0 10px; font: 700 15px var(--display); text-transform: uppercase; letter-spacing: .08em; }
.site-foot a, .site-foot span { display: block; color: #cfd6d0; text-decoration: none; margin-bottom: 6px; font-size: 14px; overflow-wrap: anywhere; }
.site-foot a:hover { color: var(--ball); }
.sf-brand img { height: 26px; width: auto; filter: brightness(0) invert(1); }
.sf-brand p { font-size: 14px; max-width: 280px; }
.sf-copy { max-width: 1120px; margin: 0 auto; padding: 14px 16px 22px; font-size: 13px; color: #8d978f; border-top: 1px solid #2a2f2c; }

@media (max-width: 860px) {
  .site-hero { grid-template-columns: 1fr; padding: 28px 20px; }
  .sh-art { position: absolute; right: -30px; top: -20px; width: 150px; opacity: .22; }
  .site-hero h1 { font-size: 36px; }
  .how-steps ol, .rules { grid-template-columns: 1fr; }
  .about-grid, .contact-grid { grid-template-columns: 1fr; }
  .site-foot-in { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .site-top-in { flex-wrap: wrap; gap: 8px 12px; padding: 10px 16px 6px; }
  .site-top-in .btn { margin-left: auto; }
  .site-nav { order: 3; width: 100%; margin: 0 -12px; overflow-x: auto; }
  .site-nav a { white-space: nowrap; }
  .site-hero { margin-top: 12px; border-radius: 18px; }
  .site-hero h1 { font-size: 32px; }
  .sh-lead { font-size: 15.5px; }
  .venue-search .btn { padding: 11px 14px; }
  .owner-cta { flex-direction: column; align-items: flex-start; padding: 22px; }
  .page-hero { padding-top: 26px; }
  .page-hero h1 { font-size: 32px; }
  .section-head h2 { font-size: 22px; }
}

/* ---------- Open play ---------- */
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 14px; }
@media (max-width: 640px) { .grid3 { grid-template-columns: 1fr 1fr; } .grid3 > label:first-child:nth-last-child(3) { grid-column: 1 / -1; } }
.op-level { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 99px; background: #eef1ee; color: #3d4640; white-space: nowrap; }
.op-level.lv-beginner { background: var(--ball-soft); color: #2f6b0a; }
.op-level.lv-intermediate { background: #e3eefc; color: #1f4f99; }
.op-level.lv-advanced { background: var(--paddle); color: var(--ball); }
.op-dot { display: block; width: 6px; height: 6px; border-radius: 50%; background: var(--ball); margin: 3px auto 0; box-shadow: 0 0 0 1.5px var(--paddle); }
.chip.on .op-dot { box-shadow: 0 0 0 1.5px #fff; }
.op-list { margin-bottom: 6px; }
.op-card { border-left: 4px solid var(--ball); }
.op-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 6px; }
.op-time { font-weight: 700; font-size: 14px; }
.op-title { display: block; font: 700 18px/1.2 var(--display); margin-bottom: 2px; }
.op-notes { margin: 8px 0 0; color: #3d4640; }
.op-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.op-spots { font-size: 14px; color: var(--muted); }
.op-spots b { color: var(--ink); font-size: 16px; }
.op-spots.full { color: #8a5a00; font-weight: 600; }
.op-join { padding: 10px 18px; }
.op-next { margin: 4px 0 14px; font-size: 14px; color: var(--muted); }
.slot.openplay { background: var(--ball-soft); border-color: #cfe9a6; opacity: .85; }
.slot.openplay small { color: #2f6b0a; font-weight: 600; }

.op-day { font-size: 16px; margin: 22px 0 8px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.op-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); margin-bottom: 10px; border-left: 4px solid var(--ball); }
.op-row:hover { border-color: #cfd5cb; border-left-color: var(--ball); box-shadow: 0 6px 18px rgba(22, 25, 26, .07); }
.op-row.cancelled { opacity: .55; border-left-color: #ccc; }
.op-row-main { display: flex; flex-direction: column; min-width: 0; }
.op-row-main b { font-size: 16px; }
.op-row-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: none; }
.op-count { font-size: 13px; font-weight: 700; white-space: nowrap; }
.op-detail h1 { margin-top: 4px; }
.op-player { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 11px 2px; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.op-player:last-child { border-bottom: 0; }
.op-player > span:first-child { display: flex; flex-direction: column; }
.op-player small { color: var(--muted); }
.op-player-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.bk-status.st-booked { background: #e3eefc; color: #1f4f99; }
.bk-status.st-checked_in { background: #e1f3e8; color: var(--ok); }
.bk-status.st-no_show { background: #fdecec; color: var(--err); }
.bk-status.st-cancelled_owner { background: #fff1d1; color: #8a5a00; }
.op-edit summary { cursor: pointer; }
.op-edit[open] summary { margin-bottom: 12px; }
.court-pick { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px 6px; margin: 0 0 12px; }
.court-pick legend { font-weight: 600; font-size: 13px; padding: 0 4px; }
.court-pick label.check { margin-bottom: 8px; }
.op-banner { display: flex; align-items: center; gap: 12px; background: var(--ball-soft); border: 1px solid #d9efbb; border-radius: 12px; padding: 10px 14px; margin: 0 0 12px; color: var(--ink); text-decoration: none; }
.op-banner-main { display: flex; flex-direction: column; flex: 1; min-width: 0; gap: 2px; }
.op-banner-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.op-banner .op-count { text-align: right; color: #2f6b0a; }
.op-banner small { color: var(--muted); }
.bk.openplay { background: var(--ball-soft); border: 1px dashed #b9df85; color: var(--ink); text-decoration: none; }

/* ---------- Check-in QR scanning ---------- */
.scan-page h1 { margin-bottom: 4px; }
.scan-box { position: relative; background: var(--paddle); border-radius: 18px; overflow: hidden; aspect-ratio: 3 / 4; max-height: 62vh; margin: 14px 0 10px; display: grid; place-items: center; }
.scan-box video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scan-frame { position: absolute; inset: 18% 14%; pointer-events: none; opacity: 0; transition: opacity .2s; }
.scan-box.live .scan-frame { opacity: 1; }
.scan-frame i { position: absolute; width: 34px; height: 34px; border: 4px solid var(--ball); }
.scan-frame i:nth-child(1) { top: 0; left: 0; border-right: 0; border-bottom: 0; border-radius: 10px 0 0 0; }
.scan-frame i:nth-child(2) { top: 0; right: 0; border-left: 0; border-bottom: 0; border-radius: 0 10px 0 0; }
.scan-frame i:nth-child(3) { bottom: 0; left: 0; border-right: 0; border-top: 0; border-radius: 0 0 0 10px; }
.scan-frame i:nth-child(4) { bottom: 0; right: 0; border-left: 0; border-top: 0; border-radius: 0 0 10px 0; }
.scan-start { position: relative; z-index: 1; text-align: center; color: #cfd6d0; padding: 20px; width: 100%; max-width: 320px; }
body.has-tabbar .scan-start .btn { background: var(--ball); color: var(--paddle); }
.scan-msg { min-height: 1.4em; font-weight: 600; margin: 0 0 12px; }
.scan-msg.ok { color: var(--ok); }
.scan-msg.bad { color: var(--err); }
.scan-alt b { display: block; margin-bottom: 8px; }
.scan-verdict { display: flex; flex-direction: column; gap: 4px; border-radius: 14px; padding: 14px 16px; margin: 0 0 14px; border: 2px solid; }
.scan-verdict b { font: 700 19px/1.2 var(--display); }
.scan-verdict span { font-size: 14px; }
.scan-verdict .btn { margin-top: 10px; align-self: flex-start; }
.scan-verdict .scan-again { font-size: 13px; font-weight: 600; margin-top: 6px; color: inherit; }
.scan-verdict.ok { background: #e7f8d2; border-color: var(--ball); color: #1f4d05; }
body.has-tabbar .scan-verdict.ok .btn { background: var(--paddle); color: #fff; }
.scan-verdict.warn { background: #fff4d6; border-color: #f0c64f; color: #6b4a00; }
.scan-verdict.bad { background: #fdecec; border-color: #f2a8a8; color: #8f1d1d; }
.scan-verdict.info { background: #e3eefc; border-color: #a9c6f0; color: #1f4f99; }
.staff-link a { color: var(--muted); }
.mini-qr { display: flex; justify-content: center; margin: 14px 0 6px; }

/* ---------- Find player (one search box) ---------- */
.find-form label { margin-bottom: 6px; }
.find-row { display: flex; gap: 8px; margin-bottom: 6px; }
.find-row input { flex: 1 1 auto; width: auto; min-width: 0; font-size: 16px; }
.find-row .btn, body.has-tabbar .form .find-row .btn { flex: none; width: auto; padding: 11px 16px; }
.find-hint, .find-count { margin: 6px 0 10px; }
.result { display: flex; flex-direction: column; gap: 2px; }
.result-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.result-top .status { flex: none; }
.result-line { font-size: 14px; overflow-wrap: anywhere; }
.result mark { background: var(--ball); color: var(--paddle); border-radius: 3px; padding: 0 1px; }
