/* Meu Inglês — visual do Painel Financeiro (Padrão Executivo Contínuo) com cor de destaque própria (índigo).
   Fundo contínuo; só dado e lição viram cartão; cor só com significado (verde = certo, âmbar = quase, vermelho = errado).
   Tokens definidos uma vez por tema: o tema.js sempre define data-theme. */

:root {
  color-scheme: light;
  --bg: #eef0f6;
  --surface: #ffffff;
  --surface-2: #f4f5fb;
  --surface-3: #e8eaf3;
  --input-bg: #ffffff;
  --text: #1f2547;
  --text-2: #3a4166;
  --muted: #5d6488;
  --soft: #8389a8;
  --brand: #4338ca;
  --brand-2: #6366f1;
  --brand-fill: #4338ca;
  --brand-soft: rgba(67, 56, 202, 0.09);
  --on-brand: #ffffff;
  --line: rgba(40, 46, 100, 0.12);
  --line-strong: rgba(40, 46, 100, 0.22);
  --line-soft: rgba(40, 46, 100, 0.07);
  --ok: #157a5c;
  --ok-fill: #1f9d74;
  --ok-bg: rgba(31, 157, 116, 0.12);
  --warn: #a95f12;
  --warn-fill: #e0912f;
  --warn-bg: rgba(224, 145, 47, 0.15);
  --bad: #c42a3a;
  --bad-fill: #e23d4e;
  --bad-bg: rgba(226, 61, 78, 0.1);
  --en: #3730a3;            /* trechos em inglês (com áudio) */
  --shadow: 0 1px 2px rgba(40, 46, 100, 0.06), 0 2px 8px rgba(40, 46, 100, 0.05);
  --shadow-lg: 0 18px 40px rgba(25, 30, 80, 0.18);
  --r: 14px;
  --r-sm: 10px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --font: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --fs-xs: 12px;
  --fs-sm: 13.5px;
  --fs: 15px;
  --fs-md: 17px;
  --fs-lg: 22px;
  --fs-xl: 28px;
  --e1: 4px;
  --e2: 8px;
  --e3: 12px;
  --e4: 16px;
  --e5: 24px;
  --e6: 32px;
  --toque: 44px;
  --nav-h: 64px;
  --pad-x: clamp(16px, 2vw, 30px);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0d18;
  --surface: #161a2a;
  --surface-2: #1c2134;
  --surface-3: #252b42;
  --input-bg: #10131f;
  --text: #f1f2fb;
  --text-2: #cdd0e6;
  --muted: #9aa0c0;
  --soft: #6b7194;
  --brand: #818cf8;
  --brand-2: #a5b4fc;
  --brand-fill: #5b5ff0;
  --brand-soft: rgba(129, 140, 248, 0.16);
  --on-brand: #ffffff;
  --line: #252b42;
  --line-strong: #323a57;
  --line-soft: #1b2033;
  --ok: #34d399;
  --ok-fill: #10b981;
  --ok-bg: rgba(16, 185, 129, 0.15);
  --warn: #fbbf24;
  --warn-fill: #f59e0b;
  --warn-bg: rgba(245, 158, 11, 0.15);
  --bad: #fb7185;
  --bad-fill: #f43f5e;
  --bad-bg: rgba(244, 63, 94, 0.15);
  --en: #a5b4fc;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 0 0 1px #252b42, 0 24px 56px rgba(0, 0, 0, 0.6);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-gutter: stable; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--fs);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.soft { color: var(--soft); }
.ok { color: var(--ok); }
.warn { color: var(--warn); }
.bad { color: var(--bad); }
.caption { font-size: var(--fs-sm); color: var(--muted); }
.mt { margin-top: var(--e4); }
.mt-sm { margin-top: var(--e2); }
.num { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- Topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--nav-h);
  display: flex; align-items: center; gap: var(--e5); padding: 0 var(--pad-x);
  background: var(--bg); box-shadow: 0 1px 0 var(--line-soft);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 15px; letter-spacing: -0.01em; white-space: nowrap; text-decoration: none; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 10px; background: var(--brand-fill); color: var(--on-brand);
  display: grid; place-items: center; font-size: 12px; font-weight: 800; letter-spacing: 0.04em;
}
.nav { display: flex; gap: 2px; }
.nav a { text-decoration: none; color: var(--muted); font-weight: 600; padding: 8px 12px; border-radius: var(--r-sm); display: inline-flex; align-items: center; gap: 6px; }
.nav a .icon { display: none; }
.nav a:hover { color: var(--text); }
.nav a[aria-current="page"] { color: var(--text); background: var(--surface); box-shadow: var(--shadow); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: var(--e2); }
.icon-btn {
  width: 40px; height: 40px; display: grid; place-items: center; border-radius: var(--r-sm);
  border: 1px solid transparent; background: transparent; color: var(--muted);
}
.icon-btn:hover { color: var(--text); background: var(--surface); border-color: var(--line); }
.pill-seq { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; font-size: var(--fs-sm); color: var(--warn); background: var(--warn-bg); padding: 6px 10px; border-radius: 999px; }
.pill-seq .icon { width: 16px; height: 16px; }

