/* Rogue AI Portal — Rogue AI brand theme (dark). Self-contained, no external CSS.
   Brand tokens ported from the Rogue AI design system (#33A1FD on a dark surface stack).
   The PUBLIC lead-capture forms are NOT themed here — they keep per-form client branding. */

:root {
  --primary: #33A1FD;
  --primary-hover: #2B8AD9;
  --primary-soft: rgba(51, 161, 253, 0.15);
  --primary-border: rgba(51, 161, 253, 0.40);

  --bg: #0A0E17;
  --bg-card: #111827;
  --bg-muted: #1A2332;
  --bg-hover: #1E293B;

  --text: #FFFFFF;
  --text-muted: #94A3B8;
  --text-faint: #64748B;

  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.15);

  --success: #10B981;
  --success-soft: rgba(16, 185, 129, 0.14);
  --warning: #F59E0B;
  --warning-soft: rgba(245, 158, 11, 0.14);
  --error: #EF4444;
  --error-soft: rgba(239, 68, 68, 0.14);

  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 14px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.30);
  --shadow: 0 2px 6px rgba(0, 0, 0, 0.35), 0 1px 2px rgba(0, 0, 0, 0.30);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.50);

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;

  --nav-h: 60px;

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Monaco, 'Cascadia Code', monospace;

  --text-xs: 12px;
  --text-sm: 13px;
  --text-base: 14px;
  --text-lg: 16px;
  --text-xl: 20px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: var(--font);
  font-size: var(--text-base);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
}

/* Subtle brand mesh — echoes the Rogue AI / GHL sidebar texture. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 120% 80% at 30% 20%, rgba(13, 110, 174, 0.07) 0%, transparent 50%),
    radial-gradient(ellipse 100% 100% at 70% 80%, rgba(51, 161, 253, 0.05) 0%, transparent 45%),
    radial-gradient(ellipse 80% 60% at 50% 50%, rgba(20, 120, 189, 0.04) 0%, transparent 55%);
  pointer-events: none;
  z-index: 0;
}
.app-shell, .login-wrap, .standalone-msg { position: relative; z-index: 1; }

h1, h2, h3, h4 { margin: 0; font-weight: 600; color: var(--text); }
h1 { font-size: var(--text-xl); }
h2 { font-size: var(--text-lg); }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.text-sm { font-size: var(--text-sm); }
.text-xs { font-size: var(--text-xs); }
.text-muted { color: var(--text-muted); }
.text-faint { color: var(--text-faint); }
.mono { font-family: var(--mono); }
.hidden { display: none !important; }

/* ── Brand logo (text wordmark) ── */
.brand-logo {
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--primary);
  white-space: nowrap;
}
.brand-logo::before {
  content: '';
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
  vertical-align: middle;
}
.brand-logo-lg { font-size: 22px; }

/* ── App shell ── */
.app-shell { min-height: 100vh; display: flex; flex-direction: column; }

.top-nav {
  height: var(--nav-h);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 var(--space-6);
  gap: var(--space-6);
  position: sticky;
  top: 0;
  z-index: 50;
}
.nav-left { display: flex; align-items: center; }
.nav-logo { display: flex; align-items: center; }
.nav-logo:hover { text-decoration: none; }
.nav-logo .brand-logo { font-size: 18px; }

.nav-center { flex: 1; display: flex; }
.nav-items { display: flex; gap: var(--space-2); }
.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-weight: 500;
  font-size: var(--text-base);
  cursor: pointer;
}
.nav-item:hover { background: var(--bg-muted); color: var(--text); text-decoration: none; }
.nav-item.active { background: var(--primary-soft); color: var(--primary); }
.nav-item-icon { display: inline-flex; }
.nav-item-icon svg { width: 18px; height: 18px; }

.nav-right { display: flex; align-items: center; position: relative; }
.nav-user { position: relative; }
.nav-user-btn {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: none;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: var(--space-1) var(--space-2);
  cursor: pointer;
  font-family: inherit;
}
.nav-user-btn:hover { background: var(--bg-muted); }
.nav-user-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: var(--text-sm);
}
.nav-user-info { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.2; }
.nav-user-name { font-size: var(--text-sm); font-weight: 600; color: var(--text); }
.nav-user-loc { font-size: var(--text-xs); color: var(--text-muted); }
.nav-user-chevron svg { width: 16px; height: 16px; color: var(--text-muted); }

.nav-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: var(--space-2);
  z-index: 60;
}
.nav-dropdown-header { padding: var(--space-2) var(--space-3); }
.nav-dropdown-name { font-weight: 600; font-size: var(--text-sm); }
.nav-dropdown-loc { font-size: var(--text-xs); color: var(--text-muted); }
.nav-dropdown-divider { height: 1px; background: var(--border); margin: var(--space-2) 0; }
.nav-dropdown-item {
  display: flex; align-items: center; gap: var(--space-2);
  width: 100%;
  padding: var(--space-2) var(--space-3);
  border: none; background: none;
  border-radius: var(--radius-sm);
  font-family: inherit; font-size: var(--text-sm);
  color: var(--text); text-align: left; cursor: pointer;
}
.nav-dropdown-item:hover { background: var(--bg-muted); text-decoration: none; }
.nav-dropdown-item svg { width: 16px; height: 16px; color: var(--text-muted); }

