:root {
    --pt-surface: #ffffff;
    --pt-surface-soft: #f4f7fb;
    --pt-surface-raised: #ffffff;
    --pt-text: #10233f;
    --pt-text-muted: #5d6f86;
    --pt-border: #dce4ee;
    --pt-overlay: rgba(8, 18, 39, 0.72);
    color-scheme: light;
}

html[data-theme="dark"] {
    --pt-surface: #111a32;
    --pt-surface-soft: #0a1124;
    --pt-surface-raised: #17213d;
    --pt-text: #f4f7fb;
    --pt-text-muted: #b5c1d2;
    --pt-border: #33415f;
    --pt-overlay: rgba(1, 5, 15, 0.86);
    color-scheme: dark;
}

.pt-theme-toggle {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--pt-border);
    border-radius: 12px;
    color: #2a3c92;
    background: var(--pt-surface);
    cursor: pointer;
    transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.pt-theme-toggle:hover,
.pt-theme-toggle:focus-visible {
    color: #2a3c92;
    background: #eef8fc;
    border-color: #91d5e9;
    transform: translateY(-1px);
}

.pt-theme-toggle:focus-visible {
    outline: 3px solid rgba(0, 174, 239, 0.24);
    outline-offset: 2px;
}

.pt-theme-toggle:active {
    color: #2a3c92;
    background: #dff3fa;
    border-color: #6fc5df;
    transform: translateY(0);
}

