/* Court Booking: iOS-style design tokens.
   Layout: iPhone-style tab bar + large titles under 900px, iPadOS sidebar above it.
   Grouped inset lists on the system grouped background; court-green tint, optic-yellow ball accent. */
:root {
  color-scheme: light;
  --bg: #F2F2F7;
  --surface: #FFFFFF;
  --surface-2: #F2F2F7;
  --elevated: #FFFFFF;
  --sheet-bg: #F2F2F7;
  --sheet-surface: #FFFFFF;
  --fill: rgba(120, 120, 128, 0.12);
  --fill-2: rgba(120, 120, 128, 0.2);
  --label: #000000;
  --label-2: rgba(60, 60, 67, 0.64);
  --label-3: rgba(60, 60, 67, 0.32);
  --sep: rgba(60, 60, 67, 0.17);
  --sep-strong: rgba(60, 60, 67, 0.29);
  --bar: rgba(249, 249, 249, 0.84);
  --glass: rgba(255, 255, 255, 0.58);
  --glass-strong: rgba(255, 255, 255, 0.72);
  --glass-edge: rgba(255, 255, 255, 0.85);
  --glass-border: rgba(60, 60, 67, 0.12);
  --glass-shadow: 0 10px 30px rgba(0, 0, 0, 0.12), 0 1px 3px rgba(0, 0, 0, 0.06);
  --seg-on: #FFFFFF;
  --alert-bg: rgba(242, 242, 242, 0.94);
  --toast-bg: rgba(28, 28, 30, 0.94);
  --toast-fg: #FFFFFF;

  --tint: #0A8754;
  --tint-hover: #087347;
  --on-tint: #FFFFFF;
  --tint-soft: rgba(10, 135, 84, 0.11);
  --select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230A8754' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 9.5l4-4 4 4M8 14.5l4 4 4-4'/%3E%3C/svg%3E");
  --tint-soft-2: rgba(10, 135, 84, 0.2);
  --chart-muted: rgba(10, 135, 84, 0.36);
  --ball: #D4E42A;

  --blue: #007AFF;
  --green: #34C759;
  --orange: #FF9500;
  --red: #FF3B30;
  --indigo: #5856D6;
  --purple: #AF52DE;
  --teal: #2A9BB0;
  --gray: #8E8E93;
  --red-text: #D70015;

  --radius: 12px;
  --gutter: 16px;
  --fs-body: 17px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-round: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Segoe UI Variable Display", "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --shadow-pop: 0 10px 30px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.06);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #000000;
    --surface: #1C1C1E;
    --surface-2: #2C2C2E;
    --elevated: #2C2C2E;
    --sheet-bg: #1C1C1E;
    --sheet-surface: #2C2C2E;
    --fill: rgba(118, 118, 128, 0.24);
    --fill-2: rgba(118, 118, 128, 0.36);
    --label: #FFFFFF;
    --label-2: rgba(235, 235, 245, 0.64);
    --label-3: rgba(235, 235, 245, 0.32);
    --sep: rgba(84, 84, 88, 0.55);
    --sep-strong: rgba(84, 84, 88, 0.8);
    --bar: rgba(22, 22, 24, 0.84);
    --glass: rgba(44, 44, 46, 0.5);
    --glass-strong: rgba(28, 28, 30, 0.66);
    --glass-edge: rgba(255, 255, 255, 0.14);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    --seg-on: #636366;
    --alert-bg: rgba(44, 44, 46, 0.94);
    --toast-bg: rgba(58, 58, 60, 0.96);
    --tint: #30D186;
    --tint-hover: #52DC9C;
    --on-tint: #00210F;
    --tint-soft: rgba(48, 209, 134, 0.14);
    --select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2330D186' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 9.5l4-4 4 4M8 14.5l4 4 4-4'/%3E%3C/svg%3E");
    --tint-soft-2: rgba(48, 209, 134, 0.24);
    --chart-muted: rgba(48, 209, 134, 0.38);
    --blue: #0A84FF;
    --green: #30D158;
    --orange: #FF9F0A;
    --red: #FF453A;
    --indigo: #5E5CE6;
    --purple: #BF5AF2;
    --teal: #40C8E0;
    --gray: #8E8E93;
    --red-text: #FF6961;
    --shadow-pop: 0 10px 30px rgba(0, 0, 0, 0.5);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #000000;
  --surface: #1C1C1E;
  --surface-2: #2C2C2E;
  --elevated: #2C2C2E;
  --sheet-bg: #1C1C1E;
  --sheet-surface: #2C2C2E;
  --fill: rgba(118, 118, 128, 0.24);
  --fill-2: rgba(118, 118, 128, 0.36);
  --label: #FFFFFF;
  --label-2: rgba(235, 235, 245, 0.64);
  --label-3: rgba(235, 235, 245, 0.32);
  --sep: rgba(84, 84, 88, 0.55);
  --sep-strong: rgba(84, 84, 88, 0.8);
  --bar: rgba(22, 22, 24, 0.84);
  --glass: rgba(44, 44, 46, 0.5);
  --glass-strong: rgba(28, 28, 30, 0.66);
  --glass-edge: rgba(255, 255, 255, 0.14);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  --seg-on: #636366;
  --alert-bg: rgba(44, 44, 46, 0.94);
  --toast-bg: rgba(58, 58, 60, 0.96);
  --tint: #30D186;
  --tint-hover: #52DC9C;
  --on-tint: #00210F;
  --tint-soft: rgba(48, 209, 134, 0.14);
  --select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2330D186' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 9.5l4-4 4 4M8 14.5l4 4 4-4'/%3E%3C/svg%3E");
  --tint-soft-2: rgba(48, 209, 134, 0.24);
  --chart-muted: rgba(48, 209, 134, 0.38);
  --blue: #0A84FF;
  --green: #30D158;
  --orange: #FF9F0A;
  --red: #FF453A;
  --indigo: #5E5CE6;
  --purple: #BF5AF2;
  --teal: #40C8E0;
  --gray: #8E8E93;
  --red-text: #FF6961;
  --shadow-pop: 0 10px 30px rgba(0, 0, 0, 0.5);
}

