/**
 * A11y UFBA — estilos do painel + recursos visuais (agnostico de CMS).
 *
 * Duas partes:
 *   1) UI do widget (.a11ybr-launcher, .a11ybr-panel, ...).
 *   2) Recursos aplicados ao documento via classes em <html> (.a11ybr-<id>).
 *
 * Convencoes:
 *   - Tudo com prefixo .a11ybr- para nao vazar estilo no tema.
 *   - Filtros visuais sao aplicados ao <body>; o widget vive fora dele (<html>).
 *
 * Paleta (azul padrao de widgets de acessibilidade):
 *   --a11ybr-dark:   #1e3a8a  (azul escuro do topo/launcher)
 *   --a11ybr-accent: #2563eb  (azul de acao/ativo)
 *   --a11ybr-soft:   #93c5fd  (azul claro de detalhes)
 */

.a11ybr-panel,
.a11ybr-launcher {
	--a11ybr-dark: #1e3a8a;
	--a11ybr-dark-2: #2c4cad;
	--a11ybr-accent: #2563eb;
	--a11ybr-accent-2: #1d4ed8;
	--a11ybr-soft: #93c5fd;
	--a11ybr-card: #f1f3f6;
	--a11ybr-ink: #16213a;
	--a11ybr-muted: #8b93a1;
	box-sizing: border-box;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}
.a11ybr-panel *,
.a11ybr-panel *::before,
.a11ybr-panel *::after {
	box-sizing: border-box;
}

/* =========================================================================
   1. Botao flutuante (launcher)
   ========================================================================= */
.a11ybr-launcher {
	position: fixed;
	/* Acima do container do VLibras (2147483645) para permanecer clicavel. */
	z-index: 2147483647;
	width: 56px;
	height: 56px;
	border: 0;
	border-radius: 50%;
	background: var(--a11ybr-dark);
	color: var(--a11ybr-soft);
	cursor: pointer;
	box-shadow: 0 4px 14px rgba(30, 58, 138, 0.4);
	display: flex;
	align-items: center;
	justify-content: center;
	transition: transform 0.15s ease, background 0.15s ease;
}
.a11ybr-launcher svg { width: 28px; height: 28px; }
.a11ybr-launcher.a11ybr-right { right: 20px; }
.a11ybr-launcher.a11ybr-left { left: 20px; }
/* Ancora vertical: topo/centro/base da tela (ver a11y-panel.js e a11y-vlibras.js,
   que espelham esses mesmos deslocamentos para o avatar do VLibras). */
.a11ybr-launcher.a11ybr-anchor-top { top: 20px; }
.a11ybr-launcher.a11ybr-anchor-center { bottom: calc(50% - 28px); }
.a11ybr-launcher.a11ybr-anchor-bottom { bottom: 20px; }
.a11ybr-launcher:hover { background: var(--a11ybr-dark-2); transform: scale(1.05); }
.a11ybr-launcher:focus-visible { outline: 3px solid var(--a11ybr-accent); outline-offset: 3px; }

/* =========================================================================
   2. Painel
   ========================================================================= */
.a11ybr-panel {
	position: fixed;
	/* Acima do container do VLibras (2147483645) para permanecer interativo. */
	z-index: 2147483646;
	width: 348px;
	max-width: calc(100vw - 32px);
	max-height: 80vh;
	overflow-y: auto;
	background: #ffffff;
	color: var(--a11ybr-ink);
	border-radius: 22px;
	box-shadow: 0 10px 36px rgba(9, 25, 52, 0.3);
	font-size: 15px;
	line-height: 1.4;
}
.a11ybr-panel.a11ybr-right { right: 20px; }
.a11ybr-panel.a11ybr-left { left: 20px; }
.a11ybr-panel[hidden] { display: none; }

/* Ancora vertical: com o botao no topo/base o painel abre logo acima/abaixo
   dele (ver a11y-panel.js e as constantes espelhadas em a11y-vlibras.js). */
.a11ybr-panel.a11ybr-anchor-top { top: 88px; }
.a11ybr-panel.a11ybr-anchor-bottom { bottom: 88px; }

/* Com o botao no meio da tela nao ha espaco acima nem abaixo dele: o painel
   tem ate 80vh, entao empilha-lo estouraria a viewport. Nesse caso ele abre
   AO LADO do botao (mesmo inset do launcher + a largura dele + a folga) e
   centralizado na vertical. */
.a11ybr-panel.a11ybr-anchor-center {
	top: 50%;
	bottom: auto;
	transform: translateY(-50%);
}
.a11ybr-panel.a11ybr-anchor-center.a11ybr-right { right: 88px; }
.a11ybr-panel.a11ybr-anchor-center.a11ybr-left { left: 88px; }

/* Telas estreitas (celular): bottom sheet fixo na metade inferior.
   O painel ocupa ~50% da altura da viewport, colado na base; a metade
   superior segue mostrando a pagina, que continua rolavel por tras.
   O conteudo interno rola de forma independente (overflow-y ja definido);
   overscroll-behavior evita que o scroll interno "vaze" para a pagina.
   Obs.: o JS tem outro limiar de tela estreita (fitsBeside() em
   a11y-vlibras.js, ~678px, calculado da geometria acima); os dois nao
   precisam coincidir, mas se mudar a largura/inset do painel aqui,
   atualize as constantes PANEL_* de la. */
