:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-raised: #ffffff;
  --surface-soft: #f7f8fa;
  --ink: #1e293b;
  --muted: #64748b;
  --line: #e5e8ec;
  --brand: #6366f1;
  --brand-dark: #4f46e5;
  --brand-soft: #eef0fb;
  --accent: #0ea5e9;
  --gold: #f59e0b;
  --danger: #ef4444;
  --success: #10b981;
  --warning: #f59e0b;
  /* Subtle, neutral elevation — no colored glow. */
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 1px 3px rgba(16, 24, 40, 0.06);
  --shadow-soft: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-hover: 0 4px 12px rgba(16, 24, 40, 0.10);
  --border-radius: 8px;
  --transition: all 0.2s ease;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "DM Sans", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

a {
  color: var(--brand-dark);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

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

button {
  touch-action: manipulation;
}

.site-header {
  position: static;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 14px clamp(18px, 4vw, 48px);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: max-content;
  color: var(--ink);
}

.brand:hover {
  text-decoration: none;
}

.brand-mark {
  display: inline-grid;
  width: 44px;
  height: 44px;
  place-items: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  border-radius: 6px;
  color: white;
  font-weight: 800;
  letter-spacing: 0;
}

.brand strong,
.brand small {
  display: block;
}

.brand small,
.eyebrow,
.category-label,
.clinic-panel p,
.medical-disclaimer {
  color: var(--muted);
}

.top-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  font-weight: 650;
}

.top-nav a {
  border-radius: 999px;
  padding: 8px 10px;
  color: var(--muted);
}

.top-nav a:hover {
  background: var(--surface-soft);
  color: var(--brand-dark);
  text-decoration: none;
}

.header-phone {
  min-width: max-content;
  border-radius: 999px;
  padding: 8px 12px;
  background: #f0f5fa;
  color: var(--accent);
  font-weight: 800;
}

.booking-layout,
.admin-layout {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: clamp(18px, 4vw, 48px);
}

.booking-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 30px;
  align-items: start;
  max-width: 1180px;
}

.admin-layout {
  width: 100%;
  max-width: none;
  display: grid;
  gap: 28px;
}

.booking-panel,
.clinic-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.booking-panel {
  overflow: hidden;
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: clamp(24px, 4vw, 38px);
  background: linear-gradient(180deg, #ffffff 0%, #fcfafd 100%);
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 6px;
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 4vw, 3.1rem);
  line-height: 1.04;
  letter-spacing: 0;
}

h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  font-size: 1.15rem;
}

h3 {
  margin-bottom: 12px;
  font-size: 1rem;
}

.clinic-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.clinic-badges span,
.timezone-pill,
.total-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 6px 10px;
  background: var(--brand-soft);
  border: 1px solid rgba(98, 28, 114, 0.12);
  border-radius: 999px;
  color: var(--brand);
  font-size: 0.85rem;
  font-weight: 750;
}

.form-section {
  padding: clamp(24px, 4vw, 38px);
  border-bottom: 1px solid var(--line);
}

.form-progress-notice {
  margin: clamp(18px, 3vw, 28px) clamp(24px, 4vw, 38px) 0;
  padding: 12px 14px;
  border: 1px solid rgba(98, 28, 114, 0.12);
  border-radius: 8px;
  background: var(--brand-soft);
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 650;
}

#bookingForm,
#serviceRequestForm {
  counter-reset: form-section;
}

#bookingForm > .form-section,
#serviceRequestForm > .form-section {
  counter-increment: form-section;
}

#bookingForm > .form-section > h2::before,
#bookingForm > .form-section .section-heading-row h2::before,
#serviceRequestForm > .form-section > h2::before,
#serviceRequestForm > .form-section .section-heading-row h2::before {
  content: counter(form-section);
  display: inline-grid;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 999px;
  background: var(--brand);
  color: white;
  font-size: 0.82rem;
  font-weight: 850;
}

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

.full-width {
  grid-column: 1 / -1;
}

label {
  display: block;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 600;
}

/* Keep the label text + required asterisk on one line; the control drops below. */
label > input,
label > select,
label > textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
}
label > .date-entry {
  margin-top: 6px;
}
label > .field-hint,
label > .field-helper,
label > small {
  display: block;
  margin-top: 5px;
}

label span[aria-hidden="true"] {
  color: var(--accent);
}

input,
select,
textarea {
  min-height: 48px;
  width: 100%;
  border: 1px solid #d8dce2;
  border-radius: 6px;
  background: white;
  color: var(--ink);
  padding: 11px 12px;
  box-shadow: 0 1px 0 rgba(98, 28, 114, 0.03);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

input:hover,
select:hover,
textarea:hover {
  border-color: rgba(98, 28, 114, 0.35);
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible {
  outline: 3px solid rgba(98, 28, 114, 0.22);
  border-color: var(--brand);
}

textarea {
  min-height: 118px;
  resize: vertical;
}

input[type="file"] {
  padding: 10px;
}

label small {
  color: var(--muted);
  font-weight: 600;
  line-height: 1.35;
}

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

.section-heading-row h2,
.section-heading-row p {
  margin-bottom: 0;
}

.appointment-grid {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 24px;
}

.calendar {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: var(--surface-raised);
  box-shadow: var(--shadow-soft);
}

.calendar-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.icon-button {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--ink);
  cursor: pointer;
  transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.icon-button:hover {
  border-color: var(--brand);
  background: var(--brand);
  color: white;
}

.weekday-row,
.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.weekday-row span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-align: center;
}

.calendar-days {
  margin-top: 8px;
}

.calendar-day {
  aspect-ratio: 1;
  min-width: 0;
  border: 1px solid transparent;
  border-radius: 6px;
  background: white;
  color: var(--ink);
  cursor: pointer;
  font-weight: 700;
  transition: transform 0.12s ease, background-color 0.16s ease, border-color 0.16s ease;
}

.calendar-day:hover:not(:disabled),
.calendar-day.selected {
  border-color: var(--brand);
  background: var(--surface-soft);
  color: var(--brand-dark);
  font-weight: 800;
}

.calendar-day:hover:not(:disabled) {
  transform: translateY(-1px);
}

.calendar-day.selected {
  background: var(--brand);
  color: white;
}

.calendar-day:disabled {
  background: #f0f5fa;
  color: #888;
  cursor: not-allowed;
}

.calendar-day.blank {
  visibility: hidden;
}

.time-panel {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-raised);
}

.slot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 9px;
}

.slot-button {
  min-height: 44px;
  border: 1px solid #d8dce2;
  border-radius: 6px;
  background: white;
  color: var(--ink);
  cursor: pointer;
  font-weight: 760;
  transition: transform 0.12s ease, background-color 0.16s ease, border-color 0.16s ease;
}

.slot-button:hover:not(:disabled),
.slot-button.selected {
  border-color: var(--brand);
  background: var(--brand);
  color: white;
}

.slot-button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.slot-button:disabled {
  background: #f0f5fa;
  color: #888;
  cursor: not-allowed;
}

.waitlist-prompt {
  display: grid;
  grid-column: 1 / -1;
  gap: 8px;
  padding: 14px;
  border: 1px solid rgba(3, 121, 111, 0.22);
  border-radius: 8px;
  background: #f0fdfa;
  color: var(--ink);
}

.waitlist-prompt strong,
.waitlist-prompt span {
  display: block;
}

.waitlist-prompt span {
  color: var(--muted);
  font-weight: 750;
}

.total-pill {
  gap: 8px;
  background: var(--brand-soft);
  border-color: rgba(98, 28, 114, 0.15);
  color: var(--brand);
}

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

.product-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  min-height: 148px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-raised);
  box-shadow: 0 1px 0 rgba(98, 28, 114, 0.03);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.16s ease, background-color 0.16s ease, border-color 0.16s ease;
}

.product-option:hover {
  transform: translateY(-1px);
  border-color: rgba(98, 28, 114, 0.3);
  box-shadow: var(--shadow-soft);
}

.product-option:has(input[type="checkbox"]:checked) {
  border-color: var(--brand);
  background: var(--surface-soft);
  box-shadow: 0 0 0 2px rgba(98, 28, 114, 0.12);
}

.product-option-hidden {
  display: none !important;
}

.product-option-disabled {
  opacity: 0.58;
  cursor: not-allowed;
}

.product-option-disabled:hover {
  transform: none;
  border-color: var(--line);
  box-shadow: none;
}

.product-option input[type="checkbox"] {
  width: 20px;
  min-height: 20px;
  margin-top: 3px;
  accent-color: var(--brand);
}

.product-copy {
  min-width: 0;
}

.product-copy strong,
.product-copy small {
  display: block;
}

.product-copy strong {
  line-height: 1.25;
}

.product-copy small {
  margin-top: 4px;
  color: var(--muted);
  font-weight: 500;
}

.product-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}

.price {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 4px 8px;
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 850;
}

.quantity-control {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.quantity-control input {
  width: 62px;
  min-height: 38px;
  padding: 6px 8px;
}

.payment-methods {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-raised);
}

.request-intro p {
  max-width: 920px;
  margin-bottom: 10px;
  color: var(--muted);
}

.request-intro p:last-child {
  margin-bottom: 0;
}

.notice-band {
  padding: 16px;
  border: 1px solid rgba(5, 150, 105, 0.22);
  border-radius: 8px;
  background: rgba(5, 150, 105, 0.08);
  color: var(--success);
  font-weight: 720;
}

