/* AirMiner — mockup do front end (HTML/CSS puro, sem dependências externas) */

:root {
  --ink: #141414;          /* preto da logo */
  --ink-2: #3c3c3c;
  --muted: #6b6b6b;
  --line: #e2e0dc;
  --bg: #f6f5f2;
  --surface: #ffffff;
  --surface-2: #faf9f7;
  --accent: #006BDE;       /* azul "Air" da marca */
  --accent-ink: #ffffff;
  /* Azuis da interface: botões, seleção e títulos (marca: Air #006BDE, Miner #0926B0) */
  --blue: #006BDE;          /* botão principal, item selecionado */
  --blue-deep: #0926B0;     /* títulos h1, hover do botão principal */
  --blue-mid: #0a4fc4;      /* títulos h2, texto dos botões secundários */
  --blue-soft: #e8f1fc;     /* fundo de hover e de item escolhido */
  --blue-line: #9cc3f2;     /* borda dos botões secundários */
  --on-blue: #ffffff;
  --brand-air: #006BDE;
  --brand-miner: #0926B0;

  --ok: #1a7f37;
  --ok-bg: #e6f4ea;
  --run: #9a6700;
  --run-bg: #fff4d6;
  --draft: #57606a;
  --draft-bg: #eef0f2;
  --danger: #cf222e;

  --radius: 12px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .05), 0 4px 16px rgba(0, 0, 0, .05);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #f0efec;
    --ink-2: #c9c7c2;
    --muted: #9a978f;
    --line: #2e2d2a;
    --bg: #141413;
    --surface: #1c1c1a;
    --surface-2: #222220;
    --accent: #4c9bff;
    --blue: #1f7ae6;
    --blue-deep: #a9bcff;    /* títulos: azul claro para ler no fundo escuro */
    --blue-mid: #7fb2ff;
    --blue-soft: #14233d;
    --blue-line: #2b4f86;
    --brand-air: #3d95f5;    /* #006BDE e #0926B0 clareados para o fundo escuro */
    --brand-miner: #7d93ff;
    --ok: #4ac26b;
    --ok-bg: #12301b;
    --run: #e3b341;
    --run-bg: #33290d;
    --draft: #a0a8b0;
    --draft-bg: #2a2d31;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
  }
  /* a logo tem fundo branco: moldura clara para não ficar um "buraco" */
  .logo { border-radius: 14%; }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }  /* "hidden" sempre vence regras de display */
html, body { margin: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
button, input, select { font: inherit; color: inherit; }

/* ---------- Botões e campos ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  border: 1px solid var(--blue-line); border-radius: 10px;
  padding: .7rem 1.2rem; cursor: pointer; text-decoration: none;
  font-weight: 600; background: var(--surface); color: var(--blue-mid);
  transition: transform .06s ease, background .15s ease;
}
.btn:hover { background: var(--blue-soft); border-color: var(--blue); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--blue); border-color: var(--blue); color: var(--on-blue); }
.btn-primary:hover { background: var(--blue-deep); border-color: var(--blue-deep); color: var(--on-blue); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--muted); padding: .45rem .7rem; }
.btn-ghost:hover { color: var(--blue); background: var(--blue-soft); }
.btn:focus-visible, .input:focus-visible, .chip:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 2px;
}

.field { display: grid; gap: .35rem; }
.field label { font-size: .85rem; font-weight: 600; color: var(--ink-2); }
.input {
  width: 100%; padding: .7rem .85rem; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface);
}
.input:focus { border-color: var(--blue); outline: none; }

/* ---------- Login ---------- */
.login-page {
  min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
}
.login-card {
  width: min(380px, 100%); background: var(--surface); border: 1px solid var(--line);
  border-radius: 18px; box-shadow: var(--shadow); padding: 32px 28px 28px;
  display: grid; gap: 22px;
}
.login-card .logo { width: 180px; height: auto; margin: 0 auto; display: block; }
.login-card h1 { margin: 0; font-size: 1.05rem; text-align: center; font-weight: 500; color: var(--muted); }
.login-form { display: grid; gap: 14px; }
.login-form .btn { width: 100%; margin-top: 6px; }
.login-error { color: var(--danger); font-size: .88rem; min-height: 1.2em; margin: -4px 0 0; }
.login-foot { text-align: center; font-size: .8rem; color: var(--muted); margin: 0; }

/* ---------- Topo ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1120px; margin: 0 auto; padding: 10px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand .logo { width: 52px; height: 52px; }
.brand-name { font-weight: 800; font-size: 1.25rem; letter-spacing: -.01em; }
.brand-name .b-air { color: var(--brand-air); }
.brand-name .b-miner { color: var(--brand-miner); }
.user { display: flex; align-items: center; gap: 10px; font-size: .92rem; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: var(--blue-deep); color: var(--on-blue); font-weight: 700; font-size: .85rem;
}

/* ---------- Conteúdo ---------- */
.container { max-width: 1120px; margin: 0 auto; padding: 28px 24px 64px; display: grid; gap: 24px; }
.container > * { min-width: 0; }  /* sem isto, a tabela alarga a coluna da grade e a página toda */
.table-wrap { overflow-x: auto; }

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
}

