/* ══════════════════════════════════════════════════════════════
   Reddit War Room — Executive Command Center & Glass Design
   ══════════════════════════════════════════════════════════════ */

.rw-page {
  padding: 12px 6px 48px;
  max-width: 1400px;
  margin: 0 auto;
  font-family: inherit;
}

/* ── STRICT SVG ICON SIZE ENFORCEMENT (Prevents Giant SVGs) ── */
#page-reddit-intel svg,
.rw-page svg {
  display: inline-block !important;
  vertical-align: middle !important;
  max-width: none;
}

.rw-hero-badge svg {
  width: 14px !important;
  height: 14px !important;
  min-width: 14px !important;
  min-height: 14px !important;
  max-width: 14px !important;
  max-height: 14px !important;
  flex-shrink: 0 !important;
}

.rw-btn svg {
  width: 15px !important;
  height: 15px !important;
  min-width: 15px !important;
  min-height: 15px !important;
  max-width: 15px !important;
  max-height: 15px !important;
  flex-shrink: 0 !important;
}

.rw-stat-icon {
  width: 22px !important;
  height: 22px !important;
  min-width: 22px !important;
  min-height: 22px !important;
  max-width: 22px !important;
  max-height: 22px !important;
  flex-shrink: 0 !important;
}

.rw-search-icon {
  width: 16px !important;
  height: 16px !important;
  min-width: 16px !important;
  min-height: 16px !important;
  max-width: 16px !important;
  max-height: 16px !important;
  flex-shrink: 0 !important;
  position: absolute !important;
  left: 14px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  color: #94a3b8 !important;
  pointer-events: none !important;
}

.rw-tab-icon {
  width: 16px !important;
  height: 16px !important;
  min-width: 16px !important;
  min-height: 16px !important;
  max-width: 16px !important;
  max-height: 16px !important;
  flex-shrink: 0 !important;
}

.rw-card-header svg,
.rw-sol-head svg,
.rw-filter-group svg {
  width: 16px !important;
  height: 16px !important;
  min-width: 16px !important;
  min-height: 16px !important;
  max-width: 16px !important;
  max-height: 16px !important;
  flex-shrink: 0 !important;
}

/* ── Hero Command Header (Dark Navy Executive Style) ───────── */
.rw-hero-header {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  padding: 24px 28px;
  margin-bottom: 22px;
  box-shadow: 0 16px 36px -10px rgba(15, 23, 42, 0.3);
  color: #ffffff;
}
.rw-hero-header::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, #3aafd8, #b83278, #10b981);
}
.rw-hero-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}
.rw-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #3aafd8;
  background: rgba(58, 175, 216, 0.14);
  border: 1px solid rgba(58, 175, 216, 0.3);
  padding: 5px 14px;
  border-radius: 999px;
  margin-bottom: 10px;
}
.rw-hero-title {
  font-size: 26px;
  font-weight: 850;
  margin: 0 0 6px;
  letter-spacing: -0.02em;
  color: #ffffff !important;
  line-height: 1.2;
}
.rw-hero-subtitle {
  font-size: 13.5px;
  color: #94a3b8 !important;
  margin: 0;
  max-width: 700px;
  line-height: 1.55;
}
.rw-hero-status {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}
@media (max-width: 768px) {
  .rw-hero-status { align-items: flex-start; }
}
.rw-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* ── Live Scrape Radar Badge ───────────────────────────────── */
.rw-live {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.01em;
  color: #cbd5e1;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
}
.rw-live .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #94a3b8;
  transition: background 0.3s ease;
}
.rw-live.is-live .dot {
  background: #10b981;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.25);
  animation: rw-pulse 1.6s ease-in-out infinite;
}
@keyframes rw-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

/* ── Buttons ───────────────────────────────────────────────── */
.rw-btn {
  border: 0;
  border-radius: 12px;
  padding: 9px 18px;
  min-height: 42px;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
  letter-spacing: 0.01em;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, #3aafd8, #2e97be);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(58, 175, 216, 0.35);
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}
.rw-btn:hover {
  background: linear-gradient(135deg, #2e97be, #227b9c);
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(58, 175, 216, 0.45);
}
.rw-btn:active { transform: translateY(0); }
.rw-btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; }

.rw-hero-header .rw-btn.secondary {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: none;
}
.rw-hero-header .rw-btn.secondary:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
}

