/* =========================================================
   SACRO — estilos
   Paleta: azul marino #101D35 · dorado plano #C5A568 · marfil #F4F0E7
   Sin degradados ni sombras metálicas (diseño plano).
   ========================================================= */

:root {
  --navy: #101D35;
  --gold: #C5A568;
  --ivory: #F4F0E7;

  --font-ui: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-serif: "Lora", Georgia, "Times New Roman", serif;

  --radius: 14px;
  --radius-sm: 10px;
  --sidebar-w: 280px;
  --topbar-h: 60px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* ---- Tema oscuro (por defecto) ---- */
:root, [data-theme="dark"] {
  --bg: #0A1226;
  --surface: #101D35;
  --surface-2: #162748;
  --surface-3: #1D3158;
  --border: rgba(197, 165, 104, .22);
  --border-strong: rgba(197, 165, 104, .55);
  --text: #F4F0E7;
  --muted: #A9B2C6;
  --accent: #C5A568;
  --accent-text: #101D35;
  --accent-ink: #D8BE8A;
  --ok: #7DCB9B;
  --warn: #E6B85C;
  --bad: #E58A82;
  --ok-bg: rgba(125, 203, 155, .12);
  --warn-bg: rgba(230, 184, 92, .12);
  --bad-bg: rgba(229, 138, 130, .12);
  --focus: #E3CB98;
}

/* ---- Tema claro (estilo crema del boceto) ---- */
[data-theme="light"] {
  --bg: #F4F0E7;
  --surface: #FBF9F4;
  --surface-2: #EFE9DB;
  --surface-3: #E6DEC9;
  --border: rgba(16, 29, 53, .16);
  --border-strong: rgba(16, 29, 53, .4);
  --text: #101D35;
  --muted: #55617A;
  --accent: #101D35;
  --accent-text: #F4F0E7;
  --accent-ink: #8A6D31;
  --ok: #1F7A48;
  --warn: #8A5A00;
  --bad: #A8372E;
  --ok-bg: rgba(31, 122, 72, .09);
  --warn-bg: rgba(138, 90, 0, .09);
  --bad-bg: rgba(168, 55, 46, .09);
  --focus: #8A6D31;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-weight: 600; }
p { margin: 0 0 .75em; }
a { color: var(--accent-ink); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }

.ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ic-lg { width: 34px; height: 34px; }
.muted { color: var(--muted); }
.only-mobile { display: none !important; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 22px;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  font-weight: 600; font-size: .95rem; cursor: pointer;
  transition: transform .15s var(--ease), background-color .15s, border-color .15s, opacity .15s;
}
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .55; cursor: progress; }
.btn-block { width: 100%; }
.btn-gold { background: var(--gold); color: var(--navy); }
.btn-gold:hover { background: #D3B77F; }
[data-theme="light"] .btn-gold { background: var(--navy); color: var(--ivory); }
[data-theme="light"] .btn-gold:hover { background: #1B2D52; }
.btn-outline { background: transparent; border-color: var(--border-strong); color: var(--text); }
.btn-outline:hover { background: var(--surface-2); }

.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px;
  background: transparent; border: 0; border-radius: 10px; color: var(--muted); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }

/* ---------- Formularios ---------- */
.field { margin: 0 0 18px; padding: 0; border: 0; min-width: 0; }
.field > label, .field > .label, legend, label.sub {
  display: block; margin-bottom: 6px; font-size: .85rem; font-weight: 600; letter-spacing: .02em; color: var(--text);
}
legend { padding: 0; }
input:not([type="radio"]):not([type="checkbox"]), select, textarea {
  width: 100%; min-height: 46px; padding: 10px 14px;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm);
  transition: border-color .15s;
}
[data-theme="light"] input:not([type="radio"]):not([type="checkbox"]), [data-theme="light"] select, [data-theme="light"] textarea { background: #fff; }
textarea { resize: vertical; min-height: 180px; line-height: 1.6; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .75; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(197,165,104,.25); }
input:disabled { opacity: .6; }
.input-icon { position: relative; }
.input-icon input { padding-right: 48px; }
.input-icon .icon-btn { position: absolute; right: 3px; top: 3px; }
.hint { display: block; margin: 4px 0 10px; font-size: .82rem; color: var(--muted); }
.link-small { display: inline-block; margin-top: 8px; font-size: .85rem; }
.form-error {
  margin: 0 0 14px; padding: 10px 14px; border-radius: var(--radius-sm);
  background: var(--bad-bg); border: 1px solid var(--bad); color: var(--bad); font-size: .9rem;
}
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 18px; font-size: .9rem; color: var(--muted); }
.check input { margin-top: 4px; accent-color: var(--gold); width: 18px; height: 18px; flex: none; }
.switch { margin: 16px 0 0; text-align: center; font-size: .9rem; color: var(--muted); }

/* Selector de nivel */
.level-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.level-card { display: block; cursor: pointer; }
.level-card input { position: absolute; opacity: 0; pointer-events: none; }
.level-body {
  display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%;
  padding: 16px 12px; text-align: center;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg);
  transition: border-color .15s, background-color .15s;
}
[data-theme="light"] .level-body { background: #fff; }
.level-body .ic { width: 26px; height: 26px; color: var(--accent-ink); margin-bottom: 4px; }
.level-body small { color: var(--muted); font-size: .78rem; line-height: 1.35; }
.level-card:hover .level-body { border-color: var(--border-strong); }
.level-card input:checked + .level-body { border-color: var(--gold); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--gold); }
.level-card input:focus-visible + .level-body { outline: 2px solid var(--focus); outline-offset: 2px; }

