.client-gallery-wrapper {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
}

.client-gallery-upload {
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: #f7f7f7;
  border-radius: 6px;
  border: 1px dashed #c5c5c5;
}

.client-gallery-section {
  margin-bottom: 2.5rem;
}

.client-gallery-section h2 {
  margin-bottom: 0.75rem;
}

.client-gallery-upload label {
  font-weight: 600;
  display: inline-block;
  margin-bottom: 0.5rem;
}

.client-gallery-button {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  background: #0073aa;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.95rem;
}

.client-gallery-button:hover,
.client-gallery-button:focus {
  background: #005a87;
}

.client-gallery-grid {
  display: grid;
  gap: 1.2rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 1024px) {
  .client-gallery-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

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

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

.client-gallery-item {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.5rem;
}

.client-gallery-item-link {
  display: block;
}

.client-gallery-item img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.client-gallery-delete {
  text-align: center;
}

.client-gallery-delete-button {
  display: inline-block;
  padding: 0.45rem 0.9rem;
  background: #b32d2e;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
}

.client-gallery-delete-button:hover,
.client-gallery-delete-button:focus {
  background: #891f1f;
}

.client-gallery-notice {
  padding: 0.8rem 1rem;
  margin-bottom: 1rem;
  border-radius: 6px;
}

.client-gallery-notice-success {
  background: #e6f7ed;
  color: #0b5d2d;
  border: 1px solid #c2ebd4;
}

.client-gallery-notice-error {
  background: #fdecea;
  color: #8a1f11;
  border: 1px solid #f5c6cb;
}

.client-gallery-notice-warning {
  background: #fff4e5;
  color: #8a6d3b;
  border: 1px solid #ffe0b2;
}

.client-gallery-login-prompt {
  max-width: 420px;
  margin: 2rem auto;
  padding: 1.5rem;
  border: 1px solid #dadada;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.client-gallery-scope-note {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  background: #f0f6ff;
  border-radius: 6px;
  border-left: 4px solid #1c6fcd;
  color: #0e3f7c;
}

.client-gallery-help {
  margin: 0.25rem 0 1rem;
  font-size: 0.9rem;
  color: #555;
}

.client-gallery-albums {
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 1.5rem;
  background: #fff;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.05);
}

.client-gallery-create-album {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.client-gallery-form-label {
  width: 100%;
  font-weight: 600;
}

.client-gallery-text {
  flex: 1 1 240px;
  padding: 0.55rem 0.75rem;
  border: 1px solid #c7c7c7;
  border-radius: 4px;
  font-size: 0.95rem;
}

.client-gallery-album-list {
  display: grid;
  gap: 1.5rem;
}

.client-gallery-album-card {
  border: 1px solid #dfe4ea;
  border-radius: 8px;
  padding: 1.25rem;
  background: #fdfdfd;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 4px 12px rgba(0, 0, 0, 0.05);
}

.client-gallery-album-card h3 {
  margin: 0 0 0.5rem;
}

.client-gallery-shortcode {
  margin: 0 0 1rem;
  font-family: Menlo, Monaco, Consolas, 'Courier New', monospace;
  background: #f1f5f9;
  padding: 0.4rem 0.6rem;
  border-radius: 4px;
  display: inline-block;
}

.client-gallery-album-form {
  display: grid;
  gap: 1rem;
}

.client-gallery-album-media {
  display: grid;
  gap: 0.75rem;
}

.client-gallery-album-preview {
  border: 1px dashed #c5c5c5;
  border-radius: 6px;
  padding: 0.75rem;
  background: #fafafa;
}

.client-gallery-album-preview-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

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

@media (max-width: 480px) {
  .client-gallery-album-preview-grid {
    grid-template-columns: 1fr;
  }
}

.client-gallery-album-thumb {
  position: relative;
  overflow: hidden;
  border-radius: 4px;
  cursor: grab;
}

.client-gallery-album-thumb img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.client-gallery-album-thumb:active {
  cursor: grabbing;
}

.client-gallery-thumb-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease;
}

.client-gallery-thumb-remove:hover,
.client-gallery-thumb-remove:focus {
  background: rgba(179, 45, 46, 0.9);
}

.client-gallery-album-preview-grid .ui-sortable-placeholder {
  visibility: visible !important;
  background: rgba(0, 115, 170, 0.12);
  border: 2px dashed #0073aa;
  border-radius: 4px;
  aspect-ratio: 1;
}

.client-gallery-empty-preview {
  margin: 0;
  font-size: 0.9rem;
  color: #555;
}

.client-gallery-album-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.client-gallery-album-delete {
  margin-top: 0.75rem;
}

.client-gallery-info {
  margin: 0;
  font-size: 0.9rem;
  color: #555;
}

.client-gallery-existing {
  margin-top: 1.5rem;
}
