:root {
  color-scheme: light;

  /* Color schema: canonical tokens for developer handoff. */
  --color-white: #FFFFFF;
  --color-background-mid: #F7FBFA;
  --color-background-teal: #D7ECE8;
  --color-subsection-fill: #EDF6F4;
  --color-card-border: #C9DDD8;
  --color-section-header-teal: #3F7D79;
  --color-dark-teal: #1E4D4A;
  --color-muted-text: #637270;
  --color-main-text: #1E2928;

  --color-coral-fill: #FCE9E4;
  --color-coral-active: #F29B87;
  --color-coral-border: #BD5947;
  --color-coral-text: #580404;

  /* Hospitalizations & Surgeries + Family Medical History + Data Tables + USDA Food Security / Teals */
  --color-teal-fill: #EDF6F4;
  --color-teal-active: #99CFC2;
  --color-teal-border: #8BB7AB;
  --color-teal-text: #1E4D4A;

  --color-periwinkle-fill: #E8ECFA;
  --color-periwinkle-active: #A8B8EA;
  --color-periwinkle-border: #6E83C7;
  --color-periwinkle-text: #40538E;

  /* Medically Prescribed Diet + Nutrition Supports / Green */
  --color-green-fill: #E8F4E9;
  --color-green-active: #A9CFAE;
  --color-green-border: #78A97D;
  --color-green-text: #254D2A;

  --color-orange-fill: #F9D9A6;
  --color-orange-active: #F2AC4C;
  --color-orange-border: #C8791E;
  --color-orange-text: #583900;

  --color-lilac-fill: #F3EBF6;
  --color-lilac-active: #B280C2;
  --color-lilac-border: #865797;
  --color-lilac-text: #563B62;

  --color-gold-fill: #F6DC88;
  --color-gold-active: #F1BE15;
  --color-gold-border: #CEA00C;
  --color-gold-text: #583900;

  --color-toggle-checkbox-blue: #1A73E8;
  --color-infant-status-teal: #0F8F96;
  --color-infant-status-purple: #6F42C1;
  --color-infant-status-amber: #D48A00;
  --color-infant-status-coral: #D94F5C;

  --shadow-soft: 0 8px 24px rgba(30, 77, 74, 0.08);
  --shadow-card: 0 3px 8px rgba(30, 77, 74, 0.16);

  /* Legacy aliases retained so existing UI rules stay stable during handoff. */
  --ink: var(--color-main-text);
  --muted: var(--color-muted-text);
  --line: var(--color-card-border);
  --surface: var(--color-white);
  --surface-soft: var(--color-subsection-fill);
  --surface-frost: rgba(255, 255, 255, 0.82);
  --soft: var(--color-subsection-fill);
  --accent: var(--color-section-header-teal);
  --accent-dark: var(--color-dark-teal);
  --accent-soft: var(--color-subsection-fill);
  --teal-muted: var(--color-section-header-teal);
  --control-blue: var(--color-toggle-checkbox-blue);
  --blue-accent: var(--color-periwinkle-active);
  --gold-accent: var(--color-gold-active);
  --purple-accent: var(--color-lilac-active);
  --green-accent: var(--color-green-border);
  --warn: var(--color-orange-text);
  --danger: var(--color-coral-border);
  --shadow: var(--shadow-soft);
  --rail: var(--color-white);
  --card-shadow: var(--shadow-card);

  /* Typography schema v1.0:
     - global editor, table, dietary, and live-preview exception tokens live here.
     - color category notes above are the canonical handoff color schema. */
  --font-ui: "Inter", "Segoe UI", Arial, sans-serif;
  --type-display-title: clamp(1.55rem, 2.25vw, 2rem);
  --type-editable-title: clamp(1.4rem, 2vw, 1.5rem);
  --type-preview-title: 1.05rem;
  --type-live-preview-title: clamp(1.05rem, 5.5cqw, 1.5rem);
  --type-live-adime-header: 1rem;
  --type-live-minor-header: 0.9rem;
  --type-live-field-label: 0.90rem;
  --type-workflow-heading: 1.75rem;
  --type-card-header: 1.15rem;
  --type-subsection-header: 0.95rem;
  --type-preview-subsection: 0.95rem;
  --type-input-body: 0.875rem;
  --type-body: var(--type-input-body);
  --type-field-label: 0.80rem;
  --type-input: var(--type-input-body);
  --type-toolbar-button: 0.80rem;
  --type-utility-button: 0.80rem;
  --type-action-button: 0.9rem;
  /* View Settings / Checkbox / Percentages:
     0.80rem / 650 / #637270 or #1E4D4A / 1 / 0.0125em. */
  --type-view-settings: 0.80rem;
  --type-checkbox-percent: var(--type-view-settings);
  --type-helper: 0.75rem;
  --type-helper-label: 0.75rem;
  --type-placeholder: 0.875rem;
  --type-table-label: 0.90rem;
  --type-table-column-header: 0.75rem;
  --type-table-text: 0.75rem;
  --type-table-input: 0.80rem;
  --type-table-placeholder: 0.75rem;
  --type-live-body: 0.9rem;
  --type-dietary-subtitle: 0.95rem;
  --type-dietary-display: clamp(0.9rem, min(2.2vw, 3cqw), 1.7rem);
  --type-dietary-card-label: clamp(0.80rem, 1vw, 1.05rem);
  --type-dietary-requirement-value: 0.875rem;
  --space-xs: 4px;
  --space-s: 8px;
  --space-m: 12px;
  --space-l: 16px;
  --space-xl: 20px;
  --space-2xl: 28px;
  --space-3xl: 32px;
  --space-subsection: 24px;
  --space-note-title-label-before: 32px;
  --space-note-title-label-after: 4px;
  --space-live-preview-label-before: 60px;
  --space-live-preview-label-after: 12px;
  --space-preview-title-before: 0px;
  --space-preview-title-after: 12px;
  --leading-tight: 1;
  --leading-display-title: 1;
  --leading-heading: 1;
  --leading-input: 1.5;
  --leading-helper: 1.25;
  --leading-body: 1.5;
  --leading-placeholder: 1.25;
  --leading-table-placeholder: 1;
  --leading-view-settings: 1;
  --leading-checkbox-percent: var(--leading-view-settings);
  --leading-dietary-subtitle: 1;
  --leading-dietary-display: 1;
  --leading-dietary-card-label: 1;
  --leading-dietary-requirement-value: 1;
  --tracking-display: 0.01em;
  --tracking-note-title: 0.0125em;
  --tracking-heading: 0.015em;
  --tracking-card-header: 0.02em;
  --tracking-field-label: 0.0125em;
  --tracking-subsection: 0.015em;
  --tracking-body: 0.01em;
  --tracking-placeholder: 0.01em;
  --tracking-table-label: 0.01em;
  --tracking-table-placeholder: 0.01em;
  --tracking-caps: 0.05em;
  --tracking-view-settings: 0.0125em;
  --tracking-checkbox-percent: var(--tracking-view-settings);
  --tracking-dietary-subtitle: 0.015em;
  --tracking-dietary-display: 0.01em;
  --tracking-dietary-card-label: 0.01em;
  --tracking-dietary-requirement-value: 0.01em;
  --align-card-text: 10px;
  --align-preview-title: 3px;
  --preview-card-x: 14px;
}

/* Ensure dynamic form fields actually collapse even when element styles set display. */
[hidden] {
  display: none !important;
}

* {
  box-sizing: border-box;
}

html {
  overflow-anchor: none;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-ui);
  color: var(--ink);
  background: linear-gradient(90deg, #FFFFFF 0%, #F7FBFA 30%, #D7ECE8 65%, #99CFC2 85%, #99CFC2 100%);
  overflow-y: auto;
  overflow-anchor: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

input:disabled {
  opacity: 0.45;
}

button {
  cursor: pointer;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 46px;
  gap: 16px;
  padding: 0 12px 0 20px;
  color: #FFFFFF;
  background: #1E4D4A;
  box-shadow: 0 2px 10px rgba(30, 41, 40, 0.18);
  font-size: var(--type-field-label);
}

.brand-block,
.topbar-actions,
.patient-title,
.patient-meta {
  display: flex;
  align-items: center;
  gap: 9px;
}

.topbar .brand-block {
  min-width: 0;
  gap: 16px;
}

.icon-button,
.rail-button {
  display: grid;
  place-items: center;
  border: 0;
  color: inherit;
  background: transparent;
}

.icon-button {
  width: 22px;
  height: 22px;
}

.topbar-menu-button {
  width: 22px;
  height: 22px;
  gap: 4px;
  color: #FFFFFF;
}

.topbar-menu-button span {
  display: block;
  width: 14px;
  height: 1.8px;
  border-radius: 999px;
  background: currentColor;
}

.topbar-title {
  color: #FFFFFF;
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1;
}

.topbar-actions {
  gap: 13px;
  margin-left: auto;
  color: #FFFFFF;
  opacity: 1;
}

.topbar-icon-action {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border: 0;
  color: rgba(255, 255, 255, 0.9);
  background: transparent;
  font-size: var(--type-utility-button);
  font-weight: 700;
  line-height: 1;
}

.topbar-icon-action[aria-label="Help"] {
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.topbar-icon-action:hover,
.topbar-icon-action:focus-visible,
.topbar-menu-button:hover,
.topbar-menu-button:focus-visible {
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.08);
}

.topbar-icon-action svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.avatar,
.patient-avatar {
  display: grid;
  place-items: center;
  border-radius: 999px;
}

.avatar {
  width: 29px;
  height: 29px;
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.24);
  font-size: 0.72rem;
  font-weight: 700;
}

.topbar-user {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 2px 10px 2px 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #FFFFFF;
  box-sizing: border-box;
}

.topbar-user > span:last-child {
  color: #FFFFFF;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1;
}

.topbar-user-caret {
  width: 11px;
  height: 11px;
  color: rgba(255, 255, 255, 0.82);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.side-rail {
  position: fixed;
  top: 46px;
  bottom: 0;
  left: 0;
  z-index: 5;
  width: 60px;
  border-right: 1px solid #C9DDD8;
  background: #FFFFFF;
}

.rail-button {
  width: 59px;
  height: 46px;
  color: #1E4D4A;
  border-bottom: 1px solid #EDF6F4;
}

.rail-button svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.rail-button.active,
.rail-button:hover,
.rail-button:focus-visible {
  color: #1A73E8;
  background: #F7FBFA;
}

.app-shell {
  margin-left: 60px;
  min-height: calc(100vh - 38px);
}

.patient-strip {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 18px;
  min-height: 86px;
  padding: 10px 28px 10px 22px;
  border-bottom: 1px solid #EDF6F4;
  background: #FFFFFF;
}

.patient-brand-cluster {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
}

.patient-brand-logo {
  width: 63px;
  height: 63px;
  flex: 0 0 auto;
  object-fit: contain;
  filter: drop-shadow(0 2px 3px rgba(30, 77, 74, 0.24));
}

.patient-brand-text {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.patient-brand-text strong {
  color: #1E4D4A;
  font-family: "Montserrat", "Inter", "Segoe UI", Arial, sans-serif;
  font-size: 0.975rem;
  font-weight: 650;
  line-height: 1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.patient-brand-text span {
  color: #0F8F96;
  font-family: "Montserrat", "Inter", "Segoe UI", Arial, sans-serif;
  font-size: 0.575rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.085em;
  text-transform: uppercase;
}

.patient-brand-divider {
  width: 2px;
  min-width: 2px;
  flex-basis: 2px;
  height: 40px;
  flex: 0 0 2px;
  border-radius: 999px;
  background: #0F8F96;
}

.patient-title {
  flex: 1 1 auto;
}

.patient-avatar {
  width: 38px;
  height: 38px;
  color: #1A73E8;
  background: #DFE7FF;
  font-size: 0.85rem;
  font-weight: 700;
}

.patient-avatar svg {
  width: 29px;
  height: 29px;
  fill: currentColor;
}

.patient-strip h1 {
  margin: 0;
  color: var(--ink);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0;
}

.patient-meta {
  margin: 0 0 0 auto;
  color: var(--muted);
  font-size: var(--type-helper);
  font-weight: 600;
  line-height: var(--leading-helper);
}

.patient-date {
  color: #40538E;
  font-size: 0.86rem;
  font-weight: 500;
}

.patient-date span {
  color: #637270;
}

.patient-meta .small-button {
  display: grid;
  width: 36px;
  min-width: 36px;
  height: 36px;
  min-height: 36px;
  place-items: center;
  padding: 0;
}

.patient-meta .small-button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.workflow-tabs {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 50px;
  min-height: 38px;
  padding: 0 65px 0 26px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  overflow-x: auto;
}

.workflow-tabs button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  align-self: stretch;
  border: 0;
  border-bottom: 2px solid transparent;
  color: #637270;
  background: transparent;
  font-size: var(--type-toolbar-button);
  font-weight: 500;
  white-space: nowrap;
}

.workflow-tabs button.active {
  color: #1A73E8;
  border-bottom-color: #1A73E8;
  font-weight: 700;
}

.workflow-tabs button span {
  color: currentColor;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
}

.app-header {
  display: grid;
  grid-template-columns: minmax(0, 1.40fr) minmax(300px, 0.58fr);
  align-items: flex-start;
  gap: 18px;
  padding: 17px 65px 12px 65px;
  color: var(--ink);
  background: transparent;
}

.note-title-area {
  grid-column: 1;
  grid-row: 1;
  width: min(520px, calc(100% - 390px));
  min-width: 320px;
}

.page-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--ink);
  font-size: var(--type-display-title);
  font-weight: 700;
  line-height: var(--leading-display-title);
  letter-spacing: var(--tracking-display);
}

.title-icon {
  display: inline-grid;
  width: 28px;
  height: 28px;
  place-items: center;
}

.title-icon svg {
  width: 28px;
  height: 28px;
  overflow: visible;
}

.title-icon path {
  fill: none;
  stroke: var(--control-blue);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.note-title-label {
  display: block;
  margin: var(--space-note-title-label-before) 0 var(--space-note-title-label-after);
  color: var(--muted);
  font-size: var(--type-helper-label);
  font-weight: 700;
  text-transform: uppercase;
}

.note-title-input {
  display: block;
  width: 100%;
  min-height: 44px;
  border: 0;
  border-bottom: 4px solid #3F7D79;
  border-radius: 0;
  padding: 4px 0 7px;
  color: var(--ink);
  background: transparent;
  box-shadow: none;
  text-shadow: none;
  font-size: var(--type-editable-title);
  font-style: italic;
  font-weight: 650;
  letter-spacing: 0;
}

.app-header input.note-title-input {
  min-height: 44px;
  border: 0;
  border-bottom: 4px solid #3F7D79;
  border-radius: 0;
  padding: 4px 0 7px;
  background: transparent;
  font-size: var(--type-editable-title);
  font-style: italic;
  font-weight: 650;
}

.note-title-input::placeholder {
  color: #637270;
  font-size: var(--type-editable-title);
  font-style: italic;
  font-weight: 650;
  opacity: 0.72;
}

.note-title-input:focus {
  outline: 0;
  border-color: #3F7D79;
  box-shadow: 0 4px 0 -2px #EDF6F4;
}

.note-title-input:hover,
.app-header input.note-title-input:hover {
  border-color: #3F7D79;
  background: transparent;
}

.eyebrow {
  margin: var(--space-l) 0 var(--space-s);
  color: #637270;
  font-size: var(--type-helper-label);
  font-weight: 700;
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  opacity: 1;
}

h1,
h2 {
  margin: 0;
  line-height: var(--leading-heading);
}

h1 {
  font-size: var(--type-display-title);
}

h2 {
  font-size: var(--type-workflow-heading);
}

.header-actions,
.pane-toolbar,
.preview-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-actions {
  grid-column: 2;
  grid-row: 1;
  flex-wrap: wrap;
  align-content: flex-start;
  justify-content: flex-end;
}

.workflow-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-m);
}

.workflow-heading-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-s);
}

.segmented {
  display: flex;
  padding: 3px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.mode-button,
.ghost-button,
.small-button,
.primary-button {
  min-height: 30px;
  border-radius: 7px;
  border: 1px solid transparent;
  padding: 5px 10px;
  white-space: nowrap;
  font-size: var(--type-toolbar-button);
  font-weight: 350;
}

.mode-button {
  color: #EDF6F4;
  background: transparent;
}

.mode-button.active {
  color: var(--accent-dark);
  background: #FFFFFF;
}

.ghost-button {
  color: var(--accent-dark);
  border-color: #C9DDD8;
  background: #FFFFFF;
}

.small-button {
  color: var(--accent-dark);
  border-color: var(--line);
  background: var(--surface);
}

.primary-button {
  color: #FFFFFF;
  background: var(--accent);
}

.submission-action,
.secondary-pill-button,
.lookup-button,
.activity-add-button,
#saveMedication,
#saveAllergy,
#savePrescribedDiet,
#saveNutritionSupport,
#saveActivity,
#addPesStatement,
.medical-history-update-button,
.food-weight-loss-popover .small-button,
.substance-entry .small-button,
.activity-entry .small-button {
  font-size: var(--type-action-button);
  font-weight: 700;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.40fr) minmax(300px, 0.58fr);
  gap: 18px;
  padding: 0 65px 24px 65px;
}

.charting-pane,
.preview-column,
.note-preview {
  min-width: 0;
}

.preview-column {
  position: sticky;
  top: 64px;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: -135px;
  height: calc(100vh - 64px);
}

.pane-toolbar {
  justify-content: flex-end;
  margin-bottom: 14px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--surface-frost);
  box-shadow: 0 4px 14px rgba(30, 77, 74, 0.05);
  backdrop-filter: blur(10px);
}

.pane-toolbar > span {
  min-height: 1px;
}

.assessment-heading,
.monitoring-heading,
.workflow-major-heading {
  margin: var(--space-2xl) 0 var(--space-l);
}

.assessment-heading h3,
.monitoring-heading h3,
.workflow-major-heading h3 {
  margin: 0;
  color: var(--ink);
  font-size: var(--type-workflow-heading);
  font-weight: 700;
  line-height: var(--leading-heading);
  letter-spacing: var(--tracking-heading);
}

.assessment-heading p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: var(--type-helper);
  font-weight: 600;
  line-height: var(--leading-helper);
}

.monitoring-heading[hidden],
.monitoring-section[hidden] {
  display: none;
}

.historical-toggle {
  margin: 10px 0 16px;
  padding: 8px 4px 2px;
}

.followup-inline {
  margin: 0;
}

.followup-workflow-toggle {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 48px;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-width: 0;
  flex: 0 0 auto;
  margin: 0;
  max-width: none;
  border: 1px solid #C9DDD8;
  border-radius: 8px;
  padding: 8px 12px;
  background: #FFFFFF;
  backdrop-filter: none;
  color: #1E2928;
  box-shadow: 0 2px 8px rgba(30, 77, 74, 0.05);
}

.app-header .followup-workflow-toggle {
  grid-column: 1;
  grid-row: 1;
  align-self: end;
  width: min(320px, 24vw);
  min-width: 260px;
  justify-self: end;
}

.followup-workflow-toggle input {
  appearance: none;
  position: relative;
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  margin: 0;
  border: 1px solid #3F7D79;
  border-radius: 2px;
  background: #FFFFFF;
  color: #FFFFFF;
  cursor: pointer;
}

.followup-workflow-toggle input:checked {
  background: #3F7D79;
}

.followup-workflow-toggle input:checked::after {
  content: "\2713";
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
}

.followup-workflow-toggle input:hover,
.followup-workflow-toggle input:focus-visible {
  border-color: #3F7D79;
  background: #FFFFFF;
  outline: 0;
  box-shadow: none;
}

.followup-workflow-toggle input:checked:hover,
.followup-workflow-toggle input:checked:focus-visible {
  background: #3F7D79;
}

.followup-workflow-toggle span {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.followup-workflow-toggle strong {
  color: var(--accent-dark);
  font-size: var(--type-subsection-header);
  font-weight: 700;
  line-height: 1;
}

.followup-workflow-toggle small {
  display: block;
  margin-top: 0;
  color: #637270;
  font-size: var(--type-helper);
  font-weight: 600;
  line-height: var(--leading-helper);
}

.followup-workflow-toggle small em {
  font-style: italic;
  text-transform: capitalize;
}

.view-settings-panel {
  margin: 10px 0 14px;
  border: 1px solid #C9DDD8;
  border-radius: 8px;
  background: var(--surface-frost);
  box-shadow: 0 6px 18px rgba(30, 77, 74, 0.07);
  backdrop-filter: blur(10px);
}

.view-settings-panel summary {
  cursor: pointer;
  padding: 9px 12px;
  color: var(--accent-dark);
  font-size: var(--type-subsection-header);
  font-weight: 700;
}

.view-settings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr));
  align-items: start;
  gap: 0 18px;
  padding: 0 12px 12px;
}

.view-settings-master {
  grid-column: 1 / -1;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  width: fit-content;
  border: 1px solid #C9DDD8;
  border-radius: 999px;
  padding: 6px 12px 6px 8px;
  color: var(--accent-dark);
  background: #EDF6F4;
  font-size: var(--type-helper);
  font-weight: 700;
  line-height: var(--leading-helper);
}

.view-settings-major {
  grid-column: 1 / -1;
  margin: var(--space-l) 0 0;
  border: 0;
  border-bottom: 1px solid #C9DDD8;
  padding: 0;
  background: transparent;
  color: #637270;
  font-size: var(--type-helper);
  font-weight: 600;
  line-height: var(--leading-helper);
  letter-spacing: var(--tracking-body);
  text-transform: uppercase;
}

.view-settings-group {
  display: grid;
  gap: var(--space-s);
  align-content: start;
  margin-top: var(--space-m);
}

.view-settings-major + .view-settings-group {
  margin-top: var(--space-m);
}

.view-settings-group[data-view-section="monitoring"] {
  grid-column: 1 / 2;
}

.view-settings-group[data-view-section="clinical"] {
  grid-column: 1 / 2;
}

.view-settings-group[data-view-section="behavior"] {
  grid-column: 2 / 3;
}

.view-settings-group[data-view-section="food"] {
  grid-column: 3 / 4;
}

.view-settings-group[data-view-section="dietaryRecall"] {
  grid-column: 1 / 2;
}

.view-settings-group[data-view-section="dietaryAssessment"] {
  grid-column: 2 / 3;
}

.view-settings-section-title {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 8px;
  margin: 0 0 var(--space-s);
  color: #1E2928;
  font-size: var(--type-field-label);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: var(--tracking-field-label);
}

.view-settings-section-title strong {
  color: #1E2928;
  font-size: var(--type-field-label);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: var(--tracking-field-label);
}

.view-settings-section-toggle {
  display: inline-flex !important;
  min-height: auto !important;
  margin-left: 2px;
  margin-top: 1px;
  padding: 0;
}

.toggle-switch-input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
}

.toggle-switch-track {
  position: relative;
  display: inline-block;
  width: 31px;
  height: 17px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #C9DDD8;
  box-shadow: inset 0 0 0 1px rgba(47, 97, 93, 0.18);
  vertical-align: middle;
}

.view-settings-master .toggle-switch-track {
  margin-top: 1px;
}

.toggle-switch-track::after {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #FFFFFF !important;
  box-shadow: 0 1px 3px rgba(30, 41, 40, 0.22);
  content: "";
  transition: transform 0.16s ease;
}

.toggle-switch-input:checked + .toggle-switch-track {
  background: var(--control-blue);
  box-shadow: inset 0 0 0 1px rgba(26, 115, 232, 0.2);
}

.toggle-switch-input:checked + .toggle-switch-track::after {
  transform: translateX(14px);
}

.toggle-switch-input:focus-visible + .toggle-switch-track {
  outline: 0;
  box-shadow: none;
}

.view-settings-group strong {
  color: #1E2928;
  font-size: var(--type-field-label);
  font-weight: 650;
}

.view-settings-group label {
  display: flex;
  min-height: auto;
  flex-direction: row;
  gap: 7px;
  align-items: flex-start;
  margin: 0;
  color: #637270;
  font-size: var(--type-view-settings);
  font-weight: 650;
  line-height: var(--leading-view-settings);
  letter-spacing: var(--tracking-view-settings);
}

.view-settings-group input[type="checkbox"]:not(.toggle-switch-input) {
  appearance: none;
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 13px;
  height: 13px;
  margin-top: 2px;
  border: 1px solid #3F7D79;
  border-radius: 2px;
  background: #FFFFFF;
}

.view-settings-group input[type="checkbox"]:not(.toggle-switch-input):hover,
.view-settings-group input[type="checkbox"]:not(.toggle-switch-input):focus-visible {
  outline: 0;
  box-shadow: none;
}

.view-settings-group input[type="checkbox"]:not(.toggle-switch-input):checked {
  background: #3F7D79;
}

.view-settings-group input[type="checkbox"]:not(.toggle-switch-input):checked::after {
  content: "\2713";
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.view-settings-dependent {
  margin-left: 18px;
  font-size: var(--type-helper) !important;
  line-height: var(--leading-helper);
}

.view-settings-dependent input[type="checkbox"] {
  appearance: none;
  position: relative;
  width: 12px;
  height: 12px;
  border: 1px solid #C9DDD8;
  border-radius: 50%;
  background: #FFFFFF;
  flex: 0 0 12px;
}

.view-settings-dependent input[type="checkbox"]:checked {
  border-color: #3F7D79;
  background: #FFFFFF;
}

.view-settings-dependent input[type="checkbox"]:checked::after {
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  background: #3F7D79;
  content: "";
}

.view-settings-group[data-view-section="dietaryRecall"] label[data-view-parent="viewRecall24"] {
  margin-left: 18px;
}

.view-settings-group[data-view-section="dietaryRecall"] label[data-view-parent="viewRecall24"] input[type="checkbox"]:not(.toggle-switch-input) {
  appearance: none;
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 0 12px;
  width: 12px;
  min-width: 12px;
  max-width: 12px;
  height: 12px;
  min-height: 12px;
  max-height: 12px;
  aspect-ratio: 1 / 1;
  margin-top: 2px;
  border: 1px solid #3F7D79;
  border-radius: 50%;
  background: #FFFFFF;
  box-sizing: border-box;
}

.view-settings-group[data-view-section="dietaryRecall"] label[data-view-parent="viewRecall24"] input[type="checkbox"]:not(.toggle-switch-input):checked {
  background: #FFFFFF;
}

.view-settings-group[data-view-section="dietaryRecall"] label[data-view-parent="viewRecall24"] input[type="checkbox"]:not(.toggle-switch-input):checked::after {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #3F7D79;
}

.section-free-text {
  display: grid;
  gap: var(--space-s);
  margin-top: var(--space-m);
  color: var(--ink);
  font-size: var(--type-field-label);
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: var(--tracking-field-label);
}

.view-hidden {
  display: none !important;
}

.view-hidden-by-fallback {
  display: none !important;
}

.note-section {
  margin-bottom: 18px;
  border: 1px solid #C9DDD8;
  border-radius: 8px;
  overflow: hidden;
  overflow-anchor: none;
  background: var(--surface);
  box-shadow: var(--card-shadow);
}

.note-section:has(:is(input, select, textarea):focus),
.section-body:has(:is(input, select, textarea):focus),
.embedded-subsection:has(:is(input, select, textarea):focus),
.behavior-subsection:has(:is(input, select, textarea):focus) {
  overflow: visible;
}

.note-section.fallback-help-active {
  overflow: visible;
}

.note-section.fallback-help-active > .section-toggle {
  border-radius: 7px 7px 0 0;
}

.note-section.fallback-help-active > .section-body {
  border-radius: 0 0 7px 7px;
}

.section-toggle {
  display: flex;
  width: 100%;
  min-height: 29px;
  align-items: center;
  justify-content: space-between;
  border: 0;
  padding: 6px 18px 6px 14px;
  color: #FFFFFF;
  font-weight: 700;
  background: var(--accent);
  font-size: var(--type-card-header);
  cursor: default;
}

.section-toggle:hover {
  background: var(--accent);
}

.section-toggle .chevron {
  width: 18px;
  height: 26px;
  flex: 0 0 18px;
  align-self: center;
  background: transparent;
  cursor: pointer;
  overflow: visible;
  transform: translateX(-2px);
}

.section-toggle .chevron::before {
  width: 40px;
  height: 40px;
}

.chevron {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 999px;
  color: transparent;
  background: transparent;
  font-size: 0;
  box-shadow: none;
}

.chevron::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 19px;
  height: 19px;
  background: url("compass-header.svg") center / contain no-repeat;
  translate: -50% -50%;
  transform: rotate(0deg);
  transform-origin: 50% 50%;
  transition: transform 300ms ease-out;
  will-change: transform;
}

.chevron::after {
  content: none;
}

.chevron[data-tooltip] {
  overflow: visible;
  isolation: isolate;
}

.chevron[data-tooltip]:hover,
.chevron[data-tooltip]:focus-visible {
  cursor: help;
  outline: none;
}

.chevron[data-tooltip]:focus-visible {
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.65);
}

.chevron[data-tooltip]:hover::before,
.chevron[data-tooltip]:focus-visible::before {
  filter: drop-shadow(0 0 2px rgba(255, 255, 255, 0.7));
}

.fallback-tooltip {
  position: absolute;
  right: -2px;
  bottom: calc(100% + 16px);
  z-index: 20;
  width: max-content;
  padding: 8px 18px;
  border: 1px solid #8BB7AB;
  border-radius: 999px;
  color: #1E4D4A;
  background: #FFFFFF;
  box-shadow: 0 8px 18px rgba(30, 77, 74, 0.16);
  font-size: var(--type-helper);
  font-weight: 600;
  line-height: var(--leading-helper);
  letter-spacing: 0.005em;
  text-align: left;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(3px);
  transition: opacity 80ms ease, transform 80ms ease, visibility 80ms ease;
}

.fallback-tooltip strong {
  font-weight: 700;
}

.fallback-tooltip::before,
.fallback-tooltip::after {
  position: absolute;
  clip-path: polygon(0 0, 100% 100%, 100% 0);
  content: "";
}

.fallback-tooltip::before {
  right: 7px;
  top: calc(100% - 1px);
  width: 32px;
  height: 22px;
  background: #8BB7AB;
}

.fallback-tooltip::after {
  right: 8px;
  top: calc(100% - 1px);
  width: 30px;
  height: 20px;
  background: #FFFFFF;
}

.chevron[data-tooltip]:hover .fallback-tooltip,
.chevron[data-tooltip]:focus-visible .fallback-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.chevron[data-tooltip].tooltip-suppressed .fallback-tooltip,
.chevron[data-tooltip].tooltip-suppressed:hover .fallback-tooltip,
.chevron[data-tooltip].tooltip-suppressed:focus-visible .fallback-tooltip {
  display: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(3px);
  transition: none;
}

.note-section:not(.collapsed) > .section-toggle .chevron::before {
  transform: rotate(180deg);
}

.section-body {
  display: grid;
  gap: 12px;
  height: auto;
  overflow: hidden;
  overflow-anchor: none;
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  background: #FFFFFF;
  opacity: 1;
  transform-origin: top;
  transition:
    height 170ms ease,
    padding 170ms ease,
    border-color 170ms ease,
    opacity 120ms ease;
}

.note-section.collapsed .section-body {
  height: 0;
  padding-top: 0;
  padding-bottom: 0;
  border-top-color: transparent;
  opacity: 0;
  pointer-events: none;
}

.field-grid {
  display: grid;
  gap: 12px;
}

.field-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.clinical-grid {
  display: grid;
  gap: 12px;
}

.clinical-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.clinical-grid.two.medical-history-fields {
  position: relative;
  column-gap: 24px;
  row-gap: 10px;
  align-items: stretch;
}

.clinical-grid.two.medical-history-fields::before {
  content: none;
}

.medical-history-builder {
  position: relative;
  display: flex;
  flex-direction: column;
  align-self: stretch;
  gap: 8px;
  min-width: 0;
}

.clinical-grid.two.medical-history-fields {
  position: relative;
}

.clinical-grid.two.medical-history-fields > .medical-history-builder:has(.medical-history-family-label) {
  position: static;
}

.clinical-grid.two.medical-history-fields > .medical-history-builder:first-child::after {
  content: "";
  position: absolute;
  top: var(--space-m);
  right: -12px;
  bottom: 0;
  width: 1px;
  background: #C9DDD8;
  pointer-events: none;
}

.medical-history-builder > label {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
}

.medical-history-builder > label:first-child {
  font-weight: 700;
}

.medical-history-family-label {
  position: static;
}

.medical-history-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.medical-diagnosis-heading {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.medical-history-help-row {
  position: relative;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  min-height: 24px;
  margin: 4px 0 4px;
}

.medical-history-help-button {
  position: static;
  z-index: 5;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid #8BB7AB;
  border-radius: 999px;
  color: #1E4D4A;
  background: #EDF6F4;
  font-size: var(--type-view-settings);
  font-weight: 700;
  line-height: var(--leading-view-settings);
  letter-spacing: var(--tracking-view-settings);
}

.medical-history-help-button:hover,
.medical-history-help-button:focus-visible {
  color: #FFFFFF;
  background: #99CFC2;
  border-color: #8BB7AB;
}

.medical-history-help-text {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 4;
  width: 75%;
  max-width: calc(100% - 16px);
  box-sizing: border-box;
  padding: 14px 16px;
  border: 1px solid #8BB7AB;
  border-radius: 8px;
  color: #1E2928;
  background: #FFFFFF;
  box-shadow: 0 10px 24px rgba(30, 77, 74, 0.14);
  font-size: var(--type-input-body);
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: var(--tracking-body);
}

.profile-history-list {
  min-height: 56px;
  border-color: #8BB7AB;
}

.profile-history-list:hover {
  border-color: #8BB7AB;
  background: #FFFFFF;
  box-shadow: none;
}

.profile-history-list:focus,
.profile-history-list:focus-visible {
  outline: 0;
  border-color: #8BB7AB;
  background: #FFFFFF;
  box-shadow: 0 0 0 3px #EDF6F4;
}

.medical-event-entry,
.family-history-entry {
  --medical-history-control-width: 220px;
  --medical-history-action-width: 92px;
  display: grid;
  gap: 8px;
  grid-template-columns:
    minmax(var(--medical-history-control-width), var(--medical-history-control-width))
    minmax(var(--medical-history-control-width), var(--medical-history-control-width))
    minmax(130px, 1fr)
    minmax(var(--medical-history-action-width), var(--medical-history-action-width));
  align-items: end;
}

.medical-event-entry label,
.family-history-entry label {
  min-width: 0;
}

#medicalEventOtherField {
  grid-column: 1 / span 2;
}

#familyRelationshipOtherField {
  grid-column: 1;
}

#familyHealthConditionOtherField {
  grid-column: 2;
}

.medical-history-notes-field {
  grid-column: 3;
}

.medical-event-entry label:has(#medicalEventType) {
  order: 1;
}

.medical-event-entry label:has(#medicalEventDate) {
  order: 2;
}

.medical-event-entry #medicalEventOtherField {
  order: 5;
}

.medical-event-entry .medical-history-notes-field {
  order: 3;
}

.family-history-entry label:has(#familyRelationship) {
  order: 1;
}

.family-history-entry label:has(#familyHealthCondition) {
  order: 2;
}

.family-history-entry #familyRelationshipOtherField {
  order: 5;
}

.family-history-entry #familyHealthConditionOtherField {
  order: 6;
}

.family-history-entry .medical-history-notes-field {
  order: 3;
}

.medical-history-update-button {
  grid-column: 4;
  order: 4;
  align-self: end;
  width: 100%;
}

.medical-history-opener,
.medical-history-update-button {
  min-height: 32px;
  color: #1E4D4A;
  border-color: #8BB7AB;
  background: #EDF6F4;
  font-weight: 650 !important;
}

.medical-history-opener.selected {
  color: #FFFFFF;
  border-color: #8BB7AB;
  background: #99CFC2;
  box-shadow: none;
}

.medical-history-entry > label,
.medical-history-entry > button {
  min-width: 0;
}

