/* MonitorMan — identidade visual própria */

/* Fonte Inter (variável, pesos 100–900) servida localmente — licença SIL OFL 1.1 em css/fonts/OFL.txt.
   Fica em /css/ para estar disponível também na tela de login (rota pública). */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("fonts/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("fonts/inter-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* >>> desenho-do-mapa: as regras desta faixa (até “<<< desenho-do-mapa”) também vão na imagem SVG do mapa
   compartilhado, que não pode carregar este arquivo: o servidor as copia daqui (src/share/styles.js). Regra
   nova do desenho do mapa (grade, fundo, elementos, links) entra numa dessas faixas; um teste confere */
:root {
  --ink: #14213d;
  --ink-2: #2b3a55;
  --muted: #5e6b80;
  --line: #d7dde6;
  --bg: #eef1f5;
  --surface: #ffffff;
  --accent: #0f8f86;
  --accent-2: #2ec4b6;
  --accent-ink: #ffffff;
  --danger: #c2372f;
  --st-online: #1f9d55;
  --st-warning: #d89a00;
  --st-offline: #d23f3f;
  --st-unknown: #8a94a6;
  --st-paused: #6b7280;
  /* A cor da marca: a barra superior, os toasts, o fundo da tela de entrada e o terminal, iguais nos dois
     temas (o --ink é o texto, que fica claro no tema escuro) */
  --brand: #14213d;
  /* Tons de apoio (seção 2.3 do DESIGN.md) que o tema escuro troca. Os do desenho do mapa ficam aqui, na
     faixa que vai para a imagem do mapa compartilhado; os só da interface, no bloco logo abaixo */
  --stage: #fbfcfd;
  --grid: #e6eaf0;
  --grid-major: #d3d9e2;
  --node: #ffffff;
  --badge-ring: #ffffff;
  --label-halo: rgba(255, 255, 255, .92);
  --submap-fill: #eef4ff;
  --submap-glyph: #2f5bb7;
  --object-line: rgba(20, 33, 61, .35);
  --online-soft: #e5f5ec;
  --warning-soft: #fff4d6;
  --warning-ink: #6b4b00;
  --warn-line: #f1dc9c;
  --offline-soft: #fde8e7;
  --neutral-soft: #f1f4f8;
  --selected: #e2f6f4;
  --radius: 10px;
  --shadow: 0 8px 28px rgba(20, 33, 61, .14), 0 2px 6px rgba(20, 33, 61, .08);
  --topbar-h: 56px;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  font-size: 15px;
}
/* <<< desenho-do-mapa */
:root {
  --surface-2: #f6f8fb;
  --input: #ffffff;
  --hover: #f4f6f9;
  --menu-hover: #eef6f5;
  --row-hover: #f8fafc;
  --line-strong: #c4ccd8;
  --accent-hover: #0c7a72;
  --danger-ink: #ffffff;
  --danger-hover: #fdf0ef;
  --danger-line: #efc4c1;
  --selected-ink: #0b6c65;
  --online-ink: #11602f;
  --offline-ink: #8f1f19;
  --warn-bg: #fff6dc;
  --warn-ink: #5c4300;
  --error-bg: #fdecea;
  --error-ink: #7a1d17;
  --error-line: #f3c0bb;
  --viewer-soft: #eef2f7;
  --viewer-ink: #4a5872;
  --bad: var(--st-offline);
  --float: rgba(255, 255, 255, .96);
  --backdrop: rgba(20, 33, 61, .38);
  --shadow-menu: 0 12px 32px rgba(20, 33, 61, .22), 0 0 0 1px rgba(20, 33, 61, .06);
}
/* Tema escuro (Minha conta → Tema; public/js/theme.js põe data-theme no <html> antes de a página
   aparecer). Troca só os valores das variáveis: as regras são as mesmas nos dois temas. Ficam iguais a
   cor da marca, as cores de estado, o --accent-2 e o que fica sobre a barra superior e sobre as cores de
   estado. Fora da faixa do desenho do mapa: o mapa compartilhado continua claro */
:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #e6ebf3;
  --ink-2: #c3cddc;
  --muted: #95a3b9;
  --line: #283550;
  --bg: #0d1422;
  --surface: #151e30;
  --accent: #3dbdb1;
  --accent-ink: #062320;
  --danger: #f2766e;
  --stage: #0f1726;
  --grid: #182234;
  --grid-major: #222e45;
  --node: #1a2539;
  --badge-ring: #0f1726;
  --label-halo: rgba(15, 23, 38, .92);
  --submap-fill: #1a2846;
  --submap-glyph: #92b2ff;
  --object-line: rgba(230, 235, 243, .3);
  --online-soft: #123222;
  --warning-soft: #36290a;
  --warning-ink: #f1d27e;
  --warn-line: #6a5418;
  --offline-soft: #3b1a1d;
  --neutral-soft: #202b40;
  --selected: #14393a;
  --shadow: 0 8px 28px rgba(0, 0, 0, .45), 0 2px 6px rgba(0, 0, 0, .3);
  --surface-2: #111a2a;
  --input: #0f1828;
  --hover: #1d2840;
  --menu-hover: #17302f;
  --row-hover: #19233a;
  --line-strong: #3b4a66;
  --accent-hover: #5fcdc2;
  --danger-ink: #2b0806;
  --danger-hover: #341a1d;
  --danger-line: #7a3a36;
  --selected-ink: #7fdcd2;
  --online-ink: #8bdcaa;
  --offline-ink: #f6a9a3;
  --warn-bg: #30260b;
  --warn-ink: #f0d68c;
  --error-bg: #361719;
  --error-ink: #f6b2ac;
  --error-line: #7a2f2b;
  --viewer-soft: #1f2a3f;
  --viewer-ink: #b2bed2;
  --bad: #f4847c;
  --float: rgba(21, 30, 48, .96);
  --backdrop: rgba(4, 8, 16, .6);
  --shadow-menu: 0 12px 32px rgba(0, 0, 0, .5), 0 0 0 1px rgba(255, 255, 255, .07);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); }
