/* ── Clinical design system ── */
:root {
  --white: #ffffff;
  --bg: #e8edf2;
  --bg-subtle: #dce4ec;
  --surface: #ffffff;
  --surface-raised: #f4f8fb;

  --border: #bcc9d4;
  --border-strong: #9aabb8;
  --border-focus: #1a5f7a;

  --text: #0f1c28;
  --text-secondary: #334155;
  --text-muted: #5c6f80;
  --text-inverse: #ffffff;

  --primary: #1a4d6d;
  --primary-hover: #153f5a;
  --primary-soft: #dceaf2;
  --accent: #0d7a6b;
  --accent-soft: #d4f0ea;

  --warning-bg: #fffbf0;
  --warning-border: #e8d48b;
  --warning-text: #6b5a1e;

  --danger: #b91c1c;
  --success: #047857;
  --high-risk: #9f1239;
  --low-risk: #047857;

  --glycemic: #1a5f7a;
  --ir: #5b4d8a;
  --electrolyte: #8a6d3b;
  --insulin: #2d6a4f;

  --radius: 6px;
  --radius-lg: 8px;

  --font: "IBM Plex Sans", system-ui, -apple-system, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;

  --shadow-xs: 0 1px 3px rgba(15, 28, 40, 0.07);
  --shadow-sm: 0 2px 8px rgba(15, 28, 40, 0.1);
  --shadow-md: 0 8px 28px rgba(15, 28, 40, 0.12);
  --header-h: auto;

  --input-h: 42px;
  --transition: 0.15s ease;
  --page-pad: 1.25rem;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  overflow-x: clip;
  max-width: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background:
    linear-gradient(180deg, #dde6ee 0%, var(--bg) 180px),
    var(--bg);
  -webkit-font-smoothing: antialiased;
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
  overflow-x: clip;
  max-width: 100%;
}

/* ── Header ── */
.header {
  position: relative;
  color: var(--text-inverse);
  overflow: hidden;
  background: linear-gradient(135deg, #0c2233 0%, #0f3044 45%, #0a3d38 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 4px 24px rgba(12, 34, 51, 0.25);
}

.header__backdrop {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.header__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 32px 32px;
  -webkit-mask-image: linear-gradient(to bottom, black 30%, transparent 100%);
  mask-image: linear-gradient(to bottom, black 30%, transparent 100%);
}

.header__shell {
  position: relative;
  max-width: 1140px;
  margin: 0 auto;
  padding: calc(1.1rem + env(safe-area-inset-top, 0px)) 1.25rem 0;
}

.header__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  padding-bottom: 1rem;
}

.header__brand {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.header__logo {
  flex-shrink: 0;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.25));
}

.header__logo svg {
  display: block;
  width: 52px;
  height: 52px;
}

.header__eyebrow {
  display: block;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(94, 234, 212, 0.85);
  margin-bottom: 0.25rem;
}

.header__title {
  margin: 0;
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.05em;
}

.header__title-endo {
  color: #fff;
}

.header__title-meta {
  color: #5eead4;
  background: linear-gradient(90deg, #5eead4, #7dd3fc);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.header__title-panel {
  font-family: var(--mono);
  font-size: 0.72em;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.45);
  margin-left: 0.35em;
  padding: 0.15em 0.45em;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  vertical-align: middle;
  -webkit-text-fill-color: rgba(255, 255, 255, 0.55);
}

.header__modules-ticker {
  position: relative;
  width: 100vw;
  max-width: 100vw;
  left: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  overflow: hidden;
  padding: 0.4rem 0;
  background: rgba(0, 0, 0, 0.14);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  -webkit-mask-image: linear-gradient(
    90deg,
    transparent,
    #000 4%,
    #000 96%,
    transparent
  );
  mask-image: linear-gradient(
    90deg,
    transparent,
    #000 4%,
    #000 96%,
    transparent
  );
}

.header__modules-ticker:hover .header__modules-track {
  animation-play-state: paused;
}

.header__modules-track {
  display: flex;
  width: max-content;
  animation: modules-marquee 38s linear infinite;
  will-change: transform;
}

.header__modules {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
}

.header__modules li {
  flex-shrink: 0;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  padding: 0.22rem 0.5rem;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.62);
  line-height: 1.2;
}

@media (prefers-reduced-motion: reduce) {
  .header__modules-ticker {
    overflow-x: auto;
    -webkit-mask-image: none;
    mask-image: none;
  }

  .header__modules-track {
    animation: none;
    width: 100%;
    justify-content: center;
  }

  .header__modules {
    flex-wrap: wrap;
    justify-content: center;
    row-gap: 0.35rem;
  }

  .header__modules li[aria-hidden="true"] {
    display: none;
  }
}

.header__aside {
  text-align: right;
  flex-shrink: 0;
  padding-top: 0.15rem;
}

.header__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  max-width: min(100%, 15.5rem);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.35rem 0.65rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.header__badge-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header__badge--draft {
  background: rgba(13, 122, 107, 0.22);
  border-color: rgba(94, 234, 212, 0.35);
  letter-spacing: 0.04em;
  max-width: none;
}

.header__badge--draft .header__badge-label {
  overflow: visible;
  text-overflow: unset;
  white-space: nowrap;
}

.header__badge--draft .header__badge-dot {
  background: #fde68a;
  box-shadow: 0 0 8px rgba(253, 230, 138, 0.85);
}

.header__badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #5eead4;
  box-shadow: 0 0 8px #5eead4;
  animation: pulse-dot 2.5s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.85); }
}

.header__tagline {
  margin: 0.45rem 0 0;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.4);
  letter-spacing: 0.02em;
}

/* ── Workflow rail (in header) ── */
.header__workflow {
  padding: 0.15rem 0 0.85rem;
}

.workflow-rail {
  --wr-icon: 30px;
  --logo-gradient: linear-gradient(135deg, #1a6b8a 0%, #0d5c4a 100%);
  --logo-stroke: rgba(255, 255, 255, 0.2);
  --liquid-ease: cubic-bezier(0.45, 0.02, 0.15, 1);
  --liquid-dur: 0.72s;

  position: relative;
  padding: 0;
}

.workflow-rail__track {
  position: relative;
}

.workflow-rail__liquid {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  pointer-events: none;
  border-radius: 8px;
  opacity: 0;
  overflow: visible;
  box-sizing: border-box;
  transition:
    transform var(--liquid-dur) var(--liquid-ease),
    width var(--liquid-dur) var(--liquid-ease),
    height var(--liquid-dur) var(--liquid-ease),
    border-radius var(--liquid-dur) var(--liquid-ease),
    opacity 0.25s ease;
  transform: translate(calc(var(--lx, 0px) + var(--intent-x, 0px)), var(--ly, 0px))
    scaleX(var(--intent-sx, 1));
  will-change: transform, width, height;
}

.workflow-rail__liquid-glass {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(155deg, #2389a8 0%, #1a6b8a 38%, #0a4a3d 100%);
  border: 1.5px solid rgba(255, 255, 255, 0.38);
  box-shadow:
    0 6px 22px rgba(8, 58, 48, 0.55),
    0 0 0 1px rgba(0, 0, 0, 0.12),
    inset 0 2px 0 rgba(255, 255, 255, 0.32),
    inset 0 -2px 0 rgba(0, 0, 0, 0.18);
}

.workflow-rail__liquid-glass::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  pointer-events: none;
}

.workflow-rail__liquid-glass::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    115deg,
    transparent 22%,
    rgba(255, 255, 255, 0.48) 48%,
    transparent 74%
  );
  opacity: 0.95;
  animation: liquidShimmer 4.2s ease-in-out infinite;
}

