/* CanWeUseIt design system. Tokens first; every color, size and shadow below comes from them, so dark mode is one block. */
:root {
  --bg: #f5f7f3; --surface: #ffffff; --surface-2: #f0f3ee; --surface-3: #e6ebe3;
  --border: #dde3da; --border-strong: #b7c3b4;
  --text: #17261d; --text-2: #55655a;
  --primary: #1e4b35; --primary-hover: #163b29; --primary-ink: #ffffff; --primary-soft: #e3efe7;
  --accent: #f2c230; --accent-ink: #17261d;
  --danger: #a8321f; --danger-soft: #fbe9e6;
  --warn: #7a5a00; --warn-soft: #fff4d6; --warn-border: #ecd384;
  --ok: #1f6b3e; --ok-soft: #dff0e4;
  --pending-soft: #fbf0c4;
  --pitch: #1e4b35; --pitch-2: #255a41; --bar: #173d2a;
  --shadow-1: 0 1px 2px rgba(16, 24, 20, .06);
  --shadow-2: 0 2px 6px rgba(16, 24, 20, .06), 0 12px 32px rgba(16, 24, 20, .12);
  --radius: 12px; --radius-s: 8px;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px;
  --t-xs: .75rem; --t-s: .875rem; --t-m: 1rem; --t-l: 1.25rem; --t-xl: 1.5rem; --t-2xl: 2rem;
  --display: "Bricolage Grotesque", system-ui, sans-serif;
  --body: "Instrument Sans", system-ui, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
  /* older names, kept so every screen picks up the tokens */
  --turf: var(--primary); --mown: var(--pitch-2); --chalk: var(--bg); --paper: var(--surface); --ink: var(--text);
  --muted: var(--text-2); --line: var(--border); --paint: var(--accent); --flag: var(--danger);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0f1512; --surface: #161e1a; --surface-2: #1c2621; --surface-3: #24302a;
  --border: #2b3731; --border-strong: #42524a;
  --text: #e7efe9; --text-2: #a5b5ab;
  --primary: #2f7a54; --primary-hover: #276848; --primary-ink: #ffffff; --primary-soft: #1d3428;
  --danger: #f2907e; --danger-soft: #3a201b;
  --warn: #f1cf6e; --warn-soft: #332b12; --warn-border: #6b5a24;
  --ok: #86d6a4; --ok-soft: #173322;
  --pending-soft: #3a3313;
  --bar: #0c1a13;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-2: 0 2px 8px rgba(0, 0, 0, .4), 0 12px 32px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 var(--body); font-variant-numeric: tabular-nums; }
h1, h2, h3, h4 { font-family: var(--display); font-weight: 700; line-height: 1.15; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: var(--t-2xl); } h2 { font-size: var(--t-xl); } h3 { font-size: 1.1rem; } h4 { font-size: var(--t-m); margin-top: .4em; }
a { color: var(--primary); } :root[data-theme="dark"] a { color: var(--ok); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.hidden { display: none !important; }
.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; }
.ic { flex: none; vertical-align: -4px; }
.muted { color: var(--text-2); }
.small { font-size: var(--t-s); }
.row { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; }
.row.between { justify-content: space-between; }
.grow { flex-basis: 100%; } .grow-1 { flex: 1; min-width: 0; }
.stack > * + * { margin-top: var(--s3); }
.mono { font-family: ui-monospace, Menlo, monospace; font-size: .85rem; }

/* ---------- app frame: top bar, sidebar (desktop), bottom tabs (phone) ---------- */
.app { min-height: 100vh; display: grid; grid-template-columns: 248px minmax(0, 1fr); grid-template-rows: 56px minmax(0, 1fr); }
.topbar { grid-column: 1 / -1; position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: var(--s3); padding: 0 var(--s4);
  background: var(--bar); color: #fff; background-image: repeating-linear-gradient(90deg, rgba(255,255,255,.035) 0 56px, transparent 56px 112px); }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font: 700 1.05rem var(--display); white-space: nowrap; }
.brand svg { border-radius: 8px; }
.brand .sep { opacity: .35; font-weight: 400; }
.tenant-name { font: 600 .95rem var(--body); opacity: .92; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 40vw; }
.switch select { font: 600 .95rem var(--body); max-width: 46vw; border: 1px solid rgba(255,255,255,.28); background: rgba(255,255,255,.06); color: #fff; border-radius: var(--radius-s); padding: 4px 28px 4px 10px; width: auto; }
.switch select option { color: #17261d; background: #fff; }
.topbar .spacer { flex: 1; }
.top-search { position: relative; width: min(320px, 30vw); }
.top-search input[type=search] { width: 100%; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18); color: #fff; border-radius: 999px; padding: 6px 12px 6px 34px; }
.top-search input::placeholder { color: rgba(255,255,255,.7); }
.top-search .ic { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); opacity: .75; }
.avatar { width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-ink); font-weight: 700; cursor: pointer; display: grid; place-items: center; }

.sidebar { position: sticky; top: 56px; height: calc(100vh - 56px); overflow-y: auto; background: var(--surface); border-right: 1px solid var(--border); padding: var(--s4) var(--s3); }
.nav-group + .nav-group { margin-top: var(--s4); }
.nav-label { font-size: var(--t-xs); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-2); padding: 0 var(--s3) var(--s1); }
.nav-item { display: flex; align-items: center; gap: var(--s3); width: 100%; border: 0; background: none; padding: 9px var(--s3); border-radius: var(--radius-s); cursor: pointer; color: var(--text); font-weight: 500; text-align: left; position: relative; }
.nav-item:hover { background: var(--surface-2); }
.nav-item[aria-current="page"] { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
:root[data-theme="dark"] .nav-item[aria-current="page"] { color: var(--ok); }
.nav-item[aria-current="page"]::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: var(--primary); }
.count { margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: var(--t-xs); font-weight: 700; display: inline-grid; place-items: center; }

main { min-width: 0; padding: var(--s5) var(--s5) 72px; max-width: 1180px; width: 100%; }
.body { min-width: 0; }
.body > main { margin: 0 auto; }
.foot { padding: 0 var(--s5) var(--s5); }
.legal-links { color: var(--text-2); } .legal-links a { color: inherit; }

.tabbar { display: none; }
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar, .top-search { display: none; }
  main { padding: var(--s4) var(--s4) 104px; }
  .foot { padding: 0 var(--s4) 104px; }
  .brand .wordmark, .brand .sep { display: none; }
  .tabbar { display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--surface);
    border-top: 1px solid var(--border); padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); box-shadow: 0 -4px 16px rgba(0,0,0,.06); }
  .tab { border: 0; background: none; display: grid; justify-items: center; gap: 2px; padding: 6px 0; font-size: .72rem; font-weight: 600; color: var(--text-2); cursor: pointer; position: relative; }
  .tab[aria-current="page"] { color: var(--primary); }
  :root[data-theme="dark"] .tab[aria-current="page"] { color: var(--ok); }
  .tab .count { position: absolute; top: 0; left: calc(50% + 6px); margin: 0; min-width: 18px; height: 18px; font-size: .65rem; padding: 0 5px; }
  .tab.raise .bubble { width: 48px; height: 48px; margin-top: -22px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; box-shadow: var(--shadow-2); }
}