.medical-history-entry > label {
  display: grid;
  align-content: end;
  gap: 8px;
  margin: 0;
}

.medical-history-entry :is(select, input[type="text"], .date-picker-field, .medical-history-update-button) {
  height: 36px;
  min-height: 36px;
}

.medical-history-entry .date-picker-field > input[type="text"] {
  height: 36px;
  min-height: 36px;
}

.medical-history-update-button.submission-action:disabled,
.medical-history-update-button.submission-action:disabled:hover,
.medical-history-update-button.submission-action:disabled:focus-visible,
.medical-history-update-button.submission-ready {
  color: #1E4D4A !important;
  border-color: #8BB7AB !important;
  background: #EDF6F4 !important;
  box-shadow: none !important;
}

.medical-history-update-button.submission-ready:hover,
.medical-history-update-button.submission-ready:focus-visible {
  cursor: pointer;
  color: #FFFFFF !important;
  border-color: #8BB7AB !important;
  background: #99CFC2 !important;
}

.medical-history-entry .medical-history-notes-field :is(input, select, textarea):focus,
.medical-history-entry .medical-history-notes-field :is(input, select, textarea):focus-visible {
  outline: 0 !important;
  border-color: #8BB7AB !important;
  box-shadow: 0 0 0 3px #EDF6F4 !important;
}

.embedded-subsection {
  display: block;
}

.embedded-subsection .section-body {
  display: grid;
  gap: 10px;
  padding: 0;
  border: 0;
  background: transparent;
}

.diet-order-box {
  display: grid;
  gap: 8px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.diet-order-box .minor-heading {
  margin: 0;
  color: var(--accent-dark);
  font-size: var(--type-field-label);
  font-weight: 650;
}

.diet-order-box .clinical-inline-builder,
.diet-order-box .clinical-entry {
  padding: 0 0 6px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.diet-order-box :is(input, select, textarea):focus {
  border-color: #78A97D;
  outline: 0;
  box-shadow: 0 0 0 3px #E8F4E9;
}

.med-supp-layout {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  column-gap: 24px;
  row-gap: 12px;
}

.med-supp-layout::before {
  content: "";
  position: absolute;
  top: var(--space-m);
  bottom: 0;
  left: 50%;
  width: 1px;
  background: #C9DDD8;
  transform: translateX(-0.5px);
  pointer-events: none;
}

.med-supp-column {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.medication-summary-field {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 5px;
  min-height: 0;
  color: var(--ink);
  font-size: var(--type-field-label);
  font-weight: 650;
}

.clinical-list-editor {
  min-height: 56px;
  resize: vertical;
  font-size: var(--type-input);
  font-weight: 450;
  line-height: 1.45;
  background: #FFFFFF;
}

.medical-history-builder > .secondary-pill-button,
.med-supp-column > .secondary-pill-button {
  margin-top: auto;
}

#medicationList {
  border-color: #6E83C7;
}

#supplementList {
  border-color: #6E83C7;
}

#prescribedDietListEditor {
  border-color: #78A97D;
}

#nutritionSupportList {
  border-color: #78A97D;
}

#supplementList:focus,
#supplementList:focus-visible {
  border-color: #6E83C7;
  outline: 0;
  box-shadow: 0 0 0 3px #E8ECFA;
}

#prescribedDietListEditor:focus,
#prescribedDietListEditor:focus-visible {
  border-color: #78A97D;
  outline: 0;
  box-shadow: 0 0 0 3px #E8F4E9;
}

#nutritionSupportList:focus,
#nutritionSupportList:focus-visible {
  border-color: #78A97D;
  outline: 0;
  box-shadow: 0 0 0 3px #E8F4E9;
}

#allergyList {
  border-color: #C8791E;
}

#intoleranceList {
  border-color: #C8791E;
}

#intoleranceList:focus,
#intoleranceList:focus-visible {
  border-color: #C8791E;
  outline: 0;
  box-shadow: 0 0 0 3px #F9D9A6;
}

.diet-note-builder {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.diet-note-builder > label,
.diet-add-field {
  min-width: 0;
}

.diet-add-field {
  display: grid;
  align-content: end;
  gap: 5px;
  font-size: var(--type-field-label);
  font-weight: 650;
}

.diet-add-field button {
  width: 100%;
}

.diet-support-opener {
  width: 100%;
  --button-active-rim: #E8F4E9;
  color: #254D2A;
  border-color: #78A97D;
  background: #E8F4E9;
}

.diet-support-opener.selected {
  color: #FFFFFF;
  border-color: #78A97D;
  background: #A9CFAE;
  box-shadow: none;
}

#addNutritionSupport.diet-support-opener,
#addNutritionSupport.diet-support-opener:hover,
#addNutritionSupport.diet-support-opener:focus-visible {
  color: #254D2A;
  border-color: #78A97D;
  background: #E8F4E9;
}

#addNutritionSupport.diet-support-opener.selected,
#addNutritionSupport.diet-support-opener.selected:hover,
#addNutritionSupport.diet-support-opener.selected:focus-visible {
  color: #FFFFFF;
  border-color: #78A97D;
  background: #A9CFAE;
  box-shadow: none;
}

.medical-diet-note-field textarea {
  border-color: #78A97D;
}

.medical-diet-note-field textarea:hover {
  border-color: #78A97D;
  background: #FFFFFF;
  box-shadow: none;
}

.medical-diet-note-field textarea:focus,
.medical-diet-note-field textarea:focus-visible {
  border-color: #78A97D !important;
  outline: 0;
  background: #FFFFFF;
  box-shadow: 0 0 0 3px #E8F4E9 !important;
}

select:required:invalid {
  color: #637270;
}

select:required option {
  color: var(--ink);
}

.entry-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.entry-actions button,
.diet-note-builder button {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #FFFFFF;
  color: var(--accent-dark);
  font-weight: 700;
  font-size: var(--type-action-button);
  padding: 4px 10px;
}

.diet-order-box .entry-actions button {
  min-height: 30px;
  padding: 4px 10px;
}

.diet-order-box :is(button, #addPrescribedDiet, #saveNutritionSupport, #cancelNutritionSupport):focus-visible {
  outline: 0;
  box-shadow: none;
}

.clinical-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.recall-grid {
  display: grid;
  gap: 10px 12px;
}

.recall-meal {
  display: grid;
  position: relative;
  grid-template-columns: minmax(320px, 1.8fr) minmax(0, 0.8fr);
  gap: 8px 12px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #FFFFFF;
  cursor: pointer;
}

.recall-meal > label:first-child {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  font-weight: 700;
}

.recall-grid textarea {
  min-height: 40px;
  background: #FFFFFF;
}

.recall-analysis {
  display: grid;
  position: relative;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  align-content: start;
  font-size: var(--type-field-label);
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: var(--tracking-field-label);
}

.recall-lookup-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  height: 40px;
  min-height: 40px;
  overflow: hidden;
  border: 1px solid #C9DDD8;
  border-radius: 999px;
  background: linear-gradient(90deg, #FFFFFF 0%, #FFFFFF calc(100% - 44px), #EDF6F4 calc(100% - 44px), #EDF6F4 100%);
  box-shadow: inset 0 1px 2px rgba(30, 77, 74, 0.05);
}

.recall-analysis:focus-within .recall-lookup-control {
  border-color: #3F7D79;
  box-shadow: 0 0 0 3px rgba(237, 246, 244, 0.95);
}

.recall-analysis input {
  width: 100%;
  height: 40px;
  min-height: 40px;
  padding: 0 12px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.recall-analysis input:focus {
  outline: 0;
}

.recall-analysis input::placeholder {
  color: #637270;
}

.recall-analysis input.input-alert {
  animation: recall-search-empty 180ms ease-in-out 2;
}

.lookup-button {
  position: relative;
  right: auto;
  bottom: auto;
  display: block;
  width: 44px;
  min-width: 44px;
  height: 100%;
  min-height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-left: 0;
  border-radius: 0 999px 999px 0;
  color: #1E4D4A;
  background: transparent;
  font-size: 0;
  font-weight: 700;
  line-height: 1;
  box-shadow: inset 8px 0 12px -14px rgba(30, 77, 74, 0.35);
  transform: scale(1);
  transition: background-color 360ms ease, color 360ms ease, transform 360ms ease;
}

.lookup-button::before,
.lookup-button::after {
  position: absolute;
  content: "";
}

.lookup-button::before {
  top: 10px;
  left: 12px;
  width: 11px;
  height: 11px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.lookup-button::after {
  top: 23px;
  left: 25px;
  width: 8px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transform: rotate(45deg);
  transform-origin: left center;
}

.lookup-button:hover,
.lookup-button:focus-visible {
  color: #1E4D4A;
  background: rgba(153, 207, 194, 0.75);
  outline: 0;
}

.recall-analysis.is-searching .lookup-button {
  color: #1E4D4A;
  background: rgba(153, 207, 194, 0.75);
  transform: scale(1.08);
}

@keyframes recall-search-empty {
  0%, 100% { background: #FFFFFF; }
  50% { background: #F7FBFA; }
}

.return-top-button {
  position: fixed;
  top: calc(100vh - 91px);
  right: 0;
  bottom: auto;
  z-index: 40;
  width: 65px;
  height: 73px;
  border: 0;
  background: url("compass-top.svg") center / contain no-repeat;
  color: var(--accent-dark);
  box-shadow: none;
  cursor: pointer;
  transform: rotate(0deg);
  transform-origin: center;
  transition:
    top 860ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 680ms cubic-bezier(0.22, 1, 0.36, 1);
}

.return-top-button.is-at-top {
  top: 181px;
  bottom: auto;
  transform: rotate(180deg);
}

.nutrition-prescription-field {
  display: grid;
  gap: 6px;
}

.field-label {
  color: var(--ink);
  font-size: var(--type-field-label);
  font-weight: 650;
}

.nutrition-prescription-box {
  overflow: hidden;
  border: 1px solid #C9DDD8;
  border-radius: 5px;
  background: #FFFFFF;
}

.generated-prescription {
  display: block;
  min-height: 38px;
  padding: 10px 12px;
  border: 0;
  border-radius: 0;
  color: var(--ink);
  background: #FFFFFF;
  font-size: var(--type-body);
  font-weight: 550;
  line-height: var(--leading-body);
  white-space: pre-wrap;
  resize: vertical;
}

.generated-clinical-text {
  color: var(--ink);
  background: #FFFFFF;
  font-size: var(--type-body);
  font-weight: 550;
  line-height: var(--leading-body);
}

.nutrition-prescription-box textarea {
  min-height: 74px;
  border: 0;
  border-top: 1px solid #C9DDD8;
  border-radius: 0;
  resize: vertical;
}

.nutrition-prescription-box .generated-prescription {
  min-height: 38px;
  border-top: 0;
}

.nutrition-prescription-box textarea::placeholder {
  color: #637270;
  font-size: var(--type-placeholder);
  font-weight: 450;
}

.prescription-note-label {
  display: block;
  padding: 9px 12px 0;
  border-top: 1px solid #C9DDD8;
  color: var(--muted);
  background: #FFFFFF;
  font-size: var(--type-helper);
  font-weight: 600;
  line-height: var(--leading-helper);
}

.prescription-note-label + textarea {
  border-top: 0;
}

.intervention-goals-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.intervention-subsection-toggle {
  display: flex;
  width: 100%;
  min-height: 29px;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  border: 0;
  border-left: 3px solid var(--accent);
  color: var(--accent-dark);
  background: #edf6f4;
  font: inherit;
  font-size: var(--type-subsection-header);
  font-weight: 700;
  text-align: left;
}

.resources-compass {
  position: relative;
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  border: 1px solid var(--accent-dark);
  border-radius: 50%;
  color: var(--accent-dark);
  background: transparent;
}

.resources-compass::before {
  content: "";
  position: absolute;
  inset: 3px;
  width: auto;
  height: auto;
  background: var(--accent-dark);
  clip-path: polygon(50% 0, 59% 40%, 100% 50%, 59% 60%, 50% 100%, 41% 60%, 0 50%, 41% 40%);
}

.intervention-resources-body {
  padding-top: 8px;
}

.intervention-resources-body textarea {
  width: 100%;
}

.return-top-button::before {
  content: none;
}

.return-top-button::after {
  content: none;
}

.recall-meal:has(.recall-analysis.view-hidden),
.recall-meal:has(.recall-analysis.view-hidden-by-setting),
.recall-meal:has(.recall-analysis.view-hidden-by-fallback) {
  grid-template-columns: 1fr;
}

.recall-meal:has(.recall-analysis.view-hidden) > label:first-child,
.recall-meal:has(.recall-analysis.view-hidden-by-setting) > label:first-child,
.recall-meal:has(.recall-analysis.view-hidden-by-fallback) > label:first-child {
  grid-template-columns: 96px minmax(0, 1fr);
}

.recall-meal-toggle {
  display: none;
}

.recall-meal.collapsed {
  display: block;
  min-height: 34px;
  padding: 8px 12px;
}

.recall-meal.collapsed::before {
  content: attr(data-meal-label);
  color: var(--accent-dark);
  font-size: var(--type-field-label);
  font-weight: 650;
}

.recall-meal.collapsed > label,
.recall-meal.collapsed .recall-analysis {
  display: none !important;
}

@media (max-width: 820px) {
  .recall-meal {
    grid-template-columns: 1fr;
  }

  .recall-analysis {
    display: none;
  }

  .recall-meal > label:first-child {
    grid-template-columns: 96px minmax(0, 1fr);
  }
}

.dietary-assessment-box {
  display: grid;
  gap: 10px;
  margin-bottom: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #FFFFFF;
}

.dietary-assessment-shell {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.infant-test-panel {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #FFFFFF;
  box-shadow: 0 6px 14px rgba(30, 77, 74, 0.08);
}

.infant-view-settings {
  display: grid;
  gap: 6px;
}

.infant-view-settings[hidden] {
  display: none;
}

.dietary-assessment-table [hidden] {
  display: none !important;
}

.dietary-assessment-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
  justify-content: space-between;
  min-height: 52px;
}

.dietary-recommend-toggle {
  order: 2;
}

.dietary-recommend-toggle[hidden] {
  display: none;
}

#dietaryAssessmentPatternLabel,
#infantAssessmentToddlerPatternLabel {
  order: 1;
  margin-right: auto;
}

#infantAssessmentToddlerPatternLabel[hidden],
#dietaryAssessmentPatternLabel[hidden] {
  display: none;
}

.dietary-assessment-table {
  display: grid;
  grid-template-columns: minmax(124px, 0.85fr) minmax(138px, 1fr) 76px minmax(142px, 1fr);
  gap: 0;
  overflow-x: auto;
  border: 1px solid #C9DDD8;
  border-radius: 6px;
}

.standard-assessment-table.recommended-active {
  grid-template-columns: minmax(124px, 0.85fr) minmax(138px, 1fr) 76px minmax(142px, 1fr) 76px minmax(142px, 1fr);
}

.infant-assessment-table {
  grid-template-columns: minmax(130px, 0.9fr) minmax(120px, 1fr) minmax(160px, 1.2fr) minmax(130px, 1fr);
}

.infant-assessment-table.infant-guidance-table .toddler-column {
  display: none !important;
}

.infant-assessment-table.infant-guidance-table .category-head {
  grid-column: 1;
}

.infant-assessment-table.infant-guidance-table > .dietary-assessment-head:nth-child(2) {
  grid-column: 2;
}

.infant-assessment-table.infant-guidance-table > #infantAssessmentRequirementsHeader {
  grid-column: 3;
}

.infant-assessment-table.infant-guidance-table > .infant-guidance-column.dietary-assessment-head {
  grid-column: 4;
}

.infant-assessment-table.infant-guidance-table > .dietary-assessment-category:not(.toddler-column) {
  grid-column: 1;
}

.infant-assessment-table.infant-guidance-table > select {
  grid-column: 2;
}

.infant-assessment-table.infant-guidance-table > output[id$="Required"] {
  grid-column: 3;
}

.infant-assessment-table.infant-guidance-table > output[id$="Comparison"] {
  grid-column: 4;
}

.infant-assessment-table.toddler-assessment-table {
  grid-template-columns: minmax(124px, 0.85fr) minmax(138px, 1fr) 76px minmax(142px, 1fr);
}

.infant-assessment-table.toddler-assessment-table.toddler-recommended-active {
  grid-template-columns: minmax(124px, 0.85fr) minmax(138px, 1fr) 76px minmax(142px, 1fr) 76px minmax(142px, 1fr);
}

.infant-assessment-table.toddler-assessment-table .infant-guidance-column {
  display: none !important;
}

.infant-assessment-table.toddler-assessment-table > .dietary-assessment-category {
  grid-column: 1;
}

.infant-assessment-table.toddler-assessment-table > select,
.infant-assessment-table.toddler-assessment-table > #infantAssessmentCalories {
  grid-column: 2;
}

.infant-assessment-table.toddler-assessment-table > output[id$="Percent"]:not([id^="infantAssessmentRecommended"]) {
  grid-column: 3;
}

.infant-assessment-table.toddler-assessment-table > output[id$="Required"],
.infant-assessment-table.toddler-assessment-table > #infantAssessmentRequiredCalories {
  grid-column: 4;
}

.infant-assessment-table.toddler-assessment-table > .toddler-recommended-column:is(.dietary-assessment-output) {
  grid-column: 5;
}

.infant-assessment-table.toddler-assessment-table > .toddler-recommended-column:is(input, select) {
  grid-column: 6;
}

.dietary-assessment-head,
.dietary-assessment-category,
.dietary-assessment-table select,
.dietary-assessment-table input,
.dietary-assessment-output {
  min-height: 38px;
  border: 0;
  border-right: 1px solid #C9DDD8;
  border-bottom: 1px solid #C9DDD8;
  border-radius: 0;
  white-space: nowrap;
}

.dietary-assessment-head {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 6px;
  color: #637270;
  background: #EDF6F4;
  font-size: var(--type-helper-label);
  font-weight: 700;
  letter-spacing: var(--tracking-caps);
  line-height: 1;
  text-align: center;
  text-transform: uppercase;
}

.infant-assessment-table.infant-guidance-table > .dietary-assessment-head {
  min-height: 38px;
}

.dietary-assessment-category {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 7px 8px;
  color: #1E2928;
  background: #edf6f4;
  border-left: 4px solid var(--accent);
  font-size: var(--type-dietary-card-label);
  font-weight: 750;
  letter-spacing: var(--tracking-dietary-card-label);
  line-height: var(--leading-dietary-card-label);
  text-align: right;
  text-transform: uppercase;
}

.dietary-assessment-output {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 7px 6px;
  background: #FFFFFF;
  color: #1E2928;
  font-size: var(--type-dietary-requirement-value);
  font-weight: 750;
  letter-spacing: var(--tracking-dietary-requirement-value);
  line-height: var(--leading-dietary-requirement-value);
}

.dietary-assessment-output.comparison-lilac {
  background: #F3EBF6;
  color: #6F42C1;
}

.dietary-assessment-output.comparison-amber {
  background: #F9D9A6;
  color: #D48A00;
}

.dietary-assessment-output.comparison-coral {
  background: #FCE9E4;
  color: #D94F5C;
}

.dietary-assessment-output.comparison-teal {
  background: #EDF6F4;
  color: #0F8F96;
}

.dietary-assessment-table select,
.dietary-assessment-table input {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  background-color: #FFFFFF;
  color: #1E2928;
  font-size: var(--type-input);
  font-weight: 550;
  letter-spacing: var(--tracking-body);
  line-height: var(--leading-tight);
  text-align: center;
}

#dietaryAssessmentPattern,
#infantAssessmentToddlerPattern,
.dietary-assessment-table select,
.dietary-assessment-table input {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dietary-assessment-table select,
.dietary-assessment-table input,
.dietary-assessment-output {
  font-size: var(--type-input) !important;
}

.dietary-assessment-table input.recommended-column,
.dietary-assessment-table input.toddler-recommended-column,
.dietary-assessment-table select.recommended-column,
.dietary-assessment-table select.toddler-recommended-column {
  color: #1E2928;
  font-size: var(--type-input) !important;
  font-weight: 550;
  letter-spacing: var(--tracking-body);
  line-height: var(--leading-tight);
}

#dietaryAssessmentCalories,
#dietaryAssessmentRequiredCalories,
#dietaryAssessmentRecommendedCaloriesDisplay,
#infantAssessmentCalories,
#infantAssessmentRequiredCalories {
  font-weight: 700;
}

.dietary-assessment-table .recommended-column {
  background-color: #F6DC88;
}

.dietary-assessment-table .recommended-calorie-select {
  background-color: #FFFFFF;
  color: #1E2928;
  font-size: var(--type-input);
  font-weight: 550;
  letter-spacing: var(--tracking-body);
  line-height: var(--leading-tight);
}

.pes-builder-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-items: start;
  min-width: 0;
  max-width: 100%;
}

.pes-problem-field {
  grid-column: 1;
  grid-row: 1;
}

.pes-problem-combobox {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  min-width: 0;
}

.pes-problem-combobox #pesProblemSearch {
  grid-column: 1 / -1;
  grid-row: 1;
  min-width: 0;
  padding-right: 38px;
}

.pes-problem-combobox #pesProblemSearch:focus {
  border-color: #CEA00C;
  outline: 0;
  box-shadow: 0 0 0 3px #F6DC88;
}

#pesEtiology:focus,
#pesSymptoms:focus,
#pesSpecifier:focus,
#pesSpecifyText:focus {
  border-color: #CEA00C;
  outline: 0;
  background: #FFFFFF;
  box-shadow: 0 0 0 3px #F6DC88;
}

.pes-problem-toggle {
  position: relative;
  z-index: 1;
  grid-column: 2;
  grid-row: 1;
  min-width: 34px;
  min-height: 32px;
  border: 0;
  color: #1E4D4A;
  background: transparent;
}

.pes-problem-toggle::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translate(-50%, -65%) rotate(45deg);
}

.pes-problem-toggle:hover,
.pes-problem-toggle:focus-visible {
  color: #1E4D4A;
  background: transparent;
  outline: 0;
}

.pes-problem-native {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.pes-specifier-field {
  grid-column: 1;
  grid-row: 2;
}

.pes-etiology-field {
  grid-column: 2;
  grid-row: 1 / span 2;
}

.pes-symptoms-field {
  grid-column: 3;
  grid-row: 1 / span 2;
}

.pes-builder-grid > *,
.note-section[data-section="nutritionDiagnosis"] .section-body,
.note-section[data-section="nutritionDiagnosis"] .clinical-panel,
.note-section[data-section="nutritionDiagnosis"] .code-list {
  min-width: 0;
  max-width: 100%;
}

.pes-builder-grid textarea {
  min-height: 116px;
}

.pes-specifier-field[hidden] {
  display: none;
}

.pes-statement-box {
  display: grid;
  gap: 6px;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #FFFFFF;
}

.pes-statement-box output {
  min-height: 42px;
  padding: 10px;
  border: 1px solid #C9DDD8;
  border-radius: 4px;
  background: #FFFFFF;
  color: #1E2928;
}

#pesStatementList {
  margin-top: var(--space-m);
}

.sub-assessment-heading {
  margin-top: 10px;
  margin-bottom: 8px;
  padding-top: 0;
}

.sub-assessment-heading p {
  margin-top: 0;
}

.clinical-panel {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #FFFFFF;
}

.diagnosis-placeholder-panel {
  padding: 6px 0 2px;
  border: 0;
  background: transparent;
}

.diagnosis-placeholder-panel .code-list {
  padding-left: 0;
}

.code-list,
.clinical-list,
.button-row,
.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.clinical-bullet-list {
  display: grid;
  gap: 4px;
  padding: 4px 0 0 18px;
}

.code-list span,
.clinical-list-item,
.suggested-code-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 26px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 9px;
  color: #1E2928;
  background: var(--soft);
  font-size: var(--type-toolbar-button);
  font-weight: 650;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: manual;
}

.clinical-bullet-list .clinical-list-item {
  display: list-item;
  min-height: 0;
  border: 0;
  border-radius: 0;
  padding: 0;
  color: var(--ink);
  background: transparent;
  font-size: var(--type-field-label);
  font-weight: 650;
  list-style: disc;
}

.clinical-bullet-list .mini-remove-button {
  margin-left: 6px;
}

.neutral-list span {
  border-color: #C9DDD8;
  background: #EDF6F4;
}

.selected-code-list span {
  color: var(--accent-dark);
  border-color: #C9DDD8;
  background: var(--accent-soft);
}

.suggested-code-chip {
  border-style: dotted;
  border-color: #1E4D4A;
  background: #FFFFFF;
}

.code-list .placeholder-chip {
  color: var(--muted);
  border-style: dashed;
  background: #FFFFFF;
  font-style: italic;
}

.secondary-pill-button {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 12px;
  color: #1E2928;
  background: var(--soft);
  font-size: var(--type-action-button);
  font-weight: 700;
}

.secondary-pill-button.selected {
  color: var(--accent-dark);
  border-color: #C9DDD8;
  background: var(--accent-soft);
}

#addMedication {
  --button-active-rim: #E8ECFA;
  border: 1px solid #6E83C7;
  color: #40538E;
  background: #e8ecfa;
}

#addMedication.selected {
  border-color: #6E83C7;
  color: #FFFFFF;
  background: #A8B8EA;
  box-shadow: none;
}

#addSupplement {
  --button-active-rim: #E8ECFA;
  border-color: #6E83C7;
  color: #40538E;
  background: #E8ECFA;
}

#addSupplement.selected {
  border-color: #6E83C7;
  color: #FFFFFF;
  background: #A8B8EA;
  box-shadow: none;
}

#addAllergy {
  --button-active-rim: #F9D9A6;
  border-color: #C8791E;
  color: #583900;
  background: #F9D9A6;
}

#addAllergy.selected {
  border-color: #c8791e;
  color: #FFFFFF;
  background: #F2AC4C;
  box-shadow: none;
}

#addIntolerance {
  --button-active-rim: #F9D9A6;
  border-color: #C8791E;
  color: #583900;
  background: #F9D9A6;
}

#addIntolerance.selected {
  border-color: #C8791E;
  color: #FFFFFF;
  background: #F2AC4C;
  box-shadow: none;
}

#addPrescribedDiet {
  --button-active-rim: #E8F4E9;
  border-color: #78A97D;
  color: #254D2A;
  background: #E8F4E9;
}

#addPrescribedDiet.selected {
  border-color: #78A97D;
  color: #FFFFFF;
  background: #A9CFAE;
  box-shadow: none;
}

#addNutritionSupport {
  --button-active-rim: #E8F4E9;
  border-color: #78A97D;
  color: #254D2A;
  background: #E8F4E9;
}

#addNutritionSupport.selected {
  border-color: #78A97D;
  color: #FFFFFF;
  background: #A9CFAE;
  box-shadow: none;
}

.clinical-entry,
.clinical-inline-builder {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid #C9DDD8;
  border-radius: 8px;
  background: #FFFFFF;
  box-shadow: 0 8px 18px rgba(30, 77, 74, 0.08);
}

.medical-history-entry {
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 0.9fr) minmax(0, 1.7fr) minmax(92px, 0.45fr);
  border-color: #8BB7AB;
  box-shadow: 0 0 0 3px #EDF6F4, 0 8px 18px rgba(30, 77, 74, 0.1);
}

.medical-history-entry :is(input, select, textarea):focus,
.medical-history-entry :is(input, select, textarea):focus-visible {
  outline: 0;
  border-color: #8BB7AB;
  box-shadow: 0 0 0 3px #EDF6F4;
}

#medicationEntry {
  grid-template-columns: repeat(4, minmax(110px, 1fr));
  margin-top: 12px;
}

#medicationEntry[data-category="Medication"] {
  --button-active-rim: #E8ECFA;
  border-color: #6E83C7;
  box-shadow: 0 0 0 3px #E8ECFA, 0 8px 18px rgba(64, 83, 142, 0.1);
}

#medicationEntry[data-category="Medication"] :is(input, select, textarea):focus {
  outline: 0;
  border-color: #40538E;
  box-shadow: 0 0 0 3px #E8ECFA;
}

#medicationEntry[data-category="Supplement"] {
  --button-active-rim: #E8ECFA;
  border-color: #6E83C7;
  box-shadow: 0 0 0 3px #E8ECFA, 0 8px 18px rgba(64, 83, 142, 0.1);
}

#medicationEntry[data-category="Supplement"] :is(input, select, textarea):focus {
  outline: 0;
  border-color: #40538E;
  box-shadow: 0 0 0 3px #E8ECFA;
}

#prescribedDietEntry {
  grid-template-columns: repeat(4, minmax(110px, 1fr));
  border-color: #78A97D;
  box-shadow: 0 0 0 3px #E8F4E9, 0 8px 18px rgba(37, 77, 42, 0.1);
}

#nutritionSupportEntry {
  border-color: #78A97D;
  box-shadow: 0 0 0 3px #E8F4E9, 0 8px 18px rgba(37, 77, 42, 0.1);
}

#prescribedDietEntry :is(input, select, textarea):focus,
#prescribedDietEntry :is(input, select, textarea):focus-visible,
.nutrition-support-entry :is(input, select, textarea):focus,
.nutrition-support-entry :is(input, select, textarea):focus-visible {
  outline: 0;
}

#prescribedDietEntry :is(input, select, textarea):focus,
#prescribedDietEntry :is(input, select, textarea):focus-visible {
  border-color: #78A97D;
  box-shadow: 0 0 0 3px #E8F4E9;
}

.nutrition-support-entry :is(input, select, textarea):focus,
.nutrition-support-entry :is(input, select, textarea):focus-visible {
  border-color: #78A97D;
  box-shadow: 0 0 0 3px #E8F4E9;
}

#prescribedDietEntry .date-picker-field:focus-within > input[type="text"],
#nutritionSupportEntry .date-picker-field:focus-within > input[type="text"],
#prescribedDietEntry .month-year-field:focus-within > input[type="text"],
#nutritionSupportEntry .month-year-field:focus-within > input[type="text"] {
  border-color: #78A97D;
  box-shadow: 0 0 0 3px #E8F4E9;
}

.diet-order-note-field {
  grid-column: span 3;
}

#savePrescribedDiet {
  color: #254D2A;
  border-color: #78A97D;
  background: #E8F4E9;
}

#savePrescribedDiet.submission-ready:hover,
#savePrescribedDiet.submission-ready:focus-visible {
  color: #FFFFFF;
  border-color: #78A97D;
  background: #A9CFAE;
}

#allergyEntry {
  --button-active-rim: #F9D9A6;
  border-color: #C8791E;
  box-shadow: 0 0 0 3px #F9D9A6, 0 8px 18px rgba(86, 51, 6, 0.07);
}

#allergyEntry :is(input, select, textarea):focus {
  outline: 0;
  border-color: #C8791E;
  background: #FFFFFF;
  box-shadow: 0 0 0 3px #F9D9A6;
}

#allergyEntry .date-picker-field:focus-within > input[type="text"],
#allergyEntry .month-year-field:focus-within > input[type="text"] {
  border-color: #C8791E;
  box-shadow: 0 0 0 3px #F9D9A6;
}

#allergyEntry[data-category="Intolerance"] {
  --button-active-rim: #F9D9A6;
  border-color: #C8791E;
  box-shadow: 0 0 0 3px #F9D9A6, 0 8px 18px rgba(86, 51, 6, 0.07);
}

#allergyEntry[data-category="Intolerance"] :is(input, select, textarea):focus {
  outline: 0;
  border-color: #C8791E;
  background: #FFFFFF;
  box-shadow: 0 0 0 3px #F9D9A6;
}

#allergyEntry[data-category="Intolerance"] .date-picker-field:focus-within > input[type="text"],
#allergyEntry[data-category="Intolerance"] .month-year-field:focus-within > input[type="text"] {
  border-color: #C8791E;
  box-shadow: 0 0 0 3px #F9D9A6;
}

#allergyEntry :is(input, select, textarea):focus-visible {
  outline: 0;
}

#addAllergy:focus-visible,
#addIntolerance:focus-visible,
#saveAllergy:focus-visible,
#addPrescribedDiet:focus-visible,
#saveNutritionSupport:focus-visible,
#cancelNutritionSupport:focus-visible,
#clearPss:focus-visible {
  outline: 0;
}

#medicationEntry .med-row-1 {
  grid-row: 1;
}

#medicationEntry .med-type-field {
  grid-column: 1;
}

#medicationEntry .med-name-field {
  grid-column: 2 / span 2;
}

#medicationEntry .med-source-field {
  grid-column: 4;
}

#medicationEntry[data-category="Supplement"] .med-name-field {
  grid-column: 1 / span 2;
}

#medicationEntry[data-category="Supplement"] .med-type-field {
  grid-column: 3;
}

#medicationEntry .med-row-2 {
  grid-row: 2;
}

#medicationEntry .med-row-3 {
  grid-row: 3;
}

#medicationEntry .med-notes-field {
  grid-column: 1 / span 3;
  grid-row: 4;
}

#medicationEntry .med-action-button {
  grid-row: 4;
}

#saveMedication {
  grid-column: 4;
  font-weight: 700 !important;
}

.nutrition-support-entry {
  grid-template-columns: repeat(4, minmax(105px, 1fr));
  transition: border-color 140ms ease, box-shadow 140ms ease, padding 140ms ease;
}

.diet-order-box .nutrition-support-entry {
  padding: 12px;
  border: 1px solid #78A97D;
  border-radius: 8px;
  background: #FFFFFF;
  box-shadow: 0 5px 14px rgba(37, 77, 42, 0.06);
}

.diet-order-box .nutrition-support-entry[hidden] {
  display: none;
}

.diet-order-box .nutrition-support-entry.editor-open {
  padding: 12px;
  border: 1px solid #78A97D;
  border-radius: 7px;
  background: #FFFFFF;
  box-shadow: 0 0 0 3px #E8F4E9, 0 8px 18px rgba(37, 77, 42, 0.1);
}

.nutrition-support-note-field {
  grid-column: 1 / span 3;
}

.support-action-field {
  grid-column: 4;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-self: end;
  gap: 8px;
}

.support-action-field button {
  width: 100%;
  font-size: var(--type-action-button);
  line-height: 1.2;
}

.month-year-field,
.date-picker-field {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 32px;
  min-width: 0;
}

.month-year-field > input[type="text"],
.date-picker-field > input[type="text"] {
  grid-column: 1 / -1;
  grid-row: 1;
  padding-right: 38px;
}

.month-picker-button,
.calendar-picker-button {
  position: absolute;
  top: 1px;
  right: 1px;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 31px;
  min-width: 31px;
  height: calc(100% - 2px);
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0 5px 5px 0;
  color: #1E4D4A;
  background: transparent;
  font-size: 0;
  line-height: 1;
  transform: none;
}

.month-picker-button::before,
.calendar-picker-button::before {
  content: "";
  width: 14px;
  height: 14px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M7 2h2v3h6V2h2v3h3a2 2 0 0 1 2 2v13a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V7a2 2 0 0 1 2-2h3V2Zm13 9H4v9h16v-9ZM4 9h16V7H4v2Z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M7 2h2v3h6V2h2v3h3a2 2 0 0 1 2 2v13a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V7a2 2 0 0 1 2-2h3V2Zm13 9H4v9h16v-9ZM4 9h16V7H4v2Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.month-picker-button:hover,
.month-picker-button:focus-visible,
.calendar-picker-button:hover,
.calendar-picker-button:focus-visible,
.calendar-picker-button:active {
  color: #1E4D4A;
  background: #EDF6F4;
  outline: 0;
}

#medicationEntry[data-category="Medication"] .month-picker-button:hover,
#medicationEntry[data-category="Medication"] .month-picker-button:focus-visible,
#medicationEntry[data-category="Medication"] .month-picker-button:active {
  color: #40538e;
  background: #E8ECFA;
}

#medicationEntry[data-category="Supplement"] .month-picker-button:hover,
#medicationEntry[data-category="Supplement"] .month-picker-button:focus-visible,
#medicationEntry[data-category="Supplement"] .month-picker-button:active {
  color: #40538E;
  background: #E8ECFA;
}

