:root {
  --bg: #101114;
  --panel: #181a1f;
  --line: #2a2d34;
  --text: #f4f4f5;
  --muted: #9aa0aa;
  --orange: #ff3c00;
  --ok: #3dd68c;
  --bad: #ff5d5d;
  --input: #111318;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font: 14px/1.45 "Segoe UI", sans-serif; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

#app { max-width: 1280px; margin: 0 auto; padding: 20px; }
.top { display: flex; justify-content: space-between; gap: 16px; align-items: flex-end; margin-bottom: 18px; }
h1 { margin: 0; font-size: 22px; }
.sub { color: var(--muted); margin-top: 4px; }
.badge { background: #24150f; color: var(--orange); border: 1px solid #5a2a16; padding: 4px 8px; border-radius: 999px; font-size: 12px; }

.grid { display: grid; grid-template-columns: minmax(420px, 520px) 1fr; gap: 16px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.panel h2 { margin: 0 0 12px; font-size: 15px; }
label { display: block; color: var(--muted); font-size: 12px; margin: 10px 0 4px; }
input, select, textarea {
  width: 100%; background: var(--input); border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px;
}
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.btn { background: #2a2d34; border: 0; border-radius: 10px; padding: 8px 12px; }
.btn.primary { background: var(--orange); color: #fff; font-weight: 600; }
.btn.ghost { background: transparent; border: 1px solid var(--line); }
.status { min-height: 22px; color: var(--muted); margin-top: 10px; word-break: break-word; }
.status.ok { color: var(--ok); }
.status.bad { color: var(--bad); max-height: 5.6em; overflow: auto; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); }
tr.active { background: #2a160f; }
tr.clickable { cursor: pointer; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 6px 10px; }
.kv b { color: var(--muted); font-weight: 500; }
.mono { font-family: Consolas, "Courier New", monospace; word-break: break-all; }

.receive-card {
  margin: 8px 0 14px;
  padding: 14px 16px;
  border-radius: 12px;
  background: #24150f;
  border: 1px solid #5a2a16;
}
.receive-card .hint { color: var(--muted); font-size: 12px; }
.receive-card .amt { font-size: 26px; font-weight: 700; margin: 6px 0 2px; }
.receive-card .usd { color: #ffcc66; font-size: 18px; font-weight: 600; }
.receive-card .pair { color: var(--muted); margin-top: 6px; font-size: 12px; }

.debug { margin-top: 16px; }
.debug pre {
  margin: 0; max-height: 280px; overflow: auto; background: #0c0d10; border: 1px solid var(--line);
  border-radius: 10px; padding: 12px; color: #d7dbe3;
}
.endpoints { display: grid; gap: 6px; margin-bottom: 12px; }
.endpoints code { color: #ffb199; }

.picker {
  --pick: #42d392;
  --pick-line: #38bdf8;
  display: grid;
  gap: 10px;
  margin-top: 8px;
}
.picker-title {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  margin: 12px 0 0;
}
.picker-title em {
  margin-left: 6px;
  color: #5eead4;
  font-style: normal;
  font-weight: 500;
  font-size: 11px;
}
.coin-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}
.coin-tile, .chain-tile {
  display: grid;
  justify-items: center;
  gap: 4px;
  min-width: 0;
  padding: 10px 4px 8px;
  border: 1px solid rgba(140, 155, 180, 0.18);
  border-radius: 13px;
  background: #141820;
  color: inherit;
  font: inherit;
}
.coin-tile strong { font-size: 13px; line-height: 1.2; }
.coin-tile small {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 11px;
}
.coin-tile:hover, .chain-tile:hover { border-color: #42d392; }
.coin-tile.selected {
  border-color: #42d392;
  background: rgba(66, 211, 146, 0.12);
  box-shadow: 0 0 0 1px rgba(94, 234, 212, 0.28), 0 0 12px rgba(66, 211, 146, 0.18);
}
.coin-tile.selected strong { color: #42d392; }
.mark {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}
.mark.dark { color: #111; }
.chain-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.chain-tile {
  grid-template-columns: 26px 1fr;
  justify-items: start;
  align-items: center;
  gap: 9px;
  min-height: 46px;
  padding: 8px 11px;
  text-align: left;
}
.chain-tile .mark { width: 26px; height: 26px; font-size: 8px; }
.chain-tile em {
  font-style: normal;
  font-weight: 700;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chain-tile.selected {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.14);
}
.chain-tile.selected em { color: #38bdf8; }
.chain-tile:disabled { cursor: default; opacity: 0.95; }
.picked {
  margin-top: 6px;
  color: #9aa0aa;
  font-size: 12px;
}
.picked b { color: #e6ecf5; font-weight: 600; }

@media (max-width: 980px) {
  .grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .coin-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .chain-grid { grid-template-columns: 1fr; }
}
