:root {
  color-scheme: light;
  --ink: #16202a;
  --muted: #607083;
  --soft: #eef7f8;
  --surface: #ffffff;
  --surface-strong: #f8fbfc;
  --line: #d7e5e8;
  --purple: #7f4ea3;
  --purple-dark: #5b337b;
  --teal: #0f8fa1;
  --teal-dark: #0a6f7c;
  --warning: #b55228;
  --danger: #9d2744;
  --shadow: 0 18px 46px rgba(35, 56, 70, 0.12);
  --radius: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: #f4fafb;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(244, 250, 251, 0.96)),
    url("assets/nursery-hero.png") top center / min(1900px, 138vw) auto no-repeat,
    #f4fafb;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
}

[hidden] {
  display: none !important;
}

.password-gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
}

.password-card {
  width: min(100%, 460px);
  padding: 30px;
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.password-card h1,
.handoff-sheet h1,
.section-head h1,
.section-head h2 {
  margin: 0;
  line-height: 1.08;
  letter-spacing: 0;
}

.password-card h1 {
  max-width: 12ch;
  font-size: clamp(2rem, 6vw, 3.5rem);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--teal-dark);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.byline,
.field-hint,
.clinical-note,
.save-status,
.share-status,
.task-meta,
.caregiver-prompt p {
  color: var(--muted);
}

.byline {
  margin: 14px 0 22px;
  line-height: 1.45;
}

label {
  display: grid;
  gap: 10px;
  color: #314252;
  font-size: 0.93rem;
  font-weight: 730;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  padding: 10px 12px;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

textarea {
  min-height: 104px;
  resize: vertical;
  line-height: 1.38;
}

select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 18px,
    calc(100% - 12px) 18px;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 34px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(15, 143, 161, 0.14);
}

.primary-button,
.secondary-button,
.filter-button,
.icon-button,
.problem-prompts button,
.prompt-actions button {
  min-height: 42px;
  border-radius: var(--radius);
  padding: 10px 14px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease, border-color 140ms ease;
}

.primary-button {
  color: #fff;
  background: var(--purple);
  box-shadow: 0 10px 24px rgba(127, 78, 163, 0.2);
}

.secondary-button,
.filter-button,
.problem-prompts button,
.prompt-actions button {
  border: 1px solid var(--line);
  color: var(--purple-dark);
  background: #fff;
}

.icon-button {
  width: 42px;
  padding: 0;
  display: grid;
  place-items: center;
  color: var(--purple-dark);
  background: #f2eaf8;
  font-size: 1.4rem;
}

button:hover {
  transform: translateY(-1px);
}

button:active {
  transform: translateY(0);
}

.compact-button,
.field-action-button {
  min-height: 38px;
}

.password-error,
.safety-error {
  margin: 8px 0 0;
  color: var(--danger);
  font-weight: 800;
}

.app-shell {
  width: min(1680px, 100%);
  margin: 0 auto;
  padding: 20px;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(390px, 0.92fr);
  gap: 18px;
  align-items: start;
}

.panel {
  border: 1px solid rgba(215, 229, 232, 0.86);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.93);
  box-shadow: var(--shadow);
  overflow: clip;
}

.patient-panel {
  padding: 18px;
}

.checklist-panel {
  position: sticky;
  top: 16px;
  max-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
}

.section-head {
  position: relative;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  justify-content: space-between;
  padding: 18px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(238, 247, 248, 0.98), rgba(250, 246, 253, 0.94));
  overflow: hidden;
}

.patient-panel > .section-head {
  min-height: 245px;
  margin-bottom: 18px;
  align-items: stretch;
}

.sticky-head {
  position: sticky;
  top: 0;
  z-index: 2;
  border-radius: 0;
  border-bottom: 1px solid var(--line);
}

.brand-lockup {
  position: relative;
  z-index: 1;
  max-width: 560px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.brand-mark {
  width: 62px;
  height: 62px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--purple);
  box-shadow: 0 10px 26px rgba(127, 78, 163, 0.24);
}

.brand-mark img {
  width: 45px;
  height: 45px;
  object-fit: contain;
}

.section-head h1 {
  max-width: 18ch;
  font-size: clamp(1.85rem, 4.3vw, 3.5rem);
}

.section-head h2 {
  font-size: clamp(1.45rem, 2.1vw, 2rem);
}

