.dpc-calculator,
.dpc-calculator * {
  box-sizing: border-box;
}

.dpc-calculator {
  --dpc-ink: #172033;
  --dpc-muted: #526174;
  --dpc-line: #e3e8ef;
  --dpc-surface: #ffffff;
  --dpc-soft: #f5f8fb;
  --dpc-accent: #146452;
  --dpc-accent-strong: #0b4438;
  --dpc-focus: rgba(20, 100, 82, 0.2);
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
  color: var(--dpc-ink);
  font-family: inherit;
}

.dpc-calculator button,
.dpc-calculator input,
.dpc-calculator select,
.dpc-calculator textarea {
  font-family: inherit;
}

.dpc-shell {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid var(--dpc-line);
  border-radius: 18px;
  box-shadow: 0 18px 45px rgba(23, 32, 51, 0.08);
}

.dpc-shell,
.dpc-step,
.dpc-enquiry,
.dpc-area,
.dpc-summary,
.dpc-table-wrap {
  min-width: 0;
  max-width: 100%;
}

.dpc-header {
  padding: 12px 2px 18px;
}

.dpc-eyebrow {
  display: inline-flex;
  padding: 5px 10px;
  border-radius: 999px;
  background: #eaf5f2;
  color: var(--dpc-accent-strong);
  font-size: 13px;
  font-weight: 700;
}

.dpc-header h2,
.dpc-step h3,
.dpc-area h4,
.dpc-enquiry h3 {
  margin: 8px 0;
  color: var(--dpc-ink);
  line-height: 1.18;
}

.dpc-header h2 {
  font-size: clamp(28px, 4vw, 44px);
}

.dpc-header p,
.dpc-step-heading p,
.dpc-area-top p {
  margin: 0;
  color: var(--dpc-muted);
}

.dpc-step,
.dpc-enquiry {
  margin-top: 18px;
  padding: 18px;
  background: var(--dpc-surface);
  border: 1px solid var(--dpc-line);
  border-radius: 14px;
}

