:root {
  /* Design tokens — light (control plane redesign) */
  --bg: #f5f3ef;
  --surface: #ffffff;
  --surface2: #eeece6;
  --ink: #1c1a17;
  --ink-soft: #726b60;
  --border: #e2ded5;
  --accent: #0ea982;
  --accent-ink: #ffffff;
  --accent-soft: #d8f3ea;
  --good: #1f7a52;
  --good-soft: #dcf0e6;
  --bad: #b23a2e;
  --bad-soft: #fbe3df;
  --warn: #a5720a;
  --warn-soft: #f6e6c8;

  /* Legacy aliases (keep existing class rules working) */
  --panel: var(--surface);
  --panel-2: var(--surface2);
  --panel-hover: var(--surface2);
  --text: var(--ink);
  --muted: var(--ink-soft);
  --faint: var(--ink-soft);
  --accent-dim: var(--accent-soft);
  --accent-border: color-mix(in srgb, var(--accent) 35%, transparent);
  --green: var(--good);
  --green-dim: var(--good-soft);
  --red: var(--bad);
  --red-dim: var(--bad-soft);
  --amber: var(--warn);
  --amber-dim: var(--warn-soft);
  --border-strong: var(--border);
  --radius: 14px;
  --radius-sm: 10px;
  --font: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Space Grotesk", Inter, system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --sidebar-width: 236px;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #232321;
  --surface: #2e2d2a;
  --surface2: #383633;
  --ink: #f3efe8;
  --ink-soft: #a89f92;
  --border: #3f3d38;
  --accent: #3fbf87;
  --accent-ink: #ffffff;
  --accent-soft: #163828;
  --good: #3fbf87;
  --good-soft: #163828;
  --bad: #e2635a;
  --bad-soft: #3a1f1c;
  --warn: #d9a441;
  --warn-soft: #3a2f14;
}

* { box-sizing: border-box; }

html { color-scheme: light; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font: 14.5px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  opacity: 0.85;
}

/* —— App shell (sidebar + main) —— */
.app-shell {
  display: flex;
  min-height: 100vh;
  align-items: stretch;
}

.sidebar {
  width: var(--sidebar-width);
  flex: none;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  gap: 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 20;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 4px;
  color: var(--ink);
  text-decoration: none;
}
.sidebar-brand:hover { opacity: 1; text-decoration: none; }

.brand-mark {
  width: 16px;
  height: 14px;
  background: var(--accent);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  flex: none;
  display: inline-block;
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.01em;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-group {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.sidebar-group-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  text-transform: uppercase;
  margin: 14px 0 4px 10px;
}

.sidebar-group:first-child .sidebar-group-label {
  margin-top: 4px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border-radius: 9px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13.5px;
  color: var(--ink-soft);
  text-decoration: none;
  border: 1px solid transparent;
}
.sidebar-link:hover {
  text-decoration: none;
  opacity: 1;
  background: var(--surface2);
  color: var(--ink);
}
.sidebar-link.active {
  background: var(--accent-soft);
  color: var(--accent);
}
.sidebar-link .nav-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}

.sidebar-spacer { flex: 1; min-height: 12px; }

/* —— Start-here rail (persistent setup guide) —— */
.setup-rail {
  display: block;
  margin: 4px 4px 6px;
  padding: 12px 13px;
  border-radius: 12px;
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  color: var(--ink);
  text-decoration: none;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.setup-rail:hover {
  text-decoration: none;
  opacity: 1;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 22%, transparent);
}
.setup-rail.active {
  box-shadow: 0 0 0 1px var(--accent) inset;
}
.setup-rail-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.setup-rail-label {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
}
.setup-rail-count {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
}
.setup-rail-bar {
  height: 5px;
  border-radius: 3px;
  background: color-mix(in srgb, var(--accent) 22%, transparent);
  overflow: hidden;
  margin-bottom: 8px;
}
.setup-rail-bar > span {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: var(--accent);
  transition: width 0.3s ease;
}
.setup-rail-next {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}
.setup-rail-arrow { color: var(--accent); font-weight: 700; }
.setup-rail.done {
  background: var(--good-soft);
  border-color: color-mix(in srgb, var(--good) 30%, transparent);
}
.setup-rail.done .setup-rail-label,
.setup-rail.done .setup-rail-count,
.setup-rail.done .setup-rail-arrow { color: var(--good); }

/* —— Next-step banner (top of working pages) —— */
.next-step-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 22px;
  padding: 13px 16px;
  border-radius: 12px;
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
  color: var(--ink);
  text-decoration: none;
}
.next-step-bar:hover { text-decoration: none; opacity: 1; }
.next-step-info { display: flex; flex-direction: column; gap: 2px; }
.next-step-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent);
}
.next-step-label { font-size: 15px; font-weight: 700; color: var(--ink); }
.next-step-go { flex: none; pointer-events: none; }

.theme-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface2);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
}

.theme-switch {
  width: 40px;
  height: 22px;
  border-radius: 11px;
  background: var(--border);
  border: none;
  position: relative;
  cursor: pointer;
  padding: 0;
  flex: none;
  transition: background 0.2s;
}
html[data-theme="dark"] .theme-switch {
  background: var(--accent);
}
.theme-switch-knob {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  position: absolute;
  top: 3px;
  left: 3px;
  transition: left 0.2s;
  box-shadow: 0 1px 2px rgba(0,0,0,.3);
}
html[data-theme="dark"] .theme-switch-knob {
  left: 21px;
}

.app-main {
  flex: 1;
  min-width: 0;
  max-width: 1200px;
  padding: 44px 52px 80px;
  background-image: radial-gradient(circle, var(--border) 1px, transparent 1px);
  background-size: 24px 24px;
  background-position: -4px -4px;
}

/* Legacy shell selectors kept for tests / old markup */
.topbar,
.site-footer { display: none !important; }
.topbar-inner,
.footer-nav,
.footer-col,
.footer-col-title { display: none; }

main {
  /* prefer .app-main; keep for nested main tags */
  max-width: 1200px;
}

.page-head {
  margin-bottom: 24px;
}

