/* ==========================================================================
   SAM Directory — Portal theme
   Design tokens + shared component classes for the opportunities portal shell.
   Loaded ONLY by layouts/front-end/opportunities/main.blade.php.
   Generic (Bootstrap/theme) overrides are scoped under body.has-opportunity-sidebar
   so nothing leaks into the marketing pages that share theme.css.
   ========================================================================== */

:root {
    --sd-navy: #132444;
    --sd-primary: #2e5eea;
    --sd-primary-hover: #244fd0;
    --sd-primary-soft: #eaf0fe;
    --sd-bg: #f6f8fb;
    --sd-surface: #ffffff;
    --sd-border: #e3e8f0;
    --sd-border-soft: #eef1f6;
    --sd-border-input: #d5dceb;
    --sd-text: #3d4c66;
    --sd-text-strong: #1e2838;
    --sd-text-muted: #61708b;
    --sd-text-faint: #8b97ad;
    --sd-green: #177245;
    --sd-green-soft: #e6f4ec;
    --sd-amber: #9a5b13;
    --sd-amber-soft: #fdf3e2;
    --sd-red: #c02626;
    --sd-red-soft: #fdeaea;
    --sd-purple: #6d3fc0;
    --sd-purple-soft: #f3ecfd;
    --sd-gold: #d9a514;
    --sd-radius-card: 12px;
    --sd-radius-control: 8px;
    --sd-font: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;

    /* shell metrics (shared with opportunity-sidebar.css) */
    --sd-topbar-height: 56px;
    --sd-topbar-height-mobile: 52px;
}

/* ==========================================================================
   1. App shell surfaces
   ========================================================================== */

body.has-opportunity-sidebar {
    font-family: var(--sd-font);
    background: var(--sd-bg);
    color: var(--sd-text);
    -webkit-font-smoothing: antialiased;
}

body.has-opportunity-sidebar .opportunity-main-content {
    background: var(--sd-bg);
}

/* Page content padding — pages nest a .container-fluid (12px) inside, so the
   effective gutter matches the design's 24px page padding. */
body.has-opportunity-sidebar #mainContent {
    padding: 20px 12px;
}

body.has-opportunity-sidebar .portal-content {
    min-width: 0;
}

@media (max-width: 991.98px) {
    body.has-opportunity-sidebar #mainContent {
        padding: 14px 2px;
    }
}

/* ==========================================================================
   2. Top bar
   ========================================================================== */

.sd-topbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    display: flex;
    align-items: center;
    gap: 16px;
    height: var(--sd-topbar-height);
    flex-shrink: 0;
    padding: 0 24px;
    background: var(--sd-surface);
    border-bottom: 1px solid var(--sd-border);
}

.sd-topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
}

.sd-topbar-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--sd-navy);
    margin: 0;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sd-topbar-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--sd-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sd-topbar-breadcrumb a {
    color: var(--sd-text-muted);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.sd-topbar-breadcrumb a:hover {
    color: var(--sd-primary);
}

.sd-topbar-logo {
    display: none;
    align-items: center;
}

.sd-topbar-logo img {
    height: 14px;
    width: auto;
    display: block;
}

.sd-topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-left: auto;
    flex-shrink: 0;
}

.sd-topbar-home {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--sd-text-muted);
    text-decoration: none;
    white-space: nowrap;
}

.sd-topbar-home:hover {
    color: var(--sd-primary);
}

.sd-topbar-home i {
    font-size: 15px;
    line-height: 1;
}

.sd-topbar-divider {
    width: 1px;
    height: 20px;
    background: var(--sd-border);
    flex-shrink: 0;
}

.sd-avatar {
    width: 30px;
    height: 30px;
    border-radius: 999px;
    background: var(--sd-navy);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .01em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    padding: 0;
    flex-shrink: 0;
    text-decoration: none;
    cursor: pointer;
}

