/* COFIRING DETAIL COMPACT V2
   Visual-only override for the expanded calculation tables.
   Loaded after the existing co-firing styles so the detail grid stays compact and readable.
*/

.cofiring-period-v5 .cfv52-detail .cfv5-section-label {
  margin: 9px 8px 5px !important;
  font-size: 11px !important;
  line-height: 1.25 !important;
}

.cofiring-period-v5 .cfv52-detail .cfv5-table-scroll {
  max-width: calc(100% - 16px) !important;
  margin: 0 8px 10px !important;
  border-radius: 6px !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  scrollbar-gutter: stable;
}

.cofiring-period-v5 .cfv52-detail .cfv5-grid {
  width: 100% !important;
  min-width: 1180px !important;
  table-layout: auto !important;
  font-size: 10px !important;
}

.cofiring-period-v5 .cfv52-detail .cfv5-grid th,
.cofiring-period-v5 .cfv52-detail .cfv5-grid td {
  height: auto !important;
  padding: 5px 6px !important;
  line-height: 1.25 !important;
  vertical-align: middle !important;
}

.cofiring-period-v5 .cfv52-detail .cfv5-grid thead th {
  padding: 5px 4px !important;
  white-space: normal !important;
  word-break: keep-all !important;
  overflow-wrap: normal !important;
  line-height: 1.2 !important;
}

.cofiring-period-v5 .cfv52-detail .cfv5-grid thead tr:first-child th {
  padding-top: 6px !important;
  padding-bottom: 6px !important;
  font-size: 11px !important;
}

.cofiring-period-v5 .cfv52-detail .cfv5-grid thead tr:nth-child(2) th {
  font-size: 10px !important;
}

.cofiring-period-v5 .cfv52-detail .cfv5-grid thead tr:nth-child(3) th {
  padding-top: 3px !important;
  padding-bottom: 3px !important;
  font-size: 9px !important;
  color: #738695 !important;
}

.cofiring-period-v5 .cfv52-detail .cfv5-grid tbody tr {
  height: 46px !important;
}

.cofiring-period-v5 .cfv52-detail .cfv5-grid tbody th,
.cofiring-period-v5 .cfv52-detail .cfv5-grid tbody td {
  white-space: nowrap !important;
  font-size: 10px !important;
}

.cofiring-period-v5 .cfv52-detail .cfv5-grid tr > :first-child {
  width: 54px !important;
  min-width: 54px !important;
  text-align: center !important;
}

/* Ordinary two-value groups: keep period/average readable without wasting width. */
.cofiring-period-v5 .cfv52-detail .cfv5-grid thead tr:nth-child(2) > th[colspan="2"] {
  min-width: 118px !important;
}

/* Factor/heat columns need less space than measured/actual groups. */
.cofiring-period-v5 .cfv52-detail .cfv5-grid thead tr:nth-child(2) > th[rowspan="2"]:not(:nth-last-child(-n+2)) {
  min-width: 68px !important;
}

/* The right-most result block is protected from the old squeezed/vertical wrapping. */
.cofiring-period-v5 .cfv52-detail .cfv5-grid .cfv5-head-ratio {
  min-width: 216px !important;
  white-space: nowrap !important;
}

.cofiring-period-v5 .cfv52-detail .cfv5-grid thead tr:nth-child(2) > th:nth-last-child(-n+2) {
  width: 108px !important;
  min-width: 108px !important;
  padding-left: 6px !important;
  padding-right: 6px !important;
  white-space: normal !important;
  word-break: keep-all !important;
  overflow-wrap: normal !important;
  text-align: center !important;
  background: #eef6f6 !important;
}

.cofiring-period-v5 .cfv52-detail .cfv5-grid thead tr:nth-child(2) > th:nth-last-child(-n+2) small {
  display: inline-block !important;
  white-space: nowrap !important;
  font-size: 8px !important;
  line-height: 1.15 !important;
}

.cofiring-period-v5 .cfv52-detail .cfv5-grid tbody tr > :nth-last-child(-n+2) {
  width: 108px !important;
  min-width: 108px !important;
  text-align: center !important;
  background: #f7fbfb !important;
}

/* Keep the totals row compact but visually separated. */
.cofiring-period-v5 .cfv52-detail .cfv5-grid .cfv5-sum th,
.cofiring-period-v5 .cfv52-detail .cfv5-grid .cfv5-sum td {
  padding-top: 6px !important;
  padding-bottom: 6px !important;
}

/* Smaller screens scroll inside the table instead of compressing columns. */
@media (max-width: 1250px) {
  .cofiring-period-v5 .cfv52-detail .cfv5-grid {
    min-width: 1160px !important;
  }
}