:root {
  --bg: #0b0b0b;
  --bg-subtle: #111111;
  --surface: #171717;
  --surface-hover: #1c1c1c;
  --surface-elevated: #222222;
  --surface-overlay: rgba(17, 17, 17, 0.92);

  --border: rgba(255, 255, 255, 0.07);
  --border-hover: rgba(255, 255, 255, 0.12);
  --border-active: rgba(255, 255, 255, 0.20);

  --text: #ededed;
  --text-secondary: #878680;
  --text-muted: #4e4e49;

  --accent: #e0dfda;
  --accent-hover: #ffffff;
  --accent-soft: #a8a79f;
  --accent-dim: rgba(237, 237, 236, 0.06);

  --success: #34d399;
  --success-dim: rgba(52, 211, 153, 0.10);
  --warning: #fbbf24;
  --warning-dim: rgba(251, 191, 36, 0.10);
  --danger: #f87171;
  --danger-dim: rgba(248, 113, 113, 0.10);

  --font-display: "Instrument Serif", Georgia, serif;
  --font-body: "DM Sans", system-ui, sans-serif;
  --font-code: "IBM Plex Mono", monospace;

  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.4);

  --transition: 150ms ease;
  --transition-fast: 100ms ease;
  --transition-spring: 250ms cubic-bezier(0.34, 1.2, 0.64, 1);
}

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

html {
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  font-family: var(--font-body);
  font-weight: 400;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  position: relative;
}

#app {
  min-height: 100vh;
}

a {
  color: var(--accent-soft);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--text);
}

::selection {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 400;
  font-style: normal;
  letter-spacing: -0.01em;
  line-height: 1.15;
  color: var(--text);
}

h1 { font-size: clamp(2rem, 4.5vw, 3.2rem); }
h2 { font-size: clamp(1.4rem, 2.5vw, 1.8rem); }
h3 { font-size: 1.1rem; }
h4 {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

p {
  color: var(--text-secondary);
  line-height: 1.65;
}

/* ── SHELL ── */

.shell {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  padding: 20px 0;
  background: var(--bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.brand {
  padding: 0 20px 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}

.brand h1 {
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  color: var(--text);
}

.brand p {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 8px 8px;
}

.nav-section-label {
  font-family: var(--font-body);
  font-size: 0.6rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 14px 12px 6px;
}

.nav button {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 400;
  text-align: left;
  padding: 8px 12px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 10px;
  border-left: 2px solid transparent;
}

.nav button:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
}

.nav button.active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  border-left-color: var(--text);
}

.nav-icon {
  font-size: 1rem;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.5;
}

.nav button.active .nav-icon {
  opacity: 0.9;
}

.nav-icon svg {
  width: 16px;
  height: 16px;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  margin-top: auto;
}

.sidebar-footer .user-email {
  font-size: 0.7rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-footer .user-role {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-body);
  font-size: 0.6rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  margin-bottom: 12px;
}

.sidebar-footer button {
  appearance: none;
  border: none;
  background: none;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 400;
  cursor: pointer;
  padding: 0;
  transition: color var(--transition);
}

.sidebar-footer button:hover {
  color: var(--danger);
}

.content {
  padding: 32px;
  overflow-y: auto;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.topbar-left .topbar-workspace {
  font-family: var(--font-body);
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}

.topbar-left h2 {
  font-size: 1.5rem;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

/* ── BUTTONS ── */

.button {
  appearance: none;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #0b0b0b;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 9px 18px;
  cursor: pointer;
  border-radius: var(--radius);
  transition: all var(--transition);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.button:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

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

.button.secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border-hover);
}

.button.secondary:hover {
  border-color: var(--border-active);
  background: rgba(255, 255, 255, 0.04);
}

.button.warn {
  background: transparent;
  color: var(--warning);
  border-color: rgba(251, 191, 36, 0.25);
}

.button.warn:hover {
  background: var(--warning-dim);
  border-color: rgba(251, 191, 36, 0.4);
}

.button.bad {
  background: transparent;
  color: var(--danger);
  border-color: rgba(248, 113, 113, 0.25);
}

.button.bad:hover {
  background: var(--danger-dim);
  border-color: rgba(248, 113, 113, 0.4);
}

.button.ghost {
  background: transparent;
  color: var(--text-secondary);
  border: none;
  padding: 8px 12px;
}

.button.ghost:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none !important;
}

/* ── CARDS & PANELS ── */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  position: relative;
}