/* Status do servidor */
.server {
  padding: 22px 24px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
}
.server-dot {
  width: 14px; height: 14px; border-radius: 50%; flex: none; background: var(--draft);
  box-shadow: 0 0 0 5px var(--draft-bg);
}
.server.is-running .server-dot { background: var(--ok); box-shadow: 0 0 0 5px var(--ok-bg); animation: pulse 1.8s ease-in-out infinite; }
.server.is-standby .server-dot { background: var(--run); box-shadow: 0 0 0 5px var(--run-bg); }
@keyframes pulse { 50% { box-shadow: 0 0 0 9px color-mix(in srgb, var(--ok-bg) 40%, transparent); } }
.server-text { flex: 1; min-width: 220px; }
.server-label { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.server-state { font-size: 1.6rem; font-weight: 800; letter-spacing: -.01em; line-height: 1.2; }
.server-detail { color: var(--muted); font-size: .92rem; margin-top: 2px; }
.server-meta { display: flex; gap: 22px; flex-wrap: wrap; }
.meta { display: grid; }
.meta b { font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.meta span { font-size: .78rem; color: var(--muted); }
.progress { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; margin-top: 10px; max-width: 360px; }
.progress > i { display: block; height: 100%; background: var(--ok); border-radius: 3px; }

/* Botão nova simulação */
.new-sim { display: flex; }
.new-sim .btn { padding: .95rem 1.6rem; font-size: 1.02rem; border-radius: 12px; }
.new-sim .plus { font-size: 1.3rem; line-height: 0; font-weight: 400; }

/* Lista */
.list-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 20px 24px 14px;
}
.list-head h2 { margin: 0; font-size: 1.15rem; }
.list-head .count { color: var(--muted); font-weight: 500; font-size: .95rem; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.search { width: 220px; padding: .5rem .75rem; }
.chip {
  border: 1px solid var(--line); background: var(--surface); border-radius: 999px;
  padding: .35rem .8rem; font-size: .85rem; cursor: pointer; color: var(--ink-2);
}
.chip[aria-pressed="true"] { background: var(--blue); color: var(--on-blue); border-color: var(--blue); }

table.sims { width: 100%; border-collapse: collapse; font-size: .93rem; }
.sims th, .sims td { text-align: left; padding: 12px 16px; border-top: 1px solid var(--line); vertical-align: middle; }
.sims th {
  font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted);
  font-weight: 600; background: var(--surface-2); white-space: nowrap;
}
.sims th:first-child, .sims td:first-child { padding-left: 24px; }
.sims th:last-child, .sims td:last-child { padding-right: 24px; }
.sims th button { all: unset; cursor: pointer; }
.sims th button:hover { color: var(--ink); }
.sims th .arrow { opacity: .35; margin-left: 4px; }
.sims th[aria-sort] .arrow { opacity: 1; }
.sims tbody tr { cursor: pointer; transition: background .12s ease; }
.sims tbody tr:hover { background: var(--surface-2); }
.sim-name { font-weight: 600; }
.sim-geo {
  display: block; font-size: .8rem; color: var(--muted); font-family: var(--mono); margin-top: 1px;
  max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.nowrap { white-space: nowrap; font-variant-numeric: tabular-nums; }
.comment {
  color: var(--ink-2); max-width: 340px; overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;  /* até 2 linhas */
}
@media (max-width: 1000px) { .comment { max-width: 220px; } }
.empty { padding: 36px 24px; text-align: center; color: var(--muted); border-top: 1px solid var(--line); }

.badge {
  display: inline-flex; align-items: center; gap: 6px; border-radius: 999px;
  padding: .2rem .65rem; font-size: .8rem; font-weight: 600; white-space: nowrap;
}
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge-completa { color: var(--ok); background: var(--ok-bg); }
.badge-rodando { color: var(--run); background: var(--run-bg); }
.badge-rodando::before { animation: blink 1.2s ease-in-out infinite; }
.badge-rascunho { color: var(--draft); background: var(--draft-bg); }
@keyframes blink { 50% { opacity: .25; } }

.mock-note { font-size: .8rem; color: var(--muted); text-align: center; margin: 0; }

/* Página provisória */
.placeholder { padding: 48px 24px; text-align: center; display: grid; gap: 12px; justify-items: center; }
.placeholder h1 { margin: 0; font-size: 1.4rem; }
.placeholder p { margin: 0; color: var(--muted); max-width: 520px; }

/* ---------- Página da simulação ---------- */
.page-head { display: grid; gap: 4px; }
.back { color: var(--muted); text-decoration: none; font-size: .9rem; width: fit-content; }
.back:hover { color: var(--ink); }
.title-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.title-row h1 { margin: 0; font-size: 1.6rem; letter-spacing: -.01em; }
.sub { color: var(--muted); font-size: .92rem; }
.sub code { font-family: var(--mono); font-size: .85rem; }

.sim-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.sim-layout > * { min-width: 0; }

.viewer-card { overflow: hidden; }
.viewer {
  position: relative; height: clamp(380px, 64vh, 760px);
  background: var(--surface-2); touch-action: none;
}
/* absoluto: o canvas nunca empurra o layout (evita laço com o ResizeObserver) */
.viewer canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; outline: none; }
.viewer-bar {
  position: absolute; top: 12px; z-index: 2; display: flex; gap: 4px; padding: 4px;
  background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(6px);
  border: 1px solid var(--line); border-radius: 10px;
}
.viewer-bar-left { left: 12px; }
.viewer-bar-right { right: 12px; }
.vbtn {
  border: 0; background: transparent; border-radius: 7px; padding: .32rem .6rem;
  font-size: .82rem; font-weight: 600; color: var(--ink-2); cursor: pointer;
}
.vbtn:hover { background: var(--surface-2); color: var(--ink); }
.vbtn[aria-pressed="true"] { background: var(--blue); color: var(--on-blue); }
.viewer-legend {
  position: absolute; left: 12px; bottom: 12px; z-index: 2; font-size: .78rem; color: var(--muted);
  background: color-mix(in srgb, var(--surface) 80%, transparent); padding: 4px 8px; border-radius: 6px;
}
.viewer-pick {
  position: absolute; right: 12px; bottom: 12px; z-index: 2; min-width: 190px; font-size: .82rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
  box-shadow: var(--shadow); display: grid; gap: 2px;
}
.viewer-pick[hidden], .viewer-bar[hidden] { display: none; }
.viewer-pick b { font-size: .9rem; }
.viewer-pick span { color: var(--muted); }
.viewer-msg {
  position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 24px;
  color: var(--muted); font-size: .95rem; z-index: 1; pointer-events: none;
}
.viewer-msg[hidden] { display: none; }

.side { display: grid; gap: 16px; }
.side-card { padding: 16px 18px; }
.side-card h2 { margin: 0 0 10px; font-size: .95rem; }
.side-card h2 .count { color: var(--muted); font-weight: 500; }
.side-card p { margin: 0; color: var(--ink-2); }
.kv { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: .88rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.yes { color: var(--ok); font-weight: 600; }
.no { color: var(--run); font-weight: 600; }

.parts { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; max-height: 280px; overflow: auto; }
.parts li {
  display: grid; grid-template-columns: auto auto 1fr auto; align-items: center; gap: 8px;
  padding: 5px 6px; border-radius: 7px; font-size: .86rem; cursor: pointer;
}
.parts li:hover { background: var(--surface-2); }
.parts li.is-picked { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.parts input { margin: 0; accent-color: var(--blue); }
.swatch { width: 12px; height: 12px; border-radius: 3px; border: 1px solid rgba(0, 0, 0, .15); }
.parts .pn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.parts .pt { color: var(--muted); font-size: .78rem; font-variant-numeric: tabular-nums; }

.res-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.res-item { background: var(--surface-2); border-radius: 10px; padding: 10px 12px; }
.res-item b { display: block; font-size: 1.35rem; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.res-item span { font-size: .78rem; color: var(--muted); }
.res-ref { margin-top: 12px; font-size: .84rem; }
.res-ref table { width: 100%; border-collapse: collapse; }
.res-ref th, .res-ref td { padding: 4px 0; text-align: right; font-variant-numeric: tabular-nums; }
.res-ref th:first-child, .res-ref td:first-child { text-align: left; }
.res-ref th { color: var(--muted); font-weight: 600; font-size: .76rem; }
.res-ref td { border-top: 1px solid var(--line); }

@media (max-width: 980px) {
  .sim-layout { grid-template-columns: minmax(0, 1fr); }
  .viewer { height: clamp(320px, 56vh, 560px); }
}
@media (max-width: 520px) {
  .viewer-bar { top: 8px; }
  .viewer-bar-left { left: 8px; right: 8px; overflow-x: auto; }
  .viewer-bar-right { top: auto; bottom: 8px; right: 8px; }
  .viewer-legend { bottom: 52px; left: 8px; }
  .viewer-pick { bottom: 52px; right: 8px; }
}

/* ---------- Fila ---------- */
.badge-fila { color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.server-queue {
  flex-basis: 100%; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  border-top: 1px solid var(--line); padding-top: 12px; margin-top: 2px; font-size: .9rem; color: var(--ink-2);
}
.queue-link { font-weight: 700; text-decoration: none; white-space: nowrap; }
.queue-link:hover { text-decoration: underline; }

.q-running { padding: 18px 22px; display: grid; gap: 12px; }
.q-run-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.q-run-head .server-dot.run { background: var(--ok); box-shadow: 0 0 0 5px var(--ok-bg); animation: pulse 1.8s ease-in-out infinite; }
.q-run-title { flex: 1; min-width: 220px; display: grid; gap: 2px; }
.q-run-title a { color: var(--ink); text-decoration: none; font-size: 1.1rem; }
.q-run-title a:hover { text-decoration: underline; }
.q-run-eta { display: grid; text-align: right; }
.q-run-eta b { font-size: 1.3rem; font-variant-numeric: tabular-nums; }
.q-run-eta span { font-size: .8rem; color: var(--muted); }
.q-running .progress { max-width: none; margin: 0; }

.queue { list-style: none; margin: 0; padding: 0; }
.q-item {
  display: grid; grid-template-columns: auto 52px minmax(0, 1fr) 200px auto; align-items: center; gap: 12px;
  padding: 12px 20px 12px 12px; border-top: 1px solid var(--line); background: var(--surface);
  transition: background .15s ease;
}
.q-item.is-moved { background: color-mix(in srgb, var(--accent) 6%, var(--surface)); }
.q-item.is-dragging { opacity: .4; }
.q-item.drop-before { box-shadow: inset 0 3px 0 var(--accent); }
.q-item.drop-after { box-shadow: inset 0 -3px 0 var(--accent); }
.q-handle { cursor: grab; color: var(--muted); font-size: 1.2rem; padding: 4px 6px; user-select: none; }
.q-pos { font-weight: 800; font-size: 1.15rem; font-variant-numeric: tabular-nums; display: grid; line-height: 1.1; }
.q-pos small { font-size: .7rem; font-weight: 600; color: var(--accent); }
.q-main { display: grid; gap: 2px; min-width: 0; }
.q-name { color: var(--ink); font-weight: 700; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-name:hover { text-decoration: underline; }
.q-meta { font-size: .82rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-meta code { font-family: var(--mono); font-size: .78rem; }
.q-time { display: grid; }
.q-time b { font-variant-numeric: tabular-nums; }
.q-time span { font-size: .78rem; color: var(--muted); }
.q-actions { display: flex; gap: 2px; }
.q-remove:hover { color: var(--danger); }

.savebar {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 40;
  width: min(760px, calc(100vw - 32px)); display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--ink); border-radius: 12px; padding: 10px 14px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .18); font-size: .9rem;
}
.savebar .spacer { flex: 1; }

/* Celular: sem alça de arrastar (usa ↑ ↓), previsão e botões em linhas próprias */
@media (max-width: 760px) {
  .q-item { grid-template-columns: 40px minmax(0, 1fr); padding: 12px; }
  .q-handle { display: none; }
  .q-time { grid-column: 2; }
  .q-actions { grid-column: 1 / -1; justify-content: flex-end; }
}

/* ---------- Resultados 3D ---------- */
.res3d { display: grid; gap: 12px; }
.res3d h2 { margin: 0; }
.rgroup { display: grid; gap: 6px; }
.rgroup.row { display: flex; gap: 16px; flex-wrap: wrap; }
.rlabel { font-size: .78rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.res3d .seg { width: 100%; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; }
.res3d .seg button { padding: .35rem .2rem; font-size: .8rem; }
.rcut { display: grid; gap: 6px; }
.rcut input[type="range"] { width: 100%; accent-color: var(--blue); }
.cbars {
  position: absolute; right: 12px; bottom: 12px; z-index: 2; display: grid; gap: 8px; width: 230px;
}
.cbar {
  background: color-mix(in srgb, var(--surface) 92%, transparent); border: 1px solid var(--line);
  border-radius: 8px; padding: 6px 8px; display: grid; gap: 4px; box-shadow: var(--shadow);
}
.cbar-label { font-size: .74rem; font-weight: 700; color: var(--ink-2); }
.cbar-grad { height: 10px; border-radius: 3px; }
.cbar-range { display: flex; justify-content: space-between; }
.cbar-range input {
  width: 64px; border: 0; background: transparent; font: .74rem var(--mono); color: var(--muted); padding: 0;
}
.cbar-range input[data-end="1"] { text-align: right; }
.cbar-range input:focus { color: var(--ink); outline: 1px solid var(--line); border-radius: 3px; }
.probe {
  position: absolute; z-index: 3; pointer-events: none; background: rgba(20, 20, 20, .88); color: #fff;
  font: 600 .78rem/1.2 var(--font); padding: 5px 8px; border-radius: 6px; white-space: nowrap;
}
.viewer-pick { bottom: auto; top: 58px; }

/* ---------- Nova simulação ---------- */
.container.wide { max-width: 1440px; }
.wizard { display: grid; grid-template-columns: minmax(0, 1fr) 440px; gap: 20px; align-items: start; }
.wizard > * { min-width: 0; }
.wizard-viewer { position: sticky; top: 86px; }
.wizard-viewer .viewer { height: calc(100vh - 120px); min-height: 420px; max-height: 860px; }
.viewer-labels { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.tag3d {
  font: 700 .72rem/1 var(--font); color: #fff; background: rgba(20, 20, 20, .82);
  padding: 4px 6px; border-radius: 6px; white-space: nowrap; transform: translateY(-14px);
}
.tag3d.tag-poroso { background: #c4661a; }
.viewer-mode {
  position: absolute; top: 58px; left: 50%; transform: translateX(-50%); z-index: 2;
  background: var(--accent); color: #fff; font-size: .82rem; font-weight: 600;
  padding: 6px 12px; border-radius: 999px; box-shadow: var(--shadow); white-space: nowrap;
}
.viewer-showall { position: absolute; top: 58px; right: 12px; z-index: 2; background: var(--surface); }

.wizard-panel { display: flex; flex-direction: column; max-height: calc(100vh - 106px); position: sticky; top: 86px; }
.steps { display: grid; grid-template-columns: repeat(5, 1fr); border-bottom: 1px solid var(--line); }
.step {
  border: 0; background: none; cursor: pointer; padding: 12px 4px 10px; font-size: .78rem; font-weight: 600;
  color: var(--muted); display: grid; justify-items: center; gap: 4px; border-bottom: 2px solid transparent;
}
.step i {
  font-style: normal; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  border: 1.5px solid currentColor; font-size: .72rem;
}
.step:disabled { cursor: default; opacity: .45; }
.step.done i { background: var(--ok); border-color: var(--ok); color: #fff; }
.step[aria-current="step"] { color: var(--blue-mid); border-bottom-color: var(--blue); }
.step[aria-current="step"] i { background: var(--blue); border-color: var(--blue); color: var(--on-blue); }

.pane { padding: 18px 20px; overflow-y: auto; flex: 1; display: grid; gap: 14px; align-content: start; }
.pane[hidden] { display: none; }
.wizard-foot { display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); align-items: center; }
.wizard-foot .spacer { flex: 1; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-sm { padding: .3rem .6rem; font-size: .8rem; border-radius: 7px; font-weight: 600; }

.hint { margin: 0; font-size: .84rem; color: var(--muted); }
.hint b { color: var(--ink-2); }
.hint.warn, .warn { color: var(--run); }
.hint.bad, .bad { color: var(--danger); }
.hint.good, .good { color: var(--ok); }
.note { margin: 0; font-size: .84rem; padding: 10px 12px; border-radius: 8px; background: var(--surface-2); color: var(--ink-2); }

.dropzone {
  display: grid; justify-items: center; gap: 4px; padding: 26px 16px; cursor: pointer; text-align: center;
  border: 1.5px dashed var(--line); border-radius: 12px; background: var(--surface-2); transition: border-color .15s;
}
.dropzone:hover, .dropzone.is-over { border-color: var(--blue); background: var(--blue-soft); }
.dropzone span { font-size: .84rem; color: var(--muted); }
.upload { display: grid; gap: 12px; }
.examples { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: .84rem; color: var(--muted); }
.upload-status { display: grid; gap: 8px; }
.file-row { display: flex; align-items: center; gap: 8px; }
.file-name { font-family: var(--mono); font-size: .84rem; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.progress-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: .86rem; }
.progress-steps li { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.progress-steps li::before { content: ""; width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid currentColor; flex: none; }
.progress-steps li.is-active { color: var(--run); }
.progress-steps li.is-active::before { border-color: currentColor; border-right-color: transparent; animation: spin .8s linear infinite; }
.progress-steps li.is-done { color: var(--ok); }
.progress-steps li.is-done::before { background: currentColor; }
@keyframes spin { to { transform: rotate(360deg); } }

.group { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px 14px; margin: 0; display: grid; gap: 10px; }
.group legend { font-weight: 700; font-size: .88rem; padding: 0 4px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; padding: 3px; gap: 3px; width: fit-content; }
.seg button { border: 0; background: none; padding: .35rem .8rem; border-radius: 6px; font-weight: 600; font-size: .85rem; cursor: pointer; color: var(--ink-2); }
.seg button[aria-checked="true"] { background: var(--blue); color: var(--on-blue); }
.rot-grid { display: grid; gap: 8px; }
.rot { display: grid; grid-template-columns: 18px auto 1fr auto auto; align-items: center; gap: 6px; }
.rot label { font-weight: 700; }
.input.num { padding: .4rem .55rem; text-align: right; font-variant-numeric: tabular-nums; min-width: 0; }
.rot .input.num { width: 100%; }
.field-inline { display: flex; align-items: center; gap: 8px; font-size: .88rem; }
.field-inline .input.num { width: 110px; }
.field-inline label { color: var(--ink-2); font-weight: 600; }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: .88rem; cursor: pointer; }
.check input { margin-top: 3px; accent-color: var(--blue); }
.input:disabled { background: var(--surface-2); color: var(--muted); }
textarea.input { resize: vertical; font: inherit; }

.slider-field { display: grid; gap: 4px; }
.sf-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: .9rem; }
.sf-head label { font-weight: 700; }
.sf-head .input.num { width: 84px; display: inline-block; }
.slider-field input[type="range"] { width: 100%; accent-color: var(--blue); }
.sf-range { display: flex; justify-content: space-between; font-size: .74rem; color: var(--muted); }
.kv.derived { background: var(--surface-2); border-radius: 10px; padding: 10px 12px; }

.cards { display: grid; gap: 10px; }
.cards:empty { display: none; }
.empty-hint { margin: 0; font-size: .86rem; color: var(--muted); text-align: center; padding: 18px; border: 1px dashed var(--line); border-radius: 10px; }
.empty-hint[hidden] { display: none; }
.zcard { border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: grid; gap: 10px; }
.zcard.is-hover { border-color: var(--accent); }
.zcard-head { display: flex; align-items: center; gap: 8px; }
.zcard-head b { flex: 1; }
.zcard-tag { font: 700 .72rem/1 var(--font); background: var(--blue); color: var(--on-blue); padding: 4px 6px; border-radius: 5px; }
.zcard-tag.poroso { background: #c4661a; color: #fff; }
.zcard .kv { font-size: .82rem; }
.zgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.zgrid .field label { font-size: .76rem; }
.zgrid .input { padding: .4rem .55rem; }
.unit-in { display: flex; align-items: center; gap: 4px; font-size: .8rem; color: var(--muted); }
.unit-in .input { flex: 1; }
.curve { width: 100%; height: auto; display: block; }
.curve text { font: 10px var(--font); fill: var(--muted); }
.fit { font-size: .82rem; font-variant-numeric: tabular-nums; display: grid; gap: 2px; }
details.more summary { cursor: pointer; font-size: .82rem; color: var(--muted); }
details.more[open] summary { margin-bottom: 8px; }

.summary { font-size: .86rem; }
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: .86rem; }
.checks li { display: flex; gap: 8px; }
.checks li::before { content: "✓"; color: var(--ok); font-weight: 700; }
.checks li.warn::before { content: "!"; color: var(--run); }
.checks li.bad::before { content: "✕"; color: var(--danger); }

.dialog { border: 1px solid var(--line); border-radius: 14px; padding: 22px; width: min(440px, calc(100vw - 32px)); background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.dialog::backdrop { background: rgba(0, 0, 0, .35); }
.dialog h2 { margin: 0 0 10px; font-size: 1.15rem; }
.dialog-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50;
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-size: .9rem; box-shadow: var(--shadow);
}
.toast[hidden] { display: none; }

@media (max-width: 1100px) {
  .wizard { grid-template-columns: minmax(0, 1fr); }
  .wizard-viewer, .wizard-panel { position: static; max-height: none; }
  .wizard-viewer .viewer { height: 52vh; min-height: 320px; }
}

/* ---------- Celular: tabela vira cartões ---------- */
@media (max-width: 760px) {
  .topbar-inner, .container { padding-left: 16px; padding-right: 16px; }
  .brand .logo { width: 42px; height: 42px; }
  .user-name { display: none; }
  .server-state { font-size: 1.35rem; }
  .new-sim .btn { width: 100%; }
  .list-head { padding: 18px 16px 12px; }
  .search { width: 100%; }
  .filters { width: 100%; }

  .sims thead { display: none; }
  .sims, .sims tbody, .sims tr, .sims td { display: block; width: 100%; }
  .sims tr { border-top: 1px solid var(--line); padding: 12px 16px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; }
  .sims td { border: 0; padding: 0 !important; }
  .sims td[data-col="nome"] { grid-column: 1; }
  .sims td[data-col="status"] { grid-column: 2; grid-row: 1; align-self: start; }
  .sims td[data-col="data"], .sims td[data-col="autor"] { font-size: .85rem; color: var(--muted); grid-column: 1 / -1; }
  .sims td[data-col="data"]::before { content: "Data: "; }
  .sims td[data-col="autor"]::before { content: "Autor: "; }
  .sims td[data-col="comentarios"] { grid-column: 1 / -1; }
  .comment { max-width: none; }
  .sim-geo { max-width: none; white-space: normal; overflow-wrap: anywhere; }
  .table-wrap { overflow: visible; }
}

/* Porosos: escolha da placa do núcleo numa peça com várias placas */
.placas { display: grid; gap: 8px; }
.placa-list { display: grid; gap: 6px; }
.placa-chip {
  display: flex; align-items: center; gap: 8px; text-align: left; width: 100%;
  font: inherit; font-size: .84rem; color: var(--ink-2); background: var(--surface);
  border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; cursor: pointer;
}
.placa-chip:hover { border-color: var(--accent); }
.placa-chip > b {
  flex: none; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink); font-size: .78rem;
}
.placa-chip > span { flex: 1; min-width: 0; }
.placa-chip > i {
  flex: none; font-style: normal; font-size: .72rem; font-weight: 600; color: var(--run);
  background: var(--run-bg); padding: 2px 6px; border-radius: 4px;
}
.placa-chip[aria-pressed="true"] { border-color: #c4661a; background: color-mix(in srgb, #c4661a 10%, var(--surface)); }
.placa-chip[aria-pressed="true"] > b { background: #c4661a; }
.tag3d.tag-placa { background: var(--accent); border-radius: 50%; min-width: 1.5em; text-align: center; }
.tag3d.tag-placa-sel { background: #c4661a; border-radius: 50%; min-width: 1.5em; text-align: center; }

/* ---------- Pausar / retomar / cancelar ---------- */
.server.is-paused .server-dot { background: var(--run); box-shadow: 0 0 0 5px var(--run-bg); }
.server-actions, .q-run-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.server-actions:empty, .q-run-actions:empty { display: none; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: color-mix(in srgb, var(--danger) 85%, #000); }
.btn-danger-ghost { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, var(--line)); background: transparent; }
.btn-danger-ghost:hover { background: color-mix(in srgb, var(--danger) 8%, transparent); }
.badge-pausada { color: var(--run); background: var(--run-bg); }
.badge-cancelada { color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, transparent); }
.q-run-head .server-dot.paused { background: var(--run); box-shadow: 0 0 0 5px var(--run-bg); }
.q-tag { display: inline-block; font-size: .72rem; font-weight: 700; color: var(--run); background: var(--run-bg); padding: 1px 6px; border-radius: 4px; margin-left: 6px; vertical-align: 1px; }
.cancel-opts { display: grid; gap: 10px; margin: 12px 0; border: 0; padding: 0; }

/* ---------- Resultados: séries do gráfico (paleta categórica validada, claro e escuro) ---------- */
:root { --series-1: #2a78d6; --series-2: #eb6834; --series-3: #1baf7a; --series-4: #eda100; }
@media (prefers-color-scheme: dark) {
  :root { --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500; }
}

/* Forças do grupo clicado */
.viewer-forces {
  position: absolute; left: 12px; top: 58px; z-index: 2; width: min(360px, calc(100% - 24px)); font-size: .8rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
  box-shadow: var(--shadow); display: grid; gap: 6px;
}
.viewer-forces[hidden] { display: none; }
.vf-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: .9rem; }
.vf-close { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: .9rem; padding: 2px 4px; }
.viewer-forces table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.viewer-forces th { color: var(--muted); font-weight: 600; font-size: .72rem; text-align: right; padding: 2px 4px; }
.viewer-forces td { text-align: right; padding: 3px 4px; border-top: 1px solid var(--line); }
.viewer-forces th:first-child, .viewer-forces td:first-child { text-align: left; color: var(--ink-2); }
.vf-foot { display: grid; gap: 1px; color: var(--muted); font-size: .74rem; }

/* Botões de exportação */
.export-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }

/* Convergência */
.conv-card { margin-top: 18px; }
.conv-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.conv-head h2 { margin: 0; }
.conv-series { display: flex; gap: 6px; flex-wrap: wrap; }
.conv-chip {
  display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: .8rem; color: var(--ink-2);
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; cursor: pointer;
}
.conv-chip i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.conv-chip b { font-variant-numeric: tabular-nums; color: var(--ink); }
.conv-chip[aria-pressed="false"] { opacity: .45; }
.conv-chip.conv-table-btn[aria-pressed="false"] { opacity: 1; }
.conv-chip.conv-table-btn[aria-pressed="true"] { background: var(--blue); color: var(--on-blue); border-color: var(--blue); }
.conv-chart { position: relative; margin-top: 8px; }
.conv-svg { display: block; width: 100%; }
.conv-window { fill: var(--line); opacity: .45; }
.conv-grid { stroke: var(--line); stroke-width: 1; }
.conv-grid.zero { stroke: var(--muted); opacity: .55; }
.conv-ax { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.conv-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.conv-end { fill: var(--ink-2); font-size: 11.5px; font-weight: 600; }
.conv-cross { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.conv-dot { stroke: var(--surface); stroke-width: 2; }
.conv-tip {
  position: absolute; z-index: 3; pointer-events: none; display: grid; gap: 2px; min-width: 150px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px;
  box-shadow: var(--shadow); font-size: .78rem; color: var(--ink-2);
}
.conv-tip[hidden] { display: none; }
.conv-tip span { display: flex; align-items: center; gap: 6px; }
.conv-tip span b { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--ink); }
.conv-tip i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.conv-table { margin-top: 10px; border-collapse: collapse; font-size: .82rem; font-variant-numeric: tabular-nums; }
.conv-table[hidden] { display: none; }
.conv-table th { color: var(--muted); font-weight: 600; font-size: .74rem; text-align: right; padding: 4px 10px; }
.conv-table td { text-align: right; padding: 4px 10px; border-top: 1px solid var(--line); }
.conv-table th:first-child, .conv-table td:first-child { text-align: left; }

/* ---------- Fases do servidor: Pre-Mesh → Pre-Sim → Meshing → Running ---------- */
.phases { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; font-size: .78rem; font-weight: 600; }
.phases li { display: flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; color: var(--muted); border: 1px solid var(--line); }
.phases li + li::before { content: "→"; display: none; }
.phases li.is-done { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 35%, var(--line)); }
.phases li.is-done::after { content: "✓"; }
.phases li.is-current { color: var(--ok); background: var(--ok-bg); border-color: var(--ok); }
.phases li.is-current::before { content: ""; display: block; width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: blink 1.4s ease-in-out infinite; }
.phases li.is-current.is-paused { color: var(--run); background: var(--run-bg); border-color: var(--run); }
.phases li.is-current.is-paused::before { animation: none; }
.q-running .phases { margin: 0; }
.progress.is-indeterminate > i { width: 35% !important; animation: indet 1.4s ease-in-out infinite; }
@keyframes indet { from { transform: translateX(-100%); } to { transform: translateX(290%); } }

/* ---------- Nova simulação: envio com porcentagem ---------- */
.progress-steps li { flex-wrap: wrap; }
.progress-steps .ps-st { margin-left: auto; font-weight: 600; font-variant-numeric: tabular-nums; }
.progress-steps .upload-bar { flex-basis: 100%; max-width: none; margin: 4px 0 2px 18px; }
.progress-steps .upload-bar > i { background: var(--run); transition: width .15s linear; }
.progress-steps li.is-done .upload-bar > i { background: var(--ok); }
@media (prefers-reduced-motion: reduce) {
  .progress.is-indeterminate > i { animation: none; width: 100% !important; opacity: .45; }
  .phases li.is-current::before { animation: none; }
}

/* ---------- Página de comparação ---------- */
.cmp-pick { padding: 18px 22px; display: grid; gap: 12px; }
.cmp-pick-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.cmp-pick-head h2, .cmp-card-head h2 { margin: 0; font-size: 1.1rem; }
.cmp-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 8px; }
.cmp-list label { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.cmp-list li.is-on label { border-color: var(--blue); background: var(--blue-soft); }
.cmp-list input { accent-color: var(--blue); }
.cmp-list input:disabled + .cmp-dot + .cmp-li-name { color: var(--muted); }
.cmp-li-name { flex: 1; min-width: 0; font-weight: 600; font-size: .9rem; display: grid; }
.cmp-li-name small { font-weight: 400; color: var(--muted); font-size: .78rem; }
.cmp-li-num { font-size: .78rem; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cmp-none { color: var(--muted); }
.cmp-dot { width: 12px; height: 12px; border-radius: 50%; flex: none; border: 1px solid var(--line); }
.cmp-empty { padding: 18px 22px; color: var(--muted); }
#cmp-body { display: grid; gap: 24px; }
.cmp-card { padding: 18px 22px; display: grid; gap: 12px; }
.cmp-card-head { display: grid; gap: 2px; }
.cmp-card-head .hint { margin: 0; }
.cmp-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .85rem; color: var(--ink-2); }
.cmp-chip { display: inline-flex; align-items: center; gap: 6px; color: inherit; text-decoration: none; font-weight: 600; }
a.cmp-chip:hover { text-decoration: underline; }
.cmp-chip > i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }
.cmp-chip > i.cmp-mk-base { width: 9px; height: 9px; border-radius: 1px; background: var(--ink); transform: rotate(45deg); }
.cmp-chip > i.cmp-mk-base.dash { width: 16px; height: 0; border-radius: 0; transform: none; background: none; border-top: 2px dashed var(--ink); }
.cmp-chart { width: 100%; }
.cmp-chart svg { display: block; max-width: 100%; height: auto; }
.cmp-chart text { font: 12px system-ui, sans-serif; fill: var(--muted); }
.cmp-chart .ax-t { fill: var(--ink-2); font-weight: 600; }
.cmp-chart .grid { stroke: var(--line); stroke-width: 1; }
.cmp-chart .zero { stroke: var(--muted); stroke-width: 1; }
.cmp-chart .axis { stroke: var(--ink-2); stroke-width: 1.5; }
.cmp-chart .ref { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 4 4; opacity: .7; }
.cmp-chart .base-line { stroke: var(--ink); stroke-width: 2; stroke-dasharray: 6 5; }
.cmp-chart .mk { stroke: var(--surface); stroke-width: 2; }
.cmp-chart .hit, .cmp-chart .hitarea { fill: transparent; cursor: crosshair; }
.cmp-chart .pt-name { fill: var(--ink); font-weight: 700; font-size: 12.5px; }
.cmp-chart .pt-ab { fill: var(--ink-2); font-size: 11.5px; }
.cmp-chart .xhair { stroke: var(--muted); stroke-width: 1; }
.cmp-chart .dot { stroke: var(--surface); stroke-width: 2; }
.cmp-chart .na, .cmp-table .na { color: var(--muted); font-size: .85rem; }
.cmp-table { width: 100%; border-collapse: collapse; font-size: .88rem; font-variant-numeric: tabular-nums; }
.cmp-table th, .cmp-table td { padding: 7px 12px; border-top: 1px solid var(--line); text-align: right; vertical-align: top; }
.cmp-table thead th { border-top: 0; font-size: .82rem; vertical-align: bottom; }
.cmp-table th[scope="row"] { text-align: left; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.cmp-table td small { display: block; color: var(--muted); font-size: .76rem; }
.cmp-table tr.tot th, .cmp-table tr.tot td { border-top: 2px solid var(--ink-2); font-weight: 700; }
.cmp-table caption { caption-side: bottom; text-align: left; padding-top: 8px; }
.cmp-seg { flex-wrap: wrap; }
.cmp-view-bar { display: flex; flex-wrap: wrap; gap: 8px; }
.cmp-imgs { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.cmp-imgs.wide { grid-template-columns: 1fr; }
@media (min-width: 900px) { .cmp-imgs.wide { grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); } }
.cmp-imgs figure { margin: 0; display: grid; gap: 6px; align-content: start; }
.cmp-imgs figcaption { font-size: .85rem; }
.cmp-imgs img { width: 100%; height: auto; display: block; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.cmp-noimg { border: 1px dashed var(--line); border-radius: 8px; padding: 28px 14px; color: var(--muted); font-size: .85rem; text-align: center; }
.cmp-scale { grid-column: 1 / -1; margin: 0; }
.cmp-tip { position: fixed; z-index: 50; pointer-events: none; background: var(--surface); color: var(--ink); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 10px; font-size: .82rem; box-shadow: 0 6px 20px rgb(0 0 0 / .12); max-width: 320px; display: grid; gap: 2px; font-variant-numeric: tabular-nums; }
.cmp-tip .tip-d { color: var(--muted); }
.cmp-tip .tip-sw { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.new-sim { gap: 10px; flex-wrap: wrap; }
.res-links { display: flex; gap: 8px; flex-wrap: wrap; }
#cmp-body > *, .cmp-card > * { min-width: 0; }
.cmp-card .table-wrap { overflow-x: auto; }   /* o modo celular da lista de simulações deixa visible */
.cmp-table thead .cmp-chip { text-align: left; align-items: flex-start; max-width: 190px; } .cmp-table thead .cmp-chip > i { margin-top: 4px; }

/* ---------- Títulos em azul ---------- */
h1, .title-row h1, .placeholder h1 { color: var(--blue-deep); }
h2, .list-head h2, .side-card h2, .res3d h2, .dialog h2, .conv-head h2, .cmp-pick-head h2, .cmp-card-head h2 { color: var(--blue-mid); }
.login-card h1 { color: var(--muted); }   /* slogan do login fica neutro */
.server-state { color: var(--blue-deep); }
.server.is-standby .server-state { color: var(--ink); }
.btn-danger:hover { border-color: var(--danger); }
.btn-danger-ghost:hover { border-color: color-mix(in srgb, var(--danger) 55%, var(--line)); }

/* ---------- Usuários e permissões ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.user-name { display: inline-grid; line-height: 1.15; }
.user-role { font-size: .72rem; color: var(--muted); font-weight: 500; }
.user .btn-ghost[aria-current="page"] { color: var(--blue); background: var(--blue-soft); }
.role { display: inline-block; font-size: .75rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.role-admin { color: var(--on-blue); background: var(--blue-deep); }
.role-engenheiro { color: var(--blue-mid); background: var(--blue-soft); border: 1px solid var(--blue-line); }
.role-leitura { color: var(--draft); background: var(--draft-bg); }
.users td, .log td { vertical-align: middle; }
.users tr.is-off td { color: var(--muted); }
.users .you { color: var(--muted); font-weight: 500; }
.u-actions { display: flex; gap: 6px; justify-content: flex-end; white-space: nowrap; }
.perm-card .table-wrap { padding: 0 24px 18px; }
.perm-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.perm-table th, .perm-table td { padding: 9px 12px; border-top: 1px solid var(--line); text-align: center; }
.perm-table thead th { border-top: 0; }
.perm-table th[scope="row"] { text-align: left; font-weight: 500; color: var(--ink-2); }
.perm-table input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--blue); cursor: pointer; }
.perm-table input:disabled { cursor: not-allowed; }
.perm-num { width: 72px; margin: 0 auto; text-align: center; }
.perm-table caption { caption-side: bottom; text-align: left; padding-top: 12px; line-height: 1.6; }
.log-filter { width: auto; padding: .45rem .7rem; }
.u-fields { display: grid; gap: 12px; margin: 6px 0 14px; }
.u-fields .hint { margin: 0; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; pointer-events: auto; }
.perm-note { font-size: .85rem; color: var(--muted); margin: 8px 0 0; }
.perm-table thead th:first-child { text-align: left; }
.senha-box { display: flex; gap: 8px; margin: 10px 0 16px; }
.senha-valor { font-family: var(--mono); font-size: 1.05rem; letter-spacing: .04em; }
.login-card .login-form h2 { margin: 0; font-size: 1rem; text-align: center; }
.geo-list { display: grid; gap: 6px; font-size: .85rem; color: var(--muted); } .geo-list ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 10px; } .geo-list li { display: flex; align-items: center; gap: 6px; } .geo-list small { color: var(--muted); }

/* ---------- Execução da simulação ---------- */
.run-card .progress { max-width: none; }
.run-card p { margin: 8px 0 0; font-size: .9rem; }
.run-erro { color: var(--danger); }
.run-log { max-height: 260px; overflow: auto; font: 11.5px/1.45 var(--mono); background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; white-space: pre-wrap; word-break: break-all; margin: 8px 0 0; }
#run-log-box summary { cursor: pointer; font-size: .85rem; color: var(--muted); margin-top: 10px; }

/* ---------- Fluxo forçado ---------- */
.zcard-tag.fluxo { background: #1baf7a; color: #fff; }
.zcard-tag.critica { background: #7a4fc0; color: #fff; }
.fluxo-grid { display: grid; gap: 8px; margin-top: 8px; }
.fluxo-grid .field-inline { flex-wrap: wrap; }
.fluxo-grid .input.num.vec { width: 70px; }
.sub-h { margin: 18px 0 6px; font-size: .95rem; color: var(--blue-mid); }
#modo-p { margin-bottom: 10px; }

/* Página da simulação: renomear, clonar e zonas porosas */
.rename-btn { font-size: 1rem; padding: .2rem .45rem; }
.rename-form { display: flex; gap: 6px; align-items: center; flex: 1 1 320px; max-width: 560px; }
.rename-form .input { flex: 1; font-size: 1.1rem; font-weight: 600; padding: .35rem .6rem; }
.clone-btn { margin-left: auto; }
.poros-item + .poros-item { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.poros-item h3 { margin: 0 0 4px; font-size: .92rem; }
.poros-item ul { margin: 6px 0 0; padding-left: 18px; font-size: .84rem; }