/* ---------- headings, panels, forms ---------- */
.head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--s3); margin-bottom: var(--s4); }
.head.tight { margin-bottom: 0; }
.page-sub { color: var(--text-2); margin-top: 4px; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--s4); box-shadow: var(--shadow-1); }
@media (min-width: 901px) { .panel { padding: var(--s5); } }
.panel > h3 + * { margin-top: var(--s3); }
label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 4px; }
input[type=text], input[type=email], input[type=date], input[type=time], input[type=number], input[type=search], input[type=tel], select, textarea {
  width: 100%; padding: 10px 12px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-s); color: var(--text); }
input:hover, select:hover, textarea:hover { border-color: var(--text-2); }
textarea { min-height: 72px; resize: vertical; }
input[readonly] { background: var(--surface-2); }
.grid2 { display: grid; gap: var(--s3); grid-template-columns: 1fr 1fr; }
.field + .field { margin-top: var(--s3); }
.w-s { width: 140px !important; } .w-m { width: 240px !important; max-width: 100%; }
.affix { display: inline-flex; align-items: stretch; border: 1px solid var(--border-strong); border-radius: var(--radius-s); background: var(--surface); overflow: hidden; }
.affix > span { padding: 0 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--text-2); font-weight: 600; }
.affix input { border: 0; border-radius: 0; width: 120px; }
.inline-check { gap: 6px; font-weight: 600; margin-bottom: 0; display: flex; align-items: center; }
.row > input[type=text], .row > input[type=email], .row > input[type=search], .row > select { width: auto; flex: 1 1 200px; }
.row > input[type=date], .row > input[type=time] { width: auto; flex: 0 1 170px; }
@media (max-width: 560px) { .grid2 { grid-template-columns: 1fr; } }
details summary { cursor: pointer; font-weight: 600; }
details > .stack, details > .grid2 { margin-top: var(--s3); }

