.result-box {
  min-height: 3rem;
  padding: 0.75rem;
  border-radius: 0.5rem;
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.875rem;
}

.result-json {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: inherit;
  font-size: inherit;
}

.preview-panel:empty {
  display: none;
}

.preview-panel,
.result-box img,
.result-box video {
  max-width: 100%;
}

.media-preview-image {
  display: block;
  width: 100%;
  max-width: 320px;
  border-radius: 0.5rem;
  border: 1px solid #dee2e6;
}

.media-preview-video,
.table-video-preview {
  display: block;
  width: 100%;
  max-width: 320px;
  border-radius: 0.5rem;
  background: #000;
}

.lazy-video-shell {
  overflow: hidden;
  background: #111827;
}

.lazy-video-placeholder {
  position: relative;
  display: flex;
  width: 100%;
  min-height: 9rem;
  aspect-ratio: 16 / 9;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  border: 0;
  border-radius: inherit;
  color: #fff;
  background: linear-gradient(135deg, #1f2933, #111827);
}

.lazy-video-shell.has-poster .lazy-video-placeholder {
  background:
    linear-gradient(rgba(17, 24, 39, 0.2), rgba(17, 24, 39, 0.72)),
    var(--lazy-video-poster) center / cover no-repeat;
}

.lazy-video-placeholder:hover,
.lazy-video-placeholder:focus {
  background: linear-gradient(135deg, #273849, #111827);
  outline: 2px solid rgba(13, 110, 253, 0.5);
  outline-offset: -2px;
}

.lazy-video-shell.has-poster .lazy-video-placeholder:hover,
.lazy-video-shell.has-poster .lazy-video-placeholder:focus {
  background:
    linear-gradient(rgba(17, 24, 39, 0.08), rgba(17, 24, 39, 0.58)),
    var(--lazy-video-poster) center / cover no-repeat;
}

.lazy-video-play {
  width: 0;
  height: 0;
  border-top: 0.45rem solid transparent;
  border-bottom: 0.45rem solid transparent;
  border-left: 0.7rem solid currentColor;
}

.render-history-video {
  border-radius: 0.5rem;
}

.render-debug {
  border-top: 1px solid #e9ecef;
  padding-top: 0.75rem;
}

.render-debug summary {
  cursor: pointer;
  color: #495057;
  font-size: 0.875rem;
  font-weight: 600;
}

.render-debug-grid {
  display: grid;
  gap: 0.75rem;
}

.render-debug-json {
  max-height: 18rem;
  overflow: auto;
  padding: 0.75rem;
  border: 1px solid #dee2e6;
  border-radius: 0.5rem;
  background: #f8f9fa;
}

.shot-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.shot-archive-card {
  padding: 1rem;
  border: 1px solid #dee2e6;
  border-radius: 0.75rem;
  background: #fff;
  box-shadow: 0 0.35rem 1rem rgba(33, 37, 41, 0.04);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.shot-archive-card:hover,
.shot-archive-card:focus {
  border-color: #86b7fe;
  box-shadow: 0 0.5rem 1.25rem rgba(33, 37, 41, 0.08);
  outline: none;
  transform: translateY(-1px);
}

.shot-archive-card.is-selected {
  border-color: #0d6efd;
  box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.12);
}

.shot-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
  min-width: 0;
}

.shot-card-title-block {
  min-width: 0;
  flex: 1 1 auto;
}

.shot-card-title-block h3 {
  overflow-wrap: anywhere;
}

.shot-card-status {
  flex: 0 0 auto;
  max-width: 45%;
}

.shot-card-status .badge,
.shot-card-status .status-loader-badge {
  max-width: 100%;
  white-space: normal;
}

.shot-archive-row {
  cursor: pointer;
}

.shot-archive-row > td {
  vertical-align: middle;
}

.shot-archive-row:hover > * {
  background: rgba(13, 110, 253, 0.06);
}

.shot-archive-row:focus {
  outline: 2px solid rgba(13, 110, 253, 0.4);
  outline-offset: -2px;
}

.shot-card-video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 0.6rem;
  background: #000;
  object-fit: cover;
}

.shot-card-empty {
  display: grid;
  min-height: 9rem;
  place-items: center;
  padding: 1rem;
  border: 1px dashed #ced4da;
  border-radius: 0.6rem;
  color: #6c757d;
  background: #f8f9fa;
  text-align: center;
}

.shot-list-preview {
  width: 220px;
  max-width: 100%;
}

.shot-list-preview-video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 0.6rem;
  background: #000;
  object-fit: cover;
}

.shot-list-preview-empty {
  display: grid;
  width: 220px;
  max-width: 100%;
  min-height: 7.75rem;
  place-items: center;
  padding: 0.9rem;
  border: 1px dashed #ced4da;
  border-radius: 0.6rem;
  color: #6c757d;
  background: #f8f9fa;
  text-align: center;
  font-size: 0.9rem;
}

@media (max-width: 991.98px) {
  .shot-list-preview,
  .shot-list-preview-empty {
    width: 180px;
  }
}

.upload-helper.is-uploading {
  opacity: 0.85;
}

.upload-spinner {
  display: inline-block;
  width: 0.9rem;
  height: 0.9rem;
  border: 0.14rem solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: upload-spinner-spin 0.8s linear infinite;
  vertical-align: text-bottom;
}

@keyframes upload-spinner-spin {
  to {
    transform: rotate(360deg);
  }
}

.status-loader-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35em 0.65em;
  border-radius: 999px;
  font-size: 0.75em;
  font-weight: 700;
  line-height: 1;
}

.status-loader-muted {
  color: #495057;
  background: #e9ecef;
}

.status-loader-primary {
  color: #fff;
  background: #0d6efd;
}

.status-spinner {
  display: inline-block;
  width: 0.75em;
  height: 0.75em;
  border: 0.16em solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: upload-spinner-spin 0.8s linear infinite;
}

.card h2 {
  margin-bottom: 0;
}

.edit-shot-form {
  overflow-y: auto;
}

#edit-shot-modal .modal-dialog {
  max-width: min(1140px, calc(100vw - 2rem));
}

#edit-shot-modal .modal-content {
  max-height: calc(100vh - 2rem);
}

#edit-shot-modal .modal-body {
  overflow-y: auto;
  overscroll-behavior: contain;
}
