@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=IBM+Plex+Mono:wght@300;400;500&display=swap');

:root {
  --bg-deep: #05050a;
  --surface-bg: rgba(255,255,255,0.045);
  --surface-bg-strong: rgba(255,255,255,0.07);
  --surface-border: rgba(255,255,255,0.09);
  --surface-border-soft: rgba(255,255,255,0.05);
  --text-primary: #f3f3f7;
  --text-dim: rgba(243,243,247,0.56);
  --text-faint: rgba(243,243,247,0.34);
  --accent: #6ea8ff;
  --accent-soft: #9fc4ff;
  --font-display: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', 'SF Mono', Menlo, monospace;
  --blur: 8px;
  --gap: 12px;
  --radius: 6px;
  --atmosphere-hue: 210;
  --atmosphere-hue2: 250;
  --atmosphere-glow: 0.25;
  --atmosphere-sat: 80%;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  background: var(--bg-deep); color: var(--text-primary);
  font-family: var(--font-display); font-feature-settings: 'tnum';
  -webkit-font-smoothing: antialiased; overflow: hidden;
  height: 100vh; width: 100vw;
}

/* ===================== ATMOSPHERE ===================== */
#atmosphere {
  position: fixed; inset: 0; z-index: 0;
  background:
    radial-gradient(circle at 22% 18%, hsla(var(--atmosphere-hue), var(--atmosphere-sat), 58%, var(--atmosphere-glow)) 0%, transparent 52%),
    radial-gradient(circle at 80% 76%, hsla(var(--atmosphere-hue2), 70%, 52%, calc(var(--atmosphere-glow) * 0.75)) 0%, transparent 58%),
    radial-gradient(circle at 50% 100%, hsla(var(--atmosphere-hue), 60%, 40%, calc(var(--atmosphere-glow) * 0.3)) 0%, transparent 65%),
    var(--bg-deep);
  transition: background 1.8s ease;
}
#atmosphere::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 50%, transparent 40%, rgba(0,0,0,0.45) 100%);
  pointer-events: none;
}
#cosmic-backdrop {
  position: fixed; inset: 0; z-index: 0;
  background-image: url('https://images.pexels.com/photos/207529/pexels-photo-207529.jpeg?auto=compress&cs=tinysrgb&w=1600');
  background-size: cover; background-position: center;
  opacity: 0; transition: opacity 2.2s ease; pointer-events: none;
}
#cosmic-backdrop.visible { opacity: 0.22; }
.particle {
  position: fixed; border-radius: 50%;
  background: hsla(var(--atmosphere-hue), 90%, 72%, 0.5);
  pointer-events: none; z-index: 1; filter: blur(1px);
  transition: background 1.8s ease;
}

/* ===================== HISTORY RAIL ===================== */
#history-rail {
  position: fixed; left: 0; top: 0; bottom: 0; width: 52px; z-index: 8;
  display: flex; flex-direction: column; align-items: center;
  padding: 16px 0 120px;
  gap: 4px;
  overflow-y: auto; overflow-x: hidden;
  scrollbar-width: none;
  transition: width 0.5s cubic-bezier(.22,.61,.36,1), background 0.4s ease;
}
#history-rail::-webkit-scrollbar { display: none; }
#history-rail:hover, #history-rail.expanded {
  width: 220px;
  background: rgba(8,8,14,0.6);
  backdrop-filter: blur(20px);
}
.history-label {
  font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--text-faint); margin: 12px 0 8px;
  white-space: nowrap; opacity: 0;
  transition: opacity 0.3s ease;
}
#history-rail:hover .history-label, #history-rail.expanded .history-label { opacity: 1; }
.history-item {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  background: var(--surface-bg); border: 1px solid var(--surface-border-soft);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; position: relative;
  transition: all 0.4s cubic-bezier(.22,.61,.36,1);
}
.history-item:hover { background: var(--surface-bg-strong); border-color: var(--accent); transform: scale(1.1); }
.history-dot {
  width: 8px; height: 8px; border-radius: 50%;
  transition: background 0.3s ease, box-shadow 0.3s ease;
}
.history-item-text {
  position: absolute; left: 48px; top: 50%; transform: translateY(-50%);
  font-size: 12px; color: var(--text-dim); white-space: nowrap;
  max-width: 150px; overflow: hidden; text-overflow: ellipsis;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s ease;
}
#history-rail:hover .history-item-text, #history-rail.expanded .history-item-text { opacity: 1; pointer-events: auto; }

/* ===================== STAGE ===================== */
#stage {
  position: fixed; top: 0; right: 0; bottom: 0; left: 52px; z-index: 2;
  display: flex; flex-wrap: wrap;
  align-content: flex-start; align-items: flex-start;
  padding: 32px 32px 200px;
  gap: var(--gap);
  overflow-y: auto; overflow-x: hidden;
  scrollbar-width: thin; scrollbar-color: var(--surface-border) transparent;
  transition: gap 1.4s cubic-bezier(.22,.61,.36,1), padding 1.4s cubic-bezier(.22,.61,.36,1), left 0.5s cubic-bezier(.22,.61,.36,1);
}
#stage.layout-radial { display: block; }
#stage.layout-radial .panel {
  position: absolute;
  transition: border-radius 1.4s cubic-bezier(.22,.61,.36,1), width 1.4s cubic-bezier(.22,.61,.36,1), height 1.4s cubic-bezier(.22,.61,.36,1), left 1.6s cubic-bezier(.22,.61,.36,1), top 1.6s cubic-bezier(.22,.61,.36,1), transform 1.4s cubic-bezier(.22,.61,.36,1), opacity 0.9s ease;
}
#stage.layout-scatter { display: block; }
#stage.layout-scatter .panel {
  position: absolute;
  transition: border-radius 1.6s cubic-bezier(.22,.61,.36,1), width 1.4s cubic-bezier(.22,.61,.36,1), height 1.4s cubic-bezier(.22,.61,.36,1), left 1.8s cubic-bezier(.22,.61,.36,1), top 1.8s cubic-bezier(.22,.61,.36,1), transform 1.4s cubic-bezier(.22,.61,.36,1), opacity 1s ease;
}
#stage.layout-video-wall {
  display: flex; flex-direction: column; flex-wrap: nowrap;
  align-items: center; justify-content: flex-start;
  gap: 20px; padding: 48px 48px 180px; overflow: visible;
}

/* ===================== PANEL ===================== */
.panel {
  position: relative;
  background: linear-gradient(155deg, rgba(255,255,255,0.05), rgba(255,255,255,0.015) 40%, rgba(255,255,255,0.03) 100%), var(--surface-bg);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius);
  backdrop-filter: blur(var(--blur)) saturate(1.1);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(1.1);
  padding: 26px 28px;
  box-shadow: 0 1px 0 rgba(255,255,255,0.06) inset, 0 24px 60px -12px rgba(0,0,0,0.55), 0 0 0 1px rgba(0,0,0,0.2), 0 0 32px -8px hsla(var(--atmosphere-hue), 70%, 60%, 0.18);
  transition: border-radius 1.4s cubic-bezier(.22,.61,.36,1), padding 1.4s cubic-bezier(.22,.61,.36,1), width 1.4s cubic-bezier(.22,.61,.36,1), height 1.4s cubic-bezier(.22,.61,.36,1), transform 0.6s cubic-bezier(.22,.61,.36,1), opacity 0.9s ease, box-shadow 0.5s ease, flex-basis 1.4s cubic-bezier(.22,.61,.36,1);
  animation: breathe 6s ease-in-out infinite;
  will-change: transform, opacity;
  cursor: pointer;
}
.panel::before {
  content: ''; position: absolute; top: 0; left: 18px; right: 18px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.22), transparent);
  pointer-events: none;
}
.panel:hover {
  border-color: hsla(var(--atmosphere-hue), 70%, 65%, 0.35);
  box-shadow: 0 1px 0 rgba(255,255,255,0.06) inset, 0 24px 60px -12px rgba(0,0,0,0.55), 0 0 0 1px rgba(0,0,0,0.2), 0 0 48px -8px hsla(var(--atmosphere-hue), 70%, 60%, 0.3);
}