/* ---------- buttons: one filled primary per view, quiet secondaries, destructive in menus ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--primary); color: var(--primary-ink); border: 1px solid transparent; border-radius: var(--radius-s);
  padding: 9px 16px; font-weight: 600; cursor: pointer; text-decoration: none; line-height: 1.25; transition: background .15s, border-color .15s, box-shadow .15s; }
.btn:hover { background: var(--primary-hover); }
.btn.alt { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn.alt:hover { background: var(--surface-2); }
.btn.ghost { background: transparent; color: var(--text); border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { background: transparent; color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, transparent); }
.btn.danger:hover { background: var(--danger-soft); }
.btn.danger.solid { background: var(--danger); color: #fff; }
.btn.small { padding: 6px 11px; font-size: var(--t-s); }
.btn[disabled] { opacity: .5; cursor: default; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: var(--radius-s); border: 1px solid transparent; background: transparent; color: var(--text-2); cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.linkbtn { background: none; border: 0; color: var(--primary); text-decoration: underline; cursor: pointer; padding: 0; font-weight: 600; }
:root[data-theme="dark"] .linkbtn { color: var(--ok); }
.actions { display: flex; gap: var(--s2); margin-top: var(--s3); flex-wrap: wrap; align-items: center; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--border-strong); background: var(--surface); border-radius: 999px; padding: 6px 13px; cursor: pointer; font-weight: 500; color: var(--text); }
.chip:hover { background: var(--surface-2); }
.chip[aria-pressed="true"] { background: var(--primary); color: #fff; border-color: var(--primary); }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 3px; }
.seg button { border: 0; background: none; border-radius: 999px; padding: 5px 14px; font-weight: 600; cursor: pointer; color: var(--text-2); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); }

/* ---------- menus and sheets ---------- */
.menu-wrap { position: relative; display: inline-block; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; min-width: 220px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-2); padding: 6px; animation: pop .14s var(--ease); }
.menu-pop.up { top: auto; bottom: calc(100% + 6px); }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; padding: 9px 10px; border-radius: 6px; cursor: pointer; text-align: left; color: var(--text); text-decoration: none; font-weight: 500; }
.menu-item:hover, .menu-item:focus-visible { background: var(--surface-2); }
.menu-item.danger { color: var(--danger); }
.menu-sep { height: 1px; background: var(--border); margin: 6px 4px; }
.menu-head { padding: 8px 10px 6px; font-size: var(--t-s); color: var(--text-2); }
dialog.sheet { border: 0; padding: 0; background: var(--surface); color: var(--text); border-radius: 16px; width: min(560px, calc(100vw - 32px)); max-height: 86vh; box-shadow: var(--shadow-2); }
dialog.sheet::backdrop { background: rgba(10, 20, 14, .45); }
dialog.sheet[open] { animation: pop .18s var(--ease); }
.sheet-head { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); padding: var(--s4) var(--s4) 0; }
.sheet-body { padding: var(--s4); overflow-y: auto; max-height: calc(86vh - 64px); }
@media (max-width: 640px) {
  dialog.sheet { margin: auto 0 0; width: 100vw; max-width: 100vw; border-radius: 18px 18px 0 0; }
  dialog.sheet[open] { animation: rise .22s var(--ease); }
  .sheet-head::before { content: ""; position: absolute; left: 50%; top: 8px; width: 40px; height: 4px; border-radius: 4px; background: var(--border-strong); transform: translateX(-50%); }
  .sheet-head { position: relative; padding-top: 22px; }
}

