
.govuk-phase-banner__content__tag {
    background-color: #1d70b8;
    color: #fff;
    text-transform: uppercase;
}

.app-phase-banner {
    border-top: 8px solid #1d70b8;
}

    .app-phase-banner .govuk-phase-banner__content {
        float: left;
    }

    .app-phase-banner .govuk-phase-banner::after {
        content: "";
        display: block;
        clear: both;
    }

/**
 * Custom header layout to allow for language switcher
*/
@media screen and (min-width: 768px) {
    .app-header-layout {
        display: flex;
        justify-content: space-between;
        flex-direction: row-reverse;
    }
}

.link-button {
    background: none;
    border: 0;
    padding: 0;
    margin: 0;
    font-family: GDS Transport;
    font-size: 19px;
    color: #1d70b8; /* govuk-link colour */
    text-decoration: underline;
    cursor: pointer;
}

/**
 * Language switcher, adapted from hmrc-frontend to roughly match FTS
 */
.app-language-select {
    margin: 0;
    float: right;
}

.app-language-select__list {
    float: right;
    margin: 0;
    white-space: nowrap;
}

.app-language-select__list-item {
    display: inline-block;
    margin-right: 0;
    border-bottom: 0;
}

    .app-language-select__list-item:first-child::after {
        content: "";
        display: inline-block;
        position: relative;
        top: 0.1875em;
        height: 1em;
        border-right: 0.09375em solid #b1b4b6;
    }

    .app-language-select__list-item a,
    .app-language-select__list-item [aria-current] {
        padding: 0.3125em;
    }

    .app-language-select__list-item [aria-current] {
        color: #b1b4b6;
        font-weight: 700;
    }

/**
 * Wide container, reserved for support admin use only
*/
.app-width-container--wide {
    max-width: none;
    margin-left: 30px;
    margin-right: 30px;
}

.app-notification-banner--failure {
    border-color: #d4351c;
    background-color: #d4351c;
}

/**
 * Notice "you can continue to X, but fix errors before publishing" alert banner.
 * Keep the heading at the compact base size (18px) rather than GOV.UK's desktop
 * 1.5rem/24px, matching the previous notices styling. Scoped so it does not affect
 * the InfoBanner / SuccessBanner elsewhere in the app.
 */
.app-notice-alert .govuk-notification-banner__heading {
    font-size: 1.125rem;
    line-height: 1.25;
}

/**
 * Global "test site" banner
 * Styles lifted from FTS
 */
.app-global-banner {
    background-color: #bbd4ea;
    border-bottom: 1px solid #ffffff;
}

.app-global-banner .govuk-warning-text--inverted .govuk-warning-text__text {
    color: #000 !important;
}

.app-global-banner .govuk-warning-text__icon {
    background-color: #000 !important;
    border-color: #000;
    color: #fff;
    margin-top: 6px;
}

/**
 * Timeout dialog
*/
.app-timeout-dialog {
    border: 0;
    padding: 0;
    max-width: 700px;
    margin-top: 5%;
}

.app-timeout-dialog::backdrop {
    background-color: rgba(0,0,0,0.5);
}

.app-timeout-dialog__header {
    background-color: #D3D3D3;
    padding: 15px;
    margin: 0;
}

.app-timeout-dialog__inner {
    padding: 15px 15px 5px 15px;
}

.app-timeout-dialog__inner:first-child {
    margin-top: 0;
}

.app-timeout-dialog .govuk-button {
    margin-bottom: 15px;
}

/* Exit-notice popup: match the legacy ".pd-inner" fixed width (700px) rather than
   shrinking to fit content the way a bare <dialog> does. */
.app-exit-dialog {
    width: 700px;
    max-width: 100%;
}

/* Leave room in the grey header bar for the close cross (legacy ".pd-header H2"). */
.app-exit-dialog .app-timeout-dialog__header {
    margin-right: 0;
    padding-right: 52px;
}

/* Close cross, mirroring the legacy ".pd-close-button" (top-right, 36x36, GOV.UK yellow focus). */
.app-exit-dialog__close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    background-color: transparent;
    color: #0b0c0c;
    font-size: 1.25rem;
    line-height: 36px;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
}

.app-exit-dialog__close::after {
    content: "\2716";
}

.app-exit-dialog__close:focus {
    outline: 3px solid transparent;
    color: #0b0c0c;
    background-color: #fd0;
    box-shadow: 0 -2px #fd0, 0 4px #0b0c0c;
}

.tile {
    border: 1px solid #b1b4b6;
    background: #f3f2f1;
    padding: 15px 15px 0 15px;
    min-height: 13rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 0.1rem;
}

.tile__link {
    text-decoration: none;
}

