:root {
  --bg: #F8F6F7;
  --surface: #FFFFFF;
  --raise: #F5EEF0;
  --line: #ECE2E5;
  --ink: #22151A;
  --muted: #7B6970;
  --faint: #B7A5AB;
  --brass: #C4122F;
  --brass-ink: #FFFFFF;
  --brass-soft: rgba(196,18,47,.06);
  --grad: linear-gradient(135deg, #6E0A1E 0%, #B3102C 42%, #E23A4B 78%, #F58A7E 100%);
  --grad-btn: linear-gradient(135deg, #A50E28 0%, #D42640 60%, #EC5A5E 100%);
  --jade: #1C8A66;
  --amber: #C27A0E;
  --ruby: #C4122F;
  --slate: #5D6F94;
  --shadow: 0 1px 2px rgba(60,10,20,.04), 0 12px 32px -18px rgba(110,10,30,.22);
  --serif: "Cormorant Garamond", "Noto Serif KR", "Hiragino Mincho ProN", "Songti SC", Georgia, serif;
  --sans: Manrope, "Apple SD Gothic Neo", "Noto Sans KR", "Hiragino Sans", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #140B0E; --surface: #1D1115; --raise: #28171D; --line: #3A2329;
  --ink: #F4EAEC; --muted: #B39CA3; --faint: #7A6168;
  --brass: #F0545C; --brass-ink: #FFFFFF; --brass-soft: rgba(240,84,92,.10);
  --jade: #4DC29B; --amber: #E8A93E; --ruby: #F0545C; --slate: #8C9EC4;
  --shadow: none;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root[data-follow="system"] {
    --bg: #140B0E; --surface: #1D1115; --raise: #28171D; --line: #3A2329;
    --ink: #F4EAEC; --muted: #B39CA3; --faint: #7A6168;
    --brass: #F0545C; --brass-ink: #FFFFFF; --brass-soft: rgba(240,84,92,.10);
    --jade: #4DC29B; --amber: #E8A93E; --ruby: #F0545C; --slate: #8C9EC4;
    --shadow: none;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); background-image: radial-gradient(900px 420px at 100% -10%, var(--brass-soft), transparent 70%); background-attachment: fixed; color: var(--ink); font-family: var(--sans); font-size: 15px; line-height: 1.5;
       -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums lining-nums; }
.muted { color: var(--muted); }
.hidden { display: none !important; }

/* ── Shell ───────────────────────────── */
.shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
aside.side { position: sticky; top: 0; height: 100vh; border-right: 1px solid var(--line);
             display: flex; flex-direction: column; padding: 26px 18px 20px; gap: 28px; background: var(--surface); }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px; text-decoration: none; color: var(--ink); }
.brand svg { flex: none; }
.brand b { font-family: var(--serif); font-size: 25px; font-weight: 600; letter-spacing: .01em; line-height: 1; }
.brand span { display: block; font-size: 12px; color: var(--muted); margin-top: 3px; }
nav.menu { display: flex; flex-direction: column; gap: 2px; }
nav.menu a { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 10px;
             color: var(--muted); text-decoration: none; font-weight: 600; font-size: 14.5px; }
nav.menu a svg { width: 19px; height: 19px; flex: none; }
nav.menu a:hover { color: var(--ink); background: var(--raise); }
nav.menu a[aria-current="page"] { color: var(--ink); background: var(--raise); box-shadow: inset 2px 0 0 var(--brass); }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.net { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); padding: 0 8px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); flex: none; }
.dot.on { background: var(--jade); box-shadow: 0 0 0 3px color-mix(in srgb, var(--jade) 20%, transparent); }

main { min-width: 0; padding: 26px clamp(16px, 4vw, 52px) 80px; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 34px; }
.top h1 { margin: 0; font-family: var(--serif); font-weight: 600; font-size: 34px; letter-spacing: -.005em; line-height: 1.1; }
.top .right { display: flex; align-items: center; gap: 10px; }
.mobile-brand { display: none; }

