@font-face { font-family: easeStandard; src: url(/_next/static/i/media/ease_standard_regular-s.p.0ba1_8dt5_40n.woff2) format("woff2"); font-display: swap; font-weight: 400; }
@font-face { font-family: recklessStandard; src: url(/_next/static/i/media/reckless_standard_regular-s.p.397mtn8fd2-62.woff2) format("woff2"); font-display: swap; font-weight: 400; }

:root {
  --ink: #0e0e0e; --ink2: #3a3a3a; --mute: #8a8a8a; --line: #ececec; --soft: #f6f6f6; --bg: #fafafa; --card: #fff;
  --up: #16a34a; --down: #dc2626; --upbg: rgba(22,163,74,.08); --downbg: rgba(220,38,38,.08);
  --r: 14px;
  color-scheme: light;
}
* { box-sizing: border-box; margin: 0; }
html, body { background: var(--bg); color: var(--ink); }
body { font: 13px/1.4 easeStandard, -apple-system, "Segoe UI", Arial, sans-serif; font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; min-height: 100vh; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.up { color: var(--up); } .down { color: var(--down); } .muted { color: var(--mute); }

/* ---------------------------------------------------------------- top bar */
.tm-top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 18px; height: 60px; padding: 0 16px; background: rgba(255,255,255,.92); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.tm-logo { display: flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; font: 22px/1 recklessStandard, Georgia, serif; letter-spacing: -.02em; flex: none; }
.tm-logo img { width: 26px; height: 26px; object-fit: contain; }
.tm-mkt { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px 0 8px; border: 1px solid var(--line); border-radius: 10px; background: #fff; flex: none; transition: border-color .15s; }
.tm-mkt:hover, .tm-mkt.open { border-color: #cfcfcf; }
.tm-mkt b { font-weight: 400; font-size: 15px; }
.coin-ic { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--ink); color: #fff; font-style: normal; font-size: 11px; flex: none; }
.tag { padding: 2px 6px; border-radius: 6px; background: var(--soft); color: var(--ink2); font-size: 11px; }
.tm-stats { display: flex; gap: 22px; overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0; }
.tm-stats::-webkit-scrollbar { display: none; }
.tm-stats div { display: flex; flex-direction: column; gap: 1px; white-space: nowrap; }
.tm-stats span { color: var(--mute); font-size: 11px; }
.tm-stats b { font-weight: 400; font-size: 13px; }
.never { display: inline-flex; align-items: center; gap: 6px; font-weight: 400; color: var(--ink); }
.never i { width: 6px; height: 6px; border-radius: 50%; background: var(--up); box-shadow: 0 0 0 3px var(--upbg); }
.tm-acct { display: flex; gap: 8px; flex: none; }

.btn { height: 36px; padding: 0 14px; border-radius: 10px; white-space: nowrap; transition: background .15s, opacity .15s, border-color .15s; }
.btn.dark { background: var(--ink); color: #fff; }
.btn.dark:hover { background: #2a2a2a; }
.btn.ghost { border: 1px solid var(--line); background: #fff; }
.btn.ghost:hover { border-color: #cfcfcf; }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12px; border-radius: 8px; }
.btn:disabled { opacity: .55; cursor: default; }
.addr { display: inline-flex; align-items: center; gap: 8px; }
.addr i { width: 7px; height: 7px; border-radius: 50%; background: var(--up); }

/* ---------------------------------------------------------------- market picker */
.tm-picker { position: fixed; z-index: 40; top: 64px; left: 16px; width: min(640px, calc(100vw - 32px)); max-height: min(560px, calc(100vh - 90px)); display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: var(--r); box-shadow: 0 24px 60px -20px rgba(0,0,0,.18); overflow: hidden; }
.pk-head { display: flex; align-items: center; gap: 10px; padding: 12px; border-bottom: 1px solid var(--line); }
.pk-head input { flex: 1; height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; outline: none; background: var(--soft); }
.pk-head input:focus { border-color: #cfcfcf; background: #fff; }
.pk-head span { color: var(--mute); font-size: 12px; white-space: nowrap; }
.pk-cols, .pk-row { display: grid; grid-template-columns: 1.3fr 1fr .8fr 1fr .7fr; gap: 8px; padding: 0 14px; align-items: center; }
.pk-cols { height: 32px; color: var(--mute); font-size: 11px; border-bottom: 1px solid var(--line); }
.pk-cols span:not(:first-child), .pk-row span:not(:first-child) { text-align: right; }
.pk-list { overflow-y: auto; }
.pk-row { height: 40px; width: 100%; text-align: left; }
.pk-row:hover, .pk-row.on { background: var(--soft); }
.pk-row .nm { display: flex; align-items: center; gap: 8px; }
.pk-row .coin-ic { width: 20px; height: 20px; font-size: 10px; }

/* ---------------------------------------------------------------- layout */
.tm-grid { display: grid; gap: 8px; padding: 8px; grid-template-columns: minmax(0, 1fr) 290px 330px; grid-template-rows: 560px auto; grid-template-areas: "chart book ticket" "bottom bottom ticket"; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); min-width: 0; }
.tm-chart { grid-area: chart; display: flex; flex-direction: column; overflow: hidden; }
.tm-book { grid-area: book; display: flex; flex-direction: column; overflow: hidden; }
.tm-ticket { grid-area: ticket; padding: 14px; display: flex; flex-direction: column; gap: 14px; align-self: start; position: sticky; top: 68px; }
.tm-bottom { grid-area: bottom; min-height: 260px; overflow: hidden; }

.ch-bar { display: flex; align-items: center; gap: 2px; height: 42px; padding: 0 10px; border-bottom: 1px solid var(--line); }
.ch-bar button { height: 28px; padding: 0 10px; border-radius: 8px; color: var(--mute); }
.ch-bar button:hover { color: var(--ink); }
.ch-bar button.on { background: var(--soft); color: var(--ink); }
.ch-live { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; color: var(--mute); font-size: 12px; }
.ch-live i { width: 6px; height: 6px; border-radius: 50%; background: var(--up); animation: pulse 2s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.ch-box { flex: 1; min-height: 0; position: relative; }

.tabs { display: flex; gap: 2px; height: 42px; align-items: center; padding: 0 8px; border-bottom: 1px solid var(--line); flex: none; }
.tabs button { height: 28px; padding: 0 10px; border-radius: 8px; color: var(--mute); }
.tabs button.on { background: var(--soft); color: var(--ink); }
.tabs em { font-style: normal; color: var(--mute); }

/* book + trades */
.bk-cols, .bk-row, .tr-row { display: grid; grid-template-columns: 1fr 1fr 1fr; padding: 0 12px; }
.bk-cols { height: 28px; align-items: center; color: var(--mute); font-size: 11px; flex: none; }
.bk-cols span:not(:first-child), .bk-row span:not(:first-child), .tr-row span:not(:first-child) { text-align: right; }
.bk-cols em { font-style: normal; }
.bk, .tr { flex: 1; min-height: 0; overflow: hidden; font-size: 12px; }
.bk { display: flex; flex-direction: column; }
.bk-side { display: flex; flex-direction: column; flex: 1; min-height: 0; overflow: hidden; }
.bk-side.asks { justify-content: flex-end; }
.bk-row { position: relative; height: 21px; align-items: center; cursor: pointer; flex: none; }
.bk-row:hover { background: var(--soft); }
.bk-row .bar { position: absolute; top: 1px; bottom: 1px; right: 0; z-index: 0; }
.bk-row span { position: relative; z-index: 1; }
.asks .bk-row span:first-child { color: var(--down); } .asks .bar { background: var(--downbg); }
.bids .bk-row span:first-child { color: var(--up); } .bids .bar { background: var(--upbg); }
.bk-mid { display: flex; justify-content: space-between; align-items: center; height: 30px; padding: 0 12px; border-block: 1px solid var(--line); background: var(--bg); flex: none; }
.bk-mid b { font-weight: 400; font-size: 14px; }
.bk-mid span { color: var(--mute); font-size: 11px; }
.tr { overflow-y: auto; padding-top: 4px; }
.tr-row { height: 21px; align-items: center; }

/* ---------------------------------------------------------------- ticket */
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--soft); border-radius: 12px; }
.seg button { height: 32px; border-radius: 9px; color: var(--mute); transition: background .15s, color .15s; }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.seg.side button { height: 38px; }
.seg.side button.long.on { background: var(--up); color: #fff; }
.seg.side button.short.on { background: var(--down); color: #fff; }
.fld { display: flex; flex-direction: column; gap: 8px; }
.fld-h { display: flex; justify-content: space-between; align-items: center; }
.fld-h label { color: var(--ink2); }
.fld-h b { font-weight: 400; font-size: 15px; }
.link { color: var(--ink2); text-decoration: underline; text-underline-offset: 3px; font-size: 12px; }
.chips { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.chips button { height: 28px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink2); font-size: 12px; }
.chips button.on { border-color: var(--ink); color: var(--ink); background: var(--soft); }
.chips button:disabled { opacity: .35; cursor: default; }
.in { display: flex; align-items: center; height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; transition: border-color .15s; }
.in:focus-within { border-color: var(--ink); }
.in input { flex: 1; min-width: 0; border: 0; outline: none; background: none; font-size: 15px; }
.in span { color: var(--mute); }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 18px; background: none; }
input[type=range]::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: linear-gradient(var(--ink), var(--ink)) 0 / var(--p, 0%) 100% no-repeat, var(--line); }
input[type=range]::-moz-range-track { height: 4px; border-radius: 4px; background: var(--line); }
input[type=range]::-moz-range-progress { height: 4px; border-radius: 4px; background: var(--ink); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; margin-top: -6px; border-radius: 50%; background: #fff; border: 2px solid var(--ink); }
input[type=range]::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 2px solid var(--ink); }
.pct-l { display: flex; justify-content: space-between; color: var(--mute); font-size: 11px; margin-top: -4px; }
.chk { display: flex; align-items: center; gap: 8px; color: var(--ink2); cursor: pointer; user-select: none; }
.chk input { width: 15px; height: 15px; accent-color: var(--ink); }
.sum { display: flex; flex-direction: column; gap: 7px; padding: 12px; border-radius: 12px; background: var(--bg); }
.sum div, .acct > div:not(.acct-h):not(.acct-b) { display: flex; justify-content: space-between; }
.sum span, .acct span { color: var(--mute); }
.sum b, .acct b { font-weight: 400; }
.btn.place { height: 46px; border-radius: 12px; font-size: 15px; color: #fff; background: var(--ink); }
.btn.place.long.ready { background: var(--up); }
.btn.place.short.ready { background: var(--down); }
.btn.place:hover:not(:disabled) { opacity: .92; }
.fine { color: var(--mute); font-size: 11.5px; text-align: center; margin-top: -6px; }
.acct { display: flex; flex-direction: column; gap: 7px; padding-top: 14px; border-top: 1px solid var(--line); }
.acct-h { font: 18px/1.2 recklessStandard, Georgia, serif; margin-bottom: 2px; }
.acct-b { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 4px; }

/* ---------------------------------------------------------------- bottom tables */
.tbl { overflow-x: auto; }
.tbl table { width: 100%; border-collapse: collapse; white-space: nowrap; }
.tbl th { height: 34px; padding: 0 12px; text-align: left; color: var(--mute); font-weight: 400; font-size: 11px; border-bottom: 1px solid var(--line); }
.tbl td { height: 42px; padding: 0 12px; border-bottom: 1px solid #f4f4f4; }
.tbl th.r, .tbl td.r { text-align: right; }
.tbl .mk { display: inline-flex; align-items: center; gap: 8px; }
.tbl .mk .coin-ic { width: 20px; height: 20px; font-size: 10px; }
.tbl .empty { height: 180px; text-align: center; color: var(--mute); border: 0; }
.tbl .empty .btn { margin-top: 12px; }
.pill { padding: 2px 7px; border-radius: 6px; font-size: 11px; }
.pill.long { color: var(--up); background: var(--upbg); }
.pill.short { color: var(--down); background: var(--downbg); }

/* ---------------------------------------------------------------- modal + toast */
.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; background: rgba(14,14,14,.32); backdrop-filter: blur(3px); }
.mdl { position: relative; width: min(420px, 100%); padding: 24px; border-radius: 18px; background: #fff; box-shadow: 0 30px 80px -20px rgba(0,0,0,.35); display: flex; flex-direction: column; gap: 14px; }
.mdl h3 { font: 26px/1.15 recklessStandard, Georgia, serif; font-weight: 400; letter-spacing: -.01em; }
.mdl p { color: var(--ink2); }
.mdl .row { display: flex; justify-content: space-between; color: var(--mute); }
.mdl .row b { color: var(--ink); font-weight: 400; }
.mdl .btn { height: 44px; border-radius: 12px; }
.mdl .x { position: absolute; top: 14px; right: 14px; width: 30px; height: 30px; border-radius: 8px; font-size: 20px; color: var(--mute); }
.mdl .x:hover { background: var(--soft); color: var(--ink); }
.wallets { display: flex; flex-direction: column; gap: 6px; }
.wallets button { display: flex; align-items: center; gap: 12px; height: 50px; padding: 0 14px; border: 1px solid var(--line); border-radius: 12px; text-align: left; }
.wallets button:hover { border-color: var(--ink); }
.wallets img { width: 26px; height: 26px; border-radius: 6px; }
.steps { display: flex; flex-direction: column; gap: 8px; counter-reset: s; }
.steps div { display: flex; gap: 10px; color: var(--ink2); }
.steps div::before { counter-increment: s; content: counter(s); flex: none; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--soft); font-size: 11px; }
.toast { position: fixed; z-index: 70; left: 50%; bottom: 24px; transform: translate(-50%, 20px); max-width: min(520px, calc(100vw - 32px)); padding: 12px 16px; border-radius: 12px; background: var(--ink); color: #fff; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: #b91c1c; }
.spin { display: inline-block; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: rot .7s linear infinite; vertical-align: -2px; margin-right: 8px; }
@keyframes rot { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1180px) {
  .tm-grid { grid-template-columns: minmax(0, 1fr) 330px; grid-template-rows: 480px 380px auto; grid-template-areas: "chart ticket" "book ticket" "bottom bottom"; }
}
@media (max-width: 760px) {
  .tm-top { height: auto; flex-wrap: wrap; gap: 10px; padding: 10px 16px; }
  .tm-logo span { display: none; }
  .tm-acct { margin-left: auto; }
  .tm-acct #depBtn { display: none; }
  .tm-stats { order: 5; flex-basis: 100%; gap: 16px; }
  .tm-picker { top: 108px; }
  .tm-grid { grid-template-columns: minmax(0, 1fr); grid-template-rows: 380px auto 360px auto; grid-template-areas: "chart" "ticket" "book" "bottom"; padding: 8px 8px 24px; }
  .tm-ticket { position: static; }
  .ch-live { display: none; }
  .pk-cols, .pk-row { grid-template-columns: 1.3fr 1fr .8fr .6fr; }
  .pk-cols span:nth-child(4), .pk-row span:nth-child(4) { display: none; }
}
