/* ── Reset & Base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #f8fafc;
  --bg2:       #ffffff;
  --bg3:       #f1f5f9;
  --border:    #e2e8f0;
  --accent:    #2563eb;
  --accent2:   #7c3aed;
  --green:     #16a34a;
  --yellow:    #ca8a04;
  --red:       #dc2626;
  --text:      #0f172a;
  --text2:     #475569;
  --text3:     #94a3b8;
  --radius:    10px;
  --radius-lg: 16px;
  --shadow:    0 4px 24px rgba(0,0,0,.08);
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Navbar ──────────────────────────────────────────────────────────────── */
.navbar {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
  position: sticky; top: 0; z-index: 100;
}
.nav-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: .75rem 1.5rem;
}
.nav-brand {
  display: flex; align-items: center; gap: .5rem;
  text-decoration: none; color: var(--text);
}
.brand-icon { font-size: 1.3rem; }
.brand-text { font-size: 1.15rem; font-weight: 700; color: var(--accent); }
.brand-sub  { font-size: .8rem; color: var(--text3); }
.nav-links  { display: flex; align-items: center; gap: 1rem; }
.nav-link   { color: var(--text2); font-size: .9rem; transition: color .15s; }
.nav-link:hover { color: var(--text); text-decoration: none; }
.nav-link-muted { color: var(--text3); }
.btn-nav {
  background: var(--accent); color: #fff;
  padding: .4rem .9rem; border-radius: var(--radius);
  font-size: .85rem; font-weight: 600;
  transition: opacity .15s;
}
.btn-nav:hover { opacity: .85; text-decoration: none; }

