/* IGIN ROI Calculator — styles. Brand tokens match igin-machine-gui / igin-dashboard-v2. */

:root {
  --brand: #25408f;
  --brand-50: #eef2fb;
  --brand-100: #dde4f6;
  --brand-200: #b9c8ee;
  --brand-600: #1f3677;
  --ink: #0a1628;
  --muted: #5b6b7d;
  --placeholder: #8593a5;
  --line: #d5dbe6;
  --line-soft: #e3e8f2;
  --surface: #f4f6fa;
  --card: #ffffff;
  --neg: #c2410c;
  --pos: #25408f;
  --radius: 8px;
  --radius-lg: 12px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", "Noto Sans Hebrew", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.4;
  color: var(--ink);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p { margin: 0; }
h2 { font-size: 16px; font-weight: 700; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
h3 { font-size: 14px; font-weight: 600; }
a { color: var(--brand); }
button { font: inherit; color: inherit; cursor: pointer; }
input { font: inherit; color: inherit; }
input::placeholder { color: var(--placeholder); }
strong { font-weight: 600; }
em { font-style: normal; font-weight: 400; color: var(--muted); }

.num { font-variant-numeric: tabular-nums; }
.lbl { display: block; font-size: 13px; font-weight: 600; letter-spacing: 0.02em; text-transform: uppercase; color: var(--muted); }
.lbl em { text-transform: none; letter-spacing: 0; }
.lbl .val { float: right; color: var(--ink); text-transform: none; letter-spacing: 0; }
.hint { font-size: 13px; color: var(--muted); line-height: 1.4; font-weight: 400; text-transform: none; letter-spacing: 0; }
.ic { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }

/* ---- Cards & controls ------------------------------------------------- */
.card { background: var(--card); border: 1px solid var(--line-soft); border-radius: var(--radius-lg); padding: 20px; }
.group { display: flex; flex-direction: column; gap: 8px; }
.group.grow { flex: 1.4; }
.two { display: flex; gap: 12px; }
.two > .group { flex: 1; }
.three { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }

.field {
  display: flex; align-items: center; height: 44px; width: 100%; padding: 0 14px;
  border-radius: var(--radius); border: 1px solid var(--line); background: var(--card);
  font-size: 16px; outline: none;
}
.field:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-100); }
.field-right { text-align: right; }
.field-center { text-align: center; }
.field-big { font-size: 18px; font-weight: 600; }
.field-sm { height: 34px; font-size: 14px; width: auto; }
.field-static { color: var(--ink); white-space: nowrap; }
.field-wrap { position: relative; display: flex; align-items: center; }
.field-wrap .field { padding-right: 64px; }
.field-wrap .affix { position: absolute; right: 12px; font-size: 13px; color: var(--muted); pointer-events: none; }
.field-wrap .affix:first-child { left: 12px; right: auto; font-size: 16px; color: var(--ink); }
.field-wrap .affix:first-child + .field { padding-left: 28px; }
.tag { background: var(--brand-50); color: var(--brand-600); padding: 2px 6px; border-radius: 4px; font-weight: 600; font-size: 11px; text-transform: uppercase; }
.tag.entered { background: #e8f5ec; color: #166534; }

.chips-row { display: flex; gap: 8px; }
.chips { display: flex; gap: 8px; }
.chips-row .field { flex: 1; min-width: 72px; }
.chip {
  display: flex; align-items: center; justify-content: center; height: 44px; min-width: 44px; padding: 0 16px;
  border-radius: var(--radius); border: 1px solid var(--line); background: var(--card);
  font-size: 16px; font-weight: 500; color: var(--ink);
}
.chip:hover { border-color: var(--brand-200); }
.chip[aria-pressed="true"], .chip.on { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.chip-sq { padding: 0; width: 44px; }
.chip:focus-visible, .btn:focus-visible, .model-card:focus-visible, .link:focus-visible { outline: 3px solid var(--brand-100); outline-offset: 1px; }

.seg { display: flex; gap: 8px; }
.seg .chip { flex: 1; padding: 0 8px; }
.seg .chip:disabled { opacity: 0.45; cursor: default; }

.stepper { display: flex; gap: 8px; align-items: center; }
.stepper .field { flex: 1; }

.model-cards { display: flex; gap: 8px; }
.model-card {
  flex: 1; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; text-align: left;
  padding: 12px 14px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--card);
  min-height: 44px;
}
.model-card strong { font-size: 15px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.model-card[aria-checked="true"] { border: 2px solid var(--brand); background: var(--brand-50); padding: 11px 13px; }
.badge { font-size: 11px; font-weight: 600; color: var(--brand-600); background: var(--brand-100); padding: 2px 6px; border-radius: 4px; text-transform: uppercase; letter-spacing: 0.02em; }

.radios { display: flex; flex-direction: column; gap: 6px; }
.radios label { display: flex; align-items: center; gap: 10px; min-height: 36px; font-size: 15px; cursor: pointer; }
.radios input { width: 18px; height: 18px; accent-color: var(--brand); margin: 0; }

.range-sm { width: 100%; accent-color: var(--brand); height: 28px; margin: 0; }

.locked { display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; margin: 0; padding: 12px 14px; border-radius: var(--radius); background: var(--surface); font-size: 14px; }
.locked dt { color: var(--muted); }
.locked dd { margin: 0; font-weight: 600; text-align: right; }
.locked .note { grid-column: 1 / -1; font-size: 13px; color: var(--muted); }

.btn {
  display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 18px;
  border-radius: var(--radius); border: 1px solid var(--line); background: var(--card);
  font-size: 14px; font-weight: 600; color: var(--ink); white-space: nowrap;
}
.btn:hover { border-color: var(--brand-200); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-600); border-color: var(--brand-600); }
.link { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 8px 4px; font-size: 13px; font-weight: 500; color: var(--brand); }

/* ---- Details (assumptions / sources) ---------------------------------- */
.details { padding: 0; }
.details summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; cursor: pointer; }
.details summary::-webkit-details-marker { display: none; }
.summary-text { display: flex; flex-direction: column; gap: 4px; }
.summary-text strong { font-size: 16px; font-weight: 700; }
.chev { width: 20px; height: 20px; color: var(--muted); transition: transform 0.15s; }
.details[open] .chev { transform: rotate(180deg); }
.details-body { display: flex; flex-direction: column; gap: 18px; padding: 0 20px 20px; border-top: 1px solid var(--line-soft); padding-top: 18px; }

