:root {
  --bg: #08111d;
  --panel: rgba(13, 25, 41, 0.88);
  --panel-strong: #101d2f;
  --ink: #e6edf3;
  --muted: #94a3b8;
  --accent: #f59e0b;
  --accent-deep: #b45309;
  --accent-soft: rgba(245, 158, 11, 0.14);
  --teal: #22d3ee;
  --teal-soft: rgba(34, 211, 238, 0.14);
  --warn: #f59e0b;
  --danger: #fb7185;
  --danger-soft: rgba(251, 113, 133, 0.14);
  --success: #34d399;
  --success-soft: rgba(52, 211, 153, 0.14);
  --line: rgba(148, 163, 184, 0.18);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.3);
  --radius: 20px;
  --radius-sm: 14px;
  --max: 1180px;
  --heading-font: "Avenir Next Condensed", "DIN Condensed", "Bahnschrift", "Segoe UI", sans-serif;
  --body-font: "Avenir Next", "Trebuchet MS", "Segoe UI", sans-serif;
  --mono-font: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--body-font);
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(34, 211, 238, 0.14), transparent 32%),
    radial-gradient(circle at bottom right, rgba(245, 158, 11, 0.12), transparent 30%),
    linear-gradient(135deg, rgba(148, 163, 184, 0.04) 25%, transparent 25%) 0 0 / 34px 34px,
    linear-gradient(180deg, #07111d 0%, #0b1422 52%, #07101b 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
}

.shell {
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(14px);
  background: rgba(7, 17, 29, 0.86);
  border-bottom: 1px solid var(--line);
}

.site-header .shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background:
    linear-gradient(135deg, rgba(34, 211, 238, 0.95) 0%, rgba(245, 158, 11, 0.9) 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.28),
    0 0 26px rgba(34, 211, 238, 0.2);
  position: relative;
}

.brand-mark::after {
  content: "";
  position: absolute;
  inset: 11px;
  border: 2px solid rgba(8, 17, 29, 0.78);
  border-radius: 8px 8px 4px 4px;
}

.brand h1,
.brand strong {
  margin: 0;
  font-size: 1rem;
  letter-spacing: 0.02em;
}

.brand p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.main-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.nav-link,
.button,
button {
  border: 0;
  border-radius: 999px;
  padding: 11px 18px;
  font: inherit;
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.nav-link {
  color: var(--muted);
}

.nav-link.active {
  background: rgba(34, 211, 238, 0.12);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(34, 211, 238, 0.18);
}

.nav-link:hover,
.button:hover,
button:hover {
  transform: translateY(-1px);
}

.button,
button {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
  color: #07111d;
  font-weight: 700;
  box-shadow: 0 14px 30px rgba(245, 158, 11, 0.18);
}

.button.secondary,
button.secondary {
  background: var(--panel-strong);
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: none;
}

.button.teal,
button.teal {
  background: linear-gradient(135deg, var(--teal) 0%, #0891b2 100%);
  color: #05101c;
  box-shadow: 0 12px 28px rgba(34, 211, 238, 0.16);
}

.hero,
.section,
.card,
.data-panel,
.table-card,
.report-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

main.shell {
  padding: 28px 0 56px;
}

.hero {
  padding: 34px;
  overflow: hidden;
  position: relative;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto -20% -30% auto;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.18), transparent 68%);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(34, 211, 238, 0.1);
  color: #bae6fd;
  font-size: 0.85rem;
  font-family: var(--mono-font);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.hero h2,
.page-title {
  margin: 16px 0 10px;
  font-family: var(--heading-font);
  font-size: clamp(2rem, 3.4vw, 3.4rem);
  line-height: 1.04;
  letter-spacing: 0.01em;
}

.hero p,
.lead {
  max-width: 680px;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.7;
}

.hero-actions,
.button-row,
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.command-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 18px;
  margin-top: 24px;
  position: relative;
  z-index: 1;
}

.command-panel {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(2, 6, 23, 0.34);
}

