:root {
  --bg: #080a0b;
  --surface: rgba(18, 20, 21, 0.88);
  --surface-solid: #121415;
  --surface-high: #181b1c;
  --line: rgba(255, 255, 255, 0.075);
  --line-strong: rgba(255, 255, 255, 0.13);
  --text: #f3f1e9;
  --muted: #8d9290;
  --muted-strong: #b3b6b2;
  --gold: #d6ac56;
  --gold-light: #f1d48f;
  --gold-dark: #8d6a2d;
  --green: #45c991;
  --green-soft: rgba(69, 201, 145, 0.12);
  --red: #f06e70;
  --red-soft: rgba(240, 110, 112, 0.12);
  --blue: #6da6e8;
  --radius: 20px;
  --radius-small: 13px;
  --shadow: 0 24px 65px rgba(0, 0, 0, 0.33);
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
  background: var(--bg);
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

a {
  color: inherit;
  text-decoration: none;
}

svg {
  display: block;
}

.hidden {
  display: none !important;
}

.login-body {
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 52% 12%, rgba(214, 172, 86, 0.09), transparent 30rem),
    repeating-linear-gradient(90deg, transparent 0, transparent 79px, rgba(255, 255, 255, 0.018) 80px),
    repeating-linear-gradient(0deg, transparent 0, transparent 79px, rgba(255, 255, 255, 0.018) 80px),
    var(--bg);
}

.login-shell {
  position: relative;
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 32px 20px;
}

.login-shell::before,
.login-shell::after {
  position: fixed;
  width: 280px;
  height: 1px;
  content: "";
  background: linear-gradient(90deg, transparent, rgba(214, 172, 86, 0.45), transparent);
}

.login-shell::before {
  top: 18%;
  left: -65px;
  rotate: 46deg;
}

.login-shell::after {
  right: -65px;
  bottom: 17%;
  rotate: -46deg;
}

.login-card {
  position: relative;
  width: min(100%, 480px);
  overflow: hidden;
  padding: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 28px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.035), transparent 40%),
    rgba(14, 16, 17, 0.94);
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.62);
  isolation: isolate;
}

.login-card::after {
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  content: "";
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.055);
}

.login-glow {
  position: absolute;
  z-index: -1;
  top: -180px;
  right: -120px;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  background: rgba(214, 172, 86, 0.08);
  filter: blur(60px);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 15px;
}

.brand-lockup h1 {
  margin: 1px 0 0;
  font-size: 23px;
  line-height: 1;
  letter-spacing: -0.04em;
}

.brand-lockup h1 span,
.overview-heading h2 span {
  color: var(--gold-light);
}

.brand-mark {
  position: relative;
  display: grid;
  width: 50px;
  height: 50px;
  flex: 0 0 50px;
  place-items: center;
  border: 1px solid rgba(214, 172, 86, 0.45);
  border-radius: 50%;
  color: var(--gold-light);
  font-family: Georgia, serif;
  font-size: 25px;
  background: rgba(214, 172, 86, 0.055);
  box-shadow: inset 0 0 0 5px var(--bg);
}

.brand-mark::before,
.brand-mark::after {
  position: absolute;
  content: "";
  background: var(--gold);
  opacity: 0.65;
}

.brand-mark::before {
  width: 1px;
  height: 8px;
  top: -5px;
  left: 24px;
}

.brand-mark::after {
  width: 8px;
  height: 1px;
  top: 24px;
  right: -5px;
}

.brand-mark span {
  transform: translateY(-1px);
}

.eyebrow,
.section-kicker,
.panel-eyebrow {
  margin: 0;
  color: var(--gold);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.16em;
}

.brand-lockup .eyebrow {
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 0.19em;
}

.login-copy {
  margin: 64px 0 34px;
}

.login-copy h2 {
  max-width: 360px;
  margin: 10px 0 14px;
  font-size: clamp(28px, 7vw, 39px);
  line-height: 1.08;
  letter-spacing: -0.055em;
}

