/* public/assets/theme/theme.css
   "Liberty" — brand tokens from the real Pomelli Brand Book (see
   docs/liberty_brand_book_by_pomelli.pdf), replacing the "O Grimório
   Errante" fantasy skin built earlier in ignorance of that book. Loaded
   AFTER styles.css so these :root redefinitions win the cascade — this
   file is the token swap; do not duplicate component rules that already
   work via var() in styles.css. */

@import url('./fonts.css');

:root {
  color-scheme: dark;

  /* The brand book names exactly 3 colors. Everything else here is a
     pure-grayscale step between them (0% saturation, same neutral axis
     black/white already imply) — not an invented hue. */
  --bg: #000000;
  --surface: #0d0d0d;
  --surface-2: #1a1a1a;
  --surface-3: #262626;
  --border: #4d4d4d;
  --border-soft: #262626;
  /* Medido: com --muted-2 em #737373 o texto pequeno dava 4,10:1 sobre --surface e
     3,67:1 sobre --surface-2, abaixo dos 4,5:1 do AA — e esse token carrega quase todo
     o texto secundario do produto (rodape, contadores, antiguidade na fila, migalha).
     Os valores atuais passam AA nas TRES superficies, inclusive --surface-3 (#262626),
     que era a mais apertada, e mantem os tres degraus de hierarquia visiveis:
       #ffffff sobre #262626 = 15,1:1
       #b3b3b3 sobre #262626 =  7,2:1
       #909090 sobre #262626 =  4,7:1  */
  --ink: #ffffff;
  --muted: #b3b3b3;
  --muted-2: #909090;

  /* Poppy Red — the ONLY accent, surgical: CTA, hover, focus, the [LBTY]
     stamp. Never a large background fill. Text ON a red fill is --ink-on
     (black), not white — white-on-#FF0000 measures ~4.0:1 (fails AA for
     the 13-14px button labels this system uses); black-on-red measures
     5.25:1. Using black keeps the whole system inside the brand's own 3
     colors — no invented compromise tone. */
  --accent: #ff0000;
  --accent-hover: #ff3333;
  --accent-ink: #ff8080;
  --accent-soft: rgba(255, 0, 0, 0.14);
  --accent-grad: #ff0000; /* flat — brutalism doesn't gradient */
  --ink-on-accent: #000000;

  /* Semantic trio — kept for badges/status (admin), desaturated to sit
     inside a monochrome+red system: green/red read as the same family as
     everything else, amber is the only non-red warm note and stays rare. */
  --green: #2e8f4f;
  --green-soft: rgba(46, 143, 79, 0.16);
  --warn: #b8860b;
  --warn-soft: rgba(184, 134, 11, 0.16);
  --red: #ff0000;
  --red-soft: rgba(255, 0, 0, 0.14);

  /* Selecao e navegacao, deliberadamente FORA do vermelho. --accent e --red
     tem o mesmo valor (#ff0000), entao usar o acento para marcar "o item que
     voce escolheu" deixava selecao e erro indistinguiveis por cor - a
     sobrecarga semantica apontada na auditoria, verificada no nivel do token.
     Nao entra uma quarta cor: a marca e preto/branco/vermelho, entao selecao
     e neutra (borda clara + superficie elevada), que le como "ativo" sem
     roubar o significado de alerta. Ver docs/reforma/FASE-5-CURADORIA.md. */
  --select: #ffffff;
  --select-soft: rgba(255, 255, 255, 0.07);

  /* Three roles, three faces — same discipline as the old system, new
     families. Almarai is the brand's own primary face (headings, punchy
     structure). Futura LT W01 Book is licensed/paid and not available to
     self-host here — Jost is a free, honest substitute (a geometric-sans
     reinterpretation in the same Futura/Kabel family, not a random pick).
     Space Mono is new: reserved for the [LBTY] stamp component and
     nothing else — the "technical/underground" texture the brand's own
     crop-mark tags and vertical sidebar text already use. */
  --font-display: 'Almarai', system-ui, sans-serif;
  --font-body: 'Jost', system-ui, sans-serif;
  --font-stamp: 'Space Mono', ui-monospace, monospace;

  --shadow-sm: none;
  --shadow-md: none;
}