.card-accent {
  display: none;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.section-header h3 {
  font-size: 1.05rem;
}

.hero {
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
}

.hero h2 {
  margin-bottom: 8px;
}

.hero p {
  max-width: 720px;
}

.hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 20px;
}

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

/* ── GRID LAYOUTS ── */

.grid {
  display: grid;
  gap: 16px;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* ── FORMS ── */

.form-grid {
  display: grid;
  gap: 16px;
}

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

.field-group {
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-subtle);
}

.field-group h4 {
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

label {
  display: block;
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}

input, select, textarea {
  width: 100%;
  border: 1px solid var(--border-hover);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.8rem;
  padding: 9px 12px;
  border-radius: var(--radius);
  transition: all var(--transition);
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--text-muted);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.04);
}

textarea {
  min-height: 100px;
  resize: vertical;
}

.checkbox-field {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-subtle);
  cursor: pointer;
  transition: border-color var(--transition);
}

.checkbox-field:hover {
  border-color: var(--border-hover);
}

.checkbox-field input[type="checkbox"] {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 2px;
  accent-color: var(--text-secondary);
  border-radius: 3px;
}

.checkbox-field label {
  margin-bottom: 0;
  text-transform: none;
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--text);
  cursor: pointer;
}

/* ── TAGS, PILLS, BADGES ── */

.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.65rem;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.02);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 400;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-hover);
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.02);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-body);
  font-size: 0.65rem;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
}

.status-badge.live {
  color: var(--success);
  border: 1px solid rgba(52, 211, 153, 0.25);
  background: var(--success-dim);
}

.status-badge.paused {
  color: var(--warning);
  border: 1px solid rgba(251, 191, 36, 0.25);
  background: var(--warning-dim);
}

.status-badge.draft {
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.status-badge.archived {
  color: var(--danger);
  border: 1px solid rgba(248, 113, 113, 0.25);
  background: var(--danger-dim);
}

.tag-row, .pill-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.tab-row {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

.tab-row button {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 400;
  padding: 10px 18px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all var(--transition);
}

.tab-row button:hover {
  color: var(--text);
}

.tab-row button.active {
  color: var(--text);
  border-bottom-color: var(--text);
}

/* ── STATUS DOT ── */

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.status-dot.live { background: var(--success); }
.status-dot.paused { background: var(--warning); }
.status-dot.draft { background: var(--text-muted); }
.status-dot.archived { background: var(--danger); }

/* ── CODE BLOCKS ── */

.mono {
  font-family: var(--font-code);
  font-size: 0.72rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-all;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  overflow: auto;
  max-height: 300px;
  position: relative;
  color: var(--text-secondary);
}

.code-wrapper {
  position: relative;
}

.code-wrapper .copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  appearance: none;
  border: 1px solid var(--border-hover);
  background: var(--surface);
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.6rem;
  font-weight: 500;
  padding: 3px 8px;
  cursor: pointer;
  z-index: 2;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.code-wrapper .copy-btn:hover {
  color: var(--text);
  border-color: var(--border-active);
  background: var(--surface-hover);
}

.code-wrapper .copy-btn.copied {
  color: var(--success);
  border-color: rgba(52, 211, 153, 0.3);
  background: var(--success-dim);
}

/* ── LISTS ── */

.list {
  display: grid;
  gap: 8px;
}

.list-item {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-subtle);
  transition: border-color var(--transition);
}

.list-item:hover {
  border-color: var(--border-hover);
}

/* ── SPLIT / FLEX HELPERS ── */

.split {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

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

.flex-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ── COLLAPSIBLE ── */

.collapsible-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-subtle);
  cursor: pointer;
  user-select: none;
  transition: all var(--transition);
}

