/* ═══════════════════════════════════════════════════════════════
   ETHEREAL INSIGHTS — Visual Design System v2.0
   "On the razor between science and wonder"
═══════════════════════════════════════════════════════════════ */

/* ── Fonts ─────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&family=Rajdhani:wght@400;500;600;700&family=Orbitron:wght@400;700;900&display=swap');

/* ── Design Tokens ─────────────────────────────────────────── */
:root {
  --void:        #03060f;
  --deep:        #070d1a;
  --surface:     #0c1526;
  --surface2:    #111e33;
  --border:      rgba(0, 245, 212, 0.12);
  --border-bright: rgba(0, 245, 212, 0.35);

  --teal:        #00f5d4;
  --teal-dim:    rgba(0, 245, 212, 0.15);
  --teal-glow:   rgba(0, 245, 212, 0.4);
  --purple:      #9d4edd;
  --purple-dim:  rgba(157, 78, 221, 0.15);
  --purple-glow: rgba(157, 78, 221, 0.45);
  --red:         #ff3060;
  --red-dim:     rgba(255, 48, 96, 0.15);
  --red-glow:    rgba(255, 48, 96, 0.45);
  --amber:       #ffd60a;
  --amber-dim:   rgba(255, 214, 10, 0.15);
  --blue:        #4488ff;
  --blue-dim:    rgba(68, 136, 255, 0.15);

  --text-primary:   #e8f4f0;
  --text-secondary: #7a9eaa;
  --text-dim:       #3d5a66;

  --nav-h: 70px;
  --header-h: 60px;
  --radius: 12px;
  --radius-sm: 8px;

  --font-data: 'Share Tech Mono', monospace;
  --font-label: 'Rajdhani', sans-serif;
  --font-brand: 'Orbitron', monospace;
}

/* ── Reset & Base ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body, #root {
  height: 100%;
  width: 100%;
  overflow: hidden;
  background: var(--void);
}

body {
  font-family: var(--font-label);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}

/* ── Animated Background ────────────────────────────────────── */
.app-shell {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  overflow: hidden;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(157, 78, 221, 0.08) 0%, transparent 70%),
    radial-gradient(ellipse 60% 40% at 20% 80%, rgba(0, 245, 212, 0.05) 0%, transparent 60%),
    var(--void);
}

/* Scanline overlay */
.app-shell::before {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.04) 2px,
    rgba(0, 0, 0, 0.04) 4px
  );
  pointer-events: none;
  z-index: 100;
}

/* ── App Layout ─────────────────────────────────────────────── */
.app-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  padding-bottom: 8px;
}

/* Scrollbar styling */
.app-content::-webkit-scrollbar { width: 3px; }
.app-content::-webkit-scrollbar-track { background: transparent; }
.app-content::-webkit-scrollbar-thumb { background: var(--teal-dim); border-radius: 2px; }

/* ── Screen Base ────────────────────────────────────────────── */
.screen {
  min-height: calc(100vh - var(--nav-h) - 8px);
  padding: 0 0 16px 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ── Screen Headers ─────────────────────────────────────────── */
.screen-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(0,245,212,0.04) 0%, transparent 100%);
}

.screen-header-simple {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 10px;
  border-bottom: 1px solid var(--border);
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-orb {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--teal) 0%, var(--purple) 60%, transparent 100%);
  box-shadow: 0 0 20px var(--teal-glow), 0 0 40px var(--purple-glow);
  animation: orb-pulse 3s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes orb-pulse {
  0%, 100% { box-shadow: 0 0 20px var(--teal-glow), 0 0 40px var(--purple-glow); }
  50% { box-shadow: 0 0 35px var(--teal-glow), 0 0 60px var(--purple-glow), 0 0 80px rgba(0,245,212,0.15); }
}

.app-title {
  font-family: var(--font-brand);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--teal);
  text-shadow: 0 0 12px var(--teal-glow);
}

.app-subtitle {
  font-family: var(--font-data);
  font-size: 10px;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
  margin-top: 1px;
}

.screen-title {
  font-family: var(--font-brand);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--teal);
  text-shadow: 0 0 10px var(--teal-glow);
}

/* ── Status Badges ──────────────────────────────────────────── */
.status-badge {
  font-family: var(--font-data);
  font-size: 10px;
  letter-spacing: 0.1em;
  padding: 5px 10px;
  border-radius: 20px;
  border: 1px solid;
}

.status-active {
  color: var(--red);
  border-color: var(--red);
  background: var(--red-dim);
  animation: badge-blink 1.5s ease-in-out infinite;
}

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

.status-idle {
  color: var(--teal);
  border-color: var(--border-bright);
  background: var(--teal-dim);
}

/* ── HUD Grid ───────────────────────────────────────────────── */
.hud-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 0 12px;
}

.hud-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.3s;
}

.hud-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--teal-glow), transparent);
}

.hud-label {
  font-family: var(--font-data);
  font-size: 9px;
  letter-spacing: 0.15em;
  color: var(--text-secondary);
  margin-bottom: 4px;
  text-transform: uppercase;
}

