/* ==========================================================================
   Diário dos BNs — Sistema visual "Caderno de Campo"
   Camada carregada por último em todas as páginas. Reaproveita as variáveis
   existentes (--bg, --text, --gold...) para que os estilos antigos herdem a
   nova identidade sem perder nenhuma funcionalidade.
   ========================================================================== */

/* ---------- 1. Tokens ---------- */
:root {
  color-scheme: dark;
  /* noite de laboratório */
  --bg: #0b0f19;
  --bg-soft: #0f1422;
  --surface: #131a2a;
  --surface-2: #182034;
  --panel: #131a2a;
  --text: #ecE8df;
  --muted: #a3a9b8;
  --subtle: #8b92a3;
  --line: rgba(236, 232, 223, .11);
  --line-strong: rgba(236, 232, 223, .22);
  --gold: #e3b65e;
  --gold-bright: #f0cd85;
  --blue: #8aa4ff;
  --accent: #e3b65e;
  --ink-inverse: #0b0f19;
  --grid-line: rgba(138, 164, 255, .07);
  --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 18px 40px -24px rgba(0,0,0,.7);
  --ds-primary: #ece8df;
  --ds-primary-ink: #0b0f19;
  --ds-primary-hover: #ffffff;
  --ds-success: #5cc58d;
  --ds-danger: #ff7a7a;
  --ds-warning: #f0c060;

  --font: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --heading-font: var(--display);
  --mono: 'JetBrains Mono', 'Fira Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;

  --max: 1200px;
  --radius: 10px;
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --t-fast: 140ms;
  --t-med: 260ms;
  --header-h: 68px;

  --action-save-bg: #1f6b45;
  --action-save-hover: #195a3a;
  --action-save-border: #2f8a5d;
  --action-refuse-bg: #a3313c;
  --action-refuse-hover: #872832;
  --action-refuse-border: #c4505b;
}

:root[data-theme="light"] {
  color-scheme: light;
  /* papel de caderno */
  --bg: #f4f1ea;
  --bg-soft: #ece8de;
  --surface: #fffdf8;
  --surface-2: #f8f5ee;
  --panel: #fffdf8;
  --text: #15192a;
  --muted: #545b6d;
  --subtle: #5d6475;
  --line: rgba(21, 25, 42, .12);
  --line-strong: rgba(21, 25, 42, .24);
  --gold: #8f5a0a;
  --gold-bright: #7a4c06;
  --blue: #2b4fd8;
  --accent: #b77712;
  --ink-inverse: #fffdf8;
  --grid-line: rgba(43, 79, 216, .07);
  --shadow: 0 1px 0 rgba(21,25,42,.04), 0 18px 36px -26px rgba(21,25,42,.35);
  --ds-primary: #15192a;
  --ds-primary-ink: #fffdf8;
  --ds-primary-hover: #2b3150;
  --ds-success: #1f7a4c;
  --ds-danger: #b3303c;
  --ds-warning: #8f5a0a;
}

/* ---------- 2. Base ---------- */

html { scroll-padding-top: calc(var(--header-h) + 16px); }
html body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "cv11";
}
html body:before { display: none; }
::selection { background: color-mix(in srgb, var(--accent) 32%, transparent); color: var(--text); }

html body :is(h1, h2, h3) { font-family: var(--display); font-optical-sizing: auto; letter-spacing: -.018em; color: var(--text); }
html body h1 { font-weight: 600; line-height: 1.04; }
html body h2 { font-weight: 560; line-height: 1.1; }
html body h3 { font-weight: 600; line-height: 1.25; letter-spacing: -.01em; }
html body :is(h1, h2) span { color: var(--gold); font-style: italic; font-weight: 480; }

html body .section-wrap { width: min(var(--max), calc(100% - 48px)); }

html body :focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 4px; }

/* Etiquetas técnicas (kickers) com visual de anotação de caderno */
html body :is(.section-kicker, .eyebrow, .account-kicker, .penrose-kicker, .lab-kicker) {
  display: inline-flex; align-items: center; gap: .6em;
  font-family: var(--mono); font-size: .72rem; font-weight: 500;
  letter-spacing: .08em; text-transform: uppercase; color: var(--gold) !important;
}
html body .section-kicker::before, html body .account-kicker::before {
  content: ""; width: 18px; height: 1px; background: currentColor; opacity: .7;
}
html body .eyebrow-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 20%, transparent); animation: ds-pulse 2.4s var(--ease) infinite; }
@keyframes ds-pulse { 50% { box-shadow: 0 0 0 7px color-mix(in srgb, var(--accent) 0%, transparent); } }

/* ---------- 3. Cabeçalho ---------- */
html body .site-header {
  position: sticky; top: 0; z-index: 1000;
  display: flex; align-items: center; gap: 12px;
  min-height: var(--header-h);
  padding: 10px max(24px, calc((100% - var(--max)) / 2));
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--t-med) var(--ease), background var(--t-med) var(--ease), min-height var(--t-med) var(--ease);
}
html body .site-header.is-scrolled { border-bottom-color: var(--line); min-height: 58px; }
html body .site-header .brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-family: var(--display); font-size: 1.12rem; font-weight: 600; letter-spacing: -.01em; margin-right: auto; }
html body .site-header .brand b { color: var(--gold); font-style: italic; font-weight: 600; }
html body .brand-logo { width: 34px; height: 34px; border-radius: 8px; box-shadow: 0 0 0 1px var(--line); transition: transform var(--t-med) var(--ease-out); }
html body .brand:hover .brand-logo { transform: rotate(-6deg) scale(1.05); }

