/* ===== contrast.css — alto contraste (preto + amarelo), ligado por data-contrast="alto" no <html> (aesir/a11y.js) =====
   Carregado POR ÚLTIMO (depois de font-sets.css). Exceção deliberada à regra de especificidade baixa dos outros CSS (base.css,
   footer.css): o bloco de tokens tem que vencer, em qualquer combinação de tela cheia/compacto e claro/escuro/sem data-theme, os
   blocos de theme.css (brand, bgdark/bglight) e o :root do stability; por isso todo seletor começa pelo prefixo P abaixo
   (0,3,1) e, onde a regra original usa #id, o seletor também usa #id. Sem !important. Paleta (modelo do vobys): fundo #000,
   texto #fff, acentos/bordas/links #facc15; muted #fde68a. Razão de contraste do texto >= 7:1 (medida na suíte, cenário Y). */

html[data-contrast="alto"]:is(.embed, :not(.embed)):is([data-theme], :not([data-theme])) {
  color-scheme: dark;
  --bg: #000000; --fg: #ffffff; --card-bg: #000000; --accent: #facc15; --muted: #fde68a; --muted-border: #facc15;
  --chart-bg: #000000; --chart-border: #facc15; --disabled-fg: #fde68a; --disabled-border: #fde68a;
  --num-accent: #facc15; --speed-download: #facc15; --speed-upload: #ffffff; --meter-bk: #ffffff66;
  --zs-bg: #000000; --zs-surface: #000000; --zs-surface-muted: #1a1a1a; --zs-border: #facc15; --zs-text: #ffffff;
  --zs-text-muted: #fde68a; --zs-primary: #facc15; --zs-primary-hover: #fde047; --zs-primary-subtle: #2a2400;
  --zs-on-primary: #000000; --zs-secondary: #ffffff;
}

/* fundo e texto (a tela cheia tem um gradiente de marca no body) */
html[data-contrast="alto"]:is(.embed, :not(.embed)):is([data-theme], :not([data-theme])) body {
  background: #000000;
  color: #ffffff;
}

/* links: amarelos e sublinhados (inclui o rodapé em texto/chips/barra e o e-mail da política) */
html[data-contrast="alto"]:is(.embed, :not(.embed)):is([data-theme], :not([data-theme])) a,
html[data-contrast="alto"]:is(.embed, :not(.embed)):is([data-theme], :not([data-theme])) .footer a.privacy,
html[data-contrast="alto"]:is(.embed, :not(.embed)):is([data-theme], :not([data-theme])) div.closePrivacyPolicy a.privacy {
  color: #facc15;
  text-decoration: underline;
}
html[data-contrast="alto"]:is(.embed, :not(.embed)):is([data-theme], :not([data-theme])) .footer a.privacy {
  border-color: #facc15;
  background: #000000;
}
html[data-contrast="alto"]:is(.embed, :not(.embed)):is([data-theme], :not([data-theme])) .footer a.privacy + a.privacy::before {
  color: #facc15;
}

