/* justusers/public/css/app.css
   Complete stylesheet: dark + light themes, all components, all pages,
   responsive breakpoints. Organized by section. */

/* === TOKENS: DARK (default) ===
   UNIFIED: legacy app.css tokens are now aliased onto the design-system.css
   tokens so every legacy-only component (marketing, auth, docs, admin, wizard)
   shares ONE palette, radius and shadow language with the app shell. The
   fallback after each comma keeps rendering sane if design-system.css is ever
   absent. Tokens that collide by name with design-system.css
   (--text-primary / --text-secondary / --bg-elevated / --border-subtle) are
   already won by that sheet via the cascade, so they are intentionally left as
   literals here (a var() self-reference would be invalid). */
:root,
[data-theme="dark"] {
  --bg-primary: var(--bg-base, #0a0a0f);
  --bg-secondary: var(--bg-surface, #111118);
  --bg-card: var(--bg-surface, #111118);
  --bg-elevated: #1e1e2a;
  --border: var(--border-default, rgba(255, 255, 255, 0.10));
  --border-subtle: #1e1e2a;
  --accent: var(--brand-primary, #6366f1);
  --accent-hover: var(--brand-primary-hover, #5254cc);
  --accent-glow: var(--brand-glow, rgba(99, 102, 241, 0.15));
  --success: var(--color-active, #22c55e);
  --warning: var(--color-slipping, #f59e0b);
  --danger: var(--color-flight-risk, #ef4444);
  --upsell: var(--color-upsell, #a78bfa);
  --text-primary: #f0f0ff;
  --text-secondary: #8888aa;
  --text-muted: var(--text-tertiary, #55556a);
  --nav-bg: rgba(10, 10, 15, 0.72);
  --shadow-card: var(--shadow-md, 0 4px 16px rgba(0, 0, 0, 0.5), 0 1px 4px rgba(0, 0, 0, 0.3));
  --radius-input: var(--radius-md, 10px);
  --radius-card: var(--radius-lg, 14px);
  --radius-modal: var(--radius-xl, 18px);
  --radius-pill: var(--radius-full, 9999px);
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --maxw: 1200px;
}

/* === TOKENS: LIGHT ===
   Legacy light overrides now alias the design-system light tokens, which are
   theme-aware on their own, so light mode stays unified too. Colliding tokens
   (--bg-elevated / --border-subtle / --text-primary / --text-secondary) are
   omitted here on purpose: design-system.css already supplies their light
   values via the cascade. */
[data-theme="light"] {
  --bg-primary: var(--bg-base, #f6f7fb);
  --bg-secondary: var(--bg-surface, #ffffff);
  --bg-card: var(--bg-surface, #ffffff);
  --border: var(--border-default, rgba(15, 18, 45, 0.12));
  --accent: var(--brand-primary, #6366f1);
  --accent-hover: var(--brand-primary-hover, #5254cc);
  --accent-glow: var(--brand-glow, rgba(99, 102, 241, 0.12));
  --text-muted: var(--text-tertiary, #8a8aa0);
  --nav-bg: rgba(250, 250, 255, 0.72);
  --shadow-card: var(--shadow-md, 0 4px 16px rgba(20, 22, 55, 0.10), 0 1px 4px rgba(20, 22, 55, 0.06));
}

/* === RESET === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  transition: background 0.3s ease, color 0.3s ease;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { line-height: 1.25; font-weight: 600; }

/* === UTILITIES === */
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-gradient { background: linear-gradient(135deg, var(--accent), var(--upsell)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.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; }
.skip-link { position: absolute; left: -999px; top: 0; background: var(--accent); color: #fff; padding: 10px 16px; border-radius: var(--radius-input); z-index: 2000; }
.skip-link:focus { left: 8px; top: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* === BUTTONS === */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: var(--radius-input); border: 1px solid transparent;
  font-weight: 500; font-size: 14px; cursor: pointer; transition: var(--transition);
  white-space: nowrap; user-select: none;
}
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-hover); transform: translateY(-1px); }
.btn--glow { box-shadow: 0 4px 20px var(--accent-glow); }
.btn--glow:hover { box-shadow: 0 6px 28px var(--accent-glow); }
.btn--ghost { background: transparent; border-color: var(--border); color: var(--text-primary); }
.btn--ghost:hover { background: var(--bg-elevated); border-color: var(--accent); }
.btn--invert { background: var(--text-primary); color: var(--bg-primary); }
.btn--invert:hover { opacity: 0.88; }
.btn--danger { background: var(--danger); color: #fff; }
.btn--danger:hover { filter: brightness(1.08); }
.btn--danger-ghost { background: transparent; border-color: var(--border); color: var(--danger); }
.btn--danger-ghost:hover { background: rgba(255, 77, 106, 0.1); border-color: var(--danger); }
.btn--lg { padding: 14px 26px; font-size: 16px; }
.btn--sm { padding: 6px 12px; font-size: 13px; }
.btn--block { width: 100%; }

/* === NAVBAR (public, glassmorphism) === */
.navbar { position: sticky; top: 0; z-index: 100; background: var(--nav-bg); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--border-subtle); }
.navbar__inner { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 20px; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.navbar__links { display: flex; align-items: center; gap: 28px; }
.navbar__links a { color: var(--text-secondary); font-size: 14px; font-weight: 500; transition: var(--transition); }
.navbar__links a:hover { color: var(--text-primary); }
.navbar__actions { display: flex; align-items: center; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; }
.brand__mark { width: 30px; height: 30px; border-radius: 8px; background: url('/favicon-96x96.png') center / 130% no-repeat; flex-shrink: 0; }
.brand__name { letter-spacing: -0.02em; }
.nav-burger { display: none; background: none; border: 0; font-size: 22px; cursor: pointer; padding: 6px; }

/* === THEME TOGGLE === */
.theme-toggle { background: transparent; border: 1px solid var(--border); border-radius: 50%; width: 38px; height: 38px; display: grid; place-items: center; cursor: pointer; transition: var(--transition); }
.theme-toggle:hover { border-color: var(--accent); }
.theme-toggle__icon--dark { display: none; }
.theme-toggle__icon--light { display: inline; }
[data-theme="dark"] .theme-toggle__icon--dark { display: inline; }
[data-theme="dark"] .theme-toggle__icon--light { display: none; }

/* === SITE LAYOUT === */
.site-main { min-height: 60vh; }
.site-footer { border-top: 1px solid var(--border-subtle); padding: 48px 0; margin-top: 80px; color: var(--text-secondary); }
.site-footer__inner { display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-between; align-items: center; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.site-footer__links { display: flex; gap: 56px; flex-wrap: wrap; }
.site-footer__links > div { display: flex; flex-direction: column; gap: 8px; }
.site-footer__links h4 { font-size: 13px; font-weight: 600; color: var(--text-primary); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 4px; }
.site-footer__links a { display: block; color: var(--text-secondary); font-size: 14px; transition: var(--transition); }
.site-footer__links a:hover { color: var(--text-primary); }
.site-footer__meta { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }

/* === HERO (elevated: layered gradient mesh + soft drifting aurora) === */
.hero { position: relative; overflow: hidden; padding: 112px 0 88px; }
.hero__bg {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(48% 62% at 18% 8%, rgba(99,102,241,0.30), transparent 70%),
    radial-gradient(44% 56% at 84% 16%, rgba(167,139,250,0.24), transparent 72%),
    radial-gradient(70% 80% at 50% 116%, rgba(99,102,241,0.16), transparent 70%);
}
.hero::before {
  content: ""; position: absolute; inset: -25% -12% auto -12%; height: 440px; z-index: 0;
  background: conic-gradient(from 130deg at 50% 50%, transparent, rgba(99,102,241,0.12), transparent 38%, rgba(167,139,250,0.12), transparent 74%);
  filter: blur(46px); opacity: 0.7; pointer-events: none;
  animation: heroDrift 20s ease-in-out infinite alternate;
}
@keyframes heroDrift { from { transform: translateY(-12px) rotate(0deg); } to { transform: translateY(12px) rotate(7deg); } }
.hero__inner { position: relative; z-index: 1; display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 48px; align-items: center; }
.hero__title { font-size: 60px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.04; margin-bottom: 20px; }
.hero__sub { font-size: 20px; color: var(--text-secondary); margin-bottom: 32px; max-width: 36ch; }
.hero__cta { display: flex; gap: 14px; flex-wrap: wrap; }
@media (prefers-reduced-motion: reduce) { .hero::before { animation: none; } }
@media (max-width: 860px) { .hero__title { font-size: 40px; } .hero__inner { grid-template-columns: 1fr; } }
.eyebrow { display: inline-block; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); margin-bottom: 16px; }
.social-proof { display: flex; align-items: center; gap: 14px; margin-top: 40px; color: var(--text-secondary); font-size: 14px; }
.avatar-stack { display: flex; }
.avatar-stack .avatar { margin-left: -10px; border: 2px solid var(--bg-primary); }
.avatar-stack .avatar:first-child { margin-left: 0; }
.stars { color: var(--warning); letter-spacing: 2px; }

/* === AVATARS === */
.avatar { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--upsell)); color: #fff; display: grid; place-items: center; font-size: 14px; font-weight: 600; }
.avatar--sm { width: 28px; height: 28px; font-size: 12px; }

/* === FLOATING PREVIEW CARD === */
.preview-card { background: linear-gradient(180deg, rgba(255,255,255,0.07), rgba(255,255,255,0.02)); border: 1px solid var(--border-default); border-radius: var(--radius-card); box-shadow: 0 18px 50px rgba(0,0,0,0.4); padding: 18px; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
[data-theme="light"] .preview-card { background: linear-gradient(180deg, rgba(255,255,255,0.85), rgba(255,255,255,0.6)); }
.preview-card--float { animation: float 6s ease-in-out infinite; }
.preview-card--delay1 { animation-delay: 0.6s; }
.preview-card--delay2 { animation-delay: 1.2s; }
.preview-card__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; font-weight: 600; }
.preview-card__row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-top: 1px solid var(--border-subtle); font-size: 14px; color: var(--text-secondary); }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

/* === BADGES === */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: var(--radius-pill); font-size: 13px; font-weight: 600; border: 1px solid transparent; }
.badge--sm { padding: 3px 9px; font-size: 11px; }
.badge--active { background: rgba(0, 212, 160, 0.12); color: var(--success); box-shadow: 0 0 16px rgba(0, 212, 160, 0.18); }
.badge--slipping { background: rgba(255, 179, 71, 0.12); color: var(--warning); box-shadow: 0 0 16px rgba(255, 179, 71, 0.18); }
.badge--churned { background: rgba(255, 77, 106, 0.12); color: var(--danger); box-shadow: 0 0 16px rgba(255, 77, 106, 0.18); }
.badge--upsell { background: rgba(167, 139, 250, 0.12); color: var(--upsell); box-shadow: 0 0 16px rgba(167, 139, 250, 0.18); }
.badge--muted { background: var(--bg-elevated); color: var(--text-muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--text-muted); }
.dot--active { background: var(--success); }
.dot--warning { background: var(--warning); }
.dot--upsell { background: var(--upsell); }

/* === ACTION BRIDGE: actionable user row === */
.user-row__main { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 10px; color: inherit; padding: 2px 0; }
.user-row__main:hover .user-row__email { color: var(--accent); }
.user-row__status { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; background: var(--text-muted); }
.status-indicator { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; display: inline-block; background: var(--text-muted); }
.status-indicator--active   { background: var(--success); animation: pulse-ring-active 2.4s infinite; }
.status-indicator--slipping { background: var(--warning); box-shadow: 0 0 8px 1px rgba(255, 179, 71, 0.5); }
.status-indicator--churned  { background: var(--danger);  box-shadow: 0 0 8px 1px rgba(255, 77, 106, 0.5); }
.status-indicator--upsell   { background: var(--upsell);  animation: pulse-ring-upsell 2.4s infinite; }
@keyframes pulse-ring-active { 0% { box-shadow: 0 0 0 0 rgba(0, 212, 160, 0.45); } 70% { box-shadow: 0 0 0 7px rgba(0, 212, 160, 0); } 100% { box-shadow: 0 0 0 0 rgba(0, 212, 160, 0); } }
@keyframes pulse-ring-upsell { 0% { box-shadow: 0 0 0 0 rgba(167, 139, 250, 0.5); } 70% { box-shadow: 0 0 0 8px rgba(167, 139, 250, 0); } 100% { box-shadow: 0 0 0 0 rgba(167, 139, 250, 0); } }

/* === ACTION BRIDGE: icon button === */
.btn-icon { background: transparent; border: 1px solid var(--border); border-radius: var(--radius-input); width: 32px; height: 32px; display: grid; place-items: center; cursor: pointer; flex-shrink: 0; transition: var(--transition); color: var(--text-secondary); font-size: 14px; line-height: 1; }
.btn-icon:hover { transform: translateY(-1px); border-color: var(--accent); color: var(--text-primary); }
.btn-icon--disabled { opacity: 0.55; cursor: not-allowed; }
.btn-icon--disabled:hover { transform: none; border-color: var(--border); color: var(--text-secondary); box-shadow: none; }
.user-row__sub { margin: -6px 0 10px 21px; font-size: 12px; }
.btn-icon--slipping:hover { border-color: var(--warning); color: var(--warning); box-shadow: 0 0 14px rgba(255, 179, 71, 0.25); }
.btn-icon--churned:hover  { border-color: var(--danger);  color: var(--danger);  box-shadow: 0 0 14px rgba(255, 77, 106, 0.25); }
.btn-icon--upsell:hover   { border-color: var(--upsell);  color: var(--upsell);  box-shadow: 0 0 14px rgba(167, 139, 250, 0.3); }

/* === PULSE: live event-stream indicator === */
.live-pill { display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; border-radius: var(--radius-pill); border: 1px solid var(--border); font-size: 12px; font-weight: 600; color: var(--text-muted); }
.live-pill__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-muted); transition: var(--transition); }
.live-pill.is-live { color: var(--success); border-color: rgba(0, 212, 160, 0.3); }
.live-pill.is-live .live-pill__dot { background: var(--success); animation: pulse-ring-active 2s infinite; }
.live-pill.is-offline .live-pill__label::after { content: ' \00b7 offline'; }

/* === ACTION BRIDGE: reach-out modal === */
.reachout__to { margin-bottom: 2px; }
#reachOutModal .modal__body.form { display: grid; gap: 16px; }
#reachOutModal textarea { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-input); padding: 10px 12px; width: 100%; resize: vertical; line-height: 1.55; font-size: 14px; }
#reachOutModal textarea:focus { border-color: var(--accent); background: var(--bg-card); }
@media (prefers-reduced-motion: reduce) { .status-indicator, .live-pill__dot { animation: none !important; } }

/* === SECTIONS (marketing) === */
.section { padding: 80px 0; }
.section--alt { background: var(--bg-secondary); }
.section--tight { padding: 48px 0; }
.section__head { text-align: center; max-width: 640px; margin: 0 auto 48px; }
.section__head h2 { font-size: 36px; letter-spacing: -0.02em; margin-bottom: 12px; }
.section__lead { color: var(--text-secondary); font-size: 18px; }

/* === FEATURE GRID (elevated glass cards + sliding accent bar) === */
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.feature-card { position: relative; overflow: hidden; background: linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.012)); border: 1px solid var(--border-subtle); border-radius: var(--radius-card); padding: 28px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); transition: var(--transition); }
[data-theme="light"] .feature-card { background: linear-gradient(180deg, rgba(255,255,255,0.92), rgba(255,255,255,0.6)); }
.feature-card::before { content: ""; position: absolute; left: 0; top: 0; height: 3px; width: 100%; background: linear-gradient(90deg, var(--accent), var(--upsell)); transform: scaleX(0); transform-origin: left; transition: transform var(--transition); }
.feature-card:hover { transform: translateY(-4px); border-color: var(--border); box-shadow: 0 18px 48px rgba(0,0,0,0.32), 0 0 0 1px var(--accent-glow); }
.feature-card:hover::before { transform: scaleX(1); }
.feature-card__icon { width: 46px; height: 46px; border-radius: 12px; background: linear-gradient(135deg, var(--accent-glow), rgba(167,139,250,0.14)); border: 1px solid rgba(99,102,241,0.25); box-shadow: inset 0 0 12px rgba(99,102,241,0.12); color: var(--accent); display: grid; place-items: center; font-size: 20px; margin-bottom: 16px; }
.feature-card h3 { font-size: 18px; margin-bottom: 8px; }
.feature-card p { color: var(--text-secondary); font-size: 15px; }

/* === TIMELINE (how it works) === */
.timeline { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; counter-reset: step; }
.timeline__step { position: relative; overflow: hidden; background: linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.012)); border: 1px solid var(--border-subtle); border-radius: var(--radius-card); padding: 28px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); transition: var(--transition); }
[data-theme="light"] .timeline__step { background: linear-gradient(180deg, rgba(255,255,255,0.92), rgba(255,255,255,0.6)); }
.timeline__step:hover { transform: translateY(-4px); box-shadow: 0 16px 44px rgba(0,0,0,0.3); border-color: var(--border); }
.timeline__num { width: 36px; height: 36px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 700; margin-bottom: 14px; }
.timeline--events { display: block; }
.timeline__event { display: flex; gap: 14px; align-items: flex-start; padding: 12px 0; border-left: 2px solid var(--border); padding-left: 18px; position: relative; }
.timeline__dot { position: absolute; left: -6px; top: 18px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }

/* === TESTIMONIALS === */
.testimonial-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.testimonial { position: relative; overflow: hidden; background: linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.012)); border: 1px solid var(--border-subtle); border-radius: var(--radius-card); padding: 28px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); transition: var(--transition); }
[data-theme="light"] .testimonial { background: linear-gradient(180deg, rgba(255,255,255,0.92), rgba(255,255,255,0.6)); }
.testimonial::before { content: ""; position: absolute; left: 0; top: 0; height: 3px; width: 100%; background: linear-gradient(90deg, var(--accent), var(--upsell)); transform: scaleX(0); transform-origin: left; transition: transform var(--transition); }
.testimonial:hover { transform: translateY(-4px); box-shadow: 0 16px 44px rgba(0,0,0,0.3); border-color: var(--border); }
.testimonial:hover::before { transform: scaleX(1); }
.testimonial blockquote { font-size: 16px; margin-bottom: 18px; color: var(--text-primary); }
.testimonial__author { display: flex; align-items: center; gap: 12px; }

/* === CTA BANNER === */
.cta-banner { position: relative; overflow: hidden; background: linear-gradient(135deg, #6366f1 0%, #7c7ff5 45%, #a78bfa 100%); border-radius: 20px; padding: 56px; text-align: center; color: #fff; box-shadow: 0 24px 60px rgba(99,102,241,0.35); }
.cta-banner::after { content: ""; position: absolute; inset: 0; background: radial-gradient(60% 120% at 50% -10%, rgba(255,255,255,0.25), transparent 60%); pointer-events: none; }
.cta-banner__inner { position: relative; z-index: 1; }
.cta-banner__inner h2 { font-size: 36px; margin-bottom: 14px; }
.cta-banner__inner p { opacity: 0.92; margin-bottom: 26px; font-size: 18px; }

/* === PRICING === */
.billing-toggle { display: flex; align-items: center; justify-content: center; gap: 14px; margin-bottom: 40px; }
.billing-toggle button { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-pill); padding: 8px 18px; cursor: pointer; transition: var(--transition); }
.billing-toggle button.is-active { background: var(--accent); color: #fff; border-color: var(--accent); }
.pill--save { background: rgba(0, 212, 160, 0.14); color: var(--success); padding: 4px 10px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 600; }
.pricing-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; align-items: start; }
.price-card { background: linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.012)); border: 1px solid var(--border-subtle); border-radius: var(--radius-card); padding: 28px; position: relative; overflow: hidden; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); transition: var(--transition); }
[data-theme="light"] .price-card { background: linear-gradient(180deg, rgba(255,255,255,0.92), rgba(255,255,255,0.6)); }
.price-card::before { content: ""; position: absolute; left: 0; top: 0; height: 3px; width: 100%; background: linear-gradient(90deg, var(--accent), var(--upsell)); transform: scaleX(0); transform-origin: left; transition: transform var(--transition); }
.price-card:hover { transform: translateY(-4px); box-shadow: 0 18px 48px rgba(0,0,0,0.32), 0 0 0 1px var(--accent-glow); }
.price-card:hover::before { transform: scaleX(1); }
.price-card--popular { border-color: var(--accent); box-shadow: 0 8px 40px var(--accent-glow); }
.price-card--badge { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--accent); color: #fff; padding: 4px 14px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 600; }
.price-card__name { font-size: 18px; font-weight: 600; margin-bottom: 8px; }
.price-card__price { display: flex; align-items: baseline; gap: 4px; margin-bottom: 20px; }
.price-card__amount { font-size: 40px; font-weight: 700; letter-spacing: -0.02em; }
.price-card__per { color: var(--text-muted); font-size: 14px; }
.price-card__features { list-style: none; margin: 20px 0; display: grid; gap: 10px; }
.price-card__features li { display: flex; gap: 10px; align-items: center; font-size: 14px; color: var(--text-secondary); }
.price-card__features li::before { content: '\2713'; color: var(--success); font-weight: 700; }
.price-card__features li.is-off { color: var(--text-muted); }
.price-card__features li.is-off::before { content: '\2717'; color: var(--text-muted); }
.price-card__section-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); font-weight: 700; margin: 20px 0 8px; }
.price-card__limits li::before { content: none; }
.price-card__scope { font-size: 11px; color: var(--text-muted); font-weight: 500; margin-left: 4px; }

