/* Whop Campaign Tracker — Mochi Cream Cute Minimalist UI */

:root {
  color-scheme: light;
  --font-display: "Fredoka", "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-body: "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, monospace;

  /* Warm Oatmilk Cream & Berry Blush Palette (Default Light) */
  --bg: #fcfaf7;
  --rail-bg: #f6f1ea;
  --surface: #ffffff;
  --surface-2: #f9f4ed;
  --surface-hover: #f2ebe1;
  --border: #ece4d8;
  --border-strong: #d9cdbd;

  --text: #342a25;
  --text-muted: #7f7067;
  --text-dim: #a6988f;

  /* Cute Strawberry-Berry Primary Accent (4.88:1 WCAG AA vs white) */
  --cta-bg: #c24662;
  --cta-bg-hover: #ad3954;
  --cta-fg: #ffffff;
  --accent-soft: #fdeef2;
  --accent-border: #f4c6d2;
  --focus-ring: #c24662;

  /* Soft Pastel Jellybean Stage Signals (WCAG AA contrast) */
  --st-none-bg: #f6f1ea;
  --st-none-fg: #7f7067;
  --st-none-bd: #e5dbcd;
  --dot-none: #e6ddd0;

  --st-social-bg: #fff2dc;
  --st-social-fg: #924c08;
  --st-social-bd: #f6d196;
  --dot-social: #f2a03d;

  --st-whop-bg: #e4f3ff;
  --st-whop-fg: #125688;
  --st-whop-bd: #add9fb;
  --dot-whop: #4aa7f0;

  --st-demo-bg: #f2eaff;
  --st-demo-fg: #5c2c96;
  --st-demo-bd: #d5bcfb;
  --dot-demo: #9d6ef0;

  --st-paid-bg: #e2f7ec;
  --st-paid-fg: #126142;
  --st-paid-bd: #a2e3c3;
  --dot-paid: #37b881;

  --st-rej-bg: #fde8ed;
  --st-rej-fg: #9c243f;
  --st-rej-bd: #f6b7c6;
  --dot-rej: #e26480;

  --rail-width: 248px;
  --radius: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow-card: 0 2px 12px rgba(74, 52, 36, 0.045);
  --shadow-lg: 0 20px 52px rgba(56, 38, 28, 0.14);
}

/* Optional Cozy Cocoa Dark Mode */
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #1b1716;
  --rail-bg: #151110;
  --surface: #231e1c;
  --surface-2: #2b2522;
  --surface-hover: #352d2a;
  --border: #362e2a;
  --border-strong: #4d413c;

  --text: #f7f1ea;
  --text-muted: #b0a299;
  --text-dim: #7f726a;

  --cta-bg: #f08da1;
  --cta-bg-hover: #f7a2b3;
  --cta-fg: #241418;
  --accent-soft: rgba(240, 141, 161, 0.16);
  --accent-border: rgba(240, 141, 161, 0.42);
  --focus-ring: #f08da1;

  --st-none-bg: rgba(176, 162, 153, 0.1);
  --st-none-fg: #b0a299;
  --st-none-bd: rgba(176, 162, 153, 0.24);
  --dot-none: #3d3430;

  --st-social-bg: rgba(247, 179, 86, 0.16);
  --st-social-fg: #fbd08d;
  --st-social-bd: rgba(247, 179, 86, 0.46);
  --dot-social: #f7b356;

  --st-whop-bg: rgba(102, 187, 250, 0.16);
  --st-whop-fg: #a2d7ff;
  --st-whop-bd: rgba(102, 187, 250, 0.44);
  --dot-whop: #66bbfa;

  --st-demo-bg: rgba(183, 140, 248, 0.16);
  --st-demo-fg: #d9c0ff;
  --st-demo-bd: rgba(183, 140, 248, 0.44);
  --dot-demo: #b78cf8;

  --st-paid-bg: rgba(77, 206, 148, 0.16);
  --st-paid-fg: #90e7be;
  --st-paid-bd: rgba(77, 206, 148, 0.46);
  --dot-paid: #4dce94;

  --st-rej-bg: rgba(242, 125, 148, 0.16);
  --st-rej-fg: #ffb5c3;
  --st-rej-bd: rgba(242, 125, 148, 0.46);
  --dot-rej: #f27d94;

  --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.24);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.56);
}

