.photo-library-page {
    scroll-behavior: auto;
}
.photo-page-shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: calc(104px + env(safe-area-inset-top)) 0 56px;
}
.photo-page-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    column-gap: 16px;
    margin-bottom: 22px;
}
.photo-page-header .eyebrow {
    grid-column: 1 / -1;
}
.photo-page-header h1 {
    grid-column: 1;
    grid-row: 2;
    margin: 0;
    font-size: clamp(42px, 7vw, 76px);
    line-height: .94;
}
.photo-tag-filter {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 16px;
}
.photo-tag-filter a {
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 11px;
    border: 1px solid color-mix(in srgb, var(--photo-tag-color, #6578e8) 45%, transparent);
    border-radius: 999px;
    background: color-mix(in srgb, var(--photo-tag-color, #6578e8) 13%, white);
    color: var(--ink);
    font-size: 12px;
    font-weight: 800;
    text-decoration: none;
}
.photo-tag-filter a.is-active {
    border-color: var(--photo-tag-color, #6578e8);
    background: var(--photo-tag-color, #6578e8);
    color: var(--photo-tag-text, #fff);
}
.photo-tag-filter .photo-tag-clear {
    border-color: var(--line);
    background: transparent;
    color: var(--muted);
}
.photo-sort-tabs {
    grid-column: 2;
    grid-row: 2;
    justify-self: end;
    display: inline-flex;
    gap: 4px;
    margin-top: 0;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.82);
}
.photo-sort-tabs a {
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 14px;
    border-radius: 999px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
}
.photo-sort-tabs a.is-active {
    background: var(--ink);
    color: #fff;
}
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
    gap: 8px;
}
.photo-tile {
    display: block;
    aspect-ratio: 1 / 1;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    border-radius: 8px;
    background: #dfe3e7;
}
.photo-tile img {
    width: 100%;
    height: 100%;
    aspect-ratio: 1 / 1;
    display: block;
    object-fit: cover;
    transition: transform 180ms ease, filter 180ms ease;
}
.photo-tile:hover img {
    transform: scale(1.035);
    filter: brightness(.94);
}
.photo-empty-state {
    grid-column: 1 / -1;
    padding: 44px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
    box-shadow: var(--shadow);
}
.photo-empty-state h2 {
    margin-bottom: 10px;
    font-size: 24px;
}
.photo-empty-state p {
    margin: 0;
    color: var(--muted);
    line-height: 1.7;
}
.photo-load-sentinel {
    height: 1px;
}
.photo-modal {
    width: min(1040px, calc(100% - 28px));
    max-height: calc(100vh - 28px);
    padding: 0;
    border: 0;
    border-radius: 16px;
    background: #111;
    color: #fff;
    overflow: hidden;
}
.photo-modal::backdrop {
    background: rgba(8, 10, 12, .74);
    backdrop-filter: blur(8px);
}
.photo-modal img {
    width: 100%;
    max-height: calc(100vh - 104px);
    display: block;
    object-fit: contain;
    background: #111;
    cursor: zoom-in;
    touch-action: none;
    transform: translate3d(var(--photo-pan-x, 0px), var(--photo-pan-y, 0px), 0) scale(var(--photo-scale, 1));
    transform-origin: center center;
    transition: transform 160ms ease;
    will-change: transform;
}
.photo-modal.is-zoomed img {
    cursor: grab;
    transition: none;
}
.photo-modal footer {
    min-height: 56px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    gap: 8px 16px;
    padding: 12px 16px;
    background: #111;
}

.photo-modal footer time {
    color: rgba(255, 255, 255, 0.92);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    font-weight: 780;
    line-height: 1.45;
    white-space: nowrap;
}

.photo-modal footer p {
    margin: 0;
    max-height: 5.8em;
    overflow-y: auto;
    color: rgba(255, 255, 255, 0.82);
    font-size: 13px;
    font-weight: 650;
    line-height: 1.45;
    overflow-wrap: anywhere;
    white-space: normal;
}

.photo-modal footer p[hidden] {
    display: none;
}
.photo-modal-tags {
    grid-column: 2;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}
.photo-modal-tags[hidden] {
    display: none;
}
.photo-modal-tags span {
    display: inline-flex;
    min-height: 22px;
    align-items: center;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 850;
}
.photo-modal-share,
.photo-modal-close {
    position: absolute;
    top: 12px;
    z-index: 2;
    height: 38px;
    border: 0;
    border-radius: 999px;
    background: rgba(255,255,255,.86);
    color: #111;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    opacity: 1;
    transform: scale(1);
    transition: opacity 180ms ease, transform 180ms ease, background 180ms ease;
}
.photo-modal-share {
    left: 12px;
    min-width: 84px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 0 14px;
    font-size: 13px;
    font-weight: 850;
}
.photo-modal-share svg {
    width: 18px;
    height: 18px;
}
.photo-modal-share:disabled {
    cursor: wait;
    opacity: .7;
}
.photo-modal-close {
    right: 12px;
    width: 38px;
}
.photo-modal-nav {
    position: absolute;
    top: 50%;
    z-index: 2;
    width: 44px;
    height: 56px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transform: translateY(-50%);
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, .76);
    color: #111;
    font-size: 34px;
    line-height: 1;
    cursor: pointer;
    opacity: 1;
    transition: opacity 180ms ease, transform 180ms ease, background 180ms ease;
}
.photo-modal.is-ui-hidden .photo-modal-share,
.photo-modal.is-ui-hidden .photo-modal-close {
    opacity: 0;
    pointer-events: none;
    transform: scale(.94);
}
.photo-modal.is-ui-hidden .photo-modal-nav,
.photo-modal.is-zoomed .photo-modal-nav {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-50%) scale(.94);
}
.photo-modal-nav:hover {
    background: rgba(255, 255, 255, .92);
}
.photo-modal-share:hover,
.photo-modal-close:hover {
    background: rgba(255, 255, 255, .96);
}
.photo-modal-share:focus-visible,
.photo-modal-close:focus-visible,
.photo-modal-nav:focus-visible {
    outline: 3px solid rgba(255, 255, 255, .42);
    outline-offset: 3px;
}
.photo-modal-prev { left: 14px; }
.photo-modal-next { right: 14px; }