.workflow-rail__steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  position: relative;
  z-index: 1;
}

.workflow__step {
  position: relative;
  min-height: 46px;
  padding: 0;
  text-align: left;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.14);
  transition:
    background var(--transition),
    border-color var(--transition),
    transform var(--transition);
}

.workflow__step:not(.is-active):not(.is-done) {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.18);
}

.workflow__step-btn {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 0.55rem;
  width: 100%;
  min-height: 46px;
  margin: 0;
  padding: 0.5rem 0.75rem;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.82);
  font: inherit;
  font-size: inherit;
  line-height: inherit;
  text-align: left;
  cursor: pointer;
  border-radius: inherit;
  -webkit-appearance: none;
  appearance: none;
}

.workflow__step-btn:disabled {
  cursor: default;
  opacity: 1;
  color: rgba(255, 255, 255, 0.82);
  -webkit-text-fill-color: currentColor;
  pointer-events: none;
}

.workflow__step-btn:not(:disabled):hover {
  background: rgba(255, 255, 255, 0.06);
}

.workflow__step-btn:focus-visible {
  outline: 2px solid #5eead4;
  outline-offset: 2px;
}

/* Short connector only in the gutter between compact step pills. */
.workflow__step:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 50%;
  left: calc(100% + 0.12rem);
  width: 0.26rem;
  height: 1px;
  background: rgba(255, 255, 255, 0.18);
  transform: translateY(-50%);
  z-index: 0;
  pointer-events: none;
}

.workflow__step.is-done:not(:last-child)::after {
  background: rgba(94, 234, 212, 0.7);
  box-shadow: none;
}

.workflow__icon {
  position: relative;
  z-index: 1;
  width: var(--wr-icon);
  height: var(--wr-icon);
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.12);
  border: 2px solid rgba(255, 255, 255, 0.22);
  color: rgba(255, 255, 255, 0.72);
  transition: var(--transition);
}

.workflow__icon svg {
  width: 15px;
  height: 15px;
}

.workflow__label {
  font-size: 0.72rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.1;
  transition: var(--transition);
}

.workflow__num {
  display: block;
  font-family: var(--mono);
  font-size: 0.58rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  opacity: 0.65;
  margin-bottom: 0.12rem;
}

.workflow__step.is-active {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  transform: none;
}

.workflow__step.is-active .workflow__step-btn:disabled {
  opacity: 1;
}

.workflow__step.is-active .workflow__icon {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.28);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.workflow__step.is-active .workflow__label {
  color: #fff;
  font-weight: 600;
}

.workflow__step.is-active .workflow__step-btn {
  color: #fff;
  -webkit-text-fill-color: #fff;
}

.workflow__step.is-active .workflow__num {
  color: #5eead4;
  opacity: 1;
}

.workflow__step.is-done {
  border-width: 1px;
  border-color: rgba(94, 234, 212, 0.75);
  background: rgba(94, 234, 212, 0.08);
}

.workflow__step.is-done .workflow__icon {
  background: rgba(94, 234, 212, 0.12);
  border-color: #5eead4;
  color: #5eead4;
}

.workflow__step.is-done .workflow__label {
  color: rgba(255, 255, 255, 0.75);
}

.workflow__step.is-done .workflow__num {
  color: #5eead4;
  opacity: 1;
}

/* ── Page layout ── */
.page {
  max-width: 1140px;
  margin: 0 auto;
  padding: 1.25rem;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

/* ── Sidebar ── */
.aside {
  position: sticky;
  top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-width: 0;
  max-width: 100%;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: 0.85rem 1rem;
  box-shadow: var(--shadow-xs);
}

.panel--subtle {
  background: var(--surface);
  border-left-color: var(--primary);
}

.panel__label {
  margin: 0 0 0.5rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--primary);
}

.panel--calc-preview.panel--calc-preview-active {
  border-left-color: #14b8a6;
  box-shadow:
    var(--shadow-xs),
    0 0 0 1px rgba(13, 122, 107, 0.08);
}

.calc-preview {
  list-style: none;
  margin: 0;
  padding: 0;
}

.calc-preview__item {
  position: relative;
  font-size: 0.78rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--bg-subtle);
  color: var(--text);
  font-weight: 500;
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  transform-origin: left center;
}

.calc-preview__item:last-child { border-bottom: none; }

.calc-preview__badge {
  position: relative;
  width: 1.35rem;
  height: 1.35rem;
  flex-shrink: 0;
  margin-top: 0.05rem;
  display: grid;
  place-items: center;
}

.calc-preview__badge-glass {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  opacity: 0;
  transform: scale(0.72);
  background: linear-gradient(
    150deg,
    #ffffff 0%,
    #c8efe6 42%,
    rgba(13, 122, 107, 0.45) 100%
  );
  border: 1.5px solid rgba(13, 122, 107, 0.55);
  box-shadow:
    0 3px 10px rgba(13, 122, 107, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
  transition:
    opacity 0.35s ease,
    transform 0.45s cubic-bezier(0.34, 1.4, 0.64, 1);
}

.calc-preview__badge-pending,
.calc-preview__badge-check {
  position: relative;
  z-index: 1;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  transition:
    opacity 0.28s ease,
    transform 0.42s cubic-bezier(0.34, 1.4, 0.64, 1);
}

.calc-preview__badge-pending {
  color: var(--text-muted);
}

.calc-preview__badge-check {
  position: absolute;
  color: #047857;
  opacity: 0;
  transform: scale(0.35) rotate(-48deg);
}

.calc-preview__item.is-ready .calc-preview__badge-glass {
  opacity: 1;
  transform: scale(1);
}

.calc-preview__item.is-ready .calc-preview__badge-pending {
  opacity: 0;
  transform: scale(0.4);
}

.calc-preview__item.is-ready .calc-preview__badge-check {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

.calc-preview__body {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.calc-preview__label {
  line-height: 1.35;
}

.calc-preview__value {
  display: inline-block;
  align-self: flex-start;
  max-width: 100%;
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.3;
  color: #0a5c50;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.95) 0%,
    rgba(212, 240, 234, 0.92) 100%
  );
  border: 1px solid rgba(13, 122, 107, 0.38);
  box-shadow:
    0 1px 4px rgba(13, 122, 107, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.85);
  white-space: normal;
  word-break: break-word;
}

.calc-preview__item.is-pending {
  color: var(--text-muted);
}

.calc-preview__item.is-pending .calc-preview__label {
  color: var(--text-secondary);
}

.calc-preview__item.is-ready .calc-preview__label {
  color: var(--text);
  font-weight: 600;
}

.calc-preview__item.is-empty,
.calc-preview__item--empty {
  font-style: italic;
  color: var(--text-muted);
  padding-left: 0;
}

.unit-system-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
}

.unit-system-toggle.liquid-segment {
  gap: 0;
  padding: 3px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 2px);
  isolation: isolate;
}

