/* CryptoStateIndex (c7) - Wall Street Quant Dark Carbon Orderbook & 50-State Regulatory Matrix Terminal */
@font-face {
  font-family: 'Instrument Sans';
  src: url('/assets/fonts/instrument-sans.woff2') format('woff2');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Geist Mono';
  src: url('/assets/fonts/geist-mono.woff2') format('woff2');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg-canvas: #060911;
  --bg-surface: #0b101b;
  --bg-subtle: #111827;
  --bg-elevated: #162032;
  --ink-primary: #f0f6fc;
  --ink-secondary: #94a3b8;
  --ink-muted: #64748b;
  --border-color: #1e293b;
  --border-subtle: #151f30;
  --cyan-primary: #06b6d4;
  --cyan-bright: #22d3ee;
  --cobalt-ink: #22d3ee;
  --cobalt-bg: rgba(6, 182, 212, 0.13);
  --cobalt-border: rgba(34, 211, 238, 0.36);
  --emerald-ink: #10b981;
  --emerald-bg: rgba(16, 185, 129, 0.13);
  --emerald-border: rgba(16, 185, 129, 0.36);
  --amber-ink: #f59e0b;
  --amber-bg: rgba(245, 158, 11, 0.14);
  --amber-border: rgba(245, 158, 11, 0.36);
  --crimson-ink: #f43f5e;
  --crimson-bg: rgba(244, 63, 94, 0.14);
  --crimson-border: rgba(244, 63, 94, 0.36);
  --font-sans: 'Instrument Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.55);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.72);
  --radius-sm: 3px;
  --radius-md: 4px;
  --radius-lg: 4px;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  font-family: var(--font-sans);
  background-color: var(--bg-canvas);
  color: var(--ink-primary);
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-canvas);
  color: var(--ink-primary);
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--cyan-bright);
  text-decoration: none;
}
a:hover {
  color: #67e8f9;
  text-decoration: underline;
}

.mono, code, pre, .num, td[data-num], .spread-pill, .nmls-id {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

code {
  background: #111827;
  border: 1px solid #1e293b;
  color: #22d3ee;
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  font-size: 0.84em;
}

/* Skip Link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--cyan-primary);
  color: #060911;
  font-weight: 700;
  padding: 0.5rem 1rem;
  z-index: 9999;
}
.skip-link:focus {
  left: 0.5rem;
  top: 0.5rem;
}

/* 1. Top Live Quant Telemetry Tape */
.exec-tape {
  background: #04070d;
  color: #e2e8f0;
  border-bottom: 1px solid #151f30;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-variant-numeric: tabular-nums;
  padding: 0.36rem 0;
}
.exec-tape-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.tape-items {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}
.csi-tape-feed {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  color: #22d3ee;
  font-weight: 700;
  letter-spacing: 0.05em;
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(34, 211, 238, 0.32);
  padding: 0.1rem 0.45rem;
  border-radius: 3px;
}
.tape-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: #f0f6fc;
  text-decoration: none;
  white-space: nowrap;
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  background: rgba(17, 24, 39, 0.75);
  border: 1px solid #151f30;
}
.tape-item:hover {
  border-color: #06b6d4;
  color: #22d3ee;
  text-decoration: none;
}
.tape-sym {
  font-weight: 700;
  color: #22d3ee;
}
.tape-price {
  color: #f0f6fc;
  font-weight: 600;
}
.tape-vwap {
  color: #64748b;
  font-size: 0.7rem;
}
.tape-bps {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: 2px;
  padding: 0.04rem 0.28rem;
  font-size: 0.68rem;
}
.tape-meta {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  color: #94a3b8;
  font-size: 0.71rem;
  flex-wrap: wrap;
}
.tape-meta strong {
  color: #22d3ee;
}
.tape-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  display: inline-block;
}