.page-head h1 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.15;
  color: var(--ink);
}

.page-head .lede {
  margin: 0;
  color: var(--ink-soft);
  max-width: 64ch;
  font-size: 15px;
}

.page-head code,
.muted code,
code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1px 6px;
}

.muted {
  color: var(--muted);
  font-weight: 400;
}

.section-title {
  margin: 32px 0 12px;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--text);
}

.section-title .muted {
  font-family: var(--font);
  font-weight: 500;
  font-size: 0.85rem;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(144px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.campaign-horizon {
  display: flex;
  flex-direction: column;
  gap: 28px;
  margin-bottom: 36px;
}

.campaign-horizon-col .section-title {
  margin-top: 0;
}

.stat,
.stat-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.stat .num,
.stat-card .num {
  display: block;
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--text);
}

.stat .lbl,
.stat-card .lbl {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.stat .lbl.pill {
  display: inline-block;
  margin-top: 10px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid transparent;
}

.stat .lbl.pill.pending {
  color: #92400e;
  background: var(--amber-dim);
  border-color: rgba(245, 158, 11, 0.35);
}

.stat .lbl.pill.approved {
  color: #065f46;
  background: var(--green-dim);
  border-color: rgba(16, 185, 129, 0.32);
}

.stat .lbl.pill.rejected {
  color: #991b1b;
  background: var(--red-dim);
  border-color: rgba(239, 68, 68, 0.32);
}

.stat-pending { border-color: rgba(245, 158, 11, 0.32); }
.stat-approved { border-color: rgba(16, 185, 129, 0.32); }
.stat-rejected { border-color: rgba(239, 68, 68, 0.32); }

.shortcuts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
  color: var(--muted);
  font-size: 0.84rem;
  margin-bottom: 16px;
  padding: 12px 16px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

kbd {
  background: var(--panel-2);
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  padding: 2px 7px;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text);
}

.position {
  color: var(--faint);
  font-size: 0.82rem;
  font-family: var(--font-mono);
  margin-bottom: 8px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.card-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.account {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
}

.tier {
  display: inline-block;
  background: var(--accent-dim);
  border: 1px solid var(--accent-border);
  color: var(--accent);
  border-radius: 4px;
  padding: 0 6px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  margin-left: 8px;
  vertical-align: middle;
}

.contact {
  color: var(--muted);
  font-size: 0.92rem;
  margin-top: 4px;
}

.tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: flex-end;
}

.tag {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--muted);
}

.tag.hook {
  color: var(--accent);
  border-color: var(--accent-border);
  background: var(--accent-dim);
}

.field-label {
  display: block;
  color: var(--faint);
  font-size: 0.7rem;
  font-weight: 700;
  margin: 16px 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.subject,
.body,
.reason-note {
  width: 100%;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font: inherit;
  transition: border-color 0.15s;
}

.body {
  resize: vertical;
  line-height: 1.65;
  font-size: 0.95rem;
}

.subject:disabled,
.body:disabled {
  background: var(--panel-2);
  border-color: var(--border);
  color: var(--text);
  opacity: 1;
}

.subject:focus,
.body:focus,
.reason-note:focus,
.form-grid input:focus,
.form-grid select:focus,
input[type="file"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.why {
  margin: 16px 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.why summary {
  cursor: pointer;
  color: var(--text);
  font-weight: 600;
}

.why summary:hover { color: var(--accent); }
.why ul { margin: 10px 0 0; padding-left: 18px; }

.reject-panel {
  margin: 16px 0;
  padding: 16px;
  background: var(--red-dim);
  border: 1px solid rgba(192, 57, 43, 0.28);
  border-radius: var(--radius);
}

.reasons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.reason-btn {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  cursor: pointer;
  font-size: 0.82rem;
  font-family: inherit;
}

.reason-btn:hover,
.reason-btn.active {
  border-color: var(--red);
  color: var(--red);
  background: var(--red-dim);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.btn {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 9px 14px;
  cursor: pointer;
  font: 600 0.88rem/1.2 var(--font);
  background: var(--panel);
  color: var(--text);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.btn:hover:not(:disabled) { background: var(--panel-hover); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn.approve,
.btn.save {
  border-color: rgba(39, 174, 96, 0.4);
  color: var(--green);
  background: var(--green-dim);
}

.btn.bulk {
  border-color: var(--accent-border);
  color: var(--accent);
  background: var(--accent-dim);
}

.btn.reject {
  border-color: rgba(192, 57, 43, 0.45);
  color: var(--red);
  background: var(--red-dim);
}

.btn.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
}

.btn.primary:hover:not(:disabled) {
  filter: brightness(0.95);
  background: var(--accent);
  border-color: var(--accent);
}

.btn.lg {
  padding: 12px 22px;
  font-size: 1rem;
  border-radius: var(--radius);
}

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

.btn.ghost:hover:not(:disabled) {
  background: var(--panel-hover);
  color: var(--text);
}

.panel,
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px 24px;
  margin-bottom: 16px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.panel:hover,
.card.lift:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px -12px rgba(0,0,0,.18);
}

.panel h2 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 1.06rem;
  font-weight: 700;
}

.panel > .muted:first-of-type,
.panel > p.muted {
  margin-top: 0;
  margin-bottom: 16px;
}

.workflow {
  display: grid;
  gap: 16px;
  margin-bottom: 8px;
}

.stat-link {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.stat-link:hover,
.stat-link:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

#contact-list:target,
#curate:target {
  scroll-margin-top: 96px;
}

#linkedin-import:target {
  scroll-margin-top: 96px;
}

.lede-sm {
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--text);
  margin: 0 0 12px;
}

.wizard-steps {
  margin: 12px 0 0;
  padding-left: 1.25rem;
  color: var(--text);
  font-size: 0.88rem;
  line-height: 1.6;
}

.wizard-steps li + li {
  margin-top: 6px;
}

.linkedin-preview-summary {
  margin-top: 16px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(37, 99, 235, 0.06);
  border: 1px solid rgba(37, 99, 235, 0.2);
  font-size: 0.88rem;
}

.pipeline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.pipeline-step {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--text);
  border: 1px solid var(--border);
  background: var(--panel);
}

