/* ═══════════════════════════════════════════════════════════════════
   Adzio UI Design System
   Dark-first, Google Ads command center aesthetic
═══════════════════════════════════════════════════════════════════ */

/* ── Tokens ─────────────────────────────────────────────────────── */
:root {
  --shadow-sm: 0 1px 3px rgba(0,0,0,.35), 0 1px 2px rgba(0,0,0,.25);
  --shadow-md: 0 4px 16px rgba(0,0,0,.45), 0 2px 6px rgba(0,0,0,.3);
  --shadow-lg: 0 12px 40px rgba(0,0,0,.6), 0 4px 12px rgba(0,0,0,.4);
  --glow-blue: 0 0 0 3px rgba(79,142,247,.18);
  --transition: 150ms cubic-bezier(.4,0,.2,1);
  --bg:      #08080b;
  --bg-1:    #0e0e12;
  --bg-2:    #151519;
  --bg-3:    #1c1c22;
  --bg-4:    #242429;
  --bg-5:    #2e2e35;
  --border:  rgba(255,255,255,.055);
  --border-2:rgba(255,255,255,.10);
  --border-3:rgba(255,255,255,.18);
  --fg:      #eeeef2;
  --fg-2:    #9494a6;
  --fg-3:    #555562;
  --fg-4:    #28282f;
  --blue:    #4f8ef7;
  --blue-d:  rgba(79,142,247,.09);
  --blue-m:  rgba(79,142,247,.18);
  --blue-g:  rgba(79,142,247,.35);
  --green:   #22c55e;
  --green-d: rgba(34,197,94,.09);
  --amber:   #f59e0b;
  --amber-d: rgba(245,158,11,.09);
  --red:     #ef4444;
  --red-d:   rgba(239,68,68,.09);
  --purple:  #a78bfa;
  --purple-d:rgba(167,139,250,.09);
  --r-xs:3px; --r-sm:6px; --r-md:10px; --r-lg:14px; --r-xl:20px; --r-full:9999px;
  color-scheme: dark;
}

/* Light mode overrides */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg:     #f8f8fb;
    --bg-1:   #f0f0f4;
    --bg-2:   #e8e8ee;
    --bg-3:   #dddde6;
    --bg-4:   #d0d0da;
    --bg-5:   #c4c4d0;
    --border: rgba(0,0,0,.07);
    --border-2:rgba(0,0,0,.12);
    --border-3:rgba(0,0,0,.20);
    --fg:     #111118;
    --fg-2:   #555568;
    --fg-3:   #9898a8;
    --fg-4:   #c8c8d8;
    --blue-d: rgba(79,142,247,.08);
    --blue-m: rgba(79,142,247,.16);
    color-scheme: light;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg:     #f8f8fb;
  --bg-1:   #f0f0f4;
  --bg-2:   #e8e8ee;
  --bg-3:   #dddde6;
  --bg-4:   #d0d0da;
  --bg-5:   #c4c4d0;
  --border: rgba(0,0,0,.07);
  --border-2:rgba(0,0,0,.12);
  --border-3:rgba(0,0,0,.20);
  --fg:     #111118;
  --fg-2:   #555568;
  --fg-3:   #9898a8;
  --fg-4:   #c8c8d8;
  --blue-d: rgba(79,142,247,.08);
  --blue-m: rgba(79,142,247,.16);
  color-scheme: light;
}

/* ── Reset ──────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; background: var(--bg); color: var(--fg);
  font-family: 'Inter', system-ui, sans-serif; font-size: 14px;
  line-height: 1.5; overflow: hidden;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv02","cv03","cv04","cv11"; }
button { cursor: pointer; border: none; background: none; color: inherit; font: inherit; }
input, textarea, select { font: inherit; color: inherit; background: none; border: none; outline: none; }
svg { flex-shrink: 0; }
a { color: var(--blue); text-decoration: none; cursor: pointer; }
a:hover { text-decoration: underline; }
.hidden { display: none !important; }

/* ═══ SPLASH ════════════════════════════════════════════════════ */
.splash {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 32px 20px; background: var(--bg); overflow-y: auto;
}
.splash-inner {
  max-width: 520px; width: 100%; display: flex; flex-direction: column;
  align-items: center; text-align: center;
}
.splash-logo { display: flex; align-items: center; gap: 10px;
  font-size: 22px; font-weight: 800; letter-spacing: -.03em; margin-bottom: 28px; }
.splash-mark { width: 38px; height: 38px; background: var(--blue); border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 28px var(--blue-g); }
.splash-title { font-size: 38px; font-weight: 800; letter-spacing: -.035em;
  line-height: 1.15; margin-bottom: 14px; }
.gradient-text { background: linear-gradient(90deg, var(--blue), var(--purple));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.splash-sub { font-size: 15px; color: var(--fg-2); line-height: 1.65;
  max-width: 400px; margin-bottom: 28px; }
.splash-stats { display: flex; gap: 20px; align-items: center; margin-bottom: 32px; flex-wrap: wrap; justify-content: center; }
.stat-item { text-align: center; }
.stat-val { font-size: 20px; font-weight: 700; }
.stat-lbl { font-size: 11px; color: var(--fg-3); margin-top: 2px; }
.stat-div { width: 1px; height: 28px; background: var(--border-2); }
.auth-error { background: var(--red-d); border: 1px solid rgba(239,68,68,.2);
  border-radius: var(--r-md); padding: 10px 14px; font-size: 13px;
  color: var(--red); margin-bottom: 16px; width: 100%; text-align: left; }
.btn-connect { display: flex; align-items: center; gap: 10px; background: #1a1a1f;
  color: #eee; font-weight: 600; font-size: 14px; padding: 12px 28px;
  border-radius: var(--r-full); transition: all .2s; border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 2px 12px rgba(0,0,0,.25); cursor: pointer; text-decoration: none; }
.btn-connect:hover { opacity: .88; transform: translateY(-1px); text-decoration: none; }
/* Light mode: Google-style white pill */
:root[data-theme="light"] .btn-connect,
:root:not([data-theme="dark"]) .btn-connect { background: #fff; color: #3c4043;
  border: 1px solid #dadce0; box-shadow: 0 1px 4px rgba(0,0,0,.12); }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .btn-connect { background: #fff; color: #3c4043;
    border: 1px solid #dadce0; box-shadow: 0 1px 4px rgba(0,0,0,.12); }
}
.splash-note { font-size: 12px; color: var(--fg-3); margin-top: 12px; margin-bottom: 36px; }
.splash-features { display: flex; flex-direction: column; gap: 12px; width: 100%;
  text-align: left; margin-top: 8px; }
.feat { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--r-md);
  font-size: 13px; line-height: 1.5; }
.feat-icon { font-size: 20px; flex-shrink: 0; }
.feat strong { display: block; font-weight: 600; margin-bottom: 2px; }
.feat div { color: var(--fg-2); }

/* ── Greeting hero ───────────────────────────────────────────── */
.greeting-hero { display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 60px 20px 32px; text-align: center;
  max-width: 680px; margin: 0 auto; width: 100%; }
.greeting-text { font-size: 32px; font-weight: 700; letter-spacing: -.02em;
  color: var(--fg); line-height: 1.2; }
