/* Mesh Button Builder — clean Stripe/Linear-style developer tool */

:root {
  --bg: #FAFAF9;
  --surface: #FFFFFF;
  --surface-2: #F5F5F4;
  --border: #E7E5E4;
  --border-2: #D6D3D1;
  --text: #0C0A09;
  --text-muted: #57534E;
  --text-faint: #A8A29E;
  --accent: #0F172A;
  --accent-hover: #1E293B;
  --primary: #5B21B6;
  --success: #047857;
  --code-bg: #0C0A09;
  --code-text: #E7E5E4;
  --code-tag: #93C5FD;
  --code-key: #FCA5A5;
  --code-str: #86EFAC;
  --code-com: #78716C;
  --code-kw: #C4B5FD;
  --shadow-sm: 0 1px 2px rgba(12, 10, 9, 0.04), 0 0 0 1px rgba(12, 10, 9, 0.04);
  --shadow-md: 0 2px 8px rgba(12, 10, 9, 0.04), 0 1px 2px rgba(12, 10, 9, 0.06);
  --shadow-lg: 0 12px 32px rgba(12, 10, 9, 0.08), 0 4px 8px rgba(12, 10, 9, 0.04);
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Inter Tight', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'cv11', 'ss01';
}

button { font-family: inherit; cursor: pointer; }
input { font-family: inherit; }

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,0.85);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 14px 32px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 32px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-logo {
  height: 32px;
  width: auto;
  display: block;
  border-radius: 6px;
}
.brand-text { line-height: 1.1; }
.brand-name { font-weight: 600; font-size: 15px; letter-spacing: -0.01em; }
.brand-sub { font-size: 11px; color: var(--text-muted); font-weight: 500; }
.header-right { display: flex; gap: 20px; justify-content: flex-end; align-items: center; }
.header-link { color: var(--text-muted); text-decoration: none; font-size: 13px; font-weight: 500; }
.header-link:hover { color: var(--text); }

/* Steps */
.steps {
  display: flex;
  align-items: center;
  gap: 8px;
}
.step {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-faint);
  font-weight: 500;
  white-space: nowrap;
}
.step-active { color: var(--text); }
.step-done { color: var(--text-muted); }
.step-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-faint);
}
.step-active .step-dot { background: var(--accent); color: white; border-color: var(--accent); }
.step-done .step-dot { background: var(--success); color: white; border-color: var(--success); }
.step-line {
  width: 32px;
  height: 1px;
  background: var(--border-2);
}
.step-line-done { background: var(--success); }

/* Main */
.main {
  min-height: calc(100vh - 60px);
  padding: 56px 32px 96px;
}
.container {
  max-width: 1100px;
  margin: 0 auto;
}
.container-wide {
  max-width: 1440px;
  margin: 0 auto;
}

/* Hero */
.hero {
  text-align: center;
  margin-bottom: 56px;
}
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--surface);
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  margin-bottom: 24px;
}
.hero h1 {
  font-size: 44px;
  letter-spacing: -0.025em;
  font-weight: 600;
  margin: 0 0 16px;
  line-height: 1.05;
  text-wrap: balance;
}
.hero p {
  font-size: 17px;
  color: var(--text-muted);
  max-width: 580px;
  margin: 0 auto;
  line-height: 1.5;
  text-wrap: pretty;
}

/* Mode grid */
.mode-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 40px;
}
.mode-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 0;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
}
.mode-card:hover {
  border-color: var(--border-2);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}
.mode-card-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.06), var(--shadow-md);
}
.mode-preview {
  background: linear-gradient(180deg, #FAFAF9 0%, #F5F5F4 100%);
  border-bottom: 1px solid var(--border);
  padding: 32px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
}
.mode-body { padding: 18px 20px; flex: 1; }
.mode-eyebrow {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  margin-bottom: 6px;
}
.mode-title { font-weight: 600; font-size: 16px; margin-bottom: 6px; letter-spacing: -0.01em; }
.mode-desc { font-size: 13px; color: var(--text-muted); line-height: 1.5; }
.mode-bestfor {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
  font-size: 11px;
  color: var(--text-faint);
  letter-spacing: 0.01em;
}
.mode-bestfor span {
  color: var(--text-muted);
  font-weight: 500;
}

/* Pairing hint shown when no routes are selected */
.pairing-hint {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--brand-accent, #FACC15);
  border-radius: var(--r-md);
  margin-bottom: 24px;
}
.pairing-hint-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--brand-accent, #FACC15);
  color: #1C1917;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.pairing-hint-body { flex: 1; min-width: 0; }
.pairing-hint-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.005em;
  margin-bottom: 2px;
}
.pairing-hint-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}
.pairing-hint-desc strong {
  color: var(--text);
  font-weight: 600;
}
.pairing-hint-action {
  flex-shrink: 0;
  padding: 8px 14px;
  background: var(--text);
  color: var(--bg);
  border: 1px solid var(--text);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  font-family: 'Inter Tight', sans-serif;
  cursor: pointer;
  align-self: center;
  transition: opacity 0.12s ease;
}
.pairing-hint-action:hover { opacity: 0.85; }
.mode-radio {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid var(--border-2);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
}
.mode-card-active .mode-radio { border-color: var(--accent); background: var(--accent); }
.mode-radio-inner {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: white;
  opacity: 0;
}
.mode-card-active .mode-radio-inner { opacity: 1; }