.notice-band.warning {
  border-color: rgba(251, 191, 36, 0.42);
  background: rgba(251, 191, 36, 0.13);
  color: var(--gold);
}

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

.policy-card {
  border: 1px solid rgba(98, 28, 114, 0.12);
  border-radius: 8px;
  padding: 16px;
  background: #fffffc;
  box-shadow: var(--shadow-soft);
}

.policy-card strong {
  display: block;
  margin-bottom: 8px;
  color: var(--brand-dark);
  font-size: 0.98rem;
}

.policy-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.65;
}

.policy-card a {
  color: var(--brand-dark);
  font-weight: 750;
}

.service-product-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-raised);
  box-shadow: var(--shadow-soft);
}

.service-product-card p {
  margin: 4px 0 0;
  color: var(--muted);
}

.radio-row,
.consent-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  line-height: 1.4;
}

.radio-row input,
.consent-row input {
  width: 18px;
  min-height: 18px;
  margin-top: 3px;
  accent-color: var(--brand);
}

.payment-note,
.consent-row {
  color: var(--muted);
}

.consent-row {
  margin: clamp(22px, 4vw, 34px);
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-raised);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  padding: 0 clamp(22px, 4vw, 34px) clamp(22px, 4vw, 34px);
}

.primary-button,
.primary-link-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border: 0;
  border-radius: 6px;
  padding: 10px 18px;
  font-weight: 850;
  cursor: pointer;
}

.primary-button {
  min-width: 150px;
  background: var(--brand);
  color: white;
  box-shadow: 0 10px 20px rgba(98, 28, 114, 0.18);
}

.primary-link-button {
  width: fit-content;
  background: var(--brand);
  color: white;
}

.primary-button:hover,
.primary-link-button:hover {
  background: var(--brand-dark);
  text-decoration: none;
}

.secondary-button {
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
}

.secondary-button:hover {
  border-color: var(--brand);
  color: var(--brand-dark);
}

.danger-button {
  min-height: 46px;
  border: 0;
  border-radius: 6px;
  padding: 10px 18px;
  background: var(--danger);
  color: white;
  font-weight: 850;
  cursor: pointer;
}

.danger-button:hover {
  background: #842626;
}

.manage-actions {
  padding-right: 0;
  padding-left: 0;
}

.manage-summary {
  display: grid;
  gap: 18px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.summary-grid > div {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-raised);
  overflow-wrap: anywhere;
}

.summary-label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.form-message {
  display: none;
  margin: 18px clamp(22px, 4vw, 34px);
  padding: 14px 16px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--surface-raised);
}

.form-message.show {
  display: block;
}

.form-message.success {
  border-color: rgba(5, 150, 105, 0.22);
  background: rgba(5, 150, 105, 0.08);
  color: var(--success);
}

.form-message.error {
  border-color: #e0bbbb;
  background: #fff1f1;
  color: var(--danger);
}

.clinic-panel {
  position: static;
  display: grid;
  gap: 22px;
  padding: 22px;
}

.booking-snapshot {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(98, 28, 114, 0.15);
  border-radius: 8px;
  background: var(--brand-soft);
}

.snapshot-heading,
.snapshot-row {
  display: grid;
  gap: 2px;
}

.snapshot-heading {
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(98, 28, 114, 0.14);
}

.snapshot-heading span,
.snapshot-row span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.snapshot-heading strong {
  font-size: 1.12rem;
}

.snapshot-heading small {
  color: var(--brand-dark);
  font-weight: 800;
}

.snapshot-row strong {
  overflow-wrap: anywhere;
}

.clinic-map {
  display: grid;
  gap: 3px;
  min-height: 170px;
  padding: 18px;
  align-content: end;
  border-radius: 8px;
  color: white;
  background:
    linear-gradient(rgba(98, 28, 114, 0.26), rgba(98, 28, 114, 0.72)),
    url("https://images.unsplash.com/photo-1576091160399-112ba8d25d1d?auto=format&fit=crop&w=900&q=80") center/cover;
}

.clinic-map span {
  color: #fef7ff;
}

address {
  margin-bottom: 12px;
  font-style: normal;
  font-weight: 700;
}

.support-list,
.hours {
  display: grid;
  gap: 8px;
}

.support-list h3,
.hours h3 {
  margin-bottom: 2px;
}

.hours p {
  margin-bottom: 0;
}

.medical-disclaimer {
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 0.9rem;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  padding: 24px;
  color: var(--muted);
}

.admin-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 14px;
  padding: clamp(22px, 4vw, 34px);
  background: var(--surface-raised);
  border-bottom: 1px solid var(--line);
}

.dashboard-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  padding: clamp(22px, 4vw, 34px);
  border-bottom: 1px solid var(--line);
  background: #fcfafd;
}

.metric-card {
  display: grid;
  gap: 4px;
  min-height: 112px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: var(--shadow-soft);
}

.metric-card span,
.metric-card small {
  color: var(--muted);
  font-weight: 750;
}

.metric-card strong {
  font-size: 2rem;
  line-height: 1;
}

/* Removed unused admin nav/card CSS — replaced by .nav-card / .panel-card in the rebuilt admin. */

.slot-control-panel {
  display: grid;
  gap: 16px;
  padding: clamp(22px, 4vw, 34px);
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}

.slot-control-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  align-items: end;
}

.slot-control-actions .compact-field {
  min-width: min(220px, 100%);
}

.slot-control-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.slot-stat {
  display: grid;
  gap: 4px;
  min-height: 86px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-raised);
}

.slot-stat span {
  color: var(--muted);
  font-weight: 800;
}

.slot-stat strong {
  font-size: 1.7rem;
  line-height: 1;
}

.slot-stat.booked {
  border-color: rgba(105, 35, 130, 0.22);
  background: #fbf5ff;
}

.slot-stat.open {
  border-color: rgba(3, 121, 111, 0.22);
  background: #f0fdfa;
}

.slot-stat.unavailable {
  border-color: rgba(100, 116, 139, 0.2);
  background: #f8fafc;
}

.slot-control-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.slot-card {
  display: grid;
  gap: 12px;
  align-content: start;
  min-height: 150px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: var(--shadow-soft);
}

.slot-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.slot-card-header strong {
  font-size: 1.1rem;
}

.slot-card-header span {
  padding: 5px 9px;
  border-radius: 999px;
  background: #eef2f7;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.slot-card.booked {
  border-color: rgba(105, 35, 130, 0.25);
}

.slot-card.booked .slot-card-header span {
  background: #fbf5ff;
  color: var(--brand);
}

.slot-card.open {
  border-color: rgba(4, 107, 210, 0.25);
}

.slot-card.open .slot-card-header span {
  background: var(--accent-soft);
  color: var(--accent);
}

.slot-card.full {
  border-color: rgba(105, 35, 130, 0.25);
  background: #fffaff;
}

.slot-card.full .slot-card-header span {
  background: #fbf5ff;
  color: var(--brand);
}

.slot-card.unavailable {
  background: #f8fafc;
}

.slot-card.closed {
  border-color: rgba(100, 116, 139, 0.24);
  background: #f8fafc;
}

.slot-card.closed .slot-card-header span,
.slot-card.unavailable .slot-card-header span {
  background: #eef2f7;
  color: var(--muted);
}

.slot-card-body {
  display: grid;
  gap: 3px;
}

.slot-booking-list {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.slot-booking-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.slot-admin-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(86px, 110px) auto;
  gap: 10px;
  align-items: end;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.slot-admin-controls label {
  min-width: 0;
}

.empty-panel {
  grid-column: 1 / -1;
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--surface-raised);
  color: var(--muted);
  font-weight: 800;
}

/* Removed unused .system-options / .settings-box accordion CSS — replaced by .panel-card. */

.reminder-box-body {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr) 260px auto;
  align-items: end;
}

.compact-row {
  align-items: end;
}

.admin-settings {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px auto;
  align-items: end;
  gap: 16px;
  padding: clamp(22px, 4vw, 34px);
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}

.email-settings {
  display: grid;
  gap: 18px;
  padding: clamp(22px, 4vw, 34px);
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}

.settings-actions {
  display: flex;
  justify-content: flex-end;
}

.settings-toggle-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 10px;
}

.settings-toggle-grid.compact {
  grid-template-columns: repeat(3, minmax(150px, 1fr));
}

.checkbox-line,
.checkbox-field {
  display: flex;
  align-items: center;
  gap: 10px;
}

.checkbox-line {
  min-height: 52px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-raised);
  color: var(--ink);
  font-weight: 850;
}

.checkbox-line.fit-content {
  width: fit-content;
  max-width: 100%;
}

.checkbox-line input,
.checkbox-field input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--brand);
}

.settings-grid,
.template-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.staff-notification-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-raised);
}

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

.settings-grid .full-width {
  grid-column: 1 / -1;
}

.placeholder-help {
  padding: 12px 14px;
  border: 1px dashed rgba(105, 35, 130, 0.28);
  border-radius: 8px;
  background: #fbf5ff;
  color: var(--muted);
  font-weight: 750;
}

.test-email-row {
  display: grid;
  grid-template-columns: minmax(220px, 360px) auto;
  gap: 12px;
  align-items: end;
}

.developer-settings {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.developer-settings summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  cursor: pointer;
  list-style: none;
}

.developer-settings summary::-webkit-details-marker {
  display: none;
}

.developer-settings summary::after {
  content: "+";
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #fbf5ff;
  color: var(--brand);
  font-weight: 950;
}

.developer-settings[open] summary::after {
  content: "-";
}