/* 2. Command Masthead */
.site-header {
  background: #0b101b;
  border-top: 2px solid #06b6d4;
  border-bottom: 1px solid #1e293b;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}
.header-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0.6rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--ink-primary);
  font-weight: 700;
  font-size: 1.12rem;
  letter-spacing: -0.02em;
  text-decoration: none;
}
.brand-logo:hover {
  text-decoration: none;
  color: #ffffff;
}
.brand-mark {
  background: rgba(6, 182, 212, 0.16);
  color: #22d3ee;
  border: 1px solid #06b6d4;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 700;
  padding: 0.26rem 0.5rem;
  border-radius: 3px;
  letter-spacing: 0.06em;
  box-shadow: inset 0 0 10px rgba(6, 182, 212, 0.2);
}
.brand-sub {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 600;
  color: var(--ink-muted);
  display: block;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  flex-wrap: wrap;
}
.main-nav a {
  color: var(--ink-secondary);
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.35rem 0.55rem;
  border-radius: 3px;
  border: 1px solid transparent;
  transition: all 0.14s ease;
}
.main-nav a:hover, .main-nav a.active {
  background: rgba(6, 182, 212, 0.14);
  color: #22d3ee;
  border-color: rgba(34, 211, 238, 0.35);
  text-decoration: none;
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Integrated State Jurisdiction Switcher */
.state-selector-wrap {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: #111827;
  border: 1px solid #1e293b;
  border-left: 2px solid #06b6d4;
  border-radius: 3px;
  padding: 0.22rem 0.5rem;
}
.state-selector-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #22d3ee;
  white-space: nowrap;
}
.state-selector, .state-selector-select {
  background: #111827;
  border: none;
  color: var(--ink-primary);
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.75rem;
  padding: 0.12rem 0.2rem;
  cursor: pointer;
  min-width: 240px;
  max-width: none;
}
.state-selector option {
  background: #0b101b;
  color: #f0f6fc;
}
.state-selector:focus, .state-selector-select:focus {
  outline: 1px solid #22d3ee;
  border-radius: 2px;
}

/* Terminal Command Omnisearch Input */
.omnisearch-wrap {
  position: relative;
}
.omnisearch-input {
  background: #111827;
  border: 1px solid #1e293b;
  border-radius: 3px;
  color: var(--ink-primary);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.36rem 0.65rem;
  min-width: 265px;
  width: 280px;
}
.omnisearch-input::placeholder {
  color: #64748b;
}
.omnisearch-input:focus {
  outline: 1px solid #22d3ee;
  border-color: #06b6d4;
  background: #0b101b;
}
.omnisearch-results {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  width: min(440px, 92vw);
  max-height: 400px;
  overflow-y: auto;
  background: #0b101b;
  border: 1px solid #06b6d4;
  border-radius: 3px;
  box-shadow: var(--shadow-md);
  z-index: 250;
  display: none;
}
.omnisearch-results.open {
  display: block;
}
.omni-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid #151f30;
  color: var(--ink-primary);
  text-decoration: none;
  font-size: 0.84rem;
}
.omni-item:hover {
  background: #162032;
  color: #22d3ee;
  text-decoration: none;
}
.omni-cat {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  padding: 0.1rem 0.35rem;
  border-radius: 2px;
  background: #111827;
  border: 1px solid #1e293b;
  color: #22d3ee;
  white-space: nowrap;
}

/* Global Dynamic State Banner */
.global-state-banner {
  background: #0e1726;
  border-bottom: 1px solid #06b6d4;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  display: none;
}
.global-state-banner.active {
  display: block;
}
.global-state-banner-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0.45rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.state-banner-metrics {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}

/* Container & Layout */
.container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 1.25rem 1rem 3rem;
  width: 100%;
  flex: 1;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--ink-muted);
  margin-bottom: 0.9rem;
}
.breadcrumbs a {
  color: var(--ink-secondary);
}
.breadcrumbs a:hover {
  color: #22d3ee;
}

/* Page Hero with Dark Carbon Quant Grid Backdrop */
.page-hero {
  background-color: #0b101b;
  background-image:
    linear-gradient(rgba(6, 182, 212, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(6, 182, 212, 0.05) 1px, transparent 1px);
  background-size: 24px 24px;
  border: 1px solid #1e293b;
  border-top: 2px solid #06b6d4;
  border-radius: 3px;
  padding: 1.35rem;
  margin-bottom: 1.15rem;
  box-shadow: var(--shadow-sm);
}
.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #22d3ee;
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(34, 211, 238, 0.38);
  padding: 0.2rem 0.55rem;
  border-radius: 3px;
  margin-bottom: 0.65rem;
}
.page-hero h1 {
  margin: 0 0 0.65rem 0;
  font-size: clamp(1.45rem, 2.4vw, 2.05rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: #f0f6fc;
}
.aeo-box, .hero-lead {
  background: rgba(17, 24, 39, 0.9);
  border-left: 3px solid #06b6d4;
  border-top: 1px solid #1e293b;
  border-right: 1px solid #1e293b;
  border-bottom: 1px solid #1e293b;
  padding: 0.9rem 1.05rem;
  border-radius: 0 3px 3px 0;
  margin-top: 0.75rem;
  font-size: 0.94rem;
  color: #cbd5e1;
}
.aeo-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.65rem;
  font-family: var(--font-mono);
  font-size: 0.73rem;
  color: #22d3ee;
}
.aeo-meta span {
  background: #0b101b;
  border: 1px solid #1e293b;
  padding: 0.15rem 0.45rem;
  border-radius: 2px;
}

