/* Bancada de Vibrações — folha de estilos original (Vibra-es--ccr-22cdb8ec-iqifen/css/style.css)
   escopada em #lab-view para coexistir sem conflito com as demais abas de web/. */

#lab-view {
  --bg: var(--paper, #f3f1ec);
  --panel: var(--sheet, #fbfaf7);
  --panel-2: var(--sunk, #eae6de);
  --canvas: var(--sheet, #fbfaf7);
  --grid: rgba(22, 24, 27, .055);
  --grid-major: var(--rule, #d9d5cc);
  --ink: #16181b;
  --muted: #4b4f55;
  --faint: #61656c;
  --line: #d9d5cc;
  --accent: #c2410c;
  --accent-ink: #ffffff;
  --accent-soft: #fdf2e9;
  --tension: #c73e2c;
  --compression: #1f5fa8;
  --mass: #263140;
  --mass-hi: #4b5a6e;
  --good: #23874b;
  --warn: #a8720a;
  --bad: #c73e2c;
  --s1: #c2410c;
  --s2: #c0750e;
  --s3: #1f5fa8;
  --s4: #c73e2c;
  --s5: #7655c2;
  --shadow: 0 1px 2px rgba(22, 24, 27, .04), 0 6px 18px -8px rgba(22, 24, 27, .12);

  --font-display: "IBM Plex Sans Condensed", "Arial Narrow", system-ui, sans-serif;
  --font-body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --r-card: 4px;
  --r: 3px;
  --fs-xs: 11px;
  --fs-s: 12px;
  --fs-m: 13px;
  --fs-l: 15px;
  --fs-xl: 18px;

  background: var(--bg);
  color: var(--ink);
  font: 400 var(--fs-m)/1.45 var(--font-body);
  -webkit-font-smoothing: antialiased;
}

:root[data-theme="dark"] #lab-view {
  --bg: #101214; --panel: #171a1d; --panel-2: #1e2226; --canvas: #13161a;
  --grid: rgba(235, 232, 225, .05); --grid-major: #2d3135; --ink: #ebe8e1; --muted: #b6b2aa; --faint: #8a867e; --line: #2d3135;
  --accent: #f07b3f; --accent-ink: #101214; --accent-soft: #2d1808;
  --tension: #ff705d; --compression: #74a9e6; --mass: #c4cfdb; --mass-hi: #eef3f8;
  --good: #4cc47e; --warn: #e3a72f; --bad: #ff705d;
  --s1: #f07b3f; --s2: #f0a63a; --s3: #74a9e6; --s4: #ff705d; --s5: #a98df2;
  --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 8px 24px -10px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

body:has(#lab-view:not([hidden])) .colophon {
  display: none;
}

/* Reset dos seletores globais de app.css dentro da Bancada */
#lab-view label {
  display: inline;
  font: inherit;
  color: inherit;
  margin: 0;
}
#lab-view small {
  display: inline;
  margin: 0;
  color: inherit;
  font-size: inherit;
  line-height: inherit;
}
#lab-view button,
#lab-view input,
#lab-view select,
#lab-view textarea {
  font: inherit;
  color: inherit;
  box-shadow: none;
}
#lab-view input:not([type=checkbox]):not([type=range]):not([type=file]),
#lab-view select,
#lab-view textarea {
  display: inline-block;
  width: auto;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}
#lab-view table {
  width: auto;
  border-collapse: collapse;
  font-size: inherit;
}
#lab-view td,
#lab-view th {
  padding: 0;
  border: 0;
  background: transparent;
}
#lab-view tbody tr:hover {
  background: transparent;
}

#lab-view kbd {
  font: 500 10px/1 var(--font-mono);
  padding: 2px 5px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 4px;
  color: var(--muted);
  background: var(--panel-2);
}
#lab-view .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
#lab-view .muted { color: var(--muted); }
#lab-view :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#lab-view .card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow);
}

/* ================= grade principal ================= */
#lab-view .lab-app {
  height: calc(100vh - var(--top, 60px));
  min-height: 660px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  grid-template-rows: auto minmax(0, 1fr) 286px;
  grid-template-areas:
    "top   top"
    "stage insp"
    "dock  insp";
  gap: 10px;
  padding-block: 10px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