.rail-foot { display: flex; justify-content: space-between; align-items: center; padding: 0 4px; gap: 8px; }
.rail-foot .fail { color: var(--neg); font-weight: 600; }

/* ---- Layout ----------------------------------------------------------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  min-height: 72px; padding: 10px 32px; background: var(--card); border-bottom: 1px solid var(--line-soft);
}
.brand { display: flex; align-items: center; gap: 16px; }
.logo { height: 52px; width: auto; display: block; }
.topbar h1 { font-size: 18px; font-weight: 700; line-height: 1.1; }
.topbar .sub { font-size: 12px; color: var(--muted); }
.topbar-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.topbar-actions #hospitalName { width: 280px; }

.layout { display: grid; grid-template-columns: 400px minmax(0, 1fr); gap: 24px; padding: 24px 32px 40px; max-width: 1640px; margin: 0 auto; }
.rail { display: flex; flex-direction: column; gap: 16px; }
.rail .card { display: flex; flex-direction: column; gap: 18px; }
.results { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

/* ---- Results ----------------------------------------------------------- */
.hero { padding: 28px 32px; display: flex; flex-direction: column; gap: 10px; }
.hero-line { font-size: 30px; font-weight: 600; line-height: 1.25; }
.hero-num { font-size: 72px; font-weight: 700; color: var(--brand); line-height: 0.9; vertical-align: -6px; padding: 0 6px; }
.hero-sub { font-size: 17px; color: var(--muted); }

.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.kpi { display: flex; flex-direction: column; gap: 6px; padding: 20px 24px; }
.kpi-val { font-size: 40px; font-weight: 600; line-height: 1.1; }

