html { color-scheme: light; }

html[data-theme="dark"] {
  color-scheme: dark;
  --bg-page: #0C0F10;
  --bg-surface: #14191A;
  --bg-surface-elevated: #1B2124;
  --bg-elevated: var(--bg-surface-elevated);
  --bg-hover: #21292C;
  --bg-active-nav: #263136;
  --sidebar-active: var(--bg-active-nav);
  --sidebar-bg: #14191A;
  --sidebar-text: #C5CECD;
  --sidebar-hover: #21292C;
  --border-subtle: #242D30;
  --border-default: #2E3A3E;
  --border-strong: #45555C;
  --text-primary: #F0F4F4;
  --text-secondary: #C5CECD;
  --text-muted: #8E9C9B;
  --teal-primary: #329693;
  --teal-hover: #3EB3B0;
  --teal-surface: rgba(50, 150, 147, 0.16);
  --green-badge-bg: #15382B;
  --green-badge-text: #75D9AC;
  --danger-bg: #3B2022;
  --danger-text: #FF9B91;
  --violet-link: #C2AAFF;
  --card-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  --modal-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
}

:root {
  --bg-page: #F9FAFA;
  --bg-surface: #FFFFFF;
  --bg-elevated: #F5F7F7;
  --bg-active-nav: #262E35;
  --sidebar-active: #262E35;
  --bg-hover: #F5F7F7;
  --sidebar-bg: #1E2423;
  --sidebar-text: #919C9B;
  --sidebar-hover: #2E3534;
  --border-subtle: #E2E8E7;
  --border-default: #E2E8E7;
  --border-strong: #CBD3D2;
  --text-primary: #1E2423;
  --text-secondary: #5E646A;
  --text-muted: #919C9B;
  --teal-primary: #2F8481;
  --teal-hover: #57ACA9;
  --teal-active: #266A67;
  --teal-surface: #E8F5F4;
  --green-badge-bg: #ECFDF3;
  --green-badge-text: #027A48;
  --amber-banner-bg: #9C7635;
  --violet-accent: #6941C6;
  --violet-link: #6941C6;
  --danger-bg: #FEF3F2;
  --danger-text: #B42318;
  --font-display: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100vh;
  background-color: var(--bg-page);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.45;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

/* 2FA Security Banner (#9C7635 exact match) */
.security-banner {
  background: var(--amber-banner-bg);
  color: #FFFFFF;
  min-height: 40px;
  padding: 8px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  font-size: 13.5px;
  font-weight: 500;
  gap: 8px;
}
.security-banner a {
  text-decoration: underline;
  font-weight: 700;
  cursor: pointer;
}
.security-banner .banner-close {
  position: absolute;
  right: 16px;
  background: transparent;
  border: none;
  color: #FFFFFF;
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
}

/* Global Top Header (54px height, crisp white, sits in right pane) */
.top-header {
  height: 54px;
  background: #FFFFFF;
  border-bottom: 1px solid var(--border-subtle);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 40;
}

.top-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #FFFFFF;
  cursor: pointer;
}
.brand-logo-icon {
  width: 24px;
  height: 24px;
  background: #FFFFFF;
  color: #1A2024;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 15px;
}

.top-header-right {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.header-nav-btn {
  background: transparent;
  border: none;
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
}
.header-nav-btn:hover {
  background: #F2F4F7;
}

.ai-tools-pill {
  background: transparent;
  border: 1px solid #2F8481;
  color: #2F8481;
  font-size: 11.5px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
}

.btn-upgrade {
  background: var(--teal-primary);
  color: #FFFFFF;
  border: none;
  border-radius: 999px;
  padding: 7px 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}
.btn-upgrade:hover {
  background: var(--teal-hover);
}

/* Main Workspace Layout (Full-Height Sidebar + Right Content Pane) */
.workspace-shell {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

.main-layout-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100vh;
  background: var(--bg-page);
}

.workspace-shell.builder-mode .left-sidebar {
  display: none !important;
}

.workspace-shell.builder-mode .top-header {
  display: none !important;
}

.workspace-shell.builder-mode .security-banner {
  display: none !important;
}

.workspace-shell.builder-mode .main-content {
  padding: 16px 24px 48px !important;
  max-width: 100% !important;
  width: 100% !important;
}

/* Left Sidebar (228px exact width, dark charcoal slate #1A2024) */
.left-sidebar {
  width: 228px;
  min-width: 228px;
  background: var(--sidebar-bg);
  border-right: 1px solid #262E35;
  padding: 16px 10px 24px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  user-select: none;
  min-height: 100vh;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: visible;
}

.sidebar-nav-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0 -10px;
  padding: 0 10px;
}

