:root {
  --bg: #eef2f6;
  --panel: #ffffff;
  --panel-alt: #f7fafc;
  --ink: #183042;
  --muted: #648097;
  --line: #d8e2ea;
  --brand: #0f6a8b;
  --brand-dark: #0b4d66;
  --accent: #26b3a6;
  --danger: #ba4d4d;
  --warning: #b9781e;
  --ok: #1f8a5b;
  --shadow: 0 20px 45px rgba(17, 52, 72, 0.09);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", "Helvetica Neue", sans-serif;
  background: radial-gradient(circle at top left, #f8fbfd 0, #edf3f7 45%, #e7eef4 100%);
  color: var(--ink);
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
  transition: grid-template-columns 180ms ease;
}

body.sidebar-collapsed .app-shell {
  grid-template-columns: 0 1fr;
}

.sidebar {
  background: linear-gradient(180deg, #12354b 0%, #0e2738 100%);
  color: #fff;
  padding: 28px 22px;
  overflow: hidden;
  transition: transform 180ms ease, opacity 180ms ease, padding 180ms ease;
}

body.sidebar-collapsed .sidebar {
  transform: translateX(-100%);
  opacity: 0;
  pointer-events: none;
  padding-left: 0;
  padding-right: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 30px;
}

.brand-mark {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-weight: 800;
  background: linear-gradient(135deg, #1fb0b4, #86d3bf);
  color: #0d2734;
}

.brand-name { font-size: 1.15rem; font-weight: 700; }
.brand-subtitle { color: rgba(255,255,255,0.7); font-size: 0.92rem; }
.nav-list { display: grid; gap: 10px; }

.nav-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-decoration: none;
  color: rgba(255,255,255,0.82);
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.02);
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(38,179,166,0.24), rgba(15,106,139,0.28));
  color: #fff;
  border-color: rgba(255,255,255,0.14);
}

.main-panel { padding: 26px; }

.main-panel-compact { padding-top: 4px; }

