/* ============================================================
   METAMATRIX — Design System
   Dark-first terminal aesthetic. Deep blacks, cyan/teal accent,
   amber warnings, neon green for positive states.
   ============================================================ */

/* ---------- TOKENS ---------- */
:root {
  --text-xs:   clamp(0.75rem,  0.7rem + 0.25vw, 0.875rem);
  --text-sm:   clamp(0.8rem,   0.75rem + 0.3vw, 0.9375rem);
  --text-base: clamp(0.9rem,   0.85rem + 0.25vw, 1rem);
  --text-lg:   clamp(1rem,     0.9rem + 0.5vw,  1.25rem);
  --text-xl:   clamp(1.25rem,  1rem + 1vw,      1.75rem);

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-full: 9999px;

  --transition: 160ms cubic-bezier(0.16, 1, 0.3, 1);

  /* Metamatrix dark palette */
  --bg:           #080a0c;
  --surface:      #0d1117;
  --surface-2:    #111820;
  --surface-3:    #161f2a;
  --border:       #1e2d3d;
  --border-bright:#2a3f55;

  --text:         #d4e4f0;
  --text-muted:   #6a8aa8;
  --text-faint:   #2e4456;
  --text-inverse: #080a0c;

  /* Accent palette */
  --accent:       #00d4c8;
  --accent-dim:   #007a74;
  --accent-glow:  rgba(0, 212, 200, 0.15);
  --accent-hover: #00ffe9;

  --green:        #39ff85;
  --green-dim:    #1a7a3d;
  --green-glow:   rgba(57, 255, 133, 0.12);

  --amber:        #ffb347;
  --amber-dim:    #7a5020;
  --amber-glow:   rgba(255, 179, 71, 0.12);

  --red:          #ff4d6a;
  --red-dim:      #7a1f2d;
  --red-glow:     rgba(255, 77, 106, 0.1);

  --blue:         #4a9eff;
  --blue-dim:     #1a3d7a;
  --blue-glow:    rgba(74, 158, 255, 0.12);

  --ion-neg:      #39d0ff;
  --ion-pos:      #ff6b35;

  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --font-body: 'Inter', -apple-system, sans-serif;

  --shadow-sm:  0 1px 3px rgba(0,0,0,0.5);
  --shadow-md:  0 4px 16px rgba(0,0,0,0.6);
  --shadow-lg:  0 8px 32px rgba(0,0,0,0.7);
  --glow-accent: 0 0 12px var(--accent-glow), 0 0 24px rgba(0,212,200,0.08);
}

/* ---------- RESET ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; scroll-behavior: smooth; }
body {
  min-height: 100dvh;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}
button { cursor: pointer; background: none; border: none; font: inherit; color: inherit; }
input, textarea, select { font: inherit; color: inherit; }
img, svg { display: block; max-width: 100%; }

/* ---------- BOOT OVERLAY ---------- */
.boot-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
}
.boot-screen {
  display: flex; flex-direction: column; align-items: center; gap: var(--space-4);
  width: 320px;
}
.boot-logo {
  font-size: 3rem;
  animation: bootpulse 1.2s ease-in-out infinite;
}
@keyframes bootpulse {
  0%,100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.95); }
}
.boot-title {
  font-family: var(--font-mono);
  font-size: var(--text-xl);
  font-weight: 700;
  letter-spacing: 0.25em;
  color: var(--accent);
  text-shadow: 0 0 20px var(--accent);
}
.boot-lines {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-muted);
  width: 100%;
  min-height: 7rem;
  display: flex; flex-direction: column; gap: 2px;
}
.boot-line { animation: fadein 0.2s ease; }
@keyframes fadein { from { opacity: 0; transform: translateX(-4px); } to { opacity: 1; } }
.boot-line.ok { color: var(--green); }
.boot-line.warn { color: var(--amber); }
.boot-bar-wrap {
  width: 100%; height: 2px;
  background: var(--border);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.boot-bar {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--green));
  border-radius: var(--radius-full);
  transition: width 0.08s linear;
  box-shadow: 0 0 8px var(--accent);
}

/* ---------- APP ---------- */
.app { display: flex; flex-direction: column; height: 100dvh; }
.hidden { display: none !important; }

