:root {
  /* Misma estética que la landing de Caligu y los otros bots: fondo crema, tinta casi negra y
     acento terracota; títulos en Bricolage Grotesque, texto en Public Sans. Los nombres viejos
     (--hairline, --panel-raised, --text-muted...) se conservan como alias para no tocar cada regla. */
  --bg: #F7F4EE;
  --panel: #FCFAF6;
  --panel-2: #EDE8DD;
  --input: #FFFFFF;
  --line: #E5E2D8;
  --line-strong: #C9C6BB;
  --ink: #17181B;
  --signal: #C2501D;
  --signal-dim: #F6E3D8;
  --alert: #B3261E;
  --positive: #2F5D50;
  --negative: #B3261E;
  --neutral: #5B5950;
  --text: #17181B;
  --text-dim: #5B5950;
  --hairline: var(--line);
  --panel-raised: var(--panel-2);
  --text-muted: var(--text-dim);
  --radius: 14px;
  --radius-lg: 20px;
  --font-display: "Bricolage Grotesque", system-ui, sans-serif;
  --font-body: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  min-height: 100vh;
}

.mono { font-family: var(--font-mono); }
h1, h2, h3 { font-family: var(--font-display); }
a { color: var(--signal); }
a:hover { color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--signal); box-shadow: 0 0 0 3px var(--signal-dim); }
.query-form input[type="text"]:focus { box-shadow: none; }

.app { max-width: 1240px; margin: 0 auto; padding: 24px 28px 64px; }

/* ---------- Top bar ---------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 10px; }
.brand-logo { width: 32px; height: 32px; border-radius: 8px; display: block; }
.brand-mark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 24px;
  letter-spacing: -0.03em;
  color: var(--ink);
}
.brand-sub {
  font-size: 12px; font-weight: 600; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.08em;
  background: var(--panel-2); padding: 5px 11px; border-radius: 999px; white-space: nowrap;
}

.query-form {
  flex: 1 1 380px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 10px 14px;
}
.query-form:focus-within { border-color: var(--signal); box-shadow: 0 0 0 3px var(--signal-dim); }
.query-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.query-row--filters { gap: 18px; row-gap: 8px; }

.query-form input[type="text"] {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
}
.query-form input[type="text"]::placeholder { color: var(--text-muted); }

.src-check-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.src-check {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.src-check--stub {
  cursor: not-allowed;
}
.src-check--stub::after {
  content: "próx.";
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-muted);
  opacity: 0.7;
  margin-left: 1px;
}
.src-check--stub input[type="checkbox"] { cursor: not-allowed; }

.query-form button,
.ghost-btn,
.modal-actions button[type="submit"],
.auth-card button[type="submit"],
.settings-form button[type="submit"] {
  background: var(--signal);
  color: #ffffff;
  border: none;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13px;
  padding: 9px 20px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s;
}
.query-form button:hover,
.modal-actions button[type="submit"]:hover,
.auth-card button[type="submit"]:hover,
.settings-form button[type="submit"]:hover { background: var(--ink); }

.query-form button:disabled {
  opacity: 0.65;
  cursor: wait;
  filter: none;
}

.ghost-btn {
  background: transparent;
  border: 1.5px solid var(--line-strong);
  color: var(--ink);
}
.ghost-btn:hover { background: transparent; border-color: var(--ink); color: var(--ink); }
.ghost-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.date-field {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}
.date-field input[type="datetime-local"] {
  background: var(--input);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 12px;
  padding: 5px 8px;
  color-scheme: light;
}

.search-warnings { display: flex; flex-direction: column; gap: 6px; }
.search-warnings:empty { display: none; }
.search-warning {
  font-size: 12px;
  color: var(--text-muted);
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-left: 3px solid var(--signal);
  border-radius: 6px;
  padding: 8px 12px;
  line-height: 1.4;
}

.status { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-muted); }
.user-menu { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.user-email { font-size: 12px; color: var(--text-muted); font-family: var(--font-mono); }
.form-error { color: var(--negative); font-size: 12.5px; min-height: 16px; margin: 0; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--negative); }
.dot--off { background: var(--text-muted); }
.dot--on { background: var(--positive); }

/* ---------- Toggle: deduplicar entre fuentes (Beta) ---------- */
.dedup-toggle {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--panel-raised);
  border: 1px solid var(--hairline);
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 12px;
  padding: 7px 12px;
  border-radius: 20px;
  cursor: pointer;
  white-space: nowrap;
}
.dedup-toggle:hover { border-color: var(--signal); }
.dedup-toggle-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
}
.dedup-toggle.dedup-toggle--on {
  color: var(--text);
  border-color: var(--signal);
}
.dedup-toggle.dedup-toggle--on .dedup-toggle-dot {
  background: var(--signal);
}
.beta-badge {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.04em;
  color: var(--alert);
  border: 1px solid var(--alert);
  padding: 1px 5px;
  border-radius: 4px;
}

