/* =====================================================================
   v3 – layout com menu lateral (inspirado no site-tjsp), tema escuro fixo,
   tipografia Inter + Fraunces e planejador com post-its
   ===================================================================== */
@font-face { font-family: "Inter"; src: url("../fonts/inter-latin-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Fraunces"; src: url("../fonts/fraunces-latin-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root, [data-bs-theme="dark"] {
  --fundo: #11141b; --superficie: #181d27; --superficie-2: #1d2330; --borda: #2a3242; --borda-forte: #3a455a;
  --texto: #e5e8ef; --suave: #9aa2b4; --primaria: #8eaef0; --primaria-forte: #b3c9f6; --primaria-clara: #1f2a42;
  --dourado: #e2b04f; --ok: #5cc98d; --erro: #ef8a84;
  --lateral-fundo: #0c1018; --lateral-texto: #aeb8cc;
  --soft: #1d2330; --card: #181d27; --line: #2a3242; --brand: #8eaef0; --brand2: #b3c9f6;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .28);
  --top-h: 76px;
  --bs-body-font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  --bs-body-bg: var(--fundo); --bs-body-color: var(--texto); --bs-secondary-color: var(--suave); --bs-border-color: var(--borda);
  --bs-tertiary-bg: var(--superficie-2); --bs-link-color-rgb: 142, 174, 240; --bs-link-hover-color: var(--primaria-forte);
  --bs-border-radius: .6rem; --bs-border-radius-lg: .9rem; --bs-focus-ring-color: rgba(142, 174, 240, .3);
  --pastel0: #28305a; --pastel1: #4a3b17; --pastel2: #173b27; --pastel3: #4a1d1d; --pastel4: #12405a; --pastel5: #3c2358;
}
body { background: var(--fundo) !important; color: var(--texto); font-feature-settings: "cv11", "ss01"; }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.fig svg { fill: initial; stroke: initial; stroke-width: initial; stroke-linecap: initial; stroke-linejoin: initial; }
html { scroll-padding-top: 90px; }

.btn { font-weight: 500; border-radius: .6rem; }
.btn-primary { --bs-btn-bg: #8eaef0; --bs-btn-border-color: #8eaef0; --bs-btn-color: #0f1626; --bs-btn-hover-bg: #b3c9f6; --bs-btn-hover-border-color: #b3c9f6; --bs-btn-hover-color: #0f1626; --bs-btn-active-bg: #b3c9f6; --bs-btn-active-color: #0f1626; --bs-btn-disabled-bg: #8eaef0; --bs-btn-disabled-color: #0f1626; }
.btn-outline-secondary, .btn-outline-primary, .btn-outline-dark { --bs-btn-color: var(--texto); --bs-btn-border-color: var(--borda-forte); --bs-btn-hover-bg: var(--superficie-2); --bs-btn-hover-color: #fff; --bs-btn-hover-border-color: var(--suave); --bs-btn-active-bg: var(--primaria-clara); --bs-btn-active-color: #fff; background: var(--superficie); }
.btn-dark { --bs-btn-bg: #2a3242; --bs-btn-border-color: #3a455a; --bs-btn-hover-bg: #36405a; --bs-btn-hover-border-color: #4a5670; }
.btn-light { --bs-btn-bg: #f0f3fa; --bs-btn-color: #172440; }
.form-control, .form-select { background-color: var(--superficie-2); border-color: var(--borda-forte); color: var(--texto); border-radius: .6rem; }
.form-control:focus, .form-select:focus { background-color: var(--superficie-2); border-color: var(--primaria); box-shadow: 0 0 0 .2rem var(--bs-focus-ring-color); color: var(--texto); }
.form-label { font-size: .78rem; font-weight: 700; color: var(--suave); text-transform: uppercase; letter-spacing: .05em; }
.table { --bs-table-bg: transparent; --bs-table-color: var(--texto); --bs-table-border-color: var(--borda); --bs-table-striped-bg: rgba(255, 255, 255, .025); --bs-table-striped-color: var(--texto); }
.alert-light { background: var(--superficie-2); border-color: var(--borda); color: var(--texto); }
.text-muted { color: var(--suave) !important; }

/* ---------- layout ---------- */
.layout { display: flex; min-height: 100vh; }
.principal { flex: 1; min-width: 0; display: flex; flex-direction: column; }
main#app { width: 100%; max-width: 1380px !important; margin: 0 auto; padding: 22px 32px 24px; flex: 1; }
.rodape { max-width: 1380px; width: 100%; margin: 0 auto; padding: 8px 32px 28px; color: var(--suave); font-size: .82rem; text-align: left !important; }

.lateral { --bs-offcanvas-width: 270px; --bs-offcanvas-bg: var(--lateral-fundo); color: var(--lateral-texto); background: var(--lateral-fundo); }
@media (min-width: 992px) { .lateral { width: 260px; flex-shrink: 0; position: sticky; top: 0; height: 100vh; background: var(--lateral-fundo) !important; border-right: 1px solid #161d2b; } }
.lateral-dentro { display: flex; flex-direction: column; gap: 6px; height: 100%; padding: 22px 14px 16px; overflow-y: auto; scrollbar-width: thin; }
.lateral .btn-close { filter: invert(1) grayscale(1) brightness(1.6); }
.marca { display: flex; align-items: center; gap: 11px; color: #fff; text-decoration: none; font-weight: 700; font-size: 1.02rem; padding: 0 8px 16px; letter-spacing: -.01em; }
.marca:hover { color: #fff; }
.marca small { display: block; font-weight: 500; font-size: .66rem; color: var(--lateral-texto); opacity: .8; letter-spacing: .01em; line-height: 1.3; max-width: 170px; }
.marca-selo { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; font-family: "Fraunces", Georgia, serif; font-weight: 700; font-size: .98rem; color: #1b1406; background: linear-gradient(140deg, #f0c86e, #c08a22); flex-shrink: 0; }
.brand::before { display: none; }

.menu { display: flex; flex-direction: column; gap: 2px; }
.menu-item { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px; color: var(--lateral-texto); text-decoration: none; font-weight: 500; font-size: .93rem; transition: background .12s, color .12s; }
.menu-item svg { width: 19px; height: 19px; opacity: .85; flex-shrink: 0; }
.menu-item:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.menu-item.active { background: rgba(255, 255, 255, .1); color: #fff; box-shadow: inset 3px 0 0 #e2b04f; }
.menu-item.active svg { opacity: 1; color: #f0c86e; }
.menu-label { font-size: .66rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 700; color: #6b778f; margin: 14px 12px 4px; }
.menu-sub { display: flex; align-items: center; gap: 10px; padding: 6px 12px; border-radius: 9px; color: var(--lateral-texto); text-decoration: none; font-size: .88rem; }
.menu-sub .dot { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-size: .9rem; background: color-mix(in srgb, var(--c) 18%, transparent); flex-shrink: 0; }
.menu-sub .nm { flex: 1; line-height: 1.2; }
.menu-sub .pc { font-size: .7rem; opacity: .6; font-variant-numeric: tabular-nums; }
.menu-sub:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.menu-sub.active { background: color-mix(in srgb, var(--c) 18%, transparent); color: #fff; box-shadow: inset 3px 0 0 var(--c); }

.btn-revisao { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 11px 14px; border-radius: 12px; text-decoration: none; font-weight: 700; color: #1b1406; background: linear-gradient(140deg, #f0c86e, #d39a2c); box-shadow: 0 4px 14px rgba(211, 154, 44, .25); transition: transform .12s, box-shadow .12s; }
.btn-revisao:hover { color: #1b1406; transform: translateY(-1px); box-shadow: 0 6px 18px rgba(211, 154, 44, .35); }
.btn-revisao svg { width: 20px; height: 20px; stroke-width: 2.1; }
.btn-revisao small { display: block; font-weight: 500; font-size: .72rem; opacity: .8; }
.btn-revisao.active { outline: 2px solid rgba(255, 255, 255, .5); outline-offset: 2px; }
.contagem { margin-top: auto; padding: 14px; border-radius: 12px; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .07); }
.contagem .n { font-family: "Fraunces", Georgia, serif; font-size: 2rem; font-weight: 600; line-height: 1; color: #fff; }
.contagem .r { font-size: .78rem; opacity: .85; margin-top: 2px; }
.contagem .barra { margin-top: 10px; background: rgba(255, 255, 255, .1); height: 5px; border-radius: 9px; overflow: hidden; }
.contagem .barra > span { display: block; height: 100%; background: #e2b04f; }
.contagem + .contagem { margin-top: 8px; }

.barra-movel { position: sticky; top: 0; z-index: 1030; display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; background: var(--lateral-fundo); border-bottom: 1px solid #161d2b; }
.barra-movel .marca { padding: 0; font-size: .98rem; }
.barra-movel .marca-selo { width: 32px; height: 32px; }
.btn-icone { border: 0; background: rgba(255, 255, 255, .08); color: #fff; width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; }
.btn-icone svg { width: 22px; height: 22px; }

.topo-busca { position: sticky; top: 0; z-index: 1020; display: flex; align-items: center; gap: 14px; padding: 12px 32px; background: color-mix(in srgb, var(--fundo) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--borda); }
@media (max-width: 991.98px) { .topo-busca { top: 52px; padding: 10px 14px; } :root, [data-bs-theme="dark"] { --top-h: 118px; } main#app { padding: 16px 14px; } .rodape { padding: 8px 14px 24px; } }
.search { max-width: 560px; }
.search input { background: var(--superficie); border: 1px solid var(--borda-forte); color: var(--texto); border-radius: 12px; padding: .55rem .9rem .55rem 2.5rem; }
.search input::placeholder { color: var(--suave); }
.search input:focus { background: var(--superficie); color: var(--texto); box-shadow: 0 0 0 3px var(--bs-focus-ring-color); }
.search input:focus::placeholder { color: var(--suave); }
.ic-busca { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--suave); pointer-events: none; z-index: 2; }
.results { background: var(--superficie); border-color: var(--borda-forte); }
.hoje-pilula { margin-left: auto; font-size: .8rem; color: var(--suave); white-space: nowrap; display: flex; gap: 8px; }
.hoje-pilula span { padding: 6px 12px; border-radius: 99px; background: var(--superficie); border: 1px solid var(--borda); }
.hoje-pilula b { color: var(--texto); }
@media (max-width: 767.98px) { .hoje-pilula { display: none; } }

/* ---------- tipografia ---------- */
.topic-title, .hero h1, .sub-hero h1, .red-title h2, .content > h2, .content h1, .grp-title, #app h1.display-6, .article > h1, .article h2.h4, .article h2.h5 { font-family: "Fraunces", Georgia, serif; font-weight: 600; letter-spacing: -.012em; }
.content, .tt, .tcard { font-family: "Inter", system-ui, sans-serif; }

/* ---------- superfícies ---------- */
.article, .sidebar, .tcard, .subj, .modecard, .sim-panel, .sim-day, .resume, .red-prop, .red-editor, .pager a { background: var(--superficie); border-color: var(--borda); box-shadow: var(--shadow); }
.article { border-radius: 16px; }
.hero { background: radial-gradient(120% 140% at 100% 0%, #3b5fa8 0%, transparent 55%), linear-gradient(135deg, #1b2c52, #23407a 60%, #2b4a8a); border-radius: 22px; padding: 2rem 2.2rem; box-shadow: 0 2px 4px rgba(0, 0, 0, .3), 0 12px 32px rgba(0, 0, 0, .35); }
.hero::after { right: -60px; bottom: -80px; width: 260px; height: 260px; border-radius: 50%; border: 36px solid rgba(240, 200, 110, .12); background: transparent; }
.sim-hero { background: radial-gradient(120% 140% at 100% 0%, #7b2a3b 0%, transparent 55%), linear-gradient(135deg, #2a1730, #4a1d3a 60%, #5c2447); }
.count { background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .12); }
.subj { border-top: 4px solid var(--c); border-left: 1px solid var(--borda); }
.subj:hover, .tcard:hover { box-shadow: 0 2px 4px rgba(0, 0, 0, .35), 0 14px 30px rgba(0, 0, 0, .4); }
.sidebar { top: 88px !important; max-height: calc(100vh - 106px) !important; }
@media (max-width: 991.98px) { .sidebar { top: auto !important; max-height: none !important; } }
.sim-panel, .red-prop, .red-editor { top: 88px !important; }
.tlink:hover { background: var(--superficie-2); }
.tlink.active { background: color-mix(in srgb, var(--c) 16%, var(--superficie)); color: #fff; }
.content { color: #d5dae6; }
.content strong, .content h2, .content h1 { color: #fff; }
.content h3 { color: color-mix(in srgb, var(--c) 55%, #fff); }
.content blockquote { background: color-mix(in srgb, var(--c) 9%, var(--superficie)); }
.content code { color: #f0c86e; background: rgba(255, 255, 255, .05); padding: 1px 5px; border-radius: 5px; }
.content pre { background: var(--superficie-2); border-color: var(--borda); }
.toc, .red-cmd, .red-comp, .red-box, .qreview, .qcard, .quiz-stats > div { background: var(--superficie-2); border-color: var(--borda); }
.chip, .tcard .num { color: #e5e8ef; }
.tcard .num { background: color-mix(in srgb, var(--c) 20%, var(--superficie)); }
.qopt { background: var(--superficie-2); border-color: var(--borda); color: var(--texto); }
.qopt .qlet { background: var(--superficie); border-color: var(--borda); }
.qnav { background: var(--superficie-2); border-color: var(--borda); color: var(--texto); }
.enem-let { background: var(--superficie-2); color: var(--texto); }
.essay-paper { background-color: var(--superficie-2); color: #e5e8ef; border-color: var(--borda-forte); }
.essay-view { background: var(--superficie-2); border-color: var(--borda); }
.sub-hero { box-shadow: 0 2px 4px rgba(0, 0, 0, .3), 0 12px 32px rgba(0, 0, 0, .35); }
.progress { background: rgba(255, 255, 255, .09); }
.fig, .gallery, .fig-inline, .gal-item { background: var(--superficie-2); border-color: var(--borda); }
.fig-inline figcaption { color: #cfd5e3; }
.lightbox { background: rgba(5, 8, 14, .94); }

/* ---------- imagens: sem coluna que ultrapassa o texto ---------- */
.fig-row { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; margin: 1rem 0 1.4rem; clear: both; }
.fig-row .fig-inline, .fig-row .fig-inline.left, .fig-row .fig-inline.small { float: none !important; clear: none !important; width: min(300px, 100%); margin: 0 !important; }
.fig-row .fig-inline .gal-btn img { max-height: 220px; }

/* ---------- Matérias (grade) ---------- */
.page-head { margin-bottom: 1.4rem; }
.page-head h1 { font-size: 2rem; margin: 0 0 .3rem; }
.page-head p { color: var(--suave); max-width: 760px; margin: 0; }

/* =====================================================================
   PLANEJADOR (calendário + post-its)
   ===================================================================== */
.pn-wrap { display: grid; grid-template-columns: 290px 1fr; gap: 18px; align-items: start; }
@media (max-width: 1100px) { .pn-wrap { grid-template-columns: 1fr; } }
.pn-tray { background: var(--superficie); border: 1px solid var(--borda); border-radius: 16px; padding: 14px; box-shadow: var(--shadow); position: sticky; top: 88px; max-height: calc(100vh - 108px); overflow: auto; }
@media (max-width: 1100px) { .pn-tray { position: static; max-height: none; } }
.pn-tray h2 { font-size: 1.05rem; margin: 0 0 4px; font-family: "Fraunces", serif; }
.pn-tray.over, .pn-cell.over { outline: 2px dashed #e2b04f; outline-offset: -3px; background: color-mix(in srgb, #e2b04f 8%, var(--superficie)); }
.pn-trayList { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; min-height: 90px; }
.pn-empty { color: var(--suave); font-size: .82rem; border: 1px dashed var(--borda-forte); border-radius: 12px; padding: 14px; text-align: center; }
.pn-note { --pc: #fde68a; position: relative; background: var(--pc); color: #2b2412; border-radius: 3px 3px 14px 3px; padding: 12px 12px 10px; box-shadow: 0 6px 14px rgba(0, 0, 0, .35); cursor: grab; transform: rotate(var(--rot, -1deg)); transition: transform .12s, box-shadow .12s; font-family: "Inter", sans-serif; user-select: none; }
.pn-note:hover { transform: rotate(0) translateY(-2px) scale(1.02); box-shadow: 0 12px 22px rgba(0, 0, 0, .45); z-index: 3; }
.pn-note::before { content: ""; position: absolute; top: -7px; left: 50%; width: 46px; height: 14px; margin-left: -23px; background: rgba(255, 255, 255, .45); transform: rotate(-2deg); border-radius: 2px; }
.pn-note.dragging { opacity: .45; }
.pn-note .h { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: .88rem; line-height: 1.2; }
.pn-note .m { font-size: .74rem; opacity: .75; margin-top: 2px; }
.pn-note .bar { height: 5px; background: rgba(0, 0, 0, .14); border-radius: 9px; margin-top: 7px; overflow: hidden; }
.pn-note .bar > i { display: block; height: 100%; background: rgba(0, 0, 0, .55); }
.pn-note.done { filter: saturate(.7); }
.pn-note.done .h::after { content: "✓"; margin-left: auto; font-weight: 800; color: #14532d; }
.pn-note.mini { padding: 6px 8px 5px; border-radius: 3px 3px 10px 3px; font-size: .74rem; box-shadow: 0 3px 8px rgba(0, 0, 0, .35); }
.pn-note.mini::before { display: none; }
.pn-note.mini .h { font-size: .74rem; }
.pn-note.mini .m { font-size: .66rem; margin: 0; }
.pn-note.mini .bar { margin-top: 4px; height: 3px; }
.pn-cal { background: var(--superficie); border: 1px solid var(--borda); border-radius: 16px; padding: 14px; box-shadow: var(--shadow); }
.pn-cal-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.pn-cal-head h2 { margin: 0; font-family: "Fraunces", serif; font-size: 1.4rem; flex: 1; }
.pn-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.pn-dow { text-align: center; font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--suave); font-weight: 700; padding: 4px 0; }
.pn-cell { min-height: 118px; background: var(--superficie-2); border: 1px solid var(--borda); border-radius: 12px; padding: 6px; display: flex; flex-direction: column; gap: 5px; transition: background .12s; }
.pn-cell.out { opacity: .38; }
.pn-cell.today { border-color: #e2b04f; box-shadow: inset 0 0 0 1px #e2b04f; }
.pn-cell.past { background: color-mix(in srgb, var(--superficie-2) 70%, var(--fundo)); }
.pn-cell .d { display: flex; align-items: center; justify-content: space-between; font-size: .78rem; font-weight: 700; color: var(--suave); }
.pn-cell.today .d span:first-child { color: #1b1406; background: #e2b04f; border-radius: 99px; padding: 0 7px; }
.pn-enem { font-size: .62rem; font-weight: 800; color: #1b1406; background: linear-gradient(140deg, #f0c86e, #d39a2c); border-radius: 6px; padding: 2px 6px; }
.pn-cell .more { font-size: .68rem; color: var(--suave); text-align: center; }
@media (max-width: 700px) { .pn-cell { min-height: 74px; padding: 3px; } .pn-note.mini .m { display: none; } .pn-dow { font-size: .6rem; } }

.pn-modal { position: fixed; inset: 0; z-index: 5000; background: rgba(5, 8, 14, .72); display: flex; align-items: flex-start; justify-content: center; overflow: auto; padding: 4vh 12px; }
.pn-box { width: min(620px, 100%); background: var(--superficie); border: 1px solid var(--borda-forte); border-radius: 18px; padding: 22px; box-shadow: 0 20px 60px rgba(0, 0, 0, .6); }
.pn-box h3 { font-family: "Fraunces", serif; margin-bottom: 14px; }
.pn-topics { max-height: 230px; overflow: auto; border: 1px solid var(--borda); border-radius: 12px; padding: 6px 10px; background: var(--superficie-2); }
.pn-topics .g { font-size: .66rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; color: var(--suave); margin: 8px 0 2px; }
.pn-topics label { display: flex; gap: 8px; align-items: flex-start; font-size: .86rem; padding: 3px 0; cursor: pointer; }
.pn-topics label.ok { opacity: .55; }
.pn-colors { display: flex; gap: 8px; }
.pn-colors button { width: 28px; height: 28px; border-radius: 6px; border: 2px solid transparent; }
.pn-colors button.sel { border-color: #fff; box-shadow: 0 0 0 2px rgba(255, 255, 255, .3); }

/* post-it do dia (canto da tela) */
#pn-widget { position: fixed; right: 18px; bottom: 18px; z-index: 1500; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; max-width: calc(100vw - 24px); pointer-events: none; }
#pn-widget > * { pointer-events: auto; }
.pn-w { --pc: #fde68a; width: 276px; background: var(--pc); color: #2b2412; border-radius: 3px 3px 16px 3px; padding: 14px 14px 12px; box-shadow: 0 12px 30px rgba(0, 0, 0, .5); transform: rotate(-1.2deg); font-size: .84rem; position: relative; }
.pn-w::before { content: ""; position: absolute; top: -8px; left: 50%; width: 52px; height: 15px; margin-left: -26px; background: rgba(255, 255, 255, .5); transform: rotate(2deg); border-radius: 2px; }
.pn-w .t { display: flex; align-items: center; gap: 6px; font-weight: 800; }
.pn-w .t .x { margin-left: auto; border: 0; background: transparent; font-size: .9rem; line-height: 1; color: #2b2412; opacity: .55; }
.pn-w .left { font-family: "Fraunces", serif; font-size: 1.7rem; font-weight: 600; line-height: 1.1; margin: 4px 0 0; font-variant-numeric: tabular-nums; }
.pn-w .sub { font-size: .72rem; opacity: .7; }
.pn-w .bar { height: 6px; background: rgba(0, 0, 0, .15); border-radius: 9px; margin: 8px 0; overflow: hidden; }
.pn-w .bar > i { display: block; height: 100%; background: rgba(0, 0, 0, .6); }
.pn-w ul { list-style: none; margin: 6px 0 0; padding: 0; max-height: 150px; overflow: auto; }
.pn-w li { display: flex; gap: 6px; align-items: flex-start; padding: 2px 0; line-height: 1.25; }
.pn-w li a { color: inherit; text-decoration: none; }
.pn-w li a:hover { text-decoration: underline; }
.pn-w li .ck { flex: 0 0 1.1rem; font-weight: 800; }
.pn-w li.ok { opacity: .6; }
.pn-w li.ok a { text-decoration: line-through; }
.pn-w li.ok .ck { color: #14532d; opacity: 1; }
.pn-w .win { font-weight: 800; color: #14532d; }
.pn-mini { border: 0; border-radius: 99px; padding: 8px 14px; background: #e2b04f; color: #1b1406; font-weight: 700; font-size: .82rem; box-shadow: 0 8px 20px rgba(0, 0, 0, .45); }
@media (max-width: 575.98px) { #pn-widget { right: 8px; bottom: 8px; } .pn-w { width: 240px; } }

/* ---------- dado da redação ---------- */
.dice-btn { display: inline-flex; align-items: center; gap: 8px; }
.dice-btn .die { display: inline-block; font-size: 1.25rem; line-height: 1; }
.dice-btn.rolling .die { animation: roll .7s cubic-bezier(.3, .1, .3, 1); }
@keyframes roll { 0% { transform: rotate(0) scale(1); } 30% { transform: rotate(240deg) scale(1.4) translateY(-6px); } 60% { transform: rotate(520deg) scale(1.2); } 100% { transform: rotate(720deg) scale(1); } }

/* atalhos e contagem compacta */
.atalho { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--borda); background: var(--superficie); color: inherit; text-decoration: none; transition: border-color .12s, background .12s; height: 100%; }
.atalho:hover { border-color: var(--primaria); background: var(--primaria-clara); color: inherit; }
.atalho i { font-style: normal; width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--primaria-clara); font-size: 1.1rem; flex-shrink: 0; }
.atalho b { display: block; font-size: .92rem; font-weight: 600; }
.atalho span span { font-size: .78rem; color: var(--suave); }
.atalho.destaque { background: #8eaef0; border-color: #8eaef0; color: #0f1626; }
.atalho.destaque span span { color: rgba(15, 22, 38, .72); }
.atalho.destaque i { background: rgba(15, 22, 38, .12); }
.atalho.destaque:hover { background: #b3c9f6; color: #0f1626; }
.contagem .cd { display: flex; align-items: center; gap: 12px; }
.contagem .cd + .cd { margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(255, 255, 255, .08); }
.contagem .cd b { font-family: "Fraunces", Georgia, serif; font-size: 1.7rem; font-weight: 600; color: #fff; min-width: 40px; line-height: 1; }
.contagem .cd span { font-size: .76rem; opacity: .85; line-height: 1.25; }
.saudacao { font-size: .95rem; }

.pn-note .h span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pn-w { width: 262px; } .pn-w ul { max-height: 96px; }

.pn-chips { display: flex; flex-direction: column; gap: 6px; align-items: stretch; min-width: 210px; }
.pn-chip { --pc: #fde68a; display: flex; justify-content: space-between; gap: 12px; background: var(--pc); color: #2b2412; border-radius: 3px 3px 10px 3px; padding: 6px 10px; font-size: .78rem; font-weight: 700; box-shadow: 0 6px 14px rgba(0, 0, 0, .4); }
.pn-chip b { font-variant-numeric: tabular-nums; }

/* questões autorais */
.aut-q { max-width: 820px; margin: 0 auto; }
.aut-q .qbase { background: #fbfaf5; color: #1a1d2e; border-left-color: #8890a8; font-size: .97rem; line-height: 1.6; }
.aut-q .qcmd { margin-top: .8rem; }
.aut-fig { background: #fff; border-radius: 10px; margin: .8rem 0; padding: 8px; text-align: center; }
.aut-fig svg { width: 100%; height: auto; max-width: 680px; stroke: initial; fill: initial; }
.aut-fig svg * { stroke-linecap: initial; }
.aut-fig figcaption { color: #444; font-size: .76rem; padding-top: 4px; }
.aut-table { background: #fff; color: #1a1d2e; border-radius: 8px; overflow: hidden; margin-top: .6rem; }
.aut-table table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.aut-table th, .aut-table td { border: 1px solid #c9ccd8; padding: .35rem .6rem; text-align: left; }
.aut-table th { background: #eceef5; }

/* ---------- sidebar de tópicos recolhível ---------- */
.tab-layout.side-hidden > aside { display: none; }
.tab-layout.side-hidden > section { flex: 0 0 100%; max-width: 100%; }
.side-toggle { gap: 6px; align-items: center; font-size: .78rem; padding: .2rem .6rem; }
.side-toggle svg { fill: none; stroke: currentColor; stroke-width: 1.8; }

/* ---------- movimento ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(.4); } 60% { transform: scale(1.3); } 100% { transform: scale(1); } }
@keyframes toastin { from { opacity: 0; transform: translate(-50%, 16px) scale(.96); } to { opacity: 1; transform: translate(-50%, 0) scale(1); } }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
#app.route-in > * { animation: rise .55s cubic-bezier(.2, .7, .2, 1) both; }
#app.route-in > *:nth-child(2) { animation-delay: .06s; } #app.route-in > *:nth-child(3) { animation-delay: .12s; } #app.route-in > *:nth-child(4) { animation-delay: .18s; } #app.route-in > *:nth-child(n+5) { animation-delay: .24s; }
#app.route-in .row.g-3 > *, #app.route-in .tgrid > * { animation: rise .55s cubic-bezier(.2, .7, .2, 1) both; }
#app.route-in .row.g-3 > *:nth-child(1), #app.route-in .tgrid > *:nth-child(1) { animation-delay: .10s; }
#app.route-in .row.g-3 > *:nth-child(2), #app.route-in .tgrid > *:nth-child(2) { animation-delay: .15s; }
#app.route-in .row.g-3 > *:nth-child(3), #app.route-in .tgrid > *:nth-child(3) { animation-delay: .20s; }
#app.route-in .row.g-3 > *:nth-child(4), #app.route-in .tgrid > *:nth-child(4) { animation-delay: .25s; }
#app.route-in .row.g-3 > *:nth-child(n+5), #app.route-in .tgrid > *:nth-child(n+5) { animation-delay: .30s; }
.progress-bar { transition: width .9s cubic-bezier(.2, .7, .2, 1); }
.tlink.done .ck { animation: pop .45s cubic-bezier(.2, .8, .3, 1.4); }
.tlink, .menu-item, .menu-sub, .tcard, .subj, .atalho, .chip { transition: background .15s, color .15s, transform .15s, box-shadow .2s, border-color .15s; }
.tlink:hover { transform: translateX(3px); }
.menu-item:hover, .menu-sub:hover { transform: translateX(3px); }
.btn { transition: transform .12s, box-shadow .15s, background-color .15s, border-color .15s, color .15s; }
.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(0) scale(.97); }
.hero .btn-light, .btn-revisao { position: relative; overflow: hidden; }
.hero::after { animation: floaty 7s ease-in-out infinite; }
.marca-selo { transition: transform .4s cubic-bezier(.2, .8, .3, 1.4); }
.marca:hover .marca-selo { transform: rotate(-8deg) scale(1.08); }
.fig-inline, .gal-item, .enem-img { transition: transform .25s, box-shadow .25s; }
.fig-inline:hover { transform: translateY(-3px); }
.qopt, .enem-let { transition: transform .12s, background .15s, border-color .15s; }
.qopt:not(:disabled):hover { transform: translateX(3px); }
.qfeedback { animation: rise .35s both; }
.pn-w { animation: rise .5s both; }
.pn-pause { margin-left: auto; }
.pn-w .t .x + .x { margin-left: 6px; }
#toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 16px); z-index: 6000; background: #1d2330; color: #e5e8ef; border: 1px solid #3a455a; border-left: 4px solid #5cc98d; border-radius: 12px; padding: .7rem 1.1rem; font-size: .88rem; box-shadow: 0 12px 34px rgba(0, 0, 0, .5); opacity: 0; pointer-events: none; }
#toast.show { animation: toastin .35s cubic-bezier(.2, .8, .3, 1) both; opacity: 1; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* áreas de redação */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .7rem; }
.cat-btn { text-align: left; display: flex; flex-direction: column; gap: 2px; padding: .8rem .9rem; border-radius: 14px; border: 1px solid var(--borda); background: var(--superficie-2); color: var(--texto); transition: transform .15s, border-color .15s, background .15s; }
.cat-btn:hover { transform: translateY(-3px); border-color: #e2b04f; background: color-mix(in srgb, #e2b04f 8%, var(--superficie-2)); }
.cat-btn .ci { font-size: 1.5rem; }
.cat-btn small { color: var(--suave); }
.cat-btn.any { border-style: dashed; }
.red-cat-sel { width: auto; max-width: 190px; }

/* mapas mentais e slides */
.extra-host { clear: both; margin: 1.4rem 0; }
.mapa-title { font-weight: 800; margin-bottom: .5rem; display: flex; gap: .5rem; align-items: baseline; }
.mapa-title small { color: var(--suave); font-weight: 500; }
.mapa-fig { margin: 0; background: #fdfcf7; border-radius: 16px; padding: .6rem; border: 1px solid var(--borda); box-shadow: var(--shadow); overflow-x: auto; }
.mapa-fig .mapa-title { color: #1a1d2e; padding: .2rem .5rem; }
.mapa-fig svg { width: 100%; min-width: 980px; height: auto; display: block; stroke: initial; fill: initial; }
.mapa-fig svg * { stroke-linecap: initial; stroke-linejoin: initial; }
.slides { --sc: #7c3aed; border-radius: 18px; overflow: hidden; border: 1px solid var(--borda); background: linear-gradient(135deg, color-mix(in srgb, var(--sc) 30%, #0c1018), #11141b 70%); box-shadow: var(--shadow); outline: none; }
.slides:focus-visible { box-shadow: 0 0 0 3px var(--sc); }
.sl-stage { position: relative; min-height: 290px; padding: 1.6rem 2rem 1rem; }
.sl { position: absolute; inset: 1.6rem 2rem 1rem; opacity: 0; transform: translateX(30px); pointer-events: none; transition: opacity .35s, transform .45s cubic-bezier(.2, .7, .2, 1); }
.sl.on { position: relative; inset: auto; opacity: 1; transform: none; pointer-events: auto; }
.sl h3 { font-family: "Fraunces", Georgia, serif; font-size: 1.7rem; margin: 0 0 .9rem; color: #fff; border-left: 6px solid var(--sc); padding-left: .8rem; }
.sl ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .55rem; }
.sl li { font-size: 1.12rem; padding: .55rem .9rem; background: rgba(255, 255, 255, .06); border-radius: 10px; border: 1px solid rgba(255, 255, 255, .08); opacity: 0; }
.sl.on li { animation: rise .5s var(--d, .1s) cubic-bezier(.2, .7, .2, 1) both; }
.sl-note { margin-top: 1rem; font-size: .85rem; color: var(--dourado); }
.sl-bar { display: flex; align-items: center; gap: 12px; padding: .7rem 1rem; background: rgba(0, 0, 0, .25); }
.sl-b { border: 0; width: 38px; height: 34px; border-radius: 10px; background: rgba(255, 255, 255, .1); color: #fff; transition: background .15s, transform .12s; }
.sl-b:hover { background: var(--sc); transform: translateY(-1px); }
.sl-dots { display: flex; gap: 6px; flex: 1; justify-content: center; }
.sl-dots i { width: 9px; height: 9px; border-radius: 50%; background: rgba(255, 255, 255, .25); transition: all .25s; }
.sl-dots i.on { width: 26px; border-radius: 6px; background: var(--sc); }
.sl-count { font-size: .8rem; color: #cbd2e0; font-variant-numeric: tabular-nums; }
.slides:fullscreen { display: flex; flex-direction: column; justify-content: center; border-radius: 0; }
.slides:fullscreen .sl-stage { min-height: 60vh; padding: 3rem 12vw; }
.slides:fullscreen .sl h3 { font-size: 3rem; } .slides:fullscreen .sl li { font-size: 1.6rem; }

/* conta */
.conta-box { margin-top: 10px; }
.conta-card { width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, .1); background: rgba(255, 255, 255, .05); color: #dfe5f2; text-align: left; text-decoration: none; transition: background .15s, transform .15s, border-color .15s; }
.conta-card:hover { background: rgba(255, 255, 255, .1); color: #fff; transform: translateY(-1px); border-color: rgba(226, 176, 79, .5); }
.conta-card .av { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: linear-gradient(140deg, #f0c86e, #c08a22); color: #1b1406; font-weight: 800; flex-shrink: 0; }
.conta-card .nm { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.conta-card .nm b { font-size: .86rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conta-card .nm small { font-size: .68rem; opacity: .65; }
.conta-card.on small { color: #5cc98d; opacity: 1; }
.conta-off { font-size: .75rem; color: #8b96ad; padding: 8px 10px; border: 1px dashed rgba(255, 255, 255, .15); border-radius: 12px; display: flex; flex-direction: column; }
.acc-box { max-width: 420px; }
.acc-tabs { display: flex; gap: 4px; padding: 4px; background: var(--superficie-2); border-radius: 12px; margin-bottom: 14px; }
.acc-tabs button { flex: 1; border: 0; background: transparent; color: var(--suave); padding: .5rem; border-radius: 9px; font-weight: 600; transition: background .15s, color .15s; }
.acc-tabs button.on { background: var(--superficie); color: var(--texto); box-shadow: var(--shadow); }

/* barra lateral: nada encolhe nem se sobrepõe (rola quando a tela é baixa) */
.lateral-dentro > * { flex-shrink: 0; }
.lateral-dentro { overflow-y: auto; overflow-x: hidden; }
.btn-revisao { min-height: 56px; }
.contagem { margin-top: 10px; }
@media (min-height: 860px) { .contagem { margin-top: auto; } }

/* tela de entrada obrigatória */
body.gate-pending .layout, body.gate-pending #pn-widget { visibility: hidden; }
.acc-gate { z-index: 7000; align-items: center; background: radial-gradient(900px 500px at 85% -10%, rgba(59, 95, 168, .5), transparent 60%), radial-gradient(700px 400px at 0% 110%, rgba(240, 200, 110, .12), transparent 60%), #0b0f18; padding: 16px; }
.acc-gate .pn-box { width: min(440px, 100%); }
.gate-brand { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.gate-brand b { font-family: "Fraunces", Georgia, serif; font-size: 1.35rem; display: block; line-height: 1.1; }
.gate-brand small { color: var(--suave); font-size: .72rem; }
.gate-lead { font-size: .9rem; color: var(--suave); margin: 0 0 12px; }

/* histórico (simulados e redações) */
.hist-row { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: .8rem 0; border-bottom: 1px solid var(--borda); }
.hist-main { flex: 1 1 260px; min-width: 0; }
.hist-nota { font-family: "Fraunces", Georgia, serif; font-size: 1.6rem; color: #e2b04f; }
.hist-box { padding: .8rem; background: var(--superficie-2); border: 1px solid var(--borda); border-radius: 14px; margin: .6rem 0 .2rem; }

/* estudo ativo: cards, mapa, slides e flashcards */
.estudo { clear: both; margin-top: 2rem; }
.estudo-wrap { border: 1px solid var(--borda); border-radius: 18px; background: var(--superficie-2); padding: 1rem 1.1rem 1.1rem; }
.estudo-head { display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: center; justify-content: space-between; margin-bottom: .8rem; }
.estudo-head h2 { font-family: "Fraunces", Georgia, serif; font-size: 1.25rem; margin: 0; }
.estudo-head h2 small { font-family: "Inter", sans-serif; font-size: .72rem; color: var(--suave); font-weight: 500; margin-left: .4rem; }
.estudo-tabs { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--superficie); border-radius: 12px; }
.estudo-tabs button { border: 0; background: transparent; color: var(--suave); border-radius: 9px; padding: .4rem .8rem; font-size: .84rem; font-weight: 600; transition: background .15s, color .15s; }
.estudo-tabs button:hover { color: var(--texto); }
.estudo-tabs button.on { background: color-mix(in srgb, var(--c, #8eaef0) 22%, var(--superficie-2)); color: #fff; box-shadow: var(--shadow); }
.estudo-pane { animation: rise .35s both; }
.estudo-note { font-size: .7rem; color: var(--suave); margin: .7rem 0 0; }
.sc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: .75rem; }
.sc { border: 1px solid var(--borda); border-top: 4px solid var(--k); border-radius: 14px; background: var(--superficie); padding: .8rem .9rem; transition: transform .15s, box-shadow .2s; }
.sc:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.sc h4 { font-size: .92rem; font-weight: 700; margin: 0 0 .4rem; color: color-mix(in srgb, var(--k) 55%, #fff); }
.sc ul { margin: 0; padding-left: 1.05rem; font-size: .84rem; line-height: 1.45; }
.sc li { margin-bottom: .25rem; }
.fc-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: .6rem; font-size: .9rem; }
.fc { perspective: 1200px; height: 270px; cursor: pointer; outline: none; }
.fc-in { position: relative; width: 100%; height: 100%; transition: transform .6s cubic-bezier(.2, .7, .2, 1); transform-style: preserve-3d; }
.fc.flip .fc-in { transform: rotateY(180deg); }
.fc-face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 18px; padding: 1.2rem 1.5rem; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; font-size: 1.12rem; line-height: 1.5; overflow: auto; border: 1px solid var(--borda-forte); }
.fc-face small { position: absolute; top: .7rem; left: 1rem; font-size: .66rem; letter-spacing: .14em; font-weight: 800; opacity: .6; }
.fc-front { background: linear-gradient(145deg, #1f2a42, #181d27); }
.fc-back { background: linear-gradient(145deg, #1d3a2c, #181d27); transform: rotateY(180deg); font-size: 1rem; text-align: left; align-items: flex-start; }
.fc-hint { position: absolute; bottom: .7rem; font-size: .7rem; color: var(--suave); }
.fc-btns { display: flex; justify-content: center; gap: .8rem; margin-top: .9rem; }
.fc-end { text-align: center; padding: 1.5rem .5rem; }
.fc-big { font-family: "Fraunces", Georgia, serif; font-size: 3rem; color: #e2b04f; }