.login-copy > p:last-child {
  max-width: 390px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.login-form label {
  display: block;
  margin: 0 0 9px;
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 650;
}

.password-wrap {
  position: relative;
}

.password-wrap input {
  width: 100%;
  height: 55px;
  padding: 0 54px 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-small);
  outline: none;
  color: var(--text);
  background: rgba(255, 255, 255, 0.035);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.password-wrap input::placeholder {
  color: #606563;
}

.password-wrap input:focus {
  border-color: rgba(214, 172, 86, 0.66);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 0 4px rgba(214, 172, 86, 0.075);
}

.icon-button {
  display: grid;
  width: 38px;
  height: 38px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 10px;
  color: var(--muted);
  cursor: pointer;
  background: transparent;
  transition: color 160ms ease, background 160ms ease, transform 160ms ease;
}

.icon-button:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.055);
}

.icon-button:active {
  transform: scale(0.94);
}

.icon-button svg {
  width: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.password-wrap .icon-button {
  position: absolute;
  top: 8px;
  right: 8px;
}

.form-error {
  min-height: 20px;
  margin: 8px 0 4px;
  color: var(--red);
  font-size: 12px;
}

.primary-button {
  display: flex;
  width: 100%;
  height: 54px;
  align-items: center;
  justify-content: space-between;
  padding: 0 17px 0 19px;
  border: 0;
  border-radius: var(--radius-small);
  color: #15120c;
  cursor: pointer;
  background: linear-gradient(105deg, #c9983f, #eccd82);
  box-shadow: 0 13px 30px rgba(214, 172, 86, 0.13);
  font-size: 13px;
  font-weight: 750;
  transition: transform 160ms ease, filter 160ms ease, box-shadow 160ms ease;
}

.primary-button:hover {
  filter: brightness(1.06);
  box-shadow: 0 16px 34px rgba(214, 172, 86, 0.2);
  transform: translateY(-1px);
}

.primary-button:disabled {
  cursor: wait;
  filter: saturate(0.5);
  opacity: 0.7;
  transform: none;
}

.primary-button svg {
  width: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.secure-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 25px;
  color: #727775;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pulse-dot {
  position: relative;
  display: inline-block;
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: currentColor;
}

.pulse-dot::after {
  position: absolute;
  inset: -4px;
  border: 1px solid currentColor;
  border-radius: 50%;
  content: "";
  opacity: 0.35;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(0.65); opacity: 0; }
  50% { transform: scale(1); opacity: 0.38; }
}

.dashboard-body {
  min-height: 100vh;
  overflow-x: hidden;
  background:
    linear-gradient(rgba(255, 255, 255, 0.012) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.012) 1px, transparent 1px),
    var(--bg);
  background-size: 80px 80px;
}

.ambient {
  position: fixed;
  z-index: -1;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(100px);
}

.ambient-one {
  top: -220px;
  right: 3vw;
  width: 520px;
  height: 520px;
  background: rgba(214, 172, 86, 0.08);
}

.ambient-two {
  top: 52%;
  left: -220px;
  width: 480px;
  height: 480px;
  background: rgba(64, 115, 105, 0.045);
}

.topbar {
  position: sticky;
  z-index: 50;
  top: 0;
  display: flex;
  height: 79px;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(24px, calc((100vw - 1440px) / 2));
  border-bottom: 1px solid var(--line);
  background: rgba(8, 10, 11, 0.82);
  backdrop-filter: blur(22px);
}

.brand-lockup.compact .brand-mark {
  width: 39px;
  height: 39px;
  flex-basis: 39px;
  font-size: 19px;
  box-shadow: inset 0 0 0 4px var(--bg);
}

.brand-lockup.compact .brand-mark::before {
  top: -4px;
  left: 18px;
  height: 7px;
}

.brand-lockup.compact .brand-mark::after {
  top: 18px;
  right: -4px;
  width: 7px;
}

