/* ── Reset & Base ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --page-gutter: 20px;
  --header-side: 78px;
  --navy:    #0D2B55;
  --blue:    #3A82B8;
  --red:     #B03030;
  --orange:  #D4770B;
  --green:   #5A8E1C;
  --purple:  #6A3F8E;
  --mauve:   #8B7BA8;
  --gray:    #8A8A8E;
  --border:  #D1D1D6;
  --bg:      #F2F2F7;
  --white:   #FFFFFF;
  --text:    #1C1C1E;
  --subtext: #3A3A3C;
  --header-h: 52px;
  /** Visible header bar height below safe-area (taller on home for logo + branding). */
  --header-bar: 52px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bot: env(safe-area-inset-bottom, 0px);
}

body.app-on-home {
  --header-bar: 110px;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  touch-action: manipulation;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Helvetica Neue', sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  touch-action: manipulation;
  min-height: 100vh;
  padding-top: calc(var(--header-bar) + var(--safe-top));
  padding-bottom: var(--safe-bot);
}

/* ── Header ───────────────────────────────────────────── */
#app-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: var(--navy);
  height: calc(var(--header-bar) + var(--safe-top));
  padding-top: var(--safe-top);
  display: grid;
  grid-template-columns: var(--header-side) 1fr auto;
  grid-template-rows: minmax(var(--header-bar), auto);
  align-items: center;
  box-sizing: border-box;
}

/* Top-right help: spans full header row so it does not wrap to a second grid row */
#header-help-btn.header-help-corner {
  grid-column: 1 / -1;
  grid-row: 1;
  z-index: 10;
  align-self: start;
  justify-self: end;
  margin-top: 6px;
  margin-right: max(10px, calc(6px + env(safe-area-inset-right, 0px)));
}

body.app-on-home #app-header {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
}

.header-back-slot {
  grid-column: 1;
  grid-row: 1;
  z-index: 3;
  align-self: center;
  justify-self: start;
}

.header-brand-stack {
  grid-column: 2;
  grid-row: 1;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: var(--header-bar);
  pointer-events: none;
}

body.app-on-home .header-brand-stack {
  grid-column: 1;
  align-items: flex-start;
  justify-content: center;
  padding: 10px 4px 10px 16px;
}

.header-tools-slot {
  grid-column: 3;
  grid-row: 1;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-height: var(--header-bar);
  padding-right: max(10px, calc(6px + env(safe-area-inset-right, 0px)));
}

/* Keep right gutter when logo is hidden so title max-width matches layout */
body:not(.app-on-home) .header-tools-slot {
  min-width: var(--header-side);
}

body.app-on-home .header-tools-slot {
  grid-column: 2;
  align-self: stretch;
  /* Leave room for corner ? button (34px + border + gap) */
  padding-right: max(48px, calc(40px + env(safe-area-inset-right, 0px)));
}

.header-help {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}
.header-help:active {
  background: rgba(255, 255, 255, 0.22);
}

.header-right-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-shrink: 0;
  height: 100%;
}

body.app-on-home .header-right-tools {
  align-items: center;
}

.header-paramedic-brand {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  pointer-events: none;
  line-height: 1.08;
  margin-top: 2px;
}
.header-paramedic-brand[hidden] {
  display: none !important;
}
.header-paramedic-line {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.92);
  text-transform: uppercase;
}

body.app-on-home .header-paramedic-line {
  font-size: clamp(11px, 3.5vw, 15px);
  font-weight: 800;
  letter-spacing: 0.1em;
  line-height: 1.15;
  color: #fff;
}

#header-logo-btn[hidden] {
  display: none !important;
}
.header-logo-btn {
  flex-shrink: 0;
  min-width: 44px;
  min-height: 44px;
  max-width: 56px;
  padding: 4px;
  border: 1px dashed rgba(255, 255, 255, 0.4);
  border-radius: 10px;
  background: transparent;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}
body.app-on-home .header-logo-btn {
  min-width: 120px;
  min-height: 80px;
  max-width: 140px;
  height: calc(100% - 12px);
  max-height: 100px;
  align-self: center;
  padding: 4px;
  border-radius: 12px;
  border-width: 2px;
}
.header-logo-btn:active {
  background: rgba(255, 255, 255, 0.08);
}
.header-logo-btn.header-logo-btn--custom {
  border: none;
  background: transparent;
  padding: 0;
}
body.app-on-home .header-logo-btn.header-logo-btn--custom {
  padding: 0;
}
.header-logo-img {
  display: block;
  max-height: 40px;
  max-width: 50px;
  width: auto;
  height: auto;
  object-fit: contain;
}
body.app-on-home .header-logo-img {
  max-height: 96px;
  max-width: 130px;
}
.header-logo-img[hidden] {
  display: none !important;
}
.header-logo-placeholder {
  font-size: 8px;
  font-weight: 600;
  line-height: 1.3;
  color: rgba(255, 255, 255, 0.7);
  text-align: center;
  max-width: 52px;
  text-transform: none;
  letter-spacing: 0.02em;
}
body.app-on-home .header-logo-placeholder {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  max-width: 120px;
}
.header-logo-placeholder[hidden] {
  display: none !important;
}

.logo-picker-panel.help-modal-panel {
  max-height: min(78vh, 560px);
}
.logo-picker-body .logo-picker-empty {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--subtext);
  line-height: 1.45;
}
.logo-picker-body .logo-picker-empty code {
  font-size: 12px;
  word-break: break-all;
}
.logo-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
  gap: 12px;
}
.logo-picker-choice {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 8px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--white);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  font-size: 12px;
  color: var(--text);
  text-align: center;
  min-height: 100px;
}
.logo-picker-choice:active {
  filter: brightness(0.96);
}
.logo-picker-choice img {
  width: 100%;
  max-width: 88px;
  height: 64px;
  object-fit: contain;
}
.logo-picker-choice-label {
  line-height: 1.25;
  word-break: break-word;
}

#header-title {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.35px;
  color: #fff;
  text-align: center;
  width: auto;
  max-width: 100%;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
  line-height: 1.2;
}

body.app-on-home #header-title {
  font-size: clamp(22px, 6.5vw, 29px);
  font-weight: 700;
  text-align: left;
  max-width: 100%;
  white-space: normal;
  line-height: 1.2;
  letter-spacing: 0.2px;
  overflow: visible;
  text-overflow: clip;
}

/* Never show Back on home (PWA / WebKit can ignore [hidden] vs display:flex fights) */
body.app-on-home #back-btn {
  display: none !important;
}
#back-btn[hidden] {
  display: none !important;
}

.header-back {
  position: relative;
  z-index: 2;
  background: none;
  border: none;
  padding: 10px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  color: #fff;
  font-size: 15px;
  -webkit-tap-highlight-color: transparent;
}

.header-back::after { content: 'Back'; font-size: 15px; color: #fff; }

/* ── Install help modal ───────────────────────────────── */
.help-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(20px, env(safe-area-inset-top, 20px)) 16px max(24px, env(safe-area-inset-bottom, 24px));
  touch-action: none;
  overscroll-behavior: none;
}
.help-modal[hidden] {
  display: none !important;
}
.help-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  touch-action: none;
}
.help-modal-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  max-height: min(72vh, 520px);
  background: var(--white);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  touch-action: auto;
}
@media (min-height: 700px) {
  .help-modal-panel {
    max-height: min(68vh, 540px);
  }
}
.help-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  background: var(--navy);
  color: #fff;
  flex-shrink: 0;
}
.help-modal-header h2 {
  font-size: 17px;
  font-weight: 700;
  margin: 0;
  letter-spacing: 0.2px;
}
.help-modal-close {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}
.help-modal-close:active {
  background: rgba(255, 255, 255, 0.25);
}
.help-modal-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 16px 20px 20px;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
}
.help-modal-lead {
  margin: 0 0 18px;
  color: var(--subtext);
  font-size: 14px;
}
.help-modal-section {
  margin-bottom: 22px;
}
.help-modal-section:last-child {
  margin-bottom: 0;
}
.help-modal-section h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--navy);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin: 0 0 10px;
}
.help-modal-steps {
  margin: 0;
  padding-left: 22px;
}
.help-modal-steps li {
  margin-bottom: 10px;
  padding-left: 4px;
}
.help-modal-steps li:last-child {
  margin-bottom: 0;
}
.help-modal-note {
  margin: 14px 0 0;
  font-size: 13px;
  color: var(--subtext);
  padding: 12px 14px;
  background: var(--bg);
  border-radius: 10px;
  border-left: 3px solid var(--blue);
}
.help-modal-para {
  margin: 0 0 12px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
}
.help-modal-bullets {
  margin: 0;
  padding-left: 20px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
}
.help-modal-bullets li {
  margin-bottom: 12px;
}
.help-modal-bullets li:last-child {
  margin-bottom: 0;
}
.help-icon-inline {
  font-size: 12px;
  opacity: 0.85;
}
/* ── Reference image fullscreen viewer (pinch / pan) ───── */
.ref-image-viewer {
  position: fixed;
  inset: 0;
  z-index: 2500;
  display: flex;
  flex-direction: column;
  background: #0c0c0e;
}
.ref-image-viewer[hidden] {
  display: none !important;
}
.ref-image-viewer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 0;
}
.ref-image-viewer-topbar {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 14px 10px;
  flex-shrink: 0;
  background: linear-gradient(to bottom, rgba(12, 12, 14, 0.58), rgba(12, 12, 14, 0));
}
.ref-image-viewer-fit {
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  background: rgba(12, 12, 14, 0.5);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.ref-image-viewer-fit:active {
  background: rgba(12, 12, 14, 0.7);
}
.ref-image-viewer-close {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  background: rgba(12, 12, 14, 0.62);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  transition: opacity 0.18s ease, transform 0.18s ease, background 0.18s ease;
  -webkit-tap-highlight-color: transparent;
}
.ref-image-viewer-close:active {
  background: rgba(12, 12, 14, 0.8);
}
.ref-image-viewer.ref-image-viewer-ui-hidden .ref-image-viewer-close {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.92);
}
.ref-image-viewer-outer {
  flex: 1;
  position: relative;
  z-index: 1;
  min-height: 0;
  overflow: hidden;
  touch-action: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ref-image-viewer-stage {
  display: inline-block;
  transform-origin: center center;
  will-change: transform;
}
.ref-image-viewer-stage img {
  display: block;
  max-width: none;
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}
.ref-image-viewer-hint {
  flex-shrink: 0;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.55);
  padding: 8px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  margin: 0;
}
html.ref-image-viewer-open,
body.ref-image-viewer-open {
  overflow: hidden !important;
  touch-action: none;
}

html.help-modal-open,
body.help-modal-open {
  overflow: hidden;
  touch-action: none;
}

/* ── Views ────────────────────────────────────────────── */
.view { display: none; min-height: calc(100vh - var(--header-bar) - var(--safe-top)); }
.view.active { display: block; }

/* ── Home Screen ──────────────────────────────────────── */
.home-search-bar {
  padding-top: 12px;
}

.home-nav { display: flex; flex-direction: column; }

/* Global search: remove nav + footer from layout so results sit below search bar (iOS-friendly) */
#view-home.home-searching .home-nav,
#view-home.home-searching .home-footer {
  display: none;
}

.home-nav-btn {
  display: flex;
  align-items: center;
  padding: 0 20px;
  height: 60px;
  border: none;
  cursor: pointer;
  font-size: 17px;
  font-weight: 500;
  color: #fff;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
  transition: filter 0.1s;
  letter-spacing: 0.1px;
}
.home-nav-btn:active { filter: brightness(0.88); }

.cat-pcp       { background: var(--red); }
.cat-special   { background: var(--gray); }
.cat-companion { background: var(--orange); }
.cat-reference { background: var(--purple); }
.cat-calculators { background: #115e59; color: #fff; }
.cat-medications { background: #1e40af; color: #fff; }

.home-footer {
  text-align: center;
  font-size: 10px;
  color: var(--gray);
  padding: 20px 16px 16px;
  line-height: 1.5;
  letter-spacing: 0.3px;
}

.home-footer-title {
  font-weight: 700;
  letter-spacing: 0.12em;
  font-size: 9px;
  color: var(--subtext);
  margin-bottom: 10px;
  line-height: 1.35;
}

.home-footer-versions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 10px;
  max-width: 420px;
  margin: 0 auto;
}

.home-footer-tag {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.65);
  font-size: 9px;
  font-weight: 600;
  color: var(--subtext);
  letter-spacing: 0.02em;
  line-height: 1.25;
}

