:root {
  --bg: #0f1419;
  --panel: #1a2332;
  --border: #2d3a4f;
  --text: #e7ecf3;
  --muted: #8b9cb3;
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --danger: #ef4444;
  --danger-hover: #dc2626;
  --ok: #22c55e;
  --warn: #f59e0b;
  --page-gutter: 0.75rem;
  --panel-radius: 8px;
  --opp-row-h: 2rem;
  --exec-list-max-h: 11rem;
}

html {
  height: 100%;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100%;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: "SF Pro Text", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.4;
  font-size: 0.875rem;
}

#app-root {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
  padding: 0.55rem var(--page-gutter);
  border-bottom: 1px solid var(--border);
  background: var(--panel);
}

.header h1 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.35;
}

.app-title-meta {
  font-weight: 400;
  color: var(--muted);
  font-size: 0.82rem;
}

.header-title-wrap {
  min-width: 0;
  flex: 1 1 auto;
}

.panel-head.hidden,
.account-panel-head.hidden {
  display: none;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  padding: 1rem 1.5rem;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
}

.card h3 { margin: 0 0 0.5rem; font-size: 0.95rem; }
.card .status { font-weight: 600; }
.card .status.ok { color: var(--ok); }
.card .status.bad { color: var(--danger); }
.card p { margin: 0.25rem 0 0; color: var(--muted); font-size: 0.85rem; }

.panel {
  margin: 0 var(--page-gutter) 0.55rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--panel-radius);
  padding: 0.55rem 0.75rem;
}

#account-panel {
  flex-shrink: 0;
}

#opp-panel {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin-bottom: 0.35rem;
}

#opp-panel .opp-panel-head,
#opp-panel .opp-toolbar,
#opp-panel .formula-note {
  flex-shrink: 0;
}

.panel.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

@media (max-width: 900px) {
  .panel.two-col { grid-template-columns: 1fr; }
}

.panel-head {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.45rem;
}

.panel h2 { margin: 0 0 0.45rem; font-size: 0.92rem; font-weight: 600; }
.panel-head h2 { margin: 0; }
.panel.two-col > div > h2 { margin: 0 0 0.45rem; font-size: 0.92rem; }

.panel-strategy-meta {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 400;
  line-height: 1.3;
}

.panel-strategy-meta.hidden {
  display: none;
}

.opp-panel-head {
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem 0.5rem;
  margin-bottom: 0.35rem;
}

.scan-stats {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  font-size: 0.72rem;
  color: var(--muted, #8b949e);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.opp-refresh-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.3rem 0.45rem;
  margin-left: auto;
}

.scan-control-group {
  display: inline-flex;
  gap: 0.35rem;
}

.refresh-interval-label.disabled {
  opacity: 0.55;
}

.refresh-interval-label.disabled input {
  pointer-events: none;
}

.refresh-interval-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.85rem;
  white-space: nowrap;
}

.refresh-interval-label input {
  width: 4.25rem;
  padding: 0.3rem 0.45rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #0f1419;
  color: var(--text);
  font-size: 0.85rem;
}

.refresh-status {
  color: var(--muted);
  font-size: 0.8rem;
  white-space: nowrap;
}

.badge {
  background: var(--border);
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.8rem;
}

.opp-toolbar {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 0.35rem;
  flex-wrap: wrap;
}

.opp-tabs {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex-wrap: wrap;
}

.scan-stake-label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-left: 0;
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  border: 1px solid #c9a22788;
  background: linear-gradient(180deg, #2a2418 0%, #1a160e 100%);
  box-shadow: 0 1px 0 #f0c67422 inset;
}

.scan-stake-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: #f0c674;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.scan-stake-label input {
  width: 6.25rem;
  padding: 0.32rem 0.45rem;
  font-size: 1.05rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  border: 1px solid #d4a72c;
  border-radius: 5px;
  background: #0f1419;
  color: #ffe08a;
  box-shadow: 0 0 0 1px #d4a72c44 inset;
}

.scan-stake-label input:focus {
  outline: none;
  border-color: #f0c674;
  box-shadow: 0 0 0 2px #f0c67444;
}

.scan-stake-suffix {
  font-size: 0.85rem;
  font-weight: 600;
  color: #d4a72c;
}

.opp-tab {
  border: 1px solid var(--border);
  background: #1e2a3d;
  color: var(--muted);
  padding: 0.28rem 0.6rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.78rem;
}

.opp-tab:hover { background: #243044; color: var(--text); }

.opp-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.opp-tab-count {
  display: inline-block;
  min-width: 1.25rem;
  margin-left: 0.25rem;
  font-variant-numeric: tabular-nums;
}

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

/* 对冲场次表：占满剩余视口高度，表头固定、内容区滚动 */
#opp-panel > .table-wrap {
  flex: 1 1 auto;
  min-height: 14rem;
  max-height: 100%;
  overflow-x: auto;
  overflow-y: auto;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
  border: 1px solid rgba(45, 58, 79, 0.65);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.08);
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.65) rgba(255, 255, 255, 0.05);
}

/* 对冲场次表：WebKit 滚动条始终可见 */
#opp-panel > .table-wrap::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
#opp-panel > .table-wrap::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 6px;
}
#opp-panel > .table-wrap::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.65);
  border-radius: 10px;
  border: 2px solid rgba(15, 20, 25, 0.35);
}
#opp-panel > .table-wrap::-webkit-scrollbar-thumb:hover {
  background: rgba(203, 213, 225, 0.9);
}

#opp-panel .table-wrap thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #1e2a3d;
  box-shadow: 0 1px 0 var(--border);
  padding: 0.35rem 0.4rem;
  font-size: 0.72rem;
  white-space: nowrap;
}

#opp-panel .table-wrap tbody td {
  padding: 0.3rem 0.4rem;
  font-size: 0.78rem;
  line-height: 1.25;
  vertical-align: middle;
}

#opp-panel .table-wrap tbody tr {
  min-height: var(--opp-row-h);
}

#opp-panel .match-cell .match-name {
  font-size: 0.78rem;
  line-height: 1.25;
}

#opp-panel .col-theoretical-pnl {
  line-height: 1.2;
  font-size: 0.74rem;
}

#opp-panel .col-theoretical-pnl > div + div {
  margin-top: 0;
}

#opp-panel .opp-actions .btn.small {
  padding: 0.2rem 0.4rem;
  font-size: 0.72rem;
}

#opp-panel .opp-actions .btn.opp-exec-now {
  font-weight: 600;
  min-width: 2.4rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