/* Mini previews inside mode cards */
.preview-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
}
.preview-btn-single { color: white; }
.preview-icon { height: 16px; width: auto; }
.preview-btn-multi {
  background: white;
  border: 1px solid var(--border);
  color: var(--text);
}
.preview-btn-cat {
  background: var(--accent);
  color: white;
  flex-direction: column;
  gap: 10px;
  padding: 14px 18px;
  align-items: stretch;
}
.preview-cluster { display: inline-flex; }
.preview-cluster-icon {
  position: relative;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: white;
  border: 1.5px solid white;
  margin-right: -7px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}
.preview-cluster-icon:last-child { margin-right: 0; }
.preview-cluster-icon img { width: 16px; height: 16px; object-fit: contain; display: block; }
.preview-grid-mini {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
}
.preview-grid-icon {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  background: rgba(255,255,255,0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.preview-grid-icon img { width: 11px; height: 11px; object-fit: contain; }

/* Buttons */
.btn-primary {
  background: var(--accent);
  color: white;
  border: none;
  padding: 11px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s;
  letter-spacing: -0.005em;
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:disabled { background: var(--border-2); cursor: not-allowed; }
.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 11px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-ghost:hover { background: var(--surface); color: var(--text); }

.step-cta { display: flex; justify-content: center; }

/* Step head */
.step-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 32px;
}
.step-eyebrow {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}
.step-head h2 {
  font-size: 28px;
  font-weight: 600;
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}
.step-head p {
  font-size: 15px;
  color: var(--text-muted);
  margin: 0;
  max-width: 560px;
}
.step-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* Catalog */
.catalog {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.catalog-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.search-wrap {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}
.search-wrap > svg {
  position: absolute;
  left: 12px;
  color: var(--text-faint);
}
.search-input {
  width: 100%;
  padding: 9px 12px 9px 34px;
  background: var(--surface-2);
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 13px;
  color: var(--text);
  outline: none;
}
.search-input:focus {
  background: var(--surface);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15,23,42,0.05);
}
.search-clear {
  position: absolute;
  right: 8px;
  background: transparent;
  border: none;
  color: var(--text-faint);
  padding: 4px;
  display: flex;
}
.filter-pills { display: flex; gap: 4px; }
.pill {
  padding: 7px 12px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  transition: all 0.12s;
}
.pill:hover { color: var(--text); background: var(--surface-2); }
.pill-active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
.catalog-counter {
  display: flex;
  align-items: baseline;
  gap: 4px;
  padding: 7px 12px;
  background: var(--surface-2);
  border-radius: 7px;
  font-size: 12px;
}
.counter-num { font-weight: 600; font-size: 14px; }
.counter-label { color: var(--text-muted); }
.counter-max { color: var(--text-faint); }
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1px;
  background: var(--border);
  max-height: 580px;
  overflow-y: auto;
}
.int-card {
  background: var(--surface);
  border: none;
  padding: 18px 12px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  position: relative;
  text-align: center;
  transition: background 0.1s;
  min-height: 100px;
}
.int-card:hover { background: var(--surface-2); }
.int-card-selected {
  background: #F5F3FF;
}
.int-card-selected:hover { background: #EDE9FE; }
.int-card-selected::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 1.5px solid var(--primary);
  pointer-events: none;
}
.int-card-logo {
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.int-card-logo img {
  height: 32px;
  max-width: 100%;
  width: auto;
  object-fit: contain;
  display: block;
}
.int-card-iconmark .int-card-logo img {
  width: 32px;
}
.int-card-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: -0.005em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.int-card-selected .int-card-name { color: var(--primary); font-weight: 600; }
.int-card-fallback {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-faint);
  letter-spacing: 0.02em;
}
.int-card-check {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
}
.catalog-empty {
  padding: 60px 20px;
  text-align: center;
  color: var(--text-faint);
  font-size: 14px;
}

/* Category picker */
.cat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.cat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 24px;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
}
.cat-card:hover { border-color: var(--border-2); box-shadow: var(--shadow-md); }
.cat-card-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15,23,42,0.06);
}
.cat-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 16px; }
.cat-name { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; margin-bottom: 4px; }
.cat-desc { font-size: 13px; color: var(--text-muted); line-height: 1.5; }
.cat-radio {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid var(--border-2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.cat-card-active .cat-radio { border-color: var(--accent); background: var(--accent); }
.cat-radio-inner { width: 8px; height: 8px; border-radius: 50%; background: white; opacity: 0; }
.cat-card-active .cat-radio-inner { opacity: 1; }
.cat-count {
  font-size: 12px;
  font-weight: 500;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 12px;
}
.cat-logos {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 6px;
}
.cat-logo {
  aspect-ratio: 1;
  background: var(--surface-2);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 4px;
}
.cat-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.cat-logo-more {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
}

/* Builder layout */
.builder {
  display: grid;
  grid-template-columns: 280px 1fr 420px;
  gap: 24px;
  align-items: start;
}
.builder-2col {
  grid-template-columns: 520px 1fr;
  max-width: 1280px;
  margin: 0 auto;
  /* So the sticky preview can settle within the grid row, not the page. */
  align-items: start;
}

/* In the customize step, keep the live preview pinned in view as the user
   scrolls through the customizer's controls on the left. */
.builder-2col .builder-center {
  position: sticky;
  top: 80px;
  /* Cap height so internal previews don't overflow the viewport. */
  max-height: calc(100vh - 96px);
  overflow-y: auto;
  /* Hide scrollbar visual cruft but keep wheel scrolling. */
  scrollbar-width: thin;
}

/* Export CTA — sits below the preview on Step 3 */
.export-cta-wrap {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.btn-export {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 22px;
  background: var(--text);
  color: var(--bg);
  border: 1px solid var(--text);
  border-radius: 10px;
  font-family: 'Inter Tight', sans-serif;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  box-shadow: 0 1px 2px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.08);
}
.btn-export:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.08), 0 8px 20px rgba(0,0,0,0.12);
}
.btn-export:active {
  transform: translateY(0);
}
.btn-export-meta {
  font-size: 12px;
  font-weight: 500;
  opacity: 0.6;
  margin-left: 4px;
  padding-left: 12px;
  border-left: 1px solid rgba(255,255,255,0.16);
  letter-spacing: 0.02em;
}
.export-cta-hint {
  font-size: 12px;
  color: var(--text-faint);
}

