:root {
  --ink: #21302d;
  --muted: #5e6d67;
  --sage: #6f8f7b;
  --sage-dark: #3e6b5a;
  --mint: #dfeade;
  --paper: #fbfaf6;
  --panel: rgba(255, 252, 246, 0.92);
  --solid: #fffdf8;
  --line: rgba(35, 48, 45, 0.16);
  --amber: #b46d2a;
  --rose: #925f5f;
  --blue: #3c6476;
  --shadow: 0 24px 80px rgba(21, 32, 28, 0.18);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: #16231f;
}
body.ops-open { background: var(--paper); }
body.menu-open { overflow: hidden; }

#scrollCanvas, .backdrop-overlay {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
#scrollCanvas { z-index: -3; background: url("public/images/therapy-room-poster.jpg") center / cover no-repeat; }
.backdrop-overlay {
  z-index: -2;
  background:
    linear-gradient(to bottom, rgba(18, 24, 22, 0.46), rgba(18, 24, 22, 0.72)),
    radial-gradient(circle at 28% 18%, rgba(255,255,255,0.14), transparent 34%);
}
.ops-open #scrollCanvas, .ops-open .backdrop-overlay { display: none; }

a { color: inherit; }
button, input, select, textarea { font: inherit; }
button, .btn, input, select, textarea { border-radius: 999px; }
textarea { border-radius: 18px; resize: vertical; }
button, .btn { cursor: pointer; min-height: 44px; }
button:disabled, .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(180, 109, 42, 0.65);
  outline-offset: 3px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-header {
  position: fixed;
  z-index: 10;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  width: min(1160px, calc(100% - 28px));
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,0.28);
  border-radius: 999px;
  background: rgba(255, 252, 246, 0.86);
  backdrop-filter: blur(18px);
  box-shadow: 0 12px 40px rgba(15, 25, 22, 0.16);
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; }
.brand-mark {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--sage-dark);
  color: white;
  font-weight: 800;
}
.brand small, .eyebrow, .fineprint, label small { color: var(--muted); }
.brand strong, .brand small { display: block; line-height: 1.05; }
nav { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
nav a {
  text-decoration: none;
  font-size: 0.92rem;
  padding: 10px 12px;
  border-radius: 999px;
  transition: background 160ms ease, color 160ms ease;
}
nav a:hover, nav a.active { background: rgba(111, 143, 123, 0.18); color: var(--sage-dark); }
.menu-toggle {
  display: none;
  width: 48px;
  height: 48px;
  border: 1px solid var(--line);
  background: white;
  padding: 11px;
}
.menu-toggle span:not(.sr-only) {
  display: block;
  height: 2px;
  margin: 5px 0;
  border-radius: 99px;
  background: var(--ink);
}

.section {
  min-height: 100vh;
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
  padding: 118px 0 72px;
  display: grid;
  align-items: center;
}
.hero { justify-items: start; }
.hero-copy { max-width: 790px; color: white; text-shadow: 0 2px 26px rgba(0,0,0,0.4); }
.eyebrow {
  margin: 0 0 12px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 800;
}
.hero .eyebrow { color: rgba(255,255,255,0.78); }
h1, h2 {
  margin: 0 0 18px;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
  letter-spacing: 0;
}
h1 { font-size: clamp(3.2rem, 9vw, 7.4rem); line-height: 0.94; }
h2 { font-size: clamp(2rem, 4vw, 3.9rem); line-height: 1; }
h3 { margin: 0 0 16px; font-size: 1.15rem; }
.lede { max-width: 710px; font-size: clamp(1.12rem, 2vw, 1.42rem); line-height: 1.6; }
.hero-disclaimer { margin-top: 16px; color: rgba(255,255,255,0.76); font-size: 0.92rem; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  padding: 12px 20px;
  text-decoration: none;
  font-weight: 800;
  line-height: 1.2;
}
.primary { background: var(--sage-dark); color: white; }
.secondary { background: rgba(255,255,255,0.82); border-color: var(--line); color: var(--ink); }
.subtle { background: rgba(255,255,255,0.2); color: white; border-color: rgba(255,255,255,0.34); }
.full { width: 100%; }
.hero-actions, .form-actions, .helper-actions, .badges, .legend, .section-head { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.section-head { justify-content: space-between; }
.hero-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 34px 0 0;
}
.hero-facts div, .panel, .video-card {
  border: 1px solid rgba(255,255,255,0.34);
  background: var(--panel);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}
.hero-facts div { padding: 16px; border-radius: 18px; color: var(--ink); text-shadow: none; }
dt { font-size: 0.78rem; color: var(--muted); font-weight: 800; text-transform: uppercase; }
dd { margin: 6px 0 0; font-weight: 800; }

.split-section, .booking-grid, .intake-layout { grid-template-columns: minmax(0, 1fr) minmax(320px, 0.78fr); gap: 22px; }
.panel, .video-card { border-radius: 28px; padding: clamp(22px, 4vw, 42px); }
.panel p { line-height: 1.7; }
.quote { font-family: Georgia, "Times New Roman", serif; font-size: 1.45rem; color: var(--sage-dark); }
.profile-grid, .policy-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 22px 0;
}
.profile-grid div, .policy-grid article {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,0.7);
  padding: 16px;
}
.profile-grid strong, .profile-grid span { display: block; }
.profile-grid span { margin-top: 6px; color: var(--muted); }
.badges span, .trust-badge, .legend span, .steps span, .status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(111, 143, 123, 0.14);
  font-weight: 800;
  font-size: 0.88rem;
}
.status-pill { color: var(--sage-dark); white-space: nowrap; }
.video-card { position: relative; overflow: hidden; padding: 0; aspect-ratio: 16 / 10; }
video { width: 100%; height: 100%; object-fit: cover; display: block; }
.play-button {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  border: 0;
  padding: 0 26px;
  background: rgba(255, 252, 246, 0.92);
  font-weight: 900;
}
.is-playing .play-button { display: none; }

