/* Family Photo Archive */
:root {
    color-scheme: dark;
    --background: #0d1119;
    --surface: #151b26;
    --surface-raised: #1b2330;
    --border: #2b3545;
    --text: #f4f7fb;
    --muted: #9ba8b8;
    --accent: #5e8cff;
    --accent-hover: #77a0ff;
    --danger: #ff6b75;
    --success: #4fd59b;
    --radius: 18px;
    --shadow: 0 20px 60px rgb(0 0 0 / 24%);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--background);
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--text);
    background:
        radial-gradient(circle at 15% -10%, rgb(75 111 205 / 24%), transparent 36rem),
        var(--background);
}

body.viewer-open {
    overflow: hidden;
}

a {
    color: inherit;
}

button,
input,
select {
    font: inherit;
}

.topbar {
    position: sticky;
    z-index: 20;
    top: 0;
    display: flex;
    min-height: 70px;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 12px clamp(18px, 4vw, 56px);
    border-bottom: 1px solid rgb(255 255 255 / 8%);
    background: rgb(13 17 25 / 82%);
    backdrop-filter: blur(18px);
}

.brand {
    font-size: 1.05rem;
    font-weight: 750;
    letter-spacing: -0.02em;
    text-decoration: none;
}

.topnav {
    display: flex;
    align-items: center;
    gap: 14px;
}

.topnav form {
    margin: 0;
}

.username {
    color: var(--muted);
    font-size: 0.9rem;
    text-decoration: none;
}

.nav-link {
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
}

.nav-link:hover {
    color: var(--text);
}

.page {
    width: min(1500px, 100%);
    margin: 0 auto;
    padding: clamp(24px, 4vw, 56px);
}

.hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 28px;
    margin: 8px 0 38px;
}

h1,
h2,
p {
    margin-top: 0;
}

h1 {
    max-width: 850px;
    margin-bottom: 10px;
    font-size: clamp(2rem, 5vw, 4.6rem);
    line-height: 0.98;
    letter-spacing: -0.055em;
}

h2 {
    margin-bottom: 10px;
    letter-spacing: -0.025em;
}

.eyebrow {
    margin-bottom: 12px;
    color: #8eabff;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.muted {
    color: var(--muted);
    line-height: 1.6;
}

.button,
.link-button,
.icon-button {
    border: 0;
    cursor: pointer;
}

.button {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    background: var(--surface-raised);
    font-weight: 700;
    text-decoration: none;
    transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.button:hover {
    transform: translateY(-1px);
    border-color: #465674;
}

.button-primary {
    border-color: transparent;
    color: #fff;
    background: var(--accent);
}

.button-primary:hover {
    border-color: transparent;
    background: var(--accent-hover);
}

.button-large {
    min-height: 50px;
    padding: 13px 20px;
}

.button:disabled {
    cursor: wait;
    opacity: 0.65;
    transform: none;
}

.link-button {
    padding: 8px 0;
    color: var(--muted);
    background: transparent;
}

.link-button:hover,
.back-link:hover {
    color: var(--text);
}

.flash {
    margin: 0 0 20px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    line-height: 1.45;
}

.flash-success {
    border-color: rgb(79 213 155 / 45%);
    color: #b7f5da;
    background: rgb(79 213 155 / 10%);
}

.flash-error {
    border-color: rgb(255 107 117 / 45%);
    color: #ffc3c7;
    background: rgb(255 107 117 / 10%);
}

.flash-info {
    border-color: rgb(94 140 255 / 45%);
    color: #c6d5ff;
    background: rgb(94 140 255 / 10%);
}

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 235px), 1fr));
    gap: clamp(12px, 2vw, 22px);
}

.move-panel {
    margin-bottom: 22px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: rgb(21 27 38 / 88%);
}

.move-panel p {
    margin: 0;
    color: var(--muted);
}

.move-panel a {
    color: #c6d5ff;
}

.move-form {
    display: flex;
    align-items: center;
    gap: 14px;
}

.move-select-all {
    display: flex;
    align-items: center;
    gap: 9px;
    cursor: pointer;
    font-weight: 700;
}

.move-select-all input {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--accent);
}

.move-count {
    margin-right: auto;
    color: var(--muted);
    white-space: nowrap;
}

.move-target {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 700;
}

.move-target select {
    width: min(280px, 32vw);
    min-height: 42px;
    padding-block: 8px;
}

.move-form .button:disabled {
    cursor: not-allowed;
}

.photo-card {
    position: relative;
    min-width: 0;
    overflow: hidden;
    border: 1px solid rgb(255 255 255 / 9%);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: 0 12px 36px rgb(0 0 0 / 14%);
}

.photo-card.is-selected {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgb(94 140 255 / 24%), 0 12px 36px rgb(0 0 0 / 14%);
}

.photo-select {
    position: absolute;
    z-index: 4;
    top: 10px;
    left: 10px;
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    cursor: pointer;
}