/* Export modal */
.export-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(12, 10, 9, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 60px 24px 24px;
  overflow-y: auto;
  animation: fadeIn 0.18s ease;
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.export-modal {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 100%;
  max-width: 880px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.18), 0 4px 16px rgba(0,0,0,0.08);
  animation: slideUp 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.export-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 28px 20px;
  border-bottom: 1px solid var(--border);
}
.export-modal-eyebrow {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--brand-accent, var(--text-muted));
  margin-bottom: 6px;
}
.export-modal-header h3 {
  font-family: 'Inter Tight', sans-serif;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
  color: var(--text);
}
.export-modal-header p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.55;
  margin: 0;
  max-width: 560px;
}
.export-modal-close {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.12s ease, color 0.12s ease;
}
.export-modal-close:hover {
  background: var(--surface-2);
  color: var(--text);
}
.export-modal-body {
  padding: 24px 28px 28px;
}

/* Customizer */
.customizer {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px;
}
.cust-section { margin-bottom: 18px; }
.cust-section:last-child { margin-bottom: 0; }
.cust-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.cust-hint {
  font-size: 11px;
  color: var(--text-faint);
  margin-top: 6px;
  line-height: 1.5;
}
.cust-hint code {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10.5px;
  background: var(--surface-2);
  padding: 1px 5px;
  border-radius: 4px;
  color: var(--text-muted);
}
.cust-text {
  width: 100%;
  padding: 9px 12px;
  background: var(--surface-2);
  border: 1px solid transparent;
  border-radius: 7px;
  font-size: 13px;
  outline: none;
}
.cust-text:focus { background: var(--surface); border-color: var(--accent); }