/* Links principais visíveis no desktop (inseridos por ds.js) */
.ds-primary-links { display: none; align-items: center; gap: 2px; margin-right: 6px; }
.ds-primary-links a {
  position: relative; padding: 8px 12px; border-radius: var(--r-sm);
  color: var(--muted); font-size: .92rem; font-weight: 500; text-decoration: none;
  transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.ds-primary-links a:hover { color: var(--text); background: color-mix(in srgb, var(--text) 6%, transparent); }
.ds-primary-links a[aria-current="page"] { color: var(--text); }
.ds-primary-links a[aria-current="page"]::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 2px; height: 2px; border-radius: 2px; background: var(--accent); }
.ds-header-cta {
  display: none; align-items: center; min-height: 38px; padding: 0 16px; margin-right: 4px;
  border-radius: 999px; background: var(--ds-primary); color: var(--ds-primary-ink) !important;
  font-size: .88rem; font-weight: 600; text-decoration: none; white-space: nowrap;
  transition: transform var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.ds-header-cta:hover { background: var(--ds-primary-hover); }
.ds-header-cta:active { transform: scale(.97); }
@media (min-width: 1080px) { .ds-primary-links, .ds-header-cta { display: inline-flex; } }

html body .site-header .menu-toggle {
  display: inline-flex !important; flex: 0 0 auto; flex-direction: row; align-items: center; justify-content: center; gap: 8px;
  width: auto; min-width: 44px; height: 40px; margin-left: 0; padding: 0 12px;
  border: 1px solid var(--line-strong); border-radius: 999px; background: transparent; color: var(--text);
  font: 500 .88rem var(--font); cursor: pointer;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
html body .site-header .menu-toggle::before { content: "Menu"; order: 2; }
html body .site-header .menu-toggle:hover { background: color-mix(in srgb, var(--text) 6%, transparent); }
html body .site-header .menu-toggle span:not(.sr-only) { display: block; width: 14px; height: 1.5px; margin: 0; background: currentColor; border-radius: 2px; transition: transform var(--t-med) var(--ease), opacity var(--t-fast); }
html body .site-header .menu-toggle span:not(.sr-only):nth-of-type(2),
html body .site-header .menu-toggle span:not(.sr-only):nth-of-type(3),
html body .site-header .menu-toggle span:not(.sr-only):nth-of-type(4) { position: absolute; }
html body .site-header .menu-toggle { position: relative; padding-left: 34px; }
html body .site-header .menu-toggle span:not(.sr-only) { position: absolute; left: 13px; }
html body .site-header .menu-toggle span:not(.sr-only):nth-of-type(2) { transform: translateY(-4px); }
html body .site-header .menu-toggle span:not(.sr-only):nth-of-type(3) { transform: translateY(0); }
html body .site-header .menu-toggle span:not(.sr-only):nth-of-type(4) { transform: translateY(4px); width: 9px; }
html body .site-header .menu-toggle[aria-expanded="true"] span:not(.sr-only):nth-of-type(2) { transform: rotate(45deg); }
html body .site-header .menu-toggle[aria-expanded="true"] span:not(.sr-only):nth-of-type(3) { opacity: 0; }
html body .site-header .menu-toggle[aria-expanded="true"] span:not(.sr-only):nth-of-type(4) { transform: rotate(-45deg); width: 14px; }
html body .site-header .menu-toggle[aria-expanded="true"]::before { content: "Fechar"; }
@media (max-width: 520px) { html body .site-header .menu-toggle::before { content: none !important; } html body .site-header .menu-toggle { width: 42px; padding: 0; } html body .site-header .menu-toggle span:not(.sr-only) { left: 14px; } }

html body .theme-toggle {
  display: inline-grid; place-items: center; width: 40px; height: 40px; min-width: 40px; padding: 0;
  border: 1px solid var(--line-strong); border-radius: 999px; background: transparent; color: var(--text);
  cursor: pointer; transition: background var(--t-fast) var(--ease), transform var(--t-med) var(--ease-out);
}
html body .theme-toggle .theme-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
html body .theme-toggle .theme-icon { font-size: 1rem; line-height: 1; color: var(--accent); }
html body .theme-toggle:hover { background: color-mix(in srgb, var(--text) 6%, transparent); transform: rotate(-18deg); }

/* Painel de navegação (desktop) e gaveta (mobile) */
html body .quick-access-panel {
  top: calc(100% + 8px); right: max(16px, calc((100% - var(--max)) / 2));
  width: min(560px, calc(100vw - 32px)); max-height: min(78vh, 620px);
  padding: 10px; border: 1px solid var(--line-strong); border-radius: var(--r-lg);
  background: var(--surface);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  box-shadow: 0 30px 60px -30px rgba(0,0,0,.55), 0 0 0 1px rgba(0,0,0,.02);
  flex-direction: row; flex-wrap: wrap; gap: 2px;
}
html body .quick-access-panel.is-open { display: grid; grid-template-columns: 1fr 1fr; animation: ds-pop var(--t-med) var(--ease-out); }
html body .quick-access-panel a {
  display: flex; align-items: center; justify-content: space-between; min-height: 44px; padding: 10px 14px;
  border: 0; border-radius: var(--r-sm); color: var(--text); font-weight: 500; font-size: .95rem;
  transition: background var(--t-fast) var(--ease), padding var(--t-fast) var(--ease);
}
html body .quick-access-panel a::after { content: "→"; color: var(--gold); opacity: 0; transform: translateX(-4px); transition: opacity var(--t-fast), transform var(--t-fast); }
html body .quick-access-panel a:hover { background: color-mix(in srgb, var(--text) 6%, transparent); }
html body .quick-access-panel a:hover::after { opacity: 1; transform: none; }
@keyframes ds-fade { from { opacity: 0; } }
@keyframes ds-pop { from { opacity: 0; transform: translateY(-6px) scale(.985); } }

@media (max-width: 1450px) {
  html body .site-header .nav {
    top: 100%; left: 0; right: 0; padding: 8px 16px 20px; max-height: calc(100dvh - var(--header-h));
    background: var(--bg); border-bottom: 1px solid var(--line);
    box-shadow: 0 30px 40px -30px rgba(0,0,0,.5);
  }
  html body .site-header .nav.is-open { display: grid !important; grid-template-columns: 1fr; animation: ds-pop var(--t-med) var(--ease-out); }
  html body .site-header .nav > a, html body .site-header .nav .nav-account-links a {
    display: flex; align-items: center; min-height: 50px; padding: 12px 8px; border-bottom: 1px solid var(--line);
    color: var(--text); font-family: var(--display); font-size: 1.22rem; font-weight: 500; text-decoration: none;
  }
}
@media (min-width: 640px) and (max-width: 1450px) {
  html body .site-header .nav.is-open { grid-template-columns: 1fr 1fr; column-gap: 24px; }
}

/* ---------- 4. Botões ---------- */
html body :is(.button, .account-button, .account-link-button, .download-button) {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 44px; padding: 0 20px; border-radius: 999px;
  font-family: var(--font); font-size: .93rem; font-weight: 600; letter-spacing: -.005em; text-decoration: none;
  cursor: pointer; isolation: isolate;
  transition: transform var(--t-fast) var(--ease), background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease), box-shadow var(--t-med) var(--ease);
}
html body :is(.button, .account-button, .account-link-button, .download-button, button):active:not(:disabled) { transform: scale(.975); }
html body :is(.button, .account-button) span[aria-hidden="true"] { display: inline-block; transition: transform var(--t-med) var(--ease-out); }
html body :is(.button, .account-button):hover span[aria-hidden="true"] { transform: translate(2px, -1px); }

html body a.button-primary, html body a.account-button-primary, html body a.account-link-button {
  background: var(--ds-primary) !important; border: 1px solid var(--ds-primary) !important; color: var(--ds-primary-ink) !important;
  box-shadow: 0 10px 24px -14px color-mix(in srgb, var(--ds-primary) 80%, transparent);
}
html body a.button-primary:hover, html body a.account-button-primary:hover, html body a.account-link-button:hover {
  background: var(--ds-primary-hover) !important; border-color: var(--ds-primary-hover) !important; color: var(--ds-primary-ink) !important; filter: none;
}
html body :is(.button-outline, .account-button-light) {
  background: transparent; border: 1px solid var(--line-strong); color: var(--text) !important;
}
html body :is(.button-outline, .account-button-light):hover { background: color-mix(in srgb, var(--text) 6%, transparent); border-color: var(--text); }
html body button.button-primary, html body button.account-button-primary, html body button[type="submit"] { border-radius: 999px; font-weight: 600; }

html body .text-link {
  display: inline-flex; align-items: center; gap: .4em; color: var(--text); font-weight: 600; text-decoration: none;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  padding-bottom: 2px; transition: background-size var(--t-med) var(--ease-out), color var(--t-fast);
}
html body .text-link:hover { background-size: 100% 1px; color: var(--gold); }

/* Estado de envio: o botão mostra um indicador enquanto a mensagem é "is-busy" */
html body form:has(.is-busy) :is(button[type="submit"], .account-button-primary)::after,
html body button[aria-busy="true"]::after {
  content: ""; width: 14px; height: 14px; margin-left: 4px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent; animation: ds-spin .7s linear infinite;
}
@keyframes ds-spin { to { transform: rotate(360deg); } }
html body button:disabled { cursor: not-allowed; opacity: .6; }

/* ---------- 5. Formulários ---------- */
html body :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]), select, textarea) {
  font-family: var(--font); font-size: 1rem; color: var(--text);
  background-color: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease), background var(--t-fast);
}
html body :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]), select, textarea):hover { border-color: color-mix(in srgb, var(--text) 40%, transparent); }
html body :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), select, textarea):focus,
html body :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), select, textarea):focus-visible {
  outline: none; border-color: var(--blue);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--blue) 18%, transparent);
}
html body input::placeholder, html body textarea::placeholder { color: var(--subtle); opacity: .8; }
html body input[type="checkbox"], html body input[type="radio"], html body input[type="range"] { accent-color: var(--blue); }
html body input:user-invalid { border-color: var(--ds-danger); }