@keyframes breathe {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-2px) scale(1.003); }
}
.panel.exiting { opacity: 0; transform: scale(0.92) translateY(8px); pointer-events: none; }
.panel.entering { animation: enter-pop 0.9s cubic-bezier(.22,.61,.36,1) both, breathe 6s ease-in-out infinite 0.9s; }
@keyframes enter-pop {
  0% { opacity: 0; transform: scale(0.9) translateY(14px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

/* ---- Panel expand (drill-down) ---- */
.panel.expanded {
  position: fixed !important;
  top: 24px !important; left: 76px !important;
  right: 24px !important; bottom: 140px !important;
  width: auto !important; height: auto !important;
  z-index: 20;
  animation: none;
  transform: none !important;
  overflow-y: auto;
  cursor: default;
}
.panel.expanded .panel-expand-content { display: block; }
.panel-expand-content { display: none; margin-top: 20px; }
.panel-expand-close {
  position: absolute; top: 14px; right: 14px;
  background: rgba(255,255,255,0.08); border: 1px solid var(--surface-border);
  color: var(--text-dim); width: 32px; height: 32px; border-radius: 50%;
  display: none; align-items: center; justify-content: center;
  cursor: pointer; font-size: 16px; transition: all 0.3s ease; z-index: 2;
}
.panel.expanded .panel-expand-close { display: flex; }
.panel-expand-close:hover { background: rgba(255,255,255,0.14); color: var(--text-primary); }

.panel-label {
  font-family: var(--font-mono); font-size: 10.5px;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-faint); margin-bottom: 16px;
  display: flex; align-items: center; gap: 7px;
}
.panel-label svg { width: 12px; height: 12px; color: var(--accent-soft); flex-shrink: 0; }
.panel-title { font-size: 21px; font-weight: 600; letter-spacing: -0.01em; margin-bottom: 10px; }
.panel-body { color: var(--text-dim); font-size: 14px; line-height: 1.65; }

/* ===================== KPI CARD PRIMITIVE ===================== */
.primitive-kpi {
  display: flex; flex-wrap: wrap; gap: 20px;
}
.kpi-card {
  flex: 1; min-width: 120px;
  padding: 16px; border-radius: 12px;
  background: linear-gradient(135deg, rgba(255,255,255,0.04), rgba(255,255,255,0.01));
  border: 1px solid var(--surface-border-soft);
}
.kpi-label {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--text-faint); margin-bottom: 10px;
}
.kpi-value {
  font-size: 28px; font-weight: 700; letter-spacing: -0.02em;
  color: var(--text-primary); margin-bottom: 6px;
  font-variant-numeric: tabular-nums;
}
.kpi-delta {
  font-family: var(--font-mono); font-size: 11.5px; font-weight: 500;
  display: flex; align-items: center; gap: 4px; margin-bottom: 10px;
}
.kpi-delta.up { color: #7ee0a8; }
.kpi-delta.down { color: #ff9d9d; }
.kpi-sparkline { height: 32px; width: 100%; }
.kpi-sparkline svg { width: 100%; height: 100%; }
.kpi-spark-path {
  fill: none; stroke: var(--accent); stroke-width: 1.5;
  stroke-linecap: round; stroke-linejoin: round;
}
.kpi-spark-area { fill: hsla(var(--atmosphere-hue), 80%, 60%, 0.12); }

/* ===================== AI RESPONSE PANEL ===================== */
.panel.panel-oracle {
  border-color: hsla(var(--atmosphere-hue), 70%, 65%, 0.25);
  background: linear-gradient(155deg, rgba(110,168,255,0.06), rgba(255,255,255,0.015) 40%, rgba(255,255,255,0.03) 100%), var(--surface-bg);
}
.oracle-response {
  font-size: 15px; line-height: 1.75; color: var(--text-dim);
  min-height: 48px;
}
.oracle-cursor {
  display: inline-block; width: 2px; height: 16px;
  background: var(--accent); margin-left: 2px;
  vertical-align: text-bottom;
  animation: blink-cursor 0.9s step-end infinite;
}
@keyframes blink-cursor { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
.oracle-thinking-dots {
  display: inline-flex; gap: 4px; align-items: center; padding: 4px 0;
}
.oracle-thinking-dots span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); opacity: 0.4;
  animation: dot-pulse 1.4s ease-in-out infinite;
}
.oracle-thinking-dots span:nth-child(2) { animation-delay: 0.2s; }
.oracle-thinking-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes dot-pulse { 0%, 80%, 100% { opacity: 0.25; transform: scale(0.8); } 40% { opacity: 1; transform: scale(1.2); } }

/* ===================== GAUGE PRIMITIVE ===================== */
.primitive-gauge {
  display: flex; gap: 24px; justify-content: center; flex-wrap: wrap;
}
.gauge-item { text-align: center; }
.gauge-ring { position: relative; width: 80px; height: 80px; margin: 0 auto 8px; }
.gauge-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.gauge-bg { fill: none; stroke: var(--surface-border); stroke-width: 4; }
.gauge-fill {
  fill: none; stroke: var(--accent); stroke-width: 4;
  stroke-linecap: round;
  transition: stroke-dashoffset 1.6s cubic-bezier(.22,.61,.36,1);
}
.gauge-center {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700; color: var(--text-primary);
}
.gauge-label { font-size: 11px; color: var(--text-faint); font-family: var(--font-mono); }

/* ===================== MINDMAP PRIMITIVE ===================== */
.primitive-mindmap { position: relative; min-height: 200px; }
.mindmap-node {
  position: absolute; padding: 10px 16px; border-radius: 20px;
  background: linear-gradient(135deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
  border: 1px solid var(--surface-border-soft);
  font-size: 13px; color: var(--text-dim); white-space: nowrap;
  transition: all 0.5s ease;
  animation: float-node 5s ease-in-out infinite;
}
.mindmap-node.center {
  background: hsla(var(--atmosphere-hue), 70%, 60%, 0.15);
  border-color: hsla(var(--atmosphere-hue), 70%, 65%, 0.3);
  color: var(--text-primary); font-weight: 600;
}
@keyframes float-node {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
.mindmap-line {
  position: absolute; height: 1px;
  background: linear-gradient(90deg, hsla(var(--atmosphere-hue), 70%, 60%, 0.3), transparent);
  transform-origin: left center; pointer-events: none;
}

/* ===================== EXISTING PRIMITIVES ===================== */
.primitive-grid table { width: 100%; border-collapse: collapse; font-size: 13px; }
.primitive-grid td, .primitive-grid th { padding: 9px 10px; border-bottom: 1px solid var(--surface-border-soft); text-align: left; color: var(--text-dim); font-family: var(--font-mono); font-size: 12.5px; }
.primitive-grid th { color: var(--text-faint); font-weight: 500; font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; border-bottom: 1px solid var(--surface-border); }
.primitive-grid tr:last-child td { border-bottom: none; }
.primitive-grid td:first-child { color: var(--text-primary); font-family: var(--font-display); font-size: 13px; }
.delta-up { color: #7ee0a8; } .delta-down { color: #ff9d9d; }

.primitive-cluster { display: flex; flex-direction: column; gap: 18px; }
.cluster-bubble { background: linear-gradient(135deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02)); border-radius: 18px; padding: 16px 20px; color: var(--text-dim); font-size: 14px; line-height: 1.65; }

.primitive-stream { font-family: var(--font-mono); font-size: 12px; color: var(--accent); line-height: 1.8; max-height: 160px; overflow: hidden; }
.stream-line { opacity: 0.85; }
.stream-line::before { content: "› "; opacity: 0.5; }

.primitive-timeline { display: flex; align-items: center; gap: 6px; margin-top: 10px; }
.timeline-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); opacity: 0.4; }
.timeline-dot.active { opacity: 1; box-shadow: 0 0 12px var(--accent); }
.timeline-line { flex: 1; height: 1px; background: var(--surface-border); }

/* BLOB */
.panel.shape-blob {
  border-radius: 42% 58% 65% 35% / 48% 40% 60% 52%;
  background: radial-gradient(circle at 30% 20%, hsla(var(--atmosphere-hue), 75%, 70%, 0.22), transparent 60%), radial-gradient(circle at 75% 80%, hsla(var(--atmosphere-hue2), 70%, 60%, 0.18), transparent 65%), linear-gradient(150deg, rgba(255,255,255,0.06), rgba(255,255,255,0.015));
  animation: breathe 6s ease-in-out infinite, blob-morph 14s ease-in-out infinite;
  overflow: hidden;
}
.blob-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.32; mix-blend-mode: luminosity; filter: saturate(1.4); pointer-events: none; }
.panel.shape-blob::after { content: ''; position: absolute; inset: 0; background-image: radial-gradient(circle, rgba(255,255,255,0.5) 0.5px, transparent 0.5px); background-size: 3px 3px; opacity: 0.05; mix-blend-mode: overlay; pointer-events: none; }
.panel.shape-blob.entering { animation: enter-pop 0.9s cubic-bezier(.22,.61,.36,1) both, breathe 6s ease-in-out infinite 0.9s, blob-morph 14s ease-in-out infinite 0.9s; }
@keyframes blob-morph {
  0%   { border-radius: 42% 58% 65% 35% / 48% 40% 60% 52%; }
  33%  { border-radius: 58% 42% 38% 62% / 60% 55% 45% 40%; }
  66%  { border-radius: 35% 65% 55% 45% / 40% 60% 50% 60%; }
  100% { border-radius: 42% 58% 65% 35% / 48% 40% 60% 52%; }
}
.primitive-blob { display: flex; flex-direction: column; gap: 16px; text-align: center; align-items: center; justify-content: center; height: 100%; position: relative; z-index: 1; }
.blob-orb { width: 42px; height: 42px; border-radius: 60% 40% 55% 45% / 50% 60% 40% 50%; background: radial-gradient(circle at 35% 30%, hsla(var(--atmosphere-hue), 85%, 78%, 0.95), hsla(var(--atmosphere-hue2), 70%, 55%, 0.35)); box-shadow: 0 0 24px -4px hsla(var(--atmosphere-hue), 80%, 65%, 0.5); animation: blob-morph 9s ease-in-out infinite; margin-bottom: 4px; }

/* CHART */
.primitive-chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart-bar { transition: height 1.2s cubic-bezier(.22,.61,.36,1), y 1.2s cubic-bezier(.22,.61,.36,1); }
.chart-line-path { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chart-area { fill: hsla(var(--atmosphere-hue), 80%, 60%, 0.16); }
.chart-dot { fill: var(--accent-soft); filter: drop-shadow(0 0 4px hsla(var(--atmosphere-hue), 80%, 65%, 0.6)); }

/* RADIAL */
.panel.shape-radial-node { border-radius: 50%; aspect-ratio: 1/1; display: flex; align-items: center; justify-content: center; text-align: center; padding: 12px; }
.panel.shape-radial-node:hover { background: linear-gradient(155deg, rgba(255,255,255,0.09), rgba(255,255,255,0.03)); }
.radial-node-content { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.radial-node-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent-soft); box-shadow: 0 0 18px var(--accent); }
.radial-node-title { font-family: var(--font-display); font-size: 12.5px; font-weight: 600; line-height: 1.3; }
.radial-orbit-ring { position: absolute; border: 1px solid var(--surface-border); border-radius: 50%; pointer-events: none; }
#radial-3d-hub { position: absolute; border-radius: 50%; overflow: hidden; cursor: grab; }
#radial-3d-hub:active { cursor: grabbing; }
#radial-3d-hub canvas { display: block; width: 100% !important; height: 100% !important; }
@keyframes hub-pulse { 0%, 100% { opacity: 0.5; transform: scale(1); } 50% { opacity: 0.8; transform: scale(1.08); } }

/* VIDEO */
.panel.shape-video { padding: 0; overflow: hidden; background: #000; cursor: default; }
.panel.shape-video.video-main { width: min(820px, 86vw); height: min(460px, 48vh); }
.panel.shape-video.video-satellite { width: min(220px, 26vw); height: min(130px, 16vh); animation: float-satellite 8s ease-in-out infinite; }
@keyframes float-satellite { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
.video-satellite-row { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; }
.primitive-video { position: relative; width: 100%; height: 100%; }
.primitive-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: none; }
.video-label-overlay { position: absolute; top: 10px; left: 12px; z-index: 2; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(255,255,255,0.75); background: rgba(0,0,0,0.4); padding: 4px 9px; border-radius: 100px; backdrop-filter: blur(8px); pointer-events: none; display: flex; align-items: center; gap: 5px; }
.video-label-overlay::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: #ff5f5f; box-shadow: 0 0 6px #ff5f5f; }

/* ===================== INPUT BAR ===================== */
#input-bar {
  position: fixed; bottom: 84px; left: 50%; transform: translateX(-50%); z-index: 10;
  width: min(640px, 90vw);
  display: flex; align-items: center; gap: 10px;
  background: rgba(12,12,18,0.65);
  border: 1px solid var(--surface-border); border-radius: 100px;
  padding: 6px 6px 6px 22px;
  backdrop-filter: blur(24px) saturate(1.2);
  box-shadow: 0 1px 0 rgba(255,255,255,0.05) inset, 0 16px 48px -8px rgba(0,0,0,0.55);
  transition: border-color 0.5s ease, box-shadow 0.5s ease;
}
#input-bar.thinking {
  border-color: hsla(var(--atmosphere-hue), 70%, 65%, 0.6);
  box-shadow: 0 1px 0 rgba(255,255,255,0.05) inset, 0 16px 48px -8px rgba(0,0,0,0.55), 0 0 0 1px hsla(var(--atmosphere-hue), 70%, 65%, 0.15), 0 0 28px -4px hsla(var(--atmosphere-hue), 80%, 60%, 0.4);
}
#semantic-input {
  flex: 1; background: transparent; border: none; outline: none;
  color: var(--text-primary); font-size: 14.5px; font-family: var(--font-display);
  padding: 11px 0;
}
#semantic-input::placeholder { color: var(--text-faint); }
#input-send {
  background: var(--accent); border: none; color: #05050a;
  font-weight: 600; font-size: 13px; padding: 11px 22px;
  border-radius: 100px; cursor: pointer; font-family: var(--font-display);
  box-shadow: 0 4px 16px -2px hsla(var(--atmosphere-hue), 80%, 60%, 0.35);
  transition: opacity 0.3s, transform 0.3s;
}
#input-send:hover { transform: scale(1.03); }
#input-send:disabled { opacity: 0.4; cursor: default; transform: none; box-shadow: none; }
#audio-toggle {
  background: transparent; border: 1px solid var(--surface-border-soft);
  color: var(--text-faint); width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all 0.3s ease; flex-shrink: 0;
}
#audio-toggle:hover { color: var(--text-primary); border-color: var(--accent); }
#audio-toggle.active { color: var(--accent); border-color: var(--accent); background: hsla(var(--atmosphere-hue), 70%, 60%, 0.1); }
#audio-toggle svg { width: 16px; height: 16px; }