.calendar-head { display: flex; align-items: center; justify-content: space-between; margin: 20px 0; }
.icon-btn { width: 46px; border: 1px solid var(--line); background: white; font-size: 1.5rem; }
.calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(38px, 1fr));
  gap: 8px;
}
.day-name, .date-btn {
  min-height: 44px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.7);
  text-align: center;
  border-radius: 14px;
}
.day-name { display: grid; place-items: center; font-size: 0.75rem; font-weight: 900; color: var(--muted); }
.date-btn.selected { background: var(--sage-dark); color: white; }
.date-btn.has-booking { border-color: var(--blue); box-shadow: inset 0 -4px 0 rgba(60,100,118,0.3); }
.date-btn:disabled { opacity: 0.42; cursor: not-allowed; background: rgba(220, 214, 202, 0.66); }
.legend i { width: 12px; height: 12px; border-radius: 50%; display: inline-block; margin-right: 6px; }
.legend .available { background: white; border: 1px solid var(--line); }
.legend .selected { background: var(--sage-dark); }
.legend .booked { background: var(--blue); }
.legend .buffer { background: var(--amber); }
.legend .closed { background: #cfc6b8; }

label { display: grid; gap: 8px; margin: 0 0 14px; font-weight: 800; color: var(--muted); }
label small, fieldset small { min-height: 18px; color: var(--rose); font-weight: 700; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.86);
  padding: 13px 15px;
  color: var(--ink);
}
.summary-box {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  background: rgba(255,255,255,0.74);
  line-height: 1.55;
  margin: 16px 0;
}
.confirmation { border-color: rgba(62, 107, 90, 0.4); background: rgba(223, 234, 222, 0.8); }
.booking-summary { position: sticky; top: 106px; align-self: start; }
.progress-track {
  height: 10px;
  border-radius: 999px;
  background: rgba(35, 48, 45, 0.1);
  overflow: hidden;
  margin: 18px 0;
}
.progress-track span { display: block; width: 20%; height: 100%; background: var(--sage-dark); transition: width 180ms ease; }
.steps { display: flex; gap: 8px; flex-wrap: wrap; margin: 18px 0; }
.steps .active { background: var(--sage-dark); color: white; }
.step-page { display: none; }
.step-page.active { display: block; }
fieldset { border: 0; padding: 0; margin: 0; }
legend { margin-bottom: 12px; font-weight: 900; }
.concern-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.concern-card {
  min-height: 70px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,0.76);
  text-align: left;
  padding: 14px;
  font-weight: 900;
}
.concern-card.active { border-color: var(--sage-dark); background: rgba(111, 143, 123, 0.2); }
.check-row {
  display: grid;
  grid-template-columns: 24px 1fr;
  align-items: start;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,0.72);
}
.check-row input { width: 20px; height: 20px; margin: 2px 0 0; }
.form-message { min-height: 24px; font-weight: 800; color: var(--rose); }
#submitIntake { display: none; }
.checklist { list-style: none; padding: 0; margin: 18px 0; }
.checklist li { padding: 11px 0; border-bottom: 1px solid var(--line); }
.checklist li.done::before { content: "✓ "; color: var(--sage-dark); font-weight: 900; }
.checklist li::before { content: "○ "; color: var(--muted); font-weight: 900; }
.helper-actions button, .helper-actions a {
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.76);
  padding: 10px 12px;
  border-radius: 999px;
  text-decoration: none;
  min-height: 44px;
}
.policy-section { min-height: 80vh; }
.footer-section { min-height: 72vh; }