th, td {
  padding: 0.4rem 0.45rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th { color: var(--muted); font-weight: 500; }
.empty { color: var(--muted); text-align: center; }

tr.opp-row-new td {
  animation: opp-row-new 1.2s ease;
}

tr.opp-row-updated td {
  animation: opp-row-updated 0.9s ease;
}

@keyframes opp-row-new {
  0% { background: rgba(56, 189, 248, 0.22); }
  100% { background: transparent; }
}

@keyframes opp-row-updated {
  0% { background: rgba(250, 204, 21, 0.18); }
  100% { background: transparent; }
}

/* 港盘赔率变化：升高红、降低绿（A 股习惯） */
.odds-val.odds-flash-up {
  color: #f87171;
  font-weight: 700;
  background: rgba(239, 68, 68, 0.2);
  border-radius: 3px;
  padding: 0 0.15rem;
  animation: odds-flash-pulse 2.4s ease forwards;
}

.odds-val.odds-flash-down {
  color: #4ade80;
  font-weight: 700;
  background: rgba(34, 197, 94, 0.2);
  border-radius: 3px;
  padding: 0 0.15rem;
  animation: odds-flash-pulse 2.4s ease forwards;
}

@keyframes odds-flash-pulse {
  0%, 18% {
    filter: brightness(1.15);
  }
  100% {
    font-weight: 600;
    background: transparent;
    filter: none;
  }
}

/* 边际变化：增加绿、减少红 */
.edge-val.edge-flash-up {
  color: #4ade80;
  font-weight: 700;
  background: rgba(34, 197, 94, 0.2);
  border-radius: 3px;
  padding: 0 0.15rem;
  animation: odds-flash-pulse 2.4s ease forwards;
}

.edge-val.edge-flash-down {
  color: #f87171;
  font-weight: 700;
  background: rgba(239, 68, 68, 0.2);
  border-radius: 3px;
  padding: 0 0.15rem;
  animation: odds-flash-pulse 2.4s ease forwards;
}

.col-edge-metric .edge-val {
  font-variant-numeric: tabular-nums;
}

.col-odds-primary,
.col-odds-hedge {
  font-variant-numeric: tabular-nums;
}

.btn {
  border: 1px solid var(--border);
  background: #243044;
  color: var(--text);
  padding: 0.32rem 0.6rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.78rem;
}

.btn:hover { background: #2d3d56; }
.btn.primary { background: var(--primary); border-color: var(--primary); }
.btn.primary:hover { background: var(--primary-hover); }
.btn.accent { background: #0d9488; border-color: #0d9488; }
.btn.accent:hover { background: #0f766e; }
.btn.accent-warn { background: var(--warn); border-color: var(--warn); color: #111; }
.btn.accent-warn:hover { background: #d97706; }
.btn.danger { background: var(--danger); border-color: var(--danger); }
.btn.danger:hover { background: var(--danger-hover); }
.btn.small { padding: 0.22rem 0.45rem; font-size: 0.72rem; }
.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}
.btn.primary:disabled,
.btn.primary[aria-disabled="true"] {
  background: var(--primary);
  border-color: var(--primary);
}
.btn.is-active:not(:disabled) {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.opp-actions { display: flex; flex-wrap: wrap; gap: 0.35rem; }

.form { display: flex; flex-direction: column; gap: 0.45rem; }
.form label { display: flex; flex-direction: column; gap: 0.2rem; font-size: 0.78rem; color: var(--muted); }
.form input {
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #111827;
  color: var(--text);
  font-size: 0.82rem;
}

.form-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.stake-dual {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.stake-readonly {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 0.82rem;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  min-height: 2rem;
  cursor: default;
}

.stake-readonly.muted {
  color: var(--muted);
}

@media (max-width: 640px) {
  .stake-dual {
    grid-template-columns: 1fr;
  }
}

.result-box {
  margin: 0;
  min-height: 5.5rem;
  max-height: 11rem;
  overflow: auto;
  background: #111827;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.5rem 0.6rem;
  font-size: 0.75rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text);
}

.edge-good { color: var(--ok); font-weight: 600; }

.opp-badge {
  display: inline-block;
  font-size: 0.72rem;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-weight: 600;
}
.opp-badge-dual { background: #2a3a5c; color: #9ec5ff; }
.opp-badge-multi { background: #3a2a5c; color: #d4b5ff; }
.opp-leg-sat { font-size: 0.72rem; color: #d4b5ff; font-weight: 600; }
.opp-badge-split { background: #3d3420; color: #f0c674; }
.opp-badge-depth-warn { background: #3d3420; color: #f0c674; margin-left: 0.35rem; font-size: 0.72rem; }
.opp-badge-depth-ok { background: #1e3d2a; color: #7dcea0; margin-left: 0.35rem; font-size: 0.72rem; }
.opp-depth-table-detail {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.72rem;
  line-height: 1.45;
  color: #b8bcc4;
  max-width: 26rem;
}
.depth-status-ok {
  color: #7dcea0;
  font-weight: 600;
}
.depth-status-bad {
  color: #e06c75;
  font-weight: 600;
}
#float-panel-focus .focus-poly-arb-detail .depth-status-ok,
.exec-depth-hint .depth-status-ok {
  color: #86efac;
}
#float-panel-focus .focus-poly-arb-detail .depth-status-bad,
.exec-depth-hint .depth-status-bad {
  color: #fca5a5;
}
.match-cell .opp-depth-age {
  margin-left: 0.25rem;
}
.opp-depth-age {
  margin-left: 0.35rem;
  font-size: 0.74rem;
  font-weight: 700;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}
.opp-depth-age-fresh {
  color: #5ddea8;
  text-shadow: 0 0 10px rgba(93, 222, 168, 0.4);
}
.opp-depth-age-stale {
  color: #ffb347;
}
.opp-depth-age-old {
  color: #ff8f6b;
  text-shadow: 0 0 8px rgba(255, 143, 107, 0.35);
}
.exec-depth-hint .opp-depth-age {
  margin-left: 0.12rem;
}
.opp-badge-ordered { background: #1e3d2a; color: #7dcea0; margin-left: 0.35rem; font-size: 0.72rem; }
.opp-badge-running { background: #2a3a4a; color: #9ec5ff; margin-left: 0.35rem; font-size: 0.72rem; }
.opp-badge-failed { background: #3d2020; color: #f0a0a0; margin-left: 0.35rem; font-size: 0.72rem; }
.opp-badge-live { background: #4a2020; color: #ff9e7a; margin-left: 0.35rem; font-size: 0.72rem; }
.opp-satellite-hint { font-size: 0.72rem; color: var(--danger, #e06c75); margin-top: 0.2rem; line-height: 1.3; }
.opp-leg-sat-warn { color: var(--danger, #e06c75); font-weight: 700; }
.opp-usdc-sub { color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; }
.opp-usdc-main {
  font-weight: 600;
  color: #e8eaed;
  font-variant-numeric: tabular-nums;
}
.opp-shares-sub {
  display: block;
  font-size: 0.68rem;
  color: var(--muted);
  font-weight: 400;
  margin-top: 0.08rem;
  font-variant-numeric: tabular-nums;
}
.col-odds-hedge .opp-usdc-main,
.col-cross-site .opp-usdc-main {
  color: #9ec5ff;
}
.opp-usdc-subline { color: var(--muted); font-size: 0.72rem; margin-top: 0.1rem; font-variant-numeric: tabular-nums; }
.col-segment-pnl { font-size: 0.78rem; line-height: 1.25; max-width: 9rem; }
.col-segment-pnl div { white-space: nowrap; }
.col-hedge-mode { font-size: 0.8rem; color: var(--muted); }
.edge-low { color: var(--warn); }

.pnl-profit { color: var(--ok); font-weight: 600; font-variant-numeric: tabular-nums; }
.pnl-loss { color: var(--danger); font-weight: 600; font-variant-numeric: tabular-nums; }

.col-theoretical-pnl {
  line-height: 1.35;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.col-theoretical-pnl > div + div {
  margin-top: 2px;
}

.formula-config {
  margin: 0.5rem 0;
  padding: 0.5rem 0.65rem;
  border-left: 3px solid var(--primary);
  background: rgba(59, 130, 246, 0.06);
  border-radius: 4px;
}

.config-list {
  margin: 0.35rem 0 0;
  padding-left: 1.1rem;
  color: var(--text);
  font-size: 0.85rem;
}

.config-list li { margin: 0.2rem 0; }

.toast {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  background: #1e293b;
  border: 1px solid var(--border);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  max-width: 320px;
}

.hidden { display: none !important; }

.toast.hidden { display: none; }
.toast.error { border-color: var(--danger); }

.opp-alert-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(4px);
  animation: opp-alert-fade-in 0.25s ease;
}

.opp-alert-overlay.hidden { display: none !important; }

.exec-manual-card-overlay {
  position: fixed;
  inset: 0;
  z-index: 2050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(2, 6, 23, 0.78);
  backdrop-filter: blur(4px);
}

.exec-manual-card-overlay.hidden { display: none !important; }

.exec-manual-card {
  position: relative;
  width: min(520px, 100%);
  max-height: min(90vh, 720px);
  overflow: auto;
  padding: 1.1rem 1.2rem 1.2rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #0f172a;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}

.exec-manual-card-close {
  position: absolute;
  top: 0.55rem;
  right: 0.65rem;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.exec-manual-card-title {
  margin: 0 0 0.35rem;
  font-size: 1.15rem;
}

.exec-manual-card-match {
  margin: 0 0 0.85rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.exec-manual-section h3 {
  margin: 0 0 0.45rem;
  font-size: 0.95rem;
  color: #cbd5e1;
}

.exec-manual-leg-list {
  margin: 0 0 0.85rem;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.exec-manual-leg-item {
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.65);
  font-size: 0.9rem;
}

.exec-manual-leg-item.ok { border-color: rgba(34, 197, 94, 0.45); }
.exec-manual-leg-item.bad { border-color: rgba(239, 68, 68, 0.5); }
.exec-manual-leg-item.running { border-color: rgba(56, 189, 248, 0.45); }

.exec-manual-crown-instructions {
  margin: 0 0 0.55rem;
  font-size: 1rem;
  font-weight: 600;
  color: #f8fafc;
}

.exec-manual-crown-details {
  margin: 0 0 0.85rem;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.25rem 0.75rem;
  font-size: 0.9rem;
}

.exec-manual-crown-details dt { color: var(--muted); margin: 0; }
.exec-manual-crown-details dd { margin: 0; }

.exec-manual-warnings,
.exec-manual-loss {
  margin: 0 0 0.75rem;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  font-size: 0.88rem;
}

.exec-manual-warnings {
  border: 1px solid rgba(251, 191, 36, 0.45);
  background: rgba(251, 191, 36, 0.08);
  color: #fde68a;
}

.exec-manual-loss {
  border: 1px solid rgba(239, 68, 68, 0.45);
  background: rgba(239, 68, 68, 0.08);
  color: #fecaca;
}

.exec-manual-actions {
  display: flex;
  gap: 0.55rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 12, 20, 0.92);
}

.login-overlay.hidden { display: none !important; }

.login-card {
  width: min(360px, 92vw);
  padding: 1.5rem;
  border-radius: 12px;
  background: var(--panel-bg, #111827);
  border: 1px solid var(--border, #334155);
  display: grid;
  gap: 0.75rem;
}

.login-field {
  display: grid;
  gap: 0.25rem;
}

.login-field input {
  padding: 0.5rem 0.65rem;
  border-radius: 6px;
  border: 1px solid var(--border, #334155);
  background: var(--input-bg, #0f172a);
  color: inherit;
}

.login-submit { width: 100%; margin-top: 0.25rem; }

.auth-user-label {
  font-size: 0.85rem;
  color: var(--muted);
  margin-right: 0.35rem;
}

.user-mgmt-create {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.user-mgmt-table {
  width: 100%;
  border-collapse: collapse;
}

.user-mgmt-table th,
.user-mgmt-table td {
  padding: 0.45rem 0.5rem;
  border-bottom: 1px solid var(--border, #334155);
  text-align: left;
}

.exec-manual-segment-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin-top: 0.35rem;
}

.exec-manual-segment-table th,
.exec-manual-segment-table td {
  padding: 0.3rem 0.4rem;
  border-bottom: 1px solid var(--border, #334155);
}

.exec-manual-segment-table tr.ok td:last-child { color: #4ade80; }
.exec-manual-segment-table tr.bad td:last-child { color: #f87171; }

#app-root.hidden { display: none !important; }

.exec-manual-meta {
  margin: 0.25rem 0 0.5rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.exec-manual-sell-legs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: flex-end;
}

.exec-operator-tag {
  display: inline-block;
  margin-left: 0.35rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.config-editor-overlay {
  position: fixed;
  inset: 0;
  z-index: 2100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(2, 6, 23, 0.78);
  backdrop-filter: blur(4px);
}

.config-editor-overlay.hidden { display: none !important; }

.config-editor-card {
  width: min(920px, 100%);
  max-height: min(92vh, 900px);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 1rem 1.1rem 1.1rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #0f172a;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}

.config-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.config-editor-head h2 {
  margin: 0;
  font-size: 1.15rem;
}

.config-editor-hint {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.45;
}

.config-editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
}

.config-file-label {
  font-size: 0.85rem;
  color: var(--muted);
}

.config-file-select {
  min-width: 11rem;
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #1e293b;
  color: var(--text);
}

.config-editor-content {
  flex: 1;
  min-height: 320px;
  width: 100%;
  resize: vertical;
  padding: 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #020617;
  color: #e2e8f0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.8rem;
  line-height: 1.45;
  tab-size: 2;
}

.config-editor-error {
  margin: 0;
  padding: 0.5rem 0.65rem;
  border-radius: 6px;
  border: 1px solid var(--danger);
  background: rgba(127, 29, 29, 0.25);
  color: #fecaca;
  font-size: 0.82rem;
  white-space: pre-wrap;
}

.config-editor-card-wide {
  width: min(960px, 100%);
  max-height: min(94vh, 920px);
}

.config-editor-meta {
  margin: 0;
  font-size: 0.78rem;
}

.cfg-poly-toolbar {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin: 0.35rem 0 0.65rem;
}

.cfg-poly-creds-status {
  margin: 0 0 0.75rem;
  padding: 0.55rem 0.7rem;
  border-radius: 6px;
  font-size: 0.82rem;
}

.cfg-poly-creds-status.cfg-poly-creds-ok {
  border: 1px solid rgba(34, 197, 94, 0.45);
  background: rgba(20, 83, 45, 0.25);
  color: #bbf7d0;
}

.cfg-poly-creds-status.cfg-poly-creds-bad {
  border: 1px solid var(--danger);
  background: rgba(127, 29, 29, 0.25);
  color: #fecaca;
}

.cfg-poly-creds-checks {
  margin: 0.45rem 0 0;
  padding-left: 1.1rem;
}

.cfg-poly-creds-checks li.bad {
  color: #fecaca;
}

.cfg-crown-pool-empty {
  margin: 0.35rem 0 0;
}

.cfg-crown-accounts-panel {
  margin-top: 0.65rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border, rgba(255, 255, 255, 0.12));
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.12);
  font-size: 0.82rem;
}

.cfg-crown-accounts-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.45rem;
}

.cfg-crown-accounts-table th,
.cfg-crown-accounts-table td {
  padding: 0.35rem 0.4rem;
  text-align: left;
  border-bottom: 1px solid var(--border, rgba(255, 255, 255, 0.08));
  vertical-align: middle;
}

.cfg-crown-accounts-table th {
  font-weight: 600;
  color: var(--muted, #94a3b8);
  font-size: 0.78rem;
}

.cfg-crown-accounts-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.crown-account-modal {
  position: fixed;
  inset: 0;
  z-index: 2200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.crown-account-modal.hidden {
  display: none !important;
}

.crown-account-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.55);
}

.crown-account-modal-card {
  position: relative;
  width: min(420px, 100%);
  padding: 0.85rem 1rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel, #0f172a);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

.crown-account-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.crown-account-modal-head h3 {
  margin: 0;
  font-size: 1rem;
}

.crown-account-modal-body {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.crown-account-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.4rem;
  margin-top: 0.75rem;
}

.cfg-crown-pool-status {
  margin-top: 0.65rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border, rgba(255, 255, 255, 0.12));
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.12);
  font-size: 0.82rem;
}

.cfg-crown-pool-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem 0.75rem;
  margin-bottom: 0.35rem;
}

.cfg-crown-pool-summary {
  margin: 0;
}

.cfg-crown-pool-toolbar {
  display: inline-flex;
  gap: 0.35rem;
  align-items: center;
}

.cfg-crown-pool-rows {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.cfg-crown-pool-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  padding-top: 0.35rem;
  border-top: 1px solid var(--border, rgba(255, 255, 255, 0.08));
}

.cfg-crown-pool-row:first-child {
  border-top: none;
  padding-top: 0;
}

.cfg-crown-pool-row-head {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex: 1 1 auto;
  min-width: 8rem;
}

.cfg-crown-pool-reason {
  margin: 0;
  flex: 1 1 100%;
  font-size: 0.78rem;
  color: var(--muted, #94a3b8);
}

.cfg-crown-pool-hint,
.cfg-crown-pool-empty {
  margin: 0.35rem 0 0;
}

.account-poly-creds-warn {
  margin: 0.35rem 0 0;
  padding: 0.45rem 0.55rem;
  border-radius: 6px;
  border: 1px solid rgba(251, 191, 36, 0.55);
  background: rgba(120, 53, 15, 0.35);
  color: #fde68a;
  font-size: 0.82rem;
}

.config-editor-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border);
}

.cfg-tab {
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.85rem;
}

.cfg-tab:hover {
  color: var(--text);
  background: rgba(30, 41, 59, 0.6);
}

.cfg-tab.active {
  color: var(--text);
  border-color: var(--border);
  background: #1e293b;
}

.config-editor-panels {
  flex: 1;
  overflow: auto;
  min-height: 200px;
  max-height: 58vh;
  padding: 0.5rem 0.15rem;
}

.cfg-panel.hidden {
  display: none !important;
}

.cfg-section-desc,
.cfg-group-desc {
  margin: 0 0 0.65rem;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.45;
}

.cfg-group {
  margin: 0 0 1rem;
  padding: 0.65rem 0.75rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(2, 6, 23, 0.35);
}

.cfg-group legend {
  padding: 0 0.35rem;
  font-size: 0.88rem;
  font-weight: 600;
}

.cfg-fields {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.65rem 0.85rem;
}

.cfg-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.82rem;
}

.cfg-field-wide {
  grid-column: 1 / -1;
}

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

.cfg-field input,
.cfg-field select,
.cfg-field textarea {
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #0f172a;
  color: var(--text);
  font-size: 0.82rem;
}

.cfg-field textarea.cfg-yaml {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.78rem;
  line-height: 1.4;
  resize: vertical;
}

.cfg-field-help {
  margin: 0.15rem 0 0;
  grid-column: 1 / -1;
  font-size: 0.75rem;
  color: #94a3b8;
  line-height: 1.35;
}

.cfg-check-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.85rem;
}

.cfg-multiselect {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.85rem;
}

.cfg-check-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.82rem;
  cursor: pointer;
}

.config-editor-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
}

.opp-alert-card {
  position: relative;
  width: min(520px, 100%);
  padding: 1.5rem 1.35rem 1.25rem;
  border-radius: 14px;
  border: 2px solid #22c55e;
  background: linear-gradient(165deg, #052e16 0%, #0f172a 55%);
  box-shadow:
    0 0 0 1px rgba(34, 197, 94, 0.25),
    0 20px 50px rgba(0, 0, 0, 0.55),
    0 0 40px rgba(34, 197, 94, 0.15);
  animation: opp-alert-pop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.opp-alert-icon {
  width: 3rem;
  height: 3rem;
  margin: 0 auto 0.75rem;
  border-radius: 50%;
  background: #16a34a;
  color: #fff;
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 3rem;
  text-align: center;
  box-shadow: 0 0 20px rgba(34, 197, 94, 0.5);
}

.opp-alert-title {
  margin: 0 0 0.5rem;
  text-align: center;
  font-size: 1.35rem;
  color: #bbf7d0;
}

.opp-alert-summary {
  margin: 0 0 0.85rem;
  text-align: center;
  color: #e2e8f0;
  font-size: 0.95rem;
}

.opp-alert-list {
  margin: 0 0 1rem;
  padding: 0.65rem 0.85rem;
  list-style: none;
  max-height: 220px;
  overflow: auto;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(34, 197, 94, 0.25);
}

.opp-alert-list li {
  padding: 0.4rem 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
  font-size: 0.88rem;
  line-height: 1.45;
}

.opp-alert-list li:last-child { border-bottom: none; }

.opp-alert-list .opp-alert-edge {
  color: #4ade80;
  font-weight: 600;
}

.opp-alert-actions {
  display: flex;
  gap: 0.6rem;
  justify-content: center;
  flex-wrap: wrap;
}

.opp-alert-close {
  position: absolute;
  top: 0.5rem;
  right: 0.65rem;
  border: none;
  background: transparent;
  color: #94a3b8;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.15rem 0.35rem;
}

.opp-alert-close:hover { color: #e2e8f0; }

@keyframes opp-alert-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes opp-alert-pop {
  from { opacity: 0; transform: scale(0.88) translateY(12px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.opp-panel-highlight {
  animation: opp-panel-flash 2.4s ease;
}

@keyframes opp-panel-flash {
  0%, 100% { box-shadow: none; }
  15%, 45% { box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.45); }
}

body.opp-alert-open { overflow: hidden; }

.hint { color: var(--muted); font-size: 0.72rem; margin: 0.25rem 0; }
.hint code { background: #111827; padding: 0.1rem 0.35rem; border-radius: 4px; }

.form textarea, .form select {
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #111827;
  color: var(--text);
  font-size: 0.9rem;
}

.capture-list { list-style: none; margin: 0; padding: 0; max-height: 200px; overflow: auto; }
.capture-list li { padding: 0.35rem 0; border-bottom: 1px solid var(--border); font-size: 0.85rem; }
.link-btn {
  background: none;
  border: none;
  color: var(--primary);
  cursor: pointer;
  padding: 0;
  font-size: inherit;
}
.link-btn:hover { text-decoration: underline; }

.header-actions { display: flex; gap: 0.5rem; align-items: center; }
.header-actions a.btn { text-decoration: none; display: inline-block; }

.panel-login {
  margin-top: 0.45rem;
  border-color: var(--border);
  box-shadow: none;
}

.account-grid,
.login-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.5rem;
}

.account-placeholder,
.login-placeholder {
  border-style: dashed;
}

.account-card,
.login-card {
  background: #111827;
  border: 1px solid var(--border);
  border-radius: var(--panel-radius);
  padding: 0.55rem 0.65rem;
}

.account-card-head,
.login-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.account-card-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  min-width: 0;
  flex: 1;
}

.account-balance-inline {
  margin-left: auto;
  font-size: 0.72rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.account-balance-inline strong {
  color: #fbbf24;
  font-weight: 600;
}

.account-card h3,
.login-card h3 { margin: 0; font-size: 0.85rem; }

.account-meta,
.login-meta {
  margin: 0 0 0.25rem;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.25;
}

.account-meta-warn {
  color: var(--danger);
}

.account-msg,
.login-msg {
  margin: 0 0 0.4rem;
  font-size: 0.78rem;
  min-height: 1.1em;
  color: var(--text);
}

.account-card-warn {
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.06);
}

.account-card-actions {
  flex: 0 0 auto;
  display: inline-flex;
  gap: 0.3rem;
  margin: 0;
}

.account-card-actions .btn {
  padding: 0.12rem 0.38rem;
  font-size: 0.625rem;
  line-height: 1.15;
  white-space: nowrap;
  min-height: 1.35rem;
  box-sizing: border-box;
}

.account-card-toolbar {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.28rem;
}

.account-card-toolbar .account-leg-monitor {
  flex: 1 1 auto;
  min-width: 0;
}

.account-leg-monitor {
  margin: 0;
  padding: 0;
  background: none;
  border: none;
  border-radius: 0;
}

.account-leg-monitor.leg-primary .progress-track-labeled {
  box-shadow: inset 3px 0 0 var(--primary);
}

.account-leg-monitor.leg-hedge .progress-track-labeled {
  box-shadow: inset 3px 0 0 #a78bfa;
}

.progress-track-labeled {
  position: relative;
  height: 1.35rem;
  min-height: 1.35rem;
  background: #111827;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 5px;
  overflow: hidden;
}

.progress-track-labeled .progress-bar {
  height: 100%;
  border-radius: 0;
}

.account-leg-monitor-summary {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  padding: 0 0.35rem 0 0.5rem;
  font-size: 0.625rem;
  line-height: 1;
  color: #d1d9e6;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
}

.account-leg-monitor.leg-error .account-leg-monitor-summary {
  color: #fecaca;
}

.account-card-toolbar .account-card-actions {
  align-self: center;
}

.progress-panel {
  flex-shrink: 0;
  margin: 0 var(--page-gutter) 0.45rem;
  padding: 0.45rem 0.65rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--panel-radius);
}

.progress-panel:not(.hidden):not(.exec-preview-progress) {
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

.exec-preview-progress {
  margin: 0 0 0.45rem;
}

.exec-preview-progress:not(.hidden) {
  position: static;
  box-shadow: none;
  z-index: auto;
}

.progress-panel.hidden { display: none; }

.progress-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.3rem;
  font-size: 0.78rem;
}

.progress-percent {
  color: var(--primary);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.progress-track {
  height: 8px;
  background: #111827;
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #60a5fa);
  border-radius: 999px;
  transition: width 0.35s ease;
}

.progress-bar.indeterminate {
  width: 40% !important;
  animation: progress-slide 1.2s ease-in-out infinite;
}

@keyframes progress-slide {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(350%); }
}

.progress-detail {
  margin: 0.3rem 0 0;
  color: var(--muted);
  font-size: 0.72rem;
  min-height: 1em;
}

.leg-progress-list,
.scan-leg-progress {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 0.75rem;
}

.leg-progress-list > .leg-progress,
.scan-leg-progress > .leg-progress {
  flex: 1 1 50%;
  min-width: 0;
  max-width: 50%;
}

.leg-progress-list {
  margin-top: 0.85rem;
}

.scan-leg-progress {
  margin: 0 0 0.85rem;
}

@media (max-width: 720px) {
  .leg-progress-list,
  .scan-leg-progress {
    flex-direction: column;
  }

  .leg-progress-list > .leg-progress,
  .scan-leg-progress > .leg-progress {
    max-width: 100%;
  }
}

.leg-progress-list.hidden,
.scan-leg-progress.hidden {
  display: none;
}

.leg-progress {
  padding: 0.4rem 0.5rem;
  border-radius: 8px;
  background: #0b1220;
  border: 1px solid var(--border);
}

.leg-progress.leg-primary {
  border-color: rgba(59, 130, 246, 0.35);
}

.leg-progress.leg-hedge {
  border-color: rgba(234, 179, 8, 0.35);
}

.leg-progress.leg-done .leg-status {
  color: var(--primary);
}

.leg-progress.leg-error .leg-status {
  color: var(--danger);
}

.leg-progress.leg-listen .leg-status {
  color: var(--muted);
}

.leg-progress.leg-listen .progress-bar {
  opacity: 0.55;
}

.leg-step-tag {
  display: inline-block;
  margin-left: 0.4rem;
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.06);
  vertical-align: middle;
}

.leg-progress.leg-primary .leg-step-tag {
  color: #8ec5ff;
  background: rgba(100, 160, 255, 0.12);
}

.leg-progress.leg-hedge .leg-step-tag {
  color: #b8a0ff;
  background: rgba(160, 120, 255, 0.12);
}

.leg-progress-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
  font-size: 0.85rem;
}

.leg-progress-head .leg-label {
  font-weight: 600;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leg-progress-head .leg-status {
  flex-shrink: 0;
}

.leg-progress-head .leg-role {
  color: var(--muted);
  font-size: 0.75rem;
  margin-left: 0.35rem;
}

.leg-status {
  color: var(--muted);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}

.leg-data-age {
  margin: 0.15rem 0 0.35rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
}

.leg-progress .progress-track {
  height: 6px;
}

.leg-progress-detail {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  min-height: 1.1em;
}

.fixture-picked-label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.fixture-picked {
  display: block;
  min-height: 2.25rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  font-size: 0.9rem;
}

.fixture-picked:empty::before,
.fixture-picked.hint:only-child {
  color: var(--muted);
}

.match-cell .match-name {
  font-weight: 500;
}

.match-cell .match-kickoff {
  margin-top: 0.15rem;
  font-size: 0.68rem;
  color: var(--muted);
  white-space: nowrap;
}

.match-cell .match-live-score {
  color: var(--text);
  font-weight: 600;
}

.match-cell .match-venues {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.25rem;
}

.venue-leg-meta {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.venue-tag {
  display: inline-block;
  font-size: 0.72rem;
  line-height: 1.2;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--muted);
  white-space: nowrap;
}

.venue-tag.venue-primary {
  border-color: #93c5fd;
  color: #1d4ed8;
  background: #eff6ff;
}

.venue-tag.venue-hedge {
  border-color: #fcd34d;
  color: #b45309;
  background: #fffbeb;
}

.match-cell .match-id {
  color: var(--muted);
  font-size: 0.78rem;
  margin-top: 0.15rem;
}

#fixture-match {
  display: block;
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.85rem;
  min-height: 1.2em;
}

.health-meta {
  color: var(--muted);
  font-size: 0.82rem;
  margin: 0.25rem 0;
}

.card-warn {
  border-color: var(--warn);
}

.badge-ok {
  background: rgba(34, 197, 94, 0.2);
  color: var(--ok);
}

.badge-bad {
  background: rgba(239, 68, 68, 0.2);
  color: var(--danger);
}

.formula-note {
  margin-top: 0.45rem;
  padding: 0.4rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.02);
  font-size: 0.78rem;
}

.formula-body {
  margin-top: 0.4rem;
  line-height: 1.45;
  font-size: 0.75rem;
}

.formula-body p {
  margin: 0.25rem 0;
}

.formula-note summary {
  cursor: pointer;
  color: var(--muted);
  user-select: none;
  font-size: 0.78rem;
}

.formula-note summary:hover {
  color: var(--text);
}

.formula-body sub {
  font-size: 0.75em;
}

.formula-hint {
  color: var(--muted);
  font-size: 0.72rem;
}

.exec-step-list {
  list-style: none;
  margin: 0.35rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.execution-jobs-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  max-height: var(--exec-list-max-h);
  overflow-y: auto;
  padding-right: 0.15rem;
}

.exec-job {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.45rem 0.55rem;
  background: rgba(255, 255, 255, 0.02);
  flex-shrink: 0;
}

.exec-job-active {
  border-color: rgba(234, 179, 8, 0.55);
  box-shadow: 0 0 0 1px rgba(234, 179, 8, 0.15);
}

.exec-job-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.exec-job-meta,
.exec-job-summary {
  margin: 0 0 0.3rem;
  font-size: 0.75rem;
  color: var(--muted);
}

.exec-step {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.2rem 0.5rem;
  font-size: 0.75rem;
  padding: 0.25rem 0.4rem;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.15);
}

.exec-step.ok {
  border-left: 3px solid var(--ok);
}

.exec-step.bad {
  border-left: 3px solid var(--bad);
}

.exec-step.running {
  border-left: 3px solid var(--warn);
}

.exec-step-msg {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.82rem;
}

.execution-progress-panel {
  border-color: rgba(234, 179, 8, 0.35);
  background: rgba(234, 179, 8, 0.06);
  padding: 0.4rem 0.5rem;
}

.execution-progress-panel.exec-done {
  border-color: rgba(34, 197, 94, 0.4);
  background: rgba(34, 197, 94, 0.06);
}

.execution-progress-panel.exec-failed {
  border-color: rgba(239, 68, 68, 0.45);
  background: rgba(239, 68, 68, 0.08);
}

.exec-progress-compact-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.76rem;
  font-weight: 600;
  line-height: 1.3;
}

.exec-progress-compact-head .progress-percent {
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

.exec-progress-bar {
  height: 6px;
  margin: 0.35rem 0 0.4rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.1);
  overflow: hidden;
}

.exec-progress-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #eab308, #f59e0b);
  transition: width 0.35s ease;
}

.execution-progress-panel.exec-done .exec-progress-bar-fill {
  background: linear-gradient(90deg, #22c55e, #16a34a);
}

.execution-progress-panel.exec-failed .exec-progress-bar-fill {
  background: linear-gradient(90deg, #ef4444, #dc2626);
}

.focus-exec-progress {
  margin-top: 0.65rem;
  padding: 0.5rem 0.55rem;
  border-radius: 8px;
  border: 1px solid rgba(234, 179, 8, 0.35);
  background: rgba(234, 179, 8, 0.06);
}

.focus-exec-progress.exec-done {
  border-color: rgba(34, 197, 94, 0.4);
  background: rgba(34, 197, 94, 0.06);
}

.focus-exec-progress.exec-failed {
  border-color: rgba(239, 68, 68, 0.45);
  background: rgba(239, 68, 68, 0.08);
}

.focus-exec-progress .exec-progress-bar {
  background: rgba(15, 23, 42, 0.08);
}

.exec-steps-log {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin: 0.3rem 0 0;
  padding: 0.4rem 0.5rem;
  min-height: 2.75rem;
  max-height: 5rem;
  overflow: auto;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.68rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text);
}

.exec-steps-log-inline {
  max-height: 4rem;
  margin: 0.2rem 0 0;
}

/* —— 右侧浮动面板 —— */
.float-dock {
  position: fixed;
  inset: 0;
  z-index: 850;
  pointer-events: none;
}

.float-dock-rail {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.35rem 0.2rem;
  pointer-events: auto;
}

.float-dock-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 2.35rem;
  padding: 0.65rem 0.45rem;
  border: 1px solid var(--border);
  border-right: none;
  border-radius: 8px 0 0 8px;
  background: var(--panel);
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: -2px 0 12px rgba(0, 0, 0, 0.25);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.float-dock-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(147, 197, 253, 0.45);
}

.float-dock-btn-active {
  background: rgba(59, 130, 246, 0.14);
  border-color: rgba(147, 197, 253, 0.55);
  color: #93c5fd;
}

.float-dock-btn-label {
  writing-mode: vertical-rl;
  text-orientation: mixed;
}

.float-dock-btn-icon {
  min-width: 2.5rem;
  min-height: 2.5rem;
  padding: 0.5rem;
}

.float-dock-icon {
  display: block;
  width: 1.2rem;
  height: 1.2rem;
}

.float-dock-icon-coin {
  width: 1.28rem;
  height: 1.28rem;
  filter: drop-shadow(0 1px 1px rgba(180, 83, 9, 0.35));
}

.float-dock-btn:hover .float-dock-icon-coin circle {
  fill: #fcd34d;
}

.float-dock-btn-active .float-dock-icon-coin circle {
  fill: #f59e0b;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.55rem;
  line-height: 0;
}

.btn-icon-svg {
  display: block;
  width: 1.05rem;
  height: 1.05rem;
}

.float-dock-badge {
  position: absolute;
  top: 0.2rem;
  left: 0.15rem;
  min-width: 1rem;
  height: 1rem;
  padding: 0 0.2rem;
  border-radius: 999px;
  background: var(--warn);
  color: #1a1a1a;
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1rem;
  text-align: center;
}

.float-dock-badge.hidden {
  display: none;
}

@keyframes float-dock-blink {
  0%, 100% { box-shadow: -2px 0 12px rgba(0, 0, 0, 0.25); }
  50% { box-shadow: -2px 0 16px rgba(234, 179, 8, 0.75), 0 0 0 2px rgba(234, 179, 8, 0.35); }
}

.float-dock-btn-blink {
  animation: float-dock-blink 0.65s ease-in-out 3;
}

.float-panel {
  position: fixed;
  right: 2.55rem;
  width: min(21rem, calc(100vw - 3.5rem));
  max-height: min(72vh, 28rem);
  overflow: auto;
  padding: 0.55rem 0.65rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 10px 0 0 10px;
  background: var(--panel);
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.35);
  pointer-events: auto;
}

.float-panel.hidden {
  display: none;
}

#float-panel-focus {
  top: 50%;
  left: 50%;
  right: auto;
  bottom: auto;
  transform: translate(-50%, -50%);
  width: min(56rem, calc(100vw - 1.5rem));
  height: min(92vh, 52rem);
  max-height: min(92vh, 52rem);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0.65rem 0.85rem 0.85rem;
  border-radius: 12px;
  background: linear-gradient(165deg, #14171f 0%, #0f1218 100%);
  border: 1px solid #2a2f3a;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  color: #e8eaed;
  z-index: 10040;
}

#float-panel-focus.float-panel-maximized {
  left: max(0.5rem, env(safe-area-inset-left)) !important;
  right: max(0.5rem, env(safe-area-inset-right)) !important;
  top: max(0.5rem, env(safe-area-inset-top)) !important;
  bottom: max(0.5rem, env(safe-area-inset-bottom)) !important;
  width: auto !important;
  max-width: none !important;
  height: auto !important;
  max-height: none !important;
  z-index: 10050;
}

#float-panel-focus .float-panel-head.panel-drag-handle {
  cursor: grab;
  border-bottom-color: #2a2f3a;
}

#float-panel-focus .float-panel-head h2 {
  color: #e8eaed;
}

#float-panel-focus .float-panel-head .hint {
  color: #9aa0a6;
}

#float-panel-focus .float-panel-close {
  color: #9aa0a6;
  border-color: #3d4450;
}

#float-panel-focus .float-panel-close:hover {
  color: #e8eaed;
  background: #1f2430;
}

.float-focus-body {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.focus-layout {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  flex: 1;
  min-height: 0;
}

.focus-layout-main {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(14rem, 16.5rem);
  gap: 0.75rem;
  flex: 1;
  min-height: 0;
  align-items: stretch;
}

.focus-layout-left {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 0;
  min-height: 0;
  flex: 1;
}

.focus-layout-right {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.focus-scenarios-panel {
  flex: 1;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.65rem 0.7rem;
  border-radius: 10px;
  border: 1px solid #2a2f3a;
  background: #0f1218;
}

.focus-scenarios-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.focus-side-title {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: #e8eaed;
}

.focus-scenarios-basis {
  font-size: 0.72rem;
  color: #9aa0a6;
  font-variant-numeric: tabular-nums;
}

.focus-scenarios-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.55rem;
  font-size: 0.74rem;
  color: #cbd5e1;
}

.focus-scenario-badge {
  display: inline-block;
  padding: 0.12rem 0.4rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
}

.focus-scenario-badge.ok {
  color: #15803d;
  background: rgba(34, 197, 94, 0.15);
}

.focus-scenario-badge.bad {
  color: #b91c1c;
  background: rgba(239, 68, 68, 0.12);
}

.focus-scenario-worst {
  font-variant-numeric: tabular-nums;
}

.focus-scenarios-rows {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  padding-right: 0.15rem;
}

.focus-scenario-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.38rem 0.45rem;
  border-radius: 7px;
  font-size: 0.8rem;
  background: #1a1f28;
  border: 1px solid #2a2f3a;
}

.focus-scenario-row.focus-scenario-ok {
  border-color: rgba(34, 197, 94, 0.35);
}

.focus-scenario-row.focus-scenario-bad {
  border-color: rgba(239, 68, 68, 0.28);
}

.focus-scenario-label {
  color: #cbd5e1;
  font-weight: 500;
}

.focus-scenario-pnl {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.focus-scenario-row.pnl-profit .focus-scenario-pnl {
  color: #15803d;
}

.focus-scenario-row.pnl-loss .focus-scenario-pnl {
  color: #dc2626;
}

.focus-scenario-row.focus-scenario-flash-up {
  animation: focus-scenario-flash-up 2s ease forwards;
}

.focus-scenario-row.focus-scenario-flash-down {
  animation: focus-scenario-flash-down 2s ease forwards;
}

@keyframes focus-scenario-flash-up {
  0%, 20% {
    background: rgba(34, 197, 94, 0.22);
    border-color: rgba(34, 197, 94, 0.55);
  }
  100% {
    background: #1a1f28;
  }
}

@keyframes focus-scenario-flash-down {
  0%, 20% {
    background: rgba(239, 68, 68, 0.18);
    border-color: rgba(239, 68, 68, 0.45);
  }
  100% {
    background: #1a1f28;
  }
}

.focus-scenarios-empty {
  margin: 0.35rem 0;
  font-size: 0.78rem;
  color: #9aa0a6;
}

.focus-poly-panel,
.focus-form-actions,
#float-panel-focus .exec-qualified-hint,
#float-panel-focus .exec-depth-hint,
.focus-exec-progress:not(.hidden) {
  flex-shrink: 0;
}

.focus-plan-inline {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.1rem;
  padding: 0.55rem 0.6rem 0.6rem;
  border-radius: 8px;
  border: 1px solid #2a2f3a;
  background: #0f1218;
  overflow: hidden;
}

.focus-plan-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-shrink: 0;
}

.focus-plan-text {
  margin: 0;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  font-size: 0.72rem;
  line-height: 1.45;
  color: #cbd5e1;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.focus-form-actions {
  margin: 0;
}

.focus-odds-trend {
  flex-shrink: 0;
  min-width: 1.15rem;
  text-align: center;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
}

.focus-odds-trend-up {
  color: #f87171;
}

.focus-odds-trend-down {
  color: #4ade80;
}

.focus-odds-trend-flat {
  visibility: hidden;
}

@media (max-width: 720px) {
  #float-panel-focus {
    width: calc(100vw - 1rem);
    height: min(94vh, none);
    max-height: 94vh;
  }

  .focus-layout-main {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }
}

.focus-empty-hint {
  margin: 1rem 0.25rem;
  text-align: center;
  color: #9aa0a6;
  font-size: 0.9rem;
}

.focus-active-wrap {
  min-width: 0;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.float-focus-form {
  margin: 0;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#float-panel-focus .float-exec-stakes {
  margin: 0;
  gap: 0.45rem;
}

#float-panel-focus .exec-qualified-hint,
#float-panel-focus .exec-depth-hint {
  margin: 0;
  font-size: 0.76rem;
  line-height: 1.35;
  color: #9aa0a6;
}

#float-panel-focus .exec-qualified-hint.ok {
  color: #86efac;
}

#float-panel-focus .exec-qualified-hint.bad {
  color: #fca5a5;
}

#float-panel-focus .exec-qualified-hint.focus {
  color: #fbbf24;
  line-height: 1.35;
  word-break: break-word;
}

#float-panel-focus .form label.focus-auto-exec-label,
.focus-poly-tabs .focus-auto-exec-label {
  display: inline-flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center;
  gap: 0.4rem;
  margin: 0 0 -0.47rem;
  padding: 0.3rem 0.55rem 0.34rem;
  border-radius: 6px;
  border: 1px solid rgba(251, 191, 36, 0.55);
  background: linear-gradient(180deg, rgba(251, 191, 36, 0.14) 0%, rgba(251, 191, 36, 0.06) 100%);
  font-size: 0.76rem;
  font-weight: 600;
  color: #fcd34d !important;
  cursor: pointer;
  user-select: none;
  flex-shrink: 0;
  white-space: nowrap;
  line-height: 1;
  transition: border-color 0.15s, background 0.15s, color 0.15s, box-shadow 0.15s;
}

#float-panel-focus .form label.focus-auto-exec-label:hover,
.focus-poly-tabs .focus-auto-exec-label:hover {
  border-color: rgba(251, 191, 36, 0.85);
  color: #fde68a !important;
  box-shadow: 0 0 10px rgba(251, 191, 36, 0.12);
}

#float-panel-focus .form label.focus-auto-exec-label:has(input:checked),
.focus-poly-tabs .focus-auto-exec-label:has(input:checked) {
  border-color: #4ade80;
  background: linear-gradient(180deg, rgba(74, 222, 128, 0.22) 0%, rgba(74, 222, 128, 0.08) 100%);
  color: #86efac !important;
  box-shadow: 0 0 12px rgba(74, 222, 128, 0.18);
}

.focus-auto-exec-text {
  white-space: nowrap;
  line-height: 1;
}

#float-panel-focus .form label.focus-auto-exec-label input[type="checkbox"],
.focus-poly-tabs .focus-auto-exec-label input[type="checkbox"] {
  width: 0.95rem;
  height: 0.95rem;
  margin: 0;
  padding: 0;
  accent-color: #4ade80;
  cursor: pointer;
  flex-shrink: 0;
}

#float-panel-focus .form label.focus-auto-exec-label input[type="checkbox"]:disabled,
.focus-poly-tabs .focus-auto-exec-label input[type="checkbox"]:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

#float-panel-focus .form label.focus-auto-exec-label:has(input:disabled),
.focus-poly-tabs .focus-auto-exec-label:has(input:disabled) {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

#float-panel-focus .form-actions,
#float-panel-focus .focus-form-actions {
  margin: 0;
  gap: 0.4rem;
}

#float-panel-focus .focus-exec-progress {
  margin-top: 0.15rem;
}

.focus-fixture-match {
  display: none !important;
}

.float-dock-badge-focus {
  font-size: 0.55rem;
  line-height: 1;
  padding: 0.15rem 0.25rem;
  color: #4ade80;
}

.float-dock-btn-active-scan {
  box-shadow: 0 0 0 2px #4ade80;
}

.float-exec-body-jobs-only {
  gap: 0.45rem;
}

.float-exec-jobs-only {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.float-exec-jobs-only .exec-jobs-table-wrap {
  flex: 1;
  min-height: 0;
  max-height: none;
}

.exec-jobs-tip {
  margin: 0;
  font-size: 0.78rem;
  flex-shrink: 0;
}

#float-panel-exec {
  top: auto;
  bottom: max(0.75rem, env(safe-area-inset-bottom));
  left: max(0.75rem, env(safe-area-inset-left));
  right: 2.55rem;
  width: auto;
  height: 38vh;
  max-height: 38vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0.65rem 0.85rem 0.85rem;
  border-radius: 12px;
  --exec-bg: #f8fafc;
  --exec-surface: #ffffff;
  --exec-border: #cbd5e1;
  --exec-text: #0f172a;
  --exec-muted: #64748b;
  --exec-primary: #2563eb;
  --exec-primary-hover: #1d4ed8;
  --exec-danger: #dc2626;
  --exec-danger-hover: #b91c1c;
  --exec-ok: #16a34a;
  --exec-warn: #d97706;
  background: linear-gradient(165deg, #ffffff 0%, var(--exec-bg) 100%);
  color: var(--exec-text);
  border: 1px solid var(--exec-border);
  box-shadow:
    0 20px 50px rgba(15, 23, 42, 0.14),
    0 0 0 1px rgba(255, 255, 255, 0.9) inset;
}

#float-panel-exec.float-panel-maximized {
  left: max(0.5rem, env(safe-area-inset-left)) !important;
  right: max(0.5rem, env(safe-area-inset-right)) !important;
  top: max(0.5rem, env(safe-area-inset-top)) !important;
  bottom: max(0.5rem, env(safe-area-inset-bottom)) !important;
  width: auto !important;
  height: auto !important;
  max-height: none !important;
  z-index: 10050;
}

#float-panel-exec.float-panel-maximized .plan-preview-box {
  max-height: min(42vh, 28rem);
}

#float-panel-exec.float-panel-maximized .float-exec-jobs-table-wrap {
  max-height: min(28vh, 16rem);
}

#float-panel-exec .float-panel-head {
  flex-shrink: 0;
  border-bottom-color: var(--exec-border);
}

#float-panel-exec .float-panel-head.panel-drag-handle {
  cursor: grab;
}

.float-exec-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  overflow: hidden;
}

#hedge-action-panel.float-exec-action {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-width: 0;
}

