/* Restore Painter Pro to the shared WBE estimate rail contract. The rail is
   intentionally composed from the same Current Item / Current Service /
   Whole Proposal structure used by the approved service builders. */
.painting-shared-reference-rail {
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  overflow-x: hidden !important;
}

.painting-shared-reference-rail > .painting-shared-service-rail {
  width: 100%;
  min-width: 0;
}

.painting-shared-reference-rail .painting-shared-rail-footer {
  display: grid;
  gap: 10px;
  margin: 0 !important;
  padding: 12px !important;
  border: 0 !important;
  border-top: 1px solid rgba(89, 128, 156, 0.44) !important;
  border-radius: 0 !important;
  background: #071521 !important;
  box-shadow: none !important;
}

.painting-shared-reference-rail .painting-shared-rail-footer .summary-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}

.painting-shared-reference-rail .painting-shared-rail-footer .summary-actions :is(button, a) {
  width: 100%;
  min-width: 0;
  justify-content: center;
}

.painting-shared-reference-rail .painting-shared-budget > .painting-financials {
  margin: 0 10px 10px !important;
  padding: 10px !important;
  border-color: rgba(89, 128, 156, 0.42) !important;
  border-radius: 10px !important;
}

.painting-shared-reference-rail .painting-shared-budget > .painting-financials > header {
  display: none !important;
}

.painting-shared-reference-rail .hgc-shared-service-rail details > summary {
  cursor: pointer;
}

@media (min-width: 1321px) {
  .proposal-section-shell:has(.painting-module-shell) .pe-layout,
  .painting-proposal-flow > .pe-layout:has(.painting-module-shell) {
    grid-template-columns: minmax(0, 1fr) clamp(320px, 20vw, 360px) !important;
  }
}

@media (min-width: 761px) {
  .painting-shared-reference-rail .painting-financial-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }

  .painting-shared-reference-rail .painting-financial-grid > label,
  .painting-shared-reference-rail .painting-financial-grid > div {
    grid-template-columns: 30px minmax(0, 1fr) 74px !important;
    grid-template-rows: 1fr !important;
    align-items: center !important;
    gap: 7px !important;
    min-height: 54px !important;
    padding: 8px !important;
  }

  .painting-shared-reference-rail .painting-financial-grid > label:is(.labor, .materials) {
    grid-template-columns: 30px minmax(0, 1fr) 74px !important;
  }

  .painting-shared-reference-rail .painting-financial-grid > label:is(.labor, .materials) input[data-paint-cost],
  .painting-shared-reference-rail .painting-financial-grid :is(input, strong) {
    width: 74px !important;
    min-width: 0 !important;
    max-width: 74px !important;
    justify-self: end !important;
  }
}

@media (max-width: 760px) {
  .painting-shared-reference-rail .painting-financial-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}
