/* ═══════════════════════════════════════════════════════════════════
   SYNAPSE ENGINE DASHBOARD — CSS
   War Room meets Elite Luxury
═══════════════════════════════════════════════════════════════════ */

:root {
  --bg:          #050508;
  --surface:     #0a0a12;
  --surface2:    #0f0f1a;
  --border:      #1e1e2e;
  --gold:        #c9a84c;
  --gold-bright: #e8c96a;
  --gold-dim:    #5a4820;
  --text:        #e8e8f0;
  --text-muted:  #6a6a8a;
  --text-dim:    #3a3a5a;
  --green:       #4cc98a;
  --red:         #c94c4c;
  --blue:        #4c8ac9;
  --amber:       #c9944c;

  --transition: 0.25s ease;
  --header-h: 100px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  line-height: 1.5;
  overflow-x: hidden;
}

/* ─── SCROLLBAR ──────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--gold-dim); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold); }

/* ─── UTILITY ────────────────────────────────────────────────────── */
.hidden { display: none !important; }

/* ═══════════════════════════════════════════════════════════════════
   LOCK SCREEN
═══════════════════════════════════════════════════════════════════ */
#lock-screen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse 80% 60% at 50% 40%, #0d0d1f 0%, var(--bg) 100%);
  overflow: hidden;
}

#neural-canvas-lock {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.lock-content {
  position: relative;
  z-index: 2;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 60px 48px;
  animation: fadeInUp 0.8s ease both;
}

.lock-brand-logo {
  width: 100px;
  height: 100px;
  object-fit: contain;
  margin-bottom: 12px;
  filter: drop-shadow(0 0 20px rgba(201, 168, 76, 0.25));
}

.lock-title-row {
  display: flex;
  align-items: center;
  gap: 20px;
  line-height: 1;
}

.lock-s-logo {
  height: clamp(44px, 8vw, 84px);
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 0 12px rgba(201, 168, 76, 0.6)) drop-shadow(0 0 28px rgba(201, 168, 76, 0.25));
  flex-shrink: 0;
}

.lock-title {
  font-family: 'Rajdhani', sans-serif;
  font-size: clamp(40px, 8vw, 80px);
  font-weight: 700;
  letter-spacing: 0.5em;
  line-height: 1;
  animation: glowPulse 3s ease-in-out infinite;
  display: flex;
  gap: 0;
}

.lock-title span {
  display: inline-block;
  margin-right: 0.45em;
}

.lock-title span:last-child { margin-right: 0; }

.lock-title span:nth-child(odd)  {
  color: var(--gold);
  text-shadow: 0 0 40px rgba(201, 168, 76, 0.45), 0 0 80px rgba(201, 168, 76, 0.18);
}
.lock-title span:nth-child(even) {
  color: #ffffff;
  text-shadow: 0 0 30px rgba(255, 255, 255, 0.25);
}

.lock-subtitle {
  font-family: 'Rajdhani', sans-serif;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.4em;
  color: #ffffff;
  text-transform: uppercase;
  margin-top: 16px;
}

.lock-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 340px;
  margin-top: 24px;
}

.lock-input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--gold-dim);
  color: var(--gold);
  font-family: 'JetBrains Mono', monospace;
  font-size: 16px;
  letter-spacing: 0.3em;
  text-align: center;
  padding: 12px 8px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.lock-input::placeholder {
  color: #ffffff;
  letter-spacing: 0.35em;
  font-weight: 800;
  font-size: 15px;
}

.lock-input:focus {
  border-bottom-color: var(--gold);
  box-shadow: 0 4px 20px rgba(201, 168, 76, 0.15);
}

.lock-input.error {
  border-bottom-color: var(--red);
  animation: errorPulse 0.5s ease;
}

.lock-error {
  font-family: 'Rajdhani', sans-serif;
  font-size: 11px;
  letter-spacing: 0.15em;
  color: var(--red);
  opacity: 0;
  transition: opacity var(--transition);
  height: 16px;
}

.lock-error.visible { opacity: 1; }

.lock-btn {
  width: 100%;
  background: transparent;
  border: 1px solid var(--gold);
  color: var(--gold);
  font-family: 'Rajdhani', sans-serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  padding: 14px 24px;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), box-shadow var(--transition);
  margin-top: 8px;
}

