
.ps-global-header,
.ps-global-header * {
    box-sizing:border-box;
}

.ps-global-header {
    position:relative;
    z-index:100;
    width:100%;
    background:#fff;
    color:#092958;
    box-shadow:0 1px 6px #061a3012;
    font-family:Arial,Helvetica,sans-serif;
}

.ps-global-header .header-row {
    min-height:89px;
    display:flex;
    align-items:center;
    gap:clamp(10px,1.7vw,28px);
    padding:12px clamp(14px,3.2vw,52px);
}

.ps-global-header .brand {
    flex:0 0 auto;
    text-decoration:none;
    color:#08275b;
    font:400 clamp(23px,2.45vw,38px)/1 Georgia,serif;
    letter-spacing:-.022em;
    white-space:nowrap;
}

.ps-global-header .brand-separator {
    height:28px;
    width:1px;
    background:#8b9bb2;
    flex:0 0 1px;
}

.ps-global-header .ps-home-tools {
    display:flex;
    align-items:center;
    flex:1 1 600px;
    min-width:0;
    max-width:760px;
    height:49px;
    background:#fff;
    border:1px solid #7290ba;
    box-shadow:0 3px 9px #001a3324;
    border-radius:999px;
    padding:4px 5px 4px 16px;
}

.ps-global-header #ps-home-search {
    display:flex;
    align-items:center;
    flex:1 1 auto;
    min-width:0;
    height:100%;
    margin:0;
    gap:12px;
    background:transparent;
    border:0;
}

.ps-global-header .ps-search-icon {
    color:#092b60;
    width:23px;
    height:23px;
    flex:0 0 auto;
}

.ps-global-header #ps-home-query {
    width:100%;
    min-width:0;
    flex:1;
    border:0;
    background:transparent;
    color:#12334f;
    font:16px Arial,sans-serif;
    outline:0;
    padding:0;
    height:100%;
}

.ps-global-header .ps-search-submit {
    display:none;
}

.ps-global-header .ps-tool-divider {
    width:1px;
    height:26px;
    background:#8b9bb2;
    margin:0 13px 0 6px;
    flex:0 0 1px;
}

.ps-global-header .ps-ai-tutor-button {
    border:0;
    border-radius:999px;
    background:linear-gradient(#0b397c,#062558);
    color:white;
    font:600 14px Arial,sans-serif;
    white-space:nowrap;
    height:37px;
    padding:0 20px;
    cursor:pointer;
    flex:0 0 auto;
}

.ps-global-header .main-nav {
    margin-left:auto;
    display:flex;
    align-items:center;
    gap:13px;
    flex:0 0 auto;
}

.ps-global-header .main-nav a {
    display:inline-flex;
    align-items:center;
    justify-content:center;
    height:30px;
    min-width:88px;
    padding:0 14px;
    border:1px solid #496aa0;
    border-radius:999px;
    color:#0b2a55;
    text-decoration:none;
    font:13px Arial,sans-serif;
    background:white;
}

.ps-global-header .main-nav a[aria-current="page"] {
    color:white;
    background:#062c60;
}

.ps-global-header .ps-search-message[hidden] {
    display:none;
}

.ps-global-header .ps-search-message {
    position:absolute;
    top:69px;
    left:38%;
    font-size:12px;
    border-radius:7px;
    color:#fff;
    background:#07345a;
    padding:6px 12px;
}

.ps-global-header .ps-visually-hidden {
    position:absolute!important;
    width:1px;
    height:1px;
    overflow:hidden;
    clip:rect(0,0,0,0);
    white-space:nowrap;
}

body:has(.ps-global-header) #polymath-search-launch {
    display:none!important;
}

@media(max-width:1220px) {
    .ps-global-header .header-row {
        flex-wrap:wrap;
        gap:10px;
        padding:12px 20px;
    }
    .ps-global-header .brand {
        font-size:28px;
    }
    .ps-global-header .brand-separator {
        display:none;
    }
    .ps-global-header .ps-home-tools {
        order:3;
        flex-basis:100%;
        max-width:none;
    }
}

@media(max-width:620px) {
    .ps-global-header .header-row {
        padding:12px;
    }
    .ps-global-header .brand {
        font-size:24px;
    }
    .ps-global-header .main-nav {
        gap:5px;
    }
    .ps-global-header .main-nav a {
        min-width:0;
        padding:0 10px;
        font-size:12px;
    }
    .ps-global-header .ps-home-tools {
        height:43px;
        padding-left:10px;
    }
    .ps-global-header .ps-ai-tutor-button {
        font-size:11px;
        height:33px;
        padding:0 9px;
    }
}

/* POLYMATH-AI-MODAL-FIX-20261116 */

/* Hide the dialog completely when closed. */
#ps-tutor-dialog[hidden] {
    display: none !important;
}