*, *::before, *::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

* {
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 999px;
}

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

html.theme-switching *,
html.theme-switching *::before,
html.theme-switching *::after {
  transition: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -56px;
  left: 16px;
  z-index: 1000;
  background: var(--cta-bg);
  color: var(--cta-fg);
  padding: 9px 16px;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
}

:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

/* App Shell */
.app-shell {
  display: grid;
  grid-template-columns: var(--rail-width) minmax(0, 1fr);
  min-height: 100vh;
}

.rail-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(42, 30, 24, 0.45);
  z-index: 45;
}

/* Soft Left Rail */
.left-rail {
  position: sticky;
  top: 0;
  height: 100vh;
  background: var(--rail-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 18px 14px;
  gap: 18px;
  overflow: hidden;
}

.rail-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 2px 4px;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: var(--cta-bg);
  color: var(--cta-fg);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(194, 70, 98, 0.22);
}

.brand-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.brand-meta {
  font-size: 11.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rail-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rail-campaigns-wrap {
  flex: 1;
  min-height: 0;
}

.rail-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
}

.rail-label {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-dim);
  letter-spacing: 0.02em;
}

.rail-mini-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 11.5px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 999px;
  cursor: pointer;
}

.rail-mini-btn:hover {
  color: var(--cta-bg);
  border-color: var(--accent-border);
  background: var(--accent-soft);
}

.rail-tablist {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.rail-nav-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
  transition: background-color 0.14s ease, color 0.14s ease;
}

.rail-ico {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

.rail-nav-btn:hover {
  color: var(--text);
  background: var(--surface-hover);
}

.rail-nav-btn.active,
.rail-nav-btn[aria-selected="true"] {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
  box-shadow: var(--shadow-card);
}

.rail-nav-btn.active .rail-ico {
  color: var(--cta-bg);
}

.rail-text {
  flex: 1;
}

.rail-pill {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-muted);
}

.rail-nav-btn.active .rail-pill {
  background: var(--accent-soft);
  color: var(--cta-bg);
}

/* Campaign List */
.rail-campaign-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-right: 2px;
}

.rail-camp-btn {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 100%;
  padding: 8px 11px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-body);
  cursor: pointer;
  text-align: left;
  transition: background-color 0.12s ease;
}

.rail-camp-btn:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.rail-camp-btn.active {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
  box-shadow: var(--shadow-card);
}

.rail-camp-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.rail-camp-name {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rail-camp-count {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-dim);
  flex-shrink: 0;
}

.rail-camp-count.warn {
  background: var(--st-social-bg);
  color: var(--st-social-fg);
  padding: 1px 7px;
  border-radius: 999px;
  font-weight: 600;
}

.rail-mini-dots {
  display: flex;
  gap: 4px;
  flex-wrap: nowrap;
  overflow: hidden;
}

.mini-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  flex-shrink: 0;
}

