/* ==============================================
   NICKRON AI ADS COPILOT — DESIGN SYSTEM v2
   Inspired by: Linear, Vercel, Stripe
   Dark-first · Data-dense · Brand-forward
   ============================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* -----------------------------------------------
   RESET
----------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
button { font-family: inherit; }
img { display: block; max-width: 100%; }
/* Ensure [hidden] always wins over display rules from author CSS */
[hidden] { display: none !important; }

/* -----------------------------------------------
   DESIGN TOKENS
----------------------------------------------- */
:root {
  /* Backgrounds */
  --bg:           #07070a;
  --bg-raised:    #0d0d12;
  --surface:      #121218;
  --surface-hover:#18181f;
  --surface-alt:  #1e1e28;

  /* Borders */
  --border:       #1c1c28;
  --border-mid:   #252535;
  --border-strong:#2e2e42;

  /* Text */
  --text:         #e4e4f0;
  --text-sub:     #9090b0;
  --text-muted:   #5a5a7a;
  --text-dim:     #32324a;

  /* Brand */
  --lime:         #c7ff2e;
  --lime-dim:     rgba(199,255,46,0.08);
  --lime-glow:    rgba(199,255,46,0.22);

  /* Semantics */
  --blue:         #4f8cff;
  --blue-dim:     rgba(79,140,255,0.10);
  --green:        #23d18b;
  --green-dim:    rgba(35,209,139,0.10);
  --red:          #f87171;
  --red-dim:      rgba(248,113,113,0.10);
  --amber:        #fbbf24;
  --amber-dim:    rgba(251,191,36,0.10);
  --purple:       #a78bfa;
  --purple-dim:   rgba(167,139,250,0.10);
  --coral:        #fb7185;
  --coral-dim:    rgba(251,113,133,0.10);
  --teal:         #2dd4bf;
  --teal-dim:     rgba(45,212,191,0.10);

  /* Named accents for panels */
  --accent-lime:   #c7ff2e;
  --accent-blue:   #4f8cff;
  --accent-violet: #a78bfa;
  --accent-coral:  #fb7185;
  --accent-teal:   #2dd4bf;
  --accent-pink:   #f472b6;
  --accent-cyan:   #38bdf8;
  --accent-gold:   #fbbf24;
  --accent-green:  #23d18b;

  /* Card accent (per-component override) */
  --card-accent: var(--lime);
  --dot-color:   var(--lime);

  /* Layout */
  --sidebar-w:  220px;
  --topbar-h:   64px;

  /* Radius */
  --r-xs: 4px;
  --r-sm: 6px;
  --r:    10px;
  --r-lg: 14px;
  --r-xl: 18px;

  /* Transitions */
  --ease:   0.14s ease;
  --ease-m: 0.22s ease;
}

/* -----------------------------------------------
   BASE
----------------------------------------------- */
html {
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  overflow: hidden;
  height: 100dvh;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text);
  line-height: 1.2;
}

p { color: var(--text-sub); }
a { color: var(--blue); text-decoration: none; transition: color var(--ease); }
a:hover { color: #7baeff; }

/* -----------------------------------------------
   APP SHELL
----------------------------------------------- */
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  height: 100dvh;
  overflow: hidden;
}

/* -----------------------------------------------
   SIDEBAR
----------------------------------------------- */
.sidebar {
  display: flex;
  flex-direction: column;
  background: var(--bg-raised);
  border-right: 1px solid var(--border);
  height: 100dvh;
  overflow: hidden;
}

.brand-block {
  padding: 16px 14px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
  text-decoration: none;
  color: inherit;
}

.brand-wordmark {
  width: 130px;
  height: auto;
  object-fit: contain;
  display: block;
}

.brand-sub {
  display: block;
  font-size: 9px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding-left: 1px;
}

/* Nav */
nav.nav-list {
  list-style: none;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1;
  overflow-y: auto;
}

.nav-item {
  all: unset;
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 7px 10px;
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: background var(--ease), color var(--ease);
  letter-spacing: -0.01em;
}

.nav-icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  opacity: 0.5;
  transition: opacity var(--ease);
}

.nav-item:hover { background: var(--surface); color: var(--text-sub); }
.nav-item:hover .nav-icon { opacity: 0.8; }

.nav-item {
  position: relative;
  overflow: hidden;
}

.nav-item.is-active {
  background: var(--lime-dim);
  color: var(--lime);
  font-weight: 600;
  box-shadow: inset 2px 0 0 var(--lime), 0 0 14px -4px rgba(199,255,46,0.55);
  animation: navGlowIn 0.35s ease;
}
.nav-item.is-active .nav-icon { opacity: 1; filter: drop-shadow(0 0 4px rgba(199,255,46,0.6)); }

@keyframes navGlowIn {
  0% { box-shadow: inset 2px 0 0 var(--lime), 0 0 0px 0 rgba(199,255,46,0); }
  40% { box-shadow: inset 2px 0 0 var(--lime), 0 0 22px -2px rgba(199,255,46,0.75); }
  100% { box-shadow: inset 2px 0 0 var(--lime), 0 0 14px -4px rgba(199,255,46,0.55); }
}

/* Status panel */
.status-panel {
  margin: 8px;
  padding: 12px 13px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.status-panel::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--lime) 0%, transparent 70%);
}

.status-panel-art { display: none; }

.status-panel-content { display: flex; flex-direction: column; gap: 3px; }

.status-panel-content .eyebrow {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.status-panel-content strong {
  font-size: 12px;
  font-weight: 800;
  color: var(--lime);
  letter-spacing: -0.01em;
}

.status-panel-content span {
  font-size: 10px;
  color: var(--text-muted);
  line-height: 1.4;
}

.account-panel {
  margin: 4px 8px 8px;
  padding: 12px 13px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.account-panel-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.account-panel-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }

.account-panel-info strong {
  font-size: 12px;
  font-weight: 800;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.account-panel-info span {
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.account-role-badge {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(199, 255, 46, 0.12);
  color: var(--accent-lime);
  border: 1px solid rgba(199, 255, 46, 0.25);
  flex-shrink: 0;
}

.account-invite-btn,
.account-logout-btn {
  width: 100%;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 0;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-sub);
  cursor: pointer;
  margin-top: 6px;
}

.account-invite-btn {
  color: var(--accent-lime);
  border-color: rgba(199, 255, 46, 0.3);
}

.account-invite-btn:hover { background: rgba(199, 255, 46, 0.08); }
.account-logout-btn:hover { background: rgba(255, 255, 255, 0.04); }

#accountHomepageBtn {
  display: block;
  text-align: center;
  text-decoration: none;
  box-sizing: border-box;
}

/* -----------------------------------------------
   MAIN
----------------------------------------------- */
.main {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow: hidden;
}

/* -----------------------------------------------
   TOPBAR
----------------------------------------------- */
.topbar {
  height: var(--topbar-h);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-raised);
  gap: 16px;
}

.topbar > div:first-child,
.topbar-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.topbar-left .eyebrow,
.topbar > div:first-child > .eyebrow {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
}

.topbar-left h2,
.topbar > div:first-child > h2 {
  font-size: 17px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.035em;
  white-space: nowrap;
}

.top-actions,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.sync-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--border-mid);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: default;
}

.sync-pill::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 7px var(--green);
  flex-shrink: 0;
}

/* -----------------------------------------------
   SECTIONS WRAP
----------------------------------------------- */
.sections-wrap {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

.section {
  display: none;
  position: relative;
  padding: 28px;
  min-height: calc(100dvh - var(--topbar-h));
  animation: sectionIn 0.32s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.section.is-active { display: block; }

.section.is-active::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(199,255,46,0.07) 50%, transparent 70%);
  background-size: 250% 100%;
  background-position: 120% 0;
  pointer-events: none;
  z-index: 5;
  animation: sectionLightSweep 0.6s ease-out both;
}

@keyframes sectionIn {
  from { opacity: 0; transform: translateY(10px) scale(0.995); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes sectionLightSweep {
  from { background-position: 120% 0; opacity: 1; }
  to   { background-position: -20% 0; opacity: 0; }
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 22px;
  gap: 20px;
}

.section-heading > div {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.section-heading h3 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.section-heading h4 {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.section-heading .muted {
  font-size: 12px;
  color: var(--text-muted);
  text-align: right;
  max-width: 320px;
  line-height: 1.55;
  flex-shrink: 0;
}

/* -----------------------------------------------
   EYEBROW
----------------------------------------------- */
.eyebrow {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--lime);
}

/* -----------------------------------------------
   PANELS
----------------------------------------------- */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 13px 18px;
  border-bottom: 1px solid var(--border);
  gap: 8px 10px;
}

.panel-heading h4 {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}

.panel-heading-icon {
  width: 25px;
  height: 25px;
  border-radius: var(--r-sm);
  background: color-mix(in srgb, var(--card-accent) 14%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--card-accent);
  flex-shrink: 0;
}

.panel-heading-icon svg { width: 13px; height: 13px; }

/* Simple h4 directly in panel */
.panel > h4 {
  padding: 12px 18px 10px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

/* -----------------------------------------------
   TAGS
----------------------------------------------- */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: var(--r-xs);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--surface-alt);
  color: var(--text-muted);
  border: 1px solid var(--border-mid);
  white-space: nowrap;
}

.tag-warning {
  background: var(--amber-dim);
  color: var(--amber);
  border-color: rgba(251,191,36,0.2);
}

/* -----------------------------------------------
   PLATFORM TABS
----------------------------------------------- */
.platform-tabs {
  position: relative;
  display: flex;
  align-items: center;
  gap: 3px;
  margin-bottom: 14px;
}

.platform-tab {
  position: relative;
  z-index: 1;
  padding: 5px 14px;
  border-radius: 20px;
  border: 1px solid transparent;
  background: transparent;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: color var(--ease);
}

.platform-tab:hover { color: var(--text-sub); }

.platform-tab.is-active {
  color: var(--text);
  font-weight: 600;
  animation: tabActivatePop 0.4s ease;
}

/* Sliding glow pill — repositioned via JS (moveTabGlow) to sit behind
   whichever tab is active, animating smoothly between tabs instead of
   snapping, with a color tuned to that platform's brand accent. */
.platform-tab-glow {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  box-shadow: 0 0 0 1px var(--tab-glow-soft, transparent), 0 0 18px -2px var(--tab-glow-soft, transparent);
  transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1), width 0.32s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.32s ease;
  pointer-events: none;
  z-index: 0;
}

