:root, :host {
  --awo-rot: #e2001a;
  --awo-rot-dunkel: #b50015;
  --text: #1d1d1f;
  --text-muted: #5f6368;
  --line: #e3e3e6;
  --bg: #ffffff;
  --bg-soft: #f6f6f8;
  --biete-bg: #fdecee;
  --biete-text: #9b0012;
  --radius: 12px;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.05), 0 4px 16px rgb(0 0 0 / 0.04);
}

/* Eigene Seite */
body { margin: 0; background: var(--bg); }

/* Container des Pools – auf der eigenen Seite und eingebettet */
.kp {
  display: block;
  margin: 0 auto;
  padding: 32px 20px 48px;
  max-width: 1200px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  line-height: 1.5;
  text-align: left;
}
.kp *, .kp *::before, .kp *::after { box-sizing: border-box; }

/* Eingebettet: Schrift vom WordPress-Theme übernehmen, kein eigener Rand */
.kp.is-embedded { padding: 0; max-width: none; font-family: inherit; }

.kp h1, .kp h3, .kp h4, .kp p { margin: 0; }

/* ---------- Kopf ---------- */
.page-header { margin-bottom: 24px; max-width: 720px; }
.eyebrow { color: var(--awo-rot); font-weight: 600; font-size: 0.85rem; }
h1 { font-size: clamp(1.8rem, 3vw, 2.4rem); line-height: 1.15; margin: 4px 0 8px; }
.lead { color: var(--text-muted); font-size: 1.05rem; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; margin-bottom: 12px; border-bottom: 1px solid var(--line); }
.tabs [role="tab"] {
  font: inherit;
  font-weight: 600;
  padding: 10px 16px;
  margin-bottom: -1px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
}
.tabs [role="tab"][aria-selected="true"] { color: var(--text); border-bottom-color: var(--awo-rot); }
.tabs [role="tab"]:hover { color: var(--text); }

/* ---------- Filter ---------- */
.filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px 16px;
  padding: 16px;
  background: var(--bg-soft);
  border-radius: var(--radius);
}
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field-search { grid-column: 1 / -1; }
.field label, .field legend { font-size: 0.8rem; font-weight: 600; color: var(--text-muted); }

input[type="search"], select {
  font: inherit;
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
}

input:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 2px solid var(--awo-rot);
  outline-offset: 2px;
}

.segmented { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.segmented legend { grid-column: 1 / -1; margin-bottom: 4px; padding: 0; }
.segmented label {
  display: flex;
  justify-content: center;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
}
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label:has(input:checked) { border-color: var(--awo-rot); background: var(--biete-bg); color: var(--biete-text); }
.segmented label:has(input:focus-visible) { outline: 2px solid var(--awo-rot); outline-offset: 2px; }

.results-bar { display: flex; align-items: center; gap: 16px; margin: 20px 0 12px; }
#count { font-weight: 600; }
.link-button { font: inherit; background: none; border: 0; padding: 0; color: var(--awo-rot); cursor: pointer; text-decoration: underline; }

/* ---------- Karten ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; align-items: stretch; }

.card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  box-shadow: var(--shadow);
}
.card-head { display: flex; gap: 12px; align-items: flex-start; }
.avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--awo-rot);
  color: #fff;
  font-weight: 700;
}
.card h3 { font-size: 1.1rem; line-height: 1.3; }
.meta { font-size: 0.88rem; color: var(--text-muted); }
.meta-light { color: #80868b; }
.stand { font-size: 0.75rem; color: #80868b; margin-top: -4px; }
.about { font-size: 0.92rem; color: var(--text); }
.about-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font: inherit;
  font-size: 0.82rem;
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
  border: 1px solid transparent;
  background: var(--bg-soft);
  color: var(--text);
}
button.chip { cursor: pointer; transition: border-color 0.15s ease; }
button.chip:hover { border-color: currentColor; }
.chip-feld { background: var(--biete-bg); color: var(--biete-text); }
.chip-tag { background: none; padding: 0 6px 0 0; color: var(--text-muted); }
button.chip-tag:hover { color: var(--awo-rot); border-color: transparent; }

.more { margin-top: auto; border-top: 1px solid var(--line); padding-top: 10px; }
.more summary { cursor: pointer; font-weight: 600; font-size: 0.9rem; color: var(--awo-rot); list-style: none; }
.more summary::-webkit-details-marker { display: none; }
.more summary::after { content: " ▾"; }
.more[open] summary::after { content: " ▴"; }
.detail { margin-top: 12px; font-size: 0.92rem; }
.detail h4 { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 4px; }

.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.button {
  display: inline-block;
  padding: 7px 14px;
  border-radius: 8px;
  background: var(--awo-rot);
  color: #fff;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
}
.button:hover { background: var(--awo-rot-dunkel); }

.empty { grid-column: 1 / -1; padding: 40px; text-align: center; color: var(--text-muted); background: var(--bg-soft); border-radius: var(--radius); }

@media (max-width: 480px) {
  .kp:not(.is-embedded) { padding: 20px 14px 32px; }
  .grid { grid-template-columns: 1fr; }
}

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

.field[hidden] { display: none; }

.chip-active { background: var(--text); color: #fff; cursor: pointer; }

/* ---------- Angebote ---------- */
.badges { display: flex; gap: 6px; }
.format-badge, .draft-badge {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
}
.format-badge { background: var(--awo-rot); color: #fff; }
.draft-badge { background: #fff4d6; color: #7a5200; }
.card-angebot > p { font-size: 0.92rem; }

.anbieter {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.anbieter > div:nth-child(2) { flex: 1; min-width: 0; }
.anbieter-name { font-weight: 600; font-size: 0.92rem; }
.avatar-small { width: 32px; height: 32px; font-size: 0.8rem; }
.button-ghost { background: none; color: var(--awo-rot); border: 1px solid var(--awo-rot); cursor: pointer; font: inherit; font-size: 0.85rem; font-weight: 600; padding: 6px 10px; }
.button-ghost:hover { background: var(--biete-bg); }

.angebot-links ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.angebot-links .link-button { text-align: left; text-decoration: none; font-size: 0.9rem; color: var(--text); }
.angebot-links .link-button:hover { color: var(--awo-rot); }
.format-mini {
  display: inline-block;
  margin-right: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--awo-rot);
}

/* ---------- Plus-Button (Formular-Links) ---------- */
.add-button { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px 6px 10px; }
.add-plus { font-size: 1.25rem; line-height: 1; font-weight: 700; }
.add-button.is-missing { opacity: 0.55; cursor: not-allowed; }
@media (max-width: 480px) { #add-label { display: none; } .add-button { padding: 6px 12px; } }