.pipeline-step.pipeline-active {
  border-color: var(--accent);
  background: rgba(37, 99, 235, 0.08);
  color: var(--accent);
}

.pipeline-arrow {
  color: var(--muted);
  font-size: 0.85rem;
}

.pipeline-badge {
  display: inline-block;
  min-width: 1.25rem;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.72rem;
  text-align: center;
}

.curate-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  margin-top: 16px;
  padding: 12px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.5);
}

.curate-toolbar label {
  font-size: 0.82rem;
  font-weight: 600;
}

.curate-toolbar select {
  display: block;
  margin-top: 4px;
  min-width: 140px;
}

.col-check { width: 36px; }
.col-action { width: 120px; white-space: nowrap; }

th.sortable {
  white-space: nowrap;
}

th.sortable a {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

th.sortable a:hover {
  color: var(--accent);
  text-decoration: none;
}

th.sortable.sorted-asc a::after,
th.sortable.sorted-desc a::after {
  font-size: 0.75rem;
  color: var(--accent);
}

th.sortable.sorted-asc a::after {
  content: "↑";
}

th.sortable.sorted-desc a::after {
  content: "↓";
}

.btn.sm {
  padding: 4px 10px;
  font-size: 0.78rem;
}

.tag.pending { background: #fef3c7; color: #92400e; }
.tag.approved { background: #d1fae5; color: #065f46; }
.tag.rejected { background: #fee2e2; color: #991b1b; }
.tag.warn { background: #fee2e2; color: #991b1b; }

@media (min-width: 720px) {
  .workflow.cols-2 { grid-template-columns: 1fr 1fr; }
  .workflow.cols-2 .panel.span-2 { grid-column: 1 / -1; }
}

.form-row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 12px;
  align-items: end;
}

.form-grid.cols-4 { grid-template-columns: 1fr 1fr 1fr auto; }

.form-grid label,
.form-grid select,
.form-grid input {
  display: block;
  width: 100%;
  font-size: 0.88rem;
  color: var(--faint);
}

.form-grid input,
.form-grid select,
input[type="file"] {
  margin-top: 6px;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 9px 10px;
  font: inherit;
  font-size: 0.9rem;
}

input[type="file"] {
  background: var(--panel-2);
  border-color: var(--border);
}

.flash {
  background: var(--green-dim);
  border: 1px solid rgba(39, 174, 96, 0.35);
  color: #1f8a4d;
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-size: 0.92rem;
}

.flash-error {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #991b1b;
}

.warn {
  color: #92400e;
  background: var(--amber-dim);
  border: 1px solid rgba(243, 156, 18, 0.35);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
}

.hook-stats {
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 0.9rem;
}

.hook-stats summary {
  cursor: pointer;
  color: var(--text);
  font-weight: 600;
}

.claim-banner {
  margin: 8px 0;
  padding: 10px 12px;
  background: var(--amber-dim);
  border: 1px solid rgba(243, 156, 18, 0.32);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
}

.claim-flag {
  display: inline-block;
  margin-right: 8px;
  color: #92400e;
}

.done {
  text-align: center;
  color: var(--muted);
  padding: 72px 24px;
  font-size: 1rem;
  background: var(--panel);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
}

.save-status {
  color: var(--muted);
  font-size: 0.82rem;
  align-self: center;
  margin-left: 4px;
}

.error-banner {
  margin-top: 12px;
  padding: 10px 12px;
  background: var(--red-dim);
  border: 1px solid rgba(192, 57, 43, 0.35);
  border-radius: var(--radius-sm);
  color: var(--red);
  font-size: 0.88rem;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  margin: 8px 0;
}

.list-show {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  margin-top: 10px;
}

.list-show-count {
  color: var(--muted);
  font-size: 0.9rem;
}

.list-show-opts {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}

.list-show-opt {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--panel);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
}

.list-show-opt:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}

.list-show-opt.active {
  border-color: var(--accent);
  background: var(--accent-dim);
  color: var(--accent);
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
}

th,
td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
}

th {
  color: var(--text);
  font-weight: 700;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: #f1f5f9;
  border-bottom: 1px solid var(--border-strong);
}

tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--panel-2); }

.list-plain {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

.list-plain li { margin: 4px 0; }

.metric-chip {
  display: inline-block;
  min-width: 34px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
}

.metric-chip.success {
  color: #065f46;
  background: var(--green-dim);
  border-color: rgba(16, 185, 129, 0.32);
}

.metric-chip.warning {
  color: #92400e;
  background: var(--amber-dim);
  border-color: rgba(245, 158, 11, 0.35);
}

.metric-chip.danger {
  color: #991b1b;
  background: var(--red-dim);
  border-color: rgba(239, 68, 68, 0.35);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0f19;
    --panel: #1e293b;
    --panel-2: #243244;
    --panel-hover: #2a3a4d;
    --text: #f8fafc;
    --muted: #94a3b8;
    --faint: #94a3b8;
    --accent: #3b82f6;
    --accent-dim: rgba(59, 130, 246, 0.14);
    --accent-border: rgba(59, 130, 246, 0.35);
    --green: #34d399;
    --green-dim: #064e3b;
    --red: #f87171;
    --red-dim: #450a0a;
    --amber: #fbbf24;
    --amber-dim: #451a03;
    --border: #334155;
    --border-strong: #475569;
  }

  html { color-scheme: dark; }

  .footer-nav a.active {
    color: #dbeafe;
    background: rgba(59, 130, 246, 0.28);
    border-color: rgba(59, 130, 246, 0.45);
  }

  .page-head code,
  .muted code,
  code {
    background: #1f2a3b;
  }

  .flash {
    color: #34d399;
    background: rgba(6, 78, 59, 0.75);
    border-color: rgba(52, 211, 153, 0.32);
  }

  .warn {
    color: #fbbf24;
    background: rgba(69, 26, 3, 0.72);
    border-color: rgba(251, 191, 36, 0.3);
  }

  .claim-flag {
    color: #fbbf24;
  }

  th {
    background: #243244;
  }

  .stat .lbl.pill.pending {
    color: #fbbf24;
    background: rgba(69, 26, 3, 0.75);
    border-color: rgba(251, 191, 36, 0.34);
  }

  .stat .lbl.pill.approved {
    color: #34d399;
    background: rgba(6, 78, 59, 0.76);
    border-color: rgba(52, 211, 153, 0.34);
  }

  .stat .lbl.pill.rejected {
    color: #f87171;
    background: rgba(69, 10, 10, 0.76);
    border-color: rgba(248, 113, 113, 0.34);
  }

  .stat-pending { border-color: rgba(251, 191, 36, 0.3); }
  .stat-approved { border-color: rgba(52, 211, 153, 0.3); }
  .stat-rejected { border-color: rgba(248, 113, 113, 0.3); }

  .metric-chip.success {
    color: #34d399;
    background: rgba(6, 78, 59, 0.76);
    border-color: rgba(52, 211, 153, 0.34);
  }

  .metric-chip.warning {
    color: #fbbf24;
    background: rgba(69, 26, 3, 0.75);
    border-color: rgba(251, 191, 36, 0.34);
  }

  .metric-chip.danger {
    color: #f87171;
    background: rgba(69, 10, 10, 0.76);
    border-color: rgba(248, 113, 113, 0.34);
  }
}