.developer-settings summary strong,
.developer-settings summary small {
  display: block;
}

.developer-settings summary small {
  margin-top: 4px;
  color: var(--muted);
  font-weight: 750;
}

.developer-note {
  margin: 0;
  padding: 12px 14px;
  border: 1px dashed rgba(105, 35, 130, 0.28);
  border-radius: 8px;
  background: #fbf5ff;
  color: var(--muted);
  font-weight: 750;
}

.developer-settings-grid,
.developer-settings .test-email-row {
  padding: 0;
}

.schedule-settings {
  display: grid;
  gap: 18px;
  padding: clamp(22px, 4vw, 34px);
  border-bottom: 1px solid var(--line);
  background: var(--surface-raised);
}

.compact-field {
  width: min(220px, 100%);
}

.schedule-days {
  display: grid;
  gap: 10px;
}

.schedule-day-row {
  display: grid;
  gap: 12px;
  align-items: start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.schedule-day-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.schedule-day-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.schedule-day-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
}

.schedule-day-toggle input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--brand);
}

.schedule-ranges {
  display: grid;
  gap: 10px;
}

.schedule-group {
  display: grid;
  gap: 8px;
}

.schedule-group h3 {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
  text-transform: uppercase;
}

.schedule-range-row {
  display: grid;
  grid-template-columns: minmax(120px, 170px) minmax(120px, 170px) auto;
  gap: 10px;
  align-items: end;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
}

.schedule-break-row {
  border-color: rgba(185, 28, 28, 0.16);
  background: #fff8f8;
}

.schedule-range-row label {
  gap: 6px;
}

.schedule-range-row label span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.icon-text-button {
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--danger);
  font-weight: 850;
  cursor: pointer;
}

.icon-text-button:hover {
  border-color: rgba(185, 28, 28, 0.35);
  background: #fff5f5;
}

.schedule-day-row.is-closed {
  background: #f8fafc;
}

.schedule-day-row.is-closed .schedule-ranges {
  opacity: 0.58;
}

.schedule-empty-state,
.schedule-empty-chip {
  color: var(--muted);
  font-weight: 750;
}

.schedule-empty-state {
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.schedule-exceptions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.schedule-exception-card {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.schedule-exception-card h3 {
  margin: 0;
  font-size: 1rem;
}

.schedule-exception-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
}

.schedule-exception-controls.slot-controls {
  grid-template-columns: minmax(130px, 1fr) minmax(120px, 0.8fr) auto;
}

.schedule-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 40px;
  align-items: center;
}

.schedule-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 8px 10px;
  border: 1px solid rgba(105, 35, 130, 0.22);
  border-radius: 999px;
  background: #fbf5ff;
  color: var(--brand);
  font-weight: 850;
  cursor: pointer;
}

.schedule-chip strong {
  color: var(--ink);
}

.schedule-chip:hover {
  border-color: var(--brand);
}

.schedule-actions {
  justify-content: flex-start;
  padding: 0;
}

.admin-settings h2,
.admin-settings p {
  margin-bottom: 0;
}

.inline-control {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-weight: 700;
}

.inline-control input {
  width: 110px;
}

.search-field {
  min-width: min(320px, 100%);
  flex: 1 1 280px;
}

.view-toggle {
  display: inline-flex;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.view-toggle .secondary-button {
  min-height: 40px;
  border-color: transparent;
}

.view-toggle .active {
  background: var(--brand);
  color: white;
}

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

.bookings-table {
  width: 100%;
  min-width: 1320px;
  border-collapse: collapse;
}

.bookings-table th,
.bookings-table td {
  padding: 16px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.bookings-table tbody tr:hover {
  background: #fcfafd;
}

.bookings-table th {
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
}

.bookings-table select {
  min-height: 40px;
}

.notes-input {
  width: 220px;
  min-height: 92px;
  resize: vertical;
  border: 1px solid #d8dce2;
  border-radius: 6px;
  padding: 10px;
  color: var(--ink);
  font: inherit;
}

.timeline-list {
  display: grid;
  gap: 7px;
  min-width: 260px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.timeline-list strong {
  color: var(--ink);
  font-size: 0.82rem;
  text-transform: uppercase;
}

.timeline-item {
  display: grid;
  gap: 2px;
  padding-left: 10px;
  border-left: 3px solid rgba(105, 35, 130, 0.22);
}

.timeline-item span {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 850;
}

.timeline-item small {
  color: var(--ink);
  font-weight: 720;
  line-height: 1.35;
}

.service-builder-list {
  display: grid;
  gap: 14px;
}

.service-builder-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.service-builder-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.service-id-pill {
  padding: 5px 9px;
  border-radius: 999px;
  background: #f1f5f9;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
}

.attachment-cell {
  min-width: 160px;
}

.lead-fields {
  min-width: 240px;
}

.lead-fields summary {
  color: var(--brand);
  cursor: pointer;
  font-weight: 800;
}

.lead-fields dl {
  display: grid;
  gap: 6px;
  margin: 10px 0 0;
}

.lead-fields dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.lead-fields dd {
  margin: 0 0 8px;
  overflow-wrap: anywhere;
}

.admin-calendar {
  padding: clamp(22px, 4vw, 34px);
  background: white;
}

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

.calendar-heading h2 {
  margin-bottom: 0;
}

.calendar-heading span {
  color: var(--muted);
  font-weight: 750;
}

.admin-weekdays,
.admin-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.admin-weekdays span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  text-align: center;
}

.admin-calendar-grid {
  margin-top: 8px;
}

.admin-calendar-day {
  min-height: 150px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-raised);
}

.admin-calendar-day.blank {
  visibility: hidden;
}

.calendar-bookings {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.calendar-booking {
  display: grid;
  gap: 1px;
  padding: 7px;
  border-left: 3px solid var(--brand);
  border-radius: 6px;
  background: white;
  font-size: 0.82rem;
}

.calendar-booking.cancelled {
  border-left-color: var(--danger);
  opacity: 0.68;
}

.calendar-booking.no_show {
  border-left-color: var(--gold);
}

.calendar-booking span,
.calendar-booking small {
  color: var(--muted);
}

.attachment-list,
.attachment-form {
  display: grid;
  gap: 12px;
}

.attachment-list {
  margin-bottom: 16px;
}

.attachment-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-raised);
}

.attachment-chip span {
  color: var(--muted);
  font-weight: 750;
}

.table-actions {
  display: grid;
  gap: 8px;
}

.table-actions select {
  min-height: 38px;
}

.muted {
  color: var(--muted);
}

@media (max-width: 1080px) {
  .booking-layout {
    grid-template-columns: 1fr;
  }

  .clinic-panel {
    position: static;
    grid-template-columns: 1fr 1fr;
  }

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

  .booking-snapshot,
  .medical-disclaimer {
    grid-column: 1 / -1;
  }
}

@media (max-width: 820px) {
  .site-header,
  .panel-heading,
  .section-heading-row,
  .service-product-card {
    align-items: stretch;
    flex-direction: column;
  }

  .top-nav,
  .clinic-badges {
    justify-content: flex-start;
  }

  .clinic-panel {
    grid-template-columns: 1fr;
  }

  .booking-snapshot,
  .medical-disclaimer {
    grid-column: auto;
  }

  .header-phone {
    min-width: 0;
  }

  .form-grid,
  .appointment-grid,
  .summary-grid,
  .admin-settings,
  .dashboard-cards,
  .admin-module-nav,
  .settings-card-grid,
  .slot-control-actions,
  .slot-admin-controls,
  .slot-booking-row,
  .slot-control-stats,
  .slot-control-grid,
  .product-list,
  .settings-box-grid,
  .reminder-box-body,
  .settings-toggle-grid,
  .settings-toggle-grid.compact,
  .settings-grid,
  .template-grid,
  .test-email-row,
  .schedule-exceptions,
  .schedule-range-row,
  .schedule-exception-controls,
  .schedule-exception-controls.slot-controls {
    grid-template-columns: 1fr;
  }

  .schedule-day-header {
    align-items: stretch;
    flex-direction: column;
  }

  .schedule-day-actions {
    justify-content: stretch;
  }

  .schedule-day-actions .secondary-button {
    flex: 1 1 140px;
  }

  .admin-weekdays,
  .admin-calendar-grid {
    grid-template-columns: 1fr;
  }

  .admin-weekdays {
    display: none;
  }

  .admin-calendar-day.blank {
    display: none;
  }
}

@media (max-width: 520px) {
  .site-header {
    position: static;
  }

  .booking-layout,
  .admin-layout {
    padding: 10px;
  }

  .booking-panel,
  .clinic-panel {
    border-radius: 0;
  }

  .form-section,
  .panel-heading {
    padding: 22px 16px;
  }

  .consent-row {
    margin: 18px 16px;
  }

  .form-actions {
    padding: 0 16px 22px;
  }

  .primary-button {
    width: 100%;
  }

  h1 {
    font-size: 2rem;
  }

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

/* Multi-step form styles */
.multi-step-form {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.step-progress {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 24px;
  margin-bottom: 32px;
}

.step-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex: 1;
  text-align: center;
  position: relative;
}

.step-indicator:not(:last-child):after {
  content: "";
  position: absolute;
  top: 12px;
  left: 100%;
  width: 100%;
  height: 2px;
  background: var(--line);
}

.step-indicator.active {
  color: var(--brand);
}

.step-indicator.active:after {
  background: var(--brand);
}

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: var(--brand);
  color: white;
  font-weight: 850;
  font-size: 0.9rem;
}

