/* ==========================================================================
   DVMReady Calculator Shell v2
   Scoped modern clinical UI — overrides existing design ONLY when
   body has .calc-shell-v2 (added alongside existing .dose-page).
   Loaded AFTER tools-shell.css → uses equal or higher specificity.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Scope & Accent Custom Properties
   -------------------------------------------------------------------------- */

.calc-shell-v2 {
  /* Inherit existing tokens where available */
  --v2-bg: #f6f1e8;
  --v2-surface: #ffffff;
  --v2-surface-warm: #fffdfb;
  --v2-text: #1c2729;
  --v2-text-muted: #68777a;
  --v2-border: rgba(0, 0, 0, 0.06);
  --v2-border-strong: rgba(28, 39, 41, 0.13);
  --v2-focus-ring: color-mix(in srgb, var(--v2-accent) 28%, transparent);
  --v2-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(0, 0, 0, 0.03);
  --v2-radius-sm: 8px;
  --v2-radius-md: 12px;
  --v2-radius-lg: 14px;
  --v2-radius-pill: 999px;
  --v2-transition: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --v2-input-height: 50px;
  --v2-gap-mobile: 20px;
  --v2-gap-desktop: 28px;

  /* Default accent (violet) */
  --v2-accent: #7c3aed;
  --v2-accent-soft: #f5f3ff;
  --v2-accent-text: #5b21b6;
}

/* Accent overrides via data-accent */
.calc-shell-v2[data-accent="violet"] {
  --v2-accent: #7c3aed;
  --v2-accent-soft: #f5f3ff;
  --v2-accent-text: #5b21b6;
}

.calc-shell-v2[data-accent="teal"] {
  --v2-accent: #0d9488;
  --v2-accent-soft: #f0fdfa;
  --v2-accent-text: #115e59;
}

.calc-shell-v2[data-accent="amber"] {
  --v2-accent: #d97706;
  --v2-accent-soft: #fffbeb;
  --v2-accent-text: #92400e;
}

.calc-shell-v2[data-accent="rose"] {
  --v2-accent: #e11d48;
  --v2-accent-soft: #fff1f2;
  --v2-accent-text: #9f1239;
}

.calc-shell-v2[data-accent="emerald"] {
  --v2-accent: #059669;
  --v2-accent-soft: #ecfdf5;
  --v2-accent-text: #065f46;
}

.calc-shell-v2[data-accent="sky"] {
  --v2-accent: #0284c7;
  --v2-accent-soft: #f0f9ff;
  --v2-accent-text: #075985;
}

.calc-shell-v2[data-accent="cyan"] {
  --v2-accent: #0891b2;
  --v2-accent-soft: #ecfeff;
  --v2-accent-text: #155e75;
}

.calc-shell-v2[data-accent="indigo"] {
  --v2-accent: #4f46e5;
  --v2-accent-soft: #eef2ff;
  --v2-accent-text: #3730a3;
}

.calc-shell-v2[data-accent="red"] {
  --v2-accent: #dc2626;
  --v2-accent-soft: #fef2f2;
  --v2-accent-text: #991b1b;
}

.calc-shell-v2[data-accent="blue"] {
  --v2-accent: #2563eb;
  --v2-accent-soft: #eff6ff;
  --v2-accent-text: #1d4ed8;
}

.calc-shell-v2[data-accent="green"] {
  --v2-accent: #16a34a;
  --v2-accent-soft: #f0fdf4;
  --v2-accent-text: #166534;
}

.calc-shell-v2[data-accent="purple"] {
  --v2-accent: #9333ea;
  --v2-accent-soft: #faf5ff;
  --v2-accent-text: #6b21a8;
}

.calc-shell-v2[data-accent="brown"] {
  --v2-accent: #8b5e34;
  --v2-accent-soft: #f8f1e8;
  --v2-accent-text: #5f3b1f;
}

/* Semantic shell variants: accent still brands the page, while type controls
   clinical priority and the safety strip treatment. */
.calc-shell-v2[data-calc-type="emergency"],
.calc-shell-v2.calc-shell-v2--risk-emergency {
  --v2-risk-color: #b91c1c;
  --v2-risk-bg: #fef2f2;
  --v2-risk-border: #fecaca;
}

.calc-shell-v2.calc-shell-v2--risk-high {
  --v2-risk-color: #c2410c;
  --v2-risk-bg: #fff7ed;
  --v2-risk-border: #fed7aa;
}

.calc-shell-v2[data-calc-type="diagnostic"],
.calc-shell-v2[data-calc-type="monitoring"],
.calc-shell-v2[data-calc-type="renal"],
.calc-shell-v2[data-calc-type="hematology"],
.calc-shell-v2[data-calc-type="transfusion"] {
  --v2-type-chip-bg: #f0f9ff;
  --v2-type-chip-text: #075985;
}

.calc-shell-v2[data-calc-type="converter"],
.calc-shell-v2[data-calc-type="reference"],
.calc-shell-v2[data-calc-type="reproduction"] {
  --v2-type-chip-bg: #f8fafc;
  --v2-type-chip-text: #475569;
}

.calc-shell-v2[data-calc-type="dosing"],
.calc-shell-v2[data-calc-type="calculator"] {
  --v2-type-chip-bg: #f0fdfa;
  --v2-type-chip-text: #115e59;
}

.calc-shell-v2[data-calc-type="toxicity"] {
  --v2-type-chip-bg: #fffbeb;
  --v2-type-chip-text: #92400e;
}

.calc-shell-v2[data-calc-type="nutrition"] {
  --v2-type-chip-bg: #ecfdf5;
  --v2-type-chip-text: #065f46;
}

/* --------------------------------------------------------------------------
   Status Variants (for result status badge + card borders)
   -------------------------------------------------------------------------- */

.calc-shell-v2 .calc-v2-status-normal {
  --status-color: #059669;
  --status-bg: #ecfdf5;
}

.calc-shell-v2 .calc-v2-status-mild {
  --status-color: #d97706;
  --status-bg: #fffbeb;
}

.calc-shell-v2 .calc-v2-status-elevated {
  --status-color: #ea580c;
  --status-bg: #fff7ed;
}

.calc-shell-v2 .calc-v2-status-critical {
  --status-color: #b91c1c;
  --status-bg: #fef2f2;
}

/* Status border override on primary result (non-print) */
.calc-shell-v2 .calc-v2-result-panel.calc-v2-status-normal .calc-v2-result-primary,
.calc-shell-v2 .calc-v2-result-panel.calc-v2-status-mild .calc-v2-result-primary,
.calc-shell-v2 .calc-v2-result-panel.calc-v2-status-elevated .calc-v2-result-primary,
.calc-shell-v2 .calc-v2-result-panel.calc-v2-status-critical .calc-v2-result-primary {
  border-left-color: var(--status-color);
}

/* --------------------------------------------------------------------------
   Global hidden state
   -------------------------------------------------------------------------- */

.calc-shell-v2 [hidden] {
  display: none !important;
}

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */

.calc-shell-v2 .calc-v2-workspace {
  box-sizing: border-box;
  display: grid;
  gap: var(--v2-gap-mobile);
  width: min(100%, 1200px);
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 16px;
  padding-right: 16px;
}

@media (min-width: 1024px) {
  .calc-shell-v2 .calc-v2-workspace {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
    align-items: stretch;
    padding-left: 24px;
    padding-right: 24px;
  }
}

.calc-shell-v2 .calc-v2-input-panel {
  min-width: 0;
}

.calc-shell-v2 .calc-v2-result-panel {
  min-width: 0;
}

@media (min-width: 1024px) {
  .calc-shell-v2 .calc-v2-result-panel {
    min-width: 0;
  }
}

/* Override old-shell grid placement, sticky, and padding */
.calc-shell-v2 .dose-input-panel,
.calc-shell-v2 .calc-v2-input-panel,
.calc-shell-v2 .dose-result-panel,
.calc-shell-v2 .calc-v2-result-panel {
  grid-column: auto;
  grid-row: auto;
}

.calc-shell-v2 .dose-result-panel,
.calc-shell-v2 .calc-v2-result-panel {
  position: static !important;
}

@media (min-width: 1024px) {
  .calc-shell-v2 .dose-result-panel,
  .calc-shell-v2 .calc-v2-result-panel {
    position: static !important;
    top: auto;
    max-height: none;
    overflow: visible;
    overscroll-behavior: auto;
    scrollbar-gutter: auto;
  }
}

.calc-shell-v2 .dose-detail-section,
.calc-shell-v2 .calc-v2-details {
  grid-column: 1 / -1;
  grid-row: auto;
}

/* --------------------------------------------------------------------------
   Desktop Workstation Layer
   -------------------------------------------------------------------------- */

.calc-shell-v2--workstation .calc-v2-workspace {
  width: min(100%, 1360px);
  max-width: 1360px;
}

.calc-shell-v2 .calc-v2-context-rail {
  display: none;
}

@media (min-width: 1024px) {
  .calc-shell-v2 .calc-v2-workspace.calc-v2-workstation {
    grid-template-columns: minmax(0, 1fr);
    gap: 22px;
    align-items: stretch;
  }

  .calc-shell-v2 .calc-v2-workstation .calc-v2-clinical-strip,
  .calc-shell-v2 .calc-v2-workstation .crash-warning-bar {
    grid-column: 1 / -1;
  }

  .calc-shell-v2 .calc-v2-workstation .calc-v2-context-rail {
    display: grid;
    grid-column: 1 / -1;
    gap: 12px;
    min-width: 0;
    position: static;
    top: auto;
    max-height: none;
    overflow: visible;
    overscroll-behavior: auto;
    scrollbar-gutter: auto;
  }

  .calc-shell-v2 .calc-v2-workstation .dose-input-panel,
  .calc-shell-v2 .calc-v2-workstation .calc-v2-input-panel {
    grid-column: 1 / -1;
  }

  .calc-shell-v2 .calc-v2-workstation .dose-result-panel,
  .calc-shell-v2 .calc-v2-workstation .calc-v2-result-panel {
    grid-column: 1 / -1;
  }

  .calc-shell-v2 .calc-v2-workstation .dose-detail-section,
  .calc-shell-v2 .calc-v2-workstation .calc-v2-details {
    grid-column: 1 / -1;
    width: auto;
    margin-top: 24px;
    padding-left: 0;
    padding-right: 0;
  }
}

@media (min-width: 1360px) {
  .calc-shell-v2 .calc-v2-workspace.calc-v2-workstation {
    max-width: 1440px;
    gap: 24px;
  }
}

@media (min-width: 1680px) {
  .calc-shell-v2 .calc-v2-workspace.calc-v2-workstation {
    max-width: 1520px;
    gap: 28px;
  }
}

.calc-shell-v2 .calc-v2-context-block {
  display: grid;
  gap: 9px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--v2-border-strong);
  border-radius: var(--v2-radius-md);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--v2-shadow);
  overflow: hidden;
}

.calc-shell-v2 .calc-v2-context-current {
  background:
    linear-gradient(135deg, var(--v2-accent-soft), rgba(255, 255, 255, 0.9) 76%),
    #ffffff;
  border-color: color-mix(in srgb, var(--v2-accent) 22%, transparent);
  justify-items: center;
  text-align: center;
}