.photo-select input {
    position: absolute;
    inset: 0;
    margin: 0;
    cursor: pointer;
    opacity: 0;
}

.photo-select span {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border: 2px solid rgb(255 255 255 / 82%);
    border-radius: 10px;
    color: transparent;
    background: rgb(5 8 13 / 72%);
    box-shadow: 0 4px 14px rgb(0 0 0 / 35%);
    font-weight: 900;
}

.photo-select input:checked + span {
    border-color: var(--accent);
    color: #fff;
    background: var(--accent);
}

.photo-select input:focus-visible + span {
    outline: 3px solid rgb(255 255 255 / 82%);
    outline-offset: 2px;
}

.photo-link {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    cursor: zoom-in;
    background: #090d13;
}

.photo-link img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 260ms ease;
}

.photo-link:hover img {
    transform: scale(1.025);
}

.photo-meta {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 13px 14px;
}

.photo-actions {
    display: flex;
    align-items: center;
}

.photo-actions form {
    margin: 0;
}

.photo-meta strong,
.photo-meta span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.photo-meta strong {
    margin-bottom: 5px;
    font-size: 0.88rem;
}

.photo-meta span {
    color: var(--muted);
    font-size: 0.74rem;
}

.icon-button {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 10px;
    color: var(--muted);
    background: transparent;
    font-size: 1.35rem;
}

.icon-button:hover {
    color: var(--danger);
    background: rgb(255 107 117 / 10%);
}

.empty-state,
.auth-card,
.upload-card,
.form-card {
    width: min(100%, 620px);
    margin: clamp(20px, 7vh, 90px) auto;
    padding: clamp(24px, 5vw, 46px);
    border: 1px solid rgb(255 255 255 / 10%);
    border-radius: 24px;
    background: rgb(21 27 38 / 88%);
    box-shadow: var(--shadow);
}

.empty-state {
    width: min(100%, 720px);
    text-align: center;
}

.upload-card {
    width: min(100%, 780px);
}

.empty-icon {
    margin-bottom: 18px;
    color: #8eabff;
    font-size: 3rem;
}

.auth-card h1,
.upload-card h1,
.form-card h1 {
    font-size: clamp(2rem, 7vw, 3.5rem);
}

.stack-form {
    display: grid;
    gap: 18px;
    margin-top: 28px;
}

.stack-form label:not(.dropzone) {
    display: grid;
    gap: 8px;
    color: #d8dfeb;
    font-size: 0.88rem;
    font-weight: 700;
}

input[type="text"],
input[type="password"],
select,
input[type="file"] {
    width: 100%;
    min-height: 50px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    outline: none;
    color: var(--text);
    background: #0f141e;
}

input[type="text"]:focus,
input[type="password"]:focus,
select:focus,
input[type="file"]:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgb(94 140 255 / 15%);
}

input[type="file"] {
    padding: 10px;
}

.auth-footer {
    margin: 22px 0 0;
    color: var(--muted);
    text-align: center;
}

.back-link {
    display: inline-block;
    margin-bottom: 32px;
    color: var(--muted);
    text-decoration: none;
}

.dropzone {
    display: grid;
    min-height: 240px;
    place-content: center;
    gap: 8px;
    padding: 28px;
    border: 2px dashed #4a6288;
    border-radius: 18px;
    cursor: pointer;
    text-align: center;
    background: rgb(94 140 255 / 6%);
    transition: border-color 160ms ease, background 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.dropzone:hover,
.dropzone.is-dragging {
    border-color: var(--accent);
    background: rgb(94 140 255 / 11%);
}

.dropzone.is-dragging {
    transform: scale(1.012);
    border-style: solid;
    box-shadow: 0 0 0 5px rgb(94 140 255 / 11%), inset 0 0 60px rgb(94 140 255 / 8%);
}

.dropzone .dropzone-icon {
    display: grid;
    width: 54px;
    height: 54px;
    margin: 0 auto 6px;
    place-items: center;
    border-radius: 16px;
    color: #d8e4ff;
    background: linear-gradient(145deg, #36558d, #253957);
    box-shadow: 0 12px 30px rgb(0 0 0 / 23%);
    font-size: 1.8rem;
    font-weight: 800;
}

.dropzone strong {
    font-size: 1.08rem;
}

.dropzone span {
    color: var(--muted);
    font-size: 0.85rem;
}

.dropzone small {
    margin-top: 5px;
    color: #78879b;
    font-size: .74rem;
}

.dropzone input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
}

.selection-summary {
    color: #c6d5ff;
    font-weight: 700;
}

.upload-progress {
    display: grid;
    gap: 11px;
    padding: 18px;
    border: 1px solid #34465f;
    border-radius: 16px;
    background: #101824;
}

.upload-progress-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 15px;
}

.upload-progress-heading strong {
    color: #dce7ff;
    font-size: 1.45rem;
    letter-spacing: -.04em;
}

