/* Floating library controls leave the three-column photo grid edge to edge. */
.ios-photos.photo-library{position:relative;padding-top:0;background:#fff;color:#111;isolation:isolate}
.photos-top{position:absolute;inset:0 0 auto;z-index:3;padding:65px 18px 22px;display:flex;align-items:flex-start;justify-content:space-between;flex-wrap:wrap;gap:10px;color:white;background:linear-gradient(#181511a8,#18151165 70%,transparent);backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px)}
.photos-heading h2{font-size:34px;line-height:1.1;letter-spacing:-1.4px;margin:0;font-weight:750}.photos-heading p{font-size:12px;font-weight:550;margin:7px 0 0}
.photos-top-actions{display:flex;align-items:center;gap:9px;padding-top:1px}.photos-glass{border:1px solid #ffffff8c;box-shadow:inset 0 1px 2px #fff8,0 2px 8px #0000000d;backdrop-filter:blur(22px) saturate(130%);-webkit-backdrop-filter:blur(22px) saturate(130%);background:#f7f7f7c9;border-radius:40px;color:#111}
.photos-top .photos-glass{background:#c8b5a13d;color:white;border-color:#ffffff42}.photos-sort{width:44px;height:44px;display:grid;place-items:center}.photos-sort svg{width:23px;height:23px}.photos-select{height:44px;min-width:66px;padding:0 16px;font-size:16px;font-weight:550}
.photo-library .photos-scroll{height:100%;padding:151px 0 115px;overflow-y:auto}.photo-library .native-photo-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:2px;padding:0}.photo-library .native-photo-grid>button{position:relative;aspect-ratio:1;padding:0;overflow:hidden;border-radius:0}.photo-library .native-photo-grid img{width:100%;height:100%;object-fit:cover;display:block}
.photos-bottom{position:absolute;z-index:4;bottom:0;left:0;right:0;display:flex;justify-content:space-between;align-items:center;padding:18px 20px max(29px,env(safe-area-inset-bottom));pointer-events:none;background:linear-gradient(transparent,#ffffffed 45%,white)}.photos-bottom>*{pointer-events:auto}.photos-tabs{display:flex;padding:4px;gap:2px;min-width:190px}.photos-tabs button{display:flex;flex:1;flex-direction:column;align-items:center;justify-content:center;gap:3px;min-width:86px;height:54px;border-radius:36px;font-size:11px;font-weight:600;color:#111}.photos-tabs button.active{color:#0088ff;background:#dedede8c}.photos-tabs svg{width:26px;height:26px;stroke-width:2.2}.photos-search{display:grid;place-items:center;width:62px;height:62px}.photos-search svg{width:28px;height:28px;stroke-width:2.4}.photos-search[aria-pressed=true]{color:#0088ff}
.photos-top .native-search{flex-basis:100%;margin:0;background:#ffffffdf;color:#222}.photos-collections{padding:12px 16px 0}.photos-collections .native-album{border-radius:20px;background:#f3f3f5;margin-bottom:12px}.photos-selection-save{min-height:54px;padding:12px 20px;display:flex;gap:8px;align-items:center;margin:auto;font-size:13px}.photos-selection-save svg{width:20px;height:20px}.photos-selection-save:disabled{opacity:.5}.photo-selection{position:absolute;bottom:8px;right:8px;border:2px solid white;border-radius:50%;height:24px;width:24px;background:#0003;display:grid;place-items:center}.photo-selection.is-selected{background:#0088ff}.photo-library .photo-selection svg{position:static;width:16px;height:16px;color:white}.photo-library button[aria-pressed=true]>img{opacity:.75}
@media(max-width:360px){.photos-top{padding-left:13px;padding-right:13px}.photos-heading h2{font-size:30px}.photos-bottom{padding-left:14px;padding-right:14px}.photos-tabs{min-width:176px}.photos-tabs button{min-width:78px}}

.photo-library:has(#photos-query) .photos-scroll{padding-top:207px}
/* Photo detail: white canvas, glass controls, and a horizontally scrollable filmstrip. */
.native-photo-viewer.ios-photo-detail{background:#fff;color:#111;padding:60px 0 max(25px,env(safe-area-inset-bottom));gap:0}
.photo-detail-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:0 16px 28px;flex-shrink:0}.detail-round{width:46px;height:46px;display:grid;place-items:center;flex-shrink:0;padding:10px}.detail-round svg{width:25px;height:25px;stroke-width:2}.photo-detail-title{display:flex;flex-direction:column;justify-content:center;align-items:center;min-width:0;max-width:70%;padding:7px 18px;min-height:46px;line-height:1.35}.photo-detail-title b{font-size:13px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;max-width:100%}.photo-detail-title small{font-size:10px;margin-top:2px}.ios-photo-detail .native-full-photo{flex:1;min-height:0}.ios-photo-detail .native-full-photo img{transform:rotate(var(--photo-rotation,0deg));object-fit:contain}.ios-photo-detail .native-full-photo.zoomed img{transform:rotate(var(--photo-rotation,0deg)) scale(1.8)}
.photo-detail-bottom{flex-shrink:0;padding-top:24px;background:white}.ios-photo-detail .photo-filmstrip{justify-content:flex-start;align-items:center;gap:3px;padding:6px calc(50% - 20px);scrollbar-width:none;height:48px;overscroll-behavior-x:contain;touch-action:pan-x;mask-image:linear-gradient(90deg,transparent,#000 12%,#000 88%,transparent)}.photo-filmstrip::-webkit-scrollbar{display:none}.ios-photo-detail .photo-filmstrip button{width:23px;height:32px;opacity:.8;border:0;border-radius:3px;overflow:hidden;transition:width .15s,height .15s}.ios-photo-detail .photo-filmstrip button.selected{width:38px;height:40px;opacity:1;margin:0 5px;border:0}.photo-detail-tools{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:13px 24px 0}.detail-tool-group{display:flex;align-items:center;justify-content:space-evenly;flex:1;max-width:188px;padding:2px 6px;height:48px}.detail-tool-group button{display:grid;place-items:center;width:44px;height:42px;padding:9px}.detail-tool-group svg{width:25px;height:25px;stroke-width:1.9}.detail-tool-group .liked svg{fill:#ff4545;color:#ff4545}.photo-download{display:block;text-align:center;text-decoration:none}
@media(max-height:700px){.photo-detail-head{padding-bottom:14px}.photo-detail-bottom{padding-top:12px}.photo-detail-tools{padding-top:8px}}
.ios-photo-detail .photos-glass{border-color:#dedee3;background:linear-gradient(145deg,#fff,#f6f6f8c9);box-shadow:inset 0 1px 2px #fff,0 2px 8px #00000005}
/* Keep the home control black on both library and photo detail screens. */
.phone-screen:has(.photo-library,.native-photo-viewer) .home-indicator:after{background:#000}