#prescribedDietEntry .calendar-picker-button:hover,
#prescribedDietEntry .calendar-picker-button:focus-visible,
#prescribedDietEntry .calendar-picker-button:active,
#nutritionSupportEntry .calendar-picker-button:hover,
#nutritionSupportEntry .calendar-picker-button:focus-visible,
#nutritionSupportEntry .calendar-picker-button:active,
.diet-order-box .calendar-picker-button:hover,
.diet-order-box .calendar-picker-button:focus-visible,
.diet-order-box .calendar-picker-button:active {
  color: #254D2A;
  background: #E8F4E9;
}

#allergyEntry .month-picker-button:hover,
#allergyEntry .month-picker-button:focus-visible,
#allergyEntry .month-picker-button:active,
#allergyEntry .calendar-picker-button:hover,
#allergyEntry .calendar-picker-button:focus-visible,
#allergyEntry .calendar-picker-button:active {
  color: #583900;
  background: #F9D9A6;
}

.native-month-picker,
.native-date-picker {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.calculation-output {
  display: grid;
  align-items: center;
  min-height: 33px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 6px 8px;
  color: var(--accent-dark);
  background: #EDF6F4;
  font-size: var(--type-field-label);
  font-weight: 650;
}

.diet-order-box .calculation-output {
  color: #254D2A;
  border-color: #78A97D;
  background: #E8F4E9;
}

#nutritionSupportTotal {
  color: #1E4D4A;
  border-color: #C9DDD8;
  background: #EDF6F4;
}

.typeahead-field {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
}

.typeahead-field input {
  grid-column: 1 / -1;
  padding-right: 38px;
}

.typeahead-toggle {
  position: absolute;
  right: 1px;
  top: 1px;
  display: grid;
  place-items: center;
  width: 32px;
  height: calc(100% - 2px);
  border: 0;
  border-radius: 0 5px 5px 0;
  color: var(--accent-dark);
  background: transparent;
  font-size: 0;
  line-height: 1;
}

.typeahead-toggle:hover,
.typeahead-toggle:focus-visible,
.typeahead-toggle:active {
  background: transparent;
  outline: 0;
  box-shadow: none;
}

.typeahead-toggle::before {
  content: "";
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid #1E2928;
}

.typeahead-options {
  position: absolute;
  top: calc(100% + 3px);
  left: 0;
  right: 0;
  z-index: 20;
  display: grid;
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid #C9DDD8;
  border-radius: 6px;
  background: #FFFFFF;
  box-shadow: 0 12px 30px rgba(30, 77, 74, 0.18);
}

.typeahead-options[hidden] {
  display: none;
}

.typeahead-options button {
  border: 0;
  border-bottom: 1px solid #EDF6F4;
  padding: 8px 10px;
  color: var(--ink);
  background: #FFFFFF;
  font-size: var(--type-field-label);
  text-align: left;
}

.typeahead-options button:hover,
.typeahead-options button:focus {
  background: var(--accent-soft);
}

.clinical-entry[hidden] {
  display: none;
}

.wide-field,
#childGrowthFields .wide-field {
  grid-column: span 2;
}

#childGrowthFields .wide-field {
  grid-column: 1 / -1;
}

.mini-remove-button {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 1px solid #C9DDD8;
  border-radius: 999px;
  color: var(--muted);
  background: #FFFFFF;
  font-size: var(--type-helper-label);
  line-height: 1;
  padding: 0;
  text-align: center;
}

.mini-remove-button.table-delete-button {
  width: auto;
  min-width: 52px;
  height: 26px;
  border-radius: 5px;
  padding: 3px 8px;
  color: #580404;
  border-color: #BD5947;
  background: #FCE9E4;
  font-size: var(--type-toolbar-button);
  font-weight: 700;
}

.submission-action {
  font-weight: 700 !important;
}

.submission-action:disabled,
.submission-action:disabled:hover,
.submission-action:disabled:focus-visible {
  cursor: default !important;
  color: #637270 !important;
  border-color: #C9DDD8 !important;
  background: #EDF6F4 !important;
  outline: 0 !important;
  box-shadow: none !important;
  opacity: 1;
}

.submission-action.submission-ready {
  cursor: pointer;
}

/* Keep incomplete actions in their clinical color family without implying they are clickable. */
.barrier-field .submission-action:disabled,
.barrier-field .submission-action:disabled:hover,
.barrier-field .submission-action:disabled:focus-visible {
  color: #580404 !important;
  border-color: #BD5947 !important;
  background: #fce9e4 !important;
}

.note-section[data-section="behavior"] .submission-action:disabled,
.note-section[data-section="behavior"] .submission-action:disabled:hover,
.note-section[data-section="behavior"] .submission-action:disabled:focus-visible {
  color: #563B62 !important;
  border-color: #865797 !important;
  background: #F3EBF6 !important;
}

#medicationEntry[data-category="Medication"] #saveMedication:disabled,
#medicationEntry[data-category="Medication"] #saveMedication:disabled:hover,
#medicationEntry[data-category="Medication"] #saveMedication:disabled:focus-visible,
.physical-health-section #saveActivity:disabled,
.physical-health-section #saveActivity:disabled:hover,
.physical-health-section #saveActivity:disabled:focus-visible {
  color: #40538E !important;
  border-color: #6E83C7 !important;
  background: #e8ecfa !important;
}

#medicationEntry[data-category="Supplement"] #saveMedication:disabled,
#medicationEntry[data-category="Supplement"] #saveMedication:disabled:hover,
#medicationEntry[data-category="Supplement"] #saveMedication:disabled:focus-visible {
  color: #40538E !important;
  border-color: #6E83C7 !important;
  background: #E8ECFA !important;
}

#addPrescribedDiet:disabled,
#addPrescribedDiet:disabled:hover,
#saveNutritionSupport:disabled,
#saveNutritionSupport:disabled:hover,
#addPesStatement:disabled,
#addPesStatement:disabled:hover {
  color: #637270 !important;
  border-color: #C9DDD8 !important;
  background: #edf6f4 !important;
}

.barrier-field .submission-action.submission-ready {
  color: #580404;
  border-color: #bd5947;
  background: #FCE9E4;
  outline: 0;
  box-shadow: none;
}

.barrier-field .submission-action.submission-ready:hover,
.barrier-field .submission-action.submission-ready:focus-visible {
  color: #FFFFFF;
  border-color: #BD5947;
  background: #F29B87;
  outline: 0;
  box-shadow: none;
}

.note-section[data-section="behavior"] .submission-action.submission-ready {
  color: #563B62;
  border-color: #865797;
  background: #F3EBF6;
  outline: 0;
  box-shadow: none;
}

.note-section[data-section="behavior"] .submission-action.submission-ready:hover,
.note-section[data-section="behavior"] .submission-action.submission-ready:focus-visible {
  color: #FFFFFF;
  border-color: #865797;
  background: #B280C2;
  outline: 0;
  box-shadow: none;
}

#medicationEntry[data-category="Medication"] #saveMedication.submission-ready {
  color: #40538E;
  border-color: #6E83C7;
  background: #E8ECFA;
  outline: 0;
  box-shadow: none;
}

#medicationEntry[data-category="Medication"] #saveMedication.submission-ready:hover,
#medicationEntry[data-category="Medication"] #saveMedication.submission-ready:focus-visible {
  color: #FFFFFF;
  border-color: #6E83C7;
  background: #A8B8EA;
  outline: 0;
  box-shadow: none;
}

#medicationEntry[data-category="Supplement"] #saveMedication.submission-ready {
  color: #40538E;
  border-color: #6E83C7;
  background: #E8ECFA;
  outline: 0;
  box-shadow: none;
}

#medicationEntry[data-category="Supplement"] #saveMedication.submission-ready:hover,
#medicationEntry[data-category="Supplement"] #saveMedication.submission-ready:focus-visible {
  color: #FFFFFF;
  border-color: #6E83C7;
  background: #A8B8EA;
  outline: 0;
  box-shadow: none;
}

#saveAllergy.submission-ready {
  color: #583900;
  border-color: #C8791E;
  background: #F9D9A6;
  outline: 0;
  box-shadow: none;
}

#saveAllergy.submission-ready:hover,
#saveAllergy.submission-ready:focus-visible {
  color: #FFFFFF;
  border-color: #C8791E;
  background: #F2AC4C;
  outline: 0;
  box-shadow: none;
}

#allergyEntry[data-category="Intolerance"] #saveAllergy.submission-ready {
  color: #583900;
  border-color: #C8791E;
  background: #F9D9A6;
}

#allergyEntry[data-category="Intolerance"] #saveAllergy.submission-ready:hover,
#allergyEntry[data-category="Intolerance"] #saveAllergy.submission-ready:focus-visible {
  color: #FFFFFF;
  border-color: #C8791E;
  background: #F2AC4C;
  box-shadow: none;
}

.physical-health-section #saveActivity.submission-ready {
  color: #40538E;
  border-color: #6E83C7;
  background: #E8ECFA;
  outline: 0;
  box-shadow: none;
}

.physical-health-section #saveActivity.submission-ready:hover,
.physical-health-section #saveActivity.submission-ready:focus-visible {
  color: #FFFFFF;
  border-color: #6E83C7;
  background: #A8B8EA;
  outline: 0;
  box-shadow: none;
}

#addPesStatement.submission-ready {
  color: #FFFFFF;
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: none;
}

#savePrescribedDiet,
#saveNutritionSupport {
  font-weight: 600 !important;
}

#savePrescribedDiet {
  color: #254D2A;
  border-color: #78A97D;
  background: #E8F4E9;
  font-weight: 600;
  box-shadow: none;
}

#saveNutritionSupport {
  color: #254D2A;
  border-color: #78A97D;
  background: #E8F4E9;
  font-weight: 600;
  box-shadow: none;
}

#savePrescribedDiet.submission-ready {
  color: #254D2A;
  border-color: #78A97D;
  background: #E8F4E9;
}

#saveNutritionSupport.submission-ready {
  color: #254D2A;
  border-color: #78A97D;
  background: #E8F4E9;
}

#savePrescribedDiet.submission-ready:hover,
#savePrescribedDiet.submission-ready:focus-visible {
  color: #FFFFFF;
  border-color: #78A97D;
  background: #A9CFAE;
  box-shadow: none;
}

#saveNutritionSupport.submission-ready:hover,
#saveNutritionSupport.submission-ready:focus-visible {
  color: #FFFFFF;
  border-color: #78A97D;
  background: #A9CFAE;
  box-shadow: none;
}

#savePrescribedDiet:disabled,
#savePrescribedDiet:disabled:hover {
  color: #254D2A !important;
  border-color: #78A97D !important;
  background: #E8F4E9 !important;
  cursor: default !important;
}

#saveNutritionSupport:disabled,
#saveNutritionSupport:disabled:hover {
  color: #254D2A !important;
  border-color: #78A97D !important;
  background: #E8F4E9 !important;
  cursor: default !important;
}

#saveAllergy,
#saveAllergy.submission-ready {
  color: #583900;
  border-color: #C8791E;
  background: #F9D9A6;
  font-size: var(--type-action-button);
  font-weight: 700 !important;
  box-shadow: none;
}

#saveAllergy.submission-ready:hover,
#saveAllergy.submission-ready:focus-visible {
  color: #FFFFFF;
  border-color: #C8791E;
  background: #F2AC4C;
  box-shadow: none;
}

#saveAllergy:disabled,
#saveAllergy:disabled:hover,
#saveAllergy:disabled:focus-visible {
  color: #583900 !important;
  border-color: #C8791E !important;
  background: #F9D9A6 !important;
  cursor: default !important;
}

#allergyEntry[data-category="Intolerance"] #saveAllergy:disabled,
#allergyEntry[data-category="Intolerance"] #saveAllergy:disabled:hover,
#allergyEntry[data-category="Intolerance"] #saveAllergy:disabled:focus-visible {
  color: #583900 !important;
  border-color: #C8791E !important;
  background: #F9D9A6 !important;
}

#medicationEntry[data-category="Medication"] .typeahead-options button:hover,
#medicationEntry[data-category="Medication"] .typeahead-options button:focus {
  color: #40538E;
  background: #E8ECFA;
}

#medicationEntry[data-category="Supplement"] .typeahead-options button:hover,
#medicationEntry[data-category="Supplement"] .typeahead-options button:focus {
  color: #40538E;
  background: #E8ECFA;
}

.history-details {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  background: #FFFFFF;
}

.history-details summary {
  color: var(--accent-dark);
  font-size: var(--type-field-label);
  font-weight: 650;
  cursor: pointer;
}

.history-details[open] {
  display: grid;
  gap: 10px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(30, 41, 40, 0.28);
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-card {
  display: grid;
  gap: 10px;
  width: min(460px, 96vw);
  padding: 16px;
  border: 1px solid #C9DDD8;
  border-radius: 8px;
  background: #FFFFFF;
  box-shadow: 0 20px 50px rgba(30, 77, 74, 0.24);
}

.modal-card h3 {
  margin: 0;
  color: var(--accent-dark);
  font-size: var(--type-subsection-header);
  font-weight: 700;
}

.modal-close-button {
  position: absolute;
  top: 14px;
  right: 16px;
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  color: #1E2928;
  border: 0;
  border-radius: 50%;
  background: transparent;
  font-size: 1.25rem;
  line-height: 1;
}

.modal-helper-text {
  margin: 0;
  color: #1E2928;
  font-size: var(--type-input);
  font-weight: 400;
  line-height: var(--leading-helper);
}

.measurement-import-card {
  position: relative;
  width: min(860px, 96vw);
  gap: 14px;
  padding: 22px;
  border-color: #C9DDD8;
}

.measurement-import-controls {
  display: grid;
  grid-template-columns: minmax(180px, 240px) minmax(0, 1fr);
  gap: 16px;
  align-items: end;
}

.measurement-import-summary {
  justify-self: end;
  color: #1E4D4A;
  font-size: var(--type-field-label);
  font-weight: 600;
}

.measurement-import-table-wrap {
  max-height: min(360px, 52vh);
  overflow: auto;
  border: 1px solid #C9DDD8;
  border-radius: 6px;
  background: #FFFFFF;
}

.measurement-import-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--type-input);
}

.measurement-import-table th,
.measurement-import-table td {
  padding: 9px 10px;
  border-bottom: 1px solid #C9DDD8;
  text-align: left;
}

.measurement-import-table th {
  color: #1E2928;
  background: #F7FBFA;
  font-size: var(--type-field-label);
  font-weight: 650;
}

.measurement-import-table tr:last-child td {
  border-bottom: 0;
}

.measurement-import-actions {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr) max-content max-content;
  gap: 12px;
  align-items: center;
}

.measurement-secondary-button,
.measurement-confirm-button {
  display: inline-grid;
  place-items: center;
  min-height: 34px;
  padding: 6px 18px;
  border-radius: 4px;
  font-size: var(--type-utility-button);
  font-weight: 600;
  line-height: 1;
}

.measurement-secondary-button {
  color: #1E4D4A;
  border: 1px solid #8BB7AB;
  background: #FFFFFF;
}

.measurement-confirm-button {
  color: #583900;
  border: 1px solid #CEA00C;
  background: #F6DC88;
}

.measurement-confirm-button:hover,
.measurement-confirm-button:focus-visible {
  color: #FFFFFF;
  background: #F1BE15;
}

.field-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.clinical-grid.four,
.field-grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.anthro-assessment-grid .wide-field {
  grid-column: 1 / -1;
}

.progress-grid {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.compact-select-label {
  grid-template-columns: 1fr;
  align-items: start;
}

.compact-select-label select {
  width: 100%;
  min-width: 0;
}

.progress-grid .custom-tag-entry {
  width: 100%;
}

.barrier-field {
  --button-active-rim: #FCE9E4;
  min-width: 0;
}

.subsection-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 6px;
  padding: 8px 8px;
  border-left: 3px solid var(--accent);
  border-bottom: 0;
  color: var(--accent-dark);
  background: #EDF6F4;
  font-size: var(--type-subsection-header);
  font-weight: 700;
}

.subsection-minimize-checkbox {
  appearance: none;
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 0 15px;
  width: 15px;
  height: 15px;
  margin: 0;
  border: 1px solid #3F7D79;
  border-radius: 2px;
  background: #FFFFFF;
  cursor: pointer;
}

.subsection-minimize-checkbox:checked {
  background: #3F7D79;
}

.subsection-minimize-checkbox:checked::after {
  content: "\2713";
  color: #FFFFFF;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.subsection-minimize-checkbox:hover {
  border-color: #3F7D79;
  background: #FFFFFF;
}

.subsection-minimize-checkbox:checked:hover {
  background: #3F7D79;
}

.subsection-label.inline-subsection-collapsed {
  opacity: 0.92;
}

.inline-subsection-hidden {
  display: none !important;
}

.minor-heading {
  grid-column: 1 / -1;
  margin: var(--space-m) 0 var(--space-s);
  color: #1E2928;
  font-size: var(--type-field-label);
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: var(--tracking-field-label);
}

.readiness-field {
  gap: 0;
  display: grid;
  margin: var(--space-m) auto var(--space-l);
  width: min(560px, 100%);
  max-width: 560px;
  justify-self: center;
  outline: 0;
  box-shadow: none;
}

.readiness-field[hidden] {
  display: none;
}

.scale-field {
  grid-column: 1 / -1;
}

.developer-archive {
  display: none !important;
}

.readiness-header {
  display: flex;
  align-items: baseline;
  gap: 20px;
  flex-wrap: wrap;
  margin: 0 0 8px;
}

.readiness-field strong {
  color: #1E2928;
  font-size: var(--type-subsection-header);
  min-width: 46px;
}

.readiness-field em {
  color: var(--muted);
  font-style: italic;
  font-weight: 650;
}

.readiness-ticks {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: var(--type-toolbar-button);
  font-weight: 650;
  padding: 0;
  line-height: 1;
  margin-top: 2px;
}

.readiness-ticks span {
  position: relative;
  text-align: center;
}

.readiness-ticks span {
  width: 1.2em;
  text-align: center;
}

.activity-builder,
.substance-builder {
  position: relative;
  display: grid;
  gap: var(--space-s);
}

.urgency-field {
  position: relative;
}

.urgency-panel {
  position: relative;
  display: grid;
  gap: 8px;
}

.activity-add-button {
  width: 100%;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #1E2928;
  background: var(--soft);
  font-size: var(--type-action-button);
  font-weight: 700;
}

.activity-add-button.selected {
  color: var(--accent-dark);
  border-color: #C9DDD8;
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 2px var(--accent, #1E4D4A);
}

.activity-entry,
.substance-entry {
  position: relative;
  top: auto;
  left: auto;
  right: auto;
  z-index: 8;
  box-sizing: border-box;
  display: grid;
  grid-template-columns: minmax(190px, 1.2fr) minmax(150px, 0.85fr) 88px 56px minmax(145px, 0.75fr) 78px 78px;
  gap: 10px 18px;
  align-items: end;
  overflow: visible;
  max-width: 100%;
  width: 100%;
  margin-top: 0;
  padding: 12px;
  border: 1px solid #C9DDD8;
  border-radius: 8px;
  background: #FFFFFF;
  box-shadow: 0 12px 30px rgba(30, 77, 74, 0.18);
}

.activity-entry {
  display: grid;
  grid-template-columns: minmax(220px, 2fr) 74px 118px 86px 112px minmax(160px, 1.2fr) 78px;
  gap: 10px 12px;
  align-items: end;
}

.activity-entry label {
  min-width: 0;
}

.activity-entry .small-button {
  width: 78px;
  min-width: 78px;
}

.activity-entry :is(input, select, button),
.substance-entry :is(input, select, button) {
  min-height: 36px;
  height: 36px;
}

.activity-entry .small-button,
.substance-entry .small-button {
  align-self: end;
}

.physical-health-section .minor-heading {
  margin: var(--space-m) 0 var(--space-s);
}

.physical-health-section .field-grid > label {
  margin: var(--space-m) 0 var(--space-s);
}

.physical-health-section .field-grid.three > .other-detail-field {
  margin-top: 0;
}

#sleepPatternOtherField,
#oralHygieneRoutineOtherField,
#bowelPatternOtherField {
  grid-column: 3;
}

#dentitionStatusOtherField {
  grid-column: 1;
}

#masticationSwallowingOtherField,
#upperGiSymptomsOtherField {
  grid-column: 2;
}

.other-detail-field[hidden] {
  display: none !important;
}

.food-weight-loss-popover {
  position: relative;
  left: 0;
  right: 0;
  bottom: auto;
  z-index: 2;
  display: grid;
  grid-template-columns: 110px 100px minmax(145px, 1fr) 70px;
  gap: 10px 12px;
  align-items: end;
  width: 100%;
  margin-top: 8px;
  padding: 12px;
  border: 1px solid #BD5947;
  border-radius: 8px;
  background: #FFFFFF;
  box-shadow: 0 0 0 3px #FCE9E4, 0 12px 30px rgba(189, 89, 71, 0.14);
}

.food-weight-loss-popover[hidden] {
  display: none;
}

.food-weight-loss-popover input,
.food-weight-loss-popover select {
  min-height: 30px;
  border: 1px solid #C9DDD8;
  border-radius: 4px;
  padding: 5px 8px;
}

.food-weight-loss-popover input:focus,
.food-weight-loss-popover input:focus-visible,
.food-weight-loss-popover select:focus,
.food-weight-loss-popover select:focus-visible {
  outline: 0;
  border-color: #BD5947;
  box-shadow: 0 0 0 3px #FCE9E4;
}

.food-weight-loss-popover .small-button {
  align-self: end;
  min-height: 34px;
  color: #580404;
  border-color: #BD5947;
  background: #FCE9E4;
  font-weight: 700;
}

.food-weight-loss-popover .small-button:hover,
.food-weight-loss-popover .small-button:focus-visible {
  color: #FFFFFF;
  border-color: #BD5947;
  background: #F29B87;
  outline: 0;
  box-shadow: none;
}

.food-weight-loss-popover label {
  font-size: var(--type-field-label);
}

.substance-entry {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
}

.substance-select-field {
  flex: 1 1 150px;
  max-width: 220px;
}

.other-substance-field {
  flex: 1 1 180px;
}

.substance-entry .numeric-field {
  flex: 0 0 64px;
}

.substance-entry .unit-field,
.substance-entry .rate-field {
  flex: 1 1 180px;
  min-width: 170px;
  max-width: 240px;
}

.substance-entry[data-substance-type="frequency"] .rate-field {
  flex-basis: 190px;
  min-width: 190px;
}

.substance-entry[data-substance-type="tobacco"] .unit-field {
  flex-basis: 190px;
}

.substance-entry label {
  min-width: 0;
}

.small-number-input {
  width: 56px;
  max-width: 56px;
}

#activityDuration {
  width: 88px;
  max-width: 88px;
}

.substance-entry .small-button,
.activity-entry .small-button {
  width: 78px;
  min-width: 78px;
  font-size: var(--type-action-button);
  font-weight: 700;
}

.activity-entry[hidden],
.substance-entry[hidden],
.amount-field[hidden],
.tobacco-field[hidden],
.frequency-field[hidden],
.rate-field[hidden],
#otherSubstanceField[hidden] {
  display: none;
}

.activity-entry input,
.activity-entry select,
.substance-entry input,
.substance-entry select {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 5px 8px;
}

.activity-entry label,
.substance-entry label {
  font-size: var(--type-field-label);
}

label,
.tag-field {
  display: grid;
  gap: var(--space-s);
  min-width: 0;
  color: #1E2928;
  font-size: var(--type-field-label);
  font-weight: 650;
}

label.disabled-field {
  color: #637270;
}

label {
  color: var(--ink);
  font-size: var(--type-field-label);
  font-weight: 650;
}

label.disabled-field select,
label.disabled-field textarea,
label.disabled-field input[type="text"],
label.disabled-field input[type="date"],
label.disabled-field input[type="month"] {
  color: #637270;
  background: #EDF6F4;
  border-color: #C9DDD8;
}

select,
textarea,
input[type="text"],
input[type="date"],
input[type="month"] {
  width: 100%;
}

select,
textarea,
input[type="text"],
input[type="date"],
input[type="month"] {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 8px;
  color: var(--ink);
  background: #FFFFFF;
  font-size: var(--type-input);
  font-weight: 550;
  letter-spacing: var(--tracking-body);
}

textarea {
  min-height: 38px;
  resize: vertical;
  line-height: var(--leading-body);
}

input::placeholder,
textarea::placeholder {
  color: #637270;
  font-size: var(--type-placeholder);
  font-style: italic;
  font-weight: 450;
  line-height: var(--leading-placeholder);
  letter-spacing: var(--tracking-placeholder);
  opacity: 1;
}

#monitoringFreeText::placeholder {
  line-height: var(--leading-tight);
}

select:has(option[value=""]:checked) {
  color: #637270;
  font-size: var(--type-placeholder);
  font-style: italic;
  font-weight: 450;
  line-height: var(--leading-placeholder);
  letter-spacing: var(--tracking-placeholder);
}

select option {
  color: var(--ink);
  font-style: normal;
}

select option:checked {
  color: var(--ink);
  background: #FFFFFF linear-gradient(#FFFFFF, #FFFFFF);
}

select:hover,
textarea:hover,
input[type="text"]:hover,
input[type="date"]:hover,
input[type="month"]:hover {
  border-color: var(--line);
  background: #FFFFFF;
}

select:focus,
textarea:focus,
input[type="text"]:focus,
input[type="date"]:focus,
input[type="month"]:focus,
button:focus-visible {
  outline: 3px solid #EDF6F4;
  outline-offset: 1px;
}

select:focus,
textarea:focus,
input[type="text"]:focus,
input[type="date"]:focus,
input[type="month"]:focus {
  border-color: var(--teal-muted);
  background: #FFFFFF;
  box-shadow: 0 0 0 3px #EDF6F4;
}

.note-section[data-section="monitoringPlan"] textarea {
  min-height: 112px;
  background: #FFFFFF;
}

.custom-select-menu {
  position: fixed;
  z-index: 80;
  max-height: min(320px, calc(100vh - 24px));
  overflow-y: auto;
  overflow-x: hidden;
  border: 1px solid #637270;
  background: #FFFFFF;
  box-shadow: 0 8px 18px rgba(30, 77, 74, 0.18);
}

.custom-select-menu.theme-allergy,
.custom-select-menu.theme-intolerance {
  border-color: #C8791E;
}

.custom-select-menu.theme-diet-order,
.custom-select-menu.theme-supplement {
  border-color: #78A97D;
}

.custom-select-menu.theme-food-access {
  border-color: #8BB7AB;
}

.custom-select-menu.theme-medical-history {
  border-color: #8BB7AB;
}

.custom-select-menu.theme-medication {
  border-color: #6E83C7;
}

.custom-select-menu.theme-psychosocial {
  border-color: #865797;
}

.custom-select-menu.theme-physical-health {
  border-color: #6E83C7;
}

.custom-select-option {
  display: block;
  width: 100%;
  min-height: 30px;
  border: 0;
  border-bottom: 1px solid #EDF6F4;
  padding: 7px 12px;
  color: var(--ink);
  background: #FFFFFF;
  font: inherit;
  font-size: var(--type-input);
  font-weight: 550;
  line-height: var(--leading-body);
  white-space: normal;
  overflow-wrap: normal;
  word-break: normal;
  text-align: left;
}

.custom-select-option:last-child {
  border-bottom: 0;
}

.searchable-select-menu {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-color: #C9DDD8;
}

.custom-select-search-wrap {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 8px;
  border-bottom: 1px solid #c9ddd8;
  background: #edf6f4;
}

.custom-select-search {
  width: 100%;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid #C9DDD8;
  border-radius: 4px;
  color: var(--ink);
  background: #FFFFFF;
  font: inherit;
  font-size: var(--type-input);
  font-weight: 450;
}

.custom-select-search::placeholder {
  color: #637270;
  font-size: var(--type-placeholder);
  font-style: italic;
  font-weight: 450;
}

.custom-select-results {
  min-height: 0;
  overflow-y: auto;
}

.custom-select-domain-heading {
  padding: 8px 10px 6px;
  border-top: 1px solid #3F7D79;
  border-bottom: 1px solid #3F7D79;
  color: #FFFFFF;
  background: #3F7D79;
  font-size: var(--type-helper-label);
  font-weight: 700;
  text-transform: uppercase;
}

.custom-select-domain-heading:first-child {
  border-top: 0;
}

.custom-select-category-heading {
  padding: 7px 11px;
  border-bottom: 1px solid #C9DDD8;
  color: #1E4D4A;
  background: var(--accent-soft);
  font-size: var(--type-field-label);
  font-weight: 700;
}

.custom-select-empty {
  padding: 18px 12px;
  color: #637270;
  text-align: center;
  font-size: var(--type-body);
  font-style: italic;
}

.custom-select-menu.theme-diagnosis .custom-select-option:hover,
.custom-select-menu.theme-diagnosis .custom-select-option:focus {
  color: #583900;
  background: #f6dc88;
}

.custom-select-menu.theme-diagnosis .custom-select-option[aria-selected="true"]:hover,
.custom-select-menu.theme-diagnosis .custom-select-option[aria-selected="true"]:focus {
  color: #583900;
}

#addPesStatement {
  --button-active-rim: #F6DC88;
  width: 100%;
  min-height: 30px;
  padding: 5px 12px;
  color: #583900;
  border-color: #CEA00C;
  border-radius: 999px;
  background: #f6dc88;
  font-size: var(--type-action-button);
  font-weight: 700;
  line-height: 1.2;
}

#addPesStatement.submission-action {
  font-weight: 700 !important;
}

#clinicalConcerns:focus,
#clinicalConcerns:focus-visible {
  outline: 0;
  border-color: #CEA00C;
  box-shadow: 0 0 0 3px #F6DC88;
}

#addPesStatement:disabled,
#addPesStatement:disabled:hover,
#addPesStatement:disabled:focus-visible {
  cursor: default !important;
  color: #583900 !important;
  border-color: #CEA00C !important;
  background: #f6dc88 !important;
  outline: 0 !important;
  box-shadow: none !important;
}

#addPesStatement.submission-ready,
#addPesStatement.submission-ready:focus-visible {
  cursor: pointer;
  color: #583900;
  border-color: #CEA00C;
  background: #f6dc88;
}

#addPesStatement.submission-ready:hover {
  color: #FFFFFF;
  border-color: #CEA00C;
  background: #f1be15;
  box-shadow: none;
}

#pesStatementList span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: #583900;
  border-style: solid;
  border-width: 2px;
  border-color: #CEA00C;
  background: #F6DC88;
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1.25;
  padding: 9px 14px;
  box-shadow: none;
}

#pesStatementList .mini-remove-button {
  display: inline-grid;
  place-items: center;
  flex: 0 0 20px;
  width: 20px;
  min-width: 20px;
  height: 20px;
  min-height: 20px;
  padding: 0;
  color: #583900;
  border-style: solid;
  border-width: 2px;
  border-color: #CEA00C;
  border-radius: 50%;
  background: #FFFFFF;
}

#rdCodeList .clinical-list-item {
  color: var(--accent-dark);
  border-color: #C9DDD8;
  background: var(--accent-soft);
}

#rdCodeList .clinical-list-item > span {
  min-height: 0;
  border: 0;
  border-radius: 0;
  padding: 0;
  color: inherit;
  background: transparent;
  font: inherit;
}

#rdCodeList .clinical-list-item > .mini-remove-button {
  flex: 0 0 auto;
  margin-left: 2px;
  color: var(--accent-dark);
  border-color: #C9DDD8;
  background: #FFFFFF;
}

#pesSpecifier:focus,
#pesSpecifyText:focus {
  border-color: #CEA00C;
  outline: 0;
  background: #FFFFFF;
  box-shadow: 0 0 0 3px #F6DC88;
}

.custom-select-option.selected:not(:hover):not(:focus) {
  color: var(--ink);
  background: #FFFFFF;
}

.custom-select-option:hover,
.custom-select-option:focus {
  color: #1E4D4A;
  background: #EDF6F4;
  outline: none;
}

.custom-select-menu.theme-allergy .custom-select-option:hover,
.custom-select-menu.theme-allergy .custom-select-option:focus {
  color: #583900;
  background: #F9D9A6;
}

.custom-select-menu.theme-intolerance .custom-select-option:hover,
.custom-select-menu.theme-intolerance .custom-select-option:focus {
  color: #583900;
  background: #F9D9A6;
}

.custom-select-menu.theme-medication .custom-select-option:hover,
.custom-select-menu.theme-medication .custom-select-option:focus {
  color: #40538E;
  background: #E8ECFA;
}

.custom-select-menu.theme-diet-order .custom-select-option:hover,
.custom-select-menu.theme-diet-order .custom-select-option:focus {
  color: #254D2A;
  background: #E8F4E9;
}

.custom-select-menu.theme-diet-order .custom-select-option[aria-selected="true"]:is(:hover, :focus) {
  color: #254D2A;
  background: #E8F4E9;
}

.custom-select-menu.theme-diet-order .custom-select-option[aria-selected="true"]:not(:hover):not(:focus) {
  color: #1E2928;
  background: #FFFFFF;
}

.custom-select-menu.theme-supplement .custom-select-option:hover,
.custom-select-menu.theme-supplement .custom-select-option:focus {
  color: #254d2a;
  background: #E8F4E9;
}

.custom-select-menu.theme-supplement .custom-select-option[aria-selected="true"] {
  color: #254D2A;
  background: #E8F4E9;
}

.custom-select-menu.theme-food-access .custom-select-option:hover,
.custom-select-menu.theme-food-access .custom-select-option:focus {
  color: #1E4D4A;
  background: #EDF6F4;
}

.custom-select-menu.theme-food-access .custom-select-option[aria-selected="true"]:is(:hover, :focus) {
  color: #1E4D4A;
  background: #EDF6F4;
}

.custom-select-menu.theme-food-access .custom-select-option[aria-selected="true"]:not(:hover):not(:focus) {
  color: #1E2928;
  background: #FFFFFF;
}

.custom-select-menu.theme-psychosocial .custom-select-option:hover,
.custom-select-menu.theme-psychosocial .custom-select-option:focus {
  color: #563b62;
  background: #F3EBF6;
}

.custom-select-menu.theme-physical-health .custom-select-option:hover,
.custom-select-menu.theme-physical-health .custom-select-option:focus {
  color: #40538E;
  background: #E8ECFA;
}

.custom-select-menu.theme-physical-health .custom-select-option[aria-selected="true"]:not(:hover):not(:focus) {
  color: #1E2928;
  background: #FFFFFF;
}

#prescribedDietEntry :is(input, select, textarea):focus,
#prescribedDietEntry :is(input, select, textarea):focus-visible,
#nutritionSupportEntry :is(input, select, textarea):focus,
#nutritionSupportEntry :is(input, select, textarea):focus-visible,
.diet-order-box :is(input, select, textarea):focus,
.diet-order-box :is(input, select, textarea):focus-visible {
  border-color: #78A97D;
  outline: 0;
  box-shadow: 0 0 0 3px #E8F4E9;
}

#medicationList:focus,
#medicationList:focus-visible {
  border-color: #6E83C7;
  outline: 0;
  box-shadow: 0 0 0 3px #E8ECFA;
}

#supplementList:focus,
#supplementList:focus-visible {
  border-color: #6E83C7;
  outline: 0;
  box-shadow: 0 0 0 3px #E8ECFA;
}

#allergyList:focus,
#allergyList:focus-visible {
  border-color: #C8791E;
  outline: 0;
  box-shadow: 0 0 0 3px #F9D9A6;
}

#prescribedDietNote:focus,
#prescribedDietNote:focus-visible {
  border-color: #78A97D !important;
  outline: 0;
  box-shadow: 0 0 0 3px #E8F4E9 !important;
}

#prescribedDietNote:hover {
  border-color: #78A97D;
  box-shadow: none;
}

.checkbox-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 650;
}

.note-section input[type="checkbox"]:not(.subsection-minimize-checkbox):not(.toggle-switch-input) {
  accent-color: var(--control-blue);
}

