/* کنترل بومی منو پیش از اجرای اسکریپت نیز کار می‌کند و هندسهٔ اولیه را ثابت نگه می‌دارد.
   The native menu control works before scripts run and keeps initial geometry stable. */
.mobile-menu{display:none}
@media(max-width:900px){
    .mobile-menu{display:block;order:0;flex:none}
    .site-header details.mobile-menu>summary.menu-toggle{display:flex;align-items:center;justify-content:center;list-style:none;cursor:pointer}
    .mobile-menu>.menu-toggle::-webkit-details-marker{display:none}
    .site-header:has(.mobile-menu[open]) .site-nav{display:block}
    /* منویی که پیش از آماده‌شدن اسکریپت باز شده، تا بسته‌شدن در جریان سند می‌ماند.
       A menu opened before enhancement stays in document flow until it is closed. */
    html:not(.shell-ready) .site-header:has(.mobile-menu[open]),
    .site-header:has(.mobile-menu[data-native-open][open]){flex-wrap:wrap;position:relative}
    html:not(.shell-ready) .site-header:has(.mobile-menu[open]) .site-nav,
    .site-header:has(.mobile-menu[data-native-open][open]) .site-nav{
        position:static;flex-basis:100%;max-height:none;border-top:0;box-shadow:none;overflow:visible;overscroll-behavior:auto
    }
}
.shell-preview{padding-block:48px;min-height:240px}
.shell-preview h1{font-size:28px;margin-bottom:16px}
.dialog-close{min-width:44px;min-height:44px}
[aria-disabled="true"]{cursor:not-allowed}
.skip-link:focus{top:8px}
.context-menu{position:relative;max-width:180px;white-space:normal}
.context-menu>summary{cursor:pointer;max-width:180px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-height:44px;display:flex;align-items:center;gap:4px}
.context-menu>summary::after{content:'⌄'}
.context-selector{position:absolute;right:0;left:auto;direction:rtl;top:100%;z-index:30;display:grid;gap:10px;width:min(300px,85vw);padding:16px;background:white;border:1px solid var(--border);border-radius:8px;box-shadow:0 8px 20px #0002}
.context-selector select{width:100%;min-height:44px;font:inherit;background:white}
/* حساب واقعی و مقصد خانه فضای بیشتری از نمونهٔ Front نیاز دارند.
   Real account controls and the Home destination need more room than the Front sample. */
@media(min-width:901px) and (max-width:1100px){
    .site-header:has(.auth-state) .site-nav{min-width:0;flex-wrap:wrap;row-gap:0}
    .site-header .auth-state{min-width:0;flex-wrap:wrap;white-space:normal}
}
@media(max-width:900px){.context-menu{position:static}.context-selector{right:auto;left:12px}}
@media(max-width:600px){.context-menu,.context-menu>summary{max-width:90px}}
/* کنترل‌های حساب در موبایل فضای مستقل و امکان شکستن سطر دارند.
   Give mobile account controls their own row and allow wrapping. */
@media(max-width:600px){
    .site-header:has(.auth-state){flex-wrap:wrap}
    .auth-state{flex-basis:100%;min-width:0;flex-wrap:wrap;justify-content:space-between;white-space:normal}
    .auth-state>a{min-height:44px;display:inline-flex;align-items:center}
    .auth-state .auth-button{min-height:44px}
}