.collapsible-header:hover {
  border-color: var(--border-hover);
  background: var(--surface-hover);
}

.collapsible-header h4 {
  margin: 0;
  border: none;
  padding: 0;
}

.collapsible-toggle {
  color: var(--text-muted);
  font-size: 0.7rem;
  font-family: var(--font-body);
  transition: transform var(--transition);
}

.collapsible-header.open .collapsible-toggle {
  transform: rotate(90deg);
}

.collapsible-header.open {
  border-radius: var(--radius) var(--radius) 0 0;
}

.collapsible-body {
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 14px;
  background: var(--surface);
  display: none;
}

.collapsible-body.open {
  display: block;
}

/* ── PROGRESS BAR / STEPPER ── */

.progress-stepper {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 20px 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
}

.step-item {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.step-item:last-child {
  flex: 0;
}

.step-circle {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.72rem;
  flex-shrink: 0;
  border: 1.5px solid var(--border-hover);
  border-radius: 50%;
  color: var(--text-muted);
  background: var(--bg);
  transition: all var(--transition);
}

.step-item.done .step-circle {
  background: var(--text);
  border-color: var(--text);
  color: var(--bg);
}

.step-item.active .step-circle {
  border-color: var(--text);
  color: var(--text);
}

.step-label {
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--text-muted);
  white-space: nowrap;
}

.step-item.done .step-label { color: var(--text); }
.step-item.active .step-label { color: var(--text); }

.step-line {
  flex: 1;
  height: 1px;
  background: var(--border-hover);
  margin: 0 8px;
  min-width: 16px;
}

.step-line.done {
  background: var(--text-muted);
}

/* ── SEARCH INPUT ── */

.search-input {
  position: relative;
  margin-bottom: 12px;
}

.search-input input {
  padding-left: 36px;
}

.search-input::before {
  content: "⌕";
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.9rem;
  pointer-events: none;
}

/* ── TOAST ── */

#toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 400;
  padding: 12px 18px;
  border: 1px solid var(--border-hover);
  border-radius: var(--radius);
  background: var(--surface-elevated);
  color: var(--text);
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: toast-in 250ms ease forwards;
  border-left: 3px solid var(--text-muted);
  max-width: 380px;
}

.toast.bad { border-left-color: var(--danger); }
.toast.warn { border-left-color: var(--warning); }
.toast.good { border-left-color: var(--success); }

.toast.removing {
  animation: toast-out 200ms ease forwards;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes toast-out {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(30px); }
}

/* ── CONFIRM DIALOG ── */

#dialog-container:empty {
  display: none;
}

.dialog-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 10001;
  display: grid;
  place-items: center;
  padding: 24px;
  animation: fade-in 150ms ease;
}

.dialog-box {
  background: var(--surface);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-lg);
  padding: 28px;
  max-width: 400px;
  width: 100%;
  box-shadow: var(--shadow-lg);
}

.dialog-box h3 {
  margin-bottom: 10px;
  font-size: 1.1rem;
}

.dialog-box p {
  margin-bottom: 24px;
  font-size: 0.85rem;
}

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

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

/* ── LANDING PAGE ── */

.landing {
  min-height: 100vh;
  background: var(--bg);
}

.landing-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 48px;
  border-bottom: 1px solid var(--border);
  background: rgba(11, 11, 11, 0.85);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.landing-nav .brand-name {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--text);
}

.landing-hero {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 100px 48px 80px;
}

