:root {
  --bg: #14120e;
  --bg-2: #1c1813;
  --bg-3: #241f19;
  --ink: #f3efe6;
  --muted: #b7ab9a;
  --line: #3a332b;
  --intake: #3c8dff;
  --exhaust: #e24b3b;
  --blank: #8d877e;
  --copper: #e0a15a;
  --plume: #ff8a3d;
  --good: #7dcea0;
  font-family: "Avenir Next", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); }
button, select, input { font: inherit; color: inherit; background: #2a241e; border: 1px solid var(--line); border-radius: 7px; padding: 5px 8px; }
button { cursor: pointer; }
button:hover { border-color: #6d6254; }
button.primary { background: var(--copper); color: #1a1208; border-color: transparent; font-weight: 650; }
button.ghost { background: transparent; }
.hidden { display: none !important; }
.fine { color: var(--muted); font-size: 12px; line-height: 1.4; }
.warn { color: var(--copper); }
a { color: var(--copper); }
code { font-size: 0.95em; color: #f6d7b0; }

/* ---------------------------------------------------------------- start */
.start {
  min-height: 100vh; display: grid; place-items: center;
  background: radial-gradient(900px 420px at 70% 20%, rgba(224, 161, 90, 0.16), transparent 60%), var(--bg);
}
.start-card { max-width: 980px; padding: 32px; }
.eyebrow { letter-spacing: 0.14em; text-transform: uppercase; color: var(--copper); font-size: 12px; }
h1 { font-size: 54px; line-height: 0.95; margin: 8px 0 12px; font-weight: 650; }
.lede { font-size: 19px; color: var(--muted); max-width: 820px; }
.start-h { font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--copper); margin: 22px 0 8px; }
.start-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.start-actions button { padding: 12px 16px; font-size: 16px; }
.template-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.template-grid button { text-align: left; padding: 12px 14px; background: var(--bg-2); }
.template-grid button b { display: block; font-size: 15px; }
.template-grid button span { display: block; color: var(--muted); font-size: 12px; margin-top: 4px; line-height: 1.35; }
.template-grid button.mock { border-color: #6b4a1e; }

/* ---------------------------------------------------------------- app frame */
.app { height: 100vh; display: grid; grid-template-rows: auto 1fr auto; overflow: hidden; }
header {
  display: flex; align-items: center; gap: 12px; padding: 8px 14px;
  border-bottom: 1px solid var(--line); background: #100e0c; min-width: 0;
}
.brand { font-weight: 800; letter-spacing: 0.1em; background: transparent; border: none; padding: 4px 6px; color: var(--copper); }
.build-name { color: var(--muted); max-width: 300px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mock { background: #3a2a12; color: var(--copper); padding: 3px 7px; border-radius: 6px; font-size: 12px; line-height: 1.25; max-width: 250px; }
.header-readout { margin-left: auto; display: flex; gap: 12px; font-variant-numeric: tabular-nums; font-size: 16px; white-space: nowrap; }
.header-readout #hot-readout { font-weight: 700; }
.header-actions { display: flex; gap: 6px; align-items: center; flex: none; }
.header-actions > button { white-space: nowrap; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { border: none; border-radius: 0; background: transparent; padding: 5px 9px; font-size: 13px; white-space: nowrap; }
.seg button.on { background: var(--bg-3); color: var(--copper); }

.layout { display: grid; grid-template-columns: 104px 340px minmax(0, 1fr) 300px; min-height: 0; }
footer { padding: 6px 14px; color: var(--muted); font-size: 12px; border-top: 1px solid var(--line); }

/* ---------------------------------------------------------------- face bar + panel */
.facebar { display: flex; flex-direction: column; gap: 4px; padding: 8px 6px; background: #100e0c; border-right: 1px solid var(--line); }
.facebar button { text-align: left; background: transparent; border: 1px solid transparent; padding: 8px 8px; border-radius: 8px; }
.facebar button b { display: block; font-size: 14px; }
.facebar button span { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; line-height: 1.25; }
.facebar button.on { background: var(--bg-3); border-color: var(--copper); }
.facebar button.on b { color: var(--copper); }

.panel { background: var(--bg-2); border-right: 1px solid var(--line); padding: 12px 14px; overflow-y: auto; min-height: 0; }
.panel h2 { margin: 0 0 2px; font-size: 18px; }
.panel h3 { margin: 14px 0 6px; font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--copper); }
.panel .sub { color: var(--muted); font-size: 12px; margin: 0 0 8px; }
.row { display: flex; gap: 6px; align-items: center; margin: 5px 0; }
.row > label { flex: 1; }
label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); }
label.check { flex-direction: row; align-items: center; gap: 6px; color: var(--ink); }
label select, label input { width: 100%; min-width: 0; }
label.check input { width: auto; }
.row select { min-width: 0; flex: 1 1 0; }
.row > button { flex: none; }
.mount-row { display: grid; grid-template-columns: 58px 1fr 64px 52px; gap: 5px; align-items: center; padding: 4px 0; border-bottom: 1px dashed #332c24; }
.mount-row.sel { background: rgba(224, 161, 90, 0.08); }
.mount-row .mid { font-size: 12px; color: var(--muted); }
.mount-row select { font-size: 12px; padding: 4px; min-width: 0; }
.mount-row input { font-size: 12px; padding: 4px; width: 100%; }
.dir { font-size: 12px; padding: 4px 6px; }
.dir.intake { border-color: var(--intake); color: #9cc4ff; }
.dir.exhaust { border-color: var(--exhaust); color: #ff9f94; }
.seal-name { font-size: 12px; color: var(--ink); }
input[type="range"] { padding: 0; accent-color: var(--copper); }
.box { border: 1px solid var(--line); border-radius: 9px; padding: 8px; margin: 6px 0; background: #1f1a15; }
.gpu-card .head { display: flex; justify-content: space-between; align-items: baseline; }
.gpu-card .head b { font-size: 15px; }
.gpu-card .t { font-variant-numeric: tabular-nums; font-weight: 700; }
details summary { cursor: pointer; font-size: 12px; color: var(--muted); margin-top: 4px; }
.pill { display: inline-block; padding: 1px 6px; border-radius: 10px; font-size: 11px; border: 1px solid var(--line); color: var(--muted); }
.pill.ft { border-color: var(--plume); color: var(--plume); }

/* ---------------------------------------------------------------- stage */
.stage { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: #0c0b09; }
.views { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr; }
.stage.net-split .views { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); }
body.net-split .layout, body.net-full .layout { grid-template-columns: 104px 340px minmax(0, 1fr); }
body.net-split .readout, body.net-full .readout { display: none; }
.stage.net-full .views { grid-template-columns: 1fr; }
.stage.net-off .netview { display: none; }
.stage.net-full .view3d { display: none; }
.view3d { position: relative; min-width: 0; min-height: 0; }
#scene { width: 100%; height: 100%; display: block; }
.labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.tag {
  position: absolute; transform: translate(-50%, -50%);
  background: rgba(12, 11, 9, 0.84); border: 1px solid var(--line);
  border-radius: 6px; padding: 2px 7px; font-size: 12px; white-space: nowrap;
}
.tag.face-tag { border-color: #5a6e8f; font-size: 13px; }
.tag.gpu-tag { border-color: #f0e2cf; font-size: 13px; font-weight: 600; }
.tag.gpu-tag.hot { border-color: var(--exhaust); color: #ffb3a8; }
.tag.rad-tag { border-color: var(--copper); }
.tag.shroud-tag { border-color: #b8433a; }
.legend {
  position: absolute; top: 10px; left: 10px; z-index: 2; display: flex; gap: 12px; padding: 6px 10px;
  background: rgba(12, 11, 9, 0.88); border: 1px solid var(--line); border-radius: 8px; font-size: 13px;
}
.legend span { display: flex; align-items: center; gap: 6px; }
.swatch { display: inline-block; width: 11px; height: 11px; border-radius: 50%; }
.swatch.intake { background: var(--intake); }
.swatch.exhaust { background: var(--exhaust); }
.swatch.blank, .swatch.blanked, .swatch.empty { background: var(--blank); }
.swatch.gpu { background: linear-gradient(90deg, #3d7adb, #5aa870, #e0a15a, #e24b3b); border-radius: 3px; width: 22px; }
.face-inset {
  position: absolute; right: 10px; bottom: 10px; z-index: 2; background: rgba(12, 11, 9, 0.9);
  border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; font-size: 12px; color: var(--muted);
}
.face-inset svg { display: block; }
.face-inset circle.fan { cursor: pointer; }

.netview { overflow: auto; padding: 10px 14px 14px; border-left: 1px solid var(--line); background: #0f0d0b; min-width: 0; }
.net-head h2 { margin: 0 0 4px; font-size: 18px; }
.net-head p { margin: 0 0 8px; font-size: 13px; color: var(--muted); line-height: 1.45; max-width: 1100px; }
.net-layer h3 { font-size: 14px; margin: 10px 0 2px; color: var(--copper); }
.net-svg { width: 100%; height: auto; display: block; }
.net-svg .rail { stroke: #6d6254; stroke-width: 4; }
.net-svg .rail-t { fill: var(--muted); font-size: 14px; }
.net-svg .wire { stroke: #8ea6c4; fill: none; }
.net-svg .wire.thin { stroke-width: 1.2; stroke: #6f7f93; }
.net-svg .wire.sealed { stroke: #6d6254; stroke-dasharray: 5 5; }
.net-svg .wire.mixwire { stroke: var(--plume); stroke-width: 2; }
.net-svg .flowdir { stroke: #cfe0f5; stroke-width: 1.5; }
.net-svg .arrowhead { fill: #cfe0f5; }
.net-svg .sym { stroke: #f3efe6; stroke-width: 1.6; fill: none; }
.net-svg .sym.fan { stroke: #7fb3ff; }
.net-svg .sym-bg { fill: #0f0d0b; }
.net-svg .inf { fill: var(--muted); font-size: 18px; }
.net-svg .br-t { fill: var(--ink); font-size: 13px; paint-order: stroke; stroke: #0f0d0b; stroke-width: 3px; }
.net-svg .br-v { fill: #c9bba7; font-size: 12.5px; paint-order: stroke; stroke: #0f0d0b; stroke-width: 3px; }
.net-svg .node circle, .net-svg .tnode circle { fill: var(--copper); stroke: #1a1208; stroke-width: 2; }
.net-svg .node-t { fill: var(--ink); font-size: 14px; font-weight: 700; paint-order: stroke; stroke: #0f0d0b; stroke-width: 3px; }
.net-svg .node-v { fill: #e8c79c; font-size: 12.5px; paint-order: stroke; stroke: #0f0d0b; stroke-width: 3px; }
.net-svg .plume-path { stroke: var(--plume); stroke-width: 2.4; stroke-dasharray: 7 4; fill: none; }
.net-svg .plume-t { fill: var(--plume); font-size: 14px; font-weight: 700; paint-order: stroke; stroke: #0f0d0b; stroke-width: 3px; }
.net-svg .row-t { fill: var(--ink); font-size: 15px; font-weight: 700; }
.net-svg .eq { fill: #f6d7b0; font-size: 13.5px; font-family: ui-monospace, Menlo, monospace; }
.net-svg .branch:hover .sym, .net-svg .branch:hover .wire { stroke: var(--copper); }
.net-foot { margin-top: 6px; }

.demo-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 6px 12px; background: #100e0c; border-bottom: 1px solid var(--line); font-size: 13px;
}
.demo-copy { min-width: 0; }
.demo-bar p { margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.demo-nav { display: flex; align-items: center; gap: 8px; flex: none; }

.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 8px 12px; border-top: 1px solid var(--line); background: var(--bg-2); }
.compare table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.compare td, .compare th { border-bottom: 1px solid var(--line); text-align: left; padding: 3px 4px; font-size: 13px; }
.compare h2 { font-size: 14px; margin: 0 0 4px; }

/* ---------------------------------------------------------------- readout */
.readout { border-left: 1px solid var(--line); padding: 10px 12px; overflow-y: auto; background: var(--bg-2); min-height: 0; }
.card-row { border-bottom: 1px solid var(--line); padding: 7px 0; }
.card-row h3 { margin: 0 0 2px; font-size: 14px; display: flex; justify-content: space-between; gap: 6px; }
.temp { font-size: 30px; font-variant-numeric: tabular-nums; line-height: 1.1; }
.throttle { color: var(--exhaust); font-weight: 700; font-size: 12px; }
.plume-note { color: var(--plume); font-size: 12px; }

.tip {
  position: fixed; z-index: 50; max-width: 420px; pointer-events: none;
  background: #0b0a08; color: var(--ink); border: 1px solid var(--copper); border-radius: 8px;
  padding: 8px 10px; font-size: 12.5px; line-height: 1.45; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

body.present .facebar, body.present .panel { display: none; }
body.present .layout { grid-template-columns: minmax(0, 1fr) 360px; }
body.present .temp { font-size: 40px; }
body.present header { font-size: 18px; }

@media (max-width: 1300px) {
  .layout { grid-template-columns: 92px 300px minmax(0, 1fr); }
  .readout { display: none; }
  .header-actions .seg button { padding: 5px 6px; }
}

/* In split mode the case view is narrower; keep the face inset out of the way. */
.stage.net-split .face-inset { padding: 4px 6px; font-size: 11px; max-width: 46%; }
.stage.net-split .face-inset svg { max-height: 150px; width: auto; }

/* ---------------------------------------------------------------- rev 4.1: funnel + calm panels */
.quick { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 22px 0 18px; }
.quick-card { text-align: left; padding: 20px 22px; border-radius: 14px; background: var(--bg-2); border: 1px solid var(--line); }
.quick-card:hover { border-color: var(--copper); }
.quick-card b { display: block; font-size: 22px; margin: 4px 0 6px; }
.quick-card span { display: block; color: var(--muted); font-size: 14px; }
.quick-card .q-kicker { color: var(--copper); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; }
details.more { margin: 6px 0 16px; }
details.more summary { color: var(--muted); cursor: pointer; font-size: 14px; }
details.more .template-grid { margin-top: 10px; }
details.more .start-actions { margin-top: 10px; }
.panel details { border-top: 1px solid #332c24; margin-top: 10px; padding-top: 6px; }
.panel details > summary { font-size: 12.5px; color: var(--muted); }
.panel details[open] > summary { color: var(--copper); margin-bottom: 6px; }
.big-row { display: grid; grid-template-columns: 1fr auto; gap: 6px; align-items: end; margin: 6px 0; }
.big-row select { font-size: 14px; padding: 7px 8px; }
.stat-hot { font-size: 34px; font-variant-numeric: tabular-nums; font-weight: 700; line-height: 1.05; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; margin: 6px 0 12px; font-size: 13px; }
.stats span { color: var(--muted); }
.gpu-line { display: grid; grid-template-columns: 1fr auto; align-items: baseline; padding: 7px 0; border-bottom: 1px solid var(--line); }
.gpu-line b { font-size: 15px; }
.gpu-line .where { color: var(--muted); font-size: 12px; display: block; }
.gpu-line .t { font-size: 26px; font-variant-numeric: tabular-nums; font-weight: 650; }
.gpu-line .sub { grid-column: 1 / -1; color: var(--muted); font-size: 12px; }
.gpu-line.vertical b::after { content: " · vertical"; color: var(--copper); font-weight: 500; font-size: 12px; }

/* ---------------------------------------------------------------- network view (rev 4.1 clean-up) */
.net-head p { font-size: 14px; }
.net-head .hint { color: var(--copper); }
details.net-more { margin: 6px 0 10px; }
details.net-more > summary { cursor: pointer; color: var(--muted); font-size: 13px; }
details.net-more[open] > summary { color: var(--copper); }
details.net-more p { font-size: 13px; color: var(--muted); line-height: 1.5; max-width: 900px; }
.net-legend { display: flex; flex-wrap: wrap; gap: 16px; font-size: 13px; color: var(--muted); margin: 4px 0 6px; }
.net-legend span { display: inline-flex; align-items: center; gap: 4px; cursor: help; }
.net-svg .rail { stroke: #4a4238; stroke-width: 3; }
.net-svg .rail-t { fill: var(--muted); font-size: 13px; }
.net-svg .wire { stroke: #7d93ad; }
.net-svg .wire.thin { stroke-width: 1.2; stroke: #8a7a66; opacity: 0.6; }
.net-svg .wire.faint { stroke: #5a524a; stroke-dasharray: 3 4; }
.net-svg .sym.fan.in { stroke: #7fb3ff; }
.net-svg .sym.fan.out { stroke: #ff8f84; }
.net-svg .br-t { font-size: 13.5px; }
.net-svg .node-t { font-size: 14px; }
.net-svg .dot { fill: #7d93ad; }
.net-svg .card-box rect { fill: #221d17; stroke: #e0a15a; stroke-width: 1.5; }
.net-svg .card-box:hover rect { fill: #2e261d; }
.net-svg .card-t { fill: var(--ink); font-size: 14px; font-weight: 700; }
.net-svg .card-v { fill: var(--muted); font-size: 11.5px; }
.duct-path { stroke: #b58cff; stroke-width: 2.4; fill: none; }
.net-svg .branch, .net-svg .node, .net-svg .card-box { cursor: help; }
.net-svg .branch:hover .wire, .net-svg .branch:hover .plume-path, .net-svg .branch:hover .duct-path { stroke: var(--copper); }
.heat-rows { display: flex; flex-direction: column; gap: 8px; margin: 6px 0 10px; }
.heat-row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; padding: 6px 8px; background: #16120e; border: 1px solid var(--line); border-radius: 10px; }
.heat-name { font-weight: 700; min-width: 54px; cursor: help; }
.chip { display: inline-flex; flex-direction: column; align-items: center; padding: 3px 10px; border-radius: 8px; background: #221d17; border: 1px solid #3a332b; cursor: help; }
.chip small { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.chip b { font-size: 15px; font-variant-numeric: tabular-nums; }
.chip.die { border-color: var(--copper); }
.link { font-size: 12px; color: #c9bba7; padding: 0 2px; cursor: help; }
.link::before { content: "→ "; color: #6d6254; }
.link::after { content: " →"; color: #6d6254; }
.net-table { width: 100%; border-collapse: collapse; font-size: 12.5px; margin-top: 6px; }
.net-table th, .net-table td { text-align: left; padding: 4px 6px; border-bottom: 1px solid #2e2821; vertical-align: top; }
.net-table th { color: var(--copper); font-weight: 600; position: sticky; top: 0; background: #0f0d0b; }
.net-table td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.net-table .eq-row td { border-bottom: 1px solid #3a332b; color: #f6d7b0; padding-top: 0; }
.net-sym .sym { stroke: #f3efe6; stroke-width: 1.6; fill: none; }
.net-sym .sym.fan.in { stroke: #7fb3ff; }
.net-sym .sym-bg { fill: #0f0d0b; }
.net-sym .inf { fill: var(--muted); font-size: 16px; }
.net-sym .plume-path { stroke: var(--plume); stroke-width: 2.4; stroke-dasharray: 6 4; fill: none; }
.net-sym .duct-path { stroke: #b58cff; stroke-width: 2.4; fill: none; }

.load-error { position: fixed; left: 50%; top: 18px; transform: translateX(-50%); z-index: 50; max-width: 720px; padding: 12px 16px; border-radius: 8px; background: #3a1712; border: 1px solid #e24b3b; color: #ffe2dc; font-size: 14px; cursor: pointer; }

.mobile-temps, .mobile-tabs { display: none; }
.solver-status { margin-top: 14px; }

/* Phone: one view at a time, temperatures stay pinned under the header. */
@media (max-width: 800px) {
  h1 { font-size: 34px; }
  .lede { font-size: 16px; }
  .start-card { padding: 18px 16px 32px; }
  .quick, .template-grid { grid-template-columns: 1fr; }
  .quick-card b { font-size: 18px; }

  .app { height: 100dvh; grid-template-rows: auto auto 1fr auto; }
  footer { display: none; }
  header { flex-wrap: wrap; gap: 6px; padding: 6px 8px; }
  .build-name { max-width: 42vw; font-size: 12px; }
  .mock { max-width: none; order: 5; }
  .header-readout { display: none; }
  #net-seg { display: none; }
  .header-actions { width: 100%; flex-wrap: wrap; overflow: visible; }
  /* Desktop tools; on a phone the header stays one row. */
  #opt-run, #compare-toggle, #demo-toggle, #present-toggle { display: none; }
  .demo-bar { flex-wrap: wrap; }

  .mobile-temps {
    display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
    padding: 6px 10px; background: #100e0c; border-bottom: 1px solid var(--line);
    font-variant-numeric: tabular-nums;
  }
  .mobile-temps .hot { font-size: 18px; font-weight: 750; white-space: nowrap; }
  .mobile-temps .mt {
    font-size: 12px; font-weight: 650; white-space: nowrap;
    padding: 2px 7px; border: 1px solid var(--line); border-radius: 999px;
  }
  .mobile-tabs {
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    background: #100e0c; border-top: 1px solid var(--line);
  }
  .mobile-tabs button { padding: 9px 2px; font-size: 13px; font-weight: 700; background: transparent; }
  .mobile-tabs button.on { color: var(--copper); border-color: var(--copper); }

  body.is-mobile .layout,
  body.net-split .layout,
  body.net-full .layout { grid-template-columns: 1fr; }
  .legend { flex-wrap: wrap; max-width: calc(100% - 12px); font-size: 11px; gap: 6px 10px; top: 6px; left: 6px; }
  .face-inset { display: none; }
  .mount-row { grid-template-columns: 46px minmax(0, 1fr) 56px 44px; }
  .net-svg { min-width: 680px; }
  .load-error { max-width: calc(100% - 24px); }

  body.mtab-pc .facebar,
  body.mtab-pc .panel,
  body.mtab-pc .readout { display: none !important; }

  body.mtab-customize .stage, body.mtab-worth .stage { display: none; }
  body.mtab-customize .layout { grid-template-columns: 84px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; }
  body.mtab-customize .facebar { overflow: auto; }
  body.mtab-worth .layout { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
  body.mtab-worth .facebar, body.mtab-worth .readout { display: none !important; }
  #worth-open, #share-link { padding: 6px 10px; }
  body.mtab-customize .readout {
    display: block; grid-column: 1 / -1; max-height: 32vh;
    border-left: none; border-top: 1px solid var(--line);
  }

  body.mtab-network .facebar,
  body.mtab-network .panel,
  body.mtab-network .readout,
  body.mtab-network .view3d { display: none !important; }
  body.mtab-network .netview { border-left: none; }

  body.mtab-split .facebar,
  body.mtab-split .panel,
  body.mtab-split .readout { display: none !important; }
  body.mtab-split .stage.net-split .views {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(190px, 40vh) minmax(220px, 1fr);
  }
  body.mtab-split .netview { border-left: none; border-top: 1px solid var(--line); }
}

/* ------------------------------------------------------------------ worth it? */
.facebar .worth-face { border-top: 1px solid var(--line); margin-top: 6px; }
.facebar .worth-face b { color: var(--copper); }
.worth-verdict { background: var(--bg-2); border: 1px solid var(--copper); border-radius: 10px; padding: 10px 12px; margin: 8px 0; line-height: 1.45; }
.worth-verdict b { font-size: 15px; }
.worth-applied { background: #1d2a1f; border: 1px solid #3f6b46; border-radius: 8px; padding: 8px 10px; margin: 6px 0; font-size: 13px; }
.worth-applied button { margin-left: 6px; }
.worth-row { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 10px 0; background: var(--bg-2); }
.worth-row.good { border-color: #3f6b46; }
.worth-row.bad { border-color: #6b3a33; }
.worth-row .wr-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.worth-row .wr-head b { font-size: 15px; }
.effort { font-size: 11px; white-space: nowrap; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.effort.e-free { color: #9fd8a6; border-color: #3f6b46; }
.effort.e-10min { color: #e6c98f; border-color: #6b5a33; }
.effort.e-rebuild { color: #f0a58f; border-color: #6b3a33; }
.worth-row .wr-num { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; margin: 6px 0 4px; font-variant-numeric: tabular-nums; }
.worth-row .delta { font-size: 24px; font-weight: 750; }
.worth-row.good .delta { color: #7fd08a; }
.worth-row.bad .delta { color: #ef7b6a; }
.worth-row.noise .delta { color: var(--muted); }
.worth-row .band { color: var(--muted); font-size: 12px; }
.noise-chip { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: #2e2922; color: var(--muted); border: 1px dashed var(--muted); }
.worth-bar { position: relative; height: 12px; margin: 6px 0; background: #17140f; border-radius: 6px; overflow: hidden; }
.worth-bar i { position: absolute; top: 0; bottom: 0; display: block; }
.worth-bar .wb-noise { background: repeating-linear-gradient(45deg, #2b261f, #2b261f 4px, #221e18 4px, #221e18 8px); }
.worth-bar .wb-zero { width: 1px; background: var(--muted); }
.worth-bar .wb-band { background: rgba(224, 161, 90, 0.45); top: 3px; bottom: 3px; border-radius: 3px; }
.worth-bar .wb-dot { width: 10px; height: 10px; top: 1px; margin-left: -5px; border-radius: 50%; background: var(--ink); }
.worth-row .wr-frame { margin: 6px 0; font-weight: 650; color: var(--copper); }
.worth-row .wr-actions { display: flex; gap: 8px; margin-top: 6px; }
.worth-rule { margin-top: 14px; }
.test-box { margin-top: 10px; padding: 10px; border: 1px dashed var(--copper); border-radius: 8px; }
.test-box .row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 6px 0; }
.test-box label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); }
.test-result { margin-top: 8px; line-height: 1.5; }
.test-result b { font-size: 16px; }
.test-result .ok { color: #7fd08a; font-weight: 650; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; z-index: 60;
  background: #231d16; border: 1px solid var(--copper); border-radius: 10px; padding: 10px 14px; display: flex; gap: 8px; align-items: center;
  transition: opacity 0.2s, transform 0.2s; max-width: calc(100% - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast-url { width: min(60vw, 520px); }

/* Worth it? gets a wider panel, and stays on screen in Present mode (the stream view). */
body.face-worth .layout { grid-template-columns: 104px 440px minmax(0, 1fr) 300px; }
body.face-worth.net-split .layout, body.face-worth.net-full .layout { grid-template-columns: 104px 440px minmax(0, 1fr); }
body.present.face-worth .panel { display: block; }
body.present.face-worth .layout { grid-template-columns: 480px minmax(0, 1fr) 340px; }
body.present .worth-row .delta { font-size: 30px; }
body.present .worth-verdict b { font-size: 18px; }
@media (max-width: 1300px) {
  body.face-worth .layout { grid-template-columns: 92px 380px minmax(0, 1fr); }
  body.present.face-worth .layout { grid-template-columns: 420px minmax(0, 1fr); }
}
@media (max-width: 800px) {
  body.face-worth .layout, body.present.face-worth .layout { grid-template-columns: minmax(0, 1fr); }
}
