:root {
  --bg: #fafafa;
  --fg: #1a1a1a;
  --muted: #666;
  --accent: #2563eb;
  --danger: #dc2626;
  --warn: #d97706;
  --ok: #16a34a;
  --card: #ffffff;
  --border: #e5e5e5;
  --radius: 8px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.5;
}

.topbar {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.brand {
  font-weight: 700;
  text-decoration: none;
  color: var(--fg);
}
.topbar nav a {
  margin-left: 18px;
  color: var(--muted);
  text-decoration: none;
}
.topbar nav a:hover { color: var(--fg); }

.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 20px 80px;
}
.page-intro { margin: 16px 0 24px; }
.page-intro h1 { margin: 0 0 4px; }

.window-banner {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 24px;
}
.wb-content { display: flex; align-items: center; gap: 12px; }
.wb-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}
.dot-pending   { background: var(--warn); }
.dot-open      { background: var(--ok); }
.dot-full      { background: var(--danger); }
.dot-closed    { background: var(--muted); }
.dot-off       { background: #6366f1; }   /* índigo nocturno para off_hours */
.dot-off_hours { background: #6366f1; }   /* alias por si poll.js usa el status literal */

.grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
/* Variante densa para el feed cuando hay muchas fichas: cards más
   estrechas → más columnas en pantallas grandes, sensación de abundancia. */
.grid.dense {
  gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
.grid.dense .card { padding: 12px; }
.grid.dense .card-title { font-size: 15px; margin: 6px 0; }
.grid.dense .card-quote { font-size: 13px; padding: 3px 10px; }
.grid.dense .card-footer { font-size: 12px; margin-top: 10px; }
.grid.dense .mini-tag { font-size: 10px; padding: 1px 6px; }
.card {
  display: block;
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 4px solid hsl(var(--tag-hue, 220), 55%, 55%);
  border-radius: var(--radius);
  padding: 16px;
  text-decoration: none;
  color: var(--fg);
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px hsla(var(--tag-hue, 220), 50%, 40%, .15);
  border-left-color: hsl(var(--tag-hue, 220), 65%, 45%);
}
.card.big { padding: 24px; }
.card-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
}
.card-title { margin: 8px 0 8px; font-size: 16px; }
.card-quote {
  border-left: 3px solid var(--border);
  margin: 0;
  padding: 4px 12px;
  color: #333;
  font-style: italic;
}
.card-quote.big { font-size: 18px; }
.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  font-size: 13px;
}
.pill {
  background: #eef2ff;
  color: var(--accent);
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 600;
}
.health { color: var(--muted); }

.form-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  max-width: 720px;
}
.form-card label { display: block; margin-bottom: 6px; font-weight: 600; }
.form-card textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 15px;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
  border: 0;
  padding: 10px 18px;
  border-radius: var(--radius);
  font-weight: 600;
  cursor: pointer;
  margin-top: 12px;
  display: inline-block;
  text-decoration: none;
}
.btn-primary:disabled {
  background: #9ca3af;
  cursor: not-allowed;
}
.hint { color: var(--muted); font-size: 13px; margin-top: 8px; }

.alert {
  padding: 10px 14px;
  border-radius: var(--radius);
  margin-bottom: 14px;
}
.alert-error {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}
/* Contador de caracteres + barra de progreso del textarea de envío */
.charcount {
  margin: 6px 0 14px;
}
.charcount-track {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.charcount-fill {
  height: 100%;
  width: 0;
  background: var(--muted);
  transition: width 120ms ease, background-color 120ms;
}
.charcount-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}
.charcount-msg { font-weight: 500; }
.charcount-num { font-variant-numeric: tabular-nums; }