@media (max-width: 640px) {
  .topbar-inner {
    padding: 12px 16px;
  }

  .topbar-head {
    align-items: center;
  }

  main {
    padding: 24px 16px 48px;
  }

  .form-grid,
  .form-grid.cols-4 {
    grid-template-columns: 1fr;
  }

  .card-head { flex-direction: column; }
  .tags { justify-content: flex-start; }
  .page-head h1 { font-size: 1.45rem; }
}

.batch-panel {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.batch-hint { margin: 4px 0 10px; font-size: 0.88rem; }

.batch-counts {
  margin-bottom: 12px;
  font-size: 0.82rem;
  font-family: var(--font-mono);
  color: var(--muted);
}

.batch-actions { flex-wrap: wrap; gap: 8px; }

.tag.segment {
  background: #e8f0fe;
  color: #1a4a8a;
}

.onboarding-form section {
  margin-bottom: 28px;
}

.onboarding-form details {
  margin: 12px 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.onboarding-form label {
  display: block;
  margin: 8px 0;
  font-size: 0.88rem;
}

.onboarding-form input,
.onboarding-form select {
  display: block;
  width: 100%;
  margin-top: 4px;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

/* Wizard: one-screen workflow walkthrough */
.wizard-steps {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.wizard-step {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--text);
  border: 1px solid var(--border);
  background: var(--panel);
}

.wizard-step.wizard-active {
  border-color: var(--accent);
  background: rgba(37, 99, 235, 0.08);
  color: var(--accent);
}

.wizard-step.wizard-done {
  border-color: var(--green);
  background: var(--green-dim);
  color: #065f46;
}

.wizard-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.06);
  font-size: 0.72rem;
}

.wizard-step.wizard-active .wizard-num {
  background: var(--accent);
  color: #fff;
}

.wizard-arrow {
  color: var(--muted);
  font-size: 0.85rem;
}

.wizard-panel {
  max-width: 960px;
  margin-left: auto;
  margin-right: auto;
}

/* Chat-style wizard */
.chat-thread {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 60vh;
  overflow-y: auto;
  padding: 8px 4px;
  margin-bottom: 20px;
}

.chat-bubble {
  display: block;
  max-width: 100%;
  margin-bottom: 4px;
}

.chat-bubble.chat-bot {
  align-self: flex-start;
}

.chat-bubble.chat-user {
  align-self: flex-end;
  text-align: right;
}

.chat-content {
  padding: 0;
  background: none;
  border: none;
  border-radius: 0;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text);
}

.chat-user .chat-content {
  background: none;
  border: none;
  color: var(--text);
}

.chat-content p {
  margin: 0;
}

.chat-content p + p {
  margin-top: 8px;
}

.chat-steps {
  margin: 10px 0 0;
  padding-left: 1.25rem;
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--faint);
}

.chat-steps li + li {
  margin-top: 6px;
}

.chat-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.chat-options.crm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px;
}

.chat-options.crm-grid .btn {
  justify-content: center;
  text-align: center;
}

.chat-action-block {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface, #fafafa);
}

