:root {
  color-scheme: light;
  --bg: #f4f7f6;
  --ink: #17211f;
  --muted: #65716e;
  --line: #dbe3e0;
  --panel: #ffffff;
  --green: #12805c;
  --red: #c43d3d;
  --blue: #2367c9;
  --amber: #b7791f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
}

button,
input,
select {
  font: inherit;
}

.app {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 18px;
}

.topbar,
.metrics,
.moduleNav,
.decisionCenter,
.workspace,
.systemStatusPanel,
.chainPanel,
.performancePanel,
.logPanel {
  margin-bottom: 14px;
}

.collectorPosition {
  border-left: 3px solid var(--blue);
}

.collectorPosition[data-state="healthy"] {
  border-left-color: var(--green);
}

.collectorPosition[data-state="idle"],
.collectorPosition[data-state="not_started"] {
  border-left-color: var(--amber);
}

.collectorPosition[data-state="stale"],
.collectorPosition[data-state="error"] {
  border-left-color: var(--red);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--amber);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 24px;
}

h2 {
  font-size: 16px;
}

.status,
.actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

button {
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 0 14px;
  background: var(--blue);
  color: #fff;
  cursor: pointer;
}

button:hover {
  filter: brightness(0.95);
}

#resetBtn,
#sellBtn {
  background: #fff;
  color: var(--ink);
  border-color: var(--line);
}

#buyBtn {
  background: var(--green);
}

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

.metrics article,
.chartPanel,
.controls,
.systemStatusPanel,
.chainPanel,
.performancePanel,
.logPanel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.metrics article {
  padding: 14px;
}

.metrics span,
.position span,
.priceBox span,
label,
th {
  color: var(--muted);
  font-size: 12px;
}

.metrics strong {
  display: block;
  margin-top: 5px;
  font-size: 22px;
}

.moduleNav {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  gap: 2px;
  overflow-x: auto;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  scrollbar-width: thin;
}

.moduleNav a {
  flex: 0 0 auto;
  min-height: 34px;
  border-radius: 5px;
  padding: 9px 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.moduleNav a:hover,
.moduleNav a:focus-visible {
  background: #eef3f1;
  color: var(--ink);
  outline: none;
}

.decisionCenter {
  overflow: hidden;
  border: 1px solid var(--line);
  border-left: 4px solid var(--amber);
  border-radius: 8px;
  background: var(--panel);
}

.decisionCenter[data-state="candidate"] {
  border-left-color: var(--green);
}

.decisionCenter[data-state="error"] {
  border-left-color: var(--red);
}

.decisionHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 16px;
}

.decisionKicker,
.decisionCell > span,
.decisionFooter span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.decisionHeader h2 {
  margin-top: 4px;
  font-size: 18px;
}

.decisionHeader p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.decisionBadge {
  flex: 0 0 auto;
  border: 1px solid #dfc482;
  border-radius: 4px;
  padding: 7px 9px;
  background: #fff9ea;
  color: #7a5a14;
  font-size: 11px;
  font-weight: 700;
}

.decisionBadge.candidate {
  border-color: #94c7b4;
  background: #edf8f3;
  color: var(--green);
}

.decisionBadge.error {
  border-color: #e2b0b0;
  background: #fff4f4;
  color: var(--red);
}

.decisionGrid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.decisionCell {
  min-width: 0;
  padding: 12px 14px;
  border-right: 1px solid var(--line);
}

.decisionCell:last-child {
  border-right: 0;
}

.decisionCell strong,
.decisionCell small {
  display: block;
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.decisionCell > strong {
  margin-top: 6px;
  font-size: 13px;
}

.decisionCell > small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.evidenceRow {
  margin-top: 7px;
}

.evidenceRow strong {
  margin-bottom: 4px;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.evidenceTrack {
  width: 100%;
  height: 5px;
  overflow: hidden;
  border-radius: 2px;
  background: #e4eae7;
}

.evidenceTrack span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--blue);
  transition: width 180ms ease;
}

.decisionFooter {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0;
  background: #f8faf9;
}

.decisionFooter > div {
  min-width: 0;
  padding: 11px 14px;
}

.decisionFooter > div + div {
  border-left: 1px solid var(--line);
}

.decisionFooter strong {
  display: block;
  margin-top: 5px;
  overflow-wrap: anywhere;
  font-size: 12px;
  line-height: 1.4;
}

.liveGate[data-state="ready"] strong {
  color: var(--green);
}

.liveGate[data-state="blocked"] strong {
  color: var(--red);
}

.liveGate[data-state="holding"] strong {
  color: var(--blue);
}