.sd-avatar:hover,
.sd-avatar:focus {
    color: #fff;
    background: #1b3260;
}

.sd-avatar:focus-visible {
    outline: 2px solid rgba(46, 94, 234, .35);
    outline-offset: 2px;
}

.sd-topbar-user .dropdown-toggle::after {
    display: none;
}

/* Dropdown skin (shared by top bar avatar menu) */
body.has-opportunity-sidebar .sd-dropdown {
    min-width: 232px;
    padding: 6px;
    border: 1px solid var(--sd-border);
    border-radius: 10px;
    box-shadow: 0 12px 30px rgba(19, 36, 68, .12);
    margin-top: 8px;
}

body.has-opportunity-sidebar .sd-dropdown .dropdown-item {
    font-size: 13.5px;
    font-weight: 500;
    color: var(--sd-text);
    border-radius: 6px;
    padding: 7px 10px;
}

body.has-opportunity-sidebar .sd-dropdown .dropdown-item:hover,
body.has-opportunity-sidebar .sd-dropdown .dropdown-item:focus {
    background: var(--sd-primary-soft);
    color: var(--sd-primary);
}

body.has-opportunity-sidebar .sd-dropdown .dropdown-divider {
    margin: 6px 4px;
    border-top-color: var(--sd-border-soft);
}

.sd-dropdown-head {
    padding: 8px 10px 10px;
    border-bottom: 1px solid var(--sd-border-soft);
    margin-bottom: 6px;
}

.sd-dropdown-head strong {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--sd-text-strong);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sd-dropdown-head span {
    display: block;
    font-size: 11.5px;
    color: var(--sd-text-faint);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sd-dropdown-form {
    margin: 0;
}

.sd-dropdown-form button {
    width: 100%;
    text-align: left;
    background: none;
    border: none;
}

.sd-topbar-login {
    font-size: 13px;
    font-weight: 500;
    color: var(--sd-text-muted);
    text-decoration: none;
    white-space: nowrap;
}

.sd-topbar-login:hover {
    color: var(--sd-primary);
}

.sd-topbar-cta {
    display: inline-flex;
    align-items: center;
    height: 34px;
    padding: 0 14px;
    border-radius: var(--sd-radius-control);
    background: var(--sd-primary);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    border: none;
}

.sd-topbar-cta:hover,
.sd-topbar-cta:focus {
    background: var(--sd-primary-hover);
    color: #fff;
}

/* Mobile top bar — hamburger (fixed, see opportunity-sidebar.css) sits at the
   left, inline logo centered, avatar right. */
@media (max-width: 991.98px) {
    .sd-topbar {
        height: var(--sd-topbar-height-mobile);
        gap: 10px;
        padding: 0 14px 0 52px;
    }

    .sd-topbar-logo {
        display: flex;
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
    }

    .sd-topbar-title {
        display: none;
    }

    .sd-topbar.has-breadcrumb .sd-topbar-logo {
        display: none;
    }

    .sd-topbar-home {
        display: none;
    }

    .sd-topbar-divider {
        display: none;
    }

    .sd-topbar-right {
        gap: 10px;
    }

    .sd-avatar {
        width: 28px;
        height: 28px;
        font-size: 11px;
    }

    .sd-topbar-login {
        display: none;
    }

    .sd-topbar-cta {
        height: 30px;
        padding: 0 11px;
        font-size: 12.5px;
    }
}

/* ==========================================================================
   3. Portal footer (one line)
   ========================================================================== */

.sd-portal-footer {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    padding: 13px 24px;
    font-size: 12px;
    color: var(--sd-text-faint);
    background: var(--sd-bg);
    border-top: 1px solid #e9edf4;
    margin-top: auto;
}

.sd-portal-footer a {
    color: var(--sd-text-faint);
    text-decoration: none;
}

.sd-portal-footer a:hover {
    color: var(--sd-primary);
}

.sd-portal-footer-note {
    margin-left: auto;
}

@media (max-width: 767.98px) {
    .sd-portal-footer {
        gap: 8px 14px;
        padding: 14px 16px;
    }

    .sd-portal-footer-note {
        margin-left: 0;
        flex-basis: 100%;
    }
}

/* ==========================================================================
   4. Mobile filter modal (shared by the opportunity and contractor search)
   ========================================================================== */

/* Backdrop behind the filter sheet. Each search page keeps its own rail
   styles; only the overlay chrome is shared. */
.sd-filter-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1054;
    background: rgba(19, 36, 68, .45);
}