.brand-lockup.compact h1 {
  font-size: 18px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.connection-pill,
.count-chip {
  display: inline-flex;
  height: 34px;
  align-items: center;
  gap: 8px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 99px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.025);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.connection-pill.online {
  border-color: rgba(69, 201, 145, 0.2);
  color: var(--green);
  background: var(--green-soft);
}

.connection-pill.offline {
  border-color: rgba(240, 110, 112, 0.2);
  color: var(--red);
  background: var(--red-soft);
}

.ghost-button {
  display: inline-flex;
  height: 38px;
  align-items: center;
  gap: 8px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted-strong);
  background: rgba(255, 255, 255, 0.02);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
  transition: border-color 160ms ease, color 160ms ease, background 160ms ease;
}

.ghost-button:hover {
  border-color: var(--line-strong);
  color: var(--text);
  background: rgba(255, 255, 255, 0.045);
}

.ghost-button svg {
  width: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.top-icon {
  width: 38px;
  height: 38px;
  border: 1px solid transparent;
}

.dashboard-shell {
  width: min(calc(100% - 48px), 1440px);
  margin: 0 auto;
  padding: 50px 0 35px;
}

.overview-heading,
.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.overview-heading {
  margin-bottom: 27px;
}

.overview-heading h2,
.section-heading h2 {
  margin: 9px 0 6px;
  font-size: clamp(26px, 3vw, 39px);
  line-height: 1.05;
  letter-spacing: -0.055em;
}

.overview-heading .muted {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.updated-block {
  min-width: 175px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.018);
  text-align: right;
}

.updated-block span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 10px;
}

.updated-block strong {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.metric-card {
  position: relative;
  min-width: 0;
  min-height: 148px;
  overflow: hidden;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

.metric-card::after {
  position: absolute;
  right: -15px;
  bottom: -43px;
  width: 95px;
  height: 95px;
  border: 1px solid rgba(255, 255, 255, 0.03);
  border-radius: 50%;
  content: "";
}

.metric-card.featured {
  border-color: rgba(214, 172, 86, 0.22);
  background:
    radial-gradient(circle at 100% 100%, rgba(214, 172, 86, 0.1), transparent 60%),
    var(--surface);
}

.metric-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted-strong);
  font-size: 11px;
  font-weight: 600;
}

.metric-tag {
  color: #626765;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.08em;
}

.metric-value {
  overflow: hidden;
  margin-top: 25px;
  font-family: var(--mono);
  font-size: clamp(20px, 1.7vw, 26px);
  font-weight: 700;
  letter-spacing: -0.05em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-value.positive,
.positive-text {
  color: var(--green);
}

.metric-value.negative,
.negative-text {
  color: var(--red);
}

.metric-card p {
  position: relative;
  z-index: 1;
  margin: 9px 0 0;
  overflow: hidden;
  color: #707573;
  font-family: var(--mono);
  font-size: 9px;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 12px;
}

.chart-row {
  margin-bottom: 50px;
}

.span-4 { grid-column: span 4; }
.span-8 { grid-column: span 8; }
.span-12 { grid-column: span 12; }

.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

.panel-header {
  display: flex;
  min-height: 76px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
}

.panel-header h3 {
  margin: 5px 0 0;
  font-size: 16px;
  letter-spacing: -0.025em;
}

.chart-legend {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 10px;
}

.chart-legend span {
  width: 14px;
  height: 2px;
  border-radius: 2px;
  background: var(--gold);
  box-shadow: 0 0 8px rgba(214, 172, 86, 0.4);
}

.chart-wrap {
  position: relative;
  height: 290px;
  padding: 19px 16px 5px;
}

.chart-wrap canvas {
  width: 100%;
  height: 100%;
}

.empty-state {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
}

.chart-footer {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line);
}

.chart-footer > div {
  min-width: 0;
  padding: 16px 19px;
  border-right: 1px solid var(--line);
}

.chart-footer > div:last-child {
  border-right: 0;
}

.chart-footer span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 9px;
}

