:root {
  --bg: #0f1115;
  --surface: #1a1d24;
  --surface-2: #232730;
  --text: #f2f4f7;
  --muted: #9aa3b2;
  --brand: #1f8a5b;
  --brand-press: #176c47;
  --danger: #c2473d;
  --radius: 14px;
}

* { box-sizing: border-box; }

/* hidden must beat the display-setting classes below (.view, .sheet-backdrop, …) */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

main { padding: max(16px, env(safe-area-inset-top)) 16px 40px; max-width: 560px; margin: 0 auto; }
.view { display: flex; flex-direction: column; gap: 14px; }
.muted { color: var(--muted); margin: 0; }
.section-title { font-size: 15px; color: var(--muted); margin: 22px 0 2px; text-transform: uppercase; letter-spacing: 0.6px; }

/* Inputs & buttons — large touch targets */
input[type="date"], input[type="password"], input[type="text"] {
  width: 100%;
  padding: 14px 16px;
  font-size: 16px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--surface-2);
  border-radius: var(--radius);
}
button { font: inherit; cursor: pointer; }

.primary {
  padding: 16px;
  font-size: 17px;
  font-weight: 600;
  color: #fff;
  background: var(--brand);
  border: none;
  border-radius: var(--radius);
  width: 100%;
  transition: background 0.15s, transform 0.05s;
}
.primary:active { background: var(--brand-press); transform: scale(0.99); }
.primary:disabled { opacity: 0.5; }

.link-btn {
  background: none; border: none; color: var(--muted);
  font-size: 22px; padding: 8px 12px; border-radius: 10px;
}
.link-btn:active { background: var(--surface-2); }

/* Tabs */
.tabs { display: flex; gap: 8px; background: var(--surface); padding: 6px; border-radius: var(--radius); }
.tab, .vtab {
  flex: 1; padding: 12px; border: none; border-radius: 10px;
  background: transparent; color: var(--muted); font-weight: 600; font-size: 15px;
}
.tab.active, .vtab.active { background: var(--surface-2); color: var(--text); }

/* Tab panels stack their contents like the parent view. */
.panel { display: flex; flex-direction: column; gap: 14px; }

/* 7-day picker: large day buttons (the club only books today … +6). */
.date-strip { display: flex; gap: 6px; margin-bottom: 4px; }
.day {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 12px 4px; min-height: 64px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--surface-2); border-radius: var(--radius);
  transition: background 0.12s, border-color 0.12s, transform 0.05s;
}
.day:active { transform: scale(0.96); }
.day .day-dow { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.4px; }
.day .day-num { font-size: 20px; font-weight: 700; }
.day.active { background: var(--brand); border-color: var(--brand); }
.day.active .day-dow, .day.active .day-num { color: #fff; }

/* Lists */
.list { display: flex; flex-direction: column; gap: 10px; }
.card {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--surface); border: 1px solid var(--surface-2);
  border-radius: var(--radius); padding: 14px 16px;
}
.card .when { font-weight: 600; }
.card .meta { color: var(--muted); font-size: 14px; }
.card button { padding: 10px 16px; border-radius: 10px; border: none; font-weight: 600; }
.card .book { background: var(--brand); color: #fff; }
.card .cancel { background: transparent; color: var(--danger); border: 1px solid var(--danger); }
.card.full { opacity: 0.55; }

.empty { color: var(--muted); text-align: center; padding: 24px; }

.notice {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  color: var(--muted); text-align: center; padding: 28px 20px;
  border: 1px solid var(--surface-2); border-radius: var(--radius);
  background: var(--surface);
}
.notice-sub { font-size: 13px; opacity: 0.75; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  background: var(--surface-2); color: var(--text);
  padding: 12px 18px; border-radius: 999px; font-size: 14px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.4); max-width: 90vw;
}
.toast.error { background: var(--danger); color: #fff; }

.spinner { text-align: center; color: var(--muted); padding: 24px; }

/* Loading skeleton — same box as a real .card so layout doesn't shift. */
.card.skeleton { pointer-events: none; }
.sk-line { background: var(--surface-2); border-radius: 6px; animation: skpulse 1.2s ease-in-out infinite; }
.sk-when { width: 165px; height: 16px; margin: 3px 0 9px; }
.sk-meta { width: 95px; height: 13px; margin: 3px 0; }
@keyframes skpulse { 0%, 100% { opacity: 0.4; } 50% { opacity: 0.85; } }

/* Slot time rows (grouped) */
.slot-row { cursor: pointer; }
.slot-row .meta { color: var(--muted); font-size: 13px; }
.slot-row .chev { color: var(--muted); font-size: 22px; }

.secondary {
  padding: 16px; font-size: 16px; font-weight: 600;
  color: var(--text); background: var(--surface-2);
  border: none; border-radius: var(--radius); flex: 1;
}

/* Bottom sheet */
.sheet-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.55);
  display: flex; align-items: flex-end; justify-content: center; z-index: 50;
}
.sheet {
  width: 100%; max-width: 560px;
  background: var(--surface); border-radius: 20px 20px 0 0;
  padding: 10px 20px calc(20px + env(safe-area-inset-bottom));
  animation: slideUp 0.18s ease-out;
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.sheet-handle { width: 40px; height: 4px; background: var(--surface-2); border-radius: 2px; margin: 6px auto 14px; }
.sheet h3 { margin: 0 0 16px; }
.field { margin-bottom: 18px; }
.field > label { display: block; color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: 0.6px; margin-bottom: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 10px 16px; border-radius: 999px; border: 1px solid var(--surface-2);
  background: var(--surface-2); color: var(--text); font-size: 15px;
}
.chip.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip:disabled { opacity: 0.35; }
.sheet-actions { display: flex; gap: 10px; margin-top: 6px; }
