:root {
  color-scheme: dark;
  --bg: #07100e;
  --panel: #0b1714;
  --panel-2: #0f1d19;
  --line: #1c302b;
  --muted: #78918a;
  --text: #eef7f3;
  --green: #2ee6a6;
  --green-2: #0bbd81;
  --red: #ff5f77;
  --amber: #f4bc62;
  font-family: Inter, Pretendard, "Noto Sans KR", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { background: var(--bg); scroll-behavior: smooth; }
body { margin: 0; color: var(--text); background: radial-gradient(circle at 60% -20%, #13362b 0, transparent 36rem), var(--bg); }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.shell { min-height: 100vh; }
.topbar { height: 66px; display: flex; align-items: center; gap: 34px; padding: 0 24px; border-bottom: 1px solid var(--line); background: rgba(7,16,14,.9); backdrop-filter: blur(18px); position: sticky; top: 0; z-index: 20; }
.brand { color: white; text-decoration: none; font-weight: 900; letter-spacing: .09em; font-size: 17px; display: flex; align-items: center; gap: 10px; }
.brand > span:last-child span { color: var(--green); }
.brand-mark { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; color: #07100e; background: linear-gradient(135deg, #6ef3c4, #0bbd81); font-size: 18px; box-shadow: 0 0 24px rgba(46,230,166,.24); }
nav { display: flex; align-self: stretch; gap: 26px; }
nav a { color: var(--muted); text-decoration: none; display: grid; place-items: center; font-size: 14px; position: relative; }
nav a.active, nav a:hover { color: var(--text); }
nav a.active::after { content: ""; height: 2px; background: var(--green); position: absolute; left: 0; right: 0; bottom: 0; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.live-pill, .locked { color: #a5beb7; background: #10241e; border: 1px solid #1f4438; border-radius: 999px; padding: 7px 11px; font-size: 11px; letter-spacing: .02em; }
.live-pill i { display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(46,230,166,.1); }
.ghost, .primary { border: 1px solid var(--line); border-radius: 9px; height: 40px; padding: 0 16px; color: var(--text); background: transparent; }
.primary { border-color: var(--green-2); background: var(--green-2); color: #03110d; font-weight: 800; }
.small { height: 34px; padding: 0 13px; }
button:disabled { opacity: .72; cursor: not-allowed; }
.ticker { min-height: 102px; padding: 18px 24px; display: flex; align-items: center; gap: 30px; border-bottom: 1px solid var(--line); background: rgba(9,20,17,.68); }
.pair-title { min-width: 190px; display: flex; align-items: center; gap: 11px; color: var(--text); border: 0; background: none; text-align: left; cursor: pointer; padding: 0; }
.pair-title strong { display: block; font-size: 18px; }
.pair-title small { display: block; color: var(--muted); margin-top: 3px; }
.coin-badge { width: 39px; height: 39px; border-radius: 50%; display: grid; place-items: center; color: #07100e; font-weight: 900; background: linear-gradient(135deg, #f6d67a, #e89928); }
.ticker-price { min-width: 150px; }
.ticker-price strong { display: block; color: var(--green); font-size: 21px; font-variant-numeric: tabular-nums; }
.ticker-price small { color: var(--muted); }
.ticker-stats { margin: 0 0 0 auto; display: grid; grid-template-columns: repeat(4, minmax(125px, 1fr)); gap: 34px; }
.ticker-stats div { min-width: 0; }
.ticker-stats dt { color: var(--muted); font-size: 11px; margin-bottom: 7px; }
.ticker-stats dd { margin: 0; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.positive { color: var(--green) !important; }
.negative { color: var(--red) !important; }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 270px 310px; grid-template-areas: "chart markets orderbook" "orders orders trades"; border-bottom: 1px solid var(--line); }
.panel { min-width: 0; background: rgba(9,20,17,.75); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.chart-panel { grid-area: chart; }
.markets { grid-area: markets; }
.orderbook { grid-area: orderbook; border-right: 0; }
.trades { grid-area: trades; border-right: 0; }
.order-entry { grid-area: orders; }
.panel-head { height: 48px; padding: 0 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.panel-head h2 { margin: 0; font-size: 14px; }
.panel-head > span:not(.locked), .updated { color: var(--muted); font-size: 11px; }
.tabs { display: flex; gap: 3px; align-items: center; height: 100%; overflow-x: auto; }
.tabs button { border: 0; background: none; color: var(--muted); padding: 8px 10px; border-radius: 7px; font-size: 11px; cursor: pointer; white-space: nowrap; }
.tabs button.active { color: var(--green); background: rgba(46,230,166,.1); }
.ohlc { height: 34px; padding: 10px 16px 0; color: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; }
.chart-wrap { height: 420px; position: relative; }
#price-chart { display: block; width: 100%; height: 100%; }
.chart-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 12px; }
.search { margin: 12px; height: 36px; border: 1px solid var(--line); border-radius: 8px; display: flex; gap: 7px; align-items: center; padding: 0 10px; color: var(--muted); background: #08130f; }
.search input { border: 0; outline: 0; background: transparent; color: var(--text); width: 100%; font-size: 12px; }
.market-columns, .market-row, .book-columns, .book-row, .trade-columns, .trade-row { display: grid; align-items: center; font-variant-numeric: tabular-nums; }
.market-columns, .market-row { grid-template-columns: 1.1fr 1fr .7fr; }
.book-columns, .book-row { grid-template-columns: 1.1fr .8fr .8fr; }
.trade-columns, .trade-row { grid-template-columns: 1fr .8fr .8fr; }
.market-columns, .book-columns, .trade-columns { color: #5e756e; font-size: 9px; padding: 0 14px 8px; }
.market-columns span:not(:first-child), .book-columns span:not(:first-child), .trade-columns span:not(:first-child) { text-align: right; }
.market-list { max-height: 384px; overflow-y: auto; }
.market-row { width: 100%; height: 48px; border: 0; border-left: 2px solid transparent; padding: 0 12px; background: transparent; color: var(--text); text-align: left; cursor: pointer; font-size: 11px; }
.market-row:hover { background: #10221c; }
.market-row.active { border-left-color: var(--green); background: rgba(46,230,166,.07); }
.market-row span:not(:first-child) { text-align: right; }
.market-row b { display: block; font-size: 12px; }
.market-row small { color: var(--muted); }
.book, .trade-list { min-height: 155px; padding: 7px 0; }
.book-row, .trade-row { height: 25px; padding: 0 14px; font-size: 10px; position: relative; }
.book-row span, .trade-row span { z-index: 1; }
.book-row span:not(:first-child), .trade-row span:not(:first-child) { text-align: right; }
.book-row i { position: absolute; right: 0; top: 2px; bottom: 2px; opacity: .08; }
.ask { color: var(--red); } .ask i { background: var(--red); }
.bid { color: var(--green); } .bid i { background: var(--green); }
.book-row span:nth-child(n+2), .trade-row span:nth-child(n+2) { color: #a5b7b2; }
.book-mid { height: 44px; display: flex; align-items: center; gap: 9px; padding: 0 14px; border-block: 1px solid var(--line); }
.book-mid strong { color: var(--green); font-size: 14px; }
.book-mid span { color: var(--muted); font-size: 10px; }
.empty-list { min-height: 120px; padding: 20px; color: var(--muted); display: grid; place-items: center; text-align: center; font-size: 11px; line-height: 1.7; }
.order-grid { display: grid; grid-template-columns: 1fr 1fr; }
.order-card { padding: 18px 20px 22px; border-right: 1px solid var(--line); }
.order-card:last-child { border-right: 0; }
.balance { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; margin-bottom: 14px; }
.balance strong { color: #afc1bc; }
.order-card label { height: 43px; margin-bottom: 9px; padding: 0 12px; display: flex; align-items: center; justify-content: space-between; border: 1px solid var(--line); border-radius: 7px; color: var(--muted); font-size: 11px; background: #08130f; }
.order-card label span { display: flex; align-items: center; gap: 8px; color: #9db0aa; }
.order-card input:not(.range) { width: 120px; border: 0; outline: none; background: none; color: var(--text); text-align: right; }
.order-card b { font-weight: 500; }
.range { accent-color: var(--green); width: 100%; margin: 3px 0 14px; }
.sell-range { accent-color: var(--red); }
.order-card .primary { width: 100%; }
.buy { background: var(--green-2); border-color: var(--green-2); }
.sell { background: #dc5268; border-color: #dc5268; color: white; }
footer { min-height: 64px; padding: 0 24px; color: var(--muted); display: flex; align-items: center; justify-content: space-between; font-size: 10px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; padding: 11px 16px; border: 1px solid #2d4f45; border-radius: 9px; background: #10201b; color: var(--text); font-size: 12px; transition: .2s ease; z-index: 50; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 1100px) {
  .ticker { flex-wrap: wrap; }
  .ticker-stats { width: 100%; margin-left: 0; }
  .workspace { grid-template-columns: minmax(0,1fr) 290px; grid-template-areas: "chart orderbook" "markets trades" "orders orders"; }
  .markets { min-height: 400px; }
}
@media (max-width: 760px) {
  .topbar { padding: 0 14px; gap: 16px; } nav { display: none; } .live-pill { display: none; }
  .top-actions .ghost { display: none; }
  .ticker { padding: 15px; gap: 16px; }
  .pair-title { min-width: 155px; } .ticker-price { min-width: 120px; }
  .ticker-stats { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .workspace { display: block; }
  .chart-wrap { height: 330px; }
  .panel { border-right: 0; }
  .markets, .orderbook, .trades { min-height: auto; }
  .order-grid { grid-template-columns: 1fr; }
  .order-card { border-right: 0; border-bottom: 1px solid var(--line); }
  footer { align-items: flex-start; flex-direction: column; justify-content: center; gap: 6px; }
}
