/* Album pages retain a reading order while varied image proportions give them a scrapbook rhythm. */
.gallery-body .photo-grid{display:block;columns:3;column-gap:20px}
.gallery-body .photo-tile{break-inside:avoid;margin-bottom:20px;display:inline-block;width:100%;vertical-align:top;box-shadow:0 3px 15px #37462e06}
.gallery-body .photo-tile-image{height:auto;aspect-ratio:4/3}
.gallery-body .photo-tile:nth-child(6n+2) .photo-tile-image{aspect-ratio:3/4}
.gallery-body .photo-tile:nth-child(6n+3) .photo-tile-image{aspect-ratio:1/1}
.gallery-body .photo-tile:nth-child(6n+4) .photo-tile-image{aspect-ratio:3/4}
.gallery-body .photo-tile:nth-child(6n+5) .photo-tile-image{aspect-ratio:16/10}
.gallery-body .photo-tile-image img{height:100%;width:100%}
.gallery-body .photo-grid .empty{column-span:all}
.album-browse-note{display:flex;align-items:center;justify-content:space-between;color:#95a184;font-size:10px;margin:0 0 18px;gap:10px}
.album-browse-note span:last-child{font-size:9px;color:#a4b098}
.no-intro-animation{animation:none!important}
.photo-viewer{height:100vh;height:100dvh;isolation:isolate;background:transparent;animation:none;overflow:hidden;overscroll-behavior:none;outline:none}
.viewer-backdrop{position:absolute;inset:0;background:#11201a;z-index:0}
.photo-viewer .lightbox-top{position:relative;z-index:1;flex-shrink:0;padding:24px 34px}
.viewer-title{min-width:0;max-width:calc(100% - 65px)}
.viewer-title b,.viewer-title span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%;display:block}
.photo-viewer .lightbox-top .viewer-return{width:42px;height:42px;color:#dbe6d1}
.viewer-return .icon{width:20px;height:20px}
.viewer-stage{position:relative;flex:1;min-height:0;z-index:1;overflow:hidden;touch-action:pan-y pinch-zoom;user-select:none;cursor:grab}
.viewer-stage.dragging{cursor:grabbing}
.viewer-slides{position:absolute;inset:0}
.viewer-slide{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;padding:0 80px;will-change:transform;backface-visibility:hidden}
.viewer-slide img{height:100%;width:100%;object-fit:contain;pointer-events:none;-webkit-user-drag:none;user-select:none}
.viewer-slide .raw-placeholder{background:transparent;color:#b7c7a9;font-size:12px}
.photo-viewer .lightbox-arrow{z-index:2;min-width:44px;min-height:48px;top:47%;background:#ffffff09}
.photo-viewer .lightbox-arrow:disabled{opacity:.18;cursor:default}
.viewer-details{position:relative;z-index:1;flex-shrink:0;padding:20px 34px 22px;max-width:780px;width:100%;align-self:center}
.viewer-photo-info{display:flex;align-items:center;justify-content:space-between;gap:20px;color:#95a88a;font-size:11px;margin-bottom:16px}
.viewer-photo-info b{font-size:12px;font-weight:400;color:#c0d0b2;white-space:nowrap;letter-spacing:1px}
.viewer-actions{display:flex;align-items:center;justify-content:center;gap:14px}
.viewer-actions .btn{min-height:44px;min-width:150px;font-size:12px;gap:9px;border-radius:9px}
.viewer-actions .icon{width:18px;height:18px}
.viewer-download{background:#dee8cf;color:#324d2b;box-shadow:0 4px 16px #00000015}
.viewer-download:hover{background:#eff5e5;color:#203c1b;transform:translateY(-1px)}
.viewer-hint{font-size:10px;color:#78916a;text-align:center;margin-top:14px;letter-spacing:.4px}
.touch-hint{display:none}
.photo-transition{position:fixed;z-index:170;overflow:hidden;pointer-events:none;background:#213b29;box-shadow:0 6px 40px #06190c20;will-change:top,left,width,height}
.photo-transition img{width:100%;height:100%;object-fit:cover;display:block}
@media(max-width:1000px){.gallery-body .photo-grid{columns:2}}
@media(max-width:700px){
  html{scroll-padding-bottom:100px}
  body{padding-bottom:calc(76px + env(safe-area-inset-bottom));font-size:14px}
  .sidebar{padding:20px 20px 17px;border-bottom:0;background:var(--bg)}
  .brand img{width:38px;height:38px}.brand>div{font-size:24px}.brand span{font-size:7px;letter-spacing:2px}
  .library-switch{top:22px;right:20px;font-size:11px;padding:9px 11px;min-width:126px;border-radius:9px}
  .library-switch button{min-width:26px;min-height:24px;align-items:center;justify-content:center}
  .sidebar nav{position:fixed;inset:auto 0 0;z-index:40;margin:0;padding:9px 9px calc(9px + env(safe-area-inset-bottom));background:#fbfcf7f2;backdrop-filter:blur(20px);border-top:1px solid #e0e7d8;box-shadow:0 -3px 22px #273c2a06;gap:6px}
  .nav-item{flex:1;min-width:0;min-height:54px;display:flex;flex-direction:column;justify-content:center;font-size:11px;gap:5px;border-radius:11px;padding:7px 4px;white-space:nowrap}
  .nav-item .icon{width:22px;height:22px}.nav-item.active{background:#e7eedf}
  .topbar{height:auto;padding:0 20px 18px;border-bottom:1px solid #e5eade;background:var(--bg)}
  .top-crumb{display:none}.search{width:100%;padding:11px 13px;border-radius:10px;gap:10px}.search input{font-size:13px}.search .icon{width:19px;height:19px}
  main{padding:27px 20px 0}.page-heading{position:relative;display:block;margin-bottom:24px}
  .page-heading h1{font-size:27px;line-height:1.65;margin:10px 0}.page-heading p{font-size:12px;line-height:1.9;max-width:100%;color:#8c9980}
  .eyebrow{font-size:9px;letter-spacing:1.5px}.heading-actions{margin-top:20px;flex-direction:row;justify-content:space-between;align-items:center;gap:12px;width:100%;padding:0}
  .heading-actions .btn{padding:11px 15px;font-size:12px;min-height:43px}.heading-actions .select{font-size:11px;min-height:42px;padding:9px 12px}.heading-actions:has(.btn:only-child){justify-content:flex-end}
  .stat-strip{gap:0;justify-content:space-between;padding:17px 0}.stat-strip>div{align-items:center;flex-direction:column;gap:7px}.stat-strip b{font-size:28px}.stat-strip span{font-size:10px}
  .section-title h2{font-size:20px}.section-title p{font-size:11px;line-height:1.8}.section-title small{font-size:10px}.text-btn{font-size:11px;min-height:40px}.circle-btn{width:38px;height:38px}.circle-btn .icon{width:17px;height:17px}
  .side-album-list{gap:14px}.compact .album-photo{height:150px}.compact .album-info{padding:13px 11px}.compact .album-info h3{font-size:14px}.album-location{font-size:9px}.album-meta{font-size:9px;margin-top:11px}.album-meta>span{font-size:8px}.photo-count,.photo-badge{font-size:9px;padding:4px 6px}
  .recent-grid{gap:14px}.memory-tile{height:174px}.memory-tile h3{font-size:14px;line-height:1.6}.memory-tile small,.memory-tile span{font-size:10px}
  .view-toolbar{padding-bottom:20px;gap:14px}.segmented{max-width:100%;overflow:auto}.segmented button{font-size:11px;min-height:38px;padding:8px 11px}.segmented.small button{min-width:38px;min-height:38px}.muted,.folder-tools>span{font-size:11px}
  .folder-row{padding:19px 14px}.folder-main b{font-size:13px}.folder-main small{font-size:10px}.folder-row .folder-city{font-size:10px}.folder-row .kind-chip{font-size:9px;padding:5px}.folder-row .folder-menu{min-width:32px;min-height:38px}.folder-path{font-size:11px;line-height:1.8}.folder-bottom-note{font-size:10px}.tile-caption{font-size:10px}.tile-caption small{font-size:9px}
  .year-rail>button{min-height:42px;font-size:18px}.year-rail>button:first-of-type{font-size:12px}.timeline-year-title p{font-size:10px}.timeline-copy p{font-size:12px}.timeline-copy>div{font-size:11px}.timeline-copy>div span{font-size:10px}
  .favorites-grid{column-gap:14px}.favorite-card{margin-bottom:14px}.favorite-caption b{font-size:13px;line-height:1.7}.favorite-caption span{font-size:9px}.favorite-caption small{font-size:8px}.favorite-toggle{width:34px;height:34px;right:9px;top:9px}.favorite-toggle .icon{width:17px;height:17px}
  .modal-overlay:has(.gallery-modal){padding:0;overscroll-behavior:contain;background:#f6f7f3}
  .gallery-modal{border:0;border-radius:0;min-height:100dvh;width:100%;box-shadow:none;overflow:visible}
  .gallery-cover{height:255px}.gallery-cover-copy{left:24px;right:24px;bottom:27px}.gallery-cover-copy h2{font-size:31px;line-height:1.6;margin:10px 0}.gallery-cover-copy>span{font-size:11px}.gallery-cover-copy p{font-size:11px;line-height:1.8}
  .cover-close{top:calc(17px + env(safe-area-inset-top));right:19px;width:42px;height:42px}.cover-close .icon{width:20px;height:20px}
  .gallery-body{padding:22px 18px calc(28px + env(safe-area-inset-bottom))}.gallery-note{font-size:14px;line-height:1.9}.gallery-note span{font-size:9px}
  .gallery-toolbar{position:sticky;top:0;z-index:5;background:#fbfcf8ed;backdrop-filter:blur(12px);padding:12px 0;margin:12px 0 15px}.gallery-toolbar .segmented{width:100%;justify-content:space-between}.gallery-toolbar .segmented button{font-size:11px;min-height:40px;padding:8px 7px}.gallery-toolbar .segmented small{font-size:9px;margin-left:4px}
  .album-browse-note{font-size:11px;margin-bottom:17px}.album-browse-note span:last-child{font-size:10px}
  .gallery-body .photo-grid{columns:2;column-gap:14px}.gallery-body .photo-tile{margin-bottom:14px;border-radius:9px}
  .gallery-body .tile-caption{padding:11px 10px;font-size:10px}.gallery-body .tile-caption small{font-size:8px}.gallery-body .favorite-toggle{width:34px;height:34px}
  .photo-viewer .lightbox-top{padding:calc(17px + env(safe-area-inset-top)) 20px 17px;min-height:78px;gap:15px}.viewer-title b{font-size:18px;line-height:1.6}.viewer-title span{font-size:11px;max-width:270px;color:#99aa8d}
  .viewer-slide{padding:0 8px}.photo-viewer .lightbox-arrow{top:45%;width:36px;min-width:36px;height:46px;left:8px;background:#14271950;border-radius:8px;color:#d9e5cf;backdrop-filter:blur(5px)}.photo-viewer .lightbox-arrow.next{left:auto;right:8px}.lightbox-arrow .icon{width:20px;height:20px}
  .viewer-details{padding:22px 22px calc(19px + env(safe-area-inset-bottom))}.viewer-photo-info{font-size:11px;gap:12px;margin-bottom:19px}.viewer-photo-info span{line-height:1.8}.viewer-photo-info b{font-size:12px}
  .viewer-actions{gap:12px}.viewer-actions .btn{flex:1;min-width:0;min-height:48px;font-size:13px;border-radius:10px}.viewer-hint{font-size:11px;margin-top:18px;letter-spacing:0}.touch-hint{display:inline}.desktop-hint{display:none}
  .empty p{font-size:12px;line-height:1.9}.empty .btn{font-size:12px;min-height:44px}footer{font-size:9px;line-height:1.9;letter-spacing:0}footer span{max-width:155px}.directory-crumb button{font-size:12px;min-height:36px}
  .field input,.field select,.field textarea{font-size:16px;min-height:44px}.field{font-size:12px}.form-help{font-size:11px}.type-choice b{font-size:13px}.type-choice small{font-size:10px}.import-method{font-size:12px;flex-wrap:wrap}.form-footer .btn{min-height:44px;font-size:12px}.form-footer>span{font-size:9px}
}
@media(hover:none){.photo-tile-image:hover img,.favorite-image:hover img{transform:none}}
@media(prefers-reduced-motion:reduce){.photo-transition{display:none}.viewer-slide{will-change:auto}}
