@font-face {
  font-family: Inter;
  src: url('/assets/inter.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --background: #0e1116;
  --panel: #151a22;
  --raised: #1a202a;
  --field: #10141b;
  --border: #2a313e;
  --muted: #a0acbe;
  --soft: #77869c;
  --text: #f0f3f8;
  --accent: #b9ef79;
  --up: #79dcae;
  --down: #fb969d;
  --font: Inter, system-ui, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--background); color: var(--text); font: 13px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .48; cursor: not-allowed; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }

.topbar {
  min-height: 67px;
  position: sticky;
  z-index: 4;
  top: 0;
  display: flex;
  align-items: center;
  gap: 45px;
  padding: 0 clamp(20px, 3vw, 48px);
  border-bottom: 1px solid var(--border);
  background: #10141c;
}
.brand { display: inline-flex; align-items: center; gap: 9px; font-size: 19px; font-weight: 800; letter-spacing: -.65px; white-space: nowrap; }
.brand-mark { width: 25px; height: 20px; background: var(--accent); clip-path: polygon(0 100%, 41% 0, 65% 0, 25% 100%, 46% 100%, 86% 0, 100% 0, 61% 100%); }
.brand-period { color: var(--accent); margin-left: -8px; }
.main-nav { display: flex; align-self: stretch; gap: 28px; }
.main-nav a { display: grid; place-items: center; position: relative; color: var(--muted); white-space: nowrap; }
.main-nav a:hover, .main-nav a.active { color: var(--text); }
.main-nav a.active::after { content: ''; height: 2px; background: var(--accent); position: absolute; inset: auto 0 0; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 11px; }
.top-balance { display: grid; min-width: 104px; max-width: 166px; padding: 4px 12px 4px 0; text-align: right; border-right: 1px solid var(--border); }
.top-balance span { font-size: 10px; color: #aebdab; white-space: nowrap; }
.top-balance strong { font-size: 17px; line-height: 1.25; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-balance:hover strong { color: var(--accent); }
.top-deposit { min-width: 74px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 36px; padding: 7px 13px; border: 1px solid transparent; border-radius: 7px; font-weight: 600; white-space: nowrap; }
.button.primary { background: var(--accent); color: #182412; }
.button.primary:not(:disabled):hover { background: #c9fa98; }
.button.subdued { background: #212834; border-color: #353e4e; }
.button.subdued:not(:disabled):hover { background: #2a3442; }
.button.subtle { background: transparent; color: var(--muted); }
.button.subtle:hover { color: var(--text); }
.text-button { border: 0; background: transparent; color: #b6c8aa; padding: 0; font-size: 12px; }
.text-button:hover { color: var(--accent); }

.workspace { width: min(100%, 1630px); padding: 28px 32px 24px; margin: 0 auto; }
.workspace-header { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 19px; }
.workspace-header h1 { font-size: clamp(24px, 2.35vw, 35px); font-weight: 640; letter-spacing: -.045em; }
.workspace-header p { color: var(--muted); margin-top: 2px; }
.ticker-strip { display: flex; overflow-x: auto; margin-bottom: 12px; border: 1px solid var(--border); border-radius: 11px; background: #131923; scrollbar-width: thin; scrollbar-color: #3b4a58 #131923; }
.ticker-item { display: grid; flex: 1 0 144px; grid-template-rows: auto auto; gap: 4px; padding: 9px 13px; border: 0; border-right: 1px solid var(--border); background: transparent; text-align: left; white-space: nowrap; }
.ticker-item:last-child { border-right: 0; }
.ticker-item:hover { background: #202b37; }
.ticker-item:focus-visible { outline-offset: -3px; }
.ticker-item[aria-current="true"] { background: #202f32; box-shadow: inset 0 -2px var(--accent); }
.ticker-item strong { color: #e0e9f3; font-size: 11px; font-weight: 630; }
.ticker-label { display: flex; align-items: center; gap: 7px; }
.ticker-label .instrument-icon { width: 20px; height: 20px; border-radius: 5px; font-size: 9px; }
.ticker-values { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; font-variant-numeric: tabular-nums; }
.ticker-price { color: var(--text); font-size: 13px; font-weight: 600; }
.ticker-change { color: var(--muted); font-size: 10px; }
.desk { display: grid; grid-template-columns: 232px minmax(360px, 1fr) 292px; align-items: stretch; gap: 12px; }
.panel { min-width: 0; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 17px; }
.panel-heading h2, .balance-label h2 { font-size: 14px; font-weight: 620; }
.panel-count { color: var(--soft); font: 11px var(--font); }
.segmented { display: flex; gap: 3px; padding: 3px; border: 1px solid #29313d; border-radius: 7px; background: var(--field); }
.segmented button { color: var(--muted); min-height: 28px; border: 0; border-radius: 5px; padding: 3px 10px; background: transparent; font-size: 12px; white-space: nowrap; }
.segmented button:hover { color: var(--text); }
.segmented button[aria-pressed="true"] { background: #303b4b; color: #f1f4f8; font-weight: 600; }
.watch-panel { display: flex; flex-direction: column; }
.watch-tabs { flex-wrap: wrap; margin: 0 14px 13px; }
.watch-tabs button { flex: 1; padding-inline: 6px; }
.search-field {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 14px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--field);
  color: var(--muted);
}
.search-icon { width: 11px; height: 11px; border: 1px solid currentColor; border-radius: 50%; position: relative; flex: 0 0 auto; }
.search-icon::after { content: ''; width: 5px; height: 1px; background: currentColor; position: absolute; left: 8px; top: 9px; transform: rotate(45deg); }
.search-field input { width: 100%; min-width: 0; height: 35px; padding: 0; color: var(--text); background: transparent; border: 0; outline: 0; font-size: 12px; }
.search-field:focus-within { border-color: #719656; }
.search-field input::placeholder { color: var(--soft); }
.watch-columns { display: flex; justify-content: space-between; padding: 14px 14px 8px; color: var(--soft); font-size: 10px; }
.watch-list { min-height: 320px; max-height: 436px; overflow: auto; scrollbar-width: thin; scrollbar-color: #394253 transparent; }
.watch-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 51px;
  padding: 7px 12px;
  color: inherit;
  border: 0;
  border-left: 2px solid transparent;
  text-align: left;
  background: transparent;
}
.watch-row:hover { background: #242b36; }
.watch-row.active { background: #242e2b; border-left-color: var(--accent); }
.instrument-icon {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  color: var(--symbol-color, #d5dce9);
  background: color-mix(in srgb, var(--symbol-color, #d5dce9) 16%, #171b24);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -.035em;
}
.instrument-icon.large { width: 43px; height: 43px; border-radius: 11px; font-size: 18px; }
.instrument-icon.fx { font-size: 10px; }
.instrument-icon.fx.large { font-size: 13px; }
.instrument-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; border-radius: inherit; padding: 2px; background: #f8f9fc; }
.instrument-icon.fx .instrument-image { inset: 14% auto auto 6%; width: 62%; height: 62%; padding: 0; border: 1px solid #202a37; border-radius: 50%; object-fit: cover; }
.instrument-icon.fx .instrument-image:last-of-type { inset: auto 5% 10% auto; }
.watch-name, .watch-price { min-width: 0; }
.watch-name strong, .watch-price strong { display: block; font-size: 12px; font-weight: 580; }
.watch-name small, .watch-price small { display: block; margin-top: 2px; font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.watch-price { text-align: right; font-variant-numeric: tabular-nums; }
.up { color: var(--up) !important; }
.down { color: var(--down) !important; }
.watch-footer { margin-top: auto; padding: 14px 15px; border-top: 1px solid var(--border); color: var(--muted); font-size: 11px; }
.watch-footer:hover { color: var(--accent); }
.watch-footer span { float: right; }
.no-results { padding: 25px 16px; color: var(--muted); }

.chart-panel { display: flex; flex-direction: column; overflow: hidden; container: chart-panel / inline-size; }
.instrument-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px; background: linear-gradient(115deg, #1b2530, #161d27 60%); }
.instrument-identity { display: flex; align-items: center; gap: 11px; min-width: 0; }
.instrument-identity h2 { font-size: 20px; line-height: 1.25; font-weight: 650; letter-spacing: -.022em; }
.instrument-subtitle { color: var(--muted); font-size: 11px; margin-top: 3px; }
.instrument-price { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.instrument-price strong { display: block; font-size: clamp(20px, 2.25vw, 32px); font-weight: 640; line-height: 1.2; letter-spacing: -.045em; }
.instrument-price span { display: block; margin-top: 5px; font-size: 11px; color: var(--muted); }
.chart-meta { min-height: 29px; padding: 0 18px 11px; border-bottom: 1px solid var(--border); background: linear-gradient(115deg, #1b2530, #161d27 60%); color: var(--muted); font-size: 11px; }
.chart-toolbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px 10px; padding: 10px 15px; border-bottom: 1px solid #242e3b; }
.chart-toolbar h3 { font-size: 12px; font-weight: 590; }
#chart-note { color: var(--soft); font-size: 10px; }
.chart-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.chart-ranges { padding: 2px; }
.chart-ranges button { font-size: 10px; min-height: 23px; padding: 3px 8px; }
.plot-wrap { position: relative; flex: 1; height: clamp(360px, 43vh, 490px); min-height: 325px; }
#plot { position: absolute; inset: 0; overflow: hidden; }
.chart-status { position: absolute; inset: 0; display: flex; justify-content: center; align-items: center; gap: 9px; padding: 16px; background: #151a22e8; color: var(--muted); text-align: center; }
.spinner { display: inline-block; width: 17px; height: 17px; border-radius: 50%; border: 2px solid #414d5b; border-top-color: var(--accent); animation: spin 1s linear infinite; flex: 0 0 auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.chart-stats { display: grid; grid-template-columns: minmax(92px, 1.25fr) repeat(5, minmax(0, 1fr)); min-height: 55px; border-top: 1px solid var(--border); background: #151d28; }
.chart-stats.forex { grid-template-columns: minmax(92px, 1.15fr) repeat(3, minmax(0, 1fr)); }
.chart-stats > div { padding: 9px 13px; border-right: 1px solid var(--border); min-width: 0; }
.chart-stats > div:last-child { border-right: 0; }
.chart-stats span, .chart-stats strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chart-stats span { font-size: 10px; color: var(--soft); }
.chart-stats strong { margin-top: 4px; font-size: 12px; font-weight: 550; font-variant-numeric: tabular-nums; }
.chart-footer { display: flex; gap: 8px; justify-content: space-between; padding: 9px 15px; border-top: 1px solid var(--border); color: var(--soft); font-size: 10px; }
.chart-footer .text-button { font-size: 10px; }

@container chart-panel (max-width: 530px) {
  .chart-stats:not(.forex) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .chart-stats:not(.forex) > div:nth-child(-n+3) { border-bottom: 1px solid var(--border); }
  .chart-stats:not(.forex) > div:nth-child(3) { border-right: 0; }
}

.order-column { display: flex; flex-direction: column; gap: 12px; }
.order-panel { padding: 0 16px 16px; }
.order-panel .panel-heading { padding: 16px 0 13px; }
.order-instrument { display: flex; align-items: baseline; gap: 8px; margin-bottom: 15px; }
.order-instrument strong { font-size: 13px; }
.order-instrument span { color: var(--muted); font-size: 11px; }
.order-side { margin-bottom: 16px; }
.order-side button { flex: 1; min-height: 33px; font-weight: 580; }
.order-side button[data-side="buy"][aria-pressed="true"] { color: #bff0c9; background: #233b32; }
.order-side button[data-side="sell"][aria-pressed="true"] { color: #ffdce1; background: #482c35; }
.field-label { color: #c3cbd9; font-size: 12px; font-weight: 550; display: block; margin: 0 0 7px; }
.field { display: flex; align-items: center; gap: 9px; border: 1px solid #354050; border-radius: 7px; background: var(--field); padding: 0 11px; }
.field:focus-within { border-color: #8aa966; }
.field input { width: 100%; height: 43px; min-width: 0; background: transparent; border: 0; outline: 0; padding: 0; }
.field input::placeholder { color: var(--soft); }
.field > span { color: var(--muted); font-size: 11px; }
.dark-select {
  display: block;
  width: 100%;
  min-height: 40px;
  padding: 6px 10px;
  border: 1px solid #354050;
  border-radius: 7px;
  background: var(--field);
  color: var(--text);
  font: inherit;
}
.dark-select:focus-visible { outline-offset: 1px; }
.stacked-label { margin-top: 14px; }
.paired-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.paired-fields .dark-select, .paired-fields .field, .entry-field .field { margin-top: 6px; }
.margin-fields { margin-bottom: 13px; }
.entry-field { margin: 10px 0 0; }
.protection-fields { margin: 0 0 7px; }
.protection-fields input { height: 36px; font-size: 12px; }
.account-control { min-width: 142px; width: min(230px, 48vw); }
.account-control .field-label { margin-bottom: 3px; color: var(--muted); font-size: 11px; }
.quantity-row { display: flex; justify-content: space-between; align-items: start; gap: 8px; min-height: 27px; padding-top: 6px; font-size: 10px; color: var(--soft); }
.quantity-row button { font-size: 10px; }
.order-preview { display: grid; gap: 9px; padding: 12px 0; border-top: 1px solid var(--border); }
.order-preview > div, .receipt-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; color: var(--muted); font-size: 11px; }
.order-preview strong, .receipt-row strong { color: var(--text); font-variant-numeric: tabular-nums; font-weight: 580; text-align: right; }
.action-button { min-height: 42px; width: 100%; }
.order-caption { text-align: center; color: var(--soft); font-size: 10px; margin-top: 9px; }
.buying-panel { flex: 1; padding: 17px 16px; }
.balance-label { display: flex; align-items: center; justify-content: space-between; }
.balance-label > span { font-size: 10px; color: var(--soft); }
.balance-value { display: block; font-variant-numeric: tabular-nums; font-weight: 580; letter-spacing: -.035em; font-size: 26px; margin-top: 8px; }
.buying-panel p { font-size: 11px; color: var(--muted); margin-top: 2px; }
.balance-actions { display: flex; gap: 7px; margin-top: 15px; }
.balance-actions button { flex: 1; font-size: 11px; }
.inline-error { margin: 8px 0; color: #ffb4b9; background: #37242a; border-radius: 6px; padding: 8px 9px; font-size: 12px; }
.activity-panel { margin-top: 12px; }
.activity-panel .panel-heading { border-bottom: 1px solid var(--border); }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; text-align: left; white-space: nowrap; }
.data-table th { padding: 11px 17px; color: var(--soft); font-size: 10px; font-weight: 550; }
.data-table td { padding: 13px 17px; border-top: 1px solid var(--border); font-size: 12px; font-variant-numeric: tabular-nums; }
.data-table td small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.data-table tbody tr:hover { background: #ffffff03; }
.data-table td.numeric, .data-table th.numeric { text-align: right; }
.data-table th [data-market-sort] { padding: 0; border: 0; background: transparent; color: var(--muted); font-size: inherit; font-weight: inherit; }
.data-table th [data-market-sort]:hover, .data-table th[aria-sort] [data-market-sort] { color: var(--text); }
.data-table th [data-market-sort]::after { content: '↕'; display: inline-block; min-width: 9px; margin-left: 5px; color: var(--soft); text-align: center; }
.data-table th[aria-sort="ascending"] [data-market-sort]::after { content: '↑'; color: var(--accent); }
.data-table th[aria-sort="descending"] [data-market-sort]::after { content: '↓'; color: var(--accent); }
.empty { padding: 26px 17px; color: var(--muted); font-size: 12px; }
.status-label { color: var(--up); font-size: 11px; }

.page-view { min-height: 66vh; width: min(100%, 1250px); }
.welcome-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, .94fr);
  align-items: center;
  gap: clamp(24px, 4vw, 57px);
  margin-top: clamp(12px, 3.6vw, 48px);
  padding: clamp(28px, 5vw, 70px);
  border: 1px solid #2b3b36;
  border-radius: 22px;
  background:
    radial-gradient(ellipse at 82% 28%, #254438b8, transparent 65%),
    linear-gradient(145deg, #161f22, #10141a 69%);
}
.welcome-copy h1 {
  color: #f3f7f4;
  font-size: clamp(37px, 5.4vw, 72px);
  font-weight: 660;
  line-height: 1.04;
  letter-spacing: -.062em;
}
.welcome-copy h1 span { display: block; color: var(--accent); }
.welcome-copy p { max-width: 35ch; margin-top: 21px; color: #b9c7c4; font-size: clamp(16px, 1.45vw, 18px); }
.welcome-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 24px; }
.welcome-actions .button { min-height: 44px; padding-inline: 19px; }
.welcome-market { min-width: 0; overflow: hidden; border-color: #3e544d; background: #131c22; box-shadow: 0 18px 38px #0a101353; }
.welcome-market > .panel-heading { border-bottom: 1px solid #293c39; }
.welcome-market .panel-heading h2 { font-size: 14px; }
.welcome-quote {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  gap: 9px;
  padding: 14px;
}
.welcome-quote:hover { background: #263737; }
.welcome-quote:focus-visible { outline-offset: -3px; }
.quote-identity { display: flex; align-items: center; min-width: 0; gap: 9px; }
.quote-identity > span:last-child { min-width: 0; }
.welcome-quote strong, .welcome-quote small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.welcome-quote small { color: #a8b6be; font-size: 11px; }
.welcome-quote-value { text-align: right; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.featured-quote { padding: 16px 17px 9px; }
.featured-quote .quote-identity strong { font-size: 16px; }
.featured-quote .welcome-quote-value strong { font-size: clamp(18px, 2.2vw, 27px); font-weight: 590; letter-spacing: -.04em; }
.welcome-chart { padding: 0 16px 13px; }
.welcome-chart canvas {
  display: block;
  width: 100%;
  height: clamp(100px, 12vw, 160px);
  background:
    repeating-linear-gradient(0deg, transparent 0 calc(25% - 1px), #b8d9c21a calc(25% - 1px) 25%),
    repeating-linear-gradient(90deg, transparent 0 calc(16.66% - 1px), #b8d9c219 calc(16.66% - 1px) 16.66%);
}
.welcome-chart p { margin: 6px 0 0; color: #a9bebc; font-size: 11px; }
.welcome-indices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid #293c39; }
.welcome-indices .welcome-quote + .welcome-quote { border-left: 1px solid #293c39; }
.page-title { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin: 8px 0 22px; }
.page-title h1 { font-size: clamp(26px, 3vw, 39px); letter-spacing: -.045em; font-weight: 640; }
.page-title p { color: var(--muted); margin-top: 3px; }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 18px; }
.stat-card { padding: 18px 20px; }
.stat-card span { display: block; color: var(--muted); font-size: 12px; }
.stat-card strong { display: block; margin-top: 5px; font-size: 25px; font-weight: 580; letter-spacing: -.028em; font-variant-numeric: tabular-nums; }
.page-block { margin: 12px 0; }
.page-block > .panel-heading { border-bottom: 1px solid var(--border); }
.market-tools { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 13px 15px; border-bottom: 1px solid var(--border); }
.market-tools .search-field { width: min(285px, 48%); margin: 0; }
.table-symbol { display: flex; align-items: center; gap: 9px; border: 0; background: transparent; color: inherit; padding: 0; text-align: left; }
.table-symbol:hover strong { color: var(--accent); }
.table-symbol strong { font-weight: 580; }
.cash-panel { padding: 22px; }
.cash-panel p { color: var(--muted); margin-top: 7px; }
.cash-panel .balance-value { font-size: clamp(27px, 3vw, 39px); margin-top: 14px; }
.cash-panel h2 { font-size: 16px; }
.accounts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); gap: 12px; }
.account-card {
  position: relative;
  padding: 20px;
  background: linear-gradient(145deg, #1f2a2a 0, var(--panel) 49%);
}
.account-card.selected-account { border-color: #65805d; }
.account-card-top, .account-card-reserved {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
}
.account-card-top span:first-child {
  color: #daead4;
  background: #2b3c36;
  border: 1px solid #40594c;
  border-radius: 5px;
  padding: 3px 8px;
  font-weight: 620;
}
.account-card h2 { margin-top: 12px; font-size: 19px; letter-spacing: -.02em; overflow-wrap: anywhere; }
.account-card p { color: var(--muted); margin-top: 4px; }
.account-card-balance { display: grid; gap: 3px; margin-top: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.account-card-balance span { color: var(--muted); font-size: 11px; }
.account-card-balance strong { font-size: clamp(23px, 3vw, 30px); letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.account-card-reserved { padding: 10px 0 0; }
.account-card-reserved span:last-child { color: var(--text); font-variant-numeric: tabular-nums; }
.account-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.signin-layout {
  width: min(100%, 820px);
  margin: clamp(26px, 7vw, 96px) auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, .95fr);
  align-items: center;
  gap: clamp(18px, 5vw, 62px);
}
.signin-intro h1 { font-size: clamp(30px, 4.5vw, 54px); line-height: 1.05; letter-spacing: -.055em; font-weight: 640; }
.signin-intro p { color: var(--muted); margin-top: 13px; }
.signin-panel { padding: clamp(18px, 3vw, 29px); background: linear-gradient(145deg, #1d2927, var(--panel) 55%); }
.signin-panel .small-note { margin-top: 15px; }
.row-actions > button + button { margin-left: 9px; }
.title-case { text-transform: capitalize; }
.funds-tabs {
  display: flex;
  gap: 21px;
  margin-bottom: 15px;
  border-bottom: 1px solid var(--border);
  overflow: auto;
  scrollbar-width: thin;
}
.funds-tabs a { color: var(--muted); padding: 9px 1px 11px; white-space: nowrap; border-bottom: 2px solid transparent; }
.funds-tabs a:hover, .funds-tabs a[aria-current="page"] { color: var(--text); }
.funds-tabs a[aria-current="page"] { border-bottom-color: var(--accent); }
.deposit-layout { display: grid; align-items: stretch; gap: 14px; grid-template-columns: minmax(248px, .78fr) minmax(285px, 1.05fr); max-width: 1020px; }
.deposit-layout:has(> :only-child) { display: block; }
.funding-method-panel { max-width: 565px; }
.funding-method-card {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 13px 0;
  padding: 12px;
  background: var(--field);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.funding-method-card small, .card-option small { display: block; margin-top: 1px; color: var(--muted); font-size: 12px; }
.virtual-card-mark {
  position: relative;
  width: 52px;
  height: 34px;
  flex: 0 0 auto;
  border: 1px solid #5c856b;
  border-radius: 5px;
  background: linear-gradient(126deg, #36594a, #244236 65%, #172e28);
}
.virtual-card-mark.card-blue { border-color: #64799d; background: linear-gradient(126deg, #425978, #292f53 70%); }
.virtual-card-mark.card-empty { border-style: dashed; border-color: #617284; background: transparent; }
.virtual-card-mark i { position: absolute; top: 8px; left: 7px; width: 11px; height: 8px; border: 1px solid #c5daac9c; border-radius: 2px; background: #b4cd865c; }
.virtual-card-mark b { position: absolute; right: 7px; bottom: 7px; width: 13px; border-bottom: 2px solid #b6d4c4a3; }
.card-choices { display: grid; min-width: 0; gap: 9px; margin: 0; padding: 0; border: 0; }
.card-option {
  display: flex;
  align-items: center;
  gap: 11px;
  cursor: pointer;
  padding: 11px;
  border: 1px solid #344353;
  border-radius: 8px;
  background: var(--field);
}
.card-option:hover { border-color: #657e70; }
.card-option:has(input:checked) { border-color: #80a96c; background: #1e2a25; }
.card-option input { accent-color: var(--accent); width: 16px; height: 16px; margin: 0; }
.deposit-panel {
  max-width: 680px;
  display: grid;
  grid-template-columns: minmax(0, .85fr) minmax(0, 1fr);
  align-items: center;
  gap: 24px;
}
.deposit-summary { padding: 17px; background: #1e2a26; border: 1px solid #40594c; border-radius: 8px; }
.deposit-summary .balance-value { margin-top: 5px; }
.deposit-summary p { font-size: 12px; margin-top: 2px; }
.deposit-action .fund-form { margin-top: 0; }
.deposit-action .deposit-instruction { margin: 0 0 9px; font-size: 12px; }
.deposit-complete { display: grid; justify-items: start; gap: 8px; }
.fund-form { margin-top: 15px; }
.fund-form .action-button { margin-top: 14px; }
.transfer-panel { max-width: 680px; }
.history-account { width: min(182px, 50%); }
.page-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px clamp(20px, 3vw, 48px) 22px; color: var(--soft); font-size: 11px; }
.page-footer .text-button { font-size: 11px; }
dialog { width: min(460px, calc(100% - 30px)); max-height: calc(100dvh - 30px); padding: 0; color: var(--text); background: var(--panel); border: 1px solid #3a4556; border-radius: 14px; box-shadow: 0 24px 80px #0009; }
dialog::backdrop { background: #07090dbb; backdrop-filter: blur(3px); }
.dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.dialog-header h2 { font-size: 20px; letter-spacing: -.025em; font-weight: 620; }
.icon-button { border: 1px solid transparent; background: transparent; color: var(--muted); width: 30px; height: 30px; font-size: 24px; line-height: 1; border-radius: 6px; }
.icon-button:hover { background: #29313f; }
#dialog-body { padding: 19px 20px 21px; }
.dialog-note { color: var(--muted); font-size: 12px; margin-bottom: 14px; }
.dialog-note:last-child { margin: 14px 0 0; }
.dialog-form .field-label:not(:first-child) { margin-top: 14px; }
.dialog-form .action-button { margin-top: 14px; }
.receipt-row { font-size: 13px; border-bottom: 1px solid var(--border); padding: 9px 0; }
.receipt-row:last-of-type { margin-bottom: 14px; }
.auth-switch { margin-top: 14px; color: var(--muted); font-size: 12px; }
.auth-switch button { margin-left: 5px; }
.small-note { color: var(--soft); font-size: 11px; }
.data-links { display: grid; gap: 8px; margin: 12px 0; }
.data-links a { color: #badaaa; text-decoration: underline; text-underline-offset: 2px; }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 8; width: min(360px, calc(100% - 44px)); padding: 13px 15px; background: #24342d; box-shadow: 0 10px 30px #0007; border: 1px solid #49644f; border-radius: 8px; }
.toast.error { background: #402831; border-color: #784651; }
.toast strong, .toast span { display: block; }
.toast span { margin-top: 3px; color: #c6d4ca; font-size: 11px; }

@media (max-width: 1160px) {
  .workspace { padding-inline: 20px; }
  .desk { grid-template-columns: 190px minmax(310px, 1fr) 265px; gap: 9px; }
  .topbar { gap: 28px; }
  .main-nav { gap: 20px; }
}

@media (max-width: 900px) {
  .desk { grid-template-columns: minmax(0, 1fr) 265px; }
  .watch-panel { grid-column: 1 / -1; }
  .watch-panel .panel-heading { padding: 11px 14px; }
  .watch-list { min-height: 0; max-height: 108px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .watch-tabs { width: fit-content; }
  .watch-columns, .watch-footer { display: none; }
  .watch-panel .search-field { margin-bottom: 10px; }
  .watch-row { border-top: 1px solid var(--border); }
  .plot-wrap { min-height: 330px; }
  .topbar { gap: 19px; padding-inline: 16px; }
  .top-actions { gap: 5px; }
  .welcome-hero { padding: 25px; gap: 22px; }
  .welcome-copy h1 { font-size: clamp(36px, 6.5vw, 55px); }
  .welcome-indices { grid-template-columns: 1fr; }
  .welcome-indices .welcome-quote + .welcome-quote { border-left: 0; border-top: 1px solid #293c39; }
}

@media (max-width: 780px) {
  .topbar { flex-wrap: wrap; gap: 0 9px; padding-top: 7px; min-height: 0; }
  .main-nav { order: 3; width: 100%; justify-content: space-between; gap: 12px; margin-top: 3px; }
  .main-nav a { height: 39px; }
  .deposit-layout { grid-template-columns: 1fr; }
  .deposit-layout .funding-method-panel { max-width: 680px; }
}

@media (max-width: 640px) {
  .topbar { flex-wrap: wrap; gap: 0 9px; padding: 7px 13px 0; min-height: 0; }
  .brand { font-size: 15px; gap: 7px; }
  .brand-mark { width: 20px; height: 16px; }
  .brand-period { margin-left: -6px; }
  .top-actions { gap: 3px; }
  .top-actions .button { min-height: 34px; padding: 4px 7px; font-size: 11px; }
  .top-balance { min-width: 0; max-width: 94px; padding-right: 6px; }
  .top-balance span { font-size: 9px; }
  .top-balance strong { font-size: 15px; }
  .top-deposit { min-width: 0; }
  .main-nav a { height: 35px; font-size: 11px; }
  .workspace { padding: 16px 12px; }
  .welcome-hero { grid-template-columns: 1fr; margin-top: 3px; padding: 22px 15px 15px; gap: 23px; border-radius: 15px; }
  .welcome-copy { padding-inline: 4px; }
  .welcome-copy h1 { font-size: clamp(33px, 8.6vw, 51px); }
  .welcome-copy p { margin-top: 12px; }
  .welcome-actions { margin-top: 17px; }
  .welcome-actions .button { padding-inline: 13px; }
  .welcome-quote { padding-block: 9px; }
  .welcome-chart canvas { height: 104px; }
  .workspace-header { margin-bottom: 14px; align-items: end; }
  .workspace-header h1 { font-size: 23px; }
  .workspace-header p { font-size: 10px; }
  .workspace-header .button { font-size: 10px; padding-inline: 8px; min-height: 32px; }
  .ticker-item { flex-basis: 124px; padding-inline: 10px; }
  .desk { grid-template-columns: 1fr; }
  .watch-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .watch-row { padding: 6px 7px; gap: 6px; }
  .watch-row .instrument-icon { width: 23px; height: 23px; border-radius: 6px; font-size: 10px; }
  .watch-name strong, .watch-price strong { font-size: 10px; }
  .watch-name small, .watch-price small { font-size: 9px; }
  .instrument-header { padding: 13px 12px; }
  .instrument-identity { gap: 8px; }
  .instrument-icon.large { width: 35px; height: 35px; font-size: 14px; }
  .instrument-identity h2 { font-size: 18px; }
  .instrument-subtitle, .chart-meta { font-size: 10px; }
  .chart-meta { padding-inline: 12px; }
  .chart-toolbar, .chart-footer { padding-inline: 12px; }
  .plot-wrap { min-height: 260px; height: 280px; }
  .chart-stats > div { padding-inline: 7px; }
  .chart-stats span { font-size: 9px; }
  .chart-stats strong { font-size: 10px; }
  .order-column { gap: 9px; }
  .stat-grid { gap: 6px; }
  .stat-card { padding: 12px 9px; }
  .stat-card span { font-size: 9px; }
  .stat-card strong { font-size: clamp(13px, 4.4vw, 21px); }
  .signin-layout, .deposit-panel { grid-template-columns: 1fr; gap: 14px; }
  .signin-intro p { margin-top: 7px; }
  .cash-panel { padding: 17px; }
  .funds-tabs { gap: 13px; font-size: 12px; }
  .dark-select, .fund-form input, #order-form input, .dialog-form input { font-size: 16px; }
  .workspace-header .dark-select, .page-title .dark-select, .history-account .dark-select { min-width: 0; padding-inline: 5px; }
  .page-title .button { font-size: 11px; padding-inline: 8px; }
  .page-title { margin-top: 3px; align-items: center; }
  .page-title p { font-size: 11px; }
  .market-tools { flex-wrap: wrap; padding: 10px; }
  .market-tools .segmented { flex-wrap: wrap; }
  .market-tools .search-field { width: 100%; }
  .page-footer { padding-inline: 12px; }
}

@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }
