/* PROTEGE-ESCOLA — acessibilidade progressiva, sem modificar o acervo. */
html { font-size: var(--pe-a11y-base, 100%) !important; }
/* Respeita também os controles tipográficos já presentes no site. */
html.large-print { font-size: var(--pe-a11y-large, 118%) !important; }
html.big { font-size: var(--pe-a11y-big, 117%) !important; }
html.big.large-print { font-size: var(--pe-a11y-both, 138%) !important; }

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 3px solid #1254a3 !important;
  outline-offset: 3px !important;
}
.pe-a11y-skip {
  position: fixed; top: 0; left: 0; z-index: 20010;
  display: block; padding: .75rem 1rem; transform: translateY(-180%);
  background: #fff; color: #000; border: 2px solid #000;
}
.pe-a11y-skip:focus, .pe-a11y-skip:focus-visible { transform: translateY(0); }

.pe-a11y-toolbar {
  position: fixed; right: .75rem; bottom: .75rem; z-index: 10020;
  width: max-content; max-width: calc(100vw - 1.5rem);
  color: #1b2938; font-family: system-ui, sans-serif; font-size: 1rem; line-height: 1.5;
}
.pe-a11y-toolbar button {
  min-height: 44px; min-width: 44px; padding: .55rem .75rem;
  font: inherit; font-size: 1rem; font-weight: 600;
  cursor: pointer; background: #f8fafc; color: #10263b;
  border: 2px solid #344054; border-radius: .35rem;
}
.pe-a11y-toolbar button:disabled { opacity: .65; cursor: not-allowed; }
.pe-a11y-trigger { display: block; margin-left: auto; background: #fff !important; color: #10263b !important; box-shadow: 0 4px 12px #0005; }
.pe-a11y-painel {
  width: min(24rem, calc(100vw - 1.5rem)); max-height: min(75vh, 34rem);
  overflow: auto; overscroll-behavior: contain;
  margin: .45rem 0 0; padding: .8rem;
  background: #fff; color: #10263b;
  border: 2px solid #344054; border-radius: .55rem; box-shadow: 0 6px 20px #0005;
}
.pe-a11y-painel[hidden] { display: none !important; }
.pe-a11y-painel h2 { font: 700 1.1rem/1.4 system-ui, sans-serif; margin: 0 0 .65rem; color: inherit; }
.pe-a11y-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .45rem; }
.pe-a11y-grid button { width: 100%; }
.pe-a11y-grid button[aria-pressed="true"] { background: #173d70; color: #fff; }
.pe-a11y-estado { font-size: .9rem; margin: .65rem 0 0; color: inherit; }

/* Contraste aplicado a elementos e variáveis visuais, preservando imagens e textos. */
html.pe-a11y-contraste {
  color-scheme: dark; background: #000 !important;
  --ink: #fff; --deep: #fff; --teal: #ffff66; --muted: #fff;
  --paper: #000; --white: #000; --soft: #000; --line: #fff;
  --gold: #ffff66; --pine: #fff; --sub: #fff; --pale: #000;
}
html.pe-a11y-contraste :is(body, main, header, footer, nav, section, article, aside,
  .card, .panel, .modal, .container, .wrap, .header, .topbar, .hero,
  .app-panel, .case-card, .case-workspace, .record-card, .subhead,
  .pe-choose, .pe-choose-inner, .pwa-install-card, details, summary) {
  background-color: #000 !important; color: #fff !important;
  background-image: none !important; box-shadow: none !important;
}
html.pe-a11y-contraste :is(h1,h2,h3,h4,h5,h6,p,li,dt,dd,small,strong,em,span,label,legend,blockquote,td,th) {
  color: #fff !important; text-shadow: none !important;
}
html.pe-a11y-contraste a:not(.pe-a11y-trigger) { color: #ffff66 !important; text-decoration: underline !important; }
html.pe-a11y-contraste :is(button,input,textarea,select,[role="button"]) {
  color: #fff !important; background: #000 !important; border-color: #fff !important;
}
html.pe-a11y-contraste :is(button,input,textarea,select):focus-visible,
html.pe-a11y-contraste :is(a,summary,[tabindex]):focus-visible {
  outline: 3px solid #ffff66 !important; outline-offset: 3px !important;
}
html.pe-a11y-contraste :is(.pe-a11y-toolbar, .pe-a11y-painel) {
  color: #fff !important; background: #000 !important; border-color: #fff !important;
}
html.pe-a11y-contraste .pe-a11y-trigger { background: #000 !important; color: #fff !important; }
html.pe-a11y-contraste .pe-a11y-skip { color: #ffff66 !important; background: #000 !important; border-color: #fff !important; }

@media (max-width: 400px) { .pe-a11y-grid { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) {
  .pe-a11y-toolbar *, .pe-a11y-toolbar *::before, .pe-a11y-toolbar *::after { transition: none !important; animation: none !important; }
}
/* Refluxo em telas estreitas, inclusive com ampliação elevada: evita larguras
 * mínimas de botões, marcas e cartões sem esconder conteúdo. */
@media (max-width: 680px) {
  .wordmark, .wordmark > span:not(.identity) { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
  .main-grid, .primary-col, .secondary-col, .panel, .side-panel,
  .control-grid, .form-grid { min-width: 0 !important; max-width: 100%; }
  .export-actions button { flex: 1 1 100%; min-width: 0; max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
  .topbar-inner, .topnav { min-width: 0; max-width: 100%; }
  :is(h1,h2,h3,a,p,button) { overflow-wrap: anywhere; }
}
