/* =====================================================================
   REDESIGN v2 – visual mais limpo, leitura confortável, páginas de matéria
   (carregado depois de style.css; sobrescreve o necessário)
   ===================================================================== */
:root { --brand: #4338ca; --brand2: #6d28d9; --soft: #f5f6fb; --line: #e3e7f0; --radius: 16px; --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 6px 20px rgba(15, 23, 42, .05); }
[data-bs-theme="dark"] { --soft: #0b1120; --card: #131c31; --line: #26334d; --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25); }
body { font-family: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif; letter-spacing: .005em; -webkit-font-smoothing: antialiased; }
#top { box-shadow: 0 1px 0 var(--line), 0 6px 18px rgba(15, 23, 42, .06); }
.topbar { background: linear-gradient(120deg, #1e1b4b 0%, #312e81 55%, #5b21b6 100%); padding-top: .55rem !important; padding-bottom: .55rem !important; }
.brand { letter-spacing: -.01em; font-size: 1.1rem; display: inline-flex; align-items: center; gap: .5rem; }
.brand::before { content: ""; width: 1.7rem; height: 1.7rem; border-radius: .55rem; background: conic-gradient(from 210deg, #f59e0b, #ec4899, #8b5cf6, #38bdf8, #f59e0b); display: inline-block; box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .85); }
.search input { background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .25); color: #fff; border-radius: 999px; padding-left: 1rem; }
.search input::placeholder { color: rgba(255, 255, 255, .75); }
.search input:focus { background: #fff; color: #111; box-shadow: 0 0 0 3px rgba(167, 139, 250, .5); }
.search input:focus::placeholder { color: #64748b; }
#tabs { padding: .35rem .75rem; gap: .15rem; background: var(--card); }
.tab { border-radius: 10px; padding: .45rem .75rem; font-size: .88rem; color: var(--bs-secondary-color); position: relative; transition: background .12s, color .12s; }
.tab:hover { background: var(--soft); color: var(--bs-body-color); }
.tab.active { background: color-mix(in srgb, var(--c, var(--brand)) 13%, var(--card)); color: var(--c, var(--brand)); }
.tab.active::after { content: ""; position: absolute; left: .75rem; right: .75rem; bottom: -.38rem; height: 3px; border-radius: 3px 3px 0 0; background: var(--c, var(--brand)); }
[data-bs-theme="dark"] .tab.active { color: #fff; }

main#app { max-width: 1320px; }
.article { border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--line); }
.hero { border-radius: 22px; padding: 2.4rem 2.2rem; position: relative; overflow: hidden; background: radial-gradient(1200px 400px at 90% -20%, rgba(236, 72, 153, .45), transparent 60%), linear-gradient(125deg, #1e1b4b, #3730a3 55%, #6d28d9); box-shadow: var(--shadow); }
.hero::after { content: ""; position: absolute; right: -60px; bottom: -80px; width: 280px; height: 280px; border-radius: 50%; background: rgba(255, 255, 255, .06); }
.hero h1 { letter-spacing: -.02em; }
.count { background: rgba(255, 255, 255, .12); backdrop-filter: blur(6px); border: 1px solid rgba(255, 255, 255, .18); }
.sim-hero { background: radial-gradient(900px 320px at 95% -20%, rgba(251, 191, 36, .35), transparent 60%), linear-gradient(125deg, #7f1d1d, #be123c 55%, #7c3aed); }
.subj { border-left-width: 1px; border-top: 5px solid var(--c); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.1rem 1.2rem; }
.subj:hover { transform: translateY(-4px); box-shadow: 0 14px 34px rgba(15, 23, 42, .14); }
.subj .ic { width: 2.9rem; height: 2.9rem; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.5rem; background: color-mix(in srgb, var(--c) 14%, var(--card)); }
.subj.sim-banner { border-top-width: 1px; border-left: 8px solid var(--c); }
.progress { border-radius: 99px; background: color-mix(in srgb, var(--bs-body-color) 9%, transparent); }
.progress-bar { border-radius: 99px; }

/* ----- leitura ----- */
.content { font-size: 1.06rem; line-height: 1.8; color: color-mix(in srgb, var(--bs-body-color) 92%, transparent); }
.content p { margin-bottom: 1.05rem; }
.content > h2, .content h1 { font-size: 1.45rem; letter-spacing: -.01em; margin-top: 2.2rem; padding-top: .3rem; color: var(--bs-body-color); display: flex; align-items: center; gap: .6rem; }
.content > h2::before, .content h1::before { content: ""; flex: 0 0 6px; align-self: stretch; border-radius: 6px; background: var(--c); }
.content h3 { font-size: 1.15rem; margin-top: 1.7rem; color: var(--c); }
[data-bs-theme="dark"] .content h3 { color: color-mix(in srgb, var(--c) 55%, #fff); }
.content ul, .content ol { padding-left: 1.4rem; }
.content li { margin-bottom: .4rem; }
.content li::marker { color: var(--c); font-weight: 700; }
.content blockquote { background: color-mix(in srgb, var(--c) 7%, var(--card)); border: 1px solid color-mix(in srgb, var(--c) 22%, var(--line)); border-left: 6px solid var(--c); border-radius: 12px; padding: .9rem 1.2rem; }
.content strong { color: var(--bs-body-color); }
.content .tag { border-radius: 12px; padding: .65rem .95rem; box-shadow: none; }
.content table { border-radius: 12px; overflow: hidden; }
.content table thead th { background: color-mix(in srgb, var(--c) 12%, var(--card)); }
.topic-head { margin: .1rem 0 1rem; }
.topic-title { border: 0; padding: 0; margin: .25rem 0 .6rem; font-size: 2rem; letter-spacing: -.02em; line-height: 1.2; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .6rem; }
.chip { font-size: .76rem; padding: .22rem .65rem; border-radius: 99px; background: color-mix(in srgb, var(--c) 11%, var(--card)); color: var(--c); font-weight: 600; border: 1px solid color-mix(in srgb, var(--c) 25%, transparent); text-decoration: none; }
[data-bs-theme="dark"] .chip { color: #fff; }
a.chip:hover { background: var(--c); color: #fff; }
.toc { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 1.3rem; padding: .8rem 1rem; border: 1px dashed var(--line); border-radius: 12px; background: var(--soft); align-items: center; }
.toc b { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--bs-secondary-color); margin-right: .3rem; }
.readbar { position: fixed; left: 0; top: 0; height: 3px; width: 0; z-index: 3000; background: linear-gradient(90deg, #f59e0b, #ec4899, #8b5cf6); transition: width .08s linear; }
.sidebar { border-radius: var(--radius); box-shadow: var(--shadow); }
.tlink { border-radius: 10px; padding: .4rem .55rem; }
.tlink.active { background: color-mix(in srgb, var(--c) 14%, var(--card)); color: var(--c); box-shadow: inset 3px 0 0 var(--c); }
[data-bs-theme="dark"] .tlink.active { color: #fff; }
.pager a { border-radius: 14px; background: var(--card); box-shadow: var(--shadow); }
.pager a:hover { border-color: var(--c); transform: translateY(-1px); }
.fig-inline { border-radius: 14px; box-shadow: var(--shadow); background: var(--card); }

/* ----- página inicial da matéria ----- */
.sub-hero { border-radius: 22px; padding: 2rem 2rem 1.6rem; color: #fff; background: linear-gradient(125deg, color-mix(in srgb, var(--c) 82%, #000), var(--c) 70%, color-mix(in srgb, var(--c) 60%, #ec4899)); box-shadow: var(--shadow); position: relative; overflow: hidden; }
.sub-hero::after { content: attr(data-ic); position: absolute; right: 1.2rem; bottom: -1.6rem; font-size: 9rem; opacity: .16; line-height: 1; }
.sub-hero h1 { font-weight: 800; letter-spacing: -.02em; }
.sub-hero .pill { display: inline-block; background: rgba(255, 255, 255, .18); border: 1px solid rgba(255, 255, 255, .25); border-radius: 99px; padding: .25rem .8rem; font-size: .82rem; margin: .2rem .3rem 0 0; }
.sub-hero .progress { background: rgba(255, 255, 255, .25); height: 8px; }
.sub-hero .progress-bar { background: #fff; }
.grp-title { display: flex; align-items: center; gap: .6rem; margin: 1.8rem 0 .7rem; font-weight: 800; font-size: 1.05rem; }
.grp-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.grp-title small { font-weight: 600; color: var(--bs-secondary-color); }
.tgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .75rem; }
.tcard { display: flex; gap: .7rem; align-items: flex-start; text-decoration: none; color: inherit; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: .8rem .9rem; box-shadow: var(--shadow); transition: transform .12s, border-color .12s; }
.tcard:hover { transform: translateY(-2px); border-color: var(--c); color: inherit; }
.tcard .num { flex: 0 0 2rem; height: 2rem; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; font-size: .78rem; font-weight: 800; background: color-mix(in srgb, var(--c) 13%, var(--card)); color: var(--c); }
[data-bs-theme="dark"] .tcard .num { color: #fff; }
.tcard.done .num { background: #16a34a; color: #fff; }
.tcard .tt { font-weight: 650; font-size: .93rem; line-height: 1.3; }
.tcard .ts { font-size: .74rem; color: var(--bs-secondary-color); }
.resume { display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; background: var(--card); border: 1px solid var(--line); border-left: 6px solid var(--c, var(--brand)); border-radius: 14px; padding: .9rem 1.1rem; box-shadow: var(--shadow); text-decoration: none; color: inherit; }
.resume:hover { color: inherit; border-color: var(--c); }

/* ----- questões reais do ENEM ----- */
.enem-q { display: flex; flex-direction: column; gap: .6rem; align-items: center; }
.enem-img { display: block; width: 100%; max-width: 820px; height: auto; background: #fff; border: 1px solid var(--line); border-radius: 12px; cursor: zoom-in; }
.enem-img.shared { border-style: dashed; }
[data-bs-theme="dark"] .enem-img { filter: brightness(.93); }
.enem-letters { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: center; margin-top: 1rem; }
.enem-let { width: 3.6rem; height: 3.6rem; border-radius: 50%; border: 2px solid var(--line); background: var(--card); color: var(--bs-body-color); font-size: 1.25rem; font-weight: 800; transition: transform .1s, border-color .12s; }
.enem-let:not(:disabled):hover { border-color: var(--c, var(--brand)); transform: translateY(-2px); }
.enem-let.sel { background: var(--c, #dc2626); border-color: transparent; color: #fff; }
.enem-let.ok { background: #16a34a; border-color: #16a34a; color: #fff; }
.enem-let.bad { background: #dc2626; border-color: #dc2626; color: #fff; }
.enem-let:disabled { cursor: default; opacity: 1; }
.enem-let:disabled:not(.ok):not(.bad) { opacity: .45; }
.modecard { height: 100%; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 1rem 1.1rem; box-shadow: var(--shadow); }
.modecard.real { border-color: color-mix(in srgb, var(--c, var(--brand)) 55%, var(--line)); }
.modecard h3 { font-size: 1.05rem; font-weight: 800; }
.modecard p { font-size: .9rem; }
.lb-overlay { position: fixed; inset: 0; z-index: 4000; background: rgba(2, 6, 23, .92); display: flex; align-items: flex-start; justify-content: center; overflow: auto; padding: 1rem; cursor: zoom-out; }
.lb-overlay img { max-width: min(1100px, 100%); height: auto; background: #fff; border-radius: 8px; }
.qreview .enem-img { margin-top: .6rem; }

/* ----- redação ----- */
.red-wrap .red-title { margin-bottom: 1rem; }
.red-kicker { display: inline-block; font-size: .76rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #dc2626; }
.red-title h2 { font-size: 1.35rem; font-weight: 800; line-height: 1.3; margin: .15rem 0 0; letter-spacing: -.01em; }
.red-prop { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 1.1rem 1.2rem; box-shadow: var(--shadow); max-height: 88vh; overflow: auto; }
@media (min-width: 1200px) { .red-prop, .red-editor { position: sticky; top: calc(var(--top-h) + 12px); } .red-prop { max-height: calc(100vh - var(--top-h) - 30px); } }
.red-prop-head { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin-bottom: .8rem; }
.red-prop .enem-img { margin-bottom: .6rem; }
.red-h { font-size: .95rem; font-weight: 800; text-align: center; letter-spacing: .05em; margin: .3rem 0 .5rem; }
.red-cmd { font-size: .97rem; line-height: 1.65; padding: .75rem .95rem; border-radius: 12px; background: var(--soft); border: 1px solid var(--line); }
.red-text { border-left: 5px solid #dc2626; background: color-mix(in srgb, #dc2626 4%, var(--card)); border-radius: 0 12px 12px 0; padding: .7rem 1rem; margin: .9rem 0; }
.red-text h4 { font-size: .78rem; font-weight: 800; letter-spacing: .08em; color: #dc2626; margin: 0; }
.red-text h5 { font-size: 1rem; font-weight: 750; margin: .15rem 0 .35rem; }
.red-text p { font-size: .96rem; line-height: 1.7; margin-bottom: .3rem; text-align: justify; }
.red-text small { color: var(--bs-secondary-color); font-size: .72rem; }
.red-note { font-size: .82rem; line-height: 1.5; border: 1px dashed var(--line); border-radius: 12px; padding: .65rem .85rem; color: var(--bs-secondary-color); }
.red-editor { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 1rem; box-shadow: var(--shadow); align-self: flex-start; }
.red-tips { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .7rem; }
.red-tips span { font-size: .72rem; padding: .2rem .6rem; border-radius: 99px; background: color-mix(in srgb, #dc2626 9%, var(--card)); color: #b91c1c; font-weight: 650; }
[data-bs-theme="dark"] .red-tips span { color: #fecaca; }
.essay-paper { display: block; width: 100%; min-height: 36rem; resize: vertical; font: 1.08rem/2rem Georgia, "Times New Roman", serif; padding: 0 1rem 0 3.4rem; color: var(--bs-body-color); border: 1px solid var(--line); border-radius: 12px; outline: none;
  background-color: var(--card);
  background-image: linear-gradient(to right, transparent 2.8rem, #f87171 2.8rem, #f87171 calc(2.8rem + 1.5px), transparent calc(2.8rem + 1.5px)), repeating-linear-gradient(to bottom, transparent 0, transparent calc(2rem - 1px), color-mix(in srgb, #2563eb 28%, transparent) calc(2rem - 1px), color-mix(in srgb, #2563eb 28%, transparent) 2rem);
  background-attachment: scroll, local; }
.essay-paper:focus { border-color: #dc2626; box-shadow: 0 0 0 3px rgba(220, 38, 38, .15); }
.red-meter { margin-top: .6rem; }
.red-bar { position: relative; height: 10px; border-radius: 99px; background: color-mix(in srgb, var(--bs-body-color) 10%, transparent); margin-bottom: .35rem; }
.red-bar i { display: block; height: 100%; border-radius: 99px; background: #94a3b8; transition: width .15s; }
.red-bar i.bad { background: #dc2626; } .red-bar i.mid { background: #f59e0b; } .red-bar i.ok { background: #16a34a; } .red-bar i.over { background: #ea580c; }
.red-bar b { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--bs-body-color); opacity: .35; }
.red-bar .m7 { left: calc(7 / 30 * 100%); } .red-bar .m25 { left: calc(25 / 30 * 100%); }
.red-res .red-score { flex: 0 0 auto; width: 120px; height: 120px; border-radius: 50%; display: flex; align-items: center; justify-content: center; position: relative; font-size: .9rem; background: conic-gradient(#dc2626 calc(var(--p, 0) * 1%), var(--line) 0); }
.red-res .red-score::before { content: ""; position: absolute; inset: 9px; border-radius: 50%; background: var(--card); }
.red-res .red-score b { position: relative; font-size: 1.9rem; margin-right: .1rem; }
.red-res .red-score > * { position: relative; }
.red-score.zero { background: var(--line) !important; }
.red-comps { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: .75rem; margin-top: 1rem; }
.red-comp, .red-box { border: 1px solid var(--line); border-radius: 14px; padding: .8rem 1rem; background: var(--soft); }
.red-comp ul { padding-left: 1.1rem; margin: .3rem 0 0; }
.red-good li::marker { color: #16a34a; } .red-imp li::marker { color: #dc2626; }
.red-pts { font-weight: 800; }
.progress-bar.lv0, .progress-bar.lv1 { background: #dc2626; } .progress-bar.lv2 { background: #f97316; } .progress-bar.lv3 { background: #eab308; } .progress-bar.lv4 { background: #84cc16; } .progress-bar.lv5 { background: #16a34a; }
.red-pts.lv0, .red-pts.lv1 { color: #dc2626; } .red-pts.lv2 { color: #ea580c; } .red-pts.lv3 { color: #ca8a04; } .red-pts.lv4 { color: #65a30d; } .red-pts.lv5 { color: #16a34a; }
@media (max-width: 575.98px) { .enem-let { width: 3rem; height: 3rem; } .hero { padding: 1.5rem 1.2rem; } .topic-title { font-size: 1.55rem; } }