/* Label preset chips — lifecycle-aware, click to fill input */
.cust-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
.cust-preset {
  font-family: 'Inter Tight', sans-serif;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 5px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
  letter-spacing: 0.005em;
  white-space: nowrap;
}
.cust-preset:hover {
  background: var(--surface);
  color: var(--text);
  border-color: var(--text-muted);
}
.cust-preset-active,
.cust-preset-active:hover {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}
.cust-preset-clear {
  color: var(--text-faint);
  background: transparent;
  border-color: transparent;
}
.cust-preset-clear:hover {
  background: transparent;
  color: var(--text-muted);
  border-color: transparent;
  text-decoration: underline;
}
.cust-toggle-row { display: flex; justify-content: space-between; align-items: center; }

/* 2-column grid for compact controls (theme/style/size/shape, plus radius/
   border-width and bg/text inside the advanced section). Each child .cust-section
   loses its own bottom margin so the grid's gap controls all spacing. */
.cust-grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 18px;
  margin-bottom: 18px;
}
.cust-grid-2col > .cust-section { margin-bottom: 0; }
/* Grid items default to min-content sizing — without min-width:0 a child with
   an <input> or long text overflows the column. Force shrinking. */
.cust-grid-2col > * { min-width: 0; }
.cust-advanced-body .cust-grid-2col { margin-bottom: 0; }

/* ── Advanced (custom shape & colors) ─────────────────────────────────── */
.cust-advanced {
  border-top: 1px solid var(--border);
  padding-top: 18px;
}
.cust-advanced-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.cust-advanced-toggle {
  display: flex;
  flex: 1;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-align: left;
  color: inherit;
  font-family: inherit;
}
.cust-advanced-toggle .cust-label { margin-bottom: 4px; }
.cust-advanced-toggle .cust-hint { margin-top: 0; }
.cust-advanced-toggle svg {
  color: var(--text-faint);
  transition: transform 0.15s ease;
  flex-shrink: 0;
}
.cust-advanced-head-open .cust-advanced-toggle svg { transform: rotate(90deg); }
.cust-advanced-toggle:hover svg { color: var(--text-muted); }

/* Override-count badge sits next to the section label so users see when
   the inheritance chain is "broken" by custom values. */
.cust-advanced-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  margin-left: 8px;
  padding: 0 6px;
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  vertical-align: 2px;
}

/* Inline reset button — only shown when overrides exist. Sits to the right
   of the section toggle so it's discoverable without expanding. */
.cust-advanced-reset-inline {
  appearance: none;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 10px;
  font: 500 12px/1 var(--font-ui);
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.cust-advanced-reset-inline:hover {
  background: var(--surface-hover);
  color: var(--text);
  border-color: var(--text-faint);
}

.cust-advanced-body {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cust-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cust-row-disabled { opacity: 0.45; pointer-events: none; }
.cust-row-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 18px;
}
.cust-row-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  letter-spacing: -0.005em;
}
.cust-row-value {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  color: var(--text-muted);
}
.cust-row-inherit {
  font-family: inherit;
  font-size: 11px;
  color: var(--text-faint);
  font-style: italic;
}
.cust-row-reset {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  background: transparent;
  border: 0;
  color: var(--text-faint);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.cust-row-reset:hover {
  background: var(--surface-2);
  color: var(--text);
}

/* Range slider — restyled to match the customizer's flat look */
.cust-slider {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  height: 4px;
  background: var(--surface-2);
  border-radius: 999px;
  outline: none;
  cursor: pointer;
}
.cust-slider::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--text);
  border: 2px solid var(--surface);
  box-shadow: 0 0 0 1px rgba(15,23,42,0.18), 0 1px 2px rgba(15,23,42,0.15);
  cursor: pointer;
  transition: transform 0.1s;
}
.cust-slider::-webkit-slider-thumb:hover { transform: scale(1.1); }
.cust-slider::-webkit-slider-thumb:active { transform: scale(0.95); }
.cust-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--text);
  border: 2px solid var(--surface);
  box-shadow: 0 0 0 1px rgba(15,23,42,0.18);
  cursor: pointer;
}