.sidebar-brand-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 8px 16px;
  user-select: none;
  cursor: pointer;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-logo-icon {
  width: 24px;
  height: 24px;
  background: #FFFFFF;
  color: #1A2024;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 15px;
  font-family: sans-serif;
}

.sidebar-logo-text {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: #FFFFFF;
  letter-spacing: -0.03em;
}

.store-switcher {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  margin-bottom: 8px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid transparent;
  color: #FFFFFF;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}
.store-switcher:hover {
  background: var(--sidebar-hover);
  border-color: #343E47;
}

.nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border-radius: 6px;
  color: var(--sidebar-text);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.nav-item:hover {
  background: var(--sidebar-hover);
  color: #FFFFFF;
}
.nav-item.active {
  background: var(--sidebar-active);
  color: #FFFFFF;
  font-weight: 600;
}
.nav-item[data-nav*="/audience"]:hover,
.nav-item[data-nav*="/audience"].active {
  background: #14352D;
  color: #5FE2B8;
}
.nav-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.nav-icon {
  width: 18px;
  text-align: center;
  font-size: 15px;
  opacity: 0.9;
}

.nav-children {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-left: 28px;
  margin-bottom: 4px;
}
.nav-subitem {
  padding: 7px 12px;
  border-radius: 6px;
  color: var(--sidebar-text);
  font-size: 13.5px;
  cursor: pointer;
}
.nav-subitem:hover {
  background: var(--sidebar-hover);
  color: #FFFFFF;
}
.nav-subitem.active {
  background: var(--sidebar-active);
  color: #FFFFFF;
  font-weight: 600;
}

.badge-new {
  background: var(--green-badge-bg);
  color: var(--green-badge-text);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.badge-success, .badge-sent, .badge-active, .badge-subscribed, .badge-enabled {
  background: var(--green-badge-bg);
  color: var(--green-badge-text);
}
.badge-draft, .badge-disabled, .badge-nonSubscribed {
  background: #2C3433;
  color: var(--text-secondary);
}
.badge-scheduled, .badge-waiting {
  background: #3B2F1E;
  color: #FCD34D;
}
.badge-danger, .badge-unsubscribed, .badge-canceled, .badge-exited {
  background: var(--danger-bg);
  color: var(--danger-text);
}
.badge-info {
  background: var(--teal-surface);
  color: #7CE8E4;
}

/* Main Content Area */
.main-content {
  flex: 1;
  min-width: 0;
  padding: 28px 36px 64px;
  max-width: 1440px;
}

/* Exact Dashboard Goals Hero (matching reference screenshot) */
.goals-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  padding: 32px 24px 44px;
  max-width: 1060px;
  margin: 0 auto;
}
.goals-hero-left {
  max-width: 560px;
}
.goals-hero-title {
  font-family: var(--font-display);
  font-size: 32px;
  line-height: 40px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 28px;
  letter-spacing: -0.01em;
}
.goals-cta-block {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.goals-cta-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}
.btn-connect-store {
  background: var(--teal-primary);
  color: #FFFFFF;
  border: none;
  border-radius: 6px;
  width: 248px;
  height: 44px;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-connect-store:hover {
  background: var(--teal-hover);
}
.goals-cta-sub {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 600;
}

.goals-hero-art {
  width: 260px;
  height: 220px;
  background: linear-gradient(145deg, #74D680 0%, #ABE8B2 55%, #FFFFFF 55%);
  border-radius: 20px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  flex-shrink: 0;
}
.goals-art-store-badge {
  position: absolute;
  left: -24px;
  top: 28px;
  width: 68px;
  height: 68px;
  background: var(--teal-primary);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  box-shadow: 0 10px 24px rgba(0,0,0,0.3);
}
.goals-art-plus-badge {
  position: absolute;
  left: -46px;
  bottom: 44px;
  width: 54px;
  height: 54px;
  background: #A7E3AF;
  color: #FFFFFF;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 400;
}
.goals-art-radio {
  width: 126px;
  height: 76px;
  background: #236B68;
  border-radius: 10px;
  margin-top: 24px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  gap: 12px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.28);
}
.goals-art-dial {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #E5EFEF;
  border: 3px solid #8FA8A7;
  position: relative;
}

.goals-cards-heading {
  text-align: center;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  margin: 16px 0 24px;
}
.goals-feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  max-width: 1060px;
  margin: 0 auto;
}
.goals-feature-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: 10px;
  padding: 28px 24px;
  text-align: center;
}
.goals-feature-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: #DCE5E5;
  color: #1E4E4C;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

