/* Pools design system: forest green, emerald and cream. Light by default, dark when the device asks for it. */
:root {
  --bg: #f7f5ee;
  --surface: #ffffff;
  --surface-2: #f4f1e7;
  --text: #10241b;
  --muted: #5b6a62;
  --border: #e6e1d3;
  --primary: #13743f;
  --primary-ink: #ffffff;
  --primary-soft: #e3f3e9;
  --emerald: #2fcf7a;
  --forest: #0a3a2a;
  --forest-2: #062a1e;
  --forest-ink: #e9f4ee;
  --accent: #b7860b;
  --accent-soft: #fbf3dc;
  --orange: #c2620c;
  --orange-soft: #fdeedf;
  --danger: #b42318;
  --danger-soft: #fdecea;
  --warning: #9a5b00;
  --warning-soft: #fff4e0;
  --info: #1d4ed8;
  --info-soft: #e8efff;
  --ok: #157f3c;
  --ok-soft: #e4f6ea;
  --live: #e5372a;
  --shadow: 0 1px 2px rgba(16, 36, 27, .06);
  --radius: 16px;
  --radius-sm: 10px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --nav-h: 64px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c1511;
    --surface: #14201a;
    --surface-2: #1a2821;
    --text: #e7efe9;
    --muted: #9db0a5;
    --border: #2a3731;
    --primary: #34b875;
    --primary-ink: #04140b;
    --primary-soft: #163526;
    --forest: #08251b;
    --forest-2: #041912;
    --accent: #e0b23a;
    --accent-soft: #33290f;
    --orange: #f0a35c;
    --orange-soft: #3a2614;
    --danger: #f2766b;
    --danger-soft: #3a1a17;
    --warning: #f0b45a;
    --warning-soft: #36270f;
    --info: #8fb0ff;
    --info-soft: #1a2440;
    --ok: #5fd08b;
    --ok-soft: #14301f;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text); font-family: var(--font);
  font-size: 15px; line-height: 1.5;
}
a { color: var(--primary); text-underline-offset: 2px; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5rem; }
h1 { font-size: 1.45rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .75rem; }
img { max-width: 100%; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1rem 0; }
.num, .kpi-value, td.num, th.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.mt { margin-top: 1rem; }
.mb { margin-bottom: 1rem; }
.mt-0 { margin-top: 0; }
.stack > * + * { margin-top: 1rem; }
.stack-sm > * + * { margin-top: .5rem; }
.row { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.row-between { display: flex; gap: .75rem; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.grow { flex: 1 1 auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 55%, transparent); outline-offset: 2px; }

/* ── Shell (staff area) ────────────────────────────────── */
.shell { min-height: 100vh; }
.sidebar { display: none; }
.topbar {
  position: sticky; top: 0; z-index: 20; background: var(--bg);
  border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: .6rem; padding: .5rem 1rem; min-height: 60px;
}
.brand { display: flex; align-items: center; gap: .6rem; color: var(--text); text-decoration: none; min-width: 0; }
.brand-logo { width: 38px; height: 38px; flex: none; display: block; }
.brand-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.brand-name { font-weight: 800; font-size: 1.15rem; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-tag { font-size: .72rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .spacer { flex: 1; }
.main { padding: 1rem 1rem calc(var(--nav-h) + 1.5rem); max-width: 1240px; margin: 0 auto; }
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; height: calc(var(--nav-h) + env(safe-area-inset-bottom)); background: var(--surface);
  border-top: 1px solid var(--border); display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav a, .bottom-nav summary {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: .72rem;
  color: var(--muted); text-decoration: none; cursor: pointer; list-style: none; height: 100%;
}
.bottom-nav summary::-webkit-details-marker { display: none; }
.bottom-nav a.active, .bottom-nav a[aria-current="page"] { color: var(--primary); font-weight: 700; }
.bottom-nav svg { width: 22px; height: 22px; }
.more-menu { position: relative; }
.more-menu[open] .more-panel { display: block; }
.more-panel {
  display: none; position: absolute; bottom: calc(var(--nav-h) + 4px); right: 6px; width: min(270px, 90vw); background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: .35rem; max-height: 70vh; overflow: auto;
}
.more-panel a { flex-direction: row; justify-content: flex-start; gap: .6rem; padding: .7rem .8rem; font-size: .95rem; color: var(--text); border-radius: var(--radius-sm); height: auto; }
.more-panel a:hover { background: var(--surface-2); }
.nav-badge { background: var(--danger); color: #fff; border-radius: 999px; font-size: .68rem; padding: 0 .4rem; min-width: 1.2rem; text-align: center; font-weight: 700; margin-left: auto; }
.user-menu { position: relative; }
.user-menu > summary { list-style: none; display: flex; align-items: center; gap: .5rem; cursor: pointer; padding: .25rem .5rem .25rem .25rem; border-radius: 999px; }
.user-menu > summary::-webkit-details-marker { display: none; }
.user-menu > summary:hover { background: var(--surface-2); }
.user-menu .menu-panel { position: absolute; right: 0; top: calc(100% + 6px); min-width: 230px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow); padding: .35rem; z-index: 40; }
.user-menu .menu-panel a, .user-menu .menu-panel button { display: flex; width: 100%; gap: .5rem; align-items: center; padding: .6rem .7rem; border-radius: 8px; color: var(--text); text-decoration: none; background: none; border: 0; font: inherit; cursor: pointer; text-align: left; }
.user-menu .menu-panel a:hover, .user-menu .menu-panel button:hover { background: var(--surface-2); }
.user-menu .menu-head { padding: .5rem .7rem; border-bottom: 1px solid var(--border); margin-bottom: .25rem; }
.user-name { font-weight: 600; max-width: 16ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-role { font-size: .75rem; color: var(--muted); }
.sep { width: 1px; height: 24px; background: var(--border); flex: none; }

@media (min-width: 1024px) {
  .shell { display: grid; grid-template-columns: 262px 1fr; }
  .sidebar {
    display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow: auto; color: var(--forest-ink);
    background: var(--forest); padding: 1.25rem .9rem 1rem; scrollbar-width: thin;
  }
  .sidebar .brand { padding: .25rem .4rem 1.4rem; color: #fff; }
  .sidebar .brand-tag { color: rgba(233, 244, 238, .7); }
  .sidebar .brand-logo { width: 38px; height: 38px; }
  .sidebar .brand-name { font-size: 1.2rem; }
  .sidebar nav a, .sidebar nav summary {
    display: flex; align-items: center; gap: .85rem; padding: .72rem .9rem; color: rgba(233, 244, 238, .88); text-decoration: none;
    border-radius: 12px; font-size: 1rem; margin-bottom: .15rem; cursor: pointer;
  }
  .sidebar nav a:hover, .sidebar nav summary:hover { background: rgba(255, 255, 255, .07); color: #fff; }
  .sidebar nav a.active { background: rgba(255, 255, 255, .12); color: #fff; font-weight: 600; }
  .sidebar nav svg { width: 22px; height: 22px; flex: none; }
  .sidebar details.nav-more { border-top: 1px solid rgba(255, 255, 255, .12); margin-top: .6rem; padding-top: .6rem; }
  .sidebar details.nav-more > summary { list-style: none; }
  .sidebar details.nav-more > summary::-webkit-details-marker { display: none; }
  .sidebar details.nav-more > summary::after { content: "+"; margin-left: auto; opacity: .7; }
  .sidebar details.nav-more[open] > summary::after { content: "–"; }
  .sidebar details.nav-more a { font-size: .93rem; padding: .55rem .9rem; }
  .sidebar details.nav-more a svg { width: 19px; height: 19px; }
  .sidebar-art { margin: auto -.9rem 0; padding-top: 1rem; flex: none; pointer-events: none; }
  .sidebar-art img { display: block; width: 100%; height: 150px; object-fit: cover; object-position: 75% 70%; opacity: .5;
    -webkit-mask-image: linear-gradient(180deg, transparent, #000 50%); mask-image: linear-gradient(180deg, transparent, #000 50%); }
  .bottom-nav { display: none; }
  .topbar { justify-content: flex-end; background: transparent; border-bottom: 0; position: static; padding: 1rem 2rem 0; min-height: 0; }
  .topbar .brand { display: none; }
  .main { padding: .5rem 2rem 3rem; }
}

/* ── Page header ───────────────────────────────────────── */
.page-head { display: flex; gap: .75rem; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; margin-bottom: 1rem; }
.page-head h1 { margin: 0; }
.page-head .sub { color: var(--muted); margin: .2rem 0 0; font-size: .92rem; }
.crumbs { font-size: .85rem; margin-bottom: .35rem; }
.crumbs a { color: var(--muted); }

/* ── Cards & grids ─────────────────────────────────────── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem; }
.card + .card { margin-top: 1rem; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-bottom: .75rem; flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; }
.card-flush { padding: 0; overflow: hidden; }
.card-flush > .card-head { padding: 1rem 1rem 0; }
.grid { display: grid; gap: 1rem; }
.grid-2 { display: grid; gap: 1rem; }
.grid-3 { display: grid; gap: 1rem; }
.kpis { display: grid; gap: .75rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 700px) {
  .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpis { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
}
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .85rem 1rem; display: block; color: inherit; text-decoration: none; box-shadow: var(--shadow); min-width: 0; }
a.kpi:hover { border-color: var(--primary); }
.kpi-label { font-size: .8rem; color: var(--muted); display: block; }
.kpi-value { font-size: 1.45rem; font-weight: 750; letter-spacing: -.01em; display: block; margin-top: .15rem; overflow-wrap: anywhere; }
.kpi-sub { font-size: .78rem; color: var(--muted); display: block; margin-top: .15rem; }
.kpi-primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.kpi-primary .kpi-label, .kpi-primary .kpi-sub { color: inherit; opacity: .85; }
.big-number { font-size: 2.2rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.1; }
.pos { color: var(--ok); }
.neg { color: var(--danger); }
.zero { color: var(--muted); }

/* ── Definition lists for figures ─────────────────────── */
.figures { display: grid; grid-template-columns: 1fr auto; gap: .35rem 1rem; margin: 0; }
.figures dt { color: var(--muted); }
.figures dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.figures .total { border-top: 1px solid var(--border); padding-top: .4rem; font-weight: 800; color: var(--text); }
.figures .indent { padding-left: 1rem; }

/* ── Buttons ───────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 42px; padding: .55rem 1rem; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; line-height: 1.2;
}
.btn:hover { border-color: var(--muted); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn-primary:hover { filter: brightness(1.07); border-color: var(--primary); }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--primary); }
.btn-ghost:hover { background: var(--primary-soft); border-color: transparent; }
.btn-sm { min-height: 34px; padding: .3rem .7rem; font-size: .88rem; }
.btn-lg { min-height: 52px; font-size: 1.05rem; padding: .7rem 1.3rem; }
.btn-block { display: flex; width: 100%; }
.btn svg { width: 18px; height: 18px; }
.link-btn { background: none; border: 0; padding: 0; color: var(--primary); font: inherit; cursor: pointer; text-decoration: underline; }
/* Touch targets of at least 32px for standalone text links (WCAG 2.2 target size). */
summary.link-btn, .crumbs a, .card-head > a, a.more-link { display: inline-flex; align-items: center; min-height: 32px; }
.link-danger { color: var(--danger); }
form.inline { display: inline; }

/* ── Forms ─────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: .3rem; margin-bottom: .85rem; min-width: 0; }
.field > label, .label { font-weight: 600; font-size: .9rem; }
.field .help, .help { color: var(--muted); font-size: .82rem; }
input, select, textarea {
  font: inherit; font-size: 16px; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: .6rem .7rem; min-height: 44px; width: 100%;
}
textarea { min-height: 88px; resize: vertical; }
input[type="checkbox"], input[type="radio"] { width: 20px; height: 20px; min-height: 0; accent-color: var(--primary); flex: none; margin: 0; }
input:focus, input:focus-within, select:focus, textarea:focus { border-color: var(--primary); outline: 3px solid color-mix(in srgb, var(--primary) 22%, transparent); }
input.input-lg { font-size: 1.5rem; font-weight: 700; min-height: 56px; font-variant-numeric: tabular-nums; }
input[aria-invalid="true"] { border-color: var(--danger); }
.check { display: flex; gap: .55rem; align-items: flex-start; margin-bottom: .7rem; cursor: pointer; }
.check span { line-height: 1.35; }
.fields-2, .fields-3 { display: grid; gap: 0 1rem; }
@media (min-width: 640px) {
  .fields-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fields-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.form-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .5rem; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: .75rem 1rem 0; margin: 0 0 1rem; min-width: 0; }
legend { font-weight: 700; padding: 0 .35rem; }
.radio-cards { display: grid; gap: .5rem; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: .85rem; }
.radio-card { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .65rem .75rem; display: flex; gap: .5rem; align-items: flex-start; cursor: pointer; background: var(--surface); }
.radio-card:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }

/* ── Alerts & badges ───────────────────────────────────── */
.alert { border-radius: var(--radius-sm); padding: .75rem 1rem; margin-bottom: 1rem; border: 1px solid transparent; }
.alert-success { background: var(--ok-soft); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 30%, transparent); }
.alert-error { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 30%, transparent); }
.alert-warning { background: var(--warning-soft); color: var(--warning); border-color: color-mix(in srgb, var(--warning) 30%, transparent); }
.alert-info { background: var(--info-soft); color: var(--info); border-color: color-mix(in srgb, var(--info) 25%, transparent); }
.alert p:last-child { margin: 0; }
.badge { display: inline-flex; align-items: center; gap: .3rem; font-size: .75rem; font-weight: 700; padding: .15rem .55rem; border-radius: 999px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); white-space: nowrap; }
.badge-open, .badge-active, .badge-playing, .badge-in_use { background: var(--info-soft); color: var(--info); border-color: transparent; }
.badge-submitted, .badge-pending, .badge-waitlist, .badge-paused, .badge-requested, .badge-warning { background: var(--warning-soft); color: var(--warning); border-color: transparent; }
.badge-approved, .badge-completed, .badge-checked_in, .badge-available, .badge-given, .badge-published, .badge-registered, .badge-ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.badge-maintenance, .badge-rejected, .badge-cancelled, .badge-voided, .badge-absent, .badge-withdrawn, .badge-danger, .badge-overdue, .badge-blocked { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.badge-setup, .badge-draft, .badge-waiting { background: var(--surface-2); color: var(--muted); }
.badge-estimate { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge.no-dot::before { display: none; }
.chip { display: inline-block; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: .1rem .6rem; font-size: .8rem; }

/* ── Tables (cards on phones) ─────────────────────────── */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th, .table td { padding: .6rem .75rem; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
.table th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; background: var(--surface-2); }
.table td.num, .table th.num { text-align: right; white-space: nowrap; }
.table tr.voided td { color: var(--muted); text-decoration: line-through; }
.table tr.voided td.keep { text-decoration: none; }
.table tfoot td { font-weight: 800; border-top: 2px solid var(--border); }
.table .actions { text-align: right; white-space: nowrap; }
@media (max-width: 699px) {
  table.table.responsive thead { display: none; }
  table.table.responsive, .table.responsive tbody, .table.responsive tr, .table.responsive td, .table.responsive tfoot { display: block; width: 100%; }
  .table.responsive tr { border-bottom: 1px solid var(--border); padding: .5rem .25rem; }
  .table.responsive td { border: 0; padding: .2rem .5rem; display: flex; justify-content: space-between; gap: 1rem; text-align: right; }
  .table.responsive td::before { content: attr(data-label); color: var(--muted); font-size: .82rem; text-align: left; font-weight: 600; flex: none; max-width: 45%; }
  .table.responsive td.num { text-align: right; }
  .table.responsive td.actions { justify-content: flex-end; }
  .table.responsive td.actions::before { content: none; }
  .table.responsive td.full { display: block; text-align: left; }
  .table.responsive td.full::before { display: block; }
}

/* ── Lists ─────────────────────────────────────────────── */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { padding: .7rem 0; border-bottom: 1px solid var(--border); display: flex; gap: .75rem; align-items: center; justify-content: space-between; }
.list > li:last-child { border-bottom: 0; }
.list .title { font-weight: 600; }
.list a.row-link { color: inherit; text-decoration: none; display: flex; gap: .75rem; align-items: center; justify-content: space-between; width: 100%; }

/* ── Tabs ──────────────────────────────────────────────── */
.tabs { display: flex; gap: .25rem; overflow-x: auto; border-bottom: 1px solid var(--border); margin-bottom: 1rem; scrollbar-width: thin; }
.tabs a { padding: .65rem .85rem; color: var(--muted); text-decoration: none; border-bottom: 3px solid transparent; white-space: nowrap; font-weight: 600; font-size: .92rem; }
.tabs a.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ── Disclosure forms ─────────────────────────────────── */
details.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
details.panel + details.panel { margin-top: .6rem; }
details.panel > summary { padding: .85rem 1rem; cursor: pointer; font-weight: 700; display: flex; gap: .6rem; align-items: center; list-style: none; }
details.panel > summary::-webkit-details-marker { display: none; }
details.panel > summary::after { content: "+"; margin-left: auto; font-size: 1.3rem; color: var(--muted); font-weight: 400; }
details.panel[open] > summary::after { content: "–"; }
details.panel > .panel-body { padding: 0 1rem 1rem; }
details.panel .count { color: var(--muted); font-weight: 600; font-size: .85rem; }

/* ── Empty states ─────────────────────────────────────── */
.empty { text-align: center; padding: 2rem 1rem; color: var(--muted); }
.empty h3 { color: var(--text); }

/* ── Quick action grid (Today) ────────────────────────── */
.actions-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
@media (min-width: 700px) { .actions-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.action-tile { display: flex; flex-direction: column; gap: .2rem; padding: .85rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); text-decoration: none; color: var(--text); box-shadow: var(--shadow); }
.action-tile strong { font-size: .98rem; }
.action-tile span { font-size: .8rem; color: var(--muted); }
.action-tile:hover { border-color: var(--primary); }

/* ── Bars / charts ─────────────────────────────────────── */
.chart { width: 100%; height: auto; display: block; }
.chart text { fill: var(--muted); font-size: 10px; }
.chart .bar-sales { fill: var(--primary); }
.chart .bar-exp { fill: var(--accent); }
.chart .grid-line { stroke: var(--border); }
.legend { display: flex; gap: 1rem; font-size: .82rem; color: var(--muted); flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: .3rem; vertical-align: -1px; }
.meter { height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; border: 1px solid var(--border); }
.meter > span { display: block; height: 100%; background: var(--primary); }

/* ── Tournament ───────────────────────────────────────── */
.match-card { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: .75rem; box-shadow: var(--shadow); }
.match-card.playing { border-color: var(--info); box-shadow: 0 0 0 1px var(--info); }
.match-meta { display: flex; justify-content: space-between; gap: .5rem; font-size: .78rem; color: var(--muted); margin-bottom: .4rem; flex-wrap: wrap; }
.match-line { display: flex; align-items: center; gap: .5rem; padding: .25rem 0; }
.match-line .name { flex: 1; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.match-line .score { font-size: 1.4rem; font-weight: 800; font-variant-numeric: tabular-nums; min-width: 2ch; text-align: center; }
.match-line.winner .name { color: var(--ok); }
.match-line.winner .name::after { content: " ✓"; }
.score-btn { width: 46px; height: 46px; border-radius: 50%; font-size: 1.4rem; font-weight: 700; padding: 0; min-height: 0; }
.matches-grid { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
.bracket { display: flex; gap: 1rem; overflow-x: auto; padding-bottom: .5rem; align-items: stretch; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
.bracket:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.bracket-hint { display: none; margin: 0 0 .4rem; }
@media (max-width: 700px) { .bracket-hint { display: block; } }
.bracket-col { min-width: 200px; display: flex; flex-direction: column; gap: .6rem; }
.bracket-col h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 0 0 .2rem; }
.bracket-col .slots { display: flex; flex-direction: column; justify-content: space-around; gap: .6rem; flex: 1; }
.bm { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); font-size: .88rem; overflow: hidden; }
.bm .bp { display: flex; justify-content: space-between; gap: .5rem; padding: .35rem .55rem; }
.bm .bp + .bp { border-top: 1px solid var(--border); }
.bm .bp.w { font-weight: 700; background: var(--ok-soft); }
.bm .bp.tbd { color: var(--muted); font-style: italic; }
.bm.live { border-color: var(--info); }
.bm .tag { font-size: .7rem; color: var(--muted); padding: .15rem .55rem; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.podium { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; align-items: end; text-align: center; }
.podium .step { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm) var(--radius-sm) 0 0; padding: .75rem .5rem; }
.podium .p1 { min-height: 120px; background: var(--accent-soft); border-color: var(--accent); }
.podium .p2 { min-height: 95px; }
.podium .p3 { min-height: 75px; }
.podium .place { font-size: 1.6rem; font-weight: 800; }
.podium .step { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 360px) { .podium { gap: .3rem; } .podium .step { padding: .6rem .3rem; font-size: .9rem; } }

/* ── Public site ──────────────────────────────────────── */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 30; }
.site-header .inner { max-width: 1240px; margin: 0 auto; padding: .6rem 1rem; display: flex; align-items: center; gap: 1rem; min-height: 64px; }
.site-nav { display: none; }
.site-nav a { color: var(--text); text-decoration: none; font-weight: 600; padding: .55rem .2rem; border-bottom: 3px solid transparent; white-space: nowrap; }
.site-nav a:hover { color: var(--primary); }
.site-nav a.active { border-bottom-color: var(--primary); }
.site-tools { display: none; align-items: center; gap: 1rem; margin-left: auto; }
.lang-pair { display: inline-flex; align-items: center; gap: .55rem; font-weight: 700; font-size: .92rem; }
.lang-pair a { color: var(--muted); text-decoration: none; display: inline-flex; align-items: center; justify-content: center; min-width: 36px; min-height: 36px; border-radius: 8px; }
.lang-pair a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.lang-pair a.active { color: var(--text); }
.lang-pair i { width: 1px; height: 16px; background: var(--border); }
.site-menu { margin-left: auto; position: static; }
.site-menu > summary { list-style: none; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--border); cursor: pointer; }
.site-menu > summary::-webkit-details-marker { display: none; }
.site-menu > summary svg { width: 22px; height: 22px; }
.site-menu .menu-sheet { position: absolute; left: 0; right: 0; top: 100%; background: var(--surface); border-bottom: 1px solid var(--border); box-shadow: var(--shadow); padding: .5rem 1rem 1rem; }
.site-menu .menu-sheet a:not(.btn) { display: block; padding: .8rem .25rem; border-bottom: 1px solid var(--border); color: var(--text); text-decoration: none; font-weight: 600; }
.site-menu .menu-sheet a.active { color: var(--primary); }
.site-menu .menu-sheet .row { margin-top: .75rem; justify-content: space-between; }
@media (min-width: 900px) {
  .site-nav { display: flex; gap: 2.2rem; margin: 0 auto; }
  .site-tools { display: flex; margin-left: 0; }
  .site-menu { display: none; }
  .site-header .inner { min-height: 76px; }
}
.public-main { max-width: 1240px; margin: 0 auto; padding: 1.25rem 1rem 3rem; }
.public-main.flush { max-width: none; padding: 0 0 3rem; }
.public-main.flush > .wrap, .wrap { max-width: 1240px; margin: 0 auto; padding: 0 1rem; }
.site-footer { background: linear-gradient(180deg, var(--forest), var(--forest-2)); color: var(--forest-ink); margin-top: 2rem; }
.site-footer .inner { max-width: 1240px; margin: 0 auto; padding: 1.5rem 1rem; display: flex; gap: 1rem 2rem; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.site-footer .brand { color: #fff; }
.site-footer .brand-tag { color: rgba(233, 244, 238, .7); }
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.site-footer .links { display: flex; gap: .5rem 1.5rem; flex-wrap: wrap; align-items: center; font-size: .95rem; }
.site-footer .contact { font-size: .88rem; color: rgba(233, 244, 238, .8); width: 100%; display: flex; gap: .4rem 1.5rem; flex-wrap: wrap; border-top: 1px solid rgba(255, 255, 255, .12); padding-top: 1rem; }

/* Hero banner: a real <img> under the text, with a solid colour behind it if the image does not load. */
.hero-banner { position: relative; background: var(--forest); color: #fff; overflow: hidden; isolation: isolate; }
.hero-banner > picture, .hero-banner > picture img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 70% 50%; z-index: -2; }
.hero-banner::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(4, 20, 13, .94) 0%, rgba(4, 20, 13, .78) 38%, rgba(4, 20, 13, .15) 75%, rgba(4, 20, 13, 0) 100%); }
.hero-banner .wrap { padding-top: 2rem; padding-bottom: 2.25rem; }
.hero-banner h1 { font-size: clamp(1.7rem, 4vw, 2.5rem); line-height: 1.1; font-weight: 750; letter-spacing: -.01em; margin: .7rem 0 .4rem; }
.hero-banner h1 .hl { color: var(--emerald); display: block; }
.hero-banner p.lead { font-size: 1.05rem; max-width: 52ch; color: rgba(255, 255, 255, .9); margin-bottom: 1.1rem; }
.hero-chip { display: inline-flex; align-items: center; gap: .45rem; border: 1px solid rgba(255, 255, 255, .35); background: rgba(255, 255, 255, .06); border-radius: 999px; padding: .3rem .8rem; font-size: .88rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; }
.btn-hero { min-height: 46px; padding: .6rem 1.1rem; font-size: 1rem; border-radius: 10px; }
.btn-emerald { background: #1d9a52; border-color: #1d9a52; color: #fff; }
.btn-emerald:hover { background: #22aa5c; border-color: #22aa5c; }
.btn-ghost-light { background: transparent; border: 1.5px solid rgba(255, 255, 255, .85); color: #fff; }
.btn-ghost-light:hover { background: rgba(255, 255, 255, .1); border-color: #fff; }
@media (min-width: 900px) { .hero-banner .wrap { padding-top: 2rem; padding-bottom: 2.25rem; } }

.home-row { display: grid; gap: 1.25rem; margin-top: 1.5rem; }
@media (min-width: 1000px) { .home-row { grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); } }

.feature { display: grid; gap: 1rem; padding: .75rem; }
@media (min-width: 700px) { .feature { grid-template-columns: minmax(230px, 1fr) minmax(0, 1.25fr); gap: 1.5rem; } }
.feature-media { position: relative; border-radius: 10px; overflow: hidden; background: var(--forest); color: #fff; display: flex; flex-direction: column; justify-content: flex-start; padding: 1.1rem; isolation: isolate; }
.feature-media > picture, .feature-media > picture img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -1; }
.feature-media h2 { color: #fff; font-size: clamp(1.3rem, 2.4vw, 1.6rem); font-weight: 750; letter-spacing: -.02em; margin: 0 0 .6rem; overflow-wrap: anywhere; }
.feature-body { padding: .5rem .25rem .25rem; display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.facts-grid { display: grid; gap: .9rem 1.25rem; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.fact { display: flex; gap: .65rem; align-items: flex-start; min-width: 0; }
.fact > svg { color: var(--primary); width: 22px; height: 22px; margin-top: .1rem; }
.fact span { overflow-wrap: anywhere; }
.fact .meter { margin-top: .45rem; height: 8px; }
.cta-note { text-align: center; color: var(--muted); font-size: .88rem; margin: 0; }
.status-pill { display: inline-flex; align-items: center; gap: .35rem; border-radius: 8px; padding: .3rem .7rem; font-weight: 700; font-size: .9rem; background: #1d9a52; color: #fff; }
.status-pill.closed { background: #6b7280; }
.status-pill.full { background: var(--orange); }
.status-pill.live { background: var(--live); }
.status-pill.done { background: #374151; }
.status-pill.cancelled { background: var(--danger); }

.live-card { display: flex; flex-direction: column; gap: 1rem; padding: .75rem; }
.live-head { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; background: var(--surface-2); border-radius: 10px; padding: .6rem .8rem; font-size: .95rem; }
.live-head .race { margin-left: auto; color: var(--primary); font-weight: 700; }
.live-dot { display: inline-flex; align-items: center; gap: .4rem; color: var(--live); font-weight: 800; letter-spacing: .02em; }
.live-dot::before { content: ""; width: 11px; height: 11px; border-radius: 50%; background: var(--live); box-shadow: 0 0 0 0 rgba(229, 55, 42, .5); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(229, 55, 42, .45); } 70% { box-shadow: 0 0 0 8px rgba(229, 55, 42, 0); } 100% { box-shadow: 0 0 0 0 rgba(229, 55, 42, 0); } }
@media (prefers-reduced-motion: reduce) { .live-dot::before { animation: none; } }
.scoreline { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: .5rem; text-align: center; padding: .25rem 0; }
.scoreline .who { display: flex; flex-direction: column; align-items: center; gap: .45rem; font-weight: 700; min-width: 0; }
.scoreline .who span { overflow-wrap: anywhere; }
.scoreline .score { font-size: clamp(1.7rem, 4vw, 2.1rem); font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; letter-spacing: -.02em; }
.scoreline .score i { font-style: normal; color: var(--muted); font-weight: 500; margin: 0 .3rem; }
.initials { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 1.3rem; background: var(--primary-soft); color: var(--primary); flex: none; }
.initials.alt { background: var(--orange-soft); color: var(--orange); }
.initials.sm { width: 38px; height: 38px; font-size: .85rem; }
.live-tourney { font-size: .85rem; color: var(--muted); text-align: center; margin-top: -.5rem; }
.live-more { list-style: none; margin: 0; padding: 0; font-size: .9rem; }
.live-more li { display: flex; justify-content: space-between; gap: .5rem; padding: .45rem 0; border-top: 1px solid var(--border); }

.howto { display: grid; gap: 1rem; margin-top: 1.25rem; padding: 1.25rem; background: color-mix(in srgb, var(--primary-soft) 55%, var(--surface)); }
@media (min-width: 1000px) { .howto { grid-template-columns: 260px 1fr; align-items: center; } }
.howto h2 { font-size: 1.25rem; font-weight: 700; margin: 0; }
.steps { display: grid; gap: .75rem; background: var(--surface); border-radius: 12px; padding: 1rem; border: 1px solid var(--border); }
@media (min-width: 760px) { .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.step { display: flex; gap: .75rem; align-items: flex-start; position: relative; }
.step .n { width: 36px; height: 36px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; font-weight: 800; flex: none; }
.step .ic { width: 48px; height: 48px; }
.step strong { display: block; margin-bottom: .15rem; }
.step p { margin: 0; font-size: .88rem; color: var(--muted); }

.filter-pills { display: flex; gap: .5rem; flex-wrap: wrap; margin: 0 0 1rem; }
.filter-pills a { padding: .5rem 1rem; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); text-decoration: none; font-weight: 600; font-size: .92rem; }
.filter-pills a.active { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.filter-pills .count { opacity: .7; font-weight: 500; margin-left: .25rem; }

.event-tiles { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.event-tile { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); color: inherit; text-decoration: none; }
.event-tile:hover { border-color: var(--primary); }
.event-tile .top { position: relative; background: var(--forest); color: #fff; padding: .9rem 1rem; min-height: 0; isolation: isolate; display: flex; flex-direction: column; justify-content: space-between; gap: .5rem; }
.event-tile .top > picture, .event-tile .top > picture img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -1; opacity: .55; }
.event-tile h3 { color: #fff; font-size: 1.1rem; font-weight: 700; margin: 0; overflow-wrap: anywhere; }
.event-tile .body { padding: 1rem; display: flex; flex-direction: column; gap: .5rem; flex: 1; }
.event-tile .body .fact { font-size: .92rem; }
.event-tile .body .fact > svg { width: 18px; height: 18px; }
.event-tile .foot { padding: 0 1rem 1rem; }

/* Event page header */
.event-hero { position: relative; background: var(--forest); color: #fff; isolation: isolate; overflow: hidden; }
.event-hero > picture, .event-hero > picture img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.event-hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(4, 20, 13, .95), rgba(4, 20, 13, .72) 55%, rgba(4, 20, 13, .35)); }
.event-hero .wrap { padding-top: 1.5rem; padding-bottom: 1.75rem; }
.event-hero h1 { font-size: clamp(1.5rem, 3.6vw, 2.1rem); font-weight: 750; letter-spacing: -.01em; margin: .6rem 0 .9rem; overflow-wrap: anywhere; }
.event-hero a:not(.btn) { color: #fff; }
.hero-facts { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.hero-facts .f { display: inline-flex; align-items: center; gap: .4rem; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .18); border-radius: 999px; padding: .35rem .8rem; font-size: .92rem; }
.hero-facts .f svg { width: 18px; height: 18px; }
.page-tabs { display: flex; gap: .25rem; overflow-x: auto; border-bottom: 1px solid var(--border); margin: 1.25rem 0 1rem; scrollbar-width: thin; }
.page-tabs a { padding: .75rem 1rem; color: var(--muted); text-decoration: none; border-bottom: 3px solid transparent; white-space: nowrap; font-weight: 700; }
.page-tabs a.active { color: var(--primary); border-bottom-color: var(--primary); }

/* Checkout */
.checkout { max-width: 760px; margin: 0 auto; }
.stepper { list-style: none; margin: 0 0 1.25rem; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .4rem; counter-reset: st; }
.stepper li { counter-increment: st; display: flex; flex-direction: column; align-items: center; gap: .35rem; text-align: center; font-size: .78rem; color: var(--muted); position: relative; }
.stepper li::before { content: counter(st); width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 2px solid var(--border); font-weight: 800; color: var(--muted); position: relative; z-index: 1; }
.stepper li + li::after { content: ""; position: absolute; top: 15px; right: 50%; width: 100%; height: 2px; background: var(--border); z-index: 0; }
.stepper li.done::before { content: "✓"; background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.stepper li.done + li::after, .stepper li.done::after { background: var(--primary); }
.stepper li.now::before { border-color: var(--primary); color: var(--primary); }
.stepper li.now { color: var(--text); font-weight: 700; }
.state-hero { text-align: center; padding: 1.5rem 1rem; }
.state-hero .ic { width: 72px; height: 72px; margin: 0 auto .75rem; }
.state-hero .ic svg { width: 36px; height: 36px; }
.state-hero h1 { font-size: 1.6rem; }
.code-box { display: inline-flex; flex-direction: column; align-items: center; gap: .15rem; background: var(--surface-2); border: 1px dashed var(--border); border-radius: 12px; padding: .6rem 1rem; }
.code-box strong { font-size: 1.35rem; letter-spacing: .08em; font-variant-numeric: tabular-nums; }
.secure-note { display: flex; gap: .6rem; align-items: flex-start; background: var(--primary-soft); color: var(--text); border-radius: 12px; padding: .75rem 1rem; font-size: .9rem; }
.secure-note svg { color: var(--primary); width: 22px; height: 22px; margin-top: .05rem; }
.op-choice { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; margin-bottom: .85rem; }
.op-choice label { display: flex; gap: .6rem; align-items: center; border: 2px solid var(--border); border-radius: 12px; padding: .8rem; cursor: pointer; background: var(--surface); font-weight: 700; }
.op-choice label:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.op-mark { width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; font-size: .7rem; font-weight: 900; flex: none; }
.op-mark.mtn { background: #ffcc00; color: #000; }
.op-mark.orange { background: #ff7900; color: #000; }

/* Generic info page */
.prose { max-width: 760px; }
.prose p, .prose li { line-height: 1.65; }

/* Older public pieces still used by some pages */
.hero { background: linear-gradient(160deg, #0b3d27, #0b6e44); color: #fff; border-radius: var(--radius); padding: 1.5rem; margin-bottom: 1.25rem; }
.hero h1 { font-size: 1.7rem; }
.hero .facts { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; margin-top: .75rem; font-size: .95rem; }
.hero a { color: #fff; }
.event-card { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; color: inherit; text-decoration: none; box-shadow: var(--shadow); }
.event-card:hover { border-color: var(--primary); }
.event-date { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; width: 56px; height: 60px; border-radius: var(--radius-sm); background: var(--primary-soft); color: var(--primary); font-weight: 800; line-height: 1.05; flex: none; }
.event-date .d { font-size: 1.4rem; }
.event-date .m { font-size: .72rem; text-transform: uppercase; }
.avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; font-weight: 800; flex: none; object-fit: cover; }
.avatar-lg { width: 88px; height: 88px; font-size: 1.6rem; }
.lang-switch { display: inline-flex; gap: .25rem; }
.lang-switch a { padding: .2rem .45rem; border-radius: 6px; font-size: .82rem; font-weight: 700; text-decoration: none; color: inherit; opacity: .75; }
.lang-switch a.active { opacity: 1; background: rgba(127, 127, 127, .18); }
.notice { border-left: 4px solid var(--accent); background: var(--accent-soft); padding: .6rem .85rem; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-size: .9rem; }

/* ── Login ─────────────────────────────────────────────── */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.auth-card { width: 100%; max-width: 380px; }

/* ── Receipts / print ─────────────────────────────────── */
.receipt { max-width: 720px; margin: 0 auto; background: var(--surface); padding: 1.5rem; border: 1px solid var(--border); border-radius: var(--radius); }
.receipt h1 { font-size: 1.3rem; }
.receipt table { width: 100%; border-collapse: collapse; margin-bottom: 1rem; }
.receipt td { padding: .25rem 0; border-bottom: 1px dotted var(--border); }
.receipt td.num { text-align: right; font-variant-numeric: tabular-nums; }
.receipt .sign { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; margin-top: 2.5rem; }
.receipt .sign div { border-top: 1px solid var(--text); padding-top: .3rem; font-size: .85rem; }
@media print {
  :root { --bg: #fff; --surface: #fff; --text: #000; --muted: #444; --border: #bbb; }
  body { font-size: 12px; background: #fff; }
  .sidebar, .bottom-nav, .topbar, .no-print, .site-header, .site-footer, .flash-area { display: none !important; }
  .shell { display: block; }
  .main, .public-main { padding: 0; max-width: none; }
  .card, .receipt, .kpi { box-shadow: none; border-color: #bbb; break-inside: avoid; }
  a { color: #000; text-decoration: none; }
  .print-only { display: block !important; }
}
.print-only { display: none; }

/* ── Poster ────────────────────────────────────────────── */
.poster-stage { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 900px) { .poster-stage { grid-template-columns: 1fr 340px; } }
.poster-preview { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; display: grid; place-items: center; }
.poster-preview svg { width: 100%; max-width: 540px; height: auto; box-shadow: var(--shadow); }

/* ── TV display ───────────────────────────────────────── */
body.tv { background: #070d0a; color: #eef6f0; min-height: 100vh; padding: 1.5vw 2.5vw; font-size: 1.6vw; }
.tv-head { display: flex; justify-content: space-between; align-items: center; border-bottom: 2px solid #1d3527; padding-bottom: 1vw; margin-bottom: 1.5vw; }
.tv-biz { color: #e9c35a; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; font-size: 1.1vw; }
.tv-title { font-size: 2.6vw; font-weight: 800; }
.tv-clock { font-size: 2.4vw; font-weight: 700; font-variant-numeric: tabular-nums; color: #9fd2b4; }
.tv-label { text-transform: uppercase; letter-spacing: .08em; color: #9fd2b4; font-weight: 700; font-size: 1.2vw; margin: 1vw 0 .6vw; }
.tv-muted { color: #7c9a88; }
.tv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(28vw, 1fr)); gap: 1.2vw; }
.tv-match { background: #102118; border: 2px solid #2fae6f; border-radius: 1vw; padding: 1vw 1.4vw; }
.tv-meta { display: flex; justify-content: space-between; color: #9fd2b4; font-size: 1.1vw; margin-bottom: .4vw; }
.tv-line { display: flex; justify-content: space-between; align-items: center; font-size: 2.2vw; font-weight: 700; padding: .2vw 0; }
.tv-score { font-size: 3.4vw; font-weight: 900; color: #fff; font-variant-numeric: tabular-nums; min-width: 4vw; text-align: right; }
.tv-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5vw; margin-top: 1vw; }
.tv-row { display: flex; justify-content: space-between; gap: 1vw; padding: .6vw 0; border-bottom: 1px solid #1d3527; }
.tv-champ { text-align: center; padding: 3vw 0; }
.tv-pos { font-size: 3vw; font-weight: 800; margin: 1vw 0; }
.tv-pos span { display: inline-grid; place-items: center; width: 4.5vw; height: 4.5vw; border-radius: 50%; background: #2a3a31; margin-right: 1vw; }
.tv-pos-1 span { background: #e9c35a; color: #0a3a25; }
.tv-pos-1 { font-size: 4.2vw; }
.tv-sponsors { position: fixed; bottom: 0; left: 0; right: 0; background: #0f1b14; border-top: 1px solid #1d3527; padding: .8vw 2.5vw; font-size: 1.2vw; color: #cfe6d8; }
@media (max-width: 800px) { body.tv { font-size: 16px; } .tv-cols { grid-template-columns: 1fr; } .tv-title { font-size: 1.4rem; } .tv-line { font-size: 1.2rem; } .tv-score { font-size: 1.8rem; } .tv-label, .tv-meta, .tv-biz, .tv-sponsors { font-size: .9rem; } .tv-clock { font-size: 1.2rem; } }
.bottom-nav a > span, .bottom-nav summary > span { max-width: 100%; padding: 0 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Icons: default size everywhere; specific places (nav, buttons) override. */
svg.icon { width: 1.25em; height: 1.25em; flex: none; vertical-align: -0.25em; }
details.panel > summary svg.icon { width: 22px; height: 22px; color: var(--primary); }
/* Let the main column shrink so wide tables scroll inside .table-wrap instead of widening the page. */
.shell > div { min-width: 0; }
.main { min-width: 0; }
/* On phones the panel hint goes under the title instead of squeezing it. */
@media (max-width: 699px) {
  details.panel > summary { display: grid; grid-template-columns: auto 1fr auto; column-gap: .6rem; align-items: center; }
  details.panel > summary::after { grid-column: 3; grid-row: 1; }
  details.panel > summary .count { grid-column: 2; grid-row: 2; font-weight: 400; }
}
.badge-reserved, .badge-pay_initiating, .badge-pay_pending, .badge-needs_review, .badge-refund_pending, .badge-refund_processing { background: var(--warning-soft); color: var(--warning); border-color: transparent; }
.badge-pay_success, .badge-refund_succeeded { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.badge-expired, .badge-pay_failed, .badge-pay_cancelled, .badge-refund_failed { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.badge-pay_refunded { background: var(--info-soft); color: var(--info); border-color: transparent; }

/* ── Shared components (design refresh) ────────────────── */
h1, h2, h3 { letter-spacing: -.01em; }
.page-head h1 { font-size: clamp(1.35rem, 2.4vw, 1.7rem); font-weight: 750; letter-spacing: -.01em; }
.page-head .sub { font-size: 1rem; }
.card { border-radius: var(--radius); }
.card-title { display: flex; align-items: center; gap: .55rem; margin: 0; font-size: 1.1rem; font-weight: 700; }
.card-title svg { color: var(--primary); width: 22px; height: 22px; }
.btn { border-radius: 10px; }
.btn-outline { background: var(--surface); border: 1.5px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary-soft); border-color: var(--primary); }
.pill { display: inline-flex; align-items: center; gap: .3rem; border-radius: 999px; padding: .3rem .85rem; font-size: .85rem; font-weight: 700; background: var(--primary); color: var(--primary-ink); white-space: nowrap; }
.pill-soft { background: var(--primary-soft); color: var(--primary); }
.pill-sample { background: var(--accent-soft); color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); }

.ic { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--primary-soft); color: var(--primary); }
.ic svg { width: 22px; height: 22px; }
.ic-orange { background: var(--orange-soft); color: var(--orange); }
.ic-blue { background: var(--info-soft); color: var(--info); }
.ic-red { background: var(--danger-soft); color: var(--danger); }
.ic-amber { background: var(--warning-soft); color: var(--warning); }

.stat-grid { display: grid; gap: .9rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 1100px) { .stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.stat-card { display: flex; align-items: center; gap: 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem; box-shadow: var(--shadow); color: inherit; text-decoration: none; min-width: 0; }
a.stat-card:hover { border-color: var(--primary); }
.stat-card .label { display: flex; align-items: center; gap: .3rem; color: var(--text); font-size: .95rem; }
.stat-card .value { display: block; font-size: clamp(1.15rem, 2vw, 1.45rem); font-weight: 750; letter-spacing: -.02em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; line-height: 1.2; }
.stat-card .hint { display: block; font-size: .78rem; color: var(--muted); margin-top: .1rem; }
@media (max-width: 520px) {
  .stat-card { flex-direction: column; align-items: flex-start; gap: .6rem; padding: .9rem; }
  .stat-card .ic { width: 44px; height: 44px; }
  .stat-card .ic svg { width: 22px; height: 22px; }
}
.info-dot { display: inline-grid; place-items: center; width: 17px; height: 17px; border-radius: 50%; border: 1.5px solid var(--muted); color: var(--muted); font-size: .7rem; font-weight: 800; cursor: help; flex: none; }

.ov-grid { display: grid; gap: 1.1rem; margin-top: 1.1rem; }
@media (min-width: 1000px) { .ov-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .ov-grid.wide-left { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); } }
.ov-card { padding: 1.25rem; }
.ov-card .card-head { margin-bottom: 1rem; }

.ledger { list-style: none; margin: 0; padding: 0; }
.ledger li { display: flex; justify-content: space-between; gap: 1rem; padding: .7rem 1rem; border-bottom: 1px solid var(--border); font-size: 1rem; }
.ledger li:nth-child(odd) { background: var(--surface-2); }
.ledger li strong, .ledger li .v { font-weight: 750; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ledger li.sub { font-size: .88rem; color: var(--muted); padding-top: .45rem; padding-bottom: .45rem; }
.ledger li.total { background: var(--primary-soft); color: var(--primary); font-weight: 800; border-radius: 10px; border: 0; margin-top: .4rem; font-size: 1.08rem; }
.ledger li.total strong { font-size: 1.1rem; }
.ledger li:last-child { border-bottom: 0; }

.state-banner { display: flex; align-items: center; gap: .65rem; border-radius: 10px; padding: .75rem .9rem; margin-top: .9rem; font-weight: 650; font-size: 1rem; }
.state-banner .ic { width: 34px; height: 34px; }
.state-banner .ic svg { width: 20px; height: 20px; }
.state-banner.ok { background: var(--ok-soft); color: var(--ok); }
.state-banner.ok .ic { background: var(--ok); color: #fff; }
.state-banner.bad { background: var(--danger-soft); color: var(--danger); }
.state-banner.bad .ic { background: var(--danger); color: #fff; }
.state-banner.warn { background: var(--warning-soft); color: var(--warning); }
.state-banner.warn .ic { background: var(--warning); color: #fff; }
.state-banner.idle { background: var(--surface-2); color: var(--muted); }
.state-banner.idle .ic { background: var(--border); color: var(--muted); }
.state-banner small { display: block; font-weight: 500; font-size: .85rem; opacity: .9; }

.debt-table { width: 100%; border-collapse: collapse; }
.debt-table th { text-align: left; font-size: .85rem; color: var(--muted); font-weight: 600; padding: .65rem .75rem; background: var(--surface-2); }
.debt-table th:first-child { border-radius: 10px 0 0 10px; }
.debt-table th:last-child { border-radius: 0 10px 10px 0; }
.debt-table td { padding: .8rem .75rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.debt-table tr:last-child td { border-bottom: 0; }
.debt-table .who { display: flex; align-items: center; gap: .7rem; font-weight: 600; }
.debt-table .who a { color: inherit; text-decoration: none; }
.debt-table .amt { color: var(--orange); font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 640px) {
  .debt-table thead { display: none; }
  .debt-table, .debt-table tbody, .debt-table tr, .debt-table td { display: block; width: 100%; }
  .debt-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .2rem .75rem; padding: .75rem 0; border-bottom: 1px solid var(--border); }
  .debt-table tr:last-child { border-bottom: 0; }
  .debt-table td { border: 0; padding: 0; }
  .debt-table td.ph { grid-column: 1; font-size: .85rem; color: var(--muted); padding-left: 3.1rem; }
  .debt-table td.amt { grid-column: 2; grid-row: 1; text-align: right; align-self: center; }
  .debt-table td.act { grid-column: 2; grid-row: 2; text-align: right; }
}

.tourney-card { position: relative; border-radius: 12px; overflow: hidden; background: var(--forest); color: #fff; padding: 1.1rem; min-height: 0; display: flex; flex-direction: column; gap: .7rem; isolation: isolate; }
.tourney-card > picture, .tourney-card > picture img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 80% 60%; z-index: -2; }
.tourney-card::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(4, 20, 13, .92), rgba(4, 20, 13, .55) 60%, rgba(4, 20, 13, .2)); }
.tourney-card h3 { color: #fff; font-size: 1.25rem; font-weight: 750; margin: 0; overflow-wrap: anywhere; }
.tourney-card .meta { display: flex; flex-direction: column; gap: .35rem; font-size: .95rem; }
.tourney-card .meta span { display: inline-flex; gap: .45rem; align-items: center; }
.tourney-card .btn { align-self: flex-start; margin-top: auto; }

.dropdown { position: relative; }
.dropdown > summary { list-style: none; cursor: pointer; }
.dropdown > summary::-webkit-details-marker { display: none; }
.dropdown .dropdown-panel { position: absolute; right: 0; top: calc(100% + 6px); min-width: 250px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); padding: .5rem; z-index: 25; }
.dropdown .dropdown-panel a { display: block; padding: .6rem .7rem; border-radius: 8px; color: var(--text); text-decoration: none; }
.dropdown .dropdown-panel a:hover, .dropdown .dropdown-panel a.active { background: var(--primary-soft); color: var(--primary); }
.dropdown .dropdown-panel form { display: flex; gap: .4rem; padding: .4rem .2rem 0; border-top: 1px solid var(--border); margin-top: .35rem; }
.btn-select { background: var(--surface); border: 1px solid var(--border); min-width: 150px; justify-content: space-between; }
.btn-select .chev { width: 16px; height: 16px; }

dialog.sheet { border: 0; border-radius: var(--radius); padding: 0; width: min(480px, calc(100vw - 2rem)); background: var(--surface); color: var(--text); box-shadow: 0 20px 60px rgba(0, 0, 0, .3); }
dialog.sheet::backdrop { background: rgba(6, 20, 14, .55); }
dialog.sheet .sheet-head { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.1rem; border-bottom: 1px solid var(--border); }
dialog.sheet .sheet-head h2 { margin: 0; font-size: 1.15rem; }
dialog.sheet .sheet-body { padding: 1rem 1.1rem 1.1rem; }
.icon-btn { background: none; border: 0; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; color: var(--muted); font-size: 1.4rem; line-height: 1; }
.icon-btn:hover { background: var(--surface-2); }

.session-strip { display: flex; flex-wrap: wrap; gap: .4rem; margin: -.35rem 0 .9rem; }
.session-strip a { display: inline-flex; align-items: center; gap: .35rem; font-size: .82rem; padding: .25rem .6rem; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); text-decoration: none; }

.close-steps { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .6rem; }
@media (min-width: 800px) { .close-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.close-steps li { display: flex; gap: .7rem; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: .8rem 1rem; }
.close-steps li .n { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; background: var(--surface-2); color: var(--muted); flex: none; }
.close-steps li.done { border-color: color-mix(in srgb, var(--ok) 40%, transparent); background: var(--ok-soft); }
.close-steps li.done .n { background: var(--ok); color: #fff; }
.close-steps li.now { border-color: var(--primary); }
.close-steps li.now .n { background: var(--primary); color: var(--primary-ink); }

.empty-state { text-align: center; padding: 1.75rem 1rem; color: var(--muted); }
.empty-state .ic { margin: 0 auto .75rem; }
.empty-state h3 { color: var(--text); margin-bottom: .35rem; }

.check-list { list-style: none; padding: 0; margin: 0; }
.check-list li { display: flex; gap: .6rem; align-items: flex-start; padding: .6rem 0; border-bottom: 1px solid var(--border); }
.check-list li:last-child { border-bottom: 0; }
.check-list .mark { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; flex: none; font-size: .75rem; font-weight: 900; margin-top: .1rem; }
.check-list .mark.warn { background: var(--warning-soft); color: var(--warning); }
.check-list .mark.info { background: var(--info-soft); color: var(--info); }
.check-list .mark.ok { background: var(--ok-soft); color: var(--ok); }
.mb-0 { margin-bottom: 0; }
/* Grid children never take the stacked-card margin. */
.grid-2 > .card + .card, .grid-3 > .card + .card, .ov-grid > .card + .card, .home-row > .card + .card { margin-top: 0; }
.stat-card .label { display: block; }
.stat-card .info-dot { display: inline-grid; vertical-align: 1px; margin-left: .15rem; }
@media (min-width: 1100px) { .stat-card .value { font-size: clamp(1.15rem, 1.5vw, 1.45rem); white-space: nowrap; } }
.debt-table .btn, .debt-table td.ph { white-space: nowrap; }
@media (min-width: 1024px) { .shell { background: linear-gradient(90deg, var(--forest) 262px, transparent 262px); } }


.fact .meter { display: block; width: 100%; max-width: 240px; }
.fact .meter > span { display: block; }
.event-tile .meter { display: block; margin-top: .4rem; }
@media (min-width: 900px) { .site-header .brand-logo { width: 48px; height: 48px; } .site-header .brand-name { font-size: 1.55rem; } }
@media (max-width: 699px) { .hero-banner::after { background: linear-gradient(180deg, rgba(4, 20, 13, .9) 0%, rgba(4, 20, 13, .72) 60%, rgba(4, 20, 13, .55) 100%); } }
.grid-2, .ov-grid { align-items: start; }
.list > li > details { min-width: 0; }
.approve-form { min-width: 240px; text-align: left; }
@media (max-width: 699px) {
  .table.responsive td.actions { flex-wrap: wrap; }
  .table.responsive td.actions details[open] { width: 100%; }
  .table.responsive td.actions details > summary { margin-left: auto; width: max-content; }
  .approve-form { min-width: 0; }
}
.approve-form { white-space: normal; } .approve-form input { display: block; }

/* Help pages */
.help-layout { display: grid; gap: 1.25rem; }
@media (min-width: 1000px) { .help-layout { grid-template-columns: 250px minmax(0, 1fr); align-items: start; } .help-toc { position: sticky; top: 1rem; max-height: calc(100vh - 2rem); overflow: auto; } }
.help-toc { font-size: .9rem; }
.help-toc ul { list-style: none; margin: 0; padding: 0; }
.help-toc li a { display: block; padding: .3rem .5rem; border-radius: 6px; color: var(--text); text-decoration: none; }
.help-toc li a:hover { background: var(--surface-2); }
.help-toc li.l3 a { padding-left: 1.2rem; color: var(--muted); font-size: .86rem; }
.help-body { max-width: 860px; line-height: 1.6; }
.help-body h1 { font-size: 1.6rem; }
.help-body h2 { font-size: 1.3rem; margin-top: 2rem; padding-top: .5rem; border-top: 1px solid var(--border); }
.help-body h3 { font-size: 1.08rem; margin-top: 1.4rem; }
.help-body h4 { font-size: 1rem; margin-top: 1rem; }
.help-body img { display: block; max-width: 100%; height: auto; border: 1px solid var(--border); border-radius: 8px; margin: .75rem 0 1rem; }
.help-body table { border-collapse: collapse; width: 100%; margin: .5rem 0 1rem; font-size: .92rem; }
.help-body th, .help-body td { border: 1px solid var(--border); padding: .4rem .6rem; text-align: left; vertical-align: top; }
.help-body th { background: var(--surface-2); }
.help-body blockquote { margin: .75rem 0; padding: .6rem .9rem; background: var(--warning-soft); border-left: 4px solid var(--warning); border-radius: 0 8px 8px 0; }
.help-body code { background: var(--surface-2); padding: .05rem .3rem; border-radius: 4px; font-size: .9em; }
.help-link { display: inline-flex; align-items: center; gap: .3rem; font-size: .88rem; color: var(--muted); text-decoration: none; border: 1px solid var(--border); border-radius: 999px; padding: .2rem .65rem; background: var(--surface); }
.help-link:hover { color: var(--primary); border-color: var(--primary); }
.quick-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin: 0 0 1rem; }
.quick-actions .btn { font-size: .92rem; }
.date-block { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; min-width: 58px; padding: .35rem .5rem; border-radius: 8px; background: rgba(255, 255, 255, .12); color: #fff; line-height: 1.1; font-weight: 700; }
.date-block .d { font-size: 1.5rem; }
.date-block .m { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; }
.setup-list li { align-items: center; }
/* Featured tournament: one column, compact header strip. */
.feature { grid-template-columns: minmax(0, 1fr) !important; gap: .9rem; }
.feature-media { min-height: 0; flex-direction: row; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .6rem; padding: .9rem 1rem; }
.feature-media h2 { margin: 0; }
.feature-body { padding: 0 .35rem .35rem; }
/* Featured tournament: one column, compact header strip. */
.feature { grid-template-columns: minmax(0, 1fr) !important; gap: .9rem; }
.feature-media { min-height: 0; flex-direction: row; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .6rem; padding: .9rem 1rem; }
.feature-media h2 { margin: 0; }
.feature-body { padding: 0 .35rem .35rem; }
.help-layout > * { min-width: 0; }
.help-toc a { overflow-wrap: anywhere; }
.help-body { overflow-wrap: break-word; }
@media (max-width: 999px) { .help-toc li.l3 { display: none; } .help-toc ul { columns: 2; column-gap: 1rem; } }
@media (max-width: 480px) { .help-toc ul { columns: 1; } }
/* Photos: always under a dark overlay so text stays readable; plain colour if they fail to load. */
.feature-media::after, .event-tile .top::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(4, 20, 13, .9), rgba(4, 20, 13, .5)); }
.feature-media > picture, .feature-media > picture img, .event-tile .top > picture, .event-tile .top > picture img { z-index: -2; opacity: 1; }
.event-tile .top { min-height: 120px; }
.feature-media { min-height: 110px; }
/* Staff sign-in: photo beside the form on wide screens only. */
.auth-photo { display: none; }
@media (min-width: 900px) {
  .auth-split { display: grid; grid-template-columns: minmax(0, 45%) minmax(0, 1fr); min-height: 100vh; }
  .auth-photo { display: block; position: relative; background: var(--forest); overflow: hidden; }
  .auth-photo picture, .auth-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
}
.hero-banner > picture img { object-position: 62% 40%; }
@media (min-width: 900px) { .hero-banner .wrap { padding-top: 3.5rem; padding-bottom: 4rem; } }
@media (max-width: 699px) { .hero-banner::after { background: linear-gradient(180deg, rgba(4, 20, 13, .82) 0%, rgba(4, 20, 13, .6) 60%, rgba(4, 20, 13, .45) 100%); } }
.badge-payment_paid { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.badge-payment_partial, .badge-payment_unpaid { background: var(--warning-soft); color: var(--warning); border-color: transparent; }
.badge-flag_incomplete, .badge-flag_no_place { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
