:root {
  --bg: #edf7d6;
  --ink: #151924;
  --muted: #5b657a;
  --panel: #ffffff;
  --line: #dbe1ed;
  --brand: #0b63f6;
  --brand-soft: #e8f0ff;
  --accent: #ff8a00;
  --danger: #c52828;
  --ok: #0f8f52;
  --shadow: 0 20px 45px rgba(12, 25, 61, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", "Noto Sans", "Helvetica Neue", sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, #f2fadf 0%, #e8f6c7 52%, #dff2b6 100%);
  min-height: 100vh;
}

.bg-orb {
  display: none;
}

.bg-orb-1 {
  width: 280px;
  height: 280px;
  background: #97d044;
  top: -120px;
  right: -60px;
}

.bg-orb-2 {
  width: 300px;
  height: 300px;
  background: #b5e949;
  bottom: -80px;
  left: -40px;
}

.container {
  width: min(1150px, 94vw);
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

.site-header {
  padding: 20px 0;
}

.header-wrap {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  display: flex;
  gap: 20px;
  justify-content: space-between;
  align-items: center;
  padding: 8px 22px;
  backdrop-filter: none;
  position: relative;
  min-height: 128px;
  overflow: visible;
}

.brand-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 0;
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #08234e;
  text-decoration: none;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.brand-mark {
  width: 460px;
  height: auto;
  max-height: 210px;
  object-fit: contain;
  border-radius: 12px;
  flex: 0 0 auto;
  display: block;
}

.subbrand {
  margin: 0;
  font-size: 0.86rem;
  color: var(--muted);
  position: absolute;
  left: 22px;
  bottom: 10px;
  text-align: left;
  z-index: 4;
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-left: auto;
  z-index: 3;
  position: relative;
}

@media (min-width: 781px) {
  .top-nav {
    top: 22px;
  }
}

.top-nav a {
  color: #1f365f;
  text-decoration: none;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 10px;
}

.top-nav a:hover {
  background: #e8f6c7;
}

.lang-switch {
  position: relative;
}

.lang-picker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 132px;
  border: 1px solid #b8d88b;
  border-radius: 10px;
  padding: 6px 10px;
  background: #f2fadf;
  color: #27461c;
}

.lang-icon {
  width: 16px;
  height: 16px;
  fill: currentColor;
  flex-shrink: 0;
}

.lang-select {
  border: 0;
  background: transparent;
  color: #27461c;
  font-weight: 700;
  font-size: 0.88rem;
  line-height: 1.2;
  min-width: 94px;
  cursor: pointer;
  padding: 0;
}

.lang-select:focus {
  outline: none;
}

.content-wrap {
  padding: 4px 0 40px;
}

.footer-media-box {
  margin: 40px auto 0;
  padding: 16px 20px 12px;
  text-align: center;
  border-top: 1px solid #e2e8f0;
  max-width: 1100px;
}

.footer-media-title {
  margin-bottom: 8px;
  font-weight: 600;
}

.footer-links-box {
  padding: 8px 20px 20px;
  text-align: center;
}

.media-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 14px;
}

.media-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}

.media-logo {
  width: 16px;
  height: 16px;
}

.media-docs {
  margin-top: 10px;
  font-size: 0.95rem;
  color: #4a5568;
  line-height: 1.7;
}

.media-docs a {
  text-decoration: none;
  color: #2b6cb0;
  margin: 0 4px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 22px;
  margin-bottom: 18px;
}

.narrow {
  width: min(520px, 100%);
}

.panel-head h1,
.panel-head h2,
.panel-head h3 {
  margin: 0 0 6px;
}

.panel-head p {
  margin: 0;
  color: var(--muted);
}

.compact {
  margin-bottom: 14px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.two-col {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  background: #ffffff;
}

.card-head-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.contract-card h2 {
  margin: 6px 0 10px;
}

.purchase-box {
  border: 1px solid #dfe8fa;
  border-radius: 10px;
  padding: 10px;
  background: #f9fbff;
  margin-top: 10px;
}

.purchase-box h3 {
  margin: 0 0 8px;
  font-size: 0.9rem;
  color: #244476;
}

.purchase-form {
  gap: 8px;
}

.purchase-form .primary-btn {
  width: 100%;
}

.purchase-form .hint {
  margin-top: 2px;
  font-size: 0.78rem;
}

.purchase-currency-wrap {
  position: relative;
}

.purchase-currency-wrap .purchase-currency-native {
  position: absolute;
  left: 0;
  top: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.purchase-currency-trigger {
  width: 100%;
  border: 1px solid #cfd8ea;
  border-radius: 10px;
  background: #fff;
  min-height: 42px;
  display: grid;
  grid-template-columns: 30px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  cursor: pointer;
  text-align: left;
}

.purchase-currency-trigger:hover {
  border-color: #b8c8e6;
}

.purchase-currency-trigger:focus {
  outline: none;
  border-color: #6ea8ff;
  box-shadow: 0 0 0 3px rgba(11, 99, 246, 0.15);
}

.purchase-currency-label {
  font-size: 0.92rem;
  color: #223255;
  font-weight: 600;
}

.purchase-currency-caret {
  font-size: 0.95rem;
  color: #607195;
}

.purchase-currency-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 35;
  border: 1px solid #cfd8ea;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(12, 25, 61, 0.16);
  padding: 6px;
  display: grid;
  gap: 4px;
  max-height: 240px;
  overflow: auto;
}

.purchase-currency-menu[hidden] {
  display: none;
}

.purchase-currency-item {
  border: 0;
  background: transparent;
  border-radius: 8px;
  display: grid;
  grid-template-columns: 24px 1fr;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 8px;
  text-align: left;
  cursor: pointer;
  color: #20304e;
  font-size: 0.9rem;
}

.purchase-currency-item img {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  object-fit: contain;
  border: 1px solid #d7e2f7;
  background: #ffffff;
}

.purchase-currency-item:hover {
  background: #f1f6ff;
}

.purchase-currency-item.is-selected {
  background: #eaf2ff;
  color: #1248ac;
}

.purchase-currency-logo {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  object-fit: contain;
  border: 1px solid #d5e1f8;
  background: #ffffff;
  padding: 2px;
}

.token-coin-image {
  display: block;
  margin-top: 8px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #d4e2fb;
  box-shadow: 0 8px 20px rgba(15, 62, 145, 0.16);
}

.badge-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.badge {
  background: #e5eeff;
  color: #1344a9;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
}

.status {
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  font-weight: 800;
}

.status.on,
.status-text-on {
  color: var(--ok);
}

.status.off,
.status-text-off {
  color: var(--danger);
}

.mono {
  font-family: "Cascadia Code", "JetBrains Mono", monospace;
  font-size: 0.83rem;
  word-break: break-word;
}

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

.fact-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 4px;
}