.liquid-segment {
  position: relative;
  isolation: isolate;
  max-width: 100%;
  overflow: hidden;
}

.liquid-segment__indicator {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  border-radius: var(--radius);
  overflow: hidden;
  max-width: 100%;
  transition:
    transform var(--liquid-dur, 0.72s) var(--liquid-ease, cubic-bezier(0.45, 0.02, 0.15, 1)),
    width var(--liquid-dur, 0.72s) var(--liquid-ease, cubic-bezier(0.45, 0.02, 0.15, 1)),
    height var(--liquid-dur, 0.72s) var(--liquid-ease, cubic-bezier(0.45, 0.02, 0.15, 1)),
    border-radius var(--liquid-dur, 0.72s) var(--liquid-ease, cubic-bezier(0.45, 0.02, 0.15, 1)),
    opacity 0.22s ease;
  will-change: transform, width, height;
}

.liquid-segment__indicator-glass {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(
    150deg,
    #ffffff 0%,
    #c8efe6 38%,
    rgba(13, 122, 107, 0.42) 100%
  );
  border: 1.5px solid rgba(13, 122, 107, 0.58);
  box-shadow:
    0 4px 16px rgba(13, 122, 107, 0.28),
    0 0 0 1px rgba(255, 255, 255, 0.65),
    inset 0 2px 0 rgba(255, 255, 255, 0.95),
    inset 0 -2px 0 rgba(13, 122, 107, 0.14);
}

.liquid-segment__indicator-glass::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
  pointer-events: none;
}

.liquid-segment__indicator-glass::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    120deg,
    transparent 24%,
    rgba(255, 255, 255, 0.82) 50%,
    transparent 76%
  );
  animation: liquidShimmer 3.6s ease-in-out infinite;
}

.liquid-segment > .unit-system-toggle__option,
.liquid-segment > .choice {
  position: relative;
  z-index: 1;
}

.unit-system-toggle__option {
  display: block;
  position: relative;
  cursor: pointer;
}

.unit-system-toggle__option input {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.unit-system-toggle__option span {
  display: block;
  padding: 0.45rem 0.55rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: 0.72rem;
  font-weight: 600;
  text-align: center;
  color: var(--text-secondary);
  background: transparent;
  transition:
    color var(--transition),
    font-weight var(--transition);
}

.unit-system-toggle.liquid-segment .unit-system-toggle__option span {
  border-color: transparent;
}

.unit-system-toggle__option input:checked + span {
  border-color: transparent;
  background: transparent;
  color: var(--accent);
  font-weight: 700;
}

.unit-system-toggle__option input:focus-visible + span {
  box-shadow: 0 0 0 3px rgba(13, 122, 107, 0.15);
}

.calc-preview__item.is-empty::before,
.calc-preview__item--empty::before { display: none; }

/* ── Content / views ── */
.content {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  min-height: 480px;
  min-width: 0;
  max-width: 100%;
  overflow-x: clip;
}

.view {
  display: none;
  padding: 1.5rem;
}

.view.is-active { display: block; }

.view__head {
  margin-bottom: 1.5rem;
  padding: 1rem 1.15rem;
  background: linear-gradient(135deg, var(--primary-soft) 0%, #f7fbfe 100%);
  border: 1px solid #b8cedb;
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
}

.view__head--results {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}

.view__section {
  margin: 0 0 0.25rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.view__title {
  margin: 0 0 0.35rem;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.02em;
}

.view__lead {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
  max-width: 56ch;
  font-weight: 500;
}

.view__patient {
  margin: 0.5rem 0 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

.view__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  flex-shrink: 0;
  justify-content: flex-end;
}

.export-pdf-target {
  display: block;
}

/* ── Form blocks ── */
.clinical-form { display: flex; flex-direction: column; gap: 1.25rem; }

.form-block {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
  border-left-width: 4px;
  border-left-color: var(--primary);
}

.form-block--anthropometry { border-left-color: var(--primary); }
.form-block--risk { border-left-color: var(--primary); }
.form-block--glycemic { border-left-color: var(--glycemic); border-top: none; }
.form-block--ir { border-left-color: var(--ir); border-top: none; }
.form-block--electrolyte { border-left-color: var(--electrolyte); border-top: none; }
.form-block--insulin { border-left-color: var(--insulin); }

.form-block__title {
  margin: 0;
  padding: 0.7rem 1rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--primary);
  background: linear-gradient(90deg, var(--primary-soft) 0%, var(--surface-raised) 100%);
  border-bottom: 1px solid var(--border);
}

.form-block__desc {
  margin: 0;
  padding: 0.65rem 1rem 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.form-block--inline {
  border: 1px solid #9ec9db;
  border-left: 4px solid var(--primary);
  background: linear-gradient(90deg, var(--primary-soft) 0%, #f0f8fc 100%);
}
.form-block--inline .form-block__title { display: none; }

.form-grid {
  display: grid;
  gap: 1rem;
  padding: 1rem;
}

.form-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.form-grid--anthropometry {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.form-grid--anthropometry .form-field--age {
  min-width: 0;
}

.form-grid--anthropometry .form-field--age .input-group {
  width: 100%;
}

.form-grid--anthropometry .form-field--sex {
  min-width: 0;
}

@media (min-width: 993px) {
  .form-grid--anthropometry .form-field--sex {
    grid-column: span 2;
  }
}

.form-metrics-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.form-metrics-row .form-field {
  min-width: 0;
}

.form-metrics-row .input-group {
  width: 100%;
}

/* ── Form fields ── */
.form-field { display: flex; flex-direction: column; gap: 0.35rem; min-width: 0; max-width: 100%; }

.form-field__label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.01em;
}

.req { color: var(--danger); font-weight: 700; }

.form-field__hint {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: -0.1rem;
}

.form-field--computed {
  position: relative;
  gap: 0;
  padding: 0;
  border-radius: var(--radius-lg);
  border: 1.5px solid rgba(13, 122, 107, 0.52);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.92) 0%, rgba(232, 247, 243, 0.88) 55%, rgba(212, 240, 234, 0.95) 100%);
  box-shadow:
    0 3px 14px rgba(13, 122, 107, 0.14),
    0 0 0 1px rgba(255, 255, 255, 0.82),
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    inset 0 -1px 0 rgba(13, 122, 107, 0.1);
  overflow: hidden;
}

.form-field--computed.computed-panel:not(.is-visible) {
  display: none;
}

.form-field--computed::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, #0d7a6b 0%, #14b8a6 55%, rgba(20, 184, 166, 0.45) 100%);
  pointer-events: none;
}

.form-field--computed::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    118deg,
    transparent 18%,
    rgba(255, 255, 255, 0.55) 48%,
    transparent 78%
  );
  pointer-events: none;
  opacity: 0.65;
}

