:root {
  color-scheme: dark;
  --bg: #060604;
  --panel: #12110c;
  --panel-2: #1e1a10;
  --text: #fff7d1;
  --muted: #b8aa73;
  --line: #3d351b;
  --accent: #ffd21f;
  --accent-2: #ffec80;
  --danger: #ff5a5f;
  --blue: #ffd21f;
  --result-panel: #1b1f24;
  --result-panel-2: #242932;
  --result-text: #f2f5f7;
  --result-muted: #9aa4af;
  --result-line: #343b45;
  --result-accent: #00c46a;
  --result-price: #f2c84b;
  --bid-green: #00c46a;
  --ask-red: #ff6b6b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 1120px;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
}

.app-shell {
  width: min(1500px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 20px 0 32px;
}

.toolbar,
.query-panel,
.venue-panel,
.runbar,
.summary-grid article,
.table-wrap,
.messages {
  border: 1px solid var(--line);
  background: var(--panel);
}

.toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 20px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 24px;
  font-weight: 700;
  color: var(--accent);
}

h2 {
  font-size: 16px;
  font-weight: 700;
}

p,
small,
label,
#status {
  color: var(--muted);
}

.toolbar p {
  margin-top: 5px;
  color: var(--accent-2);
}

.query-panel {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 12px;
  padding: 14px;
  border-top: 0;
}

.field {
  display: grid;
  gap: 6px;
}

.action-field button {
  width: 100%;
}

label {
  font-size: 12px;
}

input,
select,
button {
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0b0b08;
  color: var(--text);
  font: inherit;
}

input,
select {
  padding: 0 10px;
}

button {
  padding: 0 12px;
  cursor: pointer;
  background: var(--panel-2);
}

button:hover {
  border-color: var(--accent);
}

.venue-panel {
  margin-top: 14px;
  padding: 14px;
}

.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.venue-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(130px, 1fr));
  gap: 8px;
}

.venue-tile {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 8px;
  align-items: center;
  min-height: 48px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #16140d;
}

.venue-tile input {
  width: 16px;
  height: 16px;
}

.venue-tile.disabled {
  opacity: 0.45;
}

.venue-tile.disabled strong,
.venue-tile.disabled span {
  color: #7b8490;
}

.venue-tile strong {
  display: block;
  font-size: 13px;
}

.venue-tile span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.runbar {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 14px;
  padding: 12px 14px;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.check input {
  height: 16px;
  width: 16px;
}

#runButton {
  min-width: 128px;
  border-color: #d0a900;
  background: #9a7700;
  color: #fff5bd;
  font-weight: 700;
}

#readPriceButton {
  border-color: #8f7410;
  background: #3a2d08;
  color: #ffe477;
  font-weight: 700;
}

#applyFilterButton {
  width: 100%;
  border-color: #c9a000;
  background: #5a4500;
  color: #fff0a8;
  font-weight: 700;
}

.progress-panel {
  display: none;
  flex: 1;
  min-width: 260px;
}

.progress-panel.active {
  display: block;
}

.progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
}

.progress-track {
  height: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #0a0906;
}

.progress-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #fff1a6);
  transition: width 180ms ease;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-top: 14px;
}

.summary-grid article {
  padding: 14px;
}

.summary-grid span,
.summary-grid small {
  display: block;
}

.summary-grid strong {
  display: block;
  margin: 6px 0 4px;
  font-size: 24px;
}

.result-bar {
  display: grid;
  grid-template-columns: auto minmax(260px, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  color: var(--result-text);
}

.tabs,
.side-filter {
  display: flex;
  align-items: center;
  gap: 8px;
}

.side-filter {
  justify-self: center;
}

.export-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.result-bar button {
  border-color: var(--result-line);
  background: var(--result-panel-2);
  color: var(--result-text);
}

.result-bar button:hover {
  border-color: var(--result-accent);
}

#pigAnalysisButton {
  border-color: #b84a4f;
  color: var(--ask-red);
}

#pigAnalysisButton:hover {
  border-color: #ff8588;
}

.tab.active {
  border-color: var(--result-accent);
  color: var(--result-accent);
}

.side-filter-button {
  min-width: 72px;
  font-weight: 700;
}

.side-filter-button.active {
  border-color: var(--result-accent);
  color: var(--result-accent);
  background: rgba(0, 196, 106, 0.12);
}

.side-filter-button[data-side-filter="ask"].active {
  border-color: #b84a4f;
  color: var(--ask-red);
  background: rgba(255, 107, 107, 0.12);
}

.table-wrap {
  display: none;
  margin-top: 8px;
  overflow: auto;
  max-height: 58vh;
  border-color: var(--result-line);
  background: var(--result-panel);
  color: var(--result-text);
}

.table-wrap.active {
  display: block;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1040px;
}

th,
td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--result-line);
  text-align: right;
  white-space: nowrap;
}

th {
  position: sticky;
  top: 0;
  background: var(--result-panel-2);
  color: var(--result-muted);
  font-size: 12px;
  z-index: 1;
}

tfoot td {
  position: sticky;
  bottom: 0;
  border-top: 1px solid var(--result-accent);
  border-bottom: 0;
  background: #20262e;
  color: var(--result-text);
  font-weight: 700;
  z-index: 1;
}

tfoot .total-label {
  color: var(--result-accent);
}

tfoot .summary-total-row td {
  bottom: 38px;
}

tfoot .market-value-row td {
  bottom: 0;
  border-top-color: var(--result-line);
  background: #1b2027;
}

tfoot .market-value {
  color: var(--result-price);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

th:first-child,
td:first-child,
th:nth-child(2),
td:nth-child(2) {
  text-align: left;
}

td.price {
  color: var(--result-price);
  font-variant-numeric: tabular-nums;
}

td.venue {
  color: var(--result-text);
  font-weight: 700;
}

.side-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 22px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.side-bid {
  border-color: #0a8f5d;
  color: var(--bid-green);
  background: rgba(0, 196, 106, 0.1);
}

.side-ask {
  border-color: #b84a4f;
  color: var(--ask-red);
  background: rgba(255, 107, 107, 0.12);
}

.messages {
  display: none;
  margin-top: 12px;
  padding: 12px;
}

.messages.active {
  display: block;
}

.messages .error {
  color: var(--danger);
}

.messages .note {
  color: var(--muted);
}

.message-action {
  display: inline-flex;
  align-items: center;
  margin: 8px 8px 0 0;
  border-color: var(--accent);
  color: var(--accent);
}

.filter-hint-modal {
  position: fixed;
  inset: 0;
  z-index: 28;
  display: none;
}

.filter-hint-modal.active {
  display: block;
}

.filter-hint-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.58);
}