/* ── Flash ───────────────────────────────────────────────────────────────── */
.flash {
  max-width: 1200px; margin: .75rem auto 0; padding: .75rem 1.5rem;
  border-radius: var(--radius); font-size: .9rem;
}
.flash-error   { background: #fef2f2; border: 1px solid #fca5a5; color: #b91c1c; }
.flash-success { background: #f0fdf4; border: 1px solid #86efac; color: #15803d; }

/* ── Main Content ────────────────────────────────────────────────────────── */
.main-content { flex: 1; }

/* ── Hero ────────────────────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, #eff6ff 0%, #f5f3ff 100%);
  padding: 4rem 1.5rem 3rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
}
.hero-inner { max-width: 720px; margin: 0 auto; }
.hero-title {
  font-size: 2.4rem; font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  margin-bottom: .5rem;
}
.hero-sub { color: var(--text2); margin-bottom: 2rem; font-size: 1rem; }

/* ── Search Box ──────────────────────────────────────────────────────────── */
.search-box {
  display: flex; gap: .5rem;
  background: var(--bg2);
  border: 1.5px solid var(--border);
  border-radius: 50px;
  padding: .4rem .4rem .4rem 1.2rem;
  box-shadow: 0 2px 12px rgba(0,0,0,.06);
  transition: border-color .2s;
}
.search-box:focus-within { border-color: var(--accent); }
.search-box input {
  flex: 1; background: none; border: none; outline: none;
  color: var(--text); font-size: 1rem;
}
.search-box input::placeholder { color: var(--text3); }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn-primary {
  background: var(--accent); color: #fff;
  border: none; border-radius: 50px;
  padding: .55rem 1.6rem; font-size: .95rem; font-weight: 600;
  cursor: pointer; transition: opacity .15s;
}
.btn-primary:hover { opacity: .85; text-decoration: none; color:#fff; }
.btn-outline {
  background: none; color: var(--accent);
  border: 1.5px solid var(--accent);
  border-radius: var(--radius); padding: .45rem 1rem;
  font-size: .85rem; font-weight: 600; cursor: pointer;
  transition: background .15s;
}
.btn-outline:hover { background: #eff6ff; text-decoration: none; }
.btn-ghost {
  background: none; color: var(--text2);
  border: 1px solid var(--border);
  border-radius: var(--radius); padding: .45rem 1rem;
  font-size: .85rem; cursor: pointer;
}
.btn-ghost:hover { background: var(--bg3); }
.btn-full { width: 100%; margin-top: .75rem; }
.btn-sm { font-size: .82rem; padding: .35rem .75rem; }

/* ── Filter Bar ──────────────────────────────────────────────────────────── */
.filter-bar {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
  padding: .75rem 1.5rem;
  position: sticky; top: 56px; z-index: 90;
}
.filter-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; flex-wrap: wrap; gap: .6rem; align-items: center;
}
.filter-select {
  background: var(--bg3); border: 1px solid var(--border);
  color: var(--text); border-radius: var(--radius);
  padding: .4rem .75rem; font-size: .85rem; cursor: pointer;
}
.filter-select:focus { outline: none; border-color: var(--accent); }
.filter-check {
  display: flex; align-items: center; gap: .4rem;
  color: var(--text2); font-size: .85rem; cursor: pointer;
}
.filter-check input { cursor: pointer; accent-color: var(--accent); }

/* ── Branche Multi-Picker ────────────────────────────────────────────────── */
.branche-picker {
  position: relative;
}
.branche-btn {
  display: flex; align-items: center; gap: .4rem;
  background: var(--bg3); border: 1px solid var(--border);
  color: var(--text); border-radius: var(--radius);
  padding: .4rem .75rem; font-size: .85rem; cursor: pointer;
  white-space: nowrap; transition: border-color .15s;
}
.branche-btn:hover, .branche-btn.open { border-color: var(--accent); }
.branche-btn.has-selection { border-color: var(--accent); color: var(--accent); background: #eff6ff; }
.branche-arrow { font-size: .7rem; color: var(--text3); }

.branche-dropdown {
  position: absolute; top: calc(100% + 6px); left: 0;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px rgba(0,0,0,.12);
  width: 280px; z-index: 200;
  overflow: hidden;
}
.branche-search-wrap {
  padding: .6rem;
  border-bottom: 1px solid var(--border);
}
.branche-search-input {
  width: 100%; background: var(--bg3);
  border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text); padding: .4rem .7rem; font-size: .85rem;
  outline: none;
}
.branche-search-input:focus { border-color: var(--accent); }

.branche-options-list {
  max-height: 280px; overflow-y: auto;
  padding: .4rem 0;
}
.branche-option {
  display: flex; align-items: center; gap: .6rem;
  padding: .45rem .85rem; font-size: .85rem;
  cursor: pointer; transition: background .1s;
  color: var(--text);
}
.branche-option:hover { background: var(--bg3); }
.branche-option input[type=checkbox] {
  accent-color: var(--accent); cursor: pointer; flex-shrink: 0;
}
.branche-option-label { flex: 1; }
.branche-option-cnt { font-size: .75rem; color: var(--text3); }
.branche-clear {
  display: flex; align-items: center; justify-content: center;
  padding: .5rem; border-top: 1px solid var(--border);
  font-size: .8rem; color: var(--accent); cursor: pointer;
}
.branche-clear:hover { background: #eff6ff; }

/* ── Results ─────────────────────────────────────────────────────────────── */
.results-section { max-width: 1200px; margin: 0 auto; padding: 1.5rem; }

.results-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 1rem; flex-wrap: wrap; gap: .5rem;
}
#results-count { color: var(--text2); font-size: .9rem; }

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
}

/* ── Firma Card ──────────────────────────────────────────────────────────── */
.firma-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.2rem;
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
  transition: border-color .2s, transform .15s, box-shadow .2s;
  display: flex; flex-direction: column; gap: .6rem;
}
.firma-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37,99,235,.1);
}

.card-header {
  display: flex; justify-content: space-between; align-items: flex-start; gap: .5rem;
}
.card-name {
  font-weight: 700; font-size: 1rem; color: var(--text);
  line-height: 1.3;
}
.card-name:hover { color: var(--accent); text-decoration: none; }

