:root {
  --bg-app: #09090b;
  --bg-surface: #18181b;
  --bg-surface-elevated: #27272a;
  --bg-input: #09090b;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-active: rgba(225, 29, 72, 0.5);
  --text-main: #f4f4f5;
  --text-muted: #a1a1aa;
  --text-dark: #52525b;
  --primary: #e11d48;
  --primary-hover: #be123c;
  --primary-glow: rgba(225, 29, 72, 0.15);
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --font-sans: 'Syne', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --sidebar-w: clamp(280px, 20vw, 340px);
  --output-w: clamp(300px, 25vw, 400px);
  --header-h: 60px;
  --footer-h: 56px;
}

[data-theme="light"] {
  --bg-app: #f4f4f5;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #e4e4e7;
  --bg-input: #f4f4f5;
  --border-subtle: rgba(0, 0, 0, 0.1);
  --border-active: rgba(225, 29, 72, 0.5);
  --text-main: #09090b;
  --text-muted: #71717a;
  --text-dark: #a1a1aa;
  --primary: #e11d48;
  --primary-hover: #be123c;
  --primary-glow: rgba(225, 29, 72, 0.1);
}

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

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-app); }
::-webkit-scrollbar-thumb { background: var(--bg-surface-elevated); border-radius: 4px; border: 1px solid var(--bg-app); }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

html, body {
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  font-family: var(--font-sans);
  background: var(--bg-app);
  color: var(--text-main);
  font-size: 13px;
  line-height: 1.5;
}

#studio-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr var(--output-w);
  grid-template-rows: var(--header-h) 1fr var(--footer-h);
  grid-template-areas:
    "header header header"
    "sidebar main output"
    "footer footer footer";
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

.studio-header {
  grid-area: header;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 50;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.brand-wrapper { display: flex; align-items: center; gap: 12px; }
.brand-icon { width: 32px; height: 32px; background: var(--primary); color: #fff; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 16px; box-shadow: 0 0 15px var(--primary-glow); }
.brand-title { font-size: 17px; font-weight: 700; letter-spacing: -0.5px; }
.brand-version { font-family: var(--font-mono); font-size: 10px; background: var(--primary-glow); color: var(--primary); padding: 3px 8px; border-radius: 20px; border: 1px solid var(--border-active); font-weight: 600; }

.header-status-panel { display: flex; align-items: center; gap: 16px; }
.system-pill { display: flex; align-items: center; gap: 8px; padding: 8px 16px; background: var(--bg-app); border: 1px solid var(--border-subtle); border-radius: 30px; font-family: var(--font-mono); font-weight: 500; font-size: 11px; }
.system-pill .indicator-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-dark); }
.system-pill.idle .indicator-dot { background: var(--warning); }
.system-pill.ready .indicator-dot { background: var(--success); box-shadow: 0 0 8px var(--success); }
.system-pill.rendering .indicator-dot { background: var(--primary); animation: glowPulse 1s infinite alternate; }

@keyframes glowPulse { from { opacity: 0.3; box-shadow: 0 0 0 var(--primary); } to { opacity: 1; box-shadow: 0 0 10px var(--primary); } }

.control-sidebar {
  grid-area: sidebar;
  background: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.control-sidebar::-webkit-scrollbar { width: 6px; }
.control-sidebar::-webkit-scrollbar-thumb { background: var(--bg-surface-elevated); border-radius: 6px; }

.panel-section { border-bottom: 1px solid var(--border-subtle); }
.panel-trigger { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; cursor: pointer; user-select: none; background: var(--bg-surface); transition: var(--transition); }
.panel-trigger:hover { background: var(--bg-surface-elevated); }
.panel-trigger span { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); }
.panel-trigger i.chevron-icon { font-size: 12px; color: var(--text-dark); transition: transform 0.2s; }
.panel-section.collapsed .panel-trigger i.chevron-icon { transform: rotate(-90deg); }
.panel-section.collapsed .panel-body { display: none; }
.panel-body { padding: 4px 20px 20px; display: flex; flex-direction: column; gap: 16px; }

.studio-centerpiece {
  grid-area: main;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: clamp(16px, 3vw, 32px);
  gap: clamp(16px, 3vw, 32px);
  background: var(--bg-app);
  min-width: 0;
  contain: inline-size;
}