button, input, select, textarea { font: inherit; color: inherit; }
code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .9em; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--accent-2); outline-offset: 2px; }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .45rem;
  height: 36px; padding: 0 .8rem; border-radius: 8px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  cursor: pointer; white-space: nowrap; font-weight: 500; transition: background .12s, border-color .12s;
}
.btn:hover { background: var(--hover); border-color: var(--line-strong); }
/* aria-disabled: o mesmo visual, mas continua no Tab e, clicado, diz por que não dá (o “Adicionar” com o mapa bloqueado) */
.btn:disabled, .btn[aria-disabled=true] { opacity: .55; cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-hover); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: var(--danger-ink); }
.btn.danger.ghost { background: transparent; color: var(--danger); border-color: var(--danger-line); }
.btn.danger.ghost:hover { background: var(--danger-hover); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.small { height: 28px; padding: 0 .6rem; font-size: .85rem; }
.btn.icon { width: 36px; padding: 0; justify-content: center; }
.btn.block { width: 100%; justify-content: center; height: 42px; }
.btn.active { background: var(--selected); border-color: var(--accent); color: var(--selected-ink); }
.linklike { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
kbd { font-size: .75em; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 4px; padding: 0 4px; background: var(--surface-2); color: var(--muted); }

/* ---------- Barra superior ---------- */
.app { display: flex; flex-direction: column; overflow: hidden; }
.topbar {
  height: var(--topbar-h); flex: none; display: flex; align-items: center; gap: .75rem;
  padding: 0 .75rem; background: var(--brand); color: #e8edf5; position: relative; z-index: 20;
}
.brand { display: flex; align-items: center; gap: .5rem; font-size: 1.1rem; letter-spacing: .01em; }
.brand strong { color: var(--accent-2); }
.brand.big { font-size: 1.6rem; justify-content: center; color: var(--ink); }
.topbar .btn { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.12); color: #e8edf5; }
.topbar .btn:hover { background: rgba(255,255,255,.14); }
.topbar .btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.topbar .btn.active { background: var(--accent-2); border-color: var(--accent-2); color: var(--brand); }
.topbar .btn.ghost { background: transparent; border-color: transparent; }
.toolbar { display: flex; gap: .4rem; }
#btn-kiosk, #btn-undo, #btn-lock { flex: none; } /* só ícone: não encolhe quando o topo aperta */
/* Botão de menu: só em telas de até 900 px, onde a barra lateral vira gaveta (ver o bloco de 900 px).
   Três linhas com a gaveta fechada; o X de fechar com ela aberta (aria-expanded) */
#btn-menu { display: none; flex: none; }
#btn-menu .ico-close, #btn-menu[aria-expanded=true] .ico-menu { display: none; }
#btn-menu[aria-expanded=true] .ico-close { display: block; }
#btn-lock .ico-locked { display: none; }
#btn-lock.active .ico-locked { display: block; }
#btn-lock.active .ico-unlocked { display: none; }

.search { position: relative; margin-left: auto; width: clamp(200px, 22vw, 300px); }
.search > svg { position: absolute; left: 10px; top: 9px; width: 18px; height: 18px; fill: none; stroke: #9fb0c8; stroke-width: 2; pointer-events: none; }
.search input {
  width: 100%; height: 36px; border-radius: 8px; border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.08); color: #fff; padding: 0 .75rem 0 2.1rem;
}
.search input::placeholder { color: #9fb0c8; }
.search input:focus { background: var(--input); color: var(--ink); outline: none; box-shadow: 0 0 0 3px rgba(46,196,182,.5); }
#search-results {
  position: absolute; top: 42px; left: 0; right: 0; margin: 0; padding: .3rem; list-style: none;
  background: var(--surface); color: var(--ink); border-radius: var(--radius); box-shadow: var(--shadow); max-height: 60vh; overflow: auto;
}
#search-results li { display: flex; align-items: center; gap: .5rem; padding: .45rem .5rem; border-radius: 6px; cursor: pointer; }
#search-results li[aria-selected=true], #search-results li:hover { background: var(--menu-hover); }
#search-results li.none { color: var(--muted); cursor: default; }
#search-results .sr-name { flex: 1; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#search-results code { color: var(--muted); font-size: .8rem; }
#search-results .status-pill { font-size: 0; gap: 0; padding: 0; background: none; }

.summary { display: flex; gap: .35rem; }
.chip { white-space: nowrap; display: inline-flex; align-items: center; gap: .35rem; height: 30px; padding: 0 .6rem; border-radius: 999px; background: rgba(255,255,255,.07); font-size: .85rem; }
.chip b { font-variant-numeric: tabular-nums; font-size: .95rem; }
.chip .dot { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: .7rem; font-weight: 800; color: #fff; }
.chip.st-online .dot { background: var(--st-online); }
.chip.st-warning .dot { background: var(--st-warning); color: #1d1600; }
.chip.st-offline .dot { background: var(--st-offline); }

/* ---------- Avisos fixos ---------- */
.banner { padding: .55rem 1rem; font-size: .9rem; flex: none; z-index: 15; }
.banner.error { background: var(--error-bg); color: var(--error-ink); border-bottom: 1px solid var(--error-line); }
.banner.warn { background: var(--warn-bg); color: var(--warn-ink); border-bottom: 1px solid var(--warn-line); }

/* ---------- Palco do mapa ---------- */
.stage { position: relative; flex: 1; min-height: 0; }
.map-wrap { position: absolute; inset: 0; }
.map { width: 100%; height: 100%; display: block; background: var(--stage); touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab; outline: none; }
.map.is-panning { cursor: grabbing; }
.map.is-dragging, .map.is-dragging * { cursor: grabbing !important; }
.map.mode-link { cursor: crosshair; }
.map.mode-link .device { cursor: pointer; }
/* >>> desenho-do-mapa */
.grid-fill { pointer-events: none; }
.map-image-backdrop { fill: #fff; filter: drop-shadow(0 1px 4px rgba(20,33,61,.18)); }
.map-image { image-rendering: auto; }
.grid-minor { fill: none; stroke: var(--grid); stroke-width: 1; }
.grid-major { fill: none; stroke: var(--grid-major); stroke-width: 1.4; }
.map-loading, .map-empty {
  position: absolute; left: 50%; top: 45%; transform: translate(-50%, -50%);
  background: var(--surface); padding: 1rem 1.25rem; border-radius: var(--radius); box-shadow: var(--shadow); text-align: center;
}
.map-empty { pointer-events: none; opacity: .95; }
.map-empty p { margin: .2rem 0; }

/* Equipamentos */
.device { cursor: pointer; outline: none; }
/* Tamanho da fonte (Configurações → Visuais): o nome, o IP e o aviso de interface fora do ar ou de VM
   parada usam as fontes abaixo vezes --font-scale, que paintNode (map.js) põe no elemento quando não é
   o Médio (1) */
/* Opacidade da cor de fundo (Configurações → Visuais), de 0 a 1: só o preenchimento da forma fica
   transparente; borda, ícone, badge e nome continuam opacos. As variáveis vêm de applyFillOpacity
   (map.js), no mapa e na prévia; sem elas, 1 (opaco, como sempre). A sombra some aos poucos entre 100% e
   60% (--shade de 1 a 0): vista através de um fundo transparente, ela escureceria a cor. */
.device { --fill-opacity: var(--device-fill-opacity, 1); --shade: clamp(0, (var(--fill-opacity) - .6) / .4, 1); }
.device.submap { --fill-opacity: var(--submap-fill-opacity, 1); }
.device.object { --fill-opacity: var(--object-fill-opacity, 1); }
.device .body { fill: var(--node); fill-opacity: var(--fill-opacity); stroke: var(--status, var(--st-unknown)); stroke-width: 4.5; filter: drop-shadow(0 2px 3px rgb(20 33 61 / calc(.25 * var(--shade)))); }
.device .glyph { color: var(--ink-2); pointer-events: none; }
.device .halo { fill: none; stroke: transparent; stroke-width: 4; }
.device .badge circle { fill: var(--status, var(--st-unknown)); stroke: var(--badge-ring); stroke-width: 2.5; }
.device .badge text { fill: #fff; font-size: 15px; font-weight: 800; pointer-events: none; }
.device.st-paused .badge text { font-size: 10px; letter-spacing: -1px; }
.device.st-warning .badge text { fill: #1d1600; }
.device .label {
  font-size: calc(19px * var(--font-scale, 1)); font-weight: 600; fill: var(--ink); paint-order: stroke; stroke: var(--label-halo);
  stroke-width: 5px; stroke-linejoin: round; pointer-events: none;
}
.device.st-online { --status: var(--st-online); }
.device.st-warning { --status: var(--st-warning); }
.device.st-offline { --status: var(--st-offline); }
.device.st-unknown { --status: var(--st-unknown); }
.device.st-paused { --status: var(--st-paused); }
.device.st-empty { --status: #b6bfcc; }
.device .sublabel { font-size: calc(14px * var(--font-scale, 1)); font-weight: 600; fill: var(--muted); paint-order: stroke; stroke: var(--label-halo); stroke-width: 4px; stroke-linejoin: round; pointer-events: none; letter-spacing: .02em; }
/* Submapa: anel duplo e fundo tingido para se diferenciar de um equipamento. Com a intensidade da cor
   do estado nos submapas acima de 0% (Configurações → Visuais), --state-fill vem de paintNode (map.js):
   o fundo de sempre do submapa (--submap-fill, que o tema escuro troca) misturado com a cor do estado (o
   pior de dentro); em 0%, fica o fundo de sempre */
.device.submap .body { fill: var(--state-fill, var(--submap-fill)); stroke-width: 4.5; }
.device.submap .halo { stroke: var(--status, var(--st-unknown)); stroke-opacity: .45; stroke-width: 3; }
.device.submap:hover .halo { stroke-opacity: .8; }
.device.submap.selected .halo, .device.submap:focus-visible .halo { stroke: var(--accent); stroke-opacity: 1; stroke-width: 4; }
.device.submap .glyph { color: var(--submap-glyph); }
.device.st-paused .body { stroke-dasharray: 6 4; }
.device.st-paused .glyph { opacity: .55; }
/* Fundo por estado do equipamento (o do submapa está acima; objeto não tem). --state-fill vem de
   paintNode (map.js): o tom suave (--online-soft e os outros, tons de apoio da seção 2.3 do DESIGN.md,
   que o tema escuro troca) misturado com a cor do estado conforme a intensidade da cor do estado nos
   equipamentos (Configurações → Visuais) */
.device:not(.submap):not(.object).st-online .body { fill: var(--state-fill, var(--online-soft)); }
.device:not(.submap):not(.object).st-warning .body { fill: var(--state-fill, var(--warning-soft)); }
.device:not(.submap):not(.object).st-offline .body { fill: var(--state-fill, var(--offline-soft)); }
.device:not(.submap):not(.object).st-unknown .body,
.device:not(.submap):not(.object).st-paused .body { fill: var(--state-fill, var(--neutral-soft)); }
.device:hover .halo { stroke: rgba(15,143,134,.25); }
.device.selected .halo, .device:focus-visible .halo { stroke: var(--accent); }
.device.link-source .halo { stroke: #2f6fde; stroke-dasharray: 5 4; animation: spin 6s linear infinite; }
.device.dragging .body { filter: drop-shadow(0 8px 10px rgba(20,33,61,.3)); }
.device.unsaved .label { fill: var(--danger); }
.device.pulse .halo { animation: pulse 0.8s ease-out 3; }
/* Recortado, à espera do “Colar”: esmaecido até ser colado (ou o recorte ser desfeito com Esc).
   No modo quiosque, que só exibe, o mapa aparece inteiro */
.device.cut { opacity: .45; }
body.kiosk .device.cut { opacity: 1; }
/* Aviso de interface monitorada fora do ar: pílula “! Gi0/2 fora do ar” abaixo do nome (tons da pill de atenção) */
.device .iface-alert rect { fill: var(--warning-soft); stroke: var(--warn-line); stroke-width: 1.5; }
.device .iface-alert circle { fill: var(--st-warning); }
.device .iface-alert .sym { fill: #1d1600; font-size: calc(12px * var(--font-scale, 1)); font-weight: 800; pointer-events: none; }
.device .iface-alert .txt { fill: var(--warning-ink); font-size: calc(14px * var(--font-scale, 1)); font-weight: 600; letter-spacing: .02em; pointer-events: none; }
@keyframes pulse { 0% { stroke: var(--accent-2); stroke-width: 14; } 100% { stroke: transparent; stroke-width: 2; } }
@keyframes spin { to { stroke-dashoffset: -90; } }
/* Alças de tamanho do elemento selecionado (updateHandles em map.js): moldura tracejada e quadradinhos
   brancos com borda no acento. Espessuras, tracejado e tamanhos vêm do JS, fixos na tela em qualquer zoom */
.size-frame { fill: none; stroke: var(--accent); pointer-events: none; }
.size-handle .hit { fill: transparent; }
.size-handle .knob { fill: var(--surface); stroke: var(--accent); pointer-events: none; }
.size-handle:hover .knob { fill: var(--selected); }
.size-handle.nwse { cursor: nwse-resize; }
.size-handle.nesw { cursor: nesw-resize; }
.size-handle.ns { cursor: ns-resize; }
.size-handle.ew { cursor: ew-resize; }
/* Caixa de seleção (Shift ou Ctrl + arrastar no mapa; moveBox em map.js): retângulo em pixels
   de tela, com a moldura tracejada das alças e um véu leve do acento, que deixa ver os elementos por
   baixo. Os elementos inteiros dentro dela já ganham o halo de selecionado durante o arraste */
.select-box { fill: var(--accent); fill-opacity: .08; stroke: var(--accent); stroke-width: 1; stroke-dasharray: 4 3; pointer-events: none; shape-rendering: crispEdges; }
.map.is-selecting, .map.is-selecting * { cursor: crosshair !important; }
/* Enquanto uma alça é arrastada, o cursor dela vale no mapa todo */
.map[data-resize=nwse], .map[data-resize=nwse] * { cursor: nwse-resize !important; }
.map[data-resize=nesw], .map[data-resize=nesw] * { cursor: nesw-resize !important; }
.map[data-resize=ns], .map[data-resize=ns] * { cursor: ns-resize !important; }
.map[data-resize=ew], .map[data-resize=ew] * { cursor: ew-resize !important; }

/* Links: --link-w é a espessura escolhida no link (map.js; 4 = Normal). A própria linha também
   recebe o clique, para a área de clique nunca ficar mais fina que uma linha grossa com zoom. */
.link-line { stroke-width: var(--link-w, 4px); stroke-linecap: round; fill: none; pointer-events: visibleStroke; cursor: pointer; }
.link-hit { stroke: transparent; stroke-width: 16px; vector-effect: non-scaling-stroke; cursor: pointer; fill: none; }
.map.mode-link .link-hit, .map.mode-link .link-line { pointer-events: none; }
.link:hover .link-line { stroke-width: calc(var(--link-w, 4px) + 2px); }
.link.selected .link-line { stroke-width: calc(var(--link-w, 4px) + 2.5px); filter: drop-shadow(0 0 3px rgba(46,196,182,.9)); }
.link-label {
  font-size: 17px; font-weight: 600; fill: var(--ink-2); paint-order: stroke; stroke: var(--label-halo);
  stroke-width: 5px; stroke-linejoin: round; pointer-events: none;
}
/* <<< desenho-do-mapa */

/* Destaque de mudança de status (paintHighlight em map.js; o que destacar vem de js/status-highlight.js):
   duas ondas na cor do estado novo saem da forma e somem, meio ciclo uma atrás da outra, numa camada
   abaixo dos elementos (#layer-highlights). Sem animação (prefers-reduced-motion, que zera as animações)
   e com muitos elementos em destaque (.hl-many), fica um anel parado no lugar delas. Fora da faixa do
   desenho do mapa: o mapa compartilhado não tem destaque */
.hl { pointer-events: none; }
.hl :is(.hl-wave, .hl-ring) { fill: none; stroke: var(--highlight, var(--st-unknown)); }
.hl[data-highlight=online] { --highlight: var(--st-online); }
.hl[data-highlight=warning] { --highlight: var(--st-warning); }
.hl[data-highlight=offline] { --highlight: var(--st-offline); }
.hl .hl-wave {
  stroke-width: 5; opacity: 0; transform-box: fill-box; transform-origin: center;
  animation: hl-wave 2s cubic-bezier(.2, .6, .4, 1) infinite;
}
.hl .hl-wave.hl-late { animation-delay: -1s; }
.hl .hl-ring { display: none; stroke-width: 5; }
.hl-many .hl .hl-wave { display: none; }
.hl-many .hl .hl-ring { display: inline; }
@keyframes hl-wave { 0% { opacity: .95; transform: scale(1); } 100% { opacity: 0; transform: scale(var(--wave-sx), var(--wave-sy)); } }
@media (prefers-reduced-motion: reduce) {
  .hl .hl-wave { display: none; }
  .hl .hl-ring { display: inline; }
}

/* Barra de modo */
.mode-bar {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 12;
  display: flex; align-items: center; gap: .75rem; padding: .5rem .6rem .5rem 1rem; border-radius: 999px;
  background: #2f6fde; color: #fff; box-shadow: var(--shadow); font-size: .95rem;
}
.mode-bar .btn { background: rgba(255,255,255,.15); color: #fff; border-color: rgba(255,255,255,.3); }
.mode-bar kbd { background: transparent; color: #dbe7ff; border-color: rgba(255,255,255,.4); }

/* Zoom e legenda */
.zoom-controls {
  position: absolute; right: 14px; bottom: 14px; z-index: 10; display: flex; flex-direction: column; gap: 4px; align-items: center;
  background: var(--surface); padding: 4px; border-radius: var(--radius); box-shadow: var(--shadow);
  transition: opacity .18s, visibility .18s; /* sai da frente dos avisos de mudança de status */
}
.zoom-controls .btn { border-color: transparent; }
.zoom-level { font-size: .72rem; color: var(--muted); font-variant-numeric: tabular-nums; padding-bottom: 2px; }
body.panel-open .zoom-controls { right: calc(var(--panel-width) + 14px); }
.legend {
  position: absolute; left: 14px; bottom: 14px; z-index: 10; max-width: 330px;
  background: var(--float); border-radius: var(--radius); box-shadow: var(--shadow); font-size: .82rem;
}
.legend summary { cursor: pointer; padding: .5rem .8rem; font-weight: 600; }
.legend ul { list-style: none; margin: 0; padding: 0 .8rem .3rem; display: grid; gap: .3rem; }
.legend li { display: flex; align-items: center; gap: .5rem; }
.legend-note { margin: .2rem .8rem .6rem; color: var(--muted); font-size: .76rem; }
.badge { flex: none; width: 20px; height: 20px; border-radius: 50%; display: inline-grid; place-items: center; color: #fff; font-size: .68rem; font-weight: 800; }
.badge.st-online, .status-pill.st-online .badge { background: var(--st-online); }
.status-pill.st-warning .badge { background: var(--st-warning); color: #1d1600; }
.status-pill.st-offline .badge { background: var(--st-offline); }
.status-pill.st-unknown .badge { background: var(--st-unknown); }
.status-pill.st-paused .badge { background: var(--st-paused); font-size: .5rem; letter-spacing: -1px; }
.badge.st-warning { background: var(--st-warning); color: #1d1600; }
.badge.st-offline { background: var(--st-offline); }
.badge.st-unknown { background: var(--st-unknown); }
.badge.st-paused { background: var(--st-paused); font-size: .5rem; letter-spacing: -1px; }
.badge.st-empty, .status-pill.st-empty .badge { background: #b6bfcc; }

/* ---------- Navegação entre mapas ---------- */
.map-nav {
  position: absolute; top: 12px; left: 14px; z-index: 13; display: flex; align-items: center; gap: .5rem; max-width: calc(100% - 28px);
  background: var(--float); border-radius: var(--radius); box-shadow: var(--shadow); padding: 4px 10px 4px 4px;
}
.map-nav .btn { border-color: transparent; }
.breadcrumb { list-style: none; display: flex; flex-wrap: wrap; align-items: center; margin: 0; padding: 0; font-size: .92rem; min-width: 0; }
.breadcrumb li { display: flex; align-items: center; min-width: 0; }
.breadcrumb li + li::before { content: "›"; color: var(--muted); margin: 0 .4rem; }
.breadcrumb a { color: var(--accent); text-decoration: none; font-weight: 500; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb [aria-current] span { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 40vw; }
.mode-bar { top: 64px; }
.workspace { flex: 1; min-height: 0; display: flex; position: relative; }
/* Largura escolhida arrastando a borda (--sidebar-w, posto por js/sidebar-resize.js): de 220 a 600 px,
   nunca mais que metade da janela; sem escolha, 290 px */
.sidebar {
  position: relative; flex: none; width: clamp(220px, var(--sidebar-w, 290px), min(600px, 50vw));
  display: flex; flex-direction: column; min-height: 0;
  background: var(--surface); border-right: 1px solid var(--line); z-index: 16;
}
body.sidebar-collapsed .sidebar { display: none; }
/* Borda arrastável (separador): invisível sobre a linha da borda, com o cursor de redimensionar; a linha
   fica em --accent (3 px) parado em cima dela por um instante ou arrastando, e em --accent-2 com o foco.
   A do painel lateral (.panel-resize) é a mesma, espelhada na borda esquerda dele (ver “Painel lateral”) */
.sidebar-resize, .panel-resize { position: absolute; z-index: 1; top: 0; bottom: 0; right: -6px; width: 8px; cursor: ew-resize; touch-action: none; }
.sidebar-resize::after, .panel-resize::after { content: ""; position: absolute; top: 0; bottom: 0; left: 1px; width: 3px; transition: background-color .15s; }
.sidebar-resize:hover::after, .panel-resize:hover::after { background: var(--accent); transition-delay: .2s; }
body.sidebar-resizing .sidebar-resize::after, body.panel-resizing .panel-resize::after { background: var(--accent); transition-delay: 0s; }
.sidebar-resize:focus-visible, .panel-resize:focus-visible { outline-color: transparent; } /* a faixa faz o papel do contorno; no alto contraste do sistema, o contorno volta */
.sidebar-resize:focus-visible::after, .panel-resize:focus-visible::after { background: var(--accent-2); transition-delay: 0s; }
body.sidebar-resizing, body.sidebar-resizing *, body.panel-resizing, body.panel-resizing * { cursor: ew-resize !important; user-select: none !important; }
@media (pointer: coarse) {
  .sidebar-resize { right: -12px; width: 18px; }
  .sidebar-resize::after { left: 5px; }
}
.side-section { display: flex; flex-direction: column; min-height: 0; border-bottom: 1px solid var(--line); }
.side-section.grow { flex: 1; }
.side-head { display: flex; align-items: center; gap: .4rem; padding: .55rem .6rem .35rem .8rem; }
.side-head h2 { flex: 1; margin: 0; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); display: flex; align-items: center; gap: .4rem; }
.count-pill { background: var(--neutral-soft); color: var(--ink-2); border-radius: 999px; padding: 0 .45rem; font-size: .72rem; letter-spacing: 0; }
.count-pill.bad { background: var(--offline-soft); color: var(--offline-ink); }
.problems-list { list-style: none; margin: 0; padding: 0 .4rem .4rem; max-height: 170px; overflow: auto; }
.problems-list li a { display: flex; align-items: center; gap: .5rem; padding: .35rem .4rem; border-radius: 8px; color: var(--ink); text-decoration: none; font-size: .88rem; }
.problems-list li a:hover { background: var(--hover); }
.problems-list .p-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Em atenção por interface monitorada: a interface numa segunda linha, menor */
.problems-list .p-why { display: block; overflow: hidden; text-overflow: ellipsis; color: var(--muted); font-size: .75rem; }
.problems-list .p-map { color: var(--muted); font-size: .75rem; max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.problems-list .none { color: var(--muted); font-size: .85rem; padding: .3rem .5rem .5rem; }
.minimap-section { border-bottom: 0; padding-bottom: .6rem; }
.minimap { display: block; margin: 0 .6rem; width: calc(100% - 1.2rem); height: 180px; border: 1px solid var(--line); border-radius: 8px; background: var(--stage); cursor: pointer; touch-action: none; }
/* Janela baixa (até 860 px de altura: notebook de 1366 × 768, tela Full HD com o zoom do sistema em 125% ou
   150%, celular): a Visão geral (uns 220 px) sai da barra lateral e a árvore de mapas fica com o espaço dela.
   Problemas passa a ser a última seção, sem a linha de baixo. O minimapa volta, desenhado de novo, quando a
   janela cresce (o ResizeObserver de minimap.js) */
@media (max-height: 860px) {
  .minimap-section { display: none; }
  .problems-section { border-bottom: 0; }
}
@media (max-width: 900px) {
  /* Gaveta sobreposta: sempre a largura padrão, sem a borda arrastável. O botão de menu, no começo da
     barra superior, a mostra e esconde em qualquer tela (no mapa e em Equipamentos, Usuários e Configurações).
     A marca fica só com o logo, para o botão caber sem o topo ganhar uma linha nem empurrar o “Sair” para fora */
  .sidebar { position: absolute; top: 0; bottom: 0; left: 0; width: 290px; box-shadow: 10px 0 30px rgba(20,33,61,.15); }
  .sidebar-resize { display: none; }
  #btn-menu { display: inline-flex; }
  .topbar .brand span { display: none; }
  /* Numa linha só até 761 px (tablet na vertical, celular na horizontal), com o “Sair” à vista e espaço para a busca
     também com centenas de equipamentos nos chips: a conta fica só com o ícone, como no celular (o nome continua
     no title e em “Minha conta”), e os grupos do topo ficam a 8 px um do outro (12 px de novo em ≤760 px) */
  .topbar { gap: .5rem; }
  .account .account-name { display: none; }
}
.maps-tree, .maps-tree ul { list-style: none; margin: 0; padding: 0; }
.maps-tree { overflow: auto; flex: 1; padding: 0 .4rem .4rem; }
.tree-row { display: flex; align-items: center; gap: .25rem; border-radius: 8px; padding-left: calc(var(--depth, 0) * 18px); }
.tree-row:hover { background: var(--hover); }
.tree-row.current { background: var(--selected); }
.tree-link { flex: 1; min-width: 0; display: flex; align-items: center; gap: .5rem; padding: .45rem .4rem; color: var(--ink); text-decoration: none; border-radius: 8px; }
.tree-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-row.current .tree-name { font-weight: 700; }
.tree-count { font-size: .78rem; font-variant-numeric: tabular-nums; }
.tree-actions { display: flex; opacity: 0; transition: opacity .1s; }
.tree-row:hover .tree-actions, .tree-row:focus-within .tree-actions { opacity: 1; }
.tree-actions .btn { width: 28px; height: 28px; font-size: .85rem; }
/* Filtro da árvore de mapas (js/maps-filter.js): a lupa logo depois de “Mapas” (.btn.active enquanto o
   campo está aberto) abre o campo entre o cabeçalho e a árvore, o mesmo .field das barras de filtro. Na
   árvore, o texto encontrado fica em --selected-ink e os mapas que só estão ali pela hierarquia, em --muted
   (menos o mapa aberto, que continua como sempre) */
.maps-head h2 { flex: none; }
#btn-maps-filter { margin-right: auto; }
.maps-filter { padding: 0 .6rem .45rem; }
.maps-filter .field input { min-height: 36px; }
.tree-name mark { background: none; color: var(--selected-ink); font-weight: 700; }
.tree-row.context:not(.current) .tree-name { color: var(--muted); }
.maps-tree .none { color: var(--muted); font-size: .85rem; padding: .3rem .5rem .5rem; }
/* Barra lateral estreita (de 220 px até uns 262 px, onde o cabeçalho de “Mapas” não cabe inteiro): o
   “+ Novo mapa” fica só com o “+”, como o “Adicionar” da barra superior em telas menores; o texto continua
   para o leitor de tela. O cabeçalho é o contêiner: a largura de dentro dele, sem o espaçamento das bordas */
.maps-head { container-type: inline-size; }
.new-map-plus { display: none; }
@container (width < 241px) {
  #btn-new-map { width: 28px; padding: 0; justify-content: center; }
  #btn-new-map .new-map-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  #btn-new-map .new-map-plus { display: inline; }
}
.danger-text { color: var(--danger); }
#search-results .sr-map { display: block; color: var(--muted); font-size: .75rem; font-weight: 400; }

/* ---------- Modo quiosque (TVs): só o mapa, inteiro e ajustado à tela ---------- */
/* Somem a barra superior, a lateral e os controles do mapa; os avisos fixos (motor parado, conexão
   perdida) continuam, porque dizem se o que a TV mostra está atualizado. O mapa é só exibição: sem
   clique, arraste, zoom ou menu (o ajuste à tela é automático, em map.js). */
body.kiosk .topbar, body.kiosk .sidebar, body.kiosk .map-nav, body.kiosk .zoom-controls, body.kiosk .legend,
body.kiosk .map-empty [data-admin-only] { display: none; }
body.kiosk .map { pointer-events: none; }
body.kiosk .map-wrap { touch-action: none; }
/* A barra de modo do quiosque aparece ao entrar e ao mexer o mouse, e some sozinha com o cursor.
   Aparece já clicável e com foco possível; ao sumir, esmaece e só então sai do Tab. */
.mode-bar.kiosk-bar { top: 14px; transition: opacity .18s; }
.kiosk-bar.idle { opacity: 0; visibility: hidden; transition: opacity .18s, visibility 0s .18s; }
body.kiosk-idle, body.kiosk-idle * { cursor: none !important; }

/* ---------- Menu de contexto ---------- */
.context-menu {
  position: fixed; z-index: 60; min-width: 230px; padding: .3rem; background: var(--surface); border-radius: 10px;
  box-shadow: var(--shadow-menu); display: grid;
}
.context-menu button { display: flex; align-items: center; justify-content: space-between; gap: 1rem; text-align: left; padding: .5rem .7rem; border: 0; background: none; border-radius: 6px; cursor: pointer; font-size: .92rem; }
.context-menu button:hover, .context-menu button:focus-visible { background: var(--menu-hover); outline: none; }
.context-menu button.strong { font-weight: 700; }
.context-menu button.danger { color: var(--danger); }
.context-menu button.danger:hover, .context-menu button.danger:focus-visible { background: var(--danger-hover); }
.context-menu button:disabled { opacity: .45; cursor: default; background: none; }
.ctx-sep { height: 1px; background: var(--line); margin: .25rem .3rem; }
/* Item com submenu (Ferramentas, no equipamento): a seta à direita, no lugar do atalho, e o item destacado
   enquanto o submenu está aberto. O submenu é outro .context-menu, ao lado do item, mais estreito */
.context-menu .ctx-arrow { width: 16px; height: 16px; margin-right: -.2rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; color: var(--muted); flex: none; }
.context-menu button[aria-expanded=true] { background: var(--menu-hover); }
.context-submenu { min-width: 180px; }

/* ---------- Menu suspenso de um botão (“Adicionar” na barra superior) ---------- */
.menu-button { position: relative; display: flex; }
.menu-button > .btn .caret { width: 16px; height: 16px; margin-left: -.15rem; transition: transform .12s; }
.menu-button > .btn[aria-expanded=true] .caret { transform: rotate(180deg); }
.dropdown-menu { position: absolute; top: calc(100% + 6px); left: 0; color: var(--ink); }
.dropdown-menu button > span { display: flex; align-items: center; gap: .6rem; }
.dropdown-menu svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; color: var(--ink-2); flex: none; }

/* ---------- Painel lateral ---------- */
/* Largura escolhida arrastando a borda esquerda (--panel-w, posto por js/sidebar-resize.js na .stage, de onde
   os controles de zoom, ao lado do painel aberto, também a leem): de 300 a 720 px, nunca mais que metade do
   mapa (o 50% é o da .stage), mas sempre até os 360 px de sempre, a largura sem escolha. No celular, abaixo */
.stage { --panel-width: clamp(300px, var(--panel-w, 360px), max(360px, min(720px, 50%))); }
.panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: var(--panel-width); z-index: 14;
  background: var(--surface); border-left: 1px solid var(--line); box-shadow: -10px 0 30px rgba(20,33,61,.08);
  display: flex; flex-direction: column;
}
/* A borda arrastável é a da barra lateral, espelhada: quase toda do lado do mapa */
.panel-resize { right: auto; left: -6px; }
.panel-resize::after { left: auto; right: 1px; }
@media (pointer: coarse) {
  .panel-resize { left: -12px; width: 18px; }
  .panel-resize::after { right: 5px; }
}
.panel-head { display: flex; align-items: center; gap: .5rem; padding: .8rem .8rem .5rem 1rem; border-bottom: 1px solid var(--line); }
.panel-head h2 { flex: 1; margin: 0; font-size: 1.1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.panel-body { padding: 1rem; overflow: auto; flex: 1; }
.panel-status { margin-bottom: .75rem; }
.status-pill { display: inline-flex; align-items: center; gap: .45rem; padding: .25rem .7rem .25rem .3rem; border-radius: 999px; background: var(--neutral-soft); font-weight: 600; }
.status-pill.st-online { background: var(--online-soft); color: var(--online-ink); }
.status-pill.st-warning { background: var(--warning-soft); color: var(--warning-ink); }
.status-pill.st-offline { background: var(--offline-soft); color: var(--offline-ink); }
.props { display: grid; grid-template-columns: 9.5rem 1fr; gap: .5rem .75rem; margin: 0 0 1rem; font-size: .92rem; }
.props dt { color: var(--muted); }
.props dd { margin: 0; overflow-wrap: anywhere; }
/* Lista num valor (hoje, as interfaces monitoradas do equipamento): um item por linha, sem marcador, com
   o espaço da lista do aviso entre eles, para o nome que quebra a linha não parecer outro item */
.props-list { list-style: none; margin: 0; padding: 0; }
.props-list li + li { margin-top: .25rem; }
.props .bad { color: var(--bad); font-weight: 600; }
.props .desc { white-space: pre-wrap; }
.panel-actions { display: flex; flex-wrap: wrap; gap: .5rem; padding-top: .5rem; }
.notice { padding: .55rem .7rem; border-radius: 8px; font-size: .87rem; margin-bottom: .8rem; }
.notice.warn { background: var(--warn-bg); color: var(--warn-ink); }
.notice.error { background: var(--error-bg); color: var(--error-ink); }
.link-ends { font-size: 1rem; display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.stack { display: grid; gap: .75rem; }

/* ---------- Formulários ---------- */
.field { display: grid; gap: .3rem; border: 0; margin: 0; padding: 0; min-width: 0; }
.field > span, .field legend { font-size: .85rem; font-weight: 600; color: var(--ink-2); padding: 0; }
.field em { color: var(--danger); font-style: normal; }
.field input, .field select, .field textarea {
  width: 100%; border: 1px solid var(--line-strong); border-radius: 8px; padding: .5rem .6rem; background: var(--input); min-height: 38px;
}
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px rgba(46,196,182,.3); }
.field [aria-invalid=true] { border-color: var(--danger); }
.field .err { color: var(--danger); min-height: 0; font-size: .8rem; }
.field .err:empty { display: none; }
.check { display: flex; align-items: center; gap: .5rem; margin: .5rem 0 .75rem; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
/* Controle deslizante (ex.: escala da imagem de fundo): rótulo à esquerda, valor à direita e
   barra nativa na cor de acento, como as caixas de seleção. */
.range-field > span { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; }
.range-field output { color: var(--ink); font-variant-numeric: tabular-nums; }
.field input[type=range] { padding: 0; border: 0; border-radius: 0; min-height: 0; height: 24px; background: none; accent-color: var(--accent); cursor: pointer; }
.field input[type=range]:focus { box-shadow: none; }
.field input[type=range]:focus-visible { outline: 3px solid var(--accent-2); outline-offset: 2px; }
.form-error { background: var(--error-bg); color: var(--error-ink); padding: .55rem .7rem; border-radius: 8px; font-size: .9rem; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; }
.advanced { border: 1px solid var(--line); border-radius: 8px; padding: .5rem .75rem; }
.advanced summary { cursor: pointer; font-weight: 600; font-size: .9rem; }
.swatches { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.swatch { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--surface); background: var(--c); box-shadow: 0 0 0 1px var(--line-strong); cursor: pointer; padding: 0; }
.swatch.on { box-shadow: 0 0 0 2px var(--ink); }
.swatch.custom { position: relative; overflow: hidden; background: conic-gradient(red, yellow, lime, cyan, blue, magenta, red); }
.swatch.custom input { position: absolute; inset: -6px; width: 40px; height: 40px; opacity: 0; cursor: pointer; }
.segmented { display: flex; gap: .4rem; }
.segmented label { flex: 1; position: relative; }
/* O rádio invisível cobre só a própria opção (como no .shape-picker); sem isso ele herdava a
   largura de .field input, passava da borda da tela e o foco rolava a página para o lado. */
.segmented input { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; margin: 0; opacity: 0; cursor: pointer; }
.segmented span { display: flex; flex-direction: column; align-items: center; gap: .2rem; padding: .45rem; border: 1px solid var(--line-strong); border-radius: 8px; cursor: pointer; font-size: .85rem; }
.segmented svg { width: 40px; height: 8px; stroke: var(--ink-2); stroke-width: 2.5; fill: none; }
.segmented input:checked + span { border-color: var(--accent); background: var(--selected); font-weight: 600; }
.segmented input:focus-visible + span { outline: 3px solid var(--accent-2); }

/* Abas dentro de diálogos (ex.: Geral / Interfaces na edição do equipamento) */
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--line); }
.tab { background: none; border: 0; border-bottom: 3px solid transparent; margin-bottom: -1px; padding: .45rem .8rem; font: inherit; font-weight: 500; color: var(--muted); cursor: pointer; border-radius: 8px 8px 0 0; }
.tab:hover { color: var(--ink); background: var(--hover); }
.tab[aria-selected=true] { color: var(--selected-ink); border-bottom-color: var(--accent); font-weight: 700; }
.tab-panel { display: grid; gap: .85rem; min-width: 0; }
.notice.info { background: var(--neutral-soft); color: var(--ink-2); }
.notice.ok { background: var(--online-soft); color: var(--online-ink); }
.notice .spinner { width: 14px; height: 14px; border-width: 2px; margin-right: .3rem; }
.advanced summary .muted { font-weight: 400; }
.advanced .snmp-fields, .advanced .hv-fields { margin: .6rem 0 .25rem; }
/* API de virtualização (js/hypervisor.js): as dicas e os avisos do teste seguem o espaçamento do bloco */
.hv-fields > p, .hv-fields .check, .hv-fields .notice p { margin: 0; }
.hv-fields .notice p + p { margin-top: .35rem; }
.advanced > p.small { margin: 0 0 .25rem; }
/* Interfaces e tráfego (SNMP) */
.iface-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem .75rem; flex-wrap: wrap; }
.iface-head p { margin: 0; }
.iface-head .check { margin: 0; }
.table-wrap.inline { flex: none; margin: 0; max-height: min(52vh, 440px); }
.table-wrap.inline .data-table th, .table-wrap.inline .data-table td { padding: .45rem .6rem; }
.ifaces { display: grid; gap: .85rem; min-width: 0; align-content: start; }
.iface-notes { display: grid; gap: .35rem; }
.iface-notes p { margin: 0; }
/* Nome longo de interface (“hundred-gigabit-ethernet-1/1/1”) quebra na coluna em vez de alargar a tabela */
.ifaces .data-table td.cell-name { overflow-wrap: anywhere; }
/* VMs: com oito colunas, em tela estreita a do nome encolheria até quebrar letra a letra. Ela guarda
   uma largura mínima e a tabela rola de lado */
.vms .data-table td.cell-name { min-width: 8.5rem; }
/* Coluna “Monitorar”: caixa de seleção centralizada, coluna estreita */
.data-table .cell-check { width: 1%; text-align: center; white-space: nowrap; }
.data-table .cell-check input { width: 18px; height: 18px; margin: 0; vertical-align: middle; accent-color: var(--accent); cursor: pointer; }
.data-table .cell-check input:disabled { cursor: progress; }
/* Histórico de latência e perda de pacotes (js/history.js): período, resumo, dois gráficos com a
   mesma linha do tempo e a tabela com os mesmos números. Os dados ficam em tinta (--ink-2); a
   única cor de estado é a de Offline, nas verificações sem resposta. Com o agente SNMP, o seletor
   “Histórico de” troca para o sinal óptico e os erros de uma interface, no mesmo formato. */
.history { display: grid; gap: .85rem; min-width: 0; align-content: start; }
.history-subject .field { max-width: 26rem; }
.history-toolbar { display: flex; align-items: flex-end; gap: .5rem .75rem; flex-wrap: wrap; }
.history-toolbar .field { flex: 1 1 20rem; }
.history-toolbar legend { margin-bottom: .3rem; }
/* As opções do período com a altura do botão ao lado (36 px) */
.history-toolbar .segmented span { min-height: 36px; justify-content: center; }
/* “Ver tabela” e “Ver gráficos” com a mesma largura: os períodos não mudam de tamanho na troca */
.history-toolbar .btn { min-width: 7.4rem; justify-content: center; }
.history-content { display: grid; gap: .85rem; min-width: 0; transition: opacity .15s; }
/* Trocando de período: o que está na tela esmaece até o novo chegar, sem mudar de tamanho */
.history.loading .history-content { opacity: .5; }
.history-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, 1.6fr); gap: .5rem .75rem; margin: 0; }
.history-summary dt { font-size: .85rem; color: var(--muted); }
.history-summary dd { margin: .1rem 0 0; font-size: 1.1rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.history-summary dd small { display: block; font-size: .78rem; font-weight: 400; }
.history-charts { position: relative; display: grid; gap: .6rem; min-width: 0; border-radius: 8px; touch-action: pan-y; }
.history-chart { margin: 0; min-width: 0; }
.history-chart figcaption { display: flex; align-items: baseline; justify-content: space-between; gap: .25rem .75rem; flex-wrap: wrap; margin-bottom: .25rem; font-size: .85rem; font-weight: 600; color: var(--ink-2); }
.history-key { display: inline-flex; gap: .75rem; font-size: .78rem; font-weight: 400; color: var(--muted); }
.history-key > span { display: inline-flex; align-items: center; gap: .3rem; }
.key-line, .key-band, .key-bar, .key-err-in, .key-err-out, .key-col-a, .key-col-b { display: inline-block; flex: none; }
.key-line { width: 14px; height: 2px; border-radius: 1px; background: var(--ink-2); }
.key-band { width: 14px; height: 8px; border-radius: 2px; background: var(--ink-2); opacity: .14; }
.key-bar { width: 8px; height: 8px; border-radius: 2px; background: var(--st-offline); }
/* Erros das interfaces: colunas em tinta, a entrada cheia e a saída empilhada em cima, mais clara.
   O disco e a rede das VMs usam o mesmo par (.col-a embaixo, .col-b em cima) */
.key-err-in, .key-err-out, .key-col-a, .key-col-b { width: 8px; height: 8px; border-radius: 2px; background: var(--ink-2); }
.key-err-out, .key-col-b { opacity: .4; }
.history-chart svg { display: block; width: 100%; overflow: visible; }
.history-chart text { font-size: .78rem; fill: var(--muted); font-variant-numeric: tabular-nums; }
.history-chart text.none { font-size: .85rem; }
.history-chart .grid { stroke: var(--grid); }
.history-chart .axis { stroke: var(--line); }
.history-chart .band { fill: var(--ink-2); fill-opacity: .12; }
.history-chart .line { fill: none; stroke: var(--ink-2); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.history-chart .dot { fill: var(--ink-2); }
.history-chart .bar { fill: var(--st-offline); }
.history-chart .err-in, .history-chart .col-a { fill: var(--ink-2); }
.history-chart .err-out, .history-chart .col-b { fill: var(--ink-2); fill-opacity: .4; }
.history-chart .cross { stroke: var(--muted); }
.history-chart .hover-dot { fill: var(--ink-2); stroke: var(--surface); stroke-width: 2; }
/* Dica do intervalo sob o ponteiro: cartão flutuante, com os valores em texto */
.history-tip { position: absolute; z-index: 2; padding: .5rem .65rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); font-size: .85rem; white-space: nowrap; pointer-events: none; }
.history-tip strong { display: block; margin-bottom: .3rem; font-variant-numeric: tabular-nums; }
.history-tip dl { display: grid; grid-template-columns: auto auto; gap: .15rem .9rem; margin: 0; }
.history-tip dt { display: flex; align-items: center; gap: .35rem; color: var(--muted); }
.history-tip dd { margin: 0; text-align: right; font-weight: 500; font-variant-numeric: tabular-nums; }

/* ---------- Diálogos ---------- */
.dialog { border: 0; border-radius: 14px; padding: 0; width: min(560px, 94vw); box-shadow: var(--shadow); color: var(--ink); background: var(--surface); }
.dialog.small { width: min(420px, 94vw); }
/* Diálogo com a tabela de interfaces (equipamento com agente SNMP): sete colunas sem rolar de lado */
.dialog.wide { width: min(680px, 94vw); }
/* Diálogo com a tabela das VMs (hypervisor com a API de virtualização): oito colunas sem rolar de lado,
   com folga para a pílula mais larga (“Não encontrada”) e para taxas de três algarismos */
.dialog.vms { width: min(940px, 96vw); }
/* O cursor do fundo acompanha o arraste do título ou de uma borda (--drag-cursor, posto pelo JS) */
.dialog::backdrop { background: var(--backdrop); cursor: var(--drag-cursor, auto); }
.dialog form { padding: 1.25rem; display: grid; gap: .85rem; }
.dialog h2 { margin: 0; font-size: 1.15rem; }
.dialog p { margin: 0; line-height: 1.45; }
.dialog-actions { display: flex; justify-content: flex-end; gap: .5rem; flex-wrap: wrap; padding-top: .25rem; }
.dialog-actions .spacer { flex: 1; }
/* Diálogo redimensionável (makeResizable em js/resizable.js): título, abas e ações ficam fixos;
   o conteúdo rola por dentro e as tabelas crescem com o diálogo. */
.dialog.resizable { overflow: hidden; max-width: calc(100vw - 16px); max-height: calc(100vh - 16px); max-height: calc(100dvh - 16px); }
.dialog.resizable > form { display: flex; flex-direction: column; height: 100%; max-height: calc(100vh - 16px); max-height: calc(100dvh - 16px); }
.dialog.resizable > form > * { flex: none; }
/* O padding de 5 px (compensado pela margem) deixa o anel de foco inteiro dentro da área que rola */
.dialog.resizable > form > .tab-panel, .dialog.resizable > form > .dialog-body { flex: 1 1 auto; min-height: 0; overflow: auto; align-content: start; padding: 5px; margin: -5px; }
/* Com tamanho escolhido, a tabela de interfaces ocupa a altura que sobra (no mínimo 140 px) e rola por dentro */
.dialog.resized .ifaces:has(> .table-wrap) { grid-template-rows: auto auto minmax(140px, max-content); }
.dialog.resized .ifaces .table-wrap.inline { align-self: start; max-height: 100%; }
.resize-handle { position: absolute; z-index: 2; touch-action: none; }
.resize-handle.n, .resize-handle.s { left: 16px; right: 16px; height: 7px; cursor: ns-resize; }
.resize-handle.e, .resize-handle.w { top: 16px; bottom: 16px; width: 7px; cursor: ew-resize; }
.resize-handle.n { top: 0; }
.resize-handle.s { bottom: 0; }
.resize-handle.e { right: 0; }
.resize-handle.w { left: 0; }
.resize-handle.nw, .resize-handle.ne, .resize-handle.sw, .resize-handle.se { width: 16px; height: 16px; }
.resize-handle.nw { top: 0; left: 0; cursor: nwse-resize; }
.resize-handle.se { bottom: 0; right: 0; cursor: nwse-resize; }
.resize-handle.ne { top: 0; right: 0; cursor: nesw-resize; }
.resize-handle.sw { bottom: 0; left: 0; cursor: nesw-resize; }
/* Indicação no canto inferior direito, como a de um campo de texto redimensionável */
.resize-handle.se::after { content: ""; position: absolute; right: 4px; bottom: 4px; width: 9px; height: 9px;
  background: linear-gradient(135deg, transparent 0 50%, var(--line-strong) 50% 60%, transparent 60% 75%, var(--line-strong) 75% 85%, transparent 85%); }
body.dialog-resizing *, body.dialog-moving * { cursor: inherit !important; user-select: none !important; }
/* Diálogo móvel (makeMovable em js/movable.js): alça invisível sobre a faixa do título, do topo do
   diálogo até o fim do h2 (a altura vem do JS). Nas bordas e cantos, as alças de redimensionar ficam por cima. */
.move-handle { position: absolute; z-index: 1; top: 0; left: 0; right: 0; height: 2.65rem; cursor: move; touch-action: none; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-btn:focus-within { outline: 3px solid var(--accent-2); outline-offset: 2px; }
.bg-current { display: grid; gap: .4rem; justify-items: center; }
.bg-current img { max-width: 100%; max-height: 220px; border-radius: 8px; border: 1px solid var(--line); object-fit: contain; background: var(--hover); }
.bg-none { width: 100%; padding: 1.5rem; text-align: center; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: 8px;
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px); background-size: 16px 16px; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 50; display: grid; gap: .5rem; width: min(520px, 94vw); }
.toast { display: flex; align-items: center; gap: .6rem; padding: .65rem .7rem .65rem 1rem; border-radius: 10px; background: var(--brand); color: #fff; box-shadow: var(--shadow); font-size: .92rem; animation: rise .18s ease-out; }
.toast span { flex: 1; }
.toast.success { border-left: 5px solid var(--st-online); }
.toast.warn { border-left: 5px solid var(--st-warning); }
.toast.error { background: #7a1d17; }
.toast .btn { background: rgba(255,255,255,.15); color: #fff; border-color: rgba(255,255,255,.35); }
.toast-close { background: none; border: 0; color: #fff; font-size: 1.3rem; line-height: 1; cursor: pointer; opacity: .75; padding: 0 .2rem; }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } }

/* ---------- Avisos de mudança de status (canto inferior direito) ---------- */
/* Os cartões de js/status-notices.js: o .toast com a faixa e o badge do estado novo, no canto do zoom
   (ao lado do painel de detalhes aberto, como ele). Enquanto há aviso à mostra o zoom esmaece e sai da
   frente, menos com o mouse ou o foco do teclado nele; a roda do mouse, a pinça e as teclas + − 0
   continuam valendo, e ele volta quando o último aviso sai. No máximo três cartões ou o resumo: a pilha
   cresce para cima e nunca passa do topo do palco. */
.status-notices {
  position: absolute; right: 14px; bottom: 14px; z-index: 50;
  display: flex; flex-direction: column; justify-content: flex-end; gap: .5rem;
  width: min(360px, calc(100% - 28px)); max-height: calc(100% - 28px); overflow: hidden;
  pointer-events: none;
}
.status-notices > * { pointer-events: auto; }
/* O cartão que acabou de chegar deixa passar o clique por meio segundo: era para o que estava ali (o zoom) */
.status-notices > .arriving { pointer-events: none; }
.stage:has(> .status-notices > *) .zoom-controls:not(:hover):not(:focus-within) { opacity: 0; visibility: hidden; }
body.panel-open .status-notices { right: calc(var(--panel-width) + 14px); width: min(360px, calc(100% - var(--panel-width) - 28px)); }
body.page-open .status-notices, body.kiosk .status-notices { right: 14px; width: min(360px, calc(100% - 28px)); }
.toast.status-toast { flex: none; align-items: flex-start; gap: .65rem; padding: .6rem .5rem .6rem .75rem; border-left: 5px solid var(--status); }
.toast.status-toast.st-online { --status: var(--st-online); }
.toast.status-toast.st-warning { --status: var(--st-warning); }
.toast.status-toast.st-offline { --status: var(--st-offline); }
.toast.status-toast span { flex: none; } /* o texto do toast comum estica (.toast span); aqui quem estica é o corpo */
.toast.status-toast > .badge { margin-top: .1rem; }
.toast-open, .toast-body { flex: 1; min-width: 0; display: grid; gap: .15rem; font-size: .85rem; line-height: 1.35; text-align: left; }
.toast-open { padding: 0; border: 0; background: none; color: inherit; cursor: pointer; border-radius: 6px; }
.toast-open:hover .toast-title { text-decoration: underline; text-underline-offset: 2px; }
.toast-title { font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toast-text { overflow-wrap: anywhere; text-wrap: pretty; } /* sem palavra sozinha na última linha */
.toast-meta { color: #9fb0c8; font-size: .78rem; overflow-wrap: anywhere; text-wrap: pretty; }
.toast-counts { display: flex; flex-wrap: wrap; gap: .2rem .8rem; }
.toast-counts > span { display: inline-flex; align-items: center; gap: .35rem; font-variant-numeric: tabular-nums; }
.toast-counts .badge { width: 16px; height: 16px; font-size: .55rem; }
.toast-body .btn { justify-self: start; margin-top: .3rem; }
.toast.status-toast .toast-close { align-self: flex-start; }
/* No modo quiosque o mapa é só exibição: o cartão não abre o equipamento, e a barra lateral não existe */
body.kiosk .toast-open { pointer-events: none; }
body.kiosk .toast-body .btn { display: none; }

.spinner { display: inline-block; width: 18px; height: 18px; border: 2.5px solid rgba(15,143,134,.25); border-top-color: var(--accent); border-radius: 50%; animation: rot .7s linear infinite; vertical-align: -3px; }
.spinner.small { width: 14px; height: 14px; border-width: 2px; border-color: rgba(255,255,255,.35); border-top-color: currentColor; }
@keyframes rot { to { transform: rotate(360deg); } }

/* ---------- Login ---------- */
.login-page { display: grid; place-items: center; min-height: 100%;
  background: radial-gradient(circle at 20% 20%, #1e3a5f 0, transparent 45%), radial-gradient(circle at 80% 70%, #0f4d4a 0, transparent 40%), var(--brand); }
.login-card { width: min(380px, 92vw); background: var(--surface); border-radius: 16px; padding: 2rem 1.75rem; box-shadow: 0 20px 60px rgba(0,0,0,.35); text-align: center; }
.login-card form { display: grid; gap: .9rem; margin-top: 1.25rem; text-align: left; }

/* ---------- Telas menores (tablet) ---------- */
@media (max-width: 1640px) {
  .chip .lbl { display: none; }
  .search { width: clamp(170px, 14vw, 300px); }
}
/* Com o “Desfazer”, os textos da toolbar deixam de caber (sem espremer a busca) abaixo de ~1420 px */
@media (max-width: 1420px) {
  .toolbar .btn span:not(.sr-only) { display: none; }
  .toolbar .btn { width: 40px; padding: 0; justify-content: center; }
  .toolbar .menu-button > .btn { width: auto; padding: 0 .5rem; gap: .25rem; }
}
@media (max-width: 760px) {
  :root { --topbar-h: auto; }
  .topbar { flex-wrap: wrap; padding: .5rem; height: auto; gap: .75rem; }
  .search { order: 5; width: 100%; margin-left: 0; }
  .summary { margin-left: auto; }
  .legend:not([open]) { max-width: none; }
  .legend { max-width: 240px; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .resize-handle, .move-handle { display: none; }
  /* O painel cobre quase todo o mapa: sempre a largura padrão (ou quase a tela toda), sem a borda arrastável */
  .panel { width: min(360px, 92vw); }
  .panel-resize { display: none; }
  body.panel-open .zoom-controls { display: none; }
  /* Avisos de mudança de status: no pé do mapa, na largura da tela */
  .status-notices, body.panel-open .status-notices, body.page-open .status-notices, body.kiosk .status-notices { left: 8px; right: 8px; bottom: 8px; width: auto; max-height: calc(100% - 16px); }
  /* Histórico: resumo em duas colunas e os períodos em duas linhas de três */
  .history-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .history-toolbar .segmented { flex-wrap: wrap; }
  .history-toolbar .segmented label { flex: 1 0 30%; }
  /* Visuais: os cinco tamanhos da fonte em duas linhas (três e dois), e os seis tempos do destaque (três e três) */
  :is(.font-size, .highlight-time) .segmented { flex-wrap: wrap; }
  :is(.font-size, .highlight-time) .segmented label { flex: 1 0 30%; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

.status-pill.mini { font-size: 0; gap: 0; padding: 0; background: none; }
/* >>> desenho-do-mapa */
.device.object .body { fill: var(--obj-fill, #e8eef7); stroke: var(--object-line); stroke-width: 2; filter: drop-shadow(0 1px 2px rgb(20 33 61 / calc(.18 * var(--shade)))); }
.device.object .badge { display: none; }
.device.object .glyph { color: var(--ink-2); }
.device .label.inside { font-size: calc(17px * var(--font-scale, 1)); stroke-width: 0; fill: var(--ink); }
/* Nome e IP dentro da forma (Configurações → Visuais): sem o contorno branco, já que ficam sobre o
   fundo da forma. Os tamanhos (17 px e 14 px, vezes o tamanho da fonte) se repetem em INSIDE
   (shapes.js), que mede o texto */
.device .sublabel.inside { stroke-width: 0; }
/* Preenchimento escuro (fillTone em shapes.js): ícone e nome de dentro claros. No objeto escuro, no
   tom do texto da barra superior; no equipamento e no submapa com a cor do estado forte, brancos como
   o símbolo do badge sobre a mesma cor (Configurações → Visuais → Intensidade da cor do estado) */
.device.fill-dark .glyph { color: #e8edf5; }
.device.fill-dark .label.inside { fill: #e8edf5; }
.device:not(.object).fill-dark .glyph { color: #fff; }
.device:not(.object).fill-dark .label.inside, .device:not(.object).fill-dark .sublabel.inside { fill: #fff; }
/* Cor do estado forte, mas clara o bastante para o texto escuro: o ícone e o IP (ou o resumo do
   submapa) de dentro passam ao --ink, porque o --ink-2 (o azul, no submapa) e o cinza do IP perderiam
   contraste */
.device.fill-ink .glyph { color: var(--ink); }
.device.fill-ink .sublabel.inside { fill: var(--ink); }
/* Tema escuro, preenchimento claro (objeto claro ou a cor do estado forte e clara), em que o texto
   escuro tem mais contraste: ícone, nome e IP de dentro na cor da marca */
.device.fill-light .glyph { color: var(--brand); }
.device.fill-light .label.inside, .device.fill-light .sublabel.inside { fill: var(--brand); }
/* Posição ou tamanho não salvos: o nome de dentro também em --danger. Sobre a cor do estado forte, com
   o contorno do nome de fora da forma, senão o vermelho some no fundo */
.device.text-inside.unsaved .label.inside { fill: var(--danger); }
.device:not(.object).text-inside.unsaved:is(.fill-dark, .fill-ink, .fill-light) .label.inside { stroke-width: 5px; }
/* <<< desenho-do-mapa */
.shape-picker { display: flex; flex-wrap: wrap; gap: .35rem; }
.shape-picker label { position: relative; }
.shape-picker input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.shape-picker span { display: grid; place-items: center; width: 52px; height: 44px; border: 1px solid var(--line-strong); border-radius: 8px; cursor: pointer; }
.shape-picker svg { width: 40px; height: 30px; fill: var(--submap-fill); stroke: var(--ink-2); stroke-width: 1.8; }
.shape-picker input:checked + span { border-color: var(--accent); background: var(--selected); box-shadow: 0 0 0 1px var(--accent); }
.shape-picker input:focus-visible + span { outline: 3px solid var(--accent-2); outline-offset: 1px; }

/* ---------- Perfis: elementos só para permissão completa ---------- */
.role-viewer [data-admin-only] { display: none !important; }
.map.read-only .device { cursor: default; }
.map.read-only .device.submap { cursor: pointer; }
.account { gap: .4rem; max-width: 320px; }
.account-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.role-chip { font-size: .7rem; text-transform: uppercase; letter-spacing: .04em; padding: .1rem .45rem; border-radius: 999px; background: var(--accent-2); color: var(--brand); font-weight: 700; white-space: nowrap; }
.role-pill { display: inline-block; padding: .15rem .6rem; border-radius: 999px; font-size: .82rem; font-weight: 600; background: var(--neutral-soft); color: var(--ink-2); }
.role-pill.admin { background: var(--selected); color: var(--selected-ink); }
.role-pill.viewer { background: var(--viewer-soft); color: var(--viewer-ink); }
/* Minha conta → Tema: as três opções num .segmented, com a altura de um botão */
.account-theme legend { margin-bottom: .3rem; }
.account-theme .segmented span { min-height: 36px; justify-content: center; }
/* Minha conta → Notificações (js/push.js): a dica, o estado neste aparelho com os botões, os status que a
   pessoa recebe (.state-checks, como o “Para” das Ações) e os outros aparelhos dela, cada um com o
   “Remover” à direita */
.account-push { gap: .6rem; }
.account-push > legend { margin-bottom: .3rem; }
.push-here { font-size: .9rem; }
.push-buttons { display: flex; flex-wrap: wrap; gap: .5rem; }
.push-devices { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.push-devices li { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.push-device { display: grid; min-width: 0; font-size: .9rem; overflow-wrap: anywhere; }
.push-device small { font-size: .8rem; }
.push-fail { color: var(--danger); }

/* ---------- Navegação lateral entre telas ---------- */
.side-nav { display: grid; gap: 2px; padding: .5rem .5rem .4rem; border-bottom: 1px solid var(--line); }
.side-nav-link { display: flex; align-items: center; gap: .6rem; padding: .45rem .6rem; border-radius: 8px; color: var(--ink); text-decoration: none; font-weight: 500; font-size: .92rem; }
.side-nav-link svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; color: var(--muted); }
.side-nav-link:hover { background: var(--hover); }
.side-nav-link.current { background: var(--selected); font-weight: 700; }
.side-nav-link.current svg { color: var(--accent); }

/* ---------- Telas de listagem e cadastro ---------- */
.page { position: absolute; inset: 0; z-index: 13; background: var(--bg); display: flex; flex-direction: column; min-height: 0; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 1rem 1.25rem .5rem; flex-wrap: wrap; }
.page-head h2 { margin: 0 0 .15rem; font-size: 1.3rem; outline: none; }
.page-head p { margin: 0; max-width: 60ch; }
.page-head-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.page-head-actions .btn { text-decoration: none; }
.page-toolbar { display: flex; gap: .5rem; padding: .25rem 1.25rem .75rem; flex-wrap: wrap; }
.page-toolbar .field { min-width: 160px; }
.page-toolbar .field.grow { flex: 1; min-width: 220px; }
.page-toolbar input, .page-toolbar select { min-height: 36px; }
/* Telas de formulário (Configurações): cartões brancos com o mesmo respiro do formulário dos diálogos */
.page-body { flex: 1; min-height: 0; overflow: auto; padding: .25rem 1.25rem 1.25rem; }
.settings-card { max-width: 640px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; display: grid; gap: .85rem; }
.settings-card h3 { margin: 0; font-size: 1rem; }
.settings-card p { margin: 0; line-height: 1.45; }
.settings-card .field input[type=number] { max-width: 12rem; }
.settings-card + .settings-card { margin-top: 1rem; }
.settings-card .check { margin: 0; }
.settings-card .notice, .settings-card .props { margin: 0; }
/* Visuais: os cinco tamanhos da fonte e os seis tempos do destaque de mudança de status, cada um num
   .segmented com o texto centralizado (quebra em duas linhas quando a coluna é estreita; em tela estreita,
   três por linha), as três barras da opacidade da cor de fundo lado a lado e, abaixo delas, as duas da
   intensidade da cor do estado nas mesmas colunas (equipamentos e submapas; uma coluna em tela estreita)
   e a prévia: um pedaço de mapa (visual-preview.js) na moldura do minimapa, só para ver */
:is(.font-size, .highlight-time) legend { margin-bottom: .3rem; }
:is(.font-size, .highlight-time) .segmented label { display: flex; }
:is(.font-size, .highlight-time) .segmented span { flex: 1; min-height: 36px; justify-content: center; text-align: center; }
/* Os tempos do destaque não quebram a linha: a opção mais comprida (“Igual ao aviso”) fica com a largura do
   texto dela, e as outras dividem o resto por igual (em tela estreita, três por linha: no bloco de 760 px abaixo) */
.highlight-time .segmented label { min-width: max-content; }
.highlight-time .segmented span { white-space: nowrap; }
:is(.fill-opacity, .status-intensity) legend { margin-bottom: .45rem; }
:is(.fill-opacity, .status-intensity) .grid3 { column-gap: 1.25rem; }
:is(.fill-opacity, .status-intensity) .range-field > span { font-weight: 500; }
.visual-preview { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--stage); pointer-events: none; user-select: none; }
/* Arquivo num formulário (Importação): botão .file-btn “Escolher arquivo” + nome do arquivo escolhido */
.file-pick { display: flex; align-items: center; gap: .75rem; min-width: 0; }
.file-pick .file-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .92rem; }
.file-pick .file-name.chosen { color: var(--ink); }
.file-pick .file-btn:has([aria-invalid=true]) { border-color: var(--danger); }
/* Listas dentro de um aviso (observações da importação) */
.notice ul { margin: .35rem 0 0; padding-left: 1.1rem; }
.notice li + li { margin-top: .25rem; }
/* Tipos de equipamento criados pela importação: ícone + nome, lado a lado */
.import-types { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .3rem 1rem; }
.import-types li { display: inline-flex; align-items: center; gap: .35rem; }
.import-report { display: grid; gap: .85rem; }
.import-report:empty { display: none; }
/* Sobre: a marca da tela de entrada (logo de 40 px e Monitor<strong>Man</strong>) é o título do cartão,
   à esquerda como o texto, e só o “Man” em negrito; a coluna dos rótulos tem a largura do maior
   (“Software desenvolvido por” numa linha só) */
.settings-card .brand.big { justify-content: flex-start; font-weight: 400; }
.props.about-props { grid-template-columns: max-content 1fr; }
/* Origem da importação (Backup, The Dude ou TopoMap): .segmented acima dos cartões, na largura deles.
   Numa tela estreita, a descrição de uma origem quebra em duas linhas: as três continuam da mesma
   altura, com o texto centralizado */
.import-source { max-width: 640px; margin: 0 0 1rem; }
.import-source .segmented label { display: flex; }
.import-source .segmented span { flex: 1; justify-content: center; text-align: center; }
/* A legenda de um fieldset fica fora da grade do .field: o espaço é o mesmo do rótulo dos campos */
.import-source legend { margin-bottom: .3rem; }
.segmented small { font-size: .78rem; font-weight: 400; color: var(--muted); }
.form-actions { display: flex; justify-content: flex-end; gap: .5rem; flex-wrap: wrap; }
.table-wrap { flex: 1; min-height: 0; overflow: auto; margin: 0 1.25rem 1.25rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.data-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.data-table th, .data-table td { padding: .55rem .75rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.data-table thead th { position: sticky; top: 0; background: var(--surface-2); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); z-index: 1; white-space: nowrap; }
.data-table thead th button { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; text-transform: inherit; letter-spacing: inherit; }
.data-table thead th button.sorted { color: var(--accent); font-weight: 700; }
.data-table thead th[aria-sort=ascending] button::after { content: " ▲"; font-size: .65em; }
.data-table thead th[aria-sort=descending] button::after { content: " ▼"; font-size: .65em; }
.data-table tbody tr:hover { background: var(--row-hover); }
.data-table tbody tr[tabindex]:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.data-table tbody tr[data-map] { cursor: pointer; }
.data-table td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.data-table td.cell-name small, .data-table td small { display: block; font-size: .78rem; }
.data-table td .bad { color: var(--bad); font-weight: 600; }
.data-table td a { color: var(--accent); text-decoration: none; font-weight: 500; }
.data-table td a:hover { text-decoration: underline; }
.data-table .cell-actions { white-space: nowrap; text-align: right; }
.data-table .cell-actions .btn + .btn { margin-left: .35rem; }
.data-table .cell-icon { width: 48px; }
.data-table .status-pill { font-size: .85rem; padding-right: .6rem; }
.table-empty { padding: 2rem; text-align: center; margin: 0; }
.type-cell { display: inline-flex; align-items: center; gap: .4rem; }
.ico { width: 20px; height: 20px; flex: none; color: var(--ink-2); vertical-align: -5px; }
.ico.big { width: 26px; height: 26px; }
.icon-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: .35rem; max-height: 300px; overflow: auto; padding: 2px; }
.icon-picker label { position: relative; }
.icon-picker input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.icon-picker span { display: grid; justify-items: center; gap: .25rem; padding: .5rem .25rem; border: 1px solid var(--line-strong); border-radius: 8px; cursor: pointer; font-size: .72rem; color: var(--muted); text-align: center; }
.icon-picker span .ico { width: 26px; height: 26px; }
.icon-picker input:checked + span { border-color: var(--accent); background: var(--selected); box-shadow: 0 0 0 1px var(--accent); color: var(--ink); }
.icon-picker input:focus-visible + span { outline: 3px solid var(--accent-2); outline-offset: 1px; }
.swatch.static { display: inline-block; vertical-align: middle; width: 18px; height: 18px; box-shadow: 0 0 0 1px var(--line-strong); cursor: default; }
.form-ok { background: var(--online-soft); color: var(--online-ink); margin: 0; }

/* ---------- Abas numa tela (Configurações: Geral, Tipos de equipamento, Ações, Terminal, Importação, Exportação, Compartilhamento e Sobre) ---------- */
.page-tabs { flex: none; margin: 0 1.25rem .75rem; }
/* As oito abas das Configurações precisam de uns 870 px (mais as margens, 910 px de tela). Com a
   barra lateral aberta no tamanho padrão, a tela fica mais estreita que isso numa janela de até
   ~1200 px (ou antes, com a barra alargada): em vez de quebrar “Tipos de equipamento” em duas
   linhas, a barra rola na horizontal, como em ≤760 px. A largura que importa é a da tela (.page),
   não a da janela, por isso é uma consulta de contêiner */
.page { container-type: inline-size; }
@container (max-width: 920px) {
  .page-tabs { overflow-x: auto; scrollbar-width: none; border-bottom: 0; box-shadow: inset 0 -1px 0 var(--line); }
  .page-tabs::-webkit-scrollbar { display: none; }
  .page-tabs .tab { flex: none; white-space: nowrap; margin-bottom: 0; }
}
/* Aba com tabela: ocupa a altura que sobra, e a tabela rola */
.page-pane { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.page-intro { margin: 0 1.25rem .75rem; max-width: 80ch; line-height: 1.45; }

/* ---------- Ações na mudança de status (Configurações → Ações) ---------- */
/* Aviso no alto da aba (scripts desligados), alinhado com a tabela */
.page-pane > .notice { margin: 0 1.25rem .75rem; }
/* "Quando o status mudar": grupos De e Para com caixas de seleção, separados por uma seta */
.transition-pick { display: flex; align-items: stretch; gap: .6rem; }
.state-checks { flex: 1; min-width: 0; display: grid; gap: .35rem; align-content: start; margin: 0; padding: .4rem .75rem .6rem; border: 1px solid var(--line); border-radius: 8px; }
.state-checks legend { padding: 0 .3rem; }
.state-checks .check { margin: 0; }
/* As caixas ficam dentro de um .field: desfaz o tamanho e a borda dos campos de texto */
.state-checks .check input { min-height: 0; padding: 0; border: 0; box-shadow: none; flex: none; }
.transition-arrow { width: 22px; height: 22px; flex: none; align-self: center; fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.transition { display: inline-flex; align-items: center; flex-wrap: wrap; gap: .3rem; }
.transition .transition-arrow { width: 18px; height: 18px; }
.field textarea.code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .85rem; line-height: 1.45; }
.props.vars { grid-template-columns: max-content 1fr; gap: .3rem .75rem; margin: .6rem 0 .25rem; font-size: .85rem; }
.props.vars dt { color: var(--ink); }
.props.vars dd { color: var(--muted); }
/* Falha de script: cor de erro, nunca uma cor de estado do monitoramento */
.data-table td .fail { color: var(--danger); font-weight: 600; }
.run-details { display: grid; gap: .6rem; padding: .15rem 0 .35rem; }
.run-detail { display: grid; gap: .25rem; min-width: 0; }
.run-detail > span { font-size: .85rem; font-weight: 600; color: var(--ink-2); }
.run-detail p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.run-output { margin: 0; padding: .5rem .6rem; max-height: 14rem; overflow: auto; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .8rem; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
/* Ping contínuo (botão direito no equipamento → Ferramentas → Ping, js/ping-tool.js): a janela tem altura
   própria, e a saída (uma linha por ping, com a hora) ocupa o que sobra e rola por dentro, também com a
   janela redimensionada. Linha sem resposta na cor de valor ruim, sempre com o texto dizendo o que houve */
.dialog.ping { width: min(680px, 94vw); height: min(40rem, calc(100vh - 16px)); height: min(40rem, calc(100dvh - 16px)); }
.dialog.ping > form > .ping-output { flex: 1 1 auto; min-height: 6rem; max-height: none; }
.ping-line .ping-time { margin-right: .75rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.ping-line.bad { color: var(--bad); }
/* Com o ping andando, o tamanho e o intervalo ficam como o botão desabilitado: mudam com o ping parado */
.dialog.ping .field input:disabled { opacity: .55; cursor: not-allowed; }
.data-table tbody tr.run-more:hover { background: none; }
.data-table tbody tr:has(+ tr.run-more:not([hidden])) td { border-bottom-color: transparent; }
.runs { align-content: start; }
.dialog.resized .runs:has(> .table-wrap) { grid-template-rows: auto minmax(140px, max-content); }
.dialog.resized .runs .table-wrap.inline { align-self: start; max-height: 100%; }
/* ---------- Compartilhamento de mapa (Configurações → Compartilhamento, public/js/shares.js) ---------- */
/* Campo para copiar: o texto só de leitura (no fundo do cabeçalho de tabela) com “Copiar” e “Abrir” ao
   lado, na altura do campo; sem largura para os três, os botões descem para a linha de baixo */
.copy-row { display: flex; flex-wrap: wrap; align-items: flex-start; gap: .5rem; }
.copy-row input, .copy-row textarea { flex: 1 1 12rem; width: auto; min-width: 0; }
.copy-row .btn { flex: none; height: 38px; text-decoration: none; }
.field input[readonly], .field textarea[readonly] { background: var(--surface-2); }
/* As opções de ligar e desligar ficam junto da dica de cada uma, como nos cartões das Configurações */
#share-form .check { margin: 0; }
/* ---------- Terminal SSH (aba Terminal da edição do equipamento, public/js/terminal.js) ---------- */
/* Com a sessão à mostra, o diálogo cresce para o terminal (.dialog.terminal, posto por app.js) e o
   quadro ocupa a altura que sobra nele; o tamanho escolhido arrastando as bordas é guardado à parte
   (ver makeResizable) */
.dialog.terminal { width: min(1000px, 96vw); height: min(54rem, calc(100vh - 16px)); height: min(54rem, calc(100dvh - 16px)); }
/* A aba é uma coluna: o formulário de conexão ou a sessão, que ocupa a altura do diálogo redimensionado */
.dialog .terminal-panel { display: flex; flex-direction: column; }
.terminal-start { display: grid; gap: .85rem; }
.terminal-props { margin: 0; grid-template-columns: max-content 1fr; }
.terminal-props dd { font-weight: 600; }
/* A chave do equipamento mudou: as duas impressões digitais e o botão para confiar na nova */
.terminal-key { display: grid; gap: .5rem; margin: 0; }
.terminal-key p { margin: 0; }
.terminal-key .props { grid-template-columns: max-content 1fr; gap: .25rem .75rem; margin: 0; font-size: .87rem; }
.terminal-key .props dt { color: inherit; font-weight: 600; }
.terminal-key .props small { display: block; }
.terminal-key .form-actions { justify-content: flex-start; }
.terminal-key code, .terminal-notices code, #terminal-trust code, .hv-fields code { overflow-wrap: anywhere; }
/* Sessão: barra (equipamento, situação e botões), avisos e o quadro do terminal */
.terminal-session { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: .6rem; }
.terminal-session > * { flex: none; }
.terminal-bar { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem 1rem; padding: .6rem .75rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.terminal-who { display: grid; min-width: 0; flex: 1 1 14rem; }
.terminal-who strong, .terminal-who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.terminal-state { margin: 0; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.terminal-state .spinner { width: 14px; height: 14px; border-width: 2px; margin-right: .35rem; }
.terminal-actions { display: flex; gap: .5rem; margin-left: auto; }
.terminal-notices { display: grid; gap: .4rem; }
.terminal-notices:empty { display: none; }
.terminal-notices .notice { margin: 0; }
/* O quadro (iframe com o xterm.js) no fundo --ink, com a altura que sobra no diálogo (no mínimo uns
   10 linhas de texto); com o foco nele, o anel de foco mostra para onde vai o teclado */
.terminal-session > .terminal-screen { flex: 1 1 auto; min-height: 10rem; background: var(--brand); border-radius: var(--radius); overflow: hidden; }
.terminal-screen:focus-within { outline: 3px solid var(--accent-2); outline-offset: 2px; }
.terminal-screen iframe { display: block; width: 100%; height: 100%; border: 0; }
.terminal-help { margin: 0; }
/* Configurações → Terminal (auditoria): o detalhe do resultado quebra em linhas de até 30em, para o
   texto longo de uma falha não espremer o usuário e o equipamento em várias linhas */
.terminal-sessions td:last-child small { max-width: 30em; }
/* ---------- Assistente (#/assistente, public/js/assistant.js) ---------- */
/* Modo (Teste / IA) acima da conversa, com a nota de por que o modo IA não está disponível ao lado */
.assistant-toolbar { align-items: flex-end; gap: .5rem 1rem; }
.assistant-mode { flex: 0 1 24rem; }
.assistant-mode legend { margin-bottom: .3rem; }
.assistant-mode .segmented span { min-height: 36px; justify-content: center; }
.segmented input:disabled { cursor: not-allowed; }
.segmented input:disabled + span { opacity: .55; cursor: not-allowed; }
.assistant-note { flex: 1 1 18rem; margin: 0; align-self: center; max-width: 70ch; line-height: 1.45; }
.assistant-note a { color: var(--accent); font-weight: 600; }
/* A conversa: cartão branco como a .table-wrap; as mensagens rolam e a pergunta fica embaixo */
.chat { flex: 1; min-height: 0; display: flex; flex-direction: column; margin: 0 1.25rem 1.25rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.chat-log { flex: 1; min-height: 0; overflow: auto; padding: 1rem 1.25rem; display: flex; flex-direction: column; gap: 1.1rem; }
.chat-empty { margin: auto; max-width: 44rem; display: grid; gap: .5rem; padding: 1rem 0; text-align: center; }
.chat-empty p { margin: 0; }
.chat-examples { list-style: none; margin: .35rem 0 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem; }
.chat-examples .btn { height: auto; min-height: 28px; padding: .25rem .65rem; white-space: normal; text-align: left; }
/* Pergunta: à direita, no tom neutro; resposta: texto corrido na largura da conversa (até 60rem) */
.chat-msg { min-width: 0; }
.chat-msg.user { align-self: flex-end; max-width: min(46rem, 85%); padding: .55rem .8rem; border-radius: var(--radius); background: var(--neutral-soft); white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.45; }
.chat-msg.assistant { align-self: stretch; max-width: 60rem; display: grid; gap: .5rem; }
.chat-msg .notice { margin: 0; }
.chat-msg .notice .btn { margin-left: .5rem; vertical-align: middle; }
.chat-meta { margin: 0; font-size: .78rem; color: var(--muted); }
.chat-note { margin: 0; }
.chat-wait { margin: 0; color: var(--muted); font-size: .92rem; }
.chat-wait .spinner { width: 14px; height: 14px; border-width: 2px; margin-right: .4rem; }
/* Consultas aos dados que a resposta fez: pílulas neutras (não são estado), com o spinner enquanto rodam */
.chat-tools { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .4rem; font-size: .78rem; color: var(--muted); }
.chat-tools ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .3rem; }
.chat-tool { display: inline-flex; align-items: center; gap: .35rem; padding: .1rem .6rem; border-radius: 999px; background: var(--neutral-soft); color: var(--ink-2); }
.chat-tool .spinner { width: 12px; height: 12px; border-width: 2px; }
.chat-tool.failed { color: var(--danger); }
/* Texto da resposta: o Markdown seguro de public/js/chat-markdown.js */
.chat-md { min-width: 0; line-height: 1.5; overflow-wrap: anywhere; }
.chat-md:empty { display: none; }
.chat-md > :first-child { margin-top: 0; }
.chat-md > :last-child { margin-bottom: 0; }
.chat-md p, .chat-md ul, .chat-md ol, .chat-md blockquote, .chat-md pre, .chat-md .chat-table { margin: 0 0 .65rem; }
.chat-md ul, .chat-md ol { padding-left: 1.4rem; }
.chat-md li + li { margin-top: .2rem; }
.chat-md li > ul, .chat-md li > ol { margin: .2rem 0 0; }
.chat-md h3 { margin: 1rem 0 .4rem; font-size: 1rem; }
.chat-md h4 { margin: .85rem 0 .35rem; font-size: .92rem; }
.chat-md code { padding: 0 .25rem; border-radius: 4px; background: var(--neutral-soft); }
.chat-md pre { padding: .5rem .6rem; overflow: auto; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; font-size: .85rem; line-height: 1.45; overflow-wrap: normal; }
.chat-md pre code { padding: 0; background: none; }
.chat-md blockquote { padding-left: .75rem; border-left: 3px solid var(--line); color: var(--ink-2); }
.chat-md hr { margin: .85rem 0; border: 0; border-top: 1px solid var(--line); }
.chat-md a { color: var(--accent); font-weight: 500; }
/* Tabela da resposta: a .data-table num quadro com a largura do conteúdo, que rola na horizontal */
.chat-table { width: fit-content; max-width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
.chat-table .data-table { width: auto; min-width: 100%; overflow-wrap: normal; }
.chat-table .data-table th, .chat-table .data-table td { padding: .4rem .65rem; }
.chat-table .data-table thead th { position: static; }
.chat-table .data-table tbody tr:last-child td { border-bottom: 0; }
.chat-table .data-table td.right { text-align: right; }
.chat-table .status-pill { white-space: nowrap; }
/* Pergunta: o campo cresce com o texto até 10rem (depois rola), com Enviar (ou Parar) ao lado */
.chat-form { flex: none; display: grid; gap: .4rem; padding: .75rem 1rem .8rem; border-top: 1px solid var(--line); }
.chat-form p { margin: 0; }
.chat-input { display: flex; align-items: flex-end; gap: .5rem; }
.chat-input .field { flex: 1; }
.chat-input textarea { resize: none; max-height: 10rem; line-height: 1.4; overflow-y: auto; }
/* Configurações → Geral → Assistente (IA): a chave salva (só o final) e “Remover chave” na mesma linha */
.assistant-key-state { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .4rem 1rem; }
.assistant-key-state p { margin: 0; }
.assistant-key-state .fail { color: var(--danger); font-weight: 600; }
body.page-open .zoom-controls, body.page-open .legend, body.page-open .map-nav, body.page-open .mode-bar { display: none; }
@media (max-width: 760px) {
  .page-head, .page-toolbar { padding-left: .75rem; padding-right: .75rem; }
  /* Ping contínuo: a janela na altura da tela, para a saída mostrar mais linhas (os campos ficam um embaixo do outro) */
  .dialog.ping { height: calc(100vh - 16px); height: calc(100dvh - 16px); }
  /* Visuais: os tempos do destaque, três por linha, quebram o texto como os tamanhos da fonte */
  .highlight-time .segmented label { min-width: 0; }
  .highlight-time .segmented span { white-space: normal; }
  .table-wrap { margin: 0 .75rem .75rem; }
  .page-body { padding: .25rem .75rem .75rem; }
  .page-pane > .notice, .page-tabs, .page-intro { margin: 0 .75rem .75rem; }
  /* Abas que não cabem, as de uma tela e as de um diálogo (as cinco da edição de um hypervisor passam
     da largura de um celular): a barra rola na horizontal (a linha de baixo vira sombra interna para
     o sublinhado da aba atual não ser cortado pela rolagem) */
  .tabs { overflow-x: auto; scrollbar-width: none; border-bottom: 0; box-shadow: inset 0 -1px 0 var(--line); }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs .tab { flex: none; white-space: nowrap; margin-bottom: 0; }
  /* Num diálogo, o contorno do foco fica por dentro da aba: por fora, a rolagem da barra o cortaria */
  .dialog .tabs .tab:focus-visible { outline-offset: -3px; }
  .data-table { font-size: .85rem; }
  .transition-pick { flex-direction: column; }
  .transition-pick > .transition-arrow { transform: rotate(90deg); }
  .props.vars { grid-template-columns: 1fr; gap: .1rem; }
  .props.vars dd { margin-bottom: .35rem; }
  /* Assistente: a conversa com as margens das listagens e a pergunta quase na largura toda */
  .chat { margin: 0 .75rem .75rem; }
  .chat-log { padding: .75rem; }
  .chat-form { padding: .6rem .75rem .7rem; }
  .chat-msg.user { max-width: 92%; }
  .assistant-mode { flex-basis: 100%; }
}
.dialog .notice { margin: 0; }
