:root {
  color-scheme: light;
  --bg: #f47421;
  --surface: #ffffff;
  --ink: #17201c;
  --muted: #66726b;
  --line: #dce2dc;
  --green: #f47421;
  --green-soft: #fff0e6;
  --coral: #c9553d;
  --coral-soft: #f8e9e5;
  --focus: #23755a;
  --shadow: 0 12px 34px rgba(23, 32, 28, 0.08);
  font-family: Arial, sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
}

button, input { font: inherit; }
button {
  appearance: none;
  -webkit-appearance: none;
  color: inherit;
}
button:not(:disabled), label:has(input) { cursor: pointer; }
button:focus-visible, input:focus-visible { outline: 3px solid rgba(35, 117, 90, 0.24); outline-offset: 2px; }

svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.topbar {
  height: 112px;
  padding: 0 max(24px, calc((100vw - 1080px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg);
  position: relative;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: white;
  text-decoration: none;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.brand-mark {
  width: 37px;
  height: 37px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: end;
  gap: 3px;
  padding: 8px;
  border-radius: 7px;
  color: white;
  background: var(--ink);
}
.brand-mark span { display: block; background: currentColor; border-radius: 1px; }
.brand-mark span:nth-child(1) { height: 12px; }
.brand-mark span:nth-child(2) { height: 20px; }
.brand-mark span:nth-child(3) { height: 16px; }
.brand strong, .brand small { display: block; line-height: 1.15; }
.brand strong {
  font-size: clamp(24px, 3.2vw, 46px);
  white-space: nowrap;
}
.brand small { margin-top: 3px; color: var(--muted); font-size: 11px; }

.identity-button {
  min-height: 42px;
  padding: 4px 9px 4px 5px;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  font-weight: 600;
}
.identity-button svg { width: 15px; }
.avatar {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: var(--green);
  font-size: 13px;
  text-transform: uppercase;
}

main { width: min(100% - 160px, 1280px); margin: 0 auto 32px; padding: 0 38px 10px; border-radius: 8px; background: var(--surface); }
.resource-switcher {
  width: fit-content;
  margin-top: 30px;
  padding: 4px;
  display: flex;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.72);
}
.resource-button {
  min-height: 38px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 5px;
  color: var(--muted);
  background: transparent;
  font-size: 13px;
  font-weight: 700;
}
.resource-button svg { width: 17px; height: 17px; flex: 0 0 auto; }
.resource-button.active,
.resource-button[aria-pressed="true"] {
  color: white !important;
  background-color: #17201c !important;
  box-shadow: 0 2px 8px rgba(23, 32, 28, 0.16);
}
.date-panel {
  padding: 42px 0 34px;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
}
.eyebrow {
  margin: 0 0 6px;
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}
h1 { margin: 0; color: var(--green); font-size: 52px; font-weight: 300; line-height: 1.08; letter-spacing: 0; white-space: nowrap; }
.timezone-note { margin: 12px 0 0; color: var(--ink); font-size: 20px; font-weight: 600; }
.date-controls { margin-left: auto; display: flex; gap: 8px; }
.icon-button, .today-button, .calendar-button {
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}
.icon-button { width: 42px; }
.today-button { padding: 0 17px; font-weight: 600; }
.calendar-button { min-width: 220px; padding: 0 12px; display: flex; gap: 9px; overflow: hidden; }
.calendar-button svg { flex: 0 0 auto; }
.calendar-button select { min-width: 170px; height: 100%; border: 0; outline: 0; color: var(--ink); background: transparent; cursor: pointer; font-size: 18px; font-weight: 700; }

.schedule {
  margin-bottom: 10px;
  border-top: 1px solid var(--line);
}
.schedule-heading {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.schedule-actions { display: flex; align-items: center; gap: 18px; }
.status-key { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 16px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; }
.status-dot.available { background: var(--green); }
.status-dot.booked { margin-left: 10px; background: #9aa0a3; }
.refresh-button {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 16px;
  font-weight: 600;
}
.export-button {
  min-height: 36px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--green);
  border-radius: 6px;
  color: white;
  background: var(--green);
  font-size: 14px;
  font-weight: 700;
}
.export-button svg { width: 17px; }
.refresh-button svg { width: 16px; }
.refresh-button.loading svg { animation: spin 0.8s linear infinite; }

.booth-grid {
  padding-top: 24px;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 24px;
}
.overview-availability-note {
  margin: 90px 0 8px;
  color: var(--ink);
  font-size: 15px;
  text-align: left;
}
.booth-card:nth-child(1) { grid-area: 1 / 1 / auto / 3; }
.booth-card:nth-child(2) { grid-area: 1 / 3 / auto / 5; }
.booth-card:nth-child(3) { grid-area: 1 / 5 / auto / 7; }
.booth-card:nth-child(4) { grid-area: 2 / 2 / auto / 4; }
.booth-card:nth-child(5) { grid-area: 2 / 4 / auto / 6; }
.booth-card:nth-child(6) { grid-area: 3 / 2 / auto / 4; }
.booth-card:nth-child(7) { grid-area: 3 / 4 / auto / 6; }
.booth-card {
  min-width: 0;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid #e2e2e2;
  background: #f3f3f3;
  animation: reveal 0.34s both;
}
.booth-grid.is-updating .booth-card,
.booth-grid.is-updating .slot-row { animation: none; }
.booth-title {
  min-height: 64px;
  margin: 0;
  padding: 14px 18px;
  display: grid;
  place-items: center;
  color: white;
  background: var(--green);
  font-size: 20px;
  line-height: 1.15;
  text-align: center;
}
.host-section { padding: 12px 14px 14px; }
.host-section + .host-section { border-top: 1px solid #d5d5d5; }
.host-name { margin: 0 0 8px; font-size: 20px; }
.booth-slot {
  min-height: 40px;
  display: grid;
  grid-template-columns: minmax(108px, 1fr) minmax(48px, auto) 62px;
  align-items: center;
  gap: 8px;
  font-size: 16px;
}
.booth-slot-time { font-size: 19px; font-variant-numeric: tabular-nums; }
.booth-slot-status { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; }
.booth-slot.is-booked .booth-slot-status { color: var(--muted); }
.booth-slot .reserve-button, .booth-slot .cancel-button { min-width: 0; width: 58px; height: 30px; padding: 0 5px; justify-self: start; font-size: 16px; }
.booth-slot .cancel-button { width: 62px; }
.booth-slot .reserve-button { border: 1px solid var(--green); color: white !important; background: var(--green) !important; }
.booth-slot .cancel-button { border: 1px solid #b84a38; color: #a43d29 !important; background: white !important; }
.booth-slot .booked-label { padding: 0; color: #9aa0a3; font-weight: 700; text-align: center; }
.booking-details {
  grid-column: 1 / -1;
  margin: 3px 0 8px;
  padding: 8px 10px;
  display: grid;
  gap: 3px;
  border-left: 3px solid var(--green);
  color: var(--muted);
  background: white;
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.booking-details-title { color: var(--ink); font-size: 13px; }

.slot-row {
  min-height: 68px;
  display: grid;
  grid-template-columns: 112px minmax(160px, 1fr) auto;
  align-items: center;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  animation: reveal 0.34s both;
}
.slot-time { font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.slot-local { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; font-weight: 400; }
.slot-status { min-width: 0; display: flex; align-items: center; gap: 11px; }
.slot-status-icon {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
}
.slot-status-icon svg { width: 15px; height: 15px; }
.slot-row.is-available .slot-status-icon { color: var(--green); background: var(--green-soft); }
.slot-row.is-booked .slot-status-icon { color: var(--coral); background: var(--coral-soft); }
.slot-detail { min-width: 0; }
.slot-detail strong, .slot-detail small { display: block; overflow-wrap: anywhere; }
.slot-detail strong { font-size: 14px; font-weight: 600; }
.slot-detail small { margin-top: 2px; color: var(--muted); font-size: 12px; }
.booking-private { margin-top: 5px; display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--muted); font-size: 12px; }
.booking-private b { color: var(--ink); font-weight: 600; }
.booking-private span { min-width: 0; overflow-wrap: anywhere; }
.reserve-button, .cancel-button {
  min-width: 86px;
  height: 36px;
  padding: 0 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
}
.reserve-button { border: 1px solid #1f6b4f; color: white !important; background-color: #1f6b4f !important; }
.cancel-button { border: 1px solid #e0aa9f; color: #a43d29; background: var(--coral-soft); }
.booked-label { padding-right: 4px; color: var(--muted); font-size: 12px; }
button:disabled { cursor: not-allowed; opacity: 0.55; }

.loading-state, .empty-state, .error-state {
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--muted);
  text-align: center;
}
.spinner { width: 17px; height: 17px; border: 2px solid var(--line); border-top-color: var(--green); border-radius: 50%; animation: spin 0.7s linear infinite; }
.error-state { color: #a43d29; }

.appointment-page { min-height: 100vh; padding: 42px 80px 70px; color: var(--ink); background: var(--green); }
.appointment-brand { color: white; font-size: 46px; font-weight: 700; text-align: center; }
.appointment-back { margin: 36px auto 14px; display: block; border: 0; color: white; background: transparent; font-size: 22px; font-weight: 700; }
.appointment-panel { width: min(100%, 980px); margin: 0 auto; padding: 48px 52px; border-radius: 8px; background: white; }
.appointment-panel > h1 { color: var(--green); font-size: 38px; font-weight: 300; white-space: normal; }
.appointment-panel > h2 { margin: 28px 0 24px; color: var(--green); font-size: 34px; font-weight: 300; }
.appointment-summary { margin: 38px 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.appointment-summary div { min-width: 0; border-bottom: 1px solid var(--line); }
.appointment-summary dt, .appointment-summary dd { margin: 0; padding: 11px 12px; font-size: 18px; }
.appointment-summary dt { font-weight: 700; }
.appointment-panel fieldset { margin: 0 0 34px; padding: 0; border: 0; }
.appointment-panel legend { margin-bottom: 20px; font-size: 24px; }
.appointment-panel label:not(.na-option) { margin-bottom: 20px; display: block; }
.appointment-panel label:not(.na-option) > span { margin-bottom: 6px; display: block; font-size: 14px; font-weight: 700; }
.appointment-panel input:not([type="checkbox"]), .appointment-panel textarea { width: 100%; border: 1px solid #cbd3cc; border-radius: 7px; color: var(--ink); background: white; font-size: 16px; }
.appointment-panel input:not([type="checkbox"]) { height: 52px; padding: 0 14px; }
.appointment-panel textarea { min-height: 168px; padding: 15px 18px; resize: vertical; }
.na-option { margin: 8px 0 0; display: flex; align-items: center; gap: 10px; font-size: 18px; }
.na-option input { width: 20px; height: 20px; accent-color: var(--green); }
.appointment-submit { display: flex; justify-content: flex-end; }
.appointment-submit button { min-width: 205px; height: 58px; border: 0; color: white; background: var(--green); font-size: 25px; }


.dialog {
  width: min(92vw, 430px);
  padding: 0;
  border: 0;
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.dialog::backdrop { background: rgba(10, 18, 14, 0.55); backdrop-filter: blur(3px); }
.dialog form { padding: 28px; }
.auth-panel { padding: 28px; }
.auth-panel form { padding: 0; }
.dialog-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: var(--green);
  background: var(--green-soft);
}
.dialog-icon.booking { color: #a43d29; background: var(--coral-soft); }
.dialog h2 { margin: 20px 0 7px; font-size: 22px; }
.dialog p { margin: 0 0 22px; color: var(--muted); font-size: 14px; line-height: 1.55; }
.dialog label { display: block; margin-bottom: 7px; font-size: 13px; font-weight: 700; }
.dialog label span { color: var(--muted); font-weight: 400; }
.dialog input:not([type="hidden"]) {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 1px solid #cbd3cc;
  border-radius: 5px;
  color: var(--ink);
  background: white;
}
.dialog input + label { margin-top: 17px; }
.dialog .product-label { margin-top: 17px; }
.product-select {
  position: relative;
  border: 1px solid #cbd3cc;
  border-radius: 5px;
  background: white;
}
.product-select summary {
  min-height: 44px;
  padding: 11px 38px 11px 12px;
  display: flex;
  align-items: center;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
  overflow-wrap: anywhere;
}
.product-select summary::-webkit-details-marker { display: none; }
.product-select summary::after {
  position: absolute;
  top: 15px;
  right: 14px;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  content: "";
  transform: rotate(45deg);
}
.product-select[open] summary::after { top: 19px; transform: rotate(225deg); }
.product-options {
  max-height: 190px;
  padding: 7px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px;
  border-top: 1px solid var(--line);
  overflow-y: auto;
}
.dialog .product-options label {
  min-height: 36px;
  margin: 0;
  padding: 7px 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 500;
}
.dialog .product-options label:hover { background: var(--green-soft); }
.dialog .product-options input { width: 16px; height: 16px; flex: 0 0 auto; accent-color: var(--green); }
.dialog .form-message { min-height: 20px; margin: 8px 0 0; color: var(--muted); font-size: 12px; }
.dialog .form-message.error { color: #a43d29; }
.dialog-actions { margin-top: 25px; display: flex; justify-content: flex-end; gap: 10px; }
.text-button, .primary-button, .danger-button { height: 40px; padding: 0 17px; border-radius: 6px; font-weight: 700; }
.text-button { border: 1px solid var(--line); background: white; }
.primary-button { border: 0; color: white; background: var(--green); }
.danger-button { border: 1px solid #e0aa9f; color: #a43d29; background: var(--coral-soft); }
.auth-alternative {
  margin-top: 22px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
}
.auth-alternative::before, .auth-alternative::after { height: 1px; flex: 1; content: ""; background: var(--line); }
.admin-signin-button {
  min-height: 40px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 0;
  color: var(--green);
  background: transparent;
  font-weight: 700;
  white-space: nowrap;
}
.admin-signin-button svg { width: 16px; height: 16px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 20;
  max-width: min(90vw, 480px);
  padding: 11px 16px;
  border-radius: 6px;
  color: white;
  background: var(--ink);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translate(-50%, 14px);
  pointer-events: none;
  transition: 180ms ease;
}
.toast.visible { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: #963926; }
footer {
  width: min(100% - 48px, 1480px);
  min-height: 70px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--line);
  color: white;
  font-size: 11px;
}

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes reveal { from { opacity: 0; transform: translateY(5px); } }

@media (max-width: 700px) {
  .topbar { height: 86px; padding: 0 16px; }
  .brand strong { font-size: 20px; }
  .brand { position: static; transform: none; }
  .identity-button { max-width: 150px; }
  #identity-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  main { width: min(100% - 24px, 1080px); padding: 0 14px 20px; }
  .resource-switcher { width: 100%; margin-top: 22px; }
  .resource-button { flex: 1; padding: 0 10px; }
  .date-panel { padding: 26px 0 24px; display: block; }
  h1 { font-size: 24px; }
  .date-controls { margin-top: 24px; }
  .date-controls .today-button { flex: 1; }
  .slot-row { min-height: 76px; grid-template-columns: 76px minmax(0, 1fr) auto; gap: 10px; }
  .slot-time { font-size: 15px; }
  .slot-local { font-size: 10px; }
  .slot-status { gap: 8px; }
  .slot-status-icon { width: 24px; height: 24px; }
  .reserve-button, .cancel-button { min-width: 62px; padding: 0 10px; }
  .booked-label { display: none; }
  .dialog form { padding: 24px; }
  .auth-panel { padding: 24px; }
  .auth-panel form { padding: 0; }
  .auth-panel .dialog-actions { flex-wrap: wrap; }
  footer { width: min(100% - 32px, 1080px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