.studio-centerpiece::-webkit-scrollbar { width: 8px; }
.studio-centerpiece::-webkit-scrollbar-thumb { background: var(--bg-surface-elevated); border-radius: 8px; }

.workspace-viewport-grid {
  display: flex;
  flex: 1;
  gap: clamp(16px, 3vw, 32px);
  align-items: stretch;
  justify-content: center;
  flex-wrap: nowrap;
  min-height: 350px;
  min-width: 0;
}

.monitor-frame {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0,0,0,0.35);
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.monitor-banner {
  background: var(--bg-app);
  padding: 12px 18px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.display-box-inner {
  background: #000;
  padding: 20px;
  display: flex;
  flex: 1;
  position: relative;
  min-height: 250px;
  min-width: 0;
  overflow: auto;
}

#video-el { width: 100%; max-height: clamp(200px, 30vh, 400px); object-fit: contain; display: block; margin: auto; }
#canvas-oled { display: block; image-rendering: pixelated; box-shadow: 0 0 20px rgba(255,255,255,0.05); margin: auto; }

.drop-interceptor {
  position: absolute;
  inset: 0;
  background: rgba(9, 9, 11, 0.95);
  border: 2px dashed var(--primary);
  margin: 16px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  cursor: pointer;
  z-index: 10;
  transition: var(--transition);
}

.drop-interceptor:hover { background: rgba(9, 9, 11, 0.8); border-color: var(--primary-hover); }
.drop-interceptor.hidden { display: none !important; }
.drop-interceptor i { font-size: 48px; color: var(--primary); }
.drop-interceptor span.title { font-weight: 700; font-size: 18px; color: var(--text-main); }
.drop-interceptor span.subtitle { font-size: 12px; color: var(--text-muted); font-family: var(--font-mono); }

.timeline-master-station {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
  flex-shrink: 0;
  max-width: 100%;
  overflow: hidden;
  box-sizing: border-box;
}

.timeline-slider-rail { position: relative; height: 30px; display: flex; align-items: center; }
.timeline-hardware-track { position: absolute; height: 8px; background: var(--bg-surface-elevated); border-radius: 4px; left: 0; right: 0; }
.timeline-bracket-fill { position: absolute; height: 8px; background: var(--primary); border-radius: 4px; pointer-events: none; }

.range-bracket-slider, .timeline-scrub-input { position: absolute; width: 100%; background: transparent !important; -webkit-appearance: none; -moz-appearance: none; appearance: none; height: 30px; margin: 0; outline: none; }
.range-bracket-slider { z-index: 2; pointer-events: none; }
.timeline-scrub-input { z-index: 3; pointer-events: none; }

.range-bracket-slider::-webkit-slider-thumb { -webkit-appearance: none; pointer-events: auto; width: 14px; height: 20px; border-radius: 4px; background: var(--text-muted); cursor: ew-resize; border: 2px solid var(--bg-surface); box-shadow: 0 0 5px rgba(0,0,0,0.5); }
.timeline-scrub-input::-webkit-slider-thumb { -webkit-appearance: none; pointer-events: auto; width: 14px; height: 24px; background: var(--primary); box-shadow: 0 2px 6px var(--primary-glow); cursor: ew-resize; border-radius: 7px; border: 2px solid var(--bg-surface); transition: transform 0.1s; }
.timeline-scrub-input::-webkit-slider-thumb:hover { transform: scale(1.1); }

.range-bracket-slider::-moz-range-thumb { pointer-events: auto; width: 14px; height: 20px; border-radius: 4px; background: var(--text-muted); cursor: ew-resize; border: 2px solid var(--bg-surface); box-shadow: 0 0 5px rgba(0,0,0,0.5); box-sizing: border-box; }
.timeline-scrub-input::-moz-range-thumb { pointer-events: auto; width: 14px; height: 24px; background: var(--primary); box-shadow: 0 2px 6px var(--primary-glow); cursor: ew-resize; border-radius: 7px; border: 2px solid var(--bg-surface); transition: transform 0.1s; box-sizing: border-box; }
.timeline-scrub-input::-moz-range-thumb:hover { transform: scale(1.1); }

.range-bracket-slider::-moz-range-track, .timeline-scrub-input::-moz-range-track { background: transparent; border: none; }
.range-bracket-slider::-moz-range-progress, .timeline-scrub-input::-moz-range-progress { background: transparent; border: none; }

.playback-dashboard { display: flex; align-items: center; justify-content: space-between; }
.media-btn-deck { display: flex; align-items: center; gap: 8px; }

.output-sidebar {
  grid-area: output;
  background: var(--bg-surface);
  border-left: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.output-tabs-header { display: flex; background: var(--bg-app); border-bottom: 1px solid var(--border-subtle); }
.output-tab-trigger { flex: 1; padding: 14px 4px; background: transparent; border: none; color: var(--text-muted); font-family: var(--font-sans); font-weight: 600; font-size: 11px; cursor: pointer; border-bottom: 2px solid transparent; transition: var(--transition); display: flex; align-items: center; justify-content: center; gap: 6px; }
.output-tab-trigger.active { color: var(--primary); border-bottom-color: var(--primary); background: var(--bg-surface); }
.output-tab-trigger:hover:not(.active) { color: var(--text-main); background: var(--bg-surface-elevated); }

.output-pane-view { display: none; flex: 1; flex-direction: column; overflow: hidden; }
.output-pane-view.active { display: flex; }

.code-terminal-wrapper { display: flex; flex-direction: column; flex: 1; overflow: hidden; }
.terminal-header { padding: 12px 20px; background: var(--bg-app); border-bottom: 1px solid var(--border-subtle); display: flex; align-items: center; justify-content: space-between; }
.terminal-codearea { flex: 1; background: var(--bg-input); color: var(--primary); font-family: var(--font-mono); font-size: 11.5px; line-height: 1.6; padding: 20px; border: none; resize: none; outline: none; overflow-y: auto; }
.terminal-codearea::-webkit-scrollbar { width: 6px; }
.terminal-codearea::-webkit-scrollbar-thumb { background: var(--bg-surface-elevated); border-radius: 6px; }

.input-element-row { display: flex; flex-direction: column; gap: 8px; }
.element-label { font-size: 12px; font-weight: 600; color: var(--text-muted); display: flex; justify-content: space-between; align-items: center; }
.element-label .dynamic-readout { font-family: var(--font-mono); color: var(--primary); background: var(--primary-glow); padding: 2px 8px; border-radius: 4px; font-size: 11px; }

select, input[type="text"], input[type="number"], input[type="password"] { width: 100%; padding: 10px 14px; background: var(--bg-input); color: var(--text-main); border: 1px solid var(--border-subtle); border-radius: 8px; font-family: inherit; font-size: 13px; outline: none; transition: var(--transition); }
select:focus, input[type="text"]:focus, input[type="password"]:focus { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-glow); }

input[type="range"].standard-range { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; background: var(--bg-surface-elevated); border-radius: 3px; outline: none; }
input[type="range"].standard-range::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 16px; height: 16px; border-radius: 50%; background: var(--primary); cursor: pointer; transition: transform 0.1s ease; border: 2px solid var(--bg-surface); box-shadow: 0 2px 4px rgba(0,0,0,0.5); }
input[type="range"].standard-range::-webkit-slider-thumb:hover { transform: scale(1.2); }
input[type="range"].standard-range::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: var(--primary); cursor: pointer; transition: transform 0.1s ease; border: 2px solid var(--bg-surface); box-shadow: 0 2px 4px rgba(0,0,0,0.5); box-sizing: border-box; }
input[type="range"].standard-range::-moz-range-thumb:hover { transform: scale(1.2); }