@keyframes tabActivatePop {
  0% { transform: scale(0.94); }
  55% { transform: scale(1.03); }
  100% { transform: scale(1); }
}

/* -----------------------------------------------
   DATA SOURCE BADGE
----------------------------------------------- */
.data-source-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-left: auto;
}

.data-source-badge.is-sample {
  background: var(--amber-dim);
  color: var(--amber);
  border: 1px solid rgba(251,191,36,0.18);
}

.data-source-badge.is-live {
  background: var(--green-dim);
  color: var(--green);
  border: 1px solid rgba(35,209,139,0.18);
}

/* -----------------------------------------------
   DATE RANGE BAR
----------------------------------------------- */
.date-range-bar {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-bottom: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 4px;
  width: fit-content;
}

.date-btn {
  padding: 5px 13px;
  border-radius: var(--r-sm);
  border: none;
  background: transparent;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--ease);
}

.date-btn:hover { background: var(--surface-hover); color: var(--text-sub); }

.date-btn.is-active {
  background: var(--surface-alt);
  color: var(--text);
  font-weight: 600;
  box-shadow: 0 0 0 1px rgba(199,255,46,0.3), 0 0 10px -2px rgba(199,255,46,0.5);
  animation: dateBtnPop 0.3s ease;
}

@keyframes dateBtnPop {
  0% { transform: scale(0.92); }
  50% { transform: scale(1.04); }
  100% { transform: scale(1); }
}

.date-btn:disabled { opacity: 0.35; cursor: not-allowed; }

/* -----------------------------------------------
   METRIC GRID
----------------------------------------------- */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}

/* -----------------------------------------------
   COMBINED TAB: CHANNEL HERO ROW
----------------------------------------------- */
.channel-hero-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.channel-hero-card {
  position: relative;
  cursor: pointer;
  background:
    linear-gradient(160deg, rgba(255,255,255,0.05), rgba(255,255,255,0.01)),
    rgba(10,10,14,0.82);
  backdrop-filter: blur(6px);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px;
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.channel-hero-card::before {
  content: '';
  position: absolute;
  top: -50%; right: -35%;
  width: 160px; height: 160px;
  background: var(--hero-accent, #c7ff2e);
  opacity: 0.16;
  filter: blur(46px);
  border-radius: 50%;
  pointer-events: none;
}

/* -----------------------------------------------
   AI ACTION QUEUE
----------------------------------------------- */
.action-queue-wrap {
  margin-bottom: 18px;
}

.action-queue-heading {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
}

.action-queue-sub {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-muted);
}

.action-queue-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.action-queue-card {
  position: relative;
  background: linear-gradient(160deg, rgba(255,255,255,0.05), rgba(255,255,255,0.01)), rgba(10,10,14,0.82);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 14px 16px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.action-queue-card.is-leaving {
  transform: translateX(40px);
  opacity: 0;
}

.action-queue-dismiss {
  position: absolute;
  top: 8px;
  right: 10px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 4px;
}

.action-queue-dismiss:hover { color: var(--text-main); }

.action-queue-card-platform {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-lime, #c7ff2e);
  margin-bottom: 6px;
}

.action-queue-card-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
  line-height: 1.4;
}

.action-queue-card-detail {
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--text-sub);
  margin-bottom: 12px;
}

.action-queue-btn.is-link {
  display: block;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  padding: 8px 10px;
  border-radius: 999px;
  cursor: pointer;
  border: 1px solid var(--accent-lime, #c7ff2e);
  background: var(--accent-lime, #c7ff2e);
  color: #0a0a0e;
  text-decoration: none;
}

.action-queue-btn.is-link:hover { opacity: 0.9; }

/* -----------------------------------------------
   MORNING GREETING BANNER
----------------------------------------------- */
.morning-greeting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 28px 14px;
  padding: 10px 16px;
  border-radius: var(--r);
  background: linear-gradient(160deg, rgba(199,255,46,0.1), rgba(255,255,255,0.01));
  border: 1px solid rgba(199,255,46,0.22);
  animation: greetingSlideIn 0.35s ease;
}

.morning-greeting.is-warning {
  background: linear-gradient(160deg, rgba(248,113,113,0.1), rgba(255,255,255,0.01));
  border-color: rgba(248,113,113,0.3);
}

.morning-greeting-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
}

.morning-greeting-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 6px;
}

.morning-greeting-close:hover { color: var(--text-main); }

.campaign-checkin-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 28px 14px;
}
.campaign-checkin-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-radius: var(--r);
  background: rgba(96,165,250,0.06);
  border: 1px solid rgba(96,165,250,0.25);
  animation: greetingSlideIn 0.35s ease;
}
.campaign-checkin-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  flex: 1;
}
.campaign-checkin-verdict {
  flex-basis: 100%;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}
.campaign-checkin-verdict.is-good    { color: var(--green); }
.campaign-checkin-verdict.is-warning { color: #f5c542; }
.campaign-checkin-verdict.is-neutral { color: var(--text-muted); }
.campaign-checkin-ask {
  font-size: 11.5px;
  font-weight: 700;
  color: #93c5fd;
  background: rgba(96,165,250,0.12);
  border: 1px solid rgba(96,165,250,0.3);
  border-radius: 16px;
  padding: 6px 12px;
  cursor: pointer;
  flex-shrink: 0;
}
.campaign-checkin-ask:hover { background: rgba(96,165,250,0.2); }
.campaign-checkin-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 6px;
  flex-shrink: 0;
}
.campaign-checkin-close:hover { color: var(--text-main); }

@keyframes greetingSlideIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* -----------------------------------------------
   AI MONEY BRIEFING CARD
----------------------------------------------- */
.ai-briefing-card {
  position: relative;
  background:
    linear-gradient(160deg, rgba(199,255,46,0.08), rgba(255,255,255,0.01)),
    rgba(10,10,14,0.82);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(199,255,46,0.22);
  border-radius: var(--r-lg);
  padding: 20px 22px;
  margin-bottom: 18px;
  overflow: hidden;
}

.ai-briefing-card::before {
  content: '';
  position: absolute;
  top: -60%; left: -20%;
  width: 220px; height: 220px;
  background: #c7ff2e;
  opacity: 0.1;
  filter: blur(60px);
  border-radius: 50%;
  pointer-events: none;
}

.ai-briefing-top {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.ai-briefing-badge {
  position: relative;
  overflow: hidden;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #0a0a0e;
  background: var(--accent-lime, #c7ff2e);
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
  box-shadow: 0 0 12px -1px rgba(199,255,46,0.7);
}

.ai-briefing-badge::after {
  content: '';
  position: absolute;
  top: 0; left: -60%;
  width: 50%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,0.65), transparent);
  animation: badgeShimmer 3.2s ease-in-out infinite;
}

@keyframes badgeShimmer {
  0% { left: -60%; }
  45% { left: 130%; }
  100% { left: 130%; }
}

.ai-briefing-card.is-glow-pulse {
  animation: briefingGlowIn 0.6s ease;
}

@keyframes briefingGlowIn {
  0% { box-shadow: 0 0 0 1px rgba(199,255,46,0.22), 0 0 0px 0 rgba(199,255,46,0); }
  35% { box-shadow: 0 0 0 1px rgba(199,255,46,0.3), 0 0 32px -4px rgba(199,255,46,0.5); }
  100% { box-shadow: 0 0 0 1px rgba(199,255,46,0.22), 0 0 0px 0 rgba(199,255,46,0); }
}

.ai-briefing-headline {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
  line-height: 1.3;
}

.ai-briefing-paragraph {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-sub);
  margin: 0;
  max-width: 760px;
  position: relative;
  z-index: 1;
}

.ai-briefing-alerts {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 12px;
}

.ai-briefing-alert {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  line-height: 1.5;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
}

.ai-briefing-alert .alert-icon {
  flex-shrink: 0;
  font-size: 13px;
  line-height: 1.5;
}

.ai-briefing-alert-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.ai-briefing-alert-body .anom-why-btn {
  align-self: flex-start;
}

.ai-briefing-alert.level-danger {
  border-color: rgba(248,113,113,0.35);
  background: rgba(248,113,113,0.07);
  color: #fca5a5;
}

.ai-briefing-alert.level-warning {
  border-color: rgba(245,158,11,0.3);
  background: rgba(245,158,11,0.06);
  color: #fcd34d;
}

.ai-briefing-alert.level-info {
  border-color: rgba(96,165,250,0.3);
  background: rgba(96,165,250,0.06);
  color: #93c5fd;
}

.channel-hero-card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--hero-accent, #c7ff2e) 45%, var(--border));
  box-shadow: 0 10px 32px -10px var(--hero-accent, rgba(199,255,46,0.4));
}

.channel-hero-icon {
  position: relative;
  z-index: 1;
  width: 34px; height: 34px;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
}