@media (max-width: 640px) {
	.a11ybr-panel {
		width: auto;
		max-width: none;
		height: 50vh;
		height: 50dvh;
		max-height: none;
		bottom: 10px;
		overscroll-behavior: contain;
	}
	.a11ybr-panel.a11ybr-right,
	.a11ybr-panel.a11ybr-left {
		left: 10px;
		right: 10px;
	}
	/* Independente da ancora vertical configurada, em tela estreita o painel
	   sempre vira bottom sheet (mais previsivel em telas curtas do que abrir
	   no topo ou centro). Repete a mesma especificidade das regras de ancora
	   acima para garantir que esta vença. */
	.a11ybr-panel.a11ybr-anchor-top,
	.a11ybr-panel.a11ybr-anchor-center,
	.a11ybr-panel.a11ybr-anchor-bottom {
		top: auto;
		bottom: 10px;
		transform: none;
	}
	/* O inset lateral da ancora central (painel ao lado do botao) tem 3 classes
	   e venceria a regra de bottom sheet acima; anulado aqui com a mesma
	   especificidade. */
	.a11ybr-panel.a11ybr-anchor-center.a11ybr-right,
	.a11ybr-panel.a11ybr-anchor-center.a11ybr-left {
		left: 10px;
		right: 10px;
	}
	/* Com o painel aberto ocupando a base da tela, o launcher ficaria
	   sobreposto a ele (z-index maior); some enquanto o painel esta aberto. */
	.a11ybr-launcher[aria-expanded="true"] { display: none; }
}