.hud-value {
  font-family: var(--font-data);
  font-size: 20px;
  font-weight: bold;
  line-height: 1;
  margin-bottom: 4px;
}

.hud-sub {
  font-size: 9px;
  color: var(--text-dim);
  font-family: var(--font-data);
  letter-spacing: 0.05em;
}

.value-critical { color: var(--red); text-shadow: 0 0 10px var(--red-glow); }
.value-normal   { color: var(--teal); text-shadow: 0 0 8px var(--teal-glow); }
.value-quantum  { color: var(--purple); text-shadow: 0 0 8px var(--purple-glow); }
.value-sensor   { color: var(--blue); text-shadow: 0 0 8px rgba(68,136,255,0.5); }
.value-amber    { color: var(--amber); text-shadow: 0 0 8px rgba(255,214,10,0.4); }

/* ── Sensor Panel ───────────────────────────────────────────── */
.sensor-panel {
  margin: 0 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
}

.panel-title {
  font-family: var(--font-data);
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--text-secondary);
  margin-bottom: 12px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.sensor-bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  min-height: 28px;
}

.sensor-bar-label {
  font-family: var(--font-data);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  width: 52px;
  flex-shrink: 0;
}

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

.sensor-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
  position: relative;
}

.sensor-bar-fill::after {
  content: '';
  position: absolute;
  right: 0; top: -1px; bottom: -1px;
  width: 3px;
  background: inherit;
  filter: brightness(2);
  border-radius: 2px;
}

.sensor-bar-value {
  font-family: var(--font-data);
  font-size: 11px;
  width: 62px;
  text-align: right;
  flex-shrink: 0;
}

/* ── Anomaly Cards ──────────────────────────────────────────── */
.anomaly-list {
  margin: 0 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.anomaly-card {
  border-left: 3px solid var(--teal);
  background: var(--surface2);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 10px 12px;
  transition: background 0.2s;
}

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

.anomaly-icon { font-size: 14px; }

.anomaly-type {
  font-family: var(--font-data);
  font-size: 11px;
  font-weight: bold;
  letter-spacing: 0.1em;
  flex: 1;
}

.anomaly-sev {
  font-family: var(--font-data);
  font-size: 9px;
  letter-spacing: 0.1em;
  padding: 2px 6px;
  border-radius: 3px;
  color: var(--void);
  font-weight: bold;
}

.anomaly-time {
  font-family: var(--font-data);
  font-size: 9px;
  color: var(--text-dim);
}

.anomaly-desc, .anomaly-desc-compact {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-top: 4px;
}

.anomaly-score {
  font-family: var(--font-data);
  font-size: 10px;
  color: var(--text-dim);
  margin-top: 6px;
}

/* ── Quick Actions ──────────────────────────────────────────── */
.quick-actions {
  display: flex;
  gap: 8px;
  padding: 0 12px;
}

.action-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px 8px;
  border-radius: var(--radius);
  border: 1px solid;
  font-family: var(--font-data);
  font-size: 11px;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
  min-height: 48px;
}

.action-btn.primary {
  background: linear-gradient(135deg, rgba(0,245,212,0.15), rgba(157,78,221,0.1));
  border-color: var(--teal);
  color: var(--teal);
  text-shadow: 0 0 8px var(--teal-glow);
  box-shadow: 0 0 20px rgba(0,245,212,0.1);
}

.action-btn.primary:active {
  background: rgba(0,245,212,0.25);
  box-shadow: 0 0 30px var(--teal-glow);
}

.action-btn.secondary {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text-secondary);
}

.action-btn.secondary:active {
  background: var(--surface2);
  border-color: var(--border-bright);
  color: var(--teal);
}

/* ── Scanner Screen ─────────────────────────────────────────── */
.scanner-screen { gap: 10px; }

.visualizer-container {
  position: relative;
  height: 220px;
  margin: 0 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  background: var(--void);
}

.visualizer-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.scan-toggle {
  font-family: var(--font-data);
  font-size: 12px;
  letter-spacing: 0.15em;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid;
  cursor: pointer;
  transition: all 0.2s;
  min-height: 44px;
  min-width: 80px;
  -webkit-tap-highlight-color: transparent;
}

.scan-on {
  background: rgba(255, 48, 96, 0.15);
  border-color: var(--red);
  color: var(--red);
  box-shadow: 0 0 15px var(--red-dim);
}

.scan-off {
  background: rgba(0, 245, 212, 0.15);
  border-color: var(--teal);
  color: var(--teal);
  box-shadow: 0 0 15px var(--teal-dim);
}

.scan-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-data);
  font-size: 12px;
  letter-spacing: 0.2em;
  color: var(--teal);
  text-shadow: 0 0 10px var(--teal-glow);
}

.scan-pulse {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 10px var(--teal-glow);
  animation: pulse-dot 1s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.5); opacity: 0.5; }
}

.scan-idle {
  font-family: var(--font-data);
  font-size: 12px;
  letter-spacing: 0.2em;
  color: var(--text-dim);
}

/* ── Bell Meter ─────────────────────────────────────────────── */
.bell-meter {
  margin: 0 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
}

