/* Artiquery — capa visual profesional (se carga después de app.css y la refina).
   Principios: mucho aire, jerarquía tipográfica clara, una sola acción principal por vista,
   color con significado (verde azulado = producto, violeta = IA, verde/rojo = dirección de resultados). */

body { font-size: 15.5px; line-height: 1.6; letter-spacing: -.003em; font-feature-settings: "cv11", "ss01", "ss03"; }
h1, .hero-title, .work-title, .page-head h1, .ai-headline { font-family: var(--font-serif); font-weight: 400; letter-spacing: -.015em; }
h2, h3 { letter-spacing: -.01em; font-weight: 650; }
::selection { background: color-mix(in srgb, var(--accent) 22%, transparent); }
a { text-underline-offset: 3px; }
input, select, textarea { border-radius: 10px; border-color: var(--line-strong); transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px var(--accent-soft); }

/* ── Navegación ─────────────────────────────────────────────────────────── */
.topbar { background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(160%) blur(14px); border-bottom-color: color-mix(in srgb, var(--line) 70%, transparent); min-height: 60px; }
.brand strong { font-family: var(--font-serif); font-weight: 400; font-size: 1.32rem; letter-spacing: -.01em; }
.brand small { letter-spacing: .02em; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; background:
  radial-gradient(circle at 32% 36%, #fff 0 2.6px, transparent 3px), radial-gradient(circle at 70% 30%, #fff 0 2px, transparent 2.4px), radial-gradient(circle at 54% 70%, #fff 0 3px, transparent 3.4px),
  linear-gradient(135deg, #117d86 0%, #0d5c63 45%, #4a3db0 100%); box-shadow: 0 4px 12px rgba(13, 92, 99, .25); }
.topsearch { border-radius: 12px; background: var(--surface); border-color: var(--line); box-shadow: var(--shadow-1); }
.demo-pill { border-radius: 8px; font-size: .68rem; letter-spacing: .06em; padding: 4px 9px; }
.mode-pill { background: var(--accent-soft); color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent); }
.mode-pill::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--fav); margin-right: 6px; vertical-align: 1px; box-shadow: 0 0 0 3px var(--fav-soft); }
@media (min-width: 900px) {
  .sidebar { background: linear-gradient(180deg, var(--surface) 0%, color-mix(in srgb, var(--surface) 92%, var(--accent-soft)) 100%); border-right-color: var(--line); padding: 20px 14px; }
  .side-link { padding: 9px 11px; border-radius: 10px; font-weight: 500; transition: background .15s, color .15s; }
  .side-link .ico { opacity: .75; }
  .side-link.is-active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1), inset 0 0 0 1px var(--line); }
  .side-link.is-active .ico { color: var(--accent); opacity: 1; }
  .side-group-title { font-size: .68rem; font-weight: 650; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); padding: 0 11px; margin: 4px 0 6px; }
  .side-more summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 8px 11px; border-radius: 10px; color: var(--muted); font-size: .86rem; }
  .side-more summary::-webkit-details-marker { display: none; }
  .side-more summary:hover { background: var(--surface-2); }
  .side-more[open] summary { color: var(--ink-2); }
  .side-sep { background: transparent; margin: 10px 0; }
  .plan-chip { background: var(--surface); border-radius: 12px; padding: 12px; box-shadow: var(--shadow-1); display: flex; flex-direction: column; gap: 2px; }
  .plan-chip small { color: var(--muted); font-size: .74rem; }
  .plan-chip.is-free strong::after { content: " · Mejorar"; color: var(--ai); font-weight: 600; }
}
.tabbar { background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(14px); }

/* ── Superficies ────────────────────────────────────────────────────────── */
.panel, .wcard, .tcard, .gcard { border-radius: var(--radius); border-color: var(--line); box-shadow: var(--shadow-1); }
.wcard, .gcard { transition: box-shadow .18s, transform .18s, border-color .18s; }
.wcard:hover, .gcard:hover { box-shadow: var(--shadow-hover); border-color: var(--line-strong); }
.panel { padding: 20px; }
.page-head h1 { font-size: 2.1rem; }
@media (min-width: 900px) { .page-head h1 { font-size: 2.6rem; } }
.page-sub { font-size: 1.02rem; color: var(--muted); }