/* --- Topo escuro (header + destaque Libras) --- */
.a11ybr-top {
	background: var(--a11ybr-dark);
	border-radius: 22px 22px 18px 18px;
	padding: 16px 16px 14px;
	position: sticky;
	top: 0;
	z-index: 1;
}
.a11ybr-header {
	display: flex;
	align-items: center;
	gap: 10px;
}
.a11ybr-header-icon {
	width: 38px;
	height: 38px;
	border-radius: 10px;
	background: var(--a11ybr-accent);
	color: #fff;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}
.a11ybr-header-text { flex: 1; min-width: 0; }
.a11ybr-title {
	margin: 0;
	font-size: 16px;
	font-weight: 800;
	color: #ffffff;
	line-height: 1.2;
}
.a11ybr-subtitle {
	display: block;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.04em;
	color: var(--a11ybr-soft);
}
.a11ybr-close,
.a11ybr-gear {
	width: 30px;
	height: 30px;
	border: 0;
	border-radius: 9px;
	background: var(--a11ybr-dark-2);
	color: #fff;
	font-size: 14px;
	line-height: 1;
	cursor: pointer;
	flex-shrink: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}
.a11ybr-close:hover,
.a11ybr-gear:hover { background: #3a5cc4; }
.a11ybr-close:focus-visible,
.a11ybr-gear:focus-visible { outline: 3px solid var(--a11ybr-soft); outline-offset: 2px; }
.a11ybr-gear svg { width: 18px; height: 18px; }

/* --- Linha destacada (ex.: Traducao em Libras) --- */
.a11ybr-featured {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-top: 14px;
	padding: 12px;
	border-radius: 14px;
	background: var(--a11ybr-dark-2);
}
.a11ybr-featured-icon {
	position: relative;
	width: 44px;
	height: 44px;
	border-radius: 12px;
	background: rgba(37, 99, 235, 0.3);
	color: var(--a11ybr-soft);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}
.a11ybr-featured-icon svg {
	width: 28px;
	height: 28px;
}

/* Transicao mao fechada <-> mao aberta (dois icones sobrepostos). */
.a11ybr-icon-on,
.a11ybr-icon-off {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: opacity 0.28s ease, transform 0.28s ease;
}
.a11ybr-icon-on { opacity: 0; transform: scale(0.55) rotate(-14deg); }
.a11ybr-icon-off { opacity: 1; transform: scale(1) rotate(0deg); }
.a11ybr-featured-icon.a11ybr-is-on .a11ybr-icon-on { opacity: 1; transform: scale(1) rotate(0deg); }
.a11ybr-featured-icon.a11ybr-is-on .a11ybr-icon-off { opacity: 0; transform: scale(0.55) rotate(14deg); }
.a11ybr-featured-text { flex: 1; min-width: 0; }
.a11ybr-featured-label {
	display: block;
	font-size: 14px;
	font-weight: 700;
	color: #fff;
}
.a11ybr-featured-hint {
	display: block;
	font-size: 10px;
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--a11ybr-soft);
	margin-top: 2px;
}

/* Interruptor deslizante */
.a11ybr-switch {
	position: relative;
	width: 46px;
	height: 26px;
	border: 0;
	border-radius: 999px;
	background: #4d64a8;
	cursor: pointer;
	flex-shrink: 0;
	transition: background 0.15s ease;
	padding: 0;
}
.a11ybr-switch-knob {
	position: absolute;
	top: 3px;
	left: 3px;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: #fff;
	transition: left 0.15s ease;
}
.a11ybr-switch[aria-checked="true"] { background: var(--a11ybr-accent); }
.a11ybr-switch[aria-checked="true"] .a11ybr-switch-knob { left: 23px; }
.a11ybr-switch:focus-visible { outline: 3px solid var(--a11ybr-soft); outline-offset: 2px; }

/* --- Corpo --- */
.a11ybr-body { padding: 16px; }

/* Encaixe da janela do VLibras dentro do painel (ver a11y-vlibras.js). A
   margem fica na propria janela, e nao no encaixe: com o recurso desligado a
   raiz do widget recebe display:none e o espaco desaparece por completo — no
   encaixe, sobraria um vao em branco no corpo do painel. */
.a11ybr-dock > #vlibras-app-root { display: block; margin-bottom: 12px; }

/* Grid de cards 2 colunas */
.a11ybr-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
}
.a11ybr-card {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 8px;
	padding: 14px 12px;
	border: 2px solid transparent;
	border-radius: 14px;
	background: var(--a11ybr-card);
	color: var(--a11ybr-ink);
	font-family: inherit;
	text-align: left;
	cursor: pointer;
	transition: background 0.12s ease, border-color 0.12s ease;
}
.a11ybr-card:hover { background: #e7ecf4; }
.a11ybr-card:focus-visible { outline: 3px solid var(--a11ybr-accent); outline-offset: 2px; }
.a11ybr-card-icon {
	color: var(--a11ybr-ink);
	display: inline-flex;
}
.a11ybr-card-label {
	font-size: 13.5px;
	font-weight: 700;
	line-height: 1.25;
}
.a11ybr-card-status {
	font-size: 11px;
	font-weight: 600;
	color: var(--a11ybr-muted);
}
.a11ybr-card[aria-pressed="true"] {
	background: #ffffff;
	border-color: var(--a11ybr-accent);
}
.a11ybr-card[aria-pressed="true"] .a11ybr-card-icon { color: var(--a11ybr-accent); }
.a11ybr-card[aria-pressed="true"] .a11ybr-card-status { color: var(--a11ybr-accent); }

/* --- Card escuro: tamanho do texto --- */
.a11ybr-font-card {
	margin-top: 12px;
	padding: 14px;
	border-radius: 16px;
	background: var(--a11ybr-dark);
	color: #fff;
}
.a11ybr-font-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 12px;
}
.a11ybr-font-label { font-size: 14px; font-weight: 700; }
.a11ybr-font-pct { font-size: 14px; font-weight: 800; color: var(--a11ybr-soft); }
.a11ybr-font-controls {
	display: flex;
	align-items: center;
	gap: 12px;
}
.a11ybr-font-btn {
	width: 42px;
	height: 38px;
	border: 0;
	border-radius: 11px;
	font-size: 15px;
	font-weight: 800;
	font-family: inherit;
	cursor: pointer;
	flex-shrink: 0;
}
.a11ybr-font-minus { background: var(--a11ybr-dark-2); color: #fff; }
.a11ybr-font-minus:hover { background: #3a5cc4; }
.a11ybr-font-plus { background: var(--a11ybr-accent); color: #fff; }
.a11ybr-font-plus:hover { background: var(--a11ybr-accent-2); }
.a11ybr-font-btn:focus-visible { outline: 3px solid var(--a11ybr-soft); outline-offset: 2px; }

/* Slider */
.a11ybr-font-range {
	flex: 1;
	height: 6px;
	appearance: none;
	-webkit-appearance: none;
	background: rgba(255, 255, 255, 0.22);
	border-radius: 999px;
	cursor: pointer;
	accent-color: var(--a11ybr-accent);
}
.a11ybr-font-range::-webkit-slider-thumb {
	-webkit-appearance: none;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	background: var(--a11ybr-accent);
	border: 2px solid #fff;
}
.a11ybr-font-range::-moz-range-thumb {
	width: 14px;
	height: 14px;
	border-radius: 50%;
	background: var(--a11ybr-accent);
	border: 2px solid #fff;
}
.a11ybr-font-range:focus-visible { outline: 3px solid var(--a11ybr-soft); outline-offset: 3px; }

/* --- Reset --- */
.a11ybr-reset {
	display: block;
	width: 100%;
	margin-top: 12px;
	padding: 10px;
	border: 0;
	border-radius: 12px;
	background: transparent;
	color: var(--a11ybr-muted);
	font-family: inherit;
	font-size: 12.5px;
	font-weight: 700;
	cursor: pointer;
}
.a11ybr-reset:hover { color: #c0392b; background: #fdf1ef; }
.a11ybr-reset:focus-visible { outline: 3px solid var(--a11ybr-accent); outline-offset: 2px; }

/* =========================================================================
   2b. Tela de configuracoes (Modo Escuro + creditos)
   ========================================================================= */
.a11ybr-view[hidden] { display: none; }

.a11ybr-settings-header {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 16px;
	border-bottom: 1px solid #e6e6e6;
	position: sticky;
	top: 0;
	background: #ffffff;
	border-radius: 22px 22px 0 0;
}
.a11ybr-back {
	width: 32px;
	height: 32px;
	border: 0;
	border-radius: 9px;
	background: transparent;
	color: var(--a11ybr-ink);
	cursor: pointer;
	flex-shrink: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}
.a11ybr-back:hover { background: #eef1f6; }
.a11ybr-back:focus-visible { outline: 3px solid var(--a11ybr-accent); outline-offset: 2px; }
.a11ybr-settings-title { margin: 0; font-size: 17px; font-weight: 800; color: var(--a11ybr-ink); }

.a11ybr-settings-body { padding: 16px; }
.a11ybr-set-row {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 14px;
	border: 1px solid #e0e4ea;
	border-radius: 14px;
	background: var(--a11ybr-card);
}
.a11ybr-set-icon { color: var(--a11ybr-ink); display: inline-flex; }
.a11ybr-set-label { flex: 1; font-size: 14px; font-weight: 700; }

/* --- Idioma da interface (combobox: bandeira + nome) --- */
.a11ybr-lang-row { flex-direction: column; align-items: stretch; gap: 10px; margin-bottom: 10px; }
.a11ybr-lang-head { display: flex; align-items: center; gap: 12px; }
.a11ybr-lang-combo { position: relative; }

.a11ybr-lang-combo-btn {
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	padding: 8px 10px;
	border: 1px solid #d5dae2;
	border-radius: 10px;
	background: #ffffff;
	color: inherit;
	font: inherit;
	font-size: 14px;
	cursor: pointer;
}
.a11ybr-lang-combo-btn:hover { border-color: #c9d0da; }
.a11ybr-lang-combo-btn:focus-visible { outline: 3px solid var(--a11ybr-accent); outline-offset: 2px; }
.a11ybr-lang-combo-name { flex: 1; text-align: left; }
.a11ybr-lang-combo-chevron { flex: none; display: inline-flex; color: var(--a11ybr-soft); }
.a11ybr-lang-combo-btn[aria-expanded="true"] .a11ybr-lang-combo-chevron { transform: rotate(180deg); }

/* Lista flutuante: some do fluxo (position: absolute) para nao empurrar o
   resto da tela de ajustes ao abrir. */
.a11ybr-lang-listbox {
	position: absolute;
	inset-inline: 0;
	top: calc(100% + 6px);
	z-index: 1;
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding: 6px;
	border: 1px solid #d5dae2;
	border-radius: 10px;
	background: #ffffff;
	box-shadow: 0 8px 24px rgba(15, 23, 42, 0.16);
}
.a11ybr-lang-listbox[hidden] { display: none; }

.a11ybr-lang-listbox-opt {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px 10px;
	border-radius: 8px;
	font-size: 14px;
	cursor: pointer;
}
/* O foco de teclado fica no botao (aria-activedescendant); esta classe e o
   equivalente visual do foco para quem navega pelo mouse ou pelas setas. */
.a11ybr-lang-listbox-opt.a11ybr-is-active { background: #eef1f6; }
.a11ybr-lang-listbox-opt[aria-selected="true"] {
	background: rgba(37, 99, 235, 0.08);
	font-weight: 700;
}

/* Bandeiras: decorativas, por isso entram como imagem de fundo. O caminho e
   relativo a este arquivo, entao vale igual no WordPress e no Drupal. */
.a11ybr-flag {
	flex: none;
	width: 24px;
	height: 24px;
	background-size: contain;
	background-position: center;
	background-repeat: no-repeat;
}
.a11ybr-flag[data-lang="pt"] { background-image: url("../img/flag-pt.png"); }
.a11ybr-flag[data-lang="en"] { background-image: url("../img/flag-en.png"); }
.a11ybr-flag[data-lang="zh"] { background-image: url("../img/flag-zh.png"); }

.a11ybr-panel.a11ybr-dark .a11ybr-lang-combo-btn,
.a11ybr-panel.a11ybr-dark .a11ybr-lang-listbox { background: #16233a; color: #eaf0fb; border-color: #2a3a58; }
.a11ybr-panel.a11ybr-dark .a11ybr-lang-combo-btn:hover { border-color: #33415c; }
.a11ybr-panel.a11ybr-dark .a11ybr-lang-listbox-opt.a11ybr-is-active { background: #1f2f4d; }
.a11ybr-panel.a11ybr-dark .a11ybr-lang-listbox-opt[aria-selected="true"] {
	background: rgba(147, 197, 253, 0.16);
}

/* Modo de alto contraste do sistema: o realce azul do selecionado nao
   aparece, entao a marcacao passa a ser a propria borda do sistema. */
@media (forced-colors: active) {
	.a11ybr-lang-listbox-opt[aria-selected="true"] { border: 2px solid CanvasText; }
	.a11ybr-lang-listbox-opt.a11ybr-is-active { outline: 2px solid CanvasText; }
}

.a11ybr-about { margin-top: 24px; text-align: center; }
.a11ybr-credit { font-size: 12px; color: var(--a11ybr-muted); line-height: 1.6; }
.a11ybr-credit-prefix { display: block; }
.a11ybr-credit-person {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	margin-top: 4px;
}
.a11ybr-credit-icon { color: var(--a11ybr-accent); display: inline-flex; }
.a11ybr-credit-icon svg { width: 22px; height: 22px; }
.a11ybr-credit-name { font-weight: 700; color: var(--a11ybr-ink); }

/* Credito como link de contato (quando creditUrl esta configurado). */
a.a11ybr-credit-person { text-decoration: none; border-radius: 6px; }
a.a11ybr-credit-person:hover .a11ybr-credit-name,
a.a11ybr-credit-person:focus-visible .a11ybr-credit-name {
	color: var(--a11ybr-accent);
	text-decoration: underline;
}
a.a11ybr-credit-person:focus-visible { outline: 3px solid var(--a11ybr-accent); outline-offset: 2px; }
.a11ybr-version { margin-top: 12px; font-size: 11px; color: var(--a11ybr-muted); }

/* =========================================================================
   2c. Modo escuro do widget (classe no proprio painel)
   ========================================================================= */
.a11ybr-panel.a11ybr-dark { background: #0f1b2e; color: #e7edf6; }
.a11ybr-panel.a11ybr-dark .a11ybr-settings-header { background: #0f1b2e; border-bottom-color: #24344f; }
.a11ybr-panel.a11ybr-dark .a11ybr-settings-title,
.a11ybr-panel.a11ybr-dark .a11ybr-back,
.a11ybr-panel.a11ybr-dark .a11ybr-set-label,
.a11ybr-panel.a11ybr-dark .a11ybr-credit-name { color: #e7edf6; }
.a11ybr-panel.a11ybr-dark .a11ybr-back:hover { background: #1c2942; }
.a11ybr-panel.a11ybr-dark .a11ybr-card,
.a11ybr-panel.a11ybr-dark .a11ybr-set-row { background: #1b2942; border-color: #2a3a58; color: #e7edf6; }
.a11ybr-panel.a11ybr-dark .a11ybr-card:hover { background: #22314f; }
.a11ybr-panel.a11ybr-dark .a11ybr-card[aria-pressed="true"] { background: #14243f; border-color: var(--a11ybr-accent); }
.a11ybr-panel.a11ybr-dark .a11ybr-card-icon { color: #e7edf6; }
.a11ybr-panel.a11ybr-dark .a11ybr-card[aria-pressed="true"] .a11ybr-card-icon { color: var(--a11ybr-soft); }
.a11ybr-panel.a11ybr-dark .a11ybr-set-icon { color: var(--a11ybr-soft); }

/* =========================================================================
   3. Elementos auxiliares (regua e skip link)
   ========================================================================= */
.a11ybr-ruler-bar {
	position: fixed;
	/* O JS move a faixa com transform: translateY() a partir de top: 0
	   (composicao, sem relayout/repaint da sombra a cada movimento). */
	top: 0;
	left: 0;
	right: 0;
	height: 150px;
	background: transparent;
	/* Mascara de leitura: a faixa fica limpa e a sombra gigante escurece todo
	   o resto da viewport (acima e abaixo), guiando o foco para a linha atual. */
	box-shadow: 0 0 0 200vmax rgba(15, 23, 42, 0.6);
	will-change: transform;
	pointer-events: none;
	z-index: 2147482000;
}
/* Alto contraste do sistema (Windows High Contrast): o navegador suprime
   box-shadow no modo forced-colors, o que deixaria a mascara invisivel.
   As bordas sobrevivem (recoloridas com cores do sistema) e mantem a faixa
   perceptivel para quem mais depende dela. */
@media (forced-colors: active) {
	.a11ybr-ruler-bar {
		border-top: 3px solid CanvasText;
		border-bottom: 3px solid CanvasText;
	}
}
.a11ybr-skip-link {
	position: fixed;
	top: -60px;
	left: 12px;
	z-index: 2147483001;
	padding: 10px 16px;
	background: #1e3a8a;
	color: #fff;
	border-radius: 0 0 10px 10px;
	text-decoration: none;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
	transition: top 0.15s ease;
}
.a11ybr-skip-link:focus { top: 0; outline: 3px solid #2563eb; }

/* =========================================================================
   4. Recursos aplicados ao documento (classes em <html>)
   ========================================================================= */

/* Alto contraste — aplicado ao <body> para nao atingir o widget. */
html.a11ybr-contrast body,
html.a11ybr-contrast body * {
	background-color: #000 !important;
	color: #fff !important;
	border-color: #fff !important;
}
html.a11ybr-contrast body a,
html.a11ybr-contrast body a * { color: #ffea00 !important; text-decoration: underline !important; }
html.a11ybr-contrast body img { filter: contrast(1.1); }

/* Escala de cinza. */
html.a11ybr-grayscale body { filter: grayscale(100%); }

/* =========================================================================
   3b. Faixa de estado do assistente de voz
   ========================================================================= */

/* Fica na base da tela, independente do painel: o visitante costuma fechar o
   painel para navegar, e precisa continuar vendo o que foi entendido. */
.a11ybr-voice-status {
	position: fixed;
	bottom: 20px;
	left: 50%;
	transform: translateX(-50%);
	z-index: 2147483646;
	max-width: min(520px, calc(100vw - 32px));
	padding: 10px 18px;
	border-radius: 999px;
	background: #1e3a8a;
	color: #ffffff;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
	font-size: 15px;
	line-height: 1.3;
	text-align: center;
	box-shadow: 0 6px 20px rgba(9, 25, 52, 0.35);
}
@media (forced-colors: active) {
	.a11ybr-voice-status { border: 2px solid CanvasText; }
}

/* =========================================================================
   4. Recursos aplicados ao documento (continuacao)
   ========================================================================= */

/* Fonte dislexia (stack legivel, sem dependencia externa). */
html.a11ybr-dyslexia-font body,
html.a11ybr-dyslexia-font body * {
	font-family: Verdana, "Trebuchet MS", "Segoe UI", Tahoma, Arial, sans-serif !important;
	letter-spacing: 0.03em !important;
	word-spacing: 0.1em !important;
	line-height: 1.7 !important;
}

/* Espacamento ampliado. */
html.a11ybr-letter-spacing body,
html.a11ybr-letter-spacing body * {
	letter-spacing: 0.12em !important;
	word-spacing: 0.16em !important;
	line-height: 1.9 !important;
}

/* Destacar links. */
html.a11ybr-highlight-links body a {
	text-decoration: underline !important;
	text-underline-offset: 2px !important;
	outline: 2px solid #2563eb !important;
	outline-offset: 1px !important;
	background: rgba(37, 99, 235, 0.12) !important;
}

/* Foco visivel reforcado. */
html.a11ybr-focus-outline body :focus,
html.a11ybr-focus-outline body :focus-visible {
	outline: 3px solid #d81b60 !important;
	outline-offset: 2px !important;
}

/* Cursor ampliado (SVG embutido). */
html.a11ybr-big-cursor body,
html.a11ybr-big-cursor body * {
	cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48"><path d="M6 4l30 18-13 3 7 15-6 3-7-15-11 8z" fill="black" stroke="white" stroke-width="2"/></svg>') 4 4, auto !important;
}

/* Ler em voz alta: indica que o texto e clicavel. */
html.a11ybr-read-aloud body p,
html.a11ybr-read-aloud body h1,
html.a11ybr-read-aloud body h2,
html.a11ybr-read-aloud body h3,
html.a11ybr-read-aloud body li {
	cursor: pointer;
}

/* =========================================================================
   5. Respeito a preferencia do sistema
   ========================================================================= */
@media (prefers-reduced-motion: reduce) {
	.a11ybr-launcher,
	.a11ybr-skip-link,
	.a11ybr-switch,
	.a11ybr-switch-knob,
	.a11ybr-icon-on,
	.a11ybr-icon-off { transition: none; }
}

/* =========================================================================
   6. Navegacao por face (a11y-face.js)
   ========================================================================= */

/* Cursor desenhado: o JS nao move o cursor do sistema. pointer-events: none
   para que elementFromPoint enxergue o que esta EMBAIXO dele. O ponto quente e
   o centro (translate de -50% via margem). */
.a11ybr-face-cursor {
	position: fixed;
	top: 0;
	left: 0;
	width: 56px;
	height: 56px;
	margin: -28px 0 0 -28px;
	z-index: 2147483647;
	pointer-events: none;
	opacity: 0;
	transition: opacity .2s;
	will-change: transform;
}
.a11ybr-face-cursor.a11ybr-face-on { opacity: 1; }
.a11ybr-face-cursor svg { display: block; width: 100%; height: 100%; overflow: visible; }
.a11ybr-face-cursor-bg { fill: rgba(15, 27, 46, 0.55); stroke: #ffffff; stroke-width: 3; }
.a11ybr-face-cursor-ring {
	fill: none;
	stroke: #ffea00;
	stroke-width: 5;
	stroke-linecap: round;
	transform: rotate(-90deg);
	transform-origin: 28px 28px;
}
.a11ybr-face-cursor-dot { fill: #ffffff; stroke: #1e3a8a; stroke-width: 2; }
.a11ybr-face-cursor.a11ybr-face-calibrating .a11ybr-face-cursor-bg { animation: a11ybr-face-pulse 1s ease-in-out infinite alternate; }
.a11ybr-face-cursor.a11ybr-face-lost { opacity: .35; }
.a11ybr-face-cursor.a11ybr-face-clicked .a11ybr-face-cursor-bg { fill: #ffea00; }
.a11ybr-face-cursor.a11ybr-face-scrolling .a11ybr-face-cursor-bg { fill: rgba(37, 99, 235, 0.8); }
@keyframes a11ybr-face-pulse { from { stroke-width: 3; } to { stroke-width: 8; } }

/* Alvo sob o cursor: contorno forte, sem mexer no layout. */
.a11ybr-face-target {
	outline: 3px solid #ffea00 !important;
	outline-offset: 2px !important;
	box-shadow: 0 0 0 6px rgba(30, 58, 138, 0.85) !important;
}

/* Janela da camera. */
.a11ybr-face-window {
	position: fixed;
	right: 16px;
	bottom: 16px;
	z-index: 2147483645;
	width: 300px;
	max-width: calc(100vw - 32px);
	border-radius: 12px;
	overflow: hidden;
	background: #ffffff;
	color: #0f1b2e;
	box-shadow: 0 10px 30px rgba(9, 25, 52, 0.35);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
	font-size: 14px;
}
.a11ybr-face-window[hidden] { display: none; }
.a11ybr-face-header {
	display: flex;
	align-items: center;
	gap: 4px;
	padding: 6px 6px 6px 10px;
	border-bottom: 1px solid #e7edf6;
}
.a11ybr-face-badge {
	display: inline-flex;
	width: 28px;
	height: 28px;
	padding: 4px;
	border-radius: 6px;
	background: #1e3a8a;
	color: #ffffff;
	box-sizing: border-box;
}
.a11ybr-face-badge svg { width: 100%; height: 100%; }
.a11ybr-face-title {
	flex: 1;
	min-width: 0;
	margin-left: 4px;
	font-weight: 600;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.a11ybr-face-btn,
.a11ybr-face-step {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 8px;
	border: 0;
	border-radius: 8px;
	background: transparent;
	color: #1e3a8a;
	cursor: pointer;
	font: inherit;
	font-size: 20px;
	line-height: 1;
}
.a11ybr-face-btn svg { width: 22px; height: 22px; }
.a11ybr-face-btn:hover,
.a11ybr-face-step:hover { background: #e7edf6; }
.a11ybr-face-btn:focus-visible,
.a11ybr-face-step:focus-visible,
.a11ybr-face-start:focus-visible { outline: 3px solid #2563eb; outline-offset: 2px; }
.a11ybr-face-settings { padding: 6px 10px; border-bottom: 1px solid #e7edf6; }
.a11ybr-face-settings[hidden] { display: none; }
.a11ybr-face-setting { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.a11ybr-face-stepper { display: flex; align-items: center; }
.a11ybr-face-step { background: #e7edf6; }
.a11ybr-face-step-value { min-width: 7.5em; text-align: center; font-variant-numeric: tabular-nums; }
.a11ybr-face-setting-label { flex: 1; min-width: 0; }
.a11ybr-face-cal-start {
	width: 100%;
	margin-top: 6px;
	padding: 8px 10px;
	border: 1px solid #1e3a8a;
	border-radius: 8px;
	background: #1e3a8a;
	color: #ffffff;
	font: inherit;
	font-weight: 700;
	cursor: pointer;
}
.a11ybr-face-cal-start:hover { background: #2747a8; }
.a11ybr-face-cal-start:focus-visible { outline: 3px solid #2563eb; outline-offset: 2px; }
.a11ybr-face-video { position: relative; aspect-ratio: 4 / 3; background: #0f1b2e; }
/* Espelhado: a pessoa se ve como num espelho, que e o que o cerebro espera. */
.a11ybr-face-video video,
.a11ybr-face-video canvas {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transform: scaleX(-1);
}

/* Faixa de estado: no topo, para nao disputar a base com a do assistente de voz. */
.a11ybr-face-status {
	position: fixed;
	top: 16px;
	left: 50%;
	transform: translateX(-50%);
	z-index: 2147483646;
	/* A faixa e so aviso (aria-live), nunca alvo: sem isto ela roubaria o
	   ponteiro numa tira no topo da tela — justo onde costuma estar o menu
	   do site — e o cursor de face nao alcancaria o que esta embaixo. */
	pointer-events: none;
	max-width: min(560px, calc(100vw - 32px));
	padding: 10px 18px;
	border-radius: 999px;
	background: #1e3a8a;
	color: #ffffff;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
	font-size: 15px;
	line-height: 1.3;
	text-align: center;
	box-shadow: 0 6px 20px rgba(9, 25, 52, 0.35);
}
.a11ybr-face-status:empty { display: none; }

/* Explicacao inicial com contagem. */
.a11ybr-face-intro {
	position: fixed;
	inset: 0;
	z-index: 2147483646;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	background: rgba(9, 25, 52, 0.55);
}
.a11ybr-face-intro-box {
	max-width: 620px;
	padding: 32px 40px;
	border-radius: 12px;
	border-bottom: 6px solid #1e3a8a;
	background: #ffffff;
	color: #0f1b2e;
	text-align: center;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
	font-size: 16px;
	line-height: 1.45;
	box-shadow: 0 20px 50px rgba(9, 25, 52, 0.4);
}
.a11ybr-face-intro-icon { width: 56px; height: 56px; margin: 0 auto 8px; color: #1e3a8a; }
.a11ybr-face-intro-icon svg { width: 100%; height: 100%; }
.a11ybr-face-intro h2 { margin: 0 0 12px; font-size: 28px; line-height: 1.2; color: inherit; }
.a11ybr-face-intro p { margin: 0 0 12px; text-align: left; }
.a11ybr-face-intro .a11ybr-face-intro-hint { color: #3a5cc4; font-weight: 600; text-align: center; }
.a11ybr-face-start {
	display: inline-flex;
	align-items: center;
	gap: 16px;
	min-width: 200px;
	justify-content: center;
	margin-top: 8px;
	padding: 14px 28px;
	border: 0;
	border-radius: 8px;
	background: #1e3a8a;
	color: #ffffff;
	font: inherit;
	font-weight: 700;
	cursor: pointer;
}
.a11ybr-face-count { font-variant-numeric: tabular-nums; }

/* Lista de opcoes de <select> (a11y-face-picker.js): botoes grandes no centro
   da tela, onde o cursor de face nasce e e mais facil de mirar. */
.a11ybr-face-picker {
	position: fixed;
	inset: 0;
	z-index: 2147483646;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	background: rgba(9, 25, 52, 0.55);
}
.a11ybr-face-picker-box {
	display: flex;
	flex-direction: column;
	gap: 8px;
	width: min(460px, 100%);
	max-height: 100%;
	padding: 20px;
	border-radius: 12px;
	background: #ffffff;
	color: #0f1b2e;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
	box-shadow: 0 20px 50px rgba(9, 25, 52, 0.4);
	box-sizing: border-box;
}
.a11ybr-face-picker-title { margin: 0 0 4px; font-size: 20px; line-height: 1.3; color: inherit; text-align: center; }
.a11ybr-face-picker-list { display: flex; flex-direction: column; gap: 8px; }
.a11ybr-face-picker-group { margin-top: 4px; font-size: 13px; font-weight: 700; color: #3a5cc4; text-transform: uppercase; }
.a11ybr-face-picker-option,
.a11ybr-face-picker-nav,
.a11ybr-face-picker-close {
	min-height: 56px;
	padding: 10px 16px;
	border: 2px solid #e7edf6;
	border-radius: 10px;
	background: #f4f6fb;
	color: #0f1b2e;
	font: inherit;
	font-size: 18px;
	text-align: left;
	cursor: pointer;
}
.a11ybr-face-picker-option.a11ybr-is-selected { border-color: #1e3a8a; background: #e7edf6; font-weight: 700; }
.a11ybr-face-picker-option.a11ybr-is-selected::after { content: " ✓"; }
.a11ybr-face-picker-option:disabled { opacity: .45; cursor: not-allowed; }
.a11ybr-face-picker-nav { min-height: 44px; font-size: 15px; text-align: center; background: #ffffff; }
.a11ybr-face-picker-nav[hidden] { display: none; }
.a11ybr-face-picker-nav:disabled { opacity: .35; }
.a11ybr-face-picker-close { text-align: center; background: #1e3a8a; border-color: #1e3a8a; color: #ffffff; font-weight: 700; }
.a11ybr-face-picker button:focus-visible { outline: 3px solid #2563eb; outline-offset: 2px; }

/* Calibracao por pontos (a11y-face-calibrate.js): um alvo de cada vez, sobre
   a tela escurecida — durante a medida o conteudo da pagina so atrapalha. */
.a11ybr-face-cal {
	position: fixed;
	inset: 0;
	z-index: 2147483646;
	background: rgba(9, 25, 52, 0.82);
}
.a11ybr-face-cal-dot {
	position: absolute;
	top: 0;
	left: 0;
	width: 80px;
	height: 80px;
	margin: -40px 0 0 -40px;
	/* O alvo desliza ate o proximo canto em vez de saltar: o olhar acompanha,
	   e a cabeca vai junto sem procurar onde ele reapareceu. */
	transition: transform .4s ease;
}
.a11ybr-face-cal-dot svg { display: block; width: 100%; height: 100%; overflow: visible; }
.a11ybr-face-cal-bg { fill: rgba(255, 255, 255, 0.14); stroke: #ffffff; stroke-width: 3; }
.a11ybr-face-cal-ring {
	fill: none;
	stroke: #ffea00;
	stroke-width: 6;
	stroke-linecap: round;
	transform: rotate(-90deg);
	transform-origin: center;
}
.a11ybr-face-cal-center { fill: #ffea00; }
.a11ybr-face-cal-help {
	position: absolute;
	left: 50%;
	bottom: 6%;
	transform: translateX(-50%);
	display: flex;
	flex-direction: column;
	gap: 4px;
	/* Estreita de proposito: assim nunca encosta nos alvos dos cantos. */
	max-width: min(520px, calc(100vw - 200px));
	padding: 14px 22px;
	border-radius: 14px;
	background: #1e3a8a;
	color: #ffffff;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
	font-size: 16px;
	line-height: 1.45;
	text-align: center;
	box-shadow: 0 20px 50px rgba(9, 25, 52, 0.4);
}
.a11ybr-face-cal-title { font-size: 18px; }
.a11ybr-face-cal-count { color: var(--a11ybr-soft); font-variant-numeric: tabular-nums; }

@media (max-width: 600px) {
	.a11ybr-face-window { width: 200px; }
	.a11ybr-face-intro-box { padding: 24px 20px; }
	.a11ybr-face-intro h2 { font-size: 22px; }
}
@media (forced-colors: active) {
	.a11ybr-face-status,
	.a11ybr-face-window,
	.a11ybr-face-intro-box,
	.a11ybr-face-cal-help,
	.a11ybr-face-picker-box { border: 2px solid CanvasText; }
	.a11ybr-face-target { outline-color: Highlight !important; }
}
@media (prefers-reduced-motion: reduce) {
	.a11ybr-face-cursor,
	.a11ybr-face-cal-dot { transition: none; }
	.a11ybr-face-cursor.a11ybr-face-calibrating .a11ybr-face-cursor-bg { animation: none; }
}
