:root{--dock-height:68px;--safe-bottom:env(safe-area-inset-bottom,0px)}
.mobile-dock{display:none}
/* على الجوال تظهر أدوات المساحة في صف واحد والقائمة عند الطلب. */
.mobile-header{display:flex;align-items:center;gap:18px;padding:12px 34px;background:var(--bg);border-bottom:1px solid var(--line)}
.mobile-brand{display:flex;align-items:center;flex-shrink:0}
.workspace-switch{min-width:0;max-width:320px;gap:8px}
.workspace-switch span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.workspace-switch::after{content:'⌄';flex:none}
.workspace-header-actions{margin-inline-start:auto;display:flex;align-items:center;gap:16px}
.workspace-header-actions .notification-entry{min-height:44px;display:inline-flex;align-items:center;white-space:nowrap}
.workspace-header-note{font-size:12px;color:var(--muted)}
@media(max-width:1000px){.workspace-header-note{display:none}}
@media(max-width:800px){.workspace-header-actions{width:auto;gap:0}.workspace-header-actions .theme-toggle{display:none}.workspace-header-actions .notification-entry{font-size:13px;gap:4px;padding:8px;min-width:44px}.workspace-header-actions .notification-label{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}.mobile-brand .brand-name{display:none}}

.mobile-menu{position:fixed;inset-block:0;inset-inline-start:0;inset-inline-end:auto;margin:0;border:0;border-inline-end:1px solid var(--line);border-radius:0;padding:0;width:min(360px,calc(100% - 28px));max-width:none;height:100vh;height:100dvh;max-height:100vh;max-height:100dvh;background:var(--panel);color:var(--text);box-shadow:0 16px 64px #1a16143d;overflow:hidden}
.mobile-menu[open]{display:grid;grid-template-rows:auto auto minmax(0,1fr) auto}
.mobile-menu::backdrop{background:#1a16148c}
.menu-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:calc(8px + env(safe-area-inset-top,0px)) 16px 4px}
.menu-heading h2{margin:0;font-size:17px}
.menu-heading button{min-height:44px;min-width:44px;padding:10px}
.menu-workspace{padding:0 16px 8px;border-bottom:1px solid var(--line);min-width:0}
.menu-workspace label{margin:0;font-size:11px;color:var(--muted)}
.menu-workspace select{min-width:0;width:100%;min-height:44px;padding:8px;font-size:14px;background:var(--bg)}
.menu-workspaces-link{display:flex;align-items:center;min-height:36px;font-size:12px;color:var(--muted)}
.menu-body{overflow:auto;overscroll-behavior:contain;padding:8px 12px 12px;min-height:0;scrollbar-width:thin;scrollbar-color:var(--line) transparent}
.menu-body nav{display:grid;grid-template-columns:minmax(0,1fr);gap:10px}
.menu-section h3{font-size:11px;font-weight:500;color:var(--muted);margin:6px 12px 4px}
.mobile-menu .menu-body nav a,.menu-footer-actions a{display:flex;align-items:center;gap:10px;min-height:44px;border-radius:8px;padding:8px 12px;font-size:14px;line-height:1.5;color:var(--text)}
.mobile-dock a span,.mobile-menu .menu-body nav a span{font:inherit;color:inherit;opacity:1}
.menu-body nav svg,.menu-footer svg{flex:none;width:19px;height:19px}
.mobile-menu .menu-body nav a.active{background:var(--accent-soft);color:var(--accent)}
.mobile-menu .menu-body nav .menu-current{margin-inline-start:auto;font-size:10px}
.menu-notifications{border-top:1px solid var(--line);margin-top:12px;padding-top:4px}
.menu-notifications .notification-entry{font-size:14px;padding:8px 12px;width:100%}
.menu-preferences{margin:4px 0 0}
.menu-preferences summary{padding:8px 12px;min-height:44px;cursor:pointer;font-size:13px;color:var(--muted)}
.menu-preferences>div{display:grid;gap:6px;padding:4px 12px}
.menu-preferences button{justify-content:flex-start;min-height:44px;font-size:13px}
.menu-footer{border-top:1px solid var(--line);padding:6px 12px calc(8px + var(--safe-bottom));background:var(--panel);min-width:0}
.menu-footer-actions{display:flex;align-items:center;gap:6px}
.menu-footer-actions a{flex:1;min-width:0;font-size:13px}
.menu-footer-actions .menu-current{display:none}
.menu-footer-actions button{min-height:44px;padding:8px;font-size:12px}
.menu-account{display:flex;align-items:center;gap:10px;padding:8px 10px;min-height:56px;border-radius:8px}
.menu-account:hover,.menu-footer-actions a:hover{background:var(--raised)}
.menu-account .avatar{width:34px;height:34px;flex:none;border-radius:9px;font-size:15px}
.menu-account-info{min-width:0;flex:1;display:grid;gap:3px}
.menu-account-info strong{font-size:12px;font-weight:500;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.menu-account-info small{font-size:11px;color:var(--muted)}
body:has(.mobile-menu[open]){overflow:hidden}
body:has(.mobile-menu[open]) .floating-navigation{visibility:hidden;pointer-events:none}
.overview-summary,.starter-templates{padding:18px 20px;margin-block:20px;background:var(--panel);border:1px solid var(--line);border-radius:10px}
.overview-summary summary,.starter-templates summary{min-height:44px;cursor:pointer;font-weight:600}
.overview-summary .stats{margin:12px 0 0}
.work-home .heading h1{font-size:32px}
.editor-jumps{grid-column:1/-1;display:flex;flex-wrap:wrap;gap:8px}
.editor-jumps button{min-height:44px}
.editor-text,.editor-resources,#editor-delivery{scroll-margin-block:24px 180px}
.editor-resources{grid-column:1}
.editor .delivery{grid-column:2;grid-row:2 / span 2;order:0;align-self:start}
.editor-actions{grid-column:1/-1;display:flex;align-items:center;justify-content:space-between;gap:14px;background:var(--panel);padding:14px 20px;border:1px solid var(--line);border-radius:10px}
.editor-actions button{min-height:48px;min-width:130px}
.editor-actions p{margin:0;font-size:13px}
.save-feedback{color:var(--gold)}
.save-feedback:empty{display:none}
.editor details>summary{min-height:44px;cursor:pointer;font-weight:600;padding-block:8px}
.revision-compare>div:last-child{border-inline-start:3px solid #4a7c59;padding-inline-start:12px}
.revision-compare pre{white-space:pre-wrap;overflow-wrap:anywhere}
@media(max-width:1100px){.editor .delivery{grid-column:auto;grid-row:auto}.editor-resources{grid-column:auto}}
@media(max-width:800px){
 .layout{padding-bottom:calc(var(--dock-height) + var(--safe-bottom) + 12px)}
 .mobile-header{display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:8px;padding:8px 12px}
 .mobile-brand{display:flex;align-items:center;gap:8px;flex-shrink:0}
 .mobile-brand strong{font-size:16px;line-height:1.3}.mobile-brand small{display:block;font-size:9px;letter-spacing:1px;margin-top:3px}
 .mobile-brand .mark{width:34px;height:34px;font-size:26px}
 .workspace-switch{min-width:0;max-width:100%;justify-self:end;min-height:44px;padding:8px 10px;background:none;font-weight:500;font-size:13px;text-align:start}

 .topbar{padding:6px 16px;min-height:32px;font-size:11px;justify-content:flex-start;gap:8px}.topbar .tag{font-size:10px}
 .mobile-dock{position:fixed;z-index:20;inset-inline:0;bottom:0;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));height:calc(var(--dock-height) + var(--safe-bottom));padding:5px 8px calc(5px + var(--safe-bottom));background:var(--panel);border-top:1px solid var(--line);box-shadow:0 -3px 16px #1a161408}
 .mobile-dock a,.mobile-dock button{display:flex;flex-direction:column;justify-content:center;align-items:center;gap:3px;min-width:0;min-height:48px;border:0;border-radius:8px;background:none;padding:4px;color:var(--muted);font-size:12px;font-weight:600}
 .mobile-dock a.active,.mobile-dock button.active{color:var(--gold);background:var(--accent-soft)}
 .mobile-dock svg{width:22px;height:22px}
 main{padding:18px 16px}.heading{margin-bottom:18px}.heading h1,.work-home .heading h1{font-size:26px}
 .heading .eyebrow{margin-bottom:4px;font-size:12px}.work-home .heading .eyebrow{display:none}
 .work-home .heading .muted{margin-bottom:8px}.work-home .heading>.primary{margin-top:4px;min-height:44px}
 .work-home .work-queue{margin-block:18px}.work-queue>.section-heading{align-items:center;gap:8px}.work-queue>.section-heading h2{margin:0;font-size:19px}.work-queue>.section-heading button{padding:6px 10px;min-height:44px;font-size:12px}
 .work-queue>.muted{font-size:13px;margin:7px 0 12px}.work-home .card h3{font-size:18px}.work-home .card p{margin-bottom:10px}
 .work-home .card{padding:0}.work-home .card>a{padding:16px}.work-home .card-foot{font-size:12px}.queue-empty{margin-block:10px}
 .editor{gap:14px;padding-bottom:110px}.editor .panel{padding:16px}.editor .delivery{order:0}
 .editor textarea[name=body]{min-height:180px;max-height:48vh}.editor-jumps{gap:6px}.editor-jumps button{font-size:13px;padding:8px 10px;flex:1}
 .editor-actions{position:fixed;z-index:21;bottom:calc(var(--dock-height) + var(--safe-bottom));inset-inline:0;border-radius:0;padding:12px 16px;box-shadow:0 -3px 16px #1a161408;gap:10px;min-height:78px}
 .editor-actions>div{flex:1;min-width:0}.editor-actions button{min-width:124px;font-size:15px}.editor-actions p{font-size:12px;line-height:1.5}
 .editing-field .mobile-dock{display:none}
 .editing-field .editor-actions{bottom:var(--keyboard-inset,0px);padding-bottom:calc(12px + var(--safe-bottom))}
 .editor input,.editor textarea,.editor select{scroll-margin-block:30px 150px}
 .revision-compare{gap:12px}.revision-compare h4{margin-block:8px}.revision-compare pre{max-height:none;margin:0;font-size:14px}
 .review-panel>.fine{font-size:12px}.review-panel details>summary{min-height:44px;padding-block:8px}
 #status{bottom:calc(var(--dock-height) + var(--safe-bottom) + 10px)}
 body:has(.editor) #status{bottom:calc(var(--dock-height) + var(--safe-bottom) + 102px)}
 footer{padding-bottom:20px}
}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important}}
.editing-field .floating-navigation{visibility:hidden;pointer-events:none}
.layout{padding-bottom:130px}
@media(max-width:800px){.editor-actions{bottom:0;padding-bottom:calc(12px + var(--safe-bottom))}.editor{padding-bottom:210px}#status{bottom:140px}body:has(.editor) #status{bottom:230px}}
.invitation-page{max-width:780px;margin:0 auto;padding:24px 16px}.invitation-page .login-tools{position:static;margin-bottom:24px;gap:16px;flex-wrap:wrap}
.invitation-nav{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-block:0 20px;color:var(--muted);font-size:14px}.invitation-nav a{text-decoration:none;color:var(--accent)}.invitation-nav span::before{content:'‹';margin-inline:2px;color:var(--muted)}
.invitation-journey{max-width:720px;margin-inline:auto;overflow-wrap:anywhere}
.invitation-journey .invitation-next{margin-block:24px}
.invitation-journey h1{font-size:clamp(26px,5vw,40px)}
.invitation-journey .actions{margin-top:24px;gap:16px}
@media(max-width:600px){.invitation-journey .primary,.invitation-journey .secondary{display:block;width:100%;min-height:48px;text-align:center;white-space:normal}.invitation-journey .actions{flex-wrap:wrap}}
