:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #10151c;
  color: #eef2f8;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(ellipse at 50% -35%, rgba(35, 92, 83, 0.26), transparent 55%),
    #10151c;
}

.dashboard {
  width: min(100% - 40px, 920px);
  margin: 0 auto;
}

.topbar {
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #252d37;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #f3f6fb;
  font-size: 19px;
  font-weight: 720;
  letter-spacing: -0.6px;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 9px;
  background: #40c9a2;
  color: #0c211b;
  font-size: 17px;
}

.brand-period {
  color: #40c9a2;
}

.connection {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #a7b1be;
  font-size: 13px;
}

.connection-dot,
.live-label > span:first-child {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e6a845;
}

.connection.connected .connection-dot {
  background: #40c9a2;
  box-shadow: 0 0 10px rgba(64, 201, 162, 0.5);
}

.connection.disconnected .connection-dot {
  background: #f06c6c;
}

.intro {
  padding: 54px 0 28px;
}

.eyebrow {
  margin: 0 0 12px;
  color: #40c9a2;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 1.5px;
}

h1 {
  margin: 0;
  font-size: clamp(29px, 5vw, 40px);
  letter-spacing: -1.5px;
}

.subtitle {
  margin: 10px 0 0;
  color: #9da8b5;
  font-size: 15px;
}

.market-card {
  padding: 26px 30px 28px;
  border: 1px solid #2a3440;
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(28, 37, 47, 0.98), rgba(20, 27, 35, 0.98));
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.19);
}

.market-heading,
.asset {
  display: flex;
  align-items: center;
}

.market-heading {
  justify-content: space-between;
}

.asset {
  gap: 13px;
}

.coin-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 50%;
  background: #f7931a;
  color: white;
  font-size: 26px;
  font-weight: 700;
}

.asset h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 650;
}

.pair {
  margin-left: 5px;
  color: #a7b1be;
  font-size: 13px;
  font-weight: 500;
}

.asset p {
  margin: 5px 0 0;
  color: #82909e;
  font-size: 12px;
}

.live-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #63d8b7;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.8px;
}

.live-label > span:first-child {
  width: 6px;
  height: 6px;
  background: #40c9a2;
}

.price-block {
  padding: 34px 0 25px;
}

.metric-label {
  margin: 0 0 9px;
  color: #9ba7b5;
  font-size: 12px;
}

.price {
  margin: 0;
  font-size: clamp(34px, 7vw, 48px);
  font-weight: 650;
  letter-spacing: -1.8px;
  font-variant-numeric: tabular-nums;
}

.updated {
  min-height: 16px;
  margin: 6px 0 0;
  color: #74818f;
  font-size: 11px;
}

.divider {
  height: 1px;
  background: #2a3440;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  padding-top: 23px;
}

.metric-label span {
  color: #74818f;
}

.metric-value {
  margin: 0;
  color: #e8edf4;
  font-size: 18px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.signal-badge {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  margin: -2px 0 0;
  padding: 0 11px;
  border: 1px solid #394451;
  border-radius: 7px;
  color: #b7c1cc;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.5px;
}

.signal-badge.buy {
  border-color: rgba(64, 201, 162, 0.35);
  background: rgba(64, 201, 162, 0.1);
  color: #5de0b8;
}

.signal-badge.sell {
  border-color: rgba(240, 108, 108, 0.35);
  background: rgba(240, 108, 108, 0.1);
  color: #ff8585;
}

.signal-badge.warmup {
  color: #c2a56b;
}

.signal-badge.hold {
  color: #c2ccd6;
}

.notice {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin-top: 18px;
  padding: 15px 17px;
  border: 1px solid #27333c;
  border-radius: 11px;
  background: rgba(25, 34, 41, 0.72);
}

.notice-icon {
  display: grid;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  place-items: center;
  border: 1px solid #71808d;
  border-radius: 50%;
  color: #aeb9c4;
  font-size: 11px;
  font-weight: 700;
}

.notice p {
  margin: 1px 0 0;
  color: #aeb8c3;
  font-size: 12px;
  line-height: 1.55;
}

.notice.error {
  border-color: rgba(240, 108, 108, 0.35);
}

.notice.error .notice-icon,
.notice.error p {
  color: #ff9999;
}

.paper-card {
  margin-top: 20px;
  padding: 25px 28px;
  border: 1px solid #2a3440;
  border-radius: 16px;
  background: rgba(22, 30, 38, 0.9);
}

.paper-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.paper-heading .eyebrow {
  margin-bottom: 8px;
}

.paper-heading h2 {
  margin: 0;
  font-size: 20px;
  letter-spacing: -0.5px;
}

.reset-button {
  border: 1px solid #3a4652;
  border-radius: 7px;
  padding: 8px 11px;
  background: transparent;
  color: #b7c1cc;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.reset-button:hover {
  border-color: #40c9a2;
  color: #63d8b7;
}

.paper-description {
  max-width: 650px;
  margin: 12px 0 0;
  color: #9da8b5;
  font-size: 12px;
  line-height: 1.6;
}

.paper-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 22px;
}