#hedge-action-panel .execution-progress-panel {
  margin: 0;
}

#hedge-action-panel #action-form {
  margin: 0;
  min-width: 0;
}

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

.plan-preview-toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 0.35rem;
  margin: 0.35rem 0 0.25rem;
}

.plan-preview-box {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  min-height: 3.25rem;
  max-height: 9.5rem;
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.4;
}

.float-exec-form .stake-dual {
  margin: 0.35rem 0;
}

.float-exec-stakes {
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.float-exec-jobs-section {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.float-exec-jobs-section > .float-subtitle {
  flex-shrink: 0;
  margin: 0 0 0.3rem;
}

.exec-jobs-table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  max-height: 100%;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.12);
  overflow-y: scroll; /* 始终保留滚动条占位，避免“看不到” */
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
}

/* WebKit（Chrome/Safari）滚动条可见性：暗色主题 */
.exec-jobs-table-wrap::-webkit-scrollbar {
  width: 10px;
}
.exec-jobs-table-wrap::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
}
.exec-jobs-table-wrap::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.6);
  border-radius: 10px;
  border: 2px solid rgba(0, 0, 0, 0.15);
}
.exec-jobs-table-wrap::-webkit-scrollbar-thumb:hover {
  background: rgba(203, 213, 225, 0.85);
}

