/**
 * Conversense Dashboard - Polished Card System
 * Based on old Conversense pilot growth UI (dashboard-cards.css)
 * Uses UIKit as base, with refined overrides.
 */

/* ==========================================================================
   CSS Variables
   ========================================================================== */
:root {
  /* Category colors (from old Conversense) */
  --card-operational: #0077B5;
  --card-activity: #17a2b8;
  --card-engagement: #f0ad4e;
  --card-prospects: #6f42c1;
  --card-insights: #6c5ce7;
  --card-control-active: #28a745;

  /* Base palette */
  --primary-color: #0077B5;
  --secondary-color: #00A0DC;
  --accent-color: #0073B1;
  --light-bg: #F5F7FA;
  --dark-text: #283E4A;
  --light-text: #F5F7FA;
  --card-bg: #FFFFFF;
  --border-radius: 12px;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  --shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.12);
  --transition: all 0.3s ease;

  /* Text */
  --card-title-color: #283E4A;
  --card-text-color: #566573;
  --card-text-muted: #8e9aaf;

  /* Actions */
  --action-primary-bg: #0077B5;
  --action-secondary-bg: #f0f2f5;
  --action-secondary-hover: #e4e6e9;

  /* Campaign accent colors */
  --campaign-0: #0077B5;
  --campaign-1: #e83e8c;
  --campaign-2: #28a745;
}

/* ==========================================================================
   Global
   ========================================================================== */
/* ==========================================================================
   Global
   ========================================================================== */
html, body {
  overscroll-behavior: none;
}

body {
  background-color: var(--light-bg);
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--dark-text);
  -webkit-tap-highlight-color: transparent;
}

/* ==========================================================================
   Top Bar (Dashboard)
   ========================================================================== */
.top-bar {
  background-color: var(--card-bg);
  color: var(--primary-color);
  display: flex;
  justify-content: center;
  padding: 0;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.top-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1400px;
  width: 100%;
  padding: 10px 24px;
}

.top-bar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  text-decoration: none;
}

.top-bar-logo .logo-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  object-fit: contain;
  display: block;
  transition: transform 0.2s ease;
}

.top-bar-logo:hover .logo-mark {
  transform: scale(1.08);
}

.logo-text {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary-color);
  letter-spacing: -0.02em;
}

.top-bar-nav {
  display: flex;
  gap: 4px;
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: none;
  background: transparent;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 500;
  color: var(--card-text-color);
  cursor: pointer;
  transition: var(--transition);
}

.nav-btn svg {
  width: 16px;
  height: 16px;
}

.nav-btn:hover {
  background-color: var(--action-secondary-bg);
  color: var(--dark-text);
}

.nav-btn.active {
  background-color: rgba(0, 119, 181, 0.1);
  color: var(--primary-color);
  font-weight: 600;
}

/* ==========================================================================
   Detail Top Bar (non-dashboard pages)
   ========================================================================== */
.detail-top-bar {
  background-color: var(--card-bg);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: 12px 24px;
}

.detail-top-bar-left {
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 1400px;
  margin: 0 auto;
}

.detail-back-btn {
  background: none;
  border: 1px solid var(--primary-color);
  color: var(--primary-color);
  padding: 6px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: var(--transition);
  white-space: nowrap;
}

.detail-back-btn:hover {
  background: var(--primary-color);
  color: white;
}

.detail-top-bar h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--dark-text);
}

/* ==========================================================================
   App Container
   ========================================================================== */
.app-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px;
  width: 100%;
  box-sizing: border-box;
}

.detail-main {
  max-width: 1000px;
  margin: 0 auto;
  padding: 24px;
  width: 100%;
  box-sizing: border-box;
}

/* ==========================================================================
   Dashboard Grid
   ========================================================================== */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  width: 100%;
}

/* ==========================================================================
   Base Card (from old Conversense)
   ========================================================================== */
.dashboard-card {
  position: relative;
  background-color: var(--card-bg);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  min-height: 280px;
  min-width: 0;
  overflow: hidden;
  animation: cardPopIn 0.4s ease-out forwards;
  opacity: 0;
}

.dashboard-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

/* Disable hover lift on touch devices (prevents jitter/shaking) */
@media (hover: none) {
  .dashboard-card:hover {
    transform: none;
  }
}

/* Staggered pop-in */
.dashboard-card:nth-child(1) { animation-delay: 0.05s; }
.dashboard-card:nth-child(2) { animation-delay: 0.10s; }
.dashboard-card:nth-child(3) { animation-delay: 0.15s; }
.dashboard-card:nth-child(4) { animation-delay: 0.20s; }
.dashboard-card:nth-child(5) { animation-delay: 0.25s; }
.dashboard-card:nth-child(6) { animation-delay: 0.30s; }
.dashboard-card:nth-child(7) { animation-delay: 0.35s; }
.dashboard-card:nth-child(8) { animation-delay: 0.40s; }
.dashboard-card:nth-child(9) { animation-delay: 0.45s; }
.dashboard-card:nth-child(10) { animation-delay: 0.50s; }
.dashboard-card:nth-child(11) { animation-delay: 0.55s; }