.chat-upload {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-file-picker {
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
}

.chat-file-picker input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.chat-file-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: var(--bg, #fff);
  transition: border-color 0.15s ease;
}

.chat-file-picker:hover .chat-file-trigger,
.chat-file-picker:focus-within .chat-file-trigger {
  border-color: var(--accent, #2563eb);
}

.chat-file-trigger .btn {
  flex-shrink: 0;
  pointer-events: none;
}

.chat-file-name {
  flex: 1;
  min-width: 0;
  font-size: 0.88rem;
  color: var(--faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-file-name.has-file {
  color: var(--text);
}

.chat-action-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.mapping-confirm .mapping-title {
  margin: 0 0 8px;
  font-size: 0.9rem;
  font-weight: 600;
}

.mapping-confirm .mapping-summary {
  margin: 12px 0 0;
  font-size: 0.9rem;
}

.mapping-confirm .mapping-note {
  margin: 10px 0 0;
  font-size: 0.85rem;
}

.mapping-table code {
  font-size: 0.85rem;
}

.mapping-confirm .table-wrap {
  margin-top: 0;
}

.mapping-confirm .table-wrap + .mapping-title {
  margin-top: 14px;
}

.mapping-confirm form {
  display: inline;
}

.quality-alert {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: #fff8eb;
  border: 1px solid #f0d9a8;
  color: #6b4e16;
  font-size: 0.92rem;
}

.quality-banner {
  background: #fffdf7;
  border-color: #f0d9a8;
}

.quality-banner-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.quality-banner-inner p {
  margin: 0;
}

.cleanup-panel .cleanup-form {
  margin-top: 8px;
}

.cleanup-table input[type="text"],
.cleanup-table input[type="email"],
.cleanup-table input[type="url"] {
  width: 100%;
  min-width: 88px;
  box-sizing: border-box;
  font-size: 0.85rem;
}

.cleanup-table .cleanup-issues {
  min-width: 140px;
}

.issue-tag {
  display: inline-block;
  margin: 0 4px 4px 0;
  padding: 2px 6px;
  border-radius: 999px;
  background: #f3f4f6;
  color: #374151;
  font-size: 0.75rem;
  white-space: nowrap;
}

.cleanup-row-critical {
  background: #fff5f5;
}

.cleanup-select {
  width: 44px;
  text-align: center;
  white-space: nowrap;
}

.cleanup-select input[type="checkbox"] {
  margin: 0;
}

.cleanup-actions {
  margin-top: 14px;
}

.chat-upload textarea,
.chat-upload input[type="text"] {
  width: 100%;
  box-sizing: border-box;
}

.chat-bubble.chat-active .chat-content {
  border: none;
  box-shadow: none;
}

/* Typeform-style wizard: one question per screen */
.tf-wizard {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 20px 80px;
}

.tf-topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 0 26px;
}

.tf-brand {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.tf-progress {
  flex: 1;
  height: 4px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
}

.tf-progress span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
  transition: width 0.4s ease;
}

.tf-exit {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
}

.tf-exit:hover {
  color: var(--text);
  text-decoration: none;
}

.tf-screen {
  min-height: 52vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  animation: tf-fade 0.35s ease;
}

@keyframes tf-fade {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.tf-kicker {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 10px;
}

.tf-question {
  margin: 0;
  font-size: 2rem;
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}

.tf-question-sm {
  font-size: 1.4rem;
}

.tf-help {
  margin: 14px 0 0;
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--muted);
}

.tf-steps {
  margin: 20px 0 0;
  padding-left: 1.3rem;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--faint);
}

.tf-steps li + li {
  margin-top: 8px;
}

.tf-answer {
  margin-top: 30px;
}

.tf-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tf-option {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 500;
  transition: border-color 0.15s, background 0.15s, transform 0.08s;
}

.tf-option:hover {
  border-color: var(--accent);
  background: var(--accent-dim);
  text-decoration: none;
  transform: translateY(-1px);
}

.tf-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--panel-2);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
}

.tf-option:hover .tf-key {
  border-color: var(--accent);
  color: var(--accent);
}

.tf-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.tf-logo svg {
  width: 100%;
  height: 100%;
  display: block;
}

.tf-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 26px;
}

.tf-step-label {
  margin: 0 0 8px;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.tf-why {
  margin: 12px 0 0;
  font-size: 1.05rem;
  line-height: 1.5;
  color: var(--muted);
}

.setup-checklist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.setup-checklist li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  font-weight: 500;
}

.setup-chip {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
}

.setup-chip.ok { color: var(--accent); }
.setup-chip.need { color: #e8a45a; }
.setup-chip.skip { color: var(--faint); }

.setup-fields {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.setup-fields label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 600;
  font-size: 0.95rem;
}

.setup-fields input[type="password"],
.setup-fields input[type="text"],
.setup-fields input[type="email"],
.setup-fields input[type="url"] {
  font: inherit;
  font-weight: 400;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-strong);
  background: var(--panel);
  color: var(--text);
}

.setup-provider-options .tf-option {
  position: relative;
  cursor: pointer;
}

.setup-provider-options .tf-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.setup-provider-options .tf-option.selected {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.setup-done-actions .tf-continue {
  min-width: 200px;
  text-align: center;
}

.tf-actions form {
  display: inline;
}

.tf-upload {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tf-file-picker {
  position: relative;
  display: block;
  cursor: pointer;
}

.tf-file-picker input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.tf-file-face {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 26px 22px;
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--panel-2);
  transition: border-color 0.15s, background 0.15s;
}

.tf-file-picker:hover .tf-file-face,
.tf-file-picker:focus-within .tf-file-face {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.tf-file-picker.has-file .tf-file-face {
  border-style: solid;
  border-color: var(--accent);
}

.tf-file-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 1.1rem;
  font-weight: 700;
}

.tf-file-name {
  flex: 1;
  min-width: 0;
  font-size: 1rem;
  color: var(--faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tf-input {
  width: 100%;
  box-sizing: border-box;
  padding: 14px 16px;
  font: 1rem/1.5 var(--font);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
}

.tf-input:focus {
  outline: none;
  border-color: var(--accent);
}

.tf-answer .form-row,
.tf-answer .form-grid {
  margin-top: 0;
}

@media (max-width: 560px) {
  .tf-question { font-size: 1.6rem; }
  .tf-screen { min-height: 44vh; }
}

.workflow-step-content {
  border-top: 1px solid var(--border);
  padding-top: 20px;
}

.wizard-source-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 16px;
}

@media (min-width: 640px) {
  .wizard-source-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.wizard-source-card {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
}

.wizard-source-card h3 {
  margin: 0 0 6px;
  font-size: 1rem;
}

.wizard-source-card .form-row {
  margin-top: 12px;
  align-items: flex-end;
}

.wizard-source-card textarea {
  min-width: 240px;
  flex: 1 1 auto;
}

.wizard-preview-notice {
  margin-top: 16px;
  padding: 12px;
  background: var(--amber-dim);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-sm);
}

.wizard-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* Step inspect panels: click-through previews at each pipeline step */
.step-inspect-panel {
  padding: 16px;
  background: var(--panel-2);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
}

.step-inspect {
  margin-top: 14px;
  padding: 14px;
  background: var(--panel-2);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
}

.step-inspect summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text);
}

.step-inspect summary:hover {
  color: var(--accent);
}

.step-inspect[open] summary {
  margin-bottom: 10px;
}

.inspect-panel-body {
  margin-top: 10px;
}

.inspect-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 640px) {
  .inspect-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.preview-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin: 16px 0 6px;
}

.preview-label:first-child {
  margin-top: 0;
}

.preview-subject {
  padding: 8px 10px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
}

