:root {
  --bg: #f6f5f2;
  --surface: #ffffff;
  --surface-2: #f0eee9;
  --text: #1c1b19;
  --muted: #6b6862;
  --border: #e3e0d9;
  --accent: #2f5d50;
  --accent-text: #ffffff;
  --accent-soft: #e2ece8;
  --danger: #b3261e;
  --danger-soft: #fbe9e7;
  --radius: 14px;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.04), 0 8px 24px rgb(0 0 0 / 0.06);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141514;
    --surface: #1d1f1e;
    --surface-2: #262928;
    --text: #ecebe7;
    --muted: #a19e97;
    --border: #333735;
    --accent: #7cc4ad;
    --accent-text: #0e1a16;
    --accent-soft: #23362f;
    --danger: #f2a39b;
    --danger-soft: #3a2220;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 8px 24px rgb(0 0 0 / 0.3);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

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

main {
  max-width: 960px;
  margin: 0 auto;
  padding: 48px 16px 64px;
}

header.page { margin-bottom: 28px; }
header.page h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); line-height: 1.15; margin: 0 0 8px; letter-spacing: -0.02em; }
header.page p { margin: 0; color: var(--muted); }
.meta { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 14px; color: var(--muted); font-size: 0.92rem; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.booker { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
.booker > section { padding: 24px; min-width: 0; }
.booker > section + section { border-left: 1px solid var(--border); }
@media (max-width: 720px) {
  .booker { grid-template-columns: 1fr; }
  .booker > section + section { border-left: 0; border-top: 1px solid var(--border); }
}

h2 { font-size: 1.05rem; margin: 0 0 16px; letter-spacing: -0.01em; }

.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cal-head h2 { margin: 0; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.cal-grid .dow { font-size: 0.75rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; padding: 4px 0 8px; }
.day {
  aspect-ratio: 1;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-variant-numeric: tabular-nums;
  cursor: default;
  position: relative;
}
.day.available { background: var(--accent-soft); color: var(--accent); font-weight: 600; cursor: pointer; }
.day.available:hover { outline: 2px solid var(--accent); }
.day.selected { background: var(--accent); color: var(--accent-text); }
.day.today::after { content: ""; position: absolute; bottom: 14%; left: 50%; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: currentColor; }

.icon-btn {
  width: 36px; height: 36px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-size: 1.1rem; cursor: pointer;
}
.icon-btn:disabled { opacity: 0.35; cursor: default; }

.tz { margin-top: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 0.88rem; color: var(--muted); }

.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; max-height: 420px; overflow-y: auto; padding: 2px; }
.slot {
  padding: 10px 8px; border-radius: 10px; border: 1px solid var(--accent);
  background: var(--surface); color: var(--accent); font: inherit; font-weight: 600; cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.slot:hover { background: var(--accent-soft); }
.empty { color: var(--muted); }

form { display: flex; flex-direction: column; gap: 14px; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 0.9rem; font-weight: 600; }
input, textarea, select {
  font: inherit; font-weight: 400; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; width: 100%;
}
input:focus, textarea:focus, select:focus, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
textarea { min-height: 96px; resize: vertical; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border-radius: 10px; border: 1px solid transparent;
  background: var(--accent); color: var(--accent-text); font: inherit; font-weight: 600;
  cursor: pointer; text-decoration: none;
}
.btn:disabled { opacity: 0.6; cursor: progress; }
.btn.secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn.danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }

.link-btn { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; cursor: pointer; text-decoration: underline; }
.picked { padding: 12px 14px; border-radius: 10px; background: var(--surface-2); margin-bottom: 16px; }
.picked strong { display: block; }

.alert { padding: 10px 14px; border-radius: 10px; background: var(--danger-soft); color: var(--danger); font-size: 0.92rem; }
.hidden { display: none !important; }

.confirm { padding: 32px 24px; text-align: center; }
.confirm .check {
  width: 56px; height: 56px; margin: 0 auto 16px; border-radius: 50%;
  display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-size: 1.6rem;
}
.confirm h2 { font-size: 1.4rem; }
.confirm .when { font-size: 1.1rem; font-weight: 600; margin-bottom: 4px; }
.confirm .btn-row { justify-content: center; margin-top: 22px; }
.small { font-size: 0.86rem; color: var(--muted); }
.manage-link { word-break: break-all; }

table { width: 100%; border-collapse: collapse; font-size: 0.94rem; }
th, td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; }
.table-wrap { overflow-x: auto; }
.status-cancelled { color: var(--muted); text-decoration: line-through; }
.notes { white-space: pre-wrap; color: var(--muted); max-width: 320px; }
footer { margin-top: 28px; text-align: center; font-size: 0.85rem; color: var(--muted); }
footer a { color: inherit; }
