/* ═══════════════════════════════════════
   MIND — Neural Interface
   Full Application CSS
   ═══════════════════════════════════════ */

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

:root {
  --bg: #020408;
  --bg2: #050810;
  --glass: rgba(8, 12, 24, 0.85);
  --glass-border: rgba(60, 80, 180, 0.15);
  --text: #c8d0e8;
  --text-dim: #4a5068;
  --text-bright: #e8ecff;
  --accent: #4466ff;
  --accent2: #aa44ff;
  --mind-font: 'Space Mono', monospace;
  --body-font: 'Space Grotesk', sans-serif;
}

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body-font);
}

#app {
  width: 100%; height: 100%;
  position: relative;
}

/* ─── BRAIN CANVAS ─── */
#brain-canvas {
  position: fixed;
  inset: 0;
  z-index: 1;
  cursor: crosshair;
  width: 100vw !important;
  height: 100vh !important;
}

#brain-canvas canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

/* ─── TOP BAR ─── */
#top-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: linear-gradient(to bottom, rgba(2,4,8,0.9) 0%, transparent 100%);
  pointer-events: none;
}

#logo {
  font-family: var(--mind-font);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.3em;
  color: var(--text-bright);
  text-shadow: 0 0 20px rgba(80, 100, 255, 0.6), 0 0 40px rgba(80, 100, 255, 0.3);
  pointer-events: all;
}

#logo span {
  color: #aaaaff;
  font-size: 11px;
  display: block;
  letter-spacing: 0.2em;
  margin-top: -2px;
  text-shadow: none;
  opacity: 0.7;
}

#top-controls {
  display: flex;
  gap: 10px;
  pointer-events: all;
}

.top-btn {
  background: rgba(10, 15, 30, 0.8);
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  color: var(--text-dim);
  font-family: var(--mind-font);
  font-size: 9px;
  letter-spacing: 0.15em;
  padding: 6px 12px;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
}

.top-btn:hover, .top-btn.active {
  color: var(--text-bright);
  border-color: rgba(100, 130, 255, 0.4);
  background: rgba(20, 30, 70, 0.9);
  box-shadow: 0 0 12px rgba(80, 100, 255, 0.2);
}

/* ─── STAGE INDICATOR ─── */
#stage-indicator {
  position: fixed;
  top: 68px; left: 50%; transform: translateX(-50%);
  z-index: 10;
  font-family: var(--mind-font);
  font-size: 9px;
  letter-spacing: 0.25em;
  color: var(--text-dim);
  text-transform: uppercase;
  opacity: 0.6;
  transition: opacity 0.5s;
}

/* ─── ACTIVITY FEED ─── */
#activity-feed {
  position: fixed;
  top: 80px; left: 20px;
  z-index: 10;
  width: 220px;
  max-height: 60vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 0;
  pointer-events: none;
}

.feed-item {
  font-family: var(--mind-font);
  font-size: 9px;
  line-height: 1.6;
  color: var(--text-dim);
  padding: 4px 8px;
  border-left: 2px solid transparent;
  transition: all 0.3s;
  letter-spacing: 0.05em;
  animation: feedIn 0.3s ease;
}

.feed-item.new {
  color: var(--text);
  border-left-color: rgba(80, 100, 255, 0.5);
}

@keyframes feedIn {
  from { opacity: 0; transform: translateX(-8px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ─── EMOTIONAL STATE DISPLAY ─── */
#state-display {
  position: fixed;
  top: 80px; right: 20px;
  z-index: 10;
  width: 180px;
  background: rgba(4, 6, 15, 0.7);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  padding: 12px;
  backdrop-filter: blur(10px);
}

#state-display h4 {
  font-family: var(--mind-font);
  font-size: 9px;
  letter-spacing: 0.2em;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 10px;
}

.state-bar-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 5px;
}

.state-bar-label {
  font-family: var(--mind-font);
  font-size: 8px;
  color: var(--text-dim);
  width: 52px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.state-bar-track {
  flex: 1;
  height: 3px;
  background: rgba(255,255,255,0.05);
  border-radius: 2px;
  overflow: hidden;
}

.state-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.8s ease;
}