#input-status {
  position: fixed; bottom: 142px; left: 50%; transform: translateX(-50%); z-index: 10;
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.04em;
  color: var(--accent-soft); opacity: 0; transition: opacity 0.4s ease; pointer-events: none;
}
#input-status.visible { opacity: 0.85; }

/* ===================== MODE CONTROLS ===================== */
#mode-controls {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 10;
  display: flex; gap: 6px;
  background: rgba(10,10,16,0.55);
  backdrop-filter: blur(22px) saturate(1.2);
  border: 1px solid var(--surface-border); border-radius: 100px; padding: 6px;
  box-shadow: 0 12px 36px -8px rgba(0,0,0,0.5);
}
#mode-controls button {
  background: transparent; border: none; color: var(--text-dim);
  font-size: 12.5px; font-family: var(--font-display);
  padding: 9px 16px; border-radius: 100px; cursor: pointer;
  display: flex; align-items: center; gap: 6px;
  transition: all 0.4s cubic-bezier(.22,.61,.36,1);
}
#mode-controls button svg { width: 13px; height: 13px; opacity: 0.8; }
#mode-controls button:hover { color: var(--text-primary); }
#mode-controls button.active { background: var(--accent); color: #05050a; font-weight: 600; box-shadow: 0 0 18px hsla(var(--atmosphere-hue), 80%, 65%, 0.45); }

/* ===================== WELCOME OVERLAY ===================== */
#welcome-overlay {
  position: fixed; inset: 0; z-index: 50;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--bg-deep);
  transition: opacity 1.2s ease;
}
#welcome-overlay.hidden { opacity: 0; pointer-events: none; }
.welcome-orb {
  width: 120px; height: 120px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, hsla(210, 85%, 78%, 0.95), hsla(250, 70%, 55%, 0.35));
  box-shadow: 0 0 80px -10px hsla(210, 80%, 65%, 0.6);
  animation: welcome-pulse 2s ease-in-out infinite, blob-morph 8s ease-in-out infinite;
  margin-bottom: 32px;
}
@keyframes welcome-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 80px -10px hsla(210, 80%, 65%, 0.6); }
  50% { transform: scale(1.06); box-shadow: 0 0 120px -10px hsla(210, 80%, 65%, 0.8); }
}
.welcome-title {
  font-size: 28px; font-weight: 300; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--text-primary); margin-bottom: 12px;
}
.welcome-sub {
  font-size: 14px; color: var(--text-faint); font-family: var(--font-mono);
  letter-spacing: 0.04em;
}