/* ================= barra superior ================= */
#lab-view .lab-topbar {
  grid-area: top;
  display: flex;
  align-items: center;
  gap: 12px 20px;
  min-width: 0;
  flex-wrap: wrap;
}
#lab-view .brand { display: flex; align-items: center; gap: 10px; min-width: 0; color: var(--ink); font: inherit; }
#lab-view .brand-mark { width: 38px; height: 24px; flex: none; fill: none; stroke: var(--accent); stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
#lab-view .brand-text { display: flex; flex-direction: column; line-height: 1.1; }
#lab-view .brand h1 { margin: 0; font: 700 20px/1.1 var(--font-display); letter-spacing: .005em; white-space: nowrap; }
#lab-view .brand .sub { font: 500 10.5px/1.3 var(--font-mono); color: var(--muted); letter-spacing: .1em; text-transform: uppercase; }

#lab-view .picker {
  display: flex;
  align-items: center;
  gap: 0;
  margin-left: auto;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--panel);
  box-shadow: var(--shadow);
  min-width: 0;
}
#lab-view .picker label {
  font: 600 10.5px/1 var(--font-mono);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0 10px 0 14px;
  border-right: 1px solid var(--line);
  align-self: stretch;
  display: flex;
  align-items: center;
  margin: 0;
}
#lab-view .picker select {
  border: 0;
  background: transparent;
  height: 38px;
  padding: 0 12px;
  font-weight: 600;
  font-size: var(--fs-l);
  min-width: 0;
  max-width: 300px;
  cursor: pointer;
}
#lab-view .picker:focus-within { border-color: var(--accent); }
#lab-view .picker select:focus-visible { outline: none; }
#lab-view .top-actions { display: flex; align-items: center; gap: 8px; }

/* ================= botões ================= */
#lab-view .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 34px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--panel);
  font-weight: 500;
  font-size: var(--fs-m);
  cursor: pointer;
  white-space: nowrap;
  transition: background .12s, border-color .12s, color .12s;
}
#lab-view .btn:hover { border-color: var(--faint); background: var(--panel-2); }
#lab-view .btn:active { transform: translateY(1px); }
#lab-view .btn:disabled { opacity: .4; cursor: default; transform: none; }
#lab-view .btn:disabled:hover { background: var(--panel); border-color: var(--line); }
#lab-view .btn-primary,
#lab-view #btnPlay,
#lab-view #btnGo {
  background: var(--accent, #c2410c) !important;
  border-color: var(--accent, #c2410c) !important;
  color: var(--accent-ink, #ffffff) !important;
  font-weight: 600;
  min-width: 116px;
}
#lab-view .btn-primary:hover,
#lab-view #btnPlay:hover,
#lab-view #btnGo:hover {
  background: color-mix(in srgb, var(--accent, #c2410c) 88%, #000) !important;
  border-color: var(--ink, #16181b) !important;
  color: var(--accent-ink, #ffffff) !important;
}
#lab-view .btn-icon { width: 34px; padding: 0; font-weight: 600; }
#lab-view .btn-sm { height: 28px; padding: 0 10px; font-size: var(--fs-s); min-width: 0; }
#lab-view .btn-ghost { border-color: transparent; background: transparent; }
#lab-view .btn-group { display: inline-flex; }
#lab-view .btn-group .btn { border-radius: 0; }
#lab-view .btn-group .btn:first-child { border-radius: var(--r) 0 0 var(--r); }
#lab-view .btn-group .btn:last-child { border-radius: 0 var(--r) var(--r) 0; margin-left: -1px; }
#lab-view .ic { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
#lab-view #btnPlay .ic { fill: currentColor; stroke: none; }
#lab-view #btnPlay .ic-pause { display: none; }
#lab-view #btnPlay.running .ic-play { display: none; }
#lab-view #btnPlay.running .ic-pause { display: inline; }

#lab-view .seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--panel); }
#lab-view .seg button {
  border: 0;
  background: none;
  height: 32px;
  padding: 0 10px;
  font-size: var(--fs-s);
  font-weight: 500;
  cursor: pointer;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
#lab-view .seg button + button { border-left: 1px solid var(--line); }
#lab-view .seg button:hover { color: var(--ink); background: var(--panel-2); }
#lab-view .seg button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
#lab-view .seg-sm button { height: 28px; padding: 0 9px; }

#lab-view .seg-stage-mode {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  background: var(--panel-2);
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
#lab-view .stage-mode-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 11px;
  font: 600 var(--fs-s) var(--font-body);
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: all .14s;
}
#lab-view .stage-mode-btn .ic { width: 14px; height: 14px; }
#lab-view .stage-mode-btn:hover { color: var(--ink); background: var(--panel); }
#lab-view .stage-mode-btn[aria-checked="true"] {
  background: var(--panel);
  color: var(--accent);
  box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 0 0 1px var(--line);
}
#lab-view .stage-mode-btn#btnModeSim[aria-checked="true"] .ic { fill: currentColor; stroke: none; }

#lab-view .excite-group { display: inline-flex; align-items: center; gap: 5px; margin-left: auto; }
#lab-view .btn-excite {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--ink);
  font-weight: 500;
  transition: all .12s;
  padding: 0 9px;
  height: 28px;
  font-size: var(--fs-s);
}
#lab-view .btn-excite:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-1px);
}
#lab-view .btn-excite .ic { width: 13px; height: 13px; }
#lab-view .btn-excite[aria-pressed="true"] {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}

/* ================= área de montagem ================= */
#lab-view .stage {
  grid-area: stage;
  position: relative;
  height: auto;
  background-image: none;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}
