:root {
  --bg-page: #060b16;
  --bg-surface: #0c162b;
  --bg-card: #101d36;
  --bg-input: #070e1c;
  --border-subtle: rgba(148, 163, 184, 0.24);
  --border-emerald: rgba(52, 211, 153, 0.45);
  --border-cyan: rgba(56, 189, 248, 0.42);
  --text-main: #f8fafc;
  --text-muted: #9eb3d6;
  --emerald: #34d399;
  --cyan: #38bdf8;
  --amber: #fbbf24;
  --coral: #fb7185;
  --font-sans: "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", "SFMono-Regular", Consolas, Menlo, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: radial-gradient(circle at 20% 0%, #13254a 0%, #060b16 68%);
  color: var(--text-main);
  font-family: var(--font-sans);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.hidden {
  display: none !important;
}

.accent-emerald { color: var(--emerald); }
.accent-cyan { color: var(--cyan); }
.accent-amber { color: var(--amber); }
.accent-coral { color: var(--coral); }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--emerald);
  color: #041911;
  padding: 8px 12px;
  font-weight: 700;
  z-index: 100;
}

.skip-link:focus {
  left: 12px;
  top: 12px;
}

/* ================= HEADER & TABS ================= */
.top-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(6, 11, 22, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-subtle);
}

.header-inner {
  max-width: 1360px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-logo {
  flex-shrink: 0;
  border-radius: 9px;
  border: 1px solid var(--border-emerald);
}

.brand-text {
  min-width: 0;
}

.brand-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.brand-name {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 900;
  letter-spacing: -0.01em;
}

.brand-tagline {
  margin: 2px 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

.tag-value {
  background: rgba(251, 191, 36, 0.14);
  color: var(--amber);
  border: 1px solid rgba(251, 191, 36, 0.42);
}

.tag-spec {
  background: rgba(56, 189, 248, 0.12);
  color: var(--cyan);
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.header-ctas {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.module-tabs {
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 20px 10px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.mod-tab {
  border: 1px solid var(--border-subtle);
  background: rgba(12, 22, 43, 0.85);
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 7px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.mod-tab:hover {
  border-color: var(--cyan);
  color: var(--text-main);
}

.mod-tab.is-active {
  background: rgba(52, 211, 153, 0.14);
  border-color: var(--emerald);
  color: var(--text-main);
}

.tab-code {
  color: var(--emerald);
  margin-right: 4px;
}

.header-live-status {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.72rem;
  color: var(--emerald);
  background: rgba(52, 211, 153, 0.08);
  border: 1px solid rgba(52, 211, 153, 0.3);
  border-radius: 999px;
  padding: 5px 11px;
  white-space: nowrap;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 8px var(--emerald);
}

/* ================= MAIN WORKBENCH ================= */
.workbench {
  max-width: 1360px;
  margin: 0 auto;
  padding: 18px 20px 32px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.eval-hero {
  background: linear-gradient(135deg, rgba(16, 29, 54, 0.96) 0%, rgba(9, 17, 34, 0.96) 100%);
  border: 1px solid var(--border-cyan);
  border-radius: 14px;
  padding: 20px 22px;
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  gap: 18px;
  align-items: center;
}

.eyebrow {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--cyan);
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}

.eval-copy h2 {
  margin: 0 0 8px;
  font-size: clamp(1.25rem, 2.2vw, 1.7rem);
  line-height: 1.2;
}

.hero-desc {
  margin: 0 0 14px;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.hero-desc strong {
  color: var(--text-main);
}

.hero-desc code {
  font-family: var(--font-mono);
  background: rgba(56, 189, 248, 0.12);
  color: var(--cyan);
  padding: 1px 5px;
  border-radius: 4px;
}

.hero-actions,
.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.eval-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.metric-card {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 11px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.metric-k {
  font-size: 0.64rem;
  color: var(--text-muted);
  letter-spacing: 0.06em;
}

.metric-v {
  font-size: 0.98rem;
  font-weight: 800;
}

.metric-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* ================= BUTTONS & FORMS ================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform 0.12s ease, filter 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
}

.btn-primary {
  background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
  color: #031d13;
  border-color: #6ee7b7;
}

.btn-outline {
  background: rgba(12, 22, 43, 0.9);
  color: var(--cyan);
  border-color: var(--border-cyan);
}

.btn-ghost {
  background: rgba(15, 25, 48, 0.7);
  color: var(--text-main);
  border-color: var(--border-subtle);
}

.btn-sm {
  padding: 5px 10px;
  font-size: 0.74rem;
}

.panel-grid.split-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 13px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.card-kicker {
  display: block;
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--cyan);
  letter-spacing: 0.06em;
  margin-bottom: 3px;
}

.card-head h3 {
  margin: 0;
  font-size: 1.05rem;
}

.badge {
  font-size: 0.7rem;
  font-weight: 800;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.14);
  color: var(--cyan);
  border: 1px solid var(--border-cyan);
  white-space: nowrap;
}

.badge.is-ok {
  background: rgba(52, 211, 153, 0.16);
  color: var(--emerald);
  border-color: var(--border-emerald);
}

.badge.is-blocked {
  background: rgba(251, 113, 133, 0.16);
  color: var(--coral);
  border-color: rgba(251, 113, 133, 0.45);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.field-lbl {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 0.82rem;
}

.input:focus {
  outline: none;
  border-color: var(--cyan);
}

.compact-select {
  width: auto;
  min-width: 150px;
}

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

.pill-btn {
  border: 1px solid var(--border-subtle);
  background: var(--bg-input);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 5px 9px;
  border-radius: 999px;
  cursor: pointer;
}

.pill-btn.is-selected {
  border-color: var(--emerald);
  background: rgba(52, 211, 153, 0.15);
  color: var(--emerald);
}

.code-box {
  margin: 0;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  padding: 11px 12px;
  font-size: 0.76rem;
  line-height: 1.45;
  color: #dbeafe;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.code-tall {
  min-height: 290px;
  max-height: 360px;
  overflow-y: auto;
}

.cidr-summary {
  background: rgba(7, 14, 28, 0.8);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.73rem;
  line-height: 1.5;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cidr-summary code {
  color: var(--amber);
}

.dlq-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 250px;
  overflow-y: auto;
}

.dlq-item {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.dlq-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.dlq-title {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--text-main);
}

.dlq-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* ================= ROI TABLE & FOOTER ================= */
.roi-table {
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  overflow: hidden;
  font-size: 0.76rem;
}

.roi-row {
  display: grid;
  grid-template-columns: 1fr 1.15fr 1fr;
  gap: 8px;
  padding: 8px 11px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-input);
}

.roi-row.roi-head {
  border-top: 0;
  background: rgba(16, 29, 54, 0.96);
  font-weight: 800;
  color: var(--text-muted);
}

.site-footer {
  max-width: 1360px;
  margin: 0 auto;
  padding: 14px 20px 24px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.74rem;
  color: var(--text-muted);
}

.site-footer a {
  color: var(--emerald);
  text-decoration: none;
}

@media (max-width: 960px) {
  .eval-hero,
  .panel-grid.split-2 {
    grid-template-columns: 1fr;
  }

  .header-live-status {
    margin-left: 0;
  }
}

@media (max-width: 560px) {
  .header-inner,
  .module-tabs,
  .workbench,
  .site-footer {
    padding-left: 12px;
    padding-right: 12px;
  }

  .form-row,
  .eval-metrics {
    grid-template-columns: 1fr;
  }

  .roi-row {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .btn {
    width: 100%;
  }
}
