/* =====================================================================
   Estudo Pro · visual (inspirado no exemplo "Lumina")
   Tema claro e escuro (segue o aparelho; botão troca)
   Computador: menu lateral · iPad: gaveta · Celular: barra inferior
   ===================================================================== */
:root {
  --bg: #fafafa; --panel: #ffffff; --panel2: #f4f4f5; --panel3: #e4e4e7; --line: #e4e4e7; --line2: #d4d4d8;
  --tx: #18181b; --tx2: #3f3f46; --mut: #71717a;
  --ac: #4f46e5; --ac2: #6366f1; --ac-tx: #ffffff; --ac-soft: rgba(99, 102, 241, .12); --ac-txt: #4f46e5;
  --ok: #059669; --ok-soft: rgba(16, 185, 129, .14);
  --warn: #d97706; --warn-soft: rgba(245, 158, 11, .14);
  --bad: #e11d48; --bad-soft: rgba(244, 63, 94, .12);
  --shadow: 0 1px 2px rgba(24, 24, 27, .04), 0 1px 3px rgba(24, 24, 27, .04);
  --shadow-lg: 0 18px 40px -12px rgba(24, 24, 27, .22);
  --shadow-ac: 0 10px 24px -8px rgba(79, 70, 229, .45);
  --glass: rgba(250, 250, 250, .86);
  --tab-on: #ffffff;
  --r: 24px; --r-md: 18px; --r-sm: 14px;
  --side: 264px;
  --fd: "Plus Jakarta Sans", Inter, system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #09090b; --panel: #121216; --panel2: #18181b; --panel3: #27272a; --line: #27272a; --line2: #3f3f46;
    --tx: #f4f4f5; --tx2: #d4d4d8; --mut: #a1a1aa;
    --ac: #6366f1; --ac2: #818cf8; --ac-soft: rgba(99, 102, 241, .16); --ac-txt: #818cf8;
    --ok: #34d399; --ok-soft: rgba(16, 185, 129, .15);
    --warn: #fbbf24; --warn-soft: rgba(245, 158, 11, .15);
    --bad: #fb7185; --bad-soft: rgba(244, 63, 94, .15);
    --shadow: none; --shadow-lg: 0 18px 40px -12px rgba(0, 0, 0, .7); --shadow-ac: 0 10px 24px -8px rgba(99, 102, 241, .5);
    --glass: rgba(18, 18, 22, .88);
    --tab-on: #27272a;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #09090b; --panel: #121216; --panel2: #18181b; --panel3: #27272a; --line: #27272a; --line2: #3f3f46;
  --tx: #f4f4f5; --tx2: #d4d4d8; --mut: #a1a1aa;
  --ac: #6366f1; --ac2: #818cf8; --ac-soft: rgba(99, 102, 241, .16); --ac-txt: #818cf8;
  --ok: #34d399; --ok-soft: rgba(16, 185, 129, .15);
  --warn: #fbbf24; --warn-soft: rgba(245, 158, 11, .15);
  --bad: #fb7185; --bad-soft: rgba(244, 63, 94, .15);
  --shadow: none; --shadow-lg: 0 18px 40px -12px rgba(0, 0, 0, .7); --shadow-ac: 0 10px 24px -8px rgba(99, 102, 241, .5);
  --glass: rgba(18, 18, 22, .88);
  --tab-on: #27272a;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; background: var(--bg); color: var(--tx); }
body { font: 15px/1.55 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; transition: background .3s, color .3s; }
svg.i { width: 20px; height: 20px; flex: none; }
::selection { background: var(--ac-soft); }
.fade { animation: fadeIn .25s ease-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- estrutura ---------- */
.app { min-height: 100vh; }
.side { position: fixed; inset: 0 auto 0 0; width: var(--side); z-index: 40; background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 20px 14px; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 12px; padding: 2px 8px 18px; }
.brand b { display: block; font-family: var(--fd); font-size: 16.5px; letter-spacing: -.01em; }
.brand small { display: block; color: var(--mut); font-size: 12px; }
.logo { width: 42px; height: 42px; border-radius: 16px; background: linear-gradient(45deg, #4f46e5, #8b5cf6); color: #fff; font-family: var(--fd); font-weight: 800; font-size: 18px; display: flex; align-items: center; justify-content: center; flex: none; box-shadow: 0 6px 14px -4px rgba(99, 102, 241, .45); }
nav#nav { display: flex; flex-direction: column; gap: 2px; }
.navh { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--mut); padding: 16px 12px 6px; font-weight: 600; }
.nav-i { all: unset; box-sizing: border-box; cursor: pointer; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; color: var(--tx2); font-weight: 500; font-size: 14.5px; transition: background .15s, color .15s; }
.nav-i:hover { background: var(--panel2); color: var(--tx); }
.nav-i.on { background: var(--ac-soft); color: var(--ac-txt); font-weight: 600; }
.nav-i .badge { margin-left: auto; }
.badge { background: var(--ac); color: var(--ac-tx); border-radius: 99px; font-size: 11px; font-weight: 700; padding: 0 7px; line-height: 18px; min-width: 18px; text-align: center; }
.side-foot { margin-top: auto; padding-top: 14px; }
.mini { display: none; background: var(--panel2); border: 1px solid var(--line); border-radius: 18px; padding: 12px 14px; font-size: 13px; margin: 14px 0 0; }
.mini.show { display: block; }
.mini b { font-family: var(--fd); font-size: 22px; font-variant-numeric: tabular-nums; }
.themebtn { all: unset; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; color: var(--mut); font-size: 14px; width: 100%; box-sizing: border-box; }
.themebtn:hover { background: var(--panel2); color: var(--tx); }

.main-wrap { margin-left: var(--side); min-width: 0; }
main { max-width: 1180px; margin: 0 auto; padding: 36px 40px 64px; }
.topbar, .tabbar, .scrim { display: none; }

/* ---------- tipografia ---------- */
h1 { margin: 0 0 4px; font-family: var(--fd); font-size: 30px; line-height: 1.15; letter-spacing: -.025em; font-weight: 800; }
h2 { margin: 0 0 12px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .09em; color: var(--mut); font-weight: 600; }
h3 { margin: 0 0 6px; font-family: var(--fd); font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.sub { color: var(--mut); margin: 0 0 24px; font-size: 15px; }
.mut { color: var(--mut); }
.sm { font-size: 13px; }
.xs { font-size: 11.5px; }
.okc { color: var(--ok); }
p { margin: 0; }
mark { background: rgba(250, 204, 21, .35); color: inherit; border-radius: 3px; padding: 0 1px; }
a { color: var(--ac-txt); }
.trunc { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- blocos ---------- */
.grid { display: grid; gap: 16px; }
.g4 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; box-shadow: var(--shadow); min-width: 0; }
.card + .card, .grid + .card, .card + .grid, .grid + .grid, .tabs + .grid, .tabs + .card { margin-top: 16px; }
.kpi .l { color: var(--mut); font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.kpi .v { font-family: var(--fd); font-size: 30px; font-weight: 800; line-height: 1.15; margin-top: 6px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi .s { color: var(--mut); font-size: 12.5px; margin-top: 6px; }
.kpi .s .bar, .kpi > .bar { margin-top: 8px; }
.bar { height: 7px; background: var(--panel2); border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--ac); border-radius: 99px; transition: width .5s cubic-bezier(.4, 0, .2, 1); }
.hr { border: 0; border-top: 1px solid var(--line); margin: 12px 0; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.sp { flex: 1; }
.lbl { font-size: 11.5px; text-transform: uppercase; letter-spacing: .09em; color: var(--mut); font-weight: 600; margin-bottom: 10px; }
.card p { line-height: 1.75; }
.law { border-left: 4px solid var(--ac); }
.law .lbl { color: var(--ac-txt); }
.law p { font-size: 15.5px; }
.kid { border-left: 4px solid var(--ok); }
.kid .lbl { color: var(--ok); }
.warn { border-left: 4px solid var(--warn); }
.warn .lbl { color: var(--warn); }
ul.sum { padding-left: 20px; margin: 0; }
ul.sum li { margin: 8px 0; line-height: 1.6; }
.itile { width: 40px; height: 40px; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; flex: none; color: var(--c, var(--ac)); background: color-mix(in srgb, var(--c, var(--ac)) 15%, transparent); }
.itile svg.i { width: 19px; height: 19px; }
.itile.lg { width: 48px; height: 48px; border-radius: 16px; }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; border: 1px solid transparent; white-space: nowrap; }
.pill svg.i { width: 14px; height: 14px; }
.pill.amber { background: var(--warn-soft); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 25%, transparent); }
.pill.brand { background: var(--ac-soft); color: var(--ac-txt); border-color: color-mix(in srgb, var(--ac) 25%, transparent); }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.eyebrow { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .09em; color: var(--ac-txt); }
.eyebrow svg.i { width: 15px; height: 15px; }

/* ---------- botões e formulários ---------- */
.b, button.b {
  -webkit-appearance: none; appearance: none; cursor: pointer; font: inherit; font-size: 14px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; text-decoration: none;
  min-height: 42px; padding: 8px 16px; border-radius: var(--r-sm);
  border: 1px solid var(--line); background: var(--panel); color: var(--tx); transition: background .15s, border-color .15s, transform .1s, box-shadow .15s;
}
.b svg.i { width: 18px; height: 18px; }
.b:hover { background: var(--panel2); }
.b:active { transform: scale(.97); }
.b.p { background: var(--ac); border-color: var(--ac); color: var(--ac-tx); box-shadow: var(--shadow-ac); }
.b.p:hover { background: #4338ca; border-color: #4338ca; }
.b.d { color: var(--bad); }
.b.d:hover { background: var(--bad-soft); border-color: transparent; }
.b.sm { min-height: 34px; padding: 5px 12px; font-size: 13px; border-radius: 12px; font-weight: 600; }
.b.big { min-height: 50px; padding: 12px 20px; font-size: 15px; border-radius: 16px; }
.b.icon { min-width: 50px; min-height: 50px; padding: 0; border-radius: 16px; background: var(--panel2); border-color: transparent; position: relative; }
.b.icon:hover { background: var(--panel3); }
.b.icon .badge { position: absolute; top: -5px; right: -5px; }
button.b:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
:focus-visible { outline: 2px solid var(--ac); outline-offset: 2px; }
input, select, textarea { font: inherit; color: var(--tx); background: var(--panel); border: 1px solid var(--line2); border-radius: var(--r-sm); padding: 9px 12px; min-height: 42px; max-width: 100%; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ac); box-shadow: 0 0 0 3px var(--ac-soft); }
input[type=checkbox] { width: 20px; height: 20px; min-height: 0; padding: 0; accent-color: var(--ac); flex: none; cursor: pointer; margin: 0; }
.chip { display: inline-flex; align-items: center; gap: 4px; background: var(--panel2); border: 1px solid var(--line); color: var(--tx2); border-radius: 99px; padding: 2px 10px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.chip.nowc { background: var(--ac); border-color: var(--ac); color: var(--ac-tx); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; }
a.lnk { color: var(--tx); cursor: pointer; text-decoration: none; font-weight: 600; }
a.lnk:hover { color: var(--ac-txt); }

/* ---------- abas (controle segmentado) ---------- */
.tabs { display: flex; gap: 4px; margin: 22px 0 18px; padding: 5px; background: var(--panel2); border: 1px solid var(--line); border-radius: 18px; overflow-x: auto; scrollbar-width: none; max-width: 100%; width: max-content; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { all: unset; cursor: pointer; padding: 8px 16px; border-radius: 13px; color: var(--mut); font-weight: 600; font-size: 13.5px; white-space: nowrap; transition: background .15s, color .15s; }
.tabs button:hover { color: var(--tx); }
.tabs button.on { background: var(--tab-on); color: var(--ac-txt); box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }

/* ---------- listas ---------- */
.doc { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 12px; margin: 0 -12px; border-radius: 16px; cursor: pointer; }
.doc:hover { background: var(--panel2); }
.doc + .doc { border-top: 1px solid var(--line); }
.lead { min-width: 150px; }
.task { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.task:last-child { border-bottom: 0; }
.task > div { flex: 1; min-width: 0; }
.task.done span { text-decoration: line-through; color: var(--mut); }
.step { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--line); cursor: pointer; line-height: 1.5; }
.step:last-child { border-bottom: 0; }
.step input { margin-top: 1px; }
.step.done span { color: var(--mut); text-decoration: line-through; }
.caph { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 18px 0 4px; padding: 9px 14px; background: var(--panel2); border-radius: 14px; font-size: 13px; font-weight: 700; color: var(--tx2); }
.crumbs { font-size: 13px; color: var(--mut); margin-bottom: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumbs a { color: var(--ac-txt); cursor: pointer; font-weight: 600; }
.crumbs a:hover { text-decoration: underline; }
.crumbs .sep { margin: 0 6px; opacity: .5; }
.tl { margin: 10px 0 14px; padding-left: 18px; color: var(--mut); font-size: 13.5px; }
.tl li { margin: 3px 0; }
.sec-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 12px; }
.sec-h h3 { margin: 0; display: flex; align-items: center; gap: 8px; }
.sec-h a { font-size: 13px; font-weight: 600; cursor: pointer; text-decoration: none; }
.sec-h a:hover { text-decoration: underline; }

/* ---------- disciplinas e ciclo ---------- */
.dcard { cursor: pointer; transition: border-color .15s, transform .15s, box-shadow .15s; }
.dcard:hover { border-color: color-mix(in srgb, var(--ac) 50%, var(--line)); transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.num { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; height: 32px; border-radius: 11px; background: var(--panel2); border: 1px solid var(--line); font-weight: 700; margin-right: 4px; font-size: 13px; flex: none; color: var(--tx2); font-family: var(--fd); }
.num.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.drow { padding: 10px 0; cursor: pointer; }
.drow + .drow { border-top: 1px solid var(--line); }
.drow:hover b { color: var(--ac-txt); }
.drow .bar { margin-top: 8px; }
.dorder { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 2px; }
.dstep { display: inline-flex; flex-direction: column; padding: 10px 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel2); font-size: 14px; font-weight: 600; }
.dstep small { color: var(--mut); font-size: 11.5px; font-weight: 500; }
.dstep b { color: var(--ac-txt); font-family: var(--fd); }
.dstep.done { border-color: var(--ok); }
.dstep.done b { color: var(--ok); }
.arr { color: var(--mut); }
.dhead { display: flex; align-items: center; gap: 14px; margin-bottom: 4px; }
.dhead h1 { margin: 0; }

/* linha de estudo */
.tline2 { position: relative; margin-top: 18px; }
.st { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 14px; position: relative; padding-bottom: 14px; }
.st:before { content: ""; position: absolute; left: 19px; top: 40px; bottom: 0; width: 2px; background: var(--line); }
.st:last-child:before { display: none; }
.st-n { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--panel); border: 2px solid var(--line2); font-weight: 800; font-family: var(--fd); z-index: 1; color: var(--tx2); }
.st.done .st-n { background: var(--ok); border-color: var(--ok); color: #fff; }
.st.done .st-c { opacity: .82; }
.st.now .st-n { border-color: var(--ac); color: var(--ac-txt); box-shadow: 0 0 0 5px var(--ac-soft); }
.st.now .st-c { border-color: color-mix(in srgb, var(--ac) 55%, var(--line)); box-shadow: var(--shadow-lg); }
.st-c { padding: 18px 20px; }
.subs { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 6px; }
.lsub { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; margin: 0 -12px; border-radius: 14px; }
.lsub > div { flex: 1 1 200px; min-width: 0; }
.lsub.now { background: var(--ac-soft); }
.lsub.done b { color: var(--mut); }
.sn { font-size: 12px; color: var(--mut); min-width: 28px; font-variant-numeric: tabular-nums; font-weight: 700; }
details.caud, details.caud2 { margin-top: 12px; }
details.caud { padding: 14px 18px; }
details.caud2 { border-top: 1px solid var(--line); padding-top: 12px; }
details summary { cursor: pointer; }
audio { width: 100%; height: 40px; }

/* ---------- tabelas ---------- */
.tbw { overflow-x: auto; }
.tb { width: 100%; border-collapse: collapse; font-size: 14px; }
.tb th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--mut); padding: 10px 8px; border-bottom: 1px solid var(--line); font-weight: 700; white-space: nowrap; }
.tb td { padding: 12px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tb tr:last-child td { border-bottom: 0; }
.tb td:first-child { color: var(--tx2); }

/* ---------- materiais e busca ---------- */
.drop { border: 2px dashed var(--line2); border-radius: var(--r-md); padding: 28px 16px; text-align: center; color: var(--mut); margin-top: 6px; }
.drop.over { border-color: var(--ac); background: var(--ac-soft); }
.pg { border-left: 3px solid var(--line2); padding: 4px 0 4px 14px; margin: 14px 0; white-space: pre-wrap; color: var(--tx2); font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }
.pg .row { margin-bottom: 6px; white-space: normal; }

/* =====================================================================
   DASHBOARD
   ===================================================================== */
.dash { display: grid; gap: 20px; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); grid-template-areas: "goal kpis" "carr carr" "chart review" "heat prova"; }
.a-goal { grid-area: goal; } .a-kpis { grid-area: kpis; } .a-carr { grid-area: carr; } .a-chart { grid-area: chart; } .a-review { grid-area: review; } .a-heat { grid-area: heat; } .a-prova { grid-area: prova; }
.dash > * { min-width: 0; margin: 0 !important; }
.goal-top { display: flex; align-items: center; gap: 16px; }
.goal-v { font-family: var(--fd); font-size: 32px; font-weight: 800; letter-spacing: -.02em; margin: 6px 0 4px; line-height: 1.1; }
.goal-v span { font-size: 16px; font-weight: 600; color: var(--mut); }
.goal-act { display: flex; gap: 10px; align-items: center; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.goal-act .grow1 { flex: 1; }
.goal-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 12px; font-size: 13px; color: var(--mut); }
.goal-foot input { width: 76px; min-height: 32px; padding: 4px 8px; font-size: 13px; border-radius: 10px; }
.ring { position: relative; width: 84px; height: 84px; flex: none; display: flex; align-items: center; justify-content: center; }
.ring svg { width: 84px; height: 84px; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 8; }
.ring .ring-bg { stroke: var(--panel2); }
.ring .ring-fg { stroke: var(--ac); stroke-linecap: round; transition: stroke-dashoffset .8s cubic-bezier(.4, 0, .2, 1); }
.ring span { position: absolute; font-family: var(--fd); font-weight: 800; font-size: 15px; }
.kpis2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; height: 100%; }
.kpi2 { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 2px; }
.kpi2 .itile { width: 34px; height: 34px; border-radius: 12px; margin-bottom: 8px; }
.kpi2 .itile svg.i { width: 17px; height: 17px; }
.kpi2 b { font-family: var(--fd); font-size: 24px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.kpi2 span { font-size: 12.5px; color: var(--mut); }
.carousel { display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding: 2px 2px 8px; margin: 0 -2px; }
.carousel::-webkit-scrollbar { display: none; }
.ccard { scroll-snap-align: start; flex: 0 0 240px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px; cursor: pointer; transition: transform .15s, box-shadow .15s, border-color .15s; }
.ccard:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--c, var(--ac)) 45%, var(--line)); }
.ccard .ctitle { font-family: var(--fd); font-size: 15px; font-weight: 700; display: block; }
.ccard .cnext { font-size: 12px; color: var(--mut); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.ccard .cp { display: flex; justify-content: space-between; font-size: 11.5px; font-weight: 700; margin-bottom: 6px; }
.ccard .cp span { color: var(--mut); font-weight: 600; }
/* flashcard que vira */
.flip { perspective: 1000px; cursor: pointer; user-select: none; -webkit-user-select: none; }
.flip-in { position: relative; min-height: 220px; transform-style: preserve-3d; transition: transform .6s cubic-bezier(.23, 1, .32, 1); }
.flip.on .flip-in { transform: rotateY(180deg); }
.face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: var(--r); padding: 20px; display: flex; flex-direction: column; justify-content: space-between; gap: 12px; }
.face.front { background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); }
.face.backf { background: linear-gradient(135deg, #4f46e5, #4338ca); color: #fff; transform: rotateY(180deg); box-shadow: var(--shadow-ac); }
.face .fq { text-align: center; font-family: var(--fd); font-weight: 700; font-size: 17px; line-height: 1.4; overflow-y: auto; max-height: 130px; padding: 0 4px; }
.face .fa { text-align: center; font-size: 14.5px; line-height: 1.6; overflow-y: auto; max-height: 140px; white-space: pre-line; padding: 0 4px; }
.face .fh { text-align: center; font-size: 11.5px; color: var(--mut); }
.face.backf .fh { color: #c7d2fe; }
.ftag { font-size: 11.5px; font-weight: 700; padding: 4px 10px; border-radius: 10px; background: var(--ac-soft); color: var(--ac-txt); }
.face.backf .ftag { background: rgba(255, 255, 255, .16); color: #fff; }
.qrate { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; }
.qrate button { all: unset; box-sizing: border-box; cursor: pointer; text-align: center; padding: 10px 4px; border-radius: 16px; font-weight: 700; font-size: 12.5px; display: flex; flex-direction: column; gap: 1px; border: 1px solid transparent; transition: transform .1s, background .15s; }
.qrate button:active { transform: scale(.95); }
.qrate small { font-size: 10.5px; font-weight: 600; opacity: .75; }
.qrate .q0 { background: var(--bad-soft); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 22%, transparent) !important; }
.qrate .q1 { background: var(--warn-soft); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 22%, transparent) !important; }
.qrate .q2 { background: var(--ac-soft); color: var(--ac-txt); border-color: color-mix(in srgb, var(--ac) 22%, transparent) !important; }
.qrate .q3 { background: var(--ok-soft); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 22%, transparent) !important; }
.qrate button:disabled { opacity: .4; cursor: default; }
.empty { text-align: center; padding: 26px 16px; color: var(--mut); }
.empty .itile { margin-bottom: 10px; }
/* gráfico semanal */
.wchart { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; align-items: end; height: 150px; padding-top: 12px; }
.wbar { all: unset; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 8px; height: 100%; }
.wbar .wb { width: min(30px, 70%); border-radius: 10px; background: var(--panel3); transition: height .5s cubic-bezier(.4, 0, .2, 1), background .15s; min-height: 8px; }
.wbar:hover .wb { background: var(--line2); }
.wbar.today .wb { background: color-mix(in srgb, var(--ac) 45%, transparent); }
.wbar.sel .wb { background: var(--ac); box-shadow: var(--shadow-ac); }
.wbar span { font-size: 11.5px; color: var(--mut); font-weight: 600; }
.wbar.sel span { color: var(--ac-txt); font-weight: 800; }
.heat { display: grid; grid-template-rows: repeat(7, 14px); grid-auto-flow: column; grid-auto-columns: 14px; gap: 4px; overflow-x: auto; }
.heat i { border-radius: 4px; background: var(--panel2); }
.heat i.l1 { background: color-mix(in srgb, var(--ac) 25%, var(--panel2)); }
.heat i.l2 { background: color-mix(in srgb, var(--ac) 48%, var(--panel2)); }
.heat i.l3 { background: color-mix(in srgb, var(--ac) 72%, var(--panel2)); }
.heat i.l4 { background: var(--ac); }

/* ---------- revisão, quiz ---------- */
.rate { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 14px; }
.opt { display: flex; justify-content: flex-start; width: 100%; text-align: left; margin: 8px 0; min-height: 50px; font-weight: 500; }
.opt.ok { border-color: var(--ok); background: var(--ok-soft); }
.opt.no { border-color: var(--bad); background: var(--bad-soft); }
.revwrap { max-width: 720px; margin: 0 auto; }
.revwrap .flip-in { min-height: 340px; }
.revwrap .face .fq { font-size: 20px; max-height: 220px; }
.revwrap .face .fa { font-size: 15.5px; max-height: 240px; }

/* ---------- foco ---------- */
.focus { max-width: 520px; margin: 0 auto; text-align: center; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 6px; border-radius: 18px; background: var(--panel2); border: 1px solid var(--line); }
.seg button { all: unset; cursor: pointer; padding: 9px 4px; border-radius: 13px; font-size: 13px; font-weight: 700; color: var(--mut); text-align: center; }
.seg button.on { background: var(--tab-on); color: var(--ac-txt); box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }
.fsel { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-radius: 18px; background: var(--panel); border: 1px solid var(--line); margin-top: 14px; text-align: left; }
.fsel select { border: 0; background: transparent; font-weight: 700; text-align: right; min-height: 0; padding: 4px; box-shadow: none !important; max-width: 60%; }
.tring { position: relative; width: 250px; height: 250px; margin: 22px auto 18px; display: flex; align-items: center; justify-content: center; }
.tring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.tring circle { fill: none; stroke-width: 11; }
.tring .ring-bg { stroke: var(--panel2); }
.tring .ring-fg { stroke: var(--ac); stroke-linecap: round; transition: stroke-dashoffset .5s linear; }
.tring .tl2 { font-size: 11.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ac-txt); }
.timer { font-family: var(--fd); font-size: 54px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.03em; line-height: 1.1; margin: 4px 0; }
.tctl { display: flex; align-items: center; justify-content: center; gap: 12px; }
.tctl .b.icon { min-width: 56px; min-height: 56px; border: 1px solid var(--line); background: var(--panel); }
.tctl .b.icon.okb { background: var(--ok-soft); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 25%, transparent); }
.tctl .b.p { flex: 1; max-width: 200px; min-height: 56px; border-radius: 18px; font-size: 16px; font-family: var(--fd); font-weight: 800; }