#lab-view .stage-head {
  display: flex;
  align-items: center;
  gap: 8px 14px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
  min-width: 0;
}
#lab-view .modes-switch { display: inline-flex; padding: 3px; gap: 2px; background: var(--panel-2); border-radius: 10px; flex: none; }
#lab-view .mswitch {
  display: inline-flex; align-items: center; gap: 7px;
  border: 0; background: none; cursor: pointer;
  padding: 6px 12px; border-radius: 7px;
  font-weight: 600; font-size: var(--fs-m); color: var(--muted);
  transition: background .18s, color .18s, box-shadow .18s;
}
#lab-view .mswitch svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
#lab-view .mswitch:hover { color: var(--ink); }
#lab-view .mswitch[aria-selected="true"] { background: var(--panel); color: var(--accent); box-shadow: 0 1px 2px rgba(0, 0, 0, .08), 0 0 0 1px var(--line); }
#lab-view .clock { display: flex; align-items: baseline; gap: 5px; font-variant-numeric: tabular-nums; flex: none; }
#lab-view .clock-label { font: italic 500 15px var(--font-body); color: var(--muted); }
#lab-view #hudTime { font: 600 19px/1 var(--font-mono); letter-spacing: -.02em; }
#lab-view .clock-unit { color: var(--muted); font-family: var(--font-mono); }
#lab-view .stage[data-mode="build"] .clock { display: none; }
#lab-view .hint {
  margin: 0;
  flex: 1 1 200px;
  min-width: 0;
  font-size: var(--fs-s);
  line-height: 1.35;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
#lab-view .hint b { color: var(--ink); font-weight: 600; }
#lab-view .hint[data-toast] { color: var(--ink); animation: hintIn .35s ease; }
#lab-view .hint[data-toast]::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-right: 8px; vertical-align: 1px; }
@keyframes hintIn { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }
#lab-view .stage-chips { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; margin-left: auto; }
#lab-view .chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 0;
  font: 500 var(--fs-xs)/1 var(--font-mono);
  padding: 6px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
#lab-view .chip-btn { cursor: pointer; }
#lab-view .chip-btn:hover { color: var(--ink); border-color: var(--faint); }
#lab-view .chip-btn.off { text-decoration: line-through; opacity: .75; }
#lab-view .chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); flex: none; }
#lab-view .chip.good .dot { background: var(--good); box-shadow: 0 0 0 3px color-mix(in srgb, var(--good) 20%, transparent); }
#lab-view .chip.warn .dot { background: var(--warn); }
#lab-view .chip.bad .dot { background: var(--bad); }
#lab-view .chip-mode { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); font-weight: 600; }
#lab-view .chip-warn {
  color: var(--warn);
  border-color: var(--warn);
  background: color-mix(in srgb, var(--warn) 15%, transparent);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
#lab-view .chip-warn .ic { width: 13px; height: 13px; stroke: var(--warn); stroke-width: 2.2; }

#lab-view .stage-canvas { position: relative; min-height: 0; background: var(--canvas); overflow: hidden; }
#lab-view #scene { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; display: block; }
#lab-view .stage[data-mode="build"] .stage-canvas { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent); }

/* barra de ações da peça selecionada */
#lab-view .sel-pill {
  position: absolute;
  left: 0; top: 0;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  white-space: nowrap;
  z-index: 3;
  animation: pillIn .18s ease-out;
  will-change: transform;
}
@keyframes pillIn { from { opacity: 0; scale: .92; } to { opacity: 1; scale: 1; } }
#lab-view .sel-pill .pname { font: 600 var(--fs-xs) var(--font-mono); color: var(--muted); padding: 0 8px 0 6px; }
#lab-view .sel-pill button {
  display: inline-flex; align-items: center; gap: 5px;
  height: 28px; padding: 0 8px;
  border: 0; border-radius: 7px; background: none;
  font-size: var(--fs-s); font-weight: 500; color: var(--ink);
  cursor: pointer;
}
#lab-view .sel-pill button svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
#lab-view .sel-pill button:hover { background: var(--panel-2); }
#lab-view .sel-pill button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); }
#lab-view .sel-pill button.danger:hover { color: var(--bad); background: color-mix(in srgb, var(--bad) 12%, transparent); }
#lab-view .sel-pill .psep { width: 1px; align-self: stretch; margin: 4px 2px; background: var(--line); }

