* {
    box-sizing: border-box;
}

:root {
    color-scheme: dark;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #07080d;
    color: #f7f4ed;
}

html,
body {
    min-height: 100%;
    margin: 0;
}

body {
    min-width: 320px;
    overflow-x: hidden;
    background:
        linear-gradient(100deg, rgba(36, 209, 196, 0.12), transparent 35%),
        linear-gradient(260deg, rgba(244, 107, 130, 0.11), transparent 38%),
        linear-gradient(145deg, #07080d 0%, #10131c 47%, #050607 100%);
}

button,
textarea,
input {
    font: inherit;
}

button {
    cursor: pointer;
}

button:focus-visible,
select:focus-visible,
input:focus-visible,
textarea:focus-visible,
.upload-dropzone:focus-within {
    outline: 2px solid #65f7dc;
    outline-offset: 4px;
}

.photo-shell {
    min-height: 100vh;
    padding: clamp(1rem, 2.6vw, 2.5rem);
}

.viewer-stage {
    width: min(1480px, 100%);
    min-height: calc(100vh - clamp(2rem, 5.2vw, 5rem));
    margin: 0 auto;
    padding: clamp(1rem, 2vw, 1.75rem);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    background: rgba(12, 15, 22, 0.78);
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.46);
    backdrop-filter: blur(22px);
}

.splash-stage {
    display: grid;
    min-height: calc(100vh - clamp(2rem, 5.2vw, 5rem));
    place-items: center;
}

.splash-panel {
    display: grid;
    gap: 1.4rem;
    width: min(34rem, 100%);
    padding: clamp(1.2rem, 4vw, 2rem);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    background: rgba(12, 15, 22, 0.82);
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.46);
    backdrop-filter: blur(22px);
}

.splash-panel h1 {
    max-width: none;
}

.login-form {
    display: grid;
    gap: 0.9rem;
}

.login-question {
    display: grid;
    gap: 0.45rem;
}

.login-question span {
    color: rgba(247, 244, 237, 0.76);
    font-size: 0.92rem;
    font-weight: 800;
}

.login-question input {
    width: 100%;
    min-height: 3rem;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 8px;
    padding: 0 0.9rem;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.07);
    font-weight: 800;
}

.login-question input:disabled,
.ghost-button:disabled {
    cursor: not-allowed;
    opacity: 0.52;
}

.login-message {
    margin-bottom: 0;
    color: #f9d36b;
    font-size: 0.9rem;
    font-weight: 800;
    line-height: 1.4;
}

.login-message.is-locked {
    color: #ffd2da;
}

.topbar {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.5rem 0.25rem 1.25rem;
}

.kicker {
    margin: 0 0 0.35rem;
    color: #65f7dc;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

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

h1 {
    max-width: 12ch;
    margin-bottom: 0;
    color: #ffffff;
    font-size: clamp(2.15rem, 6vw, 5.7rem);
    line-height: 0.94;
    letter-spacing: 0;
}

.image-count {
    flex: 0 0 auto;
    min-width: 7rem;
    padding: 0.7rem 0.95rem;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 8px;
    color: #f9d36b;
    background: rgba(255, 255, 255, 0.06);
    text-align: center;
    font-size: 0.9rem;
    font-weight: 800;
}

.upload-panel,
.focus-panel,
.gallery-strip {
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.055);
}

.upload-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 0.7rem;
}

.upload-dropzone {
    display: grid;
    grid-template-columns: 2.5rem 1fr;
    align-items: center;
    gap: 0.75rem;
    width: min(24rem, 100%);
    min-height: 3.6rem;
    padding: 0.55rem 0.75rem;
    border: 1px dashed rgba(101, 247, 220, 0.54);
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(101, 247, 220, 0.14), rgba(244, 107, 130, 0.12));
}

.upload-icon {
    display: grid;
    width: 2.5rem;
    height: 2.5rem;
    place-items: center;
    border-radius: 50%;
    color: #06110f;
    background: #65f7dc;
    font-size: 1.65rem;
    font-weight: 700;
}

.upload-dropzone strong,
.upload-dropzone small {
    display: block;
}

.upload-dropzone strong {
    color: #ffffff;
    font-size: 1rem;
}

.upload-dropzone small {
    margin-top: 0.1rem;
    color: rgba(247, 244, 237, 0.68);
    line-height: 1.35;
}

.file-input {
    width: 1px;
    height: 1px;
    opacity: 0;
    position: absolute;
    pointer-events: none;
}

.status-message {
    margin-bottom: 0;
    color: #9df7a6;
    font-size: 0.9rem;
    font-weight: 700;
}

.focus-panel {
    display: grid;
    min-height: clamp(31rem, 70vh, 54rem);
    overflow: hidden;
}

.empty-viewer {
    display: grid;
    place-items: center;
    align-content: center;
    gap: 1rem;
    min-height: 100%;
    color: rgba(247, 244, 237, 0.66);
    text-align: center;
}

.empty-mark {
    width: min(17rem, 55vw);
    aspect-ratio: 1.5;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 8px;
    background:
        linear-gradient(135deg, transparent 0 58%, rgba(249, 211, 107, 0.28) 58% 59%, transparent 59%),
        linear-gradient(45deg, rgba(101, 247, 220, 0.18), rgba(244, 107, 130, 0.18));
}

