/* Shared compact portal account header; the sidebar retains its layout. */
.mobile-navigation-toggle{display:none}
@media(max-width:720px){
 .sidebar{display:grid;grid-template-columns:94px minmax(0,1fr);align-items:center;padding:7px 12px 8px;gap:5px 10px}
 .sidebar .brand-logo{padding:0;width:94px}
 .sidebar .brand-logo-image{width:94px;max-width:94px;height:46px;object-fit:contain}
 .sidebar .sidebar-motto{width:auto;margin:0;font-size:.72rem;line-height:1.3;text-align:right}
 .sidebar .sidebar-navigation{grid-column:1/-1;display:flex;flex-direction:row;align-items:center;gap:6px;min-width:0;overflow-x:auto;overflow-y:hidden;padding:3px 0 6px;scrollbar-width:thin;scrollbar-color:#91b5d5 #244c74;overscroll-behavior-x:contain}
 .sidebar .sidebar-navigation::-webkit-scrollbar{height:4px}
 .sidebar .sidebar-navigation::-webkit-scrollbar-thumb{background:#91b5d5;border-radius:5px}
 .sidebar .sidebar-home,.sidebar #nav a{flex:0 0 auto;min-width:0;min-height:38px;margin:0;padding:9px 12px;font-size:.88rem;font-weight:600;line-height:1.2;border:1px solid #ffffff32;background:#ffffff0b;border-radius:7px;white-space:nowrap;color:#fff}
 .sidebar .sidebar-home.active{background:#ffffff0b;box-shadow:none}
 .sidebar .sidebar-home .nav-icon{display:none}
 .sidebar #nav{display:flex;flex:0 0 auto;overflow:visible;gap:6px;padding:0}
 .sidebar #nav a.active{background:#30567e;border-color:#b2cde5;box-shadow:inset 0 -2px var(--orange)}
 .sidebar #portal-storage-meter{order:99;flex:0 0 auto;width:auto;margin:0;padding:0;border:0}
 .sidebar #portal-storage-meter>.storage-fold>summary{min-height:38px;padding:9px 12px;font-size:.88rem;white-space:nowrap;border:1px solid #ffffff32;background:#ffffff0b;border-radius:7px}
 .sidebar #portal-storage-meter .storage-content{position:fixed;z-index:30;top:170px;right:12px;left:12px;max-height:60vh;overflow-y:auto;padding:16px;background:#173e68;border:1px solid #6482a1;border-radius:10px;box-shadow:0 8px 30px #0005}
}

/* Pull the mobile ribbon down to unfold the same authorized links as a list. */
@media(max-width:720px){
 .sidebar .sidebar-navigation{touch-action:pan-x pinch-zoom;touch-action:pan-x pan-down pinch-zoom;padding-bottom:0}
 .sidebar .mobile-navigation-toggle{display:flex;grid-column:1/-1;align-items:center;justify-content:center;width:100%;height:24px;min-height:24px;margin:-3px 0 -4px;padding:0;border:0;border-radius:5px;background:transparent;color:#d7e5f2;cursor:pointer;touch-action:pan-x pinch-zoom}
 .sidebar .mobile-navigation-toggle span{font-size:1.25rem;line-height:1}
 .sidebar .mobile-navigation-toggle:hover{background:#ffffff0b}
 .sidebar .mobile-navigation-toggle:focus-visible{outline:2px solid var(--orange);outline-offset:0}
 .sidebar .sidebar-navigation.is-expanded{flex-direction:column;align-items:stretch;gap:6px;max-height:calc(100vh - 180px);max-height:calc(100dvh - 180px);overflow-x:hidden;overflow-y:auto;touch-action:pan-y pinch-zoom;overscroll-behavior-y:contain;scrollbar-width:thin;padding:3px 0 6px}
 .sidebar .sidebar-navigation.is-expanded.can-swipe-close{touch-action:pan-x pinch-zoom;touch-action:pan-x pan-up pinch-zoom}
 .sidebar .sidebar-navigation.is-expanded #nav{display:flex;flex-direction:column;flex:0 0 auto;width:100%;gap:6px;overflow:visible}
 .sidebar .sidebar-navigation.is-expanded #nav a{width:100%;min-height:44px;white-space:normal;overflow-wrap:anywhere;justify-content:flex-start}
 .sidebar .sidebar-navigation.is-expanded #portal-storage-meter{width:100%}
 .sidebar .sidebar-navigation.is-expanded #portal-storage-meter>.storage-fold>summary{min-height:44px;width:100%}
}
@media(max-width:720px) and (prefers-reduced-motion:no-preference){
 .sidebar .sidebar-navigation.is-expanded #nav{animation:mobile-ribbon-reveal .16s ease-out}
 @keyframes mobile-ribbon-reveal{from{opacity:.7;transform:translateY(-5px)}to{opacity:1;transform:translateY(0)}}
}

/* The account row precedes the brand on phones and follows the same visibility gates. */
@media(max-width:720px){
 .auth-pending>.portal-account-header,
 body:has(.embedded-application.is-expanded)>.portal-account-header{display:none}
}

/* One compact account row, retaining native language selection. */
@media(max-width:720px){
 .portal-account-header{display:flex;flex-wrap:nowrap;gap:8px;min-height:60px;padding:8px 12px}
 .portal-account-header .session-actions{flex:1 1 auto;width:auto;min-width:0;margin:0;gap:8px}
 .portal-account-header .account-chip{flex:1 1 auto;min-width:0;gap:7px}
 .portal-account-header .account-initials{width:30px;height:30px;font-size:.72rem}
 .portal-account-header .account-details{flex:1;min-width:0}
 .portal-account-header .account-details strong{font-size:.78rem;max-width:100%;line-height:1.4}
 .portal-account-header .account-details small{font-size:.65rem;max-width:100%;line-height:1.4}
 .portal-account-header #logout{width:44px;height:44px;min-height:44px;flex:0 0 44px;padding:0;font-size:0;border-radius:9px}
 .portal-account-header #logout::before{content:"";width:22px;height:22px;background:center/contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23173e68' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 4H4v16h5M9 12h12m-4-4 4 4-4 4'/%3E%3C/svg%3E")}
 .portal-account-header .language-control{position:relative;flex:0 0 44px;width:44px;height:44px;margin:0;border:1px solid #cbd7e4;border-radius:9px;background:#fff;justify-content:center}
 .portal-account-header .language-control::before{content:"";width:23px;height:23px;background:center/contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23173e68' stroke-width='1.7' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cellipse cx='12' cy='12' rx='4' ry='9'/%3E%3Cpath d='M3 12h18M5 7h14M5 17h14'/%3E%3C/svg%3E")}
 .portal-account-header .language-control>span{display:none}
 .portal-account-header .language-control select{position:absolute;inset:0;width:100%;height:100%;max-width:none;min-height:44px;margin:0;padding:0;opacity:0;cursor:pointer}
 .portal-account-header .language-control:focus-within{outline:3px solid #de8434;outline-offset:3px}
}

/* The same compact account bar is used by every desktop module. */
@media(min-width:721px){
 .shell>.portal-account-header{flex-wrap:nowrap}
 .portal-account-header .breadcrumb{flex:0 0 auto;white-space:nowrap}
 .portal-account-header{min-height:44px;padding-top:4px;padding-bottom:4px;gap:12px}
 .portal-account-header .session-actions{gap:9px;flex:1 1 auto;justify-content:flex-end}
 .portal-account-header .account-initials{width:28px;height:28px}
 .portal-account-header .account-details small{display:none}
 .portal-account-header #logout{min-height:32px;padding:5px 10px}
 .portal-account-header .language-control select{min-height:30px;padding-top:4px;padding-bottom:4px;margin:0}
}