/* ---- Zero border-radius, no exceptions ----
   The one rule that makes "brutalist" a real constraint instead of an
   adjective. Every pill, circle and rounded card in styles.css becomes a
   hard rectangle. Deliberately global — this is a single design law, not
   a per-component choice, and a lone override layer is the whole reason
   this file exists (easy to find, easy to revert). */
*, *::before, *::after {
  border-radius: 0 !important;
}

/* ---- Font roles ---- */
h1, h2, h3,
.welcome h2,
.brand-suffix,
.admin-tab.active,
.central-detail-head h3,
dialog.auth-modal h2,
.nav-link {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: 0.01em;
}

body, button, input, textarea, select,
.answer p, .rules-doc p, .rules-doc li,
.help-card, .welcome > p {
  font-family: var(--font-body);
}

/* Stamp face — reserved for the [LBTY] component and nothing else. */
.lbty-stamp {
  font-family: var(--font-stamp);
}

/* ---- Kill the old ambient glow/grain — brutalism has no soft light ---- */
.welcome::before, .welcome::after {
  content: none;
}

/* ---- Brand logo ---- */
.brand-logo {
  height: 34px;
  width: auto;
  display: block;
  filter: none;
}
@media (max-width: 620px) {
  .brand-logo { height: 26px; }
}

.welcome-mark {
  display: block;
  width: min(220px, 60%);
  height: auto;
  margin: 0 auto 22px;
  filter: none;
}

/* ---- Primary nav (Início / Universo / Guia do Jogo) ---- */
.brand-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav-link {
  padding: 8px 16px;
  border: 1px solid transparent;
  color: var(--muted);
  text-decoration: none;
  font-size: var(--fs-sm);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.nav-link:hover {
  color: var(--ink);
  border-color: var(--border);
}
@media (max-width: 620px) {
  /* O espacamento entre letras e o caixa-alta engordam muito o link numa tela
     estreita: tres deles somavam mais que a largura util a 320px. */
  .nav-link { padding: 8px 10px; letter-spacing: 0.04em; white-space: nowrap; }
}
.nav-link.active {
  color: var(--ink);
  border-bottom: 2px solid var(--accent);
}

/* ---- The [LBTY] stamp — the system's signature component ----
   A reusable crop-mark tag, elevated from decoration the old Wix site
   repeated by hand into one real component. Carries a short label, NEVER
   the internal rule code (COMB.X.001) — the Regra do Nome invariant
   applies here same as everywhere else. Used on: a real citation (label
   "FONTE OFICIAL"), the honest gap state stays plain text, no stamp
   (an unwritten page doesn't get authenticated). */
.lbty-stamp {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  position: relative;
}
.lbty-stamp::before, .lbty-stamp::after {
  content: '';
  position: absolute;
  width: 6px;
  height: 6px;
  border: 1px solid var(--accent);
}
.lbty-stamp::before { top: -1px; left: -1px; border-right: none; border-bottom: none; }
.lbty-stamp::after { bottom: -1px; right: -1px; border-left: none; border-top: none; }

/* ---- Tomo register is gone: the citation card is a flat black card with
   a hard white border and an [LBTY] stamp — same information, no
   ornament. ---- */
.readout.citation:not(.citation-empty) {
  background: var(--surface-2);
  color: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 0;
  position: relative;
  padding: 20px 18px 16px;
}

/* ---- Focus: red, the surgical accent doing its one interactive job ---- */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---- Buttons filled with the accent get black text (see --ink-on-accent
   note above) — overrides the old color:var(--bg) pattern which assumed
   a light-on-dark gradient fill. ---- */
.send,
#auth-submit,
#contact-submit,
.admin-gate button,
.admin-view-head button,
.auth-tabs button.active,
.filter-btn.active,
.quickview-btn.active,
.central-detail-actions button.primary,
.tab-count {
  color: var(--ink-on-accent) !important;
}

/* ---- Vertical brand signature (from the old site's sidebar text,
   redesigned as a deliberate detail rather than decorative noise) ---- */
.brand-vertical {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-family: var(--font-stamp);
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--muted-2);
  white-space: nowrap;
}

