:root {
  --paper: #efe9dd;
  --paper-2: #fbf8f1;
  --panel: #f8f4ec;
  --panel-2: #f1ebdf;
  --ink: #1f2a30;
  --ink-2: #5a666d;
  --ink-3: #8d958f;
  --line: #d8cfbe;
  --grid: rgba(48, 104, 118, .10);
  --grid-2: rgba(48, 104, 118, .16);
  --accent: #b8195a;
  --accent-soft: rgba(184, 25, 90, .10);
  --hot: #d9542b;
  --cold: #2f6fb0;
  --machine: #f3d9e2;
  --ok: #2e7d5b;
  --warn: #b26a00;
  --shadow: 0 1px 0 rgba(31, 42, 48, .06), 0 8px 24px -12px rgba(31, 42, 48, .25);
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --sans: "Archivo", "Segoe UI", system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #151b1f; --paper-2: #1d252a; --panel: #192024; --panel-2: #1f282d;
    --ink: #e8e2d5; --ink-2: #a3aca8; --ink-3: #6f7a78; --line: #2e393f;
    --grid: rgba(150, 200, 210, .05); --grid-2: rgba(150, 200, 210, .09);
    --accent: #ff5c9a; --accent-soft: rgba(255, 92, 154, .12); --machine: #3a2530;
    --shadow: 0 8px 24px -12px rgba(0, 0, 0, .6); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #151b1f; --paper-2: #1d252a; --panel: #192024; --panel-2: #1f282d;
  --ink: #e8e2d5; --ink-2: #a3aca8; --ink-3: #6f7a78; --line: #2e393f;
  --grid: rgba(150, 200, 210, .05); --grid-2: rgba(150, 200, 210, .09);
  --accent: #ff5c9a; --accent-soft: rgba(255, 92, 154, .12); --machine: #3a2530;
  --shadow: 0 8px 24px -12px rgba(0, 0, 0, .6); color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--paper); color: var(--ink); font: 13px/1.4 var(--sans);
  display: grid; grid-template-columns: 236px 1fr 330px; grid-template-rows: 58px 1fr;
  grid-template-areas: "top top top" "pal stage insp"; overflow: hidden;
}
button, input, select { font: inherit; color: inherit; }
.num, td.n, .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ---------- topo ---------- */
.top { grid-area: top; display: flex; align-items: center; gap: 18px; padding: 0 14px; border-bottom: 1px solid var(--line); background: var(--panel); }
.brand { display: flex; align-items: center; gap: 10px; min-width: 210px; }
.brand .mark { width: 32px; height: 32px; border-radius: 8px; background: var(--ink); color: var(--paper);
  display: grid; place-items: center; font: italic 23px/1 Georgia, serif; padding-bottom: 4px; }
.brand b { display: block; font-size: 18px; font-weight: 800; font-stretch: 112%; letter-spacing: -.01em; line-height: 1; }
.brand small { color: var(--ink-2); font-size: 11px; letter-spacing: .04em; }
.tools { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.sep { width: 1px; height: 22px; background: var(--line); margin: 0 6px; }
.btn { border: 1px solid var(--ink); background: var(--ink); color: var(--paper); border-radius: 6px; padding: 5px 11px; cursor: pointer; font-weight: 600; }
.btn.ghost { background: transparent; color: var(--ink); border-color: transparent; font-weight: 500; }
.btn.ghost:hover { background: var(--panel-2); border-color: var(--line); }
.btn.icon { width: 32px; padding: 5px 0; font-size: 15px; }
.btn.lobby { display: inline-flex; align-items: center; gap: 5px; text-decoration: none; border-color: var(--line); }
.btn:focus-visible, .pal-item:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.btn.small { padding: 3px 9px; font-size: 12px; }
.btn.danger { background: transparent; color: var(--accent); border-color: var(--accent); }
.menu-wrap { position: relative; }
.menu { position: absolute; z-index: 30; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); padding: 5px; min-width: 260px; }
#menu-examples { top: 36px; left: 0; width: 380px; }
.menu button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 7px 10px; border-radius: 5px; cursor: pointer; }
.menu button:hover { background: var(--accent-soft); }
.menu button small { display: block; color: var(--ink-2); font-size: 11.5px; }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }

/* ---------- paleta ---------- */
.palette { grid-area: pal; border-right: 1px solid var(--line); background: var(--panel); overflow-y: auto; padding: 10px 10px 30px; }
.palette input { width: 100%; padding: 7px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper-2); margin-bottom: 4px; }
.pal-cat { font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); margin: 14px 2px 6px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.pal-cat::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.pal-item { display: grid; grid-template-columns: 46px 1fr; gap: 8px; align-items: center; padding: 5px 6px; border-radius: 7px; cursor: grab; border: 1px solid transparent; width: 100%; background: none; text-align: left; }
.pal-item:hover { background: var(--paper-2); border-color: var(--line); }
.pal-item svg { width: 46px; height: 34px; overflow: visible; }
.pal-item b { display: block; font-weight: 600; font-size: 12.5px; }
.pal-item small { color: var(--ink-2); font-size: 11px; }

/* ---------- palco ---------- */
.stage { grid-area: stage; display: grid; grid-template-rows: 1fr 6px var(--dock-h, 290px); min-width: 0; min-height: 0; }
.canvas-wrap { position: relative; overflow: hidden; min-height: 0; }
#canvas { width: 100%; height: 100%; display: block; background: var(--paper); cursor: default; user-select: none; outline: none; }
#canvas.panning { cursor: grabbing; }
.comp { cursor: move; }
.comp .sel-box { fill: none; stroke: var(--accent); stroke-width: 1.4; stroke-dasharray: 5 4; opacity: 0; }
.comp.sel .sel-box { opacity: 1; }
.comp .lbl { font: 600 11.5px var(--sans); fill: var(--ink); paint-order: stroke; stroke: var(--paper); stroke-width: 4px; stroke-linejoin: round; }
.comp .err-dot { fill: var(--warn); }
.port { fill: var(--paper-2); stroke: var(--ink); stroke-width: 1.4; cursor: crosshair; transition: r .12s; }
.port.out { fill: var(--ink); }
.port.free { stroke: var(--accent); stroke-width: 2; animation: pulse 1.6s ease-in-out infinite; }
.port:hover, .port.hot { r: 7; stroke: var(--accent); }
@keyframes pulse { 50% { stroke-opacity: .35; } }
.pipe { cursor: pointer; }
.pipe .o { fill: none; stroke: var(--ink); stroke-width: 8; stroke-linejoin: round; }
.pipe .i { fill: none; stroke-width: 5; stroke-linejoin: round; }
.pipe .hit { fill: none; stroke: transparent; stroke-width: 16; }
.pipe.sel .o { stroke: var(--accent); stroke-width: 10; }
.pipe.hov .o { stroke: var(--accent); }
.mid-handle { fill: var(--paper-2); stroke: var(--accent); stroke-width: 1.6; cursor: grab; }
.pt-label circle { fill: var(--paper-2); stroke: var(--ink); stroke-width: 1.3; }
.pt-label text { font: 600 10.5px var(--mono); text-anchor: middle; dominant-baseline: central; fill: var(--ink); }
.pt-label { cursor: pointer; }
.pt-label.sel circle { fill: var(--accent); stroke: var(--accent); }
.pt-label.sel text { fill: #fff; }
.part-l { fill: rgba(255, 255, 255, .92); }
.part-v { fill: none; stroke: rgba(255, 255, 255, .95); stroke-width: 1.3; }
.energy path { fill: none; stroke-width: 2.4; stroke-dasharray: 7 5; animation: flow 0.9s linear infinite; }
.energy text { font: 600 11px var(--mono); paint-order: stroke; stroke: var(--paper); stroke-width: 4px; }
.energy.q-in path, .energy.q-in text { stroke: var(--hot); } .energy.q-in text { fill: var(--hot); stroke: var(--paper); }
.energy.q-out path { stroke: var(--cold); } .energy.q-out text { fill: var(--cold); }
.energy.w path { stroke: var(--accent); } .energy.w text { fill: var(--accent); }
.energy text tspan.u { font-weight: 400; opacity: .8; }
@keyframes flow { to { stroke-dashoffset: -12; } }
.coil-flow { fill: none; stroke: rgba(255, 255, 255, .85); stroke-width: 1.4; stroke-dasharray: 1.5 8; stroke-linecap: round; animation: flow .7s linear infinite; }
.spin { animation: spin 1.1s linear infinite; transform-box: fill-box; transform-origin: center; }
.piston { animation: piston .9s ease-in-out infinite alternate; }
.blades line { animation: flow .5s linear infinite; }
.flame { animation: flicker .35s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: bottom; }
.bubbles circle { animation: rise 1.6s linear infinite; }
.bubbles circle:nth-child(2) { animation-delay: -.6s; } .bubbles circle:nth-child(3) { animation-delay: -1.1s; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes piston { to { transform: translateX(14px); } }
@keyframes flicker { to { transform: scaleY(.82); opacity: .8; } }
@keyframes rise { from { transform: translateY(14px); opacity: 0; } 30% { opacity: 1; } to { transform: translateY(-10px); opacity: 0; } }
body.paused .spin, body.paused .piston, body.paused .blades line, body.paused .flame, body.paused .bubbles circle,
body.paused .coil-flow, body.paused .energy path, body.paused .port.free { animation-play-state: paused; }
.temp-line { stroke: var(--accent); stroke-width: 2; stroke-dasharray: 5 4; fill: none; }

.legend { position: absolute; left: 12px; bottom: 10px; background: color-mix(in srgb, var(--panel) 92%, transparent); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; font-size: 11px; display: grid; gap: 4px; pointer-events: none; }
.legend .bar { width: 170px; height: 8px; border-radius: 4px; border: 1px solid var(--ink); }
.legend .row { display: flex; justify-content: space-between; font-family: var(--mono); color: var(--ink-2); }
.legend .ph { display: flex; gap: 12px; align-items: center; color: var(--ink-2); }
.legend .ph i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ink-2); margin-right: 4px; vertical-align: -1px; }
.legend .ph i.v { background: none; border: 1.3px solid var(--ink-2); }
.hint { position: absolute; right: 12px; top: 10px; font-size: 11.5px; color: var(--ink-2); background: color-mix(in srgb, var(--panel) 92%, transparent); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; max-width: 360px; }
.hint:empty { display: none; }
.tip { position: absolute; z-index: 40; pointer-events: none; background: var(--ink); color: var(--paper); border-radius: 7px; padding: 8px 10px; font-size: 11.5px; box-shadow: var(--shadow); min-width: 170px; }
.tip h4 { margin: 0 0 4px; font-size: 12px; }
.tip table { border-collapse: collapse; font-family: var(--mono); }
.tip td { padding: 0 8px 0 0; }
.ctx { min-width: 170px; }
.toast { position: absolute; left: 50%; top: 14px; transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: 7px 14px; border-radius: 20px; font-size: 12px; z-index: 50; }

