/* ==========================================================================
   Lysbildeskanning – stilark
   Farger og fonter styres av variablene under :root.
   ========================================================================== */
:root {
  --bg: #f6f1e9;
  --surface: #fffdf9;
  --surface-2: #efe7da;
  --ink: #2a241f;
  --muted: #6e6359;
  --line: #e2d7c6;
  --accent: #b9471c;
  --accent-hover: #9c3b16;
  --accent-soft: #f8e3d6;
  --ok: #2f7a4d;
  --ok-soft: #e1f1e6;
  --warn: #9a5b07;
  --warn-soft: #fbefd5;
  --err: #b42318;
  --err-soft: #fbe4e1;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(42, 36, 31, .06), 0 6px 24px rgba(42, 36, 31, .06);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
main { flex: 1; }
img { max-width: 100%; display: block; }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-hover); }
h1, h2, h3 { font-family: var(--serif); line-height: 1.2; font-weight: 600; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 4.5vw, 3rem); letter-spacing: -.01em; }
h2 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
code { background: var(--surface-2); padding: .1em .35em; border-radius: 4px; font-size: .9em; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 640px) { .wrap { padding: 0 28px; } }
.narrow { max-width: 760px; }
.tiny { max-width: 440px; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.strong { font-weight: 600; }
.pre { white-space: pre-line; }
.text-warn { color: var(--warn); }
.text-ok { color: var(--ok); }
.nowrap { white-space: nowrap; }
.card-highlight { border-color: #efc9b1; box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow); }
.card-highlight .email-form { border-bottom: 0; padding-bottom: 0; margin-bottom: 0; }
.email-form { margin-bottom: 1.25rem; padding-bottom: 1.25rem; border-bottom: 1px solid var(--line); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.no-scroll { overflow: hidden; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; font-weight: 600; color: var(--accent); margin-bottom: .6em; }
.lead { font-size: 1.15rem; color: var(--muted); }

/* ---------- Knapper ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4em;
  background: var(--accent); color: #fff; border: 1px solid var(--accent);
  padding: .75em 1.4em; border-radius: 999px; font: 600 1rem/1.2 var(--sans);
  text-decoration: none; cursor: pointer; transition: background .15s, transform .1s;
}
.btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-small { padding: .5em 1em; font-size: .9rem; }
.btn-wide { width: 100%; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--surface-2); color: var(--ink); border-color: var(--line); }
.btn-danger { background: var(--err); border-color: var(--err); }
.btn-danger:hover { background: #8f1c13; border-color: #8f1c13; }
.link-button { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.button-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
form.inline { display: inline; margin: 0; }

/* ---------- Topp og bunn ---------- */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 64px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
.logo { display: flex; align-items: center; gap: .6rem; font: 600 1.15rem var(--serif); color: var(--ink); text-decoration: none; }
.logo-mark {
  width: 26px; height: 26px; border-radius: 4px; background: #fff; border: 1px solid var(--line);
  box-shadow: inset 0 0 0 5px #fff, inset 0 0 0 26px var(--accent);
  flex-shrink: 0;
}
.site-nav { display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap; font-size: .95rem; }
.site-nav a:not(.btn), .site-nav .link-button { color: var(--ink); text-decoration: none; }
.site-nav a:not(.btn):hover, .site-nav .link-button:hover { color: var(--accent); }
@media (max-width: 720px) {
  .site-nav a:not(.btn) { display: none; }
  .admin .site-nav a:not(.btn), .gallery-page .site-nav a:not(.btn) { display: inline; }
}
.site-footer { background: var(--surface); border-top: 1px solid var(--line); padding: 2rem 0; font-size: .9rem; color: var(--muted); margin-top: 3rem; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 1.5rem 3rem; justify-content: space-between; }
.site-footer a { color: var(--muted); }

/* ---------- Seksjoner ---------- */
.section { padding: 3.5rem 0; }
.section-tight { padding: 2rem 0; }
.section-alt { background: var(--surface-2); }
.section > .wrap > h2 { margin-bottom: 1.5rem; }

/* ---------- Forside ---------- */
.hero { padding: 3rem 0 4rem; overflow: hidden; }
.hero-inner { display: grid; gap: 3rem; align-items: center; }
@media (min-width: 900px) { .hero-inner { grid-template-columns: 1.1fr .9fr; } .hero { padding: 5rem 0 6rem; } }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }
.hero-art { position: relative; height: 320px; max-width: 420px; width: 100%; margin: 0 auto; }
.slide {
  position: absolute; width: 200px; height: 200px; background: #fbfaf6; border-radius: 10px;
  box-shadow: 0 2px 4px rgba(0,0,0,.08), 0 18px 40px rgba(60, 40, 20, .18);
  display: flex; align-items: center; justify-content: center;
}
.slide span { position: absolute; bottom: 10px; right: 14px; font: 600 .7rem var(--sans); letter-spacing: .1em; color: #a69a8a; }
.slide-window { width: 150px; height: 100px; border-radius: 3px; }
.slide-1 { left: 0; top: 70px; transform: rotate(-8deg); }
.slide-2 { left: 110px; top: 0; transform: rotate(5deg); z-index: 2; }
.slide-3 { left: 190px; top: 110px; transform: rotate(-2deg); z-index: 3; }
.w-sunset { background: linear-gradient(180deg, #f0a04b 0%, #e2683c 45%, #7d3b52 46%, #3b2a3f 100%); }
.w-sea { background: linear-gradient(180deg, #8cc5e3 0%, #cfe7ef 50%, #3f86a8 51%, #24607d 100%); }
.w-forest { background: linear-gradient(180deg, #d9e6c3 0%, #a9c98a 40%, #4d7a3e 41%, #2f4f2a 100%); }
/* Fargenegativ med oransje maske og perforering */
.negative-strip {
  position: absolute; left: -30px; top: 236px; width: 420px; height: 72px; z-index: 0;
  display: flex; gap: 6px; padding: 15px 8px;
  background: #c4692f; border-radius: 3px; transform: rotate(-12deg);
  box-shadow: 0 10px 30px rgba(60, 40, 20, .2);
}
.negative-strip::before, .negative-strip::after {
  content: ""; position: absolute; left: 6px; right: 6px; height: 5px;
  background: repeating-linear-gradient(90deg, rgba(255, 244, 228, .9) 0 6px, transparent 6px 13px);
}
.negative-strip::before { top: 5px; }
.negative-strip::after { bottom: 5px; }
.negative-strip span { flex: 1; border-radius: 2px; background: linear-gradient(180deg, #3d6f8f 0%, #5d93a8 45%, #a8d0d6 46%, #cfe3e0 100%); opacity: .85; }
.negative-strip span:nth-child(2) { background: linear-gradient(180deg, #2b5476 0%, #3a7a8c 55%, #b3d6cf 56%, #e0ece6 100%); }
.negative-strip span:nth-child(3) { background: linear-gradient(180deg, #4a3f78 0%, #6f8fb4 50%, #c6dccd 51%, #e5efe3 100%); }
@media (max-width: 480px) {
  .hero-art { height: 250px; max-width: 320px; }
  .slide { width: 150px; height: 150px; }
  .slide-window { width: 112px; height: 76px; }
  .slide-1 { left: 6px; top: 60px; }
  .slide-2 { left: 88px; }
  .slide-3 { left: 160px; top: 92px; }
  .negative-strip { width: 320px; height: 58px; top: 186px; left: -10px; padding: 12px 6px; }
}

.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.steps li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; }
.steps p { color: var(--muted); margin: 0; }
.step-no { display: inline-flex; width: 2rem; height: 2rem; align-items: center; justify-content: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 700; margin-bottom: .8rem; }

.price-grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.price-list { margin: .3rem 0 .9rem; display: grid; gap: .2rem; }
.price-list div { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; border-bottom: 1px dashed var(--line); padding: .25rem 0; }
.price-list dt { color: var(--muted); }
.price { font: 600 1.6rem var(--serif); margin: 0; }
.price span { font: 400 .85rem var(--sans); color: var(--muted); }
.checklist { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; gap: .4rem; }
.checklist li::before { content: "✓"; color: var(--ok); font-weight: 700; margin-right: .6rem; }

.faq { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: .75rem; }
.faq summary { padding: 1rem 1.25rem; cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent); font-size: 1.3rem; line-height: 1; }
.faq[open] summary::after { content: "–"; }
.faq p { padding: 0 1.25rem 1.1rem; margin: 0; color: var(--muted); }
.cta { background: var(--ink); color: #f6f1e9; }
.cta p { color: #cfc4b5; }

/* ---------- Kort og skjema ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); margin-bottom: 1.5rem; }
@media (min-width: 640px) { .card { padding: 2rem; } }
.card h2 { font-size: 1.35rem; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: .75rem; }
.card-head h2 { margin: 0; }
.form fieldset { border: 0; padding: 0; margin: 0 0 1.75rem; }
.form legend { font: 600 1.2rem var(--serif); margin-bottom: .9rem; padding: 0; }
.field { margin-bottom: 1.1rem; }
.field-row { display: grid; gap: 0 1rem; }
@media (min-width: 640px) { .field-row { grid-template-columns: 1fr 1fr; } }
label, .label { display: block; font-weight: 600; font-size: .95rem; margin-bottom: .35rem; }
.optional { font-weight: 400; color: var(--muted); }
input[type=text], input[type=email], input[type=tel], input[type=password], input[type=search], input:not([type]),
input[inputmode], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: #fff;
  border: 1px solid #d3c6b3; border-radius: 8px; padding: .65em .8em;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[readonly], textarea[readonly] { background: var(--bg); }
textarea { resize: vertical; }
input.short { max-width: 10rem; }
.hint { font-size: .85rem; color: var(--muted); margin: .35rem 0 0; }
.note { margin: .6rem 0 0; padding: .55rem .8rem; border-radius: 8px; background: var(--warn-soft); color: #6b3f04; font-size: .88rem; }
.note[hidden] { display: none; }
.field-error { color: var(--err); font-size: .88rem; margin: .35rem 0 0; font-weight: 500; }
.has-error input, .has-error textarea, .has-error select { border-color: var(--err); }
.hp { position: absolute; left: -9999px; }

.choice-grid { display: grid; gap: .75rem; }
.choice { display: flex; gap: .8rem; align-items: flex-start; border: 1px solid #d3c6b3; border-radius: 10px; padding: .9rem 1rem; cursor: pointer; font-weight: 400; background: #fff; }
.choice:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.choice input { margin-top: .3rem; accent-color: var(--accent); }
.choice-body { display: block; }
.choice-price { color: var(--accent); font-weight: 600; margin-left: .3rem; }
.choice-desc { display: block; color: var(--muted); font-size: .9rem; }
.estimate { background: var(--accent-soft); border: 1px solid #efc9b1; border-radius: 10px; padding: 1rem 1.15rem; margin-bottom: 1.1rem; }
.estimate-total { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; font-weight: 600; }
.estimate-total strong { font: 600 1.6rem var(--serif); color: var(--accent); }
.estimate-lines { list-style: none; padding: 0; margin: .4rem 0 .2rem; font-size: .9rem; color: var(--muted); }
.estimate-lines li { display: flex; justify-content: space-between; gap: 1rem; padding: .15rem 0; }
.estimate-lines li span:last-child { white-space: nowrap; }
.pill-choices { display: flex; flex-wrap: wrap; gap: .5rem; }
.pill-choice { margin: 0; font-weight: 500; cursor: pointer; }
.pill-choice input { position: absolute; opacity: 0; }
.pill-choice span { display: inline-block; padding: .5em 1.1em; border: 1px solid #d3c6b3; border-radius: 999px; background: #fff; }
.pill-choice input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; }
.pill-choice input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.check { display: flex; gap: .7rem; font-weight: 400; align-items: flex-start; cursor: pointer; }
.check input { margin-top: .35rem; width: 1.1rem; height: 1.1rem; accent-color: var(--accent); flex-shrink: 0; }

.flashes { padding-top: 1rem; }
.flash { padding: .85rem 1.1rem; border-radius: 10px; margin-bottom: 1rem; border: 1px solid transparent; }
.flash-ok { background: var(--ok-soft); color: #1f5434; border-color: #bfe0ca; }
.flash-error { background: var(--err-soft); color: #7a1a12; border-color: #f2c3bd; }
.flash-warn { background: var(--warn-soft); color: #6b3f04; border-color: #f0d9a8; }
.notice-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

.dl { display: grid; grid-template-columns: max-content 1fr; gap: .45rem 1.25rem; margin: 0; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 480px) { .dl { grid-template-columns: 1fr; } .dl dd { margin-bottom: .4rem; } .dl dt { font-size: .85rem; } }

/* Kvittering */
.order-no { font: 600 2.2rem var(--serif); letter-spacing: .03em; background: var(--surface); border: 2px dashed var(--accent); display: inline-block; padding: .3em .8em; border-radius: 10px; margin-bottom: 1.5rem; }
.pack-steps { padding-left: 1.2rem; }
.pack-steps li { margin-bottom: .5rem; }
.send-address { font-style: normal; font-size: 1.1rem; font-weight: 600; background: var(--bg); border-left: 4px solid var(--accent); padding: .9rem 1.2rem; margin: .5rem 0 1rem; border-radius: 0 8px 8px 0; }
.summary { margin-top: 2rem; }

.prose h2 { margin-top: 2rem; font-size: 1.3rem; }
.prose ul { padding-left: 1.2rem; }

.empty-slide { width: 120px; height: 120px; margin: 0 auto 1.5rem; border-radius: 10px; background: #fbfaf6; box-shadow: inset 0 0 0 22px #fbfaf6, inset 0 0 0 200px var(--surface-2), 0 10px 30px rgba(60,40,20,.15); }

/* ---------- Admin ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.page-head h1 { font-size: clamp(1.6rem, 3.5vw, 2.2rem); margin: 0 0 .2rem; display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.page-head p { margin: 0; }
.back { margin: 0 0 .5rem; font-size: .9rem; }
.back a { text-decoration: none; }
.grid-2 { display: grid; gap: 0 1.5rem; }
@media (min-width: 900px) { .grid-2 { grid-template-columns: 1.2fr 1fr; } }

.toolbar { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.tabs { display: flex; flex-wrap: wrap; gap: .35rem; }
.tabs a { padding: .4em .9em; border-radius: 999px; text-decoration: none; color: var(--ink); font-size: .9rem; border: 1px solid var(--line); background: var(--surface); }
.tabs a.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.tabs .count { opacity: .6; font-size: .8em; margin-left: .2em; }
.search input { min-width: 240px; padding: .5em .9em; border-radius: 999px; }

.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.table { width: 100%; border-collapse: collapse; font-size: .95rem; min-width: 760px; }
.table th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; padding: .8rem 1rem; border-bottom: 1px solid var(--line); background: var(--bg); }
.table td { padding: .85rem 1rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fcf8f1; }
.table .num { text-align: right; }
.table td:first-child { white-space: nowrap; }
.empty { text-align: center; }

.status { display: inline-block; font: 600 .75rem var(--sans); padding: .3em .75em; border-radius: 999px; white-space: nowrap; letter-spacing: .02em; vertical-align: middle; }
.status-ny { background: #e8e3f7; color: #4b3a8c; }
.status-mottatt { background: #dfeefa; color: #1d5b8a; }
.status-skannes { background: var(--warn-soft); color: var(--warn); }
.status-ferdig { background: var(--ok-soft); color: var(--ok); }
.status-returnert { background: var(--surface-2); color: var(--muted); }
.status-arkivert { background: #eee; color: #777; }
.status-utlopt { background: var(--err-soft); color: var(--err); }

.share { display: grid; gap: 0 1.5rem; }
@media (min-width: 760px) { .share { grid-template-columns: 1fr auto auto; } }
.copy-row { display: flex; gap: .5rem; }
.copy-row input { flex: 1; min-width: 0; font-size: .9rem; }
.pin { font: 700 1.6rem/1.3 ui-monospace, Consolas, monospace; letter-spacing: .15em; margin: 0; }
.pin-sub { font-size: 1.1rem; font-weight: 600; margin: .3rem 0 0; }
#message { font: .92rem/1.5 var(--sans); }

.dropzone { border: 2px dashed #cdbda6; border-radius: var(--radius); padding: 2rem 1rem; text-align: center; background: var(--bg); transition: background .15s, border-color .15s; margin-bottom: 1.25rem; }
.dropzone.is-over { border-color: var(--accent); background: var(--accent-soft); }
.dropzone-title { font: 600 1.25rem var(--serif); margin-bottom: .25rem; }
.dropzone p { margin-bottom: .3rem; }
.upload-status { margin-bottom: 1.25rem; }
.progress { height: 10px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.progress-bar { height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.upload-status p { margin: .5rem 0; }
.upload-errors { color: var(--err); font-size: .88rem; padding-left: 1.1rem; max-height: 180px; overflow: auto; }

.thumb-grid { list-style: none; padding: 0; margin: 0; display: grid; gap: .9rem; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.thumb { position: relative; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.thumb img { width: 100%; aspect-ratio: 1; object-fit: contain; background: #2a2622; }
.thumb-meta { padding: .45rem .6rem; display: flex; flex-direction: column; }
.thumb-name { font-size: .82rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thumb-delete { position: absolute; top: 6px; right: 6px; }
.thumb-delete button { width: 28px; height: 28px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; font-size: 1.1rem; line-height: 1; cursor: pointer; opacity: 0; transition: opacity .15s; }
.thumb:hover .thumb-delete button, .thumb-delete button:focus-visible { opacity: 1; }
.thumb-delete button:hover { background: var(--err); }
@media (hover: none) { .thumb-delete button { opacity: .85; } }

.danger-zone summary { cursor: pointer; font-weight: 600; color: var(--err); }
.danger-zone p { margin: .75rem 0; color: var(--muted); }

/* ---------- Kundegalleri ---------- */
.gallery-page { --bg: #1d1a17; --surface: #262220; --surface-2: #302b27; --ink: #f1ebe2; --muted: #a99d90; --line: #3a3430; --accent: #e07a4a; --accent-hover: #ec8d60; --accent-soft: #4a2c1e; --shadow: none; }
.gallery-page .logo-mark { background: #fff; border-color: #fff; box-shadow: inset 0 0 0 5px #fff, inset 0 0 0 26px var(--accent); }
.gallery-page .btn { color: #1d1a17; }
.gallery-page .btn:hover { color: #1d1a17; }
.gallery-page .btn-ghost { color: var(--ink); }
.gallery-page .flash-warn { background: #3d2f17; color: #f3d79c; border-color: #5a4522; }
.gallery-page .flash-error { background: #3f1f1b; color: #f6b8b0; border-color: #5c2a24; }
.gallery-page input { background: #15130f; border-color: var(--line); color: var(--ink); }
.gallery-page .empty-slide { background: #3a3430; box-shadow: inset 0 0 0 22px #3a3430, inset 0 0 0 200px #15130f; }
.gallery-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1.25rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.gallery-head h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); }
.gallery-head p { margin: 0; }
.tip { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 0 10px 10px 0; padding: .9rem 1.1rem; margin-bottom: 1.75rem; font-size: .92rem; color: var(--muted); }
.tip strong { color: var(--ink); }
.photo-grid { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
@media (min-width: 900px) { .photo-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); } }
.photo { display: block; border-radius: 8px; overflow: hidden; background: #0f0d0b; }
.photo img { width: 100%; aspect-ratio: 1; object-fit: contain; transition: transform .25s; }
.photo:hover img { transform: scale(1.03); }
.photo-meta { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .4rem .1rem 0; }
.photo-name { font-size: .8rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.photo-dl { flex-shrink: 0; width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-weight: 700; }
.photo-dl:hover { background: var(--accent); border-color: var(--accent); color: #1d1a17; }

.lock { width: 56px; height: 56px; margin: 0 auto 1rem; border-radius: 12px; background: #fbfaf6; box-shadow: inset 0 0 0 10px #fbfaf6, inset 0 0 0 60px var(--accent); }
.pin-input { text-align: center; font: 700 1.8rem ui-monospace, Consolas, monospace !important; letter-spacing: .35em; padding: .4em !important; }

.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(10, 9, 8, .96); display: grid; grid-template-rows: auto 1fr; }
.lightbox[hidden] { display: none; }
.lb-top { display: flex; align-items: center; gap: 1rem; padding: .75rem 1rem; color: #d9d0c4; font-size: .9rem; }
.lb-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #a99d90; }
.lb-actions { display: flex; align-items: center; gap: .5rem; }
.lb-stage { margin: 0; display: flex; align-items: center; justify-content: center; padding: 0 1rem 1rem; min-height: 0; }
.lb-stage img { max-width: 100%; max-height: 100%; object-fit: contain; box-shadow: 0 10px 50px rgba(0,0,0,.6); }
.lb-btn { background: rgba(255,255,255,.08); border: 0; color: #fff; width: 44px; height: 44px; border-radius: 50%; font-size: 1.6rem; line-height: 1; cursor: pointer; }
.lb-btn:hover { background: rgba(255,255,255,.2); }
.lb-prev, .lb-next { position: absolute; top: 50%; transform: translateY(-50%); width: 52px; height: 52px; font-size: 2rem; }
.lb-prev { left: 12px; }
.lb-next { right: 12px; }
@media (max-width: 640px) {
  .lb-prev, .lb-next { top: auto; bottom: 14px; transform: none; }
  .lb-stage { padding-bottom: 80px; }
  .lb-name { display: none; }
}
