@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@500;600;700;800&display=swap');

:root {
    --bg: #0b1120;
    --bg-deep: #070b14;
    --surface: #111827;
    --surface-soft: rgba(17, 24, 39, .74);
    --surface-raised: #172033;
    --line: rgba(148, 163, 184, .14);
    --line-strong: rgba(148, 163, 184, .25);
    --text: #f8fafc;
    --muted: #94a3b8;
    --purple: #8b5cf6;
    --blue: #3b82f6;
    --cyan: #22d3ee;
    --pink: #ec4899;
    --danger: #fb7185;
    --success: #34d399;
    --radius-sm: 12px;
    --radius: 20px;
    --radius-lg: 30px;
    --shadow: 0 24px 70px rgba(0, 0, 0, .28);
    --sidebar: 252px;
}

* { box-sizing: border-box; }

html { min-height: 100%; color-scheme: dark; background: var(--bg); scroll-behavior: smooth; }

body {
    min-height: 100vh;
    margin: 0;
    color: var(--text);
    background:
        radial-gradient(circle at 80% 0%, rgba(59, 130, 246, .08), transparent 30rem),
        radial-gradient(circle at 30% 100%, rgba(139, 92, 246, .06), transparent 35rem),
        var(--bg);
    font-family: 'DM Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
img { display: block; max-width: 100%; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; margin: -1px; padding: 0; border: 0; clip: rect(0, 0, 0, 0); white-space: nowrap; }

h1, h2, h3, .brand-name, .statistic-value {
    margin: 0;
    font-family: 'Manrope', system-ui, sans-serif;
    letter-spacing: -.035em;
}

p { color: var(--muted); line-height: 1.7; }

.app-shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }

.sidebar {
    position: fixed;
    z-index: 30;
    inset: 0 auto 0 0;
    width: var(--sidebar);
    display: flex;
    flex-direction: column;
    padding: 27px 20px 24px;
    border-right: 1px solid var(--line);
    background: rgba(7, 11, 20, .84);
    backdrop-filter: blur(24px);
}

.brand-lockup { display: flex; align-items: center; gap: 12px; padding: 0 8px 31px; }
.brand-lockup > div { display: grid; }
.brand-mark {
    width: 42px; height: 42px; display: grid; place-items: center; border-radius: 14px;
    color: white; font-size: 18px; background: linear-gradient(135deg, var(--purple), var(--blue) 62%, var(--cyan));
    box-shadow: 0 10px 30px rgba(99, 102, 241, .32);
}
.brand-name { font-size: 18px; font-weight: 800; }
.brand-subtitle { color: var(--muted); font-size: 11px; letter-spacing: .13em; text-transform: uppercase; }

.main-navigation { display: grid; gap: 7px; }
.nav-link {
    position: relative; display: flex; align-items: center; gap: 13px; min-height: 48px; padding: 0 14px;
    border: 1px solid transparent; border-radius: 14px; color: var(--muted); font-weight: 600;
    transition: .2s ease;
}
.nav-link:hover { color: var(--text); background: rgba(148, 163, 184, .07); transform: translateX(2px); }
.nav-link.active {
    color: white; border-color: rgba(139, 92, 246, .22);
    background: linear-gradient(90deg, rgba(139, 92, 246, .18), rgba(59, 130, 246, .08));
}
.nav-link.active::before {
    content: ''; position: absolute; left: -20px; width: 3px; height: 24px; border-radius: 0 4px 4px 0;
    background: linear-gradient(var(--purple), var(--cyan)); box-shadow: 0 0 18px var(--purple);
}
.nav-icon { width: 22px; color: #c4b5fd; font-size: 20px; text-align: center; }
.sidebar-footer { display: grid; gap: 12px; margin-top: auto; }
.new-photo-button {
    display: flex; align-items: center; justify-content: center; gap: 8px; padding: 13px;
    border: 1px solid rgba(139, 92, 246, .32); border-radius: 14px; color: #ddd6fe;
    background: rgba(139, 92, 246, .1); font-weight: 700; transition: .2s ease;
}
.new-photo-button:hover { background: rgba(139, 92, 246, .18); transform: translateY(-1px); }
.logout-button {
    width: 100%; padding: 10px; border: 0; color: var(--muted); background: transparent; cursor: pointer; text-align: left;
}
.logout-button:hover { color: var(--text); }

.main-stage { grid-column: 2; min-width: 0; }
.topbar {
    height: 78px; display: flex; align-items: center; justify-content: space-between; padding: 0 42px;
    border-bottom: 1px solid var(--line); background: rgba(11, 17, 32, .62); backdrop-filter: blur(20px);
}
.topbar > div:first-child { display: grid; gap: 2px; }
.topbar-kicker { color: var(--muted); font-size: 11px; letter-spacing: .15em; text-transform: uppercase; }
.topbar-title { font-weight: 600; }
.topbar-account { display: flex; align-items: center; gap: 11px; }
.topbar-account > div { display: grid; }
.topbar-account span:last-child { color: var(--muted); font-size: 12px; }
.topbar-actions { display: flex; align-items: center; gap: 16px; }
.install-app-button {
    min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 13px;
    border: 1px solid rgba(34, 211, 238, .3); border-radius: 8px; color: #cffafe;
    background: rgba(8, 145, 178, .1); cursor: pointer; font-weight: 700; transition: .2s ease;
}
.install-app-button:hover { border-color: rgba(34, 211, 238, .55); color: white; background: rgba(8, 145, 178, .18); }
.install-app-button:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; }
.install-app-icon { font-size: 20px; line-height: 1; }
.avatar {
    width: 39px; height: 39px; display: grid; place-items: center; border: 1px solid rgba(34, 211, 238, .28);
    border-radius: 50%; color: #cffafe; background: linear-gradient(145deg, rgba(59, 130, 246, .35), rgba(139, 92, 246, .3)); font-weight: 800;
}
.content-stage { width: min(1540px, 100%); margin: 0 auto; padding: 38px 42px 70px; }

.glass-card {
    border: 1px solid var(--line);
    background: linear-gradient(145deg, rgba(23, 32, 51, .82), rgba(17, 24, 39, .72));
    box-shadow: 0 18px 50px rgba(0, 0, 0, .15);
    backdrop-filter: blur(18px);
}
.eyebrow { display: block; margin-bottom: 10px; color: #a5b4fc; font-size: 11px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px;
    border: 1px solid transparent; border-radius: 13px; font-weight: 700; cursor: pointer; transition: .2s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: .55; cursor: wait; transform: none; }