.table-header {
    border: solid 1px #b1b4b6;
    background-color: #f3f2f1;
    padding: 20px 20px 0px 20px;
    margin-bottom: 0;
}

.table-content {
    border: solid 1px #b1b4b6;
    border-top: none;
    background-color: #ffffff;
    padding: 20px 20px 0px 20px;
    margin-bottom: 30px;
}

.no-border {
    border: none !important;
}

.govuk-blue-banner {
    background: #1d70b8;
    padding-top: 30px;
    padding-bottom: 20px;
    margin-bottom: 45px;
}

.govuk-blue-banner h1,
.govuk-blue-banner p,
.govuk-blue-banner .govuk-body,
.govuk-blue-banner .govuk-heading-xl {
    color: #fff !important;
}

/**
 * Search Page
*/

.app-search__provider,
.app-search__term {
    color: #505a5f;
}

.app-search__filters-details {
    border: 1px solid #b1b4b6;
}

.app-search__filters-item {
    border-bottom: 1px solid #b1b4b6;
}

.app-search__filters-summary {
    color: #0b0c0c;
}

.app-search__nested-summary {
    color: #0b0c0c;
}

.app-search__nested-details {
    border: 0;
}

.app-search__export-hint {
    width: 100%;
    margin-top: -12px;
}

.location-tree .location-row {
    position: relative;
}

.location-tree .location-toggle {
    background: transparent;
    border: 0;
    color: #1d70b8;
    cursor: pointer;
    margin-left: 4px;
    padding: 4px;
    vertical-align: middle;
}

.location-tree .location-toggle:hover {
    color: #003078;
}

.location-tree .location-toggle:focus:not(:focus-visible) {
    background: transparent;
    box-shadow: none;
    outline: none;
}
/* :focus-visible so the yellow focus block only appears for keyboard navigation,
   not as a lingering highlight after a mouse click on the arrow. */
.location-tree .location-toggle:focus-visible {
    background-color: #fd0;
    box-shadow: 0 -2px #fd0, 0 4px #0b0c0c;
    outline: 3px solid transparent;
}

.app-multi-select-tree__scroll .location-toggle__icon {
    display: inline-block;
    border: 0;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1;
    min-width: 1ch;
    text-align: center;
}

.location-tree .location-children {
    border-left: 2px solid #b1b4b6;
    margin-left: 28px;
    padding-left: 12px;
}

.checkbox-scroll {
    max-height: calc(10 * 36px);
    overflow-y: auto;
    border: 1px solid #b1b4b6;
    padding: 10px 15px;
}

.selected-list {
    list-style: none;
    margin: 0;
    padding: 0;
    border-top: 1px solid #b1b4b6;
}

.selected-list__item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 10px 0;
    border-bottom: 1px solid #b1b4b6;
}

.selected-list__label {
    flex: 1;
}

.selected-list__remove {
    background: transparent;
    border: 0;
    color: #1d70b8;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
}

.selected-list__remove:hover {
    color: #003078;
}

.selected-empty {
    padding: 10px 0;
    border-top: 1px solid #b1b4b6;
    border-bottom: 1px solid #b1b4b6;
    margin: 0;
}

.app-multi-select-tree-dialog {
    border: 0;
    max-height: 90vh;
    max-width: 44rem;
    padding: 0;
    width: calc(100% - 2rem);
}

.app-multi-select-tree-dialog::backdrop {
    background: rgb(0 0 0 / 55%);
}

.app-multi-select-tree-dialog__header {
    align-items: center;
    background: #d9d9d9;
    display: flex;
    justify-content: space-between;
    padding: 15px;
}

.app-multi-select-tree-dialog__close {
    background: transparent;
    border: 0;
    cursor: pointer;
    font-family: "GDS Transport", arial, sans-serif;
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
    padding: 0;
}

.app-multi-select-tree-dialog__close:focus {
    background-color: #fd0;
    box-shadow: 0 -2px #fd0, 0 4px #0b0c0c;
    outline: 3px solid transparent;
}

.app-multi-select-tree-dialog__body {
    padding: 20px 15px 0;
}

.app-multi-select-tree-dialog__actions {
    padding: 20px 15px 15px;
}

.app-multi-select-tree__scroll {
    overflow: auto;
}

.app-multi-select-tree__scroll .location-tree {
    min-width: 100%;
    width: max-content;
}

.app-multi-select-tree__scroll .location-row {
    align-items: center;
    display: flex;
    min-width: 100%;
    width: max-content;
}

.app-multi-select-tree__scroll .govuk-checkboxes__label {
    flex: 1 0 auto;
    min-width: 12rem;
    padding-right: 2.5rem;
    white-space: nowrap;
}

.app-multi-select-tree__scroll .govuk-checkboxes__input:disabled + .govuk-checkboxes__label {
    color: #7c7c7c;
}

