:root {
  color-scheme: dark;
  --bg: #020204;
  --panel: #08090f;
  --panel-soft: #10111a;
  --line: #2b2238;
  --line-bright: #8a2cff;
  --text: #f7f8ff;
  --muted: #a8a6ba;
  --accent: #b62cff;
  --accent-hot: #f02bff;
  --accent-2: #d7d9ee;
  --danger: #ff427d;
  --blue: #9ea9ff;
  --metal: linear-gradient(180deg, #ffffff 0%, #cfd2e6 32%, #696b86 58%, #ffffff 100%);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 50% -20%, rgba(160, 40, 255, 0.28), transparent 34%),
    linear-gradient(180deg, #050509 0%, var(--bg) 58%);
  color: var(--text);
  font-family: Inter, Segoe UI, system-ui, sans-serif;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 28px;
  border-bottom: 1px solid rgba(182, 44, 255, 0.36);
  background:
    linear-gradient(90deg, rgba(142, 44, 255, 0.18), transparent 42%),
    rgba(2, 2, 4, 0.94);
  box-shadow: 0 0 36px rgba(151, 38, 255, 0.16);
}

.brand {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}

.brand img {
  width: 132px;
  height: 72px;
  object-fit: contain;
  filter: drop-shadow(0 0 14px rgba(190, 44, 255, 0.62));
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  background: var(--metal);
  background-clip: text;
  color: transparent;
  font-size: 30px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
  text-shadow: 0 0 24px rgba(190, 44, 255, 0.45);
}

h2 {
  font-size: 22px;
}

h3 {
  margin-bottom: 12px;
  font-size: 16px;
  color: var(--accent-2);
  text-transform: uppercase;
}

p {
  margin-top: 6px;
  color: var(--muted);
}

.token-field {
  width: min(320px, 40vw);
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid rgba(172, 86, 255, 0.32);
  border-radius: 6px;
  padding: 10px 11px;
  background: rgba(2, 2, 7, 0.88);
  color: var(--text);
  font: inherit;
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent-hot);
  box-shadow: 0 0 0 3px rgba(182, 44, 255, 0.22);
}

textarea {
  resize: vertical;
}

button {
  border: 1px solid rgba(229, 217, 255, 0.28);
  border-radius: 6px;
  padding: 10px 13px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(166, 167, 204, 0.52) 42%, rgba(151, 38, 255, 0.86));
  color: #09020f;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 0 18px rgba(164, 39, 255, 0.22);
}

button:hover {
  filter: brightness(1.08);
}

.tabs {
  display: flex;
  gap: 2px;
  padding: 12px 28px 0;
  border-bottom: 1px solid rgba(182, 44, 255, 0.3);
  background: rgba(3, 3, 8, 0.94);
}