/* Estados según data-state */
.charcount[data-state="short"] .charcount-fill { background: #fbbf24; }
.charcount[data-state="short"] .charcount-msg { color: #92400e; }
.charcount[data-state="ok"] .charcount-fill    { background: var(--accent); }
.charcount[data-state="ok"] .charcount-msg     { color: var(--accent); font-weight: 600; }
.charcount[data-state="long"] .charcount-fill  { background: var(--danger); }
.charcount[data-state="long"] .charcount-msg   { color: var(--danger); font-weight: 600; }

.alert-moderation strong { display: block; margin-bottom: 4px; }
.alert-moderation .alert-category {
  font-size: 13px;
  opacity: 0.85;
  margin-bottom: 6px;
}
.alert-moderation p { margin: 0; }

.steps {
  list-style: none;
  padding: 0;
  margin: 16px 0;
}
.steps li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  color: var(--muted);
}
.steps li.done { color: var(--ok); }
.steps li.current { color: var(--accent); font-weight: 600; }
.step-marker {
  display: inline-flex;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #e5e7eb;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}
.steps li.done .step-marker { background: var(--ok); color: #fff; }
.steps li.current .step-marker {
  background: var(--accent);
  color: #fff;
  animation: step-pulse 1.4s ease-in-out infinite;
}
.steps li.current .step-label::after {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-left: 10px;
  border: 2px solid var(--accent);
  border-top-color: transparent;
  border-radius: 50%;
  vertical-align: middle;
  animation: spinner-rotate 0.9s linear infinite;
}
.steps li.done .step-marker::after { content: "✓"; position: absolute; }
.steps li.done .step-marker { position: relative; font-size: 0; }
.steps li.done .step-marker::after { font-size: 14px; line-height: 22px; }

@keyframes step-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.4); }
  50%      { box-shadow: 0 0 0 6px rgba(37, 99, 235, 0); }
}

/* Spinner reutilizable + overlay del formulario de envío */
.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #e5e7eb;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spinner-rotate 0.9s linear infinite;
  margin: 0 auto 14px;
}
@keyframes spinner-rotate {
  to { transform: rotate(360deg); }
}

.submit-overlay {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
}
.submit-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}
.submit-overlay-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 32px 36px;
  min-width: 280px;
  text-align: center;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}
.submit-overlay-text {
  margin: 0 0 6px;
  font-weight: 600;
  font-size: 16px;
}
.submit-overlay-text.fade-in {
  animation: text-fade 0.4s ease-out;
}
.submit-overlay-hint {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}
@keyframes text-fade {
  from { opacity: 0; transform: translateY(3px); }
  to   { opacity: 1; transform: translateY(0); }
}

.current-step-hint {
  margin: 6px 0 14px;
  color: var(--accent);
  font-weight: 600;
  font-size: 15px;
  min-height: 22px;
}
.current-step-hint.hint-pop {
  animation: text-fade 0.35s ease-out;
}