.landing-hero .landing-tag {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 24px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.landing-hero h1 {
  font-size: clamp(2.8rem, 6vw, 4.5rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  max-width: 780px;
  margin-bottom: 24px;
}

.landing-hero h1 .accent-word {
  font-style: italic;
}

.landing-hero p {
  max-width: 520px;
  font-size: 0.95rem;
  line-height: 1.7;
  margin-bottom: 40px;
}

.landing-hero .hero-actions {
  display: flex;
  gap: 16px;
  align-items: center;
}

.landing-hero .hero-actions .learn-link {
  font-size: 0.8rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: color var(--transition);
  background: none;
  border: none;
  font-family: var(--font-body);
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.landing-hero .hero-actions .learn-link:hover {
  color: var(--text);
}

.landing-pills {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 36px;
}

.landing-trust {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 20px 48px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  justify-content: center;
}

.landing-trust span {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.landing-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1px;
  background: var(--border);
}

.landing-feature {
  padding: 40px 36px;
  background: var(--bg);
  transition: background var(--transition);
}

.landing-feature:hover {
  background: var(--bg-subtle);
}

.landing-feature .feature-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.landing-feature .feature-icon svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.landing-feature strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.05rem;
  margin-bottom: 8px;
  color: var(--text);
}

.landing-feature p {
  font-size: 0.82rem;
  line-height: 1.6;
}

.landing-footer {
  padding: 32px 48px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.landing-footer .brand-name {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--text-secondary);
}

.landing-footer p {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* ── AUTH ── */

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
}

.auth-card {
  max-width: 380px;
  width: 100%;
  text-align: center;
}

.auth-card .auth-brand {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--text);
  margin-bottom: 8px;
}

.auth-card .auth-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 36px;
  line-height: 1.6;
}

.auth-card h2 {
  font-size: 1.4rem;
  margin-bottom: 8px;
}

.auth-card > p {
  margin-bottom: 32px;
  font-size: 0.85rem;
}

.auth-card .button {
  width: 100%;
  justify-content: center;
}

.auth-card .auth-support {
  margin-top: 24px;
  font-size: 0.75rem;
}

/* ── SUBSCRIPTION GATE ── */

.sub-gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
}

.sub-gate-card {
  max-width: 920px;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px;
}

.sub-gate-card h2 {
  margin-bottom: 8px;
}

.sub-gate-card .sub-status {
  margin: 20px 0;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
}

.sub-gate-card .sub-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 20px;
}

.stripe-pricing-wrap {
  margin-top: 20px;
}

.stripe-pricing-wrap stripe-pricing-table {
  display: block;
  width: 100%;
}

/* ── ONBOARDING WIZARD ── */

.onboarding-shell {
  min-height: 100vh;
  padding: 0;
}

.onboarding-content {
  padding: 28px;
  max-width: 880px;
  margin: 0 auto;
}

.onboarding-hero {
  padding: 28px;
  margin-bottom: 0;
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: var(--surface);
}

.onboarding-hero h2 {
  margin-bottom: 6px;
}

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

.strategy-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-subtle);
  cursor: pointer;
  transition: all var(--transition);
  user-select: none;
}

.strategy-card:hover {
  border-color: var(--border-hover);
  background: var(--surface-hover);
}

.strategy-card.selected {
  border-color: var(--border-active);
  background: rgba(255, 255, 255, 0.04);
}

.strategy-card input[type="checkbox"] {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 2px;
  accent-color: var(--text-secondary);
}

.strategy-card-info strong {
  display: block;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.82rem;
  margin-bottom: 3px;
}

.strategy-card-info .strategy-desc {
  font-size: 0.72rem;
  color: var(--text-secondary);
}

.strategy-card-info .strategy-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 3px;
}

.config-progress-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-subtle);
}

.config-progress-row .row-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.config-progress-row .row-left strong {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.8rem;
}

.progress-summary {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-muted);
  padding: 10px 0;
}

.wizard-complete {
  text-align: center;
  padding: 48px 28px;
}

.wizard-complete .check-icon {
  font-size: 2.5rem;
  color: var(--success);
  margin-bottom: 16px;
}

.wizard-complete h2 {
  margin-bottom: 10px;
}

.wizard-complete p {
  margin-bottom: 28px;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

/* ── STRATEGIES CONFIG LAYOUT ── */

.config-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 0;
}

.strategy-sidebar {
  border: 1px solid var(--border);
  border-right: none;
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
  background: var(--surface);
  max-height: calc(100vh - 140px);
  overflow-y: auto;
  position: sticky;
  top: 32px;
}