.bell-label {
  font-family: var(--font-data);
  font-size: 10px;
  letter-spacing: 0.15em;
  color: var(--text-secondary);
  margin-bottom: 10px;
  text-transform: uppercase;
}

.bell-track {
  position: relative;
  height: 28px;
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  margin-bottom: 8px;
}

.bell-classical {
  background: linear-gradient(90deg, var(--blue-dim), rgba(68,136,255,0.08));
  display: flex;
  align-items: center;
  justify-content: center;
  border-right: 2px solid rgba(68,136,255,0.4);
}

.bell-classical span {
  font-family: var(--font-data);
  font-size: 9px;
  color: var(--blue);
  letter-spacing: 0.05em;
}

.bell-quantum {
  background: linear-gradient(90deg, rgba(157,78,221,0.08), var(--purple-dim));
  display: flex;
  align-items: center;
  justify-content: center;
}

.bell-quantum span {
  font-family: var(--font-data);
  font-size: 9px;
  color: var(--purple);
  letter-spacing: 0.05em;
}

.bell-marker {
  position: absolute;
  top: 0; bottom: 0;
  width: 3px;
  background: var(--teal);
  box-shadow: 0 0 8px var(--teal-glow), 0 0 16px var(--teal-glow);
  transition: left 0.6s ease;
  border-radius: 2px;
}

.bell-value {
  font-family: var(--font-data);
  font-size: 14px;
  color: var(--teal);
  text-shadow: 0 0 8px var(--teal-glow);
  text-align: center;
}

/* ── Anomaly Feed ────────────────────────────────────────────── */
.anomaly-feed {
  margin: 0 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.empty-feed {
  font-family: var(--font-data);
  font-size: 11px;
  color: var(--text-dim);
  text-align: center;
  padding: 20px;
  letter-spacing: 0.1em;
}

/* ── Echo Screen ─────────────────────────────────────────────── */
.echo-screen {
  height: calc(100vh - var(--nav-h));
  min-height: 0;
  overflow: hidden;
}

.echo-title-area {
  display: flex;
  align-items: center;
  gap: 10px;
}

.echo-orb {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--purple) 0%, var(--teal) 70%, transparent 100%);
  box-shadow: 0 0 15px var(--purple-glow);
  animation: orb-pulse 2.5s ease-in-out infinite;
  flex-shrink: 0;
}

.echo-subtitle {
  font-family: var(--font-data);
  font-size: 9px;
  color: var(--text-secondary);
  letter-spacing: 0.1em;
  margin-top: 2px;
}

.echo-status {
  font-family: var(--font-data);
  font-size: 11px;
  color: var(--teal);
  letter-spacing: 0.1em;
  animation: badge-blink 2s ease-in-out infinite;
}

.chat-container {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}

.chat-container::-webkit-scrollbar { width: 2px; }
.chat-container::-webkit-scrollbar-thumb { background: var(--border); }

.chat-bubble {
  display: flex;
  gap: 8px;
  animation: bubble-in 0.3s ease;
}

@keyframes bubble-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.bubble-echo { align-self: flex-start; max-width: 90%; }
.bubble-user { align-self: flex-end; flex-direction: row-reverse; max-width: 88%; }

.bubble-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--purple), var(--teal));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
  box-shadow: 0 0 10px var(--purple-glow);
}

.bubble-content {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.bubble-name {
  font-family: var(--font-data);
  font-size: 9px;
  letter-spacing: 0.15em;
  color: var(--purple);
  text-shadow: 0 0 6px var(--purple-glow);
}

.bubble-text {
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.6;
}

.bubble-echo .bubble-text {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: 4px 12px 12px 12px;
}

.bubble-user .bubble-text {
  background: linear-gradient(135deg, rgba(0,245,212,0.15), rgba(157,78,221,0.1));
  border: 1px solid var(--border-bright);
  color: var(--teal);
  border-radius: 12px 4px 12px 12px;
}

.bubble-time {
  font-family: var(--font-data);
  font-size: 9px;
  color: var(--text-dim);
  padding: 0 4px;
}

.thinking-dots {
  display: flex;
  gap: 5px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px 12px 12px 12px;
}

.thinking-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--purple);
  animation: dot-bounce 1.2s ease-in-out infinite;
}

.thinking-dots span:nth-child(2) { animation-delay: 0.2s; }
.thinking-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dot-bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
  40% { transform: translateY(-8px); opacity: 1; }
}

.chat-input-area {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  background: var(--deep);
  flex-shrink: 0;
}

.chat-input {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-family: var(--font-label);
  font-size: 14px;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.2s;
  -webkit-appearance: none;
  min-height: 48px;
}

.chat-input::placeholder { color: var(--text-dim); }
.chat-input:focus { border-color: var(--teal); box-shadow: 0 0 12px var(--teal-dim); }

.send-btn {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--teal-dim), var(--purple-dim));
  border: 1px solid var(--teal);
  color: var(--teal);
  font-size: 18px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