/* === FAQ === */
.faq { max-width: 720px; margin: 48px auto 0; }
.faq__item { border-bottom: 1px solid var(--border-subtle); padding: 18px 0; }
.faq__item summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; }
.faq__item summary::after { content: '+'; color: var(--accent); }
.faq__item[open] summary::after { content: '\2212'; }
.faq__item p { color: var(--text-secondary); margin-top: 12px; }

/* === AUTH === */
.auth-shell { display: grid; grid-template-columns: 1fr 1fr; min-height: 100vh; }
.auth-shell__aside { background: linear-gradient(160deg, var(--bg-secondary), var(--bg-primary)); padding: 64px; display: flex; flex-direction: column; justify-content: center; border-right: 1px solid var(--border-subtle); }
.auth-shell__headline { font-size: 32px; letter-spacing: -0.02em; margin: 24px 0 18px; }
.auth-shell__points { list-style: none; display: grid; gap: 14px; color: var(--text-secondary); }
.auth-shell__points li { display: flex; gap: 10px; align-items: center; }
.auth-shell__main { display: grid; place-items: center; padding: 48px 24px; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card__top { text-align: center; margin-bottom: 28px; }
.auth-card__title { font-size: 26px; margin-bottom: 8px; }
.auth-card__sub { color: var(--text-secondary); }
.auth-card__foot { text-align: center; margin-top: 22px; color: var(--text-secondary); font-size: 14px; }

/* === FORMS === */
.form { display: grid; gap: 18px; }
.form--inline { grid-template-columns: 1fr auto auto; align-items: end; }
.field { display: grid; gap: 7px; }
.field--grow { flex: 1; }
.field label { font-size: 14px; font-weight: 500; }
.field input, .field select, .field textarea,
.toolbar input, .toolbar select, .inline-form select {
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-input);
  padding: 10px 12px; transition: var(--transition); width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); background: var(--bg-card); }