/* ─── CHAT INTERFACE ─── */
#chat-container {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 20;
  padding: 20px;
  background: linear-gradient(to top, rgba(2,4,8,0.98) 60%, transparent 100%);
}

#chat-history {
  max-height: 30vh;
  overflow-y: auto;
  overflow-x: hidden;
  margin-bottom: 16px;
  padding: 0 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(80,100,255,0.2) transparent;
}

#chat-history::-webkit-scrollbar { width: 3px; }
#chat-history::-webkit-scrollbar-track { background: transparent; }
#chat-history::-webkit-scrollbar-thumb { background: rgba(80,100,255,0.3); border-radius: 2px; }

.chat-message {
  margin-bottom: 16px;
  animation: msgIn 0.4s ease;
}

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

.chat-message.user .msg-content {
  font-family: var(--body-font);
  font-size: 13px;
  color: rgba(180, 190, 255, 0.7);
  font-weight: 300;
  font-style: italic;
  padding-left: 12px;
  border-left: 2px solid rgba(80, 100, 255, 0.3);
  line-height: 1.5;
}

.chat-message.mind .msg-content {
  font-family: var(--body-font);
  font-size: 14px;
  color: var(--text-bright);
  line-height: 1.7;
  font-weight: 300;
  letter-spacing: 0.01em;
}

.chat-message .msg-label {
  font-family: var(--mind-font);
  font-size: 8px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 5px;
}

.chat-message.mind .msg-label { color: rgba(120, 140, 255, 0.5); }

#input-area {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(8, 12, 24, 0.9);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 12px 16px;
  backdrop-filter: blur(20px);
  transition: border-color 0.3s;
}

#input-area:focus-within {
  border-color: rgba(80, 100, 255, 0.4);
  box-shadow: 0 0 20px rgba(80, 100, 255, 0.1);
}

#text-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-bright);
  font-family: var(--body-font);
  font-size: 14px;
  font-weight: 300;
  letter-spacing: 0.02em;
  resize: none;
  min-height: 22px;
  max-height: 100px;
  line-height: 1.5;
}

#text-input::placeholder {
  color: var(--text-dim);
  font-style: italic;
}

#voice-btn, #send-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  transition: color 0.2s;
  font-size: 16px;
}

#voice-btn:hover, #send-btn:hover { color: var(--accent); }
#voice-btn.listening { color: #ff4444; animation: pulse 0.8s ease infinite; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ─── SIDE PANEL ─── */
#side-panel {
  position: fixed;
  top: 0; right: 0;
  z-index: 30;
  width: 320px;
  height: 100vh;
  background: rgba(4, 6, 18, 0.96);
  border-left: 1px solid var(--glass-border);
  backdrop-filter: blur(20px);
  padding: 24px;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  scrollbar-width: thin;
  scrollbar-color: rgba(80,100,255,0.2) transparent;
}

#side-panel.open {
  transform: translateX(0);
}

#side-panel::-webkit-scrollbar { width: 3px; }
#side-panel::-webkit-scrollbar-thumb { background: rgba(80,100,255,0.3); }

#panel-close {
  position: absolute;
  top: 16px; right: 16px;
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 18px;
  transition: color 0.2s;
}

#panel-close:hover { color: var(--text-bright); }

#panel-region-name {
  font-family: var(--mind-font);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text-bright);
  margin-bottom: 4px;
  margin-top: 8px;
}

#panel-activation-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0;
}

#panel-activation-label {
  font-family: var(--mind-font);
  font-size: 9px;
  color: var(--text-dim);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

#panel-activation-track {
  flex: 1;
  height: 4px;
  background: rgba(255,255,255,0.07);
  border-radius: 2px;
  overflow: hidden;
}

#panel-activation-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 1s ease;
}

#panel-activation-value {
  font-family: var(--mind-font);
  font-size: 11px;
  color: var(--text);
  min-width: 32px;
  text-align: right;
}