.progress {
  height: 10px;
  border-radius: 999px;
  background: #e9edf5;
  overflow: hidden;
  margin-top: 10px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brand), #6ea8ff 72%, var(--accent));
}

.cta-row,
.row-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.primary-btn,
.ghost-btn,
.danger-btn,
.chip {
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  padding: 9px 12px;
  border: 1px solid transparent;
}

.primary-btn {
  color: #1f3114;
  background: linear-gradient(90deg, #97d044, #b5e949);
  text-decoration: none;
  border-color: #8fc44a;
}

.primary-btn:hover {
  filter: brightness(0.98);
}

.ghost-btn {
  background: #f2fadf;
  border-color: #b8d88b;
  color: #27461c;
  text-decoration: none;
}

.ghost-btn:hover {
  background: #e8f6c7;
}

.wallet-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.wallet-btn-icon {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

.wallet-btn-label {
  display: inline-block;
  min-width: 66px;
  text-align: left;
}

.wallet-btn.wallet-connected {
  border-color: #8fc44a;
  background: #e8f6c7;
  color: #27461c;
}

.danger-btn {
  background: #fff2f2;
  border-color: #f3c7c7;
  color: var(--danger);
}

.inline-form {
  display: inline;
}

.inline-note {
  border: 1px dashed #c8d5f5;
  border-radius: 10px;
  background: #f7faff;
  padding: 10px;
  margin-top: 10px;
}

.stack-form {
  display: grid;
  gap: 10px;
}

.stack-form label {
  display: grid;
  gap: 5px;
  font-weight: 600;
  color: #223255;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #cfd8ea;
  border-radius: 10px;
  padding: 10px 11px;
  font-size: 0.95rem;
  font-family: inherit;
  background: #fff;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #6ea8ff;
  box-shadow: 0 0 0 3px rgba(11, 99, 246, 0.15);
}

.inline-query {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.inline-query input {
  width: min(480px, 100%);
}

.inline-check {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 600;
}

.inline-check input {
  width: auto;
}

.hint {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
}

th,
td {
  border-bottom: 1px solid #edf1f8;
  padding: 9px 10px;
  text-align: left;
  vertical-align: top;
  font-size: 0.9rem;
}

th {
  background: #f7f9fc;
  color: #33486e;
  font-weight: 700;
}

.empty {
  border: 1px dashed #bfd0ed;
  border-radius: 12px;
  padding: 18px;
  text-align: center;
}

.flash-wrap {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.flash {
  border-radius: 10px;
  padding: 10px 12px;
  font-weight: 600;
}

.flash.success {
  background: #e8f8ef;
  color: #0f7b49;
}

.flash.error {
  background: #ffefef;
  color: #9f2323;
}

.flash.message {
  background: #ebf3ff;
  color: #1f4e94;
}

.subsection {
  margin-top: 14px;
}

.chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.chip-form {
  display: inline;
}

.chip {
  border: 1px solid #b8d88b;
  background: #f2fadf;
  color: #27461c;
  font-size: 0.78rem;
}

.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 15, 36, 0.55);
  z-index: 100;
}

.modal-card {
  width: min(460px, 92vw);
  background: #fff;
  border-radius: 14px;
  border: 1px solid #e2e8f5;
  padding: 18px;
}

.coin-info {
  min-height: 20px;
  margin: 6px 0;
  color: var(--muted);
  font-size: 0.88rem;
}

@media (max-width: 780px) {
  .header-wrap {
    border-radius: 14px;
    padding: 16px;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    min-height: 0;
  }

  .brand-stack {
    width: 100%;
    position: static;
    left: auto;
    transform: none;
    align-items: center;
  }

  .subbrand {
    position: static;
    right: auto;
    top: auto;
    width: 100%;
    text-align: center;
    margin: 2px 0 0;
  }

  .brand-mark {
    width: min(84vw, 320px);
    height: auto;
    max-height: 140px;
  }

  .token-coin-image {
    width: 52px;
    height: 52px;
  }

  .top-nav {
    width: 100%;
    justify-content: center;
    margin-left: 0;
  }

  .panel {
    padding: 16px;
  }

  .purchase-box {
    padding: 9px;
  }

  .purchase-box h3 {
    font-size: 0.84rem;
  }

  .footer-media-box {
    padding: 14px 12px 10px;
  }

  .media-links {
    gap: 8px 10px;
  }

  .media-docs {
    font-size: 0.88rem;
    line-height: 1.6;
  }

  table {
    min-width: 560px;
  }
}