.form-field--computed .form-field__label {
  position: relative;
  z-index: 1;
  margin: 0;
  padding: 0.55rem 0.9rem 0.4rem 1.15rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #0a5c50;
  border-bottom: 1px solid rgba(13, 122, 107, 0.2);
  background: linear-gradient(90deg, rgba(212, 240, 234, 0.75) 0%, rgba(255, 255, 255, 0.25) 100%);
}

.form-field--computed .computed-value {
  position: relative;
  z-index: 1;
  min-height: var(--input-h);
  height: auto;
  display: flex;
  align-items: flex-start;
  padding: 0.65rem 0.9rem 0.7rem 1.15rem;
  background: transparent;
  border: none;
  border-radius: 0;
  font-family: var(--mono);
  font-size: 0.85rem;
}

.computed-value__placeholder { color: var(--text-muted); }

.computed-value__result {
  color: #0a4d42;
  font-weight: 600;
}

.computed-value__result--stack {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.computed-value__result--stack span {
  display: block;
  line-height: 1.35;
}

.computed-value__result[hidden],
.computed-value__placeholder[hidden] {
  display: none !important;
}

.form-field--disabled { opacity: 0.55; }

.field-select {
  width: 100%;
  height: var(--input-h);
  padding: 0 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font: inherit;
  font-size: 0.88rem;
  color: var(--text);
  background: var(--white);
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.field-select:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(26, 95, 122, 0.12);
}

/* ── Input group (value + unit) ── */
.input-group {
  display: flex;
  align-items: stretch;
  height: var(--input-h);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--white);
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(15, 28, 40, 0.04);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.input-group:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(26, 95, 122, 0.16);
}

.input-group--wide { max-width: 280px; }

.input-group input {
  flex: 1;
  min-width: 0;
  height: auto;
  margin: 0;
  border: none;
  padding: 0 0.75rem;
  font: inherit;
  font-size: 0.9rem;
  font-family: var(--mono);
  color: var(--text);
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  border-radius: 0;
}

.input-group input[type="number"] {
  -moz-appearance: textfield;
}

.input-group input[type="number"]::-webkit-inner-spin-button,
.input-group input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.input-group input:focus { outline: none; }

.input-group input::placeholder {
  color: var(--text-muted);
  font-family: var(--font);
  font-weight: 400;
}

.input-group input:disabled {
  background: var(--surface-raised);
  color: var(--text-muted);
  cursor: not-allowed;
}

.input-group__suffix {
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  align-self: stretch;
  padding: 3px 0.65rem 3px 0.65rem;
  margin-right: 0;
  font-size: 0.78rem;
  font-weight: 700;
  font-family: var(--mono);
  color: var(--primary);
  background: transparent;
  border-left: none;
  white-space: nowrap;
}

.input-group__suffix::before {
  content: "";
  position: absolute;
  inset: 3px 0;
  z-index: -1;
  border-radius: calc(var(--radius) - 3px);
  background: linear-gradient(
    150deg,
    #ffffff 0%,
    #c8efe6 38%,
    rgba(13, 122, 107, 0.42) 100%
  );
  border: 1.5px solid rgba(13, 122, 107, 0.58);
  box-shadow:
    0 3px 12px rgba(13, 122, 107, 0.2),
    0 0 0 1px rgba(255, 255, 255, 0.65),
    inset 0 2px 0 rgba(255, 255, 255, 0.95),
    inset 0 -2px 0 rgba(13, 122, 107, 0.14);
  transition:
    box-shadow 0.45s ease,
    filter 0.45s ease,
    border-color 0.45s ease;
}

.input-group:focus-within .input-group__suffix::before {
  border-color: rgba(13, 122, 107, 0.72);
  box-shadow:
    0 4px 16px rgba(13, 122, 107, 0.26),
    0 0 0 1px rgba(255, 255, 255, 0.75),
    inset 0 2px 0 rgba(255, 255, 255, 1),
    inset 0 -2px 0 rgba(13, 122, 107, 0.16);
}

.input-group__suffix--muted {
  font-weight: 500;
  font-size: 0.72rem;
  font-family: var(--font);
  color: var(--text-secondary);
}

.input-group__suffix--muted::before {
  background: linear-gradient(
    150deg,
    rgba(255, 255, 255, 0.96) 0%,
    var(--surface-raised) 100%
  );
  border-color: var(--border-strong);
  box-shadow:
    0 2px 8px rgba(26, 77, 109, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.input-group__unit.liquid-segment--inline {
  flex-shrink: 0;
  align-self: stretch;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin: 3px 3px 3px 0;
  padding: 2px;
  min-width: 0;
  height: auto;
  min-height: calc(var(--input-h) - 6px);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 1px);
}

.input-group__unit.liquid-segment--inline.liquid-segment--compact {
  --liquid-unit-pad-x: 0.38rem;
}

.liquid-segment--flip {
  grid-template-columns: minmax(0, auto);
  width: auto;
  min-width: 0;
}

.liquid-segment--flip.liquid-segment--units-long .liquid-unit__flip {
  min-width: 4.85rem;
}

.liquid-unit__flip {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.32rem;
  min-height: calc(var(--input-h) - 10px);
  padding: 0 0.42rem 0 0.52rem;
  margin: 0;
  border: none;
  background: transparent;
  font: inherit;
  cursor: pointer;
  border-radius: calc(var(--radius) - 3px);
  white-space: nowrap;
}

.liquid-unit__flip:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.liquid-unit__flip-stack {
  position: relative;
  display: grid;
  overflow: hidden;
  min-width: 2.65rem;
  min-height: 1.15em;
  font-family: var(--mono);
  font-size: 0.66rem;
  font-weight: 800;
  line-height: 1.15;
  color: var(--accent);
}

.liquid-segment--flip.liquid-segment--units-long .liquid-unit__flip-stack {
  min-width: 4.35rem;
}

.liquid-unit__flip-current,
.liquid-unit__flip-next {
  grid-area: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    transform 0.34s cubic-bezier(0.45, 0.02, 0.15, 1),
    opacity 0.28s ease,
    filter 0.28s ease;
}

.liquid-unit__flip-next {
  opacity: 0;
  transform: translateY(105%);
  filter: blur(2px);
}

.liquid-segment--flip:not(.is-flipping):is(:hover, :focus-within) .liquid-unit__flip-current {
  opacity: 0.42;
  transform: translateY(-105%);
}

.liquid-segment--flip:not(.is-flipping):is(:hover, :focus-within) .liquid-unit__flip-next {
  opacity: 0.72;
  transform: translateY(0);
  filter: blur(0);
}

.liquid-unit__flip-icon {
  flex-shrink: 0;
  width: 0.55rem;
  height: 0.55rem;
  position: relative;
  opacity: 0.35;
  transition: opacity 0.25s ease, transform 0.35s cubic-bezier(0.34, 1.35, 0.64, 1);
}

.liquid-unit__flip-icon::before,
.liquid-unit__flip-icon::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 0.28rem;
  height: 0.28rem;
  border-top: 1.5px solid currentColor;
  border-right: 1.5px solid currentColor;
  color: var(--accent);
}