#panel-description {
  font-family: var(--body-font);
  font-size: 13px;
  color: var(--text);
  line-height: 1.7;
  margin: 12px 0;
  font-weight: 300;
}

#panel-trigger {
  background: rgba(20, 28, 60, 0.7);
  border: 1px solid rgba(60, 80, 180, 0.15);
  border-radius: 6px;
  padding: 10px 12px;
  margin: 12px 0;
}

#panel-trigger-label {
  font-family: var(--mind-font);
  font-size: 8px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 4px;
}

#panel-trigger-words {
  font-family: var(--body-font);
  font-size: 12px;
  color: rgba(120, 160, 255, 0.8);
  font-style: italic;
}

#panel-funfact {
  border-top: 1px solid var(--glass-border);
  margin-top: 16px;
  padding-top: 16px;
}

#panel-funfact-label {
  font-family: var(--mind-font);
  font-size: 8px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(120, 180, 120, 0.5);
  margin-bottom: 6px;
}

#panel-funfact-text {
  font-family: var(--body-font);
  font-size: 12px;
  color: rgba(160, 200, 160, 0.7);
  line-height: 1.6;
  font-style: italic;
  font-weight: 300;
}

/* ─── JOURNEY PANEL ─── */
#journey-panel {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  z-index: 40;
  width: min(90vw, 560px);
  background: rgba(4, 6, 18, 0.97);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  backdrop-filter: blur(30px);
  padding: 32px;
  display: none;
}

#journey-panel.open { display: block; }

#journey-panel h2 {
  font-family: var(--mind-font);
  font-size: 13px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 24px;
}

.journey-card {
  background: rgba(12, 16, 36, 0.8);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: all 0.25s;
}

.journey-card:hover {
  border-color: rgba(100, 130, 255, 0.3);
  background: rgba(20, 28, 70, 0.9);
  transform: translateX(4px);
}

.journey-card h3 {
  font-family: var(--mind-font);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  margin-bottom: 4px;
}

.journey-card p {
  font-family: var(--body-font);
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.5;
  font-weight: 300;
}

.journey-close-btn {
  background: transparent;
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  color: var(--text-dim);
  font-family: var(--mind-font);
  font-size: 9px;
  letter-spacing: 0.15em;
  padding: 8px 16px;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 8px;
  text-transform: uppercase;
}

.journey-close-btn:hover { color: var(--text-bright); }

/* ─── JOURNEY OVERLAY ─── */
#journey-overlay {
  position: fixed;
  bottom: 100px; left: 50%; transform: translateX(-50%);
  z-index: 15;
  width: min(90vw, 600px);
  text-align: center;
  display: none;
  pointer-events: none;
}

#journey-overlay.active { display: block; }

#journey-title-display {
  font-family: var(--mind-font);
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 12px;
}

#journey-step-text {
  font-family: var(--body-font);
  font-size: 16px;
  color: var(--text-bright);
  line-height: 1.7;
  font-weight: 300;
  font-style: italic;
  letter-spacing: 0.02em;
  text-shadow: 0 0 30px rgba(80, 100, 255, 0.3);
  animation: stepFadeIn 0.8s ease;
}

#journey-progress {
  margin-top: 12px;
  font-family: var(--mind-font);
  font-size: 8px;
  letter-spacing: 0.2em;
  color: var(--text-dim);
}

#journey-stop-btn {
  pointer-events: all;
  margin-top: 12px;
  background: transparent;
  border: 1px solid rgba(80, 100, 255, 0.2);
  border-radius: 4px;
  color: var(--text-dim);
  font-family: var(--mind-font);
  font-size: 8px;
  letter-spacing: 0.15em;
  padding: 5px 12px;
  cursor: pointer;
  text-transform: uppercase;
  transition: all 0.2s;
}

#journey-stop-btn:hover { color: var(--text-bright); border-color: rgba(100, 130, 255, 0.4); }

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