.switch-wrapper { display: flex; align-items: center; justify-content: space-between; padding: 4px 0; }
.switch-label-group { display: flex; align-items: center; gap: 10px; color: var(--text-muted); font-size: 12px; font-weight: 600; }

.master-toggle { position: relative; width: 40px; height: 22px; cursor: pointer; }
.master-toggle input { display: none; }
.toggle-slide-track { position: absolute; inset: 0; background: var(--bg-surface-elevated); border-radius: 20px; transition: var(--transition); border: 1px solid var(--border-subtle); }
.master-toggle input:checked ~ .toggle-slide-track { background: var(--primary); border-color: var(--primary); }
.toggle-bead { position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; background: #fff; border-radius: 50%; transition: var(--transition); box-shadow: 0 2px 4px rgba(0,0,0,0.2); }
.master-toggle input:checked ~ .toggle-bead { left: 21px; }

.action-chip-matrix { display: flex; gap: 8px; flex-wrap: wrap; }
.action-chip { padding: 6px 12px; background: var(--bg-input); border: 1px solid var(--border-subtle); color: var(--text-muted); font-family: var(--font-mono); font-size: 12px; font-weight: 500; border-radius: 6px; cursor: pointer; transition: var(--transition); }
.action-chip:hover { background: var(--bg-surface-elevated); color: var(--text-main); }
.action-chip.active { background: var(--primary); border-color: var(--primary-hover); color: #fff; }

.btn-prime { background: var(--primary); color: #fff; border: none; padding: 12px 20px; font-size: 13px; font-weight: 700; font-family: var(--font-sans); border-radius: 8px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 10px; transition: var(--transition); width: 100%; }
.btn-prime:hover { background: var(--primary-hover); box-shadow: 0 4px 12px var(--primary-glow); }
.btn-prime:disabled { opacity: 0.5; cursor: not-allowed; background: var(--bg-surface-elevated); color: var(--text-muted); box-shadow: none; }

.btn-utility { background: var(--bg-surface-elevated); color: var(--text-main); border: 1px solid var(--border-subtle); padding: 8px 14px; font-size: 12px; font-weight: 600; border-radius: 8px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: var(--transition); }
.btn-utility:hover { background: var(--bg-input); border-color: var(--primary); color: var(--primary); }

.btn-reset { background: none; border: none; cursor: pointer; color: var(--text-muted); padding: 2px 5px; font-size: 11px; transition: color 0.2s; display: flex; align-items: center; }
.btn-reset:hover { color: var(--primary); }

.interactive-matrix-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px dashed var(--border-subtle); font-size: 12px; }
.interactive-matrix-row:last-child { border-bottom: none; }
.interactive-matrix-row .matrix-key { color: var(--text-muted); font-weight: 500; }
.interactive-matrix-row .matrix-value { font-family: var(--font-mono); color: var(--primary); font-weight: 600; }

#action-bar {
  grid-area: footer;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  z-index: 50;
  box-shadow: 0 -4px 12px rgba(0,0,0,0.05);
}

#toast-system-sentinel { position: fixed; bottom: 80px; right: 24px; z-index: 1000; display: flex; flex-direction: column; gap: 12px; }
.toast-bubble { background: var(--bg-surface); border: 1px solid var(--border-subtle); padding: 14px 20px; border-radius: 8px; font-size: 13px; font-weight: 600; box-shadow: 0 10px 30px rgba(0,0,0,0.4); display: flex; align-items: center; gap: 12px; transform: translateY(20px); opacity: 0; animation: slideUpIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; }
.toast-bubble.success { border-left: 4px solid var(--success); }
.toast-bubble.error { border-left: 4px solid var(--danger); }
.toast-bubble.info { border-left: 4px solid var(--primary); }
.toast-bubble i { font-size: 16px; }
.toast-bubble.success i { color: var(--success); }
.toast-bubble.error i { color: var(--danger); }
.toast-bubble.info i { color: var(--primary); }
@keyframes slideUpIn { to { transform: translateY(0); opacity: 1; } }

.deployment-card { background: var(--bg-app); border: 1px solid var(--border-subtle); padding: 20px; border-radius: 12px; display: flex; flex-direction: column; gap: 12px; }
.deployment-card h4 { font-size: 13px; font-weight: 700; color: var(--text-main); display: flex; align-items: center; gap: 8px; }
.deploy-meter-track { background: var(--bg-surface-elevated); height: 8px; border-radius: 4px; overflow: hidden; margin-top: 4px; display: none; }
.deploy-meter-fill { background: var(--success); width: 0%; height: 100%; transition: width 0.1s linear; }

.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.8); backdrop-filter: blur(4px); z-index: 9999; display: none; align-items: center; justify-content: center; }
.modal-overlay.active { display: flex; }
.modal-content { background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: 12px; padding: 24px; width: 90%; max-width: 400px; display: flex; flex-direction: column; gap: 16px; }