.step-label {
  font-size: 0.85rem;
  font-weight: 750;
  text-transform: uppercase;
}

.form-step {
  display: none;
  animation: fadeIn 0.3s ease;
}

.form-step.active {
  display: block;
}

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

/* Enhanced booking snapshot */
.booking-snapshot {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(98, 28, 114, 0.15);
  border-radius: 8px;
  background: var(--brand-soft);
  transition: all 0.3s ease;
}

.booking-snapshot:hover {
  box-shadow: 0 4px 12px rgba(98, 28, 114, 0.1);
}

/* Improved loading states */
.loading-state {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--surface-raised);
  border-radius: 8px;
  border: 1px solid var(--line);
}

.loading-spinner {
  width: 24px;
  height: 24px;
  border: 3px solid rgba(98, 28, 114, 0.1);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Success message styling */
.form-message.success {
  border-color: rgba(5, 150, 105, 0.22);
  background: rgba(5, 150, 105, 0.08);
  color: var(--success);
  display: flex;
  align-items: center;
  gap: 10px;
}

.form-message.success::before {
  content: "✓";
  font-weight: bold;
  color: var(--success);
}

/* Error message styling */
.form-message.error {
  border-color: #e0bbbb;
  background: #fff1f1;
  color: var(--danger);
  display: flex;
  align-items: center;
  gap: 10px;
}

.form-message.error::before {
  content: "⚠";
  font-weight: bold;
  color: var(--danger);
}

/* Improved button hover states */
.primary-button:hover,
.primary-link-button:hover,
.secondary-button:hover,
.danger-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(98, 28, 114, 0.15);
}

/* Responsive adjustments for mobile */
@media (max-width: 768px) {
  .step-progress {
    flex-wrap: wrap;
  }
  
  .step-indicator:not(:last-child):after {
    display: none;
  }
  
  .step-indicator {
    flex-basis: 100%;
  }
  
  .multi-step-form {
    gap: 16px;
  }
}

/* Fresh booking-system redesign */
:root {
  --bg: #fffffc;
  --surface: #ffffff;
  --surface-raised: #fffffc;
  --surface-soft: #fef7ff;
  --ink: #1e293b;
  --muted: #4a4a4a;
  --line: #e8e8e8;
  --brand: #621c72;
  --brand-dark: #4e1659;
  --brand-soft: #fef7ff;
  --accent: #046bd2;
  --accent-soft: #f0f5fa;
  --gold: #b7791f;
  --danger: #b42318;
  --success: #087f5b;
  --warning: #b7791f;
  --shadow: 0 18px 45px rgba(98, 28, 114, 0.12);
  --shadow-soft: 0 8px 22px rgba(98, 28, 114, 0.08);
  --shadow-hover: 0 16px 34px rgba(98, 28, 114, 0.14);
  --border-radius: 8px;
}

body {
  background:
    linear-gradient(180deg, #fcfafd 0, var(--bg) 420px),
    var(--bg);
  color: var(--ink);
}

.site-header {
  gap: 18px;
  min-height: 0;
  padding: clamp(6px, 1vw, 10px) clamp(16px, 3vw, 48px);
  border-bottom: 1px solid rgba(98, 28, 114, 0.1);
  background: #ffffff;
  box-shadow: 0 12px 32px rgba(98, 28, 114, 0.08);
}

.brand {
  flex: 0 0 auto;
  gap: 0;
  min-width: auto;
}

.site-logo {
  width: clamp(56px, 8vw, 100px);
  height: auto;
  display: block;
  border-radius: 50%;
}

.brand-mark {
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 10px 22px rgba(98, 28, 114, 0.18);
}

.brand strong {
  letter-spacing: 0;
}

.top-nav {
  align-items: center;
  gap: clamp(16px, 2.2vw, 36px);
  border-radius: 119px;
  padding: clamp(12px, 1.6vw, 20px) clamp(20px, 3.2vw, 52px);
  background: rgba(98, 28, 114, 0.06);
}

.top-nav a {
  border-radius: 119px;
  padding: 0;
  color: var(--ink);
  font-size: 17px;
  font-weight: 600;
}

.top-nav a:hover {
  background: transparent;
  color: var(--brand-dark);
}

.header-phone {
  border: 2px solid var(--brand);
  border-radius: 119px;
  padding: 14px 32px;
  background: var(--brand);
  color: #ffffff;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
}

.header-phone:hover {
  background: #ffffff;
  color: var(--brand);
  text-decoration: none;
}

.booking-layout {
  max-width: 1240px;
  gap: 22px;
  padding-top: clamp(20px, 4vw, 42px);
}

.booking-panel,
.clinic-panel {
  border-color: rgba(98, 28, 114, 0.1);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.panel-heading {
  display: grid;
  grid-template-columns: 1fr;
  justify-items: center;
  gap: 14px;
  padding: clamp(24px, 4vw, 42px) clamp(20px, 4vw, 48px);
  text-align: center;
  background:
    radial-gradient(circle at 50% 0, rgba(98, 28, 114, 0.08), transparent 42%),
    linear-gradient(180deg, #ffffff 0%, #fcfafd 100%);
}

.panel-heading h1 {
  max-width: 720px;
  margin: 0 auto;
  font-size: clamp(2rem, 4vw, 3.15rem);
  line-height: 1.08;
}

.eyebrow {
  color: var(--brand-dark);
  letter-spacing: 0;
}

.panel-heading .eyebrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  margin: 0 0 14px;
  border-radius: 119px;
  padding: 8px 24px;
  background: var(--brand);
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 700;
}

.booking-title-copy {
  max-width: 760px;
}

.booking-title-subcopy {
  max-width: 620px;
  margin: 10px auto 0;
  color: var(--muted);
  font-size: clamp(0.98rem, 1.25vw, 1.08rem);
  line-height: 1.65;
}

.clinic-badges {
  justify-content: center;
  max-width: 820px;
}

.clinic-badges span,
.timezone-pill,
.total-pill {
  border-color: rgba(98, 28, 114, 0.12);
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.multi-step-form {
  gap: 0;
}

.step-progress {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 18px clamp(18px, 4vw, 38px);
  border-bottom: 1px solid var(--line);
  background: #fcfafd;
}

.step-indicator {
  align-items: stretch;
  gap: 7px;
  min-height: 76px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  text-align: left;
  box-shadow: none;
}

.step-indicator:not(:last-child)::after {
  display: none;
}

.step-indicator.active {
  border-color: rgba(98, 28, 114, 0.32);
  background: #fef7ff;
  color: var(--brand-dark);
  box-shadow: inset 0 0 0 1px rgba(98, 28, 114, 0.12);
}

.step-indicator.completed {
  border-color: rgba(4, 107, 210, 0.18);
  background: var(--accent-soft);
}

.step-number {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: #f0f5fa;
  color: var(--ink);
}

.step-indicator.active .step-number {
  background: var(--brand);
  color: #ffffff;
}

.step-indicator.completed .step-number {
  background: var(--accent);
  color: #ffffff;
}

.step-label {
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0;
  line-height: 1.25;
  text-transform: none;
}

.form-progress-notice {
  margin: 0;
  border-width: 0 0 1px;
  border-radius: 0;
  background: #fcfafd;
  color: var(--muted);
}

.form-step {
  background: #ffffff;
}

.form-section {
  padding: clamp(22px, 4vw, 36px);
}

.form-section h2 {
  font-size: 1.05rem;
  letter-spacing: 0;
}

#bookingForm > .form-section > h2::before,
#bookingForm > .form-section .section-heading-row h2::before,
#serviceRequestForm > .form-section > h2::before,
#serviceRequestForm > .form-section .section-heading-row h2::before {
  background: var(--brand);
}

.form-grid {
  gap: 16px;
}

label {
  color: var(--ink);
  font-weight: 600;
}

input,
select,
textarea {
  min-height: 48px;
  border-color: var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: none;
}

input:hover,
select:hover,
textarea:hover {
  border-color: rgba(98, 28, 114, 0.32);
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible {
  outline: 3px solid rgba(98, 28, 114, 0.16);
  border-color: var(--brand);
}

.appointment-grid {
  grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
}

.calendar,
.time-panel,
.payment-methods,
.summary-grid > div,
.product-option,
.service-product-card {
  border-color: var(--line);
  background: #fffffc;
  box-shadow: var(--shadow-soft);
}

.calendar-toolbar strong {
  color: var(--brand-dark);
}

.icon-button,
.calendar-day,
.slot-button,
.secondary-button {
  border-radius: 8px;
}

.calendar-day:hover:not(:disabled),
.calendar-day.selected,
.slot-button:hover:not(:disabled),
.slot-button.selected {
  border-color: var(--brand);
  background: var(--brand);
  color: #ffffff;
}

.slot-grid {
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  align-items: start;
}

.slot-button {
  min-height: 46px;
}

.waitlist-prompt {
  border-color: rgba(4, 107, 210, 0.18);
  background: var(--accent-soft);
}

.product-list {
  grid-template-columns: 1fr;
}

.product-option {
  min-height: auto;
  align-items: start;
}

.product-option:has(input[type="checkbox"]:checked) {
  border-color: var(--brand);
  background: #fef7ff;
  box-shadow: inset 0 0 0 1px rgba(98, 28, 114, 0.12);
}

.price {
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.consent-row {
  border-color: rgba(98, 28, 114, 0.12);
  background: #fcfafd;
}

.form-actions {
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.primary-button,
.primary-link-button,
.secondary-button,
.danger-button {
  border-radius: 8px;
  transition: transform 0.14s ease, box-shadow 0.16s ease, background-color 0.16s ease, border-color 0.16s ease;
}

.primary-button,
.primary-link-button {
  background: var(--brand);
  box-shadow: 0 12px 22px rgba(98, 28, 114, 0.18);
}

.primary-button:hover,
.primary-link-button:hover {
  background: var(--brand-dark);
}

.secondary-button:hover {
  border-color: var(--brand);
  color: var(--brand-dark);
}

.form-message {
  border-radius: 8px;
}

.clinic-panel {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: stretch;
  padding: 18px;
}

.booking-snapshot {
  grid-column: span 2;
  border-color: rgba(98, 28, 114, 0.12);
  background: #fef7ff;
}

.clinic-map {
  min-height: auto;
  background:
    linear-gradient(rgba(98, 28, 114, 0.18), rgba(98, 28, 114, 0.72)),
    url("https://images.unsplash.com/photo-1576091160399-112ba8d25d1d?auto=format&fit=crop&w=900&q=80") center/cover;
}

.support-list,
.hours,
.medical-disclaimer {
  border-left: 1px solid var(--line);
  padding-left: 16px;
}

.site-footer {
  border-top: 1px solid var(--line);
  background: #ffffff;
}

.admin-layout {
  max-width: none;
  gap: 22px;
}

.admin-layout > .booking-panel {
  min-width: 0;
  overflow: hidden;
}

.admin-layout,
.admin-layout section,
.table-wrap,
[data-admin-module-panel] {
  min-width: 0;
  max-width: 100%;
}

.admin-layout {
  overflow-x: hidden;
}

.admin-module-nav {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  background: #fcfafd;
}

.module-card {
  min-height: 130px;
  border-color: var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.module-card:hover {
  border-color: rgba(98, 28, 114, 0.24);
  background: #fef7ff;
}

.module-card.active {
  border-color: var(--brand);
  background: #fef7ff;
  box-shadow: inset 0 0 0 1px rgba(98, 28, 114, 0.12);
}

.module-card.developer-card,
.module-card.developer-card.active {
  background: #f7f4fb;
}

.dashboard-cards {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  background: #fcfafd;
}

.metric-card,
.slot-stat,
.slot-card,
.settings-box,
.settings-nav-card,
.service-builder-card {
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
}

.metric-card strong,
.slot-stat strong {
  color: var(--brand-dark);
}

.admin-filters,
.settings-hub,
.slot-control-panel,
.system-options {
  background: #ffffff;
}

.settings-box summary::after {
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.settings-box-body {
  background: #fffffc;
}

.bookings-table {
  min-width: 1280px;
}

.bookings-table th {
  color: var(--muted);
}

.bookings-table tbody tr:hover {
  background: #fcfafd;
}

.timeline-item {
  border-left-color: rgba(98, 28, 114, 0.24);
}

.service-id-pill {
  background: var(--brand-soft);
  color: var(--brand-dark);
}

@media (max-width: 980px) {
  .panel-heading,
  .section-heading-row,
  .calendar-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .step-progress,
  .admin-module-nav,
  .dashboard-cards,
  .clinic-panel,
  .appointment-grid {
    grid-template-columns: 1fr;
  }

  .booking-snapshot,
  .medical-disclaimer {
    grid-column: auto;
  }

  .support-list,
  .hours,
  .medical-disclaimer {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding-left: 0;
    padding-top: 16px;
  }

  .site-header {
    align-items: center;
    flex-direction: column;
  }

  .top-nav {
    width: 100%;
    justify-content: center;
    gap: 14px 22px;
    padding: 14px 20px;
  }

  .header-phone {
    width: min(100%, 320px);
  }

  .panel-heading {
    align-items: center;
    justify-items: center;
    text-align: center;
  }
}

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

  .top-nav {
    justify-content: center;
    border-radius: 24px;
  }

  .form-grid,
  .policy-grid,
  .settings-grid,
  .template-grid,
  .settings-toggle-grid,
  .settings-toggle-grid.compact,
  .reminder-box-body,
  .settings-card-grid,
  .slot-control-actions,
  .slot-admin-controls,
  .slot-booking-row,
  .slot-control-stats {
    grid-template-columns: 1fr;
  }

  .form-actions {
    flex-direction: column-reverse;
  }

  .primary-button,
  .secondary-button {
    width: 100%;
  }

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

/* One-page booking form mode */
#bookingForm .step-progress,
.step-progress {
  display: none;
}

#bookingForm .form-step,
#bookingForm .form-step.active {
  display: block;
}

#bookingForm .form-step:not([data-step="5"]) > .form-actions {
  display: none;
}

#step5-prev {
  display: none !important;
}

#bookingForm .form-progress-notice {
  margin: 0;
  padding: 14px clamp(22px, 4vw, 36px);
}

#bookingForm .form-step {
  border-bottom: 1px solid var(--line);
}

#bookingForm .form-step:last-child {
  border-bottom: 0;
}

.field-hint,
.section-helper {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.section-helper {
  margin: 8px 0 18px;
  max-width: 680px;
}

.date-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, 0.46fr);
  gap: 10px;
}

