:root {
  --bg: #111315;
  --ink: #f6f0e8;
  --muted: #aeb7b7;
  --line: rgba(246, 240, 232, 0.14);
  --panel: rgba(20, 23, 25, 0.78);
  --teal: #42d6c9;
  --amber: #ffc35a;
  --coral: #ff6f61;
  --green: #9fe870;
  --shadow: rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  letter-spacing: 0;
  background:
    radial-gradient(circle at 12% 18%, rgba(66, 214, 201, 0.18), transparent 30%),
    radial-gradient(circle at 82% 20%, rgba(255, 111, 97, 0.14), transparent 28%),
    linear-gradient(135deg, #111315 0%, #191a17 48%, #0f1413 100%);
  overflow-x: hidden;
}

button,
input,
textarea {
  font: inherit;
  letter-spacing: 0;
}

#net-visual {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  opacity: 0.58;
  pointer-events: none;
}

.shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(320px, 0.98fr) minmax(320px, 1.02fr);
  gap: 18px;
  width: min(1120px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 28px 0;
  align-items: center;
}

.hero-panel,
.metrics-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 24px 80px var(--shadow);
  backdrop-filter: blur(18px);
}

.hero-panel {
  display: grid;
  grid-template-rows: auto 1fr auto auto auto;
  min-height: 680px;
  padding: 30px;
  align-items: center;
}

.metrics-panel {
  display: grid;
  gap: 16px;
  padding: 22px;
}

.topline,
.identity-row,
.run-row,
.trace-head {
  display: flex;
  align-items: center;
}

.topline {
  gap: 14px;
}

.brand-mark {
  width: 48px;
  height: 48px;
  border: 1px solid rgba(66, 214, 201, 0.68);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(66, 214, 201, 0.9), transparent 52%),
    linear-gradient(315deg, rgba(255, 195, 90, 0.72), rgba(255, 111, 97, 0.84));
  box-shadow: 0 0 34px rgba(66, 214, 201, 0.28);
}

.eyebrow,
.metric span,
.samples span,
.identity-row span,
.trace-head span,
.dial-label,
.dial-unit {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.25;
  text-transform: uppercase;
}

#client-ip {
  margin: 2px 0 0;
  font-size: clamp(1.5rem, 4vw, 2.8rem);
  line-height: 1;
  font-weight: 760;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.dial-wrap {
  display: grid;
  place-items: center;
  width: 100%;
  padding: 22px 0;
}

.dial {
  --dial: 0%;
  width: min(430px, 78vw);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle, #181b1b 0 57%, transparent 58%),
    conic-gradient(var(--teal) 0 var(--dial), rgba(246, 240, 232, 0.12) var(--dial) 100%);
  box-shadow:
    inset 0 0 0 1px rgba(246, 240, 232, 0.1),
    0 0 90px rgba(66, 214, 201, 0.14);
}

.dial-core {
  width: 70%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  align-content: center;
  border: 1px solid rgba(246, 240, 232, 0.1);
  border-radius: 50%;
  background: rgba(17, 19, 21, 0.9);
}

.dial-core strong {
  font-size: clamp(4rem, 12vw, 8.2rem);
  line-height: 0.92;
  font-weight: 780;
  font-variant-numeric: tabular-nums;
}

.dial-unit {
  margin-top: 8px;
}

.run-row {
  justify-content: center;
  width: 100%;
  gap: 10px;
}

.primary-action,
.ghost-action {
  min-height: 48px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 0 22px;
  color: var(--ink);
  cursor: pointer;
}

.primary-action {
  min-width: 156px;
  background: linear-gradient(135deg, var(--teal), var(--green));
  color: #0d1211;
  font-weight: 760;
}

.ghost-action {
  background: rgba(246, 240, 232, 0.08);
  border-color: var(--line);
}

button:disabled {
  opacity: 0.58;
  cursor: progress;
}

.status-line {
  min-height: 24px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 0.95rem;
}

.progress-track {
  width: 100%;
  height: 8px;
  margin-top: 10px;
  overflow: hidden;
  border-radius: 8px;
  background: rgba(246, 240, 232, 0.1);
}

.progress-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--coral), var(--amber), var(--teal));
  transition: width 180ms ease;
}

.identity-row {
  justify-content: space-between;
  min-height: 50px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.identity-row strong {
  font-size: 1.2rem;
  font-variant-numeric: tabular-nums;
}

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

.metric {
  min-height: 148px;
  display: grid;
  align-content: space-between;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: rgba(246, 240, 232, 0.055);
}

.metric strong {
  font-size: clamp(2.05rem, 5vw, 3.6rem);
  line-height: 1;
  font-weight: 760;
  font-variant-numeric: tabular-nums;
}

.metric small {
  color: var(--muted);
}

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

.samples div {
  min-height: 84px;
  display: grid;
  align-content: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.12);
}

.samples strong {
  overflow-wrap: anywhere;
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
}

.trace-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.16);
}

.trace-head {
  justify-content: space-between;
  min-height: 46px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
}

.trace-head strong {
  color: var(--amber);
  font-size: 0.9rem;
}

pre {
  min-height: 176px;
  max-height: 280px;
  margin: 0;
  padding: 14px;
  overflow: auto;
  color: #dce7e2;
  font-size: 0.82rem;
  line-height: 1.5;
  white-space: pre-wrap;
}

@media (max-width: 860px) {
  .shell {
    grid-template-columns: 1fr;
    min-height: auto;
    padding: 16px 0;
  }

  .hero-panel {
    min-height: 620px;
    padding: 22px;
  }
}

@media (max-width: 560px) {
  .shell {
    width: min(100% - 20px, 1120px);
  }

  .metric-grid,
  .samples {
    grid-template-columns: 1fr;
  }

  .run-row {
    align-items: stretch;
    flex-direction: column;
  }

  .primary-action,
  .ghost-action {
    width: 100%;
  }
}