/* Standard Page Headers, Cards, Metrics, Tables, Buttons */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.page-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 600;
  margin: 0;
}
.page-subtitle {
  color: var(--text-secondary);
  font-size: 13.5px;
  margin: 4px 0 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  color: var(--text-primary);
  transition: all 0.14s ease;
}
.btn:hover {
  background: var(--bg-hover);
}
.btn-primary {
  background: var(--teal-primary);
  border-color: var(--teal-primary);
  color: #FFFFFF;
}
.btn-primary:hover {
  background: var(--teal-hover);
  border-color: var(--teal-hover);
}
.btn-danger {
  background: var(--danger-bg);
  border-color: #7F1D1D;
  color: var(--danger-text);
}
.btn-sm {
  padding: 5px 10px;
  font-size: 12.5px;
}

.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 20px;
  max-width: 100%;
  overflow-x: hidden;
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.05);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.kpi-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: 10px;
  padding: 18px 20px;
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.04);
}
.kpi-label {
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 500;
  margin-bottom: 6px;
}
.kpi-value {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
}
.kpi-delta {
  margin-top: 6px;
  font-size: 12px;
  color: #027A48;
}

/* Filter Tabs & Search Toolbar */
.tabs-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: 1px solid var(--border-default);
  margin-bottom: 20px;
  overflow-x: auto;
}
.tab-btn {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  padding: 10px 14px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.tab-btn:hover {
  color: var(--text-primary);
}
.tab-btn.active {
  color: var(--teal-primary);
  border-bottom-color: var(--teal-primary);
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.input, .select, .textarea {
  background: #FFFFFF;
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 13.5px;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--teal-primary);
  box-shadow: 0 0 0 3px rgba(32, 130, 124, 0.12);
}

/* Data Tables */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.05);
}
table.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
table.data-table th {
  padding: 12px 16px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #667085;
  border-bottom: 1px solid var(--border-default);
  background: #F9FAFB;
}
table.data-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
  color: var(--text-primary);
}
table.data-table tbody tr:hover {
  background: #F9FAFB;
}
table.data-table tr:last-child td {
  border-bottom: none;
}
table.data-table tr:hover td {
  background: var(--bg-hover);
}

/* Visual Builders & Canvases (Campaign Editor, Segment AST Builder, Workflow Canvas) */
.builder-grid {
  display: flex;
  gap: 20px;
  align-items: stretch;
  width: 100%;
  min-height: 700px;
  overflow-x: auto;
}

.element-palette-card {
  background: #FFFFFF;
  border: 1px solid #EAECF0;
  border-radius: 8px;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  color: #344054;
  font-size: 12px;
  font-weight: 500;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.03);
  text-align: center;
  width: 100%;
}
.element-palette-card:hover {
  border-color: #2F8481;
  background: #F8FDFD;
  box-shadow: 0 2px 6px rgba(32, 130, 124, 0.12);
  color: #2F8481;
}

.email-canvas-preview {
  background: #FFFFFF;
  color: #131716;
  border-radius: 10px;
  margin: 0 auto;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(16, 24, 40, 0.08);
  transition: width 0.2s ease;
}

.workflow-canvas {
  background-color: #F8F9FA;
  background-image: radial-gradient(#CBD5E1 1.2px, transparent 1.2px);
  background-size: 20px 20px;
  border: 1px solid #EAECF0;
  border-radius: 8px;
  padding: 32px 20px 60px;
  min-height: 600px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.wf-node {
  width: 420px;
  max-width: 100%;
  background: #FFFFFF;
  border: 1.5px solid #D0D5DD;
  border-radius: 8px;
  padding: 16px 18px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.12s;
  position: relative;
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.05);
  color: var(--text-primary);
  user-select: none;
}
.wf-node:hover {
  border-color: #2F8481;
  box-shadow: 0 4px 12px rgba(47, 132, 129, 0.12);
}
.wf-node.selected {
  border-color: #2F8481;
  box-shadow: 0 0 0 3px rgba(47, 132, 129, 0.2);
}
.wf-node.wf-trigger {
  border: 2px solid #2F8481;
  box-shadow: 0 2px 8px rgba(47, 132, 129, 0.15);
}
.wf-edge {
  width: 2px;
  height: 36px;
  background: #D0D5DD;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}
.wf-add-btn {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #FFFFFF;
  border: 1.5px solid #D0D5DD;
  color: #667085;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
}
.wf-add-btn:hover {
  border-color: #2F8481;
  color: #2F8481;
  transform: scale(1.1);
  box-shadow: 0 2px 6px rgba(47, 132, 129, 0.2);
}
.wf-branches {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  width: 100%;
  max-width: 820px;
  padding: 16px;
  position: relative;
}
.wf-branch-col {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.wf-branch-badge {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  margin-bottom: 12px;
  box-shadow: 0 2px 4px rgba(16, 24, 40, 0.08);
}
.wf-branch-badge.badge-yes {
  background: #E8F5F4;
  color: #2F8481;
  border: 1.5px solid #2F8481;
}
.wf-branch-badge.badge-no {
  background: #F2F4F7;
  color: #475467;
  border: 1.5px solid #D0D5DD;
}
.wf-node-exit {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: #FFFFFF;
  border: 1.5px solid #D0D5DD;
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 600;
  color: #667085;
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.04);
}

/* Modal & Drawer */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.68);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  width: 100%;
  max-width: 780px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
}