.command-panel.featured {
  border-color: rgba(34, 211, 238, 0.26);
  background:
    linear-gradient(145deg, rgba(34, 211, 238, 0.13), rgba(2, 6, 23, 0.38)),
    rgba(2, 6, 23, 0.34);
}

.command-panel h3 {
  margin: 14px 0 8px;
}

.command-panel p {
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.55;
}

.grid {
  display: grid;
  gap: 18px;
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.stat-card,
.mini-stat {
  padding: 18px;
  border-radius: var(--radius-sm);
  background: rgba(15, 23, 42, 0.62);
  border: 1px solid var(--line);
}

.stat-card .label,
.mini-stat .label {
  color: var(--muted);
  font-size: 0.9rem;
}

.stat-card .value,
.mini-stat .value {
  margin-top: 8px;
  font-size: 2rem;
  font-weight: 700;
}

.section {
  margin-top: 20px;
  padding: 26px;
}

.section h3,
.card h3,
.data-panel h3,
.table-card h3,
.report-panel h3 {
  margin: 0 0 8px;
  font-size: clamp(1.1rem, 1.6vw, 1.28rem);
  line-height: 1.25;
}

.section p,
.card p,
.subtle,
label span,
small,
td,
th,
li {
  color: var(--muted);
  line-height: 1.6;
}

.card,
.data-panel,
.table-card,
.report-panel {
  padding: 22px;
}

.card {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 18px;
  align-items: stretch;
}

.focus-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.browser-launch-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.browser-run-results {
  margin-top: 18px;
}

.setup-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card > :last-child {
  margin-bottom: 0;
}

.card > button:last-child,
.card > .button:last-child {
  margin-top: auto;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.85rem;
  background: rgba(148, 163, 184, 0.12);
  color: var(--ink);
}

.badge.warn {
  background: var(--danger-soft);
  color: var(--danger);
}

.badge.ok {
  background: var(--success-soft);
  color: var(--success);
}

.badge.teal {
  background: var(--teal-soft);
  color: var(--teal);
}

form {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 8px;
  font-weight: 600;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  font: inherit;
  background: rgba(2, 6, 23, 0.34);
  color: var(--ink);
}

input::placeholder,
textarea::placeholder {
  color: rgba(148, 163, 184, 0.74);
}

textarea {
  min-height: 132px;
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  outline: 2px solid rgba(34, 211, 238, 0.18);
  border-color: rgba(34, 211, 238, 0.48);
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.feedback {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid transparent;
  display: none;
}

.feedback.visible {
  display: block;
}

.feedback.success {
  background: var(--success-soft);
  color: var(--success);
  border-color: rgba(17, 107, 79, 0.12);
}

.feedback.error {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: rgba(165, 36, 36, 0.12);
}

.feedback.info {
  background: var(--accent-soft);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.18);
}

.job-status-panel {
  margin: 0 0 18px;
  padding: 18px;
  border-radius: var(--radius-sm);
  background:
    linear-gradient(135deg, rgba(34, 211, 238, 0.14), rgba(245, 158, 11, 0.1)),
    rgba(2, 6, 23, 0.42);
  border: 1px solid rgba(34, 211, 238, 0.2);
}

.job-status-panel .toolbar {
  justify-content: space-between;
}

.job-status-panel p {
  margin: 10px 0 0;
}

.job-card {
  position: relative;
}

.job-card.is-running {
  border-color: rgba(34, 211, 238, 0.36);
  box-shadow:
    var(--shadow),
    0 0 0 1px rgba(34, 211, 238, 0.12),
    0 0 30px rgba(34, 211, 238, 0.08);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  padding: 7px 11px;
  border-radius: 999px;
  font-family: var(--mono-font);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border: 1px solid var(--line);
  background: rgba(148, 163, 184, 0.12);
  color: var(--muted);
}

.status-pill.running {
  background: rgba(34, 211, 238, 0.12);
  border-color: rgba(34, 211, 238, 0.26);
  color: #bae6fd;
}

.status-pill.completed {
  background: var(--success-soft);
  border-color: rgba(52, 211, 153, 0.22);
  color: var(--success);
}

.status-pill.failed {
  background: var(--danger-soft);
  border-color: rgba(251, 113, 133, 0.22);
  color: var(--danger);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 0 0 0 currentColor;
  animation: pulse-dot 1.4s ease-out infinite;
}

@keyframes pulse-dot {
  0% {
    box-shadow: 0 0 0 0 rgba(34, 211, 238, 0.45);
  }

  70% {
    box-shadow: 0 0 0 9px rgba(34, 211, 238, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(34, 211, 238, 0);
  }
}

.table-wrap {
  overflow-x: auto;
}

.matrix-wrap {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(2, 6, 23, 0.22);
}

table {
  width: 100%;
  border-collapse: collapse;
}

.matrix-table {
  min-width: 980px;
}

.matrix-table th,
.matrix-table td {
  padding: 14px 16px;
}

.matrix-table th {
  color: #cbd5e1;
  font-family: var(--mono-font);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(15, 23, 42, 0.62);
}

.matrix-table tr:last-child td {
  border-bottom: 0;
}

.matrix-table td:first-child {
  color: var(--ink);
  font-weight: 700;
}

.muted-token {
  display: inline-flex;
  padding: 0.18rem 0.45rem;
  border-radius: 999px;
  color: var(--muted);
  background: rgba(148, 163, 184, 0.1);
  font-size: 0.9rem;
}

th,
td {
  padding: 12px 0;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  overflow-wrap: anywhere;
}

ul.clean {
  list-style: none;
  padding: 0;
  margin: 0;
}

ul.clean li + li {
  margin-top: 10px;
}

.metric-list {
  display: grid;
  gap: 14px;
}

.metric-row {
  display: grid;
  gap: 8px;
}

.meter {
  height: 10px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.16);
  overflow: hidden;
}

.meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--teal) 0%, var(--accent) 100%);
}