@media (min-width: 700px) { :root { --gutter: 24px; } }
@media (min-width: 900px) { :root { --fs-body: 15px; } }
@media (min-width: 1200px) { :root { --gutter: 36px; } }

/* ---- Base ---- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { margin: 0; min-height: 100%; }
body {
  font: 400 var(--fs-body)/1.35 var(--font);
  letter-spacing: -0.012em;
  background: var(--bg);
  color: var(--label);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
body.locked { overflow: hidden; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
a { color: var(--tint); }
img, svg { max-width: 100%; }
h1, h2, h3, p { margin: 0; }
:focus-visible { outline: 2px solid var(--tint); outline-offset: 2px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip { position: absolute; left: 12px; top: -60px; z-index: 300; background: var(--tint); color: var(--on-tint); padding: 10px 14px; border-radius: 10px; }
.skip:focus { top: calc(env(safe-area-inset-top, 0px) + 8px); }
.ico { display: inline-grid; place-items: center; flex: none; width: 22px; height: 22px; }
.ico svg { width: 100%; height: 100%; display: block; }
.mono { font-family: var(--mono); letter-spacing: 0.02em; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--label-2); }
.boot { padding: 40vh 0 0; text-align: center; color: var(--label-2); }

/* ---- App frame ---- */
.app { min-height: 100vh; }
.main { min-width: 0; padding-bottom: calc(49px + env(safe-area-inset-bottom, 0px) + 40px); outline: none; }
.sidebar { display: none; }

@media (min-width: 900px) {
  .app { display: grid; grid-template-columns: 264px minmax(0, 1fr); }
  .sidebar {
    display: flex; flex-direction: column; gap: 2px;
    position: sticky; top: 0; height: 100vh; overflow-y: auto;
    padding: calc(env(safe-area-inset-top, 0px) + 18px) 12px 18px;
    border-right: 1px solid var(--sep);
    background: var(--bg);
  }
  .tabbar { display: none !important; }
  .main { padding-bottom: 64px; }
}

.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 14px; min-width: 0; }
.brand-mark { width: 34px; height: 34px; flex: none; border-radius: 9px; background: #0B7A4D; display: grid; place-items: center; }
.brand-mark img { width: 28px; height: 28px; display: block; }
.brand-name { font-weight: 700; font-size: 17px; line-height: 1.2; overflow-wrap: anywhere; }
.brand-sub { font-size: 12px; color: var(--label-2); }
.side-label { font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--label-2); padding: 14px 10px 6px; }
.side-link {
  display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 10px;
  color: var(--label); text-decoration: none; font-size: 15px; font-weight: 500; border: 0; background: none; width: 100%; text-align: left;
}
.side-link .ico { color: var(--tint); width: 22px; height: 22px; }
.side-link:hover { background: var(--fill); }
.side-link[aria-current="page"] { background: var(--tint); color: var(--on-tint); }
.side-link[aria-current="page"] .ico { color: var(--on-tint); }
.side-foot { margin-top: auto; padding-top: 16px; display: grid; gap: 2px; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  display: flex; justify-content: space-around;
  padding: 5px 6px calc(3px + env(safe-area-inset-bottom, 0px));
  background: var(--bar);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-top: 1px solid var(--sep);
}
.tab {
  flex: 1; max-width: 140px; min-height: 46px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 10.5px; font-weight: 500; letter-spacing: 0.01em; color: var(--gray); text-decoration: none;
}
.tab .ico { width: 27px; height: 27px; }
.tab[aria-current="page"] { color: var(--tint); }

/* ---- Navigation bar and large title ---- */
.navbar {
  position: sticky; top: 0; z-index: 40;
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 8px;
  min-height: calc(46px + env(safe-area-inset-top, 0px));
  padding: env(safe-area-inset-top, 0px) var(--gutter) 0;
  border-bottom: 1px solid transparent;
  transition: background-color 0.2s, border-color 0.2s;
}
.navbar.scrolled {
  background: var(--bar);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom-color: var(--sep);
}
.nav-title { font-size: 17px; font-weight: 600; opacity: 0; transition: opacity 0.2s; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 52vw; }
.navbar.scrolled .nav-title { opacity: 1; }
.nav-left, .nav-right { display: flex; align-items: center; gap: 6px; min-width: 0; }
.nav-right { justify-content: flex-end; }

/* ---- Phone and small tablet: frosted-glass top bar and a floating glass tab bar ---- */
@media (max-width: 899px) {
  .navbar, .navbar.scrolled {
    background: var(--glass-strong);
    -webkit-backdrop-filter: saturate(190%) blur(24px);
    backdrop-filter: saturate(190%) blur(24px);
    border-bottom: 1px solid var(--glass-border);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.05);
  }
  .navbar .icon-btn, .navbar .btn-plain {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    box-shadow: inset 0 1px 0 var(--glass-edge);
    border-radius: 999px;
  }
  .navbar .btn-plain { padding: 0 12px; min-height: 34px; }
  .tabbar {
    left: max(12px, calc(50% - 260px)); right: max(12px, calc(50% - 260px));
    bottom: calc(env(safe-area-inset-bottom, 0px) + 10px);
    gap: 4px; padding: 6px;
    border-radius: 32px;
    background: var(--glass);
    -webkit-backdrop-filter: saturate(190%) blur(24px);
    backdrop-filter: saturate(190%) blur(24px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow), inset 0 1px 0 var(--glass-edge);
  }
  .tab { min-height: 50px; border-radius: 26px; transition: background-color 0.2s; }
  .tab[aria-current="page"] { background: var(--tint-soft-2); }
  .main { padding-bottom: calc(64px + 10px + env(safe-area-inset-bottom, 0px) + 32px); }
}