.whatif { display: flex; gap: 32px; padding: 24px 28px; }
.whatif-left { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.whatif-chart { width: 440px; flex: none; display: flex; flex-direction: column; gap: 8px; }
.whatif-chart svg { width: 100%; height: auto; display: block; overflow: visible; }

.slider { position: relative; padding: 34px 0 22px; --thumb: 28px; }
.slider input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 8px; margin: 0; border-radius: 4px; background: linear-gradient(to right, var(--brand) 0 var(--fill, 0%), var(--brand-100) var(--fill, 0%) 100%); outline: none; }
.slider input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: var(--thumb); height: var(--thumb); border-radius: 50%; background: #fff; border: 3px solid var(--brand); box-shadow: 0 1px 3px rgba(10,22,40,0.25); cursor: grab; }
.slider input[type="range"]::-moz-range-thumb { width: var(--thumb); height: var(--thumb); border-radius: 50%; background: #fff; border: 3px solid var(--brand); box-shadow: 0 1px 3px rgba(10,22,40,0.25); cursor: grab; }
.slider input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px var(--brand-100); }
.slider-marker { position: absolute; top: 28px; width: 2px; height: 20px; background: var(--muted); transform: translateX(-1px); }
.slider-marker span { position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%); font-size: 12px; color: var(--muted); white-space: nowrap; }
.slider-marker.hidden { display: none; }
.ticks { position: absolute; left: 0; right: 0; bottom: 0; height: 16px; font-size: 12px; color: var(--muted); }
.ticks span { position: absolute; transform: translateX(-50%); }