.prior-note-fields {
  display: none;
  gap: 14px;
}

.prior-note-fields.active {
  display: grid;
}

.tag-field {
  border: 0;
  padding: 0;
}

.tag-field legend {
  margin: 0 0 var(--space-s);
  padding: 0;
  color: #1E2928;
  font-size: var(--type-field-label);
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: var(--tracking-field-label);
}

.behavior-stress .substance-builder {
  margin-top: 0;
}

.behavior-stress #addSubstance {
  margin-top: 0;
}

.behavior-stress .tag-field:has([data-bind="substances"]) {
  margin-bottom: 0;
}

.behavior-stress .tag-field:has([data-bind="substances"]) .tag-group {
  display: none;
}

.behavior-stress .substance-entry {
  border-color: #865797;
  box-shadow: 0 0 0 3px #F3EBF6, 0 10px 22px rgba(86, 59, 98, 0.12);
}

.tag-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-group button {
  min-height: 26px;
  border: 2px solid var(--line);
  border-radius: 999px;
  padding: 4px 9px;
  color: #1E2928;
  background: var(--soft);
  font-size: var(--type-toolbar-button);
  font-weight: 700;
}

.tag-group button.selected {
  color: var(--accent-dark);
  border-color: #C9DDD8;
  background: var(--accent-soft);
}

.barrier-field .tag-group button:not(.tag-tool-button) {
  display: inline-grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 10px;
  color: #580404;
  border-color: #BD5947;
  background: #fce9e4;
  text-align: left;
}

.barrier-field .tag-group button:not(.tag-tool-button).selected {
  color: #580404;
  border-color: #bd5947;
  background: #f29b87;
  box-shadow: none;
}

.barrier-field .tag-remove-control {
  position: relative;
  display: inline-block;
  width: 17px;
  min-width: 17px;
  height: 17px;
  margin: -1px -4px -1px 0;
  border: 2px solid #bd5947;
  border-radius: 50%;
  background: #FFFFFF;
  overflow: hidden;
  color: transparent;
  font-size: 0;
  line-height: 0;
}

.barrier-field .tag-remove-control::before,
.barrier-field .tag-remove-control::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 1.5px;
  border-radius: 1px;
  background: #580404;
  content: "";
  transform-origin: center;
}

.barrier-field .tag-remove-control::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.barrier-field .tag-remove-control::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.barrier-field .tag-group button.selected:hover .tag-remove-control,
.barrier-field .tag-group button.selected:focus-visible .tag-remove-control {
  background: #FFFFFF;
}

.barrier-field .tag-group .add-tag-button {
  display: inline-grid;
  place-items: center;
  width: 26px;
  min-width: 26px;
  height: 26px;
  min-height: 26px;
  color: #580404;
  border-color: #BD5947;
  padding: 0 !important;
  background: #FCE9E4;
  line-height: 1;
  box-shadow: none;
}

.barrier-field .tag-group .add-tag-button span {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  transform: none !important;
  color: transparent;
  font-size: 0;
  line-height: 0;
}

.barrier-field .tag-group .add-tag-button span::before,
.barrier-field .tag-group .add-tag-button span::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 2px;
  border-radius: 1px;
  background: #580404;
  content: "";
  transform: translate(-50%, -50%);
}

.barrier-field .tag-group .add-tag-button span::after {
  transform: translate(-50%, -50%) rotate(90deg);
}

.barrier-field .tag-group .add-tag-button.active span::before,
.barrier-field .tag-group .add-tag-button.active span::after {
  background: #FFFFFF;
}

.barrier-field .tag-group .add-tag-button.active {
  color: #FFFFFF;
  border-color: #bd5947;
  background: #F29B87;
  box-shadow: none;
}

.barrier-field .custom-tag-entry input:focus {
  border-color: #BD5947;
  outline: 0;
  box-shadow: 0 0 0 3px #FCE9E4, 0 5px 14px rgba(189, 89, 71, 0.13);
}

.barrier-field .tag-group .manage-tags-button {
  color: #580404;
  border-color: #BD5947;
  background: #FCE9E4;
}

.barrier-field .tag-group .manage-tags-button.active {
  color: #FFFFFF;
  border-color: #bd5947;
  background: #F29B87;
  box-shadow: inset 0 0 0 2px #FCE9E4;
}

.barrier-field .tag-group .manage-tags-button span {
  transform: scaleX(-1) !important;
}

.barrier-field .custom-tag-entry .save-tag-button,
.barrier-field .custom-tag-entry .delete-tag-button {
  font-weight: 600 !important;
  color: #580404;
  border-color: #BD5947;
  background: #fce9e4;
}

.barrier-field .custom-tag-entry .save-tag-button:hover,
.barrier-field .custom-tag-entry .delete-tag-button:hover {
  color: #FFFFFF;
  border-color: #bd5947;
  background: #F29B87;
}

/* Psychosocial controls use lilac as a distinct clinical interaction family. */
.note-section[data-section="behavior"] {
  --button-active-rim: #F3EBF6;
}

.note-section[data-section="behavior"] .section-body button:not(.section-toggle) {
  color: #563B62;
  border-color: #865797;
  background: #f3ebf6;
}

.note-section[data-section="behavior"] .section-body button:not(.section-toggle):hover,
.note-section[data-section="behavior"] .section-body button:not(.section-toggle):focus-visible {
  border-color: #865797;
  background: #F3EBF6;
  box-shadow: none;
}

.note-section[data-section="behavior"] .tag-group button.selected,
.note-section[data-section="behavior"] .tag-group .tag-tool-button.active {
  color: #FFFFFF;
  border-color: #865797;
  background: #B280C2;
  box-shadow: inset 0 0 0 2px #F3EBF6;
}

.note-section[data-section="behavior"] .activity-add-button.selected {
  color: #FFFFFF;
  border-color: #865797;
  background: #B280C2;
  box-shadow: inset 0 0 0 2px #F3EBF6;
}

.note-section[data-section="behavior"] .tag-group .tag-tool-button {
  color: #563B62;
  border-color: #865797;
  background: #F3EBF6;
}

.note-section[data-section="behavior"] .tag-group .manage-tags-button span {
  transform: scaleX(-1) !important;
}

.note-section[data-section="behavior"] .tag-group.managing-tags button:not(.tag-tool-button) {
  border-width: 1px;
  border-color: #865797;
  background: #F3EBF6;
  box-shadow: none;
}

.note-section[data-section="behavior"] :is(input:not([type="range"]), select, textarea):focus {
  border-color: #865797;
  outline: 0;
  box-shadow: 0 0 0 3px #F3EBF6;
}

.note-section[data-section="behavior"] .pss-card,
.note-section[data-section="behavior"] .pss-column {
  border-color: #865797;
}

.note-section[data-section="behavior"] .pss-score.active {
  color: #563b62;
  border-color: #865797;
  background: #F3EBF6;
}

.tag-group .tag-tool-button {
  display: inline-grid;
  place-items: center;
  width: 26px;
  min-width: 26px;
  height: 26px;
  min-height: 26px;
  padding: 0;
  color: #FFFFFF;
  border-color: var(--accent);
  background: var(--accent);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1;
}

.tag-group .tag-tool-button span {
  display: grid;
  place-items: center;
  min-width: 0;
  width: 100%;
  height: 100%;
  transform: none;
}

.tag-group .manage-tags-button {
  color: var(--accent-dark);
  border-color: #C9DDD8;
  background: #FFFFFF;
  font-size: var(--type-toolbar-button);
}

.tag-group .manage-tags-button.active {
  color: #FFFFFF;
  border-color: var(--accent-dark);
  background: var(--accent-dark);
}

.tag-group.managing-tags button:not(.tag-tool-button) {
  border-width: 2px;
  border-style: dashed;
}

.barrier-field .tag-group.managing-tags button:not(.tag-tool-button) {
  border-color: #bd5947;
  background: #FCE9E4;
  box-shadow: none;
}

.tag-group.managing-tags button.protected-tag {
  cursor: not-allowed;
}

.custom-tag-entry {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) auto auto;
  gap: 6px;
  align-items: end;
  max-width: 620px;
  margin-top: 8px;
}

.custom-tag-entry[hidden] {
  display: none;
}

.custom-tag-entry input {
  height: 30px;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 4px 8px;
  font-size: var(--type-field-label);
  line-height: 1.25;
}

.custom-tag-entry .save-tag-button,
.custom-tag-entry .delete-tag-button {
  box-sizing: border-box;
  height: 30px;
  min-height: 30px;
  align-self: center;
  display: inline-grid;
  place-items: center;
  margin: 0;
  padding-top: 0;
  padding-bottom: 0;
  line-height: 1;
}

.pss-card {
  grid-column: 1 / -1;
  display: grid;
  border: 1px solid #C9DDD8;
  border-radius: 4px;
  background: #FFFFFF;
  box-shadow: 0 2px 5px rgba(30, 77, 74, 0.08);
}

.pss-card[hidden] {
  display: none;
}

.pss-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px 12px;
  width: 100%;
  padding: 10px;
  color: var(--ink);
  text-align: left;
  background: transparent;
}

.pss-header > div > span {
  display: block;
  font-size: var(--type-body);
  font-weight: 700;
}

.permission-note {
  display: block;
  margin-top: 3px;
  color: #583900;
  font-size: var(--type-helper-label);
  font-style: italic;
  font-weight: 650;
}

.pss-header strong {
  color: var(--accent-dark);
  font-size: var(--type-subsection-header);
  white-space: nowrap;
}

.pss-toggle-label {
  min-width: 58px;
  border: 1px solid #C9DDD8;
  border-radius: 4px;
  padding: 4px 8px;
  color: var(--accent-dark);
  text-align: center;
  background: #FFFFFF;
  font-size: var(--type-toolbar-button);
  font-weight: 700;
  cursor: pointer;
}

.pss-score {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  grid-column: 1 / -1;
  grid-row: 2;
  min-width: 0;
  max-width: 100%;
  white-space: nowrap;
  justify-self: stretch;
  justify-content: center;
  padding: 5px 12px;
  border: 1px solid #C9DDD8;
  border-radius: 999px;
  background: #FFFFFF;
  cursor: pointer;
  transition:
    background-color 140ms ease,
    border-color 140ms ease,
    box-shadow 140ms ease;
}

.pss-score span {
  display: inline;
}

.pss-score:hover,
.pss-score:focus-visible {
  border-color: #C9DDD8;
  box-shadow: inset 0 0 0 2px #EDF6F4;
}

.pss-score.active,
.pss-score:not(.incomplete) {
  color: #FFFFFF;
  border-color: #1E4D4A;
  background: #1E4D4A;
  box-shadow: inset 0 0 0 2px #EDF6F4;
}

.pss-score.active span,
.pss-score:not(.incomplete) span {
  color: #FFFFFF;
}

#pssLevel {
  color: var(--muted);
  font-style: italic;
}

#pssToggle,
#foodSecurityToggle {
  display: none;
}

.pss-score.incomplete {
  color: var(--muted);
  font-weight: 700;
}

.pss-card.collapsed .chevron {
  transform: rotate(-90deg);
}

.pss-body {
  max-height: none;
  overflow: hidden;
  padding: 0 10px 10px;
  border-top: 1px solid var(--line);
  opacity: 1;
  transform-origin: top;
  transition:
    max-height 170ms ease,
    padding 170ms ease,
    border-color 170ms ease,
    opacity 120ms ease;
}

.pss-card.collapsed .pss-body {
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  border-top-color: transparent;
  opacity: 0;
  pointer-events: none;
}

.pss-instruction {
  margin: 9px 0;
}

.pss-instruction p {
  margin: 0;
  color: var(--ink);
  font-size: var(--type-preview-subsection);
  font-weight: 700;
}

.pss-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.food-security-grid {
  display: grid;
  gap: 12px;
}

.food-security-grid label {
  gap: 7px;
}

.pss-column {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 10px;
  border: 1px solid #C9DDD8;
  border-radius: 4px;
  background: #FFFFFF;
  box-shadow: 0 1px 4px rgba(30, 77, 74, 0.08);
}

.pss-column-header {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 52px;
  gap: 8px;
  align-items: end;
  margin-bottom: 2px;
}

.pss-column-header p,
.pss-column-header span {
  margin: 0;
  color: var(--accent-dark);
  font-size: var(--type-field-label);
  font-weight: 700;
}

.pss-column-header p {
  grid-column: 1 / 3;
}

.pss-column-header span {
  text-align: center;
}

.pss-question {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 52px;
  grid-template-rows: auto 30px;
  gap: 4px 8px;
  align-items: start;
}

.pss-number {
  padding-top: 1px;
  color: var(--accent-dark);
  font-size: var(--type-field-label);
  font-weight: 700;
  text-align: right;
}

.pss-question label {
  grid-column: 2;
  grid-row: 1 / 3;
  gap: 5px;
}

.pss-question select {
  align-self: end;
}

.item-score {
  display: grid;
  place-items: center;
  min-height: 30px;
  grid-column: 3;
  grid-row: 2;
  border: 1px solid #C9DDD8;
  border-radius: 4px;
  color: var(--accent-dark);
  background: #EDF6F4;
  font-size: var(--type-field-label);
  font-weight: 650;
  text-align: center;
  white-space: nowrap;
}

/* PSS-10: lilac screening surface with a distinct coral reset action. */
.note-section[data-section="behavior"] .pss-card {
  width: 100%;
  min-width: 0;
  border-color: #865797;
  background: #F3EBF6;
  box-shadow: 0 2px 6px rgba(86, 59, 98, 0.1);
}

.note-section[data-section="behavior"] .pss-header,
.note-section[data-section="behavior"] .pss-body {
  min-width: 0;
  background: #F3EBF6;
}

.note-section[data-section="behavior"] .pss-body {
  border-top: 0;
}

.note-section[data-section="behavior"] .pss-column {
  min-width: 0;
  border-color: #865797;
  background: #F3EBF6;
}

.note-section[data-section="behavior"] .pss-question {
  min-width: 0;
}

.note-section[data-section="behavior"] .pss-question select {
  width: 100%;
  min-width: 0;
}

.note-section[data-section="behavior"] .pss-score {
  color: #563b62;
  border-color: #865797 !important;
  background: #F3EBF6 !important;
  box-shadow: none;
}

.note-section[data-section="behavior"] .pss-score:hover,
.note-section[data-section="behavior"] .pss-score:focus-visible,
.note-section[data-section="behavior"] .pss-score.active {
  color: #FFFFFF;
  border-color: #865797 !important;
  background: #B280C2 !important;
  box-shadow: inset 0 0 0 2px #F3EBF6;
}

.note-section[data-section="behavior"] .item-score {
  color: #563b62;
  border-color: #865797;
  background: #F3EBF6;
}

.note-section[data-section="behavior"] #clearPss {
  color: #563B62;
  border-color: #865797;
  background: #f3ebf6;
  box-shadow: none;
}

.note-section[data-section="behavior"] #clearPss:hover,
.note-section[data-section="behavior"] #clearPss:focus-visible,
.note-section[data-section="behavior"] #clearPss:active {
  color: #563B62;
  border-color: #865797;
  background: #f3ebf6;
  outline: 0;
  box-shadow: none;
}

.note-section[data-section="behavior"] .pss-score:hover,
.note-section[data-section="behavior"] .pss-score:focus-visible {
  outline: 0;
  box-shadow: none;
}

.note-section[data-section="behavior"] .pss-body {
  padding-right: 10px;
  padding-bottom: 14px;
  padding-left: 10px;
}

.note-section[data-section="behavior"] .tag-group button:not(.tag-tool-button):not(.selected),
.note-section[data-section="behavior"] .tag-group button:not(.tag-tool-button):not(.selected):hover,
.note-section[data-section="behavior"] .tag-group button:not(.tag-tool-button):not(.selected):focus-visible {
  color: #563B62;
  border-color: #865797;
  background: #f3ebf6;
  outline: 0;
  box-shadow: none;
}

.note-section[data-section="behavior"] .tag-group button.selected,
.note-section[data-section="behavior"] .tag-group button.selected:hover,
.note-section[data-section="behavior"] .tag-group button.selected:focus-visible {
  color: #FFFFFF;
  border-color: #865797;
  background: #B280C2;
  outline: 0;
  box-shadow: none;
}

.note-section[data-section="behavior"] .tag-group .tag-tool-button:not(.active),
.note-section[data-section="behavior"] .tag-group .tag-tool-button:not(.active):hover,
.note-section[data-section="behavior"] .tag-group .tag-tool-button:not(.active):focus-visible {
  color: #563B62;
  border-color: #865797;
  background: #F3EBF6;
  outline: 0;
  box-shadow: none;
}

.note-section[data-section="behavior"] .tag-group .tag-tool-button.active,
.note-section[data-section="behavior"] .tag-group .tag-tool-button.active:hover,
.note-section[data-section="behavior"] .tag-group .tag-tool-button.active:focus-visible {
  color: #563B62;
  border-color: #865797;
  background: #F3EBF6;
  outline: 0;
  box-shadow: 0 0 0 4px #B280C2;
}

.note-section[data-section="behavior"] [data-bind="emotionFactors"] button:not(.tag-tool-button) {
  display: inline-grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 10px;
  text-align: left;
}

.note-section[data-section="behavior"] [data-bind="emotionFactors"] .tag-remove-control {
  position: relative;
  display: inline-block;
  width: 17px;
  min-width: 17px;
  height: 17px;
  margin: -1px -4px -1px 0;
  overflow: hidden;
  border: 1px solid #865797;
  border-radius: 50%;
  background: #FFFFFF;
  color: transparent;
  font-size: 0;
  line-height: 0;
}

.note-section[data-section="behavior"] [data-bind="emotionFactors"] .tag-remove-control::before,
.note-section[data-section="behavior"] [data-bind="emotionFactors"] .tag-remove-control::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 1.5px;
  border-radius: 1px;
  background: #563B62;
  content: "";
  transform-origin: center;
}

.note-section[data-section="behavior"] [data-bind="emotionFactors"] .tag-remove-control::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.note-section[data-section="behavior"] [data-bind="emotionFactors"] .tag-remove-control::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.note-section[data-section="behavior"] [data-bind="emotionFactors"] .add-tag-button span {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  transform: none !important;
  color: transparent;
  font-size: 0;
  line-height: 0;
}

.note-section[data-section="behavior"] [data-bind="emotionFactors"] .add-tag-button span::before,
.note-section[data-section="behavior"] [data-bind="emotionFactors"] .add-tag-button span::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 2px;
  border-radius: 1px;
  background: #563B62;
  content: "";
  transform: translate(-50%, -50%);
}

.note-section[data-section="behavior"] [data-bind="emotionFactors"] .add-tag-button span::after {
  transform: translate(-50%, -50%) rotate(90deg);
}

.note-section[data-section="behavior"] [data-bind="emotionFactors"] .add-tag-button.active span::before,
.note-section[data-section="behavior"] [data-bind="emotionFactors"] .add-tag-button.active span::after {
  background: #FFFFFF;
}

.note-section[data-section="behavior"] [data-bind="emotionFactors"] .add-tag-button.active,
.note-section[data-section="behavior"] [data-bind="emotionFactors"] .add-tag-button.active:hover,
.note-section[data-section="behavior"] [data-bind="emotionFactors"] .add-tag-button.active:focus-visible {
  color: #FFFFFF;
  border-color: #865797;
  background: #B280C2;
  box-shadow: inset 0 0 0 2px #F3EBF6;
}

.note-section[data-section="behavior"] [data-entry-for="emotionFactors"] .save-tag-button {
  font-weight: 700 !important;
}

.note-section[data-section="behavior"] > .section-body {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.note-section[data-section="behavior"]:not(.collapsed) > .section-body {
  overflow: visible;
}

.behavior-subsection {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.behavior-beliefs { order: 1; }
.behavior-stress { order: 2; }
.behavior-social { order: 3; }
.behavior-sleep { order: 4; }
.physical-health-section { order: 5; }
.food-access-section { order: 6; }
.note-section[data-section="behavior"] #behaviorSummary { order: 7; }
.note-section[data-section="behavior"] .fallback-note-label { order: 8; }

.physical-health-section {
  --button-active-rim: #E8ECFA;
  border-color: #6E83C7;
}

.physical-health-section > .section-toggle {
  background: #A8B8EA;
}

.physical-health-section > .section-toggle:hover {
  background: #A8B8EA;
}

.physical-health-section .subsection-label {
  color: #40538E;
  border-left-color: #6E83C7;
  background: #e8ecfa;
}

.physical-health-section .activity-add-button,
.physical-health-section .tag-group button {
  color: #40538E;
  border-color: #6E83C7;
  background: #e8ecfa;
}

.physical-health-section .activity-add-button:hover,
.physical-health-section .activity-add-button:focus-visible,
.physical-health-section .activity-add-button.selected,
.physical-health-section .tag-group button:hover,
.physical-health-section .tag-group button:focus-visible,
.physical-health-section .tag-group button.selected {
  color: #FFFFFF;
  border-color: #6E83C7;
  background: #A8B8EA;
  outline: 0;
  box-shadow: inset 0 0 0 2px #E8ECFA;
}

.physical-health-section .activity-entry {
  border-color: #6E83C7;
  box-shadow: 0 0 0 3px #E8ECFA, 0 10px 22px rgba(64, 83, 142, 0.1);
}

.physical-health-section :is(input:not([type="range"]), select, textarea):focus {
  border-color: #6E83C7;
  outline: 0;
  box-shadow: 0 0 0 3px #E8ECFA;
}

.physical-health-section .fallback-note-label {
  display: none;
}

.physical-health-section .fallback-note-label:not(.view-hidden-by-fallback) {
  display: grid;
}

.note-section[data-section="behavior"] .pss-score.active,
.note-section[data-section="behavior"] .pss-score:not(.incomplete) {
  color: #FFFFFF;
  border-color: #865797 !important;
  background: #B280C2 !important;
  box-shadow: inset 0 0 0 2px #F3EBF6;
}

.note-section[data-section="behavior"] .pss-score.active #pssLevel,
.note-section[data-section="behavior"] .pss-score:not(.incomplete) #pssLevel {
  color: #FFFFFF;
}

/* Food and Nutrition-Related History is one teal card; interaction color follows each clinical block. */
.note-section[data-section="behavior"] .behavior-subsection > .subsection-label,
.note-section[data-section="behavior"] .embedded-subsection > .subsection-label,
.note-section[data-section="behavior"] .embedded-subsection .section-body > .subsection-label {
  color: #1E4D4A;
  border-left-color: #1E4D4A;
  background: #EDF6F4;
}

.behavior-beliefs,
.behavior-stress,
.behavior-social {
  --history-fill: #F3EBF6;
  --history-active: #B280C2;
  --history-border: #865797;
  --history-text: #563B62;
}

.behavior-sleep,
.physical-health-section {
  --history-fill: #E8ECFA;
  --history-active: #A8B8EA;
  --history-border: #6E83C7;
  --history-text: #40538E;
}

.food-access-section {
  --history-fill: #E8F4E9;
  --history-active: #A9CFAE;
  --history-border: #78A97D;
  --history-text: #254D2A;
}

.behavior-beliefs :is(input:not([type="range"]), select, textarea):focus,
.behavior-stress :is(input:not([type="range"]), select, textarea):focus,
.behavior-social :is(input:not([type="range"]), select, textarea):focus,
.behavior-sleep :is(input:not([type="range"]), select, textarea):focus,
.physical-health-section :is(input:not([type="range"]), select, textarea):focus,
.food-access-section :is(input:not([type="range"]), select, textarea):focus {
  border-color: var(--history-border) !important;
  outline: 0;
  box-shadow: 0 0 0 3px var(--history-fill) !important;
}

.behavior-beliefs .activity-add-button,
.behavior-stress .activity-add-button,
.behavior-social .activity-add-button,
.behavior-sleep .activity-add-button,
.physical-health-section .activity-add-button,
.food-access-section .activity-add-button,
.food-access-section .pss-toggle-label,
.food-access-section .small-button {
  color: var(--history-text) !important;
  border-color: var(--history-border) !important;
  background: var(--history-fill) !important;
}

.behavior-stress .activity-add-button {
  font-weight: 700 !important;
}

.behavior-beliefs .activity-add-button.selected,
.behavior-stress .activity-add-button.selected,
.behavior-social .activity-add-button.selected,
.behavior-sleep .activity-add-button.selected,
.physical-health-section .activity-add-button.selected,
.food-access-section .activity-add-button.selected {
  color: #FFFFFF !important;
  border-color: var(--history-border) !important;
  background: var(--history-active) !important;
  box-shadow: inset 0 0 0 2px var(--history-fill) !important;
}

#addSubstance:hover,
#addSubstance:focus-visible,
#addSubstance.selected {
  color: #FFFFFF !important;
  border-color: #865797 !important;
  background: #B280C2 !important;
  box-shadow: none !important;
}

#addActivity:hover,
#addActivity:focus-visible,
#addActivity.selected {
  color: #FFFFFF !important;
  border-color: #6E83C7 !important;
  background: #A8B8EA !important;
  box-shadow: none !important;
}

.food-access-section .tag-field,
.food-access-section .custom-tag-entry input,
.food-access-section .food-weight-loss-popover {
  border-color: #78A97D;
}

.food-access-section .tag-group button:not(.tag-tool-button),
.food-access-section .tag-group button:not(.tag-tool-button):hover,
.food-access-section .tag-group button:not(.tag-tool-button):focus-visible,
.food-access-section .tag-group .tag-tool-button:not(.active),
.food-access-section .tag-group .tag-tool-button:not(.active):hover,
.food-access-section .tag-group .tag-tool-button:not(.active):focus-visible {
  color: #254D2A !important;
  border-color: #78A97D !important;
  background: #E8F4E9 !important;
  box-shadow: none !important;
}

.food-access-section .tag-group button.selected,
.food-access-section .tag-group button.selected:hover,
.food-access-section .tag-group button.selected:focus-visible,
.food-access-section .tag-group .tag-tool-button.active,
.food-access-section .tag-group .tag-tool-button.active:hover,
.food-access-section .tag-group .tag-tool-button.active:focus-visible {
  color: #FFFFFF !important;
  border-color: #78A97D !important;
  background: #A9CFAE !important;
  box-shadow: inset 0 0 0 2px #E8F4E9 !important;
}

.food-access-section .tag-remove-control {
  border-color: #78A97D !important;
}

.food-access-section .tag-remove-control::before,
.food-access-section .tag-remove-control::after,
.food-access-section .add-tag-button span::before,
.food-access-section .add-tag-button span::after {
  background: #254D2A !important;
}

.food-access-section .add-tag-button.active span::before,
.food-access-section .add-tag-button.active span::after {
  background: #FFFFFF !important;
}

.food-access-section .custom-tag-entry .save-tag-button,
.food-access-section .food-weight-loss-popover .small-button {
  color: #254D2A !important;
  border-color: #78A97D !important;
  background: #E8F4E9 !important;
}

.food-access-section .custom-tag-entry .save-tag-button.submission-ready:hover,
.food-access-section .custom-tag-entry .save-tag-button:hover,
.food-access-section .food-weight-loss-popover .small-button:hover {
  color: #FFFFFF !important;
  border-color: #78A97D !important;
  background: #A9CFAE !important;
}

.food-access-section .pss-card,
.food-access-section .pss-column,
.food-access-section .pss-score,
.food-access-section .item-score {
  color: #254D2A;
  border-color: #78A97D;
  background: #E8F4E9;
}

.food-access-section .pss-score.active,
.food-access-section .pss-score:not(.incomplete) {
  color: #FFFFFF;
  border-color: #78A97D !important;
  background: #A9CFAE !important;
  box-shadow: inset 0 0 0 2px #E8F4E9;
}

.delete-tag-button {
  color: #580404;
  border-color: #BD5947;
  background: #FCE9E4;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.focused .modeling-field {
  display: none;
}

.summary-block {
  display: grid;
  gap: 7px;
  padding: 10px;
  border: 1px solid #C9DDD8;
  border-radius: 2px;
  background: #f7fbfa;
}

.summary-label {
  margin: 0;
  color: var(--muted);
  font-size: var(--type-helper);
  font-weight: 600;
  line-height: var(--leading-helper);
}

.combined-summary {
  display: block;
  min-height: 42px;
  padding: 9px 10px;
  border: 1px solid #C9DDD8;
  color: var(--ink);
  line-height: 1.45;
  background: #FFFFFF;
  font-size: var(--type-body);
}

.combined-summary:empty::before {
  content: "No documented findings yet. Blank subsections are omitted from the final ADIME note.";
  color: var(--muted);
}

.note-preview {
  position: relative;
  display: flex;
  flex-direction: column;
  container-type: inline-size;
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
  border: 1px solid #C9DDD8;
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: 0 5px 16px rgba(30, 77, 74, 0.2);
}

.preview-header {
  display: flex;
  flex-direction: column;
  gap: 0;
  align-items: stretch;
  justify-content: flex-start;
  position: relative;
  padding: 0 10px 8px;
  border-bottom: 1px solid var(--line);
  color: #FFFFFF;
  background: var(--accent);
  border-radius: 8px 8px 0 0;
}

.preview-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
  order: 1;
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
}

.preview-title-block {
  display: grid;
  align-content: end;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  order: 2;
}

.preview-title-block h2 {
  color: #FFFFFF;
  display: block;
  margin: 0;
  max-width: 100%;
  font-size: var(--type-live-preview-title);
  font-style: italic;
  font-weight: 650;
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-note-title);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  overflow-wrap: normal;
  word-break: keep-all;
}

.preview-actions .primary-button {
  flex: 1 1 0;
  min-width: 0;
  min-height: 26px;
  padding-right: 8px;
  padding-left: 8px;
  border-color: rgba(255, 255, 255, 0.65);
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  font-size: var(--type-toolbar-button);
  font-weight: 350;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.preview-actions .primary-button:hover {
  background: rgba(255, 255, 255, 0.2);
}

.preview-options-menu {
  position: relative;
  flex: 0 0 auto;
}

.preview-options-menu summary {
  display: inline-grid;
  width: 34px;
  height: 28px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.12);
  cursor: pointer;
  list-style: none;
}

.preview-options-menu summary::-webkit-details-marker {
  display: none;
}

.preview-options-menu summary:hover,
.preview-options-menu summary:focus-visible,
.preview-options-menu[open] summary {
  outline: none;
  background: rgba(255, 255, 255, 0.2);
}

.preview-menu-icon,
.preview-menu-icon::before,
.preview-menu-icon::after {
  display: block;
  width: 16px;
  height: 3px;
  border-radius: 999px;
  background: #FFFFFF;
}

.preview-menu-icon {
  position: relative;
}

.preview-menu-icon::before,
.preview-menu-icon::after {
  content: "";
  position: absolute;
  left: 0;
}

.preview-menu-icon::before {
  top: -6px;
}

.preview-menu-icon::after {
  top: 6px;
}

.preview-menu-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: auto;
  z-index: 60;
  min-width: 176px;
  padding: 0;
  border: 1px solid #C9DDD8;
  border-radius: 6px;
  background: #FFFFFF;
  overflow: hidden;
  box-shadow: 0 8px 18px rgba(30, 77, 74, 0.16);
}

.preview-menu-item {
  display: block;
  width: 100%;
  min-height: 30px;
  border: 0;
  border-radius: 0;
  padding: 7px 10px;
  color: #1E4D4A;
  background: transparent;
  font-size: var(--type-utility-button);
  font-weight: 400;
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-body);
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}

.preview-menu-item + .preview-menu-item {
  border-top: 1px solid #EDF6F4;
}

.preview-menu-item:hover,
.preview-menu-item:focus-visible {
  outline: none;
  color: #1E4D4A;
  background: #EDF6F4;
  font-weight: 650;
}

.preview-menu-item.is-copied {
  color: #1E4D4A;
  background: #EDF6F4;
  font-weight: 650;
}

.preview-menu-item.is-copied::after {
  content: "✓";
  float: right;
  font-weight: 700;
}

.note-preview::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 6;
  border-radius: inherit;
  background: #FFFFFF;
  opacity: 0;
  pointer-events: none;
}

.note-preview.copy-confirmed::after {
  animation: preview-copy-flash 520ms ease-out;
}

@keyframes preview-copy-flash {
  0% {
    opacity: 0;
  }
  12% {
    opacity: 0.86;
  }
  34% {
    opacity: 0.72;
  }
  100% {
    opacity: 0;
  }
}

.preview-toggle {
  display: none;
}

.preview-actions .preview-toggle {
  display: none;
}

.preview-toggle {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 4;
  display: inline-grid;
  place-items: center;
  width: 32px;
  min-width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  border: 0;
  color: transparent;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

.preview-toggle-icon {
  position: relative;
  display: block;
  width: 30px;
  height: 30px;
  background: url("compass-header.svg") center / contain no-repeat;
  transform: translateY(-4px) rotate(0deg);
  transform-origin: 50% 50%;
  transition: transform 300ms ease-out, filter 180ms ease;
}

.preview-toggle-icon::before,
.preview-toggle-icon::after {
  content: none;
}

.preview-toggle.is-minimized .preview-toggle-icon::before,
.preview-toggle.is-minimized .preview-toggle-icon::after {
  content: none;
}

.preview-toggle.is-minimized .preview-toggle-icon {
  transform: translateY(-4px) rotate(-180deg);
}

.preview-toggle:hover .preview-toggle-icon,
.preview-toggle:focus-visible .preview-toggle-icon {
  filter: drop-shadow(0 0 2px rgba(255, 255, 255, 0.7));
}

.preview-header .eyebrow {
  opacity: 0.8;
  font-size: 0.8rem;
}

#finalNote {
  display: none;
}

.formatted-note {
  position: relative;
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
  border: 0;
  border-radius: 0;
  padding: 16px var(--preview-card-x);
  line-height: 1.5;
  color: var(--ink);
  font-size: var(--type-live-body);
  font-weight: 400;
  overflow-y: scroll;
  scrollbar-gutter: stable;
  scrollbar-color: #8A8A8A #EDF6F4;
  scrollbar-width: auto;
}

.formatted-note::-webkit-scrollbar {
  width: 12px;
  background: #EDF6F4;
}

.formatted-note::-webkit-scrollbar-track {
  background: #EDF6F4;
}

.formatted-note::-webkit-scrollbar-track-piece {
  background: #EDF6F4;
}

.formatted-note.preview-refreshing {
  background: #FFFFFF;
}

.formatted-note .preview-scroll-sizer {
  visibility: hidden;
  pointer-events: none;
}

.formatted-note .preview-typing-layer {
  position: absolute;
  top: 16px;
  right: var(--preview-card-x);
  left: var(--preview-card-x);
}

.formatted-note .preview-typing-layer .preview-pending-node {
  display: none;
}

.formatted-note:focus {
  outline: none;
  box-shadow: none;
}

.formatted-note.preview-editing {
  background: #FFFFFF;
  box-shadow: inset 0 0 0 2px #99CFC2;
}

.formatted-note.preview-refreshing,
.formatted-note.preview-refreshing:focus,
.formatted-note.preview-refreshing.preview-editing {
  background: #FFFFFF;
  box-shadow: none;
}

.formatted-note.preview-refreshing > * {
  visibility: hidden !important;
}

.formatted-note .preview-refresh-sizer {
  min-height: 100%;
  pointer-events: none;
  visibility: hidden;
}

.formatted-note h3 {
  margin: 0 0 var(--space-l);
  padding-top: var(--space-xs);
  color: #1E2928;
  font-size: var(--type-live-adime-header);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0.025em;
  text-transform: uppercase;
}

.formatted-note h3:first-child {
  padding-top: var(--space-xs);
}

.formatted-note h4 {
  margin: 0 0 var(--space-s);
  color: #637270;
  font-size: var(--type-preview-subsection);
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: var(--tracking-body);
}

.formatted-note h5 {
  margin: 0 0 var(--space-xs);
  color: #1E2928;
  font-size: var(--type-live-minor-header);
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: var(--tracking-body);
}

.formatted-note .note-subsection-label {
  margin: 0 0 var(--space-s);
  color: #1E2928;
  font-size: var(--type-live-minor-header);
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: var(--tracking-body);
}

