/* ==========================================================================
   SITE STUDIO OS — DESIGN SYSTEM & WEB OPERATING SYSTEM STYLES
   ========================================================================== */

:root {
  --bg-deep: #080c14;
  --bg-surface: #0e1422;
  --bg-card: #131c30;
  --bg-card-hover: #19243c;
  --bg-glass: rgba(19, 28, 48, 0.7);

  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-active: rgba(99, 102, 241, 0.5);
  --border-focus: #6366f1;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --primary: #6366f1;
  --primary-glow: rgba(99, 102, 241, 0.4);
  --primary-hover: #4f46e5;
  --accent-cyan: #06b6d4;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 22px;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Outfit', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 25px var(--primary-glow);
}

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

body.studio-os {
  background-color: var(--bg-deep);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

/* ==========================================================================
   APP SHELL & SIDEBAR NAVIGATION LAYOUT
   ========================================================================== */

.os-app-shell {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

/* LEFT SIDEBAR */
.os-sidebar {
  width: 275px;
  min-width: 275px;
  max-width: 275px;
  height: 100vh;
  position: sticky;
  top: 0;
  background: #090d16;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  z-index: 45;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.35);
  transition: width 0.25s ease;
}

.sidebar-brand {
  padding: 24px 18px 20px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-logo-link {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.sidebar-logo-img {
  height: 58px;
  width: auto;
  max-width: 195px;
  object-fit: contain;
  filter: drop-shadow(0 3px 14px rgba(6, 182, 212, 0.4));
  transition: transform 0.2s ease;
}

.sidebar-logo-link:hover .sidebar-logo-img {
  transform: scale(1.03);
}

.sidebar-brand-sub {
  font-size: 11.5px;
  color: var(--text-dim);
  margin-top: 10px;
  letter-spacing: 0.8px;
  font-weight: 600;
  text-transform: uppercase;
  opacity: 0.85;
}

.sidebar-nav-container {
  flex: 1;
  padding: 20px 12px;
  overflow-y: auto;
}

.sidebar-section-title {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-dim);
  letter-spacing: 1.2px;
  text-transform: uppercase;
  padding: 0 10px 10px 10px;
}

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

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  text-decoration: none;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid transparent;
}

.sidebar-nav-item:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
  transform: translateX(3px);
}

.sidebar-nav-item.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.22), rgba(6, 182, 212, 0.16));
  border: 1px solid rgba(99, 102, 241, 0.4);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.18);
}

.nav-item-icon {
  font-size: 16px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-item-label {
  flex: 1;
}

.sidebar-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  background: rgba(99, 102, 241, 0.35);
  color: #c7d2fe;
}

.sidebar-badge.subtle {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-dim);
  font-size: 10px;
  font-weight: 500;
}

/* SIDEBAR TELEMETRY */
.sidebar-telemetry {
  margin: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.telemetry-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.telemetry-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-emerald);
}

.telemetry-env {
  margin-left: auto;
  font-size: 10px;
  font-weight: 600;
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.telemetry-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
}

.telemetry-row {
  display: flex;
  justify-content: space-between;
  color: var(--text-dim);
}

.tel-val {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 10px;
}

/* SIDEBAR USER FOOTER */
.sidebar-user-footer {
  padding: 14px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(0, 0, 0, 0.25);
}

.user-footer-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #06b6d4, #6366f1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.user-footer-info {
  flex: 1;
  min-width: 0;
}

