/* CTE — layout console + cena (design "Membrana") */
.cte { display: grid; gap: 16px; grid-template-columns: 290px minmax(0, 1fr); align-items: start; }
.cte > * { min-width: 0; }
.console { display: grid; gap: 12px; position: sticky; top: 76px; }
.console .panel { padding: 14px 16px; }
.console .panel h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); margin: 0 0 8px; }
.console .panel h2 .muted { text-transform: none; letter-spacing: 0; font-weight: 500; }
.detalhes-card { grid-column: 1 / -1; }
@media (max-width: 960px) {
  .cte { grid-template-columns: 1fr; }
  .console { position: static; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
  .cena-card { order: -1; }
}

.opcoes { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.opcoes .btn.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); opacity: 1; }
#inibidores .btn.on { background: color-mix(in srgb, var(--danger) 16%, var(--surface)); border-color: var(--danger); color: var(--ink); }
#desacopladores .btn.on { background: color-mix(in srgb, #e8a35a 30%, var(--surface)); border-color: #e8a35a; color: var(--ink); }
.linha-opt { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: .88rem; color: var(--ink-2); margin-top: 10px; }
.linha-opt select { font: inherit; padding: 4px 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.linha-opt.chk { justify-content: flex-start; cursor: pointer; }
.linha-opt input { accent-color: var(--accent); width: 17px; height: 17px; }
.linha-opt .chip { margin-left: auto; }

.cena-card { padding: 12px 14px 14px; }
.cena-head { display: flex; justify-content: flex-end; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.contadores { display: flex; gap: 8px; flex-wrap: wrap; width: 100%; }
.cont { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px; border-radius: 999px; background: var(--surface-2); font-size: .82rem; color: var(--ink-2); }
.cont i { font-style: normal; }
.cont b { color: var(--ink); font-variant-numeric: tabular-nums; font-size: .95rem; }
.medidor { display: inline-block; width: 90px; height: 10px; border-radius: 5px; background: var(--surface);
  border: 1px solid var(--line); vertical-align: middle; overflow: hidden; }
.medidor span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #b39ddb, #7b4fc9); transition: width .4s; }
.status { margin: 10px 0 0; font-size: .92rem; color: var(--ink-2); padding: 8px 12px; border-left: 3px solid var(--prog); background: var(--surface-2); border-radius: 0 var(--radius-xs) var(--radius-xs) 0; }

.cena { overflow-x: auto; border-radius: var(--radius-sm); background: #fbfaf6; border: 1px solid var(--line); }
.cena svg { display: block; width: 100%; min-width: 760px; height: auto; --eim: rgba(123,79,201,0); }
.cena svg text { font-family: var(--font); }
.cena svg .pool { pointer-events: none; }

.regiao { font-size: 15px; font-weight: 700; fill: #6b5f4a; font-style: italic; letter-spacing: .02em; }
.nome-cplx { font-size: 14px; font-weight: 700; fill: #2e3340; paint-order: stroke; stroke: #fbfaf6; stroke-width: 4px; }
.sub-cplx { font-size: 13px; font-weight: 700; fill: #fff; paint-order: stroke; stroke: rgba(0,0,0,.35); stroke-width: 3px; pointer-events: none; }
.dnp-lbl { fill: #8a4e0c; }
.badge text { font-size: 14px; font-weight: 700; fill: #fff; }
.badge rect, .badge polygon, .badge circle { stroke: rgba(0,0,0,.18); }
.badge.peq text { font-size: 12px; }
.badge.cit text { font-size: 12px; }
.badge rect, .badge polygon, .badge circle, .badge text { transition: fill .25s; }
.token text { font-size: 12px; font-weight: 700; fill: #fff; }
.token.atp text { font-size: 11px; }
.token.el text { font-size: 11px; }
.token.vaz circle { opacity: .75; }
.pool text { font-size: 11px; font-weight: 700; fill: #fff; }
.pool g { opacity: .82; }

.cap text { font-size: 13px; font-weight: 700; fill: #b71c1c; paint-order: stroke; stroke: #fbfaf6; stroke-width: 4px; }
.cap { filter: drop-shadow(0 2px 2px rgba(0,0,0,.3)); }

.hit { fill: transparent; cursor: pointer; }
.hit:hover, .hit:focus-visible { fill: rgba(31, 127, 181, .10); stroke: #1f7fb5; stroke-width: 2; stroke-dasharray: 6 4; outline: none; }

/* .f1 gira por JavaScript (atributo transform), ver cte.js */
.cplx { transition: filter .2s; }

.legenda-cena { display: flex; flex-wrap: wrap; gap: 14px; font-size: .82rem; color: var(--ink-2); margin-top: 10px; align-items: center; }
.legenda-cena .sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.sw.ox { background: #d9412b; } .sw.red { background: #2f6fdb; } .sw.el { background: #3fb34a; border-radius: 50%; box-shadow: 0 0 6px #3fb34a; }
.sw.hp { background: #7b4fc9; border-radius: 50%; } .sw.cap { background: #c62828; border-radius: 6px 6px 2px 2px; }

.detalhes-card .opcoes .btn { flex-direction: column; align-items: flex-start; gap: 0; line-height: 1.2; border-radius: var(--radius-sm); }
.detalhes-card .opcoes .btn .muted { font-weight: 500; font-size: .75rem; }

.dlg-det { width: min(760px, calc(100vw - 24px)); max-width: none; }
.dlg-det img { display: block; width: 100%; height: auto; border-radius: var(--radius-sm); background: #000; }
.partes { display: flex; gap: 6px; margin-bottom: 10px; }
.partes .btn.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.nota-det { font-size: .82rem; margin: 8px 0 0; }

.dica-rolar { display: none; font-size: .78rem; color: var(--ink-3); margin: 6px 0 0; }
@media (max-width: 760px) {
  .cena svg { min-width: 700px; }
  .dica-rolar { display: block; }
}

/* modo escuro: a cena continua clara (é uma ilustração), só a moldura muda */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .cena { border-color: #3a4a60; }
}
