:root {
  color-scheme: dark;
  --bg: #0b1018;
  --panel: #111923;
  --line: #263142;
  --text: #f0f4fa;
  --muted: #a0afc3;
  --mint: #62efb9;
  --red: #ff8693;
  --mono: ui-monospace, "SF Mono", Consolas, monospace;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
[hidden] { display: none !important; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; }
h1, h2, p, dl, dd { margin: 0; }
.symbols { position: absolute; width: 0; height: 0; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.topbar { background: #0e151f; border-bottom: 1px solid #202b3a; }
.topbar-inner { max-width: 1512px; min-height: 74px; padding: 0 42px; margin: auto; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: flex; align-items: center; gap: 11px; flex: none; font-size: 21px; line-height: 1.06; font-weight: 760; letter-spacing: -.65px; }
.brand-icon { width: 39px; height: 39px; display: block; flex: none; }
.brand-accent { color: var(--mint); }
.brand small { display: block; margin-top: 5px; font: 600 8px var(--mono); letter-spacing: 1px; color: var(--muted); }
.navigation { display: flex; align-items: center; gap: 6px; }
.navigation a { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 13px; border: 1px solid transparent; border-radius: 8px; color: var(--muted); font-size: 13px; font-weight: 650; white-space: nowrap; }
.navigation a:hover, .navigation a[aria-current] { color: var(--mint); background: #162b29; border-color: #25433e; }
.navigation svg { width: 16px; height: 16px; }
.top-actions { display: flex; align-items: center; gap: 15px; }
.mode { color: var(--muted); font: 600 10px var(--mono); white-space: nowrap; letter-spacing: .55px; }
.mode i, .feed span, .chart-foot i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 10px #62efb952; margin-right: 4px; }
.cash-header { display: flex; align-items: center; gap: 9px; border: 1px solid var(--line); padding: 9px 11px; border-radius: 8px; font: 650 13px var(--mono); white-space: nowrap; }
.cash-header svg { color: var(--mint); width: 15px; height: 15px; }
.app-shell { max-width: 1512px; margin: auto; padding: 0 42px; }
.page-intro { display: flex; justify-content: space-between; align-items: end; gap: 14px; padding: 38px 0 24px; }
.eyebrow { display: flex; align-items: center; gap: 8px; color: var(--mint); font: 650 10px var(--mono); letter-spacing: 1.6px; }
.eyebrow span { width: 15px; height: 1px; background: var(--mint); }
h1 { font-size: clamp(35px, 4.2vw, 53px); font-weight: 770; line-height: 1.06; letter-spacing: -.06em; margin: 9px 0; }
.subtitle { color: var(--muted); font-size: 15px; line-height: 1.5; }
.feed { color: var(--mint); border: 1px solid #29483f; border-radius: 30px; padding: 8px 11px; background: #14241f; font-size: 11px; white-space: nowrap; }
.feed span { width: 6px; height: 6px; }
.market-grid { display: grid; grid-template-columns: minmax(205px, .9fr) minmax(340px, 2.15fr) minmax(245px, 1fr); gap: 15px; align-items: stretch; }
.panel { min-width: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
h2 { font-size: 17px; font-weight: 690; letter-spacing: -.025em; }
.watch-head { padding: 18px 14px 12px; }
.search { display: flex; align-items: center; gap: 7px; margin-top: 15px; padding: 0 8px; min-height: 37px; border: 1px solid var(--line); border-radius: 7px; background: #0e151f; color: var(--muted); }
.search:focus-within { border-color: var(--mint); }
.search svg { width: 15px; height: 15px; }
.search input, .quantity-control input { min-width: 0; width: 100%; padding: 0; background: transparent; border: 0; color: var(--text); outline: none; }
.search input { font-size: 12px; }
.search input::placeholder { color: var(--muted); }
.watch-label { display: flex; justify-content: space-between; padding: 0 14px 9px; color: var(--muted); font: 600 9px var(--mono); letter-spacing: .7px; }
.watch-items { padding: 0 6px 7px; }
.asset-row { width: 100%; display: flex; align-items: center; gap: 8px; padding: 8px 7px; min-height: 53px; color: inherit; text-align: left; background: transparent; border: 1px solid transparent; border-radius: 8px; }
.asset-row:hover { background: #192431; }
.asset-row[aria-pressed="true"] { background: #1a2d2d; border-color: #2a4945; }
.asset-icon { display: block; flex: none; width: 33px; height: 33px; }
.asset-copy { display: grid; gap: 4px; min-width: 0; }
.asset-copy strong { font-size: 12px; }
.asset-copy small { color: var(--muted); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.asset-value { display: grid; gap: 4px; margin-left: auto; text-align: right; white-space: nowrap; font: 650 11px var(--mono); }
.asset-value small { font-size: 10px; }
.positive { color: var(--mint); }
.negative { color: var(--red); }
.chart-panel { padding: 18px 17px 13px; display: flex; flex-direction: column; }
.chart-head, .instrument, .order-heading { display: flex; align-items: center; gap: 9px; }
.chart-head, .order-heading { justify-content: space-between; }
.instrument .asset-icon { width: 41px; height: 41px; }
.instrument p { color: var(--muted); font-size: 11px; margin-top: 4px; }
.exchange { color: var(--muted); font: 600 10px var(--mono); padding: 5px 7px; border: 1px solid var(--line); border-radius: 6px; }
.quote { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; margin: 17px 0 11px; }
.quote strong { font: 710 clamp(24px, 2.65vw, 37px) var(--mono); letter-spacing: -.07em; }
.quote span { border-radius: 5px; padding: 4px 6px; background: #23352f; font: 650 11px var(--mono); }
.quote span.negative { background: #38252f; }
.ranges { display: flex; gap: 4px; align-self: start; padding: 3px; border: 1px solid var(--line); border-radius: 8px; background: #0e151e; }
.ranges button, .quantity-presets button { border: 1px solid transparent; background: transparent; border-radius: 5px; color: var(--muted); font: 650 11px var(--mono); }
.ranges button { padding: 6px 9px; }
.ranges button[aria-pressed="true"], .ranges button:hover { color: var(--mint); background: #1e3632; }
.plot { position: relative; flex: 1 0 205px; margin: 10px 0 2px; min-height: 205px; touch-action: pan-y; }
.plot svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.plot text { fill: var(--muted); stroke: none; font: 10px var(--mono); }
.chart-foot { border-top: 1px solid var(--line); display: flex; justify-content: space-between; padding-top: 11px; color: var(--muted); font: 600 10px var(--mono); }
.chart-foot i { width: 6px; height: 6px; }
.order-panel { padding: 18px 14px 13px; }
.order-heading > span { display: flex; align-items: center; gap: 3px; color: var(--muted); font-size: 11px; white-space: nowrap; }
.order-heading svg { width: 13px; height: 13px; color: var(--mint); }
.order-sides { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 8px; background: #0d151e; margin: 17px 0 16px; }
.order-sides button { min-height: 35px; border: 1px solid transparent; border-radius: 5px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 680; }
.order-sides button[data-side="buy"][aria-pressed="true"] { color: var(--mint); background: #1c352e; border-color: #2d5044; }
.order-sides button[data-side="sell"][aria-pressed="true"] { color: var(--red); background: #372630; border-color: #61414e; }
.input-label { display: block; color: var(--muted); font-size: 12px; margin-bottom: 7px; }
.quantity-control { display: flex; align-items: center; gap: 7px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: #0e151f; font: 650 15px var(--mono); }
.quantity-control:focus-within { border-color: var(--mint); }
.quantity-control span { color: var(--muted); font-size: 11px; }
.quantity-presets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin: 8px 0 15px; }
.quantity-presets button { background: #182331; min-height: 27px; }
.quantity-presets button:hover { color: var(--text); border-color: var(--muted); }
.order-details > div { display: flex; justify-content: space-between; align-items: center; gap: 4px; padding: 5px 0; }
.order-details dt { color: var(--muted); font-size: 11px; }
.order-details dd { font: 650 11px var(--mono); text-align: right; white-space: nowrap; }
.order-details .order-total { border-top: 1px solid var(--line); padding: 11px 0 0; margin-top: 6px; }
.order-total dt, .order-total dd { color: var(--text); font-size: 14px; font-weight: 700; }
.submit-order { display: flex; width: 100%; align-items: center; justify-content: space-between; margin-top: 15px; min-height: 42px; padding: 0 11px; border: 0; border-radius: 8px; background: var(--mint); color: #08261c; font-size: 13px; font-weight: 760; }
.submit-order[data-side="sell"] { background: var(--red); color: #32131a; }
.submit-order:hover { filter: brightness(1.09); }
.order-message { margin-top: 8px; min-height: 17px; font-size: 11px; line-height: 1.35; }
.notice { display: flex; align-items: center; gap: 9px; margin-top: 15px; padding: 12px 14px; background: #111b27; color: var(--muted); border: 1px solid var(--line); border-radius: 9px; font-size: 12px; line-height: 1.45; }
.notice svg { color: #9cbbea; width: 15px; height: 15px; }
.notice strong { color: #dbe7f8; }
footer { display: flex; justify-content: space-between; gap: 10px; border-top: 1px solid #202b3a; margin: 25px 0 0; padding: 14px 0 18px; color: var(--muted); font: 600 9px var(--mono); letter-spacing: .65px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 15px; }
.stat { padding: 16px; }
.stat p { color: var(--muted); font-size: 12px; margin-bottom: 9px; }
.stat strong { font: 700 clamp(15px, 2.1vw, 28px) var(--mono); white-space: nowrap; }
.table-panel h2 { padding: 17px; }
.table-scroll { overflow: auto; }
table { width: 100%; border-collapse: collapse; white-space: nowrap; }
th, td { padding: 12px 17px; border-top: 1px solid var(--line); text-align: right; font: 600 12px var(--mono); }
th { background: #0e151f; color: var(--muted); }
th:first-child, td:first-child { text-align: left; }
.table-asset { display: flex; align-items: center; gap: 8px; }
.table-asset:hover { color: var(--mint); }
.empty { padding: 23px 17px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); }
.watch-items .empty { padding: 12px 7px; border: 0; }
.reset button { margin-left: auto; padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; background: #1b2432; color: var(--text); font-size: 12px; white-space: nowrap; }
.reset button:hover { color: var(--red); }
dialog { width: min(390px, calc(100% - 28px)); border: 1px solid var(--line); border-radius: 14px; padding: 19px; background: var(--panel); color: var(--text); }
dialog::backdrop { background: #060a11c7; }
dialog p { margin: 10px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
dialog p.negative { color: var(--red); }
.dialog-actions { display: flex; justify-content: end; gap: 8px; margin-top: 17px; }
.dialog-actions button { padding: 9px 12px; border-radius: 7px; border: 1px solid var(--line); background: #1b2432; color: var(--text); font-size: 13px; font-weight: 700; }
.dialog-actions #confirm-reset { border-color: transparent; background: var(--red); color: #32131a; }
@media (max-width: 1100px) {
  .topbar-inner, .app-shell { padding-left: 25px; padding-right: 25px; }
  .mode { display: none; }
  .market-grid { gap: 10px; }
}
@media (max-width: 880px) {
  .market-grid { grid-template-columns: minmax(175px, .8fr) minmax(310px, 1.9fr); }
  .order-panel { grid-column: 1 / -1; }
}
@media (max-width: 680px) {
  .topbar-inner, .app-shell { padding-left: 14px; padding-right: 14px; }
  .topbar-inner { min-height: 61px; }
  .brand { font-size: 18px; gap: 7px; }
  .brand-icon { width: 33px; height: 33px; border-radius: 9px; }
  .brand small { font-size: 7px; }
  .cash-header { font-size: 11px; gap: 5px; }
  .navigation { position: fixed; inset: auto 0 0; z-index: 2; padding: 5px 10px max(5px, env(safe-area-inset-bottom)); background: #0e151f; border-top: 1px solid var(--line); }
  .navigation a { flex: 1; flex-direction: column; gap: 4px; padding: 6px 3px; font-size: 11px; }
  .app-shell { padding-bottom: calc(58px + env(safe-area-inset-bottom)); }
  .page-intro { padding: 22px 0 15px; align-items: start; }
  .subtitle { font-size: 13px; }
  .feed { font-size: 9px; margin-top: 2px; padding: 6px 7px; }
  .feed span { margin-right: 1px; }
  .market-grid { grid-template-columns: minmax(0, 1fr); }
  .watch-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px; }
  .search { margin: 0; width: 48%; min-height: 32px; }
  .search input, .quantity-control input { font-size: 16px; }
  .search input::placeholder { font-size: 11px; }
  .watch-label { display: none; }
  .watch-items { display: flex; gap: 4px; overflow-x: auto; padding: 0 8px 8px; }
  .asset-row { width: auto; flex: none; gap: 6px; padding: 4px 7px; min-height: 40px; }
  .asset-row .asset-icon { width: 23px; height: 23px; }
  .asset-copy small, .asset-value { display: none; }
  .chart-panel { padding: 12px; }
  .plot { flex-basis: 165px; min-height: 165px; }
  .chart-foot { padding-top: 7px; }
  .order-panel { padding: 13px; }
  .order-sides { margin: 12px 0; }
  .stats { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .stat { padding: 11px; }
  th, td { padding: 10px; }
}