#lab-view .stage-foot {
  display: flex;
  align-items: center;
  gap: 10px 14px;
  padding: 8px 10px;
  border-top: 1px solid var(--line);
  min-width: 0;
}
#lab-view .foot-pane { display: none; align-items: center; gap: 8px 10px; flex: 1 1 auto; min-width: 0; flex-wrap: wrap; }
#lab-view .stage[data-mode="build"] .foot-build,
#lab-view .stage[data-mode="test"] .foot-test { display: flex; animation: paneIn .25s ease-out; }
@keyframes paneIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
#lab-view .seg-speed { margin-left: 4px; }
#lab-view .rate { font: 400 var(--fs-xs)/1.3 var(--font-mono); color: var(--muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1 1 120px; }
#lab-view .rate.warn { color: var(--warn); }

#lab-view .tray { display: flex; align-items: stretch; gap: 4px; flex-wrap: wrap; }
#lab-view .tray-sep { width: 1px; background: var(--line); margin: 4px 4px; }
#lab-view .part {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 11px 0 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel);
  font-size: var(--fs-s);
  font-weight: 500;
  color: var(--ink);
  cursor: grab;
  touch-action: none;
  user-select: none;
  transition: transform .15s, box-shadow .15s, border-color .15s, background .15s;
}
#lab-view .part svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#lab-view .part[data-part="mass"] svg rect { fill: var(--mass); stroke: var(--mass); }
#lab-view .part:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--faint); }
#lab-view .part:active { cursor: grabbing; }
#lab-view .part.armed { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
#lab-view .part.link.current { border-color: var(--accent); box-shadow: inset 0 -2px 0 var(--accent); }
#lab-view .part.dragging { opacity: .45; }
#lab-view .auto-link { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-s); color: var(--muted); cursor: pointer; user-select: none; margin: 0; }
#lab-view .auto-link input { accent-color: var(--accent); margin: 0; }
#lab-view .btn-go { margin-left: auto; min-width: 0; }
#lab-view .btn-go .ic { fill: none; stroke: currentColor; stroke-width: 2.2; }