.analysis { max-width: 820px; margin: 0 auto; }
.analysis-head { margin-bottom: 20px; }
.analysis-head .meta { color: var(--muted); font-size: 13px; }
.quote-box, .summary-box, .report-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 18px;
}
.quote-box blockquote {
  margin: 0;
  border-left: 3px solid var(--accent);
  padding-left: 12px;
  font-style: italic;
}
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.metric { background: #f5f5f5; padding: 10px; border-radius: 6px; }
.metric-label { display: block; font-size: 12px; color: var(--muted); }
.metric-value { font-size: 18px; font-weight: 700; }
.report-md {
  white-space: pre-wrap;
  background: #fafafa;
  padding: 14px;
  border-radius: 6px;
  font-family: inherit;
  font-size: 14px;
}

.badge {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  background: #e5e7eb;
  color: #374151;
}
.badge-done { background: #dcfce7; color: #166534; }
.badge-processing { background: #dbeafe; color: #1e40af; }
.badge-queued { background: #fef3c7; color: #92400e; }
.badge-error { background: #fee2e2; color: #991b1b; }
.badge-rejected { background: #f3f4f6; color: #4b5563; }

.empty { color: var(--muted); }
.muted { color: var(--muted); }
.footer { text-align: center; color: var(--muted); padding: 24px; }

/* ============ Fragmentos numerados en texto analizado ============ */
.fragmented-text { font-size: 16px; line-height: 1.9; }
.frag { position: relative; }
.frag-id {
  font-size: 9px;
  font-weight: 700;
  color: var(--muted);
  background: #f3f4f6;
  padding: 0 4px;
  border-radius: 4px;
  vertical-align: super;
  margin-right: 2px;
}
.frag-hl { background: #fef9c3; padding: 1px 2px; border-radius: 3px; }
.frag-hl .frag-id { background: #fde68a; color: #78350f; }

/* ============ Cajas por falacia ============ */
.fallacy-cards { margin: 24px 0; }
.fallacy-cards > h2 { margin-bottom: 12px; }

.fallacy-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 14px;
}
.fallacy-card.slot-1 { border-left-color: #dc2626; }
.fallacy-card.slot-2 { border-left-color: #d97706; }
.fallacy-card.slot-3 { border-left-color: #2563eb; }

.fc-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.fc-name { margin: 0; font-size: 18px; }
.fc-badge {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 999px;
  background: #e5e7eb;
  color: #374151;
}
.fc-badge-probable { background: #fee2e2; color: #991b1b; }
.fc-badge-possible { background: #fef3c7; color: #92400e; }
.fc-badge-weak     { background: #f3f4f6; color: #6b7280; }

.fc-fragments {
  font-size: 13px;
  color: var(--muted);
  margin: 4px 0 8px;
}
.frag-ref {
  display: inline-block;
  background: #f3f4f6;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 12px;
}

.fc-tentative {
  background: #f9fafb;
  border-radius: 6px;
  padding: 12px 14px;
  margin: 10px 0 14px;
  line-height: 1.55;
}

.fc-bars { display: grid; gap: 8px; margin: 14px 0; }
.bar-row {
  display: grid;
  grid-template-columns: 200px 1fr 48px;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}
.bar-label { color: var(--muted); }
.bar {
  background: #f3f4f6;
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
}
.bar-fill { height: 100%; transition: width .3s ease; }
.bar-compat { background: #dc2626; }
.bar-text   { background: #f59e0b; }
.bar-ev     { background: #2563eb; }
.bar-conf   { background: #16a34a; }
.bar-value { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }

.fc-details { margin-top: 10px; font-size: 14px; }
.fc-details summary {
  cursor: pointer;
  color: var(--accent);
  font-weight: 600;
  padding: 4px 0;
}
.fc-details ul { margin: 6px 0 0 0; padding-left: 20px; }
.fc-details li { margin: 4px 0; }
.fc-sub { font-weight: 600; margin: 8px 0 2px; color: #374151; }

.src-level, .src-dir {
  display: inline-block;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 4px;
  margin-left: 6px;
  background: #f3f4f6;
  color: #6b7280;
}
.src-dir-supports    { background: #dcfce7; color: #166534; }
.src-dir-contradicts { background: #fee2e2; color: #991b1b; }
.src-dir-mixed       { background: #fef3c7; color: #92400e; }
.src-dir-unclear     { background: #e5e7eb; color: #4b5563; }

.discarded-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin: 16px 0;
}
.discarded-box ul { margin: 8px 0 0 0; padding-left: 20px; }
.discarded-box li { margin: 4px 0; color: var(--muted); }

@media (max-width: 600px) {
  .bar-row { grid-template-columns: 1fr; }
  .bar-row .bar-value { text-align: left; }
}

/* ================================================================
   Tooltips (?) — CSS puro, accesibles con teclado (tabindex=0).
   Estructura:
     <span class="tt" tabindex="0">
       <span class="tt-icon">?</span>
       <span class="tt-bubble">…</span>
     </span>
   ================================================================ */
.tt {
  position: relative;
  display: inline-flex;
  vertical-align: middle;
  margin-left: 4px;
  cursor: help;
  outline: none;
}
.tt-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #e5e7eb;
  color: #4b5563;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  transition: background 120ms;
}
.tt:hover .tt-icon,
.tt:focus .tt-icon { background: var(--accent); color: #fff; }

.tt-bubble {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: #111827;
  color: #f9fafb;
  border-radius: 6px;
  padding: 8px 10px;
  width: max-content;
  max-width: 260px;
  font-size: 12px;
  line-height: 1.4;
  font-weight: 400;
  white-space: normal;
  opacity: 0;
  pointer-events: none;
  transition: opacity 140ms, transform 140ms;
  z-index: 20;
  box-shadow: 0 6px 24px rgba(0,0,0,0.15);
}
.tt-bubble::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border: 5px solid transparent;
  border-top-color: #111827;
}
.tt-bubble a { color: #a5b4fc; text-decoration: underline; }
.tt:hover .tt-bubble,
.tt:focus .tt-bubble {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

/* En móvil el tooltip se ajusta al ancho de pantalla */
@media (max-width: 480px) {
  .tt-bubble { max-width: 220px; left: 0; transform: translateY(4px); }
  .tt-bubble::after { left: 12px; margin-left: 0; }
  .tt:hover .tt-bubble,
  .tt:focus .tt-bubble { transform: translateY(0); }
}

/* ================================================================
   Página /como-funciona/
   ================================================================ */
.howto { max-width: 900px; margin: 0 auto; padding: 0 20px; }

.howto-hero {
  text-align: center;
  margin: 20px 0 32px;
  padding: 32px 0;
  border-bottom: 1px solid var(--border);
}
.howto-hero h1 { font-size: 36px; margin: 0 0 12px; }
.howto-lede {
  font-size: 18px;
  color: var(--muted);
  max-width: 640px;
  margin: 0 auto;
}
.howto-lede strong { color: var(--fg); }

.howto-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 32px;
}
.howto-toc a {
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--border);
  text-decoration: none;
  color: var(--fg);
  font-size: 14px;
}
.howto-toc a:hover { border-color: var(--accent); color: var(--accent); }

.howto-section {
  margin: 56px 0;
  scroll-margin-top: 80px;
}
.howto-section > h2 {
  font-size: 26px;
  margin: 0 0 16px;
  border-bottom: 2px solid var(--accent);
  display: inline-block;
  padding-bottom: 4px;
}

.howto-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin: 20px 0;
}
@media (max-width: 700px) {
  .howto-grid-2 { grid-template-columns: 1fr; }
}
.howto-box {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 18px 20px;
}
.howto-box.ok    { border-left: 4px solid var(--ok); }
.howto-box.warn  { border-left: 4px solid var(--warn); }
.howto-box h3 { margin: 0 0 8px; font-size: 16px; }
.howto-box ul { margin: 0; padding-left: 20px; color: var(--fg); }
.howto-box li { margin: 6px 0; line-height: 1.5; }

.howto-flow {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 22px;
  margin-top: 18px;
}
.howto-flow h3 { margin: 0 0 14px; font-size: 16px; }
.howto-pipeline {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}
.howto-pipeline li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 0;
}
.pipe-n {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}

/* Métricas explicadas */
.metric-explain-list {
  display: grid;
  gap: 16px;
  margin-top: 20px;
}
.metric-explain {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.metric-explain-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.metric-explain h3 { margin: 0; font-size: 17px; color: var(--accent); }
.metric-tech { font-size: 12px; color: var(--muted); }
.metric-tech code { background: #f3f4f6; padding: 1px 6px; border-radius: 4px; }
.metric-short { font-weight: 600; margin: 0 0 8px; }
.metric-long { color: var(--muted); margin: 0 0 14px; font-size: 14px; line-height: 1.55; }
.metric-demo {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
}
.bar-label-min,
.bar-label-max { font-size: 12px; color: var(--muted); }
.bar-label-max { text-align: right; }
/* Reutilizamos .bar / .bar-fill ya definidos. Colores específicos por métrica: */
.bar-fill.bar-compatibility    { background: #2563eb; }
.bar-fill.bar-text_coverage    { background: #0891b2; }
.bar-fill.bar-evidence_coverage{ background: #16a34a; }
.bar-fill.bar-confidence       { background: #7c3aed; }

.howto-aside {
  margin-top: 28px;
  padding: 18px 22px;
  background: #eef2ff;
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
}
.howto-aside h3 { margin: 0 0 8px; font-size: 16px; }
.howto-aside p { margin: 0; line-height: 1.6; }

/* Veredictos */
.verdict-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 18px;
}
.verdict-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.verdict-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.verdict-probable     .verdict-tag { background: #fee2e2; color: #991b1b; }
.verdict-possible     .verdict-tag { background: #fef3c7; color: #92400e; }
.verdict-weak         .verdict-tag { background: #e0e7ff; color: #3730a3; }
.verdict-not_detected .verdict-tag { background: #e5e7eb; color: #4b5563; }
.verdict-card p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.55; }

/* Catálogo */
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 20px;
}
.catalog-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  scroll-margin-top: 80px;
}
.catalog-head { margin-bottom: 8px; }
.catalog-head h3 { margin: 0 0 4px; font-size: 18px; }
.catalog-aliases { margin: 0 0 6px; font-size: 12px; color: var(--muted); }
.catalog-flag {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 600;
  margin-top: 2px;
}
.catalog-flag.with-evidence { background: #d1fae5; color: #065f46; }
.catalog-flag.no-evidence   { background: #e5e7eb; color: #4b5563; }
.catalog-def {
  margin: 10px 0 12px;
  color: var(--fg);
  line-height: 1.55;
  font-size: 14px;
}
.catalog-example {
  background: #f9fafb;
  border-left: 3px solid var(--muted);
  padding: 8px 12px;
  font-style: italic;
  color: var(--muted);
  margin: 0 0 12px;
  font-size: 13px;
  border-radius: 0 6px 6px 0;
}
.catalog-indicators {
  margin-top: auto;
  font-size: 13px;
}
.catalog-indicators summary {
  cursor: pointer;
  color: var(--accent);
  font-weight: 600;
}
.catalog-indicators ul {
  margin: 8px 0 0;
  padding-left: 20px;
  color: var(--muted);
}
.catalog-indicators li { margin: 4px 0; line-height: 1.45; }

/* Limitaciones */
.howto-limits {
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
  display: grid;
  gap: 10px;
}
.howto-limits li {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--warn);
  padding: 12px 16px;
  border-radius: var(--radius);
  line-height: 1.55;
}

.howto-foot {
  margin: 56px 0 32px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
  text-align: center;
}
.howto-foot p { margin: 0; font-size: 16px; color: var(--muted); }
.howto-foot a { margin: 0 6px; }

/* ================================================================
   Feed con tags: rail de chips, carruseles horizontales, mini-tags
   ================================================================ */

/* Rail de chips de filtro */
.tag-rail {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 4px 16px;
  margin: 4px 0 20px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.tag-rail::-webkit-scrollbar { height: 6px; }
.tag-rail::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.tag-rail::-webkit-scrollbar-track { background: transparent; }

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  padding: 7px 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: var(--fg);
  text-decoration: none;
  transition: background 120ms, border-color 120ms, transform 120ms;
}
.tag-chip:hover {
  border-color: hsl(var(--tag-hue, 220), 55%, 55%);
  background: hsl(var(--tag-hue, 220), 60%, 97%);
  transform: translateY(-1px);
}
.tag-chip.active {
  background: hsl(var(--tag-hue, 220), 55%, 50%);
  border-color: hsl(var(--tag-hue, 220), 55%, 45%);
  color: white;
}
.tag-chip.active .tag-dot { background: white; }
.tag-chip.active .tag-count {
  background: rgba(255,255,255,0.25);
  color: white;
}

.tag-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: hsl(var(--tag-hue, 220), 55%, 55%);
  flex-shrink: 0;
}
.tag-count {
  background: rgba(0,0,0,0.05);
  color: var(--muted);
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 999px;
  font-weight: 600;
}

/* Hero del feed (banner con stats) */
.feed-hero {
  text-align: center;
  margin: 12px 0 22px;
  padding: 18px 16px 22px;
}
.feed-hero h1 {
  font-size: 28px;
  margin: 0 0 8px;
  font-weight: 700;
}
.feed-stats {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}
.feed-stats strong {
  color: var(--fg);
  font-size: 18px;
  font-weight: 700;
  margin: 0 2px;
}
.feed-stats a { color: var(--accent); text-decoration: none; }
.feed-stats a:hover { text-decoration: underline; }
.feed-pagination-hint {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  margin: 24px 0;
}
.feed-pagination-hint a { color: var(--accent); }

/* Mini-tags dentro de cada card */
.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 10px;
}
.mini-tag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: hsl(var(--tag-hue, 220), 60%, 95%);
  color: hsl(var(--tag-hue, 220), 50%, 30%);
  font-weight: 500;
  white-space: nowrap;
}

/* Título coloreado en vista filtrada */
.title-tag {
  color: hsl(var(--tag-hue, 220), 55%, 45%);
  padding: 0 4px;
}

/* Móvil: chips más pequeños, grid denso con cards más estrechas */
@media (max-width: 600px) {
  .tag-chip { padding: 6px 12px; font-size: 12px; }
  .grid.dense { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .feed-hero h1 { font-size: 22px; }
  .feed-stats { font-size: 13px; }
  .feed-stats strong { font-size: 15px; }
}

/* ================================================================
   FAB — Floating Action Button (CTA de "Enviar frase")
   ================================================================ */
.fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: white;
  padding: 14px 22px;
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.35);
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  z-index: 50;
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms;
}
.fab:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.45);
  background: #1d4ed8;
}
.fab-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255,255,255,0.22);
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
}
@media (max-width: 600px) {
  /* En móvil quitamos el texto y dejamos solo el círculo */
  .fab { padding: 0; width: 56px; height: 56px; justify-content: center; }
  .fab-text { display: none; }
  .fab-icon {
    width: 100%; height: 100%; background: transparent;
    font-size: 28px;
  }
}

/* ================================================================
   Aviso de privacidad en /submit/
   ================================================================ */
.privacy-note {
  margin: 32px auto 0;
  max-width: 720px;
  padding: 18px 22px;
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-left: 4px solid #f59e0b;
  border-radius: var(--radius);
}
.privacy-note h3 {
  margin: 0 0 12px;
  font-size: 15px;
  color: #92400e;
}
.privacy-note ul {
  margin: 0 0 12px;
  padding-left: 20px;
  font-size: 14px;
  line-height: 1.55;
}
.privacy-note li { margin: 6px 0; }
.privacy-note .privacy-foot {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  border-top: 1px solid #fde68a;
  padding-top: 10px;
}
.privacy-note .privacy-foot a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}
.privacy-note .privacy-foot a:hover { text-decoration: underline; }

/* ================================================================
   Página /legal/
   ================================================================ */
.legal {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 20px;
  line-height: 1.65;
}
.legal-hero {
  margin: 16px 0 32px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}
.legal-hero h1 {
  font-size: 30px;
  margin: 0 0 6px;
}
.legal-section {
  margin: 28px 0;
}
.legal-section h2 {
  font-size: 20px;
  margin: 0 0 12px;
  color: var(--accent);
}
.legal-section p { margin: 8px 0; }
.legal-section ul { padding-left: 20px; }
.legal-section li { margin: 6px 0; }
.legal-section code {
  background: #f3f4f6;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 13px;
}
.legal-foot {
  margin: 40px 0 32px;
  padding: 14px 18px;
  background: #f9fafb;
  border-left: 3px solid var(--muted);
  border-radius: var(--radius);
}
.legal-foot p { margin: 0; font-size: 13px; }

/* ================================================================
   Bloque radar+leyendas — leyendas izquierda · pentágono derecha
   ================================================================ */
.radar-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 28px;
  align-items: start;
  margin: 16px 0 28px;
}
.radar-legends-col { min-width: 0; }
.radar-legends-col .radar-axes-legend {
  /* En modo "legends" tiene su propio fondo, ajustamos al contexto en columna */
  margin: 0 0 14px;
}
.radar-legends-col .radar-legend { margin-top: 0; }
.radar-svg-col {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.radar-svg-col .radar-svg { max-width: 340px; width: 100%; }

@media (max-width: 900px) {
  .radar-hero {
    grid-template-columns: minmax(0, 1fr);
  }
  /* En móvil, pentágono primero (más visual) y leyendas debajo */
  .radar-svg-col   { order: 1; }
  .radar-legends-col { order: 2; }
}

/* ================================================================
   Radar de falacias (pentágono SVG)
   ================================================================ */

/* Variables de los 3 slots de color, alineadas con fc-badge / card-color */
:root {
  --radar-slot-1: #2563eb;  /* azul */
  --radar-slot-2: #16a34a;  /* verde */
  --radar-slot-3: #d97706;  /* naranja */
}

.radar-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px 24px;
  margin: 20px 0;
}
.radar-box > h2 { margin: 0 0 12px; font-size: 18px; }

.fallacy-radar {
  margin: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  justify-items: center;
}
.radar-caption {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 8px;
  text-align: center;
}
.radar-svg {
  width: 100%;
  max-width: 480px;
  height: auto;
  display: block;
  overflow: visible;
}

/* Anillos guía */
.radar-ring {
  fill: none;
  stroke: var(--border);
  stroke-width: 1;
  stroke-dasharray: 3 4;
}
.radar-ring-outer { stroke-dasharray: none; stroke: #cbd5e1; }

/* Ejes (líneas del centro al vértice) */
.radar-axis {
  stroke: var(--border);
  stroke-width: 1;
}

/* Polígonos por falacia: relleno semitransparente + borde sólido */
.radar-poly {
  fill: currentColor;
  fill-opacity: 0.18;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linejoin: round;
  transition: fill-opacity 140ms ease, stroke-width 140ms ease;
}
.radar-poly:hover {
  fill-opacity: 0.32;
  stroke-width: 3;
}

/* Puntos en los vértices */
.radar-point {
  fill: currentColor;
  stroke: white;
  stroke-width: 1.5;
}

/* Colores por slot — usamos `color` para que polígono y leyenda compartan */
.radar-slot-1 { color: var(--radar-slot-1); }
.radar-slot-2 { color: var(--radar-slot-2); }
.radar-slot-3 { color: var(--radar-slot-3); }

/* Iniciales en los vértices del pentágono — una sola letra, grande. */
.radar-initial {
  font-size: 16px;
  font-weight: 700;
  fill: var(--accent);
  cursor: help;
}

/* Leyenda de las iniciales a pie de pentágono: "E = Encaje, P = Parte..." */
.radar-axes-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  justify-content: center;
  margin: 12px 0 16px;
  padding: 10px 12px;
  background: #f9fafb;
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--fg);
}
.radar-axes-legend .axis-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.radar-axes-legend dt.axis-initial {
  font-weight: 700;
  color: var(--accent);
  background: white;
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  margin: 0;
}
.radar-axes-legend dd.axis-name {
  margin: 0;
  color: var(--fg);
}

/* Etiquetas numéricas de los anillos guía (0.25, 0.5, 0.75) */
.radar-ring-label {
  font-size: 9px;
  font-weight: 500;
  fill: var(--muted);
  pointer-events: none;
  opacity: 0.7;
}

/* Leyenda */
.radar-legend {
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
}
.radar-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  /* OJO: NO ponemos `color` aquí. Lo hereda de .radar-slot-N para que el
     dot pinte el color correcto vía currentColor. El color del texto lo
     ponemos en .legend-name / .legend-verdict explícitamente. */
}
.legend-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: currentColor;     /* hereda del slot */
  display: inline-block;
  flex-shrink: 0;
}
.legend-name {
  font-weight: 600;
  color: var(--fg);             /* texto en color de fondo, no del slot */
}
.legend-verdict {
  color: var(--muted);
  font-size: 13px;
}

/* Color de la barra "Calidad de las fuentes" (5ª) en las cards */
.bar-fill.bar-evq { background: #7c3aed; }

@media (max-width: 600px) {
  .radar-svg { max-width: 360px; }
  .radar-label { font-size: 10px; }
  .radar-box { padding: 14px 12px 18px; }
}