/* ---------- HEADER ---------- */
.header {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-3) var(--space-6);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  gap: var(--space-4);
  flex-shrink: 0;
  min-height: 56px;
}
.header-left { display: flex; align-items: center; gap: var(--space-3); }
.logo-icon {
  width: 28px; height: 28px;
  color: var(--accent);
  filter: drop-shadow(0 0 6px var(--accent));
  flex-shrink: 0;
}
.header-brand { display: flex; flex-direction: column; gap: 1px; }
.brand-name {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text);
}
.node-badge {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.15em;
  color: var(--green);
  text-shadow: 0 0 8px var(--green);
}
.header-center { flex: 1; display: flex; justify-content: center; }
.did-line {
  display: flex; align-items: center; gap: var(--space-2);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: var(--space-1) var(--space-3);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  max-width: 480px;
}
.did-label {
  font-size: 9px; letter-spacing: 0.15em;
  color: var(--text-faint); font-weight: 700;
}
.did-value {
  color: var(--text-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  max-width: 300px;
}
.did-check {
  color: var(--green); font-size: 9px; letter-spacing: 0.1em;
  white-space: nowrap; flex-shrink: 0;
}
.header-right {}
.header-stats { display: flex; align-items: center; gap: var(--space-2); }
.stat-pill {
  display: flex; flex-direction: column; align-items: center;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
  min-width: 56px;
}
.stat-num {
  font-family: var(--font-mono);
  font-size: var(--text-lg); font-weight: 700;
  color: var(--accent);
  line-height: 1;
}
.stat-pill.resonance .stat-num { color: var(--green); }
.stat-pill.ion .stat-num { color: var(--ion-neg); font-size: var(--text-base); }
.stat-lbl {
  font-size: 9px; letter-spacing: 0.1em;
  color: var(--text-muted); font-family: var(--font-mono);
}

/* ---------- TABBAR ---------- */
.tabbar {
  display: flex;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.tab {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-mono); font-size: var(--text-sm);
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
}
.tab:hover { color: var(--text); background: var(--surface-2); }
.tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  background: var(--surface-2);
  text-shadow: 0 0 10px var(--accent);
}
.tab-icon { font-size: 1.1em; }
.tab-label { letter-spacing: 0.08em; }

/* ---------- PANELS ---------- */
.panels { flex: 1; overflow: hidden; }
.panel { display: none; height: 100%; overflow-y: auto; padding: var(--space-6); }
.panel.active { display: block; }
.panel-header { margin-bottom: var(--space-6); }
.panel-title {
  font-family: var(--font-mono);
  font-size: var(--text-lg); font-weight: 700;
  color: var(--text);
  display: block; margin-bottom: var(--space-1);
}
.panel-sub {
  font-size: var(--text-sm);
  color: var(--text-muted);
  display: block;
}

/* ---------- CARDS ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
}
.card-title {
  font-family: var(--font-mono);
  font-size: var(--text-xs); font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: var(--space-4);
}
.card-header-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: var(--space-4);
}
.card-header-row .card-title { margin-bottom: 0; }

/* ---------- SCAN TAB ---------- */
.scan-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: var(--space-6);
  height: calc(100vh - 160px);
}
.scan-left { display: flex; flex-direction: column; gap: var(--space-4); overflow-y: auto; }
.scan-right { display: flex; flex-direction: column; gap: var(--space-4); overflow-y: auto; }

.input-area { display: flex; flex-direction: column; gap: var(--space-3); }
.scan-textarea {
  width: 100%; min-height: 120px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  line-height: 1.6;
  resize: vertical;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.scan-textarea:focus {
  border-color: var(--accent-dim);
  box-shadow: 0 0 0 2px var(--accent-glow);
}
.scan-textarea::placeholder { color: var(--text-faint); }

.analyze-btn {
  align-self: flex-start;
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-6);
  font-family: var(--font-mono);
  font-size: var(--text-sm); font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--accent);
  transition: background var(--transition), box-shadow var(--transition), color var(--transition);
}
.analyze-btn:hover {
  background: var(--accent);
  color: var(--bg);
  box-shadow: var(--glow-accent);
}
.analyze-btn:active { opacity: 0.85; }
.analyze-btn.analyzing {
  opacity: 0.7; cursor: wait;
}

