:root {
  --bg: #0b1220;
  --bg-elevated: #111827;
  --card: #1a2332;
  --card-hover: #222d3f;
  --text: #f8fafc;
  --muted: #94a3b8;
  --test: #22c55e;
  --test-soft: rgba(34, 197, 94, 0.14);
  --test-text: #86efac;
  --main: #f59e0b;
  --main-soft: rgba(245, 158, 11, 0.14);
  --main-text: #fcd34d;
  --line: rgba(248, 250, 252, 0.1);
  --shadow: 0 24px 48px rgba(0, 0, 0, 0.35);
  --radius-lg: 22px;
  --radius-md: 14px;
  --radius-pill: 999px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  color: var(--text);
  background:
    radial-gradient(1000px 480px at 8% -12%, rgba(34, 197, 94, 0.12), transparent 58%),
    radial-gradient(800px 420px at 105% 5%, rgba(245, 158, 11, 0.1), transparent 55%),
    radial-gradient(600px 300px at 50% 100%, rgba(56, 189, 248, 0.06), transparent 50%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
}

.portal-main {
  width: min(900px, calc(100% - 32px));
  margin: 0 auto;
  padding: 44px 0 72px;
}

.portal-main--narrow {
  width: min(780px, calc(100% - 32px));
}

.hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.hero-text h1 {
  margin: 0;
  font-size: clamp(34px, 5vw, 52px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

.hero-kicker {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}

.notes-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 20px 0 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: border-color 200ms ease, transform 120ms ease, background 200ms ease;
}

.notes-btn:hover {
  border-color: rgba(248, 250, 252, 0.22);
  background: var(--card-hover);
}

.notes-btn:active {
  transform: scale(0.98);
}

.notes-btn:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 3px;
}

.notes-btn .icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: var(--test-soft);
  color: var(--test-text);
  font-size: 15px;
}

.notes-btn .chev {
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
}

.status-panel {
  margin-top: 24px;
  padding: 18px 20px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.status-panel[hidden] {
  display: none !important;
}

.status-rows {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
  border: 1px solid transparent;
}

.chip-muted {
  background: rgba(148, 163, 184, 0.1);
  color: var(--muted);
  border-color: var(--line);
}

.chip-test {
  background: var(--test-soft);
  color: var(--test-text);
}

.chip-main {
  background: var(--main-soft);
  color: var(--main-text);
}

.chip-ok {
  color: #bbf7d0;
}

.chip-warn {
  color: #fde68a;
}

.chip-bad {
  color: #fecaca;
}

.chip-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.85;
}

.chip-dot.pulse {
  animation: pulse 1.4s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.45;
  }
  50% {
    opacity: 1;
  }
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
}

.toolbar-hint {
  margin: 0;
  flex: 1 1 200px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

button {
  font: inherit;
  cursor: pointer;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: var(--radius-md);
  font-weight: 600;
  text-decoration: none;
  border: 0;
  transition: filter 150ms ease, transform 120ms ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 3px;
}

.btn-ghost {
  background: rgba(248, 250, 252, 0.08);
  color: var(--text);
  border: 1px solid var(--line);
}

.btn-ghost:hover {
  background: rgba(248, 250, 252, 0.12);
}

.btn-ghost:disabled {
  opacity: 0.5;
  cursor: default;
}

.btn-test {
  background: var(--test);
  color: #052e16;
}

.btn-main {
  background: var(--main);
  color: #1c1303;
}

.btn-test:hover,
.btn-main:hover {
  filter: brightness(1.06);
}

.choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 22px;
}

.choice {
  position: relative;
  text-align: left;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  border-radius: var(--radius-lg);
  padding: 20px 20px 18px;
  min-height: 112px;
  overflow: hidden;
  transition: border-color 200ms ease, background 200ms ease, box-shadow 200ms ease;
}

.choice::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 200ms ease;
  pointer-events: none;
}

.choice.test::before {
  background: radial-gradient(120% 80% at 0% 0%, var(--test-soft), transparent 55%);
}

.choice.main::before {
  background: radial-gradient(120% 80% at 100% 0%, var(--main-soft), transparent 55%);
}