.formatted-note .note-med-label {
  font-weight: 650;
}

.formatted-note .note-status-label {
  margin-bottom: var(--space-xs);
  color: #637270;
  font-size: var(--type-live-field-label);
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: var(--tracking-body);
}

.formatted-note p {
  margin: 0 0 var(--space-xs);
}

.formatted-note p:has(+ :is(h3, h4, h5, .note-subsection-label, .note-divider)) {
  margin-bottom: var(--space-m);
}

.formatted-note .note-nested-lines {
  margin-left: 0;
  padding-left: 0;
  border-left: 0;
}

.formatted-note .note-list-lines {
  margin-bottom: var(--space-m);
}

.formatted-note .note-date {
  color: inherit;
}

.formatted-note .note-timeline-line {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  column-gap: 12px;
  align-items: baseline;
  margin: 0;
}

.formatted-note .note-divider {
  margin: 0 0 var(--space-m);
  padding: var(--space-xs) 0 0;
  border-top: 1px solid #C9DDD8;
  border-bottom: 0;
  color: #637270;
  font-size: var(--type-preview-subsection);
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: 0.01em;
}

.formatted-note .note-bullet {
  display: grid;
  grid-template-columns: 1.55em minmax(0, 1fr);
  column-gap: 0.45em;
  align-items: baseline;
  margin: 0;
  padding-left: 8px;
  text-indent: 0;
}

.formatted-note .note-list-marker {
  text-align: right;
}

.formatted-note .note-number-marker {
  font-weight: 700;
}

.formatted-note .note-nested-bullet {
  margin-left: 8px;
}

.formatted-note .note-bullet:has(+ .note-bullet-end) {
  margin-bottom: var(--space-m);
}

.formatted-note .note-bullet-end {
  height: 0;
  margin: 0 0 var(--space-m);
  border-top: 1px solid #C9DDD8;
}

.copy-status {
  margin: 0;
  min-height: 24px;
  padding: 0 14px;
  color: var(--accent-dark);
  background: #FFFFFF;
  font-size: var(--type-helper);
  font-weight: 600;
  line-height: var(--leading-helper);
}

.note-preview:has(.formatted-note.preview-refreshing) .copy-status {
  background: #FFFFFF;
}

@media (max-width: 1180px) {
  .app-header,
  .workspace {
    padding-left: 18px;
    padding-right: 18px;
  }

}

@media (max-width: 900px) {
  .app-header,
  .workspace {
    padding-left: 12px;
    padding-right: 12px;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .app-header {
    grid-template-columns: 1fr;
  }

  .note-title-area,
  .header-actions,
  .app-header .followup-workflow-toggle {
    grid-column: 1;
    grid-row: auto;
  }

  .note-title-area,
  .app-header .followup-workflow-toggle {
    width: 100%;
    min-width: 0;
  }

  .preview-column {
    position: static;
    margin-top: 0;
    height: auto;
  }

  .note-preview {
    position: fixed;
    top: 78px;
    right: 12px;
    z-index: 7;
    width: min(340px, calc(100vw - 24px));
    height: min(560px, calc(100vh - 130px));
    min-height: 0;
  }

  .note-preview .preview-header {
    cursor: move;
    user-select: none;
  }

  .note-preview.dragging {
    opacity: 0.96;
    box-shadow: 0 18px 42px rgba(30, 77, 74, 0.22);
  }

  .note-preview.minimized {
    height: auto;
  }

  .note-preview.minimized #finalNote,
  .note-preview.minimized .formatted-note,
  .note-preview.minimized .copy-status {
    display: none;
  }
}

textarea[rows] {
  padding: 10px 12px;
  overflow-y: hidden;
  resize: none;
  line-height: 1.5;
}

@media (max-width: 1240px) {
  .pss-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .app-header,
  .pane-toolbar,
  .preview-header {
    align-items: stretch;
    flex-direction: column;
    height: auto;
  }

  .topbar {
    align-items: center;
    min-height: 46px;
    padding: 0 10px 0 14px;
  }

  .side-rail {
    display: none;
  }

  .app-shell {
    margin-left: 0;
  }

  .patient-strip {
    align-items: flex-start;
    flex-direction: column;
    padding: 12px;
  }

  .header-actions,
  .pane-toolbar > div {
    justify-content: flex-start;
  }

  .workspace {
    padding: 10px;
    padding-bottom: 98px;
  }

  .field-grid.two,
  .field-grid.three,
  .clinical-grid.two,
  .clinical-grid.three,
  .dietary-assessment-shell,
  .recall-grid,
  .recall-meal,
  .dietary-assessment-box,
  .dietary-assessment-fields,
  .pes-builder-grid,
  .clinical-entry,
  .med-supp-layout,
  .nutrition-support-entry,
  .clinical-inline-builder,
  .pss-grid,
  .progress-grid,
  .compact-select-label,
  .activity-entry,
  .substance-entry {
    grid-template-columns: 1fr;
  }

  .intervention-goals-grid {
    grid-template-columns: 1fr;
  }

  .pes-problem-field,
  .pes-specifier-field,
  .pes-etiology-field,
  .pes-symptoms-field {
    grid-column: 1;
    grid-row: auto;
  }

  .clinical-grid.two.medical-history-fields,
  .med-supp-layout {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }
}

@media (max-width: 620px) {
  .workspace {
    padding-right: 10px;
  }

  .note-preview {
    top: auto;
    right: 10px;
    bottom: 10px;
    width: calc(100vw - 20px);
    height: 38vh;
  }
}

@media (max-width: 860px) {
  .pss-question {
    grid-template-columns: 22px minmax(0, 1fr) 44px;
  }

  .pss-column-header {
    grid-template-columns: 22px minmax(0, 1fr) 44px;
  }

  .item-score {
    font-size: var(--type-toolbar-button);
  }
}

@media (prefers-reduced-motion: reduce) {
  .section-body,
  .pss-body {
    transition: none;
  }
}

/* Interaction discipline:
   - data fields and open entry panels may show focus/highlight;
   - long pill action buttons may change on hover;
   - card headers, tags, checkboxes, sliders, score bars, and compact action buttons stay visually steady. */
.toggle-switch-input:focus-visible + .toggle-switch-track,
.subsection-minimize-checkbox:focus-visible,
.note-section input[type="checkbox"]:focus-visible,
.pss-score:hover,
.pss-score:focus-visible,
.note-section[data-section="behavior"] .pss-score:hover,
.note-section[data-section="behavior"] .pss-score:focus-visible {
  outline: 0 !important;
  box-shadow: none !important;
}

.tag-group button:hover,
.tag-group button:focus-visible,
.tag-group .tag-tool-button:hover,
.tag-group .tag-tool-button:focus-visible,
.barrier-field .tag-group button:hover,
.barrier-field .tag-group button:focus-visible,
.barrier-field .tag-group .add-tag-button:hover,
.barrier-field .tag-group .add-tag-button:focus-visible,
.note-section[data-section="behavior"] .tag-group button:hover,
.note-section[data-section="behavior"] .tag-group button:focus-visible,
.note-section[data-section="behavior"] .tag-group .tag-tool-button:hover,
.note-section[data-section="behavior"] .tag-group .tag-tool-button:focus-visible,
.physical-health-section .tag-group button:hover,
.physical-health-section .tag-group button:focus-visible {
  filter: none !important;
}

.submission-action.submission-ready:hover,
.submission-action.submission-ready:focus-visible,
.small-button:hover,
.small-button:focus-visible,
.ghost-button:hover,
.ghost-button:focus-visible,
.primary-button:hover,
.primary-button:focus-visible,
.activity-add-button:hover,
.activity-add-button:focus-visible,
#clearPss:hover,
#clearPss:focus-visible,
#saveMedication.submission-ready:hover,
#saveMedication.submission-ready:focus-visible,
#saveAllergy.submission-ready:hover,
#saveAllergy.submission-ready:focus-visible,
#savePrescribedDiet.submission-ready:hover,
#savePrescribedDiet.submission-ready:focus-visible,
#saveNutritionSupport.submission-ready:hover,
#saveNutritionSupport.submission-ready:focus-visible,
#saveActivity.submission-ready:hover,
#saveActivity.submission-ready:focus-visible,
#addPesStatement.submission-ready:hover,
#addPesStatement.submission-ready:focus-visible {
  filter: none !important;
  outline: 0 !important;
  box-shadow: none !important;
}

.secondary-pill-button:not(:disabled):hover,
.secondary-pill-button:not(:disabled):focus-visible,
.medical-history-opener.submission-ready:hover,
.medical-history-opener.submission-ready:focus-visible {
  background: #99CFC2;
}

#medicationEntry[data-category="Medication"] #saveMedication.submission-ready:hover,
#medicationEntry[data-category="Medication"] #saveMedication.submission-ready:focus-visible,
.physical-health-section #saveActivity.submission-ready:hover,
.physical-health-section #saveActivity.submission-ready:focus-visible {
  color: #FFFFFF !important;
  border-color: #6E83C7 !important;
  background: #A8B8EA !important;
}

#medicationEntry[data-category="Supplement"] #saveMedication.submission-ready:hover,
#medicationEntry[data-category="Supplement"] #saveMedication.submission-ready:focus-visible {
  color: #FFFFFF !important;
  border-color: #6E83C7 !important;
  background: #A8B8EA !important;
}

#savePrescribedDiet.submission-ready:hover,
#savePrescribedDiet.submission-ready:focus-visible,
#saveNutritionSupport.submission-ready:hover,
#saveNutritionSupport.submission-ready:focus-visible {
  color: #FFFFFF !important;
  border-color: #78A97D !important;
  background: #A9CFAE !important;
}

#saveAllergy.submission-ready:hover,
#saveAllergy.submission-ready:focus-visible,
#allergyEntry[data-category="Intolerance"] #saveAllergy.submission-ready:hover,
#allergyEntry[data-category="Intolerance"] #saveAllergy.submission-ready:focus-visible {
  color: #FFFFFF !important;
  border-color: #C8791E !important;
  background: #F2AC4C !important;
}

.medical-history-update-button.submission-ready:hover,
.medical-history-update-button.submission-ready:focus-visible {
  color: #FFFFFF !important;
  border-color: #8BB7AB !important;
  background: #99CFC2 !important;
}

#addPesStatement.submission-ready:hover,
#addPesStatement.submission-ready:focus-visible {
  color: #FFFFFF !important;
  border-color: #CEA00C !important;
  background: #F1BE15 !important;
}

/* Interaction normalization:
   Add buttons may show themed hover when available; headers, sliders, checkboxes,
   score bars, tags, and compact utility buttons stay visually quiet. */
.note-section input[type="checkbox"]:hover,
.note-section input[type="checkbox"]:focus-visible,
.toggle-switch-input:focus-visible + .toggle-switch-track,
.pss-score:hover,
.pss-score:focus-visible,
.note-section[data-section="behavior"] .pss-score:hover,
.note-section[data-section="behavior"] .pss-score:focus-visible {
  filter: none !important;
  outline: 0 !important;
  box-shadow: none !important;
}

.tag-group button:hover,
.tag-group button:focus-visible,
.tag-group .tag-tool-button:hover,
.tag-group .tag-tool-button:focus-visible,
.barrier-field .tag-group button:hover,
.barrier-field .tag-group button:focus-visible,
.note-section[data-section="behavior"] .tag-group button:hover,
.note-section[data-section="behavior"] .tag-group button:focus-visible,
.physical-health-section .tag-group button:hover,
.physical-health-section .tag-group button:focus-visible {
  filter: none !important;
  outline: 0 !important;
  box-shadow: none !important;
}

.secondary-pill-button:not(:disabled):hover {
  filter: none !important;
  box-shadow: none !important;
}

#addMedication:not(:disabled):hover,
#addSupplement:not(:disabled):hover {
  color: #FFFFFF !important;
  border-color: #6E83C7 !important;
  background: #A8B8EA !important;
}

#addPrescribedDiet:not(:disabled):hover,
#addNutritionSupport:not(:disabled):hover {
  color: #FFFFFF !important;
  border-color: #78A97D !important;
  background: #A9CFAE !important;
}

#addAllergy:not(:disabled):hover,
#addIntolerance:not(:disabled):hover {
  color: #FFFFFF !important;
  border-color: #C8791E !important;
  background: #F2AC4C !important;
}

.medical-history-opener:not(:disabled):hover {
  color: #FFFFFF !important;
  border-color: #8BB7AB !important;
  background: #99CFC2 !important;
}

#medicationEntry #saveMedication.submission-ready:hover,
.physical-health-section #saveActivity.submission-ready:hover {
  color: #FFFFFF !important;
  border-color: #6E83C7 !important;
  background: #A8B8EA !important;
}

#savePrescribedDiet.submission-ready:hover,
#saveNutritionSupport.submission-ready:hover {
  color: #FFFFFF !important;
  border-color: #78A97D !important;
  background: #A9CFAE !important;
}

#saveAllergy.submission-ready:hover {
  color: #FFFFFF !important;
  border-color: #C8791E !important;
  background: #F2AC4C !important;
}

.medical-history-update-button.submission-ready:hover,
 .medical-history-update-button.submission-ready:focus-visible {
  color: #FFFFFF !important;
  border-color: #8BB7AB !important;
  background: #99CFC2 !important;
}

#addPesStatement.submission-ready:hover {
  color: #FFFFFF !important;
  border-color: #CEA00C !important;
  background: #F1BE15 !important;
}

#closeFoodWeightLoss:hover,
#closeFoodWeightLoss:focus-visible {
  color: #FFFFFF !important;
  border-color: #BD5947 !important;
  background: #F29B87 !important;
  outline: 0 !important;
  box-shadow: none !important;
}

/* Tag add controls do not get a separate hover color; active state keeps the light inner rim. */
[data-manage-tags="foodUrgencyFlags"] {
  display: none !important;
}

.barrier-field .tag-group .add-tag-button:hover,
.barrier-field .tag-group .add-tag-button:focus-visible {
  color: #580404 !important;
  border-color: #BD5947 !important;
  background: #FCE9E4 !important;
  box-shadow: none !important;
}

.barrier-field .tag-group .add-tag-button.active,
.barrier-field .tag-group .add-tag-button.active:hover,
.barrier-field .tag-group .add-tag-button.active:focus-visible {
  color: #FFFFFF !important;
  border-color: #BD5947 !important;
  background: #F29B87 !important;
  box-shadow: none !important;
}

.barrier-field .tag-group .add-tag-button:hover span::before,
.barrier-field .tag-group .add-tag-button:hover span::after,
.barrier-field .tag-group .add-tag-button:focus-visible span::before,
.barrier-field .tag-group .add-tag-button:focus-visible span::after {
  background: #580404 !important;
}

.barrier-field .tag-group .add-tag-button.active span::before,
.barrier-field .tag-group .add-tag-button.active span::after,
.barrier-field .tag-group .add-tag-button.active:hover span::before,
.barrier-field .tag-group .add-tag-button.active:hover span::after,
.barrier-field .tag-group .add-tag-button.active:focus-visible span::before,
.barrier-field .tag-group .add-tag-button.active:focus-visible span::after {
  background: #FFFFFF !important;
}

.note-section[data-section="behavior"] [data-bind="emotionFactors"] .add-tag-button:hover,
.note-section[data-section="behavior"] [data-bind="emotionFactors"] .add-tag-button:focus-visible {
  color: #563B62 !important;
  border-color: #865797 !important;
  background: #F3EBF6 !important;
  box-shadow: none !important;
}

.note-section[data-section="behavior"] [data-bind="emotionFactors"] .add-tag-button.active,
.note-section[data-section="behavior"] [data-bind="emotionFactors"] .add-tag-button.active:hover,
.note-section[data-section="behavior"] [data-bind="emotionFactors"] .add-tag-button.active:focus-visible {
  color: #FFFFFF !important;
  border-color: #865797 !important;
  background: #B280C2 !important;
  box-shadow: inset 0 0 0 2px #F3EBF6 !important;
}

.note-section[data-section="behavior"] [data-bind="emotionFactors"] .add-tag-button:hover span::before,
.note-section[data-section="behavior"] [data-bind="emotionFactors"] .add-tag-button:hover span::after,
.note-section[data-section="behavior"] [data-bind="emotionFactors"] .add-tag-button:focus-visible span::before,
.note-section[data-section="behavior"] [data-bind="emotionFactors"] .add-tag-button:focus-visible span::after {
  background: #563B62 !important;
}

.note-section[data-section="behavior"] [data-bind="emotionFactors"] .add-tag-button.active span::before,
.note-section[data-section="behavior"] [data-bind="emotionFactors"] .add-tag-button.active span::after,
.note-section[data-section="behavior"] [data-bind="emotionFactors"] .add-tag-button.active:hover span::before,
.note-section[data-section="behavior"] [data-bind="emotionFactors"] .add-tag-button.active:hover span::after,
.note-section[data-section="behavior"] [data-bind="emotionFactors"] .add-tag-button.active:focus-visible span::before,
.note-section[data-section="behavior"] [data-bind="emotionFactors"] .add-tag-button.active:focus-visible span::after {
  background: #FFFFFF !important;
}

/* Food and Nutrition-Related History embedded-card theme. */
.note-section[data-section="behavior"] .behavior-subsection > .subsection-label,
.note-section[data-section="behavior"] .embedded-subsection > .subsection-label,
.note-section[data-section="behavior"] .embedded-subsection .section-body > .subsection-label {
  color: #1E4D4A !important;
  border-left-color: #1E4D4A !important;
  background: #EDF6F4 !important;
}

.note-section[data-section="behavior"] .behavior-beliefs :is(input:not([type="range"]), select, textarea):focus {
  border-color: #865797 !important;
  box-shadow: 0 0 0 3px #F3EBF6 !important;
}

.note-section[data-section="behavior"] .behavior-sleep :is(input:not([type="range"]), select, textarea):focus,
.note-section[data-section="behavior"] .physical-health-section :is(input:not([type="range"]), select, textarea):focus {
  border-color: #6E83C7 !important;
  box-shadow: 0 0 0 3px #E8ECFA !important;
}

.note-section[data-section="behavior"] .food-access-section :is(input:not([type="range"]), select, textarea):focus {
  border-color: #78A97D !important;
  box-shadow: 0 0 0 3px #E8F4E9 !important;
}

.note-section[data-section="behavior"] .physical-health-section .activity-add-button,
.note-section[data-section="behavior"] .physical-health-section .activity-add-button.selected:not(:hover):not(:focus-visible),
.note-section[data-section="behavior"] .physical-health-section .tag-group button {
  color: #40538E !important;
  border-color: #6E83C7 !important;
  background: #E8ECFA !important;
  box-shadow: none !important;
}

.note-section[data-section="behavior"] .physical-health-section .activity-add-button:hover,
.note-section[data-section="behavior"] .physical-health-section .activity-add-button:focus-visible {
  color: #FFFFFF !important;
  border-color: #6E83C7 !important;
  background: #A8B8EA !important;
  box-shadow: none !important;
}

.note-section[data-section="behavior"] .physical-health-section .tag-group button.selected {
  color: #FFFFFF !important;
  border-color: #6E83C7 !important;
  background: #A8B8EA !important;
  box-shadow: inset 0 0 0 2px #E8ECFA !important;
}

.note-section[data-section="behavior"] .food-access-section .pss-card,
.note-section[data-section="behavior"] .food-access-section .pss-column,
.note-section[data-section="behavior"] .food-access-section .item-score,
.note-section[data-section="behavior"] .food-access-section .food-weight-loss-popover {
  color: #254D2A !important;
  border-color: #78A97D !important;
  background: #E8F4E9 !important;
}

.note-section[data-section="behavior"] .food-access-section .pss-card {
  box-shadow: 0 8px 18px rgba(37, 77, 42, 0.1) !important;
}

.note-section[data-section="behavior"] .food-access-section .pss-score,
.note-section[data-section="behavior"] .food-access-section .pss-score:hover,
.note-section[data-section="behavior"] .food-access-section .pss-score:focus-visible {
  color: #FFFFFF !important;
  border-color: #78A97D !important;
  background: #A9CFAE !important;
  box-shadow: none !important;
}

.note-section[data-section="behavior"] .food-access-section .pss-score span {
  color: #FFFFFF !important;
}

.note-section[data-section="behavior"] .food-access-section .pss-score.active,
.note-section[data-section="behavior"] .food-access-section .pss-score:not(.incomplete) {
  color: #FFFFFF !important;
  border-color: #78A97D !important;
  background: #A9CFAE !important;
  box-shadow: none !important;
}

.note-section[data-section="behavior"] .food-access-section .tag-group button:not(.tag-tool-button),
.note-section[data-section="behavior"] .food-access-section .tag-group button:not(.tag-tool-button):hover,
.note-section[data-section="behavior"] .food-access-section .tag-group button:not(.tag-tool-button):focus-visible,
.note-section[data-section="behavior"] .food-access-section .tag-group .tag-tool-button:not(.active),
.note-section[data-section="behavior"] .food-access-section .tag-group .tag-tool-button:not(.active):hover,
.note-section[data-section="behavior"] .food-access-section .tag-group .tag-tool-button:not(.active):focus-visible {
  color: #254D2A !important;
  border-color: #78A97D !important;
  background: #E8F4E9 !important;
  box-shadow: none !important;
}

.note-section[data-section="behavior"] .food-access-section .tag-group button.selected,
.note-section[data-section="behavior"] .food-access-section .tag-group button.selected:hover,
.note-section[data-section="behavior"] .food-access-section .tag-group button.selected:focus-visible,
.note-section[data-section="behavior"] .food-access-section .tag-group .tag-tool-button.active,
.note-section[data-section="behavior"] .food-access-section .tag-group .tag-tool-button.active:hover,
.note-section[data-section="behavior"] .food-access-section .tag-group .tag-tool-button.active:focus-visible {
  color: #FFFFFF !important;
  border-color: #78A97D !important;
  background: #A9CFAE !important;
  box-shadow: inset 0 0 0 2px #E8F4E9 !important;
}

.note-section[data-section="behavior"] .food-access-section .tag-remove-control {
  border-color: #78A97D !important;
}

.note-section[data-section="behavior"] .food-access-section .tag-remove-control::before,
.note-section[data-section="behavior"] .food-access-section .tag-remove-control::after,
.note-section[data-section="behavior"] .food-access-section .add-tag-button span::before,
.note-section[data-section="behavior"] .food-access-section .add-tag-button span::after {
  background: #254D2A !important;
}

.note-section[data-section="behavior"] .food-access-section .add-tag-button.active span::before,
.note-section[data-section="behavior"] .food-access-section .add-tag-button.active span::after {
  background: #FFFFFF !important;
}

.note-section[data-section="behavior"] .food-access-section .custom-tag-entry .save-tag-button,
.note-section[data-section="behavior"] .food-access-section .food-weight-loss-popover .small-button {
  color: #254D2A !important;
  border-color: #78A97D !important;
  background: #E8F4E9 !important;
}

.note-section[data-section="behavior"] .food-access-section .custom-tag-entry .save-tag-button:hover,
.note-section[data-section="behavior"] .food-access-section .food-weight-loss-popover .small-button:hover,
.note-section[data-section="behavior"] .food-access-section .custom-tag-entry .save-tag-button:focus-visible,
.note-section[data-section="behavior"] .food-access-section .food-weight-loss-popover .small-button:focus-visible {
  color: #FFFFFF !important;
  border-color: #78A97D !important;
  background: #A9CFAE !important;
  box-shadow: none !important;
}

.note-section[data-section="behavior"] .food-access-section .urgency-field .tag-group button:not(.tag-tool-button),
.note-section[data-section="behavior"] .food-access-section .urgency-field .tag-group button:not(.tag-tool-button):hover,
.note-section[data-section="behavior"] .food-access-section .urgency-field .tag-group button:not(.tag-tool-button):focus-visible,
.note-section[data-section="behavior"] .food-access-section .urgency-field .tag-group .tag-tool-button:not(.active),
.note-section[data-section="behavior"] .food-access-section .urgency-field .tag-group .tag-tool-button:not(.active):hover,
.note-section[data-section="behavior"] .food-access-section .urgency-field .tag-group .tag-tool-button:not(.active):focus-visible,
.note-section[data-section="behavior"] .food-access-section .urgency-field .custom-tag-entry .save-tag-button {
  color: #580404 !important;
  border-color: #BD5947 !important;
  background: #FCE9E4 !important;
  box-shadow: none !important;
}

.note-section[data-section="behavior"] .food-access-section .urgency-field .tag-group button.selected,
.note-section[data-section="behavior"] .food-access-section .urgency-field .tag-group button.selected:hover,
.note-section[data-section="behavior"] .food-access-section .urgency-field .tag-group button.selected:focus-visible,
.note-section[data-section="behavior"] .food-access-section .urgency-field .tag-group .tag-tool-button.active,
.note-section[data-section="behavior"] .food-access-section .urgency-field .tag-group .tag-tool-button.active:hover,
.note-section[data-section="behavior"] .food-access-section .urgency-field .tag-group .tag-tool-button.active:focus-visible,
.note-section[data-section="behavior"] .food-access-section .urgency-field .custom-tag-entry .save-tag-button:hover,
.note-section[data-section="behavior"] .food-access-section .urgency-field .custom-tag-entry .save-tag-button:focus-visible {
  color: #FFFFFF !important;
  border-color: #BD5947 !important;
  background: #F29B87 !important;
  box-shadow: none !important;
}

.note-section[data-section="behavior"] .food-access-section .urgency-field .tag-remove-control {
  border-color: #BD5947 !important;
}

.note-section[data-section="behavior"] .food-access-section .urgency-field .tag-remove-control::before,
.note-section[data-section="behavior"] .food-access-section .urgency-field .tag-remove-control::after,
.note-section[data-section="behavior"] .food-access-section .urgency-field .add-tag-button span::before,
.note-section[data-section="behavior"] .food-access-section .urgency-field .add-tag-button span::after {
  background: #580404 !important;
}

.note-section[data-section="behavior"] .food-access-section .urgency-field .add-tag-button.active span::before,
.note-section[data-section="behavior"] .food-access-section .urgency-field .add-tag-button.active span::after {
  background: #FFFFFF !important;
}

.note-section[data-section="behavior"] .food-access-section .urgency-field .custom-tag-entry input:focus {
  border-color: #BD5947 !important;
  box-shadow: 0 0 0 3px #FCE9E4, 0 5px 14px rgba(189, 89, 71, 0.13) !important;
}

.note-section[data-section="behavior"] .food-access-section #foodSecurityCard,
.note-section[data-section="behavior"] .food-access-section #foodSecurityCard.pss-card,
.note-section[data-section="behavior"] .food-access-section #foodSecurityCard .pss-header,
.note-section[data-section="behavior"] .food-access-section #foodSecurityCard .pss-body {
  color: #254D2A !important;
  border-color: #78A97D !important;
  background: #E8F4E9 !important;
}

.note-section[data-section="behavior"] .food-access-section #foodSecurityCard {
  box-shadow: 0 8px 18px rgba(37, 77, 42, 0.1) !important;
}

.note-section[data-section="behavior"] .food-access-section {
  --history-fill: #EDF6F4;
  --history-active: #99CFC2;
  --history-border: #8BB7AB;
  --history-text: #1E4D4A;
}

.note-section[data-section="behavior"] .food-access-section :is(input:not([type="range"]), select, textarea):focus {
  border-color: #8BB7AB !important;
  outline: 0;
  box-shadow: 0 0 0 3px #EDF6F4 !important;
}

.note-section[data-section="behavior"] .food-access-section .pss-card,
.note-section[data-section="behavior"] .food-access-section .pss-column,
.note-section[data-section="behavior"] .food-access-section .item-score,
.note-section[data-section="behavior"] .food-access-section .food-weight-loss-popover,
.note-section[data-section="behavior"] .food-access-section #foodSecurityCard,
.note-section[data-section="behavior"] .food-access-section #foodSecurityCard.pss-card,
.note-section[data-section="behavior"] .food-access-section #foodSecurityCard .pss-header,
.note-section[data-section="behavior"] .food-access-section #foodSecurityCard .pss-body {
  color: #1E4D4A !important;
  border-color: #8BB7AB !important;
  background: #EDF6F4 !important;
}

.note-section[data-section="behavior"] .food-access-section .pss-score,
.note-section[data-section="behavior"] .food-access-section .pss-score:hover,
.note-section[data-section="behavior"] .food-access-section .pss-score:focus-visible,
.note-section[data-section="behavior"] .food-access-section .pss-score.active,
.note-section[data-section="behavior"] .food-access-section .pss-score:not(.incomplete) {
  color: #FFFFFF !important;
  border-color: #8BB7AB !important;
  background: #99CFC2 !important;
  box-shadow: none !important;
}

.note-section[data-section="behavior"] .food-access-section .pss-score span {
  color: #FFFFFF !important;
}

.note-section[data-section="behavior"] .food-access-section .pss-toggle-label,
.note-section[data-section="behavior"] .food-access-section .small-button,
.note-section[data-section="behavior"] .food-access-section .custom-tag-entry .save-tag-button,
.note-section[data-section="behavior"] .food-access-section .food-weight-loss-popover .small-button {
  color: #1E4D4A !important;
  border-color: #8BB7AB !important;
  background: #EDF6F4 !important;
}

.note-section[data-section="behavior"] .food-access-section .pss-toggle-label:hover,
.note-section[data-section="behavior"] .food-access-section .small-button:hover,
.note-section[data-section="behavior"] .food-access-section .pss-toggle-label:focus-visible,
.note-section[data-section="behavior"] .food-access-section .small-button:focus-visible {
  color: #FFFFFF !important;
  border-color: #8BB7AB !important;
  background: #99CFC2 !important;
}

.note-section[data-section="behavior"] .food-access-section .urgency-field .tag-group button:not(.tag-tool-button),
.note-section[data-section="behavior"] .food-access-section .urgency-field .tag-group button:not(.tag-tool-button):hover,
.note-section[data-section="behavior"] .food-access-section .urgency-field .tag-group button:not(.tag-tool-button):focus-visible,
.note-section[data-section="behavior"] .food-access-section .urgency-field .tag-group .tag-tool-button:not(.active),
.note-section[data-section="behavior"] .food-access-section .urgency-field .tag-group .tag-tool-button:not(.active):hover,
.note-section[data-section="behavior"] .food-access-section .urgency-field .tag-group .tag-tool-button:not(.active):focus-visible,
.note-section[data-section="behavior"] .food-access-section .urgency-field .custom-tag-entry .save-tag-button {
  color: #580404 !important;
  border-color: #BD5947 !important;
  background: #FCE9E4 !important;
  box-shadow: none !important;
}

.note-section[data-section="behavior"] .food-access-section .urgency-field .tag-group button.selected,
.note-section[data-section="behavior"] .food-access-section .urgency-field .tag-group button.selected:hover,
.note-section[data-section="behavior"] .food-access-section .urgency-field .tag-group button.selected:focus-visible,
.note-section[data-section="behavior"] .food-access-section .urgency-field .tag-group .tag-tool-button.active,
.note-section[data-section="behavior"] .food-access-section .urgency-field .tag-group .tag-tool-button.active:hover,
.note-section[data-section="behavior"] .food-access-section .urgency-field .tag-group .tag-tool-button.active:focus-visible,
.note-section[data-section="behavior"] .food-access-section .urgency-field .custom-tag-entry .save-tag-button:hover,
.note-section[data-section="behavior"] .food-access-section .urgency-field .custom-tag-entry .save-tag-button:focus-visible {
  color: #FFFFFF !important;
  border-color: #BD5947 !important;
  background: #F29B87 !important;
  box-shadow: none !important;
}

.note-section[data-section="behavior"] .food-access-section .urgency-field .custom-tag-entry input:focus {
  border-color: #BD5947 !important;
  box-shadow: 0 0 0 3px #FCE9E4 !important;
}

.note-section[data-section="behavior"] .food-access-section .urgency-panel .minor-heading {
  margin-bottom: 8px;
}

.note-section[data-section="behavior"] .food-access-section .urgency-field {
  margin-top: 0;
}