/* ── Search Bar ───────────────────────────────────────── */
.search-bar-wrap {
  background: var(--bg);
  padding: 8px 16px;
}
.search-bar-wrap.sticky {
  position: sticky;
  top: calc(var(--header-bar) + var(--safe-top));
  z-index: 50;
  border-bottom: 1px solid var(--border);
}
.search-bar {
  background: var(--white);
  border-radius: 10px;
  display: flex;
  align-items: center;
  padding: 6px 10px;
  gap: 8px;
  border: 1px solid var(--border);
}
.search-icon { flex-shrink: 0; }
.search-bar input {
  border: none;
  outline: none;
  font-size: 16px;
  flex: 1;
  min-width: 0;
  background: transparent;
  color: var(--text);
}
.search-bar input::placeholder { color: #8E8E93; }

.search-clear {
  flex-shrink: 0;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: #c7c7cc;
  color: #fff;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.search-clear::before {
  content: '';
  position: absolute;
  inset: -13px;
}
.search-clear[hidden] {
  display: none !important;
}
.search-clear svg {
  display: block;
}
.search-clear:active {
  opacity: 0.7;
}

/* ── Search Results ───────────────────────────────────── */
.search-results {
  background: var(--white);
  max-height: calc(100dvh - var(--header-bar) - var(--safe-top) - 80px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.search-result-item {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.search-result-item:active { background: var(--bg); }
.search-result-title { font-size: 15px; color: var(--blue); font-weight: 500; }
.search-result-cat   { font-size: 12px; color: var(--gray); margin-top: 2px; }

/* ── Category List ────────────────────────────────────── */
.category-list { background: var(--bg); }

.cat-section { margin-bottom: 0; }

.cat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  height: 52px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.cat-header:active { filter: brightness(0.9); }

.cat-header-title { font-size: 17px; font-weight: 500; color: #fff; }

.cat-chevron {
  width: 12px; height: 12px;
  border-right: 2px solid rgba(255,255,255,0.7);
  border-bottom: 2px solid rgba(255,255,255,0.7);
  transform: rotate(45deg);
  transition: transform 0.22s ease;
  flex-shrink: 0;
}
.cat-header.collapsed .cat-chevron { transform: rotate(-45deg); }

.cat-items { background: var(--white); overflow: hidden; }
.cat-items.collapsed { display: none; }

.directive-row {
  padding: 13px 16px 13px 20px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  -webkit-tap-highlight-color: transparent;
  min-height: 48px;
  background: var(--white);
}
.directive-row:last-child { border-bottom: none; }
.directive-row:active { background: var(--bg); }
.directive-row-title {
  font-size: 15px;
  color: var(--blue);
  line-height: 1.3;
  flex: 1;
  padding-right: 8px;
}
.directive-row-chevron {
  width: 8px; height: 8px;
  border-right: 1.5px solid var(--border);
  border-top: 1.5px solid var(--border);
  transform: rotate(45deg);
  flex-shrink: 0;
  margin-top: 1px;
}

.bls-group-chevron {
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--border);
  border-bottom: 2px solid var(--border);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
  flex-shrink: 0;
  margin-top: 1px;
}

.directive-row--bls-group.expanded .bls-group-chevron {
  transform: rotate(-135deg);
}

.bls-group-count {
  font-size: 12px;
  color: var(--subtext);
  font-weight: 400;
  margin-left: 6px;
}

.bls-group-sublist {
  overflow: hidden;
  transition: max-height 0.25s ease;
}
.bls-group-sublist.collapsed {
  display: none;
}

.directive-row--bls-standard {
  padding-left: 32px;
  background: #f7f8fb;
  border-left: 3px solid var(--purple);
}

/* ── BLS Standards (PCP) ───────────────────────────────── */
.bls-lead {
  margin: 0 0 10px;
  color: var(--subtext);
  line-height: 1.45;
  font-size: 14px;
}

.bls-standards-wrap {
  display: grid;
  gap: 10px;
}

.bls-standard {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--white);
  overflow: hidden;
}

.bls-standard summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  -webkit-tap-highlight-color: transparent;
}
.bls-standard summary::-webkit-details-marker { display: none; }

.bls-standard-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
}

.bls-standard-chevron {
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--gray);
  border-bottom: 2px solid var(--gray);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}
.bls-standard[open] .bls-standard-chevron {
  transform: rotate(-135deg);
  margin-top: 4px;
}

.bls-standard-body {
  padding: 2px 14px 12px;
}

.bls-critical {
  border-left: 3px solid var(--red);
  background: rgba(205, 58, 73, 0.08);
  color: var(--text);
  font-size: 13px;
  line-height: 1.4;
  padding: 8px 10px;
  border-radius: 8px;
  margin: 4px var(--page-gutter) 10px;
}

.bls-points {
  margin: 0;
  padding-left: 18px;
}
.bls-points li {
  margin: 6px 0;
  line-height: 1.45;
  color: var(--text);
  font-size: 14px;
}

/* BLS directive verbatim content */
.bls-preamble {
  font-size: 14px;
  color: var(--text-secondary);
  font-style: italic;
  padding: 4px var(--page-gutter) 6px;
  line-height: 1.45;
}
.bls-directive-list {
  margin: 0;
  padding-left: calc(var(--page-gutter) + 18px);
  padding-right: var(--page-gutter);
  list-style-type: decimal;
}
.bls-directive-list > li {
  margin: 8px 0;
  line-height: 1.5;
  color: var(--text);
  font-size: 14px;
}
.bls-sub-list {
  margin: 4px 0;
  padding-left: 20px;
  list-style-type: lower-alpha;
}
.bls-sub-list > li {
  margin: 4px 0;
  line-height: 1.45;
  font-size: 13.5px;
}
.bls-sub-sub-list {
  margin: 4px 0;
  padding-left: 18px;
  list-style-type: lower-roman;
}
.bls-sub-sub-list > li {
  margin: 3px 0;
  line-height: 1.4;
  font-size: 13px;
}
.bls-guideline-box {
  margin: 8px var(--page-gutter) 4px;
  border-left: 3px solid var(--blue);
  background: rgba(58, 134, 205, 0.08);
  border-radius: 8px;
  padding: 8px 12px;
}
.bls-guideline-heading {
  font-weight: 600;
  font-size: 13px;
  color: var(--blue);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.bls-guideline-list {
  margin: 0;
  padding-left: 16px;
}
.bls-guideline-list li {
  margin: 4px 0;
  line-height: 1.4;
  color: var(--text);
  font-size: 13.5px;
}

/* Guideline sub-section headings */
.bls-guideline-subheading {
  font-weight: 700;
  font-size: 13.5px;
  color: var(--text);
  margin: 10px 0 4px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.bls-guideline-subheading:first-child {
  margin-top: 2px;
  padding-top: 0;
  border-top: none;
}

/* Key clinical value highlights */
.bls-val {
  font-weight: 700;
  color: var(--blue);
  background: rgba(58, 134, 205, 0.12);
  padding: 0.06em 0.28em;
  border-radius: 4px;
  max-width: 100%;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.bls-val.bls-val--red {
  color: #b42318;
  background: rgba(180, 35, 24, 0.12);
}

/* DNR / definitions blocks */
.section-card.bls-def-section {
  background: rgba(58, 134, 205, 0.06);
  border: 1px solid rgba(58, 134, 205, 0.2);
}
.section-card.bls-def-section .section-heading {
  color: var(--blue);
  font-size: 14px;
}
.section-card.bls-def-section .bls-preamble {
  font-size: 13px;
}
.section-card.bls-def-section .bls-directive-list > li {
  font-size: 13.5px;
}

/* Section / group intro (Medical & Trauma BLS) */
.bls-section-intro {
  margin: 0 var(--page-gutter) 12px;
  padding: 10px 12px;
  background: rgba(139, 92, 246, 0.08);
  border-left: 3px solid var(--purple);
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-secondary);
}
.bls-section-intro p {
  margin: 0 0 8px;
}
.bls-section-intro p:last-child {
  margin-bottom: 0;
}

/* Body-system labels (e.g. anaphylaxis criteria) */
.bls-body-system {
  display: inline-block;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--purple);
  margin-right: 4px;
}

/* Note callout */
.bls-note {
  margin: 8px 0 4px;
  padding: 8px 12px;
  background: rgba(58, 134, 205, 0.1);
  border-left: 3px solid var(--blue);
  border-radius: 4px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text);
}
.bls-note strong {
  color: var(--blue);
}

.bls-children {
  margin-top: 8px;
  display: grid;
  gap: 8px;
}

.bls-standard--nested {
  border-radius: 10px;
  background: var(--bg);
}
.bls-standard--nested .bls-standard-title {
  font-size: 14px;
}

/* Category color classes */
.bg-navy    { background: var(--navy); }
.bg-blue    { background: var(--blue); }
.bg-red     { background: var(--red); }
.bg-orange  { background: var(--orange); }
.bg-green   { background: var(--green); }
.bg-purple  { background: var(--purple); }
.bg-mauve   { background: var(--mauve); }
.bg-gray    { background: var(--gray); }

/* ── Companion Banner ─────────────────────────────────── */
.companion-banner {
  background: var(--orange);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 1px;
  padding: 14px 18px;
  text-align: left;
}

/* ── Detail View ──────────────────────────────────────── */
.detail-content { background: var(--bg); padding-bottom: 32px; }

.detail-scope-banner {
  padding: 10px var(--page-gutter);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.detail-cat-banner {
  padding: 12px var(--page-gutter);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
}

.detail-attachments {
  background: #E8E8ED;
  display: flex;
  border-bottom: 1px solid var(--border);
}
.detail-attachments button {
  flex: 1;
  padding: 10px 0;
  background: none;
  border: none;
  border-right: 1px solid var(--border);
  font-size: 13px;
  color: var(--subtext);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.detail-attachments button:last-child { border-right: none; }

.detail-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  padding: 16px var(--page-gutter) 4px;
  background: var(--white);
}
.detail-auth {
  font-size: 13px;
  color: var(--subtext);
  padding: 0 var(--page-gutter) 16px;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  line-height: 1.4;
}

/* Directive sections */
.section-card {
  background: var(--white);
  margin-top: 12px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

/* First body paragraph after a section heading (contact pages, etc.) */
.section-card > .section-heading + p:not(.address-block):not(.contact-muted) {
  padding: 12px var(--page-gutter) 14px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
}

.section-heading {
  font-size: 13px;
  font-weight: 700;
  color: var(--subtext);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 12px var(--page-gutter) 6px;
  border-bottom: 1px solid var(--border);
}

.section-heading.red { color: var(--red); }

.indications-list {
  padding: 10px var(--page-gutter) 14px;
  list-style: none;
}
.indications-list li {
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  padding: 1px 0;
}
.indications-list li.and-connector {
  font-weight: 700;
  font-size: 13px;
  color: var(--subtext);
  padding: 2px 0;
}

/* Conditions tables */
.conditions-block { padding: 0 0 12px; }
.conditions-med-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--blue);
  padding: 10px var(--page-gutter) 6px;
  letter-spacing: 0.2px;
}
.conditions-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  font-size: 13.5px;
}
.conditions-table tr { border-bottom: 1px solid var(--border); }
.conditions-table tr:last-child { border-bottom: none; }
.conditions-table td {
  padding: 7px 10px;
  vertical-align: top;
  line-height: 1.35;
}
.conditions-table td:first-child {
  font-weight: 600;
  color: var(--white);
  background: var(--blue);
  width: 62px;
  white-space: nowrap;
}
.conditions-table td:last-child { color: var(--text); }
.conditions-table tr:nth-child(even) td:last-child { background: #F8F8FA; }

/* Contraindications */
.contra-block { padding: 0 0 4px; }
.contra-med-label {
  font-size: 13px;
  font-weight: 700;
  color: #B03030;
  padding: 10px var(--page-gutter) 4px;
}
.contra-list {
  list-style: none;
  padding: 0 var(--page-gutter) 8px;
}
.contra-list li {
  font-size: 14px;
  color: var(--text);
  padding: 3px 0 3px 14px;
  position: relative;
  line-height: 1.4;
}
.contra-list li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--red);
  font-size: 16px;
  line-height: 1.2;
}

/* Scrollable wrapper for wide tables */
.table-scroll-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0 var(--page-gutter);
}

/* Treatment tables */
.treatment-block { padding: 0 0 12px; }
.treatment-med-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  padding: 10px var(--page-gutter) 6px;
}
.treatment-table {
  width: 100%;
  min-width: 280px;
  border-collapse: collapse;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  font-size: 13px;
}
.treatment-table thead tr { background: var(--navy); }
.treatment-table thead td {
  color: #fff;
  font-weight: 600;
  padding: 7px 8px;
  font-size: 12px;
}
.treatment-table tbody tr { border-bottom: 1px solid var(--border); }
.treatment-table tbody tr:last-child { border-bottom: none; }
.treatment-table tbody td {
  padding: 7px 8px;
  vertical-align: top;
  line-height: 1.35;
  color: var(--text);
}
.treatment-table tbody tr:nth-child(even) { background: #F8F8FA; }

.treatment-note {
  font-size: 12.5px;
  color: var(--subtext);
  padding: 4px var(--page-gutter) 0;
  line-height: 1.4;
  font-style: italic;
}

/* Patch points */
.patch-point {
  background: #FFF3E0;
  border-left: 3px solid var(--orange);
  margin: 0 var(--page-gutter) 8px;
  padding: 10px 12px;
  border-radius: 0 4px 4px 0;
  font-size: 13.5px;
  color: var(--text);
  line-height: 1.45;
}

/* Clinical considerations */
.cc-list {
  list-style: none;
  padding: 8px var(--page-gutter) 12px;
}
.cc-list li {
  font-size: 14px;
  color: var(--text);
  padding: 4px 0 4px 18px;
  position: relative;
  line-height: 1.45;
  border-bottom: 1px solid #F0F0F5;
}
.cc-list li:last-child { border-bottom: none; }
.cc-list li::before {
  content: '▸';
  position: absolute;
  left: 2px;
  color: var(--blue);
  font-size: 11px;
  top: 6px;
}

/* Treat & Discharge / Refer */
.tnd-block { padding: 8px var(--page-gutter) 12px; }
.tnd-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--subtext);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.tnd-list {
  list-style: none;
  padding: 0;
}
.tnd-list li {
  font-size: 14px;
  color: var(--text);
  padding: 4px 0 4px 18px;
  position: relative;
  line-height: 1.45;
}
.tnd-list li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--green);
  font-weight: 700;
  font-size: 13px;
  top: 5px;
}
.tnd-contra-list li::before {
  content: '✗';
  color: var(--red);
}
.tnd-cc {
  font-size: 13.5px;
  color: var(--subtext);
  line-height: 1.5;
  padding: 4px 0 0;
}

/* Companion Detail ── */
.comp-section-block { padding: 0 0 8px; }
.comp-section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--blue);
  padding: 10px var(--page-gutter) 4px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.comp-section-body {
  font-size: 14.5px;
  color: var(--text);
  padding: 2px var(--page-gutter) 10px;
  line-height: 1.6;
  white-space: pre-wrap;
}

/* Palliative Sub-directives */
.palliative-sub {
  background: var(--white);
  margin-top: 12px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.palliative-sub-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--border);
}

/* Special directive item rows (no chevron - full detail inline) */
.special-detail-wrap { background: var(--white); padding: 8px 0 16px; }

/* ── Animations ───────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateX(6px); }
  to   { opacity: 1; transform: translateX(0); }
}
.view.active { animation: fadeIn 0.15s ease; }

/* ── Flowchart ────────────────────────────────────────── */
.flowchart-wrap {
  padding: 8px 16px 12px;
}
.flowchart-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--subtext);
  margin-bottom: 6px;
}
.flowchart-thumb {
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--border);
  cursor: pointer;
}