/* ===================== SUGGESTIONS ===================== */
#suggestions {
  position: fixed; bottom: 142px; left: 50%; transform: translateX(-50%); z-index: 11;
  width: min(640px, 90vw);
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
  opacity: 0; transition: opacity 0.4s ease; pointer-events: none;
}
#suggestions.visible { opacity: 1; pointer-events: auto; }
.suggestion-chip {
  background: rgba(14,14,20,0.7); border: 1px solid var(--surface-border);
  border-radius: 100px; padding: 8px 16px;
  color: var(--text-dim); font-size: 12.5px; font-family: var(--font-display);
  cursor: pointer; transition: all 0.3s ease; backdrop-filter: blur(16px);
}
.suggestion-chip:hover { color: var(--text-primary); border-color: var(--accent); background: rgba(110,168,255,0.08); }

/* ===================== DYNAMIC GRID LAYOUT ===================== */
#stage.layout-dashboard {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  grid-auto-rows: min-content;
  align-content: start;
}
.panel.span-full { grid-column: 1 / -1; }
.panel.span-2 { grid-column: span 2; }
.panel.size-hero {
  grid-column: 1 / -1;
  padding: 32px 36px;
  border-color: hsla(var(--atmosphere-hue), 70%, 65%, 0.2);
  box-shadow: 0 1px 0 rgba(255,255,255,0.06) inset, 0 32px 80px -12px rgba(0,0,0,0.6), 0 0 48px -8px hsla(var(--atmosphere-hue), 70%, 60%, 0.22);
}
.panel.size-compact { padding: 16px 20px; }
.panel.size-compact .panel-title { font-size: 15px; margin-bottom: 6px; }
.panel.size-mini {
  padding: 14px 18px;
  background: linear-gradient(155deg, rgba(255,255,255,0.04), rgba(255,255,255,0.01));
}
.panel.size-mini .panel-label { margin-bottom: 8px; }
.panel.size-mini .panel-title { font-size: 26px; font-weight: 700; margin-bottom: 2px; font-variant-numeric: tabular-nums; }
.panel.size-mini .panel-body { font-size: 12px; }

/* ===================== HOME DASHBOARD ===================== */
.dashboard-welcome {
  display: flex; align-items: center; gap: 24px;
}
.dashboard-orb {
  width: 64px; height: 64px; border-radius: 50%; flex-shrink: 0;
  background: radial-gradient(circle at 35% 30%, hsla(var(--atmosphere-hue), 85%, 78%, 0.9), hsla(var(--atmosphere-hue2), 70%, 55%, 0.35));
  box-shadow: 0 0 40px -6px hsla(var(--atmosphere-hue), 80%, 65%, 0.5);
  animation: welcome-pulse 3s ease-in-out infinite;
}
.dashboard-greeting { font-size: 24px; font-weight: 300; }
.dashboard-greeting strong { font-weight: 600; }
.dashboard-sub { color: var(--text-dim); font-size: 14px; margin-top: 4px; }

.quick-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.quick-action {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: 100px;
  background: rgba(255,255,255,0.04); border: 1px solid var(--surface-border-soft);
  color: var(--text-dim); font-size: 13px; cursor: pointer;
  transition: all 0.3s ease; font-family: var(--font-display);
}
.quick-action:hover { border-color: var(--accent); color: var(--text-primary); background: rgba(110,168,255,0.06); }
.quick-action__icon { font-size: 16px; }

.recent-list { display: flex; flex-direction: column; gap: 8px; }
.recent-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-radius: 10px;
  background: rgba(255,255,255,0.025); border: 1px solid var(--surface-border-soft);
  cursor: pointer; transition: all 0.3s ease;
}
.recent-item:hover { background: rgba(255,255,255,0.05); border-color: var(--surface-border); }
.recent-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.recent-text { flex: 1; font-size: 13px; color: var(--text-dim); }
.recent-meta { font-family: var(--font-mono); font-size: 10px; color: var(--text-faint); }

