/* ==========================================================================
   Auktionshaus - Designsystem
   Eine Datei, weil das Projekt eine ueberschaubare Zahl an Bausteinen hat.
   Reihenfolge: Tokens - Grundlagen - Layout - Bausteine - Seiten - Mobil.
   ========================================================================== */

/* --- Tokens --------------------------------------------------------------- */
:root {
  --page: #f5f6f8;
  --surface: #ffffff;
  --surface-muted: #eef1f5;
  --ink: #16191f;
  --ink-soft: #545c69;
  --ink-faint: #7b8493;
  --line: #e0e4ea;
  --line-strong: #c9cfd8;

  --brand: #17365c;
  --brand-hover: #0f2743;
  --brand-soft: #e8eef6;
  --accent: #b0480f;
  --accent-soft: #fbeee6;
  --success: #12653f;
  --success-soft: #e5f3ec;
  --danger: #a52218;
  --danger-soft: #fbeae8;

  --radius-s: 8px;
  --radius-m: 12px;
  --radius-l: 16px;

  --shadow-s: 0 1px 2px rgba(16, 24, 40, 0.06);
  --shadow-m: 0 2px 10px rgba(16, 24, 40, 0.07);

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;

  --content-width: 1180px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: #14171c;
    --surface: #1b1f26;
    --surface-muted: #232830;
    --ink: #eef1f5;
    --ink-soft: #b3bbc7;
    --ink-faint: #8b95a3;
    --line: #2d333d;
    --line-strong: #3d4550;

    --brand: #7fb0e8;
    --brand-hover: #a3c7f2;
    --brand-soft: #1e2a3a;
    --accent: #eb9a63;
    --accent-soft: #2e2119;
    --success: #6cc79b;
    --success-soft: #17281f;
    --danger: #f0938a;
    --danger-soft: #2b1a18;

    --shadow-s: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-m: 0 2px 10px rgba(0, 0, 0, 0.45);
  }
}

/* --- Grundlagen ----------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--page);
  -webkit-text-size-adjust: 100%;
}

h1,
h2,
h3,
h4 {
  margin: 0 0 var(--space-3);
  line-height: 1.25;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.3rem); }
h2 { font-size: clamp(1.25rem, 1.05rem + 0.8vw, 1.6rem); }
h3 { font-size: 1.1rem; }

p { margin: 0 0 var(--space-3); }

a {
  color: var(--brand);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

a:hover { color: var(--brand-hover); }

img { max-width: 100%; display: block; }

:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--surface);
  color: var(--ink);
  padding: var(--space-3);
  z-index: 100;
}

.skip-link:focus {
  left: var(--space-3);
  top: var(--space-3);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* --- Layout --------------------------------------------------------------- */
.wrap {
  width: 100%;
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 var(--space-4);
}

main {
  display: block;
  padding: var(--space-5) 0 var(--space-7);
  min-height: 60vh;
}

.stack > * + * { margin-top: var(--space-4); }

.page-head {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: end;
  justify-content: space-between;
  margin-bottom: var(--space-5);
}

.page-head p { color: var(--ink-soft); margin: 0; }

/* --- Kopfzeile ------------------------------------------------------------ */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 30;
}

.header-row {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  min-height: 64px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}

.logo-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 0.9rem;
  font-weight: 700;
}

@media (prefers-color-scheme: dark) {
  .logo-mark { color: #12181f; }
}

.header-nav {
  display: flex;
  gap: var(--space-1);
  flex: 1;
}

.header-nav a {
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-s);
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.94rem;
  white-space: nowrap;
}

.header-nav a:hover { background: var(--surface-muted); color: var(--ink); }
.header-nav a[aria-current="page"] { color: var(--ink); font-weight: 600; }

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-left: auto;
}

.header-search {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.header-search input {
  width: 200px;
}

.icon-link {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-s);
  color: var(--ink-soft);
  text-decoration: none;
}

.icon-link:hover { background: var(--surface-muted); color: var(--ink); }