/* ── My Notes ────────────────────────────────────────── */
.my-notes-anchor {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 16px;
  margin: 12px var(--page-gutter) 16px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--blue);
  cursor: pointer;
}
.my-notes-anchor svg { flex-shrink: 0; }
.my-notes-section {
  background: var(--white);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  margin: 32px var(--page-gutter) 28px;
}
.my-notes-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--navy);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
}
.my-notes-edit-btn {
  background: rgba(255,255,255,0.2);
  border: none;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 4px 14px;
  border-radius: 6px;
  cursor: pointer;
}
.my-notes-display {
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  min-height: 48px;
  white-space: pre-wrap;
  word-break: break-word;
}
.my-notes-display.empty {
  color: var(--gray);
  font-style: italic;
}
.my-notes-textarea {
  width: 100%;
  min-height: 120px;
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.5;
  font-family: inherit;
  color: var(--text);
  border: none;
  border-top: 1px solid var(--border);
  resize: vertical;
  outline: none;
  background: #FAFBFF;
}
.my-notes-actions {
  display: flex;
  gap: 8px;
  padding: 8px 14px 12px;
  justify-content: flex-end;
  border-top: 1px solid var(--border);
  background: #FAFBFF;
}
.my-notes-save-btn, .my-notes-cancel-btn {
  border: none;
  padding: 8px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.my-notes-save-btn {
  background: var(--blue);
  color: #fff;
}
.my-notes-cancel-btn {
  background: var(--bg);
  color: var(--text);
}

/* ── Preamble ────────────────────────────────────────── */
.preamble-section {
  margin-bottom: 12px;
  padding: 12px 16px;
}
.preamble-heading {
  font-size: 15px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 4px;
}
.preamble-body {
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  white-space: pre-line;
}

/* ── Reference Banner ─────────────────────────────────── */
.reference-banner {
  background: var(--purple);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 1px;
  padding: 14px 18px;
  text-align: left;
}

.special-care-banner {
  background: #6b7280;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 14px 18px;
  text-align: center;
}

/* ── Reference Detail ────────────────────────────────── */
.ref-detail { padding: var(--page-gutter); }

.ref-subheading {
  font-size: 14px;
  font-weight: 700;
  color: var(--navy);
  margin: 18px 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.ref-body-text {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  padding: 0 4px;
  margin-bottom: 8px;
}

.ref-note {
  background: #FFF8E1;
  border-left: 3px solid var(--orange);
  padding: 10px 12px;
  margin: 16px 0;
  font-size: 13px;
  line-height: 1.5;
  border-radius: 4px;
}

.ref-image-wrap {
  margin: 12px 0;
  text-align: center;
}
.ref-image-wrap img {
  width: 100%;
  max-width: 500px;
  height: auto;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid var(--border);
}

.ref-placeholder {
  text-align: center;
  padding: 40px 16px;
  color: var(--gray);
  font-size: 15px;
  font-style: italic;
}

/* ── Reference Tables ────────────────────────────────── */
.ref-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin: 8px 0 16px;
}
.ref-table th,
.ref-table td {
  padding: 10px 10px;
  text-align: center;
  border: 1px solid var(--border);
}
.ref-table th {
  background: var(--red);
  color: #fff;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.ref-table-striped tbody tr:nth-child(odd) { background: #fff; }
.ref-table-striped tbody tr:nth-child(even) { background: #f8f8fa; }

.ref-table-apgar th {
  background: var(--navy);
}
.ref-table-apgar td:first-child {
  text-align: left;
  font-weight: 600;
}

/* ── Croup Score Table ────────────────────────────────── */
.ref-table-croup th {
  background: #2c3e6b;
}
.ref-table-croup td:first-child {
  text-align: left;
  font-weight: 600;
  min-width: 110px;
}

/* ── Dextrose Dosing Table ───────────────────────────── */
.ref-table-dextrose th {
  background: #d35400;
}
.ref-table-dextrose td:first-child {
  font-weight: 600;
}
.ref-table-dextrose small {
  display: block;
  font-size: 10px;
  color: #666;
  margin-top: 2px;
}

/* ── ALARM Table ─────────────────────────────────────── */
.ref-table-alarm th {
  background: #c0392b;
}
.ref-table-alarm td:first-child {
  text-align: center;
  font-size: 18px;
  font-weight: 700;
  color: #c0392b;
  width: 50px;
}

/* ── ECG Lead Tables ─────────────────────────────────── */
.ref-lead-table {
  width: 100%;
  border-collapse: collapse;
  margin: 4px 0 12px;
  font-size: 14px;
}
.ref-lead-table td {
  padding: 6px 8px;
  vertical-align: middle;
  border-bottom: 1px solid #eee;
}
.ref-lead-table td:first-child {
  width: 50px;
  text-align: center;
}

.lead-badge {
  display: inline-block;
  width: 30px;
  height: 30px;
  line-height: 30px;
  border-radius: 50%;
  text-align: center;
  font-weight: 700;
  font-size: 12px;
  color: #fff;
}
.lead-v1 { background: #C0392B; }
.lead-v2 { background: #D4AC0D; color: #333; }
.lead-v3 { background: #27874A; }
.lead-v4 { background: #2E86C1; }
.lead-v5 { background: #E67E22; }
.lead-v6 { background: #7D3C98; }
.lead-v4r { background: #2E86C1; }
.lead-v8 { background: #27874A; }
.lead-v9 { background: #27874A; }

.ref-notes-list {
  font-size: 14px;
  line-height: 1.6;
  padding-left: 20px;
  margin: 8px 0 16px;
}
.ref-notes-list li {
  margin-bottom: 6px;
}

/* ── Croup Card Layout ───────────────────────────────── */
.croup-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 10px;
  overflow: hidden;
}
.croup-card-header {
  background: #2c3e6b;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  padding: 8px 12px;
}
.croup-card-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid #eee;
  font-size: 13px;
}
.croup-card-row:last-child { border-bottom: none; }
.croup-score-num {
  display: inline-block;
  background: #2c3e6b;
  color: #fff;
  width: 22px;
  height: 22px;
  line-height: 22px;
  text-align: center;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  margin-right: 6px;
  flex-shrink: 0;
}

/* ── Dextrose Card Layout ────────────────────────────── */
.dextrose-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 12px;
  overflow: hidden;
}
.dextrose-card-header {
  background: #d35400;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  padding: 10px 14px;
}
.dextrose-card-row {
  display: flex;
  justify-content: space-between;
  padding: 7px 14px;
  border-bottom: 1px solid #eee;
  font-size: 13px;
  line-height: 1.4;
}
.dextrose-card-row:last-child { border-bottom: none; }
.dextrose-card-label {
  font-weight: 600;
  color: var(--subtext);
  min-width: 90px;
}
.dextrose-card-value {
  text-align: right;
  color: var(--text);
}

/* ── Compact Dosing Table ────────────────────────────── */
.ref-table-compact {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin: 8px 0 12px;
}
.ref-table-compact th {
  background: var(--navy);
  color: #fff;
  font-weight: 600;
  font-size: 11px;
  padding: 7px 5px;
  text-align: center;
  border: 1px solid var(--border);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.ref-table-compact td {
  padding: 6px 5px;
  text-align: center;
  border: 1px solid var(--border);
  font-size: 12px;
}
.ref-table-compact tbody tr:nth-child(even) { background: #f4f6fa; }

/* ── Dialysis Card ───────────────────────────────────── */
.dialysis-card {
  background: var(--white);
  border-left: 4px solid #27874A;
  border-radius: 0 8px 8px 0;
  margin-bottom: 14px;
  padding: 14px 14px 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.dialysis-card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 8px;
}
.dialysis-card ul {
  list-style: none;
  padding: 0;
}
.dialysis-card li {
  font-size: 13px;
  color: var(--text);
  padding: 4px 0 4px 16px;
  position: relative;
  line-height: 1.45;
}
.dialysis-card li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: #27874A;
  font-size: 11px;
  top: 5px;
}
.dialysis-card li .sub-item {
  padding-left: 14px;
  display: block;
  font-size: 12px;
  color: var(--subtext);
}

/* ── Fentanyl Table ──────────────────────────────────── */
.ref-table-fentanyl th {
  background: var(--navy);
}

/* Fentanyl Youth block - solid color, no internal lines */
.fentanyl-youth-block {
  background: #e8f0fa;
}
.fentanyl-youth-block td,
.fentanyl-youth-block th {
  border: none;
  border-top: none;
}
.fentanyl-youth-block tr {
  border: none;
}
.fentanyl-youth-block tr:first-child td:first-child {
  vertical-align: top;
  font-weight: 700;
}
.fentanyl-patch-banner {
  background: #FFF3E0;
  border-left: 3px solid var(--orange);
  padding: 10px 12px;
  margin: 10px 0 14px;
  font-size: 13px;
  font-weight: 600;
  color: #b36200;
  border-radius: 4px;
}

/* ── Formula Block ───────────────────────────────────── */
.formula-block {
  margin-bottom: 20px;
}
.formula-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--navy);
  text-transform: uppercase;
  text-decoration: underline;
  margin-bottom: 10px;
}
.formula-equation {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.formula-fraction {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  vertical-align: middle;
  margin: 0 4px;
  font-size: 13px;
}
.formula-fraction .num {
  border-bottom: 1px solid var(--text);
  padding: 0 4px 2px;
  text-align: center;
}
.formula-fraction .den {
  padding: 2px 4px 0;
  text-align: center;
}
.formula-note {
  font-size: 13px;
  color: var(--subtext);
  margin-top: 4px;
  line-height: 1.5;
}

/* ── GCS / Coma Scale Calculator ─────────────────────── */
.gcs-total {
  text-align: center;
  font-size: 20px;
  font-weight: 700;
  color: var(--navy);
  padding: 14px 0;
  margin: 8px 0;
  background: var(--white);
  border: 2px solid var(--navy);
  border-radius: 10px;
}
.gcs-total span {
  font-size: 28px;
  color: var(--blue);
}
.gcs-section {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 12px;
  overflow: hidden;
}
.gcs-section-header {
  background: var(--navy);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  padding: 10px 14px;
}
.gcs-option {
  display: flex;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid #eee;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
  font-size: 14px;
}
.gcs-option:last-child { border-bottom: none; }
.gcs-option:active { background: #f0f4ff; }
.gcs-option.selected {
  background: #e3edfa;
}
.gcs-option-score {
  display: inline-block;
  width: 28px;
  height: 28px;
  line-height: 28px;
  text-align: center;
  border-radius: 50%;
  background: var(--bg);
  color: var(--navy);
  font-weight: 700;
  font-size: 13px;
  margin-right: 12px;
  flex-shrink: 0;
  border: 2px solid var(--border);
}
.gcs-option.selected .gcs-option-score {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}
.gcs-reset-btn {
  display: block;
  width: 100%;
  padding: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--red);
  cursor: pointer;
  margin-top: 8px;
}

/* ── iSBAR Cards ─────────────────────────────────────── */
.isbar-wrap {
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.isbar-card {
  display: flex;
  margin-bottom: 0;
  border-bottom: 2px solid #fff;
  overflow: hidden;
}
.isbar-card:last-child { border-bottom: none; }
.isbar-letter-col {
  background: var(--navy);
  color: #fff;
  width: 80px;
  min-width: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 14px 8px;
}
.isbar-letter {
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
}
.isbar-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 4px;
  font-weight: 600;
}
.isbar-content-col {
  flex: 1;
  padding: 12px 14px;
  background: var(--white);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  text-align: left;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text);
  min-width: 0;
}
.isbar-line {
  display: block;
  margin-bottom: 2px;
}
.isbar-line:last-child { margin-bottom: 0; }
.isbar-sub {
  font-size: 11px;
  color: var(--gray);
  margin-top: 2px;
}

/* ── Neonatal SpO2 Table ─────────────────────────────── */
.spo2-table {
  width: 100%;
  max-width: 300px;
  margin: 12px auto;
  border-collapse: collapse;
  font-size: 16px;
}
.spo2-table td {
  padding: 8px 16px;
  text-align: center;
}
.spo2-table td:first-child {
  font-weight: 600;
  color: var(--text);
  text-align: right;
}
.spo2-table td:last-child {
  font-weight: 700;
}
.spo2-1min { color: #1a1a1a; }
.spo2-2min { color: #2E86C1; }
.spo2-3min { color: #8B0000; }
.spo2-4min { color: #C0392B; }
.spo2-5min { color: #E67E22; }
.spo2-10min { color: #27ae60; }

/* ── STEMI Grid ──────────────────────────────────────── */
.stemi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 3px;
  margin: 12px 0;
}
.stemi-cell {
  text-align: center;
  padding: 14px 4px 10px;
  border-radius: 6px;
  color: #fff;
}
.stemi-cell .stemi-lead {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
}
.stemi-cell .stemi-region {
  font-size: 10px;
  letter-spacing: 0.5px;
  opacity: 0.9;
  margin-top: 2px;
}
.stemi-lateral  { background: #2E86C1; }
.stemi-inferior { background: #27874A; }
.stemi-septal   { background: #D4770B; }
.stemi-anterior { background: #C0392B; }
.stemi-none     { background: #8A8A8E; }

.stemi-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  justify-content: center;
}
.stemi-legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text);
}
.stemi-legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

/* ── Utility ──────────────────────────────────────────── */
.text-red   { color: var(--red); }
.text-blue  { color: var(--blue); }
.text-muted { color: var(--gray); font-size: 12px; }
.divider    { height: 1px; background: var(--border); margin: 0 16px; }
.spacer     { height: 12px; }

/* ── Home: Special Event & Contact buttons ───────────── */
.cat-specialevent { background: #6B4E9E; }
.cat-contact      { background: #8B7355; }
.cat-destination  { background: #3d4248; }

/* ── Special Event / Contact list views ──────────────── */
.specialevent-banner,
.contact-top-banner {
  background: var(--navy);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  text-align: center;
  padding: 14px 16px;
}
.contact-top-banner { background: #6d5a4a; }

.destination-top-banner {
  background: #2f343a;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-align: center;
  padding: 14px 16px;
}

.view-intro {
  font-size: 13px;
  color: var(--subtext);
  padding: 12px 16px 8px;
  line-height: 1.45;
  background: var(--bg);
}

.category-list.flat-list {
  background: var(--white);
  border-top: 1px solid var(--border);
}

.bg-specialevent {
  background: linear-gradient(135deg, #5c3d8a 0%, #6B4E9E 100%) !important;
}
.bg-specialevent-sub {
  background: #7d5fb0 !important;
  color: #fff !important;
  font-weight: 600;
}

.contact-banner-mauve {
  background: #8B7355 !important;
  color: #fff !important;
  font-weight: 600;
}

.contact-detail-title {
  font-size: 17px !important;
  line-height: 1.35;
}

.destination-guidelines-banner {
  background: #3d4349 !important;
  color: #fff !important;
  font-weight: 600;
}

.destination-detail-title {
  font-size: 17px !important;
  line-height: 1.35;
}

.destination-source-footer {
  font-size: 12px;
  color: var(--subtext);
  line-height: 1.45;
  padding: 0 max(18px, var(--page-gutter)) 24px;
  margin-top: 8px;
}
.destination-source-footer a {
  color: var(--blue);
  font-weight: 600;
}

.doc-pending-card .contact-muted {
  margin-bottom: 8px;
}

.destination-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 4px 0 8px;
}
.destination-action-btn {
  flex: 1 1 140px;
  min-height: 44px;
  padding: 10px 16px;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  background: var(--navy);
  color: #fff;
  -webkit-tap-highlight-color: rgba(58, 130, 184, 0.25);
}
.destination-action-btn:active {
  opacity: 0.9;
}
.destination-action-btn--secondary {
  background: #115e59;
}

.destination-tool-callout {
  margin-top: 20px;
  padding: 14px 14px 16px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
}
.destination-tool-callout-text {
  margin: 0 0 12px;
  font-size: 14px;
  line-height: 1.5;
  color: #1e3a8a;
}
.destination-tool-callout .destination-action-btn {
  width: 100%;
  flex: none;
}

/* ── Destination Guidelines: long-form pages ─────────── */
.destination-guidelines-page {
  padding-bottom: 8px;
}
.destination-page-title {
  margin: 0;
  padding: 14px max(18px, var(--page-gutter)) 10px;
  font-size: 18px;
  font-weight: 800;
  color: var(--navy);
  line-height: 1.3;
  border-bottom: 1px solid var(--border);
  background: var(--white);
}
.destination-page-title--fit2sit {
  text-decoration: underline;
  text-underline-offset: 5px;
}
.destination-prose {
  padding: 12px max(18px, var(--page-gutter)) 18px;
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
}
.destination-prose p {
  margin: 0 0 12px;
}
.destination-prose p:last-child {
  margin-bottom: 0;
}
.destination-lead {
  font-size: 14px;
  color: var(--subtext);
  margin-bottom: 8px !important;
}
.destination-bls-h3 {
  margin: 18px 0 10px;
  font-size: 15px;
  font-weight: 800;
  color: #5c2d7a;
  letter-spacing: 0.02em;
}
.destination-bls-h3:first-child {
  margin-top: 4px;
}
.destination-inline-list {
  margin: 0 0 12px;
  padding-left: 22px;
  line-height: 1.5;
}
.destination-inline-list li {
  margin-bottom: 8px;
}
.destination-numbered {
  margin: 0 0 12px;
  padding-left: 22px;
  counter-reset: none;
}
.destination-numbered > li {
  margin-bottom: 14px;
  padding-left: 4px;
}
.destination-sublist {
  margin: 8px 0 0;
  padding-left: 18px;
  list-style: disc;
}
.destination-sublist li {
  margin-bottom: 6px;
}
.destination-sublist.tight li {
  margin-bottom: 4px;
}
.destination-sublist-num {
  margin: 6px 0 0;
  padding-left: 18px;
  list-style: decimal;
}
.destination-footnote {
  font-size: 13px;
  color: var(--subtext);
  line-height: 1.45;
  margin-top: 10px !important;
}
.destination-note {
  display: block;
  font-size: 13px;
  color: var(--subtext);
  margin-top: 6px;
}
.destination-table-wrap {
  margin: 10px 0 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  overflow: hidden;
}
.destination-radio-table th,
.destination-radio-table td {
  font-size: 13px;
  vertical-align: top;
}
.destination-fit-table td {
  font-size: 14px;
  line-height: 1.5;
  padding: 10px 12px !important;
}
.destination-must-list {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
}
.destination-must-list li {
  position: relative;
  padding: 10px 0 10px 22px;
  border-bottom: 1px solid #f0f0f5;
  font-size: 15px;
  line-height: 1.5;
}
.destination-must-list li::before {
  content: '▸';
  position: absolute;
  left: 2px;
  color: var(--blue);
  font-size: 12px;
  top: 12px;
}
.destination-hospital-process {
  text-align: center;
  font-size: 16px;
  font-weight: 800;
  color: var(--navy);
  text-decoration: underline;
  margin: 22px 0 14px;
}
.destination-hospital-h4 {
  margin: 18px 0 10px;
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
}
.destination-hospital-steps {
  margin: 0 0 8px;
  padding-left: 22px;
}
.destination-hospital-steps li {
  margin-bottom: 10px;
  padding-left: 4px;
  line-height: 1.5;
}
.destination-smr-start {
  font-weight: 700;
  text-align: center;
  padding: 12px;
  background: #f4f6fa;
  border-radius: 10px;
  border: 1px solid var(--border);
}
.destination-flowchart-wrap {
  background: var(--white);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.destination-action-row--padded {
  padding: 4px max(18px, var(--page-gutter)) 16px;
}

/* ── Contact: links & typography ─────────────────────── */
.tel-link,
.mailto-link {
  color: var(--blue);
  font-weight: 600;
  text-decoration: none;
  padding: 2px 0;
  -webkit-tap-highlight-color: rgba(58, 130, 184, 0.2);
}
.tel-link:active,
.mailto-link:active { opacity: 0.75; }

.contact-intro-card .contact-lead {
  font-size: 14px;
  line-height: 1.55;
  margin: 0;
  padding: 14px var(--page-gutter) 16px;
  color: var(--text);
}
.contact-lead { font-size: 14px; line-height: 1.5; margin-bottom: 12px; color: var(--text); }
.contact-muted {
  font-size: 12px;
  color: var(--gray);
  margin: 0;
  padding: 0 var(--page-gutter) 12px;
  line-height: 1.4;
}
.contact-footnote { font-size: 11px; color: var(--gray); padding: 12px var(--page-gutter) 16px; }
.contact-poster-card { padding: 4px var(--page-gutter) 18px; }

.omc-poster-img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  border: 1px solid var(--border);
  margin-top: 8px;
}

.patch-callout-card {
  text-align: center;
  background: linear-gradient(180deg, #e8f4fc 0%, #d4e9f7 100%);
  border: 1px solid #b8d4ea;
  padding: 18px var(--page-gutter) 22px;
}
.patch-callout-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--navy);
  text-transform: uppercase;
}
.patch-callout-number {
  display: inline-block;
  margin-top: 10px;
  font-size: 28px;
  font-weight: 800;
  color: var(--navy);
  text-decoration: none;
  letter-spacing: 0.5px;
}
.patch-callout-number:active { opacity: 0.8; }

.isbar-stack { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.isbar-card {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 0;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.isbar-letter {
  background: var(--navy);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 6px;
  text-align: center;
}
.isbar-letter span {
  font-size: 26px;
  font-weight: 800;
  line-height: 1;
}
.isbar-letter small {
  display: block;
  margin-top: 6px;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  opacity: 0.9;
  line-height: 1.2;
}
.isbar-body {
  background: var(--white);
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
}

.connection-backup-card {
  background: #eef6fb;
  border-left: 4px solid var(--blue);
}

.org-address-card .address-block {
  font-size: 15px;
  line-height: 1.5;
  margin: 4px 0 8px;
  padding: 0 var(--page-gutter);
}
.kv-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 16px;
  padding: 8px var(--page-gutter);
  border-top: 1px solid var(--border);
  font-size: 14px;
}
.kv-label { font-weight: 600; color: var(--subtext); min-width: 88px; }
.kv-val { flex: 1; min-width: 0; }

/* Physician CPSO chips */
.physician-card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 8px;
  padding: 0 var(--page-gutter) 16px;
}
@media (min-width: 480px) {
  .physician-card-grid { grid-template-columns: repeat(2, 1fr); }
}
.info-chip-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
}
.info-chip-name { font-weight: 600; font-size: 14px; color: var(--text); }
.info-chip-meta { font-size: 12px; color: var(--blue); margin-top: 4px; font-weight: 600; }

/* Staff cards */
.staff-card-list { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; padding: 0 var(--page-gutter) 16px; }
.staff-card {
  background: var(--bg);
  border-radius: 12px;
  padding: 14px 16px;
  border: 1px solid var(--border);
}
.staff-card-name { font-size: 16px; font-weight: 700; color: var(--navy); }
.staff-card-role { font-size: 13px; color: var(--subtext); margin-top: 4px; line-height: 1.35; }
.staff-card-rows {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
  font-size: 14px;
}
.staff-card-rows span em {
  font-style: normal;
  font-weight: 600;
  color: var(--gray);
  margin-right: 6px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* Phone “table” rows */
.phone-table {
  margin: 8px var(--page-gutter) 0;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.phone-table-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  background: var(--white);
  border-bottom: 1px solid var(--border);
}
.phone-table-row:last-child { border-bottom: none; }
.ptr-org { font-weight: 600; font-size: 14px; color: var(--text); line-height: 1.35; }
.ptr-num { font-size: 15px; }

/* CAS cards */
.cas-card-list { display: flex; flex-direction: column; gap: 12px; margin: 10px var(--page-gutter) 16px; }
.cas-card {
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 14px 16px;
  background: linear-gradient(180deg, #fff 0%, #f9fafb 100%);
}
.cas-org { font-weight: 700; font-size: 14px; color: var(--navy); line-height: 1.35; margin-bottom: 10px; }
.cas-lines { display: flex; flex-direction: column; gap: 8px; }
.cas-line { font-size: 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.cas-line span:first-child { color: var(--gray); font-size: 12px; font-weight: 600; min-width: 64px; }

/* Patching template */
.patch-template-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 12px;
  padding: 0 var(--page-gutter) 16px;
}
.patch-field {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  background: #fafbfc;
}
.patch-field-wide { grid-column: 1 / -1; }
.patch-field-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--navy);
  margin-bottom: 8px;
}
.patch-choices { font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--gray); font-size: 12px; }
.patch-blank {
  min-height: 36px;
  border-radius: 6px;
  border: 1px dashed #c5c5c7;
  background: #fff;
}
.patch-blank-tall { min-height: 64px; }
.patch-subgrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.patch-line {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--subtext);
}
.patch-line-full { grid-column: 1 / -1; }

/* On-scene option cards */
.option-cards { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; padding: 0 var(--page-gutter) 16px; }
.option-card {
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 14px 16px;
  background: var(--white);
}
.option-card h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 8px;
}
.option-card p { font-size: 14px; line-height: 1.45; color: var(--text); }

.numbered-steps {
  margin: 10px var(--page-gutter) 0;
  padding-left: 22px;
  padding-right: var(--page-gutter);
  font-size: 14px;
  line-height: 1.55;
}
.numbered-steps li { margin-bottom: 10px; }

/* ── Pre-Sepsis Tool (FAST ParaHEWS) ───────────────────── */
.view.presepsis-view {
  background: #f1f5f9;
  min-height: calc(100vh - var(--header-bar) - var(--safe-top));
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.presepsis-view.presepsis--footer-on {
  padding-bottom: calc(112px + env(safe-area-inset-bottom, 0px));
}
.presepsis-scroll {
  max-width: 42rem;
  margin: 0 auto;
  padding: 12px 16px 24px;
}
.presepsis-local-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding: 8px 0;
}
.presepsis-local-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.25;
}
.presepsis-local-title svg {
  flex-shrink: 0;
  color: var(--blue);
}
.presepsis-local-sub {
  font-size: 0.8rem;
  color: #64748b;
  font-weight: 600;
  margin-top: 4px;
}
.presepsis-reset-btn {
  flex-shrink: 0;
  padding: 10px 14px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #2563eb;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.presepsis-reset-btn:active {
  background: #dbeafe;
}
.presepsis-card {
  background: #fff;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  padding: 18px 16px;
  margin-bottom: 16px;
}
.presepsis-card h2 {
  font-size: 1.05rem;
  font-weight: 800;
  color: #1e293b;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.presepsis-card h2 svg {
  flex-shrink: 0;
  color: var(--blue);
}
.presepsis-gateway-q {
  color: #475569;
  font-size: 1.05rem;
  margin-bottom: 14px;
  line-height: 1.4;
}
.presepsis-yesno {
  display: flex;
  gap: 12px;
}
.presepsis-yesno button {
  flex: 1;
  padding: 16px 12px;
  font-size: 1.05rem;
  font-weight: 800;
  border-radius: 12px;
  border: 2px solid #e2e8f0;
  background: #fff;
  color: #64748b;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.presepsis-yesno button.presepsis--selected-yes {
  border-color: #3b82f6;
  background: #eff6ff;
  color: #1d4ed8;
}
.presepsis-yesno button.presepsis--selected-no {
  border-color: #64748b;
  background: #f1f5f9;
  color: #334155;
}
/* Our display:flex below beats the browser’s default [hidden]{display:none} — force hide when hidden */
#presepsis-not-indicated[hidden],
#presepsis-para-section[hidden],
#presepsis-footer[hidden],
#presepsis-alert-idle[hidden],
#presepsis-alert-active[hidden] {
  display: none !important;
}

.presepsis-not-indicated {
  margin-top: 14px;
  padding: 14px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 10px;
  color: #166534;
  font-size: 0.95rem;
  line-height: 1.45;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.presepsis-not-indicated strong { display: block; margin-bottom: 4px; }
.presepsis-para-card h2 { margin-bottom: 18px; }
.presepsis-param-block {
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 20px;
  margin-bottom: 20px;
}
.presepsis-param-block:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}
.presepsis-param-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.presepsis-param-head h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: #334155;
}
.presepsis-param-score {
  margin-left: auto;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 4px 8px;
  background: #f1f5f9;
  border-radius: 6px;
  color: #475569;
}
.presepsis-opt-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.presepsis-opt-btn {
  flex: 1 1 calc(33.333% - 8px);
  min-width: 96px;
  padding: 12px 8px;
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: 10px;
  border: 2px solid #e2e8f0;
  background: #fff;
  color: #475569;
  cursor: pointer;
  text-align: center;
  line-height: 1.25;
  transition: transform 0.12s, box-shadow 0.12s;
  -webkit-tap-highlight-color: transparent;
}
.presepsis-opt-btn .presepsis-opt-val {
  display: block;
  font-size: 0.65rem;
  font-weight: 600;
  opacity: 0.65;
  margin-top: 4px;
}
.presepsis-opt-btn.presepsis-opt--on .presepsis-opt-val { display: none; }
.presepsis-opt-btn.presepsis-opt--on {
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  transform: scale(1.02);
  color: #fff;
}
.presepsis-opt-btn.presepsis-opt--on.tier-g { background: #22c55e; }
.presepsis-opt-btn.presepsis-opt--on.tier-y { background: #facc15; color: #1c1917; }
.presepsis-opt-btn.presepsis-opt--on.tier-o { background: #f97316; }
.presepsis-opt-btn.presepsis-opt--on.tier-r { background: #dc2626; }
.presepsis-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  background: #fff;
  border-top: 1px solid #e2e8f0;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.06);
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
}
.presepsis-footer-inner {
  max-width: 42rem;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: stretch;
}
@media (min-width: 480px) {
  .presepsis-footer-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}
.presepsis-total-label {
  font-size: 0.7rem;
  font-weight: 800;
  color: #64748b;
  letter-spacing: 0.06em;
}
.presepsis-total-num {
  font-size: 2rem;
  font-weight: 900;
  color: #0f172a;
  line-height: 1;
}
.presepsis-alert-panel {
  flex: 1;
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
  background: #f1f5f9;
  color: #64748b;
  font-weight: 600;
  font-size: 0.95rem;
}
.presepsis-alert-panel.presepsis-alert--on {
  background: #dc2626;
  color: #fff;
  animation: presepsis-pulse 2s ease-in-out infinite;
}
.presepsis-alert-active-row {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
}
.presepsis-alert--on .presepsis-alert-active-row {
  color: #fff;
}
@keyframes presepsis-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.92; }
}
.presepsis-alert-panel svg {
  flex-shrink: 0;
}
.presepsis-alert-title {
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: 0.02em;
}
.presepsis-alert-sub {
  font-size: 0.8rem;
  font-weight: 600;
  opacity: 0.95;
  margin-top: 4px;
}

/* ── LAMS chart (Medical References) ───────────────────── */
.lams-chart-wrap {
  margin: 14px 0 8px;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid #1a1a1a;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
.lams-chart-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  line-height: 1.35;
}
.lams-chart-table th,
.lams-chart-table td {
  border: 2px solid #1a1a1a;
  padding: 10px 8px;
  text-align: center;
  vertical-align: middle;
}
.lams-chart-th-cat {
  width: 28%;
  background: #f8fafc;
  font-weight: 800;
  color: #0f172a;
}
.lams-chart-th-score {
  width: 14%;
}
.lams-chart-cat-cell {
  background: #fff;
  font-weight: 800;
  color: #0f172a;
  font-size: 13px;
}
.lams-score-cell {
  font-weight: 800;
  font-size: 15px;
}
.lams-bg-green {
  background: #22c55e !important;
  color: #fff !important;
}
.lams-bg-yellow {
  background: #facc15 !important;
  color: #1c1917 !important;
}
.lams-bg-red {
  background: #dc2626 !important;
  color: #fff !important;
}

/* ── LAMS Calculator view ─────────────────────────────── */
.view.lams-view {
  background: #f1f5f9;
  min-height: calc(100vh - var(--header-bar) - var(--safe-top));
  padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
}
.lams-scroll {
  max-width: 28rem;
  margin: 0 auto;
  padding: 12px 14px 0;
}
.lams-header-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #fff;
  border-radius: 16px;
  padding: 16px 18px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  margin-bottom: 20px;
}
.lams-header-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: #dbeafe;
  color: #2563eb;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lams-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.2;
}
.lams-subtitle {
  margin: 4px 0 0;
  font-size: 0.85rem;
  color: #64748b;
  font-weight: 600;
}
.lams-section {
  margin-bottom: 22px;
}
.lams-section-title {
  margin: 0 0 10px 4px;
  font-size: 1.05rem;
  font-weight: 800;
  color: #1e293b;
}
.lams-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.lams-opt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 14px 16px;
  border-radius: 14px;
  border: 2px solid #e2e8f0;
  background: #fff;
  font-size: 1.05rem;
  font-weight: 700;
  color: #334155;
  cursor: pointer;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.lams-opt:active {
  transform: scale(0.99);
}
.lams-opt-val {
  font-size: 1.25rem;
  font-weight: 800;
  color: #94a3b8;
}
.lams-opt--on-green .lams-opt-val,
.lams-opt--on-red .lams-opt-val {
  color: rgba(255, 255, 255, 0.95);
}
.lams-opt--on-yellow .lams-opt-val {
  color: #1c1917;
}
.lams-opt--on-green {
  background: #22c55e !important;
  border-color: transparent !important;
  color: #fff !important;
  box-shadow: 0 2px 10px rgba(34, 197, 94, 0.35);
}
.lams-opt--on-yellow {
  background: #facc15 !important;
  border-color: transparent !important;
  color: #1c1917 !important;
  box-shadow: 0 2px 10px rgba(250, 204, 21, 0.4);
}
.lams-opt--on-red {
  background: #dc2626 !important;
  border-color: transparent !important;
  color: #fff !important;
  box-shadow: 0 2px 10px rgba(220, 38, 38, 0.35);
}
.lams-guidance {
  margin-bottom: 16px;
}
.lams-guidance-inner {
  border-radius: 16px;
  padding: 16px 16px 14px;
  border: 2px solid transparent;
}
.lams-guidance--high {
  background: #fef2f2;
  border-color: #fecaca !important;
}
.lams-guidance--std {
  background: #fefce8;
  border-color: #fde047 !important;
}
.lams-guidance-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.lams-guidance-icon {
  flex-shrink: 0;
  color: #dc2626;
  display: flex;
}
.lams-guidance--std .lams-guidance-icon {
  color: #ca8a04;
}
.lams-guidance-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
}
.lams-guidance--high .lams-guidance-title {
  color: #991b1b;
}
.lams-guidance--std .lams-guidance-title {
  color: #854d0e;
}
.lams-guidance-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.lams-guidance-list li {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 0.95rem;
  line-height: 1.45;
}
.lams-guidance--high .lams-guidance-list li {
  color: #7f1d1d;
}
.lams-guidance--std .lams-guidance-list li {
  color: #713f12;
}
.lams-g-li-num {
  font-weight: 800;
  flex-shrink: 0;
}
.lams-criteria-block {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}
.lams-criteria-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 4px;
  border: none;
  background: transparent;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  color: inherit;
}
.lams-guidance--high .lams-criteria-toggle {
  color: #991b1b;
}
.lams-guidance--std .lams-criteria-toggle {
  color: #854d0e;
}
.lams-chevron {
  flex-shrink: 0;
  transition: transform 0.2s ease;
}
.lams-criteria-toggle--open .lams-chevron {
  transform: rotate(180deg);
}
.lams-criteria-list {
  margin: 8px 0 0;
  padding-left: 20px;
  font-size: 0.88rem;
  line-height: 1.45;
  color: #475569;
}
.lams-criteria-list li {
  margin-bottom: 6px;
}
.lams-crosslink {
  margin: 18px 0 4px;
  padding: 14px 14px 16px;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 14px;
}
.lams-crosslink-text {
  margin: 0 0 12px;
  font-size: 13px;
  line-height: 1.45;
  font-weight: 600;
  color: #0c4a6e;
}
.lams-crosslink-btn {
  width: 100%;
  min-height: 44px;
  padding: 12px 14px;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  background: #0369a1;
  color: #fff;
  -webkit-tap-highlight-color: transparent;
}
.lams-crosslink-btn:active {
  opacity: 0.92;
}
.lams-disclaimer {
  font-size: 12px;
  color: #64748b;
  text-align: center;
  margin: 8px 8px 0;
  line-height: 1.4;
}
.lams-scroll-spacer {
  height: 24px;
}
.lams-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  background: #fff;
  border-top: 1px solid #e2e8f0;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.06);
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 100%;
}
.lams-footer-left {
  flex: 1;
  min-width: 0;
}
.lams-total-label {
  font-size: 0.7rem;
  font-weight: 800;
  color: #64748b;
  letter-spacing: 0.06em;
  margin: 0 0 2px;
}
.lams-total-row {
  margin: 0;
  line-height: 1;
}
#lams-total-num {
  font-size: 2.25rem;
  font-weight: 900;
  color: #0f172a;
}
.lams-total-denom {
  font-size: 1rem;
  font-weight: 600;
  color: #94a3b8;
  margin-left: 4px;
}
.lams-severity {
  margin: 6px 0 0;
  font-size: 0.8rem;
  font-weight: 800;
}
.lams-severity--muted {
  color: #64748b;
  font-weight: 600;
}
.lams-severity--lvo {
  color: #dc2626;
}
.lams-severity--std {
  color: #ca8a04;
}
.lams-reset-btn {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: 12px;
  border: none;
  background: #f1f5f9;
  color: #475569;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.lams-reset-btn:active {
  background: #e2e8f0;
}

.destination-prose .destination-prose-strong {
  margin-top: 1.25rem !important;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-weight: 700;
  font-size: 15px;
  line-height: 1.45;
}

/* ── Pediatric Values (Medical References) ─────────────── */
.ref-body-list {
  margin: 8px 0 16px;
  padding-left: 22px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
}
.ref-body-list li {
  margin-bottom: 8px;
}
.ped-ref-formula-h {
  margin-top: 18px !important;
  color: #1a4a8c !important;
}
.ped-ref-table-wrap {
  margin: 10px 0 14px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.ped-vitals-table th {
  background: #1a365d !important;
  color: #fff !important;
  text-transform: none;
  font-size: 13px;
  letter-spacing: 0.02em;
}
.ped-vitals-table td:first-child {
  font-weight: 600;
  text-align: left;
}
.ped-loa-note {
  margin-top: 8px;
}
.ref-calc-launch-wrap {
  margin: 20px 0 8px;
  padding: 0 4px;
}
.ref-open-calc-btn {
  display: block;
  width: 100%;
  max-width: 22rem;
  margin: 0 auto;
  padding: 14px 18px;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  background: #1a365d;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 2px 8px rgba(26, 54, 93, 0.25);
}
.ref-open-calc-btn:active {
  filter: brightness(0.95);
}

/* ── Pediatric Values Calculator view ────────────────── */
.view.ped-calc-view {
  background: #f8fafc;
  min-height: calc(100vh - var(--header-bar) - var(--safe-top));
  padding: 12px 12px 28px;
  padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px));
}
.ped-calc-scroll {
  max-width: 26rem;
  margin: 0 auto;
}
.ped-calc-card {
  background: #fff;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(15, 23, 42, 0.12);
  border: 1px solid #e2e8f0;
}
.ped-calc-hero {
  background: #1a365d;
  color: #fff;
  text-align: center;
  padding: 22px 18px 20px;
}
.ped-calc-hero-icon {
  margin: 0 auto 10px;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #93c5fd;
}
.ped-calc-hero-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.03em;
}
.ped-calc-hero-sub {
  margin: 6px 0 0;
  font-size: 0.88rem;
  color: #bfdbfe;
  font-weight: 600;
}
.ped-calc-badge {
  display: inline-block;
  margin-top: 12px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(30, 58, 95, 0.55);
  border: 1px solid rgba(147, 197, 253, 0.35);
  color: #e0f2fe;
}
.ped-calc-input-panel {
  padding: 18px 16px;
  background: #eff6ff;
  border-bottom: 1px solid #dbeafe;
}
.ped-calc-label {
  display: block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #1a365d;
  margin-bottom: 8px;
}
.ped-calc-input-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
}
.ped-calc-select {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  font-size: 16px;
  font-weight: 600;
  color: #1e293b;
  background: #fff;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.ped-calc-select--grow {
  flex: 1;
  min-width: 0;
}
.ped-calc-results {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ped-calc-result-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #fff;
}
.ped-calc-result-card--block {
  flex-direction: column;
  align-items: stretch;
}
.ped-calc-result-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
}
.ped-calc-result-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ped-calc-icon-blue {
  background: #dbeafe;
  color: #1a365d;
}
.ped-calc-icon-red {
  background: #fee2e2;
  color: #dc2626;
}
.ped-calc-icon-teal {
  background: #ccfbf1;
  color: #0d9488;
}
.ped-calc-icon-yellow {
  background: #fef9c3;
  color: #ca8a04;
}
.ped-calc-result-label {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
}
.ped-calc-result-value {
  margin: 4px 0 0;
  font-size: 1.65rem;
  font-weight: 800;
  color: #1a365d;
  line-height: 1.1;
}
.ped-calc-result-value--sm {
  font-size: 1.35rem;
}
.ped-calc-result-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: #1a365d;
}
.ped-calc-bp-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 8px;
}
.ped-calc-bp-box {
  padding: 12px;
  border-radius: 10px;
  text-align: center;
}
.ped-calc-bp-norm {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
}
.ped-calc-bp-hypo {
  background: #fef2f2;
  border: 1px solid #fecaca;
}
.ped-calc-bp-tag {
  margin: 0 0 4px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.ped-calc-bp-norm .ped-calc-bp-tag {
  color: #15803d;
}
.ped-calc-bp-hypo .ped-calc-bp-tag {
  color: #b91c1c;
}
.ped-calc-bp-val {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
}
.ped-calc-bp-norm .ped-calc-bp-val {
  color: #14532d;
}
.ped-calc-bp-hypo .ped-calc-bp-val {
  color: #7f1d1d;
}
.ped-calc-vitals-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 4px;
}
.ped-calc-footnote {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 14px 16px;
  background: #f1f5f9;
  border-top: 1px solid #e2e8f0;
  font-size: 11px;
  line-height: 1.45;
  color: #64748b;
}
.ped-calc-foot-icon {
  flex-shrink: 0;
  color: #94a3b8;
  margin-top: 2px;
}
.ped-calc-reset-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: calc(100% - 32px);
  margin: 12px 16px 18px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  font-size: 15px;
  font-weight: 700;
  color: #475569;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.ped-calc-reset-btn:active {
  background: #f1f5f9;
}