/* ---------- Chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 16px 0; }
.chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 6px 8px 6px 14px;
  font-size: 13px;
}
.chip.chip--active { border-color: var(--signal); color: var(--signal); }
.chip button {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  padding: 2px 6px;
}
.chip button:hover { color: var(--alert); }

/* ---------- Waveform signature ---------- */
.waveform-strip {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 10px 16px 8px;
  margin-bottom: 22px;
}
#waveform { width: 100%; display: block; }
.waveform-label {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  text-transform: uppercase;
  padding-top: 4px;
}

/* ---------- Grid layout ---------- */
.grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 18px;
}
.kpis { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }

.kpi-card {
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.kpi-label { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-dim); }
.kpi-value { font-family: var(--font-display); font-size: 28px; font-weight: 800; letter-spacing: -0.02em; color: var(--ink); }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
}
.panel-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.panel-head h2 { font-family: var(--font-display); font-size: 17px; margin: 0; font-weight: 700; letter-spacing: -0.015em; }
.panel-sub { font-size: 11px; color: var(--text-muted); }

.panel--mentions { grid-column: 1 / -1; }
.panel--map { grid-column: 1 / -1; }
.panel--ai-insight { grid-column: 1 / -1; }
.panel--ai-insight .panel-head { margin-bottom: 10px; }
.ai-insight-text { line-height: 1.6; font-size: 14px; white-space: pre-wrap; }
.ai-insight-meta {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.ai-insight-loading { color: var(--text-muted); font-size: 13px; display: flex; align-items: center; gap: 8px; }
.ai-insight-loading::before {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--hairline);
  border-top-color: var(--signal);
  animation: ai-spin 0.8s linear infinite;
}
@keyframes ai-spin { to { transform: rotate(360deg); } }
.ai-insight-setup {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  background: var(--panel-raised);
  border-radius: 6px;
  padding: 12px 14px;
}
.ai-insight-setup code {
  background: var(--panel);
  padding: 1px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 12px;
}

/* ---- Consulta a las 10 IAs ---- */
.multi-ai { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--hairline); }
.multi-ai-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.multi-ai-head h3 { font-family: var(--font-display); font-size: 14px; margin: 0 0 4px; font-weight: 600; }
.multi-ai-note { font-size: 12px; color: var(--text-muted); line-height: 1.5; margin: 0; max-width: 760px; }
.multi-ai-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.multi-ai-chip {
  font-family: var(--font-mono); font-size: 11px; padding: 3px 10px; border-radius: 999px;
  background: var(--panel-raised); color: var(--text-muted);
}
.multi-ai-chip--on { background: rgba(47, 93, 80, 0.12); color: var(--positive); }
.multi-ai-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.multi-ai-card {
  display: flex; flex-direction: column; gap: 8px;
  border: 1px solid var(--hairline); border-radius: 8px; padding: 12px 14px; background: var(--panel);
}
.multi-ai-card--error { border-color: rgba(179, 38, 30, 0.35); }
.multi-ai-card--off { opacity: 0.55; }
.multi-ai-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.multi-ai-card-head strong { font-size: 13px; }
.multi-ai-model { font-family: var(--font-mono); font-size: 10px; color: var(--text-muted); }
.multi-ai-text { font-size: 13px; line-height: 1.55; white-space: pre-wrap; margin: 0; }
.multi-ai-err { font-size: 12px; color: var(--negative); margin: 0; }
.multi-ai-off { font-size: 12px; color: var(--text-muted); margin: 0; }
.multi-ai-foot { font-family: var(--font-mono); font-size: 10px; color: var(--text-muted); display: flex; flex-wrap: wrap; gap: 8px; }
.multi-ai-foot a { color: var(--signal); text-decoration: none; }
.multi-ai-foot a:hover { text-decoration: underline; }
.multi-ai-vendor-note { font-size: 11px; color: var(--text-muted); margin: 0; }