.date-picker-input {
  color: var(--muted);
}

@media (max-width: 640px) {
  .date-entry {
    grid-template-columns: 1fr;
  }
}

.settings-back-button {
  width: fit-content;
}

/* Admin responsive refinements */
.admin-module-nav,
.settings-card-grid,
.dashboard-cards {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
}

.settings-box-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr));
}

.settings-box-wide {
  grid-column: 1 / -1;
}

.module-card,
.settings-nav-card,
.metric-card,
.settings-box,
.slot-card,
.service-builder-card,
.schedule-exception-card {
  min-width: 0;
  overflow-wrap: anywhere;
}

.admin-filters > *,
.slot-control-actions > *,
.settings-grid > *,
.template-grid > *,
.schedule-range-row > *,
.schedule-exception-controls > * {
  min-width: 0;
  max-width: 100%;
}

@media (max-width: 900px) {
  .admin-layout {
    padding: clamp(12px, 3vw, 22px);
  }

  .admin-layout .panel-heading,
  .admin-layout .section-heading-row,
  .service-builder-header,
  .schedule-day-header {
    align-items: stretch;
    flex-direction: column;
    justify-items: stretch;
    text-align: left;
  }

  .admin-module-nav,
  .dashboard-cards,
  .settings-hub,
  .slot-control-panel,
  .system-options,
  .admin-filters,
  .service-settings-panel > .section-heading-row,
  .service-settings-panel > .service-builder-list {
    padding: clamp(16px, 4vw, 24px);
  }

  .admin-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
    align-items: stretch;
  }

  .admin-filters .search-field {
    grid-column: 1 / -1;
  }

  .slot-control-actions,
  .schedule-day-actions {
    width: 100%;
    justify-content: stretch;
  }

  .slot-control-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .slot-control-actions .compact-field,
  .compact-field {
    width: 100%;
  }

  .slot-control-actions .primary-button,
  .slot-control-actions .secondary-button,
  .admin-filters > button,
  .view-toggle {
    width: 100%;
  }

  .view-toggle {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .clinic-badges {
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .admin-layout {
    padding: 8px;
  }

  .admin-module-nav,
  .settings-card-grid,
  .dashboard-cards,
  .settings-box-grid,
  .slot-control-stats,
  .slot-control-grid,
  .settings-grid,
  .template-grid,
  .settings-toggle-grid,
  .settings-toggle-grid.compact,
  .reminder-box-body,
  .schedule-exceptions,
  .schedule-range-row,
  .schedule-exception-controls,
  .schedule-exception-controls.slot-controls,
  .slot-admin-controls,
  .test-email-row {
    grid-template-columns: 1fr;
  }

  .module-card,
  .settings-nav-card {
    min-height: auto;
    padding: 16px;
  }

  .slot-card-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .slot-admin-controls .primary-button,
  .slot-admin-controls .secondary-button,
  .slot-admin-controls input,
  .slot-admin-controls select,
  .schedule-exception-controls input,
  .schedule-exception-controls select,
  .schedule-exception-controls button {
    width: 100%;
  }

  .settings-back-button {
    width: fit-content;
  }
}

/* =========================================================
   Admin clean rebuild (card menu -> one page at a time)
   ========================================================= */
.admin-shell {
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px 20px 90px;
}

.admin-toast {
  position: sticky;
  top: 12px;
  z-index: 50;
  margin: 0 0 18px;
  box-shadow: var(--shadow-soft);
}
.admin-toast:not(.show) {
  display: none;
}

.admin-page {
  animation: adminPageFade 0.25s ease;
}
@keyframes adminPageFade {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* Home */
.home-hero {
  margin-bottom: 22px;
}
.home-hero h1 {
  margin: 6px 0 6px;
  font-size: clamp(26px, 4vw, 32px);
}
.page-sub {
  margin: 0;
  color: var(--muted);
  max-width: 62ch;
  font-size: 15px;
}
.admin-home .dashboard-cards {
  margin: 0 0 26px;
}

.nav-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(225px, 1fr));
  gap: 16px;
}
.nav-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  text-align: left;
  padding: 22px 20px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.nav-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  border-color: var(--brand);
}
.nav-card:focus-visible {
  outline: 3px solid var(--brand-soft);
  outline-offset: 2px;
}
.nav-card.active {
  border-color: var(--brand);
}
.nav-card-icon {
  font-size: 24px;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  background: var(--brand-soft);
  border-radius: 14px;
  margin-bottom: 8px;
}
.nav-card strong {
  font-size: 16.5px;
  color: var(--ink);
}
.nav-card-sub {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.45;
}
.nav-card-tech .nav-card-icon {
  background: #eef2f7;
}

