/* Tópicos de Matemática Elementar I e II. Folha de estilos comum aos dois websites.
   Parte da de Álgebra Linear (mesma paleta, letra e componentes). */

/* Fórmulas como na sebenta: símbolos em Fira Math (só os glifos usados, licença OFL),
   letras e algarismos em Futura Medium, ou Jost onde a Futura não está instalada. */
@font-face {
  font-family: "Fira Math TME";
  src: url(fira-math-tme.woff) format("woff");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0028-0029, U+002B, U+002C, U+002E, U+002F, U+003C-003E, U+005B-005D, U+007B-007D,
    U+00B0, U+00B1, U+00B7, U+00D7, U+00F7, U+0394, U+03A3, U+03B1-03C9, U+2026, U+2032, U+2115,
    U+211A, U+211D, U+2124, U+2192, U+21D2, U+21D4, U+2205, U+2208, U+2209, U+2211, U+2212,
    U+221A, U+221E, U+2227-222A, U+2248, U+2260, U+2264, U+2265, U+2282, U+22C5, U+22EF, U+27FA;
}

/* Layout: página única com cabeçalho fixo. O topo repete a capa da sebenta (filetes,
   título a negrito em azul-mar) e cada secção abre como os slides (título, subtítulo, filete). */
:root {
  /* Paleta dos slides e das animações (determinantes.py) */
  --fundo: #EBF1F4;
  --fundo-2: #E1E9EE;
  --papel: #FFFFFF;
  --tinta: #1A1A1A;
  --tinta-2: #3D4A52;
  --morto: #57646C;
  --mar: #1F4E6B;
  --mar-forte: #163A50;
  --alerta: #9B3B1F;
  --mata: #4A7C59;
  --realce: #D6E6EF;
  --realce-b: #F7DFD4;
  --linha: #D2DDE4;
  --filete: rgb(31 78 107 / 0.4);
  --sobre-cor: #FFFFFF;
  --vidro: rgb(255 255 255 / 0.86);
  --sombra: 0 1px 2px rgb(22 36 46 / 0.06), 0 14px 32px -16px rgb(22 36 46 / 0.32);
  --sombra-leve: 0 1px 2px rgb(22 36 46 / 0.05), 0 6px 18px -10px rgb(22 36 46 / 0.22);
  --fundo-video: #FFFFFF;
  --mata-suave: #E3EFE6;
  --alerta-suave: #F7E3DC;
  --claro: block;
  --escuro: none;

  /* Futura nos materiais; a Jost é a versão livre mais próxima */
  --f-texto: "Jost", Futura, "Futura PT", "Century Gothic", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --f-mat: "Fira Math TME", Futura, "Futura PT", "Jost", "Century Gothic", "Avenir Next", sans-serif;
  --t-0: 0.8125rem;
  --t-1: 0.9375rem;
  --t-2: 1.0625rem;
  --t-3: 1.3125rem;
  --t-4: clamp(1.75rem, 1.2rem + 1.8vw, 2.375rem);
  --t-5: clamp(2.9rem, 1.4rem + 5.6vw, 5.25rem);

  --raio: 10px;
  --largura: 1160px;
  --margem: clamp(16px, 4vw, 40px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --fundo: #0E1920;
    --fundo-2: #0A1319;
    --papel: #1A2A35;
    --tinta: #EFEEE8;
    --tinta-2: #C6CFD3;
    --morto: #93A3AC;
    --mar: #7CC0E2;
    --mar-forte: #A3D4EC;
    --alerta: #EB9070;
    --mata: #7CC79A;
    --realce: #2C5162;
    --realce-b: #6E4032;
    --linha: #283A46;
    --filete: rgb(124 192 226 / 0.4);
    --sobre-cor: #16242E;
    --vidro: rgb(26 42 53 / 0.86);
    --sombra: 0 1px 2px rgb(0 0 0 / 0.35), 0 14px 32px -14px rgb(0 0 0 / 0.7);
    --sombra-leve: 0 1px 2px rgb(0 0 0 / 0.3), 0 8px 20px -10px rgb(0 0 0 / 0.6);
    --fundo-video: #16242E;
    --mata-suave: #1E3529;
    --alerta-suave: #3C2520;
    --claro: none;
    --escuro: block;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --fundo: #0E1920;
  --fundo-2: #0A1319;
  --papel: #1A2A35;
  --tinta: #EFEEE8;
  --tinta-2: #C6CFD3;
  --morto: #93A3AC;
  --mar: #7CC0E2;
  --mar-forte: #A3D4EC;
  --alerta: #EB9070;
  --mata: #7CC79A;
  --realce: #2C5162;
  --realce-b: #6E4032;
  --linha: #283A46;
  --filete: rgb(124 192 226 / 0.4);
  --sobre-cor: #16242E;
  --vidro: rgb(26 42 53 / 0.86);
  --sombra: 0 1px 2px rgb(0 0 0 / 0.35), 0 14px 32px -14px rgb(0 0 0 / 0.7);
  --sombra-leve: 0 1px 2px rgb(0 0 0 / 0.3), 0 8px 20px -10px rgb(0 0 0 / 0.6);
  --fundo-video: #16242E;
  --mata-suave: #1E3529;
  --alerta-suave: #3C2520;
  --claro: none;
  --escuro: block;
  color-scheme: dark;
}

/* ── Base ── */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; -webkit-text-size-adjust: 100%; }
html:has(dialog[open]) { overflow: hidden; }
body {
  margin: 0;
  background: var(--fundo);
  color: var(--tinta);
  font-family: var(--f-texto);
  font-size: var(--t-2);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
main { overflow-x: clip; }
img { max-width: 100%; display: block; }
h1, h2, h3 { margin: 0; line-height: 1.15; font-weight: 700; text-wrap: balance; }
p { margin: 0; }
a { color: var(--mar); text-underline-offset: 3px; }
button, input { font: inherit; color: inherit; }
i.var { font-style: italic; }

.limpo {
  appearance: none; background: none; border: 0; margin: 0; padding: 0;
  font: inherit; color: inherit; text-align: inherit; cursor: pointer;
}
.sr {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.icone {
  width: 1.25em; height: 1.25em; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.75;
  stroke-linecap: round; stroke-linejoin: round;
}
.so-claro { display: var(--claro); }
.so-escuro { display: var(--escuro); }

.contentor { max-width: var(--largura); margin-inline: auto; padding-inline: var(--margem); }

.saltar {
  position: absolute; left: 12px; top: -60px; z-index: 50;
  background: var(--mar); color: var(--sobre-cor); padding: 10px 16px; border-radius: 8px;
  font-weight: 600; text-decoration: none;
}
.saltar:focus { top: 12px; }

/* ── Cabeçalho fixo ── */
.topo {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  background: var(--vidro);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--linha);
}
.topo-in { display: flex; align-items: center; gap: 8px 20px; min-height: 64px; }
.marca {
  display: flex; align-items: center; gap: 10px; flex: none;
  font-weight: 700; font-size: 1.1875rem; color: var(--mar); text-decoration: none;
}
.marca svg { width: 32px; height: 32px; }
.marca-curta { display: none; }
@media (max-width: 1020px) {
  .topo .marca-longa { display: none; }
  .topo .marca-curta { display: inline; }
}
.logo-area { fill: var(--realce); }
.logo-tracos { fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.logo-u { stroke: var(--mar); }
.logo-v { stroke: var(--alerta); }
.nav { display: flex; gap: 2px; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a {
  padding: 7px 13px; border-radius: 999px; white-space: nowrap;
  color: var(--tinta-2); text-decoration: none; font-weight: 500; font-size: var(--t-1);
  transition: background-color 0.15s, color 0.15s;
}
.nav a:hover { color: var(--mar); background: var(--realce); }
.nav a[aria-current="true"] { color: var(--mar); background: var(--realce); }
.icone-botao {
  display: inline-grid; place-items: center; flex: none;
  width: 40px; height: 40px; border-radius: 999px;
  border: 1px solid var(--linha); background: var(--papel); color: var(--tinta-2);
  cursor: pointer; transition: border-color 0.15s, color 0.15s;
}
.icone-botao:hover:not(:disabled) { border-color: var(--mar); color: var(--mar); }
.icone-botao:disabled { opacity: 0.35; cursor: default; }
.icone-botao .icone { width: 20px; height: 20px; }

@media (max-width: 760px) {
  .topo-in { flex-wrap: wrap; padding-block: 8px 0; }
  .topo-in .icone-botao { margin-left: auto; }
  .nav { order: 3; width: 100%; margin-left: 0; padding-bottom: 8px; }
}

/* ── Abertura: a capa ── */
.abertura { padding-block: clamp(36px, 6vw, 76px) clamp(16px, 3vw, 36px); }
.abertura .contentor {
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 68px); align-items: center;
}
@media (max-width: 900px) { .abertura .contentor { grid-template-columns: minmax(0, 1fr); } }
.capa { border-block: 2px solid var(--filete); padding-block: 20px 22px; margin-block: 0 24px; }
.capa h1 { font-size: clamp(2.35rem, 1.1rem + 4.3vw, 4.25rem); color: var(--mar); line-height: 1.02; letter-spacing: -0.012em; }
.capa-sub {
  margin-top: 12px; padding-left: 0.18em;
  font-size: clamp(1.15rem, 0.95rem + 0.8vw, 1.55rem); font-weight: 400; color: var(--tinta-2);
}
.entrada { font-size: 1.1875rem; line-height: 1.55; color: var(--tinta-2); max-width: 40ch; }
.atalhos {
  list-style: none; margin: 28px 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 165px), 1fr)); gap: 10px; max-width: 560px;
}
.atalhos a {
  display: flex; align-items: center; gap: 12px; height: 100%;
  padding: 12px 14px; border: 1px solid var(--linha); border-radius: var(--raio);
  background: var(--papel); color: var(--tinta); text-decoration: none; box-shadow: var(--sombra-leve);
  transition: border-color 0.15s, transform 0.15s;
}
.atalhos a:hover { border-color: var(--mar); transform: translateY(-1px); }
.atalhos .icone { width: 28px; height: 28px; color: var(--mar); stroke-width: 1.6; }
.atalhos strong { display: block; font-weight: 600; line-height: 1.25; }
.atalhos small { display: block; font-size: var(--t-0); color: var(--morto); line-height: 1.35; }