/* 3. Unique CSI Quant Brief (Horizontal 6-Cell Terminal Telemetry Matrix) & Desk Ribbon */
.csi-quant-brief {
  background: #0b101b;
  border: 1px solid #1e293b;
  border-top: 2px solid #06b6d4;
  border-radius: 3px;
  padding: 0.95rem 1.1rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
}
.csi-quant-brief-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding-bottom: 0.65rem;
  margin-bottom: 0.8rem;
  border-bottom: 1px solid #151f30;
  font-family: var(--font-mono);
}
.csi-brief-status {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #22d3ee;
  text-transform: uppercase;
}
.csi-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #06b6d4;
  box-shadow: 0 0 8px #22d3ee;
  display: inline-block;
}
.csi-brief-sources {
  font-size: 0.69rem;
  color: #64748b;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.csi-telemetry-dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
  margin: 0;
  padding: 0;
}
.csi-telemetry-cell {
  background: #111827;
  border: 1px solid #1e293b;
  border-left: 2px solid #06b6d4;
  border-radius: 3px;
  padding: 0.6rem 0.8rem;
}
.csi-telemetry-cell dt {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  margin: 0 0 0.22rem 0;
}
.csi-telemetry-cell dd, dd {
  margin: 0 !important;
  margin-left: 0 !important;
  font-family: var(--font-mono);
  font-size: 0.86rem;
  font-weight: 700;
  color: #f0f6fc;
  line-height: 1.35;
}
@media (max-width: 960px) {
  .csi-telemetry-dl {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 600px) {
  .csi-telemetry-dl {
    grid-template-columns: 1fr;
  }
}

/* Collapsible Terminal Dossier Preview Drawer */
.csi-dossier-drawer {
  margin-top: 0.75rem;
  border: 1px solid #1e293b;
  background: #080c15;
  border-radius: 3px;
}
.csi-drawer-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.45rem 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: #94a3b8;
  cursor: pointer;
  list-style: none;
}
.csi-drawer-toggle::-webkit-details-marker {
  display: none;
}
.csi-drawer-toggle:hover {
  color: #22d3ee;
  background: #111827;
}
.csi-drawer-hint {
  color: #22d3ee;
  font-size: 0.68rem;
}
.csi-dossier-preview {
  margin: 0;
  padding: 0.65rem;
  border-top: 1px solid #151f30;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #060911;
}
.csi-dossier-preview img {
  max-width: 520px;
  width: 100%;
  height: auto;
  border: 1px solid #1e293b;
  border-radius: 3px;
  display: block;
}
.csi-dossier-preview figcaption {
  margin-top: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: #64748b;
}