.liquid-unit__flip-icon::before {
  left: 0;
  transform: translateY(-50%) rotate(-135deg);
}

.liquid-unit__flip-icon::after {
  right: 0;
  transform: translateY(-50%) rotate(45deg);
}

.liquid-segment--flip:is(:hover, :focus-within) .liquid-unit__flip-icon {
  opacity: 0.8;
  transform: scale(1.08);
}

.liquid-unit__flip-sources {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.liquid-segment--compact {
  --liquid-unit-pad-x: 0.38rem;
}

.liquid-unit__option {
  position: relative;
  z-index: 1;
  display: block;
  cursor: pointer;
  min-width: 0;
}

.liquid-unit__option input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  -webkit-appearance: none;
  appearance: none;
}

.liquid-unit__option span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(var(--input-h) - 10px);
  padding: 0 var(--liquid-unit-pad-x, 0.4rem);
  border: 1px solid transparent;
  border-radius: calc(var(--radius) - 3px);
  font-size: 0.66rem;
  font-weight: 700;
  font-family: var(--mono);
  line-height: 1.1;
  text-align: center;
  color: var(--text-secondary);
  background: transparent;
  transition: color var(--transition), font-weight var(--transition);
}

.liquid-unit__option input:checked + span {
  color: var(--accent);
  font-weight: 800;
}

.liquid-unit__option input:focus-visible + span {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.input-group__select {
  border: none;
  border-left: 1px solid var(--border);
  font-family: var(--font);
  font-size: 0.78rem;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  background-color: var(--primary-soft);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%237a8b99' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.4rem center;
  padding-right: 1.25rem;
  min-width: 88px;
  border-radius: 0;
}

.input-group__select:focus { outline: none; }

/* ── Choice row (sex) ── */
.choice-row {
  display: flex;
  gap: 0.5rem;
  height: var(--input-h);
}

.choice-row.liquid-segment {
  gap: 0;
  padding: 3px;
  height: auto;
  min-height: var(--input-h);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 2px);
}

.choice {
  flex: 1;
  position: relative;
  cursor: pointer;
}

.choice input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.choice span {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  transition:
    color var(--transition),
    font-weight var(--transition);
}

.choice-row.liquid-segment .choice span {
  border-color: transparent;
}

.choice:hover span {
  color: var(--text);
}

.choice input:checked + span {
  border-color: transparent;
  background: transparent;
  color: var(--primary);
  font-weight: 700;
  box-shadow: none;
}

.choice input:focus-visible + span {
  box-shadow: 0 0 0 3px rgba(26, 95, 122, 0.12);
}

/* ── Checklist ── */
.checklist {
  list-style: none;
  margin: 0;
  padding: 0.5rem 0;
}

.checklist__item {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.7rem 1rem;
  margin: 0 0.35rem;
  cursor: pointer;
  border-radius: var(--radius);
  border-bottom: none;
  transition:
    background var(--transition),
    box-shadow var(--transition);
}

.checklist li {
  border-bottom: 1px solid var(--bg-subtle);
}

.checklist li:last-child { border-bottom: none; }

.checklist__item:hover:not(:has(input:checked)) {
  background: rgba(255, 255, 255, 0.45);
}

.checklist__item input { position: absolute; opacity: 0; width: 0; height: 0; }

.checklist__liquid {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  border-radius: inherit;
  opacity: 0;
  transform: scale(0.97);
  transition:
    opacity 0.45s ease,
    transform 0.58s cubic-bezier(0.45, 0.02, 0.15, 1);
}

.checklist__liquid-glass {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(
    150deg,
    #ffffff 0%,
    #c8efe6 38%,
    rgba(13, 122, 107, 0.42) 100%
  );
  border: 1.5px solid rgba(13, 122, 107, 0.58);
  box-shadow:
    0 4px 16px rgba(13, 122, 107, 0.22),
    0 0 0 1px rgba(255, 255, 255, 0.65),
    inset 0 2px 0 rgba(255, 255, 255, 0.95),
    inset 0 -2px 0 rgba(13, 122, 107, 0.14);
}

.checklist__liquid-glass::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    120deg,
    transparent 24%,
    rgba(255, 255, 255, 0.82) 50%,
    transparent 76%
  );
  animation: liquidShimmer 3.6s ease-in-out infinite;
}

.checklist__item:has(input:checked) .checklist__liquid {
  opacity: 1;
  transform: scale(1);
}

.checklist__item:has(input:checked) .checklist__liquid-glass {
  animation: checklistLiquidIn 0.58s cubic-bezier(0.45, 0.02, 0.15, 1);
}

.checklist__box,
.checklist__label {
  position: relative;
  z-index: 1;
}

.checklist__box {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-strong);
  border-radius: 3px;
  flex-shrink: 0;
  margin-top: 1px;
  display: grid;
  place-items: center;
  transition: var(--transition);
  background: rgba(255, 255, 255, 0.85);
}

.checklist__box::after {
  content: "";
  width: 10px;
  height: 10px;
  background: var(--primary);
  border-radius: 2px;
  transform: scale(0);
  transition: transform 0.12s ease;
}

