:root {
  --bg-canvas: #050913;
  --bg-surface: #0c1425;
  --bg-elevated: #121d36;
  --bg-inset: #03060e;
  --border-subtle: rgba(148, 163, 184, 0.22);
  --border-strong: rgba(56, 189, 248, 0.45);
  --text-main: #f8fafc;
  --text-muted: #9eb3d1;
  --emerald: #10b981;
  --cyan: #38bdf8;
  --amber: #f59e0b;
  --rose: #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;
  background: var(--bg-canvas);
  color: var(--text-main);
  font-family: var(--font-sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

.hidden {
  display: none !important;
}

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

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

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

/* ================= HEADER ================= */
.top-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(5, 9, 19, 0.96);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-subtle);
}

.header-inner {
  max-width: 1380px;
  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: 10px;
}

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

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

.brand-name {
  margin: 0;
  font-size: 1.24rem;
  font-weight: 800;
  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: 700;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
}

.tag-value {
  color: var(--emerald);
  background: rgba(16, 185, 129, 0.14);
  border-color: rgba(16, 185, 129, 0.4);
}

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

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

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

.mod-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: rgba(12, 20, 37, 0.9);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

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

.mod-tab.is-active {
  background: rgba(56, 189, 248, 0.16);
  color: var(--text-main);
  border-color: var(--cyan);
}

.tab-code {
  color: var(--cyan);
  font-size: 0.72rem;
}

.header-live-status {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.72rem;
  color: var(--emerald);
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  padding: 5px 10px;
  border-radius: 999px;
}

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

/* ================= BUTTONS ================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 9px;
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #031510;
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.3);
}

.btn-primary:hover {
  filter: brightness(1.06);
}

.btn-outline {
  background: rgba(12, 20, 37, 0.9);
  color: var(--cyan);
  border-color: var(--border-strong);
}

.btn-outline:hover {
  background: rgba(20, 34, 62, 0.95);
}

.btn-ghost {
  background: rgba(148, 163, 184, 0.08);
  color: var(--text-main);
  border-color: var(--border-subtle);
}

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

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

.eval-hero {
  background: linear-gradient(135deg, rgba(16, 28, 54, 0.95), rgba(8, 14, 28, 0.96));
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  padding: 20px 22px;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 20px;
  align-items: center;
}

.eyebrow {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  color: var(--emerald);
}

.eval-copy h2 {
  margin: 6px 0 8px;
  font-size: 1.5rem;
  line-height: 1.22;
}

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

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

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

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

.metric-card {
  background: rgba(5, 9, 19, 0.88);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 11px 13px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

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

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

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

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

.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 13px;
  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;
  color: var(--cyan);
  font-weight: 700;
  letter-spacing: 0.05em;
}

.card-head h3 {
  margin: 2px 0 0;
  font-size: 1.06rem;
}

.status-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
}

.badge-neutral {
  color: var(--text-muted);
  background: rgba(148, 163, 184, 0.14);
  border-color: var(--border-subtle);
}

.badge-ok {
  color: var(--emerald);
  background: rgba(16, 185, 129, 0.16);
  border-color: rgba(16, 185, 129, 0.45);
}

.badge-warn {
  color: var(--amber);
  background: rgba(245, 158, 11, 0.16);
  border-color: rgba(245, 158, 11, 0.45);
}

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

.telemetry-mini {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.mini-stat {
  background: var(--bg-inset);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.mini-k {
  font-size: 0.61rem;
  color: var(--text-muted);
}

.mini-v {
  font-size: 0.96rem;
  font-weight: 800;
}

.preset-row,
.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.pill-btn {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-inset);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
}

.pill-btn:hover {
  color: var(--text-main);
  border-color: var(--border-strong);
}

.pill-btn.is-selected {
  background: rgba(56, 189, 248, 0.16);
  border-color: var(--cyan);
  color: var(--text-main);
}

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

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

.field-label {
  font-size: 0.67rem;
  color: var(--text-muted);
  font-weight: 700;
  letter-spacing: 0.05em;
}

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

.text-area {
  resize: vertical;
  min-height: 76px;
}

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

.code-box {
  margin: 0;
  padding: 12px;
  border-radius: 10px;
  background: var(--bg-inset);
  border: 1px solid var(--border-subtle);
  color: #cbd5e1;
  font-size: 0.74rem;
  line-height: 1.48;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-x: auto;
  max-height: 230px;
}

.code-tall {
  max-height: 360px;
}

/* ================= LIFECYCLE TRACK & ROI ================= */
.tls-track {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.tls-step {
  padding: 8px 10px;
  border-radius: 9px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-inset);
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: center;
  font-weight: 700;
}

.tls-step.is-done {
  border-color: var(--emerald);
  background: rgba(16, 185, 129, 0.14);
  color: var(--emerald);
}

.tls-step.is-active {
  border-color: var(--cyan);
  background: rgba(56, 189, 248, 0.15);
  color: var(--cyan);
}

.roi-table {
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  overflow: hidden;
  font-size: 0.75rem;
}

.roi-row {
  display: grid;
  grid-template-columns: 1.1fr 1.1fr 1.1fr;
  gap: 8px;
  padding: 9px 12px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-inset);
}

.roi-row:first-child {
  border-top: 0;
}

.roi-head {
  background: var(--bg-elevated);
  font-weight: 800;
  color: var(--text-muted);
}

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

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

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

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

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

  .eval-hero,
  .card {
    padding: 14px;
  }

  .eval-copy h2 {
    font-size: 1.24rem;
  }

  .form-row-2,
  .telemetry-mini,
  .tls-track {
    grid-template-columns: minmax(0, 1fr);
  }

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

  .btn {
    width: 100%;
  }
}