.app-multi-select-tree__scroll .location-toggle {
    appearance: none;
    align-self: center;
    background: transparent;
    border: 0;
    box-shadow: none;
    flex: 0 0 24px;
    font: inherit;
    margin-left: auto;
    padding: 0;
    text-align: center;
    text-decoration: none;
    width: 24px;
}

.app-multi-select-tree__scroll .location-children {
    margin-left: 2rem;
    padding-left: 1rem;
}

.app-search__tag {
    max-width: none;
}

.app-search__item {
    padding: 5px 0 5px 20px;
    border-left: 5px solid;
    border-color: #1d70b8;
}

.app-search__item--opportunity_pipeline, .app-search__item--commercial_upcoming {
    border-color: #f47738;
}

.app-search__item--opportunity_premarket {
    border-color: #00703c;
}

.app-search__item--opportunity_planned {
    border-color: #5694ca;
}

.app-search__item--opportunity_tender, .app-search__item--contract_active, .app-search__item--commercial_active {
    border-color: #1d70b8;
}

.app-search__item--opportunity_closed, .app-search__item--contract_closed, .app-search__item--commercial_closed {
    border-color: #28a197;
}

.app-search__item--contract_terminated {
    border-color: #982828;
}


.app-search__tag--opportunity_pipeline, .app-search__tag--commercial_upcoming {
    background: #fcd6c3;
    border-color: #fcd6c3;
}

.app-search__tag--opportunity_premarket {
    background: #cfe4dc;
    border-color: #cfe4dc;
}

.app-search__tag--opportunity_planned {
    background: #e8f1f8;
    border-color: #e8f1f8;
}

.app-search__tag--opportunity_tender, .app-search__tag--contract_active, .app-search__tag--commercial_active {
    background: #d2e2f1;
    border-color: #d2e2f1;
}

.app-search__tag--opportunity_closed, .app-search__tag--contract_closed, .app-search__tag--commercial_closed {
    background: #d0e6e7;
    border-color: #d0e6e7;
}

.app-search__tag--contract_terminated {
    background: #e59a9a;
    border-color: #e59a9a;
}

.app-search__tag--grey {
    background: #f3f2f1;
    border-color: #f3f2f1;
}

.app-search__tag--white {
    background-color: #fff;
    border: 1px solid #b1b4b6;
}

.app-search__tags-item {
    display: inline-block;
    margin-right: 0.5rem;
}

.app-active-filters__list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    list-style: none;
    padding: 0;
}

.app-active-filters__link:link,
.app-active-filters__link:visited {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border: 1px solid #b1b4b6;
    border-radius: 5px;
    text-decoration: none;
    color: #000;
}

.app-active-filters__link:hover {
    border: 1px solid #0b0c0c;
}

.app-active-filters__remove {
    font-weight: bold;
}

.app-search-navigation {
    background: none;
}

/**
 * Autocomplete selected codes
 */
.app-autocomplete-selected__item {
    display: list-item;
}

.app-autocomplete-selected__text {
    flex: 1;
    line-height: 1.4;
}

.app-autocomplete-selected__remove {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    text-decoration: underline;
    color: #1d70b8;
}

.app-autocomplete__menu {
    max-height: 200px;
    overflow-y: auto;
}

.app-autocomplete__input {
    background: #ffffff;
}

.app-autocomplete-filter {
    display: none;
}

.js-enabled .app-autocomplete-filter {
    display: list-item;
}

.app-definiition-list__item {
    display: inline-block;
}

.govuk-header {
    border-bottom: 0;
}

.govuk-header__container {
    border-bottom: 0;
    margin-bottom: 0;
}

.app-organisation-banner {
    padding-top: 5px;
    padding-bottom: 5px;
}

.app-organisation-banner__name {
    margin: 0;
    max-width: none;
    padding-right: 0.3125em;
    text-align: right;
    overflow-wrap: anywhere;
}

@media screen and (min-width: 768px) {
    .app-organisation-banner__name {
        float: right;
    }
}

@media screen and (max-width: 768px) {
    .app-organisation-banner__name {
        float: none;
        text-align: left;
    }
}

.app-search-masthead {
    background-color: #1d70b8;
}

.app-search-header {
    padding-top: 30px;
    padding-bottom: 30px;
}

.app-search-header__title,
.app-search-header__subtitle,
.app-search-header__description {
    color: #fff;
}

.app-search-header__title {
    margin-bottom: 10px;
}

.app-search-header__subtitle {
    margin-bottom: 10px;
}

.app-search-header__description {
    margin-top: 15px;
    margin-bottom: 0;
}

.app-search-objects-key {
    background-color: #f4f8fb;
    border-bottom: 1px solid #8eb8dc;
    padding: 20px 0;
}