.exec-jobs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.exec-jobs-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 0.45rem 0.5rem;
  text-align: left;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.exec-jobs-table tbody td {
  padding: 0.45rem 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  vertical-align: top;
}

.exec-jobs-table .exec-col-pnl {
  font-size: 0.72rem;
  line-height: 1.25;
  max-width: 9rem;
}

.exec-jobs-table .exec-col-pnl div {
  white-space: nowrap;
}

.exec-job-row:hover {
  background: rgba(255, 255, 255, 0.03);
}

.exec-job-row.exec-job-active {
  background: rgba(234, 179, 8, 0.08);
}

.exec-job-row.exec-job-active td {
  border-bottom-color: transparent;
}

.exec-job-detail td {
  padding: 0 0.35rem 0.55rem;
  border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.18);
}

.exec-job-detail.exec-job-active td {
  box-shadow: inset 0 0 0 1px rgba(234, 179, 8, 0.2);
}

.exec-match-cell {
  min-width: 8.5rem;
  max-width: 14rem;
}

.exec-match-name {
  display: block;
  font-size: 0.8rem;
  line-height: 1.3;
}

.exec-match-id {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.68rem;
  color: var(--muted);
  word-break: break-all;
}

.exec-progress-cell {
  min-width: 4.5rem;
  white-space: nowrap;
}