.user-footer-email {
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-footer-role {
  font-size: 10px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.user-footer-logout {
  color: #f87171;
  text-decoration: none;
  font-size: 16px;
  padding: 5px 8px;
  border-radius: 6px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-footer-logout:hover {
  background: rgba(239, 68, 68, 0.15);
  transform: scale(1.05);
}

/* ==========================================================================
   CLEAR TOP HEADER & MAIN CONTENT
   ========================================================================== */

.os-content-pane {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.06) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(6, 182, 212, 0.05) 0%, transparent 40%);
}

.os-header {
  height: 64px;
  background: rgba(11, 15, 23, 0.75);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 35;
  backdrop-filter: blur(14px);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-breadcrumb {
  display: flex;
  align-items: center;
  gap: 12px;
}

.crumb-icon {
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.crumb-titles {
  display: flex;
  flex-direction: column;
}

.header-page-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  margin: 0;
  line-height: 1.2;
}

.header-page-sub {
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.3;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.header-action-btn {
  background: linear-gradient(135deg, #0284c7, #06b6d4);
  color: #fff;
  font-weight: 700;
  border: none;
  box-shadow: 0 3px 12px rgba(6, 182, 212, 0.35);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.header-action-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 16px rgba(6, 182, 212, 0.5);
}

@media (max-width: 900px) {
  .os-sidebar {
    width: 72px;
    min-width: 72px;
    max-width: 72px;
  }
  .sidebar-logo-img, .sidebar-brand-sub, .sidebar-section-title, .nav-item-label, .sidebar-badge, .sidebar-telemetry, .user-footer-info {
    display: none;
  }
  .sidebar-brand {
    padding: 16px 12px;
    text-align: center;
  }
  .sidebar-nav-item {
    justify-content: center;
    padding: 12px;
  }
  .os-header {
    padding: 0 16px;
  }
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-emerald);
}

.status-dot.pulse {
  box-shadow: 0 0 10px var(--accent-emerald);
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.status-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--accent-emerald);
}

.badge-os {
  background: linear-gradient(135deg, #06b6d4, #0284c7);
  color: #fff;
  font-size: 11.5px;
  font-weight: 800;
  padding: 4px 9px;
  border-radius: 6px;
  letter-spacing: 1px;
  box-shadow: 0 2px 10px rgba(6, 182, 212, 0.45);
}

/* ==========================================================================
   MAIN VIEWS
   ========================================================================== */

.os-main {
  flex: 1;
  padding: 24px;
  max-width: 1600px;
  margin: 0 auto;
  width: 100%;
}

.view-panel {
  display: none;
}

.view-panel.active {
  display: block;
  animation: fadeIn 0.25s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   LAUNCHER VIEW LAYOUT
   ========================================================================== */

.launcher-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 24px;
  align-items: start;
}

.deck-header {
  margin-bottom: 20px;
}

.deck-title-wrap h2 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}

.deck-title-wrap p {
  color: var(--text-muted);
  font-size: 14px;
}

/* Intake Mode Switcher */
.intake-switcher {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  background: var(--bg-surface);
  padding: 6px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  width: fit-content;
}

.mode-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.mode-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.mode-btn.active {
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.4);
  font-weight: 600;
}

/* Intake Panes */
.intake-pane {
  display: none;
  margin-bottom: 24px;
}

.intake-pane.active {
  display: block;
}

/* ==========================================================================
   DROP ZONE & VISUAL EXTRACTION
   ========================================================================== */

.drop-zone-card {
  background: var(--bg-surface);
  border: 2px dashed rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-lg);
  padding: 40px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.drop-zone-card:hover, .drop-zone-card.drag-over {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.05);
  box-shadow: 0 0 30px rgba(99, 102, 241, 0.15);
}

.upload-icon-circle {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.1);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.drop-zone-content h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 6px;
}

.drop-zone-content p {
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 16px;
}

.browse-link {
  color: var(--accent-cyan);
  text-decoration: underline;
  font-weight: 600;
}

.zone-tags {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.zone-tags span {
  font-size: 11px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--border-subtle);
}

/* Analysis Box */
.analysis-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-active);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-top: 16px;
  box-shadow: var(--shadow-card);
}

.analysis-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 20px;
  align-items: start;
}

.preview-label, .section-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-dim);
  display: block;
  margin-bottom: 8px;
}

.preview-frame {
  width: 100%;
  height: 200px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #000;
  border: 1px solid var(--border-subtle);
}

.preview-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.recommendation-badge {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(6, 182, 212, 0.15));
  border: 1px solid rgba(99, 102, 241, 0.4);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.rec-icon {
  font-size: 24px;
}