.page-title-wrap {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.page-title-inline {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.page-title-small {
  margin: 0;
  font-size: 1.2rem;
  line-height: 1.1;
}

.sidebar-toggle,
.sidebar-fab {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(17,52,72,0.12);
  border-radius: 12px;
  background: rgba(255,255,255,0.84);
  color: var(--ink);
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(17, 52, 72, 0.08);
  font-size: 20px;
  line-height: 1;
}

.sidebar-fab {
  position: fixed;
  left: 18px;
  top: 18px;
  z-index: 40;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

body.sidebar-collapsed .sidebar-fab {
  opacity: 1;
  pointer-events: auto;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  margin-bottom: 20px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

h1, h2 { margin: 0; }
h1 { font-size: 2rem; }

.session-picker {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 220px;
}

.session-picker select,
.inline-form input {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  padding: 10px 12px;
}

.tab-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.tab-link {
  text-decoration: none;
  color: var(--muted);
  background: rgba(255,255,255,0.7);
  border-radius: 999px;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  /* width: 160px; */
  /* min-width: 120px; */
  height: 38px;
  padding: 0 12px;
}

.tab-link.active {
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  box-shadow: var(--shadow);
}

.content-panel,
.panel-card,
.stat-card,
.alert {
  background: var(--panel);
  border: 1px solid rgba(17,52,72,0.07);
  box-shadow: var(--shadow);
}

.content-panel {
  border-radius: 12px;
  padding: 12px;
}

.alert {
  margin-bottom: 18px;
  padding: 14px 16px;
  border-radius: 16px;
}

.alert-success { border-left: 5px solid var(--ok); }
.alert-warning { border-left: 5px solid var(--warning); }
.alert-danger { border-left: 5px solid var(--danger); }
.alert-info { border-left: 5px solid var(--brand); }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.stat-card {
  padding: 18px;
  border-radius: 20px;
  background: linear-gradient(180deg, #fff 0%, #f8fbfd 100%);
}

.stat-label {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 10px;
}

.stat-value {
  font-size: 1.7rem;
  font-weight: 800;
}

.split-grid {
  display: grid;
  grid-template-columns: 1.1fr 1.3fr;
  gap: 18px;
}

.panel-card {
  border-radius: 22px;
  padding: 12px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.panel-meta { color: var(--muted); font-size: 0.92rem; }
.table-wrap { overflow-x: auto; }

.data-table,
.compact-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td,
.compact-table th,
.compact-table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.data-table th,
.compact-table th {
  color: var(--muted);
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 6px 10px;
  background: #edf3f7;
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 600;
}

.pill-ok {
  background: rgba(31,138,91,0.12);
  color: var(--ok);
}

.pill-danger {
  background: rgba(186,77,77,0.12);
  color: var(--danger);
}

.pill-muted {
  background: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.78);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

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

.btn {
  border: 0;
  border-radius: 12px;
  padding: 9px 12px;
  cursor: pointer;
  font-weight: 700;
}

.btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--accent));
  color: #fff;
}

.btn-danger {
  background: rgba(186,77,77,0.14);
  color: var(--danger);
}

.btn-soft {
  background: rgba(31,138,91,0.12);
  color: var(--ok);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

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

.inline-form input {
  min-width: 96px;
}

.placeholder-card p {
  color: var(--muted);
  max-width: 62ch;
}

@media (max-width: 1100px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { padding-bottom: 14px; }
  body.sidebar-collapsed .app-shell { grid-template-columns: 1fr; }
  body.sidebar-collapsed .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(280px, 86vw);
    z-index: 50;
    transform: translateX(-100%);
    opacity: 1;
    padding-left: 22px;
    padding-right: 22px;
  }
  body:not(.sidebar-collapsed) .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(280px, 86vw);
    z-index: 50;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.24);
  }
  .sidebar-fab { opacity: 1; pointer-events: auto; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .main-panel { padding: 16px; }
  .page-header { flex-direction: column; align-items: stretch; }
  .page-title-wrap { align-items: center; }
  .stats-grid { grid-template-columns: 1fr; }
}

.log-tab-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}


.runtime-stack {
  display: grid;
  gap: 18px;
}

.runtime-card {
  background: linear-gradient(180deg, #ffffff 0%, #f6fbfd 100%);
}

.runtime-meta {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
}

.runtime-meta[data-kind="ok"] {
  color: var(--ok);
}

.runtime-meta[data-kind="danger"] {
  color: var(--danger);
}

.runtime-meta[data-kind="busy"] {
  color: var(--brand);
}

.runtime-toggle-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.runtime-toggle-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
}

.runtime-toggle-item.is-focused {
  border-color: rgba(15, 106, 139, 0.35);
  box-shadow: inset 0 0 0 1px rgba(38, 179, 166, 0.2);
}

.runtime-toggle-name {
  font-size: 1rem;
  font-weight: 800;
}

.runtime-toggle-subtext {
  color: var(--muted);
  font-size: 0.84rem;
  margin-top: 4px;
}

.runtime-switch-wrap {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.runtime-toggle-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.runtime-switch {
  position: relative;
  width: 52px;
  height: 30px;
  background: #d7e3ea;
  border-radius: 999px;
  transition: background 0.2s ease;
}

.runtime-switch::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 4px 10px rgba(16, 42, 58, 0.18);
  transition: transform 0.2s ease;
}

.runtime-toggle-input:checked + .runtime-switch {
  background: linear-gradient(135deg, var(--brand), var(--accent));
}

.runtime-switch-wrap-block .runtime-switch {
  background: #22c55e !important;
}

.runtime-switch-wrap-block .runtime-toggle-input:checked + .runtime-switch {
  background: #ef4444 !important;
}

.runtime-toggle-input:checked + .runtime-switch::after {
  transform: translateX(22px);
}

.runtime-toggle-input:disabled + .runtime-switch {
  opacity: 0.55;
}

.runtime-switch-label {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--ink);
  min-width: 64px;
}

.runtime-inline-spinner[hidden] {
  display: none !important;
}

.runtime-inline-spinner {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  border: 2px solid rgba(15, 106, 139, 0.18);
  border-top-color: var(--brand);
  animation: seller-spin 0.8s linear infinite;
}

.runtime-inline-spinner-large {
  width: 16px;
  height: 16px;
  border-width: 3px;
}

.runtime-number-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.runtime-number-input {
  width: 92px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  background: #fff;
  color: var(--ink);
  text-align: center;
  font-weight: 700;
}

.runtime-number-wrap.is-readonly .runtime-number-input,
.runtime-number-input:disabled {
  background: #e2e8f0;
  color: #64748b;
}

