/* Mari Gabaritos — papel claro, tinta azul, lousa verde */
:root {
  --bg: #f8f0ee; --card: #ffffff; --ink: #1d3f7a; --text: #2b3445; --muted: #6b7486; --line: #e8dcd6;
  --brand: #1f5fbf; --brand-ink: #ffffff; --ok: #1e8a4c; --bad: #c8362b; --warn: #c27a06;
  --ok-bg: #e5f4ea; --bad-bg: #fbe7e4; --warn-bg: #fdf1dc; --chip: #f4e6dc; --beige: #f3e3d3;
  --board: #2f5d46; --board-dark: #234836; --wood: #a0703f; --chalk: #f4f1e8;
  --radius: 14px; --shadow: 0 1px 2px rgba(90,60,40,.06), 0 4px 14px rgba(90,60,40,.06);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 15px/1.55 "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; display: flex; flex-direction: column; }
h1, h2, h3 { color: var(--ink); }
.serif { font-family: "Cinzel", Georgia, serif; letter-spacing: .02em; }
a { color: var(--brand); text-decoration: none; }
h1 { font-size: 1.6rem; margin: 0 0 .25rem; letter-spacing: -.01em; }
h2 { font-size: 1.15rem; margin: 0 0 .75rem; }
h3 { font-size: 1rem; margin: 0 0 .5rem; }
p { margin: 0 0 .75rem; }
.muted { color: var(--muted); }
small, .small { font-size: .85rem; }

.top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .75rem clamp(16px, 4vw, 40px); background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; flex-wrap: wrap; }
.brand { font-family: "Cinzel", Georgia, serif; font-weight: 700; font-size: 1.25rem; color: var(--ink); display: flex; align-items: center; gap: .6rem; letter-spacing: .03em; }
.brand img { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; border: 2px solid var(--beige); }
nav { display: flex; gap: .25rem; align-items: center; flex-wrap: wrap; }
nav a:not(.btn) { color: var(--muted); padding: .35rem .6rem; border-radius: 8px; }
nav a.active:not(.btn) { color: var(--ink); background: var(--chip); }
body:not(.authed) [data-auth] { display: none !important; }
body.authed [data-guest] { display: none !important; }