/* ---- Menu da conta ---- */
.profile-menu { position: relative; }

.profile-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 40;
  min-width: 220px;
  padding: 0;
  background: var(--surface-2);
  border: 1px solid var(--ink);
}

.profile-panel-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 14px;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--ink);
  font-size: var(--fs-base);
  font-weight: 600;
  text-align: left;
  text-decoration: none;
  white-space: nowrap;
}
.profile-panel-item:last-of-type { border-bottom: 0; }

.profile-panel-item:hover,
.profile-panel-item:focus-visible {
  background: var(--accent);
  color: var(--ink-on-accent);
}
.profile-panel-item:hover .profile-panel-icon,
.profile-panel-item:focus-visible .profile-panel-icon { color: var(--ink-on-accent); }

.profile-panel-icon { display: inline-flex; color: var(--muted); }
.profile-panel-icon svg { width: 16px; height: 16px; }

.profile-panel-dot {
  width: 7px;
  height: 7px;
  margin-left: auto;
  background: var(--accent);
}

.profile-panel-rule { display: none; } /* .profile-panel-item borders already divide */

.profile-panel-exit { color: var(--accent); }

/* ---- Brasao ---- */
.sigil-picker {
  margin: 0;
  padding: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
}
.sigil-picker legend {
  padding: 0 6px;
  font-family: var(--font-display);
  font-size: var(--fs-sm);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink);
}
.sigil-hint {
  margin: 0 0 10px;
  font-size: var(--fs-xs);
  color: var(--muted-2);
}
.sigil-options { display: flex; flex-wrap: wrap; gap: 8px; }
.sigil-option {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--muted);
  opacity: 0.6;
}
.sigil-option svg { width: 18px; height: 18px; }
.sigil-option:hover { opacity: 1; color: var(--ink); border-color: var(--ink); }
.sigil-option:focus-visible { opacity: 1; color: var(--ink); }
.sigil-option.selected {
  opacity: 1;
  color: var(--accent);
  border-color: var(--accent);
}
#avatar.avatar-sigil svg { width: 16px; height: 16px; }

.readout.citation:not(.citation-empty) .lbty-stamp {
  display: inline-block;
  margin-bottom: 10px;
}

/* ---- Guia do Jogo (sistema-completo) — sidebar index + doc body ---- */
.rules-sidebar a.active {
  background: var(--surface-2);
  color: var(--ink);
  border-left: 2px solid var(--accent);
  padding-left: 8px;
}
.rules-doc h2 {
  font-family: var(--font-display);
  font-weight: 800;
  border-top: 1px solid var(--ink);
}
.rules-doc ol.toc {
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: none;
}
.rules-doc mark {
  background: var(--accent);
  color: var(--ink-on-accent);
}
.back-to-toc {
  background: var(--surface-2);
  border: 1px solid var(--ink);
  color: var(--ink);
  opacity: 1;
}
.back-to-toc:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ---- Universo — lore page ----
   Long-form narrative gets real typographic hierarchy: a wide hero
   statement, a constrained reading measure for body copy, and the
   [LBTY]/自유 marks doing the job the old text-wall Wix page never did —
   giving each piece a beginning and an end. */
.universo-main {
  max-width: none;
  box-shadow: none;
  position: relative;
}

.universo-vertical {
  position: fixed;
  left: 18px;
  bottom: 24px;
  z-index: 5;
  pointer-events: none;
}
@media (max-width: 900px) {
  .universo-vertical { display: none; }
}

.universo-hero {
  max-width: 900px;
  margin: 0 auto;
  padding: 64px clamp(18px, 5vw, 42px) 40px;
  text-align: left;
}
.universo-hero h1 {
  margin: 18px 0 20px;
  font-size: clamp(28px, 5vw, 46px);
  line-height: 1.15;
  color: var(--ink);
}
.universo-lede {
  max-width: 60ch;
  font-size: var(--fs-base);
  line-height: 1.6;
  color: var(--muted);
}

