.archive-block {
  margin: 0 0 20px;
}
button.archive-add,
.archive-add {
  display: block;
  box-sizing: border-box;
  width: 100%;
  min-height: 48px;
  height: auto;
  margin: 0 0 16px;
  padding: 0 16px;
  border: 0;
  border-radius: 12px;
  background: #f7ead8;
  color: #1a120f;
  font: 700 16px/1 Inter, system-ui, sans-serif;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
.archive-heading {
  margin: 0 0 8px;
  font-family: Cinzel, serif;
  font-weight: 500;
  letter-spacing: 0.16em;
  font-size: 13px;
  text-transform: uppercase;
  color: #d4b98a;
}
.archive-gallery {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0;
}
.archive-gallery[hidden] { display: none; }
.archive-shot {
  position: relative;
  margin: 0;
  display: block;
  width: 100%;
  background: #14100e;
  border: 1px solid rgba(212, 185, 138, 0.18);
  border-radius: 0;
  min-height: 0;
  height: auto;
  padding: 0;
  cursor: zoom-in;
  color: inherit;
  font: inherit;
  line-height: 0;
  overflow: hidden;
  -webkit-appearance: none;
  appearance: none;
}
button.archive-shot {
  border: 1px solid rgba(212, 185, 138, 0.18);
  border-radius: 0;
  min-height: 0;
  height: auto;
  background: #14100e;
}
.archive-shot img,
.archive-shot video {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: top;
  border-radius: 0;
}
.archive-shot .archive-play {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 36px;
  height: 36px;
  margin: -18px 0 0 -18px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  color: #f4ead6;
  pointer-events: none;
}
.archive-shot .archive-play svg {
  display: block;
  margin: 8px 0 0 11px;
}
.archive-pick {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1.5px solid rgba(244, 234, 214, 0.95);
  background: rgba(0, 0, 0, 0.28);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  padding: 0;
  z-index: 2;
  cursor: pointer;
}
.archive-pick::before { content: ""; position: absolute; inset: -16px; }
.archive-shot.selected .archive-pick {
  background: #007aff;
  border-color: #f4ead6;
}
.archive-shot.selected .archive-pick::after {
  content: "";
  position: absolute;
  left: 8px;
  top: 5px;
  width: 6px;
  height: 11px;
  border: solid #f4ead6;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
body.at-select-cap .archive-shot:not(.selected) .archive-pick {
  opacity: 0.28;
  pointer-events: none;
  cursor: default;
}
.archive-empty {
  margin: 0 0 18px;
  padding: 28px 16px;
  border: 1px dashed rgba(212, 185, 138, 0.35);
  background: #14100e;
  text-align: center;
  color: rgba(244, 234, 214, 0.75);
  font-size: 14px;
}
.archive-empty[hidden] { display: none; }
.archive-tray {
  position: fixed;
  left: 50%;
  bottom: calc(180px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 1100;
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 6px 8px 6px 0;
  background: rgba(28, 28, 30, 0.92);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 0;
  border-radius: 999px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
  color: #f4ead6;
  font: 600 15px/1.2 Inter, system-ui, sans-serif;
  min-height: 0;
  height: auto;
  width: auto;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
button.archive-tray {
  border: 0;
  border-radius: 999px;
  background: rgba(28, 28, 30, 0.92);
  color: #f4ead6;
  min-height: 0;
  height: auto;
}
.archive-tray[hidden] { display: none; }
.archive-tray svg {
  width: 22px;
  height: 22px;
  margin: 11px 14px 11px 4px;
  flex: 0 0 auto;
  pointer-events: none;
}
.archive-tray-count { min-width: 0; text-align: center; padding: 0 10px 0 16px; white-space: nowrap; pointer-events: none; }
.archive-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(10, 7, 6, 0.94);
  display: none;
  align-items: center;
  justify-content: center;
  padding:
    calc(12px + env(safe-area-inset-top, 0px))
    calc(12px + env(safe-area-inset-right, 0px))
    calc(12px + env(safe-area-inset-bottom, 0px))
    calc(12px + env(safe-area-inset-left, 0px));
  z-index: 1200;
}
.archive-lightbox.open { display: flex; }
.archive-lightbox img,
.archive-lightbox video {
  max-width: 100%;
  max-height: calc(100% - 72px);
  object-fit: contain;
  z-index: 0;
}
.archive-lightbox.is-video video {
  max-height: calc(100% - 220px);
}
.archive-lightbox #archive-close {
  position: absolute;
  top: calc(8px + env(safe-area-inset-top, 0px));
  right: calc(10px + env(safe-area-inset-right, 0px));
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #2a241f;
  color: #f4ead6;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.archive-lightbox .archive-dl {
  position: absolute;
  z-index: 5;
  left: 50%;
  bottom: calc(180px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  color: #f4ead6;
  background: #9b1c24;
  text-decoration: none;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 10px 18px;
  border: 1px solid #d4b98a;
  cursor: pointer;
  font-family: Inter, system-ui, sans-serif;
}
.archive-lightbox .archive-del {
  position: absolute;
  z-index: 5;
  left: 50%;
  bottom: calc(128px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  color: #f4ead6;
  background: #2a241f;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 10px 18px;
  border: 1px solid rgba(212, 185, 138, 0.45);
  border-radius: 0;
  cursor: pointer;
  font-family: Inter, system-ui, sans-serif;
}
.archive-lightbox.is-video .archive-dl {
  bottom: calc(220px + env(safe-area-inset-bottom, 0px));
}
.archive-lightbox.is-video .archive-del {
  bottom: calc(168px + env(safe-area-inset-bottom, 0px));
}
@media (min-width: 640px) {
  .archive-gallery { grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
}
.archive-queue {
  position: fixed;
  inset: 0;
  z-index: 1300;
  background: rgba(10, 7, 6, 0.92);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 12px 12px calc(18px + env(safe-area-inset-bottom, 0px));
}
.archive-queue[hidden] { display: none; }
.archive-queue-card {
  width: 100%;
  max-width: 520px;
  max-height: min(78vh, 640px);
  overflow: auto;
  background: #17120f;
  border: 1px solid rgba(212, 185, 138, 0.28);
  border-radius: 22px;
  padding: 22px 18px 18px;
  color: #f4ead6;
}
.archive-queue-card h2 {
  margin: 0 0 8px;
  font-family: Cinzel, serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #d4b98a;
}
.archive-queue-status,
.archive-queue-count {
  margin: 0 0 10px;
  font: 600 15px/1.3 Inter, system-ui, sans-serif;
}
.archive-queue-bar {
  height: 8px;
  margin: 0 0 12px;
  border-radius: 999px;
  background: #2a241f;
  overflow: hidden;
}
.archive-queue-bar span {
  display: block;
  height: 100%;
  width: 0;
  background: #d4b98a;
}
.archive-queue-list {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  font: 500 14px/1.45 Inter, system-ui, sans-serif;
  color: rgba(244, 234, 214, 0.82);
}
.archive-queue-list li {
  padding: 8px 0;
  border-top: 1px solid rgba(244, 234, 214, 0.12);
}
button.archive-queue-done,
.archive-queue-done {
  display: block;
  width: 100%;
  min-height: 48px;
  margin: 0;
  border: 0;
  border-radius: 12px;
  background: #f7ead8;
  color: #1a120f;
  font: 700 16px/1 Inter, system-ui, sans-serif;
  cursor: pointer;
}