.readout { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.readout strong { font-size: 28px; font-weight: 600; color: var(--brand); }
.readout span { font-size: 16px; color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.stats > div { display: flex; flex-direction: column; gap: 2px; }
.stats strong { font-size: 22px; font-weight: 600; white-space: nowrap; }
.stats .lbl { font-size: 12px; }

.bottom { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.cost { display: flex; flex-direction: column; gap: 10px; padding: 20px 24px; }
.cost-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.cost-table td { padding: 10px 0; border-bottom: 1px solid #eef1f6; vertical-align: baseline; }
.cost-table td.num { text-align: right; white-space: nowrap; padding-left: 16px; }
.cost-table tr.sub td:first-child { padding-left: 18px; color: var(--muted); }
.cost-table tr.sub td.num { color: var(--muted); }
.cost-table tr.subtotal td { font-weight: 600; }
.cost-table tr.total td { border-bottom: 0; font-weight: 700; }
.cost-table .hint { display: inline; }

.side { display: flex; flex-direction: column; gap: 16px; }
.upside { display: flex; flex-direction: column; gap: 8px; padding: 20px 24px; background: #f8f9fc; border-style: dashed; }
.upside h2 { justify-content: flex-start; }
.upside h2 .ic { color: var(--muted); }
.upside p { font-size: 15px; color: var(--muted); line-height: 1.5; }
.upside p strong { color: var(--ink); }
.disclaimer { font-size: 13px; color: var(--muted); line-height: 1.5; padding: 0 4px; }
.sources { font-size: 13px; color: var(--muted); padding: 0 4px; }
.sources summary { cursor: pointer; font-weight: 600; color: var(--brand); }
.sources ol { margin: 8px 0 0; padding-left: 20px; line-height: 1.5; }

/* ---- Toast -------------------------------------------------------------- */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; padding: 10px 16px; border-radius: var(--radius); background: var(--ink); color: #fff; font-size: 14px; font-weight: 500; transition: opacity 0.15s, transform 0.15s; z-index: 10; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---- Responsive --------------------------------------------------------- */
@media (max-width: 1280px) {
  .layout { grid-template-columns: 360px minmax(0, 1fr); }
  .whatif { flex-direction: column; }
  .whatif-chart { width: 100%; max-width: 520px; }
  .hero-line { font-size: 26px; }
  .hero-num { font-size: 60px; }
  .kpi-val { font-size: 32px; }
}
@media (max-width: 980px) {
  .topbar { padding: 10px 16px; }
  .layout { grid-template-columns: 1fr; padding: 16px 16px 32px; }
  .results { order: -1; }
  .kpis, .bottom { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topbar-actions #hospitalName { width: 100%; }
}
@media (max-width: 560px) {
  .hero { padding: 20px; }
  .hero-line { font-size: 22px; }
  .hero-num { font-size: 48px; }
  .two, .chips-row { flex-wrap: wrap; }
  .three { grid-template-columns: 1fr; }
  .model-cards { flex-direction: column; }
}

/* ---- Print: only the leave-behind ------------------------------------- */
.print-only { display: none; }
@media print {
  @page { size: auto; margin: 0.5in; }
  html, body { width: 100%; height: auto; margin: 0; padding: 0; overflow: hidden !important; background: #fff; }
  body { display: block; }
  .leave-behind * { max-width: 100%; }
  .leave-behind img { break-inside: avoid; }
  body { font-size: 12pt; }
  /* Only the leave-behind prints: everything else is removed from layout so nothing can spill onto a second page. */
  body > *:not(.leave-behind) { display: none !important; }
  .print-only, .leave-behind.print-only { display: block !important; }
  .leave-behind { color: var(--ink); width: 100%; max-width: none; margin: 0; overflow: hidden; break-after: avoid; page-break-after: avoid; break-before: avoid; page-break-before: avoid; }
  .leave-behind table { width: 100%; table-layout: fixed; }
  .lb-sens td, .lb-sens th { white-space: normal; overflow-wrap: anywhere; }
}
.leave-behind { display: none; max-width: 7.5in; margin: 0 auto; }
.leave-behind .lbl { font-size: 10pt; }
.lb-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; padding-bottom: 8pt; border-bottom: 2px solid var(--brand); }
.lb-title { font-size: 18pt; font-weight: 700; line-height: 1.15; margin-top: 3pt; }
.lb-meta { font-size: 10.5pt; color: var(--muted); margin-top: 2pt; }
.lb-logo { height: 0.7in; width: auto; }
.lb-hero { font-size: 16pt; font-weight: 600; line-height: 1.25; margin-top: 10pt; }
.lb-hero strong { color: var(--brand); font-weight: 700; }
.lb-hero-sub { font-size: 11pt; color: var(--muted); margin-top: 3pt; }
.lb-figures { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10pt; margin-top: 10pt; }
.lb-figures > div { display: flex; flex-direction: column; gap: 1pt; padding: 7pt 10pt; border: 1px solid var(--line-soft); border-radius: 6pt; }
.lb-figures strong { font-size: 17pt; font-weight: 600; }
.lb-figures span:last-child { font-size: 9pt; color: var(--muted); }
.lb-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18pt; margin-top: 10pt; }
.lb-two .lb-table { table-layout: fixed; } /* column widths come from each table's <colgroup> */
.lb-table { width: 100%; border-collapse: collapse; font-size: 10pt; table-layout: auto; }
.lb-table th { text-align: left; font-size: 8.5pt; font-weight: 600; text-transform: uppercase; letter-spacing: 0.02em; color: var(--muted); padding: 3pt 0; border-bottom: 1px solid var(--ink); }
.lb-table th.num, .lb-table td.num { text-align: right; }
.lb-table td.num { padding-left: 8pt; }
.lb-table td { padding: 2pt 0; border-bottom: 1px solid var(--line-soft); vertical-align: baseline; }
.lb-table tr.total td, .lb-table tr.current td { font-weight: 700; }
.lb-table tr.sub td:first-child { padding-left: 10pt; color: var(--muted); }
.lb-sens { margin-top: 10pt; }
.lb-sens td.num, .lb-sens th.num { white-space: nowrap; }
.lb-upside { margin-top: 10pt; padding: 6pt 10pt; border: 1px dashed var(--brand-200); border-radius: 6pt; font-size: 10pt; color: var(--muted); line-height: 1.4; }
.lb-upside strong { color: var(--ink); }
.lb-foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 20pt; margin-top: 10pt; padding-top: 6pt; border-top: 1px solid var(--line-soft); }
.lb-disclaimer { font-size: 8.5pt; color: var(--muted); line-height: 1.45; max-width: 5in; }
.lb-contact { font-size: 9.5pt; text-align: right; line-height: 1.45; white-space: pre-line; }

/* ---- Range sliders used as inputs (beds per machine, prices, rates) ---- */
.range-sm { -webkit-appearance: none; appearance: none; width: 100%; height: 28px; margin: 0; background: transparent; }
.range-sm::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: var(--brand-100); }
.range-sm::-moz-range-track { height: 6px; border-radius: 3px; background: var(--brand-100); }
.range-sm::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; margin-top: -9px; border-radius: 50%; background: #fff; border: 3px solid var(--brand); box-shadow: 0 1px 3px rgba(10,22,40,0.25); cursor: grab; }
.range-sm::-moz-range-thumb { width: 24px; height: 24px; border-radius: 50%; background: #fff; border: 3px solid var(--brand); box-shadow: 0 1px 3px rgba(10,22,40,0.25); cursor: grab; }
.range-sm:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px var(--brand-100); }
.lbl .val { font-size: 15px; font-weight: 600; }
.sources-link { font-size: 14px; padding: 0 4px; }
.sources-link a { font-weight: 600; text-decoration: none; }
.sources-link a:hover { text-decoration: underline; }
a.btn { text-decoration: none; }

/* ---- Sources page ---- */
.src-layout { display: flex; flex-direction: column; gap: 16px; padding: 24px 32px 48px; max-width: 1400px; margin: 0 auto; }
.src-intro p { font-size: 16px; line-height: 1.55; }
.src-intro p + p { margin-top: 10px; }
.src-section h2, .src-formulas h2, .src-refs h2 { margin-bottom: 12px; }
.table-wrap { overflow-x: auto; }
.src-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.src-table th { text-align: left; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.02em; color: var(--muted); padding: 8px 10px 8px 0; border-bottom: 1px solid var(--ink); }
.src-table td { padding: 10px 10px 10px 0; border-bottom: 1px solid var(--line-soft); vertical-align: top; line-height: 1.45; }
.src-table tr:last-child td { border-bottom: 0; }
.src-p { font-weight: 600; min-width: 160px; }
.src-v { min-width: 120px; white-space: nowrap; }
.src-r { min-width: 130px; color: var(--muted); }
.src-r:empty::before { content: "—"; }
.src-e { color: var(--ink); }
.src-e .ref { font-size: 12px; color: var(--brand); text-decoration: none; font-weight: 600; }
.grade { display: inline-block; min-width: 22px; padding: 2px 6px; border-radius: 4px; font-size: 12px; font-weight: 700; text-align: center; color: #fff; background: var(--muted); }
.grade.A { background: #166534; }
.grade.B { background: var(--brand); }
.grade.C { background: #b45309; }
.grade.D { background: var(--muted); }
.formulas { margin: 0; padding-left: 22px; font-size: 15px; line-height: 1.6; display: flex; flex-direction: column; gap: 6px; }
.src-refs ol { margin: 0; padding-left: 22px; font-size: 14px; line-height: 1.55; display: flex; flex-direction: column; gap: 6px; }
.src-refs li:target { background: var(--brand-50); }
.src-foot { text-align: center; }
code { font-family: "SF Mono", Menlo, Consolas, monospace; font-size: 13px; background: var(--surface); padding: 1px 5px; border-radius: 4px; }
@media (max-width: 980px) { .src-layout { padding: 16px; } .src-table { font-size: 13px; } }
@media print { .page-sources .topbar { display: flex !important; } .page-sources .src-layout { display: flex !important; } }

.grade { white-space: nowrap; }
.src-sec-intro { margin: -6px 0 10px; }

/* Selected state for radio-style chips (region, cartridge price) and bed ticks */
.chip[aria-checked="true"] { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.chip[aria-checked="true"]:disabled { opacity: 0.45; }
.ticks-inline { position: relative; height: 16px; font-size: 12px; color: var(--muted); margin: -4px 12px 0; }
.ticks-inline span { position: absolute; transform: translateX(-50%); }
.radios label span strong { margin-left: 6px; color: var(--muted); font-weight: 600; }
.radios label span em { margin-left: 6px; font-style: normal; font-size: 13px; color: var(--muted); }

/* Cost statement sections */
.cost-table tr.section td { padding: 14px 0 6px; border-bottom: 1px solid var(--ink); font-size: 12px; font-weight: 600; letter-spacing: 0.02em; text-transform: uppercase; color: var(--muted); }
.cost-table tr.section:first-child td { padding-top: 0; }
.cost-table tr.total td { padding-top: 12px; font-size: 16px; }
.cost-table tr.total td.num.neg { color: var(--neg); }
.lb-table tr.section td { padding-top: 6pt; font-size: 8.5pt; font-weight: 600; text-transform: uppercase; letter-spacing: 0.02em; color: var(--muted); border-bottom: 1px solid var(--ink); }

.lb-table tr.section td { padding-top: 4pt; padding-bottom: 2pt; }
.lb-figures { margin-top: 8pt; }
.lb-two { margin-top: 8pt; }

/* Sensitivity table (replaces the chart) */
.sens-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.sens-table th { text-align: right; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.02em; color: var(--muted); padding: 6px 0 8px 8px; border-bottom: 1px solid var(--ink); }
.sens-table th:first-child, .sens-table td:first-child { text-align: left; padding-left: 0; }
.sens-table td { text-align: right; padding: 9px 0 9px 8px; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
.sens-table tr:last-child td { border-bottom: 0; }
.sens-table tr.current td { font-weight: 700; background: var(--brand-50); }
.sens-table tr.current td:first-child { border-left: 3px solid var(--brand); padding-left: 8px; }
.sens-table tr.loss td.net { color: var(--neg); }
.sens-table tr:not(.loss) td.net { color: var(--brand-600); }

/* ---- Print: the evidence page ------------------------------------------- */
@media print {
  .page-sources { font-size: 10pt; }
  .page-sources .topbar { display: flex !important; padding: 0 0 8pt; border-bottom: 2px solid var(--brand); min-height: 0; }
  .page-sources .topbar-actions { display: none !important; }
  .page-sources .logo { height: 0.6in; }
  .page-sources .topbar h1 { font-size: 15pt; }
  .page-sources .topbar .sub { font-size: 9.5pt; }
  .page-sources .src-layout { display: block !important; padding: 0; max-width: none; }
  .page-sources .card { border: 0; border-radius: 0; padding: 0; margin: 0 0 12pt; box-shadow: none; background: transparent; }
  .page-sources .src-intro { font-size: 10pt; }
  .page-sources .src-intro p { font-size: 10pt; line-height: 1.4; }
  .page-sources .src-intro h2, .page-sources .src-section h2, .page-sources .src-formulas h2, .page-sources .src-refs h2 { font-size: 12pt; margin: 0 0 4pt; padding-top: 6pt; border-top: 1px solid var(--ink); break-after: avoid; }
  .page-sources .src-sec-intro { margin: 0 0 4pt; font-size: 9pt; }
  .page-sources .kinds { margin: 4pt 0; padding-left: 14pt; font-size: 9.5pt; }
  .page-sources .table-wrap { overflow: visible; }
  /* Each parameter becomes a compact stacked entry instead of a five-column table row */
  .page-sources .src-table, .page-sources .src-table tbody, .page-sources .src-table tr, .page-sources .src-table td { display: block; width: auto; padding: 0; border: 0; }
  .page-sources .src-table thead { display: none; }
  .page-sources .src-table tr { padding: 5pt 0; border-bottom: 1px solid var(--line-soft); break-inside: avoid; page-break-inside: avoid; }
  .page-sources .src-table tr:last-child { border-bottom: 0; }
  .page-sources .src-table .src-p, .page-sources .src-table .src-v, .page-sources .src-table .src-r, .page-sources .src-table td:nth-child(4) { display: inline; min-width: 0; font-size: 10pt; }
  .page-sources .src-table .src-p { font-weight: 700; }
  .page-sources .src-table .src-p::after { content: " — "; font-weight: 400; color: var(--muted); }
  .page-sources .src-table .src-v { font-weight: 600; white-space: normal; }
  .page-sources .src-table .src-r { color: var(--muted); }
  .page-sources .src-table .src-r::before { content: " · "; }
  .page-sources .src-table .src-r:empty::before, .page-sources .src-table .src-r[data-empty]::before { content: ""; }
  .page-sources .src-table td:nth-child(4)::before { content: " · "; color: var(--muted); }
  .page-sources .src-table .src-e { display: block; margin-top: 2pt; font-size: 9.5pt; line-height: 1.4; color: var(--ink); }
  .page-sources .grade { padding: 0 4pt; font-size: 8pt; vertical-align: 1pt; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .page-sources .src-e .ref { font-size: 8.5pt; }
  .page-sources .formulas { font-size: 9.5pt; line-height: 1.45; gap: 2pt; padding-left: 16pt; }
  .page-sources .src-refs { break-before: page; page-break-before: always; }
  .page-sources .src-refs ol { font-size: 9pt; line-height: 1.4; gap: 3pt; padding-left: 16pt; }
  .page-sources .src-refs a { color: var(--ink); text-decoration: none; }
  .page-sources .src-refs a::after { content: " " attr(href); display: block; color: var(--muted); font-size: 8pt; word-break: break-all; }
  .page-sources .src-refs li:target { background: transparent; }
  .page-sources .src-foot { font-size: 8.5pt; margin-top: 8pt; }
}

.btn-sm { height: 30px; padding: 0 12px; font-size: 13px; }

.preventable-note { padding: 8px 12px; border-radius: var(--radius); background: var(--brand-50); color: var(--muted); }
.preventable-note strong { color: var(--ink); }