.field__hint { font-size: 13px; color: var(--text-muted); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field-row--between { display: flex; justify-content: space-between; align-items: center; }
.field.has-error input { border-color: var(--danger); }
.field__error { color: var(--danger); font-size: 13px; }
.checkbox { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.checkbox input { width: auto; }
.form__actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 6px; }
.link { color: var(--accent); font-weight: 500; }
.link:hover { color: var(--accent-hover); }
.link--back { color: var(--text-secondary); font-size: 14px; display: inline-block; margin-bottom: 8px; }
.shake { animation: shake 0.4s; }
@keyframes shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

/* === ALERTS === */
.alert { padding: 12px 16px; border-radius: var(--radius-input); font-size: 14px; border: 1px solid transparent; }
.alert--success { background: rgba(0, 212, 160, 0.1); color: var(--success); border-color: rgba(0, 212, 160, 0.25); }
.alert--error { background: rgba(255, 77, 106, 0.1); color: var(--danger); border-color: rgba(255, 77, 106, 0.25); }
.alert--warning { background: rgba(255, 179, 71, 0.1); color: var(--warning); border-color: rgba(255, 179, 71, 0.25); }
.alert--info { background: var(--accent-glow); color: var(--accent); }
.alert--page { margin-bottom: 20px; }

/* === APP SHELL === */
.sidebar { background: var(--bg-secondary); border-right: 1px solid var(--border-subtle); display: flex; flex-direction: column; padding: 20px 16px; position: sticky; top: 0; height: 100vh; }
.sidebar__brand { margin-bottom: 28px; padding: 0 8px; }
.sidebar__link { position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius-input); color: var(--text-primary); font-weight: 500; font-size: 14px; transition: var(--transition); }
.sidebar__link > span:last-child { opacity: 0.82; transition: opacity 0.2s ease; }
.sidebar__link:hover { background: var(--bg-elevated); color: var(--text-primary); transform: translateX(2px); box-shadow: inset 3px 0 0 var(--accent); }
.sidebar__link:hover > span:last-child { opacity: 1; }
.sidebar__link.is-active { background: var(--accent-glow); color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.sidebar__link.is-active > span:last-child { opacity: 1; }
.sidebar__link--muted { color: var(--text-secondary); }
.sidebar__link--muted > span:last-child { opacity: 1; }
.sidebar__link--muted:hover { color: var(--text-primary); }
.sidebar__icon { width: 18px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.sidebar__foot { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--border-subtle); }
.sidebar__foot--muted { color: var(--text-muted); font-size: 13px; }
.sidebar-overlay { display: none; }

/* === USER MENU === */
.usermenu__trigger { display: flex; align-items: center; gap: 8px; background: transparent; border: 1px solid var(--border); border-radius: var(--radius-pill); padding: 5px 10px 5px 6px; cursor: pointer; }
.usermenu__dropdown { position: absolute; right: 0; top: calc(100% + 8px); background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-card); box-shadow: var(--shadow-card); min-width: 180px; padding: 8px; display: none; z-index: 60; }
.usermenu__dropdown.is-open { display: block; }
.usermenu__dropdown a, .usermenu__logout { display: block; width: 100%; text-align: left; padding: 9px 12px; border-radius: var(--radius-input); font-size: 14px; background: none; border: 0; cursor: pointer; color: var(--text-primary); }
.usermenu__dropdown a:hover, .usermenu__logout:hover { background: var(--bg-elevated); }