/* ── Botones, chips, badges ─────────────────────────────────────────────── */
.btn { border-radius: 10px; font-weight: 600; letter-spacing: -.005em; transition: background .15s, box-shadow .15s, transform .05s; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn-primary { background: linear-gradient(180deg, var(--accent-2), var(--accent)); box-shadow: 0 1px 2px rgba(13, 92, 99, .3), inset 0 1px 0 rgba(255, 255, 255, .12); }
.btn-primary:hover:not(:disabled) { background: var(--accent); box-shadow: 0 4px 14px rgba(13, 92, 99, .28); }
.btn-ghost { border-color: var(--line); box-shadow: var(--shadow-1); }
.btn-pro { background: linear-gradient(135deg, var(--ai), #7b5fe0); color: #fff; box-shadow: 0 4px 14px rgba(90, 73, 198, .3); }
.chip { border-radius: 7px; padding: 2px 8px; }
.chip-ok { background: var(--fav-soft); color: var(--fav); border-color: transparent; font-weight: 600; }
.badge { border-radius: 6px; padding: 2px 8px; letter-spacing: .05em; }
.example { border-radius: 10px; border-color: var(--line); background: var(--surface); box-shadow: var(--shadow-1); transition: border-color .15s, color .15s, transform .15s; }
.example:hover { transform: translateY(-1px); }

/* ── Pestañas ───────────────────────────────────────────────────────────── */
.tabs { gap: 2px; border-bottom: 1px solid var(--line); }
.tab { border-radius: 9px 9px 0 0; font-weight: 550; color: var(--muted); }
.tab.is-active { color: var(--ink); box-shadow: inset 0 -2px 0 var(--accent); }
.tab-count { background: var(--surface-2); border-radius: 6px; }

/* ── Inicio ─────────────────────────────────────────────────────────────── */
.hero { position: relative; padding-top: 28px; }
.hero::before { content: ""; position: absolute; inset: -160px -30vw auto; height: 560px; background: var(--hero-glow); z-index: -1; pointer-events: none; }
.hero-title { font-size: clamp(2.3rem, 7vw, 4rem); line-height: 1.04; margin: 6px 0 22px; }
.hero-title em { font-style: italic; color: var(--accent); }
.bigsearch { border-radius: 20px; border-color: var(--line); padding: 16px 16px 12px; box-shadow: var(--shadow-2); }
.bigsearch textarea { font-family: var(--font-sans); font-size: 1.12rem; letter-spacing: -.01em; }
.bigsearch:focus-within { box-shadow: var(--shadow-2), 0 0 0 4px var(--accent-soft); }

/* ── Capa de IA (siempre violeta: se distingue de la fuente de un vistazo) ─ */
.layer-summary, .layer-inference { color: var(--ai); border-color: var(--ai); }
.ai-note { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: .86rem; color: var(--ink-2); background: var(--ai-soft); border: 1px solid var(--ai-line); border-radius: 12px; padding: 10px 14px; margin-bottom: 16px; }
.ai-loading { display: flex; gap: 14px; align-items: flex-start; background: var(--ai-soft); border: 1px solid var(--ai-line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px; }
.ai-loading .spinner { border-top-color: var(--ai); }
.ai-synthesis { background: linear-gradient(180deg, var(--ai-soft), var(--surface) 140px); border: 1px solid var(--ai-line); border-radius: var(--radius); padding: 24px 26px; margin-bottom: 22px; box-shadow: var(--shadow-1); }
.ai-synthesis .eyebrow { color: var(--ai); }
.ai-headline { font-size: 1.75rem; line-height: 1.2; margin: 4px 0 16px; }
.ai-par { font-size: 1.02rem; line-height: 1.75; max-width: 76ch; }
.ai-synthesis .cite { border-color: var(--ai-line); background: var(--surface); color: var(--ai); margin: 0 1px; }
.ai-synthesis .cite:hover { background: var(--ai); color: #fff; }

.results-grid { display: grid; gap: 12px; margin: 8px 0 18px; }
@media (min-width: 760px) { .results-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.result-card { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 16px 14px 20px; box-shadow: var(--shadow-1); overflow: hidden; }
.result-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--neu); }
.result-card.dir-favorece_intervencion::before { background: var(--fav); }
.result-card.dir-favorece_comparador::before { background: var(--unf); }
.result-card.dir-sin_diferencia::before { background: var(--neu); }
.result-outcome { font-weight: 650; margin-bottom: 4px; }
.result-figure { font-size: 1.15rem; font-variant-numeric: tabular-nums; margin-bottom: 8px; }
.dir-pill { display: inline-block; font-size: .72rem; font-weight: 650; padding: 2px 9px; border-radius: 7px; background: var(--surface-2); color: var(--ink-2); }
.dir-favorece_intervencion .dir-pill { background: var(--fav-soft); color: var(--fav); }
.dir-favorece_comparador .dir-pill { background: var(--unf-soft); color: var(--unf); }
.source-quote { margin: 10px 0 0; padding: 8px 12px; border-left: 2px solid var(--line-strong); color: var(--muted); font-size: .84rem; font-style: italic; background: var(--surface-2); border-radius: 0 8px 8px 0; }
.explain-grid { display: grid; gap: 12px; }
@media (min-width: 760px) { .explain-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.explain-block { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow-1); }
.explain-block h3 { font-size: .98rem; color: var(--ai); }
.summary .sum-row { border-color: var(--line); }
.summary dt { font-size: .74rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 650; }
.rel-why { list-style: none; margin: -4px 0 10px; padding-left: 2px; }

/* ── Ficha de estudio ───────────────────────────────────────────────────── */
.work-title { font-size: clamp(1.7rem, 4vw, 2.5rem); line-height: 1.12; }
.work-title-tr { color: var(--muted); font-size: 1.02rem; }
.abstract p { line-height: 1.75; max-width: 78ch; }

/* ── Planes ─────────────────────────────────────────────────────────────── */
.plan-card.is-recommended, .plan.is-recommended { border-color: var(--ai) !important; box-shadow: 0 10px 40px rgba(90, 73, 198, .18) !important; }
.locked-teaser { background: linear-gradient(135deg, var(--ai-soft), var(--surface)); border: 1px solid var(--ai-line); border-radius: var(--radius); padding: 22px; }
.locked-teaser h3 { color: var(--ai); }
.meter { border-radius: 10px; }

/* ── Movimiento: respetar a quien lo reduce ─────────────────────────────── */
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
.main-col { overflow-x: clip; }
.banner-soft { background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--line-strong); color: var(--muted); font-size: .84rem; padding: 8px 12px; }

/* ── Página de planes ───────────────────────────────────────────────────── */
.plans-hero { text-align: center; max-width: 760px; margin: 10px auto 26px; position: relative; }
.plans-hero::before { content: ""; position: absolute; inset: -140px -30vw auto; height: 480px; background: var(--hero-glow); z-index: -1; pointer-events: none; }
.plans-hero h1 { font-size: clamp(2.2rem, 6vw, 3.6rem); line-height: 1.05; margin: 6px 0 14px; }
.plans-hero h1 em { color: var(--accent); }
.billing-toggle { display: inline-flex; gap: 4px; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-1); margin-top: 10px; }
.billing-toggle button { border: 0; background: transparent; padding: 7px 14px; border-radius: 9px; cursor: pointer; font-weight: 600; color: var(--muted); }
.billing-toggle button.is-on { background: var(--ink); color: var(--surface); }
.billing-toggle .save { font-size: .7rem; color: var(--fav); margin-left: 4px; }
.billing-toggle button.is-on .save { color: var(--accent-2); }
.plan-grid-lg { gap: 16px; align-items: stretch; }
.plan-card { position: relative; padding: 24px 22px; gap: 8px; border-radius: 18px; box-shadow: var(--shadow-1); }
.plan-card h3 { font-size: 1.15rem; margin: 0; }
.plan-card.is-current { background: var(--surface); outline: 2px solid var(--fav); outline-offset: -2px; }
.plan-card.is-featured { border: 1px solid var(--ai-line); background: linear-gradient(180deg, var(--ai-soft), var(--surface) 55%); }
.plan-flag { position: absolute; top: -11px; left: 22px; background: var(--ai); color: #fff; font-size: .7rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; padding: 3px 10px; border-radius: 999px; }
.price { color: var(--ink); margin: 6px 0 4px; display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.price .amount { font-family: var(--font-serif); font-size: 2.6rem; font-weight: 400; line-height: 1; letter-spacing: -.02em; }
.price .per { color: var(--muted); font-weight: 500; font-size: .85rem; }
.plan-card .btn-block { margin: 8px 0 6px; }
.plan-card li { padding: 4px 0; color: var(--ink-2); }
.plan-card li .ico { color: var(--accent); }
.table-scroll { overflow-x: auto; }
.plans-table { width: 100%; font-size: .9rem; }
.plans-table th, .plans-table td { padding: 11px 12px; border-bottom: 1px solid var(--line); text-align: center; }
.plans-table th[scope="row"] { text-align: left; font-weight: 500; color: var(--ink-2); }
.plans-table thead th { font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.plans-table td:nth-child(3) { background: color-mix(in srgb, var(--ai-soft) 60%, transparent); font-weight: 600; }
.sum-row { grid-template-columns: 1fr !important; gap: 2px; padding: 12px 0; }
@media (min-width: 1280px) { .sum-row { grid-template-columns: 150px 1fr !important; gap: 14px; } }
.sum-row dd p { margin: 0; line-height: 1.65; }

/* ── Mapa de evidencia con datos reales ─────────────────────────────────── */
.ai-start { background: linear-gradient(135deg, var(--ai-soft), var(--surface)); border-color: var(--ai-line); }
.live-map { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .88rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.live-map th, .live-map td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; text-align: left; }
.live-map thead th { font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; background: var(--surface-2); }
.live-map tbody th { font-weight: 600; min-width: 200px; }
.live-map td { min-width: 150px; }
.map-hit { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.ai-pending { border-style: dashed; }

/* ── Acceso (versión online) ────────────────────────────────────────────── */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: var(--hero-glow), var(--bg); }
.login-card { width: 100%; max-width: 460px; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 32px 28px; box-shadow: var(--shadow-2); }
.login-brand { margin-bottom: 22px; }
.login-card h1 { font-size: 2.1rem; line-height: 1.08; margin: 0 0 10px; }
.login-card h1 em { color: var(--accent); }
.login-form { display: grid; gap: 10px; margin: 20px 0 14px; }
.login-form label { font-weight: 600; color: var(--ink); }
.login-sent { display: flex; gap: 12px; background: var(--fav-soft); border-radius: 14px; padding: 14px 16px; margin: 20px 0; color: var(--ink); }
.login-sent .ico { color: var(--fav); margin-top: 3px; }
.login-points { list-style: none; padding: 0; margin: 16px 0; display: grid; gap: 6px; color: var(--ink-2); }
.login-points .ico { color: var(--accent); margin-right: 4px; }
.login-legal { border-top: 1px solid var(--line); padding-top: 12px; margin: 0; }

/* ── Cobertura (inicio y acceso) ────────────────────────────────────────── */
.coverage-band { margin: 26px auto 10px; max-width: 860px; text-align: center; }
.cov-tiles { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.cov-tile { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 14px 12px; box-shadow: var(--shadow-1); text-align: left; }
.cov-tile strong { display: block; font-family: var(--font-serif); font-weight: 400; font-size: 1.7rem; line-height: 1.05; color: var(--accent); letter-spacing: -.01em; margin-bottom: 4px; }
.cov-tile span { font-size: .8rem; color: var(--ink-2); line-height: 1.4; display: block; }
.cov-sources { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 14px 0 6px; }
.cov-sources span { font-size: .74rem; font-weight: 600; color: var(--ink-2); background: var(--surface-2); border-radius: 7px; padding: 3px 9px; }
.cov-sources .cov-more { background: transparent; color: var(--muted); font-weight: 500; }
.cov-note { font-size: .76rem; color: var(--muted); max-width: 70ch; margin: 4px auto 0; }
.coverage-band.is-compact { margin: 18px 0 6px; text-align: left; }
.coverage-band.is-compact .cov-tiles { grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.coverage-band.is-compact .cov-tile { padding: 10px; box-shadow: none; background: var(--surface-2); border: 0; }
.coverage-band.is-compact .cov-tile strong { font-size: 1.15rem; }
.coverage-band.is-compact .cov-tile span { font-size: .7rem; }
.coverage-band.is-compact .cov-sources { justify-content: flex-start; }
@media (max-width: 420px) { .coverage-band.is-compact .cov-tiles { grid-template-columns: 1fr; } }

/* ── Comentarios del piloto ─────────────────────────────────────────────── */
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg-opt { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; font-size: .85rem; color: var(--ink-2); background: var(--surface); }
.seg-opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.seg-opt input { accent-color: var(--accent); }
.legal-card { max-width: 760px; } .legal .panel ul { padding-left: 1.2em; } .legal .panel li { margin-bottom: 6px; }
.credit-bar { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; margin: 8px 0 4px; } .credit-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent-2), var(--ai)); }
.code-input { font-family: var(--font-mono); font-size: 1.4rem; letter-spacing: .35em; text-align: center; }
.cov-details { margin-top: 12px; text-align: left; }
.cov-details summary { cursor: pointer; font-size: .84rem; font-weight: 600; color: var(--accent); list-style: none; text-align: center; }
.coverage-band.is-compact .cov-details summary { text-align: left; }
.cov-details summary::-webkit-details-marker { display: none; }
.cov-details summary::after { content: " ▾"; }
.cov-details[open] summary::after { content: " ▴"; }
.cov-details .cov-note { text-align: left; margin: 8px 0; }

/* ── IA bloqueada (Free): se ve qué se obtendría, con vista previa difuminada ── */
.ai-locked { background: linear-gradient(135deg, var(--ai-soft), var(--surface)); border: 1px solid var(--ai-line); border-radius: var(--radius); padding: 18px 20px; margin: 0 0 14px; }
.ai-locked.is-compact { padding: 14px 16px; margin-top: 12px; }
.ai-locked-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ai-locked h3 { margin: 0; font-size: 1rem; color: var(--ai); }
.ai-lock { display: inline-flex; align-items: center; gap: 4px; font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ai); background: var(--surface); border: 1px solid var(--ai-line); border-radius: 999px; padding: 2px 8px; }
.ai-locked p { margin: 8px 0 12px; }
.ai-preview { position: relative; display: grid; gap: 8px; padding: 12px 14px; margin-bottom: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; filter: blur(2.5px); user-select: none; pointer-events: none; }
.ai-preview-row { display: grid; grid-template-columns: 96px 1fr; align-items: center; gap: 10px; font-size: .82rem; }
.ai-preview-row span { color: var(--muted); }
.ai-preview-row i { display: block; height: 9px; border-radius: 5px; background: var(--line-strong); }
.ai-preview-row b { font-family: var(--font-mono, monospace); font-weight: 600; color: var(--ink, inherit); }
.extractive-note { margin: 0 0 10px; }

/* Planes en la pantalla de acceso */
.login-plans { margin: 16px 0; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); }
.login-plans .eyebrow { margin: 0 0 8px; }
.login-plans ul { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 8px; }
.login-plans li { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; }
.login-plans li .small { grid-column: 1 / -1; }
.login-plans .lp-price { font-weight: 600; color: var(--accent); white-space: nowrap; }
.login-plans li.is-free .lp-price { color: var(--fav); }
.login-plans > p.small { margin: 0; }

/* Correcciones de la comunidad */
.corrections .corr { border-top: 1px solid var(--line); padding: 10px 0; }
.corrections .corr p { margin: 4px 0; }
.corrections .corr.is-rejected { opacity: .6; }
.corrections .corr-comments { list-style: none; padding: 0; margin: 6px 0; display: grid; gap: 4px; }
.corrections .corr-vote { display: grid; gap: 6px; margin-top: 6px; }
.corrections .corr-vote input { width: 100%; }
.corrections .corr-new { margin-top: 10px; }
.corrections .corr-new > summary { list-style: none; display: inline-flex; cursor: pointer; }
.corrections .corr-new form { margin-top: 10px; }
.ok-text { color: var(--fav); }
.corr-authors { margin: 2px 0 6px; }

/* Filtros rápidos encima de los resultados */
.quick-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 12px; }
.quick-filters .qf { border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2); border-radius: 999px; padding: 6px 12px; font-size: 14px; cursor: pointer; }
.quick-filters .qf:hover { border-color: var(--accent); color: var(--accent); }
.quick-filters .qf.is-on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