.channel-hero-icon--total {
  background: rgba(199,255,46,0.16);
  color: var(--accent-lime);
}

.channel-hero-name {
  position: relative;
  z-index: 1;
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-sub);
  text-shadow: 0 1px 3px rgba(0,0,0,0.6);
  margin-bottom: 16px;
}

.channel-hero-stats {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 6px;
}

.channel-hero-stats > div {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.channel-hero-stats strong {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.channel-hero-stats span {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-sub);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-shadow: 0 1px 3px rgba(0,0,0,0.6);
}

.channel-hero-total {
  cursor: default;
  background:
    linear-gradient(160deg, rgba(199,255,46,0.1), rgba(199,255,46,0.02)),
    rgba(10,10,14,0.82);
  border-color: rgba(199,255,46,0.22);
}

.channel-hero-total .channel-hero-name { color: var(--accent-lime); }

.combined-trend-panel { margin-bottom: 20px; }

@media (max-width: 1100px) {
  .channel-hero-row { grid-template-columns: repeat(2, 1fr); }
}

.metric-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  overflow: hidden;
  transition: border-color var(--ease), transform var(--ease-m), box-shadow var(--ease);
  cursor: pointer;
}
.metric-card.is-chart-active {
  border-color: var(--card-accent);
  box-shadow: 0 0 0 1px var(--card-accent), 0 4px 24px rgba(0,0,0,0.4);
  animation: cardActivePulse 0.6s ease-out;
}

@keyframes cardActivePulse {
  0%   { box-shadow: 0 0 0 0 rgba(199,255,46,0.55), 0 0 0 1px var(--card-accent); transform: scale(1.018); }
  55%  { box-shadow: 0 0 0 14px rgba(199,255,46,0), 0 0 0 1px var(--card-accent); transform: scale(1); }
  100% { box-shadow: 0 0 0 1px var(--card-accent), 0 4px 24px rgba(0,0,0,0.4); }
}

.metric-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--card-accent);
  opacity: 0.6;
}

.metric-card:hover {
  border-color: var(--border-mid);
  transform: translateY(-1px);
}

.metric-icon { display: none; }

/* ===== METRIC CARD — PLATFORM BADGE (top-right corner) ===== */
.mpb {
  position: absolute;
  top: 11px;
  right: 11px;
  width: 20px;
  height: 20px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.7;
  transition: opacity 0.15s;
}
.metric-card:hover .mpb { opacity: 1; }
.mpb--google { background: rgba(66,133,244,0.12); }
.mpb--shopify { background: rgba(150,191,72,0.12); color: #96bf48; }
.mpb--meta   { background: rgba(24,119,242,0.12); color: #1877f2; }

.metric-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-muted);
}

.metric-value {
  font-size: 26px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.045em;
  line-height: 1;
}

.metric-trend {
  display: inline-flex;
  align-items: center;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--green);
  padding: 3px 8px;
  border-radius: 20px;
  background: var(--green-dim);
  align-self: flex-start;
  margin-top: 2px;
}

.metric-trend.is-risk {
  color: var(--amber);
  background: var(--amber-dim);
}

/* -----------------------------------------------
   METRIC CARD HOVER PANEL
----------------------------------------------- */
.metric-hover {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 36px 13px 13px;
  background: linear-gradient(180deg,
    rgba(9, 9, 14, 0.22) 0%,
    rgba(9, 9, 14, 0.85) 32%,
    rgba(9, 9, 14, 0.97) 56%
  );
  opacity: 0;
  transform: translateY(5px);
  transition: opacity 0.22s ease, transform 0.22s ease;
  pointer-events: none;
  border-radius: inherit;
}

.metric-card:hover .metric-hover {
  opacity: 1;
  transform: translateY(0);
}

.mhp-spark {
  position: absolute;
  top: 0; left: 0; right: 0;
  width: 100%;
  height: 52%;
  display: block;
  pointer-events: none;
}

.mhp-stats {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 4px;
  margin-bottom: 7px;
}

.mhp-stat {
  flex: 1;
  background: rgba(9, 9, 14, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 5px;
  padding: 4px 6px 5px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.mhp-stat-label {
  font-size: 8.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: rgba(255, 255, 255, 0.72);
  text-shadow: 0 1px 2px rgba(0,0,0,0.7);
  white-space: nowrap;
}

.mhp-stat-value {
  font-size: 10.5px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.7);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.mhp-insight {
  position: relative;
  z-index: 2;
  font-size: 9.5px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.78);
  text-shadow: 0 1px 2px rgba(0,0,0,0.7);
  line-height: 1.4;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.mhp-no-data {
  color: rgba(255, 255, 255, 0.28);
  font-style: italic;
}

.mhp-explain {
  position: relative;
  z-index: 2;
  font-size: 10px;
  font-weight: 600;
  color: #e8ffb0;
  text-shadow: 0 1px 3px rgba(0,0,0,0.85);
  background: rgba(9, 9, 14, 0.72);
  border-radius: 5px;
  padding: 4px 6px;
  line-height: 1.4;
  margin: 0 0 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* -----------------------------------------------
   CHART PANEL
----------------------------------------------- */
.chart-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px 24px 16px;
  margin-top: 10px;
  clip-path: circle(0% at var(--cp-x, 50%) -20px);
  opacity: 0;
  will-change: clip-path, opacity;
}

.chart-panel.is-open {
  animation: chartPortalIn 0.58s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.chart-panel.is-closing {
  animation: chartPortalOut 0.32s ease-in forwards;
}

.chart-panel.is-open .chart-panel-value {
  animation: valueReveal 0.45s ease-out 0.18s both;
}

@keyframes chartPortalIn {
  0%   { clip-path: circle(0% at var(--cp-x, 50%) -20px); opacity: 0; }
  20%  { opacity: 1; }
  100% { clip-path: circle(160% at var(--cp-x, 50%) -20px); opacity: 1; }
}

@keyframes chartPortalOut {
  0%   { clip-path: circle(160% at var(--cp-x, 50%) -20px); opacity: 1; }
  100% { clip-path: circle(0% at var(--cp-x, 50%) -20px); opacity: 0; }
}

@keyframes valueReveal {
  from { opacity: 0; transform: translateY(8px); filter: blur(6px); }
  to   { opacity: 1; transform: translateY(0);   filter: blur(0); }
}

.chart-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
}

.chart-panel-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.chart-panel-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}

.chart-panel-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--fg);
  letter-spacing: -0.02em;
}

.chart-close-btn {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--ease), border-color var(--ease);
}
.chart-close-btn:hover { color: var(--fg); border-color: var(--border-mid); }

.chart-wrap {
  height: 200px;
  position: relative;
  overflow: hidden;
}

.chart-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  width: 50%;
  background: linear-gradient(90deg, transparent 0%, rgba(199,255,46,0.11) 50%, transparent 100%);
  transform: translateX(-120%);
  opacity: 0;
}

.chart-wrap.is-scanning::after {
  animation: chartScan 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes chartScan {
  0%   { transform: translateX(-120%); opacity: 0; }
  8%   { opacity: 1; }
  88%  { opacity: 0.7; }
  100% { transform: translateX(220%); opacity: 0; }
}

/* -----------------------------------------------
   LAYOUT HELPERS
----------------------------------------------- */
.comparison-panel { margin-bottom: 14px; }

.split-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 14px;
  align-items: start;
}

.stitch-divider { display: none; }

/* -----------------------------------------------
   TABLES
----------------------------------------------- */
.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

thead tr { border-bottom: 1px solid var(--border); }

th {
  padding: 9px 16px;
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-dim);
  white-space: nowrap;
}

td {
  padding: 11px 16px;
  color: var(--text-sub);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

td:first-child { color: var(--text); }
td strong { font-weight: 600; color: var(--text); font-size: 12.5px; }

tbody tr { transition: background var(--ease); }
tbody tr:hover td { background: var(--surface-hover); }
tbody tr:last-child td { border-bottom: none; }

/* -----------------------------------------------
   CHANNEL DOT
----------------------------------------------- */
.channel-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--dot-color);
  margin-right: 8px;
  vertical-align: middle;
  box-shadow: 0 0 5px var(--dot-color);
  flex-shrink: 0;
}

/* -----------------------------------------------
   STATUS BADGES
----------------------------------------------- */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.status-badge.is-active   { background: var(--green-dim);  color: var(--green); }
.status-badge.is-learning { background: var(--blue-dim);   color: var(--blue); }
.status-badge.is-limited  { background: var(--amber-dim);  color: var(--amber); }
.status-badge.is-paused   { background: var(--surface-alt); color: var(--text-muted); }

/* -----------------------------------------------
   SORTABLE HEADERS
----------------------------------------------- */
#campaignTable th[data-sort-key] {
  cursor: pointer;
  user-select: none;
  transition: color var(--ease);
}
#campaignTable th[data-sort-key]:hover { color: var(--text-sub); }
#campaignTable th[data-sort-key]::after { content: " ↕"; opacity: 0.2; font-size: 0.75em; }
#campaignTable th.is-sorted { color: var(--lime); }
#campaignTable th.sort-desc::after { content: " ↓"; opacity: 1; }
#campaignTable th.sort-asc::after  { content: " ↑"; opacity: 1; }

/* -----------------------------------------------
   WATCHLIST
----------------------------------------------- */
.watchlist { display: flex; flex-direction: column; }

.watch-item {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  transition: background var(--ease);
  cursor: default;
  position: relative;
}

.watch-item:last-child { border-bottom: none; }

.watch-item::before {
  content: '';
  position: absolute;
  left: 0; top: 12px; bottom: 12px;
  width: 2px;
  border-radius: 1px;
  background: var(--card-accent);
}