/* ===================== MISSION CONTROL ===================== */
.mc-project-card {
  display: flex; flex-direction: column; gap: 12px;
  cursor: pointer;
}
.mc-project-header { display: flex; align-items: center; gap: 12px; }
.mc-project-icon {
  width: 40px; height: 40px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
}
.mc-project-name { font-size: 17px; font-weight: 600; }
.mc-project-url { font-family: var(--font-mono); font-size: 11px; color: var(--text-faint); }
.mc-status-bar { display: flex; gap: 16px; flex-wrap: wrap; }
.mc-stat {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text-dim);
}
.mc-stat__dot { width: 6px; height: 6px; border-radius: 50%; }
.mc-stat__dot.green { background: #7ee0a8; box-shadow: 0 0 6px #7ee0a8; }
.mc-stat__dot.yellow { background: #ffd666; box-shadow: 0 0 6px #ffd666; }
.mc-stat__dot.blue { background: #6ea8ff; box-shadow: 0 0 6px #6ea8ff; }
.mc-links { display: flex; gap: 8px; margin-top: 4px; }
.mc-link {
  padding: 5px 12px; border-radius: 100px;
  background: rgba(255,255,255,0.04); border: 1px solid var(--surface-border-soft);
  color: var(--text-faint); font-size: 11px; font-family: var(--font-mono);
  cursor: pointer; transition: all 0.3s ease; text-decoration: none;
}
.mc-link:hover { color: var(--accent); border-color: var(--accent); }

/* ===================== STREAMING ===================== */
.stream-output {
  font-size: 14.5px; line-height: 1.75; color: var(--text-dim);
  min-height: 60px; white-space: pre-wrap;
}
.stream-cursor {
  display: inline-block; width: 2px; height: 16px;
  background: var(--accent); vertical-align: text-bottom;
  animation: blink-cursor 0.9s step-end infinite;
}
.stream-progress {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: 11px; color: var(--text-faint);
  margin-top: 12px;
}
.stream-progress__bar {
  flex: 1; height: 3px; background: var(--surface-border);
  border-radius: 2px; overflow: hidden;
}
.stream-progress__fill {
  height: 100%; background: var(--accent); border-radius: 2px;
  transition: width 0.3s ease;
  animation: stream-indeterminate 1.5s ease-in-out infinite;
}
@keyframes stream-indeterminate {
  0% { width: 0%; margin-left: 0; }
  50% { width: 40%; margin-left: 30%; }
  100% { width: 0%; margin-left: 100%; }
}

/* ===================== TEMPLATE BROWSER ===================== */
.template-grid { display: flex; flex-wrap: wrap; gap: 12px; }
.template-card {
  flex: 1; min-width: 200px; padding: 16px;
  background: rgba(255,255,255,0.03); border: 1px solid var(--surface-border-soft);
  border-radius: 12px; cursor: pointer; transition: all 0.3s ease;
}
.template-card:hover { border-color: var(--accent); background: rgba(110,168,255,0.04); }
.template-card__name { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.template-card__meta { font-size: 11px; color: var(--text-faint); font-family: var(--font-mono); }
.template-card__delete {
  float: right; background: none; border: none; color: var(--text-faint);
  cursor: pointer; font-size: 14px; padding: 2px 6px; border-radius: 50%;
  transition: color 0.3s;
}
.template-card__delete:hover { color: #ff9d9d; }

/* ===================== EXPORT TOOLBAR ===================== */
.export-toolbar {
  display: flex; gap: 8px; margin-top: 16px; padding-top: 16px;
  border-top: 1px solid var(--surface-border-soft);
}
.export-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: 100px;
  background: rgba(255,255,255,0.04); border: 1px solid var(--surface-border-soft);
  color: var(--text-dim); font-size: 12px; font-family: var(--font-display);
  cursor: pointer; transition: all 0.3s ease;
}
.export-btn:hover { border-color: var(--accent); color: var(--text-primary); }
.export-btn svg { width: 14px; height: 14px; }

/* ===================== PRINT STYLES ===================== */
@media print {
  body { background: #fff !important; color: #111 !important; overflow: visible !important; }
  #atmosphere, #cosmic-backdrop, #particles, #history-rail,
  #input-bar, #input-status, #mode-controls, #suggestions,
  #welcome-overlay, .export-toolbar, .copy-btn, .flow-cancel-btn { display: none !important; }
  #stage {
    position: static !important; left: 0 !important; padding: 20px !important;
    display: block !important; overflow: visible !important;
    height: auto !important;
  }
  .panel {
    background: #fff !important; border: 1px solid #ddd !important;
    box-shadow: none !important; backdrop-filter: none !important;
    color: #111 !important; break-inside: avoid; margin-bottom: 16px;
    animation: none !important; border-radius: 8px !important;
  }
  .panel-title { color: #111 !important; }
  .panel-body, .report-section__body, .social-card__body,
  .oracle-response, .stream-output { color: #333 !important; }
  .panel-label { color: #666 !important; }
  .report-section { border-color: #eee !important; background: #fafafa !important; }
  .social-card { border-color: #ddd !important; background: #fafafa !important; }
  .output-table th, .output-table td { color: #333 !important; border-color: #ddd !important; }
  .kpi-value, .report-kpi__value { color: #111 !important; }
}

/* ===================== ONBOARDING ===================== */
#onboarding-overlay {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-deep);
  transition: opacity 1.2s ease;
}
#onboarding-overlay.hidden { opacity: 0; pointer-events: none; }
.ob-container {
  display: flex; flex-direction: column; align-items: center;
  text-align: center; padding: 32px 24px; max-width: 520px; width: 100%;
}
.ob-orb {
  width: 80px; height: 80px; border-radius: 50%; margin-bottom: 28px;
  background: radial-gradient(circle at 35% 30%, hsla(210, 85%, 78%, 0.95), hsla(250, 70%, 55%, 0.35));
  box-shadow: 0 0 60px -8px hsla(210, 80%, 65%, 0.6);
  animation: welcome-pulse 2.5s ease-in-out infinite, blob-morph 8s ease-in-out infinite;
}
.ob-title { font-size: 26px; font-weight: 300; letter-spacing: 0.04em; margin-bottom: 6px; }
.ob-title strong { font-weight: 700; }
.ob-question { font-size: 16px; color: var(--text-dim); margin-bottom: 28px; line-height: 1.5; }
.ob-options { display: flex; flex-direction: column; gap: 10px; width: 100%; }
.ob-option {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 20px; border-radius: 14px;
  background: rgba(255,255,255,0.03); border: 1px solid var(--surface-border-soft);
  cursor: pointer; transition: all 0.4s cubic-bezier(.22,.61,.36,1);
  text-align: left;
}
.ob-option:hover {
  border-color: var(--accent); background: rgba(110,168,255,0.06);
  transform: translateX(4px);
}
.ob-option.selected {
  border-color: var(--accent); background: rgba(110,168,255,0.1);
  box-shadow: 0 0 20px -4px hsla(var(--atmosphere-hue), 70%, 60%, 0.25);
}
.ob-option__icon { font-size: 24px; flex-shrink: 0; width: 36px; text-align: center; }
.ob-option__text { flex: 1; }
.ob-option__label { font-size: 15px; font-weight: 600; margin-bottom: 2px; }
.ob-option__desc { font-size: 12px; color: var(--text-faint); }
.ob-dots {
  display: flex; gap: 8px; margin-top: 28px;
}
.ob-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--surface-border); transition: all 0.4s ease;
}
.ob-dot.active { background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.ob-dot.done { background: var(--accent); opacity: 0.4; }
.ob-skip {
  margin-top: 20px; background: none; border: none;
  color: var(--text-faint); font-size: 12px; cursor: pointer;
  font-family: var(--font-mono); letter-spacing: 0.04em;
  transition: color 0.3s;
}
.ob-skip:hover { color: var(--text-primary); }

/* ===================== MOBILE RESPONSIVE ===================== */
@media (max-width: 768px) {
  #stage {
    left: 0; padding: 16px 12px 180px;
  }
  #stage.layout-dashboard {
    grid-template-columns: 1fr;
  }
  #history-rail { display: none; }

  .panel { padding: 18px 16px; }
  .panel.size-hero { padding: 24px 20px; }
  .panel-title { font-size: 18px; }

  #input-bar { width: calc(100% - 24px); bottom: 72px; }
  #mode-controls {
    width: calc(100% - 16px); bottom: 8px;
    overflow-x: auto; scrollbar-width: none; flex-wrap: nowrap;
    justify-content: flex-start; padding: 5px;
  }
  #mode-controls::-webkit-scrollbar { display: none; }
  #mode-controls button { font-size: 11px; padding: 8px 12px; white-space: nowrap; }
  #mode-controls button svg { width: 11px; height: 11px; }

  #suggestions { width: calc(100% - 24px); bottom: 130px; }
  .suggestion-chip { font-size: 11.5px; padding: 7px 14px; }

  .flow-menu { flex-direction: column; }
  .flow-card { min-width: unset; }

  .ob-container { padding: 24px 16px; }
  .ob-option { padding: 14px 16px; }

  .dashboard-welcome { flex-direction: column; text-align: center; }
  .quick-actions { justify-content: center; }

  .primitive-kpi { flex-direction: column; }
  .swot-grid { grid-template-columns: 1fr; }
  .output-social-grid { flex-direction: column; }

  .panel.shape-video.video-main { width: 100% !important; height: 220px !important; }
  .panel.shape-video.video-satellite { width: 45vw !important; height: 100px !important; }
  .video-satellite-row { gap: 10px; }

  #footer-links { bottom: auto; top: 8px; right: 12px; }

  /* Consent banner mobile */
  #consent-banner > div { flex-direction: column; text-align: center; }
}

@media (max-width: 400px) {
  #mode-controls button span:not(svg) { display: none; }
  .ob-option__desc { display: none; }
  .panel-label { font-size: 9px; }
}

/* ===================== MIC BUTTON (replaces audio) ===================== */
#mic-toggle {
  background: transparent; border: 1px solid var(--surface-border-soft);
  color: var(--text-faint); width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all 0.3s ease; flex-shrink: 0;
}
#mic-toggle:hover { color: var(--text-primary); border-color: var(--accent); }
#mic-toggle svg { width: 16px; height: 16px; }
#mic-toggle.recording {
  color: #ff5f5f; border-color: #ff5f5f;
  animation: mic-pulse 1s ease-in-out infinite;
  box-shadow: 0 0 16px rgba(255,95,95,0.3);
}
@keyframes mic-pulse {
  0%, 100% { box-shadow: 0 0 16px rgba(255,95,95,0.3); }
  50% { box-shadow: 0 0 28px rgba(255,95,95,0.5); }
}

/* ===================== FLUID PANEL ANIMATIONS ===================== */
.panel.stagger-enter {
  opacity: 0; transform: scale(0.97) translateY(12px);
  animation: fluid-enter 0.55s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  will-change: transform, opacity;
}
@keyframes fluid-enter {
  0% { opacity: 0; transform: scale(0.97) translateY(12px); filter: blur(4px); }
  60% { opacity: 1; filter: blur(0); }
  100% { opacity: 1; transform: scale(1) translateY(0); filter: blur(0); }
}
.panel.stagger-enter:nth-child(1) { animation-delay: 0ms; }
.panel.stagger-enter:nth-child(2) { animation-delay: 50ms; }
.panel.stagger-enter:nth-child(3) { animation-delay: 95ms; }
.panel.stagger-enter:nth-child(4) { animation-delay: 135ms; }
.panel.stagger-enter:nth-child(5) { animation-delay: 170ms; }
.panel.stagger-enter:nth-child(6) { animation-delay: 200ms; }
.panel.stagger-enter:nth-child(7) { animation-delay: 225ms; }
.panel.stagger-enter:nth-child(8) { animation-delay: 245ms; }
.panel.stagger-enter:nth-child(9) { animation-delay: 260ms; }
.panel.stagger-enter:nth-child(10) { animation-delay: 270ms; }

/* Faster exit */
.panel.exiting {
  opacity: 0; transform: scale(0.96) translateY(6px); filter: blur(2px);
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 1, 1);
}

/* ===================== AUTH UI ===================== */
.auth-card {
  display: flex; flex-direction: column; gap: 14px;
}
.auth-input {
  width: 100%; padding: 13px 18px; border-radius: 12px;
  background: rgba(255,255,255,0.04); border: 1px solid var(--surface-border);
  color: var(--text-primary); font-size: 14px; font-family: var(--font-display);
  outline: none; transition: border-color 0.3s;
}
.auth-input:focus { border-color: var(--accent); }
.auth-input::placeholder { color: var(--text-faint); }
.auth-submit {
  padding: 13px 24px; border-radius: 100px;
  background: var(--accent); border: none; color: #05050a;
  font-size: 14px; font-weight: 600; font-family: var(--font-display);
  cursor: pointer; transition: all 0.3s ease;
}
.auth-submit:hover { transform: scale(1.02); box-shadow: 0 4px 20px -4px hsla(var(--atmosphere-hue), 80%, 60%, 0.4); }
.auth-submit:disabled { opacity: 0.5; cursor: default; transform: none; }
.auth-msg { font-size: 13px; color: var(--text-dim); text-align: center; line-height: 1.6; }
.auth-msg.success { color: #7ee0a8; }
.auth-msg.error { color: #ff9d9d; }
.auth-divider {
  display: flex; align-items: center; gap: 12px;
  font-size: 11px; color: var(--text-faint); margin: 4px 0;
}
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--surface-border-soft); }
.auth-user-bar {
  display: flex; align-items: center; gap: 12px;
}
.auth-user-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: hsla(var(--atmosphere-hue), 70%, 60%, 0.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 600; color: var(--accent);
}
.auth-user-name { font-size: 13px; font-weight: 500; flex: 1; }
.auth-user-email { font-size: 11px; color: var(--text-faint); font-family: var(--font-mono); }
.auth-logout {
  background: none; border: 1px solid var(--surface-border-soft);
  color: var(--text-faint); padding: 5px 12px; border-radius: 100px;
  font-size: 11px; cursor: pointer; transition: all 0.3s;
}
.auth-logout:hover { color: #ff9d9d; border-color: #ff9d9d; }

/* Persona badge on dashboard */
.persona-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: 100px;
  background: hsla(var(--atmosphere-hue), 70%, 60%, 0.1);
  border: 1px solid hsla(var(--atmosphere-hue), 70%, 60%, 0.2);
  font-size: 11px; color: var(--accent); font-family: var(--font-mono);
  letter-spacing: 0.04em;
}
.reset-persona {
  background: none; border: none; color: var(--text-faint);
  font-size: 11px; cursor: pointer; margin-left: 8px;
  text-decoration: underline; font-family: var(--font-mono);
}
.reset-persona:hover { color: var(--accent); }

/* ===================== YOUTUBE SEARCH ===================== */
.yt-search-bar {
  display: flex; gap: 8px; width: 100%; max-width: 600px; margin: 0 auto;
}
.yt-search-input {
  flex: 1; padding: 12px 18px; border-radius: 100px;
  background: rgba(255,255,255,0.04); border: 1px solid var(--surface-border);
  color: var(--text-primary); font-size: 14px; font-family: var(--font-display);
  outline: none; transition: border-color 0.3s;
}
.yt-search-input:focus { border-color: var(--accent); }
.yt-search-input::placeholder { color: var(--text-faint); }
.yt-search-btn {
  padding: 12px 22px; border-radius: 100px;
  background: var(--accent); border: none; color: #05050a;
  font-weight: 600; font-size: 13px; cursor: pointer;
  font-family: var(--font-display);
  transition: transform 0.2s;
}
.yt-search-btn:hover { transform: scale(1.03); }
.yt-search-btn:disabled { opacity: 0.5; }

.yt-results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px; width: 100%; margin-top: 16px;
}
.yt-card {
  border-radius: 12px; overflow: hidden; cursor: pointer;
  background: rgba(255,255,255,0.03); border: 1px solid var(--surface-border-soft);
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.yt-card:hover {
  border-color: var(--accent); transform: translateY(-4px) scale(1.02);
  box-shadow: 0 16px 40px -8px rgba(0,0,0,0.5);
}
.yt-card__thumb {
  width: 100%; aspect-ratio: 16/9; object-fit: cover;
  display: block; background: #111;
}
.yt-card__info { padding: 12px 14px; }
.yt-card__title {
  font-size: 13.5px; font-weight: 600; line-height: 1.4;
  margin-bottom: 6px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.yt-card__meta {
  font-size: 11px; color: var(--text-faint); font-family: var(--font-mono);
  display: flex; gap: 8px; flex-wrap: wrap;
}
.yt-card__playing {
  position: relative;
}
.yt-card__playing::after {
  content: '▶ Pušta se'; position: absolute; top: 8px; left: 8px;
  background: rgba(255,95,95,0.9); color: #fff; padding: 3px 10px;
  border-radius: 100px; font-size: 10px; font-weight: 600;
}

/* Now playing bar */
.yt-now-playing {
  width: 100%; text-align: center; padding: 8px 0;
  font-family: var(--font-mono); font-size: 11px; color: var(--accent);
  letter-spacing: 0.04em;
}

@media (max-width: 768px) {
  .yt-results { grid-template-columns: 1fr 1fr; gap: 10px; }
  .yt-card__title { font-size: 12px; }
  .yt-search-bar { flex-direction: column; }
}
@media (max-width: 400px) {
  .yt-results { grid-template-columns: 1fr; }
}

/* ===================== FLUID CANVAS ===================== */
#fluid-canvas {
  position: fixed; inset: 0; z-index: 0;
  width: 100vw; height: 100vh;
  pointer-events: none;
}
/* Hide CSS atmosphere when WebGL active */
body.has-webgl #atmosphere { opacity: 0; }
body.has-webgl #particles { opacity: 0.3; }

/* Cursor: default system cursor (no custom glow) */

/* ===================== BRIEFING PANEL ===================== */
.briefing-panel { border-left: 3px solid var(--accent); }
.briefing-greeting { font-size: 22px; font-weight: 300; margin-bottom: 4px; }
.briefing-date { font-family: var(--font-mono); font-size: 11px; color: var(--text-faint); letter-spacing: 0.06em; margin-bottom: 16px; }
.briefing-summary { font-size: 15px; line-height: 1.7; color: var(--text-dim); margin-bottom: 18px; }
.briefing-highlights { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.briefing-highlight {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 14px; border-radius: 10px;
  background: rgba(255,255,255,0.025);
  font-size: 13.5px; color: var(--text-dim); line-height: 1.5;
}
.briefing-highlight__icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.briefing-tip {
  font-size: 12.5px; color: var(--text-faint); font-style: italic;
  padding: 10px 14px; border-radius: 8px;
  background: rgba(255,255,255,0.015);
  border: 1px solid var(--surface-border-soft);
}
.briefing-action {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 14px; padding: 10px 20px; border-radius: 100px;
  background: hsla(var(--atmosphere-hue), 70%, 60%, 0.12);
  border: 1px solid hsla(var(--atmosphere-hue), 70%, 60%, 0.2);
  color: var(--accent); font-size: 13px; font-weight: 500;
  cursor: pointer; transition: all 0.3s ease;
}
.briefing-action:hover { background: hsla(var(--atmosphere-hue), 70%, 60%, 0.2); }

/* ===================== FULLSCREEN (in mode bar) ===================== */
#fs-toggle {
  background: transparent; border: none; color: var(--text-dim);
  cursor: pointer; display: flex; align-items: center; gap: 6px;
  padding: 9px 12px; border-radius: 100px; font-size: 12.5px;
  font-family: var(--font-display);
  transition: all 0.4s cubic-bezier(.22,.61,.36,1);
}
#fs-toggle:hover { color: var(--text-primary); }

/* ===================== PROJECT MANAGEMENT ===================== */
.prj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.prj-card {
  padding: 18px; border-radius: 14px;
  background: rgba(255,255,255,0.03); border: 1px solid var(--surface-border-soft);
  cursor: pointer; transition: all 0.4s cubic-bezier(0.34,1.56,0.64,1);
  position: relative;
}
.prj-card:hover { border-color: var(--accent); transform: translateY(-3px); }
.prj-card__color { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 8px; }
.prj-card__name { font-size: 16px; font-weight: 600; margin-bottom: 4px; display: flex; align-items: center; }
.prj-card__desc { font-size: 12.5px; color: var(--text-faint); margin-bottom: 12px; line-height: 1.5; }
.prj-card__meta { display: flex; gap: 12px; font-size: 11px; color: var(--text-faint); font-family: var(--font-mono); }
.prj-card__status {
  position: absolute; top: 14px; right: 14px;
  font-size: 9px; font-family: var(--font-mono); letter-spacing: 0.1em;
  text-transform: uppercase; padding: 3px 8px; border-radius: 100px;
}
.prj-card__status--active { background: rgba(126,224,168,0.12); color: #7ee0a8; }
.prj-card__status--waiting { background: rgba(255,214,102,0.12); color: #ffd666; }
.prj-card__status--done { background: rgba(148,163,184,0.12); color: #94a3b8; }

.prj-create-btn {
  padding: 18px; border-radius: 14px; text-align: center;
  background: none; border: 2px dashed var(--surface-border);
  color: var(--text-faint); cursor: pointer; font-size: 14px;
  font-family: var(--font-display);
  transition: all 0.3s ease;
}
.prj-create-btn:hover { border-color: var(--accent); color: var(--accent); }

/* Project detail view */
.prj-detail { display: flex; flex-direction: column; gap: 18px; }
.prj-section { padding: 16px 18px; border-radius: 12px; background: rgba(255,255,255,0.02); border: 1px solid var(--surface-border-soft); }
.prj-section__title { font-size: 12px; font-family: var(--font-mono); color: var(--text-faint); letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 12px; }

.prj-files { display: flex; flex-wrap: wrap; gap: 10px; }
.prj-file {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 10px;
  background: rgba(255,255,255,0.03); border: 1px solid var(--surface-border-soft);
  font-size: 12px; color: var(--text-dim);
}
.prj-file__size { color: var(--text-faint); font-family: var(--font-mono); font-size: 10px; }
.prj-file__del { background: none; border: none; color: var(--text-faint); cursor: pointer; font-size: 14px; padding: 0 4px; }
.prj-file__del:hover { color: #ff9d9d; }
.prj-file-img { width: 48px; height: 48px; border-radius: 6px; object-fit: cover; }

.prj-upload-zone {
  padding: 20px; border: 2px dashed var(--surface-border); border-radius: 12px;
  text-align: center; color: var(--text-faint); font-size: 13px;
  cursor: pointer; transition: all 0.3s ease;
}
.prj-upload-zone:hover { border-color: var(--accent); color: var(--text-dim); }
.prj-upload-zone.dragover { border-color: var(--accent); background: rgba(110,168,255,0.05); }

.prj-tasks { display: flex; flex-direction: column; gap: 6px; }
.prj-task {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0; font-size: 13.5px; color: var(--text-dim);
}
.prj-task.done { text-decoration: line-through; opacity: 0.5; }
.prj-task__check {
  width: 18px; height: 18px; border-radius: 50%;
  border: 1.5px solid var(--surface-border); background: none;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all 0.3s ease; flex-shrink: 0; color: transparent;
}
.prj-task.done .prj-task__check { border-color: var(--accent); color: var(--accent); background: rgba(110,168,255,0.1); }
.prj-task__del { background: none; border: none; color: var(--text-faint); cursor: pointer; margin-left: auto; font-size: 12px; opacity: 0; transition: opacity 0.2s; }
.prj-task:hover .prj-task__del { opacity: 1; }

.prj-task-add {
  display: flex; gap: 8px; margin-top: 8px;
}
.prj-task-input {
  flex: 1; padding: 8px 14px; border-radius: 100px;
  background: rgba(255,255,255,0.03); border: 1px solid var(--surface-border-soft);
  color: var(--text-primary); font-size: 13px; font-family: var(--font-display);
  outline: none;
}
.prj-task-input::placeholder { color: var(--text-faint); }

.prj-notes-area {
  width: 100%; min-height: 100px; padding: 14px 16px;
  background: rgba(255,255,255,0.02); border: 1px solid var(--surface-border-soft);
  border-radius: 10px; color: var(--text-dim); font-size: 14px;
  font-family: var(--font-display); line-height: 1.7;
  resize: vertical; outline: none;
}
.prj-notes-area:focus { border-color: var(--accent); }

.prj-storage {
  font-family: var(--font-mono); font-size: 11px; color: var(--text-faint);
  display: flex; align-items: center; gap: 8px;
}
.prj-storage__bar { flex: 1; max-width: 120px; height: 4px; background: var(--surface-border); border-radius: 2px; overflow: hidden; }
.prj-storage__fill { height: 100%; background: var(--accent); border-radius: 2px; }

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

/* ===================== MODAL SYSTEM ===================== */
#modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  background: rgba(5,5,10,0.7);
  backdrop-filter: blur(8px);
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s ease;
}
#modal-overlay.visible { opacity: 1; pointer-events: auto; }
.modal-box {
  width: min(440px, 90vw); padding: 32px;
  background: linear-gradient(155deg, rgba(20,20,30,0.95), rgba(12,12,20,0.98));
  border: 1px solid var(--surface-border);
  border-radius: 20px;
  box-shadow: 0 32px 80px -12px rgba(0,0,0,0.8), 0 0 0 1px rgba(255,255,255,0.04) inset;
  transform: scale(0.95) translateY(10px);
  transition: transform 0.4s cubic-bezier(0.34,1.56,0.64,1);
}
#modal-overlay.visible .modal-box { transform: scale(1) translateY(0); }
.modal-title { font-size: 18px; font-weight: 600; margin-bottom: 18px; }
.modal-message { font-size: 14px; color: var(--text-dim); line-height: 1.6; margin-bottom: 20px; }
.modal-field { margin-bottom: 16px; }
.modal-label { display: block; font-size: 12px; color: var(--text-faint); margin-bottom: 6px; font-family: var(--font-mono); letter-spacing: 0.04em; }
.modal-input, .modal-textarea, .modal-select {
  width: 100%; padding: 12px 16px; border-radius: 12px;
  background: rgba(255,255,255,0.05); border: 1px solid var(--surface-border);
  color: var(--text-primary); font-size: 14px; font-family: var(--font-display);
  outline: none; transition: border-color 0.3s;
}
.modal-input:focus, .modal-textarea:focus, .modal-select:focus { border-color: var(--accent); }
.modal-input::placeholder, .modal-textarea::placeholder { color: var(--text-faint); }
.modal-textarea { min-height: 80px; resize: vertical; }
.modal-select { appearance: none; cursor: pointer; }
.modal-colors { display: flex; gap: 8px; flex-wrap: wrap; }
.modal-color-btn {
  width: 28px; height: 28px; border-radius: 50%; border: 2px solid transparent;
  cursor: pointer; transition: all 0.3s ease;
}
.modal-color-btn:hover { transform: scale(1.15); }
.modal-color-btn.active { border-color: #fff; box-shadow: 0 0 12px currentColor; transform: scale(1.15); }
.modal-actions {
  display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px;
}
.modal-btn {
  padding: 10px 24px; border-radius: 100px; font-size: 13px;
  font-family: var(--font-display); font-weight: 500; cursor: pointer;
  transition: all 0.3s ease; border: none;
}
.modal-btn--ok {
  background: var(--accent); color: #05050a; font-weight: 600;
}
.modal-btn--ok:hover { transform: scale(1.03); box-shadow: 0 4px 16px -2px hsla(var(--atmosphere-hue), 80%, 60%, 0.4); }
.modal-btn--cancel {
  background: rgba(255,255,255,0.06); color: var(--text-dim);
  border: 1px solid var(--surface-border-soft);
}
.modal-btn--cancel:hover { color: var(--text-primary); }
.modal-btn--danger { background: rgba(255,100,100,0.15); color: #ff9d9d; border: 1px solid rgba(255,100,100,0.2); }
.modal-btn--danger:hover { background: rgba(255,100,100,0.25); }

/* Toast */
.modal-toast {
  position: fixed; bottom: 100px; left: 50%; transform: translateX(-50%) translateY(10px);
  z-index: 250; padding: 12px 24px; border-radius: 100px;
  background: rgba(14,14,20,0.9); border: 1px solid var(--surface-border);
  backdrop-filter: blur(16px); color: var(--text-primary);
  font-size: 13px; white-space: nowrap; opacity: 0;
  transition: all 0.3s ease; pointer-events: none;
}
.modal-toast.visible { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===================== PLANS / PRICING ===================== */
.plans-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; margin-top: 16px; }
.plan-card {
  padding: 24px; border-radius: 16px;
  background: rgba(255,255,255,0.025); border: 1px solid var(--surface-border-soft);
  display: flex; flex-direction: column; position: relative;
  transition: all 0.4s cubic-bezier(0.16,1,0.3,1);
}
.plan-card:hover { border-color: var(--surface-border); transform: translateY(-3px); }
.plan-card--featured {
  border-color: hsla(var(--atmosphere-hue), 70%, 60%, 0.3);
  background: linear-gradient(155deg, hsla(var(--atmosphere-hue), 70%, 60%, 0.06), rgba(255,255,255,0.02));
}
.plan-card--current { opacity: 0.7; }
.plan-badge {
  position: absolute; top: -10px; right: 16px;
  font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.1em;
  text-transform: uppercase; padding: 4px 12px; border-radius: 100px;
  background: rgba(255,255,255,0.08); color: var(--text-faint);
}
.plan-name { font-size: 22px; font-weight: 700; margin-bottom: 4px; margin-top: 8px; }
.plan-price { font-size: 28px; font-weight: 700; color: var(--accent); margin-bottom: 16px; }
.plan-price span { font-size: 13px; font-weight: 400; color: var(--text-faint); }
.plan-features { display: flex; flex-direction: column; gap: 8px; font-size: 13px; color: var(--text-dim); line-height: 1.5; flex: 1; }
@media (max-width: 768px) { .plans-grid { grid-template-columns: 1fr; } }

/* Settings button in mode bar */
#btn-settings {
  background: transparent; border: none; color: var(--text-dim);
  cursor: pointer; display: flex; align-items: center;
  border-radius: 100px;
  transition: all 0.4s cubic-bezier(.22,.61,.36,1);
}
#btn-settings:hover { color: var(--text-primary); }

/* Home button in mode bar */
#btn-home {
  background: transparent; border: none; color: var(--text-dim);
  cursor: pointer; display: flex; align-items: center;
  border-radius: 100px;
  transition: all 0.4s cubic-bezier(.22,.61,.36,1);
}
#btn-home:hover { color: var(--accent); }

/* Stage scrollbar */
#stage::-webkit-scrollbar { width: 6px; }
#stage::-webkit-scrollbar-track { background: transparent; }
#stage::-webkit-scrollbar-thumb { background: var(--surface-border); border-radius: 3px; }
#stage::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ===================== MODE CANVAS ===================== */
#mode-canvas {
  position: fixed; inset: 0; z-index: 1;
  width: 100vw; height: 100vh;
  pointer-events: none;
}

/* ===================== AESTHETIC THEMES ===================== */
body[data-aesthetic="soft"] {
  --surface-bg: rgba(255,255,255,0.05);
  --surface-border: rgba(255,255,255,0.12);
}
body[data-aesthetic="soft"] .panel {
  border-radius: 20px;
  box-shadow: 0 1px 0 rgba(255,255,255,0.08) inset, 0 20px 50px -10px rgba(0,0,0,0.4), 0 0 40px -8px hsla(var(--atmosphere-hue), 50%, 70%, 0.12);
}
body[data-aesthetic="soft"] .panel-title { font-weight: 300; letter-spacing: 0.01em; }
body[data-aesthetic="soft"] #mode-controls { border-radius: 24px; }
body[data-aesthetic="soft"] #input-bar { border-radius: 24px; }
body[data-aesthetic="soft"] .flow-card { border-radius: 18px; }
body[data-aesthetic="soft"] .question-chip { border-radius: 20px; }

body[data-aesthetic="sharp"] .panel {
  border-radius: 4px;
  box-shadow: 0 1px 0 rgba(255,255,255,0.04) inset, 0 24px 60px -12px rgba(0,0,0,0.7), 0 0 0 1px rgba(0,0,0,0.3);
}
body[data-aesthetic="sharp"] .panel-title { font-weight: 700; letter-spacing: -0.02em; }
body[data-aesthetic="sharp"] #mode-controls { border-radius: 4px; }
body[data-aesthetic="sharp"] #input-bar { border-radius: 6px; }
body[data-aesthetic="sharp"] .flow-card { border-radius: 6px; }
body[data-aesthetic="sharp"] .question-chip { border-radius: 4px; }
body[data-aesthetic="sharp"] .auth-submit { border-radius: 4px; }
body[data-aesthetic="sharp"] .quick-action { border-radius: 4px; }

body[data-aesthetic="vivid"] {
  --atmosphere-glow: 0.35;
}
body[data-aesthetic="vivid"] .panel {
  border-color: hsla(var(--atmosphere-hue), 80%, 60%, 0.2);
  box-shadow: 0 1px 0 rgba(255,255,255,0.06) inset, 0 24px 60px -12px rgba(0,0,0,0.55), 0 0 48px -6px hsla(var(--atmosphere-hue), 80%, 60%, 0.25);
}
body[data-aesthetic="vivid"] .panel:hover {
  box-shadow: 0 1px 0 rgba(255,255,255,0.06) inset, 0 28px 70px -12px rgba(0,0,0,0.55), 0 0 60px -6px hsla(var(--atmosphere-hue), 80%, 60%, 0.35);
}

/* Font weight data attribute */
body[data-weight="light"] .panel-title { font-weight: 300; }
body[data-weight="light"] .panel-body { font-weight: 300; }
body[data-weight="bold"] .panel-title { font-weight: 700; letter-spacing: -0.02em; }
body[data-weight="bold"] .panel-label { font-weight: 600; }

/* ===================== PREMIUM MICRO-ANIMATIONS ===================== */
.quick-action {
  transition: all 0.3s cubic-bezier(0.16,1,0.3,1);
}
.quick-action:active {
  transform: scale(0.96);
}
#mode-controls button {
  transition: all 0.35s cubic-bezier(0.16,1,0.3,1);
}
#mode-controls button:active {
  transform: scale(0.95);
}
#mode-controls button.active {
  transition: all 0.4s cubic-bezier(0.34,1.56,0.64,1);
}
.flow-card:active { transform: scale(0.97); }
.auth-submit:active { transform: scale(0.97); }

/* Click ripple on panels */
.panel { overflow: hidden; }
.panel::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at var(--ripple-x, 50%) var(--ripple-y, 50%), hsla(var(--atmosphere-hue), 70%, 60%, 0.08), transparent 60%);
  opacity: 0; transition: opacity 0.6s ease;
  pointer-events: none;
}
.panel:hover::after { opacity: 1; }