/* Terminal Command Bar (.csi-desk-ribbon) */
.csi-desk-ribbon {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
  padding-top: 0.7rem;
  border-top: 1px solid #151f30;
}
.csi-ribbon-group {
  display: flex;
  align-items: center;
  gap: 0.38rem;
  flex-wrap: wrap;
}
.csi-cmd-key {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: #111827;
  border: 1px solid #1e293b;
  color: #e2e8f0;
  font-family: var(--font-mono);
  font-size: 0.71rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 0.32rem 0.58rem;
  border-radius: 3px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.12s ease;
}
.csi-cmd-key:hover {
  background: #162032;
  border-color: #06b6d4;
  color: #22d3ee;
  text-decoration: none;
}
.csi-cmd-accent {
  background: rgba(6, 182, 212, 0.14);
  border-color: rgba(34, 211, 238, 0.42);
  color: #22d3ee;
}
.csi-cmd-accent:hover, .csi-cmd-key.active {
  background: #06b6d4;
  border-color: #22d3ee;
  color: #060911;
}
.csi-cmd-ai {
  border-color: rgba(16, 185, 129, 0.38);
  color: #34d399;
}
.csi-cmd-ai:hover {
  background: rgba(16, 185, 129, 0.18);
  border-color: #10b981;
  color: #6ee7b7;
}
.data-table caption {
  text-align: left;
  font-size: 0.74rem;
  font-family: var(--font-mono);
  color: #94a3b8;
  padding: 0.65rem 0.85rem;
  background: #090d16;
  border-bottom: 1px solid #151f30;
  caption-side: top;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.prose-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.prose-block p {
  margin: 0 0 0.75rem 0;
  color: var(--ink-secondary);
  font-size: 0.92rem;
  line-height: 1.62;
}
.prose-block p:last-child {
  margin-bottom: 0;
}
@media (max-width: 760px) {
  .prose-grid {
    grid-template-columns: 1fr;
  }
}

/* Workbench & Grid Systems (Strictly Contained — Zero Horizontal Clipping) */
.workbench-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}
.workbench-left,
.workbench-right,
.panel,
.grid-2 > *,
.grid-3 > *,
.grid-4 > *,
.csi-compliance-grid > * {
  min-width: 0;
  max-width: 100%;
}
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.1rem;
  margin-bottom: 1.25rem;
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.9rem;
  margin-bottom: 1.25rem;
}

@media (max-width: 1080px) {
  .workbench-grid {
    grid-template-columns: 1fr;
  }
  .grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 760px) {
  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
  }
}

/* Panels & Cards */
.panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.15rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
}
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 0.75rem;
  margin-bottom: 0.95rem;
}
.panel-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #f0f6fc;
}
.panel-subtitle {
  font-size: 0.82rem;
  color: var(--ink-secondary);
  margin: 0.18rem 0 0;
}

/* KPI Stat Cards (Monospace Telemetry Tiles) */
.kpi-card {
  background: #0b101b;
  border: 1px solid #1e293b;
  border-top: 2px solid #06b6d4;
  border-radius: 3px;
  padding: 0.9rem 1.05rem;
  box-shadow: var(--shadow-sm);
}
.kpi-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
}
.kpi-val {
  font-family: var(--font-mono);
  font-size: 1.38rem;
  font-weight: 700;
  color: #22d3ee;
  margin: 0.25rem 0;
  font-variant-numeric: tabular-nums;
}
.kpi-note {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: #64748b;
}

/* Badges & Pills */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 0.16rem 0.48rem;
  border-radius: 3px;
  white-space: nowrap;
}
.badge-emerald {
  background: var(--emerald-bg);
  color: var(--emerald-ink);
  border: 1px solid var(--emerald-border);
}
.badge-cobalt {
  background: var(--cobalt-bg);
  color: var(--cobalt-ink);
  border: 1px solid var(--cobalt-border);
}
.badge-amber {
  background: var(--amber-bg);
  color: var(--amber-ink);
  border: 1px solid var(--amber-border);
}
.badge-crimson {
  background: var(--crimson-bg);
  color: var(--crimson-ink);
  border: 1px solid var(--crimson-border);
}
.badge-neutral {
  background: #111827;
  color: var(--ink-secondary);
  border: 1px solid var(--border-color);
}

/* Interactive Controls: Tabs, Toggles & Filter Pills */
.control-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  background: #111827;
  border: 1px solid #1e293b;
  padding: 0.6rem 0.8rem;
  border-radius: 3px;
  margin-bottom: 0.9rem;
}
.tab-group {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  flex-wrap: wrap;
}
.tab-btn, .filter-chip {
  background: #0b101b;
  border: 1px solid #1e293b;
  color: var(--ink-secondary);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.35rem 0.68rem;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.14s;
}
.tab-btn:hover, .filter-chip:hover {
  border-color: #06b6d4;
  color: #22d3ee;
}
.tab-btn.active, .filter-chip.active {
  background: #06b6d4;
  border-color: #22d3ee;
  color: #060911;
  font-weight: 700;
}

/* Flawless Quant Terminal Tables (.csi-table-frame) */
.csi-table-frame, .table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid #1e293b;
  border-top: 2px solid #06b6d4;
  background: #0b101b;
  border-radius: 4px;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.data-table thead th, .data-table th {
  background: #111827;
  color: #22d3ee;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.73rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-align: left;
  padding: 0.7rem 0.85rem;
  border-bottom: 1px solid #1e293b;
  position: sticky;
  top: 0;
  z-index: 2;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}