/* Color row — swatch + hex text input */
.cust-color-input {
  display: flex;
  align-items: stretch;
  gap: 8px;
}
.cust-color-swatch {
  position: relative;
  width: 36px;
  height: 32px;
  border-radius: 7px;
  border: 1px solid rgba(15,23,42,0.12);
  cursor: pointer;
  flex-shrink: 0;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.4);
}
.cust-color-swatch input[type="color"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  border: 0;
  padding: 0;
}
.cust-color-swatch:hover { border-color: rgba(15,23,42,0.25); }
.cust-color-text {
  flex: 1;
  min-width: 0;
  padding: 0 12px;
  background: var(--surface-2);
  border: 1px solid transparent;
  border-radius: 7px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12px;
  color: var(--text);
  outline: none;
  text-transform: lowercase;
}
.cust-color-text::placeholder {
  color: var(--text-faint);
  font-style: italic;
  text-transform: none;
}
.cust-color-text:focus {
  background: var(--surface);
  border-color: var(--accent);
}

.cust-advanced-reset {
  align-self: flex-start;
  appearance: none;
  background: transparent;
  border: 0;
  padding: 4px 0 0;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: var(--border-2);
  text-underline-offset: 3px;
}
.cust-advanced-reset:hover { color: var(--text); }

/* Style preset grid */
.cust-section-presets {
  padding-bottom: 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border);
}
.preset-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.preset-card {
  appearance: none;
  background: transparent;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 6px 6px 8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
  transition: border-color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}
.preset-card:hover {
  border-color: rgba(15,23,42,0.25);
}
.preset-card-active {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255,210,0,0.18);
}
.preset-stage {
  border-radius: 6px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(15,23,42,0.06);
  overflow: hidden;
  padding: 0 10px;
}
.preset-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  padding: 6px 11px;
  line-height: 1;
  letter-spacing: -0.01em;
  max-width: 100%;
  min-width: 0;
  white-space: nowrap;
}
.preset-btn-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
}
.preset-btn-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  display: block;
}
.preset-name {
  font-size: 10.5px;
  font-weight: 500;
  color: var(--text-muted);
  text-align: center;
  letter-spacing: -0.005em;
}
.preset-card-active .preset-name {
  color: var(--primary);
  font-weight: 600;
}

/* Segmented control */
.seg {
  display: flex;
  background: var(--surface-2);
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}
.seg-btn {
  flex: 1;
  padding: 7px 10px;
  background: transparent;
  border: none;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  transition: all 0.12s;
}
.seg-btn-active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

/* Toggle */
.toggle {
  width: 36px;
  height: 22px;
  border-radius: 999px;
  background: var(--border-2);
  border: none;
  position: relative;
  transition: background 0.15s;
  flex-shrink: 0;
}
.toggle-on { background: var(--accent); }
.toggle-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: white;
  border-radius: 50%;
  transition: transform 0.15s;
  box-shadow: 0 1px 2px rgba(0,0,0,0.15);
}
.toggle-on .toggle-knob { transform: translateX(14px); }

/* Preview center */
.preview-tabs {
  display: inline-flex;
  background: var(--surface-2);
  border-radius: 8px;
  padding: 3px;
  margin-bottom: 12px;
  gap: 2px;
}
.preview-tab {
  padding: 7px 14px;
  background: transparent;
  border: none;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  white-space: nowrap;
}
.preview-tab svg { display: block; }
.preview-tabs-surfaces { gap: 1px; flex-wrap: wrap; }
.preview-tabs-surfaces .preview-tab span:not([class]) { white-space: nowrap; }
.preview-tab-active { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,0.05); }

.preview-stage {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  min-height: 360px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(0,0,0,0.04) 1px, transparent 0);
  background-size: 20px 20px;
  overflow: hidden;
}
.preview-stage-dark {
  background: #0C0A09;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(255,255,255,0.04) 1px, transparent 0);
}
.preview-isolated {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.preview-hint {
  font-size: 11px;
  color: var(--text-faint);
  font-family: ui-monospace, SF Mono, monospace;
}
.preview-stage-dark .preview-hint { color: #57534E; }

.btn-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: stretch;
}
.btn-stack .rendered-btn {
  justify-content: center;
}

.rendered-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
  letter-spacing: -0.005em;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.05s;
  font-family: inherit;
  white-space: nowrap;
}
.rendered-btn:hover { opacity: 0.92; }
.rendered-btn:active { transform: translateY(1px); }
.rendered-btn-icon {
  display: inline-flex;
  align-items: center;
}
.rendered-btn-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}
.rendered-btn-subtext {
  font-style: italic;
  font-size: 0.75em;
  opacity: 0.7;
  font-weight: 400;
  letter-spacing: 0;
}
.cluster-icons {
  display: inline-flex;
  align-items: center;
  margin-right: 6px; /* counter the negative margin on the last child */
}
.cluster-icon {
  position: relative;
  border-radius: 50%;
  background: white;
  border: 1.5px solid white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: -6px;
  overflow: hidden;
  flex: none;
}
.cluster-icon img { width: 85%; height: 85%; object-fit: contain; }
.cluster-more {
  background: rgba(0,0,0,0.08);
  color: inherit;
  font-weight: 700;
  font-size: 0.75em;
  letter-spacing: -0.02em;
  border-color: transparent;
  padding: 0 2px;
}