/* ---------- 6. Superfícies, cards, tabelas ---------- */
html body :is(.topic-link, .download-item, .lab-card, .download-result, .classes-promo-cards article, .community-count-card, .feature-strip a, .principles article, .live-video-info, .empty-state) {
  border-radius: var(--r-md);
}
html body table { border-collapse: collapse; width: 100%; font-size: .94rem; }
html body th { font-family: var(--mono); font-size: .72rem; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); text-align: left; }
html body :is(th, td) { padding: 12px 14px; border-bottom: 1px solid var(--line); }
html body tbody tr { transition: background var(--t-fast); }
html body tbody tr:hover { background: color-mix(in srgb, var(--text) 3.5%, transparent); }
html body details > summary { cursor: pointer; }
html body code, html body kbd { font-family: var(--mono); font-size: .88em; }

/* Estados vazios */
html body .empty-state {
  display: grid; justify-items: center; gap: 12px; padding: 48px 24px; text-align: center;
  border: 1px dashed var(--line-strong); background: color-mix(in srgb, var(--surface) 60%, transparent);
}
html body .empty-state::before {
  content: ""; width: 56px; height: 56px; opacity: .8;
  background: var(--gold);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='M6 40h36M10 40V10'/%3E%3Cpath d='M10 34c6-1 10-6 14-14s8-11 14-12' stroke-dasharray='2 3.5'/%3E%3Ccircle cx='38' cy='8' r='3'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='M6 40h36M10 40V10'/%3E%3Cpath d='M10 34c6-1 10-6 14-14s8-11 14-12' stroke-dasharray='2 3.5'/%3E%3Ccircle cx='38' cy='8' r='3'/%3E%3C/svg%3E") center / contain no-repeat;
}
html body .empty-state p { margin: 0; color: var(--muted); max-width: 42ch; }

/* ---------- 7. Rodapé ---------- */
html body .site-footer {
  position: relative; margin-top: 64px; padding: 56px max(24px, calc((100% - var(--max)) / 2)) 28px;
  background: var(--bg-soft); border-top: 1px solid var(--line);
}
html body .site-footer::before {
  content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 10px; pointer-events: none;
  background: repeating-linear-gradient(90deg, var(--line-strong) 0 1px, transparent 1px 12px);
  -webkit-mask: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent); mask: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent);
}
html body .site-footer a { color: var(--text); }
html body .site-footer .footer-bottom { font-size: .84rem; color: var(--muted); }
html body .footer-contact h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
html body .footer-contact-link { font-family: var(--display); font-size: clamp(1.1rem, 2.2vw, 1.5rem); font-style: italic; color: var(--gold) !important; text-decoration-thickness: 1px; text-underline-offset: 5px; }

/* ---------- 8. Widget flutuante de acessibilidade ---------- */
html body .a11y-launcher {
  border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text);
  box-shadow: 0 14px 30px -16px rgba(0,0,0,.6); font-family: var(--font); font-weight: 600;
  transition: transform var(--t-fast) var(--ease), background var(--t-fast);
}
html body .a11y-launcher:hover, html body .a11y-launcher:focus-visible { background: var(--ds-primary); color: var(--ds-primary-ink); outline-offset: 3px; }
@media (max-width: 720px) {
  html body .a11y-launcher { min-height: 46px; width: 46px; padding: 0; font-size: 0; display: grid; place-items: center; }
  html body .a11y-launcher span { margin: 0; font-size: 18px; }
}