.content { max-width: 1120px; margin: 0 auto; padding-inline: var(--gutter); display: flex; flex-direction: column; gap: 26px; }
.title-block { display: grid; gap: 4px; padding-top: 2px; }
.large-title { font-size: 34px; line-height: 1.12; font-weight: 700; letter-spacing: 0.01em; text-wrap: balance; }
.subtitle { color: var(--label-2); font-size: 15px; display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; }
.subtitle .ico { width: 16px; height: 16px; }
.subtitle span { display: inline-flex; align-items: center; gap: 5px; }

.stack { display: flex; flex-direction: column; gap: 26px; min-width: 0; }
.cols { display: grid; gap: 26px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 1000px) {
  .cols.c-1-1 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
@media (min-width: 1240px) {
  .cols.c-3-2 { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
}

/* ---- Grouped inset lists ---- */
.group { display: flex; flex-direction: column; min-width: 0; }
.group-title {
  font-size: 13px; font-weight: 400; text-transform: uppercase; letter-spacing: 0.02em;
  color: var(--label-2); padding: 0 16px 7px; display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
}
.group-title.big { text-transform: none; font-size: 20px; font-weight: 700; color: var(--label); letter-spacing: 0; padding: 0 2px 8px; }
.group-foot { font-size: 13px; color: var(--label-2); padding: 7px 16px 0; line-height: 1.4; }
.list { background: var(--surface); border-radius: var(--radius); overflow: hidden; min-width: 0; }
.list > * { position: relative; }
.list > * + *::before {
  content: ""; position: absolute; top: 0; left: 16px; right: 0; height: 1px; background: var(--sep); pointer-events: none;
}
.list > .has-icon + *::before, .list > * + .has-icon::before { left: 58px; }

.cell {
  display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 10px 16px;
  width: 100%; border: 0; background: none; color: inherit; text-align: left; text-decoration: none; font-size: var(--fs-body);
}
button.cell:hover, a.cell:hover { background: rgba(120, 120, 128, 0.06); }
button.cell:active, a.cell:active { background: var(--fill); }
button.cell:focus-visible, a.cell:focus-visible { outline-offset: -3px; }
.cell-icon { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; color: #FFFFFF; background: var(--gray); flex: none; }
.cell-icon .ico { width: 19px; height: 19px; }
.cell-icon[data-c="tint"] { background: var(--tint); color: var(--on-tint); }
.cell-icon[data-c="green"] { background: var(--green); }
.cell-icon[data-c="blue"] { background: var(--blue); }
.cell-icon[data-c="orange"] { background: var(--orange); }
.cell-icon[data-c="red"] { background: var(--red); }
.cell-icon[data-c="indigo"] { background: var(--indigo); }
.cell-icon[data-c="purple"] { background: var(--purple); }
.cell-icon[data-c="teal"] { background: var(--teal); }
.cell-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cell-title { overflow-wrap: anywhere; }
.cell-sub { font-size: 13.5px; color: var(--label-2); overflow-wrap: anywhere; }
.cell-value { color: var(--label-2); text-align: right; margin-left: auto; min-width: 0; overflow-wrap: anywhere; display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.cell-value.strong { color: var(--label); font-weight: 600; }
.chev { color: var(--label-3); width: 16px; height: 16px; flex: none; }
.cell.tint { color: var(--tint); }
.cell.danger { color: var(--red-text); }
.cell.center { justify-content: center; font-weight: 500; }
.cell[disabled] { opacity: 0.4; pointer-events: none; }

/* Form rows */
.field { display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 0 16px; }
.field > label { flex: none; width: 8.2em; max-width: 42%; }
.field input, .field select, .field textarea {
  flex: 1; min-width: 0; border: 0; background: transparent; outline: none; padding: 12px 0; font-size: var(--fs-body);
}
.field input::placeholder, .field textarea::placeholder { color: var(--label-3); }
.field:focus-within { box-shadow: inset 0 0 0 2px var(--tint-soft-2); border-radius: inherit; }
.field.stack { flex-direction: column; align-items: stretch; gap: 0; padding-top: 10px; }
.field.stack > label { width: auto; max-width: none; font-size: 13px; color: var(--label-2); }
.field textarea { resize: vertical; min-height: 84px; padding-top: 6px; line-height: 1.4; }
/* Dropdowns: a rounded, bordered button in the theme's colours. The chosen value is in the
   main text colour with a tinted up/down chevron, and the option list follows light/dark. */
.field select {
  -webkit-appearance: none; appearance: none; cursor: pointer;
  min-height: 36px; margin: 5px 0; padding: 7px 34px 7px 12px;
  border: 1px solid var(--sep-strong); border-radius: 10px;
  background: var(--select-chevron) right 10px center / 16px no-repeat, var(--fill);
  color: var(--label); text-align: left; text-overflow: ellipsis; white-space: nowrap; overflow: hidden;
  transition: background-color 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.field select:hover { background-color: var(--fill-2); }
.field select:focus-visible { border-color: var(--tint); box-shadow: 0 0 0 3px var(--tint-soft); }
.field:focus-within:has(> select) { box-shadow: none; }
.field select option { background-color: var(--elevated); color: var(--label); }
.field select option:disabled { color: var(--label-3); }
.field input[type="date"], .field input[type="time"] { text-align: right; color: var(--label-2); min-height: 44px; }
.field input.right { text-align: right; }
.field .unit { color: var(--label-2); }
.field.invalid { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--red) 45%, transparent); }

/* ---- Controls ---- */
.btn {
  -webkit-appearance: none; appearance: none; border: 0; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: 12px;
  font-size: var(--fs-body); font-weight: 600; white-space: nowrap;
  transition: background-color 0.15s, opacity 0.15s, transform 0.1s;
}
.btn:active { transform: scale(0.98); opacity: 0.86; }
.btn .ico { width: 20px; height: 20px; }
.btn-filled { background: var(--tint); color: var(--on-tint); }
.btn-filled:hover { background: var(--tint-hover); }
.btn-tinted { background: var(--tint-soft); color: var(--tint); }
.btn-tinted:hover { background: var(--tint-soft-2); }
.btn-gray { background: var(--fill); color: var(--label); }
.btn-gray:hover { background: var(--fill-2); }
.btn-danger { background: color-mix(in srgb, var(--red) 13%, transparent); color: var(--red-text); }
.btn-plain { background: transparent; color: var(--tint); font-weight: 400; padding: 0 6px; min-height: 40px; }
.btn-plain.bold { font-weight: 600; }
.btn-plain:hover { opacity: 0.75; }
.btn-lg { min-height: 52px; width: 100%; border-radius: 14px; }
.btn-sm { min-height: 32px; padding: 0 13px; font-size: 14px; border-radius: 999px; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.38; pointer-events: none; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 50%; border: 0; display: inline-grid; place-items: center;
  background: var(--fill); color: var(--tint); flex: none;
}
.icon-btn .ico { width: 20px; height: 20px; }
.icon-btn:hover { background: var(--fill-2); }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }
.btn-row > .btn { flex: 1 1 160px; }
.inline-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 2px; padding: 2px; background: var(--fill); border-radius: 9px; min-width: 0; }
.seg button {
  border: 0; background: transparent; border-radius: 7px; min-height: 30px; padding: 5px 8px;
  font-size: 13.5px; font-weight: 500; line-height: 1.15; overflow-wrap: anywhere;
  transition: background-color 0.15s;
}
.seg button[aria-pressed="true"] { background: var(--seg-on); font-weight: 600; box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12), 0 1px 1px rgba(0, 0, 0, 0.04); }
.seg button:disabled { color: var(--label-3); cursor: default; }
.seg.inline { display: inline-grid; }
.seg-cell { padding: 8px 12px; }
/* Tap-to-choose numbers inside a list row (e.g. minimum and maximum players). */
.seg.pick { display: inline-grid; grid-auto-columns: 44px; flex: none; }
.seg.pick button { min-height: 32px; font-variant-numeric: tabular-nums; }
@media (max-width: 420px) { .seg.pick { grid-auto-columns: 36px; } }