.calc-shell-v2 .calc-v2-context-current strong {
  color: var(--v2-text);
  font-size: 15px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.calc-shell-v2 .calc-v2-context-current small,
.calc-shell-v2 .calc-v2-context-link small {
  color: var(--v2-text-muted);
  font-size: 11px;
  line-height: 1.35;
}

.calc-shell-v2 .calc-v2-context-eyebrow {
  color: var(--v2-accent-text);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-transform: uppercase;
}

.calc-shell-v2 .calc-v2-context-nav {
  display: none;
}

.calc-shell-v2 .calc-v2-context-stack {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.calc-shell-v2 .calc-v2-context-link {
  display: grid;
  gap: 2px;
  min-width: 0;
  min-height: 42px;
  padding: 9px 10px;
  color: var(--v2-text);
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: var(--v2-radius-sm);
  transition: background-color var(--v2-transition), border-color var(--v2-transition), color var(--v2-transition);
}

.calc-shell-v2 .calc-v2-context-link span {
  min-width: 0;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.calc-shell-v2 .calc-v2-context-link:hover,
.calc-shell-v2 .calc-v2-context-link:focus-visible {
  color: var(--v2-accent-text);
  background: var(--v2-accent-soft);
  border-color: color-mix(in srgb, var(--v2-accent) 22%, transparent);
  outline: 3px solid transparent;
  box-shadow: 0 0 0 3px var(--v2-focus-ring);
}

.calc-shell-v2 .calc-v2-context-dl {
  display: grid;
  gap: 7px;
  margin: 0;
}

.calc-shell-v2 .calc-v2-context-dl div {
  display: grid;
  grid-template-columns: minmax(0, 64px) minmax(0, 1fr);
  gap: 8px;
  align-items: baseline;
}

.calc-shell-v2 .calc-v2-context-dl dt {
  color: var(--v2-text-muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.25;
}

.calc-shell-v2 .calc-v2-context-dl dd {
  min-width: 0;
  margin: 0;
  color: var(--v2-text);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.calc-shell-v2 .calc-v2-context-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.calc-shell-v2 .calc-v2-context-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 8px 10px;
  color: #ffffff;
  background: #1c2729;
  border: 1px solid #1c2729;
  border-radius: var(--v2-radius-sm);
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  transition: background-color var(--v2-transition), border-color var(--v2-transition), color var(--v2-transition);
}

.calc-shell-v2 .calc-v2-context-button:hover,
.calc-shell-v2 .calc-v2-context-button:focus-visible {
  background: #0d1722;
  outline: 3px solid transparent;
  box-shadow: 0 0 0 3px var(--v2-focus-ring);
}

.calc-shell-v2 .calc-v2-context-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.calc-shell-v2 .calc-v2-context-button--quiet {
  color: var(--v2-text-muted);
  background: transparent;
  border-color: var(--v2-border);
}

.calc-shell-v2 .calc-v2-context-button--quiet:hover,
.calc-shell-v2 .calc-v2-context-button--quiet:focus-visible {
  color: var(--v2-text);
  background: rgba(0, 0, 0, 0.03);
}

.calc-shell-v2 .calc-v2-context-button--wide {
  width: 100%;
}

.calc-shell-v2 .calc-v2-context-empty {
  margin: 0;
  color: var(--v2-text-muted);
  font-size: 12px;
  line-height: 1.45;
}

.calc-shell-v2 .calc-v2-context-note,
.calc-shell-v2 .calc-v2-context-message {
  margin: 0;
  color: var(--v2-text-muted);
  font-size: 12px;
  line-height: 1.45;
}

.calc-shell-v2 .calc-v2-context-note {
  padding-top: 2px;
}

.calc-shell-v2 .calc-v2-context-message:not(:empty) {
  color: var(--v2-accent-text);
  font-weight: 800;
}

@media (min-width: 1024px) {
  .calc-shell-v2 .calc-v2-context-current {
    padding: 18px;
  }

  .calc-shell-v2 .calc-v2-context-current strong {
    max-width: 42rem;
    font-size: 22px;
  }

  .calc-shell-v2 .calc-v2-context-current small {
    font-size: 12px;
  }

  .calc-shell-v2 .calc-v2-context-session {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border-left: 4px solid color-mix(in srgb, var(--v2-accent) 34%, var(--v2-border));
  }

  .calc-shell-v2 .calc-v2-context-session .calc-v2-context-eyebrow {
    grid-column: 1 / -1;
  }

  .calc-shell-v2 .calc-v2-context-session .calc-v2-context-dl {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
  }

  .calc-shell-v2 .calc-v2-context-session .calc-v2-context-dl div {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
    min-height: 54px;
    padding: 9px 11px;
    align-content: center;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid var(--v2-border);
    border-radius: var(--v2-radius-sm);
  }

  .calc-shell-v2 .calc-v2-context-session .calc-v2-context-dl dt {
    font-size: 10px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  .calc-shell-v2 .calc-v2-context-session .calc-v2-context-dl dd {
    font-size: 13px;
  }

  .calc-shell-v2 .calc-v2-context-session .calc-v2-context-actions {
    justify-content: flex-end;
    align-self: stretch;
    align-content: center;
  }
}

.calc-shell-v2 .calc-v2-emergency-rail {
  background:
    linear-gradient(135deg, #fff1f2, rgba(255, 255, 255, 0.92) 78%),
    #ffffff;
  border-color: rgba(225, 29, 72, 0.22);
}

.calc-shell-v2 .calc-v2-emergency-rail strong {
  color: #7f1d1d;
  font-size: 15px;
  line-height: 1.25;
}

.calc-shell-v2 .calc-v2-emergency-rail-list {
  display: grid;
  gap: 6px;
  margin: 2px 0 0;
  padding: 0;
  list-style: none;
}

.calc-shell-v2 .calc-v2-emergency-rail-list li {
  position: relative;
  min-width: 0;
  padding-left: 14px;
  color: var(--v2-text);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.calc-shell-v2 .calc-v2-emergency-rail-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #e11d48;
}

@media (min-width: 1180px) and (max-width: 1359px) {
  .calc-shell-v2 .calc-v2-context-block {
    gap: 8px;
    padding: 11px;
  }

  .calc-shell-v2 .calc-v2-context-current strong {
    font-size: 14px;
  }

  .calc-shell-v2 .calc-v2-context-link {
    padding: 7px 8px;
  }
}

/* --------------------------------------------------------------------------
   Personalized Emergency Desktop Shell
   -------------------------------------------------------------------------- */

.calc-shell-v2 .calc-v2-emergency-command-board {
  display: none;
}

@media (min-width: 1024px) {
  .calc-shell-v2--emergency-family .calc-v2-emergency-command-board {
    display: grid;
    grid-column: 2 / -1;
    grid-row: auto;
    gap: 14px;
    min-width: 0;
    padding: 18px;
    border: 1px solid rgba(225, 29, 72, 0.18);
    border-left: 4px solid #e11d48;
    border-radius: var(--v2-radius-md);
    background:
      linear-gradient(135deg, #fff7f7, rgba(255, 255, 255, 0.96) 66%),
      #ffffff;
    box-shadow: var(--v2-shadow);
  }

  .calc-shell-v2--emergency-family .calc-v2-workstation .calc-v2-context-rail {
    grid-row: auto;
  }

  .calc-shell-v2--emergency-family .calc-v2-workstation .dose-input-panel,
  .calc-shell-v2--emergency-family .calc-v2-workstation .calc-v2-input-panel,
  .calc-shell-v2--emergency-family .calc-v2-workstation .dose-result-panel,
  .calc-shell-v2--emergency-family .calc-v2-workstation .calc-v2-result-panel {
    grid-row: auto;
  }

  .calc-shell-v2--emergency-family .calc-v2-workstation .calc-v2-emergency-command-board {
    grid-column: 1 / -1;
  }

  .calc-shell-v2 .calc-v2-emergency-command-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    min-width: 0;
  }

  .calc-shell-v2 .calc-v2-emergency-kicker {
    display: block;
    margin-bottom: 5px;
    color: #9f1239;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.08em;
    line-height: 1.2;
    text-transform: uppercase;
  }

  .calc-shell-v2 .calc-v2-emergency-command-head h2 {
    margin: 0;
    color: var(--v2-text);
    font-size: 20px;
    line-height: 1.2;
  }

  .calc-shell-v2 .calc-v2-emergency-command-head p {
    max-width: 78ch;
    margin: 5px 0 0;
    color: var(--v2-text-muted);
    font-size: 13px;
    line-height: 1.45;
  }

  .calc-shell-v2 .calc-v2-emergency-status {
    flex: 0 0 auto;
    max-width: 34%;
    padding: 6px 10px;
    color: #9f1239;
    background: #fff1f2;
    border: 1px solid rgba(225, 29, 72, 0.18);
    border-radius: var(--v2-radius-sm);
    font-size: 12px;
    font-weight: 900;
    line-height: 1.2;
    text-align: right;
  }

  .calc-shell-v2 .calc-v2-emergency-command-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
  }

  .calc-shell-v2 .calc-v2-emergency-card {
    display: grid;
    align-content: start;
    gap: 5px;
    min-width: 0;
    min-height: 104px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.84);
    border: 1px solid rgba(127, 29, 29, 0.1);
    border-radius: var(--v2-radius-sm);
  }

  .calc-shell-v2 .calc-v2-emergency-card span {
    color: #9f1239;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.06em;
    line-height: 1.2;
    text-transform: uppercase;
  }

  .calc-shell-v2 .calc-v2-emergency-card strong {
    min-width: 0;
    color: var(--v2-text);
    font-size: 15px;
    line-height: 1.25;
    overflow-wrap: anywhere;
  }

  .calc-shell-v2 .calc-v2-emergency-card small {
    min-width: 0;
    color: var(--v2-text-muted);
    font-size: 11px;
    line-height: 1.35;
    overflow-wrap: anywhere;
  }
}

@media (min-width: 1024px) and (max-width: 1359px) {
  .calc-shell-v2 .calc-v2-emergency-command-board {
    padding: 15px;
  }

  .calc-shell-v2 .calc-v2-emergency-command-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */

.calc-shell-v2 .calc-v2-header {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding: 24px 16px 16px;
}

@media (min-width: 1024px) {
  .calc-shell-v2 .calc-v2-header {
    padding: 32px 24px 20px;
  }
}

.calc-shell-v2 .calc-v2-title {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--v2-text);
  margin: 0 0 6px;
  letter-spacing: 0;
}

@media (min-width: 1024px) {
  .calc-shell-v2 .calc-v2-title {
    font-size: 32px;
  }
}

.calc-shell-v2 .calc-v2-subtitle {
  font-size: 15px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--v2-text-muted);
  margin: 0;
  max-width: 68ch;
}

.calc-shell-v2 .calc-v2-header > div:first-child {
  flex-wrap: wrap !important;
}

.calc-shell-v2 .tool-tag {
  background-color: var(--v2-type-chip-bg, var(--v2-accent-soft));
  color: var(--v2-type-chip-text, var(--v2-accent-text));
  border-color: color-mix(in srgb, currentColor 20%, transparent);
}

.calc-shell-v2 .tool-favorite-toggle-page {
  min-height: 34px;
  padding: 7px 10px;
  border-radius: var(--v2-radius-sm);
  background-color: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--v2-border);
  color: var(--v2-text-muted);
}

.calc-shell-v2 .tool-favorite-toggle-page {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.calc-shell-v2 .tool-favorite-toggle-page:hover,
.calc-shell-v2 .tool-favorite-toggle-page.is-favorited {
  color: var(--v2-accent-text);
  background-color: var(--v2-accent-soft);
  border-color: color-mix(in srgb, var(--v2-accent) 34%, transparent);
}

@media (max-width: 560px) {
  .calc-shell-v2 .calc-v2-header > div:first-child {
    flex-direction: column !important;
    align-items: stretch !important;
  }

  .calc-shell-v2 .tool-tag {
    width: fit-content;
  }

  .calc-shell-v2 .tool-favorite-toggle-page {
    width: 100%;
  }
}

/* --------------------------------------------------------------------------
   Form
   -------------------------------------------------------------------------- */

.calc-shell-v2 .calc-v2-form {
  display: grid;
  gap: 16px;
}

.calc-shell-v2 .calc-v2-field-row {
  display: grid;
  gap: 16px;
}

@media (min-width: 1024px) {
  .calc-shell-v2 .calc-v2-field-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

.calc-shell-v2 .calc-v2-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.calc-shell-v2 .calc-v2-field span {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--v2-text);
}

.calc-shell-v2 .calc-v2-field small {
  font-size: 12px;
  font-weight: 400;
  line-height: 1.4;
  color: var(--v2-text-muted);
  margin-top: -2px;
  margin-bottom: 2px;
}

.calc-shell-v2 .calc-v2-field input,
.calc-shell-v2 .calc-v2-field select {
  min-height: var(--v2-input-height);
  padding: 12px 14px;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.4;
  color: var(--v2-text);
  background-color: var(--v2-surface);
  border: 1px solid var(--v2-border);
  border-radius: var(--v2-radius-lg);
  box-shadow: none;
  transition: border-color var(--v2-transition), box-shadow var(--v2-transition);
  appearance: none;
  -webkit-appearance: none;
  font-family: inherit;
}

.calc-shell-v2 .calc-v2-field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2368777a' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

.calc-shell-v2 .calc-v2-field input::placeholder {
  color: #a0aeb0;
}

.calc-shell-v2 .calc-v2-field input:focus,
.calc-shell-v2 .calc-v2-field select:focus {
  outline: none;
  border-color: var(--v2-accent);
  box-shadow: 0 0 0 3px var(--v2-accent-soft);
}

.calc-shell-v2 .calc-v2-field input:focus-visible,
.calc-shell-v2 .calc-v2-field select:focus-visible {
  outline: none;
  border-color: var(--v2-accent);
  box-shadow: 0 0 0 3px var(--v2-accent-soft);
}

.calc-shell-v2 .calc-v2-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
  align-items: center;
}

.calc-shell-v2 .calc-v2-actions button,
.calc-shell-v2 .calc-v2-actions input[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--v2-input-height);
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  color: #ffffff;
  background-color: #1c2729;
  border: none;
  border-radius: var(--v2-radius-lg);
  cursor: pointer;
  transition: background-color var(--v2-transition), transform var(--v2-transition), box-shadow var(--v2-transition);
  font-family: inherit;
}

.calc-shell-v2 .calc-v2-actions button:hover,
.calc-shell-v2 .calc-v2-actions input[type="submit"]:hover {
  background-color: #0d1722;
}

.calc-shell-v2 .calc-v2-actions button:active,
.calc-shell-v2 .calc-v2-actions input[type="submit"]:active {
  transform: translateY(1px);
}

.calc-shell-v2 .calc-v2-actions button:focus-visible,
.calc-shell-v2 .calc-v2-actions input[type="submit"]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--v2-accent-soft), 0 0 0 5px rgba(28, 39, 41, 0.08);
}