.lore-piece {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 clamp(18px, 5vw, 42px) 8px;
}
.lore-piece-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 22px;
}
.lore-eyebrow {
  font-family: var(--font-stamp);
  font-size: var(--fs-sm);
  color: var(--accent);
  letter-spacing: 0.1em;
}
.lore-piece-head h2 {
  margin: 0;
  padding-top: 0;
  border-top: none;
  font-size: clamp(22px, 3.4vw, 32px);
  color: var(--ink);
}
/* Leitura longa pede corpo maior que o do resto da interface: --fs-base e 13px, que
   serve a painel e formulario, nao a 1.200 palavras seguidas. O Guia do Jogo ja le
   a 16px; o Universo passa a ler igual. */
.lore-body {
  max-width: 62ch;
  color: var(--ink);
  line-height: 1.7;
  font-size: 16px;
}
.lore-tempo {
  width: 100%;
  margin: 4px 0 0;
  font-family: var(--font-stamp);
  font-size: var(--fs-xs);
  letter-spacing: 0.06em;
  color: var(--muted-2);
}

/* Progresso de leitura: 1.220 palavras em ~4.200px de rolagem sem nenhum indicador
   de quanto falta. scaleX porque a barra e atualizada a cada quadro de rolagem. */
.leitura-progresso {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 2px;
  background: var(--border);
}
.leitura-barra {
  display: block;
  height: 100%;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: 0 50%;
}

/* `width: 100%` importa: .universo-main e um flex column, e `margin: 0 auto` desliga
   o stretch do flex. Sem isso o indice encolhe pro tamanho do conteudo (medido: 404px
   contra os 720px dos capitulos) e fica visivelmente desalinhado da coluna de leitura. */
.universo-indice {
  width: 100%;
  max-width: 720px;
  margin: 0 auto 40px;
  padding: 0 clamp(18px, 5vw, 42px);
}
.universo-indice h2 {
  margin: 0 0 12px;
  padding-top: 0;
  border-top: none;
  font-family: var(--font-stamp);
  font-size: var(--fs-xs);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.universo-indice ol {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
}
.universo-indice a {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-height: 44px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  color: var(--ink);
  text-decoration: none;
}
.universo-indice a:hover .indice-titulo { text-decoration: underline; }
.indice-num {
  font-family: var(--font-stamp);
  font-size: var(--fs-sm);
  color: var(--accent);
}
.indice-titulo { flex: 1; }
.indice-tempo {
  font-family: var(--font-stamp);
  font-size: var(--fs-xs);
  color: var(--muted-2);
  font-variant-numeric: tabular-nums;
}

.lore-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 26px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: var(--fs-sm);
}
.lore-nav a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  color: var(--muted);
}
.lore-nav a:hover { color: var(--ink); }
.lore-nav-topo { margin-left: auto; }
.lore-nav-prox { order: 3; }

/* Mapa das dimensoes: a chamada da pagina promete "o mapa das dimensoes" e o
   capitulo III so trazia uma figura de personagem. As faixas seguem a ordem do
   proprio texto — Celestial no apice, Infernal no abismo. Sem <style> nem style="",
   que a CSP bloqueia: tudo por classe. */
