:root {
  --navy: #173f6b;
  --navy-2: #0f3156;
  --blue: #0878d1;
  --blue-soft: #e6f2fc;
  --purple: #70227c;
  --purple-soft: #f2e9f4;
  --teal: #278d91;
  --teal-soft: #e4f4f3;
  --gold: #a66d16;
  --gold-soft: #fff6df;
  --red: #c64052;
  --red-soft: #fff0f2;
  --ink: #17314b;
  --muted: #62758a;
  --line: #dce5ee;
  --surface: #ffffff;
  --canvas: #f3f6fa;
  --shadow: 0 8px 28px rgba(24, 59, 91, .08);
  --radius: 20px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
.skip-link { position: fixed; left: 12px; top: -50px; z-index: 100; background: #fff; padding: 10px 16px; border-radius: 8px; color: var(--navy); }
.skip-link:focus { top: 12px; }

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 72px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px max(18px, calc((100vw - 760px) / 2));
  background: rgba(255, 255, 255, .93);
  border-bottom: 1px solid rgba(216, 227, 237, .9);
  backdrop-filter: blur(16px);
}
.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 14px 14px 14px 4px;
  display: grid;
  place-items: center;
  background: var(--navy);
  color: #fff;
  font-size: 13px;
  font-weight: 850;
  letter-spacing: -.02em;
}
.brand-copy { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.brand-copy strong { font-size: 16px; white-space: nowrap; }
.eyebrow, .overline {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .095em;
  line-height: 1.3;
  text-transform: uppercase;
}
.local-pill {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 999px;
  background: #eef7f4;
  color: #286d60;
  font-size: 12px;
  font-weight: 800;
}
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #32a274; box-shadow: 0 0 0 3px rgba(50, 162, 116, .12); }

.app-shell { width: min(100%, 760px); margin: 0 auto; padding: 20px 16px calc(112px + var(--safe-bottom)); }
.view { display: none; animation: enter .22s ease-out; }
.view.active { display: block; }
@keyframes enter { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: clamp(26px, 7vw, 36px); line-height: 1.08; letter-spacing: -.035em; }
h2 { margin-bottom: 0; font-size: 20px; line-height: 1.18; letter-spacing: -.018em; }

.summary-card {
  position: relative;
  overflow: hidden;
  padding: 24px;
  border-radius: 28px;
  color: #fff;
  background:
    radial-gradient(circle at 93% 12%, rgba(255,255,255,.18) 0 56px, transparent 58px),
    linear-gradient(140deg, var(--navy-2), #1c5d8e 65%, #28799e);
  box-shadow: 0 18px 40px rgba(23, 63, 107, .23);
}
.summary-card .overline { color: #bcd5e8; }
.summary-card h1 { margin-bottom: 0; font-size: clamp(27px, 7vw, 34px); }
.summary-topline { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.icon-button { width: 42px; height: 42px; flex: 0 0 42px; border: 1px solid rgba(255,255,255,.25); border-radius: 14px; background: rgba(255,255,255,.1); color: #fff; font-size: 21px; }
.pregnancy-progress { margin-top: 30px; }
.progress-track { height: 7px; overflow: hidden; border-radius: 99px; background: rgba(255,255,255,.17); }
.progress-track span { display: block; width: 0%; height: 100%; border-radius: inherit; background: #7bd3ce; transition: width .4s ease; }
.progress-copy { display: flex; justify-content: space-between; gap: 12px; margin-top: 10px; font-size: 13px; color: #d9e9f3; }
.progress-copy strong { color: #fff; font-size: 15px; }
.privacy-inline { display: flex; gap: 10px; align-items: center; margin-top: 22px; padding-top: 17px; border-top: 1px solid rgba(255,255,255,.15); }
.privacy-inline > span { width: 31px; height: 31px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 10px; background: rgba(255,255,255,.1); font-size: 18px; }
.privacy-inline p { margin: 0; color: #dceaf3; font-size: 12px; }
.privacy-inline strong { color: #fff; }

.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin: 30px 4px 14px; }
.section-heading.compact { margin-top: 26px; }
.quick-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.quick-card { min-height: 148px; display: flex; flex-direction: column; align-items: flex-start; padding: 17px; border: 1px solid transparent; border-radius: 20px; text-align: left; box-shadow: var(--shadow); transition: transform .15s ease, box-shadow .15s ease; }
.quick-card:active { transform: scale(.98); }
.quick-card strong { margin-top: auto; color: var(--ink); font-size: 16px; }
.quick-card small { margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.35; }
.quick-card.blue { background: var(--blue-soft); border-color: #cde4f7; }
.quick-card.purple { background: var(--purple-soft); border-color: #e4d3e8; }
.quick-card.teal { background: var(--teal-soft); border-color: #cbe8e6; }
.quick-card.red { background: var(--red-soft); border-color: #f5d4d9; }
.quick-icon { width: 39px; height: 39px; display: grid; place-items: center; border-radius: 13px; color: #fff; font-size: 23px; font-weight: 700; }
.blue .quick-icon { background: var(--blue); }.purple .quick-icon { background: var(--purple); }.teal .quick-icon { background: var(--teal); }.red .quick-icon { background: var(--red); }
.quick-card.gold { background: var(--gold-soft); border-color: #f0dfb6; }
.quick-card.navy { background: #e9f0f7; border-color: #d3dfeb; }
.gold .quick-icon { background: var(--gold); font-size: 15px; }.navy .quick-icon { background: var(--navy); }

.panel { margin-top: 16px; padding: 21px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 4px 18px rgba(29, 64, 94, .045); }
.panel-title-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 18px; }
.completion-badge, .section-count { flex: 0 0 auto; padding: 6px 9px; border-radius: 99px; background: var(--blue-soft); color: var(--navy); font-size: 11px; font-weight: 800; }
.mini-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mini-stats div { display: flex; flex-direction: column; padding: 14px 10px; border-radius: 14px; background: #f4f7fa; text-align: center; }
.mini-stats strong { color: var(--navy); font-size: 25px; line-height: 1; }
.mini-stats span { margin-top: 5px; color: var(--muted); font-size: 11px; }
.link-list { display: grid; gap: 8px; }
.link-list a { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 13px 14px; border-radius: 13px; background: #f4f7fa; color: var(--ink); font-size: 14px; font-weight: 750; text-decoration: none; }
.link-list b { color: var(--blue); font-size: 18px; }

.page-intro { margin: -20px -16px 16px; padding: 30px 22px 26px; color: #fff; border-radius: 0 0 28px 28px; }
.page-intro p:last-child { max-width: 560px; margin: 10px 0 0; color: rgba(255,255,255,.83); font-size: 14px; }
.page-intro .overline { color: rgba(255,255,255,.66); }
.blue-intro { background: linear-gradient(135deg, #0b6db6, #3394cf); }
.purple-intro { background: linear-gradient(135deg, #552067, #8a3b91); }
.teal-intro { background: linear-gradient(135deg, #176e75, #32a3a1); }
.navy-intro { background: linear-gradient(135deg, #143a62, #315f89); }
.gold-intro { background: linear-gradient(135deg, #785019, #bd8427); }

.form-grid { display: grid; gap: 14px; }
.form-grid.two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .wide { grid-column: 1 / -1; }
label { display: flex; flex-direction: column; gap: 7px; color: var(--ink); font-size: 14px; font-weight: 780; }
input, textarea, select {
  width: 100%;
  min-height: 45px;
  padding: 11px 12px;
  border: 1px solid #cfdbe6;
  border-radius: 12px;
  outline: none;
  background: #fbfcfd;
  color: var(--ink);
  font-weight: 500;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
textarea { resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(8,120,209,.11); background: #fff; }
input::placeholder, textarea::placeholder { color: #96a5b3; }
.week-34-field { grid-column: 2; }
.week-34-field input[readonly] { background: #eef5fa; color: var(--navy); font-weight: 750; }
.week-34-help { grid-column: 2; margin-top: -10px; color: var(--muted); font-size: 12px; }
.due-date-help { grid-column: 2; margin-top: -10px; color: var(--muted); font-size: 12px; }
#due-date-field[readonly] { background: #eef5fa; color: var(--navy); font-weight: 750; }
.calculated-field[readonly] { background: #eef5fa; color: var(--navy); font-weight: 750; }
.procedure-checklist { display: grid; gap: 11px; }
.procedure-check-item { display: grid; grid-template-columns: 46px 1fr; gap: 13px; align-items: start; padding: 15px; border: 1px solid var(--line); border-radius: 16px; background: #fbfcfd; transition: border-color .15s, background .15s; }
.procedure-check-item.is-complete { border-color: #bcded3; background: #f0f8f5; }
.procedure-check-control { position: relative; width: 42px; height: 42px; display: block; }
.procedure-check-control input { position: absolute; width: 1px; height: 1px; min-height: 0; margin: 0; padding: 0; opacity: 0; }
.procedure-check-control span { width: 42px; height: 42px; display: grid; place-items: center; border: 2px solid #c3d0db; border-radius: 13px; background: #fff; color: transparent; font-size: 22px; font-weight: 900; transition: .15s; }
.procedure-check-control input:focus-visible + span { outline: 3px solid rgba(8,120,209,.2); outline-offset: 2px; }
.procedure-check-control input:checked + span { border-color: var(--teal); background: var(--teal); color: #fff; }
.procedure-check-copy { min-width: 0; }
.procedure-check-copy > strong { display: block; color: var(--ink); font-size: 16px; line-height: 1.25; }
.procedure-check-copy small { display: block; margin-top: 4px; color: var(--muted); font-size: 13px; line-height: 1.4; }
.procedure-check-copy p { margin: 9px 0 0; color: #5a6f81; font-size: 12px; }
.procedure-check-copy p b { color: var(--navy); }
.procedure-link { width: fit-content; display: inline-flex; align-items: center; gap: 7px; margin-top: 11px; padding: 9px 11px; border-radius: 10px; background: var(--gold-soft); color: #79500f; font-size: 12px; font-weight: 850; text-decoration: none; }
.procedure-link:hover { text-decoration: underline; }
.procedure-disclaimer { display: flex; gap: 13px; align-items: flex-start; border-left: 4px solid var(--gold); }
.procedure-disclaimer .privacy-icon { flex: 0 0 auto; }
.procedure-disclaimer h2 { font-size: 17px; }
.procedure-disclaimer p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.record-list { display: grid; gap: 12px; }
.record-card { overflow: hidden; border: 1px solid var(--line); border-radius: 17px; background: #fff; box-shadow: 0 3px 12px rgba(27,59,88,.035); }
.record-card summary { display: flex; align-items: center; gap: 12px; min-height: 65px; padding: 13px 16px; cursor: pointer; list-style: none; }
.record-card summary::-webkit-details-marker { display: none; }
.record-index { width: 36px; height: 36px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 12px; background: var(--blue-soft); color: var(--blue); font-weight: 850; }
.record-title { min-width: 0; display: flex; flex-direction: column; }
.record-title strong { font-size: 14px; }
.record-title small { overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.record-chevron { margin-left: auto; color: var(--muted); transform: rotate(90deg); transition: transform .15s; }
details[open] .record-chevron { transform: rotate(-90deg); }
.record-body { padding: 2px 16px 18px; border-top: 1px solid #edf2f6; }
.record-body .form-grid { padding-top: 15px; }
.lab-occurrence { padding-top: 15px; }
.lab-occurrence + .lab-occurrence { margin-top: 16px; border-top: 1px solid var(--line); }
.lab-occurrence h3 { margin: 0 0 2px; color: var(--purple); font-size: 14px; }
.lab-fields { grid-template-columns: minmax(125px, .8fr) minmax(140px, .9fr) 1.5fr; }
.compact-record-list { display: grid; gap: 10px; }
.compact-row { display: grid; grid-template-columns: minmax(120px, 1.3fr) 1fr 1.2fr; gap: 10px; align-items: end; padding: 12px; border-radius: 14px; background: #f5f8fa; }
.compact-row.vaccine-row { grid-template-columns: minmax(105px, 1.2fr) 1fr .75fr 1.25fr; }
.compact-row strong { align-self: center; font-size: 13px; }
.compact-row label { font-size: 11px; }
.compact-row input { min-height: 40px; padding: 8px 9px; font-size: 13px; }
.text-button { border: 0; background: transparent; color: var(--blue); font-size: 13px; font-weight: 800; }
.procedure-path { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; margin-top: 18px; padding: 14px; border-radius: 14px; background: var(--purple-soft); color: var(--purple); font-size: 11px; font-weight: 800; text-align: center; }
.procedure-path b { font-size: 16px; }

.urgent-panel { margin-top: 16px; overflow: hidden; border-radius: 22px; background: var(--red); color: #fff; box-shadow: 0 10px 28px rgba(164, 42, 58, .19); }
.urgent-heading { display: flex; gap: 13px; align-items: center; padding: 20px 21px 16px; }
.urgent-heading > span { width: 40px; height: 40px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; background: #fff; color: var(--red); font-size: 22px; font-weight: 900; }
.urgent-heading .overline { color: rgba(255,255,255,.72); }
.urgent-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; margin: 0; padding: 0; background: rgba(255,255,255,.2); list-style-position: inside; }
.urgent-list li { padding: 15px 16px; background: #b93648; font-size: 12px; font-weight: 600; }
.urgent-addresses { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: rgba(255,255,255,.2); }
.urgent-addresses > div { display: flex; gap: 10px; align-items: flex-start; padding: 15px 16px; background: #a92f40; }
.urgent-addresses span { font-size: 22px; }.urgent-addresses p { margin: 0; font-size: 12px; }
.medical-note { margin: 0; padding: 13px 18px 16px; background: #922737; color: #ffe9ec; font-size: 11px; font-weight: 650; text-align: center; }
.healthy-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; margin: 0; padding: 0; list-style: none; }
.healthy-grid li { display: flex; gap: 9px; align-items: flex-start; min-height: 76px; padding: 11px; border-radius: 13px; background: var(--teal-soft); color: #185f63; font-size: 12px; font-weight: 750; }
.healthy-grid b { width: 29px; height: 29px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 9px; background: var(--teal); color: #fff; }
.healthy-grid span { display: flex; flex-direction: column; gap: 3px; }
.healthy-grid span strong { color: #185f63; font-size: 13px; line-height: 1.25; }
.healthy-grid span small { color: #4b7173; font-size: 11px; line-height: 1.35; }
.health-tool-list { display: grid; gap: 11px; }
.health-tool-card { overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: #fbfcfd; }
.health-tool-card summary { display: flex; align-items: center; gap: 12px; min-height: 72px; padding: 13px 15px; cursor: pointer; list-style: none; }
.health-tool-card summary::-webkit-details-marker { display: none; }
.health-tool-icon { width: 42px; height: 42px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 13px; color: #fff; font-size: 22px; font-weight: 800; }
.food-icon { background: var(--teal); }.steps-icon { background: var(--blue); }
.vaccine-tool-card { border-color: #cfe0ec; }
.vaccine-tool-card > summary { background: #f7fbfd; }
.vaccine-icon { background: var(--blue); }
.vaccine-fields { grid-template-columns: minmax(150px, 1fr) minmax(150px, 1fr); }
.vaccine-fields .wide { grid-column: 1 / -1; }
.health-tool-title { min-width: 0; display: flex; flex: 1; flex-direction: column; gap: 2px; }
.health-tool-title strong { font-size: 15px; }.health-tool-title small { color: var(--muted); font-size: 12px; line-height: 1.35; }
.health-tool-body { padding: 17px; border-top: 1px solid var(--line); background: #fff; }
.diet-profile-note { margin: 10px 0 13px; color: var(--muted); font-size: 13px; }
.diet-menu { padding: 15px; border-radius: 15px; background: var(--teal-soft); }
.diet-menu h3 { margin: 0 0 5px; color: #185f63; font-size: 16px; }.diet-menu > p { margin: 0 0 12px; color: #3f6f71; font-size: 13px; }
.diet-menu dl { display: grid; gap: 7px; margin: 0; }.diet-menu dl div { display: grid; grid-template-columns: 82px 1fr; gap: 9px; padding-top: 7px; border-top: 1px solid rgba(39,141,145,.18); }
.diet-menu dt { color: #185f63; font-size: 12px; font-weight: 850; }.diet-menu dd { margin: 0; color: #365f61; font-size: 12px; }
.diet-empty { color: #4f7375; font-size: 13px; font-weight: 700; text-align: center; }
.nutrition-note { margin: 13px 0 0; color: #5b6f80; font-size: 12px; line-height: 1.45; }
.tool-instruction { margin: 0 0 13px; color: var(--muted); font-size: 13px; }
.weekly-steps-list { display: grid; gap: 9px; }
.weekly-step-row { display: grid; grid-template-columns: 32px 1fr 1fr; gap: 9px; align-items: end; padding: 10px; border-radius: 13px; background: #f4f8fb; }
.weekly-step-row > strong { width: 32px; height: 32px; display: grid; place-items: center; align-self: center; border-radius: 10px; background: var(--blue); color: #fff; font-size: 12px; }
.weekly-step-row label { font-size: 12px; }.weekly-step-row input { min-height: 40px; padding: 8px 9px; font-size: 13px; }
.mental-health-panel { border-top: 5px solid var(--purple); }
.mental-health-tool { border-color: #ddd4e6; }
.mental-health-tool > summary { background: #fcf9fd; }
.mental-health-heading { display: flex; gap: 13px; align-items: center; margin-bottom: 14px; }
.mental-health-icon { width: 44px; height: 44px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 14px; background: var(--purple); color: #fff; font-size: 24px; }
.epds-recommendation { margin: 9px 0 17px; padding: 11px 13px; border-left: 4px solid var(--purple); border-radius: 0 11px 11px 0; background: var(--purple-soft); color: #604269; font-size: 13px; line-height: 1.4; }
.epds-meta-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; align-items: stretch; margin: 0 0 20px; }
.epds-date { margin: 0; }
.epds-gestational-age { display: flex; flex-direction: column; justify-content: center; gap: 6px; min-height: 70px; padding: 10px 12px; border: 1px solid #d8dfe6; border-radius: 12px; background: #f5f8fa; }
.epds-gestational-age span { color: var(--ink); font-size: 12px; font-weight: 800; }
.epds-gestational-age strong { color: var(--purple); font-size: 17px; }
.epds-list { display: grid; gap: 13px; }
.epds-question { min-width: 0; margin: 0; padding: 16px; border: 1px solid #ddd4e6; border-radius: 16px; background: #fcf9fd; }
.epds-question legend { width: 100%; display: flex; gap: 10px; align-items: flex-start; padding: 0; color: var(--ink); font-size: 14px; font-weight: 800; line-height: 1.4; }
.epds-question legend span { width: 27px; height: 27px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 9px; background: var(--purple); color: #fff; font-size: 12px; }
.epds-options { display: grid; gap: 7px; margin-top: 13px; }
.epds-options label { position: relative; display: flex; flex-direction: row; gap: 10px; align-items: center; min-height: 44px; padding: 10px 12px; border: 1px solid #e2dce8; border-radius: 12px; background: #fff; color: #465d72; font-size: 13px; font-weight: 650; cursor: pointer; }
.epds-options input { width: 18px; height: 18px; min-height: 0; flex: 0 0 auto; padding: 0; accent-color: var(--purple); }
.epds-options label:has(input:checked) { border-color: var(--purple); background: var(--purple-soft); color: #51205c; box-shadow: 0 0 0 2px rgba(112,34,124,.08); }
.epds-result { display: flex; justify-content: space-between; gap: 20px; align-items: center; margin-top: 18px; padding: 17px; border: 1px solid #d9e2ea; border-radius: 16px; background: #f5f8fa; }
.epds-result div { display: flex; flex-direction: column; flex: 0 0 auto; }
.epds-result span { color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; }
.epds-result strong { color: var(--navy); font-size: 23px; }
.epds-result p { margin: 0; color: #526b7d; font-size: 13px; }
.epds-result[data-status="elevated"] { border-color: #e4c277; background: #fff8e8; }
.epds-result[data-status="urgent"] { border-color: #e0a5ad; background: var(--red-soft); }
.epds-result[data-status="urgent"] strong { color: var(--red); }
.epds-result[data-status="reassuring"] { border-color: #bfdfd4; background: #edf8f4; }
.epds-urgent { margin-top: 12px; padding: 16px; border-radius: 15px; background: var(--red); color: #fff; }
.epds-urgent strong { font-size: 16px; }.epds-urgent p { margin: 4px 0 0; color: #fff2f4; font-size: 13px; font-weight: 650; }
.epds-disclaimer { margin: 17px 0 0; color: #4c6477; font-size: 12px; }
.epds-source { margin: 10px 0 0; padding-top: 10px; border-top: 1px solid var(--line); color: #728395; font-size: 10px; line-height: 1.4; }
.body-copy { color: var(--muted); font-size: 14px; }
.handoff-card { display: flex; gap: 12px; align-items: flex-start; margin: 16px 0; padding: 14px; border: 1px solid #cce5df; border-radius: 15px; background: #edf8f5; }
.handoff-icon { width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 11px; background: var(--teal); color: #fff; font-weight: 900; }
.handoff-card strong { color: #185f63; font-size: 14px; }
.handoff-card p { margin: 3px 0 0; color: #4c6e70; font-size: 12px; line-height: 1.45; }
body:not([data-app-mode="professional"]) [data-professional-only] { display: none !important; }
.patient-mode-card { display: flex; gap: 13px; align-items: flex-start; padding: 16px; border: 1px solid #cce5df; border-radius: 16px; background: #edf8f5; }
.patient-mode-card[hidden] { display: none !important; }
.patient-mode-content { min-width: 0; flex: 1; }
.patient-mode-icon { width: 40px; height: 40px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 13px; background: var(--teal); color: #fff; font-size: 21px; }
.patient-mode-card h2 { margin-top: 2px; color: #185f63; font-size: 17px; }
.patient-mode-content > p:not(.overline) { margin: 6px 0 0; color: #4c6e70; font-size: 13px; line-height: 1.45; }
.patient-share-button { width: 100%; margin-top: 14px; }
.review-return-card { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; margin-top: 14px; padding: 14px; border: 1px solid #b8ddd4; border-radius: 15px; background: #edf8f5; }
.review-return-card[hidden] { display: none !important; }
.review-return-copy strong { color: #185f63; font-size: 14px; }
.review-return-copy p { margin: 3px 0 0; color: #4c6e70; font-size: 12px; line-height: 1.45; }
.review-return-card button { grid-column: 1 / -1; width: 100%; }
.action-stack { display: grid; gap: 10px; }
.primary-button, .secondary-button, .danger-button { min-height: 48px; padding: 12px 16px; border-radius: 13px; font-weight: 800; }
.primary-button { border: 1px solid var(--navy); background: var(--navy); color: #fff; }
.transfer-button { border-color: #237d80; background: var(--teal); color: #fff; }
.secondary-button { border: 1px solid #cddae5; background: #fff; color: var(--navy); }
.new-patient-button { border-color: #9eb8ca; background: #edf4fa; }
.primary-button:disabled, .secondary-button:disabled, .danger-button:disabled { cursor: not-allowed; opacity: .5; }
.advanced-tools { margin-top: 16px; border-top: 1px solid var(--line); }
.advanced-tools summary { padding: 15px 2px 8px; color: var(--muted); font-size: 13px; font-weight: 800; cursor: pointer; }
.advanced-tools .action-stack { padding-top: 8px; }
.danger-button { width: 100%; margin-top: 16px; border: 1px solid #f0c9cf; background: #fff2f4; color: #a92f40; }
.privacy-panel { display: flex; gap: 15px; background: #eaf4f1; border-color: #d2e9e2; }
.privacy-icon { width: 44px; height: 44px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 14px; background: #3e9480; color: #fff; font-size: 22px; }
.privacy-panel p:last-child, .disclaimer-panel p { margin: 8px 0 0; color: #466578; font-size: 13px; }
.disclaimer-panel { border-left: 4px solid var(--purple); }
.auto-calc-card { display: flex; justify-content: space-between; gap: 18px; align-items: center; margin-top: 18px; padding: 15px 16px; border: 1px solid #c9e4f7; border-radius: 15px; background: var(--blue-soft); }
.auto-calc-card div { display: flex; flex-direction: column; gap: 2px; }
.auto-calc-card span { color: var(--muted); font-size: 12px; font-weight: 750; }
.auto-calc-card strong { color: var(--navy); font-size: 20px; }
.auto-calc-card small { max-width: 260px; color: #4e6c83; font-size: 12px; line-height: 1.4; }

.bottom-nav {
  position: fixed;
  z-index: 30;
  left: 50%;
  bottom: 0;
  width: min(100%, 760px);
  height: calc(75px + var(--safe-bottom));
  padding: 7px 10px var(--safe-bottom);
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  transform: translateX(-50%);
  background: rgba(255,255,255,.96);
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -8px 28px rgba(23, 58, 87, .1);
  backdrop-filter: blur(16px);
}
.bottom-nav button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 0; border-radius: 13px; background: transparent; color: #718294; }
.bottom-nav button > span { font-size: 22px; line-height: 1; }
.bottom-nav small { font-size: 10px; font-weight: 750; }
.bottom-nav button.active { background: #edf4fa; color: var(--navy); }
.save-toast { position: fixed; z-index: 50; left: 50%; bottom: calc(88px + var(--safe-bottom)); padding: 9px 14px; border-radius: 99px; background: #173f6b; color: #fff; box-shadow: var(--shadow); font-size: 12px; font-weight: 750; opacity: 0; transform: translate(-50%, 10px); pointer-events: none; transition: .2s; }
.save-toast.show { opacity: 1; transform: translate(-50%, 0); }
.app-copyright { margin: 24px 0 0; padding: 18px 12px 2px; border-top: 1px solid var(--line); color: #728395; font-size: 12px; font-weight: 700; text-align: center; }
.print-report { display: none; }

dialog { max-width: 420px; width: calc(100% - 32px); padding: 0; border: 0; border-radius: 22px; box-shadow: 0 25px 70px rgba(11,35,57,.3); }
dialog::backdrop { background: rgba(11, 33, 53, .58); backdrop-filter: blur(3px); }
.dialog-card { padding: 25px; text-align: center; }
.dialog-icon { width: 50px; height: 50px; margin: 0 auto 13px; display: grid; place-items: center; border-radius: 50%; background: var(--red-soft); color: var(--red); font-size: 24px; font-weight: 900; }
.dialog-icon.transfer-icon { background: var(--teal-soft); color: var(--teal); }
.dialog-icon.consent-icon { background: var(--blue-soft); color: var(--blue); }
.dialog-card p { color: var(--muted); font-size: 14px; }.dialog-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }.dialog-actions .danger-button { margin: 0; }
.dialog-fields { display: grid; gap: 12px; margin-top: 17px; text-align: left; }
.dialog-fields label { font-size: 13px; }
.dialog-card .form-error { min-height: 18px; margin: -3px 0 0; color: var(--red); font-size: 12px; font-weight: 750; }
.confirmation-check { display: flex; flex-direction: row; gap: 10px; align-items: flex-start; margin-top: 18px; padding: 13px; border: 1px solid var(--line); border-radius: 13px; background: #f6f8fa; color: #405a6e; font-size: 13px; font-weight: 700; line-height: 1.4; text-align: left; }
.confirmation-check input { width: 19px; height: 19px; min-height: 0; flex: 0 0 auto; margin: 0; padding: 0; accent-color: var(--teal); }
.consent-card { text-align: left; }
.consent-card .dialog-icon, .consent-card .overline, .consent-card h2 { text-align: center; }
.consent-list { display: grid; gap: 10px; margin: 17px 0 0; padding-left: 21px; color: #476174; font-size: 13px; line-height: 1.45; }
.consent-list li::marker { color: var(--teal); font-weight: 900; }
.full-button { width: 100%; margin-top: 16px; }
.share-options { display: grid; gap: 10px; margin-top: 18px; }
.share-option { min-height: 50px; display: flex; gap: 10px; align-items: center; justify-content: center; padding: 12px 16px; border-radius: 13px; color: #fff; font-size: 14px; font-weight: 850; text-decoration: none; }
.share-option span { font-size: 19px; }
.whatsapp-option { background: #207b57; }
.email-option { background: var(--navy); }
.share-link-output { min-height: 70px; margin-top: 12px; padding: 10px; color: #6e8090; font-size: 10px; line-height: 1.3; }
.incoming-warning { padding: 11px 12px; border-radius: 11px; background: var(--red-soft); color: var(--red) !important; font-size: 12px !important; font-weight: 750; }

@media (max-width: 540px) {
  .app-header { padding-left: 14px; padding-right: 14px; }
  .brand-copy .eyebrow { display: none; }
  .local-pill { padding: 7px 9px; }
  .form-grid.two-col { grid-template-columns: 1fr; }
  .form-grid .wide { grid-column: auto; }
  .week-34-field, .week-34-help, .due-date-help { grid-column: auto; }
  .lab-fields { grid-template-columns: 1fr 1fr; }
  .lab-fields .wide { grid-column: 1 / -1; }
  .compact-row { grid-template-columns: 1fr 1fr; }
  .compact-row strong { grid-column: 1 / -1; }
  .compact-row.vaccine-row { grid-template-columns: 1fr 1fr; }
  .compact-row.vaccine-row strong { grid-column: 1 / -1; }
  .compact-row.vaccine-row label:last-child { grid-column: 1 / -1; }
  .vaccine-fields { grid-template-columns: 1fr; }
  .vaccine-fields .wide { grid-column: auto; }
  .progress-copy { flex-direction: column; gap: 2px; }
  .urgent-list { grid-template-columns: 1fr; }
  .urgent-addresses { grid-template-columns: 1fr; }
  .auto-calc-card { align-items: flex-start; flex-direction: column; gap: 6px; }
  .epds-meta-grid { grid-template-columns: 1fr; }
  .epds-result { align-items: flex-start; flex-direction: column; gap: 8px; }
  .weekly-step-row { grid-template-columns: 32px 1fr; }
  .weekly-step-row label:last-child { grid-column: 2; }
  .bottom-nav { padding-left: 6px; padding-right: 6px; }
  .bottom-nav button { border-radius: 11px; }
  .bottom-nav button > span { font-size: 20px; }
  .bottom-nav small { font-size: 9px; }
}

@media (min-width: 761px) {
  .app-header { padding-left: calc((100vw - 760px) / 2 + 12px); padding-right: calc((100vw - 760px) / 2 + 12px); }
  .bottom-nav { bottom: 12px; height: 72px; border-radius: 22px; border-bottom: 1px solid var(--line); }
  .app-shell { padding-bottom: 110px; }
  .save-toast { bottom: 96px; }
}

@media print {
  @page { size: A4; margin: 12mm; }
  body { background: #fff; color: #172f46; font-size: 10.5px; }
  .app-header, .bottom-nav, .save-toast, .view, .app-copyright { display: none !important; }
  .app-shell { width: 100%; max-width: none; padding: 0; }
  .print-report { display: block !important; }
  .print-report-header { display: flex; justify-content: space-between; gap: 24px; padding: 0 0 14px; border-bottom: 3px solid var(--navy); }
  .print-report-header p { margin: 0 0 2px; color: #5f7386; font-size: 9px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
  .print-report-header h1 { margin: 0 0 5px; color: var(--navy); font-size: 24px; }
  .print-report-header strong { font-size: 14px; }
  .print-report-meta { display: flex; flex-direction: column; align-items: flex-end; justify-content: flex-end; color: #607486; font-size: 9px; text-align: right; }
  .print-section { margin-top: 14px; }
  .print-section > h2 { margin: 0 0 7px; padding-bottom: 4px; border-bottom: 1px solid #cbd8e3; color: var(--navy); font-size: 15px; }
  .print-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px 14px; margin: 0; }
  .print-fields div { min-width: 0; padding: 5px 7px; border-radius: 5px; background: #f3f6f8; break-inside: avoid; }
  .print-fields dt { color: #64788a; font-size: 8.5px; font-weight: 800; text-transform: uppercase; }
  .print-fields dd { margin: 1px 0 0; color: #162f46; font-size: 10.5px; font-weight: 650; white-space: pre-wrap; overflow-wrap: anywhere; }
  .print-record { margin: 0 0 8px; padding: 8px; border: 1px solid #d6e0e8; border-radius: 7px; break-inside: avoid; }
  .print-record h3 { margin: 0 0 6px; color: #294f70; font-size: 11px; }
  .print-complementary { display: grid; grid-template-columns: repeat(2, 1fr); gap: 5px 12px; margin: 0; padding: 0; list-style: none; }
  .print-complementary li { padding: 6px 8px; border-left: 3px solid var(--teal); background: #f2f7f7; font-weight: 750; break-inside: avoid; }
  .print-report-footer { display: flex; justify-content: space-between; gap: 16px; margin-top: 18px; padding-top: 8px; border-top: 1px solid #cbd8e3; color: #66798a; font-size: 8.5px; }
}

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