:root {
  --ink: #1a1d24; --muted: #5b6270; --line: #e3e6ec; --bg: #f5f6f9; --card: #fff;
  --acc: #2f5bea; --acc-soft: #eef2fd;
  --ok: #1f9d55; --ok-soft: #e7f6ee; --no: #c0262d; --no-soft: #fdecec; --warn: #b45309; --warn-soft: #fff4e0;
  --sem: #b8bec9;
  --n1: #2f5bea; --n1-soft: #eef2fd; --n2: #7c3aed; --n2-soft: #f3edff; --n3: #b45309; --n3-soft: #fff4e0;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 14px; }
button { font: inherit; cursor: pointer; }
h2 { margin: 2px 0 2px; font-size: 18px; letter-spacing: -0.01em; }

.topo { display: flex; align-items: center; gap: 12px; padding: 12px 24px; background: var(--card); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.topo .marca { font-weight: 700; }
.topo .marca span { color: var(--acc); }
.topo .titulo { color: var(--muted); }
.topo .espaco { flex: 1; }
.btn { border: 1px solid var(--line); background: var(--card); padding: 9px 14px; border-radius: 8px; color: var(--ink); }
.btn:hover { border-color: var(--acc); }
.btn.primario { background: var(--acc); color: #fff; border-color: var(--acc); }
.btn.ok { background: var(--ok); color: #fff; border-color: var(--ok); }
.btn:disabled { opacity: .5; cursor: default; }
.link { background: none; border: none; color: var(--muted); text-decoration: underline; padding: 4px 0; font-size: 12.5px; }
.link:hover { color: var(--no); }

.palco { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 20px; padding: 20px 24px; max-width: 1440px; margin: 0 auto; align-items: start; }
.palco > * { min-width: 0; }
@media (max-width: 1020px) { .palco { grid-template-columns: minmax(0, 1fr); padding: 16px; } }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.cab-card { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 14px; }
.cab-card small { color: var(--muted); }
.rotulo { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--acc); }

.seletor { display: inline-flex; background: var(--bg); border-radius: 10px; padding: 3px; gap: 2px; }
.seletor button { border: none; background: none; padding: 7px 12px; border-radius: 8px; color: var(--muted); font-weight: 600; font-size: 13px; }
.seletor button.ativo { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(20, 30, 60, .12); }

.progresso { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; font-size: 12.5px; color: var(--muted); }
.progresso .pontos { display: flex; gap: 5px; flex: 1; }
.progresso .ponto { height: 6px; flex: 1; border-radius: 99px; background: var(--line); }
.progresso .ponto.feito { background: var(--ok); }
.progresso .ponto.atual { background: var(--acc); }
.progresso .ponto.saiu { background: var(--no); }

.exercicio { border: 1px solid var(--line); border-radius: 12px; padding: 16px; background: linear-gradient(180deg, #fbfcff, #fff); }
.exercicio .num { font-size: 12px; font-weight: 700; color: var(--muted); }
.exercicio .enunciado { font-size: 17px; line-height: 1.45; margin: 6px 0 14px; font-weight: 500; }
.campo { display: flex; align-items: stretch; border: 1.5px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.campo:focus-within { border-color: var(--acc); box-shadow: 0 0 0 3px var(--acc-soft); }
.campo span { display: grid; place-items: center; padding: 0 12px; background: var(--bg); color: var(--muted); font-weight: 600; }
.campo input { flex: 1; min-width: 0; border: none; outline: none; padding: 12px; font: inherit; font-size: 16px; }
.campo.formula input { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.acoes { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; align-items: center; }
.acoes .espaco { flex: 1; }
.erro-form { color: var(--no); font-size: 12.5px; margin-top: 6px; min-height: 1em; }
.resolvido { display: flex; gap: 10px; align-items: center; padding: 12px; background: var(--ok-soft); border-radius: 10px; color: var(--ok); font-weight: 600; flex-wrap: wrap; }
.resolvido .espaco { flex: 1; }
.fim { text-align: center; padding: 24px 16px; border-radius: 12px; line-height: 1.55; }
.fim.ok { background: var(--ok-soft); }
.fim.saiu { background: var(--no-soft); }
.fim b { display: block; font-size: 17px; margin-bottom: 4px; }

.degraus { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 14px 0 10px; }
.degrau { border-radius: 8px; padding: 7px 10px; font-size: 12px; background: var(--bg); color: var(--muted); border: 1px solid transparent; }
.degrau b { display: block; font-size: 12.5px; }
.degrau.n1.on { background: var(--n1-soft); color: var(--n1); border-color: var(--n1); }
.degrau.n2.on { background: var(--n2-soft); color: var(--n2); border-color: var(--n2); }
.degrau.n3.on { background: var(--n3-soft); color: var(--n3); border-color: var(--n3); }

.tutor { display: flex; flex-direction: column; gap: 8px; max-height: 360px; overflow-y: auto; padding: 4px 2px; }
.msg { display: flex; gap: 8px; align-items: flex-end; }
.msg .av { width: 28px; height: 28px; border-radius: 50%; background: var(--acc); color: #fff; font-weight: 700; font-size: 12px; display: grid; place-items: center; flex: none; }
.bolha { max-width: 85%; padding: 9px 12px; border-radius: 12px; line-height: 1.45; white-space: pre-wrap; word-wrap: break-word; }
.msg.ia .bolha { background: var(--bg); border-bottom-left-radius: 4px; }
.msg.aluno { justify-content: flex-end; }
.msg.aluno .bolha { background: var(--acc); color: #fff; border-bottom-right-radius: 4px; }
.msg.sistema { justify-content: center; }
.msg.sistema .bolha { background: var(--no-soft); color: var(--no); font-size: 12.5px; text-align: center; max-width: 95%; }
.chip { display: inline-block; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 2px 7px; border-radius: 99px; margin-bottom: 4px; }
.chip.pista { background: var(--n1-soft); color: var(--n1); }
.chip.caminho { background: var(--n2-soft); color: var(--n2); }
.chip.exemplo { background: var(--n3-soft); color: var(--n3); }
.chip.acerto, .chip.fim { background: var(--ok-soft); color: var(--ok); }
.chip.especifica { background: #fff; color: var(--muted); border: 1px solid var(--line); margin-left: 4px; }

/* Painel */
.abas { display: flex; border-bottom: 1px solid var(--line); overflow-x: auto; margin: 0 -18px; padding: 0 8px; }
.abas button { border: none; background: none; padding: 12px 14px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; }
.abas button.ativa { color: var(--acc); border-bottom-color: var(--acc); }
.abas .contador { background: var(--acc); color: #fff; border-radius: 99px; font-size: 11px; padding: 1px 7px; margin-left: 6px; }
.conteudo { padding-top: 16px; }
.explica { color: var(--muted); margin: 0 0 14px; line-height: 1.5; }
.nota { color: var(--muted); font-size: 12px; line-height: 1.5; margin-top: 12px; }

.travas { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.trava { min-width: 0; }
.trava .topo-linha { display: flex; gap: 8px; align-items: baseline; justify-content: space-between; }
.trava .nome { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trava .pct { font-variant-numeric: tabular-nums; font-weight: 700; flex: none; }
.barra { height: 8px; background: var(--bg); border-radius: 99px; overflow: hidden; margin: 5px 0 4px; }
.barra i { display: block; height: 100%; border-radius: 99px; background: var(--warn); }
.barra i.alto { background: var(--no); }
.trava .vivo { font-size: 12px; color: var(--muted); }
.trava .vivo b { color: var(--ink); }
.trava.atual { background: var(--acc-soft); box-shadow: 0 0 0 6px var(--acc-soft); border-radius: 4px; }

.legenda { display: flex; gap: 14px; font-size: 12px; color: var(--muted); margin-bottom: 10px; flex-wrap: wrap; }
.legenda i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.funil { display: grid; gap: 10px; }
.funil .linha { display: grid; grid-template-columns: 78px minmax(0, 1fr); gap: 10px; align-items: center; }
.funil .ex { font-size: 12px; color: var(--muted); font-weight: 600; }
.funil .par { display: grid; gap: 3px; }
.funil .b { height: 12px; border-radius: 4px; position: relative; min-width: 2px; }
.funil .b.sem { background: var(--sem); }
.funil .b.com { background: var(--acc); }
.funil .b span { position: absolute; left: calc(100% + 6px); top: -2px; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-top: 16px; }
.tile { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.tile .v { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.tile .l { color: var(--muted); font-size: 12px; margin-top: 2px; }
.tile.destaque { background: var(--acc-soft); border-color: transparent; }
.tile.destaque .v { color: var(--acc); }

.rolagem { overflow-x: auto; }
.tabela { width: 100%; border-collapse: collapse; font-size: 12.5px; margin-top: 14px; }
.tabela th { text-align: right; font-size: 11.5px; color: var(--muted); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tabela th:first-child, .tabela td:first-child { text-align: left; }
.tabela td { padding: 7px 8px; border-bottom: 1px solid var(--line); text-align: right; font-variant-numeric: tabular-nums; }
.feed { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 6px; }
.feed li { font-size: 12.5px; padding: 7px 10px; border-radius: 8px; background: var(--bg); display: flex; gap: 8px; }
.feed li time { color: var(--muted); font-variant-numeric: tabular-nums; flex: none; }
.feed li.erro { border-left: 3px solid var(--warn); }
.feed li.ajuda { border-left: 3px solid var(--n2); }
.feed li.acerto, .feed li.fim { border-left: 3px solid var(--ok); }
.feed li.abandono { border-left: 3px solid var(--no); }
.vazio { color: var(--muted); padding: 22px; text-align: center; border: 1px dashed var(--line); border-radius: 12px; line-height: 1.6; }
