/* Oues — gold on dark. Palette harmonized with the gold serif wordmark. */
:root {
  --bg: #0B0E1A;
  --bg2: #10142a;
  --panel: #141935;
  --panel2: #1a2044;
  --line: #262d55;
  --gold: #E9B949;
  --gold-hi: #F9DC7A;
  --gold-lo: #9A6B0F;
  --text: #eef0ff;
  --muted: #9aa3c7;
  --good: #3ecf8e;
  --bad: #ff6473;
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  min-height: 100vh;
  display: flex; flex-direction: column;
}
a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-hi); }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; word-break: break-all; }

/* header */
.topbar {
  display: flex; align-items: center; gap: 18px;
  padding: 10px 18px; border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #0d1122, var(--bg));
  position: sticky; top: 0; z-index: 40;
}
.brand { display: flex; align-items: baseline; gap: 8px; }
.brand img { display: block; align-self: center; }
.brand-sub { color: var(--muted); letter-spacing: .22em; text-transform: uppercase; font-size: 11px; }
.mainnav { display: flex; gap: 4px; margin-left: 8px; }
.mainnav a { color: var(--text); padding: 7px 12px; border-radius: 9px; font-weight: 600; }
.mainnav a:hover { background: var(--panel); color: var(--gold-hi); }
.mainnav a.active { background: var(--panel2); color: var(--gold); box-shadow: inset 0 0 0 1px var(--line); }
.walletbox { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.net-badge { color: var(--muted); font-size: 12px; border: 1px solid var(--line); padding: 4px 8px; border-radius: 99px; }

/* buttons + inputs */
.btn {
  appearance: none; border: 1px solid var(--line); background: var(--panel2); color: var(--text);
  padding: 9px 16px; border-radius: 10px; font-weight: 700; cursor: pointer; font-size: 14px;
}
.btn:hover { border-color: var(--gold-lo); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-gold {
  background: linear-gradient(180deg, var(--gold-hi), var(--gold) 55%, var(--gold-lo));
  color: #241a02; border-color: var(--gold-lo);
}
.btn-gold:hover { filter: brightness(1.06); color: #241a02; }
.btn-ghost { background: transparent; }
.btn-danger { border-color: #5b2430; color: var(--bad); background: transparent; }
.btn-wide { width: 100%; }
input, select, textarea {
  width: 100%; background: var(--bg2); border: 1px solid var(--line); color: var(--text);
  border-radius: 10px; padding: 10px 12px; font-size: 14px; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--gold-lo); box-shadow: 0 0 0 2px rgba(233,185,73,.18); }
label { display: block; font-size: 12.5px; color: var(--muted); margin: 10px 0 5px; font-weight: 600; }
label:first-child { margin-top: 0; }

/* layout */
.app { flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: 22px 16px 40px; }
.loading, .empty { text-align: center; color: var(--muted); padding: 60px 10px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 14px; }
.two-col { display: grid; grid-template-columns: 1.65fr 1fr; gap: 16px; align-items: start; }
.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; margin-bottom: 16px;
}
.panel h2, .panel h3 { margin: 0 0 10px; }
.panel h3 { font-size: 15px; color: var(--gold-hi); letter-spacing: .02em; }
.foot { border-top: 1px solid var(--line); padding: 16px 18px 22px; display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: center; justify-content: space-between; }
.foot img { vertical-align: middle; margin-right: 8px; }

/* board */
.board-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.board-head h1 { font-size: 22px; margin: 0 8px 0 0; }
.tabs { display: flex; gap: 6px; }
.tabs button {
  background: var(--panel); color: var(--muted); border: 1px solid var(--line);
  border-radius: 99px; padding: 6px 14px; font-weight: 700; cursor: pointer;
}
.tabs button.active { color: #241a02; background: linear-gradient(180deg, var(--gold-hi), var(--gold)); border-color: var(--gold-lo); }
.searchbox { flex: 1; min-width: 180px; }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; display: flex; flex-direction: column; gap: 8px; color: var(--text);
}
.card:hover { border-color: var(--gold-lo); }
.card .sym { font-size: 17px; font-weight: 800; }
.card .nm { color: var(--muted); font-size: 13px; }
.card img.thumb { width: 100%; height: 110px; object-fit: cover; border-radius: 9px; background: var(--bg2); }
.pill { display: inline-block; font-size: 11px; font-weight: 800; padding: 2.5px 8px; border-radius: 99px; letter-spacing: .04em; }
.pill-bond { background: #23305e; color: #a9bcff; }
.pill-grad { background: #14532d; color: #7bf1a8; }
.pill-tax { background: #4a3605; color: var(--gold-hi); }
.pill-std { background: #2c2f45; color: var(--muted); }
.progress { height: 9px; border-radius: 99px; background: var(--bg2); overflow: hidden; border: 1px solid var(--line); }
.progress > div { height: 100%; background: linear-gradient(90deg, var(--gold-lo), var(--gold), var(--gold-hi)); }
.kv { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; padding: 3px 0; }
.kv b { font-weight: 700; text-align: right; }
.up { color: var(--good); } .down { color: var(--bad); }

/* token page */
.token-head { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.token-head img.thumb { width: 58px; height: 58px; border-radius: 12px; object-fit: cover; background: var(--bg2); }
.token-head h1 { margin: 0; font-size: 24px; }
canvas.chart { width: 100%; height: 260px; display: block; background: var(--bg2); border-radius: 10px; }
table.trades { width: 100%; border-collapse: collapse; font-size: 13px; }
table.trades th { text-align: left; color: var(--muted); font-weight: 600; padding: 5px 6px; border-bottom: 1px solid var(--line); }
table.trades td { padding: 5px 6px; border-bottom: 1px solid #1b2145; }
.trade-tabs { display: flex; gap: 6px; margin-bottom: 10px; }
.trade-tabs button { flex: 1; padding: 9px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg2); color: var(--muted); font-weight: 800; cursor: pointer; }
.trade-tabs button.on-buy { background: #14532d; color: #7bf1a8; border-color: #14532d; }
.trade-tabs button.on-sell { background: #5b2430; color: #ffb3ba; border-color: #5b2430; }
input[type="range"] { padding: 0; }

/* modal + toast */
.modal-back {
  position: fixed; inset: 0; background: rgba(4, 6, 14, .72); z-index: 90;
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.modal {
  background: var(--panel); border: 1px solid var(--gold-lo); border-radius: 16px;
  max-width: 430px; width: 100%; padding: 22px; box-shadow: 0 24px 70px rgba(0,0,0,.55);
}
.modal h3 { margin: 0 0 6px; color: var(--gold-hi); }
#toast-root { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 120; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: var(--panel2); border: 1px solid var(--gold-lo); color: var(--text);
  padding: 10px 16px; border-radius: 10px; font-size: 13.5px; box-shadow: 0 10px 30px rgba(0,0,0,.5);
  max-width: min(92vw, 560px);
}
.toast.err { border-color: var(--bad); }
.err-text { color: var(--bad); font-size: 13px; }
.ok-text { color: var(--good); font-size: 13px; }

/* forms */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.split-row { display: grid; grid-template-columns: 92px 1fr 58px; gap: 10px; align-items: center; margin: 6px 0; }
.split-row output { text-align: right; font-weight: 700; }
.checkline { display: flex; gap: 8px; align-items: center; margin: 10px 0; }
.checkline input { width: auto; }

@media (max-width: 860px) {
  .two-col { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .topbar { flex-wrap: wrap; gap: 10px; }
  .mainnav { order: 3; width: 100%; }
  .mainnav a { flex: 1; text-align: center; }
  canvas.chart { height: 200px; }
  .app { padding: 16px 12px 32px; }
}