/* botões e seletores: contorno amarelo, texto amarelo; hover/ativo invertem (amarelo com texto preto) */
html[data-contrast="alto"]:is(.embed, :not(.embed)):is([data-theme], :not([data-theme])) #startStopBtn,
html[data-contrast="alto"]:is(.embed, :not(.embed)):is([data-theme], :not([data-theme])) #startBtn,
html[data-contrast="alto"]:is(.embed, :not(.embed)):is([data-theme], :not([data-theme])) #resetBtn,
html[data-contrast="alto"]:is(.embed, :not(.embed)):is([data-theme], :not([data-theme])) #durationSelect,
html[data-contrast="alto"]:is(.embed, :not(.embed)):is([data-theme], :not([data-theme])) #server,
html[data-contrast="alto"]:is(.embed, :not(.embed)):is([data-theme], :not([data-theme])) .history-csv-btn,
html[data-contrast="alto"]:is(.embed, :not(.embed)):is([data-theme], :not([data-theme])) #downloadCsvBtn,
html[data-contrast="alto"]:is(.embed, :not(.embed)):is([data-theme], :not([data-theme])) .history-clear,
html[data-contrast="alto"]:is(.embed, :not(.embed)):is([data-theme], :not([data-theme])) .accordion-share-copy {
  background-color: #000000;
  border-color: #facc15;
  color: #facc15;
}
html[data-contrast="alto"]:is(.embed, :not(.embed)):is([data-theme], :not([data-theme])) #startStopBtn:hover,
html[data-contrast="alto"]:is(.embed, :not(.embed)):is([data-theme], :not([data-theme])) #startBtn:hover,
html[data-contrast="alto"]:is(.embed, :not(.embed)):is([data-theme], :not([data-theme])) #resetBtn:hover,
html[data-contrast="alto"]:is(.embed, :not(.embed)):is([data-theme], :not([data-theme])) .history-csv-btn:hover,
html[data-contrast="alto"]:is(.embed, :not(.embed)):is([data-theme], :not([data-theme])) #downloadCsvBtn:hover,
html[data-contrast="alto"]:is(.embed, :not(.embed)):is([data-theme], :not([data-theme])) .history-clear:hover,
html[data-contrast="alto"]:is(.embed, :not(.embed)):is([data-theme], :not([data-theme])) .accordion-share-copy:hover,
html[data-contrast="alto"]:is(.embed, :not(.embed)):is([data-theme], :not([data-theme])) #startStopBtn.running,
html[data-contrast="alto"]:is(.embed, :not(.embed)):is([data-theme], :not([data-theme])) #startBtn.running {
  background-color: #facc15;
  border-color: #facc15;
  color: #000000;
}
html[data-contrast="alto"]:is(.embed, :not(.embed)):is([data-theme], :not([data-theme])) #durationSelect,
html[data-contrast="alto"]:is(.embed, :not(.embed)):is([data-theme], :not([data-theme])) #server {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23facc15'/%3E%3C/svg%3E");
  color: #facc15;
}
html[data-contrast="alto"]:is(.embed, :not(.embed)):is([data-theme], :not([data-theme])) #resetBtn {
  border: 0.15em solid #facc15;
}

/* faixa de acessibilidade do compacto */
html[data-contrast="alto"]:is(.embed, :not(.embed)):is([data-theme], :not([data-theme])) .a11y-bar {
  border-bottom-color: #facc15;
}
html[data-contrast="alto"]:is(.embed, :not(.embed)):is([data-theme], :not([data-theme])) .a11y-btn {
  border-color: #facc15;
  color: #facc15;
}
html[data-contrast="alto"]:is(.embed, :not(.embed)):is([data-theme], :not([data-theme])) .a11y-btn[aria-checked="true"],
html[data-contrast="alto"]:is(.embed, :not(.embed)):is([data-theme], :not([data-theme])) .a11y-btn[aria-pressed="true"],
html[data-contrast="alto"]:is(.embed, :not(.embed)):is([data-theme], :not([data-theme])) .a11y-btn:hover:not(:disabled) {
  background: #facc15;
  color: #000000;
}

/* Única/Múltiplas (index): selecionado = amarelo com texto preto */
html[data-contrast="alto"]:is(.embed, :not(.embed)):is([data-theme], :not([data-theme])) .conn-seg {
  border-color: #facc15;
}
html[data-contrast="alto"]:is(.embed, :not(.embed)):is([data-theme], :not([data-theme])) .conn-seg button[aria-checked="true"] {
  background: #facc15;
  color: #000000;
}

/* texto atenuado por opacity/cinza fixo: no alto contraste vira pleno */
html[data-contrast="alto"]:is(.embed, :not(.embed)):is([data-theme], :not([data-theme])) .accordion-header .accordion-date,
html[data-contrast="alto"]:is(.embed, :not(.embed)):is([data-theme], :not([data-theme])) .accordion-header .accordion-meta,
html[data-contrast="alto"]:is(.embed, :not(.embed)):is([data-theme], :not([data-theme])) .accordion-icon,
html[data-contrast="alto"]:is(.embed, :not(.embed)):is([data-theme], :not([data-theme])) .history-section h3,
html[data-contrast="alto"]:is(.embed, :not(.embed)):is([data-theme], :not([data-theme])) .ipcard,
html[data-contrast="alto"]:is(.embed, :not(.embed)):is([data-theme], :not([data-theme])) #ipArea,
html[data-contrast="alto"]:is(.embed, :not(.embed)):is([data-theme], :not([data-theme])) .accordion-body,
html[data-contrast="alto"]:is(.embed, :not(.embed)):is([data-theme], :not([data-theme])) .conn,
html[data-contrast="alto"]:is(.embed, :not(.embed)):is([data-theme], :not([data-theme])) .poweredby {
  opacity: 1;
}
html[data-contrast="alto"]:is(.embed, :not(.embed)):is([data-theme], :not([data-theme])) .accordion-header .accordion-date,
html[data-contrast="alto"]:is(.embed, :not(.embed)):is([data-theme], :not([data-theme])) .accordion-header .accordion-metric {
  color: #fde68a;
}
html[data-contrast="alto"]:is(.embed, :not(.embed)):is([data-theme], :not([data-theme])) .accordion-header .accordion-metric strong {
  color: #ffffff;
}