/* ---------- 9. Barra de progresso, toasts e revelação ---------- */
.ds-progress {
  position: fixed; inset: 0 0 auto 0; z-index: 10020; height: 2px; pointer-events: none;
  background: linear-gradient(90deg, var(--blue), var(--accent));
  transform-origin: 0 50%; transform: scaleX(var(--ds-progress, 0));
}
.ds-progress.is-loading { animation: ds-load 1.6s var(--ease-out) forwards; }
@keyframes ds-load { from { transform: scaleX(.05); } to { transform: scaleX(.85); } }

.ds-toasts {
  position: fixed; z-index: 10030; left: 50%; bottom: max(20px, env(safe-area-inset-bottom));
  display: grid; gap: 8px; width: min(420px, calc(100vw - 32px)); transform: translateX(-50%); pointer-events: none;
}
.ds-toast {
  display: grid; grid-template-columns: auto 1fr auto; align-items: start; gap: 12px;
  padding: 14px 14px 14px 16px; border: 1px solid var(--line-strong); border-radius: 12px;
  background: var(--surface); color: var(--text); box-shadow: 0 24px 50px -24px rgba(0,0,0,.6);
  font-size: .93rem; line-height: 1.45; pointer-events: auto;
  animation: ds-toast-in 320ms var(--ease-out) both;
}
.ds-toast.is-leaving { animation: ds-toast-out 220ms var(--ease) both; }
.ds-toast-icon { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; font-size: 12px; font-weight: 700; color: var(--ds-primary-ink); background: var(--blue); }
.ds-toast[data-kind="success"] .ds-toast-icon { background: var(--ds-success); }
.ds-toast[data-kind="error"] .ds-toast-icon { background: var(--ds-danger); }
.ds-toast[data-kind="error"] { border-color: color-mix(in srgb, var(--ds-danger) 50%, var(--line-strong)); }
.ds-toast button { all: unset; cursor: pointer; padding: 0 4px; color: var(--muted); font-size: 18px; line-height: 1; }
.ds-toast button:hover { color: var(--text); }
@keyframes ds-toast-in { from { opacity: 0; transform: translateY(12px) scale(.97); } }
@keyframes ds-toast-out { to { opacity: 0; transform: translateY(8px) scale(.98); } }

html.ds-js .ds-reveal { opacity: 0; transform: translateY(18px); transition: opacity 700ms var(--ease-out), transform 700ms var(--ease-out); transition-delay: var(--ds-delay, 0ms); }
html.ds-js .ds-reveal.is-visible { opacity: 1; transform: none; }

/* Mensagens de status com marcador visual */
html body :is(.account-message, .auth-message, [data-status]):is(.is-error, .is-success, .is-busy):not(:empty) {
  display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: var(--r-sm);
  border: 1px solid currentColor; background: color-mix(in srgb, currentColor 8%, transparent); font-size: .92rem;
}
html body .account-message.is-error { color: var(--ds-danger) !important; }
html body .account-message.is-success { color: var(--ds-success) !important; }
html body .account-message.is-busy { color: var(--muted) !important; border-style: dashed; }

/* ---------- 10. Movimento reduzido e modos de acessibilidade ---------- */
@media (prefers-reduced-motion: reduce) {
  html.ds-js .ds-reveal { opacity: 1; transform: none; transition: none; }
  .ds-progress.is-loading, .eyebrow-dot { animation: none; }
}
html:has(body.a11y-motion-reduced, body.a11y-motion-minimal, body.a11y-stimulation-minimal) .ds-reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
body.a11y-high-contrast .site-header { background: #000; }
body.a11y-high-contrast :is(h1, h2) span { color: var(--gold); }
body.a11y-stimulation-minimal .ds-hero-figure canvas, body.a11y-stimulation-minimal .ds-grid-bg { opacity: .35; }

/* ==========================================================================
   PÁGINAS
   ========================================================================== */

/* ---------- Página inicial ---------- */
.ds-grid-bg {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px),
    linear-gradient(color-mix(in srgb, var(--grid-line) 50%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--grid-line) 50%, transparent) 1px, transparent 1px);
  background-size: 96px 96px, 96px 96px, 24px 24px, 24px 24px;
  background-position: -1px -1px;
  -webkit-mask: radial-gradient(ellipse 80% 70% at 60% 40%, #000 30%, transparent 78%);
          mask: radial-gradient(ellipse 80% 70% at 60% 40%, #000 30%, transparent 78%);
}

html body .ds-hero {
  position: relative; isolation: isolate;
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); align-items: center; gap: clamp(32px, 5vw, 72px);
  min-height: min(calc(100svh - var(--header-h)), 820px);
  padding-block: clamp(40px, 7vw, 96px) clamp(48px, 6vw, 80px);
}
.ds-hero-copy { position: relative; z-index: 1; }
html body .ds-hero h1 {
  margin: 22px 0 22px; font-size: clamp(2.7rem, 6.2vw, 5.4rem); font-weight: 560; letter-spacing: -.035em; line-height: .98;
}
html body .ds-hero h1 em { font-style: italic; font-weight: 420; color: var(--gold); }
.ds-hero-lede { max-width: 50ch; margin: 0 0 30px; color: var(--muted); font-size: clamp(1.02rem, 1.4vw, 1.14rem); line-height: 1.65; }
.ds-hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 14px; }
.ds-hero-actions .button { min-height: 50px; padding: 0 24px; font-size: .98rem; }