.rail-footer {
  border-top: 1px solid var(--border);
  padding-top: 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.rail-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.rail-action-btn:hover {
  color: var(--text);
  border-color: var(--border-strong);
  background: var(--surface-2);
}

/* Main Workspace */
.workspace-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.command-bar {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: 66px;
  padding: 12px 28px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.command-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.page-heading {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 24px;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--text);
}

.command-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.search-shell {
  position: relative;
  display: flex;
  align-items: center;
}

.search-ico {
  position: absolute;
  left: 12px;
  color: var(--text-dim);
  font-size: 14px;
  pointer-events: none;
}

.search-shell input {
  width: 195px;
  min-height: 36px;
  padding: 6px 14px 6px 32px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 13px;
}

.search-shell input:focus {
  border-color: var(--accent-border);
}

.platform-chips {
  display: inline-flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}

.plat-chip {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  padding: 5px 11px;
  border-radius: 999px;
  cursor: pointer;
}

.plat-chip:hover {
  color: var(--text);
}

.plat-chip.active {
  background: var(--accent-soft);
  color: var(--cta-bg);
}

/* Soft Pill Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 6px 15px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.14s ease, border-color 0.14s ease, color 0.14s ease, transform 0.12s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn-sm {
  min-height: 30px;
  padding: 4px 12px;
  font-size: 12px;
}

.btn-icon {
  width: 34px;
  padding: 0;
  border-radius: 999px;
}

.btn-cta {
  background: var(--cta-bg);
  color: var(--cta-fg);
  box-shadow: 0 3px 10px rgba(194, 70, 98, 0.2);
}

.btn-cta:hover {
  background: var(--cta-bg-hover);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

.btn-secondary:hover {
  background: var(--surface-2);
  border-color: var(--border-strong);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}

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

.btn-danger {
  background: var(--st-rej-bg);
  color: var(--st-rej-fg);
  border-color: var(--st-rej-bd);
}

.rail-mobile-only {
  display: none;
}

.workspace-body {
  padding: 24px 28px 60px;
  max-width: 1380px;
  width: 100%;
}

/* 3 Soft Pastel Summary Cards */
.bento-strip {
  display: grid;
  grid-template-columns: 1.75fr 1fr 1fr;
  gap: 14px;
  margin-bottom: 22px;
}

.bento-card {
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  color: inherit;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow-card);
  transition: border-color 0.15s ease, transform 0.15s ease;
}

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

.bento-hero.has-pending {
  border-color: var(--st-social-bd);
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
}

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

.bento-eyebrow {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-muted);
}

.bento-arrow {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: var(--surface-2);
  display: grid;
  place-items: center;
  font-size: 11px;
  color: var(--text-muted);
}

.bento-hero-nums {
  display: flex;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
}

.hero-stat {
  display: flex;
  align-items: baseline;
  gap: 7px;
  white-space: nowrap;
}

.hero-big {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 600;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.bento-hero.has-pending .hero-big {
  color: var(--st-social-fg);
}

.hero-mid {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.hero-unit {
  font-size: 12.5px;
  color: var(--text-muted);
}

.hero-divider {
  width: 1px;
  height: 20px;
  background: var(--border);
  align-self: center;
}

/* Cute Jellybean Dot Strip */
.dot-matrix {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 2px;
}

.dot-cell {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  flex-shrink: 0;
}

.dot-none { background: var(--dot-none); }
.dot-social { background: var(--dot-social); }
.dot-whop { background: var(--dot-whop); }
.dot-demo { background: var(--dot-demo); }
.dot-paid { background: var(--dot-paid); }
.dot-rej { background: var(--dot-rej); }

.dot-legend {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.dot-sep {
  color: var(--text-dim);
}

.bento-value {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 600;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}

.hairline-track {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
  margin: 2px 0;
}

.hairline-fill {
  height: 100%;
  background: var(--cta-bg);
  border-radius: 999px;
}

.bento-sub {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: auto;
}

.account-avatar-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.acc-avatar-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 5px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
}

/* Soft Stage Filter Bar */
.stage-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 18px;
}

.stage-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.stage-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.stage-tab:hover {
  color: var(--text);
  background: var(--surface);
}

.stage-tab.active {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
  box-shadow: var(--shadow-card);
}

.stage-tab-warn.active {
  border-color: var(--st-social-bd);
  background: var(--st-social-bg);
  color: var(--st-social-fg);
}

.tab-count {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--st-social-bg);
  color: var(--st-social-fg);
}

.toolbar-utils {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.compact-select {
  max-width: 220px;
  border-radius: 999px !important;
  padding: 6px 14px !important;
  font-size: 13px !important;
}

.toggle-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
}

.toggle-chip input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 5px;
  border: 1.5px solid var(--border-strong);
  background: var(--surface-2);
  display: grid;
  place-items: center;
  cursor: pointer;
  margin: 0;
  flex-shrink: 0;
}

