:root {
  color-scheme: light;
  --ink: #17212b;
  --muted: #5d6978;
  --line: #d7dee8;
  --panel: #ffffff;
  --page: #f4f7fb;
  --teal: #0f8b8d;
  --blue: #2d6cdf;
  --gold: #f0a202;
  --rose: #d64c6f;
  --green: #2f9d62;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--page);
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 30px clamp(18px, 4vw, 56px) 22px;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--teal);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  max-width: 820px;
  font-size: clamp(30px, 5vw, 58px);
  line-height: 1.03;
  letter-spacing: 0;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  white-space: nowrap;
  color: var(--muted);
  background: #f8fafc;
  font-size: 13px;
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 26px auto 42px;
}

.workspace {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
}

.input-panel,
.result-panel,
.metrics article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 12px 26px rgba(30, 43, 64, 0.08);
}

.input-panel {
  display: flex;
  flex-direction: column;
  gap: 11px;
  padding: 18px;
}

label {
  font-size: 13px;
  font-weight: 750;
  color: #334155;
}

textarea,
input,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  background: #fbfdff;
  font: inherit;
  font-size: 14px;
}

textarea {
  min-height: 154px;
  resize: vertical;
  padding: 12px;
}

input,
select {
  min-height: 42px;
  padding: 0 11px;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.segmented button,
.tab {
  border: 0;
  background: #ffffff;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.segmented button {
  min-height: 38px;
  border-right: 1px solid var(--line);
}

.segmented button:last-child {
  border-right: 0;
}

.segmented .selected {
  background: #e7f8f8;
  color: var(--teal);
}

.primary {
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: var(--blue);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.result-panel {
  min-height: 610px;
  overflow: hidden;
}

.visual-band {
  position: relative;
  height: 160px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(90deg, rgba(15, 139, 141, 0.12), rgba(45, 108, 223, 0.12)),
    repeating-linear-gradient(90deg, transparent 0 54px, rgba(23, 33, 43, 0.05) 55px 56px);
}

.orbit {
  position: absolute;
  left: 50%;
  top: 50%;
  border: 2px solid rgba(45, 108, 223, 0.28);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.orbit.one {
  width: 420px;
  height: 106px;
}

.orbit.two {
  width: 260px;
  height: 72px;
  border-color: rgba(15, 139, 141, 0.34);
  transform: translate(-50%, -50%) rotate(-14deg);
}

.node {
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.9);
}

.n1 { left: 18%; top: 66%; background: var(--teal); }
.n2 { left: 43%; top: 26%; background: var(--gold); }
.n3 { left: 63%; top: 58%; background: var(--blue); }
.n4 { left: 82%; top: 34%; background: var(--rose); }

.tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-bottom: 1px solid var(--line);
}

.tab {
  min-height: 48px;
  border-right: 1px solid var(--line);
}

.tab:last-child {
  border-right: 0;
}

.tab.active {
  color: var(--ink);
  background: #f6fafc;
  box-shadow: inset 0 -3px 0 var(--teal);
}

.output {
  padding: 22px;
}

.output h2 {
  margin: 0 0 14px;
  font-size: 24px;
}

.output p {
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.6;
}

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

.tile {
  min-height: 114px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}

.tile strong {
  display: block;
  margin-bottom: 6px;
  color: var(--ink);
}

.tile span {
  color: var(--muted);
  line-height: 1.5;
  font-size: 14px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 16px;
}

.metrics article {
  padding: 16px;
}

.metrics span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.metrics strong {
  display: block;
  margin-top: 8px;
  font-size: 34px;
}

@media (max-width: 860px) {
  .topbar,
  .workspace,
  .metrics {
    grid-template-columns: 1fr;
  }

  .topbar {
    display: grid;
    align-items: start;
  }

  .workspace {
    display: grid;
  }

  .grid {
    grid-template-columns: 1fr;
  }

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

  .status-pill {
    width: max-content;
  }
}