.runtime-switch-wrap.is-pending {
  opacity: 0.74;
}

.runtime-switch-wrap.is-readonly {
  opacity: 0.68;
  cursor: not-allowed;
}

.runtime-switch-wrap.is-readonly .runtime-switch {
  background: #cbd5e1 !important;
}

.runtime-switch-wrap.is-readonly .runtime-switch-label,
.runtime-switch-wrap.is-readonly .runtime-switch-label.is-blocked,
.runtime-switch-wrap.is-readonly .runtime-switch-label.is-opened,
.runtime-switch-wrap.is-readonly .runtime-switch-label.is-enabled,
.runtime-switch-wrap.is-readonly .runtime-switch-label.is-disabled {
  color: #64748b !important;
}

.runtime-confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.42);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 2000;
}

.runtime-confirm-card {
  width: min(100%, 460px);
  background: linear-gradient(180deg, #ffffff 0%, #f8fbfc 100%);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 24px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22);
  padding: 24px;
}

.runtime-confirm-eyebrow {
  color: var(--brand-dark);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}

.runtime-confirm-card h3 {
  margin: 0 0 10px;
  font-size: 1.2rem;
}

.runtime-confirm-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.runtime-confirm-message.is-danger {
  color: #b91c1c;
}

.runtime-confirm-message.is-success {
  color: #0f9d58;
}

.runtime-confirm-impact {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(15, 106, 139, 0.08);
  color: var(--ink);
  font-weight: 700;
}

.runtime-confirm-actions {
  margin-top: 20px;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.runtime-confirm-button {
  border: 0;
  border-radius: 14px;
  padding: 11px 16px;
  font-weight: 800;
  cursor: pointer;
}

.runtime-confirm-cancel {
  background: #e6edf1;
  color: var(--ink);
}

.runtime-confirm-accept.is-danger {
  background: #b91c1c;
  color: #fff;
}

.runtime-confirm-accept.is-success {
  background: #15803d;
  color: #fff;
}


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

.table-subtext {
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: 4px;
}

.runtime-controls-table td {
  white-space: nowrap;
}

.runtime-switch-wrap-inline {
  justify-content: flex-start;
}

.runtime-focus-row td:first-child strong {
  color: var(--brand-dark);
}

@media (max-width: 900px) {
  .runtime-toggle-grid {
    grid-template-columns: 1fr;
  }
}

.docs-stack {
  display: grid;
  gap: 1.25rem;
}

.docs-stack h3 {
  margin: 0 0 0.6rem;
  font-size: 1rem;
}

.docs-stack code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  background: rgba(15, 23, 42, 0.08);
  padding: 0.08rem 0.28rem;
  border-radius: 0.3rem;
}

.docs-stack ol, .docs-stack ul {
  margin: 0;
  padding-left: 1.2rem;
}

.docs-stack li + li {
  margin-top: 0.35rem;
}


.overview-runtime-stack {
  margin-bottom: 1.25rem;
}

.runtime-toggle-grid-compact {
  grid-template-columns: 1fr;
}


.seller-edit-input {
  width: 100%;
  max-width: 72px;
  min-width: 44px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  padding: 8px 9px;
}

.seller-save-form {
  display: inline-flex;
}



.seller-table {
  table-layout: fixed;
}

.seller-table .seller-col-session { width: 10%; }
.seller-table .seller-col-id { width: 8%; }
.seller-table .seller-col-operator { width: 10%; }
.seller-table .seller-col-category { width: 9%; }
.seller-table .seller-col-zone { width: 13%; }
.seller-table .seller-col-margin { width: 10%; }
.seller-table .seller-col-limit { width: 11%; }
.seller-table .seller-col-rule { width: 7%; }
.seller-table .seller-col-status { width: 10%; }
.seller-table .seller-col-actions { width: 12%; }

.seller-table td,
.seller-table th {
  text-align: center;
  vertical-align: middle;
  overflow-wrap: anywhere;
}

.seller-table td:nth-child(1),
.seller-table td:nth-child(3),
.seller-table td:nth-child(4),
.seller-table td:nth-child(5) {
  word-break: break-word;
}

.seller-table .action-cell {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  align-items: center;
}

.seller-table .action-cell form {
  margin: 0;
}

.seller-table .action-cell .btn {
  width: 100%;
}

.seller-table .seller-edit-input {
  text-align: center;
}


.seller-table .seller-auto-form {
  display: none;
}


.toast-stack {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  display: grid;
  gap: 10px;
}

.toast-window {
  min-width: 260px;
  max-width: 360px;
  padding: 12px 14px;
  border-radius: 14px;
  color: #fff;
  box-shadow: var(--shadow);
  background: var(--brand);
  font-size: 0.92rem;
  line-height: 1.4;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast-window.toast-danger {
  background: var(--danger);
}

.toast-window.toast-warning {
  background: #b8772d;
}

.toast-window.toast-success {
  background: var(--ok);
}

.toast-window.is-hiding {
  opacity: 0;
  transform: translateY(-6px);
}


.seller-saving-indicator[hidden] {
  display: none !important;
}

.seller-saving-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--brand);
  font-weight: 700;
}

