:root { color-scheme: dark; font: 16px/1.5 system-ui, sans-serif; color: #f8f0e2; background: #101a19; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
.admin main { max-width: 56rem; margin: auto; padding: clamp(1rem, 5vw, 3rem); }
header { border-bottom: 1px solid #48605b; padding-bottom: 1.5rem; }
.brand { color: #f3ce8b; text-transform: uppercase; letter-spacing: .18em; margin: 0; }
h1, h2 { font: 500 1.7rem Georgia, serif; margin: 0 0 .75rem; }
h1 { font-size: clamp(3rem, 10vw, 5rem); }
a { color: #f3ce8b; }
section { background: #1b2a28; border: 1px solid #30443f; border-radius: 1rem; margin: 1.25rem 0; padding: clamp(1rem, 4vw, 1.75rem); }
label { display: block; margin-bottom: .5rem; }
button, input { font: inherit; }
button { border: 1px solid transparent; border-radius: .5rem; padding: .6rem .9rem; min-height: 44px; font-weight: 650; background: #f3ce8b; color: #19221f; cursor: pointer; }
button:disabled { opacity: .45; cursor: default; }
button.secondary { background: #243732; color: #f8f0e2; border-color: #506760; }
input[type=password] { padding: .55rem; min-height: 44px; border: 1px solid #506760; background: #131f1c; border-radius: .5rem; width: min(100%, 19rem); margin: 0 .4rem .5rem 0; }
input[type=file] { display: block; max-width: 100%; margin: 0 0 .75rem; }
input::file-selector-button { font: inherit; min-height: 44px; border: 0; border-radius: .5rem; padding: .55rem; margin-right: .5rem; cursor: pointer; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(125px, 1fr)); list-style: none; padding: 0; gap: .75rem; }
.grid:empty { display: none; }
.grid li { overflow: hidden; background: #101a19; border-radius: .6rem; padding: .4rem; }
.grid img { display: block; width: 100%; aspect-ratio: 4/3; object-fit: contain; }
.grid button { width: 100%; margin-top: .4rem; }
#publish { margin-top: .65rem; }
#status { color: #f3ce8b; }
.viewer { background: #050807; width: 100vw; height: 100vh; display: grid; place-items: center; overflow: hidden; }
.stage { width: min(100vw, calc(100vh * 16 / 9)); aspect-ratio: 16/9; position: relative; container-type: inline-size; }
.stage > img, .fallback { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.fallback { display: grid; place-content: center; text-align: center; background: radial-gradient(ellipse at 50% 30%, #2c4a40, #111f1b 75%); color: #f3ce8b; }
.fallback::before { content: ""; position: absolute; inset: 5%; border: 1px solid #9b8758; }
.fallback span { font-size: 3cqw; letter-spacing: .3em; }
.fallback strong { font: 500 13cqw/1.05 Georgia, serif; }

.phone-qr { position: absolute; z-index: 1; top: .75rem; right: .75rem; text-align: right; }
.phone-qr summary { display: inline-flex; align-items: center; min-height: 44px; list-style: none; padding: .35rem .75rem; border: 1px solid #506760; border-radius: .5rem; background: #172522; color: #f8f0e2; font-weight: 600; cursor: pointer; }
.phone-qr summary::-webkit-details-marker { display: none; }
.qr-panel { background: #172522; border: 1px solid #506760; border-radius: .65rem; margin-top: .45rem; padding: .75rem; width: min(15rem, 80vw); text-align: center; }
.qr-panel img { display: block; width: min(100%, 45vh); height: auto; margin: 0 auto; }
.qr-panel p { margin: .5rem 0 0; font-size: .875rem; }

.photo-actions, .section-heading { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.section-heading { justify-content: space-between; }
.section-heading h2 { margin: 0; }
.grid li { position: relative; }
.grid .photo-close { position: absolute; top: 0; right: 0; width: 44px; height: 44px; margin: 0; padding: 0; border-radius: 0 .6rem 0 .6rem; background: #101a19; color: #fff8ea; font-size: 1.65rem; line-height: 1; }
button.text-button { background: transparent; color: #d0d7d0; padding: .35rem 0; font-weight: 500; text-decoration: underline; text-underline-offset: .2em; }
.archive-grid { grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); }
@media (max-width: 32rem) {
  .photo-actions button { flex: 1 1 100%; }
}
