* {
  box-sizing: border-box;
}

@media (max-width: 1100px) {
  .runtime-log-summary,
  .activity-summary-grid,
  .scanner-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 640px) {
  .runtime-log-summary,
  .runtime-run-metrics,
  .activity-summary-grid,
  .activity-card-metrics,
  .scanner-summary-grid,
  .scanner-group-metrics,
  .scanner-decision-metrics {
    grid-template-columns: 1fr;
  }

  .runtime-log-toolbar,
  .runtime-run-head,
  .scanner-coverage-toolbar {
    display: grid;
  }

  .runtime-run-side {
    text-align: left;
  }
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", system-ui, sans-serif;
  color: #1a1f2c;
  background: #f5f6f8;
  background-image: radial-gradient(#d4d7dc 1px, transparent 1px);
  background-size: 18px 18px;
}

.auth-gate {
  display: none;
}

body.auth-locked {
  overflow: hidden;
}

body.auth-locked .topbar,
body.auth-locked .canvas-toolbar,
body.auth-locked .app-layout,
body.auth-locked .container,
body.auth-locked .action-toast {
  display: none;
}

body.auth-locked .auth-gate {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.auth-card {
  display: grid;
  gap: 14px;
  width: min(460px, 100%);
  padding: 24px;
  border: 1px solid #dbe3ee;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.12);
}

body.auth-unlocking .auth-card {
  border-color: #93c5fd;
  box-shadow: 0 18px 50px rgba(37, 99, 235, 0.16);
}

body.auth-unlocking .auth-card::after {
  content: "";
  display: block;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, #bfdbfe, #2563eb, #bfdbfe);
  background-size: 200% 100%;
  animation: auth-progress 1s linear infinite;
}

@keyframes auth-progress {
  from { background-position: 200% 0; }
  to { background-position: 0 0; }
}

.auth-brand {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 4px;
}

.auth-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 13px;
  font-weight: 900;
}

.auth-brand h1,
.auth-brand p {
  margin: 0;
}

.auth-brand h1 {
  color: #111827;
  font-size: 20px;
  line-height: 1.2;
}

.auth-brand p {
  margin-top: 3px;
  color: #64748b;
  font-size: 13px;
  font-weight: 700;
}

.auth-card label {
  color: #334155;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.35px;
  text-transform: uppercase;
}

.auth-input {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  color: #111827;
  font: inherit;
  font-size: 14px;
}

.auth-input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16);
}

.auth-status {
  min-height: 20px;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
}

.auth-status.ok {
  color: #047857;
}

.auth-status.warn {
  color: #b45309;
}

.auth-status.error {
  color: #b91c1c;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 7px;
  min-height: 53px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 8px 16px;
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  scrollbar-width: thin;
}

.topbar::-webkit-scrollbar {
  height: 4px;
}

.topbar::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 999px;
}

.back-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: 8px;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  color: #6b7280;
  font-size: 18px;
  line-height: 1;
  text-decoration: none;
}

.runner-name {
  color: #111827;
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
}

.runner-status {
  max-width: 280px;
  overflow: hidden;
  padding: 4px 10px;
  border-radius: 6px;
  background: #f3f4f6;
  color: #6b7280;
  font-size: 12px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tabs {
  display: flex;
  flex: 0 0 auto;
  gap: 4px;
  max-width: none;
  overflow: visible;
  padding: 4px;
  margin-left: 6px;
  border-radius: 10px;
  background: #f3f4f6;
  scrollbar-width: thin;
}

@media (max-width: 1500px) {
  .runner-status,
  .last-triggered {
    display: none;
  }

  .tabs {
    flex-basis: auto;
    max-width: none;
  }

  .top-action,
  .activate-btn {
    padding-inline: 10px;
  }
}

@media (max-width: 1280px) {
  #syncButton,
  #reconcileButton,
  #exportButton,
  #logoutButton {
    display: none;
  }

  body[data-view="controlView"] #reconcileButton,
  body[data-view="tradesView"] #reconcileButton,
  body[data-view="tradesView"] #syncButton {
    display: inline-flex;
  }
}

.tabs::-webkit-scrollbar {
  height: 4px;
}

.tabs::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 2px;
}

.tab-btn {
  flex-shrink: 0;
  padding: 7px 14px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #6b7280;
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.tab-btn:hover {
  color: #1f2937;
}

.tab-btn.active {
  background: #ffffff;
  color: #111827;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  font-weight: 600;
}

.more-tabs {
  position: relative;
  flex-shrink: 0;
}

.more-tabs summary {
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  padding: 0 12px;
  border-radius: 7px;
  color: #64748b;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.more-tabs summary::-webkit-details-marker {
  display: none;
}

.more-tabs[open] summary,
.more-tabs summary:hover {
  background: #ffffff;
  color: #111827;
}

.more-tabs-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 180;
  display: grid;
  min-width: 190px;
  gap: 3px;
  padding: 8px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.16);
}

.more-tabs-menu .tab-btn {
  justify-content: flex-start;
  padding-block: 9px;
}

.top-spacer {
  flex: 1 1 10px;
  min-width: 10px;
}

.mode-badge {
  display: inline-flex;
  align-items: center;
  height: 31px;
  padding: 0 11px;
  border-radius: 999px;
  background: #d1fae5;
  color: #065f46;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  white-space: nowrap;
}

.mode-badge.mode-paper {
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.mode-badge.mode-live {
  border: 1px solid #86efac;
  background: #dcfce7;
  color: #047857;
}

.mode-badge.mode-live-empty {
  border: 1px solid #fcd34d;
  background: #fffbeb;
  color: #92400e;
}

.mode-badge-short {
  display: none;
}

.language-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 31px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  color: #0f172a;
  font: inherit;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.4px;
  cursor: pointer;
  white-space: nowrap;
}

.language-toggle:hover {
  border-color: #2563eb;
  background: #eff6ff;
  color: #1d4ed8;
}

.qats-label {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 11px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.type-analytical {
  background: #dbeafe;
  color: #2563eb;
}

.status-active {
  background: #d9f99d;
  color: #3f6212;
}

.status-guarded {
  background: #fef3c7;
  color: #92400e;
}

.last-triggered {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  min-width: 96px;
  color: #9ca3af;
  font-size: 10px;
  line-height: 1.1;
  white-space: nowrap;
}

.last-triggered strong {
  margin-top: 2px;
  color: #6b7280;
  font-size: 11px;
}

.top-action,
.activate-btn {
  min-height: 30px;
  border-radius: 8px;
  border: 1px solid #c7d2fe;
  padding: 0 12px;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}

.top-action {
  background: #eef2ff;
  color: #4f46e5;
}

.shabbat-mode-button.active {
  border-color: #f59e0b;
  background: #fffbeb;
  color: #92400e;
}

.shabbat-mode-button.expired {
  border-color: #34d399;
  background: #ecfdf5;
  color: #047857;
}

.activate-btn {
  border: 0;
  color: #ffffff;
  background: linear-gradient(135deg, #a855f7 0%, #ec4899 100%);
  box-shadow: 0 2px 8px rgba(236, 72, 153, 0.25);
}

.activate-btn.danger {
  background: #b91c1c;
  box-shadow: 0 2px 8px rgba(185, 28, 28, 0.22);
}

.canvas-toolbar {
  position: sticky;
  top: var(--topbar-height, 53px);
  z-index: 95;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 8px 24px;
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
}

.canvas-toolbar .strategy-context {
  display: none;
}

.canvas-toolbar #runtimeLastBar {
  margin-left: auto;
}

.shabbat-banner {
  position: sticky;
  top: calc(var(--topbar-height, 53px) + 47px);
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding: 10px 24px;
  border-bottom: 1px solid #fde68a;
  background: #fffbeb;
  color: #78350f;
  font-size: 13px;
  font-weight: 800;
}

.shabbat-banner.hidden {
  display: none;
}

.shabbat-banner strong {
  color: #111827;
  font-weight: 950;
}

.shabbat-banner span {
  color: #92400e;
  font-size: 12px;
  font-weight: 750;
}

.shabbat-banner.expired {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #065f46;
}

.app-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 0;
  align-items: start;
}

.strategy-navigator {
  position: sticky;
  top: calc(var(--topbar-height, 53px) + 47px);
  z-index: 30;
  height: calc(100vh - var(--topbar-height, 53px) - 47px);
  overflow-x: hidden;
  overflow-y: auto;
  border-right: 1px solid #e5e7eb;
  background: #f8fafc;
}

.navigator-shell {
  display: grid;
  grid-template-rows: none;
  gap: 10px;
  min-height: 100%;
  padding: 12px;
}

.navigator-head {
  display: grid;
  gap: 3px;
  padding: 12px;
  border: 1px solid #dbeafe;
  border-radius: 10px;
  background: #eff6ff;
}

.navigator-head span,
.navigator-head em,
.navigator-search label {
  color: #64748b;
  font-size: 10px;
  font-style: normal;
  font-weight: 950;
  letter-spacing: 0.5px;
  line-height: 1.25;
  overflow-wrap: anywhere;
  text-transform: uppercase;
  white-space: normal;
}

.navigator-head strong {
  color: #0f172a;
  font-size: 16px;
  font-weight: 950;
  line-height: 1.18;
  overflow-wrap: anywhere;
}

.navigator-primary {
  display: grid;
  gap: 4px;
}

.navigator-primary a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 37px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #334155;
  text-decoration: none;
}

