/* Cost breakdown: keep desktop descriptions compact without changing calculations. */
@media (min-width: 1101px) {
  #breakdown-table {
    width: 100%;
    font-size: clamp(10px, .72vw, 12px);
  }

  #breakdown-table tbody {
    display: block;
    width: 100%;
  }

  #breakdown-table tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 148px;
    width: 100%;
  }

  #breakdown-table td {
    padding: 3px 6px;
    vertical-align: middle;
  }

  #breakdown-table td:first-child {
    line-height: 1.32;
    white-space: nowrap;
    word-break: keep-all;
    overflow-wrap: normal;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -.06px;
  }

  #breakdown-table td:last-child {
    width: auto;
    max-width: none;
    min-width: 0;
    padding-left: 6px;
    text-align: right;
  }

  #breakdown-table td[colspan="2"] {
    grid-column: 1 / -1;
    width: auto;
    max-width: none;
  }

  #breakdown-table td:last-child .bk-val-cell {
    width: 100%;
    min-width: 0;
    justify-content: flex-end;
    gap: 5px;
  }

  #breakdown-table td:last-child .custom-waste-wrap {
    width: 52px;
    min-width: 42px;
    max-width: 52px;
    flex: 0 1 52px;
  }

  /* Other charges need a readable free-text hint. Give only this row a wide
     editor while keeping its amount pinned to the far right. */
  #breakdown-table .extra-fee-row {
    grid-template-columns: minmax(110px, 1fr) clamp(320px, 42%, 440px);
  }

  #breakdown-table .extra-fee-row td:last-child .extra-fee-input-wrap {
    width: min(360px, calc(100% - 64px));
    min-width: 230px;
    max-width: 360px;
    flex: 1 1 230px;
  }

  /* The layout headline is descriptive text, not an amount. Keep it out of
     the shared amount column so it cannot push prices beyond the half panel. */
  #breakdown-table tr:has(.layout-row-cell) {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    width: 100%;
  }

  #breakdown-table tr:has(.layout-row-cell) .layout-row-cell {
    width: auto;
    overflow: visible;
    text-overflow: clip;
  }

  #breakdown-table tr:has(.layout-row-cell) td:last-child {
    width: auto;
    max-width: none;
    min-width: 0;
    padding-left: 10px;
    text-align: left;
    overflow: hidden;
  }

  #breakdown-table tr:has(.layout-row-cell) td:last-child .bk-val-cell {
    min-width: 0;
    justify-content: flex-start;
    overflow: hidden;
  }

  #breakdown-table tr:has(.layout-row-cell) td:last-child .bk-val-cell > span:last-child {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #breakdown-table .finish-detail-calc {
    display: inline;
    margin: 0 0 0 6px;
    font-size: inherit;
    line-height: inherit;
    white-space: inherit;
  }

  #breakdown-table .finish-detail-name {
    white-space: nowrap;
  }
}