.rating-badge {
  flex-shrink: 0;
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .85rem;
}
.rating-10, .rating-9 { background: #dcfce7; color: #15803d; border: 1.5px solid #86efac; }
.rating-8,  .rating-7 { background: #fef9c3; color: #a16207; border: 1.5px solid #fde047; }
.rating-6,  .rating-5 { background: #ffedd5; color: #c2410c; border: 1.5px solid #fdba74; }
.rating-4, .rating-3, .rating-2, .rating-1 { background: #fee2e2; color: #b91c1c; border: 1.5px solid #fca5a5; }

.card-meta {
  display: flex; flex-wrap: wrap; gap: .4rem; align-items: center;
  font-size: .8rem; color: var(--text2);
}
.tag-branche-sm {
  background: #dbeafe;
  color: var(--accent); border-radius: 4px;
  padding: .15rem .45rem; font-size: .75rem;
}

.card-tags {
  display: flex; flex-wrap: wrap; gap: .35rem;
}
.tag {
  font-size: .75rem; border-radius: 4px;
  padding: .15rem .5rem;
}
.tag-modern   { background: #dcfce7; color: #15803d; }
.tag-jobs     { background: #ede9fe; color: #7c3aed; }
.tag-typ      { background: #f3e8ff; color: #9333ea; }
.tag-verified { background: #dcfce7; color: #15803d; }
.tag-social   { background: #fff7ed; color: #c2410c; }

.card-contact {
  display: flex; flex-direction: column; gap: .25rem;
  font-size: .82rem;
}
.card-contact-item { color: var(--text2); }
.card-contact-item:hover { color: var(--accent); }

.card-footer {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: .25rem;
}
.btn-fav {
  background: none; border: 1px solid var(--border);
  color: var(--text3); border-radius: var(--radius);
  padding: .3rem .6rem; font-size: .8rem; cursor: pointer;
  transition: all .15s;
}
.btn-fav:hover, .btn-fav.active {
  color: var(--red); border-color: #fca5a5;
  background: #fef2f2;
}
.btn-detail {
  font-size: .8rem; color: var(--accent);
}

/* ── Start State (Stats) ─────────────────────────────────────────────────── */
.start-state { padding: 2rem 0; }
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem; max-width: 800px; margin: 0 auto;
}
.stat-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem; text-align: center;
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
.stat-card-link {
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, transform .1s;
}
.stat-card-link:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(0,0,0,.10);
  transform: translateY(-2px);
}
.stat-card-link:hover .stat-num { text-decoration: underline; }
.stat-num { font-size: 2rem; font-weight: 800; color: var(--accent); }
.stat-label { font-size: .85rem; color: var(--text2); margin-top: .25rem; }

/* ── Empty State ─────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 4rem 1rem; color: var(--text2);
}
.empty-icon { font-size: 3rem; margin-bottom: 1rem; }
.empty-sub  { font-size: .85rem; color: var(--text3); }

/* ── Pagination ──────────────────────────────────────────────────────────── */
.pagination, .pagination-top {
  display: flex; gap: .4rem; align-items: center;
}
.page-btn {
  background: var(--bg2); border: 1px solid var(--border);
  color: var(--text2); border-radius: var(--radius);
  padding: .35rem .7rem; font-size: .85rem; cursor: pointer;
  transition: border-color .15s, color .15s;
}
.page-btn:hover, .page-btn.active {
  border-color: var(--accent); color: var(--accent);
}
.page-btn.active { font-weight: 700; background: #eff6ff; }
.results-footer { margin-top: 1.5rem; display: flex; justify-content: center; }

/* ── Loading Spinner ─────────────────────────────────────────────────────── */
.spinner {
  display: inline-block; width: 18px; height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%; animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-row {
  grid-column: 1/-1; text-align: center; padding: 2rem;
  color: var(--text3); display: flex; align-items: center; justify-content: center; gap: .5rem;
}

/* ── Auth ────────────────────────────────────────────────────────────────── */
.auth-wrap {
  display: flex; justify-content: center; align-items: center;
  min-height: calc(100vh - 120px); padding: 2rem;
}
.auth-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem; width: 100%; max-width: 400px;
  box-shadow: var(--shadow);
}
.auth-logo { font-size: 2.5rem; text-align: center; margin-bottom: .75rem; }
.auth-card h2 { text-align: center; margin-bottom: 1.5rem; font-size: 1.4rem; }
.auth-switch { text-align: center; margin-top: 1.25rem; font-size: .88rem; color: var(--text2); }

.field { margin-bottom: 1rem; }
.field label { display: block; margin-bottom: .35rem; font-size: .85rem; color: var(--text2); }
.field input {
  width: 100%; background: var(--bg3);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  color: var(--text); padding: .6rem .9rem; font-size: .95rem;
  transition: border-color .2s;
}
.field input:focus { outline: none; border-color: var(--accent); }
.muted { color: var(--text3); font-size: .8rem; }

/* ── Detail Page ─────────────────────────────────────────────────────────── */
.detail-wrap { max-width: 1000px; margin: 0 auto; padding: 1.5rem; }
.detail-back { margin-bottom: 1rem; font-size: .9rem; }
.detail-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
.detail-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap;
}
.detail-title-block h1 { font-size: 1.8rem; margin-bottom: .5rem; }
.detail-meta { display: flex; flex-wrap: wrap; gap: .4rem; }
.tag-ort     { background: var(--bg3); color: var(--text2); }
.tag-branche { background: #dbeafe; color: var(--accent); }
.detail-actions { display: flex; gap: .5rem; flex-wrap: wrap; }

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}
.detail-section { }
.detail-wide { grid-column: 1/-1; }
.detail-section h3 {
  font-size: 1rem; color: var(--text2);
  margin-bottom: .75rem;
  padding-bottom: .4rem; border-bottom: 1px solid var(--border);
}

.data-list { display: grid; grid-template-columns: auto 1fr; gap: .35rem .75rem; }
.data-list dt { color: var(--text3); font-size: .85rem; }
.data-list dd { font-size: .9rem; }

.rating-big { display: flex; align-items: center; gap: .75rem; margin-bottom: .75rem; }
.rating-circle {
  width: 56px; height: 56px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; font-weight: 800;
}
.rating-label { color: var(--text3); font-size: .85rem; }

.social-links { display: flex; flex-wrap: wrap; gap: .5rem; }
.social-btn {
  padding: .4rem .9rem; border-radius: var(--radius);
  font-size: .82rem; font-weight: 600;
}
.social-fb { background: #dbeafe; color: #1d4ed8; border: 1px solid #93c5fd; }
.social-ig { background: #fce7f3; color: #be185d; border: 1px solid #f9a8d4; }
.social-li { background: #e0f2fe; color: #0369a1; border: 1px solid #7dd3fc; }
.social-xi { background: #dcfce7; color: #15803d; border: 1px solid #86efac; }

.jobs-list { display: flex; flex-direction: column; gap: .5rem; }
.job-item {
  background: var(--bg3); border-radius: var(--radius);
  padding: .7rem 1rem;
}
.job-title { font-weight: 600; font-size: .9rem; }
.job-ort   { font-size: .82rem; color: var(--text2); }
.job-link  { font-size: .82rem; color: var(--accent); }
.badge {
  background: var(--accent); color: #fff;
  border-radius: 50px; padding: .1rem .5rem; font-size: .75rem;
  margin-left: .4rem;
}

/* ── Konto ────────────────────────────────────────────────────────────────── */
.page-wrap { max-width: 1000px; margin: 0 auto; padding: 1.5rem; }
.page-title { font-size: 1.6rem; margin-bottom: 1.5rem; }
.konto-grid {
  display: grid; grid-template-columns: 280px 1fr; gap: 1.5rem;
}
.konto-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.5rem;
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
.konto-card h3 { margin-bottom: 1rem; color: var(--text2); font-size: .95rem; }

.suchen-list { list-style: none; display: flex; flex-direction: column; gap: .5rem; }
.suche-item {
  display: flex; align-items: center; gap: .5rem;
  padding: .5rem .75rem;
  background: var(--bg3); border-radius: var(--radius);
}
.suche-name { flex: 1; font-size: .9rem; color: var(--text); }
.suche-date { font-size: .75rem; color: var(--text3); }
.btn-del {
  background: none; border: none; color: var(--text3);
  cursor: pointer; font-size: 1.1rem; line-height: 1;
}
.btn-del:hover { color: var(--red); }

.input-full {
  width: 100%; background: var(--bg3);
  border: 1.5px solid var(--border); border-radius: var(--radius);
  color: var(--text); padding: .6rem .9rem; font-size: .95rem;
  margin-bottom: 1rem;
}
.modal {
  position: fixed; inset: 0; background: rgba(15,23,42,.4);
  display: flex; align-items: center; justify-content: center; z-index: 999;
}
.modal-box {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 2rem; min-width: 360px;
  box-shadow: var(--shadow);
}
.modal-box h3 { margin-bottom: 1rem; }
.modal-actions { display: flex; gap: .5rem; }

/* ── Worker Pill ──────────────────────────────────────────────────────────── */
.worker-pill {
  font-size: .75rem; color: var(--text3);
}
.worker-pill.online  { color: var(--green); }
.worker-pill.offline { color: var(--red); }

/* ── Footer ──────────────────────────────────────────────────────────────── */
.footer {
  background: var(--bg2); border-top: 1px solid var(--border);
  padding: .75rem 1.5rem; margin-top: auto;
}
.footer-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: center; gap: .5rem;
  font-size: .8rem; color: var(--text3);
}
.footer-sep { color: var(--border); }
.footer-link { color: var(--text3); font-size: .8rem; }
.footer-link:hover { color: var(--text2); text-decoration: none; }

/* ── Legal Pages ─────────────────────────────────────────────────────────── */
.legal-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
  display: flex; flex-direction: column; gap: 1.25rem;
}
.legal-card h2 {
  font-size: 1.05rem; color: var(--text2);
  padding-bottom: .4rem; border-bottom: 1px solid var(--border);
}
.legal-card p, .legal-card ul { font-size: .9rem; color: var(--text); line-height: 1.7; }
.legal-card ul { padding-left: 1.25rem; }
.legal-card ul li { margin-bottom: .35rem; }
.legal-list { margin-bottom: .5rem; }

/* ── Favoriten ───────────────────────────────────────────────────────────── */
.fav-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}
.fav-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.2rem;
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  /* Navbar */
  .nav-inner { padding: .6rem 1rem; }
  .brand-sub  { display: none; }
  .nav-links  { gap: .6rem; }
  .nav-links .btn-nav { display: none; }
  .nav-link   { font-size: .82rem; }

  /* Hero */
  .hero { padding: 2.5rem 1rem 2rem; }
  .hero-title { font-size: 1.8rem; }
  .hero-sub   { font-size: .9rem; margin-bottom: 1.5rem; }

  /* Search Box */
  .search-box {
    flex-direction: column;
    border-radius: var(--radius-lg);
    padding: .6rem;
    gap: .5rem;
  }
  .search-box input { padding: .3rem .4rem; }
  .search-box .btn-primary { width: 100%; border-radius: var(--radius); }

  /* Filter Bar */
  .filter-bar { padding: .6rem .75rem; top: 52px; }
  .filter-inner {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: .5rem;
    padding-bottom: 4px;
  }
  .filter-inner::-webkit-scrollbar { height: 3px; }
  .filter-inner::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
  .filter-select { flex-shrink: 0; }
  .filter-check  { flex-shrink: 0; white-space: nowrap; }
  .branche-picker { flex-shrink: 0; }
  .branche-dropdown { width: 240px; }
  #btn-save-search, #btn-export { flex-shrink: 0; }

  /* Results */
  .results-section { padding: 1rem; }
  .results-grid { grid-template-columns: 1fr; }

  /* Stats Grid */
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-num   { font-size: 1.6rem; }

  /* Pagination */
  .pagination, .pagination-top { flex-wrap: wrap; gap: .3rem; }
  .page-btn { padding: .3rem .6rem; font-size: .8rem; }

  /* Detail Page */
  .detail-wrap  { padding: 1rem; }
  .detail-card  { padding: 1.25rem; }
  .detail-header { flex-direction: column; gap: .75rem; }
  .detail-title-block h1 { font-size: 1.4rem; }
  .detail-actions { width: 100%; }
  .detail-actions .btn-primary,
  .detail-actions .btn-fav { flex: 1; text-align: center; }
  .detail-grid { grid-template-columns: 1fr; }

  /* Konto Page */
  .konto-grid { grid-template-columns: 1fr; }

  /* Modal */
  .modal-box { min-width: unset; width: calc(100vw - 2rem); }

  /* Auth */
  .auth-card { padding: 1.75rem 1.25rem; }

  /* Legende */
  .legende { font-size: .73rem; gap: .4rem 1rem; }

  /* Footer */
  .footer-inner { flex-wrap: wrap; gap: .4rem; }
}

@media (max-width: 480px) {
  /* Navbar — phone */
  .nav-inner { padding: .5rem .75rem; }
  .nav-link-muted { display: none; }

  /* Hero */
  .hero { padding: 2rem .75rem 1.5rem; }
  .hero-title { font-size: 1.5rem; }

  /* Cards */
  .firma-card { padding: .9rem 1rem; }
  .stat-card  { padding: 1rem .75rem; }
  .stat-num   { font-size: 1.4rem; }

  /* Detail */
  .detail-card { padding: 1rem; }
  .detail-title-block h1 { font-size: 1.25rem; }

  /* Branche dropdown — align to screen edge */
  .branche-dropdown {
    position: fixed;
    left: .75rem;
    right: .75rem;
    width: auto;
    top: auto;
  }

  /* Konto Card */
  .konto-card { padding: 1rem; }

  /* Modal full screen */
  .modal-box {
    width: calc(100vw - 1.5rem);
    padding: 1.25rem;
  }

  /* Fav grid */
  .fav-grid { grid-template-columns: 1fr; }

  /* Touch targets — min 44px */
  .btn-primary, .btn-outline, .btn-ghost, .btn-nav,
  .filter-select, .branche-btn, .page-btn {
    min-height: 44px;
  }
  .filter-check { min-height: 44px; }
}

/* ── NEU Ribbon ──────────────────────────────────────────────────────────── */
.firma-card { position: relative; overflow: hidden; }
.firma-card-neu { border-color: #16a34a; }
.neu-ribbon {
  position: absolute;
  top: 10px; right: -22px;
  background: #16a34a;
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .06em;
  padding: 3px 28px;
  transform: rotate(35deg);
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
  pointer-events: all;
  cursor: pointer;
  z-index: 2;
  user-select: none;
}
.neu-ribbon:hover {
  background: #15803d;
}

/* ── Legende ─────────────────────────────────────────────────────────────── */
.legende {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem 1.4rem;
  align-items: center;
  padding: .5rem 1rem;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .78rem;
  color: var(--text2);
  margin: 0 0 .8rem;
}
.legende-item {
  display: flex;
  align-items: center;
  gap: .35rem;
}
.neu-ribbon-mini {
  display: inline-block;
  background: #16a34a;
  color: #fff;
  font-size: .6rem;
  font-weight: 700;
  letter-spacing: .05em;
  padding: 1px 6px;
  border-radius: 3px;
}

/* ── Export Button ───────────────────────────────────────────────────────── */
.btn-export {
  color: #16a34a;
  border-color: #16a34a;
  text-decoration: none;
}
.btn-export:hover { background: #f0fdf4; }

/* ── Sort-Select im Hero ─────────────────────────────────────────────────── */
.search-box { flex-wrap: wrap; }
.sort-hero-select {
  flex: 0 0 auto;
  font-size: .85rem;
  padding: .45rem .7rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg2);
  color: var(--text1);
  cursor: pointer;
}
@media (max-width: 600px) {
  .sort-hero-select { flex-shrink: 0; min-width: 140px; }
}

/* ── Rating Legende (Detail-Seite) ───────────────────────────────────────── */
.legende-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.2rem;
  height: 1.2rem;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  margin-left: .5rem;
  vertical-align: middle;
  line-height: 1;
}
.legende-btn:hover { opacity: .85; }

.rating-legende-box {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  margin: .8rem 0 1rem;
  font-size: .82rem;
}
.legende-header {
  font-weight: 700;
  font-size: .9rem;
  margin-bottom: .5rem;
  color: var(--text1);
}
.legende-intro {
  margin: 0 0 .8rem;
  color: var(--text2);
  line-height: 1.5;
}
.legende-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: .8rem;
}
.legende-table th {
  text-align: left;
  font-size: .75rem;
  color: var(--text2);
  font-weight: 600;
  padding: .3rem .5rem;
  border-bottom: 1px solid var(--border);
}
.legende-table td {
  padding: .3rem .5rem;
  border-bottom: 1px solid var(--border);
  color: var(--text1);
  font-size: .8rem;
  line-height: 1.4;
}
.legende-table td:nth-child(2) {
  text-align: center;
  color: var(--accent);
  font-weight: 700;
  white-space: nowrap;
}
.legende-examples {
  color: var(--text2);
  font-size: .78rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .4rem;
}

/* ── Kriterien Checklist ─────────────────────────────────────────────────── */
.kriterien-list {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin: .6rem 0 .8rem;
}
.kriterium {
  font-size: .75rem;
  padding: .2rem .55rem;
  border-radius: 999px;
  font-weight: 600;
}
.kriterium.ok  { background: #166534; color: #bbf7d0; }
.kriterium.nok { background: #7f1d1d; color: #fecaca; }