/* Sistema de seguridad */
.security { padding: 16px; border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); }
.security legend { padding: 0 8px; }
.answer-row { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.answer-row .ic { width: 28px; height: 28px; padding: 5px; border-radius: 50%; color: #fff; }
.answer-row.ok .ic { background: #2E8B57; }
.answer-row.bad .ic { background: #B8453B; }

/* Opciones de recuperación */
.rec-question { font-family: var(--font-serif); font-size: 1.1rem; margin: 6px 0 14px; }
.rec-options { display: grid; gap: 10px; margin-bottom: 16px; }
.rec-options label { display: block; cursor: pointer; }
.rec-options input { position: absolute; opacity: 0; }
.rec-options span {
  display: block; padding: 12px 16px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg);
}
[data-theme="light"] .rec-options span { background: #fff; }
.rec-options input:checked + span { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); background: var(--surface-2); }
.rec-options input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }

/* Segmentado Estudio / Prédica */
.segmented { display: inline-flex; padding: 4px; gap: 4px; background: var(--bg); border: 1px solid var(--border); border-radius: 12px; max-width: 100%; }
[data-theme="light"] .segmented { background: var(--surface-2); }
.segmented label { cursor: pointer; }
.segmented input { position: absolute; opacity: 0; }
.segmented span { display: inline-flex; align-items: center; gap: 8px; padding: 9px 18px; border-radius: 9px; font-weight: 600; font-size: .92rem; color: var(--muted); transition: background-color .15s, color .15s; }
.segmented input:checked + span { background: var(--gold); color: var(--navy); }
[data-theme="light"] .segmented input:checked + span { background: var(--navy); color: var(--ivory); }
.segmented input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ---------- Tarjetas ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.card.pad { padding: 24px; }
.card-band { padding: 16px 24px; background: var(--navy); border-bottom: 2px solid var(--gold); border-radius: var(--radius) var(--radius) 0 0; }
.card-band h2 { font-size: 1.15rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ivory); text-align: center; }
.card-body { padding: 24px; }

/* ---------- Autenticación ---------- */
.auth {
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px;
  padding: 32px 16px calc(32px + env(safe-area-inset-bottom));
}
.auth-brand { text-align: center; }
.wordmark { margin-top: 6px; font-family: var(--font-serif); font-size: 2.2rem; letter-spacing: .28em; text-indent: .28em; color: var(--accent-ink); font-weight: 600; }
.tagline { margin: 2px 0 0; font-size: .78rem; letter-spacing: .3em; text-transform: uppercase; color: var(--muted); }
.auth-card { width: 100%; max-width: 440px; }
.auth-card-wide { max-width: 640px; }

/* ---------- Layout app ---------- */
.app { min-height: 100vh; min-height: 100dvh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); z-index: 40;
  display: flex; flex-direction: column;
  background: var(--navy); color: var(--ivory); border-right: 1px solid var(--border);
}
.sidebar-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 18px 10px; }
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--gold); }
.logo-text { font-family: var(--font-serif); font-weight: 600; font-size: 1.3rem; letter-spacing: .22em; }
.sidebar .icon-btn { color: var(--ivory); }
.sidebar .icon-btn:hover { background: rgba(244,240,231,.08); }