/* ── Oxygen tank duration calculator ─────────────────────── */
.view.o2-calc-view {
  background: #f8fafc;
  min-height: calc(100vh - var(--header-bar) - var(--safe-top));
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.o2-calc-scroll {
  max-width: 28rem;
  margin: 0 auto;
  padding: 12px 14px 24px;
}
.o2-calc-header {
  background: linear-gradient(135deg, #0d9488 0%, #115e59 100%);
  color: #fff;
  border-radius: 16px;
  padding: 20px 18px;
  margin-bottom: 14px;
  text-align: center;
  box-shadow: 0 4px 16px rgba(17, 94, 89, 0.28);
}
.o2-calc-header-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 8px;
  opacity: 0.95;
}
.o2-calc-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.o2-calc-sub {
  margin: 8px 0 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.35;
}
.o2-calc-card {
  background: #fff;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  padding: 18px 16px;
  margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}
.o2-calc-field {
  margin-bottom: 18px;
}
.o2-calc-field:last-child {
  margin-bottom: 0;
}
.o2-calc-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #334155;
  margin-bottom: 6px;
}
.o2-calc-input-suffix {
  position: relative;
}
.o2-calc-input {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 44px 12px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  color: #0f172a;
  background: #fff;
  -webkit-tap-highlight-color: transparent;
}
.o2-calc-input:focus {
  outline: none;
  border-color: #0d9488;
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.2);
}
.o2-calc-suffix {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  font-weight: 600;
  color: #94a3b8;
  pointer-events: none;
}
.o2-calc-flow-row {
  display: flex;
  gap: 0;
  align-items: stretch;
}
.o2-calc-input--flow {
  flex: 1;
  min-width: 0;
  border-radius: 10px 0 0 10px;
  padding-right: 12px;
  border-right: 0;
}
.o2-calc-select {
  font-size: 15px;
  font-weight: 600;
  color: #1e293b;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.o2-calc-select:focus {
  outline: none;
  border-color: #0d9488;
}
.o2-calc-select--unit {
  flex-shrink: 0;
  min-width: 7.5rem;
  padding: 12px 10px;
  border-radius: 0 10px 10px 0;
}
.o2-calc-select--full {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
}
.o2-calc-hint {
  margin: 8px 0 0;
  font-size: 12px;
  font-weight: 600;
  color: #0d9488;
}
.o2-calc-results {
  background: #f1f5f9;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  padding: 18px 16px 16px;
  margin-bottom: 12px;
}
.o2-calc-results-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  color: #115e59;
}
.o2-calc-results-head svg {
  flex-shrink: 0;
}
.o2-calc-results-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: #0f172a;
}
.o2-calc-result-box {
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  padding: 16px;
  text-align: center;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.o2-calc-result-empty {
  color: #94a3b8;
  font-size: 15px;
  font-weight: 600;
  padding: 8px 0;
}
.o2-calc-mins {
  margin: 0;
  font-size: 2.25rem;
  font-weight: 800;
  color: #0d9488;
  line-height: 1.1;
}
.o2-calc-mins-unit {
  font-size: 1rem;
  font-weight: 600;
  color: #64748b;
}
.o2-calc-formatted {
  margin: 8px 0 0;
  font-size: 15px;
  font-weight: 600;
  color: #475569;
}
.o2-calc-formula {
  margin: 14px 0 0;
  font-size: 11px;
  line-height: 1.45;
  color: #64748b;
  text-align: center;
}
.o2-calc-reset-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #fff;
  font-size: 15px;
  font-weight: 700;
  color: #475569;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.o2-calc-reset-btn:active {
  background: #f1f5f9;
}