.app-search-inputs__label {
    margin-bottom: 10px;
}

.app-search-inputs__field {
    position: relative;
}

.app-search-inputs__input {
    width: 92%;
    margin-bottom: 10px;
}

.app-search-inputs__search {
    position: absolute;
    top: 0;
    right: 0;
    width: 40px;
    height: 40px;
    margin: 0;
    padding: 0;
    cursor: pointer;
}

.app-search-inputs__field .app-search-inputs__search,
.app-search-inputs__field .app-search-inputs__search:hover,
.app-search-inputs__field .app-search-inputs__search:active {
    top: 0;
    background-color: #cedeee;
    color: #003078;
}

.app-search-inputs__field .app-search-inputs__search:focus:not(:active) {
    background-color: #cedeee;
    color: #003078;
    border-color: #fd0;
    box-shadow: inset 0 0 0 2px #fd0;
    outline: 3px solid transparent;
}

.app-search-inputs__icon {
    pointer-events: none;
    position: absolute;
    height: 100%;
    width: 100%;
    top: 0;
    left: 0;
    border: 0;
    transform: scale(0.55);
}

.app-search__filters-title {
    border-bottom: 1px solid #b1b4b6;
}

.searchObjects {
    background: #f3f2f1;
    padding: 20px 0;
    border-bottom: 1px solid #b1b4b6;
}

.objectNav ul {
    margin: 0;
    padding: 0;
}

    .objectNav ul li {
        margin: 0 5px 0 0;
        display: inline-block;
    }

    .objectNav ul li:last-child {
        margin-right: 0;
    }

.mb0 {
    margin-bottom: 0 !important;
}

.objectNav ul li a {
    border: 1px solid #003078;
    display: block;
    padding: 5px 12px;
    text-decoration: none;
    background: #fff;
    color: #000;
}

.objectNav ul li a:hover {
    border-color: #003078;
    background: #003078;
    color: #fff;
}

.objectNav ul li a.active {
    background: #003078;
    color: #fff;
    font-weight: bold;
}

.objectNav--inverse ul li a {
    border: 0;
    padding: 8px 12px;
}

.objectNav--inverse ul li a.active {
    font-weight: bold;
}

.objectNav ul li a:focus {
    outline: 3px solid transparent;
    box-shadow: 0 -2px #fd0, 0 4px #0b0c0c;
    text-decoration: none;
}

/**
 * Mobile responsiveness for search pages
 */
@media only screen and (max-width: 700px) {
    .objectNav ul {
        margin: 0;
        padding: 0;
    }

    .objectNav ul li {
        margin: 5px 0 0 0;
        display: block;
    }

    .objectNav ul li:first-child {
        margin: 0;
    }

    .app-search__item {
        padding-left: 15px;
    }
}

.date-range-compact .govuk-date-input {
    display: flex;
    flex-wrap: nowrap;
    gap: 12px;
}

.date-range-compact .govuk-date-input__item {
    margin-right: 0;
}

HR {
    background-color: #737373;
    width: 100%;
    margin-bottom: 1.7em;
    margin-top: 1.7em;
}

/* Button rendered as a GOV.UK-style link (e.g. filter "Select all / Deselect all"). */
.app-link-button {
    display: inline-block;
    border: 0;
    padding: 0;
    margin: 0;
    background: none;
    color: #1d70b8;
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    text-decoration: underline;
    cursor: pointer;
}

.app-link-button:hover {
    color: #003078;
}

.app-link-button:focus {
    outline: 3px solid transparent;
    color: #0b0c0c;
    background-color: #ffdd00;
    box-shadow: 0 -2px #ffdd00, 0 4px #0b0c0c;
    text-decoration: none;
}

/* Bordered box around the "Choose file" control on the Documents pages (legacy parity). */
.app-file-upload-box {
    display: inline-block;
    width: -moz-fit-content;
    width: fit-content;
    max-width: 50%;
    border: 2px solid #0b0c0c;
    background-color: #fff;
}

.app-file-upload-box .govuk-file-upload {
    margin: 0;
}

/* 80% width utility (sits between govuk two-thirds and full).
   Mirrors the responsive behaviour of the govuk width-override classes:
   full width on mobile, the fixed proportion from the tablet breakpoint up. */
.govuk-\!-width-four-fifths {
    width: 100% !important;
}

@media (min-width: 40.0625em) {
    .govuk-\!-width-four-fifths {
        width: 80% !important;
    }
}

/* Long URLs inside checkbox hints (e.g. the trade-agreement reference links on the
   Other information page) must wrap within the column instead of overflowing the
   layout. Matches the legacy wrapping behaviour; applies to en-GB and cy alike. */
.govuk-checkboxes__hint {
    overflow-wrap: break-word;
    word-wrap: break-word;
}