#mentions-map {
  height: 320px;
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
  background: var(--panel-raised);
}
.map-hint {
  margin: 10px 0 0;
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.5;
}
/* Popups de Leaflet siguen la paleta clara del dashboard */
.leaflet-popup-content-wrapper, .leaflet-popup-tip {
  background: var(--panel-raised);
  color: var(--text);
}
.leaflet-popup-content { font-family: var(--font-body); font-size: 12px; margin: 10px 12px; }
.leaflet-popup-content a { color: var(--signal); }
.map-popup-meta { color: var(--text-muted); font-size: 10.5px; margin-top: 4px; }

#query-country, #query-lang {
  background: var(--input);
  color: var(--text);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  font-family: var(--font-body);
  font-size: 12px;
}

/* ---------- Trends ---------- */
.trend-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.trend-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}
.trend-rank { font-family: var(--font-mono); color: var(--text-muted); width: 20px; }
.trend-bar-track { flex: 1; height: 6px; background: var(--panel-raised); border-radius: 4px; overflow: hidden; }
.trend-bar-fill { display: block; height: 100%; background: var(--signal); border-radius: 4px; }
.trend-term { min-width: 120px; }
.trend-weight { font-family: var(--font-mono); color: var(--text-muted); font-size: 11px; }

/* ---------- Alert feed ---------- */
.alert-feed { display: flex; flex-direction: column; gap: 8px; max-height: 280px; overflow-y: auto; }
.alert-item {
  border-left: 3px solid var(--alert);
  background: var(--panel-raised);
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 12.5px;
}
.alert-item .alert-time { display: block; font-family: var(--font-mono); font-size: 10px; color: var(--text-muted); margin-top: 4px; }
.alert-item--clickable { cursor: pointer; transition: background 0.15s, border-color 0.15s; }
.alert-item--clickable:hover { background: var(--panel); border-left-color: var(--signal); }
.empty-hint { color: var(--text-muted); font-size: 13px; line-height: 1.5; }

