:root {
  --bg: #05081a;
  --panel: rgba(16, 22, 56, 0.72);
  --panel-solid: #0d1333;
  --box: rgba(8, 12, 34, 0.75);
  --line: rgba(140, 150, 255, 0.14);
  --line2: rgba(140, 150, 255, 0.3);
  --text: #eef1ff;
  --muted: #959dcf;
  --dim: #6a72a6;
  --blue: #4a63ff;
  --violet: #8a5cff;
  --green: #2fd18b;
  --red: #ff5c7a;
  --amber: #ffb547;
  --r: 18px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  background:
    radial-gradient(70vmax 50vmax at 0% -10%, rgba(58, 77, 255, 0.28), transparent 60%),
    radial-gradient(60vmax 50vmax at 100% 10%, rgba(138, 92, 255, 0.22), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font: 15px/1.5 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: #a9b8ff; text-decoration: none; }
a:hover { color: #fff; }
button { font: inherit; color: inherit; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.up { color: var(--green) !important; }
.down { color: var(--red) !important; }
.warn { color: var(--amber) !important; }
.boot { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 14px; color: var(--muted); }
.boot img { border-radius: 14px; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.5; transform: scale(0.96); } }
.noscript { text-align: center; padding: 40px; }

/* ---------- header ---------- */
.top { position: sticky; top: 0; z-index: 30; background: rgba(5, 8, 26, 0.72); backdrop-filter: blur(16px) saturate(140%); -webkit-backdrop-filter: blur(16px) saturate(140%); border-bottom: 1px solid var(--line); }
.top-in { max-width: 1320px; margin: 0 auto; padding: 0 20px; height: 66px; display: flex; align-items: center; gap: 28px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 800; font-size: 19px; letter-spacing: -0.02em; }
.brand img { border-radius: 9px; }
.brand b { background: linear-gradient(90deg, #7389ff, var(--violet)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.pill { font-size: 10px; font-weight: 800; letter-spacing: 0.12em; padding: 3px 8px; border-radius: 6px; background: linear-gradient(135deg, var(--blue), var(--violet)); color: #fff; }
.nav { display: flex; gap: 6px; }
.navlink { padding: 8px 14px; border-radius: 10px; color: var(--muted); font-weight: 600; }
.navlink:hover { color: var(--text); background: rgba(255, 255, 255, 0.04); }
.navlink.on { color: #fff; background: rgba(74, 99, 255, 0.2); }
.who { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.addr-chip { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 11px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); font-family: ui-monospace, Menlo, monospace; font-size: 13px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px var(--green); }

/* ---------- buttons & inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; cursor: pointer;
  padding: 11px 20px; border-radius: 12px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, #4a63ff, #7b5cff 60%, #a35cff);
  box-shadow: 0 8px 24px -10px rgba(110, 92, 255, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.22);
  transition: transform 0.15s, filter 0.15s; white-space: nowrap;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.1); color: #fff; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.sm { padding: 8px 14px; font-size: 14px; border-radius: 10px; }
.btn.ghost { background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line2); box-shadow: none; color: var(--text); }
.btn.ghost:hover:not(:disabled) { background: rgba(255, 255, 255, 0.08); }
.btn.danger { background: linear-gradient(135deg, #ff5c7a, #d6355a); box-shadow: 0 8px 24px -10px rgba(255, 92, 122, 0.8); }
.danger-text { color: var(--red) !important; }
.busy { position: relative; color: transparent !important; pointer-events: none; }
.busy::after { content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.35); border-top-color: #fff; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.04); cursor: pointer; color: var(--muted); font-size: 17px; }
.icon-btn:hover { color: #fff; border-color: var(--line2); }
.link { background: none; border: 0; color: #a9b8ff; cursor: pointer; padding: 0 0 0 8px; font-size: 13px; }
.text-input, .num-input, .search-input {
  width: 100%; background: var(--box); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; color: var(--text); font-size: 15px; outline: none;
}
.text-input:focus, .num-input:focus, .search-input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(74, 99, 255, 0.22); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.04); cursor: pointer; font-size: 13px; font-weight: 600; color: var(--muted); }
.chip:hover:not(:disabled) { color: #fff; border-color: var(--line2); }
.chip.on { background: rgba(74, 99, 255, 0.25); border-color: rgba(110, 130, 255, 0.6); color: #fff; }
.chip:disabled { opacity: 0.4; cursor: not-allowed; }

/* ---------- layout ---------- */
.wrap { max-width: 1320px; margin: 0 auto; padding: 24px 20px 40px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: 0 20px 50px -30px rgba(0, 0, 0, 0.8); }
.card + .card { margin-top: 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card h3, .card-head h3 { margin: 0; font-size: 17px; letter-spacing: -0.01em; }
.fine { color: var(--dim); font-size: 13px; margin: 14px 0 0; }
.alert { border-radius: 12px; padding: 11px 14px; font-size: 14px; margin-top: 12px; }
.alert.err { background: rgba(255, 92, 122, 0.1); border: 1px solid rgba(255, 92, 122, 0.35); color: #ff9aae; }
.warn-text { color: var(--amber); font-size: 14px; margin: 0; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; align-items: center; }
.gap { gap: 10px; flex-wrap: wrap; }
.k { color: var(--muted); font-size: 13px; }

.wallet-bar { display: flex; align-items: center; gap: 40px; flex-wrap: wrap; padding: 16px 22px; }
.wb-item { display: flex; flex-direction: column; gap: 2px; }
.wb-item .v { font-weight: 700; font-size: 16px; }
.wb-actions { margin-left: auto; display: flex; gap: 10px; }
.search { display: flex; gap: 10px; max-width: 920px; margin: 20px auto; }
.search-input { padding: 15px 18px; font-size: 15px; border-radius: 14px; }
.search .btn { padding: 0 30px; border-radius: 14px; }

.grid { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 18px; align-items: start; }
.panel { position: sticky; top: 84px; padding: 18px; }
.col-left, .panel { min-width: 0; }
.search { min-width: 0; }
.search-input { min-width: 0; text-overflow: ellipsis; }

/* ---------- token ---------- */
.tok-head { display: flex; align-items: center; gap: 14px; }
.tok-avatar { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 22px; background: linear-gradient(135deg, var(--blue), var(--violet)); box-shadow: 0 10px 24px -8px rgba(110, 92, 255, 0.8); flex: none; }
.tok-names { min-width: 0; }
.tok-names h2 { margin: 0; font-size: 24px; letter-spacing: -0.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sym { margin-left: auto; padding: 6px 12px; border-radius: 10px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); font-weight: 800; letter-spacing: 0.04em; }
.lp-tag { display: inline-block; margin-top: 14px; padding: 6px 12px; border-radius: 999px; background: rgba(138, 92, 255, 0.15); border: 1px solid rgba(160, 120, 255, 0.35); color: #cdbbff; font-size: 13px; font-weight: 600; }
.lp-prot { color: var(--amber); }
.price-row { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin: 20px 0 18px; }
.price { font-size: 40px; font-weight: 800; letter-spacing: -0.035em; }
.chg { font-weight: 700; font-size: 14px; }
.chg.up { color: var(--green); }
.chg.down { color: var(--red); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stat { background: var(--box); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.stat .v { font-size: 18px; font-weight: 800; letter-spacing: -0.02em; }
.pos-grid { display: grid; grid-template-columns: repeat(4, 1fr); text-align: center; }
.pos-grid > div { display: flex; flex-direction: column; gap: 4px; padding: 6px 8px; border-right: 1px solid var(--line); }
.pos-grid > div:last-child { border-right: 0; }
.pos-grid .v { font-weight: 800; font-size: 16px; }
.chart { position: relative; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: #0b0f26; height: 520px; }
.chart iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.empty-state { text-align: center; padding: 70px 24px; }
.empty-ico { width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 18px; display: grid; place-items: center; font-size: 28px; background: rgba(74, 99, 255, 0.15); border: 1px solid var(--line2); }
.empty-state h3 { font-size: 20px; margin-bottom: 6px; }
.skeleton { display: flex; flex-direction: column; gap: 14px; }
.sk-line { height: 18px; border-radius: 8px; background: linear-gradient(90deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.04)); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
.w40 { width: 40%; } .w70 { width: 70%; height: 40px; } .w90 { width: 90%; height: 70px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- trade panel ---------- */
.panel-in { display: flex; flex-direction: column; gap: 12px; }
.panel-top { display: flex; gap: 10px; }
.seg { flex: 1; display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: 14px; background: var(--box); border: 1px solid var(--line); }
.seg-btn { border: 0; background: none; padding: 10px; border-radius: 11px; font-weight: 800; cursor: pointer; color: var(--muted); }
.seg-btn.buy.on { background: linear-gradient(135deg, rgba(47, 209, 139, 0.25), rgba(47, 209, 139, 0.1)); color: var(--green); box-shadow: inset 0 0 0 1px rgba(47, 209, 139, 0.4); }
.seg-btn.sell.on { background: linear-gradient(135deg, rgba(255, 92, 122, 0.25), rgba(255, 92, 122, 0.1)); color: var(--red); box-shadow: inset 0 0 0 1px rgba(255, 92, 122, 0.4); }
.box { background: var(--box); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.box-head { display: flex; justify-content: space-between; color: var(--muted); font-size: 14px; gap: 10px; }
.box-row { display: flex; align-items: center; gap: 10px; }
.amount-input { flex: 1; min-width: 0; background: none; border: 0; outline: none; color: var(--text); font-size: 30px; font-weight: 800; letter-spacing: -0.02em; padding: 0; }
.amount-input.pct { font-size: 22px; color: #c8cfff; }
.amount-input::placeholder { color: #3d457a; }
.unit { font-weight: 800; color: var(--muted); }
.receive { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.receive.muted { font-size: 18px; font-weight: 600; }
.details { display: flex; flex-direction: column; gap: 6px; padding: 4px 4px; font-size: 13px; }
.details > div { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); }
.details > div span:last-child { color: var(--text); font-weight: 600; text-align: right; }
.trade-btn { border: 0; border-radius: 14px; padding: 16px; font-size: 16px; font-weight: 800; cursor: pointer; color: #fff; transition: filter 0.15s, transform 0.15s; display: flex; justify-content: center; }
.trade-btn.buy { background: linear-gradient(135deg, #1fbf7d, #2fd18b); box-shadow: 0 10px 30px -12px rgba(47, 209, 139, 0.9); }
.trade-btn.sell { background: linear-gradient(135deg, #e8405f, #ff5c7a); box-shadow: 0 10px 30px -12px rgba(255, 92, 122, 0.9); }
.trade-btn.warn { background: linear-gradient(135deg, #e89a20, #ffb547); color: #2a1a00; }
.trade-btn:hover:not(:disabled) { filter: brightness(1.08); transform: translateY(-1px); }
.trade-btn:disabled { opacity: 0.4; cursor: not-allowed; box-shadow: none; }

/* ---------- bottom tables ---------- */
.bottom { margin-top: 18px; padding: 0; overflow: hidden; }
.bottom-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 0 22px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tabs { display: flex; gap: 20px; }
.tab { border: 0; background: none; padding: 16px 0; font-weight: 700; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; }
.tab.on { color: #fff; border-bottom-color: var(--violet); }
.pad { padding: 20px 22px; margin: 0; }
.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 640px; }
th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--dim); padding: 12px 22px; border-bottom: 1px solid var(--line); }
td { padding: 13px 22px; border-bottom: 1px solid rgba(140, 150, 255, 0.07); }
tr:last-child td { border-bottom: 0; }
tr.click { cursor: pointer; }
tr.click:hover td { background: rgba(74, 99, 255, 0.07); }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; }
.b-green { background: rgba(47, 209, 139, 0.14); color: var(--green); }
.b-red { background: rgba(255, 92, 122, 0.14); color: var(--red); }
.b-amber { background: rgba(255, 181, 71, 0.14); color: var(--amber); }
.b-blue { background: rgba(74, 99, 255, 0.2); color: #b3c0ff; }
.b-grey { background: rgba(150, 157, 207, 0.14); color: var(--muted); }

/* ---------- wallets page ---------- */
.page-head { display: flex; align-items: center; justify-content: space-between; margin: 8px 0 18px; }
.page-head h1 { margin: 0; font-size: 32px; letter-spacing: -0.03em; }
.wlist { display: flex; flex-direction: column; gap: 10px; margin: 16px 0 18px; }
.witem { display: flex; align-items: center; gap: 18px; padding: 16px 18px; border-radius: 16px; background: var(--box); border: 1px solid var(--line); flex-wrap: wrap; }
.witem.on { border-color: rgba(47, 209, 139, 0.55); box-shadow: 0 0 0 1px rgba(47, 209, 139, 0.25), 0 10px 30px -18px rgba(47, 209, 139, 0.7); }
.winfo { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.wtags { display: flex; gap: 6px; }
.wbal { margin-left: auto; font-weight: 800; font-size: 17px; }
.wactions { display: flex; gap: 8px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 18px; }
.two .card { margin: 0; display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.two .card p { margin: 0; }
.addr-box { width: 100%; padding: 12px 14px; border-radius: 12px; background: var(--box); border: 1px solid var(--line); overflow-wrap: anywhere; font-size: 13px; }
.addr-box.key { color: var(--amber); }
.bullets { margin: 0; padding-left: 18px; color: var(--muted); font-size: 14px; }

/* ---------- login ---------- */
.login { min-height: calc(100vh - 140px); display: grid; place-items: center; padding: 40px 16px; }
.login-card { width: 100%; max-width: 440px; text-align: center; padding: 40px 32px; border-radius: 28px; background: var(--panel); border: 1px solid var(--line2); box-shadow: 0 40px 100px -40px rgba(110, 92, 255, 0.7); backdrop-filter: blur(12px); }
.login-logo { margin: 0 auto 18px; display: block; border-radius: 18px; box-shadow: 0 16px 40px -10px rgba(110, 92, 255, 0.9); }
.login-card h1 { margin: 0 0 8px; font-size: 32px; letter-spacing: -0.035em; }
.grad { background: linear-gradient(95deg, #8ea6ff, #b28bff 60%, #d18cff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.wallet-list { display: flex; flex-direction: column; gap: 10px; margin: 26px 0 8px; }
.wallet-btn { display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line2); background: rgba(255, 255, 255, 0.04); cursor: pointer; font-weight: 700; font-size: 16px; transition: all 0.15s; }
.wallet-btn:hover { background: rgba(74, 99, 255, 0.15); border-color: rgba(110, 130, 255, 0.6); transform: translateY(-1px); }
.wallet-btn img { border-radius: 8px; }
.wicon { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: linear-gradient(135deg, var(--blue), var(--violet)); font-size: 13px; }
.wallet-btn .go { margin-left: auto; color: var(--muted); }
.install { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

/* ---------- modal & toasts ---------- */
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(2, 4, 14, 0.7); backdrop-filter: blur(6px); display: grid; place-items: center; padding: 16px; animation: fade 0.15s; }
.modal { width: 100%; max-width: 460px; background: var(--panel-solid); border: 1px solid var(--line2); border-radius: 22px; padding: 22px; box-shadow: 0 40px 100px -30px rgba(0, 0, 0, 0.9); max-height: calc(100vh - 32px); overflow-y: auto; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 10px; }
.modal-head h3 { margin: 0; font-size: 19px; }
@keyframes fade { from { opacity: 0; } }
.toasts { position: fixed; z-index: 60; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 10px; max-width: min(420px, calc(100vw - 40px)); }
.toast { padding: 14px 16px; border-radius: 14px; background: var(--panel-solid); border: 1px solid var(--line2); box-shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.9); display: flex; flex-direction: column; gap: 4px; font-size: 14px; animation: slide 0.2s; transition: opacity 0.5s, transform 0.5s; }
.toast.ok { border-color: rgba(47, 209, 139, 0.5); }
.toast.err { border-color: rgba(255, 92, 122, 0.5); }
.toast.out { opacity: 0; transform: translateY(8px); }
@keyframes slide { from { transform: translateY(12px); opacity: 0; } }

.foot { max-width: 1320px; margin: 0 auto; padding: 20px 20px 32px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; color: var(--dim); font-size: 13px; border-top: 1px solid var(--line); }
.foot .links { display: flex; gap: 18px; }

@media (max-width: 1080px) {
  .grid { grid-template-columns: minmax(0, 1fr); }
  .panel { position: static; }
}
@media (max-width: 720px) {
  .top-in { gap: 12px; height: 60px; }
  .pill, .addr-chip { display: none; }
  .wrap { padding: 16px 14px 30px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat .v { font-size: 16px; overflow-wrap: anywhere; }
  .pos-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .pos-grid > div { border-right: 0; }
  .price { font-size: 32px; }
  .chart { height: 420px; }
  .wallet-bar { gap: 18px; }
  .wb-actions { margin-left: 0; }
  .two { grid-template-columns: 1fr; }
  .wbal { margin-left: 0; }
  .search .btn { padding: 0 18px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