select.lang { appearance: none; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%238E9AB0' fill='none' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 12px center;
              border: 1px solid var(--line); border-radius: 10px; padding: 9px 32px 9px 12px; font-size: 14px; font-weight: 600; cursor: pointer; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 10px; border: 1px solid var(--line);
       background: var(--surface); padding: 10px 16px; font-weight: 700; font-size: 14px; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--faint); }
.btn.gold { background: var(--grad-btn); border-color: transparent; color: #fff; box-shadow: 0 8px 20px -10px rgba(196,18,47,.7); }
.btn.gold:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; }
.btn.sm { padding: 7px 11px; font-size: 13px; border-radius: 8px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
a.btn { text-decoration: none; color: var(--ink); }
a.btn.gold { color: #fff; }
.acct { display: inline-flex; align-items: center; gap: 10px; padding: 6px 14px 6px 6px; border-radius: 999px; border: 1px solid var(--line);
        background: var(--surface); font-weight: 700; font-size: 14px; cursor: pointer; }
.avatar { width: 28px; height: 28px; border-radius: 50%; flex: none; }

.preview { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
           border: 1px solid color-mix(in srgb, var(--brass) 22%, transparent); background: var(--brass-soft);
           border-radius: 12px; padding: 12px 14px 12px 16px; margin-bottom: 30px; font-size: 14px; }
.preview .pill { font-size: 12px; font-weight: 700; color: var(--brass); margin-right: 8px; }

/* ── Portfolio ───────────────────────── */
.hero { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 22px; align-items: stretch; margin-bottom: 22px; }
.hero-card { position: relative; overflow: hidden; border-radius: 24px; padding: 30px 32px 28px; color: #fff; background: var(--grad);
             box-shadow: 0 30px 60px -30px rgba(120,10,30,.65); isolation: isolate; }
.hero-card::before { content: ""; position: absolute; inset: -40% -10% auto auto; width: 70%; aspect-ratio: 1; border-radius: 50%;
             background: radial-gradient(circle, rgba(255,255,255,.28), rgba(255,255,255,0) 65%); z-index: -1; }
.hero-card::after { content: ""; position: absolute; right: 26px; bottom: 22px; width: 120px; height: 120px; z-index: -1; opacity: .16;
             background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Ccircle cx='20' cy='20' r='18.5' fill='none' stroke='white' stroke-width='1.2'/%3E%3Ccircle cx='20' cy='20' r='14.5' fill='none' stroke='white' stroke-width='.6'/%3E%3C/svg%3E") center/contain no-repeat; }
.hero .hero-card .label, .hero .hero-card p { color: rgba(255,255,255,.84); }
.hero .hero-card .price { color: #fff; }
.hero-card .worth .cents { color: rgba(255,255,255,.7); }
.alloc { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 26px 26px 24px; box-shadow: var(--shadow);
         display: flex; flex-direction: column; justify-content: center; }
.hero .label { font-size: 14px; color: var(--muted); font-weight: 600; }
.worth { font-family: var(--serif); font-weight: 600; font-size: clamp(52px, 7.4vw, 92px); line-height: .95; letter-spacing: -.02em;
         margin: 8px 0 14px; font-variant-numeric: lining-nums tabular-nums; }
.worth .cents { color: var(--muted); font-size: .5em; letter-spacing: 0; }
.hero p { margin: 0; color: var(--muted); font-size: 13.5px; max-width: 46ch; }
.hero .price { color: var(--ink); font-weight: 600; margin-top: 6px; }
.alloc h3 { margin: 0 0 12px; font-size: 14px; color: var(--muted); font-weight: 600; }
.ribbon { display: flex; height: 10px; border-radius: 6px; overflow: hidden; background: var(--raise); gap: 2px; }
.ribbon i { display: block; height: 100%; }
.legend { list-style: none; padding: 0; margin: 14px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 18px; font-size: 13px; }
.legend li { display: flex; align-items: center; gap: 8px; min-width: 0; }
.legend .sw { width: 9px; height: 9px; border-radius: 2px; flex: none; }
.legend .lv { margin-left: auto; font-weight: 600; }

.cols { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 22px; box-shadow: var(--shadow); }
.panel > h2, .sec-h { margin: 0 0 14px; font-size: 16px; font-weight: 700; }
table.assets { width: 100%; border-collapse: collapse; font-size: 14px; }
table.assets th { text-align: right; font-weight: 600; color: var(--muted); font-size: 12.5px; padding: 0 0 10px; }
table.assets th:first-child, table.assets td:first-child { text-align: left; }
table.assets td { padding: 14px 0; border-top: 1px solid var(--line); text-align: right; white-space: nowrap; }
.tok { display: flex; align-items: center; gap: 12px; }
.tok .ic { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 800; flex: none; }
.logo { width: 40px; height: 40px; flex: none; display: grid; place-items: center; background: transparent; }
.logo img { width: 100%; height: 100%; object-fit: contain; display: block; filter: drop-shadow(0 4px 8px rgba(60,10,20,.22)); }
.logo.txt { border-radius: 50%; background: var(--grad); color: #fff; font-size: 10px; font-weight: 800; }
.tok { gap: 16px; }
.tok b { display: block; font-size: 14.5px; }
.tok small { color: var(--muted); font-size: 12.5px; }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 11px 14px; font-size: 14px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; font-weight: 600; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 20px; }

/* ── Staking ─────────────────────────── */
.stake-head { display: grid; grid-template-columns: auto 1fr; gap: 34px; align-items: center; margin-bottom: 30px; }
.apr { font-family: var(--serif); font-weight: 600; font-size: clamp(64px, 9vw, 112px); line-height: .85; letter-spacing: -.03em; }
.apr .g { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.apr small { display: block; font-family: var(--sans); font-size: 13px; letter-spacing: 0; color: var(--muted); font-weight: 600; margin-top: 10px; }
.lead { margin: 0; color: var(--muted); font-size: 15.5px; max-width: 52ch; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 18px; background: var(--surface); margin-bottom: 22px; box-shadow: var(--shadow); }
.stats > div { padding: 18px 20px; }
.stats > div + div { border-left: 1px solid var(--line); }
.stats .k { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.stats .v { font-size: 21px; font-weight: 700; margin-top: 4px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field label { font-size: 13px; color: var(--muted); font-weight: 600; display: flex; justify-content: space-between; gap: 10px; }
.inbox { display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--bg); border-radius: 12px; padding: 6px 6px 6px 14px; }
.inbox:focus-within { border-color: var(--brass); box-shadow: 0 0 0 3px var(--brass-soft); }
.inbox input { flex: 1; min-width: 0; border: 0; background: transparent; font-size: 20px; font-weight: 600; padding: 6px 0; outline: none; }
.inbox .unit { color: var(--muted); font-weight: 700; font-size: 13px; padding: 0 6px; }
.note { font-size: 13px; color: var(--muted); margin: 14px 0 0; }
.est { margin-top: 18px; border-radius: 16px; padding: 18px; background: var(--brass-soft); border: 1px solid color-mix(in srgb, var(--brass) 14%, transparent); }
.est-h { font-size: 13px; font-weight: 700; color: var(--brass); margin-bottom: 12px; }
.est-g { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.est-g > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.est-g span { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.est-g b { font-family: var(--serif); font-size: 28px; font-weight: 600; line-height: 1.1; overflow-wrap: anywhere; }
.est-g small { font-size: 12.5px; color: var(--muted); }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.field { min-width: 0; }
.field label { flex-wrap: wrap; align-items: center; min-height: 26px; }
.inbox input { width: 100%; }

/* ── Borrow ──────────────────────────── */
.chips { display: flex; gap: 6px; }
.chips button { border: 1px solid var(--line); background: transparent; border-radius: 8px; padding: 4px 9px; font-size: 12.5px; font-weight: 700; color: var(--muted); cursor: pointer; }
.chips button:hover { color: var(--ink); border-color: var(--faint); }
.loans { display: flex; flex-direction: column; gap: 14px; }
.loan { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 22px; box-shadow: var(--shadow); }
.loan-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.loan-head h3 { margin: 0; font-family: var(--serif); font-size: 26px; font-weight: 600; }
.status { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 700; padding: 5px 11px; border-radius: 999px; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.s-ok { color: var(--jade); background: color-mix(in srgb, var(--jade) 13%, transparent); }
.s-warn { color: var(--amber); background: color-mix(in srgb, var(--amber) 14%, transparent); }
.s-bad { color: var(--ruby); background: color-mix(in srgb, var(--ruby) 14%, transparent); }
.s-done { color: var(--muted); background: var(--raise); }
.loan-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; }

.gauge .top-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.gauge .pct { font-family: var(--serif); font-size: 44px; font-weight: 600; line-height: 1; }
.gauge .lbl { font-size: 13px; color: var(--muted); font-weight: 600; }
.track { position: relative; height: 8px; border-radius: 5px; background: linear-gradient(90deg,
         color-mix(in srgb, var(--jade) 55%, transparent) 0 50%, color-mix(in srgb, var(--amber) 55%, transparent) 50% 83.3%, color-mix(in srgb, var(--ruby) 60%, transparent) 83.3% 100%); }
.track .mk { position: absolute; top: -5px; width: 2px; height: 18px; background: var(--ink); opacity: .55; }
.track .me { position: absolute; top: 50%; width: 18px; height: 18px; border-radius: 50%; transform: translate(-50%, -50%);
             background: var(--grad); border: 4px solid var(--surface); box-shadow: 0 0 0 1px var(--line), 0 4px 10px -2px rgba(150,10,30,.5); }
.marks { position: relative; height: 18px; margin-top: 8px; font-size: 11.5px; color: var(--muted); }
.marks span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.loan-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.loan-actions .inbox { flex: 1 1 160px; padding: 2px 4px 2px 12px; border-radius: 10px; }
.loan-actions .inbox input { font-size: 15px; }
.empty { border: 1px dashed var(--line); border-radius: 18px; padding: 32px; text-align: center; color: var(--muted); }

/* ── Activity ────────────────────────── */
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: grid; grid-template-columns: 38px 1fr auto; gap: 14px; align-items: center; padding: 15px 0; border-top: 1px solid var(--line); }
.feed li:first-child { border-top: 0; }
.feed .ic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--raise); color: var(--brass); }
.feed .ic svg { width: 18px; height: 18px; }
.feed b { display: block; font-size: 14.5px; }
.feed small { color: var(--muted); font-size: 12.5px; }
.feed .amt { text-align: right; font-weight: 700; }
.feed .amt a { display: block; font-size: 12px; color: var(--muted); font-weight: 600; text-decoration: none; }
.feed .amt a:hover { color: var(--brass); }

/* ── Settings ────────────────────────── */
.setgrid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 7px 13px; border-radius: 7px; font-weight: 600; font-size: 13.5px; color: var(--muted); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--raise); color: var(--ink); }
.setrow { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; padding: 14px 0; border-top: 1px solid var(--line); }
.setrow:first-of-type { border-top: 0; padding-top: 0; }
.setrow > span { font-weight: 600; }
.addr { display: flex; justify-content: space-between; gap: 10px; padding: 11px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.addr:first-of-type { border-top: 0; padding-top: 0; }
.addr code { font-family: var(--sans); color: var(--muted); font-variant-numeric: tabular-nums; }
.addr a { color: var(--brass); text-decoration: none; font-weight: 700; }
ol.rules { margin: 0; padding-left: 20px; color: var(--muted); font-size: 14px; display: flex; flex-direction: column; gap: 10px; }
ol.rules li::marker { color: var(--brass); font-weight: 700; }

.demo { margin-top: 26px; border: 1px dashed var(--line); border-radius: 18px; padding: 20px; }
.demo h2 { margin: 0; font-size: 15px; }
.demo p { margin: 4px 0 14px; color: var(--muted); font-size: 13px; }
.demo .row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.demo input { border: 1px solid var(--line); background: var(--bg); border-radius: 10px; padding: 9px 12px; width: 150px; }

/* ── Trade ───────────────────────── */
.sim-note, .live-note { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 13.5px; border-radius: 12px; padding: 11px 14px; margin-bottom: 20px;
            background: color-mix(in srgb, var(--amber) 10%, transparent); border: 1px dashed color-mix(in srgb, var(--amber) 55%, transparent); color: var(--ink); }
.sim-note .pill { font-size: 12px; font-weight: 800; color: #fff; background: var(--amber); padding: 3px 9px; border-radius: 999px; }
.live-note { background: color-mix(in srgb, var(--jade) 9%, transparent); border: 1px solid color-mix(in srgb, var(--jade) 35%, transparent); }
.mkt-head { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; margin-bottom: 18px; }
.pair { display: flex; align-items: center; gap: 12px; }
.pair b { display: block; font-size: 18px; }
.pair small { color: var(--muted); font-size: 12.5px; }
.pair-logos { display: flex; }
.pl { width: 34px; height: 34px; display: grid; place-items: center; }
.pl + .pl { margin-left: -10px; }
.pl .logo { width: 100%; height: 100%; }
.pl img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 3px 6px rgba(60,10,20,.25)); }
.pl.txt { border-radius: 50%; background: var(--grad); color: #fff; font-size: 9px; font-weight: 800; }
.mk-last { display: flex; align-items: baseline; gap: 10px; }
.mk-last > span:first-child { font-family: var(--serif); font-size: 38px; font-weight: 600; line-height: 1; transition: color .25s; }
.mk-last .chg { font-weight: 700; font-size: 14px; }
.up { color: var(--jade) !important; } .dn { color: var(--ruby) !important; }
.mk-stats { display: flex; gap: 26px; margin: 0 0 0 auto; }
.mk-stats dt { font-size: 12px; color: var(--muted); font-weight: 600; }
.mk-stats dd { margin: 2px 0 0; font-weight: 700; }
.mkt-grid { display: grid; grid-template-columns: minmax(0, 1fr) 330px; grid-template-areas: "chart book" "order tape" "orders funds"; gap: 18px; }
.chart-panel { grid-area: chart; padding: 16px 16px 10px; display: flex; flex-direction: column; }
.book-panel { grid-area: book; padding: 18px 16px; }
.order-panel { grid-area: order; }
.trades-panel { grid-area: tape; padding: 18px 16px; }
.orders-panel { grid-area: orders; }
.funds-panel { grid-area: funds; padding: 18px 16px; }
.otype { margin: 0 0 14px; }
.order-panel .field[hidden] { display: none; }
.mkt-grid > * { min-width: 0; }
.btn[hidden] { display: none; }
@media (max-width: 860px) { table.orders { min-width: 520px; } }
.pcts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 10px; }
.pcts button { border: 1px solid var(--line); background: transparent; border-radius: 8px; padding: 6px 0; font-size: 12.5px; font-weight: 700; color: var(--muted); cursor: pointer; }
.pcts button:hover { color: var(--ink); border-color: var(--faint); }
.book .row { cursor: pointer; }
.book .row:hover { background: var(--raise); }
.book .empty-side { font-size: 12.5px; color: var(--muted); padding: 10px 6px; text-align: center; }
.ph { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.ph h2 { margin: 0; font-size: 16px; }
.tscroll { overflow-x: auto; }
table.orders td, table.orders th { padding-left: 8px; }
table.orders td:first-child, table.orders th:first-child { padding-left: 0; }
.tag { font-weight: 800; font-size: 12.5px; }
.tag.b { color: var(--jade); } .tag.s { color: var(--ruby); }
table.funds { font-size: 13.5px; }
table.funds td { padding: 11px 0; }
.dw { margin-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.dw .inbox { padding: 2px 4px 2px 12px; border-radius: 10px; }
.dw .inbox input { font-size: 15px; }
.dw-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dw .note { margin: 0; }
.chart-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.seg.sm button { padding: 5px 11px; font-size: 12.5px; }
.ohlc { font-size: 12.5px; color: var(--muted); }
.ohlc b { color: var(--ink); font-weight: 700; margin: 0 8px 0 3px; }
.chart-wrap { position: relative; flex: 1; min-height: 420px; }
.chart-wrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: crosshair; }
.book-panel h2, .trades-panel h2 { font-size: 15px; margin-bottom: 10px; }
.book-head { display: grid; grid-template-columns: 1fr 1fr 1fr; font-size: 11.5px; color: var(--muted); font-weight: 600; padding: 0 6px 6px; }
.book-head span:not(:first-child) { text-align: right; }
.book .row, .tape .row { position: relative; display: grid; grid-template-columns: 1fr 1fr 1fr; font-size: 12.5px; padding: 3px 6px; font-variant-numeric: tabular-nums; }
.book .row span:not(:first-child), .tape .row span:not(:first-child) { text-align: right; }
.book .row i { position: absolute; top: 1px; bottom: 1px; right: 0; border-radius: 3px; z-index: 0; transition: width .35s ease; }
.book .row span { position: relative; z-index: 1; }
#asks .row span:first-child { color: var(--ruby); font-weight: 600; }
#bids .row span:first-child { color: var(--jade); font-weight: 600; }
#asks .row i { background: color-mix(in srgb, var(--ruby) 13%, transparent); }
#bids .row i { background: color-mix(in srgb, var(--jade) 14%, transparent); }
.book .row.wall span:nth-child(2) { font-weight: 800; }
.book .row.flash { animation: flash .6s ease; }
@keyframes flash { from { background: color-mix(in srgb, var(--amber) 22%, transparent); } to { background: transparent; } }
.book-mid { display: flex; justify-content: space-between; align-items: baseline; padding: 9px 6px; margin: 4px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.book-mid span { font-family: var(--serif); font-size: 20px; font-weight: 600; }
.book-mid { flex-wrap: wrap; gap: 4px 10px; }
.book-mid small { color: var(--muted); font-size: 11.5px; }
.tape { max-height: 300px; overflow: hidden; }
.tape .row.b span:first-child { color: var(--jade); font-weight: 600; }
.tape .row.s span:first-child { color: var(--ruby); font-weight: 600; }
.tape .row.new { animation: flash .6s ease; }
.tape .row span:last-child { color: var(--muted); }
.swap-tabs { display: grid; grid-template-columns: 1fr 1fr; background: var(--raise); border-radius: 12px; padding: 4px; margin-bottom: 16px; }
.swap-tabs button { border: 0; background: transparent; padding: 10px; border-radius: 9px; font-weight: 700; color: var(--muted); cursor: pointer; }
.swap-tabs button[aria-selected="true"][data-side="buy"] { background: var(--surface); color: var(--jade); box-shadow: 0 2px 8px -4px rgba(0,0,0,.25); }
.swap-tabs button[aria-selected="true"][data-side="sell"] { background: var(--surface); color: var(--ruby); box-shadow: 0 2px 8px -4px rgba(0,0,0,.25); }
.inbox.out { background: var(--raise); }
.sw-kv { margin: 16px 0; }
.sw-kv .chips button.on { color: var(--ink); border-color: var(--brass); background: var(--brass-soft); }
.order-panel .btn.buy { background: linear-gradient(135deg, #0F6E50, #1C8A66 60%, #39B48A); box-shadow: 0 8px 20px -10px rgba(20,120,90,.7); color: #fff; border-color: transparent; }
@media (max-width: 1080px) {
  .mkt-grid { grid-template-columns: 1fr; grid-template-areas: "chart" "order" "book" "tape" "funds" "orders"; }
  .mk-stats { margin-left: 0; }
  .chart-wrap { flex: none; height: 340px; min-height: 0; }
}
@media (max-width: 520px) {
  .mkt-head { gap: 14px; }
  .mk-last > span:first-child { font-size: 30px; }
  .mk-stats { gap: 16px; width: 100%; }
  .chart-wrap { height: 280px; }
  nav.tabbar a { font-size: 10px; }
}

/* ── Operator ──────────────────────── */
.op { margin-top: 22px; border-color: color-mix(in srgb, var(--brass) 30%, var(--line)); }
.op-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 8px; }
.op-stats > div { background: var(--raise); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.op-stats span { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.op-stats b { font-size: 19px; }
.op-stats small { font-size: 12px; color: var(--muted); }
.op-row { display: grid; grid-template-columns: 180px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line); }
.op-row > span { font-weight: 600; }
.op-row .inbox { padding: 2px 4px 2px 12px; border-radius: 10px; }
.op-row .inbox input { font-size: 15px; }
.op-btns { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; justify-content: flex-end; }
@media (max-width: 860px) { .op-stats { grid-template-columns: 1fr; } .op-row { grid-template-columns: 1fr; } .op-btns { justify-content: flex-start; } }

/* ── Landing ───────────────────────── */
body.landing-on .shell, body.landing-on nav.tabbar { display: none; }
.landing { position: fixed; inset: 0; z-index: 60; overflow: auto; display: grid; place-items: center; padding: 72px 16px 40px; background: var(--bg); isolation: isolate; }
.landing.hidden { display: none; }
.landing::before { content: ""; position: absolute; z-index: -1; width: min(980px, 160vw); aspect-ratio: 1; left: 50%; top: 50%; transform: translate(-50%, -56%);
                   border-radius: 50%; background: conic-gradient(from 200deg, #6E0A1E, #C4122F, #F0545C, #F9B4A6, #F0545C, #8E0E24, #6E0A1E);
                   opacity: .16; filter: blur(70px); }
.landing::after { content: ""; position: absolute; z-index: -1; width: min(620px, 120vw); aspect-ratio: 1; left: 50%; top: 50%; transform: translate(-50%, -54%);
                  border-radius: 50%; border: 1px solid color-mix(in srgb, var(--brass) 22%, transparent);
                  box-shadow: 0 0 0 46px color-mix(in srgb, var(--brass) 3%, transparent), 0 0 0 47px color-mix(in srgb, var(--brass) 12%, transparent); }
.land-lang { position: absolute; top: 18px; right: 18px; }
.land-card { width: min(420px, 100%); display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; }
.land-mark { filter: drop-shadow(0 10px 24px rgba(160,10,35,.25)); }
.land-card h1 { font-family: var(--serif); font-weight: 600; font-size: clamp(48px, 9vw, 66px); line-height: 1; margin: 6px 0 0; letter-spacing: -.01em;
                background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; padding-bottom: 4px; }
.land-lead { margin: 0 0 6px; color: var(--muted); font-size: 16px; max-width: 34ch; }
.land-facts { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; margin: 4px 0 14px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.land-facts > div { padding: 14px 6px; display: flex; flex-direction: column; gap: 2px; }
.land-facts > div + div { border-left: 1px solid var(--line); }
.land-facts b { font-family: var(--serif); font-size: 30px; font-weight: 600; line-height: 1; }
.land-facts span { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.btn.xl { width: 100%; padding: 16px 20px; font-size: 16px; border-radius: 14px; }
.btn.xl svg { flex: none; }
.land-safe { display: flex; align-items: flex-start; gap: 8px; margin: 10px 0 0; font-size: 13px; color: var(--muted); text-align: left; }
.land-safe svg { color: var(--jade); flex: none; margin-top: 1px; }
.land-get { margin: 0; font-size: 13px; color: var(--muted); }
.land-get a { color: var(--brass); font-weight: 700; text-decoration: none; }

.acct-wrap { position: relative; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 8px); min-width: 190px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
            box-shadow: 0 18px 40px -18px rgba(60,10,20,.35); padding: 6px; z-index: 45; display: flex; flex-direction: column; }
.menu-pop button { text-align: left; border: 0; background: transparent; padding: 10px 12px; border-radius: 8px; font-weight: 600; font-size: 14px; cursor: pointer; }
.menu-pop button:hover { background: var(--raise); }
#disconnectBtn { color: var(--ruby); }
ul.secure { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; font-size: 14px; color: var(--muted); }
ul.secure li { display: flex; gap: 10px; align-items: flex-start; }
ul.secure svg { color: var(--jade); flex: none; margin-top: 1px; }

#toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 12px); max-width: min(520px, calc(100% - 32px));
         background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 12px; font-size: 14px; font-weight: 600;
         opacity: 0; transition: opacity .18s, transform .18s; pointer-events: none; z-index: 50; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }

nav.tabbar { display: none; }

@media (max-width: 1080px) {
  .hero, .cols, .loan-body, .setgrid { grid-template-columns: 1fr; }
  .hero { gap: 26px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stats > div:nth-child(3) { border-left: 0; }
  .stats > div:nth-child(n+3) { border-top: 1px solid var(--line); }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  aside.side { display: none; }
  main { padding: 16px 16px 110px; }
  .mobile-brand { display: flex; }
  .top { margin-bottom: 22px; }
  .top h1 { display: none; }
  .top .lang-d { padding: 8px 28px 8px 10px; font-size: 13px; background-position: right 10px center; }
  .top .btn.gold { padding: 9px 12px; font-size: 13px; }
  .page-title-m { display: block !important; font-family: var(--serif); font-size: 32px; font-weight: 600; margin: 0 0 18px; }
  .stake-head { grid-template-columns: 1fr; gap: 14px; }
  .grid2 { grid-template-columns: 1fr; }
  .legend { grid-template-columns: 1fr; }
  table.assets .c-price { display: none; }
  nav.tabbar { display: grid; grid-template-columns: repeat(6, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
               background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(12px); border-top: 1px solid var(--line);
               padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  nav.tabbar a { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px; color: var(--muted);
                 text-decoration: none; font-size: 11px; font-weight: 700; text-align: center; }
  nav.tabbar a svg { width: 21px; height: 21px; }
  nav.tabbar a[aria-current="page"] { color: var(--brass); }
}
@media (max-width: 440px) { .mobile-brand div { display: none; } .est-g b { font-size: 21px; } .hero-card { padding: 24px 22px; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* wallet picker + logout */
.wpick { position: fixed; inset: 0; z-index: 200; background: rgba(20, 10, 12, .38); display: grid; place-items: center; padding: 20px; backdrop-filter: blur(3px); }
.wpick-box { width: min(360px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 20px; box-shadow: 0 24px 60px rgba(0,0,0,.18);
             display: flex; flex-direction: column; gap: 8px; }
.wpick-box h3 { margin: 0 0 6px; font-size: 17px; }
.wpick-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: transparent;
              font: inherit; font-weight: 700; font-size: 15px; cursor: pointer; text-align: left; color: inherit; }
.wpick-item:hover, .wpick-item:focus-visible { border-color: var(--brass); background: color-mix(in srgb, var(--brass) 6%, transparent); outline: none; }
.wpick-item img, .wpick-dot { width: 28px; height: 28px; border-radius: 8px; flex: none; }
.wpick-dot { background: linear-gradient(135deg, var(--brass), var(--ruby)); }
.wpick-cancel { margin-top: 4px; border: 0; background: transparent; color: var(--muted); font: inherit; font-weight: 600; padding: 8px; cursor: pointer; }
.logout-top { white-space: nowrap; }
@media (max-width: 720px) { .logout-top { display: none; } }