.calc-shell-v2 .calc-v2-disclaimer {
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--v2-text-muted);
  margin-top: 4px;
  flex-basis: 100%;
}

.calc-shell-v2 .calc-v2-live-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 5px 10px;
  border: 1px solid var(--v2-border);
  border-radius: var(--v2-radius-pill);
  background: rgba(255, 255, 255, 0.7);
  color: var(--v2-text-muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.calc-shell-v2 .calc-v2-live-status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--v2-accent);
  opacity: 0.72;
}

.calc-shell-v2 .calc-v2-live-status[data-state="updating"] {
  color: var(--v2-accent-text);
  background: var(--v2-accent-soft);
  border-color: color-mix(in srgb, var(--v2-accent) 26%, transparent);
}

.calc-shell-v2 .calc-v2-live-status[data-state="updated"] {
  color: #065f46;
  background: #ecfdf5;
  border-color: rgba(5, 150, 105, 0.22);
}

.calc-shell-v2 .calc-v2-live-status[data-state="updated"]::before {
  background: #059669;
}

/* --------------------------------------------------------------------------
   Assumptions (outside form)
   -------------------------------------------------------------------------- */

.calc-shell-v2 .calc-v2-assumptions {
  margin-top: 24px;
  border-top: 1px solid var(--v2-border);
}

.calc-shell-v2 .calc-v2-assumptions summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--v2-text-muted);
  cursor: pointer;
  list-style: none;
  user-select: none;
  transition: color var(--v2-transition);
}

.calc-shell-v2 .calc-v2-assumptions summary::-webkit-details-marker {
  display: none;
}

.calc-shell-v2 .calc-v2-assumptions summary::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform var(--v2-transition);
  flex-shrink: 0;
}

.calc-shell-v2 .calc-v2-assumptions[open] summary::before {
  transform: rotate(45deg);
}

.calc-shell-v2 .calc-v2-assumptions summary:hover {
  color: var(--v2-text);
}

.calc-shell-v2 .calc-v2-assumptions summary:focus-visible {
  outline: none;
  color: var(--v2-accent-text);
}

.calc-shell-v2 .calc-v2-assumptions-body {
  padding: 0 0 20px;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.7;
  color: var(--v2-text-muted);
}

.calc-shell-v2 .calc-v2-assumptions-body p {
  margin: 0 0 12px;
}

.calc-shell-v2 .calc-v2-assumptions-body p:last-child {
  margin-bottom: 0;
}

.calc-shell-v2 .calc-v2-assumptions-body ul,
.calc-shell-v2 .calc-v2-assumptions-body ol {
  margin: 0 0 12px;
  padding-left: 20px;
}

.calc-shell-v2 .calc-v2-assumptions-body li {
  margin-bottom: 6px;
}

/* --------------------------------------------------------------------------
   Results — Primary (Hero)
   -------------------------------------------------------------------------- */

.calc-shell-v2 .calc-v2-result-primary {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), var(--v2-accent-soft) 190%),
    var(--v2-surface);
  border: 1px solid var(--v2-border-strong);
  border-left: 4px solid var(--v2-accent);
  border-radius: var(--v2-radius-md);
  box-shadow: 0 1px 3px rgba(28, 39, 41, 0.04), 0 10px 28px rgba(28, 39, 41, 0.055);
  padding: 24px;
  margin-bottom: 16px;
  transition: border-left-color var(--v2-transition), opacity var(--v2-transition), transform var(--v2-transition);
}

@media (max-width: 560px) {
  .calc-shell-v2 .calc-v2-result-primary {
    padding: 18px;
  }
}

.calc-shell-v2 .calc-v2-result-label {
  display: block;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--v2-accent-text);
  margin-bottom: 8px;
}

.calc-shell-v2 .calc-v2-result-hero {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.calc-shell-v2 .calc-v2-result-value {
  font-size: 40px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--v2-text);
  letter-spacing: 0;
  word-break: break-word;
  overflow-wrap: anywhere;
}

@media (min-width: 1024px) {
  .calc-shell-v2 .calc-v2-result-value {
    font-size: 56px;
  }
}

@media (min-width: 1180px) and (max-width: 1359px) {
  .calc-shell-v2 .calc-v2-result-primary {
    padding: 20px;
  }

  .calc-shell-v2 .calc-v2-result-value {
    font-size: 44px;
  }
}

.calc-shell-v2 .calc-v2-result-unit {
  display: inline;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--v2-text-muted);
  margin-left: 6px;
  vertical-align: middle;
}

.calc-shell-v2 .calc-v2-result-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  color: var(--status-color, var(--v2-accent-text));
  background-color: var(--status-bg, var(--v2-accent-soft));
  border: 1px solid color-mix(in srgb, currentColor 16%, transparent);
  border-radius: var(--v2-radius-pill);
}

.calc-shell-v2 .calc-v2-result-note {
  max-width: 82ch;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.65;
  color: var(--v2-text-muted);
  margin-top: 12px;
}

/* --------------------------------------------------------------------------
   Results — Secondary (Mini Cards)
   -------------------------------------------------------------------------- */

.calc-shell-v2 .calc-v2-result-secondary {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

@media (max-width: 560px) {
  .calc-shell-v2 .calc-v2-result-secondary {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 1024px) {
  .calc-shell-v2 .calc-v2-result-secondary {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }
  .calc-shell-v2 .calc-v2-result-secondary:has(> .calc-v2-mini-card:nth-child(4)) {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.calc-shell-v2 .calc-v2-mini-card {
  background-color: var(--v2-surface);
  border: 1px solid var(--v2-border-strong);
  border-top: 3px solid color-mix(in srgb, var(--v2-accent) 42%, transparent);
  border-radius: var(--v2-radius-md);
  box-shadow: var(--v2-shadow);
  padding: 16px;
  min-width: 0;
  transition: border-color var(--v2-transition), box-shadow var(--v2-transition);
}

@media (max-width: 560px) {
  .calc-shell-v2 .calc-v2-mini-card {
    padding: 14px;
  }
}

.calc-shell-v2 .calc-v2-mini-card:hover {
  border-color: color-mix(in srgb, var(--v2-accent) 24%, var(--v2-border));
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05), 0 6px 18px rgba(0, 0, 0, 0.04);
}

.calc-shell-v2 .calc-v2-mini-card-label {
  font-size: 11px;
  font-weight: 800;
  line-height: 1.3;
  color: var(--v2-accent-text);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.calc-shell-v2 .calc-v2-mini-card-value {
  font-size: 20px;
  font-weight: 800;
  line-height: 1.3;
  color: var(--v2-text);
  word-break: break-word;
}

.calc-shell-v2 .calc-v2-mini-card-note {
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--v2-text-muted);
  margin-top: 4px;
}

/* --------------------------------------------------------------------------
   Escalation Banner
   -------------------------------------------------------------------------- */

.calc-shell-v2 .calc-v2-escalation-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 14px 16px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--status-color, var(--v2-accent-text));
  background-color: var(--status-bg, var(--v2-accent-soft));
  border-left: 4px solid var(--status-color, var(--v2-accent));
  border-radius: var(--v2-radius-sm);
  margin-bottom: 16px;
  box-sizing: border-box;
}

.calc-shell-v2 .calc-v2-escalation-banner::before {
  content: "!";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  font-size: 14px;
  line-height: 1;
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   Clinical Safety Strip
   -------------------------------------------------------------------------- */

.calc-shell-v2 .calc-v2-clinical-strip,
.calc-shell-v2 .crash-warning-bar {
  grid-column: 1 / -1;
  width: 100%;
  margin: 0;
  padding: 14px 16px;
  color: var(--v2-risk-color, var(--v2-accent-text));
  background: linear-gradient(135deg, var(--v2-risk-bg, var(--v2-accent-soft)), #ffffff 140%);
  border: 1px solid var(--v2-risk-border, color-mix(in srgb, var(--v2-accent) 22%, transparent));
  border-left: 4px solid var(--v2-risk-color, var(--v2-accent));
  border-radius: var(--v2-radius-md);
  box-shadow: var(--v2-shadow);
  box-sizing: border-box;
}

.calc-shell-v2 .calc-v2-clinical-strip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.calc-shell-v2 .calc-v2-clinical-strip--generated {
  display: none;
}

@media (min-width: 1180px) {
  .calc-shell-v2 .calc-v2-clinical-strip--generated {
    display: grid;
  }
}

.calc-shell-v2 .crash-warning-bar {
  display: block;
  position: relative;
  padding-left: 54px;
}

.calc-shell-v2 .crash-warning-bar::before {
  content: "!";
  position: absolute;
  left: 16px;
  top: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: var(--v2-radius-pill);
  color: #ffffff;
  background-color: var(--v2-risk-color, var(--v2-accent));
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
}

.calc-shell-v2 .calc-v2-clinical-strip__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  margin-top: 1px;
  border-radius: var(--v2-radius-pill);
  color: #ffffff;
  background-color: var(--v2-risk-color, var(--v2-accent));
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
}

.calc-shell-v2 .calc-v2-clinical-strip__body {
  min-width: 0;
}

.calc-shell-v2 .calc-v2-clinical-strip__label,
.calc-shell-v2 .crash-warning-bar strong {
  display: block;
  margin-bottom: 3px;
  color: var(--v2-risk-color, var(--v2-accent-text));
  font-size: 13px;
  font-weight: 800;
  line-height: 1.25;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.calc-shell-v2 .crash-warning-bar strong {
  display: inline;
  margin: 0 4px 0 0;
  font-size: 13px;
  text-transform: none;
  letter-spacing: 0;
}

.calc-shell-v2 .calc-v2-clinical-strip__text,
.calc-shell-v2 .crash-warning-bar {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
}

/* --------------------------------------------------------------------------
   Next Steps
   -------------------------------------------------------------------------- */

.calc-shell-v2 .calc-v2-next-steps {
  margin-top: 8px;
  border-top: 1px solid var(--v2-border);
}

.calc-shell-v2 .calc-v2-next-steps summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--v2-text-muted);
  cursor: pointer;
  list-style: none;
  user-select: none;
  transition: color var(--v2-transition);
}

.calc-shell-v2 .calc-v2-next-steps summary::-webkit-details-marker {
  display: none;
}

.calc-shell-v2 .calc-v2-next-steps summary::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform var(--v2-transition);
  flex-shrink: 0;
}

.calc-shell-v2 .calc-v2-next-steps[open] summary::before {
  transform: rotate(45deg);
}

.calc-shell-v2 .calc-v2-next-steps summary:hover {
  color: var(--v2-text);
}

.calc-shell-v2 .calc-v2-next-steps summary:focus-visible {
  outline: none;
  color: var(--v2-accent-text);
}

.calc-shell-v2 .calc-v2-next-steps-list {
  list-style: none;
  margin: 0;
  padding: 0 0 20px;
}

.calc-shell-v2 .calc-v2-next-steps-list li {
  position: relative;
  padding-left: 24px;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.7;
  color: var(--v2-text-muted);
  margin-bottom: 8px;
}

.calc-shell-v2 .calc-v2-next-steps-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 1px;
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--v2-accent);
  background-color: var(--v2-accent-soft);
  border-radius: var(--v2-radius-pill);
}

.calc-shell-v2 .calc-v2-next-steps-list li:last-child {
  margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   Copy Action
   -------------------------------------------------------------------------- */

.calc-shell-v2 .calc-v2-copy-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.calc-shell-v2 .calc-v2-copy-action button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  color: var(--v2-text-muted);
  background-color: transparent;
  border: 1px solid var(--v2-border);
  border-radius: var(--v2-radius-sm);
  cursor: pointer;
  transition: color var(--v2-transition), border-color var(--v2-transition), background-color var(--v2-transition);
  font-family: inherit;
}

.calc-shell-v2 .calc-v2-copy-action button:hover {
  color: var(--v2-accent-text);
  border-color: var(--v2-accent);
  background-color: var(--v2-accent-soft);
}

.calc-shell-v2 .calc-v2-copy-action button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--v2-accent-soft);
}

.calc-shell-v2 .calc-v2-copy-action .dose-copy-status {
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  color: var(--v2-accent);
  opacity: 0;
  transition: opacity var(--v2-transition);
}

.calc-shell-v2 .calc-v2-copy-action .dose-copy-status.is-visible {
  opacity: 1;
}

/* --------------------------------------------------------------------------
   Details Below Workspace
   -------------------------------------------------------------------------- */

.calc-shell-v2 .calc-v2-details {
  grid-column: 1;
  width: 100%;
  margin-top: 40px;
  padding-left: 16px;
  padding-right: 16px;
}

@media (min-width: 1024px) {
  .calc-shell-v2 .calc-v2-details {
    padding-left: 24px;
    padding-right: 24px;
  }
}

