:root {
  --bg: #faf7f2;
  --ink: #2b2420;
  --muted: #7a6e66;
  --accent: #8a5a44;
  --card: #ffffff;
  --line: #e8e0d6;
  --ok: #4f7a52;
  --bad: #a4433a;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 Inter, system-ui, sans-serif; }
main { max-width: 720px; margin: 0 auto; padding: 32px 16px 64px; }
header { text-align: center; margin-bottom: 24px; }
.eyebrow { letter-spacing: .14em; text-transform: uppercase; font-size: 12px; color: var(--muted); margin: 0; }
h1 { font: 500 52px/1.1 "Cormorant Garamond", serif; margin: 8px 0; }
h1 em { color: var(--accent); }
h2 { font: 500 28px "Cormorant Garamond", serif; margin: 32px 0 12px; }
.lede { color: var(--muted); margin: 0; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 20px; }
.field { display: block; margin-bottom: 16px; }
.field span { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.field small { font-weight: 400; color: var(--muted); }
.field input { width: 100%; font: inherit; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.primary { display: block; text-align: center; background: var(--accent); color: #fff; font-weight: 600; font-size: 18px; padding: 18px; border-radius: 12px; cursor: pointer; }
.primary input { display: none; }
.hint { color: var(--muted); font-size: 13px; margin: 10px 0 0; }
.queue { list-style: none; padding: 0; margin: 12px 0 0; }
.queue li { padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.queue .name { display: flex; justify-content: space-between; gap: 8px; }
.queue .name span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.queue progress { width: 100%; height: 6px; accent-color: var(--accent); }
.queue .done { color: var(--ok); }
.queue .error { color: var(--bad); }
.queue button { font: inherit; color: var(--accent); background: none; border: 0; padding: 0; text-decoration: underline; cursor: pointer; }
.gallery-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 32px 0 12px; }
.gallery-head h2 { margin: 0; }
.view-toggle { display: inline-flex; flex-shrink: 0; border: 1px solid var(--line); border-radius: 999px; padding: 3px; background: var(--card); }
.view-toggle button { font: inherit; font-size: 13px; font-weight: 600; border: 0; background: none; color: var(--muted); padding: 6px 14px; border-radius: 999px; cursor: pointer; }
.view-toggle button[aria-pressed="true"] { background: var(--accent); color: #fff; }
.carousel { position: relative; }
.track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; scrollbar-width: none; border-radius: 12px; }
.track::-webkit-scrollbar { display: none; }
.slide { position: relative; flex: 0 0 100%; height: min(70vh, calc((100vw - 32px) * 1.25)); scroll-snap-align: center; border: 0; padding: 0; background: #1f1a17; cursor: pointer; }
.slide img { width: 100%; height: 100%; object-fit: contain; display: block; }
.slide .pending { display: grid; place-items: center; height: 100%; font-size: 14px; color: #bfb4aa; }
.slide .badge { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); background: rgb(0 0 0 / .55); color: #fff; font-size: 15px; padding: 10px 16px; border-radius: 999px; }
.nav { position: absolute; top: calc(min(70vh, calc((100vw - 32px) * 1.25)) / 2); transform: translateY(-50%); width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgb(255 255 255 / .85); color: var(--ink); font-size: 26px; line-height: 1; cursor: pointer; }
.nav.prev { left: 10px; }
.nav.next { right: 10px; }
.nav:disabled { opacity: 0; pointer-events: none; }
@media (hover: none) { .nav { display: none; } }
.caption { text-align: center; color: var(--muted); font-size: 14px; margin: 10px 0 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 6px; }
.tile { position: relative; aspect-ratio: 1; border: 0; padding: 0; border-radius: 8px; overflow: hidden; background: var(--line); cursor: pointer; }
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile .badge { position: absolute; right: 6px; bottom: 6px; background: rgb(0 0 0 / .55); color: #fff; font-size: 11px; padding: 2px 6px; border-radius: 6px; }
.tile .pending { display: grid; place-items: center; height: 100%; font-size: 12px; color: var(--muted); }
dialog { border: 0; padding: 0; background: #000; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; }
dialog::backdrop { background: #000; }
#viewer-body { display: grid; place-items: center; width: 100%; height: 100%; }
#viewer-body img, #viewer-body video { max-width: 100%; max-height: 100%; }
#viewer-body p { color: #ccc; }
.close { position: absolute; top: 12px; right: 12px; z-index: 1; font-size: 32px; color: #fff; background: none; border: 0; cursor: pointer; }