.lock-btn:hover {
  background: var(--gold);
  color: var(--bg);
  box-shadow: 0 0 30px rgba(201, 168, 76, 0.3);
}

.lock-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ═══════════════════════════════════════════════════════════════════
   HEADER
═══════════════════════════════════════════════════════════════════ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(5, 5, 8, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 12px 24px;
  gap: 16px;
}

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

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

.logo-hex {
  font-size: 22px;
  color: var(--gold);
  line-height: 1;
  filter: drop-shadow(0 0 8px rgba(201,168,76,0.5));
}

.logo-text {
  font-family: 'Rajdhani', sans-serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--gold);
}

.status-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'Rajdhani', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 2px;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dot-green {
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
  animation: dotPulse 2s ease-in-out infinite;
}

.dot-amber {
  background: var(--amber);
  box-shadow: 0 0 6px var(--amber);
  animation: dotPulseAmber 2s ease-in-out infinite;
}

.dot-red {
  background: var(--red);
  box-shadow: 0 0 6px var(--red);
  animation: dotPulseRed 2s ease-in-out infinite;
}

.live-clock {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 500;
  color: var(--gold);
  letter-spacing: 0.05em;
}

.operator-handle {
  font-family: 'Rajdhani', sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.15em;
  color: var(--text-muted);
}

.neural-pulse-bar {
  width: 10px;
  height: 30px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.neural-pulse-inner {
  width: 100%;
  background: var(--gold);
  animation: neuralPulse 1.8s ease-in-out infinite;
  border-radius: 2px;
}

/* ─── TAB NAV ────────────────────────────────────────────────────── */
.tab-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 0 24px;
  border-top: 1px solid var(--border);
}

.tab-btn {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-family: 'Rajdhani', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 12px 18px;
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition);
  white-space: nowrap;
}

.tab-btn:hover { color: var(--gold); }
.tab-btn.active { color: var(--gold); border-bottom-color: var(--gold); }

.tab-sep {
  color: var(--text-dim);
  font-size: 14px;
  padding: 0 2px;
  user-select: none;
}

/* ═══════════════════════════════════════════════════════════════════
   MAIN CONTENT
═══════════════════════════════════════════════════════════════════ */
.main-content {
  padding: 24px;
  min-height: calc(100vh - var(--header-h));
  max-width: 1600px;
  margin: 0 auto;
}

.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeIn 0.3s ease both; }

/* ═══════════════════════════════════════════════════════════════════
   PANELS
═══════════════════════════════════════════════════════════════════ */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 20px;
}

.panel-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.panel-title {
  font-family: 'Rajdhani', sans-serif;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.2em;
  color: #ffffff;
  text-transform: uppercase;
}

.panel-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--text-dim);
  border: 1px solid var(--text-dim);
  padding: 2px 8px;
  border-radius: 2px;
  margin-left: auto;
}

/* ═══════════════════════════════════════════════════════════════════
   STAT CARDS
═══════════════════════════════════════════════════════════════════ */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

@media (max-width: 1200px) { .stat-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 700px)  { .stat-grid { grid-template-columns: repeat(2, 1fr); } }

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 2px solid var(--gold-dim);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  overflow: hidden;
  transition: border-top-color var(--transition), box-shadow var(--transition);
  cursor: default;
}

.stat-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(201,168,76,0.03) 0%, transparent 60%);
  pointer-events: none;
}

.stat-card:hover {
  border-top-color: var(--gold-bright);
  box-shadow: 0 0 24px rgba(201,168,76,0.12), 0 0 60px rgba(201,168,76,0.04);
}

.stat-label {
  font-family: 'Rajdhani', sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.stat-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 32px;
  font-weight: 500;
  color: var(--gold-bright);
  line-height: 1;
  letter-spacing: -0.02em;
}

.sparkline {
  width: 100%;
  height: 24px;
  margin-top: auto;
  opacity: 0.7;
}

/* ═══════════════════════════════════════════════════════════════════
   BRAIN MID ROW
═══════════════════════════════════════════════════════════════════ */
.brain-mid-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

@media (max-width: 900px) { .brain-mid-row { grid-template-columns: 1fr; } }

/* TISSUE STATUS */
.tissue-panel, .memory-systems-panel { height: 100%; }

.tissue-list { display: flex; flex-direction: column; gap: 8px; }

