:root {
  --bg: #f8fafc;
  --dot: #cbd5e1;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --ink: #0f172a;
  --muted: #475569;
  --indigo: #4f46e5;
  --indigo-hover: #4338ca;
  --indigo-soft: #eef2ff;
  --cyan: #0ea5e9;
  --emerald: #059669;
  --emerald-bg: #ecfdf5;
  --emerald-border: #a7f3d0;
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.06);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  background-color: #ffffff;
}

.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header & Telemetry */
.site-header {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 30;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 60px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
}

.brand-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: #1d4ed8;
  color: #ffffff;
}

.brand-name {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.brand-tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--muted);
  background: #f1f5f9;
  border: 1px solid var(--border);
  padding: 2px 7px;
  border-radius: 4px;
}

.main-nav a {
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
  background: #f1f5f9;
  padding: 6px 12px;
  border-radius: 4px;
}

.telemetry-bar {
  background: #f8fafc;
  color: var(--muted);
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 6px 0;
}

.telemetry-inner {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.telemetry-bar code {
  background: #ffffff;
  border: 1px solid var(--border);
  color: var(--ink);
  padding: 1px 6px;
  border-radius: 4px;
}

.dot {
  display: none;
}

.dot-green { background: #10b981; }
.dot-indigo { background: #818cf8; }
.dot-cyan { background: #38bdf8; }

.main-content {
  padding: 32px 24px 64px;
}

/* Hero & Pipeline Flow */
.hero {
  margin-bottom: 24px;
}

.hero-kicker {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--indigo);
  margin-bottom: 8px;
}

h1 {
  font-size: clamp(1.75rem, 3vw, 2.35rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin: 0 0 10px;
}

.subtitle {
  color: var(--muted);
  font-size: 1.02rem;
  max-width: 820px;
  margin: 0 0 22px;
}

.pipeline-flow {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 16px;
  flex-wrap: wrap;
}

.flow-node {
  flex: 1 1 220px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 14px 16px;
}

.node-highlight {
  border-color: #94a3b8;
  background: #ffffff;
}

.node-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 4px;
}

.node-title {
  font-weight: 700;
  font-size: 0.96rem;
  margin-bottom: 2px;
}

.node-meta {
  font-size: 0.8rem;
  color: var(--muted);
}

.flow-edge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  min-width: 115px;
}

.edge-badge {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--muted);
  background: #ffffff;
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 4px;
}

.edge-line {
  width: 100%;
  height: 1px;
  background: #cbd5e1;
}

/* Executive Summary */
.direct-answer {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-left: 3px solid #2563eb;
  border-radius: 6px;
  padding: 18px 22px;
  margin: 22px 0;
}

.direct-answer-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.ai-badge {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: #1d4ed8;
  color: #ffffff;
  padding: 3px 8px;
  border-radius: 4px;
}

.direct-answer-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}

h2 {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 34px 0 14px;
}

h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0 0 8px;
}

.disclosure {
  font-size: 0.86rem;
  color: var(--muted);
  margin-bottom: 16px;
}

/* Filters Bar */
.filters-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}

.filter-group label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 5px;
}

.filter-group select,
.filter-group input[type="text"] {
  width: 100%;
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 8px 11px;
  font-family: var(--font-sans);
  font-size: 0.9rem;
}

.filter-group select:focus,
.filter-group input[type="text"]:focus {
  outline: 2px solid #c7d2fe;
  border-color: var(--indigo);
}

/* Data Table */
.table-wrap {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th, td {
  padding: 13px 15px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--surface-2);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

tbody tr:hover {
  background: #f8fafc;
}

tr:last-child td {
  border-bottom: none;
}

.connector-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.connector-logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px;
  flex-shrink: 0;
}

.connector-sub {
  font-family: var(--font-mono);
  font-size: 0.73rem;
  color: var(--muted);
}

.connector-desc {
  font-size: 0.84rem;
  color: var(--muted);
  margin-top: 6px;
}

.pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--surface-2);
  color: var(--ink);
  border: 1px solid var(--border);
  margin: 2px 4px 2px 0;
}

.pill-proto {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--indigo);
  background: var(--indigo-soft);
  border-color: #c7d2fe;
}

.pill-yes {
  color: var(--emerald);
  background: var(--emerald-bg);
  border-color: var(--emerald-border);
}

.pill-no {
  color: var(--muted);
}

.mono-cell {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.btn {
  display: inline-block;
  background: var(--indigo);
  color: #ffffff;
  font-weight: 600;
  text-decoration: none;
  padding: 7px 13px;
  border-radius: 8px;
  font-size: 0.82rem;
  white-space: nowrap;
  transition: background 0.15s ease;
}

.btn:hover {
  background: var(--indigo-hover);
}

code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 1px 5px;
  border-radius: 4px;
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 20px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 22px 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-links {
  display: flex;
  gap: 16px;
}

.footer-links a {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--muted);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--indigo);
}

/* Scenario Chips */
.scenario-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.chip {
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 6px 13px;
  cursor: pointer;
  transition: all 0.12s ease;
}

.chip:hover {
  border-color: var(--indigo);
  color: var(--indigo);
}

.chip.active {
  background: var(--indigo);
  border-color: var(--indigo);
  color: #ffffff;
}

.row-actions {
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
}

.btn-secondary {
  background: var(--surface-2);
  color: var(--ink);
  border: 1px solid var(--border-strong);
}

.btn-secondary:hover {
  background: var(--border);
}

/* AI Config Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 50;
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-card {
  width: 100%;
  max-width: 720px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.2);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.modal-pre {
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 8px;
  padding: 14px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.55;
  margin: 0 0 14px;
}

.modal-pre code {
  background: transparent;
  border: none;
  color: inherit;
  padding: 0;
}

.modal-footer {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
