:root {
  --primary: #0f3d2e;
  --primary-deep: #08251b;
  --secondary: #2e7d5b;
  --accent: #d7ff3e;
  --accent-ink: #171e00;
  --canvas: #f3f6f2;
  --surface: #ffffff;
  --surface-alt: #eaf0e9;
  --ink: #1f2a24;
  --ink-strong: #181c1a;
  --muted: #55605a;
  --border: #d9e2dc;
  --card-border: #e6ede7;
  --success: #1e9e6a;
  --warning: #e8a317;
  --danger: #d3453a;
  --info: #2b7cd3;
  --radius: 12px;
  --radius-lg: 20px;
  --shadow: 0 14px 40px rgba(8, 37, 27, 0.08);
  --content: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: "Inter", "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--secondary); text-decoration: none; }
a:hover { color: var(--primary); }
img { max-width: 100%; display: block; }
h1, h2, h3, h4, .display {
  font-family: "Space Grotesk", "Avenir Next", "PingFang TC", "Noto Sans TC", sans-serif;
  color: var(--ink-strong);
  letter-spacing: -0.02em;
  margin: 0 0 .5rem;
  line-height: 1.15;
}
h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1rem; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.tiny { font-size: .72rem; }
.eyebrow {
  display: inline-flex; align-items: center; gap: .45rem;
  color: var(--secondary); font-size: .72rem; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase;
}
.shell { width: min(var(--content), calc(100% - 2rem)); margin-inline: auto; }
.section { padding: 3.5rem 0; }
.section-tight { padding: 2rem 0; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(247, 250, 246, .92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(16px);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 72px; }
.brand { display: inline-flex; align-items: center; gap: .65rem; color: var(--primary); font-weight: 800; letter-spacing: -.03em; font-size: 1.15rem; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--primary); display: grid; place-items: center; color: var(--accent); font-size: 1rem; }
.brand small { display: block; font: 500 .62rem/1 "Inter", sans-serif; letter-spacing: .08em; color: var(--muted); text-transform: uppercase; }
.main-nav { display: none; gap: 1.4rem; font-size: .85rem; font-weight: 600; }
.main-nav a { color: var(--muted); }
.main-nav a:hover, .main-nav a.active { color: var(--primary); }
.header-actions { display: flex; align-items: center; gap: .5rem; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--surface-alt); display: grid; place-items: center; color: var(--primary); font-weight: 800; }
.mobile-nav { display: flex; gap: .4rem; overflow-x: auto; padding: .5rem 0 0; border-top: 1px solid var(--border); }
.mobile-nav a { white-space: nowrap; font-size: .78rem; font-weight: 600; color: var(--muted); padding: .35rem .1rem; }
.mobile-nav a.active { color: var(--primary); border-bottom: 2px solid var(--accent); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  border: 1px solid transparent; border-radius: 999px; padding: .7rem 1.1rem;
  font: 700 .82rem/1 "Inter", sans-serif; cursor: pointer; white-space: nowrap;
  transition: transform .15s ease, background .15s ease, box-shadow .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-deep); color: #fff; }