@media (max-width: 1200px) {
  #studio-shell {
    grid-template-columns: 1fr;
    grid-template-rows: var(--header-h) auto auto auto var(--footer-h);
    grid-template-areas:
      "header"
      "main"
      "sidebar"
      "output"
      "footer";
    overflow-y: auto;
  }
  .control-sidebar { border-right: none; border-bottom: 1px solid var(--border-subtle); }
  .output-sidebar { border-left: none; border-top: 1px solid var(--border-subtle); min-height: 500px; }
  .studio-centerpiece { min-height: 600px; }
}

@media (max-width: 768px) {
  .desktop-only { display: none !important; }
  .studio-centerpiece { padding: 12px; gap: 12px; }
  .workspace-viewport-grid { gap: 12px; }
} 
 
/* ==========================================================================
   CINEMATIC BOOT INTRO
   ========================================================================== */
#cinematic-boot-intro {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: #050505;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  transition: transform 0.8s cubic-bezier(0.85, 0, 0.15, 1), opacity 0.8s ease;
  overflow: hidden;
}

#cinematic-boot-intro.slide-up {
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
}

.boot-terminal-log {
  position: absolute;
  top: 20px;
  left: 20px;
  color: var(--primary);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.5;
  opacity: 0.7;
  text-shadow: 0 0 5px var(--primary-glow);
  pointer-events: none;
}