.dpc-step .dpc-enquiry {
  margin-top: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.dpc-step-heading,
.dpc-area-top {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.dpc-step-heading {
  justify-content: flex-start;
}

.dpc-step-number {
  display: inline-grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  border-radius: 50%;
  background: var(--dpc-accent);
  color: #fff;
  font-weight: 800;
}

.dpc-grid,
.dpc-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.dpc-grid-postcode {
  align-items: end;
}

.dpc-field {
  display: grid;
  gap: 7px;
  font-weight: 700;
}

.dpc-field span {
  font-size: 14px;
}

.dpc-field input,
.dpc-field select,
.dpc-field textarea {
  width: 100%;
  max-width: 100%;
  min-height: 48px;
  padding: 11px 13px;
  border: 1px solid #ccd5df;
  border-radius: 10px;
  background: #fff;
  color: var(--dpc-ink);
  font: inherit;
}

.dpc-field textarea {
  min-height: 120px;
}

.dpc-field input:focus,
.dpc-field select:focus,
.dpc-field textarea:focus,
.dpc-material-card:focus {
  outline: none;
  border-color: var(--dpc-accent);
  box-shadow: 0 0 0 4px var(--dpc-focus);
}

.dpc-field-full {
  grid-column: 1 / -1;
}

.dpc-distance-status {
  min-height: 48px;
  display: flex;
  align-items: center;
  color: var(--dpc-muted);
  font-weight: 700;
}

.dpc-manual-distance {
  margin-top: 12px;
}

.dpc-area {
  padding: 16px;
  margin-bottom: 14px;
  border: 1px solid var(--dpc-line);
  border-radius: 14px;
  background: var(--dpc-soft);
}

.dpc-material-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.dpc-material-card {
  display: grid;
  gap: 8px;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0;
  min-height: 160px;
  padding: 10px;
  border: 2px solid var(--dpc-line) !important;
  border-radius: 14px !important;
  background: #ffffff !important;
  color: var(--dpc-ink) !important;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(23, 32, 51, 0.06);
  text-decoration: none !important;
  text-shadow: none !important;
  overflow: visible;
}

.dpc-material-card.dpc-selected {
  background: #ffffff !important;
  color: var(--dpc-ink) !important;
  border-color: var(--dpc-accent) !important;
  box-shadow: 0 0 0 4px var(--dpc-focus), 0 12px 24px rgba(23, 32, 51, 0.08) !important;
}

.dpc-material-card:hover {
  background: #ffffff !important;
  color: var(--dpc-ink) !important;
  border-color: var(--dpc-accent) !important;
}

.dpc-material-media {
  display: block;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  border-radius: 10px;
  background: #dde6ee;
}

.dpc-material-media img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.dpc-material-placeholder {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  background: linear-gradient(135deg, #e3e8ef, #cbd7e3);
  color: #475569;
  font-size: 26px;
  font-weight: 900;
}

.dpc-material-name {
  font-weight: 800;
  color: var(--dpc-ink) !important;
  overflow-wrap: anywhere;
}

.dpc-material-description {
  color: #465569 !important;
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
  white-space: normal !important;
  word-break: normal;
}

.dpc-material-price {
  display: none !important;
}

.dpc-material-note {
  margin: 12px 0 0;
  color: #465569;
  font-size: 13px;
  font-weight: 700;
  white-space: normal !important;
}

.dpc-button,
.dpc-icon-button {
  appearance: none;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.dpc-button {
  min-height: 50px;
  padding: 13px 18px;
  border-radius: 12px;
  background: var(--dpc-accent);
  color: #fff;
  box-shadow: 0 12px 22px rgba(23, 107, 91, 0.22);
}

.dpc-button:hover {
  background: var(--dpc-accent-strong);
}

.dpc-button-secondary {
  background: #23324a;
  box-shadow: none;
}

.dpc-icon-button {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #fff;
  color: #b42318;
  border: 1px solid var(--dpc-line);
  font-size: 24px;
  line-height: 1;
}

.dpc-summary-card {
  overflow: hidden;
  border: 1px solid var(--dpc-line);
  border-radius: 14px;
  background: #fff;
}

.dpc-summary-empty {
  display: grid;
  gap: 6px;
  padding: 18px;
  border: 1px dashed #b8c4d2;
  border-radius: 14px;
  background: #f8fafc;
  color: var(--dpc-ink);
}

.dpc-summary-empty strong {
  font-size: 18px;
  line-height: 1.3;
}

.dpc-summary-empty span {
  color: #526174;
  font-weight: 700;
}

/* Fallback for cached older JS that rendered a table summary. */
.dpc-summary table {
  width: 100% !important;
  min-width: 0 !important;
  table-layout: fixed;
  border-collapse: collapse;
}

.dpc-summary table th:nth-child(5):not(:last-child),
.dpc-summary table td:nth-child(5):not(:last-child) {
  display: none !important;
}

.dpc-summary table th,
.dpc-summary table td {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.dpc-summary-list {
  display: grid;
}

.dpc-summary-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr 1fr 0.9fr;
  gap: 0;
  border-bottom: 1px solid var(--dpc-line);
}

.dpc-summary-row > div {
  min-width: 0;
  padding: 14px;
  border-right: 1px solid var(--dpc-line);
}

.dpc-summary-row > div:last-child {
  border-right: 0;
}

.dpc-summary-row span {
  display: block;
  margin-bottom: 6px;
  color: #526174;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.dpc-summary-row strong {
  display: block;
  color: var(--dpc-ink);
  font-size: 15px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.dpc-summary-row small {
  display: block;
  margin-top: 3px;
  color: #526174;
  font-size: 12px;
  font-weight: 700;
}

.dpc-totals {
  display: grid;
  gap: 10px;
  padding: 16px;
  background: #f8fafc;
}

.dpc-totals > div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.dpc-grand-total {
  font-size: 22px;
}

.dpc-form-message {
  color: var(--dpc-muted);
  font-weight: 700;
}

.dpc-disclaimer {
  margin: 10px 0 0;
  padding: 12px 14px;
  border: 1px solid #b9d5f4;
  border-radius: 10px;
  background: #eff7ff;
  color: #17446b;
  font-weight: 700;
}

.dpc-form-message {
  margin-top: 12px;
}

.dpc-form-message-success,
.dpc-form-message-error {
  padding: 14px 16px;
  border-radius: 12px;
  line-height: 1.45;
}

.dpc-form-message-success {
  border: 1px solid #91d5a8;
  background: #ecfdf3;
  color: #065f2b;
}

.dpc-form-message-error {
  border: 1px solid #f2b8b5;
  background: #fff1f0;
  color: #9f1c14;
}

.dpc-hidden {
  display: none !important;
}

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

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

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

@media (max-width: 640px) {
  .dpc-calculator {
    overflow-x: hidden;
  }

  .dpc-shell {
    padding: 10px;
    border-radius: 12px;
  }

  .dpc-step,
  .dpc-enquiry,
  .dpc-area {
    padding: 14px;
    border-radius: 12px;
  }

  .dpc-grid,
  .dpc-form-grid {
    grid-template-columns: 1fr;
  }

  .dpc-material-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .dpc-material-card {
    min-height: 132px;
    padding: 7px;
    border-radius: 12px;
  }

  .dpc-material-media {
    border-radius: 8px;
  }

  .dpc-material-name {
    font-size: 13px;
    line-height: 1.2;
  }

  .dpc-material-description {
    display: none;
  }

  .dpc-step-heading {
    align-items: flex-start;
  }

  .dpc-grand-total {
    font-size: 18px;
  }

  .dpc-totals > div {
    display: grid;
  }

  .dpc-summary-row {
    grid-template-columns: 1fr;
  }

  .dpc-summary-row > div {
    display: grid;
    grid-template-columns: minmax(90px, 42%) minmax(0, 1fr);
    gap: 10px;
    padding: 9px 12px;
    border-right: 0;
    border-bottom: 1px solid var(--dpc-line);
  }

  .dpc-summary-row > div:last-child {
    border-bottom: 0;
  }

  .dpc-summary-row span {
    margin-bottom: 0;
  }

  .dpc-summary table,
  .dpc-summary thead,
  .dpc-summary tbody,
  .dpc-summary tr,
  .dpc-summary th,
  .dpc-summary td {
    display: block;
    width: 100% !important;
    min-width: 0 !important;
  }

  .dpc-summary thead {
    position: absolute;
    width: 1px !important;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .dpc-summary table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--dpc-line);
  }
}
