:root {
  color-scheme: light;
  --ink: #17332d;
  --muted: #4c635a;
  --green: #19483e;
  --light: #f6f7f1;
  --line: #ccd7ce;
  font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
  line-height: 1.5;
  color: var(--ink);
  background: var(--light);
}

* { box-sizing: border-box; }
body { margin: 0; }
h1, h2, p, ul, dl, dd { margin: 0; }
h1, h2 { line-height: 1.15; font-weight: 650; letter-spacing: -.035em; }
h1 { font-size: clamp(1.75rem, 3vw, 2.5rem); }
p, small { color: var(--muted); }
a { color: var(--green); text-underline-offset: 3px; }
button, input { font: inherit; }
button, summary { cursor: pointer; }
a:focus-visible, input:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 3px solid #35744b;
  outline-offset: 3px;
}
.icon { flex: none; display: block; width: 20px; height: 20px; }
.skip-link { position: fixed; top: -6rem; left: 1rem; z-index: 1; padding: .7rem; background: white; }
.skip-link:focus { top: 1rem; }
.site-header {
  max-width: 77rem;
  min-height: 5.5rem;
  margin: auto;
  padding: 1rem clamp(1rem, 5vw, 4rem);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .8rem;
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: .7rem; text-decoration: none; }
.brand-symbol {
  display: grid;
  place-items: center;
  width: 2.7rem;
  height: 2.7rem;
  color: #d5ebad;
  background: var(--green);
  border-radius: 13px 13px 13px 4px;
}
.brand-symbol .icon { width: 1.65rem; height: 1.65rem; }
.brand strong { display: block; color: var(--ink); font-size: 1.35rem; line-height: 1.05; letter-spacing: -.055em; }
.brand-product { display: block; color: var(--muted); font-size: .74rem; margin-top: .15rem; }
.demo-label { padding: .3rem .7rem; border: 1px solid var(--line); border-radius: 1rem; font-size: .78rem; }
.login-layout {
  display: grid;
  grid-template-columns: .9fr 1fr;
  width: min(calc(100% - 3rem), 61rem);
  margin: clamp(2rem, 8vh, 5rem) auto;
  border: 1px solid var(--line);
  border-radius: 1.25rem;
  background: white;
  overflow: hidden;
  box-shadow: 0 15px 45px -32px #29483e80;
}
.context-panel { padding: clamp(2rem, 4.5vw, 4rem); background: var(--green); color: #fff; }
.location { display: flex; align-items: center; gap: .45rem; font-size: .84rem; font-weight: 550; }
.location .icon { width: 16px; height: 16px; }
.context-panel .location { color: #d4e8be; }
.context-panel h2 { margin: clamp(2rem, 7vw, 6rem) 0 1rem; max-width: 8.4em; font-size: clamp(2.5rem, 5vw, 4.1rem); }
.context-panel p { color: #d9e8df; max-width: 30ch; font-size: 1.03rem; line-height: 1.65; }
.login-card { padding: clamp(1.6rem, 4.5vw, 3.5rem); min-width: 0; }
.login-card > p { margin-top: .6rem; }
.login-tabs { display: flex; gap: .25rem; margin-bottom: 2rem; padding: .25rem; border-radius: .65rem; background: #ecf1e9; }
.login-tabs a { flex: 1; justify-content: center; display: flex; align-items: center; gap: .4rem; padding: .55rem .25rem; min-height: 44px; border-radius: .45rem; text-decoration: none; font-size: .94rem; }
.login-tabs a[aria-current="page"] { background: white; box-shadow: 0 1px 4px #233c2b25; font-weight: 650; }
.login-tabs .icon { width: 17px; height: 17px; }
.login-form { margin-top: 1.5rem; display: grid; gap: 1.15rem; }
.field { display: grid; gap: .35rem; }
.field label, summary { font-weight: 600; }
.field label { font-size: .92rem; }
.field input { width: 100%; min-height: 48px; border: 1px solid #85998a; border-radius: .5rem; padding: .6rem .8rem; color: var(--ink); background: #fff; font-size: 1rem; }
.field input::placeholder { color: #61746b; }
.secret-input { position: relative; }
.secret-input input { padding-right: 4.65rem; }
.secret-input button { min-width: 44px; min-height: 44px; position: absolute; right: 2px; top: 2px; padding: .4rem .65rem; border: none; background: transparent; font-weight: 600; color: var(--green); font-size: .85rem; }
.primary, .secondary { border-radius: .5rem; min-height: 44px; font-weight: 600; }
.primary { background: var(--green); border: 1px solid var(--green); color: white; padding: .8rem 1rem; display: flex; align-items: center; justify-content: space-between; }
.primary:hover { background: #0d372e; }
.primary:disabled { opacity: .68; }
.secondary { padding: .45rem 1rem; color: var(--green); border: 1px solid var(--line); background: white; }
details { border-top: 1px solid var(--line); margin-top: 1.5rem; padding-top: .35rem; font-size: .9rem; }
summary { min-height: 44px; padding: .7rem 0; color: var(--green); }
details ul { padding: .6rem 0 0 1.2rem; overflow-wrap: anywhere; }
.message { padding: .75rem; margin-top: 1rem; border: 1px solid; border-radius: .45rem; font-size: .92rem; }
.message.error { color: #813b2c; background: #fff2ea; }
.message.success { color: #2e5e3d; background: #eff7ed; }
.workspace { width: min(calc(100% - 3rem), 60rem); margin: 2.5rem auto; }
.workspace-heading { padding: clamp(1.35rem, 4vw, 2.5rem); border-radius: 1rem; background: #deeadc; }
.workspace-heading .location { color: #405e4b; }
.workspace-heading h1 { margin: 1.1rem 0 .45rem; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .7rem; margin-top: 1rem; }
.stats div, .panel { background: white; border: 1px solid var(--line); border-radius: .8rem; }
.stats div { display: flex; flex-direction: column-reverse; padding: 1rem; }
.stats dt { font-size: .9rem; color: var(--muted); }
.stats dd { font-weight: 600; font-size: 1.7rem; }
.panel { margin-top: 1rem; padding: clamp(1rem, 3vw, 1.8rem); }
.panel h2 { font-size: 1.35rem; margin-bottom: 1rem; }
.facility-list { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.facility-list li { display: flex; align-items: flex-start; gap: .55rem; }
.facility-list li .icon { color: #52765b; margin-top: .2rem; }
.facility-list span { display: block; color: var(--muted); font-size: .88rem; }
table { border-collapse: collapse; width: 100%; text-align: left; }
th, td { padding: .75rem .4rem; vertical-align: top; border-bottom: 1px solid var(--line); }
th { font-weight: 600; }
thead th, .account dt { color: var(--muted); font-size: .88rem; }
tbody tr:last-child > * { border: 0; }
.account { max-width: 45rem; }
.account dl > div { padding: .75rem 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: 1fr 1.35fr; gap: 1rem; align-items: baseline; }
.account dd { font-weight: 600; }
.maternal-id { letter-spacing: .05em; font-variant-numeric: tabular-nums; }
footer { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; color: var(--muted); font-size: .85rem; margin: 1.5rem 0; }
footer span:first-child { display: flex; align-items: center; gap: .35rem; }
footer .icon { height: 16px; width: 16px; }
.error-panel { max-width: 38rem; }
.error-panel h1 { margin: .75rem 0 1.3rem; }
.error-panel a { display: inline-block; padding: .5rem 0; }

@media (max-width: 43rem) {
  .site-header { min-height: 4.5rem; }
  .login-layout { display: block; max-width: 32rem; margin: 1.25rem auto; }
  .context-panel { padding: .8rem 1.25rem; }
  .context-panel h2, .context-panel p { display: none; }
  .login-tabs { margin-bottom: 1.3rem; }
  .workspace { margin: 1.25rem auto; }
  .facility-list { grid-template-columns: 1fr; }
}

@media (max-width: 28rem) {
  .login-layout, .workspace { width: calc(100% - 1.5rem); }
  .login-card { padding: 1.25rem; }
  .site-header { padding: .65rem .85rem; }
  .demo-label { font-size: .72rem; }
  .stats { gap: .35rem; }
  .stats div { padding: .62rem; }
  .stats dt, th, td { font-size: .82rem; overflow-wrap: anywhere; }
  .account dl > div { grid-template-columns: 1fr; gap: .2rem; }
}

.care-workspace, .mother-space { max-width: 48rem; overflow-wrap: anywhere; }
.care-toolbar { display: flex; align-items: center; justify-content: space-between; gap: .8rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.care-toolbar > a { display: inline-flex; align-items: center; min-height: 44px; }
.language-switch { display: inline-flex; align-items: center; gap: .15rem; padding: .15rem; border: 1px solid var(--line); background: #fff; border-radius: .6rem; margin: 0; }
.workspace > .language-switch { margin-bottom: 1rem; }
.login-card .language-switch { margin: -.25rem 0 .9rem; }
.language-switch a, .language-switch button { display: inline-grid; place-items: center; min-width: 4rem; min-height: 44px; padding: .35rem .65rem; border: 0; border-radius: .45rem; background: transparent; color: var(--green); font-size: .88rem; text-decoration: none; }
.language-switch [aria-current="true"], .language-switch [aria-pressed="true"] { background: #deeadc; font-weight: 650; }
.workspace-actions { display: grid; margin-top: 1.2rem; align-items: start; gap: .2rem; }
.action-link { display: inline-flex; gap: 1rem; justify-self: start; color: white; text-decoration: none; }
.open-form { display: grid; gap: .8rem; width: 100%; max-width: 45rem; }
.open-form h2, .care-form h2 { margin: 0; }
.open-form button, .care-form .primary { justify-self: start; }
.care-form { display: grid; gap: 1rem; }
.care-form > small { margin-top: -.5rem; }
.care-form fieldset { min-width: 0; margin: .25rem 0 0; border: 0; border-top: 1px solid var(--line); padding: .65rem 0 0; }
.care-form legend { padding-right: .8rem; font-weight: 650; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 1rem; }
.field select, .field textarea { font: inherit; width: 100%; min-height: 48px; border: 1px solid #85998a; border-radius: .5rem; background: #fff; color: var(--ink); padding: .6rem .8rem; }
.field textarea { resize: vertical; }
.field { min-width: 0; }
.field select:focus-visible, .field textarea:focus-visible { outline: 3px solid #35744b; outline-offset: 3px; }
.care-form .primary { gap: 1rem; }
.consent-option { display: flex; gap: .7rem; align-items: flex-start; line-height: 1.5; cursor: pointer; }
.consent-option input { flex: none; width: 1.3rem; height: 1.3rem; margin: .12rem 0 0; accent-color: var(--green); }
.message ul { padding-left: 1.2rem; }
.care-form .message { margin: 0; }
.identity > div { display: flex; flex-wrap: wrap; gap: .6rem 1rem; justify-content: space-between; align-items: baseline; }
.identity .maternal-id { font-size: 1.35rem; }
.identity details, .visit-entry { margin-top: .7rem; }
.record-data { display: grid; gap: .65rem; }
.record-data > div { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.4fr); gap: .6rem; align-items: baseline; }
.record-data dt { color: var(--muted); }
.record-data dd { font-weight: 550; }
.clinic-notes { white-space: pre-wrap; }
.provider-details { margin: 1rem 0 0; }
.workspace-heading + .action-link { margin-top: 1rem; }
.offline-actions, .audit-pagination { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; margin-top: 1rem; }
.offline-actions a:not([hidden]), .audit-pagination a { display: inline-flex; align-items: center; min-height: 44px; }
#offline-status:not(:empty) { margin-top: 1rem; }
.audit-list { list-style: none; padding: 0; }
.audit-entry h2 { margin-bottom: .15rem; }
.mother-name { margin: .5rem 0 1.2rem; }
.appointment-card { padding: clamp(1.2rem, 4vw, 2.3rem); border-radius: 1rem; background: var(--green); color: #fff; }
.appointment-card h2 { color: #d8edc6; font-size: 1rem; line-height: 1.4; letter-spacing: 0; }
.appointment-card p { color: inherit; }
.appointment-card .appointment-date { margin: .7rem 0; font-size: clamp(1.85rem, 6vw, 3rem); font-weight: 650; line-height: 1.2; letter-spacing: -.035em; }
.appointment-facility { display: flex; align-items: center; gap: .45rem; }
.appointment-card .appointment-note { margin-top: .8rem; color: #deebdf; }
.empty-appointment { font-size: 1.4rem; font-weight: 600; margin: .6rem 0; }
.past-appointments { list-style: none; padding: 0; }
.past-appointments li { display: grid; padding: .8rem 0; gap: .12rem; }
.past-appointments li + li { border-top: 1px solid var(--line); }
@media (max-width: 38rem) {
  .form-grid { grid-template-columns: 1fr; }
  .care-form .primary { width: 100%; }
  .record-data > div { grid-template-columns: 1fr; gap: .1rem; }
}

.workspace-link, .simulator-link { display: inline-flex; align-items: center; min-height: 44px; padding: .45rem 0; }
.simulator-link { margin-top: 1rem; }
.reminder-panel > p { margin-bottom: .8rem; }
.reminder-panel form { margin: 1rem 0; }
.reminder-panel .primary { gap: 1rem; }
.reminder-preview-label { margin-top: 1rem; font-size: .9rem; font-weight: 600; }
.reminder-message { margin: .8rem 0 1rem; padding: 1rem; border-left: 3px solid #61845e; background: #f0f5eb; border-radius: 0 .6rem .6rem 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.simulation-note { font-size: .88rem; line-height: 1.6; }
.simulation-banner { display: inline-block; padding: .3rem .65rem; color: #603d0e; background: #fff0ca; border: 1px solid #d8b66d; border-radius: .4rem; font-size: .8rem; font-weight: 700; letter-spacing: .06em; }
.outbox-list { list-style: none; margin: 0; padding: 0; }
.outbox-entry h2 { margin-bottom: .5rem; }
.simulator-space { max-width: 34rem; overflow-wrap: anywhere; }
.simulator-heading { text-align: center; }
.simulator-heading h1 { margin: .85rem 0 .65rem; font-size: clamp(1.6rem, 5vw, 2.2rem); }
.phone-frame { max-width: 27rem; margin: 1.5rem auto 1rem; border: 12px solid #213d34; border-radius: 2.1rem; padding: .55rem; background: #213d34; box-shadow: 0 12px 30px -20px #172b24; }
.phone-frame::before { content: ""; display: block; width: 3.5rem; height: .25rem; margin: .15rem auto .8rem; border-radius: 1rem; background: #799184; }
.phone-screen { padding: clamp(1rem, 4vw, 1.5rem); border-radius: 1rem; background: #f4f6e8; min-width: 0; }
.phone-screen h2 { font-size: 1.25rem; line-height: 1.3; margin-bottom: 1rem; }
.phone-screen .login-form { margin-top: 1rem; }
.phone-options { display: grid; gap: .6rem; }
.phone-option { display: flex; align-items: center; text-align: left; gap: .75rem; min-height: 48px; width: 100%; padding: .7rem .75rem; border: 1px solid #9eb09b; border-radius: .5rem; background: #fff; color: var(--green); font: inherit; font-weight: 550; text-decoration: none; }
.phone-option > span { flex: none; min-width: 1.25rem; font-variant-numeric: tabular-nums; font-weight: 750; }
.phone-option:hover { background: #e7efdf; }
.phone-result { display: grid; gap: 1rem; }
.phone-result > p { color: var(--ink); line-height: 1.65; }
.phone-result .phone-date { font-size: 1.55rem; font-weight: 650; line-height: 1.3; }
.phone-exit { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.simulator-space > .simulation-note { max-width: 27rem; margin: .7rem auto; }
.simulator-space > .workspace-link { display: flex; justify-content: center; }

@media (max-width: 28rem) {
  .site-header { flex-wrap: wrap; }
  .site-header .brand { min-width: 0; }
  .panel { min-width: 0; }
  .panel table { table-layout: fixed; overflow-wrap: anywhere; }
  .phone-frame { border-width: 8px; padding: .35rem; }
  .phone-screen { padding: 1rem; }
  .reminder-panel .primary { width: 100%; }
}