/* Full-screen darkened background. */
#ps-tutor-dialog:not([hidden]) {
    position: fixed !important;
    inset: 0 !important;
    z-index: 2147483000 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100vw !important;
    height: 100dvh !important;
    margin: 0 !important;
    padding: 18px !important;
    background: rgba(0, 15, 29, 0.83) !important;
    backdrop-filter: blur(5px);
    overflow-y: auto !important;
}

/* Centered conversation window. */
#ps-tutor-dialog .ps-tutor-panel {
    position: relative !important;
    display: flex !important;
    flex-direction: column !important;
    width: min(780px, 100%) !important;
    max-width: 780px !important;
    max-height: min(740px, 94dvh) !important;
    min-height: 0 !important;
    margin: auto !important;
    padding: 28px !important;
    overflow: hidden !important;
    background: #082840 !important;
    color: #e9f4f9 !important;
    border: 1px solid #23d8ee !important;
    border-radius: 16px !important;
    box-shadow: 0 24px 80px rgba(0,0,0,.65) !important;
    font-family: Arial, Helvetica, sans-serif !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
}

/* Ensure the conversation can scroll. */
#ps-tutor-dialog #ps-chat-history {
    min-height: 0 !important;
    overflow-y: auto !important;
}

/* Keep the close button visible. */
#ps-tutor-dialog #ps-tutor-close {
    position: absolute !important;
    top: 12px !important;
    right: 14px !important;
    z-index: 10 !important;
    color: #e9f4f9 !important;
    background: transparent !important;
    border: 0 !important;
    font-size: 26px !important;
    cursor: pointer !important;
}

@media (max-width: 620px) {
    #ps-tutor-dialog:not([hidden]) {
        padding: 8px !important;
    }

    #ps-tutor-dialog .ps-tutor-panel {
        padding: 20px 14px !important;
        max-height: 96dvh !important;
    }
}


/* POLYMATH-PRODUCTION-DIALOG-V4 */

html body #ps-tutor-dialog[hidden] {
    display: none !important;
}

html body #ps-tutor-dialog:not([hidden]) {
    position: fixed !important;
    inset: 0 !important;
    z-index: 2147483000 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100vw !important;
    height: 100dvh !important;
    margin: 0 !important;
    padding: 18px !important;
    background: rgba(0, 16, 30, .85) !important;
    backdrop-filter: blur(5px);
    overflow: auto !important;
}

html body #ps-tutor-dialog .ps-tutor-panel {
    position: relative !important;
    display: flex !important;
    flex-direction: column !important;
    box-sizing: border-box !important;
    width: min(780px, 100%) !important;
    max-width: 780px !important;
    max-height: 94dvh !important;
    min-height: 0 !important;
    margin: auto !important;
    padding: 28px !important;
    overflow: hidden !important;
    background: #082840 !important;
    color: #e9f4f9 !important;
    border: 1px solid #23d8ee !important;
    border-radius: 16px !important;
    box-shadow: 0 24px 80px rgba(0,0,0,.65) !important;
    font: 14px/1.5 Arial, sans-serif !important;
}

html body #ps-tutor-dialog #ps-chat-history {
    min-height: 0 !important;
    overflow-y: auto !important;
}

html body #ps-tutor-dialog #ps-tutor-close {
    position: absolute !important;
    top: 12px !important;
    right: 14px !important;
    z-index: 10 !important;
    color: #e9f4f9 !important;
    background: transparent !important;
    border: 0 !important;
    font-size: 26px !important;
    cursor: pointer !important;
}

@media (max-width: 620px) {
    html body #ps-tutor-dialog:not([hidden]) {
        padding: 8px !important;
    }

    html body #ps-tutor-dialog .ps-tutor-panel {
        padding: 22px 14px !important;
        max-height: 96dvh !important;
    }
}

/* Sitewide desktop header alignment */
@media (min-width:1051px) {
    .ps-global-header .header-row {
        flex-wrap:nowrap !important;
        gap:clamp(8px,1vw,16px) !important;
        padding:12px clamp(12px,2vw,30px) !important;
        min-height:89px;
    }

    .ps-global-header .brand {
        font-size:clamp(22px,2.2vw,34px);
    }

    .ps-global-header .brand-separator {
        display:block;
    }

    .ps-global-header .ps-home-tools {
        order:initial !important;
        flex:1 1 360px;
        min-width:200px;
        max-width:760px;
    }

    .ps-global-header .main-nav {
        margin-left:auto;
        gap:8px;
    }

    .ps-global-header .main-nav a {
        min-width:73px;
        padding:0 10px;
    }
}

/* POLYMATH UNIVERSAL HEADER — RIGHT-ALIGNED NAVIGATION */
@media (min-width: 1052px) {
    header.ps-global-header .header-row {
        display: flex !important;
        align-items: center !important;
        width: 100% !important;
    }

    header.ps-global-header .main-nav {
        margin-left: auto !important;
        display: flex !important;
        justify-content: flex-end !important;
        flex-shrink: 0 !important;
    }

    header.ps-global-header .main-nav a {
        text-transform: none !important;
        letter-spacing: normal !important;
    }
}