#tradeWorkspace,
#systemStatusPanel,
#chainPanel,
#shortPremiumPanel,
#equityLabPanel,
#researchPanel,
#tradeLogPanel {
  scroll-margin-top: 58px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  align-items: start;
  gap: 14px;
}

.chartPanel {
  min-width: 0;
  padding: 14px;
}

.chartHeader {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.chartHeader p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.priceBox {
  text-align: right;
}

.priceBox strong {
  display: block;
  margin-top: 4px;
  font-size: 20px;
}

.marketStudyStrip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: stretch;
  margin: 0 -14px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.marketStudyStrip > div,
.marketStudyStrip > p {
  min-width: 0;
  padding: 10px 12px;
  border-right: 1px solid var(--line);
}

.marketStudyStrip > p {
  display: flex;
  align-items: center;
  border-right: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.marketStudyStrip span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
}

.marketStudyStrip strong {
  display: block;
  margin-top: 4px;
  overflow-wrap: normal;
  word-break: normal;
  font-size: 12px;
}

.marketStudyStrip > div:nth-child(n + 5),
.marketStudyStrip > p {
  border-top: 1px solid var(--line);
}

.marketStudyStrip > div:nth-child(4) {
  border-right: 0;
}
.marketStudyStrip strong.trendUp {
  color: var(--green);
}

.marketStudyStrip strong.trendDown,
.marketStudyStrip strong.volatile {
  color: var(--red);
}

.marketStudyStrip strong.sideways,
.marketStudyStrip strong.transition {
  color: var(--amber);
}

.chartToolbar {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  padding: 7px 0;
  color: var(--muted);
  font-size: 12px;
}

.chartViewInfo,
.chartZoomControls {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.chartTimeframe {
  display: block;
  margin: 0;
}

.chartTimeframe select {
  width: 62px;
  min-height: 30px;
  padding: 0 7px;
  font-size: 12px;
  font-weight: 700;
}

.chartZoomControls button {
  width: 32px;
  min-height: 30px;
  padding: 0;
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
  font-size: 18px;
  font-weight: 700;
}

.chartZoomControls .fitButton {
  width: auto;
  padding: 0 10px;
  font-size: 12px;
}

.chartOhlc {
  min-height: 28px;
  padding: 3px 0 7px;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.chartOhlc.bull {
  color: var(--green);
}

.chartOhlc.bear {
  color: var(--red);
}

#chart {
  cursor: crosshair;
  touch-action: pan-y;
}
canvas {
  display: block;
  width: 100%;
  height: 520px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfc;
}

.controls {
  padding: 14px;
}

.controls h2 {
  margin-bottom: 12px;
}

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

.controlFieldGrid label {
  grid-template-rows: minmax(28px, auto) 38px;
  min-width: 0;
  margin: 0;
}

.controlFieldGrid .fullControl {
  grid-column: 1 / -1;
}

.primaryControls {
  margin-bottom: 14px;
}

.controlTabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.controlTabs button {
  min-height: 34px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.controlTabs button:last-child {
  border-right: 0;
}

.controlTabs button.active {
  background: var(--blue);
  color: #fff;
}

.controlTabPanel {
  padding-top: 12px;
}

.controlTabPanel[hidden] {
  display: none;
}

label {
  display: grid;
  gap: 6px;
  margin-bottom: 11px;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 10px;
  background: #fff;
  color: var(--ink);
}

.position {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f9fbfa;
}

.position strong {
  display: block;
  margin-top: 5px;
  line-height: 1.35;
}

.supportResistancePosition small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.35;
}

.systemStatusPanel {
  overflow: hidden;
}

.systemStatusHeader {
  padding: 13px 14px;
}

.systemStatusGrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  border-top: 1px solid var(--line);
  background: var(--line);
}

.systemStatusGrid .position {
  min-width: 0;
  min-height: 86px;
  margin: 0;
  border: 0;
  border-radius: 0;
  padding: 11px 12px;
  background: #f9fbfa;
}

.systemStatusGrid .position strong,
.systemStatusGrid .position small {
  overflow-wrap: anywhere;
}

.systemStatusGrid .position small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.systemStatusGrid .collectorPosition {
  box-shadow: inset 3px 0 var(--blue);
}

.systemStatusGrid .collectorPosition[data-state="healthy"] {
  box-shadow: inset 3px 0 var(--green);
}

.systemStatusGrid .collectorPosition[data-state="idle"],
.systemStatusGrid .collectorPosition[data-state="not_started"] {
  box-shadow: inset 3px 0 var(--amber);
}

.systemStatusGrid .collectorPosition[data-state="stale"],
.systemStatusGrid .collectorPosition[data-state="error"] {
  box-shadow: inset 3px 0 var(--red);
}

.systemStatusGrid .shadowPosition {
  box-shadow: inset 3px 0 var(--blue);
}

.systemStatusGrid .adaptivePosition {
  box-shadow: inset 3px 0 var(--green);
}

.systemStatusGrid .accuracyLabPosition {
  box-shadow: inset 3px 0 var(--amber);
}

.logPanel {
  padding: 14px;
  overflow-x: auto;
}

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

.logHeader p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.dangerAction {
  flex: 0 0 auto;
  background: #fff;
  color: var(--red);
  border-color: #e7baba;
}

.dangerAction:hover:not(:disabled) {
  background: #fff5f5;
}

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

@media (max-width: 620px) {
  .logHeader {
    align-items: stretch;
    flex-direction: column;
  }

  .dangerAction {
    width: 100%;
  }
}

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

th,
td {
  padding: 10px 8px;
  border-top: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

td:last-child {
  white-space: normal;
}

.profit {
  color: var(--green);
  font-weight: 700;
}

.loss {
  color: var(--red);
  font-weight: 700;
}

.sourceAuto,
.sourceManual {
  font-size: 11px;
  font-weight: 700;
}

.sourceAuto {
  color: var(--green);
}

.sourceManual {
  color: var(--amber);
}

.signalStrip {
  display: grid;
  grid-template-columns: 120px minmax(180px, 260px) minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  margin: 0 -14px 12px;
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #f8faf9;
}

.signalPrimary span,
.strengthHeader span {
  color: var(--muted);
  font-size: 12px;
}

.signalPrimary strong {
  display: block;
  margin-top: 5px;
}

.signalBadge {
  width: fit-content;
  border-radius: 4px;
  padding: 5px 8px;
  color: #fff;
  font-size: 15px;
}

.signalBadge.wait {
  background: #65716e;
}

.signalBadge.buy-ce {
  background: var(--green);
}

.signalBadge.buy-pe {
  background: var(--blue);
}

.signalBadge.hold {
  background: #7a5a14;
}

.signalBadge.exit {
  background: var(--red);
}

.strengthHeader {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
}

.strengthMeter {
  height: 7px;
  overflow: hidden;
  background: #dfe6e3;
  border-radius: 3px;
}

.strengthMeter span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--green);
  transition: width 180ms ease;
}