.hero-art {
  position: absolute;
  right: 0;
  bottom: 0;
  width: min(52%, 560px);
  height: 100%;
  object-fit: cover;
  object-position: right center;
  opacity: 0.58;
  mask-image: linear-gradient(90deg, transparent, #000 48%);
}

.header-actions {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.patient-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.patient-form > label,
.patient-form > .conditional-section,
.patient-form > .checkbox-panel,
.patient-form > .clinical-prompt,
.patient-form > .problem-list-fields,
.patient-form > .problem-prompts,
.patient-form > .field-hint,
.patient-form > .field-action-button {
  grid-column: 1 / -1;
}

.split {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.form-section-title {
  grid-column: 1 / -1;
  margin-top: 18px;
  margin-bottom: 6px;
  padding: 11px 14px;
  border-left: 4px solid var(--teal);
  border-radius: var(--radius);
  background: var(--soft);
  color: #173846;
  font-size: 0.84rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#ropSection {
  display: grid;
  gap: 14px;
}

#ropSection .form-section-title {
  margin-bottom: 0;
}

.inline-fields {
  display: grid;
  grid-template-columns: minmax(74px, 1fr) auto minmax(74px, 1fr) auto;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-weight: 800;
}

.calculated-field,
.clinical-prompt,
.checkbox-panel,
.caregiver-prompt,
.summary-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
}

.calculated-field {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
}

.calculated-field strong {
  color: var(--purple-dark);
  font-size: 1.08rem;
}

.problem-list-fields {
  display: grid;
  gap: 12px;
}

.problem-field-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  gap: 8px;
  font-weight: 700;
  color: #173846;
}

.problem-field-title {
  font-size: 0.85rem;
}

.problem-remove-button {
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 0.85rem;
  padding: 2px 8px;
  line-height: 1.4;
  background: white;
  color: #193a4e;
  min-width: 28px;
  height: 28px;
}

.problem-remove-button:hover {
  background: #f2f7fa;
}

.problem-list-auto {
  padding: 12px;
  border: 1px solid #d2ecf4;
  border-radius: var(--radius);
  background: #f4fbfe;
  display: grid;
  gap: 8px;
}

.problem-list-auto-title {
  font-size: 0.85rem;
  font-weight: 800;
  color: #173846;
}

.auto-problem-list {
  margin: 0;
  padding: 0 0 0 18px;
  min-height: 22px;
  color: #1f5160;
}

.auto-problem-list li {
  margin: 0;
  padding: 2px 0;
}

.auto-problem-list li:last-child {
  padding-bottom: 0;
}

.auto-problem-list.is-empty {
  list-style: none;
  padding-left: 0;
}

.compact-textarea {
  min-height: 76px;
}

.problem-prompts,
.prompt-actions,
.summary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.problem-prompts button,
.prompt-actions button {
  min-height: 38px;
  padding: 8px 12px;
  color: #18515d;
  line-height: 1.25;
}

.clinical-prompt {
  padding: 16px;
  display: grid;
  gap: 14px;
  border-color: #cfebef;
  background: #f4fcfd;
}

.checkbox-panel {
  padding: 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.checkbox-panel-title {
  grid-column: 1 / -1;
  color: #173846;
  font-size: 0.86rem;
  font-weight: 900;
  margin-bottom: 2px;
}

.collapsible-risk-panel {
  display: block;
}

.collapsible-risk-panel summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--soft);
  font-size: 1rem;
  font-weight: 900;
  cursor: pointer;
  list-style: none;
}

.high-risk-panel {
  border-color: #efc6d1;
  background: #fff8fa;
}

.high-risk-panel summary {
  background: #fdeaf0;
  color: #51243a;
  box-shadow: inset 5px 0 0 #c75079;
}

.high-risk-panel summary::after {
  color: #7d2d51;
}

.medium-risk-panel {
  border-color: #d8c6f4;
  background: #fbf8ff;
}

.medium-risk-panel summary {
  background: #f1e9ff;
  color: #3f2863;
  box-shadow: inset 5px 0 0 #8b63d1;
}

.medium-risk-panel summary::after {
  color: #5e3d91;
}

.collapsible-risk-panel summary::-webkit-details-marker {
  display: none;
}

.collapsible-risk-panel summary::after {
  content: "Show";
  color: var(--purple-dark);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: none;
}