.upload-progress-heading span {
    color: #aebdd0;
    font-size: .82rem;
    text-align: right;
}

.upload-progress progress {
    width: 100%;
    height: 13px;
    overflow: hidden;
    border: 0;
    border-radius: 999px;
    color: var(--accent);
    background: #0b1018;
    accent-color: var(--accent);
}

.upload-progress progress::-webkit-progress-bar {
    border-radius: 999px;
    background: #0b1018;
}

.upload-progress progress::-webkit-progress-value {
    border-radius: 999px;
    background: linear-gradient(90deg, var(--accent), #7d5cff);
}

.upload-progress progress::-moz-progress-bar {
    border-radius: 999px;
    background: linear-gradient(90deg, var(--accent), #7d5cff);
}

.upload-status {
    color: var(--muted);
    font-size: 0.85rem;
}

.upload-status-error {
    color: var(--danger);
}

.preview-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.preview-grid figure,
.preview-more {
    min-width: 0;
    margin: 0;
    overflow: hidden;
    border-radius: 12px;
    background: #0b1018;
}

.preview-grid img {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

.preview-grid figcaption {
    overflow: hidden;
    padding: 7px 8px;
    color: var(--muted);
    font-size: 0.68rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.preview-more {
    display: grid;
    min-height: 90px;
    place-items: center;
    color: var(--muted);
    font-weight: 750;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    margin-top: 36px;
    color: var(--muted);
}

.hero-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.album-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 235px), 1fr));
    gap: clamp(16px, 2vw, 26px);
}

.album-card {
    min-width: 0;
    overflow: hidden;
    border: 1px solid rgb(255 255 255 / 9%);
    border-radius: 20px;
    background: var(--surface);
    box-shadow: 0 14px 38px rgb(0 0 0 / 16%);
}

.album-cover {
    display: grid;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    place-items: center;
    color: #91adff;
    background: linear-gradient(145deg, #1d2b46, #111722);
    text-decoration: none;
}

.album-cover img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 50%;
    transition: transform 220ms ease;
}

.album-cover img.is-portrait-cover {
    object-position: 50% 50%;
}

.album-cover:hover img {
    transform: scale(1.03);
}

.folder-icon {
    font-size: 4.2rem;
    filter: drop-shadow(0 10px 16px rgb(0 0 0 / 25%));
}

.album-card-body {
    display: grid;
    gap: 5px;
    padding: 17px 18px 19px;
}