.boot-logo-lockup {
  text-align: center;
  opacity: 1;
  transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  transform: scale(1);
}

.boot-logo-lockup.hidden {
  opacity: 0;
  transform: scale(0.9);
}

.boot-logo-glitch {
  font-size: 4rem;
  font-weight: 800;
  font-family: var(--font-sans);
  color: #fff;
  letter-spacing: 4px;
  position: relative;
  text-shadow: 0 0 20px var(--primary-glow), 0 0 40px #f43f5e;
}

.boot-subtitle {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text-muted);
  letter-spacing: 2px;
  margin-top: 10px;
  text-transform: uppercase;
}

/* Dashboard Staggered Entrance */
.app-preload-hidden .control-sidebar,
.app-preload-hidden .studio-centerpiece,
.app-preload-hidden .output-sidebar {
  opacity: 0;
  transform: translateY(20px);
}

#studio-shell.intro-finished .control-sidebar { animation: staggerFadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards 0.1s; }
#studio-shell.intro-finished .studio-centerpiece { animation: staggerFadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards 0.2s; }
#studio-shell.intro-finished .output-sidebar { animation: staggerFadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards 0.3s; }

@keyframes staggerFadeUp {
  0% { opacity: 0; transform: translateY(20px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   SEO KNOWLEDGE BASE
   ========================================================================== */
.seo-knowledge-base {
  background: var(--bg-surface-elevated);
  border-top: 1px solid var(--border-subtle);
  padding: 60px 20px;
  color: var(--text-muted);
  font-family: var(--font-sans);
}

.seo-kb-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.seo-knowledge-base h2 {
  color: var(--text-primary);
  font-size: 1.5rem;
  margin-bottom: 16px;
  font-weight: 700;
}

.seo-knowledge-base p {
  line-height: 1.6;
  margin-bottom: 30px;
  max-width: 800px;
}

.seo-features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin-bottom: 40px;
}

.seo-feature-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 24px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.seo-feature-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.seo-feature-card h3 {
  color: var(--text-primary);
  font-size: 1.1rem;
  margin-bottom: 12px;
  font-family: var(--font-mono);
}

.seo-feature-card p {
  font-size: 0.9rem;
  margin-bottom: 0;
}

.seo-credits {
  border-top: 1px solid var(--border-subtle);
  padding-top: 20px;
  font-size: 0.85rem;
  text-align: center;
}

.seo-credits a {
  color: var(--primary);
  text-decoration: none;
  transition: text-shadow 0.2s ease;
}

.seo-credits a:hover {
  text-shadow: 0 0 8px var(--primary-glow);
}

/* ==========================================================================
   CUSTOM MODERN SELECT DROPDOWNS
   ========================================================================== */
.custom-select-wrapper { position: relative; width: 100%; user-select: none; }
.custom-select-wrapper select { display: none; }
.custom-select-trigger { 
  display: flex; align-items: center; justify-content: space-between; 
  width: 100%; padding: 10px 14px; background: var(--bg-input); 
  border: 1px solid var(--border-subtle); border-radius: 8px; 
  font-size: 13px; color: var(--text-main); cursor: pointer; 
  transition: var(--transition); 
}
.custom-select-trigger:hover, .custom-select-wrapper.open .custom-select-trigger { 
  border-color: var(--primary); 
  box-shadow: 0 0 0 2px var(--primary-glow); 
}
.custom-select-trigger i { font-size: 10px; color: var(--text-muted); transition: transform 0.2s; }
.custom-select-wrapper.open .custom-select-trigger i { transform: rotate(180deg); }
.custom-select-dropdown { 
  position: absolute; top: calc(100% + 4px); left: 0; width: 100%; 
  background: var(--bg-surface-elevated); border: 1px solid var(--border-subtle); 
  border-radius: 8px; overflow: hidden; z-index: 100; 
  box-shadow: 0 8px 24px rgba(0,0,0,0.5); 
  opacity: 0; visibility: hidden; transform: translateY(-10px); 
  transition: opacity 0.2s, transform 0.2s, visibility 0.2s; 
}
.custom-select-wrapper.open .custom-select-dropdown { 
  opacity: 1; visibility: visible; transform: translateY(0); 
}
.custom-select-option { 
  padding: 10px 14px; font-size: 13px; color: var(--text-muted); 
  cursor: pointer; transition: background 0.1s, color 0.1s; 
}
.custom-select-option:hover { 
  background: var(--bg-surface); color: var(--text-main); 
}
.custom-select-option.selected { 
  color: var(--primary); font-weight: 600; background: var(--bg-surface); 
}

/* Improved Modern Toggle */
.master-toggle input:checked ~ .toggle-slide-track { 
  background: var(--primary); 
  border-color: var(--primary); 
  box-shadow: 0 0 10px var(--primary-glow);
}

/* Custom Modern Checkbox */
.custom-checkbox-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}
.custom-checkbox-wrapper input {
  display: none;
}
.custom-checkbox-box {
  width: 18px;
  height: 18px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.custom-checkbox-box i {
  font-size: 11px;
  color: transparent;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.2s;
  transform: scale(0);
}
.custom-checkbox-wrapper:hover .custom-checkbox-box {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.1);
}
.custom-checkbox-wrapper input:checked + .custom-checkbox-box {
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 0 8px var(--primary-glow);
}
.custom-checkbox-wrapper input:checked + .custom-checkbox-box i {
  color: #fff;
  transform: scale(1);
}


/* Shimmer Credit Effect */
.shimmer-credit {
  background: linear-gradient(
    110deg,
    var(--primary) 0%,
    var(--primary) 40%,
    #fff 50%,
    var(--primary) 60%,
    var(--primary) 100%
  );
  background-size: 200% auto;
  color: transparent;
  -webkit-background-clip: text;
  background-clip: text;
  animation: shine 4s linear infinite;
  text-decoration: none;
  font-weight: 700;
  display: inline-block;
  transition: text-shadow 0.3s ease;
}
.shimmer-credit:hover {
  text-shadow: 0 0 10px var(--primary-glow);
}

@keyframes shine {
  to {
    background-position: 200% center;
  }
}


/* Brand Credit Pill */
.brand-credit-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 12px;
  padding: 4px 12px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  transition: border-color 0.3s ease, background 0.3s ease;
}
.brand-credit-pill:hover {
  border-color: rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.05);
}
.credit-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  font-weight: 600;
  font-family: var(--font-sans);
}


