/* Inter font feature settings */
body { font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11'; }

/* ─── Theme Transitions ─────────────────────────────────────────────────────── */
/* Only transition color-related properties on all elements — NOT transform/opacity
   to avoid sluggishness and conflicts with animation-heavy elements */
html, body, *:not(.theme-icon):not(.btn-share):not(.district-pill):not(.animate-spin) {
  transition: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease !important;
}
.animate-spin { transition: none !important; }
.btn-share { transition: color 0.15s ease, transform 0.15s ease !important; }
.district-pill {
  transition: background-color 0.15s ease, border-color 0.15s ease,
              color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease !important;
}

/* ─── Theme Toggle Sun/Moon Animation ───────────────────────────────────────── */
.theme-toggle-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
}
.theme-icon {
  position: absolute;
  transition: transform 0.4s ease-in-out, opacity 0.4s ease-in-out;
  line-height: 1;
}
/* Dark mode: sun visible, moon hidden — applies to ALL .theme-toggle-wrap buttons */
html.dark .theme-toggle-wrap .ph-sun    { transform: rotate(0deg)   scale(1);   opacity: 1; }
html.dark .theme-toggle-wrap .ph-moon   { transform: rotate(-90deg) scale(0.5); opacity: 0; }
/* Light mode: moon visible, sun hidden */
html:not(.dark) .theme-toggle-wrap .ph-sun  { transform: rotate(90deg) scale(0.5); opacity: 0; }
html:not(.dark) .theme-toggle-wrap .ph-moon { transform: rotate(0deg)  scale(1);   opacity: 1; }

/* ─── Scrollbar ──────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #94a3b8; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #64748b; }
html.dark ::-webkit-scrollbar-thumb { background: #334155; }
html.dark ::-webkit-scrollbar-thumb:hover { background: #475569; }

/* ─── Table Row Interactions ─────────────────────────────────────────────────── */
tbody tr { transition: background-color 0.15s ease !important; }
tbody tr.listing-row { cursor: pointer; }
tbody tr.listing-row:hover { background: rgba(99, 102, 241, 0.07) !important; }
tbody tr.listing-row:active { background: rgba(99, 102, 241, 0.12) !important; }

/* Light mode table hover */
html:not(.dark) tbody tr.listing-row:hover { background: rgba(99, 102, 241, 0.06) !important; }

/* Gone listings */
tbody tr.listing-gone { opacity: 0.4; cursor: default; }
tbody tr.listing-gone:hover { background: transparent !important; }

/* Unavailable listings — red background */
tbody tr.listing-unavailable { cursor: default; }
html:not(.dark) tbody tr.listing-unavailable {
  background-color: rgba(254, 226, 226, 0.7) !important;
}
html.dark tbody tr.listing-unavailable {
  background-color: rgba(127, 29, 29, 0.18) !important;
}
tbody tr.listing-unavailable:hover { filter: brightness(0.97); }
tbody tr.listing-unavailable .listing-strikethrough {
  text-decoration: line-through;
  text-decoration-color: rgba(148, 163, 184, 0.6);
}

