/* Grifo — app */
body { background: var(--paper); }
.shell { display: grid; grid-template-columns: 290px 1fr; min-height: 100vh; min-height: 100dvh; }
.only-mobile { display: none !important; }

/* Sidebar */
.side { position: sticky; top: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column; gap: 1rem; padding: 1.2rem 1rem; background: var(--sheet); border-right: 1px solid var(--rule); }
.side-top { display: flex; justify-content: space-between; align-items: center; padding: 0 .3rem; }
.new-btn { width: 100%; }
.side-h { font-size: .95rem; font-family: var(--f-body); font-weight: 700; color: var(--ink-3); letter-spacing: 0; padding: .4rem .4rem 0; }
.lib { flex: 1; overflow-y: auto; display: grid; align-content: start; gap: 2px; margin: 0 -.3rem; padding: 0 .3rem; }
.lib a { display: grid; gap: 1px; padding: .6rem .7rem; border-radius: var(--r-sm); text-decoration: none; color: var(--ink); }
.lib a:hover { background: var(--paper); }
.lib a.on { background: var(--bic-wash); }
.lib .l-t { font-weight: 700; font-size: .95rem; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lib .l-m { font-size: .8rem; color: var(--ink-3); display: flex; gap: .4rem; align-items: center; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); flex: none; }
.dot.work { background: var(--marca); box-shadow: 0 0 0 2px #E9C200 inset; }
.dot.err { background: var(--erro); }
.lib-empty { font-size: .9rem; color: var(--ink-3); padding: .4rem; }
.side-foot { display: grid; gap: .5rem; padding-top: .6rem; border-top: 1px solid var(--rule); }
.mode-badge { font-size: .82rem; color: var(--ink-2); background: var(--marca-soft); border-radius: var(--r-sm); padding: .55rem .7rem; line-height: 1.4; }
.link-btn { background: none; border: 0; color: var(--bic); text-align: left; cursor: pointer; padding: .2rem .4rem; font-size: .9rem; }
.icon-btn { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; border: 0; background: transparent; font-size: 1.25rem; cursor: pointer; text-decoration: none; color: var(--ink); }
.icon-btn:hover { background: var(--paper); }
.scrim { display: none; }

.main { min-width: 0; }
#view { outline: none; padding: clamp(1.2rem, 4vw, 2.6rem) clamp(1rem, 4vw, 3rem) 5rem; max-width: 1060px; margin: 0 auto; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .only-mobile { display: flex !important; }
  .side { position: fixed; inset: 0 auto 0 0; width: min(86vw, 320px); z-index: 40; transform: translateX(-102%); transition: transform .25s var(--ease); box-shadow: 0 0 40px rgba(0,0,0,.15); }
  .side.open { transform: none; }
  .scrim.open { display: block; position: fixed; inset: 0; background: rgba(26,31,54,.35); z-index: 30; }
  .topbar { position: sticky; top: 0; z-index: 20; align-items: center; justify-content: space-between; padding: .5rem .6rem; padding-top: max(.5rem, env(safe-area-inset-top)); background: rgba(243,245,251,.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--rule); }
  .topbar .logo { font-size: 1.25rem; }
}

/* Títulos de página */
.page-h { font-size: clamp(2rem, 4.5vw, 3rem); font-weight: 800; letter-spacing: -0.035em; }
.page-sub { color: var(--ink-2); margin-top: .6rem; font-size: 1.08rem; max-width: 56ch; }

/* ---------- Nova aula ---------- */
.new { display: grid; gap: 1.6rem; }
.sources { display: inline-flex; gap: 4px; padding: 4px; background: var(--sheet); border-radius: 999px; box-shadow: var(--shadow-sheet); flex-wrap: wrap; }
.sources button { border: 0; background: transparent; padding: .6rem 1.1rem; border-radius: 999px; font-weight: 700; cursor: pointer; color: var(--ink-2); }
.sources button[aria-selected="true"] { background: var(--ink); color: #fff; }
.card { background: var(--sheet); border-radius: var(--r-lg); box-shadow: var(--shadow-sheet); padding: clamp(1.2rem, 3vw, 2rem); }
.drop { border: 2px dashed #B8C1DE; border-radius: var(--r-md); padding: clamp(2rem, 6vw, 3.4rem) 1rem; display: grid; justify-items: center; gap: .7rem; text-align: center; cursor: pointer; transition: background .15s, border-color .15s; }
.drop:hover, .drop.over { background: var(--bic-wash); border-color: var(--bic); }
.drop-ic { width: 56px; height: 56px; border-radius: 16px; background: var(--marca); display: grid; place-items: center; font-size: 1.6rem; }
.drop strong { font-family: var(--f-display); font-size: 1.3rem; }
.drop span { color: var(--ink-3); font-size: .92rem; }
.file-pill { display: flex; align-items: center; gap: .8rem; padding: .8rem 1rem; border-radius: var(--r-md); background: var(--bic-wash); margin-top: 1rem; }
.file-pill b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1.4rem; }
.field { display: grid; gap: .35rem; }
.field label { font-weight: 700; font-size: .92rem; }
.field input, .field textarea, .field select { width: 100%; border: 1.5px solid var(--rule); border-radius: var(--r-sm); padding: .7rem .8rem; background: var(--paper); }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--bic); background: #fff; }
.field.full { grid-column: 1 / -1; }
.field textarea { min-height: 220px; resize: vertical; line-height: 1.5; }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; margin-top: 1.4rem; }
.hint { font-size: .9rem; color: var(--ink-3); }
@media (max-width: 640px) { .fields { grid-template-columns: 1fr; } }