/* ---------- aviso ---------- */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 140px); background: var(--tx); color: var(--bg); padding: 12px 18px; border-radius: 16px; font-size: 13.5px; font-weight: 600; transition: transform .3s; z-index: 80; box-shadow: var(--shadow-lg); max-width: calc(100vw - 32px); }
.toast.show { transform: translate(-50%, 0); }

/* ---------- topo e barra inferior ---------- */
.topbar { align-items: center; gap: 10px; position: sticky; top: 0; z-index: 30; padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: var(--glass); -webkit-backdrop-filter: saturate(180%) blur(14px); backdrop-filter: saturate(180%) blur(14px); border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
.iconbtn { all: unset; cursor: pointer; width: 42px; height: 42px; display: flex; align-items: center; justify-content: center; border-radius: 16px; color: var(--tx2); background: var(--panel); border: 1px solid var(--line); flex: none; box-sizing: border-box; }
.iconbtn:active { transform: scale(.95); }
.tb-title { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; }
.tb-title .logo { width: 40px; height: 40px; border-radius: 14px; font-size: 16px; }
.tb-title small { display: block; font-size: 12px; color: var(--mut); font-weight: 500; }
.tb-title b { display: block; font-family: var(--fd); font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-title > div { min-width: 0; }

/* =====================================================================
   iPad e telas médias (até 1023px): menu vira gaveta + barra no topo
   ===================================================================== */
@media (max-width: 1023px) {
  .side { transform: translateX(-104%); transition: transform .28s cubic-bezier(.4, 0, .2, 1); box-shadow: var(--shadow-lg); width: 288px; padding-top: calc(20px + env(safe-area-inset-top)); border-radius: 0 24px 24px 0; }
  body.menu-open .side { transform: none; }
  .scrim { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .45); z-index: 35; opacity: 0; pointer-events: none; transition: opacity .25s; }
  body.menu-open .scrim { opacity: 1; pointer-events: auto; }
  .main-wrap { margin-left: 0; }
  .topbar { display: flex; }
  main { padding: 24px 24px 56px; }
  .side .mini { display: none !important; }
  .dash { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "goal goal" "kpis kpis" "carr carr" "review chart" "heat prova"; }
  .kpis2 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 899px) {
  .g2 { grid-template-columns: minmax(0, 1fr); }
  .dash { grid-template-columns: minmax(0, 1fr); grid-template-areas: "goal" "kpis" "carr" "review" "chart" "heat" "prova"; }
  .kpis2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* =====================================================================
   Celular (até 639px): barra inferior, uma coluna, toque confortável
   ===================================================================== */
@media (max-width: 639px) {
  main { padding: 18px 16px calc(100px + env(safe-area-inset-bottom)); }
  h1 { font-size: 24px; }
  .sub { font-size: 14px; margin-bottom: 18px; }
  .card { padding: 18px; }
  .dash { gap: 18px; }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .g4 > :last-child:nth-child(odd) { grid-column: span 2; }
  .grid { gap: 12px; }
  .kpi .v { font-size: 24px; }
  .kpi .l { font-size: 10.5px; }
  input, select, textarea { font-size: 16px; }
  .grow { flex-basis: 100% !important; min-width: 0 !important; }
  .tabs { margin: 18px -16px 14px; border-radius: 0; border-left: 0; border-right: 0; width: auto; max-width: none; padding: 6px 12px; }
  .lead { min-width: 82px; }
  .doc { padding: 12px 10px; margin: 0 -10px; gap: 8px 12px; }
  .st { grid-template-columns: 30px minmax(0, 1fr); gap: 10px; }
  .st:before { left: 14px; top: 32px; }
  .st-n { width: 30px; height: 30px; font-size: 13px; }
  .st-c { padding: 16px; }
  .lsub > div { flex-basis: 100%; }
  .lsub { padding: 10px; margin: 0 -10px; }
  .dorder .arr { display: none; }
  .dstep { flex: 1 1 calc(50% - 8px); }
  .rate { grid-template-columns: repeat(2, 1fr); }
  .qrate { grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .qrate button { font-size: 12px; padding: 9px 2px; }
  .tb { font-size: 13.5px; }
  .goal-v { font-size: 28px; }
  .ccard { flex-basis: 226px; }
  .carousel { margin: 0 -16px; padding: 2px 16px 8px; scroll-padding: 0 16px; }
  .tring { width: 230px; height: 230px; }
  .timer { font-size: 48px; }
  .revwrap .flip-in { min-height: 300px; }
  .toast { bottom: calc(88px + env(safe-area-inset-bottom)); }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; padding: 8px 8px calc(10px + env(safe-area-inset-bottom)); background: var(--glass); -webkit-backdrop-filter: saturate(180%) blur(16px); backdrop-filter: saturate(180%) blur(16px); border-top: 1px solid var(--line); }
  .tab-i { all: unset; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 6px 2px; border-radius: 16px; color: var(--mut); font-size: 11px; font-weight: 600; position: relative; }
  .tab-i.on { color: var(--ac-txt); font-weight: 700; }
  .tab-i svg.i { width: 22px; height: 22px; }
  .tab-i .badge { position: absolute; top: 0; left: calc(50% + 5px); font-size: 10px; line-height: 16px; min-width: 16px; padding: 0 5px; }
  .tab-i .live { position: absolute; top: 4px; left: calc(50% + 8px); width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
}
@media (hover: none) {
  .dcard:hover, .ccard:hover { transform: none; box-shadow: var(--shadow); }
}

/* cabeçalho de página e utilidades responsivas */
.pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.pagehead .sub { margin: 0; }
@media (max-width: 1023px) { .hide-t { display: none !important; } }
@media (max-width: 639px) { .hide-s { display: none !important; } .pagehead { margin-bottom: 16px; } }

.ccard { min-width: 0; overflow: hidden; }
.ccard > div { min-width: 0; }


/* lista de flashcards */
.fcl { padding: 12px 0; border-bottom: 1px solid var(--line); }
.fcl:last-child { border-bottom: 0; }


.fstats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 10px; }
.fstats span { display: flex; flex-direction: column; font-size: 11.5px; color: var(--mut); font-weight: 600; }
.fstats b { font-family: var(--fd); font-size: 22px; font-weight: 800; color: var(--tx); }


.only-s { display: none; }
@media (max-width: 639px) { .only-s { display: inline; } }


/* listas de áudio */
.alist { margin-top: 8px; }
.aitem { padding: 14px 0; border-bottom: 1px solid var(--line); }
.aitem:last-child { border-bottom: 0; padding-bottom: 2px; }
.anum { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 9px; background: var(--ac-soft); color: var(--ac-txt); font-weight: 800; font-size: 12.5px; flex: none; font-family: var(--fd); }


/* =====================================================================
   Acesso dos alunos: modais sobre a página vazia e usuário no menu lateral
   ===================================================================== */
#auth { display: none; }
body.boot .app { display: none; }
body.auth #auth { display: flex; position: fixed; inset: 0; z-index: 100; align-items: center; justify-content: center; padding: 24px 16px; overflow-y: auto; background: rgba(9, 9, 11, .42); }
body.auth:not(.boot) #auth { -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.auth-card { width: 100%; max-width: 380px; margin: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 28px 24px 24px; box-shadow: var(--shadow-lg); box-sizing: border-box; animation: auth-in .18s ease-out; }
@keyframes auth-in { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.auth-q { font-family: var(--fd); font-size: 22px; font-weight: 800; letter-spacing: -.02em; line-height: 1.25; text-align: center; margin: 0 0 20px; color: var(--tx); }
.auth-sub { text-align: center; margin: -10px 0 18px; }
.auth-sn { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.auth-f { display: block; margin-bottom: 14px; }
.auth-f span { display: block; font-size: 13px; font-weight: 600; color: var(--tx2); margin-bottom: 6px; }
.auth-f input { width: 100%; box-sizing: border-box; font-size: 16px; }
.auth-err { color: var(--bad); font-size: 13.5px; font-weight: 500; margin: 0 0 12px; }
.auth-err:empty { display: none; }
.b.auth-btn { width: 100%; }
.b.auth-btn:disabled { opacity: .6; cursor: progress; }
.auth-link { all: unset; cursor: pointer; display: block; margin: 14px auto 0; color: var(--mut); font-size: 13.5px; font-weight: 500; padding: 4px 8px; border-radius: 8px; }
.auth-link:hover { color: var(--tx); }
.auth-link:focus-visible, .auth-sn .b:focus-visible, .auth-chips .b:focus-visible { outline: 2px solid var(--ac); outline-offset: 2px; }
.auth-chips { display: flex; gap: 8px; margin-bottom: 14px; }
.auth-chips .b { flex: 1; min-width: 0; padding: 8px 0; }
.auth-load { margin: auto; }
.spin { width: 28px; height: 28px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .35); border-top-color: #fff; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation-duration: 2.4s; } .auth-card { animation: none; } }
.userbox { display: flex; align-items: center; gap: 10px; padding: 14px 12px 8px; border-top: 1px solid var(--line); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--ac-soft); color: var(--ac-txt); font-family: var(--fd); font-weight: 700; display: flex; align-items: center; justify-content: center; flex: none; }
.ub-txt { min-width: 0; }
.ub-txt b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ub-txt small { display: block; font-size: 12px; color: var(--mut); }
.ub-txt small.erro { color: var(--warn); }

/* link externo no menu lateral (Estudo ao vivo) */
.nav-i .ext { margin-left: auto; display: flex; color: var(--mut); }
.nav-i .ext svg.i { width: 14px; height: 14px; }