.rec-title {
  display: block;
  font-size: 14px;
  color: #fff;
}

.rec-title strong {
  color: var(--accent-cyan);
}

.rec-desc {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.color-swatches {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.swatch-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.swatch-color {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  border: 2px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
  transition: transform 0.2s ease;
}

.swatch-color:hover {
  transform: scale(1.1);
}

.swatch-label {
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--text-dim);
}

.quick-apply-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* ==========================================================================
   URL SCANNER
   ========================================================================== */

.url-scan-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.url-input-group {
  display: flex;
  gap: 10px;
  margin: 10px 0 6px;
}

.url-input-group input {
  flex: 1;
  background: var(--bg-deep);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  color: #fff;
  font-size: 14px;
}

.url-input-group input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-glow);
}

.scan-output {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border-subtle);
}

.scan-summary-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.badge-success {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.4);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
}

.scan-details-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  background: var(--bg-deep);
  padding: 12px;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
}

.scan-meta-item .meta-label {
  font-size: 11px;
  color: var(--text-dim);
  display: block;
}

.scan-meta-item .meta-val {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.detected-module-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 8px 0 16px;
}

.detected-tag {
  background: rgba(6, 182, 212, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(6, 182, 212, 0.4);
  font-size: 11px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 4px;
}

/* ==========================================================================
   FORM CARDS & CONTROLS
   ========================================================================== */

.form-section-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 20px;
}

.section-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
  position: relative;
}

.section-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.2);
  color: var(--primary);
  border: 1px solid var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}

.section-heading h3 {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  color: #fff;
}

.section-heading p {
  color: var(--text-muted);
  font-size: 12px;
}

.module-shortcuts {
  margin-left: auto;
  display: flex;
  gap: 6px;
}

.form-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
}

.required {
  color: var(--accent-rose);
}

.field-hint {
  font-size: 11px;
  color: var(--text-dim);
}

input[type="text"], input[type="email"], input[type="url"], textarea {
  background: var(--bg-deep);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: #fff;
  font-family: var(--font-sans);
  font-size: 13px;
  transition: all 0.2s ease;
}

input:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-glow);
}

.code-textarea {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
}

.label-with-action {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

input[type="color"] {
  -webkit-appearance: none;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: none;
}

input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

input[type="color"]::-webkit-color-swatch {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}

/* Asset Upload Tiles */
.asset-uploads-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 16px;
}

.upload-tile {
  background: var(--bg-deep);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  text-align: center;
}

.upload-tile label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  display: block;
  margin-bottom: 8px;
}

.tile-preview-wrap {
  height: 70px;
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.02);
}

.tile-preview-wrap.dark {
  background: #05080f;
}

.tile-preview-wrap img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
}

.tile-placeholder {
  font-size: 11px;
  color: var(--text-dim);
}

.file-mini {
  font-size: 11px;
  color: var(--text-dim);
  width: 100%;
}

/* ==========================================================================
   THEME SELECTION CARDS
   ========================================================================== */

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

.theme-card {
  background: var(--bg-deep);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
  display: flex;
  flex-direction: column;
}

.theme-card:hover {
  border-color: rgba(99, 102, 241, 0.4);
  transform: translateY(-2px);
}

.theme-card.selected {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.08);
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.25);
}

.theme-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.theme-name {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: #fff;
}

.theme-check {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
}

.theme-card.selected .theme-check {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.theme-desc {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 12px;
  flex: 1;
}

.theme-palette-preview {
  display: flex;
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 10px;
}

.theme-palette-preview span {
  flex: 1;
}

.theme-tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.theme-tags span {
  font-size: 9px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-dim);
  padding: 1px 6px;
  border-radius: 4px;
}

/* ==========================================================================
   MODULES MATRIX
   ========================================================================== */