/* ── Weight converter (lbs ↔ kg) ───────────────────────── */
.view.wt-calc-view {
  background: #f8fafc;
  min-height: calc(100vh - var(--header-bar) - var(--safe-top));
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.wt-calc-scroll {
  max-width: 28rem;
  margin: 0 auto;
  padding: 12px 14px 24px;
}
.wt-calc-card {
  background: #fff;
  border-radius: 20px;
  border: 1px solid #e2e8f0;
  padding: 22px 18px 18px;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
}
.wt-calc-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 22px;
}
.wt-calc-head-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: #dbeafe;
  color: #1d4ed8;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.wt-calc-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
}
.wt-calc-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
}
@media (min-width: 480px) {
  .wt-calc-row {
    flex-direction: row;
    align-items: flex-end;
    gap: 12px;
  }
  .wt-calc-arrow {
    padding-bottom: 10px;
    flex-shrink: 0;
  }
  .wt-calc-arrow svg {
    transform: rotate(0deg);
  }
}
.wt-calc-col {
  flex: 1;
  min-width: 0;
}
.wt-calc-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #475569;
  margin-bottom: 8px;
}
.wt-calc-input-wrap {
  position: relative;
}
.wt-calc-input {
  width: 100%;
  box-sizing: border-box;
  padding: 14px 48px 14px 14px;
  font-size: 17px;
  font-weight: 600;
  color: #0f172a;
  border: 2px solid #e2e8f0;
  border-radius: 16px;
  background: #fff;
  -webkit-tap-highlight-color: transparent;
}
.wt-calc-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}
.wt-calc-input::placeholder {
  color: #94a3b8;
  font-weight: 500;
}
.wt-calc-unit {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  font-weight: 600;
  color: #94a3b8;
  pointer-events: none;
}
.wt-calc-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #cbd5e1;
  padding: 4px 0;
}
.wt-calc-arrow svg {
  transform: rotate(90deg);
}
.wt-calc-formula {
  margin: 20px 0 0;
  padding: 14px 12px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: #64748b;
  background: #f8fafc;
  border: 1px solid #f1f5f9;
  border-radius: 14px;
}
.wt-calc-reset-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #fff;
  font-size: 15px;
  font-weight: 700;
  color: #475569;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.wt-calc-reset-btn:active {
  background: #f1f5f9;
}