.ds-hero-meta { display: flex; flex-wrap: wrap; gap: 0; margin: 40px 0 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.ds-hero-meta li { flex: 1 1 0; min-width: 110px; padding: 16px 18px 0 0; }
.ds-hero-meta li + li { padding-left: 18px; border-left: 1px solid var(--line); }
.ds-hero-meta strong { display: block; font-family: var(--display); font-size: clamp(1.7rem, 3vw, 2.3rem); font-weight: 500; line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.ds-hero-meta span { display: block; margin-top: 6px; font-family: var(--mono); font-size: .7rem; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.ds-hero-meta .community-counts-status { flex-basis: 100%; margin: 10px 0 0; padding: 0; font-size: .78rem; color: var(--subtle); border: 0; }
.ds-hero-meta .community-counts-status:empty { display: none; }

/* Figura interativa */
.ds-hero-figure { position: relative; margin: 0; }
.ds-figure-frame {
  position: relative; border: 1px solid var(--line-strong); border-radius: var(--r-lg);
  background: color-mix(in srgb, var(--surface) 75%, transparent); overflow: hidden;
  box-shadow: var(--shadow);
}
.ds-figure-frame canvas { aspect-ratio: 16 / 11; height: auto !important; display: block; width: 100%; height: 100%; cursor: crosshair; touch-action: none; }
.ds-figure-label { position: absolute; top: 14px; left: 16px; font-family: var(--mono); font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: var(--gold); pointer-events: none; }
.ds-figure-hint { position: absolute; top: 14px; right: 16px; font-family: var(--mono); font-size: .7rem; color: var(--muted); pointer-events: none; transition: opacity var(--t-med); }
.ds-figure-readout {
  position: static; margin: 10px 0 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; background: var(--line); pointer-events: none;
}
.ds-figure-readout div { padding: 8px 12px; background: var(--surface); }
.ds-figure-readout dt { font-family: var(--mono); font-size: .64rem; letter-spacing: .06em; color: var(--muted); }
.ds-figure-readout dd { margin: 2px 0 0; font-family: var(--mono); font-size: .9rem; font-weight: 500; font-variant-numeric: tabular-nums; color: var(--text); }
.ds-figure-caption { display: flex; justify-content: space-between; gap: 16px; margin-top: 12px; font-size: .84rem; color: var(--muted); }
.ds-figure-caption a { color: var(--text); font-weight: 600; white-space: nowrap; }
.ds-figure-controls { display: flex; gap: 8px; margin-top: 12px; }
.ds-figure-controls button {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: transparent; color: var(--text); font: 500 .85rem var(--font); cursor: pointer;
}
.ds-figure-controls button:hover { background: color-mix(in srgb, var(--text) 6%, transparent); }

/* Seções da home */
.ds-section { position: relative; padding-block: clamp(64px, 9vw, 120px); }
.ds-section + .ds-section { border-top: 1px solid var(--line); }
.ds-section-head { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); align-items: end; gap: 24px 48px; margin-bottom: clamp(32px, 4vw, 52px); }
html body .ds-section-head h2 { margin: 14px 0 0; font-size: clamp(2rem, 4.2vw, 3.4rem); letter-spacing: -.03em; }
.ds-section-head p { margin: 0; color: var(--muted); max-width: 46ch; }
.ds-index { font-family: var(--mono); font-size: .72rem; color: var(--subtle); letter-spacing: .06em; }

/* Bento de caminhos */
.ds-paths { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; }
.ds-path {
  position: relative; grid-column: span 2; display: flex; flex-direction: column; min-height: 230px; padding: 22px;
  border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); color: var(--text); text-decoration: none; overflow: hidden;
  transition: border-color var(--t-med) var(--ease), transform var(--t-med) var(--ease-out), box-shadow var(--t-med) var(--ease);
}
.ds-path:hover { border-color: var(--line-strong); transform: translateY(-3px); box-shadow: var(--shadow); }
.ds-path--wide { grid-column: span 3; }
.ds-path--feature { grid-column: span 4; grid-row: span 2; min-height: 474px; background: var(--ds-primary); color: var(--ds-primary-ink); border-color: transparent; }
.ds-path--feature .ds-path-meta, .ds-path--feature p { color: color-mix(in srgb, var(--ds-primary-ink) 70%, transparent); }
.ds-path-meta { display: flex; justify-content: space-between; font-family: var(--mono); font-size: .7rem; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
html body .ds-path h3 { margin: auto 0 8px; font-size: clamp(1.35rem, 2vw, 1.7rem); color: inherit; }
.ds-path--feature h3 { font-size: clamp(2rem, 3.6vw, 3rem) !important; letter-spacing: -.03em; }
.ds-path p { margin: 0; color: var(--muted); font-size: .94rem; max-width: 40ch; }
.ds-path-icon { width: 44px; height: 44px; margin-top: 18px; color: var(--gold); }
.ds-path--feature .ds-path-icon { color: var(--accent); }
.ds-path-go { position: absolute; right: 20px; bottom: 20px; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; border: 1px solid currentColor; opacity: .35; transition: opacity var(--t-med), transform var(--t-med) var(--ease-out); }
.ds-path:hover .ds-path-go { opacity: 1; transform: rotate(-45deg); }
.ds-path-art { position: absolute; right: -10px; top: 40px; width: 62%; height: auto; opacity: .9; pointer-events: none; }
.ds-path-art path, .ds-path-art circle, .ds-path-art line { vector-effect: non-scaling-stroke; }
.ds-path:hover .ds-orbit { animation-duration: 6s; }
.ds-orbit { transform-origin: 200px 150px; animation: ds-orbit 14s linear infinite; }
@keyframes ds-orbit { to { transform: rotate(360deg); } }

/* Passo a passo (antes: princípios repetidos) */
.ds-steps { display: grid; grid-template-columns: repeat(5, 1fr); margin: 0; padding: 0; list-style: none; counter-reset: s; border-top: 1px solid var(--line-strong); }
.ds-steps li { position: relative; padding: 22px 18px 0 0; counter-increment: s; }
.ds-steps li::before { content: ""; position: absolute; top: -5px; left: 0; width: 9px; height: 9px; border-radius: 50%; background: var(--bg); border: 1.5px solid var(--gold); transition: background var(--t-med); }
.ds-steps li:hover::before { background: var(--gold); }
.ds-steps b { display: block; font-family: var(--display); font-size: 1.2rem; font-weight: 600; }
.ds-steps small { display: block; margin-top: 4px; color: var(--muted); font-size: .9rem; }
.ds-steps span { display: block; margin-bottom: 10px; font-family: var(--mono); font-size: .7rem; color: var(--subtle); }

/* Intro editorial */
.ds-intro { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px 64px; align-items: start; }
.ds-intro p { color: var(--muted); font-size: 1.05rem; }
.ds-intro p strong { color: var(--text); }
.ds-pull { font-family: var(--display); font-size: clamp(1.5rem, 2.6vw, 2.1rem); line-height: 1.25; letter-spacing: -.015em; margin: 0; }
.ds-pull em { color: var(--gold); }
.ds-tag-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; padding: 0; list-style: none; }
.ds-tag-row li { padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: .84rem; color: var(--muted); }

/* Área de animações protegida (gate) */
html body #animation-access-gate {
  margin-block: 0; padding: clamp(24px, 4vw, 40px); border: 1px solid var(--line-strong); border-radius: var(--r-lg);
  background: var(--surface); box-shadow: none; position: relative; overflow: hidden;
}
html body #animation-access-gate::after {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image: linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 24px 24px; -webkit-mask: linear-gradient(90deg, transparent 40%, #000); mask: linear-gradient(90deg, transparent 40%, #000);
}
html body #animation-access-gate > * { position: relative; z-index: 1; }
html body #animation-access-gate h2 { color: var(--text) !important; font-size: clamp(1.6rem, 3vw, 2.3rem); }
html body #animation-access-gate p { color: var(--muted) !important; }
html body #animation-access-gate .text-link { margin-top: 10px; font-size: .9rem; }
html body .ds-gate-wrap { padding-block: 0; }