.focus-photo {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    min-height: 100%;
    margin: 0;
}

.focus-image-frame {
    position: relative;
    display: grid;
    min-height: 0;
}

.focus-photo img {
    width: 100%;
    height: 100%;
    max-height: 78vh;
    object-fit: contain;
    padding: clamp(0.75rem, 2vw, 1.5rem);
}

.image-nav-button {
    position: absolute;
    top: 50%;
    display: grid;
    width: clamp(2.6rem, 5vw, 3.4rem);
    height: clamp(2.6rem, 5vw, 3.4rem);
    place-items: center;
    transform: translateY(-50%);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 50%;
    color: #ffffff;
    background: rgba(5, 6, 8, 0.66);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.36);
    font-size: clamp(2rem, 4vw, 2.6rem);
    font-weight: 300;
    line-height: 1;
    backdrop-filter: blur(12px);
}

.image-nav-button:hover {
    border-color: rgba(101, 247, 220, 0.62);
    background: rgba(5, 6, 8, 0.84);
}

.image-nav-prev {
    left: clamp(0.7rem, 2vw, 1.4rem);
}

.image-nav-next {
    right: clamp(0.7rem, 2vw, 1.4rem);
}

.focus-photo figcaption {
    display: grid;
    gap: 0.35rem;
    margin: 0;
    padding: 1rem clamp(1rem, 2vw, 1.5rem) 1.2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #f7f4ed;
    background: rgba(0, 0, 0, 0.22);
    line-height: 1.45;
}

.focus-photo figcaption time {
    color: #f9d36b;
    font-size: 0.82rem;
    font-weight: 800;
}

.gallery-strip {
    margin-top: 1rem;
    padding: clamp(1rem, 2vw, 1.25rem);
}

.gallery-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.gallery-header h2 {
    margin-bottom: 0;
    font-size: 1.05rem;
}

.gallery-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: end;
    gap: 0.7rem;
}

.select-control {
    display: grid;
    gap: 0.3rem;
}

.select-control span {
    color: rgba(247, 244, 237, 0.56);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
}

.select-control select {
    min-height: 2.4rem;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 8px;
    padding: 0 2rem 0 0.75rem;
    color: #ffffff;
    background: #151923;
    font-weight: 800;
}

.select-control select option {
    color: #f7f4ed;
    background: #151923;
}

.checkbox-control {
    display: flex;
    align-items: end;
    gap: 0.55rem;
    min-height: 3.45rem;
    padding-bottom: 0.1rem;
    color: #f7f4ed;
    font-size: 0.9rem;
    font-weight: 800;
}

.checkbox-control input {
    width: 1.2rem;
    height: 1.2rem;
    margin: 0 0 0.15rem;
    accent-color: #65f7dc;
}

.ghost-button,
.remove-button,
.danger-button {
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 8px;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.07);
    font-weight: 800;
}

.ghost-button {
    min-height: 2.4rem;
    padding: 0 0.9rem;
}

.gallery-timeline {
    display: grid;
    gap: 0.85rem;
}

.month-group {
    display: grid;
    gap: 0.85rem;
}

.month-toggle {
    display: grid;
    grid-template-columns: 2.2rem 1fr auto;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    min-height: 3.2rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    padding: 0.55rem 0.75rem;
    color: #ffffff;
    background: rgba(5, 6, 8, 0.48);
    text-align: left;
}

.month-toggle:hover {
    border-color: rgba(101, 247, 220, 0.44);
    background: rgba(255, 255, 255, 0.075);
}

.month-chevron {
    display: grid;
    width: 2.2rem;
    height: 2.2rem;
    place-items: center;
    border-radius: 50%;
    color: #06110f;
    background: #65f7dc;
    font-size: 1.25rem;
    font-weight: 900;
    line-height: 1;
}

.month-title {
    overflow: hidden;
    font-size: 1rem;
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.month-count {
    color: #f9d36b;
    font-size: 0.84rem;
    font-weight: 800;
    white-space: nowrap;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(13.5rem, 1fr));
    gap: 0.85rem;
}

.photo-card {
    display: grid;
    gap: 0.65rem;
    align-content: start;
    padding: 0.55rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: rgba(5, 6, 8, 0.52);
}

.photo-card.is-selected {
    border-color: rgba(101, 247, 220, 0.72);
    box-shadow: inset 0 0 0 1px rgba(101, 247, 220, 0.26);
}

.photo-button {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border: 0;
    border-radius: 6px;
    padding: 0;
    background: #0d1017;
}

.photo-button img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.photo-date {
    color: #f9d36b;
    font-size: 0.78rem;
    font-weight: 800;
}

.thumbnail-caption {
    display: grid;
    gap: 0.35rem;
}

.thumbnail-caption span {
    color: rgba(247, 244, 237, 0.56);
    font-size: 0.74rem;
    font-weight: 800;
    text-transform: uppercase;
}