/* ── Figura: transformação linear do plano ── */
.figura { margin: 0; min-width: 0; }
.figura-tela {
  position: relative; width: 100%; max-width: 100%; aspect-ratio: 54 / 46;
  border: 1px solid var(--linha); border-radius: 14px; background: var(--papel); overflow: hidden;
  box-shadow: var(--sombra-leve);
}
.figura canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.figura-pausa { position: absolute; right: 10px; top: 10px; width: 36px; height: 36px; }
.figura-pausa .icone { width: 16px; height: 16px; }
.leitura {
  display: flex; flex-direction: column; align-items: flex-start; gap: 10px;
  padding: 16px 4px 0; font-size: 1.25rem; font-variant-numeric: tabular-nums;
}
/* As duas equações na mesma linha; cada parte é centrada na vertical, e o resultado fica à altura dos sinais de igual */
.equacoes { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 30px; }
.eq { display: flex; align-items: center; gap: 10px; }
.equacoes output { min-width: 3ch; font-weight: 600; color: var(--mata); }
.leitura-nota { font-size: var(--t-1); color: var(--morto); min-height: 1.6em; }
.leitura { min-height: 8.4rem; }
.leitura .resultado { gap: 14px; flex-wrap: wrap; }
.leitura output.classe { min-width: 0; font-size: 0.8em; font-family: var(--f-texto, inherit); }
.leitura .m .c-a, .leitura .m .c-b, .leitura .m .c-v { font-weight: 600; }
/* Escolha da animação: um ponto por animação, no fundo da figura */
.figura canvas { transition: opacity 0.18s ease; }
.figura canvas.a-trocar { opacity: 0; }
.figura-cenas {
  position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%);
  display: flex; gap: 2px; padding: 2px 6px; border-radius: 999px;
  background: var(--vidro); border: 1px solid var(--linha);
}
.figura-cena { position: relative; width: 22px; height: 22px; padding: 0; border: 0; background: none; cursor: pointer; transition: width 0.2s; }
.figura-cena::before {
  content: ""; position: absolute; left: 50%; top: 50%; width: 8px; height: 8px; border-radius: 999px;
  transform: translate(-50%, -50%); background: var(--morto); opacity: 0.5;
  transition: width 0.2s, opacity 0.2s, background-color 0.2s;
}
.figura-cena:hover::before { opacity: 0.85; }
.figura-cena[aria-pressed="true"] { width: 32px; }
.figura-cena[aria-pressed="true"]::before { width: 22px; background: var(--mar); opacity: 1; }
.figura-cena:focus-visible { outline: 2px solid var(--mar); outline-offset: 1px; border-radius: 999px; }