.navigator-primary a:hover,
.navigator-primary a.active {
  border-color: #bfdbfe;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

.navigator-primary strong {
  color: #0f172a;
  font-size: 13px;
  font-weight: 900;
}

.navigator-primary span {
  color: #64748b;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.navigator-more {
  display: grid;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 9px;
  background: #ffffff;
}

.navigator-more summary {
  color: #475569;
  font-size: 12px;
  font-weight: 950;
  cursor: pointer;
  list-style: none;
}

.navigator-more summary::-webkit-details-marker {
  display: none;
}

.navigator-more summary::after {
  content: "+";
  float: right;
  color: #94a3b8;
}

.navigator-more[open] summary::after {
  content: "-";
}

.navigator-more div {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  margin-top: 7px;
}

.navigator-more a {
  min-width: 0;
  padding: 7px 8px;
  border-radius: 7px;
  color: #475569;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.navigator-more a:hover,
.navigator-more a.active {
  background: #eff6ff;
  color: #1d4ed8;
}

.navigator-status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.navigator-status-grid .metric {
  min-width: 0;
  padding: 8px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #ffffff;
}

.navigator-task-panel {
  display: grid;
  gap: 7px;
  padding: 11px;
  border: 1px solid #d1fae5;
  border-radius: 10px;
  background: #f0fdf4;
}

.navigator-task-panel.task-risk,
.navigator-task-panel.task-critical {
  border-color: #fecaca;
  background: #fff7f7;
}

.navigator-task-panel.task-setup {
  border-color: #fde68a;
  background: #fffbeb;
}

.navigator-task-panel.task-paper {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.navigator-task-panel span {
  color: #64748b;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.45px;
  text-transform: uppercase;
}

.navigator-task-panel strong {
  color: #0f172a;
  font-size: 14px;
  font-weight: 950;
  line-height: 1.25;
}

.navigator-task-panel em {
  color: #475569;
  font-size: 12px;
  font-style: normal;
  font-weight: 750;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.navigator-search {
  display: grid;
  gap: 7px;
}

.navigator-list {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 0;
  max-height: none;
  overflow: visible;
  padding-right: 0;
}

.navigator-group {
  display: grid;
  gap: 6px;
}

.navigator-group-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 4px;
  color: #64748b;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.45px;
  line-height: 1.2;
  text-transform: uppercase;
}

.navigator-group-title em {
  min-width: 22px;
  padding: 2px 6px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #334155;
  font-style: normal;
  text-align: center;
}

.navigator-strategy {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(82px, auto);
  gap: 8px;
  align-items: center;
  width: 100%;
  min-height: 0;
  padding: 8px;
  border: 1px solid #e5e7eb;
  border-radius: 9px;
  background: #ffffff;
  color: #0f172a;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.navigator-strategy:hover,
.navigator-strategy.selected {
  border-color: #2563eb;
  background: #eff6ff;
}

.navigator-strategy.has-risk {
  border-color: #fed7aa;
  background: #fff7ed;
}

.navigator-strategy.has-managed-position {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.navigator-strategy-main,
.navigator-strategy-side {
  min-width: 0;
}

.navigator-strategy-main {
  display: grid;
  gap: 3px;
  align-items: start;
}

.navigator-strategy-side {
  display: grid;
  gap: 4px;
  justify-items: end;
  align-self: stretch;
}

.navigator-strategy .badge {
  width: fit-content;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.navigator-strategy strong {
  min-width: 0;
  font-size: 13px;
  font-weight: 950;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.navigator-strategy em {
  min-width: 0;
  color: #64748b;
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
  line-height: 1.32;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.navigator-strategy small {
  min-width: 0;
  color: #475569;
  font-size: 11px;
  font-weight: 750;
  line-height: 1.32;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.navigator-strategy b {
  max-width: 100%;
  padding: 4px 7px;
  border-radius: 999px;
  background: #dcfce7;
  color: #047857;
  font-size: 10px;
  font-weight: 950;
  line-height: 1.2;
  text-align: center;
  text-transform: uppercase;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.navigator-strategy b.task-risk,
.navigator-strategy b.task-critical {
  background: #fee2e2;
  color: #b91c1c;
}

.navigator-strategy b.task-setup {
  background: #fef3c7;
  color: #92400e;
}

.navigator-strategy b.task-paper {
  background: #e0f2fe;
  color: #0369a1;
}

.navigator-empty {
  padding: 14px;
  border: 1px dashed #cbd5e1;
  border-radius: 9px;
  background: #ffffff;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.strategy-context {
  display: grid;
  grid-template-columns: minmax(190px, 280px) minmax(150px, 1fr);
  align-items: center;
  gap: 7px;
  min-height: 34px;
  min-width: min(540px, 44vw);
  padding: 3px;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  background: #eff6ff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.65);
}

.strategy-context-picker {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 3px 5px 3px 8px;
}

.strategy-context-picker label {
  overflow: hidden;
  color: #64748b;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.5px;
  line-height: 1;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.strategy-context-select {
  width: 100%;
  min-width: 0;
  height: 30px;
  padding: 0 28px 0 10px;
  border: 1px solid #dbeafe;
  border-radius: 7px;
  background: #ffffff;
  color: #0f172a;
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  outline: none;
}

.strategy-context-select:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.strategy-context-current {
  display: grid;
  gap: 2px;
  align-items: center;
  min-width: 0;
  padding: 4px 8px;
  border-left: 1px solid #bfdbfe;
}

.strategy-context-current span,
.strategy-context-current em {
  color: #64748b;
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
  letter-spacing: 0.5px;
  line-height: 1;
  text-transform: uppercase;
}

.strategy-context-current strong {
  overflow: hidden;
  color: #0f172a;
  font-size: 13px;
  font-weight: 950;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.toolbar-btn {
  min-height: 28px;
  padding: 0 11px;
  border: 1px solid #e5e7eb;
  border-radius: 7px;
  background: #ffffff;
  color: #6b7280;
  font: inherit;
  font-size: 12px;
  font-weight: 500;
}

.toolbar-btn.runtime-ok {
  border-color: #bbf7d0;
  background: #ecfdf5;
  color: #047857;
}

.toolbar-btn.runtime-error {
  border-color: #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}

.toolbar-btn.runtime-disabled,
.toolbar-btn.runtime-idle {
  background: #f9fafb;
  color: #6b7280;
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.action-toast {
  position: fixed;
  right: 18px;
  top: 112px;
  z-index: 130;
  max-width: min(420px, calc(100vw - 36px));
  padding: 10px 13px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.16);
  color: #1f2937;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.action-toast.ok {
  border-color: #bbf7d0;
  color: #047857;
}

.action-toast.warn {
  border-color: #fde68a;
  color: #92400e;
}

.action-toast.error {
  border-color: #fecaca;
  color: #b91c1c;
}

.action-toast.hidden {
  display: none;
}

.global-loader {
  position: fixed;
  right: 18px;
  top: calc(var(--topbar-height, 58px) + 18px);
  z-index: 4900;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  width: min(380px, calc(100vw - 36px));
  padding: 12px 13px 14px;
  overflow: hidden;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.18);
  color: #111827;
  transform: translateY(0);
  transition: opacity 160ms ease, transform 160ms ease;
  backdrop-filter: blur(14px);
}

.global-loader.hidden {
  display: grid !important;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-6px);
}

.global-loader-spinner {
  width: 18px;
  height: 18px;
  border: 3px solid #dbeafe;
  border-top-color: #2563eb;
  border-radius: 999px;
  animation: loader-spin 760ms linear infinite;
}

.global-loader-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.global-loader-copy strong {
  overflow: hidden;
  font-size: 13px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.global-loader-copy em {
  overflow: hidden;
  color: #64748b;
  font-size: 11px;
  font-style: normal;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.global-loader-progress {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, #bfdbfe, #2563eb, #7c3aed, #bfdbfe);
  background-size: 220% 100%;
  animation: loader-progress 1.05s ease-in-out infinite;
}

.manual-close-dialog {
  position: fixed;
  inset: 0;
  z-index: 5200;
  display: grid;
  place-items: center;
  padding: 16px;
}

.manual-close-dialog.hidden {
  display: none;
}

.manual-close-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.38);
  backdrop-filter: blur(4px);
}

.manual-close-panel {
  position: relative;
  display: grid;
  width: min(540px, 100%);
  max-height: calc(100vh - 32px);
  overflow: auto;
  gap: 14px;
  padding: 16px;
  border: 1px solid #fecaca;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 24px 72px rgba(15, 23, 42, 0.25);
  outline: 0;
}

.manual-close-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 32px;
  gap: 12px;
  align-items: start;
}

.manual-close-head span,
.manual-close-target span,
.manual-close-grid small,
.manual-close-status {
  color: #64748b;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.manual-close-head h2 {
  margin: 2px 0 0;
  color: #111827;
  font-size: 19px;
  font-weight: 950;
  letter-spacing: 0;
}

.manual-close-head p {
  margin: 4px 0 0;
  color: #475569;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35;
}

.manual-close-x {
  width: 32px;
  height: 32px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #ffffff;
  color: #64748b;
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

.manual-close-body {
  display: grid;
  gap: 10px;
}

.manual-close-target,
.manual-close-preview {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f8fafc;
}

.manual-close-target strong {
  color: #111827;
  font-size: 18px;
  font-weight: 950;
}

.manual-close-target em,
.manual-close-preview span {
  color: #475569;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.manual-close-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.manual-close-grid.compact {
  margin-top: 6px;
}

.manual-close-grid span {
  display: grid;
  min-width: 0;
  gap: 2px;
  padding: 8px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #ffffff;
}

.manual-close-grid strong {
  color: #111827;
  font-size: 13px;
  font-weight: 950;
  overflow-wrap: anywhere;
}

.manual-close-preview.ok {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.manual-close-preview.warn {
  border-color: #fde68a;
  background: #fffbeb;
}

.manual-close-preview.blocked {
  border-color: #fecaca;
  background: #fef2f2;
}

.manual-close-preview.loading {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.manual-close-preview > strong {
  color: #111827;
  font-size: 13px;
  font-weight: 950;
}

.manual-close-preview em {
  color: #991b1b;
  font-style: normal;
  font-size: 11px;
  font-weight: 850;
}

.manual-close-status {
  min-height: 15px;
  text-transform: none;
}

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

.position-close-pending td {
  background: #fff7ed;
}

@media (max-width: 640px) {
  .manual-close-dialog {
    align-items: end;
    padding: 10px;
  }

  .manual-close-panel {
    width: 100%;
    max-height: calc(100vh - 20px);
    padding: 13px;
  }

  .manual-close-grid {
    grid-template-columns: 1fr;
  }

  .manual-close-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .manual-close-actions .btn {
    width: 100%;
  }
}

body.is-route-loading .topbar::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  content: "";
  background: linear-gradient(90deg, #bfdbfe, #2563eb, #7c3aed, #bfdbfe);
  background-size: 220% 100%;
  animation: loader-progress 1.05s ease-in-out infinite;
}

.view-entering {
  animation: view-enter 180ms ease-out both;
}

.view-loading {
  position: relative;
}

.view-loading::before {
  position: absolute;
  inset: 0;
  z-index: 70;
  pointer-events: none;
  content: "";
  background: rgba(248, 250, 252, 0.45);
  opacity: 1;
  animation: loader-fade 140ms ease both;
}

.view-loading::after {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 71;
  max-width: min(360px, calc(100% - 28px));
  padding: 8px 11px 8px 32px;
  overflow: hidden;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
  color: #1e40af;
  content: attr(data-loading-message);
  font-size: 12px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.view-loading.active-view::after {
  animation: view-enter 160ms ease both;
}

.view-loading.active-view::before {
  border-radius: 10px;
}

.view-loading.active-view > * {
  transition: filter 160ms ease, opacity 160ms ease;
}

.view-loading.active-view > *:not(.global-loader) {
  filter: saturate(0.9);
}

.btn.is-loading,
.top-action.is-loading,
.activate-btn.is-loading,
.strategy-focus-mini.is-loading {
  position: relative;
  color: transparent !important;
}

.btn.is-loading::after,
.top-action.is-loading::after,
.activate-btn.is-loading::after,
.strategy-focus-mini.is-loading::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 14px;
  height: 14px;
  margin-top: -7px;
  margin-left: -7px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 999px;
  color: #2563eb;
  content: "";
  animation: loader-spin 760ms linear infinite;
}

.strategy-data-status.is-loading::before {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 8px;
  border: 2px solid #bfdbfe;
  border-top-color: #2563eb;
  border-radius: 999px;
  content: "";
  vertical-align: -1px;
  animation: loader-spin 760ms linear infinite;
}

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

@keyframes loader-progress {
  from { background-position: 220% 0; }
  to { background-position: 0 0; }
}

@keyframes loader-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes view-enter {
  from {
    opacity: 0.72;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .global-loader,
  .view-entering,
  .global-loader-spinner,
  .global-loader-progress,
  .strategy-data-status.is-loading::before,
  .btn.is-loading::after,
  .top-action.is-loading::after,
  .activate-btn.is-loading::after,
  .strategy-focus-mini.is-loading::after,
  body.is-route-loading .topbar::after {
    animation: none !important;
    transition: none !important;
  }
}

.tour-layer.hidden {
  display: none;
}

.tour-layer {
  position: fixed;
  inset: 0;
  z-index: 4800;
  pointer-events: none;
}

.tour-dimmer {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.34);
  pointer-events: auto;
}

.tour-highlight {
  position: fixed;
  border: 2px solid #2563eb;
  border-radius: 10px;
  background: rgba(37, 99, 235, 0.07);
  box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.34), 0 0 0 7px rgba(37, 99, 235, 0.16);
  transition: left 0.26s ease, top 0.26s ease, width 0.26s ease, height 0.26s ease;
  animation: tourPulse 1.35s ease-in-out infinite;
}

.tour-card {
  position: fixed;
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 18px 60px rgba(15, 23, 42, 0.24);
  pointer-events: auto;
  transition: left 0.24s ease, top 0.24s ease;
  max-height: min(78vh, 680px);
  overflow-y: auto;
}

.tour-step-kicker {
  color: #2563eb;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.45px;
  text-transform: uppercase;
}

.tour-card h2,
.tour-card p {
  margin: 0;
}

.tour-card h2 {
  color: #111827;
  font-size: 18px;
  line-height: 1.15;
}

.tour-card p {
  color: #475569;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.45;
}

.tour-checklist {
  display: grid;
  gap: 6px;
  margin: 2px 0 0;
  padding: 10px 12px 10px 28px;
  border: 1px solid #e0e7ff;
  border-radius: 8px;
  background: #f8fbff;
  color: #334155;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.tour-checklist:empty {
  display: none;
}

.tour-chapters {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding-top: 2px;
}

.tour-chapters button {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 8px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #ffffff;
  color: #111827;
  text-align: left;
  cursor: pointer;
}

.tour-chapters button.active {
  border-color: #2563eb;
  background: #eff6ff;
  box-shadow: inset 3px 0 0 #2563eb;
}

.tour-chapters strong {
  font-size: 12px;
  font-weight: 950;
  line-height: 1.2;
}

.tour-chapters span {
  color: #64748b;
  font-size: 10px;
  font-weight: 760;
  line-height: 1.25;
}

.tour-progress {
  display: flex;
  gap: 5px;
  min-width: 0;
}

.tour-progress button {
  flex: 1;
  min-width: 12px;
  height: 7px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #e5e7eb;
  cursor: pointer;
}

.tour-progress button.done {
  background: #93c5fd;
}

.tour-progress button.active {
  background: #2563eb;
}

@media (max-width: 640px) {
  .tour-card {
    left: 12px !important;
    right: 12px;
    width: auto !important;
    max-height: calc(100vh - 24px);
  }

  .tour-chapters {
    grid-template-columns: 1fr;
  }
}

.tour-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

@keyframes tourPulse {
  0%,
  100% {
    box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.34), 0 0 0 5px rgba(37, 99, 235, 0.13);
  }
  50% {
    box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.34), 0 0 0 9px rgba(37, 99, 235, 0.24);
  }
}

.dashboard-tooltip {
  position: fixed;
  z-index: 5000;
  width: min(420px, calc(100vw - 28px));
  padding: 12px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #0f172a;
  color: #f8fafc;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.24);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
  opacity: 0;
  pointer-events: none;
  transform: translateY(3px);
  transition: opacity 0.12s ease, transform 0.12s ease;
}

.dashboard-tooltip.visible {
  opacity: 1;
  transform: translateY(0);
}

.dashboard-tooltip::before {
  content: "";
  position: absolute;
  left: var(--tip-arrow-left, 22px);
  width: 10px;
  height: 10px;
  border-left: 1px solid #cbd5e1;
  border-top: 1px solid #cbd5e1;
  background: #0f172a;
  transform: rotate(45deg);
}

.dashboard-tooltip.placement-bottom::before {
  top: -6px;
}

.dashboard-tooltip.placement-top::before {
  bottom: -6px;
  transform: rotate(225deg);
}

a[data-tooltip],
button[data-tooltip] {
  cursor: pointer;
}

.toolbar-divider {
  width: 1px;
  height: 22px;
  margin: 0 4px;
  background: #e5e7eb;
}

.toolbar-hint {
  margin-left: auto;
  color: #9ca3af;
  font-size: 12px;
}

.container {
  width: min(1500px, calc(100% - 32px));
  min-width: 0;
  margin: 0 auto;
  padding: 18px 0 80px;
}

body[data-view="workspaceView"] .container {
  width: min(1700px, calc(100% - 24px));
  padding-top: 12px;
}

body[data-view="strategyDataView"] .container {
  width: min(1760px, calc(100% - 16px));
}

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

.stat-tile,
.panel,
.strategy-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.stat-tile {
  min-height: 88px;
  padding: 14px 16px;
}

.metric-label {
  margin-bottom: 5px;
  color: #6b7280;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.metric-value {
  color: #111827;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.1;
}

.metric-value small {
  display: block;
  margin-top: 4px;
  color: #6b7280;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.25;
}

.metric-value.positive {
  color: #059669;
}

.metric-value.negative {
  color: #dc2626;
}

.risk-stat-tile {
  position: relative;
  overflow: hidden;
}

.risk-stat-tile::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 5px;
  background: #22c55e;
}

.risk-stat-tile.has-risk {
  border-color: #fecaca;
  background: #fff7f7;
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.08);
}

.risk-stat-tile.has-risk::after {
  background: #dc2626;
}

.risk-stat-tile.has-managed-position {
  border-color: #bbf7d0;
  background: #f0fdf4;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.08);
}

.risk-stat-tile.has-managed-position::after {
  background: #22c55e;
}

.risk-command-bar {
  display: grid;
  gap: 10px;
  margin: 0 0 18px;
  padding: 12px 14px;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  background: #f0fdf4;
  box-shadow: 0 1px 8px rgba(15, 23, 42, 0.06);
}

body:not([data-view="controlView"]) .risk-command-bar {
  display: none;
}

.risk-command-bar.has-risk {
  border-color: #fecaca;
  background: #fff7f7;
}

.risk-command-bar.has-managed-position {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.risk-command-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.risk-command-head span {
  display: block;
  color: #64748b;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.risk-command-head strong {
  display: block;
  margin-top: 3px;
  color: #111827;
  font-size: 17px;
  font-weight: 950;
}

.risk-command-head em {
  display: block;
  margin-top: 3px;
  color: #64748b;
  font-size: 12px;
  font-style: normal;
  font-weight: 750;
}

.risk-command-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.control-section-label {
  margin: 8px 0 6px;
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.trade-journal {
  display: grid;
  gap: 16px;
}

.trade-snapshot-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  color: #64748b;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.trade-section {
  min-width: 0;
  padding: 14px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #ffffff;
}

.trade-section.external-broker-section {
  border-color: #facc15;
  background: #fffbeb;
}

.trade-section.screen-audit-section.ok {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.trade-section.screen-audit-section.warn {
  border-color: #facc15;
  background: #fffbeb;
}

.trade-section.screen-audit-section.critical {
  border-color: #fecaca;
  background: #fef2f2;
}

.screen-audit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 8px;
}

.screen-audit-item {
  min-width: 0;
  padding: 10px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.75);
}

.screen-audit-item.ok {
  border-color: #bbf7d0;
}

.screen-audit-item.warn {
  border-color: #facc15;
}

.screen-audit-item.critical {
  border-color: #fecaca;
}

.screen-audit-item span,
.screen-audit-item em,
.screen-audit-item strong {
  display: block;
  overflow-wrap: anywhere;
}

.screen-audit-item span {
  color: #64748b;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.screen-audit-item strong {
  margin-top: 2px;
  color: #111827;
  font-size: 14px;
  font-weight: 950;
}

.screen-audit-item em {
  margin-top: 4px;
  color: #475569;
  font-size: 12px;
  font-style: normal;
  font-weight: 750;
  line-height: 1.35;
}

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

.trade-operation {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border-left: 3px solid #cbd5e1;
  background: #f8fafc;
  font-size: 12px;
}

.trade-operation.audit-warn {
  border-left-color: #eab308;
  background: #fffbeb;
}

.trade-operation.audit-critical {
  border-left-color: #dc2626;
  background: #fef2f2;
}

.trade-operation.audit-ok {
  border-left-color: #16a34a;
  background: #f0fdf4;
}

.trade-operation span {
  min-width: 0;
  overflow-wrap: anywhere;
  font-weight: 750;
}

.trade-operation time {
  color: #64748b;
  white-space: nowrap;
}

.trade-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.trade-section-head span,
.trade-section-head em {
  display: block;
  color: #64748b;
  font-size: 12px;
  font-style: normal;
  font-weight: 850;
}

.trade-section-head strong {
  display: block;
  margin-top: 2px;
  color: #111827;
  font-size: 20px;
  font-weight: 950;
}

.trade-history-more {
  display: flex;
  justify-content: center;
  padding-top: 12px;
}

.trade-summary-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.trade-summary-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: -2px 0 12px;
  color: #475569;
  font-size: 12px;
  font-weight: 800;
}

.trade-summary-line span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 9px;
  border: 1px solid #e5e7eb;
  border-radius: 7px;
  background: #f8fafc;
  white-space: nowrap;
}

.trade-summary-line b {
  color: #111827;
}

.external-summary-line span {
  border-color: #fde68a;
  background: #fff7ed;
}

.value-tone {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  padding: 2px 7px;
  border-radius: 999px;
  color: #475569;
  font-weight: 900;
  line-height: 1.1;
}

.value-tone.positive {
  border: 1px solid #bbf7d0;
  background: #f0fdf4;
  color: #047857;
}

.value-tone.negative {
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}

.trade-table .positive {
  color: #047857;
}

.trade-table .negative {
  color: #b91c1c;
}

.trade-open-grid {
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
}

.trade-table {
  border-color: #e5e7eb;
}

.trade-table table.responsive-table th:first-child,
.trade-table table.responsive-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  min-width: 190px;
  background: #ffffff;
  box-shadow: 1px 0 0 #e5e7eb;
}

.trade-table table.responsive-table th:first-child {
  z-index: 3;
}

.external-broker-table {
  border-color: #fde68a;
  background: #fffbeb;
}

.external-broker-table table {
  min-width: 1260px;
}

.external-broker-table th,
.external-broker-table td {
  border-color: #fde68a;
}

.external-broker-row td {
  background: #fff7ed;
}

.external-broker-row td:first-child {
  background: #fff7ed;
}

.external-badge,
.external-reason {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid #fbbf24;
  background: #fef3c7;
  color: #92400e;
  font-size: 11px;
  font-weight: 950;
  line-height: 1.1;
  white-space: nowrap;
}

.external-badge {
  margin-left: 6px;
}

.trade-identity-cell {
  display: grid;
  min-width: 180px;
  gap: 3px;
  line-height: 1.15;
}

.trade-identity-cell.compact {
  min-width: 150px;
}

.trade-identity-cell strong {
  color: #111827;
  font-weight: 950;
}

.trade-identity-cell span {
  color: #475569;
  font-weight: 850;
}

.trade-identity-cell em {
  color: #64748b;
  font-size: 11px;
  font-style: normal;
  font-weight: 850;
}

.position-reconciliation-section {
  border-color: #c7d2fe;
  background: #f8fafc;
}

.position-reconciliation-table {
  border-color: #c7d2fe;
}

.position-reconciliation-table table {
  min-width: 1060px;
}

.reconciliation-account-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.reconciliation-account-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 6px 9px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #ffffff;
  color: #475569;
  font-size: 12px;
  font-weight: 850;
}

.reconciliation-account-chip.critical {
  border-color: #fecaca;
  background: #fef2f2;
}

.reconciliation-account-chip.warn {
  border-color: #fde68a;
  background: #fffbeb;
}

.reconciliation-account-chip.ok {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.reconciliation-account-chip small {
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
}

.reconciliation-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #475569;
  font-size: 11px;
  font-weight: 950;
  white-space: nowrap;
}

.reconciliation-badge.ok {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #047857;
}

.reconciliation-badge.warn {
  border-color: #fde68a;
  background: #fffbeb;
  color: #92400e;
}

.reconciliation-badge.critical {
  border-color: #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}

.risk-position-table {
  border-color: #bfdbfe;
  background: #ffffff;
}

.bot-risk-table table {
  min-width: 1320px;
}

.external-risk-table {
  border-color: #fde68a;
  background: #fffbeb;
}

.external-risk-table table {
  min-width: 1120px;
}

.external-risk-table th,
.external-risk-table td {
  border-color: #fde68a;
}

.external-risk-table td {
  background: #fffbeb;
}

.risk-reason-cell {
  display: block;
  min-width: 260px;
  max-width: 480px;
  white-space: normal;
  overflow-wrap: anywhere;
  color: #64748b;
  font-size: 11px;
  font-weight: 850;
  line-height: 1.25;
}

.trade-table td,
.trade-table th {
  white-space: nowrap;
}

.trade-audit-cell {
  display: inline-grid;
  gap: 2px;
  justify-items: start;
  text-align: left;
}

.trade-audit-cell b {
  font-weight: 900;
}

.trade-audit-cell small,
.trade-source-note {
  display: block;
  max-width: 180px;
  color: #64748b;
  font-size: 10px;
  font-weight: 850;
  line-height: 1.15;
  white-space: normal;
}

.trade-source-pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 950;
  line-height: 1.1;
  white-space: nowrap;
}

.trade-source-pill.broker {
  border: 1px solid #86efac;
  background: #dcfce7;
  color: #047857;
}

.trade-source-pill.runtime {
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #475569;
}

.trade-open-table table {
  min-width: 1680px;
}

.trade-open-table td,
.trade-open-table th {
  vertical-align: middle;
}

.trade-action-cell {
  display: inline-flex;
  min-width: 180px;
  flex-direction: column;
  gap: 6px;
  align-items: stretch;
}

.trade-action-cell.compact {
  min-width: 132px;
}

.close-fee-preview {
  display: grid;
  gap: 3px;
  color: #64748b;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.15;
}

.close-fee-preview small {
  display: block;
  white-space: nowrap;
}

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

.trade-action-cell.compact .btn {
  min-height: 32px;
}

.risk-empty-state {
  display: grid;
  gap: 5px;
  padding: 14px;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  background: #f0fdf4;
}

.risk-empty-state strong {
  color: #111827;
  font-size: 15px;
  font-weight: 950;
}

.risk-empty-state span {
  color: #64748b;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35;
}

.operator-info-map {
  display: none !important;
  gap: 10px;
  margin: 0 0 18px;
  padding: 12px;
  border: 1px solid #dbeafe;
  border-radius: 10px;
  background: #f8fbff;
}

.operator-info-head span {
  display: block;
  color: #2563eb;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.45px;
  text-transform: uppercase;
}

.operator-info-head strong {
  display: block;
  margin-top: 4px;
  color: #0f172a;
  font-size: 15px;
  font-weight: 950;
}

.operator-info-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.operator-info-card {
  display: grid;
  gap: 5px;
  min-height: 82px;
  padding: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #ffffff;
  text-decoration: none;
}

.operator-info-card.active {
  border-color: #60a5fa;
  box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.24);
}

.operator-info-card strong {
  color: #0f172a;
  font-size: 13px;
  font-weight: 950;
}

.operator-info-card span {
  color: #64748b;
  font-size: 11px;
  font-weight: 750;
  line-height: 1.35;
}

.strategy-command-center {
  display: none;
  gap: 12px;
  margin: 0 0 18px;
  padding: 14px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

body[data-view="overviewView"] .strategy-command-center,
body[data-view="workspaceView"] .strategy-command-center {
  display: grid;
}

body[data-view="overviewView"] #strategyGrid {
  display: none;
}

.strategy-command-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
}

.strategy-command-title span,
.strategy-command-section span {
  display: block;
  color: #64748b;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.45px;
  text-transform: uppercase;
}

.strategy-command-title strong {
  display: block;
  margin-top: 4px;
  color: #0f172a;
  font-size: 18px;
  font-weight: 950;
}

.strategy-command-title em {
  display: block;
  margin-top: 4px;
  color: #64748b;
  font-size: 12px;
  font-style: normal;
  font-weight: 750;
  line-height: 1.35;
}

.strategy-command-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 12px;
}

.strategy-fleet-stats {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.strategy-fleet-stat {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f8fafc;
}

.strategy-fleet-stat.positive {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.strategy-fleet-stat.warn {
  border-color: #fde68a;
  background: #fffbeb;
}

.strategy-fleet-stat.negative {
  border-color: #fecaca;
  background: #fff1f2;
}

.strategy-fleet-stat span {
  display: block;
  color: #64748b;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.45px;
  text-transform: uppercase;
}

.strategy-fleet-stat strong {
  display: block;
  margin-top: 5px;
  color: #0f172a;
  font-size: 16px;
  font-weight: 950;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.strategy-command-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 430px);
  gap: 12px;
  align-items: start;
  min-width: 0;
}

.strategy-fleet-registry {
  order: 1;
}

.strategy-selected-panel {
  order: 2;
}

.strategy-selected-panel,
.strategy-fleet-registry {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.strategy-panel-head,
.strategy-fleet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.strategy-panel-head span,
.strategy-fleet-head span {
  display: block;
  color: #64748b;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.45px;
  text-transform: uppercase;
}

.strategy-panel-head strong,
.strategy-fleet-head strong {
  display: block;
  margin-top: 4px;
  color: #0f172a;
  font-size: 14px;
  font-weight: 950;
}

.strategy-fleet-head em,
.strategy-fleet-head small {
  display: block;
  color: #64748b;
  font-size: 11px;
  font-style: normal;
  font-weight: 750;
  line-height: 1.35;
}

.strategy-fleet-head small {
  max-width: 360px;
  text-align: right;
}

.strategy-selected-panel .strategy-command-card {
  align-self: start;
}

.strategy-fleet-registry {
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 9px;
  background: #ffffff;
  box-shadow: 0 3px 16px rgba(15, 23, 42, 0.05);
}

.strategy-fleet-table {
  display: grid;
  gap: 5px;
  min-width: 0;
  max-height: 540px;
  overflow: auto;
  padding-right: 2px;
}

.strategy-fleet-row {
  display: grid;
  grid-template-columns:
    minmax(128px, 1.25fr)
    minmax(92px, 0.8fr)
    minmax(98px, 0.82fr)
    minmax(104px, 0.86fr)
    minmax(126px, 1.05fr)
    minmax(126px, 1.02fr)
    minmax(154px, 1.45fr);
  gap: 8px;
  align-items: stretch;
  min-width: 0;
  width: 100%;
  padding: 9px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #ffffff;
  color: #0f172a;
  text-align: left;
}

.strategy-fleet-row:hover {
  border-color: #bfdbfe;
  background: #f8fbff;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}

.strategy-fleet-row.selected {
  border-color: #2563eb;
  background: #eff6ff;
  box-shadow: inset 4px 0 0 #2563eb;
}

.strategy-fleet-row.has-risk {
  border-color: #fecaca;
  background: #fff7f7;
  box-shadow: inset 4px 0 0 #ef4444;
}

.strategy-fleet-row.has-managed-position {
  border-color: #bbf7d0;
  background: #f0fdf4;
  box-shadow: inset 4px 0 0 #22c55e;
}

.strategy-fleet-row.fleet-header {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 8px 10px;
  border-color: #dbeafe;
  background: #f8fafc;
  color: #64748b;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.35px;
  text-transform: uppercase;
  box-shadow: 0 6px 12px rgba(248, 250, 252, 0.96);
}

.strategy-fleet-cell {
  display: grid;
  align-content: start;
  gap: 3px;
  min-width: 0;
  color: #334155;
  font-size: 11px;
  font-weight: 750;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.fleet-focus-button {
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.fleet-focus-button:hover strong {
  color: #2563eb;
}

.strategy-fleet-cell strong {
  color: #0f172a;
  font-size: 12px;
  font-weight: 950;
  line-height: 1.25;
}

.strategy-fleet-cell em {
  color: #64748b;
  font-size: 10px;
  font-style: normal;
  font-weight: 750;
  line-height: 1.3;
}

.strategy-calculation-stamp {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 6px;
  max-width: 100%;
  color: #475569;
  font-size: 10px;
  font-weight: 850;
  line-height: 1.25;
}

.strategy-run-link {
  padding: 0;
  border: 0;
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.strategy-run-link:hover span,
.strategy-run-link:focus-visible span {
  color: #1d4ed8;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.strategy-run-link:focus-visible,
.inline-run-link:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.strategy-calculation-stamp b {
  color: #64748b;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.strategy-calculation-stamp span {
  color: #0f172a;
  font-weight: 950;
}

.strategy-calculation-stamp span small {
  margin-left: 5px;
  color: #64748b;
}

.strategy-calculation-stamp em {
  color: #64748b;
  font-size: 10px;
  font-style: normal;
  font-weight: 850;
}

.strategy-calculation-stamp.ready span {
  color: #047857;
}

.strategy-calculation-stamp.missing span {
  color: #92400e;
}

.strategy-fleet-cell.check-cell small {
  color: #475569;
  font-size: 10px;
  font-weight: 900;
  line-height: 1.25;
}

.inline-run-link {
  width: fit-content;
  margin-top: 4px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #2563eb;
  font-size: 10px;
  font-weight: 950;
  line-height: 1.2;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.inline-run-link:hover {
  color: #1d4ed8;
}

.strategy-command-head .strategy-calculation-stamp {
  width: fit-content;
  margin-top: 7px;
  padding: 6px 8px;
  border: 1px solid #bfdbfe;
  border-radius: 7px;
  background: #eff6ff;
}

.strategy-command-head .strategy-calculation-stamp.ready {
  border-color: #a7f3d0;
  background: #ecfdf5;
}

.strategy-command-head .strategy-calculation-stamp.missing {
  border-color: #fed7aa;
  background: #fff7ed;
}

.strategy-fleet-cell > .strategy-calculation-stamp {
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px solid #e5e7eb;
}

.strategy-fleet-cell.numeric strong,
.strategy-fleet-cell.risk-cell strong {
  font-size: 13px;
}

.strategy-name-cell .badge {
  max-width: 100%;
  width: max-content;
}

.strategy-name-cell strong {
  font-size: 13px;
}

.strategy-fleet-cell.positive strong,
.strategy-fleet-cell .positive,
.strategy-fleet-cell.risk-cell.positive strong {
  color: #059669;
}

.strategy-fleet-cell.warn strong,
.strategy-fleet-cell.task-setup strong,
.strategy-fleet-cell.task-paper strong {
  color: #92400e;
}

.strategy-fleet-cell.negative strong,
.strategy-fleet-cell.task-risk strong,
.strategy-fleet-cell.task-critical strong,
.strategy-fleet-cell.risk-cell.negative strong {
  color: #dc2626;
}

.strategy-fleet-cell.muted strong {
  color: #64748b;
}

.strategy-row-action-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.strategy-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 7px;
}

.strategy-row-actions .btn {
  width: fit-content;
  max-width: 100%;
}

.strategy-command-card {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 13px;
  border: 1px solid #e5e7eb;
  border-radius: 9px;
  background: #ffffff;
  box-shadow: 0 3px 16px rgba(15, 23, 42, 0.06);
}

.strategy-command-card.selected {
  border-color: #60a5fa;
  box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.18), 0 8px 24px rgba(15, 23, 42, 0.10);
}

.strategy-command-card.has-risk {
  border-color: #fecaca;
  background: #fffafa;
}

.strategy-command-card.has-managed-position {
  border-color: #bbf7d0;
  background: #fbfffd;
}

.strategy-command-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.strategy-command-head strong {
  display: block;
  margin-top: 5px;
  color: #111827;
  font-size: 17px;
  font-weight: 950;
}

.strategy-focus-mini {
  min-height: 30px;
  flex: 0 0 auto;
  padding: 0 10px;
  border: 1px solid #dbeafe;
  border-radius: 7px;
  background: #eff6ff;
  color: #1d4ed8;
  font: inherit;
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
}

.strategy-command-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.strategy-command-metrics .metric {
  min-height: 66px;
  padding: 10px;
  border-radius: 8px;
  background: #f8fafc;
}

.strategy-command-metrics .metric-value {
  font-size: 16px;
}

.strategy-command-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.strategy-command-section {
  display: grid;
  gap: 4px;
  min-height: 104px;
  padding: 10px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f8fafc;
}

.strategy-command-section.ok {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.strategy-command-section.warn,
.strategy-command-section.risk {
  border-color: #fde68a;
  background: #fffbeb;
}

.strategy-command-section.muted {
  border-color: #e5e7eb;
  background: #f8fafc;
}

.strategy-command-section strong {
  color: #0f172a;
  font-size: 14px;
  font-weight: 950;
}

.strategy-command-section em {
  display: block;
  color: #64748b;
  font-size: 11px;
  font-style: normal;
  font-weight: 750;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.strategy-live-launch-panel {
  display: grid;
  gap: 10px;
  padding: 11px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
}

.strategy-live-launch-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.strategy-live-launch-head span {
  display: block;
  color: #64748b;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.strategy-live-launch-head strong {
  display: block;
  margin-top: 3px;
  color: #0f172a;
  font-size: 15px;
  font-weight: 950;
}

.strategy-live-launch-panel p {
  margin: 0;
  color: #334155;
  font-size: 12px;
  font-weight: 760;
  line-height: 1.35;
}

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

.strategy-command-live-cta {
  display: flex;
  flex: 1 1 100%;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #f8fbff;
}

.strategy-command-live-cta.ok {
  border-color: #86efac;
  background: #f0fdf4;
}

.strategy-command-live-cta.warn,
.strategy-command-live-cta.paper {
  border-color: #fde68a;
  background: #fffbeb;
}

.strategy-command-live-cta div {
  min-width: 0;
}

.strategy-command-live-cta span {
  display: block;
  color: #64748b;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.strategy-command-live-cta strong {
  display: block;
  margin-top: 2px;
  color: #0f172a;
  font-size: 14px;
  font-weight: 950;
}

.strategy-command-live-cta em {
  display: block;
  margin-top: 3px;
  color: #475569;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
  line-height: 1.3;
}

.strategy-command-live-cta .btn {
  flex: 0 0 auto;
}

.strategy-command-risk {
  display: grid;
  gap: 8px;
}

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

.strategy-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.strategy-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 342px;
  padding: 18px 22px;
  overflow: hidden;
  transition: box-shadow 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.strategy-card:hover {
  border-color: #c4b5fd;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.10);
  transform: translateY(-1px);
}

.strategy-card.purple {
  border-color: #c4b5fd;
}

.strategy-card.amber {
  border-color: #fcd34d;
}

.strategy-card.green {
  border-color: #86efac;
}

.strategy-card.selected,
.strategy-state-card.selected,
.control-strategy.selected {
  border-color: #2563eb !important;
  box-shadow: 0 0 0 2px #bfdbfe, 0 8px 18px rgba(37, 99, 235, 0.10);
}

.strategy-card.purple::before {
  content: "PRODUCTION DEFAULT";
  position: absolute;
  top: 14px;
  right: 14px;
  max-width: 154px;
  padding: 5px 10px;
  border-radius: 999px;
  color: #ffffff;
  background: linear-gradient(135deg, #a855f7, #ec4899);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.badge {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  min-height: 22px;
  padding: 2px 8px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.35px;
  text-transform: uppercase;
}

.badge.amber {
  background: #fef3c7;
  color: #92400e;
}

.badge.green {
  background: #dcfce7;
  color: #15803d;
}

.badge.purple {
  background: #f3e8ff;
  color: #7c3aed;
}

.strategy-name {
  margin: 13px 0 7px;
  color: #111827;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.2;
}

.strategy-desc {
  min-height: 60px;
  margin: 0 0 14px;
  color: #4b5563;
  font-size: 13px;
  line-height: 1.55;
}

.metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.metric {
  min-height: 70px;
  padding: 12px 14px;
  border-radius: 9px;
  background: #f9fafb;
}

.metric .metric-value {
  font-size: 19px;
}

.card-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  gap: 8px;
  margin-top: auto;
}

.card-actions.compact-actions {
  grid-column: 1 / -1;
  margin-top: 0;
}

.live-mode-detail {
  min-height: 32px;
  margin: -2px 0 12px;
  color: #475569;
  font-size: 12px;
  line-height: 1.35;
}

.family-resume-panel,
.family-maintenance {
  display: grid;
  gap: 10px;
  margin: 4px 0 14px;
  padding: 12px;
  border: 1px solid #fecaca;
  border-radius: 8px;
  background: #fff7f7;
}

.family-resume-head {
  display: grid;
  gap: 4px;
}

.family-resume-head strong {
  color: #991b1b;
  font-size: 13px;
}

.family-resume-head span,
.family-maintenance span {
  color: #475569;
  font-size: 12px;
  line-height: 1.35;
}

.family-resume-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.family-resume-grid .metric {
  min-height: 58px;
  padding: 9px 10px;
}

.family-resume-grid .metric-value {
  font-size: 15px;
  word-break: break-word;
}

.family-checks {
  display: grid;
  gap: 7px;
  color: #334155;
  font-size: 12px;
}

.family-checks .ok {
  color: #047857;
  font-weight: 800;
}

.family-checks .warn {
  color: #b45309;
  font-weight: 800;
}

.family-checks label {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  line-height: 1.35;
}

.family-resume-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 8px;
}

.family-maintenance {
  border-color: #fed7aa;
  background: #fff7ed;
}

.family-maintenance strong {
  color: #9a3412;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.35px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font: inherit;
  font-size: 12.5px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.btn.primary {
  background: #1f2937;
  border-color: #1f2937;
  color: #ffffff;
}

.btn.secondary {
  background: #ffffff;
  color: #374151;
}

.btn.secondary:hover {
  background: #f3f4f6;
}

.btn.danger {
  border-color: #b91c1c;
  background: #b91c1c;
  color: #ffffff;
}

.two-column {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 20px;
  margin-bottom: 20px;
}

.panel {
  min-width: 0;
  margin-bottom: 20px;
  padding: 18px 22px;
}

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

.panel h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: #111827;
  font-size: 14px;
  font-weight: 700;
}

.text-link {
  color: #6b7280;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid #f3f4f6;
  border-radius: 8px;
}

.collapsible-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 8px 0 6px;
  padding: 6px 8px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f8fafc;
}

.collapsible-title {
  min-width: 0;
  overflow: hidden;
  color: #475569;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.collapsible-list-container {
  max-height: var(--collapsible-max-height, min(60vh, 640px));
  overflow: auto !important;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.collapsible-list-container.is-collapsed {
  max-height: 0 !important;
  min-height: 0 !important;
  overflow: hidden !important;
  border-color: transparent;
}

.table-wrap.collapsible-list-container {
  overflow: auto !important;
}

@media (max-width: 640px) {
  .collapsible-control {
    align-items: stretch;
    flex-direction: column;
  }

  .collapsible-control .btn {
    width: 100%;
  }

  .collapsible-list-container {
    max-height: var(--collapsible-max-height, min(58vh, 520px));
  }
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

th {
  position: sticky;
  top: 0;
  padding: 8px 10px;
  border-bottom: 1px solid #e5e7eb;
  background: #fafbfc;
  color: #6b7280;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-align: left;
  text-transform: uppercase;
}

.sort-header {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-align: left;
  text-transform: inherit;
  cursor: pointer;
}

.sort-header:hover,
.sort-header.active {
  color: #111827;
}

.sort-header span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
}

.sort-arrows {
  display: inline-grid;
  gap: 0;
  color: #cbd5e1;
  font-size: 10px;
  line-height: 0.75;
}

.sort-arrows i {
  display: block;
  font-style: normal;
}

.sort-arrows i.active {
  color: #111827;
}

td {
  padding: 8px 10px;
  border-bottom: 1px solid #f3f4f6;
  color: #374151;
  white-space: nowrap;
}

.strategy-records {
  display: grid;
  gap: 12px;
}

.records-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 8px;
}

.record-metric {
  display: grid;
  gap: 3px;
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f8fafc;
}

.record-metric span {
  color: #64748b;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.45px;
  text-transform: uppercase;
}

.record-metric strong {
  color: #111827;
  font-size: 16px;
  font-weight: 950;
}

.record-metric.positive strong {
  color: #047857;
}

.record-metric.negative strong {
  color: #b91c1c;
}

.records-help {
  padding: 10px 12px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #eff6ff;
  color: #1e3a8a;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
}

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

.strategy-record-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.42fr);
  gap: 14px;
  min-width: 0;
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-left-width: 4px;
  border-radius: 8px;
  background: #ffffff;
}

.record-card-main,
.record-card-stats,
.record-metric {
  min-width: 0;
}

.record-card-title,
.record-card-title strong,
.record-card-title em,
.record-card-main p,
.record-card-main code,
.record-metric strong {
  overflow-wrap: anywhere;
}

.strategy-record-card.positive {
  border-left-color: #10b981;
}

.strategy-record-card.negative {
  border-left-color: #ef4444;
}

.strategy-record-card.neutral {
  border-left-color: #94a3b8;
}

.record-card-main {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.record-card-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.record-card-title strong {
  color: #111827;
  font-size: 14px;
  font-weight: 950;
}

.record-card-title em {
  color: #64748b;
  font-size: 11px;
  font-style: normal;
  font-weight: 850;
}

.record-side {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  font-size: 11px;
  font-weight: 950;
}

.record-side.side-long {
  background: #dcfce7;
  color: #166534;
}

.record-side.side-short {
  background: #fee2e2;
  color: #991b1b;
}

.record-side.status-no_signal,
.record-side.status-entry_waiting {
  background: #f1f5f9;
  color: #475569;
}

.record-card-main p {
  margin: 0;
  color: #334155;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.45;
}

.record-card-main p b {
  color: #0f172a;
  font-weight: 950;
}

.record-explain {
  color: #64748b !important;
}

.record-raw {
  color: #64748b;
  font-size: 11px;
  font-weight: 750;
}

.record-raw summary {
  cursor: pointer;
}

.record-raw code {
  display: inline-block;
  margin-top: 5px;
  padding: 5px 7px;
  border-radius: 6px;
  background: #f8fafc;
  color: #475569;
}

.record-card-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.record-card-stats .record-metric {
  min-height: 52px;
  padding: 8px 10px;
}

.record-card-stats .record-metric strong {
  font-size: 14px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eef2ff;
  color: #4338ca;
  font-size: 11px;
  font-weight: 800;
}

.status-no_signal {
  background: #f3f4f6;
  color: #6b7280;
}

.status-opened,
.status-signal_detected,
.status-analytical_signal {
  background: #dcfce7;
  color: #15803d;
}

.status-skipped {
  background: #fef3c7;
  color: #92400e;
}

.status-entry_waiting {
  background: #e0f2fe;
  color: #0369a1;
}

.status-critical,
.status-error {
  background: #fee2e2;
  color: #b91c1c;
}

.status-pass {
  background: #dcfce7;
  color: #15803d;
}

.status-fail {
  background: #fee2e2;
  color: #b91c1c;
}

.status-warn {
  background: #fef3c7;
  color: #92400e;
}

.status-running,
.status-ok {
  background: #dcfce7;
  color: #15803d;
}

.state-block-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.state-block-grid.compact {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin: 14px 0;
}

.state-block {
  min-height: 128px;
  padding: 14px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #f9fafb;
}

.state-block-head {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #4b5563;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.45px;
  text-transform: uppercase;
}

.state-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 9px;
  border-radius: 50%;
  background: #9ca3af;
}

.state-ok .state-dot {
  background: #10b981;
}

.state-warn .state-dot {
  background: #f59e0b;
}

.state-error .state-dot {
  background: #ef4444;
}

.state-block-value {
  margin-top: 12px;
  color: #111827;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.25;
}

.state-block-detail {
  margin-top: 7px;
  color: #6b7280;
  font-size: 12px;
  line-height: 1.45;
}

.strategy-state-list {
  display: grid;
  gap: 16px;
}

.strategy-state-card {
  padding: 16px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #ffffff;
}

.strategy-state-card.purple {
  border-color: #c4b5fd;
}

.strategy-state-card.amber {
  border-color: #fcd34d;
}

.strategy-state-card.green {
  border-color: #86efac;
}

.strategy-state-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.state-explorer-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(260px, 0.9fr) minmax(170px, 0.45fr);
  gap: 10px;
  margin-bottom: 12px;
}

.state-summary-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.state-summary-strip {
  margin-bottom: 12px;
}

.state-focus-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 8px;
}

.state-explorer-layout {
  display: grid;
  grid-template-columns: minmax(250px, 0.35fr) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  min-width: 0;
}

.state-focus-panel,
.state-focus-card {
  min-width: 0;
}

.state-strategy-picker {
  display: grid;
  gap: 8px;
  max-height: 760px;
  overflow: auto;
  padding-right: 4px;
}

.state-strategy-option {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 9px;
  width: 100%;
  padding: 10px;
  border: 1px solid #e2e8f0;
  border-left: 4px solid #94a3b8;
  border-radius: 8px;
  background: #ffffff;
  color: #0f172a;
  text-align: left;
  cursor: pointer;
}

.state-strategy-option:hover,
.state-strategy-option.selected {
  border-color: #2563eb;
  border-left-color: #2563eb;
  background: #eff6ff;
}

.state-strategy-option.selected {
  box-shadow: inset 0 0 0 1px #2563eb;
}

.state-option-ok {
  border-left-color: #059669;
}

.state-option-warn {
  border-left-color: #d97706;
}

.state-option-critical {
  border-left-color: #dc2626;
}

.state-option-symbol {
  display: grid;
  align-items: center;
  justify-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #f8fafc;
  color: #334155;
  font-size: 11px;
  font-weight: 950;
}

.state-option-ok .state-option-symbol {
  background: #dcfce7;
  color: #047857;
}

.state-option-warn .state-option-symbol {
  background: #fef3c7;
  color: #92400e;
}

.state-option-critical .state-option-symbol {
  background: #fee2e2;
  color: #b91c1c;
}

.state-option-copy,
.state-option-meta {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.state-option-copy strong {
  overflow: hidden;
  color: #111827;
  font-size: 13px;
  font-weight: 950;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.state-option-copy em,
.state-option-meta small {
  overflow: hidden;
  color: #64748b;
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.state-option-meta {
  grid-column: 2;
}

.state-option-meta b {
  color: #334155;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.state-focus-card {
  display: grid;
  gap: 14px;
  min-width: 0;
  padding: 14px;
  border: 1px solid #dbeafe;
  border-left: 5px solid #2563eb;
  border-radius: 10px;
  background: #ffffff;
}

.state-focus-card.focus-ok {
  border-color: #bbf7d0;
  border-left-color: #059669;
}

.state-focus-card.focus-warn {
  border-color: #fde68a;
  border-left-color: #d97706;
}

.state-focus-card.focus-critical {
  border-color: #fecaca;
  border-left-color: #dc2626;
}

.state-focus-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.state-focus-head h3 {
  margin: 8px 0 0;
  color: #0f172a;
  font-size: 22px;
  line-height: 1.1;
}

.state-focus-head p {
  margin: 7px 0 0;
  color: #475569;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}

.state-calculation-pill {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 5px 8px;
  width: fit-content;
  max-width: 100%;
  margin-top: 8px;
  padding: 7px 9px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
  color: #1e3a8a;
  font-size: 11px;
  font-weight: 850;
  line-height: 1.2;
}

.state-calculation-pill.ready {
  border-color: #a7f3d0;
  background: #ecfdf5;
  color: #047857;
}

.state-calculation-pill.missing {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #9a3412;
}

.state-calculation-pill strong {
  color: inherit;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.state-calculation-pill span {
  color: #0f172a;
  font-size: 12px;
  font-weight: 950;
}

.state-calculation-pill span small {
  margin-left: 6px;
}

.state-calculation-pill small {
  color: #64748b;
  font-size: 10px;
  font-weight: 850;
}

.state-calculation-pill em {
  color: #475569;
  font-size: 10px;
  font-style: normal;
  font-weight: 850;
}

.state-focus-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.state-node-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}

.strategy-node-grid {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.state-node {
  --state-node-accent: #2563eb;
  --state-node-bg: #eff6ff;
  --state-node-border: #bfdbfe;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  min-height: 118px;
  padding: 12px;
  border: 1px solid var(--state-node-border);
  border-left: 4px solid var(--state-node-accent);
  border-radius: 8px;
  background: linear-gradient(90deg, var(--state-node-bg), #ffffff 42%);
}

.state-node-ok {
  --state-node-accent: #059669;
  --state-node-bg: #ecfdf5;
  --state-node-border: #a7f3d0;
}

.state-node-warn {
  --state-node-accent: #d97706;
  --state-node-bg: #fffbeb;
  --state-node-border: #fde68a;
}

.state-node-critical {
  --state-node-accent: #dc2626;
  --state-node-bg: #fef2f2;
  --state-node-border: #fecaca;
}

.state-node-symbol {
  display: grid;
  align-items: center;
  justify-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--state-node-border);
  border-radius: 8px;
  background: #ffffff;
  color: var(--state-node-accent);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.03em;
}

.state-node-body {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.state-node-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.state-node-head strong {
  min-width: 0;
  color: #0f172a;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.04em;
  line-height: 1.2;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.state-node-head span {
  flex: 0 0 auto;
  color: var(--state-node-accent);
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
}

.state-node-value {
  color: #111827;
  font-size: 15px;
  font-weight: 950;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.state-node p {
  margin: 0;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.state-section-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.state-ticker-section,
.state-table-section {
  min-width: 0;
}

.state-table-section {
  overflow: hidden;
}

.state-table-section .table-wrap {
  max-width: 100%;
  min-width: 0;
}

.state-table-section table {
  width: max-content;
}

.state-section-head strong,
.state-section-head span {
  color: #334155;
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.state-ticker-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  max-height: 420px;
  overflow: auto;
}

.state-ticker-node {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 10px;
  border: 1px solid #e2e8f0;
  border-left: 4px solid #94a3b8;
  border-radius: 8px;
  background: #f8fafc;
}

.state-ticker-node.ticker-ok {
  border-color: #bbf7d0;
  border-left-color: #059669;
  background: #f0fdf4;
}

.state-ticker-node.ticker-warn {
  border-color: #fde68a;
  border-left-color: #d97706;
  background: #fffbeb;
}

.state-ticker-node.ticker-critical {
  border-color: #fecaca;
  border-left-color: #dc2626;
  background: #fff7f7;
}

.state-ticker-head {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.state-ticker-head span {
  display: grid;
  align-items: center;
  justify-items: center;
  height: 24px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #334155;
  font-size: 10px;
  font-weight: 950;
}

.ticker-ok .state-ticker-head span {
  background: #dcfce7;
  color: #047857;
}

.ticker-warn .state-ticker-head span {
  background: #fef3c7;
  color: #92400e;
}

.ticker-critical .state-ticker-head span {
  background: #fee2e2;
  color: #b91c1c;
}

.state-ticker-head strong {
  overflow: hidden;
  color: #0f172a;
  font-size: 13px;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.state-ticker-head em {
  color: #64748b;
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
}

.state-ticker-node p {
  min-height: 30px;
  margin: 0;
  color: #334155;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
}

.state-ticker-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}

.state-ticker-metrics span {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 6px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.74);
  color: #64748b;
  font-size: 10px;
  font-weight: 900;
  line-height: 1.15;
  text-transform: uppercase;
}

.state-ticker-metrics b {
  overflow: hidden;
  color: #0f172a;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.state-scanner-table {
  min-width: 980px;
}

.state-reason-cell {
  display: inline-block;
  max-width: 420px;
  white-space: normal;
}

.decision-strip {
  margin-top: 12px;
  padding: 11px 13px;
  border-left: 4px solid #6366f1;
  border-radius: 8px;
  background: #eef2ff;
  color: #1f2937;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
}

body[data-view="controlView"] .container {
  width: min(1700px, calc(100% - 32px));
}

.control-monitor-grid,
.control-strategy-grid {
  display: grid;
  gap: 12px;
}

.control-monitor-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.control-strategy-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.operator-command-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 0;
}

.operator-pulse {
  display: grid;
  gap: 12px;
  margin: 0 0 12px;
  padding: 14px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #f8fbff;
}

.operator-pulse.pulse-ok {
  border-color: #bbf7d0;
  background: #f7fef9;
}

.operator-pulse.pulse-warn {
  border-color: #fde68a;
  background: #fffbeb;
}

.operator-pulse.pulse-critical,
.operator-pulse.pulse-error {
  border-color: #fecaca;
  background: #fff7f7;
}

.operator-pulse-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
}

.operator-pulse-main span,
.operator-pulse-meta span {
  display: block;
  color: #64748b;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.35px;
  text-transform: uppercase;
}

.operator-pulse-main strong {
  display: block;
  margin-top: 5px;
  color: #0f172a;
  font-size: 18px;
  font-weight: 900;
  line-height: 1.25;
}

.operator-pulse-main p {
  margin: 7px 0 0;
  color: #475569;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.45;
}

.operator-pulse-meta {
  min-width: 190px;
  padding: 10px 12px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  text-align: right;
}

.operator-pulse-meta strong,
.operator-pulse-meta em {
  display: block;
}

.operator-pulse-meta strong {
  margin-top: 5px;
  color: #111827;
  font-size: 15px;
  font-weight: 900;
}

.operator-pulse-meta em {
  margin-top: 4px;
  color: #64748b;
  font-size: 11px;
  font-style: normal;
  font-weight: 750;
}

.operator-pulse-facts {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.pulse-fact {
  min-height: 82px;
  padding: 10px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #ffffff;
}

.pulse-fact.fact-ok {
  border-color: #bbf7d0;
}

.pulse-fact.fact-warn {
  border-color: #fde68a;
}

.pulse-fact.fact-critical,
.pulse-fact.fact-error {
  border-color: #fecaca;
}

.pulse-fact span,
.pulse-fact strong,
.pulse-fact em {
  display: block;
}

.pulse-fact span {
  color: #64748b;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.pulse-fact strong {
  margin-top: 6px;
  color: #0f172a;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.3;
}

.pulse-fact em {
  margin-top: 5px;
  color: #64748b;
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
  line-height: 1.35;
}

.operator-card {
  min-height: 108px;
  padding: 13px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #ffffff;
}

.control-strategy-lens {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 14px;
}

.control-critical-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.32fr) minmax(360px, 0.68fr);
  gap: 20px;
}

.control-critical-grid .panel {
  min-width: 0;
}

.go-no-go-panel {
  margin-bottom: 12px;
}

.strategy-lens-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #ffffff;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.strategy-lens-btn:hover {
  border-color: #bfdbfe;
  background: #f8fbff;
}

.strategy-lens-btn.active {
  border-color: #2563eb;
  background: #eff6ff;
  box-shadow: inset 0 0 0 1px #bfdbfe;
}

.strategy-lens-btn strong,
.strategy-lens-btn em {
  display: block;
}

.strategy-lens-btn strong {
  color: #111827;
  font-size: 13px;
  font-weight: 900;
}

.strategy-lens-btn em {
  margin-left: auto;
  color: #64748b;
  font-size: 11px;
  font-style: normal;
  font-weight: 850;
  line-height: 1.25;
  text-align: right;
}

.live-listener {
  display: grid;
  gap: 10px;
  margin: 0 0 14px;
  padding: 14px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #f8fbff;
}

.control-market-panel .live-listener {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.live-listener-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.live-listener-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  align-items: center;
  max-width: 360px;
}

.live-listener-head strong,
.live-listener-head span {
  display: block;
}

.live-listener-head strong {
  color: #111827;
  font-size: 14px;
  font-weight: 850;
}

.live-listener-head span {
  margin-top: 3px;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.live-listener-actions .control-action-status {
  flex-basis: 100%;
  margin-top: 0;
  color: #64748b;
  font-size: 11px;
  line-height: 1.25;
  text-align: right;
}

.live-listener-actions .control-action-status.ok {
  color: #047857;
}

.live-listener-actions .control-action-status.warn {
  color: #b45309;
}

.live-listener-actions .control-action-status.error {
  color: #b91c1c;
}

#liveTapeCanvas {
  width: 100%;
  height: 170px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #ffffff;
}

.table-wrap.market-quality-wrap {
  overflow: visible;
  border: 0;
  border-radius: 0;
}

.market-quality-panel {
  display: grid;
  gap: 12px;
}

.market-quality-panel.compact {
  margin-top: 14px;
}

.market-quality-note {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #eff6ff;
  color: #1e3a8a;
  line-height: 1.35;
}

.market-quality-note strong {
  font-size: 13px;
  font-weight: 900;
}

.market-quality-note span {
  color: #475569;
  font-size: 12px;
  font-weight: 750;
}

.market-quality-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #fff;
}

.market-quality-table {
  width: 100%;
  min-width: 820px;
  border-collapse: separate;
  border-spacing: 0;
  color: #111827;
  font-size: 12px;
}

.market-quality-summary-table {
  min-width: 680px;
}

.market-quality-table th {
  padding: 10px 12px;
  border-bottom: 1px solid #dbeafe;
  background: #f8fbff;
  color: #64748b;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.2;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.market-quality-table td {
  padding: 10px 12px;
  border-top: 1px solid #e5e7eb;
  line-height: 1.35;
  vertical-align: top;
}

.market-quality-table tbody tr:first-child td {
  border-top: 0;
}

.market-quality-table tbody tr.ok td {
  background: #f0fdf4;
}

.market-quality-table tbody tr.warn td {
  background: #fffbeb;
}

.market-quality-table tbody tr.critical td {
  background: #fff1f2;
}

.market-quality-table tbody tr.ok:hover td {
  background: #e7f9ee;
}

.market-quality-table tbody tr.warn:hover td {
  background: #fef3c7;
}

.market-quality-table tbody tr.critical:hover td {
  background: #fee2e2;
}

.market-quality-table td strong,
.market-quality-table td b {
  display: block;
  color: #111827;
  font-size: 13px;
  font-weight: 950;
  line-height: 1.2;
}

.market-quality-table td span:not(.quality-pill) {
  display: block;
  margin-top: 3px;
  color: #64748b;
  font-size: 11px;
  font-weight: 750;
  line-height: 1.3;
}

.market-quality-table td:first-child strong {
  overflow-wrap: anywhere;
}

.market-quality-table td:nth-child(2) {
  width: 1%;
  white-space: nowrap;
}

.market-quality-table .empty-state {
  border: 0;
  background: transparent;
}

.quality-pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 950;
  line-height: 1.2;
  text-transform: uppercase;
}

.quality-pill.ok {
  background: #dcfce7;
  color: #047857;
}

.quality-pill.warn {
  background: #fef3c7;
  color: #92400e;
}

.quality-pill.critical {
  background: #fee2e2;
  color: #b91c1c;
}

.runtime-log {
  width: 100%;
}

.runtime-log-panel {
  display: grid;
  gap: 12px;
}

.runtime-log-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #f8fbff;
}

.runtime-log-toolbar > div,
.runtime-log-toolbar label {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.runtime-log-toolbar strong {
  color: #111827;
  font-size: 14px;
  font-weight: 950;
}

.runtime-log-toolbar span {
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.3;
}

.runtime-log-toolbar label {
  width: min(240px, 100%);
}

.runtime-log-toolbar select {
  width: 100%;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #ffffff;
  color: #111827;
  font-size: 13px;
  font-weight: 850;
}

.runtime-log-summary,
.runtime-run-metrics {
  display: grid;
  gap: 8px;
}

.runtime-log-summary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.runtime-run-metrics {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.runtime-run-metric {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 8px;
  border: 1px solid #eef2f7;
  border-radius: 7px;
  background: #f8fafc;
  overflow-wrap: anywhere;
}

.runtime-run-metric span {
  color: #64748b;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.04em;
  line-height: 1.2;
  text-transform: uppercase;
}

.runtime-run-metric strong {
  color: #111827;
  font-size: 15px;
  font-weight: 950;
  line-height: 1.15;
}

.runtime-run-metric.positive strong {
  color: #047857;
}

.runtime-run-metric.risk strong {
  color: #b91c1c;
}

.runtime-run-list {
  display: grid;
  gap: 10px;
  max-height: 520px;
  overflow-y: auto;
  padding-right: 4px;
}

.runtime-run-card {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #ffffff;
  overflow-wrap: anywhere;
}

.runtime-run-card.ok {
  border-color: #bbf7d0;
}

.runtime-run-card.error,
.runtime-run-card.critical {
  border-color: #fecaca;
  background: #fff7f7;
}

.runtime-run-card.legacy {
  border-color: #e5e7eb;
  background: #f9fafb;
}

.runtime-run-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.runtime-run-head > div:first-child {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 8px;
  min-width: 0;
  align-items: center;
}

.runtime-run-head strong {
  color: #111827;
  font-size: 14px;
  font-weight: 950;
}

.runtime-run-head em,
.runtime-run-side span,
.runtime-run-message,
.runtime-run-legacy {
  color: #64748b;
  font-size: 12px;
  font-style: normal;
  font-weight: 750;
  line-height: 1.35;
}

.runtime-run-head em {
  grid-column: 1 / -1;
}

.runtime-run-side {
  display: grid;
  gap: 3px;
  min-width: 72px;
  text-align: right;
}

.runtime-run-side strong {
  font-size: 16px;
}

.runtime-run-message,
.runtime-run-legacy {
  margin: 0;
}

.runtime-run-legacy {
  padding: 8px;
  border-radius: 7px;
  background: #f1f5f9;
}

.activity-feed-wrap,
.activity-feed {
  width: 100%;
}

.activity-feed {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.activity-summary-grid,
.activity-card-list,
.activity-card-metrics {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.activity-summary-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.activity-card-list {
  grid-template-columns: 1fr;
  max-height: 520px;
  overflow-y: auto;
  padding-right: 4px;
}

.activity-card {
  display: grid;
  grid-template-columns: minmax(140px, 180px) minmax(240px, 1fr) minmax(280px, 0.75fr);
  gap: 12px;
  align-items: center;
  min-width: 0;
  padding: 12px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #ffffff;
  overflow-wrap: anywhere;
}

.activity-card.positive {
  border-color: #86efac;
  background: #f0fdf4;
}

.activity-card.risk {
  border-color: #fecaca;
  background: #fff7f7;
}

.activity-card-head {
  display: grid;
  gap: 5px;
  align-items: start;
  min-width: 0;
}

.activity-card-head strong {
  color: #111827;
  font-size: 17px;
  font-weight: 950;
  line-height: 1.2;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
}

.activity-card-head em {
  color: #64748b;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
  line-height: 1.2;
  text-align: left;
  overflow-wrap: anywhere;
}

.activity-card-title,
.activity-card-note,
.activity-empty p {
  margin: 0;
  color: #475569;
  font-size: 12px;
  font-weight: 760;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.activity-card-title {
  color: #111827;
  font-weight: 950;
}

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

.activity-metric {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 8px;
  border: 1px solid #eef2f7;
  border-radius: 7px;
  background: rgba(248, 250, 252, 0.9);
  overflow-wrap: anywhere;
}

.activity-metric span {
  color: #64748b;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.04em;
  line-height: 1.2;
  text-transform: uppercase;
}

.activity-metric strong {
  color: #111827;
  font-size: 15px;
  font-weight: 950;
  line-height: 1.15;
  overflow-wrap: normal;
  word-break: normal;
}

.activity-metric.positive strong {
  color: #047857;
}

.activity-metric.risk strong {
  color: #b91c1c;
}

.activity-empty {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 14px;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
}

.activity-empty strong {
  color: #111827;
  font-size: 15px;
  font-weight: 950;
}

.scanner-coverage {
  width: 100%;
}

.scanner-coverage-panel {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.scanner-coverage-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding: 12px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #f8fbff;
}

.scanner-coverage-toolbar > div,
.scanner-coverage-toolbar label {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.scanner-coverage-toolbar strong {
  color: #111827;
  font-size: 14px;
  font-weight: 950;
  line-height: 1.2;
}

.scanner-coverage-toolbar span {
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.3;
}

.scanner-coverage-toolbar label {
  width: min(240px, 100%);
}

.scanner-coverage-toolbar select {
  width: 100%;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #ffffff;
  color: #111827;
  font-size: 13px;
  font-weight: 850;
}

.scanner-summary-grid,
.scanner-group-grid,
.scanner-decision-list {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.scanner-summary-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.scanner-group-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.scanner-decision-list {
  grid-template-columns: 1fr;
  max-height: 620px;
  overflow-y: auto;
  padding-right: 4px;
}

.scanner-metric {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 8px;
  border: 1px solid #eef2f7;
  border-radius: 7px;
  background: #f8fafc;
  overflow-wrap: anywhere;
}

.scanner-metric span {
  color: #64748b;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.04em;
  line-height: 1.2;
  text-transform: uppercase;
}

.scanner-metric strong {
  color: #111827;
  font-size: 15px;
  font-weight: 950;
  line-height: 1.15;
}

.scanner-metric.positive strong {
  color: #047857;
}

.scanner-group-card {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #ffffff;
  overflow-wrap: anywhere;
}

.scanner-decision-card {
  display: grid;
  grid-template-columns: minmax(128px, 170px) minmax(280px, 1fr) minmax(310px, 0.8fr);
  gap: 14px;
  align-items: center;
  min-width: 0;
  padding: 12px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #ffffff;
}

.scanner-group-card.ok,
.scanner-decision-card.neutral {
  border-color: #bfdbfe;
}

.scanner-group-card.positive,
.scanner-decision-card.positive {
  border-color: #86efac;
  background: #f0fdf4;
}

.scanner-group-card.warn,
.scanner-decision-card.warn {
  border-color: #fde68a;
  background: #fffbeb;
}

.scanner-group-head {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.scanner-group-head span {
  width: fit-content;
  max-width: 100%;
  padding: 4px 8px;
  border-radius: 6px;
  background: #eef2ff;
  color: #1e40af;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.03em;
  overflow-wrap: anywhere;
}

.scanner-group-head strong {
  color: #111827;
  font-size: 15px;
  font-weight: 950;
  line-height: 1.2;
}

.scanner-group-metrics,
.scanner-decision-metrics {
  display: grid;
  gap: 8px;
}

.scanner-group-metrics {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.scanner-decision-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.scanner-row-headline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  padding-top: 4px;
  color: #64748b;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.3;
}

.scanner-row-headline strong {
  color: #111827;
  font-size: 13px;
  font-weight: 950;
}

.scanner-decision-head {
  display: grid;
  gap: 5px;
  align-items: start;
  min-width: 0;
}

.scanner-decision-head strong {
  color: #111827;
  font-size: 17px;
  font-weight: 950;
  line-height: 1.2;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
}

.scanner-decision-head em {
  color: #64748b;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
  line-height: 1.2;
  text-align: left;
  overflow-wrap: anywhere;
}

.scanner-decision-body {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.scanner-decision-body strong {
  color: #111827;
  font-size: 13px;
  font-weight: 950;
  line-height: 1.25;
}

.scanner-decision-body p {
  margin: 0;
  color: #334155;
  font-size: 12px;
  font-weight: 760;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.scanner-decision-body b {
  color: #111827;
  font-weight: 950;
}

.scanner-anchor-summary {
  width: fit-content;
  max-width: 100%;
  padding: 4px 7px;
  border-radius: 6px;
  background: #eef2ff;
  color: #334155;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.scanner-decision-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  min-width: 0;
}

.scanner-inline-metric {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid #eef2f7;
  border-radius: 7px;
  background: rgba(248, 250, 252, 0.88);
}

.scanner-inline-metric b {
  color: #64748b;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.04em;
  line-height: 1.15;
  text-transform: uppercase;
}

.scanner-inline-metric strong {
  color: #111827;
  font-size: 14px;
  font-weight: 950;
  line-height: 1.15;
  white-space: nowrap;
}

@media (max-width: 1180px) {
  .activity-card,
  .scanner-decision-card {
    grid-template-columns: 1fr;
  }

  .activity-card-metrics,
  .scanner-decision-metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .activity-card-metrics,
  .scanner-decision-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 480px) {
  .activity-card-metrics,
  .scanner-decision-metrics {
    grid-template-columns: 1fr;
  }
}

.live-tape-legend,
.go-no-go-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.live-tape-pill,
.gate-pill {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  max-width: 100%;
  min-height: 28px;
  padding: 5px 8px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #ffffff;
  color: #334155;
  font-size: 11px;
  font-weight: 850;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.live-tape-pill i {
  width: 8px;
  height: 8px;
  border-radius: 999px;
}

.last-calculation,
.service-control {
  display: grid;
  gap: 12px;
  margin: 0 0 14px;
  padding: 14px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #ffffff;
}

.last-calculation-head,
.service-control-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.last-calculation-head strong,
.service-control-head strong {
  display: block;
  color: #111827;
  font-size: 14px;
  font-weight: 850;
}

.last-calculation-head span,
.service-control-head span {
  display: block;
  margin-top: 3px;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.calculation-narrative {
  padding: 12px;
  border-left: 4px solid #2563eb;
  border-radius: 8px;
  background: #eff6ff;
  color: #1e3a8a;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.45;
}

.calculation-flow {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.calc-step {
  min-height: 118px;
  padding: 11px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f8fafc;
}

.calc-step strong,
.calc-step span,
.calc-step em {
  display: block;
}

.calc-step strong {
  color: #111827;
  font-size: 12px;
  font-weight: 900;
}

.calc-step span {
  margin-top: 7px;
  color: #0f172a;
  font-size: 13px;
  font-weight: 850;
}

.calc-step em {
  margin-top: 6px;
  color: #64748b;
  font-size: 11px;
  font-style: normal;
  line-height: 1.35;
}

.calc-step-ok {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.calc-step-warn {
  border-color: #fde68a;
  background: #fffbeb;
}

.calc-step-error {
  border-color: #fecaca;
  background: #fef2f2;
}

.calculation-strategies {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.calculation-strategies.single {
  grid-template-columns: minmax(0, 1fr);
}

.calc-strategy {
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #ffffff;
}

.calc-strategy-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.calc-strategy-head strong {
  color: #111827;
  font-size: 13px;
}

.calc-strategy p {
  margin: 9px 0 10px;
  color: #475569;
  font-size: 12px;
  line-height: 1.4;
}

.calc-ticker-list {
  display: grid;
  gap: 6px;
}

.calc-ticker {
  display: grid;
  grid-template-columns: minmax(82px, 0.8fr) minmax(110px, 1.2fr);
  gap: 8px;
  padding: 7px;
  border: 1px solid #f1f5f9;
  border-radius: 7px;
  background: #f8fafc;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.calc-ticker:hover {
  border-color: #bfdbfe;
  background: #f8fbff;
}

.calc-ticker.active {
  border-color: #2563eb;
  background: #eff6ff;
}

.calc-ticker strong {
  color: #0f172a;
  font-size: 11px;
}

.calc-ticker span {
  color: #64748b;
  font-size: 11px;
  line-height: 1.3;
  overflow-wrap: anywhere;
  white-space: normal;
}

.service-control-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.service-action-card {
  display: grid;
  gap: 8px;
  min-height: 126px;
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f8fafc;
}

.service-action-card strong,
.service-action-card span {
  display: block;
}

.service-action-card strong {
  color: #111827;
  font-size: 13px;
}

.service-action-card span {
  color: #64748b;
  font-size: 11px;
  line-height: 1.35;
}

.streaming-status-panel {
  display: grid;
  gap: 10px;
  min-width: 0;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #f8fbff;
}

.streaming-status-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.streaming-status-head strong,
.streaming-status-head span {
  display: block;
}

.streaming-status-head strong {
  color: #111827;
  font-size: 13px;
  font-weight: 900;
}

.streaming-status-head span {
  margin-top: 3px;
  color: #64748b;
  font-size: 11px;
  font-weight: 750;
}

.streaming-status-metrics {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.streaming-status-metrics span {
  margin: 0;
  padding: 5px 8px;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  background: #ffffff;
  color: #334155;
  white-space: nowrap;
}

.streaming-feed-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
}

.streaming-feed-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #ffffff;
}

.streaming-feed-card.ok {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.streaming-feed-card.warn {
  border-color: #fde68a;
  background: #fffbeb;
}

.streaming-feed-card.critical {
  border-color: #fecaca;
  background: #fff1f2;
}

.streaming-feed-card span,
.streaming-feed-card strong,
.streaming-feed-card em,
.streaming-feed-card small {
  display: block;
}

.streaming-feed-card span {
  color: #64748b;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.streaming-feed-card strong {
  margin-top: 2px;
  color: #0f172a;
  font-size: 13px;
  font-weight: 950;
}

.streaming-feed-card b {
  color: #111827;
  font-size: 20px;
  font-weight: 950;
}

.streaming-feed-card em {
  grid-column: 1 / -1;
  color: #64748b;
  font-size: 11px;
  font-style: normal;
  font-weight: 750;
  line-height: 1.35;
}

.streaming-feed-card small {
  grid-column: 1 / -1;
  color: #475569;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.streaming-warning {
  padding: 8px 10px;
  border: 1px solid #fde68a;
  border-radius: 8px;
  background: #fffbeb;
  color: #92400e;
  font-size: 12px;
  font-weight: 850;
}

.streaming-table-wrap {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  contain: inline-size;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #ffffff;
}

.streaming-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

.streaming-table th,
.streaming-table td {
  padding: 9px 10px;
  border-bottom: 1px solid #f1f5f9;
  text-align: left;
  vertical-align: top;
}

.streaming-table th {
  background: #f8fafc;
  color: #64748b;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.streaming-table td {
  color: #0f172a;
  font-size: 12px;
  font-weight: 750;
}

.streaming-table td strong,
.streaming-table td span {
  display: block;
}

.streaming-table td span {
  margin-top: 2px;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.gate-pill.ok {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.gate-pill.blocked {
  border-color: #fecaca;
  background: #fff7f7;
  color: #991b1b;
}

.operator-card span,
.operator-card strong,
.operator-card em {
  display: block;
}

.operator-card span {
  color: #6b7280;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.operator-card strong {
  margin-top: 9px;
  color: #111827;
  font-size: 17px;
  font-weight: 850;
  line-height: 1.2;
}

.operator-card em {
  margin-top: 7px;
  color: #64748b;
  font-size: 11px;
  font-style: normal;
  line-height: 1.35;
}

.operator-action-btn {
  margin-top: 12px;
  width: 100%;
  justify-content: center;
}

.operator-ok {
  border-color: #bbf7d0;
  background: #f8fffb;
}

.operator-warn {
  border-color: #fde68a;
  background: #fffdf4;
}

.operator-critical,
.operator-error {
  border-color: #fecaca;
  background: #fff7f7;
}

.operator-columns {
  display: grid;
  grid-template-columns: minmax(360px, 0.95fr) minmax(320px, 0.75fr) minmax(320px, 0.75fr);
  gap: 20px;
}

.control-snapshot-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.execution-readiness,
.operator-results,
.operator-technical {
  display: grid;
  gap: 10px;
}

.credential-matrix {
  display: grid;
  gap: 6px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  contain: inline-size;
  margin-top: 12px;
}

.credential-matrix-head,
.credential-row {
  display: grid;
  grid-template-columns: minmax(72px, 0.8fr) minmax(82px, 1fr) minmax(82px, 1fr) minmax(98px, 1fr);
  gap: 8px;
  align-items: center;
}

.credential-matrix-head {
  color: #6b7280;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.35px;
  text-transform: uppercase;
}

.credential-row {
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #ffffff;
}

.credential-row strong {
  color: #111827;
  font-size: 12px;
}

.credential-row em {
  color: #64748b;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.credential-cell {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.credential-cell-stack {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.credential-cell-line {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
  min-width: 0;
}

.credential-dot {
  display: inline-flex;
  justify-content: center;
  width: fit-content;
  min-width: 58px;
  padding: 4px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.credential-dot.ready {
  background: #dcfce7;
  color: #166534;
}

.credential-dot.shared {
  background: #fef3c7;
  color: #92400e;
}

.credential-dot.missing {
  background: #fee2e2;
  color: #991b1b;
}

.credential-unlink-btn {
  min-height: 24px;
  padding: 3px 7px;
  border: 1px solid #fecaca;
  border-radius: 7px;
  background: #fff;
  color: #b91c1c;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

.credential-unlink-btn:hover {
  background: #fef2f2;
}

.credential-check-btn {
  min-height: 24px;
  padding: 3px 7px;
  border: 1px solid #bfdbfe;
  border-radius: 7px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

.credential-check-btn:hover {
  background: #dbeafe;
}

.credential-check-btn:disabled {
  cursor: wait;
  opacity: 0.72;
}

.credential-check-result {
  display: block;
  max-width: 260px;
  color: #64748b;
  font-size: 10px;
  font-weight: 850;
  line-height: 1.2;
  white-space: normal;
}

.credential-check-result.ok {
  color: #047857;
}

.credential-check-result.blocked {
  color: #b91c1c;
}

.credential-check-result.running {
  color: #1d4ed8;
}

.credential-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 12px;
}

.credential-input {
  width: 100%;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #ffffff;
  color: #111827;
  font: inherit;
  font-size: 13px;
}

.credential-input:focus {
  outline: none;
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.18);
}

.readiness-pill,
.technical-row,
.strategy-result-row,
.execution-guard-line {
  display: grid;
  gap: 4px;
  min-height: 62px;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f9fafb;
}

.readiness-pill.ready {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.readiness-pill.missing {
  border-color: #fde68a;
  background: #fffbeb;
}

.global-live-panel {
  display: grid;
  gap: 8px;
  min-height: 62px;
  padding: 12px;
  border: 1px solid #fde68a;
  border-radius: 8px;
  background: #fffbeb;
}

.global-live-panel.ok {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.global-live-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.global-live-head span,
.global-live-head strong,
.global-live-head em {
  display: block;
}

.global-live-head span {
  color: #6b7280;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.global-live-head strong {
  margin-top: 2px;
  color: #111827;
  font-size: 14px;
  font-weight: 950;
}

.global-live-head em {
  margin-top: 3px;
  color: #64748b;
  font-size: 11px;
  font-style: normal;
  font-weight: 750;
  line-height: 1.35;
}

.global-live-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.global-live-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.global-live-grid span,
.global-live-steps span {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  padding: 4px 7px;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 950;
  line-height: 1.15;
  white-space: normal;
}

.global-live-grid .ok,
.global-live-steps .ok {
  color: #047857;
  border-color: #bbf7d0;
  background: #ecfdf5;
}

.global-live-grid .blocked,
.global-live-steps .blocked {
  color: #b91c1c;
  border-color: #fecaca;
  background: #fff1f2;
}

.global-live-command {
  display: grid;
  gap: 7px;
  padding: 10px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #ffffff;
}

.global-live-command span,
.global-live-command strong {
  display: block;
}

.global-live-command span {
  color: #64748b;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.global-live-command strong {
  margin-top: 2px;
  color: #334155;
  font-size: 11px;
  font-weight: 750;
  line-height: 1.35;
}

.global-live-command code {
  display: block;
  overflow-x: auto;
  padding: 8px;
  border-radius: 6px;
  background: #0f172a;
  color: #e0f2fe;
  font-size: 11px;
  line-height: 1.45;
  white-space: nowrap;
}

.readiness-pill span,
.technical-row span,
.execution-guard-line span {
  color: #6b7280;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.35px;
  text-transform: uppercase;
}

.readiness-pill strong,
.technical-row strong,
.execution-guard-line strong {
  color: #111827;
  font-size: 13px;
  line-height: 1.25;
}

.readiness-pill em {
  overflow: hidden;
  color: #64748b;
  font-size: 11px;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.execution-guard-line {
  grid-template-columns: auto 1fr;
  align-items: center;
  min-height: 48px;
}

.result-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.operator-strategy-results {
  display: grid;
  gap: 8px;
}

.strategy-result-row {
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  align-items: center;
  min-height: 52px;
}

.strategy-result-row strong {
  color: #111827;
  font-size: 13px;
}

.strategy-result-row em,
.strategy-result-row span:last-child {
  color: #64748b;
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
}

.technical-row {
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  align-items: center;
  min-height: 46px;
}

.technical-ok {
  border-color: #bbf7d0;
  background: #f8fffb;
}

.technical-warn {
  border-color: #fde68a;
  background: #fffdf4;
}

.technical-critical,
.technical-error {
  border-color: #fecaca;
  background: #fff7f7;
}

.control-monitor,
.control-strategy,
.decision-card {
  min-width: 0;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #ffffff;
}

.control-monitor {
  min-height: 150px;
  padding: 14px;
}

.control-monitor-head,
.decision-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.control-monitor-head {
  align-items: center;
}

.control-monitor-head strong,
.control-strategy strong,
.decision-card-head strong {
  color: #111827;
  font-size: 13px;
  line-height: 1.25;
}

.control-monitor-head em {
  margin-left: auto;
  color: #6b7280;
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.control-monitor-value {
  margin-top: 14px;
  color: #111827;
  font-size: 17px;
  font-weight: 850;
  line-height: 1.25;
}

.control-monitor p,
.control-strategy p,
.decision-reason {
  margin: 8px 0 0;
  color: #6b7280;
  font-size: 12px;
  line-height: 1.45;
}

.monitor-ok {
  border-color: #bbf7d0;
  background: #f8fffb;
}

.monitor-warn {
  border-color: #fde68a;
  background: #fffdf4;
}

.monitor-critical,
.monitor-error {
  border-color: #fecaca;
  background: #fff7f7;
}

.monitor-ok .state-dot {
  background: #10b981;
}

.monitor-warn .state-dot {
  background: #f59e0b;
}

.monitor-critical .state-dot,
.monitor-error .state-dot {
  background: #ef4444;
}

.control-strategy {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  min-height: 176px;
  padding: 14px;
}

.control-strategy > div:first-child {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.control-strategy p,
.control-strategy .workspace-risk-grid {
  grid-column: 1 / -1;
}

.control-strategy.inactive {
  border-color: #fde68a;
  background: #fffbeb;
}

.decision-matrix {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.decision-card {
  padding: 14px;
}

.decision-card-head strong,
.decision-card-head span {
  display: block;
}

.decision-card-head span {
  margin-top: 3px;
  color: #6b7280;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.decision-reason {
  padding: 9px 10px;
  border-left: 3px solid #94a3b8;
  border-radius: 7px;
  background: #f8fafc;
  color: #334155;
  font-weight: 700;
}

.decision-matrix {
  display: block;
}

.decision-lens {
  display: grid;
  grid-template-columns: minmax(560px, 0.5fr) minmax(0, 1fr);
  align-items: start;
  gap: 14px;
}

.decision-ticker-rail {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
}

.decision-rail-title {
  padding: 11px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f8fafc;
}

.decision-rail-title strong,
.decision-rail-title span {
  display: block;
}

.decision-rail-title strong {
  color: #111827;
  font-size: 13px;
}

.decision-rail-title span {
  margin-top: 3px;
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
}

.decision-ticker-table {
  grid-column: 1 / -1;
  border-color: #bfdbfe;
  background: #ffffff;
}

.decision-grid-table {
  display: grid;
  width: 100%;
  min-width: 640px;
}

.decision-grid-head,
.decision-ticker-row {
  display: grid;
  grid-template-columns: minmax(92px, 0.85fr) 56px minmax(96px, 0.8fr) minmax(190px, 1.35fr) minmax(112px, 0.85fr);
  align-items: stretch;
}

.decision-grid-head {
  border-bottom: 1px solid #e5e7eb;
  background: #f8fafc;
}

.decision-grid-head span {
  padding: 8px 10px;
  color: #64748b;
  font-size: 10.5px;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

.decision-ticker-row {
  width: 100%;
  border: 0;
  border-top: 1px solid #eef2f7;
  background: #ffffff;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.decision-ticker-row:first-of-type {
  border-top: 0;
}

.decision-ticker-row:hover {
  background: #f8fbff;
}

.decision-ticker-row.active {
  background: #eff6ff;
  box-shadow: inset 0 1px 0 #93c5fd, inset 0 -1px 0 #93c5fd;
}

.decision-ticker-row.active > span:first-child {
  box-shadow: inset 3px 0 0 #2563eb, inset 0 1px 0 #93c5fd, inset 0 -1px 0 #93c5fd;
}

.decision-ticker-row.decision-signal {
  background: #f0fdf4;
}

.decision-ticker-row > span {
  display: flex;
  min-width: 0;
  align-items: center;
  padding: 10px;
  overflow: hidden;
}

.decision-ticker-row strong {
  color: #111827;
  font-size: 12px;
  font-weight: 950;
}

.decision-ticker-main,
.decision-price-cell {
  display: grid !important;
  align-content: center;
  gap: 3px;
}

.decision-ticker-main small,
.decision-price-cell small,
.decision-branch-cell small {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: #64748b;
  font-size: 10px;
  font-weight: 850;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.decision-row-status .status-pill {
  max-width: 100%;
  white-space: normal;
}

.decision-branch-cell {
  display: grid;
  align-content: center;
  gap: 3px;
  min-width: 0;
  max-width: 100%;
  color: #475569;
  font-size: 11px;
  font-weight: 850;
  line-height: 1.22;
}

.decision-branch-cell strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.decision-price-cell strong {
  font-variant-numeric: tabular-nums;
}

.decision-detail {
  min-width: 0;
  padding: 14px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #ffffff;
}

.decision-branch-table {
  margin-top: 12px;
  border-color: #fecaca;
}

.decision-branch-table table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

.decision-branch-table th,
.decision-branch-table td {
  min-width: 0;
  vertical-align: top;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
}

.decision-branch-table th:nth-child(1),
.decision-branch-table td:nth-child(1) {
  width: 58px;
}

.decision-branch-table th:nth-child(2),
.decision-branch-table td:nth-child(2) {
  width: 17%;
}

.decision-branch-table th:nth-child(3),
.decision-branch-table td:nth-child(3) {
  width: 30%;
}

.decision-branch-table th:nth-child(4),
.decision-branch-table td:nth-child(4) {
  width: 32%;
}

.decision-branch-table th:nth-child(5),
.decision-branch-table td:nth-child(5) {
  width: 21%;
}

.decision-branch-row td {
  background: #fff7f7;
}

.decision-branch-row.branch-pass td {
  background: #f0fdf4;
}

.decision-branch-row.branch-disabled td {
  background: #f8fafc;
  opacity: 0.8;
}

.decision-branch-row td:first-child span {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #fee2e2;
  color: #b91c1c;
  font-size: 11px;
  font-weight: 950;
}

.decision-branch-row.branch-pass td:first-child span {
  background: #dcfce7;
  color: #047857;
}

.decision-branch-row.branch-disabled td:first-child span {
  background: #e5e7eb;
  color: #64748b;
}

.decision-branch-row strong,
.decision-branch-row small {
  display: block;
  white-space: normal;
  overflow-wrap: anywhere;
}

.decision-branch-row strong {
  color: #111827;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.25;
}

.decision-branch-row small {
  margin-top: 3px;
  color: #64748b;
  font-size: 10.5px;
  font-weight: 800;
  line-height: 1.25;
}

.decision-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.decision-detail-head strong,
.decision-detail-head span {
  display: block;
}

.decision-detail-head strong {
  color: #111827;
  font-size: 16px;
  font-weight: 900;
}

.decision-detail-head span {
  margin-top: 4px;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.decision-price-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.decision-price-tile {
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #f8fbff;
}

.decision-price-tile span,
.decision-price-tile strong,
.decision-price-tile em {
  display: block;
}

.decision-price-tile span {
  color: #64748b;
  font-size: 10.5px;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

.decision-price-tile strong {
  margin-top: 5px;
  overflow-wrap: anywhere;
  color: #0f172a;
  font-size: 17px;
  font-weight: 950;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.decision-price-tile em {
  margin-top: 5px;
  color: #64748b;
  font-size: 10.5px;
  font-style: normal;
  font-weight: 800;
  line-height: 1.2;
}

.decision-explain {
  margin-top: 12px;
  padding: 12px;
  border-left: 4px solid #2563eb;
  border-radius: 8px;
  background: #eff6ff;
}

.decision-explain strong,
.decision-explain span {
  display: block;
}

.decision-explain strong {
  color: #1e3a8a;
  font-size: 13px;
  font-weight: 900;
}

.decision-explain span {
  margin-top: 5px;
  color: #334155;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.4;
}

.execution-outcome {
  display: grid;
  gap: 5px;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
}

.execution-outcome strong {
  color: #0f172a;
  font-size: 12px;
  font-weight: 950;
}

.execution-outcome span {
  color: #475569;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.4;
}

.execution-outcome.ok {
  border-color: #86efac;
  background: #f0fdf4;
}

.execution-outcome.ok strong {
  color: #166534;
}

.execution-outcome.warn {
  border-color: #fde68a;
  background: #fffbeb;
}

.execution-outcome.warn strong {
  color: #92400e;
}

.execution-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 4px;
}

.execution-detail-item {
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.72);
}

.execution-detail-item span,
.execution-detail-item strong {
  display: block;
}

.execution-detail-item span {
  color: #64748b;
  font-size: 10px;
  font-weight: 900;
  line-height: 1.15;
  text-transform: uppercase;
}

.execution-detail-item strong {
  margin-top: 3px;
  overflow-wrap: anywhere;
  color: #0f172a;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.2;
}

.decision-glossary {
  margin-top: 12px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #f8fbff;
  overflow: hidden;
}

.decision-glossary summary {
  cursor: pointer;
  padding: 11px 12px;
  color: #0f172a;
  font-size: 12px;
  font-weight: 950;
  list-style-position: inside;
}

.decision-glossary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
  padding: 0 12px 12px;
}

.decision-glossary-grid span {
  color: #475569;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
}

.decision-glossary-grid b {
  color: #1d4ed8;
  font-weight: 950;
}

.decision-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.strategy-data-view {
  display: grid;
  gap: 16px;
}

.strategy-data-head {
  align-items: center;
}

.strategy-data-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.strategy-data-control {
  display: grid;
  min-width: 150px;
  gap: 4px;
}

.strategy-data-control span {
  color: #64748b;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .04em;
  line-height: 1;
  text-transform: uppercase;
}

.strategy-data-control .select {
  width: 100%;
}

.strategy-data-control.anchor-control {
  min-width: 142px;
}

.strategy-data-control.compact-control {
  min-width: 132px;
}

.strategy-data-control.tiny-control {
  min-width: 92px;
}

.segmented {
  display: inline-flex;
  min-height: 34px;
  overflow: hidden;
  border: 1px solid #dbe3ee;
  border-radius: 8px;
  background: #f8fafc;
}

.segmented button {
  min-width: 112px;
  padding: 0 12px;
  border: 0;
  border-right: 1px solid #dbe3ee;
  background: transparent;
  color: #475569;
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.segmented button:last-child {
  border-right: 0;
}

.segmented button.active {
  background: #111827;
  color: #ffffff;
}

.strategy-data-status {
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f8fafc;
  color: #475569;
  font-size: 12px;
  font-weight: 850;
}

.strategy-data-status.error {
  border-color: #fecaca;
  background: #fff1f2;
  color: #991b1b;
}

.strategy-data-error-state {
  display: grid;
  align-content: start;
  gap: 12px;
  min-height: 320px;
  padding: 18px;
  border-top: 1px solid #e5e7eb;
  background: #fff7f7;
}

.strategy-data-error-state strong {
  color: #991b1b;
  font-size: 16px;
  font-weight: 950;
}

.strategy-data-error-state p {
  max-width: 760px;
  margin: 0;
  color: #475569;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.45;
}

.strategy-data-error-state code {
  width: fit-content;
  max-width: 100%;
  padding: 7px 9px;
  border: 1px solid #fecaca;
  border-radius: 7px;
  background: #ffffff;
  color: #7f1d1d;
  font-size: 12px;
  overflow-wrap: anywhere;
}

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

.strategy-data-grid {
  display: grid;
  grid-template-columns: minmax(720px, 1fr) minmax(340px, 420px);
  gap: 14px;
  align-items: start;
}

.strategy-chart-shell {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #ffffff;
}

.strategy-chart-shell.is-error .chart-toolbar,
.strategy-chart-shell.is-error canvas {
  display: none;
}

.strategy-chart-shell canvas {
  cursor: grab;
  outline: none;
}

.strategy-chart-shell canvas:active {
  cursor: grabbing;
}

.strategy-chart-shell canvas:focus-visible {
  box-shadow: inset 0 0 0 2px rgba(37, 99, 235, 0.3);
}

.strategy-data-view.chart-wide-mode .strategy-data-grid {
  grid-template-columns: minmax(0, 1fr);
}

.strategy-data-view.chart-wide-mode .candle-inspector {
  display: none;
}

.strategy-data-view.chart-wide-mode #strategyPriceCanvas {
  height: 520px;
}

.strategy-data-view.chart-wide-mode #strategyIndicatorCanvas {
  height: 180px;
}

.chart-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid #edf2f7;
}

.chart-topbar strong,
.chart-topbar span {
  display: block;
}

.chart-topbar strong {
  color: #111827;
  font-size: 14px;
  font-weight: 950;
}

.chart-topbar span {
  margin-top: 3px;
  color: #64748b;
  font-size: 12px;
  font-weight: 750;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px 10px;
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 0;
  color: #475569;
  font-size: 11px;
  font-weight: 850;
}

.chart-legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.chart-toolbar {
  display: grid;
  grid-template-columns: minmax(190px, 0.45fr) minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid #edf2f7;
  background: #f8fafc;
}

.chart-toolbar strong,
.chart-toolbar span {
  display: block;
}

.chart-toolbar strong {
  color: #111827;
  font-size: 12px;
  font-weight: 950;
}

.chart-toolbar span {
  margin-top: 3px;
  color: #64748b;
  font-size: 11px;
  font-weight: 750;
}

.chart-actions {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.chart-range-control {
  display: grid;
  grid-template-columns: 34px minmax(160px, 1fr) 34px 34px 34px;
  gap: 7px;
  align-items: center;
}

.chart-actions input[type="range"],
.chart-range-control input[type="range"] {
  width: 100%;
  accent-color: #2563eb;
}

.chart-presets {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.chart-presets .btn {
  min-width: 44px;
  padding-inline: 10px;
}

.chart-presets .btn.active {
  border-color: #2563eb;
  background: #eff6ff;
  color: #1d4ed8;
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.14);
}

#strategyPriceCanvas,
#strategyIndicatorCanvas {
  display: block;
  width: 100%;
  background: #ffffff;
  cursor: grab;
  touch-action: none;
}

#strategyPriceCanvas {
  height: 640px;
}

#strategyIndicatorCanvas {
  height: 190px;
  border-top: 1px solid #edf2f7;
}

#equityCanvas {
  display: block;
  width: 100%;
  height: 220px;
}

.strategy-decision-strip {
  display: grid;
  grid-template-columns: minmax(150px, 0.24fr) minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-top: 1px solid #edf2f7;
  background: #f8fafc;
}

.strategy-decision-strip strong,
.strategy-decision-strip span {
  display: block;
}

.strategy-decision-strip strong {
  color: #111827;
  font-size: 12px;
  font-weight: 950;
}

.strategy-decision-strip > div > span {
  margin-top: 2px;
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
}

.decision-strip-branches {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.decision-strip-branches span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  color: #475569;
  font-size: 10px;
  font-weight: 950;
  white-space: nowrap;
}

.decision-strip-branches .pass {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #15803d;
}

.decision-strip-branches .fail {
  border-color: #fecaca;
  background: #fff1f2;
  color: #b91c1c;
}

.decision-strip-branches .off {
  border-color: #e5e7eb;
  background: #f1f5f9;
  color: #64748b;
}

.candle-inspector {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #ffffff;
}

.inspector-head {
  padding: 12px;
  border-bottom: 1px solid #edf2f7;
}

.inspector-head span,
.inspector-head strong {
  display: block;
}

.inspector-head span {
  color: #64748b;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.inspector-head strong {
  margin-top: 4px;
  color: #111827;
  font-size: 14px;
  font-weight: 950;
}

.inspector-body {
  display: grid;
  gap: 12px;
  padding: 12px;
}

.inspector-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(126px, 1fr));
  gap: 8px;
}

.candle-inspector .metric {
  min-height: 0;
  padding: 10px 12px;
}

.candle-inspector .metric-label,
.candle-inspector .metric-value,
.trigger-policy .metric-label,
.trigger-policy .metric-value {
  overflow-wrap: anywhere;
}

.candle-inspector .metric .metric-value {
  font-size: 18px;
}

.anchor-vote-panel {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
}

.anchor-vote-panel strong {
  color: #1e3a8a;
  font-size: 12px;
  font-weight: 950;
}

.anchor-vote-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.anchor-vote {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid #bbf7d0;
  border-radius: 999px;
  background: #f0fdf4;
  color: #047857;
  font-size: 11px;
  font-weight: 900;
}

.anchor-vote.short {
  border-color: #fecaca;
  background: #fef2f2;
  color: #be123c;
}

.anchor-vote.neutral {
  border-color: #ddd6fe;
  background: #f5f3ff;
  color: #6d28d9;
}

.anchor-snapshot-panel {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #f8fbff;
}

.anchor-snapshot-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}

.anchor-snapshot-head strong,
.anchor-snapshot-head span,
.anchor-snapshot-summary b {
  display: block;
}

.anchor-snapshot-head strong {
  color: #1e3a8a;
  font-size: 12px;
  font-weight: 950;
}

.anchor-snapshot-head span {
  margin-top: 3px;
  color: #475569;
  font-size: 11px;
  font-weight: 750;
}

.anchor-snapshot-summary {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.anchor-snapshot-summary b {
  min-height: 22px;
  padding: 4px 7px;
  border: 1px solid #dbeafe;
  border-radius: 999px;
  background: #ffffff;
  color: #1e40af;
  font-size: 10px;
  font-weight: 950;
  white-space: nowrap;
}

.anchor-snapshot-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.anchor-snapshot-cell {
  display: grid;
  gap: 5px;
  min-height: 92px;
  padding: 8px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #ffffff;
}

.anchor-snapshot-cell > div {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  align-items: center;
}

.anchor-snapshot-cell strong {
  color: #111827;
  font-size: 12px;
  font-weight: 950;
}

.anchor-snapshot-cell span {
  padding: 2px 6px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-size: 10px;
  font-weight: 950;
  white-space: nowrap;
}

.anchor-snapshot-cell em,
.anchor-snapshot-cell small {
  display: block;
  color: #64748b;
  font-size: 10px;
  font-style: normal;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.anchor-snapshot-cell small {
  color: #334155;
}

.anchor-snapshot-cell.long {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.anchor-snapshot-cell.long span {
  background: #dcfce7;
  color: #15803d;
}

.anchor-snapshot-cell.short {
  border-color: #fecaca;
  background: #fef2f2;
}

.anchor-snapshot-cell.short span {
  background: #fee2e2;
  color: #be123c;
}

.anchor-snapshot-cell.trend {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.anchor-snapshot-cell.range {
  border-color: #fed7aa;
  background: #fff7ed;
}

.anchor-snapshot-cell.missing {
  border-style: dashed;
  background: #f8fafc;
  opacity: 0.75;
}

.branch-list.compact .branch-row {
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: start;
}

.branch-list.compact .branch-row .branch-name,
.branch-list.compact .branch-row em,
.branch-list.compact .branch-row p {
  grid-column: 2;
}

.branch-list.compact .branch-row span {
  grid-column: 1;
  grid-row: 1 / 4;
}

.strategy-data-lower {
  display: grid;
  grid-template-columns: minmax(420px, 0.48fr) minmax(0, 1fr);
  gap: 16px;
}

.trigger-list {
  display: grid;
  gap: 12px;
}

.trigger-policy {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.trigger-group {
  display: grid;
  gap: 7px;
  padding: 11px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #ffffff;
}

.trigger-group > strong {
  color: #111827;
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.trigger-row {
  display: grid;
  gap: 3px;
  padding: 8px;
  border-radius: 7px;
  background: #f8fafc;
}

.trigger-row span {
  color: #111827;
  font-size: 12px;
  font-weight: 900;
}

.trigger-row em {
  color: #64748b;
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
  line-height: 1.4;
}

.branch-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.branch-row {
  display: grid;
  grid-template-columns: 48px minmax(180px, 0.78fr) minmax(170px, 0.62fr) minmax(0, 1.35fr);
  gap: 10px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f8fafc;
}

.branch-row span {
  justify-self: start;
  padding: 3px 7px;
  border-radius: 999px;
  background: #e5e7eb;
  color: #475569;
  font-size: 10px;
  font-weight: 900;
}

.branch-name {
  min-width: 0;
}

.branch-name strong,
.branch-name small,
.branch-row p strong,
.branch-row p small {
  display: block;
}

.branch-name strong {
  color: #111827;
  font-size: 12px;
  line-height: 1.25;
}

.branch-name small {
  margin-top: 3px;
  color: #94a3b8;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.25;
}

.branch-row em {
  color: #64748b;
  font-size: 11px;
  font-style: normal;
  font-weight: 850;
}

.branch-row p {
  min-width: 0;
  margin: 0;
  color: #475569;
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.branch-row p strong {
  color: #334155;
  font-size: 12px;
  font-weight: 760;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.branch-row p small {
  margin-top: 3px;
  color: #94a3b8;
  font-size: 10px;
  font-weight: 750;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.branch-row.branch-pass {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.branch-row.branch-pass span {
  background: #dcfce7;
  color: #166534;
}

.branch-row.branch-fail {
  border-color: #fecaca;
  background: #fff7f7;
}

.branch-row.branch-fail span {
  background: #fee2e2;
  color: #991b1b;
}

.branch-row.branch-disabled {
  opacity: 0.72;
}

.btn.compact {
  min-height: 28px;
  padding: 0 10px;
}

.workspace-view {
  min-height: calc(100vh - 132px);
}

.workspace-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

body[data-view="workspaceView"] .workspace-switcher {
  display: none;
}

body[data-view="workspaceView"] .workspace-health {
  display: none;
}

.workspace-switcher,
.workspace-health {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 52px;
  overflow-x: auto;
  padding: 8px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 1px 8px rgba(17, 24, 39, 0.05);
}

.workspace-switcher {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(150px, 0.7fr);
  align-content: stretch;
  overflow-x: hidden;
}

.workspace-focus-picker,
.workspace-focus-card {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.workspace-focus-picker label {
  overflow: hidden;
  color: #64748b;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-focus-card {
  align-content: center;
  padding-left: 10px;
  border-left: 1px solid #dbeafe;
}

.workspace-focus-card strong,
.workspace-focus-card em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-focus-card strong {
  color: #111827;
  font-size: 13px;
  font-weight: 950;
}

.workspace-focus-card em {
  color: #6b7280;
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.workspace-switch,
.workspace-health-pill {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 8px;
  min-height: 34px;
  border-radius: 7px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  color: #374151;
  font: inherit;
  cursor: pointer;
}

.workspace-switch {
  padding: 5px 10px;
}

.workspace-switch.active {
  border-color: #60a5fa;
  box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.18);
}

.workspace-switch strong {
  color: #111827;
  font-size: 13px;
}

.workspace-switch em {
  color: #6b7280;
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
}

.workspace-health {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
  justify-content: stretch;
  overflow-x: hidden;
}

.workspace-health-pill {
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
  padding: 6px 10px;
  cursor: default;
}

.workspace-health-pill span {
  color: #6b7280;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.35px;
  text-transform: uppercase;
}

.workspace-health-pill strong {
  color: #111827;
  font-size: 12px;
}

.health-ok {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.health-warn {
  border-color: #fde68a;
  background: #fffbeb;
}

.health-error {
  border-color: #fecaca;
  background: #fef2f2;
}

.workspace-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
}

.workspace-canvas {
  position: relative;
  min-height: 560px;
  overflow: auto;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.58);
  background-image: radial-gradient(#dbe1ea 1px, transparent 1px);
  background-size: 24px 24px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.8);
}

.workspace-canvas-title {
  position: absolute;
  top: 14px;
  left: 14px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  max-width: calc(100% - 28px);
  padding: 8px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 26px rgba(15, 23, 42, 0.08);
}

.workspace-canvas-title span {
  color: #6b7280;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.workspace-canvas-title strong {
  color: #111827;
  font-size: 13px;
}

.workspace-flow {
  display: grid;
  gap: 14px;
  padding: 78px 18px 104px;
}

.workspace-fleet-panel,
.workspace-focus-pipeline {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 8px 26px rgba(15, 23, 42, 0.08);
}

.workspace-fleet-head,
.workspace-focus-pipeline-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 0.7fr);
  gap: 12px;
  min-width: 0;
}

.workspace-fleet-head span,
.workspace-focus-pipeline-head span {
  display: block;
  color: #6b7280;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.workspace-fleet-head strong,
.workspace-focus-pipeline-head strong {
  display: block;
  margin-top: 4px;
  color: #111827;
  font-size: 14px;
  font-weight: 950;
}

.workspace-fleet-head em,
.workspace-focus-pipeline-head em {
  color: #64748b;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  line-height: 1.35;
  text-align: right;
  overflow-wrap: anywhere;
}

.workspace-fleet-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
  max-height: 310px;
  overflow: auto;
  padding: 1px 2px 4px;
}

.workspace-fleet-card {
  position: relative;
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr);
  gap: 4px 8px;
  align-items: center;
  min-width: 0;
  width: 100%;
  padding: 9px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #ffffff;
  text-align: left;
  cursor: pointer;
}

.workspace-fleet-card.active {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.14);
}

.workspace-fleet-card .badge,
.workspace-fleet-card strong,
.workspace-fleet-card em,
.workspace-fleet-card small {
  grid-column: 2;
  min-width: 0;
}

.workspace-fleet-card strong,
.workspace-fleet-card em,
.workspace-fleet-card small {
  overflow-wrap: anywhere;
}

.workspace-fleet-card strong {
  color: #111827;
  font-size: 13px;
  font-weight: 950;
}

.workspace-fleet-card em,
.workspace-fleet-card small {
  color: #64748b;
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
}

.fleet-dot {
  grid-row: 1 / span 4;
  align-self: stretch;
  width: 7px;
  border-radius: 999px;
  background: #22c55e;
}

.fleet-warn .fleet-dot {
  background: #f59e0b;
}

.fleet-error .fleet-dot {
  background: #ef4444;
}

.workspace-lane {
  display: grid;
  grid-template-columns: minmax(190px, 260px) minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  opacity: 0.72;
  transition: opacity 0.14s ease, transform 0.14s ease;
}

.workspace-lane.active {
  opacity: 1;
  transform: translateX(2px);
}

.workspace-lane-label {
  min-height: 86px;
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #ffffff;
  text-align: left;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.08);
  cursor: pointer;
}

.workspace-lane-label strong,
.workspace-lane-label em {
  display: block;
}

.workspace-lane-label strong {
  margin-top: 8px;
  color: #111827;
  font-size: 13px;
}

.workspace-lane-label em {
  margin-top: 5px;
  color: #6b7280;
  font-size: 11px;
  font-style: normal;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.lane-warn {
  border-color: #fde68a;
}

.lane-error {
  border-color: #fecaca;
}

.workspace-node-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(170px, 1fr));
  gap: 14px;
  align-items: center;
  overflow-x: auto;
  padding-bottom: 4px;
}

.workspace-node {
  position: relative;
  min-height: 118px;
  padding: 11px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #ffffff;
  text-align: left;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.07);
  cursor: pointer;
}

.workspace-node::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -19px;
  width: 18px;
  height: 2px;
  background: #cbd5e1;
}

.workspace-node:last-child::after {
  display: none;
}

.workspace-node.active {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.16), 0 8px 22px rgba(15, 23, 42, 0.14);
}

.workspace-node.node-ok {
  border-color: #93c5fd;
}

.workspace-node.node-warn {
  border-color: #fde68a;
}

.workspace-node.node-error {
  border-color: #fecaca;
}

.node-kind {
  color: #6b7280;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.45px;
  text-transform: uppercase;
}

.workspace-node strong,
.workspace-node em {
  display: block;
}

.workspace-node strong {
  margin-top: 8px;
  color: #111827;
  font-size: 13px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.workspace-node em {
  margin-top: 6px;
  color: #6b7280;
  font-size: 11px;
  font-style: normal;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.workspace-connector {
  display: none;
}

.workspace-bottom-dock {
  position: absolute;
  left: 50%;
  bottom: 18px;
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: calc(100% - 32px);
  padding: 8px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.16);
  transform: translateX(-50%);
}

.workspace-bottom-dock button,
.icon-btn {
  min-height: 32px;
  padding: 0 11px;
  border: 1px solid #e5e7eb;
  border-radius: 7px;
  background: #ffffff;
  color: #374151;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
}

.workspace-bottom-dock button.active {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.workspace-bottom-dock button.danger {
  border-color: #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}

.dock-separator {
  width: 1px;
  height: 24px;
  margin: 0 4px;
  background: #e5e7eb;
}

.workspace-details {
  min-height: 0;
  overflow: hidden;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 46px rgba(15, 23, 42, 0.14);
}

.workspace-details-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 58px;
  padding: 13px 14px;
  border-bottom: 1px solid #e5e7eb;
}

.workspace-details-head span {
  display: block;
  color: #6b7280;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.45px;
}

.workspace-details-head strong {
  display: block;
  margin-top: 4px;
  color: #111827;
  font-size: 13px;
}

.workspace-details-body {
  display: grid;
  gap: 12px;
  max-height: min(68vh, 720px);
  overflow: auto;
  padding: 14px;
}

.workspace-details .table-wrap,
.workspace-table {
  overflow: auto;
  max-width: 100%;
}

.workspace-details table {
  min-width: 520px;
  table-layout: auto;
}

.workspace-details td,
.workspace-details th {
  max-width: 320px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.workspace-detail-summary {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f9fafb;
}

.workspace-detail-summary strong {
  color: #111827;
  font-size: 15px;
}

.workspace-detail-summary p {
  margin: 0;
  color: #6b7280;
  font-size: 12px;
  line-height: 1.45;
}

.workspace-table {
  max-height: 452px;
}

.workspace-detail-cards {
  display: grid;
  gap: 10px;
}

.workspace-detail-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 9px;
  background: #ffffff;
}

.workspace-detail-card-head {
  display: grid;
  gap: 3px;
  padding-bottom: 8px;
  border-bottom: 1px solid #eef2f7;
}

.workspace-detail-card-head strong {
  color: #0f172a;
  font-size: 14px;
  font-weight: 950;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.workspace-detail-card-head span {
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.workspace-detail-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}

.workspace-detail-field {
  display: grid;
  gap: 4px;
  min-height: 58px;
  padding: 9px;
  border-radius: 8px;
  background: #f8fafc;
}

.workspace-detail-field span {
  color: #64748b;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.35px;
  line-height: 1.25;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.workspace-detail-field strong {
  color: #0f172a;
  font-size: 13px;
  font-weight: 850;
  line-height: 1.32;
  overflow-wrap: anywhere;
}

.workspace-rows-notice {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
}

.workspace-rows-notice span {
  display: block;
  color: #2563eb;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.workspace-rows-notice strong,
.workspace-rows-notice b {
  display: block;
  color: #0f172a;
  font-size: 13px;
  font-weight: 950;
}

.workspace-rows-notice em {
  display: block;
  margin-top: 3px;
  color: #475569;
  font-size: 12px;
  font-style: normal;
  font-weight: 750;
  line-height: 1.35;
}

.workspace-risk-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.stress-summary {
  display: grid;
  gap: 12px;
}

.stress-score {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
  border: 1px solid #d1fae5;
  border-radius: 10px;
  background: #f0fdf4;
}

.stress-score.stress-fail {
  border-color: #fecaca;
  background: #fef2f2;
}

.stress-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.stress-card {
  min-height: 230px;
  padding: 15px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #ffffff;
}

.stress-card.stress-pass {
  border-color: #bbf7d0;
}

.stress-card.stress-fail {
  border-color: #fecaca;
}

.stress-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.stress-category {
  color: #6b7280;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.stress-name {
  margin-top: 12px;
  color: #111827;
  font-size: 16px;
  font-weight: 800;
}

.stress-kv {
  display: grid;
  grid-template-columns: minmax(95px, 0.7fr) minmax(0, 1fr);
  gap: 6px 10px;
  margin-top: 12px;
  padding: 12px;
  border-radius: 8px;
  background: #f9fafb;
  font-size: 12px;
}

.stress-kv span {
  color: #6b7280;
  font-weight: 700;
}

.stress-kv strong {
  color: #111827;
}

.stress-evidence,
.stress-invariant {
  margin-top: 10px;
  color: #4b5563;
  font-size: 12px;
  line-height: 1.45;
}

.stress-invariant {
  color: #111827;
  font-weight: 700;
}

.prop-view {
  display: grid;
  gap: 18px;
}

.prop-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 16px;
  align-items: stretch;
}

.prop-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.prop-form-group {
  display: grid;
  gap: 6px;
}

.prop-form-group label {
  color: #64748b;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.35px;
  text-transform: uppercase;
}

.prop-form-group .select,
.prop-input {
  width: 100%;
  min-width: 0;
  min-height: 38px;
}

.prop-input {
  padding: 0 10px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #ffffff;
  color: #111827;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
}

.prop-input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.prop-wide {
  grid-column: span 2;
}

.prop-verdict {
  min-height: 100%;
}

.prop-verdict-empty,
.prop-verdict-card {
  display: grid;
  gap: 12px;
  min-height: 100%;
  padding: 16px;
  border: 1px solid #dbe3ee;
  border-radius: 10px;
  background: #ffffff;
}

.prop-verdict-empty {
  align-content: center;
  color: #64748b;
}

.prop-verdict-empty strong {
  color: #111827;
  font-size: 18px;
}

.prop-verdict-card.prop-ok,
.prop-budget-card.prop-ok,
.prop-check.prop-ok {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.prop-verdict-card.prop-warn,
.prop-budget-card.prop-warn,
.prop-check.prop-warn,
.prop-check.prop-wait,
.prop-budget-card.prop-wait {
  border-color: #fde68a;
  background: #fffbeb;
}

.prop-verdict-card.prop-fail,
.prop-budget-card.prop-fail,
.prop-check.prop-fail {
  border-color: #fecaca;
  background: #fff7f7;
}

.prop-verdict-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.prop-verdict-head strong {
  color: #111827;
  font-size: 18px;
  line-height: 1.25;
  text-align: right;
}

.prop-verdict-card p,
.prop-check p {
  margin: 0;
  color: #334155;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.45;
}

.prop-auto-engine {
  display: grid;
  gap: 14px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #e5e7eb;
}

.prop-auto-headline {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(0, 1.1fr);
  gap: 14px;
  padding: 14px;
  border: 1px solid #c7d2fe;
  border-radius: 10px;
  background: linear-gradient(135deg, #eef2ff 0%, #ffffff 55%, #ecfeff 100%);
}

.prop-auto-headline > div:first-child {
  display: grid;
  align-content: center;
  gap: 10px;
}

.prop-auto-headline strong {
  color: #111827;
  font-size: 24px;
  line-height: 1.12;
}

.prop-auto-headline p {
  max-width: 680px;
  margin: 0;
  color: #334155;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.45;
}

.prop-auto-headline-metrics,
.prop-playbook,
.prop-execution-stack {
  display: grid;
  gap: 10px;
}

.prop-auto-headline-metrics {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.prop-auto-pipeline {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.prop-auto-node,
.prop-auto-metric {
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 12px;
  border: 1px solid #dbe3ee;
  border-radius: 9px;
  background: #ffffff;
}

.prop-auto-node span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #e0f2fe;
  color: #0369a1;
  font-size: 11px;
  font-weight: 950;
}

.prop-auto-node strong,
.prop-auto-metric strong {
  overflow-wrap: anywhere;
  color: #111827;
  font-size: 14px;
  font-weight: 950;
  line-height: 1.22;
}

.prop-auto-metric strong {
  font-size: 18px;
}

.prop-auto-node em,
.prop-auto-metric em {
  color: #475569;
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
  line-height: 1.4;
}

.prop-auto-metric span {
  color: #64748b;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.35px;
  text-transform: uppercase;
}

.prop-auto-node.prop-ok,
.prop-auto-metric.prop-ok {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.prop-auto-node.prop-warn,
.prop-auto-metric.prop-warn {
  border-color: #fde68a;
  background: #fffbeb;
}

.prop-auto-node.prop-wait,
.prop-auto-metric.prop-wait {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.prop-auto-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.prop-visual-map {
  display: grid;
  gap: 14px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #e5e7eb;
}

.prop-visual-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.prop-visual-head strong,
.prop-rail-head strong {
  color: #111827;
  font-size: 15px;
  font-weight: 900;
}

.prop-visual-head span,
.prop-rail-head span {
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.prop-visual-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.prop-rail-card,
.prop-contract-card,
.prop-flow-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #dbe3ee;
  border-radius: 10px;
  background: #ffffff;
}

.prop-flow-card {
  grid-column: 1 / -1;
}

.prop-rail-head {
  display: grid;
  gap: 3px;
}

.prop-rail-axis,
.prop-contract-labels {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #64748b;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.prop-rail-axis em,
.prop-contract-labels em {
  font-style: normal;
}

.prop-rail-track {
  position: relative;
  height: 18px;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  background: linear-gradient(90deg, #fee2e2 0%, #fef3c7 42%, #dcfce7 100%);
  overflow: visible;
}

.prop-rail-track::after {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
}

.prop-marker {
  position: absolute;
  top: -7px;
  z-index: 2;
  width: 4px;
  height: 30px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: #111827;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.9);
}

.prop-marker.marker-fail,
.prop-marker-chip.marker-fail span {
  background: #dc2626;
}

.prop-marker.marker-warn,
.prop-marker-chip.marker-warn span {
  background: #d97706;
}

.prop-marker.marker-start,
.prop-marker-chip.marker-start span {
  background: #2563eb;
}

.prop-marker.marker-current,
.prop-marker-chip.marker-current span {
  background: #111827;
}

.prop-marker.marker-target,
.prop-marker-chip.marker-target span {
  background: #16a34a;
}

.prop-marker-legend {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.prop-marker-chip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 2px 6px;
  align-items: center;
  min-height: 46px;
  padding: 7px 8px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f8fafc;
}

.prop-marker-chip span {
  width: 8px;
  height: 8px;
  border-radius: 999px;
}

.prop-marker-chip strong {
  overflow: hidden;
  color: #334155;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.2px;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.prop-marker-chip em {
  grid-column: 2;
  color: #111827;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.prop-contract-bar {
  height: 18px;
  overflow: hidden;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: #eff6ff;
}

.prop-contract-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #60a5fa, #2563eb);
}

.prop-flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.prop-flow-node {
  display: grid;
  gap: 5px;
  min-height: 92px;
  padding: 11px;
  border: 1px solid #e5e7eb;
  border-radius: 9px;
  background: #ffffff;
}

.prop-flow-node span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #e0f2fe;
  color: #0369a1;
  font-size: 11px;
  font-weight: 900;
}

.prop-flow-node strong {
  color: #111827;
  font-size: 13px;
  line-height: 1.2;
}

.prop-flow-node em {
  color: #64748b;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
  text-transform: uppercase;
}

.prop-flow-node.prop-ok {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.prop-flow-node.prop-warn,
.prop-flow-node.prop-wait {
  border-color: #fde68a;
  background: #fffbeb;
}

.prop-flow-node.prop-fail {
  border-color: #fecaca;
  background: #fff7f7;
}

.prop-verdict-metrics,
.prop-check-values,
.prop-rules-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.prop-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.75fr) minmax(0, 1.25fr);
  gap: 18px;
}

.prop-risk-budget,
.prop-checks {
  display: grid;
  gap: 10px;
}

.prop-budget-card,
.prop-check {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 9px;
  background: #ffffff;
}

.prop-budget-card span,
.prop-rule-notes span {
  color: #64748b;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.35px;
  text-transform: uppercase;
}

.prop-budget-card strong {
  color: #111827;
  font-size: 22px;
  line-height: 1.15;
}

.prop-budget-card em {
  color: #475569;
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
  line-height: 1.35;
}

.prop-check > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.prop-check strong {
  color: #111827;
  font-size: 14px;
  text-align: right;
}

.prop-rule-set {
  display: grid;
  gap: 14px;
}

.prop-rules-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.prop-rule-notes {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid #dbe3ee;
  border-radius: 9px;
  background: #f8fafc;
}

.prop-rule-notes strong {
  color: #111827;
  font-size: 15px;
}

.status-paused,
.status-pause,
.status-block,
.status-wait {
  background: #fef3c7;
  color: #92400e;
}

.status-failed {
  background: #fee2e2;
  color: #b91c1c;
}

.status-passed {
  background: #dcfce7;
  color: #15803d;
}

tr:hover td {
  background: #fafbfc;
}

.audit-list {
  display: grid;
  gap: 10px;
}

.audit-item {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border-left: 3px solid #a855f7;
  border-radius: 8px;
  background: #f9fafb;
}

.audit-list-rich {
  gap: 12px;
}

.audit-rich {
  --audit-accent: #2563eb;
  --audit-bg: #eff6ff;
  --audit-soft: #dbeafe;
  --audit-text: #1e3a8a;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--audit-soft);
  border-left: 4px solid var(--audit-accent);
  background:
    linear-gradient(90deg, var(--audit-bg), #ffffff 34%),
    #ffffff;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
}

.audit-rich:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
}

.audit-info {
  --audit-accent: #2563eb;
  --audit-bg: #eff6ff;
  --audit-soft: #bfdbfe;
  --audit-text: #1d4ed8;
}

.audit-ok {
  --audit-accent: #059669;
  --audit-bg: #ecfdf5;
  --audit-soft: #a7f3d0;
  --audit-text: #047857;
}

.audit-warn {
  --audit-accent: #d97706;
  --audit-bg: #fffbeb;
  --audit-soft: #fde68a;
  --audit-text: #92400e;
}

.audit-critical {
  --audit-accent: #dc2626;
  --audit-bg: #fef2f2;
  --audit-soft: #fecaca;
  --audit-text: #b91c1c;
}

.audit-symbol {
  display: grid;
  align-content: center;
  justify-items: center;
  min-height: 46px;
  border: 1px solid var(--audit-soft);
  border-radius: 8px;
  background: #ffffff;
  color: var(--audit-text);
}

.audit-symbol strong {
  font-size: 16px;
  line-height: 1;
}

.audit-symbol span {
  margin-top: 4px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.audit-body {
  min-width: 0;
}

.audit-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.audit-title {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.audit-title strong {
  color: #111827;
  font-size: 14px;
  line-height: 1.2;
  text-transform: none;
}

.audit-title span,
.audit-meta {
  color: #6b7280;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.audit-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.audit-level,
.audit-kind-label,
.audit-scope {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--audit-soft);
  background: #ffffff;
  color: var(--audit-text);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.audit-kind-label {
  background: var(--audit-bg);
}

.audit-scope {
  color: #334155;
}

.audit-message {
  color: #374151;
  font-size: 13px;
  line-height: 1.4;
}

.audit-rich .audit-message {
  margin-top: 8px;
  color: #1f2937;
  font-size: 13px;
}

.audit-code-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
  color: #64748b;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.audit-code-row code,
.audit-code-row span {
  padding: 3px 7px;
  border-radius: 6px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.audit-kind-live .audit-kind-label {
  border-color: #a7f3d0;
  background: #ecfdf5;
  color: #047857;
}

.audit-kind-order .audit-kind-label {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #9a3412;
}

.audit-kind-stream .audit-kind-label {
  border-color: #bae6fd;
  background: #f0f9ff;
  color: #0369a1;
}

.audit-kind-access .audit-kind-label {
  border-color: #ddd6fe;
  background: #f5f3ff;
  color: #6d28d9;
}

.audit-kind-sync .audit-kind-label {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.audit-kind-check .audit-kind-label {
  border-color: #c7d2fe;
  background: #eef2ff;
  color: #4338ca;
}

.detail-header {
  margin-bottom: 16px;
}

.detail-header .strategy-card {
  min-height: 0;
}

.select {
  min-height: 34px;
  min-width: 150px;
  max-width: 100%;
  padding: 0 10px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #ffffff;
  color: #1f2937;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
}

.select:focus {
  outline: none;
  border-color: #a855f7;
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.15);
}

.settings-view {
  display: grid;
  gap: 20px;
  min-width: 0;
}

#controlView,
#settingsView {
  max-width: 100%;
  overflow-x: hidden;
}

.settings-credential-form {
  grid-template-columns: minmax(160px, 0.9fr) minmax(160px, 0.9fr) minmax(190px, 1.1fr) minmax(190px, 1.1fr) auto auto;
  align-items: center;
}

.client-accounts-panel {
  display: block;
  min-width: 0;
  max-width: 100%;
  margin-top: 12px;
}

.client-account-intro {
  display: grid;
  gap: 4px;
  margin-top: 10px;
  padding: 12px 14px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
  color: #1e3a8a;
}

.client-account-intro strong {
  color: #0f172a;
  font-size: 13px;
  font-weight: 900;
}

.client-account-intro span {
  color: #334155;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.4;
}

.client-account-empty {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 14px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #ffffff;
}

.client-account-board {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 14px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #ffffff;
}

.client-account-board-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.client-account-board-head div {
  display: grid;
  gap: 4px;
}

.client-account-board-head span,
.client-account-board-head em {
  color: #64748b;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
  letter-spacing: 0.35px;
  text-transform: uppercase;
}

.client-account-board-head strong {
  color: #0f172a;
  font-size: 18px;
  font-weight: 950;
  line-height: 1.15;
}

.client-account-summary-panel {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #f8fbff;
}

.client-account-summary-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.client-account-summary-head span,
.client-account-summary-head strong,
.client-account-summary-head em {
  display: block;
}

.client-account-summary-head span {
  color: #64748b;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.35px;
  text-transform: uppercase;
}

.client-account-summary-head strong {
  margin-top: 2px;
  color: #0f172a;
  font-size: 18px;
  font-weight: 950;
  line-height: 1.15;
}

.client-account-summary-head em {
  margin-top: 3px;
  color: #475569;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  line-height: 1.35;
}

.client-account-summary-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
}

.client-account-summary-grid span {
  display: flex;
  align-items: center;
  min-height: 36px;
  padding: 7px 9px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #ffffff;
  color: #334155;
  font-size: 11px;
  font-weight: 950;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.client-account-summary-grid .ok {
  color: #047857;
  border-color: #bbf7d0;
  background: #ecfdf5;
}

.client-account-summary-grid .warn {
  color: #92400e;
  border-color: #fde68a;
  background: #fffbeb;
}

.client-account-summary-grid .blocked {
  color: #b91c1c;
  border-color: #fecaca;
  background: #fff1f2;
}

.client-account-problem-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 6px;
}

.client-account-problem-list div {
  min-width: 0;
  padding: 9px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #ffffff;
}

.client-account-problem-list strong,
.client-account-problem-list span {
  display: block;
  overflow-wrap: anywhere;
}

.client-account-problem-list strong {
  color: #111827;
  font-size: 12px;
  font-weight: 950;
  line-height: 1.25;
}

.client-account-problem-list span {
  margin-top: 4px;
  color: #475569;
  font-size: 11px;
  font-weight: 780;
  line-height: 1.35;
}

.client-account-problem-list .critical {
  border-color: #fecaca;
  background: #fff1f2;
}

.client-account-problem-list .warn {
  border-color: #fde68a;
  background: #fffbeb;
}

.client-account-problem-list .ok {
  border-color: #bbf7d0;
  background: #ecfdf5;
}

.client-account-table-wrap {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  contain: inline-size;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #ffffff;
}

.client-account-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
}

.client-account-table th,
.client-account-table td {
  padding: 11px 12px;
  border-bottom: 1px solid #eef2f7;
  text-align: left;
  vertical-align: top;
}

.client-account-table th {
  color: #64748b;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.45px;
  text-transform: uppercase;
  background: #f8fafc;
}

.client-account-table td {
  color: #0f172a;
  font-size: 13px;
  font-weight: 750;
}

.client-account-table tr:last-child td {
  border-bottom: 0;
}

.client-account-table tr.is-ready td:first-child {
  box-shadow: inset 4px 0 0 #22c55e;
}

.client-account-table tr.is-missing td:first-child {
  box-shadow: inset 4px 0 0 #f59e0b;
}

.client-account-table tr.is-disabled {
  opacity: 0.72;
}

.client-account-table strong,
.client-account-table span {
  display: block;
  max-width: 260px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.client-account-table strong {
  color: #0f172a;
  font-size: 13px;
  font-weight: 950;
  line-height: 1.25;
}

.client-account-table span {
  margin-top: 3px;
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.3;
}

.client-status-pill {
  display: inline-flex !important;
  width: fit-content;
  max-width: none !important;
  align-items: center;
  margin: 0 0 4px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px !important;
  font-weight: 950 !important;
  line-height: 1;
}

.client-status-pill.ok {
  color: #047857;
  background: #d1fae5;
}

.client-status-pill.warn,
.client-status-pill.paper {
  color: #92400e;
  background: #fef3c7;
}

.client-status-pill.critical {
  color: #b91c1c;
  background: #fee2e2;
}

.client-status-pill.disabled {
  color: #475569;
  background: #e2e8f0;
}

.client-launch-verdict {
  display: grid;
  gap: 4px;
  min-width: 0;
  max-width: 320px;
  padding: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #ffffff;
}

.client-launch-verdict strong,
.client-launch-verdict span {
  display: block;
  max-width: none;
  margin: 0;
  overflow-wrap: anywhere;
}

.client-launch-verdict strong {
  color: #111827;
  font-size: 13px;
  font-weight: 950;
  line-height: 1.2;
}

.client-launch-verdict span {
  color: #475569;
  font-size: 11px;
  font-weight: 780;
  line-height: 1.35;
}

.client-launch-verdict.ok {
  border-color: #bbf7d0;
  background: #ecfdf5;
}

.client-launch-verdict.warn,
.client-launch-verdict.paper {
  border-color: #fde68a;
  background: #fffbeb;
}

.client-launch-verdict.critical {
  border-color: #fecaca;
  background: #fff1f2;
}

.client-launch-verdict.disabled {
  border-color: #e2e8f0;
  background: #f8fafc;
}

.client-key-venue-block {
  display: grid;
  gap: 4px;
  min-width: 0;
  max-width: 330px;
}

.client-key-venue-block strong,
.client-key-venue-block span {
  max-width: none;
}

.client-key-check-actions {
  display: grid;
  gap: 4px;
  justify-items: start;
  margin-top: 7px;
}

.client-live-checklist {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 7px;
  max-width: 360px;
}

.client-live-checklist.compact {
  max-width: 320px;
}

.client-live-checklist span {
  display: inline-flex !important;
  width: fit-content;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 4px 7px;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  font-size: 10px !important;
  font-weight: 950 !important;
  line-height: 1.15 !important;
  text-transform: none;
  white-space: normal;
}

.client-live-checklist .ok {
  color: #047857;
  border-color: #bbf7d0;
  background: #ecfdf5;
}

.client-live-checklist .blocked {
  color: #b91c1c;
  border-color: #fecaca;
  background: #fff1f2;
}

.client-live-blockers {
  display: flex;
  flex-basis: 100%;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 2px;
}

.client-live-checklist .client-live-blocker {
  color: #92400e;
  border-color: #fde68a;
  background: #fffbeb;
}

.client-account-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.client-account-row-actions .btn {
  min-height: 30px;
  padding: 6px 10px;
  font-size: 12px;
}

.client-account-empty span {
  color: #64748b;
  font-size: 11px;
  font-style: normal;
  font-weight: 850;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.client-account-empty strong {
  color: #111827;
  font-size: 16px;
  font-weight: 900;
  line-height: 1.2;
}

.client-account-form {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(150px, 1fr) minmax(150px, 0.9fr) minmax(150px, 1fr) minmax(150px, 1fr) minmax(120px, 0.7fr) minmax(90px, 0.5fr) auto;
  gap: 8px;
  align-items: center;
  margin-top: 14px;
}

.client-davydov-settings {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(190px, 0.8fr) minmax(260px, 1.1fr) repeat(3, minmax(150px, 0.7fr));
  gap: 10px;
  align-items: stretch;
  padding: 10px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
}

.client-davydov-settings.hidden {
  display: none;
}

.client-davydov-settings-head {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.client-davydov-settings-head strong {
  color: #0f172a;
  font-size: 13px;
  font-weight: 950;
  line-height: 1.15;
}

.client-davydov-settings-head span {
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 850;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.davydov-setting-field {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 8px;
  border: 1px solid rgba(191, 219, 254, 0.92);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.davydov-setting-field.wide {
  grid-column: span 2;
}

.davydov-setting-field span {
  color: #334155;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.35px;
  line-height: 1.15;
  text-transform: uppercase;
}

.davydov-setting-field small {
  color: #64748b;
  font-size: 11px;
  font-weight: 750;
  line-height: 1.25;
}

.davydov-setting-field .credential-input,
.davydov-setting-field .select {
  min-height: 32px;
}

.credential-preflight {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #ffffff;
}

.credential-preflight.ok {
  border-color: #86efac;
  background: #f0fdf4;
}

.credential-preflight.blocked {
  border-color: #fecaca;
  background: #fff7f7;
}

.credential-preflight-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.credential-preflight-head div {
  display: grid;
  gap: 4px;
}

.credential-preflight-head strong {
  font-size: 14px;
  color: #111827;
}

.credential-preflight-head span,
.credential-preflight-head em {
  font-size: 12px;
  color: #64748b;
  font-style: normal;
}

.preflight-summary-grid,
.preflight-permissions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.preflight-permissions {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.preflight-message,
.preflight-done-hint {
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: #334155;
  font-size: 13px;
  line-height: 1.45;
}

.preflight-done-hint {
  background: #fef2f2;
  color: #991b1b;
}

.preflight-checks {
  display: grid;
  gap: 8px;
}

.preflight-check {
  display: grid;
  grid-template-columns: 74px minmax(180px, 0.8fr) minmax(0, 1.6fr);
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 9px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #ffffff;
}

.preflight-check span {
  justify-self: start;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.preflight-check strong {
  font-size: 13px;
  color: #111827;
}

.preflight-check em {
  color: #475569;
  font-size: 12px;
  font-style: normal;
  line-height: 1.4;
}

.preflight-check.ok {
  border-color: #bbf7d0;
}

.preflight-check.ok span {
  background: #dcfce7;
  color: #166534;
}

.preflight-check.warn {
  border-color: #fde68a;
}

.preflight-check.warn span {
  background: #fef3c7;
  color: #92400e;
}

.preflight-check.fail {
  border-color: #fecaca;
}

.preflight-check.fail span {
  background: #fee2e2;
  color: #991b1b;
}

.capital-settings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.settings-section-title {
  grid-column: 1 / -1;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
  padding: 4px 2px 2px;
}

.settings-section-title div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.settings-section-title span,
.settings-section-title em {
  color: #64748b;
  font-size: 11px;
  font-style: normal;
  font-weight: 850;
  letter-spacing: 0.35px;
  text-transform: uppercase;
}

.settings-section-title strong {
  color: #111827;
  font-size: 16px;
  font-weight: 900;
  line-height: 1.2;
}

.settings-section-title.client-title {
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid #e5e7eb;
}

.capital-card {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 14px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #ffffff;
}

.capital-card.client-strategy-card.ok {
  border-color: #86efac;
  background: #f7fef9;
}

.capital-card.client-strategy-card.warn {
  border-color: #fde68a;
  background: #fffdf4;
}

.capital-card.client-strategy-card.disabled {
  border-color: #e5e7eb;
  background: #f8fafc;
}

.settings-wide-empty {
  grid-column: 1 / -1;
}

.capital-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.capital-card-head strong,
.capital-card p,
.capital-card em {
  display: block;
}

.capital-card-head strong {
  margin-top: 6px;
  color: #111827;
  font-size: 14px;
  font-weight: 850;
  line-height: 1.25;
}

.capital-card-head small {
  display: block;
  margin-top: 4px;
  max-width: 100%;
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.capital-metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.capital-card p {
  margin: 0;
  color: #475569;
  font-size: 12px;
  line-height: 1.4;
}

.capital-card em {
  color: #64748b;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
  line-height: 1.35;
}

.capital-edit-field {
  display: grid;
  gap: 7px;
  min-height: 70px;
  padding: 10px;
  border-radius: 8px;
  background: #f9fafb;
}

.capital-edit-field span {
  color: #6b7280;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.55px;
  text-transform: uppercase;
}

.capital-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.capital-card-actions span {
  color: #64748b;
  font-size: 11px;
  font-weight: 750;
  line-height: 1.35;
  text-align: right;
}

.settings-json {
  max-width: 100%;
  box-sizing: border-box;
  max-height: 620px;
  margin: 0;
  padding: 16px;
  overflow: auto;
  border-radius: 10px;
  background: #111827;
  color: #e5e7eb;
  font-size: 12px;
  line-height: 1.55;
}

.strategy-catalog-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

.strategy-catalog-table th,
.strategy-catalog-table td {
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
}

.strategy-catalog-table small {
  font-size: 10px;
}

.hidden {
  display: none !important;
}

@media (min-width: 981px) {
  body.auth-ready .tabs {
    display: none;
  }
}

@media (max-width: 1280px) {
  .app-layout {
    grid-template-columns: 292px minmax(0, 1fr);
  }

  .topbar {
    gap: 8px;
    padding-right: 12px;
    padding-left: 12px;
  }

  .runner-status {
    max-width: 220px;
  }

  .tabs {
    max-width: 560px;
  }

  .top-action,
  .activate-btn {
    padding: 0 10px;
  }

  #exportButton {
    display: none;
  }

  .strategy-context {
    min-width: min(540px, 52vw);
    grid-template-columns: minmax(200px, 280px) minmax(150px, 1fr);
  }

  .workspace-shell {
    grid-template-columns: 1fr;
  }

  .workspace-canvas,
  .workspace-details {
    min-height: 600px;
  }

  .workspace-details-body {
    max-height: 540px;
  }
}

@media (min-width: 1101px) and (max-width: 1280px) {
  .workspace-shell {
    grid-template-columns: 1fr;
  }

  .workspace-canvas,
  .workspace-details {
    min-height: 620px;
  }
}

@media (max-width: 1220px) {
  .topbar {
    flex-wrap: wrap;
  }

  .tabs {
    order: 10;
    width: 100%;
    max-width: none;
    margin-left: 46px;
  }

  .canvas-toolbar {
    top: 98px;
  }

  .strategy-navigator {
    top: calc(var(--topbar-height, 98px) + 47px);
    height: calc(100vh - var(--topbar-height, 98px) - 47px);
  }
}

@media (max-width: 1500px) {
  .topbar {
    flex-wrap: wrap;
    overflow-x: visible;
  }

  .strategy-command-layout {
    grid-template-columns: 1fr;
  }

  .client-account-summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .strategy-fleet-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .strategy-fleet-table {
    max-height: 430px;
  }

  .strategy-fleet-registry {
    order: 1;
  }

  .strategy-selected-panel {
    order: 2;
  }

  .strategy-fleet-row {
    grid-template-columns:
      minmax(170px, 1.25fr)
      minmax(96px, 0.75fr)
      minmax(110px, 0.82fr)
      minmax(112px, 0.82fr)
      minmax(136px, 1fr)
      minmax(140px, 0.98fr)
      minmax(180px, 1.35fr);
    min-width: 0;
  }

  .strategy-fleet-cell.action-cell {
    padding-left: 8px;
    border-left: 1px solid #eef2f7;
  }

  .workspace-node-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow-x: visible;
    gap: 10px;
  }

  .workspace-node {
    min-width: 0;
  }

  .workspace-node::after {
    display: none;
  }

  .client-account-form {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: stretch;
  }

  #saveClientAccountButton {
    grid-column: 1 / -1;
    justify-self: stretch;
  }

  .strategy-catalog-table th,
  .strategy-catalog-table td {
    position: static;
    right: auto;
    left: auto;
  }
}

@media (max-width: 1440px) {
  .strategy-data-grid,
  .strategy-data-lower {
    grid-template-columns: minmax(0, 1fr);
  }

  .candle-inspector {
    width: 100%;
    min-width: 0;
  }

  .strategy-fleet-row {
    grid-template-columns:
      minmax(142px, 1.2fr)
      minmax(82px, 0.72fr)
      minmax(92px, 0.78fr)
      minmax(92px, 0.78fr)
      minmax(112px, 0.95fr)
      minmax(112px, 0.95fr)
      minmax(146px, 1.08fr);
    gap: 6px;
    padding: 8px;
  }
}

@media (max-width: 980px) {
  .app-layout {
    display: block;
  }

  .strategy-navigator {
    position: sticky;
    top: calc(var(--topbar-height, 98px) + 47px);
    height: auto;
    max-height: 46vh;
    border-right: 0;
    border-bottom: 1px solid #e5e7eb;
  }

  .navigator-shell {
    grid-template-rows: none;
    height: auto;
  }

  .navigator-list {
    grid-auto-flow: row;
    grid-auto-columns: auto;
    overflow: visible;
    padding-bottom: 0;
  }

  .navigator-group {
    min-width: 0;
  }

  .topbar {
    flex-wrap: wrap;
  }

  .tabs {
    display: none;
  }

  .toolbar-hint {
    display: none;
  }

  .strategy-context {
    flex: 1 0 100%;
    width: 100%;
    min-width: 0;
    grid-template-columns: minmax(220px, 1fr) minmax(160px, 0.8fr);
    overflow: visible;
  }

  .portfolio-grid,
  .strategy-command-title,
  .strategy-command-layout,
  .strategy-command-metrics,
  .strategy-command-split,
  .strategy-fleet-stats,
  .operator-info-grid,
  .strategy-grid,
  .stress-score,
  .stress-grid,
  .strategy-data-grid,
  .strategy-data-lower,
  .prop-layout,
  .prop-grid,
  .prop-visual-grid,
  .prop-auto-headline,
  .prop-auto-headline-metrics,
  .prop-auto-pipeline,
  .prop-form,
  .prop-rules-grid,
  .control-critical-grid,
  .operator-pulse-main,
  .operator-pulse-facts,
  .operator-command-grid,
  .control-strategy-lens,
  .calculation-flow,
  .calculation-strategies,
  .decision-lens,
  .decision-metrics,
  .decision-price-strip,
  .service-control-grid,
  .operator-columns,
  .capital-settings-grid,
  .settings-credential-form,
  .client-account-form,
  .preflight-summary-grid,
  .preflight-permissions,
  .two-column,
  .workspace-head,
  .workspace-shell,
  .state-block-grid,
  .state-block-grid.compact {
    grid-template-columns: 1fr;
  }

  .client-davydov-settings {
    grid-template-columns: 1fr;
  }

  .davydov-setting-field.wide {
    grid-column: auto;
  }

  .workspace-shell {
    align-items: stretch;
  }

  .risk-command-head {
    display: grid;
    grid-template-columns: 1fr;
  }

  .risk-command-actions {
    flex-wrap: wrap;
  }

  .strategy-command-title {
    display: grid;
  }

  .strategy-fleet-head {
    display: grid;
  }

  .strategy-fleet-head small {
    max-width: none;
    text-align: left;
  }

  .trade-open-grid {
    grid-template-columns: 1fr;
  }

  .trade-summary-strip {
    grid-template-columns: 1fr;
  }

  .trade-section-head {
    display: grid;
    grid-template-columns: 1fr;
  }

  .workspace-canvas,
  .workspace-details {
    min-height: 560px;
  }

  .workspace-lane {
    grid-template-columns: 1fr;
  }

  .workspace-fleet-head,
  .workspace-focus-pipeline-head {
    display: grid;
    grid-template-columns: 1fr;
  }

  .workspace-fleet-head em,
  .workspace-focus-pipeline-head em {
    max-width: none;
    text-align: left;
  }

  .workspace-node-row {
    grid-template-columns: repeat(5, minmax(160px, 1fr));
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .workspace-health {
    justify-content: flex-start;
  }

  .preflight-check {
    grid-template-columns: 1fr;
  }

  .branch-row {
    grid-template-columns: 1fr;
  }

  .decision-glossary-grid {
    grid-template-columns: 1fr;
  }

  .decision-ticker-rail {
    grid-template-columns: 1fr;
  }

  .decision-rail-title {
    grid-column: 1 / -1;
  }

  .strategy-card {
    min-height: 0;
  }
}

@media (max-width: 1260px) {
  .strategy-data-grid,
  .strategy-data-lower {
    grid-template-columns: 1fr;
  }

  .chart-toolbar {
    grid-template-columns: 1fr;
  }

  .chart-actions {
    grid-template-columns: 1fr;
  }

  .chart-presets {
    justify-content: flex-start;
  }

  .strategy-record-card {
    grid-template-columns: 1fr;
  }

  .anchor-snapshot-head {
    grid-template-columns: 1fr;
  }

  .anchor-snapshot-summary {
    justify-content: flex-start;
  }

  .anchor-snapshot-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  body {
    overflow-x: hidden;
  }

  .anchor-snapshot-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topbar {
    flex-wrap: nowrap;
    gap: 6px;
    min-height: 48px;
    padding: 7px 10px;
  }

  .runner-name {
    max-width: clamp(88px, 30vw, 120px);
    overflow: hidden;
    font-size: 14px;
    text-overflow: ellipsis;
  }

  .runner-status,
  .qats-label.type-analytical,
  .qats-label.status-active,
  #tourButton {
    display: none;
  }

  .mode-badge,
  .language-toggle,
  .activate-btn {
    flex: 0 0 auto;
    height: 30px;
    min-height: 30px;
  }

  .mode-badge {
    padding-inline: 9px;
  }

  .language-toggle {
    width: 34px;
  }

  .activate-btn.danger {
    max-width: 92px;
    overflow: hidden;
    padding-inline: 7px;
    font-size: 10px;
    text-overflow: ellipsis;
  }

  .tabs {
    display: none;
  }

  #runOnceButton,
  #syncButton,
  #reconcileButton,
  #exportButton,
  #logoutButton {
    display: none;
  }

  body[data-view="controlView"] #reconcileButton,
  body[data-view="tradesView"] #reconcileButton,
  body[data-view="tradesView"] #syncButton {
    display: inline-flex;
  }

  .canvas-toolbar {
    top: var(--topbar-height, 48px);
    flex-wrap: nowrap;
    gap: 6px;
    overflow-x: auto;
    padding: 7px 10px;
    scrollbar-width: none;
  }

  .canvas-toolbar::-webkit-scrollbar {
    display: none;
  }

  .canvas-toolbar #runtimeLastBar {
    display: none;
  }

  .strategy-navigator {
    position: static;
    height: auto;
    max-height: none;
    border-right: 0;
    border-bottom: 1px solid #e5e7eb;
  }

  .navigator-shell {
    min-height: 0;
    gap: 7px;
    padding: 8px;
  }

  .navigator-head {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
  }

  .navigator-head span {
    display: none;
  }

  .navigator-head strong {
    font-size: 14px;
  }

  .navigator-head em {
    text-align: right;
  }

  .navigator-primary {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .navigator-primary::-webkit-scrollbar {
    display: none;
  }

  .navigator-primary a {
    flex: 0 0 auto;
    grid-template-columns: 1fr;
    min-width: 104px;
    min-height: 38px;
    padding: 8px 10px;
    scroll-snap-align: start;
  }

  .navigator-primary span {
    display: none;
  }

  .navigator-more {
    padding: 0;
    border: 0;
    background: transparent;
  }

  .navigator-more summary {
    min-height: 36px;
    padding: 9px 10px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #ffffff;
  }

  .navigator-more div {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .navigator-task-panel {
    gap: 5px;
    padding: 9px 10px;
    border-radius: 8px;
  }

  .navigator-status-grid {
    gap: 5px;
  }

  .navigator-status-grid .metric {
    min-height: 54px;
    padding: 7px;
  }

  .navigator-search,
  .navigator-list {
    display: none;
  }

  .container,
  body[data-view="workspaceView"] .container,
  body[data-view="strategyDataView"] .container {
    width: 100%;
    padding: 10px 10px 72px;
  }

  .panel,
  .stat-tile,
  .strategy-card,
  .strategy-fleet-registry,
  .workspace-canvas,
  .workspace-details {
    border-radius: 8px;
  }

  .portfolio-grid {
    gap: 8px;
    margin-bottom: 10px;
  }

  .strategy-fleet-registry {
    padding: 8px;
  }

  .strategy-fleet-table {
    max-height: none;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .strategy-fleet-row {
    min-width: 720px;
    grid-template-columns:
      minmax(150px, 1.1fr)
      minmax(94px, 0.72fr)
      minmax(96px, 0.72fr)
      minmax(112px, 0.8fr)
      minmax(126px, 0.92fr)
      minmax(142px, 1fr);
    gap: 6px;
    padding: 8px;
  }

  .workspace-canvas,
  .workspace-details {
    min-height: auto;
  }

  .table-wrap,
  .streaming-table-wrap,
  .client-account-table-wrap {
    overflow-x: auto;
  }

  .strategy-context {
    width: 100%;
    min-width: 0;
    flex: 1 0 100%;
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .strategy-context-current {
    width: 100%;
    min-width: 0;
    border-top: 1px solid #bfdbfe;
    border-left: 0;
  }

  .strategy-context-picker {
    padding-right: 8px;
  }

  .chart-range-control {
    grid-template-columns: 32px minmax(130px, 1fr) 32px 32px 32px;
    gap: 5px;
  }

  .chart-presets .btn {
    min-width: 40px;
  }

  .toolbar-btn {
    flex: 0 0 auto;
  }

  .strategy-data-controls {
    justify-content: stretch;
  }

  .strategy-data-control,
  .strategy-data-control.anchor-control,
  .strategy-data-control.compact-control,
  .strategy-data-control.tiny-control {
    width: 100%;
  }

  .prop-wide {
    grid-column: auto;
  }

  .prop-verdict-head,
  .prop-check > div:first-child {
    display: grid;
    grid-template-columns: 1fr;
  }

  .prop-verdict-head strong,
  .prop-check strong {
    text-align: left;
  }

  .strategy-data-controls select,
  .strategy-data-controls .segmented,
  .strategy-data-controls .btn {
    width: 100%;
  }

  .settings-view .panel {
    padding: 14px 12px;
  }

  .streaming-table,
  .client-account-table {
    width: max-content;
    max-width: none;
  }

  .credential-matrix {
    display: block;
  }

  .credential-matrix-head,
  .credential-row {
    grid-template-columns: minmax(88px, 1fr) minmax(90px, 1fr) minmax(90px, 1fr) minmax(100px, 1fr);
    width: max-content;
    max-width: none;
    min-width: 420px;
  }

  .settings-credential-form {
    grid-template-columns: 1fr;
  }

  .prop-verdict-metrics,
  .prop-check-values,
  .prop-rules-grid,
  .prop-marker-legend,
  .prop-flow,
  .prop-auto-headline-metrics,
  .prop-auto-pipeline {
    grid-template-columns: 1fr;
  }

  .credential-preflight-head {
    display: grid;
    grid-template-columns: 1fr;
  }

  .settings-json {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
  }

  .segmented button {
    flex: 1 1 0;
    min-width: 0;
  }

  .workspace-flow {
    padding-right: 12px;
    padding-left: 12px;
  }

  .workspace-fleet-strip {
    display: grid;
    grid-template-columns: 1fr;
    max-height: 230px;
    overflow: auto;
  }

  .workspace-bottom-dock {
    right: 12px;
    left: 12px;
    justify-content: flex-start;
    overflow-x: auto;
    transform: none;
  }

  .chart-topbar {
    display: grid;
    grid-template-columns: 1fr;
  }

  .chart-legend {
    justify-content: flex-start;
    max-height: 92px;
    overflow-y: auto;
    padding-top: 2px;
  }

  #strategyPriceCanvas {
    height: 430px;
  }

  #strategyIndicatorCanvas {
    height: 150px;
  }

  .strategy-decision-strip {
    grid-template-columns: 1fr;
  }

  .decision-strip-branches {
    justify-content: flex-start;
  }

  .capital-metric-grid {
    grid-template-columns: 1fr;
  }

  .records-summary,
  .record-card-stats {
    grid-template-columns: 1fr;
  }

  .chart-actions {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .chart-actions input[type="range"] {
    grid-column: 1 / -1;
  }

  .chart-actions #chartReset {
    grid-column: 1 / -1;
  }

  .container {
    width: 100%;
  }

  .decision-ticker-rail {
    grid-template-columns: 1fr;
  }

  .portfolio-grid,
  .metrics,
  .card-actions {
    grid-template-columns: 1fr;
  }

  .last-triggered {
    display: none;
  }

  .workspace-flow {
    padding: 18px 12px 96px;
  }

  .workspace-bottom-dock {
    overflow-x: auto;
    justify-content: flex-start;
  }

  .strategy-card.purple::before {
    position: static;
    align-self: flex-start;
    margin-bottom: 10px;
  }
}

.strategy-accounting-panel {
  display: grid;
  gap: 14px;
}

.strategy-catalog-panel,
.catalog-secondary-grid,
.catalog-summary-grid,
.risk-limit-list {
  display: grid;
  gap: 10px;
}

.product-catalog-section {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: linear-gradient(180deg, #eff6ff 0%, #ffffff 64%);
}

.catalog-section-head {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
}

.catalog-section-head > div {
  min-width: min(100%, 360px);
  flex: 1 1 420px;
}

.catalog-section-head h3,
.catalog-subhead {
  margin: 0;
  color: #0f172a;
  font-size: 13px;
  font-weight: 950;
}

.catalog-section-head p {
  margin: 4px 0 0;
  max-width: 760px;
  color: #475569;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35;
}

.catalog-subhead {
  padding: 0 0 8px;
}

.catalog-summary-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.catalog-secondary-grid {
  grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr);
  align-items: start;
}

.catalog-secondary-grid h3,
.risk-limit-card h3 {
  margin: 0 0 8px;
  color: #0f172a;
  font-size: 13px;
}

.risk-limit-card {
  padding: 12px;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  background: #f0fdf4;
}

.risk-limit-card.risk-warn {
  border-color: #fde68a;
  background: #fffbeb;
}

.risk-limit-card.risk-critical {
  border-color: #fecaca;
  background: #fef2f2;
}

.risk-limit-card p {
  margin: 0 0 10px;
  color: #475569;
  font-size: 12px;
  font-weight: 800;
}

.risk-limit-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.risk-limit-list span {
  padding: 8px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  color: #475569;
  font-size: 11px;
  font-weight: 900;
}

.strategy-catalog-table small {
  display: block;
  margin-top: 2px;
  color: #64748b;
  font-size: 11px;
}

.product-catalog-table td {
  vertical-align: top;
}

.product-catalog-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

.product-catalog-table th,
.product-catalog-table td {
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
}

.product-catalog-table .badge {
  justify-self: start;
}

.product-quality-cell strong,
.product-runtime-cell strong,
.product-composition-cell span {
  color: #0f172a;
  white-space: normal;
}

.product-metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(56px, 1fr));
  gap: 6px;
  min-width: 150px;
}

.product-metric-grid span {
  display: grid;
  gap: 2px;
  padding: 6px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 7px;
  background: rgba(248, 250, 252, 0.9);
}

.product-metric-grid small {
  margin: 0;
  color: #64748b;
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
}

.product-metric-grid strong {
  color: #0f172a;
  font-size: 12px;
  font-weight: 950;
}

.product-action-link {
  white-space: nowrap;
}

.product-action-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.product-action-stack .btn {
  min-height: 32px;
}

.catalog-stack {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.catalog-stack strong {
  color: #0f172a;
  font-weight: 950;
}

.catalog-stack .status-pill {
  justify-self: start;
}

.catalog-sync small {
  max-width: 220px;
  overflow-wrap: anywhere;
}

.catalog-sync-warn strong {
  color: #b45309;
}

.catalog-sync-ok strong {
  color: #047857;
}

@media (max-width: 640px) {
  .control-monitor-grid,
  .control-strategy-grid,
  .control-critical-grid,
  .operator-pulse-main,
  .operator-command-grid,
  .catalog-summary-grid,
  .catalog-secondary-grid,
  .risk-limit-list {
    grid-template-columns: 1fr;
  }

  .catalog-section-head {
    display: grid;
  }

  .product-metric-grid {
    grid-template-columns: repeat(4, minmax(54px, 1fr));
  }

  .control-monitor {
    min-height: 0;
    padding: 11px;
  }

  .control-monitor-value {
    margin-top: 8px;
    font-size: 15px;
  }

  .control-monitor p {
    margin-top: 6px;
  }

  .execution-readiness,
  .global-live-panel,
  .client-account-summary-panel,
  .readiness-pill,
  .execution-guard-line {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .global-live-head {
    display: grid;
    grid-template-columns: 1fr;
  }

  .global-live-head .btn {
    width: 100%;
    min-height: 36px;
    white-space: normal;
  }

  .global-live-grid,
  .global-live-steps,
  .client-account-summary-grid,
  .client-account-problem-list {
    display: grid;
    grid-template-columns: 1fr;
  }

  .global-live-grid span,
  .global-live-steps span,
  .client-account-summary-grid span {
    width: 100%;
  }

  .global-live-command code {
    white-space: pre-wrap;
    word-break: break-word;
  }

  .strategy-fleet-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .strategy-fleet-registry {
    padding: 10px;
  }

  .strategy-fleet-table {
    max-height: none;
    overflow: visible;
    gap: 8px;
  }

  .strategy-fleet-row.fleet-header {
    display: none;
  }

  .strategy-fleet-row:not(.fleet-header) {
    min-width: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    overflow: hidden;
    padding: 10px;
  }

  .strategy-fleet-row:not(.fleet-header) .strategy-fleet-cell {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4px;
    align-items: center;
    min-height: 58px;
    padding: 8px;
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.72);
  }

  .strategy-fleet-row:not(.fleet-header) .strategy-fleet-cell[data-label]::before {
    content: attr(data-label);
    color: #64748b;
    font-size: 10px;
    font-weight: 950;
    line-height: 1.2;
    text-transform: uppercase;
  }

  .strategy-fleet-row:not(.fleet-header) .strategy-fleet-cell[data-label] > * {
    justify-self: start;
    text-align: left;
  }

  .strategy-fleet-row:not(.fleet-header) .strategy-name-cell {
    grid-column: 1 / -1;
    grid-template-columns: auto minmax(0, 1fr);
    min-height: 0;
  }

  .strategy-fleet-row:not(.fleet-header) .strategy-name-cell .badge {
    grid-row: 1 / span 2;
    align-self: start;
  }

  .strategy-fleet-row:not(.fleet-header) .strategy-name-cell strong,
  .strategy-fleet-row:not(.fleet-header) .strategy-name-cell em {
    justify-self: start;
    text-align: left;
  }

  .strategy-fleet-row:not(.fleet-header) .action-cell {
    grid-column: 1 / -1;
    grid-template-columns: 1fr;
  }

  .strategy-fleet-row:not(.fleet-header) .action-cell .strategy-row-actions {
    justify-self: stretch;
    justify-content: flex-start;
  }

  .strategy-fleet-row:not(.fleet-header) .action-cell .btn {
    width: 100%;
  }

  .control-strategy-table,
  .fleet-table-body {
    display: grid;
    gap: 8px;
  }

  .fleet-table-head {
    display: none;
  }

  .control-strategy-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 10px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #ffffff;
  }

  .control-strategy-row.selected {
    border-color: #2563eb;
    background: #eff6ff;
    box-shadow: inset 4px 0 0 #2563eb;
  }

  .control-strategy-row.inactive {
    border-color: #fde68a;
    background: #fffbeb;
  }

  .control-strategy-row .fleet-focus-button {
    grid-column: 1 / -1;
    display: grid;
    gap: 3px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eef2f7;
  }

  .fleet-state {
    display: grid;
    gap: 4px;
    min-height: 48px;
    padding: 8px;
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.72);
    color: #0f172a;
    font-size: 12px;
    font-weight: 900;
    line-height: 1.2;
  }

  .fleet-state::before {
    content: attr(data-label);
    color: #64748b;
    font-size: 10px;
    font-weight: 950;
    text-transform: uppercase;
  }

  .fleet-state.status-ok,
  .fleet-state.status-running {
    border-color: #bbf7d0;
    background: #f0fdf4;
    color: #047857;
  }

  .fleet-state.status-warn {
    border-color: #fde68a;
    background: #fffbeb;
    color: #92400e;
  }

  .fleet-state.muted {
    color: #64748b;
  }
}

@media (max-width: 640px) {
  body {
    padding-bottom: calc(78px + env(safe-area-inset-bottom));
    background-size: 14px 14px;
  }

  body.auth-locked {
    padding-bottom: 0;
  }

  .auth-card {
    padding: 18px;
  }

  .topbar {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr) auto auto;
    gap: 7px;
    align-items: center;
    min-height: 0;
    overflow: visible;
    padding: 8px 10px;
  }

  .back-btn {
    grid-column: 1;
    grid-row: 1;
  }

  .runner-name {
    grid-column: 2;
    grid-row: 1;
    max-width: none;
    min-width: 0;
    font-size: 14px;
  }

  .mode-badge {
    grid-column: 3;
    grid-row: 1;
  }

  .language-toggle {
    grid-column: 4;
    grid-row: 1;
  }

  .top-spacer,
  .last-triggered,
  .runner-status,
  .qats-label,
  #tourButton,
  #runOnceButton,
  #exportButton,
  #logoutButton {
    display: none !important;
  }

  .shabbat-mode-button {
    grid-column: 1 / 3;
    grid-row: 2;
    width: 100%;
    min-height: 36px;
    justify-content: center;
    padding-inline: 8px;
  }

  body[data-view="controlView"] #reconcileButton,
  body[data-view="tradesView"] #reconcileButton,
  body[data-view="tradesView"] #syncButton {
    display: inline-flex !important;
    grid-column: 1 / 3;
    grid-row: 2;
    width: 100%;
    min-height: 36px;
    justify-content: center;
  }

  body[data-view="tradesView"] .shabbat-mode-button {
    display: none;
  }

  .activate-btn.danger {
    grid-column: 3 / 5;
    grid-row: 2;
    width: 100%;
    max-width: none;
    min-height: 36px;
    padding-inline: 8px;
    font-size: 11px;
    text-overflow: clip;
  }

  .canvas-toolbar {
    top: var(--topbar-height, 86px);
    gap: 7px;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
  }

  .toolbar-btn {
    min-height: 34px;
    padding-inline: 11px;
    font-size: 12px;
    font-weight: 800;
  }

  .shabbat-banner {
    top: calc(var(--topbar-height, 86px) + 51px);
    display: grid;
    grid-template-columns: 1fr;
    padding: 9px 10px;
  }

  .strategy-navigator {
    position: static;
    border-bottom: 0;
    background: transparent;
  }

  .navigator-shell {
    gap: 8px;
    padding: 8px 10px 4px;
  }

  .navigator-head,
  .navigator-task-panel {
    border-radius: 8px;
  }

  .navigator-task-panel {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

  .navigator-task-panel span,
  .navigator-task-panel em {
    grid-column: 1 / -1;
  }

  .navigator-task-panel .btn {
    grid-column: 1 / -1;
    min-height: 36px;
  }

  .navigator-status-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .navigator-more {
    display: none;
  }

  .navigator-primary {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 170;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
    padding: 7px 8px calc(7px + env(safe-area-inset-bottom));
    border-top: 1px solid #dbe3ee;
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 -12px 28px rgba(15, 23, 42, 0.1);
    backdrop-filter: blur(14px);
  }

  .navigator-primary a {
    display: grid;
    grid-template-columns: 1fr;
    place-items: center;
    min-width: 0;
    min-height: 52px;
    padding: 6px 2px;
    border-radius: 8px;
    text-align: center;
  }

  .navigator-primary a.active {
    border-color: #bfdbfe;
    background: #eff6ff;
  }

  .navigator-primary strong {
    max-width: 100%;
    overflow: hidden;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .navigator-primary span {
    display: block;
    max-width: 100%;
    overflow: hidden;
    font-size: 10px;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .container,
  body[data-view="workspaceView"] .container,
  body[data-view="strategyDataView"] .container {
    padding: 10px 10px calc(104px + env(safe-area-inset-bottom));
  }

  .panel {
    margin-bottom: 12px;
    padding: 14px 12px;
  }

  .panel-head {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

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

  .stat-tile {
    min-height: 74px;
    padding: 10px;
  }

  .metric-label {
    font-size: 9.5px;
    line-height: 1.2;
  }

  .metric-value {
    font-size: 20px;
  }

  .trade-journal {
    gap: 12px;
  }

  .trade-section {
    padding: 10px;
    border-radius: 8px;
  }

  .trade-section-head {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
    margin-bottom: 10px;
  }

  .trade-summary-line {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .trade-summary-line span {
    justify-content: space-between;
    width: 100%;
    white-space: normal;
  }

  .table-wrap:has(table.responsive-table),
  .table-wrap.trade-table,
  .decision-branch-table {
    overflow: visible;
    border: 0;
    background: transparent;
  }

  table.responsive-table,
  .trade-open-table table.responsive-table,
  .decision-branch-table table.responsive-table {
    display: block;
    width: 100%;
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 12px;
  }

  table.responsive-table thead {
    display: none;
  }

  table.responsive-table tbody {
    display: grid;
    gap: 8px;
  }

  table.responsive-table tr {
    display: grid;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  }

  table.responsive-table tr.external-broker-row,
  .external-risk-table table.responsive-table tr {
    border-color: #fde68a;
    background: #fffbeb;
  }

  table.responsive-table tr.position-close-pending {
    opacity: 0.72;
  }

  table.responsive-table td {
    display: grid;
    grid-template-columns: minmax(92px, 0.38fr) minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    min-height: 38px;
    padding: 8px 10px;
    border-bottom: 1px solid #eef2f7;
    color: #1f2937;
    line-height: 1.3;
    text-align: right;
    white-space: normal;
  }

  table.responsive-table td:last-child {
    border-bottom: 0;
  }

  table.responsive-table td::before {
    content: attr(data-label);
    min-width: 0;
    color: #64748b;
    font-size: 10px;
    font-weight: 950;
    letter-spacing: 0;
    line-height: 1.2;
    text-align: left;
    text-transform: uppercase;
  }

  table.responsive-table td > * {
    justify-self: end;
    max-width: 100%;
  }

  table.responsive-table td .btn,
  table.responsive-table td button {
    width: 100%;
  }

  .trade-action-cell,
  .trade-action-cell.compact {
    width: 100%;
    min-width: 0;
  }

  .close-fee-preview {
    text-align: right;
  }

  .decision-lens {
    gap: 10px;
  }

  .decision-detail {
    padding: 10px;
  }

  .decision-price-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .decision-price-tile {
    padding: 10px;
  }

  .decision-price-tile strong {
    font-size: 15px;
  }

  .decision-grid-table {
    min-width: 560px;
  }

  .decision-grid-head,
  .decision-ticker-row {
    grid-template-columns: 92px 48px 88px 178px 106px;
  }

  .decision-branch-table table.responsive-table td {
    text-align: left;
  }

  .workspace-bottom-dock {
    bottom: calc(76px + env(safe-area-inset-bottom));
  }

  .manual-close-dialog {
    padding: 12px;
  }

  .manual-close-panel {
    max-height: calc(100vh - 24px);
    border-radius: 10px;
  }
}

@media (max-width: 640px) {
  .audit-list-rich {
    gap: 9px;
  }

  .audit-rich {
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 9px;
    padding: 10px;
  }

  .audit-symbol {
    min-height: 38px;
    border-radius: 7px;
  }

  .audit-symbol strong {
    font-size: 13px;
  }

  .audit-symbol span {
    font-size: 10px;
  }

  .audit-head {
    display: grid;
    gap: 8px;
  }

  .audit-badges {
    justify-content: flex-start;
  }

  .audit-level,
  .audit-kind-label,
  .audit-scope {
    min-height: 22px;
    padding: 3px 7px;
    font-size: 10px;
  }

  .audit-code-row {
    gap: 4px;
  }
}

@media (max-width: 1450px) {
  .state-explorer-layout {
    grid-template-columns: 1fr;
  }

  .state-strategy-picker {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: 320px;
    padding-right: 0;
  }

  .strategy-node-grid,
  .system-pipeline-grid {
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  }

  .state-ticker-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .state-explorer-toolbar,
  .state-summary-strip,
  .state-focus-metrics {
    grid-template-columns: 1fr;
  }

  .state-strategy-picker {
    grid-template-columns: 1fr;
    max-height: 360px;
  }

  .state-strategy-option {
    grid-template-columns: 34px minmax(0, 1fr);
    padding: 9px;
  }

  .state-focus-card {
    padding: 10px;
    border-radius: 8px;
  }

  .state-focus-head {
    display: grid;
  }

  .state-focus-head h3 {
    font-size: 18px;
  }

  .state-focus-badges {
    justify-content: flex-start;
  }

  .state-node-grid,
  .strategy-node-grid,
  .system-pipeline-grid,
  .state-ticker-grid {
    grid-template-columns: 1fr;
  }

  .state-node {
    min-height: 0;
    grid-template-columns: 36px minmax(0, 1fr);
    padding: 10px;
  }

  .state-node-symbol {
    width: 32px;
    height: 32px;
    font-size: 10px;
  }

  .state-ticker-grid {
    max-height: none;
    overflow: visible;
  }

  .state-ticker-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .state-scanner-table {
    min-width: 0;
  }

  .state-table-section table {
    width: 100%;
  }

  .state-reason-cell {
    max-width: 100%;
  }
}


/* keep wide settings tables/cards on screen */
.client-account-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.credential-preflight { overflow-x: auto; }
@media (max-width: 1500px) {
  .credential-preflight > div[style*="grid-template-columns"] { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)) !important; }
}

/* Deep-analysis: results-history (equity) + per-coin P/L panels ($10k reference) */
.strategy-results-panel canvas {
  width: 100%;
  display: block;
}
.results-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 4px 0 10px;
}
.results-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.results-stat-k {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted, #6b7280);
}
.results-stat-v {
  font-size: 15px;
  font-weight: 600;
}
.results-empty {
  color: var(--muted, #6b7280);
  font-size: 13px;
}
.data-fresh {
  display: inline-block;
  margin-left: 8px;
  font-size: 12px;
  color: var(--muted, #6b7280);
  white-space: nowrap;
}
.data-fresh.stale {
  color: #d97706;
  font-weight: 600;
}
.ticker-pnl-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.ticker-pnl-table th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted, #6b7280);
  padding: 4px 12px 4px 0;
  font-weight: 600;
}
.ticker-pnl-table td {
  padding: 5px 12px 5px 0;
  border-top: 1px solid var(--border, #e5e7eb);
}
.ticker-pnl-table td.tk {
  font-weight: 600;
}

/* External / journal-gap position source cell: separate a lost-ledger BOT trade
   (recoverable, its P/L is being wrongly excluded) from a true manual position. */
.external-source-cell { display: flex; flex-direction: column; gap: 2px; max-width: 320px; }
.external-source-cell.is-bot > strong { color: #b45309; }
.external-source-cell.is-external > strong { color: var(--muted, #6b7280); }
.external-source-note { font-size: 11px; color: var(--muted, #6b7280); font-style: normal; }
.external-source-pnl { font-size: 12px; font-weight: 600; }
.external-source-pnl.positive { color: #059669; }
.external-source-pnl.negative { color: #dc2626; }
.external-source-ids, .external-source-qty { font-size: 11px; color: var(--muted, #6b7280); }
.external-risk-table tr:has(.external-source-cell.is-bot) { background: rgba(180, 83, 9, 0.06); }
.recovery-pending-note {
  margin: 4px 0 0;
  font-size: 12px;
  font-weight: 600;
  color: #b45309;
  background: rgba(180, 83, 9, 0.08);
  border-radius: 6px;
  padding: 4px 8px;
}

/* Live-stream staleness cue: dashboard numbers dim + amber edge when the summary
   feed has gone quiet (socket dropped AND polling fallback has not refreshed). */
.portfolio-grid.stream-stale {
  position: relative;
  opacity: 0.55;
  transition: opacity 0.2s ease;
  outline: 2px solid #d97706;
  outline-offset: 2px;
  border-radius: 10px;
}
.portfolio-grid.stream-stale::after {
  content: "устаревшие данные · переподключение…";
  position: absolute;
  top: -10px;
  right: 8px;
  font-size: 11px;
  font-weight: 600;
  color: #d97706;
  background: var(--bg, #fff);
  padding: 0 6px;
}
.portfolio-grid .stat-tile.metric-partial .metric-label {
  color: #d97706;
}
.portfolio-grid .stat-tile.metric-partial .metric-value {
  opacity: 0.7;
}

/* --- Давыдов: прогрессивное плечо (ТЗ §9) --- */
.davydov-ladder-panel {
  margin: 12px 0;
  padding: 14px 16px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 12px;
  background: var(--panel, rgba(148, 163, 184, 0.06));
  display: grid;
  gap: 12px;
}
.davydov-ladder-title { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.davydov-ladder-title em { font-size: 12px; color: var(--muted, #6b7280); font-style: normal; }
.davydov-ladder-card {
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 10px;
  padding: 12px 14px;
  display: grid;
  gap: 8px;
}
.davydov-ladder-card.is-mixed { border-color: #d97706; }
.davydov-ladder-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.davydov-ladder-head span { display: block; font-size: 12px; color: var(--muted, #6b7280); }
.davydov-level-chips { display: flex; align-items: center; gap: 6px; }
.davydov-level-chip {
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid var(--border, #e5e7eb);
  font-size: 12px;
  color: var(--muted, #6b7280);
}
.davydov-level-chip.active {
  border-color: #2563eb;
  color: #2563eb;
  font-weight: 700;
}
.davydov-level-sep { color: var(--muted, #9ca3af); font-size: 12px; }
.davydov-load-row { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; color: var(--muted, #6b7280); flex-wrap: wrap; }
.davydov-load-row .ok { color: #059669; }
.davydov-load-row .warn { color: #d97706; }
.davydov-load-bar { position: relative; height: 10px; border-radius: 999px; background: rgba(148, 163, 184, 0.25); overflow: hidden; }
.davydov-load-bar .fill { height: 100%; border-radius: 999px; background: #059669; transition: width 0.4s ease; }
.davydov-load-bar .fill.warn { background: #d97706; }
.davydov-load-bar .mark { position: absolute; top: -2px; bottom: -2px; width: 2px; }
.davydov-load-bar .mark.up { background: #dc2626; }
.davydov-load-bar .mark.down { background: #2563eb; }
.davydov-ladder-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 4px 16px; font-size: 12px; color: var(--muted, #6b7280); }
.davydov-ladder-grid strong { color: inherit; }
.davydov-ladder-grid .warn, .davydov-ladder-grid em.warn { color: #d97706; font-style: normal; }
.davydov-ladder-grid .ok { color: #059669; }
.davydov-mixed-list { display: flex; flex-wrap: wrap; gap: 6px; font-size: 12px; }
.davydov-mixed-list .ok { color: #059669; }
.davydov-mixed-list .warn { color: #d97706; font-weight: 600; }
.davydov-history { display: grid; gap: 2px; font-size: 11px; color: var(--muted, #6b7280); }

/* The registry is the primary strategy surface. It owns the full content width and
   uses page scrolling; nested table scrollbars hide status reasons and actions. */
.strategy-command-layout {
  grid-template-columns: minmax(0, 1fr);
}

.strategy-fleet-registry {
  order: 1;
}

.strategy-selected-panel {
  order: 2;
}

.strategy-fleet-table {
  max-height: none;
  overflow: visible;
}

.strategy-fleet-row {
  min-width: 0;
  grid-template-columns:
    minmax(112px, 1.18fr)
    minmax(72px, 0.72fr)
    minmax(82px, 0.78fr)
    minmax(82px, 0.78fr)
    minmax(108px, 1fr)
    minmax(118px, 1.04fr)
    minmax(136px, 1.2fr);
}

@media (max-width: 980px) {
  .strategy-fleet-row.fleet-header {
    display: none;
  }

  .strategy-fleet-row:not(.fleet-header) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    overflow: hidden;
  }

  .strategy-fleet-row:not(.fleet-header) .strategy-fleet-cell {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4px;
    min-height: 58px;
    padding: 8px;
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.72);
  }

  .strategy-fleet-row:not(.fleet-header) .strategy-fleet-cell[data-label]::before {
    content: attr(data-label);
    color: #64748b;
    font-size: 10px;
    font-weight: 950;
    line-height: 1.2;
    text-transform: uppercase;
  }

  .strategy-fleet-row:not(.fleet-header) .strategy-name-cell,
  .strategy-fleet-row:not(.fleet-header) .action-cell {
    grid-column: 1 / -1;
  }

  .strategy-fleet-row:not(.fleet-header) .action-cell .btn {
    width: 100%;
  }
}

@media (max-width: 560px) {
  .strategy-fleet-row:not(.fleet-header) {
    grid-template-columns: minmax(0, 1fr);
  }

  .strategy-fleet-row:not(.fleet-header) .strategy-name-cell,
  .strategy-fleet-row:not(.fleet-header) .action-cell {
    grid-column: 1;
  }
}

/* Plain-language mode keeps the operational facts and removes repeated guidance. */
.compact-ui .top-action.icon-action {
  display: inline-grid;
  place-items: center;
  width: 34px;
  min-width: 34px;
  padding: 0;
  font-size: 15px;
  line-height: 1;
}

.compact-ui .top-action.icon-action.wide {
  width: 62px;
  min-width: 62px;
  font-size: 12px;
}

.compact-ui .last-triggered span,
.compact-ui .navigator-status-grid,
.compact-ui .panel-head > div > .text-link,
.compact-ui .panel-head > .text-link:not(#controlGeneratedAt),
.compact-ui .capital-card > p,
.compact-ui .capital-card > em,
.compact-ui .credential-preflight-head span:empty {
  display: none;
}

.compact-ui #controlPipeline,
.compact-ui #operatorPulse,
.compact-ui #operatorCommandGrid,
.compact-ui #operatorInfoMap,
.compact-ui #streamingStatusPanel,
.compact-ui #controlView .control-snapshot-grid,
.compact-ui #controlView .strategy-accounting-panel,
.compact-ui #controlView .strategy-focus-panel {
  display: none;
}

.compact-ui .last-triggered {
  min-width: 58px;
}

.compact-ui .navigator-head {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  padding: 9px 10px;
}

.compact-ui .navigator-head em {
  font-size: 10px;
  white-space: nowrap;
}

.compact-ui .navigator-primary a {
  grid-template-columns: minmax(0, 1fr);
  min-height: 34px;
  padding-block: 6px;
}

.compact-ui .strategy-fleet-head {
  align-items: center;
}

.compact-ui .strategy-fleet-head > div {
  display: contents;
}

.compact-ui .icon-inline-action {
  width: 28px;
  min-width: 28px;
  min-height: 28px;
  padding: 0;
  font-size: 15px;
}

.compact-ui .screen-audit-compact {
  display: flex;
  align-items: center;
  gap: 8px;
  width: max-content;
  margin: 0 0 8px;
  padding: 5px 9px;
  border: 1px solid #86efac;
  border-radius: 6px;
  background: #f0fdf4;
  color: #047857;
  font-size: 11px;
  font-weight: 900;
}

.compact-ui .settings-raw-config summary {
  cursor: pointer;
  color: #475569;
  font-size: 12px;
  font-weight: 900;
}

.compact-ui .settings-raw-config[open] summary {
  margin-bottom: 10px;
}

.compact-ui .trade-section-head em {
  max-width: 52%;
  text-align: right;
}

@media (max-width: 760px) {
  .compact-ui .top-action.icon-action.wide {
    width: 48px;
    min-width: 48px;
  }

  .compact-ui .trade-section-head em {
    max-width: none;
    text-align: left;
  }
}