/* ==========================================================================
   PREMIUM BOOT INTRO
   ========================================================================== */
#intro{
    position:fixed;
    inset:0;
    display:flex;
    justify-content:center;
    align-items:center;
    background:
    radial-gradient(circle at center,
    rgba(255,35,87,0.15) 0%,
    rgba(0,0,0,0) 55%),
    var(--bg-app);
    z-index: 9999;
}
.intro-content{ text-align:center; }
.intro-logo-wrapper{ position:relative; width:180px; height:180px; margin:auto; }
.intro-pixel-grid{
    position:absolute; inset:0; display:grid;
    grid-template-columns:repeat(8,1fr);
    grid-template-rows:repeat(8,1fr);
    gap:4px; padding:38px;
    animation:introGridFade 0.8s ease forwards;
}
.intro-pixel{
    width:100%; height:100%;
    background:#ff2357;
    border-radius:4px;
    transform:scale(0); opacity:0;
    animation:introPixelBuild .45s forwards;
}
.intro-logo{
    position:absolute; inset:0; opacity:0; transform:scale(.92);
    animation:introLogoReveal .8s ease forwards;
    animation-delay:1s;
}
.intro-logo-bg { position: relative; width: 180px; height: 180px; }




.intro-text{ margin-top:40px; opacity:0; animation:introTextReveal .8s ease forwards; animation-delay:1.7s; }
.intro-title{ color:var(--text-main); font-size:42px; font-weight:700; letter-spacing:-1px; }
.intro-subtitle{ margin-top:10px; color:var(--text-muted); font-size:13px; letter-spacing:2px; text-transform:uppercase; font-family:var(--font-mono); }
.intro-line{width:0; height:2px; margin:24px auto 0; background:#ff2357; box-shadow:0 0 20px rgba(255,35,87,0.4); animation:introLineGrow .7s ease forwards; animation-delay:2s;}
.intro-skip{
    position:fixed; bottom:40px; left:50%; transform:translateX(-50%);
    color:var(--text-muted); font-size:12px; letter-spacing:2px; text-transform:uppercase;
    opacity:0; animation:introTextReveal .8s ease forwards; animation-delay:2.2s;
}

@keyframes introPixelBuild{ from{opacity:0;transform:scale(.2);} to{opacity:1;transform:scale(1);} }
@keyframes introGridFade{ 0%,70%{opacity:1;} 100%{opacity:0;} }
@keyframes introLogoReveal{ from{opacity:0;transform:scale(.85);} to{opacity:1;transform:scale(1);} }
@keyframes introTextReveal{ from{opacity:0;transform:translateY(10px);} to{opacity:1;transform:translateY(0);} }
@keyframes introLineGrow{ from{width:0;} to{width:220px;} }
@keyframes introSweep{ from{left:-120%;} to{left:160%;} }


/* ==========================================================================
   PREMIUM BOOT INTRO
   ========================================================================== */
#intro{
    position:fixed;
    inset:0;
    display:flex;
    justify-content:center;
    align-items:center;
    background:
    radial-gradient(circle at center,
    rgba(255,35,87,0.1) 0%,
    rgba(0,0,0,0) 60%),
    var(--bg-app);
    z-index: 9999;
}
.intro-content{ text-align:center; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.intro-logo-wrapper{ position:relative; width:160px; height:160px; margin:0 auto 10px auto; }
.intro-logo-img{
    width:100%; height:100%;
    object-fit:contain;
    opacity:0; transform:scale(.85);
    animation:introLogoReveal .8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    animation-delay:0.2s;
    filter: drop-shadow(0 10px 30px rgba(255,35,87,0.4));
}
.intro-text{ margin-top:20px; opacity:0; animation:introTextReveal .8s cubic-bezier(0.16, 1, 0.3, 1) forwards; animation-delay:0.8s; }
.intro-title{ color:var(--text-main); font-size:42px; font-weight:700; letter-spacing:-1px; }
.intro-subtitle{ margin-top:10px; color:var(--text-muted); font-size:13px; letter-spacing:2px; text-transform:uppercase; font-family:var(--font-mono); }
.intro-line{
    width:0; height:2px; margin:24px auto 0;
    background:#ff2357; box-shadow:0 0 20px rgba(255,35,87,0.4);
    animation:introLineGrow .7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    animation-delay:1.1s;
}
.intro-credit{
    margin-top: 24px;
    color: var(--text-muted);
    font-size: 11px;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-weight: 600;
    opacity: 0;
    animation: introTextReveal .8s ease forwards;
    animation-delay: 1.5s;
}

@keyframes introLogoReveal{ from{opacity:0;transform:scale(.85);} to{opacity:1;transform:scale(1);} }
@keyframes introTextReveal{ from{opacity:0;transform:translateY(10px);} to{opacity:1;transform:translateY(0);} }
@keyframes introLineGrow{ from{width:0;} to{width:220px;} }

/* Theme Toggle */
.theme-toggle { background: transparent; border: none; color: var(--text-muted); font-size: 18px; cursor: pointer; padding: 8px; border-radius: 50%; transition: var(--transition); display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; }
.theme-toggle:hover { color: var(--primary); background: var(--bg-surface-elevated); }
.theme-toggle i { transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease; }
.theme-toggle.light-mode i { transform: rotate(180deg); }


/* ==========================================
   RESTORED UI STYLES
   ========================================== */

/* Brand Credit Pill & Shimmer */
.brand-credit-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    margin-left: 15px;
    vertical-align: middle;
}
.credit-label {
    font-size: 9px;
    color: var(--text-muted);
    letter-spacing: 1px;
    font-weight: 600;
}
.shimmer-credit {
    font-size: 11px;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    background: linear-gradient(90deg, var(--primary) 0%, #ff7eb3 50%, var(--primary) 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: textShimmer 3s linear infinite;
    transition: var(--transition);
}
.shimmer-credit:hover {
    filter: drop-shadow(0 0 8px var(--primary-glow));
}
@keyframes textShimmer {
    to { background-position: 200% center; }
}

/* Custom Select Dropdowns */
.custom-select-wrapper {
    position: relative;
    width: 100%;
    user-select: none;
}
.custom-select-trigger {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
    height: 44px;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    color: var(--text-main);
    font-family: var(--font-sans);
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
}
.custom-select-wrapper.open .custom-select-trigger {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-glow);
}
.custom-options {
    position: absolute;
    display: block;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-10px);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 100;
    overflow: hidden;
}
.custom-select-wrapper.open .custom-options {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
    transform: translateY(0);
}
.custom-option {
    padding: 12px 16px;
    font-size: 14px;
    color: var(--text-muted);
    cursor: pointer;
    transition: background 0.1s;
}
.custom-option:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}
.custom-option.selected {
    color: var(--primary);
    background: rgba(225, 29, 72, 0.1);
    font-weight: 500;
}