.pt-theme-toggle[data-active-theme="dark"] { color: #ffc51b; }
.pt-theme-toggle-mobile { width: 100%; height: auto; padding: 11px 14px; gap: 9px; }

html[data-theme="dark"] .pt-theme-toggle {
    color: #ffc51b;
    background: #111a32;
    border-color: #33415f;
}

html[data-theme="dark"] .pt-theme-toggle:hover,
html[data-theme="dark"] .pt-theme-toggle:focus-visible {
    color: #ffd861;
    background: #1d2a49;
    border-color: #607397;
}

html[data-theme="dark"] .pt-theme-toggle:active {
    color: #ffe38a;
    background: #243454;
    border-color: #7185aa;
}

.pt-alert-center-trigger {
    position: relative;
    width: 38px;
    height: 38px;
    display: inline-grid;
    place-items: center;
    border: 1px solid var(--pt-border);
    border-radius: 12px;
    color: #2a3c92;
    background: var(--pt-surface);
    cursor: pointer;
}

.pt-alert-center-trigger:hover { color: #007fae; border-color: #9fcce0; }
.pt-alert-center-mobile { width: 100%; border: 0; text-align: start; }
.pt-alert-center-mobile > span { margin-inline-start: auto; }
.pt-alert-center-count {
    position: absolute;
    inset-block-start: -5px;
    inset-inline-end: -5px;
    min-width: 18px;
    height: 18px;
    display: grid;
    place-items: center;
    padding-inline: 4px;
    border: 2px solid var(--pt-surface);
    border-radius: 999px;
    color: #fff;
    background: #e13f48;
    font-size: .6rem;
    font-weight: 800;
}

/* Keep identity, navigation and utility controls distinct without dividers. */
.logo-section {
    margin-inline-end: 16px;
}

.header-actions {
    margin-inline-start: 16px;
    padding-inline-start: 0;
    border-inline-start: 0;
}

/* The wordmark already identifies the brand. Hide the secondary tagline when
   it would compete with primary navigation on normal laptop displays. */
@media (max-width: 1600px) {
    .header-container .brand-text { display: none !important; }
}

body.pt-alert-center-open { overflow: hidden; }

.pt-live-stats-ribbon {
    min-height: 42px;
    display: flex;
    align-items: center;
    color: #fff;
    background: linear-gradient(90deg, #17245f, #243a93);
    border-bottom: 1px solid rgba(255, 255, 255, .12);
}

.pt-live-stats-inner {
    width: min(1180px, calc(100% - 32px));
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(22px, 5vw, 64px);
    margin-inline: auto;
}

.pt-live-stats-inner a {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #f8fbff;
    font-size: .76rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.pt-live-stats-inner a:hover { color: #75ddff; }
.pt-live-stats-inner strong { color: #fff; font-size: .86rem; font-weight: 900; }
.pt-live-stat-dot {
    width: 8px;
    height: 8px;
    flex: 0 0 8px;
    border-radius: 50%;
    background: #19d7a0;
    box-shadow: 0 0 0 3px rgba(25, 215, 160, .13);
}
.pt-alert-center-backdrop[hidden], .pt-alert-center[hidden] { display: none !important; }
.pt-alert-center-backdrop {
    position: fixed;
    inset: 0;
    z-index: 99980;
    background: rgba(8, 18, 39, .58);
    backdrop-filter: blur(5px);
}

.pt-alert-center {
    position: fixed;
    z-index: 99990;
    inset-block-start: 82px;
    inset-inline-end: max(18px, calc((100vw - 1180px) / 2));
    width: min(430px, calc(100vw - 28px));
    max-height: calc(100dvh - 102px);
    overflow-y: auto;
    border: 1px solid var(--pt-border);
    border-radius: 20px;
    color: var(--pt-text);
    background: var(--pt-surface-raised);
    box-shadow: 0 28px 80px rgba(8, 18, 39, .34);
}

.pt-alert-center-head {
    position: sticky;
    top: 0;
    z-index: 2;
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 13px 16px;
    color: #fff;
    background: linear-gradient(135deg, #1d2d70, #2a3c92);
}

.pt-alert-center-head span { color: #60d1ff; font-size: .68rem; font-weight: 800; }
.pt-alert-center-head h2 { margin: 2px 0 0; color: #fff !important; font-size: 1rem; font-weight: 850; }
.pt-alert-center-head button {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border: 1px solid rgba(255,255,255,.25);
    border-radius: 11px;
    color: #fff;
    background: rgba(255,255,255,.09);
    cursor: pointer;
}

.pt-alert-center-body { display: grid; gap: 13px; padding: 16px; }
.pt-alert-email-row,
.pt-alert-match-row,
.pt-alert-push-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 11px;
    padding: 12px;
    border: 1px solid var(--pt-border);
    border-radius: 13px;
    color: var(--pt-text);
    background: var(--pt-surface-soft);
    text-decoration: none;
}

.pt-alert-email-row > i:first-child,
.pt-alert-match-row > i:first-child,
.pt-alert-push-row > i:first-child { color: #007fae; font-size: 1rem; }
.pt-alert-email-row > i:last-child { color: #11845b; }
.pt-alert-email-row span,
.pt-alert-match-row span,
.pt-alert-push-row span { min-width: 0; display: grid; gap: 2px; }
.pt-alert-email-row small,
.pt-alert-match-row small,
.pt-alert-push-row small { color: var(--pt-text-muted); font-size: .7rem; }
.pt-alert-email-row strong { overflow: hidden; text-overflow: ellipsis; font-size: .82rem; }
.pt-alert-match-row strong, .pt-alert-push-row strong { font-size: .78rem; line-height: 1.45; }
.pt-alert-match-row:hover { color: #2a3c92; border-color: #a9c8f1; }

.pt-alert-frequency-section { display: grid; gap: 9px; }
.pt-alert-section-title { display: flex; align-items: end; justify-content: space-between; gap: 12px; }
.pt-alert-section-title strong { font-size: .78rem; }
.pt-alert-section-title small { color: var(--pt-text-muted); font-size: .65rem; }
.pt-alert-frequency-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.pt-alert-frequency-grid a {
    min-height: 62px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 3px;
    padding: 8px;
    border: 1px solid var(--pt-border);
    border-radius: 12px;
    color: var(--pt-text);
    background: var(--pt-surface-soft);
    font-size: .68rem;
    font-weight: 750;
    text-decoration: none;
    text-align: center;
}
.pt-alert-frequency-grid a:hover { border-color: #00aeef; color: #2a3c92; }
.pt-alert-frequency-grid span { color: #007fae; font-size: 1rem; font-weight: 900; }
.pt-alert-push-row button {
    min-height: 36px;
    padding: 6px 11px;
    border: 0;
    border-radius: 9px;
    color: #fff;
    background: #2a3c92;
    font: inherit;
    font-size: .72rem;
    font-weight: 800;
    cursor: pointer;
}
.pt-alert-push-row button:disabled { opacity: .45; cursor: not-allowed; }
.pt-alert-push-status { grid-column: 2 / -1; }
.pt-alert-center-links { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pt-alert-center-links a {
    padding: 10px;
    border: 1px solid var(--pt-border);
    border-radius: 11px;
    color: #2a3c92;
    background: var(--pt-surface);
    font-size: .7rem;
    font-weight: 800;
    text-align: center;
    text-decoration: none;
}
.pt-alert-center-links a span { display: inline-grid; place-items: center; min-width: 18px; height: 18px; border-radius: 99px; color:#fff; background:#e13f48; }

.pt-alert-center-signed-out { padding: 30px 24px; text-align: center; }
.pt-alert-center-signed-out > i { color: #00aeef; font-size: 2rem; }
.pt-alert-center-signed-out h3 { margin: 12px 0 5px; color: var(--pt-text); font-size: 1.05rem; }
.pt-alert-center-signed-out p { margin: 0 0 17px; color: var(--pt-text-muted); font-size: .8rem; line-height: 1.7; }
.pt-alert-center-signed-out a { display: inline-flex; padding: 9px 18px; border-radius: 10px; color:#fff; background:#2a3c92; font-size:.8rem; font-weight:800; text-decoration:none; }

html[data-theme="dark"] .pt-alert-center-trigger { color: #ffc51b; }

html[data-theme="dark"] body,
html[data-theme="dark"] #main-content {
    background: var(--pt-surface-soft) !important;
    color: var(--pt-text) !important;
}

html[data-theme="dark"] header {
    background-color: #111a32 !important;
    color: var(--pt-text) !important;
    border-color: var(--pt-border) !important;
    box-shadow: 0 2px 18px rgba(0, 0, 0, 0.28) !important;
}

html[data-theme="dark"] .nav-link,
html[data-theme="dark"] .brand-subtitle,
html[data-theme="dark"] .user-menu-name,
html[data-theme="dark"] .mobile-nav-link { color: var(--pt-text) !important; }

html[data-theme="dark"] .card,
html[data-theme="dark"] .pt-tender-card,
html[data-theme="dark"] .job-card,
html[data-theme="dark"] .op-panel,
html[data-theme="dark"] .pt-filter-card,
html[data-theme="dark"] .pt-context-filters,
html[data-theme="dark"] .user-menu-dropdown,
html[data-theme="dark"] .mobile-menu,
html[data-theme="dark"] .global-search-panel-inner {
    background: var(--pt-surface-raised) !important;
    border-color: var(--pt-border) !important;
    color: var(--pt-text) !important;
}

html[data-theme="dark"] .card-header,
html[data-theme="dark"] .card-body,
html[data-theme="dark"] .card-content,
html[data-theme="dark"] .info-item,
html[data-theme="dark"] .bg-light,
html[data-theme="dark"] .pt-card-footer,
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
    background: #121d36 !important;
    border-color: var(--pt-border) !important;
    color: var(--pt-text) !important;
}

/* Form controls need more specificity than the light brand-system rules,
   whose :not() selectors otherwise keep navy text on the navy dark surface. */
html[data-theme="dark"] body input:not([type="checkbox"]):not([type="radio"]),
html[data-theme="dark"] body select,
html[data-theme="dark"] body textarea,
html[data-theme="dark"] body .form-control,
html[data-theme="dark"] body .form-select,
html[data-theme="dark"] body .op-input {
    color: #f4f7fb !important;
    caret-color: #68a9ff !important;
    -webkit-text-fill-color: #f4f7fb !important;
}

html[data-theme="dark"] body input::placeholder,
html[data-theme="dark"] body textarea::placeholder,
html[data-theme="dark"] body .form-control::placeholder,
html[data-theme="dark"] body .op-input::placeholder {
    color: #aebdd1 !important;
    -webkit-text-fill-color: #aebdd1 !important;
    opacity: 1;
}

html[data-theme="dark"] body select option {
    color: #f4f7fb;
    background: #121d36;
}

html[data-theme="dark"] body input:-webkit-autofill,
html[data-theme="dark"] body input:-webkit-autofill:hover,
html[data-theme="dark"] body input:-webkit-autofill:focus,
html[data-theme="dark"] body textarea:-webkit-autofill,
html[data-theme="dark"] body select:-webkit-autofill {
    -webkit-text-fill-color: #f4f7fb !important;
    caret-color: #68a9ff !important;
    -webkit-box-shadow: 0 0 0 1000px #121d36 inset !important;
    box-shadow: 0 0 0 1000px #121d36 inset !important;
}

html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] h4,
html[data-theme="dark"] h5,
html[data-theme="dark"] h6,
html[data-theme="dark"] .job-card-title,
html[data-theme="dark"] .pt-tender-card h3,
html[data-theme="dark"] .pt-organization-name,
html[data-theme="dark"] .text-dark { color: var(--pt-text) !important; }

html[data-theme="dark"] p,
html[data-theme="dark"] .text-muted,
html[data-theme="dark"] .job-card-meta,
html[data-theme="dark"] .pt-card-meta,
html[data-theme="dark"] .pt-deadline-summary { color: var(--pt-text-muted) !important; }

html[data-theme="dark"] footer { background: #081026 !important; }

html[data-theme="dark"] .pt-marketplace {
    background: radial-gradient(circle at 8% 14%, rgba(0, 174, 239, .08), transparent 24rem), #0a1124 !important;
}

html[data-theme="dark"] .pt-browse-toolbar,
html[data-theme="dark"] .pt-discovery {
    background: #0a1124 !important;
    border-color: var(--pt-border) !important;
}

html[data-theme="dark"] .pt-browse-toolbar-inner,
html[data-theme="dark"] .pt-browse-title-icon,
html[data-theme="dark"] .pt-sort-control,
html[data-theme="dark"] .pt-status-tabs a,
html[data-theme="dark"] .pt-filter-drawer > summary,
html[data-theme="dark"] .pt-filter-card,
html[data-theme="dark"] .pt-check-option,
html[data-theme="dark"] .pt-personalization-bar,
html[data-theme="dark"] .pt-context-filters {
    background: #17213d !important;
    border-color: var(--pt-border) !important;
    color: var(--pt-text) !important;
}

html[data-theme="dark"] .pt-status-tabs a.is-active,
html[data-theme="dark"] .pt-status-tabs a:hover,
html[data-theme="dark"] .pt-personalization-modes,
html[data-theme="dark"] .pt-personalization-modes a.is-active,
html[data-theme="dark"] .pt-context-chip,
html[data-theme="dark"] .pt-add-tender {
    background: #202e52 !important;
    border-color: #425273 !important;
    color: #dbe9ff !important;
}

/* Keep status totals legible in dark mode. The marketplace count badge uses
   the light-theme --pt-soft token, so inheriting the pale tab text made the
   number effectively disappear against its pale background. */
html[data-theme="dark"] .pt-status-tabs a span,
html[data-theme="dark"] .job-status-tabs small {
    background: #0f1931 !important;
    border: 1px solid #425273;
    color: #e7efff !important;
}

html[data-theme="dark"] .pt-status-tabs a.is-active span,
html[data-theme="dark"] .pt-status-tabs a:hover span,
html[data-theme="dark"] .job-status-tabs a.is-active small,
html[data-theme="dark"] .job-status-tabs a:hover small {
    background: #1769e0 !important;
    border-color: #68a9ff;
    color: #fff !important;
}

html[data-theme="dark"] .job-status-tabs a {
    background: #17213d !important;
    border-color: var(--pt-border) !important;
    color: var(--pt-text) !important;
}

html[data-theme="dark"] .job-status-tabs a.is-active,
html[data-theme="dark"] .job-status-tabs a:hover {
    background: #202e52 !important;
    border-color: #425273 !important;
    color: #dbe9ff !important;
}

html[data-theme="dark"] .pt-context-chip.is-active {
    background: #293d73 !important;
    border-color: #5570ae !important;
    color: #fff !important;
}

html[data-theme="dark"] .pt-browse-title h1,
html[data-theme="dark"] .pt-context-path,
html[data-theme="dark"] .pt-context-path strong,
html[data-theme="dark"] .pt-personalization-summary,
html[data-theme="dark"] .pt-sort-control select,
html[data-theme="dark"] .pt-filter-drawer > summary {
    color: var(--pt-text) !important;
}

html[data-theme="dark"] .pt-context-total,
html[data-theme="dark"] .pt-sort-control > span {
    color: var(--pt-text-muted) !important;
}

body.pt-quick-view-open { overflow: hidden !important; }

.pt-quick-view[hidden] { display: none !important; }
.pt-quick-view {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: grid;
    place-items: center;
    padding: 18px;
}

.pt-quick-view-backdrop {
    position: absolute;
    inset: 0;
    background: var(--pt-overlay);
    backdrop-filter: blur(7px);
}

.pt-quick-view-dialog {
    position: relative;
    width: min(1180px, 96vw);
    height: min(880px, 94vh);
    display: grid;
    grid-template-rows: auto 1fr;
    overflow: hidden;
    border: 1px solid var(--pt-border);
    border-radius: 24px;
    background: var(--pt-surface-soft);
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.38);
    transform: translateY(10px) scale(.99);
    opacity: 0;
    transition: transform 180ms ease, opacity 180ms ease;
}

.pt-quick-view.is-open .pt-quick-view-dialog { transform: none; opacity: 1; }

.pt-quick-view-toolbar {
    min-height: 66px;
    display: grid;
    grid-template-columns: minmax(150px, 1fr) auto minmax(150px, 1fr);
    align-items: center;
    gap: 16px;
    padding: 10px 16px;
    background: var(--pt-surface-raised);
    border-bottom: 1px solid var(--pt-border);
    color: var(--pt-text);
}

.pt-quick-view-heading { display: flex; flex-direction: column; line-height: 1.3; }
.pt-quick-view-kicker { color: #007fae; font-size: .72rem; font-weight: 800; }
.pt-quick-view-heading strong { font-size: .96rem; }
.pt-quick-view-navigation, .pt-quick-view-actions { display: flex; align-items: center; gap: 8px; }
.pt-quick-view-actions { justify-content: flex-end; }

.pt-quick-view button,
.pt-quick-view-actions a {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 7px 11px;
    border: 1px solid var(--pt-border);
    border-radius: 11px;
    background: var(--pt-surface);
    color: var(--pt-text);
    text-decoration: none;
    font: inherit;
    font-size: .78rem;
    font-weight: 750;
    cursor: pointer;
}

.pt-quick-view button:disabled { opacity: .36; cursor: not-allowed; }
.pt-quick-view button:not(:disabled):hover,
.pt-quick-view-actions a:hover { border-color: #2a3c92; color: #2a3c92; }
.pt-quick-view-close { width: 40px; padding: 0 !important; }
[data-quick-view-position] { min-width: 54px; text-align: center; color: var(--pt-text-muted); font-size: .75rem; }

.pt-quick-view-frame {
    width: 100%;
    height: 100%;
    border: 0;
    background: var(--pt-surface-soft);
    opacity: 1;
    transition: opacity 120ms ease;
}

.pt-quick-view.is-loading .pt-quick-view-frame { opacity: 0; }
.pt-quick-view-loading {
    display: none;
    position: absolute;
    inset: 67px 0 0;
    z-index: 2;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 13px;
    color: var(--pt-text-muted);
}
.pt-quick-view.is-loading .pt-quick-view-loading { display: flex; }
.pt-quick-view-loading span { width: 8px; height: 8px; display: inline-block; border-radius: 999px; background: #2a3c92; animation: pt-pulse 800ms infinite alternate; }
.pt-quick-view-loading span:nth-child(2) { animation-delay: 120ms; }
.pt-quick-view-loading span:nth-child(3) { animation-delay: 240ms; }
@keyframes pt-pulse { to { opacity: .28; transform: translateY(-6px); } }

html.pt-quick-view-document body > header,
html.pt-quick-view-document body > footer,
html.pt-quick-view-document .global-search-backdrop,
html.pt-quick-view-document .global-search-panel,
html.pt-quick-view-document .profile-completion-banner { display: none !important; }
html.pt-quick-view-document body { padding: 0 !important; }
html.pt-quick-view-document #main-content { min-height: 100vh; padding: 18px 0 40px; }
html.pt-quick-view-document .breadcrumb { display: none !important; }

html[data-theme="dark"].pt-quick-view-document .op-action-bar,
html[data-theme="dark"].pt-quick-view-document .op-calendar-options {
    background: var(--pt-surface-raised) !important;
    border-color: var(--pt-border) !important;
    color: var(--pt-text) !important;
}

html[data-theme="dark"].pt-quick-view-document .op-action-copy strong,
html[data-theme="dark"].pt-quick-view-document .op-calendar-options strong {
    color: var(--pt-text) !important;
}

html[data-theme="dark"].pt-quick-view-document .op-action-copy small,
html[data-theme="dark"].pt-quick-view-document .op-calendar-provider-copy small {
    color: var(--pt-text-muted) !important;
}

html[data-theme="dark"].pt-quick-view-document .op-calendar-options a:hover,
html[data-theme="dark"].pt-quick-view-document .op-calendar-options a:focus-visible {
    background: #202e52 !important;
}

.op-match-badge { max-width: 100%; white-space: normal; }
.op-match-panel li { margin-block: 4px; }

[data-opportunity-card-quick-view] { cursor: pointer; }
[data-opportunity-card-quick-view]:focus-visible {
    outline: 3px solid rgba(0, 127, 174, .42);
    outline-offset: 3px;
}

@media (max-width: 760px) {
    .pt-live-stats-ribbon { min-height: 38px; overflow-x: auto; scrollbar-width: none; }
    .pt-live-stats-ribbon::-webkit-scrollbar { display: none; }
    .pt-live-stats-inner {
        width: max-content;
        min-width: 100%;
        justify-content: flex-start;
        gap: 24px;
        padding-inline: 16px;
    }
    .pt-live-stats-inner a { min-height: 38px; font-size: .7rem; }

    .header-actions {
        margin-inline-start: 0;
        padding-inline-start: 0;
        border-inline-start: 0;
    }
    .logo-section { margin-inline-end: 0; }

    .pt-alert-center {
        inset: auto 8px 8px;
        width: calc(100vw - 16px);
        max-height: calc(100dvh - 16px);
        border-radius: 18px;
    }
    .pt-alert-center-links { grid-template-columns: 1fr; }
    .pt-quick-view { padding: 0; }
    .pt-quick-view-dialog { width: 100vw; height: 100dvh; border: 0; border-radius: 0; }
    .pt-quick-view-toolbar { grid-template-columns: 1fr auto; gap: 8px; padding: 8px 10px; }
    .pt-quick-view-heading { display: none; }
    .pt-quick-view-navigation { justify-self: start; }
    .pt-quick-view-actions { justify-self: end; }
    .pt-quick-view-actions a span,
    .pt-quick-view-navigation button span { display: none; }
    .pt-quick-view-loading { inset-block-start: 55px; }
}

@media (prefers-reduced-motion: reduce) {
    .pt-quick-view-dialog,
    .pt-quick-view-frame,
    .pt-theme-toggle { transition: none !important; }
    .pt-quick-view-loading span { animation: none; }
}