.switch {
  -webkit-appearance: none; appearance: none; margin: 0; flex: none; cursor: pointer;
  width: 51px; height: 31px; border-radius: 16px; position: relative; background: var(--fill-2); transition: background-color 0.2s;
}
.switch::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%;
  background: #FFFFFF; box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15), 0 3px 1px rgba(0, 0, 0, 0.06); transition: transform 0.22s;
}
.switch:checked { background: var(--tint); }
.switch:checked::after { transform: translateX(20px); }

.stepper { display: inline-flex; background: var(--fill); border-radius: 9px; flex: none; }
.stepper button { width: 46px; height: 32px; border: 0; background: transparent; display: grid; place-items: center; color: var(--label); }
.stepper button .ico { width: 18px; height: 18px; }
.stepper button + button { border-left: 1px solid var(--sep-strong); }
.stepper button:disabled { color: var(--label-3); cursor: default; }
.stepper-value { min-width: 2ch; text-align: right; font-variant-numeric: tabular-nums; color: var(--label); font-weight: 600; }

.search {
  display: flex; align-items: center; gap: 6px; background: var(--fill); border-radius: 10px; padding: 0 10px; min-height: 38px;
}
.search .ico { width: 18px; height: 18px; color: var(--label-2); }
.search input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; font-size: var(--fs-body); padding: 8px 0; }
.search:focus-within { box-shadow: 0 0 0 2px var(--tint-soft-2); }

.choices { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 16px 12px; }
.choice {
  border: 0; border-radius: 999px; padding: 7px 14px; font-size: 14px; font-weight: 500;
  background: var(--fill); color: var(--label);
}
.choice[aria-pressed="true"] { background: var(--tint); color: var(--on-tint); }
.choice:disabled { opacity: 0.35; cursor: default; }

