:root {
  --ink: #17332f;
  --muted: #64756f;
  --green: #0d5b4b;
  --green-dark: #073f35;
  --mint: #dcefe8;
  --cream: #f4f7f4;
  --white: #ffffff;
  --line: #d8e1dd;
  --blue: #2e6f95;
  --blue-soft: #e2eef5;
  --gold: #c98b2f;
  --gold-soft: #fbefd9;
  --coral: #c85b47;
  --shadow: 0 18px 50px rgba(18, 51, 44, 0.11);
  --radius: 18px;
}

* { box-sizing: border-box; }
html { color-scheme: light; background: var(--cream); }
body {
  margin: 0;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 10% -20%, rgba(44, 134, 109, 0.15), transparent 34rem),
    var(--cream);
}
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 3px solid rgba(46, 111, 149, 0.32);
  outline-offset: 2px;
}

.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;
}

.safety-banner {
  min-height: 38px;
  padding: 8px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #57380c;
  background: var(--gold-soft);
  border-bottom: 1px solid #efd4a4;
  font-size: 13px;
}

.topbar {
  min-height: 76px;
  padding: 12px 28px;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto minmax(220px, auto) auto;
  align-items: center;
  gap: 20px;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(16px);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
  width: fit-content;
}
.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  color: white;
  background: linear-gradient(145deg, #16836b, var(--green-dark));
  border-radius: 14px 14px 14px 4px;
  font-family: Georgia, serif;
  font-size: 26px;
  box-shadow: 0 10px 24px rgba(13, 91, 75, 0.2);
}
.brand strong, .brand small { display: block; }
.brand strong { font-family: Georgia, serif; font-size: 18px; }
.brand small { color: var(--muted); font-size: 11px; margin-top: 2px; }

.workspace-switcher {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: #edf2ef;
  border-radius: 999px;
}
.workspace-button, .quiet-button, .record-tab, .mobile-nav button {
  border: 0;
  background: transparent;
  color: var(--muted);
}
.workspace-button {
  padding: 9px 16px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 13px;
}
.workspace-button.active {
  color: var(--green-dark);
  background: var(--white);
  box-shadow: 0 2px 8px rgba(23, 51, 47, 0.09);
}
.quiet-button { justify-self: end; font-size: 13px; text-decoration: underline; }

.workspace { display: none; }
.workspace.active { display: grid; }
.patient-only-app .workspace-switcher,
.patient-only-app .staff-access-control,
.patient-only-app #reset-demo,
.patient-only-app #staff-workspace {
  display: none !important;
}
.patient-only-app .topbar {
  grid-template-columns: 1fr;
}
#staff-workspace {
  grid-template-columns: 310px minmax(0, 1fr);
  min-height: calc(100vh - 114px);
}