.watch-item:hover { background: var(--surface-hover); }

.watch-icon {
  width: 27px;
  height: 27px;
  border-radius: var(--r-sm);
  background: color-mix(in srgb, var(--card-accent) 12%, transparent);
  color: var(--card-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.watch-icon svg { width: 13px; height: 13px; }

.watch-item > div > strong {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
  letter-spacing: -0.01em;
}

.watch-item > div > span {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.55;
}

/* -----------------------------------------------
   BUTTONS
----------------------------------------------- */
.primary-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: var(--r);
  background: var(--lime);
  color: #000;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
  border: none;
  cursor: pointer;
  transition: all var(--ease);
  white-space: nowrap;
}

.primary-button:hover {
  background: #d5ff52;
  transform: translateY(-1px);
  box-shadow: 0 4px 18px var(--lime-glow);
}

.primary-button:active { transform: translateY(0); box-shadow: none; }
.primary-button:disabled { opacity: 0.42; cursor: not-allowed; transform: none; box-shadow: none; }

.secondary-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: var(--r);
  background: var(--surface);
  color: var(--text-sub);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  border: 1px solid var(--border-strong);
  cursor: pointer;
  transition: all var(--ease);
  white-space: nowrap;
}

.secondary-button:hover { background: var(--surface-alt); color: var(--text); }
.secondary-button:disabled { opacity: 0.38; cursor: not-allowed; }

.danger-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: var(--r);
  background: var(--red-dim);
  color: var(--red);
  font-size: 12.5px;
  font-weight: 600;
  border: 1px solid rgba(248,113,113,0.18);
  cursor: pointer;
  transition: all var(--ease);
}

.danger-button:hover { background: rgba(248,113,113,0.18); }

.push-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--r);
  background: var(--blue);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: all var(--ease);
}

.push-button:hover {
  background: #6ba3ff;
  transform: translateY(-1px);
  box-shadow: 0 4px 18px rgba(79,140,255,0.28);
}

.push-button:disabled { opacity: 0.38; cursor: not-allowed; transform: none; box-shadow: none; }

.button-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* -----------------------------------------------
   FORM ELEMENTS
----------------------------------------------- */
label, .form-label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

textarea,
input[type="text"],
input[type="url"],
input[type="number"],
input[type="password"],
input[type="email"],
select {
  width: 100%;
  background: var(--bg-raised);
  border: 1px solid var(--border-mid);
  border-radius: var(--r);
  padding: 9px 13px;
  font-family: inherit;
  font-size: 13px;
  color: var(--text);
  outline: none;
  transition: border-color var(--ease), box-shadow var(--ease);
  -webkit-appearance: none;
  appearance: none;
}

textarea { resize: vertical; min-height: 82px; line-height: 1.6; }

textarea:focus, input:focus, select:focus {
  border-color: var(--lime);
  box-shadow: 0 0 0 3px var(--lime-dim);
}

textarea::placeholder, input::placeholder { color: var(--text-dim); }

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235a5a7a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  padding-right: 32px;
  cursor: pointer;
}

select option, select optgroup {
  background: #1e1e28;
  color: var(--text);
}

.form-grid { display: grid; gap: 12px; }

/* -----------------------------------------------
   CAMPAIGN TYPE TOGGLE
----------------------------------------------- */
.campaign-type-group { display: flex; flex-direction: column; gap: 6px; }

.type-toggle {
  display: flex;
  border: 1px solid var(--border-mid);
  border-radius: var(--r);
  overflow: hidden;
  background: var(--bg-raised);
}

.type-option {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--ease);
  text-align: center;
  user-select: none;
}

.type-option input[type="radio"] { display: none; }

.type-option:has(input:checked) {
  background: var(--surface-alt);
  color: var(--lime);
  font-weight: 700;
}

.type-option + .type-option { border-left: 1px solid var(--border-mid); }

.catalog-sync-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}

.mode-toggle {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 6px;
}
.mode-option {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-muted);
  cursor: pointer;
}
.mode-option input[type="radio"] { accent-color: var(--lime); }
.mode-option:has(input:checked) { color: var(--text); font-weight: 600; }

.interest-picker {
  margin-top: 10px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--bg-raised);
}
.interest-search-row {
  display: flex;
  gap: 8px;
}
.interest-search-row .plan-text-input { flex: 1; }
.interest-results {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.interest-result-btn {
  font-size: 11.5px;
  padding: 5px 10px;
  border-radius: 14px;
  border: 1px solid var(--border-mid);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
}
.interest-result-btn:hover { border-color: var(--lime); color: var(--lime); }
.interest-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.interest-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  padding: 5px 6px 5px 10px;
  border-radius: 14px;
  background: var(--lime-dim);
  color: var(--lime);
}
.interest-chip button {
  background: none;
  border: none;
  color: var(--lime);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0 2px;
}

/* -----------------------------------------------
   ANALYST SECTION
----------------------------------------------- */
.assistant-layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 18px;
  align-items: start;
}

.question-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: sticky;
  top: 0;
}

.question-hint {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.65;
  padding: 10px 12px;
  background: var(--surface-alt);
  border-radius: var(--r);
  border: 1px solid var(--border);
}

.question-hint strong { color: var(--text-sub); font-weight: 600; }

.starter-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 14px;
}

.starter-chip {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-sub);
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 13px;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.starter-chip:hover {
  border-color: rgba(199,255,46,0.4);
  color: var(--text-main);
  background: rgba(199,255,46,0.06);
}

/* -----------------------------------------------
   ANSWER CARDS
----------------------------------------------- */
.answer-panel { display: flex; flex-direction: column; gap: 10px; }

.answer-source {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--r);
  font-size: 11px;
  font-weight: 500;
  margin-bottom: 2px;
}

.answer-source svg { width: 13px; height: 13px; flex-shrink: 0; }
.answer-source.is-live    { background: var(--green-dim); color: var(--green); border: 1px solid rgba(35,209,139,0.15); }
.answer-source.is-quick   { background: var(--blue-dim);  color: var(--blue);  border: 1px solid rgba(79,140,255,0.15); }
.answer-source.is-warning { background: var(--amber-dim); color: var(--amber); border: 1px solid rgba(251,191,36,0.15); }

.answer-source-link {
  margin-left: auto;
  padding: 3px 9px;
  border-radius: var(--r-xs);
  background: rgba(251,191,36,0.12);
  color: var(--amber);
  font-size: 11px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: background var(--ease);
  flex-shrink: 0;
}

.answer-source-link:hover { background: rgba(251,191,36,0.22); }

.lang-toggle {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-bottom: 12px;
}

.lang-btn {
  padding: 3px 8px;
  border-radius: var(--r-xs);
  border: none;
  background: transparent;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--ease);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.lang-btn.is-active { background: var(--lime-dim); color: var(--lime); }

.answer-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px 20px 20px 24px;
  transition: border-color var(--ease);
  position: relative;
  overflow: hidden;
}

.answer-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 3px; height: 100%;
  background: var(--lime);
  opacity: 0.5;
}

.answer-card:hover { border-color: var(--border-mid); }

.lang-block > strong {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
  letter-spacing: -0.025em;
}

.lang-block > span {
  font-size: 13px;
  color: var(--text-sub);
  line-height: 1.7;
}

.answer-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.steps-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: var(--r-sm);
  background: var(--lime-dim);
  color: var(--lime);
  font-size: 11px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all var(--ease);
}

.steps-toggle:hover { background: rgba(199,255,46,0.15); }
.steps-toggle svg { width: 12px; height: 12px; }

.answer-steps {
  display: none;
  margin-top: 14px;
  padding-left: 20px;
  list-style: decimal;
}

.answer-steps.is-open { display: block; }

.answer-steps li {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 6px;
  padding-left: 3px;
}

.answer-steps li:last-child { margin-bottom: 0; }

.need-help-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 500;
  border: 1px solid var(--border-mid);
  cursor: pointer;
  transition: all var(--ease);
}

.need-help-button:hover { background: var(--surface-alt); color: var(--text-sub); }
.need-help-button svg { width: 12px; height: 12px; }

.ac-chart {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.ac-chart-lbl {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.ac-chart-svg {
  display: block;
  width: 100%;
  height: 68px;
}
.ac-chart-range {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  color: var(--text-muted);
  margin-top: 3px;
  opacity: 0.6;
}

.draft-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px;
}

/* -----------------------------------------------
   EMPTY STATES
----------------------------------------------- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 52px 24px;
  text-align: center;
  gap: 8px;
}

.empty-state strong {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
}

.empty-state span {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.65;
  max-width: 260px;
}

/* -----------------------------------------------
   BUILDER SECTION
----------------------------------------------- */
.builder-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 18px;
  align-items: start;
  margin-bottom: 28px;
}

.builder-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: sticky;
  top: 0;
}

/* -----------------------------------------------
   PLAN EDITOR
----------------------------------------------- */
.plan-editor {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.plan-editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-raised);
}

.plan-editor-header strong {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.plan-editor-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.save-template-btn {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--surface-alt);
  border: 1px solid var(--border-mid);
  border-radius: 14px;
  padding: 4px 10px;
  cursor: pointer;
}
.save-template-btn:hover { color: var(--text); border-color: var(--border); }