.indicatorStates {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
}

.indicatorStates span {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 5px 7px;
  background: #fff;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.indicatorStates span.pass {
  border-color: #94c7b4;
  background: #edf8f3;
  color: #0b6a49;
}

.indicatorStates span.fail {
  border-color: #e2b0b0;
  background: #fff4f4;
  color: #a52f2f;
}

.indicatorStates span.neutral {
  background: #f5f7f6;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

input:disabled {
  cursor: not-allowed;
  background: #eef2f0;
  color: #65716e;
}
.chainPanel {
  padding: 14px;
}

.chainHeader,
.chainChartHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.chainHeader {
  margin-bottom: 12px;
}

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

.chainSummary {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.chainSummary span,
.chainLegend span {
  color: var(--muted);
  font-size: 12px;
}

.chainSummary strong {
  display: block;
  margin-top: 3px;
  color: var(--ink);
  font-size: 14px;
}

.chainLayout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(340px, 0.65fr);
  gap: 18px;
  align-items: stretch;
}

.chainTableWrap {
  min-width: 0;
  overflow-x: auto;
}

.chainTable {
  min-width: 760px;
  font-size: 12px;
}

.chainTable th,
.chainTable td {
  padding: 8px 7px;
  text-align: right;
}

.chainTable th:nth-child(4),
.chainTable td:nth-child(4),
.chainGroups th {
  text-align: center;
}

.chainGroups th:first-child {
  color: var(--green);
}

.chainGroups th:last-child {
  color: var(--blue);
}

.chainTable tr.atmRow {
  background: #f0f6f3;
}

.chainTable .strikeCell {
  color: var(--ink);
  font-weight: 700;
}

.chainTable .historyCell {
  color: var(--muted);
  font-size: 11px;
}

.chainTable .positive {
  color: var(--green);
  font-weight: 700;
}

.chainTable .negative {
  color: var(--red);
  font-weight: 700;
}

.chainChartArea {
  min-width: 0;
}

.chainChartHeader {
  margin-bottom: 8px;
}

.chainChartHeader h3 {
  margin: 0;
  font-size: 13px;
}

.chainLegend {
  display: flex;
  gap: 12px;
}

.chainLegend span::before {
  display: inline-block;
  width: 16px;
  height: 3px;
  margin-right: 5px;
  vertical-align: middle;
  content: "";
}

.chainLegend .ceLegend::before {
  background: var(--green);
}

.chainLegend .peLegend::before {
  background: var(--blue);
}

#chainChart {
  height: 320px;
}