.nav-hamburger { display: none; background: none; border: none; cursor: pointer; color: var(--text); }

.main-content { flex: 1; }
.content-body { max-width: 1180px; margin: 0 auto; padding: var(--space-8) var(--space-6); }

/* ── Cards ── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
}
.card + .card { margin-top: var(--space-4); }

/* ── Page header ── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
  flex-wrap: wrap;
}
.page-title { font-size: var(--text-xl); }
.page-subtitle { font-size: var(--text-sm); color: var(--text-muted); margin-top: var(--space-1); }
.breadcrumb { display: flex; align-items: center; gap: var(--space-2); font-size: var(--text-sm); color: var(--text-muted); margin-bottom: var(--space-4); }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--primary); }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: inherit;
  font-size: var(--text-base);
  font-weight: 500;
  line-height: 1;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-card);
  color: var(--text);
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, opacity 0.12s;
  white-space: nowrap;
}
.btn:hover { background: var(--bg-muted); text-decoration: none; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-danger { color: var(--error); border-color: var(--border); }
.btn-danger:hover { background: var(--error-soft); border-color: var(--error); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--bg-muted); }
.btn-sm { padding: 6px 11px; font-size: var(--text-sm); }
.btn-block { width: 100%; }

.btn-row { display: flex; gap: var(--space-2); flex-wrap: wrap; align-items: center; }

/* ── Forms ── */
.field { margin-bottom: var(--space-4); }
.field-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--space-2);
}
.field-hint { font-size: var(--text-xs); color: var(--text-muted); margin-top: var(--space-1); }
.input, .form-input, .textarea, .select {
  width: 100%;
  font-family: inherit;
  font-size: var(--text-base);
  color: var(--text);
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
}
.input:focus, .form-input:focus, .textarea:focus, .select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.textarea { resize: vertical; min-height: 80px; line-height: 1.5; }
.input-color { padding: 4px; height: 38px; width: 56px; cursor: pointer; }
.input-with-color { display: flex; gap: var(--space-2); align-items: center; }
.input-with-color .input { flex: 1; }

/* Toggle switch */
.toggle { display: inline-flex; align-items: center; gap: var(--space-2); cursor: pointer; user-select: none; }
.toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle-track {
  width: 38px; height: 22px;
  background: var(--border-strong);
  border-radius: 11px;
  position: relative;
  transition: background 0.15s;
  flex-shrink: 0;
}
.toggle-track::after {
  content: '';
  position: absolute; top: 2px; left: 2px;
  width: 18px; height: 18px;
  background: #fff; border-radius: 50%;
  transition: transform 0.15s;
  box-shadow: var(--shadow-sm);
}
.toggle input:checked + .toggle-track { background: var(--primary); }
.toggle input:checked + .toggle-track::after { transform: translateX(16px); }
.toggle-label { font-size: var(--text-sm); }

/* ── Sections / fieldsets in editor ── */
.editor-section { margin-bottom: var(--space-6); }
.editor-section-title {
  font-size: var(--text-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: var(--space-3);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--border);
}
.field-row { display: flex; gap: var(--space-3); }
.field-row > * { flex: 1; }

.locked-note {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: var(--text-xs); color: var(--text-faint);
  background: var(--bg-muted); padding: 2px 8px; border-radius: 20px;
}

/* ── Badges ── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: var(--text-xs); font-weight: 600;
  padding: 2px 9px; border-radius: 20px;
  background: var(--bg-muted); color: var(--text-muted);
}
.badge-active { background: var(--success-soft); color: var(--success); }
.badge-inactive { background: var(--bg-muted); color: var(--text-muted); }
.badge-primary { background: var(--primary-soft); color: var(--primary); }
.badge-warn { background: var(--warning-soft); color: var(--warning); }

/* ── Tabs ── */
.tabs { display: flex; gap: var(--space-1); border-bottom: 1px solid var(--border); margin-bottom: var(--space-5); }
.tab {
  padding: var(--space-3) var(--space-4);
  border: none; background: none;
  border-bottom: 2px solid transparent;
  font-family: inherit; font-size: var(--text-sm); font-weight: 500;
  color: var(--text-muted); cursor: pointer;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── List rows (forms, templates) ── */
.list-row {
  display: flex; align-items: center; gap: var(--space-4);
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  margin-bottom: var(--space-3);
}
.list-row:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.list-row-main { flex: 1; min-width: 0; }
.list-row-title { font-weight: 600; font-size: var(--text-base); display: flex; align-items: center; gap: var(--space-2); }
.list-row-meta { font-size: var(--text-xs); color: var(--text-muted); margin-top: 2px; display: flex; gap: var(--space-3); flex-wrap: wrap; align-items: center; }
.list-row-actions { display: flex; gap: var(--space-2); align-items: center; flex-shrink: 0; }
.url-chip {
  display: inline-flex; align-items: center; gap: var(--space-2);
  font-family: var(--mono); font-size: var(--text-xs);
  background: var(--bg-muted); padding: 3px 8px; border-radius: var(--radius-sm);
  color: var(--text-muted); max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.group-title { font-size: var(--text-sm); font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; margin: var(--space-6) 0 var(--space-3); }
.group-title:first-child { margin-top: 0; }

/* ── Split editor layout ── */
.split-editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--space-5);
  align-items: start;
}
.split-pane { min-width: 0; }
.split-pane-config { max-height: calc(100vh - 180px); overflow-y: auto; padding-right: var(--space-2); }
.preview-frame-wrap {
  position: sticky; top: calc(var(--nav-h) + var(--space-5));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
}
.preview-frame-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--border);
  background: var(--bg-muted);
  font-size: var(--text-xs); color: var(--text-muted);
}
.preview-frame { width: 100%; height: calc(100vh - 240px); border: none; display: block; background: #fff; }

/* ── Chat (AI editor / Pluto) ── */
.chat-panel { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-card); overflow: hidden; }
.chat-head { padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--border); background: var(--bg-muted); display: flex; align-items: center; justify-content: space-between; }
.chat-head-title { font-weight: 600; font-size: var(--text-sm); display: flex; align-items: center; gap: var(--space-2); }
/* Pluto's avatar. Same 32px round treatment as the DogStop portal — Pluto is the same
   assistant across every portal and should be recognisable as such. */