.checklist__item input:checked ~ .checklist__box {
  border-color: rgba(13, 122, 107, 0.55);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.checklist__item input:checked ~ .checklist__box::after { transform: scale(1); }

.checklist__item input:focus-visible ~ .checklist__box {
  box-shadow: 0 0 0 3px rgba(26, 95, 122, 0.12);
}

.checklist__item:has(input:checked) {
  background: transparent;
  box-shadow: none;
}

.checklist__item:has(input:checked) .checklist__label {
  color: var(--primary);
  font-weight: 600;
}

.checklist__label {
  font-size: 0.85rem;
  color: var(--text);
  line-height: 1.4;
  font-weight: 500;
  transition: color var(--transition), font-weight var(--transition);
}

.checklist__item--disabled {
  opacity: 0.45;
  pointer-events: none;
}

/* ── Form validation ── */
.form-field.is-invalid .input-group,
.form-field.is-invalid .choice-row {
  border-color: var(--high-risk);
  box-shadow: 0 0 0 3px rgba(190, 24, 93, 0.1);
}

.form-field__error {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.75rem;
  color: var(--high-risk);
  line-height: 1.35;
}

.form-field--full { grid-column: 1 / -1; }

.tdd-preview { margin-top: 0.85rem; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.print-only { display: none; }

.print-meta {
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.print-meta__title {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  font-weight: 700;
}

.print-meta__disclaimer,
.print-meta__meta {
  margin: 0;
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.print-meta__meta { margin-top: 0.35rem; }

.print-letterhead {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 0.65rem;
}

.print-letterhead__mark {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 0.45rem;
  background: #0d5c4a;
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.print-letterhead__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #111;
}

.print-letterhead__subtitle {
  margin: 0.1rem 0 0;
  font-size: 0.78rem;
  color: #555;
}

.export-pdf-clone {
  position: fixed;
  left: 0;
  top: 0;
  z-index: -1;
  width: 794px;
  max-width: 794px;
  background: #ffffff;
  padding: 24px;
  pointer-events: none;
  opacity: 1;
}

.export-pdf-clone .print-only {
  display: block !important;
}

.export-pdf-clone .result-card,
.export-pdf-clone .warnings {
  opacity: 1 !important;
  transform: none !important;
  animation: none !important;
}

.form-field--compact { margin: 0; }

.form-field--compact .form-field__label {
  font-size: 0.68rem;
  margin-bottom: 0.35rem;
}

.field-input {
  width: 100%;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 0.78rem;
  background: var(--surface);
}

.field-input:focus {
  outline: 2px solid var(--primary-muted);
  border-color: var(--primary);
}

.workflow__step.is-skipped {
  display: none;
}

.workflow-rail__steps--no-insulin {
  grid-template-columns: repeat(3, 1fr);
}

.workflow-rail__steps--no-insulin .workflow__step[data-step="2"]:not(:last-child)::after {
  width: 0.26rem;
}

/* ── Lab table (label | input) ── */
.lab-table { padding: 0; }

.lab-unit-system {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border-strong);
  border-left: 4px solid var(--glycemic);
  border-radius: var(--radius-lg);
  background: linear-gradient(90deg, var(--primary-soft) 0%, var(--surface) 100%);
  box-shadow: var(--shadow-xs);
}

.lab-unit-system__copy {
  flex: 1 1 12rem;
  min-width: 0;
}

.lab-unit-system__label {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--primary);
}

.lab-unit-system__hint {
  margin: 0.2rem 0 0;
  font-size: 0.76rem;
  color: var(--text-muted);
}

.lab-unit-system .unit-system-toggle.liquid-segment {
  flex: 0 0 auto;
  min-width: 13.5rem;
}

.lab-units-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0;
  padding: 0.55rem 1rem;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(90deg, var(--surface-raised) 0%, rgba(255, 255, 255, 0.35) 100%);
}

.lab-units-strip__chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(13, 122, 107, 0.28);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 1px 4px rgba(13, 122, 107, 0.08);
}

.lab-units-strip__label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.lab-units-strip__value {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--accent);
}

.lab-row {
  display: grid;
  grid-template-columns: minmax(0, 180px) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--bg-subtle);
  min-width: 0;
}

.lab-row:last-child { border-bottom: none; }

.lab-row:hover { background: var(--primary-soft); }

.lab-row--disabled { opacity: 0.5; }

.lab-row__label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
  padding-top: 0.55rem;
  line-height: 1.3;
}

.lab-row__control {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.lab-row__ref {
  font-size: 0.72rem;
  color: var(--accent);
  font-style: normal;
  font-weight: 500;
}

/* ── Toggle line ── */
.toggle-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 1rem;
  cursor: pointer;
}

.toggle-line__text strong {
  display: block;
  font-size: 0.88rem;
  color: var(--primary);
  margin-bottom: 0.15rem;
}

.toggle-line__text span {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.toggle {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.toggle input { opacity: 0; width: 0; height: 0; position: absolute; }

.toggle__track {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: transparent;
  transition: var(--transition);
}

.toggle--liquid .toggle__track-glass {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    150deg,
    rgba(255, 255, 255, 0.95) 0%,
    var(--bg-subtle) 52%,
    rgba(200, 239, 230, 0.32) 100%
  );
  border: 1.5px solid var(--border);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.92),
    inset 0 -2px 0 rgba(13, 122, 107, 0.06);
  transition:
    transform 0.58s cubic-bezier(0.45, 0.02, 0.15, 1),
    box-shadow 0.5s ease,
    filter 0.45s ease,
    border-color 0.45s ease,
    background 0.45s ease;
}

.toggle--liquid .toggle__knob {
  position: absolute;
  left: 3px;
  top: 3px;
  width: 18px;
  height: 18px;
  z-index: 1;
  transition: transform 0.58s cubic-bezier(0.45, 0.02, 0.15, 1);
}

.toggle--liquid .toggle__knob-glass {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: linear-gradient(
    150deg,
    #ffffff 0%,
    #c8efe6 42%,
    rgba(13, 122, 107, 0.22) 100%
  );
  border: 1.5px solid rgba(13, 122, 107, 0.48);
  box-shadow:
    0 3px 10px rgba(13, 122, 107, 0.2),
    0 0 0 1px rgba(255, 255, 255, 0.75),
    inset 0 2px 0 rgba(255, 255, 255, 0.95),
    inset 0 -1px 0 rgba(13, 122, 107, 0.1);
  transition:
    transform 0.58s cubic-bezier(0.45, 0.02, 0.15, 1),
    box-shadow 0.5s ease,
    filter 0.45s ease,
    border-color 0.45s ease;
}

.toggle--liquid input:checked + .toggle__track .toggle__track-glass {
  background: linear-gradient(
    150deg,
    #ffffff 0%,
    #c8efe6 38%,
    rgba(13, 122, 107, 0.42) 100%
  );
  border-color: rgba(13, 122, 107, 0.58);
  box-shadow:
    0 4px 16px rgba(13, 122, 107, 0.28),
    0 0 0 1px rgba(255, 255, 255, 0.65),
    inset 0 2px 0 rgba(255, 255, 255, 0.95),
    inset 0 -2px 0 rgba(13, 122, 107, 0.14);
}

.toggle--liquid input:checked + .toggle__track .toggle__knob {
  transform: translateX(20px);
}

.toggle--liquid input:checked + .toggle__track .toggle__knob-glass {
  background: linear-gradient(150deg, #ffffff 0%, #f4fffc 55%, #e8f7f2 100%);
  border-color: rgba(13, 122, 107, 0.62);
  box-shadow:
    0 4px 12px rgba(13, 122, 107, 0.26),
    0 0 0 1px rgba(255, 255, 255, 0.9),
    inset 0 2px 0 rgba(255, 255, 255, 1),
    inset 0 -1px 0 rgba(13, 122, 107, 0.08);
}

.toggle--liquid input:focus-visible + .toggle__track .toggle__track-glass {
  box-shadow:
    0 0 0 3px rgba(13, 122, 107, 0.18),
    inset 0 2px 0 rgba(255, 255, 255, 0.92);
}

.toggle__track-glass[data-hover-state="intent"] {
  transform: scaleX(var(--stretch-x, 1.06));
  filter: brightness(1.06) saturate(1.05);
  border-color: rgba(13, 122, 107, 0.52);
}

.toggle__knob-glass[data-hover-state="active"],
.toggle__track-glass[data-hover-state="active"] {
  filter: brightness(1.1) saturate(1.06);
}

.toggle__knob-glass[data-hover-state="intent"] {
  transform: translate3d(var(--pull-x, 0), 0, 0);
}

/* Legacy toggle fallback (if any remain) */
.toggle:not(.toggle--liquid) .toggle__track {
  background: var(--border);
}

.toggle:not(.toggle--liquid) .toggle__track::before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  background: var(--white);
  border-radius: 50%;
  box-shadow: var(--shadow-xs);
  transition: transform var(--transition);
}