.nav { flex: 1; overflow-y: auto; padding: 8px 12px; display: flex; flex-direction: column; gap: 2px; }
.nav-label { margin: 18px 12px 6px; font-size: .7rem; letter-spacing: .16em; text-transform: uppercase; color: rgba(244,240,231,.5); }
.nav a {
  display: flex; align-items: center; gap: 14px; padding: 11px 12px; border-radius: 10px;
  color: rgba(244,240,231,.82); text-decoration: none; font-weight: 500; font-size: .95rem; position: relative;
  transition: background-color .15s, color .15s;
}
.nav a small { display: block; font-weight: 400; font-size: .76rem; color: rgba(244,240,231,.55); }
.nav a:hover { background: rgba(244,240,231,.07); color: var(--ivory); }
.nav a.active { background: rgba(197,165,104,.14); color: var(--gold); }
.nav a.active small { color: rgba(197,165,104,.8); }
.nav a.active::before { content: ""; position: absolute; left: -12px; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--gold); }

.sidebar-foot { padding: 14px 18px calc(16px + env(safe-area-inset-bottom)); border-top: 1px solid rgba(197,165,104,.2); }
.sidebar-foot .btn-outline { color: var(--ivory); border-color: rgba(197,165,104,.5); min-height: 40px; font-size: .88rem; }
.sidebar-foot .btn-outline:hover { background: rgba(244,240,231,.08); }
.foot-links { list-style: none; margin: 12px 0 6px; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.foot-links a { display: block; padding: 4px 2px; font-size: .82rem; color: rgba(244,240,231,.65); text-decoration: none; }
.foot-links a:hover { color: var(--gold); }
.foot-btn { display: flex; align-items: center; gap: 8px; padding: 6px 2px; background: none; border: 0; cursor: pointer; font-size: .82rem; color: rgba(244,240,231,.65); }
.foot-btn:hover { color: var(--gold); }
.foot-btn .ic { width: 16px; height: 16px; }

.main-col { margin-left: var(--sidebar-w); min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; height: var(--topbar-h);
  display: flex; align-items: center; gap: 12px; padding: 0 28px;
  background: var(--bg); border-bottom: 1px solid var(--border);
}
.topbar-title { font-weight: 600; flex: 1; }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.badge { padding: 4px 12px; border-radius: 99px; font-size: .78rem; font-weight: 600; letter-spacing: .04em; border: 1px solid var(--border-strong); color: var(--accent-ink); text-transform: capitalize; }
.content { flex: 1; width: 100%; max-width: 1040px; margin: 0 auto; padding: 32px 28px 64px; outline: none; }
.page-head { margin-bottom: 22px; }
.page-head h1 { font-size: 1.6rem; font-family: var(--font-serif); }
.page-head p { margin-top: 6px; }
.scrim { position: fixed; inset: 0; z-index: 35; background: rgba(5, 10, 22, .6); }

/* ---------- Inicio ---------- */
.welcome { display: flex; align-items: center; gap: 20px; padding: 24px; margin-bottom: 24px; }
.welcome h1 { font-size: 1.5rem; font-family: var(--font-serif); }
.welcome p { margin: 4px 0 0; }
.avatar { width: 64px; height: 64px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--gold); color: var(--navy); font-weight: 700; font-size: 1.5rem; }
.tool-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.tool-card {
  position: relative; display: block; padding: 24px; text-decoration: none; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  transition: border-color .18s, transform .18s var(--ease), background-color .18s;
}
.tool-card:hover { border-color: var(--gold); transform: translateY(-3px); background: var(--surface-2); }
.tool-ic { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 16px; border-radius: 12px; background: var(--surface-3); color: var(--accent-ink); }
.tool-ic .ic { width: 24px; height: 24px; }
.tool-tag { position: absolute; top: 20px; right: 20px; font-size: .72rem; font-weight: 700; letter-spacing: .12em; color: var(--accent-ink); }
.tool-card h3 { font-size: 1.08rem; margin-bottom: 8px; }
.tool-card p { margin: 0; font-size: .9rem; color: var(--muted); }

