/* How many people calculator
   Content stays in the layout width container (aligned with the masthead).
   Full-bleed background is painted with ::before so we don't nest another
   govuk-width-container or fight the parent with 100vw margins. */
.how-many-people-tool {
  /* Pull up against the masthead — cancel .govuk-main-wrapper top padding */
  margin-top: -40px;
}

.calc-page {
  max-width: none;
  margin-top: 22px;
  margin-bottom: 40px;
}

.calc-input-section {
  position: relative;
  z-index: 0;
  width: auto;
  margin: 0;
  padding: 30px 0 24px;
  box-sizing: border-box;
  background: transparent;
  border: 0;
}

.calc-input-section::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 100vw;
  transform: translateX(-50%);
  background: var(--govuk-colour-surface-bg, #f3f2f1);
  border-top: 1px solid #b1b4b6;
  border-bottom: 2px solid #b1b4b6;
  pointer-events: none;
}

.calc-input-box {
  max-width: none;
}

.calc-label {
  display: block;
  font-size: 19px;
  font-weight: 700;
  color: #0b0c0c;
  margin-bottom: 12px;
}

.calc-label__hint {
  display: block;
  margin-top: 4px;
  font-size: 15px;
  line-height: 1.5;
  color: #505a5f;
  font-weight: 400;
}

.calc-input-row {
  display: flex;
  align-items: stretch;
  gap: 0;
  margin-bottom: 12px;
}

.calc-input {
  flex: 1;
  min-width: 0;
  border: 2px solid #0b0c0c;
  border-right: 0;
  background: #ffffff;
  color: #0b0c0c;
  font-size: 30px;
  line-height: 1;
  font-weight: 700;
  padding: 8px 12px;
}

.calc-go {
    background: #1d70b8;
  border-color: #1d70b8;
  color: #ffffff;
  font-size: 16px;
  font-weight: 700;
  padding: 0 28px;
  cursor: pointer;
  white-space: nowrap;
}

.calc-go:hover {
  background: #0b0c0c;
  border-color: #0b0c0c;
}

.calc-presets {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.calc-preset-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #505a5f;
  margin-right: 2px;
}

.calc-preset {
  border: 1px solid #d8dde0;
  background: #ffffff;
  color: #0b0c0c;
  font-size: 1rem;
  line-height: 1;
  padding: 7px 1rem;
  cursor: pointer;
}

.calc-preset:hover {
  border-color: #0b0c0c;
  background: #f8f8f8;
}

.calc-results-section {
  margin-top: 22px;
}

.calc-summary-bar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid #d8dde0;
  margin-bottom: 24px;
  background: #ffffff;
}

.calc-summary-cell {
  padding: 18px;
  text-align: center;
  border-right: 1px solid #d8dde0;
}

.calc-summary-cell:last-child {
  border-right: none;
}

.calc-summary-n {
  display: block;
  font-size: 34px;
  line-height: 1;
  font-weight: 700;
  color: #0b0c0c;
}

.calc-summary-l {
  display: block;
  margin-top: 6px;
  font-size: 11px;
  line-height: 1.2;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  font-weight: 700;
  color: #505a5f;
}

.calc-category {
  margin-bottom: 24px;
  border: 1px solid #d8dde0;
  background: #ffffff;
}

.calc-cat-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #0b0c0c;
  padding: 9px 1rem;
}

.calc-cat-pill {
  color: #ffffff;
  font-size: 13px;
  line-height: 1.1;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.calc-cat-count {
  color: rgba(255, 255, 255, 0.75);
  font-size: 11px;
  text-transform: lowercase;
}

.calc-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  align-items: stretch;
  border-bottom: 1px solid #d8dde0;
}

.calc-row:last-child {
  border-bottom: 0;
}

.calc-row__left {
  padding: 14px 16px;
  border-right: 1px solid #d8dde0;
}

.calc-row__name {
  margin: 0 0 6px;
  font-size: 20px;
  line-height: 1.2;
  font-weight: 700;
  color: #0b0c0c;
}

.calc-row__detail {
  margin: 0;
  font-size: 1rem;
  line-height: 1.5;
  color: #505a5f;
}

.calc-row__note {
  margin-top: 8px;
  padding: 7px 10px;
  border-left: 3px solid #d2e2f1;
  background: #f4f8fb;
  font-size: 13px;
  line-height: 1.45;
  color: #3d3d3d;
}

.calc-row__note::before {
  content: "Design";
  display: inline-block;
  margin-right: 7px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  font-weight: 700;
  color: #1d70b8;
}

.calc-row__links {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.calc-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border: 1px solid #d8dde0;
  background: #f8f8f8;
  color: #1d70b8;
  font-size: 12px;
  text-decoration: none;
}

.calc-link:hover {
  background: #f4f8fb;
  text-decoration: underline;
}

.calc-link__tag {
  font-size: 9px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  font-weight: 700;
  color: #505a5f;
}

.calc-link--wcag {
  background: #eef4fb;
  border-color: #d2e2f1;
}

.calc-link--guidance {
  background: #f3f2f1;
}

.calc-link--standard {
  background: #fff8f5;
  border-color: #f5c4a8;
  color: #7a3300;
}

.calc-row__source {
  margin-top: 8px;
}

.calc-row__src-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-weight: 700;
  color: #505a5f;
  margin-right: 6px;
}

.calc-row__src-link {
  font-size: 13px;
  font-weight: 600;
  color: #1d70b8;
  text-decoration: none;
}

.calc-row__src-link:hover {
  text-decoration: underline;
}

.calc-row__right {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 14px 16px;
  text-align: center;
}

.calc-row__count {
  display: block;
  font-size: 1.7rem;
  line-height: 1;
  font-weight: 700;
  color: #0b0c0c;
}

.calc-row__pct {
  display: block;
  margin-top: 4px;
  font-size: 15px;
  color: #505a5f;
}

.calc-row__bar-wrap {
  margin-top: 10px;
  height: 5px;
  background: #f3f2f1;
}

.calc-row__bar-fill {
  height: 5px;
  background: var(--calc-c);
}

.calc-footnote,
.calc-disclaimer {
  margin-top: 20px;
  font-size: 1rem;
  line-height: 1.6;
  color: #505a5f;
}

@media (max-width: 48.0525em) {
  .calc-input-section {
    padding: 24px 0 18px;
  }

  .calc-input-row {
    display: block;
  }

  .calc-input {
    width: 100%;
    border-right: 2px solid #0b0c0c;
    margin-bottom: 8px;
    font-size: 28px;
  }

  .calc-go {
    width: 100%;
    min-height: 44px;
  }

  .calc-summary-bar {
    grid-template-columns: 1fr;
  }

  .calc-summary-cell {
    border-right: 0;
    border-bottom: 1px solid #d8dde0;
  }

  .calc-summary-cell:last-child {
    border-bottom: 0;
  }

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

  .calc-row__left {
    border-right: 0;
  }

  .calc-row__right {
    border-top: 1px solid #d8dde0;
  }
}