.preview-body {
  margin: 0;
  padding: 10px 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.84rem;
  line-height: 1.55;
  white-space: pre-wrap;
  max-height: 320px;
  overflow: auto;
}

.preview-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.preview-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 10px 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.preview-row:hover,
.preview-row:focus-visible {
  border-color: var(--accent-border);
  background: var(--panel-hover);
}

.preview-row-main {
  font-weight: 600;
  font-size: 0.88rem;
}

.preview-row-sub {
  flex: 1 1 auto;
  font-size: 0.8rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 160px;
}

/* Reusable modal for message/hook previews */
body.modal-open {
  overflow: hidden;
}

.preview-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.preview-modal[hidden] {
  display: none;
}

.preview-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
}

.preview-modal-panel {
  position: relative;
  width: 100%;
  max-width: 720px;
  max-height: calc(100vh - 32px);
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.preview-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.preview-modal-head h3 {
  margin: 0;
  font-size: 1.1rem;
}

.preview-modal-body {
  padding: 18px;
  overflow: auto;
}

.tag.hook[data-hook-preview] {
  cursor: pointer;
  background: var(--accent-dim);
  border-color: var(--accent-border);
  color: var(--accent);
}

.tag.hook[data-hook-preview]:hover,
.tag.hook[data-hook-preview]:focus-visible {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

a.tag {
  text-decoration: none;
}

a.tag:hover,
a.tag:focus-visible {
  filter: brightness(0.95);
}

.list-plain {
  list-style: none;
  margin: 0;
  padding: 0;
}

.list-plain li + li {
  margin-top: 4px;
}

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

body.mode-start {
  /* Objective flow uses the shared shell; keep atmosphere subtle */
}

main.main-start,
.app-main.main-start {
  max-width: 1200px;
  padding: 44px 52px 80px;
  position: relative;
  min-height: auto;
}

.start-shell {
  position: relative;
  min-height: calc(100vh - 120px);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 20px 48px;
}

.start-atmosphere {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 80%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 50%),
    radial-gradient(ellipse 50% 35% at 0% 60%, rgba(12, 26, 36, 0.06), transparent 45%);
  animation: start-atmosphere-drift 18s ease-in-out infinite alternate;
}

@keyframes start-atmosphere-drift {
  from { opacity: 0.85; transform: scale(1); }
  to { opacity: 1; transform: scale(1.03); }
}

.start-stage {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 640px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  flex: 1;
}

.start-brand {
  text-align: center;
  padding: 28px 12px 8px;
  animation: start-rise 0.7s ease-out both;
}

.start-brand-compact {
  padding: 4px 12px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  animation: start-rise 0.4s ease-out both;
}

.start-mark {
  display: inline-flex;
  width: 40px;
  height: 40px;
  color: var(--start-glow);
}

.start-brand-compact .start-mark {
  width: 22px;
  height: 22px;
}

.start-mark svg {
  width: 100%;
  height: 100%;
}

.start-wordmark {
  margin: 12px 0 8px;
  font-size: clamp(2.4rem, 6vw, 3.4rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--start-ink);
  line-height: 1.05;
}

.start-wordmark-sm {
  margin: 0;
  font-size: 1rem;
  font-weight: 650;
  color: var(--start-ink);
  letter-spacing: -0.02em;
}

.start-tagline {
  margin: 0 auto;
  max-width: 28rem;
  font-size: 1.05rem;
  color: var(--faint);
  line-height: 1.45;
}

.start-flash {
  margin: 0;
}

.start-chat {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  animation: start-rise 0.8s ease-out 0.12s both;
}

.start-thread.chat-thread {
  max-height: none;
  flex: 1;
  overflow-y: auto;
  padding: 4px 2px 24px;
  gap: 18px;
  margin-bottom: 0;
}

body.mode-start .chat-bubble.chat-bot .chat-content > p:first-child {
  font-size: 1.15rem;
  font-weight: 550;
  color: var(--start-ink);
  letter-spacing: -0.01em;
}

body.mode-start .chat-hint {
  margin-top: 6px !important;
  font-size: 0.9rem;
  color: var(--muted);
  font-weight: 400;
}

body.mode-start .chat-bubble.chat-user .chat-content {
  display: inline-block;
  text-align: left;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--border);
  border-radius: 14px 14px 4px 14px;
  padding: 10px 14px;
  box-shadow: 0 1px 2px rgba(12, 26, 36, 0.04);
  animation: start-bubble-in 0.35s ease-out both;
}

body.mode-start .chat-bubble.chat-bot.chat-active .chat-content {
  width: 100%;
}