.legal-links a:hover { color: var(--primary) !important; text-decoration: underline !important; }


.glass-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(8px); z-index: 9999; display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity 0.3s ease; }
.glass-overlay.active { opacity: 1; pointer-events: auto; }
.glass-modal { background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: 16px; padding: 32px; max-width: 480px; width: 90%; box-shadow: 0 20px 50px rgba(0,0,0,0.5); transform: translateY(20px); transition: transform 0.3s ease; text-align: center; position: relative; }
.glass-overlay.active .glass-modal { transform: translateY(0); }
.glass-modal .modal-icon { font-size: 48px; color: var(--primary); margin-bottom: 20px; text-shadow: 0 0 20px var(--primary-glow); }
.glass-modal h2 { color: var(--text-main); margin-bottom: 16px; font-family: var(--font-display); }
.glass-modal p { color: var(--text-muted); font-size: 14px; line-height: 1.6; margin-bottom: 16px; }
.glass-modal strong { color: var(--text-main); }
.modal-actions { display: flex; gap: 12px; margin-top: 24px; justify-content: center; }
.docs-modal-content { max-width: 700px; text-align: left; max-height: 80vh; display: flex; flex-direction: column; }
.docs-modal-content h2 { margin-bottom: 24px; }
.docs-body { overflow-y: auto; padding-right: 12px; text-align: left; }
.docs-body h2 { font-size: 18px; margin-top: 24px; margin-bottom: 12px; }
.docs-body p { margin-bottom: 12px; }
.close-btn { position: absolute; top: 24px; right: 24px; background: none; border: none; color: var(--text-muted); font-size: 20px; cursor: pointer; transition: 0.3s; }
.close-btn:hover { color: var(--danger); }

