/* Tokens (v6) */
:root {
  --bg: #f3f5f7;
  --card: #ffffff;
  --ink: #101828;
  --muted: #5d6779;
  --line: #e4e8ee;
  --brand: #4f46e5;
  --brand-2: #6366f1;
  --brand-ink: #ffffff;
  --brand-soft: #eef0fe;
  --accent: #f59e0b;
  --good: #15803d;
  --good-soft: #dcfce7;
  --bad: #dc2626;
  --bad-soft: #fde8e8;
  --warn-soft: #fef3c7;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 2px 10px rgba(16, 24, 40, .04);
  --shadow-up: 0 -4px 20px rgba(16, 24, 40, .08);
  --radius: 16px;
  --nav-h: 64px;
  color-scheme: light;
}
html.dark {
  --bg: #0a0f1a;
  --card: #121a29;
  --ink: #e8ecf3;
  --muted: #9aa5b8;
  --line: #222d42;
  --brand: #a5b4fc;
  --brand-2: #818cf8;
  --brand-ink: #11123a;
  --brand-soft: #1f2250;
  --good: #22c55e;
  --good-soft: #0f2e1b;
  --bad-soft: #3a1416;
  --warn-soft: #362709;
  --shadow: none;
  --shadow-up: 0 -1px 0 var(--line);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); }
button, input, select, textarea { font: inherit; color: inherit; }
.boot { padding: 40vh 0 0; text-align: center; color: var(--muted); }

/* Layout */
.top {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top));
  background: var(--card); border-bottom: 1px solid var(--line);
}
.top .logo { display: flex; align-items: center; gap: 8px; font-weight: 700; text-decoration: none; color: var(--ink); }
.top .logo img { width: 28px; height: 28px; }
.top .spacer { flex: 1; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 600;
  background: var(--brand-soft); color: var(--ink); white-space: nowrap;
}
.chip.fire { background: var(--warn-soft); }
.icon-btn { background: none; border: 0; padding: 6px; border-radius: 10px; cursor: pointer; font-size: 20px; line-height: 1; color: var(--muted); }
.icon-btn:hover { background: var(--bg); }
main { max-width: 760px; margin: 0 auto; padding: 16px 16px 110px; }
.nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 10;
  display: flex; justify-content: space-around;
  background: var(--card); border-top: 1px solid var(--line);
  padding: 6px 4px; padding-bottom: max(6px, env(safe-area-inset-bottom));
}
.nav a {
  flex: 1; max-width: 120px; display: flex; flex-direction: column; align-items: center; gap: 2px;
  text-decoration: none; color: var(--muted); font-size: 11.5px; font-weight: 600; padding: 4px 0; border-radius: 10px;
}
.nav a span { font-size: inherit; line-height: 1.2; }
.nav a.on { color: var(--brand); background: var(--brand-soft); }