/* ─── API KEY SETUP ─── */
#api-setup {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  z-index: 50;
  width: min(90vw, 480px);
  background: rgba(4, 6, 18, 0.98);
  border: 1px solid rgba(80, 100, 255, 0.3);
  border-radius: 16px;
  padding: 36px;
  text-align: center;
  backdrop-filter: blur(30px);
}

#api-setup h2 {
  font-family: var(--mind-font);
  font-size: 18px;
  letter-spacing: 0.3em;
  color: var(--text-bright);
  margin-bottom: 8px;
}

#api-setup p {
  font-family: var(--body-font);
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.7;
  margin-bottom: 24px;
  font-weight: 300;
}

#api-setup input {
  width: 100%;
  background: rgba(10, 15, 30, 0.9);
  border: 1px solid rgba(80, 100, 255, 0.2);
  border-radius: 8px;
  color: var(--text-bright);
  font-family: var(--mind-font);
  font-size: 12px;
  padding: 12px 16px;
  outline: none;
  margin-bottom: 12px;
  letter-spacing: 0.05em;
  transition: border-color 0.2s;
}

#api-setup input:focus { border-color: rgba(100, 130, 255, 0.5); }

.setup-btn {
  width: 100%;
  background: rgba(40, 60, 150, 0.8);
  border: 1px solid rgba(80, 120, 255, 0.4);
  border-radius: 8px;
  color: var(--text-bright);
  font-family: var(--mind-font);
  font-size: 11px;
  letter-spacing: 0.2em;
  padding: 14px;
  cursor: pointer;
  transition: all 0.25s;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.setup-btn:hover {
  background: rgba(60, 90, 200, 0.9);
  box-shadow: 0 0 20px rgba(80, 100, 255, 0.3);
}

.setup-btn.secondary {
  background: transparent;
  border-color: var(--glass-border);
  color: var(--text-dim);
  font-size: 9px;
}

#api-setup .model-select {
  width: 100%;
  background: rgba(10, 15, 30, 0.9);
  border: 1px solid rgba(80, 100, 255, 0.2);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--mind-font);
  font-size: 11px;
  padding: 10px 16px;
  outline: none;
  margin-bottom: 12px;
  letter-spacing: 0.05em;
  appearance: none;
}

/* ─── MODE INDICATOR ─── */
#mode-indicator {
  position: fixed;
  top: 50%; right: 20px;
  transform: translateY(-50%);
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mode-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: rgba(80, 100, 255, 0.15);
  border: 1px solid rgba(80, 100, 255, 0.15);
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
}

.mode-dot:hover::after {
  content: attr(data-label);
  position: absolute;
  right: 16px; top: 50%;
  transform: translateY(-50%);
  white-space: nowrap;
  font-family: var(--mind-font);
  font-size: 8px;
  color: var(--text-dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.mode-dot.active {
  background: rgba(80, 100, 255, 0.6);
  border-color: rgba(120, 150, 255, 0.6);
  box-shadow: 0 0 8px rgba(80, 100, 255, 0.4);
}

/* ─── LOADING ─── */
#loading {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  transition: opacity 0.8s ease;
}

#loading.fade {
  opacity: 0;
  pointer-events: none;
}

#loading-logo {
  font-family: var(--mind-font);
  font-size: 42px;
  font-weight: 700;
  letter-spacing: 0.4em;
  color: var(--text-bright);
  text-shadow: 0 0 40px rgba(80, 100, 255, 0.5);
}

#loading-sub {
  font-family: var(--mind-font);
  font-size: 9px;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--text-dim);
}

#loading-bar {
  width: 200px;
  height: 1px;
  background: rgba(255,255,255,0.05);
  border-radius: 1px;
  overflow: hidden;
}

#loading-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  width: 0%;
  transition: width 0.3s ease;
  box-shadow: 0 0 8px rgba(80, 100, 255, 0.6);
}