.calc-shell-v2 .calc-v2-detail-panel {
  margin-bottom: 0;
  background-color: transparent;
  border: none;
  border-bottom: 1px solid var(--v2-border);
  border-radius: 0;
  box-shadow: none;
  overflow: hidden;
  padding: 0;
}

.calc-shell-v2 .calc-v2-detail-panel summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 4px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--v2-text);
  cursor: pointer;
  list-style: none;
  user-select: none;
  transition: background-color var(--v2-transition);
  border-radius: var(--v2-radius-sm);
}

.calc-shell-v2 .calc-v2-detail-panel summary::-webkit-details-marker {
  display: none;
}

.calc-shell-v2 .calc-v2-detail-panel summary::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform var(--v2-transition);
  flex-shrink: 0;
}

.calc-shell-v2 .calc-v2-detail-panel[open] summary::before {
  transform: rotate(45deg);
}

.calc-shell-v2 .calc-v2-detail-panel summary:hover {
  background-color: rgba(0, 0, 0, 0.015);
}

.calc-shell-v2 .calc-v2-detail-panel summary:focus-visible {
  outline: none;
  background-color: var(--v2-accent-soft);
}

.calc-shell-v2 .calc-v2-detail-panel > div,
.calc-shell-v2 .calc-v2-detail-panel > article,
.calc-shell-v2 .calc-v2-detail-panel > section,
.calc-shell-v2 .calc-v2-detail-panel > ul,
.calc-shell-v2 .calc-v2-detail-panel > ol {
  padding: 0 4px 16px;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.7;
  color: var(--v2-text-muted);
}

.calc-shell-v2 .calc-v2-detail-panel p {
  margin: 0 0 12px;
}

.calc-shell-v2 .calc-v2-detail-panel p:last-child {
  margin-bottom: 0;
}

.calc-shell-v2 .calc-v2-detail-panel ul,
.calc-shell-v2 .calc-v2-detail-panel ol {
  margin: 0 0 12px;
  padding-left: 20px;
}

.calc-shell-v2 .calc-v2-detail-panel li {
  margin-bottom: 6px;
}

/* Flatten old-shell warning items inside v2 details */
.calc-shell-v2 .calc-v2-detail-panel .dose-warning-item {
  background: transparent;
  border: none;
  border-left: 2px solid var(--v2-border);
  padding: 6px 12px;
  border-radius: 0;
  transition: none;
}

.calc-shell-v2 .calc-v2-detail-panel .dose-warning-item:hover {
  transform: none;
}

.calc-shell-v2 .calc-v2-detail-panel code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 13px;
  padding: 2px 6px;
  background-color: rgba(0, 0, 0, 0.04);
  border-radius: 4px;
  color: var(--v2-text);
}

.calc-shell-v2 .calc-v2-detail-panel pre {
  overflow-x: auto;
  padding: 14px;
  background-color: rgba(0, 0, 0, 0.04);
  border-radius: var(--v2-radius-sm);
  font-size: 13px;
  line-height: 1.6;
}

.calc-shell-v2 .calc-v2-detail-panel pre code {
  padding: 0;
  background: none;
}

/* Specific detail panel modifiers */
.calc-shell-v2 .calc-v2-detail-safety summary {
  color: #9f1239;
}

.calc-shell-v2 .calc-v2-detail-safety[open] summary {
  background-color: #fff1f2;
}

.calc-shell-v2 .calc-v2-detail-basis summary {
  color: var(--v2-accent-text);
}

.calc-shell-v2 .calc-v2-detail-basis[open] summary {
  background-color: var(--v2-accent-soft);
}

.calc-shell-v2 .calc-v2-detail-formula summary {
  color: #075985;
}

.calc-shell-v2 .calc-v2-detail-formula[open] summary {
  background-color: #f0f9ff;
}

.calc-shell-v2 .calc-v2-detail-related summary {
  color: #065f46;
}

.calc-shell-v2 .calc-v2-detail-related[open] summary {
  background-color: #ecfdf5;
}

/* --------------------------------------------------------------------------
   Result Panel States
   -------------------------------------------------------------------------- */

/* When result panel has calculated results */
.calc-shell-v2 .calc-v2-result-panel.is-calculated {
  /* Subtle entrance animation handled by opacity/transform on children */
}

.calc-shell-v2 .calc-v2-result-panel.is-calculated .calc-v2-result-primary {
  animation: calcV2FadeIn 250ms ease-out;
}

.calc-shell-v2 .calc-v2-result-panel.is-calculated .calc-v2-mini-card {
  animation: calcV2FadeInUp 250ms ease-out backwards;
}

.calc-shell-v2 .calc-v2-result-panel.is-calculated .calc-v2-mini-card:nth-child(1) { animation-delay: 50ms; }
.calc-shell-v2 .calc-v2-result-panel.is-calculated .calc-v2-mini-card:nth-child(2) { animation-delay: 100ms; }
.calc-shell-v2 .calc-v2-result-panel.is-calculated .calc-v2-mini-card:nth-child(3) { animation-delay: 150ms; }

.calc-shell-v2 .calc-v2-result-panel.is-live-updated .calc-v2-result-primary {
  animation: calcV2ResultPulse 420ms ease-out;
}

.calc-shell-v2 .calc-v2-result-panel.is-live-updated .calc-v2-mini-card,
.calc-shell-v2 .calc-v2-result-panel.is-live-updated .dose-result-card {
  animation: calcV2ResultMiniPulse 420ms ease-out;
}

@keyframes calcV2FadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes calcV2FadeInUp {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes calcV2ResultPulse {
  0% {
    box-shadow: var(--v2-shadow);
    transform: translateY(0);
  }
  45% {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--v2-accent) 18%, transparent), var(--v2-shadow);
    transform: translateY(-1px);
  }
  100% {
    box-shadow: var(--v2-shadow);
    transform: translateY(0);
  }
}

@keyframes calcV2ResultMiniPulse {
  0% {
    border-color: var(--v2-border);
  }
  45% {
    border-color: color-mix(in srgb, var(--v2-accent) 28%, transparent);
  }
  100% {
    border-color: var(--v2-border);
  }
}

@media (prefers-reduced-motion: reduce) {
  .calc-shell-v2 .calc-v2-result-panel.is-calculated .calc-v2-result-primary,
  .calc-shell-v2 .calc-v2-result-panel.is-calculated .calc-v2-mini-card,
  .calc-shell-v2 .calc-v2-result-panel.is-live-updated .calc-v2-result-primary,
  .calc-shell-v2 .calc-v2-result-panel.is-live-updated .calc-v2-mini-card,
  .calc-shell-v2 .calc-v2-result-panel.is-live-updated .dose-result-card {
    animation: none !important;
    transform: none !important;
  }
}

/* When validation errors exist */
.calc-shell-v2 .calc-v2-result-panel.has-errors {
  opacity: 0.6;
  pointer-events: none;
  filter: grayscale(0.3);
  transition: opacity var(--v2-transition), filter var(--v2-transition);
}

/* --------------------------------------------------------------------------
   Related Tools
   -------------------------------------------------------------------------- */

.calc-shell-v2 .related-tools-section {
  display: grid;
  gap: 14px;
}

.calc-shell-v2 .related-tools-head {
  display: grid;
  gap: 8px;
}

.calc-shell-v2 .related-tools-head h2 {
  margin: 0;
  color: var(--v2-text);
  font-size: 22px;
  line-height: 1.25;
}

.calc-shell-v2 .related-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 14px;
}

.calc-shell-v2 .related-tool-card {
  display: flex;
  min-width: 0;
  min-height: 100%;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
  border-radius: 8px;
}

.calc-shell-v2 .related-tool-card h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.calc-shell-v2 .related-tool-card p {
  margin: 0;
  color: var(--v2-text-muted);
  font-size: 14px;
  line-height: 1.5;
}

.calc-shell-v2 .related-tool-card .tool-card-footer {
  margin-top: auto;
}

/* --------------------------------------------------------------------------
   Post-result desktop tool dock
   -------------------------------------------------------------------------- */

.calc-shell-v2 .calc-v2-post-result-tools {
  display: none;
}

@media (min-width: 1024px) {
  .calc-shell-v2 .calc-v2-post-result-tools {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: minmax(220px, 0.74fr) repeat(3, minmax(0, 1fr));
    gap: 12px;
    min-width: 0;
    align-items: stretch;
  }

  .calc-shell-v2 .calc-v2-post-result-tools .calc-v2-context-block {
    gap: 10px;
    min-height: 100%;
    padding: 13px;
    background: rgba(255, 255, 255, 0.66);
    box-shadow: none;
  }

  .calc-shell-v2 .calc-v2-post-result-tools .calc-v2-context-stack {
    gap: 8px;
  }

  .calc-shell-v2 .calc-v2-post-result-tools .calc-v2-context-link {
    min-height: 46px;
    background: #ffffff;
    border-color: var(--v2-border);
  }

  .calc-shell-v2 .calc-v2-post-result-tools .calc-v2-context-link span {
    font-size: 13px;
  }

  .calc-shell-v2 .calc-v2-post-result-tools .calc-v2-context-button {
    min-height: 42px;
  }
}