/* fantasma que acompanha o ponteiro ao arrastar da bandeja */
.drag-ghost,
#lab-view .drag-ghost {
  position: fixed;
  left: 0; top: 0;
  pointer-events: none;
  z-index: 60;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px;
  border-radius: 9px;
  background: var(--panel, #fff);
  border: 1px solid var(--accent, #0a7a6d);
  box-shadow: var(--shadow, 0 4px 12px rgba(0,0,0,.15));
  font-size: var(--fs-s, 12px); font-weight: 600; color: var(--accent, #0a7a6d);
}
.drag-ghost svg,
#lab-view .drag-ghost svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

#lab-view .view-tools { display: flex; gap: 2px; padding: 2px; border: 1px solid var(--line); border-radius: var(--r); flex: none; }
#lab-view .vbtn {
  width: 32px; height: 30px;
  display: grid; place-items: center;
  border: 0; border-radius: 6px;
  background: none; color: var(--muted);
  cursor: pointer;
}
#lab-view .vbtn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
#lab-view .vbtn:hover { background: var(--panel-2); color: var(--ink); }
#lab-view .vbtn.toggle[aria-pressed="true"] { color: var(--accent); background: var(--accent-soft); }

/* ================= gráficos ================= */
#lab-view .dock {
  grid-area: dock;
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}
#lab-view .dock-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  min-width: 0;
}
#lab-view .tabs {
  display: inline-flex;
  gap: 2px;
  margin: 0;
  border-bottom: 0;
  padding: 3px;
  background: var(--panel-2);
  border-radius: 10px;
  overflow-x: auto;
  min-width: 0;
  scrollbar-width: none;
}
#lab-view .tab,
#lab-view .itab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  margin: 0;
  background: none;
  padding: 6px 12px;
  font: 500 var(--fs-s) var(--font-body);
  color: var(--muted);
  cursor: pointer;
  border-radius: 7px;
  white-space: nowrap;
  transition: background .12s, color .12s;
}
#lab-view .tab .ic,
#lab-view .itab .ic {
  width: 14px;
  height: 14px;
  stroke-width: 2;
  opacity: .85;
}
#lab-view .tab[aria-selected="true"] .ic,
#lab-view .itab[aria-selected="true"] .ic {
  stroke: var(--accent);
  opacity: 1;
}
#lab-view .tab:hover,
#lab-view .itab:hover { color: var(--ink); }
#lab-view .tab[aria-selected="true"],
#lab-view .itab[aria-selected="true"] { background: var(--panel); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(0, 0, 0, .08), 0 0 0 1px var(--line); }
#lab-view .observed { margin-left: auto; font: 500 var(--fs-xs) var(--font-mono); color: var(--muted); white-space: nowrap; }
#lab-view .observed b { color: var(--accent); font-weight: 600; }
#lab-view .dock-bridge { display: inline-flex; align-items: center; gap: 6px; flex: none; }
#lab-view .dock-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 240px; }
#lab-view .chart-wrap { position: relative; min-width: 0; min-height: 0; }
#lab-view #chart { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#lab-view .readouts {
  margin: 0;
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 12px 14px;
  overflow-y: auto;
  font-size: var(--fs-s);
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
#lab-view .ro-desc { margin: 0; color: var(--muted); line-height: 1.4; }
#lab-view .ro-block { display: flex; flex-direction: column; gap: 5px; }
#lab-view .ro-block + .ro-block { border-top: 1px solid var(--line); padding-top: 10px; }
#lab-view .ro { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
#lab-view .ro .k { color: var(--muted); }
#lab-view .ro.stack { flex-direction: column; gap: 2px; }
#lab-view .ro.stack .v { text-align: left; font-family: var(--font-body); }
#lab-view .ro .v { font: 500 var(--fs-s) var(--font-mono); font-variant-numeric: tabular-nums; text-align: right; }
#lab-view .ro-title { font: 600 10px/1.2 var(--font-mono); text-transform: uppercase; letter-spacing: .1em; color: var(--faint); }
#lab-view .legend { display: flex; flex-direction: column; gap: 4px; }
#lab-view .legend span { display: flex; align-items: center; gap: 8px; line-height: 1.3; }
#lab-view .legend i { width: 16px; height: 3px; border-radius: 2px; display: inline-block; flex: none; }
#lab-view .legend i.dash { background: repeating-linear-gradient(90deg, var(--ink) 0 5px, transparent 5px 8px) !important; }

/* ================= inspetor ================= */
#lab-view .inspector {
  grid-area: insp;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
#lab-view .insp-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  margin: 10px 12px 0;
  padding: 3px;
  background: var(--panel-2);
  border-radius: 10px;
}
#lab-view .itab { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 7px 6px; }
#lab-view .badge {
  font: 600 10px/1 var(--font-mono);
  padding: 3px 5px;
  border-radius: 5px;
  background: var(--accent-soft);
  color: var(--accent);
}
#lab-view .insp-body { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 0 12px; }
#lab-view .ipanel { display: flex; flex-direction: column; }
#lab-view .sec { padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
#lab-view .sec + .sec { border-top: 1px solid var(--line); }
#lab-view .ipanel h2 { margin: 0; font: 600 var(--fs-xl)/1.2 var(--font-display); letter-spacing: .005em; text-wrap: balance; }
#lab-view .ipanel h3 {
  margin: 0;
  font: 600 10px/1.2 var(--font-mono);
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--faint);
}
#lab-view .ipanel p { margin: 0; max-width: 62ch; }
#lab-view .ipanel .lead { color: var(--ink); line-height: 1.5; }
#lab-view .theory {
  font: 400 var(--fs-s)/1.55 var(--font-mono);
  background: var(--panel-2);
  border-radius: var(--r);
  padding: 10px 12px;
  border-left: 3px solid var(--accent);
}
#lab-view .sec-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
#lab-view .sec-head .sub { color: var(--muted); font-size: var(--fs-s); }
#lab-view .tag {
  font: 600 10px/1 var(--font-mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 5px 7px;
  border-radius: 5px;
  background: var(--panel-2);
  color: var(--muted);
  white-space: nowrap;
}
#lab-view .tag.accent { background: var(--accent-soft); color: var(--accent); }

#lab-view .empty {
  padding: 28px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  color: var(--muted);
}
#lab-view .empty svg { width: 40px; height: 40px; fill: none; stroke: var(--faint); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
#lab-view .empty b { color: var(--ink); font-size: var(--fs-l); }

