:root {
  --blue:      #1a6bbf;
  --blue-dark: #155a9e;
  --orange:    #ea580c;
  --orange-lt: #fff7ed;
  --green:     #16a34a;
  --green-lt:  #dcfce7;
  --text:      #0f172a;
  --muted:     #6b7280;
  --line:      #e5e7eb;
  --bg:        #f1f3f8;
  --white:     #fff;
  /* category accent – overridden via JS on <html> */
  --cat:       var(--blue);
  --cat-soft:  #dbeafe;
  --cat-tint:  #f3f7fc;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* ── HERO ──────────────────────────────────────────── */
.hero {
  background: var(--blue);
  color: white;
  padding: 18px 32px 28px;
  position: relative;
}
.hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.brand { display: flex; align-items: baseline; gap: 6px; line-height: 1; }
.brand-mos { color: var(--orange); font-weight: 900; font-size: 22px; letter-spacing: -0.5px; }
.brand-muc { color: white; font-weight: 500; font-size: 16px; letter-spacing: 0.04em; }
.hero-menu {
  background: transparent; border: none; color: white; cursor: pointer;
  padding: 6px; border-radius: 6px; transition: background .15s;
}
.hero-menu:hover { background: rgba(255,255,255,0.12); }
.hero-title {
  font-size: 28px; font-weight: 800; color: white;
  letter-spacing: -0.8px; line-height: 1.1; margin-bottom: 6px;
}
.hero-sub { font-size: 13px; color: rgba(255,255,255,0.78); font-weight: 500; }
.hero-sub .count-pill-hero {
  display: inline-block;
  background: var(--orange); color: white;
  padding: 2px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 700;
  margin-left: 4px;
}

/* ── CATEGORY TILES ────────────────────────────────── */
.cat-bar {
  background: white;
  border-bottom: 1px solid var(--line);
  padding: 12px 24px 14px;
}
.cat-tiles {
  max-width: 1400px; margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.cat-tile {
  background: var(--tile-soft, #f3f4f6);
  border: 1.5px solid transparent;
  border-radius: 12px;
  padding: 10px 14px;
  cursor: pointer;
  font-family: inherit;
  display: flex; align-items: center; gap: 10px;
  text-align: left;
  transition: transform .12s, border-color .15s, box-shadow .15s;
}
.cat-tile:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(15,23,42,0.06);
}
.cat-tile.on {
  border-color: var(--tile-color);
  background: white;
  box-shadow: 0 0 0 3px var(--tile-ring);
}
.cat-tile-ico {
  width: 30px; height: 30px; border-radius: 8px;
  background: white;
  display: flex; align-items: center; justify-content: center;
  color: var(--tile-color);
  flex-shrink: 0;
}
.cat-tile.on .cat-tile-ico { background: var(--tile-soft); }
.cat-tile-label {
  font-size: 12.5px; font-weight: 600; color: var(--text);
  letter-spacing: -0.1px; line-height: 1.25;
  overflow: hidden; text-overflow: ellipsis;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.cat-tile.on .cat-tile-label { color: var(--tile-color); font-weight: 700; }
.cat-tile-count {
  display: inline-block; margin-left: 4px;
  background: var(--tile-color); color: #fff;
  font-size: 10px; font-weight: 800; line-height: 1;
  padding: 2px 6px; border-radius: 10px; vertical-align: middle;
}

/* Übergeordnete Sonderkachel: Gestrichene Stellen */
.cat-tile-gestrichen {
  grid-column: 1 / -1;
  background: #fff;
  border: 1.5px dashed var(--tile-color);
  justify-content: flex-start;
}
.cat-tile-gestrichen .cat-tile-ico { color: var(--tile-color); background: var(--tile-soft); }
.cat-tile-gestrichen .cat-tile-label { color: var(--tile-color); font-weight: 700; -webkit-line-clamp: 1; }
.cat-tile-gestrichen.on {
  background: var(--tile-color);
  border-style: solid;
  box-shadow: 0 0 0 3px var(--tile-ring);
}
.cat-tile-gestrichen.on .cat-tile-ico { background: rgba(255,255,255,0.22); color: #fff; }
.cat-tile-gestrichen.on .cat-tile-label { color: #fff; }
.cat-tile-gestrichen.on .cat-tile-count { background: #fff; color: var(--tile-color); }

/* ── TOOLBAR ───────────────────────────────────────── */
.toolbar-wrap {
  background: var(--cat-tint);
  border-bottom: 1px solid var(--line);
  transition: background .25s;
  position: sticky; top: 0; z-index: 20;
}
.toolbar {
  max-width: 1400px; margin: 0 auto;
  padding: 14px 24px 16px;
}
.search-wrap {
  background: white; border: 1px solid var(--line);
  border-radius: 11px;
  padding: 10px 16px;
  display: flex; align-items: center; gap: 10px;
  box-shadow: 0 2px 10px rgba(15,77,138,0.05);
  transition: border-color .15s, box-shadow .15s;
}
.search-wrap:focus-within {
  border-color: var(--cat);
  box-shadow: 0 0 0 3px var(--cat-soft);
}
.search-wrap svg { flex-shrink: 0; }
.search-input {
  flex: 1; border: none; outline: none; font-family: inherit;
  font-size: 13.5px; color: var(--text); background: transparent;
}
.search-input::placeholder { color: #9ca3af; }
.filter-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 10px;
}
.chip-group {
  background: white; border: 1px solid var(--line);
  border-radius: 9px; padding: 3px; display: flex; gap: 2px;
}
.chip {
  padding: 6px 13px; border-radius: 7px; border: none;
  background: transparent; font-family: inherit;
  font-size: 12.5px; font-weight: 600; color: var(--muted);
  cursor: pointer; transition: all .15s; white-space: nowrap;
}
.chip:hover { color: var(--text); }
.chip.on {
  background: var(--cat);
  color: white;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}
.filter-select {
  background: white; border: 1px solid var(--line); border-radius: 9px;
  padding: 7px 28px 7px 12px;
  font-family: inherit; font-size: 12.5px; font-weight: 500;
  color: var(--text); cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='11' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center;
  outline: none; transition: border-color .15s;
}
.filter-select:hover, .filter-select:focus { border-color: #cbd5e1; }
.ansp-tog {
  background: white; border: 1px solid var(--line); border-radius: 9px;
  padding: 7px 14px; font-family: inherit; font-size: 12.5px;
  font-weight: 600; color: var(--muted); cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px;
  transition: all .15s;
}
.ansp-tog.on {
  background: var(--green-lt); border-color: #86efac; color: var(--green);
}
.ansp-tog .cb {
  width: 14px; height: 14px; border-radius: 4px;
  border: 1.5px solid #d1d5db; background: white;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s; flex-shrink: 0;
}
.ansp-tog.on .cb { background: var(--green); border-color: var(--green); }
.count-badge {
  margin-left: auto;
  background: var(--orange); color: white;
  padding: 6px 14px; border-radius: 9px;
  font-size: 12px; font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(234,88,12,0.2);
}

/* ── GRID ──────────────────────────────────────────── */
.grid-wrap { max-width: 1400px; margin: 0 auto; padding: 14px 24px 40px; }
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

/* ── CARD ──────────────────────────────────────────── */
.card {
  background: white; border: 1px solid var(--line);
  border-radius: 12px; overflow: hidden; cursor: pointer;
  transition: transform .15s, box-shadow .15s, border-color .15s;
  display: flex; flex-direction: column; position: relative;
}
.card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0;
  height: 3px; background: var(--card-color, var(--blue));
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(15,77,138,0.10);
  border-color: #d1d5db;
}
.card-body { padding: 14px 14px 10px; flex: 1; display: flex; flex-direction: column; gap: 10px; }
.card-head { display: flex; gap: 10px; align-items: flex-start; }
.card-icon {
  width: 36px; height: 36px; border-radius: 9px;
  background: var(--card-soft, #eff6ff);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.card-icon i, .card-icon svg { display: block; }
.card-title-wrap { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.card-cat-badge {
  align-self: flex-start;
  font-size: 9px; font-weight: 800; letter-spacing: .08em;
  text-transform: uppercase;
  padding: 3px 7px; border-radius: 5px;
  background: var(--card-soft, #dbeafe);
  color: var(--card-color, var(--blue));
  white-space: nowrap;
}
.card-title {
  font-size: 13px; font-weight: 700; color: var(--text);
  line-height: 1.3; letter-spacing: -0.1px;
  overflow-wrap: anywhere; word-break: break-word; hyphens: auto;
}
.card-addr { font-size: 11.5px; color: var(--muted); font-weight: 500; line-height: 1.4; }
.card-pills { display: flex; flex-wrap: wrap; gap: 5px; margin-top: auto; }
.pill {
  font-size: 9.5px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase;
  padding: 3px 8px; border-radius: 5px;
  background: #f3f4f6; color: #4b5563;
}
.pill.green {
  background: var(--green-lt); color: var(--green);
}
.pill.gestrichen {
  background: #fee2e2; color: #b91c1c;
  letter-spacing: .02em; text-transform: none; font-size: 10px;
}

/* ── GESTRICHENE KARTE ─────────────────────────────── */
.card.gestrichen {
  background: #fff5f5;
  border-color: #f7b3b3;
  box-shadow: 0 0 0 1.5px #f7b3b3;
}
.card.gestrichen::before { height: 5px; background: #dc2626; }
.card.gestrichen .card-title { color: #7f1d1d; }
.card.gestrichen:hover {
  box-shadow: 0 8px 22px rgba(220,38,38,0.18), 0 0 0 1.5px #ef4444;
  border-color: #ef4444;
}
/* ── GESTRICHENE ZYKLUS-BUTTON ─────────────────────── */
.gestr-ico {
  display: flex; align-items: center; justify-content: center;
  width: 14px; height: 14px; flex-shrink: 0;
}
.ansp-tog.gestr-hide {
  background: #f1f5f9; border-color: #cbd5e1; color: #475569;
}
.ansp-tog.gestr-only {
  background: #fee2e2; border-color: #fca5a5; color: #b91c1c;
}
.card-foot {
  border-top: 1px solid #f3f4f6;
  padding: 9px 14px;
  font-size: 10px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .08em;
  color: var(--card-color, var(--blue));
}
.empty { padding: 80px 20px; text-align: center; color: #9ca3af; font-size: 14px; }

/* ── MODAL ─────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.48);
  z-index: 100; display: flex; align-items: center; justify-content: center;
  padding: 1.5rem; opacity: 0; pointer-events: none; transition: opacity 0.22s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: white; border-radius: 12px; max-width: 600px; width: 100%;
  max-height: 88vh; overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.22);
  transform: translateY(12px); transition: transform 0.22s;
  border-top: 4px solid var(--blue);
}
.modal-overlay.open .modal { transform: translateY(0); }
.modal.gestrichen { border-top-color: #dc2626; }
.modal-banner-gestrichen {
  flex-basis: 100%;
  display: flex; align-items: center; gap: 0.7rem;
  background: #fef2f2; border: 1.5px solid #fca5a5;
  border-left: 5px solid #dc2626;
  border-radius: 8px; padding: 0.8rem 1rem;
  margin-bottom: 0.4rem;
}
.modal-banner-gestrichen .mbg-ico { font-size: 1.5rem; line-height: 1; color: #dc2626; }
.modal-banner-gestrichen .mbg-title {
  font-size: 0.95rem; font-weight: 800; color: #b91c1c;
  text-transform: uppercase; letter-spacing: .04em;
}
.modal-banner-gestrichen .mbg-sub { font-size: 0.82rem; color: #7f1d1d; font-weight: 600; }
.modal-map { position: relative; height: 210px; background: var(--line); overflow: hidden; }
.modal-map iframe { width: 100%; height: 100%; border: 0; display: block; }
.modal-map .map-badge {
  position: absolute; bottom: 10px; right: 10px;
  width: 42px; height: 42px; border-radius: 50%;
  background: white; box-shadow: 0 2px 8px rgba(0,0,0,0.22);
  display: flex; align-items: center; justify-content: center;
}
.modal-body { padding: 1.5rem 1.8rem 1.8rem; }
.modal-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 0.7rem; }
.modal-header h2 { font-size: 1.15rem; font-weight: 700; line-height: 1.3; }
.modal-close {
  background: var(--bg); border: 1px solid var(--line); border-radius: 6px;
  width: 30px; height: 30px; min-width: 30px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  color: var(--muted); transition: background 0.15s; font-size: 0.9rem;
}
.modal-close:hover { background: var(--line); }
.modal-tags { display: flex; gap: 0.45rem; flex-wrap: wrap; margin-bottom: 1.1rem; padding-bottom: 1.1rem; border-bottom: 1px solid var(--line); }
.modal-badge {
  font-size: 0.68rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  padding: 0.2rem 0.65rem; border-radius: 5px;
}
.modal-branche-tag { background: #eff6ff; color: var(--blue); font-size: 0.7rem; padding: 0.2rem 0.65rem; border-radius: 5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.modal-zone-tag { background: #f3f4f6; color: #555; font-size: 0.7rem; padding: 0.2rem 0.65rem; border-radius: 5px; font-weight: 600; }
.pill-ansp { background: #e6f5ef; color: #1a7a4a; border: 1px solid #9fd8bb; }
.modal-section { margin-bottom: 1.2rem; }
.modal-section-title { font-size: 0.62rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--orange); margin-bottom: 0.4rem; }
.modal-section p { font-size: 0.86rem; line-height: 1.7; color: #444; }
.modal-contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.55rem; }
.contact-item { background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 0.65rem 0.85rem; }
.contact-item .lbl { font-size: 0.61rem; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; margin-bottom: 0.18rem; font-weight: 700; }
.contact-item .val { font-size: 0.83rem; font-weight: 600; word-break: break-word; color: var(--text); }

.site-footer { background: white; border-top: 1px solid var(--line); padding: 0.9rem 2.5rem; text-align: center; font-size: 0.73rem; color: var(--muted); }

/* ── RESPONSIVE ────────────────────────────────────── */

/* Tablet (≤ 900px) */
@media (max-width: 900px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
}

/* Kleines Tablet / großes Smartphone (≤ 760px) */
@media (max-width: 760px) {
  .hero { padding: 14px 16px 22px; }
  .hero-title { font-size: 22px; }
  .cat-bar { padding: 10px 12px 12px; }
  .cat-tiles { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .toolbar { padding: 10px 12px 12px; }
  .toolbar-wrap { position: sticky; top: 0; }
  .grid-wrap { padding: 12px 12px 32px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
  .filter-row { gap: 7px; }
  .filter-select { font-size: 12px; padding: 7px 24px 7px 10px; }
  .ansp-tog { font-size: 12px; padding: 7px 10px; }
  .count-badge { font-size: 11px; padding: 5px 10px; }
}

/* Smartphone (≤ 600px) — ein Spalten-Layout */
@media (max-width: 600px) {
  .hero { padding: 12px 14px 20px; }
  .hero-title { font-size: 20px; }
  .hero-sub { font-size: 12px; }
  .brand-mos { font-size: 19px; }
  .brand-muc { font-size: 14px; }
  .cat-bar { padding: 8px 10px 10px; }
  .cat-tiles { grid-template-columns: 1fr 1fr; gap: 6px; }
  .cat-tile { padding: 8px 10px; gap: 7px; border-radius: 10px; }
  .cat-tile-ico { width: 26px; height: 26px; }
  .cat-tile-label { font-size: 11.5px; }
  /* Gestrichen-Kachel bleibt volle Breite */
  .cat-tile-gestrichen { grid-column: 1 / -1; }
  .toolbar { padding: 8px 10px 10px; }
  .search-wrap { padding: 9px 12px; }
  .search-input { font-size: 14px; }
  .filter-row { flex-wrap: wrap; gap: 6px; }
  .chip-group { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; }
  .filter-select { width: 100%; flex: 1 1 calc(50% - 3px); min-width: 120px; font-size: 13px; }
  .ansp-tog { flex: 1 1 100%; justify-content: center; min-height: 40px; font-size: 13px; }
  #gestr-btn { flex: 1 1 100%; justify-content: center; min-height: 40px; font-size: 13px; }
  .count-badge { flex: 1 1 100%; text-align: center; margin-left: 0; }
  /* Grid: eine Spalte auf kleinen Screens */
  .grid-wrap { padding: 10px 10px 28px; }
  .grid { grid-template-columns: 1fr; gap: 9px; }
  .card-body { padding: 12px 12px 8px; }
  .card-title { font-size: 14px; }
  .card-addr { font-size: 12.5px; }
  .card-foot { font-size: 10.5px; padding: 8px 12px; }
  .card-icon { width: 32px; height: 32px; }
  /* Modal: fast vollflächig */
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal {
    border-radius: 16px 16px 0 0;
    max-height: 92vh;
    border-top-width: 5px;
  }
  .modal-map { height: 160px; }
  .modal-body { padding: 1rem 1rem 1.4rem; }
  .modal-contact-grid { grid-template-columns: 1fr; }
  .modal-header h2 { font-size: 1rem; }
  .modal-banner-gestrichen { padding: 0.65rem 0.8rem; }
  .modal-banner-gestrichen .mbg-title { font-size: 0.85rem; }
}

/* Sehr kleine Screens (≤ 380px) */
@media (max-width: 380px) {
  .cat-tiles { grid-template-columns: 1fr 1fr; gap: 5px; }
  .cat-tile { padding: 7px 8px; gap: 6px; }
  .cat-tile-ico { width: 24px; height: 24px; border-radius: 6px; }
  .cat-tile-label { font-size: 10.5px; }
  .hero-title { font-size: 18px; }
}