.exec-log-toggle {
  padding: 0.12rem 0.35rem;
  font-size: 0.65rem;
  vertical-align: middle;
}

.exec-job-log-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin: 0.15rem 0 0.25rem;
  padding: 0 0.1rem;
}

.exec-job-log-head .hint {
  font-size: 0.68rem;
}

.exec-progress-pct {
  display: inline-block;
  min-width: 2.2rem;
  margin-right: 0.35rem;
  font-weight: 600;
  font-size: 0.74rem;
  color: var(--muted);
}

.exec-step-pips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem;
  margin-top: 0.2rem;
}

.exec-pip {
  display: inline-block;
  padding: 0.08rem 0.28rem;
  border-radius: 4px;
  font-size: 0.62rem;
  line-height: 1.2;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  white-space: nowrap;
}

.exec-pip.ok {
  border-color: rgba(34, 197, 94, 0.45);
  color: var(--ok);
  background: rgba(34, 197, 94, 0.12);
}

.exec-pip.bad {
  border-color: rgba(239, 68, 68, 0.5);
  color: var(--danger);
  background: rgba(239, 68, 68, 0.12);
}

.exec-pip.running {
  border-color: rgba(234, 179, 8, 0.55);
  color: var(--warn);
  background: rgba(234, 179, 8, 0.12);
}