.filter-hint-panel {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(460px, calc(100vw - 32px));
  padding: 18px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.5);
  transform: translate(-50%, -50%);
}

.filter-hint-panel h2 {
  color: var(--accent);
}

.filter-hint-panel p {
  margin-top: 10px;
  line-height: 1.65;
  color: var(--accent-2);
}

.filter-hint-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

.filter-hint-actions button {
  border-color: var(--line);
  background: var(--panel-2);
  color: var(--text);
}

#filterHintReadPrice,
#filterHintApplyRange {
  border-color: var(--accent);
  color: var(--accent);
}

.admin-password-modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: none;
}

.admin-password-modal.active {
  display: block;
}

.admin-password-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.58);
}

.admin-password-panel {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(420px, calc(100vw - 32px));
  padding: 18px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.5);
  transform: translate(-50%, -50%);
}

.admin-password-panel h2 {
  color: var(--accent);
}

.admin-password-panel p {
  margin-top: 10px;
  color: var(--accent-2);
}

#adminPasswordInput {
  width: 100%;
  margin-top: 14px;
}

.admin-password-error {
  min-height: 18px;
  margin-top: 8px;
  color: var(--danger);
  font-size: 12px;
}

.admin-password-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}

.admin-password-actions button {
  border-color: var(--line);
  background: var(--panel-2);
  color: var(--text);
}

#adminPasswordConfirm {
  border-color: var(--accent);
  color: var(--accent);
}

.copy-history-drawer {
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
}

.copy-history-drawer.active {
  pointer-events: auto;
}

.copy-history-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  transition: background 160ms ease;
}

.copy-history-drawer.active .copy-history-backdrop {
  background: rgba(0, 0, 0, 0.28);
}

.copy-history-panel {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  width: min(520px, 92vw);
  height: 100%;
  border-left: 1px solid var(--result-line);
  background: var(--result-panel);
  color: var(--result-text);
  box-shadow: -18px 0 38px rgba(0, 0, 0, 0.36);
  transform: translateX(100%);
  transition: transform 180ms ease;
}

.copy-history-drawer.active .copy-history-panel {
  transform: translateX(0);
}

.copy-history-head,
.copy-history-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid var(--result-line);
}

.copy-history-head h2 {
  color: var(--result-text);
}

.copy-history-head p {
  margin-top: 4px;
  color: var(--result-muted);
  font-size: 12px;
}

.copy-history-panel button {
  border-color: var(--result-line);
  background: var(--result-panel-2);
  color: var(--result-text);
}

.copy-history-panel button:hover {
  border-color: var(--result-accent);
}

.copy-history-list {
  flex: 1;
  overflow: auto;
  padding: 10px;
}

.copy-history-empty {
  display: none;
  padding: 18px 14px;
  color: var(--result-muted);
}

.copy-history-empty.active {
  display: block;
}

.copy-history-item {
  padding: 12px;
  border: 1px solid var(--result-line);
  border-radius: 6px;
  background: #151a20;
}

.copy-history-item + .copy-history-item {
  margin-top: 10px;
}

.copy-history-title {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--result-text);
  font-weight: 700;
}

.copy-history-title time {
  color: var(--result-muted);
  font-size: 12px;
  font-weight: 400;
  white-space: nowrap;
}

.copy-history-meta {
  margin-top: 7px;
  color: var(--result-muted);
  font-size: 12px;
  line-height: 1.55;
}

.copy-history-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.copy-history-actions button[data-copy-history-action="copy"] {
  border-color: var(--result-accent);
  color: var(--result-accent);
}

.pig-analysis-modal {
  position: fixed;
  inset: 0;
  z-index: 24;
  display: none;
}

.pig-analysis-modal.active {
  display: block;
}

.pig-analysis-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.56);
}

.pig-analysis-panel {
  position: absolute;
  top: 5vh;
  left: 50%;
  display: flex;
  flex-direction: column;
  width: min(1080px, calc(100vw - 48px));
  max-height: 90vh;
  border: 1px solid var(--result-line);
  background: var(--result-panel);
  color: var(--result-text);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.5);
  transform: translateX(-50%);
}

.pig-analysis-head,
.pig-analysis-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid var(--result-line);
}

.pig-analysis-head h2 {
  color: var(--ask-red);
}

.pig-analysis-head p {
  margin-top: 4px;
  color: var(--result-muted);
  font-size: 12px;
}

.pig-analysis-tools {
  flex-wrap: wrap;
  justify-content: flex-start;
}

.pig-analysis-panel button {
  border-color: var(--result-line);
  background: var(--result-panel-2);
  color: var(--result-text);
}

.pig-analysis-panel button:hover {
  border-color: var(--result-accent);
}

#pigRunAnalysis {
  border-color: #b84a4f;
  color: var(--ask-red);
  font-weight: 700;
}

#pigCopyChatGPT {
  border-color: var(--result-accent);
  color: var(--result-accent);
  font-weight: 700;
}

.pig-analysis-empty {
  display: none;
  padding: 16px 14px;
  color: var(--result-muted);
}

.pig-analysis-empty.active {
  display: block;
}

.pig-record-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 10px;
  max-height: 220px;
  overflow: auto;
  padding: 12px 14px;
  border-bottom: 1px solid var(--result-line);
}

.pig-record-item {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 8px;
  align-items: start;
  padding: 10px;
  border: 1px solid var(--result-line);
  border-radius: 6px;
  background: #151a20;
}

.pig-record-item input {
  width: 16px;
  height: 16px;
  margin-top: 2px;
}

.pig-record-title {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-weight: 700;
}

.pig-record-title time {
  color: var(--result-muted);
  font-size: 12px;
  font-weight: 400;
  white-space: nowrap;
}

.pig-record-meta {
  margin-top: 6px;
  color: var(--result-muted);
  font-size: 12px;
  line-height: 1.5;
}

.pig-analysis-result {
  overflow: auto;
  padding: 14px;
}

.pig-analysis-result:empty {
  display: none;
}

.pig-risk-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.pig-risk-card {
  padding: 12px;
  border: 1px solid var(--result-line);
  background: #151a20;
}