.ai-sources-block {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border-mid);
  font-size: 11.5px;
}
.ai-sources-label { font-weight: 700; color: var(--text-muted); }
.ai-sources-block a {
  color: #93c5fd;
  text-decoration: none;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ai-sources-block a:hover { text-decoration: underline; }

.competitor-ads-panel { display: flex; flex-direction: column; gap: 8px; }
.competitor-ad-card {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 12px;
  border-radius: var(--r);
  background: var(--surface-alt);
  border: 1px solid var(--border-mid);
}
.competitor-ad-card strong { font-size: 12px; color: var(--text); }
.competitor-ad-card span { font-size: 12px; color: var(--text-muted); line-height: 1.4; }
.competitor-ad-card a { font-size: 11.5px; font-weight: 700; color: #93c5fd; text-decoration: none; margin-top: 2px; }
.competitor-ad-card a:hover { text-decoration: underline; }

.template-picker-row { margin-bottom: 12px; }
.template-picker-select {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--r);
  border: 1px solid var(--border-mid);
  background: var(--surface-alt);
  color: var(--text);
  font-size: 13px;
}

.source-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--surface-alt);
  color: var(--text-muted);
  border: 1px solid var(--border-mid);
}

.source-tag.is-ai {
  background: var(--lime-dim);
  color: var(--lime);
  border-color: rgba(199,255,46,0.2);
}

.plan-field {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.plan-field:last-child { border-bottom: none; }

.plan-field-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 7px;
}

.plan-char-hint {
  font-size: 9.5px;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-dim);
}

.plan-text-input {
  width: 100%;
  background: var(--bg-raised);
  border: 1px solid var(--border-mid);
  border-radius: var(--r);
  padding: 9px 12px;
  font-family: inherit;
  font-size: 13px;
  color: var(--text);
  outline: none;
  transition: border-color var(--ease), box-shadow var(--ease);
}

.plan-text-input:focus {
  border-color: var(--lime);
  box-shadow: 0 0 0 3px var(--lime-dim);
}

.plan-textarea {
  width: 100%;
  background: var(--bg-raised);
  border: 1px solid var(--border-mid);
  border-radius: var(--r);
  padding: 9px 12px;
  font-family: 'SF Mono', 'Fira Code', 'Menlo', monospace;
  font-size: 12px;
  color: var(--text);
  resize: vertical;
  min-height: 88px;
  line-height: 1.75;
  outline: none;
  transition: border-color var(--ease), box-shadow var(--ease);
}

.plan-textarea:focus {
  border-color: var(--lime);
  box-shadow: 0 0 0 3px var(--lime-dim);
}

.keyword-reasoning-list {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.keyword-reasoning-row {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
}
.keyword-reasoning-row strong {
  color: var(--text);
  font-weight: 600;
  flex-shrink: 0;
}

.bid-strategy-display {
  background: var(--bg-raised);
  border: 1px solid var(--border-mid);
  border-radius: var(--r);
  padding: 10px 12px;
}
.bid-strategy-display strong {
  display: block;
  color: var(--lime);
  font-size: 13px;
  margin-bottom: 4px;
}
.bid-strategy-display p {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}

.push-safety-note {
  padding: 10px 18px;
  font-size: 11.5px;
  color: var(--amber);
  background: var(--amber-dim);
  border-top: 1px solid rgba(251,191,36,0.14);
  border-bottom: 1px solid var(--border);
}

.push-safety-note strong { font-weight: 700; }

.preflight-checklist {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.preflight-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
}
.preflight-row svg { width: 14px; height: 14px; flex-shrink: 0; }
.preflight-row.is-checking { color: var(--text-muted); }
.preflight-row.is-ok { color: #4ade80; border-color: rgba(74,222,128,0.25); background: rgba(74,222,128,0.06); }
.preflight-row.is-warning { color: #fcd34d; border-color: rgba(245,158,11,0.3); background: rgba(245,158,11,0.06); }
.preflight-row.is-blocking { color: #fca5a5; border-color: rgba(248,113,113,0.35); background: rgba(248,113,113,0.07); }

.profit-forecast-card {
  margin: 0 18px 0;
  padding: 12px 14px;
  border: 1px solid rgba(199,255,46,0.22);
  border-radius: var(--r);
  background: linear-gradient(160deg, rgba(199,255,46,0.07), rgba(255,255,255,0.01));
}

.profit-forecast-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}

.profit-forecast-text {
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-sub);
  margin: 0;
}

.forecast-slider-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.forecast-slider {
  flex: 1;
  accent-color: var(--accent-lime, #c7ff2e);
  cursor: pointer;
}

.forecast-slider-value {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  min-width: 92px;
  text-align: right;
}

/* -----------------------------------------------
   IMAGE UPLOAD
----------------------------------------------- */
.image-upload-zone {
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--r);
  padding: 18px;
  text-align: center;
  cursor: pointer;
  transition: all var(--ease);
  background: var(--bg-raised);
}

.image-upload-zone:hover, .image-upload-zone.drag-over {
  border-color: var(--lime);
  background: var(--lime-dim);
}

.upload-prompt { font-size: 11.5px; color: var(--text-muted); }

.image-previews {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.image-preview-item {
  position: relative;
  width: 78px;
  border-radius: var(--r-sm);
  overflow: hidden;
  border: 1px solid var(--border-mid);
}

.image-preview-item img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
}

.image-preview-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 3px 5px;
  background: var(--surface);
}

.image-preview-meta span {
  font-size: 9px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: capitalize;
}

.image-remove-btn {
  background: none;
  border: none;
  color: var(--red);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0 2px;
  transition: color var(--ease);
}

.image-remove-btn:hover { color: #ff5555; }

/* -----------------------------------------------
   PUSH RESULT
----------------------------------------------- */
.push-result-panel { margin-top: 14px; }

.push-result {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  border-radius: var(--r-lg);
  border: 1px solid transparent;
}

.push-result svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.push-result.is-success { background: var(--green-dim); border-color: rgba(35,209,139,0.2); color: var(--green); }
.push-result.is-error   { background: var(--red-dim);   border-color: rgba(248,113,113,0.2); color: var(--red); }
.push-result.is-warning { background: rgba(234,179,8,0.08); border-color: rgba(234,179,8,0.25); color: #f5c542; }

.push-result strong { display: block; font-weight: 700; font-size: 13px; margin-bottom: 3px; }
.push-result span   { display: block; font-size: 12px; opacity: 0.85; line-height: 1.5; }
.push-result-link   { display: inline-block; margin-top: 8px; font-size: 12px; font-weight: 700; color: inherit; text-decoration: underline; }

.quality-score-panel {
  padding: 14px 16px;
  border-radius: var(--r-lg);
  border: 1px solid transparent;
  margin-bottom: 14px;
}
.quality-score-panel.is-good    { background: var(--green-dim); border-color: rgba(35,209,139,0.2); color: var(--green); }
.quality-score-panel.is-ok      { background: rgba(234,179,8,0.08); border-color: rgba(234,179,8,0.25); color: #f5c542; }
.quality-score-panel.is-warning { background: var(--red-dim); border-color: rgba(248,113,113,0.2); color: var(--red); }
.quality-score-row { display: flex; align-items: center; gap: 10px; }
.quality-score-badge { font-weight: 800; font-size: 14px; padding: 2px 8px; border-radius: 999px; background: rgba(255,255,255,0.08); flex-shrink: 0; }
.quality-score-verdict { font-size: 12.5px; line-height: 1.45; flex: 1; }
.quality-score-fix { font-size: 12px; opacity: 0.9; line-height: 1.5; margin-top: 6px; }
.quality-score-fix strong { font-weight: 700; }

/* -----------------------------------------------
   ACCESS SECTION
----------------------------------------------- */
.access-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 14px;
}

.check-list {
  list-style: none;
  padding: 4px 0;
  display: flex;
  flex-direction: column;
}

.check-list li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 10px 18px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  gap: 12px;
}

.check-list li:last-child { border-bottom: none; }
.check-list li span { color: var(--text-muted); flex-shrink: 0; }
.check-list li strong { font-size: 12px; font-weight: 600; color: var(--text); text-align: right; }

/* AI settings panel */
.ai-settings-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  background: var(--surface-alt);
  color: var(--text-muted);
  border: 1px solid var(--border-mid);
}

.ai-settings-status.is-live {
  background: var(--green-dim);
  color: var(--green);
  border-color: rgba(35,209,139,0.2);
}

.ai-settings-status.is-live::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 7px var(--green);
}

.ai-settings-panel > p.muted {
  padding: 14px 18px;
  font-size: 12px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  line-height: 1.6;
}

.ai-settings-panel .form-grid {
  padding: 18px;
  grid-template-columns: 1fr 1fr;
}

.ai-settings-panel .button-row { padding: 0 18px 18px; }

.ai-provider-subsection {
  margin: 0 18px 18px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--surface-alt);
}

.ai-provider-subsection-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px 0;
}

.ai-provider-subsection-heading h5 {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.ai-provider-subsection > p.muted {
  padding: 6px 14px 0;
  border-bottom: none;
}

.ai-provider-subsection .form-grid {
  padding: 12px 14px;
}

.ai-provider-subsection .button-row {
  padding: 0 14px 14px;
}

#aiUsageNote {
  font-size: 11px;
  color: var(--text-muted);
  padding: 10px 18px;
  border-top: 1px solid var(--border);
  min-height: 20px;
}

.platform-settings-panel { margin-top: 16px; }

.platform-help-btn {
  background: rgba(199,255,46,0.08);
  color: var(--accent-lime);
  border-color: rgba(199,255,46,0.25);
}
.platform-help-btn:hover { background: rgba(199,255,46,0.14); }

.platform-help-panel {
  margin: 0 18px 18px;
  padding: 14px 16px;
  background: var(--surface-alt);
  border: 1px solid var(--border-mid);
  border-radius: var(--r);
}

.platform-help-panel > strong {
  display: block;
  font-size: 12.5px;
  color: var(--text);
  margin-bottom: 10px;
}