.toggle-chip input[type="checkbox"]:checked {
  background: var(--cta-bg);
  border-color: var(--cta-bg);
}

.toggle-chip input[type="checkbox"]:checked::after {
  content: "";
  width: 7px;
  height: 4px;
  border-left: 2px solid var(--cta-fg);
  border-bottom: 2px solid var(--cta-fg);
  transform: rotate(-45deg) translate(0.5px, -0.5px);
}

.toggle-chip:has(input:checked) {
  color: var(--text);
  border-color: var(--accent-border);
  background: var(--accent-soft);
}

/* Inputs */
input[type="text"],
input[type="password"],
input[type="url"],
input[type="number"],
textarea,
select {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 11px;
  font-size: 13.5px;
  font-family: var(--font-body);
  width: 100%;
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="url"]:focus,
input[type="number"]:focus,
textarea:focus,
select:focus {
  border-color: var(--cta-bg);
}

.input-mono {
  font-family: var(--font-mono) !important;
  font-size: 12.5px !important;
}

/* Campaign Cards */
.matrix-stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.campaign-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.campaign-header {
  padding: 12px 18px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.campaign-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  min-width: 0;
}

.collapse-btn {
  background: var(--surface);
  color: var(--text-muted);
  border: 1px solid var(--border);
  width: 28px;
  height: 28px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 700;
}

.collapse-btn:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

.campaign-name {
  margin: 0;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
}

.campaign-meta-inline {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.campaign-tags-bar {
  padding: 10px 18px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.badge-accent {
  background: var(--accent-soft);
  color: var(--cta-bg);
  border-color: var(--accent-border);
}

.campaign-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.tag-chip {
  background: var(--surface-2);
  border: 1px dashed var(--border-strong);
  color: var(--text);
  padding: 4px 11px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 11px;
  cursor: pointer;
}

.tag-chip:hover {
  border-style: solid;
  border-color: var(--cta-bg);
  color: var(--cta-bg);
  background: var(--accent-soft);
}

/* Matrix Table */
.table-scroll {
  overflow-x: auto;
}

.matrix-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.matrix-table th,
.matrix-table td {
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  padding: 9px 14px;
  vertical-align: middle;
}

.matrix-table th:last-child,
.matrix-table td:last-child {
  border-right: none;
}

.matrix-table tr:last-child td,
.matrix-table tr:last-child th {
  border-bottom: none;
}

.matrix-table thead th {
  background: var(--surface);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-muted);
  text-align: left;
}

.col-clip {
  min-width: 200px;
  max-width: 270px;
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--surface);
  text-align: left;
  font-weight: 400;
}

.col-account {
  min-width: 135px;
}

.acc-th-main {
  display: flex;
  align-items: center;
  gap: 9px;
}

.plat-badge {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
}

.plat-youtube {
  background: #fde8e8;
  color: #b5303d;
}

.plat-tiktok {
  background: #dff6ef;
  color: #156e57;
}

.plat-instagram {
  background: #f4e8fc;
  color: #7d32a8;
}

html[data-theme="dark"] .plat-youtube {
  background: rgba(242, 125, 148, 0.2);
  color: #ffb5c3;
}

html[data-theme="dark"] .plat-tiktok {
  background: rgba(77, 206, 148, 0.2);
  color: #90e7be;
}

html[data-theme="dark"] .plat-instagram {
  background: rgba(183, 140, 248, 0.2);
  color: #d9c0ff;
}

.acc-handle {
  font-weight: 700;
  font-size: 13px;
  color: var(--text);
  display: block;
}

.acc-sub {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
}

.clip-cell-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.clip-title-line {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
}

.clip-title {
  font-weight: 700;
  font-size: 13.5px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 225px;
}

.clip-sub {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
}

.clip-sub .mp4-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--dot-paid);
  vertical-align: middle;
  margin-right: 6px;
}

.clip-copy-btn {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  background: var(--surface);
  border: 1px solid var(--border);
  opacity: 0;
  pointer-events: none;
  min-height: 24px;
  padding: 2px 9px;
  font-size: 11.5px;
  transition: opacity 0.12s ease;
}