/* Comunidade / contadores herdados (outras páginas) */
html body .community-count-card { background: var(--surface); border: 1px solid var(--line); }
html body .community-count-card strong { font-family: var(--display); font-weight: 500; color: var(--text); }

/* Penrose */
html body .penrose-feature { padding-block: clamp(64px, 9vw, 120px); }
html body .penrose-feature h2 { font-size: clamp(2.2rem, 5vw, 4rem); letter-spacing: -.03em; }
html body .penrose-film-frame { border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--line-strong); }
html body .penrose-steps li { border-color: var(--line); }

/* Biblioteca de tópicos */
html body .topic-search input { min-height: 52px; padding: 0 16px 0 44px; border-radius: 999px; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%23888' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='8' cy='8' r='6'/%3E%3Cpath d='m13 13 4 4'/%3E%3C/svg%3E") 16px 50% no-repeat; }
html body .topic-group { border-color: var(--line); }
html body .topic-group-heading h3 { font-size: 1.3rem; }
html body .topic-group-heading span { font-family: var(--mono); font-size: .72rem; color: var(--muted); }
html body .topic-link {
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  transition: border-color var(--t-fast), transform var(--t-med) var(--ease-out), background var(--t-fast);
}
html body .topic-link:hover { border-color: var(--gold); transform: translateY(-2px); }
html body .topic-link-mode { font-family: var(--mono); font-size: .68rem; }

/* Downloads */
html body .download-item {
  border: 1px solid var(--line); background: var(--surface);
  transition: border-color var(--t-fast), transform var(--t-med) var(--ease-out);
}
html body .download-item:hover { border-color: var(--line-strong); transform: translateY(-2px); }
html body .download-symbol { font-family: var(--display); color: var(--gold); }
html body .download-button { min-height: 40px; padding: 0 16px; background: transparent; border: 1px solid var(--line-strong); color: var(--text) !important; }
html body .download-button:hover { background: var(--ds-primary); border-color: var(--ds-primary); color: var(--ds-primary-ink) !important; }
html body .file-size { font-family: var(--mono); font-size: .68rem; color: var(--muted); }

/* Faixa de áreas sem célula vazia quando o link de professor está oculto */
html body .feature-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
html body .feature-strip > a[hidden] { display: none !important; }

/* ---------- Laboratório (catálogo) ---------- */
html body .lab-card {
  display: flex; flex-direction: column; border: 1px solid var(--line); background: var(--surface); overflow: hidden;
  transition: border-color var(--t-med), transform var(--t-med) var(--ease-out), box-shadow var(--t-med);
}
html body .lab-card:hover { border-color: var(--line-strong); transform: translateY(-4px); box-shadow: var(--shadow); }
html body .lab-card-art { background: var(--bg-soft); border-bottom: 1px solid var(--line); }
html body .lab-card-art svg { transition: transform 600ms var(--ease-out); }
html body .lab-card:hover .lab-card-art svg { transform: scale(1.06); }
html body .lab-card-title { font-family: var(--display); }
html body .lab-card-meta { font-family: var(--mono); font-size: .7rem !important; letter-spacing: .02em; }
html body .lab-card-cta { margin-top: auto; padding: 0 16px 16px !important; color: var(--text) !important; font-weight: 600; }
html body .lab-card:hover .lab-card-cta { color: var(--gold) !important; }

/* ---------- Contas: login, cadastro, recuperação ---------- */
html body .account-page { width: min(100% - 32px, 1100px); margin: clamp(24px, 5vw, 56px) auto 80px; }
html body .account-panel {
  position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow); padding: clamp(24px, 4vw, 44px);
}
html body .account-panel h1 { font-size: clamp(2.1rem, 4vw, 3rem); letter-spacing: -.03em; }
html body .account-panel :is(p, small) { color: var(--muted); }
html body .account-form label { color: var(--text); font-weight: 600; font-size: .92rem; }
html body .account-form :is(input, select, textarea) { background: var(--bg); border: 1px solid var(--line-strong); color: var(--text); min-height: 48px; border-radius: var(--r-sm); }
html body .account-form :is(input, select, textarea):focus { outline: none; }
html body .account-password-control { display: flex; gap: 8px; align-items: stretch; }
html body .account-password-control input { flex: 1; }
html body .account-password-toggle { flex: 0 0 auto; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: transparent; color: var(--muted); font: 500 .85rem var(--font); cursor: pointer; }
html body .account-password-toggle:hover { color: var(--text); background: color-mix(in srgb, var(--text) 5%, transparent); }
html body .account-form button[type="submit"] { min-height: 50px; margin-top: 6px; font-size: 1rem; }
html body .account-actions a { color: var(--text); font-weight: 500; font-size: .92rem; text-underline-offset: 4px; text-decoration-color: var(--line-strong); }
html body .account-actions a:hover { color: var(--gold); text-decoration-color: currentColor; }

