/* =========================================================================
   Ementário CVM — folha de estilo
   Estética: editorial/jurídica refinada · papel quente · acento pinheiro
   ========================================================================= */

:root {
  --paper:      #F1ECE0;
  --surface:    #FBF8F1;
  --surface-2:  #ECE5D5;
  --ink:        #1C1B18;
  --ink-soft:   #4A463C;
  --muted:      #837B6B;
  --line:       #DDD5C3;
  --line-soft:  #E8E1D2;
  --accent:     #145A4E;
  --accent-ink: #0C3A33;
  --accent-soft:#DBE8E2;
  --gold:       #9C6B16;
  --mark-bg:    #F3D88B;
  --mark-ink:   #5A3D00;
  --danger:     #8A2F2A;
  --danger-soft:#F0DAD7;
  --ok:         #2E6B3E;
  --shadow-sm:  0 1px 2px rgba(28,27,24,.05), 0 2px 8px rgba(28,27,24,.04);
  --shadow-md:  0 6px 24px rgba(28,27,24,.10), 0 2px 6px rgba(28,27,24,.06);
  --shadow-lg:  0 20px 60px rgba(28,27,24,.22);
  --radius:     14px;
  --radius-sm:  9px;
  --maxw:       1180px;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans:  "Hanken Grotesk", -apple-system, BlinkMacSystemFont, sans-serif;
  --mono:  "Spline Sans Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
}

[data-theme="dark"] {
  --paper:      #15130E;
  --surface:    #1E1B15;
  --surface-2:  #262217;
  --ink:        #EEE9DC;
  --ink-soft:   #CBC4B2;
  --muted:      #968D7B;
  --line:       #322C20;
  --line-soft:  #2A2519;
  --accent:     #63C6B2;
  --accent-ink: #9FE0D2;
  --accent-soft:#16332D;
  --gold:       #D8A24A;
  --mark-bg:    #5A4A1E;
  --mark-ink:   #F4DC93;
  --danger:     #E2938C;
  --danger-soft:#3A211F;
  --ok:         #7FBE8C;
  --shadow-sm:  0 1px 2px rgba(0,0,0,.30);
  --shadow-md:  0 8px 28px rgba(0,0,0,.45);
  --shadow-lg:  0 24px 64px rgba(0,0,0,.6);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    radial-gradient(140% 120% at 100% 0%, color-mix(in srgb, var(--accent) 7%, transparent) 0%, transparent 42%),
    radial-gradient(120% 100% at 0% 100%, color-mix(in srgb, var(--gold) 6%, transparent) 0%, transparent 40%);
  background-attachment: fixed;
  line-height: 1.55;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}

/* subtil grão de papel */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none; z-index: 0;
  opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

::selection { background: var(--mark-bg); color: var(--mark-ink); }

/* ----- Faixa demo ----- */
.demo-banner {
  position: relative; z-index: 5;
  display: flex; align-items: center; gap: 1rem;
  justify-content: center;
  background: var(--accent-ink);
  color: #F3EFE6;
  font-size: .82rem;
  padding: .55rem 2.6rem .55rem 1.2rem;
  text-align: center;
}
[data-theme="dark"] .demo-banner { background: var(--accent-soft); color: var(--accent-ink); }
.demo-banner code { font-family: var(--mono); font-size: .92em; opacity: .85; }
.demo-close {
  position: absolute; right: .6rem; top: 50%; transform: translateY(-50%);
  background: transparent; border: 0; color: inherit; font-size: 1.3rem;
  cursor: pointer; line-height: 1; padding: .2rem .5rem; border-radius: 6px;
}
.demo-close:hover { background: rgba(255,255,255,.15); }
body.demo-hidden .demo-banner { display: none; }