/* Page header with back button */
.page-top {
  margin-bottom: 20px;
}
.back-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: var(--brand-dark);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  padding: 6px 0;
  margin-bottom: 8px;
}
.back-button:hover {
  text-decoration: underline;
}
.page-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}
.page-title-row h1 {
  margin: 2px 0 6px;
  font-size: clamp(22px, 3vw, 27px);
}

/* Plain form section card (replaces accordions) */
.panel-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-soft);
  margin-bottom: 18px;
  overflow: hidden;
}
.panel-card-head {
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}
.panel-card-head h3 {
  margin: 0 0 3px;
  font-size: 17px;
  color: var(--ink);
}
.panel-card-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13.5px;
}
.panel-card-body {
  padding: 22px;
}

@media (max-width: 640px) {
  .admin-shell {
    padding: 20px 14px 70px;
  }
  .nav-card-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
  }
  .nav-card {
    padding: 18px 16px;
  }
  .panel-card-body {
    padding: 18px 16px;
  }
}

/* Out-of-Alberta booking notice (shown instead of the calendar) */
.out-of-province-notice {
  display: grid;
  gap: 8px;
  padding: 22px 24px;
  border: 1px solid var(--brand-soft);
  border-left: 4px solid var(--brand);
  border-radius: 12px;
  background: var(--surface-soft);
}
.out-of-province-notice strong {
  font-size: 1.05rem;
  color: var(--brand-dark);
}
.out-of-province-notice p {
  margin: 0;
  color: var(--ink);
  line-height: 1.55;
}

/* Callback request pill in the admin bookings table */
.callback-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--gold);
  color: #ffffff;
  font-size: 0.78rem;
}

/* =========================================================================
   Reason for visit field (booking form, step 3)
   ========================================================================= */
.visit-reason-field {
  margin-top: 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.visit-reason-field label {
  font-weight: 600;
  color: var(--ink);
  font-size: 0.95rem;
}
.required-asterisk {
  color: var(--danger);
  margin-left: 2px;
}
.visit-reason-field textarea {
  width: 100%;
  min-height: 96px;
  resize: vertical;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  transition: var(--transition);
}
.visit-reason-field textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18);
}
.visit-reason-field .field-helper {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
}
/* Reason shown in the admin bookings table */
.visit-reason-cell {
  margin-top: 6px;
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--ink);
}

/* =========================================================================
   Clinic panel + footer redesign (overrides earlier conflicting rules)
   ========================================================================= */
.clinic-panel {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: clamp(20px, 3vw, 32px);
  grid-template-columns: none; /* cancel the old 4-col grid */
}
.clinic-panel .booking-snapshot {
  grid-column: auto;
}

.clinic-info {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.clinic-info-head h2 {
  margin: 0 0 4px;
  font-size: clamp(1.3rem, 2.4vw, 1.6rem);
  color: var(--ink);
  letter-spacing: -0.01em;
}
.clinic-info-head p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.clinic-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 20px;
  box-shadow: var(--shadow-soft);
}

/* Location card with map banner */
.clinic-location {
  padding: 0;
  overflow: hidden;
}
.clinic-map {
  position: relative;
  min-height: 150px;
  border-radius: 0;
  background:
    linear-gradient(150deg, rgba(79, 70, 229, 0.35), rgba(14, 165, 233, 0.55)),
    url("https://images.unsplash.com/photo-1576091160399-112ba8d25d1d?auto=format&fit=crop&w=900&q=80") center/cover;
  display: flex;
  align-items: flex-end;
}
.clinic-map-overlay {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 16px 20px;
  color: #ffffff;
  text-shadow: 0 1px 6px rgba(15, 23, 42, 0.45);
}
.clinic-map-overlay strong {
  font-size: 1.15rem;
  font-weight: 700;
}
.clinic-rating {
  font-size: 0.85rem;
  font-weight: 600;
  color: #fde68a;
}
.clinic-location-body {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  padding: 16px 20px;
}
.clinic-location-body address {
  font-style: normal;
  color: var(--ink);
  line-height: 1.5;
  font-size: 0.95rem;
  margin: 0;
  border: 0;
  padding: 0;
}
.clinic-directions {
  font-weight: 600;
  color: var(--brand-dark);
  white-space: nowrap;
}
.clinic-directions:hover {
  text-decoration: underline;
}

/* Support + hours: responsive auto-fit grid (no media queries needed) */
.clinic-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.clinic-card h3 {
  margin: 0 0 12px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.clinic-contact {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.clinic-contact li {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.clinic-contact-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.clinic-contact a {
  font-weight: 600;
  color: var(--ink);
  word-break: break-word;
}
.clinic-contact a:hover {
  color: var(--brand-dark);
}
.clinic-hours {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.clinic-hours > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--line);
}
.clinic-hours > div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}
.clinic-hours dt {
  font-weight: 600;
  color: var(--ink);
  font-size: 0.9rem;
}
.clinic-hours dd {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}
.clinic-hours-closed dd {
  color: var(--danger);
  font-weight: 600;
}

.medical-disclaimer {
  margin: 0;
  padding: 14px 16px;
  border: 0;
  border-left: 3px solid var(--gold);
  border-radius: 10px;
  background: #fffbeb;
  color: #78350f;
  font-size: 0.82rem;
  line-height: 1.55;
}
.medical-disclaimer a {
  color: #b45309;
  font-weight: 700;
}

/* Footer */
.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 22px;
  padding: 22px clamp(20px, 4vw, 40px);
  margin-top: 28px;
  border-top: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.88rem;
}
.site-footer span {
  margin-right: auto;
}
.site-footer a {
  color: var(--muted);
  font-weight: 600;
  transition: var(--transition);
}
.site-footer a:hover {
  color: var(--brand-dark);
  text-decoration: none;
}

@media (max-width: 560px) {
  .clinic-location-body {
    flex-direction: column;
    align-items: flex-start;
  }
  .site-footer {
    flex-direction: column;
    align-items: flex-start;
  }
  .site-footer span {
    margin-right: 0;
  }
}

/* Hamburger menu button — hidden on desktop, shown in the mobile block below */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  cursor: pointer;
}
.nav-toggle:focus-visible {
  outline: 3px solid rgba(99, 102, 241, 0.35);
}
.nav-toggle-bar {
  display: block;
  width: 20px;
  height: 2px;
  margin: 0 auto;
  border-radius: 2px;
  background: var(--ink);
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.site-header.nav-open .nav-toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.site-header.nav-open .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}
.site-header.nav-open .nav-toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* =========================================================================
   Mobile polish (<= 640px): tighter header, stacked hero, compact form.
   Appended last so it wins over earlier conflicting media rules.
   ========================================================================= */
@media (max-width: 640px) {
  /* --- Header: logo on the left, hamburger on the right; nav + CTA drop
         into a panel below when the menu is open. --- */
  .site-header {
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px 16px;
  }
  .brand { order: 1; }
  .nav-toggle {
    order: 2;
    display: inline-flex;
    margin-left: auto;
  }
  .top-nav { order: 3; }
  .header-phone { order: 4; }
  .site-logo { width: 50px; }

  .top-nav,
  .header-phone {
    flex-basis: 100%;
    display: none;
  }
  .site-header.nav-open .top-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 4px;
    padding-top: 10px;
    border-top: 1px solid var(--line);
  }
  .site-header.nav-open .top-nav a {
    padding: 12px 8px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 650;
  }
  .site-header.nav-open .top-nav a:hover {
    background: var(--brand-soft);
    text-decoration: none;
  }
  .site-header.nav-open .header-phone {
    display: block;
    text-align: center;
    margin-top: 4px;
    padding: 12px 14px;
    font-size: 0.92rem;
  }

  /* --- Hero: stack the title above the highlight badges --- */
  .panel-heading {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    padding: 20px 16px;
    text-align: left;
  }
  .panel-heading h1,
  #booking-title {
    font-size: 1.55rem !important;
    line-height: 1.15;
    margin: 0;
  }
  .booking-title-copy,
  .booking-title-subcopy,
  .panel-heading h1 {
    max-width: none;
    margin-left: 0;
    margin-right: 0;
  }
  .booking-title-subcopy {
    font-size: 0.92rem !important;
    margin-top: 6px;
  }
  .clinic-badges {
    justify-content: flex-start;
  }
  .clinic-badges span {
    font-size: 0.72rem;
    padding: 4px 9px;
  }

  /* --- Step progress: compact, scrollable, numbers-first --- */
  .step-progress {
    padding: 0 14px;
    margin-bottom: 20px;
    gap: 4px;
    overflow-x: auto;
  }
  .step-progress .step-label {
    display: none;
  }

  /* --- Form: single column, tighter spacing, lighter labels --- */
  .form-section {
    padding: 16px;
  }
  .form-progress-notice {
    margin: 14px 16px 0;
    padding: 10px 12px;
    font-size: 0.86rem;
  }
  .form-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  label {
    font-size: 0.84rem;
    font-weight: 600;
  }
  label > input,
  label > select,
  label > textarea,
  label > .date-entry {
    margin-top: 4px;
  }
  input,
  select,
  textarea {
    min-height: 44px;
    padding: 10px 12px;
    font-size: 0.95rem;
  }
  textarea,
  .visit-reason-field textarea {
    min-height: 84px;
  }
  .section-heading-row h2,
  .form-section h2 {
    font-size: 1.05rem;
    margin: 0 0 12px;
  }
  .field-hint,
  .field-helper {
    font-size: 0.78rem;
  }

  /* --- Appointment step: stack calendar above the time list --- */
  .appointment-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .clinic-panel {
    padding: 18px 16px;
    gap: 18px;
  }
}

