/* ════════════════════════════════════════
   BBRAIN GovTech · Tema Oscuro Premium
════════════════════════════════════════ */
:root {
  --navy:        #0F2744;
  --navy-mid:    #1A3A5C;
  --accent:      #2563EB;
  --accent-pale: rgba(37,99,235,0.10);
  --accent-pale2:rgba(37,99,235,0.18);

  --bg:          #080A0D;
  --bg2:         #0F1217;
  --surface:     #141820;
  --surface2:    #1C2230;
  --border:      rgba(255,255,255,0.07);
  --border2:     rgba(255,255,255,0.12);

  --text:        #E8EDF5;
  --text-mid:    #A8B4C4;
  --muted:       #6B7A8D;
  --hint:        #404B5A;

  --amber:       #D4860F;
  --red:         #E05252;
  --green:       #3AAA72;
  --gold:        #C8A96E;

  --ig-bg:    #FFFFFF;
  --ig-border:#DBDBDB;
  --fb-bg:    #F0F2F5;
  --fb-blue:  #1877F2;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'IBM Plex Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ════════════════════════════════════
   NAV
════════════════════════════════════ */
.bb-nav {
  position: sticky; top: 0; z-index: 200;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 2rem; height: 62px;
  background: rgba(8,10,13,0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}
.bb-nav-left { display: flex; align-items: center; gap: 16px; }
.bb-logo-img { height: 30px; width: auto; filter: brightness(0) invert(1); opacity: .9; }
.bb-nav-divider { width: 1px; height: 22px; background: var(--border2); }
.bb-nav-title {
  font-size: 11px; font-weight: 500; letter-spacing: 0.07em;
  color: var(--muted); text-transform: uppercase;
}
.bb-nav-pills { display: flex; gap: 2px; }
.bb-pill {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 12px; font-weight: 600; letter-spacing: 0.04em;
  padding: 6px 18px; border: none; border-radius: 2px;
  background: transparent; color: var(--muted);
  cursor: pointer; transition: all .15s;
  border-bottom: 2px solid transparent;
}
.bb-pill:hover  { color: var(--text); }
.bb-pill.active { color: var(--gold); border-bottom-color: var(--gold); background: transparent; }

.bb-nav-badge {
  display: flex; align-items: center; gap: 7px;
  font-size: 11px; font-weight: 500; padding: 5px 14px;
  border-radius: 2px;
  background: rgba(255,255,255,0.04);
  color: var(--muted);
  border: 1px solid var(--border);
  letter-spacing: 0.04em;
}
.bb-badge-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #4ADE80; animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse  { 0%,100%{opacity:1} 50%{opacity:.4} }
@keyframes spin   { to { transform: rotate(360deg); } }
@keyframes blink  { 0%,80%,100%{opacity:.2} 40%{opacity:.9} }
@keyframes fadeIn { from{opacity:0;transform:translateY(8px)} to{opacity:1;transform:none} }

/* ════════════════════════════════════
   SECTIONS
════════════════════════════════════ */
.section { display: none; }
.section.active { display: block; }

.bb-section-header {
  max-width: 1100px; margin: 0 auto;
  padding: 1.75rem 2rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.bb-section-header h2 {
  font-family: 'Playfair Display', serif;
  font-size: 24px; font-weight: 700;
  color: var(--text); margin-bottom: 5px; letter-spacing: -0.3px;
}
.bb-section-header p { font-size: 13px; color: var(--muted); }

.bb-section-tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.1em;
  padding: 3px 10px; margin-bottom: 10px;
  background: rgba(200,169,110,0.08); color: var(--gold);
  border: 1px solid rgba(200,169,110,0.18);
  text-transform: uppercase;
}

/* ════════════════════════════════════
   BUTTONS
════════════════════════════════════ */
.bb-btn-primary {
  font-family: 'IBM Plex Sans', sans-serif;
  padding: 9px 22px;
  background: var(--accent); color: #fff;
  border: none; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all .15s; letter-spacing: 0.02em;
}
.bb-btn-primary:hover { background: #1d4ed8; }

.bb-btn-back {
  font-family: 'IBM Plex Sans', sans-serif;
  padding: 7px 16px;
  background: transparent; color: var(--muted);
  border: 1px solid var(--border); font-size: 12px;
  cursor: pointer; transition: all .15s;
}
.bb-btn-back:hover { border-color: var(--border2); color: var(--text); }

/* ════════════════════════════════════
   SOCIAL LAYOUT — columna única centrada
════════════════════════════════════ */
.social-grid {
  display: flex; flex-direction: column;
  align-items: center;
  gap: 32px;
  max-width: 520px; margin: 0 auto;
  padding: 28px 2rem;
}

/* ── INSTAGRAM PANEL ── */
.ig-panel {
  width: 100%;
  background: var(--ig-bg); border: 1px solid var(--ig-border);
  border-radius: 10px; overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
.ig-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid var(--ig-border);
}
.ig-topbar-right { display: flex; gap: 16px; }
.ig-stories {
  display: flex; gap: 16px; padding: 12px 16px;
  overflow-x: auto; border-bottom: 1px solid var(--ig-border);
}
.ig-story { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.ig-story-ring {
  width: 56px; height: 56px; border-radius: 50%;
  background: #DBDBDB; padding: 2px;
  display: flex; align-items: center; justify-content: center;
}
.ig-story-ring.active { background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888); }
.ig-story-avatar {
  width: 100%; height: 100%; border-radius: 50%;
  background: #E8E8E8; border: 2px solid white;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #333;
}
.ig-story-name { font-size: 11px; color: #333; text-align: center; max-width: 56px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.ig-post-header { display: flex; align-items: center; gap: 10px; padding: 10px 12px; }
.ig-post-avatar-wrap { flex-shrink: 0; }
.ig-post-ring { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(45deg, #f09433, #dc2743, #bc1888); padding: 2px; }
.ig-post-avatar-inner { width: 100%; height: 100%; border-radius: 50%; background: #ccc; border: 2px solid white; display: flex; align-items: center; justify-content: center; font-size: 9px; font-weight: 700; }
.ig-post-info { flex: 1; }
.ig-post-username { font-size: 13px; font-weight: 700; color: #000; }
.ig-verified { color: #0095F6; font-size: 12px; }
.ig-post-location { font-size: 11px; color: #737373; }
.ig-post-more { font-size: 18px; color: #000; cursor: pointer; }
.ig-post-img { width: 100%; display: block; max-height: 340px; object-fit: cover; }
.ig-actions { display: flex; justify-content: space-between; padding: 8px 12px; }
.ig-actions-left { display: flex; gap: 14px; }
.ig-action-btn { font-size: 22px; cursor: pointer; }
.ig-likes { padding: 0 12px 4px; font-size: 13px; color: #000; font-weight: 600; }
.ig-caption { padding: 0 12px 6px; font-size: 13px; color: #000; line-height: 1.5; }
.ig-cap-user { font-weight: 700; margin-right: 6px; }
.ig-hashtags { color: #0095F6; display: block; margin-top: 4px; font-size: 12px; }
.ig-see-comments { padding: 0 12px 3px; font-size: 13px; color: #737373; cursor: pointer; }
.ig-timestamp { padding: 0 12px 8px; font-size: 10px; color: #737373; letter-spacing: 0.04em; }

.ig-comments-section { border-top: 1px solid var(--ig-border); }
.ig-comments-list { max-height: 240px; overflow-y: auto; padding: 8px 12px; display: flex; flex-direction: column; gap: 10px; }
.ig-empty-state { font-size: 12px; color: #aaa; text-align: center; padding: 20px 0; }
.ig-comment-input-row { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-top: 1px solid var(--ig-border); }
.ig-commenter-avatar { width: 26px; height: 26px; border-radius: 50%; background: #E0E0E0; display: flex; align-items: center; justify-content: center; font-size: 9px; font-weight: 700; flex-shrink: 0; }
.ig-comment-input { flex: 1; border: none; outline: none; font-size: 13px; font-family: inherit; background: transparent; }
.ig-post-btn { background: none; border: none; color: #0095F6; font-size: 13px; font-weight: 600; cursor: pointer; }

/* ── FACEBOOK PANEL ── */
.fb-panel {
  width: 100%;
  background: var(--fb-bg); border: 1px solid #E4E6EB;
  border-radius: 10px; overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
.fb-topbar { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; background: #fff; border-bottom: 1px solid #E4E6EB; }
.fb-topbar-search { flex: 1; text-align: center; }
.fb-topbar-icons { display: flex; gap: 8px; }
.fb-icon-circle { width: 36px; height: 36px; border-radius: 50%; background: #E4E6EB; display: flex; align-items: center; justify-content: center; font-size: 14px; cursor: pointer; }
.fb-post { background: #fff; margin: 12px; border-radius: 8px; border: 1px solid #E4E6EB; }
.fb-post-header { display: flex; align-items: center; gap: 10px; padding: 12px 12px 8px; }
.fb-post-avatar { width: 40px; height: 40px; border-radius: 50%; background: #C0C0C0; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: #fff; flex-shrink: 0; }
.fb-post-info { flex: 1; }
.fb-post-name { font-size: 14px; font-weight: 700; color: #050505; }
.fb-verified { color: #1877F2; font-size: 12px; }
.fb-post-meta { font-size: 12px; color: #65676B; }
.fb-post-more { font-size: 18px; color: #65676B; cursor: pointer; }
.fb-post-text { padding: 0 12px 10px; font-size: 14px; line-height: 1.55; color: #050505; }
.fb-hashtags { color: #1877F2; }
.fb-post-img { width: 100%; display: block; max-height: 300px; object-fit: cover; }
.fb-reactions-bar { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; border-bottom: 1px solid #E4E6EB; }
.fb-reactions-left { display: flex; align-items: center; gap: 6px; }
.fb-reaction-bubbles { display: flex; }
.fb-reaction-bubble { width: 20px; height: 20px; border-radius: 50%; margin-left: -4px; display: flex; align-items: center; justify-content: center; font-size: 10px; border: 2px solid #fff; }
.fb-reaction-count { font-size: 13px; color: #65676B; }
.fb-reactions-right { display: flex; gap: 10px; font-size: 13px; color: #65676B; }
.fb-action-bar { display: flex; border-bottom: 1px solid #E4E6EB; }
.fb-action-btn { flex: 1; padding: 8px 0; background: none; border: none; font-size: 13px; color: #65676B; font-weight: 600; cursor: pointer; font-family: inherit; }
.fb-action-btn:hover { background: #F2F3F5; }
.fb-comments-section { padding: 8px 12px; }
.fb-comments-list { max-height: 200px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.fb-empty-state { font-size: 12px; color: #aaa; text-align: center; padding: 16px 0; }
.fb-comment-input-row { display: flex; align-items: center; gap: 8px; }
.fb-commenter-avatar { width: 32px; height: 32px; border-radius: 50%; background: #C0C0C0; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; color: #fff; flex-shrink: 0; }
.fb-input-wrap { flex: 1; display: flex; align-items: center; background: #F0F2F5; border-radius: 20px; padding: 6px 12px; gap: 8px; }
.fb-comment-input { flex: 1; border: none; outline: none; background: transparent; font-size: 13px; font-family: inherit; }
.fb-post-btn { background: none; border: none; cursor: pointer; display: flex; align-items: center; }

/* ── COMMENT CARDS (dentro de los paneles sociales) ── */
.ig-comment-card, .fb-comment-card {
  animation: fadeIn .25s ease;
  background: #F8F9FB;
  border: 1px solid #E8EAED;
  border-radius: 6px; padding: 10px 12px;
}
.comment-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 5px; }
.comment-user { font-size: 12px; font-weight: 700; color: #000; }
.comment-time { font-size: 11px; color: #999; }
.comment-text { font-size: 13px; color: #333; margin-bottom: 6px; line-height: 1.45; }
.comment-sentiment { display: inline-flex; align-items: center; gap: 5px; font-size: 10px; font-weight: 700; padding: 2px 8px; margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.05em; border-radius: 2px; }
.sent-positivo { background: rgba(26,122,74,0.10); color: #1A7A4A; border: 1px solid rgba(26,122,74,0.2); }
.sent-negativo { background: rgba(192,57,43,0.10); color: #C0392B; border: 1px solid rgba(192,57,43,0.2); }
.sent-neutro   { background: rgba(100,116,139,0.10); color: #64748B; border: 1px solid rgba(100,116,139,0.2); }
.sent-odio     { background: rgba(192,57,43,0.15); color: #C0392B; border: 1px solid #C0392B; }
.comment-reply { font-size: 12px; color: #333; background: #fff; border-left: 3px solid #1877F2; padding: 6px 10px; line-height: 1.45; }
.comment-alert { font-size: 11px; color: #C0392B; font-weight: 600; margin-top: 4px; }

/* ── INTEL CTA ── */
.bb-intel-cta {
  max-width: 520px; margin: 0 auto;
  padding: 0 2rem 28px;
  display: flex; align-items: center; gap: 16px;
}
.bb-intel-hint { font-size: 12px; color: var(--muted); }

/* ════════════════════════════════════
   INTELLIGENCE PANEL
════════════════════════════════════ */
.ip-wrap { max-width: 1100px; margin: 0 auto; padding: 24px 2rem; display: flex; flex-direction: column; gap: 20px; }

.ip-topbar {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--surface); border: 1px solid var(--border);
  padding: 18px 24px;
  border-left: 4px solid var(--gold);
}
.ip-topbar-title { font-family: 'Playfair Display', serif; font-size: 20px; font-weight: 700; color: var(--text); }
.ip-topbar-sub { font-size: 12px; color: var(--muted); margin-top: 3px; }

.ip-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 900px) { .ip-kpis { grid-template-columns: repeat(2,1fr); } }

.ip-kpi {
  background: var(--surface); border: 1px solid var(--border);
  padding: 16px 18px; border-top: 2px solid var(--gold);
}
.ip-kpi-icon { font-size: 18px; margin-bottom: 6px; }
.ip-kpi-val  { font-family: 'IBM Plex Mono', monospace; font-size: 26px; font-weight: 500; color: var(--text); line-height: 1; }
.ip-kpi-score { color: var(--amber) !important; }
.ip-kpi-alert { color: var(--red) !important; }
.ip-kpi-label { font-size: 11px; color: var(--muted); margin-top: 4px; text-transform: uppercase; letter-spacing: 0.04em; }
.ip-kpi-delta { font-size: 11px; font-weight: 600; margin-top: 6px; }
.ip-kpi-delta.up   { color: var(--green); }
.ip-kpi-delta.down { color: var(--red); }

.ip-row-2 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

.ip-card { background: var(--surface); border: 1px solid var(--border); padding: 20px; }
.ip-card.ip-full { width: 100%; }
.ip-card-title {
  font-family: 'Playfair Display', serif;
  font-size: 15px; font-weight: 700;
  color: var(--text); margin-bottom: 14px;
  padding-bottom: 10px; border-bottom: 1px solid var(--border);
}

.ip-sentiment-grid { display: flex; flex-direction: column; gap: 10px; }
.ip-sent-item { display: flex; align-items: center; gap: 8px; }
.ip-sent-bar-wrap { flex: 1; height: 6px; background: var(--bg2); overflow: hidden; }
.ip-sent-bar { height: 100%; background: var(--accent); }
.ip-sent-item:nth-child(1) .ip-sent-bar { width: 62%; background: var(--green); }
.ip-sent-item:nth-child(2) .ip-sent-bar { width: 21%; background: var(--red); }
.ip-sent-item:nth-child(3) .ip-sent-bar { width: 12%; background: var(--muted); }
.ip-sent-item:nth-child(4) .ip-sent-bar { width: 5%;  background: #7F1D1D; }
.ip-sent-pct   { font-family: 'IBM Plex Mono', monospace; font-size: 13px; font-weight: 500; color: var(--text); min-width: 36px; text-align: right; }
.ip-sent-label { font-size: 12px; color: var(--muted); min-width: 56px; }

.ip-temp-scale { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-bottom: 10px; }
.ip-temp-label-top, .ip-temp-label-bot { font-size: 11px; color: var(--muted); }
.ip-temp-track { width: 24px; height: 80px; background: var(--bg2); border-radius: 12px; position: relative; overflow: hidden; border: 1px solid var(--border); }
.ip-temp-fill { position: absolute; bottom: 0; width: 100%; background: linear-gradient(to top, var(--red), var(--amber), var(--green)); border-radius: 12px; }
.ip-temp-marker { position: absolute; left: -4px; right: -4px; height: 2px; background: var(--gold); border-radius: 2px; }
.ip-temp-reading { font-family: 'IBM Plex Mono', monospace; font-size: 22px; font-weight: 500; color: var(--amber); text-align: center; }
.ip-temp-status  { font-size: 12px; font-weight: 600; color: var(--amber); text-align: center; margin: 3px 0 8px; }
.ip-temp-hint    { font-size: 11px; color: var(--muted); line-height: 1.5; text-align: center; }

.ip-trend-chart  { display: flex; flex-direction: column; gap: 8px; }
.ip-trend-bars   { display: flex; gap: 8px; height: 80px; align-items: flex-end; }
.ip-trend-col    { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; height: 100%; justify-content: flex-end; }
.ip-trend-pos { width: 100%; background: var(--accent); border-radius: 2px 2px 0 0; }
.ip-trend-neg { width: 100%; background: rgba(224,82,82,0.3); border-radius: 2px 2px 0 0; }
.ip-trend-col:nth-child(1) .ip-trend-pos { height: 45%; }
.ip-trend-col:nth-child(1) .ip-trend-neg { height: 20%; }
.ip-trend-col:nth-child(2) .ip-trend-pos { height: 55%; }
.ip-trend-col:nth-child(2) .ip-trend-neg { height: 25%; }
.ip-trend-col:nth-child(3) .ip-trend-pos { height: 70%; }
.ip-trend-col:nth-child(3) .ip-trend-neg { height: 30%; }
.ip-trend-col:nth-child(4) .ip-trend-pos { height: 60%; }
.ip-trend-col:nth-child(4) .ip-trend-neg { height: 22%; }
.ip-trend-col:nth-child(5) .ip-trend-pos { height: 75%; }
.ip-trend-col:nth-child(5) .ip-trend-neg { height: 18%; }
.ip-trend-col:nth-child(6) .ip-trend-pos { height: 80%; }
.ip-trend-col:nth-child(6) .ip-trend-neg { height: 28%; }
.ip-trend-time   { font-size: 9px; color: var(--hint); margin-top: 3px; }
.ip-trend-legend { display: flex; align-items: center; font-size: 11px; color: var(--muted); gap: 4px; }
.ip-legend-dot   { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

.ip-topics { display: flex; flex-direction: column; gap: 10px; }
.ip-topic  { display: flex; align-items: center; gap: 12px; }
.ip-topic-info { min-width: 180px; }
.ip-topic-name { font-size: 13px; font-weight: 600; color: var(--text); }
.ip-topic-sent { font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; }
.ip-topic-sent.positive { color: var(--green); }
.ip-topic-sent.negative { color: var(--red); }
.ip-topic-sent.mixed    { color: var(--amber); }
.ip-topic-bar-wrap { flex: 1; height: 6px; background: var(--bg2); overflow: hidden; }
.ip-topic-bar      { height: 100%; }
.ip-topic-count    { font-family: 'IBM Plex Mono', monospace; font-size: 12px; color: var(--muted); min-width: 100px; text-align: right; }
.ip-topic-trend    { font-weight: 700; }
.ip-topic-trend.up   { color: var(--green); }
.ip-topic-trend.down { color: var(--red); }
.ip-topic-trend.stable { color: var(--muted); }

.ip-posts-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.ip-post-compare-card { border: 1px solid var(--border); overflow: hidden; }
.ip-post-compare-header { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; font-size: 13px; font-weight: 600; border-bottom: 1px solid var(--border); }
.ig-header { background: rgba(255,255,255,0.03); color: var(--text); }
.fb-header { background: rgba(24,119,242,0.06); color: var(--text); }
.ip-post-badge { font-size: 11px; padding: 3px 8px; font-weight: 600; }
.ip-post-badge.winner  { background: rgba(58,170,114,0.1); color: var(--green); border: 1px solid rgba(58,170,114,0.2); }
.ip-post-badge.warning { background: rgba(212,134,15,0.1); color: var(--amber); border: 1px solid rgba(212,134,15,0.2); }
.ip-post-compare-metrics { display: flex; gap: 0; padding: 14px; justify-content: space-around; }
.ip-pcm { text-align: center; }
.ip-pcm-val   { font-family: 'IBM Plex Mono', monospace; font-size: 18px; font-weight: 500; color: var(--text); }
.ip-pcm-label { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; margin-top: 3px; }
.ip-post-rec  { font-size: 12px; padding: 10px 14px; border-top: 1px solid var(--border); line-height: 1.5; }
.ip-post-rec.good    { background: rgba(58,170,114,0.05); color: var(--green); }
.ip-post-rec.warning { background: rgba(212,134,15,0.05); color: var(--amber); }

.ip-recs { display: flex; flex-direction: column; gap: 12px; }
.ip-rec  { display: flex; gap: 14px; align-items: flex-start; padding: 14px; background: var(--surface2); border: 1px solid var(--border); border-left: 3px solid var(--gold); }
.ip-rec-icon  { font-size: 20px; flex-shrink: 0; }
.ip-rec-title { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.ip-rec-text  { font-size: 13px; color: var(--text-mid); line-height: 1.5; }

.ip-summary-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 14px; }
.ip-summary-sub    { font-size: 12px; color: var(--muted); margin-top: 2px; }
.ip-summary-text   { font-size: 14px; color: var(--text-mid); line-height: 1.7; padding: 16px; background: var(--surface2); border: 1px solid var(--border); border-left: 3px solid var(--gold); min-height: 80px; }

/* ════════════════════════════════════
   ASISTENTE CIUDADANO
════════════════════════════════════ */
.ac-header {
  max-width: 1100px; margin: 0 auto;
  padding: 20px 2rem; display: flex;
  justify-content: space-between; align-items: flex-start;
  border-bottom: 1px solid var(--border);
}
.ac-header h2 { font-family: 'Playfair Display', serif; font-size: 22px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.ac-header p { font-size: 13px; color: var(--muted); }

.ac-kpis { display: flex; gap: 20px; }
.ac-kpi  { text-align: right; }
.ac-kpi-val { font-family: 'IBM Plex Mono', monospace; font-size: 22px; font-weight: 500; color: var(--text); }
.ac-kpi-val.accent { color: var(--gold); }
.ac-kpi-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }

.ac-grid {
  display: grid; grid-template-columns: 260px 1fr 260px;
  gap: 16px; max-width: 1100px; margin: 0 auto; padding: 20px 2rem;
}

.ac-col-map, .ac-col-chat, .ac-col-queue {
  background: var(--surface); border: 1px solid var(--border);
  overflow: hidden; display: flex; flex-direction: column;
}

.ac-panel-title {
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted);
  padding: 11px 14px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  background: var(--surface2);
}

.ac-live-dot { width: 6px; height: 6px; border-radius: 50%; background: #4ADE80; animation: pulse 2s ease-in-out infinite; display: inline-block; }

.ac-map-wrap { flex: 1; min-height: 340px; }
.ac-map-legend { display: flex; gap: 10px; flex-wrap: wrap; }
.ac-legend-item { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--muted); }
.ac-legend-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

.ac-map-summary { display: flex; justify-content: space-around; padding: 10px; border-top: 1px solid var(--border); background: var(--surface2); }
.ac-map-stat { text-align: center; }
.ac-map-stat-val   { font-family: 'IBM Plex Mono', monospace; font-size: 20px; font-weight: 500; color: var(--text); display: block; }
.ac-map-stat-label { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }

.ac-col-chat { display: flex; flex-direction: column; }
.ac-chat-inner { flex: 1; display: flex; flex-direction: column; }

.bb-chat-msgs { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 12px; background: var(--bg2); }
.bb-msg { display: flex; flex-direction: column; gap: 2px; animation: fadeIn .2s ease; }
.bb-msg.user { align-items: flex-end; }
.bb-msg.bot  { align-items: flex-start; }
.bb-bubble { max-width: 80%; padding: 9px 13px; font-size: 13px; line-height: 1.5; }
.bb-bubble.user { background: var(--accent); color: #fff; }
.bb-bubble.bot  { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.bb-msg-time { font-size: 10px; color: var(--hint); }
.bb-typing { display: flex; gap: 4px; padding: 10px 14px; }
.bb-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: blink 1.2s ease-in-out infinite; }
.bb-dot:nth-child(2) { animation-delay: .2s; }
.bb-dot:nth-child(3) { animation-delay: .4s; }

.bb-chat-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 14px; border-top: 1px solid var(--border); background: var(--surface); }
.bb-chip {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 11px; padding: 5px 10px;
  background: var(--surface2); border: 1px solid var(--border);
  cursor: pointer; color: var(--text-mid); transition: all .12s;
  display: flex; align-items: center; gap: 5px;
}
.bb-chip:hover { border-color: var(--gold); color: var(--gold); }
.chip-count { font-family: 'IBM Plex Mono', monospace; font-size: 10px; color: var(--hint); }

.bb-chat-input-row { display: flex; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--border); background: var(--surface); }
.bb-chat-input-row input {
  flex: 1; padding: 9px 12px;
  border: 1px solid var(--border); font-family: inherit;
  font-size: 13px; outline: none; color: var(--text);
  background: var(--surface2); transition: border .15s;
}
.bb-chat-input-row input:focus { border-color: var(--gold); }
.bb-chat-input-row button {
  padding: 9px 18px; background: var(--accent); color: #fff; border: none;
  font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit;
}
.bb-chat-input-row button:hover { background: #1d4ed8; }

.ac-queue-count { font-family: 'IBM Plex Mono', monospace; font-size: 11px; color: var(--gold); background: rgba(200,169,110,0.08); padding: 2px 8px; }

.ac-alert-banner {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 14px; font-size: 12px; font-weight: 600;
  background: rgba(224,82,82,0.08); color: var(--red);
  border-bottom: 1px solid rgba(224,82,82,0.15);
  animation: fadeIn .2s ease;
}

.ac-queue-list { flex: 1; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 8px; background: var(--bg2); }

.ac-folio { padding: 10px 12px; border: 1px solid var(--border); border-left: 3px solid transparent; background: var(--surface); cursor: pointer; transition: border-color .12s; }
.ac-folio:hover { border-color: var(--border2); }
.ac-folio-red    { border-left-color: var(--red); }
.ac-folio-yellow { border-left-color: var(--amber); }
.ac-folio-green  { border-left-color: var(--green); }
.ac-folio-gray   { border-left-color: var(--hint); }

.ac-folio-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 5px; }
.ac-folio-id     { font-family: 'IBM Plex Mono', monospace; font-size: 12px; font-weight: 600; color: var(--gold); }
.ac-folio-priority { font-size: 10px; font-weight: 700; padding: 2px 7px; text-transform: uppercase; letter-spacing: 0.04em; }
.ac-folio-priority.red    { background: rgba(224,82,82,0.1); color: var(--red); }
.ac-folio-priority.yellow { background: rgba(212,134,15,0.1); color: var(--amber); }
.ac-folio-priority.green  { background: rgba(58,170,114,0.1); color: var(--green); }
.ac-folio-priority.gray   { background: rgba(107,122,141,0.1); color: var(--muted); }
.ac-folio-desc   { font-size: 12px; color: var(--text-mid); margin-bottom: 5px; }
.ac-folio-meta   { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.ac-folio-status { font-size: 11px; color: var(--muted); font-weight: 500; }

.ac-top-tramites { display: flex; flex-direction: column; gap: 7px; padding: 0 10px 12px; }
.ac-tramite-row  { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-mid); }
.ac-tramite-bar-wrap { flex: 1; height: 4px; background: var(--bg2); overflow: hidden; }
.ac-tramite-bar  { height: 100%; }

/* ════════════════════════════════════
   MODAL FOLIO
════════════════════════════════════ */
.fm-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.7);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.fm-panel {
  background: var(--surface); width: 100%; max-width: 760px; max-height: 90vh;
  overflow-y: auto; border: 1px solid var(--border2);
  box-shadow: 0 24px 80px rgba(0,0,0,0.6);
}
.fm-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 24px; border-bottom: 1px solid var(--border);
  background: var(--surface2); border-left: 4px solid var(--gold);
}
.fm-folio-id  { font-family: 'IBM Plex Mono', monospace; font-size: 20px; font-weight: 500; color: var(--gold); }
.fm-folio-sub { font-size: 12px; color: var(--muted); margin-top: 3px; }
.fm-badge     { font-size: 12px; padding: 4px 12px; background: rgba(200,169,110,0.1); color: var(--gold); border: 1px solid rgba(200,169,110,0.2); font-weight: 600; }
.fm-close     { background: var(--border); border: none; color: var(--text); width: 30px; height: 30px; cursor: pointer; font-size: 16px; }

.fm-body { display: grid; grid-template-columns: 1fr 1fr; }
.fm-col-info, .fm-col-chat { padding: 20px 24px; }
.fm-col-info  { border-right: 1px solid var(--border); }
.fm-section-title { font-size: 11px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.fm-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fm-info-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--hint); margin-bottom: 2px; }
.fm-info-val   { font-size: 13px; font-weight: 500; color: var(--text); }
.fm-desc       { font-size: 13px; color: var(--text-mid); line-height: 1.5; background: var(--surface2); padding: 10px 12px; border: 1px solid var(--border); }
.fm-location   { display: flex; gap: 10px; align-items: center; padding: 10px 12px; background: var(--surface2); border: 1px solid var(--border); }
.fm-actions    { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.fm-btn-primary   { padding: 8px 16px; background: var(--accent); color: #fff; border: none; font-size: 12px; font-weight: 600; cursor: pointer; font-family: inherit; }
.fm-btn-secondary { padding: 8px 16px; background: transparent; color: var(--text); border: 1px solid var(--border2); font-size: 12px; font-weight: 600; cursor: pointer; font-family: inherit; }
.fm-btn-ghost     { padding: 8px 16px; background: transparent; color: var(--muted); border: 1px solid var(--border); font-size: 12px; cursor: pointer; font-family: inherit; }

.fm-chat-log { max-height: 280px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.fm-chat-sender { font-size: 11px; font-weight: 600; color: var(--muted); margin-bottom: 3px; }
.fm-chat-bubble { font-size: 13px; padding: 8px 11px; line-height: 1.45; }
.fm-chat-bubble.bot  { background: var(--surface2); color: var(--text); border: 1px solid var(--border); border-left: 3px solid var(--accent); }
.fm-chat-bubble.user { background: var(--accent); color: #fff; }
.fm-chat-time { font-size: 10px; color: var(--hint); margin-top: 3px; }

.bb-spinner { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,0.15); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }

/* ════════════════════════════════════════
   COMMENT STYLES — Instagram & Facebook
════════════════════════════════════════ */

/* ── Instagram comment ── */
.ig-comment {
  display: flex; gap: 10px; align-items: flex-start;
  animation: fadeIn .25s ease;
}
.ig-comment-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: #DBDBDB; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; color: #555;
}
.ig-comment-body { flex: 1; }
.ig-comment-username {
  font-size: 13px; font-weight: 700; color: #000;
  margin-right: 4px;
}
.ig-comment-text { font-size: 13px; color: #000; line-height: 1.45; }
.ig-comment-meta {
  display: flex; align-items: center; gap: 12px;
  margin-top: 4px; font-size: 11px; color: #8E8E8E;
}
.ig-comment-time { font-size: 11px; color: #8E8E8E; }
.ig-analyzing { font-size: 11px; color: #0095F6; }

.ig-reply {
  margin-top: 8px; padding: 8px 10px;
  background: #F8F8F8; border-left: 2px solid #0095F6;
  border-radius: 0 6px 6px 0;
}
.ig-reply-label {
  font-size: 10px; font-weight: 700; color: #0095F6;
  margin-bottom: 4px; letter-spacing: 0.02em;
}
.ig-reply-text { font-size: 12px; color: #333; line-height: 1.5; }

/* ── Facebook comment ── */
.fb-comment {
  display: flex; gap: 8px; align-items: flex-start;
  animation: fadeIn .25s ease;
}
.fb-comment-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: #C0C0C0; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff;
}
.fb-comment-body { flex: 1; }
.fb-comment-bubble {
  background: #F0F2F5; border-radius: 12px;
  padding: 8px 12px; display: inline-block;
  max-width: 100%;
}
.fb-comment-username {
  font-size: 12px; font-weight: 700; color: #050505; margin-bottom: 2px;
}
.fb-comment-text { font-size: 13px; color: #050505; line-height: 1.45; }
.fb-comment-meta {
  display: flex; align-items: center; gap: 12px;
  margin-top: 4px; padding-left: 4px;
  font-size: 11px; color: #65676B;
}
.fb-comment-time { font-size: 11px; color: #65676B; }
.fb-analyzing { font-size: 11px; color: #1877F2; }

.fb-reply {
  margin-top: 8px; padding: 8px 12px;
  background: #E7F3FF; border-radius: 12px;
  border-left: 3px solid #1877F2;
}
.fb-reply-label {
  font-size: 10px; font-weight: 700; color: #1877F2;
  margin-bottom: 4px; letter-spacing: 0.02em;
}
.fb-reply-text { font-size: 12px; color: #333; line-height: 1.5; }

/* Spinner */
.spinner { display: inline-block; animation: spin .8s linear infinite; }

/* ════════════════════════════════════════
   FEED LAYOUT — 3 columnas con instrucciones
════════════════════════════════════════ */
.feed-layout {
  display: grid;
  grid-template-columns: 190px minmax(0, 520px) 190px;
  gap: 0;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1rem;
  align-items: start;
}

/* ── GUIDE PANELS ── */
.guide-panel {
  padding: 16px 12px;
  position: sticky;
  top: 70px;
  min-width: 0;
}

.guide-header {
  display: flex; align-items: center; gap: 8px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--gold);
  margin-bottom: 20px; padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.guide-dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--gold); flex-shrink: 0;
}

/* Steps */
.guide-steps { display: flex; flex-direction: column; gap: 16px; margin-bottom: 20px; }
.guide-step  { display: flex; gap: 12px; align-items: flex-start; }
.guide-step-num {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px; font-weight: 500; color: var(--gold);
  opacity: 0.6; flex-shrink: 0; min-width: 20px;
  margin-top: 1px;
}
.guide-step-title {
  font-size: 12px; font-weight: 600; color: var(--text);
  margin-bottom: 3px;
}
.guide-step-desc {
  font-size: 11px; color: var(--muted); line-height: 1.6;
  font-weight: 300;
}

/* Tip */
.guide-tip {
  display: flex; gap: 8px; align-items: flex-start;
  padding: 10px 12px;
  background: rgba(200,169,110,0.06);
  border: 1px solid rgba(200,169,110,0.15);
  border-left: 3px solid var(--gold);
  font-size: 11px; color: var(--muted); line-height: 1.6; font-weight: 300;
}
.guide-tip-icon { flex-shrink: 0; }

/* Capabilities */
.guide-capabilities { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.guide-cap {
  display: flex; gap: 10px; align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--border);
  background: var(--surface);
}
.guide-cap-icon { font-size: 18px; flex-shrink: 0; }
.guide-cap-label { font-size: 12px; font-weight: 600; margin-bottom: 1px; }
.guide-cap-desc  { font-size: 10px; color: var(--muted); font-weight: 300; line-height: 1.4; }
.guide-cap.positive .guide-cap-label { color: var(--green); }
.guide-cap.negative .guide-cap-label { color: var(--red); }
.guide-cap.neutral  .guide-cap-label { color: var(--muted); }
.guide-cap.hate     .guide-cap-label { color: var(--amber); }
.guide-cap.positive { border-left: 3px solid var(--green); }
.guide-cap.negative { border-left: 3px solid var(--red); }
.guide-cap.neutral  { border-left: 3px solid var(--hint); }
.guide-cap.hate     { border-left: 3px solid var(--amber); }

.guide-divider { height: 1px; background: var(--border); margin: 16px 0; }

/* Stats */
.guide-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.guide-stat { text-align: center; padding: 10px 4px; background: var(--surface); border: 1px solid var(--border); }
.guide-stat-val   { font-family: 'IBM Plex Mono', monospace; font-size: 16px; font-weight: 500; color: var(--gold); }
.guide-stat-label { font-size: 9px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin-top: 3px; }

/* ── MOBILE FLOATING BUTTON ── */
.guide-fab {
  display: none;
  position: fixed; bottom: 24px; right: 24px; z-index: 500;
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--gold); color: var(--bg);
  border: none; cursor: pointer;
  font-size: 22px; box-shadow: 0 4px 20px rgba(200,169,110,0.4);
  align-items: center; justify-content: center;
  transition: transform .15s;
}
.guide-fab:hover { transform: scale(1.08); }

.guide-modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 600;
  background: rgba(0,0,0,0.75);
  align-items: flex-end; justify-content: center;
  padding: 0;
}
.guide-modal-overlay.open { display: flex; }
.guide-modal {
  background: var(--surface); width: 100%; max-height: 85vh;
  overflow-y: auto; border-radius: 16px 16px 0 0;
  padding: 24px 20px;
  border-top: 2px solid var(--gold);
}
.guide-modal-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 20px;
}
.guide-modal-title {
  font-family: 'Playfair Display', serif;
  font-size: 18px; font-weight: 700; color: var(--text);
}
.guide-modal-close {
  background: var(--surface2); border: none; color: var(--text);
  width: 32px; height: 32px; border-radius: 50%; cursor: pointer;
  font-size: 16px; display: flex; align-items: center; justify-content: center;
}

/* ── RESPONSIVE ── */
/* Pantalla grande — 3 columnas */
@media (min-width: 960px) {
  .guide-fab { display: none !important; }
  .guide-modal-overlay { display: none !important; }
}

/* Pantalla mediana — solo columna izquierda + feed */
@media (max-width: 959px) and (min-width: 601px) {
  .feed-layout {
    grid-template-columns: 160px minmax(0, 520px);
    max-width: 720px;
  }
  .guide-right { display: none; }
  .guide-fab { display: none !important; }
}

/* Móvil — solo feed + burbuja */
@media (max-width: 600px) {
  .feed-layout {
    grid-template-columns: 1fr;
    padding: 0 0.5rem;
  }
  .guide-panel { display: none; }
  .guide-fab { display: flex; }
  .bb-intel-cta { max-width: 100%; padding: 0 0.5rem 20px; }
}

/* ── INTEL BAR ── */
.bb-intel-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 2rem;
  max-width: 960px;
  margin: 0 auto;
  width: 100%;
  background: rgba(200,169,110,0.06);
  border-bottom: 1px solid rgba(200,169,110,0.15);
  border-top: 1px solid rgba(200,169,110,0.08);
  position: sticky; top: 62px; z-index: 100;
  backdrop-filter: blur(10px);
}
.bb-intel-bar-left { display: flex; align-items: center; gap: 10px; }
.bb-intel-bar-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--gold); flex-shrink: 0;
  animation: pulse 2s ease-in-out infinite;
}
.bb-intel-bar-label {
  font-size: 12px; font-weight: 700; color: var(--gold);
  letter-spacing: 0.04em;
}
.bb-intel-bar-desc {
  font-size: 11px; color: var(--muted);
}
.bb-intel-bar-btn {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 7px 18px;
  background: transparent; color: var(--gold);
  border: 1px solid rgba(200,169,110,0.35);
  cursor: pointer; transition: all .15s;
}
.bb-intel-bar-btn:hover {
  background: rgba(200,169,110,0.12);
  border-color: var(--gold);
}
@media (max-width: 600px) {
  .bb-intel-bar-desc { display: none; }
  .bb-intel-bar { padding: 10px 1rem; }
}