/* ---------- status ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 2px 10px 2px 8px; font-size: .78rem; font-weight: 600; background: var(--surface-3); color: var(--text); white-space: nowrap; }
.badge .ic { vertical-align: 0; }
.badge.pending { background: var(--pending-soft); color: var(--warn); }
.badge.approved, .badge.confirmed { background: var(--ok-soft); color: var(--ok); }
.badge.declined, .badge.cancelled { background: var(--surface-3); color: var(--text-2); }
.badge.flagged, .badge.conflict { background: var(--danger-soft); color: var(--danger); }
:root:not([data-theme="dark"]) .badge.flagged, :root:not([data-theme="dark"]) .badge.conflict { color: #8f2a1c; }
.pill { display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 2px 9px; font-size: .78rem; font-weight: 600; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }
.notice { background: var(--warn-soft); border: 1px solid var(--warn-border); border-radius: var(--radius-s); padding: 10px 12px; margin-bottom: var(--s3); }
.notice.ic-row { display: flex; gap: 10px; align-items: flex-start; }
.notice > .ic { color: var(--warn); margin-top: 2px; }
.notice p { margin: 0; } .notice p + p { margin-top: 6px; }
.notice.stack { display: block; }
.okbox { background: var(--ok-soft); border: 1px solid color-mix(in srgb, var(--ok) 35%, transparent); border-radius: var(--radius-s); padding: 10px 12px; }
.warn-text { color: var(--danger); font-size: .82rem; flex-basis: 100%; }
.decision-note { background: var(--surface-2); border-radius: var(--radius-s); padding: 8px 10px; margin: 8px 0 0; }
.note-box { margin-top: var(--s3); }

/* ---------- empty states and loading ---------- */
.empty-state { text-align: center; padding: 40px 16px; display: grid; justify-items: center; gap: 10px; }
.empty-state svg.art { color: var(--border-strong); }
.empty-state h3 { font-size: 1.15rem; }
.empty-state p { margin: 0; max-width: 42ch; color: var(--text-2); }
.empty, .empty-big { color: var(--text-2); }
.empty-big { text-align: center; padding: 40px 16px; }
.sk { background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface-3) 50%, var(--surface-2) 100%); background-size: 200% 100%; border-radius: var(--radius-s); animation: shimmer 1.2s linear infinite; }
.sk-line { height: 14px; margin: 10px 0; } .sk-title { height: 28px; width: 40%; margin-bottom: 20px; } .sk-card { height: 120px; margin-top: 12px; border-radius: var(--radius); }
.view-enter { animation: fadeup .2s var(--ease); }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes fadeup { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }
@keyframes rise { from { transform: translateY(40px); opacity: .6; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- sign in ---------- */
.signin { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); }
.signin-form { display: grid; align-content: center; padding: 48px clamp(24px, 6vw, 88px); gap: var(--s4); background: var(--surface); }
.signin-form h1 { font-size: clamp(1.8rem, 3vw, 2.4rem); }
.signin-art { background: var(--bar); color: #fff; display: grid; align-content: center; justify-items: center; gap: var(--s5); padding: 48px; text-align: center;
  background-image: repeating-linear-gradient(90deg, rgba(255,255,255,.04) 0 64px, transparent 64px 128px); }
.signin-art p.tag-line { font: 700 clamp(1.4rem, 2.6vw, 2rem)/1.2 var(--display); max-width: 18ch; margin: 0; }
.signin-art p.sub { opacity: .8; max-width: 36ch; margin: 0; }
.signin-art svg { width: min(460px, 100%); height: auto; filter: drop-shadow(0 20px 40px rgba(0,0,0,.35)); }
@media (max-width: 860px) { .signin { grid-template-columns: 1fr; } .signin-art { order: -1; padding: 28px 20px; gap: 12px; } .signin-art svg { display: none; } }
.check-email { display: grid; gap: var(--s3); }

/* ---------- the pitch picker: drawn as real pitches ---------- */
.facility + .facility { margin-top: var(--s5); }
.facility > h3 { margin-bottom: var(--s2); display: flex; align-items: center; gap: 6px; }
.pitches { display: grid; gap: var(--s4); grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.pitch { position: relative; border-radius: 10px; padding: 8px; color: #fff; overflow: hidden;
  background: repeating-linear-gradient(90deg, var(--pitch) 0 26px, var(--pitch-2) 26px 52px); box-shadow: var(--shadow-1); }
.pitch .whole { display: flex; width: 100%; justify-content: space-between; align-items: center; gap: 8px; background: rgba(0,0,0,.22); color: #fff; border: 0;
  border-radius: 6px; padding: 7px 10px; cursor: pointer; font-weight: 600; text-align: left; margin-bottom: 6px; }
.pitch .parts { position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; border: 2px solid rgba(255,255,255,.9); border-radius: 3px; min-height: 104px; }
.pitch .parts::after { content: ""; position: absolute; left: 50%; top: 50%; width: 46px; height: 46px; border: 2px solid rgba(255,255,255,.75); border-radius: 50%; transform: translate(-50%, -50%); pointer-events: none; }
.pitch .parts > * + * { border-left: 2px solid rgba(255,255,255,.9); }
.pitch .part { background: none; border: 0; color: #fff; cursor: pointer; padding: 10px; text-align: left; font-weight: 600; width: 100%; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; position: relative; z-index: 1; }
.pitch.single { padding: 8px; }
.pitch.single > .whole { position: relative; min-height: 132px; align-items: flex-start; margin: 0; background: none; border: 2px solid rgba(255,255,255,.9); border-radius: 3px; flex-direction: column; justify-content: flex-start; }
.pitch.single > .whole::after { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; border-left: 2px solid rgba(255,255,255,.85); }
.pitch.single > .whole::before { content: ""; position: absolute; left: 50%; top: 50%; width: 46px; height: 46px; border: 2px solid rgba(255,255,255,.75); border-radius: 50%; transform: translate(-50%, -50%); }
.pitch.single > .whole > * { position: relative; z-index: 1; background: rgba(0,0,0,.28); border-radius: 4px; padding: 1px 6px; }
.pitch button:hover { background: rgba(255,255,255,.12); }
.pitch [aria-pressed="true"] { background: var(--accent) !important; color: #17261d; }
.pitch [aria-pressed="true"] > * { background: transparent !important; }
.pitch.closed { filter: grayscale(.8); opacity: .75; }
.tag { display: inline-flex; align-items: center; gap: 3px; font-size: .72rem; font-weight: 600; background: rgba(255,255,255,.22); border-radius: 4px; padding: 1px 6px; white-space: nowrap; }
.tag .ic { vertical-align: 0; }
.tag.dark { background: var(--surface-3); color: var(--text); }
[aria-pressed="true"] .tag { background: rgba(0,0,0,.14); }

/* ---------- schedule ---------- */
.cal-tools { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; }
.legend-row { display: flex; flex-wrap: wrap; gap: var(--s4); align-items: center; font-size: var(--t-s); color: var(--text-2); margin: 0 0 var(--s3); }
.legend-row .sw { display: inline-block; width: 22px; height: 12px; border-radius: 3px; vertical-align: -1px; margin-right: 6px; border-left: 3px solid var(--text-2); background: var(--surface-3); }
.legend-row .sw.pending { background: repeating-linear-gradient(135deg, var(--surface-3) 0 4px, transparent 4px 8px); }
.legend-row .sw.closed { background: var(--surface-3); border-left-color: var(--text-2); }
.field-chips { margin-bottom: var(--s3); }
.cal { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-1); }
.cal-head, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-head div { padding: 8px; font-size: .78rem; font-weight: 600; text-align: center; color: var(--text-2); background: var(--surface-2); border-bottom: 1px solid var(--border); }
.cell { min-height: 64px; padding: 6px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); cursor: pointer; position: relative; background: var(--surface); display: flex; flex-direction: column; gap: 3px; }
.cell:nth-child(7n) { border-right: 0; }
.cell:hover { background: var(--surface-2); }
.cell.other { background: var(--surface-2); color: var(--text-2); }
.cell.today .num { background: var(--primary); color: #fff; }
.cell.sel { box-shadow: inset 0 0 0 3px var(--accent); }
.num { display: inline-block; min-width: 26px; height: 26px; line-height: 26px; text-align: center; border-radius: 50%; font-size: .85rem; font-weight: 600; }
.closed-band { display: flex; align-items: center; gap: 4px; font-size: .7rem; font-weight: 700; color: var(--text-2); background: var(--surface-3); border-radius: 4px; padding: 1px 6px; }
.closed-band .ic { vertical-align: 0; }
.chips-b { display: none; flex-direction: column; gap: 3px; }
.chip-b { display: block; border-radius: 4px; padding: 2px 6px; font-size: .74rem; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text);
  background: color-mix(in srgb, var(--c, #888) 16%, var(--surface)); border-left: 3px solid var(--c, #888); }
.chip-b b { font-weight: 700; }
.chip-b.pending, .slot.pending, .blk.pending, .ag-item.pending { background-image: repeating-linear-gradient(135deg, color-mix(in srgb, var(--c, #888) 22%, transparent) 0 5px, transparent 5px 10px); }
.chip-b .ic { vertical-align: -2px; }
.more { font-size: .72rem; color: var(--text-2); }
.dots { display: flex; flex-wrap: wrap; gap: 3px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c, #888); display: inline-block; }
.dot.pending { background: transparent; box-shadow: inset 0 0 0 2px var(--c, #888); }
.closed-note { display: flex; gap: 6px; align-items: center; background: var(--surface-3); border-radius: 6px; padding: 4px 8px; font-size: .85rem; margin: 6px 0; }
@media (min-width: 760px) { .cell { min-height: 112px; } .chips-b { display: flex; } .dots { display: none; } }
.week { display: grid; gap: 10px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .week { grid-template-columns: repeat(7, minmax(0, 1fr)); } }
.day { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; min-height: 90px; }
.day.today { border-color: var(--primary); box-shadow: inset 0 3px 0 var(--primary); }
.day.sel { box-shadow: inset 0 0 0 3px var(--accent); }
.day h3 { font-size: .95rem; margin-bottom: 8px; }
.dayhead { font: inherit; font-weight: 700; text-decoration: none; color: var(--text); }
.slot { border-radius: 6px; padding: 6px 8px; font-size: .85rem; line-height: 1.3; background: color-mix(in srgb, var(--c, #888) 14%, var(--surface)); border-left: 4px solid var(--c, #888); }
.slot + .slot { margin-top: 6px; }
.slot b { display: block; font-weight: 600; }
/* agenda */
.agenda { display: grid; gap: var(--s4); }
.ag-day h3 { font-size: .95rem; color: var(--text-2); margin-bottom: var(--s2); display: flex; gap: 8px; align-items: baseline; }
.ag-day h3 .today-tag { color: var(--primary); }
.ag-list { display: grid; gap: var(--s2); }
.ag-item { display: grid; grid-template-columns: auto 1fr auto; gap: var(--s3); align-items: center; background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--c, #888);
  border-radius: var(--radius-s); padding: 10px 12px; box-shadow: var(--shadow-1); width: 100%; text-align: left; color: var(--text); cursor: pointer; }
.ag-item .t { font-weight: 700; font-size: .95rem; min-width: 64px; }
.ag-item .w { font-size: .85rem; color: var(--text-2); }
.ag-closed { display: flex; gap: 8px; align-items: center; color: var(--text-2); font-size: .9rem; background: var(--surface-2); border-radius: var(--radius-s); padding: 8px 12px; }
/* day panel */
.lanes { display: grid; gap: 8px; }
.lane { display: grid; grid-template-columns: 160px 1fr; gap: 8px; align-items: center; }
.lane-name { padding-left: calc(var(--depth, 0) * 14px); font-weight: 600; font-size: .9rem; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.bar-track { position: relative; height: 38px; background: repeating-linear-gradient(90deg, var(--surface-2) 0 calc(100% / 16 - 1px), var(--border) calc(100% / 16 - 1px) calc(100% / 16)); border-radius: 6px; border: 1px solid var(--border); overflow: hidden; }
.free { position: absolute; top: 0; bottom: 0; background: transparent; border: 0; cursor: pointer; padding: 0; }
.free:hover, .free:focus-visible { background: color-mix(in srgb, var(--accent) 55%, transparent); }
.blk { position: absolute; top: 3px; bottom: 3px; border-radius: 5px; font-size: .72rem; overflow: hidden; white-space: nowrap; padding: 0 6px; display: flex; align-items: center; z-index: 1;
  background: color-mix(in srgb, var(--c, #888) 24%, var(--surface)); border-left: 3px solid var(--c, #888); color: var(--text); }
.blk.shared { background: repeating-linear-gradient(45deg, var(--surface-3) 0 6px, var(--surface-2) 6px 12px); border-left-color: var(--border-strong); color: var(--text-2); }
.blk.shut { background: repeating-linear-gradient(45deg, var(--border-strong) 0 6px, var(--surface-3) 6px 12px); border-left-color: var(--text-2); }
.head-lane { margin-bottom: -2px; }
.ticks { position: relative; height: 16px; font-size: .7rem; color: var(--text-2); }
.ticks span { position: absolute; transform: translateX(-30%); }
.ticks span:last-child { transform: translateX(-100%); }
@media (max-width: 560px) { .lane { grid-template-columns: 1fr; gap: 2px; } .head-lane .lane-name { display: none; } }
.items { display: grid; gap: 8px; }
.item { border-top: 1px solid var(--border); padding-top: 8px; }
.item.stack { display: grid; gap: 8px; }
.inline-form { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; align-items: center; }
.inline-form input { width: auto; }

/* ---------- requests ---------- */
.rq-tools { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; justify-content: space-between; margin-bottom: var(--s3); }
.split { display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); gap: var(--s4); align-items: start; }
.rq-list { display: grid; gap: 6px; position: sticky; top: 72px; max-height: calc(100vh - 96px); overflow-y: auto; padding: 2px; }
.rq-row { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: start; text-align: left; width: 100%; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-s); padding: 10px 12px; cursor: pointer; color: var(--text); }
.rq-row:hover { border-color: var(--border-strong); }
.rq-row[aria-current="true"] { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); background: var(--primary-soft); }
.rq-row .t { font-weight: 700; } .rq-row .m { font-size: .8rem; color: var(--text-2); }
.rq-row .bar { width: 4px; align-self: stretch; border-radius: 4px; background: var(--c, #888); }
.card + .card { margin-top: var(--s3); }
.rq-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--s3); align-items: start; }
.rq-head h3 { font-size: 1.2rem; }
.rq-meta { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin-top: 6px; color: var(--text-2); font-size: var(--t-s); }
.rq-meta .sep { opacity: .5; }
.rq-acts { display: flex; gap: var(--s2); align-items: center; }
@media (max-width: 640px) { .rq-head { grid-template-columns: auto minmax(0, 1fr); } .rq-acts { grid-column: 1 / -1; } }
.facts { display: grid; gap: 8px; margin-top: var(--s4); }
.fact { display: flex; gap: 10px; align-items: flex-start; }
.fact .ic { color: var(--text-2); margin-top: 2px; }
.fact.problem { color: var(--danger); } .fact.problem .ic { color: var(--danger); }
.fact.ok .ic { color: var(--ok); }
.dates { list-style: none; margin: var(--s3) 0 0; padding: 0; }
.dates li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 0; border-top: 1px solid var(--border); font-size: .92rem; }
.dates .when { flex: 1 1 200px; }
.pick { display: flex; align-items: flex-start; padding-top: 3px; margin: 0; } .pick input { width: 20px; height: 20px; accent-color: var(--primary); }
.bulkbar { position: sticky; top: 64px; z-index: 15; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 12px; box-shadow: var(--shadow-2); margin-bottom: 12px; }
@media (max-width: 900px) { .bulkbar { top: auto; bottom: 88px; position: fixed; left: 12px; right: 12px; } }
.filters { margin-bottom: var(--s3); }
.kbd { font: 600 .72rem ui-monospace, monospace; border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; color: var(--text-2); }

/* ---------- request time: steps ---------- */
.wizard { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: var(--s5); align-items: start; }
@media (max-width: 980px) { .wizard { grid-template-columns: minmax(0, 1fr); } }
.steps { display: flex; gap: var(--s2); list-style: none; padding: 0; margin: 0 0 var(--s4); counter-reset: st; }
.steps li { flex: 1; display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--text-2); font-size: var(--t-s); }
.steps li::before { counter-increment: st; content: counter(st); width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); color: var(--text-2); font-size: .8rem; flex: none; }
.steps li::after { content: ""; flex: 1; height: 2px; background: var(--border); border-radius: 2px; }
.steps li:last-child::after { display: none; }
.steps li[aria-current="step"] { color: var(--text); }
.steps li[aria-current="step"]::before { background: var(--primary); color: #fff; }
.steps li.done::before { content: "✓"; background: var(--ok-soft); color: var(--ok); }
.summary { position: sticky; top: 72px; }
.summary dl { margin: 0; display: grid; gap: 10px; }
.summary dt { font-size: var(--t-xs); text-transform: uppercase; letter-spacing: .05em; color: var(--text-2); font-weight: 600; }
.summary dd { margin: 2px 0 0; font-weight: 600; }
@media (max-width: 980px) { .summary { position: static; } }
.avail { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 4px 12px; font-weight: 600; font-size: var(--t-s); }
.avail.is-free { background: var(--ok-soft); color: var(--ok); }
.avail.is-part { background: var(--warn-soft); color: var(--warn); }
.avail.is-taken { background: var(--danger-soft); color: var(--danger); }
.avail.is-wait { background: var(--surface-2); color: var(--text-2); }
.wiz-nav { display: flex; justify-content: space-between; gap: var(--s2); margin-top: var(--s4); }

/* ---------- setup ---------- */
.setup { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: var(--s5); align-items: start; }
.setup-nav { position: sticky; top: 72px; display: grid; gap: 2px; }
@media (max-width: 900px) { .setup { grid-template-columns: minmax(0, 1fr); } .setup-nav { position: static; display: flex; overflow-x: auto; gap: 6px; padding-bottom: 4px; } .setup-nav .nav-item { white-space: nowrap; width: auto; border: 1px solid var(--border); } .setup-nav .nav-item[aria-current="page"]::before { display: none; } }
.checklist { display: grid; grid-template-columns: auto 1fr; gap: var(--s4); align-items: center; }
.checklist ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.checklist li { display: flex; gap: 8px; align-items: center; }
.checklist li.done { color: var(--text-2); text-decoration: line-through; }
.checklist li .ic { color: var(--text-2); } .checklist li.done .ic { color: var(--ok); }
.field-cards { display: grid; gap: var(--s3); grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.field-card { border: 1px solid var(--border); border-radius: var(--radius-s); padding: 10px; display: grid; gap: 6px; align-content: start; background: var(--surface); }
.field-card svg.thumb { width: 100%; height: 90px; background: var(--pitch); border-radius: 6px; }

/* ---------- tables, stats, misc ---------- */
.tbl { width: 100%; border-collapse: collapse; } .tbl th, .tbl td { text-align: left; padding: 8px; border-top: 1px solid var(--border); } .tbl .num { text-align: right; }
.tbl th { font-size: var(--t-s); color: var(--text-2); font-weight: 600; }
.table-wrap { overflow-x: auto; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--s3); }
.stat b { display: block; font: 700 1.8rem var(--display); }
ul.plain { list-style: none; margin: 0; padding: 0; } ul.plain li { padding: 8px 0; border-top: 1px solid var(--border); }
.plain.small li { padding: 5px 0; }
#toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: var(--radius-s);
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; max-width: 90vw; z-index: 60; box-shadow: var(--shadow-2); font-weight: 500; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.err { background: var(--danger); color: #fff; }
@media (max-width: 900px) { #toast { bottom: 96px; } }

/* maps, teams, utilization, public pages */
.fieldmap { height: 340px; border-radius: var(--radius); border: 1px solid var(--border); overflow: hidden; background: #2b3a2f; }
.fieldmap.tall { height: 460px; }
.leaflet-container { font: inherit; }
.leaflet-tooltip.map-label { background: rgba(23, 38, 29, .78); color: #fff; border: 0; box-shadow: none; font-weight: 600; font-size: .78rem; padding: 2px 6px; }
.leaflet-tooltip.map-label::before { display: none; }
.fieldmap .leaflet-control-attribution a { text-decoration: underline; }
.slot-row { display: grid; grid-template-columns: 1.2fr 1.4fr .9fr .9fr auto; gap: 8px; align-items: center; }
@media (max-width: 640px) { .slot-row { grid-template-columns: 1fr 1fr; } .slot-row > button { grid-column: span 2; } }
.meter { display: inline-block; width: 120px; max-width: 100%; height: 10px; border-radius: 5px; background: var(--surface-3); overflow: hidden; vertical-align: middle; }
.meter > span { display: block; height: 100%; background: var(--primary); }
.flagged-row td { background: var(--warn-soft); }
.public-page { background: var(--bg); }
.public-wrap { max-width: 720px; margin: 0 auto; padding: 32px 16px 48px; }
.public-wrap h1 { font-size: 1.8rem; line-height: 1.2; }
.public-brand { display: flex; align-items: center; gap: 10px; font: 700 1rem var(--display); color: var(--text); text-decoration: none; margin-bottom: 24px; }
.legal h2 { font-size: 1.15rem; margin-top: 1.6em; }
.legal table { border-collapse: collapse; width: 100%; } .legal th, .legal td { text-align: left; border-top: 1px solid var(--border); padding: 6px 8px; }
.powered { font-size: var(--t-s); color: var(--text-2); margin-top: 24px; }
/* older public pages (apply, permit) */
.login { max-width: 460px; margin: 0 auto; }
.login-top { height: 96px; background: var(--bar); background-image: repeating-linear-gradient(90deg, rgba(255,255,255,.05) 0 56px, transparent 56px 112px); }
.login-in { padding: 24px 16px; }
.login h1 { font-size: 2rem; margin-bottom: 6px; }

.dates-wrap { margin-top: var(--s3); }
.dates-wrap > summary { color: var(--text-2); font-size: var(--t-s); }

.topbar .brand, .topbar .brand:visited { color: #fff; }
.cell .num { align-self: flex-start; }
.avail-box { margin-top: var(--s3); }
@media (max-width: 900px) {
  .cal-tools { width: 100%; gap: 4px; }
  .cal-tools .seg { flex: 1; } .cal-tools .seg button { flex: 1; }
  .cal-tools > .menu-wrap { display: none; }
}
.rq-meta .sep { display: none; }
/* labels on the pitch drawings sit on solid chips so they stay readable on the mown stripes */
.pitch { background-color: var(--pitch); }
.pitch .part > span:first-child, .pitch .whole > span:first-child, .pitch.single > .whole > span:first-child { background: #173d2a; color: #fff; border-radius: 4px; padding: 1px 6px; }
.pitch .tag, .pitch.single > .whole > .tag { background: #2f5d45; color: #fff; }
.pitch [aria-pressed="true"] > span:first-child { background: transparent; color: #17261d; }
.pitch [aria-pressed="true"] .tag { background: rgba(0, 0, 0, .14); color: #17261d; }
:root[data-theme="dark"] .ag-day h3 .today-tag { color: var(--ok); }
@media (max-width: 900px) { .cal-tools .seg button { padding: 5px 8px; } .cal-tools .seg { flex: 0 1 auto; } .cal-tools .btn.small { padding: 6px 9px; } }

.plan-grid { display: grid; gap: var(--s3); grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.plan-card { border: 1px solid var(--border); border-radius: var(--radius-s); padding: var(--s4); display: grid; gap: 4px; align-content: start; background: var(--surface); }
.plan-card .price { font: 700 1.6rem var(--display); margin: 0; }
.plan-card p { margin: 0; }
.plan-card .btn { justify-self: start; margin-top: 8px; }
.owner-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--s3); margin-bottom: var(--s4); }

/* ---------- pavilions, courts, gyms, rooms: a plain card in the picker, not a drawn pitch ---------- */
.pitch.venue { background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); }
.pitch.venue.indoor { background: var(--surface-2); }
.pitch.venue .whole, .pitch.venue .part { color: var(--text); background: transparent; }
.pitch.venue.single > .whole { min-height: 96px; border: 1px dashed var(--border); flex-direction: column; align-items: flex-start; gap: 6px; }
.pitch.venue.single > .whole::before, .pitch.venue.single > .whole::after, .pitch.venue .parts::after { display: none; }
.pitch.venue .parts { border: 1px dashed var(--border); }
.pitch.venue .parts > * + * { border-left: 1px dashed var(--border); }
.pitch.venue .whole > span, .pitch.venue .part > span:first-child, .pitch.venue.single > .whole > span:first-child, .pitch.venue.single > .whole > * { background: transparent; color: var(--text); padding: 0; }
.pitch.venue .whole > span:not(.tag) { font-weight: 650; }
.pitch.venue .tag, .pitch.venue.single > .whole > .tag { background: var(--surface-3); color: var(--text); padding: 1px 6px; }
.pitch.venue .ic { color: var(--primary); }
.pitch.venue button:hover { background: var(--primary-soft); }
.pitch.venue [aria-pressed="true"] { background: var(--accent) !important; color: var(--accent-ink); }
.pitch.venue [aria-pressed="true"] .ic, .pitch.venue [aria-pressed="true"] > * { color: var(--accent-ink) !important; }
.venue-thumb { height: 90px; border-radius: 6px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; }
.venue-thumb.indoor { background: var(--surface-3); color: var(--text-2); }
.field-chips .chip .ic { margin-right: 4px; vertical-align: -2px; }