/* ---- Chips, banners, tiles ---- */
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px 3px 8px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; line-height: 1.3; white-space: nowrap;
  background: var(--fill); color: var(--label);
}
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--c, var(--gray)); flex: none; }
.chip[data-c="green"] { --c: var(--green); background: color-mix(in srgb, var(--green) 15%, transparent); }
.chip[data-c="orange"] { --c: var(--orange); background: color-mix(in srgb, var(--orange) 16%, transparent); }
.chip[data-c="red"] { --c: var(--red); background: color-mix(in srgb, var(--red) 13%, transparent); }
.chip[data-c="blue"] { --c: var(--blue); background: color-mix(in srgb, var(--blue) 13%, transparent); }
.chip[data-c="indigo"] { --c: var(--indigo); background: color-mix(in srgb, var(--indigo) 14%, transparent); }
.chip[data-c="purple"] { --c: var(--purple); background: color-mix(in srgb, var(--purple) 15%, transparent); }
.chip[data-c="teal"] { --c: var(--teal); background: color-mix(in srgb, var(--teal) 15%, transparent); }
.chip .ico { width: 12px; height: 12px; color: var(--c, var(--gray)); }
.chip[data-c="gray"] { --c: var(--gray); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

.banner { display: flex; gap: 12px; align-items: flex-start; padding: 13px 16px; border-radius: var(--radius); background: var(--tint-soft); line-height: 1.4; }
.banner > .ico { color: var(--tint); margin-top: 1px; }
.banner .banner-main { flex: 1; min-width: 0; display: grid; gap: 4px; }
.banner strong { font-weight: 600; }
.banner.warn { background: color-mix(in srgb, var(--orange) 14%, transparent); }
.banner.warn > .ico { color: var(--orange); }
.banner.error { background: color-mix(in srgb, var(--red) 12%, transparent); }
.banner.error > .ico { color: var(--red-text); }
.banner .btn { margin-top: 6px; justify-self: start; }

.tiles { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 760px) { .tiles.t4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } .tiles.t6 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1240px) { .tiles.t6 { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.tile { background: var(--surface); border-radius: var(--radius); padding: 14px 16px 15px; display: flex; flex-direction: column; gap: 3px; min-width: 0; container-type: inline-size; }
.tile-label { font-size: 13px; font-weight: 600; color: var(--label-2); display: flex; align-items: center; gap: 6px; }
.tile-label .ico { width: 16px; height: 16px; color: var(--tint); }
/* Figures scale with the tile's width (up to 29px) and stay on one line, so amounts like
   "$21,900.00" never break across lines on phones. */
.tile-value { font: 700 clamp(17px, 18cqi, 29px)/1.15 var(--font-round); letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-sub { font-size: 13px; color: var(--label-2); }
.tile.attn .tile-label .ico { color: var(--orange); }
/* A box across the whole row of boxes, e.g. Reports "Net Income". */
.tiles > .tile-wide { grid-column: 1 / -1; }
.tile.negative .tile-value { color: var(--red-text); }
/* Dashboard: five tiles. Phones: two columns, the last tile full width. Medium: three
   tiles, then two wider ones. Wide: one row of five. Sized from the space the tiles have. */
.tiles-box { container: tiles / inline-size; }
.tiles.t5 > :last-child { grid-column: 1 / -1; }
@container tiles (min-width: 560px) {
  .tiles.t5 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .tiles.t5 > * { grid-column: span 2; }
  .tiles.t5 > :nth-child(n+4) { grid-column: span 3; }
}
@container tiles (min-width: 1040px) {
  .tiles.t5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .tiles.t5 > *, .tiles.t5 > :nth-child(n+4) { grid-column: auto; }
}
.meter { height: 6px; border-radius: 3px; background: var(--tint-soft-2); overflow: hidden; margin-top: 8px; }
.meter > span { display: block; height: 100%; background: var(--tint); border-radius: 3px; }

.card { background: var(--surface); border-radius: var(--radius); padding: 16px; min-width: 0; }
.card-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px 16px; margin-bottom: 14px; }
.card-title { font-size: 17px; font-weight: 600; }
.card-sub { font-size: 13px; color: var(--label-2); }

.empty { text-align: center; padding: 36px 20px; color: var(--label-2); display: grid; justify-items: center; gap: 6px; }
.empty > .ico { width: 46px; height: 46px; color: var(--label-3); margin-bottom: 4px; }
.empty h3 { color: var(--label); font-size: 20px; font-weight: 600; }
.empty p { max-width: 38ch; line-height: 1.4; }
.empty .btn { margin-top: 10px; }
.loading { padding: 28px; text-align: center; color: var(--label-2); }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid var(--fill-2); border-top-color: var(--label-2); animation: spin 0.8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Date strip ---- */
.datebar { display: flex; flex-direction: column; gap: 10px; }
.datebar-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.datebar-title { font-size: 20px; font-weight: 700; }
.datestrip {
  display: flex; gap: 4px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none;
  margin-inline: calc(var(--gutter) * -1); padding: 2px var(--gutter) 4px; scroll-padding-inline: var(--gutter);
}
.datestrip::-webkit-scrollbar { display: none; }
.day {
  flex: none; width: 50px; border: 0; background: transparent; border-radius: 14px; padding: 6px 0 8px;
  display: flex; flex-direction: column; align-items: center; gap: 3px; scroll-snap-align: start;
}
.day:hover { background: var(--fill); }
.day .mon { font-size: 10px; font-weight: 600; color: var(--tint); height: 12px; text-transform: uppercase; letter-spacing: 0.03em; }
.day .dow { font-size: 11px; font-weight: 600; text-transform: uppercase; color: var(--label-2); letter-spacing: 0.03em; }
.day .dnum { font-size: 19px; font-weight: 600; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-variant-numeric: tabular-nums; }
.day.today .dnum { color: var(--tint); }
.day[aria-pressed="true"] .dnum { background: var(--tint); color: var(--on-tint); }
.day.past .dnum { color: var(--label-2); }
/* Holiday closures: struck through, with a small red marker. */
.day.closed .dnum { color: var(--label-3); text-decoration: line-through; position: relative; }
.day.closed .dnum::after { content: ""; position: absolute; bottom: 2px; left: 50%; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: var(--red); }
.day.closed[aria-pressed="true"] .dnum { background: var(--fill-2); color: var(--label-2); }
.date-pick {
  position: relative; display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 12px;
  border-radius: 999px; background: var(--fill); color: var(--tint); font-size: 14px; font-weight: 600;
}
.date-pick input { position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer; }
.date-pick .ico { width: 17px; height: 17px; }
.date-pick:focus-within { box-shadow: 0 0 0 2px var(--tint); }

/* ---- Sheets and alerts ---- */
.layer {
  position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-end; justify-content: center;
  background: rgba(0, 0, 0, 0.38); animation: fade 0.2s ease-out;
}
.sheet {
  --bg: var(--sheet-bg); --surface: var(--sheet-surface);
  background: var(--bg); color: var(--label);
  width: 100%; max-height: calc(100% - env(safe-area-inset-top, 0px) - 10px);
  border-radius: 14px 14px 0 0; display: flex; flex-direction: column; outline: none;
  box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.18);
  animation: rise 0.34s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.sheet-head { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 8px; padding: 12px 10px 6px; flex: none; }
.sheet-head::before { content: ""; position: absolute; top: 5px; left: 50%; width: 36px; height: 5px; margin-left: -18px; border-radius: 3px; background: var(--fill-2); }
.sheet-head h2 { font-size: 17px; font-weight: 600; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sh-left, .sh-right { display: flex; min-width: 0; }
.sh-right { justify-content: flex-end; }
.sheet-body { overflow-y: auto; overscroll-behavior: contain; padding: 10px 16px calc(28px + env(safe-area-inset-bottom, 0px)); flex: 1; display: flex; flex-direction: column; gap: 24px; }
.sheet-foot { flex: none; padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--sep); background: var(--bg); display: grid; gap: 10px; }
.sheet-foot .total { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 15px; color: var(--label-2); }
.sheet-foot .total strong { font-size: 22px; color: var(--label); font-variant-numeric: tabular-nums; }
.sheet-foot .total .breakdown { display: block; font-size: 13px; margin-top: 2px; }
.price-note { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; }
.btn.btn-inline { min-height: 0; padding: 0; font-size: 13px; font-weight: 600; }
@media (min-width: 700px) {
  .layer { align-items: center; padding: 24px; }
  .sheet { max-width: 560px; max-height: min(880px, 100%); border-radius: 16px; animation: pop 0.26s cubic-bezier(0.2, 0.9, 0.3, 1); box-shadow: var(--shadow-pop); }
  .sheet.wide { max-width: 760px; }
  .sheet-head::before { display: none; }
  .sheet-head { padding-top: 10px; }
  .sheet-body, .sheet-foot { padding-inline: 20px; padding-bottom: 24px; }
  .sheet-foot { padding-bottom: 16px; }
}
.alert-layer { align-items: center; padding: 24px; z-index: 150; }
.alert {
  width: 280px; border-radius: 14px; overflow: hidden; text-align: center;
  background: var(--alert-bg); -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px);
  animation: pop 0.2s ease-out; box-shadow: var(--shadow-pop);
}
.alert-body { padding: 20px 16px 16px; display: grid; gap: 4px; }
.alert-body h2 { font-size: 17px; font-weight: 600; }
.alert-body p { font-size: 13.5px; line-height: 1.35; }
.alert-actions { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--sep-strong); }
.alert-actions button { min-height: 46px; border: 0; background: transparent; color: var(--tint); font-size: 17px; }
.alert-actions button + button { border-left: 1px solid var(--sep-strong); }
.alert-actions button:hover { background: var(--fill); }
.alert-actions .bold { font-weight: 600; }
.alert-actions .destructive { color: var(--red-text); font-weight: 600; }