/* ── Medical dosage calculator ──────────────────────────── */
.view.dosage-calc-view {
  background: #f8fafc;
  min-height: calc(100vh - var(--header-bar) - var(--safe-top));
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.dosage-calc-scroll {
  max-width: 56rem;
  margin: 0 auto;
  padding: 10px 14px 20px;
}
.dosage-calc-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid #e2e8f0;
}
.dosage-calc-header-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: #d1fae5;
  color: #047857;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.dosage-calc-h1 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.dosage-calc-lead {
  margin: 4px 0 0;
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
}
.dosage-calc-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
@media (min-width: 900px) {
  .dosage-calc-grid {
    flex-direction: row;
    align-items: flex-start;
    gap: 20px;
  }
  .dosage-calc-col--inputs {
    flex: 1 1 58%;
    min-width: 0;
  }
  .dosage-calc-col--results {
    flex: 1 1 38%;
    min-width: 260px;
  }
}
.dosage-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 16px 14px;
  margin-bottom: 14px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}
.dosage-card:last-of-type {
  margin-bottom: 0;
}
.dosage-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  color: #047857;
}
.dosage-card-head svg {
  flex-shrink: 0;
}
.dosage-card-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
}
.dosage-row-2 {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}
.dosage-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.dosage-field--grow {
  flex: 1;
  min-width: 0;
}
.dosage-field--unit {
  width: 32%;
  min-width: 5.5rem;
  flex-shrink: 0;
}
.dosage-label {
  font-size: 12px;
  font-weight: 600;
  color: #475569;
}
.dosage-input,
.dosage-select {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  font-size: 16px;
  font-weight: 600;
  color: #0f172a;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #fff;
  -webkit-tap-highlight-color: transparent;
}
.dosage-input:focus,
.dosage-select:focus {
  outline: none;
  border-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}
.dosage-input--inline {
  flex: 1;
  min-width: 0;
}
.dosage-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.dosage-tab {
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  font-size: 12px;
  font-weight: 700;
  color: #475569;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.dosage-tab--on {
  background: #d1fae5;
  border-color: #a7f3d0;
  color: #065f46;
}
.dosage-panels {
  background: #f8fafc;
  border: 1px solid #f1f5f9;
  border-radius: 12px;
  padding: 14px 12px;
}
.dosage-panel[hidden] {
  display: none !important;
}
.dosage-in-volume {
  margin: 12px 0;
  text-align: center;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #94a3b8;
  background: #e2e8f0;
  padding: 6px 12px;
  border-radius: 999px;
  display: block;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
}
.dosage-inline-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.dosage-inline-hint {
  font-size: 14px;
  font-weight: 700;
  color: #475569;
  white-space: nowrap;
}
.dosage-inline-hint--lg {
  font-size: 1.25rem;
}
.dosage-help {
  margin: 8px 0 0;
  font-size: 11px;
  line-height: 1.4;
  color: #64748b;
}
.dosage-result-card {
  background: linear-gradient(145deg, #059669 0%, #047857 100%);
  color: #fff;
  border-radius: 14px;
  padding: 18px 16px;
  margin-bottom: 14px;
  box-shadow: 0 6px 20px rgba(5, 150, 105, 0.35);
  position: relative;
  overflow: hidden;
}
.dosage-result-label {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.88);
}
.dosage-result-empty {
  margin-top: 10px;
}
.dosage-result-empty p {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.4;
}
.dosage-result-value {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin-top: 8px;
}
.dosage-result-num {
  font-size: 2.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
}
.dosage-result-unit {
  font-size: 1.15rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.85);
  padding-bottom: 4px;
}
.dosage-tutor-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 16px 14px;
  margin-bottom: 12px;
}
.dosage-tutor-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid #f1f5f9;
  color: #047857;
}
.dosage-tutor-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: #0f172a;
}
.dosage-tutor-placeholder {
  text-align: center;
  padding: 20px 8px;
  color: #94a3b8;
  font-size: 14px;
  font-weight: 600;
}
.dosage-tutor-placeholder[hidden],
.dosage-tutor-steps[hidden] {
  display: none !important;
}
.dosage-tutor-steps {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.dosage-step {
  display: flex;
  gap: 12px;
  align-items: stretch;
}
.dosage-step-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 28px;
  flex-shrink: 0;
}
.dosage-step-badge {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #d1fae5;
  color: #047857;
  font-size: 13px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.dosage-step-line {
  flex: 1;
  width: 3px;
  min-height: 8px;
  margin: 4px 0;
  background: #d1fae5;
  border-radius: 2px;
}
.dosage-step-body {
  flex: 1;
  min-width: 0;
  padding-bottom: 16px;
}
.dosage-step-title {
  margin: 0;
  font-size: 13px;
  font-weight: 800;
  color: #0f172a;
}
.dosage-step-desc {
  margin: 6px 0 0;
  font-size: 13px;
  line-height: 1.45;
  color: #475569;
}
.dosage-tutor-tip {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 8px;
  padding: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.45;
  color: #475569;
}
.dosage-tutor-tip[hidden] {
  display: none !important;
}
.dosage-tutor-tip svg {
  flex-shrink: 0;
  color: #3b82f6;
  margin-top: 2px;
}
.dosage-tutor-tip p {
  margin: 0;
}
.dosage-reset-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #fff;
  font-size: 15px;
  font-weight: 700;
  color: #475569;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.dosage-reset-btn:active {
  background: #f1f5f9;
}
.dosage-disclaimer {
  margin: 16px 0 0;
  font-size: 11px;
  line-height: 1.45;
  color: #64748b;
  text-align: center;
}