body.sd-filters-open .sd-filter-backdrop {
    display: block;
}

/* Lock the page behind the sheet. */
body.sd-filters-open {
    overflow: hidden;
}

@media (min-width: 992px) {

    /* Desktop always shows the rail inline — never the overlay. */
    .sd-filter-backdrop {
        display: none !important;
    }

    body.sd-filters-open {
        overflow: auto;
    }
}

/* ==========================================================================
   4b. Result card — shared by opportunity and contractor results
   ========================================================================== */

.sd-rescard {
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.clickable-card {
    cursor: pointer;
}

.sd-rescard:hover {
    transform: translateY(-2px);
    border-color: var(--sd-border-input);
    box-shadow: 0 6px 18px rgba(19, 36, 68, .08);
}

.sd-rescard-body {
    display: flex;
    flex-direction: column;
    gap: 9px;
    height: 100%;
    padding: 14px 16px 15px;
}

.sd-rescard-head {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    min-height: 22px;
}

.sd-rescard-title {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.35;
    color: var(--sd-navy);
    margin: 0;
    /* Titles are often one unbroken token with no spaces to wrap at. */
    overflow-wrap: anywhere;
    word-break: break-word;
    min-width: 0;
}

.sd-rescard-title a {
    color: var(--sd-navy);
    text-decoration: none;
}

.sd-rescard-title a:hover {
    color: var(--sd-primary);
}

/* Secondary line under the title (agency, or DBA + location). */
.sd-rescard-sub {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    color: var(--sd-text-muted);
    margin: 0;
    min-width: 0;
}

.sd-rescard-sub-text {
    /* Without min-width:0 a flex item's automatic minimum is its min-content
       width, and nowrap makes that the whole string — long names then force
       the card wider than the phone viewport instead of ellipsising. */
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sd-rescard-desc {
    font-size: 12.5px;
    line-height: 1.55;
    color: var(--sd-text-muted);
    margin: 0;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Highlighted search terms inside matched snippets */
mark.sd-hl {
    background: #fdf3c9;
    color: inherit;
    padding: 0 1px;
    border-radius: 2px;
}

.sd-rescard-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.sd-rescard-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
    padding-top: 11px;
    margin-top: auto;
    border-top: 1px solid var(--sd-border-soft);
}

.sd-rescard-foot-note {
    font-size: 11.5px;
    color: var(--sd-text-faint);
}

/* Bookmark control — outline by default, gold when saved. Sits above the
   stretched title link so it stays clickable. */
.sd-rescard .sd-bookmark-cell {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
}

.sd-bookmark-cell .form-check-bookmark {
    padding: 0;
    margin: 0;
    min-height: 0;
    line-height: 1;
}

.sd-bookmark-cell .form-check-label {
    cursor: pointer;
    line-height: 1;
}

.sd-bookmark-cell .form-check-bookmark-default .bookmark-icon {
    color: #a6b1c4;
}

.sd-bookmark-cell .form-check-bookmark-default:hover .bookmark-icon {
    color: var(--sd-gold);
}

.sd-bookmark-cell .form-check-bookmark-active .bookmark-icon {
    color: var(--sd-gold);
}

/* One card per row at every width. */
.sd-card-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(0, 1fr);
}

.sd-card-grid > * {
    min-width: 0;
}

/* Card / list view switch — used by both search pages and the saved pages. */
.sd-view-toggle {
    display: flex;
    gap: 2px;
    background: #eceff5;
    border-radius: var(--sd-radius-control);
    padding: 3px;
    margin: 0;
    list-style: none;
    flex-shrink: 0;
}

.sd-view-toggle .nav-item {
    margin: 0;
}

.sd-view-toggle .nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 28px;
    padding: 0;
    border-radius: 6px;
    color: var(--sd-text-muted);
    font-size: 13px;
    background: transparent;
    border: none;
}