.thumbnail-caption textarea {
    width: 100%;
    min-height: 3.4rem;
    resize: vertical;
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: 6px;
    padding: 0.65rem;
    color: rgba(247, 244, 237, 0.92);
    background: rgba(255, 255, 255, 0.055);
    font-size: 0.88rem;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.thumbnail-caption textarea::placeholder {
    color: rgba(247, 244, 237, 0.42);
}

.thumbnail-caption-text {
    margin-bottom: 0;
    color: rgba(247, 244, 237, 0.82);
    font-size: 0.88rem;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.remove-button {
    min-height: 2.25rem;
    color: #ffd2da;
}

.danger-button {
    min-height: 2.4rem;
    padding: 0 0.9rem;
    border-color: rgba(244, 107, 130, 0.58);
    color: #16070b;
    background: #f46b82;
}

.dialog-backdrop {
    position: fixed;
    inset: 0;
    z-index: 900;
    display: grid;
    place-items: center;
    padding: 1rem;
    background: rgba(3, 4, 7, 0.72);
    backdrop-filter: blur(18px);
}

.confirm-dialog {
    display: grid;
    gap: 1rem;
    width: min(30rem, 100%);
    max-height: min(42rem, calc(100vh - 2rem));
    overflow: auto;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 8px;
    padding: clamp(1rem, 3vw, 1.4rem);
    color: #f7f4ed;
    background: rgba(12, 15, 22, 0.94);
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.58);
}

.dialog-kicker {
    margin-bottom: 0.35rem;
    color: #f46b82;
    font-size: 0.76rem;
    font-weight: 900;
    text-transform: uppercase;
}

.confirm-dialog h2 {
    margin-bottom: 0;
    color: #ffffff;
    font-size: 1.45rem;
}

.confirm-dialog p {
    margin-bottom: 0;
    color: rgba(247, 244, 237, 0.72);
    line-height: 1.45;
}

.dialog-preview {
    display: grid;
    gap: 0.65rem;
    margin: 0;
}

.dialog-preview img {
    width: 100%;
    max-height: 18rem;
    border-radius: 8px;
    object-fit: contain;
    background: rgba(0, 0, 0, 0.25);
}

.dialog-preview figcaption {
    display: grid;
    gap: 0.25rem;
    color: rgba(247, 244, 237, 0.82);
    font-size: 0.9rem;
    line-height: 1.35;
}

.dialog-preview time {
    color: #f9d36b;
    font-weight: 800;
}

.clear-summary {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 0.8rem;
    padding: 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.055);
    color: rgba(247, 244, 237, 0.82);
    line-height: 1.35;
}

.clear-count {
    display: grid;
    min-width: 3rem;
    min-height: 3rem;
    place-items: center;
    border-radius: 50%;
    color: #16070b;
    background: #f46b82;
    font-size: 1.25rem;
    font-weight: 900;
}

.dialog-actions {
    display: flex;
    justify-content: end;
    gap: 0.7rem;
}

.slideshow-fullscreen {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    background: #030407;
}

.slideshow-fullscreen img {
    width: 100vw;
    height: 100vh;
    object-fit: contain;
}

.slideshow-overlay {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
    padding: clamp(1rem, 2.5vw, 2rem);
    background: linear-gradient(to top, rgba(3, 4, 7, 0.82), rgba(3, 4, 7, 0));
    pointer-events: none;
}

.slideshow-overlay > * {
    pointer-events: auto;
}

.slideshow-overlay time {
    color: #f9d36b;
    font-size: 0.9rem;
    font-weight: 900;
}

.slideshow-overlay p {
    max-width: min(44rem, 72vw);
    margin: 0.3rem 0 0;
    color: #ffffff;
    line-height: 1.45;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    padding: 1rem;
    color: white;
    background: #b32121;
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder,
.form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder,
.form-floating > .form-control:focus::placeholder {
    text-align: start;
}

@media (max-width: 860px) {
    .photo-shell {
        padding: 0;
    }

    .viewer-stage {
        min-height: 100vh;
        border-width: 0;
        border-radius: 0;
    }

    .topbar,
    .gallery-header {
        align-items: stretch;
        flex-direction: column;
    }

    .gallery-actions {
        justify-content: start;
    }

    h1 {
        max-width: 10ch;
    }

    .image-count {
        width: fit-content;
    }

    .focus-panel {
        min-height: 28rem;
    }
}

@media (max-width: 480px) {
    .viewer-stage {
        padding: 0.8rem;
    }

    .upload-dropzone {
        grid-template-columns: 1fr;
    }

    .upload-icon {
        width: 2.7rem;
        height: 2.7rem;
    }

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

    .month-toggle {
        grid-template-columns: 2.2rem 1fr;
    }

    .month-count {
        grid-column: 2;
    }

    .gallery-actions,
    .select-control,
    .select-control select {
        width: 100%;
    }

    .checkbox-control {
        align-items: center;
        min-height: 2.4rem;
        padding-bottom: 0;
    }

    .slideshow-overlay {
        align-items: stretch;
        flex-direction: column;
    }

    .slideshow-overlay p {
        max-width: 100%;
    }

    .dialog-actions {
        display: grid;
    }
}
