.overnightCarryPanel {
  scroll-margin-top: 56px;
  border-top: 2px solid #314d49;
  background: #fbfcfc;
}

.overnightCarryHeader {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 15px 18px;
  border-bottom: 1px solid #d7dfdc;
}

.overnightCarryTitleRow,
.overnightCarryActions,
.overnightCarryLegend {
  display: flex;
  align-items: center;
  gap: 9px;
}

.overnightCarryHeader h3,
.overnightCarryChartHeader h4,
.overnightCarryTableBlock h4 {
  margin: 0;
}

.overnightCarryHeader h3 {
  font-size: 17px;
}

.overnightCarryHeader p {
  margin: 5px 0 0;
  color: #65716e;
  font-size: 13px;
}

.overnightCarryBadge {
  padding: 3px 7px;
  border: 1px solid #b06b1e;
  background: #fff8ec;
  color: #7d4a0d;
  font-size: 11px;
  font-weight: 700;
}

.overnightCarryActions label {
  color: #65716e;
  font-size: 12px;
  font-weight: 700;
}

.overnightCarryActions select,
.overnightCarryActions button {
  min-height: 34px;
  border: 1px solid #c9d3cf;
  border-radius: 4px;
  background: #fff;
  color: #202725;
}

.overnightCarryActions select {
  min-width: 110px;
  padding: 0 30px 0 9px;
}

.overnightCarryActions button {
  padding: 0 12px;
  cursor: pointer;
}

.overnightCarryEquation {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px minmax(0, 1fr) 34px minmax(0, 1fr);
  align-items: stretch;
  border-bottom: 1px solid #cbd8d3;
  background: #f6faf8;
}

.overnightCarryEquation > div {
  min-width: 0;
  padding: 14px 16px;
}

.overnightCarryEquation > b {
  display: grid;
  place-items: center;
  color: #65716e;
  font-size: 19px;
}

.overnightCarryEquation span,
.overnightCarryEquation small {
  display: block;
  color: #65716e;
  font-size: 11px;
}

.overnightCarryEquation strong {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
  font-size: 20px;
}

.overnightCarryEquation small {
  margin-top: 3px;
}

.overnightCarryAdjusted {
  border-left: 2px solid #16836a;
  background: #edf8f4;
}

.overnightCarryMatched {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 8px 16px;
  border-bottom: 1px solid #d7dfdc;
  background: #fff;
  font-size: 12px;
}

.overnightCarryMatched span:first-child {
  margin-right: auto;
  color: #65716e;
  font-weight: 700;
}

.overnightCarrySummary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border-bottom: 1px solid #d7dfdc;
  background: #fff;
}

.overnightCarrySummary > div,
.overnightCarryRegimes > div {
  min-width: 0;
  padding: 12px 14px;
  border-right: 1px solid #d7dfdc;
}

.overnightCarrySummary > div:last-child,
.overnightCarryRegimes > div:last-child {
  border-right: 0;
}

.overnightCarrySummary span,
.overnightCarryRegimes span,
.overnightCarryRegimes small {
  display: block;
  color: #65716e;
  font-size: 11px;
}

.overnightCarrySummary strong,
.overnightCarryRegimes strong {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
  font-size: 15px;
}

.overnightCarryRegimes {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid #d7dfdc;
  background: #f7f9f8;
}

.overnightCarryRegimes small {
  margin-top: 3px;
}

.overnightCarryBody {
  min-width: 0;
}

.overnightCarryChartBlock {
  padding: 13px 14px 8px;
  border-bottom: 1px solid #d7dfdc;
  background: #fff;
}

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

.overnightCarryChartHeader h4,
.overnightCarryTableBlock h4 {
  font-size: 14px;
}

.overnightCarryLegend span {
  position: relative;
  padding-left: 13px;
  color: #596561;
  font-size: 11px;
}

.overnightCarryLegend span::before {
  position: absolute;
  top: 3px;
  left: 0;
  width: 8px;
  height: 8px;
  content: "";
}

.overnightCarryLegend .theta::before { background: #14866d; }
.overnightCarryLegend .gap::before { background: #d14d45; }
.overnightCarryLegend .iv::before { background: #d18a24; }
.overnightCarryLegend .net::before { background: #303a38; }

#overnightCarryChart {
  display: block;
  width: 100%;
  height: 270px;
  background: #fff;
}

.overnightCarryTableBlock {
  min-width: 0;
  overflow-x: auto;
  background: #fff;
}

.overnightCarryTableBlock h4 {
  padding: 12px 14px;
  border-bottom: 1px solid #e6ebe9;
}

.overnightCarryTable {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.overnightCarryTable th,
.overnightCarryTable td {
  padding: 8px 9px;
  border-bottom: 1px solid #e6ebe9;
  text-align: left;
  white-space: nowrap;
}

.overnightCarryTable th {
  position: sticky;
  top: 0;
  background: #f7f9f8;
  color: #596561;
  font-size: 11px;
}

.overnightCarryPanel .positive { color: #087f5b; }
.overnightCarryPanel .negative { color: #c63f3f; }
.overnightCarryPanel .muted { color: #65716e; }
.overnightCarryPanel .gapUp { color: #a64e1d; font-weight: 700; }
.overnightCarryPanel .gapDown { color: #286e9f; font-weight: 700; }
.overnightCarryPanel .complete { color: #087f5b; }
.overnightCarryPanel .incomplete { color: #b05b19; }

.overnightCarryEmpty {
  height: 58px;
  color: #65716e;
  text-align: center !important;
}

.overnightCarryPanel[data-state="open"] .overnightCarryBadge {
  border-color: #16836a;
  background: #effaf6;
  color: #12614f;
}

.overnightCarryPanel[data-state="error"] .overnightCarryBadge {
  border-color: #c63f3f;
  background: #fff4f4;
  color: #9f2f2f;
}

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

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

@media (max-width: 700px) {
  .overnightCarryHeader,
  .overnightCarryChartHeader {
    align-items: stretch;
    flex-direction: column;
  }

  .overnightCarryActions {
    justify-content: space-between;
  }

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

  .overnightCarryEquation > b {
    min-height: 20px;
  }

  .overnightCarryMatched {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .overnightCarryMatched span:first-child {
    margin-right: 0;
  }

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

  .overnightCarrySummary > div:nth-child(3n) {
    border-right: 1px solid #d7dfdc;
  }

  .overnightCarrySummary > div:nth-child(even),
  .overnightCarryRegimes > div:nth-child(even) {
    border-right: 0;
  }

  #overnightCarryChart {
    height: 230px;
  }
}