/* ----- Topbar ----- */
.topbar {
  position: relative; z-index: 4;
  display: flex; align-items: center; justify-content: space-between;
  max-width: var(--maxw); margin: 0 auto;
  padding: 1.1rem clamp(1rem, 4vw, 2.2rem) .8rem;
}
.brand { display: inline-flex; align-items: center; gap: .6rem; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-mark {
  display: grid; place-items: center;
  width: 34px; height: 34px; border-radius: 9px;
  background: var(--accent); color: #F3EFE6;
  font-family: var(--serif); font-weight: 600; font-size: 1.25rem;
  box-shadow: var(--shadow-sm);
}
.brand-name { font-family: var(--serif); font-size: 1.4rem; font-weight: 500; letter-spacing: -.01em; }
.brand-dot { color: var(--accent); }
.brand-sub { font-family: var(--sans); font-size: .7rem; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--muted); margin-left: .15rem; vertical-align: .35em; }

.topbar-actions { display: flex; align-items: center; gap: .4rem; }
.ghost-link { color: var(--ink-soft); font-size: .9rem; font-weight: 500; padding: .4rem .6rem; border-radius: 8px; }
.ghost-link:hover { background: var(--surface-2); text-decoration: none; }
.icon-btn {
  display: grid; place-items: center; width: 38px; height: 38px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-soft);
  border-radius: 10px; cursor: pointer; transition: .18s;
}
.icon-btn:hover { color: var(--ink); border-color: var(--accent); transform: translateY(-1px); }
.ico-moon { display: none; }
[data-theme="dark"] .ico-sun { display: none; }
[data-theme="dark"] .ico-moon { display: block; }

/* ====================  BUSCA  ==================== */
.searchwrap {
  position: relative; z-index: 3;
  max-width: 820px; margin: 0 auto;
  padding: clamp(1.5rem, 8vh, 5.5rem) clamp(1rem, 4vw, 2rem) 1rem;
  text-align: center;
  transition: padding .3s ease;
}
.hero-brand { transition: opacity .25s, transform .3s; }
.hero-title {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(2.1rem, 6vw, 3.5rem); line-height: 1.05;
  letter-spacing: -.02em; margin: 0 0 .7rem;
}
.hero-title .hl { font-style: italic; color: var(--accent); }
.hero-tag { color: var(--ink-soft); font-size: clamp(.98rem, 2.2vw, 1.12rem);
  max-width: 40ch; margin: 0 auto 1.8rem; }

.searchbar {
  display: flex; align-items: center; gap: .6rem;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 999px;
  padding: .55rem .7rem .55rem 1.1rem;
  box-shadow: var(--shadow-md);
  transition: border-color .2s, box-shadow .2s;
  max-width: 720px; margin: 0 auto;
}
.searchbar:focus-within {
  border-color: var(--accent);
  box-shadow: var(--shadow-md), 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent);
}
.search-ico { color: var(--muted); flex: none; }
.searchbar:focus-within .search-ico { color: var(--accent); }
#q {
  flex: 1; border: 0; background: transparent; outline: 0;
  font-family: var(--sans); font-size: 1.08rem; color: var(--ink);
  padding: .35rem 0; min-width: 0;
}
#q::placeholder { color: var(--muted); }
#q::-webkit-search-cancel-button { display: none; }
.kbd-hint, kbd {
  font-family: var(--mono); font-size: .72rem; color: var(--muted);
  border: 1px solid var(--line); border-bottom-width: 2px;
  border-radius: 6px; padding: .1rem .42rem; background: var(--surface-2);
}
.searchbar .kbd-hint { flex: none; }
.searchbar:focus-within .kbd-hint { opacity: 0; }
.clear-btn {
  flex: none; width: 30px; height: 30px; border-radius: 50%;
  border: 0; background: var(--surface-2); color: var(--ink-soft);
  font-size: 1.2rem; line-height: 1; cursor: pointer;
}
.clear-btn:hover { background: var(--danger-soft); color: var(--danger); }

/* extras da home */
.home-extras { margin-top: 1.6rem; }
.chips-row { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; justify-content: center; margin-bottom: .8rem; }
.chips-label { font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 700; margin-right: .2rem; }
.chip {
  font-family: var(--sans); font-size: .88rem; font-weight: 500;
  color: var(--accent-ink); background: var(--accent-soft);
  border: 1px solid transparent; border-radius: 999px;
  padding: .35rem .85rem; cursor: pointer; transition: .16s;
}
[data-theme="dark"] .chip { color: var(--accent); }
.chip:hover { transform: translateY(-1px); border-color: var(--accent); }
.recents .chip { background: var(--surface-2); color: var(--ink-soft); }
.index-stat { font-size: .85rem; color: var(--muted); margin-top: 1.4rem; font-variant-numeric: tabular-nums; }