@keyframes cardPopIn {
  0% { opacity: 0; transform: translateY(20px) scale(0.95); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* Width variants */
.dashboard-card[data-width="1"] { grid-column: span 1; }
.dashboard-card[data-width="2"] { grid-column: span 2; }
.dashboard-card[data-width="3"] { grid-column: span 3; }

/* Left accent border */
.card-accent {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  border-radius: var(--border-radius) 0 0 var(--border-radius);
}

.card-accent.color-activity { background: linear-gradient(180deg, #0ea5e9, #14b8a6); }
.card-accent.color-engagement { background: linear-gradient(180deg, #f59e0b, #ef4444); }
.card-accent.color-operational { background: linear-gradient(180deg, #0077B5, #00A0DC); }
.card-accent.color-prospects { background: linear-gradient(180deg, #6f42c1, #9b6fd4); }

/* Campaign accent colors */
.card-accent.campaign-color-0 { background: linear-gradient(180deg, #0077B5, #00A0DC); }
.card-accent.campaign-color-1 { background: linear-gradient(180deg, #e83e8c, #f06292); }
.card-accent.campaign-color-2 { background: linear-gradient(180deg, #28a745, #51cf66); }
.card-accent.campaign-completed { background: #ced4da; }

/* ==========================================================================
   Card Header
   ========================================================================== */
.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 14px 20px 10px 24px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.card-title {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--card-title-color);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.card-description {
  font-size: 11px;
  color: var(--card-text-muted);
  margin: 2px 0 0 0;
  font-weight: 400;
}

/* ==========================================================================
   Card Content
   ========================================================================== */
.card-content {
  flex: 1;
  padding: 16px 20px 16px 24px;
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   Card Actions
   ========================================================================== */
.card-actions {
  display: flex;
  gap: 8px;
  padding: 12px 20px 14px 24px;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  flex-wrap: wrap;
  margin-top: auto;
}

/* ==========================================================================
   Badges
   ========================================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}

.badge-success { background-color: rgba(40, 167, 69, 0.12); color: #28a745; }
.badge-warning { background-color: rgba(240, 173, 78, 0.12); color: #d68910; }
.badge-danger  { background-color: rgba(220, 53, 69, 0.12); color: #dc3545; }
.badge-info    { background-color: rgba(23, 162, 184, 0.12); color: #17a2b8; }
.badge-neutral { background-color: rgba(142, 154, 175, 0.12); color: #8e9aaf; }

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  text-decoration: none;
  font-family: inherit;
}

.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 16px; }

.btn-primary {
  background-color: var(--primary-color);
  color: white;
}
.btn-primary:hover {
  filter: brightness(0.9);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 119, 181, 0.3);
}

.btn-secondary {
  background-color: var(--action-secondary-bg);
  color: var(--card-title-color);
}
.btn-secondary:hover {
  background-color: var(--action-secondary-hover);
}

.btn-ghost {
  background: transparent;
  color: var(--card-text-muted);
}
.btn-ghost:hover {
  background-color: var(--action-secondary-bg);
  color: var(--card-title-color);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* ==========================================================================
   CARD 1: Performance Overview - SVG Area Charts
   ========================================================================== */

/* Period tabs (pill-shaped, from growth UI) */
.period-tabs {
  display: inline-flex;
  padding: 3px;
  background: #f1f5f9;
  border-radius: 999px;
  gap: 2px;
}

.period-tab {
  border: 0;
  background: transparent;
  color: #64748b;
  border-radius: 999px;
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.period-tab:hover:not(.active) {
  color: #0f172a;
  background: rgba(255, 255, 255, 0.6);
}

.period-tab.active {
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
}

/* Subgraph grid (3 mini charts side by side) */
.stats-subgraphs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.stats-subgraph {
  border: 1px solid #eef2f7;
  border-radius: 12px;
  padding: 12px 14px 10px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 220px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.stats-subgraph:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
}

.subgraph-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.subgraph-title {
  font-size: 11px;
  font-weight: 700;
  color: #475569;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.subgraph-headline {
  font-size: 22px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
  line-height: 1;
  white-space: nowrap;
}

.subgraph-chart {
  flex: 1;
  min-height: 120px;
  display: flex;
  align-items: stretch;
}

.subgraph-chart svg {
  width: 100%;
  height: 100%;
  min-height: 120px;
  display: block;
}

.subgraph-sub {
  font-size: 11px;
  color: #64748b;
  line-height: 1.5;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 6px;
}

.subgraph-metric-token {
  font-weight: 600;
  white-space: nowrap;
}

.subgraph-metric-token strong {
  font-weight: 800;
}

.subgraph-sep {
  color: #cbd5e1;
  font-weight: 700;
}

/* SVG chart styles */
.area-chart-interactive {
  position: relative;
}

.area-chart-interactive svg {
  width: 100%;
  display: block;
}

.chart-hover-line {
  stroke: rgba(100, 116, 139, 0.7);
  stroke-width: 1;
  stroke-dasharray: 3 3;
  opacity: 0;
  transition: opacity 0.08s ease;
  pointer-events: none;
}

.chart-hover-line.is-visible { opacity: 1; }

.chart-dot-latest {
  filter: drop-shadow(0 0 1.5px rgba(15, 23, 42, 0.18));
}

.chart-dot-pulse {
  transform-box: fill-box;
  transform-origin: center;
  animation: chart-dot-pulse 1.8s ease-out infinite;
  opacity: 0.45;
}

@keyframes chart-dot-pulse {
  0%   { transform: scale(0.92); opacity: 0.45; }
  70%  { transform: scale(1.9); opacity: 0; }
  100% { transform: scale(1.9); opacity: 0; }
}

/* Hover tooltip */
.chart-hover-tooltip {
  position: absolute;
  z-index: 5;
  min-width: 160px;
  max-width: 200px;
  background: rgba(15, 23, 42, 0.94);
  color: #e2e8f0;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 10px;
  padding: 8px 10px;
  box-shadow: 0 8px 24px rgba(2, 6, 23, 0.35);
  font-size: 11px;
  line-height: 1.35;
  pointer-events: none;
}

.chart-hover-title {
  font-weight: 700;
  color: #f8fafc;
  margin-bottom: 4px;
}

.chart-hover-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 3px;
}

.chart-hover-key {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #cbd5e1;
}

.chart-hover-swatch {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 2px;
}

.chart-hover-value {
  color: #f8fafc;
  font-weight: 700;
}

/* Nudge bar (insight / tip) */
.stats-nudge {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: linear-gradient(135deg, #ecfeff 0%, #eef2ff 100%);
  border: 1px solid #bae6fd;
  color: #075985;
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 12px;
  line-height: 1.45;
}

.stats-nudge-icon {
  color: #0284c7;
  flex-shrink: 0;
  margin-top: 1px;
}

/* ==========================================================================
   CARD 2: Ideas Carousel
   ========================================================================== */
.carousel-container {
  position: relative;
  min-height: 200px;
}

.carousel-slides {
  position: relative;
  overflow: hidden;
  min-height: 180px;
}

.carousel-slide {
  display: none;
  padding: 0 8px;
}

.carousel-slide.active {
  display: block;
  animation: fadeSlide 0.3s ease-out;
}

@keyframes fadeSlide {
  0% { opacity: 0; transform: translateX(10px); }
  100% { opacity: 1; transform: translateX(0); }
}

.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--card-bg);
  border: 1px solid #eef2f7;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
  font-size: 18px;
  color: var(--card-text-color);
  transition: var(--transition);
}

.carousel-arrow:hover {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.carousel-arrow.prev { left: -4px; }
.carousel-arrow.next { right: -4px; }

.carousel-nav {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 12px;
}

.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d1d5db;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
}

.carousel-dot.active {
  background: var(--primary-color);
  transform: scale(1.3);
}

/* Idea slide content */
.idea-slide-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--card-title-color);
  margin-bottom: 6px;
  line-height: 1.3;
}

.idea-slide-hook {
  font-size: 12px;
  font-style: italic;
  color: var(--card-text-muted);
  padding: 6px 10px;
  background: rgba(108, 92, 231, 0.06);
  border-radius: 6px;
  margin-bottom: 8px;
  line-height: 1.4;
}

.idea-slide-desc {
  font-size: 12px;
  color: var(--card-text-color);
  line-height: 1.5;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.idea-slide-structure {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  background: rgba(108, 92, 231, 0.1);
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
  color: #6c5ce7;
  margin-bottom: 8px;
}

.idea-slide-points {
  list-style: none;
  padding: 0;
  margin: 0 0 8px 0;
}

.idea-slide-points li {
  font-size: 11px;
  color: var(--card-text-color);
  padding: 2px 0 2px 14px;
  position: relative;
  line-height: 1.4;
}

.idea-slide-points li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--primary-color);
  font-weight: bold;
}

.idea-slide-why {
  font-size: 11px;
  color: #075985;
  background: rgba(14, 165, 233, 0.06);
  padding: 6px 8px;
  border-radius: 6px;
  line-height: 1.4;
  margin-bottom: 10px;
}

.idea-slide-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
}

/* ==========================================================================
   CARD 3: Profile Mini Card
   ========================================================================== */
.profile-mini-question {
  font-size: 13px;
  color: var(--card-text-color);
  line-height: 1.5;
  margin-bottom: 8px;
}

.profile-mini-progress {
  font-size: 11px;
  color: var(--card-text-muted);
  margin-bottom: 12px;
}

.profile-mini-complete {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 16px 0;
}

.profile-mini-complete .check-icon {
  font-size: 32px;
  margin-bottom: 8px;
}

.profile-mini-complete p {
  font-size: 13px;
  color: var(--card-text-muted);
  margin: 0;
}

/* ==========================================================================
   CAMPAIGN CARDS
   ========================================================================== */
.campaign-card-completed {
  opacity: 0.7;
}

.campaign-card-completed:hover {
  opacity: 0.85;
}

.campaign-desc {
  font-size: 12px;
  color: var(--card-text-color);
  line-height: 1.5;
  margin-bottom: 12px;
}

/* Campaign stats row (like growth pillar stats) */
.campaign-stats-row {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

.campaign-stat {
  flex: 1;
  text-align: center;
  padding: 8px 4px;
  background: #f8f9fa;
  border-radius: 8px;
}

.campaign-stat-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--card-title-color);
  line-height: 1.2;
}

.campaign-stat-label {
  font-size: 10px;
  color: var(--card-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-top: 2px;
}

/* Replies circle (like awaiting response) */
.campaign-replies {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.replies-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f0ad4e, #fd7e14);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 18px;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(240, 173, 78, 0.3);
  position: relative;
}

.replies-circle.has-items {
  animation: replies-pulse 2s ease-in-out infinite;
}

@keyframes replies-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 4px 12px rgba(240, 173, 78, 0.3); }
  50% { transform: scale(1.04); box-shadow: 0 6px 18px rgba(240, 173, 78, 0.4); }
}

.replies-circle.empty {
  background: #e9ecef;
  color: #adb5bd;
  box-shadow: none;
}

/* Campaign post rows (like pillar recent posts) */
.campaign-posts-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 8px;
}

.campaign-post-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 4px;
  border-bottom: 1px dashed rgba(148, 163, 184, 0.25);
  min-height: 40px;
  transition: background 0.15s ease;
  border-radius: 6px;
}

.campaign-post-row:last-child { border-bottom: 0; }

.campaign-post-row:hover {
  background: rgba(0, 119, 181, 0.04);
}

.campaign-post-bullet {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.campaign-post-bullet.posted {
  background: rgba(40, 167, 69, 0.12);
  color: #28a745;
}

.campaign-post-bullet.draft {
  background: rgba(0, 119, 181, 0.12);
  color: #0077B5;
}

.campaign-post-bullet.pending {
  background: rgba(142, 154, 175, 0.12);
  color: #8e9aaf;
}

.campaign-post-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.campaign-post-title {
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
  line-height: 1.35;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.campaign-post-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #64748b;
  font-size: 11px;
  font-weight: 500;
  flex-wrap: wrap;
}

.campaign-post-meta .meta-dot {
  color: #cbd5e1;
  font-weight: 700;
}

.campaign-post-meta .meta-stat {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.campaign-post-arrow {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--action-secondary-bg);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--card-text-muted);
  font-size: 16px;
  transition: var(--transition);
}

.campaign-post-arrow:hover {
  background: var(--primary-color);
  color: white;
  transform: translateX(2px);
}

.campaign-post-cta {
  font-size: 11px;
  font-weight: 600;
  color: var(--primary-color);
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
}

.campaign-post-cta:hover {
  text-decoration: underline;
}

/* ==========================================================================
   Loading & Skeleton
   ========================================================================== */
.loading-overlay {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  grid-column: span 3;
}

.loading-overlay p {
  margin-top: 16px;
  font-size: 16px;
  color: var(--card-text-muted);
}

.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: 6px;
}

.skeleton-text { height: 14px; margin-bottom: 8px; }
.skeleton-text.short { width: 60%; }
.skeleton-text.medium { width: 80%; }
.skeleton-text.full { width: 100%; }
.skeleton-chart { height: 120px; border-radius: 12px; margin-top: 8px; }

@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ==========================================================================
   Empty States
   ========================================================================== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 32px 20px;
  color: var(--card-text-muted);
}

.empty-state .empty-icon {
  font-size: 40px;
  margin-bottom: 12px;
}

.empty-state h3 {
  margin: 0 0 6px 0;
  font-size: 16px;
  color: var(--card-title-color);
}

.empty-state p {
  margin: 0;
  font-size: 13px;
  max-width: 300px;
}

/* ==========================================================================
   Toast Notifications
   ========================================================================== */
#toast-container {
  position: fixed;
  top: 70px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  animation: toastIn 0.3s ease-out;
  max-width: 360px;
}

.toast-success { background: #28a745; color: white; }
.toast-error   { background: #dc3545; color: white; }
.toast-warning { background: #f0ad4e; color: #283E4A; }
.toast-info    { background: #17a2b8; color: white; }

@keyframes toastIn {
  0% { opacity: 0; transform: translateX(20px); }
  100% { opacity: 1; transform: translateX(0); }
}

/* ==========================================================================
   Modals
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

.modal {
  background: var(--card-bg);
  border-radius: var(--border-radius);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  padding: 24px;
  max-width: 520px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
}

/* Wide variant - full idea cards in the campaign picker need room to read. */
.modal-overlay.modal-wide .modal {
  max-width: 760px;
}

.modal h3 {
  margin: 0 0 12px 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--card-title-color);
}

.modal-input,
.modal-textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 16px;
  font-family: inherit;
  margin-bottom: 12px;
  box-sizing: border-box;
  transition: border-color 0.2s ease;
}

.modal-input:focus,
.modal-textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(0, 119, 181, 0.1);
}

.modal-textarea {
  min-height: 100px;
  resize: vertical;
}

.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 16px;
}

.modal-divider {
  text-align: center;
  color: var(--card-text-muted);
  font-size: 12px;
  margin: 8px 0;
  position: relative;
}

.modal-divider::before,
.modal-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 40%;
  height: 1px;
  background: #e5e7eb;
}

.modal-divider::before { left: 0; }
.modal-divider::after { right: 0; }

/* ==========================================================================
   Landing Page
   ========================================================================== */
.landing {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
  padding: 20px;
  box-sizing: border-box;
}

.landing-card {
  background: var(--card-bg);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
  padding: 40px 32px;
  text-align: center;
  max-width: 440px;
  width: 100%;
  box-sizing: border-box;
}

.landing-logo {
  font-size: 48px;
  line-height: 1;
  margin-bottom: 8px;
}

.landing-logo-img {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  object-fit: contain;
  margin: 0 auto 6px;
  display: block;
  box-shadow: 0 8px 24px rgba(0, 119, 181, 0.18);
}

.landing-card h1 {
  font-size: 32px;
  font-weight: 800;
  color: var(--primary-color);
  margin: 16px 0 8px;
  letter-spacing: -0.02em;
}

.landing-sub {
  font-size: 15px;
  color: var(--card-text-color);
  margin-bottom: 24px;
  line-height: 1.5;
}

.landing-footnote {
  font-size: 12px;
  color: var(--card-text-muted);
  margin-top: 16px;
}

/* ── Auth dialog ── */
.auth-tabs {
  display: flex;
  background: #f1f5f9;
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 20px;
  gap: 4px;
}

.auth-tab {
  flex: 1;
  padding: 10px 12px;
  border: none;
  border-radius: 8px;
  background: transparent;
  font-size: 16px;
  font-weight: 600;
  color: var(--card-text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.auth-tab.active {
  background: #fff;
  color: var(--primary-color);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.auth-field {
  text-align: left;
  margin-bottom: 14px;
}

.auth-field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--card-text-color);
  margin-bottom: 5px;
}

.auth-optional {
  font-weight: 400;
  color: var(--card-text-muted);
}

.auth-field input {
  width: 100%;
  box-sizing: border-box;
  padding: 11px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 16px;
  color: var(--dark-text);
  background: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.auth-field input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(0, 119, 181, 0.12);
}

.auth-submit {
  width: 100%;
  margin-top: 6px;
}

/* ==========================================================================
   Onboarding
   ========================================================================== */
.onboarding-page {
  max-width: 600px;
  margin: 0 auto;
}

.onboarding-header {
  margin-bottom: 24px;
}

.onboarding-header h1 {
  font-size: 24px;
  font-weight: 700;
  color: var(--dark-text);
  margin: 0 0 6px;
}

.onboarding-header p {
  font-size: 16px;
  color: var(--card-text-muted);
  margin: 0;
}

.onboarding-card {
  background: var(--card-bg);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 16px;
}

.onboarding-skip {
  text-align: center;
  margin-top: 12px;
}

.input-row {
  display: flex;
  gap: 10px;
}

.input-row input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 16px;
  font-family: inherit;
}

.input-row input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(0, 119, 181, 0.1);
}

.progress-bar {
  height: 4px;
  background: #e5e7eb;
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 16px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  border-radius: 2px;
  transition: width 0.3s ease;
}

.question-number {
  font-size: 12px;
  color: var(--card-text-muted);
  margin-bottom: 8px;
}

.question-text {
  font-size: 16px;
  font-weight: 600;
  color: var(--dark-text);
  margin-bottom: 12px;
  line-height: 1.4;
}

.question-suggestion {
  font-size: 13px;
  color: var(--card-text-muted);
  margin-bottom: 12px;
  padding: 8px 12px;
  background: rgba(108, 92, 231, 0.06);
  border-radius: 8px;
}

/* Prefill hint on onboarding questions */
.question-prefill-hint {
  font-size: 12.5px;
  color: #7c6fd8;
  margin-bottom: 10px;
  padding: 8px 12px;
  background: rgba(108, 92, 231, 0.08);
  border: 1px dashed rgba(108, 92, 231, 0.3);
  border-radius: 8px;
}

/* Website scan phase */
.scan-card {
  text-align: center;
  padding: 36px 24px;
}
.scan-visual {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}
.scan-spinner {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 4px solid rgba(108, 92, 231, 0.15);
  border-top-color: var(--secondary-color, #6c5ce7);
  animation: spin 1s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.scan-url {
  font-size: 16px;
  font-weight: 600;
  color: var(--dark-text);
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.scan-steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  margin-bottom: 18px;
}
.scan-step {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  color: #94a3b8;
  transition: color 0.3s ease;
}
.scan-step.done {
  color: var(--dark-text);
}
.scan-step-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #e2e8f0;
  transition: background 0.3s ease;
}
.scan-step.done .scan-step-dot {
  background: linear-gradient(135deg, var(--primary-color, #0077B5), var(--secondary-color, #6c5ce7));
  box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.15);
}
.scan-note {
  font-size: 12.5px;
  color: #94a3b8;
}

/* LinkedIn connect step */
.linkedin-connected-box {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(10, 102, 194, 0.06);
  border: 1px solid rgba(10, 102, 194, 0.25);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 14px;
  text-align: left;
}
.linkedin-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0A66C2, #0a4d8f);
  color: #fff;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.linkedin-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.linkedin-connect-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 0 4px;
}

/* One identity: either the personal profile or a company page - never both */
.channel-pick {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 4px 0 14px;
  text-align: left;
}
.channel-option {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1.5px solid var(--border, rgba(148, 163, 184, 0.25));
  border-radius: 12px;
  padding: 12px 14px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  background: transparent;
}
.channel-option:hover { border-color: var(--accent, #0077b5); }
.channel-option.picked {
  border-color: var(--accent, #0077b5);
  background: rgba(0, 119, 181, 0.06);
}
.channel-option input { display: none; }
.channel-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(135deg, #0A66C2, #0a4d8f);
  color: #fff; font-weight: 700; font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.channel-avatar.org {
  background: linear-gradient(135deg, #7c3aed, #5b21b6);
  border-radius: 10px;
}
.channel-meta { flex: 1; min-width: 0; }
.channel-name { font-weight: 600; font-size: 14px; }
.channel-sub { font-size: 12px; color: var(--card-text-muted, #64748b); }
.channel-flag {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.04em; color: #16a34a;
  background: rgba(22, 163, 74, 0.12); border-radius: 20px;
  padding: 3px 9px; flex-shrink: 0;
}
.channel-note { text-align: left; }

.auth-hint {
  font-size: 12px;
  color: var(--card-text-muted, #64748b);
  margin: -6px 0 12px;
  text-align: left;
}

.auth-closed-notice {
  background: rgba(240, 173, 78, 0.10);
  border: 1px solid rgba(240, 173, 78, 0.45);
  border-radius: 10px;
  padding: 14px 16px;
  margin: 4px 0 10px;
  text-align: left;
}
.auth-closed-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #d68910;
  margin-bottom: 6px;
}
.auth-closed-notice p {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--card-text-muted, #64748b);
  margin: 0;
}

.consent-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12.5px;
  color: var(--card-text-muted, #64748b);
  margin: 4px 0 12px;
  text-align: left;
  cursor: pointer;
}
.consent-row input {
  margin-top: 2px;
  accent-color: #0077b5;
  flex-shrink: 0;
}
.consent-row a {
  color: #0077b5;
  text-decoration: underline;
}

.question-textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 16px;
  font-family: inherit;
  min-height: 100px;
  resize: vertical;
  box-sizing: border-box;
}

.question-textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(0, 119, 181, 0.1);
}

.question-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.success-check {
  font-size: 32px;
  color: #28a745;
}

.error-text {
  color: #dc3545;
  font-size: 16px;
}

/* ==========================================================================
   IDEAS PAGE (Detail)
   ========================================================================== */
.detail-page {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.detail-config-card {
  background: var(--card-bg);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  padding: 20px 24px;
}

.detail-config-card h3 {
  margin: 0 0 8px 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--card-title-color);
}

.detail-config-card p {
  margin: 0 0 12px 0;
  font-size: 13px;
  color: var(--card-text-color);
  line-height: 1.5;
}

/* Source health bar */
.source-health-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.source-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  transition: var(--transition);
}

.source-healthy {
  background: rgba(40, 167, 69, 0.1);
  color: #28a745;
  border: 1px solid rgba(40, 167, 69, 0.2);
}

.source-disabled {
  background: rgba(142, 154, 175, 0.1);
  color: #8e9aaf;
  border: 1px solid rgba(142, 154, 175, 0.2);
}

.source-timestamp {
  font-size: 11px;
  color: var(--card-text-muted);
  margin-left: auto;
}

/* Add idea card */
.add-idea-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: var(--card-bg);
  border: 2px dashed #d1d5db;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: var(--transition);
  font-size: 16px;
  color: var(--card-text-muted);
}

.add-idea-card:hover {
  border-color: var(--primary-color);
  background: rgba(0, 119, 181, 0.03);
  color: var(--primary-color);
}

.add-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0, 119, 181, 0.1);
  color: var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 300;
}

/* Idea cards on ideas page */
.ideas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
  align-items: start;
}

@media (min-width: 900px) {
  .ideas-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 640px) and (max-width: 899px) {
  .ideas-grid { grid-template-columns: repeat(2, 1fr); }
}

.idea-card {
  background: var(--card-bg);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  padding: 20px 24px;
  border-left: 3px solid var(--card-insights);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

/* User-submitted ideas (always additional to the 5 auto-discovered ones) get
   a distinct accent color + subtle badge tint so they're visually set apart. */
.idea-card-own {
  border-left: 3px solid #f59e0b;
  background: linear-gradient(180deg, #fffbeb 0%, var(--card-bg) 60px);
}

.idea-card-own .idea-source {
  color: #b45309;
  background: #fef3c7;
  padding: 2px 8px;
  border-radius: 6px;
}

.add-own-card {
  border: 2px dashed #a5b4fc;
  border-left: 2px dashed #a5b4fc;
  background: linear-gradient(135deg, #f5f6ff, #fbfbff);
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  min-height: 220px;
  gap: 6px;
  box-shadow: none;
}

.add-own-card:hover {
  border-color: #6366f1;
  background: linear-gradient(135deg, #eef0ff, #f8f9ff);
  transform: translateY(-2px);
}

/* Empty idea slot - shows when fewer than 5 ideas, with next-refresh time */
.idea-placeholder {
  border: 2px dashed #c7d2fe;
  border-left: 2px dashed #c7d2fe;
  background: linear-gradient(135deg, #f8f9ff, #fdfdff);
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 220px;
  gap: 6px;
  box-shadow: none;
  cursor: default;
  animation: none;
}

.placeholder-icon {
  font-size: 30px;
  color: #a5b4fc;
  filter: grayscale(0.3);
}

.placeholder-title {
  color: #6366f1;
  font-weight: 600;
  font-size: 16px;
}

.placeholder-sub {
  font-size: 12.5px;
  color: var(--card-text-muted);
  max-width: 200px;
}

/* "Updating sources…" banner while a refresh is running */
.auto-refresh-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: var(--border-radius);
  background: linear-gradient(135deg, #eef2ff, #e0e7ff);
  border: 1px solid #c7d2fe;
  color: #4338ca;
  font-size: 13.5px;
  font-weight: 600;
  margin-bottom: 16px;
}

.auto-refresh-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid #c7d2fe;
  border-top-color: #6366f1;
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
  flex-shrink: 0;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.add-own-plus {
  font-size: 34px;
  font-weight: 300;
  color: #6366f1;
  line-height: 1;
}

.add-own-title {
  font-size: 15px;
  font-weight: 700;
  color: #4338ca;
}

.add-own-sub {
  font-size: 12.5px;
  color: #6b6f9c;
  max-width: 240px;
}

.add-own-hints {
  display: flex;
  gap: 8px;
  margin-top: 6px;
  flex-wrap: wrap;
  justify-content: center;
}

.add-own-hints span {
  font-size: 11px;
  background: rgba(99, 102, 241, 0.1);
  color: #4338ca;
  padding: 3px 8px;
  border-radius: 20px;
}

.source-health-card {
  margin-top: 8px;
}

.idea-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-1px);
}

.idea-card-placeholder {
  border-style: dashed;
  border-color: #d1d5db;
  opacity: 0.6;
  box-shadow: none;
}

.idea-card-placeholder:hover {
  transform: none;
  box-shadow: none;
}

.idea-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.idea-source {
  font-size: 11px;
  font-weight: 600;
  color: var(--card-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.idea-card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--card-title-color);
  margin-bottom: 6px;
  line-height: 1.3;
}

.idea-card-hook {
  font-size: 12px;
  font-style: italic;
  color: var(--card-text-muted);
  padding: 6px 10px;
  background: rgba(108, 92, 231, 0.06);
  border-radius: 6px;
  margin-bottom: 8px;
  line-height: 1.4;
}

.idea-card-description {
  font-size: 13px;
  color: var(--card-text-color);
  line-height: 1.5;
  margin-bottom: 8px;
}

.idea-card-structure {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  background: rgba(108, 92, 231, 0.1);
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
  color: #6c5ce7;
  margin-bottom: 8px;
}

.idea-card-key-points {
  list-style: none;
  padding: 0;
  margin: 0 0 8px 0;
}

.idea-card-key-points li {
  font-size: 12px;
  color: var(--card-text-color);
  padding: 2px 0 2px 14px;
  position: relative;
  line-height: 1.4;
}

.idea-card-key-points li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--card-insights);
  font-weight: bold;
}

.idea-card-reasoning {
  font-size: 11px;
  color: #075985;
  background: rgba(14, 165, 233, 0.06);
  padding: 6px 8px;
  border-radius: 6px;
  line-height: 1.4;
  margin-bottom: 8px;
}

.idea-card-attribution {
  font-size: 11px;
  color: var(--card-text-muted);
  margin-bottom: 4px;
}

.idea-link {
  color: #6c5ce7;
  text-decoration: none;
}

.idea-link:hover {
  text-decoration: underline;
}

.idea-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.clear-ideas-section {
  text-align: center;
  padding: 16px 0;
}

.placeholder-text {
  color: var(--card-text-muted);
}

/* ==========================================================================
   PROFILE PAGE
   ========================================================================== */
.profile-field {
  margin-bottom: 16px;
}

.profile-field label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--card-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.profile-field div {
  font-size: 16px;
  color: var(--card-text-color);
  line-height: 1.5;
}

/* Per-field edit icon (feedback: "edit button can be next to each field
   in the top right corner as an icon") */
.profile-field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.profile-field-head label { margin-bottom: 0; }
.ctx-field-edit {
  border: none; background: none; cursor: pointer; font-size: 13px;
  padding: 2px 4px; border-radius: 4px; color: var(--card-text-muted);
  opacity: 0.55; transition: opacity 0.15s;
}
.ctx-field-edit:hover { opacity: 1; background: rgba(0, 119, 181, 0.08); }
.ctx-field-value {
  font-size: 13.5px !important; line-height: 1.55 !important;
  color: var(--card-text) !important; white-space: pre-wrap;
}
.ctx-card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
}
.ctx-card-head h3 { margin: 0; }

/* Upload area */
.upload-area {
  margin-bottom: 16px;
}

.upload-dropzone {
  border: 2px dashed #d1d5db;
  border-radius: var(--border-radius);
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
}

.upload-dropzone:hover {
  border-color: var(--primary-color);
  background: rgba(0, 119, 181, 0.03);
}

.upload-dropzone p {
  margin: 4px 0;
  font-size: 16px;
  color: var(--card-text-color);
}

.upload-hint {
  font-size: 12px !important;
  color: var(--card-text-muted) !important;
}

.upload-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--card-text-color);
}

.upload-success { color: #28a745; font-size: 13px; }
.upload-error { color: #dc3545; font-size: 13px; }

/* Extended questions */
.extended-explanation {
  font-size: 16px;
  color: var(--card-text-color);
  line-height: 1.5;
  margin-bottom: 8px;
}

.extended-example {
  font-size: 12px;
  color: var(--card-text-muted);
  margin-bottom: 12px;
}

.extended-answer-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 16px;
  font-family: inherit;
  min-height: 220px;
  resize: vertical;
  box-sizing: border-box;
  line-height: 1.5;
}

.extended-answer-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(0, 119, 181, 0.1);
}

.extended-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.extended-answer-wrap {
  position: relative;
}

/* Question bubble: visually distinct, "exciting" - the question is the
   hero element of the Extended Questions card. Gradient pill with a soft
   glow so it clearly stands out from the surrounding interface. */
.extended-question-bubble {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  margin-bottom: 10px;
  border-radius: 16px;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 55%, #db2777 130%);
  color: #fff;
  box-shadow: 0 4px 16px rgba(79, 70, 229, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.18);
  position: relative;
}

/* Small chat tail so it reads as a speech bubble */
.extended-question-bubble::after {
  content: '';
  position: absolute;
  left: 28px;
  bottom: -8px;
  width: 16px;
  height: 16px;
  background: #7c3aed;
  border-radius: 3px;
  transform: rotate(45deg);
  border-right: 1px solid rgba(255, 255, 255, 0.18);
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}

.extended-question-bubble-icon {
  font-size: 18px;
  line-height: 1.35;
  flex-shrink: 0;
  filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.5));
  animation: extended-bubble-glow 2.4s ease-in-out infinite;
}