.toast {
  position: fixed; left: 50%; bottom: calc(49px + env(safe-area-inset-bottom, 0px) + 18px); z-index: 200;
  transform: translate(-50%, 16px); opacity: 0; pointer-events: none;
  display: flex; align-items: center; gap: 8px; max-width: calc(100% - 32px);
  padding: 11px 18px; border-radius: 999px; background: var(--toast-bg); color: var(--toast-fg);
  font-size: 15px; font-weight: 500; box-shadow: var(--shadow-pop);
  transition: opacity 0.22s, transform 0.22s;
}
.toast .ico { width: 19px; height: 19px; color: #6EE7A8; }
.toast.error .ico { color: #FF8A80; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (min-width: 900px) { .toast { bottom: 28px; left: calc(50% + 132px); } }

@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(100%); } }
@keyframes pop { from { transform: scale(1.06); opacity: 0; } }

/* ---- Booking result ---- */
.hero-state { display: grid; justify-items: center; gap: 6px; text-align: center; padding: 6px 0 2px; }
.hero-state .badge { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; color: #FFFFFF; background: var(--green); margin-bottom: 6px; }
.hero-state .badge .ico { width: 34px; height: 34px; }
.hero-state .badge[data-c="orange"] { background: var(--orange); }
.hero-state .badge[data-c="blue"] { background: var(--blue); }
.hero-state .badge[data-c="gray"] { background: var(--gray); }
.hero-state .badge[data-c="red"] { background: var(--red); }
.hero-state h3 { font-size: 24px; font-weight: 700; }
.hero-state p { color: var(--label-2); max-width: 36ch; line-height: 1.4; }
.refbox { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--surface); border-radius: var(--radius); padding: 14px 16px; }
.refbox .k { font-size: 13px; color: var(--label-2); }
.refbox .v { font: 700 26px/1.15 var(--mono); letter-spacing: 0.05em; }

.copy-btn { border: 0; background: var(--tint-soft); color: var(--tint); border-radius: 999px; padding: 4px 10px; font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; flex: none; }
.copy-btn .ico { width: 15px; height: 15px; }
.copy-btn:hover { background: var(--tint-soft-2); }

.summary-head { display: grid; gap: 8px; }
.summary-head h3 { font-size: 24px; font-weight: 700; overflow-wrap: anywhere; }
.summary-head .meta { color: var(--label-2); font-size: 14px; display: flex; flex-wrap: wrap; gap: 4px 10px; }
.summary-head .meta > span { display: inline-flex; align-items: center; gap: 5px; }
.summary-head .meta .ico { width: 16px; height: 16px; }