/* Layout em duas colunas com figura de caderno — apenas telas de acesso */
@media (min-width: 960px) {
  html body:is([data-account-page="login"], [data-account-page="signup"], [data-account-page="recovery"], [data-account-page="callback"]) .account-page {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .9fr); gap: 0;
    border: 1px solid var(--line); border-radius: 20px; overflow: hidden; background: var(--surface); box-shadow: var(--shadow);
  }
  html body:is([data-account-page="login"], [data-account-page="signup"], [data-account-page="recovery"], [data-account-page="callback"]) .account-panel {
    border: 0; border-radius: 0; box-shadow: none; padding: clamp(36px, 5vw, 64px);
  }
  html body:is([data-account-page="login"], [data-account-page="signup"], [data-account-page="recovery"], [data-account-page="callback"]) .account-page::after {
    content: "fig. — trajetória de um projétil\A y(x) = x·tanθ − g·x² / (2v₀²cos²θ)";
    white-space: pre; display: flex; align-items: flex-end; padding: 36px;
    font-family: var(--mono); font-size: .74rem; line-height: 1.8; letter-spacing: .02em; color: var(--muted);
    border-left: 1px solid var(--line);
    background:
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 400' fill='none'%3E%3Cpath d='M40 330 C 120 80, 260 60, 360 330' stroke='%23c08a2a' stroke-width='2' stroke-dasharray='3 7' stroke-linecap='round'/%3E%3Cpath d='M30 330h350M40 340V40' stroke='%23888' stroke-opacity='.5'/%3E%3Ccircle cx='200' cy='136' r='9' fill='%23c08a2a'/%3E%3Cpath d='M200 136h60' stroke='%235b7bf0' stroke-width='2'/%3E%3Cpath d='m254 131 8 5-8 5' stroke='%235b7bf0' stroke-width='2'/%3E%3Cpath d='M40 330l46-74' stroke='%235b7bf0' stroke-width='2'/%3E%3Cpath d='M70 330a30 30 0 0 0-12-24' stroke='%23888'/%3E%3Ctext x='76' y='318' fill='%23888' font-family='monospace' font-size='13'%3E%CE%B8%3C/text%3E%3Ctext x='266' y='128' fill='%235b7bf0' font-family='monospace' font-size='13'%3Ev%E2%82%93%3C/text%3E%3C/svg%3E") center 42% / 78% no-repeat,
      linear-gradient(var(--grid-line) 1px, transparent 1px) 0 0 / 24px 24px,
      linear-gradient(90deg, var(--grid-line) 1px, transparent 1px) 0 0 / 24px 24px,
      var(--bg-soft);
  }
}
html body:is([data-account-page="login"], [data-account-page="recovery"], [data-account-page="callback"]) .account-panel { max-width: none; }

/* Áreas logadas (turmas, minha área, painéis) */
html body:is([data-account-page="workspace"], [data-account-page="classes"], [data-account-page="classroom"]) .account-page { width: min(100% - 32px, var(--max)); }
html body .account-panel + .account-panel { margin-top: 18px; }

/* ---------- Páginas de conteúdo genéricas ---------- */
html body main > section:first-child h1 { letter-spacing: -.03em; }
html body .breadcrumb, html body nav[aria-label*="trilha" i], html body nav[aria-label*="Breadcrumb" i] { font-family: var(--mono); font-size: .74rem; letter-spacing: .02em; }

/* ---------- Responsivo ---------- */
@media (max-width: 960px) {
  html body .ds-hero { grid-template-columns: 1fr; min-height: 0; padding-top: 32px; }
  .ds-hero-figure { order: 2; }
  .ds-section-head, .ds-intro { grid-template-columns: 1fr; }
  .ds-paths { grid-template-columns: repeat(2, 1fr); }
  .ds-path, .ds-path--wide { grid-column: span 1; }
  .ds-path--feature { grid-column: span 2; grid-row: auto; min-height: 340px; }
  .ds-steps { grid-template-columns: 1fr; border-top: 0; border-left: 1px solid var(--line-strong); }
  .ds-steps li { padding: 0 0 22px 24px; }
  .ds-steps li::before { top: 6px; left: -5px; }
}
@media (max-width: 560px) {
  html body .section-wrap { width: calc(100% - 32px); }
  html body .site-header { padding-inline: 16px; }
  html body .ds-hero h1 { font-size: clamp(2.4rem, 11vw, 3rem); }
  .ds-hero-actions .button { flex: 1 1 100%; }
  .ds-paths { grid-template-columns: 1fr; }
  .ds-path, .ds-path--wide, .ds-path--feature { grid-column: auto; min-height: 200px; }
  .ds-path--feature { min-height: 300px; }
  .ds-figure-readout { grid-template-columns: repeat(2, 1fr); }
  .ds-figure-caption { flex-direction: column; gap: 6px; }
  .ds-hero-meta li { min-width: 0; padding-right: 10px; }
  .ds-hero-meta li + li { padding-left: 12px; }
  html body .quick-access-panel.is-open { grid-template-columns: 1fr; }
}

/* Fechamento da home */
.ds-closing-inner {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 28px 48px;
  padding: clamp(28px, 5vw, 56px); border-radius: 20px; background: var(--ds-primary); color: var(--ds-primary-ink);
  position: relative; overflow: hidden;
}
.ds-closing-inner::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: linear-gradient(color-mix(in srgb, var(--ds-primary-ink) 9%, transparent) 1px, transparent 1px), linear-gradient(90deg, color-mix(in srgb, var(--ds-primary-ink) 9%, transparent) 1px, transparent 1px);
  background-size: 28px 28px; -webkit-mask: linear-gradient(110deg, transparent 45%, #000); mask: linear-gradient(110deg, transparent 45%, #000);
}
.ds-closing-inner > * { position: relative; z-index: 1; }
html body .ds-closing-inner h2 { margin: 14px 0 10px; color: var(--ds-primary-ink); font-size: clamp(2rem, 4vw, 3.2rem); letter-spacing: -.03em; }
html body .ds-closing-inner h2 span { color: var(--accent); }
html body .ds-closing-inner .section-kicker { color: var(--accent) !important; }
.ds-closing-inner p { margin: 0; color: color-mix(in srgb, var(--ds-primary-ink) 72%, transparent); }
html body .ds-closing-inner .button-primary { background: var(--ds-primary-ink) !important; border-color: var(--ds-primary-ink) !important; color: var(--ds-primary) !important; box-shadow: none; }
html body .ds-closing-inner .button-primary:hover { background: var(--accent) !important; border-color: var(--accent) !important; color: #15192a !important; }
html body .ds-closing-inner .button-outline { border-color: color-mix(in srgb, var(--ds-primary-ink) 35%, transparent); color: var(--ds-primary-ink) !important; }
html body .ds-closing-inner .button-outline:hover { background: color-mix(in srgb, var(--ds-primary-ink) 10%, transparent); border-color: var(--ds-primary-ink); }
.ds-more-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0; margin-top: 20px; border-top: 1px solid var(--line); }
.ds-more-links a { display: block; padding: 18px 18px 18px 0; color: var(--muted); text-decoration: none; font-size: .92rem; border-bottom: 1px solid var(--line); transition: color var(--t-fast); }
.ds-more-links a span { display: block; margin-bottom: 2px; color: var(--text); font-family: var(--display); font-size: 1.15rem; font-weight: 600; transition: color var(--t-fast); }
.ds-more-links a:hover span { color: var(--gold); }
.ds-more-links a[hidden] { display: none !important; }
#public-account-counts[data-count-state="ready"] [data-count-status] { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
html body .placeholder-note { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .9rem; }
html body .placeholder-note svg { flex: 0 0 auto; color: var(--gold); }
html body .download-symbol svg { display: block; }
@media (max-width: 760px) { .ds-closing-inner { grid-template-columns: 1fr; } }