#lab-view .param { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; }
#lab-view .param label { font-size: var(--fs-s); color: var(--muted); min-width: 0; margin: 0; }
#lab-view .param label b { color: var(--ink); font: italic 600 var(--fs-m) var(--font-body); margin-right: 5px; }
#lab-view .num { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 7px; background: var(--canvas); overflow: hidden; }
#lab-view .num:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
#lab-view .num input {
  width: 84px;
  height: 30px;
  border: 0;
  background: transparent;
  padding: 0 8px;
  text-align: right;
  font: 500 var(--fs-m) var(--font-mono);
  font-variant-numeric: tabular-nums;
}
#lab-view .num input:focus { outline: none; box-shadow: none; }
#lab-view .num input[aria-invalid="true"] { color: var(--bad); }
#lab-view .num .unit {
  font: 400 var(--fs-xs) var(--font-mono);
  color: var(--muted);
  min-width: 52px;
  padding: 0 8px;
  align-self: stretch;
  display: flex;
  align-items: center;
  background: var(--panel-2);
  border-left: 1px solid var(--line);
}
#lab-view .param input[type="range"] { grid-column: 1 / -1; width: 100%; accent-color: var(--accent); margin: 2px 0 0; height: 16px; }
#lab-view .params { display: flex; flex-direction: column; gap: 14px; }

#lab-view .checks { display: flex; gap: 6px; flex-wrap: wrap; }
#lab-view .check {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--line); border-radius: 7px;
  padding: 6px 10px; cursor: pointer; font-size: var(--fs-s);
  user-select: none; margin: 0;
}
#lab-view .check input { accent-color: var(--accent); margin: 0; }
#lab-view .check:has(input:checked) { border-color: color-mix(in srgb, var(--accent) 50%, transparent); background: var(--accent-soft); }
#lab-view .row-actions { display: flex; flex-wrap: wrap; gap: 6px; }
#lab-view .live { display: grid; grid-template-columns: 1fr auto; gap: 5px 12px; font-size: var(--fs-s); background: var(--panel-2); border-radius: var(--r); padding: 10px 12px; }
#lab-view .live .k { color: var(--muted); }
#lab-view .live .v { font: 500 var(--fs-s) var(--font-mono); text-align: right; font-variant-numeric: tabular-nums; }
#lab-view .stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
#lab-view .stat { background: var(--panel-2); border-radius: var(--r); padding: 9px 10px; display: flex; flex-direction: column; gap: 3px; }
#lab-view .stat b { font: 600 18px/1 var(--font-mono); font-variant-numeric: tabular-nums; }
#lab-view .stat span { font-size: var(--fs-xs); color: var(--muted); }
#lab-view .note { font-size: var(--fs-s); color: var(--muted); line-height: 1.45; }

#lab-view .defaults > summary {
  cursor: pointer;
  font-size: var(--fs-s);
  color: var(--muted);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
#lab-view .defaults > summary::-webkit-details-marker { display: none; }
#lab-view .defaults > summary::before { content: "▸"; font-size: 10px; transition: transform .15s; }
#lab-view .defaults[open] > summary::before { transform: rotate(90deg); }
#lab-view .defaults > summary:hover { color: var(--ink); }
#lab-view .defaults[open] > summary { margin-bottom: 12px; }
#lab-view .defaults .param + .param { margin-top: 14px; }

#lab-view .modes { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
#lab-view .mode-row {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  font-size: var(--fs-s);
}
#lab-view .mode-row + .mode-row { border-top: 1px solid var(--line); }
#lab-view .mode-row:hover { background: var(--panel-2); }
#lab-view .mode-row.on { background: var(--accent-soft); }
#lab-view .mode-row .idx { font: 600 var(--fs-xs) var(--font-mono); color: var(--faint); text-align: right; }
#lab-view .mode-row .fr { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
#lab-view .mode-row .fr b { font: 600 var(--fs-m) var(--font-mono); font-variant-numeric: tabular-nums; }
#lab-view .mode-row .fr small { color: var(--muted); font: 400 var(--fs-xs) var(--font-mono); }
#lab-view .mode-row .acts { display: flex; gap: 4px; }
#lab-view .status { font-size: var(--fs-s); color: var(--muted); display: flex; gap: 8px; align-items: flex-start; }
#lab-view .status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--good); margin-top: 5px; flex: none; }
#lab-view .status.bad { color: var(--bad); }
#lab-view .status.bad::before { background: var(--bad); }

