/* Keep phone editing legible and short viewports free of fixed-bar overlap. */
.sidebar{overflow-y:auto;overscroll-behavior:contain}.sidebar>*{flex-shrink:0}.map-list{flex-shrink:1;min-height:44px}
.depth-active .card-footer button{min-height:24px}.depth-active .card-footer{padding-top:5px}
@media(max-width:900px),(max-width:1000px) and (max-height:500px){
 .depth-active .active-notes{font-size:16px;line-height:1.7;max-height:54px}
 .depth-active .field-count{font-size:9px;bottom:49px}
 .depth-active .card-topline .icon-button{width:34px;height:34px}
 .depth-active .card-footer{bottom:12px}
}
@media(max-width:900px) and (min-height:521px) and (max-height:700px),(max-width:1000px) and (max-height:500px){
 body:not(.keyboard-open) .depth-scene.focus-scene{--card-h:210px}
 body:not(.keyboard-open) .depth-active.active-card{padding:14px 17px}
 body:not(.keyboard-open) .depth-active .card-topline{margin-bottom:4px}
 body:not(.keyboard-open) .depth-active .active-title{font-size:21px;max-height:42px;min-height:36px}
 body:not(.keyboard-open) .depth-active .active-notes{margin-top:6px;max-height:40px;line-height:1.4}
 body:not(.keyboard-open) .depth-active .field-count{bottom:42px}
 body:not(.keyboard-open) .depth-child{top:calc(50% + var(--card-h)/2 + 22px);min-height:40px;padding:4px 7px}
 body:not(.keyboard-open) .depth-grandchild,body:not(.keyboard-open) .depth-ancestor:not([style*="--distance: 0"]){display:none}
 body:not(.keyboard-open) .depth-nav{bottom:2px}
 body:not(.keyboard-open) .depth-child-lines{height:24px}
}
@media(max-height:520px){
 .bottom-area{position:relative;right:auto;left:auto;background:var(--bg);padding:10px 20px max(10px,env(safe-area-inset-bottom))}
 body:not(.keyboard-open) .stage:has(.depth-scene){height:440px;min-height:440px}
 .stage:not(:has(.depth-scene)){min-height:400px}
 .overview-wrap{bottom:60px}.overview-tools{bottom:12px}
 .sidebar-bottom{padding-top:18px}.sidebar-help{margin-top:12px}
}

.depth-world:focus-within{mask-image:none;-webkit-mask-image:none}
.keyboard-open .depth-world{visibility:hidden}
.workspace-switching .workspace{opacity:.6}

/* Keep file-selection copy Persian regardless of the browser locale. */
.ai-file-choice{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin:12px 0}.ai-file-choice .secondary-action{width:auto;min-height:44px;flex-shrink:0}.ai-file-name{font-size:.8rem;color:var(--muted);overflow-wrap:anywhere;min-width:0;flex:1}