/* Terminal */
.terminal {
  flex: 1;
  background: #03070c;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  min-height: 220px;
  display: flex; flex-direction: column;
}
.terminal-bar {
  display: flex; align-items: center; gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.t-dot {
  width: 10px; height: 10px; border-radius: 50%;
}
.t-dot.red   { background: #ff5f57; }
.t-dot.yellow{ background: #ffbd2e; }
.t-dot.green { background: #28ca41; }
.t-title {
  font-family: var(--font-mono); font-size: var(--text-xs);
  color: var(--text-muted); margin-left: var(--space-2);
}
.terminal-body {
  flex: 1; padding: var(--space-4);
  font-family: var(--font-mono); font-size: var(--text-xs);
  line-height: 1.8;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 1px;
}
.t-line { color: var(--text); }
.t-line.dim { color: var(--text-faint); }
.t-line.ok  { color: var(--green); }
.t-line.accent { color: var(--accent); }
.t-line.warn { color: var(--amber); }
.t-line.err  { color: var(--red); }
.t-cursor {
  color: var(--accent);
  animation: blink 1s step-end infinite;
}
@keyframes blink { 0%,100%{opacity:1;} 50%{opacity:0;} }

/* Hermetic bars */
.hermetic-grid { display: flex; flex-direction: column; gap: var(--space-3); }
.h-principle { display: flex; align-items: center; gap: var(--space-3); }
.h-label {
  font-family: var(--font-mono); font-size: var(--text-xs);
  color: var(--text-muted); width: 100px; flex-shrink: 0;
}
.h-bar-wrap {
  flex: 1; height: 6px;
  background: var(--surface-2);
  border-radius: var(--radius-full); overflow: hidden;
}
.h-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-dim), var(--accent));
  border-radius: var(--radius-full);
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 0 6px var(--accent-glow);
}
.h-val {
  font-family: var(--font-mono); font-size: var(--text-xs);
  color: var(--accent); width: 36px; text-align: right; flex-shrink: 0;
}

/* Signature card */
.sig-card { flex: 1; }
.sig-body { min-height: 100px; display: flex; flex-direction: column; justify-content: center; }
.sig-placeholder {
  display: flex; flex-direction: column; align-items: center;
  gap: var(--space-2); text-align: center;
  padding: var(--space-4);
}
.sig-icon { font-size: 1.8rem; color: var(--text-faint); }
.sig-text { font-family: var(--font-mono); font-size: var(--text-sm); color: var(--text-muted); }
.sig-sub  { font-size: var(--text-xs); color: var(--text-faint); max-width: 240px; }
.sig-result {
  font-family: var(--font-mono); font-size: var(--text-xs);
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  word-break: break-all;
  color: var(--accent);
}
.sig-meta {
  font-size: var(--text-xs); color: var(--text-muted);
  margin-top: var(--space-2);
  display: flex; justify-content: space-between;
}

/* ---------- NETWORK TAB ---------- */
.network-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: var(--space-6);
  height: calc(100vh - 160px);
}
.network-map-wrap { display: flex; flex-direction: column; }
.network-canvas {
  flex: 1; width: 100%;
  background: #03070c;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: block;
}
.network-sidebar { display: flex; flex-direction: column; gap: var(--space-4); overflow-y: auto; }

.conn-layers { display: flex; flex-direction: column; gap: var(--space-3); }
.conn-layer {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-3);
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.conn-indicator {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
}
.conn-indicator.pulse-green {
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: gpulse 2s ease-in-out infinite;
}
@keyframes gpulse {
  0%,100%{box-shadow:0 0 4px var(--green);} 50%{box-shadow:0 0 14px var(--green);}
}
.conn-indicator.pulse-blue {
  background: var(--blue);
  box-shadow: 0 0 8px var(--blue);
  animation: bpulse 3s ease-in-out infinite;
}
@keyframes bpulse {
  0%,100%{box-shadow:0 0 4px var(--blue);} 50%{box-shadow:0 0 14px var(--blue);}
}
.conn-indicator.dim { background: var(--text-faint); }
.conn-info { flex: 1; }
.conn-name { font-size: var(--text-sm); color: var(--text); font-weight: 500; }
.conn-detail { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--text-muted); }
.conn-status {
  font-family: var(--font-mono); font-size: 9px; font-weight: 700;
  letter-spacing: 0.12em; color: var(--green);
}
.conn-status.standby { color: var(--blue); }
.conn-status.dim     { color: var(--text-faint); }

