/* Layout: painel de supervisório (IHM) claro — etiquetas de tag em mono, títulos condensados como placas de chão de fábrica.
   Semântica fixa: operador = verde-petróleo, concorrente = magenta, evento falso = âmbar de sinalização, segredo = vermelho. */
:root {
  --bg: #e9eeec;
  --panel: #fbfcfb;
  --panel-2: #f1f5f3;
  --ink: #14212a;
  --muted: #586a72;
  --line: #c6d1cf;
  --ope: #0b766e;
  --int: #b02a66;
  --fake: #d98a00;
  --secret: #cf3a2f;
  --ok: #2f8a4f;
  --ope-soft: #d6ece9;
  --int-soft: #f5dde8;
  --fake-soft: #fbecc8;
  --secret-soft: #f8dcd8;
  --f-display: 'IBM Plex Sans Condensed', 'Roboto Condensed', 'Arial Narrow', sans-serif;
  --f-body: 'IBM Plex Sans', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --f-mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  --radius: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1719; --panel: #162125; --panel-2: #1c292e; --ink: #e4ecea; --muted: #93a6aa; --line: #2b3c41;
    --ope: #2fb5a8; --int: #e8649f; --fake: #f2b23a; --secret: #f0675c; --ok: #4fbf78;
    --ope-soft: #12322f; --int-soft: #3a1b29; --fake-soft: #3a2e12; --secret-soft: #3d1c19;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1719; --panel: #162125; --panel-2: #1c292e; --ink: #e4ecea; --muted: #93a6aa; --line: #2b3c41;
  --ope: #2fb5a8; --int: #e8649f; --fake: #f2b23a; --secret: #f0675c; --ok: #4fbf78;
  --ope-soft: #12322f; --int-soft: #3a1b29; --fake-soft: #3a2e12; --secret-soft: #3d1c19;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--f-body); -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--ope); outline-offset: 2px; }
.mono { font-family: var(--f-mono); }
.tag { font-family: var(--f-mono); font-size: 0.78em; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }

/* tokens de evento */
.evt { display: inline-flex; align-items: center; justify-content: center; min-width: 1.9em; padding: 0.05em 0.45em; border-radius: 6px;
  font-family: var(--f-mono); font-weight: 600; border: 1.5px solid currentColor; line-height: 1.35; }
.evt.a { color: var(--ink); }
.evt.b { color: var(--muted); border-style: dashed; }
.evt.c { color: var(--ink); }
.evt.fake { color: var(--fake); background: var(--fake-soft); }
.evt.era { color: var(--muted); text-decoration: line-through; border-style: dashed; }
.evt.blocked { color: var(--secret); text-decoration: line-through; }
.c-ope { color: var(--ope); } .c-int { color: var(--int); } .c-fake { color: var(--fake); } .c-secret { color: var(--secret); } .c-muted { color: var(--muted); }

/* diagramas */
.dg { width: 100%; height: auto; display: block; color: var(--ink); overflow: visible; }
.dg text { font-family: var(--f-mono); fill: var(--ink); }
.dg .ev { font-size: 19px; font-weight: 600; }
.dg .ev-hidden { fill: var(--muted); }
.dg .ev-fake { fill: var(--fake); }
.dg .qn { font-size: 17px; font-weight: 600; }
.dg .sub { font-size: 14px; fill: var(--muted); font-family: var(--f-body); }
.dg .nd { fill: var(--panel); stroke: var(--ink); stroke-width: 2; transition: fill .25s, stroke .25s; }
.dg .nd2 { fill: none; stroke: var(--secret); stroke-width: 2; }
.dg .secret .nd { stroke: var(--secret); fill: var(--secret-soft); }
.dg .node.on .nd { fill: var(--ope-soft); stroke: var(--ope); stroke-width: 4; }
.dg .secret.on .nd { fill: var(--secret); stroke: var(--secret); }
.dg .secret.on text { fill: #fff; }
.dg .secret.on rect:not(.nd) { stroke: #fff; }
.dg .box.ope .nd { stroke: var(--ope); fill: var(--ope-soft); }
.dg .box.int .nd { stroke: var(--int); fill: var(--int-soft); }
.dg .qn.ope { fill: var(--ope); }
.dg .qn.int { fill: var(--int); }
.dg .jt.opesecret .nd { stroke: var(--secret); }
.dg .pre2 { fill: none; stroke: var(--fake); stroke-width: 2.4; stroke-dasharray: 5 4; }
.dg .jt.on .nd { fill: var(--fake-soft); stroke: var(--ink); stroke-width: 4; }
.dg .arc path { stroke: var(--ink); }
.dg .arc.fake path { stroke: var(--fake); }
.dg .arc.fake text { fill: var(--fake); }
.dg .arc.era path { stroke: var(--muted); }
.dg .arc.era text { fill: var(--muted); }
.dg .arc.on path { stroke-width: 5; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