.matrix-table tbody tr:hover .clip-copy-btn,
.matrix-table tbody tr:focus-within .clip-copy-btn {
  opacity: 1;
  pointer-events: auto;
}

/* Cute Jellybean Stage Pills */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid transparent;
  white-space: nowrap;
}

.stage-not_uploaded {
  background: var(--st-none-bg);
  color: var(--st-none-fg);
  border-color: var(--st-none-bd);
}

.stage-uploaded_social {
  background: var(--st-social-bg);
  color: var(--st-social-fg);
  border-color: var(--st-social-bd);
}

.stage-submitted_whop {
  background: var(--st-whop-bg);
  color: var(--st-whop-fg);
  border-color: var(--st-whop-bd);
}

.stage-demographics_sent {
  background: var(--st-demo-bg);
  color: var(--st-demo-fg);
  border-color: var(--st-demo-bd);
}

.stage-approved_paid {
  background: var(--st-paid-bg);
  color: var(--st-paid-fg);
  border-color: var(--st-paid-bd);
}

.stage-rejected {
  background: var(--st-rej-bg);
  color: var(--st-rej-fg);
  border-color: var(--st-rej-bd);
}

.cell-btn {
  width: 100%;
  min-height: 40px;
  padding: 5px 9px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background: transparent;
  color: inherit;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 3px;
  text-align: left;
  transition: background-color 0.14s ease, border-color 0.14s ease;
}

.cell-btn:hover {
  background: var(--surface-2);
  border-color: var(--border);
}

.cell-empty {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 700;
}

.cell-empty-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--dot-none);
  transition: background-color 0.14s ease, transform 0.14s ease;
}

.cell-empty-hover {
  opacity: 0;
  color: var(--cta-bg);
  transition: opacity 0.14s ease;
}

.cell-btn:hover .cell-empty-dot,
.cell-btn:focus-visible .cell-empty-dot {
  background: var(--cta-bg);
  transform: scale(1.15);
}

.cell-btn:hover .cell-empty-hover,
.cell-btn:focus-visible .cell-empty-hover {
  opacity: 1;
}

.cell-meta-line {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Accounts & Campaigns Cards */
.section-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.section-header h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
}

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

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 16px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: var(--shadow-card);
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.card-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
}

.card-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
}

.metric-item strong {
  display: block;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.metric-item span {
  font-size: 11px;
  color: var(--text-muted);
}

.progress-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  max-height: 210px;
  overflow-y: auto;
  padding-right: 4px;
}