.platform-help-steps {
  margin: 0;
  padding-left: 18px;
  list-style: decimal;
}

.platform-help-steps li {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 6px;
}

.platform-help-steps li:last-child { margin-bottom: 0; }

.platform-help-link {
  color: var(--accent-lime);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.platform-help-link:hover { text-decoration: underline; }

.platform-connections-toggle {
  display: block;
  margin: 18px auto 0;
  padding: 6px 4px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 11px;
  opacity: 0.55;
  cursor: pointer;
  transition: opacity 0.15s;
}
.platform-connections-toggle:hover { opacity: 1; color: var(--text-sub); }

.admin-unlock-error {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--accent-coral);
}

#adminUnlockInput {
  width: 100%;
  margin-top: 4px;
}

/* -----------------------------------------------
   APPROVAL ITEMS
----------------------------------------------- */
.approval-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-muted);
}

.approval-item:last-child { border-bottom: none; }

/* -----------------------------------------------
   TOAST
----------------------------------------------- */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-lg);
  padding: 12px 18px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  box-shadow: 0 8px 32px rgba(0,0,0,0.6);
  z-index: 1000;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  max-width: 320px;
}

.toast.is-visible { opacity: 1; transform: translateY(0); pointer-events: auto; }

/* -----------------------------------------------
   SCROLLBAR
----------------------------------------------- */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

/* -----------------------------------------------
   FOCUS
----------------------------------------------- */
:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }

/* -----------------------------------------------
   HELPERS
----------------------------------------------- */
.muted { color: var(--text-muted) !important; }

/* -----------------------------------------------
   AMBIENT BACKGROUND — Attio-style dot grid + glow
----------------------------------------------- */

.bg-ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

/* Fine dot grid, fading out toward the sidebar edge so it never competes
   with nav text — same idea as Attio's dotted section backgrounds. */
.bg-ambient-grid {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 22px 22px;
  -webkit-mask-image: linear-gradient(to right, transparent 0%, transparent 15%, black 45%);
  mask-image: linear-gradient(to right, transparent 0%, transparent 15%, black 45%);
}

/* Two soft brand-colour blobs, blurred and low-opacity — replaces the old
   per-tab product photos with something that never has to "match" content. */
.bg-ambient-glow {
  position: absolute;
  width: 640px;
  height: 640px;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.16;
}

.bg-ambient-glow--a {
  top: -180px;
  right: -120px;
  background: var(--lime);
}

.bg-ambient-glow--b {
  bottom: -220px;
  right: 18%;
  width: 520px;
  height: 520px;
  background: var(--blue);
  opacity: 0.1;
}

/* Keep status panel text above its decorative overlay */
.status-panel-content { position: relative; z-index: 1; }

/* Stack order — content must sit above the ambient background */
.app-shell { position: relative; z-index: 1; }
.section   { position: relative; z-index: 1; }
.topbar    { position: relative; z-index: 2; }
.sidebar   { position: relative; z-index: 3; }

/* -----------------------------------------------
   LANGUAGE TOGGLE VISIBILITY
----------------------------------------------- */
.answer-card[data-lang="en"] .lang-en { display: block; }
.answer-card[data-lang="en"] .lang-hi { display: none; }
.answer-card[data-lang="hi"] .lang-hi { display: block; }
.answer-card[data-lang="hi"] .lang-en { display: none; }

/* -----------------------------------------------
   DRAFT PANEL
----------------------------------------------- */
.draft-panel { min-height: 140px; }

/* -----------------------------------------------
   MISC TEXT HELPERS
----------------------------------------------- */
p.muted, .muted { color: var(--text-muted) !important; font-size: 12px; }
#aiUsageNote:empty { display: none; }

/* -----------------------------------------------
   PACING BAR
----------------------------------------------- */
.pacing-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 14px 20px;
  margin-top: 10px;
}
.pacing-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.pacing-label { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.pacing-status {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 20px;
  background: rgba(199,255,46,0.1);
  color: var(--lime);
}
.pacing-track {
  height: 5px;
  background: rgba(255,255,255,0.06);
  border-radius: 10px;
  overflow: hidden;
}
.pacing-fill {
  height: 100%;
  border-radius: 10px;
  background: var(--lime);
  transition: width 0.5s ease;
  width: 0;
}
.pacing-sub { margin-top: 7px; font-size: 11px; color: var(--text-muted); }

/* -----------------------------------------------
   HEALTH SCORE + FUNNEL ROW
----------------------------------------------- */
.health-funnel-row {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 10px;
  margin-top: 10px;
}
.health-panel { display: flex; flex-direction: column; }
.health-gauge-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 0 2px;
}
.health-gauge { width: 150px; height: auto; display: block; }
#gaugeFill {
  transition: stroke-dasharray 0.7s cubic-bezier(0.34,1.3,0.64,1), stroke 0.4s ease;
}
.health-score-num {
  font-size: 34px;
  font-weight: 700;
  text-align: center;
  margin-top: -14px;
  line-height: 1;
  color: var(--text);
  font-family: 'Inter', ui-sans-serif, sans-serif;
  transition: color 0.4s ease;
}
.health-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-top: 9px;
  text-transform: uppercase;
  color: var(--lime);
  transition: color 0.4s ease;
}
.health-breakdown {
  list-style: none;
  padding: 10px 0 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.health-breakdown li {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
  padding: 4px 8px;
  background: rgba(255,255,255,0.03);
  border-radius: var(--r-sm);
}
.health-breakdown li strong { font-size: 11px; color: var(--text); font-weight: 600; }

/* Funnel */
.funnel-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px 0;
}
.funnel-step {
  display: grid;
  grid-template-columns: 88px 1fr 76px 80px;
  align-items: center;
  gap: 8px;
}
.funnel-step-label { font-size: 11px; color: var(--text-muted); text-align: right; }
.funnel-step-bar-wrap {
  height: 26px;
  background: rgba(255,255,255,0.04);
  border-radius: 5px;
  overflow: hidden;
}
.funnel-step-bar {
  height: 100%;
  border-radius: 5px;
  transition: width 0.6s ease;
}
.funnel-step-value { font-size: 13px; font-weight: 600; color: var(--text); text-align: right; }
.funnel-step-drop { font-size: 10px; color: var(--text-muted); text-align: right; }

/* -----------------------------------------------
   DAY OF WEEK + INSIGHTS ROW
----------------------------------------------- */
.dow-insights-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}
.dow-chart-wrap { height: 155px; position: relative; }

/* AI Insight cards */
.insights-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 2px 0;
}
.insight-card {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  font-size: 12px;
  line-height: 1.5;
  border: 1px solid transparent;
}
.insight-card.is-positive {
  background: rgba(35,209,139,0.07);
  border-color: rgba(35,209,139,0.18);
  color: #23d18b;
}
.insight-card.is-warning {
  background: rgba(251,191,36,0.07);
  border-color: rgba(251,191,36,0.2);
  color: #fbbf24;
}
.insight-card.is-alert {
  background: rgba(248,113,113,0.07);
  border-color: rgba(248,113,113,0.18);
  color: #f87171;
}
.insight-card.is-neutral {
  background: rgba(79,140,255,0.07);
  border-color: rgba(79,140,255,0.18);
  color: var(--blue);
}
.insight-icon { flex-shrink: 0; margin-top: 1px; }

/* -----------------------------------------------
   LANGUAGE TOGGLE
----------------------------------------------- */
.lang-toggle {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 20px;
  padding: 5px 12px;
  cursor: pointer;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.03em;
  transition: background 0.2s, border-color 0.2s;
  font-family: 'Inter', ui-sans-serif, sans-serif;
  white-space: nowrap;
}
.lang-toggle:hover {
  background: rgba(255,255,255,0.09);
  border-color: rgba(255,255,255,0.18);
  color: var(--text);
}
.lang-opt {
  transition: color 0.2s;
}
.lang-opt.is-active {
  color: var(--lime);
}
.lang-sep {
  color: rgba(255,255,255,0.18);
  font-weight: 400;
}

/* -----------------------------------------------
   CAMPAIGN HEALTH SCORES
----------------------------------------------- */
.chs-panel-wrap { margin-bottom: 16px; }

.chs-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 4px 0 6px;
}

.chs-card {
  flex: 1 1 160px;
  max-width: 210px;
  background: linear-gradient(160deg, rgba(255,255,255,0.035) 0%, rgba(255,255,255,0.015) 100%);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 14px;
  padding: 16px 14px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.22s ease, transform 0.22s ease, box-shadow 0.22s ease;
  cursor: default;
}

/* Top accent glow line */
.chs-card::before {
  content: '';
  position: absolute;
  top: 0; left: 50%; transform: translateX(-50%);
  width: 55%; height: 1px;
  background: linear-gradient(90deg, transparent, var(--chs-color, rgba(199,255,46,0.7)), transparent);
}