/* ── Secções ── */
.seccao { padding-block: clamp(52px, 7vw, 92px); }
.faixa { background: var(--fundo-2); border-block: 1px solid var(--linha); }
.cabecalho {
  display: flex; align-items: center; gap: 16px;
  padding-bottom: 16px; margin-bottom: clamp(26px, 4vw, 42px);
  border-bottom: 2px solid var(--filete);
}
.cab-icone {
  display: grid; place-items: center; flex: none;
  width: 52px; height: 52px; border-radius: 14px; background: var(--realce); color: var(--mar);
}
.cab-icone .icone { width: 28px; height: 28px; stroke-width: 1.6; }
.cabecalho h2 { font-size: var(--t-4); color: var(--mar); }
.cabecalho p { margin-top: 4px; font-size: var(--t-1); color: var(--morto); }

.rotulo {
  font-size: var(--t-0); font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--morto);
}

/* Botões */
.botao {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: 999px; border: 1.5px solid var(--mar);
  background: var(--papel); color: var(--mar); cursor: pointer;
  font-size: var(--t-1); font-weight: 600; line-height: 1.2; text-decoration: none;
  transition: background-color 0.15s, border-color 0.15s;
}
.botao:hover { background: var(--realce); }
.botao .icone { width: 18px; height: 18px; }
.botao-cheio { background: var(--mar); color: var(--sobre-cor); }
.botao-cheio:hover { background: var(--mar-forte); border-color: var(--mar-forte); }
.botao:disabled { opacity: 0.45; pointer-events: none; }