/* ================= montador guiado ================= */
#lab-view .guide { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; font-size: var(--fs-s); counter-reset: g; }
#lab-view .guide .gstep { border-radius: 0; justify-content: center; position: relative; }
#lab-view .guide .gstep:first-child { border-radius: 999px 0 0 999px; }
#lab-view .guide .gstep:last-child { border-radius: 0 999px 999px 0; }
#lab-view .guide .gstep + .gstep { border-left: 2px solid var(--panel); }
#lab-view .gstep { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px 4px 4px; border-radius: 999px; background: var(--panel-2); color: var(--ink); font-weight: 500; }
#lab-view .gstep b { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font: 600 11px/1 var(--font-mono); }
#lab-view .garrow { color: var(--faint); }

#lab-view .orient { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
#lab-view .ocard {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 10px 6px 9px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--panel);
  cursor: pointer; text-align: center; color: var(--ink);
  transition: border-color .15s, background .15s, transform .15s;
}
#lab-view .ocard:hover { border-color: var(--faint); transform: translateY(-1px); }
#lab-view .ocard[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
#lab-view .ocard b { font-size: var(--fs-s); font-weight: 600; }
#lab-view .ocard small { font-size: 10.5px; color: var(--muted); line-height: 1.25; }
#lab-view .oicon svg { width: 48px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
#lab-view .ocard[aria-pressed="true"] .oicon svg { stroke: var(--accent); }

#lab-view .row2 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
#lab-view .stepper { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
#lab-view .stepper .btn { width: 30px; height: 30px; font-size: 18px; border: 0; padding: 0; }
#lab-view .stepv { min-width: 84px; text-align: center; font-size: var(--fs-s); color: var(--muted); }
#lab-view .stepv b { font: 600 18px var(--font-mono); color: var(--ink); margin-right: 2px; }

#lab-view .chainlist { position: relative; display: flex; flex-direction: column; gap: 6px; padding-left: 18px; }
#lab-view .chainlist::before { content: ""; position: absolute; left: 6px; top: 12px; bottom: 12px; width: 2px; background: var(--line); border-radius: 2px; }
#lab-view .cl-node { position: relative; display: flex; align-items: center; gap: 10px; font-size: var(--fs-s); min-height: 32px; }
#lab-view .cl-dot { position: absolute; left: -17px; width: 12px; height: 12px; border-radius: 3px; background: var(--mass); border: 2px solid var(--panel); }
#lab-view .cl-node.wall { color: var(--muted); font-style: italic; }
#lab-view .cl-node.wall .cl-dot { background: repeating-linear-gradient(135deg, var(--faint) 0 2px, var(--panel) 2px 4px); border-radius: 2px; border-color: var(--faint); }
#lab-view .cl-node.mass { background: var(--panel-2); border-radius: 8px; padding: 6px 8px; }
#lab-view .cl-node.mass b { font: 600 var(--fs-m) var(--font-mono); min-width: 26px; }
#lab-view .cl-node.mass .cl-dot { left: -17px; }
#lab-view .cl-link { display: grid; gap: 5px; padding: 6px 0 6px 2px; }
#lab-view .cl-tag { font: 600 9.5px/1 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }
#lab-view .cl-parts { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
#lab-view .cl-part {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: var(--fs-s); cursor: pointer; user-select: none;
  padding: 4px 9px 4px 7px; border-radius: 7px; border: 1px solid var(--line);
  min-width: 0; margin: 0;
}
#lab-view .cl-part input { accent-color: var(--accent); margin: 0; }
#lab-view .cl-part i { font: italic 500 var(--fs-xs) var(--font-mono); color: var(--muted); }
#lab-view .cl-part.on { border-color: color-mix(in srgb, var(--accent) 50%, transparent); background: var(--accent-soft); }
#lab-view .num-sm input { width: 70px; height: 28px; }
#lab-view .num-sm .unit { min-width: 46px; }
#lab-view .num.off { opacity: .4; }

#lab-view .exfields { display: flex; flex-direction: column; gap: 8px; }
#lab-view .exrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: var(--fs-s); color: var(--muted); flex-wrap: wrap; }
#lab-view .btn-big { width: 100%; height: 42px; font-size: var(--fs-l); gap: 10px; }
#lab-view .play-ic { width: 0; height: 0; border-left: 11px solid currentColor; border-top: 7px solid transparent; border-bottom: 7px solid transparent; }