.exec-msg-cell {
  min-width: 7rem;
  max-width: 14rem;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.35;
  word-break: break-word;
}

.exec-time-cell {
  white-space: nowrap;
  color: var(--muted);
  font-size: 0.72rem;
}

.exec-jobs-empty td {
  text-align: center;
  padding: 1.25rem 0.5rem;
}

.exec-job-legs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.72rem;
  margin-bottom: 0.5rem;
}

.exec-job-legs-table th,
.exec-job-legs-table td {
  padding: 0.28rem 0.4rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  text-align: left;
  vertical-align: top;
}

.exec-job-legs-table th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.68rem;
  white-space: nowrap;
}

.exec-leg-row.ok td:first-child {
  border-left: 3px solid var(--ok);
}

.exec-leg-row.bad td:first-child {
  border-left: 3px solid var(--danger);
}

.exec-leg-row.running td:first-child {
  border-left: 3px solid var(--warn);
}

.exec-leg-status {
  font-size: 0.68rem;
  font-weight: 600;
  white-space: nowrap;
}

.exec-leg-status-success { color: var(--ok); }
.exec-leg-status-failed { color: var(--danger); }
.exec-leg-status-planned { color: var(--muted); }
.exec-leg-status-running { color: var(--warn); }

.exec-order-id {
  font-size: 0.68rem;
  color: #9ec5ff;
  word-break: break-all;
}

.exec-leg-msg {
  max-width: 12rem;
  font-size: 0.78rem;
  color: var(--muted);
  word-break: break-word;
}

.exec-col-actions {
  white-space: nowrap;
  width: 5.5rem;
}

.opp-verify-row td {
  padding: 0.35rem 0.5rem 0.75rem;
  background: #151d2b;
  border-bottom: 1px solid var(--border);
}

.exec-verify-panel {
  margin-top: 0.35rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid #3d4f6a;
  border-radius: 6px;
  background: #1e2a3d;
  color: var(--text);
}

.exec-verify-panel.ok {
  border-color: color-mix(in srgb, var(--ok) 55%, #3d4f6a);
  background: color-mix(in srgb, var(--ok) 8%, #1e2a3d);
}

.exec-verify-panel.warn {
  border-color: color-mix(in srgb, var(--warn) 55%, #3d4f6a);
  background: color-mix(in srgb, var(--warn) 8%, #1e2a3d);
}

.exec-verify-panel.bad {
  border-color: color-mix(in srgb, var(--danger) 55%, #3d4f6a);
  background: color-mix(in srgb, var(--danger) 8%, #1e2a3d);
}

.exec-verify-panel .hint {
  color: #b8c5d9;
  font-size: 0.8rem;
}

.exec-verify-summary {
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: #f1f5f9;
  font-size: 0.88rem;
}

.exec-verify-checks {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.84rem;
  color: #e2e8f0;
}

.exec-verify-checks li {
  margin: 0.25rem 0;
}

.exec-verify-checks li strong {
  color: #f8fafc;
}

.exec-verify-check-pass { color: #4ade80; }
.exec-verify-check-warn { color: #fbbf24; }
.exec-verify-check-fail { color: #f87171; }

.exec-verify-issues {
  color: #fbbf24 !important;
}

.exec-leg-actions {
  white-space: nowrap;
}

.exec-leg-actions .btn {
  margin-right: 0.25rem;
}

.exec-verify-pnl {
  margin-top: 0.45rem;
  font-size: 0.84rem;
  color: #e2e8f0;
}

.exec-verify-calc-wrap {
  margin-top: 0.5rem;
  font-size: 0.82rem;
  color: #dbe4f0;
}

.exec-verify-calc-title {
  margin: 0.35rem 0 0.25rem;
  color: #b8c5d9;
}

.exec-verify-calc-seg {
  margin: 0.35rem 0;
  padding: 0.45rem 0.55rem;
  border: 1px solid #4a5d78;
  border-radius: 4px;
  background: #121a26;
  color: #e7ecf3;
}

.exec-verify-calc-seg strong {
  color: #f8fafc;
}

.exec-verify-formula-list {
  margin: 0.25rem 0 0;
  padding-left: 1.1rem;
  color: #d1dae8;
  line-height: 1.5;
}

.opp-verify-progress {
  padding: 0.55rem 0.65rem;
  border: 1px solid #4a5d78;
  border-radius: 6px;
  background: #121a26;
  color: #e7ecf3;
}

.opp-verify-progress-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.35rem;
  font-size: 0.84rem;
}

.opp-verify-progress-pct {
  font-variant-numeric: tabular-nums;
  color: #93c5fd;
}

.opp-verify-progress-track {
  height: 6px;
  margin-bottom: 0.35rem;
}

.opp-verify-progress-msg {
  margin: 0.15rem 0 0;
  color: #b8c5d9;
  font-size: 0.8rem;
}

.opp-verify-progress-detail {
  margin: 0.2rem 0 0;
  color: #94a3b8;
  font-size: 0.75rem;
}

.opp-verify-row-loading td {
  background: #151d2b;
}

.exec-job-detail-panel {
  padding: 0.15rem 0;
}

.exec-job-steps-head {
  margin-top: 0.35rem;
  padding-top: 0.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.exec-job-no-legs {
  margin: 0.25rem 0 0.5rem;
}

.exec-job-steps-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.72rem;
}

.exec-job-steps-table th,
.exec-job-steps-table td {
  padding: 0.3rem 0.45rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  text-align: left;
}

.exec-job-steps-table th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.68rem;
}

.exec-step-row.ok td:first-child {
  border-left: 3px solid var(--ok);
}

.exec-step-row.bad td:first-child {
  border-left: 3px solid var(--bad);
}

.exec-step-row.running td:first-child {
  border-left: 3px solid var(--warn);
}

.float-exec-jobs-list {
  --exec-list-max-h: 14rem;
}

#float-panel-trial {
  top: 4%;
  width: min(27rem, calc(100vw - 3.5rem));
  max-height: min(92vh, 42rem);
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#float-panel-trial.hidden {
  display: none;
}

.float-trial-subtitle {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.float-panel-trial .float-panel-head {
  flex-shrink: 0;
  margin: 0;
  padding: 0.5rem 0.6rem;
}

.float-trial-frame-wrap {
  flex: 1 1 auto;
  min-height: 0;
}

.float-trial-frame {
  display: block;
  width: 100%;
  height: min(78vh, 36rem);
  min-height: 22rem;
  border: none;
  background: #0f1419;
}

.float-panel-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  margin-bottom: 0.45rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border);
}

.panel-drag-handle {
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.panel-drag-handle:active,
.is-dragging.panel-drag-handle,
.is-dragging .panel-drag-handle {
  cursor: grabbing;
}

body.panel-drag-active {
  user-select: none;
  cursor: grabbing;
}

body.panel-drag-active * {
  cursor: grabbing !important;
}

.app-modal-title.panel-drag-handle {
  padding: 0.15rem 0.1rem 0.35rem;
  margin: -0.15rem -0.1rem 0;
  border-radius: 6px;
}

.opp-alert-title.panel-drag-handle {
  padding: 0.25rem 0.5rem;
  margin: -0.25rem -0.5rem 0.35rem;
  border-radius: 8px;
}

.config-editor-head.panel-drag-handle {
  padding-bottom: 0.35rem;
  margin-bottom: 0.15rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.float-panel-head h2 {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
}

.float-panel-close {
  padding: 0.2rem 0.45rem;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  font-size: 0.68rem;
  cursor: pointer;
}

.float-panel-actions {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.float-panel-actions .btn.small {
  padding: 0.2rem 0.45rem;
  font-size: 0.65rem;
}

.float-panel-close:hover {
  color: var(--text);
  border-color: rgba(147, 197, 253, 0.45);
}

.float-subtitle {
  margin: 0.55rem 0 0.35rem;
  font-size: 0.82rem;
  font-weight: 600;
}

@media (max-width: 640px) {
  .float-panel {
    right: 2.35rem;
    width: calc(100vw - 2.75rem);
  }

  #float-panel-exec {
    left: max(0.5rem, env(safe-area-inset-left));
    right: 2.35rem;
    height: 50vh;
    max-height: 50vh;
  }

  .plan-preview-box {
    max-height: 7.5rem;
  }

  .exec-match-cell,
  .exec-msg-cell {
    max-width: none;
  }

  #float-panel-trial {
    top: 4%;
    max-height: 88vh;
    width: calc(100vw - 2.75rem);
  }

  .float-trial-frame {
    min-height: 18rem;
    height: 72vh;
  }
}

@media (max-width: 720px) {
  body {
    overflow-y: auto;
    display: block;
  }

  #opp-panel {
    display: flex;
    flex-direction: column;
    min-height: 55vh;
  }

  #opp-panel > .table-wrap:not(.hidden) {
    flex: 1 1 0;
    min-height: 0;
    max-height: 100%;
  }
}

/* —— 精准扫盘面板：深色主题 —— */
#float-panel-focus .hint,
#float-panel-focus .form label {
  color: #9aa0a6;
}

#float-panel-focus .btn {
  background: #1f2430;
  border: 1px solid #3d4450;
  color: #e8eaed;
}

#float-panel-focus .btn:hover {
  background: #2a2f3a;
  border-color: #4b5563;
}

#float-panel-focus .btn.danger {
  background: #dc2626;
  border-color: #dc2626;
  color: #fff;
}