.chs-card:hover {
  border-color: color-mix(in srgb, var(--chs-color, #c7ff2e) 35%, transparent);
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.28);
}

.chs-arc-wrap {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.chs-arc-svg {
  width: 100%;
  max-width: 108px;
  overflow: visible;
  display: block;
}

.chs-arc-fill {
  transition: stroke-dashoffset 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

.chs-score-num {
  position: absolute;
  bottom: 6px;
  left: 50%; transform: translateX(-50%);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 1;
  white-space: nowrap;
}

.chs-grade {
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(255,255,255,0.3);
  text-align: center;
  margin-top: -4px;
}

.chs-body {
  width: 100%;
  text-align: center;
}

.chs-name {
  font-size: 10px;
  font-weight: 600;
  color: rgba(255,255,255,0.65);
  margin-bottom: 7px;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chs-meta {
  display: flex;
  gap: 5px;
  justify-content: center;
  margin-bottom: 7px;
}

.chs-stat {
  font-size: 9.5px;
  font-weight: 600;
  color: rgba(255,255,255,0.42);
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 4px;
  padding: 2px 6px;
  white-space: nowrap;
}

.chs-badges {
  display: flex;
  gap: 5px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}

.chs-spend {
  font-size: 9px;
  font-weight: 600;
  color: rgba(255,255,255,0.3);
}

/* -----------------------------------------------
   LIVE INTELLIGENCE FEED
----------------------------------------------- */
.intel-live-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #23d18b;
  margin-left: 7px;
  vertical-align: middle;
  position: relative;
  top: -1px;
  box-shadow: 0 0 0 0 rgba(35,209,139,0.5);
  animation: liveGlow 2.2s cubic-bezier(0.4,0,0.6,1) infinite;
}

@keyframes liveGlow {
  0%   { box-shadow: 0 0 0 0 rgba(35,209,139,0.55); }
  60%  { box-shadow: 0 0 0 7px rgba(35,209,139,0); }
  100% { box-shadow: 0 0 0 0 rgba(35,209,139,0); }
}

.anom-empty {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 22px 0 16px;
  color: rgba(255,255,255,0.35);
  font-size: 12px;
  font-style: italic;
}

.anom-pulse-dot {
  width: 8px; height: 8px;
  flex-shrink: 0;
  border-radius: 50%;
  background: #23d18b;
  box-shadow: 0 0 0 0 rgba(35,209,139,0.5);
  animation: liveGlow 2s infinite;
}

.anom-feed {
  display: flex;
  flex-direction: column;
  padding: 2px 0;
}

.anom-item {
  display: flex;
  gap: 11px;
  animation: anomSlide 0.38s ease both;
  animation-delay: var(--anim-delay, 0ms);
}

@keyframes anomSlide {
  from { opacity: 0; transform: translateX(-10px); }
  to   { opacity: 1; transform: translateX(0); }
}

.anom-timeline {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 4px;
  flex-shrink: 0;
  width: 12px;
}

.anom-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  background: rgba(255,255,255,0.22);
  border: 1.5px solid rgba(255,255,255,0.12);
}

.anom-item.is-spike .anom-dot  { background: #c7ff2e; border-color: #c7ff2e; box-shadow: 0 0 8px rgba(199,255,46,0.45); }
.anom-item.is-positive .anom-dot { background: #4ade80; border-color: #4ade80; box-shadow: 0 0 8px rgba(74,222,128,0.4); }
.anom-item.is-drop .anom-dot   { background: #fb7185; border-color: #fb7185; box-shadow: 0 0 8px rgba(251,113,133,0.4); }
.anom-item.is-warning .anom-dot { background: #fbbf24; border-color: #fbbf24; box-shadow: 0 0 8px rgba(251,191,36,0.35); }

.anom-line {
  width: 1px;
  flex: 1;
  min-height: 14px;
  background: linear-gradient(to bottom, rgba(255,255,255,0.1), rgba(255,255,255,0.03));
  margin-top: 3px;
}

.anom-body {
  flex: 1;
  min-width: 0;
  padding-bottom: 11px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.anom-item:last-child .anom-body {
  border-bottom: none;
  padding-bottom: 4px;
}

.anom-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 3px;
}

.anom-metric {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.anom-date {
  font-size: 9px;
  font-weight: 500;
  color: rgba(255,255,255,0.25);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.anom-msg {
  font-size: 11px;
  color: rgba(255,255,255,0.48);
  line-height: 1.45;
}

.anom-why-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: rgba(255,255,255,0.55);
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 20px;
  padding: 4px 10px;
  cursor: pointer;
  transition: background 0.16s, border-color 0.16s, color 0.16s;
}
.anom-why-btn svg { width: 11px; height: 11px; }
.anom-why-btn:hover {
  background: rgba(199,255,46,0.1);
  border-color: rgba(199,255,46,0.3);
  color: var(--lime);
}

/* -----------------------------------------------
   DATE RANGE PICKER — wrapper + Custom button
----------------------------------------------- */
.date-range-wrap {
  position: relative;
}

.date-btn-custom {
  display: flex;
  align-items: center;
  gap: 5px;
  border-left: 1px solid rgba(255,255,255,0.08) !important;
  margin-left: 4px;
  padding-left: 12px;
}

.date-btn-custom svg {
  opacity: 0.6;
  flex-shrink: 0;
}

.date-btn-custom.is-active {
  color: var(--lime);
  background: var(--lime-dim);
  border-color: var(--lime-glow) !important;
}
.date-btn-custom.is-active svg { opacity: 1; }

/* -----------------------------------------------
   CALENDAR PANEL
----------------------------------------------- */
.cal-panel {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  z-index: 200;
  background: #111118;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.04);
  min-width: 580px;
  overflow: hidden;
  animation: calDrop 0.18s cubic-bezier(0.16,1,0.3,1) both;
}

@media (max-width: 660px) {
  .cal-panel { min-width: calc(100vw - 32px); left: 0; }
}

@keyframes calDrop {
  from { opacity: 0; transform: translateY(-6px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.cal-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
}

.cal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(255,255,255,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px; height: 24px;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}
.cal-close:hover { background: rgba(255,255,255,0.07); color: #fff; }

.cal-range-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.cal-range-pill {
  flex: 1;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 9px;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: border-color 0.15s, background 0.15s;
}
.cal-range-pill.is-picking {
  border-color: var(--lime);
  background: rgba(199,255,46,0.06);
}

.cal-range-pill-label {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.3);
}
.cal-range-pill.is-picking .cal-range-pill-label { color: var(--lime); }

.cal-range-pill-val {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,0.75);
  white-space: nowrap;
}
.cal-range-pill.is-picking .cal-range-pill-val { color: #fff; }

.cal-nav-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 18px 0;
  position: absolute;
  left: 0; right: 0;
  top: 118px;
  pointer-events: none;
}

.cal-nav-btn {
  pointer-events: all;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 7px;
  color: rgba(255,255,255,0.6);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  transition: background 0.15s, color 0.15s;
}
.cal-nav-btn:hover { background: rgba(255,255,255,0.1); color: #fff; }

.cal-months-wrap {
  display: flex;
  gap: 0;
  padding: 10px 0 6px;
  position: relative;
}

.cal-month {
  flex: 1;
  padding: 6px 16px 10px;
}
.cal-month + .cal-month {
  border-left: 1px solid rgba(255,255,255,0.05);
}

.cal-month-name {
  font-size: 11.5px;
  font-weight: 700;
  color: rgba(255,255,255,0.75);
  text-align: center;
  margin-bottom: 10px;
  margin-top: 2px;
  letter-spacing: 0.01em;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.cal-dow {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255,255,255,0.25);
  text-align: center;
  padding: 2px 0 6px;
}

.cal-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11.5px;
  font-weight: 500;
  color: rgba(255,255,255,0.7);
  border-radius: 6px;
  cursor: pointer;
  position: relative;
  transition: background 0.1s, color 0.1s;
  user-select: none;
  z-index: 1;
}

.cal-day.is-empty {
  pointer-events: none;
}

.cal-day.is-future {
  color: rgba(255,255,255,0.18);
  cursor: not-allowed;
  pointer-events: none;
}

.cal-day.is-today:not(.is-start):not(.is-end) {
  color: var(--lime);
  font-weight: 700;
}
.cal-day.is-today:not(.is-start):not(.is-end)::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%; transform: translateX(-50%);
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--lime);
  opacity: 0.7;
}

.cal-day:hover:not(.is-empty):not(.is-future) {
  background: rgba(255,255,255,0.08);
  color: #fff;
}

/* In-range highlight */
.cal-day.in-range {
  background: rgba(199,255,46,0.1);
  color: rgba(255,255,255,0.85);
  border-radius: 0;
}

/* Start and end cells */
.cal-day.is-start,
.cal-day.is-end {
  background: var(--lime) !important;
  color: #07070a !important;
  font-weight: 700;
  border-radius: 6px;
  z-index: 2;
}

.cal-day.is-start.in-range,
.cal-day.is-start {
  border-radius: 6px 0 0 6px;
}
.cal-day.is-end.in-range,
.cal-day.is-end {
  border-radius: 0 6px 6px 0;
}

/* When start === end (single day or preset same-day) */
.cal-day.is-start.is-single,
.cal-day.is-end.is-single {
  border-radius: 6px;
}

.cal-day.is-anchor {
  box-shadow: 0 0 0 2px rgba(199,255,46,0.4);
}

/* Footer */
.cal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px 14px;
  border-top: 1px solid rgba(255,255,255,0.05);
  gap: 12px;
  flex-wrap: wrap;
}

.cal-presets {
  display: flex;
  gap: 5px;
}

.cal-preset-btn {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 6px;
  color: rgba(255,255,255,0.5);
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  padding: 4px 9px;
  font-family: inherit;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.cal-preset-btn:hover {
  background: rgba(199,255,46,0.1);
  border-color: rgba(199,255,46,0.3);
  color: var(--lime);
}

.cal-foot-actions {
  display: flex;
  gap: 8px;
}

/* -----------------------------------------------
   CONTEXTUAL AI SUGGESTIONS
----------------------------------------------- */
.ai-ask-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--lime);
  background: rgba(199,255,46,0.08);
  border: 1px solid rgba(199,255,46,0.18);
  border-radius: 20px;
  padding: 4px 11px;
  cursor: pointer;
  transition: background 0.16s, border-color 0.16s, transform 0.13s;
  white-space: nowrap;
  flex-shrink: 0;
}
.ai-ask-btn:hover {
  background: rgba(199,255,46,0.15);
  border-color: rgba(199,255,46,0.4);
  transform: scale(1.04);
}
.ai-ask-btn:active { transform: scale(0.96); }

.metric-ai-btn {
  position: absolute;
  bottom: 9px;
  right: 9px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(199,255,46,0.12);
  border: 1px solid rgba(199,255,46,0.25);
  color: var(--lime);
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.18s, background 0.15s, transform 0.13s;
}
.metric-card:hover .metric-ai-btn {
  opacity: 1;
  pointer-events: auto;
}
.metric-ai-btn:hover {
  background: rgba(199,255,46,0.24);
  transform: scale(1.14);
}

.campaign-ai-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 700;
  color: var(--lime);
  background: rgba(199,255,46,0.07);
  border: 1px solid rgba(199,255,46,0.15);
  border-radius: 6px;
  padding: 3px 8px;
  cursor: pointer;
  transition: background 0.14s, border-color 0.14s, opacity 0.14s;
  white-space: nowrap;
  opacity: 0.65;
}
.campaign-ai-btn:hover {
  background: rgba(199,255,46,0.14);
  border-color: rgba(199,255,46,0.35);
  opacity: 1;
}

.chs-ai-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 10px;
  width: 100%;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--lime);
  background: rgba(199,255,46,0.07);
  border: 1px solid rgba(199,255,46,0.15);
  border-radius: 7px;
  padding: 5px 0;
  cursor: pointer;
  transition: background 0.14s, border-color 0.14s;
}
.chs-ai-btn:hover {
  background: rgba(199,255,46,0.14);
  border-color: rgba(199,255,46,0.35);
}

/* ── AI Insight Popover ─────────────────────── */
#aiInsightPopover {
  position: fixed;
  z-index: 9999;
  width: 320px;
  max-width: calc(100vw - 20px);
  background: #0d0d13;
  border: 1px solid rgba(199,255,46,0.22);
  border-radius: 14px;
  padding: 0;
  box-shadow: 0 16px 48px rgba(0,0,0,0.78), 0 0 0 1px rgba(199,255,46,0.06);
  display: none;
  max-height: 440px;
  overflow: hidden;
  flex-direction: column;
}
#aiInsightPopover.is-visible {
  display: flex;
  animation: aipIn 0.22s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