.tissue-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  transition: border-color var(--transition);
}

.tissue-row:hover { border-color: var(--gold-dim); }

.tissue-name {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--gold);
  flex: 1;
  letter-spacing: 0.02em;
}

.tissue-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.pulse-green { animation: dotPulse 2.5s ease-in-out infinite; }
.pulse-amber { animation: dotPulseAmber 2.5s ease-in-out infinite; }
.pulse-red   { animation: dotPulseRed 2.5s ease-in-out infinite; }

.tissue-status {
  font-family: 'Rajdhani', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.15em;
  color: var(--green);
}

/* MEMORY SYSTEMS */
.memory-sys-list { display: flex; flex-direction: column; gap: 8px; }

.mem-sys-row {
  display: grid;
  grid-template-columns: 130px 60px 1fr;
  align-items: center;
  gap: 12px;
  padding: 6px 0;
}

.mem-sys-name {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--gold);
  letter-spacing: 0.02em;
}

.mem-sys-count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--text-muted);
  text-align: right;
}

.mem-bar-wrap {
  height: 4px;
  background: var(--surface2);
  border-radius: 2px;
  overflow: hidden;
}

.mem-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-dim), var(--gold));
  border-radius: 2px;
  transition: width 0.8s ease;
}

/* ═══════════════════════════════════════════════════════════════════
   AUDIT FEED
═══════════════════════════════════════════════════════════════════ */
.audit-feed-panel {}

.feed-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: dotPulse 1.5s ease-in-out infinite;
}

.audit-feed {
  max-height: 280px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.audit-entry {
  display: grid;
  grid-template-columns: 160px 120px 1fr 60px;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: var(--surface2);
  border-left: 2px solid transparent;
  transition: border-color var(--transition), background var(--transition);
  font-size: 12px;
}

.audit-entry:hover {
  background: var(--bg);
  border-left-color: var(--gold-dim);
}

.audit-ts {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

.audit-tissue {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--gold);
  font-weight: 500;
}

.audit-action {
  color: var(--text);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.audit-outcome {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'Rajdhani', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
}

.audit-outcome.ok  { color: var(--green); }
.audit-outcome.err { color: var(--red); }

/* ═══════════════════════════════════════════════════════════════════
   MEMORY TAB
═══════════════════════════════════════════════════════════════════ */
.memory-search-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

.mem-search-input {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  padding: 10px 16px;
  outline: none;
  transition: border-color var(--transition);
}

.mem-search-input:focus { border-color: var(--gold); }
.mem-search-input::placeholder { color: var(--text-dim); }

.memory-search-results {
  background: var(--surface);
  border: 1px solid var(--gold-dim);
  padding: 16px;
  margin-bottom: 20px;
}

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

.mem-sys-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 2px solid var(--gold-dim);
  padding: 16px;
  transition: border-top-color var(--transition);
}

.mem-sys-card:hover { border-top-color: var(--gold); }

.mem-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.mem-card-icon { font-size: 18px; }

.mem-card-title {
  font-family: 'Rajdhani', sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--gold);
  text-transform: uppercase;
}

.mem-card-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 12px;
  line-height: 1.6;
}

.mem-items-list { display: flex; flex-direction: column; gap: 6px; }

.mem-item {
  padding: 8px 10px;
  background: var(--surface2);
  border-left: 2px solid var(--gold-dim);
  font-size: 12px;
  color: var(--text);
  line-height: 1.5;
}

.mem-empty {
  font-family: 'Rajdhani', sans-serif;
  font-size: 12px;
  letter-spacing: 0.15em;
  color: var(--text-dim);
  padding: 16px 0;
  text-align: center;
}

/* ═══════════════════════════════════════════════════════════════════
   SKILLS TAB
═══════════════════════════════════════════════════════════════════ */
.skills-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.skills-meta { display: flex; align-items: baseline; gap: 10px; }

.skills-count-label {
  font-family: 'Rajdhani', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.skills-count-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 24px;
  color: var(--gold-bright);
}

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

.skill-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 2px solid var(--gold-dim);
  padding: 16px;
  transition: border-top-color var(--transition), box-shadow var(--transition);
}

.skill-card:hover {
  border-top-color: var(--gold);
  box-shadow: 0 0 20px rgba(201,168,76,0.08);
}