.send-btn:active {
  background: var(--teal-dim);
  box-shadow: 0 0 20px var(--teal-glow);
}

/* ── EVP Screen ──────────────────────────────────────────────── */
.waveform-container {
  height: 100px;
  margin: 0 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  background: var(--void);
}

.evp-controls {
  margin: 0 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.record-btn {
  width: 100%;
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid;
  font-family: var(--font-data);
  font-size: 14px;
  letter-spacing: 0.15em;
  cursor: pointer;
  transition: all 0.2s;
  min-height: 56px;
  -webkit-tap-highlight-color: transparent;
  background: var(--surface);
  border-color: var(--teal);
  color: var(--teal);
  box-shadow: 0 0 15px var(--teal-dim);
}

.record-btn.recording {
  background: var(--red-dim);
  border-color: var(--red);
  color: var(--red);
  box-shadow: 0 0 20px var(--red-glow);
  animation: badge-blink 1s ease-in-out infinite;
}

.record-btn:active { transform: scale(0.98); }

.evp-info {
  font-family: var(--font-data);
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.1em;
  text-align: center;
}

.evp-badge, .qhud-badge {
  font-family: var(--font-data);
  font-size: 10px;
  letter-spacing: 0.1em;
  padding: 5px 10px;
  border-radius: 20px;
  border: 1px solid var(--purple);
  color: var(--purple);
  background: var(--purple-dim);
}

/* ── Entropy Panel ───────────────────────────────────────────── */
.entropy-panel {
  margin: 0 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
}

.entropy-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.02);
  transition: background 0.2s;
}

.entropy-row.entropy-flagged {
  background: var(--red-dim);
  border: 1px solid rgba(255,48,96,0.2);
}

.entropy-label {
  font-family: var(--font-data);
  font-size: 10px;
  color: var(--text-secondary);
  width: 64px;
  flex-shrink: 0;
}

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

.entropy-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease;
}

.entropy-value {
  font-family: var(--font-data);
  font-size: 11px;
  width: 32px;
  text-align: right;
  flex-shrink: 0;
}

.entropy-flag {
  font-family: var(--font-data);
  font-size: 9px;
  color: var(--red);
  letter-spacing: 0.1em;
  flex-shrink: 0;
}

/* ── Sessions Screen ─────────────────────────────────────────── */
.sessions-list {
  padding: 0 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.session-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  transition: border-color 0.2s;
}

.session-card.session-active {
  border-color: var(--teal);
  box-shadow: 0 0 20px var(--teal-dim), inset 0 0 30px rgba(0,245,212,0.03);
}

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

.session-name {
  font-family: var(--font-label);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.session-status {
  font-family: var(--font-data);
  font-size: 10px;
  letter-spacing: 0.1em;
  padding: 3px 8px;
  border-radius: 12px;
}

.status-active { /* already defined above */ }

.status-done {
  color: var(--text-secondary);
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
}

.session-meta {
  display: flex;
  gap: 12px;
  font-family: var(--font-data);
  font-size: 10px;
  color: var(--text-secondary);
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.meta-critical { color: var(--red); }
.meta-warn { color: var(--amber); }

.session-bar {
  height: 4px;
  background: rgba(255,255,255,0.05);
  border-radius: 2px;
  overflow: hidden;
}

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

.new-session-btn {
  font-family: var(--font-data);
  font-size: 12px;
  letter-spacing: 0.1em;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  background: var(--teal-dim);
  border: 1px solid var(--teal);
  color: var(--teal);
  cursor: pointer;
  min-height: 44px;
  -webkit-tap-highlight-color: transparent;
}

/* ── Quantum HUD Screen ──────────────────────────────────────── */
.qhud-main {
  padding: 0 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.qhud-orb-container {
  display: flex;
  justify-content: center;
  padding: 20px 0 10px;
}

.qhud-orb {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%,
    rgba(0,245,212,0.3) 0%,
    rgba(157,78,221,0.2) 40%,
    rgba(0,0,0,0.5) 100%);
  border: 1px solid var(--border-bright);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: box-shadow 0.5s ease;
  animation: orb-rotate 8s linear infinite;
}

@keyframes orb-rotate {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.qhud-orb-value {
  font-family: var(--font-data);
  font-size: 28px;
  font-weight: bold;
  color: var(--teal);
  text-shadow: 0 0 20px var(--teal-glow);
  line-height: 1;
}

.qhud-orb-label {
  font-family: var(--font-data);
  font-size: 10px;
  color: var(--text-secondary);
  letter-spacing: 0.2em;
  margin-top: 4px;
}

.qhud-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.qhud-metric {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
}

.qhud-metric-label {
  font-family: var(--font-data);
  font-size: 9px;
  color: var(--text-dim);
  letter-spacing: 0.1em;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.qhud-metric-value {
  font-family: var(--font-data);
  font-size: 14px;
  font-weight: bold;
}

.qhud-explanation {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.qhud-explanation p {
  font-size: 12px;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-top: 10px;
}

.qhud-explanation em {
  color: var(--teal);
  font-style: normal;
}

/* ── Bottom Navigation ───────────────────────────────────────── */
.navbar {
  height: var(--nav-h);
  display: flex;
  align-items: stretch;
  background: var(--deep);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  position: relative;
  z-index: 50;
}

.navbar::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--teal-glow), var(--purple-glow), transparent);
}

.nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: transparent;
  border: none;
  cursor: pointer;
  position: relative;
  transition: all 0.2s;
  padding: 8px 4px;
  -webkit-tap-highlight-color: transparent;
  min-width: 44px;
}

.nav-btn:active { background: rgba(255,255,255,0.03); }

.nav-icon {
  font-size: 18px;
  line-height: 1;
  transition: all 0.2s;
  display: block;
}

.nav-label {
  font-family: var(--font-data);
  font-size: 8px;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  transition: color 0.2s;
  display: block;
}

.nav-active .nav-icon {
  text-shadow: 0 0 12px var(--teal-glow);
  transform: translateY(-1px);
}

.nav-active .nav-label {
  color: var(--teal);
}

.nav-active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 20%;
  right: 20%;
  height: 2px;
  background: var(--teal);
  box-shadow: 0 0 8px var(--teal-glow);
  border-radius: 2px 2px 0 0;
}