.tab {
  border-color: rgba(182, 44, 255, 0.28);
  border-bottom: 0;
  border-radius: 6px 6px 0 0;
  background: linear-gradient(180deg, #14111d, #080810);
  color: var(--muted);
  box-shadow: none;
}

.tab.is-active {
  background: linear-gradient(180deg, rgba(125, 29, 255, 0.42), var(--panel));
  color: var(--text);
  border-color: rgba(227, 197, 255, 0.72);
}

main {
  padding: 24px 28px 40px;
}

.panel {
  display: none;
}

.panel.is-active {
  display: block;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.search {
  max-width: 380px;
}

.icon-button {
  background: linear-gradient(180deg, #1a1624, #0a0910);
  color: var(--text);
  border-color: rgba(182, 44, 255, 0.38);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.metric {
  padding: 16px;
  border: 1px solid rgba(182, 44, 255, 0.28);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent),
    var(--panel);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 0 22px rgba(128, 30, 255, 0.08);
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.metric strong {
  display: block;
  margin-top: 8px;
  background: var(--metal);
  background-clip: text;
  color: transparent;
  font-size: 28px;
}

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

.section-extra {
  margin-top: 20px;
}

.editor {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 12px;
  align-items: end;
  margin-bottom: 18px;
  padding: 16px;
  border: 1px solid rgba(182, 44, 255, 0.28);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(182, 44, 255, 0.12), transparent 34%),
    var(--panel);
}

.editor.compact {
  grid-template-columns: repeat(2, minmax(160px, 1fr));
}

.editor .wide {
  grid-column: 1 / -1;
}

.editor button {
  min-height: 42px;
}

.table,
.rows {
  display: grid;
  gap: 8px;
}

.row {
  display: grid;
  grid-template-columns: minmax(170px, 1.4fr) repeat(4, minmax(90px, 1fr)) auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(182, 44, 255, 0.24);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(182, 44, 255, 0.055)), var(--panel);
}

.row.simple {
  grid-template-columns: 1fr auto;
}

.row-title {
  min-width: 0;
}

.row-title strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  text-shadow: 0 0 12px rgba(180, 44, 255, 0.22);
}

.row-title span,
.cell-label {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(182, 44, 255, 0.22);
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.pill.good {
  background: rgba(182, 44, 255, 0.2);
  color: #f1d7ff;
}

.pill.warn {
  background: rgba(215, 217, 238, 0.16);
  color: var(--accent-2);
}

.pill.bad {
  background: rgba(255, 107, 107, 0.16);
  color: var(--danger);
}

.link-button {
  background: linear-gradient(180deg, #181421, #090810);
  color: var(--text);
  border-color: rgba(182, 44, 255, 0.32);
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  max-width: 420px;
  padding: 12px 14px;
  border: 1px solid rgba(182, 44, 255, 0.42);
  border-radius: 8px;
  background: #08070d;
  color: var(--text);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.42), 0 0 28px rgba(182, 44, 255, 0.24);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 900px) {
  .topbar,
  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .token-field,
  .search {
    width: 100%;
    max-width: none;
  }

  .metric-grid,
  .split,
  .editor,
  .editor.compact {
    grid-template-columns: 1fr;
  }

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

  .tabs {
    overflow-x: auto;
  }
}

.hidden { display: none !important; }
.auth-bar { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; }
.login-panel { max-width: 980px; margin: 32px auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; padding: 0 18px; }
.login-card { background: rgba(12, 18, 28, 0.88); border: 1px solid rgba(255,255,255,0.12); border-radius: 8px; padding: 20px; box-shadow: 0 12px 36px rgba(0,0,0,0.28); }
.login-card label { display: grid; gap: 6px; margin: 12px 0; }
.login-card input { width: 100%; }

.public-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 28px;
  border-bottom: 1px solid rgba(182, 44, 255, 0.26);
  background: rgba(2, 2, 4, 0.92);
  backdrop-filter: blur(14px);
}

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

.public-brand,
.public-nav a {
  color: var(--text);
  text-decoration: none;
  font-weight: 800;
}

.public-brand img {
  width: 46px;
  height: 46px;
  object-fit: contain;
}

.public-nav nav a {
  color: var(--muted);
  font-size: 14px;
}

.public-nav nav a:hover,
.public-nav nav a.is-active {
  color: var(--text);
}

.public-main {
  padding: 0 0 54px;
}

.public-page {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
}

.hero {
  min-height: calc(100vh - 74px);
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(0, 1fr);
  gap: 28px;
  align-items: center;
  padding: 28px 0 38px;
}

.hero-art {
  width: 100%;
  max-height: 74vh;
  object-fit: contain;
  filter: drop-shadow(0 18px 38px rgba(0, 0, 0, 0.58));
}

.hero-copy {
  width: 100%;
  min-width: 0;
  max-width: 720px;
}

.hero-copy h1 {
  max-width: 100%;
  font-size: clamp(42px, 6.1vw, 88px);
  line-height: 1;
  overflow-wrap: anywhere;
  text-shadow: 0 0 18px rgba(190, 44, 255, 0.36);
  text-wrap: balance;
}

.hero-copy p:not(.eyebrow) {
  margin-top: 20px;
  color: #deddf0;
  font-size: 20px;
  line-height: 1.6;
}

.eyebrow {
  margin-bottom: 12px;
  color: #8fe7ff;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.public-section {
  padding: 34px 0;
  border-top: 1px solid rgba(182, 44, 255, 0.24);
}

.public-heading {
  margin-bottom: 16px;
}

.feature-grid,
.command-grid,
.plan-grid {
  display: grid;
  gap: 14px;
}

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

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

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

.feature-grid article,
.command-grid article,
.plan-card,
.legal-page {
  border: 1px solid rgba(182, 44, 255, 0.26);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(182, 44, 255, 0.06)),
    rgba(8, 9, 15, 0.92);
}

.feature-grid article,
.command-grid article,
.plan-card {
  padding: 18px;
}

.feature-grid p,
.plan-card p,
.legal-page p {
  line-height: 1.55;
}

.command-grid article strong {
  display: block;
  color: #f1d7ff;
  font-size: 16px;
}

.command-grid article span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.plan-card {
  position: relative;
}

.plan-card.featured {
  border-color: rgba(143, 231, 255, 0.54);
}

.plan-price {
  display: inline-flex;
  margin-bottom: 14px;
  color: #8fe7ff;
  font-weight: 900;
}

.plan-card ul {
  margin: 16px 0 0;
  padding-left: 18px;
  color: #deddf0;
  line-height: 1.7;
}

.legal-page {
  max-width: 900px;
  margin-top: 36px;
  padding: 28px;
}

.legal-page h1 {
  margin-bottom: 10px;
  font-size: 42px;
}

.legal-page h2 {
  margin-top: 24px;
}

.developer-login {
  position: fixed;
  right: 14px;
  bottom: 12px;
  z-index: 20;
  color: rgba(247, 248, 255, 0.34);
  font-size: 11px;
  text-decoration: none;
}

.developer-login:hover {
  color: rgba(247, 248, 255, 0.82);
}

.editor .muted.wide {
  margin: 0;
  grid-column: 1 / -1;
}

@media (max-width: 900px) {
  .public-nav {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero,
  .feature-grid,
  .command-grid,
  .plan-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
    padding-top: 20px;
  }

  .hero-art {
    max-height: 48vh;
  }
}