/* ---- Club info: sized from the page's own width, not the window ---- */
.info { container: info / inline-size; display: flex; flex-direction: column; gap: 26px; min-width: 0; }
.info-cols { display: grid; gap: 26px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@container info (min-width: 760px) { .info-cols { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
@container info (min-width: 1000px) { .info-cols { gap: 32px; } }
.info .list { container: infolist / inline-size; }
.info .cell-title, .info .cell-sub { overflow-wrap: break-word; }

/* Label and value rows: both sides share the width in proportion and wrap between words. */
.cell.kv { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); column-gap: 12px; }
.cell.kv.has-icon { grid-template-columns: 30px minmax(0, 1fr) minmax(0, 1.25fr); }
.cell.kv .cell-value { overflow-wrap: break-word; text-wrap: balance; }
/* Narrow lists (phones, or a half-width column): the value goes under its label. */
@container infolist (max-width: 400px) {
  .cell.kv, .cell.kv.has-icon { grid-template-columns: minmax(0, 1fr); row-gap: 3px; }
  .cell.kv.has-icon { grid-template-columns: 30px minmax(0, 1fr); }
  .cell.kv.has-icon .cell-icon { grid-row: 1 / span 2; align-self: center; }
  .cell.kv .cell-value { grid-column: -2; justify-content: flex-start; text-align: left; margin-left: 0; color: var(--label); font-weight: 500; }
}

.steps { display: grid; gap: 0; }
.step { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; padding: 12px 16px; align-items: start; }
.step .n { width: 26px; height: 26px; border-radius: 50%; background: var(--tint-soft); color: var(--tint); font-weight: 700; font-size: 14px; display: grid; place-items: center; }
.step p { color: var(--label-2); font-size: 14px; margin-top: 2px; line-height: 1.4; }

/* ---- Charts ---- */
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.chart text { fill: var(--label-2); font-size: 11px; font-family: var(--font); font-variant-numeric: tabular-nums; }
.chart .grid { stroke: var(--sep); stroke-width: 1; shape-rendering: crispEdges; }
.chart .baseline { stroke: var(--sep-strong); stroke-width: 1; shape-rendering: crispEdges; }
.chart .bar { fill: var(--tint); transition: opacity 0.12s; }
.chart .bar.muted { fill: var(--chart-muted); }
.chart .bar.on { opacity: 0.75; }
.chart .hit { fill: transparent; cursor: default; }
.chart .endlabel { fill: var(--label); font-weight: 600; }
.chart-tip {
  position: absolute; z-index: 5; pointer-events: none; transform: translate(-50%, calc(-100% - 8px));
  background: var(--elevated); color: var(--label); border-radius: 10px; padding: 7px 10px; font-size: 13px; line-height: 1.3;
  box-shadow: var(--shadow-pop); white-space: nowrap;
}
.chart-tip b { display: block; font-size: 12px; color: var(--label-2); font-weight: 500; }

.hbars { display: grid; gap: 9px; }
.hbar { display: grid; grid-template-columns: minmax(64px, 7.5em) minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: 13.5px; }
.hbar .k { color: var(--label-2); overflow-wrap: anywhere; }
.hbar .track { height: 10px; border-radius: 0 4px 4px 0; background: transparent; position: relative; }
.hbar .track span { position: absolute; left: 0; top: 0; bottom: 0; background: var(--tint); border-radius: 0 4px 4px 0; min-width: 2px; }
.hbar .track span.zero { background: var(--fill-2); }
.hbar .v { font-variant-numeric: tabular-nums; font-weight: 600; min-width: 2.5ch; text-align: right; }

.tl { display: grid; gap: 12px; }
.tl-row { display: grid; grid-template-columns: minmax(70px, 7em) minmax(0, 1fr) 3.2em; gap: 10px; align-items: center; font-size: 13.5px; }
.tl-row .k { font-weight: 600; overflow-wrap: anywhere; }
.tl-row .v { text-align: right; color: var(--label-2); font-variant-numeric: tabular-nums; }
.tl-track { position: relative; height: 24px; border-radius: 6px; background: var(--fill); }
.tl-seg { position: absolute; top: 0; bottom: 0; border-radius: 4px; background: var(--tint); border: 0; padding: 0; }
.tl-seg[data-c="orange"] { background: var(--orange); }
.tl-seg[data-c="blue"] { background: var(--blue); }
.tl-seg[data-c="red"] { background: var(--red); }
.tl-seg[data-c="indigo"] { background: repeating-linear-gradient(135deg, var(--indigo) 0 3px, color-mix(in srgb, var(--indigo) 55%, transparent) 3px 6px); }
.tl-now { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; background: var(--red); border-radius: 1px; }
.tl-axis { display: grid; grid-template-columns: minmax(70px, 7em) minmax(0, 1fr) 3.2em; gap: 10px; font-size: 11px; color: var(--label-2); }
.tl-axis > div { display: flex; justify-content: space-between; font-variant-numeric: tabular-nums; }
.tl-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 12px; font-size: 12.5px; color: var(--label-2); }
.tl-legend span { display: inline-flex; align-items: center; gap: 6px; }
.tl-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; background: var(--c); }

/* ---- Reports ---- */
.filter-summary { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; }
.filter-summary .what { font-size: 15px; color: var(--label-2); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.filter-summary .what strong { color: var(--label); }
.scope-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--tint-soft); color: var(--tint); font-weight: 600; font-size: 13px; }
.scope-pill.all { background: var(--fill); color: var(--label-2); }