.patient-panel {
  padding: 26px 18px;
  background: #f8faf8;
  border-right: 1px solid var(--line);
}
.panel-heading, .record-header, .dialog-heading, .status-row, .header-actions, .dialog-actions {
  display: flex;
  align-items: center;
}
.panel-heading, .record-header, .dialog-heading { justify-content: space-between; }
h1, h2, h3, p { margin-top: 0; }
h1, h2 { font-family: Georgia, "Times New Roman", serif; letter-spacing: -0.02em; }
.panel-heading h1 { font-size: 24px; margin-bottom: 0; }
.eyebrow {
  margin-bottom: 5px;
  color: var(--green);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.muted { color: var(--muted); }

.primary-button, .secondary-button {
  min-height: 42px;
  padding: 10px 16px;
  border-radius: 11px;
  font-weight: 750;
  border: 1px solid transparent;
}
.primary-button {
  color: var(--white);
  background: var(--green);
  box-shadow: 0 8px 20px rgba(13, 91, 75, 0.16);
}
.primary-button:hover { background: var(--green-dark); }
.primary-button:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }
.secondary-button {
  color: var(--green-dark);
  background: var(--white);
  border-color: var(--line);
}
.secondary-button:hover { border-color: #9db5ac; }
.compact { min-height: 36px; padding: 7px 12px; font-size: 13px; }

.search-box { display: block; margin: 22px 0 12px; }
.search-box input {
  width: 100%;
  padding: 11px 13px;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.patient-list { display: grid; gap: 7px; }
.patient-list-item {
  width: 100%;
  padding: 12px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 11px;
  align-items: center;
  text-align: left;
  color: var(--ink);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 13px;
}
.patient-list-item:hover { background: var(--white); }
.patient-list-item.active {
  background: var(--white);
  border-color: #b9cec6;
  box-shadow: 0 9px 24px rgba(23, 51, 47, 0.07);
}
.initials, .avatar {
  display: grid;
  place-items: center;
  font-weight: 800;
  color: var(--green-dark);
  background: var(--mint);
  border-radius: 50%;
}
.initials { width: 38px; height: 38px; font-size: 12px; }
.patient-list-item strong, .patient-list-item small { display: block; }
.patient-list-item small { color: var(--muted); margin-top: 3px; }
.patient-list-item .chevron { color: #98a9a3; font-size: 20px; }
.capacity-card {
  margin-top: 22px;
  padding: 15px;
  display: flex;
  gap: 12px;
  align-items: center;
  background: var(--blue-soft);
  border-radius: 14px;
}
.facility-switch-card {
  margin-bottom: 12px;
  padding: 12px;
  display: grid;
  gap: 8px;
  background: #eaf3ef;
  border: 1px solid #c5dbd3;
  border-radius: 12px;
}
.facility-switch-card label { color: var(--green-dark); font-size: 11px; font-weight: 850; }
.facility-switch-card select { margin-top: 6px; background: white; }
.facility-switch-card small { color: var(--muted); font-size: 9px; line-height: 1.35; }
.other-facility-row { display: grid; grid-template-columns: 1fr auto; gap: 7px; }
.facility-badge { padding: 4px 7px; color: #315d81; background: #edf5fb; border-radius: 20px; font-size: 10px; font-weight: 800; }
.facility-link-fieldset {
  margin-top: 15px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
}
.facility-link-fieldset legend { padding: 0 5px; color: var(--green-dark); font-size: 11px; font-weight: 850; }
.facility-link-fieldset small { display: block; margin-top: 8px; color: var(--muted); font-size: 9px; }
.facility-check-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 7px; }
.facility-check {
  padding: 8px;
  display: flex;
  align-items: center;
  gap: 7px;
  background: #f7faf8;
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 10px;
  font-weight: 750;
}
.facility-check input { width: auto; }
.capacity-number { color: var(--blue); font-family: Georgia, serif; font-size: 30px; }
.capacity-card strong, .capacity-card small { display: block; }
.capacity-card small { color: var(--muted); margin-top: 3px; }

.record-area { min-width: 0; padding: 30px clamp(22px, 4vw, 58px) 60px; }
.record-header { gap: 24px; }
.record-header h2 { margin: 8px 0 4px; font-size: clamp(28px, 3vw, 42px); }
.record-header p { color: var(--muted); margin-bottom: 0; }
.status-row { gap: 10px; }
.status-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.status-badge.verified, .status-badge.published { color: #075a3f; background: #dff3e9; }
.status-badge.draft { color: #785109; background: var(--gold-soft); }
.status-badge.reviewed { color: #15567a; background: var(--blue-soft); }
.header-actions { gap: 9px; }
.record-tabs {
  margin-top: 28px;
  display: flex;
  gap: 24px;
  border-bottom: 1px solid var(--line);
}
.record-tab {
  padding: 13px 1px;
  position: relative;
  font-weight: 700;
}
.record-tab.active { color: var(--green); }
.record-tab.active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 3px;
  background: var(--green);
  border-radius: 3px 3px 0 0;
}
.record-tab span {
  margin-left: 4px;
  padding: 2px 6px;
  font-size: 10px;
  color: var(--white);
  background: var(--coral);
  border-radius: 999px;
}

#record-content { padding-top: 24px; }
.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.summary-card, .content-card, .timeline-card {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 8px 28px rgba(23, 51, 47, 0.04);
}
.summary-card { padding: 19px; min-height: 130px; }
.summary-card .card-label { color: var(--muted); font-size: 12px; font-weight: 700; }
.summary-card strong { display: block; margin: 13px 0 5px; font-family: Georgia, serif; font-size: 24px; }
.summary-card small { color: var(--muted); }
.content-grid {
  margin-top: 15px;
  display: grid;
  grid-template-columns: 1.45fr 0.9fr;
  gap: 15px;
}
.content-card { padding: 22px; }
.content-card h3 { margin-bottom: 17px; font-size: 17px; }
.detail-list { display: grid; gap: 13px; }
.detail-row {
  padding-bottom: 13px;
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 18px;
  border-bottom: 1px solid #edf1ef;
}
.detail-row:last-child { padding-bottom: 0; border-bottom: 0; }
.detail-row span:first-child { color: var(--muted); font-size: 13px; }
.empty-state {
  padding: 46px 24px;
  text-align: center;
  color: var(--muted);
  background: rgba(255,255,255,0.55);
  border: 1px dashed #b9c9c3;
  border-radius: var(--radius);
}
.empty-state strong { display: block; margin-bottom: 6px; color: var(--ink); }

.timeline { display: grid; gap: 12px; }
.timeline-card { padding: 18px 20px; }
.timeline-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.timeline-card h3 { margin: 5px 0 0; }
.timeline-meta { color: var(--muted); font-size: 12px; }
.entry-actions { margin-top: 16px; display: flex; gap: 8px; }
.mini-button {
  padding: 7px 10px;
  color: var(--green-dark);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 9px;
  font-weight: 700;
  font-size: 12px;
}
.mini-button.publish { color: white; background: var(--green); border-color: var(--green); }

dialog {
  width: min(620px, calc(100vw - 28px));
  max-height: 90vh;
  padding: 0;
  color: var(--ink);
  background: var(--white);
  border: 0;
  border-radius: 22px;
  box-shadow: var(--shadow);
}
dialog.wide-dialog { width: min(860px, calc(100vw - 28px)); }
dialog::backdrop { background: rgba(7, 35, 29, 0.55); backdrop-filter: blur(4px); }
.dialog-form { padding: 26px; }
.dialog-heading { align-items: flex-start; margin-bottom: 22px; }
.dialog-heading h2 { margin-bottom: 5px; font-size: 29px; }
.close-button {
  width: 36px; height: 36px;
  color: var(--muted);
  background: #eff3f1;
  border: 0;
  border-radius: 50%;
  font-size: 24px;
}
.form-grid { display: grid; gap: 15px; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
label { display: grid; gap: 7px; font-size: 13px; font-weight: 750; }
input, textarea, select {
  width: 100%;
  padding: 11px 12px;
  color: var(--ink);
  background: #fbfcfb;
  border: 1px solid #cbd7d2;
  border-radius: 10px;
  resize: vertical;
}
input::placeholder, textarea::placeholder { color: #96a39f; }
.consent-check {
  margin-top: 18px;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 10px;
  padding: 13px;
  color: #445c55;
  background: #f1f6f3;
  border-radius: 11px;
  font-weight: 600;
  line-height: 1.45;
}
.consent-check input { width: 18px; height: 18px; margin-top: 1px; accent-color: var(--green); }
.dialog-actions { justify-content: flex-end; gap: 9px; margin-top: 24px; }
.dialog-actions.sticky {
  position: sticky;
  bottom: -26px;
  margin-left: -26px;
  margin-right: -26px;
  padding: 15px 26px 26px;
  background: linear-gradient(transparent, white 16%);
}
.step-indicator {
  margin: -3px 0 22px;
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  background: #eef3f1;
  border-radius: 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}
.step-indicator .active { color: var(--green); }
.form-section { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.form-section h3 { margin-bottom: 14px; }
.vitals-grid {
  margin-bottom: 14px;
  display: grid;
  grid-template-columns: repeat(4, minmax(110px, 1fr));
  gap: 9px;
}
.calculated-field { color: var(--green-dark); background: #eef6f2; font-weight: 850; }
.field-help { margin: -3px 0 14px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.autosave-status { margin: 4px 0 0; color: var(--green); font-size: 10px; font-weight: 750; }
.file-upload {
  margin-top: 16px;
  padding: 15px;
  display: grid;
  gap: 9px;
  background: #f7faf8;
  border: 1px dashed #9ebbb1;
  border-radius: 12px;
}
.file-upload > span strong, .file-upload > span small { display: block; }
.file-upload > span small { margin-top: 3px; color: var(--muted); font-size: 11px; font-weight: 500; }
.file-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.file-button {
  width: fit-content;
  padding: 8px 11px;
  color: white;
  background: var(--green);
  border-radius: 9px;
  cursor: pointer;
  font-size: 10px;
  font-weight: 800;
}
.secondary-file-button { color: var(--green); background: white; border: 1px solid #b8d2c9; }
.file-selection { color: var(--blue); font-size: 10px; line-height: 1.4; }
.prototype-storage-note { color: #845b1d; font-size: 9px; line-height: 1.35; }
.featured-upload { background: #eef6f2; border-color: var(--green); }
.upload-progress { height: 5px; overflow: hidden; background: #dbe7e2; border-radius: 10px; }
.upload-progress span { width: 0; height: 100%; display: block; background: var(--green); transition: width .25s ease; }
.file-preview-list { display: grid; gap: 7px; }
.file-preview {
  padding: 8px;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 9px;
}
.file-preview img { width: 36px; height: 36px; object-fit: cover; border-radius: 6px; }
.file-preview-icon { width: 36px; text-align: center; font-size: 20px; }
.file-preview strong, .file-preview small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-preview small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.remove-file { padding: 6px 8px; color: #8a351f; background: #fff2ed; border-radius: 7px; font-size: 9px; font-weight: 800; }
.attachment-list {
  margin-top: 12px;
  padding: 11px 12px;
  display: grid;
  gap: 4px;
  background: #f4f7f6;
  border-radius: 10px;
  font-size: 11px;
}
.attachment-list span { color: var(--blue); }
.attachment-list small { color: var(--muted); }
.lab-tests-heading { margin: 22px 0 10px; display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; }
.lab-tests-heading h3, .lab-tests-heading p { margin: 0; }
.lab-tests-heading p { margin-top: 4px; color: var(--muted); font-size: 11px; }
.lab-test-rows { display: grid; gap: 10px; }
.lab-test-row {
  padding: 13px;
  display: grid;
  grid-template-columns: 1.4fr 1fr .8fr 1fr 1fr auto;
  align-items: end;
  gap: 8px;
  background: #f7faf8;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.remove-lab-test { margin-bottom: 2px; padding: 10px; color: #8a351f; background: #fff2ed; border-radius: 9px; font-weight: 900; }
.amendment-note { margin-top: 9px; padding: 9px 11px; color: #6f4b10; background: #fff8e9; border-radius: 9px; font-size: 11px; }
.amendment-reason { margin-bottom: 18px; padding: 13px; background: #fff8e9; border: 1px solid #ead8b5; border-radius: 11px; }
.status-badge.superseded { color: #5f6c68; background: #e7ecea; }
.readonly-banner {
  margin: 0 17px 12px;
  padding: 9px 11px;
  display: grid;
  gap: 2px;
  color: #174f43;
  background: #e8f4ef;
  border: 1px solid #bed9cf;
  border-radius: 11px;
  font-size: 9px;
  line-height: 1.35;
}
.patient-facility-control {
  margin: 0 17px 12px;
  color: var(--green-dark);
  font-size: 9px;
  font-weight: 850;
}
.patient-facility-control select { margin-top: 5px; padding: 8px 10px; background: white; font-size: 11px; }
.facility-linker { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.facility-linker p { margin: 0 0 7px; color: var(--muted); font-size: 10px; }
.facility-link-actions { display: flex; gap: 7px; }
.facility-link-actions select { flex: 1; }
.readonly-banner strong { font-size: 10px; }
.patient-summary-actions { margin-top: 12px; display: flex; gap: 7px; }
.patient-action-button {
  flex: 1;
  padding: 8px 9px;
  color: var(--green);
  background: var(--mint);
  border-radius: 9px;
  font-size: 9px;
  font-weight: 800;
}
.offline-chip { color: var(--green); font-weight: 800; }
.callout {
  margin-bottom: 20px;
  padding: 13px 15px;
  color: #66430a;
  background: var(--gold-soft);
  border-left: 4px solid var(--gold);
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.5;
}
.review-summary {
  margin-bottom: 18px;
  padding: 16px;
  background: var(--cream);
  border-radius: 12px;
  line-height: 1.6;
}

.patient-workspace {
  min-height: calc(100vh - 114px);
  grid-template-columns: minmax(320px, 430px) minmax(280px, 420px);
  align-items: center;
  justify-content: center;
  gap: clamp(30px, 7vw, 90px);
  padding: 38px 24px 70px;
  background:
    radial-gradient(circle at 20% 20%, rgba(13,91,75,.16), transparent 28rem),
    radial-gradient(circle at 90% 70%, rgba(46,111,149,.12), transparent 26rem);
}
.phone-shell {
  min-height: 690px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: #f6f8f6;
  border: 10px solid #183630;
  border-radius: 44px;
  box-shadow: 0 34px 80px rgba(18, 49, 43, 0.26);
}
.phone-status {
  padding: 9px 20px 3px;
  display: flex;
  justify-content: space-between;
  color: #61746e;
  font-size: 10px;
  font-weight: 800;
}
.patient-app-header {
  padding: 24px 22px 17px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.patient-app-header p { margin-bottom: 2px; color: var(--muted); font-size: 13px; }
.patient-app-header h1 { margin-bottom: 0; font-size: 30px; }
.avatar { width: 44px; height: 44px; font-size: 12px; }
.patient-app-content { flex: 1; padding: 0 17px 18px; overflow: auto; }
.patient-hero {
  padding: 20px;
  color: white;
  background: linear-gradient(145deg, #0c6c58, #073f35);
  border-radius: 22px;
  box-shadow: 0 14px 35px rgba(13,91,75,.19);
}
.patient-hero .eyebrow { color: #bfe5d7; }
.patient-hero h2 { margin-bottom: 7px; font-size: 25px; }
.patient-hero p { margin-bottom: 0; color: #d5e9e3; line-height: 1.5; font-size: 13px; }
.quick-grid {
  margin-top: 13px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 9px;
}
.quick-card {
  padding: 13px 10px;
  text-align: center;
  background: white;
  border: 1px solid var(--line);
  border-radius: 14px;
}
.quick-card strong { display: block; font-size: 18px; font-family: Georgia, serif; }
.quick-card small { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
.patient-section { margin-top: 20px; }
.patient-section-heading {
  display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 9px;
}
.patient-section-heading h3 { margin-bottom: 0; font-size: 15px; }
.patient-section-heading span { color: var(--green); font-size: 11px; font-weight: 750; }
.patient-record-card {
  padding: 14px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 15px;
}
.patient-record-card + .patient-record-card { margin-top: 8px; }
.patient-record-card .row { display: flex; justify-content: space-between; gap: 10px; }
.patient-record-card strong { font-size: 13px; }
.patient-record-card p { margin: 7px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.source-label { margin-top: 9px; color: var(--blue); font-size: 10px; font-weight: 800; }
.access-label { display: inline-block; margin-top: 11px !important; font-size: 9px !important; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.free-label { color: var(--green) !important; }
.premium-label { color: #8b5a16 !important; }
.premium-content { margin-top: 11px; padding-top: 3px; border-top: 1px dashed #dbc9a9; }
.inline-lock {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 13px;
  padding: 12px;
  background: #fff8e9;
  border: 1px solid #ead8b5;
  border-radius: 12px;
}
.inline-lock strong { color: #6e4916; }
.inline-lock p { margin-top: 4px; color: #7a684e; }
.membership-card {
  display: flex;
  gap: 13px;
  margin-top: 16px;
  padding: 15px;
  background: #fff8e9;
  border: 1px solid #e5cf9f;
  border-radius: 16px;
}
.membership-card.active-membership { background: var(--mint); border-color: #b9dbcf; }
.membership-card p { margin: 5px 0 9px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.membership-card small { display: block; margin-top: 7px; color: var(--muted); font-size: 9px; }
.lock-icon { font-size: 20px; }
.membership-toggle {
  padding: 8px 11px;
  color: white;
  background: var(--green);
  border-radius: 9px;
  font-size: 10px;
  font-weight: 800;
}
.locked-panel {
  padding: 26px 18px;
  text-align: center;
  background: white;
  border: 1px solid var(--line);
  border-radius: 16px;
}
.locked-panel h3 { margin: 8px 0 6px; font-size: 16px; }
.locked-panel p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.large-lock { font-size: 30px; }
.fine-print { font-size: 9px !important; }
.mobile-nav {
  min-height: 66px;
  padding: 8px 8px 12px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  background: white;
  border-top: 1px solid var(--line);
}
.mobile-nav button { border-radius: 12px; font-size: 10px; font-weight: 750; }
.mobile-nav button.active { color: var(--green); background: var(--mint); }
.prototype-guide { align-self: center; }
.prototype-guide h2 { max-width: 390px; font-size: clamp(30px, 4vw, 50px); line-height: 1.02; }
.prototype-guide p, .prototype-guide li { color: var(--muted); line-height: 1.65; }
.prototype-guide ul { padding-left: 20px; }

.staff-access-control {
  min-width: 220px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.staff-access-control label {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.staff-access-control select {
  min-width: 150px;
  padding: 7px 28px 7px 9px;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 11px;
  text-transform: none;
  letter-spacing: normal;
}
.access-role-badge {
  padding: 7px 9px;
  color: var(--green-dark);
  background: var(--mint);
  border: 1px solid #badace;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}
button:disabled {
  cursor: not-allowed;
  opacity: .48;
}
.entry-preview {
  margin-top: 16px;
  padding: 16px;
  background: #f3faf7;
  border: 1px solid #b9dbcf;
  border-radius: 14px;
}
.entry-preview-heading {
  margin-bottom: 13px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.entry-preview-heading span {
  color: var(--green);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.entry-preview .detail-row {
  grid-template-columns: 130px 1fr;
}
.entry-preview .detail-row strong {
  font-size: 12px;
  line-height: 1.45;
}
.invitation-result {
  padding: 14px;
  color: var(--green-dark);
  background: var(--mint);
  border: 1px solid #b9dbcf;
  border-radius: 12px;
}
.invitation-result p { margin: 7px 0; line-height: 1.5; }

.toast-region {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 100;
  display: grid;
  gap: 8px;
}
.toast {
  max-width: 360px;
  padding: 13px 16px;
  color: white;
  background: var(--green-dark);
  border-radius: 12px;
  box-shadow: var(--shadow);
  animation: toast-in .22s ease-out;
}
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }

@media (max-width: 960px) {
  .topbar { grid-template-columns: 1fr auto; }
  .workspace-switcher { grid-row: 2; grid-column: 1 / -1; justify-self: stretch; }
  .staff-access-control { grid-column: 1 / -1; justify-self: stretch; }
  .workspace-button { flex: 1; }
  #staff-workspace { grid-template-columns: 260px minmax(0, 1fr); }
  .summary-grid { grid-template-columns: 1fr 1fr; }
  .content-grid { grid-template-columns: 1fr; }
  .vitals-grid { grid-template-columns: repeat(3, 1fr); }
  .lab-test-row { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 720px) {
  .safety-banner { align-items: flex-start; flex-direction: column; gap: 2px; padding: 8px 14px; }
  .topbar { padding: 10px 14px; position: static; }
  .brand small { display: none; }
  .quiet-button { font-size: 11px; }
  .staff-access-control { align-items: stretch; flex-direction: column; }
  .staff-access-control select { width: 100%; }
  #staff-workspace { grid-template-columns: 1fr; }
  .patient-panel { border-right: 0; border-bottom: 1px solid var(--line); }
  .patient-list { grid-template-columns: repeat(3, minmax(180px, 1fr)); overflow-x: auto; }
  .capacity-card { display: none; }
  .record-area { padding: 22px 14px 50px; }
  .record-header { align-items: flex-start; flex-direction: column; }
  .header-actions { width: 100%; }
  .header-actions button { flex: 1; }
  .record-tabs { gap: 18px; overflow-x: auto; }
  .record-tab { white-space: nowrap; }
  .summary-grid { grid-template-columns: 1fr; }
  .detail-row { grid-template-columns: 1fr; gap: 4px; }
  .form-grid.two { grid-template-columns: 1fr; }
  .form-grid .full { grid-column: auto; }
  .vitals-grid { grid-template-columns: repeat(2, 1fr); }
  .lab-test-row { grid-template-columns: 1fr 1fr; }
  .lab-test-row label:first-child { grid-column: 1 / -1; }
  .step-indicator { overflow-x: auto; justify-content: flex-start; }
  .step-indicator span { white-space: nowrap; }
  .patient-workspace { grid-template-columns: minmax(300px, 430px); padding-top: 24px; }
  .prototype-guide { order: -1; }
  .prototype-guide h2 { font-size: 31px; }
  .quick-grid { grid-template-columns: repeat(2, 1fr); }
}