.badge-count {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  font-size: 0.7rem;
  line-height: 18px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

@media (prefers-color-scheme: dark) {
  .badge-count { color: #1b1005; }
}

/* --- Buttons -------------------------------------------------------------- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: 0 var(--space-4);
  border: 1px solid transparent;
  border-radius: var(--radius-s);
  background: var(--surface-muted);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.button:hover { background: var(--line); color: var(--ink); }

.button--primary {
  background: var(--brand);
  color: #fff;
}

.button--primary:hover { background: var(--brand-hover); color: #fff; }

.button--accent {
  background: var(--accent);
  color: #fff;
}

.button--accent:hover { filter: brightness(0.92); color: #fff; }

@media (prefers-color-scheme: dark) {
  .button--primary,
  .button--primary:hover,
  .button--accent,
  .button--accent:hover { color: #12181f; }
}

.button--ghost {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--ink);
}

.button--ghost:hover { background: var(--surface-muted); }

.button--danger {
  background: transparent;
  border-color: var(--danger);
  color: var(--danger);
}

.button--danger:hover { background: var(--danger-soft); color: var(--danger); }

.button--block { width: 100%; }
.button--large { min-height: 52px; font-size: 1.05rem; }
.button--small { min-height: 36px; padding: 0 var(--space-3); font-size: 0.9rem; }

.button[disabled],
.button[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Aktionen, die ein Formular brauchen (z. B. Abmelden), sich aber in eine
   Linkliste einfuegen sollen. */
.link-button {
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.link-button:hover { color: var(--brand-hover); }

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

/* --- Formulare ------------------------------------------------------------ */
.field { margin-bottom: var(--space-4); }

.field label,
.field legend {
  display: block;
  font-weight: 600;
  font-size: 0.92rem;
  margin-bottom: var(--space-1);
}

.field-hint {
  display: block;
  color: var(--ink-soft);
  font-size: 0.85rem;
  margin-bottom: var(--space-2);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="number"],
input[type="tel"],
input[type="datetime-local"],
input[type="date"],
select,
textarea {
  width: 100%;
  min-height: 44px;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-s);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}

textarea { min-height: 140px; resize: vertical; }

input::placeholder,
textarea::placeholder { color: var(--ink-faint); }

input[aria-invalid="true"],
select[aria-invalid="true"],
textarea[aria-invalid="true"] {
  border-color: var(--danger);
}

.field-error {
  display: block;
  color: var(--danger);
  font-size: 0.87rem;
  margin-top: var(--space-1);
  font-weight: 600;
}

fieldset {
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  padding: var(--space-4);
  margin: 0 0 var(--space-4);
}

.choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.choice {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-s);
  background: var(--surface);
  cursor: pointer;
  font-size: 0.94rem;
}

.choice input { margin: 0; }
.choice:has(input:checked) {
  border-color: var(--brand);
  background: var(--brand-soft);
  font-weight: 600;
}

.checkbox-line {
  display: flex;
  gap: var(--space-3);
  align-items: start;
  font-size: 0.94rem;
}

.checkbox-line input { margin-top: 4px; width: 18px; height: 18px; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0 var(--space-4);
}

/* --- Karten und Flaechen -------------------------------------------------- */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  padding: var(--space-5);
  box-shadow: var(--shadow-s);
}

.panel--tight { padding: var(--space-4); }

.panel__title {
  margin: 0 0 var(--space-4);
  font-size: 1.05rem;
}

.form-narrow {
  max-width: 520px;
  margin: 0 auto;
}

.notice {
  border: 1px solid var(--line);
  border-left: 4px solid var(--ink-faint);
  border-radius: var(--radius-s);
  padding: var(--space-3) var(--space-4);
  background: var(--surface);
  margin-bottom: var(--space-4);
}

.notice--info { border-left-color: var(--brand); background: var(--brand-soft); }
.notice--success { border-left-color: var(--success); background: var(--success-soft); }
.notice--warning { border-left-color: var(--accent); background: var(--accent-soft); }
.notice--error { border-left-color: var(--danger); background: var(--danger-soft); }
.notice p:last-child { margin-bottom: 0; }

.tag {
  display: inline-block;
  padding: 2px var(--space-2);
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 600;
}

.tag--live { background: var(--success-soft); color: var(--success); }
.tag--soon { background: var(--accent-soft); color: var(--accent); }
.tag--ended { background: var(--surface-muted); color: var(--ink-faint); }

.empty-state {
  text-align: center;
  padding: var(--space-7) var(--space-4);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-m);
  color: var(--ink-soft);
  background: var(--surface);
}

.empty-state h2 { color: var(--ink); }

/* --- Startseite ----------------------------------------------------------- */
.hero {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: var(--space-6) 0;
}