/* === PAGE HEAD === */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 28px; flex-wrap: wrap; }
.page-head__title { font-size: 28px; letter-spacing: -0.02em; }
.page-head__withicon { display: flex; gap: 16px; align-items: center; }

/* === CARDS === */
.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-card); padding: 24px; box-shadow: var(--shadow-card); margin-bottom: 22px; }
.card--form { max-width: 560px; }
.card--link { display: block; transition: var(--transition); }
.card--link:hover { transform: translateY(-3px); border-color: var(--accent); }
.card--inset { background: var(--bg-elevated); box-shadow: none; margin-bottom: 0; }
.card--danger { border-color: rgba(255, 77, 106, 0.4); }
.card__title { font-size: 18px; margin-bottom: 12px; }
.card__subtitle { font-size: 15px; margin: 22px 0 12px; }
.card__eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; }
.card__head-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 16px; }
.card__avatar { width: 44px; height: 44px; border-radius: 10px; background: linear-gradient(135deg, var(--accent), var(--upsell)); color: #fff; display: grid; place-items: center; font-weight: 700; }
.card__avatar--lg { width: 56px; height: 56px; font-size: 22px; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }

/* === TEAMS GRID === */
.teams-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.team-card {
  background: #1a1a2e;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: var(--transition);
  text-decoration: none;
  color: var(--text-primary);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
  min-height: 180px;
  position: relative;
  overflow: hidden;
}
.team-card__badge {
  position: absolute;
  top: 14px;
  right: 14px;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  background: rgba(108, 99, 255, 0.18);
  border: 1px solid rgba(108, 99, 255, 0.35);
  padding: 3px 9px;
  border-radius: 20px;
  letter-spacing: 0.02em;
  pointer-events: none;
}
[data-theme="light"] .team-card {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}
.team-card:hover {
  border-color: rgba(108, 99, 255, 0.5);
  transform: translateY(-3px);
  box-shadow: 0 8px 32px rgba(108, 99, 255, 0.15);
}
.team-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.team-card__avatar {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--upsell));
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 700;
  flex-shrink: 0;
}
.team-card__name {
  font-size: 16px;
  font-weight: 700;
  margin: 0;
  line-height: 1.3;
  color: var(--text-primary);
}
.team-card__role {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0;
}
.team-card__role strong {
  color: var(--text-primary);
  font-weight: 600;
}
.team-card__arrow {
  display: inline-block;
  font-size: 13px;
  color: var(--accent);
  margin-top: auto;
  font-weight: 600;
  padding-top: 4px;
}
.badge--accent { background: var(--accent-glow); color: var(--accent); border-color: transparent; }

/* === WORKSPACE SWITCHER === */
.workspace-switcher { position: relative; padding: 12px 8px 0; margin-top: auto; border-top: 1px solid var(--border-subtle); }
.workspace-switcher__trigger { display: flex; align-items: center; gap: 9px; width: 100%; padding: 9px 10px; border-radius: var(--radius-input); background: var(--bg-elevated); border: 1px solid var(--border); cursor: pointer; color: var(--text-primary); font-size: 14px; font-weight: 500; transition: var(--transition); text-align: left; }
.workspace-switcher__trigger:hover { border-color: var(--accent); background: var(--bg-card); }
.workspace-switcher__trigger[aria-expanded=true] { border-color: var(--accent); }
.workspace-switcher__trigger[aria-expanded=true] .workspace-switcher__chevron { transform: rotate(180deg); }
.workspace-switcher__avatar { width: 24px; height: 24px; border-radius: 6px; background: linear-gradient(135deg, var(--accent), var(--upsell)); color: #fff; display: grid; place-items: center; font-size: 11px; font-weight: 700; flex-shrink: 0; }
.workspace-switcher__chevron { flex-shrink: 0; color: var(--text-muted); transition: transform 0.2s ease; }
.workspace-switcher__list { position: absolute; bottom: calc(100% + 6px); left: 0; right: 0; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-card); box-shadow: var(--shadow-card); padding: 6px; z-index: 200; list-style: none; max-height: 280px; overflow-y: auto; }
.workspace-switcher__list { display: none; }
.workspace-switcher__list.ws-open { display: block; }
.workspace-switcher__form { margin: 0; }
.workspace-switcher__item { display: flex; align-items: center; gap: 9px; width: 100%; padding: 9px 10px; border-radius: var(--radius-input); background: transparent; border: 0; cursor: pointer; color: var(--text-primary); font-size: 14px; text-align: left; transition: var(--transition); text-decoration: none; }
.workspace-switcher__item:hover { background: var(--bg-elevated); }
.workspace-switcher__item.is-active { background: var(--accent-glow); color: var(--accent); }
.workspace-switcher__item-avatar { width: 22px; height: 22px; border-radius: 5px; background: linear-gradient(135deg, var(--accent), var(--upsell)); color: #fff; display: grid; place-items: center; font-size: 10px; font-weight: 700; flex-shrink: 0; }
.workspace-switcher__item-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workspace-switcher__item-tag { font-size: 11px; font-weight: 600; color: var(--accent); background: var(--accent-glow); padding: 2px 7px; border-radius: var(--radius-pill); flex-shrink: 0; }
.workspace-switcher__item-check { flex-shrink: 0; color: var(--accent); }
.workspace-switcher__item--new { color: var(--text-secondary); }
.workspace-switcher__item--new:hover { color: var(--accent); }
.workspace-switcher__divider { border: 0; border-top: 1px solid var(--border-subtle); margin: 4px 0; }

/* === STAT GRID / DASHBOARD === */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-card); padding: 20px; display: grid; gap: 4px; }
.stat-card__value { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; }
.stat-card__label { font-size: 13px; }
.stat-card--active { border-top: 3px solid var(--success); }
.stat-card--churned { border-top: 3px solid var(--danger); }
.stat-card--upsell { border-top: 3px solid var(--upsell); }
.stat-card--slipping { border-top: 3px solid var(--warning); }

.priority-panel { background: var(--bg-card); border: 1px solid var(--accent); border-radius: var(--radius-card); padding: 20px; margin-bottom: 24px; box-shadow: 0 4px 30px var(--accent-glow); }
.priority-panel__head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; flex-wrap: wrap; gap: 8px; }
.priority-panel__head h2 { font-size: 18px; }
.priority-panel__rows { display: grid; gap: 6px; }

.bucket-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.bucket { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-card); display: flex; flex-direction: column; min-height: 260px; }
.bucket__head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border-subtle); }
.bucket__count { font-weight: 700; color: var(--text-secondary); }
.bucket__list { padding: 8px; overflow-y: auto; max-height: 480px; display: grid; gap: 4px; align-content: start; }
.bucket__empty { padding: 18px 8px; text-align: center; font-size: 14px; }