.chat-head-avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.chat-messages { flex: 1; overflow-y: auto; padding: var(--space-4); display: flex; flex-direction: column; gap: var(--space-3); min-height: 200px; }
.chat-bubble { max-width: 85%; padding: var(--space-3) var(--space-4); border-radius: var(--radius); font-size: var(--text-sm); line-height: 1.5; white-space: pre-wrap; word-wrap: break-word; }
.chat-bubble-user { align-self: flex-end; background: var(--primary); color: #fff; border-bottom-right-radius: 3px; }
.chat-bubble-assistant { align-self: flex-start; background: var(--bg-muted); color: var(--text); border-bottom-left-radius: 3px; }
.chat-bubble strong { font-weight: 600; }
.chat-thinking { align-self: flex-start; color: var(--text-muted); font-size: var(--text-sm); display: flex; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-4); }
.chat-input-row { display: flex; gap: var(--space-2); padding: var(--space-3); border-top: 1px solid var(--border); background: var(--bg-card); }
.chat-input { flex: 1; resize: none; min-height: 40px; max-height: 120px; }
.chat-actions { display: flex; gap: var(--space-2); padding: 0 var(--space-3) var(--space-3); }

.dot-pulse { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--primary); animation: dot-pulse 1s infinite ease-in-out; }
@keyframes dot-pulse { 0%, 80%, 100% { opacity: 0.3; } 40% { opacity: 1; } }

.changed-paths { font-size: var(--text-xs); color: var(--text-muted); padding: var(--space-2) var(--space-3); background: var(--primary-soft); border-radius: var(--radius-sm); margin: var(--space-2) 0; }
.changed-paths code { font-family: var(--mono); color: var(--primary); }

/* ── Collapsible panel ── */
.collapsible { border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: var(--space-4); overflow: hidden; }
.collapsible-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-3) var(--space-4); cursor: pointer; background: var(--bg-card);
  font-weight: 600; font-size: var(--text-sm); user-select: none;
}
.collapsible-head:hover { background: var(--bg-hover); }
.collapsible-head .chevron { transition: transform 0.15s; color: var(--text-muted); }
.collapsible.open .collapsible-head .chevron { transform: rotate(90deg); }
.collapsible-body { display: none; padding: var(--space-4); border-top: 1px solid var(--border); }
.collapsible.open .collapsible-body { display: block; }

/* ── Versions / submissions tables ── */
.data-table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.data-table th { text-align: left; font-weight: 600; color: var(--text-muted); font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.03em; padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--border); }
.data-table td { padding: var(--space-3); border-bottom: 1px solid var(--border); vertical-align: top; }
.data-table tr:last-child td { border-bottom: none; }

