.portal-home-nav {
    position: relative;
    z-index: 50;
    display: flex;
    flex: 0 0 auto;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    gap: 4px 12px;
    width: 100%;
    min-width: 0;
    margin: 0 0 8px;
    padding: 3px 8px;
    box-sizing: border-box;
    border: 1px solid #dbe3ee;
    border-radius: 8px;
    background: #fff;
    color: #334155;
    font: 400 14px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif;
}
.portal-home-nav .portal-home-link,
.portal-home-nav .portal-logout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 32px;
    max-width: 100%;
    box-sizing: border-box;
    padding: 5px 6px;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: #1e40af;
    box-shadow: none;
    font: 500 14px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif;
    text-decoration: none;
    text-align: left;
    cursor: pointer;
    transition: background-color .15s;
}
.portal-home-nav .portal-home-link svg { width: 16px; height: 16px; flex: 0 0 16px; }
.portal-home-nav .portal-route {
    display: flex;
    flex-wrap: nowrap;
    flex: 1 1 auto;
    align-items: center;
    gap: 4px;
    min-width: 0;
    max-width: 100%;
}
.portal-home-nav .portal-route-separator { color: #94a3b8; }
.portal-home-nav .portal-route > a { min-width: 0; white-space: nowrap; }
.portal-home-nav .portal-route > a span,
.portal-home-nav .portal-bp-toggle > span:first-child {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.portal-home-nav .portal-session {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    min-width: 0;
    max-width: 40%;
    flex: 0 1 auto;
    margin-left: auto;
}
.portal-home-nav .portal-account {
    min-width: 0;
    max-width: 32ch;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}
.portal-home-nav .portal-role {
    flex: 0 0 auto;
    padding: 2px 6px;
    border-radius: 4px;
    background: #f1f5f9;
    color: #475569;
    font-size: 14px;
}
.portal-home-nav .portal-logout { flex: 0 0 auto; color: #475569; }
.portal-home-nav .portal-home-link:hover,
.portal-home-nav .portal-logout:hover {
    background: #eff6ff;
    color: #1e40af;
    text-decoration: none;
    transform: none;
}
.portal-home-nav a:focus-visible { outline: 2px solid #2563eb; outline-offset: 2px; }
.portal-home-nav a:active { background: #dbeafe; }
body.theme-dark .portal-home-nav { background: #0f172a; color: #e2e8f0; border-color: #334155; }
body.theme-dark .portal-home-nav a { color: #bfdbfe; }
body.theme-dark .portal-home-nav a:hover { background: #1e293b; }
body.theme-dark .portal-home-nav .portal-role { background: #1e293b; color: #cbd5e1; }
.app-shell > .portal-home-nav { margin: 0; border-radius: 0; border-width: 0 0 1px; padding: 3px 12px; }
@media (max-width: 540px) {
    .portal-home-nav { gap: 2px 8px; padding: 3px 6px; }
    .portal-home-nav .portal-session { gap: 4px; max-width: 48%; }
    .portal-home-nav .portal-route { gap: 2px; }
}
@media (pointer: coarse) {
    .portal-home-nav .portal-home-link, .portal-home-nav .portal-logout { min-height: 40px; }
}
@media (prefers-reduced-motion: reduce) { .portal-home-nav a { transition: none; } }
@media print { .portal-home-nav { display: none !important; } }
.portal-home-nav .portal-bp { position: relative; min-width: 0; max-width: 100%; }
.portal-home-nav .portal-bp-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 32px;
    padding: 5px 8px;
    border-radius: 5px;
    color: #1e40af;
    background: #eff6ff;
    font: 500 14px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif;
    cursor: pointer;
    list-style: none;
}
.portal-home-nav .portal-bp-toggle::-webkit-details-marker { display: none; }
.portal-home-nav .portal-bp-prefix { color: #64748b; font-size: 12px; }
.portal-home-nav .portal-bp-toggle:focus-visible { outline: 2px solid #2563eb; outline-offset: 2px; }
.portal-home-nav .portal-bp-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    width: 240px;
    max-width: calc(100vw - 48px);
    padding: 4px;
    border: 1px solid #dbe3ee;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 8px 24px rgb(15 23 42 / 16%);
}
.portal-home-nav .portal-bp-menu a {
    display: block;
    padding: 8px 10px;
    border-radius: 4px;
    color: #334155;
    font: 400 14px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif;
    text-decoration: none;
}
.portal-home-nav .portal-bp-menu a:hover,
.portal-home-nav .portal-bp-menu a[aria-current="page"] { color: #1e40af; background: #eff6ff; }
.portal-home-nav .portal-bp-menu a[aria-current="page"] { font-weight: 600; }
body.theme-dark .portal-bp-toggle,
body.theme-dark .portal-bp-menu { background: #1e293b; color: #e2e8f0; border-color: #334155; }
body.theme-dark .portal-bp-prefix { color: #cbd5e1; }
@media (pointer: coarse) { .portal-home-nav .portal-bp-toggle { min-height: 40px; } }
@media (max-width: 600px) {
    .portal-home-nav .portal-bp { position: static; }
    .portal-home-nav .portal-bp-menu { left: 6px; }
}
