/* Phone controls do not change the printable document. */
.phone-new,.report-sections{display:none}
@media screen and (max-width:750px){
 html{scroll-padding-top:80px}
 body:not(.login-page){padding-bottom:calc(88px + env(safe-area-inset-bottom));overflow-x:hidden}
 header{padding:10px 12px;gap:12px;min-height:68px}
 header .identity{flex:1;min-width:0}
 header .identity strong{max-width:none}
 .phone-new{display:block;min-width:48px;padding:8px 12px;font-size:14px;white-space:nowrap}
 .subbar{gap:8px;margin:12px;width:calc(100% - 24px)}
 .subbar>div button{font-size:13px}
 .report-sections{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px;margin:0;padding:8px 12px 12px;direction:rtl;position:sticky;top:68px;z-index:19;background:#eef1ec}
 .report-sections button{min-height:46px;padding:8px 3px;font-size:12px;border-radius:10px}
 .report-sections button[aria-pressed=true]{background:#294c39;color:white;border-color:#294c39}
 .review{max-height:94px;overflow:auto;line-height:1.7;margin:10px 12px}
 #workspace{padding:2px 6px 16px}
 body.zoomed #pages{min-width:960px}
 .sheet-wrap{margin-bottom:12px}
 body.zoomed .editable:not(.inline-number){overflow:visible}
 body.zoomed .editable:not(.inline-number):before{inset:-7px 0}
 .mobile-bar{padding:8px 10px calc(8px + env(safe-area-inset-bottom));gap:7px}
 .mobile-bar button{font-size:14px;min-height:50px}
 body:has(dialog[open]){overflow:hidden}
 dialog,dialog.wide{max-height:calc(var(--visible-height,100dvh) - 12px);bottom:var(--keyboard-inset,0px);padding:16px 16px calc(16px + env(safe-area-inset-bottom));overscroll-behavior:contain;scroll-padding-block:74px 86px}
 dialog .dialog-head{gap:12px;align-items:center}
 .dialog-head h2{line-height:1.6;font-size:18px;overflow-wrap:anywhere}
 dialog .dialog-actions{bottom:calc(-16px - env(safe-area-inset-bottom));padding:12px 0 calc(12px + env(safe-area-inset-bottom))}
 .dialog-actions>.primary{flex:1;min-height:50px}
 dialog textarea{min-height:130px;max-height:32dvh;font-size:16px;line-height:1.8}
 .photo-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;align-items:stretch}
 .photo-actions button,.photo-actions .upload-button{font-size:14px;min-height:48px;display:flex;align-items:center;justify-content:center;text-align:center}
 .photo-actions span{grid-column:1/-1;margin:0;padding:4px 0}
 .paste-hint{font-size:13px;line-height:1.8}
 .thumb{height:140px}
 .photo-card-actions{gap:7px}
 .photo-card-actions button{min-height:48px;font-size:13px}
 .case-row{display:grid;grid-template-columns:88px minmax(0,1fr);gap:12px;min-height:104px}
 .case-thumbnails{width:88px;height:78px}
 .case-info{min-width:0;overflow-wrap:anywhere}
 .case-info strong{font-size:15px}
 .case-info small{font-size:11px}
 #inline-editor{max-height:calc(var(--visible-height,100dvh) - 20px);overflow:auto}
 #inline-editor>div{gap:10px}
 #inline-editor button{font-size:16px;min-height:48px}
 #crop-tools:not(.hidden){bottom:var(--keyboard-inset,0px);max-height:calc(var(--visible-height,100dvh) - 16px)}
 .login-page{padding:20px 16px;align-items:center;overflow:auto}
 .login-card{padding:28px 22px;border-radius:22px}
 .login-card .check{min-height:48px;margin:8px 0}
}
@media screen and (max-width:360px){
 .wordmark{font-size:24px}.phone-new{padding:8px}.identity strong{font-size:14px!important}
 .photo-card-actions{grid-template-columns:1fr}.thumb{height:120px}
 .login-card{padding:24px 18px}
}
@media screen and (max-height:500px) and (max-width:950px){
 dialog,dialog.wide{max-height:calc(var(--visible-height,100dvh) - 12px)}
 .login-page{place-items:start center;padding:16px}
 .login-card h1{margin-top:12px}
}
@media print{.phone-new,.report-sections{display:none!important}}
.exporting .phone-new,.exporting .report-sections,body.rendering .report-sections{display:none!important}

/* Dragging pans the image inside its mask; tapping still opens photo controls. */
.picture,#photo-preview [data-preview-photo],#crop-preview{touch-action:none;cursor:grab;user-select:none;-webkit-user-select:none}
.picture img,#photo-preview img,#crop-preview img{-webkit-user-drag:none;user-select:none}
.picture.photo-dragging,#photo-preview .photo-dragging,#crop-preview.photo-dragging{cursor:grabbing}
.picture.photo-dragging:after{display:none}
.picture:hover:after{content:"اسحب لتحريك الصورة · اضغط لضبط القص";pointer-events:none}