/* ── Skeleton loaders ── */
.skeleton {
  background: linear-gradient(90deg, var(--bg-muted) 25%, #243044 50%, var(--bg-muted) 75%);
  background-size: 200% 100%;
  animation: skeleton 1.4s ease-in-out infinite;
  border-radius: var(--radius-sm);
}
@keyframes skeleton { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.skeleton-row { height: 64px; margin-bottom: var(--space-3); }
.skeleton-line { height: 14px; margin-bottom: var(--space-2); }

/* ── Empty states ── */
.empty-state { text-align: center; padding: var(--space-8) var(--space-6); color: var(--text-muted); }
.empty-state-icon { width: 48px; height: 48px; margin: 0 auto var(--space-4); color: var(--text-faint); }
.empty-state-title { font-size: var(--text-lg); font-weight: 600; color: var(--text); margin-bottom: var(--space-2); }
.empty-state-desc { font-size: var(--text-sm); max-width: 420px; margin: 0 auto var(--space-5); }

/* ── Toast / banners ── */
.toast-wrap { position: fixed; bottom: var(--space-6); right: var(--space-6); z-index: 9999; display: flex; flex-direction: column; gap: var(--space-2); }
.toast {
  min-width: 240px; max-width: 380px;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius);
  background: var(--bg-hover); color: var(--text);
  border: 1px solid var(--border);
  font-size: var(--text-sm); box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: var(--space-2);
  animation: toast-in 0.18s ease;
}
.toast-success { background: var(--success); }
.toast-error { background: var(--error); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.banner { padding: var(--space-3) var(--space-4); border-radius: var(--radius); font-size: var(--text-sm); margin-bottom: var(--space-4); }
.banner-error { background: var(--error-soft); color: #fca5a5; border: 1px solid rgba(239, 68, 68, 0.40); }
.banner-warn { background: var(--warning-soft); color: #fcd34d; border: 1px solid rgba(245, 158, 11, 0.40); }
.banner-info { background: var(--primary-soft); color: var(--primary); border: 1px solid var(--primary-border); }
.banner-success { background: var(--success-soft); color: #6ee7b7; border: 1px solid rgba(16, 185, 129, 0.40); }
.banner ul { margin: var(--space-2) 0 0; padding-left: var(--space-5); }

/* ── Standalone (no-shell) message — used when iframe has no session ── */
.standalone-msg {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: var(--space-8); text-align: center;
}
.standalone-card { max-width: 440px; }
.standalone-card .brand-logo { font-size: 24px; margin-bottom: var(--space-5); display: inline-block; }
.standalone-card h2 { font-size: var(--text-xl); margin-bottom: var(--space-3); }
.standalone-card p { color: var(--text-muted); font-size: var(--text-base); }

/* ── Login page ── */
.login-body { background: var(--bg); }
.login-wrap { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: var(--space-4); }
.login-card { width: 100%; max-width: 440px; text-align: center; }
.login-brand { margin-bottom: var(--space-6); }
.login-title { font-size: var(--text-xl); margin-bottom: var(--space-4); }
.login-text { color: var(--text); font-size: var(--text-base); margin: 0 0 var(--space-4); }
.login-text:last-child { margin-bottom: 0; }

/* ── Auth-expired overlay ── */
.overlay { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.55); display: flex; align-items: center; justify-content: center; z-index: 9999; }
.overlay .card { max-width: 360px; text-align: center; }

/* ── Spinner ── */
.spinner { width: 18px; height: 18px; border: 2px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Responsive ── */
@media (max-width: 900px) {
  .split-editor { grid-template-columns: 1fr; }
  .preview-frame-wrap { position: static; }
  .preview-frame { height: 520px; }
  .split-pane-config { max-height: none; overflow: visible; }
}
@media (max-width: 720px) {
  .top-nav { padding: 0 var(--space-4); gap: var(--space-3); }
  .nav-hamburger { display: block; order: -1; }
  .nav-center {
    position: absolute; top: var(--nav-h); left: 0; right: 0;
    background: var(--bg-card); border-bottom: 1px solid var(--border);
    flex-direction: column; padding: var(--space-3); display: none;
    box-shadow: var(--shadow);
  }
  .nav-center.nav-center-open { display: flex; }
  .nav-items { flex-direction: column; width: 100%; }
  .nav-item { width: 100%; }
  .nav-user-info { display: none; }
  .content-body { padding: var(--space-5) var(--space-4); }
  .list-row { flex-wrap: wrap; }
  .list-row-actions { width: 100%; justify-content: flex-end; }
}

/* ============================================================================
   Editor-component token aliases
   ----------------------------------------------------------------------------
   The portal-editor CSS below is shared with the other Rogue-built portals,
   which name these tokens differently. Every value was COMPARED and is
   IDENTICAL — both vocabularies descend from the same Rogue AI design system —
   so these are pure `var()` indirections, NOT second definitions. Exactly one
   source of truth per colour remains (the :root block above), which is what
   keeps RS-ENG-004 satisfied: change --primary and every alias follows.
   Do NOT give any of these a literal value.
   (Mapped by VALUE, not by name: --bg-secondary is --bg-card, not --bg-hover.)
   ========================================================================== */
:root {
  --bg-primary:      var(--bg);            /* #0A0E17 */
  --bg-secondary:    var(--bg-card);       /* #111827 */
  --bg-tertiary:     var(--bg-muted);      /* #1A2332 */
  --bg-elevated:     var(--bg-hover);      /* #1E293B */
  --border-default:  var(--border);
  --border-hover:    var(--border-strong);
  --brand-blue:      var(--primary);       /* #33A1FD */
  --brand-blue-dark: var(--primary-hover); /* #2B8AD9 */
  --glow-subtle:     var(--primary-soft);
  --text-primary:    var(--text);
  --text-secondary:  var(--text-muted);
  --transition-fast: 150ms ease;
  /* The one genuinely new value: no 12px radius existed here (--radius is 10px,
     --radius-lg is 14px). Declared literally because it is not an alias. */
  --radius-md: 12px;
}

/* ============================================================================
   Portal editor components — ported for UI parity with the other Rogue portals.
   Covers: template-editor shell, editor modals, warn banners, settings panel,
   chat internals, event-form (ef-*) and forms-hub (bf-*) families, offers-*,
   and the .btn-secondary / .btn-tertiary variants.
   Verified before porting: ZERO DogStop brand values (#E31837 / #1E2D44) and
   zero DogStop-specific selectors in this block.
   ========================================================================== */
.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border-default);
}
.btn-secondary:hover {
  background: var(--border-default);
  color: var(--text-primary);
}


/* Remove padding/max-width constraints when editor is active */
.content-body:has(.template-editor) {
  padding: 0;
  max-width: none;
  width: 100%;
}

.main-content:has(.template-editor) {
  overflow: hidden;
}

.template-editor {
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--nav-h));
  overflow: hidden;
}

.editor-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-default);
  background: var(--bg-secondary);
  flex-shrink: 0;
}

