:root {
  --bg: #f5f6f8;
  --panel: #ffffff;
  --border: #dde1e6;
  --text: #1c2126;
  --muted: #667085;
  --accent: #2563eb;
  --accent-soft: #dbeafe;
  --warn: #b45309;
  --warn-bg: #fef3c7;
  --teal: #0f766e;
  --teal-soft: #ccfbf1;
  --violet: #6d28d9;
  --violet-soft: #ede9fe;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}

header h1 { font-size: 18px; margin: 0; }

nav { display: flex; gap: 8px; }

.tab-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 14px;
  cursor: pointer;
  font-size: 14px;
  color: var(--muted);
}
.tab-btn.active { background: var(--accent); color: white; border-color: var(--accent); }

main { padding: 20px 24px 60px; max-width: 1300px; margin: 0 auto; }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

.card-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
}
.card h3 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; color: var(--muted); letter-spacing: .04em;}
.card svg { width: 100%; height: 70px; }

.split {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 16px;
  align-items: start;
}
@media (max-width: 900px) { .split { grid-template-columns: 1fr; } }

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.panel-head h2 { font-size: 15px; margin: 0; }
.panel-head input {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 9px;
  font-size: 13px;
  min-width: 160px;
}

.count-badge {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}

.scroll-hint { margin: 0 0 6px; }

.table-wrap {
  max-height: 520px;
  overflow-y: scroll;
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: inset 0 -8px 8px -8px rgba(0,0,0,0.15);
}

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { position: sticky; top: 0; background: var(--panel); cursor: pointer; color: var(--muted); font-weight: 600; }
tbody tr { cursor: pointer; }
tbody tr:hover { background: var(--accent-soft); }
tbody tr.selected { background: var(--accent-soft); font-weight: 600; }

