:root {
  color-scheme: light;
  --background: #f3eee6;
  --surface: #fffdf9;
  --text: #302b27;
  --muted: #766d65;
  --accent: #a8896c;
  --line: #e2d8cc;
  --success: #66795f;
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, #fffaf2 0, transparent 42%),
    var(--background);
}

.page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 18px;
}

.card {
  width: min(720px, 100%);
  min-height: 580px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(32px, 7vw, 72px);
  background: rgba(255, 253, 249, 0.94);
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: 0 26px 70px rgba(65, 51, 39, 0.08);
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.brand-name {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(28px, 5vw, 42px);
  font-style: italic;
  letter-spacing: -0.03em;
}

.brand-subtitle {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

.content {
  max-width: 540px;
  margin: 64px 0;
}

.eyebrow {
  margin: 0 0 18px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(36px, 7vw, 58px);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.description {
  max-width: 470px;
  margin: 28px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.7;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 34px;
  padding: 12px 16px;
  color: var(--success);
  background: #f1f4ef;
  border-radius: 999px;
  font-size: 13px;
}

.status-dot {
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
}

footer {
  padding-top: 22px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 14px;
  font-style: italic;
}

@media (max-width: 560px) {
  .page {
    padding: 0;
  }

  .card {
    min-height: 100vh;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .content {
    margin: 48px 0;
  }
}

.login-card {
  min-height: 640px;
}

.login-content {
  width: 100%;
}

.login-title,
.admin-title {
  font-size: clamp(38px, 6vw, 56px);
}

.login-form {
  display: grid;
  gap: 20px;
  margin-top: 34px;
}

.login-form label {
  display: grid;
  gap: 9px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.login-form input {
  width: 100%;
  padding: 15px 16px;
  color: var(--text);
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 4px;
  font: inherit;
  outline: none;
}

.login-form input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(168, 137, 108, 0.13);
}

button {
  padding: 14px 20px;
  color: #ffffff;
  background: var(--text);
  border: 1px solid var(--text);
  border-radius: 4px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  opacity: 0.88;
}

.button-secondary {
  color: var(--text);
  background: transparent;
  border-color: var(--line);
}

.message {
  margin-top: 24px;
  padding: 13px 15px;
  border-radius: 4px;
  font-size: 14px;
  line-height: 1.5;
}

.message-error {
  color: #7a3832;
  background: #f8ece9;
  border: 1px solid #edd1cc;
}

.message-success {
  color: #52634d;
  background: #eff4ed;
  border: 1px solid #d9e5d5;
}

.admin-page {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
  padding: 30px 0 70px;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}

.admin-content {
  padding: 72px 0;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin-top: 48px;
}

.admin-tile {
  min-height: 250px;
  padding: 32px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.admin-tile-muted {
  background: transparent;
  border-style: dashed;
}

.admin-tile-number {
  display: block;
  margin-bottom: 42px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 42px;
  color: var(--accent);
}

.admin-tile h2 {
  margin: 0 0 12px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 26px;
  font-weight: 400;
}

.admin-tile p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

@media (max-width: 680px) {
  .admin-header {
    align-items: flex-start;
  }

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

  .admin-content {
    padding: 48px 0;
  }
}

.admin-section {
  margin-top: 56px;
  padding: 34px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 30px;
}

.section-heading h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 30px;
  font-weight: 400;
}

.gallery-form {
  display: grid;
  grid-template-columns:
    minmax(0, 2fr)
    minmax(190px, 1fr);
  gap: 22px;
  align-items: end;
}

.field {
  display: grid;
  gap: 9px;
}

.field span,
.checkbox-field span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.field input {
  width: 100%;
  padding: 14px 15px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
  font: inherit;
}

.field input:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow:
    0 0 0 3px rgba(168, 137, 108, 0.13);
}

.checkbox-field {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
}

.checkbox-field input {
  width: 18px;
  height: 18px;
}

.gallery-submit {
  min-height: 48px;
}

.gallery-count {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  color: var(--accent);
  border: 1px solid var(--line);
  border-radius: 50%;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 21px;
}

.empty-state {
  padding: 30px;
  color: var(--muted);
  background: #faf7f2;
  border: 1px dashed var(--line);
  text-align: center;
}

.gallery-list {
  display: grid;
  gap: 14px;
}

.gallery-row {
  display: flex;
  justify-content: space-between;
  gap: 30px;
  padding: 22px;
  background: #faf8f4;
  border: 1px solid var(--line);
}

.gallery-main h3 {
  margin: 10px 0 6px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 23px;
  font-weight: 400;
}

.gallery-main p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.status-badge {
  display: inline-flex;
  padding: 6px 9px;
  color: #765f4c;
  background: #f0e7dd;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.gallery-meta {
  display: grid;
  align-content: center;
  gap: 8px;
  min-width: 200px;
  color: var(--muted);
  font-size: 13px;
}

.gallery-meta strong {
  color: var(--text);
}

.created-content {
  max-width: 850px;
}

.created-details {
  display: grid;
  gap: 18px;
  margin-top: 42px;
}

.created-item {
  display: grid;
  gap: 10px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.created-item > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.created-item code {
  padding: 13px;
  background: #f6f1ea;
  border-radius: 3px;
  overflow-wrap: anywhere;
}

.created-item strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 29px;
  font-weight: 400;
}

.created-item small {
  color: var(--muted);
  line-height: 1.5;
}

.access-code-item strong {
  letter-spacing: 0.12em;
}

.created-actions {
  margin-top: 30px;
}

.button-link {
  display: inline-flex;
  padding: 14px 20px;
  color: #fff;
  background: var(--text);
  border-radius: 4px;
  font-weight: 700;
  text-decoration: none;
}

.text-link {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}

@media (max-width: 760px) {
  .admin-section {
    padding: 24px 18px;
  }

  .gallery-form {
    grid-template-columns: 1fr;
  }

  .gallery-row {
    flex-direction: column;
  }

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

.client-login-card {
  min-height: 620px;
}

.client-gallery-title {
  font-size: clamp(38px, 7vw, 58px);
}

.client-page {
  width: min(1300px, calc(100% - 36px));
  margin: 0 auto;
  padding: 30px 0 80px;
}

.client-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}

.client-hero {
  padding: 90px 0 62px;
  text-align: center;
}

.client-hero h1 {
  max-width: 900px;
  margin: 0 auto;
}

.client-hero > p:last-child {
  margin: 24px 0 0;
  color: var(--muted);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  font-style: italic;
}

.client-empty-gallery {
  max-width: 760px;
  margin: 0 auto;
  padding: 60px 32px;
  background: var(--surface);
  border: 1px solid var(--line);
  text-align: center;
}

.client-empty-icon {
  display: grid;
  width: 64px;
  height: 64px;
  margin: 0 auto 26px;
  place-items: center;
  color: var(--accent);
  border: 1px solid var(--line);
  border-radius: 50%;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 26px;
}

.client-empty-gallery h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 32px;
  font-weight: 400;
}

.client-empty-gallery p {
  max-width: 570px;
  margin: 18px auto 0;
  color: var(--muted);
  line-height: 1.7;
}

.client-download-status {
  display: inline-flex;
  margin-top: 28px;
  padding: 10px 14px;
  color: var(--success);
  background: #f1f4ef;
  border-radius: 999px;
  font-size: 13px;
}

@media (max-width: 620px) {
  .client-header {
    align-items: flex-start;
  }

  .client-header button {
    padding: 10px 12px;
    font-size: 12px;
  }

  .client-hero {
    padding: 60px 0 42px;
  }

  .client-empty-gallery {
    padding: 42px 20px;
  }
}

.gallery-detail-page {
  max-width: 1100px;
  margin: 0 auto;
}

.gallery-detail-heading {
  margin-bottom: 44px;
}

.gallery-detail-heading .admin-title {
  margin-top: 16px;
}

.gallery-summary-grid {
  display: grid;
  grid-template-columns:
    repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.summary-card {
  min-height: 170px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.summary-card > span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.summary-card strong {
  display: block;
  margin: 25px 0 8px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 30px;
  font-weight: 400;
}

.summary-card small {
  color: var(--muted);
  line-height: 1.5;
}

.gallery-access-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px;
  background: #faf7f2;
  border: 1px solid var(--line);
}

.gallery-access-box code {
  overflow-wrap: anywhere;
}

.gallery-note {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.gallery-information {
  display: grid;
  grid-template-columns:
    repeat(2, minmax(0, 1fr));
  margin: 0;
  border-top: 1px solid var(--line);
}

.gallery-information > div {
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}

.gallery-information > div:nth-child(odd) {
  padding-right: 24px;
}

.gallery-information dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.gallery-information dd {
  margin: 8px 0 0;
  overflow-wrap: anywhere;
}

.gallery-actions-grid {
  display: grid;
  grid-template-columns:
    repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.gallery-action-card {
  min-height: 150px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  color: var(--text);
  background: #faf7f2;
  border: 1px dashed var(--line);
  text-align: left;
}

.gallery-action-card:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.gallery-action-card strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
  font-weight: 400;
}

.gallery-action-card span {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.gallery-open-link {
  width: fit-content;
  margin-top: 8px;
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1px solid var(--accent);
}

@media (max-width: 850px) {
  .gallery-summary-grid {
    grid-template-columns:
      repeat(2, minmax(0, 1fr));
  }

  .gallery-actions-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 580px) {
  .gallery-summary-grid,
  .gallery-information {
    grid-template-columns: 1fr;
  }

  .gallery-access-box {
    align-items: stretch;
    flex-direction: column;
  }

  .gallery-access-box .button-link {
    justify-content: center;
  }

  .gallery-information > div:nth-child(odd) {
    padding-right: 0;
  }
}

.photo-upload-form {
  display: flex;
  align-items: end;
  gap: 18px;
}

.photo-file-field {
  flex: 1;
  display: grid;
  gap: 9px;
}

.photo-file-field > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.photo-file-field input {
  width: 100%;
  min-height: 48px;
  padding: 10px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
}

.admin-photo-grid {
  display: grid;
  grid-template-columns:
    repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.admin-photo-card {
  min-width: 0;
  background: #faf7f2;
  border: 1px solid var(--line);
}

.admin-photo-image {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #ece7e0;
}

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

.admin-photo-description {
  display: grid;
  gap: 5px;
  padding: 13px;
}

.admin-photo-description strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-photo-description span {
  color: var(--muted);
  font-size: 11px;
}

@media (max-width: 900px) {
  .admin-photo-grid {
    grid-template-columns:
      repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .photo-upload-form {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-photo-grid {
    grid-template-columns:
      repeat(2, minmax(0, 1fr));
  }
}

/* Kafelki zdjęć i sterowanie */

.admin-photo-grid {
  display: grid !important;
  grid-template-columns:
    repeat(auto-fill, minmax(190px, 1fr)) !important;
  gap: 18px !important;
  width: 100%;
}

.admin-photo-card {
  min-width: 0;
  overflow: hidden;
  background: #faf7f2;
  border: 1px solid var(--line);
  border-radius: 4px;
}

.admin-photo-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #eae5de;
}

.admin-photo-image img {
  width: 100% !important;
  height: 100% !important;
  display: block;
  object-fit: contain !important;
}

.admin-photo-description {
  padding: 13px 14px 10px;
}

.admin-photo-description strong {
  display: block;
  overflow: hidden;
  font-size: 12px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-photo-description span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.admin-photo-actions {
  padding: 0 12px 13px;
}

.photo-rotate-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.photo-action-button {
  min-width: 0;
  padding: 9px 6px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line);
  font-size: 11px;
  font-weight: 700;
}

.photo-delete {
  margin-top: 9px;
  color: #7a3832;
  font-size: 12px;
}

.photo-delete summary {
  width: fit-content;
  cursor: pointer;
}

.photo-delete form {
  margin-top: 9px;
  padding: 10px;
  background: #f8ece9;
  border: 1px solid #edd1cc;
}

.photo-delete p {
  margin: 0 0 9px;
  line-height: 1.4;
}

.photo-delete-button {
  width: 100%;
  padding: 9px;
  background: #7a3832;
  border-color: #7a3832;
  font-size: 11px;
}

@media (max-width: 600px) {
  .admin-photo-grid {
    grid-template-columns:
      repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }

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

#photos {
  scroll-margin-top: 24px;
}

.upload-progress {
  margin-top: 22px;
  padding: 18px;
  background: #faf7f2;
  border: 1px solid var(--line);
  border-radius: 4px;
}

.upload-progress[hidden] {
  display: none;
}

.upload-progress-heading {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 12px;
}

.upload-progress-heading strong {
  font-size: 14px;
}

.upload-progress-heading span {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.upload-progress progress {
  width: 100%;
  height: 12px;
  display: block;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  appearance: none;
}

.upload-progress progress::-webkit-progress-bar {
  background: #e6ddd2;
  border-radius: 999px;
}

.upload-progress progress::-webkit-progress-value {
  background: var(--accent);
  border-radius: 999px;
}

.upload-progress progress::-moz-progress-bar {
  background: var(--accent);
  border-radius: 999px;
}

.upload-progress-error {
  color: #7a3832;
  background: #f8ece9;
  border-color: #edd1cc;
}

.photo-upload-form button:disabled {
  cursor: wait;
  opacity: 0.65;
}

@media (max-width: 600px) {
  .upload-progress-heading {
    flex-direction: column;
    gap: 5px;
  }

  .upload-progress-heading span {
    text-align: left;
  }
}

/* Galeria klienta — układ editorial masonry */

.client-gallery-summary {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.client-gallery-summary span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 13px;
  color: var(--muted);
  background: rgba(255, 253, 249, 0.75);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
}

.client-gallery-summary strong {
  color: var(--text);
}

.client-photo-section {
  padding-bottom: 90px;
}

.client-cover-photo {
  position: relative;
  width: 100%;
  min-height: 440px;
  max-height: 780px;
  display: block;
  overflow: hidden;
  background: #e8e1d9;
  border: 1px solid var(--line);
  text-decoration: none;
}

.client-cover-photo img {
  width: 100%;
  height: 100%;
  min-height: 440px;
  max-height: 780px;
  display: block;
  object-fit: cover;
  transition:
    transform 600ms ease,
    filter 600ms ease;
}

.client-cover-photo:hover img {
  transform: scale(1.015);
  filter: brightness(0.94);
}

.client-cover-caption {
  position: absolute;
  left: 34px;
  bottom: 32px;
  display: grid;
  gap: 5px;
  padding: 16px 19px;
  color: #ffffff;
  background: rgba(39, 34, 30, 0.48);
  backdrop-filter: blur(8px);
}

.client-cover-caption small {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.client-cover-caption strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(22px, 3vw, 34px);
  font-weight: 400;
}

.client-masonry-grid {
  margin-top: 16px;
  column-count: 3;
  column-gap: 16px;
}

.client-masonry-photo {
  position: relative;
  width: 100%;
  display: inline-block;
  margin: 0 0 16px;
  overflow: hidden;
  background: #e9e3dc;
  border: 1px solid var(--line);
  break-inside: avoid;
  text-decoration: none;
  vertical-align: top;
}

.client-masonry-photo img {
  width: 100%;
  height: auto;
  display: block;
  transition:
    transform 400ms ease,
    filter 400ms ease;
}

.client-masonry-photo:hover img {
  transform: scale(1.018);
  filter: brightness(0.94);
}

.client-photo-number {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: grid;
  min-width: 34px;
  height: 28px;
  padding: 0 8px;
  place-items: center;
  color: #ffffff;
  background: rgba(42, 37, 33, 0.58);
  border-radius: 999px;
  font-size: 10px;
  letter-spacing: 0.08em;
  backdrop-filter: blur(6px);
}

.client-footer {
  padding: 46px 0 30px;
  border-top: 1px solid var(--line);
  text-align: center;
}

.client-footer .brand-name {
  font-size: 28px;
}

.client-footer p {
  margin: 10px 0 0;
  color: var(--muted);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 13px;
  font-style: italic;
}

@media (max-width: 920px) {
  .client-masonry-grid {
    column-count: 2;
    column-gap: 12px;
  }

  .client-cover-photo,
  .client-cover-photo img {
    min-height: 390px;
  }
}

@media (max-width: 560px) {
  .client-page {
    width: min(100% - 20px, 1300px);
  }

  .client-hero {
    padding: 54px 0 38px;
  }

  .client-cover-photo,
  .client-cover-photo img {
    min-height: 320px;
    max-height: 520px;
  }

  .client-cover-caption {
    left: 15px;
    right: 15px;
    bottom: 15px;
    padding: 13px 15px;
  }

  .client-masonry-grid {
    margin-top: 8px;
    column-count: 2;
    column-gap: 8px;
  }

  .client-masonry-photo {
    margin-bottom: 8px;
  }

  .client-photo-number {
    right: 7px;
    bottom: 7px;
    min-width: 29px;
    height: 24px;
  }

  .client-photo-section {
    padding-bottom: 55px;
  }
}

@media (max-width: 380px) {
  .client-masonry-grid {
    column-count: 1;
  }
}

/* Pełnoekranowy podgląd zdjęć */

body.lightbox-open {
  overflow: hidden;
}

.client-lightbox[hidden] {
  display: none;
}

.client-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  grid-template-rows:
    minmax(0, 1fr)
    auto;
  padding: 64px 28px 20px;
  color: #ffffff;
  background: rgba(18, 16, 15, 0.97);
  backdrop-filter: blur(10px);
}

.client-lightbox-close {
  position: absolute;
  top: 18px;
  right: 22px;
  z-index: 3;
  width: 42px;
  height: 42px;
  display: grid;
  padding: 0;
  place-items: center;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 27px;
  font-weight: 300;
  line-height: 1;
}

.client-lightbox-stage {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns:
    54px
    minmax(0, 1fr)
    54px;
  align-items: center;
  gap: 18px;
}

.client-lightbox-image-area {
  position: relative;
  min-width: 0;
  min-height: 0;
  height: 100%;
  display: grid;
  place-items: center;
}

.client-lightbox-image-area img {
  position: relative;
  z-index: 1;
  max-width: 100%;
  max-height: calc(100vh - 130px);
  display: block;
  object-fit: contain;
  opacity: 1;
  transition: opacity 180ms ease;
}

.client-lightbox-loading
  .client-lightbox-image-area img {
  opacity: 0.2;
}

.client-lightbox-spinner {
  position: absolute;
  z-index: 0;
  width: 34px;
  height: 34px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: #ffffff;
  border-radius: 50%;
  opacity: 0;
  animation: twl-lightbox-spin 800ms linear infinite;
}

.client-lightbox-loading
  .client-lightbox-spinner {
  opacity: 1;
}

.client-lightbox-error
  .client-lightbox-image-area::after {
  content: "Nie udało się wczytać zdjęcia";
  position: absolute;
  color: rgba(255, 255, 255, 0.82);
  font-size: 14px;
}

@keyframes twl-lightbox-spin {
  to {
    transform: rotate(360deg);
  }
}

.client-lightbox-navigation {
  width: 50px;
  height: 50px;
  display: grid;
  padding: 0;
  place-items: center;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  font-size: 22px;
  font-weight: 300;
}

.client-lightbox-navigation:hover,
.client-lightbox-close:hover {
  background: rgba(255, 255, 255, 0.16);
  opacity: 1;
}

.client-lightbox-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding-top: 17px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
}

.client-lightbox-footer a {
  color: rgba(255, 255, 255, 0.86);
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.32);
}

@media (max-width: 700px) {
  .client-lightbox {
    padding:
      58px
      10px
      max(14px, env(safe-area-inset-bottom));
  }

  .client-lightbox-close {
    top: 10px;
    right: 12px;
    width: 39px;
    height: 39px;
  }

  .client-lightbox-stage {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .client-lightbox-image-area img {
    max-height: calc(100vh - 125px);
  }

  .client-lightbox-navigation {
    position: absolute;
    z-index: 2;
    top: 50%;
    width: 42px;
    height: 42px;
    transform: translateY(-50%);
    background: rgba(22, 19, 17, 0.55);
  }

  .client-lightbox-previous {
    left: 8px;
  }

  .client-lightbox-next {
    right: 8px;
  }

  .client-lightbox-footer {
    justify-content: space-between;
    gap: 14px;
    padding: 14px 8px 0;
  }
}

.photo-cover-form {
  margin-bottom: 8px;
}

.photo-cover-button {
  width: 100%;
  padding: 10px 8px;
  color: #ffffff;
  background: var(--accent);
  border-color: var(--accent);
  font-size: 11px;
}

.photo-cover-active {
  margin-bottom: 8px;
  padding: 10px 8px;
  color: #5d6c57;
  background: #edf3ea;
  border: 1px solid #d5e2d1;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Pobieranie pojedynczego zdjęcia */

.client-cover-wrap,
.client-masonry-item {
  position: relative;
}

.client-masonry-item {
  width: 100%;
  display: inline-block;
  margin: 0 0 16px;
  break-inside: avoid;
  vertical-align: top;
}

.client-masonry-item .client-masonry-photo {
  width: 100%;
  display: block;
  margin: 0;
  break-inside: auto;
}

.client-photo-download {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 5;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: #332d29;
  background: rgba(255, 253, 249, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 50%;
  box-shadow: 0 5px 18px rgba(30, 25, 21, 0.15);
  text-decoration: none;
  backdrop-filter: blur(8px);
  transition:
    transform 180ms ease,
    background 180ms ease;
}

.client-cover-download {
  top: 16px;
  right: 16px;
}

.client-photo-download:hover {
  color: #332d29;
  background: #ffffff;
  transform: translateY(-1px);
  opacity: 1;
}

.client-photo-download svg,
.client-lightbox-download svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.client-lightbox-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

.client-lightbox-download {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.client-lightbox-download[hidden] {
  display: none;
}

@media (max-width: 560px) {
  .client-masonry-item {
    margin-bottom: 8px;
  }

  .client-photo-download {
    top: 7px;
    right: 7px;
    width: 37px;
    height: 37px;
  }

  .client-cover-download {
    top: 11px;
    right: 11px;
  }

  .client-lightbox-actions {
    gap: 13px;
  }

  .client-lightbox-footer {
    font-size: 11px;
  }
}

/* Zaznaczanie kilku zdjęć */

.client-selection-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 16px;
}

.client-selection-start {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 11px 16px;
  color: var(--text);
  background: #fffdf9;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.client-selection-start svg,
.client-selection-download svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.client-photo-select[hidden],
.client-selection-bar[hidden],
.client-selection-start[hidden] {
  display: none;
}

.client-photo-select {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 7;
  width: 44px;
  height: 44px;
  display: grid;
  padding: 0;
  place-items: center;
  color: #332d29;
  background: rgba(255, 253, 249, 0.92);
  border: 2px solid rgba(255, 255, 255, 0.86);
  border-radius: 50%;
  box-shadow: 0 5px 18px rgba(30, 25, 21, 0.18);
  backdrop-filter: blur(8px);
}

.client-photo-select svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
}

.client-photo-select[aria-pressed="true"] {
  color: #ffffff;
  background: var(--accent);
  border-color: rgba(255, 255, 255, 0.95);
}

.client-photo-select[aria-pressed="true"] svg {
  opacity: 1;
}

.client-selection-mode
  .client-photo-download {
  pointer-events: none;
  opacity: 0;
}

.client-selection-mode
  [data-lightbox-photo] {
  cursor: pointer;
}

.client-photo-is-selected::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  border: 4px solid var(--accent);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.75);
}

.client-photo-is-selected
  [data-lightbox-photo]::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: rgba(58, 48, 40, 0.13);
}

.client-selection-bar {
  position: fixed;
  left: 50%;
  bottom: 20px;
  z-index: 8000;
  width: min(
    calc(100% - 32px),
    720px
  );
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 14px 16px 14px 20px;
  color: #ffffff;
  background: rgba(43, 38, 34, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  box-shadow:
    0 18px 55px rgba(20, 17, 15, 0.3);
  transform: translateX(-50%);
  backdrop-filter: blur(12px);
}

.client-selection-count {
  white-space: nowrap;
  font-size: 13px;
}

.client-selection-count strong {
  font-size: 18px;
}

.client-selection-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.client-selection-download,
.client-selection-cancel {
  min-height: 42px;
  padding: 10px 15px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
}

.client-selection-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #332d29;
  background: #fffdf9;
  border-color: #fffdf9;
}

.client-selection-download:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.client-selection-cancel {
  color: #ffffff;
  background: transparent;
  border-color: rgba(255, 255, 255, 0.3);
}

.client-selection-mode .client-page {
  padding-bottom: 110px;
}

@media (max-width: 560px) {
  .client-selection-toolbar {
    margin-bottom: 10px;
  }

  .client-selection-start {
    width: 100%;
    justify-content: center;
  }

  .client-photo-select {
    top: 7px;
    left: 7px;
    width: 39px;
    height: 39px;
  }

  .client-selection-bar {
    bottom:
      max(
        10px,
        env(safe-area-inset-bottom)
      );
    width: calc(100% - 20px);
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 13px;
  }

  .client-selection-count {
    text-align: center;
  }

  .client-selection-actions {
    display: grid;
    grid-template-columns:
      minmax(0, 1fr)
      auto;
  }

  .client-selection-download {
    min-width: 0;
  }
}

/* Pobieranie całej galerii */

.client-selection-toolbar {
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.client-download-all-form {
  margin: 0;
}

.client-download-all {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 11px 16px;
  color: #ffffff;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.client-download-all svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.client-download-all:hover {
  color: #ffffff;
  opacity: 0.88;
}

@media (max-width: 560px) {
  .client-download-all-form {
    width: 100%;
  }

  .client-download-all {
    width: 100%;
  }
}

/* Ustawienie znaku wodnego */

.admin-watermark-section {
  background:
    linear-gradient(
      135deg,
      #fbf8f3,
      #f6f0e8
    );
}

.admin-watermark-state {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.admin-watermark-state.is-enabled {
  color: #52644d;
  background: #eaf1e7;
  border: 1px solid #d1dfcc;
}

.admin-watermark-state.is-disabled {
  color: #7a6252;
  background: #f5e9df;
  border: 1px solid #e7d2c2;
}

.admin-watermark-button {
  margin-top: 16px;
  min-width: 210px;
}

/* Ustawienia galerii */

.admin-gallery-settings {
  scroll-margin-top: 24px;
}

.admin-gallery-status {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.admin-gallery-status.is-published {
  color: #52644d;
  background: #eaf1e7;
  border: 1px solid #d1dfcc;
}

.admin-gallery-status.is-hidden {
  color: #7a6252;
  background: #f5e9df;
  border: 1px solid #e7d2c2;
}

.gallery-settings-form {
  display: grid;
  grid-template-columns:
    repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 22px;
}

.gallery-settings-form .form-field {
  display: grid;
  align-content: start;
  gap: 8px;
}

.gallery-settings-form
  .form-field:first-of-type {
  grid-column: 1 / -1;
}

.gallery-settings-form
  .form-field > span {
  font-size: 12px;
  font-weight: 700;
}

.gallery-settings-form
  input[type="text"],
.gallery-settings-form
  input[type="date"],
.gallery-settings-form
  select {
  width: 100%;
  min-height: 46px;
  padding: 11px 13px;
  color: var(--text);
  background: #fffdf9;
  border: 1px solid var(--line);
  border-radius: 4px;
  font: inherit;
}

.gallery-settings-form
  .form-field small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.gallery-settings-checkbox {
  grid-column: 1 / -1;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  background: #faf7f2;
  border: 1px solid var(--line);
  border-radius: 4px;
  cursor: pointer;
}

.gallery-settings-checkbox input {
  width: 19px;
  height: 19px;
  margin-top: 2px;
  accent-color: var(--accent);
}

.gallery-settings-checkbox span {
  display: grid;
  gap: 4px;
}

.gallery-settings-checkbox strong {
  font-size: 13px;
}

.gallery-settings-checkbox small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.gallery-settings-warning {
  grid-column: 1 / -1;
  padding: 13px 15px;
  color: #715d4f;
  background: #f8efe6;
  border: 1px solid #ead8c8;
  border-radius: 4px;
  font-size: 11px;
  line-height: 1.55;
}

.gallery-settings-save {
  grid-column: 1 / -1;
  width: fit-content;
  min-width: 190px;
}

@media (max-width: 700px) {
  .gallery-settings-form {
    grid-template-columns: 1fr;
  }

  .gallery-settings-form
    .form-field:first-of-type,
  .gallery-settings-checkbox,
  .gallery-settings-warning,
  .gallery-settings-save {
    grid-column: auto;
  }

  .gallery-settings-save {
    width: 100%;
  }
}

/* Ważność galerii widoczna dla klienta */

.client-expiration-card {
  width: fit-content;
  max-width: 100%;
  display: flex;
  align-items: center;
  gap: 13px;
  margin: 18px auto 0;
  padding: 12px 16px;
  color: var(--text);
  background: rgba(255, 253, 249, 0.78);
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: left;
}

.client-expiration-card > svg {
  width: 23px;
  height: 23px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.client-expiration-card > div {
  display: grid;
  gap: 2px;
}

.client-expiration-card span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.client-expiration-card strong {
  font-size: 13px;
}

.client-expiration-card small {
  color: var(--muted);
  font-size: 10px;
}

.client-expiration-card.is-active {
  color: #52644d;
  background: rgba(239, 245, 236, 0.88);
  border-color: #d1dfcc;
}

.client-expiration-card.is-ending {
  color: #7a5144;
  background: rgba(249, 235, 229, 0.9);
  border-color: #e8cec4;
}

.client-expiration-card.is-unlimited {
  color: #695d52;
}

@media (max-width: 560px) {
  .client-expiration-card {
    width: 100%;
    justify-content: center;
    padding: 12px 14px;
  }
}

/* Zarządzanie dostępem klienta */

.admin-gallery-access {
  scroll-margin-top: 24px;
  background:
    linear-gradient(
      135deg,
      #fbf8f3,
      #f7f1e9
    );
}

.gallery-access-link,
.access-result-field {
  display: grid;
  gap: 8px;
  margin-top: 20px;
}

.gallery-access-link label,
.access-result-field label {
  font-size: 12px;
  font-weight: 700;
}

.gallery-access-copy-row {
  display: grid;
  grid-template-columns:
    minmax(0, 1fr)
    auto;
  gap: 8px;
}

.gallery-access-copy-row input {
  min-width: 0;
  min-height: 46px;
  padding: 11px 13px;
  color: var(--text);
  background: #fffdf9;
  border: 1px solid var(--line);
  border-radius: 4px;
  font: inherit;
}

.gallery-copy-button {
  min-width: 112px;
  padding: 10px 15px;
  white-space: nowrap;
}

.gallery-copy-button.is-copied {
  background: #60725a;
  border-color: #60725a;
}

.gallery-access-information,
.access-result-security {
  margin-top: 18px;
  padding: 15px 16px;
  background: #fffdf9;
  border: 1px solid var(--line);
  border-radius: 4px;
}

.gallery-access-information strong,
.access-result-security strong {
  font-size: 13px;
}

.gallery-access-information p,
.access-result-security p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.gallery-access-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.gallery-access-actions form {
  margin: 0;
}

.gallery-access-regenerate {
  background: var(--accent);
  border-color: var(--accent);
}

.gallery-access-logout {
  color: #76554b;
  background: #fffaf6;
  border-color: #dfc9bf;
}

.gallery-access-note {
  margin: 15px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.access-result-page {
  width: min(100% - 32px, 720px);
  min-height: 100vh;
  display: grid;
  margin: 0 auto;
  padding: 40px 0;
  place-items: center;
}

.access-result-card {
  width: 100%;
  padding: clamp(26px, 5vw, 48px);
  background: #fffdf9;
  border: 1px solid var(--line);
  box-shadow:
    0 22px 70px rgba(42, 35, 30, 0.12);
}

.access-result-card h1 {
  margin: 10px 0 0;
}

.access-result-intro {
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

#new-gallery-code {
  font-family:
    Consolas,
    "Courier New",
    monospace;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-align: center;
}

.access-result-security {
  color: #52644d;
  background: #eef4eb;
  border-color: #d1dfcc;
}

.access-result-return {
  width: fit-content;
  display: inline-flex;
  margin-top: 22px;
  padding: 12px 18px;
  color: #ffffff;
  background: var(--accent);
  border-radius: 4px;
  text-decoration: none;
}

@media (max-width: 600px) {
  .gallery-access-copy-row {
    grid-template-columns: 1fr;
  }

  .gallery-copy-button,
  .gallery-access-actions form,
  .gallery-access-actions button {
    width: 100%;
  }

  .access-result-page {
    width: min(100% - 20px, 720px);
    padding: 18px 0;
  }
}

/* Wybór zdjęć do obróbki */

.client-favorite-panel {
  margin-bottom: 18px;
  padding: 18px;
  background: linear-gradient(135deg, #fffaf5, #f8efe7);
  border: 1px solid #e8d8ca;
  border-radius: 8px;
}

.client-favorite-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.client-favorite-heading > div:first-child {
  display: grid;
  gap: 3px;
}

.client-favorite-heading span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.client-favorite-heading strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 19px;
  font-weight: 400;
}

.client-favorite-counter {
  min-width: 78px;
  display: grid;
  padding: 9px 12px;
  background: #fffdf9;
  border: 1px solid var(--line);
  border-radius: 7px;
  text-align: center;
}

.client-favorite-counter strong {
  font-family: inherit;
  font-size: 21px;
  font-weight: 700;
}

.client-favorite-counter span {
  font-size: 8px;
}

.client-favorite-panel > p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.client-favorite-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 13px;
  margin-top: 15px;
}

.client-favorite-actions button {
  padding: 11px 16px;
}

.client-favorite-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.client-favorite-status {
  color: var(--muted);
  font-size: 11px;
}

.client-favorite-status.is-success {
  color: #52644d;
}

.client-favorite-status.is-error {
  color: #8a443b;
}

.client-favorite-panel.is-submitted {
  background: #eef4eb;
  border-color: #d1dfcc;
}

.client-favorite-button {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 6;
  width: 43px;
  height: 43px;
  display: grid;
  padding: 0;
  place-items: center;
  color: #4e433c;
  background: rgba(255, 253, 249, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  box-shadow: 0 5px 18px rgba(30, 25, 21, 0.16);
  backdrop-filter: blur(8px);
}

.client-favorite-button svg {
  width: 20px;
  height: 20px;
  fill: transparent;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.client-favorite-button.is-selected {
  color: #ffffff;
  background: #9c665e;
  border-color: #ffffff;
}

.client-favorite-button.is-selected svg {
  fill: currentColor;
}

.client-selection-mode .client-favorite-button {
  pointer-events: none;
  opacity: 0;
}

.admin-client-selection {
  scroll-margin-top: 24px;
}

.admin-selection-state {
  display: inline-flex;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.admin-selection-state.is-submitted {
  color: #52644d;
  background: #eaf1e7;
  border: 1px solid #d1dfcc;
}

.admin-selection-state.is-draft {
  color: #745f4f;
  background: #f6eadf;
  border: 1px solid #e5d1c1;
}

.admin-selection-summary {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 17px;
}

.admin-selection-summary > strong {
  font-size: 28px;
}

.admin-selection-summary > small {
  width: 100%;
  color: var(--muted);
  font-size: 11px;
}

.admin-selection-grid {
  display: grid;
  grid-template-columns:
    repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.admin-selection-photo {
  overflow: hidden;
  background: #faf7f2;
  border: 1px solid var(--line);
  border-radius: 4px;
}

.admin-selection-photo img {
  width: 100%;
  aspect-ratio: 1 / 1;
  display: block;
  object-fit: contain;
  background: #eae5de;
}

.admin-selection-photo > div {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 10px;
}

.admin-selection-photo span {
  color: var(--muted);
  font-size: 10px;
}

.admin-selection-photo strong {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-selection-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 18px;
}

.admin-selection-actions form {
  margin: 0;
}

.admin-selection-download {
  display: inline-flex;
  padding: 11px 15px;
  color: #ffffff;
  background: var(--accent);
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.admin-selection-clear {
  color: #76554b;
  background: #fffaf6;
  border-color: #dfc9bf;
}

.admin-selection-empty {
  margin-top: 17px;
  padding: 18px;
  color: var(--muted);
  background: #faf7f2;
  border: 1px dashed var(--line);
  text-align: center;
}

@media (max-width: 560px) {
  .client-favorite-heading {
    align-items: flex-start;
  }

  .client-favorite-button {
    top: 7px;
    left: 7px;
    width: 39px;
    height: 39px;
  }

  .client-favorite-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .client-favorite-actions button,
  .admin-selection-actions,
  .admin-selection-actions form,
  .admin-selection-actions button,
  .admin-selection-download {
    width: 100%;
  }

  .admin-selection-download {
    justify-content: center;
  }
}

/* Wiadomość do wyboru klienta */

.client-selection-note {
  display: grid;
  gap: 7px;
  margin-top: 16px;
}

.client-selection-note > span {
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.client-selection-note textarea {
  width: 100%;
  min-height: 105px;
  padding: 12px 13px;
  resize: vertical;
  color: var(--text);
  background: #fffdf9;
  border: 1px solid var(--line);
  border-radius: 5px;
  font: inherit;
  font-size: 12px;
  line-height: 1.55;
}

.client-selection-note textarea:focus {
  border-color: var(--accent);
  outline: 2px solid rgba(130, 105, 87, 0.12);
}

.client-selection-note textarea:disabled {
  resize: none;
  opacity: 0.75;
}

.client-selection-note small {
  color: var(--muted);
  font-size: 9px;
}

.admin-selection-note {
  margin-top: 18px;
  padding: 16px;
  background: #fffaf5;
  border: 1px solid #e8d8ca;
  border-radius: 5px;
}

.admin-selection-note span {
  color: #796355;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.admin-selection-note p {
  margin: 8px 0 0;
  white-space: pre-wrap;
  color: var(--text);
  font-size: 12px;
  line-height: 1.65;
}

/* Uwagi do pojedynczych zdjęć */

.client-photo-note-button {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 6;
  width: 43px;
  height: 43px;
  display: grid;
  padding: 0;
  place-items: center;
  color: #4e433c;
  background: rgba(255, 253, 249, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  box-shadow:
    0 5px 18px rgba(30, 25, 21, 0.16);
  backdrop-filter: blur(8px);
}

.client-photo-note-button.is-hidden {
  display: none;
}

.client-photo-note-button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.client-photo-note-button.has-note {
  color: #ffffff;
  background: #8b6a58;
}

.client-photo-note-button.has-note::after {
  content: "";
  position: absolute;
  top: 1px;
  right: 1px;
  width: 9px;
  height: 9px;
  background: #c48e75;
  border: 2px solid #ffffff;
  border-radius: 50%;
}

.client-photo-note-modal[hidden] {
  display: none;
}

.client-photo-note-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  padding: 20px;
  place-items: center;
}

.client-photo-note-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(25, 21, 18, 0.68);
  backdrop-filter: blur(4px);
}

.client-photo-note-dialog {
  position: relative;
  z-index: 1;
  width: min(100%, 500px);
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: 28px;
  background: #fffdf9;
  border: 1px solid #e4d8cd;
  border-radius: 8px;
  box-shadow:
    0 24px 80px rgba(20, 16, 13, 0.28);
}

.client-photo-note-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 36px;
  height: 36px;
  padding: 0;
  color: var(--muted);
  background: transparent;
  border: 0;
  font-size: 28px;
  font-weight: 300;
}

.client-photo-note-dialog h2 {
  margin: 5px 42px 0 0;
  font-family:
    Georgia,
    "Times New Roman",
    serif;
  font-size: 24px;
  font-weight: 400;
}

.client-photo-note-name {
  margin: 7px 0 20px;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 11px;
}

.client-photo-note-dialog label {
  display: grid;
  gap: 8px;
}

.client-photo-note-dialog label > span {
  font-size: 11px;
  font-weight: 700;
}

.client-photo-note-dialog textarea {
  width: 100%;
  min-height: 130px;
  padding: 13px;
  resize: vertical;
  color: var(--text);
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 5px;
  font: inherit;
  font-size: 12px;
  line-height: 1.6;
}

.client-photo-note-dialog textarea:focus {
  border-color: var(--accent);
  outline:
    2px solid
    rgba(130, 105, 87, 0.12);
}

.client-photo-note-dialog textarea:disabled {
  resize: none;
  background: #f5f1eb;
}

.client-photo-note-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 7px;
}

.client-photo-note-footer small,
.client-photo-note-status {
  color: var(--muted);
  font-size: 9px;
}

.client-photo-note-status.is-success {
  color: #52644d;
}

.client-photo-note-status.is-error {
  color: #8a443b;
}

.client-photo-note-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 20px;
}

.client-photo-note-cancel {
  color: var(--text);
  background: transparent;
  border: 1px solid var(--line);
}

.client-photo-note-save {
  color: #ffffff;
  background: var(--accent);
}

.client-note-modal-open {
  overflow: hidden;
}

.admin-selection-photo-note {
  grid-column: 1 / -1;
  display: grid;
  gap: 5px;
  margin: 3px 0 0;
  padding: 9px;
  color: var(--text);
  background: #fffaf5;
  border: 1px solid #eadbd0;
  border-radius: 4px;
  white-space: pre-wrap;
}

.admin-selection-photo-note em {
  color: #806858;
  font-size: 8px;
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.admin-selection-photo-note span {
  color: var(--text);
  font-size: 10px;
  line-height: 1.5;
}

@media (max-width: 560px) {
  .client-photo-note-button {
    top: 7px;
    right: 7px;
    width: 39px;
    height: 39px;
  }

  .client-photo-note-modal {
    padding: 12px;
  }

  .client-photo-note-dialog {
    padding: 23px 18px 18px;
  }

  .client-photo-note-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .client-photo-note-actions button {
    width: 100%;
  }
}

/* Korekta pozycji ikony uwagi */

.client-photo-note-button {
  top: 64px;
  right: auto;
  left: 12px;
}

.client-selection-mode
  .client-photo-note-button {
  pointer-events: none;
  opacity: 0;
}

@media (max-width: 560px) {
  .client-photo-note-button {
    top: 53px;
    right: auto;
    left: 7px;
  }
}


/* Ustawienia pakietu galerii */

.gallery-package-settings {
  display: grid;
  gap: 16px;
  margin-top: 8px;
  padding: 18px;
  background: #faf7f2;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.gallery-package-heading {
  display: grid;
  gap: 4px;
  padding-bottom: 13px;
  border-bottom: 1px solid var(--line);
}

.gallery-package-heading > span {
  font-family:
    Georgia,
    "Times New Roman",
    serif;
  font-size: 18px;
}

.gallery-package-heading > small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.gallery-price-field {
  display: grid;
  grid-template-columns:
    minmax(0, 1fr)
    auto;
  align-items: center;
  gap: 9px;
}

.gallery-price-field > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

@media (max-width: 560px) {
  .gallery-package-settings {
    padding: 15px;
  }
}

/* Pakiet w galerii klienta */

.client-package-card {
  display: grid;
  gap: 10px;
  margin-top: 16px;
  padding: 15px;
  background: #fffdf9;
  border: 1px solid #dfd3c8;
  border-radius: 6px;
}

.client-package-name {
  color: #7b6253;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.client-package-card > p {
  margin: 0;
  color: var(--text);
  font-size: 12px;
}

.client-package-card > p strong {
  font-size: 14px;
}

.client-package-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.client-package-row > span {
  color: var(--muted);
  font-size: 10px;
}

.client-package-row > strong {
  font-size: 13px;
}

.client-package-extra {
  color: #765244;
}

.client-package-extra > span,
.client-package-extra > strong {
  color: inherit;
}

.client-package-extra[hidden] {
  display: none;
}

.client-package-card > small {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.55;
}

@media (max-width: 560px) {
  .client-package-card {
    padding: 13px;
  }
}

/* Oznaczenia zdjęć dodatkowych */

.admin-package-summary {
  display: grid;
  grid-template-columns:
    repeat(
      auto-fit,
      minmax(150px, 1fr)
    );
  gap: 10px;
  margin-top: 16px;
}

.admin-package-summary > div {
  display: grid;
  gap: 5px;
  padding: 13px;
  background: #faf7f2;
  border: 1px solid var(--line);
  border-radius: 5px;
}

.admin-package-summary span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.admin-package-summary strong {
  font-size: 16px;
}

.admin-package-summary .has-extra {
  color: #765244;
  background: #fff4ec;
  border-color: #e6cdbd;
}

.admin-package-summary .has-extra span {
  color: inherit;
}

.admin-package-summary
  .admin-package-total {
  background: #f3eee8;
}

.admin-package-total small {
  color: var(--muted);
  font-size: 9px;
}

.admin-selection-photo {
  position: relative;
}

.admin-extra-photo-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
  padding: 6px 8px;
  color: #ffffff;
  background: rgba(118, 82, 68, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 999px;
  box-shadow:
    0 4px 14px
    rgba(35, 26, 22, 0.2);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.07em;
  line-height: 1;
  text-transform: uppercase;
}

@media (max-width: 560px) {
  .admin-package-summary {
    grid-template-columns: 1fr;
  }

  .admin-extra-photo-badge {
    top: 6px;
    right: 6px;
  }
}

/* Czytelniejsza etykieta zdjęcia dodatkowego */

.admin-extra-photo-badge {
  top: 10px;
  right: 10px;
  padding: 8px 11px;
  color: #ffffff;
  background: #5b3c32;
  border: 2px solid #ffffff;
  border-radius: 5px;
  box-shadow:
    0 5px 18px rgba(25, 18, 15, 0.38);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.2;
  text-align: center;
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.3);
  white-space: nowrap;
}

@media (max-width: 560px) {
  .admin-extra-photo-badge {
    top: 7px;
    right: 7px;
    padding: 7px 9px;
    font-size: 9px;
  }
}

/* Delikatna i czytelna etykieta zdjęcia dodatkowego */

.admin-extra-photo-badge {
  top: 8px;
  right: 8px;
  padding: 6px 9px;
  color: #ffffff;
  background: rgba(91, 60, 50, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 999px;
  box-shadow:
    0 4px 12px rgba(35, 25, 21, 0.28);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.05em;
  line-height: 1;
  text-shadow: none;
  white-space: nowrap;
}

@media (max-width: 560px) {
  .admin-extra-photo-badge {
    top: 6px;
    right: 6px;
    padding: 6px 8px;
    font-size: 8px;
  }
}

/* Wymuszenie czytelnego tekstu etykiety */

.admin-selection-photo .admin-extra-photo-badge {
  color: #ffffff;
  background: rgba(91, 60, 50, 0.96);
  font-weight: 700;
  opacity: 1;
}


/* Status kopii zapasowej */

.backup-status-card {
  border-left: 4px solid #9e9a94;
}

.backup-status-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.backup-status-header h2 {
  margin-bottom: 0;
}

.backup-status-badge {
  flex: 0 0 auto;
  padding: 7px 11px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1;
  text-transform: uppercase;
}

.backup-status-description {
  margin: 16px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.backup-status-grid {
  display: grid;
  grid-template-columns:
    repeat(
      auto-fit,
      minmax(160px, 1fr)
    );
  gap: 10px;
  margin-top: 18px;
}

.backup-status-grid > div {
  display: grid;
  gap: 5px;
  padding: 13px;
  background: #faf7f2;
  border: 1px solid var(--line);
  border-radius: 5px;
}

.backup-status-grid span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.backup-status-grid strong {
  font-size: 14px;
  line-height: 1.4;
}

.backup-status-healthy {
  border-left-color: #72866b;
}

.backup-status-healthy .backup-status-badge {
  color: #486242;
  background: #f0f5ee;
}

.backup-status-warning {
  border-left-color: #b28a4c;
}

.backup-status-warning .backup-status-badge {
  color: #76591f;
  background: #fff8e8;
}

.backup-status-stale {
  border-left-color: #a35e55;
}

.backup-status-stale .backup-status-badge {
  color: #7b3932;
  background: #fff0ee;
}

.backup-status-unknown {
  border-left-color: #9e9a94;
}

.backup-status-unknown .backup-status-badge {
  color: #66615c;
  background: #f5f2ee;
}

@media (max-width: 560px) {
  .backup-status-header {
    display: grid;
  }

  .backup-status-badge {
    justify-self: start;
  }

  .backup-status-grid {
    grid-template-columns: 1fr;
  }
}


/* Ostrzeżenie o miejscu na NAS */

.backup-status-grid small {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.4;
}

.backup-status-grid
  .backup-storage-warning {
  background: #fff8e8;
  border-color: #d8bd82;
}

.backup-status-grid
  .backup-storage-critical {
  color: #7b3932;
  background: #fff0ee;
  border-color: #d5a39e;
}

.backup-storage-critical span,
.backup-storage-critical small {
  color: inherit;
}


/* Wygasłe galerie */

.gallery-row-expired {
  border-left: 4px solid #a35e55;
}

.status-badge-expired {
  color: #7b3932;
  background: #fff0ee;
  border-color: #d5a39e;
}

.gallery-expired-note {
  display: block;
  margin-top: 6px;
  color: #8a4a43;
  font-size: 9px;
  line-height: 1.5;
}

.gallery-expiration-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.gallery-expiration-actions > span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.gallery-expiration-actions form {
  margin: 0;
}

.gallery-expiration-button {
  min-height: 32px;
  padding: 7px 10px;
  color: #5b463c;
  background: #faf7f2;
  border: 1px solid var(--line);
  border-radius: 5px;
  cursor: pointer;
  font: inherit;
  font-size: 10px;
  font-weight: 700;
}

.gallery-expiration-button:hover,
.gallery-expiration-button:focus-visible {
  background: #f3ece5;
  border-color: #b9a99d;
}

@media (max-width: 560px) {
  .gallery-expiration-actions {
    width: 100%;
  }

  .gallery-expiration-button {
    min-height: 36px;
  }
}


/* Galerie wygasające wkrótce */

.gallery-row-expiring {
  border-left: 4px solid #c49443;
}

.status-badge-expiring {
  color: #725313;
  background: #fff8e8;
  border-color: #d8bd82;
}

.gallery-expiring-note {
  display: block;
  margin-top: 6px;
  color: #80601e;
  font-size: 9px;
  font-weight: 700;
  line-height: 1.5;
}


/* Wyszukiwanie i filtry galerii */

.gallery-filter-section {
  display: grid;
  gap: 22px;
}

.gallery-filter-toolbar {
  display: grid;
  gap: 16px;
}

.gallery-filter-search {
  display: grid;
  gap: 8px;
}

.gallery-filter-search span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.gallery-filter-search input {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
  font: inherit;
}

.gallery-filter-search input:focus {
  border-color: #a88f7b;
  outline: 2px solid rgba(168, 143, 123, 0.18);
  outline-offset: 1px;
}

.gallery-filter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.gallery-filter-button,
.gallery-filter-clear {
  min-height: 36px;
  padding: 8px 12px;
  color: #5b463c;
  background: #faf7f2;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
}

.gallery-filter-button:hover,
.gallery-filter-button:focus-visible,
.gallery-filter-clear:hover,
.gallery-filter-clear:focus-visible {
  background: #f3ece5;
  border-color: #b9a99d;
}

.gallery-filter-button.is-active {
  color: #fff;
  background: var(--text);
  border-color: var(--text);
}

.gallery-filter-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: var(--muted);
  font-size: 12px;
}

.gallery-filter-clear {
  min-height: 32px;
  padding: 6px 11px;
}

.gallery-filter-empty {
  padding: 24px;
  color: var(--muted);
  background: #faf7f2;
  border: 1px dashed var(--line);
  text-align: center;
}

[data-gallery-item][hidden],
section[hidden] {
  display: none !important;
}

@media (max-width: 620px) {
  .gallery-filter-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }

  .gallery-filter-button {
    width: 100%;
  }

  .gallery-filter-summary {
    align-items: flex-start;
    flex-direction: column;
  }
}


/* Podsumowanie galerii */

.gallery-row-summary {
  display: grid;
  grid-template-columns:
    repeat(2, minmax(120px, 1fr));
  gap: 8px;
  margin: 8px 0;
}

.gallery-summary-item {
  display: grid;
  align-content: start;
  gap: 4px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid var(--line);
  border-radius: 4px;
}

.gallery-summary-item > span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.gallery-summary-item > strong {
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.gallery-selection-state {
  justify-self: start;
  padding: 3px 6px;
  border-radius: 999px;
  font-size: 8px;
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.gallery-selection-none {
  color: #6f6964;
  background: #eeeae5;
}

.gallery-selection-draft {
  color: #725313;
  background: #fff2cf;
}

.gallery-selection-submitted {
  color: #416148;
  background: #e5f1e7;
}

@media (max-width: 560px) {
  .gallery-row-summary {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 380px) {
  .gallery-row-summary {
    grid-template-columns: 1fr;
  }
}


/* Etapy realizacji — szczegóły */

.gallery-workflow-section {
  border-left: 3px solid #b9aa96;
}

.gallery-workflow-form {
  display: grid;
  grid-template-columns:
    minmax(220px, 1fr) auto;
  align-items: end;
  gap: 16px;
}

.gallery-workflow-submit {
  min-height: 44px;
  white-space: nowrap;
}

.gallery-workflow-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  padding: 5px 9px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.2;
  text-transform: uppercase;
}

.gallery-workflow-preparation {
  color: #625b55;
  background: #eeebe7;
  border-color: #d8d1ca;
}

.gallery-workflow-awaiting_selection {
  color: #725313;
  background: #fff2cf;
  border-color: #ead49b;
}

.gallery-workflow-selected {
  color: #365d65;
  background: #e2f0f2;
  border-color: #bdd8dc;
}

.gallery-workflow-editing {
  color: #5c4e75;
  background: #eee9f5;
  border-color: #d2c7e2;
}

.gallery-workflow-ready {
  color: #416148;
  background: #e5f1e7;
  border-color: #c1d9c5;
}

.gallery-workflow-delivered {
  color: #614d3c;
  background: #eee5dc;
  border-color: #d8c5b3;
}

.gallery-workflow-submit:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

@media (max-width: 700px) {
  .gallery-workflow-form {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .gallery-workflow-submit {
    width: 100%;
  }
}


/* Filtr etapów realizacji */

.gallery-filter-workflow {
  display: grid;
  gap: 6px;
  min-width: 220px;
}

.gallery-filter-workflow > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.gallery-filter-workflow select {
  width: 100%;
  min-height: 44px;
  padding: 9px 34px 9px 11px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
  font: inherit;
}

.gallery-filter-workflow select:focus {
  outline: 2px solid
    rgba(158, 154, 148, 0.35);
  outline-offset: 2px;
}

.gallery-main .gallery-workflow-badge {
  margin-top: 7px;
}

@media (max-width: 700px) {
  .gallery-filter-workflow {
    width: 100%;
    min-width: 0;
  }
}


/* Wgrywanie całego katalogu */

.photo-folder-hint {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.photo-upload-selection-summary {
  grid-column: 1 / -1;
  margin: 0;
  padding: 10px 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 13px;
  line-height: 1.5;
}

.photo-upload-selection-warning {
  color: #7b4f18;
  background: #fff3d7;
  border-color: #e4c98d;
}


/* Uporządkowane wgrywanie zdjęć v2 */

.photo-upload-form {
  display: grid;
  gap: 18px;
}

.photo-upload-options {
  display: grid;
  grid-template-columns:
    repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.photo-upload-picker {
  position: relative;
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 170px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--line);
  border-radius: 5px;
  cursor: pointer;
  transition:
    border-color 160ms ease,
    background-color 160ms ease,
    transform 160ms ease;
}

.photo-upload-picker:hover {
  background: #fff;
  border-color: #b9a78f;
  transform: translateY(-1px);
}

.photo-upload-picker:focus-within {
  border-color: #9e856b;
  box-shadow:
    0 0 0 3px
    rgba(158, 133, 107, 0.14);
}

.photo-upload-picker-title {
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
}

.photo-upload-picker-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 42px;
  padding: 9px 18px;
  color: #fff;
  background: #332e2a;
  border: 1px solid #332e2a;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 700;
}

.photo-upload-picker-status {
  color: #74675d;
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.photo-upload-picker-hint {
  margin-top: auto;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.photo-upload-hidden-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.photo-upload-footer {
  display: grid;
  grid-template-columns:
    minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
}

.photo-upload-selection-summary {
  width: 100%;
  min-height: 48px;
  margin: 0;
  padding: 12px 14px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 13px;
  line-height: 1.55;
}

.photo-upload-selection-warning {
  color: #7b4f18;
  background: #fff3d7;
  border-color: #e4c98d;
}

.photo-upload-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.photo-upload-clear-button,
.photo-upload-submit-button {
  min-height: 48px;
  padding: 10px 19px;
  border-radius: 4px;
  font: inherit;
  font-weight: 700;
  white-space: nowrap;
}

.photo-upload-clear-button {
  color: #4f4741;
  background: transparent;
  border: 1px solid #bdb2a8;
}

.photo-upload-clear-button:hover {
  background: #f2ede7;
}

.photo-upload-submit-button {
  color: #fff;
  background: #332e2a;
  border: 1px solid #332e2a;
}

.photo-upload-submit-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

@media (max-width: 820px) {
  .photo-upload-options {
    grid-template-columns: 1fr;
  }

  .photo-upload-picker {
    min-height: 150px;
  }

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

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

  .photo-upload-clear-button,
  .photo-upload-submit-button {
    width: 100%;
  }
}

/* Vertical cover crop */
.photo-cover-crop-form {
  display: grid;
  gap: 11px;
  width: 100%;
  margin-top: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 253, 249, 0.72);
}

.photo-cover-crop-preview {
  width: 100%;
  aspect-ratio: 16 / 7;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #e8e1d9;
}

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

.photo-cover-crop-control {
  display: grid;
  gap: 6px;
}

.photo-cover-crop-control > span {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  font-size: 12px;
}

.photo-cover-crop-control output {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.photo-cover-crop-control input[type="range"] {
  width: 100%;
}

.photo-cover-crop-help {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.photo-cover-crop-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.photo-cover-crop-actions button {
  flex: 1 1 120px;
}

/* Cover crop modal — start */

/*
 * Formularz jest domyślnie ukryty.
 * Przycisk otwierający tworzy JavaScript.
 */
[data-cover-crop-form] {
  display: none;
}

.photo-cover-crop-open {
  width: 100%;
  min-height: 32px;
  padding: 7px 10px;
  border: 1px solid #b99673;
  border-radius: 2px;
  color: #ffffff;
  background: #b99673;
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 160ms ease,
    border-color 160ms ease;
}

.photo-cover-crop-open:hover {
  border-color: #9f7c59;
  background: #9f7c59;
}

body.cover-crop-modal-open {
  overflow: hidden;
}

.photo-cover-crop-form.photo-cover-crop-modal:not([hidden]) {
  position: fixed;
  inset: 0;
  z-index: 10000;
  width: auto;
  height: auto;
  margin: 0;
  padding: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  border: 0;
  background: rgba(36, 30, 26, 0.68);
  opacity: 0;
  transition: opacity 180ms ease;
}

.photo-cover-crop-form.photo-cover-crop-modal.is-open {
  opacity: 1;
}

.photo-cover-crop-modal-panel {
  width: min(760px, 100%);
  max-height: calc(100vh - 44px);
  padding: 24px;
  display: grid;
  gap: 17px;
  overflow-y: auto;
  border: 1px solid rgba(185, 150, 115, 0.42);
  border-radius: 4px;
  background: #fffdf9;
  box-shadow:
    0 24px 70px rgba(29, 23, 19, 0.3);
  transform: translateY(10px) scale(0.985);
  transition: transform 180ms ease;
}

.photo-cover-crop-modal.is-open
.photo-cover-crop-modal-panel {
  transform: translateY(0) scale(1);
}

.photo-cover-crop-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 22px;
}

.photo-cover-crop-modal-heading {
  display: grid;
  gap: 4px;
}

.photo-cover-crop-modal-heading span {
  color: #a77f5b;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.photo-cover-crop-modal-heading h3 {
  margin: 0;
  color: var(--text);
  font-family:
    Georgia,
    "Times New Roman",
    serif;
  font-size: clamp(21px, 3vw, 28px);
  font-weight: 400;
}

.photo-cover-crop-modal-close {
  flex: 0 0 auto;
  width: 35px;
  height: 35px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--text);
  background: transparent;
  font-size: 25px;
  line-height: 1;
  cursor: pointer;
}

.photo-cover-crop-modal-close:hover {
  background: #f2ece5;
}

.photo-cover-crop-modal
.photo-cover-crop-preview {
  width: 100%;
  aspect-ratio: 16 / 7;
  max-height: 52vh;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #e8e1d9;
}

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

.photo-cover-crop-modal
.photo-cover-crop-control {
  display: grid;
  gap: 9px;
}

.photo-cover-crop-modal
.photo-cover-crop-control > span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--text);
  font-size: 13px;
}

.photo-cover-crop-modal
.photo-cover-crop-control output {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.photo-cover-crop-modal
.photo-cover-crop-control input[type="range"] {
  width: 100%;
  cursor: pointer;
}

.photo-cover-crop-modal
.photo-cover-crop-help {
  margin: -5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.photo-cover-crop-modal
.photo-cover-crop-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
}

.photo-cover-crop-modal
.photo-cover-crop-actions button {
  flex: 0 1 auto;
  min-width: 125px;
}

.photo-cover-crop-modal
.photo-cover-crop-actions
.photo-cover-crop-cancel {
  order: 2;
}

.photo-cover-crop-modal
.photo-cover-crop-actions
button[type="submit"] {
  order: 3;
}

.photo-cover-crop-modal
.photo-cover-crop-actions
[data-cover-crop-reset] {
  order: 1;
  margin-right: auto;
}

@media (max-width: 600px) {
  .photo-cover-crop-form.photo-cover-crop-modal:not([hidden]) {
    align-items: flex-end;
    padding: 10px;
  }

  .photo-cover-crop-modal-panel {
    max-height: calc(100vh - 20px);
    padding: 18px;
    gap: 14px;
  }

  .photo-cover-crop-modal
  .photo-cover-crop-preview {
    aspect-ratio: 4 / 3;
    max-height: 45vh;
  }

  .photo-cover-crop-modal
  .photo-cover-crop-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .photo-cover-crop-modal
  .photo-cover-crop-actions button {
    width: 100%;
    min-width: 0;
  }

  .photo-cover-crop-modal
  .photo-cover-crop-actions
  [data-cover-crop-reset] {
    grid-column: 1 / -1;
    margin-right: 0;
  }
}

/* Cover crop modal — end */

/* Client cover positions — start */

.client-cover-photo img.cover-position-y-0 {
  object-position: 50% 0%;
}

.client-cover-photo img.cover-position-y-1 {
  object-position: 50% 1%;
}

.client-cover-photo img.cover-position-y-2 {
  object-position: 50% 2%;
}

.client-cover-photo img.cover-position-y-3 {
  object-position: 50% 3%;
}

.client-cover-photo img.cover-position-y-4 {
  object-position: 50% 4%;
}

.client-cover-photo img.cover-position-y-5 {
  object-position: 50% 5%;
}

.client-cover-photo img.cover-position-y-6 {
  object-position: 50% 6%;
}

.client-cover-photo img.cover-position-y-7 {
  object-position: 50% 7%;
}

.client-cover-photo img.cover-position-y-8 {
  object-position: 50% 8%;
}

.client-cover-photo img.cover-position-y-9 {
  object-position: 50% 9%;
}

.client-cover-photo img.cover-position-y-10 {
  object-position: 50% 10%;
}

.client-cover-photo img.cover-position-y-11 {
  object-position: 50% 11%;
}

.client-cover-photo img.cover-position-y-12 {
  object-position: 50% 12%;
}

.client-cover-photo img.cover-position-y-13 {
  object-position: 50% 13%;
}

.client-cover-photo img.cover-position-y-14 {
  object-position: 50% 14%;
}

.client-cover-photo img.cover-position-y-15 {
  object-position: 50% 15%;
}

.client-cover-photo img.cover-position-y-16 {
  object-position: 50% 16%;
}

.client-cover-photo img.cover-position-y-17 {
  object-position: 50% 17%;
}

.client-cover-photo img.cover-position-y-18 {
  object-position: 50% 18%;
}

.client-cover-photo img.cover-position-y-19 {
  object-position: 50% 19%;
}

.client-cover-photo img.cover-position-y-20 {
  object-position: 50% 20%;
}

.client-cover-photo img.cover-position-y-21 {
  object-position: 50% 21%;
}

.client-cover-photo img.cover-position-y-22 {
  object-position: 50% 22%;
}

.client-cover-photo img.cover-position-y-23 {
  object-position: 50% 23%;
}

.client-cover-photo img.cover-position-y-24 {
  object-position: 50% 24%;
}

.client-cover-photo img.cover-position-y-25 {
  object-position: 50% 25%;
}

.client-cover-photo img.cover-position-y-26 {
  object-position: 50% 26%;
}

.client-cover-photo img.cover-position-y-27 {
  object-position: 50% 27%;
}

.client-cover-photo img.cover-position-y-28 {
  object-position: 50% 28%;
}

.client-cover-photo img.cover-position-y-29 {
  object-position: 50% 29%;
}

.client-cover-photo img.cover-position-y-30 {
  object-position: 50% 30%;
}

.client-cover-photo img.cover-position-y-31 {
  object-position: 50% 31%;
}

.client-cover-photo img.cover-position-y-32 {
  object-position: 50% 32%;
}

.client-cover-photo img.cover-position-y-33 {
  object-position: 50% 33%;
}

.client-cover-photo img.cover-position-y-34 {
  object-position: 50% 34%;
}

.client-cover-photo img.cover-position-y-35 {
  object-position: 50% 35%;
}

.client-cover-photo img.cover-position-y-36 {
  object-position: 50% 36%;
}

.client-cover-photo img.cover-position-y-37 {
  object-position: 50% 37%;
}

.client-cover-photo img.cover-position-y-38 {
  object-position: 50% 38%;
}

.client-cover-photo img.cover-position-y-39 {
  object-position: 50% 39%;
}

.client-cover-photo img.cover-position-y-40 {
  object-position: 50% 40%;
}

.client-cover-photo img.cover-position-y-41 {
  object-position: 50% 41%;
}

.client-cover-photo img.cover-position-y-42 {
  object-position: 50% 42%;
}

.client-cover-photo img.cover-position-y-43 {
  object-position: 50% 43%;
}

.client-cover-photo img.cover-position-y-44 {
  object-position: 50% 44%;
}

.client-cover-photo img.cover-position-y-45 {
  object-position: 50% 45%;
}

.client-cover-photo img.cover-position-y-46 {
  object-position: 50% 46%;
}

.client-cover-photo img.cover-position-y-47 {
  object-position: 50% 47%;
}

.client-cover-photo img.cover-position-y-48 {
  object-position: 50% 48%;
}

.client-cover-photo img.cover-position-y-49 {
  object-position: 50% 49%;
}

.client-cover-photo img.cover-position-y-50 {
  object-position: 50% 50%;
}

.client-cover-photo img.cover-position-y-51 {
  object-position: 50% 51%;
}

.client-cover-photo img.cover-position-y-52 {
  object-position: 50% 52%;
}

.client-cover-photo img.cover-position-y-53 {
  object-position: 50% 53%;
}

.client-cover-photo img.cover-position-y-54 {
  object-position: 50% 54%;
}

.client-cover-photo img.cover-position-y-55 {
  object-position: 50% 55%;
}

.client-cover-photo img.cover-position-y-56 {
  object-position: 50% 56%;
}

.client-cover-photo img.cover-position-y-57 {
  object-position: 50% 57%;
}

.client-cover-photo img.cover-position-y-58 {
  object-position: 50% 58%;
}

.client-cover-photo img.cover-position-y-59 {
  object-position: 50% 59%;
}

.client-cover-photo img.cover-position-y-60 {
  object-position: 50% 60%;
}

.client-cover-photo img.cover-position-y-61 {
  object-position: 50% 61%;
}

.client-cover-photo img.cover-position-y-62 {
  object-position: 50% 62%;
}

.client-cover-photo img.cover-position-y-63 {
  object-position: 50% 63%;
}

.client-cover-photo img.cover-position-y-64 {
  object-position: 50% 64%;
}

.client-cover-photo img.cover-position-y-65 {
  object-position: 50% 65%;
}

.client-cover-photo img.cover-position-y-66 {
  object-position: 50% 66%;
}

.client-cover-photo img.cover-position-y-67 {
  object-position: 50% 67%;
}

.client-cover-photo img.cover-position-y-68 {
  object-position: 50% 68%;
}

.client-cover-photo img.cover-position-y-69 {
  object-position: 50% 69%;
}

.client-cover-photo img.cover-position-y-70 {
  object-position: 50% 70%;
}

.client-cover-photo img.cover-position-y-71 {
  object-position: 50% 71%;
}

.client-cover-photo img.cover-position-y-72 {
  object-position: 50% 72%;
}

.client-cover-photo img.cover-position-y-73 {
  object-position: 50% 73%;
}

.client-cover-photo img.cover-position-y-74 {
  object-position: 50% 74%;
}

.client-cover-photo img.cover-position-y-75 {
  object-position: 50% 75%;
}

.client-cover-photo img.cover-position-y-76 {
  object-position: 50% 76%;
}

.client-cover-photo img.cover-position-y-77 {
  object-position: 50% 77%;
}

.client-cover-photo img.cover-position-y-78 {
  object-position: 50% 78%;
}

.client-cover-photo img.cover-position-y-79 {
  object-position: 50% 79%;
}

.client-cover-photo img.cover-position-y-80 {
  object-position: 50% 80%;
}

.client-cover-photo img.cover-position-y-81 {
  object-position: 50% 81%;
}

.client-cover-photo img.cover-position-y-82 {
  object-position: 50% 82%;
}

.client-cover-photo img.cover-position-y-83 {
  object-position: 50% 83%;
}

.client-cover-photo img.cover-position-y-84 {
  object-position: 50% 84%;
}

.client-cover-photo img.cover-position-y-85 {
  object-position: 50% 85%;
}

.client-cover-photo img.cover-position-y-86 {
  object-position: 50% 86%;
}

.client-cover-photo img.cover-position-y-87 {
  object-position: 50% 87%;
}

.client-cover-photo img.cover-position-y-88 {
  object-position: 50% 88%;
}

.client-cover-photo img.cover-position-y-89 {
  object-position: 50% 89%;
}

.client-cover-photo img.cover-position-y-90 {
  object-position: 50% 90%;
}

.client-cover-photo img.cover-position-y-91 {
  object-position: 50% 91%;
}

.client-cover-photo img.cover-position-y-92 {
  object-position: 50% 92%;
}

.client-cover-photo img.cover-position-y-93 {
  object-position: 50% 93%;
}

.client-cover-photo img.cover-position-y-94 {
  object-position: 50% 94%;
}

.client-cover-photo img.cover-position-y-95 {
  object-position: 50% 95%;
}

.client-cover-photo img.cover-position-y-96 {
  object-position: 50% 96%;
}

.client-cover-photo img.cover-position-y-97 {
  object-position: 50% 97%;
}

.client-cover-photo img.cover-position-y-98 {
  object-position: 50% 98%;
}

.client-cover-photo img.cover-position-y-99 {
  object-position: 50% 99%;
}

.client-cover-photo img.cover-position-y-100 {
  object-position: 50% 100%;
}

/* Client cover positions — end */

/* Photo sorting toolbar */
.photo-sort-toolbar {
  margin-bottom: 20px;
  padding: 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid var(--line);
  background: #faf7f2;
}

.photo-sort-description {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.photo-sort-description strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.photo-sort-description span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.photo-sort-actions {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.photo-sort-button {
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid #b99673;
  border-radius: 2px;
  color: #76583e;
  background: #fffdf9;
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.photo-sort-button:hover {
  border-color: #9f7c59;
  color: #ffffff;
  background: #9f7c59;
}

@media (max-width: 720px) {
  .photo-sort-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .photo-sort-actions {
    display: grid;
    grid-template-columns:
      repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 480px) {
  .photo-sort-actions {
    grid-template-columns: 1fr;
  }
}

/* Gallery appearance v3 — start */

.gallery-appearance-form {
  display: grid;
  gap: 24px;
}

.gallery-appearance-grid {
  display: grid;
  grid-template-columns:
    repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.gallery-appearance-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 12px;
}

.gallery-appearance-preview {
  min-height: 42px;
  padding: 10px 17px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #76583e;
  background: #fffdf9;
  border: 1px solid #b99673;
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
}

/* Palety */

.client-gallery-body.gallery-palette-cream {
  --background: #f4eee6;
  --surface: #fffaf4;
  --text: #302b27;
  --muted: #776d64;
  --line: #ddd2c6;
  background: #f4eee6;
}

.client-gallery-body.gallery-palette-warm-white {
  --background: #faf9f6;
  --surface: #ffffff;
  --text: #2f2d2b;
  --muted: #77736e;
  --line: #dfdcd6;
  background: #faf9f6;
}

.client-gallery-body.gallery-palette-beige {
  --background: #e9dfd3;
  --surface: #f7f0e8;
  --text: #3b332d;
  --muted: #796b60;
  --line: #cec0b2;
  background: #e9dfd3;
}

.client-gallery-body.gallery-palette-dark {
  --background: #211e1c;
  --surface: #2e2926;
  --text: #f4ede6;
  --muted: #c0b3a8;
  --line: #4d443d;
  color: var(--text);
  background: var(--background);
}

.gallery-palette-dark .client-header,
.gallery-palette-dark .client-hero,
.gallery-palette-dark .client-photo-section {
  color: var(--text);
}

.gallery-palette-dark
  .client-gallery-summary span,
.gallery-palette-dark
  .client-expiration-card,
.gallery-palette-dark
  [data-favorite-form],
.gallery-palette-dark
  .client-package-card {
  color: var(--text);
  background: var(--surface);
  border-color: var(--line);
}

/* Szablony */

.gallery-template-natural
  .client-cover-photo,
.gallery-template-natural
  .client-masonry-photo {
  border-radius: 4px;
}

.gallery-template-reportage
  .client-page {
  width:
    min(
      1500px,
      calc(100% - 28px)
    );
}

.gallery-template-reportage
  .client-masonry-grid {
  margin-top: 8px;
  column-gap: 8px;
}

.gallery-template-reportage
  .client-masonry-item {
  margin-bottom: 8px;
}

.gallery-template-reportage
  .client-cover-photo,
.gallery-template-reportage
  .client-masonry-photo {
  border-radius: 0;
}

.gallery-template-minimal
  .client-page {
  width:
    min(
      1180px,
      calc(100% - 36px)
    );
}

.gallery-template-minimal
  .client-masonry-grid {
  display: grid;
  column-count: initial;
  gap: 18px;
}

.gallery-template-minimal
  .client-masonry-item {
  width: auto;
  margin: 0;
  display: block;
}

.gallery-template-minimal
  .client-masonry-photo img {
  width: 100%;
  height: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

/* Kolumny */

.gallery-columns-2
  .client-masonry-grid {
  column-count: 2;
}

.gallery-columns-3
  .client-masonry-grid {
  column-count: 3;
}

.gallery-columns-4
  .client-masonry-grid {
  column-count: 4;
}

.gallery-template-minimal
  .client-masonry-grid {
  grid-template-columns:
    repeat(
      var(--gallery-columns, 3),
      minmax(0, 1fr)
    );
}

.gallery-template-minimal.gallery-columns-2 {
  --gallery-columns: 2;
}

.gallery-template-minimal.gallery-columns-3 {
  --gallery-columns: 3;
}

.gallery-template-minimal.gallery-columns-4 {
  --gallery-columns: 4;
}

@media (max-width: 920px) {
  .gallery-appearance-grid {
    grid-template-columns: 1fr;
  }

  .gallery-columns-3
    .client-masonry-grid,
  .gallery-columns-4
    .client-masonry-grid {
    column-count: 2;
  }

  .gallery-template-minimal
    .client-masonry-grid {
    grid-template-columns:
      repeat(
        2,
        minmax(0, 1fr)
      );
  }
}

@media (max-width: 560px) {
  .gallery-appearance-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .gallery-appearance-preview,
  .gallery-appearance-actions
    .gallery-settings-save {
    width: 100%;
  }
}

@media (max-width: 380px) {
  .gallery-columns-2
    .client-masonry-grid,
  .gallery-columns-3
    .client-masonry-grid,
  .gallery-columns-4
    .client-masonry-grid {
    column-count: 1;
  }

  .gallery-template-minimal
    .client-masonry-grid {
    grid-template-columns: 1fr;
  }
}

/* Gallery appearance v3 — end */

/* Subtle client photo controls — start */

/*
 * Przyciski wyświetlane bezpośrednio
 * na zdjęciach klienta.
 */

.client-photo-download,
.client-photo-select,
.client-favorite-button {
  width: 34px;
  height: 34px;
  min-width: 34px;
  min-height: 34px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  background:
    rgba(
      35,
      31,
      28,
      0.48
    );
  border:
    1px solid
    rgba(
      255,
      255,
      255,
      0.26
    );
  border-radius: 50%;
  box-shadow:
    0 2px 8px
    rgba(
      0,
      0,
      0,
      0.16
    );
  backdrop-filter: blur(4px);
  opacity: 0.68;
  transition:
    opacity 160ms ease,
    background 160ms ease,
    transform 160ms ease,
    border-color 160ms ease;
}

.client-photo-download svg,
.client-photo-select svg,
.client-favorite-button svg {
  width: 16px;
  height: 16px;
}

.client-photo-download:hover,
.client-photo-select:hover,
.client-favorite-button:hover,
.client-photo-download:focus-visible,
.client-photo-select:focus-visible,
.client-favorite-button:focus-visible {
  opacity: 1;
  background:
    rgba(
      35,
      31,
      28,
      0.78
    );
  border-color:
    rgba(
      255,
      255,
      255,
      0.55
    );
  transform: scale(1.04);
}

/*
 * Wybrane zdjęcie pozostaje czytelne.
 */

.client-favorite-button.is-selected,
.client-favorite-button[
  aria-pressed="true"
],
.client-photo-select[
  aria-pressed="true"
] {
  opacity: 1;
  background:
    rgba(
      139,
      101,
      72,
      0.9
    );
  border-color:
    rgba(
      255,
      255,
      255,
      0.72
    );
}

/*
 * Telefon — mniejsze elementy,
 * aby nie zasłaniały fotografii.
 */

@media (max-width: 560px) {
  .client-photo-download,
  .client-photo-select,
  .client-favorite-button {
    width: 30px;
    height: 30px;
    min-width: 30px;
    min-height: 30px;
    opacity: 0.58;
    box-shadow:
      0 1px 6px
      rgba(
        0,
        0,
        0,
        0.16
      );
  }

  .client-photo-download svg,
  .client-photo-select svg,
  .client-favorite-button svg {
    width: 14px;
    height: 14px;
  }

  .client-photo-download {
    top: 5px;
    right: 5px;
  }

  .client-cover-download {
    top: 8px;
    right: 8px;
  }

  .client-photo-select {
    bottom: 5px;
    left: 5px;
  }

  .client-favorite-button {
    top: 5px;
    left: 5px;
  }

  .client-favorite-button.is-selected,
  .client-favorite-button[
    aria-pressed="true"
  ],
  .client-photo-select[
    aria-pressed="true"
  ] {
    opacity: 1;
  }
}

/* Subtle client photo controls — end */

/* Subtle client photo numbers — start */

.client-photo-number {
  right: 8px;
  bottom: 8px;
  min-width: 27px;
  height: 22px;
  padding: 0 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color:
    rgba(
      255,
      255,
      255,
      0.9
    );
  background:
    rgba(
      35,
      31,
      28,
      0.42
    );
  border:
    1px solid
    rgba(
      255,
      255,
      255,
      0.18
    );
  border-radius: 999px;
  box-shadow:
    0 1px 5px
    rgba(
      0,
      0,
      0,
      0.12
    );
  backdrop-filter: blur(3px);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  opacity: 0.62;
  transition:
    opacity 160ms ease,
    background 160ms ease;
}

.client-cover-photo:hover
  .client-photo-number,
.client-masonry-photo:hover
  .client-photo-number,
.client-cover-photo:focus-visible
  .client-photo-number,
.client-masonry-photo:focus-visible
  .client-photo-number {
  opacity: 0.9;
  background:
    rgba(
      35,
      31,
      28,
      0.64
    );
}

@media (max-width: 560px) {
  .client-photo-number {
    right: 5px;
    bottom: 5px;
    min-width: 23px;
    height: 19px;
    padding: 0 5px;
    font-size: 9px;
    letter-spacing: 0.02em;
    opacity: 0.5;
    box-shadow:
      0 1px 4px
      rgba(
        0,
        0,
        0,
        0.1
      );
  }
}

/* Subtle client photo numbers — end */

/* Client gallery flow switch — start */

/* Przyciski wyboru w panelu fotografa */

.gallery-flow-fieldset {
  grid-column: 1 / -1;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.gallery-flow-fieldset legend {
  margin-bottom: 11px;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.gallery-flow-options {
  display: grid;
  grid-template-columns:
    repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.gallery-flow-choice {
  position: relative;
  display: block;
  cursor: pointer;
}

.gallery-flow-choice input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.gallery-flow-choice > span {
  min-height: 142px;
  padding: 17px;
  display: grid;
  align-content: start;
  gap: 8px;
  background: #faf7f2;
  border: 1px solid var(--line);
  transition:
    background 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.gallery-flow-choice strong {
  color: var(--text);
  font-size: 14px;
}

.gallery-flow-choice small {
  color: var(--muted);
  line-height: 1.5;
}

.gallery-flow-choice i {
  margin-top: 4px;
  color: #8a6749;
  font-family: monospace;
  font-size: 13px;
  font-style: normal;
  line-height: 1.8;
}

.gallery-flow-choice input:checked
  + span {
  background: #fffdf9;
  border-color: #9f7c59;
  box-shadow:
    0 0 0 2px
    rgba(
      159,
      124,
      89,
      0.14
    );
}

.gallery-flow-choice input:focus-visible
  + span {
  outline: 2px solid #76583e;
  outline-offset: 2px;
}

/* Liczba kolumn galerii */

.gallery-columns-2 {
  --client-flow-columns: 2;
}

.gallery-columns-3 {
  --client-flow-columns: 3;
}

.gallery-columns-4 {
  --client-flow-columns: 4;
}

/*
 * Układ rzędowy:
 * 1 2 3
 * 4 5 6
 */

.gallery-flow-rows
  .client-masonry-grid {
  display: grid;
  grid-template-columns:
    repeat(
      var(--client-flow-columns, 3),
      minmax(0, 1fr)
    );
  column-count: initial;
  align-items: start;
}

.gallery-flow-rows.gallery-template-natural
  .client-masonry-grid {
  gap: 16px;
}

.gallery-flow-rows.gallery-template-reportage
  .client-masonry-grid {
  gap: 8px;
}

.gallery-flow-rows.gallery-template-minimal
  .client-masonry-grid {
  gap: 18px;
}

.gallery-flow-rows
  .client-masonry-item {
  width: 100%;
  margin: 0;
  display: block;
  align-self: start;
  break-inside: auto;
}

.gallery-flow-rows
  .client-masonry-photo {
  width: 100%;
  margin: 0;
  display: block;
}

.gallery-flow-rows.gallery-template-natural
  .client-masonry-photo img,
.gallery-flow-rows.gallery-template-reportage
  .client-masonry-photo img {
  width: 100%;
  height: auto;
  display: block;
}

/*
 * Układ kolumnowy:
 * 1 3 5
 * 2 4 6
 */

.gallery-flow-columns
  .client-masonry-grid {
  display: block;
  grid-template-columns: none;
  column-count:
    var(
      --client-flow-columns,
      3
    );
  align-items: initial;
}

.gallery-flow-columns.gallery-template-natural
  .client-masonry-grid {
  column-gap: 16px;
}

.gallery-flow-columns.gallery-template-reportage
  .client-masonry-grid {
  column-gap: 8px;
}

.gallery-flow-columns.gallery-template-minimal
  .client-masonry-grid {
  column-gap: 18px;
}

.gallery-flow-columns
  .client-masonry-item {
  width: 100%;
  display: inline-block;
  break-inside: avoid;
  vertical-align: top;
}

.gallery-flow-columns.gallery-template-natural
  .client-masonry-item {
  margin: 0 0 16px;
}

.gallery-flow-columns.gallery-template-reportage
  .client-masonry-item {
  margin: 0 0 8px;
}

.gallery-flow-columns.gallery-template-minimal
  .client-masonry-item {
  margin: 0 0 18px;
}

.gallery-flow-columns
  .client-masonry-photo {
  width: 100%;
  margin: 0;
  display: block;
}

.gallery-flow-columns
  .client-masonry-photo img {
  width: 100%;
  height: auto;
  aspect-ratio: auto;
  object-fit: contain;
  display: block;
}

@media (max-width: 920px) {
  .gallery-columns-3,
  .gallery-columns-4 {
    --client-flow-columns: 2;
  }
}

@media (max-width: 620px) {
  .gallery-flow-options {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 380px) {
  .gallery-columns-2,
  .gallery-columns-3,
  .gallery-columns-4 {
    --client-flow-columns: 1;
  }
}

/* Client gallery flow switch — end */

/* Gallery settings toggle grid — start */

.gallery-settings-toggle-grid {
  display: grid;
  grid-template-columns:
    repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.gallery-settings-toggle-grid
  .gallery-settings-checkbox {
  height: 100%;
  margin: 0;
}

.gallery-settings-toggle-grid
  .gallery-settings-checkbox > span {
  align-self: center;
}

@media (max-width: 760px) {
  .gallery-settings-toggle-grid {
    grid-template-columns: 1fr;
  }
}

/* Gallery settings toggle grid — end */

/* Collapsible gallery settings — start */

.gallery-settings-details {
  margin: 0;
  padding: 0;
}

.gallery-settings-summary {
  min-height: 62px;
  display: grid;
  grid-template-columns:
    minmax(0, 1fr)
    auto
    20px;
  align-items: center;
  gap: 18px;
  color: inherit;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.gallery-settings-summary::-webkit-details-marker {
  display: none;
}

.gallery-settings-summary::marker {
  display: none;
  content: "";
}

.gallery-settings-summary:hover
  .admin-title,
.gallery-settings-summary:hover h2 {
  color: #76583e;
}

.gallery-settings-summary:focus-visible {
  outline: 2px solid #9f7c59;
  outline-offset: 6px;
}

.gallery-settings-summary-chevron {
  width: 11px;
  height: 11px;
  display: block;
  border-right: 2px solid #9f7c59;
  border-bottom: 2px solid #9f7c59;
  transform:
    translateY(-3px)
    rotate(45deg);
  transition:
    transform 180ms ease;
}

.gallery-settings-details[open]
  .gallery-settings-summary {
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.gallery-settings-details[open]
  .gallery-settings-summary-chevron {
  transform:
    translateY(3px)
    rotate(225deg);
}

.gallery-settings-details-content {
  padding-top: 25px;
}

.gallery-settings-details-content
  .gallery-settings-form {
  margin: 0;
}

@media (max-width: 680px) {
  .gallery-settings-summary {
    grid-template-columns:
      minmax(0, 1fr)
      18px;
    gap: 12px;
  }

  .gallery-settings-summary
    .admin-gallery-status {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .gallery-settings-summary-chevron {
    grid-column: 2;
    grid-row: 1;
  }

  .gallery-settings-details-content {
    padding-top: 20px;
  }
}

/* Collapsible gallery settings — end */

/* Collapsible gallery appearance — start */

.gallery-appearance-details
  .gallery-settings-details-content {
  display: grid;
  gap: 0;
}

.gallery-appearance-details[open]
  .gallery-settings-summary {
  margin-bottom: 0;
}

/* Collapsible gallery appearance — end */

/* Client header logo — start */

.client-brand-logo {
  display: block;
  line-height: 0;
}

.client-brand-logo img {
  width: clamp(
    200px,
    23vw,
    270px
  );
  height: auto;
  display: block;
}

.client-header
  .client-brand-logo
  + .brand-subtitle {
  margin-top: 5px;
}

/*
 * Logo zawiera czarny napis.
 * W ciemnej palecie otrzymuje
 * delikatne jasne tło.
 */

.gallery-palette-dark
  .client-brand-logo {
  padding: 6px 9px;
  background: #faf7f2;
  border-radius: 3px;
}

@media (max-width: 560px) {
  .client-brand-logo img {
    width: clamp(
      155px,
      48vw,
      190px
    );
  }

  .gallery-palette-dark
    .client-brand-logo {
    padding: 4px 6px;
  }
}

/* Client header logo — end */

/* Dark palette logo switch — start */

.client-brand-logo-light {
  display: block;
}

.client-brand-logo-dark {
  display: none;
}

.gallery-palette-dark
  .client-brand-logo {
  padding: 0;
  background: transparent;
  border-radius: 0;
}

.gallery-palette-dark
  .client-brand-logo-light {
  display: none;
}

.gallery-palette-dark
  .client-brand-logo-dark {
  display: block;
}

/* Dark palette logo switch — end */

/* Client logo visibility fix — start */

/*
 * Jasne palety:
 * pokazuj wyłącznie czarno-złote logo.
 */

.client-brand-logo
  img.client-brand-logo-light {
  display: block;
}

.client-brand-logo
  img.client-brand-logo-dark {
  display: none;
}

/*
 * Ciemna paleta:
 * pokazuj wyłącznie jasno-złote logo.
 */

.gallery-palette-dark
  .client-brand-logo
  img.client-brand-logo-light {
  display: none;
}

.gallery-palette-dark
  .client-brand-logo
  img.client-brand-logo-dark {
  display: block;
}

/*
 * Bez prostokąta za logo.
 */

.gallery-palette-dark
  .client-brand-logo {
  padding: 0;
  background: transparent;
  border-radius: 0;
}

/* Client logo visibility fix — end */

/* Admin header logo — start */

.admin-brand-logo {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  line-height: 0;
}

.admin-brand-logo img {
  display: block;
  width: clamp(185px, 20vw, 245px);
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

.admin-header .admin-brand-logo {
  align-self: center;
}

@media (max-width: 680px) {
  .admin-brand-logo img {
    width: clamp(150px, 48vw, 190px);
  }
}

/* Admin header logo — end */

/* Admin password reset — start */

.login-secondary-action {
  margin: 18px 0 0;
  text-align: center;
}

.login-secondary-action a {
  color: #76583e;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.login-secondary-action a:hover {
  text-decoration: underline;
}

.password-reset-honeypot {
  position: absolute !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}

/* Admin password reset — end */

/* Reportażowa galeria rzędowa V2 — start */

/*
 * Układ „justified”: JavaScript dobiera liczbę zdjęć
 * w każdym rzędzie i oblicza ich dokładne wymiary.
 * Dzięki temu pionowe fotografie nie tworzą pustych pól.
 */
.gallery-template-reportage {
  --reportage-gap: 4px;
}

.gallery-template-reportage
  .client-masonry-grid {
  width: calc(100vw - 8px);
  margin-top: var(--reportage-gap);
  margin-left: calc(50% - 50vw + 4px);
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  align-content: flex-start;
  justify-content: flex-start;
  gap: var(--reportage-gap);
  column-count: initial;
}

.gallery-template-reportage
  .client-masonry-grid::after {
  display: none;
  content: none;
}

.gallery-template-reportage
  .client-masonry-item {
  position: relative;
  width: var(
    --justified-width,
    calc(var(--photo-ratio, 1.5) * 210px)
  );
  height: var(--justified-height, 210px);
  min-width: 0;
  margin: 0;
  display: block;
  flex: 0 0 var(
    --justified-width,
    calc(var(--photo-ratio, 1.5) * 210px)
  );
  overflow: hidden;
  break-inside: auto;
}

.gallery-template-reportage
  .client-masonry-photo {
  width: 100%;
  height: 100%;
  margin: 0;
  display: block;
  border: 0;
  overflow: hidden;
}

.gallery-template-reportage
  .client-masonry-photo img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.gallery-template-reportage.gallery-flow-rows
  .client-masonry-grid,
.gallery-template-reportage.gallery-flow-columns
  .client-masonry-grid,
.gallery-template-reportage.gallery-columns-2
  .client-masonry-grid,
.gallery-template-reportage.gallery-columns-3
  .client-masonry-grid,
.gallery-template-reportage.gallery-columns-4
  .client-masonry-grid {
  display: flex;
  grid-template-columns: none;
  column-count: initial;
  gap: var(--reportage-gap);
}

.gallery-template-reportage.gallery-flow-rows
  .client-masonry-item,
.gallery-template-reportage.gallery-flow-columns
  .client-masonry-item {
  width: var(
    --justified-width,
    calc(var(--photo-ratio, 1.5) * 210px)
  );
  height: var(--justified-height, 210px);
  margin: 0;
  display: block;
}

@media (max-width: 620px) {
  .gallery-template-reportage {
    --reportage-gap: 3px;
  }

  .gallery-template-reportage
    .client-masonry-grid {
    width: calc(100vw - 6px);
    margin-left: calc(50% - 50vw + 3px);
  }
}

/* Reportażowa galeria rzędowa V2 — end */