.skill-card-name {
  font-family: 'Rajdhani', sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.skill-category-badge {
  display: inline-block;
  font-family: 'Rajdhani', sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 3px 8px;
  border: 1px solid var(--gold-dim);
  color: var(--gold-dim);
  margin-bottom: 12px;
}

.skill-mastery-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
}

.skill-mastery-label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
  font-family: 'Rajdhani', sans-serif;
  letter-spacing: 0.1em;
}

.skill-mastery-bar-wrap {
  height: 3px;
  background: var(--surface2);
  border-radius: 2px;
  overflow: hidden;
}

.skill-mastery-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-dim), var(--gold));
  border-radius: 2px;
  transition: width 0.8s ease;
}

.skill-meta {
  display: flex;
  justify-content: space-between;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 8px;
}

/* ═══════════════════════════════════════════════════════════════════
   FORMS (FEED / CAUSAL)
═══════════════════════════════════════════════════════════════════ */
.feed-panels {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
}

@media (max-width: 1100px) { .feed-panels { grid-template-columns: 1fr 1fr; } }
@media (max-width: 700px)  { .feed-panels { grid-template-columns: 1fr; } }

.causal-panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media (max-width: 800px) { .causal-panels { grid-template-columns: 1fr; } }

.feed-panel, .causal-panel { height: 100%; }

.feed-form { display: flex; flex-direction: column; gap: 14px; }

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

.form-label {
  font-family: 'Rajdhani', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.form-input,
.form-textarea,
.form-select {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  padding: 10px 12px;
  outline: none;
  transition: border-color var(--transition);
  border-radius: 0;
  width: 100%;
  appearance: none;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  border-color: var(--gold-dim);
}

.form-textarea {
  resize: vertical;
  font-family: 'Inter', sans-serif;
  line-height: 1.6;
}

.learn-anything-ta { font-family: 'JetBrains Mono', monospace; font-size: 12px; }

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%235a4820'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
  cursor: pointer;
}

/* BUTTONS */
.gold-btn {
  background: transparent;
  border: 1px solid var(--gold);
  color: var(--gold);
  font-family: 'Rajdhani', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 10px 20px;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), box-shadow var(--transition);
  white-space: nowrap;
}

.gold-btn:hover {
  background: var(--gold);
  color: var(--bg);
  box-shadow: 0 0 20px rgba(201,168,76,0.2);
}

.gold-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.gold-btn.full-w { width: 100%; }

.ghost-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-family: 'Rajdhani', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 8px 20px;
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition);
}

.ghost-btn:hover { border-color: var(--gold-dim); color: var(--gold); }

.form-result {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  padding: 10px 12px;
  background: var(--surface2);
  border-left: 2px solid transparent;
  display: none;
  line-height: 1.6;
}

.form-result.success { border-left-color: var(--green); color: var(--green); display: block; }
.form-result.error   { border-left-color: var(--red);   color: var(--red);   display: block; }

.causal-result {
  margin-top: 8px;
  padding: 14px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-left: 2px solid var(--gold-dim);
  display: none;
  line-height: 1.8;
}

.causal-result.visible { display: block; }

.causal-chain {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--gold);
  margin-top: 10px;
  letter-spacing: 0.05em;
}

.causal-confidence {
  font-family: 'Rajdhani', sans-serif;
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  margin-top: 6px;
}

/* ═══════════════════════════════════════════════════════════════════
   AUDIT TABLE TAB
═══════════════════════════════════════════════════════════════════ */
.audit-filters {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  align-items: flex-end;
}

.audit-filter { max-width: 200px; }

.audit-table-wrap {
  overflow-x: auto;
}

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

.audit-table th {
  font-family: 'Rajdhani', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  text-transform: uppercase;
}

.audit-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--text);
}

.audit-table tbody tr:hover { background: var(--surface2); }

.audit-table td.table-empty {
  text-align: center;
  padding: 32px;
  color: var(--text-muted);
}

.audit-table td:first-child {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text-muted);
}

.audit-table td:nth-child(2) {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

.audit-table td:nth-child(3) {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--gold);
}

.td-ok  { color: var(--green) !important; font-family: 'Rajdhani', sans-serif; font-weight: 600; letter-spacing: 0.1em; }
.td-err { color: var(--red) !important; font-family: 'Rajdhani', sans-serif; font-weight: 600; letter-spacing: 0.1em; }