.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  background: #111618;
  border: 1px solid #283035;
  color: #FFFFFF;
  padding: 12px 18px;
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(0,0,0,0.25);
  font-size: 13.5px;
  font-weight: 500;
}

/* Settings 2-column layout */
.settings-layout {
  display: grid;
  grid-template-columns: 230px 1fr;
  gap: 24px;
}

.overview-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
}

/* Mobile Navigation Controls (hidden by default on desktop) */
.mobile-menu-toggle {
  display: none;
}
.mobile-header-brand {
  display: none;
}
.mobile-sidebar-backdrop {
  display: none;
}
.mobile-sidebar-close-btn {
  display: none;
}

/* Responsive Mobile (<= 900px) */
@media (max-width: 900px) {
  .hide-on-mobile {
    display: none !important;
  }

  .mobile-menu-toggle {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: transparent;
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0;
    margin-right: 6px;
    flex-shrink: 0;
  }
  .mobile-menu-toggle:hover {
    background: var(--bg-hover);
  }

  .mobile-header-brand {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    user-select: none;
    cursor: pointer;
  }
  .mobile-brand-icon {
    width: 22px;
    height: 22px;
    background: #2F8481;
    color: #FFFFFF;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 14px;
    font-family: sans-serif;
  }
  .mobile-brand-name {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.03em;
  }

  .mobile-sidebar-close-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    background: rgba(255, 255, 255, 0.12);
    border: none;
    border-radius: 6px;
    color: #FFFFFF;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    transition: background 0.15s;
  }
  .mobile-sidebar-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
  }

  .mobile-sidebar-backdrop {
    display: block !important;
    position: fixed;
    inset: 0;
    background: rgba(17, 22, 24, 0.6);
    z-index: 998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
  }
  .mobile-sidebar-backdrop.active {
    opacity: 1;
    pointer-events: auto;
  }

  .workspace-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100%;
    min-width: 0;
    overflow-x: hidden;
  }

  /* Left Sidebar as Off-Canvas Drawer on Mobile */
  .left-sidebar {
    display: none !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    width: 280px !important;
    max-width: 85vw !important;
    height: 100vh !important;
    min-height: 100vh !important;
    z-index: 1000 !important;
    transform: translateX(-100%) !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transition: transform 0.24s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.24s !important;
    background: var(--sidebar-bg) !important;
    box-shadow: none !important;
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    padding: 16px 14px 24px !important;
    gap: 4px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
  }

  .left-sidebar.is-open {
    display: flex !important;
    transform: translateX(0) !important;
    visibility: visible !important;
    pointer-events: auto !important;
    box-shadow: 12px 0 36px rgba(0, 0, 0, 0.45) !important;
  }

  .main-layout-container {
    width: 100% !important;
    min-width: 0 !important;
    flex: 1 !important;
    min-height: 100vh !important;
    display: flex !important;
    flex-direction: column !important;
    overflow-x: hidden;
  }

  .top-header {
    height: 54px !important;
    padding: 0 12px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    background: #FFFFFF !important;
    border-bottom: 1px solid var(--border-subtle) !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 100 !important;
    flex-wrap: nowrap !important;
    overflow: visible !important;
  }

  .top-header-left {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    flex-shrink: 0 !important;
  }

  .top-header-right {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    flex-shrink: 0 !important;
    flex-wrap: nowrap !important;
  }

  .header-nav-btn {
    padding: 6px 8px !important;
    font-size: 12px !important;
    gap: 4px !important;
  }

  .ai-tools-pill {
    padding: 2px 5px !important;
    font-size: 10px !important;
  }

  .btn-upgrade {
    padding: 6px 10px !important;
    font-size: 11.5px !important;
    white-space: nowrap !important;
  }

  .main-content {
    padding: 16px 12px 48px !important;
    width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    overflow-x: hidden;
  }

  .goals-hero {
    flex-direction: column !important;
    padding: 16px 12px !important;
    gap: 16px !important;
  }

  .goals-feature-grid,
  .overview-grid,
  .builder-grid,
  .settings-layout,
  .wf-branches {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  .page-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 12px !important;
  }
  .page-header > div:last-child {
    width: 100% !important;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
  }

  .campaign-toolbar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }
  .campaign-toolbar > div {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    width: 100% !important;
  }
  #campaign-search-input {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Table Touch Scrolling within container without page stretching */
  .table-wrap {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    box-sizing: border-box !important;
    border-radius: 8px !important;
  }
  table.data-table {
    table-layout: auto !important;
    min-width: 680px !important;
    width: 100% !important;
  }
  table.data-table th,
  table.data-table td {
    padding: 10px 12px !important;
    font-size: 12.5px !important;
    white-space: nowrap !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
    overflow: visible !important;
  }

  .kpi-grid,
  .metric-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  .toolbar,
  .tabs-bar {
    flex-wrap: wrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    max-width: 100% !important;
  }

  .tab-btn {
    padding: 8px 12px !important;
    font-size: 12.5px !important;
    white-space: nowrap !important;
  }

  .card,
  .metric-card,
  .btn,
  .input,
  .select,
  .textarea {
    max-width: 100%;
    min-width: 0;
  }
}