.urgent-fab {
  position: fixed;
  z-index: 20;
  right: 20px;
  bottom: 20px;
  border: 0;
  background: var(--amber);
  color: white;
  padding: 12px 18px;
  font-weight: 900;
  box-shadow: var(--shadow);
}
.crisis-drawer {
  position: fixed;
  z-index: 30;
  right: 18px;
  bottom: 78px;
  width: min(390px, calc(100% - 36px));
  transform: translateY(18px);
  opacity: 0;
  pointer-events: none;
  transition: 180ms ease;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 24px;
  box-shadow: var(--shadow);
}
.crisis-drawer.open { transform: translateY(0); opacity: 1; pointer-events: auto; }
.close-drawer { float: right; border: 0; background: transparent; font-size: 1.5rem; }

.clinic-ops {
  min-height: 100vh;
  padding: 28px;
  background: var(--paper);
}
.ops-shell { max-width: 1360px; margin: 0 auto; display: grid; gap: 18px; }
.ops-header, .metric-grid, .ops-grid, .ops-toolbar { display: grid; gap: 14px; }
.ops-header {
  grid-template-columns: 1fr auto;
  align-items: center;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.ops-actions, .ops-toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; justify-content: flex-end; }
.ops-toolbar { justify-content: space-between; background: white; border: 1px solid var(--line); border-radius: 8px; padding: 14px; }
.ops-toolbar label { margin: 0; min-width: 160px; }
.metric-grid { grid-template-columns: repeat(6, minmax(130px, 1fr)); }
.metric, .ops-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}
.metric span { display: block; color: var(--muted); font-size: 0.78rem; font-weight: 900; text-transform: uppercase; }
.metric strong { display: block; margin-top: 8px; font-size: 1.7rem; }
.ops-grid { grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.85fr); align-items: start; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; min-width: 860px; }
th, td { padding: 11px 9px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--muted); font-size: 0.72rem; text-transform: uppercase; }
td select, td input { border-radius: 8px; padding: 8px; }
.stack { display: grid; gap: 14px; }
.capacity-bar { height: 12px; border-radius: 999px; background: #e7e1d5; overflow: hidden; }
.capacity-bar span { display: block; height: 100%; background: var(--sage-dark); }
.warning .capacity-bar span { background: var(--amber); }
.block-list, .audit-list, .intake-list { padding-left: 18px; }
.audit-list, .intake-list { max-height: 220px; overflow: auto; }
.badge {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 0.78rem;
  font-weight: 900;
  background: var(--mint);
  color: var(--sage-dark);
}
.danger { color: var(--rose); font-weight: 900; }

.reveal { opacity: 0; transform: translateY(20px); transition: 600ms ease; }
.reveal.visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal, .crisis-drawer, .progress-track span { transition: none; }
}

@media (max-width: 980px) {
  .site-header {
    align-items: center;
    border-radius: 24px;
    flex-wrap: wrap;
  }
  .menu-toggle { display: block; }
  nav {
    display: none;
    width: 100%;
    padding-top: 8px;
    border-top: 1px solid var(--line);
  }
  body.menu-open nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  nav a { background: rgba(111, 143, 123, 0.1); text-align: center; }
  .section { width: min(100% - 24px, 720px); padding-top: 128px; }
  .split-section, .booking-grid, .intake-layout, .ops-grid, .ops-header { grid-template-columns: 1fr; }
  .hero-facts, .metric-grid, .profile-grid, .policy-grid { grid-template-columns: 1fr; }
  .booking-summary { position: static; }
  h1 { font-size: clamp(3rem, 18vw, 5rem); }
}

@media (max-width: 560px) {
  .brand strong { font-size: 0.92rem; }
  .brand small { font-size: 0.75rem; }
  body.menu-open nav { grid-template-columns: 1fr; }
  .concern-grid, .calendar { gap: 6px; }
  .date-btn, .day-name { min-height: 40px; border-radius: 12px; }
  .hero-actions, .form-actions { align-items: stretch; }
  .hero-actions .btn, .form-actions .btn { width: 100%; }
}

@media print {
  .site-header, .urgent-fab, .crisis-drawer, #publicSite, #scrollCanvas, .backdrop-overlay, .ops-actions, .ops-toolbar { display: none !important; }
  .clinic-ops { padding: 0; }
  .ops-card, .metric { box-shadow: none; break-inside: avoid; }
  table { min-width: 0; font-size: 0.78rem; }
}
