:root {
  color-scheme: dark;
  --bg: #061525;
  --bg-deep: #03101e;
  --surface: rgba(12, 31, 51, 0.92);
  --surface-2: rgba(17, 42, 68, 0.88);
  --surface-3: rgba(23, 50, 80, 0.78);
  --line: rgba(132, 179, 226, 0.22);
  --line-strong: rgba(132, 179, 226, 0.40);
  --text: #f7f9fc;
  --muted: #9fb3d0;
  --muted-2: #7f96b6;
  --orange: #ffad38;
  --orange-2: #ffbe58;
  --orange-soft: rgba(255, 173, 56, 0.14);
  --green: #47f09a;
  --green-soft: rgba(71, 240, 154, 0.08);
  --danger: #ff7c76;
  --danger-soft: rgba(255, 124, 118, 0.10);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.24);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  background: var(--bg-deep);
}

html {
  overscroll-behavior: none;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(650px 360px at 70% -5%, rgba(35, 104, 161, 0.24), transparent 60%),
    radial-gradient(500px 360px at 8% 26%, rgba(24, 89, 143, 0.18), transparent 66%),
    linear-gradient(180deg, #07182a 0%, #04121f 70%, #03101d 100%);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.28;
  background-image:
    radial-gradient(circle at 20% 12%, rgba(255,255,255,0.06) 0 1px, transparent 1.2px),
    radial-gradient(circle at 72% 32%, rgba(255,255,255,0.045) 0 1px, transparent 1.2px);
  background-size: 28px 28px, 36px 36px;
}

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

button {
  border: 0;
}

button,
label[for],
input[type="date"] {
  touch-action: manipulation;
}

.hidden {
  display: none !important;
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(100%, 760px);
  min-height: 100dvh;
  margin: 0 auto;
}

/* Loader */
.app-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: #061525;
  transition: opacity 220ms ease, visibility 220ms ease;
}

.app-loader.hide {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-logo {
  width: 82px;
  height: 82px;
  border-radius: 22px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
}

.loader-ring {
  width: 34px;
  height: 34px;
  border: 3px solid rgba(255,255,255,0.12);
  border-top-color: var(--orange);
  border-radius: 50%;
  animation: spin 760ms linear infinite;
}

.loader-text {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .08em;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Shared */
.glass-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(145deg, rgba(255,255,255,0.028), transparent 35%),
    linear-gradient(180deg, rgba(14, 37, 61, 0.94), rgba(9, 27, 47, 0.92));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.035), var(--shadow);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.primary-btn,
.secondary-btn,
.admin-action,
.date-quick,
.field-chip,
.time-slot,
.icon-btn,
.change-btn,
.text-nav,
.password-toggle,
.bottom-nav-item {
  cursor: pointer;
}

.primary-btn {
  width: 100%;
  min-height: 60px;
  padding: 14px 20px;
  border-radius: 17px;
  color: #071321;
  background: linear-gradient(180deg, var(--orange-2), var(--orange));
  box-shadow: 0 14px 30px rgba(255, 173, 56, 0.20), inset 0 1px 0 rgba(255,255,255,0.24);
  font-size: 18px;
  font-weight: 900;
  transition: transform .1s ease, opacity .15s ease;
}

.primary-btn:active,
.secondary-btn:active,
.date-quick:active,
.field-chip:active,
.time-slot:active,
.bottom-nav-item:active {
  transform: scale(.985);
}

.primary-btn:disabled {
  opacity: .45;
  box-shadow: none;
  cursor: default;
}

.secondary-btn {
  min-height: 48px;
  padding: 12px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  color: var(--text);
  background: var(--surface-3);
  font-weight: 750;
}

.change-btn {
  padding: 6px 4px;
  color: var(--orange);
  background: transparent;
  font-size: 16px;
  font-weight: 850;
}

.icon-btn {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--muted);
  background: rgba(255,255,255,0.025);
  font-size: 20px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--orange);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.muted {
  color: var(--muted);
  line-height: 1.5;
}

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

.form-message.error,
.error { color: var(--danger); }
.form-message.success,
.success { color: var(--green); }

/* Login */
.login-screen {
  min-height: 100dvh;
  padding:
    max(16px, env(safe-area-inset-top))
    max(18px, env(safe-area-inset-right))
    max(26px, env(safe-area-inset-bottom))
    max(18px, env(safe-area-inset-left));
}

.login-topline {
  min-height: 40px;
  display: flex;
  align-items: center;
}

.text-nav {
  padding: 6px 0;
  color: #dce7f5;
  background: transparent;
  font-size: 17px;
}

.login-hero {
  padding: 8px 0 24px;
  text-align: center;
}

.login-logo {
  display: block;
  width: 118px;
  height: 118px;
  margin: 0 auto 18px;
  border-radius: 29px;
  box-shadow: 0 22px 55px rgba(0,0,0,.28);
}

.login-hero h1 {
  margin: 0;
  font-size: clamp(38px, 10vw, 58px);
  line-height: .98;
  letter-spacing: -.045em;
  font-weight: 950;
}

.login-hero .accent { color: var(--orange); }

.login-hero p {
  margin: 14px 0 0;
  color: #c1cce0;
  font-size: clamp(17px, 4.5vw, 22px);
}

.login-panel {
  padding: 24px 20px 20px;
}

.field-label {
  display: block;
  margin: 0 0 8px 4px;
  color: var(--text);
  font-size: 15px;
  font-weight: 800;
}

.input-shell {
  position: relative;
  margin-bottom: 18px;
}

.input-shell input,
.admin-input {
  width: 100%;
  min-height: 58px;
  padding: 13px 52px 13px 52px;
  color: var(--text);
  background: rgba(28, 57, 88, .64);
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  outline: 0;
  font-size: 17px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.025);
}

.input-shell input::placeholder,
.admin-input::placeholder {
  color: #879ebd;
}

.input-shell input:focus,
.admin-input:focus {
  border-color: rgba(255, 173, 56, .65);
  box-shadow: 0 0 0 3px rgba(255, 173, 56, .12);
}

.input-icon {
  position: absolute;
  left: 17px;
  top: 50%;
  z-index: 1;
  color: #9bb2d0;
  font-size: 24px;
  transform: translateY(-50%);
  pointer-events: none;
}

.lock-icon { font-size: 19px; }

.password-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  color: #b9c9de;
  background: transparent;
  transform: translateY(-50%);
  font-size: 20px;
}

.login-btn { margin-top: 2px; }

.helper-text,
.login-note,
.preview-note {
  color: var(--muted);
  text-align: center;
}

.helper-text {
  margin: 18px 0 0;
  font-size: 14px;
}

