/* ============================================================
   open360.de – Design-System „Angebot“ (Rot & Gelb auf Weiß)
   Handelsübliche Signalfarben: Gelb = Preis/Angebot, Rot = Aktion.
   Bewusst nur heller Modus (einheitlicher Auftritt, kein Systemdunkelmodus).
   Setzt zusätzlich die Bootstrap-5.3-Variablen.
   Kontraste (WCAG 2.1), alle >= 4,5:1:
     Weiß / Rot #E30613 4,9 · Tinte #1A1A1A / Gelb #FFD500 12,2
     Rot-Text #C8000F / Weiß 6,1 · Dunkelrot #A8000D / Gelb 5,5
     Muted #595959 / Weiß 7,0
   ============================================================ */

:root {
  /* Marke */
  --rot-600: #E30613;
  --rot-700: #C8000F;
  --rot-800: #A8000D;
  --gelb-400: #FFD500;
  --gelb-300: #FFE34D;
  --gelb-100: #FFF3B0;
  --gelb-50:  #FFF9E0;
  --tinte: #1A1A1A;

  /* Semantik */
  --bg: #FFFFFF;
  --surface: #FFFFFF;
  --surface-2: var(--gelb-50);
  --ink: var(--tinte);
  --muted: #595959;
  --line: #E8E8E8;
  --primary: var(--rot-600);
  --primary-hover: var(--rot-700);
  --on-primary: #FFFFFF;
  --link: var(--rot-700);
  --ghost-line: #DADADA;
  --ghost-hover-bg: var(--gelb-50);
  --accent: var(--gelb-400);
  --accent-hover: var(--gelb-300);
  --on-accent: var(--tinte);
  --accent-text: var(--rot-700);
  --success-bg: #E7F8EE; --success-ink: #14532D;
  --danger-bg:  #FDE8E8; --danger-ink:  #8A1C1C;
  --warn-bg:    #FFF4D6; --warn-ink:    #6B4500;

  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 6px 22px -12px rgba(0, 0, 0, .28);
  --shadow-hover: 0 14px 32px -12px rgba(0, 0, 0, .32);
  --font: ui-rounded, "SF Pro Rounded", "Segoe UI Variable Display", "Segoe UI", system-ui,
          -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;

  /* Bootstrap 5.3 */
  --bs-primary: #E30613; --bs-primary-rgb: 227, 6, 19;
  --bs-warning: #FFD500; --bs-warning-rgb: 255, 213, 0;
  --bs-body-bg: var(--bg); --bs-body-color: var(--ink);
  --bs-border-radius: var(--radius-sm);
  --bs-link-color: var(--link); --bs-link-hover-color: var(--rot-800);
  --bs-body-font-family: var(--font);
  color-scheme: light;
}

/* ---------- Basis ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: 16px; line-height: 1.55;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--link); text-underline-offset: 3px; }
a:hover { color: var(--link); text-decoration-thickness: 2px; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -.02em; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 850; }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); font-weight: 800; }
h3 { font-size: 1.1rem; font-weight: 750; }
.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--rot-600); outline-offset: 2px; border-radius: 6px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .container { display: flex; align-items: center; gap: 16px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 850; font-size: 1.35rem;
  color: var(--ink); text-decoration: none; letter-spacing: -.03em; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center;
  background: var(--rot-600);
  color: #FFFFFF; font-weight: 900; font-size: 1rem; box-shadow: var(--shadow);
}
.brand b { color: var(--accent-text); }
.nav { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.nav a { padding: 8px 12px; border-radius: 999px; text-decoration: none; color: var(--ink); font-weight: 600; }
.nav a:hover { background: var(--surface-2); }
.nav a[aria-current="page"] { background: var(--primary); color: var(--on-primary); }
.brand { flex: none; }
@media (max-width: 640px) {
  .site-header .container { flex-wrap: wrap; gap: 4px 12px; padding-top: 8px; padding-bottom: 8px; }
  .nav { margin-left: 0; width: 100%; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .nav a, .nav .btn { white-space: nowrap; padding: 6px 12px; }
  .nav a.nav-cta { order: -1; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden; color: var(--tinte);
  background: var(--gelb-400);
  padding: 56px 0 72px;
}
.hero::before, .hero::after {
  content: ""; position: absolute; border-radius: 50%; pointer-events: none;
}
.hero { border-bottom: 6px solid var(--rot-600); }
.hero::before { width: 420px; height: 420px; right: -120px; top: -140px;
  background: var(--rot-600); opacity: 1; }
@media (max-width: 899px) { .hero::before { display: none; } }
.hero::after { width: 260px; height: 260px; right: 18%; bottom: -150px;
  background: var(--gelb-300); opacity: 1; }
.hero .container { position: relative; z-index: 1; }
.hero h1 { max-width: 14ch; }
.hero h1 em { font-style: normal; color: var(--rot-800); }
.hero p { font-size: 1.15rem; max-width: 46ch; color: var(--tinte); }

/* Suche */
.search {
  display: flex; gap: 8px; margin-top: 24px; max-width: 640px;
  background: var(--surface); padding: 8px; border-radius: 999px; box-shadow: var(--shadow-hover);
}
.search input {
  flex: 1; min-width: 0; border: 0; background: transparent; color: var(--ink);
  font: inherit; font-size: 1.05rem; padding: 10px 16px; outline: none;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 700; padding: 12px 22px; border-radius: 999px;
  border: 2px solid transparent; cursor: pointer; text-decoration: none;
  transition: transform .12s ease, background-color .15s ease, box-shadow .15s ease;
}
.btn:active { transform: translateY(1px) scale(.98); }
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-hover); color: var(--on-primary); box-shadow: var(--shadow); }
.btn-accent { background: var(--accent); color: var(--on-accent); }
.btn-accent:hover { background: var(--accent-hover); color: var(--on-accent); box-shadow: var(--shadow); }
.btn-ghost { background: transparent; color: var(--link); border-color: var(--ghost-line); }
.btn-ghost:hover { background: var(--ghost-hover-bg); color: var(--link); }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* ---------- Kategorie-Chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 999px;
  background: var(--surface); border: 2px solid var(--line); color: var(--ink);
  font-weight: 700; text-decoration: none; transition: border-color .15s, transform .15s;
}
.chip:hover { border-color: var(--accent); transform: translateY(-2px); color: var(--ink); }
.chip .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.chip:nth-child(even) .dot { background: var(--primary); }

/* ---------- Abschnitte ---------- */
.section { padding: 40px 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap; margin-bottom: 20px; }
.section-head h2 { margin: 0; }
.section-head .btn { white-space: nowrap; padding: 10px 18px; }

/* ---------- Anzeigen-Karten ---------- */
.ad-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.ad-card {
  position: relative; display: flex; flex-direction: column; background: var(--surface);
  border-radius: var(--radius); overflow: hidden; text-decoration: none; color: var(--ink);
  box-shadow: var(--shadow); transition: transform .18s ease, box-shadow .18s ease;
}
.ad-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); color: var(--ink); }
.ad-card .thumb { aspect-ratio: 4 / 3; background: var(--surface-2); overflow: hidden; }
.ad-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.ad-card .body { padding: 14px 16px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.ad-card .title { font-weight: 750; font-size: 1.05rem; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ad-card .meta { color: var(--muted); font-size: .9rem; margin-top: auto; }
.price {
  align-self: flex-start; background: var(--accent); color: var(--on-accent);
  font-weight: 850; padding: 4px 12px; border-radius: 999px; font-size: 1rem;
}
.price small { font-weight: 700; font-size: .78em; }
.badge {
  position: absolute; top: 12px; left: 12px; padding: 4px 12px; border-radius: 999px;
  font-size: .8rem; font-weight: 800; letter-spacing: .02em;
  background: var(--primary); color: var(--on-primary);
}
.badge-sold { background: var(--ink); color: var(--bg); }

/* ---------- Karten / Panels ---------- */
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px; }
.card + .card { margin-top: 20px; }
.row-2 > .card + .card { margin-top: 0; }

/* ---------- Formulare ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label { font-weight: 700; font-size: .95rem; }
.field .hint { color: var(--muted); font-size: .85rem; }
.input, .field input, .field select, .field textarea {
  font: inherit; color: var(--ink); background: var(--surface);
  border: 2px solid var(--line); border-radius: var(--radius-sm); padding: 11px 14px; width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 20%, transparent);
}
.field input[aria-invalid="true"] { border-color: var(--danger-ink); }
.row-2 { display: grid; gap: 16px; grid-template-columns: 1fr; }
.row-2 > *, .editor > *, .detail > *, .browse > * { min-width: 0; }
@media (min-width: 640px) { .row-2 { grid-template-columns: 1fr 1fr; } }
.check { display: flex; gap: 10px; align-items: flex-start; }
.check input { width: 20px; height: 20px; accent-color: var(--primary); margin-top: 2px; }
.field.check { flex-direction: row; align-items: center; }
.field.check label { font-weight: 600; }

/* ---------- Hinweise ---------- */
.alert { border-radius: var(--radius-sm); padding: 14px 16px; margin-bottom: 16px; font-weight: 600; }
.alert-success { background: var(--success-bg); color: var(--success-ink); }
.alert-danger  { background: var(--danger-bg);  color: var(--danger-ink); }
.alert-warn    { background: var(--warn-bg);    color: var(--warn-ink); }
.alert ul { margin: 6px 0 0; padding-left: 20px; font-weight: 500; }

/* ---------- Checkliste (Systemcheck) ---------- */
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { display: flex; gap: 12px; align-items: baseline; padding: 10px 0; border-bottom: 1px solid var(--line); }
.checklist li:last-child { border-bottom: 0; }
.checklist .st { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 900; font-size: .85rem; }
.st-ok   { background: var(--success-bg); color: var(--success-ink); }
.st-warn { background: var(--warn-bg); color: var(--warn-ink); }
.st-fail { background: var(--danger-bg); color: var(--danger-ink); }
.checklist .detail { display: inline; padding: 0; color: var(--muted); font-size: .88rem; }

/* ---------- Installer-Schritte ---------- */
.steps { display: flex; gap: 6px; list-style: none; padding: 0; margin: 0 0 24px; counter-reset: s; flex-wrap: wrap; }
.steps li { counter-increment: s; display: flex; align-items: center; gap: 8px; font-weight: 700;
  font-size: .85rem; color: var(--muted); padding: 6px 12px 6px 6px; border-radius: 999px; background: var(--surface); }
.steps li::before { content: counter(s); width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface-2); color: var(--muted); }
.steps li.done::before { content: "✓"; background: var(--success-bg); color: var(--success-ink); }
.steps li.active { color: var(--on-primary); background: var(--primary); }
.steps li.active::before { background: var(--accent); color: var(--on-accent); }

.install-wrap { max-width: 760px; margin: 0 auto; padding: 32px 16px 64px; }
.install-hero {
  border-radius: var(--radius); padding: 28px; margin-bottom: 24px; color: var(--tinte); position: relative; overflow: hidden;
  background: var(--gelb-400);
}
.install-hero::after { content: ""; position: absolute; right: -60px; top: -80px; width: 240px; height: 240px; border-radius: 50%;
  background: var(--rot-600); }
.install-hero > * { position: relative; z-index: 1; }
.install-hero p { color: var(--tinte); margin: 0; }
.actions { display: flex; gap: 12px; justify-content: space-between; flex-wrap: wrap; margin-top: 8px; }
.install-title { font-size: 1.9rem; margin: 0 0 6px; }
.install-title em { font-style: normal; color: var(--rot-800); }
.install-foot { text-align: center; margin-top: 24px; font-size: .85rem; }
.divider { border: 0; border-top: 1px solid var(--line); margin: 8px 0 20px; }
.row-tight { gap: 8px; grid-template-columns: 1fr 1fr; }
.list { padding-left: 20px; }
.list li { margin-bottom: 6px; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em;
  background: var(--surface-2); padding: 2px 6px; border-radius: 6px; word-break: break-all; }
pre.mono { padding: 12px 14px; white-space: pre-wrap; }

/* ---------- Selber stöbern (Anzeigenübersicht) ---------- */
.page-head { padding: 32px 0 8px; }
.page-head p { color: var(--muted); margin: 0; }
.browse { display: grid; gap: 24px; grid-template-columns: 1fr; padding: 16px 0 40px; }
@media (min-width: 920px) { .browse { grid-template-columns: 270px 1fr; align-items: start; } }
.filters { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 4px 20px 20px; }
@media (min-width: 920px) { .filters { position: sticky; top: 84px; max-height: calc(100vh - 100px); overflow: auto; } }
.filters:not([open]) { padding-bottom: 4px; }
.filters summary { list-style: none; cursor: pointer; font-weight: 800; font-size: 1.05rem; padding: 14px 0;
  display: flex; justify-content: space-between; align-items: center; }
.filters summary::-webkit-details-marker { display: none; }
.filters summary::after { content: "▾"; color: var(--muted); transition: transform .15s; }
.filters:not([open]) summary::after { transform: rotate(-90deg); }
.fgroup { border: 0; margin: 0; padding: 14px 0; border-top: 1px solid var(--line); min-width: 0; }
.fgroup legend { float: left; width: 100%; font-weight: 750; font-size: .92rem; padding: 0; margin-bottom: 8px; }
.fgroup legend + * { clear: both; }
.opt { display: flex; align-items: center; gap: 10px; padding: 5px 0; cursor: pointer; font-size: .95rem; }
.opt input { width: 18px; height: 18px; accent-color: var(--rot-600); margin: 0; flex: none; }
.opt .count { margin-left: auto; color: var(--muted); font-size: .82rem; font-variant-numeric: tabular-nums; }
.range { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; }
.range input, .filters .input { font: inherit; color: var(--ink); background: var(--surface); width: 100%; min-width: 0;
  border: 2px solid var(--line); border-radius: var(--radius-sm); padding: 8px 10px; }
.range input:focus, .filters .input:focus { outline: none; border-color: var(--accent); }
.filters .btn { margin-top: 14px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.toolbar .result-count { font-weight: 800; font-size: 1.05rem; }
.toolbar select { font: inherit; color: var(--ink); background: var(--surface); border: 2px solid var(--line);
  border-radius: 999px; padding: 8px 14px; }
.active-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.tag { display: inline-flex; align-items: center; gap: 6px; background: var(--gelb-100); color: var(--tinte);
  border: 0; border-radius: 999px; padding: 5px 8px 5px 12px; font: inherit; font-size: .88rem; font-weight: 700; cursor: pointer; }
.tag span { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: rgba(28,25,23,.12); }
.tag:hover span { background: rgba(28,25,23,.25); }
.tag-reset { background: transparent; color: var(--link); text-decoration: underline; padding: 5px 4px; }
.ad-grid.browse-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.empty { text-align: center; padding: 48px 16px; background: var(--surface); border-radius: var(--radius); color: var(--muted); }
.empty strong { display: block; color: var(--ink); font-size: 1.15rem; margin-bottom: 6px; }
.pager { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; margin-top: 28px; }
.pager a, .pager span { min-width: 42px; height: 42px; display: inline-grid; place-items: center; padding: 0 12px;
  border-radius: 999px; font-weight: 750; text-decoration: none; color: var(--ink); background: var(--surface); }
.pager a:hover { background: var(--ghost-hover-bg); color: var(--ink); }
.pager [aria-current="page"] { background: var(--accent); color: var(--on-accent); }
.pager .gap { background: transparent; }

/* ---------- Anbieter ---------- */
.seller-line { display: flex; align-items: center; gap: 8px; font-size: .88rem; color: var(--muted); }
.avatar { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: var(--gelb-400); color: var(--tinte); font-weight: 850; font-size: .8rem; }
.avatar-lg { width: 56px; height: 56px; font-size: 1.3rem; }
.seller-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.seller-card { display: flex; gap: 14px; align-items: center; background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px; text-decoration: none; color: var(--ink); transition: transform .15s, box-shadow .15s; }
.seller-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); color: var(--ink); }
.seller-card strong { display: block; font-size: 1.05rem; }
.seller-head { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; background: var(--surface);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; margin: 24px 0; }
.seller-head h1 { font-size: clamp(1.5rem, 4vw, 2.2rem); margin: 0; }
.seller-head .contact { margin-left: auto; display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Anzeigen-Detail ---------- */
.detail { display: grid; gap: 24px; grid-template-columns: 1fr; padding: 24px 0 40px; }
@media (min-width: 920px) { .detail { grid-template-columns: 1.5fr 1fr; align-items: start; } }
.gallery-main { aspect-ratio: 4 / 3; border-radius: var(--radius); overflow: hidden; background: var(--surface-2); }
.gallery-thumbs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 8px; }
.gallery-thumbs div { aspect-ratio: 1; border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-2); }
.detail .price { font-size: 1.4rem; padding: 6px 16px; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 16px 0; font-size: .95rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 650; }
.seller-box { border: 2px solid var(--line); border-radius: var(--radius); padding: 16px; display: grid; gap: 10px; }
.seller-box .who { display: flex; gap: 12px; align-items: center; }
.notice { font-size: .85rem; color: var(--muted); border-left: 4px solid var(--gelb-400); padding: 4px 0 4px 12px; }
.report-link { font-size: .85rem; color: var(--muted); }

/* ---------- Tabellen / Admin ---------- */
.admin-bar { background: var(--tinte); color: #FFFFFF; font-size: .85rem; font-weight: 700; padding: 8px 0; }
.admin-bar .container { display: flex; gap: 16px; align-items: center; justify-content: space-between; }
.admin-bar a { color: #FFFFFF; }
.table-wrap { overflow-x: auto; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }
.table { width: 100%; border-collapse: collapse; font-size: .93rem; min-width: 640px; }
.table th, .table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: #FAFAFA; }
.table tr:last-child td { border-bottom: 0; }
.table .actions-cell { white-space: nowrap; text-align: right; }
.btn-sm { padding: 6px 12px; font-size: .85rem; }
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .8rem; font-weight: 800; }
.pill-aktiv { background: var(--success-bg); color: var(--success-ink); }
.pill-eingeladen { background: var(--warn-bg); color: var(--warn-ink); }
.pill-gesperrt { background: var(--danger-bg); color: var(--danger-ink); }
.stats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 20px; }
.stat { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.stat b { display: block; font-size: 1.8rem; line-height: 1.1; }
.stat span { color: var(--muted); font-size: .88rem; }
.field select { appearance: auto; }

/* ---------- Inserieren (mobil zuerst) ---------- */
.nav a.nav-cta { background: var(--gelb-400); color: var(--tinte); font-weight: 800; }
.nav a.nav-cta:hover, .nav a.nav-cta[aria-current="page"] { background: var(--gelb-300); color: var(--tinte); }
.post-wrap { max-width: 720px; margin: 0 auto; padding: 20px 0 48px; }
.uploader-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.upload-btn { min-height: 56px; font-size: 1rem; text-align: center; line-height: 1.2; }
.upload-btn input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.upload-btn:focus-within { outline: 3px solid var(--rot-600); outline-offset: 2px; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-top: 14px; }
.photo { position: relative; aspect-ratio: 1; border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-2); }
.photo img { width: 100%; height: 100%; object-fit: cover; }
.photo .cover { position: absolute; top: 10px; left: 6px; background: var(--gelb-400); color: var(--tinte);
  font-size: .75rem; font-weight: 850; padding: 2px 8px; border-radius: 999px; }
.photo .size { position: absolute; top: 10px; right: 6px; background: rgba(255,255,255,.94); color: var(--tinte);
  font-size: .72rem; font-weight: 700; padding: 2px 6px; border-radius: 6px; }
.photo .bar { position: absolute; top: 0; left: 0; right: 0; height: 6px; background: rgba(0,0,0,.18); }
.photo .bar span { display: block; height: 100%; width: 0; background: var(--rot-600); transition: width .2s linear; }
.photo.is-done .bar span { background: #15803D; }
.photo .state { position: absolute; left: 6px; bottom: 46px; background: rgba(26,26,26,.82); color: #FFFFFF;
  font-size: .75rem; font-weight: 700; padding: 2px 8px; border-radius: 6px; }
.photo .tools { position: absolute; left: 0; right: 0; bottom: 0; display: flex; background: rgba(26,26,26,.78); }
.photo .tools button { flex: 1; min-height: 40px; border: 0; background: transparent; color: #FFFFFF; font: inherit;
  font-size: 1.05rem; font-weight: 800; cursor: pointer; }
.photo .tools button:disabled { opacity: .35; cursor: default; }
.photo .tools button:not(:disabled):hover { background: rgba(255,255,255,.14); }
.photo.is-error { outline: 3px solid var(--danger-ink); }
.photo-empty { display: grid; place-items: center; text-align: center; padding: 24px 12px; margin-top: 14px;
  border: 2px dashed var(--ghost-line); border-radius: var(--radius); color: var(--muted); }
.photo-count { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-top: 10px;
  font-size: .9rem; color: var(--muted); }
.publish-bar { position: sticky; bottom: 0; background: var(--surface); padding: 12px 0 16px; margin-top: 8px;
  border-top: 1px solid var(--line); }

/* ---------- Newsletter-Kasten ---------- */
.nl-box { display: grid; gap: 16px; align-items: center; background: var(--gelb-400); color: var(--tinte);
  border-radius: var(--radius); padding: 24px; }
@media (min-width: 820px) { .nl-box { grid-template-columns: 1fr 1.2fr; } }
.nl-box h2 { margin: 0 0 6px; }
.nl-box p { margin: 0; }
.nl-form { display: grid; gap: 10px; }
.nl-form .row { display: flex; gap: 8px; flex-wrap: wrap; }
.nl-form input[type=email] { flex: 1 1 220px; min-width: 0; font: inherit; padding: 12px 14px; border-radius: 999px;
  border: 2px solid var(--tinte); background: #FFFFFF; color: var(--tinte); }
.nl-form .choice { display: flex; gap: 16px; flex-wrap: wrap; font-weight: 650; font-size: .93rem; }
.nl-form .choice label { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.nl-form .choice input { accent-color: var(--tinte); width: 18px; height: 18px; }
.nl-form .small { font-size: .82rem; }

/* ---------- Admin-Reiter ---------- */
.admin-bar nav { display: flex; gap: 4px; flex-wrap: wrap; }
.admin-bar nav a { text-decoration: none; padding: 4px 10px; border-radius: 999px; }
.admin-bar nav a[aria-current="page"] { background: var(--gelb-400); color: var(--tinte); }

/* ---------- Text-Editor ---------- */
.editor { display: grid; gap: 16px; grid-template-columns: 1fr; padding: 20px 0 40px; }
@media (min-width: 1000px) { .editor { grid-template-columns: 250px 1fr 1fr; align-items: start; } }
.text-list { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px; }
.text-list h3 { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 10px 8px 6px; }
.text-list a { display: block; padding: 8px 10px; border-radius: var(--radius-sm); text-decoration: none; color: var(--ink); font-weight: 600; font-size: .93rem; }
.text-list a:hover { background: var(--surface-2); color: var(--ink); }
.text-list a[aria-current="page"] { background: var(--gelb-400); color: var(--tinte); }
.text-list .todo { color: var(--rot-700); font-weight: 800; }
.editor textarea { min-height: 360px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9rem; line-height: 1.5; }
.ph-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ph-chips button { font: inherit; font-size: .82rem; font-family: ui-monospace, Menlo, monospace; border: 1px solid var(--ghost-line);
  background: var(--gelb-50); color: var(--tinte); border-radius: 6px; padding: 2px 8px; cursor: pointer; }
.md { line-height: 1.6; }
.md h2 { font-size: 1.4rem; margin-top: 0; } .md h3 { font-size: 1.1rem; margin: 1.2em 0 .4em; }
.md p { margin: 0 0 .9em; } .md ul { padding-left: 20px; }
.md .gap { background: var(--gelb-100); border-radius: 4px; padding: 0 3px; font-weight: 700; }
.rev-list { list-style: none; padding: 0; margin: 8px 0 0; font-size: .88rem; }
.rev-list li { display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.mail-preview { border: 1px solid var(--line); border-radius: var(--radius-sm); background: #FFFFFF; overflow: hidden; }
.mail-preview .mail-head { background: #F7F7F7; padding: 10px 14px; font-size: .85rem; color: var(--muted); border-bottom: 1px solid var(--line); }
.mail-preview .mail-body { padding: 16px; }
.mail-ad { display: grid; grid-template-columns: 72px 1fr; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.mail-ad .thumb { width: 72px; height: 72px; border-radius: 8px; overflow: hidden; }
.legal-page { max-width: 780px; margin: 0 auto; padding: 32px 0 48px; }

/* ---------- Konto / Admin (Phase 1) ---------- */
.auth-wrap { max-width: 480px; margin: 0 auto; padding: 32px 0 48px; }
.page-pad { padding-top: 28px; padding-bottom: 48px; }
.h-page { font-size: clamp(1.6rem, 5vw, 2.2rem); margin-bottom: 18px; }
.h-card { font-size: 1.15rem; margin-bottom: 12px; }
.mt-s { margin-top: 12px; } .mt-m { margin-top: 20px; }
.center { text-align: center; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.nav-form { display: inline; margin: 0; }
.code-input { font-size: 1.6rem !important; letter-spacing: .3em; text-align: center; font-variant-numeric: tabular-nums; }
.qr { display: block; width: 220px; max-width: 100%; margin: 12px 0; padding: 10px; background: #FFFFFF;
  border: 2px solid var(--line); border-radius: var(--radius-sm); }
.qr svg { display: block; width: 100%; height: auto; }
.secret-key { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 1.05rem; letter-spacing: .08em;
  background: var(--surface-2); padding: 8px 12px; border-radius: 8px; margin: 4px 0 12px; word-break: break-all; }
.steps-list li { margin-bottom: 14px; }
.codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 24px; padding-left: 24px; margin: 16px 0; }
.codes code { font-size: 1.05rem; letter-spacing: .05em; }
.table-wrap.flat { box-shadow: none; }
.table.compact { min-width: 0; font-size: .88rem; }
.table.compact th, .table.compact td { padding: 8px 10px; }
.hero-small { border-radius: var(--radius); padding: 40px 0; }
.stats { margin-bottom: 20px; }
.card + .stats, .alert + .stats { margin-top: 16px; }
@media print {
  .site-header, .site-footer, .btn-row, .alert { display: none !important; }
  .card { box-shadow: none; }
}

.rules { border: 2px solid var(--line); border-radius: var(--radius-sm); padding: 10px 14px; margin: 4px 0 16px; }
.rules summary { cursor: pointer; font-weight: 700; }
.rules .md { margin-top: 10px; font-size: .95rem; }
.filter-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.filter-row .input { flex: 1 1 200px; width: auto; }
.filter-row select.input { flex: 0 1 160px; }
.seller-line.ink { color: var(--ink); }
.small-note { display: block; font-size: .8rem; margin: 2px 0 0 34px; }
.actions-cell .nav-form { margin-left: 4px; }

/* ---------- Phase 3: Anzeigenverwaltung ---------- */
.pill-reserviert { background: var(--gelb-100); color: var(--warn-ink); }
.pill-verkauft { background: #E8E8E8; color: var(--tinte); }
.pill-archiv { background: #F2F2F2; color: var(--muted); }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 16px; }
.tabs a { padding: 8px 14px; border-radius: 999px; text-decoration: none; color: var(--ink); font-weight: 700; border: 1px solid var(--ghost-line); }
.tabs a:hover { background: var(--surface-2); }
.tabs a[aria-current="page"] { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.tabs .count { font-variant-numeric: tabular-nums; opacity: .8; margin-left: 2px; }
.ad-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ad-row { display: grid; grid-template-columns: 56px 1fr; gap: 6px 14px; align-items: center; padding: 12px 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.ad-row-thumb { width: 56px; height: 56px; border-radius: var(--radius-sm); background: var(--surface-2); display: grid; place-items: center; font-size: 1.4rem; }
.ad-row-main { min-width: 0; }
.ad-row-title { font-weight: 800; color: var(--ink); text-decoration: none; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ad-row-title:hover { color: var(--link); }
.ad-row-meta { font-size: .88rem; color: var(--muted); margin-top: 2px; }
.ad-row-meta .pill { margin-right: 4px; }
.title-row { display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap; margin-bottom: 16px; }
.title-row h1 { margin: 0; overflow-wrap: anywhere; }
.price-sm { font-weight: 800; color: var(--accent-text); }
.ad-row-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; }
@media (min-width: 720px) {
  .ad-row { grid-template-columns: 56px 1fr auto; }
  .ad-row-actions { grid-column: auto; justify-content: flex-end; }
}
.input[disabled], .field input[disabled] { background: #F4F4F4; color: var(--muted); }
.cat-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.cat-row { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; }
.cat-row.child { margin-left: 28px; border-left: 4px solid var(--gelb-400); }
.cat-row.inactive { background: #FAFAFA; }
.cat-row.inactive .input { color: var(--muted); }
.cat-form { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; }
.cat-form .input { flex: 1 1 180px; width: auto; }
.cat-form select.input { flex: 0 1 190px; }
.cat-form .input.sort { flex: 0 0 84px; width: 84px; min-width: 0; }
.cat-form .input { min-width: 0; }
.cat-form .field.check { margin: 0; }
.cat-form .btn-row { margin: 0 0 0 auto; gap: 6px; }
@media (max-width: 560px) { .cat-row.child { margin-left: 12px; } .cat-form .btn-row { margin-left: 0; } }

/* ---------- Footer ---------- */
.site-footer { margin-top: 48px; padding: 32px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: .92rem; }
.site-footer .container { display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; }
.site-footer a { color: var(--muted); }

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