/* =========================================================================
   Admin tables — clean, minimal spreadsheet look (overrides earlier rules).
   Thin gridlines, sticky light header, compact rows, lighter text.
   ========================================================================= */
.table-wrap {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: auto;
  max-height: 72vh;
  background: #ffffff;
}
.bookings-table {
  min-width: 1080px;
  font-size: 0.83rem;
  border-collapse: separate;
  border-spacing: 0;
}
.bookings-table th,
.bookings-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid #eef1f4;
  text-align: left;
  vertical-align: top;
  line-height: 1.35;
}
.bookings-table th:last-child,
.bookings-table td:last-child {
  border-right: 0;
}
.bookings-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f7f8fa;
  color: var(--muted);
  font-size: 0.71rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.bookings-table tbody tr:nth-child(even) {
  background: #fcfcfd;
}
.bookings-table tbody tr:hover {
  background: #f4f1fb;
}
/* Calm the bold/big typography down to a scannable weight */
.bookings-table strong {
  font-weight: 600;
}
.bookings-table td > strong:first-child {
  font-weight: 650;
}
.bookings-table .muted {
  font-size: 0.76rem;
  color: var(--muted);
}
.bookings-table a {
  font-weight: 500;
}
.bookings-table .visit-reason-cell {
  font-size: 0.78rem;
  margin-top: 4px;
}
/* Compact inline controls so rows stay short */
.bookings-table select {
  min-height: 32px;
  padding: 4px 8px;
  font-size: 0.82rem;
}
.bookings-table .notes-input,
.notes-input {
  width: 168px;
  min-height: 52px;
  padding: 7px 9px;
  font-size: 0.8rem;
}
.bookings-table .timeline-list,
.timeline-list {
  min-width: 180px;
  gap: 4px;
  margin-top: 8px;
  padding-top: 8px;
  font-size: 0.75rem;
}
.bookings-table .secondary-button,
.bookings-table .danger-button {
  padding: 6px 12px;
  font-size: 0.8rem;
}

/* =========================================================================
   Clean minimal SaaS pass — flat surfaces, no colored glow.
   Public booking form
   ========================================================================= */
.panel-heading {
  background: var(--surface);
}
.booking-snapshot {
  background: var(--surface-soft);
  border-color: var(--line);
}

/* =========================================================================
   Admin shell — flat, neutral, professional
   ========================================================================= */
.admin-body {
  background: var(--bg);
}
.admin-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 32px 24px 80px;
}
.admin-shell h1 {
  font-size: 1.45rem;
  line-height: 1.2;
}
.home-hero {
  margin-bottom: 24px;
}
.home-hero h1 {
  font-size: 1.6rem;
}
/* Flatten every card/panel: hairline border, no colored glow */
.admin-shell .nav-card,
.admin-shell .metric-card,
.admin-shell .slot-card,
.admin-shell .slot-stat,
.admin-shell .settings-box,
.admin-shell .settings-nav-card,
.admin-shell .service-builder-card,
.admin-shell .module-card {
  box-shadow: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.admin-shell .dashboard-cards,
.admin-shell .admin-module-nav,
.admin-shell .admin-filters,
.admin-shell .slot-control-panel,
.admin-shell .settings-hub,
.admin-shell .system-options {
  background: transparent;
  box-shadow: none;
  border: 0;
  padding-left: 0;
  padding-right: 0;
}
.admin-shell .nav-card {
  border-radius: 12px;
}
.admin-shell .nav-card:hover {
  transform: none;
  box-shadow: none;
  border-color: var(--brand);
  background: #fafaff;
}
.admin-shell .nav-card-icon {
  box-shadow: none;
}
.admin-shell .metric-card strong {
  color: var(--ink);
}

/* =========================================================================
   Bookings inbox — master list + detail (JotForm-style)
   ========================================================================= */
.inbox {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
  min-height: 540px;
}
.inbox-list {
  border-right: 1px solid var(--line);
  max-height: 74vh;
  overflow-y: auto;
  background: #fbfbfc;
}
.inbox-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 13px 16px;
  background: none;
  border: 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background 0.12s ease;
}
.inbox-item:hover {
  background: #f2f3f5;
}
.inbox-item.active {
  background: #eef0fb;
  box-shadow: inset 3px 0 0 var(--brand);
}
.inbox-item-dot {
  width: 8px;
  height: 8px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--muted);
  flex: none;
}
.inbox-item-dot.status-new { background: var(--brand); }
.inbox-item-dot.status-confirmed { background: var(--success); }
.inbox-item-dot.status-completed { background: #94a3b8; }
.inbox-item-dot.status-cancelled { background: var(--danger); }
.inbox-item-dot.status-no_show { background: var(--gold); }
.inbox-item-main {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  flex: 1;
}
.inbox-item-name {
  font-weight: 600;
  color: var(--ink);
  font-size: 0.9rem;
}
.inbox-item-email,
.inbox-item-meta {
  color: var(--muted);
  font-size: 0.78rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
.inbox-item-meta {
  margin-top: 2px;
}
.inbox-item-amount {
  color: var(--ink);
  font-weight: 600;
  font-size: 0.8rem;
  flex: none;
}
.inbox-detail {
  padding: 28px 32px;
  overflow-y: auto;
  max-height: 74vh;
}
.inbox-empty {
  padding: 48px 24px;
  color: var(--muted);
  text-align: center;
  font-size: 0.92rem;
}
.detail-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
}
.detail-head h2 {
  margin: 0 0 3px;
  font-size: 1.5rem;
  color: var(--ink);
}
.detail-email {
  color: var(--brand-dark);
  font-size: 0.9rem;
}
.detail-ref {
  font-size: 0.74rem;
  color: var(--muted);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.detail-list {
  margin: 0 0 22px;
  display: flex;
  flex-direction: column;
}
.detail-row {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px solid #f1f2f4;
}
.detail-row dt {
  color: var(--muted);
  font-size: 0.84rem;
}
.detail-row dd {
  margin: 0;
  color: var(--ink);
  font-size: 0.91rem;
  line-height: 1.5;
}
.pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 6px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 0.82rem;
  font-weight: 500;
}
.pill-amber {
  background: #fef3c7;
  color: #92400e;
}
.detail-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 18px;
  padding: 18px 20px;
  background: #fafbfc;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 20px;
}
.detail-actions label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink);
}
.detail-actions .detail-notes {
  grid-column: 1 / -1;
}
.detail-actions .notes-input {
  width: 100%;
  min-height: 68px;
}
.detail-actions .primary-button {
  grid-column: 1 / -1;
  justify-self: start;
}
.inbox-detail .timeline-list {
  min-width: 0;
}

@media (max-width: 760px) {
  .inbox {
    grid-template-columns: 1fr;
  }
  .inbox-list {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    max-height: 240px;
  }
  .detail-row {
    grid-template-columns: 1fr;
    gap: 2px;
  }
  .detail-actions {
    grid-template-columns: 1fr;
  }
}

/* =========================================================================
   FINAL neutral-glow override — wins over all earlier stacked themes.
   Removes the purple glow site-wide; keeps elevation subtle and neutral.
   ========================================================================= */
:root {
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 1px 3px rgba(16, 24, 40, 0.06);
  --shadow-soft: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-hover: 0 4px 12px rgba(16, 24, 40, 0.10);
}
body {
  background: var(--bg);
}
.site-header {
  box-shadow: none;
}
.booking-panel,
.clinic-panel {
  box-shadow: var(--shadow);
}
.primary-button {
  box-shadow: none;
}

/* =========================================================================
   Compact appointment picker — smaller calendar, 3 time slots per row.
   ========================================================================= */
.appointment-grid {
  grid-template-columns: minmax(0, 250px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.calendar {
  padding: 12px;
}
.calendar-toolbar strong {
  font-size: 0.9rem;
}
.weekday-row {
  font-size: 0.62rem;
}
.calendar-days {
  gap: 4px;
}
.calendar-day {
  aspect-ratio: auto;
  min-height: 30px;
  padding: 3px 0;
  font-size: 0.8rem;
  font-weight: 600;
}
.calendar-day:hover:not(:disabled),
.calendar-day.selected {
  font-weight: 700;
}
.time-panel {
  padding: 0;
}
#selectedDateLabel {
  font-size: 0.95rem;
  margin-top: 0;
}
.slot-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  max-width: 360px;
}
.slot-button {
  min-height: 38px;
  padding: 6px 4px;
  font-size: 0.82rem;
  font-weight: 600;
}

@media (max-width: 640px) {
  .appointment-grid {
    grid-template-columns: 1fr;
  }
  .slot-grid {
    max-width: none;
  }
}

/* =========================================================================
   Hero highlight badges — keep all three on one line.
   ========================================================================= */
.clinic-badges {
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}
.clinic-badges::-webkit-scrollbar {
  display: none;
}
.clinic-badges span {
  white-space: nowrap;
  flex: 0 0 auto;
}
@media (max-width: 640px) {
  .clinic-badges {
    justify-content: center;
    gap: 6px;
  }
  .clinic-badges span {
    font-size: 0.66rem;
    padding: 3px 8px;
  }
}