/* Embedded inside the connected Nutrition Compass. */
body.embed-mode { background: linear-gradient(90deg, #FFFFFF 0%, #F7FBFA 30%, #D7ECE8 65%, #99CFC2 85%, #99CFC2 100%); }
body.embed-mode .topbar,
body.embed-mode .side-rail,
body.embed-mode .patient-strip,
body.embed-mode .workflow-tabs { display: none !important; }
body.embed-mode .app-shell { margin-left: 0; min-height: 100vh; }
body.embed-mode .app-header { padding-top: 24px; }

/* Clinical sliders: one shared component for readiness, stress, and energy. */
.readiness-field,
.scale-field,
.readiness-field:hover,
.readiness-field:focus,
.readiness-field:active,
.readiness-field:focus-within,
.scale-field:hover,
.scale-field:focus,
.scale-field:active,
.scale-field:focus-within {
  outline: 0 !important;
  outline-color: transparent !important;
  outline-offset: 0 !important;
  outline-style: none !important;
  outline-width: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  background-color: transparent !important;
}

.readiness-field input[type="range"] {
  --clinical-slider-fill: #865797;
  --clinical-slider-track: #F3EBF6;
  --clinical-slider-progress: var(--range-progress, 50%);
}

.readiness-field input[type="range"]#energyLevel {
  --clinical-slider-fill: #6E83C7;
  --clinical-slider-track: #E8ECFA;
}

.readiness-field input[type="range"],
.readiness-field input[type="range"]:hover,
.readiness-field input[type="range"]:focus,
.readiness-field input[type="range"]:active,
.readiness-field input[type="range"]:focus-visible {
  -webkit-appearance: none !important;
  appearance: none !important;
  accent-color: transparent !important;
  width: 100% !important;
  height: 18px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 999px !important;
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
  outline: 0 !important;
  outline-color: transparent !important;
  outline-offset: 0 !important;
  outline-style: none !important;
  outline-width: 0 !important;
  box-shadow: none !important;
  filter: none !important;
  overflow: visible !important;
  -webkit-tap-highlight-color: transparent !important;
  user-select: none !important;
}

.readiness-field input[type="range"]::-webkit-slider-runnable-track,
.readiness-field input[type="range"]:hover::-webkit-slider-runnable-track,
.readiness-field input[type="range"]:focus::-webkit-slider-runnable-track,
.readiness-field input[type="range"]:active::-webkit-slider-runnable-track,
.readiness-field input[type="range"]:focus-visible::-webkit-slider-runnable-track {
  height: 10px !important;
  -webkit-appearance: none !important;
  appearance: none !important;
  border: 0 !important;
  outline: 0 !important;
  outline-color: transparent !important;
  outline-offset: 0 !important;
  outline-style: none !important;
  outline-width: 0 !important;
  border-radius: 999px !important;
  background:
    linear-gradient(
      to right,
      var(--clinical-slider-fill, #865797) 0%,
      var(--clinical-slider-fill, #865797) var(--clinical-slider-progress, 50%),
      var(--clinical-slider-track, #F3EBF6) var(--clinical-slider-progress, 50%),
      var(--clinical-slider-track, #F3EBF6) 100%
    ) !important;
  box-shadow: inset 0 1px 2px rgba(30, 77, 74, 0.08) !important;
  filter: none !important;
  opacity: 1 !important;
}

.readiness-field input[type="range"]::-webkit-slider-container {
  height: 10px !important;
  border: 0 !important;
  outline: 0 !important;
  outline-color: transparent !important;
  outline-offset: 0 !important;
  outline-style: none !important;
  outline-width: 0 !important;
  border-radius: 999px !important;
  background: transparent !important;
  box-shadow: none !important;
  filter: none !important;
}

.readiness-field input[type="range"]::-webkit-slider-thumb,
.readiness-field input[type="range"]:hover::-webkit-slider-thumb,
.readiness-field input[type="range"]:focus::-webkit-slider-thumb,
.readiness-field input[type="range"]:active::-webkit-slider-thumb,
.readiness-field input[type="range"]:focus-visible::-webkit-slider-thumb {
  -webkit-appearance: none !important;
  appearance: none !important;
  width: 18px !important;
  height: 18px !important;
  margin-top: -4px !important;
  border: 3px solid var(--clinical-slider-fill, #865797) !important;
  outline: 0 !important;
  outline-color: transparent !important;
  outline-offset: 0 !important;
  outline-style: none !important;
  outline-width: 0 !important;
  border-radius: 50% !important;
  background: #FFFFFF !important;
  box-shadow: 0 1px 3px rgba(30, 77, 74, 0.18) !important;
  filter: none !important;
  opacity: 1 !important;
}

.readiness-field input[type="range"]::-moz-range-track,
.readiness-field input[type="range"]:hover::-moz-range-track,
.readiness-field input[type="range"]:focus::-moz-range-track,
.readiness-field input[type="range"]:active::-moz-range-track {
  height: 10px !important;
  border: 0 !important;
  outline: 0 !important;
  outline-color: transparent !important;
  outline-offset: 0 !important;
  outline-style: none !important;
  outline-width: 0 !important;
  border-radius: 999px !important;
  background: var(--clinical-slider-track, #F3EBF6) !important;
  box-shadow: inset 0 1px 2px rgba(30, 77, 74, 0.08) !important;
  filter: none !important;
  opacity: 1 !important;
}

.readiness-field input[type="range"]::-moz-range-progress {
  height: 10px !important;
  border-radius: 999px !important;
  background: var(--clinical-slider-fill, #865797) !important;
  box-shadow: 0 1px 2px rgba(30, 77, 74, 0.10) !important;
  opacity: 1 !important;
}

.readiness-field input[type="range"]::-moz-range-thumb {
  width: 18px !important;
  height: 18px !important;
  border: 3px solid var(--clinical-slider-fill, #865797) !important;
  outline: 0 !important;
  outline-color: transparent !important;
  outline-offset: 0 !important;
  outline-style: none !important;
  outline-width: 0 !important;
  border-radius: 50% !important;
  background: #FFFFFF !important;
  box-shadow: 0 1px 3px rgba(30, 77, 74, 0.18) !important;
  opacity: 1 !important;
}

.readiness-field input[type="range"]::-moz-focus-outer {
  border: 0 !important;
}

/* Slider text-selection guard. */
.readiness-field input[type="range"]::selection,
.scale-field::selection,
.readiness-field::selection {
  background: transparent !important;
}
/* Biochemical & Clinical Measurements tables */
.section-body > .minor-heading.measurement-table-title,
.minor-heading.measurement-table-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 30px;
  position: relative;
  z-index: 1;
  margin: 24px 0 0;
  padding: 5px 10px;
  color: #1E4D4A;
  border: 1px solid #8BB7AB;
  border-bottom: 0;
  border-radius: 6px 6px 0 0;
  background: #99CFC2;
  font-size: var(--type-table-label);
  font-weight: 700;
  line-height: 1;
  letter-spacing: var(--tracking-table-label);
  text-align: left;
}

.measurement-table-title > span:first-child {
  min-width: 0;
}

.measurement-table-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex: 0 0 auto;
}

.measurement-table-wrap {
  overflow: hidden;
  margin: 0 0 24px;
  padding: 0;
  border: 1px solid #8BB7AB;
  border-top: 0;
  border-radius: 0 0 6px 6px;
  background: #FFFFFF;
  box-shadow: none;
}

.section-body > .measurement-table-wrap + .minor-heading.measurement-table-title {
  margin-top: 0;
}

.section-body > .measurement-table-wrap + .subsection-label {
  margin-top: 0;
}

.measurement-table-wrap .clinical-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  margin: 0;
  border: 0;
  border-collapse: separate;
  border-spacing: 0;
  background: #FFFFFF;
  font-size: var(--type-table-text);
}

.measurement-table-wrap .clinical-table th,
.measurement-table-wrap .clinical-table td {
  padding: 3px 7px;
  border-right: 0;
  vertical-align: top;
}

.measurement-table-wrap .clinical-table thead th {
  height: 22px;
  color: #1E4D4A;
  border: 0;
  border-top: 0;
  border-bottom: 0;
  background: #EDF6F4;
  font-size: var(--type-table-column-header);
  font-weight: 650;
  line-height: 1;
  letter-spacing: var(--tracking-table-label);
  padding-top: 4px;
  padding-bottom: 2px;
  text-align: left;
  vertical-align: middle;
}

.measurement-table-wrap .clinical-table thead th:last-child {
  padding-top: 2px;
  padding-bottom: 2px;
}

.measurement-table-wrap .clinical-table tfoot {
  display: table-row-group;
  background: #EDF6F4;
}

.measurement-table-wrap .clinical-table tfoot td {
  height: 34px;
  padding: 5px 8px;
  border: 0;
  border-top: 0;
  border-bottom: 2px solid #8BB7AB;
  background: #EDF6F4;
  vertical-align: middle;
}

.measurement-table-wrap .clinical-table tbody td {
  height: 28px;
  padding: 5px 7px;
  border: 0;
  border-bottom: 1px solid #C9DDD8;
  background: #FFFFFF;
  text-align: left;
  vertical-align: middle;
  color: #1E2928;
  font-size: var(--type-table-text);
  font-weight: 400;
  line-height: 1;
  letter-spacing: var(--tracking-table-label);
}

.measurement-table-wrap .clinical-table tbody tr:first-child td {
  border-top: 0;
}

.measurement-table-wrap .clinical-table tbody tr:last-child td {
  border-bottom: 0;
}

.measurement-table-wrap .clinical-table input {
  display: block;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  height: 24px;
  min-height: 24px;
  padding: 3px 7px;
  border: 1px solid #C9DDD8;
  border-radius: 4px;
  background: #FFFFFF;
  font-size: var(--type-table-input);
  font-weight: 400;
  line-height: 1;
  letter-spacing: var(--tracking-table-label);
  box-shadow: none;
}

.measurement-table-wrap .clinical-table input::placeholder {
  color: #637270;
  font-size: var(--type-table-placeholder);
  font-style: italic;
  font-weight: 450;
  line-height: var(--leading-table-placeholder);
  letter-spacing: var(--tracking-table-placeholder);
  opacity: 1;
}

.measurement-table-wrap .clinical-table input:focus {
  outline: 0;
  border-color: #8BB7AB;
  background: #FFFFFF;
  box-shadow: 0 0 0 3px #D7ECE8;
}

.measurement-table-wrap .clinical-table .date-picker-field:focus-within {
  border-radius: 4px;
  background: #FFFFFF;
  box-shadow: 0 0 0 3px #D7ECE8;
}

.measurement-table-wrap .clinical-table .date-picker-field {
  grid-template-columns: minmax(0, 1fr) 24px;
  width: 100%;
}

.measurement-table-wrap .clinical-table .date-picker-field > input[type="text"] {
  padding-right: 30px;
}

.measurement-table-wrap .clinical-table .calendar-picker-button {
  width: 24px;
  min-width: 24px;
}

.measurement-table-wrap .clinical-table .native-date-picker {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 1px;
  height: 1px;
  min-height: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.measurement-table-wrap #addLab,
.measurement-table-wrap #addVital,
.measurement-table-wrap #addAnthro,
.measurement-clear-button,
.measurement-import-button {
  box-sizing: border-box;
  display: inline-grid;
  place-items: center;
  width: 100%;
  height: 24px;
  min-height: 24px;
  margin: 0;
  padding: 2px 8px;
  color: #1E4D4A;
  border: 1px solid #8BB7AB;
  border-radius: 4px;
  background: #EDF6F4;
  font-size: var(--type-table-placeholder);
  font-weight: 700;
  line-height: 1;
  letter-spacing: var(--tracking-table-label);
  box-shadow: none;
  vertical-align: middle;
}

.measurement-table-title .measurement-import-button {
  flex: 0 0 auto;
  width: auto;
  min-width: 76px;
  height: 22px;
  min-height: 22px;
}

.measurement-table-title .measurement-clear-button {
  flex: 0 0 auto;
  width: auto;
  min-width: 62px;
  height: 22px;
  min-height: 22px;
}

.measurement-import-button {
  color: #583900;
  border: 1.5px solid #CEA00C;
  background: #F6DC88;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    inset 0 -1px 0 rgba(88, 57, 0, 0.12),
    0 1px 2px rgba(88, 57, 0, 0.18);
}

.measurement-table-wrap #addLab:hover,
.measurement-table-wrap #addVital:hover,
.measurement-table-wrap #addAnthro:hover,
.measurement-clear-button:hover,
.measurement-clear-button:focus-visible,
.measurement-table-wrap #addLab:focus-visible,
.measurement-table-wrap #addVital:focus-visible,
.measurement-table-wrap #addAnthro:focus-visible,
.measurement-table-wrap #addLab.submission-ready:hover,
.measurement-table-wrap #addVital.submission-ready:hover,
.measurement-table-wrap #addAnthro.submission-ready:hover,
.measurement-table-wrap #addLab.submission-ready:focus-visible,
.measurement-table-wrap #addVital.submission-ready:focus-visible,
.measurement-table-wrap #addAnthro.submission-ready:focus-visible {
  color: #FFFFFF;
  border-color: #8BB7AB;
  background: #99CFC2;
  box-shadow: none;
}

.measurement-import-button:hover,
.measurement-import-button:focus-visible {
  color: #FFFFFF;
  border-color: #CEA00C;
  background: #F1BE15;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.46),
    inset 0 -1px 0 rgba(88, 57, 0, 0.2),
    0 1px 2px rgba(88, 57, 0, 0.2);
}

.measurement-table-wrap #addLab:disabled,
.measurement-table-wrap #addVital:disabled,
.measurement-table-wrap #addAnthro:disabled,
.measurement-clear-button:disabled,
.measurement-table-wrap #addLab:disabled:hover,
.measurement-table-wrap #addVital:disabled:hover,
.measurement-table-wrap #addAnthro:disabled:hover,
.measurement-clear-button:disabled:hover,
.measurement-clear-button:disabled:focus-visible {
  cursor: default;
  color: #1E4D4A;
  border-color: #8BB7AB;
  background: #EDF6F4;
  opacity: 0.66;
}

.measurement-clear-button.submission-ready:hover,
.measurement-clear-button.submission-ready:focus-visible {
  color: #FFFFFF !important;
  border-color: #8BB7AB !important;
  background: #99CFC2 !important;
  box-shadow: none !important;
}

.measurement-row-actions {
  white-space: nowrap;
  line-height: 1;
  vertical-align: middle;
}

.measurement-row-actions button {
  vertical-align: middle;
}

.measurement-row-actions button + button {
  margin-left: 6px;
}

.measurement-edit-button {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 22px;
  padding: 0;
  color: #583900;
  border: 1px solid #CEA00C;
  border-radius: 4px;
  background: #F6DC88;
  font-size: var(--type-table-placeholder);
  font-weight: 700;
  line-height: 1;
  letter-spacing: var(--tracking-table-label);
  box-shadow: none;
}

.measurement-edit-button span {
  display: block;
  line-height: 1;
  transform: scaleX(-1) rotate(-8deg);
}

.measurement-edit-button:hover,
.measurement-edit-button:focus-visible,
.measurement-row-editing .measurement-edit-button {
  color: #FFFFFF;
  border-color: #CEA00C;
  background: #F1BE15;
  box-shadow: none;
}

.measurement-edit-button:disabled {
  color: #637270;
  border-color: #C9DDD8;
  background: #EDF6F4;
  cursor: not-allowed;
  opacity: 0.72;
}

.measurement-edit-button:disabled:hover,
.measurement-edit-button:disabled:focus-visible {
  color: #637270;
  border-color: #C9DDD8;
  background: #EDF6F4;
}

.measurement-delete-button {
  display: none;
  place-items: center;
  width: 24px;
  height: 22px;
  padding: 0;
  color: #580404;
  border: 1px solid #BD5947;
  border-radius: 4px;
  background: #FCE9E4;
  line-height: 1;
  box-shadow: none;
}

.measurement-row-editing .measurement-delete-button {
  display: inline-grid;
}

.measurement-delete-button svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.measurement-delete-button:hover,
.measurement-delete-button:focus-visible {
  color: #FFFFFF;
  border-color: #BD5947;
  background: #F29B87;
  box-shadow: none;
}

.measurement-table-wrap .clinical-table tbody tr.measurement-row-editing {
  position: relative;
  z-index: 2;
  filter: drop-shadow(5px 12px 18px rgba(30, 77, 74, 0.28));
}

.measurement-table-wrap .clinical-table tbody tr.measurement-row-editing td {
  padding-top: 7px;
  padding-bottom: 7px;
  background: #F7FBFA;
  border-top: 1px solid #8BB7AB;
  border-bottom: 3px solid #8BB7AB;
  box-shadow: none;
}

.measurement-table-wrap .clinical-table tbody tr.measurement-row-editing td:first-child {
  border-left: 2px solid #8BB7AB;
  border-radius: 4px 0 0 4px;
}

.measurement-table-wrap .clinical-table tbody tr.measurement-row-editing td:last-child {
  border-right: 2px solid #8BB7AB;
  border-radius: 0 4px 4px 0;
}

.measurement-row-editing td[data-key] {
  position: relative;
  background: #F7FBFA;
}

.measurement-row-editing td[data-key]:focus {
  outline: 0;
}

.measurement-edit-input {
  display: block;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  height: 26px;
  min-height: 26px;
  padding: 3px 8px;
  color: #1E2928;
  border: 1px solid #8BB7AB;
  border-radius: 4px;
  background: #FFFFFF;
  font-size: var(--type-table-input);
  font-weight: 400;
  line-height: 1;
  box-shadow: none;
}

.measurement-edit-input:focus {
  outline: 0;
  border-color: #8BB7AB;
  background: #FFFFFF;
  box-shadow: 0 0 0 3px #D7ECE8;
}

/* Text spacing schema: single semantic rhythm source for editor, tables, and preview. */
.page-title {
  margin: 0;
  line-height: var(--leading-display-title);
  letter-spacing: var(--tracking-display);
}

.recall-analysis .lookup-button {
  margin: 0;
  line-height: 1;
  letter-spacing: 0;
  font-size: 0;
}

.note-title-label {
  margin: var(--space-note-title-label-before) 0 var(--space-note-title-label-after);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-caps);
}

.note-title-input,
.app-header input.note-title-input {
  margin: 0;
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-note-title);
}

.assessment-heading,
.monitoring-heading,
.workflow-major-heading {
  margin: var(--space-2xl) 0 var(--space-l);
  padding-left: 0;
}

.assessment-heading h3,
.monitoring-heading h3,
.workflow-major-heading h3 {
  color: #1E2928;
  font-size: var(--type-workflow-heading);
  font-weight: 700;
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-heading);
}

.note-section {
  margin-bottom: 18px;
}

.section-toggle {
  margin: 0;
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-card-header);
}

.section-body,
.prior-note-fields,
.behavior-subsection,
.embedded-subsection,
.note-section[data-section="behavior"] > .section-body > .behavior-stress,
.note-section[data-section="behavior"] > .section-body > .physical-health-section,
.note-section[data-section="behavior"] > .section-body > .food-access-section {
  gap: 0;
  margin-top: 0;
  padding-top: 0;
}

.subsection-label,
.intervention-resources .subsection-label,
.note-section[data-section="behavior"] .behavior-subsection > .subsection-label,
.note-section[data-section="behavior"] .embedded-subsection > .subsection-label,
.note-section[data-section="behavior"] .embedded-subsection .section-body > .subsection-label {
  margin: var(--space-subsection) 0 0;
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-subsection);
}

.subsection-label + :is(
  .clinical-grid,
  .field-grid,
  .dietary-assessment-shell,
  .embedded-subsection,
  .behavior-subsection,
  .clinical-list-editor,
  .clinical-panel,
  .diet-order-box,
  .dietary-assessment-panel,
  .recall-grid,
  .rd-codes-layout
) {
  margin-top: var(--space-m);
}

.field-label,
.minor-heading,
.tag-field,
.section-free-text,
.section-body > .minor-heading,
.field-grid > .minor-heading,
.prescription-note-label,
.clinical-history-subsection,
.note-section label,
.field-grid > label {
  margin: var(--space-m) 0 var(--space-s);
  line-height: 1.25;
  letter-spacing: var(--tracking-field-label);
}

.section-body > .minor-heading:first-child,
.field-grid > .minor-heading:first-child {
  margin-top: var(--space-m);
}

.stacked-field-heading {
  margin-bottom: 0 !important;
}

.stacked-field-heading + .field-grid {
  margin-top: 0 !important;
}

.minor-heading:has(+ .readiness-field) {
  margin-bottom: 0 !important;
}

.minor-heading + .readiness-field {
  margin-top: var(--space-m) !important;
}

.scale-field {
  margin-top: var(--space-m) !important;
}

.behavior-stress .field-grid.two > .minor-heading,
.behavior-stress .field-grid.two > .readiness-field {
  grid-column: 1 / -1;
}

.behavior-stress .field-grid.two > .readiness-field {
  margin-top: 18px !important;
}

.behavior-stress .readiness-header {
  margin-bottom: 0 !important;
}

.behavior-stress .readiness-ticks {
  margin-top: -2px !important;
}

.physical-health-section .minor-heading:has(+ .activity-builder) {
  margin-bottom: var(--space-s) !important;
}

.physical-health-section .minor-heading + .activity-builder {
  margin-top: 0 !important;
}

.physical-health-section .stacked-field-heading {
  margin: var(--space-m) 0 0 !important;
}

.physical-health-section .stacked-field-heading + .field-grid {
  margin-top: 0 !important;
}

.physical-health-section .stacked-field-heading + .field-grid > label {
  margin-top: var(--space-m) !important;
}

.physical-health-section .field-grid + .stacked-field-heading {
  margin-top: var(--space-m) !important;
}

.behavior-stress label:has(#stressNote) {
  margin-top: 12px !important;
}

.readiness-field + :is(label, fieldset, .minor-heading) {
  margin-top: 0 !important;
}

.physical-health-section .stacked-field-heading {
  margin-top: 12px !important;
  margin-bottom: 0 !important;
}

.physical-health-section .stacked-field-heading + .field-grid {
  margin-top: 0 !important;
}

.physical-health-section .stacked-field-heading + .field-grid > label {
  margin-top: 12px !important;
  margin-bottom: 8px !important;
}

.physical-health-section .field-grid:has(+ .stacked-field-heading) {
  margin-bottom: 0 !important;
}

.field-grid {
  row-gap: 0;
}

.field-grid > label {
  gap: var(--space-s);
}

.section-body > label > :is(input, select, textarea, .custom-select, .clinical-list-editor),
.section-body > .field-label + :is(input, select, textarea, .custom-select, .clinical-list-editor) {
  margin-top: 0;
}

select,
textarea,
input[type="text"],
input[type="date"],
input[type="month"],
.clinical-list-editor,
.generated-prescription,
.generated-clinical-text {
  line-height: var(--leading-body);
  letter-spacing: var(--tracking-body);
}

::placeholder {
  line-height: var(--leading-placeholder);
  letter-spacing: var(--tracking-placeholder);
}

.submission-action,
.secondary-pill-button,
.lookup-button,
.activity-add-button,
.custom-tag-entry .save-tag-button,
#saveMedication,
#saveAllergy,
#savePrescribedDiet,
#saveNutritionSupport,
#saveActivity,
#addPesStatement,
#physicianIcdAdd,
#saveIcdCode,
.medical-history-update-button,
.food-weight-loss-popover .small-button,
.substance-entry .small-button,
.activity-entry .small-button {
  margin: 0;
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-display);
}

.mode-button,
.ghost-button,
.small-button,
.primary-button,
.preview-actions .primary-button {
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-display);
  font-size: var(--type-toolbar-button);
  font-weight: 350;
}

/* Primary / Action Button typography lock for inline Add controls whose row layout owns spacing. */
.custom-tag-entry .save-tag-button,
#physicianIcdAdd,
#saveIcdCode {
  font-size: var(--type-action-button) !important;
  font-weight: 700 !important;
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-display);
}

.custom-tag-entry .save-tag-button {
  margin: 0;
}

.recall-analysis .recall-lookup-control {
  grid-template-columns: minmax(0, 1fr) 44px;
  overflow: hidden;
  border-radius: 999px;
  background: linear-gradient(90deg, #FFFFFF 0%, #FFFFFF calc(100% - 44px), #EDF6F4 calc(100% - 44px), #EDF6F4 100%);
}

.recall-analysis .lookup-button {
  align-self: stretch;
  width: 44px;
  min-width: 44px;
  height: auto;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.recall-analysis .lookup-button:hover,
.recall-analysis .lookup-button:focus-visible,
.recall-analysis.is-searching .lookup-button {
  background: rgba(153, 207, 194, 0.75);
}

.eyebrow {
  margin: var(--space-l) 0 var(--space-s);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-caps);
}

.preview-header .eyebrow {
  position: static;
  margin: 0 0 var(--space-s);
  color: #FFFFFF;
  font-size: 0.8rem;
}

.patient-strip p,
.patient-meta,
.copy-status,
.followup-workflow-toggle small {
  margin-top: var(--space-xs);
  line-height: var(--leading-helper);
  letter-spacing: var(--tracking-body);
}

.followup-workflow-toggle small {
  margin-top: 0;
}

.measurement-table-wrap .clinical-table thead th,
.measurement-table-wrap .clinical-table tbody td,
.measurement-table-wrap .clinical-table input,
.measurement-table-wrap #addLab,
.measurement-table-wrap #addVital,
.measurement-table-wrap #addAnthro,
.measurement-edit-button,
.measurement-delete-button {
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-body);
}

.measurement-table-wrap .clinical-table input::placeholder {
  line-height: var(--leading-table-placeholder);
  letter-spacing: var(--tracking-table-placeholder);
}

.preview-title-block {
  display: grid;
  align-content: end;
  padding-left: var(--align-preview-title);
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

/* Live Preview exception: note title needs its own teal-header spacing,
   while the editable Note Title relies on its input cushion. */
.preview-title-block h2 {
  margin: 0;
  color: #FFFFFF;
  font-size: var(--type-live-preview-title);
  font-style: italic;
  font-weight: 650;
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-note-title);
}

.formatted-note {
  line-height: var(--leading-body);
  letter-spacing: var(--tracking-body);
}

.formatted-note h3 {
  margin: 0 0 var(--space-l);
  padding-top: var(--space-xs);
  line-height: 1.25;
  letter-spacing: 0.025em;
}

.formatted-note h3:first-child {
  padding-top: var(--space-xs);
}

.formatted-note h4,
.formatted-note .note-subsection-label {
  margin: 0 0 var(--space-s);
  line-height: 1.25;
  letter-spacing: var(--tracking-body);
}

.formatted-note h5 {
  margin: 0 0 var(--space-xs);
  line-height: 1.25;
  letter-spacing: var(--tracking-body);
}

.formatted-note .note-divider {
  margin: 0 0 var(--space-m);
  padding-top: var(--space-xs);
  line-height: 1.25;
  letter-spacing: var(--tracking-body);
}

.formatted-note p {
  margin: 0 0 var(--space-xs);
  letter-spacing: var(--tracking-body);
}

.formatted-note p:has(+ :is(h3, h4, h5, .note-subsection-label, .note-divider)) {
  margin-bottom: var(--space-m);
}

.formatted-note .note-status-label {
  margin-bottom: var(--space-xs);
  color: #637270;
  font-size: var(--type-live-field-label);
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: var(--tracking-body);
}

.formatted-note .note-bullet {
  display: grid;
  grid-template-columns: 1.55em minmax(0, 1fr);
  column-gap: 0.45em;
  align-items: baseline;
  margin: 0;
  padding-left: 8px;
  text-indent: 0;
}

.formatted-note .note-list-marker {
  text-align: right;
}

.formatted-note .note-number-marker {
  font-weight: 700;
}

.formatted-note .note-timeline-line {
  margin: 0;
}

.formatted-note .note-bullet:has(+ .note-bullet-end) {
  margin-bottom: var(--space-m);
}

.formatted-note .note-bullet-end {
  margin: 0 0 var(--space-m);
}

.formatted-note .note-list-lines {
  margin-bottom: var(--space-m);
}

.note-section[data-section="clinical"] .section-body > .minor-heading {
  color: #1E2928;
  font-size: var(--type-field-label);
  font-weight: 650;
}

/* Final layering and urgent-tag detail overrides. */
.note-preview {
  z-index: 120;
}

@media (max-width: 1080px) {
  .note-preview {
    z-index: 120;
  }
}

.note-section[data-section="behavior"] .food-access-section .food-weight-loss-popover {
  position: relative !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  z-index: 2 !important;
  display: grid;
  grid-template-columns: minmax(120px, 0.8fr) minmax(90px, 0.55fr) minmax(180px, 1.3fr) 72px;
  gap: 10px 12px;
  align-items: end;
  width: 100%;
  margin-top: 8px;
  padding: 12px;
  color: #1E2928 !important;
  border: 1px solid #BD5947 !important;
  border-radius: 8px;
  background: #FFFFFF !important;
  box-shadow: 0 0 0 3px #FCE9E4, 0 12px 30px rgba(189, 89, 71, 0.14) !important;
}

.note-section[data-section="behavior"] .food-access-section .food-weight-loss-popover label {
  margin: 0;
}

.note-section[data-section="behavior"] .food-access-section .food-weight-loss-popover :is(input, select) {
  border-color: #BD5947 !important;
  color: #580404 !important;
  background: #FCE9E4 !important;
}

.note-section[data-section="behavior"] .food-access-section .food-weight-loss-popover :is(input, select):focus {
  border-color: #BD5947 !important;
  box-shadow: 0 0 0 3px #FCE9E4 !important;
}

.note-section[data-section="behavior"] .food-access-section .food-weight-loss-popover .small-button {
  align-self: end;
  height: 34px;
  min-height: 34px;
  color: #580404 !important;
  border-color: #BD5947 !important;
  background: #FCE9E4 !important;
  box-shadow: none !important;
}

.note-section[data-section="behavior"] .food-access-section .food-weight-loss-popover .small-button:hover,
.note-section[data-section="behavior"] .food-access-section .food-weight-loss-popover .small-button:focus-visible {
  color: #FFFFFF !important;
  border-color: #BD5947 !important;
  background: #F29B87 !important;
}

.note-section[data-section="behavior"] .food-access-section .food-weight-loss-popover select {
  color: #580404 !important;
}

.note-section[data-section="behavior"] .food-access-section .food-weight-loss-popover select:has(option[value=""]:checked) {
  color: #637270 !important;
}

.note-section[data-section="behavior"] .food-access-section .food-weight-loss-popover select option {
  color: #580404 !important;
  background: #FFFFFF !important;
}

.note-section[data-section="behavior"] .food-access-section .food-weight-loss-popover select option:checked {
  color: #580404 !important;
  background: #FCE9E4 linear-gradient(#FCE9E4, #FCE9E4) !important;
}

.custom-select-menu.theme-urgent-coral {
  border-color: #BD5947;
}

.custom-select-menu.theme-urgent-coral .custom-select-option:hover,
.custom-select-menu.theme-urgent-coral .custom-select-option:focus,
.custom-select-menu.theme-urgent-coral .custom-select-option[aria-selected="true"]:is(:hover, :focus) {
  color: #580404;
  background: #FCE9E4;
}

.custom-select-menu.theme-urgent-coral .custom-select-option[aria-selected="true"]:not(:hover):not(:focus) {
  color: #1E2928;
  background: #FFFFFF;
}

/* Final placeholder, food-access select, and dietary-pattern scroll refinements. */
body :is(input, textarea)::placeholder {
  line-height: var(--leading-placeholder);
  letter-spacing: var(--tracking-placeholder);
}

.measurement-table-wrap .clinical-table input::placeholder,
.dietary-assessment-table input::placeholder {
  line-height: var(--leading-table-placeholder);
  letter-spacing: var(--tracking-table-placeholder);
}

.food-access-section :is(#cookingAbility, #housing, #transportation) {
  height: 36px;
  min-height: 36px;
}

.food-access-select-grid {
  align-items: end;
}

.food-access-select-grid > label {
  display: grid;
  grid-template-rows: minmax(2.5em, auto) 36px;
  align-items: end;
  gap: 4px;
}

.food-access-select-grid > label > select {
  align-self: end;
  width: 100%;
}

.dietary-assessment-box {
  padding-bottom: 16px;
  position: relative;
}

.dietary-assessment-table {
  padding-bottom: 12px;
  scrollbar-gutter: stable;
}

.dietary-assessment-help {
  position: absolute;
  top: 10px;
  right: 10px;
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid #8BB7AB;
  border-radius: 999px;
  color: #1E4D4A;
  background: #EDF6F4;
  font-size: var(--type-view-settings);
  font-weight: 700;
  line-height: var(--leading-view-settings);
  letter-spacing: var(--tracking-view-settings);
}

.dietary-assessment-help:hover,
.dietary-assessment-help:focus-visible {
  color: #FFFFFF;
  background: #99CFC2;
  border-color: #8BB7AB;
}

.dietary-assessment-help-text {
  position: absolute;
  top: 30px;
  right: 0;
  z-index: 4;
  width: 75%;
  max-width: calc(100% - 16px);
  box-sizing: border-box;
  padding: 14px 16px;
  border: 1px solid #8BB7AB;
  border-radius: 8px;
  color: #1E2928;
  background: #FFFFFF;
  box-shadow: 0 10px 24px rgba(30, 77, 74, 0.14);
  font-size: var(--type-input-body);
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: var(--tracking-body);
}

.dietary-assessment-help-text p {
  margin: 0;
}

.dietary-assessment-help-text p + p,
.dietary-assessment-help-text .dietary-help-heading {
  margin-top: 12px;
}

.dietary-assessment-help-text .dietary-help-title,
.dietary-assessment-help-text .dietary-help-heading,
.dietary-assessment-help-text strong {
  color: #1E2928;
  font-weight: 700;
}

.dietary-assessment-help-text .dietary-help-heading + p {
  margin-top: 8px;
}

.dietary-assessment-help-text .dietary-help-heading-titlecase {
  text-transform: none;
}

.dietary-assessment-table {
  gap: 0;
  border-color: #8BB7AB;
  border-radius: 8px;
  background: #FFFFFF;
  box-shadow: inset 0 0 0 1px rgba(139, 183, 171, 0.24), 0 8px 20px rgba(30, 77, 74, 0.06);
}

.dietary-assessment-head,
.dietary-assessment-category,
.dietary-assessment-table select,
.dietary-assessment-table input,
.dietary-assessment-output {
  border-color: #C9DDD8;
}

.dietary-assessment-head {
  min-height: 42px;
  padding: 7px 8px;
  white-space: normal;
  overflow-wrap: normal;
  text-wrap: balance;
  line-height: 1.08;
  background: #EDF6F4;
}