.strategy-sidebar .search-input {
  margin: 0;
  border-bottom: 1px solid var(--border);
}

.strategy-sidebar .search-input input {
  border: none;
  border-radius: var(--radius-lg) 0 0 0;
  padding: 12px 14px 12px 36px;
  font-size: 0.78rem;
}

.strategy-sidebar .search-input input:focus {
  box-shadow: none;
  background: var(--surface-hover);
}

.strategy-list-section {
  padding: 4px 0;
}

.strategy-list-header {
  font-family: var(--font-body);
  font-size: 0.6rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 12px 16px 4px;
}

.strategy-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 14px;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--text-secondary);
  transition: all var(--transition);
  margin: 1px 6px;
  border-radius: var(--radius-sm);
  border-left: 2px solid transparent;
}

.strategy-list-item:hover {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
}

.strategy-list-item.active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  border-left-color: var(--text);
}

.strategy-list-item .config-count {
  font-size: 0.6rem;
  font-weight: 500;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  padding: 1px 6px;
  border-radius: var(--radius-sm);
}

.strategy-detail {
  border: 1px solid var(--border);
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  overflow: hidden;
}

.strategy-detail-header {
  padding: 24px;
  border-bottom: 1px solid var(--border);
}

.strategy-detail-header h2 {
  font-size: 1.2rem;
  margin-bottom: 6px;
}

.subnav {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}

.subnav button {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 400;
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
}

.subnav button:hover { color: var(--text); }

.subnav button.active {
  color: var(--text);
  border-bottom-color: var(--text);
}

.subnav .new-config-btn {
  color: var(--text-muted);
  font-size: 0.72rem;
  margin-left: auto;
}

.subnav .new-config-btn:hover {
  color: var(--text);
}

.config-detail-body {
  padding: 24px;
}

.config-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 14px 24px;
  border-top: 1px solid var(--border);
  background: var(--bg-subtle);
  border-radius: 0 0 var(--radius-lg) 0;
}

/* ── CONFIG EDITOR MODAL ── */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 5000;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow-y: auto;
  animation: fade-in 150ms ease;
}

.modal-card {
  background: var(--surface);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-lg);
  width: min(680px, 100%);
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 10;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.modal-header h3 {
  font-size: 1.05rem;
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 24px;
  border-top: 1px solid var(--border);
  background: var(--bg-subtle);
  position: sticky;
  bottom: 0;
  z-index: 10;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* ── CONNECTORS TAB ── */

.guide-card {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-subtle);
  transition: border-color var(--transition);
}

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

.guide-card strong {
  display: block;
  font-family: var(--font-body);
  font-weight: 500;
  margin-bottom: 6px;
}

.guide-card ul, .guide-card ol {
  margin: 8px 0 0 18px;
  color: var(--text-secondary);
  font-size: 0.78rem;
}

.guide-card .link-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
}

/* ── APPROVALS ── */

.approval-card {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  border-left: 3px solid var(--border-hover);
}

.approval-card.long { border-left-color: var(--success); }
.approval-card.short { border-left-color: var(--danger); }

.approval-card .approval-meta {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin: 8px 0 14px;
}

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

/* ── OWNER ONBOARDING ── */

.owner-stats {
  display: flex;
  gap: 24px;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

.owner-stat {
  display: flex;
  flex-direction: column;
}

.owner-stat .stat-value {
  font-family: var(--font-display);
  font-size: 2.2rem;
  line-height: 1;
  color: var(--text);
}

.owner-stat .stat-label {
  font-family: var(--font-body);
  font-size: 0.65rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-top: 4px;
}

.checklist-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 4px;
  transition: all var(--transition);
}

.checklist-item .check-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.checklist-item .check-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1px solid var(--border-hover);
}

.checklist-item.done {
  background: rgba(255, 255, 255, 0.02);
  border-color: var(--border-hover);
}