/* ─── TYPING INDICATOR ─── */
.typing-cursor {
  display: inline-block;
  width: 2px; height: 14px;
  background: rgba(120, 150, 255, 0.8);
  margin-left: 2px;
  vertical-align: middle;
  animation: blink 0.8s step-end infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* ─── MEMORY RETRIEVAL FLASH ─── */
.memory-flash {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  z-index: 20;
  background: rgba(255, 170, 0, 0.08);
  border: 1px solid rgba(255, 170, 0, 0.2);
  border-radius: 8px;
  padding: 10px 20px;
  font-family: var(--mind-font);
  font-size: 9px;
  letter-spacing: 0.15em;
  color: rgba(255, 200, 80, 0.7);
  text-transform: uppercase;
  animation: flashIn 0.3s ease, flashOut 0.5s ease 2s forwards;
  pointer-events: none;
}

@keyframes flashIn {
  from { opacity: 0; transform: translate(-50%, -45%); }
  to { opacity: 1; transform: translate(-50%, -50%); }
}

@keyframes flashOut {
  to { opacity: 0; }
}

/* ─── SCROLLBAR ─── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(80,100,255,0.2); border-radius: 2px; }

/* ─── VIGNETTE OVERLAY ─── */
#app::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: radial-gradient(
    ellipse at 50% 50%,
    transparent 40%,
    rgba(2, 4, 8, 0.5) 70%,
    rgba(2, 4, 8, 0.9) 100%
  );
}

/* ─── MOBILE ─── */
@media (max-width: 768px) {
  #activity-feed { display: none; }
  #state-display { display: none; }
  #side-panel { width: 100vw; }
  #journey-step-text { font-size: 14px; }

  #chat-history { max-height: 25vh; }
  .chat-message.mind .msg-content { font-size: 13px; }
}

/* ─── MIRROR MODE ─── */
body.mirror-mode #top-bar { opacity: 0; }
body.mirror-mode #activity-feed { opacity: 0; }
body.mirror-mode #state-display { opacity: 0; }
body.mirror-mode #chat-container { opacity: 0; pointer-events: none; }
body.mirror-mode #chat-container.show { opacity: 1; pointer-events: all; }
body.mirror-mode .top-btn { opacity: 0.3; }
body.mirror-mode .top-btn:hover { opacity: 1; }

/* ═══════════════════════════════════════
   ONBOARDING — 4-Screen Birth Sequence
   ═══════════════════════════════════════ */

/* Container — full-screen overlay above brain, below nothing */
#onboarding {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: all;
  transition: opacity 0.8s ease;
}

#onboarding.hidden {
  opacity: 0;
  pointer-events: none;
}

/* Dark veil — semi-transparent so brain breathes behind */
.ob-veil {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse at 50% 50%,
    rgba(2, 4, 10, 0.72) 0%,
    rgba(2, 4, 10, 0.88) 100%
  );
  pointer-events: none;
}