/* ===================== TYPOGRAPHY HIERARCHY ===================== */
.panel-title {
  font-size: 21px; font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.3;
}
.panel-label {
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-faint); margin-bottom: 14px;
  opacity: 0.7;
}
.panel-body {
  color: var(--text-dim); font-size: 14px;
  line-height: 1.7; font-weight: 400;
}

/* ===================== SPATIAL DEPTH ===================== */
.panel.size-hero {
  z-index: 3;
  box-shadow: 0 1px 0 rgba(255,255,255,0.08) inset, 0 32px 80px -12px rgba(0,0,0,0.6), 0 0 0 1px rgba(0,0,0,0.2), 0 0 50px -8px hsla(var(--atmosphere-hue), 70%, 60%, 0.2);
}
.panel.size-compact {
  z-index: 2;
}
.panel.size-mini {
  z-index: 1;
  box-shadow: 0 1px 0 rgba(255,255,255,0.04) inset, 0 12px 30px -8px rgba(0,0,0,0.4);
}
.panel:hover {
  z-index: 5;
  transform: translateY(-2px);
}

/* ===================== LOADING SKELETON ===================== */
.skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,0.03) 25%, rgba(255,255,255,0.06) 50%, rgba(255,255,255,0.03) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
  border-radius: 8px;
}
.skeleton-line { height: 14px; margin-bottom: 10px; width: 80%; }
.skeleton-line:last-child { width: 50%; }
.skeleton-title { height: 24px; width: 40%; margin-bottom: 16px; }
.skeleton-block { height: 80px; width: 100%; margin-bottom: 12px; }
@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ===================== BREADCRUMB ===================== */
.breadcrumb {
  position: fixed; top: 12px; left: 64px; z-index: 8;
  display: flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.06em; color: var(--text-faint);
  opacity: 0.6;
}
.breadcrumb span { opacity: 0.4; }

@media (max-width: 768px) {
  .breadcrumb { left: 12px; top: 8px; }
  body[data-aesthetic="soft"] .panel { border-radius: 16px; }
}