.hero h1 { margin-bottom: var(--space-2); }

.hero p.hero-sub {
  color: var(--ink-soft);
  font-size: 1.05rem;
  max-width: 60ch;
  margin-bottom: var(--space-5);
}

.hero-search {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-bottom: var(--space-3);
}

.hero-search input[type="search"] {
  flex: 1 1 320px;
  min-height: 52px;
  font-size: 1.02rem;
}

.hero-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--space-2);
}

.hero-filters label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-soft);
  display: block;
  margin-bottom: 2px;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  margin: var(--space-6) 0 var(--space-4);
}

.section-head h2 { margin: 0; }

/* --- Auktionsliste -------------------------------------------------------- */
.auction-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--space-4);
}

.auction-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  overflow: hidden;
  box-shadow: var(--shadow-s);
}

.auction-card:hover { box-shadow: var(--shadow-m); }

.auction-card__media {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--surface-muted);
}

.auction-card__media a {
  display: block;
  height: 100%;
  text-decoration: none;
}

.auction-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.auction-card__placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--ink-faint);
  font-size: 0.85rem;
}

.watch-toggle {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--ink-soft);
  padding: 0;
}

.watch-toggle[aria-pressed="true"] { color: var(--accent); border-color: var(--accent); }

.auction-card__body {
  padding: var(--space-3) var(--space-4) var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  flex: 1;
}

.auction-card__title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
  line-height: 1.35;
}

.auction-card__title a { color: var(--ink); text-decoration: none; }
.auction-card__title a:hover { text-decoration: underline; }

.price {
  font-size: 1.3rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.price-label { font-size: 0.8rem; color: var(--ink-soft); }

.meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-3);
  color: var(--ink-soft);
  font-size: 0.85rem;
}

.countdown {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.countdown[data-urgent="true"] { color: var(--accent); }

.card-actions { margin-top: auto; padding-top: var(--space-3); }

.result-bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

.result-bar__count { color: var(--ink-soft); font-size: 0.92rem; }

.layout-with-side {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: var(--space-5);
  align-items: start;
}

.filter-panel { position: sticky; top: 80px; }

.pagination {
  display: flex;
  gap: var(--space-2);
  justify-content: center;
  margin-top: var(--space-6);
  flex-wrap: wrap;
}

.pagination a,
.pagination span {
  min-width: 42px;
  min-height: 42px;
  display: inline-grid;
  place-items: center;
  padding: 0 var(--space-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-s);
  background: var(--surface);
  text-decoration: none;
  color: var(--ink);
}

.pagination [aria-current="page"] {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  font-weight: 700;
}

/* --- Detailseite ---------------------------------------------------------- */
.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.85fr);
  gap: var(--space-5);
  align-items: start;
}

.gallery__main {
  aspect-ratio: 4 / 3;
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  overflow: hidden;
}

.gallery__main img { width: 100%; height: 100%; object-fit: contain; background: var(--surface-muted); }

.gallery__thumbs {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-2);
  overflow-x: auto;
  padding-bottom: var(--space-1);
}

.gallery__thumbs button {
  flex: 0 0 84px;
  height: 64px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: var(--radius-s);
  overflow: hidden;
  background: var(--surface-muted);
  cursor: pointer;
}

.gallery__thumbs button[aria-current="true"] { border-color: var(--brand); }
.gallery__thumbs img { width: 100%; height: 100%; object-fit: cover; }

.bid-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  padding: var(--space-5);
  box-shadow: var(--shadow-m);
  position: sticky;
  top: 80px;
}

.bid-box .price { font-size: 2rem; display: block; }

.bid-box__facts {
  margin: var(--space-4) 0;
  border-top: 1px solid var(--line);
  padding-top: var(--space-3);
}

.fact-row {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-1) 0;
  font-size: 0.94rem;
}

.fact-row dt { color: var(--ink-soft); margin: 0; }
.fact-row dd { margin: 0; font-weight: 600; text-align: right; }

.seller-box {
  display: flex;
  gap: var(--space-3);
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  padding: var(--space-3);
  background: var(--surface);
}

/* Die ganze Box ist ein Link. Unterstrichen wird nur der Name, sonst wirkt
   jede Kennzahl wie ein eigener Link. */
a.seller-box,
a.seller-box:hover {
  color: inherit;
  text-decoration: none;
}

a.seller-box:hover strong { text-decoration: underline; }

.avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  display: grid;
  place-items: center;
  font-weight: 700;
  overflow: hidden;
  flex: 0 0 auto;
}

.avatar img { width: 100%; height: 100%; object-fit: cover; }

.stars { color: var(--accent); letter-spacing: 1px; }

.description {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.bid-history {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.bid-history th,
.bid-history td {
  text-align: left;
  padding: var(--space-2);
  border-bottom: 1px solid var(--line);
}

.bid-history td:last-child,
.bid-history th:last-child { text-align: right; font-variant-numeric: tabular-nums; }

.table-scroll { overflow-x: auto; }

/* --- Dialog (Gebot) ------------------------------------------------------- */
dialog.modal {
  border: none;
  border-radius: var(--radius-l);
  padding: 0;
  width: min(460px, calc(100vw - 32px));
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 12px 40px rgba(16, 24, 40, 0.24);
}

dialog.modal::backdrop { background: rgba(12, 16, 22, 0.55); }

.modal__body { padding: var(--space-5); }
.modal__title { margin-bottom: var(--space-3); }

/* --- Assistent (Auktion erstellen) --------------------------------------- */
.steps {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  list-style: none;
  padding: 0;
  margin: 0 0 var(--space-5);
  counter-reset: step;
}

.steps li {
  flex: 1 1 130px;
  padding: var(--space-2) var(--space-3);
  border-top: 3px solid var(--line);
  color: var(--ink-faint);
  font-size: 0.88rem;
  font-weight: 600;
}

.steps li[data-state="done"] { border-top-color: var(--success); color: var(--ink-soft); }
.steps li[data-state="current"] { border-top-color: var(--brand); color: var(--ink); }

.dropzone {
  border: 2px dashed var(--line-strong);
  border-radius: var(--radius-m);
  padding: var(--space-6) var(--space-4);
  text-align: center;
  background: var(--surface);
  color: var(--ink-soft);
}

.dropzone[data-dragover="true"] { border-color: var(--brand); background: var(--brand-soft); }

.image-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: var(--space-3);
  list-style: none;
  padding: 0;
  margin: var(--space-4) 0 0;
}

.image-list li {
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  overflow: hidden;
  background: var(--surface);
}

.image-list img { aspect-ratio: 1; object-fit: cover; width: 100%; }

.image-list__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-2);
  font-size: 0.78rem;
  color: var(--ink-soft);
}

/* --- Fortschritt (Kauf/Verkauf) ------------------------------------------ */
.progress-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.progress-list li {
  display: flex;
  gap: var(--space-3);
  align-items: start;
  padding: var(--space-2) 0;
  color: var(--ink-faint);
}

.progress-list li[data-state="done"] { color: var(--ink); }
.progress-list li[data-state="current"] { color: var(--ink); font-weight: 600; }

.progress-list .marker {
  flex: 0 0 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
  display: grid;
  place-items: center;
  font-size: 0.7rem;
  margin-top: 2px;
}

.progress-list li[data-state="done"] .marker {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}

.progress-list li[data-state="current"] .marker {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

/* --- Dashboard ------------------------------------------------------------ */
.tab-nav {
  display: flex;
  gap: var(--space-1);
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  margin-bottom: var(--space-4);
}

.tab-nav a {
  padding: var(--space-3);
  color: var(--ink-soft);
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  font-size: 0.95rem;
}

.tab-nav a[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--brand);
  font-weight: 600;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--space-3);
}

.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  padding: var(--space-4);
}

.stat__value {
  font-size: 1.6rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.stat__label { color: var(--ink-soft); font-size: 0.87rem; }

.list-rows { display: grid; gap: var(--space-3); }

.row-card {
  display: flex;
  gap: var(--space-4);
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  padding: var(--space-3);
}

.row-card__thumb {
  flex: 0 0 84px;
  height: 64px;
  border-radius: var(--radius-s);
  overflow: hidden;
  background: var(--surface-muted);
}

.row-card__thumb img { width: 100%; height: 100%; object-fit: cover; }
.row-card__body { flex: 1; min-width: 0; }
.row-card__body h3 { margin: 0 0 2px; font-size: 1rem; }
.row-card__side { text-align: right; }

/* --- Kategorien ----------------------------------------------------------- */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: var(--space-4);
}

.category-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  padding: var(--space-4);
}