/* ---------- Botões ---------- */
.btn {
  min-height: var(--toque); padding: 0 18px; border-radius: 12px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--text); font-weight: 700; font-size: var(--fs);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; white-space: nowrap;
  transition: filter 0.15s, border-color 0.15s, background 0.15s;
}
.btn:hover { border-color: var(--brand-2); }
.btn-primary { background: var(--brand-fill); border-color: var(--brand-fill); color: var(--on-brand); }
.btn-primary:hover { filter: brightness(1.1); border-color: var(--brand-fill); }
.btn-ok { background: var(--ok-fill); border-color: var(--ok-fill); color: #fff; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--text); background: var(--brand-soft); border-color: transparent; }
.btn-danger { color: var(--bad); border-color: var(--bad-bg); background: transparent; }
.btn-danger:hover { background: var(--bad-bg); }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: var(--fs-sm); border-radius: 10px; }
.btn-lg { min-height: 54px; padding: 0 26px; font-size: var(--fs-md); border-radius: 14px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* ---------- Página ---------- */
.page { max-width: 1180px; margin: 0 auto; padding: var(--e4) var(--pad-x) 56px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--e3); margin: var(--e2) 0 var(--e4); flex-wrap: wrap; }
.page-head h1 { font-size: 26px; letter-spacing: -0.015em; font-weight: 800; }
.page-head p { color: var(--muted); margin-top: 2px; }
.grade { display: grid; gap: 14px; align-items: start; }
.grade-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: stretch; }
.grade-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: stretch; }
.grade-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grade-main { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.bloco { margin-top: 14px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 20px; min-width: 0; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--e3); margin-bottom: 14px; flex-wrap: wrap; }
.card-head h2 { font-size: var(--fs-md); font-weight: 800; letter-spacing: -0.005em; }
.card-head .sub { color: var(--muted); font-size: var(--fs-sm); margin-top: 2px; }
.card-head > div { flex: 1 1 220px; min-width: 0; }
.subtitulo { font-size: var(--fs-xs); font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: 0.07em; margin: 18px 0 8px; }
.subtitulo:first-child { margin-top: 0; }