.mapa-dimensoes {
  max-width: 62ch;
  margin: 2em 0;
}
.mapa-svg {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
  background: var(--surface-2);
}
.mapa-faixa { fill: var(--surface); stroke: var(--border); stroke-width: 1; }
.mapa-faixa-celestial { fill: #1b1b1b; }
.mapa-faixa-fisica { stroke: var(--accent); stroke-width: 1.5; }
.mapa-faixa-infernal { fill: #0a0a0a; }
.mapa-membrana { stroke: var(--muted-2); stroke-width: 1; stroke-dasharray: 5 4; }
.mapa-nome { fill: var(--ink); font-family: var(--font-display); font-size: 15px; font-weight: 700; }
.mapa-glosa { fill: var(--muted); font-size: 11px; }
.mapa-legenda { fill: var(--muted-2); font-family: var(--font-stamp); font-size: 9px; letter-spacing: 0.06em; }
.mapa-dimensoes figcaption {
  margin-top: 10px;
  font-size: var(--fs-sm);
  line-height: 1.5;
  color: var(--muted);
}
.lore-body p {
  margin: 0 0 1.3em;
}
.lore-pull {
  max-width: 52ch;
  margin: 1.8em 0;
  padding-left: 18px;
  border-left: 2px solid var(--accent);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05em;
  font-style: normal;
  color: var(--ink);
}
.lore-close {
  font-weight: 600;
  color: var(--ink);
}
.lore-piece-sig {
  margin-top: 28px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-stamp);
  font-size: 11px;
  letter-spacing: 0.05em;
  color: var(--muted-2);
}
.lore-sig-mark {
  width: 14px;
  height: 14px;
  object-fit: contain;
  opacity: 0.75;
  filter: grayscale(1) brightness(1.6);
}

/* Papel unico para a imagem de abertura dos tres capitulos: ela abre o texto, na
   mesma posicao e com o mesmo tratamento. A composicao continua livre — retrato num,
   panorama nos outros —, so o papel e que passa a ser o mesmo.

   Antes o capitulo I usava uma figura flutuante a direita, e o `.lore-body` dele
   recebia `max-width: none` pra caber ao lado dela. O efeito colateral era que a
   linha de leitura daquele capitulo ficava com 105 caracteres (medido) contra 62ch
   dos outros dois: o texto mais longo dos tres era tambem o mais dificil de ler. */
.lore-abertura {
  display: block;
  height: auto;
  margin: 0 0 24px;
  border: 1px solid var(--border);
  filter: grayscale(1);
}
.lore-abertura-panorama { width: 100%; }
.lore-abertura-retrato { width: min(240px, 60%); }

.lore-divider {
  max-width: 720px;
  margin: 48px auto;
  border: none;
  border-top: 1px solid var(--border);
}

.universo-cta {
  max-width: 720px;
  margin: 56px auto 40px;
  padding: 0 clamp(18px, 5vw, 42px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  border-top: 1px solid var(--ink);
  padding-top: 24px;
}
.universo-cta p {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.1em;
  color: var(--ink);
}
.universo-cta-link {
  display: inline-flex;
  padding: 10px 20px;
  border: 1px solid var(--ink);
  color: var(--ink);
  background: var(--accent);
  color: var(--ink-on-accent);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  font-size: var(--fs-sm);
}
.universo-cta-link:hover {
  background: var(--accent-hover);
}

/* Faixa institucional. O arquivo tem 600px de largura natural e estava sendo
   esticado pra largura total da janela (2,3x de ampliacao em 1366px): ficava
   borrado e encerrava a pagina como propaganda, competindo com a consulta, que
   e a tarefa principal. Agora nunca passa do tamanho natural e fica discreto. */
.site-banner {
  display: block;
  width: 100%;
  max-width: 460px;
  height: auto;
  margin: 48px auto 0;
  padding-top: 28px;
  border-top: 1px solid var(--border-soft, var(--border));
  opacity: .5;
  transition: opacity .2s;
}
.site-banner:hover { opacity: .8; }

/* ---- Acervo de Fichas (Inicio) ---- */
.acervo {
  max-width: 1100px;
  margin: 56px auto 0;
  padding: 32px clamp(18px, 4vw, 42px) 8px;
  border-top: 1px solid var(--border);
}
.acervo-title {
  margin: 0 0 6px;
  color: var(--ink);
}
/* Explica por que a secao existe nesta pagina. Sem isso, a galeria aparecia
   logo depois do campo de pergunta sem dizer o que tinha a ver com a consulta
   (achado da auditoria). */
.acervo-intro {
  margin: 0 0 16px;
  max-width: 62ch;
  color: var(--muted);
  font-size: var(--fs-sm);
  line-height: 1.6;
}
.acervo-fb-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin: 0 0 22px;
}
.acervo-fb-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  /* Medido em 18px de altura: abaixo do minimo de 24x24 do WCAG 2.2. */
  min-height: 24px;
  padding: 3px 0;
  color: var(--muted);
  text-decoration: none;
  font-size: var(--fs-sm);
}
.acervo-fb-link svg { width: 18px; height: 18px; }
.acervo-fb-link:hover { color: var(--ink); }
/* Slots por proporcao. Antes, retrato (226x420) e panoramicas (980x290)
   dividiam a MESMA caixa de 337x380 com object-fit: cover - espalhamento de
   6,3x no mesmo slot, descartando 74% da largura das panoramicas e 39% da
   altura do retrato (medido em navegador, ver docs/reforma/FASE-3-ASSETS.md).
   Cada formato agora tem seu proprio espaco e aparece inteiro. */