/* ---------- Domain circuit-breaker feed ---------- */
.domain-feed { display: flex; flex-direction: column; gap: 8px; max-height: 280px; overflow-y: auto; }
.domain-item {
  border-left: 3px solid var(--text-muted);
  background: var(--panel-raised);
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 12.5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.domain-item--paused { border-left-color: var(--alert); }
.domain-item-host { font-family: var(--font-mono); font-weight: 600; }
.domain-item-meta { display: block; font-size: 10.5px; color: var(--text-muted); margin-top: 3px; }
.domain-item-resume {
  background: transparent;
  border: 1.5px solid var(--line-strong);
  color: var(--text-dim);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 11px;
  cursor: pointer;
  white-space: nowrap;
}
.domain-item-resume:hover { border-color: var(--ink); color: var(--ink); }

/* ---------- Mentions table ---------- */
/* Mismo grid-template-columns en el header y en cada fila para que todo
   quede alineado. min-width: 0 en las celdas es lo que evita que un texto
   largo (o una URL sin espacios) empuje el ancho de la fila y rompa el
   contenedor -- sin eso, "1fr" en un grid se ignora si el contenido es
   mas ancho. */
.panel--mentions { overflow: hidden; }
.mentions-table,
.mentions-table-head {
  width: 100%;
  min-width: 0;
}
.mentions-table-head {
  display: grid;
  grid-template-columns: 84px 190px 96px 1fr;
  gap: 12px;
  padding: 0 6px 8px;
  border-bottom: 1px solid var(--hairline);
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}
.mentions-table { display: flex; flex-direction: column; gap: 2px; }
.mention-row {
  display: grid;
  grid-template-columns: 84px 190px 96px 1fr;
  gap: 12px;
  align-items: center;
  padding: 10px 6px;
  border-bottom: 1px solid var(--hairline);
  font-size: 13px;
  min-width: 0;
}
.mention-row:last-child { border-bottom: none; }
.mention-row > * { min-width: 0; }
.source-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  padding: 3px 7px;
  border-radius: 4px;
  width: fit-content;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.source-tag--twitter { background: #E8ECF1; color: #36506B; }
.source-tag--reddit { background: #F6E3D8; color: #C2501D; }
.source-tag--google_news { background: #E3EEE8; color: #2F5D50; }
.source-tag--google { background: #F3E7D3; color: #8A5A12; }
.source-tag--meta { background: #EFE3EE; color: #7A3E73; }
.source-tag--tiktok { background: #E1EEF0; color: #2C6470; }
.source-tag--youtube { background: #F8E3E0; color: #B3261E; }
.source-tag--searxng { background: #E6EAF2; color: #3F5A8A; }
.source-tag--manual { background: #EDE8DD; color: #5B5950; }
.source-tag--bluesky { background: #E4EDF5; color: #2F6590; }
.source-tag--mastodon { background: #ECE6F2; color: #5B4A86; }
.manual-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--text-dim);
  white-space: nowrap;
}
.mention-source { display: flex; flex-direction: column; gap: 3px; min-width: 0; overflow: hidden; }
.mention-author {
  color: var(--text-muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mentions-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding-top: 14px;
  margin-top: 8px;
  border-top: 1px solid var(--hairline);
  font-size: 12.5px;
  color: var(--text-muted);
}
.mentions-pagination button {
  background: transparent;
  border: 1.5px solid var(--line-strong);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
}
.mentions-pagination button:hover:not(:disabled) { border-color: var(--ink); }
.mentions-pagination button:disabled { opacity: 0.4; cursor: default; }
.mentions-pagination .mentions-pagination-info { font-family: var(--font-mono); }
.mention-title-link { min-width: 0; overflow: hidden; }
.mention-text {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  color: var(--text);
  overflow: hidden;
  word-break: break-word;
  overflow-wrap: anywhere;
  line-height: 1.4;
}
.sentiment-badge { font-family: var(--font-mono); font-size: 11px; padding: 2px 8px; border-radius: 999px; width: fit-content; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sentiment-badge--positive { background: rgba(47,93,80,0.12); color: var(--positive); }
.sentiment-badge--negative { background: rgba(179,38,30,0.10); color: var(--negative); }
.sentiment-badge--neutral { background: rgba(91,89,80,0.12); color: var(--neutral); }
.mention-time { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); }
.mention-row a { color: inherit; text-decoration: none; }
.mention-row a:hover .mention-text { color: var(--signal); }

/* ---------- Modal ---------- */
.modal-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(23, 24, 27, 0.45);
  align-items: center;
  justify-content: center;
  z-index: 50;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  width: min(420px, 92vw);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.modal h3 { margin: 0 0 4px; font-family: var(--font-display); font-size: 18px; font-weight: 700; letter-spacing: -0.015em; }
.modal label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--text-muted); }
.modal input, .modal select, .modal textarea {
  background: var(--input);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  padding: 8px 10px;
  font-family: var(--font-body);
  font-size: 13px;
}
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }

.modal label.checkbox-label {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 6px;
}
.modal label.checkbox-label input[type="checkbox"] {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  accent-color: var(--signal);
}
.modal .rule-backlog-hint {
  flex-basis: 100%;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.4;
}

@media (max-width: 860px) {
  .grid { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .mention-row,
  .mentions-table-head { grid-template-columns: 150px 1fr; }
  .mention-row > :nth-child(1),
  .mention-row > :nth-child(3),
  .mentions-table-head > :nth-child(1),
  .mentions-table-head > :nth-child(3) { display: none; }
}

/* ---- Interés en buscadores ---- */
.si-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; margin-top: 12px; }
.si-card { border: 1px solid var(--hairline); border-radius: 8px; padding: 12px 14px; background: var(--panel); display: flex; flex-direction: column; gap: 8px; }
.si-card--wide { grid-column: 1 / -1; }
.si-card h3 { font-family: var(--font-display); font-size: 13px; font-weight: 600; margin: 0; display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.si-tag { font-family: var(--font-mono); font-size: 10px; font-weight: 400; color: var(--text-muted); }
.si-big { font-family: var(--font-display); font-size: 28px; font-weight: 600; line-height: 1.1; }
.si-sub { font-size: 12px; color: var(--text-muted); margin: 0; line-height: 1.5; }
.si-off { font-size: 12px; color: var(--text-muted); margin: 0; }
.si-err { font-size: 12px; color: var(--negative); margin: 0; }
.si-bars { display: flex; align-items: flex-end; gap: 2px; height: 56px; }
.si-bar { flex: 1; min-width: 2px; background: var(--signal); border-radius: 2px 2px 0 0; opacity: 0.85; }
.si-axis { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 10px; color: var(--text-muted); }
.si-stats { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 12px; }
.si-stats b { font-family: var(--font-mono); font-weight: 600; }
.si-ideas { width: 100%; border-collapse: collapse; font-size: 12px; }
.si-ideas th, .si-ideas td { text-align: left; padding: 4px 6px; border-bottom: 1px solid var(--hairline); }
.si-ideas td.num, .si-ideas th.num { text-align: right; font-family: var(--font-mono); }
.si-card a { color: var(--signal); text-decoration: none; }
.si-card a:hover { text-decoration: underline; }


/* ---------- Login / registro ---------- */
.auth-card { box-shadow: none; }
.auth-card h3 { font-family: var(--font-display); font-size: 22px; font-weight: 800; letter-spacing: -0.025em; }
.auth-card label { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--text-dim); }
.auth-card input {
  background: var(--input); border: 1.5px solid var(--line); border-radius: 10px; color: var(--text);
  padding: 11px 14px; font-family: var(--font-body); font-size: 14px; font-weight: 400;
}
.auth-card button[type="submit"] { padding: 11px 20px; font-size: 14px; }
.auth-card .brand-sub { font-size: 11px; padding: 4px 9px; }
.auth-switch a { font-weight: 600; }

/* ---------- Admin / equipo ---------- */
.admin-topbar .brand, .team-topbar .brand { gap: 10px; }
.admin-wrap input, .admin-wrap select, .team-wrap input, .team-wrap select {
  background: var(--input); border: 1.5px solid var(--line); border-radius: 10px; color: var(--text);
  padding: 8px 12px; font-family: var(--font-body); font-size: 13px;
}
.admin-wrap button:not(.ghost-btn), .team-wrap button:not(.ghost-btn):not(#dissolve-btn) {
  background: var(--signal); color: #FCFAF6; border: none; border-radius: 999px; padding: 9px 20px;
  font-family: var(--font-body); font-weight: 600; font-size: 13px; cursor: pointer;
  transition: background .15s;
}
.admin-wrap button:not(.ghost-btn):hover, .team-wrap button:not(.ghost-btn):not(#dissolve-btn):hover { background: var(--ink); }
.admin-wrap button:disabled, .team-wrap button:disabled { opacity: 0.5; cursor: not-allowed; }
.danger-zone button#dissolve-btn { border-radius: 999px; padding: 9px 20px; font-family: var(--font-body); font-weight: 600; cursor: pointer; }

/* ---------- Barra de vistas (Escucha social | Prensa) ---------- */
.viewbar { background: var(--ink); }
.viewbar-inner { max-width: 1240px; margin: 0 auto; padding: 0 28px; display: flex; align-items: center; gap: 4px; }
.viewbar a {
  color: #CFCABD; text-decoration: none; font-family: var(--font-body); font-size: 13px; font-weight: 600;
  padding: 11px 16px; border-bottom: 2px solid transparent; transition: color .15s, border-color .15s;
}
.viewbar a:hover { color: #fff; }
.viewbar a.is-active { color: #fff; border-bottom-color: var(--signal); }
.viewbar .viewbar-note { margin-left: auto; font-size: 11px; color: #8F8B80; }

/* ---------- Prensa ---------- */
.press-wrap { max-width: 1240px; margin: 0 auto; padding: 24px 28px 64px; }
.press-wrap input, .press-wrap select, .press-wrap textarea {
  background: var(--input); border: 1.5px solid var(--line); border-radius: 10px; color: var(--text);
  padding: 8px 12px; font-family: var(--font-body); font-size: 13px; max-width: 100%;
}
.press-wrap textarea { width: 100%; resize: vertical; line-height: 1.4; }
.press-wrap button:not(.ghost-btn):not(.tab-btn):not(.link-btn) {
  background: var(--signal); color: #FCFAF6; border: none; border-radius: 999px; padding: 9px 20px;
  font-family: var(--font-body); font-weight: 600; font-size: 13px; cursor: pointer; transition: background .15s;
}
.press-wrap button:not(.ghost-btn):not(.tab-btn):not(.link-btn):hover { background: var(--ink); }
.press-wrap button:disabled { opacity: .5; cursor: not-allowed; }
.press-wrap .ghost-btn { padding: 7px 16px; }
.press-head { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; padding-bottom: 18px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.press-head .spacer { flex: 1; }
.press-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.tab-btn {
  background: transparent; border: 1.5px solid var(--line-strong); color: var(--ink); border-radius: 999px;
  padding: 7px 16px; font-family: var(--font-body); font-weight: 600; font-size: 13px; cursor: pointer;
}
.tab-btn.is-active { background: var(--ink); border-color: var(--ink); color: #fff; }
.press-filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.press-kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 18px; }
.press-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 18px; }
.press-grid .wide { grid-column: 1 / -1; }
.press-wrap .kpi-value.pos { color: var(--positive); }
.press-wrap .kpi-value.neg { color: var(--negative); }
.press-wrap table { width: 100%; border-collapse: collapse; font-size: 13px; }
.press-wrap th { text-align: left; color: var(--text-muted); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.press-wrap td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.press-wrap tr:last-child td { border-bottom: none; }
.press-wrap td.num, .press-wrap th.num { text-align: right; font-variant-numeric: tabular-nums; }
.press-wrap tr.clickable { cursor: pointer; }
.press-wrap tr.clickable:hover td { background: var(--panel-2); }
.sent-bar { display: flex; height: 8px; border-radius: 999px; overflow: hidden; background: var(--panel-2); min-width: 80px; }
.sent-bar i { display: block; height: 100%; }
.sent-bar .p { background: var(--positive); } .sent-bar .n { background: #B7B2A3; } .sent-bar .x { background: var(--negative); }
.chip-s { font-family: var(--font-mono); font-size: 10px; padding: 2px 8px; border-radius: 999px; display: inline-block; }
.chip-s.positivo { background: rgba(47,93,80,.12); color: var(--positive); }
.chip-s.neutral { background: var(--panel-2); color: var(--neutral); }
.chip-s.negativo { background: rgba(179,38,30,.10); color: var(--negative); }
.chip-s.warn { background: var(--signal-dim); color: var(--signal); }
.link-btn { background: none; border: none; padding: 0; color: var(--signal); font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; }
.press-note-title { font-weight: 600; color: var(--ink); text-decoration: none; }
.press-note-title:hover { color: var(--signal); }
.press-meta { font-size: 12px; color: var(--text-muted); margin-top: 3px; }
.press-empty { color: var(--text-muted); font-size: 13px; padding: 14px 2px; }
.press-banner { background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--signal); border-radius: 8px; padding: 10px 14px; font-size: 13px; margin-bottom: 14px; line-height: 1.45; }
.press-banner.err { border-left-color: var(--negative); }
.press-field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-muted); }
.press-form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.press-form .full { grid-column: 1 / -1; }
.press-form .row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.site-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; background: var(--panel); display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.site-card .grow { flex: 1; min-width: 220px; }
.site-card h3 { margin: 0 0 3px; font-size: 15px; }
.site-card.paused { opacity: .6; }
.meter { height: 10px; border-radius: 999px; background: var(--panel-2); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--signal); }
.press-pager { display: flex; gap: 10px; align-items: center; justify-content: flex-end; margin-top: 12px; font-size: 12px; color: var(--text-muted); }
.press-detail { background: var(--panel-2); border-radius: 12px; padding: 14px 16px; margin: 4px 0 8px; font-size: 13px; }
.press-detail ul { margin: 8px 0 0; padding-left: 18px; }
.press-detail li { margin-bottom: 6px; }
.press-chartbox { position: relative; height: 240px; }
@media (max-width: 900px) {
  .press-kpis { grid-template-columns: repeat(2, 1fr); }
  .press-grid, .press-form { grid-template-columns: 1fr; }
  .press-wrap, .viewbar-inner { padding-left: 16px; padding-right: 16px; }
  .viewbar .viewbar-note { display: none; }
  .press-wrap table { display: block; overflow-x: auto; }
}

.quota-pill { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 14px; max-width: 520px; display: flex; flex-direction: column; gap: 6px; }
.quota-pill[hidden] { display: none; }
.quota-top { display: flex; justify-content: space-between; align-items: baseline; }
.quota-top strong { font-family: var(--font-display); font-size: 18px; }
.press-wrap [hidden] { display: none !important; }