.chart-footer strong {
  display: block;
  overflow: hidden;
  font-family: var(--mono);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.spread-row {
  margin-bottom: 12px;
}

.spread-header {
  min-height: 86px;
}

.spread-headline {
  display: flex;
  align-items: center;
  gap: 18px;
  text-align: right;
}

.spread-headline > div {
  min-width: 115px;
}

.spread-headline small {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 9px;
}

.market-legends {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 15px;
  margin-top: 10px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
}

.market-legends span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.market-legends i {
  width: 15px;
  height: 2px;
  border-radius: 2px;
}

.market-legends .binance i {
  background: var(--blue);
  box-shadow: 0 0 7px rgba(109, 166, 232, 0.35);
}

.market-legends .bingx i {
  background: var(--gold);
  box-shadow: 0 0 7px rgba(214, 172, 86, 0.35);
}

.market-legends .gap i {
  height: 7px;
  border: 1px solid rgba(214, 172, 86, 0.23);
  background: linear-gradient(90deg, rgba(109, 166, 232, 0.17), rgba(214, 172, 86, 0.17));
}

.market-legends b {
  color: var(--muted-strong);
  font-weight: 600;
}

.spread-live-value {
  color: var(--gold-light);
  font-family: var(--mono);
  font-size: 20px;
}

.spread-live-value.positive {
  color: var(--red);
}

.spread-live-value.negative {
  color: var(--green);
}

.spread-chart-wrap {
  height: 350px;
  background:
    linear-gradient(180deg, rgba(214, 172, 86, 0.018), transparent 52%),
    repeating-linear-gradient(90deg, transparent 0, transparent 119px, rgba(255, 255, 255, 0.012) 120px);
}

.spread-chart-wrap canvas {
  cursor: crosshair;
  touch-action: pan-y;
}

.market-tooltip {
  position: absolute;
  z-index: 5;
  width: 224px;
  padding: 13px 14px;
  border: 1px solid rgba(214, 172, 86, 0.24);
  border-radius: 12px;
  background: rgba(10, 12, 13, 0.95);
  box-shadow: 0 17px 42px rgba(0, 0, 0, 0.48);
  pointer-events: none;
  backdrop-filter: blur(12px);
}

.market-tooltip time {
  display: block;
  margin-bottom: 9px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
}

.market-tooltip > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 24px;
}

.market-tooltip span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted-strong);
  font-size: 9px;
}

.market-tooltip strong {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 650;
  white-space: nowrap;
}

.market-tooltip i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.market-tooltip .binance-dot {
  background: var(--blue);
  box-shadow: 0 0 7px rgba(109, 166, 232, 0.45);
}

.market-tooltip .bingx-dot {
  background: var(--gold);
  box-shadow: 0 0 7px rgba(214, 172, 86, 0.45);
}

.market-tooltip .tooltip-gap-row {
  margin-top: 5px;
  padding-top: 5px;
  border-top: 1px solid var(--line);
}

.market-tooltip #tooltip-gap {
  color: var(--gold-light);
}

.market-tooltip #tooltip-gap.positive {
  color: var(--red);
}

.market-tooltip #tooltip-gap.negative {
  color: var(--green);
}

.spread-footer strong {
  display: flex;
  gap: 5px;
}

.spread-footer strong b {
  overflow: hidden;
  font-weight: 600;
  text-overflow: ellipsis;
}

.spread-footer small {
  display: block;
  margin-top: 5px;
  overflow: hidden;
  color: var(--gold);
  font-family: var(--mono);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-badge,
.feed-state,
.order-status {
  display: inline-flex;
  min-width: 47px;
  height: 24px;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 99px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.025);
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 750;
  letter-spacing: 0.07em;
}

.status-badge.positive,
.feed-state.positive,
.order-status.positive {
  border-color: rgba(69, 201, 145, 0.2);
  color: var(--green);
  background: var(--green-soft);
}

.status-badge.negative,
.feed-state.negative,
.order-status.negative {
  border-color: rgba(240, 110, 112, 0.2);
  color: var(--red);
  background: var(--red-soft);
}

.health-list {
  padding: 8px 20px;
}

.health-row {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 11px;
  padding: 13px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.045);
}

.health-row:last-child {
  border-bottom: 0;
}

.feed-icon {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--gold);
  background: rgba(214, 172, 86, 0.045);
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 750;
}