.sd-view-toggle .nav-link:hover {
    color: var(--sd-text-strong);
}

.sd-view-toggle .nav-link.active {
    background: #fff;
    color: var(--sd-primary);
    box-shadow: 0 1px 2px rgba(19, 36, 68, .08);
}

/* ==========================================================================
   5. Shared components
   ========================================================================== */

.sd-card {
    background: var(--sd-surface);
    border: 1px solid var(--sd-border);
    border-radius: var(--sd-radius-card);
}

.sd-card-pad {
    padding: 20px 24px;
}

.sd-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--sd-border-soft);
    font-size: 13.5px;
    font-weight: 700;
    color: var(--sd-navy);
}

.sd-card-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--sd-navy);
    margin: 0;
}

/* Chips / badges ---------------------------------------------------------- */

.sd-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.6;
    white-space: nowrap;
    background: #f0f3f8;
    color: var(--sd-text-muted);
    text-decoration: none;
}

a.sd-chip:hover {
    color: var(--sd-primary);
    background: var(--sd-primary-soft);
}

.sd-chip-blue {
    background: var(--sd-primary-soft);
    color: var(--sd-primary);
}

.sd-chip-gray {
    background: #f0f3f8;
    color: var(--sd-text-muted);
}

.sd-chip-green {
    background: var(--sd-green-soft);
    color: var(--sd-green);
}

.sd-chip-amber {
    background: var(--sd-amber-soft);
    color: var(--sd-amber);
}

.sd-chip-red {
    background: var(--sd-red-soft);
    color: var(--sd-red);
}

.sd-chip-purple {
    background: var(--sd-purple-soft);
    color: var(--sd-purple);
}

/* Notice-type badge: Solicitation & Award Notice → blue,
   Combined Synopsis/Solicitation → green, Sources Sought → purple,
   Presolicitation → amber, everything else → gray. */
.sd-badge-notice {
    display: inline-flex;
    align-items: center;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .01em;
    white-space: nowrap;
    background: #f0f3f8;
    color: var(--sd-text-muted);
}

.sd-badge-notice.is-solicitation,
.sd-badge-notice.is-award {
    background: var(--sd-primary-soft);
    color: var(--sd-primary);
}

.sd-badge-notice.is-combined {
    background: var(--sd-green-soft);
    color: var(--sd-green);
}

.sd-badge-notice.is-sources-sought {
    background: var(--sd-purple-soft);
    color: var(--sd-purple);
}

.sd-badge-notice.is-presolicitation {
    background: var(--sd-amber-soft);
    color: var(--sd-amber);
}

/* Due-date pill ----------------------------------------------------------- */

.sd-due-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
    background: #f0f3f8;
    color: var(--sd-text-muted);
}

.sd-due-pill.is-open {
    background: var(--sd-green-soft);
    color: var(--sd-green);
}

.sd-due-pill.is-soon {
    background: var(--sd-amber-soft);
    color: var(--sd-amber);
}

.sd-due-pill.is-urgent,
.sd-due-pill.is-expired {
    background: var(--sd-red-soft);
    color: var(--sd-red);
}

.sd-due-pill.is-none {
    background: #f0f3f8;
    color: var(--sd-text-faint);
}

/* Key-fact label ---------------------------------------------------------- */

.sd-kv-label {
    display: block;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--sd-text-faint);
}

.sd-kv-value {
    font-size: 13px;
    font-weight: 500;
    color: var(--sd-text-strong);
}