/* ---- modo RESULTADOS: searchwrap vira barra fixa ---- */
body[data-state="results"] .searchwrap {
  position: sticky; top: 0;
  max-width: none; width: 100%;
  padding: .7rem clamp(1rem, 4vw, 2.2rem);
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
body[data-state="results"] .hero-brand,
body[data-state="results"] .home-extras { display: none; }
body[data-state="results"] .searchbar { margin: 0 auto; box-shadow: none; }

/* ====================  RESULTADOS  ==================== */
.resultsview {
  position: relative; z-index: 2;
  display: grid; grid-template-columns: 262px 1fr;
  gap: clamp(1.2rem, 3vw, 2.4rem);
  max-width: var(--maxw); margin: 1.4rem auto 4rem;
  padding: 0 clamp(1rem, 4vw, 2.2rem);
  align-items: start;
}

/* facetas */
.facets {
  position: sticky; top: 84px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1rem 1.1rem 1.2rem;
  box-shadow: var(--shadow-sm);
  max-height: calc(100vh - 110px); overflow-y: auto;
}
.facets-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .6rem; }
.facets-head h2 { font-family: var(--serif); font-size: 1.15rem; font-weight: 500; margin: 0; }
.text-btn { background: none; border: 0; color: var(--accent); font-size: .82rem; font-weight: 600; cursor: pointer; padding: .2rem; }
.text-btn:hover { text-decoration: underline; }

.facet-group { border-top: 1px solid var(--line-soft); padding: .75rem 0 .2rem; }
.facet-group:first-child { border-top: 0; }
.facet-group > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between;
  font-size: .73rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
  color: var(--muted); padding: .15rem 0 .5rem; user-select: none;
}
.facet-group > summary::-webkit-details-marker { display: none; }
.facet-group > summary::after { content: "–"; font-size: 1rem; color: var(--muted); }
.facet-group:not([open]) > summary::after { content: "+"; }
.facet-opt {
  display: flex; align-items: center; gap: .55rem;
  font-size: .9rem; color: var(--ink-soft);
  padding: .26rem .35rem; border-radius: 7px; cursor: pointer;
}
.facet-opt:hover { background: var(--surface-2); }
.facet-opt input { accent-color: var(--accent); width: 15px; height: 15px; flex: none; }
.facet-opt .lbl { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.facet-opt .cnt { font-family: var(--mono); font-size: .76rem; color: var(--muted); flex: none; }
.facet-opt.checked { color: var(--ink); font-weight: 600; }
.facet-more { background: none; border: 0; color: var(--accent); font-size: .82rem; font-weight: 600;
  cursor: pointer; padding: .3rem .35rem; }
.facet-more:hover { text-decoration: underline; }

/* toolbar */
.results-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  margin-bottom: .9rem; flex-wrap: wrap;
}
.results-meta { font-size: 1rem; color: var(--ink-soft); }
.results-meta strong { font-size: 1.15rem; color: var(--ink); font-variant-numeric: tabular-nums; }
.timing { font-size: .82rem; color: var(--muted); margin-left: .4rem; }
.sort { font-size: .85rem; color: var(--muted); display: inline-flex; align-items: center; gap: .45rem; font-weight: 600; }
#sortSel {
  font-family: var(--sans); font-size: .88rem; font-weight: 500; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
  padding: .35rem 1.8rem .35rem .6rem; cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23837B6B' stroke-width='2'%3E%3Cpath d='m2 4 4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .55rem center;
}

.active-chips { display: flex; flex-wrap: wrap; gap: .45rem; margin-bottom: 1rem; }
.active-chip {
  display: inline-flex; align-items: center; gap: .4rem;
  font-size: .82rem; font-weight: 600; color: var(--accent-ink);
  background: var(--accent-soft); border-radius: 999px; padding: .25rem .35rem .25rem .7rem;
}
[data-theme="dark"] .active-chip { color: var(--accent); }
.active-chip button { border: 0; background: transparent; color: inherit; cursor: pointer;
  font-size: 1rem; line-height: 1; padding: 0 .15rem; opacity: .7; }