.choice:hover {
  border-color: rgba(248, 250, 252, 0.2);
  background: var(--card-hover);
}

.choice[aria-pressed="true"]::before {
  opacity: 1;
}

.choice[aria-pressed="true"] {
  box-shadow: var(--shadow);
}

.choice.test[aria-pressed="true"] {
  border-color: rgba(34, 197, 94, 0.55);
}

.choice.main[aria-pressed="true"] {
  border-color: rgba(245, 158, 11, 0.55);
}

.choice-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.choice-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.choice.test .choice-dot {
  background: var(--test);
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.5);
}

.choice.main .choice-dot {
  background: var(--main);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.45);
}

.choice strong {
  font-size: 21px;
  font-weight: 600;
}

.choice span {
  display: block;
  margin-top: 10px;
  padding-left: 20px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.result {
  margin-top: 22px;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 28px;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 26px;
  padding: 26px;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--test);
  transition: border-color 250ms ease;
}

.result.mainnet-accent {
  border-left-color: var(--main);
}

.qr-wrap {
  background: #fff;
  border-radius: 18px;
  padding: 14px;
  width: 280px;
  height: 280px;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.06);
}

.qr-wrap img {
  display: block;
  width: 252px;
  height: 252px;
  border-radius: 8px;
}

.badge {
  display: inline-block;
  margin: 0 0 12px;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

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

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

.result h2 {
  margin: 0;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.url-box {
  margin: 16px 0 0;
  padding: 14px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 14px;
  line-height: 1.55;
  word-break: break-all;
  color: #e2e8f0;
}

.api-line {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.deploy-line {
  margin: 14px 0 0;
  padding: 10px 12px;
  background: rgba(148, 163, 184, 0.08);
  border-radius: var(--radius-md);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.result-actions {
  margin-top: 18px;
}

.result-note {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 22px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 15px;
}

.back-link:hover {
  color: var(--text);
}

.back-link:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 3px;
}

.page-title {
  margin: 0;
  font-size: clamp(28px, 5vw, 40px);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.page-lead {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
  max-width: 40em;
}

.tab-bar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 26px;
}

.tab {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  min-height: 76px;
  text-align: left;
  transition: border-color 200ms ease, background 200ms ease, box-shadow 200ms ease;
}

.tab:hover {
  border-color: rgba(248, 250, 252, 0.2);
  background: var(--card-hover);
}

.tab:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 3px;
}

.tab strong {
  display: block;
  font-size: 18px;
}

.tab span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.tab[aria-selected="true"] {
  background: var(--card-hover);
  box-shadow: var(--shadow);
}

.tab.test[aria-selected="true"] {
  border-color: rgba(34, 197, 94, 0.5);
}

.tab.main[aria-selected="true"] {
  border-color: rgba(245, 158, 11, 0.5);
}

.notes-panel {
  margin-top: 22px;
}

.notes-panel[hidden] {
  display: none !important;
}

.panel-kicker {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.notes-content h1 {
  font-size: clamp(24px, 4vw, 34px);
  margin: 8px 0 0;
  letter-spacing: -0.02em;
}

.notes-content h1.ver {
  margin-top: 36px;
}

.notes-content .section {
  margin-top: 16px;
  padding: 18px 20px 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.notes-content h2 {
  font-size: 17px;
  margin: 0 0 8px;
  font-weight: 600;
}

.notes-content ul {
  margin: 0 0 10px;
  padding-left: 18px;
}

.notes-content li {
  margin: 8px 0;
  line-height: 1.55;
  color: var(--muted);
}

.notes-content .lead {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}

.notes-content code {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.9em;
  color: var(--text);
}

[hidden] {
  display: none !important;
}

@media (max-width: 720px) {
  .portal-main {
    padding-top: 28px;
  }

  .choices,
  .result,
  .tab-bar {
    grid-template-columns: 1fr;
  }

  .qr-wrap {
    margin: 0 auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .choice,
  .notes-btn,
  .btn,
  .tab {
    transition: none;
  }

  .chip-dot.pulse {
    animation: none;
  }
}
