.oscg-gallery,
.oscg-upload,
.oscg-login-panel {
  box-sizing: border-box;
  width: 100%;
}

.oscg-gallery *,
.oscg-upload *,
.oscg-login-panel * {
  box-sizing: border-box;
}

.oscg-gallery__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--oscg-min-width, 250px)), 1fr));
  gap: var(--oscg-gap, 16px);
}

.oscg-gallery__item {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  border-radius: 8px;
  background: #eef0f2;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
}

.oscg-gallery__item:focus-visible {
  outline: 3px solid currentColor;
  outline-offset: 3px;
}

.oscg-gallery__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 180ms ease;
}

.oscg-gallery__item:hover .oscg-gallery__image,
.oscg-gallery__item:focus-visible .oscg-gallery__image {
  transform: scale(1.025);
}

.oscg-gallery__empty {
  margin: 0;
  padding: 24px;
  border: 1px dashed #c9ced6;
  border-radius: 8px;
  text-align: center;
  color: #5f6875;
}

.oscg-lightbox {
  width: min(94vw, 1400px);
  max-width: none;
  height: min(92vh, 1000px);
  max-height: none;
  padding: 0;
  border: 0;
  border-radius: 10px;
  overflow: hidden;
  background: #111827;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
}

.oscg-lightbox::backdrop {
  background: rgba(0, 0, 0, 0.78);
}

.oscg-lightbox__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.oscg-lightbox__close {
  position: absolute;
  z-index: 2;
  top: 12px;
  right: 12px;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.68);
  color: #fff;
  font: 400 30px/40px Arial, sans-serif;
  cursor: pointer;
}

.oscg-upload,
.oscg-login-panel {
  margin-top: 28px;
  padding: clamp(18px, 3vw, 30px);
  border: 1px solid #dfe3e8;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.06);
}

.oscg-upload__header {
  display: flex;
  margin: 0 0 18px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.oscg-upload__title {
	margin: 0;
  font-size: clamp(20px, 2.5vw, 26px);
}

.oscg-upload__logout {
  flex: 0 0 auto;
  color: inherit;
  font-size: 14px;
}

.oscg-dropzone {
  position: relative;
  display: flex;
  min-height: 170px;
  padding: 28px;
  border: 2px dashed #aeb6c2;
  border-radius: 10px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  text-align: center;
  background: #f8fafc;
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease;
}

.oscg-dropzone:hover,
.oscg-dropzone:focus-within,
.oscg-dropzone.is-dragover {
  border-color: #4b6b8a;
  background: #f1f5f9;
}

.oscg-dropzone__input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.oscg-dropzone__headline {
  font-size: 17px;
  font-weight: 700;
  color: #1f2937;
}

.oscg-dropzone__help,
.oscg-dropzone__selection {
  color: #64748b;
  font-size: 14px;
}

.oscg-dropzone__selection:not(:empty) {
  margin-top: 5px;
  color: #17663a;
  font-weight: 700;
}

.oscg-button {
  display: inline-flex;
  min-height: 44px;
  margin-top: 16px;
  padding: 11px 22px;
  border: 0;
  border-radius: 6px;
  align-items: center;
  justify-content: center;
  background: #24384d;
  color: #fff !important;
  font: inherit;
  font-weight: 700;
  text-decoration: none !important;
  cursor: pointer;
  transition: filter 160ms ease, transform 160ms ease;
}

.oscg-button:hover,
.oscg-button:focus-visible {
  filter: brightness(1.12);
  transform: translateY(-1px);
}

.oscg-notice {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-left: 4px solid;
  border-radius: 4px;
}

.oscg-notice--success {
  border-color: #16813b;
  background: #edf9f0;
  color: #0f5729;
}

.oscg-notice--warning {
  border-color: #b7791f;
  background: #fff8e7;
  color: #704711;
}

.oscg-notice--error {
  border-color: #c53030;
  background: #fff1f1;
  color: #822020;
}

@media (prefers-reduced-motion: reduce) {
  .oscg-gallery__image,
  .oscg-button {
    transition: none;
  }
}