.active-chip button:hover { opacity: 1; }

/* lista de resultados */
.results-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .85rem; }
.result-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.15rem 1.3rem;
  cursor: pointer; transition: border-color .16s, box-shadow .16s, transform .16s;
  position: relative; overflow: hidden;
}
.result-card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--accent); transform: scaleY(0); transform-origin: top; transition: transform .2s;
}
.result-card:hover, .result-card:focus-visible {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  box-shadow: var(--shadow-md); transform: translateY(-2px); outline: none;
}
.result-card:hover::before, .result-card.kbd-active::before { transform: scaleY(1); }
.result-card.kbd-active { border-color: var(--accent); box-shadow: var(--shadow-md); }

.rc-top { display: flex; align-items: center; gap: .55rem; flex-wrap: wrap; margin-bottom: .55rem; }
.badge {
  font-size: .68rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  padding: .18rem .5rem; border-radius: 6px; border: 1px solid transparent;
}
.badge-tipo { background: var(--surface-2); color: var(--ink-soft); border-color: var(--line); }
.badge-res { }
.res-Condenatório, .res-Provido { background: var(--danger-soft); color: var(--danger); }
.res-Absolutório, .res-Negado.provimento { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.res-Parcialmente.procedente, .res-Parcialmente.provido { background: color-mix(in srgb, var(--gold) 18%, transparent); color: var(--gold); }
.res-Proposta.aceita, .res-Resposta.a.consulta { background: var(--accent-soft); color: var(--accent-ink); }
[data-theme="dark"] .res-Proposta.aceita, [data-theme="dark"] .res-Resposta.a.consulta { color: var(--accent); }
.rc-proc { font-family: var(--mono); font-size: .82rem; color: var(--muted); margin-left: auto; }

.rc-kicker { font-size: .76rem; font-weight: 700; letter-spacing: .03em; color: var(--accent);
  text-transform: uppercase; margin-bottom: .3rem; }
[data-theme="dark"] .rc-kicker { color: var(--accent-ink); }
.rc-ementa {
  font-family: var(--serif); font-size: 1.08rem; line-height: 1.45; color: var(--ink);
  margin: 0 0 .55rem;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.rc-snippet { font-size: .9rem; color: var(--ink-soft); margin: 0 0 .7rem;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rc-snippet[data-lazy] { opacity: .6; }
.rc-snippet-loading { font-style: italic; color: var(--muted); }

/* Badge "texto integral" — sinaliza que o item tem texto do PDF indexado */
.badge-pdf {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent-ink); border-color: color-mix(in srgb, var(--accent) 32%, var(--line));
}
[data-theme="dark"] .badge-pdf { color: var(--accent); }
.rc-meta { display: flex; flex-wrap: wrap; gap: .35rem 1.1rem; font-size: .84rem; color: var(--muted); }
.rc-meta b { color: var(--ink-soft); font-weight: 600; }
.rc-meta .dot { color: var(--line); }

mark { background: var(--mark-bg); color: var(--mark-ink); padding: .02em .12em; border-radius: 3px; font-weight: 600; }

/* empty / erro */
.empty-state { text-align: center; padding: 3.5rem 1rem; color: var(--ink-soft); }
.empty-state .big { font-family: var(--serif); font-size: 1.4rem; color: var(--ink); margin-bottom: .5rem; }
.empty-state .chip { margin: .25rem; }

/* ====================  DRAWER  ==================== */
.overlay {
  position: fixed; inset: 0; z-index: 20;
  background: rgba(20,18,14,.42); backdrop-filter: blur(2px);
  opacity: 0; animation: fade .2s forwards;
}
@keyframes fade { to { opacity: 1; } }
.drawer {
  position: fixed; top: 0; right: 0; z-index: 21;
  width: min(620px, 94vw); height: 100%;
  background: var(--surface); box-shadow: var(--shadow-lg);
  transform: translateX(100%); transition: transform .32s cubic-bezier(.22,.61,.36,1);
  overflow-y: auto; border-left: 1px solid var(--line);
}
.drawer.open { transform: translateX(0); }
.drawer-inner { padding: clamp(1.4rem, 4vw, 2.4rem); }
.drawer-close {
  position: sticky; top: 0; float: right; margin: -.4rem -.4rem 0 0;
  width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink-soft); cursor: pointer; font-size: 1.4rem; line-height: 1;
  display: grid; place-items: center; z-index: 2;
}
.drawer-close:hover { color: var(--danger); border-color: var(--danger); }
.d-badges { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.d-proc { font-family: var(--mono); font-size: .9rem; color: var(--muted); margin-bottom: .3rem; }
.d-ementa { font-family: var(--serif); font-size: 1.32rem; line-height: 1.4; margin: 0 0 1.4rem; font-weight: 500; }
.d-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem 1.4rem; margin-bottom: 1.6rem;
  border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); padding: 1.2rem 0; }