/* Preview summary */
.preview-summary {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
}
.sum-stat {
  background: var(--surface);
  padding: 12px 14px;
}
.sum-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  margin-bottom: 4px;
  font-weight: 500;
}
.sum-value {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

/* Mock app */
.mock-app {
  width: 100%;
  max-width: 720px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 24px 48px rgba(12,10,9,0.08), 0 0 0 1px var(--border);
  overflow: hidden;
}
.mock-app-dark { background: #0F172A; color: #F1F5F9; }
.mock-app-chrome {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 14px;
  background: #F5F5F4;
  border-bottom: 1px solid var(--border);
}
.mock-app-dark .mock-app-chrome { background: #1E293B; border-color: #334155; }
.mock-app-dots { display: flex; gap: 6px; }
.mock-app-dots span {
  width: 10px; height: 10px; border-radius: 50%;
  background: #D6D3D1;
}
.mock-app-dots span:nth-child(1) { background: #F87171; }
.mock-app-dots span:nth-child(2) { background: #FBBF24; }
.mock-app-dots span:nth-child(3) { background: #34D399; }
.mock-app-url {
  flex: 1;
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  font-family: ui-monospace, monospace;
  background: white;
  border-radius: 5px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  max-width: 280px;
  margin: 0 auto;
}
.mock-app-dark .mock-app-url { background: #0F172A; color: #94A3B8; border-color: #334155; }
.mock-app-body { padding: 0; }
.mock-app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
}
.mock-app-dark .mock-app-header { border-color: #334155; }
.mock-logo { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13px; }
.mock-logo-mark {
  width: 22px; height: 22px;
  border-radius: 6px;
  background: linear-gradient(135deg, #5B21B6, #7C3AED);
}
.mock-app-nav { display: flex; gap: 18px; font-size: 13px; color: var(--text-muted); }
.mock-app-nav .active { color: var(--text); font-weight: 500; }
.mock-app-dark .mock-app-nav { color: #94A3B8; }
.mock-app-dark .mock-app-nav .active { color: white; }
.mock-app-content { padding: 32px 24px 40px; display: flex; justify-content: center; }
.mock-card {
  width: 100%;
  max-width: 460px;
  background: var(--surface-2);
  border-radius: 12px;
  padding: 28px;
  border: 1px solid var(--border);
}
.mock-app-dark .mock-card { background: #1E293B; border-color: #334155; }
.mock-eyebrow {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}
.mock-app-dark .mock-eyebrow { color: #94A3B8; }
.mock-card h2 {
  font-size: 22px;
  font-weight: 600;
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}
.mock-card p {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 20px;
  line-height: 1.5;
}
.mock-app-dark .mock-card p { color: #94A3B8; }
.mock-button-slot { margin-bottom: 16px; }
.mock-tos {
  font-size: 11px;
  color: var(--text-faint);
}
.mock-tos span { text-decoration: underline; cursor: pointer; }

/* Code block */
.code-block {
  background: var(--code-bg);
  border-radius: var(--r-lg);
  overflow: hidden;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}
.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px 8px 14px;
  border-bottom: 1px solid #1C1917;
}
.code-tabs { display: flex; gap: 2px; }
.code-tab {
  padding: 6px 12px;
  font-size: 11px;
  color: #78716C;
  border-radius: 6px;
  cursor: pointer;
  font-family: 'Inter Tight', sans-serif;
  font-weight: 500;
  background: transparent;
  border: none;
  transition: color 0.12s ease, background 0.12s ease;
}
.code-tab:hover { color: #A8A29E; }
.code-tab-active,
.code-tab-active:hover {
  background: #1C1917;
  color: #E7E5E4;
}
.btn-copy {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  background: #1C1917;
  border: 1px solid #292524;
  color: #D6D3D1;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  font-family: 'Inter Tight', sans-serif;
}
.btn-copy:hover { background: #292524; color: white; }
.btn-copy-done { color: #86EFAC; border-color: #064E3B; background: #022C22; }
.code-body {
  margin: 0;
  padding: 16px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--code-text);
  overflow-x: auto;
  white-space: pre;
  max-height: 480px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #44403C #0C0A09;
}
.code-body::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
.code-body::-webkit-scrollbar-track {
  background: #0C0A09;
}
.code-body::-webkit-scrollbar-thumb {
  background: #292524;
  border: 2px solid #0C0A09;
  border-radius: 5px;
}
.code-body::-webkit-scrollbar-thumb:hover {
  background: #44403C;
}
.code-body::-webkit-scrollbar-corner {
  background: #0C0A09;
}
.tk-tag { color: var(--code-tag); }
.tk-key { color: #FCD34D; }
.tk-str { color: var(--code-str); }
.tk-com { color: var(--code-com); font-style: italic; }
.tk-kw { color: var(--code-kw); }

.install-note {
  margin-top: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px 18px;
}
.install-note-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}
.install-note ol {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.7;
}
.install-note code {
  background: var(--surface-2);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 12px;
  font-family: ui-monospace, monospace;
  color: var(--text);
}

/* Mesh modal */
.mesh-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(12,10,9,0.5);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.mesh-modal {
  width: 380px;
  background: white;
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.3);
  overflow: hidden;
  animation: slideUp 0.25s cubic-bezier(0.2, 0.9, 0.3, 1);
}
@keyframes slideUp { from { transform: translateY(12px); opacity: 0; } }
.mesh-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.mesh-modal-brand { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; }
.mesh-modal-brand-logo { height: 22px; width: auto; display: block; border-radius: 4px; }
.mesh-modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 4px;
  display: flex;
  border-radius: 4px;
}
.mesh-modal-close:hover { background: var(--surface-2); }
.mesh-modal-title {
  padding: 20px 20px 12px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.mesh-modal-list {
  padding: 0 8px 12px;
  max-height: 360px;
  overflow-y: auto;
}
.mesh-modal-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-muted);
}
.mesh-modal-item:hover { background: var(--surface-2); color: var(--text); }
.mesh-modal-item-icon {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 4px;
}
.mesh-modal-item-icon img { max-width: 100%; max-height: 100%; object-fit: contain; }
.mesh-modal-item-name { flex: 1; font-size: 14px; font-weight: 500; color: var(--text); }
.mesh-modal-state {
  padding: 48px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.mesh-spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--surface-2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.mesh-success {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: #ECFDF5;
  color: var(--success);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: pop 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.4);
}
@keyframes pop { from { transform: scale(0.6); opacity: 0; } }
.mesh-state-title { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.mesh-state-sub { font-size: 13px; color: var(--text-muted); }
.mesh-modal-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 12px;
  background: var(--surface-2);
  font-size: 11px;
  color: var(--text-muted);
}
.mesh-modal-foot-name { font-weight: 600; color: var(--text); }
.mesh-modal-foot-logo { height: 16px; width: auto; display: block; border-radius: 3px; }

@media (max-width: 1280px) {
  .builder { grid-template-columns: 240px 1fr 380px; }
  .builder-2col { grid-template-columns: 420px 1fr; }
}
@media (max-width: 1024px) {
  .builder { grid-template-columns: 1fr; }
  .builder-2col { grid-template-columns: 1fr; }
  /* On narrow viewports the preview can't usefully stay sticky — let it flow. */
  .builder-2col .builder-center { position: static; max-height: none; overflow: visible; }
  .mode-grid { grid-template-columns: 1fr; }
  .cat-grid { grid-template-columns: 1fr; }
  .header-inner { grid-template-columns: 1fr 1fr; }
  .steps { display: none; }
}

/* ---------- Routes (multi-select on Step 0) ---------- */
.mode-card-disabled {
  opacity: 0.45;
  pointer-events: none;
}
.mode-card-disabled:hover { transform: none; box-shadow: none; }

/* Mode-card radio becomes a checkbox visually when active */
.mode-card-active .mode-radio-inner {
  width: 10px;
  height: 7px;
  border: solid white;
  border-width: 0 0 2px 2px;
  border-radius: 0;
  background: transparent;
  transform: rotate(-45deg) translate(1px, -1px);
}

/* Route cart: live tally of picked routes + Continue button */
.route-cart {
  margin-top: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 20px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
}
.route-cart-info { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.route-cart-label { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.route-cart-count { font-size: 22px; font-weight: 600; color: var(--text); letter-spacing: -0.02em; }
.route-cart-cap { color: var(--text-muted); font-weight: 500; }
.route-cart-list { display: flex; gap: 6px; flex-wrap: wrap; }
.route-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 6px 5px 10px;
  background: rgba(15,23,42,0.05);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
}
.route-chip-x {
  background: transparent;
  border: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
}
.route-chip-x:hover { background: rgba(15,23,42,0.08); color: var(--text); }

/* ---------- Route tabs (Step 1, when >1 route) ---------- */
.route-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: rgba(15,23,42,0.04);
  border-radius: 10px;
  margin-bottom: 20px;
  width: fit-content;
}
.route-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: transparent;
  border: 0;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.route-tab:hover { color: var(--text); }
.route-tab-active {
  background: white;
  color: var(--text);
  box-shadow: 0 1px 2px rgba(15,23,42,0.06);
}
.route-tab-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #CBD5E1;
}
.route-tab-dot-ok { background: #10B981; }
.route-tab-label { font-weight: 600; }
.route-tab-meta { font-size: 12px; color: var(--text-muted); font-weight: 400; }

/* Catalog helper text */
.catalog-helper {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 14px;
}

/* Active route header — sits above the catalog/category picker on Step 2 */
.route-active-head {
  margin-bottom: 16px;
}
.route-active-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}
.route-active-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Customizer warning hint */
.cust-hint-warn {
  margin-top: 6px;
  padding: 8px 10px;
  background: rgba(217, 119, 6, 0.08);
  border-radius: 6px;
  color: #92400E;
  font-size: 11px;
  line-height: 1.4;
}

/* ---------- Route stack (Step 2 preview) ---------- */
.route-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
}
.route-stack-item {
  display: flex;
  justify-content: center;
}


/* ---------- Per-route Label section (Step 2) ---------- */
.route-label-section {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.route-label-head {
  margin-bottom: 12px;
}
.route-label-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.005em;
  margin-bottom: 4px;
}
.route-label-sub {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}


/* Customizer — Button Labels section: stack of per-route label cards */
.cust-section-labels {
  padding-bottom: 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border);
}
.cust-section-head { margin-bottom: 12px; }
.cust-section-head .cust-label { margin-bottom: 4px; }
.cust-section-head .cust-hint { margin-top: 0; }
.cust-section-head .cust-hint code {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10.5px;
  background: var(--surface-2);
  padding: 1px 5px;
  border-radius: 4px;
  color: var(--text-muted);
}
.cust-route-labels {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* RouteLabelCard — one per route, compact */
.rlc {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
}
.rlc-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.rlc-icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.rlc-icon-img {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  object-fit: contain;
  background: var(--surface);
  padding: 2px;
  border: 1px solid var(--border);
}
.rlc-icon-placeholder {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: var(--surface);
  border: 1px dashed var(--border);
}
.rlc-icon-bg {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.rlc-icon-bg-multi {
  background: linear-gradient(135deg, #FFD700 0%, #FFC107 100%);
  color: #0F172A;
}
.rlc-icon-bg-cat {
  background: #0F172A;
  color: #FFD700;
}
.rlc-meta {
  flex: 1;
  min-width: 0;
}
.rlc-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.005em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rlc-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 1px;
}
.rlc-input {
  width: 100%;
  padding: 8px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12.5px;
  outline: none;
  font-family: inherit;
  color: var(--text);
  margin-bottom: 8px;
}
.rlc-input:focus { border-color: var(--accent); }
.rlc-input::placeholder { color: var(--text-faint); }
.rlc-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.rlc-preset {
  font-family: 'Inter Tight', sans-serif;
  font-size: 10.5px;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 4px 8px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.12s ease;
  white-space: nowrap;
}
.rlc-preset:hover {
  color: var(--text);
  border-color: var(--text-muted);
}
.rlc-preset-active {
  background: var(--text);
  color: var(--surface);
  border-color: var(--text);
}
.rlc-preset-active:hover {
  color: var(--surface);
  border-color: var(--text);
}
.rlc-preset-clear {
  margin-left: auto;
  color: var(--text-faint);
}


/* Catalog see-all toggle */
.catalog-see-all-wrap {
  display: flex;
  justify-content: center;
  margin-top: 16px;
}
.catalog-see-all {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-family: 'Inter Tight', sans-serif;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.12s ease;
}
.catalog-see-all:hover {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--text-muted);
}
.catalog-see-all-collapse {
  color: var(--text-faint);
}