.start-composer {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

.start-composer textarea {
  width: 100%;
  resize: vertical;
  min-height: 72px;
  padding: 14px 16px;
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  font: inherit;
  color: var(--text);
  box-shadow: 0 8px 28px rgba(12, 26, 36, 0.06);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.start-composer textarea:focus {
  outline: none;
  border-color: var(--start-glow);
  box-shadow: 0 0 0 3px rgba(26, 107, 122, 0.18), 0 8px 28px rgba(12, 26, 36, 0.06);
}

.start-composer-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.start-send {
  align-self: flex-end;
}

.start-back-inline {
  margin-top: 8px;
}

.start-prefs {
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.start-prefs-label {
  margin: 12px 0 8px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.start-chips {
  gap: 8px;
}

.start-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  font-size: 0.88rem;
  cursor: pointer;
  user-select: none;
}

.start-chip:has(input:checked) {
  border-color: var(--start-glow);
  background: rgba(26, 107, 122, 0.1);
  color: var(--start-ink);
}

.start-chip input {
  accent-color: var(--start-glow);
}

.start-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  font-size: 0.92rem;
  color: var(--faint);
}

.start-plan {
  padding: 14px 0 0;
}

.start-plan-title {
  margin: 0 0 8px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.start-plan-actions {
  margin-top: 12px;
}

@keyframes start-rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes start-bubble-in {
  from { opacity: 0; transform: translateY(6px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 640px) {
  .start-shell {
    padding: 0 14px 32px;
  }

  .start-wordmark {
    font-size: 2.1rem;
  }

  .start-composer-actions {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .start-send {
    align-self: stretch;
  }
}

.objective-panel {
  width: 100%;
  max-width: 720px;
  margin: 8px auto 0;
}

.objective-panel-inner {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px 28px 22px;
  box-shadow: 0 18px 40px rgba(12, 26, 36, 0.06);
}

html[data-theme="dark"] .objective-panel-inner {
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

.objective-panel-title {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.objective-panel-hint {
  margin: 0 0 18px;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.objective-other-form {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.objective-other-form textarea {
  width: 100%;
  min-height: 88px;
  resize: vertical;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--ink);
  padding: 14px 16px;
  font: inherit;
}

.objective-panel-actions {
  display: flex;
  justify-content: flex-end;
}

.start-chip-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  grid-auto-rows: 1fr;
}

.start-chip-grid > form,
.objective-pick-form {
  display: grid;
  min-height: 52px;
}

.start-obj-chip {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 52px;
  text-align: center;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  cursor: pointer;
  font: inherit;
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.start-obj-chip:hover,
.start-obj-chip:focus-visible {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  box-shadow: none;
  outline: none;
  transform: translateY(-1px);
}

.start-obj-label {
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.25;
}

.start-obj-chip-soon {
  position: relative;
  overflow: hidden;
  opacity: 0.9;
  cursor: not-allowed;
  user-select: none;
  background: var(--surface2);
  color: var(--ink-soft);
}

.start-obj-chip-soon .start-obj-label {
  opacity: 0.55;
}

.start-obj-soon-stamp {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 1;
  padding: 2px 7px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transform: none;
  pointer-events: none;
  box-shadow: none;
}

@media (max-width: 420px) {
  .start-chip-grid {
    grid-template-columns: 1fr;
  }

  .start-chip-grid > form,
  .objective-pick-form,
  .start-obj-chip {
    min-height: 48px;
  }
}



/* —— Design system additions (control plane redesign) —— */
.btn.danger {
  border-color: var(--bad);
  color: var(--bad);
  background: transparent;
}
.btn.danger:hover:not(:disabled) {
  background: var(--bad-soft);
}

.chip,
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
  background: var(--surface2);
  color: var(--ink-soft);
  border: 1px solid transparent;
}
.chip.mono,
.tag.mono {
  font-family: var(--font-mono);
  font-weight: 500;
}
.chip.accent,
.tag.hook {
  background: var(--accent-soft);
  color: var(--accent);
}
.tag.pending,
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.tag.approved,
.chip.good,
.tag.success { background: var(--good-soft); color: var(--good); }
.tag.rejected,
.chip.bad,
.tag.warn { background: var(--bad-soft); color: var(--bad); }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
  background: var(--surface2);
  color: var(--ink-soft);
}
.status-pill .pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--good);
  animation: pulseGlow 1.6s ease-in-out infinite;
}
@keyframes pulseGlow {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.warn-banner {
  background: var(--warn-soft);
  color: var(--warn);
  border: 1px solid color-mix(in srgb, var(--warn) 25%, transparent);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.worker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 14px;
}
.worker-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.worker-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px -12px rgba(0,0,0,.18);
}
.worker-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}
.worker-card h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.worker-card .layer {
  font-size: 12px;
  color: var(--ink-soft);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.worker-card .outcome {
  font-size: 13.5px;
  color: var(--ink);
  margin: 0;
}
.worker-card .kpi {
  font-size: 13px;
  color: var(--accent);
  font-weight: 600;
}
.worker-card-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.worker-card-footer .gate {
  margin-left: auto;
  font-size: 12px;
  color: var(--ink-soft);
}

.objective-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 18px;
}
.objective-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
  text-align: left;
}
.objective-chip.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}
.objective-chip.soon {
  opacity: 0.65;
  cursor: not-allowed;
}
.objective-chip .soon-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--ink-soft);
  background: var(--surface2);
  padding: 2px 7px;
  border-radius: 100px;
}

.compose-center {
  max-width: 640px;
  margin: 0 auto;
}
.hero-mark {
  width: 22px;
  height: 19px;
  background: var(--accent);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  margin: 0 auto 14px;
}
.brief-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.brief-pill {
  padding: 8px 14px;
  border-radius: 100px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
.brief-pill:hover { opacity: 1; color: var(--ink); }
.brief-pill.active {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: transparent;
}

.pipeline-stages {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.pipeline-stage {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 180px;
}
.pipeline-stage .idx {
  font-family: var(--font-mono);
  color: var(--accent);
  font-weight: 600;
  font-size: 13px;
}
.pipeline-stage h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.1rem;
}
.pipeline-stage-metrics {
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  display: grid;
  gap: 6px;
  font-size: 13px;
}
.pipeline-stage-metrics .row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.pipeline-stage-metrics .row span:first-child { color: var(--ink-soft); }
.pipeline-stage-metrics .row strong { color: var(--ink); font-weight: 650; }
.pipeline-stage-footer {
  margin-top: auto;
  padding-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.pipeline-arrow {
  display: none;
}
@media (max-width: 720px) {
  .pipeline-stages { grid-template-columns: 1fr; }
}

.analytics-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.analytics-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}
.analytics-grid.equal { grid-template-columns: 1fr 1fr; }
.reject-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.reject-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.reject-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--bad-soft);
  color: var(--bad);
  font-size: 12px;
  font-weight: 700;
}
@media (max-width: 900px) {
  .analytics-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .analytics-grid,
  .analytics-grid.equal { grid-template-columns: 1fr; }
}

.bar-list { display: flex; flex-direction: column; gap: 12px; }
.bar-row { display: flex; flex-direction: column; gap: 4px; }
.bar-row-top {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
}
.bar-row-top .label { font-family: var(--font-mono); color: var(--ink-soft); }
.bar-track {
  height: 6px;
  border-radius: 100px;
  background: var(--surface2);
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  border-radius: 100px;
  background: var(--accent);
}
.bar-fill.good { background: var(--good); }