.brief-notes {
  font-size: 13px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.progress-row-head {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  margin-bottom: 4px;
}

.card-footer {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

/* Slide-Over Drawer */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(42, 30, 24, 0.45);
  z-index: 60;
}

.drawer {
  position: fixed;
  top: 12px;
  right: 12px;
  bottom: 12px;
  width: min(520px, calc(100vw - 24px));
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 70;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.drawer-header {
  padding: 18px 20px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.drawer-eyebrow {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
}

.drawer-title {
  margin: 3px 0 0;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
}

.drawer-body {
  padding: 18px 20px 26px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.drawer-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.drawer-section h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
}

.drawer-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.video-wrap {
  background: #1a1513;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
}

.video-wrap video {
  display: block;
  width: 100%;
  max-height: 280px;
}

.empty-video {
  background: var(--surface-2);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  padding: 16px;
}

.empty-video p {
  margin: 0 0 4px;
}

.copy-box {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.copy-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.copy-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.copy-row-col {
  flex-direction: column;
  align-items: stretch;
}

.copy-caption-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.copy-caption-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.segmented {
  display: inline-flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px;
}

.seg-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
}

.seg-btn.active {
  background: var(--cta-bg);
  color: var(--cta-fg);
}

.copy-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
}

.copy-code {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text);
}

.copy-preview {
  margin: 2px 0 0;
  font-size: 13.5px;
}

.copy-pre {
  margin: 0;
  white-space: pre-wrap;
  font-family: var(--font-body);
  font-size: 13px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  max-height: 120px;
  overflow-y: auto;
}

.stage-fieldset {
  border: none;
  padding: 0;
  margin: 0;
}

.stage-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.stage-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

.stage-option:has(input:checked) {
  border-color: var(--cta-bg);
  background: var(--accent-soft);
  color: var(--cta-bg);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.field-full {
  grid-column: 1 / -1;
}

.field-checks {
  justify-content: flex-end;
  gap: 8px;
}

.field label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
}

.field-hint {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

.field-hint.warn {
  color: var(--st-social-fg);
  font-weight: 600;
}

.checkbox-inline {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  cursor: pointer;
}

.input-with-btn {
  display: flex;
  gap: 6px;
}

.input-with-btn input {
  flex: 1;
  min-width: 0;
}

.drawer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

/* Native Dialog Modals */
.modal {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  padding: 0;
  width: min(540px, 94vw);
  box-shadow: var(--shadow-lg);
}

.modal::backdrop {
  background: rgba(42, 30, 24, 0.45);
}

.modal-form {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.modal-footer-right {
  display: flex;
  gap: 8px;
}

/* Toasts */
.toast-region {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--accent-border);
  border-left: 4px solid var(--cta-bg);
  border-radius: var(--radius-md);
  padding: 11px 16px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: var(--shadow-lg);
}

.empty-state {
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 40px;
  text-align: center;
  color: var(--text-muted);
}

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

@media (max-width: 1080px) {
  .bento-strip {
    grid-template-columns: 1fr;
  }
}

/* Bot & Tokens Control Panel + Header Status */
.header-bot-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.header-bot-pill:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.header-bot-pill .pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-dim);
}

.header-bot-pill.is-online {
  background: var(--st-paid-bg);
  border-color: var(--st-paid-bd);
  color: var(--st-paid-fg);
}

.header-bot-pill.is-online .pill-dot {
  background: var(--dot-paid);
}

.header-bot-pill.is-offline {
  background: var(--st-rej-bg);
  border-color: var(--st-rej-bd);
  color: var(--st-rej-fg);
}

.header-bot-pill.is-offline .pill-dot {
  background: var(--dot-rej);
}

.auth-lock-banner {
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 18px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.bot-bento-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.bot-kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 15px 17px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: var(--shadow-card);
}

.bot-kpi-value {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.2;
}

.bot-kpi-sub {
  font-size: 12px;
  color: var(--text-muted);
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 16px;
  align-items: stretch;
}

.settings-card {
  padding: 20px;
}

.label-with-badge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.secret-pill {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-muted);
}

.secret-pill.is-set {
  background: var(--st-paid-bg);
  border-color: var(--st-paid-bd);
  color: var(--st-paid-fg);
}

.secret-pill.is-missing {
  background: var(--st-social-bg);
  border-color: var(--st-social-bd);
  color: var(--st-social-fg);
}

.secret-input-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.secret-reveal-btn {
  flex-shrink: 0;
  padding: 7px 10px !important;
}

.settings-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 6px;
}

.settings-footer {
  justify-content: flex-end;
}

.maintenance-zone {
  margin-top: 16px;
  padding: 16px 20px;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  border-color: var(--st-rej-bd);
  background: var(--surface-2);
}

.maintenance-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex-shrink: 0;
}

@media (max-width: 1080px) {
  .bot-bento-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .bot-bento-strip {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 960px) {
  .app-shell {
    grid-template-columns: 1fr;
  }
  .rail-mobile-only {
    display: inline-flex;
  }
  .left-rail {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--rail-width);
    z-index: 50;
    transform: translateX(-100%);
    transition: transform 0.18s ease;
  }
  .left-rail.open {
    transform: translateX(0);
  }
}

@media (max-width: 560px) {
  .workspace-body,
  .command-bar {
    padding-left: 16px;
    padding-right: 16px;
  }
  .search-shell input {
    width: 160px;
  }
  .form-grid,
  .stage-picker {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
  }
}
