/* ============================================================
   LSCX — Los Santos Crypto Exchange
   팔레트: 잉크 네이비 배경 / 골드 포인트 / 한국식 상승 빨강·하락 파랑
   ============================================================ */
@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.min.css');
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root {
  --bg: #0B0F17;
  --panel: #121826;
  --panel-2: #171F30;
  --line: #232C41;
  --text: #E9EDF5;
  --muted: #8B95AB;
  --gold: #F2B441;
  --gold-dim: #A87F2E;
  --up: #F04452;      /* 상승 = 빨강 (국내 관례) */
  --down: #3182F6;    /* 하락 = 파랑 */
  --radius: 12px;
  --font: "Pretendard", -apple-system, "Malgun Gothic", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { color-scheme: dark; }
body {
  background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: 15px; line-height: 1.55;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.up { color: var(--up); } .down { color: var(--down); } .flat { color: var(--muted); }
.gold { color: var(--gold); }
.muted { color: var(--muted); }

/* ---------- 네비게이션 ---------- */
#nav { border-bottom: 1px solid var(--line); background: rgba(11,15,23,.92); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 50; }
.nav-inner { max-width: 1180px; margin: 0 auto; padding: 0 20px; height: 60px; display: flex; align-items: center; gap: 28px; }
.brand { font-family: var(--mono); font-weight: 600; font-size: 19px; letter-spacing: .5px; display: flex; align-items: baseline; gap: 8px; }
.brand-mark { background: var(--gold); color: #10131B; padding: 1px 6px; border-radius: 5px; font-size: 15px; }
.brand-sub { font-family: var(--font); font-size: 11px; color: var(--muted); font-weight: 400; letter-spacing: .3px; }
.nav-links { display: flex; gap: 4px; flex: 1; }
.nav-links a { padding: 8px 14px; border-radius: 8px; color: var(--muted); font-weight: 500; }
.nav-links a:hover { color: var(--text); background: var(--panel); }
.nav-links a.on { color: var(--gold); background: rgba(242,180,65,.08); }
.nav-right { display: flex; align-items: center; gap: 12px; }
.nav-user { color: var(--muted); font-size: 13px; }
.admin-link { color: var(--gold); margin-left: 6px; font-size: 12px; border: 1px solid var(--gold-dim); padding: 2px 7px; border-radius: 6px; }

/* ---------- 시세 티커 ---------- */
#ticker { border-bottom: 1px solid var(--line); background: #0D1220; overflow: hidden; height: 34px; display: flex; align-items: center; }
.tick-track { display: flex; gap: 34px; white-space: nowrap; animation: tick 40s linear infinite; padding-left: 20px; }
@keyframes tick { to { transform: translateX(-50%); } }
.tick-item { display: inline-flex; gap: 8px; font-size: 12.5px; align-items: center; }
.tick-item b { color: var(--muted); font-weight: 600; }
@media (prefers-reduced-motion: reduce) { .tick-track { animation: none; } }

/* ---------- 레이아웃 ---------- */
.wrap { max-width: 1180px; margin: 0 auto; padding: 28px 20px 80px; }
.page-title { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.page-desc { color: var(--muted); font-size: 14px; margin-bottom: 24px; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.panel + .panel { margin-top: 16px; }
.panel h3 { font-size: 15px; font-weight: 600; margin-bottom: 14px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-side { display: grid; grid-template-columns: 1fr 340px; gap: 16px; align-items: start; }
@media (max-width: 900px) { .grid-2, .grid-side { grid-template-columns: 1fr; } }

/* ---------- 버튼/폼 ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: none; cursor: pointer; border-radius: 9px; font-family: var(--font); font-weight: 600; font-size: 14px; padding: 11px 18px; transition: filter .15s, background .15s; }
.btn:hover { filter: brightness(1.1); }
.btn.primary { background: var(--gold); color: #10131B; }
.btn.ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.btn.ghost:hover { color: var(--text); }
.btn.buy { background: var(--up); color: #fff; }
.btn.sell { background: var(--down); color: #fff; }
.btn.sm { padding: 7px 13px; font-size: 13px; }
.btn.full { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; background: var(--panel-2); border: 1px solid var(--line); border-radius: 9px;
  color: var(--text); padding: 11px 13px; font-size: 14px; font-family: var(--font);
}
.field input:focus, .field textarea:focus, .field select:focus { outline: 2px solid var(--gold-dim); outline-offset: 0; border-color: transparent; }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 5px; }
.form-msg { font-size: 13px; margin-top: 10px; min-height: 18px; }
.form-msg.err { color: var(--up); }
.form-msg.ok { color: #4ADE80; }

/* ---------- 테이블 ---------- */
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; color: var(--muted); font-weight: 500; font-size: 12px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
td { padding: 11px 10px; border-bottom: 1px solid rgba(35,44,65,.55); }
tr:last-child td { border-bottom: none; }
tbody tr.click { cursor: pointer; }
tbody tr.click:hover { background: var(--panel-2); }
.t-right { text-align: right; }
.empty { color: var(--muted); text-align: center; padding: 34px 0; font-size: 13.5px; }

.badge { font-size: 11.5px; padding: 3px 9px; border-radius: 999px; font-weight: 600; }
.badge.wait { background: rgba(242,180,65,.14); color: var(--gold); }
.badge.okay { background: rgba(74,222,128,.13); color: #4ADE80; }
.badge.deny { background: rgba(240,68,82,.13); color: var(--up); }

/* ---------- 랜딩 ---------- */
.hero { padding: 84px 0 60px; text-align: left; max-width: 760px; }
.hero .eyebrow { font-family: var(--mono); font-size: 12px; letter-spacing: 2px; color: var(--gold); margin-bottom: 18px; }
.hero h1 { font-size: 44px; line-height: 1.2; font-weight: 800; letter-spacing: -.5px; }
.hero h1 .accent { color: var(--gold); }
.hero p { color: var(--muted); font-size: 16px; margin: 18px 0 30px; max-width: 560px; }
.hero .cta { display: flex; gap: 10px; }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 56px; }
@media (max-width: 900px) { .steps { grid-template-columns: 1fr 1fr; } .hero h1 { font-size: 32px; } }
.step { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.step .n { font-family: var(--mono); color: var(--gold); font-size: 12px; margin-bottom: 8px; }
.step b { display: block; font-size: 14.5px; margin-bottom: 5px; }
.step span { color: var(--muted); font-size: 13px; }

/* ---------- 거래소 ---------- */
.coin-list td:first-child { font-weight: 600; }
.coin-sub { color: var(--muted); font-size: 11.5px; font-weight: 400; }
.trade-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 12px; flex-wrap: wrap; }
.trade-head .sym { font-size: 20px; font-weight: 700; }
.trade-head .price { font-size: 26px; font-weight: 600; }
.chart-box { height: 260px; }
.chart-box canvas { width: 100%; height: 100%; display: block; }
.side-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 16px; }
.side-tabs button { padding: 10px; border-radius: 9px; border: 1px solid var(--line); background: var(--panel-2); color: var(--muted); font-weight: 600; cursor: pointer; }
.side-tabs button.on-buy { background: rgba(240,68,82,.12); color: var(--up); border-color: rgba(240,68,82,.4); }
.side-tabs button.on-sell { background: rgba(49,130,246,.12); color: var(--down); border-color: rgba(49,130,246,.4); }
.qbtns { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 14px; }
.qbtns button { padding: 7px 0; font-size: 12px; border-radius: 7px; border: 1px solid var(--line); background: var(--panel-2); color: var(--muted); cursor: pointer; }
.qbtns button:hover { color: var(--text); }
.order-summary { display: flex; justify-content: space-between; font-size: 13.5px; color: var(--muted); padding: 10px 0 14px; }
.order-summary b { color: var(--text); }

/* ---------- 지갑/포트폴리오 ---------- */
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 16px; }
@media (max-width: 700px) { .stat-row { grid-template-columns: 1fr; } }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.stat .k { font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.stat .v { font-size: 21px; font-weight: 700; }
.notice { background: rgba(242,180,65,.07); border: 1px solid rgba(242,180,65,.25); border-radius: var(--radius); padding: 14px 16px; font-size: 13.5px; color: #E8D5A8; margin-bottom: 16px; }
.notice b { color: var(--gold); }

/* ---------- 인증 페이지 ---------- */
.auth-wrap { max-width: 420px; margin: 60px auto; padding: 0 20px; }
.auth-wrap .panel { padding: 30px; }
.auth-title { font-size: 20px; font-weight: 700; margin-bottom: 22px; }
.auth-foot { text-align: center; margin-top: 18px; font-size: 13.5px; color: var(--muted); }
.auth-foot a { color: var(--gold); }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin-bottom: 16px; }
.check input { width: auto; }

/* ---------- 토스트 ---------- */
#toast { position: fixed; bottom: 28px; left: 50%; transform: translate(-50%, 20px); background: var(--panel-2); border: 1px solid var(--line); padding: 12px 20px; border-radius: 10px; font-size: 14px; opacity: 0; pointer-events: none; transition: all .25s; z-index: 100; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.ok { border-color: rgba(74,222,128,.4); }
#toast.err { border-color: rgba(240,68,82,.5); }

footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 12.5px; text-align: center; padding: 26px 20px; }

/* ---------- 선물 ---------- */
.lev-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; }
.lev-row label { font-size: 13px; color: var(--muted); }
.lev-val { font-family: var(--mono); font-size: 22px; font-weight: 600; color: var(--gold); }
input[type=range].lev { width: 100%; accent-color: var(--gold); margin: 6px 0 10px; }
.lev-presets { display: flex; gap: 6px; margin-bottom: 16px; }
.lev-presets button { flex: 1; padding: 6px 0; font-size: 12px; font-family: var(--mono); border-radius: 7px; border: 1px solid var(--line); background: var(--panel-2); color: var(--muted); cursor: pointer; }
.lev-presets button:hover { color: var(--text); }
.lev-presets button.on { color: var(--gold); border-color: var(--gold-dim); background: rgba(242,180,65,.08); }
.est { border-top: 1px solid var(--line); padding-top: 12px; margin-bottom: 14px; }
.est div { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); padding: 3px 0; }
.est b { color: var(--text); font-weight: 500; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.est .liq-line b { color: var(--gold); }
.risk { font-size: 12px; color: var(--muted); margin-top: 10px; line-height: 1.6; }
.risk.hot { color: var(--up); }
.pos-side { font-weight: 700; }
.pos-side.long { color: var(--up); }
.pos-side.short { color: var(--down); }
.lev-tag { font-family: var(--mono); font-size: 11px; border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; margin-left: 5px; color: var(--muted); font-weight: 500; }
.table-scroll { overflow-x: auto; }
.table-scroll table { min-width: 720px; }
.badge.liq { background: rgba(240,68,82,.13); color: var(--up); }
.badge.closed { background: rgba(139,149,171,.14); color: var(--muted); }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 14px; }
.panel-head h3 { margin-bottom: 0; }
.panel-head .muted { font-size: 13px; }
.stat-row.four { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .stat-row.four { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .stat-row.four { grid-template-columns: 1fr; } }
.stat .s { font-size: 12.5px; margin-top: 4px; font-family: var(--mono); }

/* ---------- 모바일 내비게이션 ---------- */
@media (max-width: 760px) {
  .nav-inner { height: auto; flex-wrap: wrap; gap: 6px 12px; padding: 10px 16px; }
  .brand-sub { display: none; }
  .nav-right { margin-left: auto; gap: 8px; }
  .nav-links { order: 3; flex-basis: 100%; overflow-x: auto; }
  .nav-links a { white-space: nowrap; padding: 6px 12px; }
  .wrap { padding: 20px 16px 60px; }
}
.grid-side + .panel { margin-top: 16px; }

/* ---------- 차트 종류 토글 ---------- */
.chart-toggle { margin-left: auto; display: inline-flex; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 2px; }
.chart-toggle button { border: none; background: transparent; color: var(--muted); font-family: var(--font); font-size: 12.5px; font-weight: 600; padding: 5px 11px; border-radius: 6px; cursor: pointer; }
.chart-toggle button:hover { color: var(--text); }
.chart-toggle button.on { background: rgba(242,180,65,.12); color: var(--gold); }
.chart-toggle .tf { font-family: var(--mono); font-size: 10.5px; opacity: .75; margin-left: 2px; }

/* ---------- 익절/손절 · 부분 종료 ---------- */
.tpsl-box { border: 1px solid var(--line); border-radius: 10px; padding: 0 14px; margin-bottom: 14px; background: rgba(23,31,48,.5); }
.tpsl-box summary { cursor: pointer; font-size: 13.5px; font-weight: 600; padding: 12px 0; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.tpsl-box summary::-webkit-details-marker { display: none; }
.tpsl-box summary::after { content: "＋"; color: var(--muted); font-weight: 400; }
.tpsl-box[open] summary::after { content: "－"; }
.tpsl-box summary .muted { font-size: 11.5px; font-weight: 400; margin-left: auto; }
.tpsl-box[open] { padding-bottom: 12px; }
.chips, .pct-chips { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.chips button, .pct-chips button { flex: 1; min-width: 48px; padding: 6px 0; font-size: 12px; font-family: var(--mono); border-radius: 7px; border: 1px solid var(--line); background: var(--panel-2); color: var(--muted); cursor: pointer; }
.chips button:hover, .pct-chips button:hover { color: var(--text); }
.pct-chips button.on { color: var(--gold); border-color: var(--gold-dim); background: rgba(242,180,65,.08); }
.trig { font-family: var(--mono); font-size: 12px; white-space: nowrap; line-height: 1.7; }
.trig span { color: var(--muted); margin-left: 5px; font-size: 11px; }
.badge.tp { background: rgba(74,222,128,.13); color: #4ADE80; }
.badge.sl { background: rgba(167,139,250,.15); color: #B4A5FB; }

dialog.modal { margin: auto; background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 14px; padding: 0; width: min(460px, calc(100vw - 24px)); max-height: calc(100vh - 32px); box-shadow: 0 24px 60px rgba(0,0,0,.5); }
dialog.modal::backdrop { background: rgba(5,8,14,.72); }
.modal-body { padding: 22px; }
.modal-title { font-size: 17px; font-weight: 700; margin-bottom: 14px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.modal-title .pos-side { font-size: 13px; padding: 3px 9px; border-radius: 6px; background: var(--panel-2); }
.kv { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); padding: 3px 0; }
.kv b { color: var(--text); font-weight: 500; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }
.modal-actions .btn { min-width: 96px; }
.tpsl-sec { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 14px; }
.tpsl-sec .sec-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-size: 13.5px; font-weight: 700; }
.tpsl-sec input { width: 100%; background: var(--panel-2); border: 1px solid var(--line); border-radius: 9px; color: var(--text); padding: 10px 12px; font-size: 14px; font-family: var(--mono); }
.tpsl-sec input:focus { outline: 2px solid var(--gold-dim); border-color: transparent; }
.sub-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; font-size: 12.5px; color: var(--muted); }
.sub-row .pct-chips { margin-top: 0; flex: 0 1 220px; }
.est-line { font-size: 12.5px; margin-top: 8px; font-family: var(--mono); color: var(--muted); }
button.link { background: none; border: none; color: var(--muted); font-size: 12px; cursor: pointer; text-decoration: underline; font-family: var(--font); }
button.link:hover { color: var(--text); }
.pct-chips { flex-wrap: nowrap; }
.pct-chips button { min-width: 0; }
.modal-body > .hint { margin-top: 14px; }
@media (max-width: 520px) {
  .modal-body { padding: 18px; }
  .sub-row { flex-direction: column; align-items: stretch; gap: 6px; }
  .sub-row .pct-chips { flex: none; }
}
.mark-tag { font-size: 12.5px; color: var(--muted); }

/* ---------- v5: 지갑·마진 모드·지정가 ---------- */
.nav-wallets { display: inline-flex; align-items: stretch; border: 1px solid var(--line); border-radius: 9px; background: var(--panel-2); overflow: hidden; text-decoration: none; }
.nav-wallets:hover { border-color: var(--gold-dim); }
.nav-wallets .nw { display: inline-flex; align-items: baseline; gap: 6px; padding: 6px 11px; white-space: nowrap; }
.nav-wallets .nw + .nw { border-left: 1px solid var(--line); }
.nav-wallets em { font-style: normal; font-size: 11.5px; color: var(--muted); }
.nav-wallets b { font-size: 13.5px; font-weight: 600; color: var(--gold); }
@media (max-width: 760px) {
  .nav-wallets .nw { padding: 5px 8px; gap: 4px; }
  .nav-wallets b { font-size: 12.5px; }
}
@media (max-width: 420px) { .nav-user { display: none; } }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 9px; padding: 3px; margin-bottom: 12px; }
.seg button { border: none; background: transparent; color: var(--muted); font-family: var(--font); font-size: 13px; font-weight: 600; padding: 7px 0; border-radius: 7px; cursor: pointer; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--panel); color: var(--gold); box-shadow: 0 0 0 1px var(--gold-dim) inset; }
.mode-tag { font-size: 10.5px; padding: 1px 6px; border-radius: 5px; margin-left: 5px; font-weight: 600; }
.mode-tag.iso { background: rgba(139,149,171,.14); color: var(--muted); }
.mode-tag.cross { background: rgba(242,180,65,.12); color: var(--gold); }
.lev-limit { font-size: 12px; color: var(--muted); margin: -4px 0 12px; }
.lev-limit.warn { color: var(--up); }
.fee-note { font-size: 11.5px; color: var(--muted); }
.acct { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 14px; }
.acct-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.acct-head b { font-size: 13.5px; }
.ratio-bar { height: 5px; border-radius: 3px; background: var(--panel-2); overflow: hidden; margin: 4px 0 2px; }
.ratio-bar i { display: block; height: 100%; background: #4ADE80; transition: width .3s; }
.ratio-bar i.mid { background: var(--gold); }
.ratio-bar i.hot { background: var(--up); }
.fund-tag { font-size: 12px; color: var(--muted); white-space: nowrap; }
.fund-tag b { font-weight: 500; font-family: var(--mono); }
.margin-cell { white-space: nowrap; }
.margin-cell .adj { margin-left: 6px; padding: 1px 7px; font-size: 12px; border-radius: 6px; border: 1px solid var(--line); background: var(--panel-2); color: var(--muted); cursor: pointer; }
.margin-cell .adj:hover { color: var(--gold); border-color: var(--gold-dim); }
.xfer-route { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; background: var(--panel-2); border-radius: 10px; padding: 12px 14px; margin-bottom: 12px; }
.xfer-route div { display: flex; flex-direction: column; gap: 2px; font-size: 12px; }
.xfer-route div b { font-size: 14px; }
.xfer-route div:last-child { text-align: right; }
.liq-move { font-family: var(--mono); }
.sub-tabs { display: flex; gap: 6px; margin-bottom: 10px; }
.sub-tabs button { flex: 1; padding: 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel-2); color: var(--muted); font-weight: 600; cursor: pointer; font-family: var(--font); }
.sub-tabs button.on { color: var(--gold); border-color: var(--gold-dim); background: rgba(242,180,65,.08); }

/* ---------- 선물 하단 탭 ---------- */
.tabs-panel { padding-top: 6px; }
.tabbar { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 0 -22px 14px; padding: 0 14px; overflow-x: auto; scrollbar-width: none; }
.tabbar::-webkit-scrollbar { display: none; }
.tabbar button { position: relative; flex: none; background: none; border: none; color: var(--muted); font-family: var(--font); font-size: 14px; font-weight: 600; padding: 12px 12px 11px; cursor: pointer; white-space: nowrap; }
.tabbar button:hover { color: var(--text); }
.tabbar button.on { color: var(--text); }
.tabbar button.on::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--gold); }
.tabbar button:focus-visible { outline: 2px solid var(--gold-dim); outline-offset: -2px; border-radius: 6px; }
.tabbar .cnt { display: inline-block; min-width: 18px; margin-left: 6px; padding: 0 5px; border-radius: 9px; background: rgba(242,180,65,.14); color: var(--gold); font-family: var(--mono); font-size: 11px; line-height: 18px; text-align: center; }
.tabbar .cnt.empty { display: none; }
.pane-note { font-size: 12.5px; color: var(--muted); margin-bottom: 6px; min-height: 0; }
.pane-note:empty { display: none; }
@media (max-width: 520px) { .tabbar { margin: 0 -18px 12px; padding: 0 8px; } .tabbar button { font-size: 13px; padding: 11px 9px 10px; } }
.grid-side > * { min-width: 0; }
@media (max-width: 520px) { .coin-list .col-fund { display: none; } }
.tabs-panel td:not(.empty) { white-space: nowrap; }
@media (max-width: 520px) {
  .tabbar { -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
}

/* ---------- 마켓 목록: 검색·정렬·스크롤 ---------- */
.mkt-panel h3 { margin-bottom: 12px; }
.mkt-tools { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.mkt-search { flex: 1 1 180px; position: relative; }
.mkt-search input { width: 100%; background: var(--panel-2); border: 1px solid var(--line); border-radius: 9px; color: var(--text);
  padding: 9px 12px 9px 32px; font-size: 13.5px; font-family: var(--font); }
.mkt-search::before { content: ""; position: absolute; left: 11px; top: 50%; width: 11px; height: 11px; margin-top: -7px;
  border: 1.6px solid var(--muted); border-radius: 50%; }
.mkt-search::after { content: ""; position: absolute; left: 21px; top: 50%; width: 5px; height: 1.6px; margin-top: 3px;
  background: var(--muted); transform: rotate(45deg); }
.mkt-search input:focus { outline: 2px solid var(--gold-dim); border-color: transparent; }
.mkt-sort { margin-bottom: 0; flex: 0 0 auto; }
.mkt-sort button { padding: 7px 11px; font-size: 12.5px; }
.mkt-scroll { max-height: 480px; overflow-y: auto; margin: 0 -8px; padding: 0 8px; scrollbar-width: thin; }
.mkt-scroll thead th { position: sticky; top: 0; background: var(--panel); z-index: 1; }
.mkt-sort-head { cursor: pointer; user-select: none; }
.mkt-sort-head:hover { color: var(--text); }
.coin-list tr.sel { background: var(--panel-2); }
.coin-list tr.sel td:first-child { box-shadow: inset 2px 0 0 var(--gold); }
.mkt-empty { color: var(--muted); text-align: center; padding: 28px 0; font-size: 13.5px; }
@media (max-width: 520px) { .mkt-sort { width: 100%; } .mkt-scroll { max-height: 380px; } }

/* ---------- 차트 간격 선택 ---------- */
.chart-toggle { flex-wrap: wrap; }
.chart-toggle button { padding: 5px 9px; }
.chart-toggle .tf-sep { width: 1px; align-self: stretch; margin: 4px 3px; background: var(--line); }
@media (max-width: 520px) {
  .chart-toggle { margin-left: 0; width: 100%; justify-content: space-between; }
  .chart-toggle button { padding: 5px 6px; font-size: 12px; }
}

/* 2열 배치 안 패널은 위아래 여백을 맞추고, 아래 패널과 간격 확보 */
.grid-2 > .panel + .panel { margin-top: 0; }
.grid-2 + .panel, .grid-side + .panel { margin-top: 16px; }
.table-scroll table { min-width: 560px; }
.tabs-panel .table-scroll table { min-width: 720px; }

/* ---------- 지갑 페이지 ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wallets { display: grid; grid-template-columns: 1fr minmax(260px, 300px) 1fr; gap: 16px; margin-bottom: 16px; align-items: stretch; }
.wallets > .panel + .panel { margin-top: 0; }
.wallet-card { display: flex; flex-direction: column; transition: box-shadow .2s, border-color .2s; }
.wallet-card.xf-src { border-color: var(--gold-dim); box-shadow: 0 0 0 1px rgba(242,180,65,.18) inset; }
.wc-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.wc-name { font-size: 13.5px; font-weight: 700; color: var(--muted); letter-spacing: .2px; }
.wc-link { font-size: 12.5px; color: var(--gold); }
.wc-link:hover { text-decoration: underline; }
.wc-balance { font-size: 30px; font-weight: 600; letter-spacing: -.5px; margin-bottom: 14px; }
.wc-rows { border-top: 1px solid var(--line); padding-top: 10px; }
.wc-rows div { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--muted); padding: 4px 0; }
.wc-rows b { color: var(--text); font-weight: 500; }
.wc-rows em { font-style: normal; font-size: 11px; color: #5E687D; margin-left: 4px; }
.xfer-card { background: var(--panel-2); }
.xfer-card .field input { background: var(--panel); }
.xf-route { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; margin: 4px 0 14px; }
.xf-end { text-align: center; font-weight: 700; font-size: 15px; padding: 9px 0; border-radius: 9px; background: var(--panel); border: 1px solid var(--line); }
.xf-swap { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--gold-dim); background: rgba(242,180,65,.08); color: var(--gold); cursor: pointer; font-size: 18px; display: grid; place-items: center; }
.xf-swap:hover { background: rgba(242,180,65,.16); }
.xf-swap:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.xf-arrow { display: inline-block; transition: transform .25s; }
.xf-arrow.rev { transform: rotate(180deg); }
@media (prefers-reduced-motion: reduce) { .xf-arrow { transition: none; } }
@media (max-width: 900px) {
  .wallets { grid-template-columns: 1fr 1fr; }
  .xfer-card { grid-column: 1 / -1; order: 3; }
}
@media (max-width: 600px) {
  .wallets { grid-template-columns: 1fr; }
  .xfer-card { order: 0; }
  .wc-balance { font-size: 26px; }
}

/* ---------- 금액·비율 슬라이더 ---------- */
.amt-slider { --p: 0; display: flex; align-items: center; gap: 12px; margin: -4px 0 14px; }
.as-wrap { position: relative; flex: 1; height: 26px; }
.as-track { position: absolute; left: 8px; right: 8px; top: 50%; height: 4px; margin-top: -2px; border-radius: 2px;
  background: linear-gradient(to right, var(--gold) calc(var(--p) * 1%), var(--line) calc(var(--p) * 1%)); }
.as-marks { position: absolute; left: 8px; right: 8px; top: 50%; pointer-events: none; }
.as-marks i { position: absolute; left: calc(var(--m) * 1%); top: 0; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px;
  transform: rotate(45deg); background: var(--panel); border: 2px solid var(--line); border-radius: 2px; }
.as-marks i.on { background: var(--gold); border-color: var(--gold); }
.as-range { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; background: transparent; -webkit-appearance: none; appearance: none; cursor: pointer; }
.as-range::-webkit-slider-runnable-track { background: transparent; height: 26px; }
.as-range::-moz-range-track { background: transparent; height: 26px; }
.as-range::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; margin-top: 5px; border-radius: 4px; transform: rotate(45deg);
  background: var(--panel); border: 3px solid var(--gold); box-shadow: 0 0 0 3px rgba(242,180,65,.12); }
.as-range::-moz-range-thumb { width: 10px; height: 10px; border-radius: 3px; transform: rotate(45deg);
  background: var(--panel); border: 3px solid var(--gold); box-shadow: 0 0 0 3px rgba(242,180,65,.12); }
.as-range:focus-visible { outline: none; }
.as-range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px rgba(242,180,65,.35); }
.as-pct { min-width: 44px; text-align: right; font-size: 12.5px; color: var(--muted); }
.amt-slider.over .as-pct { color: var(--up); font-weight: 600; }
.amt-slider.empty { opacity: .45; }
.modal .amt-slider, dialog .amt-slider { margin-top: 2px; }
.trig-row .trig-slot { flex: 0 1 260px; }
.trig-row .amt-slider { margin: 0; }
@media (max-width: 520px) { .trig-row .trig-slot { flex: none; } }
.amt-slider input.as-range { background: transparent; border: 0; padding: 0; border-radius: 0; box-shadow: none; height: 100%; width: 100%; font: inherit; }
.amt-slider input.as-range:focus { outline: none; border: 0; }

/* ---------- 관리자: 거래소 손익 ---------- */
.stat.hl { border-color: var(--gold-dim); }
.sub-h { font-size: 13px; color: var(--muted); font-weight: 600; margin: 18px 0 10px; }
.ledger-box { display: grid; grid-template-columns: 1fr auto 1.2fr auto 1fr; gap: 12px; align-items: start; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.lg-h { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--muted); font-weight: 600; padding-bottom: 8px; margin-bottom: 6px; border-bottom: 1px solid var(--line); }
.lg-h b { color: var(--text); }
.lg-col > div:not(.lg-h) { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; color: var(--muted); padding: 3px 0; }
.lg-col > div b { color: var(--text); font-weight: 500; }
.lg-col > div b.up { color: var(--up); } .lg-col > div b.down { color: var(--down); }
.lg-op { font-size: 20px; color: var(--muted); align-self: center; }
@media (max-width: 900px) { .ledger-box { grid-template-columns: 1fr; } .lg-op { text-align: center; padding: 0; line-height: 1; } }
.nav-pnl { font-style: normal; font-size: 11.5px; margin-left: 2px; }
@media (max-width: 760px) { .nav-pnl { display: none; } }
.acct-total { padding-bottom: 8px !important; margin-bottom: 4px; border-bottom: 1px dashed var(--line); }
.acct-total span { color: var(--text) !important; font-weight: 600; }
.acct-total b { font-size: 16px; }
.acct-total i { font-style: normal; font-size: 12px; font-weight: 500; }

/* ---------- 포지션 PIP 창 ---------- */
.pos-tools { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; min-height: 30px; }
.pos-tools .pane-note { margin: 0; }
.pip-btn { flex: none; }
@media (max-width: 760px) { .pip-btn { display: none; } }          /* 휴대폰에서는 PIP 불가 */
body.pip-body { margin: 0; background: var(--bg); min-height: 100vh; }
.pip { padding: 10px 12px; font-size: 13px; }
.pip-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding-bottom: 8px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.pip-brand { font-weight: 700; color: var(--gold); font-size: 12.5px; }
.pip-eq { display: inline-flex; align-items: baseline; gap: 6px; }
.pip-eq em { font-style: normal; font-size: 11px; color: var(--muted); }
.pip-eq b { font-size: 15px; color: var(--gold); }
.pip-eq i { font-style: normal; font-size: 12px; }
.pip-row { padding: 8px 0; border-bottom: 1px solid var(--line); }
.pip-row:last-child { border-bottom: none; }
.pip-l1 { display: flex; align-items: center; gap: 2px; }
.pip-l1 > b { margin-right: 6px; font-size: 14px; }
.pip-pnl { margin-left: auto; font-size: 13.5px; font-weight: 600; }
.pip-l2 { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 4px; font-size: 11.5px; color: var(--muted); }
.pip-l2 b { font-weight: 500; color: var(--text); }
.pip-l2 .gold b { color: var(--gold); }
.pip-l2 b.pip-near { color: var(--up); font-weight: 700; }
.pip-close { margin-left: 8px; padding: 3px 10px; font-size: 11.5px; border-radius: 6px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); cursor: pointer; font-family: var(--font); }
.pip-close:hover { border-color: var(--muted); }
.pip-close.arm { border-color: var(--up); color: var(--up); background: rgba(240,80,80,.1); }
.pip-empty { padding: 24px 0; text-align: center; color: var(--muted); font-size: 12.5px; }
.pip-group { display: inline-flex; gap: 6px; flex: none; }
@media (max-width: 760px) { .pip-group { display: none; } }
.pip-video { position: fixed; right: 0; bottom: 0; width: 2px; height: 2px; opacity: 0; pointer-events: none; }
.pip-video.show { width: 360px; height: auto; opacity: 1; pointer-events: auto; right: 16px; bottom: 16px; border: 1px solid var(--line); border-radius: 10px; z-index: 50; box-shadow: 0 10px 30px rgba(0,0,0,.5); }
.pip-alt { font-size: 11.5px; color: var(--muted); border-color: transparent; }
.limit-line { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; align-items: baseline; font-size: 12.5px; color: var(--muted); margin: -6px 0 12px; }
.limit-line > span:nth-child(2) { text-align: right; }
.limit-line b { color: var(--text); font-weight: 600; }
.limit-line .ratio-bar { grid-column: 1 / -1; margin: 0; }
.setting-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.setting-row > div:first-child { flex: 1 1 320px; }
.setting-input { display: inline-flex; align-items: center; gap: 8px; }
.setting-input input { width: 150px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; color: var(--text); padding: 8px 10px; font-family: var(--mono); font-size: 14px; }