/* Theme controls share the same state in the account menu and mobile drawer. */
.appearance-section { padding: 8px 4px 12px; }
.appearance-label { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; color: var(--text-muted); margin-bottom: 8px; }
.theme-switcher { display: flex; gap: 3px; padding: 3px; border: 1px solid var(--border-default); border-radius: 8px; background: var(--bg-page); }
.theme-switcher button { flex: 1; border: 0; border-radius: 5px; padding: 8px 4px; background: transparent; color: var(--text-secondary); cursor: pointer; font-size: 12px; white-space: nowrap; transition: background .15s; }
.theme-switcher button:hover { background: var(--bg-hover); }
.theme-switcher button[aria-pressed="true"] { background: var(--teal-surface); color: var(--text-primary); box-shadow: inset 0 0 0 1px var(--teal-primary); }
.theme-switcher button:focus-visible, .quick-theme-toggle:focus-visible { outline: 2px solid var(--teal-primary); outline-offset: 2px; }
.quick-theme-toggle { min-width: 32px; min-height: 32px; justify-content: center; }
.sidebar-appearance { display: none; }
@media (max-width: 900px) {
  .sidebar-appearance { display: block; padding: 0 8px; }
  .top-header-right { gap: 4px; flex-wrap: nowrap; }
  .quick-theme-toggle { display: none !important; }
}

/* ============================================================================
   1:1 Omnisend Authentic Split-Screen Auth Layout
   ============================================================================ */
.omnisend-auth-split-wrapper {
  display: flex;
  min-height: 100vh;
  width: 100%;
  background: #FFFFFF;
  font-family: var(--font-body);
}

.omnisend-auth-form-column {
  flex: 0 0 45%;
  max-width: 45%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 48px 64px;
  box-sizing: border-box;
  background: #FFFFFF;
}

