:root {
  color-scheme: light;
  --ink: #153541;
  --muted: #5d747c;
  --teal: #0d6671;
  --teal-dark: #084d56;
  --aqua: #dceff0;
  --cream: #fbf8f1;
  --white: #ffffff;
  --line: #d9e4e5;
  --coral: #bd624c;
  --gold: #e1a84b;
  --green: #2f7658;
  --shadow: 0 18px 50px rgba(19, 64, 73, .09);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; color: var(--ink); background: var(--cream); }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: 360px; z-index: -1; background: radial-gradient(circle at 80% -10%, #c5e8e8 0, transparent 45%), linear-gradient(135deg, #eef8f6, #f8f5ec); }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .65; }

.site-header { max-width: 1120px; margin: 0 auto; padding: 24px clamp(18px, 4vw, 44px); display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 46px; aspect-ratio: 1; border-radius: 15px 15px 15px 5px; color: white; font-weight: 800; letter-spacing: -.06em; background: var(--teal); box-shadow: 0 8px 20px rgba(13, 102, 113, .2); }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 1.02rem; }
.brand small { margin-top: 1px; color: var(--muted); font-size: .76rem; letter-spacing: .08em; text-transform: uppercase; }
.language-button, .text-button { border: 0; color: var(--teal); background: transparent; font-weight: 750; padding: 10px; }
.language-button { border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.78); }