.collapsible-risk-panel[open] {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.collapsible-risk-panel[open] summary::after {
  content: "Hide";
}

.checkbox-panel .high-risk-item,
.checkbox-panel > label,
.choice-row label {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  font-weight: 750;
  color: #000000;
  cursor: pointer;
}

.checkbox-panel .high-risk-item.high-risk-selected,
.checkbox-panel > label.high-risk-selected,
.checkbox-panel .high-risk-item.medium-risk-selected,
.checkbox-panel > label.medium-risk-selected {
  border-color: var(--purple);
  background: #f8f4fc;
}

.checkbox-panel .high-risk-item.high-risk-item,
.checkbox-panel > label.high-risk-item {
  cursor: pointer;
}

.checkbox-panel .high-risk-item.risk-disabled,
.checkbox-panel > label.risk-disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.checkbox-panel .high-risk-item label {
  display: block;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  flex: 1;
  line-height: 1.32;
}

.high-risk-popup {
  grid-column: 1 / -1;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 12px;
  color: #000000;
  font-size: 0.86rem;
  line-height: 1.4;
  font-weight: 560;
  box-shadow: 0 10px 26px rgba(22, 36, 49, 0.08);
}

.high-risk-popup-shell {
  width: 100%;
  display: grid;
  gap: 10px;
}

.high-risk-popup-title {
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px;
  border-left: 5px solid #7f4ea3;
  background: #f4edf9;
  font-size: 1rem;
  font-weight: 850;
  letter-spacing: 0;
  color: #3a2350;
}

.medium-risk-popup {
  border-color: #d8c6f4;
  background: #fbf8ff;
}

.medium-risk-popup .high-risk-popup-shell {
  gap: 12px;
}

.medium-risk-popup .high-risk-popup-title {
  border-left-color: #8b63d1;
  background: #f1e9ff;
  color: #3f2863;
  margin-bottom: 2px;
}

.medium-risk-popup .high-risk-popup-subtext {
  margin-top: 2px;
  color: #5f5274;
}

.medium-risk-location-fields {
  width: 100%;
  margin-top: 4px;
}

.medium-risk-popup #mediumRiskMouField {
  width: 100%;
  margin-top: 2px;
}

.high-risk-popup-subtext {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.34;
}

.high-risk-popup p,
.high-risk-popup-line,
.high-risk-popup-text {
  margin: 0;
  line-height: 1.35;
  white-space: normal;
}

.high-risk-popup-steps {
  display: grid;
  gap: 10px;
  width: 100%;
}

.high-risk-followup-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr;
  width: 100%;
}