#float-panel-focus .btn.danger:hover {
  background: #b91c1c;
  border-color: #b91c1c;
}

#float-panel-focus .btn.danger:disabled {
  background: #3d2020;
  border-color: #4a2828;
  color: #9ca3af;
}

#float-panel-exec .float-panel-head h2 {
  color: var(--exec-text);
}

#float-panel-exec .hint,
#float-panel-exec .float-subtitle,
#float-panel-exec .form label {
  color: var(--exec-muted);
}

#float-panel-exec .fixture-picked {
  background: #1a2332;
  border-color: #2d3a4f;
  color: #ffffff;
}

#float-panel-exec .fixture-picked.hint {
  color: rgba(255, 255, 255, 0.52);
}

#float-panel-exec #fixture-match {
  color: inherit;
}

#float-panel-exec .btn {
  background: var(--exec-surface);
  border-color: var(--exec-border);
  color: var(--exec-text);
}

#float-panel-exec .btn:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

#float-panel-exec .btn.primary {
  background: var(--exec-primary);
  border-color: var(--exec-primary);
  color: #fff;
}

#float-panel-exec .btn.primary:hover {
  background: var(--exec-primary-hover);
  border-color: var(--exec-primary-hover);
}

#float-panel-exec .btn.danger {
  background: var(--exec-danger);
  border-color: var(--exec-danger);
  color: #fff;
}

#float-panel-exec .btn.danger:hover {
  background: var(--exec-danger-hover);
  border-color: var(--exec-danger-hover);
}

#float-panel-exec .float-panel-close {
  color: var(--exec-muted);
  border-color: var(--exec-border);
  background: var(--exec-surface);
}

#float-panel-exec .float-panel-close:hover {
  color: var(--exec-text);
  border-color: #94a3b8;
  background: #f1f5f9;
}

#float-panel-exec .form input {
  background: var(--exec-surface);
  border: 1px solid var(--exec-border);
  color: var(--exec-text);
}

#float-panel-exec .float-exec-stakes input,
#float-panel-exec .float-exec-stakes .stake-readonly {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 2rem;
  height: 2rem;
  padding: 0 0.55rem;
  box-sizing: border-box;
  border-radius: 6px;
  font-size: 0.82rem;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

#float-panel-exec .float-exec-stakes input {
  background: var(--exec-surface);
  border: 1px solid var(--exec-border);
  color: var(--exec-text);
}

#float-panel-exec .float-exec-stakes .stake-readonly {
  background: #e8edf3;
  border: 1px solid #c5d0de;
  color: var(--exec-text);
  cursor: default;
  user-select: none;
}

#float-panel-exec .float-exec-stakes .stake-readonly.muted {
  color: var(--exec-muted);
  background: #f1f5f9;
  border-color: #d1d9e6;
}

#float-panel-exec .plan-preview-box,
#float-panel-exec .result-box {
  background: #f8fafc;
  border-color: var(--exec-border);
  color: var(--exec-text);
}

#float-panel-exec .execution-progress-panel {
  border-color: #fcd34d;
  background: #fffbeb;
  color: var(--exec-text);
}

#float-panel-exec .execution-progress-panel.exec-done {
  border-color: #86efac;
  background: #f0fdf4;
}

#float-panel-exec .execution-progress-panel.exec-failed {
  border-color: #fca5a5;
  background: #fef2f2;
}

#float-panel-exec .exec-steps-log {
  background: #f8fafc;
  border-color: var(--exec-border);
  color: var(--exec-text);
}

#float-panel-exec .exec-jobs-table-wrap {
  background: var(--exec-surface);
  border-color: var(--exec-border);
}

/* WebKit 滚动条可见性：浅色 exec 面板 */
#float-panel-exec .exec-jobs-table-wrap::-webkit-scrollbar-track {
  background: #eef2f7;
}
#float-panel-exec .exec-jobs-table-wrap::-webkit-scrollbar-thumb {
  background: rgba(100, 116, 139, 0.55);
  border: 2px solid #eef2f7;
}
#float-panel-exec .exec-jobs-table-wrap::-webkit-scrollbar-thumb:hover {
  background: rgba(51, 65, 85, 0.65);
}

#float-panel-exec .exec-jobs-table thead th {
  color: var(--exec-muted);
  background: #f1f5f9;
  border-bottom-color: var(--exec-border);
}

#float-panel-exec .exec-jobs-table tbody td {
  border-bottom-color: #e2e8f0;
  color: var(--exec-text);
}

#float-panel-exec .exec-job-row:hover {
  background: #f8fafc;
}

#float-panel-exec .exec-job-row.exec-job-active {
  background: #fffbeb;
}

#float-panel-exec .exec-job-detail td {
  background: #f8fafc;
  border-bottom-color: var(--exec-border);
}

/* 执行清单内验证面板：浅色高对比 */
#float-panel-exec .exec-verify-panel {
  background: #ffffff;
  color: var(--exec-text);
  border-color: #94a3b8;
}

#float-panel-exec .exec-verify-panel.ok {
  background: #f0fdf4;
  border-color: #86efac;
}

#float-panel-exec .exec-verify-panel.warn {
  background: #fffbeb;
  border-color: #fcd34d;
}

#float-panel-exec .exec-verify-panel.bad {
  background: #fef2f2;
  border-color: #fca5a5;
}

#float-panel-exec .exec-verify-panel .hint,
#float-panel-exec .exec-verify-calc-title {
  color: #475569;
}

#float-panel-exec .exec-verify-summary {
  color: #0f172a;
}

#float-panel-exec .exec-verify-checks,
#float-panel-exec .exec-verify-pnl,
#float-panel-exec .exec-verify-calc-wrap {
  color: #1e293b;
}

#float-panel-exec .exec-verify-checks li strong,
#float-panel-exec .exec-verify-calc-seg strong {
  color: #0f172a;
}

#float-panel-exec .exec-verify-check-pass { color: #15803d; }
#float-panel-exec .exec-verify-check-warn { color: #b45309; }
#float-panel-exec .exec-verify-check-fail { color: #b91c1c; }

#float-panel-exec .exec-verify-issues {
  color: #b45309 !important;
}

#float-panel-exec .exec-verify-calc-seg {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #1e293b;
}

#float-panel-exec .exec-verify-formula-list {
  color: #334155;
}

#float-panel-exec .exec-match-id {
  color: var(--exec-muted);
}

#float-panel-exec .exec-progress-pct {
  color: var(--exec-muted);
}

#float-panel-exec .badge {
  background: #e2e8f0;
  color: var(--exec-text);
}

#float-panel-exec .badge-ok {
  background: #dcfce7;
  color: #166534;
}

#float-panel-exec .badge-bad {
  background: #fee2e2;
  color: #b91c1c;
}

.exec-qualified-hint.focus {
  font-weight: 500;
}

.exec-qualified-hint.ok {
  color: #15803d;
}

.exec-qualified-hint.bad {
  color: #b91c1c;
}

#float-panel-exec .exec-qualified-hint.ok {
  color: #86efac;
}

#float-panel-exec .exec-qualified-hint.bad {
  color: #fca5a5;
}

/* —— 精准扫盘 · Poly 下单风格卡片 —— */
.focus-poly-panel {
  margin: 0;
}

.focus-last-tick {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: 0.74rem;
  color: #86efac;
  padding: 0.14rem 0.5rem;
  border-radius: 999px;
  background: rgba(74, 222, 128, 0.14);
  border: 1px solid rgba(74, 222, 128, 0.32);
  transition: background 0.35s ease, color 0.35s ease, box-shadow 0.35s ease;
}

.focus-last-tick.focus-last-tick-flash {
  animation: focus-last-tick-flash 2.2s ease forwards;
}

@keyframes focus-last-tick-flash {
  0%, 12% {
    color: #ecfdf5;
    background: rgba(74, 222, 128, 0.62);
    border-color: rgba(134, 239, 172, 0.85);
    box-shadow: 0 0 14px rgba(74, 222, 128, 0.55);
  }
  100% {
    color: #86efac;
    background: rgba(74, 222, 128, 0.14);
    border-color: rgba(74, 222, 128, 0.32);
    box-shadow: none;
  }
}

.focus-poly-compare-crown {
  margin-top: 0.15rem;
}

.focus-poly-card {
  background: #14171f;
  border: 1px solid #2a2f3a;
  border-radius: 14px;
  padding: 0.85rem 0.9rem 0.95rem;
  color: #e8eaed;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}

.focus-poly-head {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}

.focus-poly-icon {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 8px;
  background: #1f2430;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
}

.focus-poly-titles {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.focus-poly-market {
  font-size: 0.72rem;
  color: #9aa0a6;
  letter-spacing: 0.01em;
}

.focus-poly-outcome {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.35;
  word-break: break-word;
}

.focus-poly-outcome-accent {
  color: #4ade80;
}

.focus-poly-tabs {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.65rem 1rem;
  margin-bottom: 0.65rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid #2a2f3a;
}

.focus-poly-tab {
  font-size: 0.82rem;
  font-weight: 600;
  color: #e8eaed;
  padding-bottom: 0.35rem;
  border-bottom: 2px solid transparent;
  margin-bottom: -0.47rem;
}

.focus-poly-tab.active {
  border-bottom-color: #e8eaed;
}

.focus-poly-tab.muted {
  color: #6b7280;
  font-weight: 500;
}

.focus-poly-book {
  margin-left: auto;
  font-size: 0.78rem;
  color: #9aa0a6;
}

.focus-poly-outcomes-wrap {
  margin: 0.55rem 0 0.65rem;
  padding: 0.55rem 0.6rem 0.6rem;
  background: #0f1218;
  border-radius: 8px;
  border: 1px solid #2a2f3a;
}

.focus-poly-outcomes-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.45rem;
  font-size: 0.72rem;
  color: #9aa0a6;
}

.focus-poly-outcomes-title {
  font-weight: 500;
}

.focus-poly-outcomes {
  display: flex;
  flex-direction: column;
  gap: 0.42rem;
  margin-bottom: 0;
}

.focus-poly-single-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}

.focus-poly-crown-row .focus-poly-crown-tag {
  color: #fbbf24;
  font-weight: 600;
}

.focus-poly-btn.focus-poly-crown {
  flex: 1;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  min-height: 2.45rem;
  padding: 0.45rem 0.65rem;
  background: #2a2418;
  border: 1px solid rgba(251, 191, 36, 0.32);
  color: #fef3c7;
}

.focus-poly-btn .focus-poly-btn-price.muted {
  color: #6b7280;
  font-size: 0.9rem;
  opacity: 1;
}

.focus-poly-dual-row .focus-poly-btn {
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  min-height: 2.45rem;
  padding: 0.45rem 0.65rem;
  gap: 0.65rem;
}

.focus-poly-dual-row .focus-poly-btn-side {
  flex: 1;
  text-align: left;
  font-size: 0.8rem;
}

.focus-poly-dual-row .focus-poly-btn-price {
  min-width: 3.2rem;
  text-align: right;
  font-size: 0.95rem;
}

.focus-poly-dual-row .focus-poly-btn-hk {
  min-width: 3.4rem;
  text-align: right;
  font-size: 0.74rem;
  opacity: 0.9;
}

.focus-poly-dual-row .focus-poly-btn,
.focus-poly-single-row .focus-poly-btn {
  gap: 0.55rem;
}