/* ---------- 관리 페이지 탭 ---------- */
.adm-tabs { position: sticky; top: 0; z-index: 20; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; margin: 0 0 16px; padding: 6px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.adm-tabs::-webkit-scrollbar { display: none; }
.adm-tabs button { flex: none; display: inline-flex; align-items: center; gap: 6px; background: none; border: none; color: var(--muted); font-family: var(--font); font-size: 14px; font-weight: 600; padding: 8px 14px; border-radius: 8px; cursor: pointer; white-space: nowrap; }
.adm-tabs button:hover { color: var(--text); background: var(--panel-2); }
.adm-tabs button.on { color: var(--gold); background: rgba(242,180,65,.1); box-shadow: 0 0 0 1px var(--gold-dim) inset; }
.adm-tabs button:focus-visible { outline: 2px solid var(--gold-dim); outline-offset: 1px; }
.adm-tabs .cnt { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--up); color: #fff; font-family: var(--mono); font-size: 11px; line-height: 18px; text-align: center; }
.adm-tabs .cnt.quiet { background: var(--panel-2); color: var(--muted); }
.adm-tabs .cnt.empty { display: none; }
.adm-pane[hidden] { display: none !important; }
@media (max-width: 760px) { .adm-tabs { margin-left: -4px; margin-right: -4px; } .adm-tabs button { padding: 7px 11px; font-size: 13.5px; } }
.house-tools { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.lg-note { grid-column: 1 / -1; font-size: 12px; margin-bottom: -4px; }
.btn.danger { color: var(--up); border-color: rgba(240,68,82,.35); }
.btn.danger:hover { background: rgba(240,68,82,.1); border-color: var(--up); }
.btn.danger-fill { background: var(--up); color: #fff; border: none; }
.btn.danger-fill:disabled { opacity: .4; cursor: not-allowed; }
.danger-body { font-size: 13.5px; line-height: 1.65; }
.danger-list { margin: 10px 0; padding: 10px 12px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 9px; }
.danger-list div { display: flex; justify-content: space-between; gap: 10px; padding: 2px 0; font-size: 13px; color: var(--muted); }
.danger-list b { color: var(--text); font-weight: 500; }
.bank-box { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 10px 12px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 9px; }
.bank-box b { font-size: 15px; }
.bank-reg { display: flex; gap: 8px; }
.bank-reg input { flex: 1; min-width: 0; }
.bank-box[hidden], .bank-reg[hidden] { display: none; }
.link-btn { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 13px; padding: 0 2px; } .link-btn:hover { color: var(--gold); }

/* ---------- 선물 첫 이용 안내 ---------- */
.guide-link { text-align: right; margin: -6px 0 8px; }
.guide-link .link-btn { font-size: 12.5px; color: var(--gold); }
dialog.guide-modal { width: min(600px, calc(100vw - 24px)); }
.guide-modal .modal-body { max-height: calc(100vh - 60px); overflow-y: auto; }
.guide-steps { display: grid; gap: 8px; margin: 4px 0 14px; }
.guide-steps > div { display: grid; grid-template-columns: 24px 1fr; gap: 10px; font-size: 13px; line-height: 1.6; color: var(--muted); }
.guide-steps > div > b { width: 22px; height: 22px; border-radius: 50%; background: rgba(242,180,65,.14); color: var(--gold); font-size: 12px; display: grid; place-items: center; margin-top: 1px; }
.guide-steps strong { color: var(--text); margin-right: 6px; }
.guide-steps em { font-style: normal; color: var(--text); }
.risk-box { border: 1px solid rgba(240,68,82,.45); background: rgba(240,68,82,.07); border-radius: 10px; padding: 12px 14px; }
.risk-title { color: var(--up); font-weight: 700; font-size: 14px; margin-bottom: 6px; }
.risk-box ul { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.65; }
.risk-box li + li { margin-top: 3px; }
.risk-box b { color: var(--text); }
.agree-list { display: grid; gap: 8px; margin: 14px 0 4px; }
.agree-list label { display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px; cursor: pointer; line-height: 1.5; }
.agree-list input { margin-top: 3px; accent-color: var(--gold); width: 16px; height: 16px; flex: none; }
