@font-face { font-family: Archivo; font-style: normal; font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; src: url("../fonts/archivo-latin-ext.589f7bc0fac4.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: Archivo; font-style: normal; font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; src: url("../fonts/archivo-latin.de2f1fe81758.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
/*
  Marques Photos – Stylesheet
  Welt »Filmrand«: ein Material, zwei Lichtsituationen.
  .lt = Leuchttisch (Verwaltung, hell, Operate)
  .fm = Film/Projektion (Kundengalerie, dunkel, Experience)
  Werte und Begründungen: ../DESIGN.md
*/

/* ---------- Tokens ---------- */
:root {
  --font: "Archivo", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --stretch-edge: 68%;   /* Randschrift */
  --stretch-ui: 100%;
  --stretch-title: 118%; /* Galerietitel */

  --t-edge: .75rem;
  --t-sm: .875rem;   --lh-sm: 1.25rem;
  --t-md: 1rem;      --lh-md: 1.5rem;
  --t-lg: 1.25rem;   --lh-lg: 1.625rem;
  --t-xl: 1.75rem;   --lh-xl: 2.125rem;
  --t-title: clamp(2.25rem, 1.5rem + 3.6vw, 4.75rem);

  --s-1: .25rem; --s-2: .5rem; --s-3: .75rem; --s-4: 1rem; --s-5: 1.5rem;
  --s-6: 2rem;   --s-7: 3rem;  --s-8: 4rem;   --s-9: 6rem;

  --tap: 2.75rem;          /* 44px Mindest-Touchziel */
  --bar: 3.5rem;           /* 56px Kopfleiste */
  --r-ctl: 8px;
  --r-panel: 12px;
  --r-photo: 2px;
  --gutter: 1rem;
  --admin-max: 75rem;      /* 1200px */
  --wall-max: 105rem;      /* 1680px */

  --ease: cubic-bezier(.16, 1, .3, 1);
  --d-1: 120ms; --d-2: 200ms; --d-3: 320ms;

  /* Leuchttisch */
  --lt-bg: #F1F1EE;
  --lt-surface: #FFFFFF;
  --lt-sunken: #E7E6E2;
  --lt-line: #D9D8D2;
  --lt-line-strong: #8C897F;
  --lt-ink: #191815;
  --lt-ink-2: #5B5850;
  --lt-ink-3: #6F6B62;
  --edge-ink: #8A4E0B;    /* Bernstein als Text auf hell */
  --edge-mark: #B06A14;   /* Bernstein als Markierung auf hell */
  --ok: #2E6B3C;
  --ok-bg: #EAF3EC;
  --danger: #A8261B;
  --danger-bg: #FBEDEB;

  /* Film */
  --fm-bg: #13110E;
  --fm-raised: #1C1915;
  --fm-line: #2D2924;
  --fm-line-strong: #736C61;
  --fm-ink: #EEE8DD;
  --fm-ink-2: #A69D8F;
  --fm-edge: #E3A65A;     /* Randschrift-Bernstein */
  --fm-ph: #221E19;       /* Platzhalter beim Laden */
  --fm-danger: #F08A7E;
}
@media (min-width: 768px)  { :root { --gutter: 1.5rem; } }
@media (min-width: 1280px) { :root { --gutter: 2rem; } }

.lt {
  --bg: var(--lt-bg); --surface: var(--lt-surface); --sunken: var(--lt-sunken);
  --line: var(--lt-line); --line-strong: var(--lt-line-strong);
  --ink: var(--lt-ink); --ink-2: var(--lt-ink-2); --ink-3: var(--lt-ink-3);
  --accent: var(--edge-ink); --mark: var(--edge-mark);
  --btn-bg: var(--lt-ink); --btn-ink: #FFFFFF; --focus: var(--edge-ink);
  --err: var(--danger);
  color-scheme: light;
}
.fm {
  --bg: var(--fm-bg); --surface: var(--fm-raised); --sunken: var(--fm-ph);
  --line: var(--fm-line); --line-strong: var(--fm-line-strong);
  --ink: var(--fm-ink); --ink-2: var(--fm-ink-2); --ink-3: var(--fm-ink-2);
  --accent: var(--fm-edge); --mark: var(--fm-edge);
  --btn-bg: var(--fm-ink); --btn-ink: var(--fm-bg); --focus: var(--fm-edge);
  --err: var(--fm-danger);
  color-scheme: dark;
}

/* ---------- Basis ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--t-md);
  line-height: var(--lh-md);
  font-stretch: var(--stretch-ui);
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.icon {
  width: 20px; height: 20px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.5;
  stroke-linecap: round; stroke-linejoin: round;
}
.icon--sm { width: 16px; height: 16px; stroke-width: 1.75; }

/* Randschrift: die Typografie der Filmkante */
.edge {
  font-size: var(--t-edge);
  line-height: 1rem;
  font-weight: 600;
  font-stretch: var(--stretch-edge);
  letter-spacing: .1em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
}
.edge--quiet { color: var(--ink-2); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: var(--tap);
  padding: 0 1rem;
  border: 1px solid transparent;
  border-radius: var(--r-ctl);
  background: transparent;
  font-size: .9375rem; font-weight: 600; line-height: 1.25rem;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--d-1) var(--ease), border-color var(--d-1) var(--ease),
              color var(--d-1) var(--ease), transform var(--d-1) var(--ease);
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn--primary { background: var(--btn-bg); color: var(--btn-ink); }
.btn--primary:hover { background: color-mix(in oklab, var(--btn-bg) 84%, var(--bg)); }
.btn--secondary { background: var(--surface); border-color: var(--line-strong); color: var(--ink); }
.btn--secondary:hover { background: color-mix(in oklab, var(--ink) 5%, var(--surface)); }
.btn--ghost { color: var(--ink); }
.btn--ghost:hover { background: color-mix(in oklab, var(--ink) 7%, transparent); }
.btn--danger { background: var(--danger); color: #FFFFFF; }
.btn--danger:hover { background: color-mix(in oklab, var(--danger) 86%, #000); }
.btn--danger-quiet { color: var(--err); border-color: color-mix(in oklab, var(--err) 45%, transparent); }
.btn--danger-quiet:hover { background: color-mix(in oklab, var(--err) 8%, transparent); }
.btn--icon { width: var(--tap); padding: 0; }
.btn--block { width: 100%; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .42; cursor: not-allowed; }
.btn[aria-busy="true"] { cursor: progress; }
.btn .when-idle, .btn .when-done { display: inline-flex; align-items: center; gap: .5rem; }
.btn .when-done, .btn.is-done .when-idle { display: none; }
.btn.is-done .when-done { display: inline-flex; }

/* ---------- Formularfelder ---------- */
.field { display: grid; gap: .375rem; }
.label { font-size: var(--t-sm); line-height: var(--lh-sm); font-weight: 600; }
.hint { font-size: var(--t-sm); line-height: var(--lh-sm); color: var(--ink-2); }
.input {
  width: 100%;
  min-height: var(--tap);
  padding: .5625rem .75rem;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-ctl);
  font-size: 1rem; line-height: 1.5rem; /* ≥16px: kein Zoom auf iOS */
  transition: border-color var(--d-1) var(--ease);
}
.input::placeholder { color: var(--ink-3); opacity: 1; }
.input:hover { border-color: var(--ink-2); }
.input:focus-visible { outline: 2px solid var(--focus); outline-offset: -1px; border-color: var(--focus); }
.input[aria-invalid="true"] { border-color: var(--err); }
.input[readonly] { background: color-mix(in oklab, var(--ink) 4%, var(--surface)); }
.input--lg { font-size: 1.25rem; line-height: 1.75rem; font-weight: 600; padding-block: .625rem; }
.field-error {
  display: flex; gap: .375rem; align-items: flex-start;
  color: var(--err); font-size: var(--t-sm); line-height: var(--lh-sm); font-weight: 500;
}
.field-error .icon { margin-top: 2px; }
.secret { position: relative; }
.secret .input { padding-right: 3rem; }
.secret .btn--icon { position: absolute; right: 0; top: 0; color: var(--ink-2); }
.secret .btn--icon:hover { background: transparent; color: var(--ink); }
.secret [aria-pressed="true"] .when-hidden,
.secret [aria-pressed="false"] .when-shown { display: none; }

/* ---------- Hinweise (Django messages) ---------- */
.notice {
  display: flex; gap: .625rem; align-items: flex-start;
  padding: .75rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--r-ctl);
  background: var(--surface);
  font-size: var(--t-sm); line-height: var(--lh-sm);
}
.notice .icon { margin-top: 0; }
.notice--ok { background: var(--ok-bg); border-color: color-mix(in oklab, var(--ok) 28%, transparent); }
.notice--ok .icon { color: var(--ok); }
.notice--error { background: var(--danger-bg); border-color: color-mix(in oklab, var(--danger) 28%, transparent); }
.notice--error .icon { color: var(--danger); }
[data-photo-error] { position: sticky; top: calc(var(--bar) + .5rem); z-index: 6; margin-bottom: var(--s-4); }
.fm .notice--error { background: color-mix(in oklab, var(--fm-danger) 10%, var(--fm-bg)); border-color: color-mix(in oklab, var(--fm-danger) 35%, transparent); }
.fm .notice--error .icon { color: var(--fm-danger); }

/* ---------- Status ---------- */
.status {
  display: inline-flex; align-items: center; gap: .375rem;
  font-size: var(--t-edge); line-height: 1rem; font-weight: 600;
  font-stretch: var(--stretch-edge); letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-2);
  white-space: nowrap;
}
.status .icon { width: 14px; height: 14px; stroke-width: 2; }
.status--public { color: var(--ok); }
.status--password { color: var(--edge-ink); }

/* ---------- Verwaltung: Rahmen ---------- */
.topbar { position: sticky; top: 0; z-index: 10; background: var(--bg); border-bottom: 1px solid var(--line); }
.topbar__inner {
  max-width: var(--admin-max); height: var(--bar); margin: 0 auto;
  padding: 0 calc(var(--gutter) - .5rem) 0 var(--gutter);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.wordmark {
  display: inline-flex; align-items: center; gap: .625rem; min-height: var(--tap);
  color: var(--ink); text-decoration: none;
  font-size: .8125rem; font-weight: 700; font-stretch: var(--stretch-edge);
  letter-spacing: .16em; text-transform: uppercase;
}
.wordmark span { font-weight: 400; }
/* Das Zeichen: ein leeres Kleinbildfeld (3:2) */
.wordmark::before {
  content: ""; width: 18px; height: 12px;
  border: 1.5px solid currentColor; border-radius: 1.5px;
}
.page { max-width: var(--admin-max); margin: 0 auto; padding: var(--s-5) var(--gutter) var(--s-9); }
.page > .notice { margin-bottom: var(--s-5); }
.page-head {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  margin-bottom: var(--s-5);
}
.h1 { font-size: var(--t-xl); line-height: var(--lh-xl); font-weight: 650; letter-spacing: -.015em; }
.h1 .edge { vertical-align: super; margin-left: .25rem; font-size: .75rem; letter-spacing: .08em; }
.h2 { font-size: 1.0625rem; line-height: 1.5rem; font-weight: 650; letter-spacing: -.005em; }
.back {
  display: inline-flex; align-items: center; gap: .25rem;
  min-height: var(--tap); margin-left: -.625rem; padding: 0 .625rem 0 .375rem;
  border-radius: var(--r-ctl);
  color: var(--ink-2); font-size: var(--t-sm); font-weight: 600; text-decoration: none;
}
.back:hover { color: var(--ink); background: color-mix(in oklab, var(--ink) 6%, transparent); }

/* ---------- Dashboard ---------- */
.create {
  margin: 0 0 var(--s-6);
  padding: var(--s-4);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-panel);
}
.create form { display: grid; gap: var(--s-4); max-width: 36rem; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; }

.galleries { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.gcard a {
  display: grid; grid-template-columns: 6rem minmax(0, 1fr) auto; gap: .875rem; align-items: center;
  min-height: 5.5rem; padding: .75rem 0;
  border-bottom: 1px solid var(--line);
  color: inherit; text-decoration: none;
}
.gcard__cover {
  width: 100%; aspect-ratio: 3 / 2; object-fit: cover;
  border-radius: var(--r-photo); background: var(--sunken);
  transition: filter var(--d-2) var(--ease);
}
.gcard__cover--none { display: grid; place-items: center; color: var(--ink-3); }
.gcard__cover--none .icon { width: 22px; height: 22px; }
.gcard__title {
  font-size: 1rem; line-height: 1.375rem; font-weight: 600;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  text-underline-offset: 3px; text-decoration-thickness: 1px;
}
.gcard__meta { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .875rem; margin-top: .375rem; }
.gcard__chev { color: var(--ink-3); margin-right: -.25rem; }
.gcard a:hover .gcard__title { text-decoration-line: underline; }
.gcard a:hover .gcard__cover { filter: brightness(.94); }
.gcard a:focus-visible { outline-offset: 4px; border-radius: var(--r-ctl); }
@media (min-width: 768px) {
  .galleries { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-6) var(--s-5); border-top: 0; }
  .gcard a { grid-template-columns: 1fr; align-items: start; gap: .75rem; padding: 0; border: 0; min-height: 0; }
  .gcard__chev { display: none; }
  .gcard__meta { margin-top: .25rem; }
}
@media (min-width: 1024px) { .galleries { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1280px) { .galleries { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* Leerer Kontaktbogen */
.empty {
  display: grid; justify-items: center; gap: var(--s-3);
  padding: var(--s-8) var(--s-4);
  text-align: center;
  border: 1px solid var(--line); border-radius: var(--r-panel);
  background: var(--surface);
}
.empty__frames { display: flex; gap: .5rem; margin-bottom: var(--s-3); }
.empty__frames i {
  width: 3rem; aspect-ratio: 3 / 2;
  border: 1.5px solid var(--line-strong); border-radius: var(--r-photo);
}
.empty__frames i:nth-child(2) { border-color: var(--mark); }
.empty .h2 { font-size: 1.25rem; line-height: 1.75rem; }
.empty p { max-width: 34ch; color: var(--ink-2); }
.empty .btn { margin-top: var(--s-3); }

/* ---------- Galerie-Editor ---------- */
.ehead { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .375rem 1rem; align-items: start; margin-bottom: var(--s-5); }
.ehead .back { grid-column: 1 / -1; }
.ehead .h1 { overflow-wrap: anywhere; text-wrap: balance; }
.ehead__meta { grid-column: 1; display: flex; flex-wrap: wrap; gap: .25rem .875rem; align-items: center; }
.ehead__actions { grid-column: 2; grid-row: 2 / span 2; align-self: start; }

.editor { display: grid; gap: var(--s-6); grid-template-areas: "side" "main" "danger"; }
.editor__side { grid-area: side; }
.editor__main { grid-area: main; min-width: 0; }
.editor__danger { grid-area: danger; }
@media (min-width: 1024px) {
  .editor { grid-template-columns: minmax(0, 1fr) 21.25rem; grid-template-areas: "main side" "main danger"; grid-template-rows: auto 1fr; gap: var(--s-6) var(--s-7); align-items: start; }
}

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel); }
.panel__section { padding: var(--s-4); display: grid; gap: var(--s-3); }
.panel__section + .panel__section { border-top: 1px solid var(--line); }
.panel__section > .h2 { margin-bottom: .125rem; }
.row { display: flex; gap: .5rem; align-items: flex-start; }
.row > .input, .row > .grow { flex: 1; min-width: 0; }

.choices { display: grid; gap: .5rem; margin: 0; padding: 0; border: 0; min-width: 0; }
.choice {
  display: grid; grid-template-columns: 1.25rem minmax(0, 1fr); gap: .125rem .75rem;
  padding: .75rem .875rem;
  border: 1px solid var(--line); border-radius: var(--r-ctl);
  cursor: pointer;
  transition: border-color var(--d-1) var(--ease), box-shadow var(--d-1) var(--ease);
}
.choice:hover { border-color: var(--line-strong); }
.choice input {
  appearance: none; -webkit-appearance: none;
  grid-row: 1 / span 2; width: 1.25rem; height: 1.25rem; margin: .125rem 0 0;
  border: 1.5px solid var(--line-strong); border-radius: 50%;
  background: var(--surface); cursor: pointer;
}
.choice input:checked { border-color: var(--ink); background: radial-gradient(circle, var(--ink) 0 4.5px, var(--surface) 5px); }
.choice input:focus-visible { outline: none; }
.choice:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.choice:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.choice__label { display: flex; align-items: center; gap: .5rem; font-weight: 600; }
.choice__label .icon { width: 16px; height: 16px; color: var(--ink-2); }
.choice__desc { grid-column: 2; font-size: var(--t-sm); line-height: var(--lh-sm); color: var(--ink-2); }
.pw { display: none; gap: var(--s-3); padding-top: var(--s-2); }
.visibility:has(input[value="password"]:checked) .pw { display: grid; }
.pw-set { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.pw-set .hint { display: flex; align-items: center; gap: .375rem; }

.linkbox { display: grid; gap: .5rem; }
.linkbox .input { font-size: .875rem; text-overflow: ellipsis; }
.linkbox__actions { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.muted { color: var(--ink-2); font-size: var(--t-sm); line-height: var(--lh-sm); }

/* Fotos */
.photos-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: var(--s-4); }
.photos-head .h2 { font-size: 1.25rem; line-height: 1.75rem; }
.photos-head .edge { vertical-align: super; margin-left: .25rem; }

.drop {
  display: grid; justify-items: center; gap: .5rem;
  padding: var(--s-5) var(--s-4);
  margin-bottom: var(--s-5);
  border: 1.5px dashed var(--line-strong); border-radius: var(--r-panel);
  background: var(--surface);
  text-align: center;
  transition: border-color var(--d-1) var(--ease), background-color var(--d-1) var(--ease);
}
.drop .icon { width: 24px; height: 24px; color: var(--ink-2); }
.drop.is-over { border-color: var(--mark); background: color-mix(in oklab, var(--mark) 7%, var(--surface)); }
.drop__or { color: var(--ink-2); font-size: var(--t-sm); }
.drop__drag { margin-right: .5rem; }
@media (pointer: coarse) { .drop__drag { display: none; } }

.queue { margin-bottom: var(--s-5); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel); overflow: hidden; }
.queue__head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .5rem .5rem .5rem 1rem; min-height: 3.25rem; }
.queue__summary { font-weight: 600; font-size: var(--t-sm); }
.queue__total { height: 2px; background: var(--sunken); }
.queue__total span { display: block; height: 100%; background: var(--ink); transform: scaleX(var(--p, 0)); transform-origin: left; transition: transform var(--d-2) linear; }
.queue ol { list-style: none; margin: 0; padding: 0; max-height: 18rem; overflow-y: auto; }
.qitem {
  display: grid; grid-template-columns: 2.5rem minmax(0, 1fr) auto; gap: .25rem .75rem; align-items: center;
  padding: .625rem .5rem .625rem 1rem; border-top: 1px solid var(--line);
}
.qitem__thumb { grid-row: 1 / span 2; width: 2.5rem; height: 2.5rem; border-radius: var(--r-photo); background: var(--sunken) center / cover no-repeat; }
.qitem__name { font-size: var(--t-sm); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qitem__state { grid-column: 3; grid-row: 1 / span 2; display: flex; align-items: center; gap: .25rem; }
.qitem__state .edge { min-width: 3.25rem; text-align: right; color: var(--ink-2); }
.qitem__bar { grid-column: 2; height: 3px; border-radius: 2px; background: var(--sunken); overflow: hidden; }
.qitem__bar span { display: block; height: 100%; background: var(--ink); transform: scaleX(var(--p, 0)); transform-origin: left; transition: transform var(--d-2) linear; }
.qitem__msg { grid-column: 2; font-size: .8125rem; line-height: 1.125rem; color: var(--ink-2); }
.qitem.is-done .qitem__bar span { background: var(--ok); }
.qitem.is-done .qitem__state .edge { color: var(--ok); }
.qitem.is-error .qitem__bar span { background: var(--danger); }
.qitem.is-error .qitem__msg { color: var(--danger); }
.qitem.is-error .qitem__state .edge { color: var(--danger); }

/* Kontaktbogen */
.contact { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .875rem .5rem; }
@media (min-width: 600px) { .contact { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem .75rem; } }
@media (min-width: 768px) { .contact { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.tile__btn {
  display: block; width: 100%; aspect-ratio: 1; padding: 0;
  border: 0; border-radius: var(--r-photo); background: var(--sunken);
  overflow: hidden; cursor: pointer;
}
.tile__btn img { width: 100%; height: 100%; object-fit: cover; transition: opacity var(--d-2) var(--ease); }
.tile__btn:hover img { opacity: .86; }
.tile__btn:focus-visible { outline-offset: 3px; }
.tile.is-cover .tile__btn { outline: 2px solid var(--mark); outline-offset: 3px; }
.tile.is-cover .tile__btn:focus-visible { outline-color: var(--focus); outline-width: 3px; }
.tile__cap { display: flex; justify-content: space-between; align-items: center; gap: .25rem; margin-top: .5rem; min-height: 1rem; }
.tile__cap .edge--quiet { color: var(--ink-3); }
.tile__cover { display: none; }
.tile.is-cover .tile__cover { display: inline; }

.photos-empty { display: grid; justify-items: start; gap: .25rem; padding: var(--s-5) 0; color: var(--ink-2); }

.editor__danger { padding-top: var(--s-5); border-top: 1px solid var(--line); display: grid; gap: var(--s-3); justify-items: start; }
@media (min-width: 1024px) { .editor__danger { border-top: 0; padding: 0 var(--s-4); } }

/* ---------- Dialoge ---------- */
dialog { color: var(--ink); }
dialog::backdrop { background: rgb(19 17 14 / .55); }
.dlg {
  width: min(28rem, calc(100% - 2rem));
  padding: var(--s-5);
  border: 0; border-radius: var(--r-panel);
  background: var(--surface);
  box-shadow: 0 24px 56px -16px rgb(19 17 14 / .4);
}
.dlg h2 { font-size: 1.125rem; line-height: 1.5rem; font-weight: 650; }
.dlg p { margin-top: .5rem; color: var(--ink-2); }
.dlg .actions { margin-top: var(--s-5); justify-content: flex-end; }
@media (max-width: 479px) { .dlg .actions { display: grid; grid-template-columns: 1fr 1fr; } }

/* Fotoblatt: Bottom-Sheet auf Mobile, zentriert ab 768px */
.photo-sheet {
  width: 100%; max-width: 100%; max-height: 92svh;
  margin: auto 0 0; padding: 0;
  border: 0; border-radius: 16px 16px 0 0;
  background: var(--surface);
  box-shadow: 0 -12px 40px -16px rgb(19 17 14 / .35);
  overflow: auto;
}
.photo-sheet[open] { display: flex; flex-direction: column; }
.photo-sheet__img { background: var(--sunken); display: grid; place-items: center; height: min(52svh, 26rem); }
.photo-sheet__img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.photo-sheet__head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .5rem .5rem .5rem 1rem; }
.photo-sheet__name { font-size: var(--t-sm); color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.photo-sheet__body { display: grid; gap: .5rem; padding: 0 1rem calc(1rem + env(safe-area-inset-bottom)); }
.photo-sheet__body .btn { justify-content: flex-start; }
.photo-sheet__actions { display: grid; gap: .5rem; }
.photo-sheet__title { min-width: 0; }
.btn[data-tone="danger"] { color: var(--danger); }
.photo-sheet__confirm p { color: var(--ink-2); font-size: var(--t-sm); line-height: var(--lh-sm); }
.photo-sheet__confirm strong { display: block; color: var(--ink); font-size: 1rem; line-height: 1.5rem; margin-bottom: .25rem; }
.photo-sheet__confirm .actions { display: grid; grid-template-columns: 1fr 1fr; margin-top: .75rem; }
.photo-sheet[data-mode="confirm"] .photo-sheet__actions,
.photo-sheet:not([data-mode="confirm"]) .photo-sheet__confirm { display: none; }
@media (min-width: 768px) {
  .photo-sheet { width: min(36rem, calc(100% - 3rem)); margin: auto; border-radius: var(--r-panel); box-shadow: 0 24px 56px -16px rgb(19 17 14 / .4); }
  .photo-sheet__body { padding-bottom: 1rem; }
}
@media (prefers-reduced-motion: no-preference) {
  .photo-sheet, .dlg { transition: transform var(--d-3) var(--ease), opacity var(--d-2) var(--ease), overlay var(--d-3) allow-discrete, display var(--d-3) allow-discrete; }
  .photo-sheet[open], .dlg[open] { transform: none; opacity: 1; }
  @starting-style {
    .photo-sheet[open] { transform: translateY(24px); opacity: 0; }
    .dlg[open] { transform: translateY(8px) scale(.98); opacity: 0; }
  }
}

/* ---------- Anmeldung & Passwort (beide Welten) ---------- */
.gate { min-height: 100svh; display: grid; grid-template-rows: auto 1fr auto; }
.gate__main { display: grid; place-items: center; padding: var(--s-7) var(--gutter) var(--s-8); }
.gate__card { width: 100%; max-width: 22rem; }
.gate__frame {
  width: 4.5rem; aspect-ratio: 3 / 2; margin-bottom: var(--s-5);
  display: grid; place-items: center;
  border: 1.5px solid var(--line-strong); border-radius: var(--r-photo);
  color: var(--ink-2);
}
.gate__frame .icon { width: 18px; height: 18px; }
.gate h1 { font-size: var(--t-xl); line-height: var(--lh-xl); font-weight: 650; letter-spacing: -.015em; }
.fm.gate h1, .fm .gate h1 { font-weight: 300; font-stretch: var(--stretch-title); font-size: 2rem; line-height: 2.375rem; letter-spacing: -.02em; }
.gate__lead { margin-top: .625rem; color: var(--ink-2); }
.gate form { display: grid; gap: var(--s-4); margin-top: var(--s-5); }
.gate .notice { margin-top: var(--s-5); }
.gate__foot { padding: var(--s-4) var(--gutter); display: flex; justify-content: center; }

/* ---------- Kundengalerie ---------- */
.rebate {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  min-height: 2.5rem; padding: 0 var(--gutter);
}
.rebate .edge { display: inline-flex; align-items: center; gap: .5rem; }
/* Pfeilmarke der Filmkante, als Geometrie gezeichnet */
.rebate .edge > i { width: 6px; height: 8px; background: currentColor; clip-path: polygon(0 0, 100% 50%, 0 100%); }
.rebate a { display: inline-flex; align-items: center; min-height: var(--tap); text-decoration: none; }
.rebate a:hover { color: var(--ink); }

.cover { height: min(70svh, 125vw); background: var(--fm-ph); overflow: hidden; }
.cover img { width: 100%; height: 100%; object-fit: cover; }
@media (min-width: 768px) { .cover { height: 82svh; } }

.ghead { max-width: var(--wall-max); margin: 0 auto; padding: var(--s-6) var(--gutter) var(--s-7); display: grid; gap: var(--s-3); }
.ghead__title {
  max-width: 16ch;
  font-size: var(--t-title); line-height: 1.02; font-weight: 300;
  font-stretch: var(--stretch-title); letter-spacing: -.025em;
  text-wrap: balance; overflow-wrap: anywhere;
}
.ghead__by { color: var(--ink-2); font-size: var(--t-sm); line-height: var(--lh-sm); }
@media (min-width: 768px) {
  .ghead { grid-template-columns: minmax(0, 1fr) auto; align-items: end; padding-top: var(--s-7); padding-bottom: var(--s-8); }
  .ghead__by { text-align: right; padding-bottom: .5rem; }
}
/* Ohne Titelbild: der Titel trägt die erste Ansicht allein */
.ghead--solo { padding-top: var(--s-9); }
@media (min-width: 768px) { .ghead--solo { padding-top: 10rem; } }

/* Masonry: Zeilenspannen kommen vom Server (--rows = round(40 * h / w) + 2) */
.wall { padding: 0 .5rem var(--s-8); }
.wall__inner { max-width: var(--wall-max); margin: 0 auto; container-type: inline-size; }
.masonry {
  --cols: 2; --gap: .5rem;
  --u: calc((100cqi - (var(--cols) - 1) * var(--gap)) / var(--cols) / 40);
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  column-gap: var(--gap); grid-auto-rows: var(--u);
}
.masonry > li { grid-row-end: span var(--rows, 29); padding-bottom: calc(var(--u) * 2); min-width: 0; }
@media (min-width: 768px)  { .wall { padding: 0 var(--gutter) var(--s-9); } .masonry { --cols: 3; --gap: .75rem; } }
@media (min-width: 1280px) { .masonry { --cols: 4; } }
.frame { display: block; width: 100%; height: 100%; background: var(--fm-ph); overflow: hidden; cursor: zoom-in; }
.frame img { width: 100%; height: 100%; object-fit: cover; transition: opacity var(--d-3) var(--ease); }
.frame:focus-visible { outline: 2px solid var(--fm-edge); outline-offset: 2px; }
.js .frame img:not(.is-loaded), .js .cover img:not(.is-loaded) { opacity: 0; }
.cover img { transition: opacity 600ms var(--ease); }

.gallery-empty { max-width: var(--wall-max); margin: 0 auto; padding: 0 var(--gutter) var(--s-9); color: var(--ink-2); }
.gallery-empty .gate__frame { margin-bottom: var(--s-4); }

.gfoot { border-top: 1px solid var(--fm-line); }

/* Admin-Vorschau: Leuchttisch-Leiste über der Projektion */
.preview-bar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  padding: .25rem .375rem .25rem var(--gutter);
  background: var(--lt-bg); color: var(--lt-ink);
  border-bottom: 1px solid var(--lt-line);
  font-size: var(--t-sm);
}
.preview-bar__text { display: flex; flex-wrap: wrap; align-items: center; gap: .125rem .75rem; min-width: 0; }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed; inset: 0;
  width: 100%; height: 100%; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0;
  background: var(--fm-bg); color: var(--fm-ink);
  overflow: hidden;
}
.lightbox[open] { display: grid; grid-template-rows: var(--bar) minmax(0, 1fr) auto; }
.lightbox::backdrop { background: var(--fm-bg); }
.lb-top { display: flex; align-items: center; justify-content: space-between; padding: 0 .375rem 0 var(--gutter); }
.lb-top .btn, .lb-bottom .btn { color: var(--fm-ink); }
.lb-stage { position: relative; display: grid; place-items: center; min-height: 0; touch-action: pan-y pinch-zoom; user-select: none; -webkit-user-select: none; }
.lb-img {
  max-width: 100%; max-height: calc(100svh - var(--bar) - 4.5rem - env(safe-area-inset-bottom));
  width: auto; height: auto; object-fit: contain;
  transition: opacity var(--d-2) var(--ease);
}
.lb-img.is-switching { opacity: 0; transition-duration: var(--d-1); }
.lb-side { display: none; }
.lb-bottom {
  display: grid; grid-template-columns: var(--tap) minmax(0, 1fr) var(--tap); align-items: center; gap: .5rem;
  min-height: 4.5rem; padding: 0 .375rem env(safe-area-inset-bottom);
}
.lb-download { justify-self: center; }
.lb-download.btn--ghost:hover, .lb-top .btn--ghost:hover, .lb-bottom .btn--ghost:hover { background: color-mix(in oklab, var(--fm-ink) 9%, transparent); }
.lightbox .btn:disabled { opacity: .3; }
@media (min-width: 768px) {
  .lb-stage { padding: 0 5rem; }
  .lb-side {
    position: absolute; top: 0; bottom: 0; width: 5rem;
    display: grid; place-items: center;
    border: 0; background: transparent; color: var(--fm-ink-2); cursor: pointer;
  }
  .lb-side:hover:not(:disabled) { color: var(--fm-ink); }
  .lb-side:disabled { opacity: .25; cursor: default; }
  .lb-side .icon { width: 28px; height: 28px; stroke-width: 1.25; }
  .lb-side--prev { left: 0; }
  .lb-side--next { right: 0; }
  .lb-bottom .lb-step { visibility: hidden; }
}
::view-transition-group(photo) { animation-duration: var(--d-3); animation-timing-function: var(--ease); }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: var(--d-2); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 1ms !important; animation-duration: 1ms !important; }
}


.search { display: flex; flex-wrap: wrap; gap: .5rem; align-items: end; margin-bottom: var(--s-5); }
.search .field { flex: 1 1 12rem; }
.upload-warning { margin-top: .5rem; }

.pw.has-error { display: grid; }