.reading-highlight-box { background: rgba(244, 63, 94, 0.1); border-left: 3px solid var(--primary); padding: 12px; border-radius: 4px; margin-bottom: 16px; text-align: left; }
.reading-effect-text { font-size: 15px; line-height: 1.6; background: linear-gradient(90deg, var(--text-muted) 0%, var(--primary) 20%, #fff 50%, var(--primary) 80%, var(--text-muted) 100%); background-size: 200% auto; -webkit-background-clip: text; -webkit-text-fill-color: transparent; animation: readingShine 3s linear infinite; margin-bottom: 0 !important; font-weight: 600; }
@keyframes readingShine { to { background-position: 200% center; } }

.active-glow { background: rgba(244, 63, 94, 0.1) !important; color: var(--primary) !important; border: 1px solid var(--primary) !important; box-shadow: 0 0 15px var(--primary-glow) !important; }

/* ==========================================================================
   CIRCUIT DIAGRAM MODAL
   ========================================================================== */
.circuit-diagram-modal-content {
  max-width: 1100px;
  width: 95vw;
  max-height: 95vh;
  padding: 28px;
  display: flex;
  flex-direction: column;
  text-align: left;
}
.circuit-diagram-body {
  flex: 1;
  overflow-y: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  min-height: 300px;
}
.circuit-diagram-img {
  max-width: 100%;
  max-height: 78vh;
  object-fit: contain;
  display: block;
}