/* Result list ------------------------------------------------------------- */

.sd-result-list {
    background: var(--sd-surface);
    border: 1px solid var(--sd-border);
    border-radius: var(--sd-radius-card);
    overflow: hidden;
}

.sd-result-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--sd-border-soft);
}

.sd-result-row:last-child {
    border-bottom: none;
}

.sd-result-row:hover {
    background: #f9fafc;
}

.sd-result-title {
    font-size: 14.5px;
    font-weight: 600;
    color: var(--sd-navy);
    text-decoration: none;
    /* Notice titles are often one unbroken token — "CASE,AUGMENTOR,AIRC_End_
       Item_J85_NSN_2840…" — with no spaces to wrap at, which pushed the text
       outside the card. Break inside the word when there's nowhere else. */
    overflow-wrap: anywhere;
    word-break: break-word;
    min-width: 0;
}

.sd-result-title:hover {
    color: var(--sd-primary);
}

.sd-result-meta {
    font-size: 12.5px;
    color: var(--sd-text-muted);
}

/* ==========================================================================
   6. Buttons, forms, pagination (portal-scoped overrides)
   ========================================================================== */

body.has-opportunity-sidebar .btn {
    border-radius: var(--sd-radius-control);
    font-weight: 600;
}

body.has-opportunity-sidebar .btn-primary {
    background-image: none;
    background-color: var(--sd-primary);
    border-color: var(--sd-primary);
    color: #fff;
    box-shadow: none;
}

body.has-opportunity-sidebar .btn-primary:hover,
body.has-opportunity-sidebar .btn-primary:focus,
body.has-opportunity-sidebar .btn-primary:active,
body.has-opportunity-sidebar .btn-primary.active,
body.has-opportunity-sidebar .btn-check:checked + .btn-primary {
    background-color: var(--sd-primary-hover);
    border-color: var(--sd-primary-hover);
    color: #fff;
    box-shadow: none;
}

body.has-opportunity-sidebar .btn-primary:focus-visible {
    box-shadow: 0 0 0 .2rem rgba(46, 94, 234, .25);
}

body.has-opportunity-sidebar .btn-outline-primary {
    color: var(--sd-primary);
    border-color: var(--sd-border-input);
}

body.has-opportunity-sidebar .btn-outline-primary:hover {
    background-color: var(--sd-primary);
    border-color: var(--sd-primary);
    color: #fff;
}

.sd-btn-soft {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 14px;
    border: none;
    border-radius: var(--sd-radius-control);
    background: var(--sd-primary-soft);
    color: var(--sd-primary);
    font-size: 12.5px;
    font-weight: 600;
    font-family: inherit;
    text-decoration: none;
    cursor: pointer;
}

.sd-btn-soft:hover,
.sd-btn-soft:focus {
    background: #dfe8fd;
    color: var(--sd-primary-hover);
}

.sd-btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 14px;
    border: 1px solid var(--sd-border-input);
    border-radius: var(--sd-radius-control);
    background: var(--sd-surface);
    color: var(--sd-text);
    font-size: 12.5px;
    font-weight: 600;
    font-family: inherit;
    text-decoration: none;
    cursor: pointer;
}

.sd-btn-outline:hover,
.sd-btn-outline:focus {
    border-color: var(--sd-primary);
    color: var(--sd-primary);
}

/* Inputs */
body.has-opportunity-sidebar .form-control,
body.has-opportunity-sidebar .form-select {
    border-color: var(--sd-border-input);
    border-radius: var(--sd-radius-control);
    color: var(--sd-text-strong);
    font-size: 13.5px;
}

body.has-opportunity-sidebar .form-control:focus,
body.has-opportunity-sidebar .form-select:focus {
    border-color: var(--sd-primary);
    box-shadow: 0 0 0 3px rgba(46, 94, 234, .15);
}