.d-field .k { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; margin-bottom: .15rem; }
.d-field .v { font-size: .98rem; color: var(--ink); }
.d-section-title { font-family: var(--serif); font-size: 1.1rem; margin: 0 0 .6rem; font-weight: 600; }
.d-teor { font-size: .98rem; line-height: 1.7; color: var(--ink-soft); margin-bottom: 1.6rem; }

/* Trechos do PDF no drawer: blocos compactos com marca lateral discreta */
.d-pdf-excerpts { margin-bottom: 1.6rem; }
.d-pdf-excerpt {
  position: relative; padding: .6rem .9rem; margin: 0 0 .6rem;
  background: var(--surface-2); border-left: 3px solid color-mix(in srgb, var(--accent) 50%, var(--line));
  border-radius: 0 6px 6px 0; font-size: .94rem; line-height: 1.65;
}
.d-pdf-excerpt:last-child { margin-bottom: 0; }
.d-pdf-loading { font-style: italic; color: var(--muted); margin-bottom: 1.6rem; }
.d-pdf-empty   { font-size: .9rem; color: var(--muted); margin-bottom: 1.6rem; }
.d-tags { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1.6rem; }
.d-tag { font-size: .82rem; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-soft);
  border-radius: 999px; padding: .25rem .7rem; cursor: pointer; }
.d-tag:hover { border-color: var(--accent); color: var(--accent); }
.d-tag-static { cursor: default; font-family: var(--mono); font-size: .78rem;
  background: var(--surface); padding: .25rem .65rem; }
.d-tag-static:hover { border-color: var(--line); color: var(--ink-soft); }
.d-list { list-style: none; padding: 0; margin: 0 0 1.6rem;
  border: 1px solid var(--line-soft); border-radius: 10px; background: var(--surface-2); overflow: hidden; }
.d-list li { padding: .55rem .9rem; font-size: .92rem; color: var(--ink);
  border-top: 1px solid var(--line-soft); }
.d-list li:first-child { border-top: 0; }
.d-actions { display: flex; flex-wrap: wrap; gap: .7rem; }
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--sans); font-size: .9rem; font-weight: 600;
  padding: .6rem 1.1rem; border-radius: 10px; cursor: pointer; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); transition: .16s;
}
.btn:hover { border-color: var(--accent); }
.btn-primary { background: var(--accent); color: #F3EFE6; border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-ink); text-decoration: none; }
.copy-note { font-size: .82rem; color: var(--ok); align-self: center; }

/* ====================  RESPONSIVO  ==================== */
.filters-toggle {
  display: none; align-items: center; gap: .5rem;
  font-family: var(--sans); font-weight: 600; font-size: .9rem; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  padding: .55rem .9rem; cursor: pointer; margin: 0 clamp(1rem,4vw,2.2rem) .8rem;
}
.active-count { background: var(--accent); color: #fff; border-radius: 999px; font-size: .72rem;
  padding: .05rem .45rem; font-family: var(--mono); }

@media (max-width: 860px) {
  .resultsview { grid-template-columns: 1fr; }
  .filters-toggle { display: inline-flex; }
  .facets {
    position: fixed; inset: 0 0 0 auto; top: 0; z-index: 22;
    width: min(330px, 86vw); max-height: none; height: 100%;
    border-radius: 0; transform: translateX(100%); transition: transform .3s;
    box-shadow: var(--shadow-lg);
  }
  body.facets-open .facets { transform: translateX(0); }
  body.facets-open::after { content: ""; position: fixed; inset: 0; z-index: 21; background: rgba(0,0,0,.4); }
}
@media (max-width: 520px) {
  .hero-title { font-size: 2rem; }
  .d-grid { grid-template-columns: 1fr; }
  .rc-proc { margin-left: 0; width: 100%; }
  .ghost-link { display: none; }
}

/* ====================  RODAPÉ  ==================== */
.site-footer { position: relative; z-index: 2; border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 60%, var(--paper)); margin-top: 3rem; }
.footer-inner { max-width: var(--maxw); margin: 0 auto; padding: 2.4rem clamp(1rem,4vw,2.2rem);
  display: grid; grid-template-columns: 1.6fr 1fr; gap: 2.5rem; }