.toggle:not(.toggle--liquid) input:checked + .toggle__track { background: var(--accent); }
.toggle:not(.toggle--liquid) input:checked + .toggle__track::before { transform: translateX(20px); }
.toggle:not(.toggle--liquid) input:focus-visible + .toggle__track { box-shadow: 0 0 0 3px rgba(13, 122, 107, 0.2); }

/* ── Dose grid ── */
.dose-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  padding: 1rem;
}

/* ── Form footer ── */
.form-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.65rem;
  padding-top: 1rem;
  margin-top: 0.25rem;
  border-top: 2px solid var(--border);
}

.form-footer--split { justify-content: space-between; }

.form-footer--results {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
  flex-wrap: nowrap;
}

.form-footer--results > .btn--secondary {
  flex: 0 1 auto;
  min-width: 0;
}

.form-footer--results > .btn--liquid {
  flex: 0 1 auto;
  min-width: 0;
}

.form-footer__export {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.28rem;
  flex: 0 0 auto;
  min-width: 0;
}

.btn--export {
  flex-direction: row;
  gap: 0.22rem;
  padding: 0.4rem 0.5rem;
  min-width: 0;
  width: auto;
  min-height: 34px;
  height: 34px;
  font-size: 0.7rem;
  line-height: 1;
}

.btn--export .btn__label {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1;
  text-transform: uppercase;
}

.btn--export .btn__icon {
  width: 11px;
  height: 11px;
}

.btn--primary.btn--export::after {
  border-radius: var(--radius);
}

.btn__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.btn__icon svg {
  display: block;
  width: 100%;
  height: 100%;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  -webkit-appearance: none;
  appearance: none;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 0.55rem 1.15rem;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  min-height: 38px;
}

.btn:active { transform: translateY(1px); }

.btn--label-swap {
  min-width: 11.75rem;
}

.btn-label-swap {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
  overflow: hidden;
  min-height: 1.3em;
  line-height: 1.3;
}

.btn-label-swap__line {
  grid-row: 1;
  grid-column: 1;
  white-space: nowrap;
  transition:
    transform 0.58s cubic-bezier(0.45, 0.02, 0.15, 1),
    opacity 0.42s ease;
}

.btn--label-swap[data-lab-action="calculate"] .btn-label-swap__line:nth-child(1) {
  transform: translateY(0);
  opacity: 1;
}

.btn--label-swap[data-lab-action="calculate"] .btn-label-swap__line:nth-child(2) {
  transform: translateY(110%);
  opacity: 0;
  pointer-events: none;
}

.btn--label-swap[data-lab-action="insulin"] .btn-label-swap__line:nth-child(1) {
  transform: translateY(-110%);
  opacity: 0;
  pointer-events: none;
}

.btn--label-swap[data-lab-action="insulin"] .btn-label-swap__line:nth-child(2) {
  transform: translateY(0);
  opacity: 1;
}

.btn--primary {
  background: linear-gradient(135deg, #1a6b8a 0%, #1a4d6d 100%);
  color: var(--white);
  border-color: #153f5a;
  box-shadow: 0 2px 6px rgba(26, 77, 109, 0.25);
}

.btn--primary:hover {
  background: linear-gradient(135deg, #1a4d6d 0%, #0f3548 100%);
  border-color: #0f3548;
  box-shadow: 0 3px 10px rgba(26, 77, 109, 0.3);
}

.btn--secondary {
  background: var(--white);
  color: var(--text);
  border-color: var(--border-strong);
}

.btn--secondary:hover {
  background: var(--surface-raised);
  border-color: var(--text-muted);
}

.btn--ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border);
}

.btn--ghost:hover {
  background: var(--surface-raised);
  color: var(--text);
}

.btn--sm {
  padding: 0.4rem 0.85rem;
  font-size: 0.8rem;
  min-height: 34px;
}

.btn--block {
  width: 100%;
  margin-top: 0.55rem;
  justify-content: center;
}

/* ── Liquid action buttons ── */
.btn--liquid {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
}

.btn-liquid__label {
  position: relative;
  z-index: 1;
}

.btn-liquid__glass {
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  pointer-events: none;
  transition:
    transform 0.58s cubic-bezier(0.45, 0.02, 0.15, 1),
    box-shadow 0.5s ease,
    filter 0.45s ease,
    border-color 0.45s ease,
    background 0.45s ease;
}

.btn-liquid__glass::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    120deg,
    transparent 22%,
    rgba(255, 255, 255, 0.72) 50%,
    transparent 78%
  );
  opacity: 0.75;
  animation: liquidShimmer 3.8s ease-in-out infinite;
}