body.has-opportunity-sidebar .form-control::placeholder {
    color: var(--sd-text-faint);
}

body.has-opportunity-sidebar .form-check-input:checked {
    background-color: var(--sd-primary);
    border-color: var(--sd-primary);
}

body.has-opportunity-sidebar .form-check-input:focus {
    border-color: var(--sd-primary);
    box-shadow: 0 0 0 3px rgba(46, 94, 234, .15);
}

body.has-opportunity-sidebar .form-label {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--sd-text-strong);
}

/* Pagination */
body.has-opportunity-sidebar .pagination,
.sd-pagination {
    gap: 6px;
}

/* Long pagers (the contractor listing runs to 40 pages) must wrap rather than
   push the page wider than the viewport. */
body.has-opportunity-sidebar .pagination {
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin-bottom: 0;
}

body.has-opportunity-sidebar .page-link,
.sd-pagination .page-link {
    border: 1px solid var(--sd-border-input);
    border-radius: 7px;
    color: var(--sd-text);
    font-size: 13px;
    font-weight: 500;
    padding: 6px 11px;
}

body.has-opportunity-sidebar .page-link:hover,
.sd-pagination .page-link:hover {
    background: var(--sd-primary-soft);
    border-color: var(--sd-primary-soft);
    color: var(--sd-primary);
}

body.has-opportunity-sidebar .page-item.active .page-link,
.sd-pagination .page-item.active .page-link {
    background: var(--sd-navy);
    border-color: var(--sd-navy);
    color: #fff;
}

body.has-opportunity-sidebar .page-item.disabled .page-link {
    color: var(--sd-text-faint);
    background: transparent;
    border-color: var(--sd-border);
}

/* ==========================================================================
   7. Select2 / Tom Select skin
   ========================================================================== */

body.has-opportunity-sidebar .select2-container--default .select2-selection--single,
body.has-opportunity-sidebar .select2-container--default .select2-selection--multiple {
    border: 1px solid var(--sd-border-input);
    border-radius: var(--sd-radius-control);
    min-height: 38px;
}

body.has-opportunity-sidebar .select2-container--default.select2-container--focus .select2-selection--multiple,
body.has-opportunity-sidebar .select2-container--default.select2-container--open .select2-selection--single,
body.has-opportunity-sidebar .select2-container--default.select2-container--open .select2-selection--multiple {
    border-color: var(--sd-primary);
    box-shadow: 0 0 0 3px rgba(46, 94, 234, .15);
}

body.has-opportunity-sidebar .select2-container--default .select2-selection--multiple .select2-selection__choice {
    background: var(--sd-primary-soft);
    border: none;
    border-radius: 999px;
    color: var(--sd-primary);
    font-size: 12px;
    font-weight: 600;
    padding: 2px 10px 2px 6px;
}

body.has-opportunity-sidebar .select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    color: var(--sd-primary);
    border: none;
    background: transparent;
}

body.has-opportunity-sidebar .select2-container--default .select2-results__option--highlighted[aria-selected] {
    background: var(--sd-primary-soft);
    color: var(--sd-primary);
}

body.has-opportunity-sidebar .ts-control,
body.has-opportunity-sidebar .ts-wrapper.single .ts-control {
    border: 1px solid var(--sd-border-input);
    border-radius: var(--sd-radius-control);
    font-size: 13.5px;
    color: var(--sd-text-strong);
}

body.has-opportunity-sidebar .ts-wrapper.focus .ts-control {
    border-color: var(--sd-primary);
    box-shadow: 0 0 0 3px rgba(46, 94, 234, .15);
}

body.has-opportunity-sidebar .ts-control > .item {
    background: var(--sd-primary-soft);
    color: var(--sd-primary);
    border-radius: 999px;
    font-weight: 600;
}

/* ==========================================================================
   8. Modal skin (shared portal modals)
   ========================================================================== */