.modules-accordion {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.mod-toggle-card {
  background: var(--bg-deep);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mod-toggle-card:hover {
  border-color: rgba(255, 255, 255, 0.15);
}

.mod-toggle-card.checked {
  border-color: rgba(99, 102, 241, 0.4);
  background: rgba(99, 102, 241, 0.06);
}

.mod-checkbox {
  margin-top: 3px;
  cursor: pointer;
  accent-color: var(--primary);
}

.mod-info {
  flex: 1;
}

.mod-title {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
}

.mod-desc {
  display: block;
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.3;
  margin-top: 2px;
}

/* ==========================================================================
   LAUNCH DOCK (STICKY ASIDE)
   ========================================================================== */

.launch-dock {
  position: sticky;
  top: 92px;
}

.dock-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-active);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.6);
  position: relative;
  overflow: hidden;
}

.dock-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #6366f1, #06b6d4);
}

.dock-badge {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--accent-cyan);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.dock-card h3 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 16px;
}

.dock-meta-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}

.dock-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.dock-meta-row .lbl {
  color: var(--text-dim);
}

.dock-meta-row .val {
  color: #fff;
  font-weight: 500;
}

.dock-meta-row .val.highlight {
  color: var(--accent-emerald);
  font-weight: 700;
}

.color-val {
  display: flex;
  align-items: center;
  gap: 6px;
}

.color-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.btn-launch-pulse {
  width: 100%;
  background: linear-gradient(135deg, #6366f1 0%, #4338ca 100%);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  padding: 16px 20px;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.25s ease;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
  position: relative;
  overflow: hidden;
}

.btn-launch-pulse:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(99, 102, 241, 0.6);
  background: linear-gradient(135deg, #4f46e5 0%, #3730a3 100%);
}

.btn-launch-pulse:active {
  transform: translateY(0);
}

.dock-footer-notes p {
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.4;
  margin-top: 16px;
  text-align: center;
}

/* ==========================================================================
   BUTTONS & COMMON UI
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border: 1px solid var(--border-subtle);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
}

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

.btn-ghost:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.btn-xs {
  padding: 4px 8px;
  font-size: 11px;
}

.toggle-control {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
}

.toggle-control input {
  accent-color: var(--primary);
}

/* ==========================================================================
   FLEET VIEW
   ========================================================================== */

.fleet-header, .themes-header, .modules-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.fleet-header h2, .themes-header h2, .modules-header h2 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: #fff;
}

.fleet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
}

.fleet-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease;
}

.fleet-card:hover {
  border-color: rgba(99, 102, 241, 0.4);
  transform: translateY(-2px);
}

.fleet-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.fleet-site-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  color: #fff;
}

.fleet-status-pill {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 12px;
}

.fleet-status-pill.running {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.fleet-status-pill.stopped {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-dim);
  border: 1px solid var(--border-subtle);
}

.fleet-meta {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
  flex: 1;
}

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

/* ==========================================================================
   LAUNCH PROGRESS MODAL
   ========================================================================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-dialog {
  background: var(--bg-surface);
  border: 1px solid var(--border-active);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.8);
  overflow: hidden;
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title-group {
  display: flex;
  align-items: center;
  gap: 14px;
}

.modal-icon {
  font-size: 24px;
}

.modal-title-group h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: #fff;
}

.modal-sub {
  font-size: 12px;
  color: var(--text-dim);
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 24px;
  color: var(--text-dim);
  cursor: pointer;
}

.modal-close:hover {
  color: #fff;
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Stepper */
.stepper-list {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}

.step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  position: relative;
}

.step-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-deep);
  border: 1px solid var(--border-subtle);
  color: var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
}

.step-item.active .step-icon {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
  box-shadow: 0 0 12px var(--primary-glow);
}

.step-item.done .step-icon {
  border-color: var(--accent-emerald);
  background: var(--accent-emerald);
  color: #fff;
}

.step-label {
  font-size: 10px;
  color: var(--text-dim);
  line-height: 1.2;
}

.step-item.active .step-label {
  color: #fff;
  font-weight: 600;
}

