/* Selection – Oberfläche (hell) */

/* Schrift: Auf Apple-Geräten die vorinstallierte Avenir Next / Avenir; alle anderen bekommen
   Nunito Sans (freie, sehr ähnliche Schrift, liegt auf dem eigenen Server, SIL Open Font License,
   siehe fonts/OFL-Nunito-Sans.txt). Eine Datei deckt alle Schriftstärken ab. */
@font-face {
  font-family: "Nunito Sans"; font-style: normal; font-display: swap; font-weight: 200 1000;
  src: url(fonts/nunito-sans-latin-wght-normal.woff2) format("woff2-variations"), url(fonts/nunito-sans-latin-wght-normal.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;
}
@font-face {
  font-family: "Nunito Sans"; font-style: normal; font-display: swap; font-weight: 200 1000;
  src: url(fonts/nunito-sans-latin-ext-wght-normal.woff2) format("woff2-variations"), url(fonts/nunito-sans-latin-ext-wght-normal.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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
:root {
  --bg: #ffffff;
  --bg2: #f7f7f8;
  --bg3: #efeff1;
  --line: #e6e6e9;
  --line2: #d4d4d8;
  --text: #18181b;
  --muted: #6b6b76;
  --accent: #18181b;
  --red: #e0202c;
  --orange: #ffb000;
  --green: #0b8a3e;
  --black: #111113;
  --radius: 10px;
  --rh: 230px;
  --side: 300px;
  --top: 0px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.45 "Avenir Next", Avenir, "Nunito Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
body.noscroll { overflow: hidden; }
[hidden] { display: none !important; }
a { color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 600; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .45; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.lbm:focus-visible, .qc:focus-visible, .tile:focus-visible, .tile:focus { outline: none; }

/* ---------- Farben ---------- */
.c-red { --c: var(--red); }
.c-orange { --c: var(--orange); }
.c-green { --c: var(--green); }
.c-black { --c: var(--black); }
.sw, .dot, .badge, .qc { display: inline-block; border-radius: 50%; background: var(--c, transparent); }
.sw { width: 14px; height: 14px; flex: none; }
.sw.empty { background: transparent; border: 1.5px dashed #b4b4bd; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid var(--line2); background: var(--bg); color: var(--text);
  padding: 9px 16px; border-radius: 8px; font-weight: 500; text-decoration: none; line-height: 1.2;
}
.btn:hover:not(:disabled) { background: var(--bg2); border-color: #bcbcc4; }
.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.primary:hover:not(:disabled) { background: #36363c; border-color: #36363c; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover:not(:disabled) { color: var(--text); background: var(--bg3); }
.btn.danger { background: transparent; border-color: #f0b9bb; color: #c0262c; }
.btn.danger:hover:not(:disabled) { background: #fdecec; }
.btn.sm { padding: 6px 11px; font-size: 13.5px; }
.btn.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.icon-only { padding: 6px 8px; }
.btn.block { display: flex; width: 100%; padding: 9px 12px; font-size: 14.5px; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--muted); text-decoration: underline; font-size: 13px; }
.linkbtn:hover { color: var(--text); }

input[type=text], input[type=password], input[type=date], input[type=search], select, textarea {
  background: var(--bg); border: 1px solid var(--line2); border-radius: 8px; padding: 9px 12px; width: 100%;
}
select.sel { width: auto; padding: 6px 28px 6px 10px; font-size: 13.5px; }
input:focus, select:focus, textarea:focus { border-color: var(--text); outline: none; }
label.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text); cursor: pointer; }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); width: 16px; height: 16px; }

/* ---------- Meldungen / Zentrierte Karten ---------- */
body.msg, body.center { display: grid; place-items: center; min-height: 100vh; padding: 20px; background: var(--bg2); }
.msgbox, .card-center {
  width: min(440px, 100%); background: var(--bg); border: 1px solid var(--line);
  border-radius: 10px; padding: 28px 26px; box-shadow: 0 10px 40px rgba(0, 0, 0, .06);
}
.msgbox h1, .card-center h1 { font-size: 22px; margin-bottom: 8px; }
.msgbox p, .card-center p { color: var(--muted); margin: 0 0 16px; }
.card-center .field { margin: 14px 0; }
.card-center label.fl { display: block; font-size: 13px; color: var(--muted); margin-bottom: 5px; }
.card-center .btn { width: 100%; margin-top: 6px; padding: 11px; }
.err { color: #c0262c; font-size: 14px; min-height: 1.2em; margin-top: 8px; }
.hint { color: var(--muted); font-size: 13px; }

/* ---------- Toast ---------- */
#sel-toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px);
  /* iOS 26: über die sichtbare Höhe positionieren, damit die Meldung nicht hinter der Safari-Leiste liegt */
  bottom: auto; top: calc(var(--app-h, 100svh) - 24px - env(safe-area-inset-bottom) - 44px);
  background: var(--accent); color: #fff; padding: 10px 18px; border-radius: 10px; font-weight: 500; z-index: 400;
  opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s; max-width: 90vw; text-align: center;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .2);
}
#sel-toast.show { opacity: 1; transform: translate(-50%, 0); }
#sel-toast.error { background: #c0262c; color: #fff; }

/* ---------- Viewer: Kopfzeile ---------- */
.sv { min-height: 100vh; }
.sv[data-embed="client"] { --top: 60px; }
.sv[data-embed="admin"] { min-height: 0; --top: 0px; }
.vtop {
  position: sticky; top: 0; z-index: 60; height: 60px; display: flex; align-items: center; gap: 14px;
  padding: 0 24px; background: var(--bg); border-bottom: 1px solid var(--line);
}
.vtop h1 { font-size: 19px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.vcount { color: var(--muted); font-size: 14px; white-space: nowrap; }
.vspacer { flex: 1; }
.vmainbar { display: flex; align-items: center; gap: 12px; padding: 14px 24px 0; }

/* ---------- Viewer: Layout mit linker Seitenleiste ---------- */
.vlayout { display: flex; align-items: flex-start; }
.vmain { flex: 1; min-width: 0; }
.vside {
  position: sticky; top: var(--top); flex: none; width: var(--side); height: calc(100vh - var(--top)); overflow-y: auto;
  padding: 24px 20px 40px 24px; border-right: 1px solid var(--line); background: var(--bg);
}
.vside-head { display: none; }
.vsec { margin-bottom: 40px; }
.vsec-t { font-size: 13.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text); margin-bottom: 14px; padding-bottom: 9px; border-bottom: 2px solid var(--text); }
.frows { display: flex; flex-direction: column; gap: 2px; margin: 0 -8px; }
.frow {
  display: flex; align-items: center; gap: 11px; width: 100%; padding: 8px; border: 0; background: transparent;
  border-radius: 6px; text-align: left; font-size: 14.5px;
}
.frow:hover { background: var(--bg2); }
.frow.on { background: var(--bg3); font-weight: 600; }
.frow .cl { flex: 1; }
.frow .cn { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 13px; font-weight: 400; }
.frow.zero { opacity: .5; }
.fopts { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; margin-top: 12px; }
.vrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.vrow .lbl { color: var(--muted); font-size: 14px; flex: none; }
.vrow select.sel { flex: 1 1 auto; min-width: 0; max-width: 170px; }
.viewctl select { width: 100%; }
.segs { display: inline-flex; border: 1px solid var(--line2); border-radius: 8px; overflow: hidden; }
.seg { background: transparent; border: 0; padding: 5px 13px; color: var(--muted); font-size: 13px; }
.seg + .seg { border-left: 1px solid var(--line2); }
.seg.on { background: var(--accent); color: #fff; }
.selbar { display: none; flex-direction: column; align-items: stretch; gap: 8px; margin: 12px 0; font-size: 13.5px; }
.selinfo { color: var(--muted); }
.selacts { display: inline-flex; gap: 12px; }
.vside .btn + .btn, .vside .selbar + .btn { margin-top: 10px; }
.vside .btn.block + .selbar { margin-top: 12px; }
.fmt { margin-top: 14px; font-size: 13.5px; }
.fmt summary { cursor: pointer; color: var(--muted); margin-bottom: 6px; }
.fmt .fmthint { margin-top: 8px; padding: 8px 10px; background: var(--bg2); border-radius: 6px; color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.fmt summary:hover { color: var(--text); }
.fmt .ptitle { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 12px 0 4px; }
.fmt .opt { display: flex; gap: 9px; align-items: flex-start; padding: 4px 0; cursor: pointer; line-height: 1.35; }
.fmt .opt input { margin-top: 2px; flex: none; }
.vmenu { display: none; position: relative; }
.mbadge {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 7px; background: var(--accent); color: #fff;
  font-size: 11px; font-weight: 600; display: inline-grid; place-items: center;
}
.vback { display: none; }

/* ---------- Viewer: Raster ---------- */
.vgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--cell), 1fr)); gap: 14px; padding: 22px 24px 60px 48px; }
.vgrid > .grp, .vgrid > .blockgap, .vgrid > .divider, .vgrid > .vempty { grid-column: 1 / -1; }
.vgrid > .blockgap { height: 14px; flex: none; }
.rowfill { display: none; }
.sv[data-size="S"] { --cell: 130px; }
.sv[data-size="M"] { --cell: 200px; }
.sv[data-size="L"] { --cell: 280px; }
.tile {
  position: relative; aspect-ratio: 1 / 1; min-width: 0; background: var(--bg3);
  border-radius: 3px; overflow: hidden; cursor: zoom-in;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent;
}
.tile i { display: block; }
.tbg { position: absolute; inset: 0; background: center / cover no-repeat; opacity: 0; transition: opacity .25s; }
.tile.ready .tbg { opacity: 1; }
.tile .frame { position: absolute; inset: 0; pointer-events: none; border-radius: inherit; }
.tile .badge { position: absolute; left: 9px; top: 9px; width: 14px; height: 14px; display: none; }
.tile .badge[class*="c-"] { display: block; }
.tile .dots { position: absolute; left: 8px; bottom: 8px; right: 8px; display: flex; gap: 4px; flex-wrap: wrap; z-index: 2; }
.tile .dot { width: 19px; height: 19px; display: grid; place-items: center; font-size: 10px; font-weight: 700; line-height: 1; color: #fff; box-shadow: 0 0 0 1.5px #fff; cursor: default; }
.tile .tname {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 10px 7px 10px; font-size: 12px; pointer-events: none; color: #fff;
  background: linear-gradient(transparent, rgba(0, 0, 0, .62)); opacity: 0; transition: opacity .12s; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.tile .quick {
  position: absolute; right: 8px; bottom: 8px; display: none; gap: 7px; padding: 6px 8px;
  background: rgba(255, 255, 255, .94); border-radius: 7px; box-shadow: 0 2px 10px rgba(0, 0, 0, .28);
}
.tile .qc { width: 17px; height: 17px; border: 0; padding: 0; box-shadow: 0 0 0 1px rgba(0, 0, 0, .12); }
.tile .qc:hover { transform: scale(1.18); }
.tile .qc.on { transform: scale(1.22); box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px rgba(0, 0, 0, .55); position: relative; }
.tile .qc.on::after { content: ''; position: absolute; left: 50%; top: 50%; width: 5px; height: 5px; margin: -2.5px 0 0 -2.5px; border-radius: 50%; background: #fff; }
.tile .qc.qx { background: #fff; color: #333; font-size: 14px; line-height: 1; display: inline-grid; place-items: center; }
@media (hover: hover) {
  .tile:hover .tname { opacity: 1; }
  .tile:hover .quick { display: flex; }
  .tile:hover .dots { bottom: 42px; }
}
.tile .tcheck {
  position: absolute; right: 9px; top: 9px; width: 14px; height: 14px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(0, 0, 0, .35); box-shadow: 0 0 0 2px #fff; color: transparent; cursor: pointer; z-index: 3;
}
.tile .tcheck::before { content: ''; position: absolute; inset: -9px; border-radius: 50%; } /* größere Tippfläche */
.tile .tcheck svg { width: 10px; height: 10px; }
.tile .tcheck:hover { background: rgba(0, 0, 0, .55); }
.sv.selmode .tile { cursor: pointer; }
.sv.selmode .tile .tcheck { display: grid; }
.sv.selmode .tile .quick { display: none !important; }
.tile.picked .tcheck { background: #1f6feb; color: #fff; box-shadow: 0 0 0 2px #1f6feb; }
/* Mit Maus: Farbpunkte und Auswahlkreis erst beim Darüberfahren zeigen (Touch: immer sichtbar) */
@media (hover: hover) {
  .tile .tcheck { opacity: 0; transition: opacity .12s; }
  .tile:hover .tcheck, .tile:focus-within .tcheck,
  .sv.selmode .tile .tcheck, .tile.selmode .tcheck, .tile.picked .tcheck { opacity: 1; }
}
.divider { flex: 1 0 100%; display: flex; align-items: center; gap: 14px; margin: 20px 4px 14px; color: var(--muted); font-size: 13.5px; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.vempty { color: var(--muted); text-align: center; padding: 60px 20px; flex: 1 0 100%; margin: 0; }

/* ---------- Lightbox (hell) ---------- */
.lb {
  position: fixed; left: 0; right: 0; top: 0; height: 100vh; height: 100svh; height: var(--app-h, 100svh); z-index: 200; background: #fff; overflow: hidden; color: var(--text); display: flex; flex-direction: column;
  touch-action: pan-y; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.lb-top { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; padding-top: calc(10px + env(safe-area-inset-top)); gap: 12px; }
.lb-meta { display: flex; gap: 14px; align-items: baseline; min-width: 0; font-size: 14px; }
.lb-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.lb-count { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.lb-actions { display: flex; gap: 6px; }
.lb-btn { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: transparent; border: 0; color: var(--text); text-decoration: none; }
.lb-btn:hover { background: var(--bg3); }
.lb-stage { touch-action: none; position: relative; flex: 1; min-height: 0; min-width: 0; margin: 0 12px; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.lb-img { flex: none; background: center / contain no-repeat; transition: opacity .15s; max-width: 100%; max-height: 100%; }
.lb-img.loading { opacity: .9; }
.lb-nav {
  position: absolute; top: 50%; transform: translateY(-50%); width: 52px; height: 72px; background: transparent; border: 0; color: var(--text); opacity: .55;
  display: grid; place-items: center; z-index: 2;
}
.lb-nav:hover { opacity: 1; background: rgba(0, 0, 0, .05); }
.lb-nav.prev { left: 4px; border-radius: 0 7px 7px 0; }
.lb-nav.next { right: 4px; border-radius: 8px 0 0 12px; }
.lb-bottom { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 10px 12px calc(16px + env(safe-area-inset-bottom)); }
.lb-marks { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.lbm {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 7px; background: var(--bg2);
  border: 1px solid var(--line2); color: var(--text); font-size: 12.5px;
}
.lbm .sw { width: 8px; height: 8px; }
.lbm:hover:not(:disabled) { background: var(--bg3); }
.lbm.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.lbm.on.c-black .sw { box-shadow: 0 0 0 1.5px #fff; }
.lb-marks.readonly .lbm:not(.on) { display: none; }
.lb-others { display: flex; flex-wrap: wrap; gap: 6px 14px; justify-content: center; font-size: 13px; color: var(--muted); }
.lb-others .lbo { display: inline-flex; align-items: center; gap: 6px; }
.lb-others .dot { width: 11px; height: 11px; }

/* ---------- Client-Fuß ---------- */
.cfoot { padding: 6px 16px 40px; color: var(--muted); font-size: 13px; text-align: center; }
.cfoot button { background: none; border: 0; padding: 0; text-decoration: underline; color: inherit; font-size: inherit; }

/* ---------- Admin ---------- */
body.admin { background: var(--bg); }
.adm-head {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; height: 53px; padding: 0 20px;
  border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 70;
}
.adm-head .brand { font-weight: 700; letter-spacing: .02em; text-decoration: none; }
.adm-head nav { display: flex; gap: 6px; align-items: center; }
.adm-wrap { max-width: 1100px; margin: 0 auto; padding: 24px 20px 80px; }
.adm-wrap.wide { max-width: none; padding: 0; }
.adm-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.adm-title h1 { font-size: 24px; }
.adm-wrap.listwrap { max-width: 2200px; }
.gcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.gcard[hidden] { display: none; }
.gtools { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.gsearchwrap { position: relative; flex: 1 1 260px; max-width: 420px; color: var(--muted); }
.gsearchwrap svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.gsearchwrap .gsearch { padding-left: 34px; }
.gcount { color: var(--muted); font-size: 13.5px; }
.gviews { margin-left: auto; }
.gviews .btn { border: 0; border-radius: 0; }
/* Listenansicht */
.gcards.list { grid-template-columns: 1fr; gap: 8px; }
.gcards.list .gcard { flex-direction: row; align-items: center; gap: 14px; padding: 6px 12px 6px 6px; }
.gcards.list .gcard .cover { width: 72px; flex: none; border-radius: 6px; font-size: 0; }
.gcards.list .gcard .gb { flex-direction: row; align-items: center; gap: 18px; padding: 0; min-width: 0; }
.gcards.list .gcard h3 { flex: 1 1 auto; min-width: 0; }
.gcards.list .gcard .meta { flex: none; white-space: nowrap; }
.gcards.list .gcard .meta:first-of-type { width: 250px; }
.gcards.list .gcard .acts { margin-top: 0; flex: none; }
@media (max-width: 860px) {
  .gcards.list .gcard .gb { flex-wrap: wrap; gap: 2px 14px; }
  .gcards.list .gcard h3 { flex-basis: 100%; }
  .gcards.list .gcard .meta:first-of-type { width: auto; }
  .gcards.list .gcard .acts { margin-left: auto; }
}
.gcard { background: var(--bg); border: 1px solid var(--line); border-radius: 9px; overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 1px 2px rgba(0, 0, 0, .04); }
.gcard .cover { aspect-ratio: 3 / 2; background: var(--bg3) center / cover no-repeat; display: grid; place-items: center; color: var(--muted); font-size: 13px; text-decoration: none; }
.gcard .gb { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.gcard h3 { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gcard .meta { color: var(--muted); font-size: 13px; }
.gcard .acts { display: flex; gap: 8px; margin-top: 10px; }
.gcard .acts .del { margin-left: auto; }
.gcard .acts .del:hover { color: #c0262c; background: #fdecec; }
.tabs { display: flex; gap: 4px; padding: 0 20px; border-bottom: 1px solid var(--line); overflow-x: auto; background: var(--bg); position: sticky; top: 53px; z-index: 65; }
.tab { background: none; border: 0; padding: 12px 14px; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; text-decoration: none; }
.tab:hover { color: var(--text); }
.tab.on { color: var(--text); border-bottom-color: var(--text); font-weight: 500; }
.gtop { display: flex; align-items: center; gap: 14px; padding: 16px 20px 12px; flex-wrap: wrap; }
.gtop h1 { font-size: 22px; }
.linkbox { display: inline-flex; align-items: center; gap: 4px; background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; padding: 2px 4px 2px 12px; font-size: 14px; }
.linkbox code { font: 13.5px ui-monospace, SFMono-Regular, Menlo, monospace; }
.panel { background: var(--bg); border: 1px solid var(--line); border-radius: 9px; padding: 18px 20px; margin-bottom: 18px; }
.panel h2 { font-size: 16px; margin-bottom: 12px; }
.formrow { display: grid; grid-template-columns: 240px 1fr; gap: 6px 20px; padding: 12px 0; border-bottom: 1px solid var(--line); align-items: start; }
.formrow:last-child { border-bottom: 0; }
.formrow .fl { font-weight: 500; }
.formrow .fd { color: var(--muted); font-size: 13px; margin-top: 2px; }
.formrow .fc { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.formrow .fc input[type=text], .formrow .fc input[type=password], .formrow .fc input[type=date], .formrow .fc select { max-width: 360px; }
@media (max-width: 720px) { .formrow { grid-template-columns: 1fr; } }
.notice {
  display: flex; gap: 16px; align-items: center; justify-content: space-between; background: #fff8e6; border: 1px solid #f1d98b;
  border-radius: 8px; padding: 14px 16px; margin-bottom: 16px;
}
.notice .hint { margin-top: 3px; color: #7a6a2c; }
.drop {
  border: 2px dashed var(--line2); border-radius: 9px; padding: 30px 20px; text-align: center; color: var(--muted); margin-bottom: 16px;
  transition: background .12s, border-color .12s; background: var(--bg2);
}
.drop.over { background: var(--bg3); border-color: var(--text); color: var(--text); }
.drop .btn { margin-top: 10px; }
.queue { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.qrow { display: grid; grid-template-columns: 1fr 90px 110px; gap: 12px; align-items: center; font-size: 13.5px; padding: 8px 12px; background: var(--bg2); border-radius: 8px; border: 1px solid var(--line); }
.qrow .qn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qrow .qs { color: var(--muted); text-align: right; }
.qrow.fail { border-color: #f0b9bb; background: #fff5f5; }
.qrow.fail .qs { color: #c0262c; grid-column: 1 / -1; text-align: left; }
.bar { height: 6px; background: var(--bg3); border-radius: 3px; overflow: hidden; }
.bar > span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .15s; }
.igrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.icell { position: relative; background: var(--bg2); border-radius: 8px; overflow: hidden; border: 2px solid transparent; cursor: grab; }
.icell.dragover { border-color: var(--text); }
.icell.dragging { opacity: .35; }
.icell img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; pointer-events: none; }
.icell .in { padding: 5px 8px; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icell .x { position: absolute; right: 6px; top: 6px; width: 28px; height: 28px; border-radius: 50%; background: rgba(0, 0, 0, .65); border: 0; display: none; place-items: center; color: #fff; }
.icell:hover .x { display: grid; }
.icell .x:hover { background: #c0262c; }
.icell.bad { border-color: #f0b9bb; }
.icell .ph { aspect-ratio: 1; display: grid; place-items: center; text-align: center; padding: 10px; font-size: 12px; color: #c0262c; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12.5px; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t .cnts { display: inline-flex; gap: 10px; }
table.t .cnts span { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 13px; }
table.t .rowacts { display: flex; gap: 4px; justify-content: flex-end; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 7px; background: var(--bg3); color: var(--muted); font-size: 12px; }
.sysrow { display: flex; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.sysrow:last-child { border-bottom: 0; }
.sysrow .sym { width: 18px; font-weight: 700; }
.sysrow.ok .sym { color: #1f9d63; }
.sysrow.bad .sym { color: #c0262c; }
.sysrow.warn .sym { color: #c77d0a; }
.sysrow .sval { color: var(--muted); margin-left: auto; text-align: right; }

/* ---------- Dialoge (Admin) ---------- */
.modal-back { position: fixed; left: 0; right: 0; top: 0; height: 100vh; height: var(--app-h, 100svh); z-index: 300; background: rgba(0, 0, 0, .4); display: grid; place-items: center; padding: 16px; }
.modal { width: min(440px, 100%); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 22px 22px 18px; box-shadow: 0 24px 60px rgba(0, 0, 0, .25); }
.modal h2 { font-size: 18px; margin-bottom: 12px; }
.modal .mbody p { margin: 0; color: var(--muted); }
.modal .mbody label.fl { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.modal .macts { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }

/* ---------- Schmale Bildschirme: Menü als Schublade ---------- */
@media (max-width: 860px) {
  .vtop { padding: 0 14px; height: 56px; }
  .sv[data-embed="client"] { --top: 56px; }
  .vmenu { display: inline-flex; align-items: center; }
  .vmainbar { padding: 12px 10px 0; }
  .vside {
    position: fixed; left: 0; top: 0; height: 100%; height: var(--app-h, 100svh); width: min(320px, 88vw); z-index: 120; border-right: 0;
    transform: translateX(-104%); transition: transform .22s ease; box-shadow: 0 0 40px rgba(0, 0, 0, .25);
    padding-top: calc(18px + env(safe-area-inset-top));
  }
  .sv.drawer .vside { transform: none; }
  .vside-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
  .vback { position: fixed; inset: 0; z-index: 110; background: rgba(0, 0, 0, .35); }
  .sv.drawer .vback { display: block; }
  body.noscroll-m { overflow: hidden; }
  .vgrid { padding: 12px 16px 50px; gap: 8px; }
  .vmainbar { padding-left: 16px; padding-right: 16px; }
  .lb-stage { margin: 0 16px; }
  .sv[data-size="M"] { --cell: 150px; }
  .sv[data-size="L"] { --cell: 180px; }
  .sv[data-size="S"] { --cell: 100px; }
}
@media (max-width: 640px) {
  .vtop h1 { font-size: 17px; }
  .lb-nav { display: none; }
  .adm-wrap { padding: 16px 12px 60px; }
  .qrow { grid-template-columns: 1fr 70px; }
  .qrow .bar { grid-column: 1 / -1; order: 3; }
  .notice { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Drucken der Galerie unterbinden */
@media print { body { display: none !important; } }

/* Mehrfachauswahl: Farbe für mehrere Bilder setzen */
.bulk { margin: 4px 0 12px; }
.bulk .lbl { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.bulk.off { opacity: .45; }
.bulkmarks { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.bm { display: inline-grid; place-items: center; min-width: 30px; height: 30px; padding: 0 9px; border-radius: 7px; background: var(--bg2); border: 1px solid var(--line2); color: var(--text); font-size: 13px; }
.bm .sw { width: 14px; height: 14px; }
.bm:hover:not(:disabled) { background: var(--bg3); }
.bm:focus-visible { outline: none; }
.vside .btn.block + .btn.block { margin-top: 10px; }
.vside .bulk + .btn { margin-top: 0; }
.selinfo, .selacts .linkbtn { white-space: nowrap; }
.selacts { gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.selbar { flex-wrap: wrap; }

.blockgap { flex: 1 0 100%; height: 30px; }
.grp { flex: 1 0 100%; display: flex; align-items: baseline; gap: 8px; margin: 0 2px 2px; font-size: 22px; font-weight: 650; letter-spacing: -.015em; color: var(--text); }
.grp .gn { font-size: 14px; font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
.grp .gdot { width: 14px; height: 14px; border-radius: 50%; align-self: center; flex: none; background: var(--c); }

/* Gespeicherte Auswahlen */
.savedlist { display: flex; flex-direction: column; gap: 10px; }
.savedhint { margin: 0; color: var(--muted); font-size: 13.5px; }
.saveditem { border: 1px solid var(--line); border-radius: 6px; padding: 9px 12px; }
.saveditem .sname { font-weight: 500; font-size: 14px; overflow-wrap: anywhere; }
.saveditem .smeta { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.saveditem .sacts { display: flex; gap: 14px; margin-top: 6px; font-size: 13.5px; }
.linkbtn.danger { color: #c4261d; }
.modal input[type=text] { width: 100%; }
.lbm .xs { font-size: 13px; line-height: 1; width: 8px; text-align: center; }

.selbar .selacts { display: flex; flex-wrap: wrap; gap: 5px; justify-content: flex-start; }
.pillbtn { padding: 5px 9px; border-radius: 7px; background: var(--bg2); border: 1px solid var(--line2); color: var(--text); font-size: 12.5px; line-height: 1.3; cursor: pointer; }
.pillbtn:hover { background: var(--bg3); }
.pillbtn:focus-visible { outline: none; }

/* Auswahl in der Lightbox */
.lb-sel { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px 0 8px; margin-right: 6px; border-radius: 7px; background: var(--bg2); border: 1px solid var(--line2); color: var(--text); font-size: 14px; cursor: pointer; }
.lb-sel:hover { background: var(--bg3); }
.lb-sel:focus-visible { outline: none; }
.lb-sel .lbs-dot { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--muted); color: transparent; }
.lb-sel.on { background: #1f6feb; color: #fff; border-color: #1f6feb; }
.lb-sel.on .lbs-dot { background: #fff; border-color: #fff; color: #1f6feb; }

.sv[data-size="S"] .tile .quick { transform: scale(.8); transform-origin: right bottom; }

.vgrid > .grpact { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 8px; margin-top: 2px; }
.grpact .pillbtn { display: inline-flex; align-items: center; gap: 6px; }

/* Empfehlungen (Stern, Farbe über --pick einstellbar) */
:root { --pick: #800020; }
.c-pick { --c: var(--pick); }
.star { display: block; fill: var(--pick); stroke: #fff; stroke-width: 1.3; stroke-linejoin: round; paint-order: stroke fill; }
.sw.c-pick { border-radius: 0; clip-path: polygon(50% 4%, 62% 36%, 97% 38%, 70% 60%, 79% 94%, 50% 75%, 21% 94%, 30% 60%, 3% 38%, 38% 36%); }
/* Stern sitzt mittig auf der oberen linken Bildecke und ragt in den Weißraum */
.tile { overflow: visible; }
.tile .tbg { border-radius: inherit; }
.tile .tname { border-radius: 0 0 3px 3px; }
.tile .pickm { position: absolute; left: -14px; top: -14px; display: none; pointer-events: none; z-index: 5; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .28)); }
.tile.pk .pickm { display: block; }
.tile.pk .badge { left: 19px; top: 9px; }
.tile .quick .qp { background: transparent; box-shadow: none; width: 20px; height: 20px; display: inline-grid; place-items: center; }
.tile .quick .qp .star { stroke: transparent; fill: #b9a3a9; }
.tile .quick .qp.on .star, .tile .quick .qp:hover .star { fill: var(--pick); }
.tile .quick .qp.on { box-shadow: none; transform: scale(1.12); }
.tile .quick:not(.canpick) .qp { display: none; }
.tile .quick.pickonly .qc:not(.qp) { display: none; }
.pickctl { margin-top: 10px; }
.pickchk { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; cursor: pointer; }
.pickchk input { margin-top: 2px; }
.pickctl .fmthint { font-size: 12px; color: var(--muted); margin: 6px 0 0; line-height: 1.4; }
@media (max-width: 700px) {
  .tile .pickm { left: -10px; top: -10px; }
  .tile .pickm .star { width: 24px; height: 24px; }
  .tile.pk .badge { left: 16px; }
}
/* Logo in der Kopfzeile */
.vlogo { height: 36px; width: auto; max-width: 180px; object-fit: contain; display: block; flex: none; margin-right: 6px; }
.brandprev { max-height: 44px; max-width: 160px; object-fit: contain; background: repeating-conic-gradient(#eee 0 25%, #fff 0 50%) 0 / 12px 12px; border-radius: 4px; }
.colorctl { display: inline-flex; align-items: center; gap: 10px; }
.colorctl input[type=color] { width: 44px; height: 30px; padding: 0; border: 1px solid var(--line2); border-radius: 6px; background: #fff; cursor: pointer; }
.panel > .fmthint { font-size: 12.5px; color: var(--muted); margin: 8px 0 12px; line-height: 1.45; }

/* Bilder-Verwaltung: Mehrfachauswahl */
.icell .ick { position: absolute; left: 8px; top: 8px; width: 22px; height: 22px; border-radius: 50%; border: 2px solid #fff; background: rgba(0, 0, 0, .35); color: transparent; display: none; place-items: center; padding: 0; z-index: 2; cursor: pointer; }
.icell:hover .ick, .igrid.selmode .ick { display: grid; }
.icell.picked { border-color: #1f6feb; }
.icell.picked .ick { display: grid; background: #1f6feb; border-color: #1f6feb; color: #fff; }
.igrid.selmode .icell { cursor: pointer; }
.btn.danger.bulkdel { background: #c0262c; border-color: #c0262c; color: #fff; }
.btn.danger.bulkdel:hover:not(:disabled) { background: #a51f25; }

/* Mobil/Touch: kein Auswahlkreis im Grid – Auswählen und Farbmarkieren läuft über die Lightbox.
   Bereits ausgewählte Bilder (und der Auswahlmodus aus dem Menü) zeigen den Haken weiterhin. */
@media (hover: none), (max-width: 700px) {
  .tile .tcheck { display: none; }
  .tile.picked .tcheck, .sv.selmode .tile .tcheck { display: grid; }
}
.dlsel { font: inherit; font-size: 13px; padding: 5px 8px; border: 1px solid var(--line2); border-radius: 6px; background: #fff; max-width: 190px; }
.viewas { cursor: pointer; padding: 6px 10px; }

/* Admin-Vorschau */
.pvbar { position: fixed; left: 14px; bottom: 14px; z-index: 150; display: flex; gap: 12px; align-items: center; padding: 8px 14px; border-radius: 8px; background: #111; color: #fff; font-size: 13px; box-shadow: 0 2px 10px rgba(0, 0, 0, .3); }
.pvbar a { color: #fff; text-decoration: underline; }

/* ---------- Layouts pro Galerie ---------- */
.sv { --gap: 14px; --rh: 230px; }
.sv[data-gap="tight"] { --gap: 4px; }
.sv[data-gap="airy"] { --gap: 30px; }
.vgrid { gap: var(--gap); }
.sv[data-size="S"] { --rh: 150px; }
.sv[data-size="M"] { --rh: 230px; }
.sv[data-size="L"] { --rh: 340px; }

/* 3:2 Raster */
.sv[data-layout="r32"] .tile { aspect-ratio: 3 / 2; }
.sv[data-layout="r32"][data-size="S"] { --cell: 170px; }
.sv[data-layout="r32"][data-size="M"] { --cell: 260px; }
.sv[data-layout="r32"][data-size="L"] { --cell: 380px; }

/* Zeilen gleicher Höhe */
.sv[data-layout="rows"] .vgrid { display: flex; flex-wrap: wrap; }
.sv[data-layout="rows"] .tile { aspect-ratio: var(--r, 1.5); flex: calc(var(--r, 1.5) * 100) 1 calc(var(--r, 1.5) * var(--rh)); min-width: 0; }
.sv[data-layout="rows"] .vgrid > .grp, .sv[data-layout="rows"] .vgrid > .blockgap, .sv[data-layout="rows"] .vgrid > .divider,
.sv[data-layout="rows"] .vgrid > .vempty, .sv[data-layout="rows"] .vgrid > .grpact { flex: 0 0 100%; }
.sv[data-layout="rows"] .rowfill { display: block; flex: 400 1 0; height: 0; }

/* Mauerwerk */
.sv[data-layout="masonry"] .vgrid { display: block; column-width: var(--cell); column-gap: var(--gap); }
.sv[data-layout="masonry"] .tile { display: block; width: 100%; aspect-ratio: var(--r, 1.5); margin: 0 0 var(--gap); break-inside: avoid; }
.sv[data-layout="masonry"] .vgrid > .grp, .sv[data-layout="masonry"] .vgrid > .divider, .sv[data-layout="masonry"] .vgrid > .vempty,
.sv[data-layout="masonry"] .vgrid > .grpact, .sv[data-layout="masonry"] .vgrid > .blockgap { column-span: all; }
.sv[data-layout="masonry"] .vgrid > .grpact { display: flex; margin-bottom: var(--gap); }

/* Groß: eine Spalte */
.sv[data-layout="large"] .vgrid { grid-template-columns: minmax(0, 1fr); justify-items: center; }
.sv[data-layout="large"] .vgrid > * { justify-self: stretch; }
.sv[data-layout="large"] .vgrid > .tile { justify-self: center; width: min(100%, calc(88vh * var(--r, 1.5)), var(--lw, 1000px)); aspect-ratio: var(--r, 1.5); }
.sv[data-layout="large"][data-size="S"] { --lw: 760px; }
.sv[data-layout="large"][data-size="M"] { --lw: 1000px; }
.sv[data-layout="large"][data-size="L"] { --lw: 1300px; }

/* Banner */
.vhero { position: relative; overflow: hidden; background: var(--bg3); color: #fff; }
/* Höhe über --bh (Prozent der Fensterhöhe, pro Galerie einstellbar); 51 entspricht der früheren festen Höhe */
.vhero[data-style="tall"] { height: min(calc(var(--bh, 41) * 1vh), calc(var(--bh, 41) * 10.67px)); min-height: calc(var(--bh, 41) * 4.4px); }
.vhero-bg { position: absolute; inset: 0; background-size: cover; background-repeat: no-repeat; }
.vhero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0, 0, 0, .55), rgba(0, 0, 0, .05) 60%); pointer-events: none; }
.vhero-in { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: 0 48px 30px; max-width: 1400px; }
.vhero h2 { font-size: clamp(26px, 4.4vw, 54px); font-weight: 600; line-height: 1.1; text-shadow: 0 1px 14px rgba(0, 0, 0, .35); overflow-wrap: anywhere; }
.vhero p { margin-top: 8px; font-size: clamp(14px, 1.6vw, 19px); opacity: .92; text-shadow: 0 1px 8px rgba(0, 0, 0, .35); }
.sv.hasbanner .vtop h1 { display: none; }

@media (max-width: 900px) {
  .sv { --gap: 8px; --rh: 120px; }
  .sv[data-gap="tight"] { --gap: 3px; }
  .sv[data-gap="airy"] { --gap: 16px; }
  .sv[data-size="S"] { --rh: 90px; --cell: 100px; }
  .sv[data-size="M"] { --rh: 130px; --cell: 130px; }
  .sv[data-size="L"] { --rh: 190px; --cell: 180px; }
  .sv[data-layout="r32"][data-size="S"] { --cell: 120px; }
  .sv[data-layout="r32"][data-size="M"] { --cell: 160px; }
  .sv[data-layout="r32"][data-size="L"] { --cell: 220px; }
  .vhero[data-style="tall"] { height: calc(var(--bh, 41) * .69vh); min-height: calc(var(--bh, 41) * 3.45px); }
  .vhero-in { padding: 0 18px 18px; }
}

/* Admin: Banner-Einstellungen */
.bannerprev { width: 100%; max-width: 420px; aspect-ratio: 16 / 6; border-radius: 6px; background: var(--bg3) center / cover no-repeat; margin-bottom: 10px; border: 1px solid var(--line); }
.bannerbtns { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.bpick { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 6px; max-height: 50vh; overflow: auto; }
.bpick button { aspect-ratio: 1; border: 0; padding: 0; border-radius: 4px; background: var(--bg3) center / cover no-repeat; cursor: pointer; }
.bpick button:hover { outline: 2px solid #1f6feb; }
.opt.lropt { margin-top: 8px; }

/* Galerie-Einstellungen: alles auf einen Blick */
.adm-wrap.setwrap { max-width: 1500px; padding-bottom: 0; }
.setgrid { column-count: 3; column-gap: 18px; }
.setgrid .panel { break-inside: avoid; margin-bottom: 18px; padding: 14px 16px; }
.setgrid .formrow { grid-template-columns: 1fr; padding: 7px 0; gap: 3px; }
.setgrid .formrow .fc input[type=text], .setgrid .formrow .fc input[type=password], .setgrid .formrow .fc input[type=date], .setgrid .formrow .fc select { max-width: none; width: 100%; }
.setgrid .formrow .fd { display: none; }
.setgrid .formrow .fl { cursor: help; }
.setgrid .formrow .fc { gap: 6px; }
.setgrid .panel h2 { margin-bottom: 4px; }
.setgrid .bannerprev { max-width: 100%; aspect-ratio: 16 / 5; }
.savebar { position: sticky; bottom: 0; z-index: 40; display: flex; gap: 12px; justify-content: space-between; align-items: center; flex-wrap: wrap; padding: 12px 0; margin-top: 4px; background: var(--bg); border-top: 1px solid var(--line); }
@media (max-width: 1150px) { .setgrid { column-count: 2; } }
@media (max-width: 720px) { .setgrid { column-count: 1; } }

/* System: Bildeinstellungen und Auslastung */
.numunit { display: inline-flex; align-items: center; gap: 6px; margin-left: 8px; }
.numunit input { width: 84px; }
.verdict { padding: 10px 14px; border-radius: 8px; margin-bottom: 10px; font-weight: 500; background: var(--bg3); }
.verdict.ok { background: #e3f4e6; color: #17602a; }
.verdict.watch { background: #fff3d6; color: #7a5300; }
.verdict.move { background: #fbe0e0; color: #8a1f1f; }
.statchart { margin: 12px 0; }
.statchart .bars { display: flex; align-items: flex-end; gap: 3px; height: 70px; border-bottom: 1px solid var(--line); }
.statchart .bar { flex: 1; background: #1f6feb; border-radius: 2px 2px 0 0; min-height: 2px; opacity: .85; }
.statchart .barlbl { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 3px; }
.sysrow[title] { cursor: help; }

/* Lightbox: Klickflächen links/rechts neben dem Bild */
.lb-stage[data-zone="l"] { cursor: w-resize; }
.lb-stage[data-zone="r"] { cursor: e-resize; }

/* Zeilen gleicher Höhe: kleine Gruppen (z. B. Auswahl, Farbblöcke) dürfen nicht riesig werden */
.sv[data-layout="rows"] .tile { max-width: calc(var(--r, 1.5) * var(--rh) * 1.35); }

/* 4:3 Raster */
.sv[data-layout="r43"] .tile { aspect-ratio: 4 / 3; }
.sv[data-layout="r43"][data-size="S"] { --cell: 150px; }
.sv[data-layout="r43"][data-size="M"] { --cell: 230px; }
.sv[data-layout="r43"][data-size="L"] { --cell: 330px; }
@media (max-width: 900px) {
  .sv[data-layout="r43"][data-size="S"] { --cell: 110px; }
  .sv[data-layout="r43"][data-size="M"] { --cell: 145px; }
  .sv[data-layout="r43"][data-size="L"] { --cell: 200px; }
}

/* Logo-Größe (System → Erscheinungsbild) */
.sv.haslogo { --hdr: max(60px, calc(var(--logoh, 54px) + 24px)); }
.sv[data-embed="client"] { --top: var(--hdr, 60px); }
.vtop { height: var(--hdr, 60px); }
.vlogo { height: var(--logoh, 54px); max-width: calc(var(--logoh, 54px) * 5); }
@media (max-width: 900px) {
  .sv.haslogo { --hdr: 64px; }
  .vlogo { height: min(var(--logoh, 54px), 40px); max-width: 60vw; }
}
@media (max-width: 640px) { .sv:not(.haslogo) { --hdr: 56px; } }

.vlogolink { display: flex; align-items: center; flex: none; margin-right: 6px; }
.vlogolink .vlogo { margin-right: 0; }

/* System-Seite: mehrspaltig, kompakt */
.adm-wrap.syswrap { max-width: 1500px; }
.sysgrid { column-count: 3; column-gap: 18px; }
.sysgrid .panel { break-inside: avoid; margin-bottom: 18px; padding: 12px 16px; }
.sysgrid .panel h2 { margin-bottom: 4px; }
.sysgrid .sysrow { flex-wrap: wrap; align-items: center; padding: 6px 0; }
.sysgrid .sysrow .colorctl { flex-wrap: wrap; margin-left: auto; }
.sysgrid .fmthint, .sysgrid .panel > .fmthint { font-size: 12px; margin: 6px 0; }
.sysgrid .numunit { margin-left: 0; }
.sysgrid .numunit input { width: 72px; }
.sysgrid .statchart .bars { height: 54px; }
.sysgrid .verdict { padding: 8px 12px; font-size: 14px; }
.sysgrid input[type=text], .sysgrid input[type=password] { max-width: 100%; }
@media (max-width: 1250px) { .sysgrid { column-count: 2; } }
@media (max-width: 760px) { .sysgrid { column-count: 1; } }

/* Hinweis unter der letzten Bilderzeile (im Hauptbereich, nicht am Seitenende) */
.vmain > .cfoot { padding: 0 24px 48px 48px; text-align: left; margin-top: -34px; position: relative; }
@media (max-width: 900px) { .vmain > .cfoot { padding: 0 16px 40px; } }
.lttbl { width: 100%; border-collapse: collapse; font-size: 13px; margin: 8px 0; }
.lttbl th, .lttbl td { padding: 4px 8px; border-bottom: 1px solid var(--line, #ddd); }
.lttbl th { text-align: right; font-weight: 600; }
.lttbl th:first-child { text-align: left; }

/* ---------- Markierungen im Raster: alles oben links, untereinander, ohne weißen Hintergrund ---------- */
.tile { --ty: 12px; --dd: 18px; }
.tile.pk { --ty: 28px; }
.tile .mk { position: absolute; left: 9px; top: var(--ty); display: flex; flex-direction: column; align-items: flex-start; gap: 4px; z-index: 2; pointer-events: none; }
.tile .badge { position: static; width: var(--dd); height: var(--dd); box-shadow: 0 0 0 1.5px #fff, 0 1px 3px rgba(0, 0, 0, .35); }
.tile .dots { position: static; display: flex; flex-direction: column; flex-wrap: nowrap; gap: 4px; }
.tile .dot { width: var(--dd); height: var(--dd); box-shadow: 0 0 0 1.5px #fff, 0 1px 3px rgba(0, 0, 0, .35); }
.tile .quick {
  left: 9px; right: auto; top: 12px; bottom: auto; flex-direction: column; align-items: flex-start; gap: 4px; padding: 0;
  background: none; box-shadow: none; border-radius: 0; z-index: 4;
}
.tile .qc { width: var(--dd); height: var(--dd); box-shadow: 0 0 0 1.5px #fff, 0 1px 3px rgba(0, 0, 0, .35); }
.tile .qc:hover { transform: scale(1.12); }
.tile .qc.on { transform: none; box-shadow: 0 0 0 1.5px #fff, 0 0 0 3.5px rgba(0, 0, 0, .6); }
.tile .qc.qx { box-shadow: 0 0 0 1.5px #fff, 0 1px 3px rgba(0, 0, 0, .35); }
.tile .quick .qp { width: 22px; height: 22px; margin-left: -2px; box-shadow: none; }
.tile .quick .qp .star { fill: rgba(0, 0, 0, .35); stroke: #fff; }
.tile .quick .qp.on .star, .tile .quick .qp:hover .star { fill: var(--pick); }
@media (hover: hover) {
  .tile:hover .dots { bottom: auto; }
  /* Beim Darüberfahren ersetzt die Farbauswahl die bisherigen Markierungspunkte an derselben Stelle */
  .sv:not(.selmode) .tile.hasq:hover .mk { visibility: hidden; }
}
@media (max-width: 700px) { .tile.pk { --ty: 24px; } }

/* ---------- Lightbox: Bedienung ---------- */
.lb-stage[data-zone="l"] { cursor: w-resize; }
.lb-stage[data-zone="r"] { cursor: e-resize; }
.lb-nav { width: 52px; height: 72px; }
.lb-nav.prev { left: clamp(28px, 6vw, 110px); border-radius: 8px; }
.lb-nav.next { right: clamp(28px, 6vw, 110px); border-radius: 8px; }
.lb-ctl { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px 14px; }
.lbm { gap: 7px; padding: 5.5px 11px; font-size: 13.75px; }
.lbm .sw { width: 9px; height: 9px; }
.lb-sel { height: 33px; margin-right: 0; font-size: 13.75px; gap: 8px; padding: 0 14px 0 8px; }
.lb-star { position: absolute; z-index: 3; width: 28px; height: 28px; padding: 0; border: 0; background: none; display: grid; place-items: center; cursor: pointer; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .28)); }
.lb-star .star { fill: rgba(0, 0, 0, .3); stroke: #fff; }
.lb-star.on .star { fill: var(--pick); }
.lb-star.readonly { cursor: default; }
.lb-star:disabled { opacity: 1; }

.lb-stage[data-zone="l"], .lb-stage[data-zone="l"] .lb-img { cursor: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%2232%22 height=%2232%22 viewBox=%220 0 32 32%22 fill=%22none%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M20 6L10 16l10 10%22 stroke=%22%23fff%22 stroke-width=%225.5%22/%3E%3Cpath d=%22M20 6L10 16l10 10%22 stroke=%22%23222%22 stroke-width=%222.4%22/%3E%3C/svg%3E") 16 16, w-resize; }
.lb-stage[data-zone="r"], .lb-stage[data-zone="r"] .lb-img { cursor: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%2232%22 height=%2232%22 viewBox=%220 0 32 32%22 fill=%22none%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M12 6l10 10-10 10%22 stroke=%22%23fff%22 stroke-width=%225.5%22/%3E%3Cpath d=%22M12 6l10 10-10 10%22 stroke=%22%23222%22 stroke-width=%222.4%22/%3E%3C/svg%3E") 16 16, e-resize; }
/* Markierungen im Raster: etwas mehr Abstand */
.tile .mk, .tile .dots { gap: 7px; }
.tile .quick { gap: 7px; }
.sv[data-size="S"] .tile { --dd: 16px; }
.sv[data-size="S"] .tile .quick { gap: 5px; top: 8px; }
.tile .dot.cnt { font-size: 10.5px; }

/* Grid-Farbpunkte: ohne weißen Rahmen und ohne weißen Mittelpunkt */
.tile .badge, .tile .dot, .tile .qc, .tile .qc.qx { box-shadow: 0 1px 3px rgba(0, 0, 0, .4); }
.tile .qc.on { transform: scale(1.18); box-shadow: 0 1px 4px rgba(0, 0, 0, .5); }
.tile .qc.on::after { display: none; }

/* Lightbox: Farben und Auswahl als schlanke Symbolleiste (nur Kacheln, keine Beschriftung), am Handy und am Rechner gleich */
@media all {
  .lb-bottom { gap: 6px; padding: 6px 8px calc(10px + env(safe-area-inset-bottom)); }
  .lb-ctl { flex-wrap: nowrap; gap: 0; width: 100%; justify-content: center; }
  .lb-marks { flex-wrap: nowrap; gap: 6px; }
  .lbm { width: 44px; height: 44px; padding: 0; border-radius: 0; border: 0; background: none; justify-content: center; gap: 0; }
  .lbm .cl { display: none; }
  .lbm .sw { width: 26px; height: 26px; border-radius: 6px; box-shadow: 0 1px 3px rgba(0,0,0,.35); transition: transform .12s; }
  .lbm:hover:not(:disabled), .lbm.on { background: none; }
  .lbm.on { color: var(--text); }
  .lbm.on .sw { transform: scale(1.3); }
  .lbm.on.c-black .sw { box-shadow: 0 1px 3px rgba(0,0,0,.35); }
  .lbm.lbx .xs { font-size: 22px; line-height: 1; }
  .lb-sel, .lb-sel:hover, .lb-sel.on { background: none; border: 0; }
  .lb-sel { position: relative; width: 44px; height: 44px; padding: 0; margin-left: 12px; border-radius: 0; justify-content: center; gap: 0; }
  .lb-sel .lbs-t { display: none; }
  .lb-sel .lbs-dot { width: 26px; height: 26px; border-radius: 6px; }
  .lb-sel.on .lbs-dot { background: #1f6feb; border-color: #1f6feb; color: #fff; }
  .lb-sel[data-n]:not([data-n=""])::after {
    content: attr(data-n); position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px;
    background: #1f6feb; color: #fff; font-size: 11px; line-height: 18px; text-align: center; font-weight: 600;
  }
}

/* Grid: Farbmarkierungen als abgerundete Kacheln (statt Punkte) */
.tile { --dd: 20px; }
.tile .badge, .tile .dot, .tile .qc { border-radius: 5px; }
.tile .qc.qp { border-radius: 0; }
.tile .dot { font-size: 11px; }
.sv[data-size="S"] .tile { --dd: 16px; }
.sv[data-size="S"] .tile .dot { font-size: 9.5px; }

/* Auswahl-Symbole als Kachel statt Kreis */
.tile .tcheck { border-radius: 5px; }
.lb-sel .lbs-dot { border-radius: 5px; }
.lbo .dot { border-radius: 3px; }

/* Lightbox: nicht gewählte Farben abblenden, damit die gewählte beim Durchblättern auffällt */
.lb-marks .lbm { transition: opacity .12s, transform .12s; }
.lb-marks:has(.lbm.on:not(.lbx)) .lbm:not(.on):not(.lbx) { opacity: .35; }

/* Gruppenüberschriften und Filter: Farbkacheln statt Punkte */
.grp .gdot { width: 16px; height: 16px; border-radius: 5px; box-shadow: 0 1px 3px rgba(0, 0, 0, .35); }
.sw { border-radius: 4px; }

/* Handy: "Filter & Menü" links, Logo rechts in der Kopfzeile */
@media (max-width: 860px) {
  .vtop { gap: 10px; }
  .vtop .vmenu { order: 1; white-space: nowrap; flex: none; }
  .vtop h1 { order: 2; flex: 0 1 auto; min-width: 48px; }
  .vtop .vspacer { order: 3; flex: 1 1 0; }
  .vtop .vlogolink, .vtop > .vlogo { order: 4; margin: 0 0 0 auto; flex: none; max-width: 38vw; }
  .vtop .vlogo { max-width: 38vw; margin: 0; }
}

/* Handy, Admin-Ansicht (ohne Kopfzeile): Filter & Menü links, Logo rechts */
.vmainbar .vbarlogo { display: none; }
@media (max-width: 860px) {
  .vmainbar { gap: 10px; }
  .vmainbar .vmenu { order: -1; white-space: nowrap; flex: none; }
  .vmainbar .vbarlogo { display: block; order: 5; max-width: 38vw; margin: 0 0 0 auto; }
  .vmainbar .vbarlogo.vlogo, .vmainbar .vbarlogo .vlogo { height: min(var(--logoh, 54px), 36px); max-width: 38vw; margin: 0; }
  .vmainbar .vspacer { display: none; }
  .vmainbar .vcount { flex: 1; min-width: 0; }
}

/* Abstand zwischen den Blöcken (Gruppen) um 25 % kleiner: Gesamtabstand = 75 % des bisherigen */
/* (zweite Verkleinerung: Gesamtabstand halbiert, also 37,5 % des ursprünglichen; über negativen Außenabstand) */
.vgrid > .blockgap { height: 0; }
.vgrid > .blockgap + .grp { margin-top: calc(0.375 * (var(--gap, 14px) * 2 + 14px) - var(--gap, 14px) * 2); }

/* Lightbox am Handy: "×" und Anzahl der ausgewählten Bilder 50 % größer */
@media (max-width: 700px) {
  .lbm.lbx .xs { font-size: 33px; width: auto; }
  .lb-sel[data-n]:not([data-n=""])::after {
    top: -8px; right: -8px; min-width: 27px; height: 27px; padding: 0 6px; border-radius: 14px; font-size: 16.5px; line-height: 27px;
  }
}

/* Lightbox: Zwei-Finger-Zoom */
.lb-stage { touch-action: none; }
.lb-img { transform-origin: center center; will-change: transform; }
.lb-stage.zoomed .lb-star { visibility: hidden; }

/* Touch-Geräte mit BREITER Seite (z. B. Android-Chrome mit "Desktop-Website", Tablets): größere Bedienelemente
   in der Lightbox, keine Desktop-Pfeile. Normale Handys (bis 700 px Breite, z. B. iPhone) bleiben unverändert. */
@media (min-width: 701px) and (hover: none) and (pointer: coarse) {
  .lb-nav { display: none; }
  .lb-top { padding-left: 16px; padding-right: 10px; }
  .lb-meta { font-size: 21px; }
  .lb-count { font-size: 21px; }
  .lb-name { font-size: 18px; }
  .lb-actions { gap: 8px; }
  .lb-btn { width: 56px; height: 56px; }
  .lb-btn svg { width: 30px; height: 30px; }
  .lbm.lbx .xs { font-size: 33px; width: auto; }
  .lb-sel[data-n]:not([data-n=""])::after {
    top: -8px; right: -8px; min-width: 27px; height: 27px; padding: 0 6px; border-radius: 14px; font-size: 16.5px; line-height: 27px;
  }
}

/* Auf Touch-Geräten nie Pfeile am Bildrand (egal wie breit die Seite ist) */
@media (hover: none), (pointer: coarse) {
  .lb-nav { display: none !important; }
}
.verdict.none { background: #ececec; color: #444; }
.gviews .btn + .btn { border-left: 1px solid var(--line2); }
.btn.on:hover:not(:disabled) { background: var(--accent); border-color: var(--accent); color: #fff; }
.gcards:not(.list) .gcard .acts .del .lbl { display: none; }
.gcards:not(.list) .gcard .acts .del { padding: 6px 9px; }
.gcards.list .gcard .meta:nth-of-type(2) { width: 190px; }
.gcards.list .gcard .meta { text-align: left; }
@media (max-width: 860px) { .gcards.list .gcard .meta:nth-of-type(2) { width: auto; } }
.gcard .acts { margin-top: auto; padding-top: 10px; }
.gcards.list .gcard .acts { padding-top: 0; }
/* Teilnehmer in der Galerie-Übersicht */
.mlink { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
.mlink:hover { color: var(--text); }
.gpanel .gphead { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.gcards.list .gcard { flex-wrap: wrap; }
.gcards.list .gcard .gpanel { flex: 1 0 100%; padding: 10px 6px 8px; margin-top: 4px; border-top: 1px solid var(--line); min-width: 0; }
.modal.wide { width: min(980px, 100%); max-height: 88vh; overflow: auto; }
.gcards:not(.list) .gcard .acts .pbtn .lbl { display: none; }
.gcards:not(.list) .gcard .acts .pbtn { padding: 6px 9px; }
.gcards:not(.list) .gcard .acts { gap: 4px; }
.gcards:not(.list) .gcard .acts .lnk .lbl { display: none; }
.gcards:not(.list) .gcard .acts .lnk { padding: 6px 9px; }
/* System: Voreinstellungen für neue Galerien */
.presetrow { align-items: center; justify-content: space-between; }
.presetrow select { width: 260px; max-width: 60%; }
.presetrow input[type=checkbox] { margin-left: auto; }
.panel > .fmthint { margin: 0 0 8px; }
/* Import aus FTP-Ordner */
.adm-title-acts { display: flex; gap: 10px; flex-wrap: wrap; }
.impbar { height: 10px; background: var(--bg3); border-radius: 6px; overflow: hidden; }
.impfill { height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.implist { margin: 0 0 6px; padding-left: 18px; font-size: 13px; color: var(--muted); max-height: 160px; overflow: auto; }
.implist.impres { list-style: none; padding-left: 0; font-size: 14px; color: var(--text); }
.implist.impres li { padding: 4px 0; border-bottom: 1px solid var(--line); }
.implist.impres li a { margin-left: 6px; }
/* Bannerhöhe: Schieberegler mit Wert */
.bhctl { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.bhctl input[type=range] { width: 100%; }
.bhval { font-size: 12.5px; color: var(--muted); }
.presetrow .bhctl { width: 260px; max-width: 60%; }

/* ---------- Admin: Arbeitsansicht einer Galerie (seit 1.1.074) ---------- */
/* Linke Leiste hellgrau abgesetzt */
.sv[data-embed="admin"] .vside { background: #f6f6f7; border-right-color: #e4e4e8; }
.sv[data-embed="admin"] .vside .frow:hover { background: #ebebee; }
.sv[data-embed="admin"] .vside .frow.on { background: #e3e3e7; }
/* Kopfbereich mit Titel und Aktions-Symbolen */
.ghead { margin: -4px 0 30px; padding-bottom: 18px; border-bottom: 1px solid #e2e2e6; }
.ghead .gback { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 13px; text-decoration: none; margin-bottom: 10px; }
.ghead .gback:hover { color: var(--text); }
.ghead .gtitle { font-size: 21px; line-height: 1.2; font-weight: 650; overflow-wrap: anywhere; }
.ghead .gmeta { color: var(--muted); font-size: 13px; margin-top: 4px; }
.gicons { display: flex; gap: 6px; margin-top: 14px; }
.gicon {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 9px; border: 1px solid #dcdce1;
  background: var(--bg); color: var(--text); cursor: pointer; text-decoration: none; transition: background .12s, border-color .12s, color .12s;
}
.gicon:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.gicon:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.gupst { margin-top: 10px; font-size: 12.5px; color: var(--muted); background: var(--bg); border: 1px solid #e2e2e6; border-radius: 7px; padding: 6px 9px; }
.vmain > .ghead.m { display: none; }
@media (max-width: 860px) {
  .vside .ghead { display: none; }
  .vmain > .ghead.m { display: block; margin: 0; padding: 14px 16px 14px; background: #f6f6f7; border-bottom: 1px solid #e4e4e8; }
  .ghead.m .gback { margin-bottom: 6px; }
  .ghead.m .gtitle { font-size: 19px; }
  .ghead.m .gicons { margin-top: 10px; }
}
/* Popups für Bilder, Teilnehmer und Einstellungen */
.popup-back { padding: 3vh 16px; }
.modal.popup { display: flex; flex-direction: column; padding: 0; width: min(1320px, 100%); height: min(94vh, 1100px); overflow: hidden; }
.modal.popup.lg { width: min(1040px, 100%); height: auto; max-height: 90vh; }
.popup .phead { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px 12px 22px; border-bottom: 1px solid var(--line); flex: none; }
.popup .phead h2 { margin: 0; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.popup .pbody { flex: 1; overflow: auto; padding: 18px 22px 0; }
.popup .pbody > .hint { margin: 0 0 18px; }
.popup .adm-wrap { max-width: none; margin: 0; padding: 0 0 22px !important; }
.popup .adm-wrap.setwrap { padding-bottom: 0 !important; }
.popup .panel { margin-bottom: 14px; }
.popup .savebar { margin: 0 -22px; padding: 12px 22px; }
@media (max-width: 1250px) { .popup .setgrid { column-count: 2; } }
@media (max-width: 760px) {
  .popup .setgrid { column-count: 1; }
  .popup-back { padding: 0; }
  .modal.popup, .modal.popup.lg { width: 100%; height: 100%; max-height: none; border-radius: 0; border: 0; }
  .popup .pbody { padding: 14px 14px 0; }
  .popup .savebar { margin: 0 -14px; padding: 10px 14px; }
}
.ppart .pparthead { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; margin-bottom: 12px; }
.ppart .pparthead .hint { margin: 0; max-width: 640px; }
.ppart .pparthead .btn { flex: none; }
@media (max-width: 640px) { .ppart .pparthead { flex-direction: column; } }
/* Banner-Vorschau in den Galerie-Einstellungen: festes Mini-Fenster, nur die Bannerfläche ändert die Höhe */
.bwin { width: 100%; max-width: 420px; border: 1px solid var(--line2); border-radius: 7px; overflow: hidden; background: var(--bg); margin-bottom: 10px; }
.bwin-bar { height: 12px; display: flex; gap: 4px; align-items: center; padding: 0 7px; background: var(--bg3); border-bottom: 1px solid var(--line); }
.bwin-bar i { width: 5px; height: 5px; border-radius: 50%; background: #c9c9cf; }
.bwin-page { position: relative; aspect-ratio: 16 / 10; overflow: hidden; }
.bwin-hero { position: relative; height: 41%; background: var(--bg3) center / cover no-repeat; transition: height .08s linear; }
.bwin-hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0, 0, 0, .5), rgba(0, 0, 0, 0) 65%); }
.bwin-t { position: absolute; left: 7%; bottom: 9%; z-index: 1; color: #fff; font-weight: 600; font-size: 13px; line-height: 1.1; max-width: 86%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bwin-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; padding: 5px 6px 0 26%; }
.bwin-grid span { aspect-ratio: 1; background: #e4e4e8; border-radius: 2px; }
.savestat { color: var(--muted); font-size: 13px; }
.savestat.err { color: #c0262c; }

/* ---------- Admin: Seitenrahmen mit linker Leiste (seit 1.1.075) ---------- */
.app { display: flex; align-items: flex-start; min-height: 100vh; }
.amain { flex: 1; min-width: 0; }
.anav {
  position: sticky; top: 0; flex: none; width: var(--side); height: 100vh; overflow-y: auto;
  padding: 22px 20px 40px 24px; background: #f6f6f7; border-right: 1px solid #e4e4e8;
}
.anavtop { margin-bottom: 26px; padding-bottom: 14px; border-bottom: 1px solid #e2e2e6; }
.brandrow { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.anavtop .brand { display: block; font-weight: 700; letter-spacing: .02em; text-decoration: none; font-size: 15px; }
.nlogout { display: inline-grid; place-items: center; width: 32px; height: 32px; margin-right: -6px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); cursor: pointer; }
.nlogout:hover { background: #ebebee; color: var(--text); }
.nitems { display: flex; gap: 2px; margin: 0 -9px; }
.nitem {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 9px; border-radius: 7px; border: 0; background: transparent;
  color: var(--muted); font-size: 13.5px; line-height: 1.2; text-decoration: none; cursor: pointer; white-space: nowrap;
}
.nitem:hover { background: #ebebee; color: var(--text); }
.nitem.on { background: var(--bg); color: var(--text); font-weight: 600; box-shadow: 0 0 0 1px #dcdce1; }
.ghead .anavtop { margin: 0 0 18px; }
.aside-tools .btn + .btn { margin-top: 10px; }
.aside-tools .gsearchwrap { max-width: none; margin-bottom: 12px; }
.aside-tools .gviewrow { margin: 0; }
.aside-tools .gviews { margin-left: 0; }
.aside-tools .frows .frow { font-size: 14px; }
.adm-wrap.listwrap .adm-title, .adm-wrap.syswrap .adm-title { margin-bottom: 18px; }
/* Listenansicht: Zeilen nicht bis zum Fensterrand */
.gcards.list { max-width: 1180px; }
/* System: Spalten nach verfügbarer Breite (links ist die Leiste) */
.sysgrid { column-count: 2; }
@media (min-width: 1750px) { .sysgrid { column-count: 3; } }
@media (max-width: 1100px) { .sysgrid { column-count: 1; } }
@media (max-width: 860px) {
  .app { display: block; }
  .anav { position: static; width: auto; height: auto; padding: 12px 16px 6px; border-right: 0; border-bottom: 1px solid #e4e4e8; }
  .anavtop, .ghead .anavtop { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; padding-bottom: 10px; }
  .brandrow { margin: 0; gap: 4px; }
  .anavtop .brand { margin: 0; }
  .nitems { margin: 0 -6px 0 0; }
  .nitem { padding: 6px 7px; }
  .aside-tools .vsec { margin-bottom: 14px; }
  .aside-tools .vsec-t { display: none; }
  .aside-tools .vsec:first-child { display: flex; flex-wrap: wrap; gap: 8px; }
  .aside-tools .btn.block { display: inline-flex; width: auto; }
  .aside-tools .btn + .btn { margin: 0; }
  .anav .frows { flex-direction: row; flex-wrap: wrap; margin: 0; }
}
/* Galerie-Übersicht: Link, Teilnehmer, Löschen in beiden Ansichten als Symbole (Name im Tooltip) */
.gcard .acts .lbl { display: none; }
.gcard .acts .lnk, .gcard .acts .pbtn, .gcard .acts .del { padding: 6px 9px; }
.gcards.list .gcard .meta:first-of-type { width: 230px; }
.gcards.list .gcard .meta:nth-of-type(2) { width: 170px; }
.gcards.list .gcard .acts { gap: 4px; }
@media (max-width: 860px) { .gcards.list .gcard .meta:first-of-type, .gcards.list .gcard .meta:nth-of-type(2) { width: auto; } }
/* Umschalter Kachel/Liste in der Leiste: kein Abstand zwischen den beiden Knöpfen */
.aside-tools .segs .btn + .btn { margin-top: 0; }
/* System: Abschnitte klarer voneinander abgesetzt (Kopfzeile mit hellgrauem Band, etwas kräftigerer Rahmen) */
.sysgrid .panel { border-color: #dcdce1; box-shadow: 0 1px 3px rgba(0, 0, 0, .05); }
.sysgrid .panel > h2 { margin: -14px -16px 10px; padding: 10px 16px; background: #f6f6f7; border-bottom: 1px solid #e4e4e8; border-radius: 9px 9px 0 0; }

/* ---------- Übergänge (seit 1.1.077): nur Deckkraft/Verschiebung, damit es flüssig bleibt ---------- */
.modal-back { animation: mbIn .16s ease-out; }
.modal-back > .modal { animation: mIn .2s cubic-bezier(.2, .8, .2, 1); }
.modal-back.closing { animation: mbOut .14s ease-in forwards; pointer-events: none; }
.modal-back.closing > .modal { animation: mOut .14s ease-in forwards; }
/* Große Popups nur über die Deckkraft einblenden: gemessen die flüssigste Variante (keine ausgelassenen Frames) */
.modal-back > .modal.popup { animation: pIn .18s ease-out; }
.modal-back.closing > .modal.popup { animation: pOut .14s ease-in forwards; }
@keyframes pIn { from { opacity: 0; } }
@keyframes pOut { to { opacity: 0; } }
@keyframes mbIn { from { opacity: 0; } }
@keyframes mIn { from { opacity: 0; transform: translateY(6px); } }
@keyframes mbOut { to { opacity: 0; } }
@keyframes mOut { to { opacity: 0; transform: translateY(4px); } }
/* Teilnehmer in der Listenansicht: weich auf- und zuklappen (Grid-Zeilen 0fr -> 1fr) */
.gcards.list .gcard .gpanel {
  flex: 1 0 100%; min-width: 0; padding: 0; margin: 0; border-top: 0;
  display: grid; grid-template-rows: 0fr; opacity: 0; transition: grid-template-rows .26s cubic-bezier(.4, 0, .2, 1), opacity .2s ease;
}
.gcards.list .gcard .gpanel.open { grid-template-rows: 1fr; opacity: 1; }
.gpanel-in { overflow: hidden; min-height: 0; }
.gpanel-pad { padding: 10px 6px 8px; margin-top: 4px; border-top: 1px solid var(--line); }
/* Ladekreis in Knöpfen */
.btn.busy { position: relative; pointer-events: none; }
.btn.busy > * { visibility: hidden; }
.btn.busy::after {
  content: ''; position: absolute; left: 50%; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px;
  border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
/* Viele Galerien: Karten außerhalb des sichtbaren Bereichs nicht vorab zeichnen */
.gcard { content-visibility: auto; contain-intrinsic-size: auto 330px; }
.gcards.list .gcard { contain-intrinsic-size: auto 62px; }
.gcards.list .gcard:has(.gpanel) { content-visibility: visible; }
/* Kacheln, deren Bild schon im Browser liegt, ohne erneutes Einblenden */
.tile.instant .tbg { transition: none; }
@media (prefers-reduced-motion: reduce) {
  .modal-back, .modal-back > .modal, .modal-back.closing, .modal-back.closing > .modal, .modal-back > .modal.popup { animation: none !important; }
}
/* Hintergrund-Upload: Fortschrittsbalken in der linken Leiste (Farbe = Menüfarbe aus System > Erscheinungsbild) */
.gupst-t { margin-bottom: 6px; }
.gupst-bar { height: 6px; border-radius: 3px; background: #e6e6ea; overflow: hidden; }
.gupst-bar > span { display: block; height: 100%; width: 0; border-radius: 3px; background: var(--menu, var(--accent)); transition: width .3s ease; }
/* System-Seite: feste Spalten (links Erscheinungsbild/Bildgrößen, Mitte Voreinstellungen/Passwort, rechts Server) */
.setgrid.sysgrid { column-count: auto; columns: auto; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 18px; align-items: start; }
.sysgrid .syscol-r { display: contents; }
.sysgrid .syscol { min-width: 0; }
@media (max-width: 1749px) {
  .setgrid.sysgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sysgrid .syscol-r { display: block; min-width: 0; }
}
@media (max-width: 1100px) {
  .setgrid.sysgrid { grid-template-columns: minmax(0, 1fr); }
}