/* =========================================================================
   Day Control — compact, clean occupancy cells.
   ========================================================================= */
/* ---- Summary stats: scannable dashboard tiles ---- */
.slot-control-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.slot-control-stats .slot-stat {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}
.slot-control-stats .slot-stat span {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.slot-control-stats .slot-stat strong {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1;
  color: var(--ink);
  white-space: nowrap;
}
/* The Date tile holds a long string, not a count — keep it readable. */
.slot-control-stats .slot-stat:first-child strong {
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}
.slot-control-stats .slot-stat.booked { border-top-color: var(--brand); }
.slot-control-stats .slot-stat.booked strong { color: var(--brand-dark); }
.slot-control-stats .slot-stat.open { border-top-color: var(--success); }
.slot-control-stats .slot-stat.open strong { color: #087f5b; }
.slot-control-stats .slot-stat.unavailable { border-top-color: var(--danger); }
.slot-control-stats .slot-stat.unavailable strong { color: #b42318; }

/* ---- Slot cards: roomy, consistent grid that never feels cramped ---- */
.slot-control-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(236px, 1fr));
  gap: 16px;
}
.slot-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-left: 4px solid #cbd5e1;
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  transition: box-shadow 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}
.slot-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}
.slot-card.open { border-left-color: var(--success); }
.slot-card.booked { border-left-color: var(--brand); }
.slot-card.full { border-left-color: var(--danger); }
.slot-card.closed,
.slot-card.unavailable { border-left-color: #cbd5e1; background: #fafbfc; }

.slot-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.slot-time { font-size: 1.05rem; font-weight: 700; color: var(--ink); }
.slot-pill {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 10px;
  border-radius: 999px;
  background: #eef1f4;
  color: var(--muted);
  white-space: nowrap;
}
.slot-card.open .slot-pill { background: #dcfce7; color: #087f5b; }
.slot-card.booked .slot-pill { background: var(--brand-soft); color: var(--brand-dark); }
.slot-card.full .slot-pill { background: #fee2e2; color: #b42318; }

.slot-occupancy {
  display: flex;
  align-items: baseline;
  gap: 7px;
}
.slot-count { font-size: 1.4rem; font-weight: 700; color: var(--ink); }
.slot-count-sep { color: var(--muted); font-weight: 500; margin: 0 2px; }
.slot-occ-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.slot-booking-list { display: flex; flex-direction: column; gap: 6px; }
.slot-booking-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.slot-booking-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.slot-free-btn {
  flex: 0 0 auto;
  padding: 4px 11px;
  font-size: 0.73rem;
  font-weight: 700;
  border: 1px solid #f2c2c2;
  border-radius: 7px;
  background: #fff5f5;
  color: #b42318;
  cursor: pointer;
  transition: background-color 0.14s ease;
}
.slot-free-btn:hover { background: #fee2e2; }

/* Controls sit below a hairline divider so they read as a distinct action zone. */
.slot-admin-controls {
  display: grid;
  grid-template-columns: 1fr 68px auto;
  gap: 8px;
  align-items: center;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.slot-admin-controls select,
.slot-admin-controls input {
  min-height: 36px;
  padding: 6px 10px;
  font-size: 0.82rem;
}
.slot-admin-controls .secondary-button {
  min-height: 36px;
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 600;
}

/* Day Control stats — keep tile layout (override leftover flex rules) */
#slotControlStats.slot-control-stats .slot-stat {
  min-height: 0;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
}

/* =========================================================================
   Admin sections — unified minimal, flat, compact (Schedule, Services,
   Waitlist, Cancellation, Emails, Marketing, Email setup).
   ========================================================================= */
.admin-shell h2 { font-size: 1.1rem; }
.admin-shell h3 { font-size: 0.95rem; }
.admin-shell .section-heading-row h2 { font-size: 1.05rem; }

/* Shared panel container — flat card, hairline border, no glow */
.admin-shell .panel-card {
  border-radius: 10px;
  box-shadow: none;
}
.admin-shell .panel-card-head {
  padding: 13px 18px;
  background: var(--surface-soft);
}
.admin-shell .panel-card-head h2,
.admin-shell .panel-card-head h3 {
  font-size: 1rem;
}
.admin-shell .panel-card-body {
  padding: 18px;
}
.admin-shell .schedule-exception-card {
  border-radius: 8px;
  box-shadow: none;
  padding: 12px;
}

/* Compact form controls across every admin section */
.admin-shell input,
.admin-shell select,
.admin-shell textarea {
  min-height: 36px;
  padding: 7px 10px;
  font-size: 0.87rem;
}
.admin-shell textarea {
  min-height: 78px;
}
.admin-shell label {
  font-size: 0.84rem;
  font-weight: 600;
}
.admin-shell .checkbox-field,
.admin-shell .checkbox-line {
  min-height: 0;
  padding: 10px 12px;
  font-size: 0.86rem;
}
.admin-shell .secondary-button,
.admin-shell .primary-button {
  padding: 8px 14px;
  font-size: 0.85rem;
  min-height: 36px;
}
.admin-shell .payment-note,
.admin-shell .placeholder-help,
.admin-shell .developer-note,
.admin-shell .field-hint {
  font-size: 0.8rem;
}

/* Keep the Day Control + inbox controls at their tuned compact sizes
   (re-asserted with higher specificity so the blanket rule above can't grow them) */
.slot-control-grid .slot-admin-controls select,
.slot-control-grid .slot-admin-controls input {
  min-height: 32px;
  font-size: 0.8rem;
}
.inbox-detail .detail-actions select {
  min-height: 34px;
}

/* =========================================================================
   Desktop appointment picker — unified, contained card (calendar + times).
   Balanced two-column layout: tinted calendar rail + roomy time panel.
   ========================================================================= */
@media (min-width: 641px) {
  .appointment-grid {
    grid-template-columns: 288px minmax(0, 1fr);
    gap: 0;
    max-width: 740px;
    border: 1px solid var(--line);
    border-radius: 14px;
    overflow: hidden;
    background: var(--surface);
    box-shadow: var(--shadow);
    align-items: stretch;
  }

  /* Calendar rail — softly tinted so it reads as a distinct panel. */
  .appointment-grid .calendar {
    border: 0;
    border-right: 1px solid var(--line);
    border-radius: 0;
    background: var(--surface-soft);
    padding: 20px 18px;
    box-shadow: none;
  }
  .appointment-grid .calendar-toolbar {
    margin-bottom: 14px;
  }
  .appointment-grid .calendar-toolbar strong {
    font-size: 0.95rem;
    letter-spacing: -0.01em;
  }
  .appointment-grid .icon-button {
    width: 32px;
    height: 32px;
  }
  .appointment-grid .calendar-days {
    gap: 5px;
  }
  .appointment-grid .calendar-day {
    aspect-ratio: 1;
    min-height: 0;
    padding: 0;
    font-size: 0.83rem;
    font-weight: 600;
    border-radius: 8px;
  }

  /* Time panel — header + filling grid of slots, gentle scroll if long. */
  .appointment-grid .time-panel {
    padding: 20px 20px 20px 22px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: 360px;
  }
  #selectedDateLabel {
    margin: 0;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
    font-size: 1rem;
    font-weight: 700;
    color: var(--ink);
  }
  .appointment-grid .slot-grid {
    grid-template-columns: repeat(auto-fill, minmax(94px, 1fr));
    gap: 8px;
    max-width: none;
    align-content: start;
    max-height: 312px;
    overflow-y: auto;
    padding-right: 4px;
    margin-right: -4px;
  }
  /* Slim, unobtrusive scrollbar for the slot list. */
  .appointment-grid .slot-grid::-webkit-scrollbar {
    width: 6px;
  }
  .appointment-grid .slot-grid::-webkit-scrollbar-thumb {
    background: var(--line);
    border-radius: 999px;
  }
  .appointment-grid .slot-button {
    min-height: 42px;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 8px;
  }
}

/* =========================================================================
   Emails & Reminders — friendly "merge fields" helper (non-technical look).
   ========================================================================= */
.merge-fields {
  margin: 4px 0 4px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}
.merge-fields-title {
  margin: 0 0 12px;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--ink);
}
.merge-fields-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px 16px;
}
.merge-fields-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--muted);
}
.merge-fields-list code {
  flex: 0 0 auto;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 0.78rem;
  font-weight: 700;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* =========================================================================
   Embedded Square card field (pay-before-submit on the booking page).
   ========================================================================= */
.card-payment-box {
  margin-top: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}
.card-label {
  display: block;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 8px;
}
/* Square injects its own iframe here; give it a clean white field. */
#card-container {
  min-height: 44px;
  padding: 4px 6px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.card-errors {
  margin-top: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--danger);
  min-height: 1em;
}
.card-secure-note {
  margin: 10px 0 0;
  font-size: 0.76rem;
  color: var(--muted);
}

/* =========================================================================
   Always-available "join the waitlist" link under the calendar times.
   ========================================================================= */
.waitlist-prompt-subtle {
  grid-column: 1 / -1;
  margin-top: 10px;
  padding: 10px 12px;
  background: var(--surface-soft);
  border: 1px dashed var(--line);
  border-radius: 8px;
  font-size: 0.84rem;
  color: var(--muted);
  text-align: center;
}
.link-button {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-weight: 700;
  color: var(--brand);
  cursor: pointer;
  text-decoration: underline;
}
.link-button:hover {
  color: var(--brand-dark);
}