.dietary-assessment-category {
  background: linear-gradient(90deg, #D7ECE8 0, #EDF6F4 100%);
  border-left-color: #3F7D79;
}

.dietary-assessment-output {
  background: linear-gradient(180deg, #FFFFFF 0, #F7FBFA 100%);
}

.dietary-assessment-table select,
.dietary-assessment-table input {
  margin: 4px;
  width: calc(100% - 8px);
  min-height: 30px;
  border: 1px solid #C9DDD8;
  border-radius: 6px;
  background-color: #FFFFFF;
}

.dietary-assessment-table .recommended-column:is(input, select) {
  border-color: #C9DDD8;
  background-color: #FFFFFF;
}

.dietary-assessment-table .recommended-column:is(.dietary-assessment-head) {
  background: #EDF6F4;
}

.dietary-assessment-table .recommended-column:is(.dietary-assessment-output) {
  background: linear-gradient(180deg, #FFFFFF 0, #F7FBFA 100%);
}

.dietary-assessment-table .dietary-assessment-head:nth-child(3),
.dietary-assessment-table .dietary-assessment-head:nth-child(5) {
  min-width: 62px;
}

/* Physical Health Factors responsive containment. */
.physical-health-section {
  min-width: 0;
  overflow-x: clip;
}

.physical-health-section .section-body,
.physical-health-section .field-grid,
.physical-health-section .activity-builder,
.physical-health-section label,
.physical-health-section textarea {
  min-width: 0;
  max-width: 100%;
}

.physical-health-section .field-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.physical-health-section .field-grid.three > label {
  display: grid;
  min-width: 0;
}

.physical-health-section .field-grid.three :is(select, input, textarea),
.physical-health-section #activityNote {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

/* Dietary Pattern Assessment UI refresh: preserves existing fields and calculations. */
.dietary-assessment-shell {
  position: relative;
  display: block;
  grid-template-columns: none;
  gap: 0;
}

.dietary-assessment-box {
  position: relative;
  gap: 16px;
  min-width: 0;
  max-width: 100%;
  overflow: visible;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.dietary-assessment-shell > .dietary-assessment-box {
  width: 100%;
}

.dietary-assessment-shell > .infant-test-panel {
  position: absolute;
  top: -46px;
  right: 0;
  z-index: 7;
  width: auto;
  min-width: 150px;
  box-sizing: border-box;
}

.dietary-assessment-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 14px;
  align-items: end;
  justify-content: stretch;
  min-height: 0;
  padding: 0 34px 0 0;
}

.dietary-assessment-controls .compact-select-label {
  display: grid;
  gap: 6px;
  margin: 0;
}

#dietaryAssessmentPatternLabel,
#infantAssessmentToddlerPatternLabel,
.dietary-recommended-pattern-label,
.dietary-prescription-calorie-label {
  order: initial;
  margin-right: 0;
}

.dietary-recommend-toggle {
  align-self: center;
  min-height: 36px;
  padding: 7px 12px;
  border: 1px solid #C9DDD8;
  border-radius: 8px;
  background: #EDF6F4;
  color: #1E4D4A;
}

.dietary-summary-header {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: center;
  gap: 14px;
  margin: 0 0 8px;
}

.dietary-summary-header .dietary-recommend-toggle {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  grid-column: 3;
  gap: 8px;
  justify-self: stretch;
  margin: 0;
  width: 100%;
  max-width: none;
  line-height: var(--leading-tight);
  white-space: normal;
}

.dietary-summary-header .dietary-recommend-toggle span {
  min-width: 0;
}

.dietary-summary-header .dietary-summary-title {
  grid-column: 1 / 3;
  margin: 0;
}

.dietary-summary-header .dietary-recommend-toggle input {
  flex: 0 0 auto;
  margin: 0;
}

.dietary-intake-summary-card {
  display: grid;
  gap: 0;
  padding: 16px var(--dietary-card-inline-padding);
  border: 1px solid #C9DDD8;
  border-radius: 10px;
  background: linear-gradient(180deg, #FFFFFF 0%, #F7FBFA 100%);
  box-shadow: 0 8px 18px rgba(30, 77, 74, 0.07);
}

.dietary-summary-title {
  color: #1E2928;
  font-size: var(--type-dietary-subtitle);
  font-weight: 700;
  letter-spacing: var(--tracking-dietary-subtitle);
  line-height: var(--leading-dietary-subtitle);
  margin: 12px 0 8px;
  text-transform: uppercase;
}

.dietary-summary-values {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 12px;
}

.dietary-summary-values > div {
  display: grid;
  gap: 4px;
  align-content: end;
  min-width: 0;
  padding-right: 14px;
  border-right: 1px solid #C9DDD8;
}

.dietary-summary-values > div:last-child {
  border-right: 0;
}

.dietary-summary-values span,
.dietary-summary-comparison-text span {
  color: #637270;
  font-size: var(--type-helper-label);
  font-weight: 700;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
}

.dietary-summary-values output {
  color: #1E2928;
  font-size: var(--type-dietary-display);
  font-weight: 700;
  letter-spacing: var(--tracking-dietary-display);
  line-height: var(--leading-dietary-display);
}

.dietary-summary-comparisons {
  display: grid;
  gap: 8px;
}

.dietary-summary-comparison {
  display: grid;
  gap: 4px;
}

.dietary-summary-comparison-text {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dietary-summary-comparison-text output {
  color: #1E4D4A;
  font-size: var(--type-checkbox-percent);
  font-weight: 650;
  letter-spacing: var(--tracking-checkbox-percent);
  line-height: var(--leading-checkbox-percent);
}

.dietary-summary-bar {
  position: relative;
  height: 10px;
  overflow: hidden;
  border: 0;
  outline: 0;
  border-radius: 999px;
  background: #EDF6F4;
  box-shadow: inset 0 1px 2px rgba(30, 77, 74, 0.08);
  opacity: 1;
}

.dietary-summary-bar > span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: #3F7D79;
  box-shadow: 0 1px 2px rgba(30, 77, 74, 0.10);
  opacity: 1;
  transition: width 180ms ease;
}

.dietary-summary-bar.bar-empty > span,
.dietary-summary-bar > span {
  background: #3F7D79;
}

.dietary-summary-bar.prescription {
  background: #E8F4E9;
}

.dietary-summary-bar.prescription > span {
  background: #78A97D;
}

.dietary-fluid-card {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid #C9DDD8;
  border-radius: 10px;
  background: linear-gradient(180deg, #FFFFFF 0%, #F7FBFA 100%);
  box-shadow: 0 8px 18px rgba(30, 77, 74, 0.07);
}

.dietary-fluid-title {
  margin: 0 0 8px;
}

.dietary-fluid-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 0.28fr);
  gap: 18px;
  align-items: stretch;
}

.dietary-fluid-metrics {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.dietary-fluid-values {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: end;
}

.dietary-fluid-values > div,
.dietary-fluid-values > label {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.dietary-fluid-values > div:not(:last-child),
.dietary-fluid-values > label:not(:last-child) {
  padding-right: 14px;
  border-right: 1px solid #C9DDD8;
}

.dietary-fluid-card span,
.dietary-fluid-card .dietary-summary-comparison-text span,
.dietary-fluid-note-label > span {
  color: #637270;
  font-size: var(--type-helper-label);
  font-weight: 700;
  letter-spacing: var(--tracking-caps);
  line-height: var(--leading-tight);
  text-transform: uppercase;
}

.dietary-fluid-card output:not(.dietary-summary-comparison-text output) {
  color: #1E2928;
  font-size: var(--type-dietary-display);
  font-weight: 700;
  letter-spacing: var(--tracking-dietary-display);
  line-height: var(--leading-dietary-display);
}

.dietary-fluid-card select,
.dietary-fluid-card textarea {
  width: 100%;
  color: #1E2928;
  font-size: var(--type-input);
  font-weight: 550;
  letter-spacing: var(--tracking-body);
}

.dietary-fluid-note-label {
  position: relative;
  display: grid;
  gap: 6px;
}

.dietary-fluid-note-label textarea {
  min-height: 58px;
  resize: vertical;
}

.dietary-fluid-note-label small {
  position: absolute;
  right: 10px;
  bottom: 8px;
  color: #637270;
  font-size: var(--type-helper);
  font-weight: 600;
}

.dietary-fluid-output {
  display: grid;
  align-content: start;
  gap: 18px;
  min-width: 0;
  padding-left: 18px;
  border-left: 1px solid #C9DDD8;
}

.dietary-fluid-output label,
.dietary-fluid-output > div {
  display: grid;
  gap: 6px;
}

.dietary-fluid-output output {
  font-size: var(--type-dietary-display);
}

.dietary-fluid-output small,
.dietary-fluid-output p {
  margin: 0;
  color: #1E4D4A;
  font-size: var(--type-checkbox-percent);
  font-weight: 650;
  letter-spacing: var(--tracking-checkbox-percent);
  line-height: var(--leading-checkbox-percent);
}

.dietary-assessment-table {
  gap: 0;
  max-width: 100%;
  overflow-x: auto;
  padding: 0 0 14px;
  border: 1px solid #8BB7AB;
  border-radius: 10px;
  background: #FFFFFF;
  box-shadow: 0 8px 18px rgba(30, 77, 74, 0.06);
  scrollbar-gutter: stable;
}

.dietary-assessment-head,
.dietary-assessment-category,
.dietary-assessment-table select,
.dietary-assessment-table input,
.dietary-assessment-output {
  min-height: 40px;
  border-color: #C9DDD8;
  border-radius: 0;
  white-space: nowrap;
}

.dietary-assessment-head {
  min-height: 42px;
  padding: 8px 10px;
  background: #EDF6F4;
  color: #637270;
  font-size: var(--type-helper-label);
  font-weight: 700;
  letter-spacing: var(--tracking-caps);
  line-height: var(--leading-tight);
  text-align: center;
  text-transform: uppercase;
  white-space: normal;
}

.dietary-assessment-category {
  justify-content: flex-start;
  padding: 8px 12px;
  border-left: 4px solid #3F7D79;
  background: linear-gradient(90deg, #EDF6F4 0%, #FFFFFF 100%);
  color: #1E2928;
  font-size: var(--type-dietary-card-label);
  font-weight: 750;
  letter-spacing: var(--tracking-dietary-card-label);
  line-height: var(--leading-dietary-card-label);
  text-align: left;
  text-transform: uppercase;
}

.dietary-assessment-output {
  justify-content: center;
  padding: 8px 10px;
  background: #FFFFFF;
  color: #1E2928;
  font-size: var(--type-dietary-requirement-value) !important;
  font-weight: 750;
  letter-spacing: var(--tracking-dietary-requirement-value);
  line-height: var(--leading-dietary-requirement-value);
}

.dietary-assessment-table select,
.dietary-assessment-table input {
  align-self: center;
  margin: 5px 8px;
  width: calc(100% - 16px);
  min-height: 30px;
  border: 1px solid #C9DDD8;
  border-radius: 6px;
  background-color: #FFFFFF;
  color: #1E2928;
  font-size: var(--type-input) !important;
  font-weight: 550;
  letter-spacing: var(--tracking-body);
  line-height: var(--leading-tight);
  text-align: center;
}

.dietary-assessment-table .recommended-column:is(input, select) {
  border-color: #C9DDD8;
  background: #FFFFFF;
}

.dietary-assessment-table .recommended-column:is(.dietary-assessment-head) {
  background: #EDF6F4;
}

.dietary-assessment-table .recommended-column:is(.dietary-assessment-output) {
  background: #FFFFFF;
}

.standard-assessment-table {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  max-width: 100%;
  overflow-x: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.standard-assessment-table::before {
  content: none;
}

.standard-assessment-table.recommended-active {
  grid-template-columns: 1fr;
}

.dietary-assessment-card-labels {
  position: relative;
  display: grid;
  grid-template-columns:
    minmax(126px, 0.75fr)
    repeat(2, minmax(0, 0.85fr))
    minmax(0, 2fr);
  gap: 14px;
  align-items: end;
  max-width: 100%;
  overflow: visible;
  padding: 0 14px;
  color: #637270;
  font-size: var(--type-helper-label);
  font-weight: 700;
  letter-spacing: var(--tracking-caps);
  line-height: var(--leading-tight);
  text-transform: uppercase;
  z-index: 1;
}

.dietary-assessment-card-labels:has(.recommended-column:not([hidden])) {
  grid-template-columns:
    minmax(126px, 0.7fr)
    repeat(3, minmax(0, 0.78fr))
    minmax(0, 2.05fr);
}

.standard-assessment-table .dietary-assessment-category {
  position: relative;
  display: grid;
  align-content: center;
  min-height: 0;
  padding: 0 12px 0 30px;
  border: 0;
  background: transparent;
  color: #1E2928;
  font-size: var(--type-dietary-card-label);
  font-weight: 750;
  line-height: var(--leading-dietary-card-label);
  text-align: left;
  letter-spacing: var(--tracking-dietary-card-label);
}

.dietary-assessment-row-card {
  position: relative;
  display: grid;
  grid-template-columns:
    minmax(126px, 0.75fr)
    repeat(2, minmax(0, 0.85fr))
    minmax(0, 2fr);
  gap: 14px;
  align-items: center;
  min-width: 0;
  max-width: 100%;
  padding: 12px var(--dietary-card-inline-padding);
  border: 1px solid #C9DDD8;
  border-radius: 8px;
  background: #FFFFFF;
  box-shadow: 0 6px 16px rgba(30, 77, 74, 0.08);
  overflow: hidden;
  z-index: 1;
}

.dietary-assessment-row-card::before {
  content: none;
}

.standard-assessment-table.recommended-active .dietary-assessment-row-card {
  grid-template-columns:
    minmax(126px, 0.7fr)
    repeat(3, minmax(0, 0.78fr))
    minmax(0, 2.05fr);
}

.dietary-assessment-row-field,
.dietary-comparison-cell {
  display: grid;
  gap: 5px;
  min-width: 0;
  margin: 0;
}

.dietary-assessment-card-labels > *,
.dietary-assessment-row-card > *,
.standard-assessment-table :is(select, input, output) {
  min-width: 0;
}

.dietary-assessment-row-card > * {
  position: relative;
  z-index: 1;
}

.standard-assessment-table .recommended-column {
  background-color: transparent;
}

.dietary-assessment-row-field > span,
.dietary-comparison-cell > span {
  color: #637270;
  font-size: var(--type-helper-label);
  font-weight: 700;
  letter-spacing: var(--tracking-caps);
  line-height: 1;
  text-transform: uppercase;
}

.standard-assessment-table .dietary-assessment-row-field > span {
  display: none;
}

.dietary-assessment-row-field small {
  color: #637270;
  font-size: var(--type-helper);
  font-weight: 600;
  letter-spacing: var(--tracking-body);
  text-transform: none;
}

.dietary-prescription-input-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  width: var(--dietary-amount-control-width);
  max-width: 100%;
  min-width: 0;
  min-height: 34px;
  border: 1px solid #C9DDD8;
  border-radius: 6px;
  background: #FFFFFF;
  padding: 0;
}

.dietary-row-unit {
  color: #1E2928;
  font-size: var(--type-input);
  font-weight: 550;
  letter-spacing: var(--tracking-body);
  line-height: var(--leading-tight);
  white-space: nowrap;
}

.standard-assessment-table .dietary-assessment-row-field select {
  font-size: var(--type-input) !important;
  font-weight: 550;
}

.standard-assessment-table .dietary-assessment-row-field > select:focus,
.standard-assessment-table .dietary-assessment-row-field > select:focus-visible {
  border-color: #3F7D79;
  outline: 3px solid #EDF6F4;
  outline-offset: 1px;
  box-shadow: 0 0 0 3px #EDF6F4;
}

.standard-assessment-table .dietary-prescription-input-wrap :is(input, select) {
  min-height: 32px;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: #1E2928;
  font-size: var(--type-input) !important;
  font-weight: 550;
  padding: 7px 6px;
}

.standard-assessment-table .dietary-prescription-input-wrap :is(input, select):focus {
  outline: 0;
  box-shadow: none;
}

.dietary-prescription-input-wrap:focus-within {
  border-color: #3F7D79;
  outline: 3px solid #EDF6F4;
  outline-offset: 1px;
  box-shadow: 0 0 0 3px #EDF6F4;
}

.standard-assessment-table .dietary-assessment-output:not(.dietary-assessment-bar-output) {
  min-height: 34px;
  align-items: center;
  justify-content: flex-start;
  padding: 0 6px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #1E2928;
  font-size: var(--type-dietary-requirement-value) !important;
  font-weight: 750;
}

.standard-assessment-table :is(select, input) {
  margin: 0;
  min-height: 34px;
  text-align: left;
  padding-left: 6px;
  padding-right: 8px;
}

.standard-assessment-table select {
  width: var(--dietary-amount-control-width);
  max-width: 100%;
  padding-left: 6px;
  padding-right: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.standard-assessment-table select option {
  color: #1E2928;
  font-size: var(--type-input);
  font-weight: 550;
  letter-spacing: var(--tracking-body);
  line-height: var(--leading-tight);
  padding-left: 6px;
  padding-right: 8px;
  white-space: nowrap !important;
}

.standard-assessment-table .dietary-prescription-input-wrap :is(input, select) {
  padding-left: 6px;
  padding-right: 8px;
}

.standard-assessment-table .dietary-prescription-input-wrap select {
  width: var(--dietary-amount-control-width);
  max-width: 100%;
  padding-left: 6px;
  padding-right: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.standard-assessment-table .dietary-assessment-output:not(.dietary-assessment-bar-output) {
  font-size: var(--type-dietary-requirement-value) !important;
  font-weight: 750;
}

.standard-assessment-table output[id^="dietaryAssessmentRequired"]:not(.dietary-assessment-bar-output) {
  justify-self: start;
  width: max-content;
  max-width: 100%;
  padding-left: 14px;
  padding-right: 0;
  white-space: nowrap;
}

.dietary-comparison-cell {
  grid-template-columns: 1fr;
  row-gap: 4px;
  margin-left: 6px;
  padding-left: 12px;
  border-left: 0;
}

.dietary-comparison-cell > span {
  font-size: var(--type-helper-label);
  overflow-wrap: anywhere;
  white-space: normal;
}

.dietary-assessment-bar-output + span {
  margin-top: 4px;
}

.dietary-comparison-cell .recommended-column[hidden],
.dietary-comparison-pair[hidden] {
  display: none !important;
}

.dietary-assessment-bar-output {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  min-height: 26px;
  width: 100%;
  padding: 0 0 0 10px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #1E4D4A;
  font-size: var(--type-view-settings) !important;
  font-weight: 650;
  line-height: var(--leading-view-settings);
  letter-spacing: var(--tracking-view-settings);
  text-align: right;
  text-shadow: none;
}

.dietary-assessment-bar-output::before,
.dietary-assessment-bar-output::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 10px;
  border-radius: 999px;
  border: 0;
  pointer-events: none;
  opacity: 1;
}

.dietary-assessment-bar-output::before {
  right: 0;
  width: auto;
  background: #EDF6F4;
  box-shadow: inset 0 1px 2px rgba(30, 77, 74, 0.08);
}

.dietary-assessment-bar-output::after {
  width: calc(var(--bar-ratio, 0) * 100%);
  background: #3F7D79;
  box-shadow: 0 1px 2px rgba(30, 77, 74, 0.10);
  transition: width 180ms ease;
}

.dietary-assessment-bar-output.prescription-bar::before {
  background: #E8F4E9;
}

.dietary-assessment-bar-output.prescription-bar::after {
  background: #78A97D;
}

.dietary-assessment-bar-output.bar-empty::after {
  width: 0;
}

.dietary-comparison-pair {
  position: relative;
  display: grid;
  min-height: 34px;
  min-width: 0;
}

.dietary-comparison-pair > span {
  grid-area: 1 / 1;
  z-index: 1;
  min-width: 0;
  padding-right: 54px;
  color: #637270;
  font-size: var(--type-helper-label);
  font-weight: 700;
  letter-spacing: var(--tracking-caps);
  line-height: var(--leading-tight);
  overflow-wrap: anywhere;
  text-transform: uppercase;
  white-space: normal;
}

.dietary-comparison-pair > .dietary-assessment-bar-output {
  grid-area: 1 / 1;
  min-height: 34px;
  padding-left: 0;
}

.dietary-assessment-help {
  top: 12px;
  right: 12px;
}

@media (max-width: 980px) {
  .dietary-assessment-shell {
    grid-template-columns: 1fr;
  }

  .dietary-assessment-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding-right: 34px;
  }

  .dietary-summary-values {
    grid-template-columns: 1fr;
  }

  .dietary-summary-values > div {
    padding-right: 0;
    padding-bottom: 10px;
    border-right: 0;
    border-bottom: 1px solid #C9DDD8;
  }
}

@media (max-width: 640px) {
  .dietary-assessment-controls {
    grid-template-columns: 1fr;
  }
}

/* Dietary Assessment layout: shared summary and food-group column rules. */
.dietary-assessment-box {
  --dietary-card-inline-padding: 14px;
  --dietary-food-column: minmax(126px, 0.48fr);
  --dietary-intake-column: minmax(88px, 0.45fr);
  --dietary-amount-control-width: 100px;
  --dietary-standard-comparison-column: minmax(260px, 33.333%);
  --dietary-prescription-comparison-column: minmax(260px, 33.333%);
  --dietary-standard-columns:
    var(--dietary-food-column)
    repeat(2, var(--dietary-intake-column))
    var(--dietary-standard-comparison-column);
  --dietary-prescription-columns:
    var(--dietary-food-column)
    repeat(3, var(--dietary-intake-column))
    var(--dietary-prescription-comparison-column);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 14px;
  min-width: 0;
}

.dietary-assessment-controls {
  display: contents;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.dietary-assessment-controls .compact-select-label {
  grid-column: 1;
  align-self: start;
}

.dietary-control-group-label {
  grid-column: 1;
  grid-row: 1;
  align-self: end;
  margin: 12px 0 8px;
  color: #1E4D4A;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.015em;
  line-height: 1;
  text-transform: uppercase;
}

.dietary-prescribed-intake-label {
  grid-column: 2;
  justify-self: end;
  width: 100%;
  max-width: 520px;
  text-align: left;
}

.dietary-assessment-controls #dietaryAssessmentPatternLabel,
.dietary-assessment-controls #infantAssessmentToddlerPatternLabel {
  grid-column: 1;
  grid-row: 2;
}

.dietary-assessment-controls #dietaryAssessmentPatternLabel,
.dietary-assessment-controls .dietary-summary-pattern-label {
  min-width: 0;
  width: 100%;
  max-width: 520px;
}

.dietary-assessment-controls #dietaryAssessmentPatternLabel select,
.dietary-assessment-controls .dietary-summary-pattern-label select {
  width: 100%;
}

.dietary-assessment-controls .dietary-estimated-calorie-label {
  grid-column: 1;
  grid-row: 3;
}

.dietary-assessment-controls .dietary-recommend-toggle {
  grid-column: 2;
  grid-row: 3;
  align-self: end;
  justify-self: center;
}

.dietary-assessment-controls .dietary-summary-pattern-label {
  grid-column: 2;
  grid-row: 2;
  justify-self: end;
}

.dietary-assessment-controls .dietary-prescription-calorie-label {
  grid-column: 2;
  grid-row: 3;
  justify-self: end;
}

.dietary-assessment-controls .dietary-estimated-calorie-label,
.dietary-assessment-controls .dietary-prescription-calorie-label {
  width: 100%;
  max-width: 520px;
}

.dietary-assessment-help {
  grid-column: 2;
  grid-row: 1;
  align-self: start;
  justify-self: end;
  position: static;
  z-index: 2;
}

.dietary-intake-summary-card {
  position: relative;
}

.dietary-assessment-controls .dietary-assessment-help-text {
  top: 30px;
  right: 0;
  width: 75%;
  max-width: calc(100% - 16px);
}

.dietary-summary-control-row {
  display: contents;
}

.dietary-summary-control-row > span {
  display: none;
}

.dietary-summary-control-row .dietary-recommend-toggle {
  grid-column: 2;
  align-self: start;
}

.dietary-summary-control-row .dietary-summary-pattern-label {
  grid-column: 3;
  align-self: start;
}

.dietary-recommend-toggle {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid #C9DDD8;
  border-radius: 8px;
  background: #EDF6F4;
  color: #1E4D4A;
  white-space: normal;
}

.dietary-recommend-toggle input {
  flex: 0 0 auto;
  margin: 0;
}

.dietary-estimated-calorie-label {
  display: grid;
  gap: 6px;
  margin: 0;
  color: #1E2928;
  font-size: var(--type-field-label);
  font-weight: 650;
  letter-spacing: var(--tracking-field-label);
  line-height: var(--leading-helper);
}

.dietary-estimated-calorie-label select {
  width: 100%;
  min-width: 0;
}

.dietary-prescription-calorie-label {
  display: grid;
  gap: 6px;
  margin: 0;
  color: #1E2928;
  font-size: var(--type-field-label);
  font-weight: 650;
  letter-spacing: var(--tracking-field-label);
  line-height: var(--leading-helper);
}

.dietary-prescription-calorie-label select {
  width: 100%;
  min-width: 0;
}

.dietary-estimated-calorie-label select,
.dietary-prescription-calorie-label select,
.dietary-assessment-table .recommended-calorie-select {
  color: #1E2928;
  font-size: var(--type-input) !important;
  font-weight: 550 !important;
  letter-spacing: var(--tracking-body);
  line-height: var(--leading-tight);
}

#dietaryAssessmentEstimatedCalories.placeholder-active {
  color: #637270;
  font-size: var(--type-placeholder) !important;
  font-style: italic;
  font-weight: 450 !important;
  letter-spacing: var(--tracking-placeholder);
  line-height: var(--leading-placeholder);
}

.dietary-summary-pattern-label {
  display: grid;
  gap: 6px;
  margin: 0;
  color: #1E2928;
  font-size: var(--type-field-label);
  font-weight: 650;
  letter-spacing: var(--tracking-field-label);
  line-height: var(--leading-helper);
}

.dietary-summary-values {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  min-height: 74px;
}

.dietary-summary-values > div {
  position: relative;
  align-content: end;
  border-right: 0;
  row-gap: 2px;
}

.dietary-summary-values > div:not(:last-child)::after {
  content: "";
  position: absolute;
  right: 0;
  top: 60%;
  height: 50px;
  transform: translateY(-50%);
  border-right: 1px solid #C9DDD8;
}

.dietary-summary-values > div:nth-child(1) {
  grid-column: auto;
}

.dietary-summary-values > div:nth-child(2) {
  grid-column: auto;
  grid-template-rows: auto auto;
  align-content: end;
  row-gap: 2px;
}

.dietary-summary-values > div:nth-child(3) {
  grid-column: auto;
  padding-right: 0;
}

.dietary-summary-values > div:nth-child(3) .dietary-prescription-calorie-label {
  width: 100%;
}

.dietary-summary-title {
  color: #1E4D4A;
  font-size: var(--type-dietary-subtitle);
  font-weight: 700;
  letter-spacing: var(--tracking-dietary-subtitle);
  line-height: var(--leading-dietary-subtitle);
  margin: 12px 0 8px;
  text-transform: uppercase;
}

.dietary-summary-title-outside {
  grid-column: 1 / -1;
  grid-row: auto;
  align-self: start;
  justify-self: start;
  margin: 12px 0 8px;
  font-size: var(--type-dietary-subtitle);
  text-align: left;
}

.dietary-intake-summary-card .dietary-summary-values output {
  font-size: var(--type-dietary-display);
}

.dietary-intake-summary-card,
.dietary-assessment-card-labels,
.standard-assessment-table,
#dietaryAssessmentInfantTable {
  grid-column: 1 / -1;
}

#dietaryAssessmentInfantTable:not([hidden]) {
  position: absolute;
  z-index: 8;
  top: 124px;
  right: 0;
  left: 0;
  width: auto;
  max-width: none;
  background: #FFFFFF;
  box-shadow: 0 14px 28px rgba(30, 77, 74, 0.16);
}

@media (max-width: 1180px) {
  .dietary-assessment-shell > .infant-test-panel {
    position: static;
    width: max-content;
    max-width: 100%;
    margin-bottom: 8px;
  }

  #dietaryAssessmentInfantTable:not([hidden]) {
    top: 168px;
  }
}

.dietary-summary-values > div:nth-child(2) span:not(.dietary-summary-title) {
  align-self: end;
}

.dietary-summary-comparison-text output,
.dietary-assessment-bar-output {
  color: #1E4D4A;
  font-size: var(--type-checkbox-percent) !important;
  font-weight: 650;
  line-height: var(--leading-checkbox-percent);
  letter-spacing: var(--tracking-checkbox-percent);
}

.dietary-assessment-card-labels {
  width: 100%;
  box-sizing: border-box;
  grid-template-columns: var(--dietary-standard-columns);
}

.dietary-assessment-card-labels:has(.recommended-column:not([hidden])) {
  grid-template-columns: var(--dietary-prescription-columns);
}

.dietary-assessment-card-labels > :last-child {
  box-sizing: border-box;
  padding-left: 19px;
}

.standard-assessment-table {
  width: 100%;
  box-sizing: border-box;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-gutter: auto;
}

.dietary-assessment-card-labels,
.dietary-assessment-row-card {
  width: max(100%, 600px);
  max-width: none;
  min-width: 0;
  gap: 8px;
}

.dietary-assessment-card-labels:has(.recommended-column:not([hidden])),
.standard-assessment-table.recommended-active .dietary-assessment-row-card {
  width: max(100%, 744px);
}

.dietary-assessment-row-card {
  box-sizing: border-box;
  grid-template-columns: var(--dietary-standard-columns);
}

.dietary-assessment-row-card::after {
  content: "";
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: calc(var(--dietary-card-inline-padding) + ((100% - (2 * var(--dietary-card-inline-padding))) * 0.66667) - 4.667px);
  border-left: 1px solid #C9DDD8;
  pointer-events: none;
}

.standard-assessment-table.recommended-active .dietary-assessment-row-card {
  grid-template-columns: var(--dietary-prescription-columns);
}

.standard-assessment-table .dietary-assessment-category {
  padding: 0 4px 0 0;
  font-size: var(--type-dietary-card-label);
  font-weight: 750;
  letter-spacing: var(--tracking-dietary-card-label);
  line-height: var(--leading-dietary-card-label);
  justify-items: start;
  text-align: left;
  white-space: normal;
  overflow: hidden;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
  text-overflow: clip;
}

.dietary-comparison-cell {
  align-self: center;
  align-content: center;
  justify-self: stretch;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding-right: 6px;
}

.dietary-comparison-cell > span {
  line-height: 1.05;
}

.dietary-assessment-bar-output + span {
  margin-top: 6px;
}

.dietary-comparison-pair {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto 10px;
  column-gap: 8px;
  row-gap: 4px;
  min-height: 0;
  align-items: end;
}

.dietary-comparison-pair > span {
  grid-area: 1 / 1;
  min-width: 0;
  padding-right: 0;
  line-height: var(--leading-tight);
  overflow-wrap: normal;
  word-break: normal;
  hyphens: manual;
  white-space: normal;
}

.dietary-comparison-pair > .dietary-assessment-bar-output {
  grid-area: 1 / 2;
  display: block;
  width: auto;
  height: auto;
  min-height: 0;
  align-items: end;
  justify-content: flex-end;
  justify-self: end;
  line-height: 1;
  padding: 0;
  pointer-events: none;
  white-space: nowrap;
}

.dietary-comparison-pair > .dietary-assessment-bar-output::before,
.dietary-comparison-pair > .dietary-assessment-bar-output::after {
  content: none;
}

.dietary-calorie-row-card {
  position: relative;
  display: grid;
  grid-template-columns: var(--dietary-standard-columns);
  align-items: center;
  gap: 8px;
  width: max(100%, 600px);
  max-width: none;
  min-width: 0;
  box-sizing: border-box;
  padding: 14px var(--dietary-card-inline-padding);
}

.dietary-calorie-row-card:has(.dietary-summary-prescription:not([hidden])) {
  grid-template-columns: var(--dietary-prescription-columns);
  width: max(100%, 744px);
}

.dietary-calorie-row-card::after {
  content: "";
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: calc(var(--dietary-card-inline-padding) + ((100% - (2 * var(--dietary-card-inline-padding))) * 0.66667) - 4.667px);
  border-left: 1px solid #C9DDD8;
  pointer-events: none;
}

.dietary-calorie-row-card .dietary-summary-title {
  align-self: center;
  justify-self: start;
  margin: 0;
  min-width: 0;
  line-height: 1;
}

.dietary-calorie-row-card .dietary-calorie-category {
  position: relative;
  display: grid;
  align-content: center;
  min-height: 0;
  padding: 0 4px 0 0;
  border: 0;
  background: transparent;
  color: #1E2928;
  font-size: var(--type-dietary-card-label);
  font-weight: 750;
  letter-spacing: var(--tracking-dietary-card-label);
  line-height: var(--leading-dietary-card-label);
  text-align: left;
  text-transform: uppercase;
  white-space: normal;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
}

.dietary-calorie-row-card .dietary-summary-value {
  display: grid;
  grid-template-rows: auto auto;
  align-self: stretch;
  align-content: center;
  gap: 2px;
  min-width: 0;
}

.dietary-calorie-row-card .dietary-summary-value span {
  color: #637270;
  font-size: var(--type-helper-label);
  font-weight: 700;
  letter-spacing: var(--tracking-caps);
  line-height: var(--leading-tight);
  text-transform: uppercase;
}

.dietary-calorie-row-card .dietary-summary-value output {
  display: block;
  color: #1E2928;
  font-size: var(--type-dietary-display);
  font-weight: 700;
  letter-spacing: var(--tracking-dietary-display);
  line-height: var(--leading-dietary-display);
  white-space: nowrap;
}

.dietary-calorie-row-card .dietary-summary-comparisons {
  display: grid;
  align-content: center;
  gap: 6px;
  justify-self: stretch;
  min-width: 0;
  padding-left: 14px;
  padding-right: 6px;
}

.dietary-calorie-row-card .dietary-recommend-toggle {
  width: 100%;
  max-width: none;
  margin: 0 0 4px;
}

.dietary-calorie-row-card .dietary-summary-comparison {
  gap: 4px;
}

.dietary-calorie-row-card .dietary-summary-comparison-text {
  gap: 8px;
}

.standard-assessment-table > .dietary-assessment-card-labels {
  display: none;
}

.dietary-comparison-pair::before,
.dietary-comparison-pair::after {
  content: "";
  grid-area: 2 / 1 / 3 / 3;
  display: block;
  height: 10px;
  border: 0;
  border-radius: 999px;
  pointer-events: none;
}

.dietary-comparison-pair::before {
  background: #EDF6F4;
  box-shadow: inset 0 1px 2px rgba(30, 77, 74, 0.08);
}

.dietary-comparison-pair::after {
  width: calc(var(--bar-ratio, 0) * 100%);
  max-width: 100%;
  justify-self: start;
  background: #3F7D79;
  box-shadow: 0 1px 2px rgba(30, 77, 74, 0.10);
  transition: width 180ms ease;
}

.dietary-comparison-pair:has(.prescription-bar)::before {
  background: #E8F4E9;
}

.dietary-comparison-pair:has(.prescription-bar)::after {
  background: #78A97D;
}

/* Dietary Assessment typography schema. */
.dietary-assessment-box :is(
  .compact-select-label,
  .dietary-estimated-calorie-label,
  .dietary-prescription-calorie-label,
  .dietary-summary-pattern-label
) {
  color: #1E2928;
  font-size: var(--type-field-label);
  font-weight: 650;
  letter-spacing: var(--tracking-field-label);
  line-height: var(--leading-helper);
}

.dietary-assessment-box :is(select, input) {
  color: #1E2928;
  font-size: var(--type-input) !important;
  font-weight: 550;
  letter-spacing: var(--tracking-body);
  line-height: var(--leading-tight);
  text-transform: none;
}

.dietary-assessment-box :is(select, option) {
  text-transform: none;
}

.dietary-assessment-box :is(
  .dietary-summary-values span:not(.dietary-summary-title),
  .dietary-summary-comparison-text span,
  .dietary-assessment-card-labels,
  .dietary-assessment-card-labels > *,
  .dietary-comparison-pair > span
) {
  color: #637270;
  font-size: var(--type-helper-label);
  font-weight: 700;
  letter-spacing: var(--tracking-caps);
  line-height: var(--leading-tight);
  text-transform: uppercase;
}

.dietary-assessment-box .dietary-summary-title {
  color: #1E4D4A;
  font-size: var(--type-dietary-subtitle);
  font-weight: 700;
  letter-spacing: var(--tracking-dietary-subtitle);
  line-height: var(--leading-dietary-subtitle);
  margin: 12px 0 8px;
  text-transform: uppercase;
}

.dietary-assessment-box .dietary-summary-header .dietary-summary-title {
  margin: 0;
}

.dietary-intake-summary-card .dietary-summary-values output {
  color: #1E2928;
  font-size: var(--type-dietary-display);
  font-weight: 700;
  letter-spacing: var(--tracking-dietary-display);
  line-height: var(--leading-dietary-display);
  white-space: nowrap;
}

.standard-assessment-table .dietary-assessment-category {
  color: #1E2928;
  font-size: var(--type-dietary-card-label);
  font-weight: 750;
  letter-spacing: var(--tracking-dietary-card-label);
  line-height: var(--leading-dietary-card-label);
  text-transform: uppercase;
}

.standard-assessment-table .dietary-assessment-row-field select {
  color: #1E2928;
  font-size: var(--type-input) !important;
  font-weight: 550;
  letter-spacing: var(--tracking-body);
  line-height: var(--leading-tight);
}

.standard-assessment-table .dietary-assessment-output:not(.dietary-assessment-bar-output) {
  color: #1E2928;
  font-size: var(--type-dietary-requirement-value) !important;
  font-weight: 750;
  letter-spacing: var(--tracking-dietary-requirement-value);
  line-height: var(--leading-dietary-requirement-value);
}

.standard-assessment-table .dietary-prescription-input-wrap :is(input, select),
.standard-assessment-table .dietary-row-unit {
  color: #1E2928;
  font-size: var(--type-input) !important;
  font-weight: 550;
  letter-spacing: var(--tracking-body);
  line-height: var(--leading-tight);
}

.dietary-assessment-box :is(
  .dietary-summary-comparison-text output,
  .dietary-assessment-bar-output,
  .dietary-recommend-toggle span
) {
  color: #1E4D4A;
  font-size: var(--type-checkbox-percent) !important;
  font-weight: 650;
  letter-spacing: var(--tracking-checkbox-percent);
  line-height: var(--leading-checkbox-percent);
}

@media (max-width: 980px) {
  .dietary-assessment-controls {
    display: contents;
  }

  .dietary-summary-control-row {
    display: contents;
  }

  .dietary-summary-control-row > span {
    display: none;
  }
}

@media (max-width: 760px) {
  .standard-assessment-table {
    overflow-x: auto;
  }

  .dietary-fluid-main,
  .dietary-fluid-values {
    grid-template-columns: 1fr;
  }

  .dietary-fluid-values > div:not(:last-child),
  .dietary-fluid-values > label:not(:last-child),
  .dietary-fluid-output {
    padding-right: 0;
    padding-left: 0;
    border-right: 0;
    border-left: 0;
  }

  .dietary-summary-control-row {
    display: contents;
  }

  .dietary-summary-control-row > span {
    display: none;
  }

  .dietary-assessment-box {
    grid-template-columns: 1fr;
  }

  .dietary-assessment-controls .compact-select-label,
  .dietary-assessment-controls .dietary-control-group-label,
  .dietary-assessment-controls #dietaryAssessmentPatternLabel,
  .dietary-assessment-controls #infantAssessmentToddlerPatternLabel,
  .dietary-assessment-controls .dietary-estimated-calorie-label,
  .dietary-assessment-controls .dietary-recommend-toggle,
  .dietary-assessment-controls .dietary-summary-pattern-label,
  .dietary-assessment-controls .dietary-prescription-calorie-label,
  .dietary-summary-control-row .dietary-recommend-toggle,
  .dietary-summary-control-row .dietary-summary-pattern-label {
    grid-column: 1;
    grid-row: auto;
    justify-self: stretch;
  }
}

@media (max-width: 760px) {
  .dietary-assessment-card-labels,
  .dietary-assessment-row-card {
    gap: 10px;
  }

  .dietary-assessment-card-labels,
  .standard-assessment-table:not(.recommended-active) .dietary-assessment-row-card {
    grid-template-columns: var(--dietary-standard-columns);
  }

  .dietary-assessment-card-labels:has(.recommended-column:not([hidden])),
  .standard-assessment-table.recommended-active .dietary-assessment-row-card {
    grid-template-columns: var(--dietary-prescription-columns);
  }

  .standard-assessment-table .dietary-assessment-category {
    padding-left: 0;
    font-size: var(--type-dietary-card-label);
  }
}

.physical-health-section .activity-entry {
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  gap: 10px 12px;
  width: 100%;
  min-width: 0;
}

.physical-health-section .activity-entry label:first-child {
  grid-column: span 2;
}

.physical-health-section .activity-entry :is(input, select) {
  width: 100%;
  min-width: 0;
}

.physical-health-section .activity-entry .small-button {
  justify-self: stretch;
  width: 100%;
  min-width: 0;
}

@media (max-width: 760px) {
  .physical-health-section .field-grid.three {
    grid-template-columns: 1fr;
  }

  .physical-health-section .activity-entry,
  .physical-health-section .activity-entry label:first-child {
    grid-template-columns: 1fr;
    grid-column: auto;
  }
}

.dietary-comparison-scroll {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
  width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  padding-bottom: 8px;
  scrollbar-gutter: auto;
}

.dietary-comparison-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: max(100%, 600px);
  box-sizing: border-box;
}

.dietary-comparison-scroll:has(.standard-assessment-table.recommended-active) > .dietary-comparison-section-header,
.dietary-comparison-scroll:has(.standard-assessment-table.recommended-active) > .dietary-summary-title-outside,
.dietary-comparison-scroll:has(.standard-assessment-table.recommended-active) > .dietary-fluid-card {
  width: max(100%, 744px);
}

.dietary-comparison-section-header .dietary-summary-title {
  margin: 0;
}

.dietary-comparison-section-header .dietary-recommend-toggle {
  flex: 0 1 220px;
  margin: 0;
}

.dietary-calorie-section-header {
  justify-content: flex-end;
  align-items: center;
  margin: 12px 0 8px;
}

.dietary-calorie-section-header .dietary-summary-title {
  flex: 1 1 auto;
  margin: 0;
  text-align: right;
}

.dietary-calorie-section-header > span {
  min-width: 0;
}

.dietary-comparison-scroll > .dietary-summary-title-outside {
  width: max(100%, 600px);
  box-sizing: border-box;
  margin: 12px 0 8px;
  line-height: 1;
  letter-spacing: 0.015em;
}

.dietary-comparison-scroll > .standard-assessment-table {
  width: max(100%, 648px);
  overflow: visible;
  padding-bottom: 0;
}

.dietary-comparison-scroll:has(.standard-assessment-table.recommended-active) > .standard-assessment-table {
  width: max(100%, 820px);
}

.dietary-calorie-row-card {
  container-type: inline-size;
  grid-template-columns: var(--dietary-standard-columns);
}

.dietary-calorie-row-card:has(.dietary-summary-prescription:not([hidden])) {
  grid-template-columns: var(--dietary-prescription-columns);
}

.dietary-assessment-row-card::after,
.dietary-calorie-row-card::after {
  content: none;
}

.dietary-calorie-spacer {
  min-width: 0;
}

.dietary-comparison-cell {
  margin-left: 0;
  padding-left: 14px;
  border-left: 1px solid #C9DDD8;
}

.dietary-calorie-row-card .dietary-summary-comparisons {
  padding-left: 14px;
  border-left: 1px solid #C9DDD8;
}

.dietary-fluid-title-outside {
  margin: 12px 0 8px;
}

.dietary-fluid-card {
  width: max(100%, 600px);
  max-width: none;
  container-type: inline-size;
  box-sizing: border-box;
  gap: 14px;
  padding: 16px;
  overflow: hidden;
}

.dietary-comparison-scroll:has(.standard-assessment-table.recommended-active) > .dietary-fluid-title-outside,
.dietary-comparison-scroll:has(.standard-assessment-table.recommended-active) > .dietary-fluid-card {
  width: max(100%, 744px);
}

.dietary-fluid-main {
  grid-template-columns: minmax(0, 1fr) minmax(170px, 0.28fr);
  gap: 18px;
  min-width: 0;
}

.dietary-fluid-metrics {
  gap: 14px;
}

.dietary-fluid-values {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.dietary-fluid-values > div,
.dietary-fluid-values > label {
  align-content: end;
}

.dietary-fluid-values > div:not(:last-child),
.dietary-fluid-values > label:not(:last-child) {
  padding-right: 16px;
}

.dietary-fluid-values output {
  white-space: nowrap;
}

.dietary-fluid-comparisons {
  gap: 10px;
  padding-top: 2px;
}

.dietary-fluid-note-label {
  padding-top: 12px;
  border-top: 1px solid #C9DDD8;
}

.dietary-fluid-note-label textarea {
  min-height: 62px;
}

.dietary-fluid-output {
  gap: 18px;
  padding-left: 18px;
}

.dietary-fluid-output output {
  max-width: 100%;
  white-space: normal;
}

.dietary-fluid-output p {
  padding: 8px 10px;
  border: 1px solid #C9DDD8;
  border-radius: 6px;
  background: #F7FBFA;
}

@media (max-width: 760px) {
  .dietary-fluid-main,
  .dietary-fluid-values {
    grid-template-columns: 1fr;
  }
}

.dietary-fluid-entry-card,
.dietary-fluid-card {
  width: max(100%, 744px);
  box-sizing: border-box;
  border: 1px solid #C9DDD8;
  border-radius: 8px;
  background: #FFFFFF;
  box-shadow: 0 4px 14px rgba(30, 77, 74, 0.08);
}

.dietary-fluid-entry-card {
  display: grid;
  gap: 22px;
  margin-top: 12px;
  padding: 22px 24px 20px;
}

.dietary-fluid-entry-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 24px;
}

.dietary-fluid-entry-title {
  color: #1E4D4A;
  font-size: var(--type-dietary-subtitle);
  font-weight: 700;
  letter-spacing: var(--tracking-dietary-subtitle);
  line-height: var(--leading-dietary-subtitle);
  text-transform: uppercase;
}

.dietary-fluid-entry-header p {
  margin: 10px 0 0;
  color: #637270;
  font-size: var(--type-helper);
  font-weight: 600;
  letter-spacing: var(--tracking-body);
  line-height: var(--leading-helper);
}

.dietary-fluid-compare-toggle {
  display: inline-grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-width: 230px;
  max-width: 300px;
  padding: 14px 16px;
  border: 1px solid #C9DDD8;
  border-radius: 6px;
  background: #F7FBFA;
  color: #1E4D4A;
  font-size: var(--type-checkbox-percent);
  font-weight: 650;
  letter-spacing: var(--tracking-checkbox-percent);
  line-height: var(--leading-checkbox-percent);
}

.dietary-fluid-compare-toggle input {
  width: 20px;
  height: 20px;
  accent-color: #1E4D4A;
}

.dietary-fluid-entry-grid {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) minmax(190px, 1fr) minmax(240px, 1.08fr);
  gap: 24px;
  align-items: start;
}