/* Terminal Card */
.terminal-card {
  background: #05080f;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.terminal-bar {
  background: #090e1a;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.term-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.term-dot.red { background: #ef4444; }
.term-dot.yellow { background: #f59e0b; }
.term-dot.green { background: #10b981; }

.term-title {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-dim);
  margin-left: 6px;
}

.terminal-output {
  padding: 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: #a5b4fc;
  height: 160px;
  overflow-y: auto;
  white-space: pre-wrap;
  line-height: 1.5;
}

/* Success Deck */
.success-banner {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(6, 182, 212, 0.1));
  border: 1px solid rgba(16, 185, 129, 0.4);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.success-icon {
  font-size: 36px;
  margin-right: 16px;
}

.success-text h4 {
  font-family: var(--font-display);
  font-size: 17px;
  color: #fff;
  margin-bottom: 2px;
}

.success-text p {
  font-size: 13px;
  color: var(--text-muted);
}

.success-text a {
  color: var(--accent-cyan);
  font-weight: 600;
  text-decoration: underline;
}

.success-actions {
  display: flex;
  gap: 10px;
}

/* Device Preview Frame */
.device-preview-wrapper {
  background: var(--bg-deep);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 14px;
}

.device-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.device-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.device-switchers {
  display: flex;
  gap: 6px;
}

.btn-device {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
}

.btn-device.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.iframe-container {
  display: flex;
  justify-content: center;
  background: #000;
  border-radius: var(--radius-sm);
  overflow: hidden;
  height: 480px;
}

.iframe-container iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: #fff;
  transition: width 0.3s ease;
}

.qa-results-box {
  background: #05080f;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
}

.qa-results-box h5 {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.qa-code {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #34d399;
  max-height: 140px;
  overflow-y: auto;
  white-space: pre-wrap;
}

/* ==========================================================================
   INDUSTRY STARTER PRESETS
   ========================================================================== */

.industry-presets-bar {
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.08), rgba(6, 182, 212, 0.08));
  border: 1px solid var(--border-active);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.presets-intro {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.preset-label {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.3px;
}

.preset-hint {
  font-size: 11px;
  color: var(--text-dim);
}

.presets-btns {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-preset {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.btn-preset:hover {
  background: rgba(99, 102, 241, 0.15);
  border-color: var(--primary);
  color: #fff;
  transform: translateY(-1px);
}

.btn-preset.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* ==========================================================================
   EYEDROPPER & CANVAS LOUPE
   ========================================================================== */

.palette-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.eyedropper-status {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-deep);
  border: 1px solid var(--border-subtle);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
  font-size: 12px;
  color: var(--text-muted);
}

.loupe-preview {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: var(--primary);
  flex-shrink: 0;
}

.preview-frame {
  cursor: crosshair;
}

/* ==========================================================================
   VISUAL PRODUCT TABLE BUILDER
   ========================================================================== */

.catalog-view-switch {
  display: flex;
  gap: 4px;
  background: var(--bg-deep);
  padding: 3px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.table-actions-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.optimizer-badge {
  font-size: 11px;
  color: var(--accent-emerald);
  background: rgba(16, 185, 129, 0.1);
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid rgba(16, 185, 129, 0.3);
  margin-left: auto;
}

.visual-table-wrap {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-deep);
}

.visual-product-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.visual-product-table th {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  font-weight: 600;
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.visual-product-table td {
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
}

.visual-product-table tr:last-child td {
  border-bottom: none;
}

.table-img-slot {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  border: 1px dashed var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  position: relative;
}

.table-img-slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.table-img-placeholder {
  font-size: 9px;
  color: var(--text-dim);
}

.table-input {
  width: 100%;
  background: transparent !important;
  border: 1px solid transparent !important;
  padding: 6px 8px !important;
  font-size: 12px !important;
  color: #fff !important;
  border-radius: var(--radius-sm);
}

.table-input:hover {
  border-color: rgba(255, 255, 255, 0.1) !important;
}

.table-input:focus {
  border-color: var(--primary) !important;
  background: rgba(0, 0, 0, 0.3) !important;
}

.btn-del-row {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px;
  font-size: 14px;
  border-radius: 4px;
}

.btn-del-row:hover {
  color: var(--accent-rose);
  background: rgba(244, 63, 94, 0.1);
}

/* ==========================================================================
   LIVE WIREFRAME SIMULATOR CARD
   ========================================================================== */

.simulator-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 20px;
  box-shadow: var(--shadow-card);
}

.simulator-header {
  background: #060911;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sim-dots {
  display: flex;
  gap: 5px;
}

.sim-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.sim-dot.red { background: #ef4444; }
.sim-dot.yellow { background: #f59e0b; }
.sim-dot.green { background: #10b981; }

.sim-url {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.04);
  padding: 2px 8px;
  border-radius: 4px;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sim-live-badge {
  font-size: 9px;
  font-weight: 700;
  color: var(--accent-emerald);
  letter-spacing: 0.5px;
}

.sim-frame {
  background: #0a0e17;
  display: flex;
  flex-direction: column;
}

.sim-nav-bar {
  background: #fff;
  color: #0f172a;
  padding: 8px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.3s ease;
}

.sim-brand-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 12px;
  color: #0f172a;
  max-width: 140px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sim-nav-links {
  display: flex;
  gap: 8px;
  font-size: 10px;
  color: #475569;
  font-weight: 500;
}

.sim-hero-banner {
  height: 140px;
  position: relative;
  background-size: cover;
  background-position: center;
  background-color: #111827;
  display: flex;
  align-items: center;
  padding: 16px;
  overflow: hidden;
}

.sim-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0.8) 100%);
  z-index: 1;
}

.sim-hero-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
}

.sim-hero-sub {
  font-size: 8px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #94a3b8;
  font-weight: 700;
}

.sim-hero-content h4 {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}

.sim-hero-content p {
  font-size: 10px;
  color: #cbd5e1;
  line-height: 1.3;
  max-width: 260px;
}

.sim-hero-btn {
  width: fit-content;
  background: var(--primary);
  color: #fff;
  border: none;
  font-size: 10px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 4px;
  margin-top: 4px;
  cursor: default;
  transition: background 0.3s ease;
}

.sim-product-section {
  padding: 12px 14px;
  background: #0f1422;
}

.sim-section-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-dim);
  font-weight: 700;
  display: block;
  margin-bottom: 8px;
}