.report-layout { display: grid; gap: 26px; grid-template-columns: minmax(0, 1fr); align-items: start; }
.report-results { container: results / inline-size; min-width: 0; }
@media (min-width: 1360px) {
  .report-layout { grid-template-columns: 320px minmax(0, 1fr); }
  .report-filters { position: sticky; top: calc(58px + env(safe-area-inset-top, 0px)); max-height: calc(100vh - 76px); overflow-y: auto; }
}
.report-results .tiles.t6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.report-results .cols.c-1-1 { grid-template-columns: minmax(0, 1fr); }
@container results (min-width: 620px) { .report-results .tiles.t6 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@container results (min-width: 760px) { .report-results .cols.c-1-1 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
@container results (min-width: 1000px) { .report-results .tiles.t6 { grid-template-columns: repeat(6, minmax(0, 1fr)); } }

.rtable-wrap { background: var(--surface); border-radius: var(--radius); overflow-x: auto; }
table.rtable { width: 100%; border-collapse: collapse; font-size: 14px; }
.rtable th { text-align: left; font-size: 12px; font-weight: 600; color: var(--label-2); text-transform: uppercase; letter-spacing: 0.03em; padding: 11px 12px; border-bottom: 1px solid var(--sep); white-space: nowrap; }
.rtable td { padding: 10px 12px; border-bottom: 1px solid var(--sep); vertical-align: middle; }
.rtable tbody tr:last-child td { border-bottom: 0; }
.rtable tbody tr { cursor: pointer; }
.rtable tbody tr:hover { background: rgba(120, 120, 128, 0.06); }
.rtable .r { text-align: right; font-variant-numeric: tabular-nums; }
.rtable .nowrap { white-space: nowrap; }
.rtable td:first-child, .rtable th:first-child { padding-left: 16px; }
.rtable td:last-child, .rtable th:last-child { padding-right: 16px; }
.rtable tfoot td { font-weight: 700; border-top: 1px solid var(--sep-strong); border-bottom: 0; }
.rtable.compact tbody tr { cursor: default; }

/* Reports "By court": a table where there's room; on narrow screens each court becomes a
   small card with labelled figures, so nothing scrolls sideways. */
.court-wrap { container: courts / inline-size; }
@container courts (max-width: 480px) {
  .rtable.court-table thead { display: none; }
  .rtable.court-table, .rtable.court-table tbody { display: block; }
  .rtable.court-table tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px 16px; padding: 12px 16px; border-bottom: 1px solid var(--sep); }
  .rtable.court-table tbody tr:last-child { border-bottom: 0; }
  .rtable.court-table td { display: block; padding: 0; border: 0; text-align: left; }
  .rtable.court-table td:first-child { grid-column: 1 / -1; font-weight: 600; }
  .rtable.court-table td[data-label]::before { content: attr(data-label); display: block; font-size: 12px; font-weight: 400; color: var(--label-2); margin-bottom: 1px; }
}

/* SJV Hall payments: on narrow screens "Paid by" moves under the date and the buttons stack. */
.hall-form { gap: 12px; }
.hall-wrap { container: hall / inline-size; }
.hall-table td { vertical-align: middle; }
.hall-table .hall-by { overflow-wrap: anywhere; }
.hall-table .hall-by-sub { display: none; font-size: 13px; color: var(--label-2); margin-top: 2px; overflow-wrap: anywhere; }
.hall-table .hall-actions { width: 1%; }
.hall-btns { display: flex; gap: 6px; justify-content: flex-end; }
.hall-btns .btn { padding: 0 12px; }
.hall-btns .btn.del { color: var(--red-text); }
.hall-table tbody tr.editing td { background: var(--tint-soft); }
@container hall (max-width: 460px) {
  .hall-table .hall-by { display: none; }
  .hall-table .hall-by-sub { display: block; }
  .hall-btns { flex-direction: column; align-items: stretch; }
}
.rtable.compact tbody tr:hover { background: none; }
.rows-mobile { display: block; }
.rows-desktop { display: none; }
@media (min-width: 900px) { .rows-mobile { display: none; } .rows-desktop { display: block; } }

/* Settings save bar */
.savebar {
  position: fixed; left: 0; right: 0; bottom: calc(49px + env(safe-area-inset-bottom, 0px)); z-index: 45;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px var(--gutter); background: var(--bar);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-top: 1px solid var(--sep); animation: fade 0.2s;
}
.savebar .msg { font-size: 14px; color: var(--label-2); }
.savebar .btns { display: flex; gap: 8px; }
@media (min-width: 900px) { .savebar { left: 264px; bottom: 0; padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)); } }

.auth-card { max-width: 460px; width: 100%; margin: 0 auto; display: flex; flex-direction: column; gap: 22px; }
.auth-logo { width: 72px; height: 72px; border-radius: 18px; background: #0B7A4D; display: grid; place-items: center; }
.auth-logo img { width: 58px; height: 58px; display: block; }

/* Phone: the save bar and messages float above the glass tab bar. */
@media (max-width: 899px) {
  .savebar {
    left: 12px; right: 12px; bottom: calc(64px + 20px + env(safe-area-inset-bottom, 0px));
    padding: 10px 14px; border-radius: 22px; border-top: 0;
    background: var(--glass-strong);
    -webkit-backdrop-filter: saturate(190%) blur(24px);
    backdrop-filter: saturate(190%) blur(24px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow), inset 0 1px 0 var(--glass-edge);
  }
  .toast { bottom: calc(64px + 22px + env(safe-area-inset-bottom, 0px)); }
}
/* Browsers without blur get solid bars so text stays readable. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .navbar, .navbar.scrolled, .tabbar, .savebar { background: var(--bar); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

@media print {
  :root { --bg: #FFFFFF; --surface: #FFFFFF; --label: #000000; --label-2: #444444; --sep: #CCCCCC; color-scheme: light; }
  .sidebar, .tabbar, .navbar, .no-print, .toast, .savebar { display: none !important; }
  .app { display: block; }
  .main { padding: 0; }
  .content { max-width: none; padding: 0; }
  .rows-mobile { display: none !important; }
  .rows-desktop { display: block !important; }
  .tile, .card, .list, .rtable-wrap { border: 1px solid #DDDDDD; break-inside: avoid; }
  .rtable tbody tr { break-inside: avoid; }
}
