/* Message photos. New file so existing cache-bust tags stay as they are. */

.dm-photo-btn {
  flex: 0 0 auto;
  align-self: flex-end;
  margin: 0;
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--input-border, #2a2a2a);
  background: var(--input-bg, #141414);
  color: var(--headings, #fff);
  font: 600 0.85rem/1 var(--font-body, Inter, system-ui, sans-serif);
  cursor: pointer;
}

.dm-photo-btn:hover,
.dm-photo-btn:focus {
  border-color: var(--lime, #39ff14);
  color: var(--lime, #39ff14);
}

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

.dm-photo-pending {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 0.45rem;
}

.dm-photo-pending-item {
  position: relative;
  width: 64px;
  height: 64px;
}

.dm-photo-pending-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
  display: block;
}

.dm-photo-pending-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  cursor: pointer;
  line-height: 1;
}

.dm-photo-grid {
  display: grid;
  gap: 4px;
  margin: 0 0 0.35rem;
  width: min(100%, 260px);
}

.dm-photo-grid[data-count="1"] {
  grid-template-columns: 1fr;
  width: min(100%, 220px);
}

.dm-photo-grid[data-count="2"],
.dm-photo-grid[data-count="3"],
.dm-photo-grid[data-count="4"] {
  grid-template-columns: 1fr 1fr;
}

.dm-photo-cell {
  position: relative;
  min-width: 0;
}

.dm-photo-thumb {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 8px;
  overflow: hidden;
  background: #111;
  cursor: pointer;
}

.dm-photo-thumb img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.dm-photo-report {
  position: absolute;
  left: 4px;
  bottom: 4px;
  border: 0;
  border-radius: 999px;
  padding: 0.15rem 0.4rem;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font: 600 0.68rem/1.2 var(--font-body, Inter, system-ui, sans-serif);
  cursor: pointer;
}

.dm-unsend-button {
  border: 0;
  background: transparent;
  color: var(--danger, #e57373);
  font: 600 0.75rem/1 var(--font-body, Inter, system-ui, sans-serif);
  cursor: pointer;
  padding: 0;
}

.dm-photo-viewer {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: #000;
  display: flex;
  flex-direction: column;
  touch-action: none;
}

.dm-photo-viewer-bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: calc(0.6rem + env(safe-area-inset-top)) 0.75rem 0.6rem;
  color: #fff;
}

.dm-photo-viewer-btn {
  border: 0;
  background: transparent;
  color: #fff;
  font: 600 0.95rem/1 var(--font-body, Inter, system-ui, sans-serif);
  cursor: pointer;
  padding: 0.35rem 0.2rem;
}

.dm-photo-viewer-count {
  font: 600 0.85rem/1 var(--font-body, Inter, system-ui, sans-serif);
}

.dm-photo-viewer-img {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  object-fit: contain;
  transform-origin: center center;
  touch-action: none;
}

body.dm-photo-viewer-open {
  overflow: hidden;
}

html[data-theme="light"] .dm-photo-btn {
  background: #fff;
  color: #14210f;
  border-color: #c9d4c4;
}