/* Número em destaque */
.stat { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; }
.stat-rotulo { font-size: var(--fs-xs); font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 7px; }
.stat-ponto { width: 9px; height: 9px; border-radius: 50%; background: var(--soft); flex: none; }
.stat-ponto.ok { background: var(--ok-fill); }
.stat-ponto.warn { background: var(--warn-fill); }
.stat-ponto.brand { background: var(--brand); }
.stat-valor { font-size: clamp(22px, 2.2vw, 28px); font-weight: 800; letter-spacing: -0.03em; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-delta { font-size: var(--fs-sm); color: var(--muted); }

/* Tags e barra de progresso */
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: var(--fs-xs); font-weight: 800; background: var(--surface-3); color: var(--muted); white-space: nowrap; }
.tag.ok { background: var(--ok-bg); color: var(--ok); }
.tag.warn { background: var(--warn-bg); color: var(--warn); }
.tag.bad { background: var(--bad-bg); color: var(--bad); }
.tag.brand { background: var(--brand-soft); color: var(--brand); }
.barra { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.barra > i { display: block; height: 100%; border-radius: inherit; background: var(--brand); transition: width 0.3s var(--ease); }
.barra.ok > i { background: var(--ok-fill); }

/* Segmentado */
.seg { display: inline-flex; flex-wrap: wrap; border-radius: 14px; padding: 4px; background: var(--surface-3); gap: 2px; }
.seg button { border: 0; background: none; min-height: 40px; padding: 0 14px; border-radius: 11px; font-weight: 700; font-size: var(--fs-sm); color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

/* Campos */
.input, .select, .textarea {
  width: 100%; min-height: var(--toque); padding: 0 14px; border-radius: 12px; border: 1px solid var(--line-strong);
  background: var(--input-bg); outline: none; transition: border-color 0.15s, box-shadow 0.15s;
}
.textarea { padding: 12px 14px; min-height: 96px; resize: vertical; line-height: 1.5; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.campo { display: grid; gap: 6px; margin-bottom: 16px; align-content: start; }
.campo > label, .campo .lbl { font-weight: 700; font-size: var(--fs-sm); color: var(--text-2); }
.campo .ajuda { font-size: var(--fs-sm); color: var(--muted); }
.campos-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 600; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--brand); }
.erro-msg { min-height: 20px; color: var(--bad); font-weight: 700; font-size: var(--fs-sm); margin: 4px 0 8px; }
.aviso { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; font-size: var(--fs-sm); }
.aviso .icon { margin-top: 1px; }
.aviso.info { background: var(--brand-soft); color: var(--text-2); }
.aviso.warn { background: var(--warn-bg); color: var(--warn); }
.aviso.ok { background: var(--ok-bg); color: var(--ok); }

/* Listas */
.lista { list-style: none; margin: 0; padding: 0; }
.lista-item {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center;
  padding: 12px 6px; border-bottom: 1px solid var(--line-soft);
}
.lista > li:last-child > .lista-item, .lista > .lista-item:last-child { border-bottom: 0; }
button.lista-item, a.lista-item { width: 100%; border: 0; border-bottom: 1px solid var(--line-soft); background: none; text-align: left; border-radius: 8px; text-decoration: none; }
button.lista-item:hover, a.lista-item:hover { background: var(--surface-2); }
.li-texto { min-width: 0; display: block; }
.li-titulo { display: block; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li-sub { display: block; font-size: var(--fs-sm); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li-icone { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); flex: none; }
.vazio { text-align: center; color: var(--muted); padding: 24px 16px; border: 1px dashed var(--line-strong); border-radius: var(--r-sm); }
.vazio strong { display: block; color: var(--text); margin-bottom: 4px; }
.carregando { padding: 60px 0; text-align: center; color: var(--muted); }

/* ---------- Hoje ---------- */
.hoje-ola h1 { font-size: 26px; font-weight: 800; letter-spacing: -0.015em; }
.sessao-card { padding: 22px; }
.sessao-topo { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.sessao-topo h2 { font-size: var(--fs-lg); font-weight: 800; letter-spacing: -0.01em; }
.blocos { display: grid; gap: 8px; margin: 0 0 18px; padding: 0; list-style: none; counter-reset: bloco; }
.bloco-item {
  display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 12px; align-items: center;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2);
}
.bloco-item .n { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); font-weight: 800; }
.bloco-item.feito { opacity: 0.6; }
.bloco-item.feito .n { background: var(--ok-bg); color: var(--ok); }
.bloco-item .t { font-weight: 700; display: block; }
.bloco-item .s { font-size: var(--fs-sm); color: var(--muted); display: block; }
.bloco-item .min { font-weight: 800; color: var(--muted); font-size: var(--fs-sm); white-space: nowrap; }
.aula-card .quando { font-size: var(--fs-lg); font-weight: 800; letter-spacing: -0.01em; }

/* ---------- Trilha ---------- */
.nivel { margin-bottom: 18px; }
.nivel-topo { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; }
.nivel-selo { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--brand-fill); color: var(--on-brand); font-weight: 800; font-size: 15px; }
.nivel.futuro .nivel-selo { background: var(--surface-3); color: var(--muted); }
.nivel-topo h2 { font-size: var(--fs-md); font-weight: 800; }
.nivel-topo p { color: var(--muted); font-size: var(--fs-sm); }
.nivel-pct { text-align: right; min-width: 90px; }
.nivel-pct b { font-size: var(--fs-md); }
.nivel .barra { margin-top: 12px; }
.unidades { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 6px; }
.unidade-item {
  width: 100%; display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 12px; align-items: center;
  padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); text-align: left; text-decoration: none;
}
a.unidade-item:hover { border-color: var(--brand-2); }
.unidade-item .marca { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--surface-3); color: var(--muted); font-weight: 800; font-size: var(--fs-sm); }
.unidade-item.disponivel .marca, .unidade-item.em_andamento .marca { background: var(--brand-soft); color: var(--brand); }
.unidade-item.concluida .marca, .unidade-item.dominada .marca { background: var(--ok-bg); color: var(--ok); }
.unidade-item.bloqueada, .unidade-item.em_breve { opacity: 0.62; }
.unidade-item.atual { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); background: var(--surface); }
.unidade-item .t { font-weight: 700; display: block; }
.unidade-item .s { font-size: var(--fs-sm); color: var(--muted); display: block; }
.trilhas { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.trilha-item { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: var(--surface-2); }
.trilha-item b { display: block; margin-bottom: 4px; }

/* ---------- Lição ---------- */
body[data-rota="unidade"] .bottom-nav { display: none; }
.licao { max-width: 820px; margin: 0 auto; }
.licao-topo { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; margin-bottom: 14px; }
.licao-topo h1 { font-size: var(--fs-lg); font-weight: 800; letter-spacing: -0.01em; line-height: 1.2; }
.licao-topo .nivel-tag { font-size: var(--fs-xs); font-weight: 800; color: var(--brand); text-transform: uppercase; letter-spacing: 0.07em; }
.etapas { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-bottom: 16px; }
.etapas button {
  border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 8px 6px; font-weight: 700; font-size: var(--fs-sm);
  color: var(--muted); display: grid; gap: 2px; justify-items: center; text-align: center;
}
.etapas button .n { font-size: var(--fs-xs); font-weight: 800; letter-spacing: 0.04em; }
.etapas button[aria-current="step"] { color: var(--brand); border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.etapas button.feita { color: var(--ok); }
.objetivo { background: var(--brand-soft); border-radius: var(--r); padding: 14px 16px; margin-bottom: 14px; color: var(--text-2); }
.objetivo b { color: var(--brand); }
.teoria { display: grid; gap: 14px; }
.teoria h2 { font-size: var(--fs-md); font-weight: 800; margin-bottom: 8px; }
.rico p + p, .rico p + ul, .rico ul + p { margin-top: 10px; }
.rico ul { margin: 8px 0 0; padding-left: 20px; }
.rico li { margin: 4px 0; }
.en {
  color: var(--en); font-weight: 700; background: none; border: 0; padding: 0; text-align: left;
  border-bottom: 1px dashed color-mix(in srgb, var(--en) 45%, transparent); cursor: pointer; font-size: inherit; line-height: inherit;
}
.en:hover, .en.tocando { border-bottom-style: solid; }
.tabela-wrap { overflow-x: auto; margin: 0 -4px; }
table.tabela { width: 100%; border-collapse: collapse; font-size: var(--fs); }
.tabela th { text-align: left; font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 800; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.tabela td { padding: 9px 10px; border-bottom: 1px solid var(--line-soft); }
.tabela tr:last-child td { border-bottom: 0; }
.exemplos { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.exemplo { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: start; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); }
.exemplo .pt { color: var(--muted); font-size: var(--fs-sm); display: block; }
.exemplo .nota { color: var(--text-2); font-size: var(--fs-sm); display: block; margin-top: 2px; }
.play {
  width: 36px; height: 36px; border-radius: 10px; border: 0; background: var(--brand-soft); color: var(--brand);
  display: grid; place-items: center; flex: none;
}
.play:hover { filter: brightness(0.95); }
.play .icon { width: 18px; height: 18px; }
.comp-linha { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 4px 14px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.comp-linha:last-child { border-bottom: 0; }
.comp-linha .pt::before { content: "PT "; font-size: 10.5px; font-weight: 800; color: var(--soft); letter-spacing: 0.06em; }
.comp-linha .nota { grid-column: 1 / -1; font-size: var(--fs-sm); color: var(--muted); }
.erro-linha { display: grid; gap: 2px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.erro-linha:last-child { border-bottom: 0; }
.erro-linha .errado { color: var(--bad); text-decoration: line-through; text-decoration-thickness: 1px; }
.erro-linha .certo { color: var(--ok); font-weight: 700; }
.erro-linha .nota { font-size: var(--fs-sm); color: var(--muted); }
.dica { border-left: 4px solid var(--warn-fill); background: var(--warn-bg); border-radius: 0 var(--r) var(--r) 0; padding: 14px 16px; }
.dica h2 { color: var(--warn); }
.vocab { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.vocab-item { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: center; padding: 10px; border-radius: 12px; background: var(--surface-2); }
.vocab-item b { display: block; }
.vocab-item small { color: var(--muted); display: block; }
.licao-rodape { display: flex; justify-content: space-between; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.licao-rodape .btn-primary { margin-left: auto; }

/* Exercício */
.ex-progresso { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.ex-progresso .barra { flex: 1; }
.ex-progresso small { font-weight: 800; color: var(--muted); white-space: nowrap; }
.ex-card { padding: 22px; }
.ex-tipo { font-size: var(--fs-xs); font-weight: 800; color: var(--brand); text-transform: uppercase; letter-spacing: 0.07em; margin-bottom: 6px; }
.ex-enunciado { font-size: var(--fs-md); font-weight: 700; margin-bottom: 4px; }
.ex-frase { font-size: 20px; font-weight: 700; line-height: 1.4; margin: 8px 0 4px; }
.ex-pt { color: var(--muted); margin-bottom: 12px; }
.ex-corpo { margin-top: 14px; display: grid; gap: 10px; }
.opcoes-ex { display: grid; gap: 8px; }
.opcao-ex {
  text-align: left; padding: 12px 14px; min-height: 50px; border-radius: 12px; border: 1px solid var(--line-strong);
  background: var(--surface); font-weight: 600; display: flex; align-items: center; gap: 10px;
}
.opcao-ex:hover:not([disabled]) { border-color: var(--brand-2); background: var(--surface-2); }
.opcao-ex .letra { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-3); font-size: var(--fs-xs); font-weight: 800; color: var(--muted); flex: none; }
.opcao-ex[aria-pressed="true"] { border-color: var(--brand); background: var(--brand-soft); box-shadow: inset 0 0 0 1px var(--brand); }
.opcao-ex.certa { border-color: var(--ok-fill); background: var(--ok-bg); box-shadow: inset 0 0 0 1px var(--ok-fill); }
.opcao-ex.errada { border-color: var(--bad-fill); background: var(--bad-bg); }
.lacuna-input {
  display: inline-block; min-width: 90px; width: auto; border: 0; border-bottom: 2px solid var(--brand); background: transparent;
  font-weight: 700; font-size: inherit; padding: 0 4px; outline: none; color: var(--brand); text-align: center;
}
.lacuna-input.certa { border-color: var(--ok-fill); color: var(--ok); }
.lacuna-input.errada { border-color: var(--bad-fill); color: var(--bad); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--line-strong); background: var(--surface); border-radius: 10px; padding: 8px 12px; font-weight: 700;
  min-height: 42px; box-shadow: 0 2px 0 var(--line);
}
.chip:hover:not([disabled]) { border-color: var(--brand-2); }
.chip[disabled] { opacity: 0.25; box-shadow: none; }
.montagem { min-height: 58px; border: 1px dashed var(--line-strong); border-radius: 12px; padding: 8px; display: flex; flex-wrap: wrap; gap: 8px; align-content: flex-start; background: var(--surface-2); }
.montagem:empty::before { content: "Toque nas palavras na ordem certa"; color: var(--soft); font-size: var(--fs-sm); padding: 10px 6px; }
.associar { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.associar .col { display: grid; gap: 8px; align-content: start; }
.par { min-height: 48px; padding: 8px 12px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--surface); font-weight: 700; text-align: center; }
.par[aria-pressed="true"] { border-color: var(--brand); background: var(--brand-soft); }
.par.feito { border-color: var(--ok-fill); background: var(--ok-bg); color: var(--ok); opacity: 0.7; }
.par.erro { animation: tremer 0.3s; border-color: var(--bad-fill); }
@keyframes tremer { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.dialogo { display: grid; gap: 8px; }
.fala { display: flex; gap: 10px; align-items: flex-start; }
.fala .quem { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); font-weight: 800; font-size: var(--fs-xs); flex: none; }
.fala .balao { background: var(--surface-2); border-radius: 4px 14px 14px 14px; padding: 10px 12px; }
.fala.voce .quem { background: var(--brand-soft); color: var(--brand); }
.fala.voce .balao { background: var(--brand-soft); flex: 1; }
.texto-leitura { background: var(--surface-2); border-radius: 12px; padding: 14px 16px; line-height: 1.7; }
.pergunta-leitura { margin-top: 6px; }
.pergunta-leitura > b { display: block; margin-bottom: 8px; }
.ouvir-grande { display: flex; gap: 10px; flex-wrap: wrap; }
.mic { width: 72px; height: 72px; border-radius: 50%; border: 0; background: var(--brand-fill); color: var(--on-brand); display: grid; place-items: center; box-shadow: var(--shadow-lg); }
.mic .icon { width: 30px; height: 30px; }
.mic.ouvindo { background: var(--bad-fill); animation: pulsar 1.2s infinite; }
@keyframes pulsar { 50% { box-shadow: 0 0 0 12px var(--bad-bg); } }
.transcricao { font-size: var(--fs-md); font-weight: 600; min-height: 26px; }
.transcricao .faltou { color: var(--bad); text-decoration: underline; }
.feedback {
  margin-top: 16px; border-radius: var(--r); padding: 14px 16px; display: grid; gap: 4px;
  animation: subir 0.18s ease-out;
}
.feedback.certo { background: var(--ok-bg); color: var(--ok); }
.feedback.quase { background: var(--warn-bg); color: var(--warn); }
.feedback.errado { background: var(--bad-bg); color: var(--bad); }
.feedback.feito { background: var(--brand-soft); color: var(--brand); }
.feedback b { font-size: var(--fs-md); }
.feedback .esperada { color: var(--text); font-weight: 700; }
.feedback .explicacao { color: var(--text-2); font-size: var(--fs-sm); }
.ex-acoes { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.ex-acoes .btn-primary { margin-left: auto; min-width: 160px; }
@keyframes subir { from { transform: translateY(6px); opacity: 0; } to { transform: none; opacity: 1; } }
.resultado-licao { text-align: center; padding: 28px 20px; }
.resultado-licao .grande { font-size: 44px; font-weight: 800; letter-spacing: -0.03em; }
.producao-item { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: var(--surface-2); }
.producao-item + .producao-item { margin-top: 10px; }
.modelo { margin-top: 8px; font-size: var(--fs-sm); color: var(--muted); }
.resumo-lista { margin: 0; padding-left: 20px; display: grid; gap: 6px; }

/* ---------- Revisar ---------- */
.flash { max-width: 620px; margin: 0 auto; }
.flash-card { min-height: 260px; display: grid; place-items: center; text-align: center; padding: 28px 22px; }
.flash-card .frente { font-size: 24px; font-weight: 800; letter-spacing: -0.01em; }
.flash-card .verso { font-size: 26px; font-weight: 800; color: var(--en); margin-top: 14px; }
.flash-card .extra { color: var(--muted); font-size: var(--fs-sm); margin-top: 8px; }
.notas { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.notas .btn { flex-direction: column; gap: 0; min-height: 60px; }
.notas .btn small { font-weight: 600; color: var(--muted); font-size: var(--fs-xs); }
.notas .n0 { border-color: var(--bad-bg); color: var(--bad); }
.notas .n1 { border-color: var(--warn-bg); color: var(--warn); }
.notas .n2 { border-color: var(--ok-bg); color: var(--ok); }
.notas .n3 { border-color: var(--brand-soft); color: var(--brand); }

/* ---------- Gráficos (barras em HTML; sem eixo de valores) ---------- */
.barras { display: grid; gap: 10px; }
.barra-linha { display: grid; grid-template-columns: minmax(90px, 160px) minmax(0, 1fr) 56px; gap: 10px; align-items: center; font-size: var(--fs-sm); }
.barra-linha .rot { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.barra-linha .val { text-align: right; font-weight: 800; }
.colunas { display: flex; align-items: flex-end; gap: 3px; height: 150px; padding-top: 18px; }
.coluna { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; min-width: 0; position: relative; }
.coluna i { display: block; width: 100%; max-width: 22px; border-radius: 5px 5px 2px 2px; background: var(--brand); min-height: 2px; }
.coluna.zero i { background: var(--surface-3); }
.coluna.hoje i { background: var(--warn-fill); }
.coluna span { font-size: 10px; color: var(--soft); margin-top: 4px; }
.coluna b { position: absolute; top: -2px; font-size: 10px; color: var(--muted); }

/* ---------- Sheet e toast ---------- */
.overlay { position: fixed; inset: 0; z-index: 100; background: rgba(8, 10, 28, 0.55); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 20px; }
.sheet { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; width: min(560px, 100%); max-height: calc(100vh - 40px); max-height: calc(100dvh - 40px); display: flex; flex-direction: column; box-shadow: var(--shadow-lg); overflow: hidden; }
.sheet.sheet-sm { width: min(420px, 100%); }
.sheet-head { display: flex; align-items: center; gap: 6px; min-height: 60px; padding: 10px 12px 10px 20px; border-bottom: 1px solid var(--line); }
.sheet-head h2 { margin: 0; font-size: var(--fs-md); font-weight: 800; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet-body { padding: 20px; overflow-y: auto; flex: 1; overscroll-behavior: contain; }
.sheet-foot { padding: 14px 20px; border-top: 1px solid var(--line); background: var(--surface-2); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.sheet-msg { font-size: var(--fs-md); line-height: 1.5; color: var(--text-2); }
.toasts { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 200; display: grid; gap: 8px; width: max-content; max-width: calc(100vw - 32px); }
.toast { background: var(--text); color: var(--bg); padding: 12px 18px; border-radius: 12px; font-weight: 700; box-shadow: var(--shadow-lg); animation: subir 0.15s ease-out; text-align: center; }
.toast.erro { background: var(--bad-fill); color: #fff; }

/* ---------- Menu inferior (celular) ---------- */
.bottom-nav { display: none; }

/* ---------- Login ---------- */
.pagina-login { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 20px 16px; }
.login-wrap { display: grid; justify-items: center; gap: 14px; width: 100%; }
.login-card { width: min(420px, 100%); padding: 26px 24px; }
.login-cabeca { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.login-cabeca .brand-mark { width: 40px; height: 40px; font-size: 14px; border-radius: 12px; }
.login-nome { font-weight: 800; font-size: var(--fs-md); }
.login-seguro { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-xs); font-weight: 700; color: var(--ok); }
.login-seguro .icon { width: 14px; height: 14px; }
.login-card h1 { font-size: var(--fs-lg); font-weight: 800; margin-bottom: 4px; }
.login-card p { color: var(--muted); margin-bottom: 16px; }
.input-pin { font-size: 22px; letter-spacing: 0.4em; text-align: center; font-weight: 800; }
.link-sutil { background: none; border: 0; padding: 0; color: var(--brand); font-weight: 700; font-size: var(--fs-sm); margin-bottom: 8px; }
.login-tema { position: fixed; top: 12px; right: 12px; }
.passos-2fa { padding-left: 20px; color: var(--text-2); display: grid; gap: 6px; margin: 0 0 12px; }
.qr-2fa { width: 190px; margin: 6px auto 8px; background: #fff; border-radius: 12px; padding: 6px; }
.qr-2fa svg { width: 100%; height: auto; display: block; }
.chave-2fa { text-align: center; margin-bottom: 10px; word-break: break-all; }
.codigos-rec { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 0; list-style: none; margin: 0 0 12px; font-family: ui-monospace, Consolas, monospace; font-weight: 700; text-align: center; }
.codigos-rec li { background: var(--surface-2); border-radius: 8px; padding: 6px; }

/* ---------- Créditos ---------- */
.creditos { display: flex; justify-content: center; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px var(--pad-x) 18px; font-size: var(--fs-xs); color: var(--soft); }
.creditos:empty { display: none; }
.creditos b { color: var(--muted); font-weight: 700; }
.creditos a { display: inline-flex; align-items: center; padding: 5px; border-radius: 6px; color: var(--muted); text-decoration: none; }
.creditos a:hover { color: var(--brand); background: var(--brand-soft); }
.creditos svg { width: 15px; height: 15px; fill: currentColor; flex: none; }
.creditos-links { display: inline-flex; gap: 4px; }
body:not(.pagina-login) { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
body:not(.pagina-login) > .page { flex: 1 0 auto; }

/* ---------- Responsivo ---------- */
@media (max-width: 1080px) {
  .grade-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grade-main, .grade-2 { grid-template-columns: minmax(0, 1fr); }
}
/* Tablet em pé: menu completo no topo (com ícones), sem barra inferior. */
@media (min-width: 721px) and (max-width: 1080px) {
  .topbar { height: auto; min-height: var(--nav-h); flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; row-gap: 6px; }
  .nav { order: 3; width: 100%; justify-content: space-between; }
  .nav a { flex: 1; justify-content: center; padding: 10px 6px; }
  .nav a .icon { display: block; width: 18px; height: 18px; }
}
@media (max-width: 720px) {
  :root { --nav-h: 58px; }
  .nav { display: none; }
  .so-desktop { display: none !important; }
  body { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
  body[data-rota="unidade"] { padding-bottom: env(safe-area-inset-bottom); }
  .bottom-nav {
    display: grid; grid-template-columns: repeat(5, 1fr); align-items: center;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    height: calc(66px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: var(--surface); border-top: 1px solid var(--line);
  }
  .bottom-nav a, .bottom-nav button { display: grid; justify-items: center; gap: 3px; text-decoration: none; font-size: 11.5px; font-weight: 700; color: var(--muted); padding: 6px 0; background: none; border: 0; }
  .bottom-nav [aria-current="page"] { color: var(--brand); }
  .bottom-nav .icon { width: 23px; height: 23px; }
  .page { padding-top: var(--e3); }
  .page-head h1, .hoje-ola h1 { font-size: var(--fs-lg); }
  .grade-3 { grid-template-columns: minmax(0, 1fr); }
  .grade-4 { gap: 10px; }
  .stat { padding: 12px 14px; }
  .stat-valor { font-size: 21px; }
  .card { padding: 16px 14px; }
  .sessao-card, .ex-card { padding: 18px 14px; }
  .sessao-topo .seg { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); width: 100%; }
  .sessao-topo .seg button { padding: 0 2px; font-size: 12.5px; }
  .etapas button { font-size: 11.5px; padding: 7px 2px; }
  .ex-frase { font-size: 18px; }
  .ex-acoes .btn-primary { width: 100%; margin-left: 0; }
  .licao-rodape .btn { flex: 1; }
  .notas .btn { min-height: 56px; padding: 0 6px; }
  .overlay { padding: 0; place-items: end stretch; }
  .sheet { width: 100%; max-height: 92vh; max-height: 92dvh; border-radius: 18px 18px 0 0; border-width: 1px 0 0; }
  .sheet.sheet-sm { width: 100%; }
  .sheet-foot { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
  .sheet-foot .btn { flex: 1; }
  .toasts { bottom: 88px; }
  .barra-linha { grid-template-columns: minmax(70px, 110px) minmax(0, 1fr) 46px; }
  .comp-linha { grid-template-columns: minmax(0, 1fr); }
  .campos-2 { grid-template-columns: minmax(0, 1fr); gap: 0; }
}
@media (max-width: 720px), (pointer: coarse) {
  .input, .select, .textarea, .lacuna-input { font-size: 16px; }
}
@media (pointer: coarse) {
  .btn-sm { min-height: 40px; }
}

/* ---------- Troca de tema sem piscar (ver tema-troca.js) ---------- */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.32s; animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1); }
.tema-trocando, .tema-trocando *, .tema-trocando *::before, .tema-trocando *::after {
  transition: background-color 0.32s ease, color 0.32s ease, border-color 0.32s ease, box-shadow 0.32s ease !important;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none !important; }
}
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--text) 22%, transparent); border-radius: 999px; border: 3px solid transparent; background-clip: padding-box; }