.user-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius-input); transition: var(--transition); }
.user-row:hover { background: var(--bg-elevated); }
.user-row__email { font-weight: 500; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-row__meta { display: flex; align-items: center; gap: 12px; font-size: 13px; flex-shrink: 0; }
.user-row__arrow { color: var(--accent); }
.user-row--compact { padding: 8px 10px; }
.user-row--compact .user-row__events { display: none; }
.dashboard-updated { text-align: right; font-size: 13px; margin-top: 16px; }

/* === TABLES === */
.table-wrap { overflow-x: auto; border: 1px solid var(--border-subtle); border-radius: var(--radius-card); }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th { text-align: left; padding: 12px 16px; color: var(--text-muted); font-weight: 600; font-size: 13px; border-bottom: 1px solid var(--border-subtle); background: var(--bg-secondary); }
.data-table td { padding: 12px 16px; border-bottom: 1px solid var(--border-subtle); }
.data-table tr:last-child td { border-bottom: 0; }
.data-table__email { font-weight: 500; }
.data-table__user { display: flex; align-items: center; gap: 10px; }
.data-table__action { text-align: right; }
.role-pill { padding: 3px 10px; border-radius: var(--radius-pill); background: var(--bg-elevated); font-size: 12px; font-weight: 600; }

/* === TOOLBAR / FILTERS === */
.toolbar { display: flex; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; align-items: center; }
.toolbar__group { display: flex; gap: 10px; align-items: center; }
.toolbar__group--grow { flex: 1; min-width: 220px; }
.inline-select { display: inline-flex; }
.inline-select select { appearance: none; -webkit-appearance: none; -moz-appearance: none; width: auto; min-width: 190px; background-color: var(--bg-elevated); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238888aa' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; border: 1px solid var(--border); border-radius: var(--radius-pill); padding: 8px 36px 8px 16px; font-size: 14px; font-weight: 600; color: var(--text-primary); cursor: pointer; box-shadow: var(--shadow-card); transition: var(--transition); }
.inline-select select:hover { border-color: var(--accent); }
.inline-select select:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-glow); }
.inline-form { display: inline; }

/* === DETAIL GRID === */
.detail-grid { display: grid; grid-template-columns: 300px 1fr; gap: 22px; align-items: start; }
.keyval { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 14px; }
.keyval dt { color: var(--text-muted); }
.keyval dd { text-align: right; }

/* === KEY / CODE === */
.key-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.key-row__value { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-input); padding: 8px 12px; font-family: ui-monospace, 'SFMono-Regular', Menlo, monospace; font-size: 13px; }
.key-row__value--full { flex: 1; word-break: break-all; }
.code-pill { display: inline-block; margin-top: 12px; background: var(--bg-elevated); border-radius: var(--radius-input); padding: 4px 10px; font-family: ui-monospace, monospace; font-size: 12px; color: var(--text-secondary); }
.code-block { position: relative; background: var(--bg-secondary); border: 1px solid var(--border-subtle); border-radius: var(--radius-card); margin-top: 12px; }
.code-block pre { padding: 18px; overflow-x: auto; font-size: 13px; }
.code-block code { font-family: ui-monospace, 'SFMono-Regular', Menlo, monospace; }
.code-block__copy { position: absolute; top: 10px; right: 10px; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-input); padding: 4px 10px; font-size: 12px; cursor: pointer; }

/* === TABS === */
/* Docs snippet tabs use .tabs[data-tabs]; force a vertical layout so the active
   panel sits BELOW the tab bar. (The admin .tabs rule later sets display:flex,
   which would otherwise push the snippet box to the right.) */
.tabs[data-tabs] { display: block; }
.tabs[data-tabs] .tabs__panel[hidden] { display: none; }
.tabs__nav { display: flex; gap: 6px; border-bottom: 1px solid var(--border-subtle); margin-bottom: 4px; flex-wrap: wrap; }
.tabs__tab { background: none; border: 0; border-bottom: 2px solid transparent; padding: 10px 14px; cursor: pointer; color: var(--text-secondary); font-weight: 500; }
.tabs__tab.is-active { color: var(--accent); border-bottom-color: var(--accent); }

/* === HEALTH / USAGE BARS === */
.health-bars, .usage-grid { display: grid; gap: 16px; }
.health-bar__top, .usage-meter__top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; font-size: 14px; }
.health-bar__track, .usage-meter__track { height: 8px; background: var(--bg-elevated); border-radius: var(--radius-pill); overflow: hidden; }
.health-bar__fill, .usage-meter__fill { display: block; height: 100%; background: var(--accent); border-radius: var(--radius-pill); transition: width 0.4s ease; }
.health-bar__fill--active { background: var(--success); }
.health-bar__fill--slipping { background: var(--warning); }
.health-bar__fill--churned { background: var(--danger); }
.health-bar__fill--upsell { background: var(--upsell); }
.usage-meter__fill--warn { background: var(--warning); }

/* === SUBNAV (settings tabs) === */
.subnav { display: flex; gap: 8px; border-bottom: 1px solid var(--border-subtle); margin-bottom: 24px; flex-wrap: wrap; }
.subnav__link { padding: 10px 14px; border-bottom: 2px solid transparent; color: var(--text-secondary); font-weight: 500; font-size: 14px; }
.subnav__link.is-active { color: var(--accent); border-bottom-color: var(--accent); }
.pending-list { list-style: none; display: grid; gap: 8px; margin-top: 8px; }
.pending-list li { display: flex; justify-content: space-between; padding: 10px 12px; background: var(--bg-elevated); border-radius: var(--radius-input); font-size: 14px; }

/* === EMPTY STATE === */
.empty-state { text-align: center; padding: 64px 24px; background: var(--bg-card); border: 1px dashed var(--border); border-radius: var(--radius-card); }
.empty-state__icon { font-size: 40px; color: var(--accent); display: block; margin-bottom: 14px; }
.empty-state__title { font-size: 20px; margin-bottom: 8px; }
.empty-state__body { max-width: 44ch; margin: 0 auto 20px; }

/* === MODAL === */
.modal { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 24px; }
.modal[hidden] { display: none; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.5); backdrop-filter: blur(2px); }
.modal__dialog { position: relative; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-modal); padding: 24px; width: 100%; max-width: 460px; box-shadow: var(--shadow-card); animation: modalIn 0.2s ease; }
@keyframes modalIn { from { transform: translateY(10px) scale(0.98); opacity: 0; } to { transform: none; opacity: 1; } }
.modal__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.modal__title { font-size: 18px; }
.modal__close { background: none; border: 0; font-size: 24px; line-height: 1; cursor: pointer; color: var(--text-secondary); }

/* === TOASTS === */
.toast { background: var(--bg-elevated); border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: var(--radius-input); padding: 12px 16px; box-shadow: var(--shadow-card); animation: toastIn 0.3s ease; font-size: 14px; }
.toast--success { border-left-color: var(--success); }
.toast--error { border-left-color: var(--danger); }
@keyframes toastIn { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }

/* === DOCS (public, two-panel) === */
.docs { display: grid; grid-template-columns: 240px 1fr; gap: 40px; max-width: var(--maxw); margin: 0 auto; padding: 40px 24px 80px; }
.docs__sidebar { position: sticky; top: 88px; height: max-content; }
.docs__nav-title { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin: 18px 0 8px; }
.docs__nav ul { list-style: none; display: grid; gap: 2px; }
.docs__nav a { display: block; padding: 7px 12px; border-radius: var(--radius-input); color: var(--text-secondary); font-size: 14px; }
.docs__nav a:hover, .docs__nav a.is-active { background: var(--bg-elevated); color: var(--accent); }
.docs__content { min-width: 0; }
.docs__section { padding-bottom: 40px; margin-bottom: 8px; scroll-margin-top: 88px; }
.docs__section h1 { font-size: 36px; margin-bottom: 16px; }
.docs__section h2 { font-size: 24px; margin-bottom: 14px; }
.docs__section p, .docs__section li { color: var(--text-secondary); margin-bottom: 10px; }
.docs__section ol, .docs__section ul { padding-left: 22px; }
.docs__lead { font-size: 18px; }
.docs__states { list-style: none; padding-left: 0; display: grid; gap: 10px; }
.docs__states li { display: flex; gap: 10px; align-items: center; }
.docs__section code { background: var(--bg-elevated); padding: 2px 6px; border-radius: 4px; font-family: ui-monospace, monospace; font-size: 13px; color: var(--text-primary); }
.swagger-head { border-bottom: 1px solid var(--border-subtle); padding: 32px 0; }
.swagger-head h1 { font-size: 30px; margin: 8px 0; }
#swagger-ui { max-width: var(--maxw); margin: 0 auto; padding: 24px; }