.editor-toolbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.editor-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.editor-title {
  display: flex;
  align-items: center;
  min-width: 0;
  overflow: hidden;
}

.editor-title span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.editor-main {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.editor-preview {
  flex: 0 0 55%;
  overflow: auto;
  border-right: 1px solid var(--border-default);
  background: #f4f4f4;
}

.editor-chat {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

.editor-chat-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-default);
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-primary);
  flex-shrink: 0;
}

.editor-chat-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

/* ============================================
   Editor Modals + Banners + Settings Panel
   --------------------------------------------
   Shared chrome for Pluto editor modals (rename,
   upload photo, sync warning) + the not-configured
   banner + the Template Settings panel. ALL colors
   resolve via design tokens from :root — DO NOT
   hardcode hex/rgb here. See .claude/rules/
   portal-styling.md for the full style policy.
   ============================================ */

/* Backdrop overlay shared across every editor modal. Pluto preview iframes
   are sandboxed so the email's white background is OK to render against
   this dark backdrop — only the chrome around it adopts the dark theme. */
.editor-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.editor-modal-dialog {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
  width: 92vw;
  font-family: inherit;
  padding: 20px;
}
.editor-modal-dialog--sm  { max-width: 440px; }
.editor-modal-dialog--md  { max-width: 520px; }
.editor-modal-dialog--lg  { max-width: 640px; }

.editor-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.editor-modal-title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
}
.editor-modal-title--warn { color: var(--warning); }
.editor-modal-title--error { color: var(--error); }

.editor-modal-dismiss {
  border: none;
  background: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-secondary);
  line-height: 1;
  padding: 0 4px;
}
.editor-modal-dismiss:hover { color: var(--text-primary); }

.editor-modal-body {
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text-secondary);
}
.editor-modal-body strong { color: var(--text-primary); }
.editor-modal-body p { margin: 0 0 12px; }
.editor-modal-body code {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 0.85em;
}

.editor-modal-info-block {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin: 8px 0 16px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Embed modal: the paste-ready snippet + the list of websites approved to frame the form. */
.embed-snippet {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.78rem;
  line-height: 1.6;
  padding: 12px;
  margin: 0 0 8px;
  /* The snippet is one long URL — it must scroll inside its own box, never widen the modal. */
  overflow-x: auto;
  white-space: pre;
  user-select: all;
}

.embed-origin-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.embed-origin-list li { color: var(--text-secondary); }
.editor-modal-info-block strong { color: var(--text-primary); }
.editor-modal-info-block .editor-modal-info-warn {
  margin-top: 8px;
  color: var(--warning);
}

.editor-modal-footer {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 16px;
}

.editor-modal-input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border-default);
  border-radius: 4px;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: inherit;
  box-sizing: border-box;
}
.editor-modal-input:focus {
  outline: none;
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 2px var(--glow-subtle);
}
.editor-modal-input:disabled,
.editor-modal-input[readonly] {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  cursor: default;
}
.editor-modal-input--invalid {
  border-color: var(--error);
}

.editor-modal-status {
  margin-top: 8px;
  min-height: 1.2em;
  font-size: 0.82rem;
  color: var(--text-secondary);
}
.editor-modal-status--ok    { color: var(--success); }
.editor-modal-status--warn  { color: var(--warning); }
.editor-modal-status--error { color: var(--error); }

.editor-modal-helper {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-top: 4px;
}

.editor-modal-link {
  color: var(--brand-blue);
  text-decoration: underline;
  background: none;
  border: none;
  cursor: pointer;
  font: inherit;
  padding: 0;
}
.editor-modal-link:hover { color: var(--brand-blue-dark); }

/* Dropzone for file uploads */
.editor-modal-dropzone {
  border: 2px dashed var(--border-hover);
  border-radius: var(--radius-sm);
  padding: 24px;
  text-align: center;
  color: var(--text-secondary);
  cursor: pointer;
  transition: border-color var(--transition-fast), background var(--transition-fast);
  background: var(--bg-tertiary);
}
.editor-modal-dropzone:hover,
.editor-modal-dropzone--active {
  border-color: var(--brand-blue);
  background: var(--glow-subtle);
  color: var(--text-primary);
}
.editor-modal-dropzone--locked {
  opacity: 0.5;
  pointer-events: none;
}

/* Inline preview for selected upload */
.editor-modal-preview-img {
  max-width: 100%;
  max-height: 240px;
  display: block;
  margin: 12px auto 0;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
}
.editor-modal-preview-info {
  margin-top: 6px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-align: center;
}

.editor-modal-field-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

/* Tag for "likely match" hint inside the not-configured banner */
.editor-modal-pill {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 3px;
  vertical-align: middle;
  margin-left: 4px;
  background: var(--success);
  color: var(--bg-primary);
}

