/* ============================================================================
   GALERIA ŚLUBNA — style (faithful to the original design)
   Fonts: Cormorant Garamond + Manrope · ivory #FBFAF6 · brown #6E4C3A
   ============================================================================ */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; background: #E7E3DB; }
/* touch-action: manipulation disables the double-tap-to-zoom gesture site-wide
   (pinch-to-zoom on photos still works). */
body { font-family: 'Manrope', system-ui, sans-serif; touch-action: manipulation; }
a { color: #6E4C3A; text-decoration: none; }
a:hover { color: #543A2B; }
button, input { font-family: inherit; }
/* 16px minimum stops iOS from zooming in when a field is focused. */
input, select, textarea { font-size: 16px; }
::-webkit-scrollbar { width: 0; height: 0; }

@keyframes omPop  { 0% { opacity: 0; transform: translateY(10px) scale(.96); } 100% { opacity: 1; transform: none; } }
@keyframes omSpin { to { transform: rotate(360deg); } }
@keyframes omFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes omSheet{ from { transform: translateY(100%); } to { transform: translateY(0); } }

.page  { min-height: 100vh; background: #E7E3DB; display: flex; justify-content: center; }
.phone { width: 100%; max-width: 460px; min-height: 100vh; background: #FBFAF6; position: relative;
         overflow-x: hidden; box-shadow: 0 0 60px rgba(44,39,35,.12); padding-bottom: 64px; }

/* Header */
.hdr        { text-align: center; padding: 30px 24px 6px; }
.hdr-title  { font-family: 'Cormorant Garamond', serif; font-style: italic; font-weight: 600;
              font-size: 23px; color: #2C2723; letter-spacing: .3px; }
.hdr-date   { margin-top: 5px; font-size: 10.5px; font-weight: 600; letter-spacing: 2.5px;
              text-transform: uppercase; color: #6E4C3A; }

/* Hero card (guest: big +, admin: panel) */
.hero { margin: 14px 18px 4px; background: #FFFFFF; border-radius: 26px; padding: 30px 20px 32px;
        box-shadow: 0 6px 26px rgba(44,39,35,.07); border: 1px solid rgba(44,39,35,.05); }
.hero-col { display: flex; flex-direction: column; align-items: center; }
.plus-btn { width: 182px; height: 182px; border-radius: 50%; border: none; background: #6E4C3A; color: #fff;
            font-size: 94px; font-weight: 300; line-height: 1; cursor: pointer; padding-bottom: 10px;
            box-shadow: 0 16px 38px rgba(110,76,58,.42); display: flex; align-items: center;
            justify-content: center; transition: transform .15s ease; }
.plus-btn:active { transform: scale(.94); }
.hero-caption { margin-top: 22px; font-family: 'Cormorant Garamond', serif; font-size: 26px; color: #2C2723; }

/* Admin panel card */
.adm-label { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.adm-dot   { width: 7px; height: 7px; border-radius: 50%; background: #6E4C3A; flex: 0 0 auto; }
.adm-label span:last-child { font-size: 11px; font-weight: 700; letter-spacing: 1.5px;
              text-transform: uppercase; color: #6E4C3A; }
.btn-primary { width: 100%; padding: 16px; border-radius: 16px; border: none; background: #6E4C3A; color: #fff;
              font-size: 16px; font-weight: 700; cursor: pointer; box-shadow: 0 8px 20px rgba(110,76,58,.32); }
.btn-ghost  { display: block; text-align: center; width: 100%; margin-top: 10px; padding: 15px;
              border-radius: 16px; border: 1.5px solid rgba(44,39,35,.14); background: #fff; color: #2C2723;
              font-size: 15px; font-weight: 700; }
.adm-selbox { animation: omPop .22s ease both; }
.adm-count  { text-align: center; font-family: 'Cormorant Garamond', serif; font-size: 24px; color: #2C2723; }
.btn-selall { width: 100%; margin-top: 14px; padding: 13px; border-radius: 14px;
              border: 1.5px solid rgba(110,76,58,.35); background: #F2EBE3; color: #6E4C3A;
              font-size: 14.5px; font-weight: 700; cursor: pointer; }
.adm-actions { display: flex; gap: 10px; margin-top: 10px; }
.btn-dl-adm { flex: 7; padding: 14px; border-radius: 14px; border: 1.5px solid rgba(110,76,58,.35);
              background: #fff; color: #6E4C3A; font-size: 15px; font-weight: 700; cursor: pointer; }
.btn-del    { flex: 3; padding: 14px; border-radius: 14px; border: none; background: #A65545; color: #fff;
              font-size: 15px; font-weight: 700; cursor: pointer; }
.btn-done   { display: block; margin: 12px auto 0; background: none; border: none; color: #9C9084;
              font-size: 14px; font-weight: 600; cursor: pointer; padding: 6px 10px; }
[disabled] { opacity: .4; cursor: not-allowed !important; }

/* Count + select toggle row */
.countrow { display: flex; align-items: center; justify-content: space-between; padding: 24px 22px 12px; }
.count    { font-size: 14px; font-weight: 400; letter-spacing: .3px; color: #6E4C3A; }
.count.center { display: block; text-align: center; padding: 24px 22px 12px; font-weight: 700; font-size: 13px; }
.sel-toggle { display: inline-flex; align-items: center; gap: 5px; background: none; border: none;
              color: #6E4C3A; font-size: 14px; font-weight: 600; cursor: pointer; padding: 2px; }
.sel-info { font-size: 14px; font-weight: 600; color: #2C2723; }

/* Masonry */
.grid  { padding: 16px 16px 0; }
.cols  { column-count: 3; column-gap: 8px; }
.tile  { display: block; width: 100%; margin-bottom: 8px; border-radius: 16px; overflow: hidden;
         position: relative; cursor: pointer; break-inside: avoid; box-shadow: 0 1px 4px rgba(44,39,35,.07);
         background: #EDE7DD; }
.tile img { display: block; width: 100%; height: auto; }
.tile.sel { box-shadow: 0 0 0 1px #6E4C3A; }
.tile.sel img { opacity: .94; }
.check { position: absolute; top: 8px; right: 8px; width: 23px; height: 23px; border-radius: 50%;
         display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 400;
         color: #fff; background: rgba(20,16,14,.22); border: 1px solid rgba(255,255,255,.9); }
.check.on { background: #6E4C3A; border-color: #fff; }

/* Loading / end */
.loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 22px 0 8px;
           color: #9C9084; font-size: 13px; }
.spin { width: 18px; height: 18px; border: 2.5px solid rgba(110,76,58,.25); border-top-color: #6E4C3A;
        border-radius: 50%; animation: omSpin .8s linear infinite; display: inline-block; }
.atend { text-align: center; padding: 22px 0 8px; color: #B8AC9E; font-size: 12px; letter-spacing: .5px; }
.empty { text-align: center; padding: 30px 0; color: #B8AC9E; font-size: 13px; }

/* Upload review sheet */
.overlay { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end;
           justify-content: center; background: rgba(20,16,14,.5); animation: omFade .2s ease both; }
.sheet { width: 100%; max-width: 460px; background: #FBFAF6; border-radius: 26px 26px 0 0;
         padding: 22px 20px calc(24px + env(safe-area-inset-bottom)); animation: omSheet .3s cubic-bezier(.2,.9,.3,1) both; }
.grabber { width: 40px; height: 4px; border-radius: 2px; background: rgba(44,39,35,.15); margin: 0 auto 16px; }
.sheet-title { font-family: 'Cormorant Garamond', serif; font-size: 22px; color: #2C2723; }
.sheet-sub { font-size: 13px; color: #9C9084; margin-top: 2px; }
.pv-row { display: flex; gap: 10px; overflow-x: auto; padding: 16px 0 4px; }
.pv { width: 74px; height: 74px; flex: 0 0 auto; border-radius: 13px; background-size: cover;
      background-position: center; background-repeat: no-repeat; }
.name-input { width: 100%; margin-top: 14px; padding: 14px 16px; border-radius: 14px;
              border: 1.5px solid rgba(44,39,35,.12); background: #fff; font-size: 16px; color: #2C2723; outline: none; }
.btn-add { width: 100%; margin-top: 14px; padding: 16px; border-radius: 16px; border: none; background: #6E4C3A;
           color: #fff; font-size: 16px; font-weight: 700; cursor: pointer; box-shadow: 0 8px 20px rgba(110,76,58,.32); }
.btn-cancel { width: 100%; margin-top: 8px; padding: 12px; border-radius: 14px; border: none; background: none;
              color: #9C9084; font-size: 14px; font-weight: 600; cursor: pointer; }

/* Floating select bar (guest) */
.selbar-wrap { position: fixed; left: 0; right: 0; bottom: 0; display: flex; justify-content: center;
               padding: 16px; z-index: 55; pointer-events: none; }
.selbar { pointer-events: auto; display: flex; align-items: center; gap: 8px; background: #2C2723;
          border-radius: 18px; padding: 8px; box-shadow: 0 12px 34px rgba(0,0,0,.28); animation: omPop .22s ease both; }
.selbar-btn { padding: 11px 16px; border-radius: 12px; border: none; background: rgba(255,255,255,.12);
              color: #fff; font-size: 14.5px; font-weight: 700; cursor: pointer; }
.selbar-dl { padding: 11px 18px; border-radius: 12px; border: none; background: #fff; color: #2C2723;
             font-size: 14.5px; font-weight: 700; cursor: pointer; }
.selbar-x { width: 42px; height: 42px; flex: 0 0 auto; border-radius: 12px; border: none;
            background: rgba(255,255,255,.12); color: #fff; font-size: 18px; cursor: pointer; }

/* Lightbox */
.lb { position: fixed; inset: 0; z-index: 70; display: flex; flex-direction: column;
      background: rgba(18,14,12,.95); animation: omFade .2s ease both; }
.lb-top { position: relative; flex: 0 0 auto; height: 54px; display: flex; align-items: center;
          justify-content: center; padding-top: env(safe-area-inset-top); }
.lb-count { color: rgba(255,255,255,.6); font-size: 12px; letter-spacing: 1px; }
.lb-close { position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
            width: 40px; height: 40px; border-radius: 50%; border: none; background: #fff;
            color: #2C2723; font-size: 24px; line-height: 1; cursor: pointer; z-index: 6;
            display: flex; align-items: center; justify-content: center;
            box-shadow: 0 2px 10px rgba(0,0,0,.35); }
.lb-del { position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
          height: 38px; padding: 0 18px; border-radius: 19px; border: none; background: #A65545;
          color: #fff; font-size: 14px; font-weight: 700; cursor: pointer; z-index: 6; }
.lb-stage { position: relative; flex: 1 1 auto; min-height: 0; display: flex;
            align-items: center; justify-content: center; padding: 6px 12px 28px; }
.lb-media { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain;
            border-radius: 14px; display: block; background: #241d19; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px;
          border-radius: 50%; border: none; background: #fff; color: #2C2723; font-size: 26px;
          line-height: 1; cursor: pointer; z-index: 5; display: flex; align-items: center;
          justify-content: center; box-shadow: 0 2px 10px rgba(0,0,0,.35); padding-bottom: 2px; }
.lb-prev { left: 14px; } .lb-next { right: 14px; }
.lb-name { position: absolute; left: 0; right: 0; bottom: 6px; text-align: center; color: #fff;
           font-size: 12.5px; text-shadow: 0 1px 5px rgba(0,0,0,.7); pointer-events: none; padding: 0 12px; }
.lb-name .muted { opacity: .7; }
.lb-name b { font-weight: 700; }
.lb-thumbs { flex: 0 0 auto; display: flex; gap: 8px; overflow-x: auto;
             padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); }
.lb-thumb { width: 54px; height: 54px; flex: 0 0 auto; border-radius: 10px; cursor: pointer; object-fit: cover;
            opacity: .42; transition: opacity .15s ease; }
.lb-thumb.on { opacity: 1; box-shadow: 0 0 0 2px #fff; }

/* Delete confirmation */
.confirm-wrap { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center;
                padding: 24px; background: rgba(20,16,14,.55); animation: omFade .2s ease both; }
.confirm { width: 100%; max-width: 340px; background: #FBFAF6; border-radius: 22px; padding: 26px 22px;
           text-align: center; box-shadow: 0 24px 60px rgba(0,0,0,.35); }
.confirm-title { font-family: 'Cormorant Garamond', serif; font-size: 25px; color: #2C2723; }
.confirm-body { font-size: 14px; color: #8A7C6D; margin-top: 8px; line-height: 1.5; }
.confirm-row { display: flex; gap: 10px; margin-top: 22px; }
.confirm-cancel { flex: 1; padding: 14px; border-radius: 14px; border: 1.5px solid rgba(44,39,35,.15);
                  background: #fff; color: #2C2723; font-size: 15px; font-weight: 700; cursor: pointer; }
.confirm-del { flex: 1; padding: 14px; border-radius: 14px; border: none; background: #A65545; color: #fff;
               font-size: 15px; font-weight: 700; cursor: pointer; }

/* Login (admin gate) */
.login-card { margin: 40px 18px; background: #fff; border-radius: 24px; padding: 30px 24px;
              box-shadow: 0 6px 26px rgba(44,39,35,.07); border: 1px solid rgba(44,39,35,.05); text-align: center; }
.login-title { font-family: 'Cormorant Garamond', serif; font-size: 26px; color: #2C2723; margin-bottom: 4px; }
.login-sub { font-size: 13px; color: #9C9084; margin-bottom: 18px; }
.login-card input { width: 100%; margin-top: 10px; padding: 14px 16px; border-radius: 14px;
              border: 1.5px solid rgba(44,39,35,.12); background: #fff; font-size: 15px; color: #2C2723; outline: none; }
.login-err { color: #A65545; font-size: 13px; font-weight: 600; margin-top: 12px; }
.toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); background: #2C2723; color: #fff;
         padding: 12px 20px; border-radius: 14px; font-size: 14px; z-index: 90; box-shadow: 0 12px 34px rgba(0,0,0,.3);
         animation: omPop .22s ease both; max-width: 90%; }