.dietary-fluid-entry-group {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.dietary-fluid-entry-group:not(:last-child) {
  padding-right: 24px;
  border-right: 1px solid #C9DDD8;
}

.dietary-fluid-entry-group > span,
.dietary-fluid-card span,
.dietary-fluid-note-label > span {
  color: #1E4D4A;
  font-size: var(--type-helper-label);
  font-weight: 700;
  letter-spacing: var(--tracking-caps);
  line-height: var(--leading-tight);
  text-transform: uppercase;
}

.dietary-fluid-entry-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(130px, 0.85fr);
  gap: 10px;
}

.dietary-fluid-entry-group:nth-child(2) .dietary-fluid-entry-controls {
  grid-template-columns: minmax(0, 1fr);
}

.dietary-fluid-entry-card input,
.dietary-fluid-entry-card select,
.dietary-fluid-card select {
  width: 100%;
  min-height: 40px;
  color: #1E2928;
  font-size: var(--type-input);
  font-weight: 550;
  letter-spacing: var(--tracking-body);
  line-height: var(--leading-tight);
}

.dietary-fluid-entry-group small,
.dietary-fluid-values small,
.dietary-fluid-values p,
.dietary-fluid-output p,
.dietary-fluid-tip {
  margin: 0;
  color: #637270;
  font-size: var(--type-helper);
  font-weight: 600;
  letter-spacing: var(--tracking-body);
  line-height: var(--leading-helper);
}

.dietary-fluid-format-row {
  display: grid;
  gap: 8px;
  align-self: center;
  min-width: 0;
}

.dietary-fluid-format-row button {
  display: inline-grid;
  grid-template-columns: 16px auto;
  align-items: center;
  justify-content: start;
  gap: 8px;
  min-height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #1E2928;
  font-size: var(--type-field-label);
  font-weight: 650;
  letter-spacing: var(--tracking-field-label);
  line-height: var(--leading-helper);
  text-align: left;
}

.dietary-fluid-format-row .format-selector-dot {
  display: block;
  width: 12px;
  height: 12px;
  border: 2px solid #8BB7AB;
  border-radius: 50%;
  background: #FFFFFF;
  box-sizing: border-box;
}

.dietary-fluid-format-row button.active .format-selector-dot {
  border-color: #1E4D4A;
  box-shadow: inset 0 0 0 3px #FFFFFF;
  background: #1E4D4A;
}

.dietary-fluid-title-outside {
  width: max(100%, 744px);
  margin: 12px 0 8px;
  box-sizing: border-box;
}

.dietary-fluid-card {
  display: grid;
  gap: 18px;
  padding: 22px 24px;
  overflow: hidden;
}

.dietary-fluid-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.32fr);
  gap: 24px;
  align-items: stretch;
  min-width: 0;
}

.dietary-fluid-metrics {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.dietary-fluid-values {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}

.dietary-fluid-values > div {
  display: grid;
  gap: 7px;
  min-width: 0;
  text-align: center;
}

.dietary-fluid-values > div:not(:last-child) {
  padding-right: 18px;
  border-right: 1px solid #C9DDD8;
}

.dietary-fluid-card output:not(.dietary-summary-comparison-text output) {
  color: #1E2928;
  font-size: var(--type-dietary-display);
  font-weight: 700;
  letter-spacing: var(--tracking-dietary-display);
  line-height: var(--leading-dietary-display);
  white-space: nowrap;
}

.dietary-fluid-comparisons {
  display: grid;
  gap: 16px;
}

.dietary-fluid-comparisons .dietary-summary-comparison-text span {
  color: #637270;
  font-size: var(--type-helper-label);
  font-weight: 700;
  letter-spacing: var(--tracking-caps);
  line-height: var(--leading-tight);
  text-transform: uppercase;
}

.dietary-fluid-comparisons .dietary-summary-comparison-text output {
  color: #1E4D4A;
  font-size: var(--type-view-settings);
  font-weight: 650;
}

.dietary-fluid-output {
  display: grid;
  align-content: start;
  gap: 18px;
  min-width: 0;
  padding-left: 24px;
  border-left: 1px solid #C9DDD8;
}

.dietary-fluid-output > span {
  align-self: start;
}

.dietary-fluid-output > div {
  display: grid;
  gap: 8px;
}

.dietary-fluid-output output {
  font-size: var(--type-dietary-display);
  white-space: normal;
}

.dietary-fluid-output small {
  color: #1E4D4A;
  font-size: var(--type-view-settings);
  font-weight: 650;
  letter-spacing: var(--tracking-view-settings);
  line-height: var(--leading-view-settings);
}

.dietary-fluid-output p {
  padding: 0;
  border: 0;
  background: transparent;
}

.dietary-fluid-note-label {
  position: relative;
  display: grid;
  gap: 8px;
  padding-top: 18px;
  border-top: 1px solid #C9DDD8;
}

.dietary-fluid-note-label textarea {
  width: 100%;
  min-height: 72px;
  resize: vertical;
  color: #1E2928;
  font-size: var(--type-input);
  font-weight: 550;
  letter-spacing: var(--tracking-body);
  line-height: var(--leading-body);
}

.dietary-fluid-note-label small {
  position: absolute;
  right: 10px;
  bottom: 8px;
  color: #637270;
  font-size: var(--type-helper);
  font-weight: 600;
}

.dietary-fluid-tip {
  padding: 12px 14px;
  border: 1px solid #C9DDD8;
  border-radius: 6px;
  background: #F7FBFA;
}

.dietary-comparison-scroll:has(.standard-assessment-table.recommended-active) > .dietary-fluid-entry-card,
.dietary-comparison-scroll:has(.standard-assessment-table.recommended-active) > .dietary-fluid-title-outside,
.dietary-comparison-scroll:has(.standard-assessment-table.recommended-active) > .dietary-fluid-card {
  width: max(100%, 744px);
}

@media (max-width: 760px) {
  .dietary-fluid-entry-header,
  .dietary-fluid-main {
    grid-template-columns: 1fr;
  }

  .dietary-fluid-entry-header {
    display: grid;
  }

  .dietary-fluid-entry-grid,
  .dietary-fluid-values {
    grid-template-columns: 1fr;
  }

  .dietary-fluid-entry-group:not(:last-child),
  .dietary-fluid-values > div:not(:last-child),
  .dietary-fluid-output {
    padding-right: 0;
    padding-left: 0;
    border-right: 0;
    border-left: 0;
  }
}

.dietary-calorie-section-header .dietary-summary-title {
  text-align: left;
}

.dietary-fluid-entry-header {
  justify-content: flex-end;
}

.dietary-fluid-compare-toggle {
  grid-template-columns: auto auto;
  white-space: nowrap;
}

.dietary-fluid-compare-toggle span {
  color: #1E4D4A;
  font-size: var(--type-checkbox-percent);
  font-weight: 650;
  letter-spacing: var(--tracking-checkbox-percent);
  line-height: var(--leading-checkbox-percent);
  text-transform: none;
}

.dietary-fluid-entry-group > span,
.dietary-fluid-card span,
.dietary-fluid-note-label > span {
  color: #637270;
  font-size: var(--type-helper-label);
  font-weight: 700;
  letter-spacing: var(--tracking-caps);
  line-height: var(--leading-tight);
  text-transform: uppercase;
}

.dietary-fluid-card output:not(.dietary-summary-comparison-text output),
.dietary-fluid-output output {
  color: #1E2928;
  font-size: var(--type-dietary-display);
  font-weight: 700;
  letter-spacing: var(--tracking-dietary-display);
  line-height: var(--leading-dietary-display);
}

.dietary-assessment-box {
  --dietary-standard-comparison-column: minmax(230px, 33.333%);
  --dietary-prescription-comparison-column: minmax(230px, 33.333%);
}

.dietary-comparison-section-header .dietary-recommend-toggle,
.dietary-fluid-compare-toggle {
  min-height: 36px;
  padding: 7px 12px;
  border: 1px solid #C9DDD8;
  border-radius: 8px;
  background: #EDF6F4;
  color: #1E4D4A;
  box-sizing: border-box;
}

.dietary-comparison-section-header .dietary-recommend-toggle {
  flex: 0 0 auto;
  max-width: 100%;
  white-space: nowrap;
}

.dietary-comparison-section-header .dietary-recommend-toggle span,
.dietary-fluid-compare-toggle span {
  color: #1E4D4A;
  font-size: var(--type-checkbox-percent) !important;
  font-weight: 650;
  letter-spacing: var(--tracking-checkbox-percent);
  line-height: var(--leading-checkbox-percent);
  white-space: nowrap;
}

.dietary-calorie-section-header {
  align-items: flex-end;
}

.dietary-fluid-note-label > span {
  color: #1E2928;
  font-size: var(--type-field-label);
  font-weight: 650;
  letter-spacing: var(--tracking-field-label);
  line-height: var(--leading-helper);
  text-transform: none;
}

.dietary-fluid-note-label small {
  display: none;
}

.dietary-comparison-scroll:has(.standard-assessment-table.recommended-active) > .standard-assessment-table {
  width: max(100%, 744px);
}

.dietary-calorie-section-header {
  align-items: flex-end;
  margin: 12px 0 -2px;
}

.dietary-fluid-entry-card {
  width: max(100%, 744px);
  display: grid;
  gap: 12px;
  margin-top: 12px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.dietary-fluid-entry-header {
  justify-content: flex-end;
  gap: 0;
}

.dietary-fluid-entry-grid {
  grid-template-columns: minmax(250px, 1.1fr) minmax(220px, 1fr) minmax(280px, 1.05fr);
  gap: 16px;
  align-items: end;
}

.dietary-fluid-entry-group {
  gap: 8px;
}

.dietary-fluid-entry-group:not(:last-child) {
  padding-right: 0;
  border-right: 0;
}

.dietary-fluid-entry-card .dietary-fluid-entry-group > span {
  color: #1E2928;
  font-size: var(--type-field-label);
  font-weight: 650;
  letter-spacing: var(--tracking-field-label);
  line-height: var(--leading-helper);
  text-transform: none;
}

.dietary-fluid-compare-toggle {
  width: max-content;
  min-width: 0;
  max-width: none;
  min-height: 36px;
  padding: 7px 12px;
  gap: 12px;
  border: 1px solid #C9DDD8;
  border-radius: 8px;
  background: #EDF6F4;
  box-shadow: none;
}

.dietary-fluid-compare-toggle input {
  width: 14px;
  height: 14px;
}

.dietary-comparison-section-header .dietary-recommend-toggle input {
  width: 14px;
  height: 14px;
}

.note-section[data-section="dietaryAssessment"] .section-body > .infant-test-panel {
  justify-self: end;
  width: max-content;
  min-width: 150px;
  margin: 0 0 10px auto;
  box-sizing: border-box;
}

.dietary-assessment-shell {
  grid-template-columns: minmax(0, 1fr);
}

.dietary-calorie-section-header {
  align-items: flex-end;
  margin: 12px 0 0;
}

.dietary-calorie-section-header .dietary-summary-title {
  align-self: flex-end;
  margin: 0;
  line-height: 1;
}

.dietary-fluid-section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  width: max(100%, 744px);
  margin: 0 0 8px;
  box-sizing: border-box;
}

.dietary-fluid-section-header .dietary-fluid-title-outside {
  align-self: flex-end;
  width: auto;
  margin: 0;
  line-height: 1;
}

.dietary-fluid-section-header .dietary-fluid-compare-toggle {
  align-self: flex-end;
  flex: 0 0 auto;
  width: max-content;
  min-width: 0;
  min-height: 36px;
  margin: 0;
  padding: 7px 12px;
  gap: 12px;
}

.dietary-fluid-section-header .dietary-fluid-compare-toggle input {
  width: 14px;
  height: 14px;
}

.dietary-fluid-entry-card {
  margin-top: 0;
}

.dietary-comparison-scroll > .dietary-fluid-subsection-label {
  width: max(100%, 744px);
  box-sizing: border-box;
  margin: var(--space-subsection) 0 8px;
}

.dietary-comparison-scroll > .dietary-assessment-summary-subsection-label,
.dietary-comparison-scroll > .dietary-assessment-summary-note {
  width: max(100%, 744px);
  box-sizing: border-box;
}

.dietary-comparison-scroll > .dietary-assessment-summary-note {
  padding-top: 0;
  border-top: 0;
}

.dietary-fluid-entry-card input,
.dietary-fluid-entry-card select,
.dietary-fluid-card select {
  color: #1E2928;
  font-size: var(--type-input);
  font-weight: 550;
  letter-spacing: var(--tracking-body);
  line-height: var(--leading-tight);
}

.dietary-comparison-scroll:has(.standard-assessment-table.recommended-active) > .dietary-fluid-section-header {
  width: max(100%, 744px);
}

@media (max-width: 760px) {
  .note-section[data-section="dietaryAssessment"] .section-body > .infant-test-panel {
    justify-self: stretch;
    width: auto;
    margin-right: 0;
    margin-left: 0;
  }

  .dietary-fluid-section-header {
    display: grid;
    width: max(100%, 744px);
  }

  .dietary-fluid-section-header .dietary-fluid-compare-toggle {
    justify-self: start;
  }
}

.dietary-calorie-section-header {
  align-items: flex-end;
  margin: 12px 0 8px;
}

.dietary-calorie-section-header .dietary-summary-title,
.dietary-fluid-section-header .dietary-fluid-title-outside {
  align-self: flex-end;
  line-height: 1;
}

.dietary-assessment-controls .compact-select-label,
.dietary-fluid-entry-card .dietary-fluid-entry-group > span,
.dietary-fluid-note-label > span {
  color: #1E2928;
  font-size: var(--type-field-label);
  font-weight: 650;
  letter-spacing: var(--tracking-field-label);
  line-height: var(--leading-helper);
  text-transform: none;
}

.dietary-assessment-controls .compact-select-label {
  gap: 8px;
}

.dietary-fluid-entry-group {
  gap: 0;
}

.dietary-fluid-entry-card .dietary-fluid-entry-group > span {
  margin: 12px 0 8px;
}

.dietary-fluid-entry-card .dietary-fluid-output-group {
  align-self: end;
  padding-top: 18px;
}

.dietary-fluid-entry-group small,
.dietary-fluid-values small,
.dietary-fluid-values p,
.dietary-fluid-output small,
.dietary-fluid-output p {
  display: none;
}

.dietary-fluid-card .dietary-fluid-main {
  display: grid;
  grid-template-columns: var(--dietary-prescription-columns);
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.dietary-fluid-card .dietary-fluid-category {
  position: relative;
  display: grid;
  align-content: center;
  min-height: 0;
  padding: 0 4px 0 0;
  border: 0;
  background: transparent;
  color: #1E2928;
  font-size: var(--type-dietary-card-label);
  font-weight: 750;
  letter-spacing: var(--tracking-dietary-card-label);
  line-height: var(--leading-dietary-card-label);
  text-align: left;
  text-transform: uppercase;
  white-space: normal;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
}

.dietary-fluid-card .dietary-fluid-metrics {
  grid-column: 2 / 5;
  display: grid;
  gap: 12px;
  min-width: 0;
}

.dietary-fluid-card .dietary-fluid-values {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: center;
}

.dietary-fluid-card .dietary-fluid-values > div {
  display: grid;
  align-content: center;
  gap: 4px;
  min-width: 0;
  text-align: left;
}

.dietary-fluid-card .dietary-fluid-values > div:not(:last-child) {
  padding-right: 16px;
  border-right: 1px solid #C9DDD8;
}

.dietary-fluid-card .dietary-fluid-output {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  min-width: 0;
  padding: 0;
  border: 0;
}

.dietary-fluid-card .dietary-fluid-output > div {
  display: block;
}

.dietary-fluid-card .dietary-fluid-comparisons {
  grid-column: 5;
  align-self: center;
  align-content: center;
  justify-self: stretch;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding-left: 14px;
  padding-right: 8px;
  border-left: 1px solid #C9DDD8;
  box-sizing: border-box;
}

.dietary-fluid-card .dietary-fluid-comparisons .dietary-summary-comparison {
  min-width: 0;
}

.dietary-fluid-format-panel {
  display: grid;
  grid-template-columns: minmax(74px, max-content) minmax(155px, 1fr);
  gap: 12px;
  align-items: end;
  align-content: end;
  min-width: 0;
  text-align: left;
}

.dietary-fluid-format-row {
  display: grid;
  gap: 4px;
  align-self: end;
  min-width: 0;
  margin-bottom: 12px;
}

.dietary-fluid-format-option {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: auto;
  margin: 0;
  color: #1E2928;
  font-size: var(--type-field-label);
  font-weight: 650;
  letter-spacing: var(--tracking-field-label);
  line-height: var(--leading-helper);
}

.dietary-fluid-format-option > span {
  color: #637270;
  font-size: var(--type-view-settings);
  font-weight: 650;
  letter-spacing: var(--tracking-view-settings);
  line-height: var(--leading-view-settings);
  text-transform: none;
}

.dietary-fluid-format-option input[type="radio"] {
  appearance: none;
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 0 13px;
  width: 13px;
  min-width: 13px;
  max-width: 13px;
  height: 13px;
  min-height: 13px;
  max-height: 13px;
  aspect-ratio: 1 / 1;
  margin: 0;
  border: 1px solid #3F7D79;
  border-radius: 50%;
  background: #FFFFFF;
  box-sizing: border-box;
}

.dietary-fluid-format-option input[type="radio"]:hover,
.dietary-fluid-format-option input[type="radio"]:focus-visible {
  outline: 0;
  box-shadow: none;
}

.dietary-fluid-format-option input[type="radio"]:checked::after {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #3F7D79;
}

.dietary-fluid-output-select-label {
  display: grid;
  gap: 8px;
  min-width: 0;
  color: #1E2928;
  font-size: var(--type-field-label);
  font-weight: 650;
  letter-spacing: var(--tracking-field-label);
  line-height: var(--leading-helper);
}

.dietary-fluid-output-label-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: #1E2928;
  font-size: var(--type-field-label);
  font-weight: 650;
  letter-spacing: var(--tracking-field-label);
  line-height: var(--leading-helper);
}

.dietary-fluid-output-select-label select {
  min-width: 0;
}

/* Input / Body Text schema: editor body text, inputs, dropdowns, and textareas use
   0.875rem / 550 / #1E2928 / 1.5 / 0.01em.
   Data tables, live preview, placeholders, labels, and headings keep separate exception rules. */
.app-header :is(select, textarea, input[type="text"]:not(.note-title-input), input[type="date"], input[type="month"]),
.note-section :is(select, textarea, input[type="text"], input[type="date"], input[type="month"]):not(.measurement-edit-input),
.dietary-assessment-box :is(select, textarea, input),
.dietary-assessment-table :is(select, input),
.standard-assessment-table :is(select, input),
.dietary-fluid-entry-card :is(select, input),
.dietary-fluid-card :is(select, textarea) {
  font-size: var(--type-input);
  font-weight: 550;
  line-height: var(--leading-input) !important;
  letter-spacing: var(--tracking-body);
}

.note-title-label {
  margin: var(--space-note-title-label-before) 0 var(--space-note-title-label-after);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-caps);
}

.preview-header .eyebrow {
  display: block;
  margin: var(--space-live-preview-label-before) 0 var(--space-live-preview-label-after) !important;
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-caps);
  color: #FFFFFF;
}

.note-title-input,
.app-header input.note-title-input {
  font-size: var(--type-editable-title) !important;
  font-style: italic;
  font-weight: 650 !important;
  line-height: var(--leading-tight) !important;
  letter-spacing: var(--tracking-note-title) !important;
}

.note-title-input::placeholder {
  font-size: var(--type-editable-title);
  font-style: italic;
  font-weight: 650;
}

/* Final live-preview header spacing rule:
   LIVE PREVIEW uses helper-label rhythm with 60px before and 12px after.
   Preview title uses 4px before and 12px after. */
.note-preview .preview-header {
  padding: var(--space-live-preview-label-before) var(--preview-card-x) var(--space-preview-title-after) !important;
}

.note-preview .preview-title-block {
  display: grid !important;
  grid-template-rows: auto auto;
  row-gap: calc(var(--space-live-preview-label-after) + var(--space-preview-title-before));
  align-content: start !important;
  padding-left: var(--align-preview-title);
  padding-right: 0;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.note-preview .preview-header .eyebrow {
  margin: 0 !important;
  color: #FFFFFF;
  font-size: var(--type-helper-label);
  font-weight: 700;
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
}

.note-preview .preview-title-block h2 {
  margin: 0 !important;
}

.dietary-fluid-info-button {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 1px solid #8BB7AB;
  border-radius: 50%;
  background: #EDF6F4;
  color: #1E4D4A;
  font-size: var(--type-helper);
  font-weight: 700;
  line-height: 1;
}

.dietary-fluid-info-popover {
  position: absolute;
  z-index: 8;
  top: calc(100% + 8px);
  right: 0;
  width: min(280px, 80vw);
  padding: 10px 12px;
  border: 1px solid #8BB7AB;
  border-radius: 8px;
  background: #FFFFFF;
  color: #637270;
  box-shadow: 0 8px 20px rgba(30, 77, 74, 0.14);
  font-size: var(--type-helper);
  font-weight: 600;
  letter-spacing: var(--tracking-body);
  line-height: var(--leading-helper);
  text-transform: none;
}

.dietary-fluid-output-label-row > span {
  color: #1E2928;
  font-size: var(--type-field-label);
  font-weight: 650;
  letter-spacing: var(--tracking-field-label);
  line-height: var(--leading-helper);
  text-transform: none;
}

.dietary-fluid-card .dietary-fluid-output {
  grid-column: 5;
  display: grid;
  gap: 6px;
  min-width: 0;
  padding-left: 14px;
  padding-right: 8px;
  border-left: 1px solid #C9DDD8;
  box-sizing: border-box;
}

@media (max-width: 760px) {
  .dietary-fluid-card .dietary-fluid-main,
  .dietary-fluid-card .dietary-fluid-values {
    grid-template-columns: 1fr;
  }

  .dietary-fluid-card .dietary-fluid-metrics,
  .dietary-fluid-card .dietary-fluid-comparisons,
  .dietary-fluid-card .dietary-fluid-output {
    grid-column: 1;
  }

  .dietary-fluid-card .dietary-fluid-comparisons,
  .dietary-fluid-card .dietary-fluid-output {
    padding-left: 0;
    border-left: 0;
  }

  .dietary-fluid-card .dietary-fluid-values > div:not(:last-child) {
    padding-right: 0;
    border-right: 0;
  }
}

/* Live Preview header final cascade lock:
   LIVE PREVIEW uses helper-label rhythm with 60px before and 12px after.
   Preview title uses 4px before and 12px after. */
.note-preview .preview-header {
  padding: var(--space-live-preview-label-before) var(--preview-card-x) var(--space-preview-title-after) !important;
}

.note-preview .preview-title-block {
  display: flex !important;
  flex-direction: column !important;
  gap: calc(var(--space-live-preview-label-after) + var(--space-preview-title-before)) !important;
  align-content: stretch !important;
  padding: 0 !important;
  min-width: 0;
  max-width: 100%;
  overflow: visible;
  box-sizing: border-box;
}

.note-preview .preview-title-block .eyebrow {
  display: block !important;
  margin: 0 !important;
  color: #FFFFFF;
  font-size: var(--type-helper-label);
  font-weight: 700;
  line-height: 1;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
}

.note-preview .preview-title-block h2 {
  margin: 0 !important;
  max-width: 100%;
  font-size: var(--type-live-preview-title);
  font-weight: 650;
  line-height: 1.15;
  letter-spacing: var(--tracking-note-title);
  color: #FFFFFF;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-bottom: 0;
}

.note-preview.minimized {
  overflow: visible;
}

.note-preview.minimized .preview-header {
  min-height: 76px;
  overflow: visible;
}

.note-preview.minimized .preview-actions,
.note-preview.minimized .preview-options-menu {
  z-index: 10;
}

/* Final medical-history entry alignment lock:
   these inline add rows need their own label rhythm so the Add button
   aligns to the input boxes, not to the global stacked-label margins. */
.note-section .medical-history-entry {
  --medical-history-control-width: clamp(132px, 24%, 170px);
  --medical-history-action-width: clamp(58px, 12%, 92px);
  grid-template-columns:
    minmax(var(--medical-history-control-width), var(--medical-history-control-width))
    minmax(var(--medical-history-control-width), var(--medical-history-control-width))
    minmax(0, 1fr)
    minmax(var(--medical-history-action-width), var(--medical-history-action-width)) !important;
  align-items: end;
  width: 100%;
  box-sizing: border-box;
}

.note-section .medical-history-entry > label {
  display: grid !important;
  grid-template-rows: auto 36px;
  align-content: end;
  gap: 8px;
  margin: 0 !important;
  min-width: 0;
}

.note-section .medical-history-entry > label[hidden] {
  display: none !important;
}

.note-section .medical-history-entry > label > :is(input, select, .date-picker-field) {
  align-self: end;
  margin: 0;
}

.note-section .medical-history-update-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: end;
  width: 100%;
  min-width: 0;
  height: 36px !important;
  min-height: 36px !important;
  margin: 0 !important;
  padding-left: 8px;
  padding-right: 8px;
  padding-top: 0;
  padding-bottom: 0;
}

@media (max-width: 860px) {
  .note-section .medical-history-entry {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .note-section .medical-history-entry .medical-history-notes-field {
    grid-column: 1 / -1;
  }

  .note-section .medical-history-entry .medical-history-update-button {
    grid-column: 1 / -1;
  }
}

@media (max-width: 480px) {
  .note-section .medical-history-entry {
    grid-template-columns: 1fr !important;
  }

  .note-section .medical-history-entry > label,
  .note-section .medical-history-entry .medical-history-notes-field,
  .note-section .medical-history-entry .medical-history-update-button {
    grid-column: 1;
  }
}

/* Live Preview control layout: hamburger sits left of the right-aligned
   compass toggle; the compass stays unframed like the card-header controls. */
.note-preview .preview-actions {
  top: 12px !important;
  right: auto !important;
  left: 14px !important;
  justify-content: flex-start !important;
}

.note-preview .preview-header {
  padding-top: var(--space-live-preview-label-before) !important;
}

.note-preview .preview-toggle {
  top: 10px !important;
  right: 14px !important;
  left: auto !important;
  width: 34px !important;
  min-width: 34px !important;
  height: 28px !important;
  min-height: 28px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.note-preview .preview-toggle-icon {
  width: 40px !important;
  height: 40px !important;
}

.note-preview .preview-toggle:hover,
.note-preview .preview-toggle:focus-visible {
  background: transparent !important;
  box-shadow: none !important;
}

.note-preview .preview-toggle:hover .preview-toggle-icon,
.note-preview .preview-toggle:focus-visible .preview-toggle-icon {
  filter: none !important;
}

/* Final utility-button schema lock:
   Utility buttons use 0.80rem / 400 at rest and 650 on hover/active states. */
.workflow-heading-actions .ghost-button,
.preview-menu-item {
  display: inline-grid !important;
  grid-template-areas: "label" !important;
  align-items: center !important;
  justify-items: center !important;
  font-size: 0 !important;
  font-weight: 400 !important;
  line-height: 1 !important;
  letter-spacing: var(--tracking-body) !important;
  color: transparent !important;
}

.workflow-heading-actions .ghost-button::before,
.preview-menu-item::before {
  content: attr(data-label);
  grid-area: label;
  visibility: hidden;
  font-size: var(--type-utility-button);
  font-weight: 650;
  line-height: 1;
  letter-spacing: var(--tracking-body);
  pointer-events: none;
}

.workflow-heading-actions .ghost-button::after,
.preview-menu-item::after {
  content: attr(data-label) !important;
  grid-area: label;
  color: #1E4D4A;
  font-size: var(--type-utility-button);
  font-weight: 400;
  line-height: 1;
  letter-spacing: var(--tracking-body);
  pointer-events: none;
}

.preview-menu-item {
  justify-items: start !important;
}

.workflow-heading-actions .ghost-button:hover,
.workflow-heading-actions .ghost-button:focus-visible,
.preview-menu-item:hover,
.preview-menu-item:focus-visible,
.preview-menu-item.is-copied {
  background: #EDF6F4 !important;
}

.workflow-heading-actions .ghost-button:hover::after,
.workflow-heading-actions .ghost-button:focus-visible::after,
.preview-menu-item:hover::after,
.preview-menu-item:focus-visible::after,
.preview-menu-item.is-copied::after {
  content: attr(data-label) !important;
  color: #1E4D4A;
  font-weight: 650;
}

@media (min-width: 901px) {
  .note-preview .preview-toggle {
    display: none !important;
  }

  .note-preview .preview-actions {
    right: auto !important;
    left: 10px !important;
  }

  .note-preview .preview-menu-panel {
    right: auto;
    left: 0;
  }
}
html.homepage-preview-mode,
html.homepage-preview-mode body {
  height: auto !important;
  min-height: 0 !important;
  overflow: visible !important;
  scrollbar-width: none;
}

html.homepage-preview-mode body::-webkit-scrollbar,
html.homepage-preview-mode .formatted-note::-webkit-scrollbar {
  width: 0;
  height: 0;
}

html.homepage-preview-mode .side-rail {
  display: none !important;
}

html.homepage-preview-mode .app-shell {
  margin-left: 0 !important;
}

html.homepage-preview-mode .workspace {
  align-items: start !important;
}

html.homepage-preview-mode .preview-column {
  position: static !important;
  height: auto !important;
  min-height: 0 !important;
  align-self: start !important;
}

html.homepage-preview-mode .note-preview {
  height: auto !important;
  min-height: 0 !important;
  overflow: visible !important;
}

html.homepage-preview-mode .formatted-note {
  flex: 0 0 auto !important;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
  scrollbar-width: none;
}

html.homepage-preview-mode :is(a, button, input, textarea, select, summary) {
  pointer-events: none !important;
}