#featureInfoPopover {
  position: fixed;
  z-index: 9999;
  width: 300px;
  max-width: calc(100vw - 20px);
  background: #0d0d13;
  border: 1px solid rgba(199,255,46,0.22);
  border-radius: 14px;
  padding: 0;
  box-shadow: 0 16px 48px rgba(0,0,0,0.78), 0 0 0 1px rgba(199,255,46,0.06);
  display: none;
  max-height: 220px;
  overflow: hidden;
  flex-direction: column;
}
#featureInfoPopover.is-visible {
  display: flex;
  animation: aipIn 0.22s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.feature-info-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(255,255,255,0.07);
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.14s, color 0.14s;
}
.feature-info-btn svg { width: 11px; height: 11px; }
.feature-info-btn:hover { background: rgba(199,255,46,0.18); color: var(--lime); }
@keyframes aipIn {
  from { opacity: 0; transform: translateY(8px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.aip-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}
.aip-title {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--lime);
}
.aip-close {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  border: none;
  color: rgba(255,255,255,0.4);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1;
  transition: background 0.14s, color 0.14s;
}
.aip-close:hover { color: #fff; background: rgba(255,255,255,0.11); }
.aip-body {
  padding: 14px 16px;
  overflow-y: auto;
  flex: 1;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}
.aip-loading {
  display: flex;
  align-items: center;
  gap: 5px;
}
.aip-loading-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--lime);
  animation: aipDotBounce 1.1s ease-in-out infinite;
}
.aip-loading-dot:nth-child(2) { animation-delay: 0.18s; }
.aip-loading-dot:nth-child(3) { animation-delay: 0.36s; }
@keyframes aipDotBounce {
  0%, 80%, 100% { opacity: 0.22; transform: scale(0.72); }
  40% { opacity: 1; transform: scale(1); }
}
.aip-loading-label {
  font-size: 11.5px;
  color: rgba(255,255,255,0.35);
  margin-left: 3px;
}
.aip-card-title {
  font-size: 12.5px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 6px;
  line-height: 1.35;
}
.aip-card-text {
  font-size: 11.5px;
  color: rgba(255,255,255,0.55);
  margin: 0 0 10px;
  line-height: 1.58;
}
.aip-steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.aip-steps li {
  display: flex;
  gap: 8px;
  font-size: 11.5px;
  line-height: 1.52;
  color: rgba(255,255,255,0.72);
}
.aip-steps li::before {
  content: '→';
  color: var(--lime);
  font-weight: 800;
  flex-shrink: 0;
  margin-top: 1px;
}
.aip-divider {
  height: 1px;
  background: rgba(255,255,255,0.06);
  margin: 12px 0;
}
.aip-error {
  font-size: 12px;
  color: rgba(255,255,255,0.3);
  text-align: center;
  padding: 6px 0;
}

.aip-more-btn {
  display: block;
  width: 100%;
  margin-top: 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--lime);
  background: rgba(199,255,46,0.08);
  border: 1px solid rgba(199,255,46,0.2);
  border-radius: 20px;
  padding: 7px 0;
  cursor: pointer;
  transition: background 0.16s, border-color 0.16s;
}
.aip-more-btn:hover {
  background: rgba(199,255,46,0.15);
  border-color: rgba(199,255,46,0.4);
}

.clarify-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.clarify-option-btn {
  font-size: 12px;
  font-weight: 600;
  color: var(--lime);
  background: rgba(199,255,46,0.08);
  border: 1px solid rgba(199,255,46,0.25);
  border-radius: 20px;
  padding: 7px 14px;
  cursor: pointer;
  transition: background 0.16s, border-color 0.16s;
}
.clarify-option-btn:hover {
  background: rgba(199,255,46,0.18);
  border-color: rgba(199,255,46,0.45);
}

.clarify-custom-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.clarify-custom-input {
  flex: 1;
  font-size: 12px;
  padding: 7px 12px;
}
.clarify-custom-submit {
  font-size: 12px;
  font-weight: 600;
  color: var(--lime);
  background: rgba(199,255,46,0.08);
  border: 1px solid rgba(199,255,46,0.25);
  border-radius: var(--r);
  padding: 7px 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.16s, border-color 0.16s;
}
.clarify-custom-submit:hover {
  background: rgba(199,255,46,0.18);
  border-color: rgba(199,255,46,0.45);
}

/* ===== SHOPIFY PLATFORM MODE — hide ALL Google Ads panels ===== */
body.is-shopify #healthFunnelRow,
body.is-shopify #chsPanelWrap,
body.is-shopify #pacingWrap,
body.is-shopify #comparisonPanel,
body.is-shopify #splitLayout {
  display: none !important;
}

/* ===== META PLATFORM MODE — hide Google Ads + Shopify panels ===== */
body.is-meta #healthFunnelRow,
body.is-meta #chsPanelWrap,
body.is-meta #pacingWrap,
body.is-meta #comparisonPanel,
body.is-meta #splitLayout,
body.is-meta #shopifyOrdersPanel,
body.is-meta #shopifyHealthRow {
  display: none !important;
}

/* -----------------------------------------------
   SUGGESTION BOX
----------------------------------------------- */
.suggestion-fab {
  margin: 10px 8px 4px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--r-lg);
  background: var(--lime);
  color: #0a0a0f;
  font-size: 13px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(199,255,46,0.3);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.suggestion-fab:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(199,255,46,0.4);
}

.suggestion-fab svg { width: 16px; height: 16px; flex-shrink: 0; }

.suggestion-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5,5,8,0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1100;
  padding: 20px;
}

.suggestion-modal {
  width: 440px;
  max-width: 100%;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-lg);
  padding: 22px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.55);
}

.suggestion-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.suggestion-modal-header h4 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.suggestion-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
}

.suggestion-close:hover { color: var(--text); }
.suggestion-close svg { width: 16px; height: 16px; }

.suggestions-list {
  max-height: 420px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.suggestion-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
}

.suggestion-item-text {
  font-size: 13px;
  color: var(--text);
  line-height: 1.5;
  margin: 0 0 4px;
}

.suggestion-item-date {
  font-size: 10.5px;
  color: var(--text-muted);
}

.suggestion-modal > p.muted {
  font-size: 12.5px;
  margin-bottom: 14px;
  line-height: 1.6;
}

.suggestion-modal textarea {
  width: 100%;
  margin-bottom: 14px;
}

.help-chat-modal {
  width: 520px;
  display: flex;
  flex-direction: column;
  max-height: 80vh;
}

.help-chat-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.help-chat-messages {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px 2px 12px;
  min-height: 160px;
  max-height: 50vh;
}

.help-chat-bubble {
  max-width: 85%;
  font-size: 13px;
  line-height: 1.55;
  padding: 9px 13px;
  border-radius: 14px;
  white-space: pre-wrap;
}

.help-chat-bubble-user {
  align-self: flex-end;
  background: rgba(199,255,46,0.12);
  border: 1px solid rgba(199,255,46,0.25);
  color: var(--text);
}

.help-chat-bubble-assistant {
  align-self: flex-start;
  background: var(--bg-raised);
  border: 1px solid var(--border-mid);
  color: var(--text);
}

.help-chat-input-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.help-chat-input {
  flex: 1;
  resize: none;
  max-height: 100px;
}

.help-chat-send {
  white-space: nowrap;
}