.checklist-item.done .check-icon {
  color: var(--success);
  background: var(--success-dim);
  border-color: rgba(52, 211, 153, 0.3);
}

.checklist-item:not(.done) .check-icon { color: var(--text-muted); }

/* ── WORKSPACE SECTIONS ── */

.ws-section {
  margin-bottom: 24px;
}

.ws-section-header {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
}

/* ── METRIC CARDS ── */

.metric-card {
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  transition: border-color var(--transition);
}

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

.metric-card .metric-value {
  font-family: var(--font-display);
  font-size: 2rem;
  line-height: 1;
  margin-bottom: 4px;
  color: var(--text);
}

.metric-card .metric-label {
  font-family: var(--font-body);
  font-size: 0.65rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.metric-card .metric-help {
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* ── TIMELINE ── */

.timeline {
  display: grid;
  gap: 4px;
}

.timeline-step {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  border-left: 2px solid var(--border-hover);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  transition: all var(--transition);
}

.timeline-step .step-num {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.78rem;
  color: var(--text-muted);
  flex-shrink: 0;
  width: 22px;
}

.timeline-step.done {
  border-left-color: var(--success);
  background: rgba(52, 211, 153, 0.03);
}

.timeline-step.done .step-num {
  color: var(--success);
}

/* ── EMPTY STATE ── */

.empty {
  padding: 40px 24px;
  text-align: center;
  border: 1px dashed var(--border-hover);
  border-radius: var(--radius-lg);
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 400;
}

.empty .empty-icon {
  font-size: 1.4rem;
  margin-bottom: 8px;
  opacity: 0.3;
}

/* ── LINK LIST ── */

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

/* ── UTILITY ── */

.muted { color: var(--text-secondary); }
.small { font-size: 0.72rem; }
.small.muted { color: var(--text-muted); font-size: 0.72rem; }
.text-accent { color: var(--text); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-success { color: var(--success); }
.mt-sm { margin-top: 8px; }
.mt-md { margin-top: 16px; }
.mt-lg { margin-top: 24px; }
.mb-sm { margin-bottom: 8px; }
.mb-md { margin-bottom: 16px; }
.gap-sm { gap: 8px; }

/* ── RESPONSIVE ── */

@media (max-width: 1100px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: none;
    border-bottom: 1px solid var(--border);
    position: relative;
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    padding: 12px 16px;
    gap: 8px;
  }

  .brand { padding: 0; border: none; margin: 0; }
  .brand h1 { font-size: 0.95rem; }
  .brand p { display: none; }

  .nav {
    flex-direction: row;
    gap: 2px;
    padding: 0;
    flex-wrap: wrap;
  }

  .nav-section-label { display: none; }

  .nav button {
    padding: 7px 10px;
    font-size: 0.72rem;
    border-left: none;
    border-bottom: 2px solid transparent;
  }

  .nav button.active {
    border-left-color: transparent;
    border-bottom-color: var(--text);
  }

  .sidebar-footer { display: none; }

  .config-layout {
    grid-template-columns: 1fr;
  }

  .strategy-sidebar {
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    position: relative;
    max-height: none;
    top: 0;
    border-right: 1px solid var(--border);
  }

  .strategy-detail {
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  }

  .grid.two, .grid.three, .grid.four {
    grid-template-columns: 1fr;
  }

  .landing-hero {
    padding: 60px 24px;
  }

  .landing-nav {
    padding: 14px 24px;
  }

  .progress-stepper {
    padding: 14px;
    flex-wrap: wrap;
    gap: 6px;
    border-radius: var(--radius);
  }

  .step-label { display: none; }
  .step-line { min-width: 10px; }

  .owner-stats {
    flex-wrap: wrap;
    gap: 16px;
  }
}

@media (max-width: 640px) {
  .content { padding: 20px; }
  .landing-hero h1 { font-size: 2rem; }
  .hero { padding: 20px; }
  .field-grid { grid-template-columns: 1fr; }
  .landing-features { grid-template-columns: 1fr; }
  .landing-footer { flex-direction: column; gap: 12px; text-align: center; }
}