/* === RESPONSIVE === */
@media (max-width: 1024px) {
  .hero__inner { grid-template-columns: 1fr; }
  .hero__title { font-size: 44px; }
  .feature-grid, .timeline, .testimonial-grid { grid-template-columns: 1fr 1fr; }
  .pricing-grid { grid-template-columns: 1fr 1fr; }
  .bucket-grid, .stat-grid { grid-template-columns: 1fr 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .navbar__links { display: none; }
  .nav-burger { display: block; }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; z-index: 200; width: 248px; transform: translateX(-100%); transition: transform 0.25s ease; }
  .sidebar.is-open { transform: none; }
  .sidebar-overlay.is-open { display: block; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 150; }
  .feature-grid, .timeline, .testimonial-grid, .pricing-grid, .bucket-grid, .stat-grid { grid-template-columns: 1fr; }
  .auth-shell { grid-template-columns: 1fr; }
  .auth-shell__aside { display: none; }
  .docs { grid-template-columns: 1fr; }
  .docs__sidebar { position: static; }
  .form--inline { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }
  .cta-banner { padding: 36px 20px; }
  .hero__title { font-size: 36px; }
}

/* === REDUCED MOTION === */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

/* ============================================================
   ADMIN PANEL
   ============================================================ */

/* Page header (used in admin + ticket views) */
.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; border-bottom: 1px solid var(--border-subtle); padding-bottom: 16px; }
.page-header__inner { display: flex; align-items: flex-start; justify-content: space-between; width: 100%; gap: 16px; flex-wrap: wrap; }
.page-title { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; display: flex; align-items: center; gap: 8px; }
.page-title__icon { opacity: 0.7; }

/* Admin tabs (link-based, not button-based) */
.tab { display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px; border-radius: var(--radius-input); color: var(--text-secondary); font-size: 13px; font-weight: 600; text-decoration: none; border: 1px solid transparent; transition: var(--transition); }
.tab:hover { color: var(--text-primary); background: var(--bg-elevated); }
.tab--active { background: var(--accent-glow); color: var(--accent); border-color: rgba(108,99,255,0.2); }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 20px; padding-bottom: 2px; border-bottom: 1px solid var(--border-subtle); }

/* Badge colour variants */
.badge--green { background: rgba(0,212,160,0.12); color: var(--success); border-color: rgba(0,212,160,0.25); }
.badge--blue { background: rgba(99,179,237,0.12); color: #63b3ed; border-color: rgba(99,179,237,0.25); }
.badge--yellow { background: rgba(255,179,71,0.12); color: var(--warning); border-color: rgba(255,179,71,0.25); }
.badge--red { background: rgba(255,77,106,0.12); color: var(--danger); border-color: rgba(255,77,106,0.25); }
.badge--purple { background: rgba(167,139,250,0.12); color: var(--upsell); border-color: rgba(167,139,250,0.25); }
.badge--gold { background: rgba(255,196,0,0.12); color: #f6c90e; border-color: rgba(255,196,0,0.25); }
.badge--outline { background: transparent; border-color: var(--border); color: var(--text-secondary); }

/* Muted text utility */
.muted { color: var(--text-muted); font-size: 13px; }

/* Admin two-column layout */
.admin-panel { margin-top: 4px; }
.admin-cols { display: grid; grid-template-columns: 280px 1fr; gap: 18px; align-items: start; }
.admin-col { min-width: 0; }
.admin-col--list { max-height: calc(100vh - 200px); overflow-y: auto; }
.admin-col--editor {}

/* User list (sidebar) */
.user-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.user-list__item a { display: flex; flex-direction: column; padding: 10px 12px; border-radius: var(--radius-input); text-decoration: none; transition: var(--transition); }
.user-list__item a:hover { background: var(--bg-elevated); }
.user-list__item--active a { background: var(--accent-glow); }
.user-list__name { font-weight: 600; font-size: 13px; color: var(--text-primary); }
.user-list__email { font-size: 12px; color: var(--text-muted); }
.user-list__item { position: relative; }
.user-list__item .badge { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); }

/* Card sub-elements */
.card__header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border-subtle); font-size: 13px; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .05em; flex-wrap: wrap; }
.card__body { padding: 16px; }
.card__footer { padding: 10px 16px; border-top: 1px solid var(--border-subtle); background: var(--bg-secondary); border-radius: 0 0 var(--radius-card) var(--radius-card); }
.card--inner { background: var(--bg-elevated); box-shadow: none; border: 1px solid var(--border-subtle); }
.card--empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; min-height: 200px; background: var(--bg-elevated); border: 1px dashed var(--border); }

/* Table (admin style — different from .data-table) */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; padding: 8px 12px; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); border-bottom: 1px solid var(--border-subtle); font-weight: 600; }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--border-subtle); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover td { background: var(--bg-elevated); }
.table--sm th, .table--sm td { padding: 7px 10px; font-size: 12px; }
.table__empty { text-align: center; padding: 24px; color: var(--text-muted); }
.row--unread td { background: rgba(108,99,255,0.04); }

/* Status filter (ticket tab) */
.status-filter { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

/* Pagination */
.pagination { display: flex; align-items: center; gap: 12px; padding: 12px 16px; justify-content: center; }

/* Form elements (admin-style) */
.form-row { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.form-row label { font-size: 12px; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .04em; }
.form-row .muted { font-size: 11px; font-weight: 400; text-transform: none; letter-spacing: 0; }
.form-row--check { flex-direction: row; align-items: center; gap: 8px; }
.form-row--check label { text-transform: none; letter-spacing: 0; font-weight: 500; display: flex; align-items: center; gap: 6px; cursor: pointer; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid--3 { grid-template-columns: repeat(3, 1fr); }
.form-actions { display: flex; gap: 8px; align-items: center; margin-top: 4px; }
.form-check { display: flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.req { color: var(--danger); }

/* Input (admin-style, different from .field input) */
.input { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-input); padding: 9px 11px; width: 100%; font-size: 13px; color: var(--text-primary); transition: var(--transition); }
.input:focus { border-color: var(--accent); background: var(--bg-card); outline: none; }
.input--sm { padding: 6px 9px; font-size: 12px; }

/* User metadata row */
.user-meta-bar { display: flex; flex-wrap: wrap; gap: 14px; padding: 10px 0 14px; border-bottom: 1px solid var(--border-subtle); margin-bottom: 14px; font-size: 12px; color: var(--text-muted); }
.user-meta-bar__item { display: flex; align-items: center; gap: 5px; }

/* Modal (admin-style — different from .modal/.modal__dialog) */
.modal__overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.55); backdrop-filter: blur(3px); z-index: 900; display: flex; align-items: center; justify-content: center; padding: 24px; }
.modal__box { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-modal); box-shadow: var(--shadow-card); width: 100%; max-width: 520px; display: flex; flex-direction: column; max-height: 90vh; overflow: hidden; animation: modalIn 0.2s ease; }
.modal__box--lg { max-width: 740px; }
.modal__header { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border-subtle); font-size: 15px; font-weight: 600; flex-shrink: 0; }
.modal__body { padding: 18px; overflow-y: auto; flex: 1; }
.modal__footer { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--border-subtle); flex-shrink: 0; background: var(--bg-secondary); }
.modal__close { margin-left: auto; background: none; border: none; cursor: pointer; color: var(--text-muted); display: flex; align-items: center; }
.modal__close:hover { color: var(--text-primary); }

/* Cron modal output */
.cron-status { padding: 10px 0 6px; font-size: 14px; }
.cron-output { background: var(--bg-secondary); border: 1px solid var(--border-subtle); border-radius: 6px; padding: 12px; font-size: 12px; font-family: ui-monospace, monospace; white-space: pre-wrap; word-break: break-word; max-height: 280px; overflow-y: auto; margin-top: 10px; }