/* New listing glow */
@keyframes newGlow {
  0%, 100% { box-shadow: inset 3px 0 0 #6366f1; }
  50% { box-shadow: inset 3px 0 0 #818cf8; }
}
tbody tr.listing-new { animation: newGlow 2s ease-in-out 3; box-shadow: inset 3px 0 0 #6366f1; }

/* ─── Scan Active State ───────────────────────────────────────────────────────── */
@keyframes scanPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}
.scan-active { animation: scanPulse 1.5s ease-in-out infinite; }

/* ─── Form Elements ──────────────────────────────────────────────────────────── */
html.dark select option { background: #1e293b; color: white; }
html:not(.dark) select option { background: #f8fafc; color: #0f172a; }
input[type="number"]::-webkit-inner-spin-button { opacity: 0.3; }

/* Light mode inputs/selects */
html:not(.dark) input, html:not(.dark) select {
  color: #0f172a;
  background-color: #f8fafc;
}
html:not(.dark) input::placeholder { color: #64748b; }

/* ─── District Pills ─────────────────────────────────────────────────────────── */
.district-pill {
  transition: all 0.15s ease !important;
  user-select: none;
  -webkit-user-select: none;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  animation: badgeIn 0.15s ease-out;
}
.district-pill:hover { transform: translateY(-1px); }
.district-pill.active {
  background: linear-gradient(135deg, #4f46e5, #6366f1);
  color: white;
  border-color: #6366f1;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}
.district-pill .badge-remove {
  opacity: 0.6;
  transition: opacity 0.1s ease !important;
  line-height: 1;
  color: rgba(255,255,255,0.75);
  display: flex;
  align-items: center;
}
/* X-icon only visible on active (selected) badges — no reserved space for inactive */
.district-pill:not(.active) .badge-remove { display: none; }
.district-pill.active .badge-remove { display: inline-flex; opacity: 1; }
.district-pill.active:hover .badge-remove { opacity: 1; }
.district-pill.active .badge-remove:hover { color: white; opacity: 1; }

@keyframes badgeIn {
  from { opacity: 0; transform: scale(0.85) translateY(2px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* D1: Discovery Age Chips ("Neu entdeckt" filter) */
.age-chip {
  transition: all 0.15s ease;
  cursor: pointer;
  background: transparent;
}
.age-chip:hover {
  transform: translateY(-1px);
}
.age-chip.active {
  background: linear-gradient(135deg, #4f46e5, #6366f1);
  color: white;
  border-color: #6366f1 !important;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

/* Age badge on listing rows — shows "vor 3h / vor 2 Tagen" */
.age-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: rgba(99, 102, 241, 0.1);
  color: #4f46e5;
}
html.dark .age-badge {
  background: rgba(99, 102, 241, 0.18);
  color: #a5b4fc;
}
.age-badge.fresh {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
}
html.dark .age-badge.fresh {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
}

/* Dual-Range Slider */
.range-slider-wrap {
  position: relative;
  height: 22px;
  display: flex;
  align-items: center;
}
.range-track {
  position: absolute;
  width: 100%;
  height: 4px;
  border-radius: 2px;
  pointer-events: none;
}
html.dark .range-track { background: rgba(51, 65, 85, 0.9); }
html:not(.dark) .range-track { background: rgba(203, 213, 225, 0.9); }

.range-fill {
  position: absolute;
  height: 100%;
  background: linear-gradient(90deg, #4f46e5, #6366f1);
  border-radius: 2px;
  pointer-events: none;
}
.range-thumb {
  position: absolute;
  width: 100%;
  height: 4px;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  pointer-events: none;
  outline: none;
  border: none;
  padding: 0;
}
.range-thumb::-webkit-slider-runnable-track {
  background: transparent;
  height: 4px;
}
.range-thumb::-webkit-slider-thumb {
  -webkit-appearance: none;
  pointer-events: auto;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #6366f1;
  border: 2px solid #818cf8;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease !important;
  margin-top: -6px;
}
.range-thumb::-webkit-slider-thumb:hover {
  transform: scale(1.25);
  box-shadow: 0 0 0 5px rgba(99, 102, 241, 0.2);
}
.range-thumb:active::-webkit-slider-thumb {
  transform: scale(1.15);
  box-shadow: 0 0 0 6px rgba(99, 102, 241, 0.25);
}
.range-thumb::-moz-range-track {
  background: transparent;
  height: 4px;
}
.range-thumb::-moz-range-thumb {
  pointer-events: auto;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #6366f1;
  border: 2px solid #818cf8;
  cursor: pointer;
  box-sizing: border-box;
  transition: box-shadow 0.1s ease !important;
}
.range-thumb::-moz-range-thumb:hover {
  box-shadow: 0 0 0 5px rgba(99, 102, 241, 0.2);
}

/* Login overlay — ensure vertical centering on mobile (dynamic viewport height) */
#loginOverlay {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100svh;
}

/* Active filter chips */
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px 3px 10px;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 500;
  animation: badgeIn 0.15s ease-out;
}
html.dark .filter-chip {
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.25);
  color: #a5b4fc;
}
html:not(.dark) .filter-chip {
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #4338ca;
}
html.dark .filter-chip:hover { background: rgba(99, 102, 241, 0.18); }
html:not(.dark) .filter-chip:hover { background: rgba(99, 102, 241, 0.14); }

.filter-chip-remove {
  display: flex;
  align-items: center;
  transition: color 0.1s ease !important;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  line-height: 1;
}
html.dark .filter-chip-remove { color: rgba(165, 180, 252, 0.55); }
html:not(.dark) .filter-chip-remove { color: rgba(67, 56, 202, 0.5); }
html.dark .filter-chip-remove:hover { color: #c7d2fe; }
html:not(.dark) .filter-chip-remove:hover { color: #4338ca; }

/* Light mode inactive pills */
html:not(.dark) .district-pill:not(.active) {
  background-color: #f1f5f9;
  color: #475569;
  border-color: #cbd5e1;
}
html:not(.dark) .district-pill:not(.active):hover {
  border-color: rgba(99, 102, 241, 0.5);
  color: #1e293b;
}

/* Seen listing — left border + subtle background */
tbody tr.listing-seen:not(.listing-unavailable) {
  opacity: 0.82;
  box-shadow: inset 3px 0 0 #94a3b8; /* slate-400 */
}
html:not(.dark) tbody tr.listing-seen:not(.listing-unavailable) {
  background-color: rgba(229, 231, 235, 0.9) !important; /* gray-200 — darker */
}
html.dark tbody tr.listing-seen:not(.listing-unavailable) {
  background-color: rgba(30, 41, 59, 0.45) !important; /* slate-800/45 — darker */
}
tbody tr.listing-seen:hover { opacity: 1 !important; }

/* Seen badge shown inside card on mobile */
.seen-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.65rem;
  font-weight: 500;
  opacity: 0.65;
}
html.dark .seen-badge { color: #94a3b8; }
html:not(.dark) .seen-badge { color: #64748b; }

/* Teilen-Button (ersetzt den früheren Favoriten-Herz-Button) */
.btn-share {
  background: none;
  border: none;
  cursor: pointer;
  padding: 3px;
  border-radius: 4px;
  color: #94a3b8;
  transition: color 0.15s ease, transform 0.15s ease !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  font-size: 1rem;
  /* Never hide — always render the icon */
  opacity: 1 !important;
  visibility: visible !important;
}
html:not(.dark) .btn-share { color: #64748b; }
.btn-share i { font-size: 15px; }
.btn-share:hover {
  color: #4f46e5;
  transform: scale(1.25);
}
html.dark .btn-share:hover { color: #818cf8; }

/* ─── Mobile Card View ───────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  table thead { display: none; }
  table tbody tr {
    display: block;
    margin-bottom: 0.75rem;
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
  }
  html.dark table tbody tr {
    border: 1px solid rgba(51, 65, 85, 0.5);
    background: rgba(15, 23, 42, 0.6);
  }
  html:not(.dark) table tbody tr {
    border: 1px solid rgba(203, 213, 225, 0.6);
    background: rgba(255, 255, 255, 0.8);
  }
  table tbody tr.listing-new {
    border-left: 3px solid #6366f1 !important;
    animation: none;
    box-shadow: none;
  }
  table tbody tr.listing-seen:not(.listing-unavailable) {
    border-left: 3px solid #94a3b8 !important;
    box-shadow: none;
  }
  table tbody td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.2rem 0;
    border: none !important;
  }
  table tbody td::before {
    content: attr(data-label);
    font-weight: 600;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
  }
  html.dark table tbody td::before { color: #64748b; }
  html:not(.dark) table tbody td::before { color: #94a3b8; }
  /* Hide Eigenmittel on mobile */
  table tbody td:nth-child(7) { display: none; }
  /* Heart column: show but no label */
  table tbody td:nth-child(9)::before { display: none; }
  table tbody td:nth-child(9) { justify-content: flex-end; }
}

/* ─── Loading State ──────────────────────────────────────────────────────────── */
.loading tbody { opacity: 0.3; pointer-events: none; }

/* ─── Listing title sub-line ─────────────────────────────────────────────────
   Visible listing title under the address (was only a title-hover attribute,
   invisible on touch devices). Truncated with ellipsis so long scraper titles
   never blow up the table layout. */
.listing-addr-wrap { min-width: 0; }
.listing-title-sub {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 340px;
  margin-top: 2px;
}
@media (max-width: 768px) {
  /* Card layout: td is a flex row (label left, value right) — keep the
     address block right-aligned and cap the title width to the viewport. */
  .listing-addr-wrap { text-align: right; }
  .listing-title-sub { max-width: 60vw; margin-left: auto; }
}

/* ─── Tooltip ────────────────────────────────────────────────────────────────── */
[data-tooltip] { position: relative; }
[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 8px;
  font-size: 0.7rem;
  border-radius: 6px;
  white-space: nowrap;
  z-index: 50;
  pointer-events: none;
}
html.dark [data-tooltip]:hover::after {
  background: #1e293b;
  border: 1px solid #334155;
  color: #e2e8f0;
}
html:not(.dark) [data-tooltip]:hover::after {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #334155;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* ─── Stats Bar (light mode) ─────────────────────────────────────────────────── */
html:not(.dark) .stats-total-badge {
  background: rgba(15, 23, 42, 0.08);
  color: #0f172a;
}

/* ─── Gradient Text ──────────────────────────────────────────────────────────── */
.gradient-text {
  background: linear-gradient(135deg, #818cf8, #6366f1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ─── Focus Ring Utility ─────────────────────────────────────────────────────── */
*:focus-visible {
  outline: 2px solid rgba(99, 102, 241, 0.6);
  outline-offset: 2px;
}

/* ─── Login shake animation ──────────────────────────────────────────────────── */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

/* ─── Filter Panel Animation ─────────────────────────────────────────────────── */
#filterPanel {
  overflow: hidden;
  max-height: 2000px;
  opacity: 1;
  transition: max-height 0.35s ease, opacity 0.25s ease, border-color 0.25s ease !important;
}
#filterPanel.panel-collapsed {
  max-height: 0;
  opacity: 0;
  border-top-color: transparent !important;
}

/* ─── Stats Bar Badges ───────────────────────────────────────────────────────── */
#statsBar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
/* Better contrast for source badges in light mode */
html:not(.dark) #statsBar span[onclick] {
  filter: saturate(1.3);
}
html:not(.dark) #statsBar span[onclick] {
  background-color: rgba(0,0,0,0.05) !important;
}

/* ─── Sort Toggle Button ─────────────────────────────────────────────────────── */
/* height/flex set directly on element; this just guards min-width */
#sortOrderBtn { min-width: 2rem; }

/* ─── Admin Toggle Button ────────────────────────────────────────────────────── */
.admin-toggle-btn {
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease !important;
}
html:not(.dark) .admin-toggle-btn {
  background-color: rgba(255, 255, 255, 0.9);
  color: #374151;
  border-color: #d1d5db;
}
html:not(.dark) .admin-toggle-btn:hover {
  color: #111827;
  border-color: rgba(99, 102, 241, 0.5);
  background-color: #fff;
}
.admin-toggle-active {
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.2), rgba(99, 102, 241, 0.15)) !important;
  border-color: rgba(99, 102, 241, 0.5) !important;
  color: #a5b4fc !important;
  box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.3);
}
html:not(.dark) .admin-toggle-active {
  color: #4338ca !important;
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.1), rgba(99, 102, 241, 0.08)) !important;
}

/* ── Admin Tabs Container ── */
.admin-tabs-container {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(51, 65, 85, 0.5);
  border-radius: 0.75rem;
  padding: 4px;
}
html:not(.dark) .admin-tabs-container {
  background: rgba(241, 245, 249, 0.9);
  border-color: rgba(203, 213, 225, 0.9);
}

/* ── Admin Tabs ── */
.admin-tab {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 0.875rem;
  border-radius: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 500;
  transition: color 0.15s ease, background-color 0.15s ease !important;
  background: transparent;
  border: none;
  cursor: pointer;
  white-space: nowrap;
}
html.dark .admin-tab { color: #9ca3af; }
html:not(.dark) .admin-tab { color: #4b5563; }
html.dark .admin-tab:hover { color: #d1d5db; background: rgba(255,255,255,0.05); }
html:not(.dark) .admin-tab:hover { color: #111827; background: rgba(0,0,0,0.05); }
/* Active tab — dark text on light mode, white on dark — always high contrast */
html.dark .admin-tab.active {
  background: linear-gradient(135deg, #4f46e5, #6366f1) !important;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(99,102,241,0.35);
}
html:not(.dark) .admin-tab.active {
  background: linear-gradient(135deg, #4338ca, #4f46e5) !important;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(79,70,229,0.35);
}

/* ── Admin Cards ── */
.admin-card {
  border-radius: 0.75rem;
  backdrop-filter: blur(8px);
  transition: border-color 0.15s ease !important;
}
html.dark .admin-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(51, 65, 85, 0.5);
}
html:not(.dark) .admin-card {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(203, 213, 225, 0.8);
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
html.dark .admin-card:hover { border-color: rgba(99, 102, 241, 0.3); }
html:not(.dark) .admin-card:hover { border-color: rgba(99, 102, 241, 0.4); }

/* ── Admin Panel Box (large panels) ── */
.admin-panel-box {
  border-radius: 0.75rem;
  overflow: hidden;
  backdrop-filter: blur(8px);
}
html.dark .admin-panel-box {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(51, 65, 85, 0.5);
}
html:not(.dark) .admin-panel-box {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(203, 213, 225, 0.8);
  box-shadow: 0 1px 6px rgba(0,0,0,0.07);
}

/* ── Admin Table Rows ── */
.admin-table-row { transition: background 0.1s ease !important; }
html.dark .admin-table-row:hover { background: rgba(99, 102, 241, 0.06) !important; }
html:not(.dark) .admin-table-row:hover { background: rgba(99, 102, 241, 0.04) !important; }

/* ── Admin Inputs ── */
.admin-input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.8125rem;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s !important;
}
html.dark .admin-input {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(51, 65, 85, 0.8);
  color: white;
}
html:not(.dark) .admin-input {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  color: #0f172a;
}
.admin-input:focus {
  border-color: rgba(99,102,241,0.6);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}
html.dark .admin-input::placeholder { color: #4b5563; }
html:not(.dark) .admin-input::placeholder { color: #94a3b8; }

/* ── Buttons ── */
.btn-primary {
  padding: 0.5rem 1rem;
  background: linear-gradient(135deg, #4f46e5, #6366f1);
  color: white;
  border: none;
  border-radius: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease !important;
  white-space: nowrap;
}
.btn-primary:hover { background: linear-gradient(135deg, #6366f1, #818cf8); box-shadow: 0 4px 12px rgba(99,102,241,0.3); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-secondary {
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease !important;
  white-space: nowrap;
}
html.dark .btn-secondary {
  background: rgba(30, 41, 59, 0.6);
  color: #9ca3af;
  border: 1px solid rgba(51, 65, 85, 0.8);
}
html:not(.dark) .btn-secondary {
  background: #f1f5f9;
  color: #374151;
  border: 1px solid #cbd5e1;
}
html.dark .btn-secondary:hover { color: white; border-color: rgba(99,102,241,0.4); background: rgba(30,41,59,0.9); }
html:not(.dark) .btn-secondary:hover { color: #111827; border-color: rgba(99,102,241,0.4); background: #e2e8f0; }

/* ── Action Buttons in Table ── */
.action-btn {
  padding: 0.375rem;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: all 0.15s ease !important;
}
html.dark .action-btn {
  border: 1px solid rgba(51,65,85,0.6);
  background: rgba(30,41,59,0.5);
  color: #6b7280;
}
html:not(.dark) .action-btn {
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #6b7280;
}
html.dark .action-btn:hover { color: #a5b4fc; border-color: rgba(99,102,241,0.4); background: rgba(99,102,241,0.1); }
html:not(.dark) .action-btn:hover { color: #4338ca; border-color: rgba(99,102,241,0.4); background: rgba(99,102,241,0.08); }
.action-btn-warn:hover { color: #fbbf24 !important; border-color: rgba(251,191,36,0.4) !important; background: rgba(251,191,36,0.1) !important; }
.action-btn-danger:hover { color: #f87171 !important; border-color: rgba(248,113,113,0.4) !important; background: rgba(248,113,113,0.1) !important; }

/* ── Role Badges ── */
.role-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.5rem;
  border-radius: 0.375rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.025em;
  text-transform: uppercase;
}
.role-admin {
  background: rgba(139,92,246,0.15);
  color: #c4b5fd;
  border: 1px solid rgba(139,92,246,0.3);
}
html:not(.dark) .role-admin {
  background: rgba(139,92,246,0.1);
  color: #6d28d9;
  border-color: rgba(139,92,246,0.3);
}
.role-user {
  background: rgba(71,85,105,0.3);
  color: #94a3b8;
  border: 1px solid rgba(71,85,105,0.5);
}
html:not(.dark) .role-user {
  background: rgba(71,85,105,0.08);
  color: #475569;
  border-color: rgba(71,85,105,0.3);
}

/* ── Tier Badges (Admin-Userliste) — nutzen die role-badge-Basis ── */
.tier-pro {
  background: rgba(52,211,153,0.12);
  color: #6ee7b7;
  border: 1px solid rgba(52,211,153,0.3);
}
html:not(.dark) .tier-pro {
  background: rgba(52,211,153,0.1);
  color: #047857;
  border-color: rgba(52,211,153,0.35);
}
.tier-tryout {
  background: rgba(251,191,36,0.12);
  color: #fde68a;
  border: 1px solid rgba(251,191,36,0.3);
}
html:not(.dark) .tier-tryout {
  background: rgba(251,191,36,0.12);
  color: #b45309;
  border-color: rgba(251,191,36,0.35);
}

/* ── Audit Action Badges ── */
.audit-action {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.5rem;
  border-radius: 0.3rem;
  font-size: 0.7rem;
  font-weight: 500;
  white-space: nowrap;
}
.audit-action-ok  { background: rgba(52,211,153,0.1); color: #6ee7b7; border: 1px solid rgba(52,211,153,0.2); }
.audit-action-err { background: rgba(248,113,113,0.1); color: #fca5a5; border: 1px solid rgba(248,113,113,0.2); }
.audit-action-warn { background: rgba(251,191,36,0.1); color: #fde68a; border: 1px solid rgba(251,191,36,0.2); }
.audit-action-info { background: rgba(99,102,241,0.1); color: #a5b4fc; border: 1px solid rgba(99,102,241,0.2); }
html:not(.dark) .audit-action-ok  { color: #059669; }
html:not(.dark) .audit-action-err { color: #dc2626; }
html:not(.dark) .audit-action-warn { color: #d97706; }
html:not(.dark) .audit-action-info { color: #4338ca; }

/* ── View Transition ── */
#adminView { animation: fadeIn 0.2s ease-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* ─── Light Mode Input/Select/Checkbox Contrast ──────────────────────────────── */
html:not(.dark) select,
html:not(.dark) input[type="text"],
html:not(.dark) input[type="password"],
html:not(.dark) input[type="number"] {
  background-color: #fff;
  color: #0f172a;
  border-color: #cbd5e1;
}
html:not(.dark) select:focus,
html:not(.dark) input:focus {
  background-color: #fff;
  border-color: rgba(99, 102, 241, 0.6);
}

/* ─── Custom Select Dropdowns (Anbieter, Sort) ───────────────────────────────── */
/* Remove native OS appearance to get consistent cross-browser styling */
#filterSource,
#sortField,
#auditFilterAction {
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2394a3b8' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.625rem center;
  background-size: 10px 6px;
  padding-right: 2rem;
}
html:not(.dark) #filterSource,
html:not(.dark) #sortField,
html:not(.dark) #auditFilterAction {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2364748b' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
}
#filterSource:focus,
#sortField:focus,
#auditFilterAction:focus {
  outline: none !important;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.3) !important;
  border-color: rgba(99, 102, 241, 0.6) !important;
}
/* Keep border-radius consistent on focus (no rectangular outline override) */
#filterSource { border-radius: 0.5rem; }
#sortField    { border-radius: 0.5rem; }
/* Checkbox accent color + rounded corners */
input[type="checkbox"] {
  accent-color: #6366f1;
  width: 0.875rem;
  height: 0.875rem;
  border-radius: 4px;
}

/* ─── Anzeige-Dropdown (Sort-Bar): Favoriten / Ungesehen / Inaktive ─────────── */
.display-menu-row {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 0.625rem;
  border-radius: 0.625rem;
  cursor: pointer;
  transition: background 0.15s ease;
}
.display-menu-row:hover { background: rgba(99, 102, 241, 0.07); }
html.dark .display-menu-row:hover { background: rgba(255, 255, 255, 0.05); }
.display-menu-icon {
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 0.55rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  flex-shrink: 0;
}
/* Zähl-Badge im Anzeige-Button: display via .show, nicht Tailwind-hidden */
.display-badge { display: none; }
.display-badge.show { display: inline-flex; }
/* Caret dreht sich, wenn das Menü offen ist */
#displayMenuBtn[aria-expanded="true"] .ph-caret-down { transform: rotate(180deg); }

/* ─── Sortier-Select: nativer Pfeil ersetzt durch eigenes Caret ─────────────── */
.select-modern {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.55rem center;
  background-size: 0.6rem;
  padding-right: 1.75rem;
}
html.dark .select-modern {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* ─── Mobile Sort-Bar: zwei bündige Zeilen statt wildem Umbruch ─────────────── */
@media (max-width: 640px) {
  #sortBar .sort-bar-group { width: 100%; }
  /* Stats-Chips zentriert — wirkt gesetzt statt ausgefranst */
  #statsBar { justify-content: center; }
}

/* ─── Mobile: Listings Panel — sort bar als Header, Cards darin ──────────────── */
@media (max-width: 640px) {
  /* #listingsOuter bleibt als Panel-Container — keine visuellen Overrides */

  /* Sort bar: Panel-Header mit Separator nach unten */
  #sortBar {
    border-bottom: 1px solid rgba(203, 213, 225, 0.6) !important;
  }
  html.dark #sortBar {
    border-bottom: 1px solid rgba(51, 65, 85, 0.4) !important;
  }

  /* Listing-Cards: Sub-Cards innerhalb des Panels */
  #listingsOuter table tbody tr {
    margin: 0.5rem 0.5rem 0 !important;
  }
  #listingsOuter table tbody tr:last-child {
    margin-bottom: 0.5rem !important;
  }
}

/* ─── Admin Tables → Mobile Cards ────────────────────────────────────────────── */
@media (max-width: 640px) {
  .admin-table-users thead,
  .admin-table-audit thead { display: none; }

  .admin-table-users tbody tr,
  .admin-table-audit tbody tr {
    display: block;
    margin: 0.5rem 0.75rem;
    border-radius: 0.625rem;
    padding: 0.625rem 0.875rem;
  }
  html.dark .admin-table-users tbody tr,
  html.dark .admin-table-audit tbody tr {
    background: rgba(15, 23, 42, 0.6) !important;
    border: 1px solid rgba(51, 65, 85, 0.5);
  }
  html:not(.dark) .admin-table-users tbody tr,
  html:not(.dark) .admin-table-audit tbody tr {
    background: rgba(255, 255, 255, 0.95) !important;
    border: 1px solid rgba(203, 213, 225, 0.7);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  }

  .admin-table-users,
  .admin-table-audit {
    table-layout: fixed;
    min-width: unset;
    width: 100%;
  }

  .admin-table-users tbody td,
  .admin-table-audit tbody td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.2rem 0;
    border: none !important;
    font-size: 0.8125rem;
    word-break: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
  }
  .admin-table-users tbody td::before,
  .admin-table-audit tbody td::before {
    content: attr(data-label);
    font-weight: 600;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    flex-shrink: 0;
    margin-right: 0.5rem;
  }
  html.dark .admin-table-users tbody td::before,
  html.dark .admin-table-audit tbody td::before { color: #64748b; }
  html:not(.dark) .admin-table-users tbody td::before,
  html:not(.dark) .admin-table-audit tbody td::before { color: #94a3b8; }

  /* Aktionen column: right-align, no label prefix */
  .admin-table-users tbody td[data-label="Aktionen"] { justify-content: flex-end; }
  .admin-table-users tbody td[data-label="Aktionen"]::before { display: none; }

  /* Overflow fix for admin panels */
  .admin-panel-box { overflow-x: hidden; }
  #adminPanel-users .overflow-x-auto,
  #adminPanel-audit .overflow-x-auto { overflow-x: hidden; }

  /* Audit Log: Zellen umbrechen wie Benutzer-Tabelle */
  .admin-table-audit tbody td {
    word-break: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
  }
}

/* ─── Slider Track Visibility (Light Mode) ───────────────────────────────────── */
html:not(.dark) .range-track {
  background: #cbd5e1 !important; /* slate-300 — clearly visible */
}
html:not(.dark) .range-fill {
  background: linear-gradient(90deg, #4f46e5, #6366f1);
}
/* Kill the native browser track so only our custom track shows.
   Must override html:not(.dark) input { background-color: #f8fafc } (higher specificity) */
html:not(.dark) input.range-thumb {
  background: transparent !important;
}
.range-thumb::-webkit-slider-runnable-track {
  background: transparent !important;
  height: 4px;
}
.range-thumb::-moz-range-track {
  background: transparent !important;
  height: 4px;
}
/* Light-mode thumb: visible border so it's clearly interactive */
html:not(.dark) .range-thumb::-webkit-slider-thumb {
  background: #4f46e5;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1.5px #6366f1;
}
html:not(.dark) .range-thumb::-moz-range-thumb {
  background: #4f46e5;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1.5px #6366f1;
}

/* ─── PIN Eye-Toggle Button ──────────────────────────────────────────────────── */
.pin-wrap {
  position: relative;
}
.pin-eye-btn {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  color: #94a3b8;
  transition: color 0.15s ease !important;
}
.pin-eye-btn:hover { color: #6366f1; }
html.dark .pin-eye-btn { color: #4b5563; }
html.dark .pin-eye-btn:hover { color: #a5b4fc; }

/* ─── Stats Bar Badge Height Unification ─────────────────────────────────────── */
/* ALL badges in the stats bar share the same exact height via .stats-bar-badge class */
.stats-bar-badge {
  display: inline-flex;
  align-items: center;
  height: 1.75rem;   /* 28px — exact, no min-height */
  line-height: 1;
  padding: 0.125rem 0.625rem;
  font-size: 0.8125rem;
  border-radius: 0.5rem;
  box-sizing: border-box;
  min-height: unset;
}

/* ─── Compact List View (Mobile) ────────────────────────────────────────────── */
/* Toggle with #compactViewBtn: replaces card layout with slim single-line rows */
/* Columns shown: Bezirk (3), Fläche (5), Zimmer (6), Miete (8), Heart (9) */
@media (max-width: 768px) {
  table.compact-mode thead { display: table-header-group !important; }
  table.compact-mode thead tr { display: table-row !important; }
  /* Hide all header cells, then show only the needed ones */
  table.compact-mode thead th { display: none !important; }
  table.compact-mode thead th:nth-child(3),
  table.compact-mode thead th:nth-child(5),
  table.compact-mode thead th:nth-child(6),
  table.compact-mode thead th:nth-child(8),
  table.compact-mode thead th:nth-child(9) { display: table-cell !important; padding: 0.3rem 0.4rem; font-size: 0.65rem; }

  table.compact-mode tbody tr {
    display: table-row !important;
    margin-bottom: 0 !important;
    border-radius: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
  }
  html:not(.dark) table.compact-mode tbody tr {
    border-bottom: 1px solid rgba(203,213,225,0.4) !important;
  }
  html.dark table.compact-mode tbody tr {
    border-bottom: 1px solid rgba(51,65,85,0.3) !important;
  }
  /* Hide all cells */
  table.compact-mode tbody td { display: none !important; }
  /* Show only Bezirk, Fläche, Zimmer, Miete, Heart */
  table.compact-mode tbody td:nth-child(3),
  table.compact-mode tbody td:nth-child(5),
  table.compact-mode tbody td:nth-child(6),
  table.compact-mode tbody td:nth-child(8),
  table.compact-mode tbody td:nth-child(9) {
    display: table-cell !important;
    padding: 0.35rem 0.4rem !important;
    border: none !important;
    font-size: 0.75rem !important;
    justify-content: unset;
  }
  table.compact-mode tbody td::before { display: none !important; }
  /* Heart column: center */
  table.compact-mode tbody td:nth-child(9) { text-align: center !important; width: 2rem; }
  /* Rent: right-align, keep green color */
  table.compact-mode tbody td:nth-child(8) { text-align: right !important; }
}

/* ─── Compact/List Toggle — mobile only ─────────────────────────────────────── */
#compactViewBtn { display: none; }
@media (max-width: 640px) {
  #compactViewBtn { display: inline-flex; }
}

/* Compact view button active state */
#compactViewBtn.active {
  background-color: rgba(99,102,241,0.15) !important;
  border-color: rgba(99,102,241,0.4) !important;
  color: #818cf8 !important;
}
html:not(.dark) #compactViewBtn.active {
  background-color: rgba(99,102,241,0.1) !important;
  color: #4f46e5 !important;
}

/* ─── Mobile Responsive Improvements ────────────────────────────────────────── */
@media (max-width: 640px) {
  /* Header: wrap button group on very small screens */
  header .flex.items-center.gap-1,
  header .flex.items-center.gap-2 {
    gap: 0.25rem !important;
  }
  /* Hide last-scan info on mobile (saves space) */
  #lastScanInfo { display: none !important; }

  /* Filter grid: 1 column on mobile */
  #filterPanel .grid.grid-cols-1.sm\\:grid-cols-3 {
    grid-template-columns: 1fr;
  }
  #filterPanel .grid.grid-cols-2 {
    grid-template-columns: 1fr;
  }
  /* Filter panel: full width */
  #filterPanel { width: 100%; box-sizing: border-box; }

  /* Range sliders: full width */
  .range-slider-wrap { width: 100%; }

  /* District badges: wrap (already does, ensure min-width) */
  #districtBadges { width: 100%; }
  #districtBadges .district-pill { min-width: 0; }

  /* Stats bar: slightly smaller on mobile but still uniform height */
  .stats-bar-badge {
    font-size: 0.7rem;
    padding: 2px 8px;
    height: 26px;
    min-height: unset;
  }

  /* Sort bar: wrap options */
  .flex.flex-wrap.items-center.gap-x-3 {
    gap: 0.4rem !important;
  }

  /* Admin tabs: wrap on small screens */
  .admin-tabs-container {
    width: 100% !important;
    flex-wrap: wrap !important;
  }
  .admin-tab {
    flex: 1 1 auto;
    justify-content: center;
    min-width: 5rem;
    font-size: 0.75rem;
    padding: 0.4rem 0.5rem;
  }

  /* Admin tables: card-mode, no horizontal scroll */
  .admin-panel-box,
  .admin-panel {
    max-width: 100vw;
    overflow: hidden;
  }
  .admin-panel-box .overflow-x-auto,
  .admin-panel .overflow-x-auto {
    overflow-x: hidden !important;
    max-width: 100%;
  }
  /* Users table: card mode — no min-width, full width */
  #adminPanel-users table,
  .admin-table-users {
    min-width: unset !important;
    width: 100% !important;
    table-layout: fixed !important;
  }
  #adminPanel-users .overflow-x-auto {
    overflow: hidden !important;
    max-width: 100vw;
  }
  #adminPanel-audit table {
    min-width: unset;
  }
  .admin-panel-box table,
  .admin-panel table {
    min-width: 0;
  }

  /* Admin stat tiles: 2-column grid stays, reduce padding */
  #dashboardTiles .admin-panel-box {
    padding: 0.875rem;
  }
  #dashboardTiles .text-3xl { font-size: 1.5rem; }
}

/* ─── Landing Stats Grid ─────────────────────────────────────────────────────── */
.landing-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-bottom: 2.5rem;
  max-width: 22rem;
  margin-left: auto;
  margin-right: auto;
}
@media (min-width: 640px) {
  .landing-stats-grid {
    grid-template-columns: repeat(4, 1fr);
    max-width: 48rem;
    gap: 2rem;
  }
}

/* ─── Landing Page ───────────────────────────────────────────────────────────── */
.landing-feature-card {
  background: rgba(255,255,255,0.7);
  border: 1px solid rgba(203,213,225,0.8);
  border-radius: 0.875rem;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  backdrop-filter: blur(8px);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.landing-feature-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(99,102,241,0.1);
}
.dark .landing-feature-card {
  background: rgba(30,41,59,0.6);
  border-color: rgba(51,65,85,0.5);
}
.landing-feature-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.625rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ─── View Segmented Control (List / Map) ────────────────────────────────────── */
.view-segment-wrap {
  display: inline-flex;
  align-items: center;
  background: #f1f5f9;
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}
.dark .view-segment-wrap {
  background: rgba(255,255,255,0.07);
}
.view-segment-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 10px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
  white-space: nowrap;
}
.view-segment-btn i {
  font-size: 14px;
}
.view-segment-label {
  display: none;
}
@media (min-width: 480px) {
  .view-segment-label {
    display: inline;
  }
}
.view-segment-btn:hover:not(.active) {
  background: #e2e8f0;
  color: #334155;
}
.dark .view-segment-btn:hover:not(.active) {
  background: rgba(255,255,255,0.1);
  color: #cbd5e1;
}
.view-segment-btn.active {
  background: #6366f1;
  color: #ffffff;
  box-shadow: 0 1px 4px rgba(99,102,241,0.35);
}
.dark .view-segment-btn.active {
  background: #6366f1;
  color: #ffffff;
  box-shadow: 0 1px 6px rgba(99,102,241,0.4);
}

/* ─── Leaflet popup theme ────────────────────────────────────────────────────── */
.dark .leaflet-popup-content-wrapper {
  background: #1e293b;
  color: #e2e8f0;
  border: 1px solid rgba(51,65,85,0.8);
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}
.dark .leaflet-popup-tip {
  background: #1e293b;
}
.dark .leaflet-popup-close-button {
  color: #94a3b8 !important;
}

/* ─── Pricing Cards ──────────────────────────────────────────────────────────── */
.pricing-card {
  border-radius: 1rem;
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}
.pricing-card:hover { transform: translateY(-3px); }
html.dark .pricing-card {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(51, 65, 85, 0.6);
}
html:not(.dark) .pricing-card {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(203, 213, 225, 0.9);
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.pricing-card-featured {
  border-color: rgba(99, 102, 241, 0.5) !important;
  box-shadow: 0 0 0 1px rgba(99,102,241,0.2), 0 8px 32px rgba(99,102,241,0.12) !important;
}
.pricing-card-featured:hover {
  box-shadow: 0 0 0 1px rgba(99,102,241,0.35), 0 12px 40px rgba(99,102,241,0.18) !important;
}
.pricing-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #4f46e5, #6366f1);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 3px 12px;
  border-radius: 999px;
  white-space: nowrap;
}
.pricing-feature-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.pricing-feature-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
}
html.dark .pricing-feature-item { color: #cbd5e1; }
html:not(.dark) .pricing-feature-item { color: #374151; }
.pricing-feature-item .ph-check-circle { color: #22c55e; font-size: 1rem; }
.pricing-feature-item .ph-x-circle     { color: #94a3b8; font-size: 1rem; }

/* ─── Demo-Modus-Banner ──────────────────────────────────────────────────────── */
/* #demoBanner ist fixed (30px hoch, z-70). body.demo-mode schafft den Platz
   dafür und schiebt den sticky Portal-Header entsprechend nach unten. */
body.demo-mode { padding-top: 30px; }
body.demo-mode #mainApp header.sticky { top: 30px; }

/* ─── Teaser-Modus: gesperrter Block ─────────────────────────────────────────── */
/* Die Inhalte gesperrter Zeilen sind SERVER-SEITIGE Attrappen (negative IDs,
   erfundene Daten) — Blur und Overlay sind reine Optik. Wer beides per
   DevTools entfernt, sieht Fake-Daten, keine echten Inserate. */
.listing-locked { cursor: pointer; }
.listing-locked td > * {
  filter: blur(5px);
  user-select: none;
  pointer-events: none;
}
/* EIN Overlay über dem gesamten gesperrten Block (Anker: erste locked-Zeile,
   gesetzt von renderLockedOverlay). Frostglas-Verlauf, CTA-Karte klebt beim
   Scrollen im Viewport. */
.locked-block-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  background: linear-gradient(to bottom, rgba(248, 250, 252, 0.55), rgba(248, 250, 252, 0.9) 200px);
}
html.dark .locked-block-overlay {
  background: linear-gradient(to bottom, rgba(15, 23, 42, 0.55), rgba(15, 23, 42, 0.9) 200px);
}
.locked-block-cta {
  position: sticky;
  top: 110px;
  max-width: 380px;
  width: 100%;
  cursor: default;
}
