* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: #f4f6f8;
    color: #1f2937;
}

body {
    min-height: 100vh;
}

body.lightbox-open {
    overflow: hidden;
}

.page {
    max-width: 560px;
    margin: 60px auto;
    padding: 0 20px;
}

.page.wide {
    max-width: 1200px;
}

.card {
    background: #ffffff;
    border: 1px solid #dbe3ea;
    border-radius: 14px;
    padding: 28px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

h1, h2, h3 {
    margin-top: 0;
    color: #0f172a;
}

h1 {
    margin-bottom: 12px;
    font-size: 30px;
    line-height: 1.2;
}

h2 {
    margin-bottom: 18px;
    font-size: 24px;
}

h3 {
    margin-bottom: 8px;
    font-size: 18px;
}

p {
    margin: 0 0 16px 0;
    line-height: 1.5;
}

code {
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 6px;
}

.form-group {
    margin-bottom: 16px;
}

label {
    display: block;
    font-weight: bold;
    margin-bottom: 8px;
}

input[type="text"] {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 16px;
    background: #fff;
}

input[type="text"]:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

button,
.button,
a.button {
    display: inline-block;
    padding: 12px 16px;
    border: none;
    border-radius: 8px;
    background: #2563eb;
    color: #ffffff;
    font-size: 16px;
    text-decoration: none;
    cursor: pointer;
}

button:hover,
.button:hover,
a.button:hover {
    background: #1d4ed8;
}

.button-secondary {
    background: #6b7280;
}

.button-secondary:hover {
    background: #4b5563;
}

.message {
    padding: 12px 14px;
    border-radius: 8px;
    margin-bottom: 18px;
    font-size: 15px;
}

.message-info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
}

.message-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
}

.separator {
    height: 1px;
    background: #e5e7eb;
    margin: 24px 0;
}

.actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.center {
    text-align: center;
}

.small {
    font-size: 14px;
    color: #6b7280;
}

.welcome {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 8px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 12px;
}

.year-section + .year-section {
    margin-top: 36px;
}

.album-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
}

.album-card-link {
    text-decoration: none;
    color: inherit;
}

.album-card {
    border: 1px solid #dbe3ea;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.album-card-link:hover .album-card {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
}

.album-cover {
    display: block;
    width: 100%;
    height: 180px;
    object-fit: cover;
    background: #e5e7eb;
}

.album-cover-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
}

.album-content {
    padding: 16px;
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

.image-tile {
    display: block;
    width: 100%;
    padding: 0;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #dbe3ea;
    background: #fff;
    cursor: pointer;
}

.image-tile:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
}

.image-thumb {
    display: block;
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
}

.lightbox[hidden] {
    display: none;
}

.lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.82);
}

.lightbox-dialog {
    position: relative;
    z-index: 1;
    width: min(1200px, calc(100vw - 32px));
    height: min(90vh, 900px);
    margin: 5vh auto;
    border-radius: 16px;
    overflow: hidden;
    background: #111827;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.lightbox-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 20px;
    background: #0f172a;
    color: #ffffff;
}

.lightbox-meta {
    min-width: 0;
}

.lightbox-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 4px;
}

.lightbox-caption {
    font-size: 14px;
    color: #cbd5e1;
    word-break: break-word;
}

.lightbox-close {
    position: absolute;
    top: 12px;
    right: 14px;
    z-index: 3;
    width: 42px;
    height: 42px;
    padding: 0;
    border-radius: 999px;
    font-size: 28px;
    line-height: 1;
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.24);
}

.lightbox-content {
    display: grid;
    grid-template-columns: 64px 1fr 64px;
    align-items: stretch;
    height: calc(100% - 72px);
}

.lightbox-image-wrap {
    position: relative;
    overflow: hidden;
    width: 100%;
    height: 100%;
    touch-action: pan-y;
    user-select: none;
    cursor: grab;
}

.lightbox-image-wrap:active {
    cursor: grabbing;
}

.lightbox-track {
    display: flex;
    width: 300%;
    height: 100%;
    transform: translateX(-33.333333%);
}

.lightbox-track.is-animating {
    transition: transform 0.26s ease;
}

.lightbox-slide {
    flex: 0 0 33.333333%;
    max-width: 33.333333%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow: hidden;
}

.lightbox-image {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center center;
    border-radius: 8px;
    background: #111827;
    pointer-events: none;
	user-select: none;
	webkit-user-drag: none;
}

.lightbox-nav {
    width: 48px;
    height: 48px;
    padding: 0;
    margin: 0 auto;
    border-radius: 999px;
    font-size: 34px;
    line-height: 1;
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.24);
}

@media (max-width: 720px) {
    .lightbox-dialog {
        width: 100vw;
        height: 100vh;
        margin: 0;
        border-radius: 0;
    }

    .lightbox-content {
        grid-template-columns: 52px 1fr 52px;
    }

    .lightbox-slide {
        padding: 12px;
    }
}

select,
input[type="date"],
input[type="file"] {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 16px;
    background: #fff;
}

select:focus,
input[type="date"]:focus,
input[type="file"]:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.upload-layout {
    max-width: 760px;
}

.upload-card {
    max-width: 760px;
}

.progress-box {
    margin: 18px 0;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
    font-size: 14px;
    color: #475569;
}

.progress-bar {
    width: 100%;
    height: 14px;
    border-radius: 999px;
    background: #e2e8f0;
    overflow: hidden;
}

.progress-bar-fill {
    width: 0%;
    height: 100%;
    background: #2563eb;
    transition: width 0.12s ease;
}