:root {
  --canvas: #FBF8F3;
  --surface: #FFFFFF;
  --ink: #211C24;
  --muted: #8A8088;
  --accent: #D6336C;
  --accent-press: #B22455;
  --gold: #E0A93B;
  --line: rgba(33, 28, 36, 0.10);
  --shadow: 0 1px 2px rgba(33,28,36,.06), 0 8px 24px rgba(33,28,36,.06);
  --radius: 16px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

.wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 22px 18px 96px;
}

/* ---- Nagłówek albumu (signature) ---- */
.hero {
  padding: 26px 4px 22px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 22px;
}
.hero .eyebrow {
  font-size: 12px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  margin: 0 0 8px;
}
.hero h1 {
  font-family: "Fraunces", Georgia, "Times New Roman", serif;
  font-weight: 600;
  font-size: clamp(30px, 7vw, 52px);
  line-height: 1.02;
  letter-spacing: -.01em;
  margin: 0;
}
.hero .count {
  margin-top: 10px;
  color: var(--muted);
  font-size: 15px;
}
.hero .count b { color: var(--ink); font-weight: 600; }

/* ---- Akcje ---- */
.actions {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 12px 0;
  background: linear-gradient(var(--canvas) 70%, rgba(251,248,243,0));
}
.btn {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  padding: 12px 18px;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform .08s ease, background .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: var(--shadow);
}
.btn-primary:active { background: var(--accent-press); }
.btn .plus { font-size: 20px; line-height: 0; margin-top: -2px; }
.spacer { flex: 1; }

/* ---- Postęp wgrywania ---- */
.uploader { margin: 8px 0 18px; display: none; }
.uploader.show { display: block; }
.bar {
  height: 8px;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
}
.bar > span {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--gold));
  transition: width .2s ease;
}
.uploader .status { font-size: 13px; color: var(--muted); margin-top: 6px; }

/* ---- Siatka (masonry) ---- */
.grid { columns: 4 220px; column-gap: 12px; }
.tile {
  break-inside: avoid;
  margin: 0 0 12px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow);
  cursor: pointer;
  display: block;
  position: relative;
  border: none;
  width: 100%;
  padding: 0;
}
.tile img { width: 100%; display: block; }
.tile.video::after {
  content: "▶";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  color: #fff;
  background: rgba(33,28,36,.32);
  text-shadow: 0 2px 8px rgba(0,0,0,.4);
}
.video-tile {
  aspect-ratio: 3 / 4;
  background: #211C24;
}

/* ---- Pusty stan ---- */
.empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}
.empty h2 {
  font-family: "Fraunces", Georgia, serif;
  color: var(--ink);
  font-weight: 500;
}

/* ---- Lightbox ---- */
.lb {
  position: fixed;
  inset: 0;
  background: rgba(20,16,22,.92);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
}
.lb.show { display: flex; }
.lb img, .lb video {
  max-width: 100%;
  max-height: 86vh;
  border-radius: 10px;
}
.lb .close {
  position: absolute;
  top: 14px; right: 18px;
  color: #fff;
  font-size: 30px;
  background: none;
  border: none;
  cursor: pointer;
}
.lb .dl {
  position: absolute;
  bottom: 18px;
  color: #fff;
  text-decoration: underline;
  font-size: 14px;
}

/* ---- Panel admina ---- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  margin-bottom: 16px;
}
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; font-weight: 600; }
.field input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font: inherit;
  background: var(--canvas);
}
.field input:focus { outline: 2px solid var(--accent); border-color: transparent; }

.album-row {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.album-row:last-child { border-bottom: none; }
.album-row .qr { width: 78px; height: 78px; border-radius: 10px; border: 1px solid var(--line); flex: none; background:#fff; }
.album-row .meta { flex: 1; min-width: 0; }
.album-row .meta h3 { margin: 0 0 4px; font-size: 17px; }
.album-row .meta .link {
  font-size: 13px;
  color: var(--accent);
  word-break: break-all;
}
.album-row .meta .sub { font-size: 13px; color: var(--muted); }
.row-actions { display: flex; flex-direction: column; gap: 8px; flex: none; }
.btn-sm { padding: 8px 12px; font-size: 13px; }
.btn-ghost { background: transparent; }
.btn-danger { color: var(--accent); border-color: var(--line); }

.topbar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 18px;
}
.topbar .brand {
  font-family: "Fraunces", Georgia, serif;
  font-size: 24px;
  font-weight: 600;
}
.err { color: var(--accent); font-size: 14px; margin-top: 8px; }
.hint { color: var(--muted); font-size: 13px; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