.selected-establishment {
  margin-top: 18px;
  padding: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.mini-label {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
}

.establishment-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.establishment-row strong {
  font-size: 22px;
}

.mini-logo {
  width: 52px;
  height: 52px;
  border-radius: 13px;
}

.login-note {
  margin: 13px 0 0;
  font-size: 13px;
}

.login-gallery {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  overflow-x: auto;
  scrollbar-width: none;
}

.login-gallery::-webkit-scrollbar { display: none; }

.login-gallery-item {
  flex: 0 0 auto;
}

.login-gallery img {
  display: block;
  width: 78px;
  height: 56px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 13px;
}

.preview-note {
  margin: 26px 0 0;
  font-size: 11px;
}

/* App header */
.main-app {
  min-height: 100dvh;
  padding-bottom: calc(92px + env(safe-area-inset-bottom));
}

.native-header {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: 76px;
  padding:
    max(10px, env(safe-area-inset-top))
    max(18px, env(safe-area-inset-right))
    10px
    max(18px, env(safe-area-inset-left));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid rgba(132, 179, 226, 0.12);
  background: rgba(4, 18, 31, 0.78);
  backdrop-filter: blur(18px) saturate(1.15);
  -webkit-backdrop-filter: blur(18px) saturate(1.15);
}

.header-brand,
.header-actions {
  display: flex;
  align-items: center;
  gap: 11px;
}

.header-logo {
  width: 49px;
  height: 49px;
  border-radius: 13px;
}

.header-brand strong {
  font-size: 27px;
  letter-spacing: -.03em;
}

.header-actions { gap: 8px; }

.app-view {
  padding: 18px 18px 26px;
}

.active-view {
  animation: viewIn 180ms ease both;
}

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

/* Booking */
.user-card {
  position: relative;
  min-height: 92px;
  padding: 20px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.user-card h2 {
  margin: 0;
  font-size: clamp(29px, 7vw, 38px);
  letter-spacing: -.035em;
  font-weight: 500;
}

.user-card h2 strong { font-weight: 900; }

.credit-pill {
  flex: 0 0 auto;
  min-width: 126px;
  padding: 12px 16px;
  border: 1px solid rgba(255, 173, 56, .34);
  border-radius: 999px;
  color: var(--orange);
  background: rgba(255, 173, 56, .10);
  font-size: 16px;
  font-weight: 900;
  text-align: center;
}

.credit-pill::before {
  content: "◉";
  margin-right: 8px;
}

.role-badge {
  position: absolute;
  right: 14px;
  bottom: -11px;
  padding: 5px 9px;
  border-radius: 999px;
  color: var(--muted);
  background: #0b2036;
  border: 1px solid var(--line);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.booking-section {
  padding-top: 28px;
}

.booking-heading h1,
.page-title-row h1 {
  margin: 0;
  color: var(--text);
  font-size: clamp(34px, 8.5vw, 50px);
  line-height: 1.02;
  letter-spacing: -.048em;
  font-weight: 950;
}

.date-quick-grid {
  display: grid;
  grid-template-columns: 1.05fr 1.05fr .48fr;
  gap: 10px;
  margin-top: 24px;
}

.date-quick,
.calendar-button {
  min-height: 58px;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  color: #dfe8f6;
  background: rgba(16, 40, 65, .74);
  font-size: 18px;
  font-weight: 760;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.025);
}

.date-quick.active {
  color: #071321;
  border-color: var(--orange);
  background: linear-gradient(180deg, var(--orange-2), var(--orange));
  box-shadow: 0 12px 26px rgba(255,173,56,.16);
  font-weight: 900;
}

.calendar-button {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #a9bdd9;
  font-size: 24px;
}

.calendar-button input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: .001;
  cursor: pointer;
}

.selected-date-label {
  min-height: 30px;
  padding: 8px 4px 0;
  color: #a8bad4;
  font-size: 14px;
  text-transform: capitalize;
}

.field-buttons {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin-top: 12px;
}

.field-chip {
  min-height: 54px;
  padding: 10px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 15px;
  color: #e7edf7;
  background: rgba(18, 43, 69, .72);
  font-size: 16px;
  font-weight: 760;
}

.field-chip.active {
  color: #081525;
  border-color: var(--orange);
  background: linear-gradient(180deg, var(--orange-2), var(--orange));
  font-weight: 900;
}

.native-hidden-control {
  position: fixed !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.slot-heading {
  margin: 26px 2px 12px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.slot-heading h2 {
  margin: 0;
  font-size: clamp(25px, 6.2vw, 34px);
  letter-spacing: -.025em;
}

.slot-heading span {
  flex: 0 0 auto;
  color: #9bb1d0;
  font-size: 14px;
}

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

.time-slot {
  min-height: 70px;
  padding: 9px 8px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  color: #dce7f5;
  background: rgba(18, 43, 69, .72);
}

.time-slot strong {
  font-size: 23px;
  line-height: 1;
  letter-spacing: -.02em;
}

.time-slot small {
  color: var(--muted);
  font-size: 12px;
}

.time-slot.free {
  border-color: rgba(71, 240, 154, .85);
  color: var(--green);
  background: linear-gradient(180deg, rgba(9, 55, 50, .84), rgba(8, 42, 42, .76));
}

.time-slot.free small { color: var(--green); }

.time-slot.busy,
.time-slot.past {
  opacity: .62;
  color: #9aaec8;
}

.time-slot.busy small,
.time-slot.past small { color: #8aa1bf; }

.time-slot.selected {
  opacity: 1;
  color: #071321;
  border-color: var(--orange);
  background: linear-gradient(180deg, var(--orange-2), var(--orange));
  box-shadow: 0 13px 28px rgba(255,173,56,.16);
}

.time-slot.selected small { color: rgba(7,19,33,.68); }

.booking-preview-card {
  min-height: 96px;
  margin-top: 18px;
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(14, 36, 60, .96), rgba(9, 27, 47, .94));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.025);
}

.preview-logo {
  width: 64px;
  height: 64px;
  flex: 0 0 auto;
  border-radius: 15px;
}

.preview-copy {
  min-width: 0;
  flex: 1;
}

.preview-copy strong {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-size: 21px;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-copy span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.book-btn { margin-top: 14px; }

/* Matches */
.page-title-row {
  margin: 4px 0 22px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.matches-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.match-card,
.admin-item {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(15, 38, 62, .92), rgba(10, 28, 48, .90));
}

.match-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
}

.match-date {
  min-width: 58px;
  padding: 8px 7px;
  border-radius: 14px;
  color: var(--orange);
  background: var(--orange-soft);
  text-align: center;
}

.match-date strong {
  display: block;
  font-size: 22px;
}

.match-date span {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.match-main {
  min-width: 0;
}

.match-main strong {
  display: block;
  font-size: 17px;
}

.match-main span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.match-delete {
  min-height: 38px;
  padding: 8px 11px;
  border: 1px solid rgba(255,124,118,.25);
  border-radius: 12px;
  color: var(--danger);
  background: var(--danger-soft);
  font-weight: 750;
}

.empty-state {
  padding: 28px 18px;
  border: 1px dashed var(--line-strong);
  border-radius: 18px;
  color: var(--muted);
  text-align: center;
}

/* Alerts */
.notice-card,
.notification-card {
  padding: 18px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.notice-card h3,
.notification-card h3,
.weather-card h3 {
  margin: 0 0 6px;
  font-size: 18px;
}

.notice-icon {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,173,56,.32);
  border-radius: 13px;
  color: var(--orange);
  background: var(--orange-soft);
  font-weight: 950;
}

.notice-icon.bell { font-size: 22px; }

.weather-card {
  margin-top: 14px;
  padding: 18px;
}

.notification-card { margin-top: 14px; }

.card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-title-row > span {
  color: var(--muted);
  font-size: 12px;
}

.weather-row {
  display: grid;
  grid-template-columns: repeat(7, 54px);
  gap: 7px;
  margin-top: 12px;
  padding-bottom: 3px;
  overflow-x: auto;
  scrollbar-width: none;
}

.weather-row::-webkit-scrollbar { display: none; }

.weather-day {
  padding: 9px 5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  border: 1px solid rgba(255,255,255,.045);
  border-radius: 13px;
  background: rgba(255,255,255,.025);
  color: var(--muted);
  font-size: 10px;
  text-transform: capitalize;
}

.weather-day:first-child {
  border-color: rgba(255,173,56,.22);
  background: var(--orange-soft);
}

.weather-emoji { font-size: 19px; }
.weather-temp { color: var(--text); font-size: 9px; white-space: nowrap; }

#openAdminBtn { width: 100%; margin-top: 14px; }

/* Admin */
.admin-card,
.admin-section {
  padding: 18px;
}

.admin-grid {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.admin-action {
  min-height: 54px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--text);
  background: rgba(255,255,255,.025);
  font-weight: 760;
  text-align: left;
}

.admin-action span { color: var(--muted); font-size: 22px; }

.admin-section h3 {
  margin: 0 0 18px;
  font-size: 22px;
}

.admin-input {
  min-height: 50px;
  margin-bottom: 14px;
  padding: 11px 13px;
}

textarea.admin-input {
  min-height: 130px;
  resize: vertical;
}

.admin-two-cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.action-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 8px;
}

.action-row .primary-btn { min-height: 48px; font-size: 16px; }

.admin-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin: 14px 0;
}

.admin-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.admin-item-main {
  min-width: 0;
  flex: 1;
}

.admin-item-main strong,
.admin-item-main span {
  overflow-wrap: anywhere;
}

.admin-item-main span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.admin-item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.admin-small-btn {
  min-height: 34px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  background: rgba(255,255,255,.035);
  font-size: 11px;
  font-weight: 700;
}

.users-scroll { max-height: 58vh; overflow-y: auto; }

/* Bottom nav */
.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 40;
  width: min(100%, 760px);
  min-height: calc(74px + env(safe-area-inset-bottom));
  padding: 7px 10px max(7px, env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid rgba(132,179,226,.15);
  background: rgba(5, 21, 36, .92);
  backdrop-filter: blur(22px) saturate(1.15);
  -webkit-backdrop-filter: blur(22px) saturate(1.15);
  transform: translateX(-50%);
}

.bottom-nav-item {
  position: relative;
  min-height: 60px;
  padding: 5px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: #95a9c5;
  background: transparent;
  font-size: 11px;
  font-weight: 700;
}

.bottom-nav-item.active { color: var(--orange); }

.bottom-nav-item.active::after {
  content: "";
  position: absolute;
  bottom: 0;
  width: 44px;
  height: 3px;
  border-radius: 999px;
  background: var(--orange);
}

.nav-icon { font-size: 22px; line-height: 1; }

/* Desktop */
@media (min-width: 761px) {
  .app-shell {
    border-left: 1px solid rgba(255,255,255,.04);
    border-right: 1px solid rgba(255,255,255,.04);
    box-shadow: 0 0 70px rgba(0,0,0,.18);
  }

  .login-screen { padding-left: 52px; padding-right: 52px; }
  .app-view { padding-left: 34px; padding-right: 34px; }
}

@media (max-width: 520px) {
  .header-brand strong { font-size: 23px; }
  .header-logo { width: 44px; height: 44px; }
  .native-header { min-height: 68px; }
  .header-actions .icon-btn { width: 38px; height: 38px; }
  .change-btn { font-size: 15px; }

  .app-view { padding: 14px 14px 22px; }

  .user-card {
    min-height: 86px;
    padding: 18px 15px;
  }

  .credit-pill {
    min-width: 112px;
    padding: 11px 13px;
    font-size: 14px;
  }

  .field-buttons { gap: 8px; }
  .field-chip { font-size: 14px; min-height: 50px; }
  .time-slot { min-height: 66px; }
  .time-slot strong { font-size: 21px; }
  .primary-btn { min-height: 58px; }
}

@media (max-width: 370px) {
  .header-actions .change-btn { display: none; }
  .date-quick-grid { grid-template-columns: 1fr 1fr 56px; }
  .field-buttons { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .credit-pill { min-width: auto; }
  .user-card h2 { font-size: 27px; }
  .match-card { grid-template-columns: auto 1fr; }
  .match-delete { grid-column: 1 / -1; width: 100%; }
  .admin-two-cols,
  .action-row { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* Mobile refinement: compact booking surface, clear type, thumb-sized controls. */
:root { --radius-xl: 24px; --radius-lg: 20px; --shadow: 0 8px 24px rgba(0,0,0,.13); }
html { scroll-padding-top: 100px; }
body::before { display: none; }
.ui-icon { width: 20px; height: 20px; display: block; flex: none; }
button:focus-visible, a:focus-visible, .calendar-button:focus-within { outline: 3px solid var(--orange); outline-offset: 3px; }
.glass-card { backdrop-filter: none; -webkit-backdrop-filter: none; }
.login-screen { max-width: 500px; margin: auto; }
.login-topline, .selected-establishment, .login-note, #switchBathBtn { display: none; }
.login-hero { padding: 12px 0 16px; }
.login-logo { width: 60px; height: 60px; border-radius: 16px; }
.login-hero h1 { font-size: clamp(26px,7vw,32px); line-height: 1.15; margin-top: 14px; }
.login-hero p { font-size: 16px; margin-top: 10px; }
.login-panel { padding: 18px 16px; }
.input-shell { margin-bottom: 16px; }
.login-gallery { justify-content: center; }
.native-header { min-height: 54px; background: rgba(4,18,31,.96); }
.header-brand strong { font-size: 20px; }
.header-logo { width: 32px; height: 32px; }
.icon-btn, .header-actions .icon-btn, .password-toggle { min-width: 44px; min-height: 44px; }
.app-view { padding: 10px max(12px,env(safe-area-inset-right)) 16px max(12px,env(safe-area-inset-left)); }
.user-card { min-height: 52px; padding: 10px 12px; flex-wrap: wrap; box-shadow: none; }
.user-card h2 { font-size: clamp(20px,5vw,24px); overflow-wrap: anywhere; flex: 1; min-width: 100px; }
.credit-pill { min-width: 0; padding: 7px 10px; font-size: 14px; }
.role-badge { font-size: 12px; }
.booking-section { padding-top: 14px; }
.booking-heading h1, .page-title-row h1 { font-size: clamp(23px,6vw,30px); line-height: 1.12; letter-spacing: -.035em; }
.booking-heading .eyebrow { margin-bottom: 7px; }
.eyebrow { font-size: 12px; }
.date-quick-grid { margin-top: 12px; gap: 6px; }
.date-quick, .calendar-button { min-height: 44px; font-size: 15px; }
.selected-date-label { padding-top: 6px; }
.step-label { margin: 12px 0 6px; font-size: 14px; font-weight: 750; }
.field-buttons { margin-top: 0; grid-template-columns: repeat(auto-fit,minmax(90px,1fr)); }
.field-chip { min-height: 44px; font-size: 14px; overflow-wrap: anywhere; }
.slot-heading { margin: 14px 0 3px; align-items: center; }
.slot-heading h2 { font-size: 15px; letter-spacing: 0; }
.availability-status { margin: 4px 0 8px; min-height: 18px; color: var(--muted); font-size: 14px; }
.time-grid { grid-template-columns: repeat(4,minmax(0,1fr)); gap: 6px; }
.time-slot { min-height: 52px; padding: 7px 4px; border-radius: 11px; }
.time-slot strong { font-size: 18px; font-variant-numeric: tabular-nums; }
.time-slot small { font-size: 12px; }
.time-slot.free { border-color: rgba(71,240,154,.38); background: #0c302f; }
.time-slot.selected { border-color: var(--orange); background: var(--orange); box-shadow: 0 0 0 2px rgba(255,173,56,.2); }
.time-slot.busy, .time-slot.past { opacity: 1; background: #10243a; border-color: #243b54; }
.time-slot.busy small, .time-slot.past small { color: #a3b4c9; }
.booking-dock { position: sticky; bottom: calc(64px + env(safe-area-inset-bottom)); z-index: 20; margin-top: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 18px; background: #0b2035; box-shadow: 0 -6px 24px rgba(0,0,0,.16); }
.booking-preview-card { margin: 0; padding: 0; min-height: 36px; border: 0; border-radius: 0; background: none; box-shadow: none; gap: 10px; }
.preview-logo { width: 32px; height: 32px; border-radius: 10px; }
.preview-copy strong { white-space: normal; overflow-wrap: anywhere; font-size: 14px; line-height: 1.35; }
.preview-copy span { font-size: 14px; line-height: 1.35; margin-top: 3px; }
.book-btn { min-height: 44px; margin-top: 8px; font-size: 15px; box-shadow: none; }
.form-message { font-size: 14px; line-height: 1.45; }
#bookMsg:empty { display: none; }
.bottom-nav { min-height: calc(60px + env(safe-area-inset-bottom)); background: #051524; }
.bottom-nav-item { font-size: 12px; min-height: 44px; gap: 3px; border-radius: 12px; }
.bottom-nav-item.active { background: rgba(255,173,56,.08); }
.bottom-nav-item.active::after { display: none; }
.match-card { grid-template-columns: auto minmax(0,1fr); }
.match-delete { grid-column: 1/-1; min-height: 44px; font-size: 14px; }
.match-main strong { overflow-wrap: anywhere; }
.match-main span, .match-date span { font-size: 14px; line-height: 1.5; }
.empty-state { grid-column: 1/-1; font-size: 16px; line-height: 1.5; }
.empty-state .secondary-btn { margin-top: 14px; }
#notesView { white-space: pre-wrap; overflow-wrap: anywhere; }
.weather-row { grid-template-columns: repeat(7,86px); scroll-snap-type: x proximity; }
.weather-day { font-size: 14px; scroll-snap-align: start; padding: 12px 6px; }
.weather-temp { font-size: 12px; }
.weather-emoji { font-size: 20px; }
.admin-item { flex-wrap: wrap; }
.admin-item-actions { width: 100%; }
.admin-small-btn { min-height: 44px; font-size: 14px; flex: 1; }
.admin-item-main span { font-size: 14px; }
.connection-status { position: sticky; top: 0; z-index: 60; padding: max(10px,env(safe-area-inset-top)) 16px 10px; background: #63341c; color: #fff; text-align: center; font-size: 14px; }
.confirm-dialog { color: var(--text); width: min(100% - 24px,460px); padding: 24px; border: 1px solid var(--line-strong); border-radius: 24px; background: #0c233a; box-shadow: 0 24px 100px #0009; }
.confirm-dialog::backdrop { background: #020b17bb; backdrop-filter: blur(3px); }
.confirm-dialog h2 { font-size: 25px; line-height: 1.2; margin: 10px 0; }
#confirmDetails { white-space: pre-line; line-height: 1.6; color: #c4d3e6; }
.dialog-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 24px; }
.dialog-actions .primary-btn { min-height: 44px; font-size: 15px; }
.sheet-handle { width: 36px; height: 4px; border-radius: 4px; background: #486079; margin: -10px auto 20px; }
body.dialog-open { overflow: hidden; }
@media(max-width:520px) { .confirm-dialog { margin: auto auto max(12px,env(safe-area-inset-bottom)); } }
@media(max-width:359px) { .time-grid { grid-template-columns: repeat(3,minmax(0,1fr)); } .dialog-actions { grid-template-columns: 1fr; } }
@media(max-height:600px) { .booking-dock { position: static; } .login-hero { padding-top: 8px; } }
@media(prefers-reduced-motion:reduce) { html { scroll-behavior: auto; } }

/* Keep space for the task, show the summary only when useful. */
.booking-heading .eyebrow { display: none; }
.native-header { padding-bottom: 5px; padding-top: max(5px,env(safe-area-inset-top)); }
.booking-dock:not(.has-selection):not(:has(#bookMsg:not(:empty))) { display: none; }
.main-app { padding-bottom: calc(74px + env(safe-area-inset-bottom)); }
.field-chip { padding: 6px; border-radius: 11px; }
.date-quick, .calendar-button { border-radius: 12px; }
.time-slot.free { background: #0d292d; border-color: #28504c; }
.time-slot.selected { background: var(--orange); border-color: var(--orange); }
.glass-card, .user-card { border-radius: 16px; }
.page-title-row { margin-bottom: 14px; }
.match-card, .admin-item, .notice-card, .notification-card, .weather-card { padding: 12px; }
.match-date { min-width: 44px; padding: 6px; }
.match-date strong { font-size: 19px; }
.notice-icon { width: 32px; height: 32px; border-radius: 10px; }
.notice-card h3, .notification-card h3, .weather-card h3 { font-size: 16px; }
.weather-row { grid-template-columns: repeat(7,72px); }
.weather-day { padding: 8px 4px; }
@media(min-width:600px) { .time-grid { grid-template-columns: repeat(5,minmax(0,1fr)); } }

/* Ricerca giocatori: schede compatte, contatti solo nella gestione. */
.bottom-nav { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.bottom-nav-item { font-size: 11px; }
.match-actions { grid-column: 1/-1; display: flex; gap: 8px; }
.match-actions > button { flex: 1; width: auto; min-width: 0; }
.players-list { display: grid; gap: 10px; }
#viewPlayers h3 { margin: 20px 0 10px; font-size: 16px; }
.game-card, .join-request-card, .player-request-card { padding: 14px; border: 1px solid rgba(132,179,226,.2); border-radius: 16px; background: #0b2236; overflow-wrap: anywhere; }
.game-card-top, .game-card-footer, .request-card-top, .request-card-footer, .contact-row, .request-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.game-card-footer, .request-card-footer, .contact-row, .request-actions { margin-top: 12px; }
.game-field { font-weight: 700; font-size: 15px; }
.game-date, .modal-help { color: #a9bed0; font-size: 13px; line-height: 1.5; }
.game-time { font-weight: 700; font-size: 18px; }
.game-note, .player-names { margin-top: 8px; font-size: 14px; }
.spots-pill, .request-status { font-size: 12px; border-radius: 8px; padding: 6px 8px; background: #183549; color: #c7dfeb; }
.request-status.accepted { color: #99e3bd; }
.request-status.rejected { color: #ffb3ad; }
.players-dialog { max-height: 85dvh; overflow-y: auto; padding: 20px; }
.players-dialog .field-label { display: block; margin: 14px 0 6px; }
.players-dialog .primary-btn, .players-dialog .btn-book { width: 100%; margin-top: 16px; }
.modal-summary { display: grid; gap: 4px; font-size: 14px; }
.modal-summary span { color: #a9bed0; font-size: 13px; }
.contact-link { display: inline-flex; min-height: 44px; align-items: center; color: #ffb957; }
#manageRequestsList { display: grid; gap: 10px; }
body.modal-open { overflow: hidden; }

/* Community dashboard */
.bottom-nav { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.summary-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; margin:20px 0; }
.summary-grid strong { display:block; font-size:1.7rem; }
.summary-grid span { display:block; font-size:.75rem; color:var(--muted, #aabac9); }
.home-actions { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin:18px 0; }
.wait-row { padding:18px; margin:12px 0; overflow-wrap:anywhere; }
.wait-row .secondary-btn { margin-top:8px; }
.ledger-row { display:flex; justify-content:space-between; gap:12px; padding:12px 0; border-bottom:1px solid #ffffff20; }
.ledger-row small { display:block; opacity:.7; font-size:.75rem; }
.venue-choice { width:100%; padding:22px; text-align:left; }
#closureForm input, #closureForm select { width:100%; box-sizing:border-box; }
#viewHome h1 { font-size:1.7rem; }

#homeSummary { display:block; }
.login-topline { display:flex; }
.selected-establishment { display:flex; }
#switchBathBtn { display:inline-flex; }

/* Venue management and central administration. */
.management-details { margin: 20px 0; border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.management-details > summary { cursor: pointer; font-weight: 700; min-height: 30px; }
.management-details[open] > summary { margin-bottom: 14px; }
.management-details .form-stack { gap: 8px; }
.management-details .helper-text { margin: 0 0 8px; }
.management-details .primary-btn { margin-top: 12px; }
.checkbox-label { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.5; margin: 16px 0; }
.checkbox-label input { width: 20px; height: 20px; margin: 0; flex-shrink: 0; accent-color: var(--orange); }
.agenda-date-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 18px 0; }
.agenda-date-controls > label { grid-column: 1/-1; margin: 0; }
.agenda-date-controls .selected { border-color: var(--orange); color: var(--orange); }
.agenda-card, .venue-management-card { border: 1px solid var(--line); border-radius: 14px; padding: 16px; overflow-wrap: anywhere; background: #0b2236; }
.agenda-card h3, .venue-management-card h3 { margin: 10px 0 6px; font-size: 18px; }
.agenda-card p, .venue-management-card p { margin: 8px 0; font-size: 14px; line-height: 1.5; }
.agenda-card-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; }
.agenda-card-top > strong { font-size: 20px; font-variant-numeric: tabular-nums; }
.venue-management-card .agenda-card-top h3 { margin: 0; }
.agenda-card-top .request-status { flex-shrink: 0; }
.venue-management-card .action-row { margin-top: 14px; }
#adminShell > .page-title-row h1 { font-size: clamp(1.6rem, 6vw, 2rem); overflow-wrap: anywhere; }
#managerHome h2 { font-size: 21px; line-height: 1.3; }
#managerHome .home-actions { margin-bottom: 10px; }
#managerHome .home-actions > button { font-size: 14px; padding: 12px; }
#adminAgenda .page-title-row h2 { font-size: 22px; }
#agendaList { gap: 10px; }
#adminEstablishments h2 { font-size: 24px; }
#adminEstablishments input, #adminUsers input, #adminAgenda input, #adminAgenda select, .players-dialog input, .players-dialog select { box-sizing: border-box; width: 100%; max-width: 100%; min-width: 0; }
.match-actions { flex-wrap: wrap; }
.match-actions > button { flex-basis: 120px; }
@media (max-width: 359px) {
  #managerHome .home-actions { grid-template-columns: 1fr; }
  .summary-grid { gap: 6px; }
  .summary-grid strong { font-size: 1.4rem; }
  .management-details { padding: 10px; }
}

/* Mobile management: clear scope, one main action, navigation always within reach. */
:root { --muted: #b1c3d8; --line: rgba(149,184,218,.21); }
body::before { opacity: .1; }
.main-app { padding-bottom: calc(94px + env(safe-area-inset-bottom)); }
.native-header { position: relative; min-height: 74px; gap: 12px; padding-top: max(12px,env(safe-area-inset-top)); padding-bottom: 14px; border-bottom: 1px solid var(--line); margin-bottom: 20px; background: transparent; }
.header-brand { min-width: 0; gap: 9px; flex: 1; }
.header-brand-copy { min-width: 0; }
.header-brand-copy > strong { display: block; overflow-wrap: anywhere; font-size: 17px; line-height: 1.2; }
.header-role { display: block; color: #c3d0de; font-size: 10px; font-weight: 500; line-height: 1.35; margin-top: 5px; }
.header-actions { flex-shrink: 0; gap: 5px; }
.header-actions .change-btn { min-height: 44px; padding: 8px; font-size: 12px; }
.header-logo { flex-shrink: 0; width: 37px; height: 37px; border-radius: 12px; }
.management-banner { position: sticky; top: 0; z-index: 20; padding: 13px 14px; margin: -5px 0 22px; border: 1px solid #9c7336; border-radius: 14px; background: #172d3d; box-shadow: 0 8px 24px #0004; }
.management-banner > div > span { display: block; color: var(--orange-2); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; font-weight: 750; }
.management-banner strong { display: block; margin: 5px 0 10px; line-height: 1.35; font-size: 15px; overflow-wrap: anywhere; }
.management-banner .secondary-btn { width: 100%; min-height: 44px; background: #0b1d2d; border-color: #637783; font-size: 13px; }
.context-status { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; background: #061525e8; color: #ffd08c; font-size: 18px; padding: 24px; text-align: center; }
.context-changing #app { pointer-events: none; }
.platform-intro { display: flex; align-items: flex-start; gap: 13px; margin-bottom: 18px; }
.platform-mark { display: grid; place-items: center; flex-shrink: 0; width: 40px; height: 40px; border-radius: 12px; font-size: 24px; color: var(--orange); background: var(--orange-soft); }
.platform-intro h2 { margin: 0 0 6px; font-size: 21px !important; }
.platform-intro p { margin: 0; color: var(--muted); line-height: 1.5; font-size: 14px; }
#adminShell > .page-title-row { align-items: flex-start; margin: 4px 0 20px; gap: 10px; }
#adminRoleLabel { font-size: 10px; letter-spacing: .09em; line-height: 1.4; color: var(--orange-2); }
#adminTitle { margin-top: 7px; font-size: clamp(26px,7.5vw,36px) !important; line-height: 1.08; letter-spacing: -.035em; }
#adminMenu, #adminEstablishments { padding: 0; border: 0; background: none; box-shadow: none; backdrop-filter: none; }
.manager-day-card { padding: 20px; border: 1px solid #35536d; border-radius: 20px; background: linear-gradient(125deg,#193c55,#10283d); }
#managerDaySummary { display: grid; gap: 8px; margin-bottom: 18px; }
#managerDaySummary strong { font-size: clamp(24px,6vw,30px); font-weight: 780; line-height: 1.1; letter-spacing: -.02em; }
#managerDaySummary > span { font-size: 13px; color: #c3d4e4; }
#managerDaySummary .mini-label { text-transform: none; font-size: 12px; letter-spacing: 0; }
.manager-day-card .primary-btn { min-height: 48px; width: 100%; font-size: 15px; }
.section-kicker { margin: 28px 0 13px; font-size: 12px; font-weight: 750; color: #c9d7e5; }
.admin-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.admin-action { gap: 8px; padding: 16px 13px; min-height: 105px; background: #0d263b; align-items: flex-start; border-radius: 16px; }
.admin-action .admin-action-copy { display: grid; gap: 8px; min-width: 0; color: var(--text); }
.admin-action-copy strong { font-size: 16px; line-height: 1.25; }
.admin-action-copy small { font-size: 12px; color: var(--muted); font-weight: 400; line-height: 1.4; }
.admin-action > span:last-child { font-size: 18px; line-height: 1.2; color: var(--orange); }
.scope-caption { margin: 22px 0; padding-left: 12px; border-left: 2px solid #557489; color: var(--muted); font-size: 12px; line-height: 1.6; }
.create-establishment { padding: 0; overflow: hidden; border: 1px solid var(--orange); border-radius: 15px; margin: 20px 0; background: #10263a; }
.create-establishment > summary { list-style: none; min-height: 54px; display: flex; align-items: center; justify-content: center; padding: 14px; background: var(--orange); color: #15212d; font-size: 16px; font-weight: 780; }
.create-establishment > summary::-webkit-details-marker { display: none; }
.create-establishment[open] > summary { margin-bottom: 0; }
.create-establishment form { padding: 17px; }
.management-details summary { min-height: 44px; display: flex; align-items: center; }
.venue-management-card { padding: 19px; background: #0e283e; border-radius: 18px; }
.venue-management-card .agenda-card-top h3 { font-size: 21px; letter-spacing: -.02em; flex: 1; }
.venue-management-card > p.muted { font-size: 11px; }
.venue-management-card .manage-venue-btn { grid-column: 1/-1; width: 100%; margin-bottom: 3px; }
.venue-management-card .action-row { margin-top: 20px; gap: 9px; }
.admin-small-btn { min-height: 44px; font-size: 13px; padding: 10px 12px; border-color: #4a657a; }
.admin-item { padding: 16px; border-radius: 14px; background: #0b2236; }
.admin-item-main strong { font-size: 17px; }
.admin-item-main span { font-size: 13px; line-height: 1.5; margin-top: 6px; }
.admin-item-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; width: 100%; }
.admin-item-actions > p { grid-column: 1/-1; }
.users-scroll { max-height: none; overflow: visible; }
.admin-input, .players-dialog input, .players-dialog select, .players-dialog textarea { width: 100%; max-width: 100%; min-width: 0; font-size: 16px; min-height: 48px; }
.field-label { line-height: 1.45; }
.form-stack, .form-stack > *, .admin-two-cols > *, .page-title-row > div, .home-actions > * { min-width: 0; }
.admin-section { padding: 17px; }
.admin-section > h3 { font-size: 24px; letter-spacing: -.02em; }
.admin-section > .backAdmin { width: 100%; margin-top: 15px; }
.admin-section .form-message { font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
#newManagedBookingBtn { width: 100%; min-height: 48px; font-size: 15px; }
.agenda-date-controls { margin: 20px 0 8px; }
.agenda-date-controls > label { font-size: 12px; }
.agenda-date-controls input { margin-top: 7px; }
.agenda-card { border-left: 3px solid #5eb49d; }
.agenda-card:has(.request-status.rejected) { border-left-color: #9d6b71; opacity: .85; }
.agenda-card > .admin-small-btn { margin-top: 10px; width: 100%; color: #ffc0bb; }
.booking-admin-note { padding: 12px; border-radius: 10px; background: #183d45; color: #d5ede7; font-size: 14px; line-height: 1.5; margin: 0 0 8px; }
.manager-nav { position: fixed; z-index: 35; bottom: 0; left: 50%; transform: translateX(-50%); display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 4px; width: min(100%,760px); padding: 9px 10px calc(9px + env(safe-area-inset-bottom)); border-top: 1px solid #345069; background: rgba(7,23,38,.97); box-shadow: 0 -8px 28px #0003; backdrop-filter: blur(18px); }
.manager-nav button { display: grid; align-content: center; justify-items: center; gap: 5px; min-height: 54px; padding: 4px; color: #b9cbdc; background: transparent; font-size: 11px; border-radius: 12px; }
.manager-nav button > span { font-size: 23px; line-height: 1; }
.manager-nav button.active { color: #ffc064; background: #362d25; font-weight: 750; }
.primary-btn, .secondary-btn, .icon-btn, .admin-small-btn { touch-action: manipulation; }
button:focus-visible, summary:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid #ffbe58; outline-offset: 3px; }
.players-dialog { width: calc(100% - 24px); max-width: 480px; max-height: 88dvh; overscroll-behavior: contain; }
.players-dialog .page-title-row { align-items: flex-start; }
.players-dialog .page-title-row h2 { min-width: 0; overflow-wrap: anywhere; font-size: 24px; }
.players-dialog .page-title-row .icon-btn { flex-shrink: 0; }
.primary-btn { font-size: 16px; }
#viewHome .home-actions > button { font-size: 15px; }
#viewHome h2 { font-size: 20px; }
.bottom-nav-item { min-width: 0; font-size: 10px; }
@media(max-width:359px) {
  .main-app { padding-left: 12px; padding-right: 12px; }
  .header-brand-copy > strong { font-size: 15px; }
  .header-logo { width: 32px; height: 32px; }
  .header-actions .change-btn { padding: 5px; font-size: 11px; }
  .header-actions .icon-btn { width: 44px; min-width: 44px; }
  .admin-grid { gap: 8px; }
  .admin-action { padding: 13px 10px; min-height: 104px; }
  .admin-action-copy strong { font-size: 14px; }
  .admin-action-copy small { font-size: 11px; }
  .admin-section { padding: 13px; }
  .manager-day-card { padding: 16px; }
  .home-actions { grid-template-columns: 1fr; }
  .management-banner { padding: 11px; }
}
@media(min-width:600px) {
  .management-banner { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
  .management-banner .secondary-btn { width: auto; flex-shrink: 0; }
  .management-banner strong { margin-bottom: 0; }
  .admin-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  #platformEstablishmentList { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); align-items: start; }
}

/* A phone-sized workspace. Overflow remains reachable for zoom, keyboard and long forms. */
.app-shell { height: 100dvh; min-height: 0; }
.main-app { display: flex; flex-direction: column; height: 100%; min-height: 0; padding: 0; }
.main-app > .app-view { flex: 1 1 auto; min-height: 0; padding: 8px 12px; overflow-y: auto; overscroll-behavior-y: contain; scrollbar-width: thin; }
.native-header { flex: 0 0 auto; min-height: 52px; margin: 0; padding: max(4px,env(safe-area-inset-top)) 12px 4px; gap: 8px; background: #071b2b; }
.header-logo { width: 28px; height: 28px; border-radius: 9px; }
.header-brand { gap: 7px; }
.header-brand-copy > strong { font-size: 15px; line-height: 1.12; }
.header-role { margin-top: 3px; font-size: 9px; line-height: 1.2; }
.header-actions .change-btn { font-size: 11px; padding: 4px; }
.header-actions .icon-btn { width: 44px; height: 44px; border: 0; }
.management-banner { flex: 0 0 auto; position: static; display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0; padding: 3px 12px; min-height: 48px; border: 0; border-bottom: 1px solid #76623f; border-radius: 0; box-shadow: none; background: #23313b; }
.management-banner > div { min-width: 0; }
.management-banner > div > span { font-size: 9px; letter-spacing: .04em; }
.management-banner strong { margin: 2px 0 0; font-size: 12px; line-height: 1.2; }
.management-banner .secondary-btn { flex-shrink: 0; width: auto; min-height: 44px; margin: 0; padding: 7px 10px; font-size: 11px; border: 0; background: #122638; }
.bottom-nav, .manager-nav { position: static; flex: 0 0 auto; left: auto; bottom: auto; transform: none; width: 100%; min-height: calc(50px + env(safe-area-inset-bottom)); margin: 0; padding: 3px 7px calc(3px + env(safe-area-inset-bottom)); gap: 3px; box-shadow: 0 -3px 14px #0002; }
.bottom-nav-item, .manager-nav button { min-height: 44px; padding: 2px; gap: 2px; font-size: 10px; line-height: 1.1; border-radius: 9px; }
.manager-nav button > span, .nav-icon { font-size: 19px; }
.bottom-nav .ui-icon { width: 18px; height: 18px; }
.main-app .primary-btn, .main-app .secondary-btn, .main-app .admin-small-btn { min-height: 44px; padding: 8px 10px; font-size: 13px; border-radius: 11px; box-shadow: none; }
.main-app .icon-btn { width: 44px; height: 44px; min-height: 44px; flex-shrink: 0; }
.page-title-row, #adminShell > .page-title-row { margin: 0 0 8px; gap: 8px; align-items: center; }
.page-title-row h1, #adminTitle { margin: 0; font-size: 23px !important; line-height: 1.1; }
.page-title-row .eyebrow { font-size: 10px; line-height: 1.2; margin: 0 0 3px; }
#adminRoleLabel { display: none; }
.main-app > #adminShell { display: flex; flex-direction: column; }
#adminShell > .page-title-row { flex: 0 0 auto; min-height: 30px; }
#adminShell:has(> #adminMenu.hidden):has(> #adminEstablishments.hidden) > .page-title-row { display: none; }
#adminAgenda > .backAdmin, #adminUsers > .backAdmin { display: none; }
#adminShell > section { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior-y: contain; scrollbar-width: thin; }
#adminMenu { display: flex; flex-direction: column; gap: 8px; }
.manager-day-card { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; padding: 9px 10px; border-radius: 13px; }
#managerDaySummary { flex: 1; min-width: 0; gap: 3px; margin: 0; }
#managerDaySummary strong { font-size: 17px; line-height: 1.15; }
#managerDaySummary > span { font-size: 10px; line-height: 1.3; }
#managerDaySummary .mini-label { font-size: 10px; margin: 0; }
.manager-day-card .primary-btn { flex: 0 0 87px; width: 87px; min-height: 44px; padding: 6px; font-size: 12px; }
.admin-grid { flex: 1 0 auto; grid-template-columns: repeat(2,minmax(0,1fr)); grid-auto-rows: minmax(51px,1fr); gap: 6px; }
.admin-action { min-height: 51px; padding: 8px 10px; gap: 6px; align-items: center; border-radius: 12px; }
.admin-action .admin-action-copy { gap: 4px; }
.admin-action-copy strong { font-size: 13px; line-height: 1.2; }
.admin-action-copy small { font-size: 10px; line-height: 1.25; }
.admin-action > span:last-child { font-size: 17px; }
#adminMenu > [data-personal-account], .compact-account-button { flex: 0 0 auto; min-height: 44px; width: 100%; font-size: 12px; margin: 0; }
.platform-intro { margin: 0 0 8px; }
.platform-intro p { font-size: 12px; line-height: 1.4; }
.management-details { margin: 6px 0; padding: 0 10px; border-radius: 11px; }
.management-details > summary { min-height: 44px; font-size: 13px; }
.management-details[open] { padding-bottom: 10px; }
.create-establishment { padding: 0; margin: 6px 0; overflow: visible; }
.create-establishment > summary { min-height: 44px; font-size: 14px; padding: 10px; border-radius: 10px; }
.create-establishment form { padding: 10px; }
.management-details[open] > summary { margin-bottom: 6px; }
.venue-management-card, .agenda-card, .admin-item, .match-card, .game-card, .join-request-card, .player-request-card { padding: 10px; border-radius: 12px; }
.venue-management-card .agenda-card-top h3 { font-size: 17px; }
.venue-management-card p, .agenda-card p { margin: 4px 0; font-size: 12px; line-height: 1.3; }
.venue-management-card .action-row { margin-top: 8px; gap: 6px; grid-template-columns: minmax(0,1fr) auto; }
.venue-management-card .manage-venue-btn { grid-column: auto; margin: 0; }
.venue-management-card .request-status, .agenda-card .request-status { font-size: 10px; padding: 4px 6px; }
.agenda-card { display: grid; grid-template-columns: minmax(0,1fr) auto; column-gap: 8px; row-gap: 4px; }
.agenda-card-top { gap: 6px; }
.agenda-card > .agenda-card-top { grid-column: 1/-1; }
.agenda-card-top > strong { font-size: 16px; }
.agenda-card h3 { margin: 0 0 3px; font-size: 14px; }
.agenda-card > .admin-small-btn { width: auto; margin: 0; padding: 7px; font-size: 11px; align-self: center; }
.admin-section { padding: 10px; }
.admin-section > h3, #adminAgenda .page-title-row h2 { font-size: 19px; margin: 0 0 7px; }
.admin-section > .muted { margin: 5px 0 8px; font-size: 12px; }
.admin-section > .backAdmin { min-height: 44px; margin-top: 5px; }
.admin-list, .matches-list, .players-list { gap: 7px; margin: 7px 0; }
.admin-item { gap: 7px; }
.admin-item-main strong { font-size: 15px; }
.admin-item-main span { font-size: 11px; margin-top: 3px; }
.admin-item-actions { gap: 6px; }
.main-app .admin-input, .compact-field-select { width: 100%; min-height: 44px; font-size: 16px; padding: 8px 10px; margin-bottom: 7px; border-radius: 10px; }
.main-app .field-label { margin: 3px 0 3px; font-size: 12px; }
.main-app .admin-two-cols, .main-app .action-row { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; }
.main-app .form-message { min-height: 0; margin: 5px 0; font-size: 12px; line-height: 1.35; }
.main-app .form-message:empty, .main-app .muted:empty { display: none; }
.agenda-date-controls { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr) minmax(146px,1.8fr); gap: 5px; margin: 7px 0 4px; }
#adminAgenda .agenda-date-controls > button { padding-left: 6px; padding-right: 6px; }
.agenda-date-controls > label { grid-column: auto; display: flex; align-items: center; margin: 0; min-width: 0; font-size: 11px; }
.agenda-date-controls input { flex: 1; margin: 0; min-width: 0; width: 100%; padding: 5px; font-size: 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
#adminAgenda .page-title-row { margin-bottom: 4px; }
#newManagedBookingBtn { min-height: 44px; height: 44px; }
#adminAgenda .agenda-date-controls > label { margin: 0; }
#adminAgenda #agendaDate { min-height: 44px; height: 44px; margin: 0; }
#agendaField { margin-bottom: 2px; }
.page-hidden { display: none !important; }
.list-pager { display: grid; grid-template-columns: 44px minmax(0,1fr) 44px; gap: 7px; align-items: center; margin: 4px 0; min-height: 44px; }
.list-pager button { min-width: 44px; min-height: 44px; padding: 5px; border: 1px solid #3a566d; border-radius: 10px; background: #132d42; color: var(--text); font-size: 24px; line-height: 1; }
.list-pager button:disabled { opacity: .4; }
.list-pager button.pager-previous, .list-pager button.pager-next { font-size: 24px; line-height: 1; }
.pager-status { font-size: 11px; text-align: center; color: #b6cadc; }
.compact-tabs { display: flex; flex: 0 0 auto; gap: 4px; margin: 7px 0; padding: 3px; border: 1px solid #324c63; border-radius: 12px; background: #081d2e; }
.compact-tabs button { flex: 1; min-width: 0; min-height: 44px; padding: 4px 5px; border-radius: 8px; background: none; color: #b6cadc; font-size: 11px; line-height: 1.2; font-weight: 650; }
.compact-tabs button[aria-selected="true"], .compact-tabs button[aria-pressed="true"], .compact-tabs button.active { background: #253b4b; color: #ffd08a; }
.home-panel { min-width: 0; }
#viewHome > .page-title-row { min-height: 32px; margin-bottom: 4px; }
#homeSummary { padding: 12px; min-height: 0; }
#homeSummary > .eyebrow { margin: 0 0 5px; font-size: 9px; }
#homeSummary h1 { margin: 0; font-size: 22px; line-height: 1.1; }
.summary-grid { gap: 7px; margin: 12px 0 0; }
.summary-grid strong { font-size: 23px; line-height: 1.1; }
.summary-grid span { margin-top: 4px; font-size: 11px; }
.home-actions, #viewHome .home-actions { grid-template-columns: 1fr 1fr; gap: 7px; margin: 7px 0; }
.wait-row { margin: 7px 0; padding: 11px; }
#viewHome h2 { margin: 0 0 6px; font-size: 16px; }
#viewHome p { font-size: 13px; line-height: 1.4; }
#viewHome .secondary-btn { margin-top: 4px; }
#homeOverviewPanel > .wait-row > .secondary-btn { width: 100%; }
#homeNext { margin: 6px 0; }
#managerHome { padding: 8px 10px; }
#managerHome > h2, #managerHome > .muted, #managerHomeRole { display: none; }
#managerHome .home-actions { margin: 0; }
.credit-rules > summary { min-height: 44px; display: flex; align-items: center; font-size: 12px; }
.ledger-row { padding: 8px 0; font-size: 13px; }
.ledger-row small { font-size: 10px; }
#viewPlayers > .page-title-row { margin-bottom: 6px; }
#viewPlayers > .secondary-btn { width: 100%; }
#viewPlayers h3 { font-size: 14px; margin: 6px 0; }
.game-card-top, .game-card-footer, .request-card-footer, .request-actions { gap: 6px; }
.game-card-footer, .request-card-footer, .request-actions { margin-top: 7px; }
.game-field { font-size: 14px; }
.game-time { font-size: 16px; }
.game-note, .player-names { margin-top: 5px; font-size: 12px; }
.game-date { font-size: 11px; }
.match-card { gap: 7px; }
.match-date { min-width: 40px; padding: 5px; }
.match-main strong { font-size: 15px; }
.match-main span, .match-date span { font-size: 12px; line-height: 1.3; }
.match-actions { gap: 6px; }
.main-app .empty-state { margin: 0; padding: 12px; font-size: 13px; }
#viewBook > .user-card { min-height: 30px; margin: 0; padding: 3px 0; background: none; border: 0; }
#viewBook #welcome { display: none; }
#viewBook .credit-pill { margin-left: auto; padding: 4px 8px; font-size: 11px; }
.booking-section { padding-top: 4px; }
.booking-heading h1 { font-size: 21px; margin: 0 0 5px; }
.date-quick-grid { margin-top: 5px; }
.selected-date-label { min-height: 18px; padding: 3px 0 0; font-size: 11px; }
.step-label { display: block; margin: 7px 0 4px; font-size: 12px; }
.field-buttons { gap: 5px; }
.field-chip { min-height: 44px; padding: 6px; font-size: 12px; }
.compact-field-select { display: none; color: var(--text); background: #142f46; border: 1px solid #486079; }
.slot-heading { margin: 6px 0 2px; }
.slot-heading h2 { font-size: 13px; margin: 0; }
.slot-heading > span { font-size: 10px; }
.availability-status { min-height: 16px; margin: 2px 0 5px; font-size: 11px; }
.time-grid { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 5px; }
.time-slot { min-height: 44px; padding: 4px; }
.time-slot strong { font-size: 16px; }
.time-slot small { font-size: 10px; }
.booking-dock { position: static; display: grid; grid-template-columns: minmax(0,1fr) 88px; gap: 7px; align-items: center; margin-top: 5px; padding: 6px; border-radius: 12px; }
.booking-preview-card { min-height: 32px; gap: 5px; }
.preview-logo { display: none; }
.preview-copy strong, .preview-copy span { font-size: 11px; line-height: 1.2; margin: 0; }
.booking-dock .book-btn { margin: 0; min-height: 44px; width: 88px; font-size: 12px; }
#bookMsg { grid-column: 1/-1; }
.booking-dock:not(.has-selection) > .booking-preview-card, .booking-dock:not(.has-selection) > .book-btn { display: none; }
.booking-dock:not(.has-selection) { grid-template-columns: 1fr; }
.notice-card, .notification-card, .weather-card { margin-bottom: 8px; padding: 10px; }
.notice-card h3, .notification-card h3, .weather-card h3 { font-size: 15px; }
.notice-card .muted, .notification-card .muted { font-size: 12px; line-height: 1.4; }
.weather-row { gap: 5px; grid-template-columns: repeat(7,65px); }
.weather-day { padding: 5px 3px; }
.weather-temp { font-size: 10px; }
.confirm-dialog { max-height: calc(100dvh - 24px); padding: 13px; border-radius: 18px; overflow-y: auto; }
.players-dialog { display: flex; flex-direction: column; overflow-y: auto; }
.players-dialog:not([open]) { display: none; }
.players-dialog > .page-title-row { flex: 0 0 auto; margin: 0 0 7px; }
.players-dialog .page-title-row h2 { font-size: 20px; margin: 0; }
#appModalBody { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.players-dialog .field-label { margin: 5px 0 3px; font-size: 12px; }
.players-dialog .admin-two-cols { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.players-dialog input, .players-dialog select { min-height: 44px; margin: 0 0 5px; font-size: 16px; padding: 8px; }
.players-dialog .primary-btn, .players-dialog .secondary-btn { min-height: 44px; font-size: 14px; padding: 9px; margin-top: 7px; }
.players-dialog .helper-text, .booking-admin-note { font-size: 12px; line-height: 1.4; margin: 4px 0; padding: 8px; }
.players-dialog .compact-tabs button { font-size: 11px; }
.dialog-actions { grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 14px; }
.login-screen { height: 100dvh; min-height: 0; overflow-y: auto; padding: max(8px,env(safe-area-inset-top)) 14px max(8px,env(safe-area-inset-bottom)); }
.login-topline { min-height: 44px; }
.text-nav { min-height: 44px; font-size: 13px; }
.login-hero { display: grid; grid-template-columns: 54px minmax(0,1fr); column-gap: 12px; align-items: center; padding: 5px 0 12px; text-align: left; }
.login-logo { grid-row: 1/3; width: 54px; height: 54px; border-radius: 15px; margin: 0; }
.login-hero h1 { font-size: 23px; line-height: 1.1; margin: 0; }
.login-hero p { font-size: 12px; margin: 5px 0 0; }
.login-panel { padding: 12px; border-radius: 15px; }
#loginForm .field-label { font-size: 12px; margin: 0 0 4px; }
#loginForm .input-shell { margin-bottom: 9px; }
#loginForm .input-shell input { min-height: 46px; font-size: 16px; border-radius: 10px; padding-top: 10px; padding-bottom: 10px; }
#loginForm .primary-btn { width: 100%; min-height: 44px; margin: 0; font-size: 15px; padding: 8px; }
#loginForm .helper-text { font-size: 11px; margin: 8px 0 0; line-height: 1.3; }
.login-panel > div.form-stack { display: flex; gap: 6px; margin-top: 8px; }
.login-panel > div.form-stack > button { flex: 1; min-height: 44px; padding: 6px; font-size: 12px; border-radius: 10px; }
.selected-establishment { margin-top: 8px; min-height: 44px; padding: 6px 10px; gap: 8px; border-radius: 11px; }
.selected-establishment .mini-label, .selected-establishment .mini-logo { display: none; }
.selected-establishment .establishment-row strong { font-size: 13px; overflow-wrap: anywhere; }
.selected-establishment .change-btn { min-height: 44px; font-size: 12px; padding: 4px; }
.login-gallery-details { margin-top: 5px; border-radius: 10px; }
.login-gallery-details > summary { min-height: 44px; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 12px; cursor: pointer; }
.login-gallery-details:has(.login-gallery:empty) { display: none; }
.login-gallery { margin-top: 0; padding: 4px 0 8px; }
#establishmentPicker h1 { font-size: 26px; line-height: 1.1; margin: 16px 0 12px; }
#establishmentPicker > .muted { font-size: 13px; }
.venue-choice { min-height: 52px; padding: 12px; font-size: 15px; margin-bottom: 7px; }
@media(max-height:700px) {
  #adminConfig > .muted { display: none; }
  #adminConfig .checkbox-label { margin: 8px 0; }
  .admin-action-copy small { display: none; }
  #fieldButtons, #fieldButtons + .list-pager { display: none; }
  .compact-field-select { display: block; }
  .booking-heading h1 { font-size: 19px; }
  #viewBook > .user-card { min-height: 22px; }
  #homeSummary { padding: 10px; }
  #homeSummary > .eyebrow { display: none; }
  .summary-grid { margin-top: 9px; }
  .summary-grid strong { font-size: 21px; }
  .home-tabs { margin: 6px 0; }
  #viewHome > .page-title-row { min-height: 26px; }
  #viewHome > .page-title-row .icon-btn { height: 44px; }
  .platform-intro { margin-bottom: 5px; }
}
@media(min-height:701px) {
  .admin-action { padding: 12px; }
  .admin-action-copy strong { font-size: 15px; }
  .manager-day-card { padding: 13px; }
  #managerDaySummary strong { font-size: 20px; }
  #managerDaySummary > span { font-size: 11px; }
  .main-app > .app-view { padding: 12px; }
  .compact-field-select { display: none; }
}
@media(min-width:600px) {
  .main-app > .app-view { padding-left: 20px; padding-right: 20px; }
  #platformEstablishmentList { grid-template-columns: 1fr; }
}

/* All ordinary day slots remain visible together, with state available without relying on colour. */
.legal-links { display:flex; justify-content:center; flex-wrap:wrap; gap:16px; margin:6px 0 0; }
.legal-links a { color:#bdccda; font-size:12px; min-height:32px; display:inline-flex; align-items:center; }
#viewBook { position: relative; }
#viewBook > .user-card { position: absolute; top: 6px; right: 12px; min-height: 0; padding: 0; width: auto; z-index: 1; }
#viewBook > .user-card .role-badge { display: none; }
#viewBook .booking-heading h1 { padding-right: 78px; }
#timeGrid { grid-template-columns: repeat(4,minmax(0,1fr)); grid-auto-rows: 36px; gap: 4px; }
#timeGrid.many-times { grid-template-columns: repeat(5,minmax(0,1fr)); }
#timeGrid.few-times { grid-template-columns: repeat(3,minmax(0,1fr)); }
#timeGrid .time-slot { min-width: 0; min-height: 36px; height: 36px; flex-direction: row; gap: 4px; padding: 3px; border-radius: 8px; }
#timeGrid .time-slot strong { font-size: 15px; line-height: 1; font-variant-numeric: tabular-nums; }
#timeGrid.few-times .time-slot strong { font-size: 16px; }
.slot-state-mark { font-size: 12px; line-height: 1; min-width: 7px; }
#timeGrid .time-slot.free .slot-state-mark { color: #8ae3ba; }
#timeGrid .time-slot.busy { color: #d8dfeb; border-color: #796842; background: #302d28; }
#timeGrid .time-slot.busy .slot-state-mark { color: #ffc77b; }
#timeGrid .time-slot.closed { color: #aebac7; border-color: #4c5761; background: #25313c; }
#timeGrid .time-slot.closed .slot-state-mark { color: #c7cbd1; }
#timeGrid .time-slot.selected, #timeGrid .time-slot.selected .slot-state-mark { color: #132435; border-color: #ffbb50; background: #ffb647; }
#timeGrid.extended-times { max-height: 160px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; padding-right: 3px; }
#timeGrid:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
#timeGrid > .empty-state { grid-column: 1/-1; grid-row: auto; min-height: 44px; }
#timeGrid + .list-pager { display: none; }
#availabilityStatus { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 3px 7px; min-height: 16px; margin: 2px 0 5px; font-size: 10px; line-height: 1.3; }
.availability-count { white-space: nowrap; }
.slot-legend { display: inline-flex; align-items: center; gap: 6px; }
.slot-legend > span { white-space: nowrap; }
.slot-legend i { font-style: normal; font-size: 12px; }
.slot-legend .free { color: #8ae3ba; }
.slot-legend .busy { color: #ffc77b; }
.slot-legend .closed { color: #c7cbd1; }
#closureForm .closure-date-row { display: grid; grid-template-columns: 54px minmax(0,1fr); align-items: center; gap: 8px; margin: 3px 0; font-size: 12px; }
#closureForm .closure-date-row input { width: 100%; min-width: 0; height: 44px; min-height: 44px; font-size: 16px; margin: 0; padding: 6px 8px; }
#closureForm .closure-all-day { display: flex; align-items: center; min-height: 36px; gap: 8px; margin: 4px 0; font-size: 13px; }
#closureForm .closure-all-day input[type="checkbox"] { flex: 0 0 20px; width: 20px; height: 20px; min-height: 20px; padding: 0; margin: 0; }
#closureForm #closureTimes { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
#closureForm .closure-hint { margin: 4px 0; padding: 0; font-size: 11px; line-height: 1.35; }
@media(max-width:359px) {
  #timeGrid .time-slot strong { font-size: 14px; }
  #timeGrid .slot-state-mark { font-size: 11px; }
  #timeGrid.many-times .time-slot { gap: 2px; padding: 2px; }
}
@media(min-width:380px) {
  #timeGrid { grid-template-columns: repeat(5,minmax(0,1fr)); grid-auto-rows: 40px; }
  #timeGrid .time-slot { height: 40px; min-height: 40px; }
  #timeGrid.extended-times { max-height: 216px; }
}
@media(max-height:700px) {
  #viewBook .booking-section { padding-top: 0; }
  #viewBook .booking-heading h1 { margin-bottom: 3px; }
  #viewBook .step-label { margin-top: 5px; }
  #viewBook .slot-heading { margin-top: 4px; }
}

/* Keep the app brand distinct from the selected venue on small screens. */
.picker-brand { display: flex; align-items: center; gap: 12px; margin: 12px 0 18px; }
.picker-brand img { flex-shrink: 0; width: 48px; height: 48px; border-radius: 13px; }
.picker-brand strong { font-size: 23px; line-height: 1.15; letter-spacing: -.03em; }
.picker-brand p { margin: 4px 0 0; font-size: 12px; color: var(--muted); }
.header-platform { display: block; color: #bdccda; font-size: 10px; line-height: 1.2; margin-bottom: 2px; }
.selected-establishment .mini-label { display: block; font-size: 10px; line-height: 1.2; margin-bottom: 2px; }

/* iPhone: maintain readable controls while the keyboard reduces the visual viewport. */
@supports (-webkit-touch-callout: none) {
  input,select,textarea { font-size:16px !important; }
  #appModal { max-height:calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 16px); }
}
#appModal { overscroll-behavior:contain; }
@media(max-width:600px) {
  .native-header { padding-left:max(12px,env(safe-area-inset-left)); padding-right:max(12px,env(safe-area-inset-right)); }
  #appModal p { overflow-wrap:anywhere; }
  .form-stack button { min-height:44px; }
}
@media(prefers-reduced-motion:reduce) {
  *,*::before,*::after { scroll-behavior:auto !important; animation-duration:.01ms !important; transition-duration:.01ms !important; }
}

/* Compact mobile entry: one search, venue choices, one manager action. */
#establishmentPicker {
  display:flex;flex-direction:column;gap:16px;
  padding:max(22px,env(safe-area-inset-top)) 20px max(12px,env(safe-area-inset-bottom));
  background:radial-gradient(ellipse at 95% 0%,#20527444,transparent 48%);
}
#establishmentPicker .picker-brand { margin:0;gap:10px;flex-shrink:0; }
#establishmentPicker .picker-brand img { width:42px;height:42px;border-radius:12px; }
#establishmentPicker .picker-brand strong { font-size:20px;letter-spacing:-.04em; }
.brand-edition { font-size:10px;letter-spacing:.03em;vertical-align:middle;color:#9bb8cb;border:1px solid #64869a55;border-radius:5px;padding:3px 4px;margin-left:3px; }
#establishmentPicker .picker-brand p { font-size:12px;margin-top:3px; }
.picker-heading { margin:8px 0 2px; }
#establishmentPicker .picker-heading h1 { font-size:30px;line-height:1.1;letter-spacing:-.045em;margin:0 0 7px; }
.picker-heading p { margin:0;color:#a7bac9;font-size:14px; }
.venue-search-row { display:flex;gap:8px;align-items:center;flex-shrink:0; }
#venueSearch { display:block;min-width:0;flex:1;width:100%;height:48px;min-height:48px;padding:12px;font-size:16px;border-radius:14px;-webkit-appearance:none;appearance:none;background:#10283c;color:#f3f7fb;border:1px solid #8ca6bc44;outline:none;box-shadow:none; }
#venueSearch::placeholder { color:#9bb0c2;opacity:1; }
#venueSearch:focus { border-color:#ffc463;box-shadow:0 0 0 3px #ffc46322; }
#nearbyVenues { flex:0 0 72px;min-height:48px;padding:10px 8px;margin:0;border-radius:14px;font-size:13px;color:#ffce88;background:#ffbc5810;border-color:#ffbc5833; }
#venueSearchStatus { margin:0;font-size:12px;line-height:1.4; }
#venueSearchStatus:empty { display:none; }
.picker-venues { flex:1 0 auto; }
#establishmentList { display:grid;gap:8px; }
#establishmentList .venue-choice { display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:58px;border-radius:16px;padding:11px 14px;margin:0;background:linear-gradient(115deg,#19344a,#10273b);border:1px solid #7c9eb02c;box-shadow:0 2px 0 #ffffff03 inset;text-align:left; }
.venue-copy { min-width:0;display:grid;gap:3px; }
.venue-copy strong { font-size:15px;font-weight:650;overflow-wrap:anywhere;line-height:1.25; }
.venue-copy small { color:#a6bccb;font-size:12px;font-weight:400;overflow-wrap:anywhere; }
.venue-mark { display:grid;place-items:center;width:28px;height:28px;flex-shrink:0;border-radius:50%;background:#bdd9ec0b;color:#adcadd;font-size:18px; }
.public-demo-card { display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:8px 12px;margin:0;padding:14px;border:1px solid #ffbd552d;border-radius:17px;background:linear-gradient(110deg,#22343e,#142938);flex-shrink:0; }
.public-demo-card h2 { font-size:15px;font-weight:700;letter-spacing:-.02em;line-height:1.2;margin:0 0 4px; }
.public-demo-card p { color:#b7c7d1;font-size:12px;line-height:1.4;margin:0; }
.public-demo-card .primary-btn { min-height:44px;width:auto;min-width:82px;padding:10px 12px;border-radius:12px;font-size:13px;box-shadow:none;background:#ffc36b; }
.public-demo-card .public-demo-status { grid-column:1/-1; }
.public-demo-card .public-demo-status:empty { display:none; }
#establishmentPicker .legal-links { margin:0;gap:20px;flex-shrink:0; }
#establishmentPicker .legal-links a { min-height:44px;font-size:11px;color:#9bb0c2;text-decoration:none; }
#establishmentPicker .list-pager { margin:8px 0 0; }
#demoLabButton.trial-clock { background:#17384a;color:#ffcf83;border:1px solid #ffbf5555;min-height:44px;width:100%;font-variant-numeric:tabular-nums; }
#loginBox { padding-left:20px;padding-right:20px; }
#loginBox .login-panel { background:#10263b;border-color:#7c9eb033;box-shadow:none;border-radius:18px;padding:16px; }
#loginBox .login-hero { padding:8px 0 18px; }
#loginBox .selected-establishment { background:#10263b;box-shadow:none;border-color:#7c9eb033; }
@media(max-height:700px) {
  #establishmentPicker { gap:12px;padding-top:max(14px,env(safe-area-inset-top));padding-bottom:max(6px,env(safe-area-inset-bottom)); }
  .picker-heading { margin:2px 0; }
  #establishmentPicker .picker-heading h1 { font-size:28px; }
  #establishmentList .venue-choice { min-height:54px;padding:10px 12px; }
  .public-demo-card { padding:12px; }
  #loginBox .login-hero { padding:4px 0 10px; }
}
@media(max-width:350px) {
  #establishmentPicker,#loginBox { padding-left:14px;padding-right:14px; }
  #establishmentPicker .picker-brand strong { font-size:19px; }
}

/* Safe controls for full-bleed iPhone screens and always-visible venue photos. */
.main-app { padding-left:env(safe-area-inset-left);padding-right:env(safe-area-inset-right); }
.main-app > .native-header { padding-top:calc(env(safe-area-inset-top) + 6px);padding-left:12px;padding-right:12px; }
#demoLabButton { flex:0 0 auto;margin:4px 10px;width:calc(100% - 20px); }
#demoLabButton.trial-clock { width:calc(100% - 20px);font-size:12px; }
#commercialSettingsButton { flex:0 0 auto;min-height:32px;margin:0 10px 4px;font-size:11px;background:transparent;border:0;color:#a9becd; }
#appModal, .confirm-dialog {
  inset-block-start:calc(env(safe-area-inset-top) + 12px);
  inset-block-end:calc(env(safe-area-inset-bottom) + 12px);
  margin:auto;
  max-height:calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 24px);
  max-width:calc(100vw - env(safe-area-inset-left) - env(safe-area-inset-right) - 24px);
}
.venue-gallery-section { flex:0 0 auto;min-width:0; }
.venue-gallery-section[hidden] { display:none; }
.venue-gallery-section .login-gallery { display:flex;justify-content:flex-start;gap:8px;padding:6px 0;margin:0;scroll-snap-type:x mandatory;overscroll-behavior-x:contain; }
.venue-gallery-section .login-gallery-item { margin:0;scroll-snap-align:start; }
.venue-gallery-section .login-gallery img { width:144px;height:90px;border-radius:12px; }
.app-venue-gallery { padding:0 12px; }
.app-venue-gallery .login-gallery img { width:112px;height:64px; }
#loginGalleryDetails { margin:8px 0 0; }
.setup-progress { display:flex;gap:6px;margin:4px 0 18px; }
.setup-progress span { flex:1;padding:8px 4px;text-align:center;border-radius:9px;font-size:12px;color:#9cb6c8;background:#193347; }
.setup-progress .current { background:#ffc36b;color:#112432;font-weight:750; }
.setup-progress .complete { color:#8ce2b7; }
.setup-question { font-size:17px;font-weight:650;margin:0 0 16px;line-height:1.3; }
.demo-setup input,.demo-setup select { width:100%;background:#142e43;color:#eef5fa;border:1px solid #7994aa55;border-radius:10px; }
.setup-field-row { display:grid;grid-template-columns:52px minmax(0,1fr) 44px;align-items:center;gap:7px;margin-top:6px; }
.setup-field-row label { font-size:12px;color:#aec1d0; }
.setup-field-row input,.setup-field-row .secondary-btn { margin:0; }
.setup-hours,.setup-actions { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px; }
.setup-actions { margin-top:14px; }
.setup-actions > :only-child { grid-column:1/-1; }
.setup-note { color:#a9becd;font-size:12px;line-height:1.5; }
.setup-defaults { margin:4px 0 0; }
.setup-skip { width:100%;background:transparent;color:#d1dfeb;min-height:44px;font-size:13px;margin-top:8px; }
.setup-summary { margin:0; }
.setup-summary > div { padding:12px 0;border-bottom:1px solid #809cb633; }
.setup-summary dt { font-size:11px;color:#a9becd;margin-bottom:5px; }
.setup-summary dd { font-size:15px;margin:0;overflow-wrap:anywhere; }
#demoSetupError:empty { display:none; }
@media(max-height:700px) {
  .setup-progress { margin-bottom:12px; }
  .setup-question { margin-bottom:10px; }
  .venue-gallery-section .login-gallery img { height:70px;width:112px; }
  .app-venue-gallery .login-gallery img { height:52px;width:88px; }
}
.setup-summary > div > span { display:block;font-size:11px;color:#a9becd;margin-bottom:5px; }
.setup-summary > div > strong { display:block;font-size:15px;line-height:1.4;overflow-wrap:anywhere; }
.setup-defaults { font-size:11px;line-height:1.5;color:#9bb1c2; }
#establishmentPicker,#loginBox { padding-left:max(20px,env(safe-area-inset-left));padding-right:max(20px,env(safe-area-inset-right)); }