/* ── Parkland burn calculator ───────────────────────────── */
.view.parkland-view {
  background: #f8fafc;
  min-height: calc(100vh - var(--header-bar) - var(--safe-top));
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.parkland-scroll {
  max-width: 56rem;
  margin: 0 auto;
  padding: 10px 14px 20px;
}
.parkland-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}
.parkland-header-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: #dc2626;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.35);
}
.parkland-h1 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.parkland-sub {
  margin: 4px 0 0;
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
}
.parkland-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
@media (min-width: 900px) {
  .parkland-grid {
    flex-direction: row;
    align-items: flex-start;
    gap: 20px;
  }
  .parkland-card--inputs {
    flex: 0 0 38%;
    max-width: 22rem;
  }
  .parkland-results-wrap {
    flex: 1;
    min-width: 0;
  }
}
.parkland-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 16px 14px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}
.parkland-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
}
.parkland-card-title svg {
  color: #dc2626;
  flex-shrink: 0;
}
.parkland-field {
  margin-bottom: 16px;
}
.parkland-field:last-child {
  margin-bottom: 0;
}
.parkland-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  margin-bottom: 6px;
}
.parkland-weight-row {
  display: flex;
  gap: 0;
  align-items: stretch;
}
.parkland-input {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  font-size: 16px;
  font-weight: 600;
  color: #0f172a;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  -webkit-tap-highlight-color: transparent;
}
.parkland-input--grow {
  flex: 1;
  min-width: 0;
  border-radius: 10px 0 0 10px;
  border-right: 0;
}
.parkland-input:focus {
  outline: none;
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}
.parkland-input-suffix {
  position: relative;
}
.parkland-input-suffix .parkland-input {
  border-radius: 10px;
  padding-right: 40px;
}
.parkland-suffix {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-weight: 700;
  color: #94a3b8;
  pointer-events: none;
}
.parkland-select {
  font-size: 15px;
  font-weight: 600;
  color: #0f172a;
  border: 1px solid #cbd5e1;
  background: #f1f5f9;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.parkland-select:focus {
  outline: none;
  border-color: #dc2626;
}
.parkland-select--unit {
  flex-shrink: 0;
  min-width: 4.5rem;
  padding: 12px 10px;
  border-radius: 0 10px 10px 0;
  border-left: 0;
}
.parkland-select--full {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
}
.parkland-placeholder {
  min-height: 280px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px 16px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
}
.parkland-placeholder[hidden] {
  display: none !important;
}
.parkland-placeholder-icon {
  color: #cbd5e1;
  margin-bottom: 12px;
}
.parkland-placeholder-title {
  margin: 0 0 8px;
  font-size: 1.15rem;
  font-weight: 800;
  color: #334155;
}
.parkland-placeholder-text {
  margin: 0;
  max-width: 22rem;
  font-size: 14px;
  font-weight: 600;
  color: #64748b;
  line-height: 1.45;
}
.parkland-results[hidden] {
  display: none !important;
}
.parkland-results {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.parkland-total-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 18px 16px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}
.parkland-total-label {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
}
.parkland-weight-kg {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
}
.parkland-total-ml {
  margin: 0;
  font-size: 2.75rem;
  font-weight: 900;
  color: #dc2626;
  letter-spacing: -0.03em;
  line-height: 1;
}
.parkland-total-unit {
  font-size: 1.25rem;
  font-weight: 800;
  color: #f87171;
}
.parkland-split {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
@media (min-width: 640px) {
  .parkland-split {
    grid-template-columns: 1fr 1fr;
  }
}
.parkland-phase {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 16px 14px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}
.parkland-phase--8 {
  border-top: 4px solid #dc2626;
}
.parkland-phase--16 {
  border-top: 4px solid #2563eb;
}
.parkland-phase-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  color: #dc2626;
}
.parkland-phase-head--blue {
  color: #2563eb;
}
.parkland-phase-head h4 {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  color: #0f172a;
}
.parkland-stat-label {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
}
.parkland-stat-val {
  margin: 4px 0 12px;
  font-size: 1.35rem;
  font-weight: 800;
  color: #0f172a;
}
.parkland-stat-val--sm {
  font-size: 1.2rem;
}
.parkland-stat-rate {
  margin: 4px 0 12px;
  font-size: 1.15rem;
  font-weight: 800;
  color: #2563eb;
}
.parkland-drip-box {
  padding: 12px;
  border-radius: 12px;
  margin-top: 4px;
}
.parkland-drip-box--red {
  background: #fef2f2;
  border: 1px solid #fecaca;
}
.parkland-drip-box--blue {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
}
.parkland-drip-label {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 800;
  color: #991b1b;
}
.parkland-drip-box--blue .parkland-drip-label {
  color: #1e40af;
}
.parkland-drip-val {
  margin: 0 0 8px;
  font-size: 1.75rem;
  font-weight: 900;
  color: #dc2626;
}
.parkland-drip-val--blue {
  color: #2563eb;
}
.parkland-drip-unit {
  font-size: 0.85rem;
  font-weight: 800;
}
.parkland-drip-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 700;
  color: #7f1d1d;
  margin-top: 4px;
}
.parkland-drip-box--blue .parkland-drip-meta {
  color: #1e40af;
}
.parkland-drip-set {
  margin: 10px 0 0;
  padding-top: 8px;
  border-top: 1px solid #fecaca;
  font-size: 11px;
  font-weight: 600;
  color: #f87171;
}
.parkland-drip-set--blue {
  border-top-color: #bfdbfe;
  color: #60a5fa;
}
.parkland-formula-ref {
  margin-top: 16px;
  padding: 14px 16px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  font-size: 12px;
  line-height: 1.5;
  color: #475569;
}
.parkland-formula-title {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 800;
  color: #334155;
}
.parkland-formula-title svg {
  color: #64748b;
  flex-shrink: 0;
}
.parkland-formula-ref p {
  margin: 0 0 6px;
}
.parkland-formula-ref p:last-child {
  margin-bottom: 0;
}
.parkland-reset-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 14px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #fff;
  font-size: 15px;
  font-weight: 700;
  color: #475569;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.parkland-reset-btn:active {
  background: #f1f5f9;
}
.parkland-disclaimer {
  margin: 14px 0 0;
  font-size: 11px;
  line-height: 1.45;
  color: #64748b;
  text-align: center;
}

/* ── IV Therapy calculator ───────────────────────────────── */
.view.iv-calc-view {
  background: #f8fafc;
  min-height: calc(100vh - var(--header-bar) - var(--safe-top));
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.iv-calc-scroll {
  max-width: 48rem;
  margin: 0 auto;
  padding: 10px 14px 20px;
}
.iv-calc-header {
  display: flex;
  align-items: center;
  gap: 14px;
  justify-content: center;
  text-align: center;
  flex-wrap: wrap;
  padding-bottom: 14px;
  margin-bottom: 12px;
  border-bottom: 1px solid #e2e8f0;
}
.iv-calc-header-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: #dbeafe;
  color: #1d4ed8;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.iv-calc-h1 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
}
.iv-calc-sub {
  margin: 6px 0 0;
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
}
.iv-tab-bar {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: #e2e8f0;
  border-radius: 10px;
  margin-bottom: 14px;
}
.iv-tab {
  flex: 1;
  padding: 10px 8px;
  border: none;
  border-radius: 8px;
  background: transparent;
  font-size: 13px;
  font-weight: 700;
  color: #475569;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.iv-tab--on {
  background: #fff;
  color: #1d4ed8;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
}
.iv-panel[hidden] {
  display: none !important;
}
.iv-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 16px 14px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}
.iv-field {
  margin-bottom: 16px;
}
.iv-field:last-child {
  margin-bottom: 0;
}
.iv-field--df-wide {
  margin-top: 4px;
}
.iv-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #334155;
  margin-bottom: 6px;
}
.iv-label-hint {
  font-weight: 600;
  font-size: 11px;
  color: #94a3b8;
}
.iv-input,
.iv-select {
  width: 100%;
  box-sizing: border-box;
  padding: 11px 12px;
  font-size: 16px;
  font-weight: 600;
  color: #0f172a;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #f8fafc;
  -webkit-tap-highlight-color: transparent;
}
.iv-input:focus,
.iv-select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}
/* Time row: global .iv-select { width:100% } would make the unit select as wide as
   the whole row and overflow; constrain select to content / % of row. */