@media (min-width: 1024px) and (max-width: 1279px) {
  .calc-shell-v2 .calc-v2-post-result-tools {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* --------------------------------------------------------------------------
   Emergency Drug Desktop Browser
   -------------------------------------------------------------------------- */

.calc-shell-v2 .emergency-desktop-browser {
  display: none;
}

@media (min-width: 1180px) {
  .calc-shell-v2 .emergency-desktop-browser {
    display: grid;
    gap: 12px;
    margin-top: 16px;
    padding: 14px;
    border: 1px solid color-mix(in srgb, var(--v2-accent) 18%, var(--v2-border));
    border-radius: var(--v2-radius-md);
    background:
      linear-gradient(135deg, rgba(255, 241, 242, 0.82), rgba(255, 255, 255, 0.96) 58%),
      #ffffff;
    box-shadow: var(--v2-shadow);
  }

  .calc-shell-v2 .emergency-desktop-browser__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
  }

  .calc-shell-v2 .emergency-desktop-browser__kicker {
    display: block;
    margin-bottom: 4px;
    color: var(--v2-accent-text);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    line-height: 1.2;
    text-transform: uppercase;
  }

  .calc-shell-v2 .emergency-desktop-browser__head h2 {
    margin: 0;
    color: var(--v2-text);
    font-size: 17px;
    line-height: 1.2;
  }

  .calc-shell-v2 .emergency-desktop-browser__count {
    flex: 0 0 auto;
    padding: 5px 8px;
    color: var(--v2-accent-text);
    background: rgba(255, 241, 242, 0.92);
    border: 1px solid color-mix(in srgb, var(--v2-accent) 20%, transparent);
    border-radius: var(--v2-radius-sm);
    font-size: 11px;
    font-weight: 800;
    line-height: 1.2;
  }

  .calc-shell-v2 .emergency-desktop-browser__controls {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .calc-shell-v2 .emergency-browser-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 8px 12px;
    color: var(--v2-text-muted);
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid var(--v2-border);
    border-radius: var(--v2-radius-sm);
    font-family: inherit;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
  }

  .calc-shell-v2 .emergency-browser-chip.active {
    color: #ffffff;
    background: var(--v2-accent);
    border-color: var(--v2-accent);
  }

  .calc-shell-v2 .emergency-desktop-browser__table-wrap {
    max-height: 430px;
    overflow: auto;
    border: 1px solid var(--v2-border);
    border-radius: var(--v2-radius-md);
    background: #ffffff;
  }

  .calc-shell-v2 .emergency-desktop-table {
    width: 100%;
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
  }

  .calc-shell-v2 .emergency-desktop-table th,
  .calc-shell-v2 .emergency-desktop-table td {
    padding: 10px;
    vertical-align: top;
    border-bottom: 1px solid rgba(17, 24, 39, 0.08);
    text-align: left;
  }

  .calc-shell-v2 .emergency-desktop-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    color: var(--v2-text-muted);
    background: #fff7f7;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.06em;
    line-height: 1.2;
    text-transform: uppercase;
  }

  .calc-shell-v2 .emergency-desktop-table th:nth-child(1),
  .calc-shell-v2 .emergency-desktop-table td:nth-child(1) {
    width: 40%;
  }

  .calc-shell-v2 .emergency-desktop-table th:nth-child(2),
  .calc-shell-v2 .emergency-desktop-table td:nth-child(2) {
    width: 30%;
  }

  .calc-shell-v2 .emergency-desktop-table th:nth-child(3),
  .calc-shell-v2 .emergency-desktop-table td:nth-child(3) {
    width: 30%;
  }

  .calc-shell-v2 .emergency-desktop-table tbody tr:last-child td {
    border-bottom: 0;
  }

  .calc-shell-v2 .emergency-desktop-table tbody tr.is-unavailable {
    background: rgba(17, 24, 39, 0.025);
  }

  .calc-shell-v2 .emergency-desktop-table td strong,
  .calc-shell-v2 .emergency-desktop-table td small,
  .calc-shell-v2 .emergency-dose-ref,
  .calc-shell-v2 .emergency-patient-dose {
    display: block;
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .calc-shell-v2 .emergency-desktop-table td strong {
    color: var(--v2-text);
    font-size: 13px;
    line-height: 1.25;
  }

  .calc-shell-v2 .emergency-desktop-table td small,
  .calc-shell-v2 .emergency-patient-dose span {
    margin-top: 3px;
    color: var(--v2-text-muted);
    font-size: 11px;
    line-height: 1.35;
  }

  .calc-shell-v2 .emergency-dose-ref {
    color: var(--v2-accent-text);
    font-size: 12px;
    font-weight: 900;
    line-height: 1.25;
  }

  .calc-shell-v2 .emergency-patient-dose strong {
    color: #111827;
    font-size: 13px;
  }

  .calc-shell-v2 .emergency-desktop-table tr.is-unavailable .emergency-patient-dose strong,
  .calc-shell-v2 .emergency-desktop-table tr.is-unavailable td strong {
    color: var(--v2-text-muted);
  }
}

.calc-shell-v2 .crash-table-wrap,
.calc-shell-v2 .edc-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

@media screen {
  body[data-tool-slug="anesthetic-protocol"].calc-shell-v2 .anes-grids-container {
    gap: 18px;
  }

  body[data-tool-slug="anesthetic-protocol"].calc-shell-v2 .anes-grid-section {
    display: grid;
    gap: 9px;
  }

  body[data-tool-slug="anesthetic-protocol"].calc-shell-v2 .anes-grid-label {
    margin: 0 !important;
    color: var(--v2-accent-text) !important;
    font-size: 12px !important;
    font-weight: 900 !important;
    letter-spacing: 0.04em !important;
  }

  body[data-tool-slug="anesthetic-protocol"].calc-shell-v2 .anes-grid-section .crash-dose-table tbody {
    gap: 12px;
  }

  body[data-tool-slug="anesthetic-protocol"].calc-shell-v2 .anes-grid-section .crash-dose-table tr {
    gap: 10px;
    border-color: color-mix(in srgb, var(--v2-accent) 20%, var(--v2-border-strong));
    border-left-color: var(--v2-accent);
    box-shadow: 0 1px 2px rgba(28, 39, 41, 0.035), 0 8px 22px rgba(28, 39, 41, 0.045);
  }

  body[data-tool-slug="anesthetic-protocol"].calc-shell-v2 .anes-grid-section .crash-dose-table td {
    color: var(--v2-text);
    font-size: 14px;
    line-height: 1.45;
  }

  body[data-tool-slug="anesthetic-protocol"].calc-shell-v2 .anes-grid-section .crash-dose-table td::before {
    color: var(--v2-accent-text);
    font-size: 11px;
    letter-spacing: 0.04em;
  }

  body[data-tool-slug="anesthetic-protocol"].calc-shell-v2 .anes-grid-section .crash-dose-table td:first-child strong {
    color: var(--v2-text);
    font-size: 17px;
    font-weight: 900;
    line-height: 1.2;
  }

  body[data-tool-slug="anesthetic-protocol"].calc-shell-v2 .anes-grid-section .crash-dose-table td:first-child small,
  body[data-tool-slug="anesthetic-protocol"].calc-shell-v2 .anes-grid-section .crash-dose-table td small {
    display: block;
    margin-top: 4px;
    color: var(--v2-text-muted);
    font-size: 12px;
    line-height: 1.35;
  }

  body[data-tool-slug="anesthetic-protocol"].calc-shell-v2 .anes-grid-section .crash-dose-table td[data-label="Dose range"],
  body[data-tool-slug="anesthetic-protocol"].calc-shell-v2 .anes-grid-section .crash-dose-table td[data-label="Volume range"] {
    border: 1px solid color-mix(in srgb, var(--v2-accent) 16%, var(--v2-border));
    border-radius: var(--v2-radius-sm);
    background: color-mix(in srgb, var(--v2-accent-soft) 58%, #ffffff);
    padding: 9px;
    font-weight: 800;
  }

  body[data-tool-slug="anesthetic-protocol"].calc-shell-v2 .anes-grid-section .crash-dose-table td[data-label="Route"] {
    color: var(--v2-accent-text);
    font-weight: 900;
  }
}

@media screen and (min-width: 1024px) {
  body[data-tool-slug="anesthetic-protocol"].calc-shell-v2 .anes-grid-section .crash-dose-table tr {
    display: grid;
    grid-template-columns:
      minmax(160px, 1fr)
      minmax(150px, 0.92fr)
      minmax(160px, 0.96fr)
      minmax(82px, 0.45fr)
      minmax(220px, 1.45fr);
    align-items: stretch;
  }

  body[data-tool-slug="anesthetic-protocol"].calc-shell-v2 .anes-grid-section .crash-dose-table td {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  body[data-tool-slug="anesthetic-protocol"].calc-shell-v2 .anes-grid-section .crash-dose-table td:first-child {
    align-content: center;
  }

  body[data-tool-slug="anesthetic-protocol"].calc-shell-v2 .anes-grid-section .crash-dose-table td:first-child::before {
    display: none;
  }
}

body[data-tool-slug="anesthetic-protocol"].calc-shell-v2 .anes-template-panel {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid color-mix(in srgb, var(--v2-accent) 20%, var(--v2-border-strong));
  border-radius: var(--v2-radius-md);
  background:
    linear-gradient(135deg, var(--v2-accent-soft), rgba(255, 255, 255, 0.96) 72%),
    #ffffff;
  box-shadow: var(--v2-shadow);
}

body[data-tool-slug="anesthetic-protocol"].calc-shell-v2 .anes-template-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

body[data-tool-slug="anesthetic-protocol"].calc-shell-v2 .anes-template-kicker {
  display: block;
  margin-bottom: 4px;
  color: var(--v2-accent-text);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-transform: uppercase;
}

body[data-tool-slug="anesthetic-protocol"].calc-shell-v2 .anes-template-head h2 {
  margin: 0;
  color: var(--v2-text);
  font-size: 18px;
  line-height: 1.25;
}

body[data-tool-slug="anesthetic-protocol"].calc-shell-v2 .anes-template-head p {
  max-width: 76ch;
  margin: 5px 0 0;
  color: var(--v2-text-muted);
  font-size: 13px;
  line-height: 1.45;
}

body[data-tool-slug="anesthetic-protocol"].calc-shell-v2 .anes-template-state {
  flex: 0 0 auto;
  padding: 6px 10px;
  color: var(--v2-accent-text);
  background: #ffffff;
  border: 1px solid color-mix(in srgb, var(--v2-accent) 18%, var(--v2-border));
  border-radius: var(--v2-radius-sm);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.2;
}

body[data-tool-slug="anesthetic-protocol"].calc-shell-v2 .anes-template-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr));
}

body[data-tool-slug="anesthetic-protocol"].calc-shell-v2 .anes-template-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

body[data-tool-slug="anesthetic-protocol"].calc-shell-v2 .anes-template-actions span {
  color: var(--v2-accent-text);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

body[data-tool-slug="anesthetic-protocol"].calc-shell-v2 .anes-template-section {
  display: grid;
  gap: 9px;
}

body[data-tool-slug="anesthetic-protocol"].calc-shell-v2 .anes-template-section > p {
  margin: 0;
  color: var(--v2-accent-text);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.06em;
  line-height: 1.2;
  text-transform: uppercase;
}

body[data-tool-slug="anesthetic-protocol"].calc-shell-v2 .anes-template-checks {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
}

body[data-tool-slug="anesthetic-protocol"].calc-shell-v2 .anes-template-check,
body[data-tool-slug="anesthetic-protocol"].calc-shell-v2 .anes-template-drug label {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  min-width: 0;
  color: var(--v2-text);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.3;
}

body[data-tool-slug="anesthetic-protocol"].calc-shell-v2 .anes-template-check input,
body[data-tool-slug="anesthetic-protocol"].calc-shell-v2 .anes-template-drug input {
  flex: 0 0 auto;
  margin-top: 2px;
}

body[data-tool-slug="anesthetic-protocol"].calc-shell-v2 .anes-template-drugs {
  display: grid;
  gap: 8px;
}

body[data-tool-slug="anesthetic-protocol"].calc-shell-v2 .anes-template-drug {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(120px, 150px);
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--v2-border);
  border-radius: var(--v2-radius-sm);
  background: #ffffff;
}

body[data-tool-slug="anesthetic-protocol"].calc-shell-v2 .anes-template-drug strong,
body[data-tool-slug="anesthetic-protocol"].calc-shell-v2 .anes-template-drug small {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

body[data-tool-slug="anesthetic-protocol"].calc-shell-v2 .anes-template-drug small,
body[data-tool-slug="anesthetic-protocol"].calc-shell-v2 .anes-template-empty {
  color: var(--v2-text-muted);
  font-size: 12px;
  line-height: 1.35;
}

body[data-tool-slug="anesthetic-protocol"].calc-shell-v2 .anes-template-empty {
  margin: 0;
}

@media (max-width: 640px) {
  body[data-tool-slug="anesthetic-protocol"].calc-shell-v2 .anes-template-head,
  body[data-tool-slug="anesthetic-protocol"].calc-shell-v2 .anes-template-drug {
    grid-template-columns: 1fr;
  }

  body[data-tool-slug="anesthetic-protocol"].calc-shell-v2 .anes-template-head {
    display: grid;
  }
}

@media print {
  body.anes-print-compact {
    font-size: 7.6pt !important;
    line-height: 1.12 !important;
  }

  body.anes-print-compact .anes-workflow-block,
  body.anes-print-compact .calc-v2-copy-action {
    display: none !important;
  }

  body.anes-print-compact .dose-result-panel {
    margin-top: 8px !important;
    padding: 5px !important;
  }

  body.anes-print-compact .anes-print-header {
    margin: -5px -5px 4px !important;
    padding: 5px 7px 4px !important;
  }

  body.anes-print-compact .anes-print-logo {
    width: 26px !important;
    height: 26px !important;
  }

  body.anes-print-compact .anes-print-title {
    font-size: 12pt !important;
  }

  body.anes-print-compact .anes-print-meta-line {
    font-size: 6.2pt !important;
  }

  body.anes-print-compact .calc-v2-result-value {
    font-size: 11pt !important;
  }

  body.anes-print-compact .calc-v2-result-note,
  body.anes-print-compact .calc-v2-result-status {
    font-size: 6.5pt !important;
  }

  body.anes-print-compact .anes-case-meta {
    gap: 3px !important;
    margin-top: 4px !important;
  }

  body.anes-print-compact .anes-case-meta div {
    padding: 3px 5px !important;
  }

  body.anes-print-compact .anes-case-meta dt {
    font-size: 5.8pt !important;
  }

  body.anes-print-compact .anes-case-meta dd {
    font-size: 6.8pt !important;
  }

  body.anes-print-compact .anes-grids-container {
    gap: 4px !important;
  }

  body.anes-print-compact .anes-grid-label {
    margin: 4px 0 2px !important;
    padding: 2px 5px !important;
    font-size: 6.7pt !important;
  }

  body.anes-print-compact .crash-dose-table {
    font-size: 5.5pt !important;
    line-height: 1.08 !important;
  }

  body.anes-print-compact .crash-dose-table th,
  body.anes-print-compact .crash-dose-table td {
    padding: 1px 2px !important;
  }

  body.anes-print-compact .crash-dose-table small {
    font-size: 4.9pt !important;
  }

  body.anes-print-compact .anes-print-note,
  body.anes-print-compact .anes-print-footer {
    font-size: 5.6pt !important;
    margin-top: 4px !important;
    padding-top: 3px !important;
  }
}

/* --------------------------------------------------------------------------
   Infusion Desktop Workpanel
   -------------------------------------------------------------------------- */

.calc-shell-v2 .infusion-desktop-workpanel {
  display: none;
}

@media (min-width: 1180px) {
  .calc-shell-v2 .infusion-desktop-workpanel {
    display: grid;
    gap: 12px;
    margin-top: 16px;
    padding: 15px;
    border: 1px solid color-mix(in srgb, var(--v2-accent) 18%, var(--v2-border));
    border-radius: var(--v2-radius-md);
    background:
      linear-gradient(135deg, var(--v2-accent-soft), rgba(255, 255, 255, 0.96) 62%),
      #ffffff;
    box-shadow: var(--v2-shadow);
  }

  .calc-shell-v2 .infusion-workpanel__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
  }

  .calc-shell-v2 .infusion-workpanel__kicker {
    display: block;
    margin-bottom: 4px;
    color: var(--v2-accent-text);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    line-height: 1.2;
    text-transform: uppercase;
  }

  .calc-shell-v2 .infusion-workpanel__head h2 {
    margin: 0;
    color: var(--v2-text);
    font-size: 17px;
    line-height: 1.2;
    overflow-wrap: anywhere;
  }

  .calc-shell-v2 .infusion-workpanel__state {
    flex: 0 0 auto;
    max-width: 42%;
    padding: 5px 8px;
    color: var(--v2-accent-text);
    background: rgba(255, 255, 255, 0.76);
    border: 1px solid color-mix(in srgb, var(--v2-accent) 20%, transparent);
    border-radius: var(--v2-radius-sm);
    font-size: 11px;
    font-weight: 800;
    line-height: 1.25;
    text-align: right;
  }

  .calc-shell-v2 .infusion-workpanel__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
    gap: 10px;
  }

  .calc-shell-v2 .infusion-workpanel__card {
    display: grid;
    align-content: start;
    gap: 4px;
    min-width: 0;
    min-height: 94px;
    padding: 11px;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(17, 24, 39, 0.08);
    border-radius: var(--v2-radius-sm);
  }

  .calc-shell-v2 .infusion-workpanel__card span {
    color: var(--v2-text-muted);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.06em;
    line-height: 1.2;
    text-transform: uppercase;
  }

  .calc-shell-v2 .infusion-workpanel__card strong {
    min-width: 0;
    color: var(--v2-text);
    font-size: 14px;
    line-height: 1.25;
    overflow-wrap: anywhere;
  }

  .calc-shell-v2 .infusion-workpanel__card small {
    min-width: 0;
    color: var(--v2-text-muted);
    font-size: 11px;
    line-height: 1.35;
    overflow-wrap: anywhere;
  }

  .calc-shell-v2 .infusion-workpanel__card--standardizer {
    border-style: dashed;
    background: rgba(255, 255, 255, 0.62);
  }

  .calc-shell-v2 .infusion-workpanel__grid[data-workpanel-expanded] .infusion-workpanel__card:last-child {
    grid-column: 1 / -1;
  }
}