main { width: 100%; max-width: 1180px; margin: 0 auto; padding: 1.5rem clamp(16px, 4vw, 40px) 3rem; flex: 1; }
.foot { text-align: center; color: var(--muted); font-size: .8rem; padding: 1rem; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; box-shadow: var(--shadow); margin-bottom: 1rem; }
.grid { display: grid; gap: 1rem; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem 1rem; }
.kpi b { display: block; font-size: 1.6rem; line-height: 1.2; font-variant-numeric: tabular-nums; }
.kpi span { color: var(--muted); font-size: .82rem; }
.row { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack > * + * { margin-top: .75rem; }

.btn { display: inline-flex; align-items: center; gap: .4rem; border: 1px solid var(--brand); background: var(--brand); color: var(--brand-ink); padding: .55rem 1rem; border-radius: 9px; font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; }
.btn:hover { filter: brightness(1.05); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.danger { background: transparent; color: var(--bad); border-color: var(--line); }
.btn.sm { padding: .3rem .7rem; font-size: .85rem; }
.linkbtn { background: none; border: 0; color: var(--brand); cursor: pointer; font: inherit; padding: 0; }

label { display: block; font-weight: 600; font-size: .85rem; margin-bottom: .25rem; }
input, select, textarea { font: inherit; color: var(--text); background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: .5rem .65rem; width: 100%; }
textarea { min-height: 80px; resize: vertical; font-family: ui-monospace, Consolas, monospace; letter-spacing: .05em; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: -1px; }
.field { margin-bottom: .75rem; }
.inline { display: flex; gap: .5rem; }

.drop { border: 2px dashed var(--line); border-radius: var(--radius); padding: 2rem 1rem; text-align: center; cursor: pointer; transition: .15s; background: var(--card); }
.drop.over, .drop:hover { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 6%, var(--card)); }
.drop b { display: block; font-size: 1.05rem; margin-bottom: .25rem; }
.steps { display: flex; gap: .5rem; margin: .5rem 0 1.25rem; flex-wrap: wrap; }
.step { display: flex; align-items: center; gap: .4rem; color: var(--muted); font-size: .9rem; }
.step i { font-style: normal; width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--chip); font-size: .75rem; font-weight: 700; }
.step.on { color: var(--ink); } .step.on i { background: var(--brand); color: #fff; }

table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: .5rem .55rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
tr.click { cursor: pointer; } tr.click:hover td { background: var(--chip); }
.tablewrap { overflow-x: auto; }
td input { padding: .3rem .45rem; min-width: 110px; }
/* tabela de resultados: colunas compactas e ações sempre visíveis (fixas à direita) */
#sheets { min-width: 980px; }
#sheets th, #sheets td { padding: .45rem .35rem; }
#sheets th { font-size: .72rem; }
#sheets td input { min-width: 0 !important; font-size: .86rem; }
#sheets input[data-f="name"] { width: 160px; }
#sheets input[data-f="rm"] { width: 82px !important; }
#sheets input[data-f="turma"] { width: 108px !important; }
#sheets input[data-f="curso"] { width: 128px !important; }
#sheets .thumb { width: 44px; height: 44px; }
#sheets .header-crop { max-width: 120px !important; height: 38px; }
#sheets th:last-child, #sheets td.actions { position: sticky; right: 0; background: var(--card); z-index: 1; box-shadow: -10px 0 10px -10px rgba(90, 60, 40, .35); }
#sheets tr:hover td.actions { background: var(--card); }
.act { display: flex; gap: .35rem; flex-wrap: nowrap; justify-content: flex-end; }
.sit { display: flex; flex-direction: column; align-items: flex-start; gap: .25rem; }
.pill { white-space: nowrap; }
/* cartão do gabarito oficial aceita arrastar e soltar a folha */
.key-card { transition: .15s; }
.key-card.over { outline: 2px dashed var(--brand); outline-offset: -6px; background: color-mix(in srgb, var(--brand) 5%, var(--card)); }
.key-drop-hint { border: 1.5px dashed #d9c9bf; border-radius: 10px; padding: .45rem .7rem; color: var(--muted); text-align: center; margin: -.2rem 0 .8rem; }
.key-card.over .key-drop-hint { border-color: var(--brand); color: var(--ink); font-weight: 600; }
.num { text-align: right; }

.pill { display: inline-block; padding: .1rem .55rem; border-radius: 99px; font-size: .78rem; font-weight: 600; background: var(--chip); color: var(--muted); }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.score { font-weight: 700; }
.bar { height: 8px; border-radius: 99px; background: var(--chip); overflow: hidden; min-width: 60px; }
.bar > i { display: block; height: 100%; background: var(--brand); }

.thumb { width: 54px; height: 54px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); background: #fff; }
.header-crop { max-width: 300px; height: 46px; object-fit: cover; object-position: left center; border-radius: 6px; border: 1px solid var(--line); display: block; background: #fff; }

.anskey { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: .25rem .75rem; }
.ans { display: flex; align-items: center; gap: .3rem; font-size: .85rem; }
.ans b { width: 24px; text-align: right; color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.opt { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--muted); display: inline-grid; place-items: center; font-size: .65rem; cursor: pointer; user-select: none; color: var(--muted); background: transparent; padding: 0; }
.opt.on { background: var(--ink); color: var(--card); border-color: var(--ink); }
.opt.right { background: var(--ok); border-color: var(--ok); color: #fff; }
.opt.wrong { background: var(--bad); border-color: var(--bad); color: #fff; }
.opt.key { box-shadow: 0 0 0 2px var(--ok); }
.ans.flag b { color: var(--warn); }

.review { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 1rem; }
@media (max-width: 820px) { .review { grid-template-columns: 1fr; } }
.review canvas { width: 100%; height: auto; border-radius: 8px; border: 1px solid var(--line); background: #fff; }

.modal { position: fixed; inset: 0; background: rgba(10, 14, 20, .55); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal[hidden] { display: none; }
.modal-box { background: var(--card); border-radius: var(--radius); width: min(1100px, 100%); max-height: calc(100vh - 32px); overflow: auto; padding: 1.25rem; position: relative; }
.modal-x { position: absolute; right: .6rem; top: .4rem; border: 0; background: none; font-size: 1.6rem; color: var(--muted); cursor: pointer; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--card); padding: .6rem 1rem; border-radius: 9px; z-index: 60; box-shadow: var(--shadow); max-width: calc(100% - 32px); }
.progress { height: 6px; background: var(--chip); border-radius: 99px; overflow: hidden; margin: .5rem 0; }
.progress i { display: block; height: 100%; background: var(--brand); width: 0; transition: width .2s; }

.heat { border-collapse: separate; border-spacing: 2px; font-size: .7rem; }
.heat td, .heat th { padding: 0; border: 0; width: 20px; height: 20px; text-align: center; }
.heat th { font-weight: 500; text-transform: none; letter-spacing: 0; }
.heat td.r { background: var(--ok); color: #fff; border-radius: 3px; }
.heat td.w { background: var(--bad); color: #fff; border-radius: 3px; opacity: .85; }
.heat td.b { background: var(--chip); border-radius: 3px; }
.heat td.name { text-align: left; width: auto; white-space: nowrap; padding-right: .5rem; font-size: .78rem; }
.chart-box { position: relative; height: 260px; }
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--line); margin-bottom: 1rem; flex-wrap: wrap; }
.tabs button { background: none; border: 0; padding: .55rem .8rem; font: inherit; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; }
.tabs button.on { color: var(--ink); border-bottom-color: var(--brand); font-weight: 600; }
/* lousa */
.board { position: relative; background: radial-gradient(ellipse at 30% 20%, #3a6e55 0%, var(--board) 45%, var(--board-dark) 100%); border: 12px solid var(--wood); border-radius: 10px; box-shadow: inset 0 0 40px rgba(0,0,0,.35), 0 6px 18px rgba(90,60,40,.18); color: var(--chalk); display: grid; grid-template-columns: 1fr 240px; gap: 1rem; align-items: end; padding: 1.6rem 1.8rem 0; margin-bottom: 1.5rem; overflow: hidden; }
.board::after { content: ""; position: absolute; left: 18%; right: 18%; bottom: -12px; height: 10px; background: #8a5d33; border-radius: 3px; }
.board h1 { font-family: "Cinzel", Georgia, serif; color: var(--chalk); font-size: clamp(1.6rem, 3.6vw, 2.4rem); text-shadow: 0 0 1px rgba(255,255,255,.4); margin-bottom: .4rem; }
.board p { color: #dfe9e2; font-size: 1rem; max-width: 560px; }
.board .chalk { list-style: none; padding: 0; margin: .5rem 0 1.4rem; display: grid; gap: .3rem; font-size: .92rem; color: #eef3ec; }
.board .chalk li::before { content: "✓ "; color: #ffe79a; font-weight: 700; }
.board .chalk a { color: #ffe79a; text-decoration: underline; }
.board img { width: 240px; height: 240px; object-fit: cover; object-position: center top; border-radius: 50% 50% 0 0; display: block; }
@media (max-width: 720px) { .board { grid-template-columns: 1fr; padding: 1.2rem 1.2rem 0; } .board img { width: 170px; height: 170px; margin: 0 auto; } }
.title-rule { font-family: "Cinzel", Georgia, serif; color: var(--ink); font-size: 1.05rem; display: flex; align-items: center; gap: .6rem; margin: 0 0 .8rem; }
.title-rule .n { width: 30px; height: 30px; border-radius: 50%; background: var(--beige); display: inline-grid; place-items: center; font-family: "Montserrat", sans-serif; font-weight: 700; font-size: .85rem; color: var(--ink); }
.dashed { border: 1.5px dashed #d9c9bf; border-radius: 10px; padding: .75rem; }
.rejected { background: var(--bad-bg); border: 1px solid #efc4bd; border-radius: 10px; padding: .6rem .8rem; margin-top: .75rem; font-size: .85rem; }
.rejected summary { cursor: pointer; font-weight: 600; color: var(--bad); }
.xl-tabs { display: flex; gap: 2px; border-bottom: 2px solid #1e7145; margin-top: .5rem; }
.xl-tabs button { border: 1px solid var(--line); border-bottom: 0; background: #f3f3f3; padding: .35rem .8rem; font: inherit; font-size: .82rem; cursor: pointer; border-radius: 6px 6px 0 0; }
.xl-tabs button.on { background: #fff; color: #1e7145; font-weight: 700; border-color: #1e7145; }
.xl { overflow: auto; max-height: 60vh; border: 1px solid #d0d7de; border-top: 0; background: #fff; }
.xl table { border-collapse: collapse; font: 12px/1.3 Calibri, "Segoe UI", sans-serif; color: #222; }
.xl th, .xl td { border: 1px solid #d9d9d9; padding: 3px 6px; white-space: nowrap; text-transform: none; letter-spacing: 0; }
.xl thead th { position: sticky; top: 0; background: #1f5fbf; color: #fff; font-weight: 700; font-size: 12px; }
.xl td.rh, .xl th.rh { background: #f3f3f3; color: #666; text-align: center; font-weight: 400; }
.xl td.g { background: #c9f0d6; text-align: center; } .xl td.r { background: #fad4d0; text-align: center; } .xl td.c { text-align: center; }
.ocr-tag { font-size: .7rem; color: var(--muted); }
.trend-up { color: var(--ok); font-weight: 700; } .trend-down { color: var(--bad); font-weight: 700; } .trend-flat { color: var(--muted); }

.ai-tag { color: #6b3fc2; font-weight: 600; animation: aipulse 1.2s ease-in-out infinite; }
@keyframes aipulse { 50% { opacity: .45; } }

/* ===== Fichário: abas tipo divisória + folha com furos ===== */
main { max-width: 1300px; }
.board { margin-bottom: 1.1rem; }
.binder { position: relative; }
.binder-tabs { display: flex; gap: .45rem; padding-left: 3.4rem; position: relative; z-index: 2; margin-bottom: -1px; flex-wrap: wrap; }
.binder-tab { --c: #ddd; background: var(--c); color: #1d2b44; font-weight: 700; font-size: 1.08rem; letter-spacing: .01em; padding: .5rem 1.6rem .55rem; border-radius: 12px 12px 0 0; border: 1px solid rgba(0,0,0,.08); border-bottom: 0;
  box-shadow: inset 0 -8px 10px -8px rgba(0,0,0,.22); transform: translateY(7px); transition: transform .15s, padding .15s; }
.binder-tab:hover { transform: translateY(3px); }
.binder-tab.on { transform: none; padding-bottom: .7rem; box-shadow: 0 -2px 6px rgba(90,60,40,.08); }
.t-corrigir { --c: #f6d24a; }
.t-modelo { --c: #a9cb52; }
.sheet-page { --c: #f6d24a; position: relative; background: #fffdf8; border-radius: 4px 14px 14px 14px; border-top: 7px solid var(--c);
  box-shadow: 0 2px 4px rgba(90,60,40,.06), 0 10px 26px rgba(90,60,40,.10); padding: 1.3rem 1.3rem 1.3rem 3.6rem; }
.sheet-page.p-modelo { --c: #a9cb52; }
/* furos do fichário + margem vermelha */
.sheet-page::before { content: ""; position: absolute; left: 1.05rem; top: 1.4rem; bottom: 1.4rem; width: 16px;
  background: radial-gradient(circle at 8px 8px, var(--bg) 6.5px, rgba(120,90,70,.25) 7.5px, transparent 8.5px) 0 0 / 16px 110px repeat-y; }
.sheet-page::after { content: ""; position: absolute; left: 2.75rem; top: 0; bottom: 0; width: 2px; background: rgba(214, 90, 90, .28); }
.sheet-page .card { position: relative; z-index: 1; }
@media (max-width: 720px) {
  .binder-tabs { padding-left: .6rem; }
  .binder-tab { padding: .45rem 1.1rem .5rem; font-size: 1rem; }
  .sheet-page { padding: 1rem .8rem 1rem 2.2rem; }
  .sheet-page::before { left: .45rem; width: 12px; background-size: 12px 90px; background-image: radial-gradient(circle at 6px 6px, var(--bg) 4.5px, rgba(120,90,70,.25) 5.5px, transparent 6.5px); }
  .sheet-page::after { left: 1.7rem; }
}

/* ===== Aba Modelo ===== */
.modelo { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 1rem; align-items: start; }
@media (max-width: 980px) { .modelo { grid-template-columns: 1fr; } }
.mf-list { display: grid; gap: .45rem; margin-bottom: .6rem; }
.mf-row { display: grid; grid-template-columns: 1fr 1fr 96px auto; gap: .4rem; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: .4rem; }
.mf-row input, .mf-row select { padding: .4rem .5rem; font-size: .9rem; }
.mf-row .mf-act { display: flex; gap: .2rem; }
.mf-row .mf-act button { border: 1px solid var(--line); background: #fff; border-radius: 7px; width: 30px; height: 30px; cursor: pointer; color: var(--muted); font-size: .85rem; }
.mf-row .mf-act button:hover { color: var(--ink); border-color: var(--brand); }
.mf-row .mf-act button.del:hover { color: var(--bad); border-color: var(--bad); }
@media (max-width: 560px) { .mf-row { grid-template-columns: 1fr 1fr; } }
.chips { display: flex; flex-wrap: wrap; gap: .35rem; margin: .3rem 0 .2rem; }
.chip { border: 1px dashed #c9b8ad; background: #fff; border-radius: 99px; padding: .2rem .7rem; font-size: .82rem; cursor: pointer; color: var(--ink); }
.chip:hover { border-style: solid; border-color: var(--brand); }
.chip[disabled] { opacity: .4; cursor: default; }
.preview-box { position: sticky; top: 76px; }
.preview-box iframe { width: 100%; height: min(78vh, 980px); border: 1px solid var(--line); border-radius: 10px; background: #e9e4df; }
.mrow3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; }
@media (max-width: 560px) { .mrow3 { grid-template-columns: 1fr 1fr; } }
.logo-up { display: flex; gap: .8rem; align-items: center; border: 1.5px dashed #d9c9bf; border-radius: 10px; padding: .55rem .7rem; background: #fff; }
.logo-up.over { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 5%, #fff); }
.logo-prev { width: 92px; height: 56px; display: grid; place-items: center; border-radius: 8px; background: #faf6f3; flex: none; }
.logo-prev img { max-width: 88px; max-height: 52px; object-fit: contain; }
.mf-row { grid-template-columns: 1.25fr 1fr 92px auto; }
.ai-notice { display: flex; gap: .7rem; align-items: flex-start; background: #f3edff; border: 1px solid #d9caff; color: #3d2a73; border-radius: 10px; padding: .6rem .8rem; margin: .8rem 0 .2rem; font-size: .9rem; }
.ai-notice .spin { flex: none; width: 18px; height: 18px; margin-top: 2px; border-radius: 50%; border: 2.5px solid #cbb8ff; border-top-color: #6b3fc2; animation: mgspin .9s linear infinite; }
@keyframes mgspin { to { transform: rotate(360deg); } }

/* ===== contas, novas abas e telas (v10) ===== */
.top { gap: .6rem; }
.userbar { display: flex; align-items: center; gap: .6rem; margin-left: auto; color: var(--ink); }
.auth-card { max-width: 460px; margin: 0 auto 2rem; }
.btn.wide { width: 100%; justify-content: center; }
.t-provas { --c: #8ec5ff; } .t-midia { --c: #f6a6c8; } .t-turmas { --c: #ffc489; } .t-historico { --c: #c4b5fd; } .t-admin { --c: #cbd5e1; }
@media (max-width: 760px) {
  .binder-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; padding-right: .6rem; }
  .binder-tabs::-webkit-scrollbar { display: none; }
  .binder-tab { flex: 0 0 auto; padding: .42rem .85rem .48rem; font-size: .92rem; }
  .board { padding: 1rem 1rem 0; }
  .board .chalk { display: none; }
  .board img { width: 120px; height: 120px; }
  .board h1 { font-size: 1.5rem; }
  .top { padding: .5rem 12px; }
  .brand { font-size: 1.05rem; }
}
.subnav { display: flex; gap: .3rem; align-items: center; flex-wrap: wrap; margin: 0 0 1rem; border-bottom: 1px solid var(--line); padding-bottom: .5rem; }
.subnav a { padding: .35rem .75rem; border-radius: 99px; color: var(--muted); font-weight: 600; font-size: .9rem; }
.subnav a.on { background: var(--chip); color: var(--ink); }
.subnav .year-sel { margin-left: auto; display: flex; gap: .4rem; align-items: center; font-weight: 600; }
.subnav .year-sel select { width: auto; padding: .3rem .5rem; }
.sel2 { grid-template-columns: 1fr 1fr; gap: .6rem; }
@media (max-width: 560px) { .sel2 { grid-template-columns: 1fr; } }
.prova-info { background: #eef5ff; border: 1px solid #cfe0fb; border-radius: 10px; padding: .55rem .75rem; margin-bottom: .75rem; color: var(--ink); }
.vkeys { display: flex; flex-wrap: wrap; gap: .3rem 1rem; margin-top: .35rem; }
.vkeys code { font-size: .78rem; word-break: break-all; }
select.need { border-color: var(--warn); background: var(--warn-bg); }
.tpl-list { display: grid; gap: .45rem; }
.tpl { display: flex; justify-content: space-between; align-items: center; gap: .6rem; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 10px; padding: .55rem .75rem; background: #fffdfb; }
.pdf-canvas { width: 100%; height: auto; display: block; border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: var(--shadow); }
.gp-cfg { grid-template-columns: 2fr 1fr 1fr 1fr 1.4fr; gap: .6rem; }
@media (max-width: 900px) { .gp-cfg { grid-template-columns: 1fr 1fr; } }
textarea.mat { min-height: 140px; font-family: inherit; letter-spacing: 0; }
.qlist { display: grid; gap: .8rem; margin-top: .8rem; }
.qed { border: 1px solid var(--line); border-radius: 10px; padding: .7rem; background: #fffdfb; }
.qed textarea { min-height: 54px; font-family: inherit; letter-spacing: 0; flex: 1; }
.alt { display: flex; align-items: center; gap: .45rem; margin: .35rem 0 0 1.4rem; font-weight: 500; }
.alt input[type=radio] { width: auto; accent-color: var(--ok); }
.alt input.q-alt { flex: 1; padding: .35rem .5rem; }
.gab { margin: .6rem 0; } .gab code { font-size: .95rem; letter-spacing: .12em; word-break: break-all; }
.qprev { padding-left: 1.3rem; } .qprev > li { margin-bottom: .7rem; } .qprev ol li.ok { color: var(--ok); font-weight: 700; }
.dl-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .6rem; margin: .8rem 0; }
.dl-v { display: flex; flex-direction: column; gap: .35rem; border: 1px dashed #d9c9bf; border-radius: 10px; padding: .6rem; }
.md-add { display: flex; gap: .5rem; flex-wrap: wrap; } .md-add input { flex: 1 1 260px; }
.md-player { position: relative; width: 100%; max-width: 640px; aspect-ratio: 16 / 9; margin-top: .7rem; }
.md-player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; border-radius: 10px; background: #000; }
.search { display: flex; align-items: center; gap: .35rem; border: 1px solid var(--line); border-radius: 99px; padding: .15rem .7rem; background: #fff; }
.search input { border: 0; padding: .35rem .2rem; min-width: 200px; } .search input:focus { outline: none; }
.md-item { border-bottom: 1px solid var(--line); padding: .6rem 0; }
.md-row { display: flex; gap: .7rem; align-items: center; flex-wrap: wrap; }
.md-thumb { width: 88px; height: 50px; object-fit: cover; border-radius: 6px; background: var(--chip); flex: 0 0 auto; }
.md-ico { display: grid; place-items: center; font-size: 1.4rem; }
.md-info { flex: 1 1 200px; min-width: 0; } .md-info b { display: block; overflow: hidden; text-overflow: ellipsis; }
.md-act { display: flex; gap: .35rem; flex-wrap: wrap; }

/* v12: alinhamento do Guia de Provas e lista de arquivos */
.gp-cfg { align-items: end; }
.gp-cfg label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.files-list { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .5rem; }
.file-chip { display: inline-flex; align-items: center; gap: .35rem; background: var(--chip); border: 1px solid var(--line); border-radius: 99px; padding: .2rem .35rem .2rem .7rem; font-size: .85rem; }
.file-chip button { border: 0; background: none; color: var(--bad); cursor: pointer; font-size: .9rem; padding: 0 .3rem; }
.ext-dl { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin-top: .5rem; }

/* v13: alerta de verificação e salvamento automático */
.verify-alert { background: var(--bad-bg); border: 1px solid #efc4bd; color: #8a1f17; border-radius: 10px; padding: .6rem .85rem; margin: .75rem 0 .25rem; font-size: .9rem; }
.verify-alert ul { margin: .35rem 0 0; padding-left: 1.1rem; } .verify-alert a { color: #8a1f17; font-weight: 700; }
.autosave { color: var(--ok); margin: .4rem 0 0; min-height: 1em; }
.btn:disabled { opacity: .45; cursor: not-allowed; filter: grayscale(.3); }
input.need { border-color: var(--bad); background: var(--bad-bg); }

/* v15: cenas da Mari no banner (imagens retangulares) */
.board { grid-template-columns: 1fr minmax(220px, 380px); align-items: center; padding-bottom: 1.4rem; }
.board img.scene { width: 100%; height: 230px; object-fit: cover; object-position: center 12%; border-radius: 10px; border: 3px solid rgba(244,241,232,.85); box-shadow: 0 4px 14px rgba(0,0,0,.25); }
@media (max-width: 720px) { .board { grid-template-columns: 1fr; } .board img.scene { width: 100%; height: 170px; } }

/* v15: Fale com a Mari */
.mari-chat { position: fixed; right: 18px; bottom: 18px; z-index: 40; }
.mc-fab { display: flex; align-items: center; gap: .5rem; background: var(--brand); color: #fff; border: 0; border-radius: 99px; padding: .3rem 1rem .3rem .3rem; font: inherit; font-weight: 700; cursor: pointer; box-shadow: 0 6px 18px rgba(31,95,191,.35); }
.mc-fab img { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; border: 2px solid #fff; background: #fff; }
.mari-chat.open .mc-fab span { display: none; } .mari-chat.open .mc-fab { padding: .3rem; }
.mc-panel { position: absolute; right: 0; bottom: 64px; width: min(380px, calc(100vw - 28px)); height: min(560px, calc(100vh - 110px)); background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 12px 40px rgba(40,30,20,.25); display: flex; flex-direction: column; overflow: hidden; }
.mc-panel[hidden] { display: none; }
.mc-panel header { display: flex; align-items: center; gap: .6rem; padding: .6rem .8rem; background: linear-gradient(90deg, var(--board), #3a6e55); color: var(--chalk); }
.mc-panel header img { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; border: 2px solid var(--chalk); }
.mc-panel header b { display: block; font-family: "Cinzel", Georgia, serif; } .mc-panel header small { color: #dfe9e2; font-size: .75rem; }
.mc-x { margin-left: auto; background: none; border: 0; color: var(--chalk); font-size: 1.5rem; cursor: pointer; }
.mc-body { flex: 1; overflow-y: auto; padding: .8rem; display: flex; flex-direction: column; gap: .5rem; background: #fbf7f5; }
.mc-msg { max-width: 86%; padding: .55rem .75rem; border-radius: 14px; font-size: .9rem; line-height: 1.45; }
.mc-msg.user { align-self: flex-end; background: var(--brand); color: #fff; border-bottom-right-radius: 4px; }
.mc-msg.bot { align-self: flex-start; background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 4px; color: var(--text); }
.mc-msg.err { border-color: #efc4bd; background: var(--bad-bg); color: var(--bad); }
.mc-msg ul { margin: .3rem 0; padding-left: 1.1rem; }
.mc-msg.typing span { display: inline-block; width: 7px; height: 7px; margin: 0 2px; border-radius: 50%; background: var(--muted); animation: mcdot 1s infinite; }
.mc-msg.typing span:nth-child(2) { animation-delay: .15s; } .mc-msg.typing span:nth-child(3) { animation-delay: .3s; }
@keyframes mcdot { 50% { opacity: .2; transform: translateY(-3px); } }
.mc-sug { display: flex; flex-wrap: wrap; gap: .3rem; padding: 0 .8rem .5rem; background: #fbf7f5; }
.mc-sug button { border: 1px solid #cfe0fb; background: #eef5ff; color: var(--ink); border-radius: 99px; padding: .25rem .6rem; font: inherit; font-size: .78rem; cursor: pointer; }
.mc-form { display: flex; gap: .4rem; padding: .55rem; border-top: 1px solid var(--line); }
.mc-form input { flex: 1; }
@media (max-width: 560px) { .mc-fab span { display: none; } .mc-fab { padding: .3rem; } .mari-chat { right: 12px; bottom: 12px; } }
/* banners quadrados (cenas geradas): enquadra o rosto e a ação; o da aba Corrigir é horizontal */
.board img.scene.s-modelo, .board img.scene.s-turmas, .board img.scene.s-provas, .board img.scene.s-historico, .board img.scene.s-midia { object-position: center 40%; }
/* banners por aba (imagens enviadas pela Mari) + título da aba na lousa */
.board .board-tab { font-family: "Cinzel", Georgia, serif; color: #ffe79a; font-size: 1.15rem; margin: 0 0 .25rem; letter-spacing: .03em; }
.board img.scene.s-turmas { object-position: center 12%; }
.board img.scene.s-midia { object-position: center 30%; }
.board img.scene.s-modelo { object-position: center 22%; }
.board img.scene.s-historico { object-position: center 30%; }
.board img.scene.s-corrigir { object-position: center 30%; }
.board img.scene.s-historico { object-position: center 25%; }
.board img.scene.s-turmas { object-position: center 20%; }
/* dissertativas na revisão da folha */
.essay-item { border: 1px solid var(--line); border-radius: 8px; padding: .55rem .7rem; margin-bottom: .5rem; background: #fbfcff; }
.essay-item textarea { width: 100%; min-height: 54px; font-size: .9rem; }
/* aba Uso */
.t-uso { --c: #b7e4c7; }
.uso-num { font-size: 1.05rem; margin: .2rem 0 .4rem; } .uso-num b { font-size: 1.6rem; color: var(--ink, #1d2b44); }
.uso-bar { height: 14px; border-radius: 99px; background: #e8eef7; overflow: hidden; margin: .3rem 0; }
.uso-bar i { display: block; height: 100%; background: #2f6fed; border-radius: 99px; transition: width .4s; }
.uso-bar i.warn { background: #dc8a00; } .uso-bar i.bad { background: #d92d20; }
.uso-feat { width: 100%; font-size: .92rem; } .uso-feat td, .uso-feat th { padding: .35rem .5rem; }
.uso-hist { display: flex; gap: .4rem; align-items: flex-end; height: 110px; padding: .3rem 0; }
.uso-hist > div { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; }
.uso-hist span { width: 100%; max-width: 46px; background: #8ec5ff; border-radius: 6px 6px 0 0; }
.uso-hist small { font-size: .72rem; color: var(--muted); margin-top: .2rem; }
.uso-ctl input { padding: .3rem .45rem; }
.board img.scene.s-uso { object-position: center 30%; }
.uso-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.uso-kpis .kpi b { font-size: 1.7rem; } .kpi-bad b { color: #d92d20; }
.uso-expl { margin: .2rem 0 0; padding-left: 1.2rem; display: grid; gap: .45rem; font-size: .95rem; }
