/* معرض الصور فقط، باستخدام هوية البرنامج الحالية دون اعتماد جديد. */
#asset-photos{min-width:0;container-type:inline-size;container-name:photos}
#asset-photos p,#asset-photos label,#asset-photos summary,#asset-photos li{font-size:1rem;color:var(--ink);line-height:1.9;overflow-wrap:anywhere}
#asset-photos #asset-photo-context{direction:inherit;unicode-bidi:plaintext}
#asset-photos button,#asset-photos input,#asset-photos textarea{font-size:1rem;min-height:44px;max-width:100%}
#asset-photos button{min-width:44px;white-space:normal;overflow-wrap:anywhere}
#asset-photos :focus-visible{outline:3px solid var(--primary);outline-offset:3px}
#asset-photos .photo-toolbar,#asset-photos .photo-actions{display:flex;flex-wrap:wrap;gap:12px;align-items:center}
#asset-photos .asset-photo-gallery{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(300px,100%),1fr));gap:20px;margin-block:20px}
#asset-photos .asset-photo-tile{min-width:0;padding:16px;border:1px solid var(--line);border-radius:12px;background:white}
#asset-photos .asset-photo-tile img{display:block;width:100%;height:220px;object-fit:contain;background:var(--canvas);border-radius:8px}
#asset-photos .asset-photo-tile textarea{display:block;width:100%;resize:vertical;line-height:1.8}
#asset-photos .photo-actions>button{flex:1 1 140px}
#asset-photos #asset-photo-selection{padding-inline-start:24px}
#asset-photos #asset-photo-selection li{padding:12px;margin-block:8px;border:1px solid var(--line);border-radius:8px}
#asset-photos #asset-photo-progress{width:100%;max-width:600px;height:24px}
#asset-photos .photo-access-note{display:none}
#asset-card:not([data-acw-source="accepted"]) #asset-photos #asset-photo-workspace{display:none}
#asset-card:not([data-acw-source="accepted"]) #asset-photos .photo-access-note{display:block}
#asset-photos dialog{position:fixed;inset:0;margin:auto;width:min(900px,calc(100vw - 32px));max-width:calc(100vw - 32px);max-height:calc(100dvh - 32px);overflow:auto;padding:20px;border:1px solid var(--line);border-radius:12px;color:var(--ink);background:white}
#asset-photos dialog::backdrop{background:#10243dcc}
#asset-photos dialog img{display:block;max-width:100%;max-height:65dvh;margin:auto;object-fit:contain}
#asset-photos dialog h3{overflow-wrap:anywhere}
body[data-density="compact"] #asset-photos .asset-photo-tile{padding:12px}
@container photos (max-width:600px){#asset-photos .photo-actions>button{flex-basis:100%}#asset-photos .asset-photo-tile{padding:12px}}

/* Photo departure guard is page-local and uses the native dialog focus boundary. */
#asset-photo-leave{box-sizing:border-box;max-width:min(38rem,calc(100vw - 2rem));max-height:calc(100dvh - 2rem);overflow:auto;overflow-wrap:anywhere;border:1px solid var(--border,#cbd5e1);border-radius:12px;padding:1.25rem;color:var(--ink,#17384a);background:var(--panel,#fff)}
#asset-photo-leave::backdrop{background:rgb(15 23 42 / .48)}
#asset-photo-leave button{white-space:normal;max-width:100%;min-height:44px}
#asset-photo-leave button:focus-visible{outline:3px solid #087f79;outline-offset:3px}

#asset-photo-leave p{color:inherit}

/* Read-only viewers see content and read actions; retained editors remain in memory for the guard. */
#asset-photos [hidden]{display:none!important}
#asset-photos [data-photo-mode=readonly] .asset-photo-tile[data-primary=true]{border-inline-start:4px solid var(--primary)}
#asset-photos [data-photo-mode=readonly] .asset-photo-tile img{height:auto;max-height:28rem;aspect-ratio:4/3;object-fit:contain}
#asset-photos .asset-photo-tile strong{display:block;line-height:1.8;overflow-wrap:anywhere}