/* ---------- doca ---------- */
.dock-handle { cursor: row-resize; background: var(--line); border-top: 1px solid var(--line); }
.dock-handle:hover { background: var(--accent); }
.dock { background: var(--panel); display: grid; grid-template-rows: auto 1fr; min-height: 0; }
.tabs { display: flex; gap: 2px; padding: 6px 10px 0; border-bottom: 1px solid var(--line); }
.tabs button { border: 0; background: none; padding: 7px 12px 8px; cursor: pointer; color: var(--ink-2); border-bottom: 2px solid transparent; font-weight: 600; }
.tabs button.on { color: var(--ink); border-bottom-color: var(--accent); }
.pane { display: none; overflow: auto; padding: 10px 14px 16px; min-height: 0; }
.pane.on { display: block; }
table.grid { border-collapse: collapse; width: 100%; font-size: 12px; }
table.grid th { text-align: left; font-weight: 600; color: var(--ink-2); font-size: 11px; padding: 6px 8px; border-bottom: 1.5px solid var(--ink); position: sticky; top: -10px; background: var(--panel); white-space: nowrap; }
table.grid th small { font-weight: 400; color: var(--ink-3); }
table.grid td { padding: 5px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.grid td.n { text-align: right; }
table.grid tr.hl td { background: var(--accent-soft); }
table.grid tbody tr { cursor: pointer; }
table.grid tbody tr:hover td { background: var(--panel-2); }
.badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; color: #fff; }
.ph-lc { background: #2f6fb0; } .ph-ls { background: #24877e; } .ph-mx { background: #7b5ea7; }
.ph-vs { background: #c08417; } .ph-vsa { background: #cf4f27; } .ph-sc { background: #a23b72; } .ph-g { background: #a66126; }
.pt-num { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 1.3px solid var(--ink); font: 600 11px var(--mono); }
.empty { color: var(--ink-2); padding: 18px 4px; }

.cards { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.card { background: var(--paper-2); border: 1px solid var(--line); border-radius: 9px; padding: 9px 12px; min-width: 128px; }
.card small { display: block; color: var(--ink-2); font-size: 11px; }
.card b { font: 600 19px var(--mono); }
.card b span { font-size: 12px; font-weight: 400; color: var(--ink-2); }
.card.big { border-color: var(--accent); }
.card.big b { color: var(--accent); }

/* diagrama */
.chart-bar { display: flex; gap: 10px; align-items: center; margin-bottom: 6px; flex-wrap: wrap; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.seg button { border: 0; background: none; padding: 4px 10px; cursor: pointer; }
.seg button.on { background: var(--ink); color: var(--paper); }
#chart svg { width: 100%; height: 100%; display: block; }
#chart { height: calc(100% - 34px); min-height: 200px; }
.ax text { font: 10.5px var(--mono); fill: var(--ink-2); }
.ax line, .ax path { stroke: var(--ink-3); }
.dome { fill: none; stroke: var(--ink); stroke-width: 1.6; }
.dome-fill { fill: var(--accent-soft); }
.proc { fill: none; stroke-width: 2.2; }
.proc.dash { stroke-dasharray: 5 4; }
.cpt circle { stroke: var(--ink); stroke-width: 1.2; }
.cpt text { font: 600 10.5px var(--mono); fill: var(--ink); paint-order: stroke; stroke: var(--panel); stroke-width: 3px; }
.cpt:hover circle, .cpt.hl circle { r: 7; stroke: var(--accent); stroke-width: 2; }

/* tabelas */
.tbl-wrap { display: grid; grid-template-columns: minmax(280px, 360px) 1fr; gap: 18px; align-items: start; }
.box { background: var(--paper-2); border: 1px solid var(--line); border-radius: 9px; padding: 12px; }
.box h3 { margin: 0 0 8px; font-size: 13px; }
.box h3 small { font-weight: 400; color: var(--ink-2); }
.formrow { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.formrow label { display: grid; gap: 2px; font-size: 11px; color: var(--ink-2); }
.formrow input, .formrow select { padding: 5px 7px; border: 1px solid var(--line); border-radius: 5px; background: var(--panel); }
.kv { display: grid; grid-template-columns: auto 1fr auto; gap: 2px 10px; font-size: 12px; }
.kv span:nth-child(3n+2) { text-align: right; font-family: var(--mono); }
.kv span:nth-child(3n) { color: var(--ink-3); font-size: 11px; }
.why { font-size: 12px; color: var(--ink-2); margin: 8px 0 0; border-left: 3px solid var(--accent); padding: 2px 0 2px 9px; }
.interp { font-size: 12px; }
.interp .eq { font-family: var(--mono); background: var(--panel); border: 1px dashed var(--line); padding: 7px 9px; border-radius: 6px; margin: 6px 0; white-space: pre-wrap; }
.interp table.grid td, .interp table.grid th { padding: 3px 8px; }

/* ---------- inspetor ---------- */
.inspector { grid-area: insp; border-left: 1px solid var(--line); background: var(--panel); overflow-y: auto; padding: 14px 14px 40px; }
.inspector h2 { font-size: 15px; margin: 0; font-weight: 700; font-stretch: 108%; }
.inspector .kind { color: var(--ink-2); font-size: 11.5px; margin-bottom: 10px; }
.inspector h5 { font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); margin: 16px 0 6px; display: flex; align-items: center; gap: 8px; }
.inspector h5::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.title-in { font: 700 15px var(--sans); border: 1px solid transparent; background: none; padding: 2px 4px; margin-left: -5px; border-radius: 5px; width: 100%; }
.title-in:hover, .title-in:focus { border-color: var(--line); background: var(--paper-2); outline: none; }
.field { display: grid; grid-template-columns: 1fr 120px; gap: 8px; align-items: center; margin-bottom: 6px; }
.field.wide { grid-template-columns: 1fr; gap: 3px; }
.field label { font-size: 12px; color: var(--ink-2); }
.field .inp { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 6px; background: var(--paper-2); }
.field .inp:focus-within { border-color: var(--ink); }
.field input, .field select { border: 0; background: none; padding: 5px 7px; width: 100%; min-width: 0; }
.field select { border: 1px solid var(--line); border-radius: 6px; background: var(--paper-2); }
.field input { font-family: var(--mono); text-align: right; outline: none; }
.field .u { color: var(--ink-3); padding-right: 7px; font-size: 11px; white-space: nowrap; }
.field input[type=range] { padding: 0; accent-color: var(--accent); }
.res-line { display: flex; justify-content: space-between; padding: 4px 0; border-bottom: 1px dotted var(--line); font-size: 12.5px; }
.res-line b { font-family: var(--mono); }
.story { background: var(--paper-2); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 6px; padding: 9px 11px; font-size: 12.5px; line-height: 1.55; }
.story b { font-family: var(--mono); font-weight: 600; }
.warns { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.warns li { background: color-mix(in srgb, var(--warn) 12%, transparent); border: 1px solid color-mix(in srgb, var(--warn) 40%, transparent); border-radius: 6px; padding: 6px 9px; font-size: 12px; }
.okmsg { color: var(--ok); font-size: 12px; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 14px; }
.mini-states { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.mini-states td { padding: 3px 4px; border-bottom: 1px dotted var(--line); }
.mini-states td.n { text-align: right; font-family: var(--mono); }
.help { font-size: 12px; color: var(--ink-2); line-height: 1.55; }
.help kbd { font: 11px var(--mono); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 0 4px; background: var(--paper-2); color: var(--ink); }

@media (max-width: 1100px) {
  body { grid-template-columns: 200px 1fr; grid-template-areas: "top top" "pal stage"; }
  .inspector { position: fixed; right: 0; top: 58px; bottom: 0; width: 320px; z-index: 20; box-shadow: var(--shadow); transform: translateX(100%); transition: transform .2s; }
  body.insp-open .inspector { transform: none; }
}
@media (max-width: 700px) {
  body { grid-template-columns: 1fr; grid-template-rows: auto auto 1fr; grid-template-areas: "top" "pal" "stage"; overflow: auto; }
  .top { flex-wrap: wrap; padding: 8px 16px; height: auto; }
  .palette { display: flex; overflow-x: auto; gap: 6px; padding: 8px 16px; border-right: 0; border-bottom: 1px solid var(--line); }
  .palette input, .pal-cat { display: none; }
  .pal-item { width: auto; min-width: 150px; }
  .stage { height: 80vh; }
  .tbl-wrap { grid-template-columns: 1fr; }
}


/* =====================================================================
   v2 — barra superior, tabela de estados, abas e painel lateral
   ===================================================================== */
.top { gap: 14px; padding: 0 14px; min-width: 0; }
.top-left { display: flex; align-items: center; gap: 12px; flex: none; }
.top-right { display: flex; align-items: center; gap: 8px; margin-left: auto; flex: none; }
.brand { min-width: 0; }
.tools { flex: 1 1 auto; min-width: 0; justify-content: center; gap: 8px; flex-wrap: nowrap; }
.tgroup { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 11px; background: var(--paper-2); }
.tb { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 11px; border: 0; border-radius: 8px; background: transparent; color: var(--ink);
  font: 600 12.5px/1 var(--sans); cursor: pointer; white-space: nowrap; transition: background-color .15s, color .15s, transform .1s; }
.tb .ic { width: 16px; height: 16px; flex: none; }
.tb:hover { background: var(--accent-soft); color: var(--accent); }
.tb:active { transform: translateY(1px); }
.tb:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.tb.icon { width: 30px; padding: 0; justify-content: center; }
.tb.primary { background: var(--ink); color: var(--paper); }
.tb.primary:hover { background: var(--accent); color: #fff; }
.tb .caret { display: inline-flex; margin-left: -2px; opacity: .8; }
.tb .caret .ic { width: 13px; height: 13px; }
.play-ico { display: inline-grid; place-items: center; width: 16px; font-size: 11px; line-height: 1; }
.menu-wrap { position: relative; display: inline-flex; }
#menu-examples { top: 38px; left: 0; width: 400px; border-radius: 12px; padding: 6px; }
.menu button { border-radius: 8px; padding: 8px 10px; }
@media (max-width: 1480px) { .tb:not(.primary) .tl { display: none; } .tb:not(.primary):not(.icon) { width: 30px; padding: 0; justify-content: center; } .brand small { display: none; } }
@media (max-width: 980px) { .brand div { display: none; } .tb.primary .tl { display: none; } .tb.primary { width: 30px; padding: 0; justify-content: center; } .tb.primary .caret { display: none; } }
.profile-btn.bb-btn { padding: 0 12px 0 3px; gap: 9px; border-radius: 999px; }
.profile-btn.bb-btn .avatar { width: 28px; height: 28px; }
.profile-btn.bb-btn .burger { color: inherit; opacity: .8; }

/* ---------- abas da doca ---------- */
.tabs { gap: 4px; padding: 8px 12px 0; border-bottom: 1px solid var(--line); background: var(--panel); }
.tabs button { padding: 8px 14px 9px; border-radius: 9px 9px 0 0; font-size: 12.5px; border: 1px solid transparent; border-bottom: 0; margin-bottom: -1px; transition: color .15s, background-color .15s; }
.tabs button:hover { color: var(--ink); background: var(--panel-2); }
.tabs button.on { color: var(--ink); background: var(--paper-2); border-color: var(--line); box-shadow: inset 0 2px 0 var(--accent); }
.pane { padding: 12px 16px 18px; }

/* ---------- tabela de estados ---------- */
.states-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 0 8px; }
.states-head h3 { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: .01em; }
.states-head small { color: var(--ink-2); font-size: 11.5px; }
.tbl-scroll { border: 1px solid var(--line); border-radius: 12px; overflow: auto; background: var(--paper-2); max-height: 100%; }
table.grid.states { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 760px; font-size: 12.5px; }
table.grid.states thead th { position: sticky; top: 0; z-index: 1; padding: 9px 8px 8px; background: var(--panel-2); border-bottom: 1px solid var(--line); letter-spacing: .02em; font-size: 12px; font-weight: 700; color: var(--ink-2); vertical-align: bottom; line-height: 1.25; }
table.grid.states thead th.n { text-align: right; }
table.grid.states thead th small { display: block; letter-spacing: 0; font-family: var(--mono); font-weight: 400; color: var(--ink-3); margin-top: 1px; }
table.grid.states tbody td { padding: 7px 8px; border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent); vertical-align: middle; }
table.grid.states tbody tr:last-child td { border-bottom: 0; }
table.grid.states tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--panel) 55%, transparent); }
table.grid.states tbody tr:hover td { background: var(--accent-soft); }
table.grid.states tbody tr.hl td { background: var(--accent-soft); }
table.grid.states tbody tr.hl td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
table.grid.states td.n { font-family: var(--mono); font-variant-numeric: tabular-nums; text-align: right; color: var(--ink); }
table.grid.states td.dim { color: var(--ink-3); }
.route { display: inline-flex; align-items: center; gap: 4px; flex-wrap: nowrap; }
.route .node { padding: 2px 6px; border-radius: 6px; background: var(--panel-2); border: 1px solid var(--line); font-size: 11px; font-weight: 600; white-space: nowrap; }
.route .arr { color: var(--ink-3); font-size: 12px; }
.fluid-tag { display: inline-block; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); background: var(--paper); font-size: 11.5px; font-weight: 600; color: var(--ink-2); }
.badge { padding: 3px 10px; font-size: 11px; letter-spacing: .02em; box-shadow: 0 1px 0 rgba(0,0,0,.12); }
.pt-num { width: 24px; height: 24px; background: var(--paper); }

/* ---------- painel lateral ---------- */
.inspector { padding: 0 0 40px; background: var(--panel); }
.inspector > :not(.insp-head) { margin-left: 16px; margin-right: 16px; }
.insp-head { margin: 0 !important; padding: 16px 16px 14px; background: linear-gradient(180deg, var(--panel-2), var(--panel)); border-bottom: 1px solid var(--line); display: grid; gap: 10px; }
.insp-top { display: flex; align-items: center; gap: 10px; }
.insp-top .pt-num { width: 34px; height: 34px; font-size: 14px; background: var(--paper-2); border-width: 1.6px; flex: none; }
.insp-top h2 { font-size: 16px; line-height: 1.1; margin: 0; }
.insp-top .sub { color: var(--ink-2); font-size: 11.5px; margin-top: 2px; }
.insp-top .badge { margin-left: auto; }
.insp-route { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.insp-route .node { padding: 3px 9px; border-radius: 7px; background: var(--paper-2); border: 1px solid var(--line); font-size: 12px; font-weight: 600; }
.insp-route .arr { color: var(--ink-3); }
.insp-sec { margin-top: 16px; }
.insp-sec > h5 { margin: 0 0 8px; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tile { background: var(--paper-2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; min-width: 0; }
.tile small { display: block; color: var(--ink-2); font-size: 10.5px; letter-spacing: .05em; text-transform: uppercase; font-weight: 600; }
.tile b { display: block; font: 600 17px/1.25 var(--mono); font-variant-numeric: tabular-nums; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; }
.tile b i { font-style: normal; font-weight: 400; font-size: 11px; color: var(--ink-3); margin-left: 3px; }
.tile.hot b { color: var(--hot); } .tile.cold b { color: var(--cold); }
.propbox { border: 1px solid var(--line); border-radius: 10px; background: var(--paper-2); overflow: hidden; margin-top: 8px; }
.prop { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: baseline; padding: 7px 11px; border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent); font-size: 12.5px; }
.prop:last-child { border-bottom: 0; }
.prop span:first-child { color: var(--ink-2); }
.prop b { font: 600 12.5px var(--mono); font-variant-numeric: tabular-nums; text-align: right; }
.prop .u { color: var(--ink-3); font: 11px var(--mono); min-width: 52px; }
.callout { display: grid; grid-template-columns: 22px 1fr; gap: 8px; margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: color-mix(in srgb, var(--cold) 9%, var(--paper-2)); border: 1px solid color-mix(in srgb, var(--cold) 30%, var(--line)); font-size: 12px; line-height: 1.55; color: var(--ink); }
.callout .ci { width: 20px; height: 20px; border-radius: 50%; background: var(--cold); color: #fff; display: grid; place-items: center; font: 700 12px/1 Georgia, serif; font-style: italic; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 18px 16px 0; }
.actions .btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; border-radius: 9px; font-size: 12.5px; padding: 0 10px; }
.actions .btn.ghost { border: 1px solid var(--line); background: var(--paper-2); color: var(--ink); }
.actions .btn.ghost:hover { border-color: var(--ink-3); background: var(--panel-2); }
.actions .btn.danger { border: 1px solid color-mix(in srgb, var(--accent) 55%, transparent); background: var(--accent-soft); }
.actions .btn.danger:hover { background: var(--accent); color: #fff; }
.inspector .title-in { width: calc(100% - 32px); margin-top: 16px; margin-left: 12px; }
.inspector .kind { margin-bottom: 12px; }