.nav-badge {
  position: absolute;
  top: 8px;
  right: 12px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--red);
  color: white;
  font-family: var(--font-data);
  font-size: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 8px var(--red-glow);
  animation: badge-blink 2s ease-in-out infinite;
}

/* ── Glow Animations ─────────────────────────────────────────── */
@keyframes glow-pulse {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

/* ── Touch Feedback & Accessibility ──────────────────────────────── */
button {
  -webkit-tap-highlight-color: transparent;
  outline: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -webkit-appearance: none;
  font-weight: inherit;
  font-family: inherit;
}

input {
  outline: none;
  -webkit-appearance: none;
  -webkit-autocorrect: off;
  -webkit-autocapitalize: off;
}

/* Button active state for touch devices */
button:active {
  opacity: 0.85;
}

/* Prevent text selection on long press */
button, a {
  -webkit-user-select: none;
  user-select: none;
}

/* Focus visible for keyboard navigation */
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

/* ── Micro-animations ────────────────────────────────────────── */
.screen > * {
  animation: fade-up 0.25s ease both;
}

.screen > *:nth-child(1) { animation-delay: 0ms; }
.screen > *:nth-child(2) { animation-delay: 40ms; }
.screen > *:nth-child(3) { animation-delay: 80ms; }
.screen > *:nth-child(4) { animation-delay: 120ms; }
.screen > *:nth-child(5) { animation-delay: 160ms; }

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

@keyframes fade-in-down {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── LANDING SCREEN ──────────────────────────────────────── */
.landing-screen {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: #04040c; overflow: hidden;
}
.landing-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.landing-content {
  position: relative; z-index: 10;
  display: flex; flex-direction: column; align-items: center;
  text-align: center; padding: 24px 20px;
  opacity: 0; transform: translateY(24px);
  transition: all 0.9s cubic-bezier(0.16, 1, 0.3, 1);
  max-width: 100%;
}
.landing-content.landing-visible { opacity: 1; transform: translateY(0); }
.landing-logo-orb {
  width: 72px; height: 72px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #00ffaa, #0066ff 50%, #aa00ff);
  box-shadow: 0 0 40px rgba(0,255,170,0.5), 0 0 80px rgba(170,0,255,0.25);
  margin-bottom: 20px;
  animation: orb-pulse 2.5s ease-in-out infinite, orb-float 4s ease-in-out infinite;
  position: relative;
}
.landing-eyebrow {
  font-family: 'Share Tech Mono', monospace;
  font-size: 9px;
  color: var(--teal);
  letter-spacing: 3px;
  margin-bottom: 14px;
  opacity: 0.65;
  animation: fade-in-down 0.8s ease 0.1s both;
}

.landing-title {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(38px, 12vw, 68px);
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: 4px;
  margin: 0 0 18px;
  background: linear-gradient(135deg, #00ffaa 0%, #4488ff 50%, #aa44ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 24px rgba(0,255,170,0.3));
  animation: fade-in-down 0.8s ease 0.2s both;
}

.landing-subtitle {
  font-family: 'Rajdhani', sans-serif;
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.65;
  margin-bottom: 28px;
  max-width: 300px;
  animation: fade-in-down 0.8s ease 0.3s both;
}
.landing-features {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 36px;
  max-width: 340px;
  animation: fade-in-down 0.8s ease 0.4s both;
}

.feature-pill {
  background: rgba(0,255,170,0.05);
  border: 1px solid rgba(0,255,170,0.2);
  color: var(--teal);
  font-family: 'Share Tech Mono', monospace;
  font-size: 9px;
  padding: 5px 11px;
  border-radius: 20px;
  letter-spacing: 1px;
  transition: all 0.3s ease;
  cursor: default;
}

.feature-pill:hover {
  background: rgba(0,255,170,0.12);
  border-color: rgba(0,255,170,0.4);
  box-shadow: 0 0 12px rgba(0,255,170,0.15);
}

.cta-btn {
  background: linear-gradient(135deg, rgba(0,255,170,0.12), rgba(68,136,255,0.12));
  border: 2px solid var(--teal);
  color: var(--teal);
  font-family: 'Orbitron', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 4px;
  padding: 18px 48px;
  border-radius: 4px;
  cursor: pointer;
  box-shadow: 0 0 30px rgba(0,255,170,0.2), inset 0 0 30px rgba(0,255,170,0.04);
  animation: cta-pulse 2.2s ease-in-out infinite, fade-in-down 0.8s ease 0.5s both;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  min-height: 58px;
  min-width: 220px;
  position: relative;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

.cta-btn::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s ease;
}

.cta-btn:hover::before,
.cta-btn:active::before {
  left: 100%;
}

.cta-btn:hover,
.cta-btn:active {
  background: linear-gradient(135deg, rgba(0,255,170,0.22), rgba(68,136,255,0.22));
  box-shadow: 0 0 60px rgba(0,255,170,0.45), inset 0 0 30px rgba(0,255,170,0.1);
  transform: scale(1.03) translateY(-2px);
}

.cta-btn:active {
  transform: scale(0.98) translateY(0);
}

@keyframes cta-pulse {
  0%,100% { box-shadow: 0 0 30px rgba(0,255,170,0.2), inset 0 0 30px rgba(0,255,170,0.04); }
  50%      { box-shadow: 0 0 55px rgba(0,255,170,0.45), inset 0 0 30px rgba(0,255,170,0.1); }
}

@keyframes orb-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
.landing-footer {
  display: flex;
  gap: 20px;
  margin-top: 28px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 9px;
  color: rgba(255,255,255,0.18);
  letter-spacing: 2px;
  animation: fade-in-down 0.8s ease 0.6s both;
}

/* ── LOADING SCREEN ──────────────────────────────────────── */
.loading-screen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #04040c;
  padding: 24px;
  overflow: hidden;
}

.loading-screen::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(157, 78, 221, 0.05) 0%, transparent 70%),
    radial-gradient(ellipse 60% 40% at 20% 80%, rgba(0, 245, 212, 0.04) 0%, transparent 60%);
  pointer-events: none;
}