.extended-question-bubble-text {
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.45;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

@keyframes extended-bubble-glow {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 3px rgba(255, 255, 255, 0.4)); }
  50% { transform: scale(1.12); filter: drop-shadow(0 0 7px rgba(255, 255, 255, 0.75)); }
}

@media (prefers-reduced-motion: reduce) {
  .extended-question-bubble-icon {
    animation: none;
  }
}

.extended-draft-hint {
  display: block;
  font-size: 11.5px;
  color: #075985;
  margin-top: 5px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.extended-draft-hint.visible {
  opacity: 1;
}

/* Generating state: spinner + pulse so it reads as 'working', not static */
.extended-draft-hint-generating {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  animation: extended-hint-pulse 1.6s ease-in-out infinite;
}

.extended-draft-hint-generating::before {
  content: '';
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 2px solid rgba(7, 89, 133, 0.25);
  border-top-color: #075985;
  animation: extended-hint-spin 0.8s linear infinite;
}

@keyframes extended-hint-spin {
  to { transform: rotate(360deg); }
}

@keyframes extended-hint-pulse {
  0%, 100% { opacity: 0.85; }
  50% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .extended-draft-hint-generating,
  .extended-draft-hint-generating::before {
    animation: none;
  }
  .extended-draft-hint-generating::before {
    border-top-color: #075985;
  }
}

.extended-done {
  font-size: 16px;
  color: #28a745;
  text-align: center;
  padding: 16px 0;
}

/* ==========================================================================
   CAMPAIGN CONFIG PAGE
   ========================================================================== */
.campaign-progress-section {
  margin-top: 16px;
}

.campaign-progress-label {
  font-size: 13px;
  color: var(--card-text-muted);
  margin-bottom: 6px;
}

.campaign-progress-bar {
  height: 6px;
  background: #e5e7eb;
  border-radius: 3px;
  overflow: hidden;
}

.campaign-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  border-radius: 3px;
  transition: width 0.5s ease;
}

.post-count-selector {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.post-count-selector label {
  font-size: 13px;
  color: var(--card-text-color);
}

.post-count-btns {
  display: flex;
  gap: 4px;
}

.post-count-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  background: white;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  color: var(--card-text-color);
  transition: var(--transition);
}

.post-count-btn.active {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.campaign-post-card {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.post-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--card-title-color);
  margin-bottom: 2px;
}

.post-angle {
  font-size: 12px;
  color: var(--card-text-muted);
  margin-bottom: 4px;
}

/* ==========================================================================
   CONTACTS PAGE
   ========================================================================== */
.contacts-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

/* Abstracted topic understanding - what people engage with, aggregated across
   every real interaction (never invented; empty when there's no real data). */
.contacts-topics-card {
  background: var(--card-bg);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  margin-bottom: 20px;
}
.contacts-topics-head {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--card-title-color);
  margin-bottom: 12px;
}
.contacts-topics-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.contacts-topic-row {
  display: grid;
  grid-template-columns: minmax(120px, 220px) 1fr 28px;
  align-items: center;
  gap: 10px;
}
.contacts-topic-label {
  font-size: 12.5px;
  color: var(--card-text-color);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.contacts-topic-bar-track {
  height: 8px;
  border-radius: 4px;
  background: #eef1f6;
  overflow: hidden;
}
.contacts-topic-bar-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, #e83e8c, #f78fb3);
}
.contacts-topic-n {
  font-size: 12px;
  font-weight: 700;
  color: var(--card-text-muted);
  text-align: right;
}

.contacts-stat-card {
  background: var(--card-bg);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  padding: 16px;
  text-align: center;
}

.contacts-stat-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--card-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.contacts-stat-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--card-title-color);
}

.contacts-filters {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.contacts-filters input,
.contacts-filters select {
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
}

.contacts-filters input {
  flex: 1;
}

.contact-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  background: var(--card-bg);
  border-radius: 8px;
  margin-bottom: 4px;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.contact-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(232, 62, 140, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}

.resp-contact-link {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 700;
}
.resp-contact-link:hover { text-decoration: underline; }
.resp-msg-headline { color: var(--card-text-muted); font-weight: 500; }

.contact-avatar-link { display: flex; flex-shrink: 0; }
.contact-avatar-link:hover .contact-avatar { box-shadow: 0 0 0 2px var(--primary-color); }
.contact-profile-link {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary-color);
  text-decoration: none;
  white-space: nowrap;
}
.contact-profile-link:hover { text-decoration: underline; }

.contact-last-seen {
  font-size: 11.5px;
  color: var(--card-text-muted);
  white-space: nowrap;
  min-width: 54px;
  text-align: right;
}

.contact-row:hover {
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.contact-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--card-title-color);
  min-width: 150px;
}

.contact-headline {
  flex: 1;
  font-size: 13px;
  color: var(--card-text-color);
}

.contact-interactions {
  font-size: 12px;
  color: var(--card-text-muted);
  white-space: nowrap;
}

.contact-row-arrow {
  font-size: 15px;
  color: #c7cbd6;
  transition: transform 0.2s ease, color 0.2s ease;
}

.contact-row:hover .contact-row-arrow {
  color: var(--primary-color);
  transform: translateX(3px);
}

/* Contact detail modal */
.contact-detail-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.contact-detail-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0077B5, #00a0dc);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  flex-shrink: 0;
}