/* Deal code section (ProxyWeb-style collapsible) */
.admin-deal-list { display: flex; flex-direction: column; gap: 8px; }
.admin-deal-item { background: var(--bg-elevated); border: 1px solid var(--border-subtle); border-radius: var(--radius-card); overflow: hidden; }
.admin-deal-item.admin-deal-current { border-color: rgba(108,99,255,0.45); }
.admin-deal-item > summary { display: flex; align-items: center; gap: 10px; padding: 10px 14px; cursor: pointer; font-size: 13px; flex-wrap: wrap; list-style: none; }
.admin-deal-item > summary:hover { background: rgba(255,255,255,0.03); }
.admin-deal-code { font-family: ui-monospace, monospace; font-weight: 700; letter-spacing: 1px; }
.admin-deal-date { margin-left: auto; }
.admin-deal-edit { padding: 14px; border-top: 1px solid var(--border-subtle); }
.admin-deal-status { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 12px; }
.admin-deal-apply { margin: 0 0 16px; }
.admin-deal-apply-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.admin-deal-apply-row .input { max-width: 220px; }
.admin-deal-history-h { margin: 4px 0 8px; font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; font-weight: 600; }

/* Details accordion (admin user sections) */
.admin-user-section { background: var(--bg-elevated); border: 1px solid var(--border-subtle); border-radius: var(--radius-card); margin-bottom: 10px; overflow: hidden; }
.admin-user-section > summary { display: flex; align-items: center; gap: 8px; padding: 11px 14px; cursor: pointer; font-size: 13px; font-weight: 600; list-style: none; color: var(--text-secondary); }
.admin-user-section > summary:hover { background: rgba(255,255,255,0.03); color: var(--text-primary); }
.admin-user-section > .form-grid,
.admin-user-section > div { padding: 12px 14px 14px; }

/* Prose (ticket message content) */
.prose { font-size: 14px; line-height: 1.65; color: var(--text-primary); }
.prose a { color: var(--accent); text-decoration: underline; }
.prose img { max-width: 100%; border-radius: 6px; margin: 6px 0; }
.prose pre, .prose code { background: rgba(0,0,0,0.3); border-radius: 4px; padding: 2px 6px; font-family: ui-monospace, monospace; font-size: 13px; }
.prose blockquote { border-left: 3px solid var(--accent); padding-left: 10px; margin: 8px 0; color: var(--text-muted); }

/* Responsive admin */
@media (max-width: 900px) {
  .admin-cols { grid-template-columns: 1fr; }
  .admin-col--list { max-height: 240px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid--3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .form-grid--3 { grid-template-columns: 1fr; }
}

/* ============================================================
   INTEGRATION SETUP WIZARD (additive layer — Integration page)
   Professional, clean design with improved spacing and hierarchy.
   ============================================================ */
.setup-wizard__bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--border-subtle); flex-wrap: wrap; }
.setup-wizard__bar-left { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.setup-wizard__bar-right { display: flex; align-items: center; gap: 14px; }
.setup-wizard__editor { font-size: 12px; color: var(--text-muted); }
.setup-wizard__saved { transition: opacity 0.2s ease; }
.setup-wizard__reopen { margin-top: 12px; }
.setup-wizard__manual { padding: 22px 0; }

.setup-wizard__summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.setup-wizard__summary-grid { display: grid; grid-template-columns: repeat(3, minmax(120px, 1fr)); gap: 18px; flex: 1; }
.setup-wizard__summary-grid > div { display: flex; flex-direction: column; gap: 4px; font-size: 14px; font-weight: 600; }
.setup-wizard__summary-grid .text-muted { font-size: 12px; font-weight: 400; }

.wizard-steps { list-style: none; display: flex; align-items: center; gap: 0; margin: 8px 0 26px; padding: 0; }
.wizard-steps__step { display: flex; align-items: center; gap: 10px; flex: 1; color: var(--text-muted); font-size: 13px; font-weight: 600; }
.wizard-steps__step:not(:last-child)::after { content: ''; flex: 1; height: 2px; background: var(--border); margin: 0 12px; border-radius: 2px; transition: var(--transition); }
.wizard-steps__num { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--bg-elevated); border: 2px solid var(--border); font-size: 13px; font-weight: 700; flex-shrink: 0; transition: var(--transition); }
.wizard-steps__step.is-active { color: var(--text-primary); }
.wizard-steps__step.is-active .wizard-steps__num { background: var(--accent); color: #fff; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.wizard-steps__step.is-done .wizard-steps__num { background: var(--accent-glow); color: var(--accent); border-color: var(--accent); }
.wizard-steps__step.is-done:not(:last-child)::after { background: var(--accent); }

.wizard-panel__title { font-size: 17px; font-weight: 700; margin-bottom: 14px; letter-spacing: -0.01em; color: var(--text-primary); }

.lang-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.lang-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 20px 14px; background: var(--bg-card); border: 2px solid var(--border); border-radius: var(--radius-card); cursor: pointer; transition: var(--transition); text-align: center; }
.lang-tile:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow-card); }
.lang-tile.is-active { border-color: var(--accent); background: var(--accent-glow); box-shadow: 0 0 0 3px rgba(108,99,255,0.12), var(--shadow-card); }
.lang-tile__icon { color: var(--accent); display: inline-flex; }
.lang-tile__name { font-size: 13px; font-weight: 700; color: var(--text-primary); letter-spacing: -0.01em; }

.wizard-map { width: 100%; border-collapse: collapse; font-size: 14px; }
.wizard-map thead th { text-align: left; padding: 8px 10px; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); border-bottom: 1px solid var(--border-subtle); font-weight: 600; }
.wizard-map td { padding: 7px 10px; border-bottom: 1px solid var(--border-subtle); vertical-align: middle; }
.wizard-map__label { font-weight: 500; white-space: nowrap; width: 38%; }
.wizard-map td .input { font-family: ui-monospace, 'SFMono-Regular', Menlo, monospace; }

.wizard-events__bar { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.wizard-events__bar .input { max-width: 280px; }
.wizard-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.wizard-chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: var(--radius-pill); background: var(--bg-card); border: 2px solid var(--border); color: var(--text-secondary); font-size: 13px; font-weight: 600; cursor: pointer; transition: var(--transition); }
.wizard-chip:hover { border-color: var(--accent); color: var(--text-primary); transform: translateY(-1px); }
.wizard-chip.is-on { background: var(--accent-glow); border-color: var(--accent); color: var(--accent); box-shadow: 0 0 0 2px rgba(108,99,255,0.1); }
.wizard-chip--custom { cursor: default; }
.wizard-chip__x { background: none; border: 0; color: inherit; cursor: pointer; font-size: 15px; line-height: 1; padding: 0; }
.wizard-custom { margin-top: 16px; display: grid; gap: 8px; }
.wizard-custom__row { display: flex; gap: 8px; align-items: center; }
.wizard-custom__row .input { max-width: 280px; }

.wizard-preview { margin-top: 24px; background: var(--bg-elevated); border: 1px solid var(--border-subtle); border-radius: var(--radius-card); padding: 18px; }
.wizard-preview__head { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 12px; color: var(--text-muted); font-weight: 700; }
.wizard-preview .code-block { margin-top: 0; max-height: 360px; overflow: auto; }
.wizard-preview pre { padding: 16px; }
.wizard-preview code { font-family: ui-monospace, 'SFMono-Regular', Menlo, monospace; font-size: 13px; white-space: pre; }

.wizard-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 4px; }
.wizard-nav { display: flex; gap: 10px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border-subtle); }
.wizard-nav [data-wizard-next], .wizard-nav [data-wizard-finish] { margin-left: auto; }

