:root {
  --bg: #000000;
  --text: #ffffff;
  --muted: #c8c8c8;
  --line: #2a2a2a;
  --card: #f3f6ff;
  --card-text: #111111;
  --card-muted: #4a4a4a;
  --btn: #c5d4f5;
  --btn-text: #111827;
  --btn-hover: #d7e2fb;
  --warn: #8a5a00;
  --bad: #9b1c1c;
  --good: #166534;
  --serif: "Playfair Display", "Times New Roman", Times, serif;
  --sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; background: var(--bg); color: var(--text); }
body { font-family: var(--sans); font-size: 16px; line-height: 1.5; }

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 28px 80px; }

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 0 10px;
}
.nav-brand { display: flex; align-items: center; }
.nav-brand img { width: 52px; height: 52px; display: block; }
.nav-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px 22px;
  font-size: 15px;
}
.nav-links a { color: #fff; opacity: 0.92; }
.nav-links a:hover { opacity: 1; text-decoration: underline; }
.nav-links a.active { text-decoration: underline; }

.hero {
  text-align: center;
  padding: 48px 0 36px;
}
.wordmark {
  width: min(420px, 86vw);
  height: auto;
  display: block;
  margin: 0 auto 28px;
}
.hero h1 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(28px, 4vw, 42px);
  letter-spacing: 0.01em;
  margin-bottom: 12px;
}
.hero p {
  max-width: 620px;
  margin: 0 auto 10px;
  color: var(--muted);
  font-size: 17px;
}
.hero em {
  display: block;
  margin-top: 14px;
  font-family: var(--serif);
  font-style: italic;
  color: #fff;
}

.layout {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 48px;
  align-items: start;
  margin-top: 12px;
}
@media (max-width: 900px) {
  .nav { flex-direction: column; align-items: flex-start; }
  .nav-links { justify-content: flex-start; }
  .layout { grid-template-columns: 1fr; }
}

.note {
  background: var(--card);
  color: var(--card-text);
  border-radius: 12px;
  padding: 22px 24px;
  max-width: 640px;
}
.note p { margin: 0; font-size: 15.5px; line-height: 1.55; }
.side-actions { margin-top: 18px; display: flex; gap: 10px; flex-wrap: wrap; }

.ghost, .wallet-btn, .swap-btn, .max-btn, .flip-btn {
  border: 0;
}
.ghost, .wallet-btn {
  background: var(--btn);
  color: var(--btn-text);
  border-radius: 10px;
  padding: 10px 18px;
  font-size: 15px;
  font-weight: 500;
}
.ghost:hover, .wallet-btn:hover { background: var(--btn-hover); }
.card .wallet-btn { padding: 6px 10px; font-size: 13px; }
.wallet-wrap { position: relative; }
.wallet-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 168px;
  background: #fff;
  border: 1px solid #d7dbe8;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  overflow: hidden;
  z-index: 5;
}
.wallet-menu button {
  display: block;
  width: 100%;
  text-align: left;
  background: #fff;
  border: 0;
  padding: 10px 12px;
  font-size: 13px;
  color: #111;
}
.wallet-menu button:hover { background: #eef2ff; }

.card {
  background: var(--card);
  color: var(--card-text);
  border-radius: 12px;
  padding: 20px;
}
.card-label {
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--card-muted);
  margin-bottom: 14px;
  font-weight: 600;
}

.leg {
  background: #fff;
  border: 1px solid #d7dbe8;
  border-radius: 10px;
  padding: 12px 14px;
}
.leg-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.token { display: flex; align-items: center; gap: 8px; font-weight: 650; }
.token img.tok-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: block;
  object-fit: cover;
  background: #fff;
}
.token img.tok-icon[hidden] { display: none; }
.bal { font-size: 12px; color: var(--card-muted); }
.max-btn {
  background: transparent;
  color: #1d4ed8;
  padding: 0 0 0 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
}
input.amt {
  width: 100%;
  margin-top: 8px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--card-text);
  font-size: 28px;
  font-family: inherit;
}
input.amt::placeholder { color: #b9b9b9; }

.flip { display: flex; justify-content: center; margin: 8px 0; }
.flip-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #111;
  color: #fff;
  font-size: 16px;
}

.quote {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #d7dbe8;
  display: grid;
  gap: 6px;
  font-size: 13px;
}
.row { display: flex; justify-content: space-between; gap: 12px; color: var(--card-muted); }
.row strong { color: var(--card-text); font-weight: 600; }
.row.donate strong { color: #111; }
.row.warn { color: var(--warn); }
.row.bad { color: var(--bad); }
.tiny { font-size: 12px; color: var(--card-muted); line-height: 1.45; margin-top: 6px; }

.swap-btn {
  width: 100%;
  margin-top: 14px;
  padding: 12px;
  border-radius: 10px;
  background: var(--btn);
  color: var(--btn-text);
  font-size: 16px;
  font-weight: 650;
}
.swap-btn:hover { background: var(--btn-hover); }
.swap-btn:disabled { opacity: 0.45; cursor: not-allowed; }

.status {
  margin-top: 10px;
  font-size: 12px;
  color: var(--card-muted);
  min-height: 16px;
  word-break: break-word;
}
.status.good { color: var(--good); }
.status.bad { color: var(--bad); }

.addrs {
  margin-top: 56px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  color: var(--muted);
  font-size: 13px;
}
.addrs code { display: block; color: #fff; font-size: 12px; word-break: break-all; margin: 4px 0; }
.addrs a { color: #fff; text-decoration: underline; }

footer {
  margin-top: 36px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}
footer a { text-decoration: underline; }