.loading-orb {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #00ffaa, #0066ff 50%, #aa00ff);
  box-shadow: 0 0 40px rgba(0,255,170,0.6), 0 0 80px rgba(170,0,255,0.3);
  animation: orb-pulse 0.9s ease-in-out infinite, orb-float 3s ease-in-out infinite;
  margin-bottom: 24px;
  position: relative;
  z-index: 10;
}

.loading-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 6px;
  color: var(--teal);
  text-shadow: 0 0 20px rgba(0,255,170,0.6);
  margin-bottom: 4px;
  position: relative;
  z-index: 10;
  animation: fade-in-down 0.6s ease both;
}

.loading-subtitle {
  font-family: 'Share Tech Mono', monospace;
  font-size: 9px;
  color: var(--text-dim);
  letter-spacing: 2px;
  margin-bottom: 40px;
  position: relative;
  z-index: 10;
  animation: fade-in-down 0.6s ease 0.1s both;
}

.loading-bar-track {
  width: 260px;
  height: 2px;
  background: rgba(255,255,255,0.06);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 16px;
  position: relative;
  z-index: 10;
  box-shadow: 0 0 12px rgba(0, 245, 212, 0.1);
}

.loading-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--teal), #4488ff, #aa44ff);
  box-shadow: 0 0 12px var(--teal), 0 0 24px rgba(68, 136, 255, 0.4);
  border-radius: 2px;
  transition: width 0.08s linear;
  position: relative;
}

.loading-bar-fill::after {
  content: '';
  position: absolute;
  right: 0;
  top: -2px;
  bottom: -2px;
  width: 8px;
  background: inherit;
  filter: brightness(1.3);
  border-radius: 1px;
  box-shadow: 0 0 12px var(--teal);
}

.loading-status {
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  color: rgba(0,255,170,0.7);
  text-align: center;
  min-height: 18px;
  animation: fade-in 0.3s ease;
  position: relative;
  z-index: 10;
  letter-spacing: 0.05em;
}

.loading-pct {
  font-family: 'Orbitron', monospace;
  font-size: 10px;
  color: var(--text-dim);
  margin-top: 8px;
  letter-spacing: 2px;
  position: relative;
  z-index: 10;
}

