@media (min-width: 981px) {
  .journey-grid--six.jgc:has(>[hidden])>:not([hidden]) {
    grid-column: 1/-1;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(180px,.68fr) minmax(0,1.45fr) auto;
    gap: 22px;
    align-items: center;
    padding: 20px 24px;
  }

  .journey-grid--six.jgc:has(>[hidden])>:not([hidden])>:is(h3,p,.journey-card__action) {
    margin: 0;
  }

  .journey-grid--six.jgc:has(>[hidden])>:not([hidden]) h3 {
    grid-column: 1;
  }

  .journey-grid--six.jgc:has(>[hidden])>:not([hidden]) p {
    grid-column: 2;
  }

  .journey-grid--six.jgc:has(>[hidden])>:not([hidden]) .journey-card__action {
    grid-column: 3;
    padding: 0;
  }
}

@media (min-width: 1440px) and (max-width: 1919px) {
  main > .page-intro {
    padding: 72px 0 56px;
  }

  main > .section:not(.section--compact):not(.section--amber) {
    padding: 64px 0;
  }

  main > .section--compact,
  main > .section--amber {
    padding: 52px 0;
  }
}

@media (min-width: 1920px) {
  body:has([data-render="forms"]) main > .page-intro,
  body:has([data-render="deadlines"]) main > .page-intro,
  body:has([data-workbench-profile]) main > .page-intro {
    padding: 72px 0 56px;
  }

  body:has([data-render="forms"]) main > .section,
  body:has([data-render="deadlines"]) main > .section,
  body:has([data-workbench-profile]) main > .section {
    padding: 56px 0;
  }

  body:has([data-render="forms"]) main > .section--amber,
  body:has([data-render="deadlines"]) main > .section--amber,
  body:has([data-workbench-profile]) main > .section--amber {
    padding: 48px 0;
  }

  body:has([data-render="forms"]) main > section:nth-of-type(2) .journey-grid {
    gap: 16px;
  }

  body:has([data-render="forms"]) main > section:nth-of-type(2) .journey-card {
    min-height: 156px;
    padding: 20px;
  }

  body:has([data-render="forms"]) main > section:nth-of-type(3):has(.quick-links-rail) > .container {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, 420px);
    column-gap: 40px;
    align-items: start;
  }

  body:has([data-render="forms"]) main > section:nth-of-type(3) .section-heading,
  body:has([data-render="forms"]) main > section:nth-of-type(3) .field,
  body:has([data-render="forms"]) main > section:nth-of-type(3) .filter-status,
  body:has([data-render="forms"]) main > section:nth-of-type(3) .form-list,
  body:has([data-render="forms"]) main > section:nth-of-type(3) .collection-actions {
    grid-column: 1 / -1;
  }

  body:has([data-render="forms"]) main > section:nth-of-type(3) .public-summary-strip {
    grid-column: 1;
    width: 100%;
    max-width: none;
  }

  body:has([data-render="forms"]) main > section:nth-of-type(3) .quick-links-rail {
    grid-column: 2;
    grid-row: 2;
    width: 100%;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
  }

  body:has([data-render="forms"]) main > section:nth-of-type(3) .form-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    align-items: start;
  }

  body:has([data-render="forms"]) main > section:nth-of-type(3) .form-list:not(:has(> :not([hidden]) ~ :not([hidden]))) {
    grid-template-columns: 1fr;
  }

  body:has([data-render="deadlines"]) main > section:nth-of-type(2):has(.quick-links-rail) > .container {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, 420px);
    column-gap: 40px;
    align-items: start;
  }

  body:has([data-render="deadlines"]) main > section:nth-of-type(2) .section-heading,
  body:has([data-render="deadlines"]) main > section:nth-of-type(2) .calendar-pulse,
  body:has([data-render="deadlines"]) main > section:nth-of-type(2) .deadline-list {
    grid-column: 1 / -1;
  }

  body:has([data-render="deadlines"]) main > section:nth-of-type(2) .filter-bar--primary,
  body:has([data-render="deadlines"]) main > section:nth-of-type(2) .filter-disclosure,
  body:has([data-render="deadlines"]) main > section:nth-of-type(2) .filter-status {
    grid-column: 1;
  }

  body:has([data-render="deadlines"]) main > section:nth-of-type(2) .quick-links-rail {
    grid-column: 2;
    grid-row: 2;
    width: 100%;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
  }

  body:has([data-render="deadlines"]) main > section:nth-of-type(2) .deadline-list,
  body:has([data-render="deadlines"]) main > section:nth-of-type(3) .deadline-list--compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }

  body:has([data-render="deadlines"]) main > section:nth-of-type(2) .deadline-list:not(:has(> :not([hidden]) ~ :not([hidden]))),
  body:has([data-render="deadlines"]) main > section:nth-of-type(3) .deadline-list--compact:not(:has(> :not([hidden]) ~ :not([hidden]))) {
    grid-template-columns: 1fr;
  }

  body:has([data-workbench-profile]) .workbench-layout {
    grid-template-columns: minmax(420px, 520px) minmax(0, 1fr);
    gap: 40px;
  }

  body:has([data-workbench-profile]) .workbench-panel {
    padding: 20px;
  }

  body:has([data-workbench-profile]) .workbench-grid {
    grid-template-columns: minmax(0, 1.4fr) minmax(360px, 0.8fr);
    gap: 16px;
  }

  body:has([data-workbench-profile]) .workbench-card {
    padding: 20px;
  }

  body:has([data-workbench-profile]) .workbench-packet {
    min-height: 220px;
  }

  body:has([data-workbench-profile]) .situation-packs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
  }

  body:has([data-workbench-profile]) .situation-pack {
    padding: 18px;
  }

  body:has([data-workbench-profile]) .situation-pack__body {
    gap: 14px;
    margin-top: 16px;
  }

  body:has([data-workbench-profile]) .situation-pack__checks,
  body:has([data-workbench-profile]) .situation-pack__routes {
    padding: 14px;
  }

  body:has([data-workbench-profile]) .situation-pack__check {
    padding: 9px 10px;
  }

  body:has([data-workbench-profile]) .situation-pack__check strong {
    font-size: 12px;
  }

  body:has([data-workbench-profile]) .situation-pack__check small {
    font-size: 10px;
  }

  body:has([data-workbench-profile]) .situation-pack__crosswalk {
    padding: 12px 14px;
  }

  body:has([data-workbench-profile]) .situation-pack__crosswalk-link {
    min-height: 0;
    padding: 8px 9px;
  }

  body:has([data-workbench-profile]) .situation-pack__crosswalk-link strong {
    font-size: 11px;
  }

  body:has([data-workbench-profile]) .situation-pack__source {
    padding: 8px 9px;
    font-size: 11px;
  }

  body:has([data-workbench-profile]) .source-list.wtl {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }

  main > .page-intro {
    padding: 72px 0 56px;
  }

  main > .section {
    padding: 56px 0;
  }

  main > .section--amber {
    padding: 48px 0;
  }

  body:has(.home-hero) .deadline-list--compact,
  body:has(.service-list) .service-list,
  body:has(.source-list:not(.wtl)) .source-list:not(.wtl),
  body:has(.change-list) .change-list,
  body:has(.regime-list) .regime-list,
  body:has(.tool-grid) .tool-grid,
  body:has(.code-guide-list) .code-guide-list,
  body:has(.rights-grid) .rights-grid,
  body:has(.atlas-grid) [data-render="atlas-dataset-cards"] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }

  body:has(.tool-grid) .tool-grid {
    align-items: start;
  }
}