.pig-risk-card span {
  display: block;
  color: var(--result-muted);
  font-size: 12px;
}

.pig-risk-card strong {
  display: block;
  margin-top: 6px;
  font-size: 22px;
}

.pig-risk-card.high strong,
.pig-risk-card.very-high strong {
  color: var(--ask-red);
}

.pig-risk-card.medium strong {
  color: var(--result-price);
}

.pig-risk-section {
  margin-top: 14px;
}

.pig-risk-section h3 {
  margin: 0 0 8px;
  font-size: 15px;
  color: var(--result-text);
}

.pig-risk-list {
  margin: 0;
  padding-left: 18px;
  color: var(--result-text);
  line-height: 1.7;
}

.pig-risk-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
}

.pig-risk-table th,
.pig-risk-table td {
  padding: 8px 9px;
}

.pig-risk-note {
  margin-top: 12px;
  color: var(--result-muted);
  font-size: 12px;
  line-height: 1.6;
}

.replay-workspace {
  margin-top: 18px;
  border: 1px solid var(--result-line);
  background: #11151a;
  color: var(--result-text);
}

.replay-header,
.replay-query-strip,
.replay-transport,
.replay-comparison-strip {
  display: flex;
  align-items: center;
}

.replay-header {
  justify-content: space-between;
  gap: 20px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--result-line);
  background: #171b21;
}

.replay-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.replay-header h2 {
  color: var(--result-text);
  font-size: 18px;
}

.replay-header p {
  margin-top: 5px;
  color: var(--result-muted);
  font-size: 12px;
}

.replay-preview-badge {
  padding: 3px 7px;
  border: 1px solid #76621c;
  border-radius: 4px;
  color: var(--result-price);
  font-size: 11px;
}

.replay-window-summary {
  display: grid;
  gap: 4px;
  text-align: right;
}

.replay-window-summary span {
  color: var(--result-muted);
  font-size: 11px;
}

.replay-window-summary strong {
  color: var(--result-price);
  font-size: 13px;
}

.replay-query-strip {
  display: grid;
  grid-template-columns: 0.75fr 1fr 1fr 1fr 1fr auto;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--result-line);
}

.replay-field {
  display: grid;
  gap: 5px;
}

.replay-field label {
  color: var(--result-muted);
}

.replay-field input {
  width: 100%;
  border-color: var(--result-line);
  background: #0c1014;
  color: var(--result-text);
}

.replay-load-button {
  align-self: end;
  min-width: 110px;
  border-color: #8f7410;
  background: #3a2d08;
  color: #ffe477;
  font-weight: 700;
}

.replay-transport {
  justify-content: space-between;
  gap: 14px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--result-line);
  background: #0d1116;
}

.replay-controls,
.replay-speed,
.replay-clock {
  display: flex;
  align-items: center;
}

.replay-controls,
.replay-speed {
  gap: 5px;
}

.replay-controls button,
.replay-speed button {
  min-width: 36px;
  height: 30px;
  padding: 0 9px;
  border-color: var(--result-line);
  background: var(--result-panel-2);
  color: var(--result-text);
}

.replay-controls .replay-play-button {
  width: 42px;
  border-color: #8f7410;
  background: #6f5708;
  color: #fff1a8;
}

.replay-speed button.active {
  border-color: var(--result-accent);
  color: var(--result-accent);
}

.replay-clock {
  gap: 7px;
}

.replay-clock span,
.replay-clock small {
  color: var(--result-muted);
  font-size: 11px;
}

.replay-clock strong {
  color: var(--result-price);
  font-size: 17px;
  font-variant-numeric: tabular-nums;
}

.replay-timeline {
  position: relative;
  padding: 28px 22px 14px 70px;
  border-bottom: 1px solid var(--result-line);
  background: #15191e;
}

.timeline-labels {
  position: absolute;
  top: 7px;
  right: 22px;
  left: 70px;
  display: flex;
  justify-content: space-between;
  color: var(--result-muted);
  font-size: 10px;
}

.timeline-track {
  position: relative;
  height: 18px;
  border-top: 1px solid #353c45;
}

.timeline-track + .timeline-track {
  margin-top: 8px;
}

.timeline-track-name {
  position: absolute;
  top: -8px;
  left: -54px;
  width: 42px;
  color: var(--result-muted);
  font-size: 10px;
  text-align: right;
}

.timeline-track i {
  position: absolute;
  top: -4px;
  width: 3px;
  height: 8px;
  background: var(--result-accent);
}

.tas-track i {
  background: var(--result-price);
}

.timeline-track i.large {
  top: -7px;
  width: 5px;
  height: 14px;
}

.timeline-track i.cancel {
  background: var(--ask-red);
}

.timeline-cursor {
  position: absolute;
  top: 20px;
  bottom: 8px;
  width: 1px;
  background: #e7edf3;
}

.timeline-cursor::after {
  position: absolute;
  top: -3px;
  left: -4px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #fff;
  content: "";
}

.timeline-cursor span {
  position: absolute;
  top: -17px;
  left: 7px;
  padding: 2px 5px;
  background: #e7edf3;
  color: #11151a;
  font-size: 9px;
  white-space: nowrap;
}

.replay-data-grid {
  display: grid;
  grid-template-columns: minmax(350px, 0.95fr) minmax(430px, 1.2fr) minmax(330px, 0.85fr);
  min-height: 430px;
}

.replay-column {
  min-width: 0;
  border-right: 1px solid var(--result-line);
  background: var(--result-panel);
}

.replay-column:last-child {
  border-right: 0;
}

.replay-column-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 58px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--result-line);
  background: #20252d;
}

.replay-column-head h3 {
  margin: 0;
  color: var(--result-text);
  font-size: 14px;
}

.replay-column-head span {
  display: block;
  margin-top: 3px;
  color: var(--result-muted);
  font-size: 10px;
}

.replay-legend {
  color: var(--result-muted);
  font-size: 10px;
  white-space: nowrap;
}

.replay-legend b {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin: 0 4px 0 7px;
  border-radius: 50%;
}

.buy-dot {
  background: var(--bid-green);
}

.sell-dot {
  background: var(--ask-red);
}

.replay-table-scroll {
  max-height: 372px;
  overflow: auto;
}

.replay-table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  font-size: 11px;
}

.replay-table th,
.replay-table td {
  height: 38px;
  padding: 0 9px;
  border-bottom: 1px solid var(--result-line);
  text-align: right;
  white-space: nowrap;
}