/* Inline-list row used by the not-configured banner. */
.editor-modal-list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border-default);
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
}
.editor-modal-list-row:hover { border-color: var(--border-hover); }
.editor-modal-list-row .editor-modal-list-name {
  font-weight: 600;
  color: var(--text-primary);
  word-break: break-word;
}
.editor-modal-list-row .editor-modal-list-meta {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* Standalone banner (rendered inline, not as a modal) used when a session
   can't be created because the local template isn't linked to a GHL ID. */
.editor-warn-banner {
  padding: 24px;
  margin: 24px auto;
  max-width: 720px;
  background: var(--bg-elevated);
  border: 1px solid var(--warning);
  border-left: 4px solid var(--warning);
  border-radius: var(--radius-md);
  color: var(--text-primary);
}
.editor-warn-banner h2 {
  margin: 0 0 8px;
  font-size: 1.2rem;
  color: var(--warning);
}
.editor-warn-banner p {
  margin: 0 0 16px;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.5;
}
.editor-warn-banner code {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.85em;
}
.editor-warn-banner .editor-warn-banner-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.editor-warn-banner .editor-warn-banner-loading {
  font-size: 0.9rem;
  color: var(--text-secondary);
}
.editor-warn-banner-footer {
  margin: 16px 0 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* ── Template Settings Panel (collapsible row above the editor) ── */
.editor-settings-panel {
  display: none;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-default);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 0.9rem;
}
.editor-settings-panel--open { display: block; }
.editor-settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 20px;
  align-items: start;
}
.editor-settings-panel .esp-label {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.78rem;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.editor-settings-panel .esp-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.editor-settings-panel .esp-hint-icon {
  cursor: help;
  color: var(--text-secondary);
  font-weight: 400;
  margin-left: 4px;
}
.editor-settings-panel input {
  padding: 8px 10px;
  border: 1px solid var(--border-default);
  border-radius: 4px;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: inherit;
}
.editor-settings-panel input:focus {
  outline: none;
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 2px var(--glow-subtle);
}
.editor-settings-panel input[readonly],
.editor-settings-panel input:disabled {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  cursor: default;
}
.editor-settings-panel .esp-foot {
  font-size: 0.72rem;
  color: var(--text-secondary);
  min-height: 1em;
}
.editor-settings-panel .esp-foot--ok    { color: var(--success); }
.editor-settings-panel .esp-foot--warn  { color: var(--warning); }
.editor-settings-panel .esp-foot--error { color: var(--error); }
.editor-settings-panel .esp-from-name {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85rem;
}
/* "Auto-generate" button — explicit hover overrides the global
   .btn-secondary:hover (which uses a translucent white overlay that becomes
   invisible against any white-ish parent). */
.editor-settings-panel .esp-gen-btn {
  font-size: 0.72rem;
  padding: 3px 10px;
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.editor-settings-panel .esp-gen-btn:hover:not(:disabled) {
  background: var(--brand-blue);
  color: #fff;
  border-color: var(--brand-blue);
}
.editor-settings-panel .esp-gen-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Chat Messages */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-bubble {
  padding: 10px 14px;
  border-radius: 12px;
  max-width: 88%;
  font-size: 0.8125rem;
  line-height: 1.6;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.chat-bubble code {
  background: rgba(255, 255, 255, 0.1);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 0.8em;
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
}

.chat-bubble-user {
  align-self: flex-end;
  background: var(--brand-blue);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.chat-bubble-assistant {
  align-self: flex-start;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
}

.chat-bubble-assistant strong {
  color: var(--text-primary);
}

.chat-system-message {
  text-align: center;
  padding: 6px 12px;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-style: italic;
}

.chat-change-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 0.75rem;
  color: var(--success);
  font-weight: 500;
}

.chat-change-indicator svg {
  width: 14px;
  height: 14px;
}

.chat-error-text {
  color: var(--error);
}

/* Thinking animation */
.chat-thinking {
  min-height: 36px;
  display: flex;
  align-items: center;
}

/* Immediate ack line shown next to the thinking dots (server `ack` SSE event) */
.chat-ack-text {
  color: var(--text-muted);
  font-style: italic;
  margin-right: 8px;
}

.thinking-dots {
  display: flex;
  gap: 4px;
  padding: 4px 0;
}

.thinking-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: thinking-bounce 1.2s ease-in-out infinite;
}

.thinking-dots span:nth-child(2) { animation-delay: 0.15s; }
.thinking-dots span:nth-child(3) { animation-delay: 0.3s; }

@keyframes thinking-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-6px); opacity: 1; }
}

/* Chat Input */
.chat-input-area {
  padding: 12px 16px;
  border-top: 1px solid var(--border-default);
  flex-shrink: 0;
}

.chat-input-wrap {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-default);
  border-radius: 12px;
  padding: 4px 4px 4px 12px;
  transition: border-color 0.15s;
}

.chat-input-wrap:focus-within {
  border-color: var(--brand-blue);
}

.chat-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 0.8125rem;
  font-family: inherit;
  resize: none;
  padding: 6px 0;
  line-height: 1.5;
  max-height: 120px;
}

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

.chat-send-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: var(--brand-blue);
  color: #fff;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s;
}

.chat-send-btn:hover {
  background: var(--brand-blue-dark);
}