.contact-detail-head h3 { margin: 0; font-size: 17px; }
.contact-detail-headline { margin: 2px 0 0; font-size: 12.5px; color: var(--card-text-muted); }
.contact-detail-topics { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.contact-topic-pill {
  font-size: 11px;
  font-weight: 600;
  background: rgba(232, 62, 140, 0.1);
  color: #b5306f;
  padding: 3px 9px;
  border-radius: 20px;
}

.contact-summary-box {
  background: linear-gradient(135deg, #f5f9ff, #fbfdff);
  border: 1px solid #dbeafe;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 18px;
}

.contact-summary-label {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #2563eb;
  margin-bottom: 6px;
}

.contact-summary-text {
  font-size: 13.5px;
  color: #1e3a5f;
  line-height: 1.55;
}

.contact-interactions-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--card-title-color);
  margin-bottom: 10px;
}

.contact-interactions-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 320px;
  overflow-y: auto;
}

.contact-interaction {
  display: flex;
  gap: 10px;
  padding: 10px 12px;
  background: #fafbfc;
  border-radius: 10px;
  border: 1px solid #eef0f4;
}
.contact-interaction.from-us {
  background: #f5f9ff;
  border-color: #dbeafe;
  margin-left: 24px;
}

.ci-icon { font-size: 18px; flex-shrink: 0; }
.ci-post { font-size: 12.5px; font-weight: 600; color: var(--card-title-color); margin-bottom: 3px; }
.ci-post a { color: inherit; text-decoration: none; }
.ci-post a:hover { text-decoration: underline; color: var(--primary-color); }
.ci-text { font-size: 12.5px; color: var(--card-text-color); font-style: italic; margin-bottom: 3px; }
.ci-date { font-size: 11px; color: var(--card-text-muted); }
.contact-empty { font-size: 13px; color: var(--card-text-muted); text-align: center; padding: 12px 0; }

/* Message waiting banner (post overview modal) */
.msg-waiting-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #fff8f0, #fffdf6);
  border: 1px solid #fde3c0;
  border-radius: 10px;
  padding: 10px 14px;
  margin-top: 14px;
  font-size: 13px;
}

.msg-waiting-banner span:nth-child(2) { flex: 1; }
.msg-waiting-icon { font-size: 18px; }

.cell-msg-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 10.5px;
  font-weight: 700;
  background: rgba(245, 158, 11, 0.16);
  color: #92400e;
  padding: 2px 6px;
  border-radius: 20px;
}

/* Response dialogue modal */
.resp-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.resp-head h3 { margin: 0; font-size: 17px; }
.resp-sub { margin: 2px 0 0; font-size: 12px; color: var(--card-text-muted); }

.resp-thread {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 260px;
  overflow-y: auto;
  padding: 4px 2px;
  margin-bottom: 14px;
}

/* Prominent follow-up CTA above the responses thread: a comment is
   important to reply to, so when someone commented there is one clear
   action instead of only the small per-message buttons. */
.resp-followup {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(232, 62, 140, 0.08));
  border: 1px solid rgba(37, 99, 235, 0.35);
  border-radius: 10px;
  padding: 9px 12px;
  margin: 2px 0 12px;
}
.resp-followup-text {
  font-size: 13px;
  line-height: 1.4;
  color: var(--card-text, #1f2937);
}

.resp-msg { display: flex; flex-direction: column; max-width: 80%; }
.resp-msg.theirs { align-self: flex-start; align-items: flex-start; }
.resp-msg.mine { align-self: flex-end; align-items: flex-end; }

.resp-msg-bubble {
  padding: 9px 13px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.45;
}

.resp-msg.theirs .resp-msg-bubble {
  background: #f1f3f7;
  color: #1f2937;
  border-bottom-left-radius: 4px;
}

.resp-msg.mine .resp-msg-bubble {
  background: linear-gradient(135deg, #0077B5, #00a0dc);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.resp-msg-meta {
  font-size: 10.5px;
  color: var(--card-text-muted);
  margin-top: 3px;
  padding: 0 4px;
}

.resp-empty {
  font-size: 13px;
  color: var(--card-text-muted);
  text-align: center;
  padding: 20px 0;
}

/* Post context shown above the thread in the response dialogue */
.resp-post-context {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 12px;
}

.resp-post-context-label {
  font-size: 11px;
  font-weight: 700;
  color: #0077B5;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 5px;
}

.resp-post-context-title {
  font-size: 14px;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.35;
  margin-bottom: 4px;
}

.resp-post-context-body {
  font-size: 12.5px;
  color: #64748b;
  line-height: 1.5;
}

/* Per-comment action buttons (like LinkedIn) */
.resp-actions {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}

.resp-act {
  background: none;
  border: none;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  border-radius: 12px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}

.resp-act:hover {
  background: rgba(0, 119, 181, 0.08);
  color: #0077B5;
}

.resp-act.liked {
  color: #0a66c2;
  background: rgba(10, 102, 194, 0.1);
}

.resp-cached-note {
  font-size: 11.5px;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

/* The AI suggestion lands directly in the textarea - there is deliberately no
   separate suggestion bubble, which would show the same text twice. This is
   just the one-line status above the composer. */
.resp-compose-status {
  font-size: 12px;
  color: var(--card-text-muted, #64748b);
  line-height: 1.4;
  min-height: 16px;
}

.resp-compose-error {
  color: #dc3545;
  font-weight: 600;
}

.resp-compose {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.resp-compose-input {
  width: 100%;
  min-height: 70px;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 13.5px;
  font-family: inherit;
  resize: vertical;
  box-sizing: border-box;
}

.resp-compose-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(0, 119, 181, 0.1);
}

.resp-compose button {
  align-self: flex-end;
}

/* ==========================================================================
   POST EDITOR (prepare_post style)
   ========================================================================== */
.prepare-post-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 20px;
  min-height: 500px;
}

.prepare-post-sidebar {
  background: var(--card-bg);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  padding: 20px;
}

.sidebar-section {
  margin-bottom: 16px;
}

.sidebar-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--card-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.sidebar-value {
  font-size: 13px;
  color: var(--card-text-color);
  line-height: 1.4;
}

.sidebar-divider {
  border: none;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  margin: 12px 0;
}

.prepare-post-main {
  background: var(--card-bg);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  padding: 24px;
  display: flex;
  flex-direction: column;
}

.post-editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.post-editor-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--card-title-color);
}

.prepare-post-textarea {
  width: 100%;
  min-height: 300px;
  padding: 16px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 16px;
  font-family: inherit;
  line-height: 1.6;
  resize: vertical;
  box-sizing: border-box;
}

.prepare-post-textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(0, 119, 181, 0.1);
}

.char-counter {
  font-size: 12px;
  color: var(--card-text-muted);
  text-align: right;
  margin-top: 4px;
}

.char-counter.warning { color: #f0ad4e; }
.char-counter.danger { color: #dc3545; }

.hashtag-area {
  margin-top: 16px;
}

.hashtag-area label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--card-text-muted);
  margin-bottom: 6px;
}

.hashtag-input-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.hashtag-input-row input {
  flex: 1;
  padding: 6px 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
}

.hashtag-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.hashtag-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  background: rgba(108, 92, 231, 0.1);
  border-radius: 12px;
  font-size: 12px;
  color: #6c5ce7;
  font-weight: 500;
}

.remove-hashtag {
  cursor: pointer;
  font-size: 10px;
  opacity: 0.6;
}

.remove-hashtag:hover { opacity: 1; }

.editor-toolbar {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  flex-wrap: wrap;
}

/* ==========================================================================
   Count-up Animation Helper
   ========================================================================== */
.count-up {
  display: inline-block;
}

/* ==========================================================================
   Refresh & Loading indicators
   ========================================================================== */
.refresh-bar {
  padding: 8px 16px;
  background: rgba(14, 165, 233, 0.06);
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.refresh-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #075985;
}

/* UIKit spinner override for inline use */
.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(0, 119, 181, 0.2);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loading-spinner.sm { width: 14px; height: 14px; border-width: 1.5px; }
.loading-spinner.lg { width: 32px; height: 32px; border-width: 3px; }

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ==========================================================================
   Scroll target (invisible anchor for campaigns scroll)
   ========================================================================== */
.scroll-target {
  height: 0;
  overflow: hidden;
}

/* ==========================================================================
   Fade-in animation
   ========================================================================== */
.fade-in {
  animation: fadeIn 0.3s ease-out;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 960px) {
  .dashboard-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .dashboard-card[data-width="2"],
  .dashboard-card[data-width="3"] {
    grid-column: span 2;
  }
  .stats-subgraphs {
    grid-template-columns: 1fr;
  }
  .prepare-post-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .landing {
    padding: 16px;
    align-items: flex-start;
    padding-top: 8vh;
  }
  .landing-card {
    padding: 28px 20px;
  }
  .landing-card h1 {
    font-size: 26px;
  }
  .onboarding-page {
    padding: 16px;
    box-sizing: border-box;
  }
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .dashboard-card,
  .dashboard-card[data-width="1"],
  .dashboard-card[data-width="2"],
  .dashboard-card[data-width="3"] {
    grid-column: span 1 !important;
    min-height: auto;
  }
  /* Disable staggered pop-in on mobile - prevents vertical shaking while scrolling */
  .dashboard-card {
    animation: none;
    opacity: 1;
  }
  .top-bar-nav { gap: 0; }
  .nav-btn span { display: none; }
  .contacts-stats-row { grid-template-columns: 1fr; }
  .campaign-stats-row { flex-wrap: wrap; }
}

/* ==========================================================================
   Pulse Animations & Text Shadows (from old Conversense pilot)
   ========================================================================== */

/* Gentle pulse for status indicators */
.is-pulsing {
  animation: gentle-pulse 2s ease-in-out infinite;
}

@keyframes gentle-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* Pulse glow for notification dots */
.pulse-glow {
  animation: pulse-glow 1.5s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.7; }
}

/* Text shadows for emphasis */
.card-highlight .metric-value,
.stat-value-emphasis {
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.badge-text-shadow {
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.section-title-emphasis {
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* ==========================================================================
   ══════════════════════════════════════════════════════════════════════
   TAB INTERFACE (Schedule · Performance · Ideas · Profile)
   ========================================================================== */

/* ── Tab top bar with connector ── */
.tab-top-bar {
  background: #ffffff;
  border-bottom: 1px solid #e8ecf1;
}

.tab-nav {
  display: flex;
  align-items: center;
  gap: 2px;
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border: none;
  background: transparent;
  border-radius: 10px 10px 0 0;
  font-size: 16px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  position: relative;
  transition: color 0.2s ease, background 0.2s ease;
  white-space: nowrap;
}

.tab-btn svg {
  width: 17px;
  height: 17px;
}

.tab-btn:hover {
  color: var(--primary-color);
  background: #f0f7fc;
}

.tab-btn.active {
  color: #ffffff;
  background: linear-gradient(135deg, #0077B5, #00A0DC);
  box-shadow: 0 4px 14px rgba(0, 119, 181, 0.35);
}

/* Connector notch - links the active tab to the page underneath */
.tab-btn.active::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -9px;
  transform: translateX(-50%);
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 9px solid #0077B5;
  filter: drop-shadow(0 2px 3px rgba(0, 119, 181, 0.25));
  z-index: 5;
}

.tab-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  margin-left: 8px;
  border: none;
  background: #f0f2f5;
  border-radius: 10px;
  color: #566573;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab-icon-btn svg {
  width: 18px;
  height: 18px;
}

.tab-icon-btn:hover {
  background: #e4e8ee;
  color: var(--primary-color);
}

/* ── Page header (connects to active tab) ── */
.page-header {
  background: transparent;
  border: none;
  padding: 22px 24px 8px;
  margin: 0;
}

.page-header-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.page-title {
  margin: 0;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--card-title-color);
  position: relative;
  display: inline-block;
  padding-left: 14px;
}

.page-title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 4px;
  border-radius: 3px;
  background: var(--page-accent, #0077B5);
}

.page-subtitle {
  margin: 4px 0 0 14px;
  font-size: 13.5px;
  color: var(--card-text-muted);
}

.page-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.page-body {
  max-width: 1280px;
  margin: 0 auto;
  padding: 20px 24px 60px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ── Schedule matrix ── */
.schedule-week-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary-color);
  background: rgba(0, 119, 181, 0.08);
  padding: 6px 14px;
  border-radius: 999px;
}

.schedule-unscheduled-chip {
  font-size: 12.5px;
  font-weight: 600;
  color: #4b5563;
  background: #f0f2f5;
  padding: 6px 14px;
  border-radius: 999px;
}

.matrix-card {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.07);
  padding: 18px 20px 20px;
  border: 1px solid #edf0f5;
}

.matrix-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.matrix-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  align-items: center;
  font-size: 12px;
  color: #64748b;
}

/* Week up/down navigation - elegant pill: arrows either side of the label */
.matrix-week-nav {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  padding: 3px 6px;
}
.matrix-nav-btn {
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #334155;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.matrix-nav-btn:hover:not(:disabled) {
  background: #ffffff;
  color: var(--primary-color);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.12);
}
.matrix-nav-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.matrix-week-nav-label {
  font-size: 11.5px;
  font-weight: 700;
  color: #475569;
  padding: 0 8px;
  cursor: pointer;
  white-space: nowrap;
}
.matrix-week-nav-label:hover {
  color: var(--primary-color);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Completed campaigns in the legend: small font, faded dot - stays until
   the last post that belonged to the campaign is no longer tracked. */
.legend-item-completed {
  font-size: 10.5px;
  color: #94a3b8;
}
.legend-item-completed .legend-dot {
  opacity: 0.4;
  filter: saturate(0.5);
}

.legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}

.matrix-hint {
  font-size: 12px;
  color: #94a3b8;
}

.matrix-plus-glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  background: #0077B5;
  color: white;
  font-weight: 700;
  font-size: 11px;
  margin: 0 2px;
}