.btn-primary { color: white; background: linear-gradient(135deg, var(--purple), var(--blue)); box-shadow: 0 10px 28px rgba(79, 70, 229, .25); }
.btn-primary:hover { color: white; box-shadow: 0 14px 34px rgba(79, 70, 229, .38); }
.btn-ghost { color: #dbeafe; border-color: var(--line-strong); background: rgba(148, 163, 184, .06); }
.btn-ghost:hover { color: white; border-color: rgba(148, 163, 184, .4); background: rgba(148, 163, 184, .11); }
.btn-danger { color: white; background: linear-gradient(135deg, #e11d48, #f43f5e); }
.btn-danger-ghost { color: #fda4af; border-color: rgba(244, 63, 94, .25); background: rgba(244, 63, 94, .07); }
.btn-danger-ghost:hover { color: #fecdd3; background: rgba(244, 63, 94, .14); }
.btn-sm { min-height: 36px; padding: 7px 12px; border-radius: 10px; font-size: 13px; }
.btn-block { width: 100%; }
.text-link { color: #c4b5fd; font-weight: 700; }
.text-link:hover { color: #e0e7ff; }

.hero-banner {
    position: relative; min-height: 330px; display: flex; align-items: center; overflow: hidden; padding: 54px 58px;
    border: 1px solid rgba(129, 140, 248, .2); border-radius: var(--radius-lg);
    background:
        linear-gradient(110deg, rgba(17, 24, 39, .9), rgba(17, 24, 39, .35)),
        radial-gradient(circle at 90% 40%, rgba(34, 211, 238, .2), transparent 22%),
        linear-gradient(135deg, #15172f, #111827 48%, #0c2035);
    box-shadow: var(--shadow);
}
.hero-banner::after { content: ''; position: absolute; inset: 0; opacity: .12; background-image: radial-gradient(rgba(255,255,255,.7) .7px, transparent .7px); background-size: 27px 27px; }
.hero-content { position: relative; z-index: 2; width: min(680px, 72%); }
.hero-content h1 { font-size: clamp(42px, 5vw, 68px); line-height: 1.03; }
.hero-content p { max-width: 590px; margin: 19px 0 26px; color: #b8c3d5; font-size: 17px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-glow { position: absolute; border-radius: 50%; filter: blur(8px); }
.hero-glow-one { top: -130px; right: 8%; width: 340px; height: 340px; background: rgba(139, 92, 246, .17); }
.hero-glow-two { right: -90px; bottom: -190px; width: 390px; height: 390px; background: rgba(34, 211, 238, .12); }
.hero-orbit {
    position: absolute; z-index: 2; right: 8%; width: 180px; height: 180px; display: grid; place-items: center;
    border: 1px solid rgba(165, 180, 252, .2); border-radius: 50%; color: white; font-size: 43px;
    box-shadow: inset 0 0 60px rgba(139, 92, 246, .08), 0 0 100px rgba(34, 211, 238, .08);
}
.hero-orbit::before, .hero-orbit::after { content: ''; position: absolute; border: 1px solid rgba(34, 211, 238, .14); border-radius: 50%; }
.hero-orbit::before { inset: 25px -25px; transform: rotate(45deg); }
.hero-orbit::after { inset: -20px 30px; transform: rotate(-30deg); }

.statistics-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 17px; margin: 22px 0; }
.statistic-card { display: flex; align-items: flex-start; gap: 15px; min-height: 140px; padding: 24px; border-radius: var(--radius); }
.statistic-card > div:last-child { display: grid; gap: 5px; }
.statistic-icon { width: 42px; height: 42px; flex: 0 0 42px; display: grid; place-items: center; border-radius: 13px; color: #ddd6fe; background: rgba(139, 92, 246, .14); font-size: 20px; }
.statistic-icon.accent-blue { color: #bfdbfe; background: rgba(59, 130, 246, .14); }
.statistic-icon.accent-cyan { color: #a5f3fc; background: rgba(34, 211, 238, .12); }
.statistic-icon.accent-pink { color: #fbcfe8; background: rgba(236, 72, 153, .12); }
.statistic-label, .statistic-hint { color: var(--muted); font-size: 12px; }
.statistic-value { font-size: clamp(19px, 2vw, 26px); font-weight: 800; white-space: nowrap; }

.dashboard-storage { display: grid; grid-template-columns: .8fr 1.2fr; align-items: center; gap: 50px; padding: 28px 32px; border-radius: var(--radius); }
.dashboard-storage h2 { font-size: 22px; }
.storage-progress { display: grid; gap: 9px; }
.storage-progress-header { display: flex; justify-content: space-between; gap: 14px; color: var(--muted); font-size: 12px; }
.progress-track { height: 9px; overflow: hidden; border-radius: 999px; background: rgba(148, 163, 184, .12); }
.progress-value { display: block; height: 100%; min-width: 2px; border-radius: inherit; background: linear-gradient(90deg, var(--purple), var(--blue), var(--cyan)); box-shadow: 0 0 18px rgba(59, 130, 246, .35); }
.storage-remaining { color: #cbd5e1; font-size: 12px; text-align: right; }

.section-block { margin-top: 44px; }
.section-heading, .page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.section-heading h2 { font-size: 28px; }
.page-heading { align-items: center; margin-bottom: 30px; }
.page-heading h1 { font-size: clamp(35px, 4vw, 52px); }
.page-heading p { max-width: 650px; margin: 8px 0 0; }
.page-heading-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.recent-photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

.photo-card { display: inline-block; width: 100%; overflow: hidden; border-radius: var(--radius); transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease; }
.photo-card:hover { border-color: rgba(139, 92, 246, .3); transform: translateY(-4px); box-shadow: 0 24px 60px rgba(0, 0, 0, .25); }
.photo-card-image { position: relative; display: block; overflow: hidden; background: var(--surface-raised); }
.photo-card-preview { width: 100%; display: block; padding: 0; border: 0; color: inherit; background: transparent; cursor: zoom-in; }
.photo-card-image img { width: 100%; min-height: 220px; max-height: 470px; object-fit: cover; transition: transform .6s cubic-bezier(.2,.7,.2,1); }
.photo-card:hover .photo-card-image img { transform: scale(1.035); }
.photo-date { position: absolute; right: 12px; bottom: 12px; padding: 6px 9px; border: 1px solid rgba(255,255,255,.15); border-radius: 9px; color: white; background: rgba(7, 11, 20, .7); backdrop-filter: blur(12px); font-size: 11px; }
.photo-favorite-button {
    position: absolute; z-index: 2; top: 12px; right: 12px; width: 42px; height: 42px; display: grid; place-items: center;
    padding: 0; border: 1px solid rgba(255,255,255,.2); border-radius: 50%; color: white;
    background: rgba(7, 11, 20, .7); backdrop-filter: blur(12px); cursor: pointer; font-size: 23px;
    transition: transform .2s ease, color .2s ease, background .2s ease;
}
.photo-favorite-button:hover, .photo-favorite-button:focus-visible { transform: scale(1.08); background: rgba(30, 41, 59, .92); }
.photo-favorite-button:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; }
.photo-favorite-button.active { color: #fde68a; background: rgba(67, 48, 9, .82); }
.photo-favorite-button:disabled { opacity: .55; cursor: wait; }
.photo-card-body { display: grid; gap: 14px; padding: 19px; }
.photo-card-body h3 { margin-bottom: 7px; font-size: 19px; }
.photo-card-body p { display: -webkit-box; overflow: hidden; margin: 0; color: var(--muted); font-size: 13px; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.photo-analysis { border: 1px solid rgba(139, 92, 246, .24); border-radius: 14px; background: linear-gradient(145deg, rgba(139, 92, 246, .08), rgba(34, 211, 238, .045)); }
.photo-analysis-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.photo-analysis-card { padding: 13px; }
.photo-analysis-card .photo-analysis-heading { justify-content: flex-start; margin-bottom: 9px; color: #c4b5fd; font-size: 12px; }
.photo-analysis-card .photo-analysis-text { max-height: 240px; overflow: auto; padding-right: 4px; color: #aebbd0; font-size: 12px; line-height: 1.65; white-space: pre-line; }
.photo-card-meta { display: flex; justify-content: space-between; color: #7f8da3; font-size: 11px; }
.photo-card-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: -4px; }
.photo-card-tags span { padding: 3px 7px; border-radius: 8px; color: #a5b4fc; background: rgba(99,102,241,.1); font-size: 10px; }
.photo-card-actions { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 3px; border-top: 1px solid var(--line); }
.photo-card-actions .btn:last-child { margin-left: auto; }
.photo-analyze-button { color: #c4b5fd; }
.masonry-gallery { column-count: 3; column-gap: 20px; }
.masonry-gallery .photo-card { margin-bottom: 20px; break-inside: avoid; }
.album-tools {
    display: grid; grid-template-columns: minmax(240px, 1fr) minmax(170px, auto) auto auto;
    align-items: center; gap: 12px; margin-bottom: 24px; padding: 14px; border-radius: 17px;
}
.album-tools-expanded { grid-template-columns: minmax(230px, 1fr) repeat(3, minmax(145px, auto)) auto auto; }
.collection-manager {
    display: grid; grid-template-columns: minmax(220px, .7fr) minmax(260px, 1fr); gap: 20px;
    margin: -8px 0 28px; padding: 24px; border-radius: 18px;
}
.collection-manager h2 { margin-top: 4px; font-size: 25px; }
.collection-manager p { margin: 6px 0 0; font-size: 12px; }
.collection-create { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 9px; }
.collection-list { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; }
.collection-chip { display: inline-flex; align-items: center; overflow: hidden; border: 1px solid var(--line-strong); border-radius: 999px; background: rgba(148,163,184,.06); }
.collection-chip button { padding: 8px 10px; border: 0; color: #dbeafe; background: transparent; cursor: pointer; }
.collection-chip button:last-child { color: #fda4af; }
.collection-chip small { color: #64748b; font-size: 10px; }
.undo-bar {
    position: fixed; z-index: 130; right: 24px; bottom: 24px; display: flex; align-items: center; gap: 12px;
    max-width: calc(100vw - 48px); padding: 13px 16px; border: 1px solid rgba(129,140,248,.35);
    border-radius: 14px; color: #e2e8f0; background: rgba(15,23,42,.97); box-shadow: var(--shadow);
}
.undo-bar button { padding: 3px 5px; border: 0; color: var(--cyan); background: transparent; cursor: pointer; font-weight: 800; }
.undo-bar button:last-child { color: #94a3b8; font-size: 20px; }
.trash-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.trash-card { display: grid; grid-template-columns: minmax(140px, .65fr) 1fr; overflow: hidden; border-radius: var(--radius); }
.trash-card > img { width: 100%; height: 100%; min-height: 230px; object-fit: cover; }
.trash-card > div { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; padding: 23px; }
.trash-card h2 { margin-top: 6px; font-size: 23px; }
.trash-card p { display: -webkit-box; overflow: hidden; font-size: 12px; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.trash-card-actions { display: flex; gap: 8px; margin-top: auto; padding-top: 15px; }
.album-search { position: relative; }
.album-search > span:not(.sr-only) { position: absolute; z-index: 1; top: 50%; left: 15px; color: var(--muted); font-size: 22px; transform: translateY(-54%); pointer-events: none; }
.album-search .form-control { padding-left: 45px; }
.album-tools .form-control { min-height: 46px; }
.album-filter-button {
    min-height: 46px; display: inline-flex; align-items: center; gap: 8px; padding: 0 14px;
    border: 1px solid var(--line-strong); border-radius: 13px; color: #cbd5e1;
    background: rgba(148, 163, 184, .06); cursor: pointer; font-weight: 700;
}
.album-filter-button:hover, .album-filter-button.active { border-color: rgba(250, 204, 21, .42); color: #fde68a; background: rgba(113, 63, 18, .18); }
.album-filter-button:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }
.album-filter-count { min-width: 23px; padding: 2px 6px; border-radius: 10px; color: currentColor; background: rgba(255,255,255,.1); font-size: 11px; text-align: center; }
.album-result-count { color: var(--muted); font-size: 12px; white-space: nowrap; }
.album-no-results { min-height: 270px; }
.album-lightbox { grid-template-rows: minmax(0, 1fr) auto; }
.album-lightbox-nav {
    position: fixed; z-index: 2; top: 50%; width: 52px; height: 52px; display: grid; place-items: center;
    padding: 0; border: 1px solid rgba(255,255,255,.22); border-radius: 50%; color: white;
    background: rgba(15, 23, 42, .82); cursor: pointer; font-size: 38px; line-height: 1; transform: translateY(-50%);
}
.album-lightbox-nav:hover, .album-lightbox-nav:focus-visible { background: rgba(51, 65, 85, .96); }
.album-lightbox-nav:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; }
.album-lightbox-previous { left: 24px; }
.album-lightbox-next { right: 24px; }
.album-lightbox-caption {
    width: min(900px, 100%); display: flex; align-items: center; justify-content: space-between; gap: 20px;
    padding-top: 14px; color: #cbd5e1;
}
.album-lightbox-caption > div { min-width: 0; display: grid; gap: 3px; }
.album-lightbox-caption strong { color: white; font-size: 15px; }
.album-lightbox-caption span { max-width: 650px; overflow: hidden; color: #94a3b8; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }

.empty-state { display: grid; place-items: center; min-height: 310px; padding: 50px; border-radius: var(--radius); text-align: center; }
.empty-state h1, .empty-state h2 { max-width: 620px; font-size: clamp(28px, 4vw, 42px); }
.empty-state p { max-width: 520px; }
.empty-state-mark { width: 66px; height: 66px; display: grid; place-items: center; margin-bottom: 18px; border: 1px solid rgba(139, 92, 246, .25); border-radius: 22px; color: #c4b5fd; background: rgba(139, 92, 246, .1); font-size: 28px; }

.editor-layout { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(310px, .55fr); align-items: start; gap: 24px; }
.editor-main, .upload-panel, .save-panel { border-radius: var(--radius); }
.editor-main { display: grid; gap: 28px; padding: 30px; }
.editor-side { display: grid; gap: 18px; position: sticky; top: 24px; }
.upload-panel, .save-panel { padding: 22px; }
.panel-label { display: flex; justify-content: space-between; margin-bottom: 13px; color: #dbeafe; font-weight: 700; }
.panel-label small { color: var(--muted); font-weight: 500; }
.form-section { display: grid; gap: 9px; }
.form-label-row { display: flex; align-items: center; justify-content: space-between; }
.form-label-row > span, .field-hint { color: var(--muted); font-size: 12px; }
.form-label { color: #dbeafe; font-size: 13px; font-weight: 700; }
.form-control {
    width: 100%; padding: 13px 15px; border: 1px solid var(--line-strong); border-radius: 13px;
    outline: none; color: var(--text); -webkit-text-fill-color: var(--text);
    caret-color: var(--cyan); background: #0a1020; transition: .2s ease;
}
.form-control::placeholder { color: #8492a8; -webkit-text-fill-color: #8492a8; opacity: 1; }
.form-control:focus { border-color: rgba(99, 102, 241, .7); background: rgba(7, 11, 20, .85); box-shadow: 0 0 0 4px rgba(99, 102, 241, .1); }
.form-control:disabled { color: #cbd5e1; -webkit-text-fill-color: #cbd5e1; background: #1a2436; opacity: 1; cursor: not-allowed; }
select.form-control { color-scheme: dark; }
select.form-control option { color: var(--text); background: #111827; }
.form-control:-webkit-autofill,
.form-control:-webkit-autofill:hover,
.form-control:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--text);
    box-shadow: 0 0 0 1000px #0a1020 inset;
    caret-color: var(--cyan);
}
.story-editor { min-height: 300px; resize: vertical; line-height: 1.75; }
.metadata-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; padding-top: 5px; }
.upload-queue { max-height: 290px; overflow: auto; display: grid; gap: 8px; margin-top: 13px; padding-right: 4px; }
.upload-queue .selected-file { margin-top: 0; }
.validation-message { color: #fda4af; font-size: 12px; }
.image-uploader { position: relative; min-height: 240px; overflow: hidden; border: 1px dashed rgba(129, 140, 248, .34); border-radius: 16px; background: rgba(7, 11, 20, .45); }
.image-uploader:hover { border-color: rgba(34, 211, 238, .55); }
.image-uploader-input { position: absolute; z-index: 4; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.image-uploader-input:disabled { cursor: wait; }
.image-uploader-empty, .image-uploader-overlay { position: absolute; z-index: 2; inset: 0; display: grid; place-content: center; justify-items: center; gap: 7px; padding: 22px; text-align: center; pointer-events: none; }
.image-uploader-empty span:last-child, .image-uploader-overlay span:last-child { color: var(--muted); font-size: 12px; }
.upload-symbol { width: 48px; height: 48px; display: grid; place-items: center; margin-bottom: 5px; border-radius: 15px; color: #c4b5fd; background: rgba(139, 92, 246, .14); font-size: 24px; }
.image-uploader-preview { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.image-uploader-overlay { opacity: 0; background: rgba(7, 11, 20, .78); transition: opacity .2s ease; }
.image-uploader:hover .image-uploader-overlay { opacity: 1; }
.selected-file { display: flex; align-items: center; gap: 10px; margin-top: 13px; padding: 10px 12px; border-radius: 11px; color: #a7f3d0; background: rgba(16, 185, 129, .08); }
.selected-file > div { display: grid; min-width: 0; }
.selected-file strong { overflow: hidden; color: #d1fae5; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.selected-file small { color: #6ee7b7; }
.save-panel p { margin: 0 0 16px; font-size: 12px; }
.ai-suggestion-panel { border-color: rgba(139, 92, 246, .25); background: linear-gradient(145deg, rgba(139, 92, 246, .08), rgba(7, 11, 20, .7)); }
.button-spinner { width: 15px; height: 15px; display: inline-block; border: 2px solid rgba(255,255,255,.3); border-top-color: white; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.photo-detail-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.photo-detail-toolbar > div { display: flex; gap: 9px; }
.photo-detail-figure { overflow: hidden; margin: 0; border: 1px solid var(--line); border-radius: var(--radius-lg); background: #05070d; box-shadow: var(--shadow); }
.photo-detail-image-button { position: relative; width: 100%; display: block; padding: 0; border: 0; color: inherit; background: transparent; cursor: zoom-in; }
.photo-detail-image-button img { width: 100%; max-height: 76vh; object-fit: contain; }
.photo-detail-image-button:focus-visible { outline: 3px solid var(--cyan); outline-offset: -3px; }
.photo-enlarge-hint { position: absolute; right: 17px; bottom: 17px; padding: 8px 11px; border: 1px solid rgba(255,255,255,.18); border-radius: 10px; color: white; background: rgba(7, 11, 20, .75); backdrop-filter: blur(12px); font-size: 12px; font-weight: 700; opacity: .78; transition: opacity .2s ease, transform .2s ease; }
.photo-detail-image-button:hover .photo-enlarge-hint, .photo-detail-image-button:focus-visible .photo-enlarge-hint { opacity: 1; transform: translateY(-2px); }
.photo-detail-copy { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 60px; padding: 48px min(6vw, 80px) 10px; }
.photo-detail-copy > header, .photo-story, .photo-analysis-detail { grid-column: 1; }
.photo-detail-copy h1 { font-size: clamp(40px, 6vw, 74px); line-height: 1.05; }
.photo-story { color: #cbd5e1; font-family: Georgia, serif; font-size: 20px; line-height: 1.9; white-space: pre-line; }
.photo-analysis-detail { padding: 22px; }
.photo-analysis-detail h2 { margin-top: 4px; font-size: 22px; }
.photo-analysis-detail .photo-analysis-text { margin-top: 18px; color: #cbd5e1; font-size: 14px; line-height: 1.75; white-space: pre-line; }
.photo-analysis-empty, .photo-analysis-error { margin: 16px 0 0; font-size: 13px; }
.photo-analysis-error { color: #fca5a5; }
.photo-metadata { grid-column: 2; grid-row: 1 / span 3; align-self: start; margin: 0; padding: 23px; border-radius: var(--radius); }
.photo-metadata div, .storage-facts div, .profile-facts div { display: flex; justify-content: space-between; gap: 20px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.photo-metadata div:last-child, .storage-facts div:last-child, .profile-facts div:last-child { border-bottom: 0; }
.photo-metadata dt, .storage-facts span, .profile-facts span { color: var(--muted); font-size: 12px; font-weight: 500; }
.photo-metadata dd { margin: 0; color: #e2e8f0; font-size: 12px; text-align: right; }

.profile-layout { display: grid; grid-template-columns: .75fr 1.25fr; gap: 24px; }
.profile-card, .profile-storage { border-radius: var(--radius); }
.profile-card { display: flex; flex-direction: column; align-items: center; padding: 42px 30px; text-align: center; }
.profile-avatar { width: 104px; height: 104px; display: grid; place-items: center; margin-bottom: 17px; border: 1px solid rgba(34, 211, 238, .25); border-radius: 34px; background: linear-gradient(145deg, rgba(139, 92, 246, .35), rgba(59, 130, 246, .25)); box-shadow: 0 18px 45px rgba(59, 130, 246, .18); font: 800 42px 'Manrope'; }
.profile-role { margin-bottom: 10px; padding: 5px 9px; border-radius: 99px; color: #c4b5fd; background: rgba(139, 92, 246, .12); font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.profile-card h2 { font-size: 30px; }
.profile-card > span:not(.profile-role) { color: var(--muted); }
.profile-facts { width: 100%; margin-top: 28px; text-align: left; }
.profile-storage { padding: 38px; }
.profile-storage h2 { font-size: 32px; }
.profile-storage > p { max-width: 540px; }
.profile-storage-number { margin-top: 30px; font: 800 clamp(46px, 7vw, 74px) 'Manrope'; letter-spacing: -.06em; background: linear-gradient(90deg, white, #a5b4fc, #67e8f9); -webkit-background-clip: text; background-clip: text; color: transparent; }
.profile-storage-caption { display: block; margin: -5px 0 34px; color: var(--muted); }
.storage-facts { margin-top: 28px; }

.user-management-layout { display: grid; grid-template-columns: minmax(320px, .8fr) minmax(420px, 1.2fr); gap: 24px; align-items: start; }
.user-create-card, .user-list-card { padding: 32px; border-radius: var(--radius); }
.user-create-card h2, .user-list-card h2 { font-size: 28px; }
.admin-user-form { display: grid; gap: 18px; margin-top: 24px; }
.form-status { margin-top: 20px; padding: 12px 14px; border: 1px solid; border-radius: 12px; font-size: 13px; line-height: 1.5; }
.form-status-success { border-color: rgba(52, 211, 153, .28); color: #d1fae5; background: rgba(16, 185, 129, .09); }
.form-status-error { border-color: rgba(251, 113, 133, .28); color: #ffe4e6; background: rgba(244, 63, 94, .08); }
.user-list-card .section-heading { margin-bottom: 16px; }
.user-list-loading { min-height: 220px; }
.user-list { display: grid; }
.user-list-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 14px; padding: 17px 0; border-bottom: 1px solid var(--line); }
.user-list-row:last-child { border-bottom: 0; }
.user-list-identity { min-width: 0; display: grid; gap: 3px; }
.user-list-identity strong, .user-list-identity span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-list-identity span { color: var(--muted); font-size: 12px; }
.user-role-list { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.role-badge { padding: 5px 9px; border: 1px solid rgba(139, 92, 246, .22); border-radius: 999px; color: #ddd6fe; background: rgba(139, 92, 246, .1); font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.user-edit-panel { margin: 20px 0 10px; padding: 22px; border: 1px solid rgba(129, 140, 248, .3); border-radius: 16px; background: rgba(7, 11, 20, .48); }
.user-edit-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.user-edit-heading h3 { font-size: 22px; }
.icon-button { width: 38px; height: 38px; display: grid; place-items: center; padding: 0; border: 1px solid var(--line-strong); border-radius: 50%; color: var(--text); background: rgba(148, 163, 184, .08); cursor: pointer; font-size: 22px; line-height: 1; }
.icon-button:hover { border-color: rgba(148, 163, 184, .45); background: rgba(148, 163, 184, .14); }
.icon-button:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; }
.user-edit-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.user-edit-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 10px; padding-top: 2px; }

.dialog-backdrop { position: fixed; z-index: 100; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(2, 6, 15, .78); backdrop-filter: blur(10px); }
.delete-dialog { width: min(470px, 100%); padding: 35px; border-radius: 24px; text-align: center; animation: dialog-in .2s ease; }
@keyframes dialog-in { from { opacity: 0; transform: translateY(12px) scale(.98); } }
.pwa-dialog-backdrop {
    position: fixed; z-index: 160; inset: 0; display: grid; place-items: center; padding: 20px;
    background: rgba(2, 6, 15, .82); backdrop-filter: blur(12px);
}
.pwa-install-dialog {
    position: relative; width: min(460px, 100%); padding: 34px; border: 1px solid var(--line-strong);
    border-radius: 8px; color: var(--text); background: #111827; box-shadow: var(--shadow);
    animation: dialog-in .2s ease;
}
.pwa-install-dialog h2 { max-width: 340px; font-size: 29px; line-height: 1.2; }
.pwa-dialog-close {
    position: absolute; top: 16px; right: 16px; width: 38px; height: 38px; display: grid; place-items: center;
    padding: 0; border: 1px solid var(--line-strong); border-radius: 50%; color: var(--text);
    background: rgba(148, 163, 184, .08); cursor: pointer; font-size: 22px;
}
.pwa-dialog-close:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; }
.pwa-install-steps { display: grid; gap: 14px; margin: 25px 0 0; padding-left: 22px; color: #cbd5e1; line-height: 1.5; }
.dialog-icon { width: 52px; height: 52px; display: grid; place-items: center; margin: 0 auto 18px; border-radius: 17px; color: #fecdd3; background: rgba(244, 63, 94, .14); font-size: 24px; font-weight: 800; }
.delete-dialog h2 { font-size: 26px; }
.dialog-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; margin-top: 25px; }

.image-lightbox-backdrop { position: fixed; z-index: 110; inset: 0; display: grid; place-items: center; padding: 24px; background: rgba(2, 6, 15, .94); backdrop-filter: blur(14px); animation: lightbox-in .2s ease; }
.image-lightbox { position: relative; width: 100%; height: 100%; display: grid; grid-template-rows: minmax(0, 1fr) auto; place-items: center; }
.image-lightbox img { width: auto; max-width: 100%; height: auto; max-height: calc(100vh - 100px); object-fit: contain; border-radius: 10px; box-shadow: 0 25px 90px rgba(0, 0, 0, .55); }
.image-lightbox-close { position: fixed; z-index: 1; top: 22px; right: 22px; width: 46px; height: 46px; display: grid; place-items: center; padding: 0; border: 1px solid rgba(255,255,255,.22); border-radius: 50%; color: white; background: rgba(15, 23, 42, .82); cursor: pointer; font-size: 29px; line-height: 1; transition: background .2s ease, transform .2s ease; }
.image-lightbox-close:hover, .image-lightbox-close:focus-visible { background: rgba(51, 65, 85, .95); transform: scale(1.05); }
.image-lightbox-close:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; }
.image-lightbox-caption { padding-top: 14px; color: #cbd5e1; font-size: 13px; }
@keyframes lightbox-in { from { opacity: 0; } }

.toast-notification { position: fixed; z-index: 120; right: 25px; bottom: 25px; display: flex; align-items: center; gap: 11px; max-width: min(420px, calc(100vw - 30px)); padding: 13px 15px; border: 1px solid rgba(52, 211, 153, .25); border-radius: 14px; color: #d1fae5; background: rgba(6, 30, 28, .95); box-shadow: var(--shadow); animation: toast-in .25s ease; }
.toast-error { border-color: rgba(251, 113, 133, .3); color: #ffe4e6; background: rgba(47, 12, 22, .96); }
.toast-mark { width: 26px; height: 26px; display: grid; place-items: center; flex: 0 0 26px; border-radius: 50%; color: #052e2b; background: var(--success); font-weight: 900; }
.toast-error .toast-mark { color: #4c0519; background: var(--danger); }
.toast-notification button { margin-left: auto; border: 0; color: currentColor; background: none; cursor: pointer; font-size: 20px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(15px); } }

.loading-spinner { display: inline-flex; align-items: center; gap: 12px; color: var(--muted); }
.spinner-ring { width: 28px; height: 28px; border: 3px solid rgba(148, 163, 184, .15); border-top-color: var(--purple); border-right-color: var(--cyan); border-radius: 50%; animation: spin .8s linear infinite; }
.route-loading { min-height: 48vh; display: grid; place-items: center; }

.slideshow-state {
    min-height: 100dvh; display: grid; place-content: center; justify-items: center; padding: 30px;
    color: var(--text); background: #02040a; text-align: center;
}
.slideshow-state h1 { max-width: 700px; font-size: clamp(34px, 6vw, 68px); }
.slideshow-state p { max-width: 520px; margin: 15px 0 25px; }
.slideshow-empty-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.slideshow-local-message { margin-top: -10px !important; color: #cbd5e1; font-size: 13px; }
.slideshow-page {
    position: fixed; z-index: 150; inset: 0; width: 100vw; height: 100dvh; overflow: hidden;
    color: white; background: #02040a; outline: none;
}
.slideshow-frame, .slideshow-shade { position: absolute; inset: 0; }
.slideshow-frame {
    overflow: hidden; contain: strict; background: #02040a;
    transform: translateZ(0); animation: slideshow-reveal .9s ease-out both;
}
.slideshow-photo {
    position: absolute; top: -8%; left: 0; width: 100%; height: 116%; max-width: none; object-fit: cover;
    object-position: center; transform-origin: center; backface-visibility: hidden;
    will-change: transform;
    animation: slideshow-vertical-pan-zoom var(--slide-duration, 60s) linear both;
}
.slideshow-photo-portrait { top: -10%; height: 120%; animation-name: slideshow-vertical-pan-zoom-portrait; }
.slideshow-fit-contain, .slideshow-fit-smart.slideshow-photo-portrait {
    top: 0; height: 100%; object-fit: contain; animation-name: slideshow-contained-zoom;
}
.slideshow-shade {
    background:
        linear-gradient(180deg, rgba(2, 4, 10, .55), transparent 24%, transparent 58%, rgba(2, 4, 10, .82)),
        linear-gradient(90deg, rgba(2, 4, 10, .25), transparent 35%, transparent 65%, rgba(2, 4, 10, .15));
    pointer-events: none;
}
.slideshow-preload {
    position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover;
    opacity: 0; pointer-events: none;
}
.slideshow-toolbar {
    position: absolute; z-index: 2; top: 0; right: 0; left: 0; display: grid;
    grid-template-columns: 48px 1fr 48px 48px 48px; align-items: center; gap: 10px;
    padding: max(22px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) 20px max(24px, env(safe-area-inset-left));
}
.slideshow-position { min-width: 0; display: grid; justify-items: center; gap: 2px; }
.slideshow-source-label { max-width: min(380px, 45vw); overflow: hidden; color: white; font-size: 13px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.slideshow-counter { justify-self: center; color: rgba(255, 255, 255, .82); font-size: 12px; font-weight: 700; }
.slideshow-icon-button {
    width: 46px; height: 46px; display: grid; place-items: center; padding: 0;
    border: 1px solid rgba(255, 255, 255, .24); border-radius: 50%; color: white;
    background: rgba(2, 6, 15, .46); box-shadow: 0 8px 28px rgba(0, 0, 0, .18);
    backdrop-filter: blur(14px); cursor: pointer; font-size: 23px; line-height: 1;
    transition: background .2s ease, border-color .2s ease, transform .2s ease;
}
.slideshow-icon-button:hover { border-color: rgba(255, 255, 255, .52); background: rgba(15, 23, 42, .78); transform: scale(1.05); }
.slideshow-icon-button:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; }
.slideshow-icon-button:disabled { opacity: .35; cursor: default; transform: none; }
.slideshow-toolbar .slideshow-icon-button:last-child { font-size: 20px; }
.slideshow-source-menu, .slideshow-settings-menu {
    position: absolute; z-index: 4; top: max(84px, calc(env(safe-area-inset-top) + 64px)); right: max(24px, env(safe-area-inset-right));
    width: min(390px, calc(100vw - 32px)); display: grid; gap: 9px; padding: 22px;
    border: 1px solid rgba(255, 255, 255, .2); border-radius: 18px; color: white;
    background: rgba(9, 14, 27, .94); box-shadow: 0 24px 70px rgba(0, 0, 0, .42); backdrop-filter: blur(20px);
}
.slideshow-source-menu { max-height: calc(100dvh - 110px); overflow-y: auto; }
.slideshow-settings-menu { gap: 17px; }
.slideshow-settings-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.slideshow-settings-heading h2 { margin-top: 4px; font-size: 21px; }
.slideshow-settings-heading button {
    width: 34px; height: 34px; display: grid; place-items: center; padding: 0;
    border: 1px solid rgba(255,255,255,.16); border-radius: 50%; color: white;
    background: rgba(148,163,184,.08); cursor: pointer; font-size: 22px;
}
.slideshow-setting-field { display: grid; grid-template-columns: 1fr minmax(140px, auto); align-items: center; gap: 15px; color: #cbd5e1; font-size: 13px; }
.slideshow-setting-field select {
    min-height: 40px; padding: 7px 10px; border: 1px solid rgba(255,255,255,.18); border-radius: 10px;
    outline: none; color: white; color-scheme: dark; background: #111827;
}
.slideshow-toggle-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.slideshow-toggle-grid label {
    display: flex; align-items: center; gap: 8px; padding: 10px;
    border: 1px solid rgba(255,255,255,.1); border-radius: 10px; color: #cbd5e1;
    background: rgba(148,163,184,.05); cursor: pointer; font-size: 12px;
}
.slideshow-toggle-grid input { width: 16px; height: 16px; accent-color: var(--cyan); }
.slideshow-settings-note { margin: -3px 0 0; color: #64748b; font-size: 10px; }
.slideshow-source-option {
    width: 100%; display: grid; gap: 3px; padding: 13px 14px; border: 1px solid rgba(255, 255, 255, .13);
    border-radius: 12px; color: #e2e8f0; background: rgba(148, 163, 184, .06); cursor: pointer; text-align: left;
}
.slideshow-source-option:hover, .slideshow-source-option.active { border-color: rgba(34, 211, 238, .42); background: rgba(8, 145, 178, .13); }
.slideshow-source-option:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }
.slideshow-source-option:disabled { opacity: .4; cursor: default; }
.slideshow-source-option span { font-weight: 700; }
.slideshow-source-option small { color: #94a3b8; font-size: 11px; }
.slideshow-folder-picker { border-style: dashed; }
.slideshow-forget-folder { justify-self: start; padding: 7px 2px; border: 0; color: #fda4af; background: transparent; cursor: pointer; font-size: 12px; font-weight: 700; }
.slideshow-source-message { margin: 2px 0 0; color: #cbd5e1; font-size: 11px; line-height: 1.5; }
.slideshow-caption {
    position: absolute; z-index: 2; right: max(34px, env(safe-area-inset-right)); bottom: 120px;
    width: min(560px, calc(100vw - 68px)); padding: 18px 20px; border: 1px solid rgba(255,255,255,.13);
    border-radius: 15px; background: rgba(2, 6, 15, .42); backdrop-filter: blur(14px); text-align: right;
}
.slideshow-toolbar, .slideshow-footer, .slideshow-caption {
    transition: opacity .35s ease, transform .35s ease;
}
.slideshow-controls-hidden .slideshow-toolbar { opacity: 0; transform: translateY(-16px); pointer-events: none; }
.slideshow-controls-hidden .slideshow-footer { opacity: 0; transform: translateY(16px); pointer-events: none; }
.slideshow-controls-hidden .slideshow-caption { opacity: 0; pointer-events: none; }
.slideshow-caption h1 { font-size: clamp(24px, 3vw, 42px); line-height: 1.05; }
.slideshow-caption p {
    display: -webkit-box; overflow: hidden; margin: 8px 0 0; color: rgba(255,255,255,.78);
    font-size: 13px; line-height: 1.55; -webkit-box-orient: vertical; -webkit-line-clamp: 3;
}
.slideshow-footer {
    position: absolute; z-index: 2; right: 0; bottom: 0; left: 0; display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: end; gap: 24px;
    padding: 30px max(34px, env(safe-area-inset-right)) max(30px, env(safe-area-inset-bottom)) max(34px, env(safe-area-inset-left));
}
.slideshow-ambient { min-width: 0; display: flex; align-items: flex-end; gap: 22px; }
.slideshow-clock {
    color: white; font-family: 'Manrope', system-ui, sans-serif; font-size: clamp(38px, 5vw, 72px);
    font-weight: 700; font-variant-numeric: tabular-nums; line-height: .9;
}
.slideshow-weather { display: grid; gap: 3px; }
.slideshow-temperature {
    color: rgba(255, 255, 255, .9); font-family: 'Manrope', system-ui, sans-serif;
    font-size: clamp(22px, 2.5vw, 34px); font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1;
}
.slideshow-weather-credit { color: rgba(255, 255, 255, .55); font-size: 9px; }
.slideshow-hidden { display: none; }
.slideshow-controls { display: flex; align-items: center; gap: 10px; }
.slideshow-control-button { width: 42px; height: 42px; font-size: 21px; }
.slideshow-play-button { width: 56px; height: 56px; font-size: 18px; }
.slideshow-mode-button { width: 38px; height: 38px; color: rgba(255,255,255,.7); font-size: 18px; }
.slideshow-mode-button.active { border-color: rgba(34, 211, 238, .65); color: white; background: rgba(8, 145, 178, .4); }
.slideshow-progress {
    position: absolute; right: 0; bottom: 0; left: 0; height: 3px;
    overflow: hidden; background: rgba(255, 255, 255, .14);
}
.slideshow-progress span {
    display: block; width: 100%; height: 100%; transform-origin: left;
    background: linear-gradient(90deg, var(--cyan), white);
    animation: slideshow-progress var(--slide-duration, 60s) linear both;
}
.slideshow-paused .slideshow-photo, .slideshow-paused .slideshow-progress span { animation-play-state: paused; }
@keyframes slideshow-reveal { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideshow-dissolve { from { opacity: 0; filter: blur(12px); } to { opacity: 1; filter: blur(0); } }
@keyframes slideshow-slide { from { opacity: 0; transform: translate3d(5%, 0, 0); } to { opacity: 1; transform: translate3d(0, 0, 0); } }
@keyframes slideshow-zoom { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: scale(1); } }
.slideshow-transition-dissolve .slideshow-frame { animation-name: slideshow-dissolve; animation-duration: 1.1s; }
.slideshow-transition-slide .slideshow-frame { animation-name: slideshow-slide; animation-duration: .7s; }
.slideshow-transition-zoom .slideshow-frame { animation-name: slideshow-zoom; animation-duration: .9s; }
@keyframes slideshow-progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes slideshow-vertical-pan-zoom {
    from { transform: translate3d(0, -3.5%, 0) scale(1.03); }
    to { transform: translate3d(0, 3.5%, 0) scale(1.13); }
}
@keyframes slideshow-vertical-pan-zoom-portrait {
    from { transform: translate3d(0, -4%, 0) scale(1.02); }
    to { transform: translate3d(0, 4%, 0) scale(1.11); }
}
@keyframes slideshow-contained-zoom {
    from { transform: scale(.98); }
    to { transform: scale(1.04); }
}

.auth-shell { min-height: 100vh; display: grid; grid-template-columns: 1.1fr .9fr; background: var(--bg-deep); }
.auth-visual { position: relative; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; padding: 48px; background: radial-gradient(circle at 75% 32%, rgba(34, 211, 238, .17), transparent 22%), radial-gradient(circle at 30% 75%, rgba(139, 92, 246, .2), transparent 30%), linear-gradient(145deg, #111a31, #08101e); }
.auth-visual::before { content: ''; position: absolute; inset: 0; opacity: .25; background-image: radial-gradient(white .65px, transparent .65px); background-size: 31px 31px; }
.auth-nebula { position: absolute; width: 420px; height: 420px; top: 22%; right: 7%; border: 1px solid rgba(165, 180, 252, .14); border-radius: 50%; box-shadow: inset 0 0 90px rgba(139, 92, 246, .12), 0 0 130px rgba(34, 211, 238, .08); }
.auth-nebula::before, .auth-nebula::after { content: ''; position: absolute; border: 1px solid rgba(34, 211, 238, .12); border-radius: 50%; }
.auth-nebula::before { inset: 50px -80px; transform: rotate(35deg); }
.auth-nebula::after { inset: -50px 80px; transform: rotate(-25deg); }
.auth-brand, .auth-quote, .auth-caption { position: relative; z-index: 2; }
.auth-brand { display: inline-flex; align-items: center; gap: 11px; font: 800 21px 'Manrope'; }
.auth-brand span, .auth-mobile-mark { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 13px; background: linear-gradient(135deg, var(--purple), var(--blue)); }
.auth-quote { max-width: 650px; }
.auth-quote h1 { margin-bottom: 24px; font-size: clamp(58px, 7vw, 105px); line-height: .95; }
.auth-quote p { max-width: 520px; margin: 0; color: #bcc8da; font-size: 18px; }
.auth-caption { color: var(--muted); font-size: 12px; }
.auth-form-panel { display: grid; place-items: center; padding: 42px; background: var(--bg); }
.auth-form-wrap { width: min(430px, 100%); }
.auth-form-wrap h2 { font-size: 38px; }
.auth-form-wrap > p { margin-bottom: 28px; }
.auth-mobile-mark { display: none; margin-bottom: 28px; }
.auth-form { display: grid; gap: 18px; }
.remember-me { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 13px; cursor: pointer; }
.remember-me input { width: 16px; height: 16px; accent-color: var(--purple); }
.auth-submit { justify-content: space-between; min-height: 50px; margin-top: 3px; }
.auth-error { display: flex; align-items: center; gap: 9px; margin-bottom: 20px; padding: 12px; border: 1px solid rgba(251, 113, 133, .26); border-radius: 12px; color: #fecdd3; background: rgba(244, 63, 94, .08); font-size: 13px; }
.auth-error span { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: rgba(244, 63, 94, .18); font-weight: 800; }

#blazor-error-ui { position: fixed; z-index: 200; right: 20px; bottom: 20px; display: none; padding: 13px 16px; border: 1px solid rgba(251,113,133,.3); border-radius: 12px; color: #ffe4e6; background: #3f101c; box-shadow: var(--shadow); }
#blazor-error-ui .reload { margin-left: 8px; text-decoration: underline; }
#blazor-error-ui .dismiss { margin-left: 12px; border: 0; color: inherit; background: none; }

@media (max-width: 1180px) {
    .statistics-grid { grid-template-columns: repeat(2, 1fr); }
    .recent-photo-grid { grid-template-columns: repeat(2, 1fr); }
    .masonry-gallery { column-count: 2; }
    .hero-orbit { opacity: .5; right: 4%; }
    .photo-detail-copy { gap: 34px; padding-inline: 25px; }
    .album-tools-expanded { grid-template-columns: minmax(220px, 1fr) repeat(2, minmax(145px, auto)); }
    .album-tools-expanded .album-filter-button, .album-tools-expanded .album-result-count { justify-self: stretch; }
}

@media (max-width: 900px) {
    :root { --sidebar: 0px; }
    .app-shell { display: block; padding-bottom: 72px; }
    .sidebar { inset: auto 0 0; width: 100%; height: 68px; padding: 7px 12px calc(7px + env(safe-area-inset-bottom)); border: 0; border-top: 1px solid var(--line); }
    .brand-lockup, .sidebar-footer { display: none; }
    .main-navigation { display: grid; grid-template-columns: repeat(auto-fit, minmax(54px, 1fr)); gap: 4px; }
    .nav-link { min-height: 53px; display: grid; place-items: center; align-content: center; gap: 1px; padding: 3px; border-radius: 11px; font-size: 10px; }
    .nav-link.active::before { display: none; }
    .nav-icon { font-size: 18px; }
    .topbar { height: 68px; padding: 0 22px; }
    .topbar > div:first-child { display: none; }
    .topbar-actions { margin-left: auto; }
    .content-stage { padding: 26px 22px 50px; }
    .editor-layout { grid-template-columns: 1fr; }
    .editor-side { position: static; }
    .photo-detail-copy { grid-template-columns: 1fr; padding: 35px 8px; }
    .album-tools { grid-template-columns: minmax(0, 1fr) minmax(165px, auto); }
    .album-tools-expanded { grid-template-columns: 1fr 1fr; }
    .collection-manager { grid-template-columns: 1fr; }
    .collection-list { grid-column: 1; }
    .trash-grid { grid-template-columns: 1fr; }
    .metadata-fields { grid-template-columns: 1fr; }
    .album-filter-button { justify-content: center; }
    .album-result-count { justify-self: end; }
    .photo-metadata { grid-column: 1; grid-row: auto; }
    .profile-layout { grid-template-columns: 1fr; }
    .user-management-layout { grid-template-columns: 1fr; }
    .auth-shell { grid-template-columns: 1fr; }
    .auth-visual { display: none; }
    .auth-form-panel { min-height: 100vh; }
    .auth-mobile-mark { display: grid; }
}

@media (max-width: 640px) {
    .content-stage { padding: 20px 15px 42px; }
    .hero-banner { min-height: 390px; padding: 34px 25px; }
    .hero-content { width: 100%; }
    .hero-content h1 { font-size: 42px; }
    .hero-content p { font-size: 15px; }
    .hero-orbit { right: -90px; bottom: -80px; opacity: .25; }
    .statistics-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .statistic-card { min-height: 155px; flex-direction: column; padding: 17px; }
    .statistic-value { font-size: 19px; white-space: normal; }
    .dashboard-storage { grid-template-columns: 1fr; gap: 22px; padding: 24px; }
    .recent-photo-grid { grid-template-columns: 1fr; }
    .masonry-gallery { column-count: 1; }
    .album-tools { grid-template-columns: 1fr; }
    .album-tools-expanded { grid-template-columns: 1fr; }
    .album-result-count { justify-self: start; padding-inline: 3px; }
    .album-lightbox-caption { align-items: stretch; flex-direction: column; }
    .album-lightbox-caption .btn { justify-content: center; }
    .album-lightbox-nav { top: auto; bottom: 105px; width: 44px; height: 44px; transform: none; }
    .collection-manager { padding: 20px; }
    .collection-create { grid-template-columns: 1fr; }
    .trash-card { grid-template-columns: 1fr; }
    .trash-card > img { min-height: 210px; max-height: 300px; }
    .undo-bar { right: 15px; bottom: 84px; left: 15px; }
    .album-lightbox-previous { left: 14px; }
    .album-lightbox-next { right: 14px; }
    .page-heading { align-items: flex-start; flex-direction: column; }
    .page-heading-actions { width: 100%; flex-direction: column; }
    .page-heading-actions .btn { width: 100%; }
    .section-heading { align-items: flex-start; flex-direction: column; }
    .editor-main { padding: 22px; }
    .photo-detail-toolbar { align-items: flex-start; flex-direction: column; gap: 15px; }
    .photo-detail-toolbar > div { width: 100%; }
    .photo-detail-toolbar .btn { flex: 1; }
    .photo-detail-copy h1 { font-size: 40px; }
    .photo-story { font-size: 18px; }
    .photo-enlarge-hint { right: 10px; bottom: 10px; }
    .image-lightbox-backdrop { padding: 12px; }
    .image-lightbox-close { top: 14px; right: 14px; }
    .image-lightbox img { max-height: calc(100vh - 86px); }
    .profile-storage { padding: 26px; }
    .user-create-card, .user-list-card { padding: 24px; }
    .user-list-row { grid-template-columns: auto minmax(0, 1fr) auto; }
    .user-role-list { grid-column: 2; justify-content: flex-start; }
    .user-edit-button { grid-column: 3; grid-row: 1 / span 2; }
    .user-edit-form { grid-template-columns: 1fr; }
    .user-edit-actions { grid-column: 1; }
    .dialog-actions { grid-template-columns: 1fr; }
    .toast-notification { right: 15px; bottom: 84px; left: 15px; }
    .auth-form-panel { padding: 25px; }
    .auth-form-wrap h2 { font-size: 32px; }
    .topbar-actions { gap: 10px; }
    .topbar-account > div { display: none; }
    .install-app-button { width: 40px; padding: 0; }
    .install-app-label { display: none; }
    .pwa-install-dialog { padding: 30px 24px; }
    .slideshow-toolbar { grid-template-columns: 44px 1fr 44px 44px 44px; gap: 5px; padding-inline: 12px; }
    .slideshow-icon-button { width: 42px; height: 42px; }
    .slideshow-source-label { max-width: 34vw; font-size: 11px; }
    .slideshow-source-menu { top: max(76px, calc(env(safe-area-inset-top) + 58px)); right: 16px; }
    .slideshow-settings-menu { top: max(76px, calc(env(safe-area-inset-top) + 58px)); right: 16px; }
    .slideshow-caption { right: 16px; bottom: 150px; width: calc(100vw - 32px); padding: 14px 16px; text-align: left; }
    .slideshow-footer { grid-template-columns: 1fr; justify-items: center; gap: 19px; padding: 24px 18px max(24px, env(safe-area-inset-bottom)); }
    .slideshow-ambient { width: 100%; justify-content: center; }
    .slideshow-clock { font-size: 48px; }
    .slideshow-controls { grid-row: 1; }
    .slideshow-controls { gap: 7px; }
    .slideshow-mode-button { width: 35px; height: 35px; }
}

@media (prefers-reduced-motion: reduce) {
    .slideshow-frame { animation-duration: .01ms; }
    .slideshow-photo { animation: none; transform: scale(1.04); }
}

@media (display-mode: standalone) {
    .install-app-button { display: none; }
}