.td-payload {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--text-dim);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audit-footer {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 0 0;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}

.audit-count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text-muted);
  margin-left: auto;
}

/* ═══════════════════════════════════════════════════════════════════
   HEALTH TAB
═══════════════════════════════════════════════════════════════════ */
.health-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
}

.health-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--text-muted);
}

.health-idle {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px;
  font-family: 'Rajdhani', sans-serif;
  font-size: 14px;
  letter-spacing: 0.2em;
  color: var(--text-dim);
  text-transform: uppercase;
}

.health-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 0;
}

.health-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  overflow: hidden;
}

.health-tile.pass  { border-left: 3px solid var(--green); }
.health-tile.fail  { border-left: 3px solid var(--red); animation: healthFail 1.5s ease-in-out infinite; }
.health-tile.repair { border-left: 3px solid var(--amber); animation: healthRepair 1.5s ease-in-out infinite; }
.health-tile.skip  { border-left: 3px solid var(--text-dim); opacity: 0.6; }

.health-tile-icon { font-size: 20px; }

.health-tile-name {
  font-family: 'Rajdhani', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--text);
  text-transform: uppercase;
}

.health-tile-status {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.05em;
}

.health-tile.pass  .health-tile-status { color: var(--green); }
.health-tile.fail  .health-tile-status { color: var(--red); }
.health-tile.repair .health-tile-status { color: var(--amber); }
.health-tile.skip  .health-tile-status { color: var(--text-dim); }

.health-tile-time {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--text-dim);
}

/* Circuit Breakers */
.breakers-panel { margin-top: 20px; }
.breakers-list { display: flex; flex-direction: column; gap: 10px; }

.breaker-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  background: var(--surface2);
  border: 1px solid var(--border);
}

.breaker-name {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--gold);
  width: 120px;
}

.breaker-state {
  font-family: 'Rajdhani', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.15em;
  padding: 3px 10px;
  border: 1px solid var(--border);
}

.breaker-state.closed   { color: var(--green); border-color: var(--green); }
.breaker-state.open     { color: var(--red);   border-color: var(--red); }
.breaker-state.half-open { color: var(--amber); border-color: var(--amber); }

.breaker-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text-dim);
  margin-left: auto;
}

/* ═══════════════════════════════════════════════════════════════════
   LOADING / PULSE STATES
═══════════════════════════════════════════════════════════════════ */
.feed-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 24px;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold-dim);
  animation: pulseDot 1.4s ease-in-out infinite;
}

.pulse-dot:nth-child(2) { animation-delay: 0.2s; }
.pulse-dot:nth-child(3) { animation-delay: 0.4s; }

/* ═══════════════════════════════════════════════════════════════════
   TOAST NOTIFICATIONS
═══════════════════════════════════════════════════════════════════ */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background: var(--surface);
  border: 1px solid var(--gold-dim);
  border-left: 3px solid var(--gold);
  padding: 12px 20px;
  font-family: 'Rajdhani', sans-serif;
  font-size: 13px;
  letter-spacing: 0.1em;
  color: var(--text);
  min-width: 280px;
  max-width: 400px;
  animation: toastIn 0.3s ease both;
  pointer-events: all;
}

.toast.toast-error { border-left-color: var(--red); border-color: rgba(201,76,76,0.3); }
.toast.toast-success { border-left-color: var(--green); border-color: rgba(76,201,138,0.3); }
.toast.toast-out { animation: toastOut 0.3s ease both; }

/* ═══════════════════════════════════════════════════════════════════
   KEYFRAMES
═══════════════════════════════════════════════════════════════════ */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

@keyframes glowPulse {
  0%, 100% { text-shadow: 0 0 40px rgba(201,168,76,0.4), 0 0 80px rgba(201,168,76,0.15); }
  50%       { text-shadow: 0 0 60px rgba(201,168,76,0.6), 0 0 120px rgba(201,168,76,0.25); }
}

@keyframes dotPulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 6px var(--green); }
  50%       { opacity: 0.5; box-shadow: 0 0 2px var(--green); }
}

@keyframes dotPulseAmber {
  0%, 100% { opacity: 1; box-shadow: 0 0 6px var(--amber); }
  50%       { opacity: 0.5; box-shadow: 0 0 2px var(--amber); }
}