/* Scroll container (mobile: horizontal scroll) */
.matrix-scroll {
  overflow-x: auto;
  /* CRITICAL: overflow-x:auto makes the browser compute overflow-y as `auto`
     too (a `visible` value on the other axis becomes `auto`). That turned this
     element into a vertical scroll container which swallowed vertical swipes on
     mobile - the matrix covers ~88% of a phone screen, so the page could not be
     scrolled at all. Pin the vertical axis and let touch pan horizontally only,
     so vertical gestures chain to the page. */
  overflow-y: hidden;
  /* touch-action must allow BOTH axes. `pan-x` alone restricts every gesture
     starting inside this element (it covers ~88% of a phone screen) to
     horizontal panning, so vertical swipes did nothing and the page could only
     be scrolled from the thin strip at the very bottom. With pan-x pan-y the
     horizontal pan is consumed here and the vertical pan chains to the page
     (this element cannot scroll vertically: overflow-y is hidden). */
  touch-action: pan-x pan-y;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
  border-radius: 12px;
  padding-bottom: 4px;
}

/* Grid: corner + 7 days, then per week: label + 7 days */
.week-matrix {
  display: grid;
  grid-template-columns: 118px repeat(7, minmax(128px, 1fr));
  min-width: 1020px;
  gap: 6px;
}

.matrix-corner {
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  padding: 4px 6px 10px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
}

.matrix-day-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 6px 10px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #eef1f6;
}

.matrix-day-head .day-name {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
}

.matrix-day-head .day-num {
  font-size: 16px;
  font-weight: 800;
  color: #334155;
  line-height: 1;
}

.matrix-day-head.is-today {
  background: linear-gradient(135deg, #0077B5, #00A0DC);
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(0, 119, 181, 0.3);
}

.matrix-day-head.is-today .day-name,
.matrix-day-head.is-today .day-num {
  color: #ffffff;
}

.matrix-week-label {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 3px;
  padding: 14px 10px;
  position: sticky;
  left: 0;
  background: #ffffff;
  z-index: 2;
  border-radius: 10px;
}

.matrix-week-label .week-name {
  font-size: 12.5px;
  font-weight: 800;
  color: #334155;
}

.matrix-week-label .week-range {
  font-size: 10.5px;
  color: #94a3b8;
  white-space: nowrap;
}

.matrix-week-label.current {
  background: rgba(0, 119, 181, 0.06);
}

.matrix-week-label.current .week-name {
  color: var(--primary-color);
}

/* ── Matrix cells ── */
.matrix-cell {
  min-height: 104px;
  border-radius: 12px;
  border: 1px solid #eef1f6;
  background: #ffffff;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  position: relative;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  cursor: pointer;
  overflow: hidden;
}

.matrix-cell:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}

/* Past empty: grayed ✕ */
.cell-empty-past {
  background: #f6f8fa;
  border-style: dashed;
  border-color: #e2e7ee;
  align-items: center;
  justify-content: center;
  cursor: default;
}

.cell-empty-past:hover {
  transform: none;
  box-shadow: none;
}

.empty-cross {
  color: #c3ccd8;
  font-size: 20px;
  font-weight: 300;
  opacity: 0.7;
}

/* Past post */
.cell-post-past {
  border-left: 4px solid var(--post-color, #28a745);
  background: linear-gradient(180deg, #ffffff 0%, #fbfdfc 100%);
}

/* Posts of COMPLETED campaigns: faded/desaturated scheme - the campaign is
   done, its posts are archived but still tracked (shown + clickable). */
.cell-post-completed {
  filter: saturate(0.45) opacity(0.72);
}
.cell-post-completed:hover {
  filter: saturate(0.6) opacity(0.92);
}
.cell-post-completed .cell-post-status,
.cell-post-completed .cell-post-title {
  color: #94a3b8 !important;
}

.cell-post-top {
  display: flex;
  align-items: center;
  /* Posted pip lives on the TOP-RIGHT, clear of the date badge (top-left) */
  justify-content: flex-end;
  gap: 6px;
  margin-left: 64px;
  min-height: 20px;
}

.cell-post-status {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #28a745;
  background: rgba(40, 167, 69, 0.1);
  padding: 2px 8px;
  border-radius: 999px;
}

/* Sparkline under the title in past-post cards (real snapshots only) */
.cell-post-spark {
  margin: 4px 0 2px;
  color: #4f8ef7;
  opacity: 0.85;
  line-height: 0;
}
.cell-post-spark svg { max-width: 100%; }

/* LinkedIn link chip inside past-post cards */
.cell-li-link {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 700;
  color: #0a66c2;
  background: rgba(10, 102, 194, 0.08);
  border: 1px solid rgba(10, 102, 194, 0.25);
  border-radius: 999px;
  padding: 1px 8px;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease;
}
.cell-li-link:hover { background: rgba(10, 102, 194, 0.15); }
.cell-li-hint {
  color: #0a66c2 !important;
  font-weight: 700;
  cursor: pointer;
}

/* Progression chart + responses blocks in the post stats modal */
.post-perf-chart,
.post-responses {
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border, rgba(148, 163, 184, 0.25));
  border-radius: 12px;
  background: var(--card-bg, #fff);
}
.chart-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}
.chart-title { font-size: 13px; font-weight: 700; }
.chart-legend-row { display: inline-flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.chart-legend { font-size: 10.5px; color: var(--card-text-muted, #64748b); display: inline-flex; gap: 8px; align-items: center; }
.chart-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 3px; vertical-align: middle; }
.chart-empty {
  font-size: 12.5px;
  color: var(--card-text-muted, #64748b);
  padding: 10px 0 6px;
  text-align: center;
}

/* Three mini-charts - side-by-side on desktop, stacked on mobile */
.perf-minis {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

/* Account growth: compact cumulative tiles, side-by-side on desktop,
   stacked on mobile. Period tabs on top (old Conversense style). */
.perf-growth-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  padding: 4px;
  background: #f1f5f9;
  border-radius: 999px;
  gap: 2px;
  max-width: 100%;
  margin-bottom: 12px;
}
.perf-growth-tab {
  border: 0;
  background: transparent;
  color: #64748b;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  letter-spacing: 0.01em;
  font-family: inherit;
}
.perf-growth-tab:hover:not(.is-active) {
  color: #0f172a;
  background: rgba(255, 255, 255, 0.6);
}
.perf-growth-tab.is-active {
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
}
.perf-growth-sub { font-size: 12.5px; color: var(--card-text-muted); margin: 0 0 14px; }
.perf-growth-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
}
.perf-growth-tile {
  border: 1px solid var(--border, rgba(148, 163, 184, 0.25));
  border-radius: 12px;
  background: var(--card-bg, #fff);
  padding: 14px;
  display: flex;
  flex-direction: column;
  /* Compact, consistent cards - never giant squares */
  min-height: 190px;
}
.perf-growth-tile-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}
.perf-growth-tile-label { font-size: 12.5px; font-weight: 700; }
.perf-growth-tile-value { font-size: 18px; font-weight: 800; color: var(--card-title-color); }
.perf-growth-tile-chart { flex: 1; min-height: 0; }
.perf-growth-tile-chart svg { height: 100%; }
.perf-growth-tile-wait {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 12px;
  color: var(--card-text-muted);
  line-height: 1.5;
  padding: 4px 6px;
}
.perf-growth-empty {
  border: 1px dashed var(--border, rgba(148, 163, 184, 0.35));
  border-radius: 12px;
  background: var(--card-bg, #fff);
  padding: 32px 24px;
  text-align: center;
}
.perf-growth-empty-icon { font-size: 26px; margin-bottom: 8px; }
.perf-growth-empty-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--card-title-color);
  margin-bottom: 6px;
}
.perf-growth-empty-text {
  font-size: 12.5px;
  color: var(--card-text-muted);
  max-width: 460px;
  margin: 0 auto;
  line-height: 1.55;
}

@media (max-width: 900px) {
  .perf-growth-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .perf-growth-grid { grid-template-columns: 1fr; }
  .perf-growth-tile { min-height: 160px; }
}
.perf-mini {
  height: 220px;
  display: flex;
  flex-direction: column;
}
  border: 1px solid var(--border, rgba(148, 163, 184, 0.25));
  border-radius: 8px;
  background: var(--card-bg, #fff);
  padding: 12px;
}
.perf-mini-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.perf-mini-label { font-size: 11px; font-weight: 600; }
.perf-mini-value { font-size: 12px; font-weight: 700; }
.perf-mini svg { height: 180px; }
.perf-mini p { font-size: 11px; color: var(--card-text-muted); margin: 0; }

/* Mobile: stack vertically */
@media (max-width: 767px) {
  .perf-minis {
    grid-template-columns: 1fr;
  }
}
  font-size: 12.5px;
  color: var(--card-text-muted, #64748b);
  padding: 10px 0 6px;
  text-align: center;
}
.resp-thread.compact { max-height: 260px; overflow-y: auto; }

.cell-unread-badge {
  font-size: 10.5px;
  font-weight: 800;
  color: #b45309;
  background: #fef3c7;
  padding: 2px 8px;
  border-radius: 999px;
  animation: gentle-pulse 2s ease-in-out infinite;
}

.cell-post-title {
  font-size: 12px;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.cell-post-stats {
  display: flex;
  gap: 8px;
  font-size: 10.5px;
  color: #64748b;
}

.mini-stat {
  background: #f1f5f9;
  padding: 1px 7px;
  border-radius: 999px;
  white-space: nowrap;
}

/* Future scheduled */
.cell-post-scheduled {
  border-top: 3px solid var(--post-color, #0077B5);
  background: linear-gradient(180deg, rgba(0, 119, 181, 0.04), #ffffff);
}

.time-chip {
  font-size: 11px;
  font-weight: 700;
  color: #ffffff;
  background: linear-gradient(135deg, #0077B5, #00A0DC);
  padding: 2px 10px;
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(0, 119, 181, 0.3);
}

.cell-post-campaign {
  font-size: 10.5px;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Date badge - top-left circle on every cell, since the column header only
   carries the weekday name (the date itself shifts week to week). */
.cell-date-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #8a94a6;
  background: rgba(148, 163, 184, 0.12);
  border-radius: 999px;
  padding: 2px 7px;
  line-height: 1.5;
  z-index: 1;
  pointer-events: none;
}
.cell-date-badge.is-today {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.25);
}
.cell-post-past .cell-date-badge { color: #7a8699; background: rgba(120, 130, 145, 0.12); }
/* Mobile day-column carousel already shows the real date in its own row
   header (week-page-day-head) - the in-cell badge would be redundant there. */
.week-page-day-cell .cell-date-badge { display: none; }

/* Empty today/future: + slot */
.cell-slot {
  border: 2px dashed #d3dae4;
  align-items: center;
  justify-content: center;
  background: #fafcff;
}

.cell-slot:hover {
  border-color: #0077B5;
  background: rgba(0, 119, 181, 0.05);
}

.cell-plus {
  font-size: 26px;
  font-weight: 300;
  color: #9db1c4;
  line-height: 1;
  transition: transform 0.15s ease, color 0.15s ease;
}

.cell-slot:hover .cell-plus {
  transform: scale(1.15);
  color: #0077B5;
}

.cell-today-tag {
  position: absolute;
  top: 6px;
  right: 8px;
  font-size: 9.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #0077B5;
  background: rgba(0, 119, 181, 0.1);
  padding: 1px 7px;
  border-radius: 999px;
}

.col-today {
  background-color: rgba(0, 119, 181, 0.045);
}

/* ── Campaign slots card ── */
.campaign-slots-card {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.07);
  padding: 18px 20px;
  border: 1px solid #edf0f5;
}

.slots-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.slots-head h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  color: var(--card-title-color);
}

.slots-count {
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
  background: #f0f2f5;
  padding: 3px 12px;
  border-radius: 999px;
}

.campaign-slots {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: stretch;
  gap: 12px;
}

.campaign-slot {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 16px;
  /* Grow vertically to fit real (often long) campaign titles - never clip. */
  min-height: 92px;
  height: auto;
  border-radius: 12px;
  border: 1px solid #e8ecf1;
  background: #ffffff;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: all 0.2s ease;
  min-width: 0;
}

.campaign-slot:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
  border-color: var(--slot-color, #0077B5);
}

.slot-empty {
  border: 2px dashed #d3dae4;
  justify-content: center;
  background: #fafcff;
}

.slot-empty:hover {
  border-color: #0077B5;
  background: rgba(0, 119, 181, 0.05);
}

.slot-plus {
  font-size: 24px;
  font-weight: 300;
  color: #9db1c4;
}

.slot-color-bar {
  width: 5px;
  align-self: stretch;
  border-radius: 999px;
  flex-shrink: 0;
}

.slot-body {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  flex: 1;
}

.slot-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.35;
  /* Full title, wrapped - this is the ONLY place the campaign title is
     shown on this card, so it must be fully readable. No line-clamp: the
     card grows vertically (min-height on .campaign-slot only sets a floor)
     instead of ever cutting text off. */
  white-space: normal;
  overflow-wrap: anywhere;
}

.slot-meta {
  font-size: 11px;
  color: #94a3b8;
  margin-top: auto;
  padding-top: 4px;
}

.slot-arrow {
  color: #c3ccd8;
  font-size: 16px;
  flex-shrink: 0;
  align-self: center;
}

/* Cancel-campaign control: bottom-left of the picker modal content. */
.picker-danger {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(220, 53, 69, 0.15);
  text-align: left;
}

/* ── Profile nudge card ── */
.profile-nudge-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: linear-gradient(135deg, #fff8f0, #fffdf8);
  border: 1px solid #f5e3c8;
  border-radius: 14px;
  padding: 14px 18px;
  margin-bottom: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.profile-nudge-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(240, 173, 78, 0.18);
}

.nudge-icon {
  font-size: 22px;
  margin-top: 2px;
}

.nudge-text {
  flex: 1;
  font-size: 13px;
  color: #7c6a52;
  line-height: 1.5;
}

.nudge-text strong {
  display: block;
  color: #92400e;
  font-size: 13.5px;
  margin-bottom: 2px;
}

.nudge-q {
  display: block;
  margin-top: 4px;
  font-style: italic;
  color: #b45309;
}

.nudge-cta {
  font-size: 12.5px;
  font-weight: 700;
  color: #b45309;
  white-space: nowrap;
  align-self: center;
  background: rgba(240, 173, 78, 0.12);
  padding: 6px 12px;
  border-radius: 8px;
}

/* ── Modal: bell (post stats) ── */
.bell-modal-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.bell-modal-head h3 {
  margin: 0;
  font-size: 19px;
  font-weight: 700;
}
  margin: 0;
  font-size: 17px;
}

.bell-campaign {
  margin: 2px 0 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--card-text-muted);
  padding: 0 0 6px 0;
}
  margin: 2px 0 0;
  font-size: 12.5px;
  color: var(--card-text-muted);
}