.sim-product-card {
  background: #141b2d;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  display: flex;
  gap: 10px;
  padding: 8px;
  align-items: center;
}

.sim-product-img-slot {
  width: 48px;
  height: 48px;
  background: #0a0d14;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.sim-product-img-slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sim-img-placeholder {
  font-size: 8px;
  color: var(--text-dim);
}

.sim-product-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sim-badge {
  font-size: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  padding: 1px 4px;
  border-radius: 3px;
  width: fit-content;
}

.sim-product-details strong {
  font-size: 11px;
  color: #fff;
}

.sim-specs {
  font-size: 9px;
  color: var(--text-dim);
}

.sim-card-btn {
  background: var(--primary);
  color: #fff;
  border: none;
  font-size: 9px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 3px;
  width: fit-content;
  margin-top: 2px;
  cursor: default;
}

/* ==========================================================================
   RESPONSIVENESS
   ========================================================================== */

@media (max-width: 1100px) {
  .launcher-layout {
    grid-template-columns: 1fr;
  }
  .launch-dock {
    position: static;
  }
  .analysis-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .form-grid-3, .form-grid-2, .asset-uploads-row {
    grid-template-columns: 1fr;
  }
  .stepper-list {
    grid-template-columns: repeat(4, 1fr);
  }
  .header-left .system-status {
    display: none;
  }
  .header-user-email {
    display: none;
  }
}

/* ==========================================================================
   CLAYPILOT OS AUTHENTICATION & USER PROFILE STYLES
   ========================================================================== */

.auth-gateway-overlay {
  z-index: 99999 !important;
  background: radial-gradient(circle at 50% 20%, rgba(14, 20, 34, 0.98) 0%, rgba(8, 12, 20, 0.99) 100%) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
}

