:root {
  color-scheme: light;
  --ink: #17212b;
  --muted: #65717e;
  --line: #d7dee5;
  --panel: #ffffff;
  --paper: #f5f8fa;
  --accent: #007f8f;
  --accent-strong: #00606c;
  --danger: #aa2e25;
  --success: #1f7a4d;
  --warning: #9a6700;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: var(--paper);
  overflow-x: hidden;
}

a {
  color: var(--accent-strong);
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px clamp(16px, 4vw, 40px);
  background: #ffffff;
  border-bottom: 1px solid var(--line);
}

.brand {
  color: var(--ink);
  font-size: 1.1rem;
  font-weight: 800;
  text-decoration: none;
}

nav {
  display: flex;
  align-items: center;
  gap: 14px;
}

nav a,
.link-button {
  color: var(--ink);
  font: inherit;
  text-decoration: none;
}

.inline {
  display: inline;
}

.link-button {
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(340px, 480px) minmax(0, 1fr);
  gap: 24px;
  width: min(1360px, calc(100% - 32px));
  margin: 24px auto;
}

.booking-panel,
.calendar-panel,
.confirmation,
.login-form,
.settings-form,
.table-wrap {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.booking-panel,
.confirmation,
.login-form,
.settings-form {
  padding: 24px;
}

.calendar-panel {
  padding: 16px;
  overflow: hidden;
}

.fc {
  max-width: 100%;
}

.fc .fc-toolbar {
  align-items: flex-start;
  gap: 10px;
}

.fc .fc-toolbar-title {
  font-size: clamp(1.05rem, 2vw, 1.45rem);
}

.fc .fc-button {
  min-height: 34px;
  padding: 6px 9px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 800;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

h1 {
  margin: 0 0 12px;
  font-size: clamp(1.8rem, 3vw, 3rem);
  line-height: 1.05;
}

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

.booking-form,
.login-form,
.settings-form {
  display: grid;
  gap: 18px;
}

.booking-form {
  margin-top: 24px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

label {
  display: grid;
  gap: 7px;
  color: #33404d;
  font-size: 0.9rem;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 42px;
  padding: 9px 10px;
  border: 1px solid #b8c4cf;
  border-radius: 6px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
}

.dob-label {
  grid-column: 1 / -1;
}

.dob-selects {
  display: grid;
  grid-template-columns: 2fr 1fr 1.5fr;
  gap: 8px;
}

.dob-selects select {
  width: 100%;
}

fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

legend {
  margin-bottom: 9px;
  color: #33404d;
  font-size: 0.9rem;
  font-weight: 800;
}

.time-picker,
.duration-picker {
  display: grid;
  gap: 12px;
}

.time-slots,
.duration-options {
  display: grid;
  gap: 8px;
}

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

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

.time-slot,
.choice-card span {
  min-height: 42px;
  border: 1px solid #b8c4cf;
  border-radius: 6px;
  background: #ffffff;
  color: var(--ink);
  font-weight: 800;
}

.time-slot {
  padding: 9px 8px;
}

.time-slot:hover,
.time-slot.selected,
.choice-card input:checked + span {
  border-color: var(--accent);
  background: #e8f7f8;
  color: var(--accent-strong);
}

.manual-time,
.custom-duration {
  max-width: 220px;
}

.choice-card {
  display: block;
}

.choice-card input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.choice-card span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 9px 8px;
  text-align: center;
}

button,
.primary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 16px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--accent);
  color: #ffffff;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

button:hover,
.primary-action:hover {
  background: var(--accent-strong);
}

button.danger {
  border-color: var(--danger);
  background: var(--danger);
}

.flash {
  width: min(960px, calc(100% - 32px));
  margin: 14px auto 0;
  padding: 12px 14px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #ffffff;
}

.booking-panel .flash {
  width: 100%;
}

.flash.error {
  border-color: #f0b4ae;
  background: #fff1f0;
  color: #7b2119;
}

.flash.success {
  border-color: #a8d9bf;
  background: #eefaf3;
  color: #155c39;
}

.narrow-shell,
.login-shell,
.admin-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 24px auto;
}

.login-shell,
.narrow-shell {
  width: min(720px, calc(100% - 32px));
}

.notice {
  padding: 12px;
  border-left: 4px solid var(--warning);
  background: #fff8e6;
  color: #674500;
  line-height: 1.5;
}

.details-list {
  display: grid;
  gap: 10px;
  margin: 22px 0;
}

.details-list div {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

dt {
  color: var(--muted);
  font-weight: 800;
}

dd {
  margin: 0;
}

.admin-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.capacity-pill {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1100px;
}

th,
td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 0.9rem;
}

th {
  background: #eef4f7;
  color: #263440;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.actions button {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 0.82rem;
}

.status {
  display: inline-flex;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: capitalize;
}

.status.pending_payment {
  background: #fff8e6;
  color: var(--warning);
}

.status.paid {
  background: #e8f7ee;
  color: var(--success);
}

.status.cancelled,
.status.expired {
  background: #f4f0ef;
  color: #6b4a45;
}

.event-paid {
  background: var(--success) !important;
  border-color: var(--success) !important;
}

.event-pending {
  background: var(--warning) !important;
  border-color: var(--warning) !important;
}

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

.site-footer {
  width: min(1360px, calc(100% - 32px));
  margin: 28px auto;
  color: var(--muted);
  font-size: 0.88rem;
}

@media (max-width: 960px) {
  .app-shell {
    grid-template-columns: 1fr;
    width: min(760px, calc(100% - 28px));
  }

  .booking-panel {
    order: 1;
  }

  .calendar-panel {
    order: 2;
  }
}

@media (max-width: 760px) {
  .time-slots {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .duration-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .fc .fc-toolbar {
    flex-direction: column;
  }

  .fc .fc-toolbar-chunk {
    display: flex;
    flex-wrap: wrap;
    max-width: 100%;
  }

  .table-wrap {
    overflow: visible;
    border: 0;
    background: transparent;
  }

  table,
  thead,
  tbody,
  tr,
  th,
  td {
    display: block;
  }

  table {
    min-width: 0;
  }

  thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  tr {
    margin-bottom: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    overflow: hidden;
  }

  td {
    display: grid;
    grid-template-columns: minmax(120px, 38%) minmax(0, 1fr);
    gap: 12px;
    border-bottom: 1px solid var(--line);
    overflow-wrap: anywhere;
  }

  td::before {
    content: attr(data-label);
    color: var(--muted);
    font-weight: 800;
  }

  td:last-child {
    border-bottom: 0;
  }

  .actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .actions form,
  .actions button {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .site-header,
  .admin-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  nav {
    flex-wrap: wrap;
  }

  .form-grid,
  .details-list div {
    grid-template-columns: 1fr;
  }

  .app-shell,
  .narrow-shell,
  .login-shell,
  .admin-shell,
  .site-footer {
    width: calc(100% - 20px);
    margin-top: 10px;
  }

  .booking-panel,
  .confirmation,
  .login-form,
  .settings-form {
    padding: 16px;
  }

  .calendar-panel {
    padding: 10px;
  }

  h1 {
    font-size: 1.75rem;
  }
}

@media (max-width: 430px) {
  .time-slots,
  .duration-options {
    grid-template-columns: 1fr 1fr;
  }

  td {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .primary-action {
    width: 100%;
  }
}