.site-footer h3 { font-family: var(--serif); font-size: 1.3rem; font-weight: 500; margin: 0 0 .6rem; }
.site-footer h4 { font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 0 0 .8rem; }
.site-footer p { color: var(--ink-soft); font-size: .94rem; max-width: 52ch; margin: 0 0 .8rem; }
.muted-note { font-size: .82rem !important; color: var(--muted) !important; }
.footer-tips ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.footer-tips li { font-size: .9rem; color: var(--ink-soft); }
.footer-tips code { font-family: var(--mono); font-size: .85em; background: var(--surface-2);
  padding: .1rem .4rem; border-radius: 5px; color: var(--accent-ink); }
[data-theme="dark"] .footer-tips code { color: var(--accent); }
@media (max-width: 680px) { .footer-inner { grid-template-columns: 1fr; gap: 1.6rem; } }

/* busca na web — estado vazio + rodapé de resultados */
.web-search-tip {
  margin-top: 2rem;
  padding: 1.2rem 1.4rem;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  text-align: left;
}
.web-search-tip p { margin: 0 0 .9rem; font-size: .92rem; color: var(--ink-soft); }
.web-search-btns { display: flex; flex-wrap: wrap; gap: .6rem; }
.btn-web {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .45rem .9rem; border-radius: var(--radius-sm);
  font-size: .88rem; font-weight: 500;
  background: var(--surface); border: 1px solid var(--line);
  color: var(--accent-ink); text-decoration: none;
  transition: background .15s, border-color .15s;
}
.btn-web:hover { background: var(--accent-soft); border-color: var(--accent); }
[data-theme="dark"] .btn-web { background: var(--surface-2); color: var(--accent); }

.results-web-footer {
  list-style: none;
  padding: 1rem 0 .4rem;
  font-size: .84rem;
  color: var(--muted);
  border-top: 1px solid var(--line-soft);
  margin-top: .6rem;
  display: flex; flex-wrap: wrap; align-items: center; gap: .4rem;
}
.web-footer-label { color: var(--muted); }
.results-web-footer a { color: var(--accent); text-decoration: none; }
.results-web-footer a:hover { text-decoration: underline; }

/* nota de fallback OR */
.or-fallback-note {
  display: flex;
  align-items: flex-start;
  gap: .45rem;
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
  border-radius: 6px;
  padding: .6rem .9rem;
  font-size: .87rem;
  color: var(--ink-soft);
  margin-bottom: .75rem;
  line-height: 1.5;
}
.or-fallback-note svg { flex-shrink: 0; margin-top: 1px; color: var(--accent); }
.or-fallback-note code { font-size: .82rem; background: color-mix(in srgb, var(--accent) 12%, transparent); padding: .1em .35em; border-radius: 3px; }

/* utilidades */
[hidden] { display: none !important; }
.skeleton { animation: pulse 1.2s ease-in-out infinite; background: var(--surface-2); border-radius: 8px; }
@keyframes pulse { 0%,100%{opacity:.5} 50%{opacity:1} }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
