:root {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #222;
    background: #f7f4ef;
}
* { box-sizing: border-box; }
[hidden] { display:none !important; }
body { margin: 0; min-height: 100vh; padding: 24px; }
body.lightbox-open { overflow: hidden; }
.page { width: min(100%, 980px); margin: 0 auto; }
.box { width: min(100%, 520px); margin: 0 auto; background: #fff; padding: 34px 22px; border-radius: 22px; box-shadow: 0 12px 34px rgba(0,0,0,.08); text-align: center; }
h1 { margin: 0 0 12px; font-size: clamp(28px, 7vw, 38px); }
h2 { margin: 0; font-size: clamp(24px, 5vw, 32px); }
.wedding-header { padding: 4px 0 24px; margin-bottom: 25px; border-bottom: 1px solid rgba(146,125,81,.16); }
.wedding-title-wrap { display:flex; align-items:center; justify-content:center; width:100%; gap:16px; }
.wedding-names { font-family:"Segoe Script","Brush Script MT","Apple Chancery",cursive; font-size:clamp(40px,7vw,60px); font-weight:400; line-height:1.08; white-space:nowrap; color:#927d51; text-align:center; }
.wedding-and { font-size:.72em; margin:0 4px; }
.banner-line { flex:1; max-width:62px; height:1px; background:linear-gradient(to right,transparent,rgba(146,125,81,.65)); }
.banner-line:last-child { background:linear-gradient(to left,transparent,rgba(146,125,81,.65)); }
.upload-content { text-align:center; }
.lead { margin:0 0 22px; line-height:1.5; }
.file-button,.upload-button,.secondary-button { display:block; width:100%; padding:18px 20px; border-radius:16px; font-size:18px; font-weight:700; cursor:pointer; border:0; -webkit-tap-highlight-color:transparent; }
.file-button { background:#f0ebe4; border:2px dashed #c8b9a8; }
.upload-button { margin-top:14px; background:#222; color:#fff; }
.upload-button:disabled { opacity:.38; cursor:not-allowed; }
.secondary-button { width:auto; padding:11px 16px; font-size:14px; background:#fff; border:1px solid #d9d3cb; }
.file-info,.status,.privacy,.gallery-count,.gallery-empty,.closed-message { margin-top:12px; font-size:14px; line-height:1.45; }
.file-info,.privacy,.gallery-count { color:#6b6b6b; }
.status { min-height:22px; }
progress { width:100%; height:18px; margin-top:18px; }
.gallery-section { margin-top:28px; width:min(100%,980px); padding:24px; }
.gallery-heading { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-bottom:18px; text-align:left; }
.gallery-heading .gallery-count { margin:5px 0 0; }
.gallery-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; }
.gallery-item { position:relative; aspect-ratio:1/1; overflow:hidden; padding:0; border:0; border-radius:12px; background:#e8e5e1; cursor:zoom-in; }
.gallery-item img { display:block; width:100%; height:100%; object-fit:cover; image-orientation:from-image; transition:transform .18s ease; }
.gallery-item:active img { transform:scale(.98); }
.video-badge { position:absolute; left:50%; top:50%; transform:translate(-50%,-50%); display:grid; place-items:center; width:54px; height:54px; padding-left:4px; border-radius:50%; background:rgba(0,0,0,.68); color:white; font-size:24px; box-shadow:0 3px 14px rgba(0,0,0,.25); pointer-events:none; }
.load-more { margin:20px auto 0; }
.lightbox[hidden] { display:none; }
.lightbox { position:fixed; inset:0; z-index:9999; display:grid; grid-template-columns:minmax(50px,90px) minmax(0,1fr) minmax(50px,90px); align-items:center; background:rgba(0,0,0,.94); padding:max(12px,env(safe-area-inset-top)) max(8px,env(safe-area-inset-right)) max(12px,env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left)); }
.lightbox-stage { grid-column:2; margin:0; min-width:0; display:flex; flex-direction:column; align-items:center; justify-content:center; }
.lightbox-media { display:block; max-width:100%; max-height:calc(100vh - 165px); object-fit:contain; image-orientation:from-image; border-radius:4px; }
.lightbox-media[hidden] { display:none !important; }
.lightbox-stage video { width:min(100%,1100px); background:#000; }
.lightbox-meta { display:flex; flex-direction:column; align-items:center; gap:10px; margin-top:10px; }
.lightbox-counter { color:rgba(255,255,255,.8); font-size:14px; }
.lightbox-message { margin:10px 0; padding:10px 14px; border-radius:10px; background:#3b2626; color:#fff; font-size:14px; }
.lightbox-download { display:inline-flex; align-items:center; justify-content:center; min-height:44px; padding:10px 16px; border-radius:12px; background:rgba(255,255,255,.95); color:#222; font-size:14px; font-weight:700; text-decoration:none; -webkit-tap-highlight-color:transparent; }
.lightbox-download:active { transform:scale(.98); }
.lightbox-control { border:0; background:rgba(255,255,255,.12); color:#fff; cursor:pointer; -webkit-tap-highlight-color:transparent; }
.lightbox-control:disabled { opacity:.22; cursor:default; }
.lightbox-prev,.lightbox-next { width:48px; height:64px; border-radius:16px; font-size:42px; line-height:1; justify-self:center; }
.lightbox-prev { grid-column:1; }
.lightbox-next { grid-column:3; }
.lightbox-close { position:absolute; top:max(12px,env(safe-area-inset-top)); right:max(12px,env(safe-area-inset-right)); z-index:2; width:46px; height:46px; border-radius:50%; font-size:32px; line-height:1; }
@media (max-width:720px) {
    body { padding:14px; }
    .box { padding:28px 18px; }
    .wedding-header { padding:2px 0 20px; margin-bottom:22px; }
    .wedding-title-wrap { gap:8px; }
    .wedding-names { font-size:clamp(34px,10.5vw,48px); }
    .banner-line { max-width:28px; }
    .gallery-section { padding:16px; }
    .gallery-grid { grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px; }
    .lightbox { grid-template-columns:1fr; padding-left:8px; padding-right:8px; }
    .lightbox-stage { grid-column:1; width:100%; }
    .lightbox-media { max-height:calc(100vh - 180px); }
    .lightbox-prev,.lightbox-next { position:absolute; top:50%; transform:translateY(-50%); width:44px; height:58px; background:rgba(0,0,0,.45); }
    .lightbox-prev { left:8px; }
    .lightbox-next { right:8px; }
    .lightbox-download { font-size:14px; padding:10px 14px; }
}
@media (max-width:430px) {
    .gallery-heading { align-items:flex-start; }
    .secondary-button { padding:10px 12px; }
}

/* v7.2 — akcje w lightboxie */
.lightbox-actions {
    display:flex;
    flex-wrap:wrap;
    align-items:center;
    justify-content:center;
    gap:10px;
}
.lightbox-action {
    min-height:44px;
    padding:10px 16px;
    border:0;
    border-radius:12px;
    background:rgba(255,255,255,.95);
    color:#222;
    font:inherit;
    font-size:14px;
    font-weight:700;
    text-decoration:none;
    cursor:pointer;
    -webkit-tap-highlight-color:transparent;
}
.lightbox-action:active { transform:scale(.98); }
.lightbox-action:disabled,
.lightbox-action[aria-disabled="true"] { opacity:.58; cursor:wait; }
.lightbox-share { background:#fff; }
@media (max-width:600px) {
    .lightbox-actions { width:100%; }
    .lightbox-action { flex:1 1 auto; }
}

/* v7.3 — ekran wejścia hasłem */
.access-box {
    margin-top: clamp(18px, 7vh, 72px);
}
.access-content {
    text-align: center;
}
.access-content .lead {
    max-width: 410px;
    margin-left: auto;
    margin-right: auto;
    color: #5f5b55;
}
.guest-login-divider {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 24px 0 20px;
    color: #9a9187;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .08em;
}
.guest-login-divider::before,
.guest-login-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #e6dfd6;
}
.guest-login {
    width: 100%;
    max-width: 390px;
    margin: 0 auto;
    text-align: left;
}
.guest-password-label {
    display: block;
    margin: 0 0 8px;
    color: #4f4a44;
    font-size: 14px;
    font-weight: 700;
}
.guest-password-input {
    display: block;
    width: 100%;
    min-height: 54px;
    padding: 13px 15px;
    border: 1px solid #d8d0c7;
    border-radius: 14px;
    outline: none;
    background: #fff;
    color: #222;
    font: inherit;
    font-size: 18px;
    box-shadow: inset 0 1px 2px rgba(0,0,0,.025);
}
.guest-password-input:focus {
    border-color: #927d51;
    box-shadow: 0 0 0 3px rgba(146,125,81,.13);
}
.guest-login-button {
    display: block;
    width: 100%;
    min-height: 54px;
    margin-top: 13px;
    padding: 14px 18px;
    border: 0;
    border-radius: 14px;
    background: #222;
    color: #fff;
    font: inherit;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.guest-login-button:active {
    transform: scale(.985);
}
.guest-login-error {
    margin: 10px 0 0;
    padding: 10px 12px;
    border-radius: 11px;
    background: #fff1f0;
    color: #932c26;
    font-size: 14px;
    line-height: 1.4;
}
.guest-login-hint {
    max-width: 390px;
    margin: 14px auto 0;
    color: #777069;
    font-size: 12px;
    line-height: 1.5;
}


/* v7.4 — filtry galerii + pewne ukrywanie przycisku "Pokaż więcej" */
.gallery-filters {
    display:flex;
    flex-wrap:wrap;
    gap:8px;
    margin:0 0 18px;
}
.gallery-filter {
    min-height:40px;
    padding:9px 14px;
    border:1px solid #d9d3cb;
    border-radius:999px;
    background:#fff;
    color:#4f4a44;
    font:inherit;
    font-size:14px;
    font-weight:700;
    cursor:pointer;
    transition:background .15s ease,color .15s ease,border-color .15s ease,transform .15s ease;
    -webkit-tap-highlight-color:transparent;
}
.gallery-filter:active { transform:scale(.97); }
.gallery-filter.is-active {
    background:#927d51;
    border-color:#927d51;
    color:#fff;
}
.load-more:disabled { opacity:.55; cursor:wait; }
@media (max-width:600px) {
    .gallery-filters {
        display:grid;
        grid-template-columns:repeat(3,minmax(0,1fr));
        gap:6px;
    }
    .gallery-filter {
        width:100%;
        padding:9px 8px;
        font-size:13px;
    }
}