.paper-metric .metric-value {
  font-size: 16px;
}

.paper-metric .metric-subvalue {
  margin: 5px 0 0;
  color: #9da8b5;
  font-size: 11px;
  line-height: 1.45;
  font-variant-numeric: tabular-nums;
}

.paper-metric .positive {
  color: #5de0b8;
}

.paper-metric .negative {
  color: #ff8585;
}

.paper-status {
  min-height: 18px;
  margin: 17px 0 0;
  color: #aeb8c3;
  font-size: 12px;
  line-height: 1.5;
}

.trades-section {
  margin-top: 21px;
  border-top: 1px solid #2a3440;
  padding-top: 17px;
}

.trades-section h3 {
  margin: 0 0 10px;
  color: #cbd3dd;
  font-size: 12px;
  font-weight: 650;
}

.trade-list {
  display: grid;
  gap: 8px;
}

.trade-row {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 11px;
  border: 1px solid #29343e;
  border-radius: 8px;
  background: rgba(16, 21, 28, 0.48);
  font-size: 11px;
}

.trade-side {
  font-weight: 750;
}

.trade-side.buy {
  color: #5de0b8;
}

.trade-side.sell {
  color: #ff8585;
}

.trade-detail {
  color: #aeb8c3;
  line-height: 1.5;
}

.trade-result {
  color: #aeb8c3;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.trade-result.positive {
  color: #5de0b8;
}

.trade-result.negative {
  color: #ff8585;
}

.empty-trades {
  margin: 0;
  color: #74818f;
  font-size: 12px;
}

footer {
  padding: 28px 0 36px;
  color: #73808d;
  font-size: 11px;
  line-height: 1.6;
}

footer p {
  margin: 4px 0;
}

@media (max-width: 640px) {
  .dashboard {
    width: min(100% - 28px, 920px);
  }

  .intro {
    padding-top: 40px;
  }

  .market-card {
    padding: 21px 19px 22px;
  }

  .metrics {
    grid-template-columns: 1fr 1fr;
    row-gap: 22px;
  }

  .paper-card {
    padding: 21px 19px;
  }

  .paper-metrics {
    grid-template-columns: 1fr 1fr;
    row-gap: 17px;
  }

  .signal-metric {
    grid-column: 1 / -1;
  }
}

.paper-heading { flex-wrap: wrap; }