.srOnly {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.performancePanel {
  padding: 14px;
}

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

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

.performanceTabs {
  display: inline-flex;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.performanceTabs button {
  min-height: 32px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  padding: 0 12px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
}

.performanceTabs button:last-child {
  border-right: 0;
}

.performanceTabs button.active {
  background: var(--blue);
  color: #fff;
}

.performanceSummary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.performanceSummary div {
  padding: 12px;
  border-right: 1px solid var(--line);
}

.performanceSummary div:last-child {
  border-right: 0;
}

.performanceSummary span {
  color: var(--muted);
  font-size: 12px;
}

.performanceSummary strong {
  display: block;
  margin-top: 5px;
  font-size: 18px;
}

.performanceTableWrap {
  overflow-x: auto;
}

.performanceTable {
  min-width: 760px;
  font-size: 12px;
}

.performanceTable th,
.performanceTable td {
  text-align: right;
}

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

.performanceTable .samplePending {
  color: var(--amber);
  font-weight: 700;
}

.performanceTable .sampleReady {
  color: var(--green);
  font-weight: 700;
}

.performanceTable .emptyPerformance {
  padding: 22px 8px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 900px) {
  .topbar,
  .chartHeader {
    align-items: stretch;
    flex-direction: column;
  }

  .workspace,
  .metrics,
  .chainLayout {
    grid-template-columns: 1fr;
  }

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

  .decisionCell:nth-child(2) {
    border-right: 0;
  }

  .decisionCell:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

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

  .chainHeader,
  .performanceHeader {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .performanceSummary div:nth-child(2) {
    border-right: 0;
  }

  .performanceSummary div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  #chainChart {
    height: 280px;
  }

  .priceBox {
    text-align: left;
  }

  canvas {
    height: 380px;
  }

  .signalStrip {
    grid-template-columns: 1fr;
    gap: 10px;
  }

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

  .marketStudyStrip > div:nth-child(2),
  .marketStudyStrip > div:nth-child(4),
  .marketStudyStrip > div:nth-child(6) {
    border-right: 0;
  }

  .marketStudyStrip > p {
    grid-column: 1 / -1;
    border-top: 1px solid var(--line);
  }
}

.streamState {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 5px 7px;
  font-size: 11px;
  font-weight: 700;
}

.streamState.live {
  border-color: #94c7b4;
  background: #edf8f3;
  color: var(--green);
}

.streamState.connecting {
  border-color: #dfc482;
  background: #fff9ea;
  color: #7a5a14;
}

.streamState.rest {
  background: #f5f7f6;
  color: var(--muted);
}

.dualTradeDesk {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 12px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.tradeSide {
  min-width: 0;
  padding: 12px 10px 12px 0;
}

.tradeSide + .tradeSide {
  border-left: 1px solid var(--line);
  padding-right: 0;
  padding-left: 10px;
}

.tradeSideHeader {
  display: flex;
  min-height: 42px;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.tradeSideHeader span,
.sideContract {
  color: var(--muted);
  font-size: 11px;
}

.tradeSideHeader strong {
  text-align: right;
}

.tradeSideHeader b {
  display: block;
  margin-top: 3px;
  font-size: 15px;
}

.sideActions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin: 8px 0 10px;
}

.sideActions button {
  min-width: 0;
  padding: 0 8px;
  font-size: 12px;
}

#buyCeBtn {
  background: var(--green);
}

#buyPeBtn {
  background: var(--blue);
}

#sellCeBtn,
#sellPeBtn {
  border-color: var(--line);
  background: #fff;
  color: var(--red);
}

.sidePosition,
.sideContract {
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.sidePosition {
  min-height: 34px;
  font-size: 12px;
  font-weight: 700;
}

.sideContract {
  min-height: 46px;
  margin-top: 6px;
}

@media (max-width: 1100px) and (min-width: 901px) {
  .metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .decisionHeader {
    align-items: flex-start;
    flex-direction: column;
  }

  .decisionGrid,
  .decisionFooter {
    grid-template-columns: 1fr;
  }

  .decisionCell,
  .decisionCell:nth-child(2) {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .decisionCell:last-child {
    border-bottom: 0;
  }

  .decisionFooter > div + div {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .controlFieldGrid,
  .systemStatusGrid {
    grid-template-columns: 1fr;
  }

  .controlFieldGrid label {
    grid-template-rows: auto 38px;
  }

  .controlFieldGrid .fullControl {
    grid-column: auto;
  }

  .dualTradeDesk {
    grid-template-columns: 1fr;
  }

  .tradeSide,
  .tradeSide + .tradeSide {
    padding: 12px 0;
    border-left: 0;
  }

  .tradeSide + .tradeSide {
    border-top: 1px solid var(--line);
  }
}