/* Descarga dos PDF: rótulo e um botão por versão, com amostra da cor de fundo */
.descarregar { display: flex; flex-direction: column; gap: 10px; }
.descarregar-botoes { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; max-width: 400px; }
.descarregar .botao { justify-content: center; }
.amostra {
  width: 13px; height: 13px; border-radius: 3px; flex: none; margin-left: 2px;
  box-shadow: inset 0 0 0 1px rgb(120 135 145 / 0.6);
}
.amostra-claro { background: #FFFFFF; }
.amostra-escuro { background: #16242E; }

/* Indicação de que a capa abre o documento, só ao passar o rato ou com foco */
.abrir-selo {
  position: absolute; left: 50%; top: 50%; z-index: 1; pointer-events: none;
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 18px; border-radius: 999px;
  background: var(--mar); color: var(--sobre-cor); font-size: var(--t-1); font-weight: 600;
  box-shadow: var(--sombra); opacity: 0; transform: translate(-50%, -40%);
  transition: opacity 0.2s, transform 0.2s;
}
.abrir-selo .icone { width: 18px; height: 18px; }
:is(.pilha, .deck-capa):is(:hover, :focus-visible) .abrir-selo { opacity: 1; transform: translate(-50%, -50%); }

/* ── Documentos (sebenta e fichas) ── */
.doc { display: grid; grid-template-columns: minmax(0, 320px) minmax(0, 1fr); gap: clamp(32px, 5vw, 72px); align-items: start; }
@media (max-width: 780px) { .doc { grid-template-columns: minmax(0, 1fr); } }
.doc-lado { display: flex; flex-direction: column; gap: 30px; }
.pilha { position: relative; display: block; width: min(100% - 56px, 250px); aspect-ratio: 560 / 792; margin: 6px 0 4px 6px; }
.pilha img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  border-radius: 3px; border: 1px solid var(--linha); box-shadow: var(--sombra); background: var(--papel);
  transition: transform 0.4s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.pilha .tras { transform: translate(42px, 10px) rotate(5.5deg); }
.pilha .frente { transform: rotate(-1.5deg); }
.pilha:hover .tras, .pilha:focus-visible .tras { transform: translate(52px, 2px) rotate(8deg); }
.pilha:hover .frente, .pilha:focus-visible .frente { transform: translate(-4px, -4px) rotate(-2.5deg); }

/* Índice num painel, para se destacar do fundo */
.doc-painel {
  min-width: 0; padding: 20px 24px 22px; border-radius: 14px;
  background: var(--papel); border: 1px solid var(--linha); box-shadow: var(--sombra-leve);
}
.doc-painel .indice > li:last-child { border-bottom: 0; }
@media (max-width: 520px) { .doc-painel { padding: 14px 14px 16px; } }
.doc-meta { display: flex; flex-wrap: wrap; gap: 4px 20px; margin-bottom: 14px; color: var(--morto); font-size: var(--t-1); }
.doc-meta b { color: var(--tinta); font-weight: 600; }
.doc-nota { margin-top: 18px; font-size: var(--t-1); color: var(--morto); max-width: 62ch; }

.indice { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--linha); }
.indice > li { border-bottom: 1px solid var(--linha); }
.item-linha {
  display: grid; grid-template-columns: 5.2em minmax(0, 1fr) auto 36px;
  align-items: center; gap: 4px 16px; padding: 12px 0;
}
.codigo {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  padding: 4px 8px; border-radius: 6px; background: var(--realce); color: var(--mar);
  font-size: var(--t-0); font-weight: 700; letter-spacing: 0.03em; white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.codigo .icone { width: 15px; height: 15px; stroke-width: 2; }
.item-prep .codigo { background: var(--realce-b); color: var(--alerta); }
.item-abrir { display: block; min-width: 0; padding: 4px 0; }
.item-titulo { display: block; font-weight: 500; line-height: 1.35; }
.item-abrir:hover .item-titulo { color: var(--mar); text-decoration: underline; text-decoration-thickness: 1px; }
.item-extra { display: block; margin-top: 2px; font-size: var(--t-0); color: var(--morto); }
.pag { color: var(--morto); font-size: var(--t-1); font-variant-numeric: tabular-nums; white-space: nowrap; }
.item-mais {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 999px; color: var(--morto);
}
.item-mais:hover { background: var(--realce); color: var(--mar); }
.item-mais .icone { width: 18px; height: 18px; transition: transform 0.2s; }
.item-mais[aria-expanded="true"] .icone { transform: rotate(180deg); }
.sub { list-style: none; margin: 0 0 14px calc(5.2em + 16px); padding: 0; }
.sub button {
  display: flex; justify-content: space-between; gap: 16px; width: 100%;
  padding: 5px 0; font-size: var(--t-1); color: var(--tinta-2); border-bottom: 1px dotted var(--linha);
}
.sub button:hover span:first-child { color: var(--mar); text-decoration: underline; }
.sub .pag { font-size: var(--t-0); }
@media (max-width: 520px) {
  .item-linha { grid-template-columns: auto minmax(0, 1fr) 36px; }
  .item-linha .pag { display: none; }
  .sub { margin-left: 0; }
}

/* ── Slides ── */
.decks { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 40px 36px; }
.deck { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.deck-capa {
  position: relative; display: block; width: 100%; max-width: 100%; aspect-ratio: 16 / 9;
  border-radius: 10px; overflow: hidden; border: 1px solid var(--linha); box-shadow: var(--sombra);
  background: var(--papel);
}
.deck-capa img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s cubic-bezier(0.2, 0.7, 0.2, 1); }
.deck-capa:hover img { transform: scale(1.025); }
.selo {
  position: absolute; right: 10px; bottom: 10px; padding: 3px 10px; border-radius: 999px;
  background: var(--vidro); color: var(--tinta-2); font-size: var(--t-0); font-weight: 500;
  border: 1px solid var(--linha);
}
.deck-corpo { display: flex; flex-direction: column; gap: 12px; }
.deck h3 { font-size: var(--t-3); }

/* ── Vídeos ── */
.serie + .serie { margin-top: 56px; }
.serie-cab { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 18px; margin-bottom: 22px; }
.serie-cab h3 { font-size: var(--t-3); }
.serie-cab p { color: var(--morto); font-size: var(--t-1); }
.videos {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 28px 22px;
}
.video { display: flex; flex-direction: column; gap: 12px; width: 100%; }
.video-poster {
  position: relative; display: block; width: 100%; max-width: 100%; aspect-ratio: 16 / 9;
  border-radius: 8px; overflow: hidden; border: 1px solid var(--linha); background: var(--papel);
  box-shadow: var(--sombra-leve);
}
.video-poster img { width: 100%; height: 100%; object-fit: cover; }
.video-play { position: absolute; left: 8px; bottom: 8px; }
.video-play span {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  background: var(--mar); color: var(--sobre-cor); box-shadow: var(--sombra);
  transition: transform 0.2s;
}
.video-play .icone { width: 14px; height: 14px; margin-left: 2px; fill: currentColor; stroke: none; }
.video:hover .video-play span, .video:focus-visible .video-play span { transform: scale(1.12); }
.video-dur {
  position: absolute; right: 8px; bottom: 8px; padding: 1px 7px; border-radius: 4px;
  background: rgb(10 18 24 / 0.7); color: #FFFFFF; font-size: 12px; font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.video-texto { display: flex; gap: 12px; align-items: flex-start; }
.video-num {
  display: grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 50%;
  border: 1.5px solid var(--mar); color: var(--mar); font-size: var(--t-0); font-weight: 700;
  font-variant-numeric: tabular-nums; margin-top: 1px;
}
.video-titulo { display: block; font-weight: 600; line-height: 1.3; }
.video:hover .video-titulo { color: var(--mar); }
.video-sub { display: block; margin-top: 3px; font-size: var(--t-0); color: var(--morto); line-height: 1.4; }

/* ── Provas modelo ── */
.provas { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); gap: 18px; }
.prova {
  display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 20px; align-items: start;
  padding: 18px; border: 1px solid var(--linha); border-radius: 14px; background: var(--papel); box-shadow: var(--sombra-leve);
}
.prova-capa {
  position: relative; display: block; width: 100%; max-width: 100%; aspect-ratio: 560 / 792;
  border-radius: 3px; overflow: hidden; border: 1px solid var(--linha); box-shadow: var(--sombra-leve);
}
.prova-capa img { width: 100%; height: 100%; object-fit: cover; }
.prova-capa .abrir-selo { gap: 6px; padding: 6px 12px; font-size: var(--t-0); }
.prova-capa .abrir-selo .icone { width: 15px; height: 15px; }
.prova-corpo { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; min-width: 0; }
.prova h3 { font-size: var(--t-3); }
.prova-meta { margin-top: -4px; font-size: var(--t-1); color: var(--morto); }
.prova .descarregar { width: 100%; margin-top: 4px; }

/* Secção ainda sem conteúdo */
.vazio {
  display: flex; align-items: center; gap: 20px; padding: 26px 28px;
  border: 1.5px dashed var(--filete); border-radius: 14px;
}
.vazio-icone {
  display: grid; place-items: center; flex: none; width: 56px; height: 56px; border-radius: 14px;
  background: var(--papel); color: var(--morto); box-shadow: var(--sombra-leve);
}
.vazio-icone .icone { width: 28px; height: 28px; stroke-width: 1.6; }
.vazio-titulo { font-weight: 600; }
.vazio-titulo + p { margin-top: 2px; font-size: var(--t-1); color: var(--morto); }

/* ── Notação matemática (legendas da figura) ── */
.m, .leitura { font-family: var(--f-mat); font-weight: 500; }
.m { font-variant-numeric: tabular-nums; white-space: nowrap; }
.m.mp { white-space: normal; }
.mn { white-space: nowrap; }
.m i { font-style: italic; }
.m sub, .m sup { font-size: 0.72em; line-height: 0; }
.mop { font-style: normal; }
.m .c-a { color: var(--mar); font-weight: 700; }
.m .c-b { color: var(--alerta); font-weight: 700; }
.m .c-v { color: var(--mata); font-weight: 700; }
.m .c-g { color: var(--morto); }
/* Fração empilhada, com o traço à altura do sinal de igual */
.fr {
  display: inline-flex; flex-direction: column; align-items: stretch; text-align: center; vertical-align: middle;
  margin: 0 0.12em; font-size: 0.86em; line-height: 1.12;
}
.fr > span { padding: 0 0.2em; }
.fr > span + span { border-top: 1.5px solid currentColor; padding-top: 0.08em; }
/* Raiz quadrada com o traço por cima do radicando */
.raiz { display: inline-flex; align-items: stretch; }
.raiz-r { border-top: 1.5px solid currentColor; padding: 0.06em 0.1em 0 0.06em; margin-left: -0.04em; }
.m .raiz-i { font-size: 0.62em; line-height: 0; margin-right: -0.42em; position: relative; top: -0.15em; }
.mbarra { text-decoration: overline; text-decoration-thickness: 1.5px; }

/* ── Glossário: lista à esquerda, ficha do termo à direita ── */
.glossario { display: flex; flex-direction: column; gap: 16px; }
.gl-controlos { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.gl-pesquisa { position: relative; display: flex; align-items: center; flex: 1 1 260px; max-width: 400px; }
.gl-pesquisa .icone { position: absolute; left: 14px; width: 18px; height: 18px; color: var(--morto); pointer-events: none; }
.gl-pesquisa input {
  width: 100%; padding: 11px 16px 11px 42px; border-radius: 999px; border: 1.5px solid var(--linha);
  background: var(--papel); color: var(--tinta); font: inherit; font-size: var(--t-1); box-shadow: var(--sombra-leve);
}
.gl-pesquisa input:focus { outline: none; border-color: var(--mar); }
.gl-temas { display: flex; flex-wrap: wrap; gap: 6px; }
.gl-tema {
  padding: 6px 12px; border-radius: 999px; border: 1px solid var(--linha); background: var(--papel);
  font-size: var(--t-0); color: var(--tinta-2); transition: border-color 0.15s;
}
.gl-tema:hover { border-color: var(--mar); }
.gl-tema b { margin-right: 3px; color: var(--mar); font-variant-numeric: tabular-nums; }
.gl-tema[aria-pressed="true"] { background: var(--mar); border-color: var(--mar); color: var(--sobre-cor); }
.gl-tema[aria-pressed="true"] b { color: inherit; }
.gl-corpo { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 20px; align-items: start; }
.gl-lista {
  list-style: none; margin: 0; padding: 8px; max-height: 620px; overflow-y: auto; overscroll-behavior: contain;
  border-radius: 14px; background: var(--papel); border: 1px solid var(--linha); box-shadow: var(--sombra-leve);
}
.gl-letra { padding: 10px 10px 4px; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.12em; color: var(--mar); }
.gl-termo {
  display: flex; justify-content: space-between; align-items: baseline; gap: 10px; width: 100%;
  padding: 6px 10px; border-radius: 8px; font-size: var(--t-1); line-height: 1.35;
}
.gl-termo small { flex: none; font-size: 0.72rem; color: var(--morto); font-variant-numeric: tabular-nums; }
.gl-termo:hover { background: var(--fundo-2); color: var(--mar); }
.gl-termo[aria-pressed="true"] { background: var(--realce); color: var(--mar); font-weight: 600; }
.gl-vazio { padding: 14px 10px; font-size: var(--t-1); color: var(--morto); }
.gl-ficha {
  min-width: 0; min-height: 320px; padding: 24px 28px 26px; scroll-margin-top: 12px;
  border-radius: 14px; background: var(--papel); border: 1px solid var(--linha); box-shadow: var(--sombra-leve);
}
.gl-ficha h3 { margin: 6px 0 4px; font-size: clamp(1.5rem, 1.2rem + 1vw, 1.875rem); color: var(--mar); }
.gl-sin { font-size: var(--t-1); color: var(--morto); }
.gl-sin em { font-style: italic; color: var(--tinta-2); }
.gl-def { margin-top: 12px; max-width: 68ch; font-size: var(--t-2); line-height: 1.65; }
.gl-ex { margin-top: 18px; padding: 14px 16px; border-radius: 12px; background: var(--fundo-2); border: 1px solid var(--linha); }
.gl-ex .rotulo { margin-bottom: 6px; }
.gl-ex > div { line-height: 1.6; }
.gl-ex p { margin: 6px 0; }
/* Contas dos exemplos, uma por linha, com a nota à direita (por baixo, no telemóvel) */
.gl-contas { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 7px 24px; margin: 10px 0 12px 0.6em; }
.gl-cf { min-width: 0; }
.gl-cn { font-size: var(--t-0); color: var(--morto); line-height: 1.45; }
.gl-ex > div > :first-child { margin-top: 0; }
.gl-ex > div > :last-child { margin-bottom: 0; }
@media (max-width: 560px) {
  .gl-contas { grid-template-columns: minmax(0, 1fr); gap: 3px; margin-left: 0; }
  .gl-cn:empty { display: none; }
  .gl-cn { margin: 0 0 6px 1.2em; }
}
/* Fórmula destacada numa definição */
.gl-def .gl-dmat { display: block; margin: 10px 0 10px 1.2em; }
/* Ligações para outros termos, dentro da definição */
.gl-lig { color: var(--mar); text-decoration: underline dotted; text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.gl-lig:hover { text-decoration-style: solid; }
.gl-voltar { display: inline-flex; align-items: center; gap: 4px; margin: -4px 0 10px -4px; padding: 3px 10px 3px 4px; border-radius: 999px; font-size: var(--t-0); font-weight: 600; color: var(--mar); }
.gl-voltar:hover { background: var(--realce); }
.gl-voltar .icone { width: 16px; height: 16px; }
.gl-fig { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 22px; margin: 12px 0 6px; }
.gl-fig.tres { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 12px 14px; max-width: 420px; }
.gl-fig figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.gl-fig svg { display: block; width: 100%; max-width: 120px; height: auto; overflow: visible; }
.gl-fig svg.largo { max-width: 290px; }
.gl-fig svg.medio { max-width: 180px; }
.gl-fig svg.grande { max-width: 260px; }
.gl-fig figcaption { font-size: var(--t-0); color: var(--tinta-2); text-align: center; line-height: 1.35; }
.gl-fig .l-a, .gl-fig .l-b, .gl-fig .l-v, .gl-fig .l-g { fill: none; stroke-width: 2.4; stroke-linecap: round; }
.gl-fig .l-a { stroke: var(--mar); }
.gl-fig .l-b { stroke: var(--alerta); }
.gl-fig .l-v { stroke: var(--mata); }
.gl-fig .l-g { stroke: var(--morto); stroke-width: 1.3; opacity: 0.7; }
.gl-fig .tr { stroke-dasharray: 5 5; }
.gl-fig .fino { stroke-width: 1.4; }
.gl-fig .diag { stroke-width: 2.2; opacity: 0.5; }
.gl-fig .f-a { fill: var(--mar); }
.gl-fig .f-v { fill: var(--mata); }
.gl-fig .f-t { fill: var(--tinta); }
.gl-fig .barra { stroke: var(--tinta); stroke-width: 1.4; }
.gl-fig text { font-family: var(--f-mat); font-weight: 500; font-size: 17px; fill: var(--tinta); text-anchor: middle; dominant-baseline: central; paint-order: stroke; stroke: var(--fundo-2); stroke-width: 7px; stroke-linejoin: round; }
.gl-fig text.g { fill: var(--morto); }
/* Preenchimentos e rótulos coloridos das figuras de TME, e tabelas pequenas nos exemplos */
.gl-fig .f-r { fill: var(--realce); }
.gl-fig .f-rb { fill: var(--realce-b); }
.gl-fig .f-b { fill: var(--alerta); }
.gl-fig .f-p { fill: var(--papel); }
.gl-fig .l-t { fill: none; stroke: var(--tinta); stroke-linecap: round; stroke-linejoin: round; }
.gl-fig .l-t:not(.fino) { stroke-width: 2.4; }
.gl-fig text.a { fill: var(--mar); font-weight: 600; }
.gl-fig text.b { fill: var(--alerta); font-weight: 600; }
.gl-fig text.v { fill: var(--mata); font-weight: 600; }
.gl-tabela { border-collapse: collapse; margin: 4px 0 10px; font-size: var(--t-1); font-variant-numeric: tabular-nums; }
.gl-tabela th, .gl-tabela td { padding: 4px 12px; text-align: center; border-bottom: 1px solid var(--linha); white-space: nowrap; }
.gl-tabela th { font-weight: 600; color: var(--tinta-2); white-space: normal; }
@media (max-width: 520px) {
  .gl-tabela { font-size: var(--t-0); }
  .gl-tabela th, .gl-tabela td { padding: 4px 7px; }
}
.gl-tabela td:first-child, .gl-tabela th:first-child { text-align: left; }
/* Regra de Ruffini: traço vertical depois do número a, traço horizontal antes da última linha */
.gl-ruffini td { border: 0; padding: 3px 12px; text-align: right; }
.gl-ruffini td.vert { border-right: 1.5px solid var(--tinta-2); color: var(--mar); font-weight: 700; }
.gl-ruffini tr.soma td { border-top: 1.5px solid var(--tinta-2); }
.gl-ruffini td.resto { color: var(--alerta); font-weight: 700; box-shadow: inset 1.5px 0 0 var(--tinta-2); }
.gl-rodape { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 16px 24px; margin-top: 22px; }
.gl-nota { font-size: var(--t-0); color: var(--morto); align-self: center; }
.gl-ver { display: flex; flex-direction: column; gap: 6px; }
.gl-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.gl-chip {
  padding: 5px 11px; border-radius: 999px; border: 1px solid var(--linha); background: var(--papel);
  font-size: var(--t-0); color: var(--mar); transition: border-color 0.15s;
}
.gl-chip:hover { border-color: var(--mar); }
@media (max-width: 760px) {
  .gl-corpo { grid-template-columns: minmax(0, 1fr); }
  .gl-lista { max-height: 280px; }
  .gl-ficha { padding: 18px 16px 20px; min-height: 0; }
}

/* ── Animações: cartões com o desenho, a conta, a frase e os controlos ── */
.animacoes { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); gap: 26px; align-items: start; }
.anim {
  display: flex; flex-direction: column; gap: 12px; min-width: 0; padding: 20px 22px 16px; scroll-margin-top: 90px;
  border-radius: 14px; background: var(--papel); border: 1px solid var(--linha); box-shadow: var(--sombra-leve);
}
.anim-cab h3 { font-size: var(--t-3); color: var(--mar); }
.anim-cab p { margin-top: 3px; font-size: var(--t-1); color: var(--morto); }
.anim-palco svg { display: block; width: 100%; height: auto; margin: 0 auto; overflow: visible; }
.anim-leitura { display: flex; flex-direction: column; justify-content: flex-start; gap: 8px; }
.anim-conta { min-height: 2.6em; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; text-align: center; }
.anim-texto { font-size: var(--t-1); line-height: 1.55; color: var(--tinta-2); text-align: center; max-width: 52ch; margin: 0 auto; }
.anim-texto strong { display: block; margin-top: 6px; color: var(--mar); font-weight: 600; }
.anim-controlos { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 8px; padding-top: 12px; border-top: 1px solid var(--linha); }
.anim-controlos .icone-botao { width: 38px; height: 38px; }
.anim-controlos .icone-botao .icone { width: 18px; height: 18px; }
.anim-tocar { background: var(--mar); border-color: var(--mar); color: var(--sobre-cor); }
.anim-tocar:hover:not(:disabled) { background: var(--mar-forte); border-color: var(--mar-forte); color: var(--sobre-cor); }
.anim-pontos { display: flex; gap: 4px; margin-left: 6px; }
.anim-ponto { width: 18px; height: 18px; display: grid; place-items: center; border-radius: 50%; }
.anim-ponto::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--linha); transition: background-color 0.2s, transform 0.2s; }
.anim-ponto.feito::before { background: var(--mar); opacity: 0.45; }
.anim-ponto.atual::before { background: var(--mar); transform: scale(1.3); }
.anim-passo { margin-left: auto; font-size: var(--t-0); color: var(--morto); font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 420px) {
  .anim { padding: 16px 14px 14px; }
  .anim-pontos { display: none; }
}
/* Peças dos desenhos */
.anim-palco text { font-family: var(--f-mat); font-weight: 500; dominant-baseline: auto; stroke: none; }
.anim-conta:empty { display: none; }
.anim-palco .an-rotulo { font-family: var(--f-texto); font-weight: 400; letter-spacing: 0.02em; }
.an-traco { stroke-width: 2; stroke-linecap: round; }
.an-risco { stroke-width: 2.2; stroke-linecap: round; }
.an-s-v { stroke: var(--mata); }
.an-s-t { stroke: var(--tinta); }
.an-realce { fill: var(--realce); }
.an-realce-b { fill: var(--realce-b); }
.an-realce-v { fill: var(--mata-suave); stroke: var(--mata); stroke-width: 1.5; }
.an-c-a { fill: var(--mar); stroke: var(--mar); }
.an-c-b { fill: var(--alerta); stroke: var(--alerta); }
.an-c-v { fill: var(--mata); stroke: var(--mata); }
.an-c-t { fill: var(--tinta); stroke: var(--tinta); }
.an-c-g { fill: var(--morto); stroke: none; }
.an-c-p { fill: var(--papel); stroke: none; font-weight: 700; }
.anim-palco g text { stroke: none; }
.anim-palco g line { stroke-width: 2; }
.an-f-a { fill: var(--mar); fill-opacity: 0.85; }
.an-f-b { fill: var(--alerta); fill-opacity: 0.85; }
.an-f-v { fill: var(--mata); fill-opacity: 0.9; }
.an-peca { stroke: var(--tinta); stroke-width: 1.4; }
.an-contorno { fill: none; stroke: var(--tinta); stroke-width: 2.2; }
.an-div { stroke: var(--tinta); stroke-width: 1.4; }
.an-chave { fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.an-s-a { stroke: var(--mar); }
.an-s-b { stroke: var(--alerta); }

/* ── Programa ── */
.temas {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 440px), 1fr)); gap: 18px;
}
.tema {
  display: grid; grid-template-columns: 60px minmax(0, 1fr); gap: 18px;
  position: relative;
  padding: 22px 22px 22px 18px; border: 1px solid var(--linha); border-radius: 12px; background: var(--papel);
  box-shadow: var(--sombra-leve);
}
.tema:has(.menu[open]) { z-index: 4; }
.picto { width: 60px; height: 60px; fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.picto .fino { stroke-width: 1.75; }
.picto .tenue { opacity: 0.5; }
.picto .p-cheio-mar { fill: var(--mar); stroke: none; }
.picto .p-cheio-alerta { fill: var(--alerta); stroke: none; }
.picto .p-cheio-tinta { fill: var(--tinta-2); stroke: none; }
.picto .p-mar { stroke: var(--mar); }
.picto .p-alerta { stroke: var(--alerta); }
.picto .p-tinta { stroke: var(--tinta-2); }
.picto .p-morto { stroke: var(--morto); }
.picto .p-fundo { fill: var(--realce); }
.picto .p-fundo-b { fill: var(--realce-b); }
.picto .p-ponto { fill: var(--mata); }
.picto .p-mata { stroke: var(--mata); }
.picto .p-papel { fill: var(--papel); }
.tema-corpo { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.tema h3 { font-size: 1.1875rem; }
.tema-resumo { font-size: var(--t-1); color: var(--tinta-2); line-height: 1.5; }
.tema-vazio { margin-top: auto; padding-top: 6px; font-size: var(--t-0); color: var(--morto); }

/* Submenu de materiais: botão sempre no fundo do cartão, painel por cima dos cartões seguintes */
.menu { margin-top: auto; padding-top: 6px; }
.menu > summary { list-style: none; width: fit-content; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-botao { gap: 7px; padding: 7px 12px 7px 14px; font-size: var(--t-0); }
.menu-botao .icone { width: 16px; height: 16px; }
.menu[open] > .menu-botao { background: var(--realce); }
.menu-n {
  display: grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  background: var(--realce); color: var(--mar); font-size: 0.75rem; font-weight: 700; font-variant-numeric: tabular-nums;
}
.menu[open] .menu-n { background: var(--papel); }
.menu-seta { transition: transform 0.2s; }
.menu[open] .menu-seta { transform: rotate(180deg); }
.menu-painel {
  position: absolute; left: 12px; right: 12px; top: calc(100% - 12px); z-index: 5;
  max-height: min(60vh, 440px); overflow-y: auto; padding: 6px 8px 8px;
  border-radius: 12px; background: var(--papel); border: 1px solid var(--linha); box-shadow: var(--sombra);
}
.menu-grupo {
  display: flex; align-items: center; gap: 8px; padding: 10px 10px 4px;
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--morto);
}
.menu-grupo .icone { width: 15px; height: 15px; color: var(--mar); }
.menu-painel ul { list-style: none; margin: 0; padding: 0; }
.menu-item {
  display: flex; align-items: baseline; gap: 10px; width: 100%; padding: 7px 10px; border-radius: 8px;
  color: var(--tinta); text-decoration: none; font-size: var(--t-1); line-height: 1.35;
}
.menu-item:hover { background: var(--realce); color: var(--mar); }
.menu-item b { flex: none; min-width: 4.6em; font-size: var(--t-0); font-weight: 700; color: var(--mar); }

.avaliacao { margin-top: clamp(44px, 6vw, 64px); }
.avaliacao h3 { font-size: var(--t-3); margin-bottom: 18px; }
.datas {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 14px;
}
.data {
  display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 14px; align-items: start;
  padding: 16px; border-radius: 12px; background: var(--papel); border: 1px solid var(--linha); box-shadow: var(--sombra-leve);
}
.data time {
  display: grid; place-items: center; align-content: center; height: 70px;
  border-radius: 10px; background: var(--realce); color: var(--mar); line-height: 1;
}
.data-dia { font-size: 1.65rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.data-mes { margin-top: 5px; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; }
.data-nome { font-weight: 600; line-height: 1.3; }
.data-quando { font-size: var(--t-0); color: var(--morto); margin-top: 2px; }
.data-falta { margin-top: 8px; font-size: var(--t-0); font-weight: 600; color: var(--mata); }
.data.passada { opacity: 0.6; }
.data.passada .data-falta { color: var(--morto); }

/* ── Rodapé ── */
.rodape { border-top: 1px solid var(--linha); padding-block: 36px 52px; color: var(--morto); font-size: var(--t-1); }
.rodape .contentor { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 14px 32px; }
.rodape .marca { font-size: 1.0625rem; }
.rodape p { line-height: 1.5; }
.rodape a { font-weight: 500; }

/* ── Diálogos ── */
dialog { padding: 0; border: 0; color: var(--tinta); background: var(--papel); box-shadow: 0 30px 80px -20px rgb(0 0 0 / 0.5); }
dialog::backdrop { background: rgb(8 16 22 / 0.74); }

.leitor {
  width: min(100vw - 24px, 1080px); height: min(100dvh - 24px, 1400px);
  max-width: none; max-height: none; border-radius: 14px; overflow: hidden;
  flex-direction: column;
}
.leitor[open] { display: flex; }
.barra {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px;
  padding: 10px 12px; border-bottom: 1px solid var(--linha); background: var(--papel);
}
.barra-titulo { flex: 1 1 160px; min-width: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.barra-grupo { display: flex; align-items: center; gap: 6px; }
.leitor-pagina { display: flex; align-items: center; gap: 6px; font-size: var(--t-1); color: var(--morto); font-variant-numeric: tabular-nums; }
.leitor-pagina input {
  width: 3.6em; padding: 6px 4px; text-align: center; border-radius: 8px;
  border: 1px solid var(--linha); background: var(--fundo); color: var(--tinta);
  font-variant-numeric: tabular-nums;
}
.segmentado { display: inline-flex; padding: 3px; border-radius: 999px; border: 1px solid var(--linha); background: var(--fundo); }
.segmentado button {
  padding: 5px 12px; border-radius: 999px; border: 0; background: none; cursor: pointer;
  font-size: var(--t-0); font-weight: 600; color: var(--morto);
}
.segmentado button[aria-pressed="true"] { background: var(--mar); color: var(--sobre-cor); }
.barra .botao { padding: 7px 14px; }
.folhas {
  position: relative; flex: 1; overflow: auto; overscroll-behavior: contain;
  padding: 16px; background: var(--fundo-2);
}
.folhas:focus { outline: none; }
.folha {
  margin: 0 auto 16px; background: var(--papel); box-shadow: var(--sombra);
  border-radius: 2px; overflow: hidden;
}
.folha canvas { display: block; width: 100%; height: 100%; }
.estado {
  position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 14px;
  padding: 24px; text-align: center; color: var(--morto); background: var(--fundo-2);
}
.leitor-corpo { position: relative; flex: 1; display: flex; flex-direction: column; min-height: 0; }
@media (max-width: 640px) {
  .leitor { width: 100vw; height: 100dvh; border-radius: 0; }
  .barra-titulo { flex-basis: calc(100% - 60px); order: -1; }
  .barra [data-fechar] { order: -1; }
  .folhas { padding: 10px; }
}

.cinema { width: min(100vw - 24px, 1120px); max-width: none; max-height: calc(100dvh - 24px); border-radius: 14px; overflow: auto; }
.cinema video { display: block; width: 100%; aspect-ratio: 16 / 9; background: var(--fundo-video); }
.cinema-rodape { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 16px; padding: 16px 16px 18px; }
.cinema-info h3 { font-size: var(--t-3); color: var(--mar); }
.cinema-info p { margin-top: 2px; color: var(--morto); font-size: var(--t-1); }
@media (max-width: 640px) { .cinema { width: 100vw; border-radius: 0; } }

/* ── Foco e movimento ── */
:is(a, button, input, [tabindex]):focus-visible { outline: 2.5px solid var(--mar); outline-offset: 3px; border-radius: 6px; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* ── Novidades ── */
.novo {
  display: inline-block; margin-left: 4px; padding: 1px 8px 2px; border-radius: 999px;
  background: var(--alerta); color: var(--papel); font-family: var(--f-texto); font-size: 0.72rem;
  font-weight: 600; font-style: normal; letter-spacing: 0.02em; line-height: 1.45; text-transform: none;
  vertical-align: 0.15em; white-space: nowrap;
}
h2 .novo { font-size: 0.8rem; vertical-align: 0.5em; }
.nav a.tem-novo { position: relative; }
.nav a.tem-novo::after {
  content: ""; position: absolute; top: 4px; right: 4px; width: 7px; height: 7px;
  border-radius: 50%; background: var(--alerta);
}
.novidades { margin-top: 18px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; }
.novidades .rotulo { margin: 0; color: var(--alerta); }
.novidades ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.novidades a {
  display: inline-block; padding: 3px 11px; border-radius: 999px; border: 1px solid var(--linha);
  background: var(--papel); color: var(--tinta-2); text-decoration: none; font-size: var(--t-0);
}
.novidades a:hover { border-color: var(--alerta); color: var(--alerta); }