.category-card h2 { font-size: 1.05rem; margin-bottom: var(--space-1); }
.category-card h2 a { color: var(--ink); text-decoration: none; }
.category-card h2 a:hover { text-decoration: underline; }

.category-card ul {
  list-style: none;
  margin: var(--space-2) 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-2);
  font-size: 0.88rem;
}

/* --- Nachrichten ---------------------------------------------------------- */
.thread {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.bubble {
  max-width: 78%;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-m);
  background: var(--surface-muted);
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.bubble--own {
  align-self: flex-end;
  background: var(--brand-soft);
}

.bubble__meta {
  display: block;
  font-size: 0.78rem;
  color: var(--ink-soft);
  margin-top: var(--space-1);
}

/* --- Fusszeile ------------------------------------------------------------ */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding: var(--space-6) 0;
  margin-top: var(--space-7);
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.footer-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-5);
}

.footer-cols h2 { font-size: 0.92rem; color: var(--ink); margin-bottom: var(--space-2); }

.footer-cols ul { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--space-1); }

.footer-note {
  margin-top: var(--space-5);
  padding-top: var(--space-4);
  border-top: 1px solid var(--line);
  font-size: 0.85rem;
}

/* --- Cookie-Hinweis ------------------------------------------------------- */
.cookie-bar {
  position: fixed;
  left: var(--space-3);
  right: var(--space-3);
  bottom: var(--space-3);
  z-index: 60;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-m);
  padding: var(--space-4);
  max-width: 640px;
  margin: 0 auto;
}

/* --- Mobile Navigation ---------------------------------------------------- */
.bottom-nav { display: none; }

@media (max-width: 900px) {
  .layout-with-side { grid-template-columns: 1fr; }
  .filter-panel { position: static; }
  .detail-layout { grid-template-columns: 1fr; }
  .bid-box { position: static; }
  .header-nav,
  .header-search { display: none; }
}

@media (max-width: 620px) {
  main { padding-bottom: 88px; }

  /* "Auktion erstellen" und die Beobachtungsliste stehen in der unteren Leiste.
     Im Kopf wuerden sie nur Platz kosten und "Anmelden" abschneiden. */
  .header-actions > .button--primary,
  .header-actions > a[href="/konto/beobachtungsliste"] { display: none; }

  .bottom-nav {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 40;
    background: var(--surface);
    border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom);
  }

  .bottom-nav a {
    display: grid;
    justify-items: center;
    gap: 2px;
    padding: var(--space-2) 0;
    font-size: 0.7rem;
    color: var(--ink-soft);
    text-decoration: none;
    min-height: 56px;
  }

  .bottom-nav a[aria-current="page"] { color: var(--brand); font-weight: 600; }

  .cookie-bar { bottom: 74px; }

  .auction-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: var(--space-3); }
  .panel { padding: var(--space-4); }
  .row-card { flex-wrap: wrap; }
  .row-card__side { text-align: left; }
}

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

@media print {
  .site-header, .site-footer, .bottom-nav, .cookie-bar { display: none; }
}

/* --- Hilfsklassen --------------------------------------------------------- */
/* Bewusst klein gehalten und nur fuer Abstaende, Breiten und die wenigen
   Groessenvarianten, die sonst als style-Attribut im Markup landen wuerden.
   Inline-Styles sind nicht moeglich, weil die Content Security Policy
   style-src auf 'self' begrenzt - und das soll so bleiben. */
.mt-0 { margin-top: 0; }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-5 { margin-top: var(--space-5); }
.mb-1 { margin-bottom: var(--space-1); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-5 { margin-bottom: var(--space-5); }
.m-0 { margin: 0; }

.text-center { text-align: center; }
.measure { max-width: 75ch; }
.grow { flex: 1; }

.row-end { justify-content: flex-end; }
.row-center { justify-content: center; }

.heading--compact { font-size: 1.3rem; }
.price--compact { font-size: 1.1rem; }

.avatar--small { width: 32px; height: 32px; font-size: 0.8rem; }
.avatar--medium { width: 64px; height: 64px; font-size: 1.2rem; }
.avatar--large { width: 96px; height: 96px; font-size: 1.6rem; margin: 0 auto; }

.plain-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: var(--space-3);
}

.plain-list--tight { gap: var(--space-2); }

.icon-button-row { display: flex; gap: 2px; }

.seller-box--plain { border: none; padding: 0; }