.tier-badge {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}
.tier-A { background: #dcfce7; color: #166534; }
.tier-B { background: #fee2e2; color: #991b1b; }

#trajectory-chart { width: 100%; height: 320px; background: #fafbfc; border: 1px solid var(--border); border-radius: 6px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 6px; }

.flag {
  background: var(--warn-bg);
  color: var(--warn);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 12px;
  margin-bottom: 10px;
}

.meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 14px;
  font-size: 13px;
  margin-bottom: 14px;
}
.meta-grid div span.k { color: var(--muted); margin-right: 4px; }

.viewer { text-align: center; }

.plotly-chart { width: 100%; height: 340px; }

.view-buttons, .window-buttons {
  display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-bottom: 10px;
}
.window-buttons { margin-top: 10px; margin-bottom: 0; }

.view-btn, .win-btn, .region-cubes-btn {
  border: 1px solid var(--border);
  background: white;
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 12px;
  cursor: pointer;
}
.view-btn.active, .win-btn.active { background: var(--accent); color: white; border-color: var(--accent); }
.region-cubes-btn {
  color: var(--violet);
  border-color: #c4b5fd;
  background: #f5f3ff;
  font-weight: 600;
}
.region-cubes-btn:hover:not(:disabled), .region-cubes-btn.active {
  color: white;
  border-color: var(--violet);
  background: var(--violet);
}
.region-cubes-btn:disabled { color: var(--muted); border-color: var(--border); background: #f8fafc; cursor: not-allowed; }

.nv-canvas-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: black;
  border-radius: 6px;
  overflow: hidden;
}
.nv-canvas-wrap canvas { width: 100%; height: 100%; display: block; }
.nv-status {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #cbd5e1;
  font-size: 13px;
  background: rgba(0,0,0,0.35);
  pointer-events: none;
}
.nv-status[hidden] { display: none; }

.region-cubes-legend {
  margin-top: 10px;
  padding: 10px 12px;
  color: #334155;
  background: #fafafa;
  border: 1px solid var(--border);
  border-left: 3px solid var(--violet);
  border-radius: 7px;
  text-align: left;
}
.region-cubes-legend[hidden] { display: none; }
.region-legend-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.region-legend-title strong { font-size: 12px; }
.region-legend-title span { color: var(--muted); font-size: 10px; }
.region-legend-items { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.region-legend-items span { display: flex; align-items: center; gap: 5px; font-size: 10px; font-weight: 700; }
.region-legend-items i { width: 9px; height: 9px; border-radius: 2px; }
.region-legend-items .region-rul { background: #ff2d2d; }
.region-legend-items .region-rml { background: #ff7d00; }
.region-legend-items .region-rll { background: #ffd700; }
.region-legend-items .region-lul { background: #00e6a5; }
.region-legend-items .region-lll { background: #2d7dff; }
.region-cubes-legend p { margin: 8px 0 0; color: var(--muted); font-size: 10px; line-height: 1.45; }

/* Astra generated-report panel (CT tab) */
.astra-panel {
  margin: 14px 0;
  padding: 12px 14px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.astra-panel .panel-head { margin-bottom: 8px; }
.astra-panel h3 { margin: 0; font-size: 14px; }
.astra-badge {
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  vertical-align: middle;
}
.astra-btn {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: white;
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 12px;
  cursor: pointer;
}
.astra-btn:disabled {
  background: white;
  color: var(--muted);
  border-color: var(--border);
  cursor: not-allowed;
}
.astra-status { font-size: 12px; color: var(--muted); }
.astra-status.ok { color: #15803d; }
.astra-status.err { color: var(--warn); }
.astra-status[hidden] { display: none; }
.astra-report {
  margin: 10px 0 0;
  padding: 10px 12px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: inherit;
  max-height: 260px;
  overflow-y: auto;
}
.astra-report[hidden] { display: none; }
.astra-disclaimer {
  margin-top: 10px;
  padding: 8px 10px;
  background: var(--warn-bg);
  border-radius: 6px;
  color: #6b4a08;
}

/* Model architecture tab */
.model-tab {
  --lobe-rul: #ef6a6a;
  --lobe-rml: #f59e62;
  --lobe-rll: #eab84f;
  --lobe-lul: #4bb4a4;
  --lobe-lll: #4f86d9;
}

.model-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 36px;
  align-items: center;
  margin-bottom: 18px;
  padding: 26px 30px;
  overflow: hidden;
  color: #f8fafc;
  border-radius: 14px;
  background:
    radial-gradient(circle at 90% 10%, rgba(45, 212, 191, .22), transparent 34%),
    linear-gradient(125deg, #172554 0%, #1e3a5f 48%, #134e4a 100%);
  box-shadow: 0 12px 34px rgba(15, 23, 42, .13);
}
.model-hero::after {
  content: "";
  position: absolute;
  right: 27%;
  bottom: -75px;
  width: 180px;
  height: 180px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 50%;
}
.model-hero h2 { margin: 2px 0 10px; font-size: 26px; letter-spacing: -.02em; }
.model-lede { max-width: 760px; margin: 0; color: #dbeafe; font-size: 14px; line-height: 1.65; }
.eyebrow {
  margin: 0 0 5px;
  color: var(--teal);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.model-hero .eyebrow { color: #5eead4; }
.model-facts { display: flex; position: relative; z-index: 1; }
.model-facts div {
  display: flex;
  flex-direction: column;
  min-width: 92px;
  padding: 8px 15px;
  border-left: 1px solid rgba(255,255,255,.18);
}
.model-facts div:first-child { border-left: 0; }
.model-facts strong { font-size: 23px; color: white; }
.model-facts span { margin-top: 2px; color: #bfdbfe; font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }

.model-overview-grid {
  display: grid;
  grid-template-columns: .9fr 1.1fr;
  gap: 16px;
  margin-bottom: 16px;
}
.model-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  box-shadow: 0 5px 18px rgba(15, 23, 42, .04);
}
.model-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 14px;
}
.model-card-head h3 { margin: 0; font-size: 17px; letter-spacing: -.01em; }
.diagram-badge {
  flex: none;
  padding: 4px 8px;
  color: var(--muted);
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.diagram-badge.code-backed { color: #166534; background: #f0fdf4; border-color: #bbf7d0; }
.diagram-badge.experiment { color: #6d28d9; background: var(--violet-soft); border-color: #ddd6fe; }

.lung-visual { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(135px, .7fr); gap: 8px; align-items: center; }
.lung-map { width: 100%; max-height: 290px; }
.airway {
  fill: none;
  stroke: #94a3b8;
  stroke-width: 9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.lung-outline { fill: #f8fafc; stroke: #cbd5e1; stroke-width: 2; }
.lobe-shape {
  cursor: pointer;
  filter: url(#lobe-shadow);
  stroke: white;
  stroke-width: 3;
  opacity: .72;
  transform-origin: center;
  transition: opacity .15s, transform .15s, filter .15s;
}
.lobe-shape:hover, .lobe-shape.active { opacity: 1; transform: scale(1.018); }
.lobe-shape[data-lobe="rul"] { fill: var(--lobe-rul); }
.lobe-shape[data-lobe="rml"] { fill: var(--lobe-rml); }
.lobe-shape[data-lobe="rll"] { fill: var(--lobe-rll); }
.lobe-shape[data-lobe="lul"] { fill: var(--lobe-lul); }
.lobe-shape[data-lobe="lll"] { fill: var(--lobe-lll); }
.lobe-labels text {
  fill: white;
  font-size: 13px;
  font-weight: 800;
  text-anchor: middle;
  pointer-events: none;
  paint-order: stroke;
  stroke: rgba(15,23,42,.25);
  stroke-width: 2px;
}
.lobe-detail {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 9px;
}
.lobe-detail strong { font-size: 13px; }
.lobe-detail p { margin: 4px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.lobe-dot { flex: none; width: 10px; height: 10px; margin-top: 4px; border-radius: 50%; }
.lobe-rul { background: var(--lobe-rul); }
.lobe-rml { background: var(--lobe-rml); }
.lobe-rll { background: var(--lobe-rll); }
.lobe-lul { background: var(--lobe-lul); }
.lobe-lll { background: var(--lobe-lll); }
.patch-strip { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-top: 6px; }
.patch-chip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 6px 4px;
  color: var(--muted);
  background: white;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  font-size: 10px;
  font-weight: 700;
}
.patch-chip span { width: 7px; height: 7px; border-radius: 2px; background: currentColor; }
.patch-chip[data-lobe="rul"] span { color: var(--lobe-rul); }
.patch-chip[data-lobe="rml"] span { color: var(--lobe-rml); }
.patch-chip[data-lobe="rll"] span { color: var(--lobe-rll); }
.patch-chip[data-lobe="lul"] span { color: var(--lobe-lul); }
.patch-chip[data-lobe="lll"] span { color: var(--lobe-lll); }
.patch-chip:hover, .patch-chip.active { color: var(--text); border-color: #94a3b8; background: #f8fafc; }
.model-note { margin: 9px 0 0; color: var(--muted); font-size: 10.5px; line-height: 1.5; }

.mini-architecture { padding: 4px 8px 0; }
.mini-input {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 180px;
  margin: 0 auto;
  padding: 9px 13px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.mini-input div { display: flex; flex-direction: column; }
.mini-input strong { font-size: 12px; }
.mini-input small, .mini-branch small, .mini-output small { color: var(--muted); font-size: 9px; }
.volume-icon {
  position: relative;
  width: 25px;
  height: 25px;
  background: linear-gradient(135deg, #334155, #94a3b8);
  border: 2px solid white;
  border-radius: 4px;
  box-shadow: 4px -4px 0 #cbd5e1, 7px -7px 0 #e2e8f0;
}
.branch-split { display: flex; justify-content: center; height: 27px; }
.branch-split::before { content: ""; width: 1px; height: 14px; background: #94a3b8; }
.branch-split span { width: 31%; margin-top: 13px; border-top: 1px solid #94a3b8; }
.branch-split span:first-child { border-left: 1px solid #94a3b8; }
.branch-split span:last-child { border-right: 1px solid #94a3b8; }
.mini-branches { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mini-branch {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 76px;
  padding: 25px 12px 10px;
  border-radius: 8px;
  text-align: center;
}
.mini-branch.global { color: #78350f; background: #fffbeb; border: 1px solid #fde68a; }
.mini-branch.local { color: #115e59; background: #f0fdfa; border: 1px solid #99f6e4; }
.branch-tag { position: absolute; top: 7px; left: 0; right: 0; font-size: 8px; font-weight: 800; letter-spacing: .08em; }
.mini-branch strong { font-size: 12px; }
.mini-pool {
  width: 65%;
  margin: 17px 0 0 auto;
  padding: 8px;
  color: #115e59;
  background: #f8fffe;
  border: 1px dashed #5eead4;
  border-radius: 8px;
  text-align: center;
}
.mini-pool div { display: flex; justify-content: center; gap: 4px; margin-bottom: 4px; }
.mini-pool span { padding: 3px 5px; background: var(--teal-soft); border-radius: 4px; font-size: 9px; }
.mini-pool strong { display: block; font-size: 9px; font-weight: 600; }
.mini-output { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; margin-top: 15px; }
.mini-output div { display: flex; flex-direction: column; align-items: center; padding: 9px; background: #f8fafc; border: 1px solid var(--border); border-radius: 8px; }
.mini-output div > span { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; font-weight: 700; }
.align-mark { color: var(--violet); font-size: 22px; }
.implementation-callout { display: flex; gap: 8px; margin-top: 14px; padding: 9px 11px; color: #334155; background: #f1f5f9; border-radius: 7px; font-size: 10.5px; line-height: 1.45; }
.implementation-callout strong { flex: none; }

.architecture-card { margin-bottom: 16px; }
.architecture-flow {
  display: grid;
  grid-template-columns: 1.05fr 24px 1.2fr 24px 1.15fr 24px 1.15fr 24px 1.15fr;
  gap: 6px;
  align-items: center;
}
.flow-column { align-self: stretch; display: flex; flex-direction: column; gap: 8px; }
.flow-label { padding-bottom: 2px; color: #94a3b8; font-size: 9px; font-weight: 800; letter-spacing: .11em; text-align: center; }
.flow-arrow { color: #94a3b8; font-size: 20px; text-align: center; }
.flow-node {
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 84px;
  padding: 12px 9px;
  border: 1px solid var(--border);
  border-radius: 9px;
  text-align: center;
}
.flow-node strong { font-size: 11px; }
.flow-node small { margin-top: 4px; color: var(--muted); font-size: 9px; line-height: 1.4; }
.flow-node.neutral { flex-direction: row; gap: 9px; background: #f8fafc; }
.flow-node.neutral div { display: flex; flex-direction: column; align-items: flex-start; text-align: left; }
.node-icon { display: block; flex: none; width: 27px; height: 27px; }
.ct-icon { border: 4px solid #64748b; border-radius: 50%; box-shadow: inset 0 0 0 5px #cbd5e1; }
.patch-icon { background: linear-gradient(135deg, #5eead4, #0f766e); border-radius: 5px; box-shadow: 5px -5px 0 rgba(15,118,110,.25); }
.flow-node.frozen { background: #fffbeb; border-color: #fde68a; }
.flow-node.trainable { background: #f0fdfa; border-color: #99f6e4; }
.node-kicker { position: absolute; top: 6px; color: var(--muted); font-size: 7.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.flow-node.global-feature { background: #fff7ed; border-color: #fed7aa; }
.flow-node.regional-feature { background: #f0fdfa; border-color: #99f6e4; }
.token-row { display: flex; gap: 3px; margin: 7px 0 2px; }
.token-row i { width: 15px; height: 19px; border-radius: 3px; }
.token-row i:nth-child(1) { background: var(--lobe-rul); }
.token-row i:nth-child(2) { background: var(--lobe-rml); }
.token-row i:nth-child(3) { background: var(--lobe-rll); }
.token-row i:nth-child(4) { background: var(--lobe-lul); }
.token-row i:nth-child(5) { background: var(--lobe-lll); }
.flow-node.scan-head, .flow-node.region-head { background: #f8fafc; }
.tensor-pill { margin-top: 8px; padding: 3px 7px; color: #334155; background: white; border: 1px solid var(--border); border-radius: 10px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 8px; }
.flow-node.objective { padding-top: 25px; }
.objective-id { position: absolute; top: 7px; padding: 2px 6px; color: white; border-radius: 8px; font-size: 8px; font-weight: 800; }
.flow-node.o2 { background: var(--violet-soft); border-color: #c4b5fd; }
.flow-node.o2 .objective-id { background: var(--violet); }
.flow-node.o4 { background: var(--teal-soft); border-color: #99f6e4; }
.flow-node.o4 .objective-id { background: var(--teal); }

.objective-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 16px; }
.objective-card { padding: 17px 18px; background: white; border: 1px solid var(--border); border-top-width: 3px; border-radius: 10px; }
.o2-card { border-top-color: var(--violet); }
.o4-card { border-top-color: var(--teal); }
.fusion-card { border-top-color: var(--accent); }
.objective-card-title { display: flex; align-items: center; gap: 8px; }
.objective-card-title span { display: flex; align-items: center; justify-content: center; width: 25px; height: 25px; color: white; background: #475569; border-radius: 7px; font-size: 10px; font-weight: 800; }
.o2-card .objective-card-title span { background: var(--violet); }
.o4-card .objective-card-title span { background: var(--teal); }
.fusion-card .objective-card-title span { background: var(--accent); }
.objective-card h3 { margin: 0; font-size: 14px; }
.objective-card p { color: #475569; font-size: 11px; line-height: 1.55; }
.objective-card code { display: block; padding: 9px 10px; overflow-x: auto; color: #1e293b; background: #f8fafc; border-radius: 6px; font-size: 10px; white-space: nowrap; }
.objective-card .objective-foot { margin-bottom: 0; color: var(--muted); font-size: 9.5px; }

.spatial-card { margin-bottom: 12px; }
.spatial-flow { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr; gap: 12px; align-items: center; padding: 8px 10px; }
.spatial-flow > b { color: #94a3b8; font-weight: 400; }
.spatial-step { display: flex; flex-direction: column; align-items: center; min-width: 0; text-align: center; }
.spatial-step strong { margin-top: 8px; font-size: 11px; }
.spatial-step small { margin-top: 3px; color: var(--muted); font-size: 8.5px; }
.spatial-cube { position: relative; width: 46px; height: 38px; transform: skewY(-7deg); }
.spatial-cube i { position: absolute; inset: 0; border: 1px solid #7c3aed; border-radius: 4px; background-image: linear-gradient(#ddd6fe 1px, transparent 1px), linear-gradient(90deg, #ddd6fe 1px, transparent 1px); background-size: 8px 8px; }
.spatial-cube i:nth-child(2) { transform: translate(5px, -5px); opacity: .65; }
.spatial-cube i:nth-child(3) { transform: translate(10px, -10px); opacity: .35; }
.mask-stack { display: flex; align-items: flex-end; gap: 3px; height: 38px; }
.mask-stack i { width: 9px; border-radius: 5px 5px 2px 2px; }
.mask-stack i:nth-child(1) { height: 33px; background: var(--lobe-rul); }
.mask-stack i:nth-child(2) { height: 22px; background: var(--lobe-rml); }
.mask-stack i:nth-child(3) { height: 29px; background: var(--lobe-rll); }
.mask-stack i:nth-child(4) { height: 34px; background: var(--lobe-lul); }
.mask-stack i:nth-child(5) { height: 27px; background: var(--lobe-lll); }
.bin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; width: 42px; height: 42px; }
.bin-grid i { background: var(--teal-soft); border: 1px solid #5eead4; border-radius: 3px; }
.bin-grid i:nth-child(2), .bin-grid i:nth-child(3) { background: #99f6e4; }
.split-heads { position: relative; display: flex; gap: 11px; align-items: center; height: 42px; }
.split-heads::before { content: ""; position: absolute; left: 50%; top: 7px; bottom: 7px; width: 1px; background: #94a3b8; transform: rotate(90deg); }
.split-heads i { position: relative; z-index: 1; width: 31px; height: 26px; border-radius: 5px; }
.split-heads i:first-child { background: var(--violet-soft); border: 1px solid #c4b5fd; }
.split-heads i:last-child { background: var(--teal-soft); border: 1px solid #99f6e4; }
.spatial-note { max-width: 900px; margin: 12px auto 0; text-align: center; }
.model-provenance { margin: 0; padding: 0 6px; color: var(--muted); font-size: 10px; line-height: 1.55; text-align: center; }

@media (max-width: 1050px) {
  .model-overview-grid { grid-template-columns: 1fr; }
  .architecture-flow { grid-template-columns: 1fr; }
  .flow-column { display: grid; grid-template-columns: 1fr 1fr; }
  .flow-label { grid-column: 1 / -1; }
  .flow-arrow { transform: rotate(90deg); }
}

@media (max-width: 760px) {
  .model-hero { grid-template-columns: 1fr; gap: 20px; padding: 22px; }
  .model-facts { justify-content: space-between; }
  .model-facts div { min-width: 0; padding: 7px 12px; }
  .lung-visual { grid-template-columns: 1fr; }
  .lung-map { max-height: 250px; }
  .objective-grid { grid-template-columns: 1fr; }
  .spatial-flow { grid-template-columns: 1fr; }
  .spatial-flow > b { transform: rotate(90deg); text-align: center; }
}

@media (max-width: 520px) {
  header { align-items: flex-start; gap: 10px; }
  nav { flex-wrap: wrap; justify-content: flex-end; }
  main { padding: 14px 12px 40px; }
  .model-card { padding: 15px; }
  .model-hero h2 { font-size: 21px; }
  .model-facts strong { font-size: 19px; }
  .flow-column { grid-template-columns: 1fr; }
  .flow-label { grid-column: auto; }
}