.chat-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.chat-send-btn svg {
  width: 16px;
  height: 16px;
}

.chat-send-btn.sending {
  opacity: 0.5;
  cursor: wait;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .template-editor {
    height: calc(100vh - var(--nav-h));
  }

  .editor-main {
    flex-direction: column;
  }

  .editor-preview {
    flex: 0 0 45%;
    border-right: none;
    border-bottom: 1px solid var(--border-default);
  }

  .editor-chat {
    flex: 1;
  }

  .editor-toolbar-left {
    flex-wrap: nowrap;
    overflow: hidden;
  }

  .editor-title {
    font-size: 0.8125rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 50vw;
  }

  .editor-journey-badge {
    display: none;
  }
}

@media (max-width: 480px) {
  .editor-preview {
    flex: 0 0 35%;
  }
}
.btn-tertiary {
  background: transparent;
  border: 1px solid var(--border-default);
  color: var(--text-muted);
}
.btn-tertiary:hover {
  background: var(--bg-tertiary);
  border-color: var(--border-hover);
  color: var(--text-primary);
}

/* Tab navigation bar buttons */
.event-form-tab {
  padding: 12px 20px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
}
.event-form-tab--active {
  color: var(--brand-blue);
  border-bottom-color: var(--brand-blue);
}

/* Label style for editor form fields (replaces injected <style> tag) */
.event-form-editor-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  margin-bottom: 4px;
  color: var(--text-muted);
}

/* Pills used on form cards and header */
.ef-deleted-pill {
  background: var(--bg-tertiary);
  color: var(--text-muted);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 500;
}
.ef-expires-pill {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
}

/* ── Booking Forms (design tokens only) ─────────────────────────────────────── */
.bf-scope-pill {
  background: var(--brand-blue-btn, var(--brand-blue));
  color: var(--text-primary);
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.bf-tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--border-default);
  flex-wrap: wrap;
}
.bf-tab {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  padding: 10px 16px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: color var(--transition-fast), border-color var(--transition-fast);
}
.bf-tab:hover { color: var(--text-primary); }
.bf-tab.active { color: var(--text-primary); border-bottom-color: var(--brand-blue); }
/* Viewport toggle (Desktop/Mobile) inside the preview pill — active reads in brand blue (parity with
   the event-form builder), since these buttons suppress the underline that .bf-tab.active normally uses. */
.bf-viewport-tab.active { color: var(--brand-blue); }
.bf-card {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  margin-bottom: var(--space-4);
}
/* Two-pane editor (controls left, live preview right) — parity with the event-form builder. */
.bf-editor-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-6);
  align-items: start;
}
@media (max-width: 900px) {
  .bf-editor-split { grid-template-columns: 1fr; }
}
/* Collapsible category accordions (Services & Pricing) — all collapsed by default. */
.bf-accordion {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-3);
  overflow: hidden;
}
.bf-accordion-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  background: transparent;
  border: none;
  padding: var(--space-4) var(--space-5);
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
  transition: background var(--transition-fast);
}
.bf-accordion-header:hover { background: var(--bg-secondary); }
.bf-accordion-count { color: var(--text-muted); font-weight: 500; font-size: 0.8125rem; }
.bf-accordion-chevron {
  color: var(--text-muted);
  transition: transform var(--transition-fast);
  font-size: 0.75rem;
}
.bf-accordion.open .bf-accordion-chevron { transform: rotate(180deg); }
.bf-accordion-content {
  padding: 0 var(--space-5) var(--space-4);
  border-top: 1px solid var(--border-default);
}
.bf-accordion-content[hidden] { display: none; }
.bf-section-title {
  margin: 0 0 var(--space-4) 0;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text-primary);
}
.bf-field { margin-bottom: var(--space-4); }
.bf-field-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 8px 0;
  border-bottom: 1px solid var(--border-default);
  flex-wrap: wrap;
}
.bf-field-row:last-child { border-bottom: none; }
.bf-check { display: inline-flex; align-items: center; gap: 6px; font-size: 0.875rem; color: var(--text-primary); cursor: pointer; min-width: 200px; }
.bf-check.bf-req { color: var(--text-muted); min-width: auto; }
.bf-lock { font-size: 0.7rem; color: var(--text-muted); font-weight: 400; }
.bf-label-input { flex: 1; min-width: 140px; max-width: 300px; }
.bf-pricing-table { width: 100%; border-collapse: collapse; font-size: 0.8125rem; }
.bf-pricing-table th {
  text-align: left;
  color: var(--text-muted);
  font-weight: 600;
  padding: 6px 10px;
  border-bottom: 1px solid var(--border-default);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.bf-pricing-table td { padding: 8px 10px; border-bottom: 1px solid var(--border-default); color: var(--text-primary); vertical-align: middle; }
.bf-sm-input { max-width: 160px; padding: 6px 10px !important; font-size: 0.8125rem !important; }
.bf-saved { border-color: var(--success) !important; }
.bf-status { padding: 2px 8px; border-radius: 4px; font-size: 0.7rem; font-weight: 600; text-transform: capitalize; }
/* Advanced-builder drag-drop role assignor (design tokens). */
.bf-dnd-panel { margin-bottom: var(--space-4); }
.bf-dnd-svc { font-size: 0.875rem; font-weight: 700; color: var(--text-primary); margin-bottom: var(--space-2); }
.bf-dnd-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--space-3); }
.bf-dnd-col { background: var(--bg-secondary); border: 1.5px dashed var(--border-default); border-radius: var(--radius-md); padding: var(--space-3); min-height: 70px; transition: border-color var(--transition-fast), background var(--transition-fast); }
.bf-dnd-col-over { border-color: var(--brand-blue); background: var(--bg-elevated); }
.bf-dnd-col-title { font-size: 0.72rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.03em; margin-bottom: var(--space-2); }
.bf-chip { display: flex; align-items: center; justify-content: space-between; gap: 6px; background: var(--bg-tertiary); border: 1px solid var(--border-default); border-radius: var(--radius-sm); padding: 6px 10px; margin-bottom: 6px; font-size: 0.8125rem; color: var(--text-primary); cursor: grab; }
.bf-chip:hover { border-color: var(--border-hover); }
.bf-chip-dragging { opacity: 0.5; }
.bf-chip-price { color: var(--text-muted); font-size: 0.75rem; margin-left: 4px; }
.bf-chip-reset { background: transparent; border: none; color: var(--brand-blue); cursor: pointer; font-size: 0.9rem; padding: 0 2px; }