/* Gravador */
.recorder { display: grid; justify-items: center; gap: 1.1rem; padding: 1.5rem 0 .5rem; text-align: center; }
.rec-btn { width: 112px; height: 112px; border-radius: 50%; border: 0; cursor: pointer; background: var(--erro); color: #fff; font-weight: 800; font-family: var(--f-display); font-size: 1.05rem; box-shadow: 0 0 0 10px var(--erro-wash); transition: transform .15s; }
.rec-btn:hover { transform: scale(1.03); }
.rec-btn.on { background: var(--ink); box-shadow: 0 0 0 10px #E3E6F0; animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 18px #E3E6F0; } }
.rec-time { font-family: var(--f-display); font-size: 2.6rem; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.meter { width: min(100%, 360px); height: 48px; }
.meter rect { fill: var(--bic); }

.recent { margin-top: .6rem; }
.recent h2 { font-size: 1.3rem; margin-bottom: .8rem; }
.recent-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .8rem; }
.recent-grid a { background: var(--sheet); border-radius: var(--r-md); padding: 1rem 1.1rem; text-decoration: none; color: var(--ink); box-shadow: var(--shadow-sheet); display: grid; gap: .3rem; }
.recent-grid a:hover { outline: 2px solid var(--bic); }
.recent-grid small { color: var(--ink-3); }

/* ---------- Processando ---------- */
.proc { max-width: 640px; }
.proc-steps { list-style: none; margin: 2rem 0 0; padding: 0; display: grid; gap: .4rem; }
.proc-steps li { display: grid; grid-template-columns: 34px 1fr auto; gap: .8rem; align-items: center; padding: .85rem 1rem; border-radius: var(--r-md); background: var(--sheet); }
.proc-steps .ic { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; background: var(--paper); color: var(--ink-3); font-size: .9rem; }
.proc-steps li.run .ic { background: var(--marca); color: var(--ink); animation: spin-soft 1.4s linear infinite; }
.proc-steps li.ok .ic { background: var(--ok); color: #fff; }
.proc-steps li.err .ic { background: var(--erro); color: #fff; }
.proc-steps li small { color: var(--ink-3); font-variant-numeric: tabular-nums; }
@keyframes spin-soft { 50% { transform: scale(.86); } }
.bar { height: 8px; border-radius: 99px; background: var(--rule); overflow: hidden; margin-top: 1.6rem; }
.bar i { display: block; height: 100%; width: 0; background: var(--bic); transition: width .4s var(--ease); }
.proc-tip { margin-top: 1.4rem; font-family: var(--f-hand); font-size: 1.45rem; color: var(--bic); }

/* ---------- Aula ---------- */
.lesson-h { display: flex; justify-content: space-between; gap: 1rem; align-items: start; flex-wrap: wrap; }
.lesson-h h1 { font-size: clamp(1.8rem, 4vw, 2.7rem); font-weight: 800; letter-spacing: -0.035em; max-width: 24ch; }
.meta { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .8rem; }
.chip { font-size: .85rem; font-weight: 700; padding: .3rem .7rem; border-radius: 999px; background: var(--sheet); color: var(--ink-2); }
.chip.subj { background: var(--bic-wash); color: var(--bic-deep); }
.lesson-acts { display: flex; gap: .4rem; }
.tabs { position: sticky; top: 0; z-index: 5; display: flex; gap: .3rem; overflow-x: auto; margin: 1.6rem -1rem 1.6rem; padding: .6rem 1rem; background: rgba(243,245,251,.94); backdrop-filter: blur(8px); scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { flex: none; text-decoration: none; padding: .55rem 1rem; border-radius: 999px; font-weight: 700; color: var(--ink-2); font-size: .97rem; display: inline-flex; gap: .4rem; align-items: center; }
.tabs a:hover { color: var(--bic); }
.tabs a.on { background: var(--bic); color: #fff; }
.tabs .n { font-size: .78rem; opacity: .7; }
@media (max-width: 900px) { .tabs { top: 58px; } }

.pane-acts { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.2rem; }
.empty-pane { text-align: center; padding: 3rem 1rem; display: grid; gap: 1rem; justify-items: center; }

/* Resumo */
.resumo-grid { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 1.6rem; align-items: start; }
@media (max-width: 1000px) { .resumo-grid { grid-template-columns: 1fr; } }
.doc {
  background:
    linear-gradient(90deg, transparent 0, transparent calc(clamp(1rem, 4vw, 3rem) - 14px), var(--margin) calc(clamp(1rem, 4vw, 3rem) - 14px), var(--margin) calc(clamp(1rem, 4vw, 3rem) - 12px), transparent calc(clamp(1rem, 4vw, 3rem) - 12px)),
    var(--sheet);
  border-radius: var(--r-lg); box-shadow: var(--shadow-sheet);
  padding: clamp(1.3rem, 4vw, 2.6rem) clamp(1.2rem, 4vw, 3rem);
  font-size: 1.06rem; line-height: 1.7;
}
.doc .short { font-size: 1.15rem; color: var(--ink-2); border-left: 4px solid var(--marca); padding-left: 1rem; margin-bottom: 1.4rem; }
.md h2 { font-size: 1.55rem; margin: 2rem 0 .7rem; color: var(--bic-deep); }
.md h2:first-child { margin-top: 0; }
.md h3 { font-size: 1.18rem; margin: 1.4rem 0 .4rem; }
.md p { margin: .6rem 0; max-width: 72ch; }
.md ul, .md ol { margin: .5rem 0; padding-left: 1.3rem; max-width: 70ch; }
.md li { margin: .25rem 0; }
.md li::marker { color: var(--bic); font-weight: 700; }
.md blockquote { margin: 1rem 0; padding: .9rem 1.1rem; background: var(--bic-wash); border-radius: var(--r-sm); font-family: var(--f-display); font-weight: 700; font-size: 1.12rem; color: var(--bic-deep); }
.md code { background: var(--paper); padding: .1em .35em; border-radius: 5px; font-size: .92em; }
.md .tbl { overflow-x: auto; margin: 1rem 0; }
.md table { border-collapse: collapse; width: 100%; font-size: .96rem; }
.md th, .md td { text-align: left; padding: .55rem .7rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
.md th { font-family: var(--f-display); background: var(--paper); }
.aside { display: grid; gap: 1rem; position: sticky; top: 80px; }
.aside .card { padding: 1.2rem; }
.aside h3 { font-size: 1.05rem; margin-bottom: .7rem; }
.gloss { display: grid; gap: .6rem; margin: 0; }
.gloss dt { font-weight: 700; }
.gloss dd { margin: 0; color: var(--ink-2); font-size: .93rem; }
.provas { margin: 0; padding-left: 1.1rem; display: grid; gap: .45rem; font-size: .95rem; }
.provas li::marker { content: "★ "; color: #E0B400; }

/* Flashcards */
.fc-wrap { display: grid; justify-items: center; gap: 1.2rem; }
.fc-top { width: 100%; max-width: 640px; display: flex; justify-content: space-between; align-items: center; gap: 1rem; color: var(--ink-2); font-weight: 700; }
.fc-prog { flex: 1; height: 6px; background: var(--rule); border-radius: 9px; overflow: hidden; }
.fc-prog i { display: block; height: 100%; background: var(--ok); transition: width .3s; }
.fc { display: block; width: 100%; max-width: 640px; aspect-ratio: 3 / 2; perspective: 1400px; border: 0; padding: 0; background: none; cursor: pointer; }
.fc-in { display: block; position: relative; width: 100%; height: 100%; transition: transform .55s var(--ease); transform-style: preserve-3d; }
.fc.flipped .fc-in { transform: rotateY(180deg); }
.fc-face { position: absolute; inset: 0; backface-visibility: hidden; border-radius: var(--r-lg); display: grid; place-items: center; padding: 2rem; text-align: center; box-shadow: var(--shadow-sheet); font-size: clamp(1.15rem, 2.6vw, 1.6rem); line-height: 1.35; }
.fc-front { background: repeating-linear-gradient(180deg, transparent 0 39px, #EFE3A0 39px 40px), var(--marca-soft); font-family: var(--f-display); font-weight: 700; }
.fc-back { background: var(--sheet); transform: rotateY(180deg); color: var(--ink); }
.fc-tag { position: absolute; top: 1rem; left: 1.2rem; font-size: .8rem; font-family: var(--f-body); font-weight: 700; color: var(--ink-3); }
.fc-turn { position: absolute; bottom: 1rem; right: 1.2rem; font-family: var(--f-hand); font-size: 1.25rem; color: var(--bic); font-weight: 500; }
.fc-btns { display: flex; gap: .6rem; flex-wrap: wrap; justify-content: center; }
.btn-erro { background: var(--erro-wash); color: var(--erro); }
.btn-ok { background: var(--ok-wash); color: var(--ok); }
.fc-done { text-align: center; display: grid; gap: .8rem; justify-items: center; padding: 2rem 1rem; }
.big-n { font-family: var(--f-display); font-size: 4rem; font-weight: 800; line-height: 1; color: var(--bic); }
.kbd { font-size: .85rem; color: var(--ink-3); }

/* Quiz */
.qz { max-width: 720px; margin: 0 auto; }
.qz-top { display: flex; justify-content: space-between; align-items: center; color: var(--ink-2); font-weight: 700; margin-bottom: 1rem; gap: 1rem; }
.lvl { font-size: .8rem; padding: .2rem .6rem; border-radius: 99px; background: var(--paper); }
.qz-q { font-family: var(--f-display); font-size: clamp(1.3rem, 2.8vw, 1.7rem); font-weight: 700; line-height: 1.25; letter-spacing: -0.01em; }
.qz-opts { display: grid; gap: .6rem; margin: 1.4rem 0; }
.qz-opt { display: grid; grid-template-columns: 34px 1fr; gap: .8rem; align-items: center; text-align: left; width: 100%; padding: .9rem 1rem; border-radius: var(--r-md); border: 2px solid var(--rule); background: var(--sheet); cursor: pointer; font-size: 1.03rem; transition: border-color .15s, background .15s; }
.qz-opt:hover:not([disabled]) { border-color: var(--bic); }
.qz-opt .lt { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--paper); font-weight: 800; font-family: var(--f-display); }
.qz-opt.right { border-color: var(--ok); background: var(--ok-wash); }
.qz-opt.right .lt { background: var(--ok); color: #fff; }
.qz-opt.wrong { border-color: var(--erro); background: var(--erro-wash); }
.qz-opt.wrong .lt { background: var(--erro); color: #fff; }
.qz-opt[disabled] { cursor: default; }
.qz-exp { padding: 1rem 1.2rem; border-radius: var(--r-md); background: var(--bic-wash); color: var(--ink); }
.qz-exp b { color: var(--bic-deep); }
.qz-end { text-align: center; display: grid; gap: 1rem; justify-items: center; }
.qz-review { text-align: left; width: 100%; display: grid; gap: .6rem; margin-top: 1rem; }
.qz-review div { background: var(--sheet); border-radius: var(--r-md); padding: .9rem 1rem; border-left: 5px solid var(--ok); }
.qz-review div.x { border-left-color: var(--erro); }
.qz-review small { color: var(--ink-2); display: block; margin-top: .3rem; }

/* Slides */
.sl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.sl-thumb { border: 0; padding: 0; background: none; cursor: pointer; text-align: left; display: grid; gap: .4rem; }
.sl-thumb small { color: var(--ink-3); font-weight: 700; }
.slide { aspect-ratio: 16 / 9; width: 100%; border-radius: 12px; overflow: hidden; position: relative; container-type: inline-size; background: var(--sheet); box-shadow: var(--shadow-sheet); color: var(--ink); }
.sl-thumb:hover .slide { outline: 3px solid var(--bic); }
.slide .sx { position: absolute; inset: 0; padding: 7cqw 7cqw 6cqw; display: flex; flex-direction: column; gap: 3cqw; }
.slide h4 { font-family: var(--f-display); font-weight: 800; font-size: 5.6cqw; letter-spacing: -0.03em; line-height: 1.05; }
.slide ul { margin: 0; padding-left: 4cqw; display: grid; gap: 1.6cqw; font-size: 3.1cqw; line-height: 1.3; }
.slide li::marker { color: var(--bic); }
.slide.capa { background: var(--bic); color: #fff; }
.slide.capa .sx { justify-content: flex-end; }
.slide.capa h4 { font-size: 9cqw; }
.slide.capa p { font-size: 3.4cqw; color: #D5D9FF; max-width: 80%; }
.slide.capa::after { content: ""; position: absolute; left: 7cqw; top: 8cqw; width: 22cqw; height: 4cqw; background: var(--marca); transform: skewX(-12deg); border-radius: 2px; }
.slide.destaque { background: var(--marca); }
.slide.destaque .sx { justify-content: center; }
.slide.destaque small { font-size: 2.6cqw; font-weight: 700; color: #6B5A00; }
.slide.destaque p { font-family: var(--f-display); font-weight: 800; font-size: 6.4cqw; line-height: 1.1; letter-spacing: -0.03em; }
.slide .cols { display: grid; grid-template-columns: 1fr 1fr; gap: 3cqw; flex: 1; }
.slide .col { background: var(--bic-wash); border-radius: 2cqw; padding: 3cqw; }
.slide .col + .col { background: var(--marca-soft); }
.slide .col b { font-family: var(--f-display); font-size: 3.4cqw; display: block; margin-bottom: 1.4cqw; }
.slide .col ul { font-size: 2.7cqw; }
.slide .pg { position: absolute; right: 4cqw; bottom: 3cqw; font-size: 2cqw; color: var(--ink-3); font-weight: 700; }
.slide.capa .pg { color: #B9BFFF; }
.slide .brand { position: absolute; left: 7cqw; bottom: 3cqw; font-family: var(--f-display); font-weight: 800; font-size: 2.2cqw; color: var(--bic); }
.slide.capa .brand { display: none; }

.present { position: fixed; inset: 0; z-index: 100; background: #0E1226; display: grid; grid-template-rows: 1fr auto; padding: 2vh 2vw; }
.present .stage { display: grid; place-items: center; min-height: 0; }
.present .slide { width: min(96vw, calc(86vh * 16 / 9)); box-shadow: none; }
.present .bar-p { display: flex; justify-content: center; align-items: center; gap: 1rem; color: #C7CCE6; padding-top: 1.2vh; }
.present .bar-p button { background: rgba(255,255,255,.1); color: #fff; border: 0; border-radius: 99px; padding: .5rem 1rem; cursor: pointer; font-weight: 700; }
.present .note { color: #9DA4C7; font-size: .95rem; text-align: center; max-width: 80ch; margin: 0 auto; }

/* Tutor */
.chat { display: grid; grid-template-rows: 1fr auto; gap: 1rem; max-width: 760px; margin: 0 auto; min-height: 60vh; }
.msgs { display: flex; flex-direction: column; gap: .8rem; }
.msg { max-width: 88%; padding: .85rem 1.05rem; border-radius: 18px; line-height: 1.55; }
.msg.me { align-self: flex-end; background: var(--bic); color: #fff; border-bottom-right-radius: 5px; }
.msg.bot { align-self: flex-start; background: var(--sheet); box-shadow: var(--shadow-sheet); border-bottom-left-radius: 5px; }
.msg.bot.typing { color: var(--ink-3); font-style: italic; }
.msg .md p { margin: .3rem 0; }
.suggest { display: flex; flex-wrap: wrap; gap: .5rem; }
.suggest button { border: 1.5px solid var(--rule); background: var(--sheet); border-radius: 99px; padding: .5rem .9rem; cursor: pointer; font-size: .93rem; }
.suggest button:hover { border-color: var(--bic); color: var(--bic); }
.ask { position: sticky; bottom: 1rem; display: flex; gap: .5rem; background: var(--sheet); padding: .5rem; border-radius: 999px; box-shadow: var(--shadow-sheet); }
.ask input { flex: 1; border: 0; background: transparent; padding: 0 .9rem; min-width: 0; outline: none; font-size: 1.02rem; }

/* Transcrição */
.tr-search { display: flex; gap: .6rem; margin-bottom: 1rem; }
.tr-search input { flex: 1; border: 1.5px solid var(--rule); border-radius: 99px; padding: .65rem 1.1rem; background: var(--sheet); }
.tr { display: grid; gap: .2rem; }
.tr p { display: grid; grid-template-columns: 62px 1fr; gap: .8rem; padding: .6rem .4rem; border-radius: var(--r-sm); max-width: none; }
.tr p:hover { background: var(--sheet); }
.tr .ts { font-family: var(--f-display); font-weight: 700; color: var(--bic); font-variant-numeric: tabular-nums; padding-top: .05rem; }

/* Toast, diálogo */
.toast { position: fixed; left: 50%; bottom: 1.4rem; transform: translate(-50%, 140%); background: var(--ink); color: #fff; padding: .8rem 1.2rem; border-radius: 99px; font-weight: 700; z-index: 200; transition: transform .25s var(--ease); max-width: 92vw; text-align: center; }
.toast.show { transform: translate(-50%, 0); }
dialog { border: 0; border-radius: var(--r-lg); padding: 1.8rem; max-width: 440px; width: 92vw; box-shadow: 0 30px 80px -20px rgba(23,32,143,.45); }
dialog::backdrop { background: rgba(26,31,54,.45); }
dialog h2 { font-size: 1.5rem; margin-bottom: .6rem; }
dialog p { color: var(--ink-2); }
dialog .field { margin-top: 1rem; }
dialog .actions { justify-content: flex-end; }

.banner { display: flex; gap: .8rem; align-items: center; padding: .8rem 1rem; border-radius: var(--r-md); background: var(--marca-soft); margin-bottom: 1.4rem; font-size: .95rem; }
.banner.err { background: var(--erro-wash); color: #8A1C22; }

/* Impressão / PDF */
@media print {
  .side, .topbar, .tabs, .pane-acts, .lesson-acts, .toast, .aside, .ask, .suggest { display: none !important; }
  .shell { display: block; }
  body, .doc { background: #fff !important; box-shadow: none !important; }
  #view { padding: 0; max-width: none; }
  .doc { padding: 0; }
  .md h2 { break-after: avoid; }
  .resumo-grid { display: block; }
  .print-slides .sl-grid { display: block; }
  .print-slides .sl-thumb { display: block; break-inside: avoid; page-break-after: always; margin: 0; }
  .print-slides .sl-thumb small { display: none; }
  .print-slides .slide { box-shadow: none; border: 1px solid #ddd; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .fc-btns, .fc-top, .kbd { display: none !important; }
}
@page { margin: 14mm; }

/* ===================== v2 ===================== */
.lib-q { width: 100%; border: 1.5px solid var(--rule); border-radius: 99px; padding: .5rem .9rem; background: var(--paper); font-size: .92rem; }
.lib-q:focus { outline: none; border-color: var(--bic); background: #fff; }
.fp-ic { width: 34px; height: 34px; border-radius: 10px; background: var(--marca); display: grid; place-items: center; font-weight: 800; }
.icon-btn.sm { width: 34px; height: 34px; font-size: 1rem; color: var(--ink-3); }
.icon-btn.sm:hover { color: var(--bic); }

/* Controles segmentados */
.opt { display: grid; gap: .35rem; }
.opt-l { font-size: .85rem; font-weight: 700; color: var(--ink-2); }
.segc { display: inline-flex; flex-wrap: wrap; gap: 3px; padding: 3px; background: var(--paper); border-radius: 12px; border: 1px solid var(--rule); width: fit-content; max-width: 100%; }
.segc button { border: 0; background: transparent; padding: .42rem .8rem; border-radius: 9px; font-weight: 700; font-size: .9rem; cursor: pointer; color: var(--ink-2); }
.segc button:hover { color: var(--bic); }
.segc button[aria-checked="true"] { background: var(--sheet); color: var(--bic-deep); box-shadow: 0 1px 3px rgba(23,32,143,.18); }

/* Personalizar */
.custom { margin-top: 1.4rem; border: 1.5px solid var(--rule); border-radius: var(--r-md); }
.custom summary { list-style: none; cursor: pointer; padding: .9rem 1.1rem; display: flex; flex-wrap: wrap; gap: .3rem 1rem; align-items: baseline; justify-content: space-between; font-weight: 700; }
.custom summary::-webkit-details-marker { display: none; }
.custom summary span::before { content: "▸ "; color: var(--bic); display: inline-block; transition: transform .2s; }
.custom[open] summary span::before { content: "▾ "; }
.custom summary small { font-weight: 400; color: var(--ink-3); font-size: .88rem; }
.custom-in { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.4rem 2rem; padding: .4rem 1.1rem 1.3rem; }
.cgroup { display: grid; gap: .7rem; align-content: start; }
.cgroup h3 { font-size: 1.02rem; }
.cgroup.wide { grid-column: 1 / -1; border-top: 1px solid var(--rule); padding-top: 1.1rem; }
.fields.tight { margin-top: 0; }
.field small.hint { font-size: .82rem; }
.field select { appearance: auto; }
@media (max-width: 700px) { .custom-in { grid-template-columns: 1fr; } }
.opts-grid { display: grid; gap: 1rem; margin-top: 1rem; }

/* Barra de ações dos painéis */
.pane-bar { display: flex; flex-wrap: wrap; gap: .8rem 1rem; align-items: center; justify-content: space-between; margin-bottom: 1.2rem; }
.pane-bar .pane-acts { margin: 0; }
.lvl-switch .opt { grid-auto-flow: column; align-items: center; gap: .7rem; }
.subtabs { display: inline-flex; gap: 4px; padding: 4px; background: var(--sheet); border-radius: 999px; box-shadow: var(--shadow-sheet); }
.subtabs button { border: 0; background: transparent; padding: .5rem 1rem; border-radius: 999px; font-weight: 700; cursor: pointer; color: var(--ink-2); }
.subtabs button[aria-selected="true"] { background: var(--ink); color: #fff; }

.loading { display: grid; justify-items: center; gap: .8rem; text-align: center; padding: 3.5rem 1rem; }
.spin { width: 44px; height: 44px; border-radius: 50%; border: 4px solid var(--bic-wash); border-top-color: var(--bic); animation: rot 0.9s linear infinite; }
@keyframes rot { to { transform: rotate(360deg); } }

/* Resumo: extras */
.avisos { background: var(--marca-soft) !important; }
.avisos ul { margin: 0; padding-left: 1.1rem; display: grid; gap: .4rem; font-size: .95rem; }
.filt { text-decoration: none; color: var(--ink); display: grid; gap: .3rem; }
.filt p { font-size: .93rem; color: var(--ink-2); }
.filt:hover { outline: 2px solid var(--bic); }
.sel-hint { font-size: .85rem; padding: 0 .3rem; }
.sel-btn { position: absolute; z-index: 60; background: var(--ink); color: #fff; border: 0; border-radius: 99px; padding: .5rem .9rem; font-weight: 700; font-size: .9rem; cursor: pointer; box-shadow: 0 8px 24px -8px rgba(0,0,0,.4); }
.sel-btn[hidden] { display: none; }

/* Flashcards: estatísticas e montador */
.fc-stats { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: center; margin-bottom: 1.2rem; }
.fc-stats span { background: var(--sheet); border-radius: 99px; padding: .4rem .9rem; font-size: .9rem; color: var(--ink-2); }
.fc-stats b { color: var(--bic-deep); font-family: var(--f-display); }
.builder { display: grid; gap: 1rem; margin-bottom: 1.2rem; }
.builder h3 { font-size: 1.1rem; }
.builder .actions { margin-top: 0; }
.ai-row { display: flex; flex-wrap: wrap; gap: 1rem; align-items: end; }
.ai-row .grow { flex: 1 1 260px; }
.card-list { display: grid; gap: .5rem; }
.crow { display: grid; grid-template-columns: 30px 1fr auto auto auto; gap: .6rem; align-items: center; background: var(--sheet); border-radius: var(--r-md); padding: .7rem .8rem; }
.cn { font-family: var(--f-display); font-weight: 800; color: var(--ink-3); text-align: center; }
.cq { display: grid; gap: .15rem; min-width: 0; }
.cq b { font-size: .98rem; }
.cq span { color: var(--ink-2); font-size: .93rem; }
.cq small { color: var(--bic); font-size: .8rem; font-weight: 700; }
.cbox { font-size: .7rem; letter-spacing: 1px; color: var(--ok); white-space: nowrap; }
@media (max-width: 560px) { .crow { grid-template-columns: 1fr auto auto; } .cn, .cbox { display: none; } }

/* Quiz: Certo ou Errado */
.qz-tags { display: inline-flex; gap: .4rem; }
.lvl.ce { background: var(--bic-wash); color: var(--bic-deep); }
.qz-opts.ce { grid-template-columns: 1fr 1fr; }

/* Transcrição v2 */
.tr-stats { display: grid; gap: .9rem; margin-bottom: 1rem; padding: 1.2rem 1.3rem; }
.tr-meter { display: flex; height: 12px; border-radius: 99px; overflow: hidden; background: var(--rule); }
.tr-meter i { display: block; height: 100%; }
.tr-meter .c, .tr-legend i.c { background: var(--bic); }
.tr-meter .a, .tr-legend i.a { background: #E9C200; }
.tr-meter .v, .tr-legend i.v { background: #B9C0D6; }
.tr-meter .d, .tr-legend i.d { background: #E79AA0; }
.tr-legend { display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; font-size: .92rem; color: var(--ink-2); align-items: center; }
.tr-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: .35rem; }
.tr-legend .sep { color: var(--ok); font-weight: 700; }
.warn { color: #A15C00; font-weight: 700; }
.tr-tools { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-bottom: 1rem; position: sticky; top: 58px; z-index: 4; background: rgba(243,245,251,.94); padding: .5rem 0; backdrop-filter: blur(6px); }
.tr-tools input { flex: 1 1 200px; border: 1.5px solid var(--rule); border-radius: 99px; padding: .55rem 1rem; background: var(--sheet); }
.seg { display: grid; grid-template-columns: 62px 1fr auto; gap: .7rem; padding: .65rem .5rem; border-radius: var(--r-sm); align-items: start; }
.seg:hover { background: var(--sheet); }
.seg .ts { border: 0; background: none; font-family: var(--f-display); font-weight: 700; color: var(--bic); font-variant-numeric: tabular-nums; cursor: pointer; text-align: left; padding: .05rem 0; font-size: .95rem; }
.seg .ts:disabled { cursor: default; color: var(--ink-3); }
.seg .ts:not(:disabled):hover { text-decoration: underline; }
.sg-txt { line-height: 1.6; }
.seg.k-v .sg-txt, .seg.k-d .sg-txt { color: var(--ink-3); }
.seg.k-a { background: var(--marca-soft); }
.ktag { display: inline-block; font-size: .74rem; font-weight: 700; padding: .05rem .5rem; border-radius: 99px; margin-right: .45rem; background: var(--rule); color: var(--ink-2); vertical-align: 1px; }
.k-a .ktag { background: #F3D54A; color: var(--ink); }
.k-d .ktag { background: #F8D3D6; color: #8A1C22; }
.seg.low .sg-txt { text-decoration: underline dotted #D08A00 1.5px; text-underline-offset: 4px; }
.sg-meta { display: flex; gap: .7rem; font-size: .8rem; margin-top: .2rem; }
.fixd { color: var(--ok); font-weight: 700; cursor: help; text-decoration: underline dotted; }
.seg.now { background: var(--bic-wash); }
.player { position: sticky; bottom: .8rem; margin-top: 1rem; background: var(--sheet); border-radius: 99px; box-shadow: var(--shadow-sheet); padding: .4rem .8rem; z-index: 6; }
.player audio { width: 100%; height: 40px; display: block; }
@media (max-width: 900px) { .tr-tools { top: 58px; } }

/* Slides: temas */
.slide.th-claro.capa { background: #fff; color: var(--ink); border: 1px solid var(--rule); }
.slide.th-claro.capa p { color: var(--ink-2); }
.slide.th-claro.capa::after { background: var(--bic); }
.slide.th-claro.destaque { background: var(--bic-wash); }
.slide.th-claro.destaque small { color: var(--bic); }
.slide.th-claro.destaque p { color: var(--bic-deep); }
.slide.th-escuro { background: #141938; color: #EEF0FA; }
.slide.th-escuro li::marker { color: var(--marca); }
.slide.th-escuro .col { background: #232A55; }
.slide.th-escuro .col + .col { background: #3A3413; }
.slide.th-escuro .pg { color: #8D94BC; }
.slide.th-escuro .brand { color: var(--marca); }
.slide.th-escuro.capa { background: #0B0F2A; }
.slide.th-escuro.destaque { background: #141938; }
.slide.th-escuro.destaque small { color: var(--marca); }
.slide.th-escuro.destaque p { color: #fff; }

/* ===================== v3: slides ricos ===================== */
.slide .sx { padding: 5.5cqw 6.5cqw 6.5cqw; gap: 2.4cqw; }
.slide h4 { font-size: 4.6cqw; }
.slide ul { font-size: 2.7cqw; gap: 1.3cqw; }
.slide li b { font-weight: 700; }
.slide li span { display: block; color: var(--ink-2); font-size: .86em; margin-top: .2cqw; }
.slide.dense h4 { font-size: 4cqw; }
.slide.dense ul, .slide.dense .col ul { font-size: 2.35cqw; gap: 1cqw; }
.slide.xdense h4 { font-size: 3.6cqw; }
.slide.xdense ul, .slide.xdense .col ul { font-size: 2.05cqw; gap: .8cqw; }
.slide.xdense .sx { gap: 1.6cqw; padding-top: 4.5cqw; }
.slide .cols.n3 { grid-template-columns: 1fr 1fr 1fr; }
.slide .col ul { font-size: 2.4cqw; }
.slide.capa h4 { font-size: 7.6cqw; }
.slide.destaque em { font-style: normal; font-size: 2.7cqw; color: #5C4E00; max-width: 85%; }

/* conceito */
.cpt { display: grid; gap: 2cqw; align-content: start; }
.cpt-t { font-family: var(--f-display); font-weight: 800; font-size: 3.8cqw; color: var(--bic-deep); background: var(--marca); width: fit-content; padding: .4cqw 1.6cqw; border-radius: 1cqw; transform: rotate(-1deg); }
.cpt-d { font-size: 3cqw; line-height: 1.35; max-width: 92%; }
.cpt-e { font-size: 2.5cqw; background: var(--bic-wash); border-radius: 1.6cqw; padding: 1.8cqw 2.2cqw; line-height: 1.35; }
.cpt-e b { display: block; font-size: 1.9cqw; color: var(--bic); margin-bottom: .4cqw; }
/* processo */
.flow { list-style: none; margin: 0; padding: 0; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 1.6cqw; counter-reset: f; flex: 1; }
.flow li { counter-increment: f; background: var(--bic-wash); border-radius: 1.6cqw; padding: 2cqw 1.6cqw; display: flex; flex-direction: column; gap: .8cqw; position: relative; font-size: 2.2cqw; line-height: 1.3; }
.flow li::before { content: counter(f); width: 4.2cqw; height: 4.2cqw; border-radius: 50%; background: var(--bic); color: #fff; display: grid; place-items: center; font-family: var(--f-display); font-weight: 800; font-size: 2.2cqw; }
.flow li b { font-family: var(--f-display); font-size: 2.5cqw; }
.flow li span { color: var(--ink-2); }
.flow li:not(:last-child)::after { content: "›"; position: absolute; right: -1.45cqw; top: 40%; color: var(--bic); font-weight: 800; font-size: 3cqw; }
/* fórmula */
.fml { display: grid; gap: 2cqw; }
.fml-x { font-family: var(--f-display); font-weight: 800; font-size: 4.4cqw; text-align: center; padding: 2.4cqw; background: var(--marca-soft); border-radius: 1.6cqw; letter-spacing: -0.01em; }
.fml dl { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: .8cqw 3cqw; font-size: 2.3cqw; }
.fml dl div { display: flex; gap: 1.2cqw; }
.fml dt { font-weight: 800; color: var(--bic); min-width: 4cqw; }
.fml dd { margin: 0; color: var(--ink-2); }
.fml-o { font-size: 2.2cqw; color: #7A5A00; }
/* exemplo */
.exm { display: grid; grid-template-columns: 1fr 1fr; gap: 2.4cqw; flex: 1; }
.exm-s { background: var(--paper); border-left: 0.7cqw solid var(--bic); border-radius: 1cqw; padding: 2cqw; font-size: 2.45cqw; line-height: 1.4; }
.exm ol { margin: 0; padding-left: 3cqw; display: grid; gap: 1.1cqw; font-size: 2.3cqw; line-height: 1.35; align-content: start; }
.exm ol li::marker { color: var(--bic); font-weight: 800; }
/* pergunta */
.qst { display: grid; gap: 2.4cqw; align-content: center; flex: 1; }
.qst-q { font-family: var(--f-display); font-weight: 700; font-size: 3.6cqw; line-height: 1.2; }
.qst-a { font-size: 2.6cqw; background: var(--ok-wash); border-radius: 1.6cqw; padding: 2cqw 2.4cqw; line-height: 1.4; }
.qst-a b { display: block; font-size: 1.9cqw; color: var(--ok); margin-bottom: .4cqw; }
.hide-ans .qst-a { filter: blur(1.4cqw); opacity: .5; }
/* temas nos novos blocos */
.th-escuro .cpt-d, .th-escuro .exm-s, .th-escuro .qst-q { color: #EEF0FA; }
.th-escuro .cpt-t { color: var(--ink); }
.th-escuro .cpt-e, .th-escuro .flow li { background: #232A55; color: #EEF0FA; }
.th-escuro .flow li span, .th-escuro li span, .th-escuro .fml dd { color: #B9C0E0; }
.th-escuro .exm-s { background: #1E244A; }
.th-escuro .fml-x { background: #3A3413; color: #fff; }
.th-escuro .qst-a { background: #12392B; color: #D8F5E8; }
.th-claro .cpt-t { background: var(--bic-wash); }
/* notas na apresentação */
.present .note { font-size: 1.05rem; line-height: 1.6; max-height: 20vh; overflow-y: auto; color: #C3C9E6; padding: .6rem 1rem 0; }
/* quiz: níveis */
.qz-info { margin: -.4rem 0 1.4rem; }
.qz-lvl .opt { grid-auto-flow: column; align-items: center; gap: .7rem; }
.lvl.n-facil { background: var(--ok-wash); color: var(--ok); }
.lvl.n-medio { background: var(--bic-wash); color: var(--bic-deep); }
.lvl.n-dificil { background: #FFE9CC; color: #8A4B00; }
.lvl.n-desafio { background: var(--erro-wash); color: #8A1C22; }
@media (max-width: 640px) { .lvl-switch .opt, .qz-lvl .opt { grid-auto-flow: row; } }
.slide ul.two { grid-template-columns: 1fr 1fr; column-gap: 3.5cqw; row-gap: 1.6cqw; padding-left: 3cqw; }
.fml dt { min-width: 10cqw; }
.slide.dense .cpt-d { font-size: 2.6cqw; } .slide.dense .cpt-e { font-size: 2.2cqw; padding: 1.4cqw 2cqw; }
.slide.xdense .cpt-d { font-size: 2.3cqw; } .slide.xdense .cpt-e { font-size: 2cqw; }

/* ===== v4: navegação, início, ferramentas ===== */
.side-nav { display: grid; gap: 2px; margin: .2rem -.3rem .3rem; }
.side-nav a { display: block; padding: .5rem .7rem; border-radius: var(--r-sm); text-decoration: none; color: var(--ink-2); font-weight: 700; font-size: .95rem; }
.side-nav a:hover { background: var(--paper); color: var(--ink); }
.side-nav a.on { background: var(--bic-wash); color: var(--bic-deep); }
.subj-row { display: flex; flex-wrap: wrap; gap: .35rem; }
.sj { border: 1.5px solid var(--rule); background: transparent; color: var(--ink-2); font: inherit; font-size: .78rem; font-weight: 700; padding: .2rem .6rem; border-radius: 99px; cursor: pointer; }
.sj[style] { border-color: hsl(var(--h) 55% 80%); }
.sj.on { background: var(--ink); color: var(--sheet); border-color: var(--ink); }
.sj.on[style] { background: hsl(var(--h) 60% 38%); border-color: transparent; color: #fff; }
.chip.subj[style] { background: hsl(var(--h) 85% 93%); color: hsl(var(--h) 60% 26%); }
.foot-links { display: flex; flex-wrap: wrap; gap: .1rem .6rem; }
.foot-links .link-btn { padding: .15rem 0; font-size: .85rem; color: var(--ink-3); }
.foot-links .link-btn:hover { color: var(--bic); text-decoration: underline; }

.home { max-width: 1040px; display: grid; gap: 1.5rem; }
.home-h { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.stat { background: var(--sheet); border-radius: var(--r-lg); padding: 1.2rem 1.4rem; box-shadow: var(--shadow-sheet); display: grid; align-content: start; gap: .15rem; }
.stat b { font-family: var(--f-display); font-size: 2.6rem; line-height: 1; letter-spacing: -.02em; }
.stat > span { color: var(--ink-2); font-weight: 700; }
.stat small { color: var(--ink-3); } .stat small.ok { color: var(--ok); font-weight: 700; }
.stat .btn { justify-self: start; margin-top: .6rem; }
.week { display: flex; gap: .35rem; margin-top: .7rem; }
.week i { width: 26px; height: 26px; border-radius: 8px; background: var(--paper); display: grid; place-items: center; font-style: normal; }
.week i small { font-size: .68rem; font-weight: 700; color: var(--ink-3); }
.week i.on { background: var(--marca); } .week i.on small { color: #3A3413; }
.tools { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.tool { background: var(--sheet); border: 1.5px solid var(--rule); border-radius: var(--r-lg); padding: 1.2rem 1.3rem; display: grid; gap: .45rem; align-content: start; text-decoration: none; color: inherit; transition: border-color .15s var(--ease), transform .15s var(--ease); }
a.tool:hover { border-color: var(--bic); transform: translateY(-2px); }
.tool h3 { font-size: 1.1rem; } .tool p { margin: 0; color: var(--ink-2); font-size: .93rem; line-height: 1.45; }
.tool-row { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .3rem; }
.tool-row input { flex: 1; min-width: 120px; border: 1.5px solid var(--rule); border-radius: 99px; padding: .45rem .9rem; background: var(--paper); font: inherit; font-size: .92rem; color: var(--ink); }
.tool-row input:focus { outline: none; border-color: var(--bic); }
.tool-go { color: var(--bic); font-weight: 700; margin-top: .3rem; }
.sec-h { font-size: 1.3rem; margin-top: .6rem; }
.lgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.lcard { background: var(--sheet); border-radius: var(--r-md); padding: 1.1rem 1.2rem; text-decoration: none; color: inherit; display: grid; gap: .45rem; align-content: start; box-shadow: var(--shadow-sheet); transition: transform .15s var(--ease); }
.lcard:hover { transform: translateY(-2px); }
.lcard b { font-family: var(--f-display); font-size: 1.15rem; line-height: 1.25; }
.lc-top { display: flex; justify-content: space-between; align-items: center; gap: .5rem; min-height: 1.8rem; } .lc-top small { color: var(--ink-3); }
.lc-m { color: var(--ink-3); font-size: .86rem; }
.lc-due { justify-self: start; background: var(--marca-soft); color: #3A3413; font-weight: 700; font-size: .8rem; padding: .15rem .6rem; border-radius: 99px; }

.searchbar { display: flex; gap: .6rem; max-width: 640px; }
.searchbar input { flex: 1; border: 1.5px solid var(--rule); border-radius: 99px; padding: .7rem 1.2rem; background: var(--sheet); font: inherit; color: var(--ink); }
.searchbar input:focus { outline: none; border-color: var(--bic); }
.results { display: grid; gap: .9rem; }
.res { padding: 1.1rem 1.3rem; display: grid; gap: .3rem; }
.res-t { font-family: var(--f-display); font-weight: 700; font-size: 1.2rem; color: var(--ink); text-decoration: none; margin-right: .6rem; }
.res-t:hover { color: var(--bic); }
.hit { display: flex; gap: .7rem; align-items: baseline; text-decoration: none; color: var(--ink-2); padding: .35rem .5rem; border-radius: var(--r-sm); font-size: .95rem; line-height: 1.45; }
.hit:hover { background: var(--paper); }
.hit .lvl { flex: none; }
.hit mark { background: var(--marca); color: #1A1F36; border-radius: 3px; padding: 0 .1em; }

.sim-set { display: grid; gap: 1rem; }
.sim-list { display: grid; gap: .4rem; }
.sim-it { display: flex; gap: .8rem; align-items: center; padding: .6rem .8rem; border: 1.5px solid var(--rule); border-radius: var(--r-md); cursor: pointer; }
.sim-it:has(input:checked) { border-color: var(--bic); background: var(--bic-wash); }
.sim-it input { width: 20px; height: 20px; accent-color: var(--bic); }
.sim-it small { display: block; color: var(--ink-3); }
.sims { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .8rem; }
.sims .card { padding: .9rem 1rem; display: grid; gap: .1rem; } .sims b { font-family: var(--f-display); font-size: 1.8rem; } .sims span, .sims small { color: var(--ink-3); font-size: .85rem; }
.by { display: grid; gap: .5rem; width: min(480px, 100%); margin: 1rem auto; text-align: left; }
.by > div { display: grid; grid-template-columns: 110px 1fr auto; gap: .7rem; align-items: center; font-size: .92rem; }
.by i { height: 10px; background: var(--paper); border-radius: 99px; overflow: hidden; display: block; } .by u { display: block; height: 100%; background: var(--ok); border-radius: 99px; }
.hist { display: flex; align-items: flex-end; justify-content: center; gap: 6px; height: 56px; margin: .4rem auto; }
.hist i { width: 14px; background: var(--bic); border-radius: 4px 4px 0 0; display: block; opacity: .85; }
.hist small { align-self: center; margin-left: .6rem; color: var(--ink-3); }

.gl-tools { display: flex; gap: .8rem; align-items: center; flex-wrap: wrap; }
.gl-tools input { border: 1.5px solid var(--rule); border-radius: 99px; padding: .45rem 1rem; background: var(--sheet); font: inherit; font-size: .92rem; min-width: 190px; color: var(--ink); }
.gl-tools input:focus { outline: none; border-color: var(--bic); }
.gloss { padding: 1.4rem 1.6rem; display: grid; gap: 1.4rem; }
.gl-g h3 { font-size: 1rem; color: var(--bic); border-bottom: 1.5px solid var(--rule); padding-bottom: .3rem; margin-bottom: .5rem; }
.gl-g dl { margin: 0; display: grid; gap: .8rem; }
.gl-g dl > div { display: grid; grid-template-columns: minmax(130px, 220px) 1fr; gap: 1.2rem; }
.gl-g dt { font-weight: 800; } .gl-g dd { margin: 0; color: var(--ink-2); line-height: 1.5; }
.gl-g dd em { display: block; color: var(--ink-3); font-size: .92rem; margin-top: .2rem; }
@media (max-width: 760px) { .stats, .tools { grid-template-columns: 1fr; } .gl-g dl > div { grid-template-columns: 1fr; gap: .1rem; } }

/* ===== Modo escuro ===== */
[data-theme="dark"] {
  --paper: #0E1124; --sheet: #171B36; --ink: #E9ECFB; --ink-2: #B4BBDB; --ink-3: #868EB4;
  --bic: #6572F7; --bic-deep: #B3BAFF; --bic-wash: #232A5C; --marca-soft: #3B3414; --rule: #2A3062;
  --margin: #7A3A48; --ok: #3DD598; --ok-wash: #123A2D; --erro: #FF6B72; --erro-wash: #3D1B22;
  --shadow-sheet: 0 1px 0 rgba(255,255,255,.03), 0 14px 40px -18px rgba(0,0,0,.7);
  color-scheme: dark;
}
[data-theme="dark"] .sources button[aria-selected="true"], [data-theme="dark"] .subtabs button[aria-selected="true"], [data-theme="dark"] .toast, [data-theme="dark"] .sel-btn { color: var(--paper); }
[data-theme="dark"] .field input:focus, [data-theme="dark"] .field textarea:focus, [data-theme="dark"] .lib-q:focus { background: var(--sheet); }
[data-theme="dark"] .banner { color: #F5E9A8; }
[data-theme="dark"] .mode-badge { color: #F5E9A8; }
[data-theme="dark"] .btn-ghost { color: var(--ink); }
[data-theme="dark"] .hit mark, [data-theme="dark"] .lc-due { color: #1A1F36; }
[data-theme="dark"] .lc-due { background: var(--marca); }
[data-theme="dark"] .tabs { background: rgba(14,17,36,.94); }
[data-theme="dark"] .chip.subj[style] { background: hsl(var(--h) 45% 24%); color: hsl(var(--h) 90% 88%); }
[data-theme="dark"] .sj[style] { border-color: hsl(var(--h) 40% 34%); }
.toast { opacity: 0; pointer-events: none; transition: transform .25s var(--ease), opacity .2s; }
.toast.show { opacity: 1; }
.res .chip { justify-self: start; }
.res-t { display: inline-block; }
.res-h { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; margin-bottom: .2rem; } .res-t { margin-right: 0; }

/* Provas */
.exams { display: grid; gap: .8rem; }
.ex-h { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.ex-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: .8rem; }
.exam { display: flex; align-items: center; gap: 1rem; background: var(--sheet); border: 1.5px solid var(--rule); border-radius: var(--r-md); padding: .8rem 1rem; }
.ex-d { display: grid; justify-items: center; min-width: 54px; padding: .3rem .5rem; border-radius: 12px; background: var(--paper); }
.ex-d b { font-family: var(--f-display); font-size: 1.7rem; line-height: 1; } .ex-d small { color: var(--ink-3); font-size: .75rem; font-weight: 700; }
.exam.warm .ex-d { background: var(--marca-soft); } .exam.warm .ex-d b, .exam.warm .ex-d small { color: #3A3413; }
.exam.hot .ex-d { background: var(--erro-wash); } .exam.hot .ex-d b, .exam.hot .ex-d small { color: var(--erro); }
.ex-i { flex: 1; min-width: 0; display: grid; } .ex-i span { color: var(--ink-3); font-size: .86rem; line-height: 1.35; }

/* Plano de vestibular */
.vest-banner { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; text-decoration: none; color: #fff; background: var(--bic); border-radius: var(--r-lg); padding: 1.1rem 1.4rem; box-shadow: 0 24px 50px -28px rgba(36, 51, 201, .9); transition: transform .15s var(--ease); }
.vest-banner:hover { transform: translateY(-2px); }
.vest-banner > div { display: grid; gap: .15rem; } .vest-banner small { color: #D4D9FF; font-size: .9rem; } .vest-banner b { font-family: var(--f-display); font-size: 1.3rem; line-height: 1.25; }
.vb-st { background: var(--marca); color: #1A1F36; font-weight: 800; padding: .5rem 1.1rem; border-radius: 99px; white-space: nowrap; }
.vb-st.ok { background: #BFF2D9; }
.vest-banner.empty { background: var(--sheet); color: var(--ink); border: 2px dashed var(--bic); box-shadow: none; } .vest-banner.empty small { color: var(--ink-2); }
[data-theme="dark"] .vest-banner.empty { border-color: var(--bic); }
.subj-pick { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .5rem; }
.subj-pick .sj { font-size: .9rem; padding: .35rem .85rem; }
.vday { padding: 1.4rem 1.5rem; display: grid; gap: 1.1rem; }
.vd-h { display: grid; gap: .5rem; justify-items: start; } .vd-h h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
.vd-acts { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.vd-it { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1rem 1.1rem; border: 1.5px solid var(--rule); border-radius: var(--r-md); }
.vd-it > div { display: grid; } .vd-it span { color: var(--ink-3); font-size: .9rem; }
.vd-it.done { border-color: var(--ok); background: var(--ok-wash); }
.vd-foot { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; color: var(--ink-2); font-size: .92rem; padding-top: .8rem; border-top: 1px solid var(--rule); }
.vd-foot select { border: 1.5px solid var(--rule); border-radius: 99px; padding: .4rem .9rem; background: var(--paper); font: inherit; color: var(--ink); }
.wk-list { display: grid; gap: .7rem; }
.wk { display: flex; align-items: center; gap: 1rem; background: var(--sheet); border: 1.5px solid var(--rule); border-radius: var(--r-md); padding: .8rem 1rem; flex-wrap: wrap; }
.wk .ex-d.hot { background: var(--erro-wash); } .wk .ex-d.hot b, .wk .ex-d.hot small { color: var(--erro); }
.wk-b { display: flex; gap: .4rem; }
.vhist { display: grid; gap: .5rem; }
.vhist > div { display: grid; grid-template-columns: 70px 120px 1fr auto; gap: .8rem; align-items: baseline; padding: .6rem .9rem; background: var(--sheet); border-radius: var(--r-sm); }
.vhist small { color: var(--ink-3); } .vhist span { color: var(--ink-2); } .vhist em { font-style: normal; font-weight: 800; color: var(--ink-3); } .vhist em.ok { color: var(--ok); }
@media (max-width: 760px) { .vd-acts { grid-template-columns: 1fr; } .vhist > div { grid-template-columns: 60px 1fr auto; } .vhist span { display: none; } }

/* Créditos */
.cred-chip { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; background: var(--marca-soft); color: #3A3413; border: 1.5px solid var(--marca); border-radius: 99px; padding: .45rem .9rem; font: inherit; font-weight: 700; cursor: pointer; }
.cred-chip[hidden] { display: none; }
.cred-chip b { font-family: var(--f-display); font-size: 1.05rem; } .cred-chip small { font-weight: 600; opacity: .75; }
.cred-chip.low { background: var(--erro-wash); border-color: var(--erro); color: var(--erro); }
.side .cred-chip { width: 100%; margin-top: .6rem; }
.cr-box { display: grid; justify-items: center; gap: .1rem; background: var(--bic-wash); border-radius: var(--r-md); padding: 1rem; margin: .6rem 0; }
.cr-box b { font-family: var(--f-display); font-size: 2.2rem; color: var(--bic-deep); line-height: 1.1; } .cr-box span { color: var(--ink-2); font-size: .92rem; }
.cr-tab { width: 100%; border-collapse: collapse; margin: .8rem 0 .2rem; font-size: .95rem; }
.cr-tab td { padding: .4rem 0; border-bottom: 1px solid var(--rule); } .cr-tab td:last-child { text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; }
.hub { padding: 1.6rem; display: grid; gap: 1rem; }
.hub-list { display: grid; gap: .6rem; }
.hub-it { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .85rem 1rem; border: 1.5px solid var(--rule); border-radius: var(--r-md); background: var(--sheet); }
.hub-it > span { display: grid; gap: .1rem; min-width: 0; } .hub-it small { color: var(--ink-3); font-size: .88rem; line-height: 1.35; }
.hub-it .btn { white-space: nowrap; flex: none; }
@media (max-width: 760px) { .hub { padding: 1.1rem; } .hub-it { flex-direction: column; align-items: stretch; } .topbar .cred-chip { padding: .35rem .7rem; } .topbar .cred-chip small { display: none; } }
[data-theme="dark"] .cred-chip { background: #3A3413; border-color: #8A7B27; color: #F5E9A8; }
[data-theme="dark"] .cred-chip.low { background: #3D1A1D; border-color: var(--erro); color: #FF9CA2; }
[data-theme="dark"] .cr-box { background: #1F2547; } [data-theme="dark"] .cr-box b { color: #C9D0FF; }

/* compra por Pix dentro do Grifo */
.opt-row{display:flex;gap:10px;align-items:flex-start;padding:10px 12px;border:1px solid var(--line,#d5d9e6);border-radius:12px;margin-top:8px;cursor:pointer}
.opt-row input{margin-top:4px}
.opt-row small{color:var(--muted,#5b6275)}
.pix-box{display:grid;gap:10px;justify-items:center;text-align:center}
.pix-box img{border-radius:12px;background:#fff;padding:6px}
.pix-box textarea{width:100%;font:12px/1.3 ui-monospace,monospace;resize:none}

/* topo no celular: contraste forte nos dois temas e botão de tema visível */
.topbar .icon-btn { background: var(--sheet); border: 1.5px solid var(--rule); color: var(--ink); font-weight: 700; }
.topbar .icon-btn:hover, .topbar .icon-btn:focus-visible { background: var(--bic-wash); border-color: var(--bic); }
.topbar .theme-tg { font-size: 1.15rem; }
[data-theme="dark"] .topbar { background: rgba(14,17,36,.96); border-bottom: 1px solid var(--rule); }
[data-theme="dark"] .topbar .logo { color: var(--ink); }
.side-foot .link-btn { color: var(--ink-2); font-weight: 600; }
.side-foot .link-btn:hover { color: var(--bic-deep); }
.btn-ghost { border-width: 1.5px; }

/* ===== Polimento v27 ===== */
.hoje { position: relative; display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap; margin: 0 0 1.4rem; padding: 1.3rem 1.4rem; border-radius: var(--r-lg); color: #fff; overflow: hidden;
  background: radial-gradient(120% 140% at 100% 0%, #3b4be0 0%, #2433C9 45%, #17208F 100%); box-shadow: var(--shadow-sheet); }
.hoje::after { content: ""; position: absolute; right: -30px; bottom: -34px; width: 150px; height: 56px; background: var(--marca); opacity: .22; transform: rotate(-8deg); border-radius: 6px; pointer-events: none; }
.hoje-t { flex: 1 1 240px; min-width: 0; position: relative; z-index: 1; }
.hoje small { display: block; opacity: .8; font-weight: 700; font-size: .85rem; margin-bottom: .25rem; }
.hoje h2 { font-size: clamp(1.3rem, 4.6vw, 1.75rem); margin: 0 0 .25rem; color: #fff; text-wrap: balance; }
.hoje p { margin: 0; opacity: .92; }
.hoje .hoje-n { margin-top: .6rem; font-size: .93rem; opacity: .85; }
.hoje .hoje-n a { color: #fff; text-underline-offset: 3px; }
.hoje-go { position: relative; z-index: 1; flex: none; text-decoration: none; font-weight: 800; padding: .85rem 1.6rem; border-radius: 999px; background: var(--marca); color: #1A1F36; box-shadow: 0 8px 20px -10px rgba(0,0,0,.5); transition: transform .15s var(--ease); }
.hoje-go:hover { transform: translateY(-2px); }
.hoje-go:active { transform: scale(.97); }
@media (max-width: 520px) { .hoje-go { width: 100%; text-align: center; } }

.mapa { margin: 0 0 1.4rem; padding: 1rem 1.1rem; border-radius: var(--r-md); background: var(--bic-wash); }
.mapa summary { cursor: pointer; font-family: var(--f-display); font-weight: 700; font-size: 1.05rem; display: flex; align-items: baseline; gap: .6rem; list-style: none; }
.mapa summary::-webkit-details-marker { display: none; }
.mapa summary::after { content: "▾"; margin-left: auto; color: var(--bic); transition: transform .2s var(--ease); }
.mapa:not([open]) summary::after { transform: rotate(-90deg); }
.mapa summary small { font-family: var(--f-body); font-weight: 600; color: var(--ink-3); font-size: .82rem; }
.mapa-g { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .6rem; margin-top: .9rem; }
.mapa-n { background: var(--sheet); border-radius: var(--r-sm); padding: .7rem .8rem .7rem 2.5rem; position: relative; min-width: 0; }
.mapa-i { position: absolute; left: .7rem; top: .7rem; width: 1.4rem; height: 1.4rem; border-radius: 50%; background: var(--bic); color: #fff; font-size: .75rem; font-weight: 800; display: grid; place-items: center; }
.mapa-n b { display: block; font-size: .95rem; line-height: 1.25; overflow-wrap: anywhere; }
.mapa-n ul { margin: .35rem 0 0; padding-left: 1rem; font-size: .86rem; color: var(--ink-2); }
.mapa-n li { margin: 0; }

.qz-bar { height: 6px; border-radius: 99px; background: var(--rule); overflow: hidden; margin: 0 0 .9rem; }
.qz-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--bic), #5b6bff); border-radius: 99px; transition: width .35s var(--ease); }
.qz-opt { transition: transform .12s var(--ease), border-color .15s, background .15s; }
.qz-opt:not([disabled]):hover { transform: translateY(-1px); border-color: var(--bic); }
.qz-opt:not([disabled]):active { transform: scale(.985); }
.qz-opt.right { animation: grifoPop .35s var(--ease); }
.qz-opt.wrong { animation: grifoShake .3s; }
@keyframes grifoPop { 50% { transform: scale(1.02); } }
@keyframes grifoShake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.qz-end #trErr { flex: 1 1 100%; }

/* abas: sugere que dá para rolar */
@media (max-width: 900px) {
  .tabs { -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); mask-image: linear-gradient(90deg, #000 88%, transparent); padding-right: 2.2rem; }
}
.empty-pane { text-align: center; }
.empty-pane .btn { margin-top: .4rem; }
@media (prefers-reduced-motion: reduce) { .qz-opt.right, .qz-opt.wrong { animation: none; } .hoje-go, .qz-bar i { transition: none; } }
[data-theme="dark"] .mapa-n { background: var(--sheet); }
[data-theme="dark"] .hoje-go { color: #1A1F36; }