/* bordas cinza translúcidas viram amarelas */
html[data-contrast="alto"]:is(.embed, :not(.embed)):is([data-theme], :not([data-theme])) .accordion,
html[data-contrast="alto"]:is(.embed, :not(.embed)):is([data-theme], :not([data-theme])) .ipcard,
html[data-contrast="alto"]:is(.embed, :not(.embed)):is([data-theme], :not([data-theme])) #pingChart,
html[data-contrast="alto"]:is(.embed, :not(.embed)):is([data-theme], :not([data-theme])) #uplotHost {
  border-color: #facc15;
}
html[data-contrast="alto"]:is(.embed, :not(.embed)):is([data-theme], :not([data-theme])) .accordion-panel + .accordion-panel {
  border-top-color: #facc15;
}
html[data-contrast="alto"]:is(.embed, :not(.embed)):is([data-theme], :not([data-theme])) .accordion-header:hover {
  background: #2a2400;
}

/* selo da Avaliação (stability): cores sobre preto com >= 7:1 (os #id originais exigem #id aqui) */
html[data-contrast="alto"]:is(.embed, :not(.embed)):is([data-theme], :not([data-theme])) #rating.great,
html[data-contrast="alto"]:is(.embed, :not(.embed)):is([data-theme], :not([data-theme])) .history-badge.great { color: #4ade80; }
html[data-contrast="alto"]:is(.embed, :not(.embed)):is([data-theme], :not([data-theme])) #rating.good,
html[data-contrast="alto"]:is(.embed, :not(.embed)):is([data-theme], :not([data-theme])) .history-badge.good { color: #a3e635; }
html[data-contrast="alto"]:is(.embed, :not(.embed)):is([data-theme], :not([data-theme])) #rating.poor,
html[data-contrast="alto"]:is(.embed, :not(.embed)):is([data-theme], :not([data-theme])) .history-badge.poor { color: #fb923c; }
html[data-contrast="alto"]:is(.embed, :not(.embed)):is([data-theme], :not([data-theme])) #rating.bad,
html[data-contrast="alto"]:is(.embed, :not(.embed)):is([data-theme], :not([data-theme])) .history-badge.bad { color: #ff6b6b; }

/* modal de privacidade: o véu preto some sobre fundo preto, então a caixa ganha borda amarela */
html[data-contrast="alto"]:is(.embed, :not(.embed)):is([data-theme], :not([data-theme])) #privacyPolicy {
  border: 0.125rem solid #facc15;
  box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.85);
}

/* controles nativos e foco */
html[data-contrast="alto"]:is(.embed, :not(.embed)):is([data-theme], :not([data-theme])) input[type="range"] {
  accent-color: #facc15;
}
html[data-contrast="alto"]:is(.embed, :not(.embed)):is([data-theme], :not([data-theme])) span.loadCircle {
  filter: invert(1);
}
html[data-contrast="alto"]:is(.embed, :not(.embed)):is([data-theme], :not([data-theme])) :focus-visible {
  outline: 0.1875rem solid #facc15;
  outline-offset: 0.125rem;
}

/* com alto contraste ligado o claro/escuro não faz sentido: some o botão de modo do popover */
html[data-contrast="alto"]:is(.embed, :not(.embed)):is([data-theme], :not([data-theme])) .zs-mode {
  display: none;
}

/* forced-colors (Windows alto contraste): quem manda é o SO; só garante que as amostras de cor do painel continuem coloridas */
@media (forced-colors: active) {
  .zs-swatch {
    forced-color-adjust: none;
  }
}
