/* PokeCalc — visual inspirado na ficha do PokeIdle: fundo escuro, painéis terracota,
   caixas internas vinho-escuro, placas "de metal" e títulos com contorno. */
:root {
  color-scheme: dark;
  --bg: #1d1418;
  --painel: #b0634b;
  --painel-borda: #4a2a2c;
  --painel-luz: #c9785d;
  --caixa: #33232a;
  --caixa-2: #2a1c22;
  --caixa-borda: #5b3b40;
  --texto: #f6e9df;
  --texto-2: #d9c3b8;
  --muted: #a88f88;
  --ouro: #ffcf4a;
  --lilas: #c8b4ff;
  --up: #6be38f;
  --down: #ff7a7a;
  --radius: 10px;
  /* Séries dos gráficos (paleta validada, passos do modo escuro). */
  --s1: #3987e5;
  --s1-soft: #6da7ec;
  --s2: #d95926;
  --grid: #3d2c32;
  --axis: #5b3b40;
  --font-titulo: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: radial-gradient(ellipse at top, #2c1c22 0%, var(--bg) 60%) fixed;
  color: var(--texto);
  font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
}

a { color: var(--ouro); }
small { font-weight: 400; }

/* ---------- topo */
.topbar {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 10px 20px;
  background: linear-gradient(#5a3236, #432428);
  border-bottom: 3px solid #2a1719;
  box-shadow: 0 2px 0 #6e3f3f inset;
}
.brand { font-weight: 900; font-size: 22px; letter-spacing: .5px; text-shadow: 2px 2px 0 #1a0e10; }
.brand span { color: var(--ouro); }
.brand small { font-family: system-ui, sans-serif; font-size: 12px; color: var(--texto-2); margin-left: 6px; text-shadow: none; }
#nav { display: flex; gap: 6px; flex-wrap: wrap; }
#nav a {
  padding: 6px 14px;
  border-radius: 8px;
  color: var(--texto-2);
  text-decoration: none;
  font-weight: 600;
  border: 2px solid transparent;
}
#nav a:hover { color: var(--texto); }
#nav a.active {
  color: #2a1508;
  background: linear-gradient(#ffd977, #e9a930);
  border-color: #6b4410;
  box-shadow: 0 2px 0 #6b4410;
}

main { max-width: 1280px; margin: 0 auto; padding: 18px 16px 48px; display: grid; gap: 16px; }

/* ---------- painéis */
.painel {
  background: linear-gradient(var(--painel-luz), var(--painel) 40px);
  border: 3px solid var(--painel-borda);
  border-radius: 12px;
  box-shadow: 0 0 0 2px #d98b6c inset, 0 4px 0 #2a1719;
  padding: 14px;
  min-width: 0;
}
.painel.vazio { text-align: center; padding: 40px; font-weight: 600; }
.painel h2, .fi-cartao-tit {
  font-family: var(--font-titulo);
  font-weight: 900;
  font-size: 16px;
  margin: 0 0 8px;
  letter-spacing: .4px;
  text-shadow: 2px 2px 0 #3a1d1d;
  text-transform: uppercase;
}
.painel h2 small { text-transform: none; color: var(--texto-2); font-family: system-ui, sans-serif; font-size: 12px; text-shadow: none; }
.painel-cab { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.painel-cab h2 { margin: 0; }
h3.sub { font-size: 12px; margin: 14px 0 6px; color: #ffe2cf; text-transform: uppercase; letter-spacing: .06em; }
.dica { font-size: 12px; color: #ffe2cf; margin: 0 0 10px; opacity: .9; }
.painel-cab .dica { margin: 0; }
.nota-rodape { font-size: 12px; color: #ffe2cf; margin: 10px 0 0; }
.muted { color: var(--muted); }
.strong { font-weight: 700; }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.ok { color: var(--up); font-weight: 600; }
.aviso { margin: 0; font-size: 12px; color: #ffd0a0; }

.layout { display: grid; grid-template-columns: 330px 1fr; gap: 16px; align-items: start; }
.coluna { display: grid; gap: 16px; min-width: 0; }

.toolbar { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.toolbar h2 { margin: 0; }
.toolbar-actions { display: flex; gap: 8px; }
.grow { flex: 1 1 220px; }

/* ---------- formulários */
.field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; margin-bottom: 8px; }
.field > span { font-weight: 700; color: #fff3ea; }
.field small { color: #ffe2cf; }
input, select, textarea {
  font: inherit;
  color: var(--texto);
  background: var(--caixa-2);
  border: 2px solid var(--caixa-borda);
  border-radius: 7px;
  padding: 7px 9px;
  width: 100%;
}
select:disabled, input:disabled { opacity: .45; }
textarea { font-family: ui-monospace, Consolas, monospace; font-size: 12px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--ouro); outline-offset: 0; }
.check { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.check input { width: auto; accent-color: var(--ouro); }
.toolbar-check { align-self: center; margin: 14px 4px 0; background: var(--caixa); border: 2px solid var(--caixa-borda); border-radius: 8px; padding: 6px 10px; }
.toolbar-check small { color: var(--muted); }
.form-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; align-items: end; }
.inline-form { display: flex; gap: 8px; margin: 4px 0 10px; }

.btn {
  font: inherit;
  font-weight: 700;
  border: 2px solid #3a1d1d;
  background: linear-gradient(#e7a77f, #c97b58);
  color: #2a1508;
  border-radius: 8px;
  padding: 7px 14px;
  cursor: pointer;
  box-shadow: 0 3px 0 #3a1d1d, 0 1px 0 #ffd2b4 inset;
}
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #3a1d1d; }
.btn.primary { background: linear-gradient(#d7a4ff, #9a5fd6); color: #fff; text-shadow: 1px 1px 0 #3d1f66; border-color: #2e1650; box-shadow: 0 3px 0 #2e1650, 0 1px 0 #ecd4ff inset; }
.btn.ghost { background: var(--caixa); color: var(--texto); border-color: var(--caixa-borda); box-shadow: 0 3px 0 #1a0e10; }
.btn.sm { padding: 4px 10px; font-size: 12px; }
.btn:disabled { opacity: .45; cursor: default; }
.btn.danger, .link.danger { color: var(--down); }
.link { background: none; border: 0; color: var(--ouro); cursor: pointer; font: inherit; padding: 2px 4px; }

.chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 2px 0 10px; }
.painel-cab .chips { margin: 0; }
.chip {
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  border: 2px solid var(--caixa-borda);
  background: var(--caixa);
  color: var(--texto);
  border-radius: 999px;
  padding: 3px 10px;
  cursor: pointer;
}
.chip:hover { border-color: var(--ouro); }
.chip.on { background: var(--ouro); color: #2a1508; border-color: #6b4410; }
.chip.destaque { border-color: #7c5bb5; background: #3a2850; }

/* ---------- tabelas */
.table-wrap { overflow-x: auto; background: var(--caixa); border: 2px solid var(--caixa-borda); border-radius: 8px; }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
th, td { padding: 7px 9px; text-align: left; border-bottom: 1px solid var(--caixa-borda); white-space: nowrap; }
thead th { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
tbody tr:last-child th, tbody tr:last-child td { border-bottom: 0; }
tfoot th, tfoot td { border-top: 2px solid var(--caixa-borda); border-bottom: 0; font-weight: 700; }
td.num { text-align: right; }
table.mini { background: var(--caixa); border-radius: 8px; overflow: hidden; }
table.mini td { padding: 3px 4px; }
table.mini th { font-size: 12px; }
table.mini input { padding: 3px 6px; }
.tabela.compacta th, .tabela.compacta td { padding: 5px 6px; font-size: 12px; }
.duelo tr.menor th, .duelo tr.menor td { font-size: 12px; color: var(--texto-2); }
.duelo td.vence { color: var(--up); font-weight: 700; }
tr.best { background: rgba(200, 180, 255, .12); }
tr.best th { box-shadow: inset 3px 0 0 var(--lilas); }
.resumo { background: var(--caixa); border: 2px solid var(--caixa-borda); border-radius: 8px; padding: 8px 10px; display: grid; gap: 2px; font-size: 12px; }
.resumo b { font-size: 15px; }

.delta { font-size: 11px; font-weight: 700; margin-left: 4px; }
.delta.up { color: var(--up); }
.delta.down { color: var(--down); }
.delta.flat { color: var(--muted); }

/* ---------- ficha (fi-) */
.painel.ficha { display: grid; gap: 14px; }
.fi-heroi { display: grid; grid-template-columns: 1fr 340px; gap: 16px; align-items: stretch; }
.fi-tag { display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; background: #3a1d1d; color: var(--ouro); padding: 2px 8px; border-radius: 6px; margin-bottom: 6px; }
.fi-nome { font-size: 26px; font-weight: 900; line-height: 1.15; text-shadow: 2px 2px 0 #3a1d1d; }
.fi-refino { font-family: system-ui, sans-serif; font-size: 13px; vertical-align: middle; background: #4ccf6c; color: #10351a; border: 2px solid #1f5a2e; padding: 0 6px; border-radius: 6px; text-shadow: none; }
.fi-sub { display: flex; gap: 8px; align-items: center; margin: 8px 0 6px; }
.fi-nivel { display: inline-block; background: #3a1d1d; color: var(--ouro); font-weight: 800; padding: 3px 12px; border-radius: 999px; font-size: 13px; }
.fi-nivel-antes { font-size: 12px; color: #ffe2cf; }
.fi-tipos { margin-bottom: 6px; }
.tipo { display: inline-block; font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 5px; background: #777; color: #fff; text-shadow: 1px 1px 0 rgba(0,0,0,.35); }
.tipo.electric { background: #e5c32f; color: #3a2c00; text-shadow: none; }
.tipo.fire { background: #e8673a; } .tipo.water { background: #4a8ee8; } .tipo.grass { background: #5cb85c; }
.tipo.psychic { background: #e8508a; } .tipo.dragon { background: #6a5be0; } .tipo.dark { background: #5a4a44; }
.tipo.ghost { background: #6b5aa6; } .tipo.fairy { background: #ef8fd2; } .tipo.steel { background: #8ea3b5; }
.tipo.ice { background: #6fd3e0; color: #0a3a40; text-shadow: none; } .tipo.fighting { background: #c0453b; }
.tipo.poison { background: #9a52b8; } .tipo.ground { background: #c9a352; } .tipo.rock { background: #a8924a; }
.tipo.bug { background: #96b52a; } .tipo.flying { background: #8fa6e8; } .tipo.normal { background: #9c9a88; }
.fi-selos { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.selo { font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 6px; border: 2px solid rgba(0,0,0,.35); }
.selo.shiny { background: #ffd95a; color: #4a3200; }
.selo.zmove { background: #2b3f7a; color: #ffe066; }
.selo.mega { background: #6b2f8f; color: #ffd9ff; }
.selo.lend { background: #8f6b10; color: #fff3c4; }
.selo.golpe { background: #3a2830; color: var(--texto-2); }

.fi-placas { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 8px; }
.fi-placa {
  display: flex; flex-direction: column; gap: 1px;
  padding: 7px 10px;
  border-radius: 8px;
  border: 2px solid rgba(0,0,0,.45);
  min-width: 0;
}
.fi-placa-rot { font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; opacity: .85; }
.fi-placa-rot i { font-style: normal; color: #ff8fb0; margin-right: 4px; }
.fi-placa-val { font-size: 20px; font-weight: 800; line-height: 1.2; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fi-placa-val small { font-size: 12px; opacity: .7; }
.fi-placa-sub { font-size: 11px; opacity: .9; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.fi-placa.metal { box-shadow: 0 1px 0 rgba(255,255,255,.45) inset, 0 3px 0 rgba(0,0,0,.3); color: #1e1a1a; }
.fi-placa.metal.t1 { background: linear-gradient(#cfcfd4, #a7a7ae); }
.fi-placa.metal.t2 { background: linear-gradient(#8de38f, #5cbf63); }
.fi-placa.metal.t3 { background: linear-gradient(#8fc6ff, #5a9be6); }
.fi-placa.metal.t4 { background: linear-gradient(#d7b0ff, #a874e6); }
.fi-placa.metal.t5 { background: linear-gradient(#ffe68a, #f0b52c); }
.fi-placa.destaque { background: var(--caixa); border-color: #1a0e10; color: var(--texto); }
.fi-placa.destaque .fi-placa-val { color: var(--ouro); }
.fi-delta { font-size: 11px; font-weight: 800; padding: 0 5px; border-radius: 4px; background: rgba(0,0,0,.35); }
.fi-delta.up { color: var(--up); }
.fi-delta.down { color: var(--down); }
.fi-placa.metal .fi-delta { background: rgba(0,0,0,.55); }
.fi-acoes { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }

/* palco com a nota */
.fi-palco {
  position: relative;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 0%, #4a3a4a 0%, #2a1e28 55%, #1e151c 100%);
  border: 3px solid #1a0e10;
  border-radius: 10px;
  padding: 18px 16px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  min-height: 300px;
}
.fi-feixe {
  position: absolute; top: -20px; left: 50%; width: 260px; height: 260px; transform: translateX(-50%);
  background: conic-gradient(from 160deg at 50% 0%, transparent 0deg, color-mix(in srgb, var(--cor) 35%, transparent) 20deg, transparent 40deg);
  filter: blur(6px);
  pointer-events: none;
}
.fi-pedestal {
  position: absolute; top: 158px; left: 50%; width: 150px; height: 26px; transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(ellipse, color-mix(in srgb, var(--cor) 55%, #2a1e28) 0%, #3a2a38 70%);
  box-shadow: 0 0 24px color-mix(in srgb, var(--cor) 45%, transparent);
}
.fi-sprite { position: absolute; top: 46px; left: 50%; transform: translateX(-50%); width: 128px; height: 128px; filter: drop-shadow(0 4px 0 rgba(0,0,0,.35)); }
.fi-nota { position: relative; text-align: center; display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: 0 8px; }
.fi-nota-num { font-size: 52px; font-weight: 900; font-variant-numeric: tabular-nums; color: var(--cor); line-height: 1; text-shadow: 3px 3px 0 #1a0e10, 0 0 18px color-mix(in srgb, var(--cor) 40%, transparent); }
.fi-nota-max { font-size: 24px; font-weight: 800; color: #b7a9b9; }
.fi-faixa { flex-basis: 100%; font-weight: 800; letter-spacing: .12em; color: var(--cor); font-size: 13px; margin-top: 2px; }
.fi-regua { position: relative; display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; width: 100%; margin-top: 10px; }
.fi-regua .seg { height: 9px; border-radius: 2px; background: #3a2a34; border: 1px solid #1a0e10; }
.fi-marca { position: absolute; top: -4px; width: 3px; height: 17px; background: #fff; border-radius: 2px; box-shadow: 0 0 4px #fff; transform: translateX(-50%); }

/* cartão de stats */
.fi-cartao { background: var(--caixa); border: 2px solid #1a0e10; border-radius: 10px; padding: 12px 14px; }
.fi-cartao-tit i { font-style: normal; color: var(--lilas); }
.fi-stats { display: grid; grid-template-columns: 240px 1fr; gap: 16px; align-items: center; }
.fi-radar { width: 100%; max-width: 240px; display: block; }
.fi-radar .r-grade { fill: none; stroke: #5b4650; stroke-width: 1; }
.fi-radar .r-rot { fill: #e5d3d8; font-size: 9px; font-weight: 700; }
.fi-radar .r-stats { fill: rgba(200, 180, 255, .35); stroke: var(--lilas); stroke-width: 2; }
.fi-radar .r-hoje { fill: none; stroke: #8c7fa8; stroke-width: 1.5; stroke-dasharray: 2 3; }
.fi-radar .r-iv { fill: none; stroke: var(--ouro); stroke-width: 1.5; stroke-dasharray: 4 3; }
.fi-legenda { display: flex; gap: 12px; flex-wrap: wrap; font-size: 11px; font-weight: 700; justify-content: center; }
.fi-legenda span { display: inline-flex; align-items: center; gap: 5px; }
.fi-legenda i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; }
.lg-stats { background: var(--lilas); }
.lg-hoje { background: #8c7fa8; }
.lg-iv { background: var(--ouro); }
.fi-barras { display: grid; gap: 6px; background: var(--caixa-2); border: 2px solid #1a0e10; border-radius: 8px; padding: 10px 12px; }
.fi-barra { display: grid; grid-template-columns: 58px 1fr 64px 52px; gap: 10px; align-items: center; font-size: 13px; }
.fi-barra-rot { font-weight: 800; }
.fi-barra-trilho { position: relative; height: 11px; background: #4a2f38; border-radius: 6px; overflow: hidden; }
.fi-barra-fill, .fi-barra-hoje { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 6px; }
.fi-barra-fill { background: linear-gradient(#e2d6ff, #b9a3f5); }
.fi-barra-hoje { background: rgba(255,255,255,.18); z-index: 1; border-right: 2px solid #fff; }
.fi-barra-fill { z-index: 0; }
.fi-barra-val { text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; }
.fi-iv { font-size: 11px; font-weight: 800; text-align: right; }
.fi-iv.lo { color: #ff9a4a; }
.fi-iv.mid { color: #ffd84a; }
.fi-iv.hi { color: #6be38f; }
.fi-iv.max { color: #7ef9ff; }
.fi-barra.total { border-top: 1px solid var(--caixa-borda); padding-top: 6px; color: var(--texto-2); }

/* ---------- coleção */
.pk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.pk-card {
  background: linear-gradient(var(--painel-luz), var(--painel) 40px);
  border: 3px solid var(--painel-borda);
  border-radius: 12px;
  box-shadow: 0 0 0 2px #d98b6c inset, 0 4px 0 #2a1719;
  padding: 12px;
  display: grid;
  gap: 10px;
}
.pk-topo { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; }
.sprite { image-rendering: pixelated; flex: none; object-fit: contain; }
.sprite-btn { background: radial-gradient(circle, color-mix(in srgb, var(--cor, #ffd166) 30%, #2a1e28) 0%, #2a1e28 70%); border: 2px solid #1a0e10; padding: 0; cursor: pointer; border-radius: 10px; }
.pk-nome { font-size: 18px; font-weight: 900; text-shadow: 2px 2px 0 #3a1d1d; }
.pk-linha { display: flex; gap: 6px; align-items: center; margin-top: 4px; flex-wrap: wrap; }
.pk-nota { text-align: center; background: var(--caixa); border: 2px solid #1a0e10; border-radius: 10px; padding: 6px 10px; }
.pk-nota b { display: block; font-weight: 900; font-size: 24px; color: var(--cor); text-shadow: 2px 2px 0 #1a0e10; line-height: 1.1; }
.pk-nota span { font-size: 10px; font-weight: 800; text-transform: uppercase; color: var(--cor); letter-spacing: .06em; }
.pk-poderes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.pk-poderes div { background: var(--caixa); border: 2px solid #1a0e10; border-radius: 8px; padding: 5px 8px; display: flex; flex-direction: column; }
.pk-poderes span { font-size: 10px; font-weight: 800; text-transform: uppercase; color: var(--texto-2); }
.pk-poderes b { color: var(--ouro); font-size: 15px; white-space: nowrap; }
.pk-golpe { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: center; }
.pk-golpe .check { margin: 0; }
.pk-z { display: flex; align-items: center; gap: 6px; }
.zside { display: inline-flex; border: 2px solid var(--caixa-borda); border-radius: 7px; overflow: hidden; }
.zside.alerta { border-color: #ff9a4a; }
.zbtn { font: inherit; font-size: 11px; font-weight: 800; padding: 2px 7px; border: 0; background: var(--caixa-2); color: var(--muted); cursor: pointer; }
.zbtn.on { background: #2b3f7a; color: #ffe066; }
select.alerta { border-color: #ff9a4a; }
.selo.zmove.alerta { border-color: #ff9a4a; }
.toolbar-zside { min-width: 260px; }
.toolbar-zside .field { margin: 0; }
.toolbar-zside .aviso { max-width: 300px; }
.pk-golpe-nome { font-size: 12px; font-weight: 700; background: var(--caixa); border: 2px solid var(--caixa-borda); border-radius: 7px; padding: 4px 8px; color: var(--texto-2); }
.pk-acoes { display: flex; gap: 6px; flex-wrap: wrap; }
.pk-evo { display: grid; gap: 4px; }
.pk-evo-linha {
  display: grid; grid-template-columns: 1fr 1fr auto; gap: 2px 8px; align-items: center;
  font-size: 12px; font-weight: 700; color: var(--texto-2);
  background: var(--caixa); border: 2px solid var(--caixa-borda); border-radius: 7px; padding: 3px 4px 3px 8px;
}
.pk-evo-linha > span:first-child { grid-column: 1 / 3; }
.pk-evo-linha .btn { grid-column: 3; grid-row: 1 / 3; }
.pk-evo-linha b { color: var(--texto); }
.pk-evo-linha small { color: var(--ouro); font-weight: 800; }
.aviso-txt { color: #ffd0a0; }
.aviso .chip { margin-left: 6px; }

/* ---------- simulador */
.stepper { display: inline-flex; align-items: center; gap: 6px; }
.stepper span { min-width: 28px; text-align: center; }
.step {
  width: 24px; height: 24px; border-radius: 6px;
  border: 2px solid var(--caixa-borda); background: var(--caixa-2); color: var(--texto);
  cursor: pointer; font: inherit; line-height: 1; font-weight: 800;
}
.step:hover:not(:disabled) { border-color: var(--ouro); }
.step:disabled { opacity: .35; cursor: default; }
.ladder { display: flex; gap: 4px; align-items: stretch; height: 190px; background: var(--caixa); border: 2px solid var(--caixa-borda); border-radius: 8px; padding: 10px 10px 4px; }
.rung { flex: 1; display: flex; flex-direction: column; align-items: center; min-width: 0; }
.rung:hover .rung-bar { filter: brightness(1.15); }
.rung-bar-wrap { flex: 1; width: 100%; display: flex; align-items: flex-end; }
.rung-bar { width: 100%; background: #5a4a6a; border-radius: 4px 4px 0 0; }
.rung-bar.on { background: var(--lilas); }
.rung-n { font-size: 11px; color: var(--muted); margin-top: 4px; font-variant-numeric: tabular-nums; }
.rung-here { font-size: 9px; font-weight: 800; line-height: 1.2; min-height: 22px; text-align: center; color: var(--lilas); }

/* ---------- gráficos */
#curve-chart, #return-chart { background: var(--caixa); border: 2px solid var(--caixa-borda); border-radius: 8px; padding: 10px; }
.chart { display: block; overflow: visible; }
.chart .gridline { stroke: var(--grid); stroke-width: 1; }
.chart .axis { stroke: var(--axis); stroke-width: 1; }
.chart .tick { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .mlabel { fill: var(--texto); font-size: 11px; font-weight: 700; paint-order: stroke; stroke: var(--caixa); stroke-width: 4px; }
.chart .marker { stroke: var(--caixa); stroke-width: 2px; }
.chart .crosshair { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .chart-hover { cursor: crosshair; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--texto-2); margin-bottom: 8px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { display: inline-block; width: 12px; height: 10px; border-radius: 2px; }
.legend i.dashed { height: 2px; }

/* ---------- tooltip e diálogo */
.tooltip {
  position: fixed;
  z-index: 100;
  display: none;
  pointer-events: none;
  background: #1e151a;
  color: var(--texto);
  border: 2px solid var(--caixa-borda);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .5);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
  max-width: 280px;
}
.tooltip .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }

dialog {
  border: 3px solid var(--painel-borda);
  border-radius: 12px;
  background: var(--painel);
  color: var(--texto);
  padding: 0;
  width: min(640px, calc(100vw - 32px));
  box-shadow: 0 0 0 2px #d98b6c inset;
}
dialog::backdrop { background: rgba(10, 4, 6, .7); }
.dlg { padding: 18px; display: grid; gap: 10px; }
.dlg h3 { margin: 0; font-family: var(--font-titulo); font-size: 20px; text-shadow: 2px 2px 0 #3a1d1d; }
.dlg p { margin: 0; }
.dlg .muted { color: #ffe2cf; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; }
.error { color: #ffd0d0; min-height: 1em; font-weight: 700; }

@media (max-width: 1000px) {
  .layout { grid-template-columns: 1fr; }
  .fi-heroi { grid-template-columns: 1fr; }
  .fi-stats { grid-template-columns: 1fr; justify-items: center; }
  .fi-barras { width: 100%; }
}
@media (max-width: 600px) {
  .topbar { flex-wrap: wrap; gap: 8px; }
  .fi-placas { grid-template-columns: 1fr 1fr; }
  .fi-placa-val { font-size: 17px; }
  .pk-grid { grid-template-columns: 1fr; }
  .fi-barra { grid-template-columns: 50px 1fr 56px 44px; gap: 6px; }
}
@media (prefers-reduced-motion: no-preference) {
  .fi-feixe { animation: feixe 6s ease-in-out infinite alternate; }
  @keyframes feixe { from { opacity: .7; } to { opacity: 1; } }
}