.omnisend-auth-showcase-column {
  flex: 1;
  min-height: 100vh;
  background: linear-gradient(135deg, #d3e9e3 0%, #e8f4ec 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 48px;
  box-sizing: border-box;
}

@media (max-width: 960px) {
  .omnisend-auth-split-wrapper {
    flex-direction: column;
  }
  .omnisend-auth-form-column {
    flex: 1;
    max-width: 100%;
    min-height: auto;
    padding: 40px 24px;
  }
  .omnisend-auth-showcase-column {
    display: none;
  }
}

/* App chrome only: never recolor email content or cross the iframe boundary. */
html[data-theme="dark"] :is(.top-header, .card, .kpi-card, .table-wrap, .modal, .drawer, .element-palette-card, .wf-node, .wf-add-btn, .wf-node-exit, .omnisend-auth-split-wrapper, .omnisend-auth-form-column) {
  background: var(--bg-surface) !important;
  color: var(--text-primary);
  border-color: var(--border-default);
  box-shadow: var(--card-shadow);
}
html[data-theme="dark"] :is(input, select, textarea):not(.email-canvas-preview *) {
  background: var(--bg-surface-elevated) !important;
  color: var(--text-primary) !important;
  border-color: var(--border-strong) !important;
  accent-color: var(--teal-primary);
}
html[data-theme="dark"] ::placeholder { color: var(--text-muted); opacity: 1; }
html[data-theme="dark"] :is(th, thead, .wf-branch-badge.badge-no) { background: var(--bg-surface-elevated); color: var(--text-secondary); }
html[data-theme="dark"] :is(td, th) { border-color: var(--border-subtle); }
html[data-theme="dark"] :is(tbody tr:hover, .header-nav-btn:hover, .mobile-menu-toggle:hover) { background: var(--bg-hover); }
html[data-theme="dark"] :is(.mobile-header-brand, .mobile-menu-toggle, .page-title, .hero-title, .goals-hero-title, .goals-cta-label) { color: var(--text-primary) !important; }
html[data-theme="dark"] .modal { box-shadow: var(--modal-shadow); }
html[data-theme="dark"] .workflow-canvas { background-color: #0E1214; background-image: radial-gradient(#26333A 1.2px, transparent 1.2px); border-color: var(--border-subtle); }
html[data-theme="dark"] .wf-edge { background: var(--border-strong); }
html[data-theme="dark"] .wf-node.selected { border-color: var(--teal-primary); }
html[data-theme="dark"] .kpi-delta { color: var(--green-badge-text); }
html[data-theme="dark"] .omnisend-auth-showcase-column { background: linear-gradient(135deg, #142D2A, #1B2124); }

/* Legacy views use inline neutral colors. Map those neutrals without touching
   brand colors, status fills, images, or the authentic email canvas. */
html[data-theme="dark"] [style]:not(iframe, .email-canvas-preview, .email-canvas-preview *):is(
  [style*="background:#FFF" i], [style*="background: #FFF" i],
  [style*="background:white" i], [style*="background: white" i],
  [style*="background:#F9FAF" i], [style*="background:#F8F9F" i],
  [style*="background:#F2F4F7" i], [style*="background:#F5F7F7" i],
  [style*="background:#F8FAFC" i], [style*="background:#F3F4F6" i],
  [style*="background-color:#FFFFFF" i], [style*="background-color: #FFFFFF" i],
  [style*="rgb(249, 250, 251)" i], [style*="rgb(249,250,251)" i],
  [style*="rgb(255, 255, 255)" i], [style*="rgb(255,255,255)" i],
  [style*="rgb(242, 244, 247)" i], [style*="rgb(242,244,247)" i],
  [style*="rgb(248, 249, 250)" i], [style*="rgb(248,249,250)" i],
  [style*="rgb(245, 247, 247)" i], [style*="rgb(245,247,247)" i],
  [style*="rgb(248, 250, 252)" i], [style*="rgb(248,250,252)" i],
  [style*="rgb(243, 244, 246)" i], [style*="rgb(243,244,246)" i]
) { background: var(--bg-surface-elevated) !important; }
html[data-theme="dark"] [style]:not(iframe, .email-canvas-preview, .email-canvas-preview *):is(
  [style*="color:#111618" i], [style*="color:#1E2423" i],
  [style*="color:#1A2024" i], [style*="color:#101828" i],
  [style*="color:#344054" i], [style*="color:#131716" i],
  [style*="color:#1F2937" i], [style*="color:#333" i],
  [style*="color: #111618" i], [style*="color: #344054" i],
  [style*="rgb(17, 22, 24)" i], [style*="rgb(17,22,24)" i],
  [style*="rgb(52, 64, 84)" i], [style*="rgb(52,64,84)" i]
) { color: var(--text-primary) !important; }
html[data-theme="dark"] [style]:not(iframe, .email-canvas-preview, .email-canvas-preview *):is(
  [style*="color:#667085" i], [style*="color:#475467" i],
  [style*="color:#5E646A" i], [style*="color:#6B7280" i],
  [style*="color:#919C9B" i], [style*="color:#98A2B3" i],
  [style*="color: #667085" i], [style*="color: #475467" i],
  [style*="rgb(102, 112, 133)" i], [style*="rgb(102,112,133)" i],
  [style*="rgb(71, 84, 103)" i], [style*="rgb(71,84,103)" i]
) { color: var(--text-secondary) !important; }
html[data-theme="dark"] [style]:not(iframe, .email-canvas-preview, .email-canvas-preview *):is(
  [style*="#EAECF0" i], [style*="#E2E8E7" i], [style*="#D0D5DD" i], [style*="#E5E7EB" i],
  [style*="rgb(208, 213, 221)" i], [style*="rgb(208,213,221)" i],
  [style*="rgb(234, 236, 240)" i], [style*="rgb(234,236,240)" i]
) { border-color: var(--border-default) !important; }
html[data-theme="dark"] [style*="box-shadow"]:not(iframe, .email-canvas-preview, .email-canvas-preview *) { box-shadow: var(--card-shadow) !important; }

html[data-theme="dark"] [style]:not(iframe, .email-canvas-preview, .email-canvas-preview *):is(
  [style*="background:#E8F5F4" i], [style*="background:#ECFDF3" i], [style*="background:#F0FDF4" i],
  [style*="rgb(232, 245, 244)" i], [style*="rgb(232,245,244)" i],
  [style*="rgb(236, 253, 243)" i], [style*="rgb(236,253,243)" i],
  [style*="rgb(240, 253, 244)" i], [style*="rgb(240,253,244)" i]
) { background: var(--teal-surface) !important; }
html[data-theme="dark"] [style]:not(iframe, .email-canvas-preview, .email-canvas-preview *):is([style*="background:#FEF6EE" i], [style*="background:#FFFAEB" i], [style*="background:#FEF3C7" i]) { background: #362B1C !important; }
html[data-theme="dark"] [style]:not(iframe, .email-canvas-preview, .email-canvas-preview *):is([style*="color:#B54708" i], [style*="color:#B45309" i]) { color: #F5BE71 !important; }
html[data-theme="dark"] [style]:not(iframe, .email-canvas-preview, .email-canvas-preview *):is(
  [style*="color:#027A48" i], [style*="color:#2F8481" i],
  [style*="rgb(47, 132, 129)" i], [style*="rgb(47,132,129)" i]
) { color: #73CFBC !important; }

/* Explicit dropzone and interactive upload states in dark mode */
html[data-theme="dark"] #import-dropzone,
html[data-theme="dark"] .import-dropzone {
  background: var(--bg-surface-elevated) !important;
  border-color: var(--border-default) !important;
}
html[data-theme="dark"] #import-dropzone.dragover,
html[data-theme="dark"] .import-dropzone.dragover {
  background: var(--teal-surface) !important;
  border-color: var(--teal-primary) !important;
}

/* Explicit light rendering surface; srcdoc HTML/CSS is intentionally untouched. */
[data-testid="sent-email-preview-frame"], .email-canvas-preview {
  color-scheme: light;
  background: #FFFFFF !important;
  color: #131716;
  filter: none !important;
}

/* ==========================================================================
   Omnisend 1:1 Segments List Table & Sentence-Style Segment Builder
   ========================================================================== */
.omnisend-segments-table th {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text-primary, #111618);
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle, #E4E7EC);
  text-transform: uppercase;
  background: var(--bg-surface, #FFFFFF);
}
.omnisend-segments-table td {
  padding: 20px 20px;
  font-size: 14.5px;
  color: var(--text-primary, #111618);
  border-bottom: 1px solid var(--border-subtle, #E4E7EC);
  vertical-align: middle;
}
.seg-name-link {
  color: #2F8481;
  font-weight: 500;
  font-size: 15px;
  cursor: pointer;
  text-decoration: none;
  background: transparent;
  border: none;
  padding: 0;
  text-align: left;
  transition: color 0.15s ease;
}
.seg-name-link:hover {
  color: #1E6B68;
  text-decoration: underline;
}
html[data-theme="dark"] .seg-name-link {
  color: #73CFBC !important;
}
html[data-theme="dark"] .seg-name-link:hover {
  color: #9EE6B8 !important;
}

.seg-builder-card {
  background: var(--bg-surface, #FFFFFF);
  border: 1px solid var(--border-subtle, #E4E7EC);
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
  overflow: visible;
}
.seg-builder-section {
  padding: 22px 28px;
  border-bottom: 1px solid var(--border-subtle, #EAECF0);
}
.seg-builder-section:last-child {
  border-bottom: none;
}
.seg-sentence-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}
.seg-sentence-label {
  font-weight: 700;
  font-size: 13.5px;
  color: var(--text-primary, #111618);
  min-width: 118px;
  text-align: right;
  margin-right: 4px;
  user-select: none;
}
.seg-sentence-word {
  font-weight: 600;
  font-size: 13.5px;
  color: var(--text-primary, #111618);
  padding: 0 2px;
}
.seg-pill-select,
.seg-pill-input {
  background: #F2F4F7;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13.5px;
  font-weight: 600;
  color: #1D2939;
  min-height: 38px;
  line-height: 1.25;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.seg-pill-select {
  cursor: pointer;
}
.seg-pill-select:hover,
.seg-pill-input:hover,
.seg-pill-select:focus,
.seg-pill-input:focus {
  background: #E4E7EC;
  border-color: #D0D5DD;
  outline: none;
}
html[data-theme="dark"] .seg-pill-select,
html[data-theme="dark"] .seg-pill-input {
  background: #242E2D !important;
  border-color: #354341 !important;
  color: #F0F6F5 !important;
}
html[data-theme="dark"] .seg-pill-select:hover,
html[data-theme="dark"] .seg-pill-input:hover {
  background: #2D3938 !important;
}

.seg-quick-chips-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding-left: 132px;
  margin-top: 4px;
}
.seg-quick-chip {
  background: var(--bg-surface, #FFFFFF);
  border: 1px solid var(--border-default, #D0D5DD);
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary, #667085);
  cursor: pointer;
  transition: all 0.15s ease;
}
.seg-quick-chip:hover {
  border-color: #2F8481;
  color: #2F8481;
  background: rgba(47, 132, 129, 0.05);
}
.seg-trash-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary, #475467);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
}
.seg-trash-btn:hover {
  background: rgba(217, 45, 32, 0.08);
  color: #D92D20;
}
.seg-add-filter-split {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid var(--border-default, #98A2B3);
  border-radius: 8px;
  background: var(--bg-surface, #FFFFFF);
  overflow: hidden;
}
.seg-add-filter-split button {
  background: transparent;
  border: none;
  padding: 8px 14px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary, #111618);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.seg-add-filter-split button + button {
  border-left: 1px solid var(--border-default, #D0D5DD);
  padding: 8px 10px;
}
.seg-add-filter-split button:hover {
  background: rgba(16, 24, 40, 0.04);
}
.seg-breadcrumb-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--text-secondary, #475467);
  margin-bottom: 10px;
}
.seg-breadcrumb-link {
  background: transparent;
  border: none;
  padding: 0;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-primary, #111618);
  cursor: pointer;
}
.seg-breadcrumb-link:hover {
  color: #2F8481;
  text-decoration: underline;
}
.seg-breadcrumb-sep {
  color: #98A2B3;
  font-size: 15px;
  line-height: 1;
}
.seg-breadcrumb-current {
  font-weight: 600;
  color: var(--text-primary, #111618);
}
.seg-detail-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}
.seg-detail-title-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.seg-detail-heading {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary, #111618);
  margin: 0;
}
.seg-status-active-pill {
  display: inline-flex;
  align-items: center;
  background: #DCFCE7;
  color: #166534;
  font-size: 12.5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
}
html[data-theme="dark"] .seg-status-active-pill {
  background: rgba(34, 197, 94, 0.18) !important;
  color: #86EFAC !important;
}
.seg-pill-input-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.seg-pill-input-wrap .seg-pill-input {
  padding-right: 32px;
}
.seg-input-pencil {
  position: absolute;
  right: 10px;
  pointer-events: none;
  color: var(--text-secondary, #475467);
  display: inline-flex;
  align-items: center;
}
.seg-collection-pill-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.seg-collection-select {
  padding-right: 54px !important;
  max-width: 440px;
}
.seg-collection-count-badge {
  position: absolute;
  right: 28px;
  pointer-events: none;
  background: #FFFFFF;
  color: #1D2939;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.08);
}
html[data-theme="dark"] .seg-collection-count-badge {
  background: #131716 !important;
  color: #E2E8F0 !important;
}
.seg-builder-footer-section {
  display: flex;
  align-items: center;
  gap: 12px;
}
.seg-add-filter-main,
.seg-add-filter-caret {
  background: transparent;
  border: none;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary, #111618);
  cursor: pointer;
  padding: 8px 14px;
}
.seg-add-filter-caret {
  border-left: 1px solid var(--border-default, #D0D5DD);
  padding: 8px 10px;
}
.seg-footer-icon-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary, #475467);
  cursor: pointer;
  padding: 7px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
}
.seg-footer-icon-btn:hover {
  background: rgba(16, 24, 40, 0.05);
  color: var(--text-primary, #111618);
}
.seg-group-connector-bar {
  padding: 16px 28px;
  background: var(--bg-surface, #FFFFFF);
  border-left: 1px solid var(--border-subtle, #E4E7EC);
  border-right: 1px solid var(--border-subtle, #E4E7EC);
}
.seg-group-op-select {
  font-weight: 700;
  letter-spacing: 0.03em;
}
.seg-quick-chip-more {
  padding: 7px 10px;
  font-weight: 700;
}
@media (max-width: 768px) {
  .seg-sentence-label {
    min-width: auto;
    text-align: left;
    width: 100%;
    margin-bottom: 2px;
  }
  .seg-quick-chips-row {
    padding-left: 0;
  }
  .seg-builder-section {
    padding: 16px;
  }
}


