
/* ============ TOKENS ============ */
:root {
  /* Light surface ramp */
  --canvas: #f7f7f9;
  --surface: #ffffff;
  --stop-ring: rgba(0,119,182,.95); /* generating-ring, brand blue reads on white */
  --surface-2: #f5f5f7;
  --surface-3: #ececef;
  --hairline: #e8e8ed;
  --hairline-soft: #f0f0f3;

  /* Text ramp */
  --text: #0a0a0f;
  --text-soft: #424245;
  --text-muted: #86868b;
  --text-dim: #afafb2;

  /* Brand */
  --accent: #5B2D8E;
  --accent-ink: #5B2D8E; /* accent as text or a ring; dark mode lifts it (S48) */
  --accent-soft: rgba(91,45,142,0.08);
  --blue: #0077B6;
  --gradient: linear-gradient(135deg, #0077B6 0%, #5B2D8E 55%, #7CB518 100%);
  --gradient-flat: linear-gradient(135deg, #0077B6, #5B2D8E);
  --gradient-subtle: linear-gradient(135deg, rgba(0,119,182,0.04), rgba(91,45,142,0.03), rgba(124,181,24,0.03));

  /* Status */
  --ok: #0a7c43; --ok-bg: #dcfce7; --ok-soft: rgba(10,124,67,0.1);
  --warn: #d97706; --warn-bg: #fef3c7; --warn-soft: rgba(217,119,6,0.1); --warn-strong: #b45309; /* amber text that meets AA on light */
  --bad: #dc2626; --bad-bg: #fee2e2; --bad-soft: rgba(220,38,38,0.1);
  --bad-strong: #991b1b; --label: #6e6e73; /* one meter: red text and quiet labels that meet AA (approved screens 2026-10-27) */

  /* Platform brand */
  --g: #4285F4; --m: #7c3aed; --tik: #ee1d52; --li: #0A66C2; --gtm: #246FDB;

  /* Effects */
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.03);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.03);
  --shadow-md: 0 4px 14px rgba(0,0,0,0.07), 0 1px 3px rgba(0,0,0,0.04);
  --shadow-lg: 0 20px 50px rgba(0,0,0,0.12), 0 6px 18px rgba(0,0,0,0.05);
  --shadow-float: 0 18px 40px -12px rgba(10,10,15,0.16), 0 4px 10px rgba(10,10,15,0.04);
  --shadow-focus: 0 0 0 3px rgba(91,45,142,0.15);
  --surface-elev: #ffffff;

  /* Layout */
  --side-w: 232px;
  --side-w-collapsed: 56px;
  --chat-w: 440px;
  --topbar-h: 56px;

  /* Design system tokens (Lena spec) */
  --radius-row: 10px;
  --radius-card: 14px;
  --radius-pill: 999px;
  --row-h: 52px;
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px;
  --space-5: 20px; --space-6: 28px; --space-7: 44px;
  --hairline-strong: #dcdce1;

  /* Logo scale factors (normalized for 28px container, equal visual mass) */
  --logo-scale-google: 1.00;
  --logo-scale-meta: 1.00;
  --logo-scale-linkedin: 1.15;
  --logo-scale-tiktok: 1.00;
  --logo-scale-microsoft: 1.00;
  --logo-scale-openai: 1.00;
  --logo-scale-snapchat: 1.00;
  --logo-scale-reddit: 1.00;
  --logo-scale-pinterest: 1.00;
  --logo-scale-x: 0.80;
  --logo-scale-ga4: 1.00;
  --logo-scale-gtm: 1.00;
  --logo-scale-gsc: 1.00;
  --logo-scale-merchant: 1.00;
  --logo-scale-gmc: 0.59;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

html.dark {
  --canvas: #07070b;
  --surface: #101015;
  --stop-ring: rgba(255,255,255,.95); /* generating-ring, white reads on near-black */
  --surface-2: #18181f;
  --surface-3: #22222b;
  --hairline: #25252d;
  --hairline-soft: #1c1c24;
  --hairline-strong: #2f2f38;
  --text: #f5f5f7;
  --text-soft: #c2c2cc;
  --text-muted: #7a7a85;
  --text-dim: #4a4a52;
  --accent-soft: rgba(140,92,196,0.18);
  --accent-ink: #a78bfa; /* --accent is 2:1 on these surfaces */
  --blue: #3aa0dc;
  --gradient-subtle: linear-gradient(135deg, rgba(0,119,182,0.06), rgba(140,92,196,0.05), rgba(124,181,24,0.04));
  --ok-bg: rgba(10,124,67,0.18); --ok-soft: rgba(10,124,67,0.14);
  --warn-bg: rgba(217,119,6,0.18); --warn-soft: rgba(217,119,6,0.14); --warn-strong: #fbbf24;
  --bad-bg: rgba(220,38,38,0.18); --bad-soft: rgba(220,38,38,0.14);
  --bad-strong: #fca5a5; --label: #82828d;
  --shadow-float: 0 18px 40px -12px rgba(0,0,0,0.7), 0 4px 10px rgba(0,0,0,0.4);
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.4);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.5), 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 14px rgba(0,0,0,0.5), 0 1px 3px rgba(0,0,0,0.3);
  --shadow-lg: 0 20px 50px rgba(0,0,0,0.6), 0 6px 18px rgba(0,0,0,0.4);
  --shadow-focus: 0 0 0 3px rgba(140,92,196,0.25);
  --surface-elev: #15151b;
}

/* ============ RESET ============ */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
html { background: var(--canvas); }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  font-feature-settings: 'cv11', 'ss01';
  color: var(--text);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.005em;
  overflow: hidden;
  transition: background-color 280ms var(--ease), color 280ms var(--ease);
}
/* Hide the app shell until requireAuth resolves and first hydrate completes.
   Splash stays painted on top so the user never sees a flash of unauth content. */
.app-shell { opacity: 0; visibility: hidden; transition: opacity 220ms ease; }
body.loaded .app-shell { opacity: 1; visibility: visible; }
.auth-splash {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  background: var(--canvas);
  pointer-events: none;
  opacity: 1; transition: opacity 220ms ease;
}
body.loaded .auth-splash { opacity: 0; }
.auth-splash[hidden] { display: none; }
.auth-splash__dot { display: none; }
button { font: inherit; color: inherit; }
img { display: block; }

/* ============ APP LAYOUT ============ */
.app {
  display: grid;
  grid-template-columns: var(--side-w) 1fr;
  height: 100vh;
  transition: grid-template-columns 280ms var(--ease);
}
.app.is-collapsed { grid-template-columns: var(--side-w-collapsed) 1fr; }
.app.is-chat-open { grid-template-columns: var(--side-w) 1fr var(--chat-w); }
.app.is-collapsed.is-chat-open { grid-template-columns: var(--side-w-collapsed) 1fr var(--chat-w); }
/* Hover-zone removed: it was intercepting icon clicks. Empty-space click
   lives on .side itself, handled via e.target === side in JS. */
.side-hover-zone { display: none !important; }

/* Icon tooltips (collapsed sidebar) */
.app.is-collapsed .side__fold[data-tip]::after,
.app.is-collapsed .navrow[data-tip]::after,
.app.is-collapsed .brand-card[data-tip]::after,
.app.is-collapsed .user[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%);
  background: #1a1a1f;
  color: #fff;
  font-size: 11.5px;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: 6px;
  white-space: nowrap;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease 150ms;
  box-shadow: 0 4px 12px rgba(0,0,0,0.22);
}
.app.is-collapsed .side__fold[data-tip]:hover::after,
.app.is-collapsed .navrow[data-tip]:hover::after,
.app.is-collapsed .brand-card[data-tip]:hover::after,
.app.is-collapsed .user[data-tip]:hover::after { opacity: 1; }
.side__fold { position: relative; }
.navrow, .brand-card, .user { position: relative; }

/* ============ SIDEBAR (Claude-style slim) ============ */
.side {
  background: var(--surface-2);
  border-right: 1px solid var(--hairline);
  display: flex;
  flex-direction: column;
  padding: 10px 8px 6px;
  min-width: 0;
  overflow: hidden;
  transition: padding 220ms var(--ease);
}
.app.is-collapsed .side { padding: 10px 6px 6px; align-items: center; overflow: visible; cursor: pointer; }
.app.is-collapsed .side > * { cursor: default; }
.app.is-collapsed .side .navrow,
.app.is-collapsed .side .brand-card,
.app.is-collapsed .side .user,
.app.is-collapsed .side .side__fold { cursor: pointer; }

/* Top brand row */
.side__brand-row {
  display: flex;
  align-items: center;
  height: 36px;
  padding: 0 6px;
  margin-bottom: 6px;
  position: relative;
}
.side__brand-wordmark {
  height: 20px;
  width: auto;
  display: block;
  margin-right: auto;
  background: transparent;
}
.app.is-collapsed .side__brand-wordmark { display: none; }

/* Nav rows (Claude style) */
.navrow {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 7px 9px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
  background: transparent;
  border: 0;
  cursor: pointer;
  text-align: left;
  letter-spacing: -0.005em;
  transition: background 120ms ease;
}
.navrow:hover { background: var(--surface-3); }
.navrow.is-active { background: var(--surface-3); font-weight: 600; }
.navrow__icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  color: var(--text-soft);
}
.navrow__icon svg { width: 17px; }
.navrow__label { flex: 1; min-width: 0; }
.navrow__kbd {
  font-size: 10.5px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  padding: 1px 5px;
  border-radius: 4px;
  color: var(--text-muted);
  font-weight: 500;
}
.navrow__badge {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--gradient-flat);
  color: #fff;
  padding: 1px 6px;
  border-radius: 4px;
}
.app.is-collapsed .navrow { justify-content: center; padding: 8px; gap: 0; }
.app.is-collapsed .navrow__label,
.app.is-collapsed .navrow__kbd,
.app.is-collapsed .navrow__badge { display: none; }

.beta-badge {
  display: inline-flex;
  align-items: center;
  height: 16px;
  padding: 0 6px;
  margin-left: 6px;
  background: var(--accent);
  color: #fff;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 4px;
  vertical-align: middle;
}

/* New chat primary */
.navrow--primary {
  background: transparent;
  border: 0;
  margin-bottom: 4px;
}
.navrow--primary .navrow__icon {
  background: var(--gradient-flat);
  color: #fff;
  border-radius: 6px;
}
.navrow--primary .navrow__icon svg { width: 12px; }
.navrow--primary:hover { background: var(--surface-3); }

/* Section heading (Claude style: uppercase muted) */
.nav-section {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 14px 12px 4px;
}
.app.is-collapsed .nav-section { display: none; }

/* Divider */
.nav-divider {
  height: 1px;
  background: var(--hairline);
  margin: 8px 6px;
}
.app.is-collapsed .nav-divider { width: 24px; margin: 8px auto; }

/* Active brand context card */
.brand-card {
  margin: 4px 4px 0;
  padding: 7px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  transition: background 140ms ease;
}
.brand-card:hover { background: var(--surface-3); }
.brand-card__avatar {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: var(--gradient);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 9px;
  font-weight: 700;
  flex-shrink: 0;
  overflow: hidden;
}
.brand-card__avatar img { width: 100%; height: 100%; object-fit: cover; }
.brand-card__info { flex: 1; min-width: 0; }
.brand-card__name {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: -0.005em;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand-card__meta {
  font-size: 10.5px;
  color: var(--text-muted);
  margin-top: 1px;
  white-space: nowrap;
}
.brand-card__chev { color: var(--text-muted); font-size: 9px; transition: transform 140ms ease; }
.brand-card.is-open .brand-card__chev { transform: rotate(180deg); }
.brand-card.is-open { background: var(--surface-3); }
.app.is-collapsed .brand-card { padding: 6px; justify-content: center; }
.app.is-collapsed .brand-card__info,
.app.is-collapsed .brand-card__chev { display: none; }
.brand-menu {
  position: absolute; left: 4px; right: 4px; top: calc(100% + 4px);
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: 10px; padding: 4px; box-shadow: var(--shadow-md);
  z-index: 70; max-height: 300px; overflow-y: auto; display: none;
  cursor: default;
}
.brand-card.is-open .brand-menu { display: block; }
.brand-menu__item { display: flex; align-items: center; gap: 9px; padding: 8px 9px; border-radius: 7px; cursor: pointer; }
.brand-menu__item:hover { background: var(--surface-2); }
.brand-menu__item.is-active { background: var(--surface-2); }
.brand-menu__av { width: 22px; height: 22px; border-radius: 6px; background: var(--gradient); color: #fff; display: grid; place-items: center; font-size: 9px; font-weight: 700; flex-shrink: 0; overflow: hidden; }
.brand-menu__av img { width: 100%; height: 100%; object-fit: cover; }
.brand-menu__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; font-weight: 600; color: var(--text); }
.brand-menu__check { color: var(--accent); flex-shrink: 0; opacity: 0; }
.brand-menu__check svg { width: 14px; }
.brand-menu__item.is-active .brand-menu__check { opacity: 1; }
.brand-menu__divider { height: 1px; background: var(--hairline); margin: 4px 6px; }
.brand-menu__add { display: flex; align-items: center; gap: 9px; padding: 8px 9px; border-radius: 7px; cursor: pointer; font-size: 12.5px; color: var(--text-muted); }
.brand-menu__add:hover { background: var(--surface-2); color: var(--text); }
.brand-menu__add svg { flex-shrink: 0; }
.app.is-collapsed .brand-menu { left: auto; right: 4px; min-width: 210px; }

.side__top {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
  padding: 0 4px;
  min-height: 32px;
}
.side__brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--gradient);
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: -0.02em;
  flex-shrink: 0;
  box-shadow: var(--shadow-xs);
}
.side__brand-logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
}
.side__brand-name {
  font-weight: 700;
  font-size: 14.5px;
  letter-spacing: -0.02em;
  flex: 1;
  white-space: nowrap;
}
.app.is-collapsed .side__brand-name { display: none; }
.side__fold {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: transparent;
  border: 0;
  display: grid;
  place-items: center;
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 140ms ease, color 140ms ease;
}
.side__fold:hover { background: var(--surface-3); color: var(--text); }
.side__fold svg { width: 16px; }
.side__fold-active { display: none; }
.app.is-rail-hover.is-collapsed .side__fold-default { display: none; }
.app.is-rail-hover.is-collapsed .side__fold-active { display: block; }
.app.is-collapsed .side__brand-row { justify-content: center; padding: 0; }

/* Brand workspace switcher */
.workspace {
  position: relative;
  margin-bottom: 16px;
}
.workspace__btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--hairline);
  border-radius: 10px;
  background: var(--surface);
  cursor: pointer;
  text-align: left;
  transition: all 140ms ease;
}
.workspace__btn:hover { border-color: var(--text-dim); background: var(--surface-2); }
.workspace__avatar {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: var(--gradient);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}
.workspace__info { flex: 1; min-width: 0; }
.workspace__name {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.workspace__meta {
  font-size: 10.5px;
  color: var(--text-muted);
  margin-top: 1px;
  white-space: nowrap;
}
.workspace__chev { color: var(--text-muted); font-size: 9px; flex-shrink: 0; opacity: 0.7; }
.app.is-collapsed .workspace__info,
.app.is-collapsed .workspace__chev { display: none; }
.app.is-collapsed .workspace__btn { padding: 7px; justify-content: center; }

/* Ask CTA */
.ask-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  background: var(--gradient-flat);
  color: #fff;
  border: 0;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 6px;
  box-shadow: var(--shadow-sm);
  transition: transform 140ms ease, box-shadow 140ms ease, opacity 140ms ease;
}
.ask-btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.ask-btn svg { width: 14px; flex-shrink: 0; }
.ask-btn__label { flex: 1; text-align: left; }
.ask-btn__kbd {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  font-weight: 600;
  background: rgba(255,255,255,0.18);
  padding: 1px 6px;
  border-radius: 4px;
  letter-spacing: 0.02em;
}
.app.is-collapsed .ask-btn { justify-content: center; padding: 9px; }
.app.is-collapsed .ask-btn__label,
.app.is-collapsed .ask-btn__kbd { display: none; }

/* Search */
.searchbtn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 11px;
  background: transparent;
  border: 0;
  border-radius: 8px;
  font-size: 12.5px;
  color: var(--text-muted);
  cursor: pointer;
  text-align: left;
  margin-bottom: 12px;
  transition: background 140ms ease, color 140ms ease;
}
.searchbtn:hover { background: var(--surface-2); color: var(--text-soft); }
.searchbtn svg { width: 13px; flex-shrink: 0; opacity: 0.7; }
.searchbtn__text { flex: 1; }
.searchbtn__kbd {
  font-size: 10px;
  font-weight: 600;
  background: var(--surface-2);
  padding: 1px 5px;
  border-radius: 4px;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}
.app.is-collapsed .searchbtn { justify-content: center; padding: 7px; }
.app.is-collapsed .searchbtn__text,
.app.is-collapsed .searchbtn__kbd { display: none; }

/* Section heading */
.side__section {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 14px 12px 6px;
}
.app.is-collapsed .side__section { display: none; }

/* Conversations list */
.convs {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  margin: 0 -2px;
  padding: 0 2px;
}
.convs::-webkit-scrollbar { width: 3px; }
.convs::-webkit-scrollbar-thumb { background: var(--hairline); border-radius: 3px; }
.app.is-collapsed .convs { display: none; }

.conv {
  width: 100%;
  padding: 7px 11px;
  border-radius: 7px;
  font-size: 13px;
  color: var(--text-soft);
  background: transparent;
  border: 0;
  cursor: pointer;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1.35;
  transition: background 120ms ease, color 120ms ease;
  position: relative;
}
.conv:hover { background: var(--surface-2); color: var(--text); }
.conv--active { background: var(--accent-soft); color: var(--text); font-weight: 500; }
.conv--active::before {
  content: '';
  position: absolute;
  left: 0; top: 6px; bottom: 6px;
  width: 2px;
  border-radius: 0 2px 2px 0;
  background: var(--gradient);
}
.conv__title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Footer */
.side__footer {
  margin-top: auto;
  padding-top: 6px;
  border-top: 1px solid var(--hairline-soft);
  width: 100%;
}
.user {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px;
  cursor: pointer;
  border-radius: 8px;
  transition: background 140ms ease;
}
.user:hover { background: var(--surface-2); }
.user__avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--gradient);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}
.user__avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.user__info { flex: 1; min-width: 0; }
.user__name {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user__email {
  font-size: 10.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.app.is-collapsed .user__info { display: none; }
.app.is-collapsed .user { justify-content: center; padding: 8px 0; }
/* Pinned usage meter chip + Settings row in the sidebar footer (UX revamp). */
.usage-chip { width: 100%; display: block; text-align: left; background: none; border: 0; border-radius: 0; padding: 10px 4px 8px; margin-bottom: 6px; cursor: pointer; }
.usage-chip:hover .usage-chip__label { color: var(--text); }
.usage-chip__track { height: 5px; border-radius: 999px; background: var(--hairline-soft); overflow: hidden; margin-bottom: 9px; }
.usage-chip__bar { height: 100%; width: 0%; border-radius: 999px; background: var(--gradient); transition: width 200ms ease, background 200ms ease; }
.usage-chip__bar.is-warn { background: var(--warn); }
.usage-chip__bar.is-crit { background: var(--bad); }
.usage-chip__row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.usage-chip__label { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: var(--text-muted); letter-spacing: -0.01em; transition: color 140ms ease; }
.usage-chip__help { display: inline-grid; place-items: center; width: 13px; height: 13px; border: 1px solid var(--hairline); border-radius: 50%; font-size: 9px; font-weight: 700; color: var(--text-muted); line-height: 1; cursor: help; }
.ps-tip { position: fixed; z-index: 9999; background: #0a0a0f; color: #fff; font: 500 11px/1.35 -apple-system, Inter, sans-serif; letter-spacing: -0.01em; padding: 6px 9px; border-radius: 7px; max-width: 220px; box-shadow: 0 6px 20px -8px rgba(10,10,20,0.5); pointer-events: none; opacity: 0; transition: opacity 120ms ease; }
.ps-tip.is-on { opacity: 1; }
.usage-chip__val { font-size: 12px; font-weight: 700; color: var(--text); white-space: nowrap; font-variant-numeric: tabular-nums; }
.usage-chip__sub { font-size: 10.5px; font-weight: 500; color: var(--text-muted); margin-top: 3px; letter-spacing: -0.01em; }
.app.is-collapsed .usage-chip { display: none; }
.usage-chip__up { display: flex; align-items: center; justify-content: center; gap: 7px; width: 100%; margin: 0 0 8px; padding: 9px 12px; border: 0; border-radius: 999px; background: var(--gradient); color: #fff; font-size: 12.5px; font-weight: 650; cursor: pointer; letter-spacing: -0.01em; box-shadow: 0 4px 14px -6px rgba(91,45,142,0.55); transition: filter 140ms ease, transform 140ms ease; }
.usage-chip__up:hover { filter: brightness(1.06); transform: translateY(-1px); }
.usage-chip__up svg { width: 15px; height: 15px; flex-shrink: 0; }
.app.is-collapsed .usage-chip__up { display: none !important; }
/* ONE METER (approved screens 2026-10-27): label and % on top, a bar that FILLS as tasks are used, used/total and the reset
   below. Shown only when billing-state's meter.mode is 'one'; otherwise the chip above is today's UI, untouched. */
.usage-chip .om-meter { display: none; }
.usage-chip--one > :not(.om-meter) { display: none; }
.usage-chip--one .om-meter { display: block; padding: 0; }
.usage-chip--one { padding: 6px 4px 8px; }
.om-meter__row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.om-meter__label { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--text); letter-spacing: -0.01em; }
.om-meter .usage-chip__help { border-color: var(--hairline-strong); color: var(--label); }
.om-meter__pct { font-size: 12.5px; font-weight: 600; color: var(--text-soft); font-variant-numeric: tabular-nums; }
.om-meter__pct.is-crit { color: var(--bad-strong); }
.om-meter__track { height: 6px; border-radius: 999px; background: var(--hairline); overflow: hidden; margin: 7px 0 6px; }
.om-meter__bar { height: 100%; width: 0%; border-radius: 999px; background: var(--gradient); transition: width 200ms ease; }
.om-meter__bar.is-warn { background: var(--warn); }
.om-meter__bar.is-crit { background: var(--bad); }
.om-meter__sub { font-size: 11px; font-weight: 500; color: var(--label); letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.om-meter__sub a { color: var(--accent-ink); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
/* What a finished chat reply or agent report used: one quiet line, always visible (the action row only shows on hover). */
.msg__used { font-size: 12px; color: var(--label); font-variant-numeric: tabular-nums; margin-top: 8px; }
.msg__used b { color: var(--text-soft); font-weight: 600; }
.run-card__foot .msg__used { margin: 0 auto 0 0; align-self: center; }
/* Usage notices: a floating card with a progress ring. Severity lives in the words, never in a tinted box. */
.om-notice { position: fixed; z-index: 96; /* above the page, under every modal (100+) */ right: 20px; bottom: calc(20px + var(--run-dock-room, 0px)); width: min(520px, calc(100vw - 32px)); display: grid; grid-template-columns: 60px 1fr; gap: 16px; align-items: start; background: var(--surface-elev); border: 1px solid var(--hairline); border-radius: 20px; padding: 20px 22px 20px 20px; box-shadow: var(--shadow-float); color: var(--text); animation: omIn 220ms cubic-bezier(.2,.8,.2,1); }
@keyframes omIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .om-notice { animation: none; } }
.om-ring { position: relative; width: 60px; height: 60px; }
.om-ring svg { width: 60px; height: 60px; transform: rotate(-90deg); display: block; }
.om-ring__track { fill: none; stroke: var(--hairline); stroke-width: 6; }
.om-ring__fill { fill: none; stroke: url(#omRingGrad); stroke-width: 6; stroke-linecap: round; }
.om-ring__val { position: absolute; inset: 0; display: grid; place-items: center; font-size: 13px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.om-notice__main { min-width: 0; }
.om-notice__close { position: absolute; top: 12px; right: 12px; width: 28px; height: 28px; border-radius: 8px; border: 0; background: none; color: var(--label); font-size: 18px; line-height: 1; cursor: pointer; }
.om-notice__close:hover { background: var(--surface-2); color: var(--text); }
.om-notice__kicker { font-size: 11.5px; font-weight: 600; color: var(--label); font-variant-numeric: tabular-nums; padding-right: 28px; }
.om-notice__title { font-size: 16px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.35; margin-top: 3px; padding-right: 24px; text-wrap: balance; }
.om-notice__body { font-size: 13px; color: var(--text-soft); line-height: 1.55; margin-top: 6px; text-wrap: pretty; }
.om-notice__body b { color: var(--text); font-weight: 600; }
.om-notice__offer { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--hairline-soft); font-size: 12.5px; color: var(--text-soft); line-height: 1.5; text-wrap: pretty; }
.om-notice__offer b { color: var(--accent-ink); font-weight: 700; }
.om-notice__btns { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.om-notice__link { font-size: 12.5px; font-weight: 600; color: var(--accent-ink); text-decoration: none; display: inline-block; margin-top: 10px; background: none; border: 0; padding: 0; font-family: inherit; cursor: pointer; }
@media (max-width: 760px) {
  .om-notice { right: 16px; grid-template-columns: 48px 1fr; gap: 12px; padding: 16px 16px 16px 14px; }
  .om-ring, .om-ring svg { width: 48px; height: 48px; }
  .om-ring__val { font-size: 10.5px; letter-spacing: -0.03em; }
}
@media (max-width: 560px) {
  .om-notice__close { width: 44px; height: 44px; top: 4px; right: 4px; }
  .om-notice__btns .settings-row__btn { min-height: 44px; }
  .om-notice__link { min-height: 44px; display: inline-flex; align-items: center; margin-top: 2px; }
  .om-meter__sub a { display: inline-block; padding: 16px 0; margin: -16px 0; }
}
.user__chev { margin-left: auto; color: var(--text-muted); font-size: 11px; flex-shrink: 0; transition: transform 140ms ease; }
.user.is-open .user__chev { transform: rotate(180deg); }
.user.is-open { background: var(--surface-2); }
.app.is-collapsed .user__chev { display: none; }
.user-menu { position: absolute; left: 4px; right: 4px; bottom: calc(100% + 4px); background: var(--surface); border: 1px solid var(--hairline); border-radius: 10px; padding: 4px; box-shadow: var(--shadow-md); z-index: 70; display: none; }
.user.is-open .user-menu { display: block; }
.user-menu__email { font-size: 11px; color: var(--text-muted); padding: 7px 9px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-menu__item { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 8px 9px; border: 0; background: none; border-radius: 7px; cursor: pointer; font-size: 13px; font-weight: 500; color: var(--text); text-decoration: none; }
.user-menu__item:hover { background: var(--surface-2); }
.user-menu__item svg { width: 16px; height: 16px; flex-shrink: 0; color: var(--text-muted); }
.user-menu__sep { height: 1px; background: var(--hairline-soft); margin: 4px 6px; }

/* ============ MAIN ============ */
.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  background: var(--canvas);
}

/* Top bar */
.topbar {
  height: var(--topbar-h);
  flex-shrink: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--hairline);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 14px;
  position: relative;
  /* The topbar's backdrop-filter creates its own stacking context; without an
     explicit z-index the notification popover (nested here) gets trapped below
     page content like the Agents composer. Lift the whole context above page
     content but below every intended overlay (setup scrim 100+, modals, toasts). */
  z-index: 99;
}
.topbar::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -8px; height: 8px;
  background: linear-gradient(180deg, rgba(0,0,0,0.04), transparent);
  pointer-events: none;
  opacity: 0;
  transition: opacity 200ms ease;
}
.main.is-scrolled .topbar::after { opacity: 1; }

.topbar__title {
  /* Hidden per Ahmed 2026-06-03: sidebar logo + active nav row already show
     context, and section pages (MCP) have their own rich header bar. */
  display: none;
}
/* MCP header lives IN the main topbar (per Ahmed 2026-06-03): logo + text, no
   separate in-page bar. Shown only when the MCP page is active. */
.topbar__mcphead { display: none; align-items: center; gap: 11px; min-width: 0; }
.topbar.is-mcphead .topbar__mcphead { display: flex; }
.topbar__mcphead-icon {
  width: 30px; height: 30px; border-radius: 8px; background: var(--gradient);
  display: grid; place-items: center; flex-shrink: 0; padding: 5px;
}
.topbar__mcphead-icon img { width: 100%; height: 100%; object-fit: contain; }
.topbar__mcphead-copy { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.topbar__mcphead-title { font-size: 14.5px; font-weight: 700; letter-spacing: -0.02em; }
.topbar__mcphead-sub { font-size: 11.5px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 640px) { .topbar__mcphead-sub { display: none; } }
.topbar__crumb {
  font-size: 12px;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.topbar__crumb svg { width: 10px; opacity: 0.6; }
.topbar__crumb-label {
  background: var(--surface-2);
  padding: 3px 9px;
  border-radius: 6px;
  border: 1px solid var(--hairline);
  font-weight: 500;
  color: var(--text-soft);
}
.topbar__sp { flex: 1; }

.toolbtn {
  height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 11px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--surface);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-soft);
  cursor: pointer;
  transition: all 140ms ease;
}
.toolbtn:hover { color: var(--text); border-color: var(--text-dim); background: var(--surface-2); }
.toolbtn svg { width: 13px; }

.toolbtn--primary {
  background: var(--gradient-flat);
  color: #fff;
  border: 0;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  padding: 0 13px;
}
.toolbtn--primary:hover { background: var(--gradient-flat); color: #fff; opacity: 0.92; transform: translateY(-1px); box-shadow: var(--shadow-md); }
.toolbtn--primary kbd {
  font: inherit;
  font-size: 10.5px;
  background: rgba(255,255,255,0.18);
  padding: 1px 5px;
  border-radius: 3px;
  margin-left: 2px;
  font-weight: 600;
}

.iconbtn {
  width: 32px;
  height: 32px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-soft);
  cursor: pointer;
  display: grid;
  place-items: center;
  position: relative;
  transition: all 140ms ease;
}
.iconbtn:hover { color: var(--text); border-color: var(--text-dim); background: var(--surface-2); }
.iconbtn svg { width: 14px; }
.iconbtn__dot {
  position: absolute;
  top: 5px; right: 5px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--bad);
  border: 2px solid var(--surface);
}

/* Theme switcher */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-row);
  background: transparent;
  border: 1px solid var(--hairline);
  color: var(--text-muted);
  cursor: pointer;
  transition: background 120ms var(--ease), color 120ms var(--ease);
  overflow: hidden;
  position: relative;
}
.theme-toggle:hover { color: var(--text-soft); background: var(--surface-2); }
.theme-toggle svg { width: 15px; height: 15px; stroke-width: 1.75; position: absolute; transition: opacity 220ms var(--ease), transform 220ms var(--ease); }
#themeIconSun  { opacity: 0; transform: rotate(-45deg); }
#themeIconMoon { opacity: 1; transform: rotate(0deg); }
html.dark #themeIconSun  { opacity: 1; transform: rotate(0deg); display: block !important; }
html.dark #themeIconMoon { opacity: 0; transform: rotate(45deg); }

/* ============ SCROLL CANVAS ============ */
.scroll {
  flex: 1;
  overflow-y: auto;
  scroll-behavior: smooth;
}
.scroll::-webkit-scrollbar { width: 6px; }
.scroll::-webkit-scrollbar-thumb { background: var(--hairline); border-radius: 6px; }
.scroll::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }
.scroll__inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px 32px 80px;
}

/* ============ AUTOMATIONS PAGE ============ */
.automations-page {
  display: none;
  flex: 1;
  flex-direction: column;
  background: var(--canvas);
  min-height: 0;
  overflow: hidden;
}
.app.is-automations-page .automations-page { display: flex; }
.app.is-automations-page .scroll,
.app.is-automations-page .chats-page,
.app.is-automations-page .mcp-page,
.app.is-automations-page .brands-page,
.app.is-automations-page .settings-page,
.app.is-automations-page .allchats-page { display: none; }
.auto-body { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 28px 24px 60px; }
.auto-inner { max-width: 100%; min-width: 0; }
.auto-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}
.auto-title { font-size: 19px; font-weight: 700; letter-spacing: -0.02em; }
.auto-sub { font-size: 13px; color: var(--text-muted); margin-top: 5px; max-width: 56ch; line-height: 1.5; }
/* S47: the strip scrolls sideways when its tabs do not fit (five tabs in Advanced mode on a 375 px phone), and a tab
   never shrinks or wraps, so Brand Knowledge and Memory stay reachable (gaps-pass2-mobile U1). */
.auto-tabs {
  display: flex;
  gap: 4px;
  background: var(--surface-2);
  padding: 3px;
  border-radius: 10px;
  margin-bottom: 18px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}
.auto-tabs::-webkit-scrollbar { display: none; }
.fam-filter.is-more { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent); }
.auto-tabs.is-more { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent); }
.auto-tab {
  flex-shrink: 0;
  white-space: nowrap;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  padding: 7px 14px;
  background: transparent;
  border: 0;
  border-radius: 7px;
  color: var(--text-soft);
  cursor: pointer;
}
.auto-tab.is-active { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: var(--shadow-xs); }
.auto-tab__count {
  font-size: 10.5px;
  font-weight: 600;
  margin-left: 5px;
  background: var(--surface-3);
  padding: 1px 6px;
  border-radius: 999px;
  color: var(--text-muted);
}
.auto-tab.is-active .auto-tab__count { background: var(--accent-soft); color: var(--accent); }
.auto-view { display: none; }
.auto-view.is-active { display: block; }

.auto-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
}
@media (max-width: 1600px) { .auto-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 1280px) { .auto-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 980px) { .auto-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .auto-grid { grid-template-columns: 1fr; } }
.agent-card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 14px;
  padding: 18px;
  transition: all 160ms ease;
  display: flex;
  flex-direction: column;
}
.agent-card:hover { border-color: var(--text-dim); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.agent-card__head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.agent-card__icon {
  width: 38px; height: 38px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  color: var(--accent);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
html.dark .agent-card__icon { color: #b591e0; }
.agent-card__icon svg { width: 18px; }
/* Icon stroke normalization to match the approved design (stroke-width 1.8,
   round caps/joins). Scoped to action/chip icon containers only, never a bare
   svg{} rule, so data-viz strokes (rings, sparklines) are untouched. */
.agent-card__icon svg,
.gs-item__icon svg,
.agent-flagship__icon svg,
.mcp-card__head-icon svg,
.navrow__icon svg,
.ps-strip__ic svg,
.ps-hero__send svg,
.iconbtn svg,
.toolbtn svg {
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.agent-card__name { font-size: 14.5px; font-weight: 700; letter-spacing: -0.015em; }
.agent-card__status {
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--ok-bg);
  color: var(--ok);
  margin-top: 2px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.agent-card__status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
html.dark .agent-card__status { color: #2fbf72; } /* --ok (#0a7c43) is 3.1:1 on the dark pill */
@keyframes agentPulse { 0%,100% { opacity:1 } 50% { opacity:0.4 } }
.agent-card__desc { font-size: 12.5px; color: var(--text-soft); line-height: 1.55; margin-bottom: 12px; }
.agent-card__meta { display: flex; gap: 14px; padding-top: 12px; border-top: 1px solid var(--hairline-soft); }
.agent-card__meta-item { flex: 1; }
.agent-card__meta-l { font-size: 10px; color: var(--text-muted); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; margin-bottom: 2px; }
.agent-card__meta-v { font-size: 12.5px; font-weight: 600; }
.agent-card__chans { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.chan-pill { display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; font-weight: 600; color: var(--text-soft); background: var(--surface-2); border: 1px solid var(--hairline); padding: 3px 8px 3px 6px; border-radius: 999px; }
.chan-pill i { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.chan-pill img { width: 14px; height: 14px; object-fit: contain; border-radius: 3px; flex-shrink: 0; }
.agent-card__foot { display: flex; gap: 8px; margin-top: auto; flex-wrap: wrap; }
.agent-card__says { font-size: 11.5px; color: var(--text-soft); line-height: 1.45; margin-top: 8px; }
.agent-card__bandwrap { flex-shrink: 0; align-self: flex-start; }
.band-pill { font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 999px; letter-spacing: 0.01em; white-space: nowrap; }
.band-pill--observe { color: var(--text-soft); background: var(--surface-2); border: 1px solid var(--hairline); }
.band-pill--propose { color: var(--accent); background: var(--accent-soft); }
.band-pill--act_guardrails { color: #b45309; background: rgba(245,158,11,0.14); }
.band-pill--full_auto { color: var(--bad); background: var(--bad-bg); }
.scope-pill { font-size: 10px; font-weight: 700; padding: 3px 8px 3px 6px; border-radius: 999px; letter-spacing: 0.01em; white-space: nowrap; display: inline-flex; align-items: center; gap: 5px; }
.scope-pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.scope-pill--read { color: var(--blue, #0077B6); background: rgba(0,119,182,0.10); }
.scope-pill--read::before { background: var(--blue, #0077B6); }
.scope-pill--propose { color: var(--accent); background: var(--accent-soft); }
.scope-pill--propose::before { background: var(--accent); }
.scope-pill--act { color: #b45309; background: rgba(245,158,11,0.14); }
.scope-pill--act::before { background: #d97706; }
/* Capability ladder (2026-07-16): every card answers "what can this agent do to
   my account?" as Reads -> Suggests -> Acts, filled to its level, one brand blue
   instead of three corner-pill colours. Replaces the cramped scope/band pill. */
.cap { margin: 2px 0 14px; padding-top: 13px; border-top: 1px solid var(--hairline-soft); }
.cap__note { font-size: 11.5px; color: var(--text-muted); line-height: 1.45; }
.lead-plan { border: 1px solid var(--hairline); border-radius: 14px; padding: 16px 18px; margin: 0 0 16px; background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 6%, var(--surface)), var(--surface)); box-shadow: var(--shadow-xs); }
.lead-plan__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.lead-plan__title { font-size: 14px; font-weight: 750; letter-spacing: -0.01em; display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lead-plan__badge { font-size: 10px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: #fff; background: var(--gradient-flat, var(--accent)); padding: 2px 8px; border-radius: 999px; }
.lead-plan__goal { font-size: 11px; font-weight: 600; color: var(--text-muted); }
.lead-plan__stats { display: flex; gap: 6px; flex-wrap: wrap; }
.lead-plan__stat { font-size: 11px; font-weight: 600; color: var(--text-soft); background: var(--surface-2); border: 1px solid var(--hairline); border-radius: 999px; padding: 3px 9px; white-space: nowrap; }
.lead-plan__story { font-size: 12.5px; color: var(--text-soft); line-height: 1.5; margin: 10px 0 12px; }
.lead-plan__rows { display: flex; flex-direction: column; gap: 1px; }
.lead-plan__row { display: flex; align-items: center; gap: 10px; padding: 7px 2px; border-top: 1px solid var(--hairline); font-size: 12.5px; }
.lead-plan__ord { width: 20px; height: 20px; border-radius: 6px; background: var(--surface-2); color: var(--text-muted); font-size: 11px; font-weight: 700; display: grid; place-items: center; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.lead-plan__verb { flex: 1; min-width: 0; color: var(--text); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lead-plan__tgt { color: var(--text-muted); font-weight: 400; }
.lead-plan__cat { font-size: 10px; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase; color: var(--text-muted); background: var(--surface-2); border-radius: 999px; padding: 2px 7px; flex-shrink: 0; }
.lead-plan__imp { font-size: 12px; font-weight: 700; color: var(--text); white-space: nowrap; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.lead-plan__more { font-size: 11.5px; color: var(--text-muted); padding: 8px 2px 0; }
.lead-run { display: flex; align-items: center; gap: 14px; justify-content: space-between; border: 1px solid var(--hairline); border-radius: 12px; padding: 13px 16px; margin: 0 0 14px; background: var(--surface); }
.lead-run__title { font-size: 13.5px; font-weight: 700; letter-spacing: -0.01em; }
.lead-run__sub { font-size: 12px; color: var(--text-soft); margin-top: 2px; line-height: 1.45; }
.lead-run__text { min-width: 0; }
.ps-more > summary { cursor: pointer; width: fit-content; padding: 4px 0; font-weight: 600; color: var(--accent-ink); }
/* S48 review: on a phone the Lead's sentence takes the full width (its button goes under it), and the pending approvals
   come before the Lead run, so the first one is in view (it started 720 px down the tab, 486 before S48). */
@media (max-width: 600px) { .lead-run { flex-wrap: wrap; } .lead-run__text { flex: 1 1 100%; } }
@media (max-width: 560px) {
  .auto-view[data-auto-tab="approvals"].is-active { display: flex; flex-direction: column; }
  .auto-view[data-auto-tab="approvals"] > #leadRunBar, .auto-view[data-auto-tab="approvals"] > #leadPlanCard { order: 1; }
  .auto-view[data-auto-tab="approvals"] > #leadRunBar { margin-top: 14px; }
}
.agent-card__goal { font-size: 11.5px; color: var(--text-soft); line-height: 1.5; margin: 0 0 10px; }
.agent-card__goal span { font-weight: 700; color: var(--text); text-transform: uppercase; font-size: 9.5px; letter-spacing: 0.05em; margin-right: 5px; }
.agent-card--build { border-style: dashed; align-items: flex-start; justify-content: center; }
.agent-card--build:hover { border-color: var(--accent); }
.agent-flagship-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 12px; margin: 2px 0 8px; }
.agent-flagship { display: flex; align-items: center; gap: 18px; background: var(--gradient-soft, var(--surface)); border: 1px solid var(--accent-soft); border-radius: 16px; padding: 18px 20px; margin: 0; }
.agent-flagship__icon { width: 46px; height: 46px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--hairline); color: var(--accent); display: grid; place-items: center; flex-shrink: 0; }
.agent-flagship__icon svg { width: 22px; }
.agent-flagship__body { flex: 1; min-width: 0; }
.agent-flagship__name { font-size: 16px; font-weight: 700; letter-spacing: -0.02em; display: flex; align-items: center; gap: 9px; }
.agent-flagship__tag { font-size: 10.5px; font-weight: 700; color: var(--text-soft); background: var(--surface-2); border: 1px solid var(--hairline); padding: 3px 9px; border-radius: 999px; letter-spacing: 0.08em; text-transform: uppercase; }
.agent-flagship__desc { font-size: 12.5px; color: var(--text-soft); line-height: 1.55; margin: 5px 0 10px; }
.mem-add { display: flex; gap: 10px; margin-bottom: 16px; }
.mem-add input { flex: 1; padding: 10px 13px; border: 1px solid var(--hairline); border-radius: 10px; background: var(--surface-2); color: var(--text); font-size: 13px; }
.mem-add input:focus { outline: none; border-color: var(--accent); }
.mem-list { display: flex; flex-direction: column; gap: 8px; }
.mem-item { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--hairline); border-radius: 11px; }
.mem-item__body { flex: 1; min-width: 0; }
.mem-item__note { font-size: 13px; color: var(--text); line-height: 1.5; }
.mem-item__meta { font-size: 10.5px; color: var(--text-muted); margin-top: 4px; display: flex; align-items: center; gap: 7px; }
.mem-item__src { font-weight: 600; padding: 1px 7px; border-radius: 999px; background: var(--surface-2); }
.mem-item__src--user-told { color: var(--accent); background: var(--accent-soft); }
.mem-item__src--outcome { color: #7c3aed; background: rgba(124,58,237,0.12); }
.mem-item__src--agent-extracted { color: var(--ok); background: var(--ok-bg); }

/* ============ BUILD 4: OPERATOR COMMAND CENTER ============ */
/* Coexistence mode toggle strip — always on its own row (flex-basis:100% means
   it wraps even when parent is wide; avatar+name stay on row 1 at every width) */
.cx-mode-strip { display: flex; gap: 0; border: 1px solid var(--hairline); border-radius: 10px; overflow: hidden; background: var(--surface-2); flex-shrink: 0; min-width: 0; flex-basis: 100%; }
.cx-mode-btn { flex: 1; padding: 8px 10px; font-size: 12px; font-weight: 600; border: 0; background: transparent; color: var(--text-muted); cursor: pointer; transition: background 100ms ease, color 100ms ease; text-align: center; white-space: nowrap; }
.cx-mode-btn:hover { background: var(--surface-3); color: var(--text); }
.cx-mode-btn.is-active { background: var(--surface); color: var(--accent); box-shadow: var(--shadow-xs); }
.cx-mode-btn.is-active.cx-mode--auto { color: #b45309; }
/* Command center section chrome */
.cc-section { margin: 0 0 24px; }
.cc-section__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 10px; }
.cc-section__title { font-size: 13.5px; font-weight: 700; letter-spacing: -0.01em; }
.cc-section__sub { font-size: 12px; color: var(--text-muted); line-height: 1.5; margin: -6px 0 10px; }
.cc-section__action { font-size: 12px; color: var(--accent); background: none; border: none; cursor: pointer; padding: 0; font-weight: 600; }
/* Brand command row (shown in automations tab, top of Command Center) */
.cc-brand-row { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 14px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--hairline); border-radius: 12px; margin: 0 0 20px; }
.cc-brand-row__avatar { width: 36px; height: 36px; border-radius: 9px; background: var(--gradient); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 700; flex-shrink: 0; overflow: hidden; }
.cc-brand-row__avatar img { width: 100%; height: 100%; object-fit: cover; }
.cc-brand-row__body { flex: 1; min-width: 0; }
.cc-brand-row__name { font-size: 14px; font-weight: 700; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-brand-row__meta { font-size: 11.5px; color: var(--text-muted); margin-top: 1px; }
/* Guardrails grid */
.gr-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.gr-field label { font-size: 10.5px; font-weight: 600; color: var(--text-muted); letter-spacing: .04em; text-transform: uppercase; margin-bottom: 4px; display: block; }
.gr-field input, .gr-field select { width: 100%; padding: 7px 10px; border: 1px solid var(--hairline); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; font-size: 13px; }
.gr-field input:focus, .gr-field select:focus { outline: none; border-color: var(--accent); }
.gr-row-sw { display: flex; align-items: flex-start; gap: 12px; padding: 10px 0; border-top: 1px solid var(--hairline-soft); }
.gr-row-sw__body { flex: 1; min-width: 0; }
.gr-row-sw__label { font-size: 12.5px; font-weight: 700; color: var(--text); }
.gr-row-sw__sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; line-height: 1.5; }
/* Feed: Found / Did / Proposing */
.cc-feed { display: flex; flex-direction: column; gap: 10px; }
.cc-feed-group { }
.cc-feed-group__head { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); margin: 0 0 8px; display: flex; align-items: center; gap: 8px; }
.cc-feed-group__head span { background: var(--surface-3); padding: 1px 7px; border-radius: 999px; font-size: 10px; font-weight: 700; }
.cc-card { border: 1px solid var(--hairline); border-radius: 11px; padding: 13px 14px; background: var(--surface); display: flex; flex-direction: column; gap: 8px; transition: border-color .14s ease; }
.cc-card:hover { border-color: var(--hairline-strong, var(--text-dim)); }
.cc-card--info { border-color: rgba(0,119,182,0.2); background: rgba(0,119,182,0.03); }
.cc-card--pending { border-left: 3px solid var(--accent); }
.cc-card__head { display: flex; align-items: flex-start; gap: 9px; }
.cc-card__badge { flex-shrink: 0; padding: 2px 8px; border-radius: 999px; font-size: 10px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; white-space: nowrap; }
.cc-card__badge--found { color: #0369a1; background: rgba(3,105,161,0.1); }
.cc-card__badge--proposed { color: var(--accent); background: var(--accent-soft); }
.cc-card__badge--info { color: #0077B6; background: rgba(0,119,182,0.1); }
.cc-card__badge--executed { color: var(--ok); background: var(--ok-soft); }
.cc-card__badge--failed { color: var(--bad); background: var(--bad-soft); }
.cc-card__title { font-size: 13px; font-weight: 700; letter-spacing: -0.01em; flex: 1; min-width: 0; }
.cc-card__body { font-size: 12px; color: var(--text-soft); line-height: 1.55; }
.cc-card__impact { font-size: 12px; color: var(--ok); font-weight: 600; }
.cc-card__meta { font-size: 10.5px; color: var(--text-muted); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cc-card__task-tag { padding: 2px 7px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--hairline); font-weight: 600; font-size: 10px; letter-spacing: .02em; }
.cc-card__actions { display: flex; gap: 8px; margin-top: 2px; }
/* Attribution timeline */
.attr-timeline { display: flex; flex-direction: column; gap: 0; }
.attr-row { display: grid; grid-template-columns: 100px 1fr auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--hairline-soft); }
.attr-row:last-child { border-bottom: 0; }
.attr-row__date { font-size: 11px; color: var(--text-muted); font-weight: 500; }
.attr-row__action { font-size: 12.5px; font-weight: 600; color: var(--text); }
.attr-row__meta { font-size: 11px; color: var(--text-muted); }
.attr-row__verdict { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.attr-verdict--improved { color: var(--ok); background: var(--ok-soft); }
.attr-verdict--worsened { color: var(--bad); background: var(--bad-soft); }
.attr-verdict--flat { color: var(--text-muted); background: var(--surface-2); }
.attr-verdict--insufficient_data { color: var(--text-dim); background: var(--surface-2); }
/* Intelligence cards grid */
.intel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.intel-card { border: 1px solid var(--hairline); border-radius: 12px; padding: 15px 16px; background: var(--surface); display: flex; flex-direction: column; gap: 10px; min-height: 120px; }
.intel-card__head { display: flex; align-items: center; gap: 10px; }
.intel-card__icon { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; flex-shrink: 0; }
.intel-card__icon svg { width: 16px; }
.intel-card__icon--perf { background: rgba(0,119,182,0.1); color: #0077B6; }
.intel-card__icon--anomaly { background: var(--warn-soft); color: var(--warn); }
.intel-card__icon--health { background: var(--ok-soft); color: var(--ok); }
.intel-card__icon--portfolio { background: var(--accent-soft); color: var(--accent); }
.intel-card__title { font-size: 13px; font-weight: 700; letter-spacing: -0.01em; }
.intel-card__sub { font-size: 11.5px; color: var(--text-muted); line-height: 1.5; }
.intel-card__body { font-size: 12.5px; color: var(--text-soft); line-height: 1.55; }
.intel-card__score { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; }
.intel-card__score--good { color: var(--ok); }
.intel-card__score--warn { color: var(--warn); }
.intel-card__score--bad { color: var(--bad); }
.intel-card__loading { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-muted); }
.intel-card__spin { width: 13px; height: 13px; border-radius: 50%; border: 2px solid var(--accent); border-top-color: transparent; animation: grSpin .7s linear infinite; flex-shrink: 0; }
.intel-card__fetch-btn { margin-top: auto; font-size: 12px; padding: 7px 12px; border: 1px solid var(--hairline); border-radius: 8px; background: var(--surface-2); color: var(--text-soft); cursor: pointer; transition: background .12s ease; align-self: flex-start; }
.intel-card__fetch-btn:hover { background: var(--surface-3); color: var(--text); }
/* Empty states */
.cc-empty { text-align: center; color: var(--text-muted); padding: 30px 20px; font-size: 13px; line-height: 1.6; }
/* Mobile: Command Center responsive overrides.
   @media MUST stay after base rules — later declaration wins on equal specificity
   (feedback_mobile_css_cascade_order). Breakpoint at 600px covers viewport width;
   at 375px the content area is ~319px (375 - 56px collapsed sidebar). */
@media (max-width: 600px) {
  /* Tighter auto-body padding gives more usable width */
  .auto-body { padding: 16px 14px 48px; }
  /* Guardrails + intel grids: single column */
  .gr-grid { grid-template-columns: 1fr; }
  .intel-grid { grid-template-columns: 1fr; }
  /* Guardrail inputs and selects: always full viewport-safe width */
  .gr-field input, .gr-field select { box-sizing: border-box; max-width: 100%; }
  /* Brand row: tighter padding, avatar+name line 1, strip line 2 */
  .cc-brand-row { gap: 8px 10px; padding: 10px 12px; }
  .cc-brand-row__body { min-width: 0; flex-basis: 0; flex-grow: 1; }
  /* Mode strip: already full-width from base; tighter padding on small screens */
  .cx-mode-btn { padding: 8px 4px; font-size: 11px; }
  /* Attribution rows: drop verdict pill, compress date column */
  .attr-row { grid-template-columns: 64px 1fr; gap: 8px; }
  .attr-row__verdict { display: none; }
  /* Section heads: allow title to wrap rather than overflow */
  .cc-section__head { flex-wrap: wrap; gap: 6px; }
}
.mem-item__acts { display: flex; gap: 4px; flex-shrink: 0; }
.mem-item__acts button { background: none; border: 0; color: var(--text-muted); cursor: pointer; padding: 4px; border-radius: 7px; font-size: 11.5px; font-weight: 600; }
.mem-item__acts button:hover { background: var(--surface-2); color: var(--text); }
.mem-item__acts button.is-danger:hover { color: var(--bad); }
.ps-modal-ov { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; z-index: 100001; padding: 20px; }
.ps-modal { background: var(--surface); border: 1px solid var(--hairline); border-radius: 14px; padding: 22px; width: 400px; max-width: 92vw; box-shadow: var(--shadow-lg); }
.ps-modal__msg { font-size: 14px; color: var(--text); line-height: 1.5; white-space: pre-wrap; margin-bottom: 16px; }
.ps-modal__input { width: 100%; margin: 0 0 16px; padding: 10px 12px; border: 1px solid var(--hairline); border-radius: 10px; background: var(--surface-2); color: var(--text); font-size: 13.5px; font-family: inherit; resize: vertical; }
.ps-modal__btns { display: flex; gap: 10px; justify-content: flex-end; }
/* Slack, the one PaidSync app (22 Oct, Ahmed's yes on the setup mock vault/paidsync/slack-setup-mock-2026-10-22): the
   Slack card on Connect apps, then one glass sheet for the start, the channels and the done step. Scoped to .sk-*;
   colours come from the app tokens, so html.dark follows. */
.sk-card { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius-card); margin: 0 0 16px; overflow: hidden; }
.sk-row { display: flex; align-items: center; gap: 14px; min-height: 60px; padding: 12px 16px; position: relative; }
.sk-row + .sk-row::before, .sk-picker + .sk-row::before { content: ""; position: absolute; left: 64px; right: 0; top: 0; height: 1px; background: var(--hairline); }
.sk-tile { width: 36px; height: 36px; border-radius: 10px; background: #fff; box-shadow: inset 0 0 0 1px rgba(0,0,0,.06); display: grid; place-items: center; flex: none; }
.sk-tile img { width: 22px; height: 22px; display: block; }
.sk-ico { width: 36px; height: 36px; border-radius: 10px; background: var(--hairline-soft); display: grid; place-items: center; flex: none; color: var(--text); }
.sk-ico svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.sk-nm { flex: 1; min-width: 0; }
.sk-nm b { display: block; font-size: 15px; font-weight: 500; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sk-nm small { display: block; font-size: 13px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sk-wrap .sk-nm small { white-space: normal; }
.sk-btn { border: 0; border-radius: 999px; min-height: 40px; padding: 0 16px; font-family: inherit; font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap; flex: none; }
.sk-btn--grad { background: var(--gradient); color: #fff; box-shadow: inset 0 1px 0 rgba(255,255,255,.3); }
.sk-btn--grad:disabled { opacity: .55; cursor: default; }
.sk-end { margin: 16px 0 0; }
.sk-link2 { border: 1px solid var(--hairline); background: var(--surface); color: var(--text); border-radius: 999px; min-height: 36px; padding: 0 14px; font-family: inherit; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; flex: none; }
.sk-link2:hover { background: var(--surface-2); }
/* Settings, Notifications: an iOS-style grouped list and the Slack sheet (Ahmed 1 Nov 2026, "go ahead build"). */
:root { --i-card: var(--surface); --i-sep: rgba(60,60,67,.13); --i-2: rgba(60,60,67,.62); --i-3: rgba(60,60,67,.28); --i-fill: rgba(120,120,128,.16); --i-press: rgba(120,120,128,.13); --i-sheet: #f2f2f7; --i-mat: rgba(246,246,249,.82); --i-ring: 0 0 0 .5px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.035); }
html.dark { --i-card: #1c1c1f; --i-sep: rgba(84,84,88,.5); --i-2: rgba(235,235,245,.6); --i-3: rgba(235,235,245,.26); --i-fill: rgba(120,120,128,.34); --i-press: rgba(120,120,128,.24); --i-sheet: #0d0d11; --i-mat: rgba(30,30,34,.82); --i-ring: none; }
.ios { max-width: 640px; -webkit-font-smoothing: antialiased; }
.i-hero { background: var(--i-card); border-radius: 18px; padding: 30px 24px 24px; text-align: center; box-shadow: var(--i-ring); }
.i-stack { position: relative; width: 138px; height: 66px; margin: 0 auto 16px; }
.i-tile { position: absolute; top: 6px; width: 54px; height: 54px; border-radius: 14px; display: grid; place-items: center; transform: rotate(var(--r,0deg)) translateY(var(--y,0px)) scale(var(--s,1)); transition: transform .55s cubic-bezier(.34,1.45,.5,1), opacity .35s ease, filter .35s ease; box-shadow: 0 10px 20px -10px rgba(0,0,0,.45), inset 0 0 0 .5px rgba(0,0,0,.08); }
.i-tile svg { width: 27px; height: 27px; fill: #fff; }
.i-tile img { width: 27px; height: 27px; }
.i-tile.t-app { left: 39px; top: 0; z-index: 3; width: 60px; height: 60px; border-radius: 16px; background: linear-gradient(180deg, color-mix(in srgb, var(--blue) 74%, #fff), var(--blue)); }
.i-tile.t-app svg { width: 30px; height: 30px; }
.i-tile.t-mail { left: 2px; z-index: 2; --r: -10deg; --y: 5px; background: linear-gradient(180deg, color-mix(in srgb, #5B2D8E 72%, #fff), #5B2D8E); }
.i-tile.t-slack { right: 2px; z-index: 1; --r: 10deg; --y: 5px; background: #fff; }
.i-tile.is-off { --s: .86; opacity: .32; filter: grayscale(1); }
.i-hero h2 { font-size: 22px; line-height: 1.2; font-weight: 650; letter-spacing: -.022em; margin: 0; color: var(--text); }
.ios-head { font-size: 12.5px; font-weight: 500; letter-spacing: .035em; text-transform: uppercase; color: var(--i-2); margin: 30px 16px 7px; }
.ios-foot { font-size: 13px; line-height: 1.42; color: var(--i-2); margin: 8px 16px 0; text-wrap: pretty; }
.ios-foot.warn { color: var(--warn-strong); }
.ios-gap { margin-top: 24px; }
.ios-gap2 { margin-top: 16px; }
.ios-list { background: var(--i-card); border-radius: 14px; box-shadow: var(--i-ring); }
.ios-list > * { position: relative; }
.ios-list > * + *::before { content: ""; position: absolute; top: 0; right: 0; left: var(--inset, 16px); height: 1px; background: var(--i-sep); pointer-events: none; z-index: 1; }
.ios-list.ic-list { --inset: 60px; }
.ios-list.i-chans { --inset: 50px; }
.ios-list > :first-child, .ios-list > :first-child > .ios-row { border-top-left-radius: 14px; border-top-right-radius: 14px; }
.ios-list > :last-child, .ios-list > :last-child > .ios-row { border-bottom-left-radius: 14px; border-bottom-right-radius: 14px; }
.ios-row { position: relative; display: flex; align-items: center; gap: 12px; min-height: 50px; padding: 0 16px; width: 100%; box-sizing: border-box; border: 0; background: transparent; text-align: left; font: 400 16px/1.25 Inter, system-ui, sans-serif; letter-spacing: -.011em; color: var(--text); transition: background .2s ease; }
.ios-tap { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.ios-tap:active { background: var(--i-press); transition: none; }
.ios-tap:focus-visible, .ios-sw:focus-visible, .ios-navbtn:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.ios-ico { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; flex: none; box-shadow: inset 0 0 0 .5px rgba(0,0,0,.08); }
.ios-ico svg { width: 18px; height: 18px; fill: #fff; }
.ios-ico.purple { background: linear-gradient(180deg, color-mix(in srgb, #5B2D8E 72%, #fff), #5B2D8E); }
.ios-ico.white { background: #fff; box-shadow: inset 0 0 0 .5px rgba(0,0,0,.16); }
.ios-ico.white img { width: 18px; height: 18px; }
.ios-label { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ios-label small { display: block; font-size: 13px; line-height: 1.3; color: var(--i-2); margin-top: 1px; letter-spacing: 0; }
.ios-value { color: var(--i-2); white-space: nowrap; display: flex; align-items: center; gap: 7px; flex: none; max-width: 55%; overflow: hidden; }
.ios-value span { overflow: hidden; text-overflow: ellipsis; }
.ios-value .t { transition: opacity .14s ease; }
.ios-chev { width: 8px; height: 14px; fill: none; stroke: var(--i-3); stroke-width: 2.3; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ios-ud { width: 9px; height: 15px; fill: none; stroke: var(--i-2); stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ios-blue { color: var(--blue); }
.ios-redtx { color: var(--bad); }
.ios-center { justify-content: center; }
.i-dot { width: 8px; height: 8px; border-radius: 50%; background: #34c759; flex: none; }
.i-dot.bad { background: var(--bad); }
.i-dot.warn { background: var(--warn); }
/* The tap target is the 44 px tall button; the track and knob are drawn inside it. Off has a --text-muted outline (3:1),
   as the app's .ps-switch does (qa-phone-switches holds both). */
.ios-sw { width: 51px; height: 44px; border-radius: 999px; background: none; position: relative; border: 0; flex: none; cursor: pointer; padding: 0; }
.ios-sw::before { content: ""; position: absolute; left: 0; top: 6.5px; width: 51px; height: 31px; border-radius: 999px; background: var(--i-fill); box-shadow: inset 0 0 0 1px var(--text-muted); transition: background .25s ease, box-shadow .25s ease; }
.ios-sw::after { content: ""; position: absolute; top: 8.5px; left: 2px; width: 27px; height: 27px; border-radius: 999px; background: #fff; box-shadow: 0 3px 8px rgba(0,0,0,.15), 0 3px 1px rgba(0,0,0,.06); transition: transform .34s cubic-bezier(.3,1.3,.5,1), width .18s ease; }
.ios-sw:active::after { width: 33px; }
.ios-sw.on::before { background: var(--blue); box-shadow: none; }
.ios-sw.on::after { transform: translateX(20px); }
.ios-sw.on:active::after { transform: translateX(14px); }
.ios-sw:disabled { opacity: .45; cursor: default; }
.ios-sw:disabled::after { width: 27px; }
.i-grp { transition: opacity .3s ease, filter .3s ease; }
.i-dim { opacity: .38; filter: saturate(.5); pointer-events: none; }
.ios-wrap { position: relative; }
.ios-menu { position: absolute; right: 10px; top: calc(100% - 6px); z-index: 60; min-width: 244px; border-radius: 13px; overflow: hidden; background: var(--i-mat); -webkit-backdrop-filter: blur(30px) saturate(180%); backdrop-filter: blur(30px) saturate(180%); box-shadow: 0 0 0 .5px rgba(0,0,0,.1), 0 14px 44px rgba(0,0,0,.2); transform-origin: top right; animation: iosMenu .26s cubic-bezier(.2,.9,.3,1.14); }
.ios-menu.up { top: auto; bottom: calc(100% - 6px); transform-origin: bottom right; }
@keyframes iosMenu { from { opacity: 0; transform: scale(.82); } }
.ios-menu.out { opacity: 0; transform: scale(.92); transition: opacity .14s ease, transform .14s ease; }
.ios-menu button { position: relative; display: flex; align-items: center; gap: 8px; width: 100%; min-height: 44px; padding: 0 16px 0 12px; border: 0; background: none; font: 400 16px Inter, system-ui, sans-serif; letter-spacing: -.011em; color: var(--text); text-align: left; cursor: pointer; }
.ios-menu button + button::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1px; background: var(--i-sep); }
.ios-menu button:active, .ios-menu button:focus-visible { background: var(--i-press); outline: none !important; box-shadow: none !important; }
.ios-menu .gap { height: 8px; background: rgba(120,120,128,.12); }
.ios-menu .ck { width: 18px; height: 18px; flex: none; fill: none; stroke: var(--text); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; visibility: hidden; }
.ios-menu button.sel .ck { visibility: visible; }
.ios-ov { position: fixed; inset: 0; z-index: 100000; /* the agent dialog's layer: above the consent banner, under the alert and the toasts */ display: flex; align-items: center; justify-content: center; padding: 24px; }
.ios-scrim { position: absolute; inset: 0; background: rgba(0,0,0,.32); animation: iosFade .3s ease; }
@keyframes iosFade { from { opacity: 0; } }
.ios-ov.closing .ios-scrim { opacity: 0; transition: opacity .3s ease; }
.ios-sheet { position: relative; width: min(540px, 100%); height: min(720px, 100%); background: var(--i-sheet); border-radius: 20px; overflow: hidden; box-shadow: 0 30px 80px rgba(0,0,0,.3), 0 0 0 .5px rgba(0,0,0,.08); animation: iosIn .46s cubic-bezier(.32,.72,0,1); will-change: transform; }
.ios-sheet:focus, .ios-sheet:focus-visible, .i-alert button:focus { outline: none !important; }
.i-alert button:focus-visible { background: var(--i-press); box-shadow: none !important; }
@keyframes iosIn { from { opacity: 0; transform: translateY(26px) scale(.985); } }
.ios-ov.closing .ios-sheet { opacity: 0; transform: translateY(18px) scale(.985); transition: opacity .22s ease, transform .32s cubic-bezier(.32,.72,0,1); }
.ios-nav { position: absolute; top: 0; left: 0; right: 0; z-index: 5; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; height: 54px; padding: 0 8px; border-bottom: 1px solid transparent; transition: background .2s ease, border-color .2s ease; }
.ios-nav.edge { background: var(--i-mat); -webkit-backdrop-filter: blur(24px) saturate(180%); backdrop-filter: blur(24px) saturate(180%); border-bottom-color: var(--i-sep); }
.ios-nav b { font-size: 16px; font-weight: 600; letter-spacing: -.012em; color: var(--text); text-align: center; opacity: 0; transition: opacity .18s ease; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.ios-nav.titled b { opacity: 1; }
.ios-navbtn { border: 0; background: none; font: 400 16px Inter, system-ui, sans-serif; letter-spacing: -.011em; color: var(--blue); cursor: pointer; min-height: 44px; padding: 0 8px; display: flex; align-items: center; gap: 3px; justify-self: start; border-radius: 10px; max-width: 150px; }
.ios-navbtn span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ios-navbtn.done { font-weight: 600; justify-self: end; }
.ios-navbtn svg { width: 12px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ios-navbtn[hidden] { visibility: hidden; display: flex; }
.ios-pages { position: absolute; inset: 0; overflow: hidden; }
.ios-page { position: absolute; inset: 0; overflow-y: auto; overscroll-behavior: contain; padding: 58px 18px 36px; background: var(--i-sheet); will-change: transform; transition: transform .5s cubic-bezier(.32,.72,0,1), filter .5s ease; touch-action: pan-y; }
.ios-page.back { transform: translateX(-30%); filter: brightness(.94); }
.ios-page.ahead { transform: translateX(100%); }
.ios-page.ahead, .ios-page.back { pointer-events: none; }
.ios-page:not(:first-child) { box-shadow: -12px 0 32px rgba(0,0,0,.07); }
.i-large { font-size: 32px; line-height: 1.1; font-weight: 700; letter-spacing: -.026em; margin: 2px 2px 18px; color: var(--text); }
.i-av { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 10px; background: linear-gradient(180deg, #a7acb8, #868b97); color: #fff; font: 600 24px/1 Inter, system-ui, sans-serif; letter-spacing: .01em; flex: none; }
.i-av.sm { width: 32px; height: 32px; margin: 0; font-size: 12.5px; }
.i-bhead { text-align: center; padding: 4px 0 2px; }
.i-bhead h3 { font-size: 22px; line-height: 1.2; font-weight: 650; letter-spacing: -.022em; margin: 0; color: var(--text); }
.i-bhead p { margin: 5px 0 0; font-size: 14px; color: var(--i-2); display: flex; gap: 7px; align-items: center; justify-content: center; }
.i-note { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; background: var(--i-card); border-radius: 14px; margin-top: 20px; box-shadow: var(--i-ring); }
.i-note .x { width: 22px; height: 22px; border-radius: 50%; background: var(--bad); color: #fff; display: grid; place-items: center; flex: none; font: 700 13px/1 Inter, system-ui, sans-serif; margin-top: 1px; }
.i-note b { display: block; font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.i-note span { font-size: 14px; line-height: 1.42; color: var(--i-2); }
.i-pv { background: var(--i-card); border-radius: 14px; overflow: hidden; box-shadow: var(--i-ring); }
.i-pv__top { display: flex; align-items: center; gap: 8px; padding: 11px 14px; border-bottom: 1px solid var(--i-sep); font: 600 14px/1 Inter, system-ui, sans-serif; color: var(--text); }
.i-pv__top img { width: 15px; height: 15px; }
.i-pv__top small { margin-left: auto; font-weight: 500; font-size: 12px; color: var(--i-2); }
.i-pv__body { padding: 12px 14px 6px; display: grid; grid-template-columns: 36px minmax(0,1fr); column-gap: 10px; }
.i-pv__body > * { grid-column: 2; }
.i-pv__av { grid-column: 1; grid-row: 1 / span 7; width: 36px; height: 36px; border-radius: 8px; background: #fff url(/favicon.svg) center/22px no-repeat; box-shadow: inset 0 0 0 .5px rgba(0,0,0,.14); }
.i-pv__who { font: 700 14.5px/1.2 Inter, system-ui, sans-serif; color: var(--text); display: flex; align-items: center; gap: 6px; padding-top: 1px; }
.i-pv__who em { font-style: normal; font-size: 10px; font-weight: 600; padding: 2px 4px; border-radius: 3px; background: var(--i-fill); color: var(--i-2); letter-spacing: .02em; }
.i-pv__who time { font-weight: 400; font-size: 12px; color: var(--i-2); }
.i-msg { display: grid; grid-template-rows: 1fr; opacity: 1; transition: grid-template-rows .44s cubic-bezier(.32,.72,0,1), opacity .26s ease; }
.i-msg.off { grid-template-rows: 0fr; opacity: 0; }
.i-msg > div { overflow: hidden; min-height: 0; }
.i-msg p { margin: 0; padding: 4px 0 6px; font-size: 14.5px; line-height: 1.42; color: var(--text); }
.i-msg p b { font-weight: 600; }
.i-msg .i-pv__none { color: var(--i-2); }
.i-pv__btns { display: flex; gap: 8px; padding: 2px 0 8px; }
.i-pv__btns span { font: 600 13px/1 Inter, system-ui, sans-serif; padding: 8px 12px; border-radius: 6px; box-shadow: inset 0 0 0 1px var(--i-3); color: var(--text); }
.i-pv__btns .p { background: #007a5a; color: #fff; box-shadow: none; }
.i-search { display: flex; align-items: center; gap: 7px; height: 38px; padding: 0 10px; border-radius: 11px; background: var(--i-fill); margin: 2px 0 16px; }
.i-search svg { width: 16px; height: 16px; stroke: var(--i-2); fill: none; stroke-width: 2; stroke-linecap: round; flex: none; }
.i-search input { flex: 1; min-width: 0; border: 0; background: transparent; font: 400 16px Inter, system-ui, sans-serif; color: var(--text); outline: none; -webkit-appearance: none; appearance: none; }
.i-search input::placeholder { color: var(--i-2); }
.i-hash { width: 22px; flex: none; text-align: center; color: var(--i-2); font-weight: 500; }
.i-hash svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 1.8; vertical-align: -1px; }
.i-ck { width: 18px; height: 18px; stroke: var(--blue); fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.i-spin { width: 17px; height: 17px; border-radius: 50%; border: 2px solid var(--i-3); border-top-color: var(--i-2); animation: iSpin .7s linear infinite; flex: none; }
@keyframes iSpin { to { transform: rotate(360deg); } }
.ios-row.ok { color: #34a853; }
.ios-row.err { color: var(--bad); }
.ios-row.busy { pointer-events: none; }
.ios-row .i-ck2 { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; margin-right: 2px; }
.i-alert-ov { position: fixed; inset: 0; z-index: 100001; background: rgba(0,0,0,.22); display: grid; place-items: center; animation: iosFade .2s ease; }
.i-alert { width: 280px; border-radius: 16px; background: var(--i-mat); -webkit-backdrop-filter: blur(30px) saturate(180%); backdrop-filter: blur(30px) saturate(180%); text-align: center; overflow: hidden; box-shadow: 0 20px 50px rgba(0,0,0,.25); animation: iAlert .32s cubic-bezier(.34,1.3,.5,1); }
@keyframes iAlert { from { opacity: 0; transform: scale(1.14); } }
.i-alert h4 { font: 600 17px/1.3 Inter, system-ui, sans-serif; margin: 20px 16px 4px; color: var(--text); letter-spacing: -.012em; }
.i-alert p { font-size: 13px; line-height: 1.4; margin: 0 16px 18px; color: var(--text); }
.i-alert button { display: block; width: 100%; min-height: 46px; border: 0; border-top: 1px solid var(--i-sep); background: none; font: 400 17px Inter, system-ui, sans-serif; letter-spacing: -.012em; color: var(--blue); cursor: pointer; }
.i-alert button.red { color: var(--bad); }
.i-alert button.bold { font-weight: 600; }
.i-alert button:active { background: var(--i-press); }
@media (max-width: 640px) {
  body.i-sheet-open { background: #000; }
  #app { transition: transform .5s cubic-bezier(.32,.72,0,1), border-radius .5s cubic-bezier(.32,.72,0,1), filter .5s ease; transform-origin: 50% 0; }
  body.i-sheet-open #app { transform: translateY(12px) scale(.94); border-radius: 14px; overflow: hidden; filter: brightness(.82); }
  .ios-ov { align-items: flex-end; padding: 0; }
  .ios-scrim { background: rgba(0,0,0,.18); }
  .ios-sheet { width: 100%; height: calc(100% - 44px); border-radius: 14px 14px 0 0; animation: iosUp .5s cubic-bezier(.32,.72,0,1); }
  @keyframes iosUp { from { transform: translateY(100%); } }
  .ios-ov.closing .ios-sheet { opacity: 1; transform: translateY(100%); transition: transform .38s cubic-bezier(.32,.72,0,1); }
  .ios-nav { height: 62px; padding: 8px 6px 0; touch-action: none; }
  .ios-nav::before { content: ""; position: absolute; top: 6px; left: 50%; width: 36px; height: 5px; margin-left: -18px; border-radius: 3px; background: var(--i-3); }
  .ios-page { padding: 68px 16px 40px; }
  .i-hero { padding: 26px 14px 22px; }
  .ios-label { white-space: normal; padding: 13px 0; line-height: 1.25; }
  .ios-value { max-width: 48%; }
  .i-alert-ov { place-items: end center; padding: 0 8px calc(10px + env(safe-area-inset-bottom)); }
  .i-alert { width: 100%; max-width: 420px; background: none; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; border-radius: 0; overflow: visible; animation: iSheetUp .42s cubic-bezier(.32,.72,0,1); }
  @keyframes iSheetUp { from { transform: translateY(110%); } }
  .i-alert .g { background: var(--i-mat); -webkit-backdrop-filter: blur(30px) saturate(180%); backdrop-filter: blur(30px) saturate(180%); border-radius: 14px; overflow: hidden; }
  .i-alert h4 { font-size: 13px; font-weight: 600; color: var(--i-2); margin: 14px 16px 2px; }
  .i-alert p { font-size: 13px; color: var(--i-2); margin: 0 16px 14px; }
  .i-alert button { min-height: 56px; font-size: 19px; }
  .i-alert .c { margin-top: 8px; background: var(--i-card); border-radius: 14px; overflow: hidden; }
  .i-alert .c button { border-top: 0; }
}
@media (prefers-reduced-motion: reduce) { .ios-page, .ios-sheet, .ios-menu, .ios-sw::before, .ios-sw::after, .i-tile, .i-msg, #app, .i-alert { transition: none !important; animation: none !important; } }
.sk-link { background: none; border: 0; color: var(--blue); font-family: inherit; font-size: 15px; font-weight: 500; cursor: pointer; min-height: 44px; padding: 0 0 0 10px; flex: none; }
html.dark .sk-link, html.dark .sk-chan:not(.set), html.dark .notif-popover__slack { color: #4aa3d9; }
.sk-muted { font-size: 14px; color: var(--text-muted); white-space: nowrap; flex: none; }
.sk-ov { position: fixed; inset: 0; z-index: 100000; background: rgba(10,10,22,.38); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); display: flex; justify-content: center; align-items: flex-start; padding: 64px 16px 40px; overflow-y: auto; }
.sk-sheet { outline: none; width: 100%; max-width: 460px; background: var(--surface); background: color-mix(in srgb, var(--surface) 96%, transparent); -webkit-backdrop-filter: blur(28px) saturate(170%); backdrop-filter: blur(28px) saturate(170%); border-radius: 32px; padding: 26px 24px 22px; box-shadow: 0 0 0 1px var(--hairline), 0 40px 90px -36px rgba(0,0,0,.45); color: var(--text); }
.sk-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.sk-lockup { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 700; }
.sk-lockup img { width: 32px; height: 32px; border-radius: 9px; }
.sk-x { width: 44px; height: 44px; border-radius: 999px; border: 0; background: var(--hairline-soft); color: var(--text); display: grid; place-items: center; cursor: pointer; }
.sk-x svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; }
.sk-steps { display: flex; gap: 5px; margin: 0 0 18px; }
.sk-steps i { display: block; height: 4px; flex: 1; border-radius: 2px; background: var(--hairline); }
.sk-steps i.on { background: var(--gradient); }
.sk-sheet h2 { font-size: 26px; line-height: 1.15; letter-spacing: -.025em; font-weight: 700; margin: 0 0 8px; color: var(--text); }
.sk-sub { color: var(--text-muted); font-size: 15px; margin: 0 0 20px; line-height: 1.45; }
.sk-center { text-align: center; }
.sk-pair { display: flex; justify-content: center; gap: 18px; margin: 4px 0 22px; }
.sk-pair span { width: 56px; height: 56px; border-radius: 15px; background: #fff; box-shadow: inset 0 0 0 1px rgba(0,0,0,.06), 0 8px 24px -10px rgba(0,0,0,.35); display: grid; place-items: center; overflow: hidden; }
.sk-pair img { width: 32px; height: 32px; } .sk-pair img.ps { width: 56px; height: 56px; }
.sk-group { background: var(--surface); border: 1px solid var(--hairline); border-radius: 20px; overflow: hidden; margin: 0 0 16px; }
.sk-done { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-muted); margin: 0 0 14px; }
.sk-done img { width: 16px; height: 16px; } .sk-done svg { width: 16px; height: 16px; stroke: #7CB518; stroke-width: 2.4; fill: none; stroke-linecap: round; flex: none; }
.sk-pill { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; border: 0; border-radius: 999px; min-height: 52px; padding: 0 20px; font-family: inherit; font-size: 16px; font-weight: 600; cursor: pointer; text-decoration: none; }
.sk-pill--grad { background: var(--gradient); color: #fff; box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 12px 30px -14px rgba(91,45,142,.65); }
.sk-pill--grad:disabled { background: var(--hairline); color: var(--text-muted); box-shadow: none; cursor: not-allowed; }
.sk-pill .sl { width: 24px; height: 24px; border-radius: 7px; background: #fff; display: grid; place-items: center; } .sk-pill .sl img { width: 15px; height: 15px; }
.sk-quiet { display: block; width: 100%; text-align: center; font-family: inherit; font-size: 15px; color: var(--text-muted); background: none; border: 0; min-height: 44px; margin-top: 6px; cursor: pointer; }
.sk-hint { text-align: center; font-size: 13px; color: var(--text-muted); margin: 12px 0 0; }
.sk-mark { width: 36px; height: 36px; border-radius: 10px; background: linear-gradient(135deg,#1B2B7B 0%,#5B2D8E 55%,#7CB518 100%); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; flex: none; }
.sk-chan { display: flex; align-items: center; gap: 6px; font-family: inherit; font-size: 15px; font-weight: 500; color: var(--blue); background: none; border: 0; cursor: pointer; min-height: 44px; padding: 0 0 0 8px; max-width: 46%; min-width: 0; }
.sk-chan.set { color: var(--text); } .sk-chan span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sk-chan svg { width: 14px; height: 14px; stroke: var(--text-muted); stroke-width: 2; fill: none; stroke-linecap: round; flex: none; }
.sk-brand.open .sk-chan svg { transform: rotate(180deg); }
.sk-picker { padding: 4px 12px 12px 64px; position: relative; }
.sk-picker::before { content: ""; position: absolute; left: 64px; right: 0; top: 0; height: 1px; background: var(--hairline); }
.sk-search { box-sizing: border-box; width: 100%; margin: 10px 0 6px; padding: 0 12px; min-height: 40px; border-radius: 12px; border: 0; background: var(--hairline-soft); color: var(--text); font-family: inherit; font-size: 14px; }
.sk-opt { display: flex; align-items: center; gap: 10px; width: 100%; background: none; border: 0; color: var(--text); text-align: left; padding: 9px 6px; min-height: 44px; border-radius: 10px; cursor: pointer; font-family: inherit; font-size: 15px; }
.sk-opt:hover { background: var(--hairline-soft); }
.sk-opt .h { width: 18px; color: var(--text-muted); text-align: center; flex: none; }
.sk-opt .ck { margin-left: auto; width: 16px; height: 16px; stroke: var(--blue); stroke-width: 2.4; fill: none; stroke-linecap: round; flex: none; }
.sk-phint { font-size: 13px; color: var(--text-muted); margin: 8px 6px 2px; line-height: 1.45; }
.sk-err { font-size: 13px; color: var(--bad); margin: 2px 0 0; white-space: normal; }
.sk-sw { width: 51px; height: 31px; border-radius: 999px; background: var(--hairline); position: relative; flex: none; border: 0; cursor: pointer; }
.sk-sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.25); transition: transform .2s; }
.sk-sw.on { background: var(--blue); } .sk-sw.on::after { transform: translateX(20px); }
.sk-msg { display: grid; grid-template-columns: 36px 1fr; gap: 10px; padding: 14px 16px; }
.sk-msg img { width: 36px; height: 36px; border-radius: 8px; }
.sk-msg .n { font-size: 15px; font-weight: 700; } .sk-msg .n i { font-style: normal; font-size: 10px; font-weight: 600; background: var(--hairline); color: var(--text-muted); border-radius: 3px; padding: 1px 4px; margin-left: 4px; vertical-align: 2px; }
.sk-msg p { margin: 2px 0 0; font-size: 15px; }
.notif-popover__slack { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; border-top: 1px solid var(--hairline); background: none; padding: 12px 14px; min-height: 48px; color: var(--blue); font-family: inherit; font-size: 14px; font-weight: 500; cursor: pointer; }
.notif-popover__slack img { width: 18px; height: 18px; }
.sk-card { border: 1px solid var(--hairline); }
.sk-card [data-sk="act"] { display: contents; }
.sk-card [data-sk="body"] .sk-nm b, .sk-card [data-sk="body"] .sk-nm small, .sk-brand .sk-nm b, .sk-brand .sk-nm small { white-space: normal; text-wrap: pretty; overflow-wrap: anywhere; }
.sk-btn { min-height: 44px; }
.sk-ov .sk-sheet:focus, .sk-ov .sk-sheet:focus-visible { outline: none; box-shadow: 0 0 0 1px var(--hairline), 0 40px 90px -36px rgba(0,0,0,.45); }
.sk-msg { grid-template-columns: 36px minmax(0, 1fr); }
.sk-msg p { overflow-wrap: anywhere; }
.sk-sheet p, .sk-sub, .sk-hint, .sk-phint, .sk-err, .sk-msg p { text-wrap: pretty; }
.sk-nowrap { white-space: nowrap; }
.sk-rowerr { margin: -4px 0 0; padding: 0 16px 12px 64px; }
html.dark .sk-err { color: #f87171; }
.sk-searchwrap { position: relative; display: block; }
.sk-searchwrap svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; stroke: var(--text-muted); stroke-width: 2; fill: none; stroke-linecap: round; pointer-events: none; margin-top: 2px; }
.sk-search { min-height: 44px; padding-left: 34px; }
.sk-lockup .wm { height: 19px; width: auto; display: block; }
html.dark .sk-lockup .wm { filter: brightness(0) invert(1); }
.sk-ov { background: rgba(246,245,251,.55); }
html.dark .sk-ov { background: rgba(6,6,14,.55); }
html.dark .sk-group { background: rgba(255,255,255,.04); }
.sk-nm small, .sk-sub, .sk-hint, .sk-phint, .sk-done, .sk-muted, .sk-quiet { color: #6e6e73; }
html.dark .sk-nm small, html.dark .sk-sub, html.dark .sk-hint, html.dark .sk-phint, html.dark .sk-done, html.dark .sk-muted, html.dark .sk-quiet { color: var(--text-muted); }
@media (max-width: 440px) { .sk-sheet { padding: 22px 16px 18px; border-radius: 26px; } .sk-ov { padding: 56px 10px 30px; } .sk-sheet h2 { font-size: 23px; } .sk-picker { padding-left: 14px; } .sk-picker::before { left: 14px; } .sk-rowerr { padding-left: 16px; } .sk-card .sk-row.sk-wrap { flex-wrap: wrap; } .sk-card .sk-row.sk-wrap .sk-btn { width: 100%; } .sk-card .sk-muted { display: none; } }
/* Link Slack (slackLinkDialog): who is being linked to which login, in two labelled rows. Scoped to .sl__* so the
   shared .ps-modal is untouched; the 44px buttons at 375 come from the shared .ps-modal .modal-btn rule. */
.sl__title { font-size: 15px; font-weight: 600; margin: 0 0 10px; }
.sl__id { margin: 0 0 14px; padding: 12px 14px; border: 1px solid var(--hairline); border-radius: 10px; background: var(--surface-2); display: grid; gap: 8px; }
.sl__id div { display: grid; grid-template-columns: 104px 1fr; gap: 10px; align-items: baseline; }
.sl__id dt { font-size: 12.5px; color: var(--text-soft); margin: 0; }
.sl__id dd { margin: 0; font-size: 14px; line-height: 1.4; overflow-wrap: anywhere; min-width: 0; }
.sl__id b { font-weight: 600; }
.sl__what { font-size: 13.5px; line-height: 1.5; color: var(--text-soft); margin: 0 0 6px; }
.sl__note { font-size: 13px; line-height: 1.45; color: var(--text-soft); margin: 0 0 18px; }
@media (max-width: 560px) { .sl__id div { grid-template-columns: 1fr; gap: 2px; } }
/* Cancel-reason step. About a third of cancellations are requested within a
   day of paying, so this is often the moment the person is still present to answer.
   One question, optional, never blocking: a cancellation must never be
   harder than it was before. */
.ps-reason__q { font-size: 14px; color: var(--text); font-weight: 600; margin: 0 0 4px; }
.ps-reason__sub { font-size: 12.5px; color: var(--text-dim); margin: 0 0 14px; line-height: 1.45; }
/* This modal is taller than psConfirm (five options plus a textarea plus a
   button row), so it needs a height guard psConfirm never did. Scoped to the
   reason step only: .ps-modal is shared by every confirm in the app and must
   not be touched here. On a short viewport the card scrolls rather than
   pushing its buttons off screen, which would make cancelling impossible. */
.ps-modal--reason { max-height: 86vh; overflow-y: auto; }
.ps-reason__opts { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.ps-reason__opt { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 11px 13px; border: 1px solid var(--hairline); border-radius: 10px; background: var(--surface-2); color: var(--text); font-size: 13.5px; font-family: inherit; cursor: pointer; transition: border-color .12s, background .12s; min-height: 44px; }
.ps-reason__opt:hover { border-color: var(--text-dim); }
.ps-reason__opt[aria-pressed="true"] { border-color: var(--accent, #0077B6); background: var(--surface); box-shadow: inset 0 0 0 1px var(--accent, #0077B6); }
.ps-reason__skip { background: none; border: 0; color: var(--text-dim); font-size: 12.5px; font-family: inherit; cursor: pointer; padding: 0; text-decoration: underline; }
/* Win-back offer (api/_winback-offer.js, Ahmed 2026-10-12): on /welcome-back only (off Cancel plan since 2026-10-27).
   Every number on it comes from the server's quote; nothing here holds a price. Scoped to its own classes so
   the shared .ps-modal is untouched. Layout: Lena's direction B "Growth", approved by Ahmed 2026-10-12. */
/* Inter 300 for the light 50% (the same self-hosted variable files as the 400 to 800 weights in /vendor/fonts). */
/* cyrillic-ext */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url(/vendor/fonts/google/inter/v20/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa2JL7W0Q5n-wU.woff2) format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
/* cyrillic */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url(/vendor/fonts/google/inter/v20/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa0ZL7W0Q5n-wU.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* greek-ext */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url(/vendor/fonts/google/inter/v20/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa2ZL7W0Q5n-wU.woff2) format('woff2');
  unicode-range: U+1F00-1FFF;
}
/* greek */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url(/vendor/fonts/google/inter/v20/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa1pL7W0Q5n-wU.woff2) format('woff2');
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}
/* vietnamese */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url(/vendor/fonts/google/inter/v20/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa2pL7W0Q5n-wU.woff2) format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url(/vendor/fonts/google/inter/v20/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa25L7W0Q5n-wU.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url(/vendor/fonts/google/inter/v20/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa1ZL7W0Q5nw.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* A column whose middle scrolls and whose footer (the way out) never does, at any screen height. */
.ps-modal--winback { width: 600px; border-radius: 20px; max-width: 100%; padding: 0; max-height: 88vh; max-height: calc(100dvh - 40px); display: flex; flex-direction: column; overflow: hidden; }
.ps-wb__scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 40px 40px 32px; }
.ps-wb__foot { flex: 0 0 auto; display: flex; flex-wrap: wrap; align-items: center; gap: 0 32px; padding: 0 40px; border-top: 1px solid var(--hairline); }
.ps-wb__link { background: none; border: 0; padding: 0; color: var(--accent-ink, #5B2D8E); font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; }
.ps-wb__title { font-size: 34px; line-height: 1.08; font-weight: 700; letter-spacing: -.04em; color: var(--text); margin: 0 0 16px; }
.ps-wb__line { font-size: 16px; line-height: 1.55; letter-spacing: -.01em; color: var(--text-soft); margin: 0 0 26px; text-wrap: pretty; }
/* Title and line on the left, the plant on the right; on phones the plant sits above the title. */
.ps-wb__hero { display: grid; grid-template-columns: 1fr auto; gap: 0 16px; align-items: end; margin-bottom: 32px; }
.ps-wb__hero .ps-wb__title { margin: 0 0 16px; }
.ps-wb__hero .ps-wb__line { margin: 0; }
.ps-wb__illo { grid-column: 2; grid-row: 1 / span 2; width: 176px; height: 152px; display: flex; align-items: flex-end; justify-content: flex-end; }
.ps-wb__illo img { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; }
.ps-wb__opts { display: flex; flex-direction: column; gap: 24px; }
/* The ticket: a green stub with the 50%, a perforation, the offer. One button, the whole ticket is the click target. */
.ps-wb__tk { --sw: 176px; --body: #FBF9F1; --stub: linear-gradient(165deg, #8FC620 0%, #7CB518 48%, #6AA312 100%); --ink: #0f2205; --cap: #1d3410; --perf: rgba(78,120,12,.5); --pr: #12140c; --fine: #5a5d50;
  position: relative; display: grid; grid-template-columns: var(--sw) 1fr; width: 100%; padding: 0; border: 0; border-radius: 16px; background: var(--body); color: var(--pr); font: inherit; text-align: left; cursor: pointer; min-height: 44px; transition: transform .2s cubic-bezier(.2,.7,.2,1), box-shadow .2s; }
.ps-wb__tk::before, .ps-wb__tk::after { content: ""; position: absolute; left: calc(var(--sw) - 12px); width: 24px; height: 24px; border-radius: 50%; background: var(--surface); z-index: 2; }
.ps-wb__tk::before { top: -12px; clip-path: inset(50% 0 0 0); }
.ps-wb__tk::after { bottom: -12px; clip-path: inset(0 0 50% 0); }
.ps-wb__tk--best { box-shadow: 0 0 0 1px rgba(70,105,12,.10), 0 1px 2px rgba(20,30,8,.16), 0 2px 6px rgba(20,30,8,.08), 0 28px 44px -18px rgba(40,68,8,.34); }
.ps-wb__tk--best:hover { transform: translateY(-1px); box-shadow: 0 0 0 1px rgba(70,105,12,.12), 0 1px 2px rgba(20,30,8,.16), 0 2px 6px rgba(20,30,8,.08), 0 32px 48px -18px rgba(40,68,8,.38); }
.ps-wb__tk:focus-visible { outline: 2px solid #0077B6; outline-offset: 3px; }
.ps-wb__tk:disabled { opacity: .6; cursor: default; transform: none; }
.ps-wb__stub { position: relative; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; padding: 24px 16px 24px 24px; background: var(--stub); color: var(--ink); border-radius: 16px 0 0 16px; box-shadow: inset 0 1px 0 rgba(255,255,255,.28), inset 0 -1px 0 rgba(30,60,0,.12); }
.ps-wb__n { font-size: 68px; line-height: .9; font-weight: 300; letter-spacing: -.07em; margin-left: -3px; }
.ps-wb__cap { font-size: 13px; margin-top: 12px; color: var(--cap); font-weight: 500; letter-spacing: 0; }
.ps-wb__main { position: relative; display: block; padding: 24px 24px 24px 32px; }
.ps-wb__main::before { content: ""; position: absolute; left: -.75px; top: 16px; bottom: 16px; width: 1.5px; background: repeating-linear-gradient(to bottom, var(--perf) 0 4px, transparent 4px 9px); border-radius: 1px; }
.ps-wb__head { display: block; text-wrap: balance; font-size: 17px; line-height: 1.3; font-weight: 600; letter-spacing: -.02em; }
.ps-wb__price { display: block; margin-top: 8px; font-variant-numeric: tabular-nums; text-wrap: pretty; }
.ps-wb__price b { display: block; font-size: 26px; line-height: 1.15; font-weight: 650; letter-spacing: -.035em; color: var(--pr); }
.ps-wb__was { display: block; font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.ps-wb__was s { text-decoration-thickness: 1px; text-decoration-color: rgba(106,106,112,.8); }
.ps-wb__fine { display: block; margin-top: 12px; font-size: 13px; line-height: 1.55; color: var(--fine); }
.ps-wb__fine > span { display: block; text-wrap: pretty; }
.ps-wb__cta { display: flex; align-items: center; justify-content: center; width: 100%; height: 48px; margin-top: 20px; border-radius: 999px; font-size: 15px; font-weight: 600; letter-spacing: -.01em; white-space: nowrap; background: #0077B6; color: #fff; box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,60,100,.35), 0 6px 14px -6px rgba(0,90,140,.5); transition: background .15s; }
.ps-wb__tk:hover .ps-wb__cta { background: #0a84c6; }
/* The 3-month ticket: flat, lighter, a quiet tinted button. */
.ps-wb__tk--sm { --body: #F6F8EE; --stub: #EBF3D3; --ink: #44720b; --cap: #4d5a38; --perf: rgba(78,120,12,.35); box-shadow: none; }
.ps-wb__tk--sm .ps-wb__stub { box-shadow: none; padding-top: 16px; padding-bottom: 16px; }
.ps-wb__tk--sm .ps-wb__main { padding-top: 16px; padding-bottom: 16px; }
.ps-wb__tk--sm .ps-wb__n { font-size: 48px; }
.ps-wb__tk--sm .ps-wb__head { font-size: 16px; }
.ps-wb__tk--sm .ps-wb__price { margin-top: 4px; font-size: 14px; color: var(--text-soft); }
.ps-wb__tk--sm .ps-wb__price b { display: inline; font-size: inherit; font-weight: 600; letter-spacing: 0; }
.ps-wb__tk--sm .ps-wb__cta { background: rgba(0,119,182,.09); color: #00598A; box-shadow: none; margin-top: 16px; }
.ps-wb__tk--sm:hover .ps-wb__cta { background: rgba(0,119,182,.16); }
.ps-wb__tk--sm:hover { transform: none; }
html.dark .ps-wb__tk { --body: #161b10; --stub: linear-gradient(165deg, #86BC1C 0%, #78AE17 48%, #699F12 100%); --perf: rgba(150,205,50,.5); --pr: #f3f5ec; --fine: #b9bcab; }
html.dark .ps-wb__tk--best { box-shadow: 0 0 0 1px rgba(150,205,50,.22), 0 1px 2px rgba(0,0,0,.6), 0 2px 6px rgba(0,0,0,.4), 0 28px 44px -18px rgba(0,0,0,.8); }
html.dark .ps-wb__tk--sm { --body: #121510; --stub: #1b2611; --ink: #A9D653; --cap: #b4c29a; --perf: rgba(150,205,50,.3); box-shadow: none; }
html.dark .ps-wb__cta { background: #0A82C4; }
html.dark .ps-wb__tk:hover .ps-wb__cta { background: #1590d4; }
html.dark .ps-wb__tk--sm .ps-wb__cta { background: rgba(77,177,232,.14); color: #7CCBF2; }
html.dark .ps-wb__tk--sm:hover .ps-wb__cta { background: rgba(77,177,232,.24); }
.ps-wb__err { font-size: 13px; color: var(--bad); margin: 0 0 12px; line-height: 1.45; }
.ps-wb__err[hidden] { display: none; }
html.dark .ps-wb__err { color: #f87171; }
/* The way out: both links the same size. */
.ps-wb__quiet { background: none; border: 0; padding: 0; min-height: 56px; font: inherit; font-size: 14px; color: var(--text-soft); text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--text-muted); cursor: pointer; }
.ps-wb__quiet:hover { color: var(--text); }
.ps-wb__btns { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; justify-content: flex-end; margin-top: 18px; }
.ps-wb__btns a.modal-btn { text-decoration: none; }
@media (max-width: 600px) {
  .ps-modal-ov:has(> .ps-modal--winback) { padding: 12px; }
  .ps-modal--winback { max-height: calc(100dvh - 24px); border-radius: 18px; }
  .ps-wb__scroll { padding: 24px 24px 24px; }
  .ps-wb__title { font-size: 30px; margin-bottom: 8px; }
  .ps-wb__line { font-size: 15px; margin-bottom: 22px; }
  .ps-wb__hero { grid-template-columns: 1fr; margin-bottom: 24px; }
  .ps-wb__illo { grid-column: 1; grid-row: 1; width: 100%; height: 120px; justify-content: flex-start; margin-bottom: 16px; }
  .ps-wb__hero .ps-wb__title { margin-bottom: 8px; }
  .ps-wb__opts { gap: 16px; }
  .ps-wb__tk { --sw: 96px; border-radius: 14px; }
  .ps-wb__tk::before, .ps-wb__tk::after { left: calc(var(--sw) - 10px); width: 20px; height: 20px; }
  .ps-wb__tk::before { top: -10px; }
  .ps-wb__tk::after { bottom: -10px; }
  .ps-wb__stub { padding: 16px 4px 16px 14px; border-radius: 14px 0 0 14px; }
  .ps-wb__n, .ps-wb__tk--sm .ps-wb__n { font-size: 38px; letter-spacing: -.065em; }
  .ps-wb__cap { margin-top: 8px; }
  .ps-wb__main { padding: 16px 16px 16px 20px; }
  .ps-wb__head { font-size: 16px; }
  .ps-wb__price b { font-size: 18px; }
  .ps-wb__tk--sm .ps-wb__price { font-size: 13.5px; }
  .ps-wb__cta { margin-top: 16px; }
  .ps-wb__tk--sm .ps-wb__cta { font-size: 14px; }
  .ps-wb__foot { padding: 0 24px; gap: 0 16px; flex-wrap: nowrap; }
  .ps-wb__quiet { font-size: 13px; white-space: nowrap; }
}
@media (max-width: 380px) { .ps-wb__foot { padding: 0 20px; gap: 0 12px; } .ps-wb__quiet { font-size: 12.5px; } }
/* Short screens (375x667, 360x640, a laptop at 720): the plant gives way first, so the choices and the way out fit. */
@media (max-height: 720px) {
  .ps-wb__illo { height: 72px; }
  .ps-wb__scroll { padding-top: 22px; }
  .ps-wb__hero { margin-bottom: 16px; }
}
/* A permanent change (2026-09-17): the red Permanent label, and the red Approve on every approval surface. */
.ps-perm-chip { display: inline-flex; align-items: center; font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--bad, #ef4444); background: rgba(239,68,68,.08); border: 1px solid rgba(239,68,68,.3); border-radius: 999px; padding: 2px 8px; white-space: nowrap; vertical-align: middle; line-height: 1.5; margin-left: 6px; }
.ps-appr-btn--perm, .ps-appr-btn--apply.ps-appr-btn--perm { background: var(--bad, #ef4444); color: #fff; border: 0; }
.ps-appr-btn--perm:hover, .ps-appr-btn--apply.ps-appr-btn--perm:hover { background: var(--bad, #ef4444); color: #fff; opacity: .9; }
.appr-card__row--perm span { color: var(--bad, #ef4444); }
.cc-card__actions .conn-tile__btn.ps-appr-btn--perm { background: var(--bad, #ef4444); color: #fff; border-color: transparent; }
/* Share report modal */
.share-modal { background: var(--surface); border: 1px solid var(--hairline); border-radius: 16px; width: 500px; max-width: 94vw; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-lg); }
.share-modal__head { display: flex; align-items: center; gap: 10px; padding: 18px 20px 14px; border-bottom: 1px solid var(--hairline); }
.share-modal__title { font-size: 15px; font-weight: 700; letter-spacing: -0.015em; flex: 1; }
.share-modal__close { background: transparent; border: 0; cursor: pointer; padding: 6px; border-radius: 7px; color: var(--text-muted); }
.share-modal__close:hover { background: var(--surface-2); color: var(--text); }
.share-modal__close svg { width: 15px; height: 15px; }
.share-modal__body { padding: 16px 20px 20px; }
.share-modal__intro { font-size: 12.5px; color: var(--text-muted); line-height: 1.5; margin-bottom: 16px; }
.share-field { margin-bottom: 14px; }
.share-field__label { font-size: 11.5px; font-weight: 600; color: var(--text-muted); letter-spacing: 0.03em; display: block; margin-bottom: 6px; }
.share-field__input, .share-field__sel { width: 100%; padding: 9px 12px; border: 1px solid var(--hairline); border-radius: 9px; background: var(--surface-2); color: var(--text); font-size: 13px; font-family: inherit; }
.share-field__input:focus, .share-field__sel:focus { border-color: var(--text-dim); outline: none; box-shadow: var(--shadow-focus); }
textarea.share-field__input { resize: vertical; min-height: 62px; }
.share-wl { display: flex; align-items: flex-start; gap: 10px; padding: 11px 12px; border: 1px solid var(--hairline); border-radius: 10px; background: var(--surface-2); margin-bottom: 14px; cursor: pointer; }
.share-wl__txt { flex: 1; min-width: 0; }
.share-wl__t { font-size: 12.5px; font-weight: 600; color: var(--text); display: block; }
.share-wl__h { font-size: 11px; color: var(--text-muted); margin-top: 2px; line-height: 1.45; display: block; }
.share-wl__lock { font-size: 11px; color: var(--accent); font-weight: 600; background: none; border: 0; cursor: pointer; padding: 0; white-space: nowrap; align-self: center; }
.share-wl input { margin-top: 2px; }
.share-logo { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--hairline); border-radius: 10px; background: var(--surface-2); margin: 0 0 14px; }
.share-logo__prev { width: 40px; height: 40px; border-radius: 8px; border: 1px dashed var(--hairline); background: var(--surface); flex-shrink: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.share-logo__prev.has { border-style: solid; }
.share-logo__prev img { max-width: 100%; max-height: 100%; object-fit: contain; }
.share-modal__create { width: 100%; justify-content: center; }
.share-result { margin-top: 12px; padding: 13px; border: 1px solid var(--hairline); border-radius: 11px; background: var(--surface-2); }
.share-result__link { display: flex; gap: 8px; align-items: center; }
.share-result__url { flex: 1; min-width: 0; font-size: 12px; font-family: 'JetBrains Mono', ui-monospace, monospace; background: var(--surface); border: 1px solid var(--hairline); border-radius: 8px; padding: 8px 10px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.share-list { margin-top: 18px; border-top: 1px solid var(--hairline); padding-top: 14px; }
.share-list__h { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 10px; }
.share-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--hairline-soft); font-size: 12.5px; }
.share-row:last-child { border-bottom: 0; }
.share-row__main { flex: 1; min-width: 0; }
.share-row__t { font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.share-row__sub { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.share-row__act { background: transparent; border: 1px solid var(--hairline); border-radius: 7px; padding: 4px 9px; font-size: 11px; font-weight: 600; color: var(--text-soft); cursor: pointer; }
.share-row__act:hover { background: var(--surface-2); color: var(--text); }
.share-row__act--danger:hover { border-color: var(--bad); color: var(--bad); }
.share-row--revoked { opacity: 0.5; }
.share-empty { font-size: 12px; color: var(--text-muted); padding: 6px 0; }
.modal-btn--danger { background: var(--bad); color: #fff; }
/* S48: the Activity status word beside the time (the dot keeps its colour, the word says it). */
.act-word { font-weight: 600; color: var(--text-soft); }
.ps-toasts { position: fixed; bottom: 16px; right: 16px; z-index: 100002; display: flex; flex-direction: column; gap: 8px; max-width: min(360px, calc(100vw - 32px)); pointer-events: none; }
.ps-toast { pointer-events: auto; display: flex; gap: 11px; align-items: flex-start; background: var(--surface); border: 1px solid var(--hairline); border-radius: 13px; padding: 13px 15px; font-size: 13px; color: var(--text); box-shadow: var(--shadow-lg); line-height: 1.45; transition: opacity .3s ease; animation: psToastIn .2s cubic-bezier(.2,.7,.3,1); }
.ps-toast__ico { width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; background: var(--accent); color: #fff; margin-top: 1px; }
.ps-toast__ico svg { width: 12px; height: 12px; }
.ps-toast__body { min-width: 0; flex: 1; }
.ps-toast__title { font-size: 12.5px; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 2px; }
.ps-toast__msg { font-size: 12.5px; color: var(--text-soft); word-break: break-word; }
.ps-toast__act { margin-top: 8px; background: var(--accent); color: #fff; border: none; border-radius: 999px; padding: 6px 13px; font-size: 12px; font-weight: 600; cursor: pointer; }
.ps-toast--error { border-color: rgba(239,68,68,0.32); background: linear-gradient(180deg, rgba(239,68,68,0.06), var(--surface)), var(--surface); }
/* The run dock shares the toasts' corner (on a phone it spans the bottom edge), so the toasts sit above an open dock
   (--run-dock-room, set by dockRoom) and never cover its Stop. */
.ps-toasts { bottom: max(16px, min(calc(var(--run-dock-room, 0px) + 8px), 60vh)); }
.ps-toast--error .ps-toast__ico { background: var(--bad); }
.ps-toast--error .ps-toast__title { color: var(--bad); }
.ps-toast--success .ps-toast__ico { background: var(--ok); }
.ps-toast--success .ps-toast__title { color: var(--ok); }
@keyframes psToastIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
/* S46 agent dialogs (Hire, Edit, History, Growth Run): one shell. On a phone each is a full-width bottom sheet, so there is
   no thin overlay edge to slip onto, and fields use 16 px text so iOS does not zoom on focus. */
.agent-dlg { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; z-index: 100000; } /* above the consent banner (99999), under a confirm (100001) and the toasts (100002) */
.agent-dlg__panel { background: var(--surface); border: 1px solid var(--hairline); border-radius: 16px; padding: 24px; max-width: 92vw; max-height: 90vh; overflow-y: auto; overscroll-behavior: contain; box-shadow: var(--shadow-lg); }
/* Dark: native checkboxes and selects draw dark, and the run status green and the Delete red reach 4.5:1 on the panel. */
html.dark .agent-dlg__panel { color-scheme: dark; --ok: #2fbf72; --bad: #f87171; }
.agent-dlg__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.agent-dlg__hint { font-size: 11.5px; color: var(--text-soft); line-height: 1.45; margin: -6px 0 12px; }
.agent-dlg__panel:focus { outline: none; }
.agent-dlg__panel :is(input, select, textarea, button):focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.hb-goal { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--hairline); border-radius: 10px; padding: 10px 12px; cursor: pointer; margin-bottom: 6px; }
.hb-goal.is-picked { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.hb-goal:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.hb-goal__dot { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--text-muted); box-sizing: border-box; flex-shrink: 0; margin-top: 1px; }
.hb-goal.is-picked .hb-goal__dot { border: 5px solid var(--accent); }
.hb-goal__label { display: block; font-weight: 600; font-size: 13px; }
.hb-goal__hint { display: block; font-size: 11.5px; color: var(--text-muted); }
@media (max-width: 520px) {
  .agent-dlg { align-items: flex-end; }
  .agent-dlg__panel { width: 100% !important; max-width: 100%; max-height: 92vh; max-height: 92dvh; border-radius: 16px 16px 0 0; border-bottom: 0; padding: 20px 16px calc(16px + env(safe-area-inset-bottom)); }
  .agent-dlg__panel :is(input, select, textarea) { font-size: 16px !important; }
  .agent-dlg__panel .modal-btn, .agent-dlg__panel .conn-tile__btn, .agent-dlg__panel .gr-chip, .agent-dlg__check { min-height: 44px; }
  .agent-dlg__panel :is(input:not([type="checkbox"]), select) { min-height: 44px; }
  .agent-dlg__wrap { flex-wrap: wrap; }
  .agent-dlg__wrap > * { flex: 1 1 170px !important; }
}
/* Growth Run live progress */
.gr-run { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; z-index: 9999; padding: 20px; }
.gr-run__card { background: var(--surface); border: 1px solid var(--hairline); border-radius: 16px; width: 640px; max-width: 95vw; max-height: 90vh; display: flex; flex-direction: column; box-shadow: var(--shadow-lg); }
.gr-run__head { padding: 18px 22px; border-bottom: 1px solid var(--hairline); }
.gr-run__title { font-size: 16px; font-weight: 700; letter-spacing: -0.02em; display: flex; align-items: center; gap: 9px; }
.gr-run__goal { font-size: 12.5px; color: var(--text-muted); margin-top: 3px; }
.gr-run__body { padding: 10px 22px 18px; overflow-y: auto; }
.gr-phase { border-bottom: 1px solid var(--hairline-soft); padding: 12px 0; }
.gr-phase:last-child { border-bottom: 0; }
.gr-phase__head { display: flex; align-items: center; gap: 10px; font-size: 13.5px; font-weight: 600; cursor: pointer; user-select: none; }
.gr-phase__label { flex: 1; min-width: 0; }
.gr-phase__chev { width: 8px; height: 8px; border-right: 2px solid var(--text-muted); border-bottom: 2px solid var(--text-muted); transform: rotate(45deg); opacity: 0; transition: transform .2s, opacity .2s; flex-shrink: 0; margin-right: 2px; }
.gr-phase--done .gr-phase__chev { opacity: 0.6; }
.gr-phase--open .gr-phase__chev { transform: rotate(-135deg); }
.gr-phase__dot { width: 18px; height: 18px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; border: 2px solid var(--hairline); transition: all .2s ease; }
.gr-phase--running .gr-phase__dot { border-color: var(--accent); border-top-color: transparent; animation: grSpin .7s linear infinite; }
.gr-phase--done .gr-phase__dot { border: none; background: linear-gradient(145deg, #34d399, #059669); box-shadow: 0 2px 5px rgba(5,150,105,.4), inset 0 1px 1px rgba(255,255,255,.5); position: relative; }
.gr-phase--done .gr-phase__dot::after { content: ''; width: 4px; height: 8px; border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); }
@keyframes grSpin { to { transform: rotate(360deg); } }
.gr-phase--pending { opacity: 0.5; }
.gr-phase__text { font-size: 12.5px; color: var(--text-soft); line-height: 1.55; margin: 8px 0 0 28px; white-space: pre-wrap; max-height: 240px; overflow-y: auto; }
.gr-run__foot { padding: 14px 22px; border-top: 1px solid var(--hairline); display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.gr-banner { font-size: 11.5px; color: var(--text-soft); background: var(--surface-2); border: 1px solid var(--hairline); border-radius: 9px; padding: 8px 11px; margin: 4px 0 12px; line-height: 1.45; }
.gr-banner--act { color: #b45309; background: rgba(245,158,11,0.1); border-color: rgba(245,158,11,0.3); }
.gr-actions__summary { font-size: 12.5px; font-weight: 600; margin: 2px 0 8px; }
.gr-act-item { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: 12px; }
.gr-act-item__name { color: var(--text-soft); }
.gr-act-tag { font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; padding: 2px 7px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); white-space: nowrap; }
.gr-act-tag--ok { background: var(--ok-bg, rgba(16,185,129,0.14)); color: var(--ok); }
.gr-act-tag--hold { background: rgba(245,158,11,0.14); color: #b45309; }
.gr-act-tag--fail { background: rgba(220,38,38,0.13); color: var(--bad); }
.gr-act-item { flex-wrap: wrap; }
.gr-act-item__err { flex-basis: 100%; margin-left: 0; color: var(--bad); font-size: 11px; line-height: 1.45; padding-left: 2px; }
/* Approval board */
.appr-sec { margin: 0 0 24px; }
.appr-sec__h { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
.appr-sec__h span { background: var(--surface-2); color: var(--text-soft); font-size: 11px; padding: 1px 8px; border-radius: 999px; }
.appr-sec__h--pending { color: var(--accent); }
.appr-sec__h--pending span { background: var(--accent-soft); color: var(--accent); }
.appr-sec__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
@media (max-width: 560px) { .appr-sec__grid { grid-template-columns: 1fr; } .value-card__row { gap: 18px; } }
/* Collapsible Applied/Failed/Declined history */
.appr-hist { border: 1px solid var(--hairline); border-radius: 12px; background: var(--surface); overflow: hidden; }
.appr-hist__head { width: 100%; display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: none; border: 0; cursor: pointer; text-align: left; font: inherit; }
.appr-hist__head:hover { background: var(--surface-2); }
.appr-hist__chev { width: 8px; height: 8px; border-right: 2px solid var(--text-muted); border-bottom: 2px solid var(--text-muted); transform: rotate(-45deg); transition: transform .18s ease; flex-shrink: 0; margin-left: 2px; }
.appr-hist.is-open .appr-hist__chev { transform: rotate(45deg); }
.appr-hist__title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-soft); }
.appr-hist__count { background: var(--surface-2); color: var(--text-soft); font-size: 11px; padding: 1px 8px; border-radius: 999px; }
.appr-hist__hint { font-size: 11px; color: var(--text-muted); margin-left: auto; white-space: nowrap; }
.appr-hist__body { padding: 4px 14px 16px; }
.appr-hist__empty { font-size: 12.5px; color: var(--text-muted); padding: 14px 2px; }
.appr-filter-row { display: flex; flex-wrap: wrap; gap: 7px; margin: 4px 0 14px; }
.appr-filter { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 11.5px; font-weight: 600; color: var(--text-soft); background: var(--surface-2); border: 1px solid var(--hairline); border-radius: 999px; padding: 4px 11px; cursor: pointer; }
.appr-filter:hover { border-color: var(--text-dim); }
.appr-filter.is-active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.appr-filter span { font-size: 10px; font-weight: 700; background: rgba(0,0,0,0.06); padding: 0 6px; border-radius: 999px; }
.appr-filter.is-active span { background: rgba(255,255,255,0.5); }
@media (max-width: 560px) { .appr-hist__hint { display: none; } }
/* Agent Drafts top filter tabs */
.appr-draft-filters { display: flex; gap: 2px; background: var(--surface-2); border: 1px solid var(--hairline); border-radius: 10px; padding: 3px; margin: 0 0 16px; width: fit-content; }
.appr-draft-tab { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 12px; font-weight: 600; color: var(--text-muted); background: transparent; border: 0; border-radius: 7px; padding: 5px 13px; cursor: pointer; transition: background 130ms, color 130ms, box-shadow 130ms; white-space: nowrap; }
.appr-draft-tab:hover { color: var(--text-soft); }
.appr-draft-tab.is-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-xs); }
.appr-draft-tab span { font-size: 10px; font-weight: 700; background: var(--surface-2); padding: 1px 6px; border-radius: 999px; min-width: 18px; text-align: center; }
.appr-draft-tab.is-active span { background: var(--accent-soft); color: var(--accent); }
/* Proposal attribution line */
.appr-card__attribution { font-size: 10.5px; color: var(--text-muted); display: flex; align-items: center; gap: 4px; }
.appr-card__attribution svg { width: 10px; height: 10px; flex-shrink: 0; opacity: 0.7; }
/* Automation template cards */
.tpl-card { border: 1px solid var(--hairline); border-radius: 12px; padding: 16px; background: var(--surface); display: flex; flex-direction: column; gap: 10px; transition: box-shadow .16s, border-color .16s; }
.tpl-card:hover { border-color: var(--hairline-strong, var(--text-dim)); box-shadow: var(--shadow-sm, 0 2px 10px rgba(0,0,0,0.05)); }
.tpl-card__head { display: flex; align-items: flex-start; gap: 10px; }
.tpl-card__icon { width: 32px; height: 32px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex-shrink: 0; }
.tpl-card__icon svg { width: 16px; height: 16px; }
.tpl-card__name { font-size: 13.5px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.3; }
.tpl-card__band { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); margin-top: 2px; }
.tpl-card__desc { font-size: 12px; color: var(--text-muted); line-height: 1.55; flex: 1; }
.tpl-card__foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tpl-card__sched { font-size: 11px; color: var(--text-muted); flex: 1; }
.tpl-card--enabled { border-color: var(--ok); }
.tpl-card--enabled .tpl-card__icon { background: rgba(16,185,129,0.1); color: var(--ok); }
.appr-card { border: 1px solid var(--hairline); border-radius: 12px; padding: 15px 16px; background: var(--surface); display: flex; flex-direction: column; gap: 8px; height: 100%; transition: box-shadow .16s ease, border-color .16s ease; }
.appr-card:hover { border-color: var(--hairline-strong, var(--text-dim)); box-shadow: var(--shadow-sm, 0 2px 10px rgba(0,0,0,0.05)); }
.appr-card__head { display: flex; align-items: center; gap: 8px; }
.appr-card__chan { width: 16px; height: 16px; border-radius: 4px; object-fit: contain; flex-shrink: 0; }
.appr-card__title { font-size: 13.5px; font-weight: 700; letter-spacing: -0.01em; flex: 1; min-width: 0; }
.appr-card__tgt { color: var(--text-soft); font-weight: 600; }
.appr-card__src { font-size: 10px; font-weight: 700; color: var(--text-muted); background: var(--surface-2); border: 1px solid var(--hairline); padding: 2px 7px; border-radius: 999px; white-space: nowrap; }
.appr-card__row { font-size: 12px; color: var(--text-soft); line-height: 1.5; }
.appr-card__row span { font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); margin-right: 6px; }
.appr-card__preview { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; font-size: 12px; background: var(--surface-2); border: 1px solid var(--hairline); border-radius: 8px; padding: 7px 10px; }
.appr-prev__k { font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); white-space: nowrap; }
.appr-prev__v { color: var(--text-soft); font-weight: 600; }
.appr-card__held { font-size: 11px; color: #b45309; background: rgba(245,158,11,0.1); border-radius: 7px; padding: 5px 8px; }
.appr-card__est { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; padding: 7px 9px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--hairline); }
.appr-card__est-num { font-size: 14px; font-weight: 800; letter-spacing: -0.01em; }
.appr-card__est-num.pos { color: var(--ok); }
.appr-card__est-num.neg { color: var(--bad); }
.appr-card__est-lbl { font-size: 10.5px; color: var(--text-muted); line-height: 1.45; }
.appr-card__det { font-size: 11.5px; color: var(--text-muted); }
.appr-card__det summary { cursor: pointer; color: var(--text-soft); }
.appr-card__det pre { background: var(--surface-2); border-radius: 8px; padding: 9px 10px; margin: 7px 0 0; font-size: 11px; overflow-x: auto; white-space: pre-wrap; word-break: break-word; }
/* Pin actions + status to the card bottom so CTAs across sibling cards share one Y baseline. */
.appr-card__actions { display: flex; gap: 8px; margin-top: auto; padding-top: 6px; }
.appr-card__actions .ps-appr-btn { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-height: 36px; line-height: 1; }
.appr-card__actions .ps-appr-btn svg { width: 13px; height: 13px; flex-shrink: 0; }
.appr-card__row--revised span { color: var(--accent); }
/* Before and after on every Approve surface (step 3): the value now, the value Apply writes, in the account's currency. */
.ps-ba { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-soft); line-height: 1.5; }
.ps-ba__row { display: flex; flex-wrap: wrap; gap: 2px 8px; min-width: 0; }
.ps-ba__k { font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); padding-top: 2px; }
.ps-ba__v { color: var(--text); overflow-wrap: anywhere; }
.ps-ba__d { color: var(--text-muted); }
.ps-ba__note { font-size: 11.5px; color: var(--text-muted); }
.ps-ba__note--warn { color: #b45309; background: rgba(245,158,11,0.1); border-radius: 7px; padding: 5px 8px; }
.appr-card__revising { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--accent); padding: 6px 0; }
.appr-card__spin { width: 13px; height: 13px; border-radius: 50%; border: 2px solid var(--accent); border-top-color: transparent; animation: grSpin .7s linear infinite; flex-shrink: 0; }
.appr-card__done { font-size: 12px; font-weight: 600; color: var(--text-muted); margin-top: auto; padding-top: 6px; }
.appr-card__done--ok { color: var(--ok); }
.appr-card__done--bad { color: var(--bad); }
.appr-card__done--warn { color: #b45309; }
.appr-card__undo-says { flex-basis: 100%; font-size: 11.5px; font-weight: 500; color: var(--text-soft); line-height: 1.45; margin-top: 6px; }
/* M6: Platform contract checklist */
.appr-card__contract { margin: 4px 0; }
.appr-card__contract-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 999px; cursor: pointer; border: 1px solid transparent; transition: background .12s; }
.appr-card__contract-chip--pass { color: var(--ok); background: rgba(34,197,94,.08); border-color: rgba(34,197,94,.2); }
.appr-card__contract-chip--warn { color: #b45309; background: rgba(245,158,11,.08); border-color: rgba(245,158,11,.2); }
.appr-card__contract-body { margin-top: 6px; background: var(--surface-2); border: 1px solid var(--hairline); border-radius: 8px; padding: 7px 10px; font-size: 11.5px; }
.appr-card__contract-row { display: flex; align-items: flex-start; gap: 7px; padding: 3px 0; line-height: 1.45; }
.appr-card__contract-icon { flex-shrink: 0; margin-top: 1px; font-size: 11px; }
.appr-card__contract-icon--pass { color: var(--ok); }
.appr-card__contract-icon--warn { color: #b45309; }
.appr-card__contract-icon--ask { color: var(--accent); }
.appr-card__contract-val { color: var(--text-muted); font-size: 10.5px; margin-left: 2px; }
.appr-card__contract-act { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 600; color: var(--accent); background: var(--accent-soft); border: 1px solid rgba(99,102,241,.2); border-radius: 6px; padding: 2px 7px; margin-left: 6px; text-decoration: none; cursor: pointer; }
.appr-card__contract-partial { font-size: 11px; color: #b45309; background: rgba(245,158,11,.07); border-radius: 6px; padding: 4px 8px; margin-top: 4px; display: flex; align-items: center; gap: 6px; }
.appr-card__contract-partial input[type=checkbox] { cursor: pointer; }
/* Value delivered card */
.value-card { border: 1px solid var(--hairline); border-radius: 14px; padding: 16px 18px; margin: 0 0 18px; background: linear-gradient(135deg, var(--accent-soft), var(--surface)); }
.value-card--empty { background: var(--surface-2); }
.value-card__title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-soft); margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.value-card__est { font-size: 9.5px; font-weight: 700; color: var(--accent); background: var(--surface); border: 1px solid var(--hairline); padding: 1px 7px; border-radius: 999px; letter-spacing: 0.02em; }
.value-card__row { display: flex; gap: 28px; flex-wrap: wrap; }
.value-card__col { min-width: 130px; }
.value-card__big { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.05; }
.value-card__big--pos { color: var(--ok); }
.value-card__big--neg { color: var(--bad); }
.value-card__lbl { font-size: 11.5px; color: var(--text-muted); margin-top: 3px; line-height: 1.4; }
.value-card__stat { font-size: 12.5px; color: var(--text-soft); margin-top: 12px; display: flex; gap: 8px; align-items: baseline; }
.value-card__stat span { color: var(--text-muted); }
.value-card__note { font-size: 10.5px; color: var(--text-muted); margin-top: 12px; line-height: 1.45; }
.value-card__empty { font-size: 12.5px; color: var(--text-muted); line-height: 1.5; }
/* Compact "Value delivered" hero shown above the Lead run bar */
.value-card--hero { position: relative; padding: 14px 18px 12px; }
.value-card--hero .value-card__title { margin-bottom: 0; }
.value-card__tag { position: absolute; top: 13px; right: 16px; font-size: 9.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); background: var(--surface); border: 1px solid var(--hairline); padding: 2px 8px; border-radius: 999px; cursor: help; }
.value-card__num { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; margin-top: 7px; font-variant-numeric: tabular-nums; }
.value-card__num--pos { color: var(--ok); }
.value-card__num--neg { color: var(--bad); }
.value-card__sub { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }
.value-card__line { font-size: 12.5px; color: var(--text-soft); margin-top: 8px; font-variant-numeric: tabular-nums; }
.value-card__line span { color: var(--text-muted); }
.value-card__line b { font-weight: 700; color: var(--text); }
.value-card--hero .value-card__note { margin-top: 10px; padding-top: 9px; border-top: 1px solid var(--hairline); }
/* Inline revise box on approval cards and table rows */
.appr-revise-box { margin: 12px 0 10px; padding: 12px 14px; border: 1px solid var(--hairline); border-radius: 12px; background: var(--surface-2); box-shadow: var(--shadow-xs); }
.appr-revise-box label { display: block; font-size: 10.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 6px; }
.appr-revise-box textarea { width: 100%; box-sizing: border-box; border: 1px solid var(--hairline); background: var(--surface); border-radius: 9px; padding: 9px 11px; font-family: inherit; font-size: 12.5px; line-height: 1.5; color: var(--text); outline: 0; resize: vertical; min-height: 52px; }
.appr-revise-box textarea:focus { border-color: var(--accent); box-shadow: var(--shadow-focus); }
.appr-revise-box__btns { display: flex; justify-content: flex-end; gap: 8px; margin-top: 9px; }
/* Last-synced strip: compact channel logos + age */
#lastSyncedBar { flex-wrap: wrap; gap: 8px; align-items: center; }
.sync-pill__lbl { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); margin-right: 2px; }
.sync-pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--text-soft); background: var(--surface); border: 1px solid var(--hairline); border-radius: 999px; padding: 3px 9px 3px 6px; }
.sync-pill b { font-weight: 600; }
.sync-pill__logo { width: 13px; height: 13px; object-fit: contain; border-radius: 3px; }
.sync-pill__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-dim); }
.sync-pill--stale { color: #b45309; border-color: rgba(245,158,11,0.35); background: rgba(245,158,11,0.08); }
.sync-line__more { font-size: 11px; color: var(--text-muted); }
.sync-line__sep { color: var(--text-dim); }
.sync-line__fresh { font-size: 11px; color: var(--text-soft); font-weight: 600; }
.sync-line__fresh.is-stale { color: #b45309; }
/* Runs dock: non-blocking, several runs at once */
.run-dock { position: fixed; right: 18px; bottom: 18px; width: 380px; max-width: calc(100vw - 32px); z-index: 9998; display: flex; flex-direction: column; gap: 10px; max-height: 86vh; overflow-y: auto; }
.run-card { background: var(--surface); border: 1px solid var(--hairline); border-radius: 13px; box-shadow: var(--shadow-lg); overflow: hidden; }
.run-card__head { display: flex; align-items: center; gap: 10px; padding: 11px 13px; cursor: pointer; border-bottom: 1px solid var(--hairline-soft); }
.run-card.is-collapsed .run-card__head { border-bottom: 0; }
.run-card__spin { width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0; border: 2px solid var(--accent); border-top-color: transparent; animation: grSpin .7s linear infinite; }
.run-card__spin.is-done { border: 2px solid var(--ok); background: var(--ok); animation: none; position: relative; }
.run-card__spin.is-done::after { content: ''; position: absolute; left: 4px; top: 1px; width: 3px; height: 6px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.run-card__spin.is-error { border: 2px solid var(--bad); background: var(--bad); animation: none; position: relative; }
.run-card__spin.is-error::before, .run-card__spin.is-error::after { content: ''; position: absolute; left: 6px; top: 3px; width: 2px; height: 8px; background: #fff; }
.run-card__spin.is-error::before { transform: rotate(45deg); }
.run-card__spin.is-error::after { transform: rotate(-45deg); }
.run-card__spin.is-stopped { border: 2px solid var(--text-muted); background: var(--text-muted); animation: none; position: relative; }
.run-card__spin.is-stopped::after { content: ''; position: absolute; left: 4px; top: 4px; width: 6px; height: 2px; background: #fff; }
.run-card__spin.is-warn { border: 2px solid var(--warn,#d97706); background: var(--warn,#d97706); animation: none; position: relative; }
.run-card__spin.is-warn::after { content: ''; position: absolute; left: 4px; top: 1px; width: 2px; height: 6px; background: #fff; box-shadow: 0 8px 0 #fff; }
.run-card__note { font-size: 12px; color: var(--text-muted); flex: 1; align-self: center; }
.gr-err { display: flex; gap: 10px; align-items: flex-start; margin: 8px 0; padding: 11px 13px; border-radius: 11px; border: 1px solid rgba(239,68,68,0.3); background: linear-gradient(180deg, rgba(239,68,68,0.07), var(--surface-2)); }
.gr-err__ico { width: 20px; height: 20px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; background: var(--bad); color: #fff; margin-top: 1px; }
.gr-err__ico svg { width: 11px; height: 11px; }
.gr-err__title { font-size: 12.5px; font-weight: 700; color: var(--bad); margin-bottom: 2px; }
.gr-err__msg { font-size: 12px; color: var(--text-soft); line-height: 1.5; word-break: break-word; }
.run-card__titles { flex: 1; min-width: 0; }
.run-card__title { font-size: 13px; font-weight: 700; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.run-card__goal { font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.run-card__x { background: none; border: 0; color: var(--text-muted); font-size: 19px; line-height: 1; cursor: pointer; padding: 0 2px; flex-shrink: 0; }
.run-card__x:hover { color: var(--text); }
.run-card__stop { background: none; border: 1px solid var(--hairline); color: var(--bad); font-size: 10.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px; cursor: pointer; flex-shrink: 0; }
.run-card__stop:hover { background: var(--bad-bg, rgba(239,68,68,0.1)); }
.run-card__stop:disabled { opacity: 0.6; cursor: default; }
.run-card__body { max-height: 60vh; overflow-y: auto; }
.run-card.is-collapsed .run-card__body { display: none; }
.run-card__phases { padding: 4px 14px 6px; }
.run-card__foot { padding: 0 14px 12px; display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
@media (max-width: 560px) { .run-dock { right: 8px; left: 8px; bottom: 8px; width: auto; } }
@media (max-width: 640px) { .agent-flagship { flex-direction: column; align-items: flex-start; } .mem-add { flex-direction: column; } }

.sched-list { background: var(--surface); border: 1px solid var(--hairline); border-radius: 14px; overflow: hidden; }
.sched-row {
  display: grid;
  grid-template-columns: 36px minmax(280px, 2fr) minmax(160px, 1fr) minmax(140px, 1fr) 100px 34px;
  align-items: center;
  gap: 20px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--hairline-soft);
  transition: background 120ms ease;
  position: relative;
}
.auto-menu { position: fixed; min-width: 160px; background: var(--surface); border: 1px solid var(--hairline); border-radius: 10px; box-shadow: var(--shadow-md); padding: 5px; z-index: 1000; display: none; }
.auto-menu.is-open { display: block; }
.sched-row:last-child { border-bottom: 0; }
.sched-row:hover { background: var(--surface-2); }
.sched-row__icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  display: grid;
  place-items: center;
  color: var(--text-soft);
}
.sched-row__icon svg { width: 14px; }
.sched-row__name { font-size: 13.5px; font-weight: 600; letter-spacing: -0.005em; }
.sched-row__desc { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }
.sched-row__schedule { font-size: 12px; color: var(--text); font-family: 'JetBrains Mono', monospace; }
.sched-row__next { font-size: 11.5px; color: var(--text-soft); }
.sched-row__status {
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--ok-bg);
  color: var(--ok);
  justify-self: start;
}
.sched-row__status--paused { background: var(--surface-3); color: var(--text-muted); }
.sched-row__status--err { background: var(--bad-bg); color: var(--bad); }
.sched-row__last { font-size: 10.5px; color: var(--text-muted); margin-top: 2px; }
.sched-row__sum { font-size: 11px; color: var(--text-soft); margin-top: 3px; line-height: 1.4; max-width: 52ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sched-row__err { font-size: 11px; color: var(--bad); margin-top: 3px; line-height: 1.4; max-width: 52ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sched-row { cursor: pointer; }
.sched-row__more {
  width: 24px; height: 24px;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 6px;
}
.sched-row__more:hover { background: var(--surface-3); color: var(--text); }

/* ============ DRAFTS BOARD (v5 table layout) ============ */
.drafts__toolbar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  flex-wrap: wrap;
}
.chip-group {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font: inherit;
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--hairline);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}
.chip:hover { border-color: var(--text-dim); color: var(--text-soft); background: var(--surface-2); }
.chip.is-active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.chip img { width: 12px; height: 12px; object-fit: contain; }
.drafts__search-wrap {
  margin-left: auto;
  position: relative;
  flex-shrink: 0;
}
.drafts__search {
  font: inherit;
  font-size: 12.5px;
  height: 32px;
  padding: 0 32px 0 10px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-row);
  background: var(--surface);
  color: var(--text);
  width: 200px;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.drafts__search:focus { outline: none; border-color: var(--accent); box-shadow: var(--shadow-focus); }
.drafts__search::placeholder { color: var(--text-dim); }
.drafts__search-kbd {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  padding: 1px 4px;
  border-radius: 4px;
  pointer-events: none;
}
/* v5 table container */
.drafts__scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
}
.drafts__v5table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  min-width: 820px;
}
.drafts__v5table thead th {
  text-align: left;
  padding: 10px 14px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1.5px solid var(--hairline-strong);
  background: var(--surface-2);
  white-space: nowrap;
}
.drafts__v5table thead th:first-child { padding-left: 20px; }
.drafts__v5table tbody tr.dv5-row {
  border-bottom: 1px solid var(--hairline-soft);
  cursor: pointer;
  transition: background 80ms ease;
  position: relative;
}
.drafts__v5table tbody tr.dv5-row:hover { background: var(--accent-soft); }
.drafts__v5table tbody tr.dv5-row:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: -2px; } /* a key opens the row (S35 review) */
.drafts__v5table tbody tr.dv5-row.is-selected {
  background: rgba(91,45,142,0.06);
  border-left: 3px solid var(--accent);
}
.drafts__v5table tbody tr.dv5-row.is-selected td:first-child { padding-left: 17px; }
.drafts__v5table td {
  padding: 13px 14px;
  vertical-align: middle;
}
.drafts__v5table td:first-child { padding-left: 20px; }
/* S48 review: the table drops Trend, then Guardrails, then Agent, then Campaign (the target is also under the action)
   as its box narrows, so the Actions column, Approve last, stays inside it. */
.drafts__scroll { container: drafts / inline-size; }
@container drafts (max-width: 1259px) { .drafts__v5table :is(th, tr.dv5-row > td):nth-child(6) { display: none; } }
@container drafts (max-width: 1089px) { .drafts__v5table :is(th, tr.dv5-row > td):nth-child(8) { display: none; } }
@container drafts (max-width: 979px) { .drafts__v5table :is(th, tr.dv5-row > td):nth-child(5) { display: none; } }
@container drafts (max-width: 859px) { .drafts__v5table :is(th, tr.dv5-row > td):nth-child(4) { display: none; } }
@container drafts (max-width: 859px) { .drafts__v5table { min-width: 0; } } /* six columns fit a 1024 px window with the sidebar open */
/* Expand panel row */
tr.dv5-expand-row td { padding: 0; border-bottom: 1px solid var(--hairline); }
tr.dv5-expand-row.dv5-hidden { display: none; }
.dv5-expand-panel {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 220ms cubic-bezier(0.2,0,0,1), opacity 220ms cubic-bezier(0.2,0,0,1);
}
tr.dv5-expand-row.dv5-open .dv5-expand-panel { max-height: 700px; opacity: 1; }
.dv5-expand-inner {
  padding: 20px 24px 24px;
  border-top: 1px solid var(--hairline);
  background: var(--surface);
}
.dv5-eyebrow {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.dv5-headline {
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: -0.012em;
  color: var(--text);
  margin-bottom: 6px;
}
.dv5-body { font-size: 12.5px; color: var(--text-soft); line-height: 1.6; max-width: 640px; }
.dv5-section { margin-top: 18px; }
.dv5-stat-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; margin-top: 10px; }
.dv5-stat-card {
  background: var(--surface-2);
  border-radius: 8px;
  padding: 11px 13px;
  border: 1px solid var(--hairline-strong);
}
.dv5-stat-val { font-size: 19px; font-weight: 600; letter-spacing: -0.02em; color: var(--text); line-height: 1.2; }
.dv5-stat-desc { font-size: 10.5px; color: var(--text-muted); margin-top: 2px; }
.dv5-guardrail-list { display: flex; flex-direction: column; gap: 5px; margin-top: 8px; }
.dv5-guardrail-item { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-soft); }
.dv5-changes-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.dv5-undo-line {
  margin-top: 14px;
  padding: 8px 12px;
  background: var(--surface-2);
  border-radius: 6px;
  font-size: 11px;
  color: var(--text-muted);
  border-left: 2px solid var(--hairline);
  font-family: 'JetBrains Mono', 'SF Mono', monospace;
  letter-spacing: 0.01em;
}
.dv5-attr-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 14px; }
.dv5-attr-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--surface-2);
  border: 1px solid var(--hairline-strong);
}
.dv5-attr-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--ok); flex-shrink: 0; }
.dv5-expand-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}
.dv5-ebtn {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: background 150ms, box-shadow 150ms, transform 80ms;
  letter-spacing: -0.01em;
}
.dv5-ebtn:active { transform: scale(0.97); }
.dv5-ebtn-ghost { background: transparent; border: 1px solid var(--hairline); color: var(--text-soft); }
.dv5-ebtn-ghost:hover { background: var(--surface-2); border-color: rgba(91,45,142,0.2); color: var(--text); }
.dv5-ebtn-approve { background: var(--accent); color: #fff; box-shadow: 0 1px 3px rgba(91,45,142,0.25); }
.dv5-ebtn-approve:hover { background: #7c3aed; box-shadow: 0 2px 8px rgba(91,45,142,0.35); }
/* Audit log table */
.alog-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.alog-table th { text-align: left; padding: 7px 10px; font-size: 11px; font-weight: 600; color: var(--text-muted); letter-spacing: 0.03em; text-transform: uppercase; border-bottom: 1px solid var(--hairline); }
.alog-table td { padding: 9px 10px; border-bottom: 1px solid var(--hairline); vertical-align: middle; color: var(--text-soft); line-height: 1.4; }
.alog-table tr:last-child td { border-bottom: 0; }
.alog-table tr:hover td { background: var(--surface-2); }
.alog-pill { display: inline-flex; align-items: center; padding: 2px 7px; border-radius: 4px; font-size: 11px; font-weight: 600; }
.alog-pill--ok { background: var(--ok-bg,#dcfce7); color: var(--ok,#16a34a); }
.alog-pill--fail { background: var(--bad-bg,#fee2e2); color: var(--bad,#dc2626); }
.alog-pill--undo { background: var(--warn-bg,#fef3c7); color: var(--warn,#b45309); }
.alog-tool { font-family: ui-monospace, monospace; font-size: 11.5px; color: var(--text); }
.alog-pagination { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 12px; color: var(--text-muted); }
/* Platform badge */
.dv5-plat-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
}
.dv5-logo-wrap {
  width: 20px; height: 20px;
  border-radius: 5px;
  display: grid; place-items: center;
  flex-shrink: 0;
  overflow: hidden;
  background: transparent;
}
.dv5-logo-wrap img { display: block; background: transparent; }
/* Action text */
.dv5-action-text { font-size: 13px; color: var(--text); font-weight: 500; max-width: 240px; }
.dv5-action-sub { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }
/* Agent badge */
.dv5-agent-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-soft); font-weight: 500; }
.dv5-agent-avatar {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--gradient-flat);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  display: grid; place-items: center;
  flex-shrink: 0;
}
/* Sparkline */
.dv5-spark-wrap { display: block; overflow: hidden; width: 100%; max-width: 140px; position: relative; }
svg.dv5-spark { display: block; overflow: hidden; }
/* Delta */
.dv5-delta { font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; gap: 3px; }
.dv5-delta.up { color: var(--ok); }
.dv5-delta.down { color: var(--bad); }
.dv5-delta.flat { color: var(--text-muted); }
.dv5-guardrail-hint { font-size: 10.5px; color: var(--text-soft); margin-left: 4px; white-space: nowrap; } /* --text-muted was 3.6:1 at 10.5px (S35 review) */
/* Status pill */
.dv5-status-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}
.dv5-status-pill.pending { background: var(--warn-soft); color: var(--warn); }
.dv5-status-pill.failed { background: var(--bad-soft); color: var(--bad); }
.dv5-status-pill.published { background: var(--ok-soft); color: var(--ok); }
/* Row action cluster */
.dv5-action-cluster {
  display: flex;
  align-items: center;
  gap: 6px;
  opacity: 0;
  transition: opacity 100ms ease;
}
.drafts__v5table tbody tr.dv5-row:hover .dv5-action-cluster,
.drafts__v5table tbody tr.dv5-row.is-selected .dv5-action-cluster,
.drafts__v5table tbody tr.dv5-row:focus-within .dv5-action-cluster { opacity: 1; } /* S48: a key that lands on Approve shows it */
.dv5-act-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  font-family: inherit;
  transition: all 100ms ease;
  white-space: nowrap;
}
.dv5-act-btn.approve { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.dv5-act-btn.approve:hover { background: var(--ok); color: #fff; }
/* A permanent change: the same red as the card's button, on the table row and in the expanded row. The
   row button keeps the short Approve (its full name, "Approve permanent change", in the label), since the
   action column is tight. */
.dv5-act-btn.approve.perm { background: var(--bad, #ef4444); color: #fff; }
.dv5-act-btn.approve.perm:hover { background: var(--bad, #ef4444); color: #fff; opacity: .9; }
.dv5-ebtn-approve.dv5-ebtn-perm { background: var(--bad, #ef4444); box-shadow: 0 1px 3px rgba(239,68,68,0.3); }
.dv5-ebtn-approve.dv5-ebtn-perm:hover { background: var(--bad, #ef4444); opacity: .9; }
.dv5-act-btn.reject { background: transparent; color: var(--text-muted); border-color: var(--hairline); }
.dv5-act-btn.reject:hover { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.dv5-act-btn.revise { background: transparent; color: var(--text-muted); border-color: var(--hairline); }
.dv5-act-btn.revise:hover { background: var(--surface-2); color: var(--text); border-color: var(--hairline-strong); }
/* Keyboard hint row */
.dv5-kbd-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 0 10px;
  font-size: 11px;
  color: var(--text-muted);
}
.dv5-kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  border: 1px solid var(--hairline-strong);
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 5px;
  color: var(--text-muted);
  font-family: inherit;
  line-height: 1.4;
}
.dv5-hint-sep { opacity: 0.3; }
/* Legacy row stubs: kept for compatibility with any existing JS that adds these classes */
.drafts__row { display: none; }
.drafts__cell {}
.drafts__btn-approve {
  font: inherit; font-size: 11px; font-weight: 700; padding: 5px 10px;
  border-radius: var(--radius-pill); background: var(--gradient-flat);
  color: #fff; border: 0; cursor: pointer; white-space: nowrap; transition: filter 120ms ease;
}
.drafts__btn-approve:hover { filter: brightness(1.05); }
.drafts__btn-dismiss {
  font: inherit; font-size: 11px; font-weight: 600; padding: 5px 8px;
  border-radius: var(--radius-pill); background: transparent; color: var(--text-muted);
  border: 1px solid var(--hairline); cursor: pointer; transition: background 120ms ease, color 120ms ease;
}
.drafts__btn-dismiss:hover { background: var(--bad-soft); color: var(--bad); border-color: transparent; }

/* Status pills */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}
.status-pill__dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.status-pill--pending { background: var(--warn-soft); color: var(--warn); }
.status-pill--pending .status-pill__dot { background: var(--warn); }
.status-pill--approved { background: var(--ok-soft); color: var(--ok); }
.status-pill--approved .status-pill__dot { background: var(--ok); }
.status-pill--failed { background: var(--bad-soft); color: var(--bad); }
.status-pill--failed .status-pill__dot { background: var(--bad); }
.status-pill--published { background: var(--accent-soft); color: var(--accent); }
.status-pill--published .status-pill__dot { background: var(--accent); }
.status-pill--scheduled { background: var(--surface-3); color: var(--text-soft); }
.status-pill--scheduled .status-pill__dot { background: var(--text-soft); }

/* Bulk actions strip */
.drafts__bulk {
  display: none;
  align-items: center;
  gap: var(--space-3);
  padding: 10px 16px;
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  border-radius: var(--radius-row);
  margin-bottom: var(--space-3);
  animation: bulkSlideDown 160ms var(--ease) both;
}
.drafts__bulk.is-visible { display: flex; }
@keyframes bulkSlideDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
.drafts__bulk-count { font-size: 12.5px; font-weight: 700; color: var(--accent); }
.drafts__bulk-sp { flex: 1; }

/* Drafts empty state */
.drafts__empty {
  text-align: center;
  padding: 60px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
}
.drafts__empty-icon { font-size: 64px; line-height: 1; opacity: 0.4; }
.drafts__empty-title { font-size: 17px; font-weight: 700; letter-spacing: -0.015em; color: var(--text); }
.drafts__empty-sub { font-size: 13px; color: var(--text-muted); max-width: 360px; line-height: 1.6; }
.drafts__empty-cta {
  margin-top: var(--space-2);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 10px 22px;
  border-radius: var(--radius-pill);
  background: var(--gradient-flat);
  color: #fff;
  border: 0;
  cursor: pointer;
  transition: filter 120ms ease;
}
.drafts__empty-cta:hover { filter: brightness(1.05); }

/* ============ ACTIVE AUTOMATIONS TABLE ============ */
.autos__table {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  overflow-x: auto;
  overflow-y: hidden;
  container-type: inline-size;
  margin-top: var(--space-3);
}
.autos__thead {
  display: grid;
  grid-template-columns: 128px minmax(140px, 1fr) 150px 110px 130px 130px 96px;
  align-items: center;
  gap: 0;
  padding: 0 16px;
  min-height: 36px;
  border-bottom: 1.5px solid var(--hairline-strong);
  background: var(--surface-2);
  position: sticky;
  top: 0;
  z-index: 2;
}
.autos__th {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 0 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.autos__th:first-child { padding-left: 0; }
/* S47: the last column holds the 44 px switch and Edit (it was 36 px, which clipped both). */
.autos__row {
  display: grid;
  grid-template-columns: 128px minmax(140px, 1fr) 150px 110px 130px 130px 96px;
  align-items: center;
  gap: 0;
  padding: 0 16px;
  min-height: var(--row-h);
  border-bottom: 1px solid var(--hairline-soft);
  cursor: pointer;
  transition: background 120ms ease;
}
.autos__row:last-child { border-bottom: 0; }
.autos__row:hover { background: var(--surface-2); }
.autos__cell { padding: 0 8px; min-width: 0; overflow: hidden; }
.autos__cell:first-child { padding-left: 0; }
.autos__status-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  margin: 0 auto;
}
.autos__status-dot--ok { background: var(--ok); }
.autos__status-dot--warn { background: var(--warn); }
.autos__status-dot--off { background: var(--text-muted); }
.autos__status { display: flex; align-items: center; gap: 7px; }
.autos__status .autos__status-dot { margin: 0; }
.autos__status-word { font-size: 12px; font-weight: 600; color: var(--text-soft); line-height: 1.3; }
.autos__status-dot--bad { background: var(--bad); }
.autos__status-dot--running {
  background: var(--accent);
  animation: autosPulse 1.5s ease-in-out infinite;
}
@keyframes autosPulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:0.6;transform:scale(0.85)} }
.autos__name { font-size: 13.5px; font-weight: 600; letter-spacing: -0.005em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.autos__desc { font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.autos__sched { font-size: 12px; color: var(--text-soft); }
.autos__time { font-size: 11.5px; color: var(--text-muted); }
/* S47 review: the name column keeps 140 px. Under 920 px of table the Last run and Next run columns go, and a table still
   too narrow scrolls sideways instead of clipping the switch and Edit (it was 0 px of name at 768). */
.autos__thead, .autos__row { min-width: min-content; }
@container (max-width: 920px) {
  .autos__thead, .autos__row { grid-template-columns: 128px minmax(140px, 1fr) 150px 110px 96px; }
  .autos__thead > :nth-child(5), .autos__thead > :nth-child(6), .autos__row > :nth-child(5), .autos__row > :nth-child(6) { display: none; }
}
/* S48: at 768 px and below the agent cards above the table already show every agent with its buttons, so the table
   goes rather than scrolling sideways (gaps U9; the .autos__cards it used to switch to were never drawn). */
@media (max-width: 768px) { .autos__table { display: none; } }
/* S48 review: the table needs 660 px (Status 128, name 140, Schedule, Autonomy, switch and Edit). Where the page leaves it
   less, a 769 to 940 px window with the sidebar open (an iPad at 810), it goes too: the cards above show every agent. */
#myAgentsTable { container: autos-wrap / inline-size; }
@container autos-wrap (max-width: 659px) { .autos__table { display: none; } }

/* Autonomy chip */
.auto-chip {
  display: inline-flex;
  align-items: center;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}
.auto-chip--readonly { background: var(--surface-3); color: var(--text-soft); }
.auto-chip--propose { background: var(--accent-soft); color: var(--accent-ink); }
.auto-chip--auto {
  background: linear-gradient(135deg, rgba(0,119,182,0.12), rgba(91,45,142,0.12), rgba(124,181,24,0.12));
  color: var(--accent);
}

/* One switch (S47): every on/off control on the page is a .ps-switch span with role=switch, tabindex 0, aria-checked
   and aria-label; is-on is its state. psSwitchWire keeps aria-checked equal to is-on and turns Space and Enter into a
   click. The 44 px box is the tap target; the 36 x 20 track and the knob are drawn inside it. Off is a grey knob on an
   outlined track, on a white knob on the brand gradient, both at 3:1 or more against the page. It replaced the two older
   styles: a 26 x 15 label with no role or key, and a 32 x 18 hidden checkbox (gaps-pass2-mobile U7, U8, U10). */
/* The box hangs 4 px past each side (margin-inline -4px), so the drawn track lines up with the text and inputs around it. */
.ps-switch { position: relative; display: inline-block; width: 44px; height: 44px; flex-shrink: 0; cursor: pointer; outline: none; -webkit-tap-highlight-color: transparent; margin-inline: -4px; }
.ps-switch::before { content: ''; position: absolute; left: 4px; top: 12px; width: 36px; height: 20px; box-sizing: border-box; border-radius: 999px; background: var(--surface-3); box-shadow: inset 0 0 0 1px var(--text-muted); transition: background 140ms ease; }
.ps-switch::after { content: ''; position: absolute; left: 7px; top: 15px; width: 14px; height: 14px; border-radius: 50%; background: var(--text-muted); transition: transform 140ms ease, background 140ms ease; }
.ps-switch.is-on::before { background: var(--gradient-flat); box-shadow: none; }
.ps-switch.is-on::after { transform: translateX(16px); background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,0.25); }
.ps-switch[tabindex]:focus-visible { box-shadow: none; }
.ps-switch:focus-visible::before { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }
html.dark .ps-switch:focus-visible::before { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px #a78bfa; } /* --accent is 2:1 on dark */
@media (prefers-reduced-motion: reduce) { .ps-switch::before, .ps-switch::after { transition: none; } }

/* ============ SIDE DRAWER ============ */
.drawer-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.3);
  backdrop-filter: blur(8px);
  z-index: 900;
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms var(--ease);
}
html.dark .drawer-backdrop { background: rgba(0,0,0,0.6); }
.drawer-backdrop.is-open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed;
  right: 0; top: 0; bottom: 0;
  width: 480px;
  background: var(--surface-elev);
  box-shadow: var(--shadow-lg);
  z-index: 901;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 280ms var(--ease);
}
.drawer.is-open { transform: translateX(0); }
.drawer__header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 0 20px;
  height: 56px;
  border-bottom: 1px solid var(--hairline);
  flex-shrink: 0;
}
.drawer__title { font-size: 15px; font-weight: 700; letter-spacing: -0.015em; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drawer__close {
  width: 28px; height: 28px;
  border-radius: 6px;
  background: transparent;
  border: 0;
  color: var(--text-muted);
  cursor: pointer;
  display: grid; place-items: center;
  flex-shrink: 0;
  transition: background 120ms ease, color 120ms ease;
}
.drawer__close:hover { background: var(--surface-2); color: var(--text); }
.drawer__close svg { width: 16px; }
.drawer__body { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: var(--space-4); }
.drawer__section {
  background: var(--surface-2);
  border-radius: var(--radius-card);
  padding: var(--space-4);
}
.drawer__section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: var(--space-3);
}
.drawer__footer {
  display: flex;
  align-items: center;
  padding: 14px 20px;
  border-top: 1px solid var(--hairline);
  flex-shrink: 0;
  gap: var(--space-3);
}
.drawer__footer-sp { flex: 1; }
.drawer__btn-save {
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 9px 20px;
  border-radius: var(--radius-pill);
  background: var(--gradient-flat);
  color: #fff;
  border: 0;
  cursor: pointer;
  transition: filter 120ms ease;
}
.drawer__btn-save:hover { filter: brightness(1.05); }
.drawer__btn-delete {
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--bad);
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 9px 4px;
  transition: opacity 120ms ease;
}
.drawer__btn-delete:hover { opacity: 0.7; }

/* ============ CONNECTOR ROW LIST (replaces tile grid) ============ */
.conn-row-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: var(--space-4);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  overflow: hidden;
}
.conn-row {
  border-bottom: 1px solid var(--hairline-soft);
}
.conn-row:last-child { border-bottom: none; }
.conn-row__header {
  display: flex;
  align-items: center;
  background: var(--surface);
  transition: background 80ms ease;
}
.conn-row__header:hover { background: var(--accent-soft); }
.conn-row.is-open > .conn-row__header { background: rgba(91,45,142,0.06); border-left: 3px solid var(--accent); }
.conn-row__main {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
  padding: 13px 16px;
  background: transparent;
  border: none;
  border-radius: 0;
  cursor: pointer;
  text-align: left;
}
.conn-row.is-open > .conn-row__header > .conn-row__main { padding-left: 13px; }
.conn-row__chev {
  color: var(--text-dim);
  flex-shrink: 0;
  transition: transform 200ms ease, background 120ms ease;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
}
.conn-row__chev svg { display: block; }
.conn-row.is-open .conn-row__chev { transform: rotate(90deg); }
.conn-row__main:hover .conn-row__chev { background: var(--surface-2); }
.conn-row__logo {
  width: 28px; height: 28px;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: var(--radius-row);
  border: 1px solid var(--hairline-soft);
  padding: 3px;
  background: var(--surface);
  transform: scale(var(--logo-scale, 1));
}
.conn-row__name {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  flex-shrink: 0;
  min-width: 130px;
}
.conn-row__status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: var(--radius-pill);
  flex-shrink: 0;
}
.conn-row__status::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.conn-row__status--ok { color: var(--ok); background: var(--ok-bg); }
.conn-row__status--ok::before { background: var(--ok); }
.conn-row__status--partial { color: var(--warn,#d97706); background: rgba(217,119,6,0.1); }
.conn-row__status--partial::before { background: var(--warn,#d97706); }
.conn-row__status--none { color: var(--text-muted); background: var(--surface-2); }
.conn-row__status--none::before { background: var(--text-dim); }
.conn-row__status--error { color: var(--bad,#dc2626); background: rgba(220,38,38,0.1); }
.conn-row__status--error::before { background: var(--bad,#dc2626); }
.conn-row__status--stale { color: var(--warn,#d97706); background: rgba(217,119,6,0.1); }
.conn-row__status--stale::before { background: var(--warn,#d97706); }
.conn-row__count {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-left: 8px;
}
.conn-row__spacer { flex: 1; }
.conn-row__actions {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
  padding-right: 16px;
}
.conn-row__act {
  padding: 4px 10px;
  font-size: 11.5px;
  font-weight: 500;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text-soft);
  cursor: pointer;
  transition: background 100ms ease, border-color 100ms ease, color 100ms ease;
  white-space: nowrap;
}
.conn-row__act:hover { background: var(--surface-2); border-color: var(--text-dim); color: var(--text); }
.conn-row__act--danger:hover { background: rgba(220,38,38,0.07); border-color: var(--bad,#dc2626); color: var(--bad,#dc2626); }
.conn-row__act--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}
.conn-row__act--primary:hover { filter: brightness(1.1); }
.conn-expand {
  overflow: hidden;
  max-height: 0;
  transition: max-height 240ms cubic-bezier(0.2,0,0,1);
  border-top: none;
}
.conn-expand.is-open {
  max-height: 600px;
  border-top: 1px solid var(--hairline-soft);
}
.conn-expand__inner {
  padding: 12px 16px 16px 56px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
@media (max-width: 390px) {
  .conn-row__count { display: none; }
  .conn-row__name { min-width: 100px; }
  .conn-expand__inner { padding-left: 16px; }
}
/* Phones (Rio 9 Oct, #4a2a): the row head wraps so Connect/Reconnect sits under the status pill instead of over it,
   the name wraps instead of pushing the pill out, the attached count hides, and the tab rail scrolls sideways so
   the Connections counter stays on one line and Danger zone is reachable instead of clipped. */
@media (max-width: 480px) {
  .conn-row__header { flex-wrap: wrap; }
  .conn-row__main { flex: 1 1 100%; }
  .conn-row__name { flex: 1 1 auto; min-width: 0; white-space: normal; line-height: 1.25; }
  .conn-row__count { display: none; }
  .conn-row__actions { margin-left: auto; padding: 0 16px 10px; }
  .conn-row__act { min-height: 36px; }
  .setup-tab-rail { overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; padding: 0 12px; gap: 0; }
  .setup-tab-rail::-webkit-scrollbar { display: none; }
  .setup-tab { white-space: nowrap; flex: 0 0 auto; padding: 11px 10px; }
  .setup-tab__count { white-space: nowrap; }
  /* A right-edge fade says the rail scrolls on; it sticks to the viewport edge, not to the content. */
  .setup-tab-rail::after { content: ''; position: sticky; right: 0; flex: 0 0 28px; margin-left: -28px; align-self: stretch; background: linear-gradient(to right, transparent, var(--surface) 70%); pointer-events: none; }
}
/* Attached accounts, Brand Setup connections */
.conn-attached__headside { display: inline-flex; align-items: center; gap: 10px; }
.conn-attached__count {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0;
  text-transform: none;
}
.conn-attached__list {
  margin-top: var(--space-4);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}
.conn-attached__row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--hairline-soft);
  transition: background 100ms ease;
}
.conn-attached__row:last-child { border-bottom: none; }
/* Brand Facebook Pages (2026-10-04): the modal reuses .attach-acct-row; dark tick-boxes follow the theme there only. */
html.dark #brandPagesModal input[type="checkbox"] { color-scheme: dark; }
.conn-pages__reset { background: none; border: 0; padding: 0; font: inherit; color: var(--text-soft); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.conn-pages__reset:disabled { opacity: 0.5; cursor: default; }
.conn-attached__row:hover { background: var(--surface-2); }
/* Remove is always present, never revealed on hover only: a control that exists
   only under a pointer does not exist on touch, and this is the one control that
   must always be reachable (see the handler's invariant note). Quiet until you
   want it, red on intent. */
.conn-attached__remove {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  background: none;
  border: 1px solid var(--hairline);
  border-radius: 5px;
  padding: 3px 9px;
  cursor: pointer;
  transition: color 100ms ease, border-color 100ms ease;
}
.conn-attached__remove:hover:not(:disabled) { color: #dc2626; border-color: #dc2626; }
.conn-attached__remove:disabled { opacity: 0.45; cursor: default; }
.conn-attached__id { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.conn-attached__name {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.conn-attached__num {
  font-size: 11px;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.conn-attached__sync {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface-2);
  padding: 2px 9px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}
.conn-attached__sync.is-ok { color: var(--ok); background: var(--ok-bg); }
.conn-attached__sync.is-fail { color: var(--warn); background: var(--warn-bg); }
.conn-attached__empty {
  margin-top: var(--space-4);
  border: 1px dashed var(--hairline);
  border-radius: var(--radius-card);
  background: var(--surface);
  padding: 18px 16px;
  font-size: 12.5px;
  color: var(--text-muted);
  text-align: center;
}
/* Refresh and Revoke live inside the expanded row now (progressive disclosure) */
.conn-expand__manage {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--hairline-soft);
}
.conn-expand__manage-note {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.conn-expand__manage-btns { display: inline-flex; gap: 6px; }
.conn-expand.is-open { max-height: 680px; }
@media (max-width: 390px) {
  .conn-attached__row { gap: 8px; padding: 10px 12px; }
  .conn-attached__headside { gap: 8px; }
  /* Four items in one row at 375px. The account name is the only element allowed
     to truncate; the sync badge and Remove keep their full labels, because a
     clipped "Remov" and a clipped "Access los" are both worse than a shorter name. */
  .conn-attached__remove { padding: 3px 7px; }
}

/* ============ BRAND KNOWLEDGE CALIBRATION ============ */
.kn__wrap { max-width: 760px; }
.kn__head {
  display: flex;
  align-items: center;
  height: 56px;
  border-bottom: 1px solid var(--hairline);
  margin-bottom: var(--space-4);
}
.kn__head-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.015em;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
}
.kn__head-count {
  font-size: 11px;
  font-weight: 700;
  background: var(--surface-3);
  color: var(--text-muted);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}
.kn__head-action {
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: transparent;
  border: 1px solid var(--hairline);
  color: var(--text-soft);
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease;
}
.kn__head-action:hover { background: var(--surface-2); border-color: var(--text-dim); }

.kn__row--instr {
  display: grid;
  grid-template-columns: 28px 1fr 88px;
  align-items: center;
  min-height: 56px;
  border-bottom: 1px solid var(--hairline-soft);
  padding: 0 4px;
  gap: var(--space-2);
}
.kn__row--instr:last-child { border-bottom: 0; }
.kn__drag {
  display: grid;
  place-items: center;
  width: 28px;
  color: var(--text-dim);
  cursor: grab;
  opacity: 0;
  transition: opacity 120ms ease;
}
.kn__drag svg { width: 14px; }
.kn__row--instr:hover .kn__drag { opacity: 1; }
.kn__instr-text {
  font-size: 13.5px;
  color: var(--text);
  line-height: 1.5;
  outline: none;
  border-radius: 4px;
  padding: 2px 4px;
  cursor: default;
}
.kn__instr-text:focus { background: var(--surface-2); cursor: text; }
.kn__row-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  justify-content: flex-end;
  opacity: 0;
  transition: opacity 120ms ease;
}
.kn__row--instr:hover .kn__row-actions { opacity: 1; }
.kn__row-btn {
  width: 28px; height: 28px;
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: var(--text-muted);
  cursor: pointer;
  display: grid; place-items: center;
  transition: background 120ms ease, color 120ms ease;
}
.kn__row-btn:hover { background: var(--surface-2); color: var(--text); }
.kn__row-btn--del:hover { background: var(--bad-soft); color: var(--bad); }
.kn__row-btn svg { width: 13px; }

/* Inline add row */
.kn__add-row {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 4px;
  border-top: 1px dashed var(--hairline);
  margin-top: 4px;
}
.kn__add-input {
  font: inherit;
  font-size: 13.5px;
  color: var(--text);
  background: transparent;
  border: 0;
  outline: none;
  flex: 1;
  padding: 2px 4px;
  margin-left: 36px;
}
.kn__add-input::placeholder { color: var(--text-dim); }

/* Dropzone */
.kn__dropzone {
  height: 160px;
  border: 1.5px dashed var(--hairline-strong);
  border-radius: var(--radius-card);
  background: var(--surface-2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}
.kn__dropzone:hover, .kn__dropzone.is-dragover {
  border-color: var(--accent);
  border-style: solid;
  background: var(--accent-soft);
  transform: scale(1.005);
}
.kn__dropzone-icon { font-size: 32px; opacity: 0.5; }
.kn__dropzone-title { font-size: 13.5px; font-weight: 600; color: var(--text-soft); }
.kn__dropzone-sub { font-size: 11.5px; color: var(--text-muted); }

/* File rows */
.kn__row--file {
  display: grid;
  grid-template-columns: 36px 1fr 80px 100px 28px;
  align-items: center;
  gap: var(--space-2);
  min-height: 52px;
  padding: 6px 4px;
  border-bottom: 1px solid var(--hairline-soft);
}
.kn__row--file:last-child { border-bottom: 0; }
.kn__file-icon {
  width: 32px; height: 32px;
  border-radius: 6px;
  display: grid; place-items: center;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}
.kn__file-icon--pdf { background: rgba(220,38,38,0.1); color: var(--bad); }
.kn__file-icon--md  { background: var(--accent-soft); color: var(--accent); }
.kn__file-icon--txt { background: var(--surface-3); color: var(--text-soft); }
.kn__file-icon--csv { background: rgba(124,181,24,0.12); color: #5c7d0a; }
.kn__file-icon--doc { background: rgba(0,119,182,0.1); color: #0077B6; }
.kn__file-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kn__file-sub { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.kn__file-size { font-size: 11.5px; color: var(--text-muted); }
.kn__file-date { font-size: 11.5px; color: var(--text-muted); }

/* ============ MICROINTERACTION DEFAULTS ============ */
button:focus-visible, input:focus-visible, [tabindex]:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
}
button:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 2px; } /* S48: the tint alone was 1.3:1 */
/* Card hover: max 2px lift */
.agent-card:hover { transform: translateY(-1px); }
.creative-card:hover { transform: translateY(-1px); }
/* Button hover: brightness only */
.conn-tile__btn--primary:hover { filter: brightness(1.05); opacity: 1; }
/* Loading shimmer */
@keyframes psShimmer {
  0% { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
.ps-shimmer {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%);
  background-size: 800px 100%;
  animation: psShimmer 1.4s ease-in-out infinite;
  border-radius: var(--radius-row);
}

/* ============ MOBILE PARITY ============ */
/* Approvals on a phone: the card board, never the 1232px table. renderDraftsTable hides the board
   whenever the table has rows, so the table and the board swap here (2026-09-17). The breakpoint is
   the one the board's own grid uses (.appr-sec__grid, 560px): at 390px only, an iPhone 16 (393px),
   a Pixel (412px) or a Pro Max (430px) got the desktop table with Approve 800px off-screen. */
@media (max-width: 560px) {
  .drafts__scroll,
  .drafts__v5table,
  .dv5-kbd-hint { display: none; }
  #apprBoard { display: block !important; }
  /* S47: the same 44 px reaches every agent button: card footers, the table's Edit, the chat approval card, the Agents
     tabs, the Approvals filters and family pills, a run card's Stop and dismiss, and the bell's own controls (U10 to U13, U19, U21). */
  .appr-card__actions .ps-appr-btn, .appr-card__done .ps-appr-btn, .cc-card__actions .conn-tile__btn,
  .agent-card__foot .conn-tile__btn, .autos__row .kn__row-btn, .ps-approval__actions .ps-appr-btn, .auto-tab, #draftsPlatformChips .chip, .fam-filter__pill,
  .run-card__x, .notif-popover__mark, .notif-item__x { min-height: 44px; }
  .run-card__stop { position: relative; }
  .run-card__stop::after { content: ''; position: absolute; inset: calc(50% - 22px) -8px; } /* a 44 px hit area, the pill stays a pill */
  .autos__row .kn__row-btn, .run-card__x, .notif-item__x { min-width: 44px; }
  .appr-card__actions { flex-wrap: wrap; }
  .appr-card__actions .ps-appr-btn--perm { flex-basis: 100%; }
}
@media (max-width: 390px) {
  .drafts__cards { display: flex !important; flex-direction: column; gap: var(--space-3); }
  .drafts__card-m {
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: var(--radius-card);
    padding: var(--space-4);
    display: flex; flex-direction: column; gap: var(--space-2);
  }
  .drafts__card-m__top { display: flex; align-items: center; gap: var(--space-2); justify-content: space-between; }
  .drafts__card-m__actions { display: flex; gap: var(--space-2); margin-top: var(--space-2); }
  .drafts__card-m__actions button { flex: 1; min-height: 44px; }
  .drawer { width: 100%; bottom: 0; top: auto; height: 92vh; transform: translateY(100%); border-radius: 20px 20px 0 0; }
  .drawer.is-open { transform: translateY(0); }
  .drawer__drag-handle {
    width: 36px; height: 4px;
    background: var(--hairline);
    border-radius: 2px;
    margin: 10px auto -6px;
  }
  .conn-row-list { border-radius: var(--radius-card); }
  .kn__wrap { max-width: 100%; padding: 0 16px; }
  /* gs-item: hide inline CTA at 390px — whole row is clickable */
  .gs-item__cta { display: none; }
  /* compact scroll padding on mobile */
  .scroll__inner { padding: 16px 14px 60px; }
  /* setup panel tab rail: scroll horizontally instead of clipping */
  .setup-tab-rail { overflow-x: auto; overflow-y: hidden; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
  .setup-tab-rail::-webkit-scrollbar { display: none; }
}

/* ============ CREATIVE PERFORMANCE ============ */
.creatives-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.creative-card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-xs);
  transition: all 160ms ease;
}
.creative-card:hover { border-color: var(--text-dim); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.creative-card__thumb {
  position: relative;
  aspect-ratio: 4 / 5;
  background: linear-gradient(135deg, var(--surface-2), var(--surface-3));
  display: grid;
  place-items: center;
  overflow: hidden;
}
.creative-card__thumb-icon {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,0.85);
  display: grid;
  place-items: center;
  color: #1a1a1f;
}
.creative-card__thumb-icon svg { width: 16px; }
.creative-card__play-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0,0,0,0.28);
  opacity: 0;
  transition: opacity 0.15s ease;
  pointer-events: none;
}
.creative-card:hover .creative-card__play-overlay { opacity: 1; }
.creative-card__play-overlay svg { filter: drop-shadow(0 1px 4px rgba(0,0,0,0.5)); }
.creative-card__platform {
  position: absolute;
  top: 8px; left: 8px;
  background: rgba(0,0,0,0.72);
  color: #fff;
  border-radius: 5px;
  padding: 3px 8px 3px 6px;
  font-size: 10.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.creative-card__platform img { width: 15px; height: 15px; object-fit: contain; filter: none; }
.creative-card__badge {
  position: absolute;
  top: 9px; right: 9px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  backdrop-filter: blur(8px);
}
.creative-card__badge--win { background: rgba(22,163,74,0.9); color: #fff; }
.creative-card__badge--watch { background: rgba(217,119,6,0.9); color: #fff; }
.creative-card__badge--fatigued { background: rgba(220,38,38,0.92); color: #fff; }
.creative-card__body { padding: 12px 14px 14px; }
.creative-card__name {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: -0.005em;
  margin-bottom: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.creative-card__stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
  font-size: 11px;
}
.creative-card__stat-l { color: var(--text-muted); margin-bottom: 1px; font-size: 10.5px; }
.creative-card__stat-v { font-weight: 700; color: var(--text); letter-spacing: -0.005em; font-size: 13px; }
.creative-card__stat-v--good { color: var(--ok); }
.creative-card__stat-v--bad { color: var(--bad); }
.creative-card__freq {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--hairline-soft);
  display: flex;
  align-items: center;
  gap: 8px;
}
.creative-card__freq-bar {
  flex: 1;
  height: 4px;
  background: var(--surface-2);
  border-radius: 2px;
  overflow: hidden;
}
.creative-card__freq-fill { height: 100%; border-radius: 2px; }
.creative-card__freq-label { font-size: 10.5px; color: var(--text-muted); font-weight: 600; white-space: nowrap; }
.creative-card { cursor: pointer; }
.creative-skeleton {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}
.creative-skeleton::before {
  content: '';
  display: block;
  aspect-ratio: 4/5;
  background: linear-gradient(90deg,var(--surface-2) 25%,var(--surface-3) 50%,var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}
.creative-skeleton::after {
  content: '';
  display: block;
  height: 72px;
  background: linear-gradient(90deg,var(--surface-2) 25%,var(--surface-3) 50%,var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  margin: 12px 14px;
  border-radius: 6px;
}
@keyframes shimmer { to { background-position: -200% 0; } }
.creatives-sort-select {
  font-size: 11.5px;
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  color: var(--text);
  border-radius: 7px;
  padding: 4px 8px;
  cursor: pointer;
  outline: none;
}
.creatives-filter-pill {
  font-size: 10.5px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  background: var(--surface-2);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 120ms;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.creatives-filter-pill.active { background: var(--text); color: var(--bg); border-color: var(--text); }
.creatives-empty {
  grid-column: 1 / -1;
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}
/* Creative detail modal */
.creative-modal-overlay {
  position: fixed; inset: 0; z-index: 900;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
}
.creative-modal {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 18px;
  padding: 28px;
  width: min(520px, 92vw);
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
  box-shadow: var(--shadow-lg);
}
.creative-modal__close {
  position: absolute; top: 14px; right: 14px;
  background: var(--surface-2); border: none; border-radius: 50%;
  width: 30px; height: 30px; cursor: pointer; color: var(--text-muted);
  display: grid; place-items: center;
}
.creative-modal__close:hover { background: var(--surface-3); color: var(--text); }
.creative-modal__title { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.creative-modal__sub { font-size: 11.5px; color: var(--text-muted); margin-bottom: 20px; }
.creative-modal__grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 12px 18px;
}
.creative-modal__stat-l { font-size: 10.5px; color: var(--text-muted); margin-bottom: 2px; }
.creative-modal__stat-v { font-size: 20px; font-weight: 700; letter-spacing: -0.03em; }

/* ============ EMPTY STATE TOGGLE ============ */
/* Boot state: hide connection-dependent chrome until the first post-load
   applyAppState() resolves the real connection state. Without this, the
   not-empty layout (banner, coverage, audit rings that read "click to
   connect") paints first, then is-empty-state hides it once data loads --
   a "connect flashes then disappears" on the user's first interaction.
   2026-06-08 fix. Cleared in applyAppState(). */
.app.is-booting #main .scroll__inner > *:not(#psBoot) { display: none !important; }
#psBoot { display: none; }
.app.is-booting #main #psBoot { display: flex; align-items: center; justify-content: center; min-height: 60vh; }
.ps-boot__spinner { width: 26px; height: 26px; border-radius: 50%; border: 2.5px solid var(--hairline); border-top-color: var(--accent); animation: psBootSpin 0.7s linear infinite; }
@keyframes psBootSpin { to { transform: rotate(360deg); } }
/* Empty-state styles ONLY apply on the home/reports view. The :not() guards
   keep Settings, Chats, Brands, MCP, Automations, and the chat page from
   inheriting the centered single-card layout. */
.app.is-empty-state:not(.is-settings-page):not(.is-allchats-page):not(.is-brands-page):not(.is-mcp-page):not(.is-automations-page):not(.is-chat-page):not(.is-members-page) .banner,
.app.is-empty-state:not(.is-settings-page):not(.is-allchats-page):not(.is-brands-page):not(.is-mcp-page):not(.is-automations-page):not(.is-chat-page):not(.is-members-page) .cov,
.app.is-empty-state:not(.is-settings-page):not(.is-allchats-page):not(.is-brands-page):not(.is-mcp-page):not(.is-automations-page):not(.is-chat-page):not(.is-members-page) .sec { display: none; }
.app.is-empty-state:not(.is-settings-page):not(.is-allchats-page):not(.is-brands-page):not(.is-mcp-page):not(.is-automations-page):not(.is-chat-page):not(.is-members-page) .scroll { display: flex; justify-content: center; }
.app.is-empty-state:not(.is-settings-page):not(.is-allchats-page):not(.is-brands-page):not(.is-mcp-page):not(.is-automations-page):not(.is-chat-page):not(.is-members-page) .scroll__inner {
  max-width: 760px;
  width: 100%;
  text-align: center;
  margin-block: auto;
  padding-top: 28px;
  padding-bottom: 28px;
}
.app.is-empty-state:not(.is-settings-page):not(.is-allchats-page):not(.is-brands-page):not(.is-mcp-page):not(.is-automations-page):not(.is-chat-page):not(.is-members-page) .home-greeting { margin-bottom: 28px; text-align: center; }
.app.is-empty-state:not(.is-settings-page):not(.is-allchats-page):not(.is-brands-page):not(.is-mcp-page):not(.is-automations-page):not(.is-chat-page):not(.is-members-page) .home-greeting__hi { font-size: 36px; }
.app.is-empty-state:not(.is-settings-page):not(.is-allchats-page):not(.is-brands-page):not(.is-mcp-page):not(.is-automations-page):not(.is-chat-page):not(.is-members-page) .home-greeting__sub { font-size: 15px; max-width: 100%; margin: 0; white-space: normal; }
.app.is-empty-state:not(.is-settings-page):not(.is-allchats-page):not(.is-brands-page):not(.is-mcp-page):not(.is-automations-page):not(.is-chat-page):not(.is-members-page) .gs-card { max-width: 100%; text-align: left; padding: 24px 26px; }
.app.is-empty-state:not(.is-settings-page):not(.is-allchats-page):not(.is-brands-page):not(.is-mcp-page):not(.is-automations-page):not(.is-chat-page):not(.is-members-page) .gs-card__head { margin-bottom: 18px; }
.app.is-empty-state:not(.is-settings-page):not(.is-allchats-page):not(.is-brands-page):not(.is-mcp-page):not(.is-automations-page):not(.is-chat-page):not(.is-members-page) .gs-card__title { font-size: 18px; }

.state-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 4px;
  font-size: 11px;
}
.state-toggle button {
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  letter-spacing: -0.005em;
}
.state-toggle button.is-on {
  background: var(--gradient-flat);
  color: #fff;
}

/* ============ HOME GREETING + GETTING STARTED ============ */
.home-greeting {
  margin-bottom: 24px;
}
.home-greeting__hi {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 4px;
}
.home-greeting__hi .home-greeting__name {
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.home-greeting__sub {
  font-size: 14px;
  color: var(--text-soft);
  line-height: 1.55;
}

.gs-card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-xs);
  position: relative;
  overflow: hidden;
}
.gs-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.gs-card__title-wrap { flex: 1; min-width: 0; }
.gs-card__tag {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 4px;
}
.gs-card__title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.gs-card__close {
  width: 26px; height: 26px;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 6px;
  display: grid;
  place-items: center;
}
.gs-card__close:hover { background: var(--surface-2); color: var(--text); }
.gs-card__close svg { width: 14px; }

.gs-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.gs-progress__bar {
  flex: 1;
  height: 6px;
  background: var(--surface-2);
  border-radius: 3px;
  overflow: hidden;
}
.gs-progress__fill {
  height: 100%;
  background: var(--gradient);
  border-radius: 3px;
  transition: width 240ms ease;
}
.gs-progress__count {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.005em;
}
.gs-progress__count b {
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.gs-list { display: flex; flex-direction: column; gap: 6px; }
.gs-item {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 13px 14px;
  border-radius: 12px;
  border: 1px solid var(--hairline-soft);
  background: var(--surface);
  transition: background 120ms ease, border-color 120ms ease;
}
.gs-item.is-done { background: var(--surface-2); border-color: var(--hairline-soft); }
.gs-item__check {
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 2px solid var(--hairline);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: transparent;
  transition: all 220ms var(--ease);
  position: relative;
}
.gs-item.is-done .gs-item__check {
  background: var(--gradient);
  border-color: transparent;
  color: #fff;
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(91,45,142,0.3);
}
.gs-item__check svg { width: 13px; transition: all 200ms ease; }
.gs-item.is-done .gs-item__check svg { animation: gsCheckPop 380ms cubic-bezier(.18,1.4,.4,1) both; }
@keyframes gsCheckPop {
  0% { transform: scale(0) rotate(-30deg); opacity: 0; }
  60% { transform: scale(1.25) rotate(0deg); opacity: 1; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}
.gs-item__icon {
  width: 38px; height: 38px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  padding: 6px;
  transition: all 220ms var(--ease);
}
.gs-item__icon img { width: 100%; height: 100%; object-fit: contain; }
.gs-item__icon svg { width: 18px; color: var(--text-soft); }
.gs-item.is-done .gs-item__icon { opacity: 0.55; }
.gs-item__main { flex: 1; min-width: 0; }
.gs-item__title {
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.005em;
  transition: color 200ms ease;
}
.gs-item.is-done .gs-item__title { color: var(--text-muted); text-decoration: line-through; }
.gs-item__sub {
  font-size: 11.5px;
  color: var(--text-soft);
  margin-top: 2px;
  line-height: 1.45;
}
.gs-item__logos {
  display: flex;
  gap: 5px;
  margin-top: 8px;
  align-items: center;
}
.gs-item__logo {
  position: relative;
  width: 22px; height: 22px;
  border-radius: 5px;
  background: #fff;
  border: 1px solid var(--hairline);
  padding: 3px;
  display: grid;
  place-items: center;
  opacity: 0.4;
  filter: grayscale(0.6);
  transition: opacity 180ms ease, filter 180ms ease, border-color 180ms ease, transform 140ms ease;
}
.gs-item__logo img { width: 100%; height: 100%; object-fit: contain; transform: scale(var(--logo-scale, 1)); }
/* Logo scale factors (Lena spec): normalized to fit 44px container at equal visual mass.
   These override Bundle A 1.x values. */
[data-platform="google_ads"]    { --logo-scale: var(--logo-scale-google); }
[data-platform="meta_ads"]      { --logo-scale: var(--logo-scale-meta); }
[data-platform="linkedin"]      { --logo-scale: var(--logo-scale-linkedin); }
[data-platform="tiktok"]        { --logo-scale: var(--logo-scale-tiktok); }
[data-platform="snapchat"]      { --logo-scale: var(--logo-scale-snapchat); }
[data-platform="reddit"]        { --logo-scale: var(--logo-scale-reddit); }
[data-platform="pinterest"]     { --logo-scale: var(--logo-scale-pinterest); }
[data-platform="x"]             { --logo-scale: var(--logo-scale-x); }
[data-platform="microsoft_ads"] { --logo-scale: var(--logo-scale-microsoft); }
[data-platform="openai_ads"]    { --logo-scale: var(--logo-scale-openai); }
[data-platform="ga4"]           { --logo-scale: var(--logo-scale-ga4); }
[data-platform="gtm"]           { --logo-scale: var(--logo-scale-gtm); }
[data-platform="gsc"]           { --logo-scale: var(--logo-scale-gsc); }
[data-platform="merchant"]      { --logo-scale: var(--logo-scale-merchant); }
[data-platform="gmc"]           { --logo-scale: var(--logo-scale-gmc); }
/* Monochrome logos: swap to explicit white-fill variants in dark mode.
   Theme class is .dark on <html> (documentElement). [data-theme] is NOT used.
   gs-item__logo uses hardcoded #fff bg so it is exempt and excluded here. */
.dark img.conn-row__logo[data-platform="openai_ads"],
.dark .conn-tile__logo img[src*="chatgpt"],
.dark .mcp-plat-chip img[src*="chatgpt"],
.dark .tracking-pill img[src*="chatgpt"] { content: url('/assets/logos/chatgpt-dark.svg'); }
.dark img.conn-row__logo[data-platform="merchant"],
.dark .conn-tile__logo img[src*="merchant-center"],
.dark .mcp-plat-chip img[src*="merchant-center"],
.dark .tracking-pill img[src*="merchant-center"] { content: url('/assets/logos/merchant-center-dark.svg'); }
/* TikTok: swap to white-fill SVG on dark theme so the note mark stays visible */
.dark img.conn-row__logo[data-platform="tiktok"],
.dark .conn-tile__logo img[src*="tiktok.png"],
.dark .mcp-plat-chip img[src*="tiktok.png"],
.dark .tracking-pill img[src*="tiktok"] { content: url('/assets/logos/tiktok-dark.svg'); }
.gs-item__logo.is-connected {
  opacity: 1;
  filter: none;
  border-color: var(--ok, #10b981);
}
.gs-item__logo.is-connected::after {
  content: '';
  position: absolute;
  bottom: -2px; right: -2px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--ok, #10b981);
  border: 1.5px solid var(--surface);
}
.gs-item__cta {
  font-size: 11.5px;
  font-weight: 600;
  padding: 7px 14px;
  background: var(--gradient-flat);
  color: #fff;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
  transition: all 140ms ease;
}
.gs-item__cta:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.gs-item.is-done .gs-item__cta { display: none; }

/* Platform picker modal (opened from Getting Started "Connect" / "Connect more"
   CTAs). Reuses the brand-modal shell with a grid of platform cards inside. */
.platform-picker__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  padding: 4px 0 8px;
}
.platform-picker__card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  border-radius: 11px;
  cursor: pointer;
  text-align: left;
  transition: border-color 140ms ease, background 140ms ease, transform 120ms ease;
}
.platform-picker__card:hover { border-color: var(--text-dim); background: var(--surface-3); transform: translateY(-1px); }
.platform-picker__card[disabled] { opacity: 0.5; cursor: not-allowed; }
.platform-picker__card[disabled]:hover { transform: none; border-color: var(--hairline); background: var(--surface-2); }
.platform-picker__logo {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  background: #fff;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  flex-shrink: 0;
}
.platform-picker__logo img { width: 22px; height: 22px; object-fit: contain; }
.platform-picker__label { flex: 1; min-width: 0; }
.platform-picker__name { font-size: 13px; font-weight: 600; color: var(--text); letter-spacing: -0.01em; }
.platform-picker__hint { font-size: 11.5px; color: var(--text-muted); margin-top: 1px; font-weight: 500; }
.platform-picker__check { color: var(--ok); flex-shrink: 0; }
.platform-picker__check svg { width: 16px; }

/* Attach-accounts modal rows. Used post-OAuth and from the Setup connections
   panel (when the user multi-selects which accounts belong to a brand). */
.attach-acct-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  border-radius: 9px;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease;
}
.attach-acct-row:hover { border-color: var(--text-dim); background: var(--surface-3); }
.attach-acct-row input[type="checkbox"] {
  width: 16px; height: 16px;
  accent-color: var(--text);
  cursor: pointer;
  flex-shrink: 0;
}
.attach-acct-row__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.attach-acct-row__name { font-size: 13px; font-weight: 600; color: var(--text); letter-spacing: -0.005em; }
.attach-acct-row__meta { font-size: 11.5px; color: var(--text-muted); font-weight: 500; }
/* Quiet, typographic, single accent. Says which brand already owns this account so
   the same ad account is never silently pulled into a second brand. */
.attach-acct-row__warn { font-size: 11.5px; color: #b45309; font-weight: 500; margin-top: 1px; }
/* "Could not check" is an unknown, not a warning: muted, so the orange keeps meaning danger. */
.attach-acct-row__warn--unknown { color: var(--text-muted); font-weight: 400; }
/* Says why the account list is empty. "Not loaded" and "none exist" are different
   facts and only one of them should send anyone to reconnect. */
.conn-tile__acct-empty { font-size: 11.5px; color: var(--text-muted); padding: 6px 2px; line-height: 1.5; }

/* Confetti when all done */
.gs-card__done-banner {
  display: none;
  background: var(--gradient);
  color: #fff;
  border-radius: 10px;
  padding: 14px 18px;
  margin-top: 10px;
  align-items: center;
  gap: 12px;
}
.gs-card.is-all-done .gs-card__done-banner { display: flex; }
.gs-card__done-banner svg { width: 18px; flex-shrink: 0; }
.gs-card__done-title { font-size: 14px; font-weight: 700; letter-spacing: -0.01em; }
.gs-card__done-sub { font-size: 12px; opacity: 0.9; margin-top: 1px; }

/* ============ CHANNEL COVERAGE STRIP ============ */
.cov {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 16px;
  padding: 15px 18px;
  box-shadow: var(--shadow-xs);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 24px;
}
.cov__label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
}
.cov__chips {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 10px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--surface-2);
  transition: all 140ms ease;
  height: 34px;
}
.chip:hover { border-color: var(--hairline); background: var(--surface); }
.chip__logo {
  width: 18px;
  height: 18px;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 4px;
}
.chip__name {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: -0.008em;
  color: var(--text);
}
.chip__count {
  font-size: 10.5px;
  color: var(--text-muted);
  font-weight: 500;
  background: var(--surface-2);
  padding: 1px 6px;
  border-radius: 999px;
  margin-left: -2px;
}
.chip__act {
  font-size: 10.5px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  border: 0;
  cursor: pointer;
  letter-spacing: -0.005em;
  transition: opacity 140ms ease;
}
.chip__act--connect {
  background: var(--gradient-flat);
  color: #fff;
}
.chip__act--skip {
  background: transparent;
  color: var(--text-muted);
  padding: 3px 7px;
}
.chip__act--skip:hover { color: var(--bad); }
.chip__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px rgba(16,185,129,0.18); flex-shrink: 0; margin-left: 2px; }
.chip__act--include {
  background: var(--ok-bg);
  color: var(--ok);
}
.chip__act--reconnect {
  background: var(--warn-soft);
  color: var(--warn);
}
.chip[data-state='reconnect'] { border-color: rgba(217,119,6,0.25); background: var(--surface); }
.chip[data-state='unknown'] { border-color: var(--hairline); background: var(--surface-2); }
.chip[data-state='unknown'] .chip__name { color: var(--text-soft); }
.chip__dot--unknown { background: var(--text-muted); box-shadow: 0 0 0 3px rgba(148,163,184,0.18); }
.chip[data-state='skipped'] { opacity: 0.5; background: var(--surface-2); }
.chip[data-state='skipped'] .chip__name { text-decoration: line-through; }
.cov__empty { font-size: 12.5px; color: var(--text-muted); }
.cov__action {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-soft);
  background: transparent;
  border: 1px solid var(--hairline);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: 999px;
  white-space: nowrap;
  transition: all 140ms ease;
}
.cov__action:hover { background: var(--surface-2); color: var(--text); border-color: var(--text-dim); }
.cov__action svg { width: 12px; }

/* ============ FINDINGS BANNER ============ */
.banner {
  background: var(--gradient-subtle);
  border: 1px solid var(--hairline);
  border-radius: 18px;
  padding: 16px 18px 16px 18px;
  display: none;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.banner.is-ready { display: flex; }
.banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 0% 50%, rgba(91,45,142,0.06) 0%, transparent 40%);
  pointer-events: none;
}
.banner__icon {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  position: relative;
}
.banner__icon img { width: 100%; height: 100%; object-fit: contain; }
.banner__icon-pulse { display: none; }
.banner__count {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-right: 4px;
}
.banner__body { flex: 1; min-width: 0; }
.banner__title {
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  line-height: 1.3;
}
.banner__sub {
  font-size: 12px;
  color: var(--text-soft);
  margin-top: 3px;
  line-height: 1.5;
}
.banner__sub b { color: var(--text); font-weight: 600; }
.banner__cta {
  font-size: 12.5px;
  font-weight: 600;
  padding: 8px 16px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
  transition: all 140ms ease;
}
.banner__cta:hover { background: var(--gradient-flat); color: #fff; border-color: transparent; transform: translateY(-1px); box-shadow: var(--shadow-md); }
/* THIS WEEK card (merged findings banner + PaidSync analysis). Root keeps class
   "banner" so it inherits the glass styling and the empty-state hide rule. */
.week-card { flex-direction: column; align-items: stretch; gap: 0; padding: 18px 22px 14px; }
.week-card__label { font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-muted); }
.week-card__title { margin: 6px 0 8px; font-size: 16.5px; font-weight: 700; letter-spacing: -0.02em; color: var(--text); }
.week-card__summary { font-size: 13.5px; line-height: 1.6; color: var(--text-soft); max-width: 66ch; white-space: pre-wrap; }
.week-card__findline { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--hairline); }
.week-card__findcopy { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 12.5px; color: var(--text-soft); background: transparent; border: 0; padding: 0; cursor: pointer; }
.week-card__findcopy .banner__title { font-size: 12.5px; }
.week-card__findcopy:hover .banner__title { color: var(--text); }
.week-card__chev { color: var(--text-muted); transition: transform 140ms ease; }
.week-card__findcopy[aria-expanded="true"] .week-card__chev { transform: rotate(180deg); }
.week-card__rows { margin-top: 10px; }
.app.is-empty-state:not(.is-settings-page):not(.is-allchats-page):not(.is-brands-page):not(.is-mcp-page):not(.is-automations-page):not(.is-chat-page):not(.is-members-page) #weekCard { display: none !important; }

/* REPORT FILTERS ROW: single toolbar above the report. position relative +
   z-index so the date popover paints above later sections. Never overflow:hidden
   here, the date popover must escape it. */
.rep-filters { position: relative; z-index: 60; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; background: var(--surface); border: 1px solid var(--hairline); border-radius: 14px; padding: 10px 14px; box-shadow: var(--shadow-sm); margin-bottom: 14px; }
.rep-filters__sp { flex: 1 1 auto; }
@media (max-width: 560px) {
  .rep-filters #reportsFreshness { flex-basis: 100%; order: 9; }
}

/* ============ SECTION HEADERS ============ */
.sec { margin-bottom: 36px; }
.sec__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 14px;
}
.sec__head-text { min-width: 0; }
.sec__title {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text);
  line-height: 1.2;
}
.sec__sub {
  font-size: 12.5px;
  color: var(--text-soft);
  margin-top: 3px;
  line-height: 1.45;
}
.sec__action {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-soft);
  background: transparent;
  border: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border-radius: 6px;
  white-space: nowrap;
}
.sec__action:hover { background: var(--surface-2); color: var(--text); }
.sec__action svg { width: 11px; }
.period-select {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-soft);
  background: transparent;
  border: 1px solid var(--hairline);
  border-radius: 6px;
  padding: 5px 28px 5px 10px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23888' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  outline: none;
  transition: border-color 0.15s;
}
.period-select:hover, .period-select:focus { border-color: var(--accent, #5B2D8E); color: var(--text); }
.section-updating { opacity: 0.5; pointer-events: none; transition: opacity 0.2s; }
.updating-pill {
  font-size: 10.5px;
  font-weight: 500;
  color: var(--accent, #5B2D8E);
  background: rgba(91,45,142,0.08);
  border-radius: 4px;
  padding: 2px 7px;
  display: none;
}
.updating-pill.is-visible { display: inline-block; }

/* ============ KPI HERO ============ */
.kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(2, 1fr); } }

.kpi {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 14px;
  padding: 18px 20px;
  box-shadow: var(--shadow-xs);
  position: relative;
  overflow: hidden;
  transition: all 160ms ease;
}
.kpi:hover { border-color: var(--text-dim); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.kpi__lbl {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 8px;
  letter-spacing: 0.01em;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.kpi__val {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.kpi__spark { margin-top: 12px; height: 26px; line-height: 0; }
.kpi__spark svg { display: block; width: 100%; height: 26px; overflow: visible; }
.kpi__spark--empty { display: none; }
.kpi__foot {
  margin-top: 10px;
  font-size: 11.5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.kpi__delta {
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.kpi__delta svg { width: 10px; }
.kpi__delta--up { color: var(--ok); }
.kpi__delta--dn { color: var(--bad); }
.kpi__period { color: var(--text-muted); font-weight: 400; }

/* ============ REPORT EDIT MODE (Slice B, premium inline) ============ */
.report-editing [data-report-section] {
  border-radius: 16px;
  box-shadow: 0 0 0 1px var(--hairline);
  transition: box-shadow 180ms ease, transform 180ms ease, opacity 180ms ease;
}
.report-editing [data-report-section]:hover {
  box-shadow: 0 0 0 1.5px var(--accent, #5B2D8E), 0 10px 30px rgba(20,18,45,0.07);
  transform: translateY(-1px);
}
.report-editing [data-report-section].rep-hidden { opacity: 0.5; }
.report-editing [data-report-section].rep-hidden:hover { box-shadow: 0 0 0 1.5px var(--hairline); transform: none; }
.rep-edit-hint {
  display: flex; align-items: center; gap: 9px;
  font-size: 12px; font-weight: 500; color: var(--text-soft);
  background: rgba(91,45,142,0.055);
  border: 1px solid rgba(91,45,142,0.16);
  border-radius: 11px; padding: 10px 14px; margin-bottom: 18px;
}
.rep-edit-hint svg { width: 15px; height: 15px; color: var(--accent, #5B2D8E); flex-shrink: 0; }
.rep-sec-edit {
  display: flex; align-items: center; gap: 10px;
  margin: 0 0 14px; padding: 7px 9px 7px 6px;
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: 11px; box-shadow: var(--shadow-xs);
  font-size: 12.5px; font-weight: 600; color: var(--text);
}
.rep-sec-edit.is-dragging { opacity: 0.4; }
.rep-sec-edit.is-dragover { box-shadow: 0 0 0 1.5px var(--accent, #5B2D8E), var(--shadow-sm); }
.rep-sec-edit__grip {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 8px; color: var(--text-muted);
  cursor: grab; flex-shrink: 0; transition: background 130ms ease, color 130ms ease;
}
.rep-sec-edit__grip:hover { background: var(--surface-2); color: var(--text-soft); }
.rep-sec-edit__grip:active { cursor: grabbing; }
.rep-sec-edit__grip svg { width: 16px; height: 16px; }
.rep-sec-edit__lbl { color: var(--text); }
.rep-sec-edit__pill {
  font-size: 9.5px; font-weight: 700; color: var(--text-muted);
  background: var(--surface-2); border: 1px solid var(--hairline);
  border-radius: 5px; padding: 2px 7px; letter-spacing: 0.04em; text-transform: uppercase;
}
.rep-sec-edit__acts { margin-left: auto; display: flex; align-items: center; gap: 5px; }
.rep-sec-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 29px; height: 29px; border-radius: 8px; padding: 0;
  background: var(--surface); border: 1px solid var(--hairline);
  color: var(--text-soft); cursor: pointer; transition: all 130ms ease;
}
.rep-sec-btn svg { width: 15px; height: 15px; }
.rep-sec-btn:hover:not(:disabled) { background: var(--surface-2); color: var(--text); border-color: var(--text-dim); transform: translateY(-1px); }
.rep-sec-btn:disabled { opacity: 0.3; cursor: default; }
.rep-sec-btn--metrics { width: auto; padding: 0 12px; gap: 6px; font-size: 11.5px; font-weight: 600; color: var(--text); }
.rep-sec-btn--on { background: var(--accent, #5B2D8E); border-color: var(--accent, #5B2D8E); color: #fff; }
.rep-sec-btn--on:hover:not(:disabled) { filter: brightness(1.08); background: var(--accent, #5B2D8E); color: #fff; }

/* ============ CARDS ============ */
.card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 14px;
  padding: 18px 20px;
  box-shadow: var(--shadow-xs);
}
.card__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  gap: 12px;
}
.card__title {
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.card__sub { font-size: 11.5px; color: var(--text-muted); font-weight: 400; }
.card__legend {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.card__legend > span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}
.card__legend i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

/* Grid layouts */
.row2 {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 14px;
}
@media (max-width: 1100px) { .row2 { grid-template-columns: 1fr; } }
.row3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
@media (max-width: 1100px) { .row3 { grid-template-columns: 1fr; } }

/* ============ CHANNEL ROWS ============ */
.chanrow {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--hairline-soft);
  font-size: 12.5px;
}
.chanrow:last-child { border-bottom: 0; }
.chanrow__left {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}
.chanrow__left img { width: 16px; height: 16px; object-fit: contain; }
.chanrow__name { font-weight: 500; color: var(--text); }
.chanrow__right { color: var(--text); font-weight: 600; }
.chanrow__right small {
  color: var(--text-muted);
  font-weight: 400;
  margin-left: 2px;
}
.chanrow__bar {
  width: 64px;
  height: 4px;
  background: var(--surface-2);
  border-radius: 2px;
  overflow: hidden;
  margin: 0 12px;
}
.chanrow__bar-fill { height: 100%; border-radius: 2px; }

/* ============ AUDIT RINGS ============ */
.rings {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
@media (max-width: 1100px) { .rings { grid-template-columns: repeat(2, 1fr); } }

.ring {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 14px;
  padding: 18px;
  text-align: center;
  box-shadow: var(--shadow-xs);
  transition: all 160ms ease;
  position: relative;
  overflow: hidden;
}
.ring:hover { border-color: var(--text-dim); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.ring__hdr {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
}
.ring__hdr img { width: 15px; height: 15px; object-fit: contain; }
.ring__hdr span {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.005em;
}
.ring__svg {
  width: 96px;
  height: 96px;
  margin: 0 auto 6px;
  display: block;
}
.ring__score {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-top: 4px;
}
.ring__lbl {
  font-size: 11px;
  font-weight: 600;
  margin-top: 3px;
}
.ring--good .ring__lbl { color: var(--ok); }
.ring--warn .ring__lbl { color: var(--warn); }
.ring--bad .ring__lbl { color: var(--bad); }
.ring--empty {
  border-style: dashed;
  background: var(--surface-2);
}
.ring--empty .ring__hdr img { opacity: 0.5; }
.ring--empty .ring__hdr span { color: var(--text-muted); }
.ring__empty-body {
  height: 96px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 6px;
}
.ring__empty-msg { font-size: 11.5px; color: var(--text-muted); }
.ring__score--empty {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-dim);
  -webkit-text-fill-color: var(--text-dim);
  background: none;
}
.ring__lbl--empty { color: var(--text-muted); }
.ring__footer-btn { margin-top: 8px; }
.ring__cta {
  font-size: 11px;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: all 140ms ease;
}
.ring__cta--sm { padding: 4px 12px; font-size: 10.5px; }
.ring__cta:hover { background: var(--gradient-flat); color: #fff; border-color: transparent; }
/* Tracking sources strip */
.tracking-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.tracking-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px 5px 7px;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  background: var(--surface);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-soft);
}
.tracking-pill img { width: 14px; height: 14px; object-fit: contain; }
.tracking-pill .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--text-dim);
  flex-shrink: 0;
}
.tracking-pill.is-connected .dot { background: var(--ok); }
.tracking-pill a { font-size: 10.5px; color: var(--text-muted); text-decoration: none; margin-left: 2px; }
.tracking-pill a:hover { color: var(--text); }
/* "Ask an admin": a muted word for someone who may not connect, never a link that refuses them. */
.tracking-pill__ask { font-size: 10.5px; color: var(--text-muted); margin-left: 2px; cursor: default; }
.tracking-pill.is-expired .dot { background: var(--bad); }
.chip[data-state="reconnect"] .chip__count { white-space: nowrap; }
@media (max-width: 480px) { .mcp-tile[data-ps-member-chip] .mcp-tile__head { flex-wrap: wrap; } }
@media (max-width: 600px) { .tracking-pill { min-height: 44px; } .tracking-pill a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 6px; } .chip__act { min-height: 44px; } }

/* ============ TABLE ============ */
.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.tbl th {
  padding: 10px 14px 10px 0;
  text-align: left;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--hairline);
}
.tbl th:last-child { padding-right: 0; }
.tbl th.r { text-align: right; }
.tbl td {
  padding: 11px 14px 11px 0;
  border-bottom: 1px solid var(--hairline-soft);
  color: var(--text);
}
.tbl td:last-child { padding-right: 0; }
.tbl td.r { text-align: right; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr:hover td { background: var(--surface-2); }
.tbl__name {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}
.tbl__name img { width: 14px; height: 14px; object-fit: contain; }
.tbl__id {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  color: var(--text-muted);
}
.tbl__roas--good { color: var(--ok); font-weight: 600; }
.tbl__roas--warn { color: var(--warn); font-weight: 600; }
.tbl__roas--bad { color: var(--bad); font-weight: 600; }

/* ============ CHAT DRAWER ============ */
.chat {
  border-left: 1px solid var(--hairline);
  background: var(--surface);
  display: none;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}
.app.is-chat-open .chat { display: flex; }

.chat__head {
  height: var(--topbar-h);
  flex-shrink: 0;
  padding: 0 16px;
  border-bottom: 1px solid var(--hairline);
  display: flex;
  align-items: center;
  gap: 10px;
}
.chat__head-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--gradient);
  display: grid;
  place-items: center;
  color: #fff;
  flex-shrink: 0;
}
.chat__head-icon svg { width: 12px; }
.chat__head-text { flex: 1; min-width: 0; }
.chat__head-title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat__head-sub {
  font-size: 10.5px;
  color: var(--text-muted);
  margin-top: 1px;
}
.chat__close {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: grid;
  place-items: center;
}
.chat__close:hover { background: var(--surface-2); color: var(--text); }
.chat__close svg { width: 14px; }

.chat__msgs {
  flex: 1;
  overflow-y: auto;
  padding: 18px 18px 12px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.chat__msgs::-webkit-scrollbar { width: 4px; }
.chat__msgs::-webkit-scrollbar-thumb { background: var(--hairline); border-radius: 4px; }

.msg__role {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}

/* ============ CLAUDE-STYLE BOT LAYOUT ============ */
.msg--bot {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 12px;
  align-items: start;
}
.msg--bot .msg__role { display: none; }
.msg__avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface-2);
  display: grid;
  place-items: center;
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
}
.msg__avatar img { width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; }
/* PaidSync mark + loading ring (replaces the character avatar). PS monogram is
   the brand rule for PaidSync-in-chat; a gradient ring spins while working. */
.msg__avatar-ps { font-size: 12px; font-weight: 700; letter-spacing: -0.02em; z-index: 1;
  background: var(--gradient); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.msg__avatar.is-thinking::before {
  content: ""; position: absolute; inset: -1px; border-radius: 50%;
  background: conic-gradient(from 0deg, #0077B6, #5B2D8E, #7CB518, #0077B6);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 3px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 3px));
  animation: spin 0.9s linear infinite;
}
.msg__avatar.is-thinking .msg__avatar-ps { animation: pulse 1.4s ease-in-out infinite; }
.msg__content { min-width: 0; }
.msg--bot .msg__tools { display: flex; flex-direction: column; gap: 6px; }
.msg--bot .msg__body { font-size: 14px; line-height: 1.7; }
.msg--bot .msg__body p { margin-bottom: 12px; }
.msg--bot .msg__body p:last-child { margin-bottom: 0; }

.msg__actions {
  display: flex;
  gap: 4px;
  margin-top: 10px;
  opacity: 0;
  transition: opacity 150ms ease;
}
.msg--bot:hover .msg__actions,
.msg__actions.is-pinned { opacity: 1; }
.msg__action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 7px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 140ms ease;
}
.msg__action-btn:hover { background: var(--surface-2); color: var(--text); border-color: var(--text-dim); }
.msg__action-btn svg { width: 14px; height: 14px; }
.msg__action-btn.is-active { color: var(--accent); border-color: var(--accent); }
/* S10 run thumbs (Rio): the lit thumb is the only sign of the saved vote, so it takes --accent-ink (--accent is 2:1 on
   dark); on a phone the thumbs get S47's 44 px, and on a run card's foot their own line, so no button wraps alone. */
.run-thumbs .msg__action-btn.is-active { color: var(--accent-ink); border-color: var(--accent-ink); }
.ah-row--rated { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 10px; } /* a rated history row: thumbs at its top right */
.ah-row--rated > div { grid-column: 1; }
.ah-row--rated > .run-thumbs { grid-column: 2; grid-row: 1 / span 2; align-self: start; }
@media (max-width: 560px) { .run-thumbs .msg__action-btn { min-width: 44px; min-height: 44px; } .run-card__foot .run-thumbs { order: -1; flex-basis: 100%; justify-content: flex-end; } }

/* Claude-style tool chip */
.cc-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 12.5px;
  color: var(--text-soft);
  align-self: flex-start;
}
.cc-chip__icon { width: 16px; height: 16px; display: grid; place-items: center; color: var(--text-muted); }
.cc-chip__icon svg { width: 14px; height: 14px; }
.cc-chip__name { font-weight: 500; }
.cc-chip__time { color: var(--text-dim); font-size: 11.5px; }
.cc-chip.is-running .cc-chip__icon { color: var(--accent); animation: psPulse 1.1s ease-in-out infinite; }
.cc-chip.is-error { border-color: rgba(220,38,38,0.3); color: #b91c1c; }

/* Thinking row */
.ps-thinking-row { display: inline-flex; align-items: center; gap: 10px; padding: 4px 0; font-size: 13px; color: var(--text-soft); }
.ps-thinking-row__phrase { transition: opacity 250ms ease; }
.ps-thinking-row__elapsed { font-size: 11.5px; color: var(--text-dim); font-family: 'JetBrains Mono', monospace; }

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

/* Claude-style approval card for propose_action */
.ps-approval {
  margin-top: 8px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  align-self: stretch;
}
.ps-approval__head {
  /* W3: Apple notification style — white card, no gradient */
  background: #ffffff;
  border-bottom: 1px solid var(--hairline);
  color: var(--text);
  padding: 11px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.ps-approval__head-icon {
  width: 22px; height: 22px; border-radius: 6px;
  background: var(--text);
  display: grid; place-items: center; flex-shrink: 0;
}
.ps-approval__head-icon svg { width: 12px; height: 12px; }
.ps-approval__head-title { font-size: 13px; font-weight: 600; line-height: 1.3; color: var(--text); }
.ps-approval__head-sub { font-size: 11px; color: var(--text-muted); font-weight: 500; margin-top: 1px; }
.ps-approval__body { padding: 12px 14px; font-size: 12.5px; line-height: 1.6; color: var(--text); }
.ps-approval__row { display: flex; gap: 10px; margin-bottom: 6px; }
.ps-approval__row:last-child { margin-bottom: 0; }
.ps-approval__row-label { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); min-width: 84px; flex-shrink: 0; padding-top: 2px; }
.ps-approval__row-val { flex: 1; }
.ps-approval__args { font-family: 'JetBrains Mono', monospace; font-size: 11.5px; color: var(--text-soft); background: var(--surface-2); padding: 8px 10px; border-radius: 7px; white-space: pre-wrap; word-break: break-all; }
.ps-approval__actions { display: flex; gap: 8px; justify-content: flex-end; padding: 0 14px 12px; }
/* Editable numbers on the approval card (RMF X.4). One row per z.number() argument the
   tool's schema declares, range hint is Google's own. Shared by the inline chat card and
   the Approvals board card. */
.ps-edit { display: grid; grid-template-columns: 110px 1fr; gap: 8px 12px; align-items: center; margin-bottom: 8px; }
.ps-edit__k { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); }
.ps-edit__in { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.ps-edit__in input { font: inherit; font-size: 13px; width: 104px; padding: 6px 10px; border: 1px solid var(--hairline-strong); border-radius: 8px; background: var(--surface); color: var(--text); }
.ps-edit__in input.is-edited { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(99,91,255,.12); }
.ps-edit__range { font-size: 11.5px; color: var(--text-muted); }
.ps-edit__was { font-size: 11.5px; color: var(--text-dim); }
.ps-edited-tag { font-size: 11.5px; color: var(--accent); font-weight: 600; margin-right: auto; align-self: center; }
@media (max-width: 520px) { .ps-edit { grid-template-columns: 1fr; } }
.ps-appr-btn {
  font: inherit; font-size: 12px; font-weight: 600;
  padding: 8px 14px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--hairline); background: var(--surface); color: var(--text-soft);
}
.ps-appr-btn:hover { background: var(--surface-2); color: var(--text); }
.ps-appr-btn--apply { background: var(--gradient-flat); color: #fff; border: 0; }
.ps-appr-btn--apply:hover { opacity: 0.92; color: #fff; }
.ps-appr-btn--danger { color: var(--bad, #ef4444); border-color: rgba(239,68,68,0.32); background: rgba(239,68,68,0.05); }
.ps-appr-btn--danger:hover { background: rgba(239,68,68,0.12); border-color: rgba(239,68,68,0.5); color: var(--bad, #ef4444); }
.ps-appr-btn--chat { color: var(--accent-ink); border-color: color-mix(in srgb, var(--accent-ink) 60%, transparent); white-space: nowrap; } /* --accent is 2:1 on dark; one line at 375 (S35 review) */
.ps-appr-btn:disabled { opacity: 0.55; cursor: default; }
.ps-approval.is-applied .ps-approval__head { background: #f0fdf4; border-bottom-color: #bbf7d0; }
.ps-approval.is-applied .ps-approval__head-title { color: #15803d; }
.ps-approval.is-applied .ps-approval__head-icon { background: #16a34a; }
.ps-approval.is-rejected .ps-approval__head { background: #f9fafb; border-bottom-color: var(--hairline); }
.ps-approval.is-rejected .ps-approval__head-icon { background: #6b7280; }
/* The pick card (22 Oct): the platform's own mark on a surface chip, not the dark action glyph square.
   --surface, not white: a mono mark (ChatGPT, X) is inverted on the dark theme and would vanish on white. */
.ps-pick-card .ps-approval__head-icon { width: 28px; height: 28px; background: var(--surface); border: 1px solid var(--hairline); }
.ps-pick-card .ps-approval__head-icon img { width: 18px; height: 18px; object-fit: contain; display: block; }
.ps-pick { margin-top: 10px; }
.ps-pick__line { font-size: 13px; line-height: 1.65; color: var(--text); margin: 0 0 8px; }
.ps-pick__after { margin: 8px 0 0; color: var(--text-muted); }
/* Design gate 22 Oct: the shared head is white on every theme, so on dark the title vanished; the button sat on the divider. */
.ps-pick-card .ps-approval__head { background: var(--surface); }
.ps-pick-card .ps-approval__actions { padding-top: 12px; }
.ps-pick__line, .ps-pick-card .ps-approval__head-title, .ps-pick-card .ps-approval__head-sub { text-wrap: balance; }
.ps-nowrap { white-space: nowrap; }
@media (max-width: 560px) { .ps-pick-card .ps-pick-btn { width: 100%; } }

.msg--user .msg__body {
  background: var(--surface-2);
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}
.msg--bot .msg__body {
  font-size: 13px;
  line-height: 1.65;
  color: var(--text);
}
.msg--bot .msg__body p { margin-bottom: 9px; }
.msg--bot .msg__body p:last-child { margin-bottom: 0; }
.msg--bot .msg__body b, .msg--bot .msg__body strong { font-weight: 600; }
.msg--bot .msg__body h1, .msg--bot .msg__body h2, .msg--bot .msg__body h3 { font-weight: 700; letter-spacing: -0.01em; margin: 14px 0 8px; line-height: 1.3; }
.msg--bot .msg__body h1 { font-size: 17px; }
.msg--bot .msg__body h2 { font-size: 15px; }
.msg--bot .msg__body h3 { font-size: 13.5px; }
.msg--bot .msg__body ul, .msg--bot .msg__body ol { padding-left: 22px; margin: 8px 0; display: flex; flex-direction: column; gap: 5px; }
.msg--bot .msg__body li { font-size: 13px; }
.msg--bot .msg__body a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.msg--bot .msg__body code { background: var(--surface-2); padding: 1px 5px; border-radius: 4px; font-size: 12px; font-family: 'JetBrains Mono', monospace; }
.msg--bot .msg__body pre { background: var(--surface-2); border: 1px solid var(--hairline); border-radius: 8px; padding: 10px 12px; overflow-x: auto; margin: 8px 0; }
.msg--bot .msg__body pre code { background: transparent; padding: 0; font-size: 11.5px; line-height: 1.5; }
.msg--bot .msg__body blockquote { border-left: 3px solid var(--hairline); padding-left: 12px; color: var(--text-muted); margin: 8px 0; }
.msg--bot .msg__body table { border-collapse: collapse; width: 100%; margin: 10px 0; font-size: 12px; }
.msg--bot .msg__body th, .msg--bot .msg__body td { border: 1px solid var(--hairline); padding: 6px 10px; text-align: left; }
.msg--bot .msg__body th { background: var(--surface-2); font-weight: 600; }
.msg--bot .msg__body .ps-cursor { display: inline-block; width: 7px; height: 14px; background: currentColor; opacity: 0.7; animation: psBlink 1s steps(2) infinite; vertical-align: -2px; margin-left: 1px; border-radius: 1px; }
@keyframes psBlink { 50% { opacity: 0; } }
.ps-thinking { display: inline-flex; align-items: center; gap: 8px; color: var(--text-muted); font-size: 12.5px; padding: 4px 0; }
.ps-thinking__dots { display: inline-flex; gap: 3px; }
.ps-thinking__dots span { width: 5px; height: 5px; border-radius: 50%; background: var(--text-soft); opacity: 0.4; animation: psDot 1.2s ease-in-out infinite; }
.ps-thinking__dots span:nth-child(2) { animation-delay: 0.18s; }
.ps-thinking__dots span:nth-child(3) { animation-delay: 0.36s; }
@keyframes psDot { 0%, 80%, 100% { opacity: 0.3; transform: scale(0.85); } 40% { opacity: 1; transform: scale(1); } }
.ps-thinking__elapsed { font-size: 11px; color: var(--text-dim); font-family: 'JetBrains Mono', monospace; }

.chat__empty { display: flex; flex-direction: column; gap: 6px; align-items: center; justify-content: center; height: 100%; text-align: center; padding: 0 20px; color: var(--text-muted); }
.chat__empty-title { font-size: 14px; font-weight: 600; color: var(--text-soft); }
.chat__empty-sub { font-size: 12px; line-height: 1.5; max-width: 280px; }

.chatpg__feed { display: none; flex-direction: column; gap: 22px; width: 100%; max-width: 760px; margin: 0 auto; padding: 6px 0 26px; }
.chats-page.is-conversing .chatpg__hero,
.chats-page.is-conversing .chatpg__greet,
.chats-page.is-conversing .chatpg__suggestions,
.chats-page.is-conversing .chatpg__sugcards,
.chats-page.is-conversing .chatpg__recent { display: none; }
.chats-page.is-conversing .chatpg__feed { display: flex; }
.chats-page.is-conversing .chatpg__body { justify-content: flex-start; padding-top: 24px; }
.chatpg__feed .msg--user .msg__body { display: inline-block; max-width: 80%; }
.chatpg__feed .msg { display: flex; flex-direction: column; }
.chatpg__feed .msg--user { align-items: flex-end; }

.tool-chip.is-running .tool-chip__dot { background: var(--accent); animation: psPulse 1.1s ease-in-out infinite; }
@keyframes psPulse { 0%, 100% { opacity: 0.4; transform: scale(0.85); } 50% { opacity: 1; transform: scale(1); } }
.tool-chip.is-done .tool-chip__dot { background: var(--ok); }
.tool-chip.is-error .tool-chip__dot { background: var(--bad, #ef4444); }
.tool-chip__time { color: var(--text-dim); margin-left: 4px; font-size: 10px; }

.ps-chart { background: var(--surface); border: 1px solid var(--hairline); border-radius: 10px; padding: 14px 16px 10px; margin: 10px 0; }
.ps-chart__title { font-size: 11.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 8px; }
.ps-chart svg { width: 100%; height: 160px; display: block; }
.ps-chart__legend { display: flex; gap: 14px; margin-top: 8px; font-size: 11px; color: var(--text-muted); flex-wrap: wrap; }
.ps-chart__legend span { display: inline-flex; align-items: center; gap: 5px; }
.ps-chart__swatch { width: 9px; height: 9px; border-radius: 50%; }
.ps-mermaid { background: var(--surface); border: 1px solid var(--hairline); border-radius: 10px; padding: 14px; margin: 10px 0; overflow-x: auto; }
.tool-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  padding: 5px 9px;
  font-size: 11px;
  color: var(--text-muted);
  margin: 4px 0 8px;
}
.tool-chip__dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--ok);
}
.tool-chip__name {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  color: var(--accent);
  font-size: 10.5px;
}

.approval {
  margin-top: 10px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.approval__head {
  background: var(--gradient-flat);
  color: #fff;
  padding: 11px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.approval__head-icon {
  width: 20px;
  height: 20px;
  border-radius: 5px;
  background: rgba(255,255,255,0.2);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.approval__head-icon svg { width: 10px; }
.approval__title { font-size: 12.5px; font-weight: 600; line-height: 1.3; }
.approval__body { padding: 14px; font-size: 12.5px; line-height: 1.55; }
.approval__actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding: 0 14px 14px;
}
.appr-btn {
  font-size: 12px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
  border: 1px solid var(--hairline);
  background: var(--surface);
  color: var(--text);
  transition: all 140ms ease;
}
.appr-btn:hover { background: var(--surface-2); }
.appr-btn--apply {
  background: var(--gradient-flat);
  color: #fff;
  border: 0;
  box-shadow: var(--shadow-sm);
}
.appr-btn--apply:hover { opacity: 0.92; transform: translateY(-1px); box-shadow: var(--shadow-md); }

.chat__composer {
  flex-shrink: 0;
  padding: 12px 14px 16px;
  border-top: 1px solid var(--hairline);
  background: var(--surface);
}
.composer-wrap {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 14px;
  padding: 6px 8px 6px 6px;
  display: flex;
  align-items: flex-end;
  gap: 6px;
  transition: border-color 140ms ease, box-shadow 140ms ease;
  box-shadow: var(--shadow-sm);
}
.composer-wrap:focus-within { border-color: var(--accent); box-shadow: var(--shadow-focus); }
.composer-plus {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 0;
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.composer-plus:hover { background: var(--surface-2); color: var(--text); }
.composer-plus svg { width: 16px; }
.composer-voice-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  background: var(--surface-2);
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text);
  border: 0;
  cursor: pointer;
  flex-shrink: 0;
}
.composer-voice-pill:hover { background: var(--surface-3); }
.composer-voice-pill svg { width: 12px; }

/* Recipes / ready prompts */
.composer-recipes-wrap { position: relative; flex-shrink: 0; }
.composer-recipes {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 0;
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.composer-recipes:hover { background: var(--surface-2); color: var(--accent); }
.composer-recipes svg { width: 16px; }
.recipes-popover {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 8px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 14px;
  padding: 6px;
  box-shadow: var(--shadow-lg);
  min-width: 300px;
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 160ms ease, transform 160ms var(--ease);
}
.recipes-popover.is-open { opacity: 1; pointer-events: auto; transform: translateY(0); }
.recipes-popover__head {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 8px 11px 4px;
}
.recipe-item {
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 8px;
  background: transparent;
  border: 0;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: var(--text);
  transition: background 120ms ease;
}
.recipe-item:hover { background: var(--surface-2); }
.recipe-item__icon {
  width: 26px; height: 26px;
  border-radius: 7px;
  background: var(--gradient);
  color: #fff;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.recipe-item__icon svg { width: 13px; }
.recipe-item__main { flex: 1; min-width: 0; }
.recipe-item__title { font-size: 13px; font-weight: 600; letter-spacing: -0.005em; }
.recipe-item__sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; font-weight: 400; line-height: 1.4; }
.composer-listen-dot { display: none; }
.composer-mic {
  width: 28px; height: 28px;
  border: 0;
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  border-radius: 50%;
}
.composer-mic:hover { background: var(--surface-2); color: var(--text); }
.composer-mic svg { width: 13px; }

/* Composer file chips */
.composer-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 4px 8px;
}
.composer-chips:empty { display: none; }
.composer-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px 5px 7px;
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  font-size: 11.5px;
  color: var(--text);
  max-width: 100%;
}
.composer-chip__icon { font-size: 13px; }
.composer-chip__name {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}
.composer-chip__size { color: var(--text-muted); font-size: 10.5px; }
.composer-chip__x {
  width: 16px; height: 16px;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0;
}
.composer-chip__x:hover { color: var(--bad); }
.composer-hint {
  font-size: 10.5px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 8px;
}

/* ============ ATTACHMENT POPOVER (ChatGPT/Claude style) ============ */
.attach-popover {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 8px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 14px;
  padding: 6px;
  box-shadow: var(--shadow-lg);
  min-width: 240px;
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 160ms ease, transform 160ms var(--ease);
}
.attach-popover.is-open { opacity: 1; pointer-events: auto; transform: translateY(0); }
.attach-popover__item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 11px;
  border-radius: 8px;
  background: transparent;
  border: 0;
  cursor: pointer;
  text-align: left;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  transition: background 120ms ease;
}
.attach-popover__item:hover { background: var(--surface-2); }
.attach-popover__icon {
  width: 28px; height: 28px;
  border-radius: 7px;
  background: var(--surface-2);
  display: grid;
  place-items: center;
  color: var(--text-soft);
  flex-shrink: 0;
}
.attach-popover__icon svg { width: 14px; }
.attach-popover__main { flex: 1; min-width: 0; }
.attach-popover__title { font-size: 13px; font-weight: 500; }
.attach-popover__sub { font-size: 10.5px; color: var(--text-muted); margin-top: 1px; font-weight: 400; }

/* Container wrap to position popover */
.composer-plus-wrap { position: relative; flex-shrink: 0; }

/* ============ DATE RANGE PICKER (Google Ads style) ============ */
.date-trigger {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font: inherit;
  font-size: 12.5px;
  font-weight: 500;
  background: var(--surface);
  border: 1px solid var(--hairline);
  padding: 6px 12px;
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
  transition: all 140ms ease;
}
.date-trigger:hover { border-color: var(--text-dim); background: var(--surface-2); }
.date-trigger svg { width: 13px; opacity: 0.7; }
.date-picker {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  display: none;
  z-index: 95;
  width: 480px;
  overflow: hidden;
}
.date-picker.is-open { display: flex; }
.date-picker__presets {
  width: 168px;
  border-right: 1px solid var(--hairline);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.date-preset {
  width: 100%;
  text-align: left;
  font: inherit;
  font-size: 11.5px;
  padding: 5px 9px;
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background 120ms ease;
}
.date-preset:hover { background: var(--surface-2); }
.date-preset.is-active { background: var(--accent-soft); font-weight: 600; }
.date-preset__chev { color: var(--text-muted); font-size: 10px; opacity: 0.6; }
.date-preset__lock { display: none; width: 12px; height: 12px; margin-left: auto; flex-shrink: 0; background: no-repeat center / contain; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2386868b' stroke-width='2'%3E%3Crect x='3' y='11' width='18' height='11' rx='2'/%3E%3Cpath d='M7 11V7a5 5 0 0 1 10 0v4'/%3E%3C/svg%3E"); }
.date-preset.is-locked { color: var(--text-muted); }
.date-preset.is-locked .date-preset__lock { display: inline-block; }
.date-preset-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 4px;
  font-size: 11px;
  color: var(--text);
}
.date-preset-row input {
  width: 36px;
  font: inherit;
  font-size: 11px;
  padding: 3px 5px;
  border: 1px solid var(--hairline);
  border-radius: 5px;
  background: var(--surface);
  text-align: center;
  color: var(--text);
}
.date-preset-row input:focus { outline: 0; border-color: var(--accent); }
.date-preset-rule { height: 1px; background: var(--hairline); margin: 4px 0; }
/* Wired date picker: presets + calendar + compare/apply footer (Meta/Shopify style) */
.date-picker { width: 600px; flex-direction: column; }
.date-picker__top { display: flex; }
.date-picker__presets { width: 168px; padding: 10px; gap: 2px; }
.date-picker__label { font-size: 9.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); padding: 2px 9px 6px; }
.date-picker__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--hairline); padding: 10px 14px; }
.date-cmp__inline { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.date-cmp__title { font-size: 12px; font-weight: 700; color: var(--text); }
.date-cmp__switch { width: 36px; height: 21px; border-radius: 11px; border: 1px solid var(--hairline); background: var(--surface-2); position: relative; cursor: pointer; transition: background 150ms ease, border-color 150ms ease; padding: 0; flex-shrink: 0; }
.date-cmp__switch[aria-checked="true"] { background: var(--accent); border-color: var(--accent); }
.date-cmp__knob { position: absolute; top: 1px; left: 1px; width: 17px; height: 17px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,0.25); transition: transform 150ms ease; }
.date-cmp__switch[aria-checked="true"] .date-cmp__knob { transform: translateX(15px); }
.date-cmp__opts { display: flex; gap: 5px; }
.date-cmp__opts.is-off { opacity: 0.4; pointer-events: none; }
.date-cmp__opt { font: inherit; font-size: 11px; padding: 5px 10px; border: 1px solid var(--hairline); border-radius: 7px; background: var(--surface); color: var(--text); cursor: pointer; display: flex; align-items: center; gap: 5px; transition: all 120ms ease; }
.date-cmp__opt:hover:not(:disabled) { border-color: var(--text-dim); background: var(--surface-2); }
.date-cmp__opt.is-active { border-color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.date-cmp__opt:disabled { opacity: 0.55; cursor: default; }
.date-cmp__soon { font-size: 8.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); background: var(--surface-2); border: 1px solid var(--hairline); border-radius: 4px; padding: 1px 5px; }
.date-apply { font: inherit; font-size: 11.5px; font-weight: 700; color: #fff; background: var(--accent); border: 1px solid var(--accent); border-radius: 9px; padding: 7px 16px; cursor: pointer; transition: filter 130ms ease; flex-shrink: 0; }
.date-apply:hover { filter: brightness(1.08); }
/* Upsell strip (non-entitled plans) */
.date-upsell { display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--hairline); padding: 11px 13px; background: linear-gradient(0deg, rgba(91,45,142,0.04), transparent); }
.date-upsell__ic { width: 26px; height: 26px; border-radius: 8px; background: var(--accent-soft); display: grid; place-items: center; flex-shrink: 0; }
.date-upsell__ic span { width: 13px; height: 13px; background: no-repeat center / contain; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='13' height='13' viewBox='0 0 24 24' fill='none' stroke='%235B2D8E' stroke-width='2'%3E%3Crect x='3' y='11' width='18' height='11' rx='2'/%3E%3Cpath d='M7 11V7a5 5 0 0 1 10 0v4'/%3E%3C/svg%3E"); }
.date-upsell__tx { font-size: 11px; color: var(--text-soft); line-height: 1.35; flex: 1; }
.date-upsell__tx b { color: var(--text); font-weight: 600; }
.date-upsell__cta { font: inherit; font-size: 11px; font-weight: 700; color: #fff; background: var(--gradient); border: 0; border-radius: 8px; padding: 6px 12px; cursor: pointer; white-space: nowrap; }
.date-cmp__optlock { display: none; width: 11px; height: 11px; margin-left: 5px; vertical-align: -1px; background: no-repeat center / contain; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='11' viewBox='0 0 24 24' fill='none' stroke='%2386868b' stroke-width='2'%3E%3Crect x='3' y='11' width='18' height='11' rx='2'/%3E%3Cpath d='M7 11V7a5 5 0 0 1 10 0v4'/%3E%3C/svg%3E"); }
.date-cmp__opt.is-cmp-locked { color: var(--text-muted); }
.date-cmp__opt.is-cmp-locked .date-cmp__optlock { display: inline-block; }
@media (max-width: 680px) {
  .date-picker { width: min(92vw, 380px); }
  .date-picker__top { flex-direction: column; }
  .date-picker__presets { width: 100%; border-right: 0; border-bottom: 1px solid var(--hairline); flex-direction: row; flex-wrap: wrap; gap: 4px; }
  .date-picker__presets .date-picker__label { width: 100%; }
  .date-picker__presets .date-preset { width: auto; }
  .date-picker__foot { flex-wrap: wrap; }
}
/* Premium report toolbar buttons (Edit / Reset) */
.rep-toolbtn { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 11.5px; font-weight: 600; color: var(--text-soft); background: var(--surface); border: 1px solid var(--hairline); border-radius: 9px; padding: 6px 11px; cursor: pointer; transition: all 140ms ease; white-space: nowrap; }
.rep-toolbtn svg { width: 13px; height: 13px; flex-shrink: 0; }
.rep-toolbtn:hover { border-color: var(--text-dim); background: var(--surface-2); color: var(--text); transform: translateY(-1px); }
.rep-toolbtn.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }
.rep-toolbtn.is-active:hover { filter: brightness(1.08); background: var(--accent); color: #fff; }
.rep-toolbtn--quiet { border-color: transparent; background: transparent; color: var(--text-muted); padding: 6px 9px; }
.rep-toolbtn--quiet:hover { background: var(--surface-2); color: var(--text); border-color: transparent; transform: none; }
.date-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 5px;
  font-size: 11.5px;
  color: var(--text);
}
.date-picker__cal {
  flex: 1;
  padding: 10px 12px 12px;
  min-width: 0;
}
.date-picker__cal-inputs {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}
.date-input-wrap {
  flex: 1;
  min-width: 0;
}
.date-input-label { font-size: 9.5px; font-weight: 600; color: var(--text-muted); margin-bottom: 3px; letter-spacing: 0.04em; }
.date-input {
  width: 100%;
  font: inherit;
  font-size: 11.5px;
  padding: 5px 7px;
  border: 1px solid var(--hairline);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  min-width: 0;
}
.date-input:focus { outline: 0; border-color: var(--accent); }
.date-input--star { color: var(--bad); }
.date-cal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.date-cal-month {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.date-cal-month svg { width: 10px; color: var(--text-muted); }
.date-cal-nav {
  display: flex;
  gap: 2px;
}
.date-cal-nav button {
  width: 22px; height: 22px;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 5px;
  display: grid;
  place-items: center;
}
.date-cal-nav button:hover { background: var(--surface-2); color: var(--text); }
.date-cal-nav button svg { width: 10px; }
.date-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  font-size: 11px;
}
.date-cal-day {
  text-align: center;
  padding: 3px 0;
  font-size: 9.5px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}
.date-cal-cell {
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  cursor: pointer;
  color: var(--text);
  font-size: 11.5px;
  position: relative;
  transition: background 120ms ease, color 120ms ease;
  user-select: none;
}
.date-cal-cell:hover { background: var(--surface-2); }
.date-cal-cell.is-other { color: var(--text-dim); opacity: 0.5; cursor: default; }
.date-cal-cell.is-other:hover { background: transparent; }
.date-cal-cell.is-today { font-weight: 700; color: var(--accent); }
.date-cal-cell.is-range { background: var(--accent-soft); border-radius: 0; }
.date-cal-cell.is-start, .date-cal-cell.is-end {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}
.date-cal-cell.is-start { border-radius: 6px 0 0 6px; }
.date-cal-cell.is-end { border-radius: 0 6px 6px 0; }
/* Comparison window: a subtle underline so it reads as secondary to the main range */
.date-cal-cell.is-cmp-range { box-shadow: inset 0 -2px 0 0 var(--text-dim); }
.date-cal-cell.is-cmp-start, .date-cal-cell.is-cmp-end { box-shadow: inset 0 -2px 0 0 var(--accent); }
.date-cmp__range { font-size: 11px; color: var(--text-soft); font-weight: 500; }
.date-cmp__range b { color: var(--text); font-weight: 700; }
.date-cmp-inputs { margin-top: 2px; }
.date-cmp-inputs .date-input-label { color: var(--accent); }
.date-input.is-editing { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.date-cal-cell.is-start.is-end { border-radius: 6px; }

/* ============ USER SETTINGS PAGE ============ */
.settings-page {
  display: none;
  flex: 1;
  flex-direction: column;
  background: var(--canvas);
  min-height: 0;
  overflow: hidden;
}
.app.is-settings-page .settings-page { display: flex; }
.app.is-settings-page .scroll,
.app.is-settings-page .chats-page,
.app.is-settings-page .mcp-page,
.app.is-settings-page .brands-page { display: none; }
.settings-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 24px 80px;
}
.settings-inner {
  display: grid;
  grid-template-columns: 188px minmax(0, 1fr);
  gap: 36px;
  align-items: start;
  max-width: 100%;
}
.settings-main { max-width: 880px; }
.settings-row__full {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 900px) { .settings-row__full { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
  .settings-body { padding: 16px 12px 60px; }
  .settings-inner { grid-template-columns: 1fr; gap: 0; }
  .settings-tabs { display: flex; flex-direction: row; overflow-x: auto; gap: 0; border-bottom: 1px solid var(--hairline); padding-bottom: 0; flex-shrink: 0; white-space: nowrap; position: static; margin-bottom: 16px; }
  .settings-tab { border-radius: 0; border-bottom: 2px solid transparent; padding: 10px 14px; flex-shrink: 0; width: auto; margin-bottom: 0; background: transparent; }
  .settings-tab.is-active { background: transparent; border-bottom-color: var(--accent); }
  .settings-tab svg { display: none; }
}
.settings-view { display: none; }
.settings-view.is-active { display: block; }
.notif-wrap { position: relative; }
.notif-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(360px, calc(var(--notif-room, 100vw) - 32px));
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  display: none;
  z-index: 90;
}
.notif-popover.is-open { display: block; }
/* S47: the bell list is min(360px, 100vw - 32px). On a phone it hangs from the topbar, 16 px in from its right edge, and its
   room is the topbar (100%), not the screen, so it never runs off the left or under the sidebar rail (U2). */
@media (max-width: 560px) { .notif-wrap { position: static; } .notif-popover { right: 16px; --notif-room: 100%; } }
.notif-popover__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--hairline);
}
.notif-popover__title { font-size: 13.5px; font-weight: 700; letter-spacing: -0.01em; }
.notif-popover__mark {
  font: inherit;
  font-size: 11.5px;
  color: var(--text-muted);
  background: transparent;
  border: 0;
  cursor: pointer;
  font-weight: 500;
}
.notif-popover__mark:hover { color: var(--text); }
.notif-popover__list { max-height: 360px; overflow-y: auto; }
.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--hairline-soft);
  cursor: pointer;
}
.notif-item:last-child { border-bottom: 0; }
.notif-item:hover { background: var(--surface-2); }
.notif-item.is-clickable { cursor: pointer; }
.notif-item__icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--gradient);
  color: #fff;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.notif-item__icon--warn { background: var(--warn-bg); color: var(--warn); }
.notif-item__icon--ok { background: var(--ok-bg); color: var(--ok); }
.notif-item__icon svg { width: 14px; }
.notif-item__main { flex: 1; min-width: 0; }
.notif-item__title { font-size: 13px; font-weight: 600; letter-spacing: -0.005em; line-height: 1.35; }
.notif-item__sub { font-size: 11.5px; color: var(--text-soft); margin-top: 2px; line-height: 1.45; }
.notif-item__time { font-size: 10.5px; color: var(--text-muted); margin-top: 4px; }
.notif-item.is-unread { background: var(--accent-soft); }
.notif-item__dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  margin-top: 7px;
}
.notif-item:not(.is-unread) .notif-item__dot { visibility: hidden; }
.notif-empty {
  padding: 40px 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}
.notif-empty svg { width: 72px; height: 72px; opacity: 1; margin-bottom: 14px; }
/* Sticky only where the tabs are the side column: at 640 px and below they are a static strip above the content (Rio, Team top-up 6). */
@media (min-width: 641px) { .settings-tabs { position: sticky; top: 0; } }
.settings-tab {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 7px;
  font: inherit;
  font-size: 13px;
  color: var(--text-soft);
  background: transparent;
  border: 0;
  cursor: pointer;
  width: 100%;
  text-align: left;
  margin-bottom: 2px;
}
.settings-tab:hover { background: var(--surface-2); color: var(--text); }
.settings-tab.is-active { background: var(--accent-soft); color: var(--text); font-weight: 600; }
.settings-tab svg { width: 14px; color: var(--text-muted); }
.settings-tab.is-active svg { color: var(--accent); }
.settings-main { min-width: 0; }
.settings-section { margin-bottom: 28px; }
.settings-section__title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}
.settings-section__sub { font-size: 12.5px; color: var(--text-soft); margin-bottom: 14px; line-height: 1.55; }
.settings-row {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  padding: 14px 18px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.settings-row__avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--gradient);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
}
.settings-row__main { flex: 1; min-width: 0; }
.settings-row__label { font-size: 11px; color: #6e6e73; font-weight: 500; } /* 5.1:1 on white; --text-muted is 3.6:1 (Rio, Team top-up 11) */
html.dark .settings-row__label { color: #82828d; } /* --text-muted is 4.47:1 on the dark row */
.settings-row__name { font-size: 14.5px; font-weight: 600; letter-spacing: -0.01em; margin-top: 2px; }
.settings-row__sub { font-size: 12px; color: var(--text-soft); margin-top: 2px; }
.settings-row__btn {
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  padding: 7px 13px;
  border-radius: 7px;
  border: 1px solid var(--hairline);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}
.settings-row__btn--primary { background: var(--gradient-flat); color: #fff; border: 0; box-shadow: var(--shadow-sm); }
.settings-row__btn--danger:hover { background: var(--bad-bg); color: var(--bad); border-color: var(--bad); }
.settings-row__btn:disabled { opacity: .55; cursor: default; }
@media (max-width: 560px) { .settings-row__btn, .ps-modal .modal-btn { min-height: 44px; } }
.settings-field { margin-bottom: 12px; }
.settings-field label { font-size: 12px; font-weight: 500; color: var(--text-soft); display: block; margin-bottom: 4px; }
.settings-field input,
.settings-field select {
  width: 100%;
  font: inherit;
  font-size: 13px;
  padding: 8px 11px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  color: var(--text);
}
.plan-card {
  background: var(--gradient-subtle);
  border: 1px solid var(--accent);
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 12px;
}
.plan-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.plan-card__plan {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  background: var(--gradient);
  color: #fff;
  padding: 4px 11px;
  border-radius: 999px;
}
.plan-card__price {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.plan-card__price small { font-size: 13px; color: var(--text-muted); font-weight: 500; }
.plan-card__usage { font-size: 12px; color: var(--text-soft); margin-top: 6px; }
.plan-card__bar {
  height: 6px;
  background: var(--surface-2);
  border-radius: 3px;
  overflow: hidden;
  margin: 8px 0 4px;
}
.plan-card__bar-fill {
  height: 100%;
  background: var(--gradient);
  border-radius: 3px;
}
.plan-card__price-row { display: flex; align-items: baseline; gap: 6px; margin-bottom: 2px; }
.plan-card__price { font-size: 24px; font-weight: 800; letter-spacing: -0.03em; background: var(--gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.plan-card__interval { font-size: 12px; color: var(--text-muted); font-weight: 500; }
/* ONE METER plan card (approved 2026-10-27): usage is the hero. Its parts show only under .plan-card--one. */
.om-only { display: none; }
.plan-card--one .om-only { display: block; }
.plan-card--one .om-legacy { display: none !important; }
.plan-card--one .plan-card__head { justify-content: flex-start; gap: 10px; margin-bottom: 0; }
.plan-card--one #billingManageBtn { margin-left: auto; }
.plan-card .plan-card__quiet { display: none; font-size: 12.5px; color: var(--label); font-weight: 500; white-space: nowrap; }
.plan-card--one .plan-card__quiet:not(:empty) { display: inline; }
.plan-card__used { align-items: baseline; justify-content: space-between; gap: 12px; margin-top: 18px; }
.plan-card--one .plan-card__used { display: flex; }
.plan-card__big { font-size: 28px; font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; color: var(--text); }
.plan-card__big small { font-size: 15px; font-weight: 600; color: var(--label); letter-spacing: -0.01em; }
.plan-card__pct { font-size: 15px; font-weight: 700; color: var(--text-soft); font-variant-numeric: tabular-nums; }
.plan-card--one .plan-card__bar { height: 8px; border-radius: 999px; margin: 10px 0 8px; }
html.dark .plan-card--one .plan-card__bar { background: var(--hairline); }
.plan-card--one .plan-card__bar-fill { border-radius: 999px; }
.plan-card--one .plan-card__bar-fill.is-warn { background: var(--warn); }
.plan-card--one .plan-card__bar-fill.is-crit { background: var(--bad); }
.plan-card__line { font-size: 12px; color: var(--text-soft); line-height: 1.6; text-wrap: pretty; }
html.dark .plan-card--one { border-color: var(--accent-ink); }
.om-how { font-size: 12.5px; color: var(--text-soft); line-height: 1.6; margin: 0 0 16px; text-wrap: pretty; }
.om-how p + p { margin-top: 6px; }
.om-split { border: 1px solid var(--hairline); border-radius: 12px; background: var(--surface); }
.om-split__head { display: flex; justify-content: space-between; gap: 12px; font-size: 11px; font-weight: 600; color: var(--label); padding: 12px 18px; border-bottom: 1px solid var(--hairline-soft); }
.om-split__row { display: flex; justify-content: space-between; gap: 16px; padding: 11px 18px; font-size: 13.5px; border-bottom: 1px solid var(--hairline-soft); }
.om-split__row:last-child { border-bottom: 0; }
.om-split__row > span:first-child { text-wrap: pretty; }
.om-split__row > span:last-child { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.om-split__row small { display: block; font-size: 12px; color: var(--label); margin-top: 2px; }
.om-note { font-size: 12px; color: var(--label); line-height: 1.55; margin: 10px 0 16px; text-wrap: pretty; }
@media (max-width: 560px) { .om-split__head, .om-split__row { padding-left: 14px; padding-right: 14px; } }
.billing-status-badge {
  display: inline-flex; align-items: center; font-size: 11px; font-weight: 700;
  padding: 3px 9px; border-radius: 999px; letter-spacing: 0.02em; text-transform: uppercase;
}
.billing-status-badge--active { background: var(--ok-bg); color: var(--ok); }
.billing-status-badge--past_due { background: var(--warn-bg,#fff8e1); color: var(--warn,#f59e0b); }
.billing-status-badge--canceled { background: var(--bad-bg); color: var(--bad); }
.billing-status-badge--trialing { background: var(--accent-bg,#eff6ff); color: var(--accent,#3b82f6); }
/* Billing sub-tab rail */
.billing-subtab-rail {
  display: flex; gap: 2px; padding: 4px; background: var(--surface-2);
  border-radius: 10px; margin-bottom: 20px; width: fit-content;
}
.billing-subtab {
  padding: 7px 16px; font: inherit; font-size: 13px; font-weight: 500;
  color: var(--text-muted); background: transparent; border: none;
  border-radius: 7px; cursor: pointer; white-space: nowrap; transition: background 0.12s, color 0.12s;
}
.billing-subtab--active {
  background: var(--surface); color: var(--text); font-weight: 600;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
@media (max-width: 480px) {
  .billing-subtab-rail { width: 100%; }
  .billing-subtab { flex: 1; text-align: center; padding: 7px 8px; }
}
/* Plan picker (Change plan), in the pricing page's register (Ahmed 2026-10-02): a light sheet whatever the
   theme, the Monthly/Yearly capsule with the offer chip inside Yearly, two glass tiles (Pro, Team) with
   the TASKS capsules and the live lines, the Done For You box below, one plain line when the yearly offer
   does not apply to a move. Colours are explicit so html.dark changes nothing here. */
.ppm-box { --surface:#ffffff; --surface-elev:#ffffff; --surface-2:#f5f5f7; --surface-3:#ececef; --hairline:#e8e8ed; --hairline-soft:#f0f0f3; --text:#0a0a0f; --text-soft:#424245; --text-muted:#6e6e73; --text-dim:#86868b; --accent:#5B2D8E; --accent-soft:rgba(91,45,142,0.08); background:#fff; color:#1d1d1f; border-radius:28px; padding:26px 30px 24px; max-width:940px; width:100%; max-height:94vh; overflow-y:auto; font-family:'Inter',-apple-system,BlinkMacSystemFont,sans-serif; }
.ppm-top { display:flex; align-items:center; justify-content:space-between; }
.ppm-right { display:flex; align-items:center; gap:10px; }
.ppm-curpick { position:relative; display:inline-flex; align-items:center; color:#5b6075; font-size:13px; }
.ppm-curpick select { appearance:none; -webkit-appearance:none; border:0; background:transparent; font:inherit; color:inherit; padding:6px 18px 6px 6px; border-radius:8px; cursor:pointer; }
.ppm-curpick select:hover, .ppm-curpick select:focus-visible { background:#f1f2f6; color:#0f1222; outline:none; }
.ppm-curpick svg { position:absolute; right:3px; width:12px; height:12px; pointer-events:none; }
.ppm-title { font-size:22px; font-weight:600; letter-spacing:-0.022em; color:#1d1d1f; }
.ppm-x { width:34px; height:34px; border:0; border-radius:50%; background:#f5f5f7; color:#6e6e73; font-size:18px; cursor:pointer; line-height:1; }
.ppm-head { display:flex; align-items:center; justify-content:space-between; gap:16px; flex-wrap:wrap; margin:12px 0 0; }
.ppm-head__sub { font-size:15px; color:#5c5c61; } .ppm-head__sub strong { color:#1d1d1f; font-weight:600; }
.ppm-seg { display:inline-flex; padding:4px; border-radius:980px; background:rgba(21,17,43,0.06); }
.ppm-seg__opt { font:inherit; border:0; background:transparent; height:38px; padding:0 16px; border-radius:980px; font-size:15px; font-weight:500; color:#5c5c61; cursor:pointer; display:inline-flex; align-items:center; gap:8px; white-space:nowrap; }
.ppm-seg__opt[aria-checked="true"] { background:#fff; color:#1d1d1f; font-weight:600; box-shadow:0 2px 10px rgba(28,18,64,0.14); }
.ppm-chip { display:inline-flex; align-items:center; gap:6px; height:24px; padding:0 10px; border-radius:980px; background:rgba(91,45,142,0.10); color:#5B2D8E; font-size:13px; font-weight:700; }
.ppm-chip[hidden] { display:none; } .ppm-chip small { font-weight:500; color:#5c5c61; font-size:13px; } .ppm-chip svg { width:12px; height:12px; }
/* Promo code (BF2026, Ahmed 2026-10-30): one quiet line under the billing cycle, right-aligned with it. */
.ppm-code { display:flex; justify-content:flex-end; align-items:center; flex-wrap:wrap; gap:4px 8px; min-height:34px; margin-top:8px; font-size:14px; color:#5c5c61; }
.ppm-code__open:focus-visible, .ppm-code__x:focus-visible, .ppm-code__go:focus-visible { outline:2px solid #5B2D8E; outline-offset:2px; border-radius:6px; }
.ppm-code__open, .ppm-code__x { font:inherit; border:0; background:none; padding:4px 2px; color:#5B2D8E; font-weight:600; cursor:pointer; text-decoration:underline; text-underline-offset:3px; }
.ppm-code__form { display:inline-flex; align-items:center; gap:6px; }
.ppm-code__in { font:inherit; font-size:14px; height:34px; width:140px; padding:0 12px; border:1px solid rgba(21,17,43,0.18); border-radius:10px; background:#fff; color:#1d1d1f; text-transform:uppercase; letter-spacing:0.04em; }
.ppm-code__in:focus { outline:2px solid #5B2D8E; outline-offset:1px; border-color:transparent; }
.ppm-code__go { font:inherit; font-size:14px; font-weight:600; height:34px; min-width:96px; padding:0 14px; border:0; border-radius:10px; background:#1d1d1f; color:#fff; cursor:pointer; }
.ppm-code__go[disabled] { opacity:0.6; cursor:default; }
.ppm-code__on { color:#1d1d1f; } .ppm-code__on b { color:#5B2D8E; }
.ppm-code__err { color:#b91c1c; flex-basis:100%; text-align:right; }
@media (max-width:600px) { .ppm-code { justify-content:flex-start; } .ppm-code__err { text-align:left; } .ppm-code__open, .ppm-code__x { min-height:44px; } .ppm-code__in, .ppm-code__go { height:44px; } }
.ppm-code__in::placeholder { color:#5c5c61; text-transform:none; letter-spacing:0; }
.ppm-stage { position:relative; isolation:isolate; overflow:hidden; overflow:clip; border-radius:22px; margin-top:18px; padding:20px; background:#f5f5f7; }
.ppm-stage::before { content:""; position:absolute; inset:-30% -10%; z-index:-1; background:radial-gradient(42% 46% at 14% 20%, rgba(0,119,182,0.26), transparent 70%), radial-gradient(40% 44% at 82% 24%, rgba(91,45,142,0.26), transparent 70%), radial-gradient(46% 42% at 52% 100%, rgba(124,181,24,0.18), transparent 70%); filter:blur(40px); }
.ppm-grid { display:grid; grid-template-columns:repeat(2, minmax(0,1fr)); gap:16px; }
.ppm-tile { position:relative; border-radius:24px; padding:22px 22px 20px; display:flex; flex-direction:column; min-width:0; background:rgba(255,255,255,0.62); -webkit-backdrop-filter:blur(30px) saturate(1.7); backdrop-filter:blur(30px) saturate(1.7); border:1px solid rgba(255,255,255,0.84); box-shadow:0 1px 0 rgba(255,255,255,0.95) inset, 0 28px 70px rgba(28,18,64,0.12), 0 2px 10px rgba(28,18,64,0.05); }
.ppm-tile::after { content:""; position:absolute; inset:0; border-radius:inherit; pointer-events:none; z-index:0; background:linear-gradient(135deg, rgba(255,255,255,0.55), rgba(255,255,255,0) 40%); }
.ppm-tile > * { position:relative; z-index:1; }
.ppm-tile--hot { background:rgba(26,14,64,0.86); border-color:rgba(255,255,255,0.18); color:#fff; box-shadow:0 1px 0 rgba(255,255,255,0.24) inset, 0 30px 70px rgba(16,6,48,0.38); }
.ppm-tile--hot::after { background:linear-gradient(135deg, rgba(255,255,255,0.16), rgba(255,255,255,0) 42%); }
.ppm-name { display:flex; align-items:center; justify-content:space-between; gap:10px; min-height:28px; font-size:17px; font-weight:600; letter-spacing:-0.01em; color:#1d1d1f; }
.ppm-tile--hot .ppm-name { color:#fff; }
.ppm-pill { font-size:13px; font-weight:700; letter-spacing:0.03em; text-transform:uppercase; padding:4px 9px; border-radius:980px; background:rgba(91,45,142,0.10); color:#5B2D8E; white-space:nowrap; }
.ppm-tile--hot .ppm-pill { background:rgba(255,255,255,0.14); color:#fff; }
.ppm-pill--cur { background:rgba(124,181,24,0.16); color:#3f6508; } .ppm-tile--hot .ppm-pill--cur { background:rgba(124,181,24,0.28); color:#eaffd0; }
.ppm-price { display:flex; align-items:baseline; gap:8px; margin-top:14px; flex-wrap:wrap; min-height:2.5rem; }
.ppm-was { font-size:17px; font-weight:500; color:#6e6e73; text-decoration:line-through; text-decoration-thickness:1.5px; } .ppm-was[hidden] { display:none; }
.ppm-tile--hot .ppm-was { color:rgba(255,255,255,0.74); }
.ppm-amt { font-size:40px; font-weight:600; letter-spacing:-0.045em; line-height:1; color:#1d1d1f; } .ppm-tile--hot .ppm-amt { color:#fff; }
.ppm-amt.long { font-size:32px; line-height:40px; letter-spacing:-0.04em; } .ppm-was.long { font-size:15px; }
.ppm-suf { font-size:14px; color:#6e6e73; font-weight:500; } .ppm-tile--hot .ppm-suf { color:rgba(255,255,255,0.7); }
.ppm-save { margin-top:8px; font-size:14px; color:#5c5c61; min-height:2.6em; line-height:1.3; } .ppm-save b { color:#1d1d1f; font-weight:600; }
.ppm-tile--hot .ppm-save { color:rgba(255,255,255,0.76); } .ppm-tile--hot .ppm-save b { color:#fff; }
.ppm-row { display:flex; align-items:center; justify-content:flex-start; gap:10px; margin-top:14px; }
.ppm-cap { font-size:13px; font-weight:600; letter-spacing:0.02em; text-transform:uppercase; color:#424245; white-space:nowrap; } .ppm-tile--hot .ppm-cap { color:rgba(255,255,255,0.76); }
.ppm-tiers { display:inline-flex; background:rgba(21,17,43,0.06); border-radius:980px; padding:3px; min-height:34px; }
.ppm-tiers button { font:inherit; border:0; background:transparent; color:#5c5c61; font-size:13px; font-weight:500; height:28px; padding:0 10px; border-radius:980px; cursor:pointer; transition:all .25s cubic-bezier(.2,.8,.2,1); }
.ppm-tiers button.on { background:#fff; color:#1d1d1f; font-weight:600; box-shadow:0 2px 8px rgba(28,18,64,0.14); }
.ppm-tile--hot .ppm-tiers { background:rgba(255,255,255,0.12); } .ppm-tile--hot .ppm-tiers button { color:rgba(255,255,255,0.72); } .ppm-tile--hot .ppm-tiers button.on { background:rgba(255,255,255,0.96); color:#1d1d1f; }
.ppm-cta { margin:16px 0 0; height:46px; width:100%; border-radius:980px; font-size:15px; font-weight:600; display:flex; align-items:center; justify-content:center; cursor:pointer; border:0; font-family:inherit; text-decoration:none; }
.ppm-cta--ink { background:#15112b; color:#fff; box-shadow:0 10px 24px rgba(21,17,43,0.22); }
.ppm-cta--white { background:#fff; color:#1d1d1f; box-shadow:0 8px 20px rgba(0,0,0,0.22); }
.ppm-cta--line { background:transparent; color:#1d1d1f; box-shadow:0 0 0 1px rgba(21,17,43,0.18) inset; }
.ppm-cta[disabled], .ppm-cta--cur { background:transparent; color:#86868b; box-shadow:0 0 0 1px rgba(21,17,43,0.12) inset; cursor:default; }
.ppm-tile--hot .ppm-cta[disabled], .ppm-tile--hot .ppm-cta--cur { color:rgba(255,255,255,0.6); box-shadow:0 0 0 1px rgba(255,255,255,0.22) inset; }
.ppm-facts { list-style:none; margin:16px 0 0; padding:0; display:flex; flex-direction:column; gap:8px; }
.ppm-facts li { display:flex; align-items:center; gap:11px; font-size:14px; color:#424245; letter-spacing:-0.005em; line-height:1.4; }
.ppm-facts li svg { width:17px; height:17px; flex:0 0 17px; color:#86868b; }
.ppm-tile--hot .ppm-facts li { color:rgba(255,255,255,0.86); } .ppm-tile--hot .ppm-facts li svg { color:#d7c4f4; }
.ppm-live { font-weight:600; color:#1d1d1f; display:inline-block; } .ppm-tile--hot .ppm-live { color:#fff; }
.ppm-live.bump { animation:ppm-bump .6s cubic-bezier(.2,.8,.2,1); }
@keyframes ppm-bump { 0% { transform:scale(1); } 30% { transform:scale(1.12); color:#5B2D8E; } 100% { transform:scale(1); } }
.ppm-tile--hot .ppm-live.bump { animation-name:ppm-bump-hot; } @keyframes ppm-bump-hot { 0% { transform:scale(1); } 30% { transform:scale(1.12); color:#d7c4f4; } 100% { transform:scale(1); } }
@media (prefers-reduced-motion:reduce) { .ppm-live.bump { animation:none; } }
.ppm-why { margin-top:12px; font-size:13px; line-height:1.4; color:#5c5c61; min-height:1.2em; } .ppm-tile--hot .ppm-why { color:rgba(255,255,255,0.7); }
.ppm-why--offer { color:#5B2D8E; font-weight:600; } .ppm-tile--hot .ppm-why--offer { color:#d7c4f4; }
.ppm-dfy { position:relative; margin-top:16px; border-radius:24px; padding:24px 26px; display:grid; grid-template-columns:minmax(220px,1fr) auto auto; gap:24px; align-items:center; background:rgba(255,255,255,0.62); -webkit-backdrop-filter:blur(30px) saturate(1.7); backdrop-filter:blur(30px) saturate(1.7); border:1px solid rgba(255,255,255,0.84); box-shadow:0 1px 0 rgba(255,255,255,0.95) inset, 0 28px 70px rgba(28,18,64,0.12), 0 2px 10px rgba(28,18,64,0.05); }
.ppm-dfy__kicker { font-size:13px; font-weight:600; color:#5B2D8E; white-space:nowrap; }
.ppm-dfy__title { font-size:22px; font-weight:600; letter-spacing:-0.022em; color:#1d1d1f; margin-top:6px; white-space:nowrap; }
.ppm-dfy__sub { font-size:15px; color:#6e6e73; margin-top:8px; }
.ppm-dfy .ppm-facts { margin:0; gap:9px; }
.ppm-dfy__cta { display:flex; flex-direction:column; align-items:center; gap:10px; }
.ppm-dfy__cta .ppm-cta { width:auto; margin:0; padding:0 26px; gap:8px; }
.ppm-dfy__note { display:inline-flex; align-items:center; gap:6px; font-size:13px; color:#5c5c61; white-space:nowrap; } .ppm-dfy__note svg { width:13px; height:13px; color:#6e6e73; }
.ppm-err { background:#fee2e2; border:1px solid #fecaca; border-radius:12px; padding:10px 14px; font-size:14px; color:#b91c1c; margin:14px 0 0; }
.ppm-box .ppm-seg__opt:focus-visible, .ppm-box .ppm-tiers button:focus-visible, .ppm-box .ppm-cta:focus-visible, .ppm-box .ppm-x:focus-visible, .ppm-box a:focus-visible { outline:2px solid #5B2D8E; outline-offset:2px; }
.ppm-box:focus { outline:none; }
.ppm-foot { margin-top:18px; font-size:13px; color:#5c5c61; text-align:center; } .ppm-foot a { color:#0077B6; text-decoration:none; font-weight:500; }
@media (max-width:1100px) { .ppm-save { min-height:3.9em; } }
@media (max-width:940px) { .ppm-dfy { grid-template-columns:1fr; } .ppm-dfy__cta { align-items:flex-start; } }
@media (max-width:720px) { .ppm-grid { grid-template-columns:1fr; } .ppm-box { padding:20px 16px 18px; border-radius:22px; } .ppm-stage { padding:14px; } .ppm-head__sub { width:100%; } .ppm-dfy { padding:20px 18px; } .ppm-chip small { display:none; } .ppm-seg__opt { padding:0 12px; } .ppm-dfy .ppm-facts li { white-space:normal; } }
/* Change plan, the pricing page's four cards (Ahmed 1 Nov 2026: "ok I like it"). The lv-* rules of styles.css, which this page
   does not load, ported and scoped to the sheet; the confirm and Done For You screens keep the rules above. */
.ppm-box:has(.lv-grid) { max-width:1240px; border-radius:18px; padding:26px 28px 24px; }
.ppm-box .lv { --lv-ink:#15112b; --lv-text:#2b2840; --lv-muted:#6b6880; --lv-line:rgba(21,17,43,.10); --lv-panel:#f6f5f2; --lv-violet:#5B2D8E; --lv-violet2:#7a3fd1; color:var(--lv-text); }
.ppm-box .ppm-you { margin:6px 0 0; color:#5b6075; font-size:14px; line-height:1.45; } .ppm-box .ppm-you b { color:#0f1222; font-weight:600; }
.ppm-box .lv-toggle { display:flex; flex-direction:column; align-items:center; gap:4px; margin:16px 0 14px; }
.ppm-box .lv-track { display:inline-flex; align-items:center; padding:3px; background:#fff; border:1px solid var(--lv-line); border-radius:980px; }
.ppm-box .lv-seg { font-family:inherit; font-size:14px; font-weight:500; line-height:1; color:var(--lv-muted); background:transparent; border:0; border-radius:980px; padding:9px 16px; cursor:pointer; display:inline-flex; align-items:center; gap:8px; white-space:nowrap; }
.ppm-box .lv-seg.active { background:#fff; color:var(--lv-ink); box-shadow:0 0 0 1px var(--lv-line), 0 1px 2px rgba(21,17,43,.08); }
.ppm-box .lv-seg:focus-visible { outline:2px solid var(--lv-violet); outline-offset:2px; }
.ppm-box .lv-chip { display:inline-flex; align-items:center; gap:5px; font-size:14px; font-weight:700; color:var(--lv-violet); }
.ppm-box .lv-chip[hidden] { display:none; } .ppm-box .lv-chip svg { width:14px; height:14px; flex-shrink:0; } .ppm-box .lv-lim { font-weight:500; color:rgba(91,45,142,.72); }
.ppm-box .lv-toggle .ppm-code { justify-content:center; min-height:28px; margin-top:4px; font-size:13px; } .ppm-box .ppm-code[hidden] { display:none; }
.ppm-box .lv-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; align-items:stretch; margin-top:6px; }
.ppm-box .lv-card { background:var(--lv-panel); border:1px solid var(--lv-line); border-radius:16px; display:flex; flex-direction:column; min-width:0; }
.ppm-box .lv-head { position:relative; background:#fff; border-radius:16px; margin:-1px -1px 0; padding:22px; box-shadow:0 0 0 1px var(--lv-line), 0 6px 16px rgba(21,17,43,.06); display:flex; flex-direction:column; }
.ppm-box .lv-name { font-size:20px; line-height:24px; font-weight:600; color:var(--lv-ink); letter-spacing:-.01em; }
.ppm-box .lv-desc { font-size:14px; line-height:1.5; color:var(--lv-text); margin:6px 0 0; min-height:42px; }
.ppm-box .lv-price { margin-top:22px; display:flex; align-items:baseline; gap:8px; white-space:nowrap; }
.ppm-box .lv-price .pp-amt { font-size:40px; font-weight:700; color:var(--lv-ink); letter-spacing:-.02em; line-height:1; }
.ppm-box .lv-price .pp-amt.long { font-size:34px; line-height:40px; }
.ppm-box .lv-price .pp-was { font-size:20px; font-weight:500; color:var(--lv-muted); text-decoration:line-through; text-decoration-thickness:1.5px; } .ppm-box .lv-price .pp-was.long { font-size:18px; }
.ppm-box .lv-per { font-size:13px; line-height:18px; color:var(--lv-muted); margin-top:6px; min-height:18px; }
.ppm-box .lv.lv--yr .lv-per { min-height:36px; }
.ppm-box .lv-sel { position:relative; display:block; margin-top:18px; height:38px; }
.ppm-box .lv-sel select { appearance:none; -webkit-appearance:none; width:100%; height:38px; border:1px solid rgba(21,17,43,.16); border-radius:8px; background:#fff; padding:0 28px 0 11px; font-family:inherit; font-size:14px; font-weight:500; letter-spacing:-.01em; color:var(--lv-ink); text-overflow:ellipsis; cursor:pointer; }
.ppm-box .lv-sel select:focus-visible { outline:2px solid var(--lv-violet); outline-offset:1px; }
.ppm-box .lv-sel .lv-chev { position:absolute; right:9px; top:11px; width:16px; height:16px; color:var(--lv-muted); pointer-events:none; }
.ppm-box .lv-sel--static { display:flex; align-items:center; border:1px dashed rgba(21,17,43,.18); border-radius:8px; padding:0 12px; font-size:14px; font-weight:500; color:var(--lv-ink); }
.ppm-box .lv-btn { display:flex; align-items:center; justify-content:center; width:100%; height:40px; margin-top:12px; border-radius:8px; font-family:inherit; font-size:14px; font-weight:600; cursor:pointer; transition:background .15s; }
.ppm-box .lv-btn:focus-visible { outline:2px solid var(--lv-violet); outline-offset:2px; }
.ppm-box .lv-btn[disabled] { opacity:.5; cursor:default; background:#fff; color:var(--lv-ink); border:1px solid rgba(21,17,43,.18); box-shadow:none; }
.ppm-box .lv-card--unl .lv-btn[disabled] { background:transparent; color:#fff; border-color:rgba(255,255,255,.4); }
.ppm-box .lv-btn--line { border:1px solid rgba(21,17,43,.18); color:var(--lv-ink); background:#fff; } .ppm-box .lv-btn--line:not([disabled]):hover { background:#f6f5f2; }
.ppm-box .lv-btn--primary { border:0; background:linear-gradient(180deg,var(--lv-violet2),var(--lv-violet)); color:#fff; box-shadow:0 1px 0 rgba(255,255,255,.25) inset, 0 1px 2px rgba(21,17,43,.2); } .ppm-box .lv-btn--primary:not([disabled]):hover { background:var(--lv-violet); }
.ppm-box .lv-btn--white { background:#fff; color:var(--lv-ink); border:1px solid #fff; } .ppm-box .lv-btn--white:not([disabled]):hover { background:#f6f5f2; }
.ppm-box .lv-why { font-size:12px; line-height:1.4; color:var(--lv-muted); margin-top:8px; } .ppm-box .lv-why:empty { display:none; }
.ppm-box .lv-facts { list-style:none; margin:0; padding:18px 22px 16px; border-bottom:1px solid var(--lv-line); }
.ppm-box .lv-facts li, .ppm-box .lv-feats li { display:flex; gap:10px; align-items:flex-start; font-size:14px; line-height:1.45; color:var(--lv-text); padding:5px 0; }
.ppm-box .lv-facts svg, .ppm-box .lv-feats svg { flex:0 0 16px; width:16px; height:16px; margin-top:2px; color:var(--lv-muted); }
.ppm-box .lv-feats svg { color:var(--lv-ink); }
.ppm-box .lv-feats { list-style:none; margin:0; padding:14px 22px 22px; }
.ppm-box .lv-feats li.lv-all, .ppm-box .lv-worth { font-weight:600; color:var(--lv-ink); }
.ppm-box .lv .ppm-live { font-weight:inherit; color:inherit; display:inline; }
/* Header, facts and checklist rows line up across the cards (subgrid), so a line under one button never shifts another card. */
@supports (grid-template-rows:subgrid) { .ppm-box .lv-card { display:grid; grid-row:span 3; grid-template-rows:subgrid; row-gap:0; } }
.ppm-box .lv-card--unl .lv-head { background:linear-gradient(160deg,#2a1858,#15112b 70%); box-shadow:0 0 0 1px rgba(255,255,255,.06), 0 14px 34px rgba(21,17,43,.28); }
.ppm-box .lv-card--unl .lv-name, .ppm-box .lv-card--unl .lv-price .pp-amt, .ppm-box .lv-card--unl .lv-sel--static { color:#fff; }
.ppm-box .lv-card--unl .lv-desc, .ppm-box .lv-card--unl .lv-per, .ppm-box .lv-card--unl .lv-price .pp-was, .ppm-box .lv-card--unl .lv-why { color:rgba(255,255,255,.72); }
.ppm-box .lv-card--unl .lv-sel--static { border-color:rgba(255,255,255,.28); } .ppm-box .lv-card--unl .ppm-why--offer { color:#d7c4f4; }
/* The current plan: an outline and a badge in the header's corner, out of the flow, so the four buttons stay on one row. */
.ppm-box .lv-card.is-cur .lv-head { box-shadow:0 0 0 2px #0077B6 inset, 0 6px 16px rgba(21,17,43,.06); }
.ppm-box .lv-cur { position:absolute; top:18px; right:18px; font-size:11px; font-weight:600; letter-spacing:.02em; line-height:16px; color:#0b5c8a; background:#e6f2fa; border:1px solid #cfe6f5; border-radius:999px; padding:2px 8px; }
.ppm-box .lv-note { text-align:center; font-size:13px; color:var(--lv-muted); margin:18px auto 0; line-height:1.5; }
.ppm-box .lv-row { display:flex; align-items:center; justify-content:space-between; gap:20px; margin:16px auto 0; padding:20px 24px; background:#fff; border:1px solid var(--lv-line); border-radius:16px; }
.ppm-box .lv-row__name { font-size:20px; font-weight:700; letter-spacing:-.01em; color:var(--lv-ink); }
.ppm-box .lv-row p { margin:4px 0 0; font-size:14px; color:var(--lv-muted); }
.ppm-box .lv-row .lv-btn { margin:0; padding:0 22px; min-width:150px; width:auto; }
.ppm-box .lv-dfy { display:grid; grid-template-columns:minmax(0,1.1fr) minmax(0,1.4fr) auto; align-items:center; gap:28px; padding:22px 28px; }
.ppm-box .lv-dfy__kicker { font-size:12px; font-weight:600; letter-spacing:.02em; color:#5B2D8E; margin-bottom:4px; }
.ppm-box .lv-dfy__facts { list-style:none; margin:0; padding:0 0 0 28px; border-left:1px solid var(--lv-line); display:grid; grid-template-columns:1fr 1fr; gap:10px 22px; }
.ppm-box .lv-dfy__facts li { display:flex; align-items:center; gap:9px; font-size:14px; color:var(--lv-ink); }
.ppm-box .lv-dfy__facts svg { flex:0 0 16px; width:16px; height:16px; color:var(--lv-muted); }
@media (max-width:1180px) { .ppm-box .lv-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (max-width:900px) { .ppm-box .lv-dfy { grid-template-columns:1fr; gap:16px; } .ppm-box .lv-dfy__facts { border-left:0; padding:0; } .ppm-box .lv-dfy .lv-btn { width:100%; } }
@media (max-width:720px) { .ppm-box:has(.lv-grid) { padding:18px 14px; } .ppm-box .lv-grid { grid-template-columns:minmax(0,1fr); } .ppm-box .lv-desc { min-height:0; } .ppm-box .lv.lv--yr .lv-per { min-height:18px; } .ppm-box .lv-seg { padding:9px 12px; } .ppm-box .lv-lim { display:none; } }
@media (max-width:520px) { .ppm-box .lv-dfy__facts { grid-template-columns:1fr; } }
/* Upgrade now or on the renewal date (Ahmed 2026-10-15): the confirm step inside the same sheet, approved from the local
   preview vault/paidsync/upgrade-schedule-preview-2026-10-15.html. One sentence per line, measured at 375px. */
.ppm-box.ppm-box--narrow { max-width:560px; }
.ppm-back { background:none; border:0; color:#6e6e73; font:inherit; font-size:14px; cursor:pointer; padding:4px 0; }
.ppm-back:hover { color:#1d1d1f; }
.ppm-when .ppm-title { margin-top:10px; }
.ppm-when .ppm-head__sub { margin-top:6px; line-height:1.45; }
.ppm-when .ppm-head__sub span, .ppm-when .ppm-save span { display:block; }
.ppm-when .ppm-save, .ppm-when .ppm-price { min-height:0; }
.ppm-when .ppm-cta.ppm-cta--ink[disabled] { background:#15112b; color:#fff; box-shadow:none; opacity:0.75; cursor:default; }
.ppm-when .ppm-cta.ppm-cta--white[disabled] { background:#fff; color:#1d1d1f; box-shadow:none; opacity:0.75; cursor:default; }
.ppm-when .ppm-why { margin-top:auto; padding-top:12px; }
.ppm-when .ppm-why span { display:block; }
.ppm-when .ppm-err { text-wrap:pretty; }
.ppm-when .ppm-foot { line-height:1.5; }
.ppm-done__rows { margin:20px 0 0; border-top:1px solid #e8e8ed; }
.ppm-done__row { display:flex; justify-content:space-between; gap:16px; padding:13px 0; border-bottom:1px solid #e8e8ed; font-size:15px; color:#5c5c61; }
.ppm-done__row b { color:#1d1d1f; font-weight:600; text-align:right; }
.ppm-done__acts { display:flex; align-items:center; gap:18px; margin-top:22px; }
.ppm-done__acts .ppm-cta { width:auto; margin:0; padding:0 28px; }
.ppm-done__link { background:none; border:0; font:inherit; font-size:14px; color:#0077B6; font-weight:500; cursor:pointer; padding:0; }
@media (max-width:720px) { .ppm-when .ppm-foot span { display:block; } .ppm-done__acts { flex-direction:column; align-items:stretch; } .ppm-done__acts .ppm-cta { width:100%; } .ppm-done__link { min-height:44px; } .ppm-back { min-height:44px; margin:-10px 0; } }
/* Why a disabled action is disabled, in text. A title tooltip does not exist on touch,
   so today's stuck customers get a dead grey button and no reason at all on a phone. */
.card-row__why { font-size: 11.5px; color: var(--text-muted); margin-top: 6px; }
/* Two classes, deliberately: .card-row__badge is defined later in this sheet, so a
   single-class modifier loses the tie and the secondary badge paints accent like Primary. */
.card-row__badge.card-row__badge--backup { color: var(--text-muted); background: var(--surface-2); font-weight: 500; }
/* A row carrying a why-line is taller; its actions belong beside the card name, not floating
   at the vertical middle of the explanation. */
.card-row.card-row--why { align-items: flex-start; }
.card-row.card-row--why .card-row__acts { margin-top: 1px; }
/* Backup-card ask. Plain text "Recommended", no pill: one accent, typographic. */
.backup-rec { font-size: 11px; font-weight: 600; color: var(--accent); margin-left: 6px; }
.backup-nudge { display: flex; align-items: center; gap: 14px; margin-top: 14px; padding: 14px 16px; border: 1px solid var(--hairline); border-radius: 10px; background: var(--surface-2); }
.backup-nudge__main { flex: 1; min-width: 0; }
.backup-nudge__title { font-size: 13px; font-weight: 600; color: var(--text); }
.backup-nudge__sub { font-size: 12.5px; color: var(--text-soft); line-height: 1.55; margin-top: 3px; }
@media (max-width: 560px) {
  .backup-nudge, .settings-row.settings-row--stack-sm { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 560px) {
  .card-row { flex-wrap: wrap; }
  .card-row__acts { width: 100%; justify-content: flex-start; margin-top: 6px; }
}
/* Card list in Payment method tab */
.card-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--hairline); }
.card-row:last-child { border-bottom: 0; }
.card-row__info { flex: 1; min-width: 0; }
.card-row__name { font-size: 13px; font-weight: 500; color: var(--text); }
.card-row__exp { font-size: 11.5px; color: var(--text-muted); margin-top: 1px; }
.card-row__badge { font-size: 10.5px; font-weight: 600; color: var(--accent); background: var(--accent-soft); border-radius: 4px; padding: 2px 6px; white-space: nowrap; }
.card-row__acts { display: flex; gap: 6px; flex-shrink: 0; }
.card-row__act { font-size: 11.5px; padding: 4px 10px; border-radius: 6px; border: 1px solid var(--hairline); background: var(--surface-2); color: var(--text); cursor: pointer; white-space: nowrap; }
.card-row__act:hover { background: var(--surface-2); }
.card-row__act--danger { color: var(--bad); border-color: transparent; background: transparent; }
.card-row__act--danger:hover { background: rgba(255,59,48,0.07); }
.card-row__act:disabled { opacity: 0.4; cursor: not-allowed; }
/* Billing details form */
.settings-field { margin-bottom: 12px; }
.settings-field label { display: block; font-size: 11.5px; font-weight: 500; color: var(--text-muted); margin-bottom: 4px; }
.settings-field input, .settings-field select {
  width: 100%; padding: 7px 10px; font-size: 13px; border: 1px solid var(--hairline);
  border-radius: 8px; background: var(--surface-2); color: var(--text);
  box-sizing: border-box; outline: none;
}
.settings-field input:focus, .settings-field select:focus { border-color: var(--accent); }
/* Country combobox */
.country-combo { position: relative; }
.country-list {
  display: none; position: absolute; top: 100%; left: 0; right: 0; z-index: 50;
  background: var(--surface); border: 1px solid var(--hairline); border-radius: 8px;
  max-height: 220px; overflow-y: auto; box-shadow: var(--shadow-md); margin-top: 2px;
}
.country-list.is-open { display: block; }
.country-list__item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 7px 10px; font-size: 13px; cursor: pointer;
}
.country-list__item:hover, .country-list__item.is-active { background: var(--surface-2); }
.country-list__item-code { font-size: 11px; color: var(--text-muted); }
.country-list__empty { padding: 8px 10px; font-size: 12px; color: var(--text-muted); }
/* ACM (add-credit modal) */
.acm-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.4);
  z-index: 104; backdrop-filter: blur(2px);
}
.acm-amounts {
  display: grid; grid-template-columns: repeat(4,1fr); gap: 8px;
}
.acm-amount {
  padding: 10px 0; font: inherit; font-size: 14px; font-weight: 700;
  border: 2px solid var(--hairline); background: var(--surface-2);
  color: var(--text); border-radius: 10px; cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease;
}
.acm-amount:hover { border-color: var(--text-dim); background: var(--surface-3); }
.acm-amount--selected { border-color: var(--accent,#3b82f6); background: var(--accent-bg,#eff6ff); color: var(--accent,#3b82f6); }
html.dark .acm-amount--selected { background: rgba(167,139,250,.14); color: #c4b5fd; border-color: #a78bfa; }
.acm-amount--custom { font-size: 12px; font-weight: 600; }
.acm-card-row {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text-soft);
  background: var(--surface-2); border: 1px solid var(--hairline);
  border-radius: 9px; padding: 10px 12px;
}
@media (max-width: 460px) {
  .acm-amounts { grid-template-columns: repeat(2,1fr); }
  #acmStripeCard { font-size: 13px; padding: 10px 11px; }
}
/* MCM (manage-card modal) */
.mcm-card-display {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: var(--text-soft);
  background: var(--surface-2); border: 1px solid var(--hairline);
  border-radius: 9px; padding: 10px 12px; margin-bottom: 14px;
}
.mcm-card-display svg { flex-shrink: 0; }
.mcm-card-display__info { flex: 1; font-weight: 500; color: var(--text); }
.mcm-card-display__exp { font-size: 11.5px; color: var(--text-muted); }
.mcm-new-card-wrap { margin-bottom: 14px; }
.mcm-new-card-wrap__label { font-size: 12px; color: var(--text-soft); margin-bottom: 8px; }
.mcm-stripe-field {
  background: var(--surface-2); border: 1px solid var(--hairline);
  border-radius: 10px; padding: 11px 13px; font-size: 14px; min-height: 40px;
}
.mcm-remove-link {
  display: block; text-align: center; margin-top: 10px;
  font-size: 12px; color: var(--bad,#ef4444); cursor: pointer;
  text-decoration: none; background: none; border: none; font: inherit; width: 100%;
}
.mcm-remove-link:hover { text-decoration: underline; }
/* FREE PLAN BANNER */
.free-banner {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  background: var(--gradient);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.005em;
  flex-shrink: 0;
}
.free-banner.is-visible { display: flex; }
.free-banner__brand { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.free-banner__logo { height: 20px; width: auto; filter: brightness(0) invert(1); flex-shrink: 0; }
.free-banner__divider { color: rgba(255,255,255,0.45); font-weight: 400; flex-shrink: 0; }
.free-banner__cta {
  background: #fff;
  color: var(--accent);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  border: 0;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: transform 120ms ease;
}
.free-banner__cta:hover { transform: scale(1.03); }
@media (max-width: 480px) {
  .free-banner { padding: 8px 14px; font-size: 12px; flex-wrap: wrap; gap: 6px; }
  .free-banner__cta { padding: 5px 10px; font-size: 11.5px; }
  .free-banner__brand { gap: 8px; }
  .free-banner__logo { height: 18px; }
}

/* ============ CONV HOVER ACTIONS (Claude style) ============ */
.conv {
  position: relative;
  padding-right: 32px;
}
.conv__title {
  position: relative;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  mask-image: linear-gradient(to right, #000 calc(100% - 12px), transparent 100%);
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 12px), transparent 100%);
}
.conv__more {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px; height: 22px;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 5px;
  display: grid;
  place-items: center;
  opacity: 0;
  transition: opacity 120ms ease, background 120ms ease;
}
.conv:hover .conv__more, .conv.is-menu-open .conv__more { opacity: 1; }
.conv__more:hover { background: var(--surface-3); color: var(--text); }
.conv__more svg { width: 13px; }
.conv__star {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--warn);
  display: none;
  pointer-events: none;
}
.conv.is-starred .conv__star { display: block; }
.conv.is-starred:hover .conv__star, .conv.is-starred.is-menu-open .conv__star { display: none; }
.conv__star svg { width: 11px; }

.conv__menu {
  position: absolute;
  right: 4px;
  top: calc(100% + 2px);
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  padding: 4px;
  box-shadow: var(--shadow-md);
  z-index: 60;
  min-width: 160px;
  display: none;
}
.conv.is-menu-open .conv__menu { display: block; }
.conv__menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 11px;
  font-size: 12.5px;
  background: transparent;
  border: 0;
  cursor: pointer;
  color: var(--text);
  width: 100%;
  text-align: left;
  border-radius: 7px;
  font: inherit;
}
.conv__menu-item:hover { background: var(--surface-2); }
.conv__menu-item--danger { color: var(--bad); }
.conv__menu-item--danger:hover { background: var(--bad-bg); }
.conv__menu-item svg { width: 13px; opacity: 0.8; }

.convs-show-all {
  width: 100%;
  text-align: left;
  font: inherit;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 9px 11px;
  border-radius: 7px;
  display: none;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}
.convs.is-overflowing + .convs-show-all { display: flex; }
.app.is-collapsed .convs-show-all { display: none !important; }
.convs-show-all:hover { background: var(--surface-2); color: var(--text); }
.convs-show-all svg { width: 12px; }

/* ============ ALL CHATS PAGE ============ */
.allchats-page {
  display: none;
  flex: 1;
  flex-direction: column;
  background: var(--canvas);
  min-height: 0;
  overflow: hidden;
}
.app.is-allchats-page .allchats-page { display: flex; }
.app.is-allchats-page .scroll,
.app.is-allchats-page .chats-page,
.app.is-allchats-page .mcp-page,
.app.is-allchats-page .brands-page,
.app.is-allchats-page .settings-page { display: none; }
.allchats-body {
  flex: 1;
  overflow-y: auto;
  padding: 32px;
}
.allchats-inner { max-width: 880px; margin: 0 auto; }
.allchats-search {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 18px;
}
.allchats-search svg { width: 15px; color: var(--text-muted); }
.allchats-search input { flex: 1; font: inherit; font-size: 14px; border: 0; outline: 0; background: transparent; color: var(--text); }
.allchats-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.allchats-title { font-size: 26px; font-weight: 800; letter-spacing: -0.025em; }
.allchats-actions { display: flex; align-items: center; gap: 8px; }
.ct-btn {
  display: inline-flex; align-items: center; gap: 5px;
  font: inherit; font-size: 12.5px; font-weight: 600; color: var(--text);
  background: var(--surface); border: 1px solid var(--hairline); border-radius: 999px;
  padding: 7px 14px; cursor: pointer; transition: background 120ms ease, border-color 120ms ease;
}
.ct-btn:hover { background: var(--surface-2); border-color: var(--text-dim); }
.ct-btn strong { font-weight: 700; }
.ct-btn svg { width: 12px; }
.ct-btn--primary { background: var(--text); color: var(--canvas); border-color: var(--text); }
.ct-btn--primary:hover { background: var(--text); opacity: 0.88; }
.ct-btn--danger { color: var(--bad); border-color: rgba(220,38,38,0.35); }
.ct-btn--danger:hover { background: rgba(220,38,38,0.06); border-color: var(--bad); }
.allchats-bulkbar { display: flex; align-items: center; gap: 10px; padding: 8px 4px 14px; font-size: 12.5px; color: var(--text-soft); }
.allchats-bulkbar span { margin-right: auto; font-weight: 600; }
.allchats-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 10px;
  cursor: pointer;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--hairline);
  width: 100%;
  text-align: left;
  font: inherit;
  color: var(--text);
  position: relative;
}
.allchats-item:hover { background: var(--surface); }
.allchats-item--task.is-dim { opacity: 0.4; cursor: default; }
.allchats-item.is-checked { background: var(--surface-2); }
.allchats-item__icon {
  width: 26px; height: 26px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  color: var(--text-muted);
  flex-shrink: 0;
}
.allchats-item__icon svg { width: 15px; }
.allchats-item__check {
  width: 20px; height: 20px; border-radius: 50%;
  border: 1.5px solid var(--text-dim); color: transparent;
  display: grid; place-items: center; flex-shrink: 0; margin: 3px;
}
.allchats-item__check.is-on { background: var(--accent); border-color: var(--accent); color: #fff; }
.allchats-item__check svg { width: 11px; }
.allchats-item__title { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.allchats-item__kind { font-size: 10px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-muted); background: var(--surface-2); border: 1px solid var(--hairline); border-radius: 999px; padding: 2px 8px; flex-shrink: 0; }
.allchats-item__time { font-size: 12px; color: var(--text-muted); white-space: nowrap; flex-shrink: 0; transition: opacity 120ms ease; }
.allchats-item__star { color: var(--warn); flex-shrink: 0; }
.allchats-item__star svg { width: 13px; }
.allchats-item__more {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  width: 28px; height: 28px; border: 0; background: transparent; color: var(--text-muted);
  cursor: pointer; border-radius: 7px; display: grid; place-items: center;
  opacity: 0; transition: opacity 120ms ease, background 120ms ease;
}
.allchats-item:hover .allchats-item__time { opacity: 0; }
.allchats-item:hover .allchats-item__more, .allchats-item.is-menu-open .allchats-item__more { opacity: 1; }
.allchats-item__more:hover { background: var(--surface-3); color: var(--text); }
.allchats-item__more svg { width: 15px; }
.allchats-item .conv__menu { right: 10px; }
.allchats-item.is-menu-open .conv__menu { display: block; }
.allchats-item.is-menu-open { background: var(--surface); border-color: var(--hairline); }

/* ============ SEARCH OVERLAY (command palette) ============ */
.search-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 110;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 100px;
}
.search-overlay.is-open { display: flex; }
.search-modal {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 14px;
  width: 620px;
  max-width: calc(100vw - 32px);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.search-modal__input-wrap {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--hairline);
}
.search-modal__input-wrap svg { width: 16px; color: var(--text-muted); }
.search-modal__input {
  flex: 1;
  font: inherit;
  font-size: 15px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}
.search-modal__input::placeholder { color: var(--text-muted); }
.search-modal__kbd {
  font-size: 10.5px;
  background: var(--surface-2);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--text-muted);
}
.search-modal__results { padding: 6px; max-height: 400px; overflow-y: auto; }
.search-result-group { font-size: 10.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); padding: 10px 12px 4px; }
.search-result {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  background: transparent;
  border: 0;
  width: 100%;
  text-align: left;
  font: inherit;
  color: var(--text);
}
.search-result:hover, .search-result.is-active { background: var(--surface-2); }
.search-result__icon {
  width: 24px; height: 24px;
  border-radius: 6px;
  background: var(--surface-2);
  display: grid;
  place-items: center;
  color: var(--text-soft);
  flex-shrink: 0;
}
.search-result__icon svg { width: 12px; }
.search-result__main { flex: 1; min-width: 0; }
.search-result__title { font-size: 13px; font-weight: 500; }
.search-result__sub { font-size: 11px; color: var(--text-muted); margin-top: 1px; }

/* ============ BRANDS PAGE ============ */
.brands-page {
  display: none;
  flex: 1;
  flex-direction: column;
  background: var(--canvas);
  min-height: 0;
  overflow: hidden;
}
.app.is-brands-page .brands-page { display: flex; }
.app.is-brands-page .scroll,
.app.is-brands-page .chats-page,
.app.is-brands-page .mcp-page { display: none; }

/* ============ TEAM MEMBERS PAGE (owner-only, team plan) ============ */
.members-page { display: none; flex: 1; flex-direction: column; background: var(--canvas); min-height: 0; overflow: hidden; }
.app.is-members-page .members-page { display: flex; }
.app.is-members-page .scroll,
.app.is-members-page .chats-page,
.app.is-members-page .mcp-page,
.app.is-members-page .brands-page,
.app.is-members-page .automations-page,
.app.is-members-page .settings-page,
.app.is-members-page .allchats-page { display: none; }
.mp-body { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 28px 24px 60px; }
.mp-inner { max-width: 1000px; margin: 0 auto; min-width: 0; }
.mp-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.mp-head__title { font-size: 21px; font-weight: 700; letter-spacing: -0.02em; }
.mp-head__sub { font-size: 13px; color: var(--text-muted); margin-top: 4px; max-width: 540px; line-height: 1.5; }
.mp-invite-btn { font: inherit; font-size: 13px; font-weight: 600; height: 38px; padding: 0 18px; border-radius: 999px; border: 0; background: var(--text); color: var(--canvas); cursor: pointer; display: inline-flex; align-items: center; gap: 7px; transition: transform 120ms, box-shadow 120ms; white-space: nowrap; flex-shrink: 0; }
.mp-invite-btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.mp-invite-btn svg { width: 13px; height: 13px; }
.mp-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 24px; }
.mp-stat { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius-card); padding: 18px; box-shadow: var(--shadow-sm); }
.mp-stat__label { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); }
.mp-stat__value { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; margin-top: 8px; line-height: 1.1; }
.mp-stat__value small { font-size: 14px; font-weight: 500; color: var(--text-muted); }
.mp-stat__sub { font-size: 12px; color: var(--text-muted); margin-top: 6px; }
.mp-stat__bar { height: 6px; background: var(--surface-3); border-radius: 999px; margin-top: 12px; overflow: hidden; }
.mp-stat__bar-fill { height: 100%; background: var(--gradient); border-radius: 999px; }
.mp-panel { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius-card); box-shadow: var(--shadow-sm); overflow: hidden; container-type: inline-size; }
.mp-panel__head { padding: 16px 20px; border-bottom: 1px solid var(--hairline-soft); }
.mp-panel__title { font-size: 14.5px; font-weight: 700; }
.mp-panel__sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.mp-row { display: flex; align-items: center; gap: 14px; padding: 14px 20px; border-bottom: 1px solid var(--hairline-soft); }
.mp-row:last-child { border-bottom: 0; }
.mp-row__avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--gradient-flat); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 14px; flex-shrink: 0; }
.mp-row__avatar--photo { background: var(--surface-2, #eef1f6); padding: 0; overflow: hidden; }
.mp-row__avatar--photo img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 50%; }
.mp-row__info { flex: 1; min-width: 0; }
.mp-row__name { font-size: 13.5px; font-weight: 600; }
.mp-row__email { font-size: 12.5px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mp-role { font-size: 11.5px; font-weight: 600; padding: 4px 11px; border-radius: 999px; background: var(--surface-2); color: var(--text-soft); flex-shrink: 0; }
.mp-role--owner { background: var(--accent-soft); color: var(--accent); }
.mp-remove { font: inherit; font-size: 12.5px; font-weight: 600; color: var(--bad); background: transparent; border: 0; cursor: pointer; padding: 6px 8px; border-radius: 8px; flex-shrink: 0; }
.mp-remove:hover { background: var(--bad-soft); }
.mp-cap { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; padding: 5px 11px; border-radius: 999px; background: transparent; border: 1px dashed var(--hairline-strong); color: var(--text-muted); cursor: pointer; transition: all 0.15s; font-family: inherit; flex-shrink: 0; }
.mp-cap:hover { border-color: var(--text-dim); color: var(--text-soft); background: var(--surface-2); }
.mp-cap--set { border-style: solid; border-color: transparent; background: var(--accent-soft); color: var(--accent); }
.mp-cap svg { width: 11px; height: 11px; }
/* Usage at or past the member's cap: same chip, the existing warning tokens. */
.mp-cap--limit { background: var(--warn-soft); color: var(--warn-strong); }
html.dark .mp-cap--set { color: var(--text-soft); }
html.dark .mp-cap--limit { color: var(--warn-strong); }
.mp-cap-edit { display: inline-flex; align-items: center; gap: 6px; background: var(--surface); border: 1px solid var(--hairline-strong); border-radius: 10px; padding: 4px 4px 4px 10px; box-shadow: var(--shadow-md); flex-shrink: 0; }
.mp-cap-edit span { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.mp-cap-edit input { width: 62px; border: 1px solid var(--hairline-strong); border-radius: 6px; padding: 5px 6px; font: inherit; font-size: 12.5px; text-align: right; background: var(--surface); color: var(--text); }
.mp-cap-edit__save { border: 0; background: var(--text); color: var(--canvas); font: inherit; font-size: 12px; font-weight: 600; padding: 6px 11px; border-radius: 6px; cursor: pointer; }
.mp-cap-edit__ghost { border: 0; background: transparent; color: var(--text-muted); font: inherit; font-size: 12px; padding: 6px 6px; border-radius: 6px; cursor: pointer; }
.mp-cap-edit__ghost:hover { color: var(--text); }
/* Roles v2 access + brand scope. Same quiet pill language as the cap control:
   dashed border when unset, solid tint when set, typographic only, no dots. */
.mp-acc { display: inline-flex; align-items: center; font-size: 11.5px; font-weight: 600; padding: 5px 11px; border-radius: 999px; background: var(--surface-2); color: var(--text-soft); cursor: pointer; border: 1px solid transparent; transition: all 0.15s; font-family: inherit; flex-shrink: 0; }
.mp-acc:hover { border-color: var(--hairline-strong); color: var(--text); }
.mp-acc--viewer { background: transparent; border: 1px dashed var(--hairline-strong); color: var(--text-muted); }
.mp-acc--admin { background: var(--accent-soft); color: var(--accent); }
.mp-scope { display: inline-flex; align-items: center; font-size: 11.5px; font-weight: 500; padding: 5px 11px; border-radius: 999px; background: transparent; border: 1px dashed var(--hairline-strong); color: var(--text-muted); cursor: pointer; transition: all 0.15s; font-family: inherit; flex-shrink: 0; }
.mp-scope:hover { border-color: var(--text-dim); color: var(--text-soft); background: var(--surface-2); }
.mp-scope--set { border-style: solid; border-color: transparent; background: var(--surface-2); color: var(--text-soft); }
.mp-acc-edit { display: flex; flex-direction: column; gap: 10px; background: var(--surface); border: 1px solid var(--hairline-strong); border-radius: 12px; padding: 12px; box-shadow: var(--shadow-md); min-width: 280px; }
.mp-acc-edit > .mp-acc-edit__row { flex-direction: column; }
.mp-acc-edit__row { display: flex; gap: 6px; flex-wrap: wrap; }
.mp-acc-opt { flex: 1; min-width: 72px; text-align: left; border: 1px solid var(--hairline-strong); background: var(--surface); border-radius: 8px; padding: 7px 9px; cursor: pointer; font: inherit; color: var(--text-soft); }
.mp-acc-opt strong { display: block; font-size: 12.5px; font-weight: 600; color: var(--text); }
.mp-acc-opt small { display: block; font-size: 10.5px; color: var(--text-muted); line-height: 1.35; margin-top: 2px; }
.mp-acc-opt--on { border-color: var(--accent); background: var(--accent-soft); }
.mp-acc-brands { max-height: 168px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; border-top: 1px solid var(--hairline); padding-top: 9px; }
.mp-acc-brands label { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-soft); padding: 4px 2px; cursor: pointer; }
.mp-acc-edit__act { display: flex; gap: 6px; justify-content: flex-end; }
/* Each scope option explains itself behind a mark, so the three options stay
   three readable lines instead of one carrying a permanent footnote. */
.mp-help { flex: 0 0 auto; width: 15px; height: 15px; margin-left: 2px; padding: 0; border-radius: 50%; border: 1px solid var(--hairline-strong); background: transparent; color: var(--text-dim); font: inherit; font-size: 10px; font-weight: 700; line-height: 1; display: inline-flex; align-items: center; justify-content: center; cursor: help; transition: color 0.15s, border-color 0.15s; }
.mp-help:hover, .mp-help:focus-visible { color: var(--accent); border-color: var(--accent); outline: none; }
/* position:fixed because .mp-acc-brands is overflow-y:auto and would clip an
   absolutely positioned bubble. Placed by mpShowHelp. */
.mp-tip { position: fixed; z-index: 9999; max-width: 260px; background: var(--text); color: var(--surface); font-size: 11.5px; line-height: 1.45; padding: 8px 10px; border-radius: 8px; box-shadow: var(--shadow-md); opacity: 0; visibility: hidden; transition: opacity 0.12s; pointer-events: none; }
.mp-tip.is-on { opacity: 1; visibility: visible; }
.mp-inv__meta { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
/* Invite form. Replaces the single-line prompt now that an invite carries an
   access level and a brand scope, which a text prompt cannot express. */
.mp-invform { display: flex; flex-direction: column; gap: 12px; background: var(--surface); border: 1px solid var(--hairline-strong); border-radius: 12px; padding: 14px; margin-bottom: 12px; }
.mp-invform input[type=email] { width: 100%; border: 1px solid var(--hairline-strong); border-radius: 8px; padding: 9px 11px; font: inherit; font-size: 13.5px; background: var(--surface); color: var(--text); }
.mp-invform__lbl { font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-muted); }
/* Measured at 1024 and 768 (settings column beside the app nav): a member row's
   pills need ~480px on one line, so a members panel narrower than 720px squeezed
   the name and email to zero and pushed Remove past the panel edge. There the
   row keeps name, email and Remove on its first line (Remove stays top right, as
   on desktop) and the pills take the line under it. The info basis reserves 90px
   for Remove, so no pill can squeeze back onto the first line beside it. Placed
   after the .mp-row rules so it wins; phones keep their own layout below. */
@media (min-width: 561px) {
  @container (max-width: 719px) {
    .mp-row { flex-wrap: wrap; row-gap: 8px; }
    .mp-row > * { order: 2; }
    .mp-row > .mp-row__avatar, .mp-row > .mp-row__info, .mp-row > .mp-remove { order: 0; }
    .mp-row__info { flex: 1 1 calc(100% - 142px); }
    /* Tablets held upright give the panel ~300px: the open editor must wrap here too. */
    .mp-cap-edit { flex-wrap: wrap; max-width: 100%; }
  }
}
@media (max-width: 560px) {
  .mp-acc-edit { min-width: 0; width: 100%; }
  .mp-acc-edit__row { flex-direction: column; }
  /* Measured at 375px: the row's pills overflowed by ~140px once scope and
     access joined cap and Remove. Wrap instead of clipping them off-screen. */
  .mp-row, .mp-inv { flex-wrap: wrap; row-gap: 8px; }
  .mp-row__info, .mp-inv__info { flex: 1 1 100%; min-width: 0; order: 1; }
  .mp-row__avatar, .mp-inv__ic { order: 0; }
  .mp-row .mp-scope, .mp-row .mp-acc, .mp-row .mp-cap, .mp-row .mp-cap-edit, .mp-row .mp-role, .mp-row .mp-remove, .mp-inv__act { order: 2; }
  .mp-row__email, .mp-inv__email { overflow-wrap: anywhere; }
  /* The open cap editor is ~326px, wider than a phone row: it sat above the
     name and its Cancel was clipped by the panel. Keep it with the pills. */
  .mp-cap-edit { flex-wrap: wrap; max-width: 100%; }
}
.mp-inv { display: flex; align-items: center; gap: 14px; padding: 14px 20px; background: var(--warn-soft); border-bottom: 1px solid var(--hairline-soft); }
.mp-inv:last-child { border-bottom: 0; }
.mp-inv__ic { width: 38px; height: 38px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--hairline); color: var(--warn); display: grid; place-items: center; flex-shrink: 0; }
.mp-inv__info { flex: 1; min-width: 0; }
.mp-inv__email { font-size: 13.5px; font-weight: 500; color: var(--text-soft); }
.mp-inv__status { font-size: 12px; color: var(--warn); margin-top: 2px; }
.mp-inv__act { font: inherit; font-size: 12.5px; font-weight: 500; color: var(--text-soft); background: transparent; border: 0; cursor: pointer; padding: 6px 10px; border-radius: 8px; flex-shrink: 0; }
.mp-inv__act:hover { background: var(--surface-2); }
.mp-note { display: flex; gap: 12px; align-items: flex-start; background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius-card); padding: 16px 18px; margin-top: 16px; box-shadow: var(--shadow-sm); }
.mp-note__ic { width: 30px; height: 30px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--hairline); color: var(--blue); display: grid; place-items: center; flex-shrink: 0; }
.mp-note__tx { font-size: 12.5px; color: var(--text-soft); line-height: 1.55; }
.mp-note__tx strong { color: var(--text); font-weight: 600; }
.mp-empty { padding: 40px 20px; text-align: center; color: var(--text-muted); font-size: 13px; }
@media (max-width: 700px) { .mp-stats { grid-template-columns: 1fr; } }

.brands-page__head {
  padding: 32px 0 0;
}
.brands-page__title {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}
.brands-page__count {
  font-size: 12.5px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.brands-page__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  gap: 12px;
}
.brands-page__search {
  flex: 1;
  max-width: 360px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 9px;
  padding: 8px 12px;
}
.brands-page__search svg { width: 14px; color: var(--text-muted); }
.brands-page__search input {
  font: inherit;
  font-size: 13px;
  border: 0;
  outline: 0;
  flex: 1;
  background: transparent;
  color: var(--text);
}
.page-new-btn {
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  height: 38px;
  padding: 0 18px;
  border-radius: 999px;
  border: 0;
  background: var(--text);
  color: var(--canvas);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: transform 120ms, box-shadow 120ms;
}
.page-new-btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.page-new-btn svg { width: 13px; }

.brands-page__body {
  flex: 1;
  overflow-y: auto;
  padding: 0 32px 60px;
}
.brands-page__inner {
  max-width: 1100px;
  margin: 0 auto;
}
.brands-page__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

/* All brand tiles share dimensions so the grid reads as a uniform card set. */
/* padding-bottom: 44px = 10px gap + 28px icon + 6px breathing room above the delete button. */
.brands-page__grid > .brand-tile { min-height: 176px; display: flex; flex-direction: column; padding-bottom: 16px; }
/* KPI shimmer skeleton shown while the warehouse summary loads */
.brand-tile__kpis .btk-skel { display: flex; flex-direction: column; gap: 7px; flex: 1; }
.brand-tile__kpis .btk-skel .sk-val { width: 56px; height: 14px; border-radius: 6px; }
.brand-tile__kpis .btk-skel .sk-lbl { width: 70px; height: 8px; border-radius: 4px; }
.brand-tile__kpis .btk-skel .sk-val, .brand-tile__kpis .btk-skel .sk-lbl {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: psShimmer 1.4s linear infinite;
}
@keyframes psShimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.brand-tile__spacer { flex: 1; min-height: 12px; }
.brand-tile__kpis { display: flex; gap: 14px; align-items: flex-end; padding-top: 12px; border-top: 1px solid var(--hairline); }
.brand-tile__kpis .btk { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.brand-tile__kpis .btk__v { font-size: 16px; font-weight: 700; letter-spacing: -0.02em; color: var(--text); line-height: 1.1; }
.brand-tile__kpis .btk__l { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-tile__kpis-empty { font-size: 11.5px; color: var(--text-muted); padding-top: 12px; border-top: 1px solid var(--hairline); }
.brand-tile__delete {
  position: absolute;
  bottom: 10px; right: 10px;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--hairline);
  color: var(--text-soft);
  cursor: pointer;
  display: grid; place-items: center;
  opacity: 0;
  transition: opacity 140ms ease, background 140ms ease, border-color 140ms ease, color 140ms ease, transform 120ms ease, box-shadow 120ms ease;
  z-index: 2;
}
.brand-tile__delete:focus-visible { opacity: 1; }
.brand-tile:hover .brand-tile__delete { opacity: 1; }
.brand-tile__delete:hover { background: rgba(220,38,38,0.08); border-color: rgba(220,38,38,0.24); color: #dc2626; transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.brand-tile__delete svg { width: 14px; }
.brand-tile--add {
  border-style: dashed;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.brand-tile--add:hover { border-color: var(--text-dim); background: var(--surface-3); }
.brand-tile__add-inner { text-align: center; color: var(--text-soft); }
.brand-tile__add-icon {
  width: 42px; height: 42px;
  border-radius: 11px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  display: grid; place-items: center;
  margin: 0 auto 12px;
  color: var(--text-muted);
}
.brand-tile__add-title { font-size: 13px; font-weight: 600; color: var(--text); letter-spacing: -0.005em; }

.brand-tile {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 14px;
  padding: 15px 16px;
  cursor: pointer;
  transition: all 160ms ease;
  position: relative;
  overflow: hidden;
}
.brand-tile:hover { border-color: var(--text-dim); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.brand-tile.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), var(--shadow-sm);
}
.brand-tile.is-active::before {
  content: 'Active';
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--gradient);
  color: #fff;
  padding: 3px 8px;
  border-radius: 999px;
}
.brand-tile__head {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 14px;
}
.brand-tile__avatar {
  width: 40px; height: 40px;
  border-radius: 11px;
  background: var(--gradient);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.02em;
  flex-shrink: 0;
  overflow: hidden;
}
.brand-tile__avatar img { width: 100%; height: 100%; object-fit: cover; }
.brand-tile__name {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.2;
}
.brand-tile__meta {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 2px;
}
/* Workspace sharing: quiet muted "Shared" text label next to a brand name. No dot, no pill. */
.brand-shared-tag {
  font-size: 10.5px;
  font-weight: 500;
  color: var(--text-muted);
  margin-left: 7px;
  letter-spacing: 0.02em;
  vertical-align: 1px;
}
/* Roles v2 (2026-08-18): ONE switch for every write affordance on a brand the
   member may only read. The brands API already returns caps.canAct and
   caps.canManageBrand per brand; psApplyAccessGate() puts them on <body> and
   these two rules do the rest. Before this, nothing read canAct at all, so a
   viewer saw every button and only learned their role from a red error toast.
   Hidden, not disabled: a greyed-out button still reads as a broken app, and
   the "View only" label in the topbar already says why it is gone. */
body.ps-view-only [data-ps-act] { display: none !important; }
body.ps-brand-locked [data-ps-brand-admin] { display: none !important; }
/* Same two markers with a "-view" suffix mean LOCKED rather than hidden, for a
   control that CARRIES a fact about the brand (is auto-execution armed? is this
   skill on?). A member with the brand in scope may read everything about it, and
   hiding the switch takes the fact away along with the button. Same treatment
   the guardrail number fields already get (rendered `disabled`), so a panel
   reads as one state instead of half-missing. */
body.ps-view-only [data-ps-act-view],
body.ps-brand-locked [data-ps-brand-admin-view] { pointer-events: none; opacity: 0.55; }
/* Same quiet pill language as .vm-toggle so the topbar row stays one system.
   No dot, no colour: this is a statement of fact, not a warning. */
.ps-viewonly-tag {
  display: none;
  align-items: center;
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: transparent;
  border: 1px solid var(--hairline);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: default;
}
body.ps-view-only .ps-viewonly-tag { display: inline-flex; }
/* ============ DEDICATED CHATS PAGE ============ */
.chats-page {
  display: none;
  flex: 1;
  flex-direction: column;
  background: var(--canvas);
  min-height: 0;
  overflow: hidden;
}
.app.is-chat-page .chats-page { display: flex; }
.app.is-chat-page .scroll { display: none; }
.app.is-chat-page .topbar { display: flex; }

.chatpg__head {
  height: 56px;
  border-bottom: 1px solid var(--hairline);
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
}
.chatpg__title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
  flex: 1;
}
.chatpg__back {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-soft);
  background: transparent;
  border: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border-radius: 6px;
}
.chatpg__back:hover { background: var(--surface-2); color: var(--text); }
.chatpg__back svg { width: 12px; }

.chatpg__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  overflow-y: auto;
}
.chatpg__hero {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.025em;
  text-align: center;
  margin-bottom: 28px;
  color: var(--text);
}
.chatpg__composer-wrap {
  width: 100%;
  max-width: 720px;
}
/* Workspace sharing: one quiet privacy line under the composer on shared brands. */
.composer-shared-note {
  font-size: 11.5px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 8px;
  line-height: 1.5;
}
.chatpg__suggestions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 16px;
}
.chatpg__approval-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 520px;
  margin: 18px auto 0;
  padding: 10px 14px;
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  border-radius: 10px;
}
.chatpg__approval-title { display: block; font-size: 12.5px; font-weight: 600; color: var(--text); }
.chatpg__approval-sub { display: block; font-size: 11px; color: var(--text-muted); margin-top: 2px; line-height: 1.4; }
.chatpg__sug {
  font-size: 12.5px;
  padding: 8px 14px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  color: var(--text-soft);
  cursor: pointer;
  transition: all 140ms ease;
}
.chatpg__sug:hover { color: var(--text); border-color: var(--text-dim); background: var(--surface-2); }

.chatpg__recent {
  width: 100%;
  max-width: 720px;
  margin-top: 36px;
}
.chatpg__recent-head {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
  padding-left: 4px;
}
.chatpg__recent-list { display: flex; flex-direction: column; gap: 4px; }
.chatpg__recent-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  cursor: pointer;
  transition: all 140ms ease;
}
.chatpg__recent-item:hover { border-color: var(--text-dim); transform: translateY(-1px); box-shadow: var(--shadow-xs); }
.chatpg__recent-icon {
  width: 28px; height: 28px;
  border-radius: 7px;
  background: var(--surface-2);
  display: grid;
  place-items: center;
  color: var(--text-muted);
  flex-shrink: 0;
}
.chatpg__recent-icon svg { width: 14px; }
.chatpg__recent-text { flex: 1; min-width: 0; }
.chatpg__recent-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chatpg__recent-meta { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.composer-input {
  flex: 1;
  font: inherit;
  font-size: 13.5px;
  line-height: 1.55;
  border: 0;
  outline: 0;
  resize: none;
  background: transparent;
  color: var(--text);
  padding: 0 4px;
  min-width: 0;
  overflow-y: auto;
  max-height: 150px;
  height: auto;
}
.composer-input::placeholder { color: var(--text-muted); }
.composer-send {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--gradient-flat);
  color: #fff;
  border: 0;
  cursor: pointer;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}
.composer-send:hover { opacity: 0.92; transform: translateY(-1px); }
.composer-send.is-busy:hover { transform: none; opacity: 1; }
.composer-send svg { width: 13px; }
.composer-send.is-busy svg { width: 15px; }
/* Stop state (both composers): a spinning progress ring around a clear stop
   square so "generating -> click to stop" is unmistakable (Claude/ChatGPT
   parity). Ring is a pointer-events:none ::after so it never blocks the click;
   abort logic is unchanged. No red (brand rule). */
.composer-send.is-busy, .c2__send.is-busy { position: relative; overflow: visible; }
.composer-send.is-busy::after, .c2__send.is-busy::after {
  content: ''; position: absolute; inset: -3px; border-radius: 50%; pointer-events: none;
  background: conic-gradient(from 0deg, transparent 0 15%, var(--stop-ring, rgba(0,119,182,.95)) 50%, transparent 85% 100%);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 3px));
          mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 3px));
  animation: psStopSpin .85s linear infinite;
}
@keyframes psStopSpin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .composer-send.is-busy::after, .c2__send.is-busy::after { animation: none; background: var(--stop-ring, rgba(0,119,182,.6)); }
}

/* ============ CHARTS ============ */
canvas.chart { display: block; cursor: crosshair; }

/* ============ SETUP PANEL (Gear modal) ============ */
.scrim {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
}
.scrim.is-open { opacity: 1; pointer-events: auto; }
.setup-panel {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 720px;
  max-width: 100vw;
  background: var(--surface);
  border-left: 1px solid var(--hairline);
  z-index: 101;
  transform: translateX(100%);
  transition: transform 280ms var(--ease);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
}
.setup-tab-rail {
  display: flex;
  gap: 2px;
  padding: 0 20px;
  border-bottom: 1px solid var(--hairline);
  background: var(--surface);
  flex-shrink: 0;
}
.setup-tab {
  font: inherit;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: 0;
  padding: 11px 14px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all 140ms ease;
}
.setup-tab:hover { color: var(--text); }
.setup-tab.is-active {
  color: var(--text);
  font-weight: 600;
  border-bottom-color: var(--accent);
}
.setup-tab__count {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface-2);
  padding: 1px 7px;
  border-radius: 10px;
  margin-left: 6px;
}
.setup-tab.is-active .setup-tab__count { background: var(--accent-soft); color: var(--accent); }
.setup-view { display: none; }
.setup-view.is-active { display: block; }

/* Connection list (rich) */
.conn-list { display: flex; flex-direction: column; gap: 10px; }
.conn-tile {
  display: flex;
  flex-direction: column;
  padding: 14px 16px;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  background: var(--surface);
  transition: all 140ms ease;
}
.conn-tile:hover { border-color: var(--text-dim); box-shadow: var(--shadow-sm); }
/* MCP page platform grid: 2-col card grid per the approved design, primary
   ads platform as a full-width wide tile, 1-col on narrow screens. Cards in
   the same row stretch to equal height; the tile stacks head / sub / actions
   (never the old single-row anatomy, which crushed text in half-width cards). */
.mcp-plat-grid { display: flex; flex-direction: column; gap: 10px; }
.mcp-plat-grid .conn-tile { border-radius: 16px; padding: 15px 17px; box-shadow: var(--shadow-sm); }
.mcp-plat-grid .conn-tile:hover { box-shadow: var(--shadow-md); }
.mcp-tile__head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.mcp-tile__head .conn-tile__name { margin-right: auto; min-width: 0; }
.mcp-tile__head .conn-pill { flex-shrink: 0; }
.mcp-tile__sub { font-size: 12px; line-height: 1.55; color: var(--text-muted); margin-top: 8px; }
.mcp-tile__actions { display: flex; gap: 7px; margin-top: 10px; flex-wrap: wrap; }
.mcp-tile__mslink { margin-top: 8px; }
.mcp-tile__mslink a { font-size: 11px; color: var(--text-muted); text-decoration: underline; text-underline-offset: 2px; }
.conn-tile__top {
  display: flex;
  align-items: center;
  gap: 14px;
}
.conn-tile__logo {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  display: grid;
  place-items: center;
  padding: 6px;
  flex-shrink: 0;
}
.conn-tile__logo img { width: 100%; height: 100%; object-fit: contain; transform: scale(var(--logo-scale, 1)); }
.conn-tile__main { flex: 1; min-width: 0; }
.conn-tile__name {
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.conn-tile__status-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.conn-tile__status-dot--ok { background: var(--ok); }
.conn-tile__status-dot--off { background: var(--text-dim); }
.conn-tile__status-dot--warn { background: var(--bad, #dc2626); box-shadow: 0 0 0 3px var(--bad-soft, rgba(220,38,38,0.12)); }
.conn-tile__status-dot--loading { background: var(--text-dim); animation: connDotPulse 1.1s ease-in-out infinite; }
@keyframes connDotPulse { 0%,100% { opacity: 0.35; } 50% { opacity: 1; } }
/* Status pills (shared by MCP tiles): ok=green, warn=red, muted=coming soon, loading=spinner */
.conn-pill { font-size: 10.5px; font-weight: 600; padding: 3px 8px; border-radius: 5px; display: inline-flex; align-items: center; gap: 5px; }
.conn-pill--ok { color: var(--ok); background: var(--ok-bg, rgba(16,185,129,0.12)); }
.conn-pill--warn { color: var(--bad, #dc2626); background: var(--bad-bg, #fee2e2); }
.conn-pill--muted { color: var(--text-muted); background: var(--surface-2); }
.conn-pill--loading { color: var(--text-muted); background: var(--surface-2); }
.conn-spin { width: 10px; height: 10px; border-radius: 50%; border: 1.6px solid var(--hairline); border-top-color: var(--text-muted); animation: connSpin 0.7s linear infinite; }
@keyframes connSpin { to { transform: rotate(360deg); } }
.conn-tile.is-expired { box-shadow: inset 3px 0 0 var(--bad, #dc2626); }
.conn-tile__sub {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 3px;
  font-family: 'JetBrains Mono', monospace;
}
.conn-tile__actions { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }
.conn-tile__btn {
  font: inherit;
  font-size: 11.5px;
  font-weight: 600;
  padding: 6px 11px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 7px;
  color: var(--text-soft);
  cursor: pointer;
}
.conn-tile__btn:hover { background: var(--surface-2); color: var(--text); }
.conn-tile__btn--primary {
  background: var(--gradient-flat);
  color: #fff;
  border: 0;
}
.conn-tile__btn--primary:hover { background: var(--gradient-flat); opacity: 0.92; color: #fff; }
.conn-tile__btn--danger:hover { background: var(--bad-bg); color: var(--bad); border-color: var(--bad); }

.conn-group {
  margin-bottom: 24px;
}
.conn-group__head {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.conn-group__head-text { display: inline-flex; align-items: center; gap: 8px; }
.conn-group__add {
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  background: transparent;
  border: 1px dashed var(--hairline);
  color: var(--text-soft);
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  letter-spacing: 0;
  text-transform: none;
}
.conn-group__add:hover { color: var(--text); border-color: var(--text-dim); background: var(--surface-2); }

/* Multi-account sub-rows for one platform */
.conn-tile__accounts {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--hairline-soft);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.conn-tile__accounts.is-hidden { display: none; }
.conn-tile__disclosure {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  padding: 5px 10px 5px 10px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-soft);
  letter-spacing: 0.02em;
  user-select: none;
  border: 1px solid var(--hairline);
  border-radius: 7px;
  background: var(--surface-2);
  text-align: left;
  transition: border-color 120ms ease, background 120ms ease, color 120ms ease;
  margin-bottom: 2px;
}
.conn-tile__disclosure:hover {
  border-color: var(--text-dim);
  background: var(--surface);
  color: var(--text);
}
.conn-tile__disclosure-chevron {
  display: inline-block;
  transition: transform 160ms ease;
  font-style: normal;
  font-size: 10px;
  color: var(--text-muted);
}
.conn-tile__disclosure.is-open .conn-tile__disclosure-chevron { transform: rotate(90deg); }
.conn-tile__acct-list { display: flex; flex-direction: column; gap: 6px; max-height: 340px; overflow-y: auto; }
.conn-tile__acct-list.is-hidden { display: none; }
.conn-tile__acct-search {
  font: inherit;
  font-size: 12px;
  padding: 6px 10px;
  border: 1px solid var(--hairline);
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--text);
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 4px;
}
.conn-tile__acct-search::placeholder { color: var(--text-dim); }
.conn-tile__acct-search:focus { outline: none; border-color: var(--accent); }
.conn-acct {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  background: var(--surface-2);
  border-radius: 7px;
  font-size: 12px;
}
.conn-acct__name { font-weight: 500; }
.conn-acct__id { color: var(--text-muted); font-family: 'JetBrains Mono', monospace; font-size: 11px; margin-left: 8px; }
.conn-acct__sp { flex: 1; }
.conn-acct__btn {
  font: inherit;
  font-size: 10.5px;
  color: var(--text-muted);
  background: transparent;
  border: 0;
  cursor: pointer;
}
.conn-acct__btn:hover { color: var(--bad); }
.conn-tile.is-expanded { flex-wrap: wrap; }

/* Two-zone account picker */
.conn-zone-note {
  background: var(--gradient-subtle);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 12px;
  color: var(--text-soft);
  line-height: 1.55;
  margin-bottom: 18px;
}
.conn-zone-note b { color: var(--text); font-weight: 600; }

.conn-acct-pick {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  cursor: pointer;
  transition: all 140ms ease;
  margin-bottom: 6px;
}
.conn-acct-pick:hover { border-color: var(--text-dim); background: var(--surface-2); }
.conn-acct-pick.is-attached {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.conn-acct-pick__check {
  width: 18px; height: 18px;
  border-radius: 5px;
  border: 1.5px solid var(--hairline);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: transparent;
  background: var(--surface);
}
.conn-acct-pick.is-attached .conn-acct-pick__check {
  background: var(--gradient-flat);
  border-color: transparent;
  color: #fff;
}
.conn-acct-pick__check svg { width: 11px; }
.conn-acct-pick__main { flex: 1; min-width: 0; }
.conn-acct-pick__name { font-size: 12.5px; font-weight: 600; line-height: 1.2; }
.conn-acct-pick__meta { font-size: 11px; color: var(--text-muted); margin-top: 2px; font-family: 'JetBrains Mono', monospace; }
.conn-acct-pick__badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-muted);
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.conn-acct-pick__badge--this { background: var(--ok-bg); color: var(--ok); }
.conn-acct-pick__badge--other { background: var(--warn-bg); color: var(--warn); }
.setup-panel.is-open { transform: translateX(0); }
.setup-panel__head {
  height: 56px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--hairline);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 10px;
}
.setup-panel__title { font-size: 15px; font-weight: 700; letter-spacing: -0.02em; flex: 1; }
.setup-panel__body { flex: 1; overflow-y: auto; padding: 20px; }
.setup-section { margin-bottom: 24px; }
.setup-section h3 {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.setup-field { margin-bottom: 12px; }
.setup-field label { font-size: 12px; font-weight: 500; color: var(--text-soft); display: block; margin-bottom: 4px; }
.setup-field input,
.setup-field textarea {
  width: 100%;
  font: inherit;
  font-size: 13px;
  padding: 8px 11px;
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  color: var(--text);
  outline: 0;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
.setup-field input:focus,
.setup-field textarea:focus { border-color: var(--accent); box-shadow: var(--shadow-focus); background: var(--surface); }
.setup-field textarea { resize: vertical; min-height: 80px; line-height: 1.55; }
.conv-picker { display: flex; flex-direction: column; gap: 2px; }
.conv-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 8px; cursor: pointer;
  border: 1px solid transparent;
  transition: background 100ms ease, border-color 100ms ease;
}
.conv-row:hover { background: var(--surface-2); }
.conv-row.is-checked { background: var(--accent-soft, rgba(0,119,182,0.08)); border-color: var(--accent-border, rgba(0,119,182,0.2)); }
.conv-row__check { flex-shrink: 0; accent-color: var(--accent); width: 15px; height: 15px; cursor: pointer; }
.conv-row__label { font-size: 13px; font-weight: 500; color: var(--text); flex: 1; }

/* ============ MCP INTEGRATIONS PAGE (full screen) ============ */
.mcp-page {
  display: none;
  flex: 1;
  flex-direction: column;
  background: var(--canvas);
  min-height: 0;
  overflow: hidden;
}
.app.is-mcp-page .mcp-page { display: flex; }
.app.is-mcp-page .scroll { display: none; }
.app.is-mcp-page .chats-page { display: none; }
.mcp-page__head {
  height: 56px;
  border-bottom: 1px solid var(--hairline);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 12px;
  background: var(--surface);
  flex-shrink: 0;
}
.mcp-page__head-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--gradient);
  color: #fff;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  padding: 6px;
}
.mcp-page__head-icon img { width: 100%; height: 100%; object-fit: contain; }
.mcp-page__title { font-size: 15px; font-weight: 700; letter-spacing: -0.02em; }
.mcp-page__subtitle { font-size: 11.5px; color: var(--text-muted); margin-top: 1px; }
.mcp-page__body { flex: 1; overflow-y: auto; padding: 32px 24px 60px; }
.mcp-page__inner { max-width: 880px; margin: 0 auto; }
.mcp-page__back {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-soft);
  background: transparent;
  border: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border-radius: 6px;
}
.mcp-page__back:hover { background: var(--surface-2); color: var(--text); }
.mcp-page__back svg { width: 12px; }

/* ── MCP card: iOS-premium glass surface ── */
.mcp-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.72) 0%, rgba(255,255,255,0.52) 100%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(91,45,142,0.10);
  border-radius: 18px;
  margin-bottom: 16px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04), 0 8px 24px rgba(91,45,142,0.06);
}
.mcp-card__head {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 18px 20px 14px;
}
.mcp-card__head-icon {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  color: var(--text-soft);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.mcp-card__head-icon svg { width: 18px; }
.mcp-card__head-text { flex: 1; min-width: 0; }
.mcp-card__head-title { font-size: 14px; font-weight: 700; letter-spacing: -0.015em; line-height: 1.25; }
.mcp-card__head-desc { font-size: 12px; color: var(--text-soft); margin-top: 2px; line-height: 1.45; }
.mcp-card__body { padding: 4px 20px 20px; }

/* API key codebox: iOS Settings-style light surface */
.mcp-codebox {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f2f2f7;
  border: 1px solid rgba(60,60,67,0.12);
  border-radius: 12px;
  padding: 16px 16px;
  margin-bottom: 10px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.7), 0 1px 3px rgba(0,0,0,0.06);
}
.mcp-codebox__code {
  font-family: 'JetBrains Mono', ui-monospace, Consolas, monospace;
  font-size: 13px;
  color: #1d1d1f;
  flex: 1;
  min-width: 0;
  word-break: break-all;
  letter-spacing: 0.03em;
}
/* Eye-toggle button inside codebox */
.mcp-reveal-btn {
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 4px 6px;
  color: rgba(60,60,67,0.45);
  flex-shrink: 0;
  transition: color 140ms ease;
  display: flex; align-items: center;
}
.mcp-reveal-btn:hover { color: rgba(60,60,67,0.8); }
.mcp-reveal-btn svg { width: 15px; height: 15px; }
.mcp-copy-btn, .mcp-regen-btn, .mcp-rotate-btn {
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 8px;
  border: 0;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 140ms ease;
}
.mcp-copy-btn {
  background: var(--gradient-flat);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.mcp-copy-btn:active { transform: scale(0.97); }
.mcp-copy-btn:hover { opacity: 0.90; transform: translateY(-1px); }
.mcp-copy-btn.is-copied {
  background: linear-gradient(135deg, #16a34a, #15803d);
}
.mcp-regen-btn {
  background: rgba(60,60,67,0.07);
  color: rgba(60,60,67,0.7);
  border: 1px solid rgba(60,60,67,0.12);
}
.mcp-regen-btn:hover { color: #1d1d1f; background: rgba(60,60,67,0.13); }
.mcp-rotate-btn {
  display: flex; align-items: center; gap: 5px;
  background: rgba(60,60,67,0.07);
  color: rgba(60,60,67,0.7);
  border: 1px solid rgba(60,60,67,0.12);
}
.mcp-rotate-btn svg { width: 12px; height: 12px; flex-shrink: 0; }
.mcp-rotate-btn:hover { color: #1d1d1f; background: rgba(60,60,67,0.13); }
.mcp-rotate-btn:disabled { opacity: 0.5; cursor: not-allowed; }
/* Warn hint: soft amber glass */
.mcp-hint {
  font-size: 11.5px;
  color: var(--text-soft);
  line-height: 1.55;
  margin-top: 6px;
}
.mcp-hint--warn {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: rgba(251,191,36,0.08);
  border: 1px solid rgba(251,191,36,0.20);
  border-radius: 12px;
  padding: 10px 13px;
  margin-top: 10px;
  color: var(--text-soft);
  font-weight: 400;
  font-size: 11.5px;
  line-height: 1.55;
}
.mcp-hint--warn .mcp-hint__icon {
  flex-shrink: 0;
  width: 14px; height: 14px;
  margin-top: 1px;
  color: #f59e0b;
}
.mcp-hint--warn .mcp-hint__icon svg { width: 14px; height: 14px; display: block; }

.mcp-guide-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 24px 0 8px;
}
/* dark mode card surface */
.dark .mcp-card {
  background: linear-gradient(180deg, rgba(20,20,26,0.82) 0%, rgba(16,16,20,0.72) 100%);
  border: 1px solid rgba(255,255,255,0.06);
  box-shadow: 0 1px 2px rgba(0,0,0,0.4), 0 8px 24px rgba(0,0,0,0.25);
}
/* dark codebox: system gray fill on dark */
.dark .mcp-codebox {
  background: rgba(118,118,128,0.24);
  border-color: rgba(255,255,255,0.06);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04), 0 1px 3px rgba(0,0,0,0.2);
}
.dark .mcp-codebox .mcp-codebox__code {
  color: #f5f5f7;
}
.dark .mcp-codebox .mcp-reveal-btn {
  color: rgba(255,255,255,0.4);
}
.dark .mcp-codebox .mcp-reveal-btn:hover {
  color: rgba(255,255,255,0.75);
}
.dark .mcp-codebox .mcp-regen-btn,
.dark .mcp-codebox .mcp-rotate-btn {
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.6);
  border-color: rgba(255,255,255,0.1);
}
.dark .mcp-codebox .mcp-regen-btn:hover,
.dark .mcp-codebox .mcp-rotate-btn:hover {
  color: rgba(255,255,255,0.9);
  background: rgba(255,255,255,0.16);
}
.dark .mcp-hint--warn {
  background: rgba(251,191,36,0.07);
  border-color: rgba(251,191,36,0.15);
}
.mcp-plat-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}
.mcp-plat-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: var(--surface);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: all 140ms ease;
}
.mcp-plat-chip:hover { border-color: var(--text-dim); background: var(--surface-2); }
/* W9: active chip uses PaidSync brand purple as solid background.
   Text becomes white. Logos that are dark/coloured on transparent need
   brightness inversion so they read on the dark bg. Logos with an explicit
   data-dark-src are swapped by mcpChipSelect() JS — no CSS filter needed. */
.mcp-plat-chip.is-active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}
/* Default: invert dark logos to white on the purple background */
.mcp-plat-chip.is-active img { filter: brightness(0) invert(1); }
/* Logos with a purpose-built white variant (swapped by JS via data-dark-src):
   chatgpt-dark.svg, n8n-dark.svg, zapier-dark.svg are already white on transparent */
.mcp-plat-chip.is-active img[data-has-dark-src] { filter: none; }
/* Claude orange logo renders fine on purple — don't invert */
.mcp-plat-chip.is-active img[data-logo="claude"] { filter: none; }
/* Gemini gradient SVG renders fine on purple — don't invert */
.mcp-plat-chip.is-active img[data-logo="gemini"] { filter: none; }
/* Cursor: keep the real 3D PNG (same shape inactive+active), wrap in white pill
   so the black rounded-square bg reads on the purple chip */
.mcp-plat-chip.is-active img[data-logo="cursor"] {
  filter: none;
  background: #fff;
  border-radius: 4px;
  padding: 1px;
  box-sizing: content-box;
}
/* n8n + Zapier: keep original PNG (color logo), wrap in white pill for contrast on purple */
.mcp-plat-chip.is-active img[data-logo="n8n"],
.mcp-plat-chip.is-active img[data-logo="zapier"] {
  filter: none;
  background: #fff;
  border-radius: 4px;
  padding: 1px;
  box-sizing: content-box;
}
/* Dark mode: same solid accent, same rules */
.dark .mcp-plat-chip.is-active { border-color: var(--accent); background: var(--accent); color: #fff; }
.dark .mcp-plat-chip.is-active img { filter: brightness(0) invert(1); }
.dark .mcp-plat-chip.is-active img[data-has-dark-src] { filter: none; }
.dark .mcp-plat-chip.is-active img[data-logo="claude"] { filter: none; }
.dark .mcp-plat-chip.is-active img[data-logo="gemini"] { filter: none; }
.dark .mcp-plat-chip.is-active img[data-logo="cursor"] {
  filter: none;
  background: #fff;
  border-radius: 4px;
  padding: 1px;
  box-sizing: content-box;
}
.dark .mcp-plat-chip.is-active img[data-logo="n8n"],
.dark .mcp-plat-chip.is-active img[data-logo="zapier"] {
  filter: none;
  background: #fff;
  border-radius: 4px;
  padding: 1px;
  box-sizing: content-box;
}
.mcp-plat-chip img,
.mcp-plat-chip .mcp-plat-logo {
  width: 16px; height: 16px; object-fit: contain;
}
.mcp-plat-logo {
  border-radius: 4px;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  display: grid;
  place-items: center;
}
.mcp-plat-tip {
  display: none;
  background: linear-gradient(180deg, rgba(91,45,142,0.04) 0%, rgba(0,119,182,0.03) 100%);
  border: 1px solid rgba(91,45,142,0.12);
  border-radius: 14px;
  padding: 16px 18px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-soft);
  box-shadow: 0 1px 2px rgba(0,0,0,0.03), 0 4px 12px rgba(91,45,142,0.04);
}
.dark .mcp-plat-tip {
  background: linear-gradient(180deg, rgba(91,45,142,0.07) 0%, rgba(0,119,182,0.05) 100%);
  border-color: rgba(91,45,142,0.18);
  box-shadow: 0 1px 2px rgba(0,0,0,0.2), 0 4px 12px rgba(0,0,0,0.15);
}
.mcp-plat-tip.is-active { display: block; }
/* W9: numbered step list inside tips */
.mcp-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0; }
.mcp-step { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--hairline); }
.mcp-step:last-child { border-bottom: none; padding-bottom: 0; }
.mcp-step__num { width: 22px; height: 22px; border-radius: 50%; background: var(--gradient-flat); color: #fff; font-size: 10.5px; font-weight: 700; display: grid; place-items: center; flex-shrink: 0; margin-top: 1px; box-shadow: 0 2px 6px rgba(91,45,142,0.3); }
.mcp-step__text { font-size: 12.5px; line-height: 1.55; color: var(--text-soft); }
.mcp-plat-tip code {
  background: rgba(91,45,142,0.08);
  padding: 1px 6px;
  border-radius: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  color: var(--accent);
  font-weight: 600;
}
.dark .mcp-plat-tip code {
  background: rgba(140,92,196,0.14);
  color: #b985f5;
}
.mcp-plat-tip b, .mcp-plat-tip strong { color: var(--text); font-weight: 600; }

.mcp-migration-notice {
  background: rgba(217,119,6,0.07);
  border: 1px solid rgba(217,119,6,0.25);
  border-radius: 10px;
  padding: 11px 14px;
  margin-bottom: 16px;
  display: flex;
  gap: 11px;
  align-items: flex-start;
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-soft);
}
.mcp-migration-notice svg { color: var(--warn); flex-shrink: 0; margin-top: 1px; width: 16px; }
.mcp-migration-notice b { color: var(--text); font-weight: 600; }
.mcp-migration-notice code {
  background: var(--surface);
  border: 1px solid rgba(217,119,6,0.3);
  padding: 1px 6px;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text);
}

/* ============ CREATE BRAND MODAL ============ */
.brand-modal {
  position: fixed; top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(0.96);
  width: 460px; max-width: calc(100vw - 32px);
  max-height: calc(100vh - 48px);
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  z-index: 105;
  opacity: 0; pointer-events: none;
  transition: opacity 220ms ease, transform 220ms var(--ease);
  overflow: hidden;
  display: flex; flex-direction: column;
}
.brand-modal.is-open { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%) scale(1); }
.brand-modal__head { padding: 18px 20px 14px; border-bottom: 1px solid var(--hairline); display: flex; align-items: center; gap: 10px; }
.brand-modal__title { font-size: 15px; font-weight: 700; letter-spacing: -0.015em; flex: 1; }
.brand-modal__close { background: transparent; border: 0; cursor: pointer; padding: 6px; border-radius: 7px; color: var(--text-muted); }
.brand-modal__close:hover { background: var(--surface-2); color: var(--text); }
.brand-modal__close svg { width: 14px; }
.brand-modal__body { padding: 18px 20px 8px; flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.brand-modal__label { font-size: 11.5px; font-weight: 600; color: var(--text-muted); letter-spacing: 0.04em; text-transform: uppercase; display: block; margin-bottom: 6px; }
.brand-modal__input {
  width: 100%; padding: 11px 12px; font: inherit; font-size: 14px;
  background: var(--surface-2); border: 1px solid var(--hairline);
  color: var(--text); border-radius: 9px; outline: 0;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
.brand-modal__input:focus { border-color: var(--text-dim); box-shadow: var(--shadow-focus); }
.brand-modal__hint { font-size: 11.5px; color: var(--text-muted); margin-top: 5px; }
.brand-modal__field + .brand-modal__field { margin-top: 14px; }
.brand-modal__err { font-size: 12px; color: var(--bad); margin-top: 10px; min-height: 14px; }
.brand-modal__foot { padding: 12px 20px 18px; display: flex; justify-content: flex-end; gap: 8px; }
.brand-modal__btn {
  padding: 9px 16px; font: inherit; font-size: 13px; font-weight: 600;
  border: 1px solid var(--hairline); background: var(--surface-2);
  color: var(--text); border-radius: 9px; cursor: pointer;
  transition: background 160ms ease, transform 120ms ease;
}
.brand-modal__btn:hover { background: var(--surface-3); }
.brand-modal__btn--primary {
  background: var(--text); color: var(--canvas); border-color: var(--text);
}
.brand-modal__btn--primary:hover { background: var(--text); opacity: 0.92; transform: translateY(-1px); } /* .brand-modal__btn:hover would paint it surface-3 under canvas-coloured text: an unreadable Done on a phone, where a tap leaves hover on */
.brand-modal__btn[disabled] { opacity: 0.5; cursor: not-allowed; transform: none; }
/* Every brand dialog on a phone: no tap target under 44 px (Rio, Team top-up 4). */
@media (max-width: 560px) {
  .brand-modal__btn, .brand-modal .acm-amount, .brand-modal .brand-modal__input { min-height: 44px; }
  .brand-modal__close { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
}
#ttuBuyOk:not(:empty) { margin-top: 10px; }
#ttuAutoToggle[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }

/* Btn primary in modal */
.modal-btn {
  font-size: 13px;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: 8px;
  border: 1px solid var(--hairline);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: all 140ms ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.modal-btn:hover { background: var(--surface-2); border-color: var(--text-dim); }
.modal-btn svg { width: 13px; }
.modal-btn--primary {
  background: var(--gradient-flat);
  color: #fff;
  border: 0;
  box-shadow: var(--shadow-sm);
}
.modal-btn--primary:hover { background: var(--gradient-flat); opacity: 0.92; transform: translateY(-1px); box-shadow: var(--shadow-md); }
.modal-btn--primary:disabled { background: var(--gradient-flat); color: #fff; opacity: 0.7; cursor: default; transform: none; }
.modal-btn--ghost { background: transparent; border: 0; color: var(--text-soft); }
.modal-btn--ghost:hover { color: var(--text); background: var(--surface-2); }
.modal-btn.modal-btn--danger { background: var(--bad); color: #fff; border-color: var(--bad); }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { opacity: 0.45; } 50% { opacity: 1; } }
@keyframes psSpin { to { transform: rotate(360deg); } }

/* ============ SCROLLBARS ============ */
.scroll,
.chat__msgs,
.setup-panel__body,
.convs {
  scrollbar-width: thin;
  scrollbar-color: var(--hairline) transparent;
}

/* Selection */
::selection { background: var(--accent-soft); color: var(--text); }

/* ============ MIGRATION BANNER ============ */
.migrate-bar {
  background: var(--gradient);
  color: #fff;
  padding: 8px 20px;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 14px;
  font-weight: 500;
  letter-spacing: -0.005em;
  flex-shrink: 0;
}
.migrate-bar__url {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.16);
  padding: 3px 9px;
  border-radius: 5px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 600;
}
.migrate-bar__badge {
  background: rgba(255,255,255,0.2);
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.migrate-bar__spacer { flex: 1; }
.migrate-bar__link {
  color: #fff;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 5px;
  background: rgba(255,255,255,0.16);
  font-weight: 600;
  font-size: 11.5px;
}
.migrate-bar__link:hover { background: rgba(255,255,255,0.26); }
.migrate-bar__link svg { width: 11px; }
.app-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
}
.app-shell .app { height: auto; flex: 1; min-height: 0; }

/* Sync now shares the .rep-toolbtn family with Share and Edit report so the
   toolbar reads as one system. Only the disabled state needs an extra rule. */
#refreshAllBtn:disabled { opacity: 0.55; cursor: default; }

/* Trend chart controls: quiet selects + legend, one family with rep-toolbtn */
.trend-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
/* A line on this chart can be a measurement or an even spread of a period total, and
   until 2026-08-28 they looked identical. LinkedIn and TikTok publish no daily
   breakdown at all, so their share was ALWAYS spread. Quiet, typographic, sits under
   the chart it is about rather than competing with the report-level notice above the
   KPIs, which is reserved for totals that are actually wrong. */
.chart-note { margin-top: 10px; font-size: 11px; line-height: 1.5; color: var(--text-muted); }
.trend-sel {
  font: inherit; font-size: 11.5px; font-weight: 600; color: var(--text-soft);
  background: var(--surface); border: 1px solid var(--hairline); border-radius: 9px;
  padding: 5px 8px; cursor: pointer; max-width: 150px;
}
.trend-sel:hover { border-color: var(--text-dim); color: var(--text); }

/* ============ MOBILE / NARROW (<= 768px) ============ */
/* Placed last so it overrides base rules on ties (media queries add no specificity). */
@media (max-width: 768px) {
  .topbar { padding: 0 12px; gap: 8px; }
  .auto-head { flex-direction: column; align-items: stretch; }
  .brands-page__grid { grid-template-columns: 1fr; }
  /* Stack the scheduled-task row so its 6-column desktop grid stops overflowing */
  .sched-row { display: block; padding: 14px 16px; }
  .sched-row__icon { display: none; }
  .sched-row__schedule, .sched-row__next, .sched-row > div { margin-top: 3px; }
  .sched-row__name { margin-top: 0; }
  .sched-row__status { display: inline-block; margin-top: 8px; }
  .sched-row__more { position: absolute; top: 10px; right: 10px; }
  .sched-row__sum, .sched-row__err { white-space: normal; max-width: none; }
}
/* MCP card mobile parity at 390px */
@media (max-width: 440px) {
  .mcp-card { border-radius: 14px; }
  .mcp-card__head { padding: 16px 16px 12px; }
  .mcp-card__body { padding: 4px 16px 16px; }
  .mcp-codebox { padding: 13px 12px; }
  .mcp-codebox__code { font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; word-break: normal; }
  .mcp-plat-tip { padding: 13px 14px; border-radius: 12px; }
}

/* ── AI model picker (flag modelPicker) ── */
.composer-model { flex-shrink: 0; border: 1px solid var(--hairline); background: var(--surface-2); color: var(--text-soft); border-radius: 999px; padding: 5px 11px; font-size: 11.5px; font-weight: 600; cursor: pointer; white-space: nowrap; max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
.composer-model:hover { color: var(--text); border-color: var(--text-muted); }
.model-pop { position: fixed; z-index: 10000; background: var(--surface); border: 1px solid var(--hairline); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; min-width: 230px; }
.model-pop__item { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; padding: 8px 10px; border: 0; background: transparent; color: var(--text); font-size: 12.5px; border-radius: 8px; cursor: pointer; }
.model-pop__item:hover { background: var(--surface-2); }
.model-pop__item.is-current { font-weight: 700; }
.model-pop__badge { margin-left: auto; font-size: 10px; font-weight: 600; color: var(--accent); border: 1px solid var(--accent); border-radius: 999px; padding: 1px 7px; }
.msg__model { font-size: 10.5px; color: var(--text-muted); margin-top: 6px; }

/* ── Simplified chat composer (one box, textarea + bottom control bar) ── */
.chatpg__greet { text-align: center; margin-bottom: 26px; }
.chatpg__greet-hi { font-size: 14px; color: var(--text-muted); margin-bottom: 8px; }
.chatpg__greet-q { font-size: 34px; font-weight: 700; letter-spacing: -0.02em; color: var(--text); margin: 0 0 10px; }
.chatpg__greet-sub { font-size: 13.5px; color: var(--text-muted); max-width: 480px; margin: 0 auto; line-height: 1.55; }
.chatpg__sugcards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.sugcard { border: 1px solid var(--hairline); border-radius: 12px; padding: 13px 15px; text-align: left; background: var(--surface); cursor: pointer; transition: border-color .14s, box-shadow .14s; }
.sugcard:hover { border-color: var(--text-muted); box-shadow: var(--shadow-sm); }
.sugcard__t { font-size: 13px; font-weight: 600; color: var(--text); }
.sugcard__s { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; line-height: 1.4; }
.c2 { background: var(--surface); border: 1px solid var(--hairline); border-radius: 18px; box-shadow: var(--shadow-sm); padding: 12px 12px 9px; transition: border-color .14s, box-shadow .14s; }
.c2:focus-within { border-color: var(--accent); box-shadow: var(--shadow-focus); }
.c2__input { width: 100%; border: 0; outline: 0; resize: none; background: transparent; font: inherit; font-size: 15px; color: var(--text); min-height: 44px; max-height: 200px; padding: 2px 4px 8px; }
.c2__input::placeholder { color: var(--text-muted); }
.c2__bar { display: flex; align-items: center; gap: 7px; }
.c2__btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--hairline); background: var(--surface); color: var(--text-soft); border-radius: 999px; padding: 6px 11px; font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap; transition: color .14s, border-color .14s; }
.c2__btn:hover { color: var(--text); border-color: var(--text-muted); }
.c2__btn svg { width: 14px; height: 14px; flex-shrink: 0; }
.c2__btn .c2__car { color: var(--text-muted); font-size: 9px; margin-left: -1px; }
.c2__plus { width: 32px; height: 32px; padding: 0; justify-content: center; border-radius: 50%; }
.c2__spacer { flex: 1; }
.c2__send { width: 34px; height: 34px; border: 0; border-radius: 50%; background: var(--gradient); color: #fff; display: grid; place-items: center; cursor: pointer; flex-shrink: 0; transition: opacity .14s, transform .14s; }
.c2__send:hover { opacity: .92; transform: translateY(-1px); }
.c2__send.is-busy:hover { transform: none; opacity: 1; }
.c2__send svg { width: 15px; height: 15px; }
.c2__menu { position: fixed; z-index: 10000; background: var(--surface); border: 1px solid var(--hairline); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; min-width: 230px; }
.c2__menu-item { display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; padding: 8px 10px; border: 0; background: transparent; color: var(--text); font-size: 12.5px; border-radius: 8px; cursor: pointer; }
.c2__menu-item:hover { background: var(--surface-2); }
.c2__menu-item svg { width: 15px; height: 15px; color: var(--text-muted); flex-shrink: 0; }
.c2__menu-sep { height: 1px; background: var(--hairline); margin: 5px 8px; }
.c2__menu-lbl { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); padding: 6px 10px 3px; }
.c2__chev { margin-left: auto; color: var(--text-muted); font-size: 14px; }
.c2__menu--gads { min-width: 340px; max-height: min(480px, 70vh); overflow: auto; }
.c2__menu-item--gads { justify-content: flex-start; }
.c2__menu-item .gads-code { margin-left: auto; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; color: var(--text-dim); }
.gads-glogo { width: 15px; height: 15px; flex-shrink: 0; object-fit: contain; }
.recipe-item__icon--logo { background: var(--surface-2); border: 1px solid var(--hairline); }
.recipe-item__icon--logo img { width: 14px; height: 14px; object-fit: contain; }
.gads-filter { display: flex; align-items: center; gap: 8px; padding: 4px 6px 8px; position: sticky; top: 0; background: var(--surface); z-index: 1; }
.gads-filter input { flex: 1; font: inherit; font-size: 12.5px; padding: 7px 10px; border: 1px solid var(--hairline); border-radius: 8px; background: var(--surface-2); color: var(--text); outline: 0; min-width: 0; }
.gads-back { border: 0; background: transparent; color: var(--text-muted); font: inherit; font-size: 12px; cursor: pointer; padding: 4px 6px; border-radius: 6px; white-space: nowrap; }
.gads-back:hover { background: var(--surface-2); color: var(--text); }
/* Guided Google Ads intake card (RMF: complete). Same shell as the approval card. */
.ps-intake { border: 1px solid var(--hairline); border-radius: 12px; background: var(--surface); overflow: hidden; box-shadow: var(--shadow-xs); margin: 6px 0 10px; width: 100%; max-width: 640px; outline: 0; }
.ps-intake__head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--hairline); background: var(--surface-2); font-size: 12.5px; color: var(--text-muted); }
.ps-intake__head b { color: var(--text); }
.ps-intake__head .gads-glogo { width: 15px; height: 15px; }
.ps-intake__x { margin-left: auto; border: 0; background: transparent; color: var(--text-muted); font-size: 18px; line-height: 1; cursor: pointer; padding: 0 2px; }
.ps-intake__prog { height: 4px; background: var(--surface-3); }
.ps-intake__prog i { display: block; height: 100%; background: var(--gradient-flat); border-radius: 2px; transition: width .18s ease; }
.ps-intake__body { padding: 14px 16px 6px; }
.ps-intake__q { font-size: 15px; font-weight: 650; letter-spacing: -.01em; margin-bottom: 4px; }
.ps-intake__hint { font-size: 12.5px; color: var(--text-muted); margin-bottom: 12px; line-height: 1.5; }
.ps-intake__chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ps-chip { font: inherit; font-size: 13px; padding: 9px 13px; border: 1px solid var(--hairline-strong); border-radius: 10px; background: var(--surface); cursor: pointer; color: var(--text); min-height: 40px; }
.ps-chip.is-on { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(99,91,255,.12); font-weight: 600; }
.ps-intake__in { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.ps-intake__in input, .ps-intake__in textarea { font: inherit; font-size: 14px; padding: 9px 12px; border: 1px solid var(--hairline-strong); border-radius: 9px; background: var(--surface); color: var(--text); min-height: 44px; flex: 1; min-width: 0; }
.ps-intake__in input[type="number"] { flex: 0 0 150px; }
.ps-intake__range, .ps-intake__muted { font-size: 11.5px; color: var(--text-muted); }
.ps-intake__muted { padding: 10px 12px; }
.ps-intake__pick { border: 1px solid var(--hairline); border-radius: 10px; overflow: auto; max-height: 260px; }
.ps-intake__pick div { display: flex; justify-content: space-between; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--hairline-soft); font-size: 13px; cursor: pointer; }
.ps-intake__pick div:last-child { border-bottom: 0; }
.ps-intake__pick div.is-on { background: var(--surface-2); font-weight: 600; }
.ps-intake__pick span { color: var(--text-muted); font-weight: 400; font-size: 12px; white-space: nowrap; }
.ps-intake__err { margin-top: 10px; font-size: 12.5px; color: #b42318; }
.ps-intake__nav { display: flex; align-items: center; gap: 8px; padding: 10px 14px 12px; border-top: 1px solid var(--hairline); margin-top: 12px; }
.ps-intake__nav .sp { flex: 1; }
.ps-intake__enter { font-size: 11.5px; color: var(--text-muted); }
/* Google Ads section inside Reports (RMF reporting) */
.gads-title { display: flex; align-items: center; gap: 8px; }
.gads-title .gads-glogo { width: 18px; height: 18px; }
.sec__action#gadsExport svg { width: 11px; margin-left: 2px; }
.gads-colwrap { position: relative; display: inline-flex; }
.sec__action#gadsCols svg { width: 11px; margin-left: 2px; }
.gads-colmenu { position: absolute; top: calc(100% + 6px); right: 0; z-index: 40; min-width: 236px; background: #fff; border: 1px solid #e6e8ee; border-radius: 10px; box-shadow: 0 8px 24px rgba(16,24,40,.12); padding: 8px; }
.gads-colmenu__t { font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: #6b7280; padding: 4px 8px 6px; }
.gads-colmenu__r { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 6px; font-size: 13px; cursor: pointer; }
.gads-colmenu__r:hover { background: #f5f6fa; }
.gads-colmenu__r code { margin-left: auto; font-size: 10px; color: #9aa1ad; }
.gads-head-actions { display: flex; align-items: center; gap: 10px; }
@media (max-width: 560px) { #gadsSection .sec__head { flex-wrap: wrap; } #gadsSection .gads-head-actions { flex-basis: 100%; justify-content: flex-end; } }
.gads-tabs { overflow-x: auto; margin-bottom: 12px; }
.gads-tabs .auto-tab { white-space: nowrap; }
.gads-body { min-height: 80px; }
.gads-body .tblscroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.gads-tbl th { white-space: nowrap; }
.gads-tbl td { vertical-align: top; }
.gads-sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; white-space: normal; }
.gads-absent { color: var(--text-dim); cursor: help; }
.gads-st { background: var(--surface-2); color: var(--text-soft); border: 1px solid var(--hairline); }
.gads-st--enabled { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.gads-st--paused { background: rgba(245,158,11,0.14); color: #b45309; border-color: transparent; }
.gads-st--removed { background: var(--bad-bg); color: var(--bad); border-color: transparent; }
.gads-state { padding: 26px 12px; text-align: center; }
.gads-state__t { font-size: 13.5px; font-weight: 600; margin-bottom: 6px; }
.gads-state__s { font-size: 12.5px; color: var(--text-muted); margin-bottom: 12px; word-break: break-word; }
.gads-heading { font-size: 13px; font-weight: 700; padding: 6px 12px 8px; }
.gads-note { font-size: 12px; color: var(--text-muted); padding: 8px 12px; }
.gads-actions { white-space: nowrap; }
.gads-actions .dv5-ebtn { font-size: 12px; padding: 4px 10px; margin-left: 4px; }
.gads-danger { color: var(--bad); }
.gads-pending { display: grid; gap: 10px; padding: 6px 0 4px; }
.gads-pending:empty { display: none; }
.gads-applied { font-size: 12.5px; color: var(--ok); background: var(--ok-bg); border-radius: 10px; padding: 10px 12px; }
/* Conversions tab: create + Get tag (RMF C.65) */
.conv-google-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 10px; }
.conv-google-tools__hint { font-size: 11.5px; color: var(--text-muted); }
.conv-google-intake:empty { display: none; }
.conv-google-intake { margin: 0 0 12px; }
.conv-gettag { font-size: 11px; padding: 3px 9px; margin-left: 6px; white-space: nowrap; }
.conv-tag-h { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-muted); margin: 12px 0 6px; }
.conv-tag-wrap { position: relative; }
.conv-tag { font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace; font-size: 11.5px; line-height: 1.5; background: var(--surface-2); border: 1px solid var(--hairline); border-radius: 8px; padding: 10px 12px; padding-right: 76px; white-space: pre-wrap; word-break: break-all; margin: 0; }
.conv-copy { position: absolute; top: 6px; right: 6px; font-size: 11px; padding: 2px 8px; }
.conv-prov { font-family: ui-monospace, Menlo, monospace; font-size: 11px; color: var(--text-muted); margin-top: 12px; }
.conv-tag-empty { font-size: 13px; line-height: 1.5; padding: 8px 0; }
.conv-tag-empty div { color: var(--text-muted); font-size: 12.5px; margin-top: 4px; }
@media (max-width: 520px) { .ps-intake__enter { display: none; } }
@media (max-width: 520px) { .c2__menu--gads { left: 8px !important; right: 8px; min-width: 0; width: auto; max-height: 60vh; } }
@media (max-width: 560px) { .chatpg__greet-q { font-size: 27px; } .chatpg__sugcards { grid-template-columns: 1fr; } .c2__bar { flex-wrap: wrap; } }
.instr-modal-body { max-height: 320px; overflow-y: auto; margin: 12px 0; }
.instr-row { display: flex; gap: 8px; align-items: flex-start; padding: 9px 0; border-bottom: 1px solid var(--hairline); }
.instr-row__text { flex: 1; font-size: 13px; color: var(--text); line-height: 1.5; }
.instr-row__del { border: 0; background: transparent; color: var(--text-muted); cursor: pointer; padding: 2px; flex-shrink: 0; }
.instr-row__del:hover { color: var(--bad); }
.instr-row__del svg { width: 15px; height: 15px; }

/* ── Live run experience (flag: liveRun). Namespaced lr-*, additive only. ── */
.c2 { position: relative; }
.c2::after {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(135deg, rgba(0,119,182,.6), rgba(91,45,142,.6), rgba(124,181,24,.6));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  opacity: 0; transition: opacity .35s var(--ease);
}
.c2:focus-within::after { opacity: 1; }
.c2 .c2__input { caret-color: var(--accent); }
.lr-enter { opacity: 0; transform: translateY(7px) scale(.985); animation: lrRise .5s cubic-bezier(0.34,1.4,0.44,1) forwards; }
@keyframes lrRise { to { opacity: 1; transform: translateY(0) scale(1); } }
.lr-steps { position: relative; padding-left: 40px; margin: 6px 0 10px; display: flex; flex-direction: column; }
.lr-steps::before { content: ""; position: absolute; left: 12px; top: 15px; bottom: 15px; width: 2px; border-radius: 2px; background: var(--hairline); }
.lr-steps.lr-running::before {
  background: linear-gradient(180deg, #0077B6, #5B2D8E, #7CB518, #0077B6);
  background-size: 100% 320%; animation: lrThread 2.6s linear infinite;
}
@keyframes lrThread { from { background-position: 0 0; } to { background-position: 0 320%; } }
.lr-step { display: flex; align-items: center; gap: 9px; min-height: 38px; font-size: 13px; color: var(--text-soft); position: relative; padding: 0 8px; border-radius: 8px; transition: background .2s var(--ease); }
.lr-step.lr-done { cursor: pointer; }
.lr-step.lr-done:hover { background: var(--surface-2); }
/* Persistent live pulse at the tail of a streaming timeline. Fills the gaps
   between tools (and the opening reasoning gap) so the run never looks frozen.
   Removed on fold. */
/* PLANNER-FIRST checklist block: the agent lays out the job before running it */
.lr-plan { position: relative; margin: 4px 0 6px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.lr-plan__title { font-size: 12.5px; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 6px; }
.lr-plan__steps { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 3px; }
.lr-plan__steps li { font-size: 12.5px; color: var(--text-muted); line-height: 1.45; }
/* The live head of the thread. It sits on the SAME rail as the tool nodes
   (their centers are at x=13 of .lr-steps, i.e. -33px from this row's content
   box), so it reads as the thread still being drawn, not a stray dot beside
   the text (Ahmed 2026-07-11: "make it emmersed... truly premium, Apple UX").
   Apple-calm: one small gradient core that breathes + a single soft halo that
   expands and fades. No hard surface ring, no text flicker. */
.lr-working { position: relative; display: flex; align-items: center; min-height: 38px; padding: 0 8px; font-size: 13px; color: var(--text-soft); letter-spacing: -0.005em; }
.lr-working::before { content: ""; position: absolute; left: -33px; top: 50%; transform: translateY(-50%); width: 12px; height: 12px; border-radius: 50%; background: var(--gradient-flat); animation: lrTipBreathe 2s ease-in-out infinite; }
.lr-working::after { content: ""; position: absolute; left: -35px; top: 50%; margin-top: -8px; width: 16px; height: 16px; border-radius: 50%; background: var(--gradient-flat); opacity: 0; animation: lrTipHalo 2s ease-out infinite; pointer-events: none; }
@keyframes lrTipBreathe { 0%,100% { transform: translateY(-50%) scale(.9); opacity: .82; } 50% { transform: translateY(-50%) scale(1); opacity: 1; } }
@keyframes lrTipHalo { 0% { transform: scale(.55); opacity: .3; } 70%,100% { transform: scale(1.85); opacity: 0; } }
.lr-node {
  position: absolute; left: -40px; top: 50%; transform: translateY(-50%);
  width: 26px; height: 26px; border-radius: 50%; z-index: 1;
  background: var(--surface); border: 1px solid var(--hairline-strong);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  animation: lrNodePop .45s cubic-bezier(0.34,1.4,0.44,1);
}
@keyframes lrNodePop { 0% { transform: translateY(-50%) scale(.72); } 100% { transform: translateY(-50%) scale(1); } }
.lr-node img { width: 14px; height: 14px; object-fit: contain; }
.lr-node .lr-gdot { width: 8px; height: 8px; border-radius: 50%; background: var(--gradient); }
.lr-badge {
  position: absolute; right: -4px; bottom: -4px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--surface); display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 2px rgba(0,0,0,0.15);
  animation: lrBadgeIn .4s cubic-bezier(0.34,1.4,0.44,1) .15s both;
}
@keyframes lrBadgeIn { from { transform: scale(0); } to { transform: scale(1); } }
.lr-check { width: 10px; height: 10px; }
.lr-check circle { fill: none; stroke: var(--ok); stroke-width: 1.6; stroke-dasharray: 44; stroke-dashoffset: 44; animation: lrDraw .45s var(--ease) forwards; }
.lr-check path { fill: none; stroke: var(--ok); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 14; stroke-dashoffset: 14; animation: lrDraw .35s .22s var(--ease) forwards; }
@keyframes lrDraw { to { stroke-dashoffset: 0; } }
.lr-step .lr-ms { margin-left: auto; font-size: 11px; color: var(--text-dim); font-variant-numeric: tabular-nums; font-family: ui-monospace, 'SF Mono', Menlo, monospace; white-space: nowrap; }
.lr-step .lr-chev { width: 11px; height: 11px; flex: none; opacity: 0; transition: opacity .2s var(--ease), transform .25s var(--ease); color: var(--text-dim); }
.lr-step.lr-done:hover .lr-chev { opacity: 1; }
.lr-step.lr-open .lr-chev { opacity: 1; transform: rotate(90deg); }
.lr-sdetail { overflow: hidden; max-height: 0; opacity: 0; transition: max-height .35s var(--ease), opacity .3s var(--ease); }
.lr-sdetail.lr-open { max-height: 260px; opacity: 1; overflow-y: auto; }
.lr-sdetail-inner { margin: 2px 0 10px 2px; padding: 2px 8px; display: flex; flex-direction: column; gap: 6px; }
.lr-drow { display: flex; align-items: baseline; gap: 9px; font-size: 11.5px; color: var(--text-muted); min-width: 0; }
.lr-drow code { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 11px; color: var(--text-soft); background: var(--surface-2); border: 1px solid var(--hairline); padding: 1px 6px; border-radius: 6px; white-space: nowrap; }
.lr-drow .lr-dres { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lr-fail { color: var(--bad); }
.lr-receipt {
  display: flex; align-items: center; gap: 8px; margin: 6px 0 10px;
  padding: 9px 13px; border: 1px solid var(--hairline); border-radius: 11px; background: var(--surface);
  font-size: 12.5px; color: var(--text-soft); animation: lrRise .45s cubic-bezier(0.34,1.4,0.44,1);
}
.lr-receipt .lr-check { width: 13px; height: 13px; flex: none; }
.lr-receipt a { color: var(--accent); font-weight: 500; margin-left: auto; cursor: pointer; font-size: 12px; white-space: nowrap; }
html.dark .lr-receipt a { color: #a884d4; }
/* Report-ready card (generate_report tool result) */
.lr-report-card {
  margin-top: 12px; border-radius: 14px; overflow: hidden;
  border: 1px solid var(--hairline); background: var(--surface);
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  animation: lrRise .45s cubic-bezier(0.34,1.4,0.44,1);
}
.lr-report-card__head {
  padding: 12px 16px 10px; border-bottom: 1px solid var(--hairline);
  display: flex; align-items: center; gap: 10px;
}
.lr-report-card__icon {
  width: 28px; height: 28px; border-radius: 8px; flex: none;
  background: var(--gradient); display: flex; align-items: center; justify-content: center;
}
.lr-report-card__icon svg { width: 13px; height: 13px; }
.lr-report-card__title { font-size: 13px; font-weight: 600; color: var(--text); line-height: 1.3; }
.lr-report-card__sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.lr-report-card__body { padding: 10px 16px 14px; display: flex; gap: 8px; flex-wrap: wrap; }
.lr-report-card__cta {
  display: inline-flex; align-items: center; gap: 6px; height: 31px; padding: 0 16px;
  border-radius: 999px; font-size: 12.5px; font-weight: 600; cursor: pointer;
  font-family: inherit; text-decoration: none; transition: box-shadow .2s, transform .2s;
  white-space: nowrap;
}
.lr-report-card__cta--primary {
  background: var(--gradient); color: #fff; border: 0;
  box-shadow: 0 4px 16px rgba(91,45,142,0.28);
}
.lr-report-card__cta--primary:hover { box-shadow: 0 6px 22px rgba(91,45,142,0.4); transform: translateY(-1px); }
.lr-report-card__cta--primary:active { transform: translateY(0); }
.lr-report-card__cta--secondary {
  background: transparent; border: 1px solid var(--hairline); color: var(--text-soft);
}
.lr-report-card__cta--secondary:hover { background: var(--surface-2); }
html.dark .lr-report-card { background: var(--surface); }
.lr-approval {
  position: relative; overflow: hidden;
  margin-top: 12px; border-radius: 16px; padding: 15px 17px;
  border: 1px solid transparent;
  background: color-mix(in srgb, var(--surface) 62%, transparent);
  -webkit-backdrop-filter: blur(26px) saturate(1.6);
  backdrop-filter: blur(26px) saturate(1.6);
  box-shadow: 0 6px 22px rgba(0,0,0,0.08), inset 0 1px 0 rgba(255,255,255,0.55);
}
.lr-approval::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(135deg, rgba(0,119,182,.55), rgba(91,45,142,.55), rgba(124,181,24,.55));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
}
html.dark .lr-approval { background: rgba(28,28,36,0.55); box-shadow: 0 8px 26px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.09); }
html.dark .lr-approval::before { background: linear-gradient(135deg, rgba(64,156,255,.45), rgba(168,132,212,.45), rgba(124,181,24,.45)); }
.lr-approval .lr-ah { font-size: 10.5px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--text-muted); }
.lr-approval .lr-at { font-size: 14px; font-weight: 600; margin-top: 6px; letter-spacing: -0.01em; color: var(--text); }
.lr-approval .lr-as { font-size: 12.5px; color: var(--text-muted); margin-top: 4px; line-height: 1.5; }
.lr-approval .lr-abtns { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.lr-approval .lr-aperm { color: var(--bad, #ef4444); }
@media (max-width: 520px) { .lr-approval .lr-abtns button { min-height: 44px; } }
.lr-approval .lr-awhy { background: none; border: none; padding: 0; margin-top: 8px; font-size: 12px; font-weight: 600; color: var(--accent); cursor: pointer; }
.lr-approval .lr-awhy-full { font-size: 12.5px; color: var(--text-muted); margin-top: 6px; line-height: 1.55; white-space: pre-line; max-height: 180px; overflow-y: auto; }
.lr-btn-approve { height: 31px; padding: 0 16px; border-radius: 999px; border: 0; background: var(--gradient); color: #fff; font-size: 12.5px; font-weight: 600; cursor: pointer; font-family: inherit; transition: box-shadow .25s var(--ease), transform .25s var(--ease); }
.lr-btn-approve:hover { box-shadow: 0 4px 16px rgba(91,45,142,0.4); transform: translateY(-1px); }
.lr-btn-approve:disabled { opacity: .55; cursor: default; transform: none; box-shadow: none; }
.lr-btn-approve.lr-btn-perm { background: var(--bad, #ef4444); }
.lr-btn-approve.lr-btn-perm:hover { box-shadow: 0 4px 16px rgba(239,68,68,0.35); }
.lr-btn-decline { height: 31px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--hairline); background: transparent; font-size: 12.5px; color: var(--text-soft); cursor: pointer; font-family: inherit; }
.lr-btn-decline:hover { background: var(--surface-2); }
.lr-approval.lr-applied::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(115deg, transparent 32%, rgba(255,255,255,0.38) 50%, transparent 68%);
  background-size: 250% 100%; background-position: 130% 0;
  animation: lrSheen .95s ease .15s 1 both;
}
html.dark .lr-approval.lr-applied::after { background: linear-gradient(115deg, transparent 32%, rgba(255,255,255,0.14) 50%, transparent 68%); background-size: 250% 100%; background-position: 130% 0; }
@keyframes lrSheen { to { background-position: -60% 0; } }
.lr-applied-row { display: flex; align-items: flex-start; gap: 13px; }
.lr-applied-badge {
  position: relative; flex: none; width: 32px; height: 32px; border-radius: 50%; margin-top: 2px;
  background: linear-gradient(150deg, #14a05a, #0a7c43);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px rgba(10,124,67,0.35), inset 0 1px 0 rgba(255,255,255,0.25);
  animation: lrBadgeIn .45s cubic-bezier(0.34,1.4,0.44,1) both;
}
html.dark .lr-applied-badge { background: linear-gradient(150deg, #2fbf72, #148a4e); box-shadow: 0 4px 16px rgba(52,194,120,0.3), inset 0 1px 0 rgba(255,255,255,0.18); }
.lr-applied-badge svg { width: 15px; height: 15px; }
.lr-applied-badge svg path { fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 14; stroke-dashoffset: 14; animation: lrDraw .35s .2s var(--ease) forwards; }
.lr-applied-badge::after { content: ""; position: absolute; inset: -7px; border-radius: 50%; border: 1.5px solid var(--ok); opacity: 0; animation: lrHalo .9s ease-out .15s 1 forwards; }
@keyframes lrHalo { 0% { opacity: .7; transform: scale(.72); } 100% { opacity: 0; transform: scale(1.18); } }
.lr-applied-link { display: inline-block; margin-top: 8px; font-size: 12px; font-weight: 500; color: var(--accent); cursor: pointer; }
html.dark .lr-applied-link { color: #a884d4; }
.lr-applied-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.lr-doc-chip { display: inline-flex; align-items: center; gap: 7px; margin: 0 6px 8px 0; height: 27px; padding: 0 10px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--hairline); font-size: 12px; color: var(--text-soft); }
.lr-doc-chip button { border: 0; background: none; color: var(--text-dim); cursor: pointer; font-size: 13px; line-height: 1; padding: 0; }
.lr-doc-chip button:hover { color: var(--bad); }
.lr-scrim { position: fixed; inset: 0; z-index: 240; background: rgba(0,0,0,.35); opacity: 0; pointer-events: none; transition: opacity .3s var(--ease); }
.lr-scrim.lr-on { opacity: 1; pointer-events: auto; }
.lr-sheet {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 94vw); z-index: 241;
  background: var(--surface); border-left: 1px solid var(--hairline); box-shadow: var(--shadow-lg);
  transform: translateX(102%); transition: transform .38s var(--ease); padding: 22px; overflow-y: auto;
}
.lr-sheet.lr-open { transform: none; }
.lr-sheet h3 { font-size: 16px; font-weight: 650; letter-spacing: -0.02em; margin: 0; color: var(--text); }
.lr-sheet .lr-ssub { font-size: 12.5px; color: var(--text-muted); margin-top: 4px; line-height: 1.5; }
.lr-skill-row { padding: 12px 0; border-bottom: 1px solid var(--hairline-soft); }
.lr-skill-head { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; }
.lr-skill-head .lr-sname { font-size: 13.5px; font-weight: 600; color: var(--text); }
.lr-skill-head .lr-sdesc { font-size: 12px; color: var(--text-muted); margin-top: 3px; line-height: 1.5; }
.lr-switch { margin-left: auto; flex: none; width: 34px; height: 20px; border-radius: 999px; background: var(--surface-3); position: relative; border: 0; cursor: pointer; transition: background .25s var(--ease); }
.lr-switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .25s var(--ease); }
.lr-switch.lr-on { background: var(--accent); }
.lr-switch.lr-on::after { transform: translateX(14px); }
.lr-skill-edit { display: none; margin-top: 12px; }
.lr-skill-row.lr-editing .lr-skill-edit { display: block; }
.lr-skill-edit label { display: block; font-size: 11.5px; font-weight: 600; color: var(--text-soft); margin: 10px 0 4px; }
.lr-skill-edit input, .lr-skill-edit textarea { width: 100%; box-sizing: border-box; background: var(--surface-2); border: 1px solid var(--hairline); border-radius: 9px; color: var(--text); font: inherit; font-size: 13px; padding: 8px 10px; outline: none; }
.lr-skill-edit input:focus, .lr-skill-edit textarea:focus { border-color: var(--accent); }
.lr-skill-edit textarea { min-height: 110px; resize: vertical; }
.lr-skill-actions { display: flex; gap: 8px; margin-top: 12px; align-items: center; }
.lr-skill-save { height: 30px; padding: 0 15px; border-radius: 999px; border: 0; background: var(--gradient); color: #fff; font-size: 12.5px; font-weight: 600; cursor: pointer; font-family: inherit; }
.lr-skill-gen { height: 30px; padding: 0 13px; border-radius: 999px; border: 1px solid var(--hairline); background: transparent; font-size: 12.5px; color: var(--text-soft); cursor: pointer; font-family: inherit; }
.lr-skill-gen:hover, .lr-skill-save:hover { filter: brightness(1.05); }
.lr-skill-del { margin-left: auto; border: 0; background: none; color: var(--text-muted); font-size: 12px; cursor: pointer; font-family: inherit; }
.lr-skill-del:hover { color: var(--bad); }
.lr-new-skill { margin-top: 14px; width: 100%; height: 36px; border-radius: 10px; border: 1px dashed var(--hairline-strong); background: transparent; color: var(--text-muted); font-size: 13px; cursor: pointer; font-family: inherit; }
.lr-new-skill:hover { color: var(--text-soft); border-color: var(--text-dim); }
/* starter gallery */
.lr-starters { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 6px; margin-top: 4px; -webkit-overflow-scrolling: touch; }
.lr-starter-card { flex: 0 0 200px; border: 1px solid var(--hairline); border-radius: 12px; padding: 11px 12px; background: var(--surface); }
.lr-starter-card .lr-sc-name { font-size: 12.5px; font-weight: 600; color: var(--text); }
.lr-starter-card .lr-sc-desc { font-size: 11px; color: var(--text-muted); margin-top: 3px; line-height: 1.45; height: 46px; overflow: hidden; }
.lr-starter-card .lr-sc-add { margin-top: 8px; height: 26px; padding: 0 12px; border-radius: 999px; border: 0; background: var(--gradient); color: #fff; font-size: 11.5px; font-weight: 600; cursor: pointer; font-family: inherit; }
.lr-starter-card .lr-sc-add:disabled { opacity: .5; cursor: default; }
/* reference files on a skill */
.lr-files { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.lr-file-chip { display: inline-flex; align-items: center; gap: 7px; height: 26px; padding: 0 10px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--hairline); font-size: 12px; color: var(--text-soft); }
.lr-file-chip svg { width: 12px; height: 12px; opacity: .6; }
.lr-file-chip button { border: 0; background: none; color: var(--text-dim); cursor: pointer; font-size: 13px; line-height: 1; padding: 0; }
.lr-file-chip button:hover { color: var(--bad); }
.lr-file-add { height: 26px; padding: 0 11px; border-radius: 8px; border: 1px dashed var(--hairline-strong); background: transparent; color: var(--text-muted); font-size: 12px; cursor: pointer; font-family: inherit; }
.lr-file-add:hover { color: var(--text-soft); border-color: var(--text-dim); }
.lr-file-menu { margin-top: 6px; border: 1px solid var(--hairline); border-radius: 10px; overflow: hidden; }
.lr-file-menu button { display: block; width: 100%; text-align: left; padding: 9px 11px; border: 0; border-bottom: 1px solid var(--hairline-soft); background: var(--surface); color: var(--text-soft); font-size: 12.5px; cursor: pointer; font-family: inherit; }
.lr-file-menu button:last-child { border-bottom: 0; }
.lr-file-menu button:hover { background: var(--surface-2); }
.lr-file-menu .lr-file-empty { color: var(--text-muted); font-size: 12px; padding: 10px 11px; }
.lr-skill-edit .lr-hint { font-size: 11px; color: var(--text-dim); margin-top: 3px; line-height: 1.5; }
.lr-sec-h { font-size: 13.5px; font-weight: 650; letter-spacing: -0.01em; color: var(--text); }
.lr-rule-row { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; border-bottom: 1px solid var(--hairline-soft); }
.lr-rule-text { flex: 1; font-size: 12.5px; color: var(--text-soft); line-height: 1.5; }
.lr-rule-del { border: 0; background: none; color: var(--text-dim); cursor: pointer; font-size: 14px; line-height: 1; padding: 1px 2px; }
.lr-rule-del:hover { color: var(--bad); }
.lr-rule-in { flex: 1; box-sizing: border-box; background: var(--surface-2); border: 1px solid var(--hairline); border-radius: 9px; color: var(--text); font: inherit; font-size: 12.5px; padding: 8px 10px; outline: none; }
.lr-rule-in:focus { border-color: var(--accent); }
.lr-rule-add { height: 33px; padding: 0 14px; border-radius: 999px; border: 0; background: var(--gradient); color: #fff; font-size: 12.5px; font-weight: 600; cursor: pointer; font-family: inherit; }
.lr-safety-note { margin-top: 14px; font-size: 11.5px; color: var(--text-dim); line-height: 1.5; }
@media (prefers-reduced-motion: reduce) {
  .lr-enter, .lr-node, .lr-badge, .lr-receipt, .lr-applied-badge { animation-duration: .01s !important; }
  /* Keep the live tip visible but still: a steady core, no halo pulse. */
  .lr-working::before { animation: none !important; opacity: 1 !important; transform: translateY(-50%) !important; }
  .lr-working::after { display: none !important; }
}

/* ── View mode toggle (Simple / Advanced, Ahmed 2026-07-13) ──
   One text pill instanced in the topbar and the chat bar. It SHOWS the
   current mode; clicking switches to the other (tooltip carries the action).
   Both instances sync via applyViewMode -> .vm-toggle textContent. */
.vm-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: transparent;
  border: 1px solid var(--hairline);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 120ms var(--ease), color 120ms var(--ease);
}
.vm-toggle:hover { color: var(--text); background: var(--surface-2); }
@media (max-width: 440px) {
  /* Hide Brand Setup text label on mobile; gear icon + title attr remain */
  .toolbtn__label { display: none; }
}

/* ── Basic mode (Simple view). ADDITIVE hide/simplify rules ONLY, every
   selector scoped .app.is-basic-mode (qa-view-mode.js enforces this).
   applyViewMode() is the only writer of the class. !important is deliberate:
   renderDraftsTable() sets inline display on #draftsTable/#apprBoard and the
   stylesheet must win in basic mode. Advanced mode is byte-identical. */
.app.is-basic-mode .navrow[data-nav-search],
.app.is-basic-mode .navrow[data-nav="brands"],
.app.is-basic-mode .auto-tab[data-auto-tab="command-center"],
.app.is-basic-mode .auto-tab[data-auto-tab="memory"],
.app.is-basic-mode #agentTemplatesHead,
.app.is-basic-mode #agentTemplatesSub,
.app.is-basic-mode #agentTemplates,
.app.is-basic-mode #draftsTable,
.app.is-basic-mode #draftsBulk,
.app.is-basic-mode .dv5-kbd-hint,
.app.is-basic-mode .drafts__search-kbd,
.app.is-basic-mode #securityApiKeyRow,
.app.is-basic-mode button[data-ps-event-click="workspace-004-16"] { display: none !important; }
.app.is-basic-mode #apprBoard { display: block !important; }
.app.is-basic-mode #reportsKpis .kpi:nth-child(n+5) { display: none !important; }
/* Chat-level advanced levers hidden in Simple mode */
.app.is-basic-mode #modelPickerPage,
.app.is-basic-mode #modelPickerDrawer,
.app.is-basic-mode #lrSkillsBtn { display: none !important; }
/* Approval card guardrail field rows hidden in Simple mode */
.app.is-basic-mode .dv5-guardrail-list { display: none !important; }
/* Simple agents shelf (Ahmed 2026-07-13): switch-only cards. Autonomy badges,
   guardrail lines, and the build-your-own card are Advanced concepts. */
.app.is-basic-mode .agent-card__bandwrap,
.app.is-basic-mode .agent-card__guards,
.app.is-basic-mode .cap,
.app.is-basic-mode .agent-card--build { display: none !important; }
/* Slice 3 IA collapse: Media Buyer / Approvals / Activity in Simple mode. Brand
   Knowledge folds into the Media Buyer's Account Brain; Activity and the Account
   Brain summary are Simple-only. Advanced keeps Command Center + the per-agent
   history drawer and stays byte-identical (its Activity tab is hidden, so the
   view is unreachable there). */
.app.is-basic-mode .auto-tab[data-auto-tab="brand-knowledge"] { display: none !important; }
/* Activity tab + Account Brain are Simple-only: hidden by default (so Advanced
   stays byte-identical without the class) and revealed only in Simple mode. */
.auto-tab[data-auto-tab="activity"], #accountBrainCard { display: none; }
.app.is-basic-mode .auto-tab[data-auto-tab="activity"] { display: inline-block; }
.app.is-basic-mode #accountBrainCard { display: block; }

/* ==================== PS SENSE THEME, Slice 1 (2026-07-16) ====================
   Approved calm-glass re-skin from the Sense complete-app mockup. VISUAL ONLY:
   ground, chrome, depth, radii. Zero JS or structural changes; every selector
   here overrides existing paint, so features are untouched. Revert = this block.
   Slice 2 (one-buyer Home on the Agents tab) comes separately. */

/* -- softened depth + hairlines (tokens) -- */
:root {
  --hairline: #e4e0ea;
  --hairline-soft: #eeeaf3;
  --hairline-strong: #d6d0df;
  --surface-2: #f4f2f8;
  --surface-3: #ebe8f1;
  --shadow-sm: 0 2px 8px rgba(38,24,66,.05), 0 1px 2px rgba(38,24,66,.04);
  --shadow-md: 0 8px 26px rgba(38,24,66,.08), 0 2px 6px rgba(38,24,66,.05);
  --shadow-lg: 0 24px 60px rgba(38,24,66,.14), 0 8px 20px rgba(38,24,66,.07);
  --shadow-focus: 0 0 0 3px rgba(91,45,142,.16);
}
html.dark {
  --hairline: #2a2735;
  --hairline-soft: #201d2b;
  --hairline-strong: #363244;
}

/* -- the ground: calm pastel with brand pools (light), sanctioned near-black
      with pools (dark). Painted on html; body + page wrappers go transparent. -- */
html {
  background:
    radial-gradient(1100px 720px at 6% -4%, rgba(0,119,182,.10), transparent 52%),
    radial-gradient(1000px 820px at 102% 26%, rgba(91,45,142,.10), transparent 54%),
    radial-gradient(1150px 760px at 68% 108%, rgba(124,181,24,.08), transparent 52%),
    linear-gradient(160deg, #eef1f6 0%, #f4eef7 46%, #eff3ec 100%);
  background-attachment: fixed;
}
html.dark {
  background:
    radial-gradient(52% 46% at 14% 6%, rgba(0,119,182,.26), transparent 56%),
    radial-gradient(58% 54% at 84% 96%, rgba(91,45,142,.28), transparent 60%),
    radial-gradient(48% 54% at 106% 46%, rgba(124,181,24,.12), transparent 54%),
    #0A0A16;
  background-attachment: fixed;
}
body,
.main,
.automations-page, .settings-page, .allchats-page,
.brands-page, .chats-page, .mcp-page {
  background: transparent;
}

/* -- frosted chrome: sidebar + topbar only (blur kept off cards for perf) -- */
.side {
  background: rgba(255,255,255,.58);
  border-right: 1px solid rgba(255,255,255,.75);
  backdrop-filter: blur(22px) saturate(1.3);
  -webkit-backdrop-filter: blur(22px) saturate(1.3);
}
html.dark .side {
  background: rgba(22,18,32,.55);
  border-right-color: rgba(255,255,255,.07);
}
.topbar {
  background: rgba(255,255,255,.45);
  border-bottom: 1px solid rgba(120,100,150,.10);
  backdrop-filter: blur(18px) saturate(1.25);
  -webkit-backdrop-filter: blur(18px) saturate(1.25);
}
html.dark .topbar {
  background: rgba(14,12,22,.55);
  border-bottom-color: rgba(255,255,255,.06);
}

/* -- calm glass cards: soft white surfaces, light borders, generous radius -- */
.agent-card, .agent-flagship, .mcp-card, .conn-tile, .autos__table, .sk-card {
  background: rgba(255,255,255,.66);
  border-color: rgba(255,255,255,.85);
  border-radius: 18px;
  box-shadow: 0 8px 26px rgba(38,24,66,.06);
}
.agent-card:hover { border-color: rgba(255,255,255,.95); box-shadow: 0 16px 38px rgba(38,24,66,.11); }
html.dark .agent-card, html.dark .agent-flagship, html.dark .mcp-card,
html.dark .conn-tile, html.dark .autos__table, html.dark .sk-card {
  background: rgba(24,20,34,.55);
  border-color: rgba(255,255,255,.07);
  box-shadow: 0 8px 26px rgba(0,0,0,.35);
}
/* ================== end PS SENSE THEME, Slice 1 ================== */

/* ==================== PS SENSE, Slice 2 (2026-07-16): one-buyer Home ====================
   The Agents tab leads with the media buyer hero (real Growth Run wiring), a real
   pending-approvals strip, and the specialist roster folded into three family cards.
   Legacy flagship cards stay in DOM (functions untouched) but hidden. */
html {
  background:
    radial-gradient(1100px 720px at 6% -4%, rgba(0,119,182,.16), transparent 52%),
    radial-gradient(1000px 820px at 102% 26%, rgba(91,45,142,.15), transparent 54%),
    radial-gradient(1150px 760px at 68% 108%, rgba(124,181,24,.12), transparent 52%),
    linear-gradient(160deg, #eaeef5 0%, #f2ebf7 46%, #ecf2e9 100%);
  background-attachment: fixed;
}
.ps-legacy { display: none !important; }
.ps-hero {
  position: relative; border-radius: 24px; padding: 34px 30px 24px; margin: 2px 0 14px;
  background:
    radial-gradient(circle at 50% 0%, rgba(91,45,142,.05), transparent 60%),
    radial-gradient(rgba(91,45,142,.05) 1px, transparent 1.5px) 0 0/14px 14px,
    rgba(255,255,255,.62);
  border: 1px solid rgba(255,255,255,.85);
  box-shadow: 0 14px 44px rgba(38,24,66,.08);
  display: flex; flex-direction: column; align-items: center; text-align: center;
}
html.dark .ps-hero { background: radial-gradient(circle at 50% 0%, rgba(140,92,196,.08), transparent 60%), radial-gradient(rgba(140,92,196,.07) 1px, transparent 1.5px) 0 0/14px 14px, rgba(24,20,34,.55); border-color: rgba(255,255,255,.08); }
.ps-hero__orb {
  width: 58px; height: 58px; border-radius: 50%; margin-bottom: 14px; position: relative;
  background: radial-gradient(circle at 33% 27%, #f0f9ff 0%, #86c1e8 16%, #0077B6 40%, #5B2D8E 74%, #43206e 100%);
  box-shadow: inset -7px -9px 18px rgba(40,10,70,.5), inset 5px 5px 12px rgba(255,255,255,.45), 0 8px 22px rgba(91,45,142,.32);
}
.ps-hero__orb::after { content: ''; position: absolute; top: 9px; left: 14px; width: 17px; height: 10px; border-radius: 50%; background: rgba(255,255,255,.72); filter: blur(2.4px); transform: rotate(-22deg); }
.ps-hero__title { font-size: 24px; font-weight: 500; letter-spacing: -0.02em; margin: 0 0 18px; color: var(--text-soft); }
.ps-hero__title b { font-weight: 750; color: var(--text); }
.ps-hero__composer {
  display: flex; align-items: center; gap: 8px; width: 100%; max-width: 640px;
  background: rgba(255,255,255,.8); border: 1px solid rgba(255,255,255,.95);
  border-radius: 16px; padding: 6px 6px 6px 18px; box-shadow: 0 6px 18px rgba(38,24,66,.07);
}
html.dark .ps-hero__composer { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.1); }
.ps-hero__composer input { flex: 1; border: 0; background: transparent; font: inherit; font-size: 14px; color: var(--text); outline: none; padding: 9px 0; min-width: 0; }
.ps-hero__composer input::placeholder { color: var(--text-dim); }
.ps-hero__send { width: 42px; height: 42px; border-radius: 12px; border: 0; background: var(--gradient-flat); color: #fff; display: grid; place-items: center; cursor: pointer; flex-shrink: 0; }
.ps-hero__send svg { width: 18px; height: 18px; }
.ps-hero__send:hover { filter: brightness(1.06); }
.ps-hero__chips { display: flex; align-items: center; justify-content: center; gap: 9px; margin-top: 14px; flex-wrap: wrap; }
.ps-goalchip { border: 1px solid var(--hairline); background: rgba(255,255,255,.6); color: var(--text-soft); font: 600 12.5px 'Inter', sans-serif; padding: 8px 15px; border-radius: 999px; cursor: pointer; transition: background .15s, color .15s; }
.ps-goalchip:hover { background: #fff; color: var(--text); }
html.dark .ps-goalchip { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.1); }
html.dark .ps-goalchip:hover { background: rgba(255,255,255,.12); color: var(--text); }
.ps-hero__note { flex-basis: 100%; font-size: 11.5px; color: var(--text-soft); margin-top: 4px; }
.ps-strip {
  display: flex; align-items: center; gap: 14px; border-radius: 18px; padding: 13px 16px; margin: 0 0 14px;
  background: rgba(255,255,255,.66); border: 1px solid rgba(255,255,255,.85); box-shadow: 0 8px 26px rgba(38,24,66,.06);
}
html.dark .ps-strip { background: rgba(24,20,34,.55); border-color: rgba(255,255,255,.07); }
.ps-strip__ic { width: 38px; height: 38px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--hairline); color: var(--blue, #0077B6); display: grid; place-items: center; flex-shrink: 0; }
.ps-strip__ic svg { width: 18px; height: 18px; }
.ps-strip__txt { flex: 1; font-size: 13.5px; color: var(--text-soft); }
.ps-strip__txt b { font-weight: 750; color: var(--text); font-variant-numeric: tabular-nums; }
/* Family filter pill row: a shortcut on top of the .ps-fam accordion below,
   never a replacement for its own expand/collapse. Clicking scrolls to and
   opens that family section; existing default open/closed state is untouched. */
.fam-filter { display: flex; gap: 6px; padding: 5px; border-radius: 999px; background: rgba(255,255,255,.55); border: 1px solid rgba(255,255,255,.8); box-shadow: 0 8px 26px rgba(38,24,66,.05); backdrop-filter: blur(20px) saturate(1.4); -webkit-backdrop-filter: blur(20px) saturate(1.4); margin-bottom: 14px; width: fit-content; flex-wrap: wrap; }
html.dark .fam-filter { background: rgba(24,20,34,.5); border-color: rgba(255,255,255,.07); }
.fam-filter__pill { border: 0; background: transparent; font: 600 12.5px/1 'Inter', sans-serif; letter-spacing: -0.01em; color: var(--text-soft); padding: 8px 14px; border-radius: 999px; cursor: pointer; transition: background 150ms; display: flex; align-items: center; gap: 6px; }
.fam-filter__pill:hover { background: rgba(255,255,255,.45); }
html.dark .fam-filter__pill:hover { background: rgba(255,255,255,.08); }
.fam-filter__pill.is-active { background: var(--surface); color: var(--text); box-shadow: 0 4px 12px rgba(78,66,120,.14); }
.fam-filter__pill span { background: var(--text); color: var(--canvas, var(--surface)); font-size: 10px; font-weight: 700; font-variant-numeric: tabular-nums; padding: 2px 6px; border-radius: 999px; }
.fam-filter__pill.is-active span { background: var(--accent); color: #fff; }
@media (max-width: 560px) { .fam-filter { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; scrollbar-width: none; } .fam-filter::-webkit-scrollbar { display: none; } .fam-filter__pill { flex-shrink: 0; } }
.ps-fam { border-radius: 20px; margin: 0 0 12px; background: rgba(255,255,255,.55); border: 1px solid rgba(255,255,255,.8); box-shadow: 0 8px 26px rgba(38,24,66,.05); overflow: hidden; }
html.dark .ps-fam { background: rgba(24,20,34,.5); border-color: rgba(255,255,255,.07); }
.ps-fam__head { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: transparent; font: inherit; text-align: left; padding: 15px 18px; cursor: pointer; }
.ps-fam__label { font-size: 14px; font-weight: 750; letter-spacing: -0.01em; color: var(--text); }
.ps-fam__sub { font-size: 12px; color: var(--text-muted); flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 900px) { .ps-fam__head { flex-wrap: wrap; } .ps-fam__n { margin-left: auto; } .ps-fam__sub { order: 1; flex-basis: 100%; white-space: normal; } }
.ps-fam__n { font-size: 11.5px; font-weight: 650; color: var(--text-dim); white-space: nowrap; }
.ps-fam__chev { width: 16px; height: 16px; color: var(--text-dim); transition: transform .18s; flex-shrink: 0; }
.ps-fam.is-open .ps-fam__chev { transform: rotate(180deg); }
.ps-fam__body { display: none; padding: 0 14px 14px; }
.ps-fam.is-open .ps-fam__body { display: block; }
.ps-fam__body .auto-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1280px) { .ps-fam__body .auto-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .ps-fam__body .auto-grid { grid-template-columns: 1fr; } .ps-hero { padding: 26px 18px 20px; } .ps-hero__title { font-size: 20px; } }
.ps-hirerow { display: flex; align-items: center; gap: 13px; border-radius: 18px; padding: 13px 16px; margin: 2px 0 12px; background: rgba(255,255,255,.55); border: 1px solid rgba(255,255,255,.8); }
html.dark .ps-hirerow { background: rgba(24,20,34,.5); border-color: rgba(255,255,255,.07); }
.ps-hirerow__t { flex: 1; font-size: 13px; color: var(--text-soft); }
.ps-hirerow__t b { font-weight: 700; color: var(--text); }
/* ================== end PS SENSE, Slice 2 ================== */
/* Reporting v2: Campaigns, "Where your leads come from", creatives scope note. Only the app's own
   tokens and classes (.sec, .card, .tbl, .trend-sel, .creatives-filter-pill) plus these small gaps. */
#creativesFilters .creatives-filter-pill.active { color: var(--surface); }
.lds-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.lds-controls .creatives-filter-pill { min-height: 28px; padding: 4px 11px; font-size: 12px; color: var(--text-soft); }
.lds-controls .creatives-filter-pill.active { color: var(--surface); }
.lds-controls .creatives-filter-pill img { width: 12px; height: 12px; object-fit: contain; }
.lds-controls button:focus-visible, .lds-controls select:focus-visible, .lds-q:focus-visible, .lds-more:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#leadsSection .tbl td, #leadsSection .tbl th { white-space: nowrap; }
#leadsSection .tbl td:first-child { white-space: normal; }
#leadsSection .lds-grid td:first-child { white-space: nowrap; }
#leadsSection .tbl__name > span { display: inline-flex; flex-wrap: wrap; align-items: baseline; column-gap: 8px; }
.lds-sub { display: block; flex-basis: 100%; font-size: 11.5px; font-weight: 400; color: var(--text-muted); margin-top: 1px; }
.lds-tag { font-size: 11px; font-weight: 600; color: var(--accent); }
.lds-dim { color: var(--text-muted); font-weight: 400; }
.lds-row { cursor: pointer; }
.lds-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.lds-row.is-open td { background: var(--surface-2); border-bottom-color: transparent; }
.lds-detail td { background: var(--surface-2); padding-top: 0 !important; }
.lds-detail__grid { display: flex; flex-wrap: wrap; gap: 8px 28px; padding: 2px 0 12px 22px; font-size: 12px; }
.lds-detail__grid span { color: var(--text-muted); margin-right: 6px; }
.lds-detail__grid b { font-weight: 600; color: var(--text); }
.lds-total td { font-weight: 700; border-top: 1px solid var(--hairline); border-bottom: 0; }
.lds-of { display: none; }
.lds-note { font-size: 12px; color: var(--text-muted); padding: 2px 0 12px; }
.lds-more { display: block; width: 100%; padding: 10px 0 12px; background: none; border: 0; border-top: 1px solid var(--hairline-soft); font: inherit; font-size: 12px; font-weight: 600; color: var(--accent); cursor: pointer; text-align: left; }
.lds-subhead { font-size: 13.5px; font-weight: 600; letter-spacing: -0.01em; margin: 20px 0 2px; }
.lds-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.lds-wowline { font-size: 12.5px; color: var(--text-soft); padding: 12px 0 4px; }
.lds-wowline b { color: var(--text); font-weight: 600; }
.lds-up { color: var(--ok); font-weight: 600; } .lds-dn { color: var(--bad); font-weight: 600; } .lds-flat { color: var(--text-muted); font-weight: 500; }
.lds-chart-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 0 4px; flex-wrap: wrap; }
.lds-legend { display: inline-flex; gap: 12px; font-size: 11px; color: var(--text-muted); }
.lds-legend span { display: inline-flex; align-items: center; gap: 5px; }
.lds-legend i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
.lds-chart { width: 100%; height: 150px; display: block; margin-bottom: 6px; }
.lds-foot { font-size: 11.5px; color: var(--text-muted); margin-top: 10px; line-height: 1.5; }
.lds-nw { white-space: nowrap; }
.lds-q { position: relative; font: inherit; font-size: 10.5px; font-weight: 700; width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--hairline-strong); background: var(--surface); color: var(--text-muted); cursor: pointer; margin-left: 5px; vertical-align: 1px; padding: 0; }
.lds-help { display: block; margin-top: 6px; max-width: 760px; }
.lds-help[hidden] { display: none; }
.lds-fresh { font-size: 11px; color: var(--text-soft); font-weight: 600; white-space: nowrap; }
.lds-cre-note { font-size: 12px; color: var(--text-muted); margin: -6px 0 12px; }
#ldsTip { position: fixed; pointer-events: none; z-index: 400; background: var(--text); color: var(--surface); border-radius: 8px; padding: 8px 10px; font-size: 12px; line-height: 1.5; box-shadow: var(--shadow-md); display: none; min-width: 140px; font-variant-numeric: tabular-nums; }
#ldsTip .t { font-weight: 700; margin-bottom: 2px; } #ldsTip .r { display: flex; justify-content: space-between; gap: 14px; } #ldsTip .r span:first-child { opacity: .72; }
#ldsTip .r--sum { margin-top: 3px; padding-top: 3px; border-top: 1px solid rgba(128,128,140,.35); font-weight: 600; }
.lds-phone { display: none; }
.lds-card { padding: 12px 0; border-bottom: 1px solid var(--hairline-soft); }
.lds-card .tbl__name { font-weight: 600; }
.lds-card__tags, .lds-card__sub { padding-left: 22px; margin-top: 2px; }
.lds-card__sub { font-size: 11.5px; color: var(--text-muted); }
.lds-card__line { font-size: 12.5px; color: var(--text-soft); margin-top: 4px; padding-left: 22px; }
.lds-card__line b { color: var(--text); }
.lds-card .lds-detail__grid { padding: 8px 0 0 22px; gap: 6px 18px; }
.lds-card--total { border-bottom: 0; }
.lds-card--total .lds-card__line { padding-left: 0; }
html.dark .lds-tag, html.dark .lds-more { color: #b591e0; }
@media (max-width: 560px) {
  .lds-desk { display: none; } .lds-phone { display: block; }
  #leadsSection .sec__head { flex-wrap: wrap; align-items: flex-start; }
  .lds-controls { width: 100%; justify-content: space-between; }
  .lds-controls .creatives-filter-pill { min-height: 44px; padding: 6px 12px; }
  .lds-controls .trend-sel { min-height: 44px; font-size: 13px; }
  .lds-q { width: 24px; height: 24px; }
  .lds-q::after { content: ''; position: absolute; inset: -10px; }
  .lds-hide-sm { display: none; }
  .lds-of { display: block; font-size: 11px; font-weight: 400; color: var(--text-muted); }
  .lds-total .lds-of { font-weight: 400; }
  #ldsBody { padding-left: 14px !important; padding-right: 14px !important; }
  #leadsSection .tbl { font-size: 12px; }
  #leadsSection .tbl th, #leadsSection .tbl td { padding-right: 10px; }
  #leadsSection .tbl th { font-size: 9.5px; letter-spacing: .04em; }
  #leadsSection .tbl td:first-child { white-space: nowrap; }
}

/* v3: summary, chart switch, open day, week switch, verdict */
.lds-summary__s { font-size: 14px; line-height: 1.5; color: var(--text); margin: 0 0 6px; }
.lds-summary__s b { font-weight: 600; }
.lds-facts { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; font-size: 12.5px; color: var(--text-soft); margin-bottom: 12px; }
.lds-facts b { color: var(--text); font-weight: 600; }
.lds-facts i { color: var(--text-dim); font-style: normal; }
.lds-watch { color: var(--warn-strong, #b45309); }
.lds-watch b { color: var(--warn-strong, #b45309); }
.lds-seg { display: inline-flex; background: var(--surface-2); border-radius: 8px; padding: 2px; gap: 2px; }
.lds-seg button { font: inherit; font-size: 12px; font-weight: 500; border: 0; background: transparent; color: var(--text-soft); padding: 5px 10px; border-radius: 6px; cursor: pointer; }
.lds-seg button.on { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: var(--shadow-xs); }
.lds-legend i.line { width: 14px; height: 0; border-top: 2px solid var(--text-soft); border-radius: 0; }
.lds-dayrow { cursor: pointer; }
.lds-dayrow:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.lds-caret { display: inline-block; width: 13px; color: var(--text-muted); transition: transform 120ms; }
.lds-dayrow.is-open .lds-caret { transform: rotate(90deg); }
.lds-dayrow.is-open td { background: var(--surface-2); }
.lds-dayc td { background: var(--surface-2); font-size: 12px; color: var(--text-soft); }
.lds-dayc td:first-child { padding-left: 14px; }
.lds-subhead { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.lds-verdict { font-size: 13.5px; color: var(--text); margin: 2px 0 8px; line-height: 1.5; }
.lds-verdict b { font-weight: 600; }
@media (max-width: 560px) { .lds-seg button { min-height: 36px; } .lds-summary__s { font-size: 13.5px; } .lds-facts { flex-direction: column; gap: 3px; } .lds-facts i { display: none; } }

/* "Where your leads come from" */
.geo-controls { display: flex; align-items: center; gap: 10px; }
.geo-controls .creatives-filter-pill { min-height: 28px; padding: 4px 11px; font-size: 12px; color: var(--text-soft); }
.geo-controls .creatives-filter-pill img { width: 12px; height: 12px; object-fit: contain; }
.geo-controls button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.geo-hint { font-size: 11.5px; color: var(--text-muted); padding: 2px 0 12px; }
.geo-controls .creatives-filter-pill.active { color: var(--surface); }
#geoSection .tbl td, #geoSection .tbl th { white-space: nowrap; }
.geo-name { display: flex; align-items: baseline; gap: 6px; font-weight: 500; }
.geo-n { flex: 1; min-width: 0; }
.geo-tag { margin-left: 8px; }
.geo-caret { display: inline-block; width: 12px; color: var(--text-muted); transition: transform 120ms; }
.geo-row { cursor: pointer; }
.geo-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.geo-row.is-open .geo-caret { transform: rotate(90deg); }
.geo-row.is-open td { background: var(--surface-2); }
.geo-region td { background: var(--surface-2); font-size: 12px; color: var(--text-soft); }
.geo-region td:first-child { padding-left: 20px; }
.geo-lead { display: inline-flex; align-items: center; gap: 10px; justify-content: flex-end; }
.geo-bar { display: inline-block; width: 90px; height: 6px; background: var(--surface-3); border-radius: 3px; overflow: hidden; }
.geo-bar i { display: block; height: 100%; background: var(--text-soft); border-radius: 3px; }
.geo-dim { color: var(--text-dim); font-weight: 400; }
.geo-foot { font-size: 11.5px; color: var(--text-muted); margin-top: 10px; line-height: 1.5; max-width: 820px; }
@media (max-width: 560px) {
  #geoSection .sec__head { flex-wrap: wrap; }
  .geo-hide-sm { display: none; }
  .geo-bar { display: none; }
  .geo-tag { display: block; margin-left: 0; }
  .geo-controls { width: 100%; } .geo-controls .creatives-filter-pill { min-height: 44px; padding: 6px 12px; font-size: 12px; }
  #geoSection .tbl td:first-child { white-space: normal; }
}
.lds-none { display: none !important; }
.lds-swipe { display: none; font-size: 11.5px; color: var(--text-muted); margin: 4px 0; }
@media (max-width: 560px) { .lds-swipe { display: block; } #geoSection .geo-hide-sm { display: table-cell; } }
.date-cal-cell.is-future { color: var(--text-dim); opacity: .45; cursor: default; pointer-events: none; }
/* Phone (QA 2026-10-01): wide tables scroll inside their own card, never the whole report;
   an opened day wraps its campaign names; the date picker sits on screen with real tap targets. */
@media (max-width: 560px) {
  .tbl-scroll-sm { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .row2 { grid-template-columns: minmax(0, 1fr) !important; } .row2 > .card { min-width: 0; } .row2 canvas { max-width: 100%; }
  .lds-wkcamp .lds-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  #leadsSection .lds-dayc td:first-child { white-space: normal; }
  #leadsSection .lds-dayc .tbl__name span { white-space: normal; }
  .date-picker { position: fixed !important; left: 10px !important; right: 10px !important; top: 72px !important; width: auto !important; max-width: none !important; max-height: calc(100vh - 90px); overflow-y: auto; z-index: 500; }
  .date-picker__top { flex-direction: column; }
  .date-picker__presets { display: flex; flex-wrap: wrap; gap: 6px; }
  .date-picker__presets .date-picker__label, .date-preset-rule { flex-basis: 100%; }
  .date-preset { min-height: 40px; }
  .date-cal-cell { min-height: 40px; display: flex; align-items: center; justify-content: center; }
  .date-cal-nav button { width: 40px; height: 40px; }
}
.creative-card__live { font-size: 11px; font-weight: 600; color: #15803d; margin: -2px 0 6px; }
.lds-busy { opacity: .45; transition: opacity .15s; pointer-events: none; }
.lds-hint { font-size: 11.5px; color: var(--text-muted); padding: 2px 0 10px; }
.lds-warn { font-size: 12px; color: var(--warn-strong, #b45309); margin-bottom: 6px; line-height: 1.5; }