.greeting-sub { font-size: 16px; color: var(--fg-2); margin-top: 8px; line-height: 1.5; }
.greeting-continue-btn {
  display: inline-block; margin-left: 8px;
  padding: 2px 10px; border-radius: 20px; border: 1.5px solid var(--blue);
  background: transparent; color: var(--blue); font-size: 13px; font-weight: 500;
  cursor: pointer; vertical-align: middle; transition: background .15s, color .15s;
}
.greeting-continue-btn:hover { background: var(--blue); color: #fff; }
.greeting-connect { margin-top: 28px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.greeting-connect-note { font-size: 11px; color: var(--fg-3); }

/* ── Account Pulse card ──────────────────────────────────────── */
.pulse-card {
  display: flex; align-items: center; gap: 10px;
  margin-top: 20px; padding: 10px 14px;
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 10px; width: 100%; max-width: 420px;
  transition: border-color .2s;
}
.pulse-card.pulse-critical { border-color: rgba(239,68,68,.4); background: rgba(239,68,68,.06); }
.pulse-card.pulse-warning  { border-color: rgba(245,158,11,.35); background: rgba(245,158,11,.05); }
.pulse-card.pulse-ok       { border-color: rgba(34,197,94,.3);  background: rgba(34,197,94,.05); }
.pulse-dot {
  width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0;
  background: var(--fg-3);
}
.pulse-dot.dot-critical { background: #ef4444; box-shadow: 0 0 6px rgba(239,68,68,.6); }
.pulse-dot.dot-warning  { background: #f59e0b; box-shadow: 0 0 6px rgba(245,158,11,.5); }
.pulse-dot.dot-ok       { background: #22c55e; box-shadow: 0 0 6px rgba(34,197,94,.5); }
.pulse-dot.dot-loading  { background: var(--fg-4); animation: pulse-blink 1.4s ease-in-out infinite; }
@keyframes pulse-blink { 0%,100%{opacity:.3} 50%{opacity:1} }
.pulse-body { flex: 1; min-width: 0; text-align: left; }
.pulse-headline { font-size: 13px; font-weight: 600; color: var(--fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pulse-detail   { font-size: 11px; color: var(--fg-3); margin-top: 2px; }
.pulse-action {
  flex-shrink: 0; background: none; border: 1px solid var(--border);
  color: var(--fg-2); font-size: 12px; font-weight: 500;
  padding: 4px 10px; border-radius: 6px; cursor: pointer;
  transition: border-color .15s, color .15s;
}
.pulse-action:hover { border-color: var(--blue); color: var(--blue); }

.starters-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
  margin-top: 32px; width: 100%; max-width: 780px; }
.starter-card { background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 14px 16px; cursor: pointer; text-align: left;
  transition: border-color .15s, background .15s; }
.starter-card:hover { background: var(--bg-3); border-color: var(--border-2); }
.starter-icon { font-size: 20px; margin-bottom: 8px; }
.starter-label { font-size: 13px; font-weight: 600; color: var(--fg); }
.starter-sub { font-size: 11px; color: var(--fg-2); margin-top: 2px; }

/* ── Settings modal ──────────────────────────────────────────── */
.stg-backdrop { position:fixed; inset:0; background:rgba(0,0,0,.55); z-index:300; backdrop-filter:blur(3px); }
.stg-backdrop.hidden { display:none; }
.stg-modal {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%,-50%);
  z-index: 301; display: flex;
  width: calc(100vw - 40px); max-width: 720px;
  height: calc(100vh - 80px); max-height: 540px;
  border-radius: 14px; overflow: hidden;
  box-shadow: 0 24px 80px rgba(0,0,0,.5);
}
.stg-modal.hidden { display:none; }
.stg-nav {
  width: 190px; flex-shrink: 0;
  background: var(--bg-1);
  border-right: 1px solid var(--border);
  padding: 20px 0;
  border-radius: 14px 0 0 14px;
  display: flex; flex-direction: column; gap: 2px;
}
.stg-panel {
  flex: 1; min-width: 0;
  background: var(--bg-2);
  border-radius: 0 14px 14px 0;
  padding: 28px 32px;
  overflow-y: auto;
  position: relative;
}

.stg-nav-title {
  font-size: 11px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--fg-3);
  padding: 0 16px 10px;
}
.stg-nav-item {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 16px; border-radius: 8px; margin: 0 8px;
  font-size: 13px; font-weight: 500; color: var(--fg-2);
  background: none; border: none; cursor: pointer; text-align: left;
  transition: background .12s, color .12s;
}
.stg-nav-item:hover { background: var(--bg-3); color: var(--fg); }
.stg-nav-item.active { background: var(--bg-3); color: var(--fg); font-weight: 600; }
.stg-nav-item svg { flex-shrink: 0; opacity: .7; }

.stg-close {
  position: absolute; top: 16px; right: 16px;
  background: none; border: none; cursor: pointer;
  color: var(--fg-3); padding: 4px; border-radius: 6px;
  transition: color .15s, background .15s;
}
.stg-close:hover { color: var(--fg); background: var(--bg-3); }

/* Sections */
.stg-section { display: none; }
.stg-section.active { display: block; }
.stg-section-title { font-size: 16px; font-weight: 700; color: var(--fg); margin: 0 0 20px; }

/* Avatar row */
.stg-avatar-row { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }
.stg-avatar { width: 48px; height: 48px; border-radius: 50%; background: var(--blue);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700; color: #fff; flex-shrink: 0; }
.stg-avatar-name { font-size: 15px; font-weight: 600; color: var(--fg); }
.stg-avatar-email { font-size: 12px; color: var(--fg-3); margin-top: 2px; }

/* Fields */
.stg-field { margin-bottom: 20px; }
.stg-field-label { font-size: 11px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--fg-3); margin-bottom: 8px; display: block; }
.stg-field-row { display: flex; gap: 8px; }
.stg-field-hint { font-size: 11px; color: var(--fg-3); margin-top: 6px; }
.stg-input { flex: 1; background: var(--bg-3); border: 1px solid var(--border);
  border-radius: var(--r); padding: 8px 11px; font-size: 13px; color: var(--fg); }
.stg-input:focus { outline: none; border-color: var(--blue-m); }

/* Info rows */
.stg-info-row { display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0; border-bottom: 1px solid var(--border); }
.stg-info-label { font-size: 13px; color: var(--fg-2); }
.stg-info-val { font-size: 13px; font-weight: 500; color: var(--fg); }
.stg-divider { height: 1px; background: var(--border); margin: 20px 0; }

/* Buttons */
.stg-btn-primary { display: inline-flex; align-items: center; padding: 9px 18px;
  border-radius: 8px; background: var(--blue-m); color: #fff; font-size: 13px;
  font-weight: 600; border: none; cursor: pointer; transition: opacity .15s; margin-top: 4px; }
.stg-btn-primary:hover { opacity: .88; }
.stg-btn-secondary { display: inline-flex; align-items: center; padding: 9px 18px;
  border-radius: 8px; background: var(--bg-3); color: var(--fg); font-size: 13px;
  font-weight: 500; border: 1px solid var(--border); cursor: pointer; transition: background .15s; margin-top: 4px; }
.stg-btn-secondary:hover { background: var(--bg-4); }
.stg-btn-save { padding: 8px 16px; border-radius: var(--r); background: var(--blue-m);
  color: #fff; font-size: 12px; font-weight: 600; border: none; cursor: pointer;
  transition: opacity .15s; white-space: nowrap; }
.stg-btn-save:hover { opacity: .85; }
.stg-btn-danger { padding: 9px 16px; border-radius: var(--r);
  background: rgba(239,68,68,.08); color: #f87171; font-size: 13px; font-weight: 600;
  border: 1px solid rgba(239,68,68,.25); cursor: pointer; transition: background .15s; }
.stg-btn-danger:hover { background: rgba(239,68,68,.16); }
.stg-hint-text { font-size: 12px; color: var(--fg-3); margin-top: 14px; line-height: 1.5; }
.stg-link { color: #4f8ef7; text-decoration: none; }
.stg-link:hover { text-decoration: underline; }

/* Plan & Billing */
.stg-plan-badge-row { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.stg-plan-badge { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 20px; }
.stg-plan-free   { background: var(--bg-3); color: var(--fg-2); border: 1px solid var(--border); }
.stg-plan-pro    { background: rgba(79,142,247,.15); color: #7ab4fa; border: 1px solid rgba(79,142,247,.3); }
.stg-plan-agency { background: rgba(168,85,247,.15); color: #c084fc; border: 1px solid rgba(168,85,247,.3); }
.stg-plan-renew  { font-size: 11px; color: var(--fg-3); }
.stg-usage-bar-wrap { margin-bottom: 20px; }
.stg-usage-label { display: flex; justify-content: space-between; font-size: 12px;
  color: var(--fg-2); margin-bottom: 8px; }
.stg-usage-track { height: 5px; background: var(--bg-3); border-radius: 3px; overflow: hidden; }
.stg-usage-fill { height: 100%; background: var(--blue-m); border-radius: 3px; transition: width .4s; }

/* Notifications toggles */
.stg-toggle-row { display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--border); }
.stg-toggle-info { flex: 1; min-width: 0; }
.stg-toggle-label { font-size: 13px; font-weight: 500; color: var(--fg); }
.stg-toggle-sub { font-size: 12px; color: var(--fg-3); margin-top: 3px; line-height: 1.4; }
.stg-toggle {
  width: 40px; height: 22px; border-radius: 11px; border: none;
  background: var(--bg-3); cursor: pointer; position: relative; flex-shrink: 0;
  transition: background .2s;
}
.stg-toggle::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 16px; height: 16px; border-radius: 50%; background: var(--fg-3);
  transition: transform .2s, background .2s;
}
.stg-toggle--on { background: var(--blue-m); }
.stg-toggle--on::after { transform: translateX(18px); background: #fff; }

/* Appearance */
.stg-theme-row { display: flex; gap: 6px; }
.stg-theme-btn { flex: 1; min-width: 0; font-size: 12px; }
/* theme-btn styles already defined globally — stg-theme-btn inherits them */

/* Refer */
.stg-refer-card { display: flex; gap: 14px; align-items: flex-start;
  background: var(--bg-3); border: 1px solid var(--border); border-radius: 12px;
  padding: 16px; margin-bottom: 20px; }
.stg-refer-icon { font-size: 28px; flex-shrink: 0; }
.stg-refer-headline { font-size: 14px; font-weight: 600; color: var(--fg); margin-bottom: 5px; }
.stg-refer-sub { font-size: 12px; color: var(--fg-2); line-height: 1.5; }
.stg-refer-link-row { display: flex; gap: 8px; }
.stg-refer-input { font-size: 12px; color: var(--fg-2); }

/* About */
.stg-about-row { display: flex; justify-content: space-between; padding: 10px 0;
  border-bottom: 1px solid var(--border); }
.stg-about-label { font-size: 13px; color: var(--fg-2); }
.stg-about-val { font-size: 13px; font-weight: 500; color: var(--fg); }
.stg-about-links { display: flex; flex-direction: column; gap: 10px; padding-top: 4px; }

/* Mobile: stack nav above panel */
@media (max-width: 600px) {
  .stg-modal { flex-direction: column; max-height: calc(100vh - 40px); border-radius: 14px; }
  .stg-nav { width: 100%; height: auto; border-right: none; border-bottom: 1px solid var(--border);
    border-radius: 14px 14px 0 0; flex-direction: row; flex-wrap: wrap; padding: 10px 8px 4px; gap: 0; overflow-x: auto; }
  .stg-panel { border-radius: 0 0 14px 14px; }
  .stg-nav-title { display: none; }
  .stg-nav-item { padding: 6px 10px; font-size: 12px; margin: 0 2px 6px; }
}

/* Keep old .theme-btn working (used in profile menu too) */
.theme-btn { flex: 1; padding: 7px 0; border-radius: var(--r); background: var(--bg-3);
  color: var(--fg-2); font-size: 12px; font-weight: 500; border: 1px solid var(--border);
  cursor: pointer; transition: all .15s; }
.theme-btn:hover { background: var(--bg-4); color: var(--fg); }
.theme-btn.active { background: var(--blue-m); color: #fff; border-color: var(--blue-m); }

/* ── Onboarding modal ───────────────────────────────────────── */
.ob-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.7);
  z-index: 300; display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(4px); padding: 20px; }
.ob-overlay.hidden { display: none; }
.ob-modal { background: var(--bg-1); border: 1px solid var(--border-2);
  border-radius: var(--r-xl); padding: 36px 32px; max-width: 400px; width: 100%;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  box-shadow: 0 24px 80px rgba(0,0,0,.5); }
.ob-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 24px; }
.ob-logo-mark { width: 40px; height: 40px; border-radius: 12px;
  background: var(--blue); display: flex; align-items: center; justify-content: center; }
.ob-logo-text { font-size: 22px; font-weight: 800; letter-spacing: -.04em; }
.ob-title { font-size: 22px; font-weight: 700; letter-spacing: -.02em; margin-bottom: 10px; color: var(--fg); }
.ob-sub { font-size: 13px; color: var(--fg-2); line-height: 1.6; margin-bottom: 24px; }
.ob-question { font-size: 14px; font-weight: 600; margin-bottom: 10px; }
.ob-input { width: 100%; background: var(--bg-3); border: 1px solid var(--border-2);
  border-radius: var(--r); padding: 10px 14px; font-size: 14px; margin-bottom: 12px;
  text-align: center; }
.ob-input:focus { outline: none; border-color: var(--blue); }
.ob-btn { width: 100%; padding: 11px; border-radius: var(--r); background: var(--blue);
  color: #fff; font-size: 14px; font-weight: 600; cursor: pointer;
  border: none; margin-bottom: 8px; }
.ob-btn:hover { opacity: .9; }
.ob-skip { background: none; border: none; color: var(--fg-3); font-size: 12px;
  cursor: pointer; padding: 4px; }
.ob-skip:hover { color: var(--fg-2); }
.ob-type-btn {
  display: flex; align-items: center; gap: 14px;
  width: 100%; padding: 14px 16px;
  background: var(--bg-2); border: 1.5px solid var(--border-2);
  border-radius: var(--r-lg); cursor: pointer; text-align: left;
  transition: all var(--transition);
}
.ob-type-btn:hover {
  background: var(--bg-3); border-color: var(--blue);
}
.ob-type-btn.selected {
  background: var(--blue-d); border-color: var(--blue);
  box-shadow: var(--glow-blue);
}

/* ── Sidebar connect button ─────────────────────────────────── */
.sb-connect { display: flex; flex-direction: column; align-items: stretch; gap: 6px; }
.btn-connect-sidebar { display: flex; align-items: center; justify-content: center;
  gap: 8px; padding: 9px 12px; border-radius: var(--r); background: var(--blue);
  color: #fff; font-size: 12px; font-weight: 600; text-decoration: none; }
.btn-connect-sidebar:hover { opacity: .9; text-decoration: none; }
.sb-connect-note { font-size: 10px; color: var(--fg-3); text-align: center; }

/* ── Sidebar settings gear ──────────────────────────────────── */
.sb-head-right { display: flex; gap: 2px; }

/* ── Inline intro response (unauthenticated starters) ───────── */
.intro-response { max-width: 640px; margin: 0 auto; padding: 0 0 16px; }
.intro-bubble { background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 20px 22px; font-size: 14px; line-height: 1.7;
  color: var(--fg); white-space: pre-wrap; }
.intro-bubble strong { color: var(--fg); }
.intro-bubble .intro-feature { display: flex; align-items: flex-start; gap: 10px;
  margin: 10px 0; }
.intro-bubble .intro-feature-icon { font-size: 16px; flex-shrink: 0; margin-top: 2px; }
.intro-cta { margin-top: 16px; background: var(--blue-d); border: 1px solid var(--blue-m);
  border-radius: var(--r-lg); padding: 18px 22px; display: flex;
  flex-direction: column; align-items: flex-start; gap: 10px; }
.intro-cta-text { font-size: 14px; font-weight: 500; color: var(--fg); line-height: 1.5; }
.intro-cta-sub { font-size: 12px; color: var(--fg-2); }

/* ── Guest connect nudge (after a few messages) ─────────────── */
.guest-nudge { display: flex; align-items: center; gap: 12px; max-width: 560px;
  margin: 8px auto; padding: 10px 16px; background: var(--blue-d);
  border: 1px solid var(--blue-m); border-radius: var(--r-full);
  font-size: 12px; color: var(--fg-2); }
.guest-nudge span { flex: 1; }
.btn-nudge-connect { background: var(--blue); color: #fff; padding: 4px 12px;
  border-radius: var(--r-full); font-size: 11px; font-weight: 600;
  text-decoration: none; white-space: nowrap; flex-shrink: 0; }
.btn-nudge-connect:hover { opacity: .85; text-decoration: none; }

/* ── Unauth connect card (inline in chat) ────────────────────── */
.unauth-card { background: var(--bg-2); border: 1px solid var(--border-2);
  border-radius: var(--r-lg); padding: 28px 24px; max-width: 420px; margin: 24px auto;
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; }
.unauth-card-icon { font-size: 28px; margin-bottom: 4px; }
.unauth-card-title { font-size: 16px; font-weight: 700; }
.unauth-card-sub { font-size: 13px; color: var(--fg-2); line-height: 1.5; }
.unauth-card-note { font-size: 11px; color: var(--fg-3); margin-top: 4px; }

/* ═══ APP SHELL ══════════════════════════════════════════════════ */
.app { display: flex; height: 100%; overflow: hidden; }

/* ── Sidebar ── */
.sidebar { width: 230px; flex-shrink: 0; background: var(--bg-1);
  border-right: 1px solid var(--border); display: flex; flex-direction: column;
  transition: width .2s, transform .2s; overflow: hidden; }
.sidebar.collapsed { width: 0; }
.sb-head { padding: 12px 12px 9px; display: flex; align-items: center;
  justify-content: space-between; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.logo { display: flex; align-items: center; gap: 8px;
  font-size: 15px; font-weight: 800; letter-spacing: -.03em; }
.logo-mark { width: 22px; height: 22px; background: var(--blue); border-radius: 7px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.sb-head-right { display: flex; gap: 4px; }
.icon-btn { width: 26px; height: 26px; border-radius: var(--r-sm); background: var(--bg-3);
  display: flex; align-items: center; justify-content: center;
  color: var(--fg-2); transition: all .15s; }
.icon-btn:hover { background: var(--bg-4); color: var(--fg); }

.acct-pill { margin: 8px 10px 4px; padding: 7px 10px; background: var(--bg-2);
  border: 1px solid var(--border); border-radius: var(--r-md);
  display: flex; align-items: center; gap: 6px; cursor: pointer; transition: background .15s;
  flex-shrink: 0; }
.acct-pill:hover { background: var(--bg-3); }
.live-dot { width: 6px; height: 6px; background: var(--green); border-radius: 50%;
  flex-shrink: 0; animation: blink 2s infinite; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:.3} }
.acct-name { font-size: 12px; font-weight: 600; flex: 1; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; color: var(--fg); }
.acct-spend { font-size: 11px; color: var(--amber); font-weight: 600;
  font-variant-numeric: tabular-nums; }

/* Mobile close button — hidden on desktop */
.sb-close-btn { display: none; }
.sb-backdrop { display: none; }

/* ── Agency client list ──────────────────────────────────────────── */
.agency-clients { margin: 8px 10px 4px; flex-shrink: 0; }
.agency-clients-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 5px 8px; border-radius: var(--r-sm); cursor: pointer;
  transition: background .15s;
}
.agency-clients-head:hover { background: var(--bg-3); }
.agency-clients-label {
  display: flex; align-items: center; gap: 5px;
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--fg-3);
}
.agency-count {
  background: var(--bg-3); border-radius: 10px;
  padding: 1px 5px; font-size: 9px; font-weight: 700; color: var(--fg-2);
}
.agency-chevron { color: var(--fg-3); transition: transform .2s; flex-shrink: 0; }
.agency-client-list { overflow-y: auto; transition: max-height .25s ease; max-height: 220px; }
.agency-client-list.collapsed { max-height: 0; overflow: hidden; }
.agency-client-list::-webkit-scrollbar { width: 2px; }
.agency-client-list::-webkit-scrollbar-thumb { background: var(--bg-5); }
.agency-client-row {
  display: flex; align-items: center; gap: 7px; width: 100%;
  padding: 6px 8px; border-radius: var(--r-sm); border: none; background: none;
  cursor: pointer; text-align: left; margin: 1px 0;
  transition: background .15s; color: var(--fg-2);
}
.agency-client-row:hover { background: var(--bg-3); color: var(--fg); }
.agency-client-row.active { background: var(--blue-d); color: var(--fg); }
.agency-client-dot {
  width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0;
}
.agency-client-dot.enabled { background: var(--green); }
.agency-client-dot.paused { background: var(--fg-3); }
.agency-client-info { flex: 1; overflow: hidden; }
.agency-client-name { font-size: 12px; font-weight: 600; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.agency-client-id { font-size: 10px; color: var(--fg-3); }
.agency-client-row.is-child { padding-left: 20px; }
.agency-client-row.acct-cancelled { opacity: .5; }
.sb-mcc-group { margin: 2px 0; }
.sb-mcc-head {
  display: flex; align-items: center; gap: 5px;
  padding: 4px 8px; border-radius: var(--r-sm); cursor: pointer;
  font-size: 10px; color: var(--fg-3); transition: background .15s;
}
.sb-mcc-head:hover { background: var(--bg-3); }
.sb-mcc-name { flex: 1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-mcc-children.collapsed { display: none; }
.agency-active-pill {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 8px; margin: 2px 0;
  background: var(--blue-d); border-radius: var(--r-sm);
}
.agency-active-name {
  flex: 1; font-size: 12px; font-weight: 600; color: var(--fg);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sb-cancelled-toggle {
  display: flex; align-items: center; gap: 3px; cursor: pointer;
  font-size: 9px; color: var(--fg-3); font-weight: 600;
  padding: 2px 5px; border-radius: 10px; background: var(--bg-3);
  white-space: nowrap;
}
.sb-cancelled-toggle input { display: none; }
.sb-empty-accounts { font-size: 11px; color: var(--fg-3); padding: 8px 8px; }

.sb-section { padding: 7px 12px 3px; font-size: 10px; font-weight: 700;
  color: var(--fg-3); text-transform: uppercase; letter-spacing: .08em; flex-shrink: 0; }
.nav-item { display: flex; align-items: center; gap: 8px; padding: 6px 10px;
  border-radius: var(--r-sm); margin: 1px 6px; font-size: 12px; font-weight: 500;
  cursor: pointer; color: var(--fg-2); transition: all .15s; white-space: nowrap; }
.nav-item:hover { background: var(--bg-3); color: var(--fg); }
.nav-item.active { background: var(--blue-d); color: var(--blue); }
.nav-badge-new { margin-left: auto; font-size: 9px; font-weight: 700; padding: 1px 5px;
  border-radius: var(--r-full); background: var(--blue-d); color: var(--blue);
  border: 1px solid var(--blue-m); }

#history-list { flex: 1; overflow-y: auto; padding: 2px 0; }
#history-list::-webkit-scrollbar { width: 2px; }
#history-list::-webkit-scrollbar-thumb { background: var(--bg-5); }
.history-item { padding: 5px 10px 5px 12px; border-radius: var(--r-sm); margin: 1px 6px;
  cursor: pointer; display: flex; justify-content: space-between; align-items: center;
  transition: background .15s; }
.history-item:hover { background: var(--bg-3); }
.history-item--active { background: var(--bg-4) !important; }
.history-item--active .history-title { color: var(--fg-1); font-weight: 600; }
.history-title { font-size: 12px; color: var(--fg-2); overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.history-time { font-size: 10px; color: var(--fg-3); flex-shrink: 0; margin-left: 6px; }
.history-empty { font-size: 12px; color: var(--fg-3); padding: 8px 12px; }

.impact-widget { display: flex; align-items: center; gap: 5px; margin: 6px 8px 2px;
  padding: 6px 10px; border-radius: 8px; background: rgba(16,185,129,.08);
  border: 1px solid rgba(16,185,129,.18); font-size: 11px; color: var(--fg-2);
  cursor: default; }
.impact-widget svg { color: #10b981; flex-shrink: 0; }
.impact-widget .impact-hours { font-weight: 700; color: #10b981; }
.impact-widget .impact-actions { color: var(--fg-2); }

.sb-footer { margin-top: auto; padding: 8px; border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; }
.user-row { display: flex; align-items: center; gap: 7px; }
.avatar { width: 24px; height: 24px; border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--purple));
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; flex-shrink: 0; }
.user-info { min-width: 0; }
.user-name { font-size: 12px; font-weight: 600; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.user-email { font-size: 10px; color: var(--fg-3); }
.btn-disconnect { color: var(--fg-3); padding: 5px; border-radius: var(--r-sm);
  transition: all .15s; }
.btn-disconnect:hover { color: var(--red); background: var(--red-d); }

/* ── Topbar ── */
.topbar { height: 50px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 16px; gap: 10px;
  flex-shrink: 0; background: var(--bg-1); }
.sidebar-toggle { flex-shrink: 0; }
.topbar-title { font-size: 13px; font-weight: 600; flex: 1; }
.badge-beta { font-size: 9px; font-weight: 700; padding: 2px 6px;
  border-radius: var(--r-full); background: var(--blue-d); color: var(--blue);
  border: 1px solid var(--blue-m); vertical-align: middle; margin-left: 6px; }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.period-sel { background: var(--bg-3); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 4px 8px; font-size: 11px;
  color: var(--fg-2); cursor: pointer; appearance: none; }
.mode-strip { display: flex; gap: 2px; background: var(--bg-3);
  border-radius: var(--r-sm); padding: 2px; }
.m-tab { padding: 4px 10px; border-radius: 4px; font-size: 11px; font-weight: 600;
  color: var(--fg-3); cursor: pointer; transition: all .15s; }
.m-tab.active { background: var(--bg-1); color: var(--fg); box-shadow: 0 1px 3px rgba(0,0,0,.5); }

/* ── Agent bar ── */
.agent-bar { background: linear-gradient(90deg,rgba(79,142,247,.06),rgba(167,139,250,.06));
  border-bottom: 1px solid var(--blue-m); padding: 7px 16px;
  display: flex; align-items: center; gap: 8px; font-size: 12px; flex-shrink: 0; }
.agent-pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--blue);
  animation: blink 1s infinite; flex-shrink: 0; }
.agent-bar-stop { margin-left: auto; font-size: 11px; color: var(--fg-3); cursor: pointer; }
.agent-bar-stop:hover { color: var(--fg); }

/* ── Main / Chat ── */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.chat-body { flex: 1; overflow-y: auto; padding: 20px 18px;
  display: flex; flex-direction: column; gap: 14px; scroll-behavior: smooth; }
.chat-body::-webkit-scrollbar { width: 3px; }
.chat-body::-webkit-scrollbar-thumb { background: var(--bg-5); border-radius: 2px; }

/* Welcome */
.welcome { max-width: 560px; margin: 0 auto; padding: 24px 0; width: 100%; }
.welcome-mark { width: 48px; height: 48px; background: var(--blue);
  border-radius: 14px; display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px; box-shadow: 0 0 24px var(--blue-g); }
.welcome-title { font-size: 22px; font-weight: 800; letter-spacing: -.025em;
  margin-bottom: 8px; }
.welcome-sub { font-size: 13px; color: var(--fg-2); margin-bottom: 18px; line-height: 1.6; }
.voice-hint { background: linear-gradient(90deg,var(--blue-d),var(--purple-d,rgba(167,139,250,.07)));
  border: 1px solid var(--blue-m); border-radius: var(--r-md);
  padding: 10px 13px; display: flex; gap: 10px; align-items: center;
  font-size: 12px; color: var(--fg-2); margin-bottom: 18px; line-height: 1.5; }
.voice-hint-icon { font-size: 18px; flex-shrink: 0; }
.quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.qc { background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 13px; cursor: pointer;
  transition: all .15s; }
.qc:hover { background: var(--bg-3); border-color: var(--border-2); transform: translateY(-1px); }
.qc-icon { font-size: 17px; margin-bottom: 7px; }
.qc-title { font-size: 12px; font-weight: 700; margin-bottom: 3px; }
.qc-desc { font-size: 11px; color: var(--fg-3); line-height: 1.4; }

/* Messages */
.msg { display: flex; gap: 9px; animation: msg-in .2s ease; }
@keyframes msg-in { from{opacity:0;transform:translateY(4px)} to{opacity:1;transform:none} }
.msg.user-msg { flex-direction: row-reverse; }
.msg-av { width: 26px; height: 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; flex-shrink: 0; margin-top: 2px; }
.msg-av.ai { background: var(--blue); color: #fff; }
.msg-av.user { background: linear-gradient(135deg,var(--blue),var(--purple)); color: #fff; }
.bubble { background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 11px 14px; max-width: 600px;
  font-size: 13px; line-height: 1.7; }
.bubble p { margin-bottom: 8px; }
.bubble p:last-child { margin-bottom: 0; }
.bubble strong { font-weight: 600; }
.bubble ul, .bubble ol { padding-left: 16px; margin: 6px 0; }
.bubble li { margin-bottom: 4px; }
.bubble code { font-family: 'JetBrains Mono', monospace; font-size: 12px;
  background: var(--bg-4); padding: 1px 5px; border-radius: 4px; }
.msg.user-msg .bubble { background: var(--blue-d); border-color: var(--blue-m);
  max-width: 420px; }

/* Typing indicator */
.typing-indicator { display: flex; gap: 4px; align-items: center; padding: 8px 14px; }
.typing-indicator span { width: 5px; height: 5px; background: var(--fg-3);
  border-radius: 50%; animation: bounce .7s infinite; }
.typing-indicator span:nth-child(2) { animation-delay: .12s; }
.typing-indicator span:nth-child(3) { animation-delay: .24s; }
@keyframes bounce { 0%,80%,100%{transform:translateY(0)} 40%{transform:translateY(-5px)} }

/* Thinking bubble — multi-step reasoning display */
.thinking-bubble { padding: 10px 14px !important; }
.thinking-steps { display: flex; flex-direction: column; gap: 3px; margin-bottom: 4px; }
.thinking-step-done {
  font-size: 11px;
  color: var(--fg-3);
  padding-left: 16px;
  position: relative;
  opacity: .7;
}
.thinking-step-done::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 10px;
}
.thinking-current {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--fg-2);
}
.thinking-cur-text { flex: 1; }

/* Collapsed state after response starts */
.thinking-summary { font-size: 11px; }
.thinking-toggle {
  background: transparent;
  border: none;
  color: var(--fg-3);
  font-size: 11px;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 4px;
}
.thinking-toggle:hover { color: var(--fg-2); }
.thinking-detail { padding-top: 6px; display: flex; flex-direction: column; gap: 3px; }
.thinking-detail.hidden { display: none; }
.thinking-detail-row {
  font-size: 11px;
  color: var(--fg-3);
  padding-left: 14px;
  position: relative;
}
.thinking-detail-row::before {
  content: '·';
  position: absolute;
  left: 4px;
}

/* Legacy thinking-label (used in non-chat contexts) */
.thinking-label { font-size: 11px; color: var(--fg-3); padding: 4px 14px;
  display: flex; align-items: center; gap: 6px; }
.thinking-spin { width: 10px; height: 10px; border: 1px solid var(--fg-3);
  border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Input area ── */
.input-area { border-top: 1px solid var(--border); padding: 12px 16px;
  flex-shrink: 0; background: var(--bg-1); }
.input-wrap { background: var(--bg-2); border: 1px solid var(--border-2);
  border-radius: var(--r-xl); padding: 9px 12px;
  display: flex; flex-direction: column; gap: 8px; transition: border-color .15s; }
.input-wrap:focus-within { border-color: var(--blue); }
.chips-row { display: flex; gap: 5px; flex-wrap: wrap; }
.chip { background: var(--bg-3); border: 1px solid var(--border);
  border-radius: var(--r-full); padding: 4px 11px;
  font-size: 11px; color: var(--fg-2); cursor: pointer;
  transition: all .15s; white-space: nowrap; }
.chip:hover { background: var(--bg-4); color: var(--fg); border-color: var(--border-2); }
.input-row { display: flex; align-items: flex-end; gap: 7px; }
.chat-input { flex: 1; resize: none; min-height: 20px; max-height: 120px;
  overflow-y: auto; font-size: 13px; line-height: 1.5; color: var(--fg); }
.chat-input::placeholder { color: var(--fg-3); }
.input-actions { display: flex; gap: 5px; align-items: center; flex-shrink: 0; }
.mic-btn { width: 32px; height: 32px; border-radius: 50%; background: var(--bg-3);
  border: 1px solid var(--border); display: flex; align-items: center;
  justify-content: center; transition: all .2s; color: var(--fg-2); }
.mic-btn:hover { background: var(--bg-4); color: var(--fg); }
.recording-pill { display: flex; align-items: center; gap: 7px; padding: 6px 10px 6px 12px;
  background: rgba(239,68,68,.12); border: 1px solid rgba(239,68,68,.3); border-radius: 8px;
  margin-bottom: 6px; font-size: 12px; color: var(--fg); }
.rec-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red, #ef4444);
  animation: mic-pulse 1s infinite; flex-shrink: 0; }
.rec-label { flex: 1; color: var(--fg-2); }
.rec-stop { background: rgba(239,68,68,.2); border: 1px solid rgba(239,68,68,.4);
  border-radius: 5px; padding: 2px 8px; font-size: 11px; color: var(--red, #ef4444);
  cursor: pointer; font-weight: 600; }
.rec-stop:hover { background: rgba(239,68,68,.35); }

.mic-btn.listening { background: var(--red); border-color: var(--red); color: #fff;
  animation: mic-pulse 1s infinite; }
.mic-btn.speaking { background: var(--blue); border-color: var(--blue); color: #fff;
  animation: mic-speak 1.2s ease-in-out infinite; }
@keyframes mic-pulse { 0%,100%{box-shadow:0 0 0 0 rgba(239,68,68,.4)} 50%{box-shadow:0 0 0 8px rgba(239,68,68,0)} }
@keyframes mic-speak { 0%,100%{box-shadow:0 0 0 0 rgba(59,130,246,.4)} 50%{box-shadow:0 0 0 6px rgba(59,130,246,0)} }
.send-btn { width: 32px; height: 32px; border-radius: 50%; background: var(--blue);
  color: #fff; display: flex; align-items: center; justify-content: center;
  transition: opacity .15s; }
.send-btn:hover { opacity: .85; }
.send-btn:disabled { opacity: .3; cursor: not-allowed; }

/* ── Attach button ── */
.attach-btn { width: 32px; height: 32px; border-radius: 50%; background: var(--bg-3);
  border: 1px solid var(--border); display: flex; align-items: center;
  justify-content: center; color: var(--fg-2); transition: all .2s; cursor: pointer; }
.attach-btn:hover { background: var(--bg-4); color: var(--blue); border-color: var(--blue); }
.attach-preview { display: flex; align-items: center; gap: 6px; padding: 4px 8px;
  background: var(--bg-3); border: 1px solid var(--border); border-radius: 6px;
  margin-bottom: 6px; font-size: 12px; color: var(--fg-2); }
.attach-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 200px; }
.attach-clear { background: none; border: none; color: var(--fg-3); cursor: pointer;
  font-size: 11px; padding: 0 2px; line-height: 1; }
.attach-clear:hover { color: var(--red); }

/* ── Campaign Brief Card ── */
.brief-card-wrap { padding: 0 0 4px 0; }
.brief-card { background: var(--bg-2); border: 1px solid var(--border); border-radius: 12px;
  overflow: hidden; font-size: 13px; }
.brief-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px;
  border-bottom: 1px solid var(--border); }
.brief-head-icon { font-size: 16px; }
.brief-head-text { flex: 1; }
.brief-title { font-weight: 600; font-size: 13px; color: var(--fg); }
.brief-subtitle { font-size: 11px; color: var(--fg-3); margin-top: 1px; }
.brief-close { background: none; border: none; color: var(--fg-3); cursor: pointer;
  font-size: 16px; line-height: 1; padding: 0; }
.brief-close:hover { color: var(--fg); }
.brief-body { padding: 12px 14px; }
.brief-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; margin-bottom: 12px; }
.brief-field { display: flex; flex-direction: column; gap: 2px; }
.brief-field-label { font-size: 10px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--fg-3); font-weight: 600; }
.brief-field-val { font-size: 12px; color: var(--fg); }
.brief-field-val.missing { color: var(--amber, #f59e0b); font-style: italic; }
.brief-lists { margin-bottom: 10px; }
.brief-list-label { font-size: 10px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--fg-3); font-weight: 600; margin-bottom: 4px; }
.brief-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.brief-tag { padding: 2px 7px; border-radius: 4px; font-size: 11px; background: var(--bg-3);
  border: 1px solid var(--border); color: var(--fg-2); }
.brief-tag.negative { background: rgba(239,68,68,.08); border-color: rgba(239,68,68,.2);
  color: var(--red, #ef4444); }
.brief-missing { padding: 8px 10px; border-radius: 8px; background: rgba(245,158,11,.08);
  border: 1px solid rgba(245,158,11,.2); margin-bottom: 10px; font-size: 12px; color: var(--fg-2); }
.brief-missing strong { color: var(--amber, #f59e0b); }
/* Handoff timer bar */
.brief-handoff { margin-top: 10px; }
.brief-handoff-bar { display: flex; align-items: center; gap: 8px; padding: 8px 10px;
  border-radius: 8px; background: var(--bg-3); border: 1px solid var(--border); }
.brief-start-btn { flex: 1; padding: 7px 10px; border-radius: 6px; background: var(--blue);
  color: #fff; border: none; cursor: pointer; font-size: 12px; font-weight: 600;
  transition: opacity .15s; }
.brief-start-btn:hover { opacity: .85; }
.brief-start-btn:disabled { opacity: .5; cursor: not-allowed; }
.brief-stay-btn { padding: 7px 10px; border-radius: 6px; background: var(--bg-4);
  color: var(--fg-2); border: 1px solid var(--border); cursor: pointer; font-size: 12px; }
.brief-stay-btn:hover { color: var(--fg); }
.brief-timer { font-size: 11px; color: var(--fg-3); white-space: nowrap; min-width: 30px; text-align: right; }
.brief-timer-bar { height: 3px; border-radius: 2px; background: var(--border); margin-top: 6px; overflow: hidden; }
.brief-timer-fill { height: 100%; background: var(--blue); transition: width .9s linear; }
/* Free plan upgrade prompt */
.brief-upgrade { display: flex; align-items: center; gap: 8px; padding: 8px 10px;
  border-radius: 8px; background: rgba(99,102,241,.08); border: 1px solid rgba(99,102,241,.2);
  margin-top: 10px; font-size: 12px; }
.brief-upgrade-text { flex: 1; color: var(--fg-2); }
.brief-upgrade-btn { padding: 5px 10px; border-radius: 5px; background: var(--blue);
  color: #fff; border: none; cursor: pointer; font-size: 11px; font-weight: 600; }

/* ── RSA Clarify Card ── */
.rsa-clarify-wrap { padding: 0 0 4px 0; }
.rsa-clarify { background: var(--bg-2); border: 1px solid var(--border); border-radius: 12px;
  overflow: hidden; font-size: 13px; }
.rsa-clarify-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px;
  border-bottom: 1px solid var(--border); font-weight: 600; }
.rsa-clarify-body { padding: 12px 14px; }
.rsa-clarify-q { color: var(--fg-2); margin-bottom: 10px; line-height: 1.5; }
.rsa-clarify-options { display: flex; flex-direction: column; gap: 6px; }
.rsa-clarify-opt { padding: 8px 12px; border-radius: 7px; background: var(--bg-3);
  border: 1px solid var(--border); cursor: pointer; font-size: 12px; color: var(--fg);
  transition: all .15s; text-align: left; }
.rsa-clarify-opt:hover { border-color: var(--blue); background: rgba(59,130,246,.06); }
.rsa-camp-select { width: 100%; padding: 7px 10px; border-radius: 6px; background: var(--bg-3);
  border: 1px solid var(--border); color: var(--fg); font-size: 12px; margin-top: 8px; }
.rsa-clarify-go { margin-top: 8px; padding: 7px 16px; border-radius: 6px; background: var(--blue);
  color: #fff; border: none; cursor: pointer; font-size: 12px; font-weight: 600; }

/* ── Right Rail ── */
.rail { width: 246px; flex-shrink: 0; background: var(--bg-1);
  border-left: 1px solid var(--border); display: flex; flex-direction: column;
  overflow-y: auto; overflow-x: hidden; }
.rail::-webkit-scrollbar { width: 2px; }
.rail::-webkit-scrollbar-thumb { background: var(--bg-5); }
.rail-section { padding: 12px 12px 9px; border-bottom: 1px solid var(--border); }
.rail-section:last-child { border-bottom: none; }
.rs-title { font-size: 10px; font-weight: 700; color: var(--fg-3);
  text-transform: uppercase; letter-spacing: .07em; margin-bottom: 8px;
  display: flex; align-items: center; justify-content: space-between; }
.rs-link { color: var(--blue); text-transform: none; letter-spacing: 0;
  font-weight: 500; font-size: 11px; cursor: pointer; }

/* Health ring */
.health-ring-wrap { display: flex; align-items: center; gap: 11px; margin-bottom: 8px; }
.health-loading, .rail-loading { font-size: 11px; color: var(--fg-3); padding: 6px 0; }
.kpi-row { display: flex; justify-content: space-between; padding: 5px 0;
  border-bottom: 1px solid var(--border); }
.kpi-row:last-child { border-bottom: none; }
.kpi-n { font-size: 11px; color: var(--fg-2); }
.kpi-v { font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.up { color: var(--green); } .down { color: var(--red); } .neutral { color: var(--fg-3); }

/* Campaign rows in rail */
.camp-r { padding: 8px 0; border-bottom: 1px solid var(--border); cursor: pointer; }
.camp-r:last-child { border-bottom: none; }
.camp-r:hover .crn { color: var(--blue); }
.crh { display: flex; align-items: center; gap: 5px; justify-content: space-between; margin-bottom: 3px; }
.crn { font-size: 11px; font-weight: 700; transition: color .15s; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crs { font-size: 11px; font-weight: 600; flex-shrink: 0; }
.crm { font-size: 10px; color: var(--fg-3); display: flex; gap: 6px; flex-wrap: wrap; }
.camp-r-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.camp-r-dot.enabled { background: #22c55e; }
.camp-r-dot.paused  { background: var(--fg-3); }

/* Voice commands in rail */
.voice-cmd-list { display: flex; flex-direction: column; gap: 5px; }
.voice-cmd { font-size: 11px; color: var(--fg-2); background: var(--bg-3);
  padding: 6px 9px; border-radius: var(--r-sm); cursor: pointer;
  transition: all .15s; font-style: italic; }
.voice-cmd:hover { background: var(--bg-4); color: var(--fg); }

/* ── Voice Overlay ── */
.voice-overlay { position: fixed; inset: 0; background: rgba(8,8,11,.82);
  backdrop-filter: blur(6px); z-index: 150; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 14px; }
.vo-orb { width: 86px; height: 86px; border-radius: 50%;
  background: radial-gradient(circle,rgba(239,68,68,.4),rgba(239,68,68,.1));
  border: 2px solid rgba(239,68,68,.5);
  display: flex; align-items: center; justify-content: center; position: relative;
  animation: orb-breathe 1.2s ease-in-out infinite; }
@keyframes orb-breathe { 0%,100%{transform:scale(1)} 50%{transform:scale(1.06)} }
.vo-ring { position: absolute; inset: -14px; border-radius: 50%;
  border: 1px solid rgba(239,68,68,.2); animation: ring-out 1.5s linear infinite; }
@keyframes ring-out { 0%{transform:scale(.8);opacity:.8} 100%{transform:scale(1.3);opacity:0} }
.vo-waves { display: flex; align-items: center; gap: 3px; height: 24px; }
.vo-waves span { display: block; width: 3px; background: var(--red);
  border-radius: 2px; animation: wave-bar .6s ease-in-out infinite; }
.vo-waves span:nth-child(1){height:6px;animation-delay:0s}
.vo-waves span:nth-child(2){height:14px;animation-delay:.08s}
.vo-waves span:nth-child(3){height:10px;animation-delay:.16s}
.vo-waves span:nth-child(4){height:20px;animation-delay:.24s}
.vo-waves span:nth-child(5){height:12px;animation-delay:.32s}
.vo-waves span:nth-child(6){height:8px;animation-delay:.12s}
.vo-waves span:nth-child(7){height:16px;animation-delay:.2s}
.vo-waves span:nth-child(8){height:6px;animation-delay:.04s}
@keyframes wave-bar { 0%,100%{transform:scaleY(1);opacity:.6} 50%{transform:scaleY(1.7);opacity:1} }
.vo-title { font-size: 17px; font-weight: 700; }
.vo-transcript { font-size: 13px; color: var(--fg-2); font-style: italic; min-height: 20px; }
.vo-suggestions { display: flex; flex-direction: column; gap: 6px; width: 320px; }
.vo-sug { background: var(--bg-3); border: 1px solid var(--border-2);
  border-radius: var(--r-md); padding: 9px 13px; font-size: 12px; color: var(--fg-2);
  cursor: pointer; transition: all .15s; text-align: left; }
.vo-sug:hover { background: var(--bg-4); border-color: var(--blue-m); color: var(--fg); }
.vo-cancel { font-size: 12px; color: var(--fg-3); cursor: pointer; padding: 8px; }
.vo-cancel:hover { color: var(--fg-2); }

/* ── Tooltip ── */
.tooltip-popup { position: fixed; background: var(--bg-3); border: 1px solid var(--border-3);
  border-radius: var(--r-md); padding: 12px 14px; max-width: 260px;
  font-size: 12px; line-height: 1.55; z-index: 200; pointer-events: none;
  box-shadow: 0 8px 32px rgba(0,0,0,.7); }
.tooltip-popup h4 { font-size: 10px; font-weight: 700; color: var(--blue);
  text-transform: uppercase; letter-spacing: .05em; margin-bottom: 5px; }

/* ── Modal ── */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.6);
  display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal { background: var(--bg-2); border: 1px solid var(--border-2);
  border-radius: var(--r-xl); padding: 20px; min-width: 280px; max-width: 380px; width: 90%; }
.modal-head { font-size: 14px; font-weight: 700; margin-bottom: 14px; }
.acct-option { display: flex; flex-direction: column; align-items: flex-start;
  width: 100%; padding: 10px 12px; border-radius: var(--r-md);
  border: 1px solid var(--border); margin-bottom: 6px; background: var(--bg-3);
  transition: all .15s; cursor: pointer; font-size: 13px; }
.acct-option:hover { background: var(--bg-4); border-color: var(--border-2); }
.acct-option.active { border-color: var(--blue); background: var(--blue-d); }
.acct-option span { font-size: 11px; color: var(--fg-3); margin-top: 2px; }
.modal-close { width: 100%; padding: 9px; border-radius: var(--r-md);
  background: var(--bg-4); color: var(--fg-2); font-size: 13px;
  margin-top: 6px; transition: background .15s; }
.modal-close:hover { background: var(--bg-5); }

/* Account switcher */
.acct-section-label { font-size: 10px; font-weight: 700; color: var(--fg-3);
  text-transform: uppercase; letter-spacing: .07em;
  padding: 10px 4px 5px; }
.acct-mcc-row { border: 1px solid var(--border); border-radius: var(--r-md);
  margin-bottom: 7px; overflow: hidden; }
.acct-mcc-head { display: flex; align-items: center; gap: 7px; padding: 9px 11px;
  background: var(--bg-3); cursor: pointer; transition: background .15s; }
.acct-mcc-head:hover { background: var(--bg-4); }
.acct-mcc-chevron { color: var(--fg-3); flex-shrink: 0; transition: transform .2s; }
.acct-mcc-name { font-size: 12px; font-weight: 700; flex: 1;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--fg); }
.acct-mcc-children { padding: 4px 0; }
.acct-mcc-children.collapsed { display: none; }
.acct-child-empty { font-size: 11px; color: var(--fg-3); padding: 8px 14px; }
.acct-child-empty a { color: var(--blue); cursor: pointer; }
.acct-expand-btn { margin-left: auto; font-size: 13px; color: var(--fg-3);
  padding: 2px 5px; border-radius: var(--r-sm); transition: all .15s; }
.acct-expand-btn:hover { color: var(--blue); background: var(--blue-d); }
.acct-client-row { display: flex; flex-direction: column; align-items: flex-start;
  width: 100%; padding: 8px 11px; border-radius: 0; border: none;
  border-bottom: 1px solid var(--border); background: none;
  cursor: pointer; transition: background .15s; text-align: left; }
.acct-client-row:last-child { border-bottom: none; }
.acct-client-row:hover { background: var(--bg-3); }
.acct-client-row.active { background: var(--blue-d); }
.acct-client-row.is-child { padding-left: 26px; }
.acct-client-name { font-size: 12px; font-weight: 600; margin-bottom: 3px; color: var(--fg); }
.acct-client-meta { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.acct-id-badge { font-size: 10px; color: var(--fg-3); font-variant-numeric: tabular-nums; }
.acct-status-badge { font-size: 9px; font-weight: 700; padding: 1px 6px;
  border-radius: var(--r-full); text-transform: uppercase; }
.acct-status-badge.cancelled { background: var(--red-d); color: var(--red);
  border: 1px solid rgba(239,68,68,.2); }
.acct-status-badge.active { background: var(--blue-d); color: var(--blue);
  border: 1px solid var(--blue-m); }
.acct-cancelled { opacity: .55; }
.acct-cancelled:hover { opacity: .8; }

/* ═══ OPERATE PAGE ════════════════════════════════════════════════ */
.operate-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.operate-body { flex: 1; overflow-y: auto; padding: 20px 18px; }
.operate-body::-webkit-scrollbar { width: 3px; }
.operate-body::-webkit-scrollbar-thumb { background: var(--bg-5); }

/* Operate home grid */
.op-home { max-width: 640px; }
.op-home-title { font-size: 20px; font-weight: 700; letter-spacing: -.02em;
  margin-bottom: 20px; color: var(--fg); }
.op-home-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.op-home-card { background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--r-xl); padding: 20px; cursor: pointer;
  transition: border-color .15s, background .15s; }
.op-home-card:hover { border-color: var(--blue); background: var(--bg-3); }
.op-home-icon { width: 36px; height: 36px; border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; margin-bottom: 10px; }
.op-home-label { font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.op-home-desc { font-size: 12px; color: var(--fg-2); line-height: 1.5; }

/* Back button inside task panels */
.op-back-btn { background: none; border: none; color: var(--fg-2);
  font-size: 12px; font-weight: 600; cursor: pointer; padding: 0 0 14px 0;
  display: flex; align-items: center; gap: 4px; transition: color .15s; }
.op-back-btn:hover { color: var(--fg); }

.op-task { background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--r-xl); padding: 20px; max-width: 640px; }
.op-task-header { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 20px; }
.op-task-icon { width: 40px; height: 40px; border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center; font-size: 18px;
  flex-shrink: 0; }
.op-task-icon.blue { background: var(--blue-d); }
.op-task-icon.amber { background: var(--amber-d); }
.op-task-icon.purple { background: var(--purple-d); }
.op-task-icon.green { background: var(--green-d); }
.op-task-title { font-size: 16px; font-weight: 700; letter-spacing: -.015em;
  margin-bottom: 3px; }
.op-task-sub { font-size: 13px; color: var(--fg-2); line-height: 1.5; }

/* Wizard */
.wizard { display: flex; flex-direction: column; gap: 0; }
.wz-step { border: 1px solid var(--border); border-radius: var(--r-lg);
  overflow: hidden; margin-bottom: 10px; transition: all .2s; }
.wz-step.active { border-color: var(--border-2); }
.wz-step-head { display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-bottom: 1px solid var(--border); }
.wz-num { width: 22px; height: 22px; border-radius: 50%; background: var(--blue);
  color: #fff; font-size: 11px; font-weight: 700; display: flex;
  align-items: center; justify-content: center; flex-shrink: 0; }
.wz-step-title { font-size: 13px; font-weight: 600; }
.wz-step-body { padding: 14px 16px; }
.wz-input { width: 100%; background: var(--bg-3); border: 1px solid var(--border-2);
  border-radius: var(--r-md); padding: 9px 12px; font-size: 13px;
  color: var(--fg); resize: none; line-height: 1.5; transition: border-color .15s; }
.wz-input:focus { border-color: var(--blue); outline: none; }
.wz-hint { font-size: 11px; color: var(--fg-3); margin-top: 7px; line-height: 1.5; }
.wz-step-foot { padding: 10px 16px; border-top: 1px solid var(--border);
  display: flex; gap: 8px; }
.btn-wz-next { background: var(--blue); color: #fff; font-weight: 600;
  padding: 8px 18px; border-radius: var(--r-md); font-size: 13px;
  transition: opacity .15s; }
.btn-wz-next:hover { opacity: .85; }
.btn-wz-back { background: var(--bg-4); color: var(--fg-2); font-weight: 500;
  padding: 8px 14px; border-radius: var(--r-md); font-size: 13px;
  transition: background .15s; }
.btn-wz-back:hover { background: var(--bg-5); }

/* Budget options */
.budget-options { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 4px; }
.budget-opt { background: var(--bg-3); border: 1px solid var(--border-2);
  border-radius: var(--r-md); padding: 10px 8px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; transition: all .15s; }
.budget-opt input { display: none; }
.budget-opt:has(input:checked) { background: var(--blue-d); border-color: var(--blue); }
.budget-opt span { font-size: 14px; font-weight: 700; margin-bottom: 3px; }
.budget-opt small { font-size: 10px; color: var(--fg-3); }

/* Generating */
.wz-generating { padding: 28px; text-align: center; }
.gen-spinner { width: 36px; height: 36px; border: 3px solid var(--bg-4);
  border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite;
  margin: 0 auto 14px; }
.gen-title { font-size: 15px; font-weight: 600; margin-bottom: 18px; }
.gen-steps { display: flex; flex-direction: column; gap: 8px; text-align: left;
  max-width: 280px; margin: 0 auto; }
.gen-step { font-size: 12px; color: var(--fg-3); padding: 7px 12px;
  border-radius: var(--r-sm); border: 1px solid var(--border); }
.gen-step.active { background: var(--blue-d); border-color: var(--blue-m);
  color: var(--blue); }
.gen-step.done { background: var(--green-d); border-color: rgba(34,197,94,.2);
  color: var(--green); }

/* Proposal card */
.proposal-card { border: 1px solid var(--border-2); border-radius: var(--r-lg);
  overflow: hidden; margin-top: 4px; }
.pc-head { padding: 13px 15px; border-bottom: 1px solid var(--border);
  display: flex; gap: 11px; align-items: flex-start; }
.pc-ico { width: 32px; height: 32px; border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center; font-size: 15px; flex-shrink: 0; }
.pc-title { font-weight: 700; font-size: 13px; margin-bottom: 3px; }
.pc-desc { font-size: 12px; color: var(--fg-2); line-height: 1.5; }
.pc-body { padding: 14px 15px; }
.pc-impact { display: flex; gap: 10px; margin-bottom: 12px; }
.pc-impact-i { flex: 1; background: var(--bg-2); border-radius: var(--r-sm); padding: 9px; }
.pc-impact-i .il { font-size: 10px; color: var(--fg-3); margin-bottom: 3px; }
.pc-impact-i .iv { font-size: 14px; font-weight: 700; }
.pc-foot { padding: 10px 15px; border-top: 1px solid var(--border); display: flex; gap: 7px; }
.btn-approve { background: var(--green); color: #000; font-weight: 700;
  padding: 8px 16px; border-radius: var(--r-md); font-size: 12px;
  transition: opacity .15s; }
.btn-approve:hover { opacity: .85; }
.op-action-btn { font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 5px;
  cursor: pointer; border: none; transition: opacity .15s; }
.op-action-btn:hover { opacity: .8; }
.op-action-btn:disabled { opacity: .5; cursor: default; }
.op-action-btn.red { background: var(--red); color: #fff; }
.op-action-btn.green { background: var(--green); color: #000; }
.op-action-btn.blue { background: var(--blue); color: #fff; }
.op-action-btn.amber { background: var(--amber); color: #000; }
.proposal-card.approved { border-color: var(--green); }
.proposal-card.approved .pc-foot { display: none; }
.proposal-card.approved::after { content: '✓ Approved & queued for Google Ads sync';
  display: block; padding: 9px 15px; font-size: 11px; font-weight: 700;
  color: var(--green); background: var(--green-d); }

/* Operate explainer */
.operate-explainer { display: flex; flex-direction: column; gap: 10px; }
.oe-step { display: flex; align-items: flex-start; gap: 9px; font-size: 12px;
  color: var(--fg-2); line-height: 1.5; }
.oe-num { width: 20px; height: 20px; border-radius: 50%; background: var(--blue-d);
  border: 1px solid var(--blue-m); color: var(--blue); font-size: 10px;
  font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

/* Glossary */
.glossary-list { display: flex; flex-direction: column; gap: 4px; }
.gloss-item { font-size: 11px; color: var(--fg-2); padding: 6px 8px;
  background: var(--bg-3); border-radius: var(--r-sm); cursor: pointer;
  transition: all .15s; line-height: 1.4; }
.gloss-item:hover { background: var(--bg-4); color: var(--fg); }
.gloss-item strong { font-weight: 600; color: var(--fg); }

/* Task list (operate sidebar) */
.task-list { padding: 2px 0; }
.task-item { display: flex; align-items: center; gap: 8px; padding: 6px 10px;
  border-radius: var(--r-sm); margin: 1px 6px; font-size: 12px; font-weight: 500;
  cursor: pointer; color: var(--fg-2); transition: all .15s; }
.task-item:hover { background: var(--bg-3); color: var(--fg); }
.task-item.active { background: var(--blue-d); color: var(--blue); }
.task-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.task-dot.blue { background: var(--blue); }
.task-dot.amber { background: var(--amber); }
.task-dot.purple { background: var(--purple); }
.task-dot.green { background: var(--green); }

/* Fields */
.field-label { display: block; font-size: 11px; font-weight: 600;
  color: var(--fg-2); text-transform: uppercase; letter-spacing: .05em;
  margin-bottom: 7px; margin-top: 14px; }
.field-label:first-child { margin-top: 0; }
.field-select { width: 100%; background: var(--bg-3); border: 1px solid var(--border-2);
  border-radius: var(--r-md); padding: 9px 12px; font-size: 13px;
  color: var(--fg); transition: border-color .15s; appearance: none; cursor: pointer; }
.field-select:focus { border-color: var(--blue); outline: none; }
.field-textarea { width: 100%; background: var(--bg-3); border: 1px solid var(--border-2);
  border-radius: var(--r-md); padding: 9px 12px; font-size: 13px;
  color: var(--fg); resize: none; line-height: 1.5; transition: border-color .15s; }
.field-textarea:focus { border-color: var(--blue); outline: none; }
.field-input { width: 100%; background: var(--bg-3); border: 1px solid var(--border-2);
  border-radius: var(--r-md); padding: 9px 12px; font-size: 13px;
  color: var(--fg); transition: border-color .15s; box-sizing: border-box; }
.field-input:focus { border-color: var(--blue); outline: none; }
.field-hint { font-weight: 400; text-transform: none; letter-spacing: 0;
  color: var(--fg-4); font-size: 11px; }
.btn-secondary-sm { background: var(--bg-3); color: var(--fg-1); font-weight: 500;
  padding: 7px 14px; border-radius: var(--r); border: 1px solid var(--border-2); font-size: 13px; cursor: pointer; }
.btn-secondary-sm:hover { background: var(--bg-4); }
.btn-primary-sm { background: var(--blue); color: #fff; font-weight: 600;
  padding: 8px 18px; border-radius: var(--r-md); font-size: 13px;
  transition: opacity .15s; margin-top: 12px; }
.btn-primary-sm:hover { opacity: .85; }

/* Budget rows */
.campaign-budget-list { display: flex; flex-direction: column; gap: 8px; }
.budget-row { display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; background: var(--bg-3); border-radius: var(--r-md);
  border: 1px solid var(--border); }
.budget-camp-name { flex: 1; font-size: 13px; font-weight: 500; }
.budget-controls { display: flex; align-items: center; gap: 5px; }
.budget-input { width: 70px; background: var(--bg-4); border: 1px solid var(--border-2);
  border-radius: var(--r-sm); padding: 5px 8px; font-size: 13px;
  font-variant-numeric: tabular-nums; text-align: right; }
.budget-unit { font-size: 11px; color: var(--fg-3); }

.empty-state { font-size: 12px; color: var(--fg-3); padding: 16px; text-align: center; }
.campaign-select-wrap { display: flex; flex-direction: column; gap: 0; }
.rsa-form { display: flex; flex-direction: column; gap: 0; }
.field-row { margin-bottom: 12px; }
.audit-result { margin-top: 16px; }

/* Ad preview */
.ad-preview { background: #fff; border-radius: var(--r-md); padding: 14px;
  color: #202124; font-family: Arial, sans-serif; font-size: 13px; }
.ap-ad { font-size: 10px; color: #006621; border: 1px solid #006621;
  padding: 0 3px; border-radius: 2px; display: inline-block; margin-bottom: 6px; }
.ap-url { font-size: 13px; color: #006621; margin-bottom: 3px; }
.ap-hl { font-size: 18px; color: #1a0dab; line-height: 1.3; margin-bottom: 4px; }
.ap-body { font-size: 13px; color: #3c4043; line-height: 1.5; }
.ap-ext { margin-top: 8px; padding-top: 7px; border-top: 1px solid #e8eaed;
  display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; }
.ap-ext span { color: #1a0dab; }

/* Keyword pills */
.kw-wrap { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0; }
.kw { padding: 3px 9px; border-radius: var(--r-full); font-size: 11px;
  font-weight: 500; border: 1px solid var(--border); }
.kw.broad { background: var(--bg-4); color: var(--fg-2); }
.kw.phrase { background: var(--blue-d); color: var(--blue); border-color: var(--blue-m); }
.kw.exact { background: var(--green-d); color: var(--green); border-color: rgba(34,197,94,.2); }
.kw.neg { background: var(--red-d); color: var(--red); border-color: rgba(239,68,68,.2); }

/* Alert Strip */
/* Alert strip — proactive morning briefing */
.alert-strip {
  border-bottom: 1px solid var(--bg-4);
  background: var(--bg-2);
  flex-shrink: 0;
  padding: 10px 16px 12px;
}
.alert-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.alert-header-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.alert-header-dot.danger  { background: var(--red); box-shadow: 0 0 6px var(--red); }
.alert-header-dot.warning { background: #f59e0b;    box-shadow: 0 0 6px #f59e0b44; }
.alert-header-title { font-size: 12px; font-weight: 700; color: var(--fg-2); }
.alert-dismiss {
  margin-left: auto;
  background: none; border: none;
  color: var(--fg-3); font-size: 13px;
  cursor: pointer; padding: 2px 4px;
}
.alert-dismiss:hover { color: var(--fg); }

.alert-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.alert-card {
  border-radius: 8px;
  padding: 10px 12px;
  border-left: 3px solid transparent;
}
.alert-card-danger  { background: #3f1212; border-left-color: var(--red); }
.alert-card-warning { background: #2d2308; border-left-color: #f59e0b; }
.alert-card-top {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 4px;
}
.alert-card-icon  { font-size: 13px; }
.alert-card-title { font-size: 13px; font-weight: 700; color: var(--fg-1); }
.alert-card-body  { font-size: 12px; color: var(--fg-2); line-height: 1.5; margin-bottom: 8px; }
.alert-card-action {
  background: var(--bg-4);
  border: 1px solid var(--bg-5, var(--bg-4));
  color: var(--fg-1);
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.alert-card-action:hover { background: var(--blue); color: #fff; border-color: var(--blue); }

.alert-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; border-radius: 50%; background: var(--red);
  color: #fff; font-size: 9px; font-weight: 700; margin-left: 6px;
}

/* Bell button in topbar */
.alert-bell {
  position: relative;
  background: none; border: none; cursor: pointer;
  font-size: 16px; padding: 4px 6px; border-radius: 6px;
  color: var(--fg-2); line-height: 1;
  transition: background .15s;
}
.alert-bell:hover { background: var(--bg-3); }
.alert-bell-badge {
  position: absolute; top: 0; right: 0;
  background: var(--red); color: #fff;
  font-size: 9px; font-weight: 700;
  min-width: 14px; height: 14px;
  border-radius: 7px; padding: 0 3px;
  display: flex; align-items: center; justify-content: center;
  transform: translate(3px,-3px);
  line-height: 1;
}

/* Alert card in chat (injected via openAlerts) */
.alert-chat-card {
  background: var(--bg-2);
  border: 1px solid var(--bg-4);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 4px;
}
.alert-chat-row {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 10px 0; border-bottom: 1px solid var(--bg-3);
}
.alert-chat-row:last-child { border-bottom: none; padding-bottom: 0; }
.alert-chat-sev { font-size: 15px; flex-shrink: 0; margin-top: 1px; }
.alert-chat-body { flex: 1; min-width: 0; }
.alert-chat-headline { font-size: 13px; font-weight: 700; color: var(--fg-1); margin-bottom: 3px; }
.alert-chat-detail { font-size: 12px; color: var(--fg-2); line-height: 1.5; margin-bottom: 8px; }
.alert-chat-apply {
  background: var(--blue,.6); border: 1px solid var(--blue);
  color: #fff; border-radius: 6px; padding: 4px 12px;
  font-size: 12px; font-weight: 600; cursor: pointer; font-family: inherit;
}
.alert-chat-apply:hover { opacity: .85; }
.alert-chat-apply:disabled { opacity: .5; cursor: not-allowed; }

/* Negative Keywords */
.neg-controls { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 20px; }
.neg-loading { display: flex; flex-direction: column; align-items: center; padding: 60px 0; }
.neg-result { display: flex; flex-direction: column; gap: 14px; }
.neg-summary { font-size: 13px; color: var(--fg-2); background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--r); padding: 10px 14px; }
.neg-table-wrap { overflow-x: auto; }
.neg-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.neg-table th { padding: 7px 10px; text-align: left; font-weight: 600; color: var(--fg-2);
  background: var(--bg-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.neg-table td { padding: 7px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.neg-table tr:hover td { background: var(--bg-2); }
.neg-row-dim td { opacity: .55; }
.neg-term { max-width: 240px; word-break: break-word; }
.neg-meta { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--fg-2); }
.neg-num { text-align: right; color: var(--fg-2); }
.neg-reason { max-width: 220px; font-size: 11px; color: var(--fg-3); }
.neg-match { padding: 2px 7px; border-radius: var(--r-full); font-size: 10px; font-weight: 600; text-transform: uppercase; }
.neg-match.exact { background: var(--green-d); color: var(--green); }
.neg-match.phrase { background: var(--blue-d); color: var(--blue); }
.neg-level { font-size: 10px; font-weight: 600; color: var(--fg-3); }
.neg-badge { display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: var(--r-full);
  font-size: 10px; font-weight: 600; }
.neg-badge.exists { background: var(--bg-4); color: var(--fg-3); }
.neg-badge.error { background: var(--red-d); color: var(--red); }
.neg-actions { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); }
.neg-sel-count { font-size: 12px; color: var(--fg-2); flex: 1; }
.btn-danger { padding: 7px 16px; border-radius: var(--r); background: var(--red); color: #fff;
  border: none; font-size: 13px; font-weight: 600; cursor: pointer; }
.btn-danger:hover { opacity: .85; }
.btn-danger:disabled { opacity: .4; cursor: default; }
.op-home-icon.red { background: rgba(239,68,68,.12); }
.task-dot.red { background: var(--red); }

/* ── Negative Keyword Wizard ────────────────────────────────── */
.neg-mode-tabs { display: flex; gap: 6px; margin-bottom: 20px; border-bottom: 1px solid var(--border); padding-bottom: 0; }
.neg-mode-tab { padding: 8px 16px; border: none; background: none; font-size: 13px; font-weight: 500;
  color: var(--fg-2); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; border-radius: 0; }
.neg-mode-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.neg-mode-tab:hover:not(.active) { color: var(--fg-1); }
.neg-wizard-step { padding: 4px 0 12px; }
.neg-step-label { font-size: 13px; color: var(--fg-2); margin-bottom: 14px; }
.neg-step-label strong { color: var(--fg-1); }
.neg-step-input-row { display: flex; gap: 8px; align-items: center; }
.neg-step-input-row .field-input { flex: 1; }
.neg-kw-hint { margin-top: 8px; font-size: 12px; color: var(--fg-3); min-height: 16px; }
.neg-scope-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
@media (max-width: 600px) { .neg-scope-options { grid-template-columns: 1fr; } }
.neg-scope-card { padding: 14px; border: 1.5px solid var(--border); border-radius: var(--r);
  cursor: pointer; transition: border-color .15s, background .15s; }
.neg-scope-card:hover { border-color: var(--accent); background: var(--bg-2); }
.neg-scope-card.selected { border-color: var(--accent); background: rgba(99,102,241,.08); }
.neg-scope-icon { font-size: 18px; margin-bottom: 4px; }
.neg-scope-title { font-size: 13px; font-weight: 600; color: var(--fg-1); margin-bottom: 3px; }
.neg-scope-desc { font-size: 11px; color: var(--fg-3); line-height: 1.4; }
.neg-entity-picker { margin-bottom: 14px; }
.neg-entity-list { display: flex; flex-direction: column; gap: 6px; max-height: 220px; overflow-y: auto;
  border: 1px solid var(--border); border-radius: var(--r); padding: 6px; background: var(--bg-1); }
.neg-entity-item { padding: 8px 10px; border-radius: var(--r); cursor: pointer; font-size: 13px;
  display: flex; align-items: center; gap: 8px; color: var(--fg-1); }
.neg-entity-item:hover { background: var(--bg-2); }
.neg-entity-item.selected { background: rgba(99,102,241,.1); color: var(--accent); font-weight: 600; }
.neg-entity-item .neg-entity-sub { font-size: 11px; color: var(--fg-3); font-weight: 400; }
.neg-step-nav { display: flex; gap: 8px; margin-top: 16px; }
.neg-match-options { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.neg-match-card { padding: 14px; border: 1.5px solid var(--border); border-radius: var(--r);
  cursor: pointer; transition: border-color .15s, background .15s; }
.neg-match-card:hover { border-color: var(--accent); background: var(--bg-2); }
.neg-match-card.selected { border-color: var(--accent); background: rgba(99,102,241,.08); }
.neg-match-top { display: flex; align-items: center; gap: 10px; margin-bottom: 5px; }
.neg-match-name { font-size: 13px; font-weight: 700; color: var(--fg-1); }
.neg-match-example { font-size: 12px; font-family: monospace; color: var(--fg-3);
  background: var(--bg-3); padding: 1px 6px; border-radius: 4px; }
.neg-match-desc { font-size: 12px; color: var(--fg-3); line-height: 1.4; }
.neg-match-suggestion { font-size: 12px; color: var(--blue); background: rgba(59,130,246,.08);
  border: 1px solid rgba(59,130,246,.2); border-radius: var(--r); padding: 8px 12px;
  margin-bottom: 14px; min-height: 0; }
.neg-match-suggestion:empty { display: none; }
.neg-done-wrap { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 30px 0; }
.neg-done-check { width: 48px; height: 48px; border-radius: 50%; background: rgba(34,197,94,.15);
  color: var(--green); font-size: 24px; display: flex; align-items: center; justify-content: center; }
.neg-done-msg { font-size: 14px; color: var(--fg-1); text-align: center; max-width: 360px; }

/* ── RSA Writer Modal ───────────────────────────────────────── */
.rsa-overlay { position:fixed; inset:0; background:rgba(0,0,0,.55); z-index:200; }
.rsa-modal { position:fixed; top:50%; left:50%; transform:translate(-50%,-50%);
  width:min(700px,96vw); max-height:90vh; overflow-y:auto;
  background:var(--bg-1); border:1px solid var(--border); border-radius:18px;
  padding:28px 28px 24px; z-index:201; display:flex; flex-direction:column; gap:18px; }
.rsa-modal-head { display:flex; align-items:flex-start; justify-content:space-between; }
.rsa-modal-title { font-size:20px; font-weight:700; color:var(--fg); }
.rsa-modal-sub { font-size:12px; color:var(--fg-3); margin-top:3px; }
.rsa-close { background:none; border:none; font-size:18px; color:var(--fg-3);
  cursor:pointer; padding:2px 6px; border-radius:6px; }
.rsa-close:hover { background:var(--bg-3); color:var(--fg); }

.rsa-policy-brief { background:var(--bg-2); border:1px solid var(--border); border-radius:12px;
  padding:14px 16px; display:flex; flex-direction:column; gap:8px; }
.rsa-policy-head { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.rsa-policy-badge { font-size:12px; font-weight:700; background:var(--bg-4);
  color:var(--fg-2); padding:3px 10px; border-radius:20px; }
.rsa-policy-risk { font-size:12px; font-weight:600; }
.risk-low { color:var(--green); }
.risk-medium { color:#f59e0b; }
.risk-high { color:#f97316; }
.risk-high-risk { color:#f97316; }
.risk-very-high { color:var(--red); }
.rsa-policy-summary { font-size:13px; color:var(--fg-2); line-height:1.5; }
.rsa-policy-disclosures { font-size:12px; color:var(--fg-3); line-height:1.6; }
.rsa-disc-item { margin-top:2px; }

.rsa-form { display:flex; flex-direction:column; gap:14px; }
.rsa-field { display:flex; flex-direction:column; gap:6px; }
.rsa-label { font-size:13px; font-weight:600; color:var(--fg-2); }
.rsa-hint { font-weight:400; color:var(--fg-3); }
.rsa-textarea { background:var(--bg-2); border:1px solid var(--border); border-radius:10px;
  padding:10px 12px; font-size:14px; color:var(--fg); resize:vertical; font-family:inherit;
  transition:border-color .15s; }
.rsa-textarea:focus { outline:none; border-color:var(--blue); }
.rsa-input { background:var(--bg-2); border:1px solid var(--border); border-radius:10px;
  padding:10px 12px; font-size:14px; color:var(--fg); font-family:inherit;
  transition:border-color .15s; }
.rsa-input:focus { outline:none; border-color:var(--blue); }
.rsa-generate-btn { padding:11px 22px; background:var(--blue); color:#fff;
  border:none; border-radius:10px; font-size:14px; font-weight:600; cursor:pointer;
  transition:opacity .15s; align-self:flex-start; }
.rsa-generate-btn:hover { opacity:.88; }
.rsa-generate-btn:disabled { opacity:.45; cursor:default; }

.rsa-results { display:flex; flex-direction:column; gap:10px;
  border-top:1px solid var(--border); padding-top:18px; }
.rsa-results-head { display:flex; align-items:center; justify-content:space-between; }
.rsa-results-title { font-size:15px; font-weight:700; color:var(--fg); }
.rsa-regenerate { background:none; border:1px solid var(--border); border-radius:8px;
  padding:5px 12px; font-size:12px; color:var(--fg-2); cursor:pointer; }
.rsa-regenerate:hover { background:var(--bg-2); }
.rsa-section-label { font-size:11px; font-weight:700; text-transform:uppercase;
  letter-spacing:.07em; color:var(--fg-3); }
.rsa-count { font-weight:400; color:var(--fg-4); }

.rsa-headlines-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:6px; margin-top:6px; }
.rsa-h-cell { background:var(--bg-2); border:1px solid var(--border); border-radius:8px;
  padding:8px 10px; font-size:12px; display:flex; flex-direction:column; gap:4px;
  position:relative; min-height:72px; }
.rsa-h-cell-top { display:flex; align-items:flex-start; gap:6px; flex:1; }
.rsa-h-cell.error { border-color:var(--red); background:rgba(239,68,68,.06); }
.rsa-h-cell.warn  { border-color:#f59e0b; background:rgba(245,158,11,.06); }
.rsa-h-icon { flex-shrink:0; font-size:10px; margin-top:1px; }
.rsa-h-text { flex:1; line-height:1.5; color:var(--fg); word-break:normal; overflow-wrap:break-word; border-radius:3px; padding:1px 3px; cursor:text; }
.rsa-h-text:focus { outline:none; background:var(--bg-3,rgba(0,0,0,.05)); box-shadow:0 0 0 1.5px #2563EB44; }
.rsa-h-cell-meta { display:flex; align-items:center; gap:4px; flex-wrap:wrap; }
.rsa-charcount { font-size:10px; color:var(--fg-4); white-space:nowrap; margin-left:auto; }
.rsa-charcount.near { color:#f59e0b; }
.rsa-charcount.over { color:var(--red); font-weight:700; }

.rsa-desc-list { display:flex; flex-direction:column; gap:6px; margin-top:6px; }
.rsa-desc-row { background:var(--bg-2); border:1px solid var(--border); border-radius:8px;
  padding:10px 12px; font-size:13px; display:flex; align-items:flex-start; gap:8px; }
.rsa-desc-row.error { border-color:var(--red); background:rgba(239,68,68,.06); }
.rsa-desc-row.warn  { border-color:#f59e0b; background:rgba(245,158,11,.06); }
.rsa-d-text { flex:1; line-height:1.5; color:var(--fg); border-radius:3px; padding:1px 3px; cursor:text; }
.rsa-d-text:focus { outline:none; background:var(--bg-3,rgba(0,0,0,.05)); box-shadow:0 0 0 1.5px #2563EB44; }

.rsa-paths-row { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-top:6px; }
.rsa-path-val { background:var(--bg-2); border:1px solid var(--border); border-radius:8px;
  padding:8px 12px; font-size:13px; color:var(--fg); margin-top:5px; }

.rsa-policy-issues { background:rgba(239,68,68,.07); border:1px solid rgba(239,68,68,.2);
  border-radius:10px; padding:12px 14px; }
.rsa-issues-title { font-size:13px; font-weight:700; color:var(--red); margin-bottom:8px; }
.rsa-issue-row { display:flex; gap:8px; font-size:12px; color:var(--fg-2);
  padding:5px 0; border-bottom:1px solid var(--border); line-height:1.4; }
.rsa-issue-row:last-child { border-bottom:none; }
.rsa-issue-row.error { color:var(--red); }

.rsa-note { font-size:12px; color:var(--fg-3); padding:4px 0; }
.rsa-actions { display:flex; gap:10px; padding-top:4px; }
.btn-rsa-copy { padding:9px 18px; background:var(--bg-3); color:var(--fg);
  border:1px solid var(--border); border-radius:8px; font-size:13px; font-weight:600;
  cursor:pointer; }
.btn-rsa-copy:hover { background:var(--bg-4); }
.btn-rsa-publish-open { padding:9px 18px; background:var(--blue); color:#fff;
  border:none; border-radius:8px; font-size:13px; font-weight:600; cursor:pointer; }
.btn-rsa-publish-open:hover { opacity:.88; }

/* Publish flow */
.rsa-publish-flow { display:flex; flex-direction:column; gap:14px;
  border-top:1px solid var(--border); padding-top:18px; }
.rsa-copy-editor { display:flex; flex-direction:column; gap:14px; }
.rsa-copy-section { display:flex; flex-direction:column; gap:6px; }
.rsa-copy-section-title { font-size:12px; font-weight:600; color:var(--fg-2); text-transform:uppercase; letter-spacing:.05em; }
.rsa-copy-hint { font-weight:400; text-transform:none; color:var(--fg-4); margin-left:6px; letter-spacing:0; }
.rsa-h-num { font-size:11px; color:var(--fg-4); min-width:18px; flex-shrink:0; }
.rsa-policy-tag { display:flex; align-items:center; gap:8px; flex-wrap:wrap;
  background:var(--bg-2); border:1px solid var(--border); border-radius:8px;
  padding:8px 12px; font-size:12px; }
.rsa-policy-risk { font-size:11px; font-weight:600; text-transform:uppercase; letter-spacing:.04em; }
.rsa-pin-badge { font-size:10px; font-weight:600; color:#2563eb; background:rgba(37,99,235,.1);
  border:1px solid rgba(37,99,235,.25); border-radius:10px; padding:2px 7px;
  white-space:nowrap; flex-shrink:0; cursor:help; }
.rsa-callout-grid { display:flex; flex-wrap:wrap; gap:8px; }
.rsa-sitelink-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(220px,1fr)); gap:10px; }
.rsa-sitelink-card { background:var(--bg-2); border:1px solid var(--border); border-radius:10px; padding:10px 12px; display:flex; flex-direction:column; gap:6px; }
.rsa-sl-row { display:flex; align-items:baseline; gap:6px; }
.rsa-sl-label { font-size:10px; font-weight:600; color:var(--fg-4); min-width:38px; flex-shrink:0; text-transform:uppercase; }
.rsa-sl-field { flex:1; outline:none; font-size:12px; color:var(--fg); border-bottom:1px solid transparent; min-width:0; }
.rsa-sl-field:focus { border-bottom-color:var(--blue); }
.rsa-sl-path { color:var(--blue); font-size:11px; }
.rsa-callout-chip { display:inline-block; background:var(--bg-3); border:1px solid var(--border-2);
  border-radius:20px; padding:5px 12px; font-size:12px; color:var(--fg); cursor:text;
  outline:none; min-width:40px; transition:border-color .15s; }
.rsa-callout-chip:focus { border-color:var(--blue); background:var(--bg-2); }
.rsa-h-text { flex:1; outline:none; min-width:0; font-size:13px; color:var(--fg); }
.rsa-h-text:focus { color:var(--fg); }
.rsa-desc-text { flex:1; outline:none; min-width:0; font-size:13px; color:var(--fg); }
.rsa-publish-head { display:flex; align-items:center; justify-content:space-between; }
.rsa-publish-title { font-size:16px; font-weight:700; color:var(--fg); }
.rsa-back-btn { background:none; border:1px solid var(--border); border-radius:8px;
  padding:5px 12px; font-size:12px; color:var(--fg-2); cursor:pointer; }
.rsa-back-btn:hover { background:var(--bg-2); }
.rsa-publish-warning { background:rgba(245,158,11,.1); border:1px solid rgba(245,158,11,.3);
  border-radius:10px; padding:12px 14px; font-size:13px; color:var(--fg-2); line-height:1.5; }
.rsa-preview-box { background:var(--bg-2); border:1px solid var(--border); border-radius:12px;
  padding:16px 18px; }
.rsa-preview-label { font-size:10px; font-weight:700; text-transform:uppercase;
  letter-spacing:.08em; color:var(--fg-4); margin-bottom:10px; }
.rsa-preview-url { font-size:13px; color:var(--green); margin-bottom:4px; }
.rsa-preview-headline { font-size:17px; font-weight:600; color:#1a73e8; line-height:1.4;
  margin-bottom:6px; }
.rsa-preview-desc { font-size:13px; color:var(--fg-2); line-height:1.5; }
.rsa-approve-check { display:flex; gap:10px; align-items:flex-start; font-size:13px;
  color:var(--fg-2); line-height:1.5; cursor:pointer;
  background:var(--bg-2); border:1px solid var(--border); border-radius:10px;
  padding:14px; }
.rsa-approve-check input[type=checkbox] { width:16px; height:16px; flex-shrink:0; margin-top:2px;
  accent-color:var(--blue); cursor:pointer; }
.btn-rsa-publish-confirm { padding:12px 24px; background:var(--blue); color:#fff;
  border:none; border-radius:10px; font-size:14px; font-weight:700; cursor:pointer;
  transition:opacity .15s; }
.btn-rsa-publish-confirm:hover:not(:disabled) { opacity:.88; }
.btn-rsa-publish-confirm:disabled { opacity:.35; cursor:default; }
.rsa-pub-success { background:rgba(34,197,94,.1); border:1px solid rgba(34,197,94,.3);
  border-radius:10px; padding:14px 16px; font-size:13px; color:var(--fg-2);
  line-height:1.6; }
.rsa-pub-resource { font-size:11px; color:var(--fg-4); word-break:break-all; }
.rsa-pub-resource-row { font-size:12px; color:var(--fg-3); margin-top:6px; }
.rsa-time-saved { display:inline-flex; align-items:center; gap:6px;
  background:rgba(34,197,94,.15); border:1px solid rgba(34,197,94,.4);
  border-radius:20px; padding:4px 12px; font-size:12px; font-weight:600;
  color:#16a34a; margin-top:8px; }
.rsa-pub-error { background:rgba(239,68,68,.1); border:1px solid rgba(239,68,68,.3);
  border-radius:10px; padding:14px 16px; font-size:13px; color:var(--red); }

/* ── Monday Report Card ─────────────────────────────────────── */
.report-card { background: var(--bg-2); border: 1px solid var(--border); border-radius: 14px;
  padding: 20px 22px; max-width: 600px; width: 100%; }
.report-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.report-badge { font-size: 12px; font-weight: 700; background: var(--blue-d); color: var(--blue);
  border-radius: 6px; padding: 3px 9px; letter-spacing: .04em; }
.report-period { font-size: 12px; color: var(--fg-3); }
.report-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.report-kpi { background: var(--bg-3); border-radius: 10px; padding: 12px 14px; }
.report-kpi-val { font-size: 20px; font-weight: 700; color: var(--fg); line-height: 1.2; }
.report-kpi-label { font-size: 11px; color: var(--fg-3); margin-top: 4px; }
.delta-up { color: var(--green); font-weight: 600; }
.delta-down { color: var(--red); font-weight: 600; }
.report-section-title { font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: var(--fg-3); margin: 14px 0 8px; }
.report-camp-list { display: flex; flex-direction: column; gap: 4px; margin-bottom: 6px; }
.report-camp-row { display: flex; align-items: center; gap: 8px; padding: 7px 10px;
  background: var(--bg-3); border-radius: 8px; font-size: 13px; }
.report-camp-row.waste { background: rgba(239,68,68,.07); }
.report-camp-name { flex: 1; color: var(--fg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.report-camp-stat { font-size: 12px; color: var(--fg-2); min-width: 48px; text-align: right; }
.report-actions { display: flex; flex-direction: column; gap: 8px; }
.report-action { display: flex; gap: 10px; align-items: flex-start; font-size: 13px;
  background: var(--bg-3); border-radius: 8px; padding: 10px 12px; line-height: 1.4; }
.report-action.warning { border-left: 3px solid var(--red); }
.report-action.opportunity { border-left: 3px solid var(--blue); }
.report-action-icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.report-empty { font-size: 13px; color: var(--fg-3); padding: 8px 0; }

/* ── Professional Report Card ────────────────────────────────────── */
.report-card-pro { background: var(--bg-2); border: 1px solid var(--border); border-radius: 16px; padding: 24px; max-width: 720px; }
.rpro-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 24px; gap: 12px; }
.rpro-title { font-size: 18px; font-weight: 700; color: var(--fg); }
.rpro-subtitle { font-size: 13px; color: var(--fg-3); margin-top: 3px; }
.rpro-export-btn { background: var(--blue); color: #fff; border: none; border-radius: 8px; padding: 8px 14px; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.rpro-export-btn:hover { opacity: .88; }
.rpro-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 24px; }
.rpro-kpi { background: var(--bg-3); border-radius: 10px; padding: 14px; }
.rpro-kpi-icon { font-size: 18px; margin-bottom: 6px; }
.rpro-kpi-val { font-size: 22px; font-weight: 700; color: var(--fg); line-height: 1.1; }
.rpro-kpi-label { font-size: 11px; color: var(--fg-3); margin-top: 4px; text-transform: uppercase; letter-spacing: .4px; }
.rpro-kpi-delta { font-size: 11px; font-weight: 600; margin-top: 6px; }
.rpro-kpi-delta.up { color: #22c55e; }
.rpro-kpi-delta.down { color: var(--red); }
.rpro-section { margin-bottom: 20px; }
.rpro-section-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--fg-3); margin-bottom: 10px; }
.rpro-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.rpro-table th { font-size: 10px; text-transform: uppercase; letter-spacing: .5px; color: var(--fg-3); padding: 6px 10px; border-bottom: 1px solid var(--border); text-align: left; }
.rpro-table td { padding: 9px 10px; border-bottom: 1px solid var(--border); color: var(--fg); }
.rpro-table tr:last-child td { border-bottom: none; }
.rpro-td-rank { color: var(--fg-3); width: 28px; }
.rpro-td-name { font-weight: 500; }
.rpro-td-num { text-align: right; font-variant-numeric: tabular-nums; }
.rpro-waste-row td { background: rgba(239,68,68,.05); }
.rpro-waste-tag { font-size: 10px; background: rgba(239,68,68,.12); color: var(--red); border-radius: 4px; padding: 1px 5px; margin-left: 6px; }
.rpro-actions { display: flex; flex-direction: column; gap: 10px; }
.rpro-action { display: flex; gap: 12px; padding: 12px 14px; border-radius: 10px; background: var(--bg-3); }
.rpro-action-warning { border-left: 3px solid var(--red); }
.rpro-action-opportunity { border-left: 3px solid var(--blue); }
.rpro-action-icon { font-size: 16px; flex-shrink: 0; }
.rpro-action-camp { font-size: 12px; font-weight: 700; color: var(--fg); margin-bottom: 2px; }
.rpro-action-text { font-size: 13px; color: var(--fg-2); line-height: 1.4; }
.rpro-empty { font-size: 13px; color: var(--fg-3); padding: 10px 0; }
.rpro-footer { font-size: 11px; color: var(--fg-3); text-align: right; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border); }

/* Responsive */
@media (max-width: 900px) { .rail { display: none; } }
@media (max-width: 520px) { .report-kpis { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) {
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; z-index: 50;
    transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .quick-grid { grid-template-columns: 1fr; }
  .budget-options { grid-template-columns: 1fr 1fr; }
}

/* ── Mascot & Brand ──────────────────────────────────────────── */

/* Greeting mascot */
.greeting-mascot {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 16px;
  animation: mascot-pop 0.5s cubic-bezier(0.34,1.56,0.64,1) both;
  box-shadow: 0 4px 24px rgba(0,0,0,0.18);
}
@keyframes mascot-pop {
  from { transform: scale(0.6) translateY(10px); opacity: 0; }
  to   { transform: scale(1) translateY(0);      opacity: 1; }
}

/* Agent bar mascot (replaces pulse dot) */
.agent-mascot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  animation: mascot-bounce 1.2s ease-in-out infinite;
}
@keyframes mascot-bounce {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-3px); }
}

/* Sidebar icon overrides */
.sb-head .sb-logo-icon {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: transparent;
}

/* Onboarding logo centering */
.ob-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.rpro-section-note { font-size: 11px; color: var(--fg-3); font-weight: 400; margin-left: 8px; }

/* ── Monday Report — Sunny Card ────────────────────────────────────────────── */
.report-sunny {
  background: #FFFCF5;
  border: 1px solid #F0EDE6;
  border-radius: 16px;
  padding: 24px;
  max-width: 720px;
  width: 100%;
  font-size: 14px;
  color: #1a1a2e;
  box-shadow: 0 2px 12px rgba(245,158,11,.08);
}
.dark .report-sunny {
  background: #1e1c14;
  border-color: #3a3626;
  color: #e8e4d8;
}
.rs-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
  gap: 12px;
}
.rs-badge {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: #F59E0B;
  background: rgba(245,158,11,.1);
  padding: 3px 10px;
  border-radius: 99px;
  display: inline-block;
  margin-bottom: 6px;
}
.rs-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
}
.rs-period {
  font-size: 12px;
  color: #888;
  margin-top: 2px;
}
.rs-header-right {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.rs-btn-chart, .rs-btn-export {
  padding: 6px 12px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
}
.rs-btn-chart {
  background: var(--bg-2, #f0f0f5);
  color: var(--fg, #1a1a2e);
}
.rs-btn-export {
  background: #0B1020;
  color: #fff;
}
.rs-kpis {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}
.rs-kpi {
  background: #fff;
  border: 1px solid #F0EDE6;
  border-radius: 10px;
  padding: 14px 14px 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.dark .rs-kpi {
  background: #252218;
  border-color: #3a3626;
}
.rs-kpi-val {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.5px;
}
.rs-kpi-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: #888;
  margin-top: 2px;
}
.rdelta-up   { font-size: 11px; font-weight: 700; color: #16a34a; margin-top: 3px; display: block; }
.rdelta-down { font-size: 11px; font-weight: 700; color: #dc2626; margin-top: 3px; display: block; }

.rs-chart-wrap { margin-bottom: 20px; }
.rs-chart-wrap.hidden { display: none; }
.rs-hourly-bars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 80px;
  padding: 0 4px;
  border-bottom: 1px solid #F0EDE6;
}
.rs-hour-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
}
.rs-hour-bar {
  width: 100%;
  background: linear-gradient(180deg, #F59E0B, #FBBF24);
  border-radius: 2px 2px 0 0;
  min-height: 2px;
  transition: height .3s ease;
}
.rs-hour-label {
  font-size: 9px;
  color: #aaa;
  margin-top: 3px;
  line-height: 1;
}
.rs-section { margin-bottom: 16px; }
.rs-section-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: #F59E0B;
  margin-bottom: 8px;
}
.rs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.rs-table th {
  background: #F8F6F0;
  color: #555;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  padding: 7px 10px;
  text-align: left;
}
.dark .rs-table th { background: #2a2618; }
.rs-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #F0EDE6;
  vertical-align: middle;
}
.dark .rs-table td { border-bottom-color: #3a3626; }
.rs-table tr:last-child td { border-bottom: none; }
.rs-table tr.rs-waste td { background: rgba(254,226,226,.25); }
.rs-tag-waste {
  background: #FEE2E2;
  color: #991b1b;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 99px;
  font-weight: 600;
  margin-left: 5px;
}
.rs-match {
  background: #EEF2FF;
  color: #3730a3;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 99px;
  font-weight: 600;
}
.rs-actions { display: flex; flex-direction: column; gap: 8px; }
.rs-action {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  background: #FFFBF0;
  border: 1px solid #F0EDE6;
}
.rs-action-warning { border-color: #FCA5A5; background: #FEF2F2; }
.rs-action-opportunity { border-color: #86EFAC; background: #F0FDF4; }
.rs-action-icon { font-size: 16px; flex-shrink: 0; }
.rs-action-body { display: flex; flex-direction: column; gap: 6px; flex: 1; }
.rs-action-text { color: var(--fg-1, #111); }
.rs-action-btn {
  align-self: flex-start;
  padding: 4px 12px;
  border-radius: 6px;
  border: none;
  background: #2563EB;
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s;
}
.rs-action-btn:hover { background: #1D4ED8; }
.rs-footer {
  font-size: 11px;
  color: #aaa;
  text-align: center;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid #F0EDE6;
}

/* Loading dots */
.report-loading { display: flex; align-items: center; min-height: 36px; }
.report-loading-dot {
  display: inline-block;
  width: 7px; height: 7px;
  background: #F59E0B;
  border-radius: 50%;
  margin: 0 2px;
  animation: rdot-bounce 1.2s ease-in-out infinite;
}
.report-loading-dot:nth-child(2) { animation-delay: .15s; }
.report-loading-dot:nth-child(3) { animation-delay: .30s; }
@keyframes rdot-bounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: .4; }
  40%           { transform: scale(1);   opacity: 1;   }
}

/* Report narrative (AI plain-English summary) */
.rs-narrative {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: #FFFBF0;
  border: 1px solid rgba(245,158,11,.25);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 18px;
}
.rs-narrative-icon img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.rs-narrative-body p {
  font-size: 13px;
  line-height: 1.65;
  color: var(--fg, #1a1a2e);
  margin-bottom: 6px;
}
.rs-narrative-body p:last-child { margin-bottom: 0; }
.dark .rs-narrative {
  background: rgba(245,158,11,.07);
  border-color: rgba(245,158,11,.2);
}
.dark .rs-action { background: #1e1e1e; border-color: #333; }
.dark .rs-action-warning { background: #2d1212; border-color: #7f1d1d; }
.dark .rs-action-opportunity { background: #0d2d1a; border-color: #166534; }
.dark .rs-action-text { color: var(--fg-1); }

/* ── Operate Chat Panel ─────────────────────────────────────────────────── */
.op-chat-panel {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 56px);
  background: var(--bg);
}
.op-chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.op-chat-welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 10px;
  padding: 48px 24px;
  margin: auto;
}
.op-chat-mascot {
  width: 56px; height: 56px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 4px 16px rgba(0,0,0,.12);
}
.op-chat-welcome-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--fg);
  margin-top: 8px;
}
.op-chat-welcome-sub {
  font-size: 13px;
  color: var(--fg-2);
  max-width: 380px;
  line-height: 1.5;
}
.op-chat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 8px;
}
.op-chip {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 500;
  color: var(--fg);
  cursor: pointer;
  font-family: inherit;
}
.op-chip:hover { background: var(--hover); }

.op-msg { display: flex; gap: 10px; align-items: flex-start; }
.op-msg-user { flex-direction: row-reverse; }
.op-av { width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0; overflow: hidden; }
.op-av-img { width: 100%; height: 100%; object-fit: cover; }
.op-bubble {
  max-width: 520px;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.6;
  background: var(--bg-2);
  color: var(--fg);
  border: 1px solid var(--border);
}
.op-msg-user .op-bubble {
  background: var(--blue);
  color: #fff;
  border-color: transparent;
}
.op-bubble-loading { display: flex; align-items: center; gap: 4px; min-height: 36px; }
.op-bubble-error { background: #fef2f2; border-color: #fca5a5; color: #991b1b; }
.op-chat-input-row {
  display: flex;
  gap: 8px;
  padding: 12px 24px 20px;
  border-top: 1px solid var(--border);
  align-items: flex-end;
}
.op-chat-input {
  flex: 1;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
  color: var(--fg);
  font-family: inherit;
  resize: none;
  max-height: 120px;
  outline: none;
}
.op-chat-input:focus { border-color: var(--blue); }
.op-chat-send {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: var(--blue);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.op-chat-send:hover { opacity: .85; }

/* ── Action confirm card (chat inline) ──────────────────────────── */
.action-card-wrap { padding: 0 0 4px 0; }
.action-card {
  background: var(--bg-2);
  border: 1px solid var(--bg-4);
  border-radius: 10px;
  padding: 14px 16px 12px;
  max-width: 460px;
  margin: 4px 0 4px 40px;
}
.ac-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.ac-icon { font-size: 16px; }
.ac-verb { font-size: 13px; font-weight: 700; }
.ac-badge {
  margin-left: auto;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--fg-3);
  background: var(--bg-3);
  padding: 2px 7px;
  border-radius: 20px;
}
.ac-desc {
  font-size: 13px;
  color: var(--fg-2);
  margin-bottom: 12px;
  line-height: 1.5;
}
.ac-foot { display: flex; gap: 8px; }
.ac-approve {
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: 7px;
  padding: 7px 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.ac-approve:hover { opacity: .88; }
.ac-approve:disabled { opacity: .5; cursor: default; }
.ac-dismiss {
  background: var(--bg-3);
  color: var(--fg-2);
  border: none;
  border-radius: 7px;
  padding: 7px 14px;
  font-size: 13px;
  cursor: pointer;
}
.ac-dismiss:hover { background: var(--bg-4); }
.ac-done {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--fg-2);
  padding: 4px 0;
}

/* ── RSA strength meter + grade badges ─────────────────────────── */
.rsa-strength {
  background: var(--bg-2);
  border: 1px solid var(--bg-4);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 4px;
}
.rsa-strength-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.rsa-strength-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--fg-3);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.rsa-strength-badge {
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
}
.rsa-strength-meta {
  font-size: 11px;
  color: var(--fg-3);
  margin-left: auto;
}
.rsa-strength-bar {
  height: 5px;
  background: var(--bg-3);
  border-radius: 3px;
  overflow: hidden;
}
.rsa-grade {
  font-size: 11px;
  font-weight: 800;
  width: 22px;
  height: 22px;
  border-radius: 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.rsa-angle {
  font-size: 10px;
  color: var(--fg-3);
  background: var(--bg-3);
  padding: 1px 6px;
  border-radius: 4px;
  white-space: nowrap;
}
.rsa-pin-badge {
  font-size: 10px;
  font-weight: 700;
  color: #6366f1;
  background: #6366f122;
  border: 1px solid #6366f144;
  padding: 1px 6px;
  border-radius: 4px;
  flex-shrink: 0;
}
.rsa-h-cell {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border-radius: 7px;
  background: var(--bg-2);
  border: 1px solid var(--bg-3);
  margin-bottom: 4px;
  cursor: default;
}
.rsa-h-cell:hover { background: var(--bg-3); }
.rsa-h-cell.error { border-color: #ef444444; background: #ef444408; }
.rsa-h-text { flex: 1; font-size: 13px; color: var(--fg-1); }

/* ── RSA Asset extensions ───────────────────────────────────────── */
.rsa-assets-wrap { margin-top: 20px; display: flex; flex-direction: column; gap: 16px; }
.rsa-asset-section {
  background: var(--bg-2);
  border: 1px solid var(--bg-4);
  border-radius: 10px;
  padding: 14px 16px;
}
.rsa-asset-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.rsa-asset-icon { font-size: 15px; }
.rsa-asset-title { font-size: 13px; font-weight: 700; color: var(--fg-1); }
.rsa-asset-hint  { font-size: 11px; color: var(--fg-3); margin-left: auto; }

/* Callouts */
.rsa-callout-row { display: flex; flex-wrap: wrap; gap: 8px; }
.rsa-callout-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-3);
  border: 1px solid var(--bg-4);
  border-radius: 20px;
  padding: 5px 12px;
}
.rsa-callout-text { font-size: 12px; color: var(--fg-1); }
.rsa-callout-len  { font-size: 10px; color: var(--fg-3); }
.rsa-callout-len.over { color: var(--red); }

/* Sitelinks */
.rsa-sitelinks-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.rsa-sitelink-card {
  background: var(--bg-3);
  border-radius: 8px;
  padding: 10px 12px;
  border-left: 3px solid var(--blue);
}
.rsa-sl-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--blue);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.rsa-sl-desc { font-size: 11px; color: var(--fg-2); line-height: 1.4; }
.rsa-sl-path { font-size: 10px; color: var(--fg-3); margin-top: 4px; font-style: italic; }

/* Call asset */
.rsa-call-row { display: flex; gap: 12px; flex-wrap: wrap; }
.rsa-call-field { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 140px; }
.rsa-call-label { font-size: 11px; color: var(--fg-3); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.rsa-call-input {
  background: var(--bg-3);
  border: 1px solid var(--bg-4);
  border-radius: 7px;
  padding: 7px 10px;
  font-size: 13px;
  color: var(--fg-1);
  outline: none;
  font-family: inherit;
}
.rsa-call-input:focus { border-color: var(--blue); }

/* ── Search term cleanup card ───────────────────────────────────── */
/* ── Diagnosis Card ─────────────────────────────────────────────────────── */
.diag-card {
  background: var(--bg-2);
  border: 1px solid var(--bg-4);
  border-radius: 12px;
  max-width: 560px;
  margin: 4px 0 4px 40px;
  overflow: hidden;
  font-size: 13px;
}
.diag-header { padding: 14px 16px 8px; }
.diag-title-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.diag-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 20px;
  font-size: 12px; font-weight: 600;
}
.diag-campaign { font-size: 12px; color: var(--fg-2); }
.diag-meta {
  display: flex; flex-wrap: wrap; gap: 6px 0;
  padding: 6px 16px 10px;
  border-top: 1px solid var(--bg-4);
  border-bottom: 1px solid var(--bg-4);
}
.diag-meta-item { width: 50%; display: flex; flex-direction: column; padding: 4px 0; }
.diag-meta-key { font-size: 11px; color: var(--fg-3, #888); text-transform: uppercase; letter-spacing: .04em; }
.diag-meta-val { font-weight: 600; color: var(--fg-1); }
.diag-narrative { padding: 12px 16px; line-height: 1.55; color: var(--fg-1); }
.diag-rec-detail {
  display: flex; align-items: flex-start; gap: 8px;
  margin: 0 16px 12px;
  padding: 10px 12px;
  background: rgba(37,99,235,.08);
  border-radius: 8px;
  border: 1px solid rgba(37,99,235,.18);
  font-size: 12px; color: var(--fg-1);
}
.diag-rec-icon { font-size: 14px; color: #2563EB; flex-shrink: 0; margin-top: 1px; }
.diag-edit-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 16px 12px;
  border-top: 1px solid var(--bg-4);
  background: var(--bg-3, rgba(0,0,0,.03));
}
.diag-edit-label { font-size: 12px; font-weight: 600; color: var(--fg-2); white-space: nowrap; }
.diag-edit-input {
  width: 100px;
  padding: 6px 10px;
  border-radius: 7px;
  border: 1.5px solid var(--bg-4);
  background: var(--bg);
  color: var(--fg-1);
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  transition: border-color .15s;
}
.diag-edit-input:focus { outline: none; border-color: #2563EB; }
.diag-edit-hint { font-size: 11px; color: var(--fg-3, #888); }

.diag-foot {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px;
  border-top: 1px solid var(--bg-4);
}
.diag-approve {
  padding: 7px 16px; border-radius: 7px; border: none;
  background: #2563EB; color: #fff;
  font-size: 13px; font-weight: 600; cursor: pointer;
  transition: background .15s;
}
.diag-approve:hover { background: #1D4ED8; }
.diag-approve:disabled { opacity: .5; cursor: default; }
.diag-ask {
  padding: 7px 16px; border-radius: 7px; border: 1px solid var(--bg-4);
  background: transparent; color: var(--fg-1);
  font-size: 13px; font-weight: 500; cursor: pointer;
}
.diag-ask:hover { background: var(--bg-3); }
.diag-dismiss {
  padding: 7px 12px; border-radius: 7px; border: none;
  background: transparent; color: var(--fg-3, #888);
  font-size: 12px; cursor: pointer;
}
.diag-dismiss:hover { color: var(--fg-1); }

/* ── Keyword Research Card ─────────────────────────────────────────── */
.kwr-card-wrap { padding: 0 0 4px 0; }
.kwr-card {
  background: var(--bg-2); border: 1px solid var(--bg-4);
  border-left: 3px solid #6366f1;
  border-radius: 10px; max-width: 640px;
  margin: 4px 0 4px 40px; overflow: hidden; }
.kwr-head { display: flex; align-items: flex-start; gap: 10px;
  padding: 14px 16px 12px; border-bottom: 1px solid var(--border); }
.kwr-icon { font-size: 20px; flex-shrink: 0; }
.kwr-title { font-size: 13px; font-weight: 700; color: var(--fg-1); }
.kwr-title em { font-style: normal; color: var(--accent); }
.kwr-sub { font-size: 11px; color: var(--fg-3); margin-top: 2px; }
.kwr-dismiss { margin-left: auto; background: none; border: none;
  color: var(--fg-3); cursor: pointer; font-size: 14px; padding: 2px 4px; flex-shrink: 0; }
.kwr-body { padding: 12px 16px 14px; }
.kwr-loading { display: flex; align-items: center; gap: 10px;
  color: var(--fg-3); font-size: 12px; padding: 8px 0; }
.kwr-spinner { width: 14px; height: 14px; border: 2px solid var(--border);
  border-top-color: var(--accent); border-radius: 50%;
  animation: spin .7s linear infinite; flex-shrink: 0; }
.kwr-error, .kwr-empty { font-size: 12px; color: var(--fg-3); padding: 4px 0; }
.kwr-seed-prompt p { font-size: 13px; color: var(--fg-2); margin: 0 0 10px; }
.kwr-seed-row { display: flex; gap: 8px; }
.kwr-seed-input { flex: 1; background: var(--bg-1); border: 1px solid var(--border);
  border-radius: 8px; padding: 7px 10px; font-size: 13px; color: var(--fg); }
.kwr-seed-input:focus { outline: none; border-color: var(--accent); }
.kwr-seed-btn { background: var(--accent); color: #fff; border: none;
  border-radius: 8px; padding: 7px 14px; font-size: 12px; font-weight: 600;
  cursor: pointer; white-space: nowrap; }
.kwr-group { margin-bottom: 14px; }
.kwr-group-label { font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--fg-3); margin-bottom: 6px; }
.kwr-row { display: flex; align-items: flex-start; gap: 8px;
  padding: 7px 0; border-bottom: 1px solid var(--border); }
.kwr-row:last-child { border-bottom: none; }
.kwr-row-check { padding-top: 2px; flex-shrink: 0; }
.kwr-row-main { flex: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.kwr-kw-text { font-size: 13px; font-weight: 600; color: var(--fg-1); }
.kwr-mt-badge { font-size: 10px; background: var(--bg-3); color: var(--fg-3);
  border-radius: 4px; padding: 1px 5px; font-weight: 600; text-transform: uppercase; }
.kwr-badge { font-size: 10px; border-radius: 4px; padding: 1px 6px; font-weight: 600; }
.kwr-badge-warn { background: #fef3c7; color: #92400e; }
.kwr-badge-info { background: #ede9fe; color: #5b21b6; }
.kwr-rationale { font-size: 11px; color: var(--fg-3); width: 100%; }
.kwr-row-meta { display: flex; gap: 10px; flex-shrink: 0; align-items: center;
  font-size: 11px; color: var(--fg-3); }
.kwr-comp-high { color: #ef4444; font-weight: 600; }
.kwr-comp-med  { color: #f59e0b; font-weight: 600; }
.kwr-comp-low  { color: #10b981; font-weight: 600; }
.kwr-rejected { font-size: 11px; color: var(--fg-3); padding: 6px 0 2px;
  border-top: 1px solid var(--border); margin-top: 4px; }
.kwr-actions { display: flex; align-items: center; gap: 10px;
  margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.kwr-add-btn { background: var(--accent); color: #fff; border: none;
  border-radius: 8px; padding: 8px 16px; font-size: 12px; font-weight: 700;
  cursor: pointer; }
.kwr-add-btn:hover { opacity: .88; }
.kwr-add-hint { font-size: 11px; color: var(--fg-3); }

/* ── Cleanup card ──────────────────────────────────────────────────── */
.cleanup-card-wrap { padding: 0 0 4px 0; }
.cleanup-card {
  background: var(--bg-2);
  border: 1px solid var(--bg-4);
  border-left: 3px solid #ef4444;
  border-radius: 10px;
  max-width: 600px;
  margin: 4px 0 4px 40px;
  overflow: hidden;
}
.cleanup-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px 10px;
}
.cleanup-icon { font-size: 18px; margin-top: 1px; }
.cleanup-title { font-size: 13px; font-weight: 700; color: var(--fg-1); }
.cleanup-sub   { font-size: 12px; color: var(--fg-2); margin-top: 2px; }
.cleanup-dismiss {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--fg-3);
  cursor: pointer;
  font-size: 14px;
  padding: 0 4px;
}
.cleanup-table-wrap {
  overflow-x: auto;
  max-height: 220px;
  overflow-y: auto;
  border-top: 1px solid var(--bg-4);
  border-bottom: 1px solid var(--bg-4);
}
.cleanup-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.cleanup-table th {
  background: var(--bg-3);
  padding: 7px 10px;
  text-align: left;
  font-weight: 600;
  color: var(--fg-3);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .05em;
  position: sticky;
  top: 0;
}
.cleanup-table td { padding: 7px 10px; border-bottom: 1px solid var(--bg-3); }
.cleanup-table tr:last-child td { border-bottom: none; }
.cleanup-table tr:hover td { background: var(--bg-3); }
.clt-term { color: var(--fg-1); font-weight: 500; max-width: 180px; }
.clt-meta { color: var(--fg-3); font-size: 11px; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clt-cost { color: var(--red); font-weight: 600; }
.clt-clicks { color: var(--fg-3); }
.cleanup-mt-sel {
  font-size: 11px;
  padding: 2px 5px;
  border-radius: 5px;
  border: 1px solid var(--bg-4);
  background: var(--bg-2);
  color: var(--fg-1);
  cursor: pointer;
}
.cleanup-mt-all {
  font-size: 10px;
  padding: 1px 4px;
  border-radius: 4px;
  border: 1px solid var(--bg-4);
  background: var(--bg-2);
  color: var(--fg-2);
  cursor: pointer;
  margin-left: 4px;
}
.cleanup-foot {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
}
.cleanup-approve {
  background: #ef4444;
  color: #fff;
  border: none;
  border-radius: 7px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.cleanup-approve:hover { opacity: .88; }
.cleanup-approve:disabled { opacity: .5; cursor: default; }
.cleanup-count { font-size: 12px; color: var(--fg-3); margin-left: auto; }


/* ── Negative Scope Flow Card (inline chat wizard) ──────────────── */
.nsf-card-wrap { padding: 0 0 4px; }
.nsf-card { background: var(--bg-2); border: 1.5px solid rgba(239,68,68,.3);
  border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-sm); }
.nsf-head { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px 10px;
  border-bottom: 1px solid var(--border); }
.nsf-icon { font-size: 20px; flex-shrink: 0; }
.nsf-head-text { flex: 1; min-width: 0; }
.nsf-title { font-size: 13px; font-weight: 700; color: var(--fg-1); margin-bottom: 6px; }
.nsf-kw-list { display: flex; flex-wrap: wrap; gap: 5px; }
.nsf-kw-tag { background: rgba(239,68,68,.1); color: var(--red); border: 1px solid rgba(239,68,68,.25);
  padding: 2px 8px; border-radius: var(--r-full); font-size: 12px; font-weight: 500; }
.nsf-dismiss { background: none; border: none; color: var(--fg-3); cursor: pointer;
  font-size: 16px; padding: 2px 6px; border-radius: 4px; flex-shrink: 0; }
.nsf-dismiss:hover { background: var(--bg-3); }
.nsf-body { padding: 12px 14px; display: flex; flex-direction: column; gap: 14px; }
.nsf-section { display: flex; flex-direction: column; gap: 6px; }
.nsf-section-label { font-size: 11px; font-weight: 600; color: var(--fg-2); text-transform: uppercase;
  letter-spacing: .04em; }
.nsf-scope-row { display: flex; gap: 6px; flex-wrap: wrap; }
.nsf-scope-btn { padding: 6px 12px; border-radius: var(--r); border: 1.5px solid var(--border-2);
  background: var(--bg-3); font-size: 12px; font-weight: 500; color: var(--fg-1); cursor: pointer; }
.nsf-scope-btn:hover { border-color: var(--accent); }
.nsf-scope-btn.active { border-color: var(--accent); background: rgba(99,102,241,.1); color: var(--accent); font-weight: 700; }
.nsf-entity-list { display: flex; flex-direction: column; gap: 4px; max-height: 180px;
  overflow-y: auto; border: 1px solid var(--border); border-radius: var(--r);
  padding: 4px; background: var(--bg-1); }
.nsf-entity-item { padding: 7px 10px; border-radius: var(--r); cursor: pointer;
  font-size: 13px; color: var(--fg-1); }
.nsf-entity-item:hover { background: var(--bg-3); }
.nsf-entity-item.selected { background: rgba(99,102,241,.1); color: var(--accent); font-weight: 600; }
.nsf-entity-sub { font-size: 11px; color: var(--fg-3); font-weight: 400; }
.nsf-loading { padding: 8px; font-size: 12px; color: var(--fg-3); }
.nsf-mt-row { display: flex; gap: 6px; flex-wrap: wrap; }
.nsf-mt-btn { padding: 6px 12px; border-radius: var(--r); border: 1.5px solid var(--border-2);
  background: var(--bg-3); font-size: 12px; cursor: pointer; display: flex; flex-direction: column;
  align-items: flex-start; gap: 1px; }
.nsf-mt-btn:hover { border-color: var(--accent); }
.nsf-mt-btn.active { border-color: var(--accent); background: rgba(99,102,241,.1); }
.nsf-mt-name { font-weight: 700; color: var(--fg-1); font-size: 12px; }
.nsf-mt-btn.active .nsf-mt-name { color: var(--accent); }
.nsf-mt-eg { font-size: 10px; font-family: monospace; color: var(--fg-3); }
.nsf-mt-hint { font-size: 11px; color: var(--blue); line-height: 1.4; }
.nsf-foot { display: flex; align-items: center; gap: 10px; padding-top: 4px; }
.nsf-confirm-btn { padding: 8px 16px; background: var(--red); color: #fff; border: none;
  border-radius: var(--r); font-size: 13px; font-weight: 700; cursor: pointer; }
.nsf-confirm-btn:disabled { opacity: .4; cursor: default; }
.nsf-confirm-btn:not(:disabled):hover { opacity: .88; }
.nsf-status { font-size: 12px; color: var(--red); }
.nsf-done { display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
.nsf-done-check { width: 36px; height: 36px; border-radius: 50%; background: rgba(34,197,94,.15);
  color: var(--green); font-size: 18px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

/* ── Problem Solver Card ─────────────────────────────────────────── */
.pp-card-wrap { padding: 0 0 4px; }
.pp-card { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--r-lg);
  overflow: hidden; box-shadow: var(--shadow-sm); }
.pp-card.pp-red    { border-color: rgba(239,68,68,.35); }
.pp-card.pp-orange { border-color: rgba(249,115,22,.35); }
.pp-card.pp-blue   { border-color: rgba(59,130,246,.35); }
.pp-head { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px 10px; border-bottom: 1px solid var(--border); }
.pp-icon { font-size: 22px; flex-shrink: 0; }
.pp-head-text { flex: 1; min-width: 0; }
.pp-title { font-size: 14px; font-weight: 700; color: var(--fg-1); margin-bottom: 3px; }
.pp-summary { font-size: 12px; color: var(--fg-2); line-height: 1.5; }
.pp-dismiss { background: none; border: none; color: var(--fg-3); cursor: pointer; font-size: 16px;
  padding: 2px 6px; border-radius: 4px; flex-shrink: 0; }
.pp-dismiss:hover { background: var(--bg-3); color: var(--fg-1); }
.pp-table-wrap { overflow-x: auto; max-height: 320px; overflow-y: auto; }
.pp-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.pp-table th { padding: 7px 10px; text-align: left; font-weight: 600; color: var(--fg-2);
  background: var(--bg-3); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 1; }
.pp-table td { padding: 7px 10px; border-bottom: 1px solid var(--bg-3); }
.pp-table tr:last-child td { border-bottom: none; }
.pp-table tr:hover td { background: var(--bg-3); }
.pp-term { font-weight: 500; color: var(--fg-1); }
.pp-camp { color: var(--fg-2); max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pp-num  { text-align: right; white-space: nowrap; }
.pp-num.red { color: var(--red); font-weight: 600; }
.pp-reason { color: var(--fg-3); font-size: 11px; }
.pp-locked-row td { padding: 0; }
.pp-gate { display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  background: rgba(99,102,241,.06); border-top: 1px dashed rgba(99,102,241,.3); }
.pp-gate-lock { font-size: 14px; }
.pp-gate span { font-size: 12px; color: var(--fg-2); flex: 1; }
.pp-gate-btn { font-size: 12px; font-weight: 600; color: var(--accent); text-decoration: none;
  background: rgba(99,102,241,.12); padding: 4px 10px; border-radius: var(--r); white-space: nowrap; }
.pp-gate-btn:hover { background: rgba(99,102,241,.2); }
.pp-foot { display: flex; align-items: center; gap: 12px; padding: 10px 14px;
  border-top: 1px solid var(--border); background: var(--bg-1); }
.pp-act-btn { padding: 7px 14px; background: var(--red); color: #fff; border: none;
  border-radius: var(--r); font-size: 13px; font-weight: 600; cursor: pointer; }
.pp-act-btn:hover { opacity: .88; }
.pp-act-btn:disabled { opacity: .5; cursor: default; }
a.pp-act-btn { display: inline-block; text-decoration: none; background: var(--accent); }
a.pp-act-btn:hover { opacity: .88; }
.pp-count { font-size: 12px; color: var(--fg-3); margin-left: auto; }

/* ═══════════════════════════════════════════════════════════════════
   PREMIUM POLISH PASS
   Elevates every surface: depth, motion, mobile, focus states, brand.
═══════════════════════════════════════════════════════════════════ */

/* ── Global: sharper focus rings ─────────────────────────────────── */
*:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ── Sidebar: more refined ───────────────────────────────────────── */
.sidebar {
  background: var(--bg-1);
  border-right-color: var(--border);
}
:root:not([data-theme="light"]) .sidebar {
  background: linear-gradient(180deg, #0c0c10 0%, #09090d 100%);
  border-right-color: rgba(255,255,255,.045);
}
.sb-head {
  padding: 14px 12px 11px;
  background: transparent;
}
.logo-mark {
  background: linear-gradient(135deg, #4f8ef7, #7c6dfa);
  box-shadow: 0 2px 10px rgba(79,142,247,.35);
}
.acct-pill {
  border-radius: 10px;
  background: rgba(255,255,255,.04);
  border-color: rgba(255,255,255,.06);
}
.acct-pill:hover { background: rgba(255,255,255,.07); }
.nav-item.active {
  background: linear-gradient(90deg, rgba(79,142,247,.14), rgba(79,142,247,.06));
  border-left: 2px solid var(--blue);
  padding-left: 8px;
}
.history-item {
  border-radius: var(--r-md);
  padding: 6px 10px 6px 12px;
}
.sb-footer {
  background: rgba(0,0,0,.2);
  border-top-color: rgba(255,255,255,.05);
  padding: 10px 10px 12px;
}

/* ── Topbar: glass effect ────────────────────────────────────────── */
.topbar {
  height: 52px;
  background: var(--bg-1);
  border-bottom-color: var(--border);
}
:root:not([data-theme="light"]) .topbar {
  background: rgba(14,14,18,.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom-color: rgba(255,255,255,.055);
  box-shadow: 0 1px 0 rgba(255,255,255,.03);
}
.period-sel {
  background: rgba(255,255,255,.05);
  border-color: rgba(255,255,255,.08);
  border-radius: var(--r-md);
  padding: 5px 10px;
  font-size: 12px;
  color: var(--fg-2);
  transition: border-color var(--transition);
}
.period-sel:hover { border-color: rgba(255,255,255,.14); color: var(--fg); }
.period-sel:focus { border-color: var(--blue); outline: none; }

/* ── Greeting hero: more premium ─────────────────────────────────── */
.greeting-hero { padding: 52px 24px 28px; }
.greeting-mascot {
  width: 80px; height: 80px;
  box-shadow: 0 0 0 4px rgba(79,142,247,.15), 0 8px 32px rgba(0,0,0,.35);
  border: 2px solid rgba(79,142,247,.2);
}
.greeting-text {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -.025em;
  color: var(--fg);
}
:root:not([data-theme="light"]) .greeting-text {
  background: linear-gradient(135deg, #eeeef2 30%, rgba(79,142,247,.8) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.greeting-sub { font-size: 15px; margin-top: 6px; }

/* Starter cards: premium hover with gradient border */
.starter-card {
  position: relative;
  border-radius: var(--r-lg);
  background: var(--bg-2);
  border-color: var(--border);
  padding: 16px;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition), background var(--transition);
}
:root:not([data-theme="light"]) .starter-card {
  background: linear-gradient(145deg, rgba(255,255,255,.03), rgba(255,255,255,.01));
  border-color: rgba(255,255,255,.06);
}
.starter-card:hover {
  background: linear-gradient(145deg, rgba(79,142,247,.08), rgba(124,109,250,.04));
  border-color: rgba(79,142,247,.25);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,.1), 0 0 0 1px rgba(79,142,247,.18);
}
.starter-icon { font-size: 22px; margin-bottom: 10px; }
.starter-label { font-size: 13px; font-weight: 600; letter-spacing: -.01em; color: var(--fg); }
.starter-sub { font-size: 11px; color: var(--fg-3); margin-top: 3px; }

/* Chips: horizontal scroll on narrow screens */
.chips-row {
  overflow-x: auto;
  flex-wrap: nowrap;
  padding-bottom: 2px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.chips-row::-webkit-scrollbar { display: none; }
.chip {
  white-space: nowrap;
  flex-shrink: 0;
  font-size: 11.5px;
  padding: 5px 12px;
  border-radius: var(--r-full);
  transition: all var(--transition);
}

/* ── Input bar: premium depth ────────────────────────────────────── */
.input-area {
  padding: 12px 16px;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  background: var(--bg);
  border-top-color: var(--border);
}
:root:not([data-theme="light"]) .input-area {
  background: linear-gradient(180deg, transparent 0%, rgba(8,8,11,.6) 100%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-top-color: rgba(255,255,255,.05);
}
.input-wrap {
  background: var(--bg-2);
  border-color: var(--border-2);
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition), box-shadow var(--transition);
}
:root:not([data-theme="light"]) .input-wrap {
  background: rgba(255,255,255,.04);
  border-color: rgba(255,255,255,.09);
}
.input-wrap:focus-within {
  border-color: rgba(79,142,247,.5);
  box-shadow: var(--glow-blue), var(--shadow-sm);
}
.chat-input { font-size: 14px; }

/* Send button: glow */
.send-btn {
  background: linear-gradient(135deg, #4f8ef7, #6b74f5);
  box-shadow: 0 2px 10px rgba(79,142,247,.35);
  transition: opacity var(--transition), box-shadow var(--transition), transform var(--transition);
}
.send-btn:hover {
  opacity: 1;
  box-shadow: 0 4px 18px rgba(79,142,247,.5);
  transform: scale(1.05);
}
.send-btn:active { transform: scale(.96); }

/* ── Chat messages: more depth ───────────────────────────────────── */
.msg-av { width: 28px; height: 28px; }
.msg-av.ai {
  background: linear-gradient(135deg, #4f8ef7, #7c6dfa);
  box-shadow: 0 2px 8px rgba(79,142,247,.3);
}
.bubble {
  border-radius: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,.25);
  background: rgba(255,255,255,.04);
  border-color: rgba(255,255,255,.07);
  font-size: 14px;
  line-height: 1.65;
  color: #c2c4ce;
}
.msg.user-msg .bubble {
  background: linear-gradient(135deg, rgba(79,142,247,.16), rgba(124,109,250,.1));
  border-color: rgba(79,142,247,.22);
}

/* Thinking / typing */
.thinking-spin {
  border-width: 1.5px;
  width: 12px; height: 12px;
}

/* ── Right rail: more refined ────────────────────────────────────── */
.rail {
  background: var(--bg-1);
  border-left-color: var(--border);
}
:root:not([data-theme="light"]) .rail {
  background: linear-gradient(180deg, #0d0d11 0%, #0a0a0e 100%);
  border-left-color: rgba(255,255,255,.04);
}
.rail-section { padding: 14px 14px 10px; }

/* ── Modals: premium glass (dark mode only) ──────────────────────── */
:root:not([data-theme="light"]) .ob-modal {
  background: linear-gradient(145deg, rgba(21,21,25,.98), rgba(14,14,18,.98));
  border-color: rgba(255,255,255,.1);
  box-shadow: 0 32px 100px rgba(0,0,0,.7), 0 0 0 1px rgba(255,255,255,.05);
}
:root:not([data-theme="light"]) .modal {
  background: rgba(21,21,25,.97);
  border-color: rgba(255,255,255,.1);
  box-shadow: 0 24px 80px rgba(0,0,0,.65);
}
:root:not([data-theme="light"]) .settings-drawer {
  background: linear-gradient(180deg, #0d0d11, #0a0a0e);
  border-left-color: rgba(255,255,255,.06);
  box-shadow: -12px 0 48px rgba(0,0,0,.6);
}
/* Light mode modal: clean white */
:root[data-theme="light"] .ob-modal,
:root[data-theme="light"] .modal {
  background: #ffffff;
  border-color: rgba(0,0,0,.1);
  box-shadow: 0 24px 80px rgba(0,0,0,.15);
}
:root[data-theme="light"] .settings-drawer {
  background: #f8f8fb;
  border-left-color: rgba(0,0,0,.07);
}

/* ── Voice overlay: more cinematic ──────────────────────────────── */
.voice-overlay {
  background: rgba(4,4,8,.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

/* ── Scrollbars: ultra-thin ──────────────────────────────────────── */
.chat-body::-webkit-scrollbar { width: 2px; }
.chat-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 2px; }
.chat-body::-webkit-scrollbar-track { background: transparent; }

/* ── Alert strip: refined ────────────────────────────────────────── */
.alert-strip {
  border-radius: 0;
  box-shadow: 0 2px 12px rgba(0,0,0,.3);
}

/* ── Icon buttons: uniform hover ─────────────────────────────────── */
.icon-btn {
  width: 28px; height: 28px;
  border-radius: var(--r-sm);
  background: rgba(255,255,255,.04);
  transition: background var(--transition), color var(--transition);
}
.icon-btn:hover { background: rgba(255,255,255,.08); color: var(--fg); }

/* ── Light mode overrides ─────────────────────────────────────────── */
/* System light (no explicit theme set) — wrap in media query so it
   doesn't fire on system-dark with no data-theme attribute */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .input-wrap {
    background: #fff;
    border-color: rgba(0,0,0,.1);
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
  }
  :root:not([data-theme="dark"]) .bubble {
    background: #fff;
    border-color: rgba(0,0,0,.07);
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
    color: #111118;
  }
  :root:not([data-theme="dark"]) .msg.user-msg .bubble {
    background: linear-gradient(135deg, rgba(79,142,247,.14), rgba(124,109,250,.09));
    border-color: rgba(79,142,247,.25);
    color: #111118;
  }
  :root:not([data-theme="dark"]) .genui-history-label {
    color: #7878a0;
  }
  :root:not([data-theme="dark"]) .gui-camp-table-wrap {
    background: #fff;
    border-color: rgba(0,0,0,.07);
    color: #111118;
  }
  :root:not([data-theme="dark"]) .greeting-text {
    background: linear-gradient(135deg, #111118 40%, #4f8ef7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
  }
  :root:not([data-theme="dark"]) .starter-card {
    background: #fff;
    border-color: rgba(0,0,0,.08);
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
  }
  :root:not([data-theme="dark"]) .starter-card:hover {
    background: linear-gradient(145deg, rgba(79,142,247,.05), rgba(124,109,250,.03));
    border-color: rgba(79,142,247,.3);
    box-shadow: 0 8px 24px rgba(0,0,0,.08), 0 0 0 1px rgba(79,142,247,.15);
  }
}
/* Explicit light theme toggle */
:root[data-theme="light"] .input-wrap {
  background: #fff;
  border-color: rgba(0,0,0,.1);
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
}
:root[data-theme="light"] .bubble {
  background: #fff;
  border-color: rgba(0,0,0,.07);
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
  color: #111118;
}
:root[data-theme="light"] .msg.user-msg .bubble {
  background: linear-gradient(135deg, rgba(79,142,247,.14), rgba(124,109,250,.09));
  border-color: rgba(79,142,247,.25);
  color: #111118;
}
:root[data-theme="light"] .genui-history-label {
  color: #7878a0;
}
:root[data-theme="light"] .gui-camp-table-wrap {
  background: #fff;
  border-color: rgba(0,0,0,.07);
  color: #111118;
}
:root[data-theme="light"] .greeting-text {
  background: linear-gradient(135deg, #111118 40%, #4f8ef7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
:root[data-theme="light"] .starter-card {
  background: #fff;
  border-color: rgba(0,0,0,.08);
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
:root[data-theme="light"] .starter-card:hover {
  background: linear-gradient(145deg, rgba(79,142,247,.05), rgba(124,109,250,.03));
  border-color: rgba(79,142,247,.3);
  box-shadow: 0 8px 24px rgba(0,0,0,.08), 0 0 0 1px rgba(79,142,247,.15);
}

/* Alert cards in light mode */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .alert-card-warning {
    background: #fffbeb;
    border-left-color: #f59e0b;
  }
  :root:not([data-theme="dark"]) .alert-card-danger {
    background: #fff1f1;
    border-left-color: var(--red);
  }
}
:root[data-theme="light"] .alert-card-warning {
  background: #fffbeb;
  border-left-color: #f59e0b;
}
:root[data-theme="light"] .alert-card-danger {
  background: #fff1f1;
  border-left-color: var(--red);
}

/* ═══════════════════════════════════════════════════════════════════
   RESPONSIVE — Mobile-first
═══════════════════════════════════════════════════════════════════ */

/* Tablet: 640–900px — sidebar visible, rail hidden */
@media (min-width: 641px) and (max-width: 900px) {
  .sidebar { width: 200px; }
  .chat-body { padding: 16px 14px; }
}

/* Mobile: ≤640px */
@media (max-width: 640px) {
  /* Sidebar becomes a full-height drawer */
  .sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    width: 280px;
    z-index: 50;
    transform: translateX(-100%);
    transition: transform .25s cubic-bezier(.4,0,.2,1);
    box-shadow: none;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 8px 0 40px rgba(0,0,0,.7);
  }
  /* Backdrop handled by #sb-backdrop div (::after can't receive touch events on iOS) */
  .sb-close-btn { display: flex; }

  .sb-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 49;
    background: rgba(0,0,0,.55);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
  }
  .sb-backdrop.active { display: block; }
  /* Main area fills full width */
  .main { width: 100%; }
  .rail { display: none; }
  /* Chat padding */
  .chat-body { padding: 14px 12px; gap: 12px; }
  /* Greeting */
  .greeting-hero { padding: 36px 16px 20px; }
  .greeting-text { font-size: 26px; }
  .greeting-sub { font-size: 14px; }
  .greeting-mascot { width: 66px; height: 66px; }
  .starters-grid { grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 20px; }
  .starter-card { padding: 12px; }
  .starter-icon { font-size: 18px; margin-bottom: 6px; }
  /* Input */
  .input-area { padding: 10px 12px; padding-bottom: max(10px, env(safe-area-inset-bottom)); }
  .input-wrap { border-radius: 16px; }
  /* Bubbles */
  .bubble { font-size: 13.5px; max-width: calc(100vw - 80px); }
  .msg.user-msg .bubble { max-width: calc(100vw - 80px); }
  /* Topbar */
  .topbar { height: 48px; padding: 0 12px; }
  /* RSA modal full screen on mobile */
  .rsa-modal {
    position: fixed;
    inset: 0;
    border-radius: 0;
    max-height: 100dvh;
  }
  /* Report card */
  .report-sunny { padding: 16px; border-radius: 12px; }
  .rs-kpis { grid-template-columns: repeat(3, 1fr); }
  /* Diagnosis + action cards */
  .diag-card, .action-card, .cleanup-card, .pp-card {
    margin-left: 36px;
  }
}

/* Very small (≤380px) */
@media (max-width: 380px) {
  .starters-grid { grid-template-columns: 1fr; }
  .rs-kpis { grid-template-columns: repeat(2, 1fr); }
}

/* ── Reduced motion ──────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}

/* ── Pricing modal ────────────────────────────────────────────────── */
#pricing-modal .modal-inner {
  max-width: 720px;
  padding: 32px 28px 28px;
}
.pricing-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--fg);
  margin-bottom: 4px;
  text-align: center;
}
.pricing-sub {
  font-size: 14px;
  color: var(--fg-2);
  text-align: center;
  margin-bottom: 28px;
}
.pricing-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.pricing-card {
  border-radius: 16px;
  border: 1.5px solid var(--border);
  background: var(--bg-2);
  padding: 24px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  transition: border-color .2s;
}
.pricing-card:hover { border-color: var(--blue); }
.pricing-card-featured {
  border-color: var(--blue);
  background: linear-gradient(160deg, color-mix(in srgb, var(--blue) 8%, var(--bg-2)), var(--bg-2));
}
.pricing-badge {
  position: absolute;
  top: -11px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--blue);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  padding: 2px 10px;
  border-radius: 20px;
  white-space: nowrap;
}
.pricing-plan-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--fg);
}
.pricing-amount {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  line-height: 1;
}
.pricing-amount-num {
  font-size: 36px;
  font-weight: 800;
  color: var(--fg);
  font-variant-numeric: tabular-nums;
}
.pricing-amount-period {
  font-size: 13px;
  color: var(--fg-2);
  padding-bottom: 6px;
}
.pricing-features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.pricing-feat {
  font-size: 13px;
  color: var(--fg-2);
  display: flex;
  align-items: center;
  gap: 8px;
}
.pricing-feat::before {
  content: '✓';
  color: var(--blue);
  font-weight: 700;
  flex-shrink: 0;
}
.pricing-cta {
  margin-top: 8px;
  padding: 11px 0;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid var(--border);
  background: var(--bg-3);
  color: var(--fg);
  width: 100%;
  transition: background .15s, border-color .15s;
}
.pricing-cta:hover { background: var(--bg-2); border-color: var(--blue); }
.pricing-cta-featured {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}
.pricing-cta-featured:hover { filter: brightness(1.12); }

/* ── Chat limit banner ───────────────────────────────────────────── */
.chat-limit-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: color-mix(in srgb, var(--blue) 12%, var(--bg-2));
  border: 1px solid color-mix(in srgb, var(--blue) 30%, transparent);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--fg-2);
  margin-bottom: 8px;
}
.chat-limit-upgrade {
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: 7px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Plan badge in sidebar ───────────────────────────────────────── */
.plan-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  background: var(--blue);
  color: #fff;
  border-radius: 5px;
  padding: 2px 6px;
  margin-left: 6px;
  vertical-align: middle;
}

/* ── Toast notifications ─────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--fg);
  box-shadow: 0 8px 32px rgba(0,0,0,.2);
  opacity: 0;
  transition: opacity .25s, transform .25s;
  z-index: 9999;
  pointer-events: none;
  white-space: nowrap;
}
.toast-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.toast-success { border-color: #22c55e; }

/* Pricing responsive */
@media (max-width: 600px) {
  .pricing-cards { grid-template-columns: 1fr; }
  #pricing-modal .modal-inner { padding: 24px 16px 20px; }
}

.plan-badge-free {
  background: var(--bg-3);
  color: var(--fg-2);
  border: 1px solid var(--border);
}

/* ── Handoff card ───────────────────────────────────────────── */
/* ── Operate handoff card (inline in chat thread) ─────────── */
.handoff-inline-wrap {
  padding: 0 16px 12px 16px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .25s, transform .25s;
}
.handoff-inline-wrap.visible {
  opacity: 1;
  transform: translateY(0);
}
.handoff-inline-wrap.collapsed { padding-bottom: 8px; }

.handoff-inline {
  background: color-mix(in srgb, var(--accent) 6%, var(--bg-2));
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border));
  border-radius: 12px;
  overflow: hidden;
}
.handoff-inline-top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px 10px;
  flex-wrap: wrap;
}
.handoff-inline-icon {
  font-size: 20px;
  flex-shrink: 0;
}
.handoff-inline-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}
.handoff-inline-text strong {
  font-size: 13px;
  font-weight: 600;
  color: var(--fg);
}
.handoff-inline-text span {
  font-size: 12px;
  color: var(--fg-2);
}
.handoff-inline-btns {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.handoff-btn-go {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.handoff-btn-go:hover { opacity: .88; }
.handoff-btn-stay {
  background: transparent;
  color: var(--fg-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}
.handoff-btn-stay:hover { background: var(--bg-3); }

/* Progress bar */
.handoff-inline-bar-track {
  height: 3px;
  background: var(--border);
  margin: 0 14px;
}
.handoff-inline-bar {
  height: 3px;
  width: 100%;
  background: var(--accent);
  transition: width 1s linear;
  border-radius: 2px;
}
.handoff-inline-footer {
  padding: 5px 14px 10px;
  font-size: 11px;
  color: var(--fg-3);
}

/* Gated handoff — lock tint */
.handoff-inline-wrap.gated .handoff-inline {
  background: color-mix(in srgb, #f59e0b 5%, var(--bg-2));
  border-color: color-mix(in srgb, #f59e0b 28%, var(--border));
}
.handoff-btn-go.locked {
  background: #f59e0b;
  color: #000;
}
.handoff-btn-go.locked:hover { opacity: .88; }

/* Inline upgrade card (morphed from handoff) */
.handoff-upgrade-card {
  background: var(--bg-2);
  border: 1px solid color-mix(in srgb, #f59e0b 35%, var(--border));
  border-radius: 12px;
  overflow: hidden;
  padding: 16px;
}
.handoff-upgrade-top {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 14px;
}
.handoff-upgrade-icon { font-size: 20px; flex-shrink: 0; margin-top: 2px; }
.handoff-upgrade-text { flex: 1; }
.handoff-upgrade-text strong { display: block; font-size: 14px; font-weight: 600; color: var(--fg); margin-bottom: 3px; }
.handoff-upgrade-text span  { font-size: 12px; color: var(--fg-2); }

.handoff-upgrade-plan {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 10px;
}
.handoff-upgrade-plan-name {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #f59e0b;
  margin-bottom: 2px;
}
.handoff-upgrade-plan-price {
  font-size: 28px;
  font-weight: 700;
  color: var(--fg);
  line-height: 1;
  margin-bottom: 10px;
}
.handoff-upgrade-plan-price span { font-size: 14px; font-weight: 400; color: var(--fg-2); }
.handoff-upgrade-perks {
  list-style: none;
  padding: 0;
  margin: 0 0 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.handoff-upgrade-perks li { font-size: 12px; color: var(--fg-2); }
.handoff-upgrade-cta {
  display: block;
  background: #f59e0b;
  color: #000;
  text-align: center;
  border-radius: 8px;
  padding: 10px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}
.handoff-upgrade-cta:hover { opacity: .88; }
.handoff-upgrade-dismiss {
  display: block;
  width: 100%;
  background: transparent;
  border: none;
  color: var(--fg-3);
  font-size: 12px;
  cursor: pointer;
  padding: 6px 0 0;
  text-align: center;
}
.handoff-upgrade-dismiss:hover { color: var(--fg-2); }

/* Collapsed state */
.handoff-inline-collapsed {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.handoff-collapsed-dot { font-size: 14px; opacity: .5; }
.handoff-collapsed-label { font-size: 12px; color: var(--fg-3); flex: 1; }
.handoff-collapsed-link {
  font-size: 12px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  white-space: nowrap;
}
.handoff-collapsed-link.locked { color: #f59e0b; }
.handoff-collapsed-link:hover { text-decoration: underline; }
/* collapsed link as button */
button.handoff-collapsed-link {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

/* ── Work Mode Panel (Canvas-style) ─────────────────────────── */
.work-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 480px;
  max-width: 90vw;
  height: 100dvh;
  background: var(--bg-1);
  border-left: 1px solid var(--border);
  z-index: 200;
  transform: translateX(100%);
  transition: transform .3s cubic-bezier(.4,0,.2,1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.work-panel.open {
  transform: translateX(0);
  box-shadow: -8px 0 32px rgba(0,0,0,.18);
}
.work-panel iframe {
  flex: 1;
  border: none;
  width: 100%;
  height: 100%;
}
.work-panel-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.35);
  z-index: 199;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
}
.work-panel-backdrop.open {
  opacity: 1;
  pointer-events: all;
}
/* Shrink chat area on wide screens when panel is open */
@media (min-width: 900px) {
  .app.work-panel-open > main {
    margin-right: 480px;
    transition: margin-right .3s cubic-bezier(.4,0,.2,1);
  }
  .work-panel-backdrop.open { display: none; }
}
@media (max-width: 899px) {
  .work-panel {
    width: 100vw;
    max-width: 100vw;
    height: 80dvh;
    top: auto;
    bottom: 0;
    border-left: none;
    border-top: 1px solid var(--border);
    border-radius: 16px 16px 0 0;
    transform: translateY(100%);
  }
  .work-panel.open { transform: translateY(0); }
}

/* Operate embedded mode — hide sidebar gutter */
.app-embedded {
  grid-template-columns: 1fr !important;
}
.operate-embedded {
  padding-top: 0 !important;
}
.embedded-topbar {
  border-bottom: 1px solid var(--border);
  padding: 0 12px;
  height: 46px;
}

/* ── AI disclaimer ──────────────────────────────────────────── */
.ai-disclaimer {
  text-align: center;
  font-size: 11px;
  color: var(--fg-3);
  margin: 4px 0 0;
  padding: 0;
  letter-spacing: 0.01em;
}

/* ── Campaign Creation Wizard ───────────────────────────────── */
.wz-wrap { max-width: 600px; padding: 4px 0 24px; }
.wz-progress { display: flex; gap: 6px; margin-bottom: 6px; }
.wz-prog-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--bg-4); }
.wz-prog-dot.active { background: var(--accent); }
.wz-prog-dot.done { background: #22c55e; }
.wz-review-label { font-size: 11px; color: var(--fg-3); margin-bottom: 14px; }
.wz-section-title { font-size: 15px; font-weight: 700; color: var(--fg); margin-bottom: 12px; }
.wz-label { display: block; font-size: 12px; font-weight: 600; color: var(--fg-2); margin-bottom: 6px; }
.wz-required { color: var(--red); }
.wz-optional { color: var(--fg-3); font-weight: 400; }
.wz-hint { font-size: 11px; color: var(--fg-3); margin-top: 5px; line-height: 1.5; }
.wz-field { margin-bottom: 16px; }
.wz-input { width: 100%; padding: 9px 11px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg); color: var(--fg); font-size: 13px; box-sizing: border-box; }
.wz-input:focus { border-color: var(--accent); outline: none; }
.wz-input.wz-error { border-color: var(--red); }
.wz-input-prefix { display: flex; align-items: center; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.wz-input-prefix span { padding: 0 10px; font-size: 13px; color: var(--fg-2); background: var(--bg-2); border-right: 1px solid var(--border); white-space: nowrap; }
.wz-input-prefix .wz-input { border: none; border-radius: 0; }
.wz-foot { display: flex; gap: 10px; margin-top: 20px; }
.wz-btn-primary { background: var(--accent); color: #fff; border: none; padding: 9px 18px; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; }
.wz-btn-primary:hover { opacity: .88; }
.wz-btn-primary:disabled { opacity: .45; cursor: default; }
.wz-btn-secondary { background: var(--bg-3); color: var(--fg-2); border: 1px solid var(--border); padding: 9px 14px; border-radius: 8px; font-size: 13px; cursor: pointer; }
.wz-btn-secondary:hover { background: var(--bg-4); }
.wz-btn-danger { background: #dc2626; color: #fff; border: none; padding: 9px 18px; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; }
.wz-btn-danger:hover { opacity: .88; }
.wz-ai-note { background: var(--bg-2); border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: 8px; padding: 10px 12px; font-size: 12px; color: var(--fg-2); margin-bottom: 14px; line-height: 1.6; }
.wz-warn { background: #fffbeb; border: 1px solid #fbbf24; border-radius: 8px; padding: 10px 12px; font-size: 12px; color: #92400e; margin-top: 8px; line-height: 1.6; }
@media (prefers-color-scheme: dark) { .wz-warn { background: #2d2308; color: #fde68a; } }
:root[data-theme="dark"] .wz-warn { background: #2d2308; color: #fde68a; }

/* Goal picker */
.wz-goal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 16px; }
.wz-goal-card { border: 1px solid var(--border); border-radius: 10px; padding: 14px 12px; cursor: pointer; text-align: center; transition: border-color .15s, background .15s; }
.wz-goal-card:hover { border-color: var(--accent); background: var(--bg-2); }
.wz-goal-card.selected { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.wz-goal-icon { font-size: 22px; margin-bottom: 6px; }
.wz-goal-label { font-size: 13px; font-weight: 700; color: var(--fg); margin-bottom: 3px; }
.wz-goal-desc { font-size: 11px; color: var(--fg-3); }

/* Toggle switch */
.wz-toggle-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.wz-toggle-row:last-of-type { border-bottom: none; }
.wz-toggle-info { flex: 1; }
.wz-toggle-label { font-size: 13px; font-weight: 600; color: var(--fg); margin-bottom: 2px; }
.wz-toggle-desc { font-size: 11px; color: var(--fg-3); line-height: 1.5; }
.wz-switch { position: relative; display: inline-block; width: 40px; height: 22px; flex-shrink: 0; }
.wz-switch input { opacity: 0; width: 0; height: 0; }
.wz-slider { position: absolute; inset: 0; background: var(--bg-4); border-radius: 22px; cursor: pointer; transition: background .2s; }
.wz-slider::before { content: ''; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform .2s; }
.wz-switch input:checked + .wz-slider { background: var(--accent); }
.wz-switch input:checked + .wz-slider::before { transform: translateX(18px); }
.wz-switch input:disabled + .wz-slider { opacity: .5; cursor: default; }

/* Bid strategy grid */
.wz-bid-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; margin-bottom: 14px; }
.wz-bid-card { border: 1px solid var(--border); border-radius: 9px; padding: 10px 11px; cursor: pointer; position: relative; transition: border-color .15s; }
.wz-bid-card:hover { border-color: var(--accent); }
.wz-bid-card.selected { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.wz-rec-badge { position: absolute; top: -8px; right: 8px; background: var(--accent); color: #fff; font-size: 9px; padding: 2px 6px; border-radius: 6px; font-weight: 700; text-transform: uppercase; }
.wz-bid-label { font-size: 12px; font-weight: 700; color: var(--fg); margin-bottom: 4px; }
.wz-bid-desc { font-size: 11px; color: var(--fg-3); line-height: 1.4; }
.wz-bid-fields { margin-top: 4px; }

/* Devices */
.wz-device-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.wz-device-opt { display: flex; align-items: center; gap: 6px; padding: 8px 14px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 600; }
.wz-device-opt.on { border-color: var(--accent); color: var(--accent); }
.wz-device-opt input { display: none; }

/* Keywords / headlines edit rows */
.cw-kw-row { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.cw-mt-sel { border: 1px solid var(--border); border-radius: 6px; background: var(--bg); color: var(--fg); font-size: 11px; padding: 5px 6px; flex-shrink: 0; }
.cw-kw-input { flex: 1; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); color: var(--fg); font-size: 12px; padding: 6px 8px; }
.cw-kw-input:focus { border-color: var(--accent); outline: none; }
.cw-kw-del { background: none; border: none; color: var(--fg-3); font-size: 16px; cursor: pointer; padding: 0 4px; line-height: 1; }
.cw-kw-del:hover { color: var(--red); }
.cw-neg-badge { font-size: 14px; font-weight: 700; color: var(--red); width: 18px; text-align: center; flex-shrink: 0; }
.wz-add-btn { background: none; border: 1px dashed var(--border); border-radius: 7px; color: var(--fg-3); font-size: 12px; padding: 6px 12px; cursor: pointer; margin-top: 4px; }
.wz-add-btn:hover { border-color: var(--accent); color: var(--accent); }

/* Headlines char count */
.cw-hl-row { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.cw-hl-input { flex: 1; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); color: var(--fg); font-size: 12px; padding: 6px 8px; }
.cw-hl-input:focus { border-color: var(--accent); outline: none; }
.cw-char-count { font-size: 10px; color: var(--fg-3); width: 24px; text-align: right; flex-shrink: 0; }
.cw-char-count.over { color: var(--red); font-weight: 700; }

/* Final review */
.wz-final-warning { background: #fff1f1; border: 1px solid #fca5a5; border-radius: 9px; padding: 12px 14px; font-size: 12px; color: #7f1d1d; margin-bottom: 16px; line-height: 1.6; }
@media (prefers-color-scheme: dark) { .wz-final-warning { background: #2d0e0e; color: #fca5a5; } }
:root[data-theme="dark"] .wz-final-warning { background: #2d0e0e; color: #fca5a5; }
.wz-review-grid { border: 1px solid var(--border); border-radius: 9px; overflow: hidden; margin-bottom: 8px; }
.wz-review-row { display: flex; padding: 9px 12px; border-bottom: 1px solid var(--border); font-size: 12px; }
.wz-review-row:last-child { border-bottom: none; }
.wz-rv-k { color: var(--fg-3); width: 130px; flex-shrink: 0; }
.wz-rv-v { color: var(--fg); font-weight: 500; flex: 1; }

/* Generating spinner */
.wz-generating-wrap { display: flex; flex-direction: column; align-items: center; padding: 40px 0; gap: 14px; }
.wz-gen-title { font-size: 15px; font-weight: 700; color: var(--fg); }
.wz-gen-steps { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.wz-gen-step { font-size: 12px; color: var(--fg-3); padding-left: 20px; position: relative; }
.wz-gen-step::before { content: '○'; position: absolute; left: 0; }
.wz-gen-step.active { color: var(--fg); font-weight: 600; }
.wz-gen-step.active::before { content: '●'; color: var(--accent); }
.wz-gen-step.done { color: #22c55e; }
.wz-gen-step.done::before { content: '✓'; color: #22c55e; }

/* Error / success states */
.wz-error-msg { background: #fff1f1; border: 1px solid #fca5a5; border-radius: 9px; padding: 14px; font-size: 13px; color: #7f1d1d; margin-bottom: 14px; }
@media (prefers-color-scheme: dark) { .wz-error-msg { background: #2d0e0e; color: #fca5a5; } }
:root[data-theme="dark"] .wz-error-msg { background: #2d0e0e; color: #fca5a5; }
.wz-success-wrap { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 32px 0; }
.wz-success-icon { font-size: 44px; margin-bottom: 12px; }
.wz-success-title { font-size: 18px; font-weight: 700; color: var(--fg); margin-bottom: 8px; }
.wz-success-msg { font-size: 13px; color: var(--fg-2); margin-bottom: 6px; max-width: 420px; line-height: 1.6; }
.wz-success-note { font-size: 11px; color: var(--fg-3); max-width: 380px; line-height: 1.6; }
.wz-enable-box {
  margin-top: 16px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-2);
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 420px;
  width: 100%;
}
.wz-enable-consent {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  color: var(--fg-2);
  line-height: 1.5;
  cursor: pointer;
}
.wz-enable-consent input[type="checkbox"] { margin-top: 2px; flex-shrink: 0; }
.wz-enabled-msg { font-size: 13px; color: var(--green); font-weight: 600; padding: 4px 0; }

/* ── Conversational Campaign Wizard ──────────────────────────────────── */
#create-wizard {
  height: 100%;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  padding: 0;
}
.cw-convo {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px 16px 32px;
  max-width: 640px;
  width: 100%;
  margin: 0 auto;
}

/* Chat bubbles */
.cw-bubble { display: flex; gap: 10px; animation: cwFadeUp .25s ease both; }
.cw-bubble-ai { align-items: flex-start; }
.cw-bubble-user { flex-direction: row-reverse; }
@keyframes cwFadeUp { from { opacity:0; transform:translateY(6px); } to { opacity:1; transform:none; } }

.cw-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: #e8edf7; overflow: hidden;
  flex-shrink: 0; margin-top: 2px;
}
.cw-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cw-bubble-body { display: flex; flex-direction: column; gap: 10px; max-width: calc(100% - 42px); }
.cw-bubble-text {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 12px 12px 12px 3px;
  padding: 10px 14px; font-size: 13px; color: var(--fg); line-height: 1.55;
}
.cw-bubble-user .cw-bubble-text {
  background: var(--accent); color: #fff; border-color: transparent;
  border-radius: 12px 12px 3px 12px;
}

/* Option grid */
.cw-options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px;
}
.cw-opt-card {
  background: var(--bg-1); border: 1px solid var(--border-2);
  border-radius: 10px; padding: 11px 10px;
  cursor: pointer; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  transition: border-color .15s, background .15s;
}
.cw-opt-card:hover:not(:disabled) { border-color: var(--accent); background: var(--bg-2); }
.cw-opt-card:disabled { opacity: .5; cursor: default; }
.cw-opt-card.cw-opt-rec { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--bg-1)); }
.cw-opt-rec-badge { font-size: 9px; font-weight: 700; color: var(--accent); letter-spacing: .03em; text-transform: uppercase; }
.cw-opt-icon { font-size: 20px; }
.cw-opt-label { font-size: 12px; font-weight: 700; color: var(--fg); }
.cw-opt-desc  { font-size: 10px; color: var(--fg-3); line-height: 1.4; }

/* Custom text input row (below option grid for "Other") */
.cw-custom-input-row {
  display: flex; gap: 8px; align-items: center;
  margin-top: 4px;
}
.cw-url-row { display: flex; gap: 8px; align-items: center; }
.cw-custom-input {
  flex: 1; background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; color: var(--fg); font-size: 13px;
  padding: 9px 12px; outline: none;
}
.cw-custom-input:focus { border-color: var(--accent); }
.cw-custom-input.cw-input-error { border-color: var(--red); }
.cw-custom-submit {
  background: var(--accent); color: #fff; border: none;
  border-radius: 8px; padding: 9px 14px; font-size: 14px; font-weight: 700;
  cursor: pointer; flex-shrink: 0;
}
.cw-custom-submit:hover { opacity: .88; }

/* Generation status */
.cw-gen-status {
  background: var(--bg-1); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px 14px;
  display: flex; flex-direction: column; gap: 8px;
}
.cw-gen-item {
  display: flex; align-items: center; gap: 10px;
  font-size: 12px; color: var(--fg-3); transition: color .2s;
}
.cw-gen-item.active { color: var(--fg); font-weight: 600; }
.cw-gen-item.done   { color: var(--green); }
.cw-gen-dot {
  width: 16px; height: 16px; border-radius: 50%; flex-shrink: 0;
  background: var(--bg-4); display: flex; align-items: center;
  justify-content: center; font-size: 10px; font-weight: 700;
}
.cw-gen-dot.spinning {
  border: 2px solid var(--accent); border-top-color: transparent;
  background: transparent;
  animation: cwSpin .7s linear infinite;
}
@keyframes cwSpin { to { transform: rotate(360deg); } }

/* Review card */
.cw-review-card {
  background: var(--bg-1); border: 1px solid var(--border);
  border-radius: 12px; overflow: hidden;
}
.cw-review-warning {
  background: #fff1f1; border-bottom: 1px solid #fca5a5;
  padding: 10px 14px; font-size: 11px; color: #7f1d1d; line-height: 1.6;
}
@media (prefers-color-scheme: dark) { .cw-review-warning { background: #2d0e0e; color: #fca5a5; } }
:root[data-theme="dark"] .cw-review-warning { background: #2d0e0e; color: #fca5a5; }
.cw-review-rows { }
.cw-rv-row {
  display: flex; padding: 8px 14px;
  border-bottom: 1px solid var(--border); font-size: 12px;
}
.cw-rv-row:last-child { border-bottom: none; }
.cw-rv-k { color: var(--fg-3); width: 100px; flex-shrink: 0; }
.cw-rv-v { color: var(--fg); font-weight: 500; flex: 1; }
.cw-review-foot { padding: 12px 14px; border-top: 1px solid var(--border); }
.cw-publish-btn {
  background: #16a34a; color: #fff; border: none;
  border-radius: 8px; padding: 10px 20px; font-size: 13px; font-weight: 700;
  cursor: pointer; width: 100%;
}
.cw-publish-btn:hover { opacity: .88; }
.cw-publish-btn:disabled { opacity: .45; cursor: default; }

/* Retry/back buttons inside bubbles */
.cw-retry-btn {
  background: var(--bg-3); border: 1px solid var(--border);
  color: var(--fg-2); border-radius: 7px; padding: 6px 12px;
  font-size: 12px; cursor: pointer; margin-top: 6px;
}
.cw-retry-btn:hover { background: var(--bg-4); }

/* Review card sections (headlines, descriptions, keywords) */
.cw-review-section { border-top: 1px solid var(--border); }
.cw-review-section-hd {
  display: flex; justify-content: space-between; align-items: center;
  padding: 9px 14px; font-size: 12px; font-weight: 600; color: var(--fg-2);
  cursor: pointer; user-select: none;
}
.cw-review-section-hd:hover { background: var(--bg-2); }
.cw-rv-chevron { font-size: 10px; color: var(--fg-3); }
.cw-review-section-body { padding: 6px 14px 10px; }
.cw-rv-copy-item {
  display: flex; align-items: baseline; gap: 6px;
  font-size: 12px; color: var(--fg); padding: 4px 0;
  border-bottom: 1px solid var(--border);
}
.cw-rv-copy-item:last-child { border-bottom: none; }
.cw-rv-copy-idx { font-size: 10px; color: var(--fg-3); width: 16px; flex-shrink: 0; }
.cw-rv-copy-len { margin-left: auto; font-size: 10px; color: var(--fg-3); flex-shrink: 0; }
.cw-rv-copy-len.over { color: var(--red); font-weight: 700; }
.cw-rv-kw-grid { display: flex; flex-wrap: wrap; gap: 5px; }
.cw-rv-kw-chip {
  font-size: 11px; padding: 3px 8px; border-radius: 5px;
  background: var(--bg-3); color: var(--fg-2); border: 1px solid var(--border);
}
.cw-rv-kw-chip.exact { border-color: var(--blue); color: var(--blue); }
.cw-rv-kw-chip.phrase { border-color: var(--green); color: var(--green); }
.cw-rv-kw-chip.neg { border-color: var(--red); color: var(--red); background: var(--red-d); }
.cw-rv-kw-vol { font-size: 9px; opacity: .65; margin-left: 4px; }
.cw-rv-kw-hint { font-size: 10px; color: var(--fg-3); margin-bottom: 6px; }
.cw-kw-match { font-size: 9px; background: transparent; border: none; color: inherit; opacity: .7; cursor: pointer; padding: 0 2px; margin-left: 3px; }
.cw-kw-match:hover { opacity: 1; text-decoration: underline; }
.cw-kw-remove { font-size: 11px; background: transparent; border: none; color: inherit; opacity: .5; cursor: pointer; padding: 0 2px; margin-left: 1px; line-height: 1; }
.cw-kw-remove:hover { opacity: 1; }
.cw-rv-kw-chip { display: inline-flex; align-items: center; }
.cw-kw-add-btn { margin-top: 8px; font-size: 11px; background: transparent; border: 1px dashed var(--border-2); color: var(--fg-3); border-radius: 6px; padding: 4px 10px; cursor: pointer; }
.cw-kw-add-btn:hover { border-color: var(--accent); color: var(--accent); }
.cw-kw-add-row { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.cw-phone-row { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.cw-phone-country { background: var(--bg-2); border: 1px solid var(--border-2); color: var(--fg); border-radius: 8px; padding: 8px 6px; font-size: 12px; }
.cw-phone-num { flex: 1; }

/* Success card */
.cw-success-card {
  background: var(--bg-1); border: 1px solid var(--green);
  border-radius: 12px; padding: 16px;
}
.cw-success-title { font-size: 15px; font-weight: 700; color: var(--fg); margin-bottom: 6px; }
.cw-success-msg   { font-size: 13px; color: var(--fg-2); margin-bottom: 6px; line-height: 1.6; }
.cw-success-note  { font-size: 11px; color: var(--fg-3); line-height: 1.6; margin-bottom: 8px; }

/* ── Ad Schedule Flow ─────────────────────────────────────────────────── */
/* ── Slot question card ─────────────────────────────── */
.slot-question-card { background:var(--bg-1); border:1.5px solid var(--accent);
  border-radius:12px; padding:16px 18px 14px; max-width:520px; }
.sq-header { font-size:13px; font-weight:700; color:var(--accent); margin-bottom:6px;
  letter-spacing:.02em; }
.sq-question { font-size:14px; font-weight:600; color:var(--fg-1); margin-bottom:12px; }
.sq-chips { display:flex; flex-wrap:wrap; gap:8px; }
.sq-chip { padding:7px 14px; border-radius:8px; border:1.5px solid var(--border);
  background:var(--bg-2); color:var(--fg-1); font-size:13px; font-weight:500;
  cursor:pointer; transition:background .12s,border-color .12s; }
.sq-chip:hover { background:var(--bg-3); border-color:var(--border-2); }
.sq-chip-primary { background:var(--accent); color:#fff; border-color:var(--accent); }
.sq-chip-primary:hover { opacity:.9; }
.sq-pick-wrap { margin-top:12px; border-top:1px solid var(--border); padding-top:10px; }
.sq-pick-list { display:flex; flex-direction:column; gap:6px; max-height:180px;
  overflow-y:auto; margin-bottom:4px; }
.sq-pick-row { display:flex; align-items:center; gap:8px; font-size:13px;
  color:var(--fg-2); cursor:pointer; padding:4px 0; }
.sq-pick-row input { accent-color:var(--accent); }

/* ── Slot confirm card ──────────────────────────────── */
.slot-confirm-card { background:var(--bg-1); border:1.5px solid var(--border);
  border-radius:12px; padding:16px 18px; max-width:520px; }
.sc-header { font-size:13px; font-weight:700; color:var(--accent); margin-bottom:12px;
  letter-spacing:.02em; }
.sc-rows { display:flex; flex-direction:column; gap:8px; margin-bottom:16px; }
.sc-row { display:flex; gap:12px; align-items:baseline; font-size:13px; }
.sc-label { color:var(--fg-3); font-weight:500; min-width:90px; flex-shrink:0; }
.sc-val { color:var(--fg-1); font-weight:600; }
.sc-actions { display:flex; gap:8px; flex-wrap:wrap; }
.sc-btn-publish { padding:8px 18px; border-radius:8px; border:none;
  background:var(--accent); color:#fff; font-size:13px; font-weight:700;
  cursor:pointer; transition:opacity .12s; }
.sc-btn-publish:hover:not(:disabled) { opacity:.9; }
.sc-btn-publish:disabled { opacity:.5; cursor:not-allowed; }
.sc-btn-edit { padding:8px 14px; border-radius:8px; border:1.5px solid var(--border);
  background:transparent; color:var(--fg-2); font-size:13px; font-weight:500;
  cursor:pointer; }
.sc-btn-edit:hover { background:var(--bg-2); }
.sc-result { margin-top:10px; font-size:13px; font-weight:600; padding:8px 12px;
  border-radius:8px; }
.sc-result-ok { background:rgba(52,211,153,.12); color:#34d399; }
.sc-result-err { background:rgba(248,113,113,.1); color:#f87171; }

.schedule-card { padding:0; background:none; border:none; box-shadow:none; }
.sched-shell { background:var(--bg-1); border:1px solid var(--border); border-radius:12px;
  overflow:hidden; max-width:640px; }
.sched-head { display:flex; align-items:flex-start; gap:10px; padding:16px 18px 12px;
  border-bottom:1px solid var(--border); }
.sched-icon { font-size:20px; flex-shrink:0; line-height:1; }
.sched-title { font-size:15px; font-weight:600; color:var(--fg-1); }
.sched-sub { font-size:12px; color:var(--fg-3); margin-top:2px; }
.sched-applying-to { max-width:min(420px,100%); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.sched-loading { padding:20px 18px; color:var(--fg-3); font-size:13px; }
.sched-err { padding:16px 18px; color:var(--red); font-size:13px; }

/* Step 1 – campaign list */
.sched-selbar { display:flex; align-items:center; gap:8px; padding:10px 18px;
  border-bottom:1px solid var(--border); background:var(--bg-2); }
.sched-sel-all, .sched-sel-none { font-size:12px; color:var(--accent); background:none;
  border:none; cursor:pointer; padding:0; text-decoration:underline; }
.sched-sel-count { font-size:12px; color:var(--fg-3); margin-left:auto; }
.sched-camp-list { max-height:320px; overflow-y:auto; }
.sched-camp-row { display:flex; align-items:center; gap:10px; padding:11px 18px;
  cursor:pointer; border-bottom:1px solid var(--border); transition:background .12s; }
.sched-camp-row:hover { background:var(--bg-2); }
.sched-camp-row.selected { background:var(--accent-bg,rgba(37,99,235,.06)); }
.sched-camp-row input[type=checkbox] { flex-shrink:0; accent-color:var(--accent); width:15px; height:15px; }
.sched-camp-info { flex:1; min-width:0; }
.sched-camp-name { font-size:13px; font-weight:500; color:var(--fg-1);
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.sched-camp-meta { font-size:11px; color:var(--fg-3); margin-top:2px; }
.sched-status-dot { font-size:11px; border-radius:10px; padding:2px 8px; white-space:nowrap;
  flex-shrink:0; font-weight:500; }
.sched-status-dot.active { background:#22c55e18; color:#16a34a; }
.sched-status-dot.paused { background:#f59e0b18; color:#b45309; }
.sched-empty { padding:20px 18px; color:var(--fg-4); font-size:13px; text-align:center; }

/* Presets */
.sched-presets { display:flex; flex-wrap:wrap; gap:6px; padding:12px 18px;
  border-bottom:1px solid var(--border); background:var(--bg-2); }
.sched-preset { font-size:12px; border:1px solid var(--border); border-radius:20px;
  padding:4px 12px; background:var(--bg-1); color:var(--fg-2); cursor:pointer; transition:all .12s; }
.sched-preset:hover { border-color:var(--accent); color:var(--accent); background:var(--accent-bg,rgba(37,99,235,.06)); }

/* Step 2 – week grid */
.sched-week { display:flex; flex-direction:column; gap:0; padding:0; }
.sched-day-block { display:flex; align-items:flex-start; gap:12px; padding:10px 18px;
  border-bottom:1px solid var(--border); transition:background .1s; }
.sched-day-block:last-child { border-bottom:none; }
.sched-day-block.on { background:var(--bg-2); }
.sched-day-toggle { display:flex; align-items:center; gap:7px; cursor:pointer;
  flex-shrink:0; width:52px; }
.sched-day-toggle input { accent-color:var(--accent); width:14px; height:14px; }
.sched-day-name { font-size:13px; font-weight:600; color:var(--fg-1); }
.sched-day-times { flex:1; display:flex; flex-direction:column; gap:5px; }
.sched-time-row { display:flex; align-items:center; gap:6px; flex-wrap:wrap; }
.sched-time-sep { font-size:12px; color:var(--fg-3); }
/* 12h time picker */
.sched-tp { display:flex; align-items:center; gap:2px; }
.sched-tp-h { width:36px; padding:4px 4px; border:1px solid var(--border);
  border-radius:6px 0 0 6px; background:var(--bg-1); color:var(--fg-1);
  font-size:12px; text-align:center; border-right:none; }
.sched-tp-min { padding:4px 4px; border:1px solid var(--border); border-left:none; border-right:none;
  background:var(--bg-1); color:var(--fg-1); font-size:12px; cursor:pointer; width:38px; text-align:center; }
.sched-tp-ampm { padding:4px 5px; border:1px solid var(--border); border-radius:0 6px 6px 0;
  background:var(--bg-1); color:var(--fg-1); font-size:12px; cursor:pointer; }
.sched-rm-win { background:none; border:none; color:var(--fg-4); font-size:16px;
  cursor:pointer; line-height:1; padding:0 2px; }
.sched-rm-win:hover { color:var(--red); }
.sched-add-win { background:none; border:none; color:var(--accent); font-size:11px;
  cursor:pointer; padding:0; text-decoration:underline; margin-top:3px; display:block; }
.sched-all-day { font-size:11px; color:var(--fg-3); font-style:italic; display:inline; }
.sched-off-label { font-size:11px; color:var(--fg-4); font-style:italic; }
.sched-confirm-off { font-size:11px; color:var(--fg-3); margin-top:6px; padding-top:6px;
  border-top:1px dashed var(--border); }
.sched-hint { padding:8px 18px; font-size:11px; color:var(--fg-4);
  border-top:1px solid var(--border); background:var(--bg-2); }

/* Step 3 – confirm */
.sched-confirm-section { padding:10px 18px 6px; border-bottom:1px solid var(--border); }
.sched-confirm-section:last-of-type { border-bottom:none; }
.sched-confirm-label { font-size:11px; font-weight:600; color:var(--fg-3);
  text-transform:uppercase; letter-spacing:.04em; margin-bottom:6px; }
.sched-confirm-camp { font-size:13px; color:var(--fg-1); padding:2px 0; }
.sched-confirm-sched { font-size:13px; color:var(--fg-1); padding:2px 0; }

/* Footer buttons */
.sched-foot { display:flex; gap:8px; padding:14px 18px;
  border-top:1px solid var(--border); background:var(--bg-2); }
.sched-next { padding:8px 18px; background:var(--accent); color:#fff; border:none;
  border-radius:8px; font-size:13px; font-weight:600; cursor:pointer; }
.sched-next:disabled { opacity:.45; cursor:not-allowed; }
.sched-back { padding:8px 14px; background:none; border:1px solid var(--border);
  border-radius:8px; font-size:13px; color:var(--fg-2); cursor:pointer; }
.sched-apply { padding:8px 20px; background:#16a34a; color:#fff; border:none;
  border-radius:8px; font-size:13px; font-weight:600; cursor:pointer; }
.sched-apply:disabled { opacity:.45; cursor:not-allowed; }
.sched-success { border-color:#22c55e; }

/* Schedule card – mobile */
@media (max-width: 640px) {
  .sched-shell { max-width:100%; border-radius:10px; }
  .sched-head { padding:12px 14px 10px; }
  .sched-day-block { padding:9px 12px; gap:8px; }
  .sched-day-toggle { width:44px; }
  .sched-camp-row { padding:10px 12px; }
  .sched-selbar { padding:8px 12px; }
  .sched-presets { padding:10px 12px; gap:5px; }
  .sched-preset { font-size:11px; padding:3px 10px; }
  .sched-confirm-section { padding:10px 12px 6px; }
  .sched-foot { padding:12px 12px; flex-wrap:wrap; }
  .sched-next, .sched-apply { flex:1; text-align:center; }
  .sched-tp-h { width:36px; }
  .sched-hint { padding:6px 12px; }
}

/* ── Upgrade Gate Card ─────────────────────────────────────────────────── */
.upgrade-card { padding:0; background:none; border:none; box-shadow:none; }
.ugc-shell { background:var(--bg-1); border:1.5px solid #7c3aed44; border-radius:12px;
  overflow:hidden; max-width:560px; }
.ugc-head { display:flex; align-items:flex-start; gap:10px; padding:14px 16px 10px;
  background:linear-gradient(135deg,#7c3aed08,#2563eb08); border-bottom:1px solid var(--border); }
.ugc-lock { font-size:22px; flex-shrink:0; }
.ugc-title { font-size:14px; font-weight:600; color:var(--fg-1); }
.ugc-teaser { font-size:12px; color:var(--fg-3); margin-top:3px; }
.ugc-perks { padding:10px 16px; display:flex; flex-direction:column; gap:5px; }
.ugc-perk { font-size:12px; color:var(--fg-2); }
.ugc-perk::before { content:''; }
.ugc-foot { display:flex; align-items:center; gap:10px; padding:12px 16px;
  background:var(--bg-2); border-top:1px solid var(--border); }
.ugc-btn { padding:9px 20px; background:linear-gradient(135deg,#7c3aed,#2563eb);
  color:#fff; border:none; border-radius:8px; font-size:13px; font-weight:600; cursor:pointer; }
.ugc-btn:hover { opacity:.9; }
.ugc-dismiss { font-size:12px; color:var(--fg-4); background:none; border:none; cursor:pointer; }

/* ── Scheduled pause button in campaign list ───────────────────────────── */
.sched-camp-row { display:flex; align-items:center; gap:10px; padding:11px 18px;
  cursor:pointer; border-bottom:1px solid var(--border); transition:background .12s; }
.sched-camp-row:hover { background:var(--bg-2); }
.sched-camp-row.selected { background:var(--accent-bg,rgba(37,99,235,.06)); }
.sched-camp-check { flex-shrink:0; display:flex; align-items:center; }
.sched-camp-check input { accent-color:var(--accent); width:15px; height:15px; }
.sched-pause-btn { flex-shrink:0; background:none; border:1px solid var(--border);
  border-radius:6px; padding:3px 7px; font-size:13px; color:var(--fg-3); cursor:pointer;
  transition:all .12s; }
.sched-pause-btn:hover { border-color:var(--accent); color:var(--accent); }

/* ── Scheduled Pause Modal ──────────────────────────────────────────────── */
.sched-pause-overlay { position:fixed; inset:0; background:rgba(0,0,0,.45);
  display:flex; align-items:center; justify-content:center; z-index:9999; }
.sched-pause-box { background:var(--bg-1); border:1px solid var(--border);
  border-radius:14px; width:360px; overflow:hidden; box-shadow:0 20px 60px rgba(0,0,0,.25); }
.sched-pause-head { display:flex; align-items:flex-start; gap:10px; padding:14px 16px;
  border-bottom:1px solid var(--border); }
.sched-pause-icon { font-size:20px; flex-shrink:0; }
.sched-pause-title { font-size:14px; font-weight:600; color:var(--fg-1); }
.sched-pause-sub { font-size:12px; color:var(--fg-3); margin-top:2px;
  max-width:240px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.sched-pause-close { margin-left:auto; background:none; border:none; font-size:18px;
  color:var(--fg-4); cursor:pointer; padding:0; line-height:1; }
.sched-pause-body { padding:14px 16px; display:flex; flex-direction:column; gap:4px; }
.sched-pause-label { font-size:12px; font-weight:600; color:var(--fg-2); }
.sched-pause-input { width:100%; padding:8px 10px; border:1px solid var(--border);
  border-radius:8px; background:var(--bg-2); color:var(--fg-1); font-size:13px;
  margin-top:4px; box-sizing:border-box; }
.sched-pause-foot { display:flex; gap:8px; padding:12px 16px;
  border-top:1px solid var(--border); background:var(--bg-2); }
.sched-pause-confirm { padding:8px 18px; background:#16a34a; color:#fff; border:none;
  border-radius:8px; font-size:13px; font-weight:600; cursor:pointer; }
.sched-pause-confirm:disabled { opacity:.5; cursor:not-allowed; }
.sched-pause-cancel { padding:8px 14px; background:none; border:1px solid var(--border);
  border-radius:8px; font-size:13px; color:var(--fg-2); cursor:pointer; }
.sched-pause-success { display:flex; align-items:center; gap:8px; padding:10px 14px;
  background:#22c55e12; border:1px solid #22c55e44; border-radius:10px;
  font-size:13px; color:#16a34a; }
.sched-pause-success-icon { font-size:16px; }

/* Prefill banner in schedule picker */
.sched-prefill-banner { padding:9px 18px; font-size:12px; color:#1d4ed8;
  background:#dbeafe; border-bottom:1px solid #bfdbfe; }

/* ── Audit Card ──────────────────────────────────────────────────────────── */
.aud-shell { background:var(--bg-1); border:1px solid var(--border); border-radius:12px;
  overflow:hidden; max-width:680px; }
.aud-head { display:flex; align-items:center; gap:10px; padding:14px 18px 12px;
  border-bottom:1px solid var(--border); }
.aud-icon { font-size:20px; flex-shrink:0; }
.aud-title { font-size:15px; font-weight:600; color:var(--fg-1); }
.aud-sub { font-size:12px; color:var(--fg-3); margin-top:2px; }

.aud-section { border-bottom:1px solid var(--border); }
.aud-section:last-child { border-bottom:none; }
.aud-section-title { font-size:11px; font-weight:600; color:var(--fg-3); text-transform:uppercase;
  letter-spacing:.06em; padding:10px 18px 6px; }
.aud-empty { padding:8px 18px 12px; font-size:13px; color:var(--fg-4); }

/* Priority actions */
.aud-action-row { display:flex; align-items:center; gap:10px; padding:8px 18px;
  border-bottom:1px solid var(--border); }
.aud-action-row:last-child { border-bottom:none; }
.aud-action-icon { font-size:16px; flex-shrink:0; }
.aud-action-body { flex:1; min-width:0; }
.aud-action-label { font-size:13px; font-weight:500; color:var(--fg-1); display:flex; align-items:center; gap:8px; }
.aud-action-pri { font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:.05em; }
.aud-action-detail { font-size:12px; color:var(--fg-3); margin-top:2px; line-height:1.5; }
.aud-action-empty { padding:8px 18px 12px; font-size:13px; color:#22c55e; }
.aud-fix-btn {
  flex-shrink: 0;
  padding: 5px 11px;
  border-radius: 7px;
  border: 1px solid rgba(79,142,247,.35);
  background: rgba(79,142,247,.08);
  color: #7ab4fa;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, border-color .15s;
}
.aud-fix-btn:hover { background: rgba(79,142,247,.18); border-color: rgba(79,142,247,.6); }
.aud-fix-btn--locked { border-color: rgba(255,255,255,.12); color: var(--fg-3); background: transparent; }
.aud-fix-btn--locked:hover { background: rgba(255,255,255,.04); }

/* IS bars */
.aud-is-row { padding:8px 18px; border-bottom:1px solid var(--border); }
.aud-is-row:last-child { border-bottom:none; }
.aud-paused-details { padding:0 18px 8px; }
.aud-paused-summary { font-size:11px; color:var(--fg-3); cursor:pointer; list-style:none; padding:6px 0; }
.aud-paused-summary::-webkit-details-marker { display:none; }
.aud-paused-summary::before { content:'▶ '; font-size:9px; }
details[open] .aud-paused-summary::before { content:'▼ '; }
.aud-is-row--paused .aud-is-bar-wrap { background:var(--bg-3,#f0f0f0); }
.aud-is-name { font-size:12px; font-weight:500; color:var(--fg-1); margin-bottom:5px;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.aud-is-bar-wrap { position:relative; background:var(--bg-2); border-radius:4px; height:8px;
  margin-bottom:4px; overflow:hidden; }
.aud-is-bar { height:100%; border-radius:4px; transition:width .3s; }
.aud-is-lbl { position:absolute; right:4px; top:-1px; font-size:10px; color:var(--fg-3); }
.aud-is-pills { display:flex; gap:4px; flex-wrap:wrap; }

/* QS chart */
.aud-qs-chart { display:flex; align-items:flex-end; gap:4px; padding:8px 18px 4px;
  height:64px; }
.aud-qs-col { display:flex; flex-direction:column; align-items:center; gap:2px; flex:1; }
.aud-qs-bar { width:100%; border-radius:3px 3px 0 0; min-height:2px; transition:height .3s; }
.aud-qs-num { font-size:10px; color:var(--fg-3); }
.aud-qs-legend { display:flex; gap:12px; flex-wrap:wrap; padding:4px 18px 10px;
  font-size:11px; color:var(--fg-3); }
.aud-qs-dot { display:inline-block; width:8px; height:8px; border-radius:50%; margin-right:3px; }

/* Device */
.aud-dev-row { display:flex; align-items:center; gap:10px; padding:7px 18px;
  border-bottom:1px solid var(--border); font-size:12px; }
.aud-dev-row:last-child { border-bottom:none; }
.aud-dev-icon { font-size:15px; flex-shrink:0; }
.aud-dev-name { font-weight:500; color:var(--fg-1); width:72px; }
.aud-dev-stat { color:var(--fg-2); width:88px; }

/* Call */
.aud-call-row { display:flex; align-items:center; justify-content:space-between;
  padding:7px 18px; border-bottom:1px solid var(--border); font-size:12px; }
.aud-call-row:last-child { border-bottom:none; }
.aud-call-name { color:var(--fg-1); font-weight:500; flex:1; min-width:0;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.aud-call-cnt { color:var(--fg-3); flex-shrink:0; margin-left:8px; }
.aud-call-empty { padding:8px 18px 12px; font-size:12px; color:var(--fg-4); }

/* Shared pills */
.aud-pill { font-size:10px; font-weight:600; border-radius:10px; padding:2px 7px; }
.aud-pill.red    { background:rgba(239,68,68,.12);  color:#dc2626; }
.aud-pill.amber  { background:rgba(245,158,11,.12); color:#b45309; }
.aud-pill.blue   { background:rgba(59,130,246,.12); color:#2563eb; }
.aud-pill.green  { background:rgba(34,197,94,.12);  color:#16a34a; }

/* Mobile */
@media (max-width: 640px) {
  .aud-shell { border-radius:10px; }
  .aud-head, .aud-section-title, .aud-action-row, .aud-is-row,
  .aud-dev-row, .aud-call-row { padding-left:12px; padding-right:12px; }
  .aud-qs-chart { padding-left:12px; padding-right:12px; }
  .aud-qs-legend { padding-left:12px; }
  .aud-dev-name { width:56px; }
  .aud-dev-stat { width:72px; }
}

/* ── Profile menu ──────────────────────────────────────────────────── */
.sb-footer { position: relative; flex-direction: column; align-items: stretch; gap: 0; }
.user-row { padding: 6px 4px; border-radius: var(--r-md); transition: background .15s; }
.user-row:hover { background: var(--bg-2); }
.profile-chevron { margin-left: auto; color: var(--fg-3); flex-shrink: 0; }

/* Plan ring on avatar */
.plan-ring-pro  { box-shadow: 0 0 0 2px var(--blue); }
.plan-ring-agency { box-shadow: 0 0 0 2px #a855f7; }
.plan-ring-free { box-shadow: none; }

/* Popup menu */
.profile-menu {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0; right: 0;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,.18);
  z-index: 2000;
  overflow: visible;
  display: none;
  min-width: 220px;
}
.profile-menu.open { display: block; }

.pm-header {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 14px 10px;
}
.pm-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), #a855f7);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.pm-header-info { min-width: 0; }
.pm-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pm-email { font-size: 11px; color: var(--fg-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.pm-divider { height: 1px; background: var(--border); margin: 4px 0; }

.pm-plan-row {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px; cursor: pointer; transition: background .12s;
}
.pm-plan-row:hover { background: var(--bg-2); }
.pm-plan-badge {
  font-size: 10px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; border-radius: 5px; padding: 2px 7px;
}
.pm-plan-pro    { background: var(--blue); color: #fff; }
.pm-plan-agency { background: #a855f7; color: #fff; }
.pm-plan-free   { background: var(--bg-3); color: var(--fg-2); border: 1px solid var(--border); }
.pm-plan-label  { font-size: 12px; color: var(--fg-2); }

.pm-usage-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 14px 8px;
}
.pm-usage-label { font-size: 11px; color: var(--fg-3); }
.pm-usage-val   { font-size: 11px; font-weight: 600; color: var(--fg-2); }

.pm-item {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 14px; font-size: 13px; color: var(--fg-2);
  cursor: pointer; transition: background .12s; width: 100%;
  background: none; border: none; text-align: left;
}
.pm-item:hover { background: var(--bg-2); color: var(--fg); }
.pm-item svg { flex-shrink: 0; opacity: .7; }

#pm-theme-item { position: relative; }

.pm-theme-dropdown {
  position: absolute;
  right: 10px; bottom: calc(100% + 4px);
  background: var(--bg-3);
  border: 1px solid var(--border-2, var(--border));
  border-radius: 9px;
  padding: 4px;
  display: flex; flex-direction: column; gap: 2px;
  z-index: 3000;
  min-width: 120px;
  box-shadow: 0 -4px 24px rgba(0,0,0,.3), 0 2px 8px rgba(0,0,0,.2);
}
.pm-theme-dropdown[hidden] { display: none; }
.pm-theme-opt {
  width: 100%; text-align: left;
  font-size: 13px; padding: 7px 12px; border-radius: 6px;
  background: transparent; border: none;
  color: var(--fg-2); cursor: pointer; transition: background .1s, color .1s;
  white-space: nowrap; font-family: inherit;
}
.pm-theme-opt:hover { background: rgba(255,255,255,.06); color: var(--fg); }
.pm-theme-opt.active { color: var(--fg); font-weight: 500; }
.pm-theme-opt[data-t="premium"] {
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-size: 15px;
  letter-spacing: -.01em;
}

.pm-logout { color: var(--red) !important; }
.pm-logout:hover { background: var(--red-d) !important; }

/* ── PLG upsell gates ──────────────────────────────────────────────── */

/* Value hook in upgrade card */
.ugc-value-hook {
  font-size: 13px; font-weight: 600;
  color: #22c55e; margin-top: 3px;
}

/* Diagnosis card gate row */
.diag-gate-row {
  display: flex; align-items: center; gap: 8px;
  background: rgba(99,102,241,.07); border: 1px solid rgba(99,102,241,.2);
  border-radius: 8px; padding: 10px 14px;
}
.diag-gate-lock { font-size: 16px; flex-shrink: 0; }
.diag-gate-label { font-size: 13px; color: var(--fg-2); flex: 1; }
.diag-gate-btn {
  flex-shrink: 0; background: var(--blue); color: #fff;
  border: none; border-radius: 6px; padding: 6px 12px;
  font-size: 12px; font-weight: 600; cursor: pointer;
  transition: opacity .15s;
}
.diag-gate-btn:hover { opacity: .85; }

/* Cleanup card gate overlay row */
.cleanup-gate-row td { padding: 0; }
.cleanup-gate-overlay {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  background: linear-gradient(to bottom, transparent, var(--bg-2) 30%);
  border-top: 1px dashed var(--border);
}
.cleanup-gate-lock { font-size: 18px; flex-shrink: 0; }
.cleanup-gate-text { flex: 1; font-size: 13px; color: var(--fg-2); }
.cleanup-gate-btn {
  flex-shrink: 0; background: var(--blue); color: #fff;
  border: none; border-radius: 6px; padding: 7px 14px;
  font-size: 12px; font-weight: 600; cursor: pointer;
  transition: opacity .15s;
}
.cleanup-gate-btn:hover { opacity: .85; }

/* Input upgrade strip */
.input-upgrade-strip {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 14px;
  background: rgba(99,102,241,.06);
  border-top: 1px solid rgba(99,102,241,.15);
  border-bottom: 1px solid rgba(99,102,241,.1);
}
.ius-text { flex: 1; font-size: 12px; color: var(--fg-2); }
.ius-btn {
  flex-shrink: 0; background: var(--blue); color: #fff;
  border: none; border-radius: 6px; padding: 5px 12px;
  font-size: 12px; font-weight: 600; cursor: pointer;
  transition: opacity .15s;
}
.ius-btn:hover { opacity: .85; }
.ius-dismiss {
  flex-shrink: 0; background: none; border: none;
  color: var(--fg-4); font-size: 13px; cursor: pointer;
  padding: 2px 4px; border-radius: 4px;
  transition: color .12s;
}
.ius-dismiss:hover { color: var(--fg-2); }

/* ── Change Log drawer ─────────────────────────────────────────────── */
.changelog-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.35);
  z-index: 999; transition: opacity .2s;
}
.changelog-overlay.hidden { display: none; }
.changelog-drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 420px; max-width: 100vw;
  background: var(--bg); border-left: 1px solid var(--border);
  display: flex; flex-direction: column;
  z-index: 1000; transform: translateX(0);
  transition: transform .22s cubic-bezier(.4,0,.2,1);
  box-shadow: -4px 0 24px rgba(0,0,0,.18);
}
.changelog-drawer.hidden { display: none; }
.cl-header {
  display: flex; align-items: center; gap: 8px;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.cl-title { font-size: 14px; font-weight: 700; color: var(--fg); flex: 1; }
.cl-download {
  display: flex; align-items: center; gap: 4px;
  font-size: 12px; color: var(--fg-3); text-decoration: none;
  padding: 4px 8px; border: 1px solid var(--border); border-radius: 6px;
  transition: color .15s, border-color .15s;
}
.cl-download:hover { color: var(--blue); border-color: var(--blue); }
.cl-close {
  background: none; border: none; color: var(--fg-3);
  font-size: 14px; cursor: pointer; padding: 4px 6px;
  border-radius: 4px; transition: background .12s;
}
.cl-close:hover { background: var(--bg-3); color: var(--fg); }
.cl-body { flex: 1; overflow-y: auto; padding: 12px 0; }
.cl-loading { color: var(--fg-3); font-size: 13px; padding: 24px 16px; }
.cl-empty   { color: var(--fg-3); font-size: 13px; padding: 24px 16px; text-align: center; }
.cl-entry {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 16px; border-bottom: 1px solid var(--bg-3);
  transition: background .1s;
}
.cl-entry:hover { background: var(--bg-2); }
.cl-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
  margin-top: 4px;
}
.cl-dot.ok      { background: #22c55e; }
.cl-dot.partial { background: #f59e0b; }
.cl-dot.failed  { background: #ef4444; }
.cl-info { flex: 1; min-width: 0; }
.cl-label  { font-size: 13px; font-weight: 600; color: var(--fg); }
.cl-detail { font-size: 11px; color: var(--fg-3); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cl-meta   { font-size: 11px; color: var(--fg-4); margin-top: 2px; }

/* Campaign Status Card */
.campaign-status-card { background: var(--bg-2); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; max-width: 520px; }
.cs-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.cs-title  { font-size: 13px; font-weight: 700; color: var(--fg); }
.cs-summary { font-size: 11px; color: var(--fg-3); }
.cs-row    { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--bg-3); }
.cs-row:last-child { border-bottom: none; }
.cs-name   { font-size: 12px; font-weight: 600; color: var(--fg); flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 5px; }
.cs-meta   { font-size: 11px; color: var(--fg-3); white-space: nowrap; }
.cs-action { flex-shrink: 0; }
.cs-btn { border: none; border-radius: 5px; font-size: 11px; font-weight: 600; padding: 4px 10px; cursor: pointer; transition: opacity .15s; }
.cs-btn:disabled { opacity: .5; cursor: default; }
.cs-btn--pause  { background: rgba(239,68,68,.12); color: #ef4444; }
.cs-btn--pause:hover  { background: rgba(239,68,68,.2); }
.cs-btn--enable { background: rgba(34,197,94,.12); color: #22c55e; }
.cs-btn--enable:hover { background: rgba(34,197,94,.2); }

/* Inline chat action buttons (e.g. Publish Campaign) */
.chat-action-btn { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; padding: 8px 16px; border: none; border-radius: 7px; background: var(--accent, #6366f1); color: #fff; font-size: 13px; font-weight: 600; cursor: pointer; transition: opacity .15s; }
.chat-action-btn:hover { opacity: .88; }
.chat-action-btn:disabled { opacity: .5; cursor: default; }

/* ── Generative UI Components ─────────────────────────────────────────────── */

/* Component stream-in animation */
.genui-comp { animation: genui-in .35s ease both; }
@keyframes genui-in { from { opacity:0; transform:translateY(6px); } to { opacity:1; transform:translateY(0); } }

/* MetricRow */
.gui-metric-row { display:grid; grid-template-columns:repeat(3,1fr); gap:1px; background:var(--border); border:1px solid var(--border); border-radius:12px; overflow:visible; margin-top:4px; }
.gui-metric-cell { background:var(--bg-2); padding:13px 14px; }
.gui-metric-cell:first-child { border-radius:11px 0 0 11px; }
.gui-metric-cell:last-child  { border-radius:0 11px 11px 0; }
.gui-metric-label { font-size:10px; font-weight:700; letter-spacing:.08em; text-transform:uppercase; color:var(--fg-3); margin-bottom:4px; }
.gui-metric-val { font-size:20px; font-weight:800; letter-spacing:-.02em; font-variant-numeric:tabular-nums; color:var(--fg); }
.gui-metric-delta { font-size:11px; font-weight:700; margin-top:3px; }
.gui-delta-bad  { color:#f87171; }
.gui-delta-good { color:#34d399; }
.gui-delta-neu  { color:var(--fg-3); }

/* TrendChart */
.gui-chart-wrap { background:var(--bg-2); border:1px solid var(--border); border-radius:12px; padding:13px 14px 10px; margin-top:4px; }
.gui-chart-title { font-size:11px; font-weight:700; color:var(--fg-3); margin-bottom:8px; letter-spacing:.03em; text-transform:uppercase; }
.gui-chart-svg { width:100%; height:110px; display:block; overflow:visible; }

/* SearchTermTriage */
.gui-triage-wrap { background:var(--bg-2); border:1px solid var(--border); border-radius:12px; overflow:hidden; margin-top:4px; }
.gui-triage-label { font-size:10px; font-weight:700; letter-spacing:.08em; text-transform:uppercase; color:var(--fg-3); padding:11px 14px 6px; }
.gui-triage-hdr { display:grid; grid-template-columns:1fr 54px 62px 88px; gap:6px; padding:6px 14px; font-size:10px; font-weight:700; letter-spacing:.06em; text-transform:uppercase; color:var(--fg-4); border-bottom:1px solid var(--border); }
.gui-triage-row { display:grid; grid-template-columns:1fr 54px 62px 88px; gap:6px; padding:9px 14px; align-items:center; border-bottom:1px solid var(--bg-3); transition:background .12s; }
.gui-triage-row:last-child { border-bottom:none; }
.gui-triage-row.gui-struck { opacity:.38; }
.gui-triage-row.gui-struck .gui-term { text-decoration:line-through; }
.gui-term { font-size:12px; font-weight:500; color:var(--fg); min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.gui-tnum { font-size:12px; font-weight:600; font-variant-numeric:tabular-nums; color:var(--fg-3); text-align:right; }
.gui-tcpa { color:#f87171; font-weight:700; }
.gui-btn-neg { padding:4px 9px; border-radius:100px; border:1.5px solid #f87171; background:transparent; color:#f87171; font-size:11px; font-weight:700; font-family:inherit; cursor:pointer; transition:background .12s,color .12s; white-space:nowrap; }
.gui-btn-neg:hover { background:#f87171; color:#fff; }
.gui-btn-neg.gui-done { border-color:var(--fg-3); color:var(--fg-3); pointer-events:none; }
.gui-btn-neg--confirm { background:#f87171; color:#fff; border-color:#f87171; min-width:190px; }
.gui-triage-footer { padding:9px 14px; font-size:12px; color:#34d399; font-weight:700; display:none; }
.gui-triage-footer.show { display:block; }

/* ActionCard */
.gui-action-card { background:var(--bg-2); border:1px solid rgba(79,142,247,.22); border-radius:12px; overflow:hidden; margin-top:4px; background:linear-gradient(135deg,rgba(79,142,247,.05) 0%,var(--bg-2) 60%); }
.gui-action-body { padding:15px 15px 14px; }
.gui-action-icon { font-size:18px; margin-bottom:7px; }
.gui-action-title { font-size:14px; font-weight:800; color:var(--fg); margin-bottom:3px; }
.gui-action-desc { font-size:13px; color:var(--fg-3); line-height:1.55; }
.gui-action-changes { margin:10px 0 0; display:flex; flex-direction:column; gap:3px; }
.gui-action-change { font-size:12px; font-weight:600; color:var(--fg-3); display:flex; align-items:center; gap:5px; }
.gui-action-change::before { content:'→'; color:var(--blue); }
.gui-action-btns { display:flex; gap:8px; margin-top:13px; }
.gui-btn-publish { flex:1; padding:9px; border-radius:9px; border:none; background:var(--blue); color:#fff; font-size:13px; font-weight:700; font-family:inherit; cursor:pointer; transition:opacity .15s; }
.gui-btn-publish:hover { opacity:.85; }
.gui-btn-publish.gui-done { background:#34d399; color:#08080b; pointer-events:none; }
.gui-btn-publish--confirm { background:#e05a1e; font-size:12px; }
.gui-btn-dismiss { padding:9px 14px; border-radius:9px; border:1.5px solid var(--fg-3); background:transparent; color:var(--fg-3); font-size:13px; font-weight:700; font-family:inherit; cursor:pointer; transition:all .15s; }
.gui-btn-dismiss:hover { border-color:var(--fg); color:var(--fg); }
.gui-btn-dismiss:disabled { opacity:.3; pointer-events:none; }
.gui-action-result { margin-top:9px; font-size:13px; font-weight:700; color:#34d399; display:none; }
.gui-action-result.show { display:block; }
.gui-action-card--historic { opacity:.82; }
.operate-ctx-banner { display:flex; align-items:center; gap:8px; padding:8px 12px; background:var(--blue-bg,rgba(59,130,246,.1)); border:1px solid var(--blue-border,rgba(59,130,246,.25)); border-radius:8px; margin-bottom:14px; font-size:13px; color:var(--fg-2); }
.operate-ctx-icon { font-size:16px; flex-shrink:0; }
.budget-row--presel { background:var(--blue-bg,rgba(59,130,246,.07)); border-radius:6px; }
.budget-suggested { font-size:11px; color:var(--blue,#3b82f6); font-style:italic; margin-right:4px; }
@keyframes health-pulse {
  0%   { background: rgba(245,158,11,.18); border-radius:6px; }
  75%  { background: rgba(245,158,11,.18); border-radius:6px; }
  100% { background: transparent; }
}
.health-highlight { animation: health-pulse 1.9s ease-out forwards; }
.gui-action-expired { font-size:12px; color:var(--fg-4); font-style:italic; margin-top:4px; }
.genui-history-label { font-size:10px; font-weight:700; letter-spacing:.06em; text-transform:uppercase; color:var(--fg-4); margin-bottom:8px; }
.genui-text { font-size:13px; color:var(--fg-2); line-height:1.65; margin-top:4px; }
.genui-text p { margin:4px 0; }
.genui-stale-banner { font-size:11px; color:var(--fg-3); background:rgba(251,191,36,.08); border:1px solid rgba(251,191,36,.2); border-radius:7px; padding:5px 10px; margin-top:8px; }
.genui-stale-banner--locked { background:rgba(239,68,68,.07); border-color:rgba(239,68,68,.2); color:#dc2626; }

/* ── DailyPulse GenUI component ─────────────────────────────────────── */
.dp-card { background:var(--bg-2); border:1px solid var(--border); border-radius:12px; overflow:hidden; margin-top:4px; }
.dp-header { display:flex; align-items:center; justify-content:space-between; padding:9px 14px; border-bottom:1px solid var(--border); }
.dp-header-left { display:flex; align-items:center; gap:7px; }
.dp-dot { width:7px; height:7px; border-radius:50%; background:var(--green); box-shadow:0 0 5px var(--green); flex-shrink:0; }
.dp-period { font-size:11px; font-weight:700; color:var(--fg-3); text-transform:uppercase; letter-spacing:.07em; }
.dp-body { display:grid; grid-template-columns:auto 1fr; gap:0; align-items:start; }
.dp-hero { padding:16px 14px 16px 16px; border-right:1px solid var(--border); display:flex; flex-direction:column; gap:3px; }
.dp-hero-label { font-size:10px; font-weight:700; letter-spacing:.1em; text-transform:uppercase; color:var(--fg-3); }
.dp-hero-num { font-size:44px; font-weight:800; line-height:1; letter-spacing:-.03em; font-variant-numeric:tabular-nums; }
.dp-hero--zero .dp-hero-num { color:var(--fg-3); }
.dp-hero--active .dp-hero-num { color:var(--green); }
.dp-hero-delta { font-size:11px; margin-top:2px; }
.dp-delta--up   { color:var(--green); font-weight:600; }
.dp-delta--down { color:var(--red);   font-weight:600; }
.dp-delta--neu  { color:var(--fg-3);  font-weight:500; }
.dp-metrics { display:flex; flex-wrap:wrap; padding:10px 14px; gap:0; align-content:start; }
.dp-metric { display:flex; flex-direction:column; gap:2px; padding:5px 12px 5px 0; min-width:70px; }
.dp-metric-label { font-size:10px; color:var(--fg-3); text-transform:uppercase; letter-spacing:.07em; font-weight:500; }
.dp-metric-value { font-size:15px; font-weight:700; font-variant-numeric:tabular-nums; color:var(--fg); }
.dp-metric--spend .dp-metric-value { color:var(--amber); }
@media (max-width:480px) { .dp-body { grid-template-columns:1fr; } .dp-hero { border-right:none; border-bottom:1px solid var(--border); } }

/* ── HealthCard ─────────────────────────────────────────────────────────── */
.hc-card { background:var(--bg-2); border:1px solid var(--border); border-radius:12px; overflow:hidden; margin-top:4px; }
.hc-header { display:flex; align-items:center; justify-content:space-between; padding:12px 14px 10px; border-bottom:1px solid var(--border); }
.hc-title { font-size:13px; font-weight:800; color:var(--fg); }
.hc-score-pill { display:flex; align-items:center; gap:6px; background:var(--bg-3); border-radius:20px; padding:4px 12px; }
.hc-score-num { font-size:18px; font-weight:900; font-variant-numeric:tabular-nums; line-height:1; }
.hc-score-label { font-size:10px; font-weight:600; text-transform:uppercase; letter-spacing:.06em; color:var(--fg-3); }
.hc-score--good .hc-score-num { color:var(--green); }
.hc-score--warn .hc-score-num { color:var(--amber); }
.hc-score--poor .hc-score-num { color:#ef4444; }
.hc-bar-wrap { padding:10px 14px 0; display:flex; align-items:center; gap:8px; }
.hc-bar-track { flex:1; height:6px; background:var(--bg-3); border-radius:3px; overflow:hidden; }
.hc-bar-fill { height:100%; border-radius:3px; }
.hc-bar-fill--good { background:var(--green); }
.hc-bar-fill--warn { background:var(--amber); }
.hc-bar-fill--poor { background:#ef4444; }
.hc-bar-pct { font-size:11px; font-weight:700; min-width:36px; text-align:right; color:var(--fg-2); }
.hc-checks { padding:8px 0; }
.hc-check { display:flex; align-items:flex-start; gap:10px; padding:8px 14px; border-bottom:1px solid var(--border); }
.hc-check:last-child { border-bottom:none; }
.hc-check-icon { width:18px; height:18px; border-radius:50%; display:flex; align-items:center; justify-content:center; flex-shrink:0; margin-top:1px; font-size:10px; font-weight:900; }
.hc-icon--pass { background:rgba(34,197,94,.15); color:#16a34a; }
.hc-icon--warn { background:rgba(251,191,36,.15); color:#d97706; }
.hc-icon--fail { background:rgba(239,68,68,.12); color:#dc2626; }
.hc-check-body { flex:1; min-width:0; }
.hc-check-label { font-size:12px; font-weight:700; color:var(--fg); }
.hc-check-detail { font-size:11px; color:var(--fg-3); margin-top:2px; line-height:1.4; }
.hc-check-tag { display:inline-block; font-size:9px; font-weight:700; border-radius:3px; padding:1px 6px; text-transform:uppercase; letter-spacing:.04em; margin-left:6px; vertical-align:middle; }
.hc-tag--pass { background:rgba(34,197,94,.12); color:#16a34a; }
.hc-tag--warn { background:rgba(251,191,36,.12); color:#d97706; }
.hc-tag--fail { background:rgba(239,68,68,.10); color:#dc2626; }
.hc-footer { font-size:10px; color:var(--fg-3); padding:6px 14px; border-top:1px solid var(--border); }

/* ── ActionsBoard ───────────────────────────────────────────────────────── */
.ab-card { background:var(--bg-2); border:1px solid var(--border); border-radius:12px; overflow:hidden; margin-top:4px; }
.ab-header { display:flex; align-items:center; justify-content:space-between; padding:12px 14px 10px; border-bottom:1px solid var(--border); }
.ab-title { font-size:13px; font-weight:800; color:var(--fg); }
.ab-count { font-size:11px; color:var(--fg-3); background:var(--bg-3); border-radius:5px; padding:2px 8px; font-weight:600; }
.ab-section-label { font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:.08em; padding:10px 14px 4px; color:var(--fg-3); display:flex; align-items:center; gap:6px; }
.ab-section-label::after { content:''; flex:1; height:1px; background:var(--border); }
.ab-item { display:flex; align-items:flex-start; gap:12px; padding:10px 14px; border-bottom:1px solid var(--border); }
.ab-item:last-child { border-bottom:none; }
.ab-icon { width:32px; height:32px; border-radius:8px; display:flex; align-items:center; justify-content:center; flex-shrink:0; font-size:15px; }
.ab-icon--negatives { background:rgba(239,68,68,.10); }
.ab-icon--pause     { background:rgba(251,191,36,.10); }
.ab-icon--rsa       { background:rgba(99,102,241,.10); }
.ab-icon--budget    { background:rgba(34,197,94,.10); }
.ab-icon--tracking  { background:rgba(239,68,68,.10); }
.ab-body { flex:1; min-width:0; }
.ab-item-title { font-size:12px; font-weight:700; color:var(--fg); line-height:1.3; }
.ab-item-desc  { font-size:11px; color:var(--fg-3); margin-top:2px; line-height:1.4; }
.ab-impact { display:inline-flex; align-items:center; gap:3px; font-size:10px; font-weight:700; margin-top:5px; border-radius:4px; padding:1px 7px; }
.ab-impact--high   { background:rgba(239,68,68,.10); color:#dc2626; }
.ab-impact--medium { background:rgba(251,191,36,.10); color:#d97706; }
.ab-impact--low    { background:rgba(99,102,241,.10); color:#6366f1; }
.ab-action-btn { flex-shrink:0; background:var(--bg-3); border:1px solid var(--border); color:var(--fg-2); border-radius:7px; padding:5px 12px; font-size:11px; font-weight:600; cursor:pointer; white-space:nowrap; transition:background .12s,color .12s,border-color .12s; }
.ab-action-btn:hover { background:var(--accent); color:#fff; border-color:var(--accent); }
.ab-action-btn.ab-btn--danger:hover { background:#dc2626; border-color:#dc2626; color:#fff; }
.ab-footer { font-size:10px; color:var(--fg-3); padding:6px 14px; border-top:1px solid var(--border); }
@media (max-width:480px) { .ab-action-btn { display:none; } }

/* ── RSACard ────────────────────────────────────────────────────────────── */
.rsa-card { background:var(--bg-2); border:1px solid var(--border); border-radius:12px; overflow:hidden; margin-top:4px; }
.rsa-header { display:flex; align-items:center; justify-content:space-between; padding:12px 14px 8px; border-bottom:1px solid var(--border); }
.rsa-title { font-size:13px; font-weight:800; color:var(--fg); }
.rsa-period { font-size:11px; color:var(--fg-3); background:var(--bg-3); border-radius:5px; padding:2px 7px; }
.rsa-summary { display:flex; flex-wrap:wrap; gap:10px; padding:8px 14px; border-bottom:1px solid var(--border); }
.rsa-summary-item { display:flex; align-items:center; gap:5px; font-size:12px; color:var(--fg-2); font-weight:500; }
.rsa-summary-dot { width:8px; height:8px; border-radius:50%; flex-shrink:0; }
.rsa-warn-banner { font-size:11px; color:#d97706; background:rgba(251,191,36,.08); border-bottom:1px solid rgba(251,191,36,.2); padding:6px 14px; }
.rsa-scroll { overflow-x:auto; }
.rsa-table { width:100%; border-collapse:collapse; font-size:12px; }
.rsa-table thead tr { border-bottom:1px solid var(--border); }
.rsa-table th { padding:6px 10px; text-align:right; font-size:10px; font-weight:600; color:var(--fg-3); text-transform:uppercase; letter-spacing:.06em; white-space:nowrap; }
.rsa-table th.rsa-ag, .rsa-table th.rsa-badge-cell { text-align:left; }
.rsa-table td { padding:7px 10px; border-bottom:1px solid var(--border); vertical-align:middle; }
.rsa-table tr:last-child td { border-bottom:none; }
.rsa-table td.rsa-ag { text-align:left; min-width:130px; max-width:210px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; color:var(--fg); }
.rsa-table td.rsa-badge-cell { text-align:left; white-space:nowrap; }
.rsa-table td.rsa-spend { text-align:right; font-weight:700; font-variant-numeric:tabular-nums; color:var(--amber); }
.rsa-table td.rsa-num { text-align:right; font-variant-numeric:tabular-nums; color:var(--fg-2); }
.rsa-zero { color:var(--fg-3); }
.rsa-row--needsfix td { background:rgba(239,68,68,.04); }
.rsa-no-data { font-size:12px; color:var(--fg-3); }
.rsa-footer { font-size:10px; color:var(--fg-3); padding:6px 14px; border-top:1px solid var(--border); }
/* Strength badge colours */
.rsa-str-badge { font-size:10px; font-weight:700; border-radius:5px; padding:2px 8px; display:inline-block; }
.rsa-str--excellent { background:rgba(34,197,94,.15); color:#16a34a; }
.rsa-str--good      { background:rgba(20,184,166,.15); color:#0d9488; }
.rsa-str--average   { background:rgba(251,191,36,.15); color:#d97706; }
.rsa-str--weak      { background:rgba(249,115,22,.15); color:#ea580c; }
.rsa-str--poor      { background:rgba(239,68,68,.15); color:#dc2626; }
/* Summary dot colours mirror badge colours */
.rsa-summary-dot.rsa-str--excellent { background:#22c55e; }
.rsa-summary-dot.rsa-str--good      { background:#14b8a6; }
.rsa-summary-dot.rsa-str--average   { background:#fbbf24; }
.rsa-summary-dot.rsa-str--weak      { background:#f97316; }
.rsa-summary-dot.rsa-str--poor      { background:#ef4444; }
@media (max-width:480px) { .rsa-table td.rsa-ag { max-width:110px; } }

/* ── KeywordTable ───────────────────────────────────────────────────────── */
.kt-card { background:var(--bg-2); border:1px solid var(--border); border-radius:12px; overflow:hidden; margin-top:4px; }
.kt-header { display:flex; align-items:center; justify-content:space-between; padding:12px 14px 8px; border-bottom:1px solid var(--border); }
.kt-title { font-size:13px; font-weight:800; color:var(--fg); }
.kt-period { font-size:11px; color:var(--fg-3); background:var(--bg-3); border-radius:5px; padding:2px 7px; }
.kt-wasted-banner { font-size:11px; color:#d97706; background:rgba(251,191,36,.08); border-bottom:1px solid rgba(251,191,36,.2); padding:6px 14px; }
.kt-scroll { overflow-x:auto; }
.kt-table { width:100%; border-collapse:collapse; font-size:12px; }
.kt-table thead tr { border-bottom:1px solid var(--border); }
.kt-table th { padding:6px 10px; text-align:right; font-size:10px; font-weight:600; color:var(--fg-3); text-transform:uppercase; letter-spacing:.06em; white-space:nowrap; }
.kt-table th.kt-kw { text-align:left; }
.kt-table td { padding:7px 10px; border-bottom:1px solid var(--border); vertical-align:middle; }
.kt-table tr:last-child td { border-bottom:none; }
.kt-table td.kt-kw { text-align:left; min-width:140px; max-width:220px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; display:flex; align-items:center; gap:5px; }
.kt-table td.kt-spend { text-align:right; font-weight:700; font-variant-numeric:tabular-nums; color:var(--amber); }
.kt-table td.kt-num { text-align:right; font-variant-numeric:tabular-nums; color:var(--fg-2); }
.kt-zero { color:var(--fg-3); }
.kt-row--wasted td { background:rgba(239,68,68,.04); }
.kt-dot { display:inline-block; width:6px; height:6px; border-radius:50%; flex-shrink:0; }
.kt-dot--on  { background:var(--green); }
.kt-dot--off { background:var(--fg-3); }
.kt-badge { font-size:9px; font-weight:700; letter-spacing:.04em; border-radius:3px; padding:1px 5px; text-transform:uppercase; flex-shrink:0; }
.kt-badge--exact  { background:rgba(99,102,241,.15); color:#818cf8; }
.kt-badge--phrase { background:rgba(16,185,129,.12); color:#34d399; }
.kt-badge--broad  { background:rgba(251,191,36,.12); color:#fbbf24; }
.kt-footer { font-size:10px; color:var(--fg-3); padding:6px 14px; border-top:1px solid var(--border); }
@media (max-width:480px) { .kt-table td.kt-kw { max-width:120px; } }

/* ── CampaignTable ──────────────────────────────────────────────────────── */
/* ── CampaignTable GenUI component ─────────────────────────────────── */
.gui-camp-table-wrap { background:var(--bg-2); border:1px solid var(--border); border-radius:12px; overflow:hidden; margin-top:4px; }
.ct-header { display:flex; align-items:center; justify-content:space-between; padding:12px 14px 8px; border-bottom:1px solid var(--border); }
.ct-title { font-size:13px; font-weight:800; color:var(--fg); }
.ct-period { font-size:11px; font-weight:600; color:var(--fg-3); letter-spacing:.04em; text-transform:uppercase; }
/* scroll wrapper: relative so the fade overlay positions correctly */
.ct-scroll-wrap { position:relative; }
.ct-scroll { overflow-x:auto; -webkit-overflow-scrolling:touch; }
/* right-edge fade hint for horizontal scroll on mobile */
.ct-scroll-fade { position:absolute; top:0; right:0; bottom:0; width:32px; background:linear-gradient(to right,transparent,var(--bg-2)); pointer-events:none; opacity:0; transition:opacity .2s; border-radius:0 0 0 0; }
.gui-camp-table { width:100%; border-collapse:collapse; font-size:13px; }
.gui-camp-table th { padding:8px 10px; text-align:left; font-size:11px; font-weight:700; color:var(--fg-3); letter-spacing:.04em; text-transform:uppercase; border-bottom:1px solid var(--border); white-space:nowrap; }
.gui-camp-table th.ct-sortable { cursor:pointer; user-select:none; }
.gui-camp-table th.ct-sortable:hover { color:var(--fg); }
.gui-camp-table td { padding:9px 10px; border-bottom:1px solid var(--border-faint,rgba(0,0,0,.06)); color:var(--fg-2); vertical-align:middle; }
.gui-camp-table tr:last-child td { border-bottom:none; }
.gui-camp-table tr:hover td { background:var(--bg-3,rgba(0,0,0,.03)); }
/* name col: wider, truncates gracefully */
.ct-name { color:var(--fg); font-weight:600; max-width:260px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.ct-num { text-align:right; font-variant-numeric:tabular-nums; white-space:nowrap; }
/* Share column: secondary text, clearly readable in both themes */
.ct-share-col { min-width:60px; }
.ct-share { font-size:12px; font-weight:600; color:var(--fg-3); }
.ct-vs { min-width:120px; }
/* muted abs-diff in vs-prev — only supplementary, still readable */
.ct-muted { color:var(--fg-3); font-size:11px; margin-left:3px; font-weight:400; }
.ct-delta { font-weight:700; }
.ct-delta--pos { color:#22c55e; }
.ct-delta--neg { color:#ef4444; }
.ct-badge { display:inline-block; font-size:10px; font-weight:700; letter-spacing:.04em; text-transform:uppercase; padding:2px 6px; border-radius:4px; }
.ct-badge--new { background:rgba(34,197,94,.15); color:#16a34a; }
.ct-badge--stopped { background:rgba(239,68,68,.12); color:#dc2626; }
/* Chart/table toggle */
.ct-view-toggle { display:flex; align-items:center; gap:4px; }
.ct-toggle-btn { display:inline-flex; align-items:center; justify-content:center; width:26px; height:26px; border-radius:6px; border:1px solid var(--border); background:transparent; color:var(--fg-3); cursor:pointer; transition:background .15s, color .15s; }
.ct-toggle-btn:hover { background:var(--bg-3); color:var(--fg); }
.ct-toggle-btn--active { background:rgba(79,142,247,.12); border-color:rgba(79,142,247,.35); color:#4f8ef7; }
.ct-chart-metric { font-size:11px; padding:3px 6px; border-radius:6px; border:1px solid var(--border); background:var(--bg-2); color:var(--fg-2); cursor:pointer; margin-left:4px; }
/* Bar chart */
.ct-chart { padding:10px 14px 14px; display:flex; flex-direction:column; gap:8px; }
.ct-chart-empty { padding:20px; text-align:center; color:var(--fg-3); font-size:13px; }
.ct-chart-row { display:flex; align-items:center; gap:8px; }
.ct-chart-label { width:140px; flex-shrink:0; font-size:12px; color:var(--fg-2); font-weight:500; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; text-align:right; }
.ct-chart-bar-wrap { flex:1; display:flex; align-items:center; gap:6px; }
.ct-chart-bar { height:18px; border-radius:4px; background:rgba(79,142,247,.55); min-width:2px; transition:width .3s ease; }
.ct-chart-val { font-size:11px; font-weight:600; color:var(--fg-2); white-space:nowrap; font-variant-numeric:tabular-nums; }
/* Markdown formatting */
.bubble .md-h1 { font-size:17px; font-weight:800; color:var(--fg); margin:14px 0 6px; line-height:1.3; }
.bubble .md-h2 { font-size:15px; font-weight:700; color:var(--fg); margin:12px 0 5px; line-height:1.3; border-bottom:1px solid var(--border-faint,rgba(0,0,0,.06)); padding-bottom:4px; }
.bubble .md-h3 { font-size:13px; font-weight:700; color:var(--fg); margin:10px 0 4px; letter-spacing:.01em; }
.bubble .md-h4 { font-size:12px; font-weight:700; color:var(--fg-2); margin:8px 0 3px; text-transform:uppercase; letter-spacing:.04em; }
.bubble .md-ul, .bubble .md-ol { margin:5px 0 5px 16px; padding:0; }
.bubble .md-ul li, .bubble .md-ol li { margin:3px 0; color:var(--fg-2); line-height:1.5; }
.bubble .md-hr { border:none; border-top:1px solid var(--border); margin:10px 0; }
.bubble .md-code { font-family:ui-monospace,monospace; font-size:12px; background:rgba(0,0,0,.08); padding:1px 5px; border-radius:4px; color:var(--fg); }
.bubble .md-table-wrap { overflow-x:auto; margin:8px 0; }
.bubble .md-table { border-collapse:collapse; font-size:12px; width:100%; }
.bubble .md-table th { text-align:left; padding:6px 10px; font-size:11px; font-weight:700; color:var(--fg-3); text-transform:uppercase; letter-spacing:.04em; border-bottom:1px solid var(--border); white-space:nowrap; }
.bubble .md-table td { padding:7px 10px; border-bottom:1px solid var(--border-faint,rgba(0,0,0,.06)); color:var(--fg-2); }
.bubble .md-table tr:hover td { background:var(--bg-3,rgba(0,0,0,.03)); }
.bubble p { margin:4px 0; line-height:1.6; }
/* Copy button */
.msg-footer { display:flex; align-items:center; gap:8px; padding:2px 0 0 36px; }
.msg-copy-btn { font-size:11px; font-weight:500; color:var(--fg-3); background:none; border:1px solid var(--border); border-radius:6px; padding:3px 9px; cursor:pointer; transition:color .15s, border-color .15s; }
.msg-copy-btn:hover { color:var(--fg-2); border-color:var(--fg-3); }
/* metric swap: whole label row is the button */
.gui-metric-cell--swap { position:relative; }
/* button replaces the static label — inherits label typography */
.gui-metric-swap-btn {
  display:inline-flex; align-items:center; gap:5px;
  background:none; border:none; padding:0; margin-bottom:4px; cursor:pointer;
  font-size:10px; font-weight:700; letter-spacing:.08em; text-transform:uppercase;
  color:var(--fg-3); transition:color .15s;
}
.gui-metric-swap-btn:hover { color:var(--fg); }
.gui-metric-swap-btn:hover .gui-metric-chevron { opacity:1; }
.gui-metric-chevron { opacity:.5; flex-shrink:0; transition:opacity .15s; }
/* picker dropdown */
.gui-mr-picker { z-index:9999; min-width:140px; background:var(--bg-2); border:1px solid var(--border); border-radius:8px; box-shadow:0 6px 20px rgba(0,0,0,.22); overflow:hidden; }
.gui-mr-picker-item { display:block; width:100%; text-align:left; background:none; border:none; padding:9px 14px; font-size:13px; font-weight:500; color:var(--fg-2); cursor:pointer; transition:background .1s; }
.gui-mr-picker-item:hover { background:var(--bg-3,rgba(0,0,0,.06)); color:var(--fg); }

/* ── Smart follow-up suggestion pills ───────────────────────────────────────── */
.sugg-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 6px 0 10px 44px; /* align with bubble indent */
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .35s ease, transform .35s ease;
}
.sugg-row--visible { opacity: 1; transform: translateY(0); }

.sugg-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--fg-3);
  flex-shrink: 0;
  margin-right: 2px;
}

.sugg-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg-2);
  color: var(--fg-2);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s, transform .15s;
  /* staggered entrance */
  opacity: 0;
  transform: translateY(4px);
  animation: suggPillIn .3s ease calc(var(--i, 0) * 60ms + 100ms) forwards;
}
.sugg-pill:hover {
  background: var(--bg-3, rgba(255,255,255,.06));
  color: var(--fg);
  border-color: rgba(255,255,255,.15);
  transform: translateY(-1px);
}
.sugg-pill--action {
  border-color: rgba(79, 142, 247, .35);
  color: #7ab4fa;
}
.sugg-pill--action:hover {
  background: rgba(79, 142, 247, .1);
  border-color: rgba(79, 142, 247, .6);
  color: #a8ceff;
}
.sugg-pill--action::before { content: '⚡'; font-size: 11px; }

@keyframes suggPillIn {
  to { opacity: 1; transform: translateY(0); }
}

/* Inline confirmation state */
.sugg-confirm-msg {
  font-size: 12px;
  color: var(--fg-2);
  flex: 1;
  min-width: 0;
}
.sugg-confirm-btn {
  padding: 5px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: none;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.sugg-confirm-btn--yes {
  border-color: rgba(79,142,247,.5);
  color: #7ab4fa;
}
.sugg-confirm-btn--yes:hover { background: rgba(79,142,247,.12); }
.sugg-confirm-btn--no  { color: var(--fg-3); }
.sugg-confirm-btn--no:hover  { color: var(--fg); }

/* Light mode overrides */
@media (prefers-color-scheme: light) {
  .sugg-pill--action { border-color: rgba(37,99,235,.3); color: #2563eb; }
  .sugg-pill--action:hover { background: rgba(37,99,235,.06); border-color: rgba(37,99,235,.5); color: #1d4ed8; }
  .sugg-confirm-btn--yes { border-color: rgba(37,99,235,.4); color: #2563eb; }
}
:root[data-theme="light"] .sugg-pill--action { border-color: rgba(37,99,235,.3); color: #2563eb; }
:root[data-theme="light"] .sugg-pill--action:hover { background: rgba(37,99,235,.06); border-color: rgba(37,99,235,.5); color: #1d4ed8; }
/* ─────────────────────────────────────────────────────────────────────────── */

/* ═══════════════════════════════════════════════════════════════════
   Premium Theme  —  data-theme="premium"
   Disappearing chrome · weight as hierarchy · light as depth
═══════════════════════════════════════════════════════════════════ */
:root[data-theme="premium"] {
  --bg:      #000000;
  --bg-1:    #000000;
  --bg-2:    #000000;
  --bg-3:    #0e0e0e;
  --bg-4:    #181818;
  --bg-5:    #222222;
  --border:  rgba(255,255,255,.07);
  --border-2:rgba(255,255,255,.11);
  --border-3:rgba(255,255,255,.18);
  --fg:      #f0f0f4;
  --fg-2:    #a8a8b4;
  --fg-3:    #686878;
  --fg-4:    #333340;
  /* semantic only — no blue accent */
  --blue:    #888896;
  --blue-d:  rgba(255,255,255,.03);
  --blue-m:  rgba(255,255,255,.06);
  --blue-g:  rgba(255,255,255,.12);
  --green:   #4a9e6e;
  --green-d: rgba(74,158,110,.09);
  --red:     #d05050;
  --red-d:   rgba(208,80,80,.09);
  --amber:   #888896;
  --amber-d: rgba(255,255,255,.04);
  --shadow-sm: 0 1px 3px rgba(255,255,255,.025), inset 0 1px 0 rgba(255,255,255,.05);
  --shadow-md: 0 2px 8px rgba(255,255,255,.025), 0 8px 24px rgba(255,255,255,.02), inset 0 1px 0 rgba(255,255,255,.06);
  --shadow-lg: 0 0 0 1px rgba(255,255,255,.04), 0 4px 16px rgba(255,255,255,.03), 0 16px 48px rgba(255,255,255,.02), inset 0 1px 0 rgba(255,255,255,.07);
  --glow-blue: 0 0 0 3px rgba(255,255,255,.06);
  --r-xs:2px; --r-sm:5px; --r-md:9px; --r-lg:12px; --r-xl:16px;
  color-scheme: dark;
}

/* ── Layout & base ── */
:root[data-theme="premium"] html,
:root[data-theme="premium"] body {
  background: #000;
}

/* Scrollbar — barely visible */
:root[data-theme="premium"] ::-webkit-scrollbar { width: 3px; height: 3px; }
:root[data-theme="premium"] ::-webkit-scrollbar-track { background: transparent; }
:root[data-theme="premium"] ::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 3px; }
:root[data-theme="premium"] ::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.18); }

/* ── AI bubble ── */
:root[data-theme="premium"] .bubble {
  background: #050505;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 14px;
  padding: 20px 22px;
  font-size: 13px;
  font-weight: 300;
  line-height: 1.75;
  box-shadow:
    0 0 0 1px rgba(255,255,255,.04),
    0 2px 6px  rgba(255,255,255,.04),
    0 8px 24px rgba(255,255,255,.035),
    0 20px 56px rgba(255,255,255,.025),
    inset 0 1px 0 rgba(255,255,255,.08);
  animation: pm-fadein .35s ease both;
}
@keyframes pm-fadein {
  from { opacity: 0; transform: translateY(5px); }
  to   { opacity: 1; transform: translateY(0); }
}
:root[data-theme="premium"] .msg.user-msg .bubble {
  background: rgba(255,255,255,.04);
  border-color: rgba(255,255,255,.09);
  font-weight: 400;
  animation: none;
}

/* ── Response text formatting ── */
:root[data-theme="premium"] .bubble p {
  margin: 0 0 10px;
  color: var(--fg-2);
  font-weight: 300;
  line-height: 1.75;
}
:root[data-theme="premium"] .bubble p:first-child { color: var(--fg); }
:root[data-theme="premium"] .bubble p:last-child  { margin-bottom: 0; }
:root[data-theme="premium"] .bubble strong { font-weight: 500; color: var(--fg); }

/* Section headings — micro-label style */
:root[data-theme="premium"] .bubble .md-h1,
:root[data-theme="premium"] .bubble .md-h2,
:root[data-theme="premium"] .bubble .md-h3 {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--fg-3);
  border: none;
  padding: 0;
  margin: 20px 0 8px;
  line-height: 1.4;
}
:root[data-theme="premium"] .bubble .md-h2:first-child,
:root[data-theme="premium"] .bubble .md-h3:first-child { margin-top: 0; }
:root[data-theme="premium"] .bubble .md-h4 {
  font-size: 10px; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; color: var(--fg-3);
  margin: 14px 0 6px; border: none; padding: 0;
}

/* Lists */
:root[data-theme="premium"] .bubble .md-ul,
:root[data-theme="premium"] .bubble .md-ol {
  list-style: none; padding: 0; margin: 6px 0 12px;
  display: flex; flex-direction: column; gap: 6px;
}
:root[data-theme="premium"] .bubble .md-ul li,
:root[data-theme="premium"] .bubble .md-ol li {
  color: var(--fg-2); font-weight: 300; line-height: 1.65;
  padding-left: 14px; position: relative; margin: 0;
}
:root[data-theme="premium"] .bubble .md-ul li::before {
  content: '–'; position: absolute; left: 0;
  color: var(--fg-3); font-weight: 300;
}
:root[data-theme="premium"] .bubble .md-ol { list-style: decimal; padding-left: 16px; }
:root[data-theme="premium"] .bubble .md-ol li::before { display: none; }

/* Inline code — keyword chip style */
:root[data-theme="premium"] .bubble .md-code,
:root[data-theme="premium"] .bubble code {
  font-family: ui-monospace, 'JetBrains Mono', monospace;
  font-size: 11.5px; font-weight: 400;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 4px; padding: 1px 6px;
  color: var(--fg);
}

/* HR */
:root[data-theme="premium"] .bubble .md-hr {
  border: none; border-top: 1px solid rgba(255,255,255,.06); margin: 14px 0;
}

/* Table */
:root[data-theme="premium"] .bubble .md-table th {
  color: var(--fg-3); font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; font-size: 10px; border-bottom-color: rgba(255,255,255,.07);
}
:root[data-theme="premium"] .bubble .md-table td {
  color: var(--fg-2); font-weight: 300; border-bottom-color: rgba(255,255,255,.04);
}

/* ── Semantic classes emitted by formatMarkdown in premium mode ── */

/* .pm-insight — key finding callout block */
:root[data-theme="premium"] .bubble .pm-insight {
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 9px;
  padding: 12px 15px;
  margin: 0 0 16px;
  font-size: 12.5px; font-weight: 300; line-height: 1.7;
  color: var(--fg);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
}
:root[data-theme="premium"] .bubble .pm-insight-label {
  font-size: 10px; font-weight: 600; letter-spacing: .1em;
  text-transform: uppercase; color: var(--fg-3); margin-bottom: 5px;
}

/* .pm-kw — search term / keyword chip */
:root[data-theme="premium"] .bubble .pm-kw {
  font-family: ui-monospace, 'JetBrains Mono', monospace;
  font-size: 11.5px; font-weight: 400;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 4px; padding: 1px 6px;
  color: var(--fg); white-space: nowrap;
}

/* .pm-num — data numbers */
:root[data-theme="premium"] .bubble .pm-num {
  font-variant-numeric: tabular-nums; font-weight: 500; color: var(--fg);
}
:root[data-theme="premium"] .bubble .pm-num.pm-bad  { color: var(--red); }
:root[data-theme="premium"] .bubble .pm-num.pm-good { color: var(--green); }

/* .pm-camp — campaign name underline style */
:root[data-theme="premium"] .bubble .pm-camp {
  font-size: 11.5px; font-weight: 400; color: var(--fg-3);
  border-bottom: 1px solid rgba(255,255,255,.1); padding-bottom: 1px;
}

/* .pm-action — action/recommendation strip */
:root[data-theme="premium"] .bubble .pm-action {
  border-top: 1px solid rgba(255,255,255,.06);
  padding-top: 13px; margin-top: 16px;
  font-size: 12.5px; font-weight: 300; color: var(--fg-2); line-height: 1.7;
}
:root[data-theme="premium"] .bubble .pm-action-label {
  font-size: 10px; font-weight: 600; letter-spacing: .1em;
  text-transform: uppercase; color: var(--fg-3); margin-bottom: 4px;
}

/* ── Sidebar ── */
:root[data-theme="premium"] .history-item {
  border-radius: 6px;
}
:root[data-theme="premium"] .history-item:hover {
  background: rgba(255,255,255,.03) !important;
}
:root[data-theme="premium"] .history-item--active {
  background: rgba(255,255,255,.05) !important;
}
:root[data-theme="premium"] .history-item--active .history-title {
  color: var(--fg); font-weight: 500;
}

/* ── Input bar ── */
:root[data-theme="premium"] #chat-input {
  font-weight: 300;
}
:root[data-theme="premium"] #chat-input:focus {
  box-shadow: 0 0 0 2px rgba(255,255,255,.06);
}

/* ── Suggestion pills ── */
:root[data-theme="premium"] .sugg-pill {
  background: transparent;
  border-color: rgba(255,255,255,.1);
  color: var(--fg-3);
  font-weight: 400;
}
:root[data-theme="premium"] .sugg-pill:hover {
  background: rgba(255,255,255,.04);
  border-color: rgba(255,255,255,.18);
  color: var(--fg);
}

/* ── Sidebar search ── */
.sb-search-row {
  display: flex; align-items: center; gap: 6px;
  margin: 2px 8px 4px;
  padding: 5px 9px; border-radius: 7px;
  background: rgba(255,255,255,.03);
  border: 1px solid var(--border);
  color: var(--fg-3); font-size: 12px; cursor: text;
  transition: border-color .12s;
}
.sb-search-row:hover,
.sb-search-row:focus-within { border-color: rgba(255,255,255,.14); }
.sb-search-row svg { flex-shrink: 0; opacity: .6; }
.sb-search-input {
  background: none; border: none; outline: none;
  color: var(--fg); font-size: 12px; font-family: inherit;
  width: 100%; min-width: 0;
}
.sb-search-input::placeholder { color: var(--fg-3); }
.history-item.sb-hidden { display: none; }
.sb-search-empty { padding: 8px 12px; font-size: 12px; color: var(--fg-3); display: none; }

/* ── Charts ── */
:root[data-theme="premium"] .ct-chart-bar {
  background: rgba(255,255,255,.42);
}

/* ── "Answer from" label ── */
:root[data-theme="premium"] .genui-history-label {
  color: var(--fg-3);
}

/* ── "Ask again to act on this" ── */
:root[data-theme="premium"] .gui-action-expired {
  color: var(--fg-2);
}

/* ── Chat bubble shadow lift (both user + AI) ── */
:root[data-theme="premium"] .msg .bubble {
  box-shadow:
    0 0 0 1px rgba(255,255,255,.04),
    0 2px 6px  rgba(255,255,255,.04),
    0 8px 24px rgba(255,255,255,.035),
    0 20px 56px rgba(255,255,255,.025),
    inset 0 1px 0 rgba(255,255,255,.08);
}

/* ── Theme switcher button ── */
:root[data-theme="premium"] .theme-btn.active {
  background: rgba(255,255,255,.08);
  color: var(--fg);
}

/* ── Desaturate emojis ── */
:root[data-theme="premium"] .starter-icon,
:root[data-theme="premium"] .sugg-pill,
:root[data-theme="premium"] .chip,
:root[data-theme="premium"] .vo-sug {
  filter: grayscale(1);
}

/* ── Greeting — drop gradient, Playfair italic ── */
:root[data-theme="premium"] .greeting-text {
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-weight: 500;
  font-size: 34px;
  letter-spacing: -.01em;
  line-height: 1.25;
  background: none !important;
  -webkit-background-clip: unset !important;
  background-clip: unset !important;
  -webkit-text-fill-color: var(--fg) !important;
  color: var(--fg) !important;
}
:root[data-theme="premium"] .greeting-text .gradient-text,
:root[data-theme="premium"] .greeting-text span[style*="gradient"] {
  background: none !important;
  -webkit-text-fill-color: var(--fg) !important;
  color: var(--fg) !important;
}

/* ── Change plan card (preview → approve → PUBLISH) ─────────────────────── */
.cp-wrap { display:block; }
.cp-card { background:var(--bg-1); border:1px solid var(--border-2); border-radius:var(--r-lg);
  padding:14px 16px; margin:8px 0; max-width:640px; }
.cp-head { display:flex; align-items:center; justify-content:space-between; gap:8px; flex-wrap:wrap; margin-bottom:10px; }
.cp-title { font-weight:600; color:var(--fg); }
.cp-badge { font-size:11px; padding:3px 8px; border-radius:var(--r-full); background:var(--amber-d); color:var(--amber); }
.cp-badge-ok { background:var(--green-d); color:var(--green); }
.cp-badge-warn { background:var(--red-d); color:var(--red); }
.cp-rows { display:flex; flex-direction:column; gap:8px; }
.cp-row { border:1px solid var(--border); border-radius:var(--r-md); padding:8px 10px; background:var(--bg-2); min-width:0; }
.cp-row-muted { opacity:.65; }
.cp-row-name { font-weight:600; font-size:13px; margin-bottom:4px; overflow-wrap:anywhere; }
.cp-row-line { font-size:13px; color:var(--fg-2); overflow-wrap:anywhere; }
.cp-row-line strong { color:var(--fg); }
.cp-k { display:inline-block; min-width:56px; font-size:11px; text-transform:uppercase; letter-spacing:.04em; color:var(--fg-3); }
.cp-add { color:var(--green); }
.cp-rem { color:var(--red); }
.cp-row-note { font-size:12px; color:var(--fg-2); margin-top:4px; }
.cp-warn { color:var(--amber); }
.cp-actions { display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin-top:12px; }
.cp-btn { border:1px solid var(--border-2); background:var(--bg-3); color:var(--fg); border-radius:var(--r-sm);
  padding:6px 12px; font-size:13px; cursor:pointer; }
.cp-btn:disabled { opacity:.5; cursor:not-allowed; }
.cp-approve, .cp-publish { background:var(--blue); border-color:var(--blue); color:#fff; }
.cp-confirm-label { width:100%; font-size:12px; color:var(--fg-2); }
.cp-confirm-input { flex:1 1 140px; min-width:0; background:var(--bg-2); border:1px solid var(--border-2);
  color:var(--fg); border-radius:var(--r-sm); padding:6px 8px; font-family:inherit; letter-spacing:.08em; }
.cp-status { font-size:12px; margin-top:8px; color:var(--fg-2); min-height:1em; }
.cp-ok { color:var(--green); } .cp-err { color:var(--red); } .cp-muted { color:var(--fg-2); }
.cp-acks { margin-top:12px; padding:10px 12px; border:1px solid var(--amber); border-radius:var(--r-md); background:var(--amber-d); }
.cp-acks-title { font-size:12px; font-weight:600; color:var(--amber); margin-bottom:6px; }
.cp-ack { display:flex; gap:8px; align-items:flex-start; font-size:13px; color:var(--fg); line-height:1.4; cursor:pointer; }
.cp-ack + .cp-ack { margin-top:6px; }
.cp-ack input { margin-top:3px; flex:0 0 auto; }