.seller-spinner {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  border: 2px solid rgba(15, 106, 139, 0.18);
  border-top-color: var(--brand);
  animation: seller-spin 0.8s linear infinite;
}

.seller-row.is-saving {
  opacity: 0.8;
}

@keyframes seller-spin {
  to {
    transform: rotate(360deg);
  }
}


.buyer-bulk-card {
  margin-bottom: 16px;
}

.buyer-bulk-form {
  display: flex;
  justify-content: flex-start;
}


/* .redis-filter-card {
  margin-bottom: 16px;
} */

.redis-key-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.redis-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
}

.redis-filter-row-top {
  flex-wrap: nowrap;
}

.redis-filter-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 160px;
  flex: 1 1 160px;
}

.redis-key-field {
  flex: 0 1 360px;
  min-width: 280px;
}

.redis-filter-actions {
  display: flex;
  align-items: end;
  flex: 0 0 auto;
}

.redis-refresh-button {
  align-self: auto;
}

.redis-key-form select {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  padding: 10px 12px;
}

.redis-selected-row {
  background: rgba(15, 106, 139, 0.06);
}


.redis-view-toggle {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.redis-view-toggle .tab-link {
  padding: 8px 12px;
}

.redis-market-table-wrap {
  overflow: auto;
}

.redis-market-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  white-space: nowrap;
}

.redis-market-table th,
.redis-market-table td {
  border: 1px solid #d8dee9;
  padding: 6px 8px;
  text-align: center;
  vertical-align: middle;
}

.redis-market-table th {
  background: #eef2f7;
  position: sticky;
  top: 0;
  z-index: 1;
}