.node-list { display: flex; flex-direction: column; gap: var(--space-2); max-height: 200px; overflow-y: auto; }
.node-entry {
  display: flex; align-items: center; gap: var(--space-2);
  padding: var(--space-2);
  background: var(--surface-2); border-radius: var(--radius-sm);
  font-family: var(--font-mono); font-size: var(--text-xs);
}
.node-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.node-dot.online { background: var(--green); box-shadow: 0 0 4px var(--green); }
.node-dot.away { background: var(--amber); }
.node-id { color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.node-res { color: var(--accent); flex-shrink: 0; }

.net-health { display: flex; flex-direction: column; gap: var(--space-3); }
.health-row { display: flex; align-items: center; gap: var(--space-3); }
.health-lbl { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--text-muted); width: 90px; flex-shrink: 0; }
.health-bar-wrap { flex: 1; height: 5px; background: var(--surface-2); border-radius: var(--radius-full); overflow: hidden; }
.health-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-dim), var(--accent));
  border-radius: var(--radius-full);
  transition: width 1s ease;
}
.health-bar.green { background: linear-gradient(90deg, var(--green-dim), var(--green)); }
.health-bar.blue  { background: linear-gradient(90deg, var(--blue-dim), var(--blue)); }
.health-num { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--accent); width: 36px; text-align: right; flex-shrink: 0; }

/* ---------- SANCTUARY TAB ---------- */
.sanctuary-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: var(--space-6);
  height: calc(100vh - 160px);
}
.sanctuary-main { display: flex; flex-direction: column; gap: var(--space-5); overflow-y: auto; }
.sanctuary-sidebar { display: flex; flex-direction: column; gap: var(--space-4); overflow-y: auto; }

/* Ion card */
.ion-card {}
.ion-live-badge {
  font-family: var(--font-mono); font-size: 9px; font-weight: 700;
  letter-spacing: 0.15em; color: var(--green);
  background: var(--green-glow); border: 1px solid var(--green-dim);
  border-radius: var(--radius-full);
  padding: 2px 8px;
  animation: gpulse 2s ease-in-out infinite;
}
.ion-display {
  display: flex; align-items: stretch; gap: var(--space-6);
  padding: var(--space-4) 0;
}
.ion-side {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: var(--space-2);
}
.ion-label {
  font-family: var(--font-mono); font-size: 9px; font-weight: 700;
  letter-spacing: 0.15em;
}
.ion-side.neg .ion-label { color: var(--ion-neg); }
.ion-side.pos .ion-label { color: var(--ion-pos); }
.ion-gauge-wrap {
  flex: 1; width: 24px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex; align-items: flex-end; overflow: hidden;
  min-height: 80px;
}
.ion-gauge {
  width: 100%; border-radius: var(--radius-sm);
  transition: height 1s ease;
}
.neg-gauge { background: linear-gradient(0deg, var(--ion-neg), rgba(57, 208, 255, 0.4)); box-shadow: 0 0 8px var(--ion-neg); }
.pos-gauge { background: linear-gradient(0deg, var(--ion-pos), rgba(255, 107, 53, 0.4)); }
.ion-reading {
  font-family: var(--font-mono); font-size: var(--text-lg); font-weight: 700;
}
.ion-side.neg .ion-reading { color: var(--ion-neg); text-shadow: 0 0 10px var(--ion-neg); }
.ion-side.pos .ion-reading { color: var(--ion-pos); }
.ion-trend {
  font-family: var(--font-mono); font-size: var(--text-xs);
}
.ion-trend.up { color: var(--green); }
.ion-trend.down { color: var(--text-muted); }
.ion-center {
  display: flex; flex-direction: column; align-items: center; gap: var(--space-2);
  justify-content: center;
}
.ion-status {
  font-family: var(--font-mono); font-size: var(--text-xs); font-weight: 700;
  letter-spacing: 0.15em; color: var(--green);
}

/* Protocols */
.protocols-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-4); }
.proto-card { display: flex; flex-direction: row; gap: var(--space-4); align-items: flex-start; }
.proto-letter {
  font-family: var(--font-mono); font-size: var(--text-xl); font-weight: 700;
  color: var(--accent); line-height: 1;
  opacity: 0.6;
  flex-shrink: 0;
}
.proto-title { font-size: var(--text-sm); font-weight: 600; color: var(--text); margin-bottom: var(--space-1); }
.proto-sub { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--text-muted); margin-bottom: var(--space-3); }
.proto-items { display: flex; flex-direction: column; gap: var(--space-1); }
.proto-item { font-size: var(--text-xs); color: var(--text-faint); }
.proto-item.active { color: var(--green); }

/* Hardware */
.hw-list { display: flex; flex-direction: column; gap: var(--space-3); }
.hw-item {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--border);
}
.hw-item:last-child { border-bottom: none; }
.hw-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.hw-item.online .hw-dot { background: var(--green); box-shadow: 0 0 5px var(--green); }
.hw-item.pending .hw-dot { background: var(--amber); }
.hw-info { flex: 1; }
.hw-name { font-size: var(--text-sm); color: var(--text); }
.hw-detail { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--text-muted); }
.hw-badge {
  font-family: var(--font-mono); font-size: 9px; font-weight: 700;
  letter-spacing: 0.1em; color: var(--green);
}
.hw-badge.pending { color: var(--amber); }

