.shared-image-viewer {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: none;
  align-items: center;
  justify-content: center;
  padding: clamp(12px, 2.2vw, 28px);
  background: rgba(24, 24, 27, 0.28);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.shared-image-viewer.show {
  display: flex;
}

.shared-viewer-shell {
  width: min(1720px, calc(100vw - clamp(20px, 2.4vw, 36px)));
  height: min(940px, calc(100dvh - clamp(20px, 2.4vw, 36px)));
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(340px, 27vw, 430px);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.42);
}

.shared-viewer-canvas {
  min-width: 0;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: clamp(16px, 2.6vw, 34px);
  background: #f4f4f5;
}

.shared-viewer-canvas img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.28);
}

.shared-viewer-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
  overflow-y: auto;
  border-left: 1px solid #e4e4e7;
  background: rgba(250, 250, 250, 0.98);
  padding: 22px;
  color: #18181b;
}

.shared-viewer-toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.shared-viewer-feedback {
  align-self: flex-end;
  min-height: 0;
  max-width: 100%;
  margin-top: -8px;
  border: 1px solid rgba(24, 24, 27, 0.14);
  border-radius: 999px;
  background: rgba(24, 24, 27, 0.94);
  color: #ffffff;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
  box-shadow: 0 12px 28px rgba(24, 24, 27, 0.22);
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.shared-viewer-feedback.show {
  opacity: 1;
  transform: translateY(0);
}

.shared-viewer-feedback[data-type="warning"] {
  background: rgba(161, 98, 7, 0.96);
  border-color: rgba(161, 98, 7, 0.2);
}

.shared-viewer-icon {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(24, 24, 27, 0.14);
  border-radius: 50%;
  background: #18181b;
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
  cursor: pointer;
}

.shared-viewer-icon.is-favorite {
  color: #ff3b30;
}

.shared-viewer-author {
  display: flex;
  align-items: center;
  gap: 12px;
}

.shared-viewer-avatar {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: #18181b;
  color: #ffffff;
  font-weight: 900;
}

.shared-viewer-avatar img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.shared-viewer-author strong {
  display: block;
  font-size: 16px;
}

.shared-viewer-author span,
.shared-viewer-stats,
.shared-viewer-field label,
.shared-viewer-field p,
.shared-tune-ref-note {
  color: #71717a;
}

.shared-viewer-stats {
  display: flex;
  gap: 18px;
  border-top: 1px solid #e4e4e7;
  border-bottom: 1px solid #e4e4e7;
  padding: 12px 0;
  font-size: 13px;
}

.shared-viewer-field label,
.shared-viewer-tune label {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 900;
}

.shared-viewer-field strong {
  display: block;
  font-size: 18px;
  line-height: 1.35;
}

.shared-viewer-field p {
  max-height: min(180px, 18dvh);
  overflow: auto;
  font-size: 14px;
  line-height: 1.72;
  white-space: pre-wrap;
}

.shared-viewer-tune {
  display: grid;
  gap: 10px;
  margin-top: 2px;
  border: 1px solid #e4e4e7;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  padding: 12px;
}

.shared-image-viewer.is-display-source .shared-viewer-tune {
  margin-top: auto;
}

.shared-viewer-tune textarea {
  width: 100%;
  height: 64px;
  resize: none;
  border: 1px solid #e4e4e7;
  border-radius: 10px;
  outline: none;
  background: #ffffff;
  padding: 10px;
  color: #18181b;
  font: inherit;
  font-size: 13px;
  line-height: 1.5;
}

.shared-viewer-tune textarea:focus::placeholder {
  color: transparent;
}

.shared-tune-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.shared-tune-chip {
  border: 1px solid #e4e4e7;
  border-radius: 999px;
  background: transparent;
  color: #71717a;
  padding: 5px 8px;
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
}

.shared-tune-ref {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.shared-tune-ref-slot {
  position: relative;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px dashed #e4e4e7;
  border-radius: 10px;
  background: #ffffff;
  color: #71717a;
  cursor: pointer;
}

.shared-tune-ref-slot input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

.shared-tune-ref-slot > i {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  pointer-events: none;
}

.shared-tune-ref-slot img {
  width: 100%;
  height: 100%;
  display: none;
  object-fit: cover;
}

.shared-tune-ref-slot.has-image > i {
  display: none;
}

.shared-tune-ref-slot.has-image img {
  display: block;
}

.shared-tune-ref-remove {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 18px;
  height: 18px;
  display: none;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.68);
  color: #ffffff;
  font-size: 10px;
  cursor: pointer;
  z-index: 3;
}

.shared-tune-ref-slot.has-image .shared-tune-ref-remove {
  display: flex;
}

.shared-viewer-recreate {
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 10px;
  background: #18181b;
  color: #ffffff;
  font-weight: 900;
  cursor: pointer;
}

.shared-viewer-video,
.shared-viewer-publish {
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-shrink: 0;
  border: 1px solid #e4e4e7;
  border-radius: 10px;
  background: #ffffff;
  color: #18181b;
  font-weight: 900;
  cursor: pointer;
}

.shared-viewer-video:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.shared-viewer-bottom-actions {
  display: grid;
  gap: 8px;
  margin-top: auto;
  padding-top: 2px;
}

.shared-viewer-publish[hidden] {
  display: none;
}

.shared-image-viewer.is-display-source .shared-viewer-bottom-actions {
  display: none;
}

.shared-viewer-video:hover,
.shared-viewer-publish:hover {
  border-color: #18181b;
}

.shared-viewer-publish.is-published {
  border-color: #18181b;
  background: #18181b;
  color: #ffffff;
}

@media (max-width: 900px) {
  .shared-viewer-shell {
    height: calc(100dvh - 20px);
    grid-template-columns: 1fr;
    overflow: auto;
  }

  .shared-viewer-canvas {
    min-height: 58dvh;
  }

  .shared-viewer-side {
    border-left: 0;
    border-top: 1px solid #e4e4e7;
  }
}