@media (min-width: 1180px) and (max-width: 1320px) {
  .calc-shell-v2 .infusion-workpanel__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* --------------------------------------------------------------------------
   Drug Formulary Desktop Browser
   -------------------------------------------------------------------------- */

.calc-shell-v2 .formulary-desktop-browser {
  display: none;
}

@media (min-width: 1180px) {
  .calc-shell-v2 .formulary-desktop-browser {
    display: grid;
    gap: 12px;
    margin-top: 16px;
    padding: 18px;
    border: 1px solid var(--v2-border);
    border-radius: var(--v2-radius-md);
    background: rgba(255, 255, 255, 0.82);
    box-shadow: var(--v2-shadow);
  }

  .calc-shell-v2 .formulary-desktop-browser__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
  }

  .calc-shell-v2 .formulary-desktop-browser__kicker {
    display: block;
    margin-bottom: 4px;
    color: var(--v2-accent-text);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.08em;
    line-height: 1.2;
    text-transform: uppercase;
  }

  .calc-shell-v2 .formulary-desktop-browser__head h2 {
    margin: 0;
    color: var(--v2-text);
    font-size: 16px;
    line-height: 1.25;
  }

  .calc-shell-v2 .formulary-desktop-browser__count {
    color: var(--v2-text-muted);
    font-size: 12px;
    font-weight: 800;
    line-height: 1.4;
  }

  .calc-shell-v2 .formulary-desktop-browser__table-wrap {
    max-height: 430px;
    overflow: auto;
    border: 1px solid var(--v2-border);
    border-radius: var(--v2-radius-sm);
    background: #ffffff;
  }

  .calc-shell-v2 .formulary-desktop-table {
    min-width: 720px;
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
  }

  .calc-shell-v2 .formulary-desktop-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 9px 10px;
    color: var(--v2-text-muted);
    background: #fffdfb;
    border-bottom: 1px solid var(--v2-border);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.08em;
    line-height: 1.2;
    text-align: left;
    text-transform: uppercase;
  }

  .calc-shell-v2 .formulary-desktop-table td {
    padding: 10px;
    vertical-align: top;
    border-bottom: 1px solid rgba(0, 0, 0, 0.045);
  }

  .calc-shell-v2 .formulary-desktop-table tr.is-active td {
    background: var(--v2-accent-soft);
  }

  .calc-shell-v2 .formulary-desktop-table td:first-child {
    width: 27%;
  }

  .calc-shell-v2 .formulary-desktop-table td:nth-child(2),
  .calc-shell-v2 .formulary-desktop-table td:nth-child(3) {
    width: 28%;
  }

  .calc-shell-v2 .formulary-desktop-table td:last-child {
    width: 17%;
  }

  .calc-shell-v2 .formulary-desktop-table strong {
    display: block;
    color: var(--v2-text);
    font-size: 13px;
    line-height: 1.25;
    overflow-wrap: anywhere;
  }

  .calc-shell-v2 .formulary-desktop-table small {
    display: block;
    margin-top: 3px;
    color: var(--v2-text-muted);
    font-size: 11px;
    line-height: 1.3;
  }

  .calc-shell-v2 .formulary-dose-chip {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    margin-bottom: 5px;
    padding: 4px 7px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 900;
    line-height: 1;
  }

  .calc-shell-v2 .formulary-dose-chip--calculable {
    color: #065f46;
    background: #ecfdf5;
  }

  .calc-shell-v2 .formulary-dose-chip--reference {
    color: #075985;
    background: #f0f9ff;
  }

  .calc-shell-v2 .formulary-dose-chip--blocked {
    color: #9f1239;
    background: #fff1f2;
  }

  .calc-shell-v2 .formulary-dose-text {
    display: block;
    color: var(--v2-text);
    font-size: 12px;
    line-height: 1.45;
    overflow-wrap: anywhere;
  }

  .calc-shell-v2 .formulary-desktop-actions {
    display: grid;
    gap: 7px;
  }

  .calc-shell-v2 .formulary-lookup-btn {
    min-height: 30px;
    padding: 6px 10px;
    color: #ffffff;
    background: #1c2729;
    border: 1px solid #1c2729;
    border-radius: var(--v2-radius-sm);
    cursor: pointer;
    font-family: inherit;
    font-size: 12px;
    font-weight: 900;
    line-height: 1;
  }

  .calc-shell-v2 .formulary-lookup-btn:hover,
  .calc-shell-v2 .formulary-lookup-btn:focus-visible {
    background: #0d1722;
    outline: none;
  }

  .calc-shell-v2 .formulary-desktop-empty {
    padding: 16px;
    color: var(--v2-text-muted);
    font-size: 13px;
    line-height: 1.45;
    text-align: center;
  }
}

.calc-shell-v2 #dc-dose-drug-info .dose-chip.is-selected,
.calc-shell-v2 #dc-dose-drug-info .conc-chip.is-selected {
  border-color: #0f766e !important;
  background: #ecfdf5 !important;
  color: #064e3b;
  box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.14);
}

.calc-shell-v2 #dc-dose-drug-info .dose-chip.is-selected small,
.calc-shell-v2 #dc-dose-drug-info .conc-chip.is-selected div {
  color: #064e3b !important;
}

/* --------------------------------------------------------------------------
   Command Palette
   -------------------------------------------------------------------------- */

.calc-v2-command-open {
  overflow: hidden;
}

.calc-v2-command-palette[hidden] {
  display: none !important;
}

.calc-v2-command-palette {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: start center;
  padding: 72px 16px 24px;
}

.calc-v2-command-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 18, 20, 0.42);
  backdrop-filter: blur(3px);
}

.calc-v2-command-panel {
  position: relative;
  width: min(720px, 100%);
  max-height: min(680px, calc(100vh - 96px));
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 14px;
  background: #fffdfb;
  box-shadow: 0 24px 70px rgba(12, 18, 20, 0.22);
}

.calc-v2-command-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 14px;
  border-bottom: 1px solid var(--v2-border);
  background: linear-gradient(135deg, #ffffff, var(--v2-accent-soft));
}

.calc-v2-command-search input {
  min-width: 0;
  min-height: 48px;
  padding: 12px 14px;
  color: var(--v2-text);
  background: #ffffff;
  border: 1px solid var(--v2-border);
  border-radius: 10px;
  font-family: inherit;
  font-size: 16px;
  line-height: 1.3;
}

.calc-v2-command-search input:focus {
  outline: none;
  border-color: var(--v2-accent);
  box-shadow: 0 0 0 3px var(--v2-accent-soft);
}

.calc-v2-command-search button {
  min-height: 48px;
  padding: 10px 14px;
  color: var(--v2-text-muted);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--v2-border);
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
}

.calc-v2-command-search button:hover,
.calc-v2-command-search button:focus-visible {
  color: var(--v2-text);
  background: #ffffff;
  outline: none;
}

.calc-v2-command-results {
  display: grid;
  gap: 4px;
  max-height: calc(min(680px, 100vh - 96px) - 78px);
  overflow: auto;
  padding: 10px;
}

.calc-v2-command-result {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 14px;
  align-items: center;
  padding: 12px;
  color: var(--v2-text);
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 10px;
}

.calc-v2-command-result span,
.calc-v2-command-result em {
  min-width: 0;
}

.calc-v2-command-result strong {
  display: block;
  color: inherit;
  font-size: 14px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.calc-v2-command-result small {
  display: block;
  margin-top: 3px;
  color: var(--v2-accent-text);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.3;
}

.calc-v2-command-result em {
  color: var(--v2-text-muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.4;
}

.calc-v2-command-result:hover,
.calc-v2-command-result:focus-visible,
.calc-v2-command-result.is-selected {
  color: var(--v2-text);
  background: var(--v2-accent-soft);
  border-color: color-mix(in srgb, var(--v2-accent) 24%, transparent);
  outline: none;
}

.calc-v2-command-empty {
  margin: 0;
  padding: 24px;
  color: var(--v2-text-muted);
  font-size: 14px;
  line-height: 1.5;
  text-align: center;
}

@media (max-width: 560px) {
  .calc-v2-command-palette {
    padding: 18px 10px;
    place-items: start center;
  }

  .calc-v2-command-panel {
    max-height: calc(100vh - 36px);
    border-radius: 12px;
  }

  .calc-v2-command-search {
    grid-template-columns: 1fr;
  }

  .calc-v2-command-result {
    grid-template-columns: 1fr;
    gap: 5px;
  }
}

/* --------------------------------------------------------------------------
   Clinical tools consent banner
   -------------------------------------------------------------------------- */

@media screen {
  body.calc-shell-v2 #cookie-banner,
  body:has(.calc-shell-v2) #cookie-banner {
    right: 16px !important;
    bottom: 16px !important;
    left: auto !important;
    width: min(340px, calc(100% - 24px)) !important;
    max-width: 340px !important;
    margin: 0 !important;
    padding: 9px 10px !important;
    transform: none !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 14px !important;
    box-shadow: 0 16px 40px rgba(20, 33, 47, 0.22) !important;
    font-size: 0.78rem !important;
  }

  body.calc-shell-v2 #cookie-banner > div,
  body:has(.calc-shell-v2) #cookie-banner > div {
    flex-wrap: wrap !important;
    gap: 8px 12px !important;
    max-width: none !important;
    margin: 0 !important;
  }

  body.calc-shell-v2 #cookie-banner span,
  body:has(.calc-shell-v2) #cookie-banner span {
    flex: 1 1 260px !important;
    line-height: 1.35 !important;
  }

  body.calc-shell-v2 #cookie-banner > div > div,
  body:has(.calc-shell-v2) #cookie-banner > div > div {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    justify-content: flex-end !important;
  }

  body.calc-shell-v2 #cookie-accept,
  body:has(.calc-shell-v2) #cookie-accept {
    min-height: 44px !important;
    padding: 8px 14px !important;
    border-radius: 9px !important;
    font-size: 0.8rem !important;
    font-weight: 800 !important;
  }
}

@media screen and (max-width: 640px) {
  body.calc-shell-v2 #cookie-banner,
  body:has(.calc-shell-v2) #cookie-banner {
    bottom: 8px !important;
    right: auto !important;
    left: 50% !important;
    width: calc(100% - 16px) !important;
    padding: 10px !important;
    transform: translateX(-50%) !important;
    font-size: 0.78rem !important;
  }

  body.calc-shell-v2 #cookie-banner > div > div,
  body:has(.calc-shell-v2) #cookie-banner > div > div {
    flex: 1 1 100% !important;
  }

  body.calc-shell-v2 #cookie-accept,
  body:has(.calc-shell-v2) #cookie-accept {
    flex: 1 1 140px !important;
  }
}

/* --------------------------------------------------------------------------
   Shared Calculator Print Controls
   -------------------------------------------------------------------------- */

.calc-shell-v2 .calc-v2-print-sheet-header {
  display: none;
}

.calc-shell-v2 .calc-v2-print-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  padding: 14px 15px;
  color: var(--v2-text);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), var(--v2-accent-soft)),
    #ffffff;
  border: 1px solid color-mix(in srgb, var(--v2-accent) 18%, var(--v2-border));
  border-left: 4px solid color-mix(in srgb, var(--v2-accent) 58%, #0d1722);
  border-radius: var(--v2-radius-md);
  box-shadow: var(--v2-shadow);
}

.calc-shell-v2 .calc-v2-print-actions__copy,
.calc-shell-v2 .calc-v2-print-actions__controls {
  min-width: 0;
}

.calc-shell-v2 .calc-v2-print-actions__copy {
  display: grid;
  gap: 3px;
}