@media print { .ds-reveal { opacity: 1 !important; transform: none !important; } .ds-progress, .ds-toasts { display: none !important; } }

html body .ds-path.ds-path--feature p, html body .ds-path.ds-path--feature .ds-path-meta { color: color-mix(in srgb, var(--ds-primary-ink) 68%, transparent); }
.ds-path p { padding-right: 44px; }
html body .ds-gate-wrap > #animation-access-gate { width: 100%; }
html body .account-form button[type="submit"], html body button.account-button-primary {
  background: var(--ds-primary) !important; border: 1px solid var(--ds-primary) !important; color: var(--ds-primary-ink) !important;
}
html body .account-form button[type="submit"]:hover:not(:disabled), html body button.account-button-primary:hover:not(:disabled) { background: var(--ds-primary-hover) !important; }
@media (max-width: 560px) { .ds-path--feature .ds-path-art { opacity: .45; top: 70px; } }

/* Menu: grupo de conta flui como itens normais; widgets saem da frente quando o menu abre */
html body .site-header .nav .nav-account-links { display: contents; }
html body .site-header .nav .nav-signout { min-height: 50px; padding: 12px 8px; border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--ds-danger); font: 500 1.05rem var(--font); text-align: left; cursor: pointer; }
html body:has(.site-header .nav.is-open, .quick-access-panel.is-open) :is(.a11y-launcher) { visibility: hidden; }
@media (min-width: 1080px) and (max-width: 1450px) {
  html body .site-header .nav {
    left: auto; right: max(16px, calc((100% - var(--max)) / 2)); top: calc(100% + 8px); width: min(580px, calc(100vw - 32px));
    padding: 10px 18px 16px; border: 1px solid var(--line-strong); border-radius: var(--r-lg);
    background: var(--surface);
  }
  html body .site-header .nav > a, html body .site-header .nav .nav-account-links a { font-size: 1.05rem; min-height: 46px; }
  html body .site-header .nav > a:hover, html body .site-header .nav .nav-account-links a:hover { color: var(--gold); }
}

/* Atalho para o Modo Interativo */
.ds-primary-links a.ds-space-link { margin-left: 4px; padding-left: 26px; color: var(--text); }
.ds-primary-links a.ds-space-link::before { content: ""; position: absolute; left: 10px; top: 50%; width: 9px; height: 9px; margin-top: -4.5px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff, var(--accent) 55%, transparent 60%); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.ds-primary-links a.ds-space-link:hover::before { box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 28%, transparent); }


/* Seletor de laboratório (Física | Química) — abre pelo botão "Laboratório" do cabeçalho */
.ds-lab-picker { position: fixed; inset: 0; z-index: 2000; display: grid; place-items: center; padding: 20px; }
.ds-lab-picker[hidden] { display: none; }
.ds-lab-picker__backdrop { position: absolute; inset: 0; background: rgba(5, 8, 14, .66); backdrop-filter: blur(4px); animation: ds-fade var(--t-med, .25s) ease both; }
.ds-lab-picker__panel { position: relative; width: min(680px, 100%); max-height: calc(100dvh - 40px); overflow: auto; padding: 28px; border: 1px solid var(--line-strong); border-radius: 18px; background: var(--panel); color: var(--text); box-shadow: 0 30px 80px -30px rgba(0,0,0,.8); animation: ds-pop var(--t-med, .25s) var(--ease-out, ease) both; }
.ds-lab-picker__kicker { margin: 0 0 4px; font: 500 .72rem var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--gold); }
.ds-lab-picker__panel h2 { margin: 0 0 18px; font-size: clamp(1.35rem, 3.6vw, 1.8rem); line-height: 1.2; }
.ds-lab-picker__close { position: absolute; top: 12px; right: 14px; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 50%; background: transparent; color: var(--muted); font-size: 1.5rem; line-height: 1; cursor: pointer; }
.ds-lab-picker__close:hover { color: var(--text); border-color: var(--line-strong); }
.ds-lab-picker__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ds-lab-picker__card { display: flex; flex-direction: column; gap: 8px; padding: 20px; border: 1px solid var(--line-strong); border-radius: 14px; background: var(--bg); color: var(--text); text-decoration: none; transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.ds-lab-picker__card:hover, .ds-lab-picker__card:focus-visible { transform: translateY(-3px); border-color: var(--accent, var(--gold)); box-shadow: 0 16px 30px -22px var(--accent, var(--gold)); outline: none; }
.ds-lab-picker__card:focus-visible { outline: 2px solid var(--accent, var(--gold)); outline-offset: 2px; }
.ds-lab-picker__card[data-lab="fisica"] { --accent: #6aa8ff; }
.ds-lab-picker__card[data-lab="quimica"] { --accent: #4fd1a5; }
.ds-lab-picker__icon { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 16px; color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.ds-lab-picker__icon svg { width: 40px; height: 40px; }
.ds-lab-picker__card strong { font: 600 1.15rem var(--display); letter-spacing: -.01em; }
.ds-lab-picker__card > span:not(.ds-lab-picker__icon) { color: var(--muted); font-size: .92rem; line-height: 1.45; }
.ds-lab-picker__card em { margin-top: auto; padding-top: 6px; font: normal 600 .9rem var(--font); color: var(--accent); }
html.ds-lab-picker-open { overflow: hidden; }
@media (max-width: 560px) { .ds-lab-picker__grid { grid-template-columns: 1fr; } .ds-lab-picker__panel { padding: 22px 18px; } .ds-lab-picker__card { flex-direction: row; flex-wrap: wrap; align-items: center; } .ds-lab-picker__icon { width: 52px; height: 52px; } .ds-lab-picker__card strong { flex: 1; min-width: 0; } .ds-lab-picker__card > span:not(.ds-lab-picker__icon), .ds-lab-picker__card em { flex-basis: 100%; } }
@media print { .ds-lab-picker { display: none !important; } }