@keyframes dotPulseRed {
  0%, 100% { opacity: 1; box-shadow: 0 0 6px var(--red); }
  50%       { opacity: 0.4; box-shadow: 0 0 2px var(--red); }
}

@keyframes neuralPulse {
  0%   { height: 20%; transform: translateY(80%); }
  25%  { height: 80%; transform: translateY(0%); }
  50%  { height: 40%; transform: translateY(30%); }
  75%  { height: 65%; transform: translateY(5%); }
  100% { height: 20%; transform: translateY(80%); }
}

@keyframes pulseDot {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50%       { opacity: 1;   transform: scale(1.1); background: var(--gold); }
}

@keyframes errorPulse {
  0%, 100% { box-shadow: none; }
  50%       { box-shadow: 0 0 20px rgba(201,76,76,0.4); }
}

/* ─── MEMORY CARD FEED BUTTON ─────────────────────────────────── */
.mem-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mem-feed-btn {
  margin-left: auto;
  padding: 4px 12px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--gold);
  background: rgba(201,168,76,0.08);
  border: 1px solid rgba(201,168,76,0.3);
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  font-family: 'Rajdhani', sans-serif;
}

.mem-feed-btn:hover {
  background: rgba(201,168,76,0.2);
  border-color: var(--gold);
}

/* ─── MEMORY FEED MODAL ────────────────────────────────────────── */
.mem-feed-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 900;
  background: rgba(0,0,0,0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.mem-feed-modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  width: 100%;
  max-width: 640px;
  padding: 28px 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.6), 0 0 0 1px rgba(201,168,76,0.12);
}

.mem-feed-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.mem-feed-modal-type {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--gold);
  font-family: 'Rajdhani', sans-serif;
}

.mem-feed-modal-desc {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
  line-height: 1.5;
}

.mem-feed-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 6px;
  line-height: 1;
  flex-shrink: 0;
  transition: color 0.2s;
}

.mem-feed-close:hover { color: #fff; }

.mem-feed-ta {
  width: 100%;
  box-sizing: border-box;
  min-height: 200px;
  resize: vertical;
}

.mem-feed-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.mem-feed-result {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  flex: 1;
}

/* ─── ICA™ COMPLIANCE TICKER ──────────────────────────────────── */
@keyframes synTickerScroll {
  from { transform: translateX(0); }
  to   { transform: translateX(calc(-1 * var(--syn-ticker-w, 50%))); }
}

.ica-ticker-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  height: 36px;
  background: rgba(10,10,18,0.97);
  border-top: 1px solid rgba(201,168,76,0.25);
  overflow: hidden;
}

.ica-ticker-label-syn {
  flex-shrink: 0;
  padding: 0 14px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 3px;
  color: var(--gold);
  border-right: 1px solid rgba(201,168,76,0.25);
  height: 100%;
  display: flex;
  align-items: center;
  background: rgba(201,168,76,0.05);
  white-space: nowrap;
}

.ica-ticker-track-syn {
  flex: 1;
  overflow: hidden;
  height: 100%;
  display: flex;
  align-items: center;
}

.ica-ticker-inner-syn {
  display: flex;
  align-items: center;
  white-space: nowrap;
  gap: 0;
}

.ica-ticker-inner-syn.running {
  animation: synTickerScroll 30s linear infinite;
}

.syn-tick-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 18px;
}

.syn-tick-label {
  font-size: 9px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
  font-family: 'JetBrains Mono', monospace;
}

.syn-tick-val {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  font-family: 'JetBrains Mono', monospace;
}

.syn-tick-sep {
  color: rgba(255,255,255,0.08);
  padding: 0 2px;
  font-size: 16px;
}

#dashboard:not(.hidden) {
  padding-bottom: 36px;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(20px); }
}

@keyframes healthFail {
  0%, 100% { box-shadow: none; }
  50%       { box-shadow: inset 0 0 20px rgba(201,76,76,0.08); }
}

@keyframes healthRepair {
  0%, 100% { box-shadow: none; }
  50%       { box-shadow: inset 0 0 20px rgba(201,148,76,0.1); }
}

@keyframes countUp {
  from { opacity: 0; }
  to   { opacity: 1; }
}