/* Botrad trading workspace */
:root { background: #080d11; color: #edf6f4; }
html { scroll-behavior: smooth; scroll-padding-top: 100px; }
body { background: radial-gradient(ellipse at 95% 0%, #14392f88, transparent 38%), radial-gradient(ellipse at 0% 55%, #16273b55, transparent 45%), #080d11; }
.dashboard { width: min(100% - 64px, 1220px); }
.topbar { height: 88px; border-color: #ffffff12; gap: 24px; }
.brand { font-size: 25px; letter-spacing: -1px; }
.brand-mark { width: 36px; height: 36px; border-radius: 12px; background: #b4f577; transform: rotate(-8deg); color: #102119; }
.brand-period, .accent { color: #b4f577; }
.brand-logo { display: block; width: 215px; height: 72px; object-fit: contain; }
@media (max-width: 480px) { .brand-logo { width: 160px; height: 54px; } }
.main-nav { display: flex; gap: 30px; margin-left: auto; }
.main-nav a { color: #a7bbb6; font-size: 12px; text-decoration: none; }
.main-nav a:hover { color: #b4f577; }
.connection { padding: 10px 14px; border: 1px solid #ffffff16; border-radius: 30px; background: #ffffff04; font-size: 11px; }
.intro { padding: 55px 0 35px; }
.eyebrow { color: #b4f577; font-size: 10px; letter-spacing: 2px; }
h1 { font-size: clamp(34px, 4.6vw, 62px); letter-spacing: -2.8px; line-height: 1.08; font-weight: 600; }
h1 span { color: #8baba2; }
.subtitle { max-width: 560px; line-height: 1.7; font-size: 13px; margin-top: 20px; }
.market-card { position: relative; overflow: hidden; padding: 30px 34px; border-color: #75b9a32b; border-radius: 24px; background: linear-gradient(135deg, #14221ff2, #0e171af5 60%); box-shadow: 0 24px 80px #0004, inset 0 1px #ffffff08; }
.asset h2 { font-size: 19px; }
.coin-icon { background: #f6af45; color: #271903; width: 48px; height: 48px; }
.price-block { padding: 30px 0 20px; }
.price { font-size: clamp(32px, 4.8vw, 60px); letter-spacing: -2px; font-weight: 550; }
.chart-heading { display: flex; justify-content: space-between; color: #839f96; font-size: 10px; gap: 12px; margin: 0 0 10px; }
.chart-heading b { color: #47edbd; padding-left: 8px; }
#market-chart { display: block; width: 100%; height: 190px; background: repeating-linear-gradient(to top, transparent 0, transparent 46px, #ffffff06 47px, transparent 48px); }
#chart-caption { margin: 8px 0 20px; }
.divider { background: #ffffff10; }
.metrics { padding-top: 24px; }
.metric { padding-right: 15px; }
.metric-value { font-size: 22px; letter-spacing: -.6px; }
.signal-badge { min-height: 35px; border-radius: 8px; padding: 0 18px; }
.notice { background: #10231b55; border-color: #74bf9d22; border-radius: 14px; }
.paper-card { background: linear-gradient(135deg, #121c20, #0e171b); border: 1px solid #ffffff12; border-radius: 24px; padding: 30px 34px; margin-top: 24px; }
.section-kicker { display: flex; align-items: center; justify-content: space-between; gap: 14px; color: #8ca49e; font-size: 10px; letter-spacing: 1.5px; margin-bottom: 22px; }
.section-kicker > span:last-child { padding: 7px 10px; background: #b4f5770c; border: 1px solid #b4f57730; border-radius: 6px; color: #b4f577; font-size: 9px; letter-spacing: .5px; }
.section-kicker .environment-real { background: #ff866519 !important; border-color: #ff866566 !important; color: #ffab91 !important; }
#engine-title, #connect-title { font-size: 30px; letter-spacing: -1.2px; margin: 0; font-weight: 550; }
.paper-description { max-width: 850px; color: #94aaa4; line-height: 1.8; }
#engine-signal { font-size: 16px; color: #e2f7ee; padding: 20px; border: 1px solid #56dfb526; border-radius: 14px; background: #50e8b508; }
.engine-card .paper-heading { justify-content: flex-start; gap: 10px; margin-top: 20px; }
.reset-button { border-radius: 10px; min-height: 42px; padding: 10px 16px; transition: background .18s, transform .18s; }
.reset-button:not(:disabled):hover { background: #b4f57710; color: #c6ffa0; border-color: #b4f577; transform: translateY(-1px); }
.reset-button[aria-pressed="true"] { background: #b4f577; color: #112017; border-color: #b4f577 !important; font-weight: 700; }
.reset-button:disabled { opacity: .45; cursor: not-allowed; }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid #b4f577; outline-offset: 4px; }
#execution-feedback { color: #b4f577; }
#engine-status { padding-top: 18px; border-top: 1px solid #ffffff10; color: #93a79f; line-height: 1.9; }
.paper-metrics { gap: 12px; }
.paper-metric { padding: 20px; border: 1px solid #ffffff0a; border-radius: 14px; background: #ffffff02; }
.paper-metric .metric-value { font-size: 22px; }
.paper-heading h2 { font-size: 24px; }
.connection-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; margin: 28px 0; }
.connection-steps > div { border-top: 1px solid #ffffff15; padding-top: 20px; }
.connection-steps span { font-size: 12px; color: #b4f577; font-variant-numeric: tabular-nums; }
.connection-steps h3 { font-size: 17px; letter-spacing: -.4px; font-weight: 550; margin: 12px 0; }
.connection-steps p, .setup-guide p { color: #94aaa4; font-size: 12px; line-height: 1.8; }
.connection-steps a { color: #b4f577; font-size: 11px; text-decoration: none; }
.setup-guide { border-top: 1px solid #ffffff15; padding-top: 20px; }
.setup-guide summary { cursor: pointer; font-size: 13px; color: #d7ece4; }
.setup-guide summary span { float: right; color: #b4f577; }
pre { padding: 18px; border: 1px solid #ffffff10; border-radius: 12px; background: #070d10; overflow-x: auto; color: #c4e9b5; font-size: 11px; line-height: 1.8; }
footer { display: flex; justify-content: space-between; gap: 25px; color: #82958d; }
@media (min-width: 1050px) { .engine-card { position: relative; } }
@media (max-width: 760px) {
  .dashboard { width: calc(100% - 28px); }
  .main-nav { display: none; }
  .topbar { height: 74px; }
  .intro { padding: 36px 0 28px; }
  h1 { letter-spacing: -1.6px; }
  .market-card, .paper-card { padding: 24px 20px; border-radius: 20px; }
  .connection-steps { grid-template-columns: 1fr; gap: 18px; }
  .paper-metric { padding: 14px; }
  .paper-metric .metric-value { font-size: 18px; }
  footer { display: block; }
  #engine-title, #connect-title { font-size: 26px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .reset-button { transition: none; } }
[hidden] { display: none !important; }

/* Clear signal and account hierarchy. */
.dashboard { max-width: 1280px; }
.intro { padding: 34px 0 26px; }
.intro h1 { font-size: clamp(28px, 3.3vw, 42px); letter-spacing: -1.8px; }
.intro .subtitle { max-width: none; margin-top: 12px; font-size: 14px; }
.trading-workspace { display: grid; grid-template-columns: 1.1fr 1fr; gap: 20px; align-items: start; }
.trading-workspace > section { min-width: 0; margin: 0; padding: 26px; border-radius: 20px; }
.trading-workspace .price { font-size: clamp(32px, 3.6vw, 48px); }
.trading-workspace .price-block { padding: 26px 0 22px; }
.trading-workspace #market-chart { height: 240px; }
.trading-workspace .section-kicker { margin-bottom: 18px; font-size: 9px; letter-spacing: 1px; }
.engine-title-row, .account-heading, .history-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
#engine-title { font-size: 23px; letter-spacing: -.7px; }
.mode-pill { flex-shrink: 0; border: 1px solid #ffffff19; color: #a9bdb6; border-radius: 30px; padding: 6px 10px; font-size: 11px; }
#engine-signal.decision-panel { --signal-color: #e8c875; --signal-bg: #e8c8750b; margin: 22px 0 0; padding: 22px; border: 1px solid color-mix(in srgb, var(--signal-color) 25%, transparent); background: var(--signal-bg); border-radius: 16px; }
#engine-signal.buy { --signal-color: #67e6b3; --signal-bg: #67e6b30c; }
#engine-signal.sell { --signal-color: #ff9396; --signal-bg: #ff93960c; }
#engine-signal.offline, #engine-signal.warmup { --signal-color: #9cacc0; --signal-bg: #9cacc008; }
.decision-heading { display: flex; align-items: center; gap: 14px; color: var(--signal-color); }
.decision-icon { display: grid; place-items: center; width: 46px; height: 46px; flex-shrink: 0; border: 1px solid color-mix(in srgb, var(--signal-color) 30%, transparent); border-radius: 12px; font-size: 28px; }
#engine-signal-label { margin: 0; font-size: clamp(23px, 2.2vw, 30px); line-height: 1.2; letter-spacing: -.8px; font-weight: 650; text-wrap: balance; }
#engine-signal-reason { color: #bac9c3; font-size: 13px; line-height: 1.7; margin: 16px 0 14px; }
#engine-signal-meta { color: #90a79d; font-size: 11px; line-height: 1.6; margin: 0; padding-top: 12px; border-top: 1px solid #ffffff0c; font-variant-numeric: tabular-nums; }
.behavior-note { color: #93a89f; font-size: 12px; line-height: 1.7; margin: 13px 0 22px; }
.account-heading { padding-top: 18px; border-top: 1px solid #ffffff10; }
.account-heading h3 { font-size: 13px; margin: 0; font-weight: 550; color: #c3d1cb; }
#engine-position-state { font-size: 11px; color: #a9bdb6; }
.engine-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.engine-actions .reset-button { font-size: 12px; padding: 12px 10px; }
.close-position:not(:disabled) { color: #ffb5ad; border-color: #ffb5ad55; background: #ffb5ad09; }
.close-position:not(:disabled):hover { color: #ffd4cf; border-color: #ffb5ad; background: #ffb5ad15; }
.command-feedback { font-size: 11px; line-height: 1.6; color: #96aaa2; min-height: 18px; margin: 10px 0 0; }
#engine-status.engine-health { border: 0; padding: 0; margin: 9px 0 0; color: #93b8a7; font-size: 10px; line-height: 1.6; }
.engine-settings, .market-analysis { border-top: 1px solid #ffffff10; margin-top: 20px; padding-top: 16px; }
.engine-settings summary, .market-analysis summary { color: #a9bdb6; font-size: 12px; cursor: pointer; }
.mode-selector { display: flex; gap: 8px; margin-top: 16px; }
.mode-selector button { flex: 1; font-size: 12px; }
.engine-settings .paper-description, .engine-settings .paper-status { font-size: 11px; line-height: 1.8; }
.market-analysis .metrics { grid-template-columns: 1fr 1fr; padding-top: 18px; }
.market-analysis .signal-metric { grid-column: 1/-1; }
.market-analysis .metric-value { font-size: 18px; }
.balance-card, .history-card { padding: 26px; border-radius: 20px; }
.history-heading { margin-bottom: 20px; }
.history-heading h2 { font-size: 21px; letter-spacing: -.5px; margin: 0; font-weight: 550; }
.history-heading .eyebrow { margin-bottom: 8px; font-size: 9px; letter-spacing: 1.4px; }
.history-heading > span { font-size: 11px; color: #8fa79c; text-align: right; }
#engine-metrics { display: grid; grid-template-columns: 1.15fr repeat(4, 1fr); gap: 10px; margin: 0; }
#engine-metrics .paper-metric { padding: 18px 14px; min-width: 0; border-color: #ffffff0b; }
#engine-metrics .paper-metric:first-child { border-color: #b4f57735; background: #b4f57706; }
#engine-metrics .metric-label { font-size: 10px; line-height: 1.6; min-height: 32px; }
#engine-metrics .metric-value { font-size: clamp(15px, 1.6vw, 21px); white-space: nowrap; letter-spacing: -.5px; }
.balance-note { color: #78938a; margin: 14px 0 0; font-size: 10px; line-height: 1.7; }
#engine-history { gap: 0; }
.server-trade { display: grid; grid-template-columns: 1fr 1fr 1.2fr .8fr; align-items: center; gap: 18px; padding: 16px 0; border-top: 1px solid #ffffff0b; font-size: 12px; }
.server-trade-action { display: grid; gap: 5px; }
.server-trade-action strong { font-size: 13px; font-weight: 550; }
.server-trade-action span, .server-trade-date { color: #859f94; font-size: 11px; }
.server-trade-action.buy strong, .server-trade-result.positive { color: #67e6b3; }
.server-trade-action.sell strong, .server-trade-result.negative { color: #ff9396; }
.server-trade-price { color: #adbbb5; font-variant-numeric: tabular-nums; }
.server-trade-result { color: #7f968b; text-align: right; font-variant-numeric: tabular-nums; }
.notice { margin: 18px 0; background: transparent; border-color: #ffffff0b; }
.secondary-panel { border: 1px solid #ffffff12; border-radius: 14px; margin-top: 14px; background: #0f191b; }
.secondary-panel > summary { padding: 18px 22px; font-size: 13px; color: #c0d0c8; cursor: pointer; }
.secondary-panel > summary span { float: right; color: #78938a; font-size: 11px; }
.secondary-panel > .paper-card { margin-top: 0; border: 0; background: transparent; }
@media (max-width: 960px) {
  .trading-workspace { grid-template-columns: 1fr; }
  .trading-workspace .engine-card { order: -1; }
  .trading-workspace .market-card { margin-top: 0; }
  #engine-metrics { grid-template-columns: repeat(2, 1fr); }
  #engine-metrics .paper-metric:first-child { grid-column: 1/-1; }
  #engine-metrics .metric-value { font-size: 21px; }
  #engine-metrics .metric-label { min-height: auto; }
}
@media (max-width: 600px) {
  .intro { padding-top: 25px; }
  .intro h1 span { display: block; margin-top: 4px; }
  .intro .subtitle { font-size: 12px; }
  .trading-workspace > section, .balance-card, .history-card { padding: 20px; }
  .main-nav { display: flex; gap: 0; }
  .main-nav a { display: none; }
  .main-nav #logout { min-height: 32px; padding: 5px 10px; font-size: 11px; }
  .connection { padding: 8px; font-size: 10px; }
  .topbar { gap: 8px; }
  .brand-logo { width: 125px; height: 48px; }
  #engine-signal.decision-panel { padding: 18px; }
  #engine-signal-label { font-size: 25px; }
  .server-trade { grid-template-columns: 1fr 1fr; gap: 10px; }
  .server-trade-date { text-align: right; }
  .server-trade-price { font-size: 10px; }
  .secondary-panel > summary span { float: none; display: block; padding: 6px 0 0 16px; }
}

/* Readable operation ledger, with explicit labels on small screens. */
.history-explanation { color: #91a79c; font-size: 12px; line-height: 1.7; margin: -5px 0 20px; max-width: 760px; }
#engine-history { display: block; overflow: auto; max-height: 540px; scrollbar-color: #3e574e transparent; }
.history-table { width: 100%; border-collapse: collapse; text-align: left; font-variant-numeric: tabular-nums; }
.history-table th { position: sticky; top: 0; z-index: 1; padding: 13px 14px; background: #172421; color: #a9c1b5; font-weight: 500; font-size: 11px; white-space: nowrap; border-bottom: 1px solid #ffffff16; }
.history-table td { padding: 19px 14px; border-bottom: 1px solid #ffffff0c; vertical-align: middle; }
.history-table tbody tr:nth-child(even) { background: #ffffff02; }
.history-table tbody tr:hover { background: #b4f57705; }
.history-value { display: grid; gap: 7px; color: #dce8e1; font-size: 13px; white-space: nowrap; }
.history-value > span { font-weight: 550; }
.history-value small { font-size: 10px; color: #7e9a8c; font-weight: 400; }
.history-value.buy > span, .history-value.positive > span { color: #67e6b3; }
.history-value.sell > span, .history-value.negative > span { color: #ff9396; }
.history-value.muted > span { color: #9bada4; font-weight: 400; }
@media (max-width: 760px) {
  #engine-history { max-height: none; overflow: visible; }
  .history-heading { align-items: flex-start; }
  #engine-history-summary { max-width: 125px; line-height: 1.7; }
  .history-table, .history-table tbody { display: block; }
  .history-table thead { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); }
  .history-table tr { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 14px; margin-bottom: 12px; padding: 18px; border: 1px solid #ffffff12; border-radius: 14px; background: #ffffff02; }
  .history-table td { display: block; padding: 0; border: 0; min-width: 0; }
  .history-table td::before { content: attr(data-label); display: block; font-size: 9px; color: #7e9a8c; margin-bottom: 8px; }
  .history-table td:last-child { grid-column: 1/-1; border-top: 1px solid #ffffff0b; padding-top: 14px; }
  .history-value { font-size: 12px; white-space: normal; overflow-wrap: anywhere; }
}