.replay-table th:first-child,
.replay-table td:first-child {
  text-align: left;
}

.replay-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #171c22;
  color: var(--result-muted);
  font-weight: 500;
}

.replay-table td {
  color: var(--result-text);
  font-variant-numeric: tabular-nums;
}

.replay-table .focus-row {
  background: rgba(242, 200, 75, 0.1);
}

.replay-table .focus-row td:first-child {
  box-shadow: inset 3px 0 var(--result-price);
}

.trade-side {
  display: inline-block;
  padding: 2px 5px;
  border: 1px solid var(--result-line);
  border-radius: 4px;
  font-size: 9px;
}

.trade-side.buy {
  border-color: #008f51;
  color: var(--bid-green);
}

.trade-side.sell {
  border-color: #a94a4e;
  color: var(--ask-red);
}

.trade-side.neutral {
  color: var(--result-muted);
}

.event-filter-preview {
  display: flex;
  gap: 3px;
}

.event-filter-preview span {
  margin: 0;
  padding: 3px 5px;
  border: 1px solid var(--result-line);
  border-radius: 3px;
}

.event-filter-preview span.active {
  border-color: var(--result-accent);
  color: var(--result-accent);
}

.event-list {
  max-height: 372px;
  overflow: auto;
}

.event-item {
  display: grid;
  grid-template-columns: 94px 72px 1fr;
  column-gap: 9px;
  align-items: center;
  min-height: 58px;
  padding: 8px 11px;
  border-bottom: 1px solid var(--result-line);
  box-shadow: inset 3px 0 #65707c;
}

.event-item time {
  color: var(--result-muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.event-item .event-type {
  color: var(--result-text);
  font-size: 10px;
  font-weight: 700;
}

.event-item strong {
  min-width: 0;
  overflow: hidden;
  color: var(--result-text);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-item small {
  grid-column: 3;
  margin-top: 3px;
  color: var(--result-muted);
  font-size: 10px;
}

.event-item.tas-event {
  box-shadow: inset 3px 0 var(--result-price);
}

.event-item.tas-sell-event,
.event-item.l2-ask-event {
  box-shadow: inset 3px 0 var(--ask-red);
}

.event-item.l2-bid-event {
  box-shadow: inset 3px 0 var(--bid-green);
}

.event-item.current-event {
  background: rgba(242, 200, 75, 0.1);
}

.book-spread {
  color: var(--result-price);
  font-size: 11px;
  white-space: nowrap;
}

.book-head,
.book-row {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 0.9fr 1fr;
  align-items: center;
  min-height: 40px;
  padding: 0 12px;
  border-bottom: 1px solid var(--result-line);
  font-size: 11px;
}

.book-head {
  min-height: 30px;
  color: var(--result-muted);
  font-size: 9px;
}

.book-head span:not(:first-child),
.book-row strong,
.book-row b {
  text-align: right;
}

.book-row {
  position: relative;
  overflow: hidden;
}

.book-row > span,
.book-row > strong,
.book-row > b {
  position: relative;
  z-index: 1;
}

.book-row > i {
  position: absolute;
  top: 4px;
  right: 0;
  bottom: 4px;
  opacity: 0.12;
}

.ask-row > i {
  background: var(--ask-red);
}

.bid-row > i {
  background: var(--bid-green);
}

.ask-row strong,
.ask-row b {
  color: #ff9a9d;
}

.bid-row strong,
.bid-row b {
  color: #4be39a;
}

.book-row.best-row {
  background: #20262d;
}

.book-mid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 10px 12px;
  border-top: 1px solid #59616c;
  border-bottom: 1px solid #59616c;
  background: #11151a;
}

.book-mid div {
  display: grid;
  gap: 3px;
}

.book-mid div:last-child {
  text-align: right;
}

.book-mid span {
  color: var(--result-muted);
  font-size: 9px;
}

.book-mid strong {
  color: var(--result-price);
  font-size: 16px;
}

.book-imbalance {
  padding: 14px 12px;
}

.book-imbalance > div:first-child {
  display: flex;
  justify-content: space-between;
  color: var(--result-muted);
  font-size: 10px;
}

.imbalance-bar {
  height: 5px;
  margin-top: 7px;
  overflow: hidden;
  background: var(--ask-red);
}

.imbalance-bar i {
  display: block;
  width: 56%;
  height: 100%;
  background: var(--bid-green);
}

.replay-comparison-strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  border-top: 1px solid var(--result-line);
  background: #181d23;
}

.replay-comparison-strip > div {
  min-width: 0;
  padding: 12px 15px;
  border-right: 1px solid var(--result-line);
}

.replay-comparison-strip > div:last-child {
  border-right: 0;
}

.replay-comparison-strip span {
  display: block;
  margin-bottom: 6px;
  color: var(--result-muted);
  font-size: 10px;
}

.replay-comparison-strip strong {
  margin-right: 5px;
  color: var(--result-text);
  font-size: 18px;
}

.replay-comparison-strip small,
.replay-comparison-strip b {
  color: var(--result-muted);
  font-size: 10px;
  font-weight: 400;
}

.replay-comparison-strip .comparison-gap strong {
  color: var(--result-price);
}

.replay-comparison-strip .buy-text {
  color: var(--bid-green);
}

.replay-comparison-strip .sell-text {
  color: var(--ask-red);
}

/* Sterling-style replay preview */
.replay-workspace {
  border-color: #393939;
  background: #202020;
  color: #ededed;
  font-family: "Arial Narrow", "Segoe UI", Arial, sans-serif;
}

.replay-header {
  padding: 10px 12px;
  border-color: #474747;
  background: #171717;
}

.replay-header h2 {
  color: #f1f1f1;
  font-size: 16px;
}

.replay-header p,
.replay-window-summary span {
  color: #a9a9a9;
}

.replay-preview-badge {
  border-color: #aaa000;
  border-radius: 0;
  background: #3b3900;
  color: #fff34a;
}

.replay-query-strip {
  gap: 7px;
  padding: 8px;
  border-color: #474747;
  background: #303030;
}

.replay-field label {
  color: #c8c8c8;
}

.replay-field input {
  height: 29px;
  border-color: #5a5a5a;
  border-radius: 0;
  background: #101010;
  color: #f0f0f0;
}

.replay-load-button {
  height: 29px;
  border-color: #c8b900;
  border-radius: 0;
  background: #5d5500;
  color: #fff86a;
}

.replay-load-button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.replay-transport {
  padding: 7px 9px;
  border-color: #474747;
  background: #202020;
}

.replay-scrubber {
  display: grid;
  grid-template-columns: auto minmax(180px, 1fr) 116px auto;
  align-items: center;
  gap: 10px;
  padding: 7px 14px;
  border-bottom: 1px solid #474747;
  background: #292929;
  color: #cfcfcf;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.replay-scrubber output {
  color: #fff23f;
  font-size: 11px;
  text-align: center;
  white-space: nowrap;
}

.replay-scrubber input[type="range"] {
  width: 100%;
  height: 18px;
  margin: 0;
  appearance: none;
  background: transparent;
  cursor: ew-resize;
}

.replay-scrubber input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  border: 1px solid #6a6a6a;
  background: linear-gradient(to right, #d8c400 0 var(--scrubber-progress, 0%), #4a4a4a var(--scrubber-progress, 0%) 100%);
}

.replay-scrubber input[type="range"]::-webkit-slider-thumb {
  width: 13px;
  height: 16px;
  margin-top: -7px;
  border: 1px solid #fff45a;
  border-radius: 0;
  appearance: none;
  background: #817300;
}

.replay-scrubber input[type="range"]::-moz-range-track {
  height: 4px;
  border: 1px solid #6a6a6a;
  background: #4a4a4a;
}

.replay-scrubber input[type="range"]::-moz-range-progress {
  height: 4px;
  background: #d8c400;
}

.replay-scrubber input[type="range"]::-moz-range-thumb {
  width: 13px;
  height: 16px;
  border: 1px solid #fff45a;
  border-radius: 0;
  background: #817300;
}

.replay-scrubber input[type="range"]:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.replay-controls button,
.replay-speed button {
  height: 27px;
  border-color: #565656;
  border-radius: 0;
  background: #363636;
}

.replay-controls .replay-play-button {
  border-color: #d2bd00;
  background: #6a5e00;
  color: #fff56b;
}

.replay-speed button.active {
  border-color: #00ca68;
  background: #17462f;
}

.replay-clock strong,
.replay-window-summary strong {
  color: #fff23f;
}

.replay-timeline {
  padding-top: 27px;
  border-color: #474747;
  background: #333;
}

.timeline-labels,
.timeline-track-name {
  color: #d1d1d1;
}

.timeline-track {
  border-color: #555;
}

#replayCursor {
  left: calc(70px + (100% - 92px) * var(--replay-progress, 0));
}