/* Cards */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin: 0 0 14px; border: 1px solid var(--line); }
.card h2 { font-size: 17px; margin: 0 0 10px; }
.card h3 { font-size: 15px; margin: 14px 0 6px; }
.muted { color: var(--muted); }
.small { font-size: 13.5px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (max-width: 520px) { .grid2 { grid-template-columns: 1fr; } }
h1.page { font-size: 22px; margin: 4px 0 4px; }
.lead { color: var(--muted); margin: 0 0 16px; }
.kicker { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }

/* Hero / level */
.hero { background: linear-gradient(135deg, #4f46e5, #4338ca 60%, #312e81); color: #fff; border: 0; }
html.dark .hero { background: linear-gradient(135deg, #3730a3, #1e1b4b); }
.hero .kicker, .hero .muted { color: rgba(255,255,255,.8); }
.hero .lv { font-size: 24px; font-weight: 800; margin: 2px 0; }
.bar { height: 10px; border-radius: 999px; background: var(--line); overflow: hidden; }
.bar > i { display: block; height: 100%; width: 0; background: var(--brand); border-radius: 999px; transition: width .5s ease; }
.hero .bar { background: rgba(255,255,255,.25); }
.hero .bar > i { background: #c7d2fe; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.stat { background: rgba(255,255,255,.12); border-radius: 12px; padding: 8px 10px; }
.stat b { display: block; font-size: 18px; }
.stat small { opacity: .85; font-size: 12px; }

/* Next step */
.next { display: flex; gap: 12px; align-items: center; text-decoration: none; color: var(--ink); }
.next .ico { font-size: 28px; width: 48px; height: 48px; border-radius: 12px; background: var(--brand-soft); display: grid; place-items: center; flex: none; }
.next b { display: block; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 16px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink); font-weight: 600; cursor: pointer; text-decoration: none;
}
.btn.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.btn.good { background: var(--good); color: #fff; border-color: var(--good); }
.btn.danger { color: var(--bad); }
.btn.block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btns { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }

/* Journey */
.phase { padding: 0; overflow: hidden; }
.phase > summary { list-style: none; cursor: pointer; padding: 14px 16px; }
.phase > summary::-webkit-details-marker { display: none; }
.phase .ph-head { display: flex; align-items: center; gap: 12px; }
.phase .ph-num { width: 36px; height: 36px; border-radius: 10px; background: var(--brand-soft); display: grid; place-items: center; font-weight: 800; flex: none; }
.phase.complete .ph-num { background: var(--good); color: #fff; }
.phase .ph-title { font-weight: 700; }
.phase .bar { margin-top: 10px; }
.items { border-top: 1px solid var(--line); }
.item { display: flex; align-items: center; gap: 12px; padding: 11px 16px; text-decoration: none; color: var(--ink); border-bottom: 1px solid var(--line); }
.item:last-child { border-bottom: 0; }
.item:hover { background: var(--bg); }
.item .t-ico { font-size: 20px; width: 28px; text-align: center; flex: none; }
.item .t-main { flex: 1; min-width: 0; }
.item .t-main small { display: block; color: var(--muted); font-size: 12.5px; }
.item .xp { font-size: 12px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.item.done .t-title { color: var(--muted); }
.check { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; flex: none; font-size: 13px; }
.item.done .check, .check.on { background: var(--good); border-color: var(--good); color: #fff; }
.item.next-up { background: var(--brand-soft); }

/* Lesson content */
.content { font-size: 16.5px; }
.content h3 { font-size: 17px; margin: 22px 0 8px; }
.content p { margin: 0 0 12px; }
.content ul, .content ol { padding-left: 22px; margin: 0 0 12px; }
.content li { margin: 4px 0; }
.content blockquote { margin: 14px 0; padding: 10px 14px; border-left: 4px solid var(--accent); background: var(--warn-soft); border-radius: 0 10px 10px 0; }
.content table { width: 100%; border-collapse: collapse; margin: 8px 0 14px; font-size: 14.5px; }
.content th, .content td { border-bottom: 1px solid var(--line); padding: 7px 8px; text-align: left; vertical-align: top; }
.content th { font-size: 13px; color: var(--muted); }
.content code { background: var(--bg); padding: 1px 5px; border-radius: 6px; font-size: 14px; }
.box { border-radius: 12px; padding: 12px 14px; margin: 14px 0; }
.box.practice { background: var(--brand-soft); }
.box.mistakes { background: var(--bad-soft); }
.box h4 { margin: 0 0 6px; font-size: 14px; }
.box ul { margin: 0; padding-left: 20px; }
.pager { display: flex; gap: 10px; justify-content: space-between; margin-top: 10px; }
.pager a { flex: 1; }

/* Quiz */
.q { margin: 0 0 18px; }
.q .qt { font-weight: 650; margin-bottom: 8px; }
.opt { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; margin: 6px 0; cursor: pointer; background: var(--card); }
.opt input { margin-top: 4px; accent-color: var(--brand); }
.opt.sel { border-color: var(--brand); background: var(--brand-soft); }
.opt.right { border-color: var(--good); background: var(--good-soft); }
.opt.wrong { border-color: var(--bad); background: var(--bad-soft); }
.explain { font-size: 14px; color: var(--muted); margin-top: 6px; }
.score { font-size: 40px; font-weight: 800; }

/* Forms */
label.f { display: block; font-size: 13.5px; font-weight: 600; margin: 10px 0 4px; }
input.in, select.in, textarea.in {
  width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--card);
}
input.in:focus, select.in:focus, textarea.in:focus { outline: 2px solid var(--brand); outline-offset: 0; }
.toggle { display: flex; align-items: center; gap: 10px; margin: 12px 0; font-weight: 600; font-size: 14.5px; }
.toggle input { width: 20px; height: 20px; accent-color: var(--brand); }
.err { color: var(--bad); font-size: 14px; margin-top: 8px; min-height: 1em; }

/* Login */
.auth { max-width: 380px; margin: 12vh auto 0; padding: 0 16px; text-align: center; }
.auth img { width: 64px; height: 64px; }
.auth h1 { margin: 12px 0 4px; }
.auth input.in { text-align: center; font-size: 24px; letter-spacing: .4em; }

/* Money / chart */
.money { font-size: 26px; font-weight: 800; }
.chart { display: flex; align-items: flex-end; gap: 8px; height: 130px; padding: 0 2px; position: relative; margin-top: 12px; }
.chart .col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; }
.chart .b { width: 100%; max-width: 44px; background: var(--line); border-radius: 8px 8px 3px 3px; min-height: 3px; height: 0; transition: height .5s ease; }
.chart .b.hit { background: var(--good); }
.chart .b.some { background: var(--brand); }
.chart .lbl { font-size: 11.5px; color: var(--muted); }
.chart .goal { position: absolute; left: 0; right: 0; border-top: 2px dashed var(--accent); }
.chart .goal span { position: absolute; right: 0; top: -20px; font-size: 11.5px; color: var(--muted); background: var(--card); padding: 0 4px; }

/* Jobs */
.job { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.job:last-child { border-bottom: 0; }
.job .t-ico { font-size: 22px; }
.job .t-main { flex: 1; min-width: 0; }
.job .v { font-weight: 700; white-space: nowrap; }
.tag { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: var(--bg); color: var(--muted); margin-left: 4px; }

/* Badges */
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.badge { border: 1px solid var(--line); border-radius: 14px; padding: 12px; text-align: center; background: var(--card); }
.badge .bi { font-size: 34px; line-height: 1.2; }
.badge b { display: block; font-size: 14px; margin-top: 4px; }
.badge small { display: block; color: var(--muted); font-size: 12.5px; }
.badge.locked { opacity: .45; filter: grayscale(1); }
.levels .lvrow { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line); }
.levels .lvrow.cur { font-weight: 800; color: var(--brand); }

/* Toasts */
#toasts { position: fixed; left: 0; right: 0; bottom: 86px; display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 50; pointer-events: none; padding: 0 16px; }
.toast { background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-weight: 600; box-shadow: 0 6px 24px rgba(0,0,0,.2); animation: pop .25s ease; max-width: 520px; }
.toast.xp { background: var(--brand); color: var(--brand-ink); }
.toast.gold { background: var(--accent); color: #1f1300; }
.toast.err { background: var(--bad); color: #fff; }
@keyframes pop { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }

.recent li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.recent { list-style: none; margin: 0; padding: 0; }
.recent li b { color: var(--brand); white-space: nowrap; }
.back { display: inline-block; margin-bottom: 8px; text-decoration: none; font-weight: 600; font-size: 14.5px; }
.meta-line { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 14px; }
.steps .step { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.steps .step:last-child { border-bottom: 0; }
.steps .step.done span.txt { color: var(--muted); text-decoration: line-through; }
.empty { text-align: center; color: var(--muted); padding: 18px 0; }
.phase .t-main { flex: 1; min-width: 0; }
.mt { margin-top: 14px; }
.hint { margin-top: 12px; }

/* v2: diagramas, treino, flashcards, simulador */
.dg { margin: 14px 0; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
.dg svg { width: 100%; height: auto; display: block; }
.dg figcaption { font-size: 12.5px; color: var(--muted); text-align: center; margin-top: 6px; }
.dg-box { fill: var(--card); stroke: var(--muted); stroke-width: 1.2; }
.dg-t { fill: var(--ink); font-size: 13px; font-weight: 700; }
.dg-s { fill: var(--muted); font-size: 11px; }
.dg-ln { stroke: var(--muted); stroke-width: 1.3; fill: none; }
.dg-dim { stroke: var(--accent); stroke-width: 1.5; stroke-dasharray: 4 3; }
.dg-head { fill: var(--muted); }
.flash { min-height: 220px; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: 14px; cursor: pointer; }
.flash .ff { font-size: 19px; font-weight: 700; }
.flash .fb { font-size: 16.5px; padding: 12px 14px; background: var(--brand-soft); border-radius: 12px; width: 100%; }
.optbtn { width: 100%; text-align: left; font-weight: 500; }
.optbtn:hover { border-color: var(--brand); }
.okbox { border-color: var(--good); background: var(--good-soft); }
.badbox { border-color: var(--bad); background: var(--bad-soft); }
.qt { font-weight: 650; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.nowrap { white-space: nowrap; }

/* v3: diário e habilidades */
.journal { display: flex; flex-direction: column; gap: 12px; }
.jentry { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--card); }
.jentry img { display: block; width: 100%; max-height: 320px; object-fit: cover; background: var(--bg); }
.jbody { padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.jnote { white-space: pre-wrap; font-size: 15px; }
.small-btn { padding: 4px 10px; font-size: 13px; border-radius: 8px; }
details > summary.btn { list-style: none; display: inline-flex; }
details > summary.btn::-webkit-details-marker { display: none; }
.jform { margin-top: 10px; }
.hub { margin-bottom: 14px; }
.hubcard { display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: var(--ink); margin: 0; }
.hubcard .hi { font-size: 28px; }
@media (max-width: 520px) { .grid2.hub { grid-template-columns: 1fr 1fr; } }
.skill { padding: 10px 0; border-bottom: 1px solid var(--line); }
.skill:last-child { border-bottom: 0; }
.segs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin: 8px 0 6px; }
.seg { height: 8px; border-radius: 4px; background: var(--line); }
.seg.on { background: var(--brand); }
.skill summary { cursor: pointer; color: var(--muted); }
.reqs { margin: 6px 0 0; padding-left: 18px; font-size: 14px; }
.reqs li.ok a { color: var(--good); }
.tag { white-space: nowrap; }
.center { text-align: center; margin-top: 16px; }

/* v5: sessão de hoje, destaques, glossário, objetivos */
.ring { --p: 0; width: 72px; height: 72px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: conic-gradient(var(--brand) calc(var(--p) * 1%), var(--line) 0); }
.ring > span { width: 58px; height: 58px; border-radius: 50%; background: var(--card); display: grid; place-items: center; text-align: center; font-size: 11px; line-height: 1.1; color: var(--muted); }
.ring b { font-size: 17px; color: var(--ink); display: block; }
.ring small { display: block; }
.plan { list-style: none; margin: 12px 0 0; padding: 0; counter-reset: p; }
.plan li a { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.plan .pi { font-size: 20px; width: 28px; text-align: center; }
.plan .pt { flex: 1; min-width: 0; }
.plan .pt small { display: block; color: var(--muted); font-size: 12px; }
.plan .pm { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.callout { display: block; margin: 14px 0; padding: 10px 14px; border-radius: 12px; border-left: 4px solid var(--brand); background: var(--brand-soft); }
.callout b { display: block; font-size: 13.5px; margin-bottom: 2px; }
.callout.c-atencao, .callout.c-erro { border-left-color: var(--bad); background: var(--bad-soft); }
.callout.c-profissional, .callout.c-fonte, .callout.c-resumo { border-left-color: var(--accent); background: var(--warn-soft); }
.gloss dt { font-weight: 700; margin-top: 12px; }
.gloss dd { margin: 2px 0 0; color: var(--muted); font-size: 15px; }
.obj { margin: 6px 0 0; padding-left: 18px; color: var(--muted); }
.hub { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 520px) { .grid2.hub { grid-template-columns: 1fr 1fr; } }


/* =====================================================================
   v6 — refinamento de interface
   ===================================================================== */
body { font-size: 16px; line-height: 1.6; }
h1.page { font-size: 24px; line-height: 1.25; letter-spacing: -.01em; margin: 2px 0 6px; }
.card { padding: 18px; }
.card h2 { font-size: 17px; letter-spacing: -.005em; }
.kicker { font-size: 11.5px; letter-spacing: .07em; }
:focus-visible { outline: 3px solid var(--brand-2); outline-offset: 2px; border-radius: 8px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
.ic { width: 22px; height: 22px; flex: none; }

/* Cabeçalho */
.top { padding: 8px 14px; padding-top: max(8px, env(safe-area-inset-top)); backdrop-filter: saturate(1.4) blur(10px); background: color-mix(in srgb, var(--card) 88%, transparent); }
.top .logo img { width: 30px; height: 30px; }
.chip { min-height: 32px; text-decoration: none; }
.xpchip { padding-left: 6px; }
.mini-ring { --p: 0; width: 18px; height: 18px; border-radius: 50%; background: conic-gradient(var(--brand) calc(var(--p) * 1%), color-mix(in srgb, var(--brand) 20%, transparent) 0); -webkit-mask: radial-gradient(circle, transparent 4.5px, #000 5px); mask: radial-gradient(circle, transparent 4.5px, #000 5px); }
.icon-btn { display: grid; place-items: center; width: 40px; height: 40px; }
.icon-btn .ic { width: 22px; height: 22px; }

/* Navegação inferior */
.nav { height: auto; min-height: var(--nav-h); align-items: stretch; box-shadow: var(--shadow-up); border-top: 0; background: color-mix(in srgb, var(--card) 94%, transparent); backdrop-filter: blur(10px); }
.nav-brand { display: none !important; }
.nav a { gap: 3px; font-size: 11px; padding: 6px 0 4px; position: relative; min-height: 52px; justify-content: center; }
.nav a .ic { width: 24px; height: 24px; }
.nav a.on { background: none; color: var(--brand); }
.nav a.on::before { content: ''; position: absolute; top: 0; left: 30%; right: 30%; height: 3px; border-radius: 0 0 3px 3px; background: var(--brand); }
.nav a.on .ic { stroke-width: 2.4; }
main { padding: 18px 16px calc(var(--nav-h) + 40px); }
main.has-bar { padding-bottom: calc(var(--nav-h) + 120px); }
#toasts { bottom: calc(var(--nav-h) + 22px); }
body:has(main.has-bar) #toasts { bottom: calc(var(--nav-h) + 96px); }

/* Botões */
.btn { min-height: 46px; border-radius: 12px; transition: transform .08s ease, filter .15s ease; }
.btn:active { transform: scale(.985); }
.btn.primary:hover, .btn.good:hover { filter: brightness(1.06); }
.btn .ic { width: 20px; height: 20px; }
.btn.subtle { background: none; border-color: transparent; color: var(--muted); font-weight: 500; min-height: 40px; font-size: 14px; }
.tag.ok { background: var(--good-soft); color: var(--good); }

/* Hoje */
.greet { margin: 0 0 12px; }
.greet .page { font-size: 21px; }
.hero { padding: 18px; background: linear-gradient(140deg, #4f46e5 0%, #4338ca 55%, #312e81 100%); position: relative; overflow: hidden; }
.hero::after { content: ''; position: absolute; right: -40px; top: -40px; width: 160px; height: 160px; border-radius: 50%; background: rgba(255,255,255,.07); pointer-events: none; }
.hero .lv { font-size: 22px; }
.hero-xp { text-align: right; line-height: 1.1; }
.hero-xp b { font-size: 24px; display: block; }
.hero-xp small { opacity: .8; font-size: 12px; }
.hero .bar { margin-top: 10px; height: 8px; }
.stats { margin-top: 12px; }
.stat { text-decoration: none; color: inherit; }
a.stat:hover { background: rgba(255,255,255,.2); }
.session .top-row { align-items: flex-start; }
.session .s-title { font-size: 20px; margin: 2px 0 2px; }
.session .small { margin: 0; }
.go { margin-top: 14px; justify-content: space-between; padding: 12px 16px; font-size: 16px; }
.plan { margin-top: 8px; }
.plan li a { padding: 11px 2px; min-height: 52px; }
.plan li a:hover .pt b { color: var(--brand); }
.pn { width: 26px; height: 26px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 12.5px; font-weight: 800; background: var(--brand-soft); color: var(--brand); }
.plan .pt b { font-weight: 600; font-size: 15px; line-height: 1.35; display: block; }
.plan .pt small { margin-bottom: 1px; }
.chev { width: 18px; height: 18px; color: var(--muted); }
.psegs { display: grid; grid-template-columns: repeat(auto-fit, minmax(30px, 1fr)); gap: 6px; margin: 12px 0 14px; }
.pseg { text-decoration: none; color: var(--muted); text-align: center; }
.pseg .bar { height: 8px; display: block; }
.pseg small { font-size: 11.5px; font-weight: 700; }
.pseg.on small { color: var(--brand); }
.pseg.on .bar { outline: 2px solid var(--brand); outline-offset: 2px; }
.pseg.full .bar > i { background: var(--good); }
.fold { padding: 0; }
.fold > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary h2 { margin: 0; }
.fold[open] > summary .small { visibility: hidden; }
.fold .recent { padding: 0 18px 12px; }

/* Jornada */
.filters { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 12px; margin: 0 -2px; scrollbar-width: none; position: sticky; top: 56px; z-index: 5; background: linear-gradient(var(--bg) 80%, transparent); }
.filters::-webkit-scrollbar { display: none; }
.fchip { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); font-weight: 600; font-size: 14px; cursor: pointer; color: var(--muted); }
.fchip.on { background: var(--ink); color: var(--card); border-color: var(--ink); }
.fchip .ic { width: 16px; height: 16px; }
.go-next { margin-left: auto; color: var(--brand); border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); }
.phase > summary { padding: 16px 18px; }
.phase.current { border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); }
.phase .ph-num { width: 40px; height: 40px; border-radius: 12px; font-size: 16px; }
.phase.current .ph-num { background: var(--brand); color: var(--brand-ink); }
.phase .ph-title { font-size: 16.5px; }
.caret { color: var(--muted); transition: transform .2s ease; font-size: 14px; }
.phase[open] .caret { transform: rotate(180deg); }
.ph-about { padding: 0 18px 12px 70px; }
.ph-about p { margin: 0 0 6px; }
.objd > summary { cursor: pointer; color: var(--brand); font-weight: 600; padding: 2px 0; }
.objd .obj { margin-top: 4px; }
.item { padding: 12px 18px; min-height: 60px; }
.item .t-ico { width: 36px; height: 36px; border-radius: 10px; background: var(--bg); display: grid; place-items: center; font-size: 18px; }
.item .t-title { font-weight: 600; font-size: 15px; line-height: 1.35; }
.item.done .t-title { font-weight: 500; }
.item.done .t-ico { opacity: .55; }
.item.next-up { background: var(--brand-soft); box-shadow: inset 4px 0 0 var(--brand); }
.pill { font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--brand-ink); background: var(--brand); padding: 3px 8px; border-radius: 999px; white-space: nowrap; }
.flash-hl { animation: hl 1.4s ease; }
@keyframes hl { 0%, 60% { background: color-mix(in srgb, var(--brand) 30%, transparent); } }
.hid { text-align: center; padding: 10px 16px; margin: 0; }

/* Aula */
.readbar { position: fixed; left: 0; right: 0; top: 0; height: 3px; z-index: 20; pointer-events: none; }
.readbar > i { display: block; height: 100%; width: 0; background: var(--brand-2); transition: width .1s linear; }
.content { font-size: 17px; line-height: 1.7; padding: 20px; }
.content h3 { font-size: 18.5px; margin: 28px 0 10px; letter-spacing: -.005em; }
.content > h3:first-child { margin-top: 4px; }
.content p, .content li { max-width: 68ch; }
.content strong { font-weight: 700; }
.tbl { overflow-x: auto; margin: 10px 0 16px; border: 1px solid var(--line); border-radius: 12px; -webkit-overflow-scrolling: touch; }
.tbl table { margin: 0; min-width: 100%; }
.tbl th { background: var(--bg); position: sticky; top: 0; }
.tbl th, .tbl td { padding: 9px 12px; white-space: normal; }
.tbl tr:last-child td { border-bottom: 0; }
.callout { border-radius: 12px; padding: 12px 14px; }
.actionbar { position: fixed; left: 0; right: 0; bottom: var(--nav-h); z-index: 9; padding: 10px 16px; padding-bottom: calc(10px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--bg) 30%); }
.actionbar .btn { max-width: 728px; margin: 0 auto; display: flex; justify-content: space-between; text-align: left; box-shadow: 0 8px 24px rgba(16, 24, 40, .18); min-height: 56px; padding: 8px 18px; }
.ab-txt { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.ab-txt small { font-size: 12px; opacity: .85; font-weight: 600; }
.ab-txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pager { margin-top: 14px; }
.pager .btn { font-size: 14.5px; }

/* Listas e cartões gerais */
.hubcard { transition: border-color .15s ease, transform .1s ease; }
.hubcard:hover { border-color: var(--brand); }
.opt { min-height: 48px; padding: 12px 14px; }

/* Desktop: navegação lateral */
@media (min-width: 960px) {
  :root { --nav-h: 0px; }
  body { padding-left: 232px; }
  .nav { top: 0; bottom: 0; right: auto; width: 232px; flex-direction: column; justify-content: flex-start; gap: 4px; padding: 18px 12px; box-shadow: none; border-right: 1px solid var(--line); }
  .nav-brand { display: flex !important; flex-direction: row !important; align-items: center; gap: 10px !important; font-size: 16px !important; font-weight: 800 !important; color: var(--ink) !important; padding: 4px 10px 18px !important; min-height: 0 !important; max-width: none !important; flex: none !important; }
  .nav-brand img { width: 32px; height: 32px; }
  .nav a { flex: none; max-width: none; flex-direction: row; justify-content: flex-start; gap: 12px; font-size: 15px; padding: 10px 12px; min-height: 44px; border-radius: 10px; }
  .nav a:hover { background: var(--bg); color: var(--ink); }
  .nav a.on { background: var(--brand-soft); }
  .nav a.on::before { display: none; }
  .top .logo { visibility: hidden; }
  main { max-width: 820px; padding: 26px 32px 60px; }
  main.has-bar { padding-bottom: 130px; }
  .actionbar { left: 232px; bottom: 0; padding-bottom: 18px; }
  #toasts { bottom: 24px; left: 232px; }
  body:has(main.has-bar) #toasts { bottom: 100px; }
  .filters { top: 60px; }
  h1.page { font-size: 28px; }
}
.grid2.hub, .hub { grid-template-columns: repeat(3, 1fr); gap: 10px; }
.hubcard { padding: 14px 12px; }
.hubcard b { font-size: 14.5px; line-height: 1.3; }
.hubcard .hi { font-size: 24px; }
@media (max-width: 520px) { .grid2.hub, .hub { grid-template-columns: repeat(3, 1fr); } .hubcard .small { font-size: 12px; } }
.item.next-up .check { display: none; }


/* =====================================================================
   Escola Pro — matérias e diagramas
   ===================================================================== */
:root { --por: #e11d48; --mat: #2563eb; --fis: #7c3aed; --qui: #ea580c; --bio: #16a34a; --his: #a16207; }
html.dark { --por: #fb7185; --mat: #60a5fa; --fis: #a78bfa; --qui: #fb923c; --bio: #4ade80; --his: #facc15; }
.s-por { --sc: var(--por); } .s-mat { --sc: var(--mat); } .s-fis { --sc: var(--fis); }
.s-qui { --sc: var(--qui); } .s-bio { --sc: var(--bio); } .s-his { --sc: var(--his); }
.item .t-ico[class*="s-"] { background: color-mix(in srgb, var(--sc) 14%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--sc) 30%, transparent); }
.subjs { display: grid; gap: 6px; margin-top: 8px; }
.subj { display: flex; gap: 12px; align-items: center; padding: 10px; border-radius: 12px; text-decoration: none; color: var(--ink); border: 1px solid var(--line); }
.subj:hover { border-color: var(--sc); }
.sj-ico { width: 40px; height: 40px; flex: none; border-radius: 10px; display: grid; place-items: center; font-size: 20px; background: color-mix(in srgb, var(--sc) 14%, transparent); }
.sj-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.sj-main .bar { height: 6px; }
.sj-main .bar > i { background: var(--sc); }
.sj-next { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (min-width: 700px) { .subjs { grid-template-columns: 1fr 1fr; } }
.phase.locked { opacity: .75; padding: 16px 18px; }
.phase.locked .ph-num { background: var(--bg); }
.phase.locked .tag { margin: 8px 0 0; }
.content em { font-style: italic; }
.content del { color: var(--bad); }
.dg-fill { fill: color-mix(in srgb, var(--brand) 35%, var(--card)); stroke: var(--brand); stroke-width: 1.2; }
.dg-pt { fill: var(--brand); }
.dg-orb { fill: none; stroke: var(--muted); stroke-width: 1.2; stroke-dasharray: 3 3; }
.dg-line { stroke: var(--brand); stroke-width: 2.5; }
.dg-a .dg-box { stroke: var(--por); stroke-width: 2; }
.dg-b .dg-box { stroke: var(--mat); stroke-width: 2; }
.subjs > * { min-width: 0; }
.callout.c-ensinar { border-left-color: var(--bio); background: color-mix(in srgb, var(--bio) 12%, var(--card)); }
.callout.c-prova { border-left-color: var(--brand); background: var(--brand-soft); }
.dg-t2 { fill: var(--ink); font-size: 11.5px; font-weight: 700; }
.dg .dg-s { font-size: 10.5px; }

.bklist { list-style: none; padding: 0; margin: 10px 0 0; }
.bklist li { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px solid var(--line, rgba(128,128,128,.25)); }
.bklist li span { flex: 1; }
.bklist .btn { padding: 4px 10px; min-height: 0; }
code { font-size: .9em; }