/* ---------- Resultados ---------- */
.results { margin-top: 24px; display: grid; gap: 16px; }
.res-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.res-card { padding: 22px 24px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); border-top: 3px solid var(--gold); animation: rise .35s var(--ease) both; }
.res-card.full { grid-column: 1 / -1; }
.res-card h3 { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: var(--accent-ink); }
.res-card p { font-size: .98rem; line-height: 1.7; }
.res-card p:last-child { margin-bottom: 0; }
.res-card ul { margin: 0; padding-left: 1.1em; }
.res-card li { margin-bottom: 6px; }
.verse { font-family: var(--font-serif); }
.sources { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; font-size: .86rem; color: var(--muted); }
.sources li { padding-left: 14px; position: relative; margin: 0; }
.sources li::before { content: ""; position: absolute; left: 0; top: .62em; width: 5px; height: 5px; border-radius: 50%; background: var(--gold); }
.meta-line { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0; font-size: .85rem; color: var(--muted); }
.pill { display: inline-block; padding: 3px 12px; border-radius: 99px; font-size: .76rem; font-weight: 600; letter-spacing: .04em; border: 1px solid var(--border-strong); color: var(--accent-ink); }
.pill.ok { color: var(--ok); border-color: var(--ok); background: var(--ok-bg); }
.pill.warn { color: var(--warn); border-color: var(--warn); background: var(--warn-bg); }
.pill.bad { color: var(--bad); border-color: var(--bad); background: var(--bad-bg); }

.passage { padding: 14px 0; border-top: 1px solid var(--border); }
.passage:first-of-type { border-top: 0; padding-top: 0; }
.passage h4 { font-family: var(--font-serif); font-size: 1.1rem; color: var(--accent-ink); margin-bottom: 6px; }
.passage .quote { font-family: var(--font-serif); font-style: italic; margin-bottom: 8px; }
.passage .lbl { display: block; font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-top: 8px; }