/* ─── Screen wrapper ─── */
.ob-screen {
  position: relative;
  z-index: 1;
  width: min(90vw, 560px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  animation: obScreenIn 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}

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

/* ─── Screen label (e.g., "AWAKENING") ─── */
.ob-screen-label {
  font-family: var(--mind-font);
  font-size: 7px;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: rgba(80, 100, 255, 0.3);
  margin-bottom: 32px;
  text-align: center;
}

/* ─── Output text area ─── */
.ob-output {
  font-family: var(--body-font);
  font-size: 18px;
  font-weight: 300;
  line-height: 1.8;
  color: var(--text-bright);
  text-align: center;
  letter-spacing: 0.01em;
  min-height: 3.6em;
  max-width: 480px;
  margin-bottom: 40px;
  text-shadow: 0 0 30px rgba(80, 100, 255, 0.15);
  transition: opacity 0.4s;
}

.ob-output.loading {
  opacity: 0.4;
}

/* ─── Input field ─── */
.ob-input-wrap {
  width: 100%;
  max-width: 480px;
  position: relative;
  animation: obInputIn 0.5s 0.3s ease both;
}

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

.ob-input {
  width: 100%;
  background: rgba(8, 12, 28, 0.7);
  border: 1px solid rgba(80, 100, 255, 0.18);
  border-radius: 10px;
  color: var(--text-bright);
  font-family: var(--body-font);
  font-size: 15px;
  font-weight: 300;
  padding: 16px 52px 16px 20px;
  outline: none;
  resize: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  backdrop-filter: blur(12px);
  line-height: 1.6;
  letter-spacing: 0.01em;
}

.ob-input::placeholder {
  color: rgba(80, 100, 200, 0.25);
  font-style: italic;
}

.ob-input:focus {
  border-color: rgba(100, 130, 255, 0.4);
  box-shadow: 0 0 20px rgba(80, 100, 255, 0.08);
}

/* Send arrow */
.ob-send {
  position: absolute;
  right: 14px; top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: rgba(100, 130, 255, 0.4);
  cursor: pointer;
  transition: color 0.2s;
  padding: 4px;
  line-height: 1;
}

.ob-send:hover { color: rgba(120, 160, 255, 0.9); }

/* ─── Screen 2 action buttons ─── */
.ob-actions {
  display: flex;
  gap: 14px;
  margin-top: 8px;
  animation: obInputIn 0.5s 0.6s ease both;
}

.ob-btn {
  background: transparent;
  border: 1px solid rgba(80, 100, 255, 0.2);
  border-radius: 8px;
  color: var(--text-dim);
  font-family: var(--mind-font);
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 10px 24px;
  cursor: pointer;
  transition: all 0.25s;
}

.ob-btn:hover {
  color: var(--text-bright);
  border-color: rgba(100, 130, 255, 0.5);
  box-shadow: 0 0 14px rgba(80, 100, 255, 0.12);
}

.ob-btn.primary {
  background: rgba(40, 60, 150, 0.6);
  border-color: rgba(80, 120, 255, 0.4);
  color: rgba(200, 220, 255, 0.85);
}

.ob-btn.primary:hover {
  background: rgba(60, 90, 200, 0.8);
  box-shadow: 0 0 20px rgba(80, 100, 255, 0.2);
}

/* ─── Hint text below input ─── */
.ob-hint {
  font-family: var(--mind-font);
  font-size: 7px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(80, 100, 200, 0.25);
  margin-top: 14px;
  text-align: center;
  animation: obInputIn 0.4s 0.5s ease both;
}

/* ─── Trust score line (post-sequence) ─── */
.ob-trust-line {
  font-family: var(--mind-font);
  font-size: 8px;
  letter-spacing: 0.2em;
  color: rgba(80, 180, 120, 0.35);
  margin-top: 20px;
  text-transform: uppercase;
  text-align: center;
  animation: obInputIn 0.4s 0.8s ease both;
}

/* ─── Progress dots ─── */
.ob-progress {
  display: flex;
  gap: 8px;
  margin-bottom: 28px;
}

.ob-dot {
  width: 4px; height: 4px;
  border-radius: 50%;
  background: rgba(80, 100, 255, 0.15);
  border: 1px solid rgba(80, 100, 255, 0.15);
  transition: all 0.4s;
}

.ob-dot.active {
  background: rgba(80, 100, 255, 0.6);
  box-shadow: 0 0 6px rgba(80, 100, 255, 0.4);
}

.ob-dot.done {
  background: rgba(80, 180, 100, 0.4);
  border-color: rgba(80, 180, 100, 0.4);
}

/* ─── Pulse on brain while onboarding ─── */
.ob-brain-pulse {
  animation: obBrainPulse 3s ease-in-out infinite;
}

@keyframes obBrainPulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1.0; }
}

/* ─── Transition flash when entering main app ─── */
.ob-transition-flash {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(80, 100, 255, 0.06);
  pointer-events: none;
  animation: obFlash 1.2s ease forwards;
}

@keyframes obFlash {
  0% { opacity: 0; }
  30% { opacity: 1; }
  100% { opacity: 0; }
}

/* ─── Skip-to-share reveal ─── */
.ob-share-reveal {
  animation: obShareIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes obShareIn {
  from { opacity: 0; transform: scale(0.97) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* ─── Mobile ─── */
@media (max-width: 768px) {
  .ob-output { font-size: 15px; }
  .ob-input  { font-size: 14px; }
}
