
.dialogV3 {
    --dlg-blue-dark: #007EC3;
    --dlg-blue: var(--primary-blue, #19ACEE);
    --dlg-pale-blue: #F1FBFF;
    --dlg-ink: #191919;
    --dlg-body: #414042;
    --dlg-muted: #6B7280;
    --dlg-border: #DEE2E6;
    --dlg-radius: 12px;
    --dlg-radius-sm: 8px;
}

.dialogV3 .modal-content {
    border: 0;
    border-radius: var(--dlg-radius);
    color: var(--dlg-body);
}

.dialogV3 .modal-header,
.dialogV3 .modal-footer {
    border: 0;
}

.dialogV3 .modal-header {
    padding: 24px 24px 8px;
}

.dialogV3 .modal-title {
    margin: 0;
    color: var(--dlg-blue-dark);
    font-size: 1.5rem;
    font-weight: 700;
}

.dialogV3 .modal-body {
    padding: 8px 24px 16px;
}

.dialogV3 .modal-footer {
    gap: 12px;
    justify-content: flex-end;
    padding: 8px 24px 24px;
}

.dialogV3 .dialogV3Intro {
    margin: 0 0 20px;
    color: var(--dlg-muted);
    font-size: 0.9375rem;
}

/*  ==================== THE LIST ==================== */

.dialogV3 .dialogV3ListHeader {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.dialogV3 .dialogV3SelectAllBtn {
    background: none;
    border: 0;
    padding: 0;
    color: var(--dlg-blue-dark);
    font-size: 0.9375rem;
    font-weight: 600;
    text-decoration: underline;
}

.dialogV3 .dialogV3Count {
    color: var(--dlg-muted);
    font-size: 0.875rem;
}

/*  Tall enough to show that the list runs on, short enough to leave the buttons on screen on a
    laptop. The dialog itself does not scroll, so the footer stays put while the list moves. */
.dialogV3 .dialogV3List {
    list-style: none;
    margin: 0;
    padding: 4px 0;
    max-height: 340px;
    overflow-y: auto;
    border: 1px solid var(--dlg-border);
    border-radius: var(--dlg-radius-sm);
}

.dialogV3 .dialogV3Item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 16px;
}

.dialogV3 .dialogV3Item:hover {
    background: var(--dlg-pale-blue);
}

/*  style.css sizes bare inputs site-wide, so the box states its own size rather than inheriting
    one meant for a text field. */
.dialogV3 .dialogV3Checkbox {
    width: 1.125rem;
    height: 1.125rem;
    flex-shrink: 0;
    margin: 2px 0 0;
    accent-color: var(--dlg-blue-dark);
    cursor: pointer;
}

.dialogV3 .dialogV3Item label {
    margin: 0;
    color: var(--dlg-ink);
    font-size: 0.9375rem;
    font-weight: 400;
    cursor: pointer;
}

.dialogV3 .dialogV3Error {
    margin: 12px 0 0;
    color: #B02A37;
    font-size: 0.875rem;
    font-weight: 600;
}

/*  ==================== BUTTONS ==================== */

.dialogV3 .dialogV3PrimaryBtn {
    background: var(--dlg-blue);
    border: 1px solid var(--dlg-blue);
    border-radius: var(--dlg-radius-sm);
    color: #FFF;
    font-weight: 700;
    padding: 12px 28px;
    white-space: nowrap;
}

.dialogV3 .dialogV3PrimaryBtn:hover,
.dialogV3 .dialogV3PrimaryBtn:focus {
    background: var(--dlg-blue-dark);
    border-color: var(--dlg-blue-dark);
    color: #FFF;
}

.dialogV3 .dialogV3SecondaryBtn {
    background: #FFF;
    border: 1px solid var(--dlg-border);
    border-radius: var(--dlg-radius-sm);
    color: var(--dlg-body);
    font-weight: 600;
    padding: 12px 28px;
    white-space: nowrap;
}

.dialogV3 .dialogV3SecondaryBtn:hover,
.dialogV3 .dialogV3SecondaryBtn:focus {
    background: #F5F7F9;
    color: var(--dlg-body);
}

/*  ============================ NARROW ============================ */

@media (max-width: 767px) {
    .dialogV3 .modal-header {
        padding: 20px 16px 8px;
    }

    .dialogV3 .modal-body {
        padding: 8px 16px 16px;
    }

    /*  Side by side the two do not fit a phone, and the one that commits belongs under the thumb,
        so they stack with Save on top. */
    .dialogV3 .modal-footer {
        flex-direction: column-reverse;
        align-items: stretch;
        padding: 8px 16px 20px;
    }

    .dialogV3 .modal-footer > .btn {
        width: 100%;
        margin: 0;
    }

    .dialogV3 .dialogV3List {
        max-height: 50vh;
    }
}

/*  ==================== THE SAVED SEARCH PICKER ====================
    savedSearchModalV3.jsp only. Every row here is a way into a search rather than a setting to
    change, so the row is the control: no separate button to aim at, and the whole width responds. */

.dialogV3 .savedSearchPickerList {
    padding: 0;
}

.dialogV3 .savedSearchPickerItem {
    align-items: center;
    gap: 12px;
    padding: 0;
}

.dialogV3 .savedSearchPickerItem + .savedSearchPickerItem {
    border-top: 1px solid var(--dlg-border);
}

.dialogV3 .savedSearchPickerName {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1 1 auto;
    min-width: 0;
    background: none;
    border: 0;
    color: var(--dlg-ink);
    font-size: 0.9375rem;
    font-weight: 600;
    padding: 12px 16px;
    text-align: left;
}

.dialogV3 .savedSearchPickerLabel {
    flex: 1 1 auto;
    min-width: 0;
}

.dialogV3 button.savedSearchPickerName {
    cursor: pointer;
}

.dialogV3 .savedSearchPickerItem:hover button.savedSearchPickerName {
    color: var(--dlg-blue-dark);
}

/*  Whose search it is, or why there is nothing to run - either way it qualifies the name above it
    rather than competing with it. */
.dialogV3 .savedSearchPickerNote {
    display: block;
    color: var(--dlg-muted);
    font-size: 0.8125rem;
    font-weight: 400;
    margin-top: 2px;
}

/*  Shows where the row goes without being a second thing to aim at: the row is already the
    control, so the arrow only appears under the pointer. */
.dialogV3 .savedSearchPickerArrow {
    color: var(--dlg-blue-dark);
    flex-shrink: 0;
    font-size: 0.875rem;
    opacity: 0;
    transition: opacity 0.15s ease-in-out;
}

.dialogV3 .savedSearchPickerItem:hover .savedSearchPickerArrow,
.dialogV3 .savedSearchPickerItem:focus-within .savedSearchPickerArrow {
    opacity: 1;
}

.dialogV3 .savedSearchPickerEmpty {
    margin: 16px 0 0;
    color: var(--dlg-muted);
    font-size: 0.9375rem;
}

.dialogV3 .savedSearchPickerFooter {
    justify-content: space-between;
}

.dialogV3 .savedSearchPickerManageAll {
    color: var(--dlg-blue-dark);
    font-size: 0.9375rem;
    font-weight: 600;
    text-decoration: underline;
    white-space: nowrap;
}

.dialogV3 .savedSearchPickerManageAll i {
    margin-right: 8px;
}

@media (max-width: 767px) {
    /*  The footer stacks its buttons on a phone, but one of these is a link out and the other
        closes the dialog, so they stay on one line and wrap only if they must. */
    .dialogV3 .savedSearchPickerFooter {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 12px;
    }

    .dialogV3 .savedSearchPickerFooter > .btn {
        width: auto;
    }
}