.btn--liquid.btn--primary .btn-liquid__glass {
  background: linear-gradient(155deg, #2389a8 0%, #1a4d6d 52%, #0c3347 100%);
  border: 1.5px solid rgba(255, 255, 255, 0.22);
  box-shadow:
    0 4px 14px rgba(12, 51, 71, 0.45),
    0 0 0 1px rgba(0, 0, 0, 0.1),
    inset 0 2px 0 rgba(255, 255, 255, 0.28),
    inset 0 -2px 0 rgba(0, 0, 0, 0.15);
}

.btn--liquid.btn--primary {
  color: var(--white);
}

.btn--liquid.btn--primary:hover .btn-liquid__glass {
  transform: scale(1.028);
  filter: brightness(1.12) saturate(1.08);
  box-shadow:
    0 8px 26px rgba(12, 51, 71, 0.52),
    0 0 0 1px rgba(0, 0, 0, 0.12),
    inset 0 2px 0 rgba(255, 255, 255, 0.36),
    inset 0 -2px 0 rgba(0, 0, 0, 0.12);
  border-color: rgba(255, 255, 255, 0.34);
}

.btn--liquid.btn--secondary .btn-liquid__glass {
  background: linear-gradient(
    150deg,
    #ffffff 0%,
    #d4ecf4 42%,
    rgba(26, 77, 109, 0.22) 100%
  );
  border: 1.5px solid rgba(26, 77, 109, 0.42);
  box-shadow:
    0 4px 14px rgba(26, 77, 109, 0.16),
    0 0 0 1px rgba(255, 255, 255, 0.7),
    inset 0 2px 0 rgba(255, 255, 255, 0.98),
    inset 0 -2px 0 rgba(26, 77, 109, 0.12);
}

.btn--liquid.btn--secondary {
  color: var(--text);
}

.btn--liquid.btn--secondary:hover .btn-liquid__glass {
  transform: scale(1.028);
  filter: brightness(1.08) saturate(1.06);
  box-shadow:
    0 6px 20px rgba(26, 77, 109, 0.22),
    0 0 0 1px rgba(255, 255, 255, 0.75),
    inset 0 2px 0 rgba(255, 255, 255, 1),
    inset 0 -2px 0 rgba(26, 77, 109, 0.1);
  border-color: rgba(26, 77, 109, 0.55);
}

.btn--liquid.btn--ghost .btn-liquid__glass {
  background: linear-gradient(
    150deg,
    rgba(255, 255, 255, 0.92) 0%,
    rgba(228, 240, 246, 0.75) 100%
  );
  border: 1.5px solid rgba(26, 77, 109, 0.28);
  box-shadow:
    0 2px 10px rgba(26, 77, 109, 0.1),
    inset 0 2px 0 rgba(255, 255, 255, 0.9),
    inset 0 -1px 0 rgba(26, 77, 109, 0.08);
}

.btn--liquid.btn--ghost {
  color: var(--text-secondary);
}

.btn--liquid.btn--ghost:hover {
  color: var(--text);
}

.btn--liquid.btn--ghost:hover .btn-liquid__glass {
  transform: scale(1.028);
  filter: brightness(1.1);
  background: linear-gradient(
    150deg,
    #ffffff 0%,
    #e8f2f7 100%
  );
  border-color: rgba(26, 77, 109, 0.45);
  box-shadow:
    0 5px 16px rgba(26, 77, 109, 0.16),
    0 0 0 1px rgba(255, 255, 255, 0.8),
    inset 0 2px 0 rgba(255, 255, 255, 0.95),
    inset 0 -2px 0 rgba(26, 77, 109, 0.1);
}

.btn--liquid:hover .btn-liquid__glass::after {
  animation-duration: 1.6s;
  opacity: 0.95;
}

.btn--liquid:active .btn-liquid__glass {
  transform: scale(0.985);
  filter: brightness(0.98);
}

.btn--liquid:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ── Tag ── */
.tag {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  background: var(--bg-subtle);
  color: var(--text-muted);
  letter-spacing: 0.03em;
}

/* ── Results ── */
.results {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.result-card {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--white);
  box-shadow: var(--shadow-sm);
}

.result-card--wide { /* full width default in column layout */ }

.result-card__head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1rem;
  background: linear-gradient(90deg, var(--primary-soft) 0%, var(--surface-raised) 100%);
  border-bottom: 1px solid var(--border);
  border-left: 5px solid var(--primary);
}

.result-card[data-theme="blue"] .result-card__head { border-left-color: var(--glycemic); }
.result-card[data-theme="teal"] .result-card__head { border-left-color: var(--accent); }
.result-card[data-theme="violet"] .result-card__head { border-left-color: var(--ir); }
.result-card[data-theme="rose"] .result-card__head { border-left-color: var(--high-risk); }
.result-card[data-theme="amber"] .result-card__head { border-left-color: var(--insulin); }
.result-card[data-theme="orange"] .result-card__head { border-left-color: #c2410c; }

.result-card__icon { display: none; }

.result-card__title {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--primary);
}

.result-card__body { padding: 0; }

.result-metric {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1.5rem;
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--bg-subtle);
  align-items: baseline;
}

.result-metric:last-child { border-bottom: none; }

.result-metric:nth-child(even) { background: var(--primary-soft); }

.result-metric__label {
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.result-metric__value {
  font-family: var(--mono);
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text);
  text-align: right;
}

.result-metric--highlight .result-metric__value {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--primary);
}

.result-card__summary {
  margin: 0;
  padding: 0.65rem 1rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  background: var(--primary-soft);
  border-top: 1px solid var(--border);
  line-height: 1.45;
}

.result-badge {
  display: inline-block;
  margin-left: 0.4rem;
  font-family: var(--font);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.1rem 0.45rem;
  border-radius: 3px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  vertical-align: middle;
}

.result-badge--high {
  background: #fce7f3;
  color: var(--high-risk);
}

.result-badge--low {
  background: #d1fae5;
  color: var(--low-risk);
}

/* ── Warnings ── */
.warnings {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
  border-radius: var(--radius-lg);
}

.warnings__title {
  margin: 0 0 0.5rem;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--warning-text);
}

.warnings__list {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.78rem;
  color: var(--warning-text);
  line-height: 1.55;
}

.warnings__list li + li { margin-top: 0.3rem; }

.warnings--input {
  background: #fef2f2;
  border-color: #fecaca;
}

.warnings--input .warnings__title {
  color: #991b1b;
}

.warnings--input .warnings__list {
  color: #7f1d1d;
}

.warnings.panel--notice {
  background: linear-gradient(90deg, var(--accent-soft) 0%, var(--surface-raised) 100%);
  border: 1px solid rgba(13, 122, 107, 0.22);
  border-left: 4px solid var(--accent);
  box-shadow: var(--shadow-xs);
}

.warnings.panel--notice .warnings__title {
  font-size: 0.68rem;
  letter-spacing: 0.07em;
  color: var(--accent);
}

.warnings.panel--notice .warnings__list {
  color: var(--text-secondary);
}

.empty-state {
  padding: 2.5rem 1rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
}

/* ── Footer & toast ── */
.site-footer {
  max-width: 1140px;
  margin: 0 auto;
  padding: 1rem 1.25rem 1.5rem;
  text-align: center;
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* ── Modal ── */
.modal[hidden] {
  display: none !important;
}

body.is-modal-open {
  overflow: hidden;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.modal__panel {
  position: relative;
  width: min(100%, 420px);
  padding: 1.25rem 1.35rem 1.15rem;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}

.modal__title {
  margin: 0 0 0.65rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}

.modal__text {
  margin: 0 0 0.45rem;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--text);
}

.modal__hint {
  margin: 0 0 1rem;
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--text-muted);
}

.modal__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.modal__actions .btn {
  flex: 1 1 140px;
}

.toast {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: var(--white);
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: var(--shadow-sm);
  z-index: 200;
}

.toast[hidden] { display: none; }

/* Responsive → css/responsive.css */
@media print {
  .no-print { display: none !important; }

  body { background: #fff; }

  .header {
    background: #fff;
    color: #000;
    border-bottom: 2px solid #000;
    box-shadow: none;
  }

  .header__backdrop { display: none; }

  .header__title-endo,
  .header__title-panel { color: #000; -webkit-text-fill-color: #000; }

  .header__title-meta {
    -webkit-text-fill-color: #0d5c4a;
    color: #0d5c4a;
  }

  .header__eyebrow,
  .header__tagline,
  .header__modules li { color: #333; }

  .header__workflow { display: none; }

  .page { display: block; max-width: none; padding: 0; }
  .content { border: none; box-shadow: none; }

  .view { display: none !important; padding: 0; }
  .view#screen-4 { display: block !important; }

  .print-only { display: block !important; }

  .print-meta {
    break-inside: avoid;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #111;
  }

  .print-letterhead__mark {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .result-card { break-inside: avoid; }
  .warnings { break-inside: avoid; }

  @page {
    margin: 1.5cm;
  }
}