.bell-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: linear-gradient(135deg, #f59e0b, #f97316);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  box-shadow: 0 6px 16px rgba(245, 158, 11, 0.35);
  flex-shrink: 0;
}

.bell-icon-blue {
  background: linear-gradient(135deg, #0077B5, #00A0DC);
  box-shadow: 0 6px 16px rgba(0, 119, 181, 0.35);
}

.bell-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.bell-stat {
  background: #f8fafc;
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border: 1px solid #eef1f6;
}

.bell-stat-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
}

.bell-stat-value {
  font-size: 20px;
  font-weight: 800;
  color: #1e293b;
}

.bell-chart {
  margin-bottom: 14px;
}

.bell-messages {
  border-top: 1px solid #eef1f6;
  padding-top: 12px;
}

.bell-messages-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  font-weight: 700;
  color: #334155;
  margin-bottom: 8px;
}

.unread-count {
  background: #fef3c7;
  color: #b45309;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 10px;
  border-radius: 999px;
}

.msg-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid #f4f6f9;
}

.msg-row:last-child {
  border-bottom: none;
}

.msg-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0077B5, #00A0DC);
  color: white;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.msg-body {
  flex: 1;
  min-width: 0;
}

.msg-name {
  font-size: 12.5px;
  font-weight: 700;
  color: #1e293b;
}

.msg-text {
  font-size: 12px;
  color: #64748b;
  margin-top: 1px;
}

.msg-none {
  font-size: 12.5px;
  color: #94a3b8;
  text-align: center;
  padding: 14px;
}

.post-overview-body {
  max-height: 260px;
  overflow-y: auto;
  background: #f8fafc;
  border: 1px solid #eef1f6;
  border-radius: 10px;
  padding: 14px;
  font-size: 13px;
  line-height: 1.6;
  color: #334155;
  white-space: pre-wrap;
  margin-bottom: 14px;
}

/* ── Modal: campaign picker ── */
.picker-head h3 {
  margin: 0 0 4px;
  font-size: 19px;
  font-weight: 700;
}
  margin: 0 0 4px;
  font-size: 19px;
  font-weight: 700;
}
  margin: 0 0 4px;
  font-size: 17px;
}

.picker-sub {
  margin: 0 0 14px;
  font-size: 12.5px;
  color: var(--card-text-muted);
}

.campaign-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: stretch;
  gap: 8px;
  margin-bottom: 14px;
}

.campaign-tab {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  padding: 12px;
  /* Tall enough to show the FULL campaign title - this is the only place
     the title appears in this modal, so no separate summary card needed. */
  min-height: 76px;
  height: auto;
  border-radius: 10px;
  border: 1.5px solid #e2e7ee;
  background: #ffffff;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  color: #334155;
  transition: all 0.15s ease;
  min-width: 0;
}

.campaign-tab:hover {
  border-color: #b8c4d4;
}

.campaign-tab.active {
  border-color: var(--tab-color, #0077B5);
  background: color-mix(in srgb, var(--tab-color, #0077B5) 8%, white);
  box-shadow: 0 0 0 1px var(--tab-color, #0077B5);
}

.campaign-tab.empty {
  align-items: center;
  justify-content: center;
  border-style: dashed;
  color: #9db1c4;
  font-size: 20px;
  padding: 12px;
}

.tab-color-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 4px;
}

.tab-campaign-title {
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.picker-content {
  min-height: 120px;
}

.picker-posts-meta {
  font-size: 11.5px;
  font-weight: 600;
  color: #64748b;
  margin-bottom: 10px;
}

.picker-posts {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 280px;
  overflow-y: auto;
}

.picker-post-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid #eef1f6;
  background: #ffffff;
  font-size: 12.5px;
}

.picker-post-row.next {
  border-color: #0077B5;
  background: rgba(0, 119, 181, 0.05);
}

.picker-post-row.done {
  opacity: 0.65;
  background: #f8fafc;
}

.picker-post-row.locked {
  opacity: 0.55;
}

.picker-post-order {
  font-size: 11px;
  font-weight: 800;
  color: #94a3b8;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.picker-post-title {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 600;
  color: #334155;
}

.picker-lock {
  font-size: 13px;
  flex-shrink: 0;
}

.picker-empty {
  text-align: center;
  padding: 22px 10px;
  font-size: 13px;
  color: #64748b;
}

.picker-hint {
  font-size: 12px;
  color: #94a3b8;
  margin: 4px 0 12px;
}

.picker-error {
  color: #dc3545;
  font-size: 13px;
  text-align: center;
  padding: 16px;
}

.picker-reason {
  font-size: 12.5px;
  color: #475569;
  background: #f1f5f9;
  border-radius: 8px;
  padding: 8px 10px;
  margin: 6px 0 10px;
  line-height: 1.45;
}

/* ── Modal: arc length picker (campaign creation) ── */
.arc-count-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin: 14px 0 10px;
}

.arc-count-option {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 14px 6px;
  border-radius: 12px;
  border: 1.5px solid #e2e8f0;
  background: #fff;
  cursor: pointer;
  transition: all 0.15s ease;
}

.arc-count-option:hover:not(.disabled) {
  border-color: #0077B5;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 119, 181, 0.12);
}

.arc-count-option.recommended {
  border-color: #0077B5;
  background: rgba(0, 119, 181, 0.06);
  box-shadow: 0 0 0 1px rgba(0, 119, 181, 0.25);
}

.arc-count-option.disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.arc-count-num {
  font-size: 22px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1;
}

.arc-count-label {
  font-size: 11px;
  color: #64748b;
}

.arc-count-badge {
  position: absolute;
  top: -8px;
  right: -4px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.3px;
  background: #0077B5;
  color: #fff;
  padding: 2px 6px;
  border-radius: 999px;
  text-transform: uppercase;
}

.arc-outline {
  margin-top: 6px;
  border-top: 1px dashed #e2e8f0;
  padding-top: 10px;
}

.arc-outline-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #94a3b8;
  margin-bottom: 6px;
}

.arc-outline-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 12.5px;
  color: #475569;
  padding: 3px 0;
  line-height: 1.4;
}

.arc-outline-idx {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #eef2ff;
  color: #4f46e5;
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.arc-progress {
  text-align: center;
  padding: 10px 0 16px;
}

.arc-progress-text {
  font-size: 13px;
  color: #64748b;
  margin-top: 8px;
}

.badge-muted {
  background: #f1f5f9;
  color: #64748b;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
}

.picker-post-row.pending {
  border-style: dashed;
  background: #fafbfc;
}

@media (max-width: 480px) {
  .arc-count-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 5px;
  }
  .arc-count-num {
    font-size: 18px;
  }
}

/* ── Modal: idea picker ── */
.idea-picker-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 320px;
  overflow-y: auto;
}

/* Full, vertical idea cards in the campaign picker - same look and
   readability as the Ideas overview page. */
.picker-idea-stack {
  gap: 14px;
  max-height: 56vh;
  padding-right: 4px;
}

.picker-idea-card {
  cursor: pointer;
}

.picker-idea-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  border-left-color: #0077B5;
}

.idea-picker-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #eef1f6;
  background: #ffffff;
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 12.5px;
}

.idea-picker-row:hover {
  border-color: #0077B5;
  background: rgba(0, 119, 181, 0.05);
}

.idea-picker-bulb {
  font-size: 16px;
  flex-shrink: 0;
}

.idea-picker-title {
  flex: 1;
  min-width: 0;
  font-weight: 600;
  color: #334155;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.idea-picker-structure {
  font-size: 10px;
  font-weight: 700;
  color: #6c5ce7;
  background: rgba(108, 92, 231, 0.08);
  padding: 2px 8px;
  border-radius: 999px;
  flex-shrink: 0;
}

.idea-picker-arrow {
  font-size: 11.5px;
  font-weight: 700;
  color: #0077B5;
  flex-shrink: 0;
}

/* ── Performance page ── */
.perf-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.perf-stat-card {
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid #edf0f5;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.07);
  padding: 18px;
  border-top: 4px solid var(--stat-color, #0077B5);
}

.perf-stat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.perf-stat-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #64748b;
}

.perf-stat-trend {
  font-size: 11px;
  font-weight: 800;
  color: #28a745;
  background: rgba(40, 167, 69, 0.1);
  padding: 2px 8px;
  border-radius: 999px;
}

.perf-stat-value {
  font-size: 32px;
  font-weight: 800;
  color: #1e293b;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
}

.perf-two-col {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 16px;
}

