/* PUNKS · Central de Operações — paleta de pergaminho/couro inspirada no Tribal Wars.
   Cores em tokens; o tema escuro redefine os mesmos tokens. */
:root {
  --bg: #f3eee4;
  --bg-card: #fffdf8;
  --bg-sunk: #f7f1e5;
  --border: #e2d7c2;
  --border-strong: #cdbd9f;
  --text: #2a2117;
  --text-muted: #6f624f;  /* ≥ 4,5:1 sobre todos os fundos claros */
  --accent: #8a5a14;
  --accent-strong: #6e4610;
  --accent-soft: #f4e6c8;
  --on-accent: #fffaf0;
  --danger: #b23a2a;
  --danger-soft: #f8e2dc;
  --warn: #86590d;
  --warn-soft: #f7ebcf;
  --good: #2e7a4a;
  --good-soft: #e0f0e4;
  --z-front: #d9412f;
  --z-meio: #e3a52c;
  --z-back: #3b78d8;
  --topbar: #2b1d0e;
  --topbar-2: #3d2a14;
  --topbar-text: #f4e4bc;
  --shadow: 0 1px 2px rgba(60, 40, 10, .06), 0 2px 8px rgba(60, 40, 10, .05);
  --radius: 10px;
  --mono: "SFMono-Regular", "JetBrains Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14120f; --bg-card: #1d1a16; --bg-sunk: #18150f; --border: #332c22; --border-strong: #4a3f30;
    --text: #ece4d5; --text-muted: #a3957c; --accent: #e0aa4f; --accent-strong: #f0c070; --accent-soft: #3a2c15;
    --on-accent: #1d1a16; --danger: #e8806d; --danger-soft: #3d221c; --warn: #e5b95c; --warn-soft: #382b12;
    --good: #7cc99a; --good-soft: #1b3325; --topbar: #0f0c08; --topbar-2: #1f170c;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 2px 10px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #14120f; --bg-card: #1d1a16; --bg-sunk: #18150f; --border: #332c22; --border-strong: #4a3f30;
  --text: #ece4d5; --text-muted: #a3957c; --accent: #e0aa4f; --accent-strong: #f0c070; --accent-soft: #3a2c15;
  --on-accent: #1d1a16; --danger: #e8806d; --danger-soft: #3d221c; --warn: #e5b95c; --warn-soft: #382b12;
  --good: #7cc99a; --good-soft: #1b3325; --topbar: #0f0c08; --topbar-2: #1f170c;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 2px 10px rgba(0, 0, 0, .25);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px; line-height: 1.45; -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
h1, h2, h3 { margin: 0; font-weight: 600; }
h2 { font-size: 14px; color: var(--text); margin-bottom: 10px; }
.muted { color: var(--text-muted); font-weight: 400; }
.mono { font-family: var(--mono); }
small { font-size: .72em; }
code { font-family: var(--mono); font-size: .92em; background: var(--bg-sunk); padding: 1px 4px; border-radius: 4px; }
.spacer { flex: 1; }

/* ------------------------------------------------------------------ topo e navegação */
.topbar {
  display: flex; align-items: center; gap: 18px; padding: 0 18px; height: 56px;
  background: var(--topbar); color: var(--topbar-text);
  position: sticky; top: 0; z-index: 30; box-shadow: 0 2px 10px rgba(0, 0, 0, .25);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; white-space: nowrap; }
.brand-mark { width: 32px; height: 32px; display: block; flex: none; }  /* símbolo da marca (web/brand) */
.brand-text { font-weight: 700; letter-spacing: .04em; font-size: 15px; line-height: 1.1; display: flex; flex-direction: column; }
.brand-sub { font-weight: 400; font-size: 11px; letter-spacing: .02em; opacity: .7; }
.main-nav { display: flex; gap: 2px; height: 100%; }
.main-nav > a, .nav-trigger {
  display: flex; align-items: center; padding: 0 14px; color: rgba(244, 228, 188, .72); text-decoration: none;
  font: inherit; font-weight: 500; font-size: 13.5px; border: 0; border-bottom: 3px solid transparent; border-top: 3px solid transparent;
  white-space: nowrap; background: none; cursor: pointer; height: 100%;
}
.nav-trigger::after { content: ""; width: 5px; height: 5px; margin: -3px 0 0 7px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); opacity: .6; }
.main-nav > a:hover, .nav-group:hover .nav-trigger, .nav-group.open .nav-trigger { color: var(--topbar-text); background: rgba(255, 255, 255, .04); }
.main-nav > a.active, .nav-group.active .nav-trigger { color: #fff3d6; border-bottom-color: #e0aa4f; background: rgba(224, 170, 79, .1); }
.nav-group { position: relative; display: flex; }
.nav-menu {
  display: none; position: absolute; top: 100%; left: 0; z-index: 60; min-width: 240px; padding: 6px;
  background: var(--topbar-2); border: 1px solid rgba(255, 255, 255, .1); border-top: 0; border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: 0 10px 24px rgba(0, 0, 0, .35);
}
@media (hover: hover) { .nav-group:hover .nav-menu { display: block; } }
.nav-group.open .nav-menu, .nav-group:focus-within .nav-menu { display: block; }
.nav-menu a {
  display: block; padding: 8px 12px; border-radius: 6px; color: var(--topbar-text); text-decoration: none; font-size: 13.5px; font-weight: 500;
}
.nav-menu a small { display: block; font-size: 11.5px; font-weight: 400; color: rgba(244, 228, 188, .55); margin-top: 1px; }
.nav-menu a:hover, .nav-menu a:focus-visible { background: rgba(255, 255, 255, .07); }
.nav-menu a.active { background: rgba(224, 170, 79, .16); color: #fff3d6; box-shadow: inset 3px 0 0 #e0aa4f; }
.topbar-right { display: flex; align-items: center; gap: 8px; margin-left: auto; min-width: 0; flex-shrink: 1; }
.topbar-right > * { flex-shrink: 0; }
.topbar-right > .ws-select { flex-shrink: 1; min-width: 90px; }
.topbar .pill { background: rgba(255, 255, 255, .08); color: var(--topbar-text); border: 1px solid rgba(255, 255, 255, .1); }
.topbar .pill.muted { background: transparent; border-style: dashed; color: rgba(244, 228, 188, .6); }
.topbar .btn.ghost { color: var(--topbar-text); border-color: rgba(244, 228, 188, .25); }
.topbar .btn.ghost:hover { border-color: rgba(244, 228, 188, .6); color: #fff; }
.ws-select { font: inherit; font-size: 12px; padding: 4px 8px; border-radius: 999px; max-width: 200px; text-overflow: ellipsis;
  background: rgba(255, 255, 255, .08); color: var(--topbar-text); border: 1px solid rgba(255, 255, 255, .2); }
.ws-select option { color: #222; }
.icon-btn {
  width: 32px; height: 32px; border-radius: 8px; border: 1px solid rgba(244, 228, 188, .25); background: transparent;
  color: var(--topbar-text); font-size: 16px; cursor: pointer;
}
.icon-btn:hover { border-color: rgba(244, 228, 188, .6); }
.more-menu { position: relative; }
.more-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 60; min-width: 250px; padding: 6px;
  background: var(--topbar-2); border: 1px solid rgba(255, 255, 255, .12); border-radius: var(--radius); box-shadow: 0 10px 24px rgba(0, 0, 0, .35); }
.more-pop button { display: block; width: 100%; text-align: left; padding: 8px 12px; border: 0; border-radius: 6px; background: none;
  color: var(--topbar-text); font: inherit; font-size: 13.5px; font-weight: 500; cursor: pointer; }
.more-pop button small { display: block; font-size: 12px; font-weight: 400; color: rgba(244, 228, 188, .6); }
.more-pop button:hover, .more-pop button:focus-visible { background: rgba(255, 255, 255, .08); }
.more-pop button.danger { color: #f3a593; }

.pill { font-size: 12.5px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-variant-numeric: tabular-nums; white-space: nowrap; }
a.pill { text-decoration: none; }
a.pill:hover { text-decoration: underline; }
.pill.muted { background: transparent; border: 1px dashed var(--border); color: var(--text-muted); }

/* ------------------------------------------------------------------ páginas */
.page.layout {
  display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 18px;
  max-width: 1500px; margin: 0 auto; padding: 18px; align-items: start;
}
.page.single { max-width: 1200px; margin: 0 auto; padding: 18px; display: block; }
/* abas da mesma seção com a mesma largura (Operações: salvas · montar · envios; Tropas: ataque · defesa · mapa),
   pra página não pular ao trocar de aba */
.page.single[data-page="operacoes"], .page.single[data-page="envios"], .page.single[data-page="mapa"] { max-width: 1500px; }
.panel { position: relative; min-width: 0; }
.panel.params-panel { position: sticky; top: 74px; max-height: calc(100vh - 90px); overflow-y: auto; padding-right: 4px; scrollbar-width: thin; }
.page-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 12px; }
/* título da página na fonte da marca (Anton, um peso só — sem negrito sintético); o resto do painel segue na fonte do sistema */
.page-title { font-family: "Anton", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-weight: 400; font-size: 27px; line-height: 1.15; letter-spacing: .005em; color: var(--text); margin-bottom: 4px; }

.card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; margin-bottom: 12px; box-shadow: var(--shadow);
}
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; gap: 8px; }
.card-head h2 { margin: 0; }
.hint { font-size: 12px; color: var(--text-muted); margin: -2px 0 10px; }
.section-h { font-size: 14px; margin: 26px 0 8px; font-weight: 650; }
.section-h .muted { font-weight: 400; font-size: 12.5px; }
.subhead { font-size: 12.5px; color: var(--text-muted); margin: 14px 0 8px; font-weight: 700; }

/* configuração recolhível */
.config-card { padding: 0; }
.config-card > summary {
  list-style: none; cursor: pointer; padding: 12px 16px; display: flex; flex-direction: column; gap: 4px;
}
.config-card > summary::-webkit-details-marker { display: none; }
.config-title { font-size: 14px; color: var(--text); font-weight: 700; display: flex; justify-content: space-between; }
.config-title::after { content: "▾"; transition: transform .15s; }
.config-card:not([open]) .config-title::after { transform: rotate(-90deg); }
.config-status { font-size: 12px; display: flex; flex-wrap: wrap; gap: 2px 4px; align-items: center; }
.cfg.ok { color: var(--good); }
.cfg.bad { color: var(--danger); font-weight: 600; }
.cfg-sep { color: var(--text-muted); }
.config-sec { padding: 12px 16px; border-top: 1px solid var(--border); }
.btn-row { display: flex; gap: 6px; flex-wrap: wrap; }

/* grupos de parâmetros */
.param-group { border-top: 1px solid var(--border); padding: 10px 0 4px; }
.param-group:first-of-type { border-top: 0; padding-top: 0; }
.param-group > summary {
  cursor: pointer; list-style: none; font-weight: 600; font-size: 13px; padding: 2px 0 10px;
  display: flex; justify-content: space-between; align-items: center;
}
.param-group > summary::-webkit-details-marker { display: none; }
.param-group > summary::after { content: "▾"; color: var(--text-muted); transition: transform .15s; }
.param-group:not([open]) > summary::after { transform: rotate(-90deg); }
.param-group:not([open]) > summary { padding-bottom: 4px; }

/* ------------------------------------------------------------------ campos */
.field { display: block; font-size: 12.5px; color: var(--text-muted); margin-bottom: 10px; }
.field input[type="text"], .field input:not([type]), .field input[type="number"], .field input[type="email"], .field input[type="password"],
.field input[type="datetime-local"], .field select, .field textarea, .pick-tools input {
  display: block; width: 100%; margin-top: 4px; padding: 7px 9px;
  border: 1px solid var(--border); border-radius: 7px; background: var(--bg-sunk);
  color: var(--text); font-size: 13px; font-family: inherit;
}
.field textarea { font-family: var(--mono); resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible,
a:focus-visible, summary:focus-visible, [tabindex]:focus-visible, tr.clickable:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 1px;
}
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.checkbox-field { display: flex; align-items: center; gap: 7px; font-size: 13px; margin-bottom: 10px; }
.checkbox-field input { accent-color: var(--accent); }
select, input[type="search"], .mini-input {
  padding: 6px 8px; border: 1px solid var(--border); border-radius: 7px; background: var(--bg-card);
  color: var(--text); font-size: 12.5px; font-family: inherit;
}
.mini-input { width: 64px; }
.seg-row { display: flex; gap: 8px; align-items: flex-start; }
.seg-row .segmented { flex: 1; }
.file-input { width: 100%; font-size: 12.5px; margin-bottom: 8px; }

/* controle compacto numa linha: rótulo · slider · valor · unidade */
.ctl { display: grid; grid-template-columns: minmax(84px, auto) 1fr auto auto; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-muted); margin-bottom: 8px; }
.ctl input[type="range"] { width: 100%; accent-color: var(--accent); min-width: 70px; }
.ctl output { font-family: var(--mono); font-weight: 600; color: var(--text); min-width: 2.2em; text-align: right; font-size: 12.5px; }
.ctl output.wide { min-width: 5.6em; }
.ctl-unit { font-size: 11.5px; }
.ctl.compact { margin: 0; grid-template-columns: auto 110px auto auto; }
.ctl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 2px 22px; padding: 10px 2px 2px; }

