/* tutorIA — CSS único (design-system.md). Ordem: fontes · tokens · base · componentes · shell ·
   assinaturas · páginas · efeitos · reduced-motion. Mobile first (375 px) até desktop (1280 px). */

/* ── fontes (self-hosted, OFL) ─────────────────────────────────────────────────────────────── */
@font-face {
  font-family: "Geist";
  src: url("/static/vendor/geist-5.3.0/geist-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Caveat";
  src: url("/static/vendor/caveat-5.3.0/caveat-latin-600-normal.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}

/* ── tokens (design-system.md §3) ──────────────────────────────────────────────────────────── */
:root {
  color-scheme: light dark;
  /* claro em hex puro: navegador sem light-dark() (Safari < 17.5) fica só no tema claro */
  --bg: #ffffff;
  --surface: #f7f7fb;
  --surface-2: #efeff6;
  --border: #e7e7ef;
  --fg: #0f1020;
  --fg-inverse: #ffffff;
  --muted: #5b5d75;
  --primary: #6d28d9;
  --accent: #db2777;
  --info: #2563eb;
  --success: #15803d;
  --warning: #b45309;
  --danger: #dc2626;
  --g1: var(--primary);
  --g2: var(--info);
  --g3: var(--accent);
  --brand-gradient: linear-gradient(90deg, var(--g1), var(--g2), var(--g3));
  --ring: color-mix(in srgb, var(--primary) 35%, transparent);

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --shadow-sm: 0 1px 2px #0f10200f, 0 2px 8px -2px #0f102014;
  --shadow-md: 0 12px 32px -12px #0f102040;

  --ease: cubic-bezier(.2, .8, .2, 1);
  --t-fast: 150ms;
  --t: 250ms;
  --t-slow: 400ms;

  --sidebar-w: 248px;
  --bottom-nav-h: 60px;
  --font: "Geist", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* Clerk segue os tokens, inclusive o tema (design-system.md §4.3) */
  --clerk-color-primary: var(--fg);
  --clerk-color-primary-foreground: var(--fg-inverse);
  --clerk-color-foreground: var(--fg);
  --clerk-color-muted-foreground: var(--muted);
  --clerk-color-background: var(--bg);
  --clerk-color-input: var(--bg);
  --clerk-color-input-foreground: var(--fg);
  --clerk-color-neutral: var(--muted);
  --clerk-color-danger: var(--danger);
  --clerk-color-success: var(--success);
  --clerk-color-ring: var(--primary);
  --clerk-border-radius: var(--r-sm);
  --clerk-font-family: var(--font);
}
@supports (color: light-dark(#000, #fff)) {
  :root {
    --bg: light-dark(#ffffff, #0a0a12);
    --surface: light-dark(#f7f7fb, #11111b);
    --surface-2: light-dark(#efeff6, #181826);
    --border: light-dark(#e7e7ef, #26263a);
    --fg: light-dark(#0f1020, #ececf4);
    --fg-inverse: light-dark(#ffffff, #0a0a12);
    --muted: light-dark(#5b5d75, #9b9db4);
    --primary: light-dark(#6d28d9, #a78bfa);
    --accent: light-dark(#db2777, #f472b6);
    --info: light-dark(#2563eb, #60a5fa);
    --success: light-dark(#15803d, #4ade80);
    --warning: light-dark(#b45309, #fbbf24);
    --danger: light-dark(#dc2626, #f87171);
    --shadow-sm: 0 1px 2px light-dark(#0f10200f, #0000), 0 2px 8px -2px light-dark(#0f102014, #0006);
    --shadow-md: 0 12px 32px -12px light-dark(#0f102040, #000c);
  }
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

/* ── base ──────────────────────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html:has(#landing) { scroll-behavior: smooth; } }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  display: flex; flex-direction: column; min-height: 100dvh; /* rodapé no fim da tela em página curta */
}
main { padding: 1rem; max-width: 960px; margin: 0 auto; width: 100%; flex: 1 0 auto; }
main:has(.table-wrap.wide) { max-width: 1240px; } /* tabela larga (consumo, 9 colunas) cabe sem rolar */
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.02em; font-weight: 700; }
h1 { font-size: 1.5rem; margin: 0.25rem 0 1rem; }
h2 { font-size: 1.25rem; margin: 0 0 0.75rem; }
h3 { font-size: 1.0625rem; margin: 0 0 0.5rem; }
p { margin: 0 0 0.75rem; }
a { color: var(--primary); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
small { font-size: 0.8125rem; }
code { font-size: 0.875em; background: var(--surface-2); padding: 0.1em 0.35em; border-radius: 4px; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1.5rem 0; }
:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; }
::selection { background: color-mix(in srgb, var(--primary) 22%, transparent); }
.muted { color: var(--muted); }
.error { color: var(--danger); }
.ok { color: var(--success); }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}
.icon { width: 1.25em; height: 1.25em; flex: none; vertical-align: -0.25em; }
@media (min-width: 768px) {
  main { padding: 2rem; }
  h1 { font-size: 1.875rem; }
}

/* ── componentes (design-system.md §5) ─────────────────────────────────────────────────────── */
/* botões */
button, a.button {
  font: inherit; font-weight: 600; font-size: 0.9375rem;
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 40px; padding: 0.5rem 1rem;
  border-radius: var(--r-sm); border: 1px solid var(--fg);
  background: var(--fg); color: var(--fg-inverse);
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease),
    color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
button:hover, a.button:hover { box-shadow: var(--shadow-sm); }
button:active, a.button:active { transform: translateY(1px); }
button:disabled { opacity: 0.55; cursor: not-allowed; box-shadow: none; transform: none; }
button.secondary, a.button.secondary { background: var(--bg); color: var(--fg); border-color: var(--border); }
button.secondary:hover, a.button.secondary:hover { background: var(--surface); }
button.ghost, a.button.ghost { background: transparent; color: var(--fg); border-color: transparent; }
button.ghost:hover, a.button.ghost:hover { background: var(--surface-2); box-shadow: none; }
button.danger, a.button.danger { background: var(--danger); border-color: var(--danger); color: var(--fg-inverse); }
button.link {
  background: none; border: none; color: var(--primary); padding: 0; min-height: 0;
  font-weight: 500; text-decoration: underline; text-underline-offset: 0.18em;
}
button.link:hover { box-shadow: none; }
.icon-btn { width: 40px; min-width: 40px; padding: 0; }
@media (max-width: 1023px) { .icon-btn { width: 44px; min-width: 44px; min-height: 44px; } }

/* campos */
input, select, textarea { font: inherit; color: var(--fg); }
/* popup nativo do select (ex.: GTK) não segue color-scheme: cores explícitas, senão texto claro em fundo claro */
option { background-color: var(--bg); color: var(--fg); }
input:not([type="checkbox"], [type="radio"], [type="file"], [type="range"]), select, textarea {
  min-height: 40px; padding: 0.5rem 0.75rem; max-width: 100%;
  border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--bg);
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
input:not([type="checkbox"], [type="radio"], [type="file"], [type="range"]):focus, select:focus, textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--ring);
}
input[type="file"] { max-width: 100%; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--primary); width: 1.05rem; height: 1.05rem; }
textarea { line-height: 1.5; }
fieldset { border: 1px solid var(--border); border-radius: var(--r-sm); padding: 0.75rem 1rem; margin: 0; }
legend { font-weight: 600; padding: 0 0.25rem; }

/* agrupamentos */
.stack { display: flex; flex-direction: column; gap: 1rem; }
.stack label { display: flex; flex-direction: column; gap: 0.375rem; font-weight: 500; font-size: 0.9375rem; }
.stack label small { font-weight: 400; }
.stack label.check, label.check { flex-direction: row; align-items: baseline; gap: 0.5rem; font-weight: 400; }
.actions { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.heading { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: center; justify-content: space-between; margin-bottom: 0.5rem; }
.heading h1 { margin-bottom: 0.25rem; }
.heading p { margin: 0 0 0.75rem; }
.filters { display: flex; flex-wrap: wrap; gap: 0.75rem 1rem; margin: 0 0 1rem; align-items: end; }
.filters label { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.875rem; color: var(--muted); }

/* painel e cartões */
.panel {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md);
  padding: 1rem; margin: 0 0 1rem;
}
@media (min-width: 768px) { .panel { padding: 1.25rem 1.5rem; } }
.cards { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.75rem; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md);
  padding: 0.875rem 1rem; display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; align-items: baseline;
  transition: box-shadow var(--t) var(--ease), border-color var(--t) var(--ease);
}
.card:hover { box-shadow: var(--shadow-sm); border-color: color-mix(in srgb, var(--primary) 25%, var(--border)); }
.card-title { font-weight: 600; margin-right: auto; overflow-wrap: anywhere; color: var(--fg); text-decoration: none; }
a.card-title:hover { color: var(--primary); }
.card .error { flex-basis: 100%; font-size: 0.875rem; }
@media (min-width: 640px) { .cards { grid-template-columns: repeat(2, 1fr); } }
.danger-zone { border-top: 1px solid color-mix(in srgb, var(--danger) 35%, var(--border)); margin-top: 1.25rem; padding-top: 1.25rem; }
.panel.danger-zone { border: 1px solid color-mix(in srgb, var(--danger) 40%, var(--border)); background: color-mix(in srgb, var(--danger) 4%, var(--surface)); }

/* badges e status */
.badge {
  display: inline-flex; align-items: center; gap: 0.25rem;
  font-size: 0.75rem; font-weight: 600; line-height: 1.5; padding: 0 0.5rem; border-radius: 999px;
  background: var(--primary); color: var(--fg-inverse); white-space: nowrap; vertical-align: 0.1em;
}
.badge.off, .badge.status-rejected, .badge.status-removed { background: var(--surface-2); color: var(--muted); }
.badge.minor, .badge.status-pending { background: var(--warning); }
.badge.status-active { background: var(--success); }
.status-processing { color: var(--muted); }
.status-processing::before {
  content: ""; display: inline-block; width: 0.5em; height: 0.5em; border-radius: 50%;
  background: var(--warning); margin-right: 0.4em; vertical-align: 0.1em; animation: pulse 1.6s ease-in-out infinite;
}
.status-ready { color: var(--success); }
.status-failed { color: var(--danger); }
@keyframes pulse { 50% { opacity: 0.3; } }

/* abas */
.tabs { display: flex; gap: 0.25rem; overflow-x: auto; border-bottom: 1px solid var(--border); margin: 0.5rem 0 1.25rem; scrollbar-width: none; }
.tabs a {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.625rem 0.75rem; text-decoration: none; white-space: nowrap; color: var(--muted); font-weight: 500;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.tabs a:hover { color: var(--fg); }
.tabs a[aria-current="page"] { color: var(--fg); border-bottom-color: var(--primary); font-weight: 600; }

/* avisos */
.notice {
  display: flex; gap: 0.5rem; align-items: baseline;
  padding: 0.75rem 1rem; border-radius: var(--r-sm); margin: 0 0 1rem;
  border: 1px solid var(--border); border-left: 3px solid var(--info); background: var(--surface);
}
.notice-active { border-left-color: var(--success); background: color-mix(in srgb, var(--success) 8%, var(--bg)); }
.notice-rejected { border-left-color: var(--danger); background: color-mix(in srgb, var(--danger) 8%, var(--bg)); }

/* listas e estados vazios */
.list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.5rem; overflow-wrap: anywhere; }
.list:not(:empty) + .empty, .chat:not(:empty) + .empty, .materials:not(:empty) + .empty { display: none; }
ul.plain { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.375rem; }
.empty-state { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }
.empty-state .icon { width: 2.5rem; height: 2.5rem; padding: 0.6rem; border-radius: var(--r-md); background: var(--surface-2); color: var(--primary); margin-bottom: 0.75rem; }

/* tabelas */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r-md); margin: 0 0 1rem; }
table.data { border-collapse: collapse; width: 100%; background: var(--bg); font-size: 0.875rem; }
table.data th, table.data td { padding: 0.625rem 0.875rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data th { white-space: nowrap; color: var(--muted); font-weight: 600; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; background: var(--surface); }
table.data tbody tr { transition: background var(--t-fast) var(--ease); }
table.data tbody tr:hover { background: var(--surface); }
table.data .num, .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
table.data th.num { white-space: normal; } /* cabeçalho numérico quebra linha antes de a tabela rolar */
table.data tr.total td { font-weight: 700; background: var(--surface-2); }
table.data tr.inactive td { color: var(--muted); }

/* dados em pares */
.facts { display: grid; gap: 0 1rem; margin: 0; }
.facts dt { color: var(--muted); font-size: 0.875rem; }
.facts dd { margin: 0 0 0.625rem; overflow-wrap: anywhere; }
@media (min-width: 768px) {
  .facts { grid-template-columns: max-content 1fr; gap: 0.5rem 1.5rem; }
  .facts dt { font-size: inherit; }
  .facts dd { margin: 0; }
}

/* estatísticas */
.stats { display: grid; gap: 0.75rem; margin: 0 0 1rem; }
.stat { display: block; text-decoration: none; color: var(--muted); margin: 0; font-size: 0.875rem; }
.stat strong { display: block; font-size: 1.875rem; line-height: 1.1; letter-spacing: -0.03em; color: var(--fg); font-variant-numeric: tabular-nums; margin-bottom: 0.25rem; }
a.stat:hover { border-color: color-mix(in srgb, var(--primary) 35%, var(--border)); box-shadow: var(--shadow-sm); }
@media (min-width: 768px) { .stats { grid-template-columns: repeat(3, 1fr); } }

/* menu (popover) */
.menu {
  margin: 0; padding: 0.375rem; min-width: 232px;
  border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--bg); color: var(--fg); box-shadow: var(--shadow-md);
}
.menu > a, .menu > button, .menu > form > button {
  display: flex; align-items: center; gap: 0.625rem; width: 100%; min-height: 40px; padding: 0.5rem 0.625rem;
  justify-content: flex-start; background: none; border: 0; border-radius: var(--r-sm);
  color: var(--fg); font-weight: 500; text-decoration: none;
}
.menu > a:hover, .menu > button:hover, .menu > form > button:hover { background: var(--surface-2); box-shadow: none; }
.menu hr { margin: 0.375rem 0; }
.menu .menu-label { display: block; font-size: 0.75rem; color: var(--muted); padding: 0.375rem 0.625rem 0.25rem; }

/* markdown (materiais e tutor) */
.markdown, .msg { overflow-wrap: anywhere; }
.markdown table, .msg table { border-collapse: collapse; display: block; overflow-x: auto; margin: 0.75rem 0; }
.markdown th, .markdown td, .msg th, .msg td { border: 1px solid var(--border); padding: 0.375rem 0.625rem; }
.markdown th, .msg th { background: var(--surface); }
.markdown img, .msg img { max-width: 100%; border-radius: var(--r-sm); }
.markdown pre, .msg pre { overflow-x: auto; background: var(--surface-2); padding: 0.75rem 1rem; border-radius: var(--r-sm); }
.markdown pre code, .msg pre code { background: none; padding: 0; }
.markdown h1 { font-size: 1.5rem; }
article.markdown { max-width: 68ch; margin-inline: auto; line-height: 1.7; }
.markdown blockquote { margin: 0.75rem 0; padding-left: 1rem; border-left: 3px solid var(--border); color: var(--muted); }

/* rodapé legal */
.legal-links { font-size: 0.875rem; color: var(--muted); }
.legal-links a { color: var(--muted); }
footer.legal-links { text-align: center; padding: 1.5rem 1rem; }
footer.legal-links p { margin: 0 0 0.25rem; }

/* ── shell (design-system.md §4.1–4.2) ─────────────────────────────────────────────────────── */
.brand { font-weight: 800; font-size: 1.1875rem; letter-spacing: -0.035em; color: var(--fg); text-decoration: none; }
.avatar {
  display: inline-grid; place-items: center; flex: none;
  width: 34px; height: 34px; min-height: 34px; padding: 0; border: 0; border-radius: 50%;
  background: linear-gradient(135deg, #6d28d9, #db2777); color: #fff;
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.02em;
}
.mobilebar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
  padding: 0.375rem 0.5rem; padding-top: max(0.375rem, env(safe-area-inset-top));
  background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.mobilebar .avatar { width: 36px; height: 36px; margin-right: 0.25rem; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: min(86vw, 300px); height: 100dvh; max-height: none;
  margin: 0; border: 0; border-right: 1px solid var(--border); padding: 0.75rem;
  background: var(--surface); color: var(--fg);
  flex-direction: column; gap: 0.125rem; overflow-y: auto;
}
.sidebar:popover-open { display: flex; animation: drawer var(--t) var(--ease); }
.sidebar::backdrop { background: rgb(10 10 18 / 0.45); backdrop-filter: blur(2px); }
@keyframes drawer { from { transform: translateX(-100%); } }
.side-head { display: flex; align-items: center; justify-content: space-between; padding: 0.25rem 0.25rem 0.75rem 0.5rem; }
.switcher { margin: 0 0 0.25rem; }
.switcher label { display: block; }
.switcher select { width: 100%; border-radius: 999px; font-size: 0.875rem; font-weight: 500; }
.side-label { font-size: 0.6875rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 1.125rem 0.5rem 0.375rem; }
.side-list, .side-sub { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.side-sub { margin: 2px 0 6px 1.125rem; padding-left: 0.625rem; border-left: 1px solid var(--border); }
.side-link {
  display: flex; align-items: center; gap: 0.625rem; min-height: 40px; padding: 0.375rem 0.5rem;
  border-radius: var(--r-sm); color: var(--fg); text-decoration: none; font-weight: 500; font-size: 0.9375rem;
  transition: background var(--t-fast) var(--ease);
}
.side-sub .side-link { min-height: 34px; font-size: 0.875rem; color: var(--muted); }
.side-link > .icon { color: var(--muted); }
.side-link:hover { background: var(--surface-2); }
.side-link[aria-current="page"] { background: var(--bg); color: var(--fg); font-weight: 600; box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--border); }
.side-link[aria-current="page"] > .icon, .side-link[data-open] > .icon { color: var(--primary); }
.side-link[data-open] { font-weight: 600; }
.side-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-link .badge { margin-left: auto; background: var(--accent); }
.side-new { color: var(--muted); }
.side-ops[data-open] > .icon, body.super .side-sub .side-link[aria-current="page"] { color: var(--warning); }
.side-foot { margin-top: auto; padding-top: 0.75rem; border-top: 1px solid var(--border); }
.side-user {
  width: 100%; justify-content: flex-start; gap: 0.625rem; padding: 0.375rem 0.5rem;
  background: none; border: 0; color: var(--fg); font-weight: 500; font-size: 0.875rem;
}
.side-user:hover { background: var(--surface-2); box-shadow: none; }
.side-user > .icon { margin-left: auto; color: var(--muted); }
#usermenu { position: fixed; inset: 3.5rem 0.5rem auto auto; }
.menu-lang { padding: 0.25rem 0.625rem; }
.menu-lang label { display: flex; align-items: center; gap: 0.625rem; color: var(--muted); }
.menu-lang select { flex: 1; min-height: 34px; padding: 0.25rem 0.5rem; font-size: 0.875rem; }
.theme-switch { display: flex; gap: 2px; padding: 2px; margin: 0.375rem 0.625rem; background: var(--surface-2); border-radius: var(--r-sm); }
.theme-switch button {
  flex: 1; gap: 0.3rem; min-height: 32px; padding: 0.25rem 0.375rem;
  background: none; border: 0; color: var(--muted); font-size: 0.8125rem; font-weight: 500;
}
.theme-switch button:hover { color: var(--fg); box-shadow: none; }
.theme-switch button[aria-pressed="true"] { background: var(--bg); color: var(--fg); box-shadow: var(--shadow-sm); }
.focusbar { display: flex; align-items: center; gap: 0.75rem; max-width: 960px; margin: 0 auto; padding: 0.875rem 1rem; }
.focusbar .brand { margin-right: auto; }
.focusbar select { min-height: 36px; padding: 0.25rem 0.5rem; font-size: 0.875rem; }
main.focused { max-width: 720px; }
/* layout focado (§4.2): sem artigo longo, o conteúdo vira um cartão central */
main.focused:not(:has(article, .login-split)) {
  width: min(560px, calc(100% - 2rem)); margin: clamp(0.5rem, 6vh, 4rem) auto 0; padding: 1.5rem 1.25rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-sm);
}
main.focused:not(:has(article, .login-split)) .panel { background: var(--bg); }
@media (min-width: 768px) { main.focused:not(:has(article, .login-split)) { padding: 2rem; } }
main.focused h1 { font-size: 1.625rem; }
main.focused > p { color: var(--muted); }
main.focused #sign-in { display: grid; justify-items: center; margin-top: 1rem; }
@media (max-width: 1023px) {
  /* alvos de toque ≥ 44 px no celular (design-system.md §9) */
  .side-link, .side-sub .side-link, .menu > a, .menu > button, .menu > form > button,
  .theme-switch button { min-height: 44px; }
}
/* navegador sem popover (ex.: Safari < 17): barra lateral e menu viram blocos estáticos no fluxo */
@supports not selector(:popover-open) {
  @media (max-width: 1023px) {
    .sidebar { position: static; display: flex; width: auto; height: auto; border-right: 0; border-bottom: 1px solid var(--border); }
    .mobilebar [popovertarget] { visibility: hidden; }
  }
  .side-close { display: none; }
  #usermenu { position: static; display: block; margin: 0 1rem 1rem; box-shadow: none; }
}
@media (min-width: 1024px) {
  .mobilebar, .side-close { display: none; }
  .sidebar { display: flex; width: var(--sidebar-w); z-index: 10; }
  body.has-shell { padding-left: var(--sidebar-w); }
  #usermenu { inset: auto auto 4.25rem 0.75rem; }
}

/* ── assinaturas (design-system.md §6) ─────────────────────────────────────────────────────── */
/* azulejo de idioma (§6.3) */
.tile {
  --lang: var(--primary);
  position: relative; overflow: hidden; flex: none;
  display: inline-grid; place-items: center;
  background: var(--lang); color: #fff; text-decoration: none;
  font-weight: 700; letter-spacing: -0.02em; line-height: 1;
}
.tile[data-lang="en"] { --lang: #4338ca; }
.tile[data-lang="es"] { --lang: #b45309; }
.tile[data-lang="fr"] { --lang: #be185d; }
.tile[data-lang="de"] { --lang: #44403c; }
.tile[data-lang="it"] { --lang: #15803d; }
.tile[data-lang="pt"] { --lang: #0369a1; }
.tile sup { font-size: 0.55em; margin-left: 1px; opacity: 0.85; vertical-align: 0.6em; }
.tile-xs { width: 22px; height: 22px; font-size: 0.625rem; border-radius: 6px; }
.tile-sm { width: 30px; height: 30px; font-size: 0.75rem; border-radius: 8px; }
.tile-md { width: 46px; height: 46px; font-size: 1.0625rem; border-radius: 11px; }
.tile-lg {
  width: 100%; min-height: 136px; padding: 1rem 1.125rem; border-radius: var(--r-lg);
  display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start; gap: 1rem;
  box-shadow: var(--shadow-sm); transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
.tile-lg:hover { transform: translateY(-2px); box-shadow: 0 18px 36px -18px var(--lang); }
.tile-lg .tile-code { font-size: 2.5rem; letter-spacing: -0.04em; }
.tile-lg .tile-hi {
  position: absolute; right: -0.25rem; top: 42%; transform: translateY(-50%);
  font-size: 2.75rem; font-style: italic; font-weight: 700; letter-spacing: -0.03em;
  opacity: 0.16; white-space: nowrap; pointer-events: none;
}
.tile-lg .tile-name { position: relative; font-weight: 600; font-size: 1.0625rem; line-height: 1.3; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.tile-meta { display: block; margin-top: 0.125rem; font-size: 0.8125rem; font-weight: 500; letter-spacing: 0; opacity: 0.85; }
@media (min-width: 640px) { .tile-lg { aspect-ratio: 4 / 3; } }
/* caneta do professor (§6.1) */
ruby.fix { ruby-position: over; }
ruby.fix del { text-decoration: none; position: relative; color: var(--muted); }
ruby.fix del::after {
  content: ""; position: absolute; left: -2px; right: -2px; top: 54%; height: 2px;
  background: var(--accent); border-radius: 2px; transform: rotate(-4deg); transform-origin: left;
}
ruby.fix rt {
  font-family: "Caveat", cursive; font-weight: 600; font-size: 1.2em; line-height: 1;
  color: var(--accent); padding-bottom: 1px; transform: rotate(-3deg);
}
.msg.assistant blockquote {
  margin: 0.5rem 0; padding: 0.125rem 0 0.125rem 0.75rem;
  border-left: 2px solid var(--accent); color: var(--muted); font-size: 0.9375rem; line-height: 1.5;
}
.msg.assistant blockquote > :last-child { margin-bottom: 0; }
/* rota CEFR (§6.2) */
.route { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; }
.route li { display: flex; align-items: center; flex: 1; position: relative; }
.route li:first-child { flex: 0; }
.route li::before { content: ""; flex: 1; height: 2px; margin: 0 2px; background: repeating-linear-gradient(90deg, color-mix(in srgb, var(--muted) 45%, transparent) 0 4px, transparent 4px 7px); }
.route li:first-child::before { display: none; }
.route li.done::before, .route li.now::before { background: var(--primary); }
.route span {
  display: grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 50%;
  border: 2px solid var(--border); background: var(--bg); color: var(--muted);
  font-size: 0.6875rem; font-weight: 700;
}
.route .done span { background: var(--primary); border-color: var(--primary); color: var(--fg-inverse); }
.route .now span {
  width: 38px; height: 38px; font-size: 0.8125rem; background: var(--accent); border-color: var(--accent); color: var(--fg-inverse);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 18%, transparent);
}
.route .now::after {
  content: attr(data-you); position: absolute; right: 19px; transform: translateX(50%); top: -1.35rem;
  font-size: 0.6875rem; font-weight: 600; color: var(--accent);
}
.route-md { padding-top: 1.25rem; max-width: 420px; }
.route-lg { padding-top: 1.5rem; }
.route-lg span { width: 36px; height: 36px; font-size: 0.8125rem; }
.route-lg .now span { width: 48px; height: 48px; font-size: 1rem; }
.route-lg .now::after { right: 24px; }
.route-sm { width: 132px; }
.route-sm li::before { margin: 0; }
.route-sm span { width: 12px; height: 12px; font-size: 0; border-width: 1.5px; border-color: color-mix(in srgb, var(--muted) 55%, transparent); }
.route-sm .now span { width: 16px; height: 16px; font-size: 0; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.route-sm .now::after { display: none; }
.route-hint { font-size: 0.8125rem; margin: 0.375rem 0 0; }
/* calor do erro recorrente (§6.5) */
.heat { display: inline-flex; gap: 2px; vertical-align: -0.1em; }
.heat i { width: 6px; height: 14px; border-radius: 2px; background: var(--accent); }

/* ── páginas ───────────────────────────────────────────────────────────────────────────────── */
/* aula */
.chat { display: flex; flex-direction: column; gap: 1.25rem; padding-bottom: 0.5rem; }
.chat-empty .empty-state p { max-width: 40ch; margin: 0 auto 1rem; }
.msg.user {
  align-self: flex-end; max-width: 85%; padding: 0.5rem 0.875rem; white-space: pre-wrap;
  background: linear-gradient(135deg, #6d28d9, #2563eb); color: #fff; /* fixo: texto branco AA nos dois temas */
  border-radius: 16px 16px 4px 16px;
}
.msg.assistant { font-size: 1.0625rem; line-height: 1.7; max-width: 68ch; }
.msg.assistant > :first-child { margin-top: 0; }
.msg.assistant > :last-child { margin-bottom: 0; }
.note { font-size: 0.875rem; color: var(--muted); }
.note.error { color: var(--danger); }
.note.tools { font-size: 0.8125rem; opacity: 0.75; }
.note.tools > summary { cursor: pointer; width: fit-content; }
.note.tools ul { margin: 0.25rem 0 0; padding-left: 1.25rem; }
.composer {
  position: sticky; bottom: 0; z-index: 5;
  display: grid; grid-template-columns: 1fr auto; grid-template-areas: "input send" "new .";
  gap: 0.375rem 0.5rem; padding: 1rem 0 max(0.75rem, env(safe-area-inset-bottom));
  background: linear-gradient(transparent, var(--bg) 1.25rem);
}
.composer textarea {
  grid-area: input; width: 100%; resize: none; min-height: 48px; max-height: 40vh;
  padding: 0.75rem 1rem; border-radius: 14px; box-shadow: var(--shadow-sm);
}
.composer [data-send] { grid-area: send; align-self: end; width: 48px; min-width: 48px; min-height: 48px; border-radius: 14px; }
.composer [data-new] { grid-area: new; justify-self: start; min-height: 32px; padding: 0.25rem 0.5rem; font-size: 0.8125rem; font-weight: 500; color: var(--muted); }
.composer [data-new] .icon { width: 1rem; height: 1rem; }
@media (max-width: 1023px) { .composer [data-new] { min-height: 44px; } }
/* biblioteca, listening e fala */
.materials { margin-top: 1rem; }
.segments { padding-left: 1.25rem; margin: 0; }
.segments li { margin: 0.25rem 0; }
audio { width: 100%; }
.seg { background: none; border: 0; color: inherit; text-align: left; width: 100%; padding: 0.25rem 0.375rem; border-radius: 6px; font-weight: 400; min-height: 0; display: block; white-space: normal; }
.seg:hover { background: var(--surface-2); box-shadow: none; }
.seg.now { background: color-mix(in srgb, var(--warning) 22%, transparent); }
/* admin */
.providers { display: grid; gap: 0 1rem; }
@media (min-width: 768px) { .providers { grid-template-columns: repeat(2, 1fr); align-items: start; } }
fieldset.roles { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; }
fieldset.roles label.check { display: flex; gap: 0.35rem; align-items: baseline; }
details.member > summary { cursor: pointer; display: flex; flex-wrap: wrap; gap: 0.25rem 0.5rem; align-items: baseline; }
details.member[open] > summary { margin-bottom: 0.75rem; }
.caps span { white-space: nowrap; margin-inline-start: 0.5rem; }
/* operação (super-admin) */
.ops-band {
  display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; align-items: baseline;
  padding: 0.5rem 0.875rem; margin: 0 0 1.25rem; border-radius: var(--r-sm);
  background: color-mix(in srgb, var(--warning) 14%, var(--bg));
  border: 1px solid color-mix(in srgb, var(--warning) 40%, var(--border));
}
.ops-band strong { text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.75rem; margin-right: auto; color: var(--warning); }

/* progresso */
.progress-grid { display: grid; gap: 0 1rem; }
@media (min-width: 900px) { .progress-grid { grid-template-columns: 1fr 1fr; align-items: start; } }
.tasks-open .list li { position: relative; padding-left: 1.625rem; }
.tasks-open .list li::before {
  content: ""; position: absolute; left: 0; top: 0.3em; width: 1rem; height: 1rem;
  border: 2px solid var(--border); border-radius: 50%;
}
.tasks-done .list li { display: flex; gap: 0.625rem; align-items: flex-start; }
.tasks-done .list li > .icon { color: var(--success); margin-top: 0.15em; }
.mistake { display: grid; grid-template-columns: 1fr auto; gap: 0.125rem 0.75rem; align-items: center; padding: 0.5rem 0; border-bottom: 1px solid var(--border); }
.mistake:last-child { border-bottom: 0; }
.mistake-fix { font-size: 1.0625rem; }
.mistake-fix del { color: var(--muted); text-decoration-color: var(--accent); text-decoration-thickness: 2px; }
.mistake-meta { grid-column: 1 / -1; }
.mistake.cool { opacity: 0.55; }
.mistake.cool .heat i { background: var(--border); }
.history .list li { position: relative; padding-left: 1.25rem; display: grid; gap: 0.125rem; }
.history .list li::before { content: ""; position: absolute; left: 0.25rem; top: 0.55em; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--primary); }
.history .list li::after { content: ""; position: absolute; left: calc(0.5rem - 1px); top: 1.4em; bottom: -0.6rem; width: 2px; background: var(--border); }
.history .list li:last-child::after { display: none; }
/* biblioteca */
.card.material { align-items: center; flex-wrap: nowrap; }
.card.material .card-body { display: flex; flex-direction: column; gap: 0.125rem; min-width: 0; margin-right: auto; }
.card.material .card-title { margin: 0; }
.card.material .card-body .badge { align-self: flex-start; }
.card.material .card-body .muted { font-size: 0.8125rem; }
.card.material:has(.error), .card.material:has(a[href*="speech="]) { flex-wrap: wrap; }
/* classificação (spec 17): curso · lição, chips de tag, selo da IA; grupos por curso na biblioteca */
.classification-line { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.375rem; font-size: 0.8125rem; color: var(--fg); }
.classification-line .tag { color: var(--primary); text-decoration: none; background: color-mix(in srgb, var(--primary) 10%, transparent); padding: 0 0.4rem; border-radius: 999px; }
.classification-line .tag:hover { text-decoration: underline; }
.badge.ai { background: var(--surface-2); color: var(--muted); font-weight: 500; }
.material-group h3 { margin: 1.5rem 0 0.25rem; font-size: 0.9375rem; }
.material-group h3 a { color: inherit; text-decoration: none; }
.material-group h3 a:hover { text-decoration: underline; }
.material-group .materials { margin-top: 0.5rem; }
.classification { display: grid; gap: 0.75rem; }
/* envio recolhido e edição no cartão (spec 17) */
details.upload > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 0.5rem; font-weight: 600; color: var(--primary); }
details.upload > summary::-webkit-details-marker { display: none; }
details.upload[open] > summary { margin-bottom: 1rem; }
.card.material.editing { grid-column: 1 / -1; display: block; }
.card.material .icon-btn { color: var(--muted); }
@media (min-width: 640px) { .classification { grid-template-columns: 2fr 1fr; } }
.card-icon { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: var(--r-sm); background: color-mix(in srgb, var(--primary) 10%, var(--bg)); color: var(--primary); }
.status { font-size: 0.8125rem; font-weight: 600; white-space: nowrap; }

/* home e cabeçalho da linha */
.track-grid { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: 0.875rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); }
.track-item { position: relative; }
button.track-edit { position: absolute; top: 0.5rem; right: 0.5rem; color: #fff; }
button.track-edit:hover { background: rgb(255 255 255 / 0.16); }
.tile-new {
  width: 100%; height: 100%; min-height: 136px; flex-direction: column; gap: 0.5rem;
  border: 2px dashed var(--border); border-radius: var(--r-lg); background: transparent; color: var(--muted);
}
.tile-new:hover { border-color: var(--primary); color: var(--primary); background: color-mix(in srgb, var(--primary) 5%, transparent); box-shadow: none; }
.tile-new .icon { width: 1.75rem; height: 1.75rem; }
.tracks-empty { max-width: 48ch; }
.track-head { display: grid; grid-template-columns: auto 1fr auto; gap: 0.75rem 0.875rem; align-items: center; margin-bottom: 1.25rem; }
.track-head h1 { margin: 0; font-size: 1.375rem; overflow-wrap: anywhere; }
.track-title p { margin: 0; font-size: 0.875rem; }
.track-route { grid-column: 1 / -1; grid-row: 2; }
.track-edit-btn { grid-column: 3; grid-row: 1; }
@media (min-width: 900px) {
  .track-head { grid-template-columns: auto 1fr auto auto; }
  .track-head h1 { font-size: 1.625rem; }
  .track-route { grid-column: 3; grid-row: 1; width: 300px; }
  .track-edit-btn { grid-column: 4; }
}
.track-tabs a .icon { width: 1.125rem; height: 1.125rem; }
@media (max-width: 1023px) {
  .track-tabs {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; margin: 0;
    display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; overflow: visible;
    padding: 0.25rem 0.25rem max(0.25rem, env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(12px);
    border-top: 1px solid var(--border); border-bottom: 0;
  }
  .track-tabs a {
    flex-direction: column; justify-content: center; gap: 0.125rem; min-height: 52px; margin: 0;
    padding: 0.25rem 0.125rem; border-bottom: 0; border-radius: var(--r-sm); font-size: 0.6875rem;
  }
  .track-tabs a .icon { width: 1.375rem; height: 1.375rem; }
  .track-tabs a[aria-current="page"] { color: var(--primary); background: color-mix(in srgb, var(--primary) 8%, transparent); }
  body.has-track-tabs main { padding-bottom: calc(var(--bottom-nav-h) + 1rem); }
  body.has-track-tabs footer.legal-links { padding-bottom: calc(var(--bottom-nav-h) + 1.5rem); }
  body.has-track-tabs .composer { bottom: var(--bottom-nav-h); }
}

/* professor */
.acting { justify-content: flex-end; margin-bottom: 0.25rem; }
.acting label { flex-direction: row; align-items: center; gap: 0.5rem; }
.acting select { min-height: 34px; padding: 0.25rem 0.5rem; font-size: 0.875rem; }
.lang-group { margin-bottom: 1.5rem; }
.lang-head { display: flex; align-items: center; gap: 0.625rem; }
.student-card { flex-direction: column; align-items: stretch; gap: 0.5rem; }
.student-card .card-title { margin: 0; }
.student-tracks > li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.25rem 0.75rem; font-size: 0.875rem; }
.level-cell { display: inline-flex; align-items: center; gap: 0.625rem; white-space: nowrap; }
.cohort-card { align-items: center; }

/* admin */
.admin-bento { margin-bottom: 1rem; }
.admin-bento .stat { position: relative; padding: 1.25rem 1.5rem; }
.admin-bento .stat > .icon { position: absolute; top: 1.25rem; right: 1.25rem; color: var(--primary); width: 1.5rem; height: 1.5rem; }
.admin-bento .stat strong { font-size: 2.25rem; }
.stat-alert > .icon, .stat-alert strong { color: var(--accent); }
.bar-cell { background: linear-gradient(90deg, transparent calc(100% - var(--w)), color-mix(in srgb, var(--primary) 14%, transparent) 0); }

/* landing (design-system.md §4.3) */
#landing main { max-width: none; padding: 0; }
.lp-wrap { max-width: 1120px; margin: 0 auto; padding: 0 1.25rem; }
.lp-nav { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 80%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent); }
.lp-nav .lp-wrap { display: flex; align-items: center; gap: 0.75rem; min-height: 60px; }
.lp-nav .brand { margin-right: auto; }
.lp-links { display: none; gap: 1.5rem; margin-right: 0.5rem; }
.lp-links a { color: var(--muted); text-decoration: none; font-weight: 500; font-size: 0.9375rem; }
.lp-links a:hover { color: var(--fg); }
.lp-lang label { display: flex; align-items: center; gap: 0.25rem; color: var(--muted); }
.lp-lang select { min-height: 36px; padding: 0.25rem 0.5rem; font-size: 0.875rem; border-color: transparent; background: transparent; }
.lp-hero { overflow: hidden; padding: 3rem 0 1.5rem; }
.lp-hero-grid { display: grid; gap: 2.5rem; align-items: center; }
.lp-badge {
  display: inline-flex; align-items: center; gap: 0.375rem; margin-bottom: 1rem;
  padding: 0.25rem 0.75rem; border-radius: 999px; font-size: 0.8125rem; font-weight: 600; color: var(--primary);
  background: color-mix(in srgb, var(--bg) 70%, transparent); border: 1px solid color-mix(in srgb, var(--primary) 25%, var(--border));
}
.lp-hero h1 { font-size: clamp(2.25rem, 7vw, 3.75rem); line-height: 1.04; letter-spacing: -0.045em; font-weight: 800; margin: 0 0 1rem; text-wrap: balance; }
.lp-lead { font-size: 1.125rem; color: var(--muted); max-width: 36ch; margin-bottom: 1.5rem; }
.lp-cta { min-height: 48px; padding: 0.75rem 1.375rem; font-size: 1rem; border-radius: 12px; }
.lp-fine { font-size: 0.8125rem; color: var(--muted); max-width: 44ch; margin-top: 1rem; }
.lp-demo {
  background: var(--bg); border-radius: var(--r-lg); padding: 1rem 1.125rem 1.25rem;
  display: flex; flex-direction: column; gap: 0.75rem;
  box-shadow: 0 30px 60px -30px color-mix(in srgb, var(--g1) 55%, transparent), 0 0 0 1px var(--border);
}
.lp-demo-head { display: flex; align-items: center; gap: 0.625rem; padding-bottom: 0.75rem; border-bottom: 1px solid var(--border); font-size: 0.9375rem; }
.lp-demo-head > span:last-child { margin-left: auto; color: var(--muted); font-size: 0.8125rem; }
.lp-demo .msg.user { margin: 0; animation: lp-in 8s var(--ease) infinite; }
.lp-demo .msg.assistant { animation: lp-in2 8s var(--ease) infinite; }
.lp-demo .msg.assistant p { margin: 0; line-height: 2.2; }
.lp-demo ruby.fix del::after { animation: lp-strike 8s var(--ease) infinite; }
.lp-demo ruby.fix rt { animation: lp-pen 8s var(--ease) infinite; }
.lp-demo blockquote { animation: lp-why 8s var(--ease) infinite; }
@keyframes lp-in { 0%, 3% { opacity: 0; transform: translateY(8px); } 10%, 100% { opacity: 1; transform: none; } }
@keyframes lp-in2 { 0%, 16% { opacity: 0; transform: translateY(8px); } 24%, 100% { opacity: 1; transform: none; } }
@keyframes lp-strike { 0%, 30% { transform: rotate(-4deg) scaleX(0); } 38%, 100% { transform: rotate(-4deg) scaleX(1); } }
@keyframes lp-pen { 0%, 40% { opacity: 0; } 50%, 100% { opacity: 1; } }
@keyframes lp-why { 0%, 52% { opacity: 0; } 62%, 100% { opacity: 1; } }
.lp-marquee { margin-top: 2.5rem; color: var(--muted); font-size: 1.25rem; font-weight: 600; letter-spacing: -0.01em; opacity: 0.7; }
.lp-section { padding: 3.5rem 0; scroll-margin-top: 60px; }
.lp-section h2 { font-size: clamp(1.625rem, 4vw, 2.25rem); letter-spacing: -0.035em; margin-bottom: 0.5rem; }
.lp-sub { color: var(--muted); font-size: 1.0625rem; margin-bottom: 1.75rem; }
.lp-card { position: relative; display: flex; flex-direction: column; gap: 0.25rem; padding: 1.5rem; }
.lp-card h3 { font-size: 1.125rem; }
.lp-card p { margin-bottom: 0.75rem; }
.lp-step { position: absolute; top: 1.25rem; right: 1.25rem; font-size: 2rem; font-weight: 800; line-height: 1; color: color-mix(in srgb, var(--primary) 18%, transparent); }
.lp-mini { margin-top: auto; padding: 1rem; background: var(--bg); border-radius: var(--r-md); line-height: 2.3; font-size: 1.125rem; }
.lp-tiles { display: flex; gap: 0.5rem; margin-top: auto; }
.lp-icons { display: flex; gap: 0.75rem; color: var(--primary); margin-top: auto; }
.lp-icons .icon { width: 2.5rem; height: 2.5rem; padding: 0.55rem; border-radius: var(--r-md); background: var(--bg); border: 1px solid var(--border); }
.lp-schools {
  display: grid; gap: 1.5rem; align-items: center; padding: 2rem 1.5rem; border-radius: var(--r-lg); position: relative; overflow: hidden; isolation: isolate;
  background: #0f1020; color: #ececf4;
}
.lp-schools::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(60% 90% at 100% 0%, #6d28d966, transparent 70%), radial-gradient(40% 70% at 0% 100%, #db277733, transparent 70%); }
.lp-schools h2 { color: #fff; }
.lp-schools p { color: #b9bad0; }
.lp-schools ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.625rem; }
.lp-schools li { display: flex; gap: 0.625rem; align-items: flex-start; color: #dcdcea; }
.lp-schools li .icon { color: #a78bfa; margin-top: 0.15em; }
.lp-schools .button { background: #fff; color: #0f1020; border-color: #fff; justify-self: start; }
.lp-faq { max-width: 760px; }
.lp-faq details { border-bottom: 1px solid var(--border); }
.lp-faq summary {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: 1.125rem 0; cursor: pointer; font-weight: 600; font-size: 1.0625rem; list-style: none;
}
.lp-faq summary::-webkit-details-marker { display: none; }
.lp-faq summary .icon { color: var(--muted); transition: transform var(--t) var(--ease); }
.lp-faq details[open] summary .icon { transform: rotate(180deg); }
.lp-faq details p { color: var(--muted); margin: 0 0 1.25rem; max-width: 64ch; }
.lp-foot { border-top: 1px solid var(--border); padding: 1.5rem 0 2rem; font-size: 0.875rem; }
.lp-foot .lp-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.25rem; }
.lp-foot .brand { font-size: 1rem; margin-right: auto; }
.lp-foot a:not(.brand) { color: var(--muted); }
@media (min-width: 768px) {
  .lp-links { display: flex; }
  .lp-hero { padding: 5rem 0 2rem; }
  .lp-schools { grid-template-columns: 1.6fr 1fr; padding: 2.75rem; }
  .lp-schools .button { justify-self: end; }
}
@media (min-width: 960px) { .lp-hero-grid { grid-template-columns: 1.1fr 1fr; gap: 3.5rem; } }

/* login (design-system.md §4.3) */
body.login-page main { max-width: none; padding: 0; }
.login-split { display: grid; }
.login-art {
  position: relative; isolation: isolate; overflow: hidden;
  display: flex; flex-direction: column; gap: 1rem; padding: 1.25rem 1.25rem 1.5rem;
  background: #0f1020; color: #ececf4;
}
.login-art::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(60% 55% at 0% 0%, #6d28d999, transparent 70%),
    radial-gradient(50% 55% at 100% 100%, #db277766, transparent 70%),
    radial-gradient(40% 40% at 95% 5%, #2563eb66, transparent 70%);
}
.login-art .brand { color: #fff; display: none; }
.login-demo { display: none; color: var(--fg); max-width: 420px; }
.login-welcome { margin: 0; font-size: 1.25rem; font-weight: 700; letter-spacing: -0.025em; line-height: 1.25; color: #fff; }
.login-welcome span { display: block; margin-top: 0.25rem; font-size: 0.9375rem; font-weight: 500; letter-spacing: 0; color: #b9bad0; }
.login-form { display: grid; place-items: start center; padding: 1.5rem 1rem 2rem; }
.login-form #sign-in { width: 100%; max-width: 400px; display: grid; justify-items: center; }
@media (min-width: 768px) {
  body.login-page .focusbar { position: absolute; top: 0; right: 0; z-index: 2; max-width: 50%; margin: 0; }
  body.login-page .focusbar .brand { display: none; }
  body.login-page footer.legal-links { position: absolute; bottom: 0; right: 0; width: 50%; }
  .login-split { grid-template-columns: 1fr 1fr; min-height: 100dvh; }
  .login-art { padding: 2rem 2.5rem 2.5rem; justify-content: space-between; }
  .login-art .brand { display: inline; font-size: 1.375rem; }
  .login-demo { display: flex; }
  .login-welcome { font-size: 2rem; letter-spacing: -0.035em; }
  .login-welcome span { font-size: 1.0625rem; }
  .login-form { place-items: center; padding: 4rem 2rem; }
}

/* ── efeitos portados do Magic UI (design-system.md §8) ────────────────────────────────────── */
.gradient-text { background: var(--brand-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.aurora { position: relative; isolation: isolate; }
.aurora::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(55% 75% at 15% 0%, color-mix(in srgb, var(--g1) 30%, transparent), transparent 70%),
    radial-gradient(45% 65% at 95% 15%, color-mix(in srgb, #38bdf8 28%, transparent), transparent 70%),
    radial-gradient(40% 60% at 55% 105%, color-mix(in srgb, var(--g3) 24%, transparent), transparent 70%);
}
.dots { position: relative; }
.dots::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: radial-gradient(color-mix(in srgb, var(--fg) 12%, transparent) 1px, transparent 1px);
  background-size: 18px 18px;
  mask-image: linear-gradient(#000, transparent 85%);
}
.shimmer { position: relative; overflow: hidden; }
.shimmer::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(110deg, transparent 35%, color-mix(in srgb, var(--fg-inverse) 35%, transparent) 50%, transparent 65%);
  background-size: 250% 100%; animation: shimmer 2.8s linear infinite;
}
@keyframes shimmer { from { background-position: 150% 0; } to { background-position: -100% 0; } }
@property --angle { syntax: "<angle>"; initial-value: 0deg; inherits: false; }
.beam { position: relative; }
.beam::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1.5px; pointer-events: none;
  background: conic-gradient(from var(--angle), transparent 65%, var(--g1), var(--g2), var(--g3), transparent);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  animation: beam 5s linear infinite;
}
@keyframes beam { to { --angle: 360deg; } }
.marquee { overflow: hidden; white-space: nowrap; mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); }
.marquee > span { display: inline-block; animation: marquee 28s linear infinite; }
@keyframes marquee { to { transform: translateX(-50%); } }
.bento { display: grid; gap: 0.75rem; }
.bento > * { margin: 0; }
@media (min-width: 768px) {
  .bento { grid-template-columns: repeat(3, 1fr); }
  .bento .span-2 { grid-column: span 2; }
  .bento .tall { grid-row: span 2; }
}
.fade-in { animation: fade-in var(--t-slow) var(--ease) both; animation-delay: calc(var(--i, 0) * 60ms); }
@keyframes fade-in { from { opacity: 0; filter: blur(6px); transform: translateY(6px); } }

/* ── reduced motion: desliga tudo (design-system.md §3.5) ──────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