.perf-panel {
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid #edf0f5;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.07);
  padding: 18px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.panel-head h3 {
  margin: 0;
  font-size: 14.5px;
  font-weight: 800;
  color: #1e293b;
}

.panel-badge {
  font-size: 11px;
  font-weight: 800;
  color: #0077B5;
  background: rgba(0, 119, 181, 0.1);
  padding: 2px 10px;
  border-radius: 999px;
}

.perf-notifications {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.perf-notification {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 10px;
  border: 1px solid #eef1f6;
  font-size: 12.5px;
}

.perf-notification.good { background: rgba(40, 167, 69, 0.05); border-color: rgba(40, 167, 69, 0.2); }
.perf-notification.bad { background: rgba(220, 53, 69, 0.05); border-color: rgba(220, 53, 69, 0.2); }
.perf-notification.info { background: rgba(0, 119, 181, 0.05); border-color: rgba(0, 119, 181, 0.2); }

.perf-n-icon {
  font-size: 16px;
  flex-shrink: 0;
}

.perf-n-body {
  display: flex;
  flex-direction: column;
  gap: 1px;
  color: #64748b;
}

.perf-n-body strong {
  color: #1e293b;
}

.perf-notification:hover { border-color: rgba(0, 119, 181, 0.45); }

.perf-n-link {
  color: #0077B5;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.perf-n-link:hover { text-decoration: underline; }

.perf-n-chips {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.perf-n-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.05);
  font-size: 11.5px;
  color: #334155;
  white-space: nowrap;
}

.perf-themes-list { display: flex; flex-direction: column; }

.perf-theme-row {
  padding: 10px 14px;
  border-bottom: 1px solid #eef1f6;
}

.perf-theme-row:last-child { border-bottom: none; }

.perf-theme-title {
  font-weight: 600;
  font-size: 13px;
  color: #1e293b;
  margin-bottom: 2px;
}

.perf-theme-meta {
  font-size: 11.5px;
  color: #8e9aaf;
  margin-bottom: 5px;
}

.perf-n-empty {
  font-size: 12.5px;
  color: #94a3b8;
  text-align: center;
  padding: 20px;
}

.perf-tips {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.perf-topic-times { grid-column: 1 / -1; }
.perf-topic-times-list { display: flex; flex-direction: column; }
.perf-topic-time {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 4px;
  border-bottom: 1px solid rgba(15, 35, 64, 0.07);
}
.perf-topic-time:last-child { border-bottom: none; }
.perf-tt-title { font-weight: 600; font-size: 13.5px; color: #1c2b3a; flex: 1; min-width: 0; }
.perf-tt-meta { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.perf-tt-window {
  font-size: 12px; font-weight: 600; color: #fff;
  background: linear-gradient(135deg, #0077b5, #00a0dc);
  border-radius: 20px; padding: 3px 10px;
}
.perf-tt-avg { font-size: 12px; color: #28a745; font-weight: 600; }
.perf-tt-n { font-size: 11.5px; color: #8a94a6; }
@media (max-width: 640px) {
  .perf-topic-time { flex-direction: column; align-items: flex-start; gap: 6px; }
  .perf-tt-meta { width: 100%; justify-content: space-between; }
}

.perf-tip {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #eef1f6;
  font-size: 12.5px;
  color: #475569;
  line-height: 1.45;
}

.tip-icon {
  flex-shrink: 0;
  font-size: 15px;
}

.perf-contacts-card {
  background: linear-gradient(135deg, #f0f9ff, #f5f0ff);
  border: 1px solid #dbeafe;
  border-radius: 14px;
  padding: 14px 18px;
  cursor: pointer;
  transition: all 0.2s ease;
}

/* ── Performance: honest locked state (analytics scope missing) ── */
.perf-locked-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: linear-gradient(135deg, #fff8f0, #fdf0ff);
  border: 1px solid #f3e3c2;
  border-radius: 14px;
  padding: 18px 20px;
}
.perf-locked-icon {
  font-size: 26px;
  line-height: 1;
  margin-top: 2px;
}
.perf-locked-body h3 {
  font-size: 15px;
  font-weight: 800;
  color: #5b4636;
  margin: 0 0 6px;
}
.perf-locked-body p {
  font-size: 13px;
  color: #6b5b4b;
  line-height: 1.5;
  margin: 0 0 8px;
}
.perf-locked-body p.perf-locked-hint {
  font-size: 12px;
  color: #8a7a6a;
  margin: 0;
}

/* ── Performance: big activity chart panel ── */
.perf-chart-big {
  min-height: 140px;
}

/* Perf stat card headers: keep the trend chip subtle and honest (no invented %) */
.perf-stat-trend {
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  background: #f1f5f9;
  border-radius: 999px;
  padding: 2px 8px;
}
.perf-contacts-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 119, 181, 0.12);
}

.perf-contacts-inner {
  display: flex;
  align-items: center;
  gap: 14px;
}

.contacts-emoji {
  font-size: 24px;
}

.perf-contacts-title {
  font-size: 16px;
  font-weight: 800;
  color: #1e293b;
}

.perf-contacts-sub {
  font-size: 12px;
  color: #64748b;
  margin-top: 2px;
}

/* ── Schedule inputs (post editor sidebar) ── */
.schedule-inputs {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.schedule-inputs input {
  padding: 7px 10px;
  border: 1px solid #d1d9e4;
  border-radius: 8px;
  font-size: 12.5px;
  font-family: inherit;
  color: #334155;
  background: #ffffff;
  width: 100%;
  box-sizing: border-box;
}

/* ==========================================================================
   MOBILE - tab interface
   ========================================================================== */
@media (max-width: 900px) {
  .perf-stats-grid { grid-template-columns: 1fr; }
  .perf-two-col { grid-template-columns: 1fr; }
  .campaign-slots { grid-template-columns: 1fr; }
  .campaign-tabs { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  /* App-style bottom tab bar: icons at the bottom, opening toward the content above */

  /* Betamaxx feedback widget: lift its FAB clear of the fixed bottom tab bar
     (74px = same reservation the app uses for .app-container padding). */
  #betamaxx-host { --bmx-bottom-offset: 74px; }
  .tab-top-bar .top-bar-inner {
    justify-content: center;
    padding: 10px 16px;
  }

  .tab-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    justify-content: space-around;
    overflow-x: visible;
    background: var(--card-bg);
    border-top: 1px solid #eef1f6;
    box-shadow: 0 -6px 20px rgba(15, 23, 42, 0.08);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
    box-sizing: border-box;
    z-index: 1000;
    gap: 0;
  }

  .tab-btn {
    flex: 1;
    flex-direction: column;
    justify-content: center;
    padding: 7px 4px 6px;
    font-size: 12px;
    gap: 3px;
    border-radius: 12px;
  }

  .tab-btn svg { width: 20px; height: 20px; }

  .tab-btn span { display: block; font-size: 9.5px; font-weight: 700; }

  .tab-btn.active {
    background: rgba(0, 119, 181, 0.12);
    color: var(--primary-color);
    box-shadow: none;
  }

  /* Indicator dot "opens toward the top" - connects the active tab to the page content above it */
  .tab-btn.active::after {
    content: '';
    position: absolute;
    top: -3px;
    left: 50%;
    bottom: auto;
    transform: translateX(-50%);
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--primary-color);
    border: none;
    filter: none;
  }

  .tab-icon-btn { display: none; }

  /* Leave room for the fixed bottom tab bar */
  .app-container { padding-bottom: 74px; }

  .page-header { padding: 14px 16px; }
  .page-title { font-size: 20px; }
  .page-body { padding: 14px 12px 20px; gap: 14px; }

  .matrix-card { padding: 12px; border-radius: 12px; }
  .week-matrix { min-width: 860px; grid-template-columns: 92px repeat(7, minmax(112px, 1fr)); gap: 4px; }
  .matrix-cell { min-height: 92px; padding: 12px; }

  /* Mobile: transposed day-column snap carousel replaces the row grid */
  .matrix-scroll.is-mobile .week-matrix {
    display: block;
    min-width: 0;
  }
  .matrix-scroll.is-mobile {
    scroll-snap-type: x mandatory;
  }

  .campaign-slots-card { padding: 14px; }
  .campaign-slot { padding: 12px; }

  .bell-stats-grid { grid-template-columns: 1fr; gap: 8px; }
  .bell-stat { padding: 12px; }

  .matrix-hint { display: none; }

  /* No card animations on mobile - solid, no shaking */
  .dashboard-card, .perf-stat-card, .matrix-card, .campaign-slots-card, .perf-panel {
    animation: none !important;
  }

  /* ── Contacts list: stop the horizontal squeeze that pushed past 100vw and
     disturbed the fixed bottom tab bar. Rows stack vertically instead of
     forcing name/headline/interactions onto one line. ── */
  .contact-row {
    flex-wrap: wrap;
    gap: 8px 10px;
    padding: 12px 14px;
  }
  .contact-row .contact-name {
    min-width: 0;
    max-width: calc(100% - 50px);
    flex: 1 1 auto;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .contact-headline {
    flex: 1 1 100%;
    order: 3;
    white-space: normal;
    overflow-wrap: anywhere;
    font-size: 12.5px;
  }
  .contact-interactions {
    flex: 0 0 auto;
    order: 2;
    font-size: 11px;
  }
  .contact-row-arrow { order: 4; margin-left: auto; }
  .contact-avatar { order: 0; }
  .contact-last-seen { order: 5; margin-left: 0; }
  .contacts-filters { flex-direction: column; gap: 8px; }
  .contacts-filters select { width: 100%; }
  .contacts-stats-row { grid-template-columns: repeat(2, 1fr); }
  .contacts-topic-row { grid-template-columns: 1fr; gap: 4px; }
  .contacts-topic-n { text-align: left; }

  /* ── Profile fields: long values (LinkedIn headlines, context blurbs) must
     wrap instead of forcing the card wider than the viewport. ── */
  .profile-field { max-width: 100%; }
  .profile-field div {
    overflow-wrap: anywhere;
    word-break: break-word;
  }
  .linkedin-connected-box,
  .linkedin-connected-box > div:not(.linkedin-avatar) {
    min-width: 0;
  }
  .linkedin-connected-box { flex-wrap: wrap; }
  .linkedin-connected-box div[style*="font-weight:600"],
  .linkedin-connected-box div[style*="color:var(--card-text-muted)"] {
    overflow-wrap: anywhere;
  }

  /* ── Hard global guard: nothing may create horizontal scroll on mobile,
     which is what pushed/disturbed the fixed bottom tab bar. ──
     CAREFUL: `overflow-x: hidden` on BODY forces its overflow-y to compute as
     `auto`, turning body into a scroll container that cannot actually scroll
     (the page scrolls on <html>). Every vertical swipe starting inside body was
     swallowed there - the page only scrolled from the thin strip at the very
     bottom. Clip horizontally on <html> only and leave body fully visible. */
  html { overflow-x: clip; max-width: 100vw; }
  body { overflow-x: visible; overflow-y: visible; max-width: 100vw; }
  .app-container, .page-body, .detail-config-card {
    max-width: 100%;
    overflow-wrap: anywhere;
  }
}

/* ══════════════════════════════════════════════════════════════
   CAMPAIGN-COLORED MATRIX POSTS + FADED PAST POSTS
   ══════════════════════════════════════════════════════════════ */

/* Scheduled posts carry the full campaign color */
.cell-post-scheduled {
  border-top: 3px solid var(--post-color, #0077B5);
  background: color-mix(in srgb, var(--post-color, #0077B5) 6%, #ffffff);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--post-color, #0077B5) 18%, transparent);
}
.cell-post-scheduled:hover {
  box-shadow: 0 6px 18px color-mix(in srgb, var(--post-color, #0077B5) 22%, transparent);
}

/* Past posts: same campaign color, faded - history, not news */
.cell-post-past {
  border-left: 4px solid color-mix(in srgb, var(--post-color, #28a745) 45%, #c8ccd4);
  background: color-mix(in srgb, var(--post-color, #28a745) 5%, #f7f8fa);
  opacity: 0.85;
  filter: saturate(0.55);
  transition: opacity 0.15s ease, filter 0.15s ease, transform 0.15s ease;
}
.cell-post-past:hover {
  opacity: 1;
  filter: saturate(0.85);
}
.cell-post-past .cell-post-status {
  background: rgba(40, 167, 69, 0.12);
  color: #1f8a3d;
}

/* ── Schedule best-time chip (own stats) ── */
.schedule-best-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: #6d4a00;
  background: #fff7e0;
  border: 1px solid #f3e3b2;
  padding: 5px 12px;
  border-radius: 999px;
  white-space: nowrap;
}
.schedule-best-chip strong { font-weight: 800; }

/* ── Danger ghost button (de-schedule) ── */
.btn-danger-ghost {
  background: transparent;
  color: #c0392b;
  border: 1px solid #e8b4ad;
}
.btn-danger-ghost:hover {
  background: #fdf0ee;
}

/* ══════════════════════════════════════════════════════════════
   MOBILE MATRIX - day-column snap carousel
   ══════════════════════════════════════════════════════════════ */
.matrix-scroll.is-mobile {
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scroll-padding-left: 0;
}
/* Full-week pages: swipe left/right for prev/next week, all 7 days visible per page */
.mobile-week-matrix {
  display: flex;
  min-width: 100%;
}
.week-page {
  flex: 0 0 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 2px 4px;
}
.week-page-label {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 2px 2px 4px;
}
.week-page-name {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
}
.week-page-label.current .week-page-name { color: #0077B5; }
.week-page-range {
  font-size: 11.5px;
  color: #94a3b8;
}
.week-page-days {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.week-page-day {
  display: flex;
  align-items: stretch;
  gap: 10px;
}
.week-page-day-head {
  flex: 0 0 52px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 6px 2px;
  border-radius: 10px;
  background: #f7f9fb;
}
.week-page-day.is-today .week-page-day-head {
  background: linear-gradient(135deg, rgba(0,119,181,0.12), rgba(0,160,220,0.08));
}
.week-page-day-head .day-name {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
}
.week-page-day-head .day-num {
  font-size: 16px;
  font-weight: 800;
  color: #1e293b;
}
.week-page-day.is-today .day-name,
.week-page-day.is-today .day-num {
  color: #0077B5;
}
.week-page-day-head .snap-today {
  font-size: 7.5px;
  padding: 1px 6px;
  margin: 2px 0 0;
}
.snap-today {
  font-size: 10px;
  font-weight: 800;
  color: #ffffff;
  background: linear-gradient(135deg, #0077B5, #00A0DC);
  padding: 2px 10px;
  border-radius: 999px;
  margin-left: auto;
  box-shadow: 0 2px 8px rgba(0, 119, 181, 0.35);
}
.week-page-day-cell {
  flex: 1;
  min-width: 0;
}
.week-page-day-cell .matrix-cell {
  min-height: 64px;
  width: 100%;
}
.week-page-day-cell .cell-empty-past { min-height: 48px; }
.week-page-day-cell .cell-slot { min-height: 56px; }
.week-page-day-cell .cell-post-title { font-size: 12px; line-height: 1.3; }
.week-page-day-cell .cell-post-campaign { display: none; }
/* Week tag no longer needed - each page is a single week now */
.cell-week-tag { display: none; }
/* page dots under the mobile matrix */
.mobile-matrix-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 10px;
}
.mobile-matrix-dots span {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #d3dae4;
  transition: background 0.2s ease, width 0.2s ease;
}
.mobile-matrix-dots span.active {
  background: #0077B5;
  width: 18px;
}

/* ══════════════════════════════════════════════════════════════
   POST EDITOR - story flow with final scheduling step
   ══════════════════════════════════════════════════════════════ */
.editor-flow {
  max-width: 780px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 20px 16px 60px;
}
.editor-story-card {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--story-accent, #0077B5) 8%, #ffffff), #ffffff);
  border: 1px solid color-mix(in srgb, var(--story-accent, #0077B5) 22%, #e8ecf1);
  border-left: 4px solid var(--story-accent, #0077B5);
  border-radius: 16px;
  padding: 18px 20px;
}
.editor-story-kicker {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--story-accent, #0077B5);
}
.editor-story-card h2 {
  font-size: 21px;
  font-weight: 800;
  color: #1e293b;
  margin: 4px 0 2px;
  line-height: 1.25;
}
.editor-story-campaign {
  font-size: 13px;
  color: #64748b;
  margin: 0;
}
.editor-story-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  text-align: right;
  min-width: 120px;
}
.editor-story-angle {
  font-size: 12px;
  color: #64748b;
  font-style: italic;
  margin: 0;
  max-width: 260px;
}
.editor-block {
  background: #ffffff;
  border: 1px solid #e8ecf1;
  border-radius: 16px;
  padding: 18px 20px;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
}
.editor-block-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.editor-block-head h3 {
  font-size: 15px;
  font-weight: 800;
  color: #1e293b;
  margin: 0;
}
.editor-step-num {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: linear-gradient(135deg, #0077B5, #00A0DC);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 119, 181, 0.35);
}
/* Final step block - visually distinct as the finish line */
.editor-schedule-block {
  border: 2px solid rgba(0, 119, 181, 0.25);
  background: linear-gradient(180deg, rgba(0, 119, 181, 0.035), #ffffff 30%);
  box-shadow: 0 4px 18px rgba(0, 119, 181, 0.08);
}
.editor-title-input {
  width: 100%;
  font-size: 17px;
  font-weight: 700;
  color: #1e293b;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 12px;
  box-sizing: border-box;
}
.editor-title-input:focus {
  outline: none;
  border-color: #0077B5;
  box-shadow: 0 0 0 3px rgba(0, 119, 181, 0.12);
}
/* Suggestion banner */
.editor-suggestion {
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 14px;
}
.editor-suggestion.from-own {
  background: linear-gradient(135deg, rgba(40, 167, 69, 0.09), rgba(40, 167, 69, 0.03));
  border: 1px solid rgba(40, 167, 69, 0.3);
}
.editor-suggestion.from-research {
  background: linear-gradient(135deg, rgba(108, 92, 231, 0.09), rgba(108, 92, 231, 0.03));
  border: 1px solid rgba(108, 92, 231, 0.3);
}
.editor-suggestion.from-nearest {
  background: linear-gradient(135deg, rgba(0, 119, 181, 0.09), rgba(0, 119, 181, 0.03));
  border: 1px solid rgba(0, 119, 181, 0.32);
}
.editor-ab-chip {
  font-size: 11px;
  font-weight: 700;
  color: #7a5c00;
  background: linear-gradient(135deg, #ffe9a8, #ffd966);
  border: 1px solid rgba(180, 140, 20, 0.4);
  border-radius: 20px;
  padding: 2px 9px;
  white-space: nowrap;
  animation: pulse-glow 2.4s ease-in-out infinite;
}
.editor-alternatives {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.editor-alt {
  font-size: 11.5px;
  font-weight: 600;
  color: #55617a;
  background: rgba(15, 35, 64, 0.05);
  border-radius: 14px;
  padding: 3px 9px;
}
.editor-alt.chosen {
  color: #fff;
  background: linear-gradient(135deg, #0077b5, #00a0dc);
}
.ab-badge {
  font-size: 10px;
  font-weight: 700;
  color: #7a5c00;
  background: linear-gradient(135deg, #ffe9a8, #ffd966);
  border-radius: 10px;
  padding: 1px 6px;
  margin-left: 6px;
  vertical-align: middle;
}
.editor-suggestion-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.editor-suggestion-label {
  font-size: 15px;
  color: #334155;
}
.editor-suggestion-label strong {
  font-size: 16px;
  color: #1e293b;
}
.editor-suggestion-source {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  color: #475569;
  border: 1px solid rgba(0, 0, 0, 0.06);
}
.editor-suggestion-reason {
  font-size: 12.5px;
  color: #64748b;
  margin: 8px 0 0;
  line-height: 1.45;
}
.editor-insight-hint {
  font-size: 12.5px;
  color: #4b5563;
  background: #f1f5ff;
  border: 1px solid #dbe4ff;
  border-radius: 10px;
  padding: 9px 12px;
  margin: 0 0 14px;
}
.editor-chip-label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #94a3b8;
  margin: 14px 0 8px;
}
.editor-day-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  /* Same trap as .matrix-scroll: keep the vertical axis out of it so mobile
     swipes scroll the page instead of being swallowed by this strip. */
  overflow-y: hidden;
  touch-action: pan-x pan-y;
  overscroll-behavior-x: contain;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
}
.editor-time-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.editor-chip {
  position: relative;
  border: 1.5px solid #e2e8f0;
  background: #ffffff;
  border-radius: 12px;
  padding: 8px 14px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}
.editor-chip.day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  min-width: 58px;
  flex: 0 0 auto;
}
.chip-wd {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
}
.chip-d {
  font-size: 18px;
  font-weight: 800;
  color: #1e293b;
}
.chip-today {
  font-size: 9px;
  font-weight: 800;
  color: #0077B5;
}
.editor-chip.time {
  font-size: 13.5px;
  font-weight: 700;
  color: #334155;
}
.editor-chip:hover {
  border-color: #0077B5;
  transform: translateY(-1px);
}
.editor-chip.selected {
  border-color: #0077B5;
  background: linear-gradient(135deg, #0077B5, #00A0DC);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 119, 181, 0.3);
}
.editor-chip.selected .chip-wd,
.editor-chip.selected .chip-d,
.editor-chip.selected .chip-today {
  color: #ffffff;
}
.editor-chip.suggested:not(.selected) {
  border-color: rgba(108, 92, 231, 0.6);
  background: rgba(108, 92, 231, 0.06);
}
.chip-sug {
  position: absolute;
  top: -7px;
  right: -7px;
  font-size: 12px;
  background: #6c5ce7;
  border-radius: 999px;
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(108, 92, 231, 0.4);
}
.editor-schedule-cta {
  width: 100%;
  margin-top: 18px;
  font-size: 16px;
  padding: 14px;
}
.editor-alt-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 12px;
  flex-wrap: wrap;
}

/* ── Ideas page: traction insight strip ── */
.ideas-traction-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, rgba(255, 122, 0, 0.09), rgba(255, 122, 0, 0.03));
  border: 1px solid rgba(255, 122, 0, 0.3);
  border-radius: 14px;
  padding: 13px 16px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.ideas-traction-strip:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(255, 122, 0, 0.15);
}
.traction-icon { font-size: 20px; }
.traction-body {
  flex: 1;
  font-size: 13px;
  color: #5c5346;
  line-height: 1.45;
}
.traction-body strong { color: #7a4a00; }
.traction-cta {
  font-size: 12px;
  font-weight: 800;
  color: #c2410c;
  white-space: nowrap;
}

/* ══════════════════════════════════════════════════════════════
   PLAN / TRIAL PAGE - "continued access" gate
   Shown when a trial expires or a paid period lapses. Today it offers
   request-by-email; the same page becomes the Stripe Checkout entry.
   ══════════════════════════════════════════════════════════════ */
.plan-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(1200px 600px at 20% -10%, rgba(0,119,181,0.08), transparent 60%),
              radial-gradient(1000px 500px at 90% 110%, rgba(124,58,237,0.06), transparent 60%),
              var(--bg, #f6f8fb);
}
.plan-card {
  width: 100%;
  max-width: 480px;
  background: var(--card-bg, #fff);
  border: 1px solid var(--card-border, #e6eaf0);
  border-radius: 18px;
  box-shadow: 0 18px 50px rgba(15, 40, 80, 0.12);
  padding: 40px 36px;
  text-align: center;
}
.plan-card h1 { font-size: 24px; margin: 14px 0 8px; }
.plan-text { color: var(--card-text-muted, #64748b); font-size: 14px; line-height: 1.55; }
.plan-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 22px 0;
}
.plan-fact {
  background: var(--bg, #f6f8fb);
  border: 1px solid var(--card-border, #e6eaf0);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12px;
  color: var(--card-text-muted, #64748b);
}
.plan-fact strong { display: block; font-size: 14px; color: var(--text, #0f172a); margin-top: 2px; }
.plan-cta {
  border-top: 1px dashed var(--card-border, #e6eaf0);
  padding-top: 18px;
}
.plan-cta-note { font-size: 12.5px; color: var(--card-text-muted, #64748b); margin-bottom: 14px; line-height: 1.5; }

/* ==========================================================================
   POST EDITOR - WRITING-FIRST LAYOUT
   The text editor is the page. Context is a thin strip, scheduling lives in
   a modal, and the improvement box sits directly under the text it rewrites.
   ========================================================================== */

.editor-writing-first {
  max-width: 820px;
  gap: 12px;
}

/* ① Context strip - small on purpose (reference, not the work) */
.editor-context-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  border-left: 3px solid var(--story-accent, #0077B5);
  background: color-mix(in srgb, var(--story-accent, #0077B5) 5%, #ffffff);
  border-radius: 8px;
  font-size: 12px;
}
.editor-context-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex-wrap: wrap;
}
.editor-context-campaign {
  font-weight: 700;
  color: #334155;
}
.editor-context-angle {
  color: #64748b;
  font-style: italic;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 340px;
}
.editor-context-right { flex-shrink: 0; }

/* ② The writing surface - dominant element */
.editor-writing-surface {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 18px 20px 12px;
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.06);
}
.editor-writing-surface .editor-title-input {
  width: 100%;
  border: none;
  border-bottom: 1px solid #eef2f7;
  border-radius: 0;
  padding: 4px 0 12px;
  font-size: 20px;
  font-weight: 700;
  color: #1e293b;
  background: transparent;
  box-sizing: border-box;
}
.editor-writing-surface .editor-title-input:focus {
  outline: none;
  border-bottom-color: var(--primary-color);
}
.editor-main-textarea {
  min-height: 52vh;
  border: none !important;
  padding: 16px 0 8px !important;
  font-size: 17px !important;
  line-height: 1.7 !important;
  box-shadow: none !important;
  resize: vertical;
}
.editor-main-textarea:focus {
  outline: none;
  box-shadow: none !important;
}
.editor-main-textarea.is-regenerating {
  opacity: 0.5;
  pointer-events: none;
}
.editor-surface-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border-top: 1px solid #f1f5f9;
  padding-top: 8px;
  flex-wrap: wrap;
}
.editor-surface-footer .char-counter { margin: 0; }
.editor-hashtags-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.hashtag-inline-input {
  border: 1px dashed #cbd5e1;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
  width: 110px;
  background: transparent;
}
.hashtag-inline-input:focus {
  outline: none;
  border-color: var(--primary-color);
  border-style: solid;
}

/* ③ Ask for improvements - directly under the text */
.editor-improve {
  background: linear-gradient(135deg, #f8fbff, #ffffff);
  border: 1px solid #dbeafe;
  border-radius: 14px;
  padding: 14px 16px;
}
.editor-improve-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 8px;
}
.editor-improve-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
}
.editor-improve-input {
  flex: 1;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
  resize: vertical;
  box-sizing: border-box;
}
.editor-improve-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(0, 119, 181, 0.1);
}
.editor-improve-btn {
  flex-shrink: 0;
  align-self: stretch;
  padding-left: 18px;
  padding-right: 18px;
}
.editor-improve-hint {
  font-size: 11.5px;
  color: var(--card-text-muted);
  margin: 8px 0 0;
}
.editor-improve-learned {
  margin-top: 10px;
  padding: 8px 10px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 8px;
  font-size: 12.5px;
  color: #065f46;
}

/* ④ Action bar - scheduling opens a modal */
.editor-action-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 0 0;
  flex-wrap: wrap;
}
.editor-action-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

@media (max-width: 640px) {
  .editor-improve-row { flex-direction: column; }
  .editor-improve-btn { align-self: flex-end; }
  .editor-main-textarea { min-height: 44vh; }
  .editor-context-angle { max-width: 100%; white-space: normal; }
  .editor-action-bar { flex-direction: column-reverse; align-items: stretch; }
  .editor-action-right { justify-content: space-between; }
}

/* ── Chat with your context ─────────────────────────────── */
.context-chat-bubble {
  max-width: 88%;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}
.context-chat-bubble.assistant {
  align-self: flex-start;
  background: var(--card-bg-alt, #f1f3f5);
  color: var(--card-text);
  border-top-left-radius: 4px;
}
.context-chat-bubble.user {
  align-self: flex-end;
  background: #0077b5;
  color: #fff;
  border-top-right-radius: 4px;
}
.context-chat-bubble.sys {
  align-self: center;
  background: transparent;
  color: var(--card-text-muted);
  font-size: 12px;
  border: 1px dashed var(--card-border, #d1d5db);
}
.context-chat-chip {
  background: var(--card-bg-alt, #eef2f6);
  border: 1px solid var(--card-border, #d1d5db);
  color: var(--card-text);
  border-radius: 10px;
  padding: 2px 8px;
  font-size: 11px;
}
#context-chat-input {
  border: 1px solid var(--card-border, #d1d5db);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  background: var(--card-bg, #fff);
  color: var(--card-text);
}
#context-chat-input:focus { outline: none; border-color: #0077b5; }

/* ── Repost card (bell modal) ── */
.repost-card { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--card-border, #e5e7eb); }
.repost-label { display: block; font-size: 12px; color: var(--card-text-muted); margin: 8px 0 2px; }
.repost-targets { display: flex; flex-direction: column; gap: 4px; margin: 6px 0 2px; }
.repost-loading { font-size: 12px; color: var(--card-text-muted); margin: 4px 0; }
.repost-target {
  display: flex; align-items: center; gap: 8px; padding: 6px 9px;
  border: 1px solid var(--card-border, #d1d5db); border-radius: 6px;
  cursor: pointer; font-size: 13px; background: var(--card-bg, #fff);
}
.repost-target input { margin: 0; accent-color: #0077b5; }
.repost-target .repost-used { margin-left: auto; font-size: 11px; color: var(--card-text-muted); white-space: nowrap; }
.repost-target.disabled { opacity: 0.55; cursor: default; }
.repost-input {
  width: 100%; box-sizing: border-box; margin: 6px 0; padding: 8px 10px;
  border: 1px solid var(--card-border, #d1d5db); border-radius: 6px;
  font-family: inherit; font-size: 13px; background: var(--card-bg, #fff); color: var(--card-text);
}
.repost-input:focus { outline: none; border-color: #0077b5; }
.repost-row { display: flex; gap: 8px; align-items: center; }
.repost-row .repost-input { flex: 1; margin: 6px 0; }
.repost-mode-toggle { font-size: 12px; margin: 2px 0 0; }
.repost-mode-toggle a { color: #0077b5; cursor: pointer; }
.repost-note { font-size: 12px; color: var(--card-text-muted); margin: 4px 0 0; }
.repost-list-title {
  font-size: 11px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--card-text-muted); margin: 10px 0 4px;
}
.repost-list-item {
  display: flex; gap: 6px; align-items: center; flex-wrap: wrap;
  font-size: 12px; padding: 3px 0; color: var(--card-text);
}
.repost-list-item a { color: #0077b5; }

/* ── Context improve/edit tools (subtle, on the context card) ─────────── */
.ctx-improve-row {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  align-items: center;
  flex-wrap: wrap;
}
/* The improve input gets its OWN line - full width available, never
   squeezed next to the edit button (feedback: "the improve window is
   tiny, should have its own line"). */
#ctx-improve-input {
  flex: 1 1 100%;
  font-size: 14px;
  padding: 9px 12px;
  border: 1px solid var(--card-text-muted, #8e9aaf);
  border-radius: 6px;
  background: var(--card-bg, #fff);
  color: var(--card-text-color, #333);
  min-width: 0;
  box-sizing: border-box;
}
#ctx-tools-row .btn { flex: 0 0 auto; }
.ctx-tool-btn {
  background: transparent;
  border: 1px solid var(--card-text-muted, #8e9aaf);
  border-radius: 6px;
  color: var(--card-text-muted, #8e9aaf);
  font-size: 12.5px;
  padding: 5px 10px;
  cursor: pointer;
  white-space: nowrap;
}
.ctx-tool-btn:hover {
  border-color: var(--accent-color, #0073B1);
  color: var(--accent-color, #0073B1);
}
#ctx-improve-input::placeholder {
  color: var(--card-text-muted, #8e9aaf);
  font-style: italic;
}
.ctx-edit-area {
  margin-top: 12px;
}
.ctx-edit-field {
  margin-bottom: 10px;
}
.ctx-edit-field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--card-text-muted, #8e9aaf);
  margin-bottom: 4px;
}
.ctx-edit-field textarea {
  width: 100%;
  box-sizing: border-box;
  font-size: 13px;
  line-height: 1.5;
  padding: 8px;
  border: 1px solid var(--card-text-muted, #8e9aaf);
  border-radius: 6px;
  background: var(--card-bg, #fff);
  color: var(--card-text-color, #333);
  resize: vertical;
  font-family: inherit;
}
.ctx-edit-field textarea:focus {
  outline: none;
  border-color: var(--accent-color, #0073B1);
}
.ctx-edit-note {
  color: var(--card-text-muted, #8e9aaf);
  font-size: 12px;
  margin-top: 6px;
}
.ctx-edit-note a {
  color: var(--accent-color, #0073B1);
  text-decoration: none;
}
.ctx-edit-note a:hover {
  text-decoration: underline;
}

/* ── Arc count selection (select-then-submit, never commit-on-click) ──── */
.arc-count-option.selected {
  border-color: #0077B5;
  background: rgba(0, 119, 181, 0.07);
  box-shadow: 0 0 0 1px #0077B5 inset;
}
.arc-count-option.selected .arc-count-num {
  color: #0077B5;
}
.arc-count-option.selected::after {
  content: "✓";
  position: absolute;
  top: 6px;
  right: 8px;
  font-size: 13px;
  color: #0077B5;
  font-weight: 700;
}
#arc-selected-label {
  font-weight: 600;
  color: var(--accent-color, #0073B1);
  margin: 4px 0 8px;
}