/* Minimal highlight.js dark theme (JS self-hosted at /assets/vendor/highlightjs via composer; theme inline per CSP) */
.hljs { color: var(--text-primary); background: transparent; }
.hljs-comment, .hljs-quote { color: #6b7280; font-style: italic; }
.hljs-keyword, .hljs-selector-tag, .hljs-literal, .hljs-section, .hljs-link { color: var(--upsell); }
.hljs-string, .hljs-attr, .hljs-template-tag, .hljs-addition { color: var(--success); }
.hljs-number, .hljs-built_in, .hljs-builtin-name, .hljs-type { color: var(--warning); }
.hljs-title, .hljs-name { color: #63b3ed; }
.hljs-attribute, .hljs-variable, .hljs-tag { color: var(--accent-hover); }

@media (max-width: 768px) {
  .wizard-steps__label { display: none; }
  .setup-wizard__summary-grid { grid-template-columns: 1fr; }
  .wizard-map__label { width: auto; }
}

/* ============================================================
   INTEGRATION PAGE v2 — CodeBlock component, mode toggle,
   mapping table, SDK reference. Additive — no existing rules
   were modified.
   ============================================================ */

/* ── CodeBlock wrapper (dark, Nord palette, selection-isolated) ── */
.code-block-wrapper {
  border-radius: 8px;
  border: 1px solid #2d2d2d;
  background: #1e1e2e;
  overflow: hidden;
  margin: 16px 0;
  font-family: 'JetBrains Mono', 'Fira Code', ui-monospace, 'SFMono-Regular', Menlo, 'Courier New', monospace;
}
.code-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: #181825;
  border-bottom: 1px solid #2d2d2d;
}
.code-block-lang {
  font-size: 11px;
  font-weight: 600;
  color: #6c7086;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.code-block-scroll {
  max-height: 420px;
  overflow-y: auto;
  overflow-x: auto;
}
.code-block-pre {
  margin: 0;
  padding: 20px;
  color: #cdd6f4;
  font-size: 13px;
  line-height: 1.65;
  /* Isolate text selection to the code element only */
  user-select: text;
  -webkit-user-select: text;
}
/* Prevent selection bleeding outside the pre */
.code-block-wrapper * { user-select: none; -webkit-user-select: none; }
.code-block-pre,
.code-block-code { user-select: text !important; -webkit-user-select: text !important; }

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 4px;
  border: 1px solid #45475a;
  background: transparent;
  color: #cdd6f4;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  flex-shrink: 0;
}
.copy-btn:hover { background: #313244; }
.copy-btn.copied { color: #a6e3a1; border-color: #a6e3a1; }

/* Wizard preview override: no extra margin inside the preview card */
.wizard-preview .code-block-wrapper { margin: 0; }

/* ── Mode toggle (Guided Wizard | Manual / Docs) ── */
.mode-toggle {
  display: inline-flex;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px;
  gap: 4px;
  margin-bottom: 16px;
}
.mode-btn {
  padding: 8px 22px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}
.mode-btn--active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 8px var(--accent-glow);
}
.mode-btn:not(.mode-btn--active):hover { color: var(--text-primary); }

.setup-wizard__meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  min-height: 24px;
  flex-wrap: wrap;
}

/* ── Mapping table (Step 2) ── */
.mapping-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.mapping-table thead th {
  text-align: left;
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.mapping-table tbody tr:nth-child(even) { background: var(--bg-elevated); }
.mapping-table tbody td {
  padding: 10px 14px;
  border: none;
  vertical-align: middle;
}
.mapping-input {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 6px 10px;
  color: var(--text-primary);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12px;
  transition: var(--transition);
}
.mapping-input:focus { border-color: var(--accent); outline: none; background: var(--bg-card); }
.preview-cell {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12px;
  color: #a6e3a1;
  max-width: 180px;
  word-break: break-all;
}
.badge.required {
  background: rgba(243,139,168,0.15);
  color: #f38ba8;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 99px;
  text-transform: uppercase;
  border: none;
  display: inline-block;
}

/* ── SDK Reference (<details> collapsed by default) ── */
.sdk-reference { cursor: default; }
.sdk-reference__summary {
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0;
  color: var(--text-primary);
  gap: 12px;
}
.sdk-reference__summary::-webkit-details-marker { display: none; }
.sdk-reference__summary::after {
  content: '+';
  color: var(--accent);
  font-size: 22px;
  font-weight: 300;
  line-height: 1;
  flex-shrink: 0;
}
.sdk-reference[open] .sdk-reference__summary::after { content: '\2212'; }

/* ── Responsive overrides ── */
@media (max-width: 768px) {
  /* Hide Preview column on small screens */
  .mapping-table thead th:nth-child(4),
  .mapping-table tbody td:nth-child(4) { display: none; }
  .mode-toggle { width: 100%; }
  .mode-btn { flex: 1; text-align: center; }
}

/* ============================================================
   INTEGRATION PAGE — snippet tabs + getting-started onboarding
   (additive; classes used by views/integration.php)
   ============================================================ */

/* Snippet framework tabs (.tab-bar / .tab-panel) */
.tab-bar { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--border-subtle); margin-top: 18px; }
.tab-bar__tab { background: none; border: 0; border-bottom: 2px solid transparent; padding: 10px 16px; margin-bottom: -1px; cursor: pointer; color: var(--text-secondary); font-weight: 600; font-size: 13px; border-radius: var(--radius-input) var(--radius-input) 0 0; transition: var(--transition); white-space: nowrap; }
.tab-bar__tab:hover { color: var(--text-primary); background: var(--bg-elevated); }
.tab-bar__tab.is-active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-panel { margin-top: 16px; }
.tab-panel.hidden { display: none; }

/* Getting-started onboarding banner + checklist */
.onboarding-banner { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-card); box-shadow: var(--shadow-card); padding: 20px 22px; margin-bottom: 22px; }
.onboarding-banner__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.onboarding-banner__head strong { font-size: 16px; }
.onboarding-checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.onboarding-checklist__item { display: flex; align-items: center; gap: 12px; padding: 11px 14px; background: var(--bg-elevated); border: 1px solid var(--border-subtle); border-radius: var(--radius-input); font-size: 14px; color: var(--text-secondary); transition: var(--transition); }
.onboarding-checklist__item.is-done { color: var(--text-primary); border-color: rgba(0, 212, 160, 0.28); background: rgba(0, 212, 160, 0.06); }
.onboarding-checklist__check { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; background: var(--bg-card); border: 1px solid var(--border); color: var(--text-muted); }
.onboarding-checklist__item.is-done .onboarding-checklist__check { background: rgba(0, 212, 160, 0.16); border-color: rgba(0, 212, 160, 0.4); color: var(--success); }

/* ============================================================
   INTEGRATION PAGE — two-part layout (Step 1 base snippet,
   Step 2 guided wizard) + placement guidance. Additive.
   ============================================================ */
.int-step { margin-bottom: 28px; }
.int-step__head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.int-step__num { width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 18px; flex-shrink: 0; box-shadow: 0 4px 12px var(--accent-glow); }
.int-step__title { font-size: 22px; margin-bottom: 6px; font-weight: 700; letter-spacing: -0.02em; }
.int-step__sub { font-size: 15px; line-height: 1.5; }
.int-note { background: var(--bg-elevated); border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: var(--radius-input); padding: 14px 16px; font-size: 14px; color: var(--text-secondary); margin: 16px 0; line-height: 1.6; }
.int-note strong { color: var(--text-primary); }
.int-note em { color: var(--text-primary); font-style: italic; }
.int-note code { background: var(--bg-elevated); padding: 1px 6px; border-radius: 4px; font-family: ui-monospace, monospace; font-size: 12px; }
.int-note--ok { background: rgba(0,212,160,0.08); border-color: rgba(0,212,160,0.3); }
.int-note--plan { background: var(--bg-elevated); border-color: var(--border); }
.lang-group { margin-bottom: 18px; }
.lang-group:last-child { margin-bottom: 0; }
.lang-group__title { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); font-weight: 700; margin-bottom: 10px; }
.placement-note { display: flex; flex-direction: column; gap: 4px; background: var(--bg-elevated); border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: var(--radius-input); padding: 12px 14px; font-size: 14px; margin-top: 18px; }
.placement-note [data-placement-where] { color: var(--text-primary); font-weight: 600; }
.placement-note [data-placement-base] { font-size: 13px; }

/* ── Manual snippet tab nav (.code-block-tabnav / .code-block-tab) ──
   These live inside .code-block-header (bg #181825) so they use the
   dark palette rather than the app-level tab colours.              */
.code-block-tabnav {
  display: flex;
  gap: 2px;
  flex: 1;
  flex-wrap: wrap;
  align-items: center;
}
.code-block-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: #9399b2;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
  /* prevent the global user-select:none on .code-block-wrapper from
     blocking button interaction */
  user-select: none;
  -webkit-user-select: none;
}
/* Hover on an inactive tab: subtle accent tint, never mistaken for active. */
.code-block-tab:hover {
  background: rgba(108, 99, 255, 0.10);
  color: #cdd6f4;
}
/* Active tab: solid accent fill so the current language is unmistakable. */
.code-block-tab.is-active {
  background: #6c63ff;
  border-color: #6c63ff;
  color: #fff;
  box-shadow: 0 2px 8px rgba(108, 99, 255, 0.35);
}
.code-block-tab.is-active:hover {
  background: #6c63ff;
  color: #fff;
}