.finding { padding: 14px 16px; margin-bottom: 10px; border-radius: var(--radius-sm); border: 1px solid var(--border); border-left-width: 4px; background: var(--bg); }
[data-theme="light"] .finding { background: #fff; }
.finding:last-child { margin-bottom: 0; }
.finding.ok { border-left-color: var(--ok); }
.finding.warn { border-left-color: var(--warn); }
.finding.bad { border-left-color: var(--bad); }
.finding header { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.finding strong { font-family: var(--font-serif); }
.finding p { margin: 0 0 6px; font-size: .94rem; }
.finding p:last-child { margin: 0; }

.result-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
.result-actions .btn { min-height: 38px; font-size: .85rem; padding: 0 16px; }

.empty, .loading-card { padding: 28px; text-align: center; color: var(--muted); border: 1px dashed var(--border-strong); border-radius: var(--radius); }
.loading-card { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--border); border-top-color: var(--gold); animation: spin .8s linear infinite; }
.skeleton { display: grid; gap: 16px; }
.skeleton .res-card { height: 120px; opacity: .5; animation: pulse 1.2s ease-in-out infinite; }

/* Dropzone */
.dropzone {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 26px 16px; margin-bottom: 18px; text-align: center; cursor: pointer;
  border: 2px dashed var(--border-strong); border-radius: var(--radius); background: var(--bg); color: var(--accent-ink);
  transition: border-color .15s, background-color .15s;
}
.dropzone strong { color: var(--text); }
.dropzone small { color: var(--muted); }
.dropzone:hover, .dropzone.drag { border-color: var(--gold); background: var(--surface-2); }

/* ---------- Historial ---------- */
.filter-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.chip { padding: 7px 16px; border-radius: 99px; background: transparent; border: 1px solid var(--border); color: var(--muted); cursor: pointer; font-size: .85rem; font-weight: 500; }
.chip:hover { border-color: var(--border-strong); color: var(--text); }
.chip.active { background: var(--gold); border-color: var(--gold); color: var(--navy); font-weight: 600; }
[data-theme="light"] .chip.active { background: var(--navy); border-color: var(--navy); color: var(--ivory); }
.hist-list { display: grid; gap: 10px; }
.hist-item { display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.hist-item:hover { border-color: var(--border-strong); }
.hist-open { flex: 1; min-width: 0; text-align: left; background: none; border: 0; cursor: pointer; padding: 0; }
.hist-open strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist-open span { font-size: .8rem; color: var(--muted); }

/* ---------- Modal & toast ---------- */
.modal { width: min(620px, calc(100% - 32px)); max-height: 82vh; padding: 0; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); color: var(--text); }
.modal::backdrop { background: rgba(5,10,22,.7); }
.modal[open] { display: flex; flex-direction: column; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 14px 14px 24px; background: var(--navy); border-bottom: 2px solid var(--gold); color: var(--ivory); }
.modal-head h2 { font-size: 1.05rem; letter-spacing: .08em; }
.modal-head .icon-btn { color: var(--ivory); }
.modal-body { padding: 22px 24px 26px; overflow-y: auto; }
.modal-body h3 { font-size: 1rem; margin: 18px 0 6px; color: var(--accent-ink); }
.modal-body h3:first-child { margin-top: 0; }
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 100; max-width: calc(100% - 32px); padding: 12px 20px; border-radius: 99px; background: var(--gold); color: var(--navy); font-weight: 600; font-size: .9rem; animation: rise .25s var(--ease) both; }
.toast.error { background: var(--bad); color: #fff; }

/* ---------- Animaciones ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .tool-grid { grid-template-columns: 1fr; }
  .res-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .only-mobile { display: inline-grid !important; }
  .sidebar { transform: translateX(-100%); transition: transform .25s var(--ease); width: min(300px, 86vw); }
  .sidebar.open { transform: none; }
  .main-col { margin-left: 0; }
  .topbar { padding: 0 12px; padding-top: env(safe-area-inset-top); height: calc(var(--topbar-h) + env(safe-area-inset-top)); }
  .content { padding: 22px 16px 48px; }
}
@media (max-width: 600px) {
  .grid-2 { grid-template-columns: 1fr; }
  .level-grid { grid-template-columns: 1fr; }
  .level-body { flex-direction: row; text-align: left; gap: 12px; padding: 12px 14px; flex-wrap: wrap; }
  .level-body small { flex-basis: 100%; padding-left: 38px; margin-top: -8px; }
  .card.pad, .card-body { padding: 18px; }
  .welcome { flex-direction: column; align-items: flex-start; }
  .segmented { display: flex; width: 100%; }
  .segmented label { flex: 1; }
  .segmented span { justify-content: center; padding: 10px 8px; width: 100%; }
  .btn:not(.btn-block) { width: 100%; }
  .result-actions .btn { width: auto; }
  .badge { display: none; }
}

/* ---------- Impresión / guardar PDF ---------- */
@media print {
  .sidebar, .topbar, .scrim, .page-head p, form, .result-actions, .toast, .filter-row, .hist-list { display: none !important; }
  .main-col { margin: 0; }
  body { background: #fff; color: #000; }
  .content { max-width: none; padding: 0; }
  .res-card { break-inside: avoid; background: #fff; color: #000; border-color: #999; }
  .res-card h3, .passage h4 { color: #6b5420; }
  .muted, .sources { color: #333; }
}
