:root {
  color-scheme: light;
  --bg: #f3f7f6;
  --panel: #ffffff;
  --ink: #101514;
  --muted: #727b79;
  --line: #dde5e3;
  --brand: #14bf63;
  --brand-dark: #087d3d;
  --brand-deep: #075c32;
  --brand-soft: #e9f8ef;
  --danger: #e60012;
  --danger-dark: #9f000d;
  --danger-soft: #ffe8e8;
  --warn: #f3aa22;
  --hero: #0f8f47;
  --shadow: 0 12px 32px rgba(21, 40, 34, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100%;
  margin: 0;
  padding-bottom: 76px;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

svg {
  display: block;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

button:disabled {
  cursor: not-allowed;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: clamp(20px, 5vw, 30px);
  line-height: 1.05;
}

h2 {
  font-size: clamp(18px, 4vw, 24px);
}

h3 {
  font-size: 17px;
}

.muted,
.hint {
  color: var(--muted);
}

.app-shell,
.shell {
  width: min(100%, 1040px);
  margin: 0 auto;
  padding: 14px;
}

.admin-shell {
  width: min(100%, 1100px);
}

.app-header,
.topbar,
.section-head,
.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 8;
  margin: -14px -14px 0;
  padding: 16px 18px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.topbar {
  margin-bottom: 12px;
}

.club-title,
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.club-title p,
.brand p,
.page-head p {
  color: var(--muted);
}

.brand-mark,
.logo {
  display: grid;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font-size: 18px;
  font-weight: 950;
}

.profile-pill,
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  border: 0;
  border-radius: 999px;
  background: #eef5f0;
  color: #506057;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.app-utility-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  width: 100%;
  margin-top: 2px;
  font-size: 11px;
  font-weight: 800;
}

.app-utility-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid #cfe4d8;
  border-radius: 999px;
  background: #f3fbf6;
  color: var(--brand-dark);
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.app-utility-nav a:hover,
.app-utility-nav a:focus-visible {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand-deep);
  text-decoration: none;
}

.app-utility-nav a:active {
  transform: scale(0.98);
}

.language-toggle {
  min-width: 42px;
  min-height: 32px;
  border: 1px solid #cfe4d8;
  border-radius: 999px;
  background: #fff;
  color: var(--brand-dark);
  padding: 0 10px;
  font-size: 12px;
  font-weight: 950;
  cursor: pointer;
}

.profile-loading {
  max-width: min(42vw, 180px);
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 375px) {
  .app-shell {
    padding: 10px;
  }

  .app-header {
    padding-inline: 10px;
  }

  .booking-table th,
  .booking-table td {
    min-width: 48px;
    padding: 2px;
  }

  .booking-table .time-col {
    min-width: 42px;
  }

  .booking-table .matrix-cell {
    min-height: 28px;
    font-size: 9px;
    border-radius: 4px;
    padding: 0 2px;
  }

  .time-range-label {
    min-width: 38px;
    font-size: 8px;
  }

  .court-table .time-col {
    min-width: 42px;
  }

  .court-table th,
  .court-table td {
    min-width: 48px;
    padding: 2px;
  }

  .date-button {
    flex: 1 1 48px;
    padding: 5px 4px;
    min-height: 38px;
  }

  .date-button strong {
    font-size: 13px;
  }

  .date-button span {
    font-size: 9px;
  }

  .step-dot {
    min-height: 36px;
    font-size: 13px;
  }

  .selection-status {
    font-size: 12px;
    padding: 10px;
  }

  .selected-date-card {
    font-size: 12px;
    padding: 10px;
  }

  .wizard-actions .primary,
  .wizard-actions .secondary {
    min-height: 44px;
    font-size: 14px;
  }
}

@media (max-width: 430px) {
  .app-header {
    padding-inline: 14px;
  }

  .club-title {
    gap: 8px;
  }

  .brand-mark {
    flex-basis: 38px;
    width: 38px;
    height: 38px;
  }

  .club-title h1 {
    font-size: 19px;
  }

  .club-title p {
    font-size: 12px;
  }

  .profile-pill {
    padding-inline: 9px;
    font-size: 11px;
  }

  .booking-table th,
  .booking-table td {
    min-width: 64px;
    padding: 3px;
  }

  .booking-table .time-col {
    min-width: 56px;
  }

  .booking-table .matrix-cell {
    min-height: 34px;
    font-size: 11px;
  }

  .time-range-label {
    min-width: 52px;
    font-size: 10px;
  }
}

.app-view {
  display: none;
}

.app-view.active {
  display: block;
  animation: viewIn 260ms cubic-bezier(0.22, 1, 0.36, 1);
}

.booking-step {
  display: none;
}

.booking-step.active {
  display: block;
  animation: stepIn 280ms cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes viewIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes stepIn {
  from {
    opacity: 0;
    transform: translateX(10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.stepper {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 14px;
}

.step-dot {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-weight: 950;
  transition: color 180ms ease, background-color 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.step-dot.active {
  color: #fff;
  background: var(--brand-deep);
  border-color: var(--brand-deep);
}

.step-dot.done {
  color: var(--brand-dark);
  background: var(--brand-soft);
  border-color: #a5dfb8;
}

.home-dashboard {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.home-status {
  min-height: 156px;
  border-radius: 22px;
  padding: 20px;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(7, 92, 50, 0.96) 0%, rgba(20, 191, 99, 0.88) 48%, rgba(142, 214, 255, 0.92) 100%),
    repeating-linear-gradient(45deg, rgba(255,255,255,0.12) 0 1px, transparent 1px 16px);
  box-shadow: var(--shadow);
}

.home-status span,
.home-status strong,
.home-status small {
  display: block;
}

.home-status span {
  font-size: 14px;
  font-weight: 950;
  opacity: 0.82;
}

.home-status strong {
  margin-top: 14px;
  font-size: clamp(34px, 9vw, 62px);
  line-height: 1;
}

.home-status small {
  margin-top: 10px;
  font-size: 15px;
  font-weight: 900;
}

.quick-book {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 52px;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(135deg, #075c32, #08a754 62%, #79d9ff);
  color: #fff;
  padding: 14px 16px;
  text-align: left;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.quick-book-icon {
  display: grid;
  grid-column: 2;
  width: 52px;
  height: 52px;
  place-items: center;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--brand-deep);
  box-shadow: 0 8px 18px rgba(7, 92, 50, 0.18);
}

.quick-book-icon svg {
  width: 30px;
  height: 30px;
}

.quick-book-copy,
.quick-book-copy span,
.quick-book-copy strong {
  grid-column: 1;
  display: block;
  min-width: 0;
}

.quick-book-copy span {
  font-size: 20px;
  font-weight: 950;
}

.quick-book-copy strong {
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
}

.quick-links {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.quick-links button {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 76px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  padding: 12px;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(21, 40, 34, 0.05);
}

.quick-links button:nth-child(1) {
  border-color: #cfeeff;
  background: linear-gradient(135deg, #ffffff 0%, #f1fbff 100%);
}

.quick-links button:nth-child(2) {
  border-color: #d7eadf;
  background: linear-gradient(135deg, #ffffff 0%, #f3fbf6 100%);
}

.quick-links button:nth-child(3) {
  border-color: #d7eadf;
  background: linear-gradient(135deg, #ffffff 0%, #f5fff9 100%);
}

.quick-link-copy {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
}

.quick-links strong,
.quick-links span {
  display: block;
  min-width: 0;
}

.quick-links strong {
  font-size: 17px;
  line-height: 1.15;
}

.quick-links span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.quick-link-icon {
  grid-column: 1;
  grid-row: 1;
  align-self: center;
  width: 44px;
  height: 44px;
  padding: 10px;
  border-radius: 14px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  box-shadow: inset 0 0 0 1px rgba(7, 92, 50, 0.08);
}

.quick-link-icon.icon-blue {
  background: #e9f7ff;
  color: #1478a8;
}

.quick-link-icon.icon-green {
  background: #e6f7ee;
  color: var(--brand-deep);
}

.quick-link-icon.icon-mint {
  background: #e9fbf2;
  color: #0b8d49;
}

.promo-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid #cfe8d8;
  border-radius: 16px;
  background: var(--brand-soft);
}

.promo-strip > div {
  min-width: 0;
  flex: 1 1 auto;
}

.promo-icon {
  flex: 0 0 auto;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 14px;
  background: #fff;
  color: var(--brand-dark);
  box-shadow: inset 0 0 0 1px rgba(7, 92, 50, 0.1);
}

.promo-icon svg {
  width: 25px;
  height: 25px;
}

.promo-strip strong,
.promo-strip span {
  display: block;
}

.promo-strip .promo-icon {
  display: grid;
}

.promo-strip strong {
  font-size: 18px;
}

.promo-strip span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.promo-strip button {
  flex: 0 0 auto;
  min-height: 40px;
  border: 0;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  padding: 0 14px;
  font-weight: 950;
  cursor: pointer;
}

.home-hero {
  position: relative;
  min-height: 214px;
  margin: 0 -14px;
  padding: 26px 22px;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(circle at 88% 18%, rgba(255, 255, 255, 0.22), transparent 26%),
    linear-gradient(135deg, #0b5f36 0%, #13a457 54%, #58d882 100%);
}

.home-hero::after {
  content: "";
  position: absolute;
  inset: auto -60px -140px -60px;
  height: 220px;
  border-radius: 50% 50% 0 0;
  background: var(--bg);
}

.hero-kicker {
  position: relative;
  z-index: 1;
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: 999px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.16);
  font-size: 13px;
  letter-spacing: 0.04em;
  font-weight: 950;
}

.hero-copy {
  position: relative;
  z-index: 1;
  max-width: 560px;
  margin-top: 34px;
}

.hero-copy h2 {
  font-size: clamp(34px, 8vw, 58px);
  letter-spacing: 0;
}

.hero-copy p {
  margin-top: 6px;
  font-size: 16px;
  font-weight: 800;
}

.home-panel {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: -46px;
  padding: 14px;
  border-radius: 24px 24px 8px 8px;
  background: #edf5f4;
}

.menu-card {
  position: relative;
  display: grid;
  min-height: 118px;
  overflow: hidden;
  border: 1px solid #d7e0de;
  border-radius: 16px;
  background: #fff;
  padding: 16px 14px;
  text-align: left;
  box-shadow: 0 5px 12px rgba(21, 40, 34, 0.04);
  cursor: pointer;
}

.menu-card strong {
  display: block;
  font-size: clamp(18px, 4vw, 24px);
  line-height: 1.05;
}

.menu-card small {
  display: block;
  margin-top: 6px;
  color: #7a7f7f;
  font-size: clamp(13px, 3vw, 17px);
  font-weight: 800;
}

.menu-card b {
  position: absolute;
  left: 14px;
  bottom: 14px;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 999px;
  background: var(--brand-deep);
  color: #fff;
  font-size: 26px;
  line-height: 1;
}

.card-art {
  position: absolute;
  right: 12px;
  bottom: 12px;
  opacity: 0.2;
}

.whistle {
  width: 62px;
  height: 44px;
  border: 12px solid var(--brand);
  border-radius: 999px;
  transform: rotate(-34deg);
}

.whistle::before {
  content: "";
  position: absolute;
  right: -22px;
  top: -15px;
  width: 36px;
  height: 21px;
  background: var(--brand);
}

.coupon-art {
  display: grid;
  width: 74px;
  height: 46px;
  place-items: center;
  border: 6px solid var(--brand);
  color: var(--brand-deep);
  background: #fff;
  font-size: 32px;
  font-weight: 950;
}

.clock-art {
  width: 66px;
  height: 66px;
  border: 7px solid #15191a;
  border-radius: 999px;
}

.clock-art::before {
  content: "";
  position: absolute;
  left: 28px;
  top: 14px;
  width: 6px;
  height: 28px;
  border-radius: 999px;
  background: #f01824;
}

.clock-art::after {
  content: "";
  position: absolute;
  left: 31px;
  top: 36px;
  width: 24px;
  height: 6px;
  border-radius: 999px;
  background: #f01824;
  transform: rotate(48deg);
  transform-origin: left center;
}

.calendar-art {
  width: 68px;
  height: 60px;
  border-radius: 14px;
  background: #fff;
  border-top: 16px solid var(--brand);
  box-shadow: inset 0 -5px 0 #eceef1;
}

.calendar-art::before,
.calendar-art::after {
  content: "";
  position: absolute;
  left: 14px;
  top: 26px;
  width: 40px;
  height: 4px;
  background: #15191a;
  box-shadow: 0 15px 0 #a8adb5;
}

.promo-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: min(100% - 36px, 780px);
  margin: 26px auto 22px;
  padding: 18px;
  border-radius: 20px;
  background:
    linear-gradient(90deg, rgba(255,255,255,0.9), rgba(255,255,255,0.62)),
    linear-gradient(135deg, #d6f5ff, #e8fff0);
  box-shadow: var(--shadow);
}

.promo-banner strong,
.promo-banner span {
  display: block;
}

.promo-banner strong {
  font-size: 19px;
}

.promo-banner span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.promo-banner button {
  display: grid;
  flex: 0 0 46px;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: #f01824;
  font-size: 34px;
  box-shadow: 0 6px 16px rgba(21, 40, 34, 0.12);
}

.hero-cta {
  display: block;
  width: min(100% - 36px, 880px);
  min-height: 58px;
  margin: 0 auto 30px;
  border: 0;
  border-radius: 14px;
  background: var(--brand-deep);
  color: #fff;
  font-size: clamp(18px, 4vw, 24px);
  font-weight: 950;
  cursor: pointer;
}

.page-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 14px;
}

.back-button {
  display: grid;
  flex: 0 0 46px;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: var(--brand-deep);
  font-size: 32px;
  font-weight: 950;
  box-shadow: var(--shadow);
  cursor: pointer;
}

.card,
.booking-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.card {
  padding: 16px;
  margin-bottom: 14px;
}

.hint,
.legend {
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.date-row,
.facility-row,
.actions,
.admin-login,
.inline-fields {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.date-row {
  margin-top: 12px;
}

.selected-date-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 12px;
  margin-bottom: 10px;
  border: 1px solid #a5dfb8;
  border-radius: 14px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-weight: 950;
}

.selected-date-card span {
  color: var(--muted);
  font-size: 12px;
}

.selected-date-card strong {
  flex: 1;
}

.selected-date-card em {
  padding: 5px 9px;
  border-radius: 999px;
  background: #fff;
  font-size: 12px;
  font-style: normal;
}

.date-control {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 48px;
  gap: 8px;
  align-items: end;
  margin-top: 12px;
  min-width: 0;
}

.date-control > * {
  min-width: 0;
}

.icon-button {
  display: grid;
  width: 44px;
  height: 48px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font-size: 28px;
  font-weight: 950;
  cursor: pointer;
}

.icon-button:disabled {
  opacity: 0.35;
}

.date-picker-label {
  position: relative;
  display: grid;
  min-width: 0;
  gap: 6px;
  margin: 0;
}

.date-picker-label input {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  cursor: pointer;
  opacity: 0;
}

.date-picker-display {
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 48px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  padding: 10px 42px 10px 12px;
  font-size: clamp(14px, 2.1vw, 16px);
  font-weight: 950;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.date-picker-display::after {
  position: absolute;
  right: 13px;
  bottom: 14px;
  width: 16px;
  height: 16px;
  border: 2px solid var(--brand-dark);
  border-radius: 4px;
  content: "";
}

.date-picker-display::before {
  position: absolute;
  right: 13px;
  bottom: 20px;
  z-index: 0;
  width: 16px;
  border-top: 2px solid var(--brand-dark);
  content: "";
}

@media (max-width: 380px) {
  .date-control {
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    gap: 6px;
  }

  .date-picker-display {
    padding-right: 34px;
    font-size: 13px;
  }

  .date-picker-display::after,
  .date-picker-display::before {
    right: 10px;
  }

  .date-row {
    gap: 4px;
  }

  .date-button {
    flex: 1 1 60px;
    padding: 7px 6px;
    min-height: 42px;
  }

  .date-button strong {
    font-size: 15px;
  }

  .date-button span {
    font-size: 10px;
  }

  .booking-table th,
  .booking-table td {
    min-width: 58px;
    padding: 3px;
  }

  .booking-table .time-col {
    min-width: 52px;
  }

  .booking-table .matrix-cell {
    min-height: 32px;
    font-size: 10px;
    border-radius: 6px;
  }

  .time-range-label {
    min-width: 48px;
    font-size: 10px;
  }

  .court-table .time-col {
    min-width: 52px;
  }
}

.date-button,
.facility-button,
.time-button,
.primary,
.secondary,
.danger {
  min-height: 48px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 950;
}

.date-button,
.facility-button,
.secondary {
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
}

.date-button.active,
.facility-button.active {
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
}

.date-button.today:not(.active) {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand-dark);
  box-shadow: 0 0 0 2px rgba(20, 191, 99, 0.2);
  position: relative;
}

.date-button.today:not(.active)::after {
  content: "";
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--brand);
}

.date-button:disabled {
  opacity: 0.42;
}

.date-button {
  flex: 1 1 92px;
  padding: 9px 10px;
}

.date-button span,
.facility-button span {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  font-weight: 800;
}

.facility-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 12px;
}

.facility-button {
  min-width: 0;
  padding: 12px 8px;
  line-height: 1.15;
  box-shadow: 0 4px 12px rgba(21, 40, 34, 0.04);
}

.time-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.time-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid;
  padding: 12px;
  text-align: left;
}

.time-button.available,
.matrix-cell.available {
  color: #095f2b;
  background: #eefaf1;
  border-color: #8ee0a6;
}

.time-button.unavailable,
.matrix-cell.unavailable {
  color: #fff;
  background: var(--danger);
  border-color: var(--danger-dark);
}

.time-button.active {
  color: #fff;
  background: var(--brand);
  border-color: var(--brand-dark);
}

.time-range-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.time-range-grid label {
  margin-top: 0;
}

.compact-stats div {
  padding: 10px 8px;
  border-radius: 12px;
}

.compact-stats strong {
  font-size: 22px;
}

.available-court-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.available-court {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 72px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 10px;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.available-court.available {
  border-color: #9be4b1;
  background: #f4fcf6;
}

.available-court.unavailable {
  color: #936161;
  border-color: #ffd3d3;
  background: #fff7f7;
}

.available-court.selected {
  color: #fff;
  border-color: var(--brand-dark);
  background: var(--brand);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.38);
}

.available-court .court-code {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 12px;
  background: #fff;
  color: var(--brand-dark);
  font-weight: 950;
  box-shadow: inset 0 0 0 1px rgba(8, 125, 61, 0.15);
}

.available-court.unavailable .court-code {
  color: var(--danger);
}

.available-court.selected .court-code {
  color: #fff;
  background: rgba(0, 0, 0, 0.18);
  box-shadow: none;
}

.available-court strong,
.available-court small {
  display: block;
}

.available-court strong {
  font-size: 17px;
}

.available-court small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.court-price {
  display: inline;
  min-height: 0;
  border-radius: 0;
  background: transparent;
  color: var(--brand-deep);
  padding: 0;
  font-weight: 950;
}

.available-court.selected small {
  color: rgba(255, 255, 255, 0.85);
}

.available-court.selected .court-price {
  background: transparent;
  color: #fff;
}

.price-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  margin-left: 6px;
  border-radius: 999px;
  background: var(--brand-deep);
  color: #fff;
  padding: 2px 10px;
  font-weight: 950;
  white-space: nowrap;
}

.selection-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 10px 0 12px;
  border: 1px solid #d7ebe0;
  border-radius: 12px;
  background: #f7fcf8;
  color: var(--muted);
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 900;
}

.selection-status strong {
  color: var(--ink);
}

.booking-day-scroll {
  max-height: min(58vh, 520px);
  margin-top: 8px;
  border-radius: 12px;
}

.booking-table th,
.booking-table td {
  min-width: 76px;
  padding: 4px;
}

.booking-table .time-col {
  min-width: 62px;
}

.booking-table .matrix-cell {
  min-height: 36px;
  border-radius: 8px;
  font-size: 12px;
}

.wide {
  width: 100%;
  margin-top: 12px;
}

.section-subhead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
}

.section-subhead strong {
  font-size: 15px;
}

.section-subhead span {
  font-size: 12px;
  font-weight: 800;
}

.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin: 0 3px 0 8px;
  border-radius: 999px;
}

.dot.ok {
  background: var(--brand);
}

.dot.no {
  background: var(--danger);
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
  margin-top: 12px;
}

input,
select,
textarea {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  padding: 10px 12px;
}

textarea {
  min-height: 82px;
  resize: vertical;
}

.checkbox-line {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.checkbox-line input {
  width: 20px;
  min-height: 20px;
}

.checkbox-line.disabled {
  opacity: 0.55;
}

.plan-hint {
  margin-top: 10px;
  border: 1px solid #ffe0a6;
  border-radius: 12px;
  background: #fff9ea;
  color: #7a5200;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 900;
}

.plan-hint.credit {
  border-color: #cfe8d8;
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.plan-hint.error {
  border-color: #f3b8b8;
  background: #fff1f1;
  color: #a6000f;
}

.inline-fields {
  align-items: end;
}

.inline-fields label {
  flex: 1 1 190px;
}

.inline-fields .secondary {
  flex: 0 0 96px;
}

.primary,
.secondary,
.danger {
  border: 0;
  padding: 0 14px;
}

.primary {
  width: 100%;
  color: #fff;
  background: var(--brand);
}

.primary:hover {
  background: var(--brand-dark);
}

.danger {
  color: #fff;
  background: var(--danger);
  border: 1px solid var(--danger-dark);
}

.price-stack {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.price-stack > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 12px;
  background: #f7faf6;
  border: 1px solid var(--line);
}

.price-stack .total {
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
}

.price-stack strong {
  font-size: 20px;
  white-space: nowrap;
}

.qr {
  display: grid;
  min-height: 150px;
  place-items: center;
  border: 2px dashed var(--line);
  border-radius: 12px;
  margin-top: 12px;
  overflow: hidden;
  text-align: center;
  color: var(--muted);
  padding: 14px;
}

.qr img {
  width: min(220px, 100%);
  display: block;
}

.qr-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.qr-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.qr-actions svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.wide-setting {
  grid-column: 1 / -1;
}

.wide-setting input[type="file"] {
  padding: 13px;
  cursor: pointer;
  background: #fff;
}

.grant-search-button {
  align-self: end;
  min-height: 48px;
}

.payment-preview-row {
  display: grid;
  grid-template-columns: minmax(130px, 190px) 1fr;
  gap: 14px;
  align-items: center;
  margin-top: 14px;
}

.admin-qr-preview {
  min-height: 130px;
  margin-top: 0;
}

.notice {
  border-radius: 12px;
  padding: 12px;
  background: #fff9ea;
  border: 1px solid #ffe0a6;
  color: #7a5200;
  margin-top: 12px;
}

.notice.success {
  background: var(--brand-soft);
  border-color: #a5dfb8;
  color: var(--brand-dark);
}

.notice:empty {
  display: none;
}

.hidden {
  display: none !important;
}

@media (max-width: 560px) {
  .app-shell {
    width: 100%;
  }

  .quick-links {
    grid-template-columns: 1fr;
  }

  .quick-links button {
    min-height: 68px;
  }

  .promo-strip {
    align-items: flex-start;
  }

  .card {
    padding: 14px;
    border-radius: 16px;
  }

  .page-head {
    align-items: flex-start;
  }

  .selected-date-card {
    align-items: flex-start;
    flex-direction: column;
  }

  .inline-fields {
    grid-template-columns: 1fr;
  }

  .price-stack {
    grid-template-columns: 1fr;
  }

  .qr img {
    width: min(190px, 100%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-view.active,
  .booking-step.active {
    animation: none;
  }

  * {
    scroll-behavior: auto !important;
  }
}

/* Final precedence for the LIFF customer surface. */
html,
body {
  min-width: 0;
  overflow-x: hidden;
}

body {
  color: var(--ink);
  background: var(--bg);
  font-family: "Noto Sans Thai", "Leelawadee UI", Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.auth-pending .app-shell,
.auth-pending .bottom-nav {
  visibility: hidden;
  pointer-events: none;
}

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(243, 248, 246, 0.98);
}

.auth-gate.hidden {
  display: none !important;
}

.auth-gate-panel {
  width: min(100%, 380px);
  padding: 34px 28px 30px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
  text-align: center;
}

.auth-gate-mark {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin: 0 auto 16px;
  border-radius: 15px;
  color: #fff;
  background: var(--brand);
  font-size: 27px;
  font-weight: 950;
}

.auth-gate-kicker {
  margin: 0 0 5px;
  color: var(--brand-dark);
  font-size: 13px;
  font-weight: 900;
}

.auth-gate-panel h2 {
  margin: 0;
  font-size: clamp(22px, 5vw, 29px);
  line-height: 1.2;
}

.auth-gate-panel p:not(.auth-gate-kicker) {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.auth-loader {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 22px;
}

.auth-loader span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand);
  animation: auth-pulse 900ms ease-in-out infinite;
}

.auth-loader span:nth-child(2) { animation-delay: 120ms; }
.auth-loader span:nth-child(3) { animation-delay: 240ms; }

.auth-gate.error .auth-gate-mark { background: var(--danger); }

@keyframes auth-pulse {
  0%, 100% { transform: translateY(0); opacity: 0.4; }
  50% { transform: translateY(-4px); opacity: 1; }
}

.app-shell {
  width: min(100%, 1120px);
  padding: 18px clamp(14px, 3vw, 28px) 104px;
}

.app-header {
  flex-wrap: wrap;
  border-color: var(--line);
  border-radius: 0 0 16px 16px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 5px 18px rgba(22, 65, 45, 0.05);
}

.app-header h1 { font-size: clamp(23px, 3vw, 34px); }

.app-view.active { animation: view-in 190ms ease-out both; }

@keyframes view-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

.home-status {
  min-height: 190px;
  border-radius: 22px;
  background: linear-gradient(118deg, #075a32 0%, #20ad69 49%, #a3dceb 100%);
  box-shadow: 0 16px 32px rgba(8, 122, 64, 0.16);
}

.home-status::after { display: none; }
.home-status strong { font-size: clamp(42px, 8vw, 78px); }
.quick-book { border-radius: 18px; background: var(--brand-deep); }
.quick-book:hover { background: var(--brand-dark); }
.quick-book-icon { color: var(--brand-dark); background: #eefaff; }

.quick-links { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.quick-links button,
.card,
.booking-card { border-radius: 16px; box-shadow: var(--shadow-soft); }
.quick-links button { min-height: 82px; border-color: var(--line); background: #fff; }
.quick-links button:nth-child(1) { background: #f1fbff; }
.quick-links button:nth-child(2) { background: #f3fbf6; }
.quick-links button:nth-child(3) { background: #f3fcf8; }
.quick-links button:hover { border-color: #9adab5; background: #fff; }

.back-button { display: grid; place-items: center; }
.back-button svg,
.icon-button svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.4;
}

.date-row {
  display: grid;
  grid-template-columns: repeat(7, minmax(84px, 1fr));
  flex-wrap: nowrap;
  overflow-x: auto;
  padding: 2px 2px 6px;
  scrollbar-width: thin;
}

.date-button { min-width: 84px; border-radius: 13px; }
.date-button.today:not(.active) { border-width: 2px; background: #e5f8ec; }
.date-button.active { background: var(--brand-dark); border-color: var(--brand-dark); }

.schedule-scroll,
.mini-schedule-scroll { max-width: 100%; overscroll-behavior-x: contain; border-color: var(--line); border-radius: 16px; }
.court-table { min-width: 760px; }
.court-table th,
.court-table td { min-width: 78px; padding: 5px; }
.court-table .time-col { min-width: 78px; width: 78px; }
.court-table thead th,
.court-table .time-col { background: #f8fcfa; }
.matrix-cell { min-height: 38px; border-radius: 9px; }
.schedule-scroll .matrix-cell.available { color: var(--brand-dark); background: #effaf3; border-color: #82dda9; }
.schedule-scroll .matrix-cell.available:hover { background: #ddf7e7; }
.schedule-scroll .matrix-cell.unavailable { color: #fff; background: var(--danger); border-color: var(--danger-dark); }
.schedule-scroll .matrix-cell.selected,
.booking-table .matrix-cell.selected { color: #fff; background: var(--brand-dark); border-color: var(--brand-deep); box-shadow: 0 0 0 2px #fff, 0 5px 12px rgba(8, 122, 64, 0.22); }

.empty-state { display: grid; justify-items: center; gap: 7px; padding: 30px 16px; color: var(--muted); text-align: center; }
.empty-state-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; color: var(--brand-dark); background: var(--brand-soft); }
.empty-state-icon svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.empty-state strong { color: var(--ink); font-size: 16px; }
.empty-state span { max-width: 320px; font-size: 13px; line-height: 1.5; }

.bottom-nav { max-width: 1120px; padding-bottom: max(10px, env(safe-area-inset-bottom)); border-color: var(--line); background: rgba(255, 255, 255, 0.9); }
.bottom-nav button.route-active { background: var(--brand-dark); box-shadow: 0 7px 17px rgba(8, 122, 64, 0.18); }
.primary { background: var(--brand); }
.primary:hover { background: var(--brand-dark); }
.price-stack .total,
.summary-card.total { background: var(--brand-dark); }

@media (max-width: 620px) {
  .app-shell { padding: 12px 10px 100px; }
  .app-header { margin: -12px -10px 0; padding: 13px 12px; }
  .app-utility-nav { justify-content: flex-start; gap: 6px; overflow-x: auto; padding-bottom: 1px; scrollbar-width: none; }
  .app-utility-nav::-webkit-scrollbar { display: none; }
  .app-utility-nav a { min-height: 26px; padding-inline: 8px; font-size: 10px; }
  .club-title h1 { font-size: 22px; }
  .club-title p { font-size: 12px; }
  .home-status { min-height: 148px; padding: 18px; border-radius: 18px; }
  .home-status strong { font-size: clamp(37px, 11vw, 58px); }
  .quick-links button { min-height: 70px; padding: 12px; }
  .quick-links strong { font-size: 13px; }
  .card { padding: 14px; }
  .court-table { min-width: 704px; }
  .court-table th,
  .court-table td { min-width: 70px; }
  .court-table .time-col { min-width: 72px; width: 72px; }
  .matrix-cell { min-height: 36px; font-size: 11px; }
  .member-id-helper { align-items: stretch; flex-direction: column; }
  .member-id-helper button { width: 100%; }
  .bottom-nav { margin: 0 4px; border: 1px solid var(--line); border-radius: 16px 16px 0 0; }
}

@media (prefers-reduced-motion: reduce) {
  .app-view.active,
  .auth-loader span { animation: none; }
}

/* Impeccable pass: Thai-first LIFF shell, calm hierarchy, and touch-safe states. */
:root {
  --bg: #f3f8f6;
  --panel: #ffffff;
  --ink: #15231d;
  --muted: #687771;
  --line: #d9e7e0;
  --brand: #12bd68;
  --brand-dark: #087a40;
  --brand-deep: #075a32;
  --brand-soft: #e8f8ee;
  --danger: #e10618;
  --danger-dark: #a1000d;
  --shadow: 0 14px 36px rgba(22, 65, 45, 0.08);
  --shadow-soft: 0 7px 22px rgba(22, 65, 45, 0.06);
}

html,
body {
  min-width: 0;
  overflow-x: hidden;
}

body {
  color: var(--ink);
  background: var(--bg);
  font-family: "Noto Sans Thai", "Leelawadee UI", Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-rendering: optimizeLegibility;
}

body.auth-pending {
  overflow: hidden;
}

.auth-pending .app-shell,
.auth-pending .bottom-nav {
  visibility: hidden;
  pointer-events: none;
}

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(243, 248, 246, 0.98);
}

.auth-gate.hidden {
  display: none !important;
}

.auth-gate-panel {
  width: min(100%, 380px);
  padding: 34px 28px 30px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
  text-align: center;
}

.auth-gate-mark {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin: 0 auto 16px;
  border-radius: 15px;
  color: #fff;
  background: var(--brand);
  font-size: 27px;
  font-weight: 950;
}

.auth-gate-kicker {
  margin: 0 0 5px;
  color: var(--brand-dark);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.auth-gate-panel h2 {
  margin: 0;
  font-size: clamp(22px, 5vw, 29px);
  line-height: 1.2;
}

.auth-gate-panel p:not(.auth-gate-kicker) {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.auth-loader {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 22px;
}

.auth-loader span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand);
  animation: auth-pulse 900ms ease-in-out infinite;
}

.auth-loader span:nth-child(2) { animation-delay: 120ms; }
.auth-loader span:nth-child(3) { animation-delay: 240ms; }

.auth-gate.error .auth-gate-mark {
  color: #fff;
  background: var(--danger);
}

.auth-retry {
  width: 100%;
  margin-top: 20px;
}

@keyframes auth-pulse {
  0%, 100% { transform: translateY(0); opacity: 0.4; }
  50% { transform: translateY(-4px); opacity: 1; }
}

.app-shell {
  width: min(100%, 1120px);
  padding: 18px clamp(14px, 3vw, 28px) 104px;
}

.app-header {
  border-color: var(--line);
  border-radius: 0 0 16px 16px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 5px 18px rgba(22, 65, 45, 0.05);
}

.app-header h1 {
  font-size: clamp(23px, 3vw, 34px);
  letter-spacing: -0.02em;
}

.app-header p {
  color: var(--muted);
}

.app-view.active {
  animation: view-in 190ms ease-out both;
}

@keyframes view-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

.home-status {
  min-height: 190px;
  border-radius: 22px;
  background: linear-gradient(118deg, #075a32 0%, #20ad69 49%, #a3dceb 100%);
  box-shadow: 0 16px 32px rgba(8, 122, 64, 0.16);
}

.home-status::after {
  display: none;
}

.home-status strong {
  font-size: clamp(42px, 8vw, 78px);
  letter-spacing: -0.04em;
}

.quick-book {
  border-radius: 18px;
  background: var(--brand-deep);
  box-shadow: 0 12px 24px rgba(5, 90, 50, 0.16);
}

.quick-book:hover {
  background: var(--brand-dark);
}

.quick-book-icon {
  color: var(--brand-dark);
  background: #eefaff;
}

.quick-links {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.quick-links button,
.card,
.booking-card {
  border-radius: 16px;
  box-shadow: var(--shadow-soft);
}

.quick-links button {
  min-height: 82px;
  padding: 16px;
  border-color: var(--line);
  background: #fff;
}

.quick-links button:nth-child(1) { background: #f1fbff; }
.quick-links button:nth-child(2) { background: #f3fbf6; }
.quick-links button:nth-child(3) { background: #f3fcf8; }

.quick-links button:hover {
  border-color: #9adab5;
  background: #fff;
}

.card {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.94);
}

.page-head {
  align-items: center;
  margin: 10px 0 14px;
}

.page-head h2,
.section-head h2 {
  letter-spacing: -0.02em;
}

.back-button svg,
.icon-button svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.4;
}

.back-button {
  display: grid;
  place-items: center;
}

.date-row {
  display: grid;
  grid-template-columns: repeat(7, minmax(84px, 1fr));
  flex-wrap: nowrap;
  overflow-x: auto;
  padding: 2px 2px 6px;
  scrollbar-width: thin;
}

.date-button {
  min-width: 84px;
  border-radius: 13px;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, color 180ms ease;
}

.date-button.today:not(.active) {
  border-width: 2px;
  background: #e5f8ec;
}

.date-button.active {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
  box-shadow: 0 7px 16px rgba(8, 122, 64, 0.18);
}

.schedule-scroll,
.mini-schedule-scroll {
  max-width: 100%;
  overscroll-behavior-x: contain;
  border-color: var(--line);
  border-radius: 16px;
}

.court-table {
  min-width: 760px;
}

.court-table th,
.court-table td {
  min-width: 78px;
  padding: 5px;
}

.court-table .time-col {
  min-width: 78px;
  width: 78px;
}

.court-table thead th,
.court-table .time-col {
  background: #f8fcfa;
}

.matrix-cell {
  min-height: 38px;
  border-radius: 9px;
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.schedule-scroll .matrix-cell.available {
  color: var(--brand-dark);
  background: #effaf3;
  border-color: #82dda9;
}

.schedule-scroll .matrix-cell.available:hover {
  background: #ddf7e7;
}

.schedule-scroll .matrix-cell.unavailable {
  color: #fff;
  background: var(--danger);
  border-color: var(--danger-dark);
}

.schedule-scroll .matrix-cell.selected,
.booking-table .matrix-cell.selected {
  color: #fff;
  background: var(--brand-dark);
  border-color: var(--brand-deep);
  box-shadow: 0 0 0 2px #fff, 0 5px 12px rgba(8, 122, 64, 0.22);
}

.empty-state {
  display: grid;
  justify-items: center;
  gap: 7px;
  padding: 30px 16px;
  color: var(--muted);
  text-align: center;
}

.empty-state-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 3px;
  border-radius: 14px;
  color: var(--brand-dark);
  background: var(--brand-soft);
}

.empty-state-icon svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.empty-state strong {
  color: var(--ink);
  font-size: 16px;
}

.empty-state span {
  max-width: 320px;
  font-size: 13px;
  line-height: 1.5;
}

.coupon-shop-card {
  display: none !important;
}

.bottom-nav {
  max-width: 1120px;
  padding-bottom: max(10px, env(safe-area-inset-bottom));
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.9);
}

.bottom-nav button.route-active {
  background: var(--brand-dark);
  box-shadow: 0 7px 17px rgba(8, 122, 64, 0.18);
}

.primary {
  background: var(--brand);
}

.primary:hover {
  background: var(--brand-dark);
}

.price-stack .total,
.summary-card.total {
  background: var(--brand-dark);
}

@media (max-width: 620px) {
  .app-shell {
    padding: 12px 10px 100px;
  }

  .app-header {
    margin: -12px -10px 0;
    padding: 13px 12px;
  }

  .club-title {
    min-width: 0;
  }

  .club-title h1 {
    font-size: 22px;
  }

  .club-title p {
    font-size: 12px;
  }

  .profile-pill {
    max-width: 104px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .home-status {
    min-height: 148px;
    padding: 18px;
    border-radius: 18px;
  }

  .home-status strong {
    font-size: clamp(37px, 11vw, 58px);
  }

  .quick-links button {
    min-height: 70px;
    padding: 12px;
  }

  .quick-links strong {
    font-size: 13px;
  }

  .quick-link-icon {
    width: 30px;
    height: 30px;
  }

  .card {
    padding: 14px;
  }

  .court-table {
    min-width: 704px;
  }

  .court-table th,
  .court-table td {
    min-width: 70px;
  }

  .court-table .time-col {
    min-width: 72px;
    width: 72px;
  }

  .matrix-cell {
    min-height: 36px;
    font-size: 11px;
  }

  .bottom-nav {
    margin: 0 4px;
    border: 1px solid var(--line);
    border-radius: 16px 16px 0 0;
  }
}

@media (min-width: 621px) {
  .bottom-nav {
    border: 1px solid var(--line);
    border-radius: 16px;
  }
}

.schedule-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.schedule-summary:empty {
  display: none;
}

.schedule-summary div {
  padding: 12px;
  border-radius: 14px;
  background: var(--brand-soft);
  text-align: center;
}

.schedule-summary strong,
.schedule-summary span {
  display: block;
}

.schedule-summary strong {
  font-size: 26px;
}

.schedule-summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.schedule-scroll {
  max-height: 68vh;
  overflow: auto;
  border: 1px solid #e7eeeb;
  border-radius: 14px;
  background: #fff;
}

.mini-schedule-scroll {
  max-height: 430px;
  overflow: auto;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}

.court-table {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.court-table th,
.court-table td {
  min-width: 86px;
  padding: 4px;
  border-bottom: 1px solid #f0f4f2;
  border-right: 1px solid #f0f4f2;
  text-align: center;
}

.court-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #fbfdfc;
  font-weight: 950;
}

.court-table .time-col {
  position: sticky;
  left: 0;
  z-index: 4;
  min-width: 104px;
  background: #fbfdfc;
}

.court-table tbody .time-col {
  font-size: 13px;
  white-space: nowrap;
}

.time-range-label {
  display: inline-block;
  min-width: 88px;
  letter-spacing: 0;
}

.matrix-cell {
  width: 100%;
  min-height: 34px;
  border: 1px solid;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 950;
  cursor: pointer;
}

.schedule-scroll .matrix-cell {
  min-height: 32px;
  border-radius: 8px;
  background: transparent;
}

.schedule-scroll .matrix-cell.available {
  color: var(--brand-dark);
  background: #f4fcf6;
}

.schedule-scroll .matrix-cell.unavailable {
  color: #fff;
  background: var(--danger);
  border-color: var(--danger-dark);
}

.matrix-cell.selected {
  color: #fff;
  background: var(--brand);
  border-color: var(--brand-dark);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.45);
}

.schedule-scroll .matrix-cell.selected,
.booking-table .matrix-cell.selected {
  color: #fff;
  background: var(--brand);
  border-color: var(--brand-dark);
  box-shadow: 0 6px 14px rgba(20, 191, 99, 0.28), inset 0 0 0 2px rgba(255, 255, 255, 0.38);
  transform: scale(1.02);
  transition: transform 120ms ease, box-shadow 120ms ease, background-color 120ms ease;
}

.wizard-actions {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.wizard-actions.two {
  grid-template-columns: 0.8fr 1.2fr;
}

.primary:disabled,
.secondary:disabled,
.danger:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.primary:active,
.secondary:active,
.danger:active,
.quick-book:active,
.quick-links button:active,
.promo-strip button:active,
.menu-card:active,
.matrix-cell:active,
.available-court:active,
.date-button:active,
.facility-button:active {
  transform: translateY(1px) scale(0.99);
}

.confirm-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.confirm-summary div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fbfa;
}

.confirm-summary span,
.confirm-summary strong {
  display: block;
}

.confirm-summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.confirm-summary strong {
  margin-top: 4px;
  font-size: 15px;
}

.confirm-summary .wide-summary {
  grid-column: 1 / -1;
}

.toast {
  position: fixed;
  right: 16px;
  bottom: 86px;
  left: 16px;
  z-index: 30;
  max-width: 520px;
  margin: 0 auto;
  padding: 13px 16px;
  border-radius: 14px;
  color: #fff;
  background: var(--brand-deep);
  font-weight: 900;
  text-align: center;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.2);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.warn {
  background: #9a6200;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.stat,
.promo {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.promo {
  width: 100%;
  text-align: left;
  cursor: pointer;
}

.stat span,
.promo span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.stat strong {
  display: block;
  margin-top: 4px;
  font-size: 28px;
}

.member-id-helper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid #cfe4d8;
  border-radius: 14px;
  background: var(--brand-soft);
}

.member-id-helper div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.member-id-helper strong { font-size: 13px; }
.member-id-helper span { color: var(--muted); font-size: 11px; }
.member-id-helper button { flex: 0 0 auto; min-height: 34px; }

.promo-list,
.booking-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.promo strong {
  color: var(--brand-dark);
}

.coupon-list,
.coupon-catalog {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.coupon-wallet-item,
.coupon-shop-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid #d8eee3;
  border-radius: 16px;
  background: linear-gradient(110deg, #f8fffb, #eef9ff);
}

.coupon-wallet-item.pending {
  opacity: 0.72;
  background: #f7f7f7;
}

.coupon-wallet-item .coupon-art,
.coupon-shop-item .coupon-art {
  width: 58px;
  height: 58px;
  border: 0;
  border-radius: 14px;
  font-size: 0;
}

.coupon-art-green {
  color: #087a48;
  background: #dff8e9;
}

.coupon-art-blue {
  color: #15729c;
  background: #e3f5ff;
}

.coupon-art svg {
  width: 31px;
  height: 31px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.coupon-wallet-copy,
.coupon-shop-copy {
  min-width: 0;
}

.coupon-wallet-copy strong,
.coupon-shop-copy strong,
.coupon-wallet-copy span,
.coupon-shop-copy span,
.coupon-wallet-copy small,
.coupon-shop-copy small {
  display: block;
}

.coupon-wallet-copy strong,
.coupon-shop-copy strong {
  color: var(--brand-dark);
  font-size: 16px;
}

.coupon-wallet-copy span,
.coupon-shop-copy span,
.coupon-wallet-copy small,
.coupon-shop-copy small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.coupon-wallet-copy small {
  color: var(--brand);
  letter-spacing: 0.04em;
}

.coupon-badge {
  display: inline-block !important;
  width: fit-content;
  padding: 3px 7px;
  border-radius: 999px;
  color: #087a48 !important;
  background: #dff8e9;
  font-size: 11px !important;
}

.coupon-buy-button,
.coupon-use-button {
  min-width: 68px;
  white-space: nowrap;
}

.booking-coupon-picker {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #d8eee3;
  border-radius: 14px;
  background: #f8fffb;
}

.booking-coupon-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.booking-coupon-picker-head strong,
.booking-coupon-picker-head span {
  display: block;
}

.booking-coupon-picker-head strong {
  color: var(--brand-dark);
  font-size: 15px;
}

.booking-coupon-picker-head span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.booking-coupon-selection {
  margin-top: 0 !important;
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--brand-dark) !important;
  background: var(--brand-soft);
  white-space: nowrap;
}

.booking-coupon-options {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.booking-coupon-option {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 24px;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 9px;
  border: 1px solid #bfe8cf;
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: background-color 180ms ease, border-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.booking-coupon-option:hover,
.booking-coupon-option:focus-visible {
  border-color: var(--brand);
  box-shadow: 0 4px 12px rgba(8, 125, 61, 0.12);
  transform: translateY(-1px);
}

.booking-coupon-option.selected {
  border-color: var(--brand-dark);
  background: #dff8e9;
  box-shadow: inset 0 0 0 1px var(--brand-dark);
}

.booking-coupon-icon {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 10px;
  color: var(--brand-dark);
  background: var(--brand-soft);
}

.booking-coupon-icon svg {
  width: 21px;
  height: 21px;
}

.booking-coupon-copy {
  min-width: 0;
}

.booking-coupon-copy strong,
.booking-coupon-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.booking-coupon-copy strong {
  color: var(--brand-dark);
  font-size: 14px;
}

.booking-coupon-copy small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.booking-coupon-check {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 1px solid #b9d8c5;
  border-radius: 50%;
  color: #fff;
  background: #fff;
  font-weight: 950;
}

.booking-coupon-option.selected .booking-coupon-check {
  border-color: var(--brand-dark);
  background: var(--brand-dark);
}

.booking-coupon-empty {
  margin: 9px 0 1px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

@media (prefers-reduced-motion: reduce) {
  .app-view.active,
  .booking-step.active {
    animation: none;
  }

  .step-dot,
  .booking-coupon-option {
    transition: none;
  }
}

.coupon-purchase {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid #cfe6db;
  border-radius: 16px;
  background: #fbfffd;
}

.coupon-admin-card {
  margin-top: 14px;
}

.coupon-hero-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  padding: 18px 20px;
  border: 1px solid #d3eee2;
  background: linear-gradient(100deg, #eefcf5, #e9f7ff);
  border-radius: 16px;
}

.coupon-hero-strip strong,
.coupon-hero-strip span {
  display: block;
}

.coupon-hero-strip strong {
  color: var(--brand-dark);
  font-size: 20px;
}

.coupon-hero-strip span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.coupon-hero-strip svg {
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  fill: none;
  stroke: var(--brand-dark);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.coupon-unavailable {
  margin-top: 16px;
  padding: 14px;
  border-radius: 14px;
  background: #fff8f7;
  border: 1px solid #f4d7d2;
}

.coupon-unavailable h3,
.coupon-unavailable p {
  margin: 0;
}

.coupon-unavailable p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.coupon-unavailable-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #f1dfdc;
  color: #78544d;
}

.coupon-unavailable-item span {
  text-align: right;
  font-size: 13px;
  font-weight: 800;
}

.admin-coupon-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.admin-coupon-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border: 1px solid #d8eee3;
  border-radius: 14px;
  background: #fbfffd;
}

.admin-coupon-item.inactive {
  opacity: 0.58;
  background: #f6f7f7;
}

.admin-coupon-item h3,
.admin-coupon-item p,
.admin-coupon-item small {
  display: block;
  margin: 4px 0 0;
}

.admin-coupon-item h3 {
  margin-top: 8px;
  color: var(--brand-dark);
}

.admin-coupon-item p,
.admin-coupon-item small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.coupon-admin-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.coupon-definition-form {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8fcfa;
}

.coupon-definition-form .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.coupon-definition-form .actions button {
  flex: 1 1 180px;
}

.coupon-purchase h3 {
  margin: 0;
  font-size: 18px;
}

.coupon-purchase-price {
  margin: 0 0 8px;
  color: var(--brand-dark);
  font-size: 18px;
  font-weight: 950;
}

.coupon-qr {
  min-height: 120px;
}

.coupon-qr img {
  width: min(190px, 100%);
}

.booking-card {
  padding: 12px;
}

.badge.pending_approval {
  background: #fff7e6;
  color: #9a6200;
}

.badge.approved {
  background: #e9f9ef;
  color: var(--brand-dark);
}

.badge.rejected,
.badge.cancelled {
  background: var(--danger);
  color: #fff;
}

.booking-card.pending_approval {
  border-left: 6px solid var(--warn);
}

.booking-card.approved {
  border-left: 6px solid var(--brand);
}

.booking-card.rejected,
.booking-card.cancelled {
  border-left: 6px solid var(--danger);
}

.receipt-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  margin-top: 10px;
  padding: 0 14px;
  border-radius: 12px;
  color: #fff;
  background: var(--brand);
  font-weight: 950;
  text-decoration: none;
}

.receipt-shell {
  max-width: 760px;
  margin: 0 auto;
  padding: 16px;
}

.receipt-card {
  min-height: calc(100vh - 32px);
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow);
  padding: 18px;
}

.receipt-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.receipt-label {
  color: var(--muted);
  font-weight: 950;
}

.receipt-top h1 {
  margin: 2px 0 0;
  font-size: clamp(28px, 7vw, 42px);
}

.receipt-status {
  align-self: flex-start;
  border-radius: 999px;
  padding: 8px 12px;
  background: #fff7e6;
  color: #9a6200;
  font-weight: 950;
  white-space: nowrap;
}

.receipt-status.approved {
  color: var(--brand-dark);
  background: var(--brand-soft);
}

.receipt-status.rejected,
.receipt-status.cancelled {
  color: #fff;
  background: var(--danger);
}

.receipt-meta,
.receipt-total {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.receipt-meta > div,
.receipt-total > div {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f7faf6;
  padding: 10px;
}

.receipt-meta span,
.receipt-total span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.receipt-meta strong,
.receipt-total strong {
  display: block;
  margin-top: 3px;
}

.receipt-items {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.receipt-item {
  border: 1px solid #cdebd8;
  border-radius: 14px;
  padding: 12px;
  background: #f2fbf5;
}

.receipt-item > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--brand-dark);
}

.receipt-ranges {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.receipt-ranges span {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: center;
  border-radius: 10px;
  background: #fff;
  padding: 9px 10px;
  font-weight: 950;
}

.receipt-ranges em {
  font-style: normal;
  color: var(--brand-dark);
}

.receipt-total .grand-total {
  grid-column: 1 / -1;
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
}

.receipt-total .grand-total strong {
  font-size: 30px;
}

.receipt-note {
  margin-top: 14px;
  color: var(--muted);
  font-weight: 800;
}

.receipt-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.receipt-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border-radius: 14px;
  text-decoration: none;
}

.receipt-export-message {
  min-height: 20px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.bottom-nav {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  max-width: 1040px;
  margin: 0 auto;
  padding: 8px 12px 12px;
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.bottom-nav button {
  display: grid;
  place-items: center;
  gap: 2px;
  min-height: 48px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 950;
}

.nav-icon {
  width: 19px;
  height: 19px;
  stroke-width: 2.4;
}

.bottom-nav button.route-active {
  color: #fff;
  background: var(--brand-deep);
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

.admin-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  align-items: end;
  margin-top: 14px;
}

.admin-filters label {
  margin-top: 0;
}

.accounting-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  margin: 14px 0;
}

.summary-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  padding: 14px;
  box-shadow: var(--shadow);
}

.summary-card.total {
  color: #fff;
  border-color: var(--brand-dark);
  background: linear-gradient(135deg, var(--brand-dark), var(--brand));
}

.summary-card span,
.summary-card strong,
.summary-card small {
  display: block;
}

.summary-card span {
  color: inherit;
  font-size: 13px;
  font-weight: 950;
  opacity: 0.78;
}

.summary-card strong {
  margin-top: 6px;
  font-size: 28px;
}

.summary-card small {
  margin-top: 4px;
  color: var(--muted);
  font-weight: 900;
}

.summary-card.total small {
  color: rgba(255, 255, 255, 0.78);
}

.summary-card div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.summary-card b {
  border-radius: 999px;
  background: #eef5f0;
  color: #506057;
  padding: 5px 8px;
  font-size: 12px;
}

.summary-card.total b {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

@media (max-width: 540px) {
  .app-header h1 {
    font-size: 19px;
  }

  .app-header p,
  .profile-pill {
    font-size: 12px;
  }

  .admin-coupon-item {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-coupon-item button,
  .admin-coupon-item .badge {
    align-self: stretch;
    text-align: center;
  }

  .coupon-admin-actions {
    width: 100%;
    justify-content: stretch;
  }

  .coupon-admin-actions button {
    flex: 1 1 120px;
  }

  .home-hero {
    min-height: 260px;
  }

  .hero-copy {
    margin-top: 26px;
  }

  .hero-copy h2 {
    font-size: 42px;
  }

  .hero-copy p {
    max-width: 250px;
    font-size: 14px;
    line-height: 1.35;
  }

  .home-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: -34px;
    padding: 12px;
  }

  .menu-card {
    min-height: 112px;
    padding: 14px 12px;
  }

  .menu-card b {
    width: 34px;
    height: 34px;
    font-size: 24px;
  }

  .card-art {
    right: 10px;
    bottom: 10px;
    transform: scale(0.5);
    transform-origin: right bottom;
  }

  .promo-banner {
    width: calc(100% - 28px);
  }

  .date-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .date-button {
    min-width: 0;
    flex: unset;
  }

  .facility-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .facility-button {
    min-height: 58px;
    padding: 9px 6px;
  }

  .facility-button strong {
    font-size: 17px;
  }

  .facility-button span {
    font-size: 10px;
  }

  .mini-schedule-scroll {
    max-height: 300px;
  }

  .compact-court-table th,
  .compact-court-table td {
    min-width: 66px;
    padding: 5px;
  }

  .compact-court-table .time-col {
    min-width: 64px;
  }

  .compact-court-table .matrix-cell {
    min-height: 34px;
    font-size: 12px;
    border-radius: 9px;
  }

  .time-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .time-button {
    min-height: 44px;
    padding: 9px 10px;
  }

  .court-table .time-col {
    min-width: 94px;
  }

  .time-range-label {
    min-width: 82px;
    font-size: 11px;
  }
}

@media (min-width: 620px) {
  body {
    padding-bottom: 0;
  }

  .app-shell,
  .shell {
    padding: 20px;
  }

  .app-header {
    margin: -20px -20px 0;
    padding: 18px 28px;
  }

  .home-hero {
    margin: 0;
    border-radius: 0 0 34px 34px;
  }

  .home-panel {
    margin-right: 22px;
    margin-left: 22px;
  }

  .facility-row {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .time-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .stat-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .bottom-nav {
    position: sticky;
    bottom: auto;
    top: 75px;
    margin-top: 14px;
    margin-bottom: 16px;
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow);
  }
}

@media (min-width: 900px) {
  .home-panel {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .menu-card {
    min-height: 180px;
  }
}

@media (max-width: 560px) {
  .wizard-actions.two {
    grid-template-columns: 1fr;
  }
}

/* Premium surface system: keep the booking flow familiar while giving every
   screen the same calm, high-contrast visual language. */
:root {
  --bg: #f4f8f6;
  --panel: rgba(255, 255, 255, 0.88);
  --ink: #102019;
  --muted: #6d7c75;
  --line: #d9e5df;
  --brand: #13c96a;
  --brand-dark: #07934a;
  --brand-deep: #05683a;
  --brand-soft: #e8f8ef;
  --danger: #e10618;
  --danger-dark: #a4000d;
  --danger-soft: #fff0f1;
  --warn: #e5a21f;
  --hero: #12372a;
  --shadow: 0 18px 45px rgba(17, 47, 34, 0.08), 0 3px 10px rgba(17, 47, 34, 0.05);
  --shadow-lift: 0 22px 50px rgba(17, 47, 34, 0.13), 0 5px 14px rgba(17, 47, 34, 0.06);
}

html {
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  background:
    linear-gradient(180deg, #f8fbfa 0, var(--bg) 44%, #eef5f2 100%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

button,
a,
input,
select,
textarea {
  transition: border-color 180ms ease, background-color 180ms ease, color 180ms ease, box-shadow 180ms ease, transform 180ms ease, opacity 180ms ease;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(19, 201, 106, 0.3);
  outline-offset: 2px;
}

.app-shell,
.shell {
  width: min(100%, 1120px);
  padding: 18px;
}

.app-header,
.topbar {
  border-color: rgba(217, 229, 223, 0.86);
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 8px 28px rgba(18, 55, 42, 0.04);
  backdrop-filter: blur(20px) saturate(130%);
  -webkit-backdrop-filter: blur(20px) saturate(130%);
}

.app-header {
  margin: -18px -18px 0;
  padding: 16px 22px;
}

.brand-mark,
.logo {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: var(--brand);
  box-shadow: 0 8px 18px rgba(19, 201, 106, 0.22), inset 0 0 0 1px rgba(255, 255, 255, 0.22);
}

.club-title h1,
.brand h1 {
  letter-spacing: -0.02em;
  font-weight: 900;
}

.club-title p,
.brand p,
.page-head p {
  font-weight: 650;
}

.profile-pill,
.badge {
  min-height: 34px;
  border: 1px solid #dcebe2;
  background: rgba(232, 248, 239, 0.82);
  color: #3d5a4b;
  box-shadow: 0 4px 12px rgba(17, 47, 34, 0.04);
}

.language-toggle {
  min-height: 34px;
  border-color: #c8e8d5;
  background: rgba(255, 255, 255, 0.72);
  color: var(--brand-deep);
}

.language-toggle:hover,
.profile-pill:hover {
  border-color: var(--brand);
  background: #fff;
  transform: translateY(-1px);
}

.home-dashboard {
  gap: 14px;
  margin-top: 22px;
}

.home-status {
  position: relative;
  min-height: 174px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 24px;
  background: linear-gradient(118deg, #10392a 0%, #0c6b3d 54%, #18bd68 100%);
  box-shadow: 0 24px 50px rgba(5, 104, 58, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.home-status::after {
  position: absolute;
  right: 7%;
  bottom: 18px;
  width: 22%;
  height: 3px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.55);
  content: "";
  transform: skewX(-28deg);
}

.home-status strong {
  letter-spacing: -0.04em;
  font-weight: 850;
}

.quick-book {
  min-height: 82px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 18px;
  background: linear-gradient(118deg, #075c32 0%, #08a754 68%, #16bdca 100%);
  box-shadow: 0 16px 32px rgba(5, 104, 58, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.quick-book:hover,
.hero-cta:hover {
  box-shadow: 0 20px 38px rgba(5, 104, 58, 0.24), 0 0 0 4px rgba(19, 201, 106, 0.12);
  transform: translateY(-2px);
}

.quick-book-icon {
  border-radius: 14px;
  box-shadow: 0 8px 18px rgba(4, 64, 36, 0.2);
}

.quick-links {
  gap: 10px;
  margin-top: 16px;
}

.quick-links button {
  min-height: 84px;
  border-color: var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: var(--shadow);
}

.quick-links button:hover,
.available-court:hover,
.facility-button:hover,
.date-button:hover,
.coupon-shop-item:hover,
.coupon-wallet-item:hover {
  border-color: #99dbb4;
  box-shadow: var(--shadow-lift);
  transform: translateY(-2px);
}

.quick-links button:nth-child(1),
.quick-links button:nth-child(2),
.quick-links button:nth-child(3) {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.76);
}

.quick-link-icon {
  border-radius: 14px;
}

.promo-strip,
.promo-banner,
.coupon-hero-strip {
  border-color: #d5e9df;
  border-radius: 18px;
  background: linear-gradient(112deg, rgba(239, 252, 245, 0.94), rgba(237, 249, 255, 0.84));
  box-shadow: var(--shadow);
}

.promo-strip button,
.coupon-buy-button,
.coupon-use-button {
  box-shadow: 0 8px 16px rgba(19, 201, 106, 0.18);
}

.promo-strip button:hover,
.coupon-buy-button:hover,
.coupon-use-button:hover {
  background: var(--brand-dark);
  box-shadow: 0 12px 24px rgba(19, 201, 106, 0.26);
  transform: translateY(-1px);
}

.page-head {
  margin: 24px 0 16px;
}

.page-head h2 {
  font-weight: 900;
  letter-spacing: -0.02em;
}

.back-button {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
}

.back-button:hover,
.icon-button:hover {
  border-color: #9cdbb4;
  color: var(--brand-dark);
  box-shadow: var(--shadow-lift);
  transform: translateY(-2px);
}

.card,
.booking-card,
.receipt-card {
  border-color: rgba(217, 229, 223, 0.9);
  border-radius: 22px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px) saturate(120%);
  -webkit-backdrop-filter: blur(16px) saturate(120%);
}

.card {
  padding: 20px;
  margin-bottom: 16px;
}

.section-head h2,
.section-head h3 {
  font-weight: 900;
  letter-spacing: -0.015em;
}

.stepper {
  gap: 10px;
  margin-bottom: 16px;
}

.step-dot {
  min-height: 46px;
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.72);
}

.step-dot:hover {
  border-color: #8fd5aa;
  transform: translateY(-1px);
}

.step-dot.active {
  background: var(--brand-deep);
  border-color: var(--brand-deep);
  box-shadow: 0 8px 18px rgba(5, 104, 58, 0.2), 0 0 0 4px rgba(19, 201, 106, 0.1);
}

.step-dot.done {
  background: #e4f8ed;
}

.selected-date-card,
.selection-status,
.plan-hint,
.notice {
  border-radius: 14px;
}

.date-picker-display,
.icon-button,
input,
select,
textarea {
  border-color: var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.84);
}

input:hover,
select:hover,
textarea:hover,
.date-picker-display:hover {
  border-color: #a7dcb9;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(19, 201, 106, 0.12);
  outline: 0;
}

.date-button,
.facility-button,
.time-button,
.primary,
.secondary,
.danger {
  min-height: 50px;
  border-radius: 14px;
}

.date-button,
.facility-button,
.secondary {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.8);
}

.date-button.active,
.facility-button.active,
.time-button.active,
.matrix-cell.selected,
.available-court.selected {
  background: var(--brand);
  border-color: var(--brand-dark);
  box-shadow: 0 8px 18px rgba(19, 201, 106, 0.2), inset 0 0 0 2px rgba(255, 255, 255, 0.32);
}

.primary {
  background: var(--brand);
  box-shadow: 0 10px 22px rgba(19, 201, 106, 0.18);
}

.primary:hover {
  background: var(--brand-dark);
  box-shadow: 0 14px 28px rgba(19, 201, 106, 0.27), 0 0 0 4px rgba(19, 201, 106, 0.1);
  transform: translateY(-2px);
}

.secondary:hover {
  border-color: #86d2a4;
  background: #f3fcf6;
  color: var(--brand-dark);
  transform: translateY(-1px);
}

.primary:active,
.secondary:active,
.danger:active,
.quick-book:active,
.quick-links button:active,
.promo-strip button:active,
.menu-card:active,
.matrix-cell:active,
.available-court:active,
.date-button:active,
.facility-button:active,
.booking-coupon-option:active {
  transform: scale(0.985);
}

.price-stack > div,
.confirm-summary div,
.schedule-summary div,
.stat,
.promo {
  border-color: var(--line);
  border-radius: 15px;
  background: rgba(248, 252, 250, 0.86);
}

.price-stack .total,
.summary-card.total {
  background: linear-gradient(115deg, var(--brand-deep), var(--brand-dark));
  box-shadow: 0 14px 26px rgba(5, 104, 58, 0.2);
}

.qr,
.schedule-scroll,
.mini-schedule-scroll {
  border-color: var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
}

.schedule-scroll .matrix-cell.available,
.time-button.available {
  border-color: #8bdcab;
  background: #effaf3;
}

.schedule-scroll .matrix-cell.available:hover,
.time-button.available:hover {
  background: #dff8e9;
  box-shadow: 0 5px 12px rgba(19, 201, 106, 0.15);
  transform: translateY(-1px);
}

.schedule-scroll .matrix-cell.unavailable,
.time-button.unavailable {
  background: var(--danger);
  border-color: var(--danger-dark);
}

.coupon-wallet-item,
.coupon-shop-item,
.booking-coupon-picker,
.booking-coupon-option {
  border-radius: 17px;
  border-color: #cfe8d9;
  background: rgba(250, 255, 252, 0.86);
  box-shadow: 0 8px 20px rgba(17, 47, 34, 0.04);
}

.coupon-wallet-item,
.coupon-shop-item {
  padding: 16px;
}

.booking-coupon-picker {
  background: rgba(241, 251, 245, 0.9);
}

.booking-coupon-option {
  background: rgba(255, 255, 255, 0.9);
}

.booking-coupon-option.selected {
  background: #dff8e9;
  box-shadow: 0 8px 18px rgba(19, 201, 106, 0.12), inset 0 0 0 1px var(--brand-dark);
}

.toast {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  background: rgba(5, 104, 58, 0.94);
  box-shadow: 0 18px 38px rgba(2, 38, 21, 0.22);
  backdrop-filter: blur(14px);
}

.receipt-link {
  border-radius: 14px;
  background: var(--brand);
  box-shadow: 0 8px 18px rgba(19, 201, 106, 0.18);
}

.receipt-link:hover {
  background: var(--brand-dark);
  transform: translateY(-1px);
}

.bottom-nav {
  border-color: rgba(217, 229, 223, 0.9);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 -8px 28px rgba(17, 47, 34, 0.06);
  backdrop-filter: blur(20px) saturate(130%);
  -webkit-backdrop-filter: blur(20px) saturate(130%);
}

.bottom-nav button {
  min-height: 54px;
  border: 1px solid transparent;
  border-radius: 16px;
}

.bottom-nav button:hover {
  color: var(--brand-dark);
  background: #f1faf5;
}

.bottom-nav button.route-active {
  color: #fff;
  background: var(--brand-deep);
  box-shadow: 0 8px 18px rgba(5, 104, 58, 0.18);
}

@media (max-width: 620px) {
  .app-shell,
  .shell {
    padding: 14px;
  }

  .app-header {
    margin: -14px -14px 0;
    padding: 14px 16px;
  }

  .home-status {
    min-height: 154px;
    padding: 18px;
  }

  .home-status strong {
    font-size: clamp(34px, 12vw, 54px);
  }

  .card {
    padding: 16px;
  }

  .quick-links button {
    min-height: 72px;
  }
}

@media (min-width: 900px) {
  .app-shell,
  .shell {
    padding: 24px;
  }

  .app-header {
    margin: -24px -24px 0;
    padding-inline: 30px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* Customer surface precedence after the legacy theme rules. */
body {
  font-family: "Noto Sans Thai", "Leelawadee UI", Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
}

.app-shell { width: min(100%, 1120px); padding-bottom: 104px; }
.home-status { min-height: 190px; border-radius: 22px; background: linear-gradient(118deg, #075a32 0%, #20ad69 49%, #a3dceb 100%); }
.home-status::after { display: none; }
.quick-book { border-radius: 18px; background: var(--brand-deep); }
.quick-book-icon { color: var(--brand-dark); background: #eefaff; }
.quick-links { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.quick-links button { min-height: 82px; border-radius: 16px; border-color: var(--line); background: #fff; }
.quick-links button:nth-child(1) { background: #f1fbff; }
.quick-links button:nth-child(2) { background: #f3fbf6; }
.quick-links button:nth-child(3) { background: #f3fcf8; }
.date-row { display: grid; grid-template-columns: repeat(7, minmax(84px, 1fr)); flex-wrap: nowrap; overflow-x: auto; padding: 2px 2px 6px; }
.date-button { min-width: 84px; border-radius: 13px; }
.date-button.today:not(.active) { border-width: 2px; background: #e5f8ec; }
.date-button.active { background: var(--brand-dark); border-color: var(--brand-dark); }
.schedule-scroll, .mini-schedule-scroll { max-width: 100%; overscroll-behavior-x: contain; border-color: var(--line); border-radius: 16px; }
.court-table { min-width: 760px; }
.court-table th, .court-table td { min-width: 78px; padding: 5px; }
.court-table .time-col { min-width: 78px; width: 78px; }
.matrix-cell { min-height: 38px; border-radius: 9px; }
.schedule-scroll .matrix-cell.available { color: var(--brand-dark); background: #effaf3; border-color: #82dda9; }
.schedule-scroll .matrix-cell.unavailable { color: #fff; background: var(--danger); border-color: var(--danger-dark); }
.schedule-scroll .matrix-cell.selected, .booking-table .matrix-cell.selected { color: #fff; background: var(--brand-dark); border-color: var(--brand-deep); box-shadow: 0 0 0 2px #fff, 0 5px 12px rgba(8, 122, 64, 0.22); }
.bottom-nav { max-width: 1120px; border-color: var(--line); background: rgba(255, 255, 255, 0.9); }
.bottom-nav button.route-active { background: var(--brand-dark); }
.primary { background: var(--brand); }
.primary:hover { background: var(--brand-dark); }
.price-stack .total, .summary-card.total { background: var(--brand-dark); }

/* Coupon packages are a real customer action, so keep the shop visible. */
.coupon-shop-card { display: block !important; }

.admin-page-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  position: sticky;
  top: 12px;
  z-index: 10;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
}

.admin-page-nav > div:first-child {
  display: grid;
  gap: 3px;
  min-width: max-content;
}

.admin-page-nav-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.admin-page-tab {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 16px;
  color: var(--brand-dark);
  background: #f4fbf7;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, color 160ms ease;
}

.admin-page-tab:hover { transform: translateY(-1px); }
.admin-page-tab.active { color: #fff; background: var(--brand-dark); border-color: var(--brand-dark); }
.admin-page-section.hidden { display: none; }

.admin-preview-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.admin-preview-toolbar > div { margin-right: auto; }
.admin-preview-toolbar h2 { margin: 0 0 4px; }
.admin-preview-toolbar label { min-width: 180px; }
.admin-back-link { text-decoration: none; white-space: nowrap; border: 1px solid #bfe8cf; background: #f1fbf5; color: var(--brand-dark); box-shadow: 0 8px 18px rgba(17, 47, 34, .06); }
.admin-back-link:hover { color: #fff; background: var(--brand-dark); border-color: var(--brand-dark); }
.admin-preview-card { position: relative; overflow: visible; }
.court-preview-scroll { position: relative; overflow-x: auto; border: 1px solid var(--line); border-radius: 16px; }
.court-preview-table { width: 100%; min-width: 780px; border-collapse: separate; border-spacing: 0; }
.court-preview-table th, .court-preview-table td { border-bottom: 1px solid #e5eee9; border-right: 1px solid #e5eee9; padding: 8px; text-align: center; }
.court-preview-table th { position: sticky; top: 0; z-index: 1; background: #f5fbf7; color: var(--text); font-weight: 900; }
.court-preview-table th:first-child { left: 0; z-index: 2; }
.court-preview-table td:first-child { position: sticky; left: 0; z-index: 1; background: #fff; }
.preview-time { min-width: 124px; white-space: nowrap; }
.preview-cell { display: grid; place-items: center; width: 100%; min-height: 42px; border: 1px solid; border-radius: 11px; font: inherit; font-weight: 800; }
.preview-cell.available { color: #078649; background: #effaf3; border-color: #78d99f; }
.preview-cell.occupied { color: #fff; background: #ed0016; border-color: #bc0011; cursor: pointer; transition: transform 160ms ease, box-shadow 160ms ease; }
.preview-cell.occupied:hover, .preview-cell.occupied:focus-visible { transform: translateY(-1px); box-shadow: 0 6px 14px rgba(190, 0, 17, .22); }
.preview-legend { display: flex; gap: 14px; padding: 12px 4px 0; color: var(--muted); font-weight: 700; }
.preview-legend span { display: inline-flex; align-items: center; gap: 6px; }
.preview-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.available-dot { background: #12c96a; }
.occupied-dot { background: #ed0016; }
.booking-popover { position: absolute; z-index: 8; width: min(300px, calc(100% - 24px)); display: grid; gap: 7px; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.97); box-shadow: 0 18px 42px rgba(17,47,34,.2); }
.booking-popover.hidden { display: none; }
.popover-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.popover-head button { border: 0; background: transparent; font-size: 24px; cursor: pointer; color: var(--muted); }
.booking-popover span { color: var(--muted); }
.booking-popover a { color: var(--brand-dark); font-weight: 800; }
.popover-price { color: var(--brand-dark); font-size: 18px; }
.coupon-hero-action { margin-left: auto; white-space: nowrap; }

@media (max-width: 720px) {
  .admin-page-nav, .admin-preview-toolbar { align-items: stretch; flex-direction: column; }
  .admin-page-nav-actions { justify-content: stretch; overflow-x: auto; flex-wrap: nowrap; }
  .admin-page-tab { white-space: nowrap; }
  .admin-preview-toolbar .primary { width: 100%; }
  .coupon-hero-action { margin-left: 0; }
}

@media (max-width: 620px) {
  .app-shell { padding: 12px 10px 100px; }
  .app-header { margin: -12px -10px 0; padding: 13px 12px; }
  .club-title h1 { font-size: 22px; }
  .home-status { min-height: 148px; padding: 18px; border-radius: 18px; }
  .home-status strong { font-size: clamp(37px, 11vw, 58px); }
  .quick-links { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .quick-links button { min-height: 94px; padding: 14px; grid-template-columns: 52px minmax(0, 1fr); gap: 10px; }
  .quick-links button:nth-child(3) { grid-column: 1 / -1; }
  .quick-links strong { font-size: clamp(16px, 4.6vw, 20px); line-height: 1.2; }
  .quick-links span { margin-top: 5px; font-size: 13px; line-height: 1.3; }
  .quick-link-icon { width: 52px; height: 52px; padding: 12px; border-radius: 16px; }
  .card { padding: 14px; }
  .court-table { min-width: 704px; }
  .court-table th, .court-table td { min-width: 70px; }
  .court-table .time-col { min-width: 72px; width: 72px; }
  .matrix-cell { min-height: 36px; font-size: 11px; }
}

@media (max-width: 380px) {
  .quick-links { grid-template-columns: 1fr; }
  .quick-links button:nth-child(3) { grid-column: auto; }
}

/* Availability must remain unmistakable after selected-state rules are applied. */
.schedule-scroll .matrix-cell.available,
.booking-table .matrix-cell.available,
.time-button.available {
  color: var(--brand-dark);
  background: #effaf3;
  border-color: #82dda9;
}

.schedule-scroll .matrix-cell.available:hover,
.booking-table .matrix-cell.available:hover,
.time-button.available:hover {
  color: var(--brand-dark);
  background: #ddf7e7;
}

.schedule-scroll .matrix-cell.available.selected,
.booking-table .matrix-cell.available.selected,
.time-button.available.active {
  color: #fff;
  background: var(--brand);
  border-color: var(--brand-dark);
  box-shadow: 0 0 0 2px #fff, 0 6px 14px rgba(19, 201, 106, 0.28);
}

.schedule-scroll .matrix-cell.unavailable,
.booking-table .matrix-cell.unavailable,
.time-button.unavailable {
  color: #fff;
  background: var(--danger);
  border-color: var(--danger-dark);
}