.data-table thead th:hover {
  background: #162032;
  color: #67e8f9;
}
.data-table td {
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid #151f30;
  vertical-align: middle;
  color: #e2e8f0;
  line-height: 1.45;
}
.data-table tbody tr:nth-child(odd) {
  background: #0b101b;
}
.data-table tbody tr:nth-child(even) {
  background: #0e1524;
}
.data-table tbody tr:hover {
  background: rgba(6, 182, 212, 0.08);
}
.data-table tr.state-restricted-row {
  opacity: 0.68;
}

@media (max-width: 780px) {
  .data-table th, .data-table td {
    padding: 0.55rem 0.65rem;
    font-size: 0.8rem;
  }
}

/* 51-Jurisdiction State Matrix Grid */
.state-matrix-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(58px, 1fr));
  gap: 0.38rem;
}
.state-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.38rem 0.22rem;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid #1e293b;
  transition: transform 0.1s, border-color 0.1s;
}
.state-cell:hover {
  transform: translateY(-1px);
  border-color: #22d3ee;
  text-decoration: none;
}
.state-cell .st-sub {
  font-size: 0.6rem;
  font-weight: 500;
  opacity: 0.88;
}
.state-cell.st-ok {
  background: var(--emerald-bg);
  color: var(--emerald-ink);
  border-color: var(--emerald-border);
}
.state-cell.st-warn {
  background: var(--amber-bg);
  color: var(--amber-ink);
  border-color: var(--amber-border);
}
.state-cell.st-ban {
  background: var(--crimson-bg);
  color: var(--crimson-ink);
  border-color: var(--crimson-border);
}
.state-cell.selected-user-state {
  outline: 2px solid #22d3ee;
  outline-offset: 1px;
}

/* Form Inputs & Calculator Controls */
.calc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1rem;
}
.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.32rem;
}
.form-field label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.form-input, .form-select {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  padding: 0.5rem 0.68rem;
  border: 1px solid #1e293b;
  border-radius: 3px;
  background: #111827;
  color: #f0f6fc;
  width: 100%;
}
.form-input:focus, .form-select:focus {
  outline: 1px solid #22d3ee;
  border-color: #06b6d4;
}

/* SVG Charts */
.svg-chart-wrap {
  width: 100%;
  overflow-x: auto;
  background: #0b101b;
  border: 1px solid #1e293b;
  border-left: 2px solid #06b6d4;
  border-radius: 3px;
  padding: 0.75rem 1rem;
}
.svg-chart-wrap svg {
  width: 100%;
  max-width: 920px;
  height: auto;
  display: block;
}

/* FAQ Accordion */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.faq-item {
  border: 1px solid #1e293b;
  border-left: 2px solid #06b6d4;
  border-radius: 3px;
  background: #111827;
  padding: 0.75rem 1rem;
}
.faq-item summary {
  font-weight: 700;
  cursor: pointer;
  color: #f0f6fc;
  font-size: 0.94rem;
}
.faq-item summary:hover {
  color: #22d3ee;
}
.faq-item p {
  margin: 0.6rem 0 0;
  color: #94a3b8;
  font-size: 0.89rem;
  line-height: 1.6;
}

