.emaCrossPanel {
  margin-bottom: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.emaCrossHeader {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 14px;
}

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

.emaCrossHeaderActions {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.emaCrossHeaderActions label {
  min-width: 180px;
  margin: 0;
}

.emaCrossBadge {
  display: inline-block;
  margin-bottom: 5px;
  color: var(--green);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

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

.emaCrossSummary > div {
  min-width: 0;
  padding: 11px 12px;
  border-right: 1px solid var(--line);
}

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

.emaCrossSummary span,
.emaCrossState span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.emaCrossSummary strong,
.emaCrossState strong {
  display: block;
  margin-top: 5px;
  overflow-wrap: anywhere;
  font-size: 18px;
}

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

.emaCrossState > div {
  min-width: 0;
  min-height: 70px;
  padding: 11px 12px;
  border-right: 1px solid var(--line);
}

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

.emaCrossState strong {
  font-size: 13px;
  line-height: 1.35;
}

.emaCrossRiskControls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.emaCrossRiskControls label {
  margin: 0;
}

.emaCrossComparison {
  border-bottom: 1px solid var(--line);
}

.emaCrossComparisonHeader,
.emaCrossTableHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.emaCrossComparisonHeader {
  padding: 12px 14px;
  background: #f9fbfa;
}

.emaCrossComparisonHeader span,
.emaCrossTableHeader span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.emaCrossComparisonHeader > strong {
  max-width: 340px;
  text-align: right;
}

.emaCrossComparisonWrap {
  overflow-x: auto;
}

.emaCrossComparisonTable {
  min-width: 1160px;
  font-size: 12px;
}

.emaCrossComparisonTable th:nth-child(n + 3),
.emaCrossComparisonTable td:nth-child(n + 3) {
  text-align: right;
}

.emaCrossComparisonTable tbody tr:last-child td {
  border-bottom: 0;
}

.emaCrossComparisonTable .emaCrossCurrentPlan td:first-child,
.emaCrossComparisonTable .emaCrossTightPlan td:first-child,
.emaCrossComparisonTable .emaCrossRiskPlan td:first-child {
  font-weight: 700;
}

.emaCrossComparisonTable .emaCrossTightPlan,
.emaCrossComparisonTable .emaCrossRiskPlan {
  background: #f4faf7;
}

.emaCrossGuard {
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.emaCrossGuardHeader,
.emaCrossGuardTableHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
}

.emaCrossGuardHeader {
  align-items: flex-end;
  background: #f9fbfa;
}

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

.emaCrossGuardHeader > strong {
  min-width: 150px;
  text-align: right;
}

.emaCrossGuardSummary,
.emaCrossGuardRules {
  display: grid;
  border-top: 1px solid var(--line);
}

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

.emaCrossGuardRules {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  background: #f9fbfa;
}

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

.emaCrossGuardSummary > div:last-child,
.emaCrossGuardRules > div:last-child {
  border-right: 0;
}

.emaCrossGuardSummary span,
.emaCrossGuardRules span {
  display: block;
  color: var(--muted);
  font-size: 10px;
}

.emaCrossGuardSummary strong,
.emaCrossGuardRules strong {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
  font-size: 13px;
}

.emaCrossGuardReady,
.emaCrossGuardAccepted {
  color: var(--green);
}

.emaCrossGuardLocked,
.emaCrossGuardBlocked {
  color: #aa5d00;
}

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

.emaCrossGuardTableHeader span {
  color: var(--muted);
  font-size: 11px;
  text-align: right;
}

.emaCrossGuardTableWrap {
  max-height: 430px;
  overflow: auto;
}

.emaCrossGuardTable {
  min-width: 1120px;
  font-size: 12px;
}

.emaCrossGuardTable th:nth-child(n + 4):nth-child(-n + 9),
.emaCrossGuardTable td:nth-child(n + 4):nth-child(-n + 9) {
  text-align: right;
}

.emaCrossGuardTable tbody tr:last-child td {
  border-bottom: 0;
}

.emaCrossGuardTable thead th {
  position: sticky;
  z-index: 1;
  top: 0;
  background: #fff;
}

.emaCrossChartHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px 0;
}

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

.emaCrossCanvasWrap {
  padding: 8px 14px 14px;
}

#emaCrossChart {
  display: block;
  width: 100%;
  height: 380px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.emaCrossTableHeader {
  padding: 13px 14px;
  border-top: 1px solid var(--line);
}

.emaCrossTableHeader > div {
  text-align: right;
}

.emaCrossTableHeader strong {
  display: block;
  margin-top: 3px;
  font-size: 17px;
}

.emaCrossTableWrap {
  overflow-x: auto;
}

.emaCrossTable {
  min-width: 1450px;
  font-size: 12px;
}

.emaCrossTable th:nth-child(n + 5):nth-child(-n + 7),
.emaCrossTable td:nth-child(n + 5):nth-child(-n + 7),
.emaCrossTable th:nth-child(9),
.emaCrossTable td:nth-child(9) {
  text-align: right;
}

.emaCrossTable th:nth-child(n + 8):nth-child(-n + 11),
.emaCrossTable td:nth-child(n + 8):nth-child(-n + 11) {
  white-space: nowrap;
}

.emaCrossTable .emaCrossEmpty {
  padding: 24px 12px;
  color: var(--muted);
  text-align: center;
}

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

.emaCrossPe {
  color: var(--blue);
  font-weight: 700;
}

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

  .emaCrossHeaderActions {
    align-items: stretch;
  }

  .emaCrossHeaderActions label {
    flex: 1 1 auto;
    min-width: 0;
  }

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

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

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

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

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

  .emaCrossGuardSummary > div:nth-child(3n) {
    border-right: 0;
  }

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

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

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

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

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

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

  #emaCrossChart {
    height: 320px;
  }

  .emaCrossComparisonHeader,
  .emaCrossTableHeader {
    align-items: flex-start;
  }
}

@media (max-width: 560px) {
  .emaCrossHeaderActions,
  .emaCrossRiskControls {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .emaCrossHeaderActions button {
    width: 100%;
  }

  .emaCrossRiskControls {
    display: grid;
  }

  .emaCrossComparisonHeader {
    flex-direction: column;
  }

  .emaCrossGuardHeader,
  .emaCrossGuardTableHeader {
    align-items: flex-start;
    flex-direction: column;
  }

  .emaCrossGuardHeader > strong,
  .emaCrossGuardTableHeader span {
    min-width: 0;
    text-align: left;
  }

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

  .emaCrossGuardSummary > div:nth-child(3n) {
    border-right: 1px solid var(--line);
  }

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

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

  .emaCrossComparisonHeader > strong {
    max-width: none;
    text-align: left;
  }
}