.high-risk-popup-action-row {
  display: flex;
  width: 100%;
  justify-content: stretch;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.high-risk-popup-action-row button {
  flex: 1;
  min-height: 38px;
  padding: 9px 10px;
  font-size: 0.88rem;
  min-width: 0;
  text-align: center;
  border-radius: 10px;
}

.high-risk-followup-panel {
  border: 1px solid #e2ecf3;
  border-radius: var(--radius);
  background: #ffffff;
  padding: 10px;
  display: grid;
  gap: 8px;
  box-shadow: 0 2px 12px rgba(19, 35, 55, 0.05);
}

.high-risk-followup-panel-title {
  margin: 0;
  font-size: 0.84rem;
  font-weight: 740;
  color: #000000;
}

.high-risk-popup-step-panel {
  border: 1px solid #e2ecf3;
  border-radius: var(--radius);
  background: #fdfdff;
  padding: 9px;
  box-shadow: 0 1px 10px rgba(22, 36, 49, 0.05);
}

.high-risk-popup-step-title {
  margin: 0 0 4px;
  font-size: 0.82rem;
  font-weight: 720;
  color: #000000;
}

.high-risk-popup-step-panel-lines {
  display: grid;
  gap: 4px;
}

.high-risk-popup-step-panel-line {
  margin: 0;
  padding: 0;
  color: #000000;
  font-size: 0.8rem;
  line-height: 1.4;
}

.high-risk-popup-step {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.high-risk-popup-step-visible {
  color: inherit;
}

.high-risk-popup-step-chosen {
  color: #000000;
  font-weight: 800;
}

.high-risk-popup-line {
  margin: 0;
  padding: 2px 0;
  background: transparent;
  border: 0;
  border-left: 0;
  font-size: 0.81rem;
  line-height: 1.34;
}

.high-risk-popup-question {
  margin: 0;
  color: #000;
  font-size: 0.95rem;
  font-weight: 850;
  line-height: 1.35;
}

.high-risk-popup-date-line {
  margin-top: 4px;
  margin-bottom: 2px;
  font-weight: 740;
  font-size: 0.9rem;
  color: var(--purple-dark);
}

.high-risk-popup-line-label {
  display: inline-block;
  min-width: 120px;
  margin-right: 8px;
  font-size: 0.77rem;
  font-weight: 740;
  color: #000000;
}

.high-risk-popup-editing .high-risk-popup-line {
  color: #000000;
}

.high-risk-popup-date-row {
  display: grid;
  gap: 6px;
  width: 100%;
  font-size: 0.84rem;
  font-weight: 700;
  color: #000000;
}

.high-risk-popup-parent-row {
  display: grid;
  gap: 6px;
  width: 100%;
  font-size: 0.84rem;
  font-weight: 700;
  color: #000000;
}

.high-risk-popup-date-row[hidden] {
  display: none;
}

.high-risk-popup-parent-row[hidden] {
  display: none;
}

.high-risk-popup-parent-label {
  display: block;
  width: 100%;
  margin: 0;
  font-size: 0.84rem;
  color: #000000;
}

.high-risk-popup-date-input {
  width: 100%;
  max-width: 240px;
  padding: 10px 12px;
  border-radius: 10px;
  border-color: #ccddf0;
}

.high-risk-popup-parent-input {
  width: 100%;
  max-width: 320px;
  padding: 10px 12px;
  border-radius: 10px;
  border-color: #ccddf0;
}

.high-risk-popup-date-input:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 4px rgba(127, 78, 163, 0.12);
}

.high-risk-step-status {
  color: #1d8f62;
  font-size: 0.73rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.high-risk-step-status.pending {
  color: var(--warning);
}

.high-risk-popup-actions {
  display: grid;
  width: 100%;
  gap: 10px;
  align-items: stretch;
}

.high-risk-popup-actions button {
  flex: 1;
  min-height: 40px;
  padding: 9px 12px;
  font-size: 0.9rem;
  min-width: 0;
  text-align: center;
  border-radius: 10px;
}

.high-risk-popup-actions button.high-risk-popup-action {
  font-weight: 740;
  border-width: 1px;
  border-radius: 8px;
  border-color: #c8d8e3;
  background: var(--purple);
  color: #fff;
  box-shadow: none;
  transition: background 140ms ease, transform 140ms ease, border-color 140ms ease;
}

.high-risk-popup-actions button.high-risk-popup-action.secondary-button {
  border: 1px solid #c8d8e3;
  color: #fff;
  background: var(--purple);
}

.high-risk-popup-action-row .high-risk-popup-action.secondary-button {
  background: var(--purple);
  color: #fff;
}

@media (min-width: 840px) {
  .high-risk-followup-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .high-risk-popup-action-row {
    flex-wrap: nowrap;
  }

  .high-risk-popup-action-row button {
    min-height: 39px;
  }
}

input[type="checkbox"],
input[type="radio"] {
  width: 18px;
  min-height: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--purple);
  padding: 0;
}

.checkbox-panel input[type="checkbox"] {
  -webkit-appearance: auto;
  appearance: auto;
  margin: 0;
  width: 18px;
  min-width: 18px;
  height: 18px;
  flex-shrink: 0;
  cursor: pointer;
  pointer-events: auto;
}

.checkbox-panel input[type="checkbox"]:focus-visible {
  outline: 2px solid rgba(127, 78, 163, 0.35);
  outline-offset: 2px;
}

.choice-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.stored-select {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 1px;
  opacity: 0;
  pointer-events: none;
}

.clinical-note,
.save-status,
.share-status,
.field-hint {
  margin: 12px 0 0;
  line-height: 1.45;
  font-size: 0.9rem;
}

.toolbar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.filter-button.active {
  color: #fff;
  border-color: var(--teal);
  background: var(--teal);
}

.checklist {
  padding: 16px;
  display: grid;
  gap: 10px;
  overflow: auto;
}

.task-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.task-card.done {
  background: #f5faf8;
}

.task-title {
  margin: 0 0 6px;
  font-size: 1rem;
  line-height: 1.22;
}

.task-meta {
  margin: 4px 0 0;
  font-size: 0.88rem;
  line-height: 1.35;
}

.badge {
  min-width: 52px;
  padding: 5px 8px;
  border-radius: 999px;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.badge.due {
  color: var(--warning);
  background: #fff1e9;
}

.badge.done {
  color: #176c47;
  background: #e7f7ef;
}

.empty {
  padding: 24px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

.summary-panel {
  display: none;
  margin: 0 16px 16px;
  padding: 14px;
  gap: 12px;
}

.summary-panel.visible {
  display: grid;
}

.handoff-link {
  font-size: 0.88rem;
}

.summary-box {
  min-height: 360px;
  font-family: inherit;
  font-size: 0.92rem;
  line-height: 1.55;
}

.summary-preview {
  min-height: 360px;
  display: grid;
  gap: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(250, 254, 255, 0.98)),
    #ffffff;
  color: #152536;
  box-shadow: 0 16px 34px rgba(22, 36, 49, 0.08);
}

.summary-preview-card {
  padding: 16px;
  border: 1px solid #d5e6eb;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(22, 36, 49, 0.04);
}

.summary-preview-card h3,
.summary-preview-card h4 {
  margin: 0 0 10px;
  font-weight: 900;
  color: #173846;
}

.summary-preview-card h3 {
  font-size: 1.28rem;
  line-height: 1.15;
}

.summary-preview-card h4 {
  font-size: 0.88rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding-bottom: 6px;
  border-bottom: 1px solid #e0edf0;
}

.summary-preview-id-card {
  background:
    linear-gradient(135deg, #f2fbfc 0%, #fff9ef 100%);
  border-left: 6px solid #1597a3;
}

.summary-preview-id-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px 14px;
}

.summary-preview-kicker {
  margin: 0 0 4px;
  color: #0a7f8b;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.summary-preview-lines {
  display: grid;
  gap: 10px;
}

.summary-preview p {
  display: flex;
  gap: 8px;
  margin: 0;
  line-height: 1.55;
}

.summary-preview p strong {
  flex: 0 0 auto;
  color: #24384b;
  font-weight: 900;
}

.summary-preview p span {
  min-width: 0;
}

.summary-preview p.numbered {
  align-items: flex-start;
  font-weight: 700;
}

.summary-number {
  width: 1.45rem;
  height: 1.45rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #8751a8;
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 900;
}

.summary-preview-credit {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  color: var(--muted);
  font-size: 0.78rem;
  text-align: right;
}

.summary-preview-credit strong {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #173846;
  color: #ffffff;
  font-size: 0.76rem;
  letter-spacing: 0.04em;
}

.handoff-summary {
  margin-top: 16px;
}

@media (max-width: 680px) {
  .summary-preview-id-grid {
    grid-template-columns: 1fr;
  }

  .summary-preview p {
    display: block;
  }

  .summary-preview p strong {
    display: inline;
  }
}

.summary-raw {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.caregiver-prompt {
  padding: 12px;
}

.caregiver-prompt strong {
  display: block;
  margin-bottom: 4px;
}

.handoff-view {
  min-height: 100vh;
  padding: 28px;
  background: #f4fafb;
}

.handoff-sheet {
  width: min(980px, 100%);
  margin: 0 auto;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.handoff-sheet pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  padding: 18px;
  border-radius: var(--radius);
  background: #f7fafb;
  line-height: 1.45;
}

@media (max-width: 1120px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .checklist-panel {
    position: static;
    max-height: none;
  }

  .checklist {
    max-height: none;
  }
}

@media (max-width: 760px) {
  body {
    background-size: 1500px auto;
  }

  .app-shell,
  .password-gate,
  .handoff-view {
    padding: 12px;
  }

  .patient-panel {
    padding: 14px;
  }

  .section-head {
    padding: 14px;
  }

  .patient-panel > .section-head {
    min-height: 0;
    padding-bottom: 120px;
  }

  .brand-lockup {
    display: grid;
    grid-template-columns: 52px 1fr;
  }

  .brand-mark {
    width: 52px;
    height: 52px;
  }

  .brand-mark img {
    width: 38px;
    height: 38px;
  }

  .hero-art {
    width: 100%;
    height: 150px;
    opacity: 0.48;
    mask-image: linear-gradient(180deg, transparent, #000 35%);
  }

  .header-actions {
    position: absolute;
    right: 12px;
    top: 12px;
  }

  .patient-form,
  .split,
  .checkbox-panel {
    grid-template-columns: 1fr;
  }

  .patient-form {
    gap: 16px;
  }

  .form-section-title {
    margin-top: 16px;
    padding: 10px 12px;
  }

  .checkbox-panel,
  .clinical-prompt {
    padding: 12px;
  }

  .summary-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .task-card {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .badge {
    grid-column: 2;
    width: max-content;
  }
}

@media print {
  body {
    background: #fff;
  }

  .password-gate,
  .app-shell {
    display: none !important;
  }

  .handoff-view {
    display: block !important;
    min-height: 0;
    padding: 0;
    background: #fff;
  }

  .handoff-sheet {
    width: 100%;
    padding: 0;
    border: 0;
    box-shadow: none;
  }

  .summary-actions {
    display: none;
  }
}