/* Status-pill backgrounds are token-equivalent rgba (15% tints of the matching token), the
   sanctioned pattern from .ef-expires-pill: --brand-blue-btn #1478BD, --success #10B981,
   --warning #F59E0B, --error #EF4444. */
.bf-status--lead { background: rgba(20,120,189,0.15); color: var(--brand-blue); }
.bf-status--booked { background: rgba(16,185,129,0.15); color: var(--success); }
.bf-status--pending { background: var(--bg-secondary); color: var(--text-muted); }
.bf-status--conflict { background: rgba(245,158,11,0.15); color: var(--warning); }
.bf-status--failed { background: rgba(239,68,68,0.15); color: var(--error); }

/* Monospace URL / slug code block */
.ef-code-block {
  font-family: monospace;
  font-size: 0.8125rem;
  color: var(--text-primary);
  text-decoration: none;
  background: var(--bg-tertiary);
  padding: 4px 10px;
  border-radius: 4px;
}

/* Field row inside the editor controls panel */
.ef-field-row {
  border: 1px solid var(--border-default);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 8px;
  background: var(--bg-secondary);
}

/* Submission status color modifiers */
.ef-status-ok    { color: var(--success); font-weight: 500; }
.ef-status-warn  { color: var(--warning); font-weight: 500; }
.ef-status-error { color: var(--error);   font-weight: 500; }

/* Version history source-label color modifiers */
.ef-source-create      { color: var(--success);    font-weight: 500; }
.ef-source-manual-edit { color: var(--brand-blue);  font-weight: 500; }
.ef-source-ai-edit     { color: #7e57c2;            font-weight: 500; } /* purple — no token exists */
.ef-source-rollback    { color: var(--warning);     font-weight: 500; }
.ef-source-default     { color: var(--text-muted);  font-weight: 500; }

/* AI result banners (inline, not modal) */
.ef-banner-success {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--success);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  margin-top: 12px;
}
.ef-banner-error {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--error);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
}


/* ============================================================ */
/* Offers View — per-location Rogue CRM offer custom values      */
/* ============================================================ */

.offers-view {
  padding: var(--space-6) var(--space-8);
  max-width: 1400px;
  margin: 0 auto;
}

.offers-header {
  margin-bottom: var(--space-6);
}

.offers-header .page-title {
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 var(--space-2) 0;
}

.offers-header .page-subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.5;
  margin: 0;
  max-width: 720px;
}

.offers-loading {
  color: var(--text-muted);
  font-size: 0.95rem;
  padding: var(--space-8) 0;
  text-align: center;
}

.offers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
  gap: var(--space-5);
}

.offers-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  transition: border-color var(--transition-fast);
}

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

.offers-card-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-3);
  border-bottom: 1px solid var(--border-default);
  padding-bottom: var(--space-3);
}

.offers-card-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.offers-card-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.offers-subblock {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.offers-subblock-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding-bottom: var(--space-1);
}

.offers-field-row {
  display: grid;
  grid-template-columns: 64px 1fr auto auto;
  gap: var(--space-3);
  align-items: center;
}

.offers-field-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
  cursor: help;
}

.offers-field-input {
  width: 100%;
}

.offers-field-status {
  font-size: 0.78rem;
  min-width: 50px;
  text-align: right;
}
.offers-field-status--ok { color: var(--success); }
.offers-field-status--error { color: var(--error); }

.offers-save-btn {
  min-width: 60px;
}

.offers-preview {
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.offers-preview-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}

.offers-preview-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.offers-preview-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.9rem;
  color: var(--text-primary);
}

.offers-preview-svc {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
}

.offers-preview-value {
  color: var(--brand-blue);
  font-weight: 600;
}

.offers-preview-label-text {
  color: var(--text-secondary);
}

.offers-preview-code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.78rem;
  padding: 2px 8px;
  background: var(--bg-secondary);
  border: 1px dashed var(--border-default);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  margin-left: auto;
}