.sterling-window {
  position: relative;
  margin: 9px;
  border: 2px solid #0e0e0e;
  outline: 1px solid #7b7b7b;
  background: #686868;
  color: #111;
  font-family: "Arial Narrow", "Roboto Condensed", "Segoe UI", Arial, sans-serif;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.5);
}

.sterling-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 29px;
  padding-left: 7px;
  background: #171717;
  color: #e8e8e8;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 12px;
}

.sterling-titlebar > div,
.sterling-window-actions {
  display: flex;
  align-items: center;
}

.sterling-app-icon {
  width: 6px;
  height: 6px;
  margin: -7px 15px 0 0;
  background: #f44444;
  box-shadow: 7px 0 #ffe600, 0 7px #19d550, 7px 7px #426bff;
}

.sterling-window-actions span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 29px;
  color: #dedede;
  font-size: 13px;
}

.sterling-window-actions span:last-child {
  background: #3a1717;
}

.sterling-menubar {
  display: flex;
  align-items: center;
  gap: 17px;
  height: 25px;
  padding: 0 8px;
  border-bottom: 1px solid #080808;
  background: #252525;
  color: #d2d2d2;
  font-size: 11px;
}

.sterling-menubar b {
  margin-left: auto;
  color: #fff24b;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}

.sterling-quote-strip {
  display: grid;
  grid-template-columns: 1.1fr 0.8fr repeat(6, 1fr);
  min-height: 45px;
  border-bottom: 2px solid #252525;
  background: #151515;
  color: #eee;
}

.sterling-quote-strip > div {
  display: grid;
  align-content: center;
  gap: 2px;
  min-width: 0;
  padding: 4px 9px;
  border-right: 1px solid #3f3f3f;
}

.sterling-quote-strip > div:last-child {
  border-right: 0;
}

.sterling-quote-strip small {
  color: #8e8e8e;
  font-size: 8px;
}

.sterling-quote-strip strong {
  overflow: hidden;
  color: #efefef;
  font-size: 14px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sterling-symbol-box {
  grid-template-columns: 1fr auto;
  align-items: center;
  background: #080808;
}

.sterling-symbol-box strong {
  color: #fff;
  font-size: 16px;
  font-weight: 700;
}

.sterling-symbol-box span {
  color: #bdbdbd;
  font-size: 9px;
}

.sterling-quote-strip .sterling-change {
  place-items: center;
  align-content: center;
  font-size: 14px;
  font-weight: 700;
}

.sterling-change.up {
  background: #0a7c21;
  color: #fff;
}

.sterling-main-grid {
  display: grid;
  grid-template-columns: minmax(650px, 2fr) minmax(360px, 0.95fr);
  min-height: 512px;
}

.sterling-l2,
.sterling-tas {
  min-width: 0;
  background: #686868;
}

.sterling-tas {
  border-left: 3px solid #222;
}

.sterling-pane-title {
  display: flex;
  align-items: center;
  gap: 18px;
  height: 28px;
  padding: 0 8px;
  border-bottom: 1px solid #101010;
  background: #2a2a2a;
  color: #e6e6e6;
  font-size: 10px;
}

.sterling-pane-title strong {
  font-size: 12px;
}

.sterling-pane-title span {
  color: #bdbdbd;
}

.sterling-pane-title b {
  margin-left: auto;
  color: #fff24a;
  font-weight: 500;
}

.sterling-l3-toggle {
  height: 21px;
  margin-left: auto;
  padding: 0 8px;
  border: 1px solid #777;
  border-radius: 2px;
  background: #444;
  color: #ddd;
  font: 700 10px/1 "Segoe UI", Arial, sans-serif;
  cursor: pointer;
}

.sterling-l3-toggle.active {
  border-color: #ffdf00;
  background: #685b00;
  color: #fff36a;
}

.sterling-l3-toggle + #replaySpread {
  margin-left: 0;
}

.sterling-pane-title .offexchange-summary {
  padding: 2px 5px;
  border: 1px solid #f0a125;
  background: #53300a;
  color: #ffd08a;
  font-weight: 700;
}

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

.sterling-book-side {
  min-width: 0;
}

.sterling-side-rows {
  height: 456px;
  overflow: hidden;
}

.ask-book-side {
  border-left: 3px solid #292929;
}

.sterling-side-head,
.sterling-l2-row {
  display: grid;
  grid-template-columns: 1.05fr 0.72fr 0.42fr;
  align-items: center;
}

.sterling-side-head {
  height: 23px;
  padding: 0 7px;
  border-bottom: 1px solid #222;
  background: #4c4c4c;
  color: #ededed;
  font-size: 9px;
}

.sterling-side-head span:nth-child(n + 2) {
  text-align: right;
}

.sterling-l2-row {
  height: 24px;
  padding: 0 7px;
  border-bottom: 1px solid #5a5a5a;
  background: #717171;
  color: #111;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}

.sterling-l2-row:hover,
.sterling-l2-row.l3-selected {
  box-shadow: inset 0 0 0 2px #fff;
}

.sterling-l2-row span,
.sterling-l2-row b,
.sterling-l2-row em {
  overflow: hidden;
  text-overflow: clip;
  white-space: nowrap;
}

.sterling-l2-row b,
.sterling-l2-row em {
  text-align: right;
  font-style: normal;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}

.sterling-l2-row em.odd-lot {
  font-weight: 700;
}

.sterling-l2-row.depth-1 {
  background: #fff500;
}

.sterling-l2-row.depth-2 {
  background: #ff474b;
}

.sterling-l2-row.depth-3 {
  background: #363deb;
}

.sterling-l2-row.depth-4 {
  background: #16d13e;
}

.sterling-l2-row.depth-5 {
  background: #8a8a8a;
}

.sterling-tas-head,
.sterling-tas-row {
  display: grid;
  grid-template-columns: 1.15fr 0.55fr 0.65fr 1fr;
  align-items: center;
}

.sterling-tas-head {
  height: 23px;
  padding: 0 7px;
  border-bottom: 1px solid #222;
  background: #4c4c4c;
  color: #ededed;
  font-size: 9px;
}

.sterling-tas-head span:nth-child(2),
.sterling-tas-head span:nth-child(3) {
  text-align: right;
}

.sterling-tas-row {
  height: 24px;
  padding: 0 7px;
  border-bottom: 1px solid #555;
  background: #717171;
  color: #111;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.sterling-tas-row span,
.sterling-tas-row b,
.sterling-tas-row em,
.sterling-tas-row i {
  overflow: hidden;
  white-space: nowrap;
}

.sterling-tas-row b,
.sterling-tas-row em {
  text-align: right;
  font-style: normal;
  font-weight: 500;
}

.sterling-tas-row i {
  padding-left: 7px;
  font-style: normal;
}

.sterling-tas-row.offexchange-print {
  box-shadow: inset 4px 0 #ff9f1a;
}

.sterling-tas-row.offexchange-print i {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow: visible;
}

.sterling-tas-row mark {
  padding: 2px 3px;
  border: 1px solid #392000;
  background: #ffad32;
  color: #1b1000;
  font-size: 8px;
  font-style: normal;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.sterling-tas-row.print-buy {
  background: #18c844;
}

.sterling-tas-row.print-sell {
  background: #ff4a4d;
}

.sterling-tas-row.print-unknown {
  background: #8a8a8a;
}

.sterling-tas-rows {
  height: 432px;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-color: #777 #252525;
  scrollbar-width: thin;
}

.sterling-tas-rows::-webkit-scrollbar {
  width: 11px;
}

.sterling-tas-rows::-webkit-scrollbar-track {
  background: #252525;
}

.sterling-tas-rows::-webkit-scrollbar-thumb {
  border: 2px solid #252525;
  border-radius: 0;
  background: #777;
}

.sterling-tas-rows::-webkit-scrollbar-thumb:hover {
  background: #999;
}

.sterling-tas-limit-note {
  display: grid;
  place-items: center;
  height: 28px;
  border-top: 1px solid #555;
  background: #2c2c2c;
  color: #c9c9c9;
  font-size: 10px;
}

.sterling-empty-row {
  display: grid;
  place-items: center;
  height: 100%;
  background: #777;
  color: #242424;
  font-size: 12px;
}

.sterling-tas-row.selected-print {
  box-shadow: inset 0 0 0 2px #fff;
}

.sterling-tas-tabs {
  display: flex;
  align-items: center;
  height: 29px;
  border-top: 2px solid #333;
  background: #1f1f1f;
  color: #aaa;
  font-size: 9px;
}

.sterling-tas-tabs span {
  display: grid;
  place-items: center;
  width: 74px;
  height: 100%;
  border-right: 1px solid #444;
}

.sterling-tas-tabs span.active {
  background: #555;
  color: #fff;
}

.sterling-l3-panel {
  border-top: 3px solid #222;
  background: #191919;
  color: #e4e4e4;
  font-family: "Arial Narrow", "Roboto Condensed", "Segoe UI", Arial, sans-serif;
}

.sterling-l3-panel.is-collapsed {
  display: none;
}

.sterling-l3-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 31px;
  padding: 3px 8px;
  border-bottom: 1px solid #080808;
  background: #292929;
  font-size: 10px;
}

.sterling-l3-titlebar > div {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 8px;
}

.sterling-l3-titlebar strong {
  color: #fff;
  font-size: 12px;
}

.sterling-l3-titlebar b {
  overflow: hidden;
  color: #fff05b;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sterling-l3-preview {
  padding: 2px 5px;
  border: 1px solid #d5bd00;
  background: #605600;
  color: #fff470;
  font-weight: 700;
}

.sterling-l3-limitations {
  justify-content: flex-end;
  margin-left: 10px;
}

.sterling-l3-limitations span {
  padding: 2px 5px;
  border: 1px solid #515151;
  background: #202020;
  color: #aaa;
  white-space: nowrap;
}

.sterling-l3-limitations button {
  display: grid;
  place-items: center;
  width: 24px;
  height: 22px;
  border: 1px solid #6a6a6a;
  border-radius: 0;
  background: #3a3a3a;
  color: #eee;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.sterling-l3-summary {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 27px;
  padding: 0 8px;
  border-bottom: 1px solid #3f3f3f;
  background: #202020;
  color: #aaa;
  font-size: 10px;
}

.sterling-l3-summary b {
  margin-left: 3px;
  color: #f1f1f1;
  font-variant-numeric: tabular-nums;
}

.sterling-l3-summary span:last-child {
  margin-left: auto;
  color: #74dca0;
}

.sterling-l3-summary span:last-child.is-warning {
  color: #ffbc55;
}

.sterling-l3-scroll {
  max-height: 246px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-color: #777 #252525;
  scrollbar-width: thin;
}

.sterling-l3-head,
.sterling-l3-row {
  display: grid;
  grid-template-columns: 52px minmax(180px, 1.5fr) 90px 58px 90px 100px 100px 118px 78px;
  align-items: center;
  min-width: 970px;
}

.sterling-l3-head {
  position: sticky;
  top: 0;
  z-index: 1;
  height: 23px;
  padding: 0 8px;
  border-bottom: 1px solid #151515;
  background: #4b4b4b;
  color: #ededed;
  font-size: 9px;
}

.sterling-l3-head span:nth-child(n + 4),
.sterling-l3-row span:nth-child(n + 4) {
  text-align: right;
}

.sterling-l3-rows {
  max-height: 223px;
  overflow-y: auto;
  scrollbar-color: #777 #252525;
  scrollbar-width: thin;
}

.sterling-l3-row {
  width: 100%;
  height: 24px;
  padding: 0 8px;
  border: 0;
  border-bottom: 1px solid #424242;
  background: #686868;
  color: #101010;
  font-family: inherit;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  text-align: left;
  cursor: pointer;
}

.sterling-l3-row:nth-child(even) {
  background: #747474;
}

.sterling-l3-row:hover,
.sterling-l3-row:focus-visible {
  outline: 0;
  box-shadow: inset 0 0 0 2px #fff36a;
}

.sterling-l3-row span {
  overflow: hidden;
  padding-right: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sterling-l3-row .queue-rank {
  color: #fff359;
  font-weight: 700;
  text-align: left;
}

.sterling-l3-row .side-bid {
  color: #003d17;
  font-weight: 700;
}

.sterling-l3-row .side-ask {
  color: #6a0007;
  font-weight: 700;
}

.sterling-l3-row .order-status {
  color: #173a21;
  font-weight: 700;
}

.sterling-l3-empty {
  display: grid;
  place-items: center;
  min-width: 970px;
  min-height: 84px;
  background: #626262;
  color: #202020;
  font-size: 11px;
}

.sterling-order-drawer {
  position: absolute;
  z-index: 20;
  top: 54px;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  width: min(470px, calc(100% - 20px));
  min-height: 560px;
  overflow: hidden;
  border-left: 2px solid #ffe100;
  background: #151515;
  color: #e8e8e8;
  box-shadow: -12px 0 24px rgba(0, 0, 0, 0.65);
  font-family: "Segoe UI", Arial, sans-serif;
  transform: translateX(102%);
  transition: transform 150ms ease-out;
  pointer-events: none;
}

.sterling-order-drawer.is-open {
  transform: translateX(0);
  pointer-events: auto;
}

.sterling-order-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 47px;
  padding-left: 12px;
  border-bottom: 1px solid #4a4300;
  background: #242200;
}

.sterling-order-drawer-head > div {
  display: grid;
  gap: 2px;
}

.sterling-order-drawer-head span {
  color: #aaa45d;
  font-size: 8px;
}

.sterling-order-drawer-head strong {
  color: #fff36a;
  font-size: 14px;
}

.sterling-order-drawer-head button {
  width: 42px;
  height: 47px;
  border: 0;
  border-left: 1px solid #4a4300;
  border-radius: 0;
  background: #302d00;
  color: #eee;
  font-size: 21px;
  cursor: pointer;
}

.sterling-order-identity {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 55px;
  padding: 8px 12px;
  border-bottom: 1px solid #3b3b3b;
  background: #1d1d1d;
}

.sterling-order-identity > div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.sterling-order-identity small,
.sterling-order-metrics small {
  color: #8f8f8f;
  font-size: 8px;
}

.sterling-order-identity strong {
  overflow: hidden;
  color: #fff;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sterling-order-identity > span {
  flex: none;
  padding: 4px 8px;
  border: 1px solid #00a75b;
  background: #082b1c;
  color: #40e79a;
  font-size: 10px;
  font-weight: 700;
}

.sterling-order-identity > span.is-filled {
  border-color: #20a95a;
  background: #0a3820;
  color: #6df2a7;
}

.sterling-order-identity > span.is-canceled,
.sterling-order-identity > span.is-cleared {
  border-color: #b24b4e;
  background: #361719;
  color: #ff8e91;
}

.sterling-order-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border-bottom: 1px solid #3b3b3b;
}

.sterling-order-metrics > div {
  display: grid;
  align-content: center;
  min-height: 51px;
  padding: 6px 8px;
  border-right: 1px solid #343434;
  border-bottom: 1px solid #343434;
}

.sterling-order-metrics > div:nth-child(5n) {
  border-right: 0;
}

.sterling-order-metrics strong {
  overflow: hidden;
  margin-top: 3px;
  color: #f1f1f1;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sterling-order-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 29px;
  padding: 0 10px;
  overflow-x: auto;
  border-bottom: 1px solid #3b3b3b;
  background: #202020;
  color: #8d8d8d;
  font-size: 9px;
  white-space: nowrap;
}

.sterling-order-meta b {
  margin-left: 3px;
  color: #d9d9d9;
  font-weight: 500;
}

.sterling-order-timeline {
  display: flex;
  flex: 1;
  min-height: 220px;
  flex-direction: column;
  overflow: hidden;
}

.sterling-order-timeline > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 32px;
  padding: 0 10px;
  border-bottom: 1px solid #3b3b3b;
  background: #202020;
}

.sterling-order-timeline > header strong {
  font-size: 11px;
}

.sterling-order-timeline > header span {
  color: #8f8f8f;
  font-size: 9px;
}

.sterling-order-timeline-head,
.sterling-order-event {
  display: grid;
  grid-template-columns: 100px 70px minmax(120px, 1fr) 90px;
  align-items: center;
  min-width: 410px;
}

.sterling-order-timeline-head {
  height: 23px;
  padding: 0 9px;
  border-bottom: 1px solid #202020;
  background: #4a4a4a;
  color: #eee;
  font-size: 8px;
}

.sterling-order-timeline-rows {
  flex: 1;
  overflow: auto;
  scrollbar-color: #777 #252525;
  scrollbar-width: thin;
}

.sterling-order-event {
  min-height: 35px;
  padding: 3px 9px;
  border-bottom: 1px solid #393939;
  background: #242424;
  color: #dedede;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.sterling-order-event:nth-child(even) {
  background: #2b2b2b;
}

.sterling-order-event span {
  overflow: hidden;
  padding-right: 7px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sterling-order-event b {
  justify-self: start;
  padding: 2px 5px;
  background: #575757;
  color: #fff;
  font-size: 9px;
}

.sterling-order-event b.event-add,
.sterling-order-event b.event-resting {
  background: #08713c;
}

.sterling-order-event b.event-modify {
  background: #6c5e00;
}

.sterling-order-event b.event-fill {
  background: #0d7844;
}

.sterling-order-event b.event-cancel,
.sterling-order-event b.event-clear {
  background: #92383c;
}

.sterling-order-empty {
  display: grid;
  place-items: center;
  min-height: 120px;
  color: #777;
  font-size: 10px;
}

.sterling-order-drawer > footer {
  padding: 7px 10px;
  border-top: 1px solid #4a4300;
  background: #242200;
  color: #aaa45d;
  font-size: 9px;
  line-height: 1.4;
}

@media (max-width: 700px) {
  .sterling-order-drawer {
    top: 29px;
    width: 100%;
    min-height: 620px;
    border-left: 0;
  }

  .sterling-order-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sterling-order-metrics > div:nth-child(5n) {
    border-right: 1px solid #343434;
  }

  .sterling-order-metrics > div:nth-child(2n) {
    border-right: 0;
  }
}

.sterling-event-ticker {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 31px;
  padding: 4px 8px;
  overflow: hidden;
  border-top: 2px solid #202020;
  background: #555;
  color: #111;
  font-size: 10px;
  white-space: nowrap;
}

.sterling-event-ticker b {
  padding: 2px 4px;
  color: #fff;
  font-size: 9px;
}

.sterling-event-ticker strong {
  font-weight: 600;
}

.ticker-time {
  font-variant-numeric: tabular-nums;
}

.ticker-bid {
  background: #007d28;
}

.ticker-trade {
  background: #6d6100;
}

.ticker-ask {
  background: #a6292e;
}

.ticker-arrow {
  color: #e6e6e6;
}

.sterling-offexchange-alert {
  display: grid;
  grid-template-columns: 20px auto auto 1fr;
  align-items: center;
  gap: 8px;
  min-height: 31px;
  padding: 4px 8px;
  border-top: 1px solid #332000;
  background: #3c2a13;
  color: #ffd28d;
  font-size: 10px;
}

.sterling-offexchange-alert > b {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 1px solid #ffad32;
  color: #ffbd52;
}

.sterling-offexchange-alert > strong {
  color: #ffbd52;
  white-space: nowrap;
}

.sterling-offexchange-alert > span {
  color: #fff;
  white-space: nowrap;
}

.sterling-offexchange-alert > small {
  overflow: hidden;
  color: #d7b57f;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sterling-offexchange-alert.is-empty {
  border-top-color: #444;
  background: #303030;
  color: #aaa;
}

.sterling-offexchange-alert.is-empty > b,
.sterling-offexchange-alert.is-empty > strong,
.sterling-offexchange-alert.is-empty > span,
.sterling-offexchange-alert.is-empty > small {
  border-color: #666;
  color: #aaa;
}

.sterling-statusbar {
  display: grid;
  grid-template-columns: 0.65fr 1fr repeat(4, 0.85fr) 0.55fr;
  height: 27px;
  background: #171717;
  color: #c7c7c7;
  font-size: 9px;
}

.sterling-statusbar span,
.sterling-statusbar b {
  display: flex;
  align-items: center;
  padding: 0 8px;
  border-right: 1px solid #3d3d3d;
}

.sterling-statusbar span:first-child {
  color: #fff34f;
  font-weight: 700;
}

.sterling-statusbar .status-offexchange {
  color: #ffbd52;
}

.sterling-statusbar b {
  justify-content: flex-end;
  color: #fff;
}

.sterling-comparison-strip {
  margin: 0 9px 9px;
  border: 1px solid #454545;
  background: #222;
}

.sterling-comparison-strip > div {
  padding-top: 9px;
  padding-bottom: 9px;
}

@media (max-width: 900px) {
  body {
    min-width: 0;
  }

  .app-shell {
    width: calc(100vw - 20px);
  }

  .toolbar,
  .panel-title,
  .runbar {
    align-items: stretch;
    flex-direction: column;
  }

  .query-panel,
  .venue-grid,
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .progress-panel {
    min-width: 0;
    width: 100%;
  }

  .pig-analysis-panel {
    top: 2vh;
    width: calc(100vw - 20px);
    max-height: 96vh;
  }

  .pig-record-list,
  .pig-risk-cards {
    grid-template-columns: 1fr;
  }

  .replay-header,
  .replay-transport {
    align-items: stretch;
    flex-direction: column;
  }

  .replay-scrubber {
    grid-template-columns: auto minmax(120px, 1fr) auto;
  }

  .replay-scrubber output {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .replay-window-summary {
    text-align: left;
  }

  .replay-query-strip,
  .replay-data-grid,
  .replay-comparison-strip {
    grid-template-columns: 1fr;
  }

  .replay-column,
  .replay-comparison-strip > div {
    border-right: 0;
    border-bottom: 1px solid var(--result-line);
  }

  .replay-comparison-strip > div:last-child {
    border-bottom: 0;
  }

  .sterling-quote-strip {
    grid-template-columns: repeat(2, 1fr);
  }

  .sterling-main-grid {
    grid-template-columns: 1fr;
  }

  .sterling-tas {
    border-top: 3px solid #222;
    border-left: 0;
  }

  .sterling-event-ticker {
    flex-wrap: wrap;
    white-space: normal;
  }

  .sterling-statusbar {
    grid-template-columns: repeat(2, 1fr);
    height: auto;
  }

  .sterling-statusbar span,
  .sterling-statusbar b {
    min-height: 26px;
    border-bottom: 1px solid #3d3d3d;
  }

  .sterling-offexchange-alert {
    grid-template-columns: 20px 1fr;
  }

  .sterling-offexchange-alert > span,
  .sterling-offexchange-alert > small {
    grid-column: 2;
    white-space: normal;
  }
}