#lab-view .formulas { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
#lab-view .fx { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1px 10px; padding: 7px 10px; align-items: baseline; }
#lab-view .fx + .fx { border-top: 1px solid var(--line); }
#lab-view .fx-l { grid-column: 1 / -1; font-size: 10.5px; color: var(--faint); text-transform: uppercase; letter-spacing: .06em; font-family: var(--font-mono); }
#lab-view .fx-e { font: 400 var(--fs-s)/1.4 var(--font-mono); color: var(--muted); min-width: 0; overflow-wrap: anywhere; }
#lab-view .fx-v { font: 600 var(--fs-m) var(--font-mono); color: var(--ink); white-space: nowrap; font-variant-numeric: tabular-nums; }
#lab-view .mats { display: flex; flex-wrap: wrap; gap: 10px 16px; }
#lab-view .mat { display: flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: var(--fs-xs); }
#lab-view .mat-n { font-weight: 600; font-size: var(--fs-s); }
#lab-view .mat table { border-collapse: collapse; border-left: 1.5px solid var(--ink); border-right: 1.5px solid var(--ink); border-radius: 3px; }
#lab-view .mat td { padding: 2px 6px; text-align: right; font-variant-numeric: tabular-nums; }
#lab-view .mat-u { color: var(--muted); }
#lab-view .more { display: flex; flex-direction: column; gap: 12px; }
#lab-view .chip-edit { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); font-weight: 600; }

/* ================= modais ================= */
#lab-view .modal {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-items: center;
  background: rgba(8, 12, 18, .5);
  padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
}
#lab-view .modal-card {
  width: min(560px, 100%);
  max-height: 100%;
  overflow: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 16px 18px 18px;
  display: flex; flex-direction: column; gap: 12px;
}
#lab-view .modal-card.wide { width: min(880px, 100%); }
#lab-view .modal-card header { display: flex; align-items: center; justify-content: space-between; }
#lab-view .modal-card h2 { margin: 0; font: 600 20px var(--font-display); }
#lab-view .modal-card h3 { margin: 10px 0 6px; font: 600 10px var(--font-mono); text-transform: uppercase; letter-spacing: .1em; color: var(--faint); }
#lab-view .modal-card p { margin: 0; }
#lab-view .modal-card ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 5px; }
#lab-view .modal-card textarea {
  display: block;
  width: 100%; min-height: 220px; resize: vertical;
  border: 1px solid var(--line); border-radius: var(--r);
  background: var(--canvas);
  font: 400 var(--fs-xs)/1.4 var(--font-mono);
  padding: 10px;
}
#lab-view .help-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 4px 28px; }
#lab-view .keys { border-collapse: collapse; font-size: var(--fs-s); }
#lab-view .keys td { padding: 4px 12px 4px 0; vertical-align: top; }
#lab-view .msg { font-size: var(--fs-s); min-height: 1.2em; }
#lab-view .msg.bad { color: var(--bad); }
#lab-view .msg.good { color: var(--good); }

/* ================= larguras menores ================= */
@media (max-width: 1240px) {
  #lab-view .lab-app { grid-template-columns: minmax(0, 1fr) 320px; }
  #lab-view .dock-body { grid-template-columns: minmax(0, 1fr) 210px; }
  #lab-view .brand .sub { display: none; }
  #lab-view .top-actions .btn span { display: none; }
  #lab-view .top-actions .btn { width: 34px; padding: 0; }
}
@media (max-width: 900px) {
  #lab-view .lab-app {
    height: auto;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto 62vh auto auto;
    grid-template-areas: "top" "stage" "insp" "dock";
  }
  #lab-view .lab-topbar { gap: 10px; }
  #lab-view .picker { margin-left: 0; flex: 1 1 100%; order: 3; }
  #lab-view .picker select { max-width: none; flex: 1; }
  #lab-view .top-actions { margin-left: auto; }
  #lab-view .stage-foot { flex-wrap: wrap; }
  #lab-view .part span { display: none; }
  #lab-view .part { padding: 0 9px; }
  #lab-view .rate { display: none; }
  #lab-view .inspector { overflow: visible; }
  #lab-view .insp-body { overflow: visible; }
  #lab-view .dock-head { flex-wrap: wrap; }
  #lab-view .tabs { flex-wrap: wrap; }
  #lab-view .dock-body { display: block; }
  #lab-view .chart-wrap { height: 240px; }
  #lab-view .readouts { border-left: 0; border-top: 1px solid var(--line); }
  #lab-view .ro-desc { display: none; }
}
@media (max-width: 480px) {
  #lab-view .seg-speed button { padding: 0 7px; }
  #lab-view .btn-primary { min-width: 0; }
  #lab-view .hint { flex-basis: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  #lab-view .btn, #lab-view .tab, #lab-view .itab, #lab-view .part, #lab-view .mswitch, #lab-view .sel-pill, #lab-view .foot-pane { transition: none; animation: none; }
}