.btn-accent { background: var(--accent); color: var(--accent-ink); }
.btn-accent:hover { background: #c8ef2f; color: var(--accent-ink); }
.btn-outline { border-color: var(--border); background: var(--surface); color: var(--primary); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: .45rem .75rem; font-size: .72rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }

/* Cards and layout */
.card { background: var(--surface); border: 1px solid var(--card-border); border-radius: var(--radius); box-shadow: 0 1px 0 rgba(8,37,27,.02); }
.card-pad { padding: 1.1rem; }
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stack { display: grid; gap: .75rem; }
.row { display: flex; align-items: center; gap: .6rem; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .25rem .55rem; border-radius: 999px; background: var(--surface-alt); color: var(--primary); font-size: .68rem; font-weight: 700; }
.badge-accent { background: var(--accent); color: var(--accent-ink); }
.badge-warn { background: #fff4d6; color: #7a5200; }
.badge-danger { background: #fde9e6; color: #8f2118; }
.badge-success { background: #e1f6ec; color: #0a6842; }
.divider { height: 1px; background: var(--border); margin: 1rem 0; border: 0; }

/* Hero */
.hero { background: linear-gradient(135deg, rgba(8,37,27,.92), rgba(15,61,46,.82) 62%, rgba(27,85,63,.78)), url('../stitch/images/court-1.jpg') center/cover; color: #fff; border-radius: 0 0 28px 28px; overflow: hidden; position: relative; }
.hero::after { content: ""; position: absolute; inset: auto -10% -40% 40%; height: 70%; background: radial-gradient(circle, rgba(215,255,62,.18), transparent 65%); pointer-events: none; }
.hero-inner { padding: 3.5rem 0 2.8rem; position: relative; z-index: 1; }
.hero h1 { color: #fff; max-width: 780px; }
.hero h1 em { color: var(--accent); font-style: normal; }
.hero p { color: #d8e6de; max-width: 620px; font-size: 1rem; }
.hero-kicker { color: var(--accent); }
.hero-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.3rem; }
.hero-meta { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.5rem; color: #cfe0d6; font-size: .78rem; }
.hero-meta span { border: 1px solid rgba(255,255,255,.18); border-radius: 999px; padding: .35rem .65rem; }
.hero-card { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); border-radius: var(--radius-lg); padding: 1.2rem; margin-top: 2rem; }
.hero-card .price { font: 700 2rem/1 "Space Grotesk", sans-serif; color: var(--accent); }
.stat { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); border-radius: var(--radius); padding: 1rem; }
.stat strong { display: block; font: 700 1.5rem/1.1 "Space Grotesk", sans-serif; color: var(--accent); }

/* Court cards */
.court-card { overflow: hidden; display: flex; flex-direction: column; }
.court-visual { height: 150px; background: linear-gradient(135deg, #1f6b50, #0d3a2a); position: relative; overflow: hidden; }
.court-visual img { width: 100%; height: 100%; object-fit: cover; display: block; }
.court-visual::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(8,37,27,.05), rgba(8,37,27,.55)); pointer-events: none; }
.court-code { position: absolute; top: .6rem; left: .7rem; z-index: 1; color: #fff; font: 700 .75rem/1 "Space Grotesk", sans-serif; background: rgba(8,37,27,.55); padding: .25rem .4rem; border-radius: 6px; }
.court-tag { position: absolute; bottom: .6rem; left: .7rem; z-index: 1; color: #fff; font-size: .7rem; font-weight: 600; }
.court-card .card-pad { display: flex; flex-direction: column; gap: .55rem; flex: 1; }
.price-line { font: 700 1rem/1.2 "Space Grotesk", sans-serif; color: var(--primary); }
.price-line small { font: 500 .7rem "Inter", sans-serif; color: var(--muted); }

/* Schedule */
.schedule-layout { display: grid; gap: 1rem; }
.date-strip { display: flex; gap: .5rem; overflow-x: auto; padding-bottom: .35rem; }
.date-chip { min-width: 64px; text-align: center; border: 1px solid var(--border); background: var(--surface); border-radius: 12px; padding: .55rem .35rem; color: var(--muted); }
.date-chip strong { display: block; font: 700 1.15rem/1 "Space Grotesk", sans-serif; color: var(--ink); }
.date-chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.date-chip.active strong { color: #fff; }
.court-tabs { display: flex; gap: .45rem; overflow-x: auto; padding-bottom: .25rem; }
.court-tab { border: 1px solid var(--border); background: var(--surface); border-radius: 999px; padding: .5rem .8rem; white-space: nowrap; font-size: .78rem; font-weight: 700; color: var(--muted); }
.court-tab.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.slot-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; }
.slot { text-align: left; border: 1px solid var(--card-border); background: var(--surface); border-radius: 12px; padding: .8rem; min-height: 96px; cursor: pointer; color: var(--ink); }
.slot:hover { border-color: var(--secondary); }
.slot .slot-time { font: 700 .92rem/1.2 "Space Grotesk", sans-serif; color: var(--ink-strong); }
.slot .slot-price { font: 700 1rem/1.2 "Space Grotesk", sans-serif; color: var(--primary); margin-top: .55rem; }
.slot.is-selected { background: var(--accent); border: 2px solid var(--primary); color: var(--accent-ink); }
.slot.is-selected .slot-price { color: var(--accent-ink); }
.slot.is-closed { background: #eef1ed; color: #8a948e; cursor: not-allowed; }
.slot.is-closed .slot-price { color: #8a948e; }
.slot .slot-tag { float: right; font-size: .62rem; font-weight: 700; color: var(--secondary); }
.summary { position: sticky; top: 90px; }
.summary-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .45rem 0; font-size: .82rem; }
.summary-row strong { font-weight: 700; }
.total { font: 700 1.5rem/1 "Space Grotesk", sans-serif; color: var(--primary); }
.policy-box { border: 1px solid #f0d391; background: #fffaf0; border-radius: 12px; padding: .8rem; color: #6b4b00; font-size: .75rem; }

/* Forms */
.form-card { width: min(480px, 100%); margin: 2rem auto; }
.field { margin-bottom: .85rem; }
.field label { display: block; font-size: .75rem; font-weight: 700; color: var(--muted); margin-bottom: .3rem; }
.input, input[type="text"], input[type="email"], input[type="password"], input[type="tel"], input[type="number"], textarea, select {
  width: 100%; border: 1px solid var(--border); background: var(--surface); color: var(--ink);
  border-radius: 10px; padding: .7rem .8rem; font: 400 .88rem/1.3 "Inter", sans-serif;
}
.input:focus, input:focus, textarea:focus, select:focus { outline: 2px solid var(--secondary); outline-offset: 1px; border-color: transparent; }
.errorlist { list-style: none; padding: 0; margin: .25rem 0; color: var(--danger); font-size: .75rem; }
.messages { display: grid; gap: .45rem; margin: 1rem 0; }
.message { border: 1px solid var(--border); background: var(--surface); border-left: 4px solid var(--secondary); border-radius: 8px; padding: .65rem .8rem; font-size: .8rem; }
.message.error { border-left-color: var(--danger); }
.message.success { border-left-color: var(--success); }
.message.warning { border-left-color: var(--warning); }
.help { color: var(--muted); font-size: .72rem; margin-top: .25rem; }

/* Auth split */
.auth-wrap { display: grid; gap: 2rem; align-items: center; padding: 2.5rem 0; }
.auth-aside { background: linear-gradient(145deg, rgba(8,37,27,.94), rgba(15,61,46,.78)), url('../stitch/images/facility-court.jpg') center/cover; color: #fff; border-radius: var(--radius-lg); padding: 1.5rem; display: none; }
.auth-aside h2 { color: #fff; }
.auth-aside p { color: #d8e6de; }
.auth-aside .badge { background: rgba(255,255,255,.12); color: var(--accent); }

/* Admin */
.admin-body { background: #eef2ee; }
.admin-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }
.admin-sidebar { background: var(--primary-deep); color: #fff; padding: 1rem; display: flex; flex-direction: column; gap: 1.2rem; }
.admin-sidebar .brand { color: #fff; }
.admin-sidebar .brand small { color: #9db8ab; }
.admin-sidebar .brand-mark { background: var(--accent); color: var(--primary-deep); }
.admin-nav { display: grid; gap: .2rem; }
.admin-nav a { color: #c6d8ce; font-size: .8rem; font-weight: 600; padding: .55rem .6rem; border-radius: 8px; }
.admin-nav a:hover, .admin-nav a.active { background: rgba(255,255,255,.09); color: #fff; }
.admin-main { padding: 1.2rem; min-width: 0; }
.admin-topbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.admin-title { font: 700 1.4rem/1.2 "Space Grotesk", sans-serif; }
.kpi-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; }
.kpi { background: var(--surface); border: 1px solid var(--card-border); border-radius: 12px; padding: 1rem; }
.kpi .label { color: var(--muted); font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.kpi .value { font: 700 1.6rem/1.1 "Space Grotesk", sans-serif; color: var(--primary); margin-top: .3rem; }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--card-border); border-radius: 12px; }
table.data { width: 100%; border-collapse: collapse; font-size: .78rem; }
table.data th, table.data td { text-align: left; padding: .7rem .8rem; border-bottom: 1px solid var(--border); vertical-align: top; }
table.data th { background: #f6f8f5; color: var(--muted); font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; }
table.data tr:last-child td { border-bottom: 0; }
.mono { font-family: "SFMono-Regular", Consolas, monospace; font-size: .72rem; }
.admin-public { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(circle at 20% 10%, #184d39, var(--primary-deep)); padding: 1rem; }
.admin-public .card { width: min(440px, 100%); }

/* Footer */
.site-footer { border-top: 1px solid var(--border); background: #eef3ed; padding: 2rem 0; margin-top: 2rem; color: var(--muted); font-size: .78rem; }
.footer-grid { display: grid; gap: 1rem; }
.footer-grid h4 { color: var(--primary); font-size: .8rem; margin-bottom: .5rem; }
.footer-grid a { display: block; color: var(--muted); margin-bottom: .25rem; }

/* Responsive */
@media (min-width: 760px) {
  .main-nav { display: flex; }
  .mobile-nav { display: none; }
  .hero-inner { padding: 5rem 0 4rem; }
  .hero-card { position: absolute; right: 0; bottom: 2.5rem; width: 300px; margin: 0; }
  .grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .schedule-layout { grid-template-columns: minmax(0, 1fr) 330px; align-items: start; }
  .slot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .auth-wrap { grid-template-columns: 1fr 420px; }
  .auth-aside { display: block; }
  .kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; }
}
@media (min-width: 1060px) {
  .slot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar { flex-direction: row; align-items: center; overflow-x: auto; }
  .admin-nav { display: flex; gap: .2rem; overflow-x: auto; }
  .admin-nav a { white-space: nowrap; }
}

.feature-icon { width: 42px; height: 42px; border-radius: 12px; background: var(--surface-alt); color: var(--primary); display: grid; place-items: center; margin-bottom: .4rem; }
.feature-icon .material-symbols-outlined { font-size: 22px; }

.page-media { width: 100%; height: 170px; border-radius: 12px; overflow: hidden; margin-bottom: 1rem; border: 1px solid var(--card-border); }
.page-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.admin-sidebar-photo { width: 100%; height: 110px; object-fit: cover; border-radius: 10px; margin-top: 1rem; opacity: .9; }
.uat-asset-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; }
.uat-asset { background: var(--surface); border: 1px solid var(--card-border); border-radius: 12px; overflow: hidden; }
.uat-asset img { width: 100%; height: 160px; object-fit: cover; display: block; }
.uat-asset div { padding: .55rem .7rem; font-size: .72rem; color: var(--muted); }
@media (min-width: 760px) { .uat-asset-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Login modal + schedule selection (UI-004) */
.slot.is-selected { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary) inset; background: var(--surface-alt); }
.btn.is-disabled { opacity: .45; cursor: not-allowed; }
.login-modal { width: min(440px, calc(100vw - 2rem)); border: 0; border-radius: 16px; padding: 0; box-shadow: var(--shadow); }
.login-modal::backdrop { background: rgba(8, 37, 27, .55); }
.login-modal-body { position: relative; padding: 1.4rem; }
.login-modal h2 { font-size: 1.35rem; margin: .25rem 0 .4rem; }
.modal-close { position: absolute; top: .5rem; right: .65rem; border: 0; background: transparent; color: var(--muted); font-size: 1.6rem; line-height: 1; cursor: pointer; padding: .2rem .4rem; }
.login-modal .message.error { margin: .6rem 0; }

/* ===== L1/L2 Stitch layout foundation ===== */
:root {
  --content: 1280px;
  --gutter: 32px;
  --primary-ink: #00261a;
  --primary: #00261a;
  --primary-container: #0f3d2e;
  --primary-deep: #08251b;
  --accent: #cbf230;
  --accent-hover: #b0d500;
  --canvas: #f1f4f0;
  --surface: #f7faf6;
  --surface-alt: #eaf0e9;
  --card-border: #e6ede7;
  --border: #e6ede7;
  --section: 96px;
  --shadow: 0 1px 8px rgba(15, 61, 46, .06);
  --radius: 12px;
  --radius-sm: 8px;
  --header-height: 80px;
  --tabbar-height: 64px;
}
html { font-size: 16px; }
body { font-size: 16px; line-height: 26px; background: var(--canvas); }
.shell { width: min(var(--content), calc(100% - (var(--gutter) * 2))); }
h1 { font-size: 48px; line-height: 56px; }
h2 { font-size: 28px; line-height: 36px; }
.small { font-size: 14px; line-height: 22px; }
.eyebrow { font-size: 12px; letter-spacing: .14em; }
.section { padding: var(--section) 0; }
.section-tight { padding: 56px 0; }
.btn { min-height: 44px; border-radius: 8px; padding: .75rem 1.1rem; font-size: 16px; font-weight: 600; }
.btn-sm { min-height: 38px; font-size: 14px; }
.btn-accent { background: var(--accent); color: var(--primary-deep); }
.btn-accent:hover { background: var(--accent-hover); color: var(--primary-deep); }
.card { border-radius: 12px; box-shadow: var(--shadow); }
.card-pad { padding: 24px; }
.input, input[type="text"], input[type="email"], input[type="password"], input[type="tel"], input[type="number"], textarea, select { border-radius: 8px; min-height: 44px; font-size: 16px; }

/* desktop header */
.site-header { position: fixed; inset: 0 0 auto; z-index: 60; height: var(--header-height); background: rgba(247, 250, 246, .94); backdrop-filter: blur(16px); border-bottom: 1px solid rgba(230, 237, 231, .9); box-shadow: 0 1px 8px rgba(15,61,46,.06); }
.header-inner { height: var(--header-height); display: flex; align-items: center; gap: 24px; }
.brand { gap: 12px; font-size: 20px; line-height: 1.1; }
.brand-mark { width: 40px; height: 40px; border-radius: 10px; background: var(--primary-container); color: var(--accent); }
.brand-mark .material-symbols-outlined { font-size: 22px; }
.brand small { margin-top: 3px; font-size: 10px; letter-spacing: .14em; color: var(--secondary); }
.main-nav { display: none; gap: 28px; margin-inline: auto; font-size: 15px; font-weight: 500; }
.main-nav a { color: #414944; padding: 8px 0; }
.main-nav a.active { color: var(--primary-ink); font-weight: 600; }
.header-actions { display: flex; align-items: center; gap: 14px; }
.login-link { color: #414944; font-size: 15px; font-weight: 500; padding: 8px; }
.book-now { min-height: 40px; padding: .55rem 1rem; color: var(--primary-deep); font-size: 14px; }
.book-now .material-symbols-outlined { font-size: 18px; }
.avatar { width: 36px; height: 36px; border: 1px solid var(--border); background: var(--surface); color: var(--primary); font-size: 14px; }
.avatar-guest .material-symbols-outlined { font-size: 18px; }
.account-menu { position: relative; }
.account-menu summary { list-style: none; cursor: pointer; }
.account-menu summary::-webkit-details-marker { display: none; }
.account-dropdown { position: absolute; right: 0; top: calc(100% + 10px); min-width: 190px; background: var(--surface); border: 1px solid var(--card-border); border-radius: 12px; box-shadow: 0 12px 32px rgba(8,37,27,.14); padding: 8px; display: grid; }
.account-dropdown a, .account-dropdown button { display: block; width: 100%; text-align: left; border: 0; background: transparent; color: var(--ink); font: 500 14px/1.4 "Inter", sans-serif; padding: 10px 12px; border-radius: 8px; cursor: pointer; }
.account-dropdown a:hover, .account-dropdown button:hover { background: var(--surface-alt); color: var(--primary); }
.account-dropdown form { margin: 0; border-top: 1px solid var(--border); padding-top: 6px; margin-top: 6px; }
.mobile-topbar, .mobile-bottom-tabs, .mobile-fab { display: none; }
main { padding-top: var(--header-height); min-height: calc(100vh - var(--header-height)); }

/* member mobile shell */
@media (max-width: 1279px) {
  :root { --gutter: 16px; --section: 56px; }
  .site-header { display: none; }
  .mobile-topbar { display: flex; align-items: center; justify-content: space-between; position: fixed; inset: 0 0 auto; z-index: 60; height: 64px; padding: 0 16px; background: rgba(247,250,246,.96); backdrop-filter: blur(16px); border-bottom: 1px solid var(--border); }
  .mobile-topbar .brand { font-size: 17px; }
  .mobile-topbar .brand-mark { width: 34px; height: 34px; }
  .mobile-topbar .brand small { font-size: 9px; }
  .mobile-top-actions { display: flex; align-items: center; gap: 10px; }
  .icon-button { width: 40px; height: 40px; display: grid; place-items: center; color: var(--muted); }
  .icon-button .material-symbols-outlined { font-size: 22px; }
  main { padding-top: 64px; padding-bottom: calc(var(--tabbar-height) + env(safe-area-inset-bottom) + 16px); }
  h1 { font-size: 36px; line-height: 44px; }
  h2 { font-size: 28px; line-height: 34px; }
  .mobile-bottom-tabs { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 70; height: calc(var(--tabbar-height) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: rgba(247,250,246,.98); border-top: 1px solid var(--border); backdrop-filter: blur(16px); }
  .mobile-bottom-tabs a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-width: 0; color: #65716a; font-size: 11px; font-weight: 500; }
  .mobile-bottom-tabs a .material-symbols-outlined { font-size: 22px; }
  .mobile-bottom-tabs a.active { color: var(--primary); font-weight: 700; }
  .mobile-bottom-tabs a.active::before { content: ""; position: absolute; margin-top: -48px; width: 22px; height: 3px; border-radius: 3px; background: var(--accent); }
  .mobile-fab { display: inline-flex; align-items: center; gap: 6px; position: fixed; left: 50%; bottom: calc(var(--tabbar-height) + env(safe-area-inset-bottom) + 14px); transform: translateX(-50%); z-index: 65; background: var(--accent); color: var(--primary-deep); border-radius: 999px; padding: 12px 20px; font-size: 14px; font-weight: 700; box-shadow: 0 10px 24px rgba(8,37,27,.2); white-space: nowrap; }
  .mobile-fab .material-symbols-outlined { font-size: 18px; }
  .mobile-fab.is-hidden { opacity: 0; pointer-events: none; transform: translate(-50%, 8px); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .site-footer { padding-bottom: calc(var(--tabbar-height) + env(safe-area-inset-bottom) + 20px); }
}
@media (min-width: 1280px) {
  .main-nav { display: flex; }
  .mobile-topbar, .mobile-bottom-tabs, .mobile-fab { display: none !important; }
  main { padding-bottom: 0; }
}

/* hero full bleed */
.hero { border-radius: 0; background: radial-gradient(circle at 82% 22%, rgba(203,242,48,.12), transparent 30%), linear-gradient(100deg, #08251b 0%, #08251b 58%, #0f3d2e 100%); }
.hero::before { content: ""; position: absolute; inset: 0; opacity: .15; background-image: linear-gradient(rgba(203,242,48,.35) 1px, transparent 1px), linear-gradient(90deg, rgba(203,242,48,.35) 1px, transparent 1px); background-size: 120px 120px; mask-image: linear-gradient(90deg, transparent, #000 35%, #000); pointer-events: none; }
.hero::after { display: none; }
.hero-inner { padding: 112px 0 80px; }
.hero h1 { font-size: 48px; line-height: 56px; max-width: 980px; }
.hero p { max-width: 820px; font-size: 16px; line-height: 26px; color: #a2d1bb; }

/* footer */
.site-footer { background: var(--surface); padding: 56px 0 24px; margin-top: var(--section); font-size: 14px; }
.footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; }
.footer-grid h4 { font-size: 14px; margin-bottom: 12px; }
.footer-grid a { margin-bottom: 8px; }
.footer-bottom { display: flex; justify-content: space-between; gap: 16px; border-top: 1px solid var(--border); margin-top: 32px; padding-top: 18px; font-size: 12px; color: var(--muted); }
@media (max-width: 767px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-bottom { flex-direction: column; } }

/* L1 legacy overrides */
.mobile-nav { display: none !important; }
@media (min-width: 760px) { .main-nav { display: none; } }
@media (min-width: 1280px) { .main-nav { display: flex; } }

/* ===== L3/L4 landing ===== */
.desktop-home { display: block; }
.mobile-home { display: none; }
.hero-stitch { min-height: 620px; display: flex; align-items: center; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(420px, .85fr); gap: 48px; align-items: center; padding: 112px 0 80px; }
.hero-copy h1 { color: #f7faf6; margin: 18px 0 18px; }
.hero-copy h1 em { color: var(--accent); font-style: normal; }
.hero-live { display: inline-flex; align-items: center; gap: 8px; border: 1px solid rgba(203,242,48,.25); background: rgba(15,61,46,.7); color: #d9efdf; border-radius: 999px; padding: 7px 12px; font-size: 12px; font-weight: 600; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgba(203,242,48,.15); }
.hero-trust { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 22px; color: #cfe5d7; font-size: 14px; }
.hero-trust span { display: inline-flex; align-items: center; gap: 6px; }
.hero-trust .material-symbols-outlined { color: var(--accent); font-size: 18px; }
.booking-widget { background: #fff; border-radius: 12px; padding: 24px; color: var(--ink); box-shadow: 0 16px 40px rgba(0,0,0,.18); }
.widget-head { display: flex; flex-direction: column; gap: 3px; margin-bottom: 18px; }
.widget-head strong { font: 700 22px/1.2 "Space Grotesk", sans-serif; color: var(--primary); }
.widget-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: end; }
.widget-grid .field { margin: 0; }
.widget-grid .btn { grid-column: 1 / -1; min-height: 48px; }
.widget-foot { display: flex; justify-content: space-between; gap: 12px; border-top: 1px solid var(--border); padding-top: 14px; margin-top: 16px; font-size: 12px; color: var(--muted); }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; margin-bottom: 40px; }
.section-head h2 { margin: 4px 0 0; }
.section-head > p { max-width: 420px; margin: 0; font-size: 15px; }
.feature-band { background: var(--surface); }
.feature-grid { gap: 20px; }
.feature-card { background: #fff; border: 1px solid var(--card-border); border-radius: 12px; padding: 24px; display: flex; flex-direction: column; min-height: 260px; box-shadow: var(--shadow); }
.feature-no { font-size: 11px; letter-spacing: .12em; color: var(--muted); font-weight: 700; }
.feature-card .feature-icon { margin: 18px 0; background: var(--surface-alt); color: var(--primary); }
.feature-card h3 { font-size: 20px; line-height: 28px; }
.feature-card p { color: var(--muted); font-size: 14px; line-height: 22px; }
.feature-meta { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--border); color: var(--secondary); font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.feature-meta .material-symbols-outlined { font-size: 16px; }
.why-band { background: #e8efe9; border-block: 1px solid var(--border); }
.why-card { background: #fff; border: 1px solid var(--card-border); border-radius: 12px; padding: 22px; }
.why-card > .material-symbols-outlined { color: var(--primary); font-size: 28px; margin-bottom: 14px; }
.why-card h3 { font-size: 18px; line-height: 24px; }
.why-card p { color: var(--muted); font-size: 14px; line-height: 22px; margin: 0; }
.court-legend { display: flex; gap: 16px; font-size: 12px; color: var(--muted); }
.court-legend span { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot.available, .dot.available.status { background: var(--success); }
.dot.booked { background: #8d9891; }
.dot.maintenance { background: var(--warning); }
.court-mosaic { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 24px; }
.mosaic-card { background: #fff; border: 1px solid var(--card-border); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; }
.mosaic-feature { grid-column: span 6; }
.mosaic-small { grid-column: span 3; }
.mosaic-medium { grid-column: span 4; }
.mosaic-card .court-visual { height: 180px; }
.mosaic-feature .court-visual { height: 240px; }
.mosaic-small .court-visual { height: 130px; }
.mosaic-body { padding: 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.mosaic-body h3 { font-size: 20px; line-height: 26px; margin: 0; }
.status-label { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.mosaic-lines { display: flex; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: 12px; }
.mosaic-lines span { background: var(--surface-alt); border-radius: 999px; padding: 4px 8px; }
.membership-band { background: var(--surface); border-block: 1px solid var(--border); }
.membership-card { background: #fff; border: 1px solid var(--card-border); border-radius: 12px; padding: 26px; }
.membership-card.featured { border: 2px solid var(--accent); background: var(--primary); color: #fff; }
.membership-card.featured h3, .membership-card.featured p { color: #fff; }
.membership-card > .material-symbols-outlined { color: var(--secondary); font-size: 28px; margin: 18px 0 8px; }
.membership-card.featured > .material-symbols-outlined { color: var(--accent); }
.membership-card h3 { font-size: 20px; }
.membership-card p { color: var(--muted); font-size: 14px; margin: 0; }
.membership-card.featured p { color: #cfe5d7; }
.proof-band { background: var(--primary-deep); color: #fff; padding: 40px 0; }
.proof-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.proof-grid div { display: flex; flex-direction: column; gap: 4px; }
.proof-grid strong { font: 700 32px/1 "Space Grotesk", sans-serif; color: var(--accent); }
.proof-grid span { color: #cfe5d7; font-size: 13px; }
.cta-band { background: var(--primary); color: #fff; border-radius: 12px; padding: 36px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.cta-band h2 { color: #fff; }
.cta-band p { color: #cfe5d7; margin: 0; }
.cta-band .eyebrow { color: var(--accent); }

.mobile-hero { margin: 16px; border-radius: 24px; overflow: hidden; background: var(--primary-deep); color: #fff; }
.mobile-hero-media { position: relative; height: 190px; }
.mobile-hero-media img { width: 100%; height: 100%; object-fit: cover; opacity: .72; }
.mobile-hero-media .hero-live { position: absolute; left: 16px; top: 16px; }
.mobile-hero-body { padding: 20px; }
.mobile-hero-body h1 { font-size: 36px; line-height: 44px; color: #fff; margin: 0 0 10px; }
.mobile-hero-body h1 em { color: var(--accent); font-style: normal; }
.mobile-hero-body p { color: #cfe5d7; font-size: 14px; margin: 0; }
.mobile-quick { margin: 16px; }
.mobile-date-row { display: flex; gap: 8px; margin: 14px 0; }
.mobile-date-row .date-chip { flex: 1; text-decoration: none; }
.mobile-court-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 10px; }
.mobile-slot-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 1px solid var(--border); border-radius: 8px; padding: 11px 12px; margin-bottom: 8px; color: var(--ink); }
.mobile-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 16px; }
.mobile-action { background: #fff; border: 1px solid var(--card-border); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 4px; color: var(--ink); }
.mobile-action .material-symbols-outlined { color: var(--primary); font-size: 24px; }
.mobile-action strong { font-size: 14px; }
.mobile-action small { color: var(--muted); font-size: 11px; }
.mobile-gallery { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.mobile-gallery-card { background: #fff; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; color: var(--ink); }
.mobile-gallery-card img { width: 100%; height: 110px; object-fit: cover; }
.mobile-gallery-card span, .mobile-gallery-card strong { display: block; padding: 0 10px; }
.mobile-gallery-card span { color: var(--muted); font-size: 11px; margin-top: 8px; }
.mobile-gallery-card strong { font-size: 13px; padding-bottom: 10px; }
@media (max-width: 1279px) {
  .desktop-home { display: none; }
  .mobile-home { display: block; }
}

/* ===== L5 schedule matrix ===== */
.schedule-page { padding-top: 40px; }
.page-head { margin-bottom: 24px; }
.page-head h1 { margin: 4px 0 6px; }
.date-nav { display: flex; align-items: center; gap: 8px; }
.icon-button { width: 40px; height: 40px; display: inline-grid; place-items: center; border: 1px solid var(--border); border-radius: 8px; color: var(--primary); background: var(--surface); }
.schedule-controls { margin-bottom: 24px; }
.week-presets { display: flex; gap: 14px; font-size: 13px; }
.week-presets a { color: var(--secondary); font-weight: 600; }
.date-strip { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 8px; }
.date-chip { position: relative; min-width: 70px; border-radius: 8px; padding: 8px 6px; text-decoration: none; }
.date-chip .avail-dot { display: block; width: 5px; height: 5px; border-radius: 50%; background: var(--success); margin: 5px auto 0; }
.date-chip.active .avail-dot { background: var(--accent); }
.date-chip .avail-dot.off { background: #b9c4bd; }
.filter-row { margin-top: 16px; align-items: flex-start; gap: 20px; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.dot.selected { background: var(--accent); border: 1px solid var(--primary); }
.schedule-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.matrix-card { min-width: 0; overflow: hidden; }
.matrix-scroll { overflow-x: auto; }
.matrix { min-width: 760px; }
.matrix-row { display: grid; grid-template-columns: 96px repeat(5, minmax(0, 1fr)); border-bottom: 1px solid var(--border); }
.matrix-row:last-child { border-bottom: 0; }
.matrix-head { background: #f7faf6; }
.matrix-time { padding: 14px 12px; font-size: 12px; color: var(--muted); display: flex; align-items: center; border-right: 1px solid var(--border); }
.matrix-court { padding: 10px 8px; text-align: center; border-right: 1px solid var(--border); display: flex; flex-direction: column; gap: 2px; }
.matrix-court strong { font-size: 14px; color: var(--primary); }
.matrix-court small { font-size: 10px; color: var(--muted); }
.matrix-cell { min-height: 66px; padding: 8px; border-right: 1px solid var(--border); display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 3px; color: var(--ink); text-decoration: none; }
.matrix-cell:last-child { border-right: 0; }
.matrix-cell.available:hover { background: #f0f7ef; }
.matrix-cell .cell-state { font-size: 10px; color: var(--secondary); }
.matrix-cell strong { font: 700 13px/1.2 "Space Grotesk", sans-serif; color: var(--primary); }
.matrix-cell.selected { background: var(--accent); box-shadow: inset 0 0 0 2px var(--primary); }
.matrix-cell.selected .cell-state, .matrix-cell.selected strong { color: var(--primary-deep); }
.matrix-cell.booked { background: #eef1ed; color: #7f8a83; }
.matrix-cell.booked .cell-state { color: #7f8a83; display: inline-flex; align-items: center; gap: 3px; }
.matrix-cell.blocked { background: repeating-linear-gradient(135deg, #f6f1e3, #f6f1e3 5px, #eee6d1 5px, #eee6d1 10px); color: #8a6d22; }
.matrix-cell.blocked .cell-state { color: #8a6d22; display: inline-flex; align-items: center; gap: 3px; }
.matrix-cell.missing { color: var(--muted); background: #fafafa; }
.matrix-cell small { font-size: 10px; color: var(--muted); }
.summary { position: sticky; top: 104px; }
.qr-note { display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--border); margin-top: 16px; padding-top: 14px; color: var(--muted); font-size: 12px; line-height: 18px; }
.qr-note .material-symbols-outlined { color: var(--primary); font-size: 24px; }
.mobile-schedule { display: none; }
@media (max-width: 1100px) {
  .schedule-layout { grid-template-columns: 1fr; }
  .summary { position: static; }
  .matrix-card { display: none; }
  .mobile-schedule { display: grid; gap: 14px; margin-top: 16px; }
  .mobile-court-card { padding: 18px; }
  .mobile-court-card h2 { font-size: 20px; }
  .mobile-slot-list { margin-top: 10px; }
  .mobile-slot-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); color: var(--ink); font-size: 14px; }
  .mobile-slot-line:last-child { border-bottom: 0; }
  .mobile-slot-line.closed { color: var(--muted); }
  .mobile-slot-line .material-symbols-outlined { font-size: 18px; color: var(--muted); }
}

/* ===== CMS shell (L2) ===== */
.admin-body { background: var(--canvas); }
.admin-layout { display: grid; grid-template-columns: 288px minmax(0, 1fr); min-height: 100vh; }
.admin-sidebar { position: fixed; inset: 0 auto 0 0; width: 288px; overflow-y: auto; padding: 20px 16px; background: var(--primary-deep); display: flex; flex-direction: column; z-index: 80; }
.admin-sidebar-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.admin-sidebar .brand { color: #fff; font-size: 18px; }
.admin-sidebar .brand small { color: #9db8ab; }
.admin-sidebar .brand-mark { width: 36px; height: 36px; background: var(--accent); color: var(--primary-deep); }
.admin-nav { display: grid; gap: 2px; }
.admin-nav-group { color: #7fa18f; font-size: 10px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; margin: 14px 10px 5px; }
.admin-nav a { display: flex; align-items: center; gap: 9px; color: #c6d8ce; font-size: 13px; font-weight: 500; padding: 9px 10px; border-radius: 8px; }
.admin-nav a .material-symbols-outlined { font-size: 18px; }
.admin-nav a:hover, .admin-nav a.active { background: #123f2f; color: var(--accent); }
.admin-sidebar-foot { margin-top: auto; border-top: 1px solid rgba(255,255,255,.12); padding-top: 12px; }
.admin-sidebar-foot form { margin: 8px 0 0; }
.admin-sidebar-photo { width: 100%; height: 88px; object-fit: cover; border-radius: 8px; margin-bottom: 10px; opacity: .85; }
.admin-shell { grid-column: 2; min-width: 0; }
.admin-shell-topbar { position: sticky; top: 0; z-index: 50; height: 64px; display: flex; align-items: center; gap: 16px; padding: 0 24px; background: rgba(247,250,246,.96); border-bottom: 1px solid var(--border); backdrop-filter: blur(16px); }
.admin-shell-title { display: flex; flex-direction: column; min-width: 180px; }
.admin-shell-title strong { font: 700 18px/1.2 "Space Grotesk", sans-serif; color: var(--primary); }
.admin-search { display: flex; align-items: center; gap: 6px; min-width: 220px; max-width: 360px; flex: 1; border: 1px solid var(--border); border-radius: 8px; padding: 0 10px; background: #fff; }
.admin-search .material-symbols-outlined { font-size: 18px; color: var(--muted); }
.admin-search input { border: 0; min-height: 36px; padding: 0; background: transparent; box-shadow: none; font-size: 13px; }
.admin-search input:focus { outline: none; }
.admin-shell-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.admin-shell-actions .btn { min-height: 34px; font-size: 12px; }
.admin-menu-button { display: none; width: 40px; height: 40px; align-items: center; justify-content: center; color: var(--primary); cursor: pointer; }
.admin-drawer-toggle { display: none; }
.admin-drawer-close { display: none; color: #fff; font-size: 24px; cursor: pointer; }
.admin-main { padding: 24px; max-width: 1600px; }
@media (max-width: 1023px) {
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar { transform: translateX(-100%); transition: transform .2s ease; box-shadow: 12px 0 32px rgba(0,0,0,.2); }
  .admin-drawer-toggle:checked ~ .admin-layout .admin-sidebar { transform: translateX(0); }
  .admin-drawer-toggle:checked ~ .admin-layout .admin-drawer-close { display: block; }
  .admin-drawer-toggle:checked ~ .admin-layout::after { content: ""; position: fixed; inset: 0; background: rgba(8,37,27,.45); z-index: 70; }
  .admin-shell { grid-column: 1; }
  .admin-menu-button { display: flex; }
  .admin-search { display: none; }
}
@media (max-width: 1023px) {
  .admin-sidebar { flex-direction: column; overflow-y: auto; }
  .admin-nav { display: grid; overflow: visible; }
  .admin-nav a { white-space: normal; }
}
@media (max-width: 600px) {
  .admin-shell-topbar { padding: 0 12px; gap: 8px; }
  .admin-shell-title { min-width: 0; flex: 1; }
  .admin-shell-title .eyebrow { display: none; }
  .admin-shell-actions { gap: 4px; }
  .admin-shell-actions .btn { display: none; }
  .admin-main { padding: 16px; }
  .admin-main .grid-2, .admin-main .grid-3 { grid-template-columns: 1fr; }
  .admin-topbar { flex-wrap: wrap; }
  .admin-topbar .row { flex-wrap: wrap; }
  .kpi .value { font-size: 1.35rem; overflow-wrap: anywhere; }
}
.admin-shell-topbar { position: fixed; left: 288px; right: 0; top: 0; }
.admin-shell { padding-top: 64px; }
@media (max-width: 1023px) { .admin-shell-topbar { left: 0; } }
@media (max-width: 1100px) {
  .schedule-page .shell { display: flex; flex-direction: column; }
  .schedule-page .page-head { order: 0; }
  .schedule-page .schedule-controls { order: 1; }
  .schedule-page .mobile-schedule { order: 2; }
  .schedule-page .schedule-layout { order: 3; }
  .schedule-page .summary { border-radius: 16px 16px 0 0; }
}
@media (max-width: 900px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .kpi .value { font-size: 1.1rem; white-space: nowrap; }
}
.mobile-price-note { font-size: 13px; font-weight: 700; color: var(--primary); margin: 4px 0 8px; }
