/*
 * Tema: <html data-cor="azul|rosa|vermelho|verde|amarelo|marrom|mono" data-modo="claro|escuro|sistema">
 * (escolhido na faixa do topo; guardado no aparelho em localStorage 'lector-tema').
 */
:root {
  --bg: #f4f2ee; --surface: #ffffff; --ink: #1d2327; --muted: #6b7378; --line: #e2ded7;
  --ok: #2e7d4f; --ok-soft: #e1f2e8; --warn: #a8650a; --warn-soft: #fbefd9; --bad: #b3261e; --bad-soft: #fbe3e1;
  --shadow: 0 1px 2px rgba(0, 0, 0, .05), 0 2px 8px rgba(0, 0, 0, .04); color-scheme: light;
  --accent: #1e4d8c; --accent-text: #1e4d8c; --accent-ink: #ffffff; --accent-soft: #e2ebf7;
  --radius: 12px; --nav-w: 220px;
}
:root[data-cor="azul"] { --accent: #1e4d8c; --accent-text: #1e4d8c; --accent-ink: #ffffff; --accent-soft: #e2ebf7; }
:root[data-cor="rosa"] { --accent: #b0306c; --accent-text: #a52d65; --accent-ink: #ffffff; --accent-soft: #f9e3ee; }
:root[data-cor="vermelho"] { --accent: #c4173e; --accent-text: #b3153a; --accent-ink: #ffffff; --accent-soft: #fbe2e7; }
:root[data-cor="verde"] { --accent: #2b6b3d; --accent-text: #2b6b3d; --accent-ink: #ffffff; --accent-soft: #e1efe4; }
:root[data-cor="amarelo"] { --accent: #e3ac12; --accent-text: #8a6400; --accent-ink: #1f1a08; --accent-soft: #fbf1d3; }
:root[data-cor="marrom"] { --accent: #7a4a2a; --accent-text: #7a4a2a; --accent-ink: #ffffff; --accent-soft: #f1e6dc; }
:root[data-cor="mono"] { --accent: #2b2f31; --accent-text: #2b2f31; --accent-ink: #ffffff; --accent-soft: #e9eaea; }
:root[data-modo="escuro"] {
  --bg: #15191b; --surface: #1e2427; --ink: #e8eaeb; --muted: #9aa3a8; --line: #30383c;
  --ok: #6cc592; --ok-soft: #1d3327; --warn: #e3a64a; --warn-soft: #3a2c15; --bad: #f08a83; --bad-soft: #3e1f1d;
  --shadow: none; color-scheme: dark;
  --accent: #8db7f0; --accent-text: #8db7f0; --accent-ink: #0b1726; --accent-soft: #1f2f45;
}
:root[data-modo="escuro"][data-cor="azul"] { --accent: #8db7f0; --accent-text: #8db7f0; --accent-ink: #0b1726; --accent-soft: #1f2f45; }
:root[data-modo="escuro"][data-cor="rosa"] { --accent: #f29ac2; --accent-text: #f29ac2; --accent-ink: #2a0f1c; --accent-soft: #3d2230; }
:root[data-modo="escuro"][data-cor="vermelho"] { --accent: #f5899f; --accent-text: #f5899f; --accent-ink: #2a0c12; --accent-soft: #40212a; }
:root[data-modo="escuro"][data-cor="verde"] { --accent: #86d09b; --accent-text: #86d09b; --accent-ink: #0e2415; --accent-soft: #213a29; }
:root[data-modo="escuro"][data-cor="amarelo"] { --accent: #f2c94c; --accent-text: #f2c94c; --accent-ink: #1f1a08; --accent-soft: #3a3219; }
:root[data-modo="escuro"][data-cor="marrom"] { --accent: #d6a77f; --accent-text: #d6a77f; --accent-ink: #24160b; --accent-soft: #3a2c21; }
:root[data-modo="escuro"][data-cor="mono"] { --accent: #e4e6e7; --accent-text: #e4e6e7; --accent-ink: #121415; --accent-soft: #2e3437; }
@media (prefers-color-scheme: dark) {
  :root:not([data-modo="claro"]):not([data-modo="escuro"]) {
  --bg: #15191b; --surface: #1e2427; --ink: #e8eaeb; --muted: #9aa3a8; --line: #30383c;
    --ok: #6cc592; --ok-soft: #1d3327; --warn: #e3a64a; --warn-soft: #3a2c15; --bad: #f08a83; --bad-soft: #3e1f1d;
    --shadow: none; color-scheme: dark;
    --accent: #8db7f0; --accent-text: #8db7f0; --accent-ink: #0b1726; --accent-soft: #1f2f45;
  }
  :root:not([data-modo="claro"]):not([data-modo="escuro"])[data-cor="azul"] { --accent: #8db7f0; --accent-text: #8db7f0; --accent-ink: #0b1726; --accent-soft: #1f2f45; }
  :root:not([data-modo="claro"]):not([data-modo="escuro"])[data-cor="rosa"] { --accent: #f29ac2; --accent-text: #f29ac2; --accent-ink: #2a0f1c; --accent-soft: #3d2230; }
  :root:not([data-modo="claro"]):not([data-modo="escuro"])[data-cor="vermelho"] { --accent: #f5899f; --accent-text: #f5899f; --accent-ink: #2a0c12; --accent-soft: #40212a; }
  :root:not([data-modo="claro"]):not([data-modo="escuro"])[data-cor="verde"] { --accent: #86d09b; --accent-text: #86d09b; --accent-ink: #0e2415; --accent-soft: #213a29; }
  :root:not([data-modo="claro"]):not([data-modo="escuro"])[data-cor="amarelo"] { --accent: #f2c94c; --accent-text: #f2c94c; --accent-ink: #1f1a08; --accent-soft: #3a3219; }
  :root:not([data-modo="claro"]):not([data-modo="escuro"])[data-cor="marrom"] { --accent: #d6a77f; --accent-text: #d6a77f; --accent-ink: #24160b; --accent-soft: #3a2c21; }
  :root:not([data-modo="claro"]):not([data-modo="escuro"])[data-cor="mono"] { --accent: #e4e6e7; --accent-text: #e4e6e7; --accent-ink: #121415; --accent-soft: #2e3437; }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-tap-highlight-color: transparent; }
a { color: var(--accent-text); }
h1 { font-size: 1.5rem; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 1.05rem; margin: 0 0 .75rem; }
code { font-size: .9em; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; letter-spacing: .12em; text-transform: uppercase; }

/* Estrutura */
.topwrap { position: sticky; top: 0; z-index: 20; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .6rem 1rem; padding-top: max(.6rem, env(safe-area-inset-top)); background: var(--surface); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: .5rem; font-weight: 700; color: var(--ink); text-decoration: none; }
.sync { font-size: .78rem; padding: .15rem .55rem; border-radius: 99px; background: var(--accent-soft); color: var(--muted); }
.sync.ok { background: var(--ok-soft); color: var(--ok); }
.sync.warn { background: var(--warn-soft); color: var(--warn); }
#nav { position: fixed; z-index: 15; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-around; background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
#nav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: .45rem .2rem; font-size: .68rem; color: var(--muted); text-decoration: none; }
#nav a .ico { font-size: 1.2rem; line-height: 1.2; }
#nav a.on { color: var(--accent-text); font-weight: 600; }
#nav a[href="#/alunos"], #nav a[href="#/ajuda"] { display: none; }
main { max-width: 1100px; margin: 0 auto; padding: 1rem 1rem 6rem; }
body.login-mode #nav, body.login-mode .sync, body.login-mode .help-link { display: none; }
.top-right { display: flex; align-items: center; gap: .5rem; }
.help-link { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line); color: var(--accent-text); font-weight: 700; text-decoration: none; }
.help-frame { display: block; width: 100%; height: calc(100vh - 200px); min-height: 480px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.help-inline { font-size: .85rem; }
@media (min-width: 900px) {
  #nav { top: var(--top-h, 53px); bottom: 0; right: auto; width: var(--nav-w); flex-direction: column; justify-content: flex-start; padding: 1rem .6rem; border-top: 0; border-right: 1px solid var(--line); gap: 2px; }
  #nav a { flex: none; flex-direction: row; gap: .7rem; padding: .55rem .8rem; font-size: .95rem; border-radius: 8px; }
  #nav a .ico { width: 1.3rem; text-align: center; font-size: 1.05rem; }
  #nav a.on { background: var(--accent-soft); }
  #nav a[href="#/alunos"], #nav a[href="#/ajuda"] { display: flex; }
  a.help-link { display: none; }
  .theme-toggle { display: none; }
  main { margin-left: var(--nav-w); padding: 1.5rem 2rem 3rem; }
  body.login-mode main { margin-left: auto; }
}

/* Componentes */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: .8rem; margin-bottom: 1rem; }
.back { display: inline-block; font-size: .85rem; text-decoration: none; margin-bottom: .2rem; }
.row { display: flex; align-items: center; gap: .5rem; }
.row.wrap { flex-wrap: wrap; }
.card { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; margin-bottom: 1rem; box-shadow: var(--shadow); color: inherit; }
.card.flush { padding: 0; overflow-x: auto; }
@media (max-width: 640px) {
  .table th, .table td { padding: .5rem .55rem; }
  .table.grades .hide-sm { display: none; }
  .table.grades .actions-cell { white-space: normal; }
  .table.grades .actions-cell .btn { margin: 2px 0; }
}
.card.link { text-decoration: none; transition: border-color .15s; }
.card.link:hover { border-color: var(--accent); }
.card.notice, p.notice { background: var(--warn-soft); border-color: transparent; color: var(--ink); }
p.notice { padding: .6rem .8rem; border-radius: 8px; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: .8rem; margin-bottom: .6rem; }
.card-head h2 { display: flex; align-items: center; gap: .6rem; margin: 0; }
.logo { width: 34px; height: 34px; object-fit: contain; border-radius: 6px; background: #fff; }
.section-title { margin: 1.5rem 0 .7rem; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.empty { text-align: center; padding: 3rem 1rem; color: var(--muted); }
.empty .btn { margin-top: .6rem; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .3rem; min-height: 40px; padding: .45rem .95rem; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--accent); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--accent-text); }
.btn.ghost:hover { background: var(--accent-soft); }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.danger-text { color: var(--bad); }
.btn.small { min-height: 30px; padding: .2rem .6rem; font-size: .82rem; }
.btn.big { min-height: 52px; font-size: 1.05rem; padding: .6rem 1.4rem; }
.btn.huge { min-height: 72px; font-size: 1.25rem; padding: .8rem 1.6rem; border-radius: 14px; }
.btn.left { margin-right: auto; }

.chip { display: inline-block; padding: .08rem .55rem; border-radius: 99px; font-size: .78rem; font-weight: 600; background: var(--line); color: var(--muted); white-space: nowrap; text-decoration: none; }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.info { background: var(--accent-soft); color: var(--accent-text); }

.field { display: flex; flex-direction: column; gap: .3rem; margin-bottom: .8rem; }
.field > span { font-size: .82rem; font-weight: 600; color: var(--muted); }
.field small { color: var(--muted); font-size: .78rem; }
.field.inline { flex-direction: row; align-items: center; margin: 0; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: .55rem .7rem; min-height: 42px; width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
input[type="checkbox"] { width: 18px; height: 18px; min-height: 0; accent-color: var(--accent); }
input[type="file"] { padding: .4rem; }
.page-head select, .page-head input[type="search"] { width: auto; min-width: 200px; max-width: 100%; }
.check { display: flex; align-items: center; gap: .5rem; padding: .3rem 0; cursor: pointer; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .1rem .8rem; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0 1rem; }
.grid2 .wide { grid-column: 1 / -1; }

.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: .6rem .8rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: var(--bg); }
.table tr:last-child td { border-bottom: 0; }
.table.click tbody tr { cursor: pointer; }
.table.click tbody tr:hover { background: var(--accent-soft); }
.table .num { text-align: right; width: 1%; white-space: nowrap; }
.table th.sort { cursor: pointer; }
.table th.sort:hover { color: var(--accent-text); }
.actions-cell { text-align: right; white-space: nowrap; }
.grade-cell { font-weight: 700; font-size: 1.05rem; }
.grade-cell.low { color: var(--bad); }
tr.absent td { color: var(--muted); }
.scroll-x { overflow-x: auto; }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .6rem; }
.tile { display: flex; flex-direction: column; padding: .8rem; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; color: inherit; }
.tile:hover { border-color: var(--accent); }
.tile span { color: var(--muted); font-size: .85rem; }

.tabs { display: flex; gap: .3rem; overflow-x: auto; margin-bottom: 1rem; border-bottom: 1px solid var(--line); }
.tabs.sub { border-bottom: 0; }
.tab { padding: .5rem .9rem; border: 0; background: none; font: inherit; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; cursor: pointer; text-decoration: none; white-space: nowrap; }
.tabs.sub .tab { border: 1px solid var(--line); border-radius: 99px; padding: .3rem .9rem; }
.tab.on { color: var(--accent-text); border-bottom-color: var(--accent); }
.tabs.sub .tab.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

.hero { display: flex; flex-wrap: wrap; gap: .8rem; margin: .5rem 0 1rem; }
.hero .huge { flex: 1 1 280px; }
.class-status > div { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .45rem 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.class-status > div:first-child { border-top: 0; }

.step h2 { display: flex; align-items: center; gap: .6rem; }
.step .n { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-size: .85rem; }

/* Grade do gabarito */
.keygrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(calc(2.2rem + var(--alts) * 2.35rem + 2.5rem), 1fr)); gap: .25rem 1.2rem; margin: .5rem 0 1rem; }
.krow { display: flex; align-items: center; gap: .25rem; padding: .1rem .3rem; border-radius: 8px; }
.krow.missing { background: var(--warn-soft); }
.krow.annulled .kb:not(.x) { opacity: .35; }
.qn { width: 2rem; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; margin-right: .2rem; }
.kb { width: 2.15rem; height: 2.15rem; border-radius: 50%; border: 1.5px solid var(--line); background: var(--surface); color: var(--muted); font: inherit; font-weight: 700; font-size: .85rem; cursor: pointer; padding: 0; user-select: none; -webkit-user-select: none; }
.kb:hover { border-color: var(--accent); }
.kb.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.kb.x { border-style: dashed; margin-left: .2rem; }
.kb.x.on { background: var(--bad); border-color: var(--bad); color: #fff; }
.kb.wide { width: auto; border-radius: 99px; padding: 0 .8rem; font-weight: 600; }

/* Correção */
.capture { display: flex; flex-direction: column; gap: .6rem; margin-bottom: 1rem; }
.capture .huge { width: 100%; }
.result { background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--line); border-radius: var(--radius); padding: .8rem 1rem; margin-bottom: .6rem; }
.result p { margin: .3rem 0 0; }
.result.ok { border-left-color: var(--ok); }
.result.warn { border-left-color: var(--warn); }
.result.bad { border-left-color: var(--bad); background: var(--bad-soft); }
.result.busy { display: flex; align-items: center; gap: .6rem; color: var(--muted); }
.res-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.grade { font-size: 1.9rem; font-weight: 800; line-height: 1; text-align: right; font-variant-numeric: tabular-nums; }
.grade small { display: block; margin-top: .35rem; font-size: .8rem; font-weight: 600; line-height: 1.2; color: var(--muted); }
.spinner { width: 18px; height: 18px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.prog { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: .6rem .9rem; margin-bottom: .5rem; }
.prog summary { display: flex; align-items: center; gap: .8rem; cursor: pointer; list-style: none; flex-wrap: wrap; }
.prog summary::-webkit-details-marker { display: none; }
.bar, .pbar { flex: 1; min-width: 80px; height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; }
.bar i, .pbar i { display: block; height: 100%; background: var(--ok); }
.pbar { display: inline-block; width: 60px; min-width: 60px; flex: none; vertical-align: middle; height: 6px; }

.review-row { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; padding: .8rem 0; border-top: 1px solid var(--line); }
.review-row:first-of-type { border-top: 0; }
.crop { border-radius: 6px; border: 1px solid var(--line); background-repeat: no-repeat; max-width: 100%; }
.pick { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .4rem; }
.sticky-actions { position: sticky; bottom: 70px; justify-content: flex-end; padding: .6rem 0; }
@media (min-width: 900px) { .sticky-actions { bottom: 0; } }

/* Resultados */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: .6rem; margin-bottom: 1rem; }
.stats > div { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: .6rem .8rem; }
.stats span { display: block; font-size: .78rem; color: var(--muted); }
.stats strong { font-size: 1.4rem; font-variant-numeric: tabular-nums; }
.map { border-collapse: collapse; font-size: .78rem; font-variant-numeric: tabular-nums; }
.map th, .map td { border: 1px solid var(--line); padding: .25rem .3rem; text-align: center; min-width: 1.6rem; }
.map th { background: var(--bg); color: var(--muted); }
.map .name { text-align: left; white-space: nowrap; position: sticky; left: 0; background: var(--surface); max-width: 220px; overflow: hidden; text-overflow: ellipsis; z-index: 1; }
.map th.name { background: var(--bg); }
.map td.y { background: var(--ok-soft); color: var(--ok); }
.map td.n { background: var(--bad-soft); color: var(--bad); font-weight: 700; }
.map td.b { background: var(--line); }
.map td.an { background: repeating-linear-gradient(45deg, var(--line), var(--line) 3px, transparent 3px, transparent 6px); }
.map tfoot td { font-weight: 700; background: var(--bg); }
.map td.pct.low { color: var(--bad); }
.items td.right { background: var(--ok-soft); color: var(--ok); font-weight: 700; }
.items td.suspect { background: var(--warn-soft); color: var(--warn); font-weight: 700; }
.items tr.annulled td { color: var(--muted); }

/* Janelas e avisos */
.modal-wrap { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 1rem; background: rgba(10, 15, 18, .45); }
.modal { width: 100%; max-width: 440px; max-height: 92vh; overflow: auto; background: var(--surface); border-radius: 16px; padding: 1.3rem; box-shadow: 0 10px 40px rgba(0, 0, 0, .25); }
.modal.wide { max-width: 640px; }
.modal h2 { font-size: 1.15rem; margin-bottom: 1rem; }
.actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: 1rem; flex-wrap: wrap; }
.confirm-msg { margin: 0 0 .5rem; font-size: 1rem; }
#toasts { position: fixed; z-index: 60; left: 50%; bottom: 84px; transform: translateX(-50%); display: flex; flex-direction: column; gap: .4rem; width: min(92vw, 420px); }
.toast { background: var(--ink); color: var(--bg); padding: .7rem 1rem; border-radius: 10px; box-shadow: 0 4px 16px rgba(0, 0, 0, .2); transition: opacity .4s, transform .4s; }
.toast.ok { background: var(--ok); color: #fff; }
.toast.warn { background: var(--warn); color: #fff; }
.toast.out { opacity: 0; transform: translateY(8px); }
@media (min-width: 900px) { #toasts { bottom: 24px; left: calc(50% + var(--nav-w) / 2); } }

.login { max-width: 380px; margin: 12vh auto 0; }
.login h1 { margin-bottom: .3rem; }
.login .btn { width: 100%; margin-top: .4rem; }
.error { color: var(--bad); min-height: 1.2em; }

@media print { .top, #nav, .btn { display: none !important; } main { margin: 0; padding: 0; } }

/* ---------- Faixa de tema (como na versão Lite e no site reinaldo.mat.br) ---------- */
.theme-bar { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 12px; padding: 5px 1rem; background: var(--bg); border-bottom: 1px solid var(--line); font-size: .82rem; }
.theme-bar .lbl { font-weight: 700; color: var(--muted); }
.modes { display: flex; padding: 2px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); }
.modes button { display: inline-flex; align-items: center; justify-content: center; gap: 4px; height: 30px; min-width: 30px; padding: 0 9px; border: 0; border-radius: 99px; background: transparent; color: var(--muted); font: inherit; font-weight: 600; cursor: pointer; }
.modes button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.modes svg { flex: none; }
.swatches { display: flex; gap: 6px; flex-wrap: wrap; }
.swatch { width: 26px; height: 26px; border-radius: 50%; padding: 0; cursor: pointer; border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--line); }
.swatch[aria-pressed="true"] { border-color: var(--ink); }
.swatch[data-cor="azul"] { background: #1e4d8c; }
.swatch[data-cor="rosa"] { background: #b0306c; }
.swatch[data-cor="vermelho"] { background: #c4173e; }
.swatch[data-cor="verde"] { background: #2b6b3d; }
.swatch[data-cor="amarelo"] { background: #e3ac12; }
.swatch[data-cor="marrom"] { background: #7a4a2a; }
.swatch[data-cor="mono"] { background: linear-gradient(135deg, #111 50%, #fff 50%); }
@media (max-width: 640px) { .theme-bar .lbl, .modes .txt { display: none; } .theme-bar { justify-content: center; gap: 8px; } }

/* ---------- Marca Lector ---------- */
.brand img.sym { width: 34px; height: auto; }
.brand img.word { height: 22px; width: auto; }
.brand img.word.on-dark { display: none; }
:root[data-modo="escuro"] .brand img.word.on-light { display: none; }
:root[data-modo="escuro"] .brand img.word.on-dark { display: inline; }
@media (prefers-color-scheme: dark) {
  :root:not([data-modo="claro"]):not([data-modo="escuro"]) .brand img.word.on-light { display: none; }
  :root:not([data-modo="claro"]):not([data-modo="escuro"]) .brand img.word.on-dark { display: inline; }
}
.login .logo { display: block; width: 220px; max-width: 70%; margin: 0 auto 1rem; padding: 10px; border-radius: 14px; background: #fff; }

/* ---------- Início: ações principais (como na versão Lite) ---------- */
.home-title { margin: .4rem 0 1rem; }
.actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: .8rem; margin-bottom: 1rem; }
.action { display: flex; flex-direction: column; gap: .3rem; padding: 1.1rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); color: var(--ink); text-decoration: none; transition: transform .15s, border-color .15s; }
.action:hover { transform: translateY(-2px); border-color: var(--accent); }
.action strong { font-size: 1.08rem; }
.action span:last-child { color: var(--muted); font-size: .88rem; }
.action .ic { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-text); font-size: 1.3rem; font-weight: 700; margin-bottom: .2rem; }
.action.main { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.action.main span:last-child { color: var(--accent-ink); opacity: .85; }
.action.main .ic { background: rgba(255, 255, 255, .18); color: var(--accent-ink); }

/* ---------- Opções do cartão + prévia ---------- */
.card-opts { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1.2rem; align-items: start; margin-bottom: .6rem; }
.card-preview { margin: 0; text-align: center; }
.card-preview svg { display: block; width: 150px; height: auto; }
.pv-page { fill: #fff; stroke: var(--line); }
.pv-ink { fill: #111; } .pv-qr { fill: #111; opacity: .85; }
.pv-bar { fill: #c9c9c9; } .pv-bar.strong { fill: #777; }
.pv-line { stroke: #bbb; stroke-width: .5; }
.pv-bubbles circle { fill: none; stroke: #777; stroke-width: .35; }
@media (max-width: 640px) { .card-opts { grid-template-columns: 1fr; } .card-preview svg { margin: 0 auto; width: 130px; } }

/* No celular a faixa de cores fica recolhida: o botão ◐ do topo abre e fecha. */
@media (max-width: 899px) { .theme-bar { display: none; } body.show-theme .theme-bar { display: flex; } }
.theme-toggle { cursor: pointer; background: transparent; font: inherit; padding: 0; }
body.login-mode .theme-toggle { display: inline-grid; }

.theme-bar.inline { display: flex !important; justify-content: flex-start; padding: 0 0 .4rem; background: none; border: 0; }
.theme-bar.inline .lbl { display: none; }
.theme-bar.inline .modes .txt { display: inline; }
.hero { margin-top: 0; }

@media (max-width: 640px) {
  .actions { grid-template-columns: 1fr 1fr; gap: .6rem; }
  .action { padding: .8rem; }
  .action span:last-child { display: none; }
  .action .ic { width: 36px; height: 36px; font-size: 1.1rem; }
  .action strong { font-size: .98rem; }
  .action.main { grid-column: 1 / -1; flex-direction: row; align-items: center; gap: .8rem; padding: 1rem; }
  .action.main strong { font-size: 1.15rem; }
  .home-title { font-size: 1.25rem; }
}