.iv-time-row {
  display: flex;
  gap: 0;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.iv-input--time {
  flex: 1 1 0%;
  min-width: 0;
  width: auto;
  max-width: 100%;
  border-radius: 10px 0 0 10px;
  border-right: 0;
}
.iv-select.iv-select--unit {
  width: auto;
  flex: 0 1 36%;
  min-width: 4.75rem;
  max-width: 6.75rem;
  border-radius: 0 10px 10px 0;
  border-left: 0;
  background: #f1f5f9;
}
.iv-select--full {
  width: 100%;
}
.iv-static-field {
  padding: 11px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #f1f5f9;
  font-size: 15px;
  font-weight: 600;
  color: #475569;
}
.iv-df-grid {
  display: grid;
  gap: 8px;
}
.iv-df-grid--4 {
  grid-template-columns: repeat(4, 1fr);
}
.iv-df-grid--row {
  grid-template-columns: repeat(4, 1fr);
}
.iv-std-df-btn,
.iv-dir-df-btn {
  padding: 10px 6px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #fff;
  font-size: 15px;
  font-weight: 800;
  color: #334155;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.iv-std-df-btn.iv-drop-btn--on,
.iv-dir-df-btn.iv-drop-btn--on {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}
.iv-dir-df-btn.iv-drop-btn--on {
  background: #4f46e5;
  border-color: #4f46e5;
}
.iv-gen-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
@media (min-width: 768px) {
  .iv-gen-grid {
    flex-direction: row;
    align-items: stretch;
    gap: 20px;
  }
  .iv-gen-inputs {
    flex: 1;
    min-width: 0;
  }
  .iv-gen-result {
    flex: 1;
    min-width: 220px;
  }
}
.iv-gen-result {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 14px;
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.iv-result-title {
  margin: 0 0 8px;
  text-align: center;
  font-size: 15px;
  font-weight: 800;
  color: #1e3a8a;
}
.iv-result-gtts {
  margin: 0 0 16px;
  text-align: center;
  font-size: 2.75rem;
  font-weight: 900;
  color: #1d4ed8;
  line-height: 1;
}
.iv-result-gtts-unit {
  font-size: 1.1rem;
  font-weight: 700;
  color: #3b82f6;
}
.iv-result-sub-inner {
  background: #fff;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  padding: 14px;
  text-align: center;
}
.iv-sub-label {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
}
.iv-sub-big {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 800;
  color: #0f172a;
}
.iv-inline-unit {
  font-size: 1rem;
  font-weight: 700;
}
.iv-sub-pill {
  margin: 10px 0 0;
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: #475569;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
}
.iv-dir-type-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
@media (min-width: 520px) {
  .iv-dir-type-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
.iv-dir-type-btn {
  padding: 12px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #fff;
  font-size: 12px;
  font-weight: 700;
  color: #334155;
  line-height: 1.3;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.iv-dir-type-btn.iv-dir-type-btn--on {
  background: #4f46e5;
  border-color: #4f46e5;
  color: #fff;
}
.iv-dir-params {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 14px 12px;
  margin: 16px 0;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
}
@media (min-width: 560px) {
  .iv-dir-params {
    grid-template-columns: 1fr 1fr;
  }
}
.iv-dir-drip-setup {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 8px;
}
.iv-dir-results {
  margin-top: 16px;
  padding: 18px 14px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 14px;
}
.iv-dir-results-top {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-bottom: 18px;
}
@media (min-width: 560px) {
  .iv-dir-results-top {
    grid-template-columns: 1fr 1fr;
  }
}
.iv-dir-target {
  grid-column: 1 / -1;
}
@media (min-width: 560px) {
  .iv-dir-target {
    grid-column: span 1;
  }
  .iv-dir-bolus-meta {
    grid-column: span 1;
  }
}
.iv-dir-bolus-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-content: start;
}
.iv-dir-bolus-meta[hidden] {
  display: none !important;
}
.iv-dir-stat-label {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
}
.iv-dir-target-val {
  margin: 0;
  font-size: 2.25rem;
  font-weight: 900;
  color: #1d4ed8;
  line-height: 1.1;
}
.iv-dir-target-val span:last-child {
  font-size: 1.1rem;
  font-weight: 700;
  color: #3b82f6;
}
.iv-dir-stat-num {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
  color: #0f172a;
}
.iv-dir-drip-block {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-top: 16px;
  border-top: 1px solid #bfdbfe;
  align-items: center;
  text-align: center;
}
@media (min-width: 560px) {
  .iv-dir-drip-block {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    text-align: left;
  }
}
.iv-dir-drip-big {
  margin: 6px 0 0;
  font-size: 2.5rem;
  font-weight: 900;
  color: #1d4ed8;
  line-height: 1;
}
.iv-dir-drip-big span:last-child {
  font-size: 1.1rem;
  font-weight: 700;
  color: #3b82f6;
}
.iv-dir-practical-card {
  min-width: 180px;
  padding: 14px;
  background: #fff;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  text-align: center;
}
.iv-dir-notes {
  margin-top: 16px;
  padding: 14px;
  background: #fff;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
}
.iv-dir-notes[hidden] {
  display: none !important;
}
.iv-note-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 13px;
  line-height: 1.45;
  color: #334155;
  margin-bottom: 10px;
}
.iv-note-row:last-child {
  margin-bottom: 0;
}
.iv-note-icon {
  flex-shrink: 0;
  color: #3b82f6;
  margin-top: 2px;
}
.iv-note-icon--warn {
  color: #d97706;
}
.iv-reset-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 14px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #fff;
  font-size: 15px;
  font-weight: 700;
  color: #475569;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.iv-reset-btn:active {
  background: #f1f5f9;
}
.iv-disclaimer {
  margin: 12px 0 0;
  font-size: 11px;
  line-height: 1.45;
  color: #64748b;
  text-align: center;
}

/* ── Medical Calculators hub ───────────────────────────── */
.calculators-top-banner {
  background: #115e59;
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-align: center;
  padding: 14px 16px;
}
.detail-scope-banner.calc-hub-banner {
  background: #115e59;
  color: #fff;
  font-size: 14px;
}

/* ── Medication Information ─────────────────────────────── */
.medications-top-banner {
  background: #1e40af;
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-align: center;
  padding: 14px 16px;
}
.med-tab-bar {
  display: flex;
  flex-wrap: nowrap;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  position: sticky;
  top: calc(var(--header-bar) + var(--safe-top) + 56px);
  z-index: 5;
}
.med-tab {
  flex: 1;
  min-width: 0;
  padding: 12px 4px;
  border: none;
  background: transparent;
  font-size: 10px;
  font-weight: 700;
  color: #64748b;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  -webkit-tap-highlight-color: transparent;
}
@media (min-width: 380px) {
  .med-tab { font-size: 11px; padding: 12px 6px; }
}
.med-tab--on {
  color: #1e40af;
  border-bottom-color: #1e40af;
}
.med-tab:active {
  background: #f8fafc;
}
.medications-list {
  padding: 12px 14px 28px;
  max-width: 42rem;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.med-empty {
  text-align: center;
  padding: 2rem 1rem;
  color: #64748b;
  font-size: 15px;
}
.med-card {
  background: #fff;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
  overflow: hidden;
}
.med-card--expanded {
  border-color: #93c5fd;
  box-shadow: 0 0 0 1px #93c5fd;
}
.med-card-header {
  width: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 14px 12px;
  border: none;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}
.med-card-header:active {
  background: #f8fafc;
}
.med-card-header-main {
  flex: 1;
  min-width: 0;
}
.med-card-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
}
.med-card-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
}
.med-name-suffix {
  color: #1d4ed8;
  text-decoration: underline;
  text-decoration-color: #bfdbfe;
  text-underline-offset: 2px;
}
.med-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}
.med-badge {
  display: inline-flex;
  align-items: center;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid transparent;
}
.med-badge-home {
  color: #047857;
  background: #ecfdf5;
  border-color: #a7f3d0;
}
.med-badge-ems {
  color: #1d4ed8;
  background: #eff6ff;
  border-color: #bfdbfe;
}
.med-badge-alert {
  color: #b91c1c;
  background: #fef2f2;
  border-color: #fecaca;
}
.med-card-category {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: #64748b;
  margin-top: 6px;
}
.med-card-preview {
  font-size: 13px;
  color: #475569;
  margin-top: 8px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.med-chevron {
  flex-shrink: 0;
  width: 10px;
  height: 10px;
  margin-top: 6px;
  border-right: 2px solid #94a3b8;
  border-bottom: 2px solid #94a3b8;
  transform: rotate(45deg);
}
.med-chevron-up {
  transform: rotate(-135deg);
  margin-top: 10px;
}
.med-card-body {
  padding: 0 14px 14px;
  border-top: 1px solid #f1f5f9;
  background: linear-gradient(180deg, rgba(239, 246, 255, 0.35) 0%, #fff 48px);
}
.med-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding-top: 12px;
  margin-bottom: 12px;
}
.med-stat-wide {
  grid-column: 1 / -1;
}
.med-stat {
  background: #fff;
  border: 1px solid #f1f5f9;
  border-radius: 10px;
  padding: 10px 10px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.med-stat-label {
  display: block;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
  margin-bottom: 4px;
}
.med-stat-val {
  font-size: 14px;
  font-weight: 600;
  color: #1e293b;
}
.med-block {
  margin-bottom: 10px;
}
.med-block-label {
  display: block;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
  margin-bottom: 4px;
}
.med-block-text {
  font-size: 14px;
  color: #334155;
  background: #fff;
  border: 1px solid #f1f5f9;
  border-radius: 10px;
  padding: 10px 12px;
  margin: 0;
  line-height: 1.45;
}
.med-details {
  font-size: 13px;
  color: #64748b;
  margin-top: 6px;
}
.med-details summary {
  cursor: pointer;
  font-weight: 600;
  padding: 8px 0;
  outline: none;
}
.med-details summary:hover {
  color: #1d4ed8;
}
.med-details-notes summary:hover {
  color: #b45309;
}
.med-details-body {
  margin: 0;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  color: #475569;
  line-height: 1.5;
  font-size: 13px;
}
.med-notes-wrap {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 10px;
}
.med-notes-icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: #f59e0b;
  color: #fff;
  font-size: 14px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.med-notes-text {
  margin: 0;
  font-size: 13px;
  color: #78350f;
  line-height: 1.5;
}
.med-suffix-card {
  background: #fff;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  padding: 14px 16px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}
.med-suffix-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
}
.med-suffix-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
  color: #1d4ed8;
}
.med-suffix-cat {
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: right;
  max-width: 50%;
  line-height: 1.25;
  color: #64748b;
  background: #f1f5f9;
  padding: 4px 8px;
  border-radius: 6px;
}
.med-suffix-indication {
  font-size: 14px;
  font-weight: 600;
  color: #1e293b;
  margin: 0 0 8px;
  line-height: 1.4;
}
.med-suffix-examples {
  font-size: 12px;
  color: #64748b;
  margin: 0;
  line-height: 1.45;
}
.med-suffix-examples-label {
  font-weight: 700;
  color: #475569;
}

/* ── Burn % Calculator (Rule of Nines) ─────────────────── */
.view.burn-view {
  background: #f1f5f9;
  min-height: calc(100vh - var(--header-bar) - var(--safe-top));
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.burn-scroll {
  max-width: 42rem;
  margin: 0 auto;
  padding: 12px 14px 28px;
}
.burn-top-card {
  background: #1d4ed8;
  color: #fff;
  border-radius: 16px;
  padding: 16px 14px;
  margin-bottom: 12px;
  box-shadow: 0 4px 14px rgba(29, 78, 216, 0.25);
}
.burn-top-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}
.burn-h2 {
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.burn-tagline {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: rgba(255, 255, 255, 0.85);
  margin-top: 6px;
}
.burn-top-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.burn-icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: none;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.burn-icon-btn:active {
  background: rgba(255, 255, 255, 0.35);
}
.burn-icon-btn--reset {
  background: #ef4444;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.35);
}
.burn-panel {
  background: #fff;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  padding: 12px;
  margin-bottom: 14px;
}
.burn-row-split {
  display: flex;
  gap: 10px;
}
.burn-type-btn {
  flex: 1;
  padding: 14px 10px;
  border-radius: 14px;
  border: 2px solid transparent;
  background: #f8fafc;
  font-size: 0.95rem;
  font-weight: 800;
  color: #94a3b8;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.burn-type-btn--on {
  background: #fff;
  border-color: #2563eb;
  color: #1d4ed8;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}
.burn-degree-row {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #e2e8f0;
  flex-wrap: wrap;
  justify-content: center;
}
.burn-deg-btn {
  flex: 1;
  min-width: 88px;
  max-width: 120px;
  padding: 10px 8px;
  border-radius: 12px;
  border: 2px solid #e2e8f0;
  background: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  color: #64748b;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.burn-deg-btn--on {
  border-color: #ef4444;
  background: #fef2f2;
  color: #b91c1c;
}
.burn-diagrams {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 20px;
  margin-bottom: 16px;
}
@media (min-width: 520px) {
  .burn-diagrams {
    flex-direction: row;
    align-items: flex-start;
    justify-content: center;
    gap: 16px;
  }
}
.burn-diagrams--zoom .burn-svg {
  transform: scale(1.08);
  transform-origin: center top;
}
.burn-figure {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.burn-side-label {
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  color: #1e3a8a;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 10px;
}
.burn-svg {
  width: 100%;
  max-width: 300px;
  height: auto;
  aspect-ratio: 100 / 145;
  display: block;
  transition: transform 0.25s ease;
  touch-action: manipulation;
}
.burn-region {
  fill: rgba(191, 219, 254, 0.75);
  stroke: #93c5fd;
  cursor: pointer;
  transition: fill 0.15s, stroke 0.15s;
}
.burn-region--selected {
  fill: #ef4444;
  stroke: #b91c1c;
}
.burn-pct {
  font-size: 6px;
  font-weight: 900;
  pointer-events: none;
  fill: #1e40af;
}
.burn-pct--on {
  fill: #fff;
}
.burn-result-card {
  border-radius: 20px;
  border: 4px solid #e2e8f0;
  background: #f8fafc;
  padding: 20px 16px;
  text-align: center;
  margin-bottom: 14px;
  transition: border-color 0.3s, background 0.3s, box-shadow 0.3s;
}
.burn-result-card--on {
  border-color: #ef4444;
  background: #fef2f2;
  box-shadow: 0 8px 24px rgba(239, 68, 68, 0.12);
}
.burn-result-badge {
  display: inline-block;
  font-size: 0.55rem;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 6px 12px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #64748b;
  margin-bottom: 10px;
}
.burn-result-card--on .burn-result-badge {
  background: #ef4444;
  color: #fff;
}
.burn-result-pct {
  font-size: 2.75rem;
  font-weight: 900;
  color: #cbd5e1;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.burn-result-card--on .burn-result-pct {
  color: #dc2626;
}
.burn-result-tags {
  margin-top: 14px;
  min-height: 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}
.burn-tag {
  font-size: 0.65rem;
  font-weight: 800;
  padding: 6px 10px;
  border-radius: 10px;
  border: 2px solid #fecaca;
  background: #fff;
  color: #b91c1c;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.burn-tag::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #ef4444;
}
.burn-result-hint {
  font-size: 0.85rem;
  color: #94a3b8;
  font-weight: 600;
  margin-top: 8px;
}
.burn-bls {
  background: #0f172a;
  border-radius: 16px;
  padding: 18px 16px;
  color: #e2e8f0;
  margin-bottom: 16px;
}
.burn-bls-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.burn-bls-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #fbbf24;
  color: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 18px;
  flex-shrink: 0;
}
.burn-bls-title {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fbbf24;
}
.burn-bls ul {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.75rem;
  line-height: 1.55;
  font-weight: 600;
}
.burn-bls li {
  margin-bottom: 8px;
}
.burn-bls-idle {
  font-size: 0.75rem;
  color: #94a3b8;
  font-style: italic;
  line-height: 1.5;
}
.burn-foot {
  text-align: center;
  font-size: 0.6rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
  line-height: 1.4;
  padding: 0 8px;
}

/* ── Drug-Calc Views (Dextrose, Epi, Broncho, Croup) ──────────────────────── */
.drug-calc-view { background: #f1f5f9; min-height: 100vh; }
.drug-calc-scroll { padding: 0 0 48px; }

.drug-calc-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 16px 18px;
  color: #fff;
}
.drug-calc-header--blue   { background: #1d4ed8; }
.drug-calc-header--red    { background: #b91c1c; }
.drug-calc-header--teal   { background: #0f766e; }
.drug-calc-header--purple { background: #6d28d9; }

.drug-calc-header-icon {
  background: rgba(255,255,255,0.18);
  border-radius: 10px;
  padding: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.drug-calc-h1 { font-size: 1.15rem; font-weight: 700; margin: 0; }
.drug-calc-sub { font-size: 0.75rem; color: rgba(255,255,255,0.78); margin: 3px 0 0; }

.drug-calc-card {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  margin: 12px 12px 0;
  padding: 16px;
}
.drug-calc-card--info { background: #f8fafc; border: 1px solid #e2e8f0; }

.drug-calc-field { margin-bottom: 14px; }
.drug-calc-label { display: block; font-size: 0.8rem; font-weight: 600; color: #475569; margin-bottom: 6px; }

.drug-calc-weight-row { display: flex; gap: 8px; align-items: center; }
.drug-calc-input {
  flex: 1;
  padding: 10px 12px;
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  font-size: 1rem;
  outline: none;
  -webkit-appearance: none;
}
.drug-calc-input:focus { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,0.15); }

.drug-calc-unit-toggle {
  display: flex;
  background: #f1f5f9;
  border-radius: 10px;
  padding: 3px;
  border: 1px solid #e2e8f0;
}
.drug-calc-unit-btn {
  padding: 6px 14px;
  border-radius: 7px;
  font-size: 0.8rem;
  font-weight: 600;
  border: none;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.drug-calc-unit-btn--on { background: #fff; color: #1d4ed8; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }

.drug-calc-toggle-row { display: flex; gap: 8px; }
.drug-calc-option-btn {
  flex: 1;
  padding: 10px 8px;
  border-radius: 10px;
  border: 1.5px solid #cbd5e1;
  background: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s;
}
.drug-calc-option-btn--on { background: #eff6ff; border-color: #3b82f6; color: #1d4ed8; }

.drug-calc-result { margin-top: 12px; }
.drug-calc-result--hidden { display: none; }

.drug-calc-result-main {
  background: #f8fafc;
  border-radius: 10px;
  padding: 14px 16px;
  border: 1px solid #e2e8f0;
  margin-bottom: 10px;
}
.drug-calc-result-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 3px 0;
}
.drug-calc-result-row + .drug-calc-result-row { border-top: 1px solid #e2e8f0; margin-top: 6px; padding-top: 9px; }
.drug-calc-result-label { font-size: 0.8rem; color: #64748b; font-weight: 500; }
.drug-calc-result-value { font-size: 1.6rem; font-weight: 700; color: #0f172a; }
.drug-calc-result-unit { font-size: 0.9rem; color: #64748b; font-weight: 500; }

.drug-calc-meta-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.drug-calc-meta-pill {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  padding: 5px 11px;
}
.drug-calc-meta-label { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.06em; color: #3b82f6; font-weight: 700; display: block; }
.drug-calc-meta-val { font-size: 0.9rem; font-weight: 600; color: #1e3a8a; }

.drug-calc-warning {
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #92400e;
  margin-top: 8px;
}

.drug-calc-empty {
  text-align: center;
  padding: 28px 0 10px;
  color: #94a3b8;
  font-size: 0.85rem;
  font-style: italic;
}

.drug-calc-drug-section { padding: 12px 0; border-bottom: 1px solid #e2e8f0; }
.drug-calc-drug-section:last-child { border-bottom: none; padding-bottom: 4px; }
.drug-calc-drug-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 8px;
  padding: 3px 8px;
  border-radius: 5px;
  display: inline-block;
}
.drug-calc-drug-label--red   { background: #fee2e2; color: #b91c1c; }
.drug-calc-drug-label--green { background: #dcfce7; color: #15803d; }
.drug-calc-condition-note { font-size: 0.72rem; color: #64748b; margin: 6px 0 0; font-style: italic; }
.drug-calc-age-note { font-size: 0.78rem; color: #6366f1; margin: -6px 0 12px; font-weight: 600; }

.drug-calc-info-heading { font-size: 0.85rem; font-weight: 700; color: #334155; margin: 0 0 10px; }
.drug-calc-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 380px) { .drug-calc-info-grid { grid-template-columns: 1fr; } }
.drug-calc-info-sub { font-size: 0.72rem; font-weight: 700; color: #475569; margin: 0 0 4px; text-transform: uppercase; letter-spacing: 0.05em; }
.drug-calc-info-list { margin: 0; padding-left: 1rem; font-size: 0.75rem; color: #475569; line-height: 1.6; }
.drug-calc-note { font-size: 0.75rem; color: #64748b; font-style: italic; margin: 10px 0 0; padding-top: 10px; border-top: 1px solid #e2e8f0; }

.drug-calc-disclaimer {
  text-align: center;
  font-size: 0.6rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
  line-height: 1.4;
  padding: 16px 8px 0;
}

/* ── Quick Calculator button on directive detail ──────────────────────────── */
.quick-calc-card { border-left: 3px solid #3b82f6 !important; padding-bottom: 16px; }
.quick-calc-heading { color: #1d4ed8 !important; }
.quick-calc-btn {
  display: block;
  width: fit-content;
  min-width: 200px;
  max-width: calc(100% - 32px);
  padding: 11px 24px;
  margin: 10px auto 0;
  background: #1d4ed8;
  color: #fff;
  font-size: 0.92rem;
  font-weight: 700;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  text-align: center;
  letter-spacing: 0.01em;
  transition: background 0.15s;
}
.quick-calc-btn:active { background: #1e40af; }