body.has-opportunity-sidebar .sd-modal {
    border: 1px solid var(--sd-border);
    border-radius: var(--sd-radius-card);
    box-shadow: 0 18px 48px rgba(19, 36, 68, .18);
}

body.has-opportunity-sidebar .sd-modal .modal-header {
    padding: 18px 24px 14px;
    border-bottom: 1px solid var(--sd-border-soft);
}

body.has-opportunity-sidebar .sd-modal .modal-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--sd-navy);
}

body.has-opportunity-sidebar .sd-modal .modal-body {
    padding: 20px 24px;
    color: var(--sd-text);
    font-size: 13.5px;
}

body.has-opportunity-sidebar .sd-modal .modal-footer {
    padding: 14px 24px 18px;
    border-top: 1px solid var(--sd-border-soft);
    gap: 8px;
}

body.has-opportunity-sidebar .sd-modal .modal-footer > * {
    margin: 0;
}

body.has-opportunity-sidebar .sd-modal h4 {
    font-size: 19px;
    font-weight: 700;
    color: var(--sd-navy);
}

body.has-opportunity-sidebar .sd-modal h5,
body.has-opportunity-sidebar .sd-modal h6 {
    color: var(--sd-text-strong);
    font-weight: 600;
}

body.has-opportunity-sidebar .sd-modal .form-check-label,
body.has-opportunity-sidebar .sd-modal .form-label {
    font-size: 13px;
    color: var(--sd-text);
}

body.has-opportunity-sidebar .sd-modal .btn {
    padding: 9px 18px;
    font-size: 13.5px;
}

body.has-opportunity-sidebar .sd-modal .btn-secondary {
    background: #fff;
    border-color: var(--sd-border-input);
    color: var(--sd-text);
}

body.has-opportunity-sidebar .sd-modal .btn-secondary:hover {
    background: #f0f3f8;
    border-color: var(--sd-border-input);
    color: var(--sd-text-strong);
}

body.has-opportunity-sidebar .sd-modal .btn-danger {
    background-color: var(--sd-red);
    border-color: var(--sd-red);
    background-image: none;
}

body.has-opportunity-sidebar .sd-modal .btn-danger:hover {
    background-color: #a71f1f;
    border-color: #a71f1f;
}

/* Subscribe modal specifics */
.sd-modal-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 999px;
    background: var(--sd-primary-soft);
    color: var(--sd-primary);
    font-size: 1.75rem;
}

.sd-modal-lead {
    font-size: 13.5px;
    color: var(--sd-text-muted);
}

.sd-feature-list {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: left;
}

.sd-feature-list li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
    color: var(--sd-text);
    padding: 4px 0;
}

.sd-feature-list li i {
    line-height: 1.5;
}

.sd-price-block {
    display: inline-block;
    border: 1px solid var(--sd-border);
    border-radius: var(--sd-radius-card);
    padding: 14px 26px;
    background: var(--sd-bg);
}

.sd-price-block .sd-price {
    font-size: 26px;
    font-weight: 700;
    color: var(--sd-navy);
    line-height: 1.1;
}

/* ==========================================================================
   9. Misc
   ========================================================================== */

/* Brand colour for plain content links. Kept at element-level specificity via
   :where() so any component class (buttons, nav links, tabs, result titles)
   still controls its own colour. */
:where(body.has-opportunity-sidebar) a {
    color: var(--sd-primary);
}

:where(body.has-opportunity-sidebar) a:hover {
    color: var(--sd-primary-hover);
}

body.has-opportunity-sidebar .page-header-title,
body.has-opportunity-sidebar h1 {
    color: var(--sd-navy);
}

/* The top bar is sticky, so page-level sticky rails need to clear it. */
body.has-opportunity-sidebar .sidebar-scrollable-content {
    top: calc(var(--sd-topbar-height) + 14px);
}

body.has-opportunity-sidebar [id] {
    scroll-margin-top: calc(var(--sd-topbar-height) + 12px);
}

.sd-visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