.health-row strong {
  display: block;
  font-size: 11px;
  font-weight: 650;
}

.health-row small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

.health-note {
  min-height: 47px;
  margin: 0 20px 19px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: #727775;
  background: rgba(255, 255, 255, 0.02);
  font-family: var(--mono);
  font-size: 8px;
  line-height: 1.55;
}

.section-heading {
  margin: 0 0 17px;
}

.section-heading h2 {
  margin-bottom: 0;
  font-size: 29px;
}

.count-chip {
  color: var(--gold-light);
}

.orders-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px minmax(0, 1fr);
  gap: 12px;
  margin-bottom: 50px;
}

.order-card,
.trap-center-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.order-card {
  position: relative;
  overflow: hidden;
  padding: 23px;
}

.order-card::before {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  content: "";
  opacity: 0.8;
}

.order-card.buy::before {
  left: 0;
  background: var(--green);
}

.order-card.sell::before {
  right: 0;
  background: var(--red);
}

.order-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}

.side-badge {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.09em;
}

.side-badge.buy { color: var(--green); }
.side-badge.sell { color: var(--red); }

.order-price {
  margin: 26px 0;
  font-family: var(--mono);
  font-size: clamp(28px, 3.1vw, 44px);
  font-weight: 700;
  letter-spacing: -0.06em;
}

.order-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.order-meta > div {
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.018);
}

.order-meta span,
.order-meta strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-meta span {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 8px;
}

.order-meta strong {
  font-family: var(--mono);
  font-size: 10px;
}

.order-track {
  height: 3px;
  margin-top: 22px;
  overflow: hidden;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.045);
}

.order-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  transition: width 500ms ease;
}

.order-card.buy .order-track span { background: var(--green); }
.order-card.sell .order-track span { background: var(--red); }

.order-card > p {
  margin: 10px 0 0;
  color: #646967;
  font-size: 9px;
}

.trap-center-card {
  display: flex;
  min-height: 254px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  background:
    radial-gradient(circle, rgba(214, 172, 86, 0.06), transparent 65%),
    var(--surface);
  text-align: center;
}

.trap-radar {
  position: relative;
  display: grid;
  width: 72px;
  height: 72px;
  margin-bottom: 15px;
  place-items: center;
  border: 1px solid rgba(214, 172, 86, 0.13);
  border-radius: 50%;
}

.trap-radar::before,
.trap-radar::after {
  position: absolute;
  content: "";
  background: rgba(214, 172, 86, 0.18);
}

.trap-radar::before { width: 100%; height: 1px; }
.trap-radar::after { width: 1px; height: 100%; }

.trap-radar span {
  position: absolute;
  border: 1px solid rgba(214, 172, 86, 0.12);
  border-radius: 50%;
}

.trap-radar span:nth-child(1) { inset: 9px; }
.trap-radar span:nth-child(2) { inset: 20px; }
.trap-radar span:nth-child(3) {
  inset: 29px;
  border-color: var(--gold);
  background: var(--gold);
  box-shadow: 0 0 12px var(--gold);
}

.trap-radar b {
  position: relative;
  z-index: 2;
  color: transparent;
}

.trap-center-card p {
  margin: 0 0 7px;
  color: var(--gold);
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 750;
  letter-spacing: 0.12em;
}

.trap-center-card > strong {
  font-family: var(--mono);
  font-size: 17px;
}

.trap-center-card > span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 8px;
}

.operations-row {
  margin-bottom: 12px;
}

.risk-block {
  padding: 20px 22px 0;
}

.risk-heading,
.risk-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}

.risk-heading {
  color: var(--muted-strong);
  font-size: 10px;
}

.risk-heading strong {
  color: var(--text);
  font-family: var(--mono);
}

.progress-track {
  height: 5px;
  margin: 10px 0 8px;
  overflow: hidden;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.05);
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #34785e, var(--green));
  transition: width 500ms ease;
}

.progress-track.gold span {
  background: linear-gradient(90deg, var(--gold-dark), var(--gold-light));
}