.patient-shell { width: min(760px, calc(100% - 32px)); margin: 18px auto 70px; display: grid; gap: 22px; }
.network-status { margin: 0; padding: 13px 15px; border: 1px solid #e4a99b; border-radius: 12px; color: #842f20; background: #fff0ec; font-weight: 700; line-height: 1.45; }
.hero-card, .content-card, .auth-card, .admin-card { border: 1px solid rgba(205, 221, 222, .9); border-radius: 26px; background: rgba(255,255,255,.94); box-shadow: var(--shadow); }
.hero-card { padding: clamp(28px, 6vw, 54px); overflow: hidden; position: relative; }
.hero-card::after { content: "+"; position: absolute; right: 28px; top: 12px; color: rgba(13,102,113,.08); font: 900 8rem/1 sans-serif; }
.eyebrow, .kicker { color: var(--teal); font-size: .75rem; font-weight: 850; letter-spacing: .13em; text-transform: uppercase; }
.hero-card h1 { max-width: 620px; margin: 10px 0 14px; font-family: Georgia, Cambria, serif; font-size: clamp(2.15rem, 6vw, 3.65rem); line-height: .99; letter-spacing: -.035em; }
.hero-card > p { max-width: 620px; margin: 0; color: var(--muted); font-size: 1.08rem; line-height: 1.65; }
.synthetic-warning { margin-top: 24px; padding: 13px 15px; border-radius: 12px; color: #6e4825; background: #fff2d5; font-weight: 650; font-size: .88rem; }
.content-card { padding: clamp(24px, 5vw, 42px); }
.section-heading { display: flex; align-items: center; gap: 14px; margin-bottom: 26px; }
.step-dot { display: grid; flex: 0 0 40px; place-items: center; width: 40px; height: 40px; border-radius: 50%; color: white; background: var(--teal); font-weight: 800; }
.section-heading p { margin: 0 0 2px; }
.section-heading h2 { margin: 0; font: 700 clamp(1.3rem, 4vw, 1.65rem)/1.2 Georgia, Cambria, serif; }
form { display: grid; gap: 20px; }
.checkin-progress { display: flex; gap: 10px; margin-bottom: 8px; padding-bottom: 5px; overflow-x: auto; scroll-snap-type: x proximity; }
.checkin-progress button { display: flex; align-items: center; gap: 9px; min-height: 46px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 12px; color: var(--muted); background: #f7faf9; text-align: left; }
.checkin-progress button { flex: 0 0 auto; min-width: 142px; scroll-snap-align: start; }
.checkin-progress button span { display: grid; flex: 0 0 27px; place-items: center; width: 27px; height: 27px; border-radius: 50%; color: var(--teal); background: var(--aqua); font-size: .78rem; font-weight: 850; }
.checkin-progress button[aria-current="step"] { border-color: var(--teal); color: var(--teal-dark); background: #eef8f6; }
.checkin-progress button[aria-current="step"] span { color: white; background: var(--teal); }
.checkin-progress button:disabled { cursor: default; opacity: .55; }
.checkin-step { display: grid; gap: 20px; }
.checkin-step .section-heading { margin: 6px 0; }
.checkin-step [data-checkin-heading], .checkin-step [data-checkin-scroll-target] { scroll-margin-block: 24px; }
.step-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 4px; }
.step-actions .secondary-button { margin-right: auto; }
.field-grid { display: grid; gap: 18px; }
.two-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
label { display: grid; gap: 8px; color: var(--ink); font-weight: 720; font-size: .92rem; }
label small { color: var(--muted); font-weight: 500; }
input, textarea, select { width: 100%; border: 1px solid #c8d8da; border-radius: 12px; padding: 13px 14px; color: var(--ink); background: #fff; outline: none; transition: border-color .15s, box-shadow .15s; }
textarea { resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: var(--teal); box-shadow: 0 0 0 4px rgba(13,102,113,.12); }
.question-stack { display: grid; gap: 16px; }
.question-card { margin: 0; padding: 20px; border: 1px solid var(--line); border-radius: 17px; background: #fbfdfc; }
.question-card legend { padding: 0; font-weight: 780; line-height: 1.4; }
.question-card .question-help { margin: 7px 0 14px; color: var(--muted); font-size: .88rem; line-height: 1.45; }
.choice-row { display: flex; flex-wrap: wrap; gap: 10px; }
.choice-row label { position: relative; display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 10px 13px; border: 1px solid #c9dada; border-radius: 11px; background: white; font-weight: 640; }
.choice-row input { width: auto; accent-color: var(--teal); }
.required-mark { color: var(--coral); }
.primary-button, .secondary-button { min-height: 46px; border-radius: 12px; padding: 11px 18px; font-weight: 790; }
.primary-button { border: 1px solid var(--teal); color: white; background: var(--teal); box-shadow: 0 8px 20px rgba(13,102,113,.14); }
.primary-button:hover { background: var(--teal-dark); }
.secondary-button { border: 1px solid var(--teal); color: var(--teal); background: white; }
.fine-print { margin: 0; color: var(--muted); font-size: .8rem; line-height: 1.5; }
.form-error { padding: 13px 15px; border: 1px solid #e4a99b; border-radius: 12px; color: #842f20; background: #fff0ec; }
.queue-panel > h2 { margin: 8px 0; font: 700 2rem Georgia, Cambria, serif; }
.queue-panel > p { color: var(--muted); }
.queue-children { display: grid; gap: 14px; margin: 24px 0; }
.queue-child { padding: 20px; border: 1px solid var(--line); border-radius: 17px; background: linear-gradient(120deg, #f7fbfa, white); }
.queue-child header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.queue-child h3 { margin: 0; }
.queue-child p { margin: 9px 0 0; color: var(--muted); line-height: 1.5; }
.queue-position { color: var(--teal); font-weight: 850; }
.queue-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.family-room { margin-top: 32px; padding-top: 26px; border-top: 1px solid var(--line); }
.room-heading { display: flex; align-items: start; justify-content: space-between; gap: 18px; }
.room-heading h2 { margin: 5px 0 0; font: 700 clamp(1.4rem, 4vw, 1.9rem)/1.1 Georgia, Cambria, serif; }
.room-heading > p { max-width: 330px; margin: 0; color: var(--muted); font-size: .86rem; line-height: 1.45; }
.room-child-picker { max-width: 400px; margin-top: 22px; }
.message-list { display: grid; gap: 10px; max-height: 360px; overflow: auto; margin: 18px 0; }
.message-item { padding: 13px 15px; border: 1px solid var(--line); border-radius: 14px; background: #fbfdfc; }
.message-item header { display: flex; justify-content: space-between; gap: 10px; }
.message-item time { color: var(--muted); font-size: .76rem; }
.message-item p { margin: 8px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; }
.room-empty, .photo-list { color: var(--muted); font-size: .87rem; }
.message-form { grid-template-columns: 1fr auto; align-items: end; }
.photo-share { display: grid; gap: 10px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.photo-share > label { font-weight: 780; }
.photo-share input[type=file] { max-width: 560px; padding: 9px; }
.photo-preview { display: grid; justify-items: start; gap: 10px; width: fit-content; max-width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: #fbfdfc; }
.photo-preview img { display: block; max-width: min(100%, 300px); max-height: 300px; object-fit: contain; border-radius: 10px; }
.photo-preview p { margin: 0; max-width: 100%; overflow-wrap: anywhere; color: var(--muted); font-size: .84rem; }
.photo-list { display: grid; gap: 9px; }
.photo-record { display: grid; justify-items: start; gap: 10px; max-width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 14px; color: var(--ink); background: #fff; }
.private-photo-preview { max-width: 100%; }
.private-photo-preview img { display: block; max-width: min(100%, 360px); max-height: 360px; object-fit: contain; border-radius: 10px; }
footer { width: min(760px, calc(100% - 32px)); margin: 0 auto 30px; color: var(--muted); text-align: center; font-size: .8rem; }

.provider-header { max-width: 1320px; }
.local-badge { padding: 8px 12px; border-radius: 999px; color: #735325; background: #fff0c9; font-size: .78rem; font-weight: 800; }
.provider-shell { width: min(1240px, calc(100% - 36px)); margin: 22px auto 70px; }
.provider-intro { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
.provider-intro h1 { margin: 7px 0 6px; font: 700 clamp(2rem, 4vw, 3.2rem)/1 Georgia, Cambria, serif; }
.provider-intro p { max-width: 700px; margin: 0; color: var(--muted); }
.auth-card, .admin-card { padding: 28px; margin-bottom: 24px; }
.auth-card h2 { margin-top: 0; }
.auth-card form { display: grid; grid-template-columns: 1fr auto; align-items: end; }
.metrics-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
.metric { padding: 20px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,.9); }
.metric strong { display: block; font: 700 2rem Georgia, Cambria, serif; }
.metric span { color: var(--muted); font-size: .83rem; }
.provider-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.provider-card { padding: 21px; border: 1px solid var(--line); border-radius: 20px; background: white; box-shadow: 0 8px 28px rgba(19,64,73,.06); }
.provider-card.blocked { border-left: 5px solid var(--coral); }
.provider-card.ready { border-left: 5px solid var(--green); }
.provider-card.active { border-left: 5px solid var(--gold); }
.provider-card.closed { opacity: .62; }
.provider-card header { display: flex; justify-content: space-between; gap: 10px; }
.provider-card h3 { margin: 0; }
.provider-card .status-pill { height: fit-content; padding: 5px 8px; border-radius: 999px; background: var(--aqua); font-size: .7rem; font-weight: 850; text-transform: uppercase; }
.provider-card dl { display: grid; grid-template-columns: auto 1fr; gap: 7px 12px; margin: 18px 0; font-size: .86rem; }
.provider-card dt { color: var(--muted); }
.provider-card dd { margin: 0; font-weight: 650; overflow-wrap: anywhere; }
.provider-card .card-actions { display: flex; gap: 8px; }
.active-child-control { display: grid; grid-template-columns: minmax(220px, 1fr) auto auto; align-items: end; gap: 14px; margin: 0 0 22px; padding: 18px; border: 1px solid #bed6d8; border-radius: 18px; background: #edf7f6; }
.active-child-readout { align-self: center; }
.active-child-readout strong { display: block; margin-top: 3px; font-size: 1.05rem; }
.conversation-card { margin: 0 0 24px; padding: 24px; border: 1px solid var(--line); border-radius: 20px; background: rgba(255,255,255,.95); }
.conversation-card h2 { margin: 5px 0 7px; font: 700 clamp(1.35rem, 3vw, 1.85rem)/1.1 Georgia, Cambria, serif; }
.conversation-card > p { margin: 0 0 18px; color: var(--muted); }
.conversation-controls { display: grid; grid-template-columns: minmax(220px, 1fr) auto; align-items: end; gap: 12px; max-width: 760px; }
.provider-messages { display: grid; gap: 10px; max-height: 360px; overflow: auto; margin: 18px 0; }
.provider-message { padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: #fbfdfc; }
.provider-message header { display: flex; justify-content: space-between; gap: 10px; }
.provider-message time { color: var(--muted); font-size: .76rem; }
.provider-message p { margin: 8px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; }
.provider-photo-list { display: grid; gap: 8px; margin: 14px 0; }
.provider-photo-item { display: grid; justify-items: start; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; }
.provider-photo-item span { overflow-wrap: anywhere; }
.room-indicators { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.room-indicator { padding: 5px 8px; border-radius: 999px; color: #084d56; background: #dceff0; font-size: .72rem; font-weight: 800; }
.room-indicator.unread { color: #71420a; background: #fff0c9; }
.provider-card button { min-height: 42px; }
.admin-card { margin-top: 28px; }
.admin-heading { display: flex; justify-content: space-between; gap: 20px; }
.admin-heading h2 { margin: 7px 0 0; font-family: Georgia, Cambria, serif; }
.admin-heading p { max-width: 520px; color: var(--muted); font-size: .88rem; }
.question-admin-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 20px 0; }
.admin-question { padding: 13px 14px; border: 1px solid var(--line); border-radius: 13px; background: #fbfdfc; }
.admin-question strong { display: block; }
.admin-question small { color: var(--muted); }
details { border-top: 1px solid var(--line); padding-top: 18px; }
summary { cursor: pointer; color: var(--teal); font-weight: 800; }
.question-form { margin-top: 20px; }
.check-row { display: flex; align-items: center; gap: 9px; }
.check-row input { width: auto; }
[data-conference-invitation] { display: block; overflow-wrap: anywhere; margin: 12px 0; }
#provider-conference .card-actions { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; }
#provider-conference li { margin-bottom: 14px; }
#provider-conference li button { margin: 0 8px 8px 0; }
.delivery-panel { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.delivery-panel h3 { margin-top: 0; }
.delivery-panel dl { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 18px; }
.delivery-panel dt { color: var(--muted); }
.delivery-panel dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.delivery-panel .card-actions { display: flex; flex-wrap: wrap; gap: 10px; }

@media (max-width: 900px) {
  .provider-grid { grid-template-columns: repeat(2, 1fr); }
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .site-header { padding: 18px; }
  .brand strong { font-size: .92rem; }
  .brand-mark { width: 40px; }
  .local-badge { display: none; }
  .patient-shell, .provider-shell { width: min(100% - 22px, 760px); margin-top: 8px; }
  .hero-card, .content-card, .auth-card, .admin-card { border-radius: 20px; }
  .two-columns, .provider-grid, .question-admin-list { grid-template-columns: 1fr; }
  .hero-card h1 { font-size: 2.25rem; }
  .choice-row { display: grid; }
  .checkin-step input, .checkin-step textarea, .checkin-step select { font-size: 16px; }
  .step-actions { display: grid; grid-template-columns: 1fr; }
  .step-actions .primary-button, .step-actions .secondary-button { width: 100%; margin: 0; }
  .queue-actions, .provider-intro, .admin-heading, .room-heading { align-items: stretch; flex-direction: column; }
  .auth-card form { grid-template-columns: 1fr; }
  .provider-card dl { grid-template-columns: 1fr; }
  .provider-card dd { margin-bottom: 5px; }
  .message-form, .active-child-control, .conversation-controls { grid-template-columns: 1fr; }
  .provider-card .card-actions { flex-wrap: wrap; }
}