.split {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 18px;
}

.portal-footer {
  padding: 0 0 38px;
  color: var(--muted);
}

.portal-footer .shell {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.hide {
  display: none !important;
}

.auth-chip {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(34, 211, 238, 0.1);
  color: var(--muted);
  border: 1px solid rgba(34, 211, 238, 0.12);
}

.hero-rail {
  margin-top: 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.accent-panel {
  background: linear-gradient(145deg, rgba(34, 211, 238, 0.12), rgba(15, 23, 42, 0.78));
  border-radius: var(--radius-sm);
  padding: 18px;
  border: 1px solid rgba(34, 211, 238, 0.14);
}

.muted-panel {
  background: linear-gradient(145deg, rgba(245, 158, 11, 0.12), rgba(15, 23, 42, 0.78));
  border-radius: var(--radius-sm);
  padding: 18px;
  border: 1px solid rgba(245, 158, 11, 0.14);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 16px;
}

.code-snippet {
  width: 100%;
  margin-top: auto;
  padding: 14px;
  border-radius: 14px;
  font-family: var(--mono-font);
  font-size: clamp(0.78rem, 1vw, 0.88rem);
  line-height: 1.55;
  background:
    linear-gradient(90deg, rgba(34, 211, 238, 0.08), transparent 38%),
    #06101d;
  color: #dbeafe;
  border: 1px solid rgba(34, 211, 238, 0.16);
  overflow-x: auto;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

code {
  max-width: 100%;
  padding: 0.12rem 0.32rem;
  border-radius: 0.35rem;
  background: rgba(34, 211, 238, 0.1);
  color: #bae6fd;
  font-family: var(--mono-font);
  font-size: 0.92em;
  overflow-wrap: anywhere;
}

@media (max-width: 920px) {
  .grid.three,
  .grid.two,
  .stat-grid,
  .split,
  .hero-rail,
  .command-grid,
  .focus-grid,
  .browser-launch-grid,
  .setup-grid {
    grid-template-columns: 1fr;
  }

  .site-header .shell {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  main.shell {
    padding-top: 18px;
  }

  .hero,
  .section,
  .card,
  .data-panel,
  .table-card,
  .report-panel {
    padding: 20px;
    border-radius: 18px;
  }

  .hero h2,
  .page-title {
    line-height: 1.02;
  }
}