.album-title {
    overflow: hidden;
    margin-bottom: 5px;
    font-size: 1.08rem;
    font-weight: 800;
    text-decoration: none;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.album-card-body span {
    color: var(--muted);
    font-size: 0.78rem;
}

.settings-header {
    margin-bottom: 30px;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.settings-card,
.user-admin-card {
    padding: clamp(20px, 3vw, 30px);
    border: 1px solid rgb(255 255 255 / 9%);
    border-radius: 18px;
    background: var(--surface);
}

.settings-card-wide {
    grid-column: 1 / -1;
}

.compact-form {
    margin-top: 18px;
}

.current-cover {
    display: block;
    width: min(100%, 360px);
    aspect-ratio: 16 / 10;
    margin: 16px 0;
    border-radius: 14px;
    object-fit: cover;
    object-position: 50% 50%;
}

.current-cover.is-portrait-cover {
    object-position: 50% 50%;
}

.small-text {
    font-size: 0.82rem;
}

.danger-text {
    color: var(--danger);
}

.access-form {
    display: grid;
    gap: 20px;
}

.user-checklist {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
}

.user-check {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #101620;
}

.user-check input,
.toggle-row input {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
}

.user-check span,
.user-check strong,
.user-check small {
    display: block;
}

.user-check small {
    margin-top: 3px;
    color: var(--muted);
}

.user-admin-list {
    display: grid;
    gap: 16px;
}

.user-admin-card {
    display: grid;
    gap: 20px;
}

.user-pending {
    border-color: rgb(94 140 255 / 48%);
}

.user-admin-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.user-admin-heading h2 {
    margin-bottom: 8px;
}

.status-badge {
    display: inline-flex;
    padding: 5px 9px;
    border-radius: 999px;
    color: #c6d5ff;
    background: rgb(94 140 255 / 13%);
    font-size: 0.72rem;
    font-weight: 800;
}

.status-active {
    color: #b7f5da;
    background: rgb(79 213 155 / 12%);
}

.status-blocked {
    color: #ffc3c7;
    background: rgb(255 107 117 / 12%);
}

.user-admin-form {
    display: grid;
    grid-template-columns: minmax(180px, 0.7fr) minmax(260px, 1fr) auto;
    align-items: end;
    gap: 14px;
}

.user-admin-form > label:not(.toggle-row) {
    display: grid;
    gap: 7px;
    color: #d8dfeb;
    font-size: 0.82rem;
    font-weight: 700;
}

.toggle-row {
    display: flex;
    min-height: 50px;
    align-items: center;
    gap: 10px;
    color: #d8dfeb;
    font-size: 0.84rem;
}

.photo-viewer {
    position: fixed;
    inset: 0;
    width: 100vw;
    max-width: none;
    height: 100dvh;
    max-height: none;
    margin: 0;
    padding: 0;
    border: 0;
    overflow: hidden;
    color: #fff;
    background: rgb(4 6 10 / 96%);
}

.photo-viewer::backdrop {
    background: rgb(0 0 0 / 88%);
}

.photo-viewer[open] {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
}

.viewer-toolbar {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 13px 18px;
    border-bottom: 1px solid rgb(255 255 255 / 12%);
}

.viewer-toolbar > span {
    overflow: hidden;
    color: #d9e1ee;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.viewer-toolbar > div {
    display: flex;
    flex: 0 0 auto;
    gap: 8px;
}

.viewer-button {
    min-height: 38px;
    padding: 8px 12px;
    border: 1px solid rgb(255 255 255 / 18%);
    border-radius: 10px;
    color: #fff;
    cursor: pointer;
    background: rgb(255 255 255 / 8%);
}

.viewer-stage {
    position: relative;
    display: grid;
    width: 100%;
    height: 100%;
    min-height: 0;
    place-items: center;
    overflow: hidden;
    touch-action: pan-y pinch-zoom;
}

.viewer-stage img {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    object-fit: contain;
    cursor: zoom-in;
    transition: transform 180ms ease;
}

.viewer-stage.is-zoomed {
    display: block;
    padding: 18px;
    overflow: auto;
    text-align: center;
}

.viewer-stage.is-zoomed img {
    position: static;
    max-width: none;
    max-height: none;
    width: auto;
    height: auto;
    margin: 0 auto;
    cursor: zoom-out;
}

.viewer-arrow {
    position: fixed;
    z-index: 2;
    top: 50%;
    width: 50px;
    height: 70px;
    border: 0;
    border-radius: 13px;
    color: #fff;
    cursor: pointer;
    background: rgb(0 0 0 / 45%);
    font-size: 2.7rem;
}

.viewer-prev {
    left: 14px;
}

.viewer-next {
    right: 14px;
}

.viewer-counter {
    padding: 10px;
    color: #aeb8c7;
    text-align: center;
}

@media (max-width: 700px) {
    .topbar {
        min-height: 62px;
        gap: 12px;
        padding: 10px 16px;
    }

    .brand {
        max-width: 36vw;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .username {
        display: none;
    }

    .topnav {
        gap: 10px;
    }

    .nav-link {
        font-size: 0.75rem;
    }

    .topnav .button {
        min-height: 38px;
        padding: 8px 11px;
        font-size: 0.82rem;
    }

    .page {
        padding: 26px 16px 44px;
    }

    .hero {
        display: grid;
        align-items: start;
        margin-bottom: 28px;
    }

    .hero .button {
        width: 100%;
    }

    .hero-actions {
        display: grid;
        width: 100%;
    }

    .move-form {
        display: grid;
        grid-template-columns: 1fr;
    }

    .move-count {
        margin-right: 0;
    }

    .move-target {
        display: grid;
    }

    .move-target select,
    .move-form .button {
        width: 100%;
    }

    .settings-grid {
        grid-template-columns: 1fr;
    }

    .user-admin-heading {
        display: grid;
    }

    .user-admin-form {
        grid-template-columns: 1fr;
    }

    .viewer-toolbar {
        padding: 10px;
    }

    .viewer-toolbar > span {
        max-width: 32vw;
        font-size: 0.78rem;
    }

    .viewer-button {
        padding: 7px 9px;
        font-size: 0.78rem;
    }

    .viewer-arrow {
        top: 48%;
        width: 42px;
        height: 62px;
    }

    .viewer-prev {
        left: 7px;
    }

    .viewer-next {
        right: 7px;
    }

    .gallery {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .photo-card {
        border-radius: 13px;
    }

    .photo-meta {
        padding: 9px 10px;
    }

    .photo-meta strong {
        font-size: 0.75rem;
    }

    .photo-meta span {
        font-size: 0.64rem;
    }

    .icon-button {
        width: 28px;
        height: 28px;
    }

    .empty-state,
    .auth-card,
    .upload-card,
    .form-card {
        margin: 12px auto;
        padding: 24px 20px;
        border-radius: 18px;
    }

    .preview-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .pagination {
        flex-wrap: wrap;
        font-size: 0.85rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition: none !important;
    }
}

/* Collection experience */
[hidden] { display: none !important; }

:root {
    --background: #0b1018;
    --surface: #171f2a;
    --surface-raised: #202b39;
    --border: #344253;
    --accent: #638df9;
    --accent-hover: #7da3ff;
}

body {
    background: radial-gradient(ellipse at 12% 0%, rgb(73 106 181 / 16%), transparent 34rem),
        radial-gradient(ellipse at 88% 20%, rgb(48 142 142 / 8%), transparent 38rem), var(--background);
}

:focus-visible { outline: 2px solid #a5c2ff; outline-offset: 3px; }
.topbar { min-height: 76px; }
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand::before {
    content: '✦'; display: grid; width: 30px; height: 30px; place-items: center;
    border-radius: 10px; color: #bcd2ff; background: #263859; font-size: 1.1rem;
}
.topnav { flex-wrap: wrap; justify-content: flex-end; }
.nav-link { padding: 8px 10px; border-radius: 9px; }
.nav-link:hover { background: rgb(255 255 255 / 7%); }
.button { box-shadow: 0 7px 22px rgb(0 0 0 / 10%); }
.button-primary { background: linear-gradient(135deg, #6489f0, #5e79dd); }
.button-primary:hover { background: linear-gradient(135deg, #789dfb, #718aeb); }

.memory-hero {
    position: relative; display: flex; min-height: clamp(330px, 35vw, 490px);
    align-items: flex-end; overflow: hidden; margin: 4px 0 44px;
    border: 1px solid rgb(255 255 255 / 13%); border-radius: 28px;
    background: #17202d; box-shadow: 0 28px 80px rgb(0 0 0 / 24%);
}
.memory-hero > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; }
.memory-shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgb(7 13 24 / 88%), rgb(7 13 24 / 38%) 68%, transparent), linear-gradient(0deg, rgb(5 11 20 / 70%), transparent 80%); }
.memory-content { position: relative; z-index: 1; width: min(100%, 720px); padding: clamp(24px, 5vw, 58px); }
.memory-badge, .transfer-kicker {
    display: inline-flex; margin-bottom: 16px; color: #b9cfff; font-size: .75rem;
    font-weight: 850; letter-spacing: .12em; text-transform: uppercase;
}
.memory-content h1 { max-width: 690px; font-size: clamp(2.1rem, 4.2vw, 4.25rem); line-height: 1.04; }
.memory-content p { margin: 16px 0 24px; color: #e0e7f2; }
.memory-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.button-glass { background: rgb(17 28 43 / 64%); border-color: rgb(255 255 255 / 35%); backdrop-filter: blur(10px); }
.memory-viewer-arrow {
    display: grid;
    width: 44px;
    height: 44px;
    padding: 0;
    place-items: center;
    border: 1px solid rgb(255 255 255 / 42%);
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    background: rgb(17 28 43 / 64%);
    backdrop-filter: blur(10px);
    box-shadow: 0 7px 22px rgb(0 0 0 / 15%);
    transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}
.memory-viewer-arrow svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.memory-viewer-arrow:hover { transform: scale(1.06); border-color: #fff; background: rgb(33 49 72 / 86%); }
.memory-viewer-arrow:disabled { cursor: wait; opacity: .7; }
.memory-viewer-arrow.is-loading { animation: memory-arrow-pulse 800ms ease-in-out infinite alternate; }
@keyframes memory-arrow-pulse { to { transform: scale(.92); opacity: .55; } }
.dashboard-intro { margin-bottom: 24px; }
.dashboard-intro h1 { margin-bottom: 10px; }
.library-overview { display: flex; gap: 0; margin-bottom: 55px; padding: 18px 0; border-block: 1px solid rgb(255 255 255 / 10%); }
.library-overview > div { display: grid; min-width: 190px; gap: 4px; padding-right: 34px; margin-right: 34px; border-right: 1px solid rgb(255 255 255 / 12%); }
.library-overview > div:last-child { border-right: 0; }
.library-overview strong { font-size: 1.25rem; letter-spacing: -.03em; }
.library-overview span { color: var(--muted); font-size: .78rem; }
.album-group-filter {
    display: grid;
    gap: 14px;
    margin: -28px 0 34px;
    padding: 16px 18px;
    border: 1px solid rgb(94 140 255 / 28%);
    border-radius: 15px;
    background: linear-gradient(110deg, rgb(24 35 53 / 82%), rgb(16 24 36 / 76%));
}
.album-group-filter-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.album-group-filter-heading > div { display: grid; gap: 4px; }
.album-group-filter-heading strong { font-size: .88rem; }
.album-group-filter-heading span { color: var(--muted); font-size: .75rem; line-height: 1.4; }
#album-group-filter-status { flex: 0 0 auto; padding-top: 2px; color: #b9cbeb; font-weight: 700; }
.album-group-filter-options { display: flex; flex-wrap: wrap; gap: 9px 18px; }
.album-group-filter-option { display: flex; align-items: center; gap: 8px; min-height: 34px; cursor: pointer; user-select: none; }
.album-group-filter-option input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
.album-group-filter-option span { color: #dbe7f8; font-size: .82rem; font-weight: 720; }
.collection-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.collection-toolbar h2 { margin-bottom: 0; font-size: clamp(1.5rem, 2.6vw, 2.4rem); }
.collection-toolbar .eyebrow { margin-bottom: 5px; }
.album-search { display: grid; gap: 7px; min-width: min(100%, 280px); color: var(--muted); font-size: .76rem; font-weight: 750; }
.album-search input { width: 100%; min-height: 44px; padding: 10px 13px; border: 1px solid var(--border); border-radius: 11px; outline: none; color: var(--text); background: #101722; }
.album-search input:focus { border-color: var(--accent); }
.album-card { transition: transform 180ms ease, border-color 180ms ease; }
.album-card[hidden] { display: none; }
.album-card:hover { transform: translateY(-3px); border-color: #53657e; }
.album-card-body { min-height: 110px; }
.album-paste-hint { color: #b5ccff; font-size: .78rem; font-weight: 750; text-decoration: none; }
.album-paste-hint:hover { text-decoration: underline; }

.transfer-banner {
    display: flex; align-items: center; justify-content: space-between; gap: 22px;
    margin-bottom: 26px; padding: 19px 22px; border: 1px solid rgb(126 177 255 / 43%);
    border-radius: 18px; background: linear-gradient(110deg, #1a2a42, #152331);
    box-shadow: 0 16px 40px rgb(0 0 0 / 13%);
}
.transfer-kicker { margin-bottom: 5px; font-size: .65rem; }
.transfer-banner strong { display: block; font-size: 1.12rem; }
.transfer-banner p { margin: 5px 0 0; color: #b8c8dc; font-size: .84rem; line-height: 1.5; }
.transfer-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.transfer-actions form, .transfer-banner > form { margin: 0; }
.album-hero { margin-bottom: 28px; }
.hero-actions { flex-wrap: wrap; justify-content: flex-end; }
.move-panel { position: sticky; z-index: 9; top: 86px; background: #1c2b40; border-color: #4a6a99; box-shadow: 0 15px 45px rgb(0 0 0 / 30%); }
.move-form { flex-wrap: wrap; }
.move-instruction { display: grid; min-width: min(100%, 210px); gap: 4px; margin-right: auto; }
.move-instruction strong { font-size: .85rem; }
.move-instruction span { color: #b7c9e2; font-size: .75rem; }
.move-count { margin-right: 0; font-size: .8rem; }
.photo-select { display: none; }
.gallery.is-selecting .photo-select { display: grid; }
.gallery.is-selecting .photo-link { cursor: pointer; }
.gallery.is-selecting .photo-actions { visibility: hidden; }
.gallery.is-selecting .photo-card { border-color: #445b7b; }
.gallery.is-selecting .photo-card.is-selected { border-color: #92b3ff; }
.gallery.is-selecting .photo-card.is-selected::after { content: ''; position: absolute; inset: 0; border: 2px solid #92b3ff; border-radius: inherit; pointer-events: none; }
.feature-toggle { display: flex !important; align-items: center; gap: 15px; padding: 18px; border: 1px solid var(--border); border-radius: 15px; background: #101924; cursor: pointer; }
.feature-toggle input { width: 21px; height: 21px; flex: 0 0 auto; accent-color: var(--accent); }
.feature-toggle span { display: grid; gap: 5px; }
.feature-toggle small { color: var(--muted); font-weight: 400; line-height: 1.45; }
.admin-settings-card { max-width: 780px; }
.admin-settings-list { display: grid; max-width: 780px; gap: 20px; }
.access-group-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.access-group-option { display: flex !important; align-items: center; gap: 12px; padding: 14px; border: 1px solid var(--border); border-radius: 13px; background: #101721; cursor: pointer; }
.access-group-option input { width: 19px; height: 19px; flex: 0 0 auto; accent-color: var(--accent); }
.access-group-option span, .access-group-option strong, .access-group-option small { display: block; }
.access-group-option small { margin-top: 4px; color: var(--muted); font-weight: 400; }
.access-note { padding: 11px 13px; border: 1px solid rgb(79 213 155 / 30%); border-radius: 11px; color: #bdf2db; background: rgb(79 213 155 / 8%); font-size: .82rem; }
.group-name-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.user-check { display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; gap: 11px; }
.user-check select { min-height: 40px; padding: 8px 10px; font-size: .82rem; }
.user-card-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; }
.user-card-actions form { margin: 0; }
.user-detail-hero { align-items: center; }
.user-detail-grid { align-items: start; }
.profile-storage-card { width: min(100%, 820px); margin: 0 auto; }
.storage-numbers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 20px 0; }
.storage-numbers > div { display: grid; gap: 5px; padding: 15px; border: 1px solid var(--border); border-radius: 14px; background: #101721; }
.storage-numbers strong { overflow-wrap: anywhere; font-size: 1.15rem; }
.storage-numbers span { color: var(--muted); font-size: .74rem; }
.storage-percent { margin: 12px 0 0; color: #c7d7f0; font-weight: 750; }
.battery-shell {
    position: relative; display: inline-flex; width: 132px; height: 19px; align-items: center;
    padding: 2px; border: 2px solid #7d8ba0; border-radius: 5px;
}
.battery-shell::after { content: ''; position: absolute; right: -6px; width: 4px; height: 8px; border-radius: 0 3px 3px 0; background: #7d8ba0; }
.storage-battery { width: 100%; height: 100%; border: 0; border-radius: 2px; overflow: hidden; appearance: none; background: #202a38; }
.storage-battery::-webkit-progress-bar { background: #202a38; }
.storage-battery::-webkit-progress-value { background: linear-gradient(90deg, #5ed0a1, #7de7b9); }
.storage-battery::-moz-progress-bar { background: linear-gradient(90deg, #5ed0a1, #7de7b9); }
.battery-large { width: min(100%, 360px); height: 24px; }
.battery-unlimited { justify-content: center; color: #8fe1bc; font-size: .78rem; font-weight: 850; }
.storage-overview { gap: 5px !important; }
.storage-overview .battery-shell { margin-top: 5px; }
.folder-access-list { display: grid; gap: 10px; }
.folder-access-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(190px, 260px); align-items: center; gap: 18px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 14px; background: #101721; }
.folder-access-row > div { min-width: 0; }
.folder-access-row strong, .folder-access-row span { display: block; }
.folder-access-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder-access-row span { margin-top: 4px; color: var(--muted); font-size: .75rem; }
.folder-access-row select { min-height: 42px; padding: 8px 11px; }
.folder-access-row .access-fixed { margin: 0; padding: 10px 12px; border-radius: 10px; color: #bdf2db; background: rgb(79 213 155 / 10%); font-size: .8rem; font-weight: 750; text-align: center; }
.upload-space-info { padding: 12px 14px; border: 1px solid rgb(94 140 255 / 36%); border-radius: 12px; color: #c9d8ff; background: rgb(94 140 255 / 8%); font-size: .84rem; font-weight: 700; }
.selection-over-quota { color: #ffadb3; }

@media (max-width: 850px) {
    .library-overview { margin-bottom: 35px; }
    .library-overview > div { min-width: 0; flex: 1; padding-right: 14px; margin-right: 14px; }
    .move-panel { top: 74px; }
}
@media (max-width: 700px) {
    .memory-hero { min-height: 420px; margin-bottom: 30px; border-radius: 20px; }
    .memory-shade { background: linear-gradient(0deg, rgb(5 10 20 / 93%), rgb(5 10 20 / 25%) 82%); }
    .memory-content { padding: 24px; }
    .memory-content h1 { font-size: clamp(2rem, 8vw, 3rem); }
    .dashboard-intro { margin-bottom: 20px; }
    .library-overview { flex-wrap: wrap; gap: 16px; }
    .library-overview > div { min-width: 130px; flex: 1 1 36%; border: 0; margin: 0; }
    .album-group-filter { margin-top: -12px; padding: 15px; }
    .album-group-filter-heading { display: grid; gap: 7px; }
    #album-group-filter-status { padding: 0; }
    .collection-toolbar { display: grid; }
    .album-search { width: 100%; }
    .transfer-banner { align-items: flex-start; flex-direction: column; padding: 18px; }
    .transfer-actions { width: 100%; }
    .transfer-actions .button { width: auto; }
    .move-panel { position: static; }
    .move-form { display: flex; }
    .move-instruction { width: 100%; }
    .move-form .button { width: auto; }
    .topbar { align-items: flex-start; }
    .brand { max-width: 44vw; }
    .storage-numbers { grid-template-columns: 1fr; }
    .group-name-list { grid-template-columns: 1fr; }
    .folder-access-row { grid-template-columns: 1fr; }
    .folder-access-row select { width: 100%; }
}
@media (max-width: 430px) {
    .topnav { gap: 1px; }
    .topnav .nav-link { padding: 6px 5px; }
    .topnav .link-button { padding: 6px 3px; font-size: .75rem; }
    .memory-actions .button { width: 100%; }
    .viewer-toolbar > span { max-width: 20vw; }
}

/* Video library */
.video-hero { margin-bottom: 24px; }
.video-upload-card {
    margin-bottom: 52px;
    padding: clamp(22px, 4vw, 36px);
    border: 1px solid rgb(255 255 255 / 11%);
    border-radius: 24px;
    background: linear-gradient(135deg, rgb(28 39 56 / 94%), rgb(17 25 37 / 94%));
    box-shadow: 0 24px 65px rgb(0 0 0 / 18%);
}
.video-upload-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
}
.video-upload-heading h2 { margin-bottom: 0; font-size: clamp(1.35rem, 2.5vw, 2rem); }
.video-dropzone { min-height: 190px; }
.video-selection-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 10px;
}
.video-selection-item {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 11px;
    padding: 11px 13px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #0e151f;
}
.video-selection-icon {
    display: grid;
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 10px;
    color: #d5e1ff;
    background: #263a5d;
    font-size: .72rem;
}
.video-selection-item > span:last-child { min-width: 0; }
.video-selection-item strong,
.video-selection-item small { display: block; }
.video-selection-item strong { overflow: hidden; font-size: .8rem; text-overflow: ellipsis; white-space: nowrap; }
.video-selection-item small { margin-top: 3px; color: var(--muted); font-size: .7rem; }
.video-collection-heading { margin-bottom: 20px; }
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 22px;
}
.video-card {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--surface);
    box-shadow: 0 15px 38px rgb(0 0 0 / 13%);
    transition: transform 180ms ease, border-color 180ms ease;
}
.video-card:hover { transform: translateY(-3px); border-color: #53657e; }
.video-card-preview {
    position: relative;
    display: grid;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    place-items: center;
    border: 0;
    color: #fff;
    cursor: pointer;
    background:
        radial-gradient(circle at 50% 48%, rgb(91 136 239 / 36%), transparent 22%),
        linear-gradient(145deg, #101a2a, #080d14 68%);
}
.video-card-preview::before,
.video-card-preview::after {
    content: '';
    position: absolute;
    inset-inline: 0;
    height: 14px;
    opacity: .35;
    z-index: 2;
    background: repeating-linear-gradient(90deg, #8fabde 0 18px, transparent 18px 29px);
}
.video-card-thumb {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: .64;
    pointer-events: none;
}
.video-card-preview::before { top: 0; }
.video-card-preview::after { bottom: 0; }
.video-film-mark {
    position: absolute;
    top: 25px;
    left: 18px;
    z-index: 3;
    color: #94a8c8;
    font-size: .62rem;
    font-weight: 850;
    letter-spacing: .18em;
}
.video-play-button {
    display: grid;
    width: 64px;
    height: 64px;
    padding-left: 4px;
    place-items: center;
    z-index: 3;
    border: 1px solid rgb(255 255 255 / 30%);
    border-radius: 50%;
    background: linear-gradient(145deg, #769cff, #4d6dd1);
    box-shadow: 0 13px 35px rgb(29 63 144 / 45%);
    font-size: 1.45rem;
    transition: transform 160ms ease;
}
.video-card-preview:hover .video-play-button { transform: scale(1.08); }
.video-open-label { position: absolute; z-index: 3; right: 16px; bottom: 24px; color: #bbc8dc; font-size: .72rem; font-weight: 750; text-shadow: 0 1px 5px #000; }
.video-card-body { display: grid; gap: 15px; padding: 16px; }
.video-card-copy { display: grid; min-width: 0; gap: 4px; }
.video-card-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.video-card-copy span { color: var(--muted); font-size: .72rem; }
.video-card-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.video-card-actions form { margin: 0 0 0 auto; }
.button-small { min-height: 36px; padding: 7px 12px; font-size: .78rem; }
.video-empty-state { margin-block: 22px; }

.video-viewer {
    width: 100vw;
    max-width: none;
    height: 100dvh;
    max-height: none;
    margin: 0;
    padding: 0;
    border: 0;
    color: var(--text);
    background: #070b11;
}
.video-viewer::backdrop { background: rgb(0 0 0 / 86%); }
.video-viewer-shell { display: grid; height: 100%; grid-template-rows: auto minmax(0, 1fr) auto; }
.video-viewer-toolbar { position: static; min-height: 64px; }
.video-player-stage {
    display: grid;
    min-height: 0;
    place-items: center;
    padding: clamp(8px, 2vw, 24px);
    background: #020305;
}
.video-player-stage video {
    display: block;
    width: min(100%, 1500px);
    height: 100%;
    max-height: 100%;
    outline: none;
    background: #000;
}
.video-viewer-footer {
    display: flex;
    min-height: 68px;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 12px clamp(14px, 3vw, 28px);
    border-top: 1px solid #1d2530;
    background: #0a0f16;
}
.video-viewer-footer span { color: var(--muted); font-size: .78rem; }

@media (max-width: 700px) {
    .video-upload-card { margin-bottom: 36px; padding: 20px; border-radius: 18px; }
    .video-upload-heading { display: grid; gap: 14px; }
    .video-upload-heading .upload-space-info { width: 100%; }
    .video-dropzone { min-height: 175px; padding: 20px 14px; }
    .video-grid { grid-template-columns: 1fr; gap: 16px; }
    .video-viewer-toolbar > span { max-width: 62vw; }
    .video-viewer-footer { align-items: stretch; flex-direction: column; gap: 9px; }
    .video-viewer-footer .button { width: 100%; }
    .video-player-stage { padding: 0; }
}