.acervo-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 3fr);
  gap: 10px;
  max-width: 780px;
  align-items: start;
}
.acervo-grid img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
  background: var(--surface);
}
.acervo-grid img.acervo-retrato { grid-row: 1 / 3; }
.acervo-grid img[data-carregou="nao"] {
  aspect-ratio: 3 / 1;
  background: repeating-linear-gradient(45deg, var(--surface-2), var(--surface-2) 8px, var(--surface) 8px, var(--surface) 16px);
}
@media (max-width: 780px) {
  .acervo-grid { grid-template-columns: 1fr; }
  .acervo-grid img.acervo-retrato { grid-row: auto; max-width: 260px; }
}

/* ---- Pagina de fichas do jogador ---- */
.perfil-main { max-width: none; box-shadow: none; }
.perfil-head { max-width: 900px; margin: 0 auto; padding: 48px clamp(18px, 5vw, 42px) 8px; }
.perfil-head h1 { margin: 0 0 10px; font-size: clamp(26px, 5vw, 40px); }
.perfil-lede { max-width: 60ch; color: var(--muted); margin: 0 0 18px; }

.fichas {
  max-width: 900px;
  margin: 0 auto;
  padding: 16px clamp(18px, 5vw, 42px) 64px;
  display: grid;
  gap: 18px;
}
@media (min-width: 780px) { .fichas { grid-template-columns: 1fr 1fr; } }

.ficha { border: 1px solid var(--border); background: var(--surface); padding: 20px; }
.ficha-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.ficha-head h2 { margin: 0; font-size: var(--fs-lg); }
.ficha-estado {
  font-family: var(--font-stamp);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 8px;
  border: 1px solid var(--border);
  color: var(--muted);
  white-space: nowrap;
}
.ficha-estado-aprovado { border-color: var(--green); color: var(--green); }
.ficha-estado-pendente { border-color: var(--warn); color: var(--warn); }
.ficha-estado-recusado { border-color: var(--accent); color: var(--accent); }
.ficha-tipo { color: var(--muted-2); font-size: var(--fs-sm); margin: 4px 0 14px; text-transform: capitalize; }
.ficha-nota { border-left: 2px solid var(--accent); padding-left: 12px; color: var(--muted); font-size: var(--fs-sm); }
.ficha-campos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; margin: 0 0 16px; }
.ficha-campos dt { font-family: var(--font-stamp); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted-2); }
.ficha-campos dd { margin: 2px 0 0; }
.ficha-acoes { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
/* Aviso do segundo passo de "reabrir ficha aprovada" - mesma forma de .ficha-nota (borda
   lateral + texto discreto), mas com --warn em vez de --accent pra nao se confundir com a
   observacao da revisao. flex-basis:100% forca a propria linha dentro de .ficha-acoes, antes
   dos botoes de confirmar/cancelar. */
.ficha-aviso-reabrir { flex-basis: 100%; margin: 0; border-left: 2px solid var(--warn); padding-left: 12px; color: var(--muted); font-size: var(--fs-sm); }
.ficha-anexo { font-size: var(--fs-sm); color: var(--muted); display: grid; gap: 6px; }
.ficha-nova { display: grid; gap: 12px; }
.ficha-nova label { display: grid; gap: 5px; font-size: var(--fs-sm); color: var(--muted); }
.ficha-nova textarea { resize: vertical; }
.ficha-faccoes { border: 1px solid var(--border); padding: 12px 14px; margin: 0; }
.ficha-faccoes legend {
  padding: 0 6px;
  font-family: var(--font-stamp);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.ficha-faccao {
  display: flex !important;
  align-items: center;
  gap: 8px;
  color: var(--ink);
}

/* ---- Fila de fichas no painel admin ---- */
.ficha-admin-acoes {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px 14px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-soft);
}
.ficha-admin-acoes label {
  display: grid;
  gap: 4px;
  font-family: var(--font-stamp);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.ficha-admin-acoes input[type="number"] { width: 90px; }
.ficha-admin-msg { margin-top: 10px; }
