:root {
  color-scheme: dark;
  --bg: #0c1018;
  --surface: #121823;
  --surface-raised: #171f2c;
  --border: #242d3b;
  --text: #eff2f7;
  --muted: #9aa8ba;
  --subtle: #78869b;
  --accent: #f8ab71;
  --green: #57d9ad;
  --red: #f49aa0;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-family: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
[hidden] { display: none !important; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.frame { width: min(1280px, calc(100% - 100px)); margin-inline: auto; }
.topbar { border-bottom: 1px solid var(--border); background: #0e131c; }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 66px; gap: 14px; }
.brand { color: var(--text); text-decoration: none; display: flex; align-items: center; gap: 11px; font-size: 1.03rem; font-weight: 720; white-space: nowrap; }
.brand-logo {
  display: block;
  flex: none;
  filter: drop-shadow(0 0 8px #54f0ff42) drop-shadow(0 0 10px #ff4fd82e);
}
.topbar-nav { display: flex; align-items: center; gap: 4px; margin-inline-end: auto; }
.nav-item {
  display: inline-flex;
  align-items: center;
  min-height: 35px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: .875rem;
  text-decoration: none;
  white-space: nowrap;
}
.nav-item:hover { color: var(--text); background: var(--surface-raised); }
.nav-item[aria-current] { color: #ffd0aa; background: #3a291f; border-color: #624638; }
.nav-item:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.community-menu { position: relative; z-index: 3; }
.community-menu summary { cursor: pointer; gap: 7px; list-style: none; }
.community-menu summary::-webkit-details-marker { display: none; }
.community-menu summary::after {
  content: "";
  width: 6px;
  height: 6px;
  border: solid currentColor;
  border-width: 0 1.5px 1.5px 0;
  rotate: 45deg;
  translate: 0 -2px;
}
.community-menu[open] summary { color: var(--text); background: var(--surface-raised); }
.community-menu[open] summary::after { rotate: 225deg; translate: 0 2px; }
.community-links {
  position: absolute;
  top: calc(100% + 6px);
  inset-inline-start: 0;
  width: 178px;
  margin: 0;
  padding: 5px;
  list-style: none;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface-raised);
  box-shadow: 0 12px 32px #0007;
}
.community-links a {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 0 9px;
  border-radius: 5px;
  color: var(--muted);
  text-decoration: none;
  font-size: .875rem;
}
.community-links a:hover, .community-links a:focus-visible { color: var(--text); background: var(--surface); }
.community-links a:focus-visible { outline: 2px solid var(--accent); }
.community-symbols { position: absolute; }
.community-icon { width: 17px; height: 17px; fill: currentColor; }
.summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 22px 0; }
.metric { min-width: 0; padding: 15px 19px 17px; background: var(--surface); border: 1px solid var(--border); border-radius: 11px; }
.metric dt { font-size: .875rem; color: var(--muted); }
.metric dd { margin: 8px 0 0; font: 650 clamp(1.38rem, 2.8vw, 1.96rem) / 1.12 var(--mono); letter-spacing: -.05em; white-space: nowrap; }
.metric-highlight { border-color: #4d3930; background: linear-gradient(116deg, #1e1b22, #151a25 95%); }
.metric-highlight dd { color: var(--accent); }
.metric-highlight dd .positive { color: var(--accent); }
.metric dd small { font-size: .56em; font-weight: 500; letter-spacing: 0; color: var(--muted); }

.board { background: var(--surface); border: 1px solid var(--border); border-radius: 13px; overflow: hidden; }
.board-heading { padding: 20px 20px 0; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.board-title-group { display: flex; flex-wrap: wrap; align-items: baseline; gap: 3px 5px; }
.board-heading h2 { font-size: 1.23rem; margin: 0; }
.board-title-group span { color: var(--muted); font-size: .8rem; }
.board-actions { display: flex; align-items: center; gap: 10px; margin-inline-start: auto; }
.update-time { font-size: .8rem; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.refresh, .exchange, .threshold select, .pagination button {
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text);
  background: var(--surface-raised);
  font-size: .875rem;
}
.refresh { flex: none; padding: 7px 12px; }
.refresh span[aria-hidden] { display: inline-block; color: var(--accent); font-size: 1.06em; }
.market-feedback { margin: 10px 20px 0; font-size: .875rem; color: var(--accent); overflow-wrap: anywhere; }
.refresh:hover, .pagination button:enabled:hover { border-color: var(--subtle); }
.refresh:disabled { opacity: .6; }
.toolbar { padding: 17px 20px; display: flex; align-items: center; justify-content: space-between; gap: 10px 14px; flex-wrap: wrap; }
.exchange-filters, .inputs { display: flex; flex-wrap: wrap; gap: 7px; }
.exchange {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px 6px 8px;
  min-height: 35px;
  font-weight: 600;
}
.exchange[aria-pressed="false"] { color: var(--muted); background: transparent; border-color: #354154; }
.exchange[aria-pressed="false"]:hover { background: var(--surface-raised); border-color: var(--subtle); }
.exchange[aria-pressed="true"] { color: #ffd0aa; background: #3a291f; border-color: var(--accent); }
.exchange[aria-pressed="true"]:hover { background: #4b3526; border-color: #ffd0aa; }
.exchange-check {
  display: grid;
  place-items: center;
  flex: 0 0 13px;
  height: 13px;
  border: 1px solid var(--subtle);
  border-radius: 3px;
}
.exchange[aria-pressed="true"] .exchange-check { background: var(--accent); border-color: var(--accent); }
.exchange[aria-pressed="true"] .exchange-check::after {
  content: "";
  width: 4px;
  height: 7px;
  border: solid #2d1c13;
  border-width: 0 2px 2px 0;
  transform: translateY(-1px) rotate(45deg);
}
.exchange-status {
  position: absolute;
  top: 5px;
  right: 4px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--subtle);
}
.exchange[data-state="live"] .exchange-status { background: var(--green); }
.exchange[data-state="offline"] .exchange-status { background: var(--red); }
.pair-filters { display: flex; flex-wrap: wrap; gap: 7px 18px; }
.ranking-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 18px;
  width: 100%;
  padding-top: 9px;
  border-top: 1px solid var(--border);
}
.baseline-status { margin-inline-start: auto; color: var(--subtle); font-size: .8rem; white-space: nowrap; }
.quote-filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px 10px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.quote-filter-label { color: var(--muted); font-size: .875rem; }
.quote-options { display: flex; flex-wrap: wrap; gap: 5px; }
.quote-options label { position: relative; cursor: pointer; }
.quote-options label span {
  display: flex;
  align-items: center;
  min-height: 35px;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface-raised);
  color: var(--muted);
  font-size: .83rem;
  white-space: nowrap;
}
.quote-options label:hover span { color: var(--text); border-color: var(--subtle); }
.quote-options input:checked + span { color: #ffd0aa; border-color: var(--accent); background: #3a291f; }
.quote-options input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.search { display: flex; align-items: center; gap: 8px; padding: 0 10px; background: #0e131c; border: 1px solid var(--border); border-radius: 7px; }
.search:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.search-icon { width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid var(--muted); position: relative; flex: none; }
.search-icon::after { position: absolute; content: ""; width: 5px; height: 1.5px; background: var(--muted); rotate: 45deg; right: -4px; bottom: -1px; }
.search input { outline: none; width: 138px; height: 33px; padding: 0 0 0 3px; background: transparent; color: var(--text); border: 0; font-size: .875rem; }
.search input:focus-visible { outline: none; }
.search input::placeholder { color: var(--muted); }
.threshold { position: relative; }
.threshold::after { position: absolute; content: ""; right: 12px; top: 13px; width: 5px; height: 5px; border: solid var(--muted); border-width: 0 1px 1px 0; rotate: 45deg; pointer-events: none; }
.threshold select { appearance: none; height: 35px; padding: 0 28px 0 10px; }
.account-controls { position: relative; display: flex; flex: none; justify-self: end; z-index: 4; }
.account-entry { white-space: nowrap; }
.account-trigger { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; }
.account-trigger svg { flex: none; }
.account-trigger[aria-expanded="true"] { color: var(--text); border-color: var(--subtle); }
.account-actions {
  position: absolute;
  inset-block-start: 100%;
  inset-inline-end: 0;
  width: max-content;
  min-width: 144px;
  max-width: min(320px, calc(100vw - 36px));
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface-raised);
  box-shadow: 0 12px 32px #0007;
}
.account-menu-email {
  margin: 0 0 3px;
  padding: 8px 9px;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: .875rem;
  overflow-wrap: anywhere;
}
.account-actions a, .account-actions button {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 38px;
  padding: 0 9px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--text);
  font-size: .875rem;
  text-decoration: none;
  white-space: nowrap;
}
.account-actions [aria-current="page"] { color: var(--accent); }
.account-actions a:hover, .account-actions button:hover { background: var(--surface); }
.account-actions :focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.account-actions button:disabled { opacity: .65; }
.asset-actions { display: flex; align-items: center; gap: 4px; }
.favorite-button {
  min-width: 32px;
  min-height: 34px;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1.15rem;
}
.favorite-button:hover, .favorite-button[aria-pressed="true"] { color: var(--accent); }
#favorites-only[aria-pressed="true"] { color: #ffd0aa; border-color: var(--accent); background: #3a291f; }
.compact-dialog {
  width: min(400px, calc(100% - 24px));
  padding: 20px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 13px;
}
.compact-dialog::backdrop { background: #06080cba; }
.account-dialog h2 { margin: 0; font-size: 1.2rem; }
.automation-dialog p { margin: 0; color: var(--muted); }
.account-form { display: grid; gap: 9px; margin-top: 14px; }
.account-form label, .account-form p, .account-status { color: var(--muted); font-size: .875rem; }
.account-form p { margin: 0 0 3px; overflow-wrap: anywhere; }
.account-form input {
  width: 100%;
  min-height: 39px;
  padding: 6px 10px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 7px;
}
.account-form button[type="submit"] { color: #ffd0aa; border-color: #73513d; background: #3a291f; }
.account-code-actions { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.account-status { margin: 0; }
.account-dialog .account-status:not(:empty) { margin-top: 12px; }
.account-status[data-error="true"] { color: var(--red); }
#account-board-status { width: 100%; }

.table-wrap { overflow-x: auto; }
.board .table-wrap { position: relative; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
thead { background: #101620; }
th {
  color: var(--muted);
  font-weight: 550;
  padding: 11px 18px;
  text-align: left;
  white-space: nowrap;
  border-block: 1px solid var(--border);
}
th button { border: 0; background: transparent; padding: 0; color: inherit; }
th button:hover, th[aria-sort] { color: var(--text); }
th button span { padding-left: 3px; color: var(--subtle); font-size: .85em; }
th[aria-sort] button span { color: var(--accent); }
.baseline-column[aria-sort] { box-shadow: inset 0 -2px var(--accent); }
.deviation-column { background: #1d2633; }
th.deviation-column { color: #ffd0aa; }
td.deviation-column .spread { font-size: 1.02rem; font-weight: 780; }
.route-baseline {
  display: block;
  color: var(--muted);
  font-size: .73rem;
  margin-top: 4px;
  white-space: nowrap;
}
.baseline-coverage { display: block; color: var(--muted); font-size: .7rem; white-space: nowrap; }
.column-note { font-size: .8rem; margin-left: 3px; color: var(--subtle); }
.align-right { text-align: right; }
.expand-column { width: 44px; }
td { padding: 11px 18px; border-bottom: 1px solid var(--border); }
tr:last-child td { border-bottom: 0; }
.market-row { cursor: pointer; }
.market-row:hover, .market-row.is-open { background: #17202c; }
.asset-cell, .venue-name { display: flex; align-items: center; }
.asset-cell { gap: 10px; min-width: 96px; font-weight: 690; }
.asset-kind { display: block; color: var(--muted); font-size: .68rem; font-weight: 500; white-space: nowrap; }
.history-trigger { padding: 0; border: 0; color: inherit; background: transparent; text-align: left; }
.history-trigger:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.asset-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: none;
  background: #252c47;
  color: #c1caff;
  border-radius: 8px;
  font: 680 .71rem var(--mono);
}
.asset-mark[data-tone="1"] { background: #352922; color: #ffc295; }
.asset-mark[data-tone="2"] { background: #213634; color: #99e2ce; }
.asset-mark[data-tone="3"] { background: #33283e; color: #e0b2f4; }
.quote-price { display: block; margin-top: 3px; color: var(--muted); }
.quote-instrument { display: block; margin-top: 3px; color: var(--subtle); font: .72rem var(--mono); }
.venue-name { gap: 6px; white-space: nowrap; font-weight: 560; }
.long .venue-indicator { background: var(--green); }
.short .venue-indicator { background: var(--red); }
.venue-indicator { display: inline-block; width: 3px; height: 10px; border-radius: 2px; flex: none; }
.quote-price, .notional, .spread, .pagination { font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.quote-price { font-size: .82rem; }
.notional { color: var(--muted); }
.spread { font-weight: 690; }
.positive { color: var(--green); }
.negative { color: var(--red); }
.neutral { color: var(--muted); }
.expand-cell { padding: 0 10px 0 0; }
.expand-button { display: grid; place-items: center; height: 32px; width: 31px; background: transparent; border: 0; color: var(--muted); border-radius: 6px; }
.expand-button:hover { background: var(--surface-raised); }
.chevron { width: 7px; height: 7px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; rotate: 45deg; translate: 0 -2px; }
.is-open .chevron { rotate: 225deg; translate: 0 2px; }
.empty { text-align: center; color: var(--muted); padding: 42px 12px; }
.details td { background: #0f151f; padding: 15px 18px 17px; }
.details-heading { display: block; margin: 0 0 9px; color: var(--muted); font-size: .875rem; font-weight: 550; }
.details-venues { margin: 0 0 8px; color: var(--muted); font-size: .8rem; }
.routes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px 16px; margin: 0; padding: 0; list-style: none; }
.route { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(78px, auto); gap: 8px; align-items: start; padding: 9px 0; border-bottom: 1px solid var(--border); }
.route-value { text-align: right; }
.route-value .notional { font-size: .8rem; display: block; margin-top: 3px; }
.board-footer { border-top: 1px solid var(--border); padding: 10px 18px; min-height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: .875rem; }
.board-note { margin: 8px 0 0; padding-inline: 2px; color: var(--muted); text-align: right; font-size: .75rem; line-height: 1.5; }
.pagination { display: flex; gap: 10px; align-items: center; }
.pagination button { width: 32px; height: 31px; font: 1.36rem / 1 system-ui; }
.pagination button:disabled { opacity: .35; }
.site-footer { margin-top: 28px; border-top: 1px solid var(--border); background: #0e131c; color: var(--muted); font-size: .875rem; }
.footer-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) repeat(2, minmax(120px, .38fr));
  gap: 24px clamp(24px, 5vw, 72px);
  padding-block: 28px 24px;
}
.footer-brand .brand { width: fit-content; color: var(--text); text-decoration: none; }
.board-description { max-width: 440px; margin: 10px 0 0; line-height: 1.65; }
.footer-nav { display: grid; align-content: start; justify-items: start; gap: 9px; }
.footer-nav h2 { margin: 5px 0 2px; color: var(--accent); font-size: .8rem; }
.footer-nav a, .footer-nav button, .footer-bottom a { color: inherit; text-decoration: none; }
.footer-nav button { border: 0; padding: 0; background: transparent; font: inherit; text-align: left; }
.footer-nav a:hover, .footer-nav button:hover, .footer-bottom a:hover { color: var(--text); }
.site-footer a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.social-links { display: flex; gap: 8px; }
.social-links a {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface-raised);
}
.social-links a:hover { border-color: var(--accent); }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; border-top: 1px solid var(--border); padding-block: 14px; font-size: .8rem; }
.footer-bottom small { font: inherit; }

.history-dialog {
  width: min(1020px, calc(100% - 40px));
  max-height: calc(100dvh - 40px);
  padding: 0;
  background: var(--surface);
  color: var(--text);
  border: 1px solid #343e4f;
  border-radius: 15px;
  overscroll-behavior: contain;
  box-shadow: 0 22px 85px #0009;
}
.history-dialog::backdrop { background: #070a10cc; }
.history-panel { padding: 24px; }
.history-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 18px; }
.history-header h2 { margin: 5px 0 0; font-size: clamp(1.55rem, 3vw, 2rem); line-height: 1.2; }
.automation-dialog .history-header { margin-bottom: 10px; }
.automation-dialog .history-header h2 { margin: 0; font-size: 1.2rem; }
.history-asset { color: var(--accent); font: 680 .9rem var(--mono); letter-spacing: .02em; }
.history-close {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-raised);
  color: var(--muted);
  font-size: 1.45rem;
  line-height: 1;
}
.history-close:hover { color: var(--text); border-color: var(--muted); }
.history-controls { display: flex; flex-wrap: wrap; gap: 11px; align-items: flex-end; }
.history-pair {
  display: grid;
  flex: 2 1 320px;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: end;
  gap: 8px;
  min-width: 0;
}
.history-swap { display: grid; place-items: center; width: 37px; height: 37px; padding: 0; color: var(--accent); }
.history-control { display: grid; flex: 1 1 136px; min-width: 0; gap: 5px; color: var(--muted); font-size: .875rem; }
.history-control > span { display: flex; align-items: center; gap: 6px; }
.history-control select {
  width: 100%;
  min-height: 37px;
  border: 1px solid #364254;
  border-radius: 7px;
  padding: 5px 10px;
  background: #0e141f;
  color: var(--text);
}
.legend-mark { display: inline-block; height: 8px; width: 3px; border-radius: 2px; }
.long-mark { background: var(--green); }
.short-mark { background: var(--red); }
.history-refresh { min-height: 37px; }
.history-status { color: var(--muted); margin: 12px 0; font-size: .875rem; line-height: 1.5; min-height: 21px; }
.history-status[data-state="error"] { color: var(--red); }
.history-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 0 0 13px; }
.history-stats > div { padding: 10px 13px; background: var(--surface-raised); border: 1px solid var(--border); border-radius: 8px; min-width: 0; }
.history-stats dt { color: var(--muted); font-size: .845rem; }
.history-stats dd { margin: 4px 0 0; font: 650 clamp(1rem, 2vw, 1.35rem) / 1.3 var(--mono); overflow-wrap: anywhere; }
.history-stats .history-stat-time { color: var(--muted); font: .8rem var(--mono); }
.history-chart, .history-events { border: 1px solid var(--border); border-radius: 9px; background: #0e141f; }
.history-section-heading { display: flex; gap: 9px; align-items: baseline; justify-content: space-between; padding: 12px 14px; }
.history-section-heading h3 { margin: 0; font-size: .98rem; }
.history-section-heading span { color: var(--muted); font-size: .8rem; text-align: right; }
#history-canvas { display: block; width: 100%; height: 235px; outline-offset: -2px; }
#history-canvas:focus-visible { outline: 2px solid var(--accent); }
.chart-readout, .history-note { margin: 0; color: var(--muted); padding: 8px 14px 11px; font-size: .8rem; line-height: 1.5; }
.chart-readout { min-height: 40px; font-variant-numeric: tabular-nums; }
.history-events { margin-top: 13px; }
.history-events td, .history-events th { padding: 8px 13px; white-space: nowrap; }
.history-events td { font-variant-numeric: tabular-nums; }
.history-events .empty { padding: 15px 10px; }
.history-peak-button { background: transparent; color: inherit; border: 0; padding: 0; text-align: left; line-height: 1.5; }
.history-peak-button:hover { text-decoration: underline; text-underline-offset: 3px; }
.history-peak-button time { color: var(--muted); margin-left: 5px; }

@media (max-width: 900px) {
  .frame { width: calc(100% - 42px); }
  .summary { gap: 9px; }
  .metric { padding-inline: 13px; }
}
@media (max-width: 640px) {
  .frame { width: calc(100% - 24px); }
  .topbar-inner { height: 57px; gap: 7px; }
  .brand { gap: 5px; font-size: .95rem; }
  .brand-logo { width: 30px; height: 30px; }
  .topbar-nav { gap: 2px; }
  .nav-item { padding-inline: 6px; font-size: .82rem; }
  .community-links { inset-inline-start: auto; inset-inline-end: 0; }
  .account-entry { padding-inline: 7px; }
  .summary { grid-template-columns: repeat(2, 1fr); margin-block: 19px; }
  .board-heading { padding-inline: 12px; }
  .toolbar { padding: 13px 12px; }
  .exchange { padding: 5px 10px 5px 7px; gap: 5px; }
  .inputs { width: 100%; }
  .search { flex: 1; min-width: 0; }
  .search input { width: 100%; }
  th, td { padding-inline: 8px; }
  .column-note, .size-column { display: none; }
  .deviation-column { position: sticky; inset-inline-end: 0; z-index: 1; }
  .baseline-status { margin-inline-start: 0; }
  .routes { grid-template-columns: 1fr; }
  .expand-column { width: 24px; }
  .expand-cell { padding-right: 2px; }
  .expand-button { width: 26px; }
  .asset-cell { min-width: unset; gap: 5px; }
  .asset-mark { width: 23px; height: 23px; font-size: .62rem; border-radius: 6px; }
  .board-footer { padding-inline: 12px; }
  .footer-content { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; padding-block: 22px 19px; }
  .footer-brand { grid-column: 1 / -1; }
  .history-dialog { width: calc(100% - 16px); max-height: calc(100dvh - 16px); }
  .history-panel { padding: 14px; }
  .history-pair { flex-basis: 100%; gap: 6px; }
  .history-controls > .history-control { flex-basis: calc(50% - 6px); }
  .history-stats { gap: 5px; }
  .history-stats > div { padding-inline: 7px; }
  #history-canvas { height: 190px; }
}
@media (max-width: 440px) {
  .search { flex-basis: 100%; }
}
@media (max-width: 430px) {
  .topbar-inner { display: grid; grid-template-columns: minmax(0, 1fr) auto; height: auto; padding-block: 8px; }
  .topbar-nav { grid-area: 2 / 1 / 3 / -1; margin-inline-end: 0; }
  .topbar .account-controls { grid-area: 1 / 2; }
}
@media (max-width: 370px) {
  .asset-mark { display: none; }
  th, td { padding-inline: 6px; }
}

.automation-docs { max-width: 960px; padding-top: clamp(30px, 6vw, 72px); padding-bottom: 60px; }
.automation-intro h1 { margin: 0 0 10px; font-size: clamp(1.8rem, 4vw, 3rem); line-height: 1.2; }
.automation-intro p, .automation-docs section p, .automation-docs li { color: var(--muted); line-height: 1.7; }
.automation-docs a:not(.nav-item) { text-underline-offset: 3px; }
.automation-toc { display: flex; gap: 15px; flex-wrap: wrap; margin: 14px 0 25px; }
.automation-docs section { background: var(--surface); padding: clamp(15px, 4vw, 26px); border: 1px solid var(--border); border-radius: 12px; margin-bottom: 14px; scroll-margin-top: 76px; }
.automation-docs h2 { margin: 0 0 10px; font-size: 1.22rem; }
.automation-docs h3 { font-size: 1rem; }
.automation-docs pre { max-width: 100%; overflow-x: auto; padding: 13px; background: #0e131c; border: 1px solid var(--border); border-radius: 8px; }
.automation-docs code { font-family: var(--mono); font-size: .86rem; }
.automation-docs li + li { margin-top: 7px; }
.automation-command-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: .875rem; }
.automation-command-label { display: flex; flex-wrap: wrap; align-items: center; gap: 7px 10px; }
.automation-release {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 4px 8px;
  border: 1px solid #99603d;
  border-radius: 6px;
  background: #3a291f;
  color: #ffd0aa;
  font-size: .77rem;
  white-space: nowrap;
}
.automation-release strong { color: #ffe5ce; font: 700 .95rem/1.2 var(--mono); }
.automation-command-heading button { color: #ffd0aa; border-color: #73513d; background: #3a291f; }
.automation-command-heading .automation-changelog-toggle {
  padding: 4px 8px;
  font-size: .8rem;
  color: var(--muted);
  border-color: var(--border);
  background: transparent;
}
.automation-command-heading .automation-changelog-toggle:hover,
.automation-command-heading .automation-changelog-toggle[aria-expanded="true"] { color: var(--text); border-color: var(--subtle); }
.automation-changelog {
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: .875rem;
  color: var(--muted);
}
.automation-changelog ul { margin: 0 0 8px; padding-inline-start: 1.25em; }
.automation-changelog strong { color: var(--text); }
.automation-command pre { margin: 8px 0 4px; white-space: pre-wrap; overflow-wrap: anywhere; }
.automation-command [role="status"] { margin: 0; font-size: .875rem; }
.automation-docs details { margin-top: 12px; }
.automation-docs summary { cursor: pointer; color: var(--text); }
.automation-glossary { display: grid; gap: 10px; }
.automation-glossary div { padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; }
.automation-glossary dt { font-weight: 650; }
.automation-glossary dd { margin: 4px 0 0; line-height: 1.55; color: var(--muted); }