.risk-caption {
  color: #666b69;
  font-family: var(--mono);
  font-size: 8px;
}

.micro-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  padding: 21px 22px 22px;
}

.micro-stats > div {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
}

.micro-stats span,
.micro-stats strong {
  display: block;
}

.micro-stats span {
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 8px;
}

.micro-stats strong {
  font-family: var(--mono);
  font-size: 11px;
}

.position-empty {
  display: flex;
  min-height: 251px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 20px;
  text-align: center;
}

.flat-orbit {
  position: relative;
  display: grid;
  width: 66px;
  height: 66px;
  margin-bottom: 18px;
  place-items: center;
  border: 1px dashed rgba(255, 255, 255, 0.13);
  border-radius: 50%;
}

.flat-orbit::after {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  content: "";
  background: var(--gold);
  box-shadow: 0 0 10px var(--gold);
  transform: translateY(-33px);
  transform-origin: 3px 36px;
  animation: orbit 6s linear infinite;
}

.flat-orbit span {
  width: 13px;
  height: 1px;
  background: var(--muted);
}

@keyframes orbit {
  to { rotate: 360deg; }
}

.position-empty strong {
  font-size: 14px;
}

.position-empty p {
  max-width: 250px;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.position-live {
  min-height: 251px;
  padding: 23px;
}

.position-pnl {
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.02);
}

.position-pnl span,
.position-pnl strong {
  display: block;
}

.position-pnl span {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 9px;
}

.position-pnl strong {
  font-family: var(--mono);
  font-size: 25px;
}

.position-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin-top: 20px;
}

.position-details span,
.position-details strong {
  display: block;
}

.position-details span {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 8px;
}

.position-details strong {
  overflow: hidden;
  font-family: var(--mono);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-list {
  margin: 0;
  padding: 8px 22px 16px;
}

.settings-list > div {
  display: flex;
  min-height: 39px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.045);
}

.settings-list > div:last-child {
  border-bottom: 0;
}

.settings-list dt {
  color: var(--muted);
  font-size: 9px;
}

.settings-list dd {
  margin: 0;
  overflow: hidden;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 650;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trades-panel {
  margin-top: 12px;
}

.mobile-csv {
  display: none;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
}

th,
td {
  height: 49px;
  padding: 0 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.043);
  text-align: left;
}

th {
  color: #686d6b;
  background: rgba(255, 255, 255, 0.013);
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

td {
  color: var(--muted-strong);
  font-family: var(--mono);
  font-size: 9px;
}

tbody tr {
  transition: background 120ms ease;
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.019);
}

tbody tr:last-child td {
  border-bottom: 0;
}

.trade-side {
  display: inline-flex;
  min-width: 47px;
  height: 21px;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: 8px;
  font-weight: 750;
}

.trade-side.long {
  color: var(--green);
  background: var(--green-soft);
}

.trade-side.short {
  color: var(--red);
  background: var(--red-soft);
}

.table-empty {
  height: 90px;
  color: var(--muted);
  text-align: center;
}

.dashboard-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 27px 3px 0;
  color: #545957;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.08em;
}

.toast {
  position: fixed;
  z-index: 100;
  right: 24px;
  bottom: 24px;
  max-width: min(380px, calc(100vw - 48px));
  padding: 13px 16px;
  border: 1px solid rgba(240, 110, 112, 0.25);
  border-radius: 12px;
  color: #ffd5d5;
  background: rgba(45, 20, 21, 0.96);
  box-shadow: var(--shadow);
  font-size: 11px;
  line-height: 1.5;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.refreshing svg {
  animation: spin 900ms linear infinite;
}

@keyframes spin {
  to { rotate: 360deg; }
}

@media (max-width: 1180px) {
  .metrics-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .metric-card {
    min-height: 134px;
  }

  .metric-value {
    margin-top: 20px;
  }

  .chart-row .span-8,
  .chart-row .span-4 {
    grid-column: span 12;
  }

  .health-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 20px;
  }

  .health-note {
    margin-top: 4px;
  }

  .orders-grid {
    grid-template-columns: 1fr 150px 1fr;
  }

  .order-card {
    padding: 20px;
  }

  .operations-row .span-4 {
    grid-column: span 6;
  }

  .operations-row .span-4:last-child {
    grid-column: span 12;
  }

  .settings-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 30px;
  }
}