/* 4. Unique CSI Compliance Terminal (.csi-compliance-terminal) */
.csi-compliance-terminal {
  background: #0b101b;
  border: 1px solid #1e293b;
  border-top: 2px solid #06b6d4;
  border-radius: 4px;
  padding: 1.2rem;
  margin-top: 1.5rem;
  box-shadow: var(--shadow-sm);
}
.csi-compliance-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 1.25rem;
}
@media (max-width: 960px) {
  .csi-compliance-grid {
    grid-template-columns: 1fr;
  }
}
.csi-pretrade-protocol, .csi-wire-dispatch {
  background: #080c15;
  border: 1px solid #151f30;
  border-radius: 3px;
  padding: 1rem;
}
.csi-terminal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding-bottom: 0.55rem;
  margin-bottom: 0.65rem;
  border-bottom: 1px solid #151f30;
  font-family: var(--font-mono);
}
.csi-terminal-tag {
  font-size: 0.71rem;
  font-weight: 700;
  color: #22d3ee;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.csi-protocol-score {
  font-size: 0.72rem;
  font-weight: 700;
  color: #10b981;
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(16, 185, 129, 0.35);
  padding: 0.12rem 0.45rem;
  border-radius: 2px;
}
.csi-terminal-title {
  margin: 0 0 0.35rem 0;
  font-size: 1.02rem;
  color: #f0f6fc;
}
.csi-terminal-sub {
  margin: 0 0 0.75rem 0;
  font-size: 0.83rem;
  color: #94a3b8;
}
.csi-protocol-bar {
  width: 100%;
  height: 6px;
  background: #111827;
  border: 1px solid #1e293b;
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 0.8rem;
}
.csi-protocol-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #06b6d4, #10b981);
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.6);
  transition: width 0.2s ease;
}
.csi-protocol-switches {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 0.85rem;
}
.csi-switch-row {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  background: #111827;
  border: 1px solid #1e293b;
  padding: 0.5rem 0.65rem;
  border-radius: 3px;
  font-size: 0.81rem;
  color: #cbd5e1;
  cursor: pointer;
}
.csi-switch-row:hover {
  border-color: #06b6d4;
}
.csi-switch-row input[type="checkbox"] {
  accent-color: #06b6d4;
  margin-top: 0.18rem;
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}
.csi-protocol-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.csi-wire-form {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 0.85rem;
}
.csi-wire-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}
@media (max-width: 600px) {
  .csi-wire-inputs {
    grid-template-columns: 1fr;
  }
}
.csi-terminal-input, .csi-terminal-select {
  background: #111827;
  border: 1px solid #1e293b;
  color: #f0f6fc;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 0.48rem 0.65rem;
  border-radius: 3px;
  width: 100%;
}
.csi-terminal-input:focus, .csi-terminal-select:focus {
  outline: 1px solid #22d3ee;
  border-color: #06b6d4;
}
.csi-wire-submit {
  justify-content: center;
  padding: 0.48rem 0.8rem;
}
.csi-wire-status {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: #10b981;
}
.csi-correction-drawer summary {
  list-style: none;
  width: 100%;
  justify-content: center;
}
.csi-correction-drawer summary::-webkit-details-marker {
  display: none;
}
.csi-correction-form {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-top: 0.55rem;
  padding: 0.65rem;
  background: #111827;
  border: 1px solid #1e293b;
  border-radius: 3px;
}
.csi-corr-msg {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: #10b981;
}

/* Terminal Modals (#csi-watchlist-drawer & #csi-cite-modal) */
.csi-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 7, 13, 0.82);
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.csi-modal-backdrop[hidden] {
  display: none !important;
}
.csi-modal-panel {
  background: #0b101b;
  border: 1px solid #06b6d4;
  border-top: 2px solid #22d3ee;
  border-radius: 4px;
  width: min(620px, 95vw);
  max-height: 85vh;
  overflow-y: auto;
  padding: 1.1rem;
  box-shadow: var(--shadow-md);
}
.csi-watchlist-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.csi-watch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 0.65rem;
  background: #111827;
  border: 1px solid #1e293b;
  border-radius: 3px;
  font-size: 0.83rem;
}
.csi-cite-pre {
  background: #060911;
  border: 1px solid #1e293b;
  padding: 0.75rem;
  border-radius: 3px;
  font-size: 0.75rem;
  color: #cbd5e1;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0 0 0.75rem 0;
}

/* Footer */
.site-footer {
  background: #04070d;
  color: #94a3b8;
  border-top: 1px solid #1e293b;
  padding: 2.5rem 1rem;
  margin-top: auto;
  font-size: 0.84rem;
}
.footer-inner {
  max-width: 1440px;
  margin: 0 auto;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-bottom: 1.75rem;
}
.footer-col h3 {
  font-family: var(--font-mono);
  color: #22d3ee;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 0.65rem 0;
}
.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.footer-col a {
  color: #94a3b8;
}
.footer-col a:hover {
  color: #22d3ee;
}
.footer-legal {
  border-top: 1px solid #151f30;
  padding-top: 1.25rem;
  color: #64748b;
  font-family: var(--font-mono);
  font-size: 0.73rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

@media (max-width: 640px) {
  .header-inner {
    flex-direction: column;
    align-items: stretch;
  }
  .header-tools {
    justify-content: space-between;
  }
  .omnisearch-input {
    width: 100%;
  }
  .omnisearch-wrap {
    flex: 1;
  }
}