/* EOD analytics dashboard: stat cards + chart grid */
.eod-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.eod-stat-card {
  background: linear-gradient(180deg, #fff 0%, #f7fafc 100%);
  border: 1px solid rgba(17,52,72,0.07);
  border-radius: 14px;
  padding: 12px 14px;
}
.eod-stat-label { color: #648097; font-size: 0.82rem; margin-bottom: 6px; }
.eod-stat-num { font-size: 1.5rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.eod-stat-buy { color: #0f6a8b; }
.eod-stat-profit { color: #1f8a5b; }
.eod-stat-loss { color: #ba4d4d; }
.eod-stat-usable { color: Blue; font-weight: 700; }
.eod-stat-used { color: #c62828; font-weight: 700; }
/* Transactions table cell flags */
.eod-sess-rech { background: #fff9c4; }            /* Seller Sess containing "rech" */
.eod-sess-rech { color: #c62828; font-weight: 700; }
.eod-comm-flag { color: #c62828; font-weight: 700; } /* Buyer Comm == 5.85% */
.balances-lapu-line { text-align: center; padding: 8px 0; font-size: 0.95rem; }

.eod-chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 16px 0;
}
.eod-chart-card { padding: 14px 16px; }
.eod-chart-title { margin: 0 0 10px; font-size: 1rem; }
/* Fixed-height box prevents Chart.js (maintainAspectRatio:false) infinite-grow loop */
.eod-chart-box { position: relative; height: 260px; width: 100%; }
.eod-chart-box canvas { position: absolute; inset: 0; }
.eod-chart-wide { grid-column: 1 / -1; }

/* Per-exchange state value pies: one cell per exchange, buyer+seller pies side by side */
.eod-pie-exchange-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.eod-pie-cell {
  border: 1px solid rgba(17,52,72,0.07);
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
}
.eod-pie-title { font-weight: 700; font-size: 0.95rem; margin-bottom: 8px; }
.eod-pie-total { color: #648097; font-weight: 400; font-size: 0.78rem; }
.eod-pie-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.eod-pie-half { min-width: 0; }
.eod-pie-sub { font-size: 0.8rem; color: #648097; margin-bottom: 4px; text-align: center; }
.eod-pie-box { position: relative; height: 170px; width: 100%; }
.eod-pie-box canvas { position: absolute; inset: 0; }
.eod-pie-empty { height: 170px; display: grid; place-items: center; color: #94a3b8; font-size: 0.8rem; }
@media (max-width: 1100px) { .eod-pie-exchange-grid { grid-template-columns: 1fr; } }
@media (max-width: 1100px) {
  .eod-chart-grid { grid-template-columns: 1fr; }
  .eod-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* EOD buyer-session: light background tint per buyer exchange (no reds) */
.eod-bx-ApiBox    { background: #fef3c7; }  /* amber  */
.eod-bx-PDRS      { background: #ede9fe; }  /* violet */
.eod-bx-RBS       { background: #dbeafe; }  /* blue   */
.eod-bx-ReEx      { background: #d1fae5; }  /* green  */
.eod-bx-RoboticEx { background: #ffedd5; }  /* orange */
.eod-bx-RealRobo  { background: #fce7f3; }  /* pink   */

/* EOD inline heading: title + meta on a single line */
.eod-inline-meta {
  font-size: 0.62em;
  font-weight: 400;
  color: #64748b;
}

/* EOD auto-refresh toggle + countdown */
.eod-autorefresh-wrap {
  margin-right: 6px;
}
.eod-autorefresh-count {
  color: var(--muted, #648097);
  font-variant-numeric: tabular-nums;
  min-width: 34px;
}

/* EOD stats block (legacy inline style): 3 lines of totals with colored values */
.eod-stats {
  font-size: 13px;
  line-height: 1.7;
  color: #334155;
}
.eod-stats-line {
  white-space: normal;
}
.eod-stat-pl {
  font-weight: 700;
}
.eod-stat-buy {
  font-weight: 700;
  color: #1d4ed8;
}
.eod-stat-sell {
  font-weight: 700;
  color: #b91c1c;
}

/* Top Side x Exchange matrix: auto-fit to content instead of full page width */
.eod-matrix-table {
  width: auto;
}

.redis-diff-alert {
  color: #b91c1c;
  font-weight: 700;
}

.redis-exchange-highlight {
  color: #1d4ed8;
  background: yellow;
  font-weight: 600;
}

/* EOD card: filters (col 1) and summary matrix (col 2) side by side */
.eod-controls-split {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: flex-start;
}
.eod-controls-split > .eod-controls-col {
  flex: 0 1 auto;
}

/* Mkt-Pairs (Configured Keys) filters: auto-fit dropdowns, left-aligned */
.mkt-pairs-filters {
  justify-content: flex-start;
}
.mkt-pairs-filters .redis-filter-field,
.mkt-pairs-filters .redis-key-field {
  flex: 0 0 auto;
  width: auto;
  min-width: 0;
}
.mkt-pairs-filters .redis-filter-field select,
.mkt-pairs-filters .redis-key-field select {
  width: auto;
  min-width: 80px;
}

/* EOD filter dropdowns: size to content instead of a fixed/wide field */
.eod-filter-auto {
  width: auto;
  min-width: 0;
}
.eod-filter-auto select {
  width: auto;
  min-width: 80px;
}

/* EOD panel: toggle row, quick-count badges */
.eod-toggle-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  /* margin-top: 10px; */
  padding-top: 5px;
  border-top: 1px solid var(--grid, #e5e7eb);
}
.eod-toggle {
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}
.eod-badges {
  display: flex;
  gap: 8px;
  align-items: center;
}
.eod-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 12px;
  background: #f1f5f9;
  border: 1px solid var(--grid, #e5e7eb);
  font-size: 12px;
}
.eod-badge-label {
  color: #64748b;
}
.eod-badge-value {
  font-weight: 700;
  color: #b45309;
}

.runtime-switch-wrap-block .runtime-switch-label.is-blocked {
  color: #b91c1c !important;
}

.runtime-switch-wrap-block .runtime-switch-label.is-opened {
  color: #15803d !important;
}