.calc-shell-v2 .calc-v2-print-actions__copy span {
  color: var(--v2-accent-text);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-transform: uppercase;
}

.calc-shell-v2 .calc-v2-print-actions__copy strong {
  color: var(--v2-text);
  font-size: 15px;
  line-height: 1.25;
}

.calc-shell-v2 .calc-v2-print-actions__copy small {
  color: var(--v2-text-muted);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.calc-shell-v2 .calc-v2-print-actions__controls {
  display: grid;
  justify-items: end;
  gap: 5px;
}

.calc-shell-v2 .calc-v2-print-button {
  min-height: 44px;
  padding: 11px 16px;
  color: #ffffff;
  background: #1c2729;
  border: 1px solid #1c2729;
  border-radius: var(--v2-radius-sm);
  cursor: pointer;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
  transition: background-color var(--v2-transition), border-color var(--v2-transition), box-shadow var(--v2-transition);
}

.calc-shell-v2 .calc-v2-print-button:hover,
.calc-shell-v2 .calc-v2-print-button:focus-visible {
  background: #0d1722;
  border-color: #0d1722;
  outline: none;
  box-shadow: 0 0 0 3px var(--v2-focus-ring), 0 10px 22px rgba(13, 23, 34, 0.14);
}

.calc-shell-v2 .calc-v2-print-button:disabled {
  cursor: progress;
  opacity: 0.65;
}

.calc-shell-v2 .calc-v2-print-actions__controls small {
  color: var(--v2-text-muted);
  font-size: 11px;
  line-height: 1.25;
  text-align: right;
}

@media (max-width: 680px) {
  .calc-shell-v2 .calc-v2-print-actions {
    grid-template-columns: 1fr;
  }

  .calc-shell-v2 .calc-v2-print-actions__controls {
    justify-items: stretch;
  }

  .calc-shell-v2 .calc-v2-print-button {
    width: 100%;
  }
}

/* --------------------------------------------------------------------------
   Print Styles
   -------------------------------------------------------------------------- */

@media print {
  .calc-shell-v2 .calc-v2-header,
  .calc-shell-v2 .calc-v2-actions,
  .calc-shell-v2 .calc-v2-assumptions,
  .calc-shell-v2 .calc-v2-next-steps,
  .calc-shell-v2 .calc-v2-details,
  .calc-shell-v2 .calc-v2-copy-action,
  .calc-shell-v2 .site-header,
  .calc-shell-v2 .site-footer,
  .calc-shell-v2 .scope-strip,
  .calc-shell-v2 .tool-header,
  .calc-shell-v2 .related-tools-section,
  .calc-shell-v2 .tool-favorite-toggle-page,
  .calc-shell-v2 .calc-v2-context-rail,
  .calc-shell-v2 .calc-v2-print-actions,
  .calc-shell-v2 .calc-v2-post-result-tools,
  .calc-shell-v2 .emergency-desktop-browser,
  .calc-shell-v2 .dc-desktop-browser,
  .calc-shell-v2 .formulary-desktop-browser,
  .calc-shell-v2 .infusion-desktop-workpanel,
  .calc-shell-v2 .knowledge-graph-section,
  .calc-shell-v2 .navle-breadcrumbs,
  .calc-shell-v2 .dose-detail-section,
  .calc-v2-command-palette {
    display: none !important;
  }

  .calc-shell-v2 .calc-v2-print-sheet-header {
    display: block !important;
    margin: 0 0 12pt !important;
    padding: 0 0 8pt !important;
    border-bottom: 1pt solid #999 !important;
    color: #000 !important;
  }

  .calc-shell-v2 .calc-v2-print-sheet-kicker {
    display: block;
    margin-bottom: 3pt;
    color: #555 !important;
    font-size: 8pt !important;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }

  .calc-shell-v2 .calc-v2-print-sheet-title {
    display: block;
    margin: 0 0 3pt !important;
    color: #000 !important;
    font-size: 16pt !important;
    font-weight: 800 !important;
    line-height: 1.15 !important;
  }

  .calc-shell-v2 .calc-v2-print-sheet-header p {
    margin: 2pt 0 0 !important;
    color: #444 !important;
    font-size: 8.5pt !important;
    line-height: 1.3 !important;
  }

  .calc-shell-v2 .calc-v2-workspace {
    display: block;
    padding: 0;
  }

  .calc-shell-v2.calc-v2-printing-result .calc-v2-input-panel,
  .calc-shell-v2.calc-v2-printing-result .dose-input-panel,
  .calc-shell-v2.calc-v2-printing-result .calc-v2-result-panel,
  .calc-shell-v2.calc-v2-printing-result .dose-result-panel {
    margin-bottom: 10pt !important;
  }

  .calc-shell-v2 .calc-v2-result-panel {
    position: static !important;
    page-break-inside: avoid;
  }

  .calc-shell-v2 .calc-v2-result-primary,
  .calc-shell-v2 .calc-v2-mini-card {
    border: 1px solid #ccc;
    box-shadow: none;
    background: white;
    page-break-inside: avoid;
  }

  .calc-shell-v2 .calc-v2-result-primary {
    border-left: 4px solid var(--v2-accent);
  }

  .calc-shell-v2 .calc-v2-result-panel.calc-v2-status-normal .calc-v2-result-primary,
  .calc-shell-v2 .calc-v2-result-panel.calc-v2-status-mild .calc-v2-result-primary,
  .calc-shell-v2 .calc-v2-result-panel.calc-v2-status-elevated .calc-v2-result-primary,
  .calc-shell-v2 .calc-v2-result-panel.calc-v2-status-critical .calc-v2-result-primary {
    border-left-color: var(--status-color);
  }

  .calc-shell-v2 .calc-v2-result-value {
    color: #000;
  }

  .calc-shell-v2 .calc-v2-mini-card-value {
    color: var(--v2-accent);
  }
}


/* BCS guide */
.calc-v2-bcs-guide { margin: 16px 0; }
.calc-v2-bcs-guide-title { font-size: 0.85rem; font-weight: 600; color: #4b5563; margin-bottom: 8px; }
.calc-v2-bcs-guide-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.bcs-guide-item { display: flex; flex-direction: column; gap: 2px; padding: 10px 8px; border-radius: 8px; border: 1px solid #e5e7eb; background: #fff; cursor: pointer; text-align: left; transition: transform .08s ease, box-shadow .15s ease; }
.bcs-guide-item:hover { transform: translateY(-1px); box-shadow: 0 4px 10px rgba(0,0,0,0.06); }
.bcs-guide-item strong { font-size: 1.1rem; font-weight: 700; }
.bcs-guide-item span { font-size: 0.75rem; font-weight: 600; }
.bcs-guide-item small { font-size: 0.7rem; color: #6b7280; line-height: 1.3; }
.bcs-guide--under { border-left: 3px solid #f59e0b; }
.bcs-guide--ideal { border-left: 3px solid #10b981; }
.bcs-guide--over { border-left: 3px solid #f97316; }
.bcs-guide--obese { border-left: 3px solid #ef4444; }

/* MGCS options */
.calc-v2-mgcs-group { margin: 16px 0; }
.calc-v2-mgcs-group-title { font-size: 0.9rem; font-weight: 700; color: #1f2937; margin-bottom: 8px; }
.calc-v2-mgcs-options { display: flex; flex-direction: column; gap: 6px; }
.calc-v2-mgcs-option { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: 8px; border: 1px solid #e5e7eb; background: #fff; cursor: pointer; transition: background .1s ease; }
.calc-v2-mgcs-option:hover { background: #f9fafb; }
.calc-v2-mgcs-option input { margin-top: 2px; flex-shrink: 0; }
.calc-v2-mgcs-option span { font-size: 0.85rem; color: #374151; line-height: 1.4; }
.calc-v2-mgcs-option span strong { color: #111827; }

/* ============================================
   PRINT STYLES — Clinical Calculator Print-Friendly Mode
   ============================================ */
@media print {
  /* Hide non-essential chrome */
  .site-header,
  .site-footer,
  .calc-v2-sidebar,
  .calc-v2-nav,
  .calc-v2-actions,
  .calc-v2-btn--reset,
  .calc-v2-btn--copy,
  .calc-v2-disclaimer--screen,
  .theme-toggle,
  .nav-status-bar,
  #navStatusBar,
  .calc-v2-feedback { display: none !important; }

  /* Layout: full width, no sidebar */
  .calc-v2-layout { grid-template-columns: 1fr !important; }
  .calc-v2-main { max-width: 100% !important; padding: 0 !important; }

  /* Typography: optimize for paper */
  body { font-size: 11pt !important; line-height: 1.4 !important; color: #000 !important; background: #fff !important; }
  h1 { font-size: 16pt !important; margin-bottom: 8pt !important; }
  h2 { font-size: 13pt !important; margin-top: 12pt !important; margin-bottom: 6pt !important; }
  h3 { font-size: 11pt !important; }

  /* Inputs: show values clearly */
  input, select, textarea {
    border: 1px solid #999 !important;
    background: #fff !important;
    color: #000 !important;
    font-size: 11pt !important;
  }
  input::placeholder, textarea::placeholder { color: transparent !important; }

  /* Result cards: bordered boxes */
  .calc-v2-result-card,
  .calc-v2-result,
  .calc-v2-result-highlight {
    border: 1px solid #333 !important;
    background: #fff !important;
    color: #000 !important;
    box-shadow: none !important;
    page-break-inside: avoid;
  }

  /* Tables: clean lines */
  table { border-collapse: collapse !important; width: 100% !important; }
  th, td { border: 1px solid #999 !important; padding: 4pt 6pt !important; }
  th { background: #f0f0f0 !important; }

  /* Sections: avoid breaking inside */
  .calc-v2-section,
  .calc-v2-result-card,
  .calc-v2-reference-card { page-break-inside: avoid; }

  /* Print footer */
  /* Print footer — auto-injected via JS */
  .calc-v2-print-footer {
    display: block !important;
    margin-top: 20pt;
    padding-top: 8pt;
    border-top: 1pt solid #999;
    font-size: 9pt;
    color: #666;
  }

  body.calc-v2-print-density-compact {
    font-size: 8.6pt !important;
    line-height: 1.18 !important;
  }

  body.calc-v2-print-density-compact .calc-v2-workspace {
    display: flex !important;
    flex-direction: column !important;
    gap: 6pt !important;
  }

  body.calc-v2-print-density-compact .calc-v2-result-panel,
  body.calc-v2-print-density-compact .dose-result-panel {
    order: 1;
  }

  body.calc-v2-print-density-compact .calc-v2-input-panel,
  body.calc-v2-print-density-compact .dose-input-panel {
    order: 2;
    display: none !important;
  }

  body.calc-v2-print-density-compact .calc-v2-print-sheet-header {
    margin-bottom: 6pt !important;
    padding-bottom: 5pt !important;
  }

  body.calc-v2-print-density-compact .calc-v2-print-sheet-kicker {
    margin-bottom: 2pt !important;
    font-size: 7pt !important;
  }

  body.calc-v2-print-density-compact .calc-v2-print-sheet-title {
    margin-bottom: 2pt !important;
    font-size: 13pt !important;
    line-height: 1.1 !important;
  }

  body.calc-v2-print-density-compact .calc-v2-print-sheet-header p {
    margin-top: 1pt !important;
    font-size: 7.4pt !important;
    line-height: 1.18 !important;
  }

  body.calc-v2-print-density-compact .calc-v2-input-panel,
  body.calc-v2-print-density-compact .dose-input-panel,
  body.calc-v2-print-density-compact .calc-v2-result-panel,
  body.calc-v2-print-density-compact .dose-result-panel {
    margin-bottom: 4pt !important;
    padding: 5pt !important;
    border: 1pt solid #d1d5db !important;
    border-radius: 4pt !important;
    box-shadow: none !important;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  body.calc-v2-print-density-compact .calc-v2-input-panel form,
  body.calc-v2-print-density-compact .dose-input-panel form {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 4pt 6pt !important;
  }

  body.calc-v2-print-density-compact .calc-v2-field,
  body.calc-v2-print-density-compact .dose-field,
  body.calc-v2-print-density-compact .calc-v2-form-row,
  body.calc-v2-print-density-compact .dose-form-row {
    margin: 0 !important;
    min-width: 0 !important;
  }

  body.calc-v2-print-density-compact label,
  body.calc-v2-print-density-compact .calc-v2-field label,
  body.calc-v2-print-density-compact .dose-field label {
    margin-bottom: 1pt !important;
    font-size: 7.4pt !important;
    line-height: 1.15 !important;
  }

  body.calc-v2-print-density-compact input,
  body.calc-v2-print-density-compact select,
  body.calc-v2-print-density-compact textarea {
    min-height: 18pt !important;
    padding: 2pt 4pt !important;
    font-size: 8.2pt !important;
    line-height: 1.15 !important;
  }

  body.calc-v2-print-density-compact small,
  body.calc-v2-print-density-compact .calc-v2-help,
  body.calc-v2-print-density-compact .calc-v2-field-help,
  body.calc-v2-print-density-compact .dose-help {
    font-size: 6.8pt !important;
    line-height: 1.18 !important;
  }

  body.calc-v2-print-density-compact .calc-v2-result-primary,
  body.calc-v2-print-density-compact .calc-v2-result-card,
  body.calc-v2-print-density-compact .calc-v2-mini-card,
  body.calc-v2-print-density-compact .dose-result-card {
    margin: 0 0 3pt !important;
    padding: 4pt !important;
    border-radius: 3pt !important;
    box-shadow: none !important;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  body.calc-v2-print-density-compact .calc-v2-mini-card-label,
  body.calc-v2-print-density-compact .calc-v2-mini-card-note {
    font-size: 6.2pt !important;
    line-height: 1.12 !important;
  }

  body.calc-v2-print-density-compact .calc-v2-mini-card-note {
    margin-top: 1pt !important;
  }

  body.calc-v2-print-density-compact .calc-v2-escalation-banner {
    gap: 3pt !important;
    padding: 4pt 5pt !important;
    font-size: 7pt !important;
    line-height: 1.15 !important;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  body.calc-v2-print-density-compact .calc-v2-escalation-banner::before {
    width: 14pt !important;
    height: 14pt !important;
    font-size: 8pt !important;
  }

  body.calc-v2-print-density-compact .calc-v2-mini-grid,
  body.calc-v2-print-density-compact .calc-v2-result-grid,
  body.calc-v2-print-density-compact .calc-v2-results-grid,
  body.calc-v2-print-density-compact .dose-result-grid {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 4pt !important;
  }

  body.calc-v2-print-density-compact .calc-v2-result-value,
  body.calc-v2-print-density-compact .calc-v2-mini-card-value {
    font-size: 12pt !important;
    line-height: 1.1 !important;
  }

  body.calc-v2-print-density-compact table {
    font-size: 7.2pt !important;
  }

  body.calc-v2-print-density-compact th,
  body.calc-v2-print-density-compact td {
    padding: 2pt 3pt !important;
  }

  body.calc-v2-print-density-compact .calc-v2-result-panel details:not([open]),
  body.calc-v2-print-density-compact .dose-result-panel details:not([open]) {
    display: none !important;
  }

  body.calc-v2-print-density-compact .page > div[style*="background:#f8f9fa"] {
    display: none !important;
  }

  body.calc-v2-print-density-compact .calc-v2-print-footer {
    margin-top: 6pt !important;
    padding-top: 4pt !important;
    font-size: 7pt !important;
    line-height: 1.2 !important;
  }
}

/* Hide print footer on screen */
.calc-v2-print-footer { display: none; }

.discharge-print-sheet {
  display: none;
}

/* Print styles for clinical printouts */
@media print {
  .site-header, #cookie-banner, .nav-shell, .menu-toggle, .site-footer,
  .dose-action-bar, .calc-v2-action-bar, button[type="submit"],
  .tool-card-footer, .related-tools, .dose-reference-copy,
  .skip-link, .navle-header-auth, .nav-status {
    display: none !important;
  }
  body {
    background: #fff !important;
    color: #000 !important;
  }
  .calc-v2-workspace, .dose-workspace, .tool-main {
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  .calc-v2-result-panel, .dose-result-panel {
    border: 1px solid #ccc !important;
    box-shadow: none !important;
  }
  body.is-printing-discharge .site-header,
  body.is-printing-discharge .site-footer,
  body.is-printing-discharge #cookie-banner,
  body.is-printing-discharge .skip-link,
  body.is-printing-discharge .nav-status,
  body.is-printing-discharge .navle-breadcrumbs,
  body.is-printing-discharge .discharge-post-print-note,
  body.is-printing-discharge .related-tools-section,
  body.is-printing-discharge .dose-input-panel,
  body.is-printing-discharge .calc-v2-result-header .dose-btn,
  body.is-printing-discharge .dose-error-summary,
  body.is-printing-discharge .calc-v2-result-panel .calc-v2-copy-action,
  body.is-printing-discharge [class*='tool-footer'],
  body.is-printing-discharge .nav-status {
    display: none !important;
  }
  body.is-printing-discharge .calc-v2-result-panel {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: #fff !important;
    box-shadow: none !important;
  }
  body.is-printing-discharge main,
  body.is-printing-discharge .page,
  body.is-printing-discharge .dose-workspace,
  body.is-printing-discharge .calc-v2-workspace {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  body.is-printing-discharge .dose-workspace-section {
    display: block !important;
  }
  body.is-printing-discharge .calc-v2-result-panel > :not(.discharge-print-sheet) {
    display: none !important;
  }
  body.is-printing-discharge .discharge-print-sheet {
    display: block !important;
    color: #14212f !important;
    font-family: "Manrope", Arial, sans-serif !important;
    font-size: 8.4pt !important;
    line-height: 1.24 !important;
    page-break-after: avoid;
    page-break-inside: avoid;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
  body.is-printing-discharge .discharge-print-brand {
    align-items: stretch;
    background: #f3fbfa !important;
    border: 0.9pt solid #bedad6;
    border-left: 7pt solid #0f766e;
    border-radius: 7pt;
    display: flex;
    justify-content: space-between;
    margin: 0 0 6pt;
    overflow: hidden;
    padding: 0;
  }
  body.is-printing-discharge .discharge-print-brand-id {
    align-items: center;
    display: flex;
    gap: 8pt;
    padding: 8pt 10pt;
  }
  body.is-printing-discharge .discharge-print-mark {
    align-items: center;
    background: #0f766e !important;
    border-radius: 6pt;
    color: #fff !important;
    display: flex;
    font-size: 8.8pt !important;
    font-weight: 900 !important;
    height: 28pt;
    justify-content: center;
    line-height: 1 !important;
    width: 32pt;
  }
  body.is-printing-discharge .discharge-print-brand p,
  body.is-printing-discharge .discharge-print-generated span,
  body.is-printing-discharge .discharge-print-patient span,
  body.is-printing-discharge .discharge-print-summary span,
  body.is-printing-discharge .discharge-print-clinic span {
    color: #58676b !important;
    font-size: 6.8pt !important;
    font-weight: 800 !important;
    letter-spacing: 0 !important;
    margin: 0;
    text-transform: uppercase;
  }
  body.is-printing-discharge .discharge-print-brand p {
    color: #14212f !important;
    font-size: 15pt !important;
    font-weight: 900 !important;
    line-height: 0.95 !important;
    text-transform: none;
  }
  body.is-printing-discharge .discharge-print-brand-id span {
    color: #34464b !important;
    display: block;
    font-size: 7.6pt !important;
    font-weight: 700 !important;
    margin-top: 2pt;
  }
  body.is-printing-discharge .discharge-print-generated {
    background: #fff !important;
    border-left: 0.9pt solid #bedad6;
    min-width: 1.7in;
    padding: 8pt 10pt;
    text-align: right;
  }
  body.is-printing-discharge .discharge-print-generated strong,
  body.is-printing-discharge .discharge-print-generated em {
    color: #14212f !important;
    display: block;
    font-size: 8pt !important;
    font-style: normal;
    margin-top: 1pt;
  }
  body.is-printing-discharge .discharge-print-generated strong {
    font-size: 10.6pt !important;
    font-weight: 900 !important;
  }
  body.is-printing-discharge .discharge-print-generated em {
    color: #58676b !important;
    font-size: 7.4pt !important;
  }
  body.is-printing-discharge .discharge-print-clinic {
    display: grid;
    gap: 5pt;
    grid-template-columns: 1fr 1fr 1fr;
    margin-bottom: 6pt;
  }
  body.is-printing-discharge .discharge-print-clinic div {
    border: 0.8pt solid #d6dee0;
    border-radius: 5pt;
    padding: 4pt 5pt;
  }
  body.is-printing-discharge .discharge-print-clinic i {
    border-bottom: 0.8pt solid #9aa6aa;
    display: block;
    height: 11pt;
    margin-top: 2pt;
  }
  body.is-printing-discharge .discharge-print-patient,
  body.is-printing-discharge .discharge-print-summary {
    background: #fff !important;
    border: 0.8pt solid #c8d2d5;
    border-radius: 6pt;
    display: grid;
    gap: 0;
    margin-bottom: 6pt;
    overflow: hidden;
  }
  body.is-printing-discharge .discharge-print-patient {
    grid-template-columns: repeat(4, 1fr);
  }
  body.is-printing-discharge .discharge-print-summary {
    grid-template-columns: repeat(2, 1fr);
  }
  body.is-printing-discharge .discharge-print-patient div,
  body.is-printing-discharge .discharge-print-summary div {
    border-right: 0.8pt solid #d6dee0;
    padding: 5pt 6pt;
  }
  body.is-printing-discharge .discharge-print-patient div:last-child,
  body.is-printing-discharge .discharge-print-summary div:last-child {
    border-right: 0;
  }
  body.is-printing-discharge .discharge-print-patient strong,
  body.is-printing-discharge .discharge-print-summary strong {
    color: #14212f !important;
    display: block;
    font-size: 8.8pt !important;
    font-weight: 800 !important;
    margin-top: 1pt;
  }
  body.is-printing-discharge .discharge-print-grid {
    display: grid;
    gap: 5pt;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  body.is-printing-discharge .discharge-print-section {
    background: #fff !important;
    border: 0.8pt solid #c8d2d5;
    border-radius: 6pt;
    break-inside: avoid;
    overflow: hidden;
    padding: 0;
    page-break-inside: avoid;
  }
  body.is-printing-discharge .discharge-print-section--wide {
    grid-column: 1 / -1;
  }
  body.is-printing-discharge .discharge-print-section h2 {
    background: #eef8f6 !important;
    border-bottom: 0.8pt solid #d6e7e4;
    color: #0b5b55 !important;
    font-size: 7.3pt !important;
    font-weight: 800 !important;
    letter-spacing: 0 !important;
    line-height: 1 !important;
    margin: 0 !important;
    padding: 4pt 6pt !important;
    text-transform: uppercase;
  }
  body.is-printing-discharge .discharge-print-section p,
  body.is-printing-discharge .discharge-print-section ul {
    margin: 5pt 6pt !important;
  }
  body.is-printing-discharge .discharge-print-section ul {
    padding-left: 13pt !important;
  }
  body.is-printing-discharge .discharge-print-section li {
    margin: 0 0 1.8pt !important;
    padding-left: 0 !important;
  }
  body.is-printing-discharge .discharge-print-muted {
    color: #58676b !important;
  }
  body.is-printing-discharge .discharge-print-footer {
    border-top: 0.8pt solid #c8d2d5;
    color: #34464b !important;
    font-size: 7.3pt !important;
    margin-top: 5pt;
    padding-top: 4pt;
  }
  body.is-printing-discharge .discharge-print-footer strong {
    color: #14212f !important;
  }
  body.is-printing-discharge .discharge-print-sheet--dense {
    font-size: 7.8pt !important;
    line-height: 1.14 !important;
  }
  body.is-printing-discharge .discharge-print-sheet--dense .discharge-print-grid {
    gap: 3.5pt;
  }
  body.is-printing-discharge .discharge-print-sheet--dense .discharge-print-section {
    border-radius: 5pt;
  }
  body.is-printing-discharge .discharge-print-sheet--dense .discharge-print-section h2 {
    padding: 3pt 5pt !important;
  }
  body.is-printing-discharge .discharge-print-sheet--dense .discharge-print-section p,
  body.is-printing-discharge .discharge-print-sheet--dense .discharge-print-section ul {
    margin: 3pt 5pt !important;
  }
  body.is-printing-discharge .discharge-print-sheet--dense .discharge-print-section li {
    margin-bottom: 0.7pt !important;
  }
  a[href]:after {
    content: "" !important;
  }
}

/* ==========================================================================
   Mobile Responsiveness
   ========================================================================== */

@media (max-width: 767px) {
  .calc-shell-v2 .calc-v2-workspace {
    padding-left: 12px;
    padding-right: 12px;
    gap: 16px;
  }
  .calc-shell-v2 .calc-v2-input-panel,
  .calc-shell-v2 .calc-v2-result-panel {
    padding: 16px;
    border-radius: 10px;
  }
  .calc-shell-v2 .calc-v2-field input,
  .calc-shell-v2 .calc-v2-field select {
    min-height: 44px;
    font-size: 16px; /* Prevents iOS zoom on focus */
  }
  .calc-shell-v2 .calc-v2-result-primary {
    padding: 16px;
  }
  .calc-shell-v2 .calc-v2-mini-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

@media (max-width: 480px) {
  .calc-shell-v2 .calc-v2-workspace {
    padding-left: 8px;
    padding-right: 8px;
  }
  .calc-shell-v2 .calc-v2-tool-header h1 {
    font-size: 1.25rem;
  }
  .calc-shell-v2 .calc-v2-tool-header p {
    font-size: 0.85rem;
  }
  .calc-shell-v2 .calc-v2-field-row {
    gap: 12px;
  }
}

/* Dark mode removed per product decision — light theme only */