.network-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.network-chip {
  padding: 8px 12px;
  border-radius: 100px;
  border: 1px solid var(--border);
  background: var(--surface2);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
}
.network-chip.active,
.network-chip:has(input:checked) {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: transparent;
}
.network-chip input { display: none; }

.shortcut-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.shortcut-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 13px;
  color: var(--ink-soft);
}
.shortcut-chip kbd {
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--surface2);
  padding: 2px 6px;
  border-radius: 6px;
  color: var(--ink);
}

.crm-option-list { display: flex; flex-direction: column; gap: 8px; }
.crm-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  cursor: pointer;
}
.crm-option.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.crm-badge {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
  flex: none;
}

.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}
.table-wrap table {
  width: 100%;
  border-collapse: collapse;
}
.table-wrap th,
.table-wrap td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-size: 13.5px;
}
.table-wrap th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  background: var(--surface2);
}

textarea,
input[type="text"],
input[type="password"],
input[type="url"],
input[type="email"],
input[type="datetime-local"],
input[type="number"],
select {
  font-family: var(--font);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  background: var(--surface2);
  color: var(--ink);
  font-size: 14px;
}
textarea.mono {
  font-family: var(--font-mono);
  font-size: 13.5px;
}

.flash {
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 16px;
}
.flash-error {
  background: var(--bad-soft);
  color: var(--bad);
}

.metric-chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 100px;
  background: var(--surface2);
  font-family: var(--font-mono);
  font-size: 12px;
}
.metric-chip.success { background: var(--good-soft); color: var(--good); }
.metric-chip.warning { background: var(--warn-soft); color: var(--warn); }
.metric-chip.danger { background: var(--bad-soft); color: var(--bad); }

.list-plain { list-style: none; padding: 0; margin: 0; }
.list-plain li { padding: 6px 0; }

.split-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 900px) {
  .split-2 { grid-template-columns: 1fr; }
  .objective-grid { grid-template-columns: 1fr; }
}

/* Auth (login / 2FA) */
.auth-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  margin: 0;
  background: linear-gradient(160deg, var(--bg, #232321) 0%, #2e3532 50%, #232321 100%);
  font-family: var(--font-body, Inter, sans-serif);
  color: var(--ink, #e8eee9);
}
.auth-card {
  width: min(400px, 92vw);
  padding: 32px 28px;
  border-radius: 16px;
  background: var(--surface, #2e2d2a);
  border: 1px solid color-mix(in srgb, var(--ink, #fff) 10%, transparent);
}
.auth-card-wide { width: min(440px, 92vw); }
.auth-brand {
  font-family: var(--font-display, "Space Grotesk", sans-serif);
  font-size: 1.75rem;
  margin: 0 0 8px;
}
.auth-sub { margin: 0 0 20px; opacity: 0.75; line-height: 1.4; }
.auth-error { color: var(--bad, #e85d5d); margin: 0 0 12px; }
.auth-form { display: grid; gap: 14px; }
.auth-form label { display: grid; gap: 6px; font-size: 0.9rem; }
.auth-form input {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--ink, #fff) 18%, transparent);
  background: var(--surface2, #101612);
  color: inherit;
}
.auth-qr { display: block; margin: 0 auto 16px; border-radius: 8px; background: #fff; }
.auth-muted { font-size: 0.85rem; opacity: 0.7; word-break: break-all; }
.auth-muted a { color: var(--accent, #0ea982); }
.auth-alt {
  margin: 18px 0 0;
  text-align: center;
  font-size: 0.9rem;
}
.auth-alt a { color: var(--accent); font-weight: 600; }

/* Demo intake */
.demo-body {
  background:
    radial-gradient(ellipse 70% 45% at 50% -5%, color-mix(in srgb, var(--accent) 28%, transparent), transparent 60%),
    linear-gradient(160deg, var(--bg) 0%, #2a2f2c 55%, var(--bg) 100%);
}
.demo-shell {
  width: min(480px, 94vw);
  padding: 28px 12px 48px;
}
.demo-brand {
  text-align: center;
  margin-bottom: 22px;
}
.demo-brand .brand-mark {
  display: inline-block;
  margin-bottom: 10px;
}
.demo-wordmark {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0 0 8px;
  color: var(--ink);
}
.demo-tagline {
  margin: 0;
  color: var(--ink-soft);
  font-size: 1.02rem;
  line-height: 1.45;
}
.demo-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 26px 24px 22px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22);
}
.demo-card-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0 0 6px;
}
.demo-card-hint {
  margin: 0 0 18px;
  color: var(--ink-soft);
  font-size: 0.95rem;
}
.demo-form .btn { width: 100%; margin-top: 4px; }
.demo-foot { margin: 16px 0 0; text-align: center; font-size: 0.9rem; }
.demo-foot a { color: var(--accent); font-weight: 600; }

.demo-welcome {
  width: 100%;
  margin: 0 0 18px;
  padding: 16px 18px;
  border-radius: 14px;
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
}
.demo-welcome-kicker {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--accent);
}
.demo-welcome-copy {
  margin: 0 0 12px;
  color: var(--ink);
  font-size: 0.95rem;
}
.demo-welcome-creds {
  display: grid;
  gap: 8px;
  margin: 0;
}
.demo-welcome-creds > div {
  display: flex;
  gap: 10px;
  align-items: baseline;
}
.demo-welcome-creds dt {
  min-width: 72px;
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
}
.demo-welcome-creds dd { margin: 0; }
.demo-welcome-creds code {
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--surface);
}

.sidebar-user {
  padding: 12px 14px 8px;
  display: grid;
  gap: 8px;
  border-top: 1px solid color-mix(in srgb, var(--ink, #fff) 8%, transparent);
}
.sidebar-user-name { font-weight: 600; font-size: 0.9rem; }
.sidebar-user-client { font-size: 0.75rem; opacity: 0.65; font-family: var(--font-mono); }
.sidebar-switch-client select {
  width: 100%;
  margin-top: 4px;
  padding: 6px 8px;
  border-radius: 8px;
  background: var(--surface2);
  color: inherit;
  border: 1px solid color-mix(in srgb, var(--ink, #fff) 14%, transparent);
}