@media (max-width: 780px) {
  .topbar {
    height: 68px;
    padding: 0 16px;
  }

  .brand-lockup.compact .brand-mark {
    width: 35px;
    height: 35px;
    flex-basis: 35px;
  }

  .brand-lockup.compact .brand-mark::before {
    left: 16px;
  }

  .brand-lockup.compact .brand-mark::after {
    top: 16px;
  }

  .brand-lockup.compact h1 {
    font-size: 16px;
  }

  .desktop-only {
    display: none;
  }

  .connection-pill {
    width: 34px;
    padding: 0;
    justify-content: center;
  }

  .connection-pill #connection-text {
    display: none;
  }

  .dashboard-shell {
    width: min(calc(100% - 28px), 1440px);
    padding-top: 32px;
  }

  .overview-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .overview-heading .muted {
    max-width: 350px;
    line-height: 1.55;
  }

  .updated-block {
    min-width: 0;
    width: 100%;
    text-align: left;
  }

  .metrics-grid {
    grid-template-columns: 1fr 1fr;
  }

  .metric-card {
    min-height: 132px;
    padding: 17px;
  }

  .metric-value {
    font-size: 21px;
  }

  .content-grid {
    display: block;
  }

  .content-grid > .panel {
    margin-bottom: 12px;
  }

  .chart-wrap {
    height: 250px;
  }

  .chart-footer {
    grid-template-columns: 1fr 1fr;
  }

  .chart-footer > div:nth-child(2) {
    border-right: 0;
  }

  .chart-footer > div:nth-child(-n+2) {
    border-bottom: 1px solid var(--line);
  }

  .health-list {
    display: block;
  }

  .section-heading {
    align-items: center;
  }

  .orders-grid {
    display: grid;
    grid-template-columns: 1fr;
  }

  .trap-center-card {
    min-height: 170px;
    grid-row: 1;
  }

  .order-card {
    min-height: 250px;
  }

  .operations-row .panel {
    min-height: 0;
  }

  .settings-list {
    display: block;
  }

  .mobile-csv {
    display: inline-flex;
  }

  .dashboard-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }
}

@media (max-width: 500px) {
  .login-card {
    padding: 27px 22px;
    border-radius: 22px;
  }

  .login-copy {
    margin: 48px 0 30px;
  }

  .topbar-actions {
    gap: 2px;
  }

  .top-icon {
    width: 34px;
    height: 34px;
  }

  .dashboard-shell {
    width: min(calc(100% - 20px), 1440px);
  }

  .overview-heading h2 {
    font-size: 30px;
  }

  .metrics-grid {
    gap: 8px;
  }

  .metric-card {
    min-height: 126px;
    padding: 15px;
    border-radius: 16px;
  }

  .metric-label {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .metric-value {
    margin-top: 15px;
    font-size: 18px;
  }

  .metric-card p {
    font-size: 8px;
  }

  .panel,
  .order-card,
  .trap-center-card {
    border-radius: 16px;
  }

  .panel-header {
    min-height: 70px;
    padding: 17px;
  }

  .chart-legend {
    display: none;
  }

  .chart-wrap {
    height: 225px;
    padding-inline: 7px;
  }

  .chart-footer > div {
    padding: 13px;
  }

  .health-list {
    padding-inline: 16px;
  }

  .health-note {
    margin-inline: 16px;
  }

  .order-card {
    padding: 18px;
  }

  .order-price {
    margin: 22px 0;
    font-size: 35px;
  }

  .order-meta {
    gap: 6px;
  }

  .order-meta > div {
    padding: 9px 7px;
  }

  .risk-block,
  .micro-stats,
  .settings-list {
    padding-inline: 17px;
  }

  .trades-panel .panel-header {
    align-items: flex-start;
    flex-direction: column;
  }

  th,
  td {
    padding: 0 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