.segmented { display: flex; gap: 4px; margin-bottom: 12px; background: var(--bg-sunk); border: 1px solid var(--border); border-radius: 8px; padding: 3px; }
.segmented button {
  flex: 1; padding: 6px 4px; font-size: 12.5px; border-radius: 6px; border: 0; background: transparent; color: var(--text-muted); cursor: pointer;
}
.segmented button:hover { color: var(--text); }
.segmented button.active { background: var(--bg-card); color: var(--accent); font-weight: 600; box-shadow: var(--shadow); }

.btn {
  padding: 8px 14px; border-radius: 7px; border: 1px solid var(--accent); background: var(--accent);
  color: var(--on-accent); font-size: 13px; cursor: pointer; font-weight: 600; white-space: nowrap;
}
.btn:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.small { padding: 5px 11px; font-size: 12px; }
.btn.ghost { background: transparent; color: var(--accent); border-color: var(--border-strong); }
.btn.ghost:hover { border-color: var(--accent); background: var(--accent-soft); }

.info-block { font-size: 12.5px; margin-top: 4px; }
.info-block .row { display: flex; justify-content: space-between; gap: 8px; padding: 2px 0; font-family: var(--mono); }
.warn-text { color: var(--warn); }
.danger-text { color: var(--danger); }
.good-text { color: var(--good); }
.manual-wrap { padding: 10px; border: 1px dashed var(--border-strong); border-radius: 8px; margin-bottom: 12px; }

/* ------------------------------------------------------------------ barra de filtros e resumo */
.filterbar {
  display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin-bottom: 12px; padding: 10px 14px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  position: sticky; top: 64px; z-index: 12;
}
.filterbar > label:not(.ctl) { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; }
.filterbar select { min-width: 150px; }
/* filtro de vários jogadores: botão que abre lista com caixas de marcar */
.mpick { position: relative; display: inline-block; font-weight: 400; }
.mpick-btn { min-width: 170px; max-width: 260px; text-align: left; padding: 6px 28px 6px 10px; border: 1px solid var(--border-strong); border-radius: 6px;
  background: var(--bg-card); color: var(--text); font: inherit; font-size: 13px; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; position: relative; }
.mpick-btn::after { content: "▾"; position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }
.mpick.has-sel .mpick-btn { border-color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.mpick-pop { position: absolute; top: calc(100% + 4px); left: 0; z-index: 30; width: 300px; max-width: 86vw; padding: 8px; background: var(--bg-card);
  border: 1px solid var(--border-strong); border-radius: 8px; box-shadow: 0 6px 24px rgba(0,0,0,.18); }
.mpick-pop input[type=search] { width: 100%; box-sizing: border-box; margin-bottom: 6px; }
.mpick-pop .pick-list { max-height: 320px; }
.mpick-acts { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; font-size: 12px; color: var(--text-muted); }
.mpick-acts .spacer { flex: 1; }
.sel-sum { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: -4px 0 12px; font-size: 12.5px; }
.sel-sum:empty { display: none; }
.sel-sum .sel-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 4px 2px 9px; border-radius: 999px; background: var(--accent-soft); border: 1px solid var(--border-strong); }
.sel-sum .sel-chip button { border: 0; background: none; color: var(--text-muted); cursor: pointer; font-size: 14px; line-height: 1; padding: 0 4px; }
.sel-sum .sel-tot { color: var(--text-muted); margin-left: 4px; }
.thresholds { margin-bottom: 10px; }
.thresholds > summary { cursor: pointer; font-size: 12.5px; color: var(--text-muted); padding: 2px 2px; width: max-content; }

.summary-bar { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 12px; }
.summary-bar:empty { display: none; }
.stat-chip {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px;
  box-shadow: var(--shadow);
}
.stat-chip.z-front .stat-label::before, .stat-chip.z-meio .stat-label::before, .stat-chip.z-back .stat-label::before {
  content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.stat-chip.z-front .stat-label::before { background: var(--z-front); }
.stat-chip.z-meio .stat-label::before { background: var(--z-meio); }
.stat-chip.z-back .stat-label::before { background: var(--z-back); }
.stat-chip.danger .stat-value { color: var(--danger); }
.stat-chip .stat-label { font-size: 12.5px; color: var(--text-muted); font-weight: 600; }
/* o número principal da página: o dobro da largura, primeiro da fila e maior */
.stat-chip.hero { grid-column: span 2; order: -1; display: flex; flex-direction: column; justify-content: center; }
.stat-chip.hero .stat-value { font-size: 34px; line-height: 1.1; }
.stat-chip.hero .stat-label { color: var(--text); }
.stat-chip .stat-value { font-size: 24px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.stat-chip .stat-value small { font-weight: 500; color: var(--text-muted); }
.stat-chip .stat-sub { font-size: 12px; color: var(--text-muted); }

.warnings { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.warnings:empty { display: none; }
.banner { padding: 8px 12px; border-radius: 8px; font-size: 12.5px; }
.banner.warn { background: var(--warn-soft); color: var(--warn); }
.banner.danger { background: var(--danger-soft); color: var(--danger); }
.banner.info { background: var(--accent-soft); color: var(--accent-strong); }
/* observações do plano: um bloco recolhido no fim dos avisos */
.warn-more { border: 1px solid var(--border); border-radius: 8px; background: var(--bg-card); }
.warn-more > summary { cursor: pointer; padding: 7px 12px; font-size: 12.5px; color: var(--text-muted); font-weight: 600; }
.warn-more[open] > summary { border-bottom: 1px solid var(--border); }
.warn-more-list { display: flex; flex-direction: column; gap: 6px; padding: 8px; }
/* Planejador: básico esconde os parâmetros finos; explicações longas recolhidas */
#attack-params.basic .adv { display: none !important; }
#attack-params .card-head { align-items: center; }
.segmented.mini { margin: 0; }
.segmented.mini button { padding: 3px 9px; font-size: 12px; }
.adv-note { margin: -4px 0 10px; padding: 6px 10px; border-radius: 7px; background: var(--accent-soft); color: var(--accent-strong); font-size: 12.5px; }
.hint-tip { margin: -4px 0 10px; font-size: 12px; }
.hint-tip > summary { cursor: pointer; color: var(--text-muted); list-style: none; display: inline-flex; gap: 5px; align-items: center; }
.hint-tip > summary::-webkit-details-marker { display: none; }
.hint-tip > summary::before { content: "i"; display: inline-grid; place-items: center; width: 15px; height: 15px; border-radius: 50%;
  border: 1px solid currentColor; font: italic 600 10px/1 Georgia, serif; }
.hint-tip > summary:hover { color: var(--accent); }
.hint-tip[open] > p.hint { margin: 4px 0 0; }
.sq-zero { color: var(--danger); font-weight: 600; cursor: help; }
.stale-banner { margin: 0; border-radius: 0; padding: 10px 20px; font-weight: 600; position: sticky; top: 0; z-index: 50; }
.stale-banner button { margin-left: 10px; }

/* ------------------------------------------------------------------ resultados do planejador */
.results-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; border-bottom: 1px solid var(--border); margin-bottom: 12px; }
.results-head .tabs { border-bottom: 0; margin-bottom: 0; }
.results-actions { display: flex; gap: 8px; align-items: center; padding-bottom: 8px; flex-wrap: wrap; }
.save-inline { display: flex; gap: 6px; }
.save-inline input { width: 190px; padding: 5px 8px; border: 1px solid var(--border); border-radius: 7px; background: var(--bg-card); color: var(--text); font-size: 12.5px; }
.tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.tabs button {
  padding: 10px 14px; background: none; border: none; border-bottom: 2px solid transparent; margin-bottom: -1px;
  color: var(--text-muted); font-size: 13px; cursor: pointer; font-weight: 600; white-space: nowrap;
}
.tabs button:hover { color: var(--text); }
.tabs button.active { color: var(--accent); border-color: var(--accent); }
.tab-content { display: none; }
.tab-content.active { display: block; }
.toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.table-search { min-width: 180px; }

.front-tag { font-size: 11.5px; padding: 1px 7px; border-radius: 999px; background: var(--bg-sunk); border: 1px solid var(--border); white-space: nowrap; }
.nt-yes { color: var(--good); font-weight: 700; }
.origin-own { color: var(--good); }
.origin-don { color: #d06a2c; }

/* ------------------------------------------------------------------ tabelas */
.table-wrap { overflow: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-card); box-shadow: var(--shadow); }
.table-wrap.tall { max-height: 540px; }
table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
thead th {
  position: sticky; top: 0; z-index: 1; background: var(--bg-sunk); text-align: left; padding: 9px 10px;
  border-bottom: 1px solid var(--border); color: var(--text-muted); font-weight: 600; white-space: nowrap; font-size: 12px;
}
thead th[data-key] { cursor: pointer; user-select: none; }
thead th[data-key]:hover { color: var(--text); }
thead th.asc::after { content: " ▲"; font-size: 9px; color: var(--accent); }
thead th.desc::after { content: " ▼"; font-size: 9px; color: var(--accent); }
th.num, td.num { text-align: right; font-variant-numeric: tabular-nums; }
tbody td { padding: 7px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:nth-child(even) { background: color-mix(in srgb, var(--bg-card) 97%, var(--text) 3%); }
tbody tr.clickable { cursor: pointer; }
tbody tr.clickable:hover { background: var(--accent-soft); }
tbody tr.bait { background: var(--warn-soft) !important; }
tr.note-row td { text-align: center; color: var(--text-muted); font-size: 12px; padding: 10px; white-space: normal; }
.empty-state { padding: 30px; text-align: center; color: var(--text-muted); font-size: 13px; white-space: normal; }

.units { display: inline-flex; gap: 8px; flex-wrap: wrap; }
.units .u { display: inline-flex; align-items: center; gap: 3px; font-variant-numeric: tabular-nums; }
.unit-ic { width: 16px; height: 16px; vertical-align: -3px; image-rendering: auto; }
.unit-tx { font-size: 11.5px; color: var(--text-muted); font-weight: 600; }
.zone-tag { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.zone-tag .dot { margin: 0; }
.zone-pill { font-size: 11.5px; padding: 1px 8px; border-radius: 999px; font-weight: 600; color: #fff; white-space: nowrap; }
.zone-pill.z-front { background: var(--z-front); }
.zone-pill.z-meio { background: var(--z-meio); color: #3b2a05; }
.zone-pill.z-back { background: var(--z-back); }

.res-pill { padding: 3px 9px; border-radius: 999px; font-size: 12px; font-family: var(--mono); white-space: nowrap; }
.res-pill.good { background: var(--good-soft); color: var(--good); }
.res-pill.bad { background: var(--danger-soft); color: var(--danger); }
.res-pill.mid { background: var(--warn-soft); color: var(--warn); }
.res-counts { display: flex; gap: 10px; flex-wrap: wrap; margin: 8px 0; align-items: center; }

/* ------------------------------------------------------------------ barra lateral de destaques */
.side-field { display: block; font-size: 12.5px; color: var(--text-muted); margin-bottom: 10px; }
.side-field select { display: block; width: 100%; margin-top: 4px; }
.side-stats { font-size: 12.5px; display: grid; grid-template-columns: 1fr auto; gap: 5px 10px; }
.side-stats b { text-align: right; font-variant-numeric: tabular-nums; color: var(--text); }
.zone-bar { grid-column: 1 / -1; display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: var(--border); }
.zone-bar i { display: block; height: 100%; }
.zone-bar-legend { grid-column: 1 / -1; display: flex; gap: 10px; flex-wrap: wrap; font-size: 11.5px; color: var(--text-muted); margin-bottom: 4px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; }
.z-front { background: var(--z-front); }
.z-meio { background: var(--z-meio); }
.z-back { background: var(--z-back); }
.stat-chip.z-front, .stat-chip.z-meio, .stat-chip.z-back { background: var(--bg-card); }

.top-list { list-style: none; margin: 0; padding: 0; counter-reset: top; }
.top-list li {
  counter-increment: top; display: grid; grid-template-columns: 18px 1fr auto; gap: 1px 8px;
  align-items: baseline; padding: 7px 6px; border-bottom: 1px solid var(--border); font-size: 12.5px;
}
.top-list li:last-child { border-bottom: 0; }
.top-list li::before { content: counter(top); color: var(--text-muted); font-size: 11px; font-weight: 600; }
.top-list li.clickable { cursor: pointer; border-radius: 6px; }
.top-list li.clickable:hover { background: var(--accent-soft); }
.top-list li.active { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.top-list .who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.top-list .val { font-variant-numeric: tabular-nums; font-weight: 700; text-align: right; }
.top-list .sub { grid-column: 2 / 4; color: var(--text-muted); font-size: 11.5px; }
.top-list li.empty { color: var(--text-muted); font-size: 12px; display: block; }
.top-list li.has-bar { padding: 6px 6px 7px; row-gap: 4px; }
.top-list li.has-bar .cbar { grid-column: 2 / 4; display: block; width: auto; margin: 0; }
/* barra fina de comparação dentro de tabela/lista */
.cbar { display: inline-block; vertical-align: middle; width: 64px; height: 5px; margin-left: 8px; border-radius: 3px;
  background: var(--bg-sunk); box-shadow: inset 0 0 0 1px var(--border); overflow: hidden; }
.cbar i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.cbar.good i { background: var(--good); }
.cbar.bl-partial i { background: var(--z-meio); }
.cbar.bl-bare i { background: var(--z-front); }
td.bar-cell { white-space: nowrap; }
.cnum { display: inline-block; min-width: 2.6em; text-align: right; font-variant-numeric: tabular-nums; }
.top-list li.empty::before { content: ""; }

/* ------------------------------------------------------------------ mapas (estilo do mapa do jogo) */
.map-wrap {
  position: relative; width: 100%; height: min(66vh, 640px); border-radius: var(--radius); overflow: hidden;
  border: 2px solid #2b2418; background: #343a2c; cursor: grab; touch-action: none; box-shadow: var(--shadow);
}
.map-wrap.dragging { cursor: grabbing; }
.map-wrap canvas { display: block; width: 100%; height: 100%; }
/* mapa sem nada pra mostrar na visão escolhida: diz por quê, sem cobrir o mapa inteiro */
.map-empty { position: absolute; left: 50%; top: 18px; transform: translateX(-50%); max-width: min(460px, calc(100% - 90px)); padding: 8px 14px; border-radius: 8px;
  background: rgba(20, 16, 10, .82); color: #f4e4bc; font-size: 13px; text-align: center; pointer-events: none; }
.map-empty[hidden] { display: none; }
.map-tip {
  position: absolute; pointer-events: none; z-index: 2; max-width: 280px;
  background: #f4e4bc; color: #2b1d0b; border: 1px solid #7d510f; border-radius: 5px;
  padding: 6px 9px; font: 12px/1.4 Verdana, sans-serif; box-shadow: 0 2px 8px rgba(0, 0, 0, .45);
}
.map-tip .units { gap: 6px; margin-top: 2px; }
.map-tip .unit-tx { color: #7d510f; }
.map-zoom { position: absolute; right: 8px; top: 8px; display: flex; flex-direction: column; gap: 4px; z-index: 2; }
.map-zoom button {
  width: 30px; height: 30px; border-radius: 5px; border: 1px solid #7d510f; background: #e3d5b8;
  color: #3b2a10; font-size: 15px; line-height: 1; cursor: pointer;
}
.map-zoom button:hover { background: #f4e4bc; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 8px; font-size: 12px; color: var(--text-muted); }
.legend .sw { display: inline-block; width: 10px; height: 10px; margin-right: 5px; vertical-align: -1px; border-radius: 2px; }
.sw.real { background: #ff2d1f; box-shadow: 0 0 0 1.5px #fff inset; }
.sw.fake { background: #b8f23a; box-shadow: 0 0 0 1.5px #1c3308 inset; }
.sw.fake-nt { background: #b8f23a; box-shadow: 0 0 0 1.5px #1c3308 inset; position: relative; }
.sw.fake-nt::after { content: ""; position: absolute; inset: 3px; background: #1c3308; border-radius: 1px; }
.sw.focus { border: 1.5px dashed var(--text-muted); border-radius: 50%; }
.sw.ours { background: #2f6fdf; }
.sw.enemy { background: #8c2a1c; }
.sw.other { background: #a0703c; }
.sw.barb { background: #9c9580; }
.sw.def-strong { background: #ff3b30; box-shadow: 0 0 0 1.5px #4a0d08 inset; }
.sw.def-mid { background: #ffa033; }
.sw.losing { background: #ffd84d; border-radius: 50%; }
.sw.def-res { background: transparent; border: 2px solid #34c759; }
.sw.def-sens { background: transparent; border: 1.5px solid #ff2d1f; }
.sw.noble { background: #ffd84d; border-radius: 50%; box-shadow: 0 0 0 1px #3b2a10 inset; }
.map-hint { font-size: 11px; }
.map-toggle { font-size: 12px; color: var(--text-muted); display: inline-flex; gap: 4px; align-items: center; cursor: pointer; }

.map-menu {
  position: fixed; z-index: 200; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 8px; box-shadow: 0 6px 20px rgba(0, 0, 0, .35); padding: 4px; min-width: 210px; font-size: 12.5px;
}
.map-menu-head { padding: 5px 8px; color: var(--text-muted); border-bottom: 1px solid var(--border); margin-bottom: 4px; font-family: var(--mono); }
.map-menu button { display: block; width: 100%; text-align: left; padding: 7px 9px; background: none; border: none; color: var(--text); border-radius: 5px; cursor: pointer; }
.map-menu button:hover { background: var(--accent-soft); }

.manual-adjust:not(:empty) { margin: 0 0 12px; padding: 8px; border: 1px dashed var(--border-strong); border-radius: 8px; }
.adj-title { font-size: 12.5px; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; display: flex; justify-content: space-between; align-items: center; }
.adj-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-family: var(--mono); padding: 2px 4px 2px 8px; border-radius: 999px; margin: 0 4px 4px 0; }
.adj-chip.pin { background: var(--good-soft); color: var(--good); }
.adj-chip.block { background: var(--danger-soft); color: var(--danger); }
.adj-chip button { background: none; border: none; color: inherit; cursor: pointer; font-size: 14px; line-height: 1; padding: 0 2px; }

/* ------------------------------------------------------------------ totais por jogador inimigo */
.enemy-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; margin-bottom: 14px; }
.enemy-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; box-shadow: var(--shadow); }
.enemy-card .ec-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.enemy-card .ec-name { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.enemy-card .ec-tag { font-size: 11px; color: var(--text-muted); font-family: var(--mono); }
.enemy-card .ec-total { font-size: 22px; font-weight: 700; margin: 4px 0 6px; font-variant-numeric: tabular-nums; }
.enemy-card .ec-total small { font-size: 11px; color: var(--text-muted); font-weight: 400; }
.enemy-card .ec-bar { display: flex; height: 6px; border-radius: 3px; overflow: hidden; background: var(--border); }
.enemy-card .ec-bar .r { background: #d9362b; }
.enemy-card .ec-bar .f { background: #6aa51f; }
.enemy-card .ec-lines { font-size: 12px; margin-top: 7px; display: grid; gap: 2px; }
.enemy-card .ec-lines span.k { color: var(--text-muted); }
.enemy-card .ec-lines .real { color: #d9362b; }
.enemy-card .ec-lines .fake { color: #5c9a18; }

/* ------------------------------------------------------------------ roster editável */
.roster-editor { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 12px; background: var(--bg-card); box-shadow: var(--shadow); }
.roster-editor > summary { cursor: pointer; font-weight: 600; font-size: 13px; }
.roster-editor .hint { margin: 8px 0; }
#roster-editor-table input { width: 66px; padding: 3px 5px; border: 1px solid var(--border); border-radius: 5px; background: var(--bg-sunk); color: var(--text); font-family: var(--mono); }
#roster-editor-table td.edited input { border-color: var(--accent); background: var(--accent-soft); }
#roster-editor-table .support-tag, #roster-editor-table .nocollect-tag { font-size: 11px; color: var(--warn); margin-left: 4px; }
#roster-editor-table .manual-tag { font-size: 11px; color: var(--accent); margin-left: 4px; }
#roster-editor-table td.rm button { background: none; border: none; color: var(--danger); cursor: pointer; font-size: 15px; }
#roster-editor-table tr.nocollect td:first-child { color: var(--text-muted); }
.roster-add { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.roster-add input[type="text"] { flex: 1; min-width: 160px; padding: 5px 8px; border: 1px solid var(--border); border-radius: 7px; background: var(--bg-sunk); color: var(--text); }
.roster-add input[type="number"] { width: 70px; padding: 5px 6px; border: 1px solid var(--border); border-radius: 7px; background: var(--bg-sunk); color: var(--text); font-family: var(--mono); }

/* ------------------------------------------------------------------ operações salvas / envios */
.ops-list { display: grid; gap: 8px; margin-top: 6px; }
.ops-row { border: 1px solid var(--border); border-radius: var(--radius); padding: 11px 14px; background: var(--bg-card); box-shadow: var(--shadow); }
.ops-row.sel { border-color: var(--accent); background: var(--accent-soft); }
.ops-row-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.ops-row-name { font-weight: 650; font-size: 14px; }
.ops-row-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.ops-row-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
/* excluir é raro e destrutivo: link apagado, afastado dos botões do dia a dia */
.ops-row-actions .op-del { color: var(--text-muted); margin-left: 14px; }
.ops-row-actions .op-del:hover { color: var(--danger); }
.ops-detail { margin-top: 16px; }
.ops-detail h3 { font-size: 15px; margin-bottom: 6px; }
.ops-cmp { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ops-cmp .col { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; background: var(--bg-card); }
.send-bar { display: inline-block; width: 90px; height: 6px; border-radius: 3px; background: var(--border); vertical-align: middle; overflow: hidden; margin-right: 6px; }
.send-bar i { display: block; height: 100%; background: var(--good); }
.send-status { font-size: 11.5px; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.send-status.ok { background: var(--good-soft); color: var(--good); }
.send-status.partial { background: var(--warn-soft); color: var(--warn); }
.send-status.none { background: var(--danger-soft); color: var(--danger); }
.send-status.nodata { background: var(--accent-soft); color: var(--text-muted); }
/* cartão de diagnóstico: explica dado faltando antes de mostrar o placar */
.diag-card { margin: 10px 0 12px; padding: 10px 14px; border: 1px solid var(--warn); border-left-width: 4px; border-radius: 8px; background: var(--warn-soft); color: var(--text); font-size: 13px; }
.diag-card .diag-title { font-weight: 700; color: var(--warn); margin-bottom: 4px; }
.diag-card ul { margin: 0; padding-left: 18px; display: grid; gap: 4px; }

/* ------------------------------------------------------------------ diálogos (MP / partes) */
.mp-dialog {
  width: min(1100px, 94vw); max-height: 90vh; border: 1px solid var(--border); border-radius: 12px;
  background: var(--bg-card); color: var(--text); padding: 18px 20px;
}
.mp-dialog::backdrop { background: rgba(20, 12, 4, .6); }
.mp-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.mp-head h2 { margin: 0; }
.mp-templates { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mp-templates textarea { font-family: var(--mono); font-size: 12px; }
.mp-list { display: grid; gap: 10px; margin-top: 6px; }
.mp-item { border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; }
.mp-item-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 6px; }
.mp-item-head .muted { font-size: 12px; }
.mp-item textarea {
  width: 100%; height: 120px; font-family: var(--mono); font-size: 11.5px;
  border: 1px solid var(--border); border-radius: 6px; background: var(--bg-sunk); color: var(--text); padding: 6px 8px; resize: vertical;
}
.mp-item-title { font-size: 13.5px; margin-bottom: 8px; }
.mp-part + .mp-part { margin-top: 10px; }

/* ------------------------------------------------------------------ avisos, carregamento, overlay */
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 300; display: flex; flex-direction: column; gap: 8px; max-width: min(380px, calc(100vw - 32px)); }
.toast {
  padding: 10px 14px; border-radius: 9px; font-size: 13px; background: var(--bg-card); color: var(--text);
  border: 1px solid var(--border); border-left: 4px solid var(--good); box-shadow: 0 6px 20px rgba(0, 0, 0, .18);
  opacity: 0; transform: translateY(8px); transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: none; }
.toast.err { border-left-color: var(--danger); }
.toast.info { border-left-color: var(--accent); }

.is-loading::after {
  content: ""; position: absolute; top: 90px; left: 50%; width: 34px; height: 34px; margin-left: -17px; z-index: 20;
  border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite;
}
.is-loading > * { opacity: .55; transition: opacity .15s; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .is-loading::after { animation-duration: 2.4s; } .toast { transition: none; } }

.server-overlay {
  position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--bg) 88%, transparent); font-size: 15px; text-align: center; padding: 20px;
}

/* ------------------------------------------------------------------ visitante / remoto */
.remote-only { display: none; }
body.remote .remote-only { display: inline-flex; }
body.remote .local-only { display: none !important; }
body.viewer .admin-only { display: none !important; }

/* ------------------------------------------------------------------ telas menores */
@media (max-width: 1400px) {
  .topbar { gap: 12px; }
  .main-nav > a, .nav-trigger { padding: 0 10px; }
  .topbar #world-pill { display: none; }
}
@media (max-width: 1100px) {
  .brand-sub { display: none; }
}
@media (max-width: 900px) {
  .topbar { flex-wrap: wrap; height: auto; padding: 8px 12px 0; gap: 6px 10px; }
  .topbar-right { margin-left: auto; }
  .main-nav { order: 3; width: 100%; overflow-x: auto; scrollbar-width: none; height: 42px; margin: 0 -12px; padding: 0 6px; width: calc(100% + 24px); }
  /* o menu rola de lado: a borda que esmaece mostra que tem mais itens (some quando chega ao fim) */
  .main-nav.more-right { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 44px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 44px), transparent); }
  .nav-group, .nav-group .nav-menu { display: contents !important; }
  .nav-trigger { display: none; }
  .nav-menu a { display: flex; align-items: center; padding: 0 10px; border-radius: 0; color: rgba(244, 228, 188, .72); white-space: nowrap;
    border-bottom: 3px solid transparent; border-top: 3px solid transparent; }
  .nav-menu a small { display: none; }
  .nav-menu a.active { box-shadow: none; border-bottom-color: #e0aa4f; }
  .page.layout { grid-template-columns: minmax(0, 1fr); padding: 12px; gap: 12px; }
  .page.single { padding: 12px; }
  .panel.params-panel { position: static; max-height: none; overflow: visible; padding-right: 0; }
  .side-quick { order: 2; }
  .filterbar { top: 96px; }
  .map-wrap { height: 62vh; }
  .mp-templates, .ops-cmp { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  body { font-size: 14.5px; }
  .brand-text { font-size: 14px; }
  .filterbar { position: static; }
  .filterbar select { min-width: 0; flex: 1; }
  .filterbar .mpick, .filterbar .mpick-btn { flex: 1; width: 100%; max-width: none; min-width: 0; }
  .filterbar > label:not(.ctl) { flex: 1 1 45%; }
  .ctl.compact { grid-template-columns: auto 1fr auto auto; flex: 1 1 100%; }
  .summary-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-chip .stat-value { font-size: 20px; }
  .results-actions, .save-inline { width: 100%; }
  .save-inline input { flex: 1; width: auto; }
  .table-search { flex: 1; min-width: 0; }
  /* tabelas viram cartões: cada linha um cartão, cada célula "rótulo: valor" */
  .table-wrap.tall { max-height: none; }
  table.cards-on-mobile thead { display: none; }
  table.cards-on-mobile, table.cards-on-mobile tbody { display: block; }
  table.cards-on-mobile tr { display: block; padding: 8px 12px; border-bottom: 1px solid var(--border); }
  table.cards-on-mobile tbody tr:nth-child(even) { background: transparent; }
  table.cards-on-mobile td { display: flex; justify-content: space-between; gap: 12px; border: 0; padding: 3px 0; white-space: normal; text-align: right; }
  table.cards-on-mobile td::before { content: attr(data-label); color: var(--text-muted); font-size: 12px; text-align: left; }
  table.cards-on-mobile td:first-child { font-weight: 650; font-size: 14px; }
  table.cards-on-mobile td.empty-state, table.cards-on-mobile tr.note-row td { display: block; text-align: center; }
  table.cards-on-mobile td.empty-state::before, table.cards-on-mobile tr.note-row td::before { content: none; }
  .ctl-grid { grid-template-columns: 1fr; }
  .page-head { flex-direction: column; }
}
.banner details > summary { cursor: pointer; font-weight: 600; }
.warn-list { margin: 6px 0 2px; padding-left: 18px; display: grid; gap: 2px; }

/* ------------------------------------------------------------------ início (homepage da tribo) */
.home-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; align-items: stretch; }
.home-grid .card { margin: 0; }
.home-grid .card.third { grid-column: span 2; }
.home-grid .card.half { grid-column: span 3; }
.home-grid .card.wide { grid-column: 1 / -1; }
.home-grid .card[hidden] { display: none; }
@media (max-width: 1100px) { .home-grid .card.third { grid-column: span 3; } .home-grid #home-collector { grid-column: 1 / -1; } }
@media (max-width: 760px) { .home-grid .card.third, .home-grid .card.half { grid-column: 1 / -1; } }
/* Início: guerra dia a dia (tomadas pra cima, perdidas pra baixo) */
.wd-head { display: flex; justify-content: space-between; align-items: baseline; margin: 14px 0 6px; font-size: 12px; font-weight: 600; }
.wd-head .muted { font-weight: 400; display: inline-flex; align-items: center; gap: 4px; }
.wd-head .dot { margin: 0 0 0 6px; }
.wd-g { background: var(--good); }
.wd-r { background: var(--danger); }
.war-daily { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.wd-col { display: flex; flex-direction: column; align-items: stretch; cursor: default; }
.wd-up, .wd-down { height: 34px; display: flex; }
.wd-up { align-items: flex-end; border-bottom: 1px solid var(--border-strong); }
.wd-down { align-items: flex-start; }
.wd-up i, .wd-down i { display: block; width: 100%; border-radius: 2px; }
.wd-up i { background: var(--good); }
.wd-down i { background: var(--danger); opacity: .85; }
.wd-lbl { text-align: center; font-size: 11px; color: var(--text-muted); margin-top: 3px; }
/* Início: saúde da coleta */
.cov-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.cov-head .muted { font-size: 12px; line-height: 1.35; }
.home-big.cov-none, .home-big.cov-low { color: var(--danger); }
.home-big.cov-ok { color: var(--good); }
.home-big small { font-size: .6em; color: var(--text-muted); font-weight: 500; }
.cov-bar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: var(--bg-sunk); }
.cov-bar i, .cov-legend i { display: block; }
.cov-bar .a, .cov-legend .a { background: var(--good); }
.cov-bar .i, .cov-legend .i { background: var(--z-meio); }
.cov-bar .n, .cov-legend .n { background: var(--border-strong); }
.cov-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--text-muted); margin: 6px 0 10px; }
.cov-legend span { display: inline-flex; align-items: center; gap: 5px; }
.cov-legend i { width: 9px; height: 9px; border-radius: 2px; }
.cov-actions { align-items: center; gap: 10px; font-size: 13px; }
.cov-sep { border: 0; border-top: 1px solid var(--border); margin: 12px 0 10px; }
.cov-sub { font-size: 12px; font-weight: 600; margin-bottom: 4px; }
.home-steps { margin: 0; padding-left: 20px; font-size: 13.5px; line-height: 1.7; }
.home-steps .done { color: var(--text-muted); text-decoration: line-through; }
.home-grid .card h3 { font-size: 14.5px; color: var(--text); margin: 0 0 10px; font-weight: 700; }
.home-grid .card h3 .muted { font-weight: 400; }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; font-size: 13px; }
.kv .v { font-variant-numeric: tabular-nums; font-weight: 600; text-align: right; }
.kv .v.good { color: var(--good); } .kv .v.bad { color: var(--danger); }
.home-big { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; margin: 2px 0 6px; }
.home-list { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.home-list li { display: flex; gap: 8px; align-items: baseline; padding: 5px 0; border-bottom: 1px solid var(--border); }
.home-list li:last-child { border-bottom: 0; }
.home-list .when { color: var(--text-muted); font-size: 12px; white-space: nowrap; margin-left: auto; font-variant-numeric: tabular-nums; }
.tag-chip { font-size: 11px; padding: 0 6px; border-radius: 4px; background: var(--bg-sunk); color: var(--text-muted); font-weight: 600; }
.home-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.home-cols h4 { font-size: 12px; color: var(--text-muted); margin: 0 0 6px; font-weight: 600; }
.alert-line { padding: 10px 14px; border-radius: var(--radius); background: var(--warn-soft); margin-bottom: 12px; font-size: 13px; }
.alert-line.warn { background: var(--danger-soft); }
.card.is-locked { position: relative; }
.card.is-locked .lock-body { filter: blur(4px); opacity: .3; pointer-events: none; user-select: none; }
.card.is-locked .lock-cta { position: absolute; left: 50%; top: 55%; transform: translate(-50%, -50%); display: grid; gap: 4px;
  text-align: center; font-size: 13px; padding: 12px 18px; border-radius: var(--radius); background: var(--bg-card);
  border: 1px solid var(--border); box-shadow: var(--shadow); white-space: nowrap; }
.main-nav a.locked::after { content: "🔒"; font-size: 10px; margin-left: 4px; opacity: .7; }
.nav-menu a.locked { position: relative; padding-right: 30px; }
.nav-menu a.locked::after { position: absolute; right: 10px; top: 10px; margin: 0; }
.locked-page { max-width: 520px; margin: 40px auto; text-align: center; padding: 28px; }
.locked-page .lock-mark { font-size: 34px; }

/* ------------------------------------------------------------------ ataques chegando */
.check-inline { display: inline-flex; gap: 5px; align-items: center; font-size: 13px; }
.inc-badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 0 6px; border-radius: 4px; margin-right: 3px; white-space: nowrap; }
.inc-badge.noble { background: var(--danger); color: #fff; }
.inc-badge.large, .inc-badge.huge { background: var(--z-front); color: #fff; }
.inc-badge.medium { background: var(--z-meio); color: #3b2a05; }
.inc-badge.small { background: var(--bg-sunk); color: var(--text-muted); border: 1px solid var(--border); }
.inc-badge.spy { background: var(--bg-sunk); color: var(--text-muted); }
.inc-badge.ign { background: transparent; color: var(--text-muted); border: 1px dashed var(--border); }
.countdown { font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.inc-soon td { background: var(--danger-soft); }
.coverage-list { font-size: 13px; line-height: 1.7; }

.inc-groups tr.grp { cursor: pointer; }
.inc-groups tr.grp:hover td { background: var(--bg-sunk); }
.inc-groups tr.grp.open td { background: var(--accent-soft); }
.inc-groups tr.grp td:first-child::before { content: "▸ "; color: var(--text-muted); }
.inc-groups tr.grp.open td:first-child::before { content: "▾ "; }
.inc-groups tr.detail > td { background: var(--bg-card); padding: 12px 14px 16px; }
.inc-detail { display: grid; grid-template-columns: minmax(0, 2fr) minmax(240px, 1fr); gap: 18px; }
.inc-detail table { font-size: 12px; }
.inc-detail h4 { font-size: 12.5px; color: var(--text-muted); margin: 0 0 6px; font-weight: 700; }
.wall-big { font-size: 22px; font-weight: 700; }
.inc-units .units { display: flex; flex-wrap: wrap; gap: 6px 12px; }
@media (max-width: 900px) { .inc-detail { grid-template-columns: 1fr; } }
.inc-vname { display: inline-block; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.inc-groups td { white-space: nowrap; }

/* ------------------------------------------------------------------ configurações */
.cfg-card { margin-bottom: 14px; }
.cfg-card h3 { font-size: 15px; margin: 0 0 4px; }
.cfg-card h4 { font-size: 12.5px; font-weight: 700; color: var(--text-muted); margin: 10px 0 6px; }
.cfg-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 14px; margin-bottom: 14px; }
.cfg-grid .cfg-card { margin: 0; }
.cfg-tribes { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.tribe-chips { display: flex; flex-wrap: wrap; gap: 6px; min-height: 30px; }
.tribe-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 10px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--bg-sunk); font-size: 13px; }
.tribe-chip.bad { border-color: var(--danger); color: var(--danger); }
.tribe-chip button { border: 0; background: transparent; color: var(--text-muted); cursor: pointer; font-size: 14px; line-height: 1; padding: 0 3px; }
.tribe-chip button:hover { color: var(--danger); }
.tribe-search { position: relative; margin-top: 8px; max-width: 320px; }
.tribe-search input { width: 100%; }
.tribe-results { position: absolute; left: 0; right: 0; top: 100%; z-index: 20; background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow); max-height: 260px; overflow: auto; }
.tribe-results:empty { display: none; }
.tribe-results button { display: flex; width: 100%; gap: 8px; align-items: baseline; text-align: left; padding: 6px 10px; border: 0; background: transparent; color: var(--text); cursor: pointer; font: inherit; font-size: 13px; }
.tribe-results button:hover { background: var(--accent-soft); }
.mode-switch { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; margin: 8px 0 10px; }
.mode-switch button { border: 0; background: transparent; padding: 5px 12px; cursor: pointer; font: inherit; font-size: 13px; color: var(--text-muted); }
.mode-switch button.on { background: var(--accent); color: var(--on-accent); }
.cfg-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px 12px; }
.cfg-fields .field input { width: 100%; }
.cfg-preview { margin-top: 8px; font-size: 13px; }

/* ------------------------------------------------------------------ blind */
.blind-page .map-wrap { height: 460px; }
.blind-export { margin: 8px 0 12px; }
.blind-export textarea { width: 100%; min-height: 160px; font-family: var(--mono); font-size: 12px; background: var(--bg-sunk); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: 8px; }
.bl-badge { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; white-space: nowrap; }
.bl-badge.ok { background: color-mix(in srgb, var(--z-back) 15%, transparent); color: var(--z-back); }
.bl-badge.partial { background: var(--warn-soft); color: var(--warn); }
.bl-badge.bare { background: var(--danger-soft); color: var(--danger); }
.req-pill { font-size: 11px; padding: 1px 7px; border-radius: 999px; background: rgba(90, 160, 255, .15); color: #5aa0ff; white-space: nowrap; font-weight: 600; }
.req-pill.covered { background: var(--good-soft); color: var(--good); }
.miss { color: var(--danger); font-variant-numeric: tabular-nums; }
.miss.zero { color: var(--text-muted); }
.req-batch { border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-card); padding: 12px 14px; margin-bottom: 12px; }
.req-batch .toolbar { margin: 8px 0 0; }
.req-batch table { font-size: 12px; }
.helpers { font-size: 11px; color: var(--text-muted); }

/* pílula do coletor dos membros (Início) */
.page-head-pills { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; justify-content: flex-end; }
.coll-pill { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.coll-pill i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.coll-pill.ok { background: var(--good-soft); color: var(--good); }
.coll-pill.low { background: var(--warn-soft); color: var(--warn); }
.coll-pill.none { background: var(--danger-soft); color: var(--danger); }
@media (max-width: 640px) { .coll-pill-extra { display: none; } }
body.viewer .nav-group.admin-only { display: none !important; }
@media (max-width: 900px) { .nav-menu a.locked { padding-right: 10px; } .nav-menu a.locked::after { position: static; margin-left: 4px; } }

/* fila de MPs (diálogo Exportar MP) */
.mp-send { border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; margin: 10px 0; background: var(--accent-soft); }
.mp-send h3 { margin: 0 0 8px; font-size: 14px; }
.mp-send .field.inline { display: flex; flex-direction: row; align-items: center; gap: 6px; margin: 0; }
.mp-send .field.inline input { width: 220px; }
.mp-q-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 8px; }
.mp-q-count { font-family: var(--mono); font-size: 12px; }
.mp-q-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 4px 16px; max-height: 240px; overflow: auto; }
.mp-q-list li { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.mp-q-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-muted); flex: none; }
.mp-q-dot.pending, .mp-q-dot.sending { background: var(--warn); }
.mp-q-dot.sent { background: var(--good); }
.mp-q-st { margin-left: auto; font-size: 12px; }
.mp-q-st.good { color: var(--good); }
.mp-q-st.muted { color: var(--text-muted); }
.linkish { background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; cursor: pointer; font: inherit; font-size: 12px; }
.inc-total { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--border); font-size: 13px; }
.wall-big.bad, #inc-groups td .bad { color: var(--danger); font-weight: 600; }
.inc-detail .inc-wrap, .inc-detail .inc-footnote { white-space: normal; overflow-wrap: anywhere; }
.inc-footnote { font-size: 11.5px; font-style: italic; color: var(--text-muted); line-height: 1.35; margin-top: 3px; max-width: 46ch; }
.wall-big sup { font-size: 12px; font-weight: 400; color: var(--text-muted); margin-left: 1px; }
.blind-coords { margin: 4px 0 12px; border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; }
.blind-coords summary { cursor: pointer; font-weight: 600; font-size: 13.5px; }
.blind-coords textarea { width: 100%; font-family: var(--mono); font-size: 12.5px; margin: 4px 0 6px; box-sizing: border-box; }
.map-wrap.inc-map { height: 440px; margin: 4px 0 6px; }
@media (max-width: 720px) { .map-wrap.inc-map { height: 320px; } }

/* seletor de jogadores (Quem ataca com full) */
.pick-tools { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.pick-tools input { flex: 1; min-width: 0; }
.btn-link { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; font-size: 12px; cursor: pointer; text-decoration: underline; white-space: nowrap; }
.pick-list { max-height: 240px; overflow-y: auto; border: 1px solid var(--border); border-radius: 6px; background: var(--bg-sunk); margin-bottom: 6px; }
.pick-list .hint { margin: 8px; }
/* lista de quem manda full recolhida: o padrão (todos) não precisa da lista aberta na barra lateral */
.pick-box > summary { cursor: pointer; list-style: none; font-size: 13px; margin-bottom: 6px; display: flex; gap: 8px; align-items: baseline; }
.pick-box > summary::-webkit-details-marker { display: none; }
.pick-box[open] > summary .btn-link { visibility: hidden; }
.pick-row { display: flex; align-items: center; gap: 7px; padding: 4px 8px; font-size: 13px; cursor: pointer; border-bottom: 1px solid var(--border); }
.pick-row:last-child { border-bottom: 0; }
.pick-row input { accent-color: var(--accent); margin: 0; }
.pick-row .pick-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-row .pick-meta { color: var(--text-muted); font-size: 11px; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* pouso mais cedo possível (Planejador) */
.timing-limit { border: 1px solid var(--border); border-radius: 8px; background: var(--bg-card); padding: 9px 12px; margin: 0 0 12px; font-size: 13px; }
.timing-limit.late { border-color: var(--danger); background: var(--danger-soft); }
.timing-limit .tl-late { color: var(--danger); }
.timing-limit #tl-use-earliest { margin-left: 8px; vertical-align: 1px; }
.timing-limit .tl-main b { font-size: 15px; }
.timing-limit .tl-sub { color: var(--text-muted); font-size: 12px; margin-top: 2px; }
.timing-limit details { margin-top: 6px; }
.timing-limit summary { cursor: pointer; font-size: 12px; color: var(--accent); }
.timing-limit table { width: 100%; border-collapse: collapse; margin-top: 6px; font-size: 12px; }
.timing-limit td, .timing-limit th { padding: 3px 6px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
.timing-limit th { color: var(--text-muted); font-weight: 600; }

/* histórico de apoios (Blind) */
.bf-card { margin-top: 18px; }
.bf-fields { display: grid; grid-template-columns: 1fr 1fr 180px; gap: 10px; }
.bf-fields input, .bf-fields select { width: 100%; }
.bf-status p { margin: 4px 0; font-size: 13px; }
.bf-issues { margin: 4px 0 0; padding-left: 18px; font-size: 12.5px; }
.bf-recent { margin-top: 8px; }
.bf-recent summary { cursor: pointer; font-size: 13px; }
.blind-cov { margin-top: 18px; }
.bf-intro { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.bf-intro h4 { margin: 0 0 4px; font-size: 14px; }
.bf-bbcode { width: 100%; font-family: var(--mono); font-size: 12px; background: var(--bg-sunk); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: 8px; }
.bf-meter { margin: 8px 0 12px; }
.bf-meter .m-head { font-size: 15px; margin-bottom: 6px; }
.bf-meter .m-head b { font-size: 20px; }
.bf-meter .m-bar { display: flex; height: 14px; border-radius: 4px; overflow: hidden; background: var(--bg-sunk); border: 1px solid var(--border); }
.bf-meter .m-bar.sm { height: 8px; flex: 1; }
.bf-meter .m-bar i { display: block; height: 100%; }
.bf-meter .m-used { background: #c0392b; }
.bf-meter .m-pend { background: #e08e0b; }
.bf-meter .m-free { background: #2e8b3d; }
.bf-meter .m-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; margin: 5px 0 8px; color: var(--text-muted); }
.bf-meter .m-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }
.bf-meter .m-units { display: grid; grid-template-columns: max-content 1fr max-content; gap: 4px 10px; align-items: center; font-size: 12px; max-width: 520px; }
.bf-meter .m-short { color: var(--danger, #c0392b); font-weight: 600; }
.bm-players { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 6px 0 10px; }
#bm-preview pre { white-space: pre-wrap; font-family: var(--mono); font-size: 12px; margin: 0; max-height: 260px; overflow: auto; }
@media (max-width: 760px) { .bf-fields { grid-template-columns: 1fr; } }
.blind-hot { margin-top: 6px; }
.blind-hot-head { align-items: baseline; gap: 12px; }
.blind-hot-head .section-h { margin: 14px 0 4px; }
.blind-hot-head .checkbox-field { margin: 0; }
.blind-hot .hot-why { display: block; }
.blind-hot .hot-why b { font-weight: 650; }
.blind-hot .hot-sub { display: block; color: var(--text-muted); font-size: 12px; }
.blind-hot .small-note { font-size: 12px; margin: 4px 0 14px; }
.sup-history { margin-top: 18px; }
.sup-history > summary { cursor: pointer; list-style: none; }
.sup-history > summary::-webkit-details-marker { display: none; }
.sup-history > summary h3::before { content: "▸ "; color: var(--text-muted); }
.sup-history[open] > summary h3::before { content: "▾ "; }
.sup-history > summary h3 { display: inline; }
#sup-totals { margin: 6px 0; font-size: 13px; }

/* mapa da tribo */
.tmap-page .num-sm { width: 70px; padding: 4px 6px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg-sunk); color: var(--text); font: inherit; }
.tm-layers { margin-top: -4px; }
.tm-layers label { font-weight: 500 !important; }
.tm-layers .sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; }
.tm-layers select { padding: 2px 4px; font: inherit; font-size: 12px; }
.tm-two { display: grid; grid-template-columns: minmax(340px, 1fr) 1.6fr; gap: 14px; align-items: start; }
.tm-two.tm-tp-grid { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 900px) { .tm-two, .tm-two.tm-tp-grid { grid-template-columns: 1fr; } }
#tm-far-info, #tm-tp-info { margin: 4px 0 8px; font-size: 13px; }

/* blind: quanto pedir na lista de coordenadas */
.seg-radio { display: flex; flex-direction: column; gap: 4px; margin: 6px 0 8px; font-size: 13px; }
.seg-radio input { accent-color: var(--accent); margin-right: 4px; }
#blind-fixed { margin-bottom: 4px; }

/* planejador: mapa + painel de focos */
.plan-map-layout { display: grid; grid-template-columns: 1fr; gap: 12px; align-items: start; }
.plan-map-layout.with-focus { grid-template-columns: minmax(0, 1fr) 320px; }
@media (max-width: 1100px) { .plan-map-layout.with-focus { grid-template-columns: 1fr; } }
.focus-panel { border: 1px solid var(--border); border-radius: 10px; background: var(--bg-card); padding: 10px; max-height: 72vh; overflow-y: auto; }
.focus-panel-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 2px; }
.focus-card { border: 1px solid var(--border); border-left: 4px solid #fff; border-radius: 8px; padding: 8px; margin-top: 8px; background: var(--bg-sunk); font-size: 13px; }
.focus-card.fake { border-left-color: #b8f23a; }
.focus-card.real { border-left-color: #ff2d1f; }
.focus-card .fc-head { display: flex; align-items: center; gap: 6px; }
.focus-card .fc-head b { flex: 1; }
.focus-card .fc-head button { background: none; border: 1px solid var(--border); border-radius: 5px; padding: 0 6px; cursor: pointer; color: var(--text); font: inherit; line-height: 1.6; }
.focus-card .fc-row { display: flex; gap: 6px; align-items: center; margin-top: 6px; flex-wrap: wrap; }
.focus-card .fc-row input { width: 74px; padding: 3px 6px; border: 1px solid var(--border); border-radius: 5px; background: var(--bg-card); color: var(--text); font: inherit; }
.focus-card .fc-row select { padding: 3px 4px; font: inherit; font-size: 12px; max-width: 170px; }
.focus-card .fc-label { font-size: 12px; font-weight: 600; color: var(--text-muted); margin-top: 8px; }
.fc-chip { display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px; border-radius: 999px; border: 1px solid var(--border); background: var(--bg-card); font-size: 12px; cursor: pointer; margin: 3px 3px 0 0; }
.fc-chip.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.fc-chip .n { opacity: .7; font-size: 11px; }
/* squads (modo squad do Planejador) */
.focus-card.squad { border-left-color: #e0a526; }
.focus-card.fakeop { border-left-color: #d36bff; }
.focus-card .fc-row input.fo-owner { width: 120px; }
.focus-card .sq-name { flex: 1; min-width: 0; font-weight: 700; padding: 2px 6px; border: 1px solid transparent; border-radius: 5px; background: transparent; color: var(--text); font-size: 13px; }
.focus-card .sq-name:hover, .focus-card .sq-name:focus { border-color: var(--border); background: var(--bg-card); }
.focus-card .fc-row input.sq-arr { width: auto; }
.sq-stats { margin-top: 6px; font-size: 12px; }
.fc-chip.sq-p { cursor: default; }
.fc-chip.sq-p button { border: 0; background: none; padding: 0 2px; cursor: pointer; color: inherit; font: inherit; opacity: .65; }
.fc-chip.sq-p button:hover { opacity: 1; }
.squad-summary { margin: 8px 0; overflow-x: auto; }
.squad-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.squad-table th, .squad-table td { text-align: left; padding: 5px 8px; border-bottom: 1px solid var(--border); vertical-align: top; white-space: normal; }
.squad-table td:nth-child(3), .squad-table td:nth-child(4) { min-width: 180px; font-size: 12px; }
.squad-table th { font-size: 12px; color: var(--text-muted); }

/* revisão de exclusões */
.excl-list { list-style: none; padding-left: 0; }
.excl-item { display: flex; gap: 6px; align-items: baseline; cursor: pointer; }
.excl-item input { accent-color: var(--accent); }
.inc-badge.fake { background: transparent; color: var(--text-muted); border: 1px solid var(--z-meio); }
.inc-badge.dup { background: transparent; color: var(--text); border: 1px dashed var(--z-meio); }
.inc-origin-chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 4px 2px 10px; border-radius: 999px; background: var(--bg-sunk); border: 1px solid var(--border); font-size: 12px; }
tr.inc-dup-noble td:first-child { box-shadow: inset 3px 0 0 var(--danger); }

/* ---- Chegando: página larga, mapa + coluna lateral (linha do tempo, ondas, prioridade) */
.page.single.inc-page { max-width: 1760px; }
.inc-top { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 14px; align-items: start; margin: 4px 0 14px; }
.inc-top .map-wrap.inc-map { height: 640px; margin: 0 0 6px; }
.inc-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.inc-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 10px 12px; }
.inc-card h3 { font-size: 13px; margin: 0 0 8px; }
.inc-card h3 .muted { font-weight: 400; font-size: 11.5px; }
.inc-note { font-size: 11.5px; margin: 6px 0 0; }
.inc-timebar { align-items: center; }
.inc-timebar .inc-tlabel { font-size: 13px; font-weight: 600; color: var(--text-muted); }
.inc-timebar input[type="time"] { padding: 5px 7px; border: 1px solid var(--border); border-radius: 7px; background: var(--bg-card); color: var(--text); font: inherit; }
.inc-bars { display: flex; align-items: flex-end; gap: 2px; height: 120px; padding-bottom: 16px; position: relative; }
.inc-bar { flex: 1 1 0; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: stretch;
  background: none; border: 0; padding: 0; cursor: pointer; position: relative; }
.inc-bar .stack { display: flex; flex-direction: column-reverse; justify-content: flex-start; gap: 2px; height: 100%; }
.inc-bar .stack i { display: block; width: 100%; }
.inc-bar .stack i:last-child { border-radius: 3px 3px 0 0; }
.inc-bar .r { background: var(--accent); }
.inc-bar .f { background: var(--border-strong); }
.inc-bar:hover .stack i { filter: brightness(1.15); }
.inc-bar.off { opacity: .35; }
.inc-bar.on .stack { outline: 2px solid var(--accent); outline-offset: 1px; }
.inc-bar .nob { position: absolute; top: -2px; left: 50%; transform: translate(-50%, -100%); font-size: 9.5px; font-weight: 700; color: #fff;
  background: var(--danger); border-radius: 999px; padding: 0 4px; line-height: 14px; }
.inc-bar .lbl { position: absolute; bottom: -16px; left: 0; font-size: 10px; color: var(--text-muted); white-space: nowrap; }
.inc-hist { padding-top: 16px; }
.inc-hist-max { font-size: 11px; margin-top: 4px; }
.inc-hist-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 11.5px; color: var(--text-muted); margin-top: 6px; }
.inc-hist-legend .sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; vertical-align: -1px; margin-right: 3px; }
.inc-sw-real { background: var(--accent); } .inc-sw-fake { background: var(--border-strong); } .inc-sw-noble { background: var(--danger); border-radius: 999px !important; }
.inc-wave-list, .inc-prio { list-style: none; margin: 0; padding: 0; max-height: 300px; overflow: auto; }
.inc-wave-list li, .inc-prio li { padding: 7px 8px; border-radius: 7px; border: 1px solid transparent; cursor: pointer; font-size: 12.5px; }
.inc-wave-list li + li, .inc-prio li + li { margin-top: 3px; }
.inc-wave-list li:hover, .inc-prio li:hover { background: var(--bg-sunk); }
.inc-wave-list li.on { background: var(--accent-soft); border-color: var(--accent); }
.inc-wave-list .t { display: flex; gap: 8px; align-items: baseline; }
.inc-wave-list .t .countdown { margin-left: auto; font-size: 11.5px; }
.inc-wave-list .d, .inc-prio .muted { font-size: 11.5px; }
.inc-prio .bad { color: var(--danger); }
.inc-support { grid-column: 1 / -1; border-top: 1px solid var(--border); padding-top: 10px; }
.inc-support table { font-size: 12px; }
.inc-support-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 6px; font-size: 11.5px; white-space: normal; }
.inc-support h4 .inc-wrap { font-weight: 400; white-space: normal; }
@media (max-width: 1100px) {
  .inc-top { grid-template-columns: 1fr; }
  .inc-top .map-wrap.inc-map { height: 460px; }
}
@media (max-width: 720px) { .inc-top .map-wrap.inc-map { height: 320px; } }
.inc-sup-split { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; font-size: 12px; }
.inc-sup-split span { padding: 1px 8px; border-radius: 999px; border: 1px solid var(--border); white-space: nowrap; }
.inc-sup-split .ok { color: var(--good); border-color: var(--good); }
.inc-sup-split .late { color: var(--danger); border-color: var(--danger); }
.inc-sup-split .unk { color: var(--text-muted); border-style: dashed; }
.inc-sup-list { font-size: 11.5px; width: 100%; max-height: 180px; }
.inc-sup-list td { padding: 2px 6px; }
.inc-sup-list tr.late td { color: var(--danger); }
.inc-sup-list tr.ok td:last-child { color: var(--good); }

/* ---- Chegando: próxima onda, saldo, filtros, abas */
.inc-hero { display: grid; grid-template-columns: auto auto 1fr auto; gap: 8px 28px; align-items: center; margin-bottom: 12px;
  background: var(--bg-card); border: 1px solid var(--border); border-left: 5px solid var(--accent); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 14px 18px; }
.inc-hero.noble { border-left-color: var(--danger); }
.inc-hero.quiet { display: block; border-left-color: var(--border-strong); padding: 10px 16px; }
.inc-hero .k { font-size: 12.5px; color: var(--text-muted); font-weight: 600; }
.inc-hero .big { font-size: 30px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.inc-hero .cd .big { color: var(--accent-strong); }
.inc-hero.noble .cd .big { color: var(--danger); }
.inc-hero .facts { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 14px; }
.inc-hero .facts .who { flex-basis: 100%; font-size: 12px; }
.inc-hero .facts .risk { color: var(--danger); }
.inc-hero .noble-text { color: var(--danger); }
.inc-hero .act { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-size: 12px; }
@media (max-width: 900px) { .inc-hero { grid-template-columns: 1fr 1fr; } .inc-hero .facts, .inc-hero .act { grid-column: 1 / -1; align-items: flex-start; } }

.inc-filters { align-items: center; }
.inc-view { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text-muted); }
.inc-view select { font-weight: 600; color: var(--text); }
.inc-more { position: relative; }
.inc-more > summary { list-style: none; cursor: pointer; padding: 5px 10px; border: 1px solid var(--border-strong); border-radius: 7px; font-size: 12.5px; color: var(--accent); }
.inc-more > summary::-webkit-details-marker { display: none; }
.inc-more > summary::after { content: " ▾"; font-size: 10px; }
.inc-more[open] > summary { background: var(--accent-soft); }
.inc-more-body { position: absolute; z-index: 30; top: calc(100% + 4px); left: 0; display: flex; flex-direction: column; gap: 6px; min-width: 240px;
  background: var(--bg-card); border: 1px solid var(--border-strong); border-radius: 8px; box-shadow: 0 6px 24px rgba(0,0,0,.18); padding: 10px 12px; }

.saldo-cell { white-space: nowrap; }
.saldo { display: inline-block; min-width: 44px; font-weight: 700; font-variant-numeric: tabular-nums; }
.saldo.neg { color: var(--danger); } .saldo.pos { color: var(--good); } .saldo.zero { color: var(--text-muted); }
.saldo-bar { display: inline-block; position: relative; width: 60px; height: 6px; border-radius: 3px; background: var(--bg-sunk); vertical-align: middle; margin: 0 6px; }
.saldo-bar::before { content: ""; position: absolute; left: 50%; top: -2px; bottom: -2px; width: 1px; background: var(--border-strong); }
.saldo-bar i { position: absolute; top: 0; bottom: 0; }
.saldo-bar i.neg { background: var(--danger); border-radius: 3px 0 0 3px; }
.saldo-bar i.pos { background: var(--good); border-radius: 0 3px 3px 0; }
.saldo-sub { font-size: 11.5px; }
.stale { cursor: help; }
.soon-ico { margin-right: 3px; }

.inc-tabs { border-bottom: 1px solid var(--border); margin: 6px 0 10px; }
.inc-tabs .tab-n { font-size: 11px; font-weight: 600; color: var(--text-muted); margin-left: 3px; }
.inc-tabs .tab-n:empty { display: none; }

/* notas da aldeia (intel) */
.inc-badge.intel-def { background: transparent; color: #2f7fd6; border: 1px solid #4ea3ff; }
.inc-badge.intel-atk { background: transparent; color: var(--danger); border: 1px solid #ff4d3d; }
.sw.intel-ring { background: transparent !important; border: 2px solid; border-radius: 999px; }
.sw.intel-ring.atk { border-color: #ff4d3d; } .sw.intel-ring.def { border-color: #4ea3ff; }
.sw.intel-wall { background: #ffd84d; border-radius: 999px; }
.inc-badge.full { background: #7a1d12; color: #fff; }

/* ---- central dentro do jogo (/central) */
body.central #btn-logout, body.central #ws-select { display: none !important; }
body.central-member #main-nav, body.central-member #world-pill, body.central-member #support-pill { display: none !important; }
body.central-member #inc-player, body.central-member #inc-player-link,
body.central-member .inc-tabs [data-inctab]:not([data-inctab="aldeias"]),
body.central-member [data-inctab-body]:not([data-inctab-body="aldeias"]) { display: none !important; }
body.central-member .inc-page .page-head .hint, body.central-member .inc-page .page-head .hint-tip { display: none; }
.inc-support-names { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.inc-search { min-width: 220px; }
@media (max-width: 720px) { .inc-search { flex: 1; min-width: 0; } }
#central-troops-note.on { color: var(--good); }

/* ------------------------------------------------------------------ inteligência (aldeias inimigas) */
.intel-page { max-width: 1400px; }
.intel-filters { padding: 10px 14px; margin-bottom: 12px; }
.intel-filters .toolbar { margin: 0; }
.intel-layers { margin-top: 8px !important; gap: 4px 18px; }
.intel-layers .checkbox-field { margin: 0; }
.intel-sw { display: inline-block; width: 11px; height: 11px; border-radius: 2px; }
.intel-sw.atk { background: #d9412f; }
.intel-sw.likely { background: #e8875c; opacity: .8; }
.intel-sw.def { background: #3b78d8; }
.intel-sw.gap, .intel-sw.note, .intel-sw.pdef { background: #8fb8ea; }  /* defesa provável (sem ataque visto) */
.intel-kind { font-size: 12px; font-weight: 600; white-space: nowrap; display: inline-flex; align-items: center; gap: 5px; }
.intel-kind::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.intel-kind.atk { color: #c2382a; }
.intel-kind.likely { color: #c4673f; }
.intel-kind.def { color: #3b78d8; }
.intel-kind.gap { color: #5b8fd0; }
.intel-kind.note { color: #5b8fd0; }
/* topo da Inteligência: front conhecido (principal) + disposição numa barra só; o resto numa linha */
.intel-summary { grid-template-columns: minmax(260px, 1fr) minmax(300px, 1.4fr); }
.intel-summary .stat-chip.hero { grid-column: auto; }
.intel-dispo .dispo-bar { display: flex; height: 12px; border-radius: 4px; overflow: hidden; margin: 8px 0 6px; background: var(--bg-sunk); gap: 1px; }
.intel-dispo .dispo-bar i { display: block; height: 100%; min-width: 3px; }
.dispo-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; }
.dispo-legend .sw { margin-right: 4px; }
.intel-status { font-size: 13px; color: var(--text-muted); margin: -4px 0 10px; }
.intel-status b { color: var(--text); }
.intel-toggles { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.intel-toggles .tg-label { font-size: 12px; color: var(--text-muted); margin-right: 2px; }
.intel-toggles .tg-sep { width: 1px; height: 18px; background: var(--border); margin: 0 6px; }
.intel-toggles .tg { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; padding: 3px 9px 3px 7px; border: 1px solid var(--border);
  border-radius: 999px; cursor: pointer; user-select: none; background: var(--bg-card); }
.intel-toggles .tg input { position: absolute; opacity: 0; pointer-events: none; }
.intel-toggles .tg:has(input:not(:checked)) { opacity: .45; }
.intel-toggles .tg:has(input:focus-visible) { outline: 2px solid var(--accent, #7d510f); outline-offset: 1px; }
.intel-toggles .tg .sw { margin: 0; }
.intel-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--text-muted); margin: 6px 0 14px; }
.intel-legend .sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; vertical-align: -1px; margin-right: 4px; }
@media (max-width: 760px) { .intel-summary { grid-template-columns: 1fr; } .intel-toggles .tg-sep { display: none; } }
/* Equipe: quem vê o Mapa e torres da tribo inteira na central */
.central-fullmap { display: grid; gap: 8px; margin: 10px 0 14px; }
.central-fullmap .tribe-chips { min-height: 0; }
/* central do membro: Chegando, Inteligência e Mapa e torres */
.central-nav { display: none; gap: 4px; }
body.central-member .central-nav { display: flex; }
.central-nav a { padding: 4px 12px; border-radius: 6px; color: inherit; text-decoration: none; font-weight: 600; font-size: 13px; }
.central-nav a.active { background: rgba(0,0,0,.18); }

.intel-n.atk { color: #c2382a; }
.intel-n.def { color: #3b78d8; }
.intel-lean { display: inline-block; vertical-align: middle; width: 56px; height: 6px; border-radius: 3px; background: #3b78d8; overflow: hidden; margin-right: 4px; }
.intel-lean i { display: block; height: 100%; background: #d9412f; }
.intel-tabs { margin-top: 18px; }
.intel-tab { margin-top: 10px; }
.intel-tab-note { margin: 0 0 8px; font-size: 12.5px; }
.intel-tab .table-search { margin-bottom: 8px; }
.stat-chip .stat-sub .cbar { display: block; width: 100%; margin: 6px 0 0; }
.intel-sw.tower { background: transparent; border-radius: 50%; box-shadow: inset 0 0 0 2px rgba(110, 220, 230, .95); }
.intel-sw.church { background: rgba(201, 162, 255, .35); border-radius: 50%; box-shadow: inset 0 0 0 1.5px rgba(201, 162, 255, .9); }
.intel-sw.academy { background: transparent; width: 9px; height: 9px; transform: rotate(45deg); box-shadow: inset 0 0 0 1.5px var(--text-muted); }
.intel-sw.old { background: rgba(217, 65, 47, .45); outline: 1.5px dashed var(--text-muted); outline-offset: 1px; }
.mini-select { padding: 3px 6px; font-size: 12.5px; }

/* Planejador em passos: número do passo no título de cada grupo e modelos prontos no topo */
.step-n { display: inline-grid; place-items: center; width: 18px; height: 18px; margin-right: 7px; border-radius: 50%;
  background: var(--accent); color: var(--on-accent); font-size: 11px; font-weight: 700; flex: none; }
.preset-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: 0 0 12px; font-size: 12.5px; }
.preset-row .btn-link { font-size: 12.5px; }
.param-group > summary { justify-content: flex-start; gap: 4px; }
.param-group > summary::after { margin-left: auto; }
.warn-list { margin: 6px 0 0; padding-left: 18px; }
.warn-list li { margin: 3px 0; }

/* abas de seção (Operações: OPs · Montar · Envios; Tropas: Ataque · Defesa · Mapa e torres) */
.subnav { display: flex; gap: 2px; padding: 0 18px; background: var(--bg-card); border-bottom: 1px solid var(--border);
  position: sticky; top: 56px; z-index: 25; overflow-x: auto; }
.subnav a { padding: 10px 14px 9px; color: var(--text-muted); text-decoration: none; font-weight: 600; font-size: 13px;
  border-bottom: 2px solid transparent; white-space: nowrap; }
.subnav a:hover { color: var(--text); }
.subnav a.active { color: var(--accent); border-bottom-color: var(--accent); }
.subnav a.locked::after { content: " 🔒"; font-size: 11px; }
.subnav a:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
@media (max-width: 900px) { .subnav { position: static; padding: 0 8px; } }
/* com a barra de abas visível, o que gruda no topo desce a altura dela */
body.has-subnav .panel.params-panel { top: 112px; max-height: calc(100vh - 128px); }
body.has-subnav .filterbar { top: 102px; }
@media (max-width: 900px) { body.has-subnav .filterbar, body.has-subnav .panel.params-panel { top: 0; } }
.op-st { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600;
  background: var(--bg-sunk); color: var(--text-muted); vertical-align: 1px; }
.op-st.next { background: var(--accent-soft); color: var(--accent-strong); }
.op-st.live { background: var(--good-soft); color: var(--good); }
#team-tokens:not(.show-revoked) tr.revoked { display: none; }
.team-sec { margin-top: 18px; }
.team-sec > summary { cursor: pointer; list-style: none; }
.team-sec > summary::-webkit-details-marker { display: none; }
.team-sec > summary::before { content: "▸ "; color: var(--text-muted); }
.team-sec[open] > summary::before { content: "▾ "; }
.blind-tabs { margin: 16px 0 14px; border-bottom: 1px solid var(--border); }
.cfg-savebar { position: sticky; bottom: 0; padding: 10px 0; background: var(--bg); border-top: 1px solid var(--border); margin-top: 14px; z-index: 5; }
.home-list.clip > li.more { display: none; }
.page-head > a.btn { margin-left: auto; text-decoration: none; }

/* Equipe → Plano: escolher plano e período, pagar por PIX, avisar */
.plan-sec, .ops-sec { margin-top: 18px; }
.plan-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; margin: 8px 0 10px; }
.plan-opt { display: grid; gap: 2px; text-align: left; padding: 14px 16px; border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--bg-card); color: var(--text); cursor: pointer; font: inherit; position: relative; }
.plan-opt b { font-size: 15px; }
.plan-opt span { font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }
.plan-opt small { color: var(--text-muted); font-size: 12.5px; }
.plan-opt em { position: absolute; top: 10px; right: 12px; font-style: normal; font-size: 11px; font-weight: 700; color: var(--good); }
.plan-opt:hover { border-color: var(--border-strong); }
.plan-opt.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.plan-opt:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.plan-opts { gap: 10px 20px; }
.plan-pay { margin-top: 10px; padding: 14px 16px; border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: var(--radius); background: var(--bg-card); display: grid; gap: 8px; }
.pay-sum { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 15px; }
.pay-sum b { font-size: 22px; font-variant-numeric: tabular-nums; }
.ops-tabs { margin: 8px 0 10px; border-bottom: 1px solid var(--border); }
/* faixa da cobrança (teste grátis, vencendo, vencido) logo abaixo do topo */
.plan-banner { padding: 8px 20px; font-size: 13.5px; background: var(--accent-soft); color: var(--accent-strong); border-bottom: 1px solid var(--border); }
.plan-banner.warn { background: var(--warn-soft); color: var(--warn); }
.plan-banner.danger { background: var(--danger-soft); color: var(--danger); font-weight: 600; }
.plan-banner a { color: inherit; font-weight: 700; margin-left: 6px; }

/* barra lateral de Defesa/Ataque: as listas de baixo ficam recolhidas (a barra passava da página) */
.side-more > summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; }
.side-more > summary::-webkit-details-marker { display: none; }
.side-more > summary h2 { margin: 0; }
.side-more > summary::after { content: "+"; color: var(--accent); font-size: 18px; line-height: 1; }
.side-more[open] > summary { margin-bottom: 10px; }
.side-more[open] > summary::after { content: "−"; }

/* ------------------------------------------------------------------ desempenho (#desempenho) */
/* cores das linhas: paleta categórica validada (daltonismo e contraste) contra o fundo dos cartões,
   claro #fffdf8 e escuro #1d1a16 — a vaga de cada jogador é fixa enquanto ele está no gráfico */
.perf-page { --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4; --s6: #6250d6; --chart-grid: #eee5d4; --chart-axis: #cdbd9f; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .perf-page { --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #9085e9; --chart-grid: #2a251d; --chart-axis: #4a3f30; }
}
:root[data-theme="dark"] .perf-page { --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #9085e9; --chart-grid: #2a251d; --chart-axis: #4a3f30; }
.perf-page .segmented button { white-space: nowrap; flex: 0 0 auto; }
.perf-filters .segmented { margin: 0; }
.perf-body { transition: opacity .15s; }
.perf-body.loading { opacity: .55; }
.perf-notes { list-style: none; margin: -4px 0 12px; padding: 0; font-size: 12.5px; color: var(--text-muted); }
.perf-notes:empty { display: none; }
.perf-chart-card { position: relative; margin-bottom: 14px; }
.perf-chart-bar { display: flex; gap: 8px; flex-wrap: wrap; justify-content: space-between; margin-bottom: 12px; }
.perf-chart-bar .segmented { margin: 0; flex-wrap: wrap; }
.perf-chart-title { font-size: 14px; margin: 0 0 6px; }
.perf-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; margin-bottom: 6px; }
.perf-legend:empty { display: none; }
.perf-legend .lg { display: inline-flex; align-items: center; gap: 6px; }
.perf-legend .lg i { width: 14px; height: 2px; border-radius: 1px; }
.perf-legend button { border: 0; background: none; color: var(--text-muted); cursor: pointer; font-size: 14px; line-height: 1; padding: 0 2px; }
.perf-legend button:hover { color: var(--danger); }
.perf-chart { position: relative; height: 280px; border-radius: 6px; }
.perf-chart:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.perf-chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.perf-chart .grid { stroke: var(--chart-grid); stroke-width: 1; }
.perf-chart .zero { stroke: var(--chart-axis); stroke-width: 1; }
.perf-chart text { fill: var(--text-muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.perf-chart text.end-lbl { fill: var(--text); font-size: 12px; font-weight: 600; }
.perf-chart .ln { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.perf-chart .end { stroke: var(--bg-card); stroke-width: 2; }
.perf-chart .xh { stroke: var(--text-muted); stroke-width: 1; }
.perf-chart .tick { stroke: var(--chart-axis); stroke-width: 1; }
.perf-empty { display: grid; place-items: center; height: 100%; color: var(--text-muted); text-align: center; }
.perf-tip { position: absolute; pointer-events: none; z-index: 5; min-width: 150px; max-width: 260px; padding: 8px 10px; font-size: 12.5px;
  background: var(--bg-card); border: 1px solid var(--border-strong); border-radius: 8px; box-shadow: var(--shadow); }
.perf-tip .when { color: var(--text-muted); font-size: 11.5px; margin-bottom: 4px; }
.perf-tip .row { display: grid; grid-template-columns: 12px auto 1fr; gap: 8px; align-items: center; line-height: 1.6; }
.perf-tip .row i { height: 2px; border-radius: 1px; }
.perf-tip .row b { font-variant-numeric: tabular-nums; }
.perf-tip .row span { color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.perf-table-note { font-size: 12px; }
.perf-key { display: inline-block; width: 12px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 6px; }
.perf-table tr.sel td:first-child { font-weight: 600; }
.perf-table small.sub { display: block; color: var(--text-muted); font-size: 11.5px; white-space: nowrap; }
.perf-table td.num .cbar { display: block; width: 100%; max-width: 64px; margin: 3px 0 0 auto; }
.dl { white-space: nowrap; font-variant-numeric: tabular-nums; }
.dl.up { color: var(--good); }
.dl.down { color: var(--danger); }
.perf-th { text-decoration: underline dotted var(--border-strong); text-underline-offset: 3px; cursor: help; }
.perf-glossary { margin-top: 16px; scroll-margin-top: 72px; }
.perf-glossary h3 { font-size: 15px; margin-bottom: 4px; }
.perf-glossary > p { margin: 0 0 12px; font-size: 12.5px; }
.perf-glossary dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px 24px; margin: 0; }
.perf-glossary dt { font-weight: 600; margin-bottom: 2px; }
.perf-glossary dd { margin: 0; font-size: 13px; color: var(--text-muted); line-height: 1.5; }
.perf-glossary dd b { color: var(--text); font-weight: 600; }
.spark { width: 72px; height: 20px; display: block; }
.spark polyline { fill: none; stroke: var(--text-muted); stroke-width: 1.5; stroke-linejoin: round; }
.spark circle { fill: var(--accent); }
@media (max-width: 640px) {
  .perf-chart { height: 220px; }
  .perf-table-note { display: none; }
}

/* ------------------------------------------------------------------ pesquisa de experiência */
.survey-card { position: fixed; left: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 250; width: min(340px, calc(100vw - 32px));
  background: var(--bg-card); border: 1px solid var(--border-strong); border-radius: var(--radius); box-shadow: 0 6px 24px rgba(40, 25, 5, .18); padding: 14px 16px; }
.survey-card b { display: block; font-size: 14px; }
.survey-card p { margin: 4px 0 10px; font-size: 13px; color: var(--text-muted); }
.survey-card-acts { display: flex; gap: 8px; }
.survey-dlg { width: min(640px, 94vw); max-height: 90vh; border: 1px solid var(--border); border-radius: 12px; background: var(--bg-card); color: var(--text); padding: 18px 20px; }
.survey-dlg::backdrop { background: rgba(20, 12, 4, .6); }
.survey-dlg h2 { font-size: 17px; }
.survey-q { border: 0; border-top: 1px solid var(--border); margin: 0; padding: 14px 0 12px; display: grid; gap: 6px; }
.survey-q legend { font-weight: 600; padding: 0; margin-bottom: 8px; float: left; width: 100%; }
.survey-q legend + * { clear: both; }
.survey-opt { display: flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; padding: 3px 0; }
.survey-opt input { accent-color: var(--accent); margin: 0; }
.survey-hint { font-size: 12px; margin-top: -4px; }
.survey-extra { margin: 2px 0 4px 24px; width: calc(100% - 24px); }
.survey-q textarea, .survey-extra { font: inherit; font-size: 13px; padding: 6px 8px; border: 1px solid var(--border-strong); border-radius: 6px; background: var(--bg-card); color: var(--text); }
.survey-q > textarea { width: 100%; }
.survey-scale { display: flex; gap: 4px; flex-wrap: wrap; }
.survey-scale label { cursor: pointer; }
.survey-scale input { position: absolute; opacity: 0; pointer-events: none; }
.survey-scale span { display: grid; place-items: center; min-width: 38px; height: 34px; padding: 0 6px; border: 1px solid var(--border-strong); border-radius: 6px; font-weight: 600; font-variant-numeric: tabular-nums; }
.survey-scale input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.survey-scale input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.survey-scale-ends { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; color: var(--text-muted); }
.survey-pair { display: flex; gap: 12px; flex-wrap: wrap; }
.survey-pair label { display: grid; gap: 4px; font-size: 13px; }
.survey-err { color: var(--danger); font-weight: 600; margin: 8px 0 0; }
.survey-q.missing legend { color: var(--danger); }
.survey-q.missing legend::after { content: " — falta responder"; font-weight: 400; font-size: 12.5px; }
.survey-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; border-top: 1px solid var(--border); padding-top: 14px; margin-top: 4px; }
.survey-foot .muted { font-size: 12px; }
@media (max-width: 640px) { .survey-scale span { min-width: 30px; } }

/* Apoiar (doações): página e o atalho no topo */
.page.single.donate-page { max-width: 1100px; }
.donate-page .card > .section-h:first-child { margin-top: 0; }
.donate-page .card { padding: 18px 20px; margin-bottom: 16px; }
.support-pill { text-decoration: none; }
.support-pill:hover { text-decoration: underline; }
