/* Photo library follows iOS Photos; editing follows SNOW's photo-first touch layout. */
.view-album,.view-photoEditor { padding:0; color:#171719; background:#fff; }
body:not(.school-phone-embedded) .topbar:is([data-view=album],[data-view=photoEditor]) { display:none; }
.school-phone-embedded .topbar:is([data-view=album],[data-view=photoEditor]) #view-title { display:none; }
.phone:has(.photo-app--detail) { padding-bottom:0; }
.phone:has(.photo-app--detail) .bottom-nav { display:none; }
.photo-app { --photo-blue:#007aff; --photo-mint:#a6eee1; font-family:-apple-system,BlinkMacSystemFont,"Hiragino Sans",sans-serif; line-height:1.4; }
.photo-toolbar { display:grid; grid-template-columns:72px minmax(0,1fr) 72px; align-items:center; min-height:56px; padding:4px 12px; gap:4px; background:#fff; }
.photo-toolbar-title { text-align:center; font-size:16px; font-weight:600; }
.photo-library-toolbar { grid-template-columns:44px minmax(0,1fr) 44px; padding-inline:12px; }
.photo-library-toolbar .photo-toolbar-title { font-size:17px; letter-spacing:-.2px; }
.photo-header-action { display:flex; justify-content:flex-end; align-items:center; }
.photo-app button { -webkit-touch-callout:none; touch-action:manipulation; }
.photo-app button:disabled { opacity:.4; }
.photo-icon-button { display:grid; place-items:center; min-width:44px; min-height:44px; padding:10px; border:0; border-radius:50%; background:transparent; color:var(--photo-blue); }
.photo-app svg { width:24px; height:24px; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; flex-shrink:0; }
.photo-back svg { width:25px; height:25px; }
.photo-library-heading { padding:8px 20px 16px; }
.photo-library-heading h2 { color:#171719; padding:0; font-size:32px; font-weight:750; letter-spacing:-1.2px; line-height:1.15; margin:0 0 5px; }
.photo-note { margin:0; color:#8e8e93; font-size:13px; }
.photo-library-filters { display:flex; justify-content:center; gap:4px; padding:0 12px 8px; margin:0; }
.photo-library-filter { position:relative; isolation:isolate; min-height:44px; padding:8px 16px; border-radius:0; color:#8e8e93; font-size:12px; font-weight:600; background:transparent; }
.photo-library-filter[aria-pressed=true] { color:#171719; }
.photo-library-filter[aria-pressed=true]::before { content:""; position:absolute; z-index:-1; inset:7px 0; border-radius:8px; background:#f2f2f7; }
.photo-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:1px; }
.photo-tile { position:relative; display:block; padding:0; margin:0; aspect-ratio:1; width:100%; min-width:0; min-height:44px; border:0; border-radius:0; overflow:hidden; background:#f2f2f7; }
.photo-tile img,.photo-tile canvas { display:block; width:100%; height:100%; object-fit:cover; object-position:center top; }
.photo-tile .photo-edited-badge { position:absolute; right:4px; bottom:4px; padding:3px 5px; color:white; background:#0008; border-radius:4px; font-size:9px; line-height:1.2; }
.photo-library-count { text-align:center; padding:20px 16px; margin:0; color:#8e8e93; font-size:12px; }
.photo-empty { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:12px; min-height:40dvh; padding:32px; text-align:center; }
.photo-empty>svg { width:44px; height:44px; stroke-width:1.1; color:#aeaeb2; }
.photo-empty strong { font-size:18px; font-weight:600; }
.photo-empty p { font-size:13px; line-height:1.7; color:#8e8e93; margin:0; }
.photo-empty-note { padding:16px; color:#8e8e93; font-size:12px; text-align:center; }
.photo-more { display:block; min-height:44px; padding:12px 24px; margin:16px auto; font-size:14px; color:var(--photo-blue); }
.photo-app--detail { position:relative; display:flex; flex-direction:column; height:var(--photo-viewport-height,calc(100dvh - 56px)); min-height:0; background:#000; color:#fff; padding-bottom:env(safe-area-inset-bottom); }
.school-phone-embedded .photo-app--detail { height:var(--photo-viewport-height,calc(100dvh - 44px)); }
.photo-app--detail .photo-toolbar { position:sticky; top:0; z-index:3; flex-shrink:0; color:#fff; background:#000; }
.photo-detail-meta { display:flex; flex-direction:column; align-items:center; min-width:0; gap:2px; }
.photo-detail-meta strong { font-size:14px; font-weight:600; }
.photo-detail-meta span { max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:11px; color:#aaa; }
.photo-stage { display:flex; justify-content:center; align-items:center; flex:1; min-height:80px; overflow:hidden; background:#000; padding:12px 0; }
.photo-preview { display:block; width:100%; height:100%; min-height:0; object-fit:contain; }
.photo-status { margin:0; padding:4px 16px; min-height:22px; font-size:11px; line-height:1.5; text-align:center; color:#aaa; overflow-wrap:anywhere; }
.photo-status:empty { padding:0; min-height:0; }
.photo-status[role=alert] { color:#dd655f; }
.photo-edit-button { min-height:44px; padding:8px 12px; color:var(--photo-blue); background:transparent; font-size:15px; font-weight:600; }
.photo-export { display:flex; justify-content:center; align-items:center; gap:8px; min-height:52px; margin:0; padding:10px 16px; color:var(--photo-blue); background:transparent; font-size:13px; }
.photo-export svg { width:22px; height:22px; }
.photo-compare { align-self:center; min-height:44px; padding:8px 16px; color:#fff; font-size:12px; background:#ffffff14; border-radius:24px; margin:8px 0; }
/* Editor top actions and bottom tool sheet stay distinct from the dark photo stage. */
.photo-app--editor.photo-app--detail { background:#fff; color:#171719; }
.photo-app--editor .photo-toolbar { background:#fff; color:#171719; }
.photo-app--editor .photo-back { color:#171719; }
.photo-app--editor .photo-detail-meta span { color:#8e8e93; }
.photo-app--editor .photo-stage { background:#202124; padding:16px 0; }
.photo-app--editor .photo-status { color:#8e8e93; background:#fff; }
.photo-save { min-width:60px; min-height:44px; border-radius:20px; padding:8px 16px; color:#17362f; background:var(--photo-mint); font-size:13px; font-weight:650; }
.photo-editor-sheet { flex-shrink:0; padding:12px 0 6px; background:#fff; }
.photo-settings { min-height:112px; }
.photo-tool-panel { padding:4px 16px 12px; min-height:112px; }
.photo-tool-panel--filter { padding-inline:0; }
.photo-filter-rail { display:flex; gap:12px; overflow-x:auto; overscroll-behavior-x:contain; padding:0 16px 4px; scrollbar-width:none; }
.photo-filter-rail::-webkit-scrollbar { display:none; }
.photo-filter { display:flex; flex-direction:column; align-items:center; gap:7px; flex:0 0 66px; min-height:44px; padding:0; color:#8e8e93; background:transparent; font-size:10px; }
.photo-filter canvas { display:block; width:66px; height:72px; object-fit:cover; object-position:center top; border-radius:7px; border:2px solid transparent; padding:2px; }
.photo-filter[aria-pressed=true] { color:#171719; font-weight:650; }
.photo-filter[aria-pressed=true] canvas { border-color:#43bfa9; }
.photo-tool-nav { display:flex; justify-content:space-around; gap:4px; padding:8px 8px 0; border-top:1px solid #f2f2f4; }
.photo-tool { display:flex; flex:1; min-width:0; flex-direction:column; align-items:center; justify-content:center; gap:7px; min-height:58px; padding:4px 0; background:transparent; color:#99999f; font-size:10px; }
.photo-tool svg { width:23px; height:23px; stroke-width:1.6; }
.photo-tool[aria-pressed=true] { color:#1c9983; font-weight:650; }
.photo-reset { display:block; min-height:44px; margin:4px auto 0; padding:8px 16px; color:#8e8e93; background:transparent; font-size:11px; }
.photo-save-note { margin:0; color:#a0a0a5; font-size:10px; text-align:center; }
.photo-adjust-label { display:grid; grid-template-columns:1fr auto; gap:18px 12px; padding:10px 8px; font-size:13px; }
.photo-adjust-label output { color:#8e8e93; font-variant-numeric:tabular-nums; }
.photo-adjust-label input { grid-column:1 / -1; width:100%; height:44px; accent-color:#32b79f; margin:0; }
.photo-frame-options { display:flex; justify-content:center; gap:28px; }
.photo-frame { display:flex; flex-direction:column; align-items:center; gap:7px; padding:2px; font-size:11px; color:#8e8e93; background:transparent; }
.photo-frame-swatch { display:block; width:54px; height:64px; border:7px solid #fff; border-bottom-width:14px; border-radius:3px; background:#d6d6da; box-shadow:0 0 0 1px #dedee2; }
.photo-frame--none .photo-frame-swatch { border:0; }
.photo-frame--pink .photo-frame-swatch { border-color:#fce4ec; }
.photo-frame[aria-pressed=true] { color:#1c9983; font-weight:650; }
.photo-frame[aria-pressed=true] .photo-frame-swatch { outline:2px solid #43bfa9; outline-offset:3px; }
.photo-caption-label { display:flex; flex-direction:column; gap:10px; font-size:12px; color:#8e8e93; }
.photo-caption-label input { width:100%; min-height:44px; border:0; border-radius:8px; padding:12px; font-size:16px; background:#f4f4f6; color:#171719; }
.photo-rotate-button { display:flex; flex-direction:column-reverse; align-items:center; gap:10px; min-height:80px; margin:auto; padding:8px 16px; font-size:12px; color:#171719; background:transparent; }
.photo-app--editor .photo-export { color:#1c9983; min-height:44px; font-size:12px; }

/* In the chat panel, the outer sheet already supplies the smartphone navigation. */
.school-phone-embedded .phone:has(.photo-app--detail)>.topbar { display:none; }
.photo-editor-actions { display:flex; justify-content:space-between; align-items:center; gap:12px; padding:0 16px; }
.photo-editor-actions .photo-reset,.photo-editor-actions .photo-export { flex:1; margin:0; min-height:44px; padding:8px; }
.photo-app--editor .photo-status { position:absolute; top:60px; left:12px; right:12px; z-index:2; border-radius:6px; background:#fffffff0; pointer-events:none; }
.photo-app--editor .photo-status:empty { display:none; }
/* Keep a useful photo preview when the phone is inside a short chat sheet. */
@media (max-height:650px) {
    .photo-app--editor .photo-stage { min-height:160px; padding:8px 0; }
    .photo-editor-sheet { padding:8px 0 4px; }
    .photo-settings,.photo-tool-panel { min-height:84px; }
    .photo-tool-panel { padding:2px 16px 8px; }
    .photo-tool-panel--filter { padding-inline:0; }
    .photo-filter { gap:5px; }
    .photo-filter canvas { height:56px; }
    .photo-tool-nav { padding-top:4px; }
    .photo-tool { min-height:50px; gap:5px; }
    .photo-frame-swatch { height:48px; }
    .photo-frame { gap:5px; }
    .photo-rotate-button { min-height:64px; padding-block:4px; gap:6px; }
}

/* Match the chat phone's compact library and Lenoas control colors. */
.school-in-app .photo-app { --photo-blue:#2a2328; --photo-mint:#eef0f3; }
.school-in-app .photo-library-heading { padding:8px 16px 16px; }
.school-in-app .photo-library-heading h2 { font-size:26px; letter-spacing:-.6px; line-height:1.3; }
.school-in-app .photo-library-filters { justify-content:flex-start; padding-inline:16px; gap:8px; }
.school-in-app .photo-library-filter { font-size:13px; font-weight:500; }
.school-in-app .photo-grid { gap:3px; }
.school-in-app .photo-empty { padding:24px; }
.school-in-app .photo-empty .secondary { min-height:44px; padding:10px 16px; border-radius:8px; background:#f3f4f6; color:#2a2328; }
.school-in-app .photo-app--editor .photo-save { border-radius:8px; color:#2a2328; }
/* Chat-only album actions; keep the photograph unobstructed. */
.photo-header-action { position:relative; }
.photo-more-actions { color:inherit; font-size:27px; line-height:1; }
.photo-actions-menu { position:absolute; top:100%; right:0; z-index:5; min-width:184px; padding:4px; border:1px solid #e5e5e8; border-radius:8px; background:#fff; color:#2a2328; }
.photo-actions-menu[hidden] { display:none; }
.photo-actions-menu button { display:block; width:100%; min-height:44px; padding:10px 12px; border:0; border-radius:4px; background:transparent; color:inherit; font:inherit; font-size:13px; text-align:left; }
.photo-actions-menu .photo-delete-action { color:#c33; }
.photo-tile { position:relative; }
.photo-background-badge { position:absolute; top:4px; right:4px; padding:3px 5px; border-radius:4px; background:#000b; color:#fff; font-size:10px; line-height:1.4; pointer-events:none; }
.photo-detail-meta .photo-background-status { color:#fff; }
.photo-app--chat-album.photo-app--detail .photo-toolbar { grid-template-columns:44px minmax(0,1fr) 88px; }
.photo-app--chat-album .photo-header-action > .photo-edit-button { flex:none; min-width:44px; padding-inline:4px; white-space:nowrap; }
