.pp-shell-title { flex: 1 1 auto; min-width: 0; }
.pp-shell-actions { display: flex; align-items: center; gap: 12px; flex: 0 0 auto; }
.pp-shell-title > button { flex-shrink: 0; }
.pp-account { position: relative; text-align: left; }
.pp-account-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 260px;
    padding: 6px 8px;
    border: 1px solid transparent;
    border-radius: 8px;
    color: #334155;
    text-align: left;
}
.pp-account-trigger:hover, .pp-account-trigger[aria-expanded="true"] {
    background: #f1f5f9;
    border-color: #e2e8f0;
}
.pp-account-trigger:focus-visible, .pp-account-panel a:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}
.pp-account-avatar {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 50%;
    background: #e0e7ff;
    color: #4338ca;
}
.pp-account-name { min-width: 0; }
.pp-account-name > div { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.pp-account-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    width: 300px;
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 96px);
    max-height: calc(100dvh - 96px);
    overflow-y: auto;
    overscroll-behavior: contain;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 12px 30px rgb(15 23 42 / 14%);
    z-index: 60;
}
.pp-account-heading { padding: 14px 16px; border-bottom: 1px solid #e2e8f0; background: #f8fafc; overflow-wrap: anywhere; }
.pp-account-links { padding: 6px; }
.pp-account-links a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 6px;
    color: #334155;
    font-size: 14px;
    line-height: 1.5;
}
.pp-account-links a:hover { background: #eef2ff; color: #4338ca; }
.pp-account-links i { width: 20px; flex-shrink: 0; text-align: center; color: #64748b; }
.pp-account-logout { border-top: 1px solid #e2e8f0; }
.pp-account-logout a, .pp-account-logout i { color: #be123c; }
.pp-account-logout a:hover { background: #fff1f2; color: #9f1239; }

/* Menu labels should not inherit the browser's link underline. */
.pp-sidebar a,
.pp-sidebar a:hover,
.pp-sidebar a:focus,
.pp-sidebar a:active,
.pp-account-panel a,
.pp-account-panel a:hover,
.pp-account-panel a:focus,
.pp-account-panel a:active {
    text-decoration: none;
}

/* Keep sidebar links readable and independent from legacy Bootstrap link rules. */
.pp-sidebar a,
.pp-sidebar a:visited {
    color: #d0c8fa !important;
    text-decoration: none !important;
    border-bottom: 0 !important;
}
.pp-sidebar a:hover,
.pp-sidebar a:focus,
.pp-sidebar a:active,
.pp-sidebar a[aria-current="page"] {
    color: #fff !important;
    text-decoration: none !important;
    border-bottom: 0 !important;
}
.pp-sidebar { width: 280px; max-width: calc(100vw - 48px); height: 100vh; height: 100dvh; }
.pp-sidebar-nav { min-height: 0; overscroll-behavior: contain; }
@media (min-width: 1024px) {
    .pp-sidebar[data-collapsed="true"] { width: 80px; }
    .pp-shell-frame[data-collapsed="true"] { padding-left: 80px; }
    .pp-shell-frame[data-collapsed="false"] { padding-left: 280px; }
}
@media (max-width: 639px) {
    .pp-shell-actions { gap: 4px; }
    .pp-account-name { display: none; }
    .pp-account-trigger { gap: 6px; padding: 4px; }
    .pp-shell-header > div { gap: 8px; }
    .pp-shell-title { gap: 6px; }
    .pp-shell-title h1 { font-size: 16px; }
}

@media print {
    .pp-sidebar,
    .pp-shell-header,
    .pp-account-panel,
    .pp-user-chat,
    .pp-ai-help,
    #pp-music-control,
    #pp-music-frame,
    .pp-role-guide-widget,
    #pp-page-loader-overlay,
    .pp-loader-backdrop,
    #pp-ai-api-loader,
    .pp-ai-api-loader,
    .swal2-container,
    .no-print,
    .hide-on-export,
    [data-user-chat],
    [data-ai-help],
    [data-role-guide-widget] {
        display: none !important;
        visibility: hidden !important;
    }

    .pp-shell-frame,
    .pp-shell-frame[data-collapsed="true"],
    .pp-shell-frame[data-collapsed="false"] {
        padding-left: 0 !important;
        margin-left: 0 !important;
    }
}