/* Telemetry */
.telemetry-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
.telem-item {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  text-align: center;
}
.telem-val {
  font-family: var(--font-mono); font-size: var(--text-lg); font-weight: 700;
  color: var(--accent); line-height: 1; margin-bottom: var(--space-1);
}
.telem-val.success { color: var(--green); }
.telem-lbl { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--text-muted); }

/* ---------- FEED TAB ---------- */
.feed-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: var(--space-6);
  height: calc(100vh - 160px);
}
.feed-main { display: flex; flex-direction: column; gap: var(--space-4); overflow: hidden; }
.feed-list { flex: 1; display: flex; flex-direction: column; gap: var(--space-3); overflow-y: auto; }
.feed-sidebar { display: flex; flex-direction: column; gap: var(--space-4); overflow-y: auto; }

.feed-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  transition: border-color var(--transition);
  animation: feedin 0.3s ease;
}
@keyframes feedin { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; } }
.feed-item:hover { border-color: var(--border-bright); }
.feed-item.glimmer { border-color: rgba(0, 212, 200, 0.3); }
.feed-item.suppress { border-color: rgba(255, 77, 106, 0.2); }
.feed-top {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: var(--space-3);
}
.feed-hash {
  font-family: var(--font-mono); font-size: var(--text-xs);
  color: var(--accent);
}
.feed-time { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--text-faint); }
.feed-principles {
  display: flex; flex-wrap: wrap; gap: var(--space-2);
  margin-bottom: var(--space-3);
}
.feed-tag {
  font-family: var(--font-mono); font-size: 9px; font-weight: 700;
  letter-spacing: 0.1em;
  padding: 2px 8px; border-radius: var(--radius-full);
  background: var(--accent-glow); color: var(--accent);
  border: 1px solid var(--accent-dim);
}
.feed-tag.green { background: var(--green-glow); color: var(--green); border-color: var(--green-dim); }
.feed-tag.amber { background: var(--amber-glow); color: var(--amber); border-color: var(--amber-dim); }
.feed-sig {
  font-family: var(--font-mono); font-size: var(--text-xs);
  color: var(--text-muted); word-break: break-all;
  padding: var(--space-2);
  background: var(--surface-2); border-radius: var(--radius-sm);
}
.feed-bar-row {
  display: flex; align-items: center; gap: var(--space-2); margin-top: var(--space-3);
}
.feed-bar-lbl { font-family: var(--font-mono); font-size: 9px; color: var(--text-faint); width: 50px; flex-shrink: 0; }
.feed-bar-wrap { flex: 1; height: 3px; background: var(--surface-2); border-radius: var(--radius-full); overflow: hidden; }
.feed-bar-fill {
  height: 100%; border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--accent-dim), var(--accent));
}

/* Active law */
.active-law {
  padding: var(--space-3);
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.law-number {
  font-family: var(--font-mono); font-size: var(--text-xl); font-weight: 700;
  color: var(--accent); text-shadow: 0 0 12px var(--accent);
  margin-bottom: var(--space-1);
}
.law-name { font-size: var(--text-sm); font-weight: 600; color: var(--text); margin-bottom: var(--space-2); }
.law-desc { font-size: var(--text-xs); color: var(--text-muted); font-style: italic; line-height: 1.6; }

/* Freq canvas */
#freq-canvas { width: 100%; border-radius: var(--radius-sm); }
.freq-labels {
  display: flex; justify-content: space-between;
  margin-top: var(--space-2);
}
.freq-lbl { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--text-faint); }
.freq-lbl.right { color: var(--red); }

/* Session */
.session-info { display: flex; flex-direction: column; gap: var(--space-2); }
.sess-row { display: flex; justify-content: space-between; align-items: center; }
.sess-lbl { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--text-muted); }
.sess-val { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--text); }
.sess-val.awaiting { color: var(--amber); }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 900px) {
  .scan-layout, .network-layout, .sanctuary-layout, .feed-layout {
    grid-template-columns: 1fr;
    height: auto;
  }
  .header-center { display: none; }
  .protocols-grid { grid-template-columns: 1fr; }
  .tab-label { display: none; }
}
@media (max-width: 600px) {
  .panel { padding: var(--space-4); }
  .header { padding: var(--space-2) var(--space-4); }
}

/* ---------- SCROLLBARS ---------- */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-bright); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-faint); }
