/* ================================================================
   PUBLIC PLATFORM HEADER
   Shared across public /pb/ pages and the Account/Admin application
   shells so platform identity and account actions remain consistent.
   ================================================================ */
:root {
    --platform-public-header-bg: #222;
    --platform-public-header-border: #606b74;
    --platform-public-header-button: #4a555f;
    --platform-public-header-button-hover: #596773;
}

body.pb-public-platform-shell {
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
}


/* Legacy page-level top bars remain in a few templates only so their existing
   JavaScript can keep using established element IDs during this cleanup pass. */
.org-topbar[hidden],
.mskc-public-topbar[hidden],
.account-topbar[hidden] { display: none !important; }

.platform-public-header-host {
    width: 100%;
    min-height: 64px;
}

.platform-topbar,
.platform-topbar * {
    box-sizing: border-box;
}

.platform-topbar {
    min-height: 64px;
    width: 100%;
    padding: 12px clamp(16px, 3vw, 34px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    background: var(--platform-public-header-bg);
    color: #fff;
}

.platform-app-mobile-toggle {
    display: none;
    place-items: center;
    width: 38px !important;
    min-width: 38px;
    height: 36px;
    margin: 0 !important;
    padding: 0 !important;
    border: 1px solid var(--platform-public-header-border);
    border-radius: 6px;
    background: var(--platform-public-header-button);
    color: #fff;
    font: inherit;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}
.platform-app-mobile-toggle:hover,
.platform-app-mobile-toggle:focus-visible { background: var(--platform-public-header-button-hover); }

.platform-brand {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    color: #fff;
    text-decoration: none;
}
.platform-brand:hover,
.platform-brand:focus { color: #fff; text-decoration: none; }
.platform-brand strong {
    display: block;
    font-size: 17px;
    line-height: 1.2;
}
.platform-brand span {
    color: #bfd0dd;
    font-size: 10px;
    letter-spacing: .1em;
    line-height: 1.25;
    text-transform: uppercase;
}

/* Reserved for the platform-wide public menu when it is introduced. */
.platform-primary-nav[hidden] { display: none !important; }

.platform-top-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-left: auto;
    flex: 0 0 auto;
}

.platform-account-menu { position: relative; }
.platform-account-menu-button {
    display: inline-flex;
    width: auto !important;
    align-items: center;
    gap: 7px;
    max-width: 280px;
    margin: 0;
    padding: 8px 12px;
    border: 1px solid var(--platform-public-header-border);
    border-radius: 6px;
    background: var(--platform-public-header-button);
    color: #fff;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.35;
    cursor: pointer;
}
.platform-account-menu-button:hover,
.platform-account-menu-button:focus-visible { background: var(--platform-public-header-button-hover); }
.platform-account-icon {
    width: 17px;
    height: 17px;
    flex: 0 0 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.platform-account-name-full,
.platform-account-name-compact {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.platform-account-name-compact { display: none; }
.platform-account-chevron {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform .15s ease;
}
.platform-account-menu-button.is-open .platform-account-chevron { transform: rotate(180deg); }
.platform-account-dropdown {
    position: absolute;
    z-index: 500;
    top: calc(100% + 6px);
    right: 0;
    min-width: 170px;
    padding: 6px;
    border: 1px solid #c9c9c9;
    border-radius: 7px;
    background: #fff;
    box-shadow: 0 5px 18px rgba(0,0,0,.22);
}
.platform-account-dropdown[hidden] { display: none !important; }
.platform-account-dropdown-item,
.platform-top-actions .platform-account-dropdown-item {
    display: block;
    width: 100%;
    margin: 0;
    padding: 8px 10px;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: #2f2f2f;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}
.platform-account-dropdown-item:hover,
.platform-account-dropdown-item:focus,
.platform-top-actions .platform-account-dropdown-item:hover,
.platform-top-actions .platform-account-dropdown-item:focus { background: #ededed; color: #111; }

@media (max-width: 760px) {
    .platform-app-mobile-toggle { display: grid; }
}

@media (max-width: 720px) {
    .platform-topbar { gap: 10px; padding: 10px 12px; }
    .platform-brand strong { font-size: 15px; }
    .platform-brand span { font-size: 9px; }
    .platform-account-name-full { display: none; }
    .platform-account-name-compact { display: inline; }
    .platform-account-menu-button { max-width: 150px; padding: 7px 9px; }
}

@media (max-width: 430px) {
    .platform-brand strong { font-size: 14px; }
    .platform-brand span { display: none; }
    .platform-account-menu-button { max-width: 118px; }
}
