:root {
  color-scheme: dark;
  --bg: #080b0f;
  --panel: #0d1117;
  --panel-2: #111720;
  --line: #202833;
  --muted: #788494;
  --text: #e8edf3;
  --green: #1fd09c;
  --red: #f25d70;
  --yellow: #f5bf45;
  --blue: #5387ff;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 13px Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input { font: inherit; }
button { color: inherit; background: none; border: 0; cursor: pointer; }
.topbar { height: 56px; display: flex; align-items: center; padding: 0 18px; border-bottom: 1px solid var(--line); background: #0a0e13; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 210px; color: white; text-decoration: none; font-size: 17px; font-weight: 750; letter-spacing: -.4px; }
.brand > span:last-child span { color: var(--green); }
.brand-mark { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--green); color: #04150f; font-weight: 900; box-shadow: 0 0 20px #1fd09c33; }
nav { display: flex; align-self: stretch; gap: 22px; }
nav button { color: var(--muted); padding: 0 3px; border-bottom: 2px solid transparent; }
nav button:hover, nav .nav-active { color: white; border-color: var(--green); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.network { color: #b8c0cb; padding: 8px 11px; background: #121821; border: 1px solid var(--line); border-radius: 7px; }
.network i, .status-dot::before { display: inline-block; width: 6px; height: 6px; margin-right: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); content: ""; }
.icon-button { width: 34px; height: 34px; color: var(--muted); border: 1px solid var(--line); border-radius: 7px; }
.wallet-button { padding: 9px 15px; color: #06140f; background: var(--green); border-radius: 7px; font-weight: 750; }
.wallet-button.connected { color: var(--green); background: #15362e; }

.market-strip { position: relative; z-index: 10; grid-column: 1; grid-row: 1; min-width: 0; height: 56px; display: flex; align-items: center; padding: 0 14px; overflow: visible; border-bottom: 1px solid var(--line); background: var(--panel); }
.pair-picker-wrap { position: relative; flex: 0 0 190px; }
.pair-picker { width: 100%; display: flex; align-items: center; gap: 10px; text-align: left; }
.pair-picker b { margin-left: auto; color: var(--muted); }
.pair-picker strong, .pair-picker small { display: block; }
.pair-picker strong { font-size: 14px; white-space: nowrap; }.pair-picker small { margin-top: 2px; color: var(--muted); font-size: 10px; white-space: nowrap; }
.pair-menu { position: absolute; z-index: 30; top: 100%; left: 0; width: 300px; padding: 12px; color: var(--text); background: #111820; border: 1px solid #2b715f; border-radius: 6px; box-shadow: 0 12px 30px #000b; }
.pair-menu[hidden] { display: none; }.pair-menu label { display: block; margin-bottom: 8px; color: var(--muted); font-size: 11px; }
.pair-menu input { width: 100%; padding: 9px; color: var(--text); background: #0d1117; border: 1px solid var(--line); border-radius: 5px; outline-color: var(--green); }
.pair-menu p { margin: 8px 0 0; color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.token-logo { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; color: #fff; font-weight: 800; background: linear-gradient(145deg, #e74343, #962929); }
.pool-picker { position: relative; display: flex; flex-direction: column; gap: 4px; min-width: 230px; margin: 0 16px 0 0; color: var(--green); font-size: 9px; font-weight: 800; letter-spacing: .7px; text-transform: uppercase; }
.pool-picker > button { display: flex; align-items: center; justify-content: space-between; width: 100%; height: 32px; padding: 0 9px; color: #ecf3f1; background: #111a20; border: 1px solid #2b715f; border-radius: 5px; font-size: 10px; font-weight: 700; text-align: left; }
#poolValue { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.pool-picker > button:focus-visible { outline: 1px solid var(--green); outline-offset: 1px; }.pool-picker > button b { color: var(--muted); transition: transform .15s; }.pool-picker > button[aria-expanded="true"] b { transform: rotate(180deg); }
.pool-menu { position: absolute; z-index: 30; top: 100%; right: 0; left: 0; max-height: 320px; overflow-y: auto; margin-top: 4px; padding: 4px; background: #111820; border: 1px solid #2b715f; border-radius: 6px; box-shadow: 0 12px 30px #000b; letter-spacing: 0; text-transform: none; }.pool-menu[hidden] { display: none; }
.pool-menu button { width: 100%; padding: 8px; color: #ecf3f1; border-radius: 4px; font-size: 10px; font-weight: 700; text-align: left; }.pool-menu button:hover, .pool-menu button:focus-visible { color: var(--green); background: #18332b; outline: 0; }.pool-menu button::before { margin-right: 7px; color: var(--green); content: "✓"; }
.pool-menu button[aria-selected="false"]::before { content: ""; display: inline-block; width: 7px; }
.market-notice { margin: 12px; padding: 10px; color: var(--yellow); background: #2b2516; border: 1px solid #635224; border-radius: 5px; font-size: 11px; }
.order-panel.market-unavailable > :not(.market-notice) { opacity: .45; pointer-events: none; }
.last-price { display: flex; flex-direction: column; min-width: 115px; }
.last-price strong { color: var(--green); font: 18px/1.1 ui-monospace, monospace; }.last-price span { color: var(--muted); font-size: 10px; }
.market-strip dl { display: flex; gap: clamp(20px, 4vw, 64px); margin: 0; }
.market-strip dl div { min-width: 88px; display: flex; flex-direction: column; gap: 3px; white-space: nowrap; }.market-strip dt { color: var(--muted); font-size: 10px; }.market-strip dd { margin: 0; font-size: 12px; font-weight: 600; }
.up { color: var(--green) !important; }.sell { color: var(--red); }.buy { color: var(--green); }

.terminal-grid { display: grid; grid-template-columns: minmax(480px, 1fr) 330px 340px; grid-template-rows: 56px minmax(414px, calc(100vh - 368px)) 255px; gap: 1px; background: var(--line); }
.panel { min-width: 0; background: var(--panel); }
.chart-panel { grid-column: 1; grid-row: 2; }.market-column { grid-column: 2; grid-row: 1 / 3; min-width: 0; display: grid; grid-template-rows: 369px minmax(200px, 1fr); gap: 1px; overflow: hidden; background: var(--line); }.order-panel { grid-column: 3; grid-row: 1 / 4; }.positions-panel { grid-column: 1 / 3; grid-row: 3; }
.panel-tabs { height: 42px; display: flex; align-items: center; gap: 18px; padding: 0 14px; border-bottom: 1px solid var(--line); }
.panel-tabs button { height: 100%; padding: 0; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.panel-tabs button:hover, .panel-tabs button.active { color: var(--text); border-color: var(--green); }
.panel-tabs em { margin-left: 4px; padding: 2px 5px; color: #8e9aa8; background: #202832; border-radius: 8px; font-size: 8px; font-style: normal; font-weight: 500; }
.panel-tabs span { flex: 1; }.panel-tabs .time { font-size: 11px; }.panel-tabs .time.active { color: var(--green); border-color: transparent; }
.chart-toolbar { display: flex; gap: 16px; height: 30px; align-items: center; padding: 0 14px; color: var(--muted); font-size: 11px; }
.chart { position: relative; height: calc(100% - 72px); min-height: 350px; overflow: hidden; background-image: linear-gradient(#1b222c 1px, transparent 1px), linear-gradient(90deg, #1b222c 1px, transparent 1px); background-size: 100% 20%, 16.666% 100%; }
.price-axis { position: absolute; inset: 9px 8px 28px auto; z-index: 4; display: flex; flex-direction: column; justify-content: space-between; color: #667180; font: 10px ui-monospace, monospace; }
.time-axis { position: absolute; left: 12px; right: 46px; bottom: 5px; display: flex; justify-content: space-between; color: #667180; font-size: 10px; }
.candles { position: absolute; inset: 12px 54px 78px 18px; display: flex; align-items: flex-end; gap: 4px; }
.candle { position: relative; flex: 1; height: 100%; }.candle i { position: absolute; left: 50%; width: 1px; transform: translateX(-50%); background: currentColor; }.candle b { position: absolute; left: 24%; width: 52%; min-height: 3px; background: currentColor; border-radius: 1px; }
.candle.green { color: var(--green); }.candle.red { color: var(--red); }
.volume { position: absolute; left: 18px; right: 54px; bottom: 28px; height: 42px; display: flex; align-items: flex-end; gap: 4px; opacity: .55; }.volume i { flex: 1; min-height: 3px; background: var(--green); }.volume i.red { background: var(--red); }
.order-line, .current-line { position: absolute; left: 10px; right: 44px; z-index: 5; border-top: 1px dashed; }
.order-line { top: 25%; color: var(--yellow); }.current-line { top: 47%; color: var(--green); }
.order-line b { position: absolute; top: -19px; padding: 3px 6px; border-radius: 3px; color: #171103; background: var(--yellow); font-size: 9px; }.order-line span, .current-line span { position: absolute; top: -9px; right: -2px; padding: 2px 4px; color: #07140f; background: currentColor; border-radius: 2px; font: 10px ui-monospace, monospace; }.order-line span { color: var(--yellow); }.order-line span::first-line, .current-line span::first-line { color: #07140f; }

.book-summary, .book-row { display: grid; grid-template-columns: minmax(76px, 1fr) 82px 82px; column-gap: 12px; align-items: center; padding: 0 12px; font: 11px ui-monospace, SFMono-Regular, monospace; font-variant-numeric: tabular-nums; }
.book-summary { height: 30px; color: var(--muted); font-family: inherit; }.book-summary span:not(:first-child), .book-row span:not(:first-child) { text-align: right; }
.book { height: 132px; overflow: hidden; }.book-row { position: relative; width: 100%; height: 21px; }.book-row::before { position: absolute; z-index: 0; inset: 1px 0 1px auto; width: var(--depth); content: ""; background: #f25d7024; }.bids .book-row::before { background: #1fd09c24; }.book-row span { position: relative; z-index: 1; }.asks .book-row span:first-child { color: var(--red); }.bids .book-row span:first-child { color: var(--green); }.book-row:hover { background: #ffffff08; }
.mid-price { height: 39px; display: flex; align-items: center; gap: 12px; padding: 0 12px; border-block: 1px solid var(--line); }.mid-price strong { color: var(--green); font: 18px ui-monospace, monospace; }.mid-price span { color: var(--muted); font-size: 10px; }
.depth-toggle { display: flex; gap: 3px; }.panel-tabs .depth-toggle button { width: 24px; height: 24px; padding: 0; color: #536070; border: 0; border-radius: 3px; }.panel-tabs .depth-toggle button:hover, .panel-tabs .depth-toggle button.active { color: var(--green); border: 0; background: #16241f; }.depth-toggle button::before { display: block; width: 13px; height: 11px; margin: auto; content: ""; background: currentColor; clip-path: polygon(0 75%, 33% 75%, 33% 50%, 66% 50%, 66% 25%, 100% 25%, 100% 100%, 0 100%); }.depth-toggle button[data-depth="activeLiquidity"]::before { clip-path: none; background: linear-gradient(to top, currentColor 65%, transparent 65%) left/3px 100% no-repeat, linear-gradient(to top, currentColor 100%, transparent 100%) center/3px 100% no-repeat, linear-gradient(to top, currentColor 45%, transparent 45%) right/3px 100% no-repeat; }
.trade-summary, .trade-row { display: grid; grid-template-columns: 1fr 1fr 60px; gap: 10px; padding: 0 12px; }.trade-summary { height: 33px; align-items: center; color: var(--muted); font-size: 10px; }.trade-summary span:not(:first-child), .trade-row span:not(:first-child) { text-align: right; }.trades { height: calc(100% - 75px); overflow: hidden; }.trade-row { height: 23px; align-items: center; font: 10px ui-monospace, SFMono-Regular, monospace; font-variant-numeric: tabular-nums; }.trade-row.buy span:first-child { color: var(--green); }.trade-row.sell span:first-child { color: var(--red); }.trade-row:hover { background: #ffffff08; }.trade-empty { height: 100%; display: grid; place-content: center; color: var(--muted); text-align: center; }.trade-empty strong { color: #aab3be; font-size: 11px; }

.order-panel { padding: 0 16px; }
.order-type { display: flex; height: 54px; margin: 0 -16px 16px; border-bottom: 1px solid var(--line); }.order-type button { flex: 1; color: var(--muted); font-weight: 700; }.order-type .active { color: var(--text); box-shadow: inset 0 -2px var(--green); }
.side-toggle { display: flex; padding: 3px; margin-bottom: 18px; border-radius: 7px; background: #090d12; }.side-toggle button { flex: 1; padding: 9px; border-radius: 5px; color: var(--muted); }.side-toggle .active { color: #05140e; background: var(--green); font-weight: 750; }
label { display: block; margin-top: 15px; color: var(--muted); font-size: 11px; }label > span { float: right; }.input { display: flex; height: 42px; margin-top: 7px; border: 1px solid var(--line); border-radius: 7px; background: #090d12; }.input:focus-within { border-color: #3d806c; }.input input { min-width: 0; flex: 1; padding: 0 12px; color: var(--text); background: transparent; border: 0; outline: 0; font: 15px ui-monospace, monospace; }.input button { padding: 0 11px; color: var(--green); }.input .unit-button { display: flex; align-items: center; gap: 7px; color: var(--text); font-weight: 700; }.unit-button b { color: var(--muted); font-size: 10px; }
.quick-prices { display: flex; gap: 6px; margin-top: 7px; }.quick-prices button { flex: 1; padding: 6px; color: var(--muted); border-radius: 4px; background: var(--panel-2); }.quick-prices button:hover { color: var(--text); }
.balance, .range-labels { display: flex; justify-content: space-between; color: var(--muted); font-size: 10px; }.balance { margin-top: 8px; }.balance strong { color: #aab3be; font-weight: 500; }
.range-wrap { position: relative; margin: 30px 0 4px; }.range { width: 100%; margin: 0; accent-color: var(--green); }.range-wrap output { position: absolute; left: clamp(20px, calc(var(--value) * 1%), calc(100% - 20px)); bottom: 24px; min-width: 38px; padding: 4px 7px; color: #202833; background: var(--text); border-radius: 5px; font-weight: 700; text-align: center; transform: translateX(-50%); pointer-events: none; }.range-wrap output::after { position: absolute; left: 50%; bottom: -4px; width: 8px; height: 8px; background: var(--text); content: ""; transform: translateX(-50%) rotate(45deg); }.range-labels { color: #596474; }
.execution-card { display: grid; gap: 10px; margin-top: 20px; padding: 13px; background: #101720; border: 1px solid var(--line); border-radius: 8px; }.execution-card div { display: flex; justify-content: space-between; }.execution-card span { color: var(--muted); }.execution-card strong { font-weight: 600; }
.primary { width: 100%; margin-top: 18px; padding: 13px; color: #06140f; background: var(--green); border-radius: 7px; font-weight: 800; }.primary:hover { filter: brightness(1.08); }.primary:disabled { cursor: wait; filter: grayscale(.5); }.order-note { color: var(--muted); font-size: 10px; line-height: 1.5; text-align: center; }

.positions-tabs em { color: var(--green); background: #15362e; }
.table-wrap { overflow: auto; }table { width: 100%; border-collapse: collapse; white-space: nowrap; }th, td { height: 48px; padding: 0 14px; text-align: left; border-bottom: 1px solid #19212b; font-size: 11px; }th { height: 34px; color: var(--muted); font-weight: 500; }td strong, td small { display: block; }td small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.progress { width: 80px; height: 2px; margin-top: 6px; background: #26303c; }.progress i { display: block; height: 100%; background: var(--green); }.pill { padding: 4px 7px; border-radius: 10px; white-space: nowrap; }.pill.filling { color: var(--yellow); background: #392d12; }.pill.waiting { color: #9aa5b2; background: #222a34; }.pill.filled { color: var(--green); background: #15362e; }.table-action { color: var(--muted); text-decoration: none; }.table-action:hover { color: white; }.table-empty { color: var(--muted); text-align: center; }
.toast { position: fixed; z-index: 20; right: 18px; bottom: 18px; display: flex; align-items: center; gap: 10px; min-width: 240px; padding: 12px; border: 1px solid #285c4e; border-radius: 8px; background: #101b18; box-shadow: 0 12px 40px #0009; opacity: 0; transform: translateY(10px); pointer-events: none; transition: .2s; }.toast.show { opacity: 1; transform: none; }.toast > span { display: grid; place-items: center; width: 26px; height: 26px; color: #05140e; background: var(--green); border-radius: 50%; }.toast strong, .toast small { display: block; }.toast small { margin-top: 3px; color: var(--muted); }
.unit-modal { position: fixed; z-index: 40; inset: 0; display: grid; place-items: center; padding: 20px; background: #0009; }.unit-modal[hidden] { display: none; }.unit-modal > section { width: min(460px, 100%); padding: 20px; border: 1px solid #303a47; border-radius: 16px; background: #171e27; box-shadow: 0 20px 70px #000c; }.unit-modal h2 { margin: 0 0 18px; color: #aab3be; font-size: 15px; font-weight: 500; }.unit-modal [role="radiogroup"] { display: grid; gap: 12px; }.unit-option { position: relative; min-height: 104px; padding: 18px 18px 42px; border: 1px solid #485465; border-radius: 12px; text-align: left; }.unit-option:hover { background: #ffffff05; }.unit-option.active { border: 2px solid var(--text); padding: 17px 17px 41px; }.unit-option strong, .unit-option span { display: block; }.unit-option strong { margin-bottom: 8px; font-size: 17px; }.unit-option span { color: var(--muted); line-height: 1.45; }.unit-option i { position: absolute; left: 18px; bottom: 16px; width: 18px; height: 18px; border: 1px solid #576476; border-radius: 50%; }.unit-option.active i { border: 5px solid var(--text); }

@media (max-width: 1100px) { .terminal-grid { grid-template-columns: minmax(450px, 1fr) 280px; }.order-panel { grid-column: 2; }.market-column { display: none; }.positions-panel { grid-column: 1; }.market-strip dl div:nth-last-child(-n+2) { display: none; } }