.rw-btn.secondary {
  background: var(--card, #ffffff);
  color: var(--text, #0f172a);
  border: 1px solid var(--card-border, #e2e8f0);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}
.rw-btn.secondary:hover {
  border-color: #3aafd8;
  color: #3aafd8;
  box-shadow: 0 4px 14px rgba(58, 175, 216, 0.16);
}
.rw-btn.text-btn {
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
  box-shadow: none;
  padding: 8px 14px;
  min-height: 40px;
}
.rw-btn.text-btn:hover {
  color: #0f172a;
  background: #e2e8f0;
  border-color: #94a3b8;
}
[data-theme="dark"] .rw-btn.text-btn {
  background: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
  border-color: rgba(255, 255, 255, 0.2);
}

/* ── Interactive Stat Tiles Grid ───────────────────────────── */
.rw-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
}
.rw-stat {
  position: relative;
  overflow: hidden;
  background: var(--card, #ffffff);
  border: 1px solid var(--card-border, #e2e8f0);
  border-radius: 16px;
  padding: 16px 18px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}
.rw-stat::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0; width: 4px;
  background: #3aafd8;
  border-radius: 4px 0 0 4px;
}
.rw-stat.pos::before { background: #10b981; }
.rw-stat.neg::before { background: #ef4444; }
.rw-stat.neu::before { background: #64748b; }
.rw-stat.ym::before { background: #b83278; }
.rw-stat.comp::before { background: #8b5cf6; }
.rw-stat.alert::before { background: #f59e0b; }

.rw-stat:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
  border-color: #3aafd8;
}
.rw-stat.active-filter {
  border-color: #3aafd8;
  box-shadow: 0 0 0 3px rgba(58, 175, 216, 0.25);
  background: rgba(58, 175, 216, 0.06);
}
.rw-stat .k-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.rw-stat .k {
  font-size: 11px;
  font-weight: 800;
  color: #64748b;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.rw-stat .v {
  font-size: 30px;
  font-weight: 850;
  margin: 8px 0 2px;
  letter-spacing: -0.02em;
  line-height: 1;
  color: #0f172a;
}
.rw-stat.pos .v { color: #059669; }
.rw-stat.neg .v { color: #dc2626; }
.rw-stat.alert .v { color: #d97706; }
.rw-stat .sub-k {
  font-size: 11px;
  color: #64748b;
  opacity: 0.85;
}

/* ── Filter & Search Toolbar ───────────────────────────────── */
.rw-toolbar-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: var(--card, #ffffff);
  border: 1px solid var(--card-border, #e2e8f0);
  border-radius: 16px;
  padding: 14px 20px;
  margin-bottom: 20px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
}
.rw-search-box {
  position: relative;
  flex: 1;
  min-width: 260px;
}
.rw-search-box input {
  width: 100%;
  border: 1px solid #cbd5e1;
  background: var(--card, #ffffff);
  border-radius: 12px;
  padding: 10px 36px 10px 42px !important;
  font: inherit;
  font-size: 13.5px;
  color: #0f172a;
  min-height: 42px;
  transition: all 0.15s ease;
}
.rw-search-box input:focus {
  outline: none;
  border-color: #3aafd8;
  box-shadow: 0 0 0 3px rgba(58, 175, 216, 0.18);
}
.rw-search-clear {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: 0;
  font-size: 16px;
  color: #94a3b8;
  cursor: pointer;
  padding: 2px;
}
.rw-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}
.rw-filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
}
.rw-filter-group label {
  font-size: 12px;
  font-weight: 750;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 5px;
}
.rw-filters select {
  border: 1px solid #cbd5e1;
  background: var(--card, #ffffff);
  border-radius: 11px;
  padding: 8px 14px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
  min-height: 40px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.rw-filters select:hover { border-color: #3aafd8; }
.rw-filters select:focus { outline: none; border-color: #3aafd8; box-shadow: 0 0 0 3px rgba(58, 175, 216, 0.16); }

/* ── Segmented Tab Navigation ──────────────────────────────── */
.rw-tabs-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 22px;
  border-bottom: 2px solid #e2e8f0;
}
.rw-tab-btn {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 10px 18px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 750;
  color: #64748b;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.18s ease;
}
.rw-tab-btn:hover {
  color: #0f172a;
  background: rgba(148, 163, 184, 0.12);
}
.rw-tab-btn.active {
  background: linear-gradient(135deg, #3aafd8, #2e97be);
  color: #ffffff !important;
  font-weight: 800;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(58, 175, 216, 0.35);
}
.rw-tab-btn.active .rw-tab-icon {
  color: #ffffff !important;
}

.rw-tab-panel { display: none; }
.rw-tab-panel.active {
  display: block;
  animation: rw-fade-in 0.22s ease-out;
}
@keyframes rw-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Cards Layout ──────────────────────────────────────────── */
.rw-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
@media (max-width: 980px) {
  .rw-grid { grid-template-columns: 1fr; }
}
.rw-card {
  background: var(--card, #ffffff);
  border: 1px solid var(--card-border, #e2e8f0);
  border-radius: 18px;
  padding: 22px;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.05);
}
.rw-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.rw-card h3 {
  font-size: 15px;
  font-weight: 800;
  margin: 0;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #0f172a;
}

/* ── Heatmap Grid ─────────────────────────────────────────── */
.rw-heat {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(20px, 1fr));
  gap: 6px;
  max-width: 100%;
}
.rw-heat-cell {
  width: 100%;
  aspect-ratio: 1;
  min-height: 20px;
  max-height: 28px;
  border-radius: 5px;
  background: rgba(148, 163, 184, 0.16);
  cursor: pointer;
  border: 0;
  padding: 0;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}
.rw-heat-cell:hover {
  transform: scale(1.28);
  box-shadow: 0 0 0 2px #3aafd8;
  z-index: 5;
}
.rw-heat-cell.is-on {
  box-shadow: 0 0 0 3px #b83278;
  transform: scale(1.18);
}
.rw-heat-legend {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 11.5px;
  color: #64748b;
  flex-wrap: wrap;
}
.rw-heat-legend i {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  display: inline-block;
}
.rw-chart-wrap {
  height: 260px;
  position: relative;
}

/* ── Mention Feed Rows ─────────────────────────────────────── */
.rw-feed {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.rw-row {
  position: relative;
  display: grid;
  grid-template-columns: 110px 1fr auto;
  gap: 16px;
  align-items: start;
  padding: 16px 18px;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  cursor: pointer;
  text-align: left;
  transition: all 0.16s cubic-bezier(0.16, 1, 0.3, 1);
}
.rw-row::before {
  content: "";
  position: absolute;
  left: 0; top: 12px; bottom: 12px; width: 4px;
  border-radius: 4px;
  background: #94a3b8;
}
.rw-row:has(.rw-badge.positive)::before { background: #10b981; }
.rw-row:has(.rw-badge.negative)::before { background: #ef4444; }
.rw-row:has(.rw-badge.mixed)::before { background: #f59e0b; }
.rw-row:hover {
  transform: translateY(-2px);
  border-color: #3aafd8;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}
.rw-badge {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  display: inline-block;
  white-space: nowrap;
}
.rw-badge.positive { background: #d1fae5; color: #065f46; }
.rw-badge.negative { background: #fee2e2; color: #991b1b; }
.rw-badge.neutral { background: #e2e8f0; color: #334155; }
.rw-badge.mixed { background: #fef3c7; color: #92400e; }
.rw-badge.P0, .rw-badge.P1 { background: #ffe4e6; color: #9f1239; }
.rw-badge.P2 { background: #ede9fe; color: #5b21b6; }
.rw-badge.P3 { background: #e2e8f0; color: #475569; }

.rw-row h4 {
  font-size: 14px;
  font-weight: 750;
  margin: 0 0 6px;
  line-height: 1.4;
  color: #0f172a;
}
.rw-row p {
  font-size: 12.5px;
  color: #64748b;
  margin: 0;
  line-height: 1.55;
}
.rw-meta {
  font-size: 11.5px;
  color: #64748b;
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.rw-row a {
  align-self: center;
  font-size: 12px;
  font-weight: 750;
  color: #3aafd8;
  text-decoration: none;
  padding: 7px 14px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  white-space: nowrap;
  transition: all 0.15s ease;
}
.rw-row a:hover {
  background: #3aafd8;
  color: #ffffff !important;
  border-color: #3aafd8;
}

/* ── Content Priorities & Solutions ─────────────────────────── */
.rw-kwt-scroll { overflow-x: auto; border-radius: 14px; }
.rw-kwt { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 800px; }
.rw-kwt thead th {
  font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em;
  color: #64748b; text-align: left; padding: 10px 14px; border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}
.rw-kwt tbody td { padding: 14px; border-bottom: 1px solid #e2e8f0; vertical-align: top; }
.rw-kwt tbody tr:hover { background: rgba(58, 175, 216, 0.05); }

#rw-solutions {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 14px;
}
.rw-sol {
  position: relative;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 18px;
  background: #ffffff;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
  transition: all 0.18s ease;
}
.rw-sol::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: #94a3b8;
}
.rw-sol-P0::before, .rw-sol-P1::before { background: linear-gradient(180deg, #ef4444, #b91c1c); }
.rw-sol-P2::before { background: linear-gradient(180deg, #8b5cf6, #6d28d9); }
.rw-sol-P3::before { background: linear-gradient(180deg, #f59e0b, #d97706); }
.rw-sol:hover { transform: translateY(-3px); box-shadow: 0 14px 28px rgba(15, 23, 42, 0.1); }

/* ── Qualitative & Matrix ──────────────────────────────────── */
/* "How to read this" legend for the severity matrix */
.rw-legend { margin: 6px 0 14px; border: 1px solid var(--card-border, #e2e8f0); border-radius: 10px; background: rgba(58,175,216,.05); overflow: hidden; }
.rw-legend > summary { cursor: pointer; padding: 9px 13px; font-size: 12.5px; font-weight: 800; color: var(--blue, #3AAFD8); list-style: none; display: flex; align-items: center; gap: 6px; }
.rw-legend > summary::-webkit-details-marker { display: none; }
.rw-legend > summary::after { content: '▸'; margin-left: auto; transition: transform .18s ease; font-size: 11px; }
.rw-legend[open] > summary::after { transform: rotate(90deg); }
.rw-legend[open] > summary { border-bottom: 1px solid var(--card-border, #e2e8f0); }
.rw-legend-body { padding: 11px 14px 12px; font-size: 12px; color: var(--muted, #64748b); line-height: 1.55; }
.rw-legend-body .lg-lead { margin: 0 0 9px; color: var(--text, #0f172a); }
.rw-legend-body ul { margin: 0; padding-left: 16px; }
.rw-legend-body li { margin-bottom: 5px; }
.rw-legend-body b { color: var(--text, #0f172a); }
.lg-b { display: inline-block; font-size: 10px; font-weight: 800; padding: 1px 8px; border-radius: 999px; margin: 0 1px; }
[data-theme="dark"] .rw-legend { background: rgba(58,175,216,.08); }

.rw-sortby { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; color: #64748b; white-space: nowrap; }
[data-theme="dark"] .rw-sortby { color: #94a3b8; }
.rw-age { font-weight: 600; }
.rw-qual-days {
  border: 1px solid #cbd5e1; background: #ffffff;
  border-radius: 11px; padding: 7px 12px; font: inherit; font-size: 12.5px; font-weight: 600;
  color: #0f172a; cursor: pointer; min-height: 36px;
}
.rw-qual-totals { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.rw-qual-totals span {
  font-size: 12.5px; color: #64748b; padding: 6px 14px; border-radius: 999px;
  background: #f1f5f9; border: 1px solid #e2e8f0;
}

/* ── Drawer & Log ──────────────────────────────────────────── */
.rw-empty {
  color: #64748b; font-size: 13.5px; padding: 36px 20px; text-align: center;
  line-height: 1.6; border: 1px dashed #cbd5e1; border-radius: 14px;
  background: #f8fafc;
}
.rw-log { font-size: 12.5px; color: #64748b; max-height: 220px; overflow-y: auto; }
.rw-log div { padding: 8px 0; border-bottom: 1px solid #e2e8f0; }

.rw-drawer {
  position: fixed; inset: 0; background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  z-index: 100; display: none; justify-content: flex-end;
  opacity: 0; transition: opacity 0.22s ease;
}
.rw-drawer.open { display: flex; opacity: 1; }
.rw-drawer-panel {
  width: min(580px, 100%); height: 100%; background: #ffffff; overflow-y: auto;
  padding: 28px; box-shadow: -16px 0 48px rgba(15, 23, 42, 0.25);
  transform: translateX(30px); transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}
.rw-drawer.open .rw-drawer-panel { transform: translateX(0); }

/* ── Dark Mode Overrides ───────────────────────────────────── */
[data-theme="dark"] .rw-toolbar-card,
[data-theme="dark"] .rw-card,
[data-theme="dark"] .rw-stat,
[data-theme="dark"] .rw-sol,
[data-theme="dark"] .rw-row {
  background: #0f172a;
  border-color: rgba(255, 255, 255, 0.12);
  color: #f8fafc;
}
[data-theme="dark"] .rw-search-box input,
[data-theme="dark"] .rw-filters select,
[data-theme="dark"] .rw-qual-days {
  background: #1e293b;
  border-color: rgba(255, 255, 255, 0.16);
  color: #f8fafc;
}
[data-theme="dark"] .rw-drawer-panel { background: #0f172a; color: #e2e8f0; }
[data-theme="dark"] .rw-tabs-nav { border-bottom-color: rgba(255, 255, 255, 0.12); }
[data-theme="dark"] .rw-tab-btn { color: #94a3b8; }
[data-theme="dark"] .rw-tab-btn:hover { color: #ffffff; background: rgba(255, 255, 255, 0.08); }

/* ══════════════════════════════════════════════════════════════
   INNER COMPONENTS — panel headers, solution cards, priorities
   table, severity matrix, action cards, keyword & thread lists.
   (Restores styling the shell CSS didn't cover.)
   ══════════════════════════════════════════════════════════════ */

/* Panel headers (title + day selector) */
.rw-sol-head { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.rw-sol-head > select, .rw-sol-head .rw-qual-days { margin-left: auto; }
.rw-sol-head h3 { font-size: 15px; font-weight: 800; color: #0f172a; }

/* Solution cards */
.rw-sol-top { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 10px; }
.rw-sol-top h4 { font-size: 14px; font-weight: 800; margin: 0; flex: 1; min-width: 120px; color: #0f172a; }
.rw-sol-badge { font-size: 9.5px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; }
.rw-sol-badge.P0, .rw-sol-badge.P1 { background: #fee2e2; color: #991b1b; }
.rw-sol-badge.P2 { background: #ede9fe; color: #5b21b6; }
.rw-sol-badge.P3 { background: #fef3c7; color: #92400e; }
.rw-sol-count { font-size: 11px; font-weight: 700; color: #64748b; }
.rw-sol-fix { font-size: 12.5px; line-height: 1.55; color: #0f172a; margin-bottom: 12px; }
.rw-sol-fix-label { display: inline-block; font-size: 9.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #fff; background: #3aafd8; padding: 2px 8px; border-radius: 6px; margin-right: 6px; vertical-align: middle; }
.rw-sol-meta { display: flex; flex-direction: column; gap: 8px; }
.rw-owner-pill { align-self: flex-start; font-size: 11px; font-weight: 700; color: #0f172a; background: rgba(58,175,216,.12); border: 1px solid rgba(58,175,216,.25); padding: 4px 11px; border-radius: 999px; }
.rw-sol-exwrap { display: flex; flex-direction: column; gap: 5px; }
.rw-sol-ex { font-size: 11.5px; color: #64748b; text-decoration: none; padding: 5px 9px; border-radius: 8px; background: #f1f5f9; border: 1px solid #e2e8f0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: all .13s ease; }
.rw-sol-ex:hover { color: #3aafd8; border-color: #3aafd8; }
.rw-sol-reply { margin-top: 12px; width: 100%; }

/* Content & PR priorities table cells */
.rw-pri { display: inline-block; font-size: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.rw-pri-High { background: #fee2e2; color: #991b1b; }
.rw-pri-Medium { background: #fef3c7; color: #92400e; }
.rw-pri-Low { background: #dcfce7; color: #166534; }
.rw-kwt-theme { font-weight: 800; color: #0f172a; white-space: nowrap; }
.rw-kwt-src { display: block; font-size: 10.5px; font-weight: 600; color: #3aafd8; text-decoration: none; margin-top: 3px; }
.rw-kwt-src:hover { text-decoration: underline; }
.rw-kwt-num { font-weight: 800; color: #0f172a; text-align: center; font-variant-numeric: tabular-nums; }
.rw-kwt-sent { min-width: 130px; }
.rw-kwt-bar { display: flex; height: 8px; border-radius: 999px; overflow: hidden; background: rgba(148,163,184,.18); }
.rw-kwt-seg { height: 100%; display: block; }
.rw-kwt-seg.neg { background: #ef4444; }
.rw-kwt-seg.mix { background: #f59e0b; }
.rw-kwt-seg.neu { background: #94a3b8; }
.rw-kwt-seg.pos { background: #10b981; }
.rw-kwt-counts { display: block; font-size: 10.5px; color: #64748b; margin-top: 4px; font-weight: 700; }
.rw-kwt-action { color: #0f172a; line-height: 1.5; min-width: 260px; }
.rw-kwt .rw-owner-pill { white-space: nowrap; }

/* Severity matrix + qualitative report */
.rw-matrix-scroll { overflow-x: auto; border-radius: 12px; }
.rw-matrix { width: 100%; border-collapse: separate; border-spacing: 4px; font-size: 12px; }
.rw-matrix th { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: #64748b; padding: 6px 4px; text-align: center; white-space: nowrap; }
.rw-matrix th:first-child { text-align: left; }
.rw-matrix-label { font-size: 12px; font-weight: 700; color: #0f172a; white-space: nowrap; padding-right: 12px; text-align: left; }
.rw-matrix-count { font-size: 10px; font-weight: 800; color: #64748b; background: #f1f5f9; padding: 1px 7px; border-radius: 999px; margin-left: 4px; }
.rw-cell { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; height: 30px; border-radius: 8px; font-weight: 800; font-size: 12px; }
.rw-qual-h { font-size: 12.5px; font-weight: 800; margin: 22px 0 10px; color: #0f172a; }
.rw-qual-list { margin: 0; padding-left: 18px; }
.rw-qual-list li { font-size: 12.5px; color: #64748b; line-height: 1.55; margin-bottom: 7px; }
.rw-qual-totals b { color: #0f172a; font-weight: 800; }
.rw-qual-totals .pos b { color: #059669; }
.rw-qual-totals .neg b { color: #dc2626; }
.rw-kw-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.rw-kw { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 11px; border: 1px solid #e2e8f0; background: #f8fafc; }
.rw-kw-n { font-size: 15px; font-weight: 850; color: #3aafd8; min-width: 26px; text-align: center; }
.rw-kw-t { font-size: 11.5px; color: #64748b; line-height: 1.3; }
.rw-thread-list { display: flex; flex-direction: column; gap: 7px; }
.rw-thread { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-radius: 11px; border: 1px solid #e2e8f0; background: #f8fafc; text-decoration: none; transition: all .14s ease; }
.rw-thread span { font-size: 12.5px; color: #0f172a; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rw-thread em { font-size: 12px; font-weight: 800; color: #059669; font-style: normal; white-space: nowrap; }
.rw-thread:hover { border-color: #3aafd8; transform: translateX(2px); }

/* Brand action recommendation cards */
.rw-actions { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.rw-action { border: 1px solid #e2e8f0; border-radius: 14px; padding: 16px; background: #ffffff; transition: all .12s ease; }
.rw-action:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(15,23,42,.1); }
.rw-action h4 { margin: 0 0 8px; font-size: 13.5px; font-weight: 800; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: #0f172a; }
.rw-action p { margin: 0 0 12px; font-size: 12px; color: #64748b; line-height: 1.5; }
.rw-action .row { display: flex; gap: 8px; flex-wrap: wrap; }
.rw-action .rw-btn { padding: 7px 12px; min-height: 34px; font-size: 12px; }
.rw-action-src { display: inline-block; margin: 4px 0 2px; font-size: 11.5px; font-weight: 700; color: #3aafd8; text-decoration: none; padding: 5px 10px; border-radius: 8px; background: rgba(58,175,216,.1); border: 1px solid rgba(58,175,216,.22); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: all .13s ease; }
.rw-action-src:hover { background: #3aafd8; color: #fff; border-color: #3aafd8; }

/* Stats update flash */
.rw-stats.rw-updated { animation: rw-stats-flash .85s ease; border-radius: 16px; }
@keyframes rw-stats-flash { 0% { box-shadow: 0 0 0 3px rgba(58,175,216,.45); } 60% { box-shadow: 0 0 0 3px rgba(58,175,216,.18); } 100% { box-shadow: 0 0 0 0 rgba(58,175,216,0); } }
.rw-stats.rw-updated .rw-stat .v { animation: rw-num-pop .5s ease; }
@keyframes rw-num-pop { 0% { transform: scale(1); } 40% { transform: scale(1.08); } 100% { transform: scale(1); } }

/* Dark mode — inner components */
[data-theme="dark"] .rw-sol-head h3,
[data-theme="dark"] .rw-sol-top h4,
[data-theme="dark"] .rw-kwt-theme,
[data-theme="dark"] .rw-kwt-num,
[data-theme="dark"] .rw-kwt-action,
[data-theme="dark"] .rw-matrix-label,
[data-theme="dark"] .rw-qual-h,
[data-theme="dark"] .rw-action h4,
[data-theme="dark"] .rw-thread span,
[data-theme="dark"] .rw-sol-fix,
[data-theme="dark"] .rw-owner-pill { color: #f8fafc; }
[data-theme="dark"] .rw-action,
[data-theme="dark"] .rw-kw,
[data-theme="dark"] .rw-thread,
[data-theme="dark"] .rw-sol-ex { background: rgba(15,23,42,.55); border-color: rgba(255,255,255,.12); }
[data-theme="dark"] .rw-pri-High { background: rgba(239,68,68,.2); color: #fca5a5; }
[data-theme="dark"] .rw-pri-Medium { background: rgba(245,158,11,.2); color: #fcd34d; }
[data-theme="dark"] .rw-pri-Low { background: rgba(16,185,129,.2); color: #6ee7b7; }

/* ══════════════════════════════════════════════════════════════
   MOBILE — phone-friendly Reddit Analysis (≤768px)
   Compact hero, 2-col stat tiles, stacked toolbar, small scrollable
   tabs, single-column cards, stacked feed rows.
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .rw-page { padding: 4px 2px 22px; }

  /* Hero — very slim; drop the long subtitle on phones */
  .rw-hero-header { padding: 12px 12px; border-radius: 12px; margin-bottom: 10px; }
  .rw-hero-header::before { height: 3px; }
  .rw-hero-main { flex-direction: column; align-items: stretch; gap: 9px; margin-bottom: 10px; }
  .rw-hero-badge { font-size: 9px; padding: 3px 9px; margin-bottom: 5px; }
  .rw-hero-badge { display: none; }
  .rw-hero-title { font-size: 17px; margin: 0 0 2px; }
  .rw-hero-subtitle { display: none; }
  .rw-hero-status { align-items: stretch; width: 100%; gap: 8px; }
  .rw-live { justify-content: center; font-size: 10.5px; padding: 6px 12px; }
  .rw-hero-actions { width: 100%; flex-wrap: wrap; gap: 7px; }
  .rw-hero-actions .rw-btn { flex: 1 1 45%; justify-content: center; min-height: 32px; padding: 6px 8px; font-size: 11px; }
  #page-reddit-intel .rw-btn svg { width: 13px !important; height: 13px !important; }

  /* Stat tiles — compact 3-per-row grid; all 7 visible, NO horizontal scroll */
  .rw-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 9px; }
  .rw-stat { min-width: 0; padding: 8px 8px; border-radius: 10px; }
  .rw-stat::before { width: 3px; }
  .rw-stat .k-wrap { gap: 3px; }
  .rw-stat .k { font-size: 8px; letter-spacing: .01em; line-height: 1.15; }
  .rw-stat .v { font-size: 16px; margin: 3px 0 0; }
  .rw-stat .sub-k { display: none; }
  #page-reddit-intel .rw-stat-icon { display: none !important; }

  /* Toolbar — compact stacked search + filters */
  .rw-toolbar-card { flex-direction: column; align-items: stretch; gap: 7px; padding: 9px 10px; border-radius: 12px; margin-bottom: 10px; }
  .rw-search-box { min-width: 0; width: 100%; }
  .rw-search-box input { min-height: 38px; padding: 8px 32px 8px 38px !important; font-size: 13px; }
  .rw-filters { width: 100%; gap: 6px; flex-wrap: wrap; }
  .rw-filter-group { flex: 1 1 30%; min-width: 92px; }
  .rw-filter-group label { display: none; }
  .rw-filters select { width: 100%; min-width: 0; min-height: 34px; padding: 6px 8px; font-size: 12px; }
  .rw-btn.text-btn { flex: 1 1 100%; min-height: 32px; font-size: 12px; }

  /* Tabs — small, tight, single-row scroll, no icons */
  .rw-tabs-nav { gap: 4px; margin-bottom: 10px; padding-bottom: 5px; }
  .rw-tab-btn { padding: 6px 10px; font-size: 12px; border-radius: 9px; }
  #page-reddit-intel .rw-tab-icon { display: none !important; }

  /* Cards + charts — tight */
  .rw-card { padding: 12px 11px; border-radius: 12px; }
  .rw-card-header { flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
  .rw-card h3 { font-size: 13.5px; line-height: 1.3; }
  /* drop the decorative right-side header pill on mobile (it was clipping) */
  .rw-card-header .rw-badge { display: none; }
  .rw-chart-wrap { height: 180px; }
  /* tidier, tighter heatmap */
  .rw-heat { gap: 4px; }
  .rw-heat-cell { min-height: 15px; max-height: 18px; border-radius: 4px; }
  .rw-heat-legend { font-size: 10px; gap: 5px; }
  .rw-grid { grid-template-columns: 1fr; gap: 10px; }
  #rw-solutions { grid-template-columns: 1fr; gap: 10px; }
  .rw-actions { grid-template-columns: 1fr; gap: 10px; }
  .rw-sol-head { flex-direction: column; align-items: stretch; gap: 8px; }
  .rw-sol-head > select, .rw-sol-head .rw-qual-days { margin-left: 0; }

  /* Feed rows — tight, stacked, full-width Open button */
  .rw-feed { gap: 8px; }
  .rw-row { grid-template-columns: auto 1fr; gap: 9px; padding: 10px 11px 10px 14px; border-radius: 12px; }
  .rw-row h4 { font-size: 13px; margin: 0 0 3px; }
  .rw-row p { font-size: 11.5px; line-height: 1.45; }
  .rw-meta { font-size: 10.5px; margin-top: 6px; gap: 5px; }
  .rw-badge { font-size: 9px; padding: 3px 8px; }
  .rw-row > a { grid-column: 1 / -1; justify-self: stretch; text-align: center; margin-top: 5px; padding: 8px; font-size: 12px; }

  /* Tables → stacked cards on mobile (NO horizontal scroll) */
  .rw-kwt-scroll, .rw-matrix-scroll { overflow-x: visible; }
  .rw-kwt, .rw-matrix { min-width: 0; width: 100%; border-spacing: 0; display: block; font-size: 12.5px; }
  .rw-kwt thead, .rw-matrix thead { display: none; }
  .rw-kwt tbody, .rw-matrix tbody { display: block; }
  .rw-kwt tr, .rw-matrix tr {
    display: block; border: 1px solid var(--card-border, #e2e8f0); border-radius: 12px;
    padding: 10px 12px; margin-bottom: 8px; background: var(--card, #fff);
  }
  .rw-kwt td, .rw-matrix td {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 4px 0; border: 0; text-align: left;
  }
  /* per-row label pulled from data-c (priorities) or data-dim (matrix) */
  .rw-kwt td[data-c]::before, .rw-matrix td[data-dim]::before {
    content: attr(data-c) attr(data-dim);
    font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .03em;
    color: #64748b; flex: 0 0 auto;
  }
  /* theme + cluster name become the card title (full width, no label) */
  .rw-kwt td.rw-kwt-theme, .rw-matrix td.rw-matrix-label {
    display: block; font-size: 13.5px; font-weight: 800; padding: 0 0 8px; margin-bottom: 6px;
    border-bottom: 1px solid rgba(148,163,184,.22); white-space: normal;
  }
  .rw-kwt td.rw-kwt-action { flex-direction: column; align-items: flex-start; gap: 3px; }
  .rw-kwt-sent { min-width: 0; }
  .rw-kwt-bar { flex: 1; max-width: 150px; }
  .rw-cell { min-width: 44px; height: 24px; }
  [data-theme="dark"] .rw-kwt tr, [data-theme="dark"] .rw-matrix tr { background: rgba(15,23,42,.55); }

  /* Severity matrix ONLY: compact 3-per-row square grid per cluster (not tall rows) */
  .rw-matrix tr { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; align-items: stretch; }
  .rw-matrix td.rw-matrix-label { grid-column: 1 / -1; }
  .rw-matrix td[data-dim] {
    flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    padding: 7px 4px; background: rgba(148,163,184,.08); border-radius: 8px; text-align: center;
  }
  .rw-matrix td[data-dim]::before { font-size: 8.5px; text-align: center; line-height: 1.1; }
  .rw-matrix .rw-cell { width: 100%; min-width: 0; height: 22px; }
  [data-theme="dark"] .rw-matrix td[data-dim] { background: rgba(148,163,184,.14); }

  /* Sort control */
  .rw-sortby { width: 100%; justify-content: space-between; font-size: 11.5px; }
  .rw-sortby select { flex: 1; min-height: 34px; }

  /* Drawer */
  .rw-drawer-panel { width: 100%; padding: 15px; }
}

@media (max-width: 400px) {
  .rw-hero-title { font-size: 16px; }
  .rw-hero-actions .rw-btn { font-size: 11.5px; padding: 7px 7px; }
  .rw-tab-btn { padding: 6px 9px; font-size: 11.5px; }
  .rw-stat { padding: 8px 9px; }
  .rw-stat .v { font-size: 17px; }
  .rw-stat .k { font-size: 8px; }
}