@media (min-width: 1920px) and (max-width: 2399px) {
  body:has([data-workbench-profile]) .situation-packs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  body:has([data-workbench-profile]) .situation-pack:nth-child(3) {
    grid-column: 1 / -1;
  }

  body:has([data-workbench-profile]) .situation-pack:nth-child(3) .situation-pack__body {
    grid-template-columns: minmax(0, 1.35fr) minmax(360px, .65fr);
  }
}

@media (min-width: 2400px) {
  body:has(.home-hero) .deadline-list--compact,
  body:has(.service-list) .service-list,
  body:has(.source-list:not(.wtl)) .source-list:not(.wtl),
  body:has(.change-list) .change-list,
  body:has(.regime-list) .regime-list,
  body:has(.tool-grid) .tool-grid,
  body:has(.code-guide-list) .code-guide-list,
  body:has(.rights-grid) .rights-grid,
  body:has(.atlas-grid) [data-render="atlas-dataset-cards"] {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  body:has([data-workbench-profile]) .source-list.wtl {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  /* Four equal calculators are a closed set; keep the wide canvas balanced. */
  body:has(.tool-grid) .tool-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
  }

  /* Finite four-column families avoid a lone final card on the wide canvas. */
  body:has(.regime-list) .regime-list,
  body:has(.rights-grid) .rights-grid,
  body:has(.atlas-grid) [data-render="atlas-dataset-cards"] {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
  }

  body:has(.rights-grid) .rights-card {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }

  /* Evidence cards stay readable while the eight-card source set closes as 4 + 4. */
  body:has(.source-list:not(.wtl)) .source-list:not(.wtl) {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
  }

  /* Five visible service cards close as 3 + 2 without narrowing their internals. */
  body:has(.service-list--featured-tail) .service-list--featured-tail {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 16px;
  }

  .service-list--featured-tail > .service-card {
    grid-column: span 2;
  }

  .service-list--featured-tail > .service-card:nth-child(4),
  .service-list--featured-tail > .service-card:nth-child(5) {
    grid-column: span 3;
  }

  /* The compact journey catalogue closes its final two-card row. */
  body:has(.journey-grid--six.jgc) .journey-grid--six.jgc:not(:has([hidden])) > :nth-last-child(-n + 2) {
    grid-column: span 2;
  }

  /* The form-event showcase closes its three-card row in the all view. */
  body:has([data-render=form-events]) .deadline-list--compact.deadline-list--all > .deadline-card:nth-child(3) {
    grid-column: span 2;
  }

  .deadline-list--all[data-render="deadlines"][data-timeline-scope="localized"]:not(.deadline-list--compact) > :last-child {
    grid-column: span 2;
  }

  .source-list[data-payment-scope="localized"]:not(:has([hidden])) > :nth-last-child(-n + 2) {
    grid-column: span 2;
  }

  /* The late-added notice card closes the data-contract row on the very-wide canvas. */
  body:has(.dc-list) .dc-list > .service-card--notice-deadlines {
    grid-column: span 3;
  }

  /* Ten-card families close their final row with two equal wide cards. */
  body:has(.rights-grid) .rights-grid > .rights-card:not([hidden]):has(+ .rights-card[hidden]),
  body:has(.rights-grid) .rights-grid > .rights-card:not([hidden]):has(+ .rights-card:not([hidden]) + .rights-card[hidden]),
  body:has(.rights-grid > .rights-card:not([hidden]):last-child) .rights-grid > .rights-card:nth-last-child(-n + 2),
  body:has(.atlas-grid) [data-render="atlas-dataset-cards"] > :nth-last-child(-n + 2) {
    grid-column: span 2;
  }
}