/* ── SPIRIT BOX ──────────────────────────────────────────── */
.sb-badge {
  background: rgba(170,68,255,0.12); border: 1px solid rgba(170,68,255,0.35);
  color: #aa44ff; font-family: 'Share Tech Mono', monospace;
  font-size: 9px; padding: 4px 10px; border-radius: 3px; letter-spacing: 2px;
}
.sb-freq-display {
  background: rgba(0,0,0,0.55); border: 1px solid rgba(0,255,170,0.12);
  border-radius: 8px; padding: 14px 16px; text-align: center; margin: 6px 0;
}
.sb-freq-label {
  font-family: 'Rajdhani', sans-serif; font-size: 9px;
  color: var(--text-dim); letter-spacing: 3px; margin-bottom: 4px;
}
.sb-freq-number {
  font-family: 'Orbitron', sans-serif; font-size: 42px; font-weight: 700;
  color: var(--teal); text-shadow: 0 0 24px rgba(0,255,170,0.7); line-height: 1;
}
.sb-freq-unit { font-size: 16px; color: var(--text-dim); }
.sb-sweep-indicator {
  font-family: 'Share Tech Mono', monospace; font-size: 10px;
  color: var(--text-dim); letter-spacing: 2px; margin-top: 6px;
}
.sb-sweep-indicator.sweep-active {
  color: var(--teal); animation: sweep-flash 0.8s ease-in-out infinite;
}
@keyframes sweep-flash { 0%,100%{opacity:1} 50%{opacity:0.4} }
.sb-canvas-container {
  position: relative; height: 110px;
  background: #000; border: 1px solid rgba(0,255,170,0.1);
  border-radius: 6px; overflow: hidden; margin: 6px 0;
}
.sb-contact-word {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.55); animation: contact-appear 0.15s ease;
}
@keyframes contact-appear { from{opacity:0;transform:scale(1.15)} to{opacity:1;transform:scale(1)} }
.sb-word-text {
  font-family: 'Orbitron', sans-serif; font-size: 30px; font-weight: 900;
  color: #fff; letter-spacing: 6px;
  text-shadow: 0 0 20px #00ffaa, 0 0 40px rgba(0,255,170,0.5);
}
.sb-word-freq {
  font-family: 'Share Tech Mono', monospace; font-size: 10px;
  color: var(--teal); margin-top: 4px; opacity: 0.7;
}
.sb-idle-overlay {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
}
.sb-idle-text {
  font-family: 'Share Tech Mono', monospace; font-size: 11px;
  color: rgba(255,255,255,0.18); letter-spacing: 3px;
}
.sb-controls { display: flex; align-items: center; gap: 10px; margin: 6px 0; }
.sb-sweep-btn {
  flex: 1; background: rgba(0,255,170,0.08);
  border: 2px solid rgba(0,255,170,0.3); color: var(--teal);
  font-family: 'Orbitron', sans-serif; font-size: 12px; font-weight: 700;
  letter-spacing: 3px; padding: 13px; border-radius: 6px; cursor: pointer;
  min-height: 48px; transition: all 0.2s;
}
.sb-sweep-btn.sweeping {
  background: rgba(255,34,68,0.12); border-color: #ff2244; color: #ff2244;
  animation: sweep-btn-pulse 1s ease-in-out infinite;
}
@keyframes sweep-btn-pulse {
  0%,100%{box-shadow:0 0 18px rgba(255,34,68,0.3)} 50%{box-shadow:0 0 36px rgba(255,34,68,0.6)}
}
.sb-rate-controls { display: flex; gap: 6px; }
.sb-rate-btn {
  width: 44px; height: 44px;
  background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.1);
  color: var(--text-dim); font-family: 'Orbitron', sans-serif;
  font-size: 11px; font-weight: 700; border-radius: 6px; cursor: pointer; transition: all 0.2s;
}
.sb-rate-btn.rate-active {
  background: rgba(68,136,255,0.12); border-color: #4488ff; color: #4488ff;
  box-shadow: 0 0 12px rgba(68,136,255,0.3);
}
.sb-log {
  background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.05);
  border-radius: 8px; padding: 10px 12px; flex: 1; overflow-y: auto;
}
.sb-log-entry {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 0; border-bottom: 1px solid rgba(255,255,255,0.04);
  animation: fade-in 0.25s ease;
}
.sb-log-word {
  font-family: 'Orbitron', sans-serif; font-size: 11px; font-weight: 700;
  color: #fff; text-shadow: 0 0 8px rgba(0,255,170,0.35); min-width: 90px;
}
.sb-log-freq { font-family: 'Share Tech Mono', monospace; font-size: 10px; color: var(--teal); flex: 1; }
.sb-log-entropy { font-family: 'Share Tech Mono', monospace; font-size: 9px; color: #aa44ff; }
.sb-log-time { font-family: 'Share Tech Mono', monospace; font-size: 9px; color: var(--text-dim); }

/* ── 7-TAB NAV OVERRIDE ──────────────────────────────────── */
.nav-label { font-size: 7px !important; letter-spacing: 0px !important; }
.nav-btn { padding: 6px 1px !important; }

/* ── MOBILE OPTIMIZATIONS ──────────────────────────────────────── */
@media (max-width: 768px) {
  .landing-title {
    font-size: clamp(36px, 11vw, 60px);
  }

  .cta-btn {
    min-width: 200px;
    padding: 16px 40px;
  }

  .hud-grid {
    grid-template-columns: 1fr;
  }

  .quick-actions {
    gap: 6px;
  }

  .action-btn {
    min-height: 44px;
  }
}

@media (max-width: 480px) {
  :root {
    --radius: 10px;
    --radius-sm: 6px;
  }

  /* Landing optimizations */
  .landing-content {
    padding: 20px 16px;
  }

  .landing-logo-orb {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
  }

  .landing-title {
    font-size: clamp(28px, 10vw, 42px);
    letter-spacing: 2px;
    margin-bottom: 14px;
  }

  .landing-subtitle {
    font-size: 12px;
    margin-bottom: 20px;
  }

  .landing-features {
    gap: 5px;
    margin-bottom: 28px;
    max-width: 100%;
  }

  .feature-pill {
    font-size: 7.5px;
    padding: 4px 8px;
    border-radius: 16px;
  }

  .cta-btn {
    padding: 14px 32px;
    font-size: 11px;
    letter-spacing: 2px;
    min-width: 160px;
    min-height: 48px;
  }

  .landing-footer {
    gap: 12px;
    font-size: 8px;
    margin-top: 20px;
  }

  /* Loading screen optimizations */
  .loading-bar-track {
    width: 220px;
  }

  .loading-title {
    font-size: 18px;
    letter-spacing: 4px;
  }

  /* Screen layout */
  .screen {
    gap: 8px;
  }

  .screen-header {
    padding: 12px 12px 10px;
  }

  .screen-header-simple {
    padding: 12px 12px 8px;
  }

  /* HUD grid and cards */
  .hud-grid {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 0 8px;
  }

  .hud-card {
    padding: 10px;
  }

  .hud-label {
    font-size: 8px;
  }

  .hud-value {
    font-size: 16px;
  }

  .hud-sub {
    font-size: 8px;
  }

  /* Panels and cards */
  .sensor-panel,
  .anomaly-list,
  .anomaly-feed,
  .entropy-panel,
  .bell-meter {
    margin: 0 8px;
    padding: 10px;
    border-radius: var(--radius-sm);
  }

  .panel-title {
    font-size: 9px;
    margin-bottom: 8px;
  }

  .sensor-bar-row {
    gap: 6px;
    margin-bottom: 8px;
    min-height: 24px;
  }

  .sensor-bar-label {
    width: 40px;
    font-size: 8px;
  }

  .sensor-bar-value {
    font-size: 10px;
    width: 55px;
  }

  .sensor-bar-track {
    height: 5px;
  }

  /* Action buttons */
  .quick-actions {
    gap: 5px;
    padding: 0 8px;
  }

  .action-btn {
    padding: 10px 6px;
    font-size: 9px;
    letter-spacing: 0.05em;
    min-height: 42px;
    gap: 4px;
  }

  /* Chat */
  .chat-bubble {
    max-width: 92%;
  }

  .chat-input {
    font-size: 13px;
    padding: 10px 12px;
    min-height: 44px;
  }

  .send-btn {
    width: 44px;
    height: 44px;
  }

  /* Quantum HUD */
  .qhud-grid {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .qhud-orb {
    width: 120px;
    height: 120px;
  }

  .qhud-orb-value {
    font-size: 24px;
  }

  .qhud-metric {
    padding: 10px;
  }

  .qhud-metric-value {
    font-size: 12px;
  }

  /* Sessions */
  .sessions-list {
    padding: 0 8px;
    gap: 8px;
  }

  .session-card {
    padding: 10px;
  }

  .session-name {
    font-size: 13px;
  }

  /* Spirit Box */
  .sb-freq-number {
    font-size: 36px;
  }

  .sb-sweep-btn,
  .sb-rate-btn {
    min-height: 44px;
  }

  .sb-log {
    padding: 8px 10px;
  }

  .sb-log-entry {
    padding: 4px 0;
    font-size: 10px;
  }

  /* EVP */
  .waveform-container {
    height: 80px;
  }

  .record-btn {
    padding: 14px;
    font-size: 12px;
    min-height: 48px;
  }

  .entropy-row {
    padding: 5px 6px;
    margin-bottom: 6px;
  }

  .entropy-label {
    font-size: 9px;
    width: 60px;
  }
}

@media (max-width: 320px) {
  .landing-title {
    font-size: 24px;
    letter-spacing: 1px;
  }

  .landing-subtitle {
    font-size: 11px;
  }

  .landing-features {
    gap: 4px;
  }

  .feature-pill {
    font-size: 7px;
    padding: 3px 6px;
  }

  .cta-btn {
    padding: 12px 24px;
    font-size: 10px;
    min-width: 140px;
  }

  .hud-grid {
    gap: 4px;
  }

  .hud-card {
    padding: 8px;
  }

  .hud-label {
    font-size: 7px;
  }

  .hud-value {
    font-size: 14px;
  }

  .quick-actions {
    gap: 4px;
  }

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

/* ── Landscape Mode Optimization ────────────────────────────────── */
@media (max-height: 500px) and (orientation: landscape) {
  .nav-btn {
    padding: 4px 2px;
  }

  .nav-label {
    font-size: 6px !important;
  }

  .screen {
    gap: 4px;
  }

  .sensor-bar-row {
    margin-bottom: 4px;
    min-height: 20px;
  }

  .action-btn {
    padding: 8px 4px;
    min-height: 38px;
  }
}