.focus-poly-single-row .focus-poly-btn {
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  min-height: 2.45rem;
  padding: 0.45rem 0.65rem;
}

.focus-poly-crown-row .focus-poly-btn-side {
  flex: 1;
  text-align: left;
}

.focus-poly-crown-row .focus-poly-btn-hk {
  min-width: 3.4rem;
  text-align: right;
}

.focus-poly-dual-row {
  grid-column: 1 / -1;
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
}

.focus-poly-dual-tag {
  font-size: 0.72rem;
  color: #9aa0a6;
  align-self: center;
  min-width: 1.8rem;
}

.focus-poly-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.1rem;
  min-height: 3.25rem;
  border: none;
  border-radius: 10px;
  padding: 0.55rem 0.45rem;
  cursor: default;
  font: inherit;
  line-height: 1.2;
  transition: background 0.15s ease;
}

.focus-poly-btn.focus-poly-dual {
  flex: 1;
}

.focus-poly-btn.focus-poly-yes {
  background: #15803d;
  color: #fff;
}

.focus-poly-btn.focus-poly-no {
  background: #3d4450;
  color: #fff;
}

.focus-poly-btn-side {
  font-size: 0.78rem;
  font-weight: 600;
  opacity: 0.95;
}

.focus-poly-btn-price {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.focus-poly-btn-hk {
  font-size: 0.68rem;
  opacity: 0.82;
}

.focus-poly-btn.odds-flash-up {
  box-shadow: inset 0 0 0 2px #f87171;
}

.focus-poly-btn.odds-flash-down {
  box-shadow: inset 0 0 0 2px #4ade80;
}

.focus-poly-compare {
  display: grid;
  gap: 0.35rem;
  padding: 0.55rem 0.65rem;
  background: #1a1f28;
  border-radius: 8px;
  margin-bottom: 0.6rem;
  font-size: 0.78rem;
}

.focus-poly-compare-row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
}

.focus-poly-compare-label {
  color: #9aa0a6;
  flex-shrink: 0;
}

.focus-poly-compare-val {
  color: #e8eaed;
  font-weight: 500;
  text-align: right;
  word-break: break-word;
}

.focus-poly-arb {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.65rem;
  padding-top: 0.15rem;
  font-size: 0.8rem;
}

.focus-poly-arb-status {
  font-weight: 700;
  line-height: 1.35;
  word-break: break-word;
}

.focus-poly-arb-ok .focus-poly-arb-status {
  color: #4ade80;
}

.focus-poly-arb-bad .focus-poly-arb-status {
  color: #f87171;
}

.focus-poly-arb-detail {
  color: #9aa0a6;
}

.focus-depth-panel {
  margin-top: 0.55rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.22);
  font-size: 0.78rem;
}

.focus-depth-panel.focus-depth-flash {
  animation: focus-depth-pulse 0.55s ease-out;
}

@keyframes focus-depth-pulse {
  0% { border-color: rgba(74, 222, 128, 0.55); background: rgba(74, 222, 128, 0.08); }
  100% { border-color: rgba(255, 255, 255, 0.08); background: rgba(0, 0, 0, 0.22); }
}

.focus-depth-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.focus-depth-title {
  font-weight: 600;
  color: #e8eaed;
}

.focus-depth-age {
  font-size: 0.72rem;
  color: #9aa0a6;
  font-variant-numeric: tabular-nums;
}

.focus-depth-rows {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.focus-depth-wait {
  margin: 0;
  color: #9aa0a6;
  font-size: 0.76rem;
}

.focus-depth-row {
  display: grid;
  grid-template-columns: minmax(4.5rem, auto) 1fr auto;
  align-items: center;
  gap: 0.35rem 0.5rem;
  padding: 0.28rem 0.35rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
}

.focus-depth-row-ok {
  border-left: 2px solid rgba(74, 222, 128, 0.65);
}

.focus-depth-row-bad {
  border-left: 2px solid rgba(248, 113, 113, 0.75);
}

.focus-depth-label {
  color: #cbd5e1;
  white-space: nowrap;
}

.focus-depth-amts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.65rem;
  font-variant-numeric: tabular-nums;
}

.focus-depth-plan {
  color: #e8eaed;
}

.focus-depth-cap {
  color: #9ec5ff;
}

.focus-depth-row .depth-status-ok,
.focus-depth-row .depth-status-bad {
  font-size: 0.72rem;
  white-space: nowrap;
}

.focus-poly-btn.odds-flash-up .focus-poly-btn-price,
.focus-poly-btn.odds-flash-up .focus-poly-btn-hk {
  color: #f87171;
}

.focus-poly-btn.odds-flash-down .focus-poly-btn-price,
.focus-poly-btn.odds-flash-down .focus-poly-btn-hk {
  color: #4ade80;
}

/* —— 应用模态框（居中） —— */
.app-modal-root {
  position: fixed;
  inset: 0;
  z-index: 2200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.app-modal-root.hidden {
  display: none !important;
}

.app-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(6px);
  animation: app-modal-fade-in 0.2s ease;
}

.app-modal-card {
  position: relative;
  z-index: 1;
  width: min(28rem, 100%);
  max-height: min(80vh, 32rem);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 1.25rem 1.35rem 1.15rem;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  box-shadow:
    0 24px 60px rgba(15, 23, 42, 0.18),
    0 0 0 1px rgba(255, 255, 255, 0.85) inset;
  animation: app-modal-pop 0.28s cubic-bezier(0.34, 1.4, 0.64, 1);
}

.app-modal-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.35;
}

.app-modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.55;
  color: #475569;
  white-space: pre-wrap;
  word-break: break-word;
}

.app-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  flex-shrink: 0;
}

.app-modal-btn-cancel {
  background: #fff;
  border-color: #cbd5e1;
  color: #334155;
}

.app-modal-btn-cancel:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

.app-modal-btn-confirm {
  min-width: 5.5rem;
}

.app-modal-danger .app-modal-title {
  color: #b91c1c;
}

.app-modal-danger .app-modal-btn-confirm {
  background: #dc2626;
  border-color: #dc2626;
}

.app-modal-danger .app-modal-btn-confirm:hover {
  background: #b91c1c;
  border-color: #b91c1c;
}

body.app-modal-open {
  overflow: hidden;
}

@keyframes app-modal-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes app-modal-pop {
  from {
    opacity: 0;
    transform: scale(0.94) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* —— 执行详情弹窗 —— */
.exec-detail-modal-root {
  position: fixed;
  inset: 0;
  z-index: 2250;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.exec-detail-modal-root.hidden {
  display: none !important;
}

.exec-detail-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(6px);
  animation: app-modal-fade-in 0.2s ease;
}

.exec-detail-modal-card {
  position: relative;
  z-index: 1;
  width: min(46rem, 100%);
  max-height: min(88vh, 54rem);
  display: flex;
  flex-direction: column;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  box-shadow:
    0 24px 60px rgba(15, 23, 42, 0.2),
    0 0 0 1px rgba(255, 255, 255, 0.85) inset;
  animation: app-modal-pop 0.28s cubic-bezier(0.34, 1.4, 0.64, 1);
  overflow: hidden;
}

.exec-detail-modal-root.exec-detail-maximized {
  padding: 0.45rem;
}

.exec-detail-modal-root.exec-detail-maximized .exec-detail-modal-card {
  width: calc(100vw - 0.9rem);
  height: calc(100vh - 0.9rem);
  max-height: none;
}

.exec-detail-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.15rem 0.75rem;
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
}

.exec-detail-modal-title {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.35;
  flex: 1 1 auto;
  min-width: 0;
  word-break: break-word;
}

.exec-detail-modal-head-actions {
  display: flex;
  gap: 0.35rem;
  flex-shrink: 0;
}

.exec-detail-modal-close {
  background: #fff;
}

.exec-detail-modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 0.85rem 1.15rem 1.1rem;
  font-size: 0.86rem;
  line-height: 1.5;
  color: #334155;
}

.exec-detail-section {
  margin-bottom: 1.1rem;
}

.exec-detail-section:last-child {
  margin-bottom: 0;
}

.exec-detail-section > h4 {
  margin: 0 0 0.55rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: none;
  color: #64748b;
}

.exec-detail-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr));
  gap: 0.55rem 1rem;
  margin-bottom: 0.55rem;
}

.exec-detail-summary-item {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
}

.exec-detail-summary-item .label {
  font-size: 0.68rem;
  color: #94a3b8;
}

.exec-detail-summary-item .value {
  font-size: 0.84rem;
  font-weight: 600;
  color: #0f172a;
}

.exec-detail-summary-msg {
  margin: 0;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  background: #f1f5f9;
  color: #475569;
  font-size: 0.82rem;
  line-height: 1.45;
}

.exec-detail-summary-msg.bad {
  background: #fef2f2;
  color: #b91c1c;
}

.exec-detail-summary-msg.ok {
  background: #f0fdf4;
  color: #166534;
}

.exec-detail-step-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.exec-detail-step {
  display: flex;
  gap: 0.65rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid #e2e8f0;
}

.exec-detail-step:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.exec-detail-step-marker {
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
  margin-top: 0.05rem;
  background: #f1f5f9;
  color: #94a3b8;
}

.exec-detail-step-success .exec-detail-step-marker {
  background: #dcfce7;
  color: #15803d;
}

.exec-detail-step-failed .exec-detail-step-marker {
  background: #fee2e2;
  color: #b91c1c;
}

.exec-detail-step-running .exec-detail-step-marker {
  background: #fef3c7;
  color: #b45309;
}

.exec-detail-step-skipped .exec-detail-step-marker {
  background: #f8fafc;
  color: #cbd5e1;
}

.exec-detail-step-content {
  flex: 1 1 auto;
  min-width: 0;
}

.exec-detail-step-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.2rem;
}

.exec-detail-step-title {
  font-size: 0.86rem;
  color: #0f172a;
}

.exec-detail-step-status {
  flex-shrink: 0;
  font-size: 0.72rem;
  color: #64748b;
}

.exec-detail-step-success .exec-detail-step-status { color: #15803d; }
.exec-detail-step-failed .exec-detail-step-status { color: #b91c1c; }
.exec-detail-step-running .exec-detail-step-status { color: #b45309; }

.exec-detail-step-desc {
  margin: 0;
  font-size: 0.82rem;
  color: #475569;
  line-height: 1.45;
}

.exec-detail-step-meta {
  margin: 0.2rem 0 0;
  font-size: 0.72rem;
  color: #94a3b8;
}

.exec-detail-modal-body .exec-job-legs-table th {
  color: #64748b;
  border-bottom: 1px solid #e2e8f0;
}

.exec-detail-modal-body .exec-job-legs-table td {
  border-bottom: 1px solid #e2e8f0;
  color: #334155;
}

.exec-detail-modal-body .exec-job-no-legs {
  color: #94a3b8;
}

.exec-detail-modal-body .exec-verify-panel {
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
}

.exec-detail-modal-body .exec-verify-panel.ok {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.exec-detail-modal-body .exec-verify-panel.warn {
  border-color: #fde68a;
  background: #fffbeb;
}

.exec-detail-modal-body .exec-verify-panel.bad {
  border-color: #fecaca;
  background: #fef2f2;
}

.exec-detail-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.45rem;
  padding-top: 0.35rem;
  border-top: 1px solid #e2e8f0;
  margin-top: 0.25rem;
}

body.exec-detail-modal-open {
  overflow: hidden;
}