.auth-dialog {
  animation: authDialogEntrance 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes authDialogEntrance {
  from {
    opacity: 0;
    transform: scale(0.94) translateY(12px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.user-pill-btn:hover {
  background: rgba(255, 255, 255, 0.12) !important;
  border-color: rgba(6, 182, 212, 0.5) !important;
  box-shadow: 0 0 15px rgba(6, 182, 212, 0.25);
}

.dropdown-item {
  transition: all 0.15s ease;
}

.dropdown-item:hover {
  background: rgba(255, 255, 255, 0.06) !important;
  color: #fff !important;
  padding-left: 18px !important;
}

.dropdown-item#btn-logout:hover {
  background: rgba(239, 68, 68, 0.15) !important;
  color: #fca5a5 !important;
}

/* Zero-Flicker Pre-flight Auth Gating */
html.is-authenticated #auth-modal {
  display: none !important;
}

html.needs-auth #auth-modal {
  display: flex !important;
}

/* ==========================================================================
   THEME DESIGN SYSTEM STAGE & SHOWCASE
   ========================================================================== */
.theme-stage-container {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 24px;
  align-items: start;
}

@media (max-width: 992px) {
  .theme-stage-container {
    grid-template-columns: 1fr;
  }
}

.theme-stage-preview-frame {
  background: var(--bg-deep);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4);
}

.theme-stage-header-bar {
  padding: 14px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  transition: all 0.3s ease;
}

.theme-stage-brand {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.theme-stage-nav-links {
  display: flex;
  gap: 16px;
  font-size: 12px;
  opacity: 0.85;
}

.theme-stage-hero-banner {
  padding: 32px 24px;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(30, 41, 59, 0.9));
  position: relative;
  overflow: hidden;
}

.theme-stage-hero-sub {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 6px;
  display: inline-block;
}

.theme-stage-hero-title {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 8px;
}

.theme-stage-hero-desc {
  font-size: 13px;
  color: var(--text-muted);
  max-width: 440px;
  margin-bottom: 18px;
  line-height: 1.5;
}

.theme-stage-hero-btn {
  padding: 8px 18px;
  font-size: 12px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.theme-stage-spec-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.theme-stage-spec-card {
  background: var(--bg-deep);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}

.theme-stage-spec-label {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
  display: block;
}

.theme-stage-spec-val {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
}

.theme-palette-swatches-grid {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.theme-palette-chip {
  flex: 1;
  min-width: 75px;
  background: var(--bg-deep);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 6px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.theme-palette-chip:hover {
  transform: translateY(-2px);
  border-color: var(--accent-cyan);
}

.theme-palette-chip-color {
  height: 24px;
  border-radius: 4px;
  margin-bottom: 4px;
}

.theme-palette-chip-code {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
}

.theme-full-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px;
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
  position: relative;
}

.theme-full-card:hover {
  border-color: rgba(6, 182, 212, 0.4);
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
}

.theme-full-card.active-in-stage {
  border-color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.04);
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.2);
}

.theme-preview-mini-header {
  height: 28px;
  border-radius: 4px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  font-size: 10px;
  font-weight: 700;
}

/* ==========================================================================
   MODULE DIRECTORY & ECOSYSTEM
   ========================================================================== */
.mod-cat-btn.active, .bmod-cat-btn.active {
  background: var(--primary) !important;
  color: #fff !important;
  border-color: var(--primary) !important;
}

.mod-full-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease;
  position: relative;
}

.mod-full-card:hover {
  border-color: rgba(99, 102, 241, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.mod-category-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 8px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.mod-route-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-subtle);
  color: #a5b4fc;
  padding: 2px 6px;
  border-radius: 4px;
}

.mod-dep-tag {
  font-size: 11px;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fbbf24;
  padding: 2px 8px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.mod-fleet-pill {
  font-size: 11px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
  padding: 2px 8px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
}

.fleet-mod-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: #e2e8f0;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 11px;
  transition: all 0.15s ease;
}

.fleet-mod-chip:hover {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.4);
  color: #fff;
}

.fleet-theme-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-deep);
  border: 1px solid var(--border-subtle);
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
}
