/*
 * Schulungskalender-Widget — Stylesheet aus handoff/-Mockups extrahiert.
 * Ref #627. Quellen:
 *   handoff/mockups/01-vollkalender-default.html
 *   handoff/mockups/02-card-zustaende.html
 *   handoff/mockups/04-termin-tile.html
 *   handoff/mockups/05-schulungsart-iframe.html
 *   handoff/mockups/06-empty-state.html
 *
 * Eigenes CSS statt Tailwind-Utility-Klassen: die Mockups arbeiten mit
 * CSS-Variablen + benannten Komponenten-Klassen, das ist die definitive
 * Vorgabe (Memory: feedback_schulungskalender_handoff_mockups.md).
 */

:root {
  --primary:      #2C2B80;
  --primary-700:  #23226a;
  --primary-50:   #f4f4fb;
  --accent:       #FF433E;
  --accent-600:   #e83a35;
  --ink:          #0f172a;
  --muted:        #64748b;
  --muted-2:      #94a3b8;
  --line:         #E5E7EB;
  --line-strong:  #D1D5DB;
  --line-2:       #eef0f3;
  --surface:      #ffffff;
  --surface-2:    #F8FAFC;
  --pill:         #F1F5F9;
  --pill-ink:     #1f2937;
  --free:         #0f766e;
  --shadow-sm:    0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .04);
  --shadow-md:    0 6px 16px rgba(15, 23, 42, .08), 0 2px 6px rgba(15, 23, 42, .06);
  --shadow-pop:   0 18px 40px rgba(15, 23, 42, .14), 0 4px 12px rgba(15, 23, 42, .08);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Source Sans 3", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 20% -10%, #eef1f8 0%, transparent 60%),
    radial-gradient(1000px 500px at 110% 10%, #fef3f2 0%, transparent 55%),
    #ffffff;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.widget {
  width: 1200px;
  max-width: 100%;
  margin: 0 auto;
  padding: 24px 16px 60px;
}

/* ===== Filterbar ===================================================== */
.filterbar {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.row-1 { display: block; }
.row-1 .search { width: 100%; }

.row-filters {
  display: grid;
  grid-template-columns: 220px 1fr auto;
  gap: 12px;
  align-items: center;
}
.row-filters .btn-select { width: 100%; justify-content: flex-start; }
.row-filters .btn-select .chev { margin-left: auto; }
.row-filters .cbgroup { justify-self: start; }
.row-filters .ddwrap.sort-trigger-wrap { justify-self: end; }

.row-2 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.search { position: relative; flex: 1 1 auto; min-width: 0; }
.search input {
  width: 100%; height: 42px;
  padding: 0 14px 0 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font: 400 15px/1.2 "Source Sans 3", sans-serif;
  color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
.search input::placeholder { color: var(--muted-2); }
.search input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(44,43,128,.18);
}
.search .icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--muted-2); pointer-events: none;
}
.search .clear {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 24px; height: 24px;
  border: 0; background: transparent; cursor: pointer;
  color: var(--muted-2); border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
}
.search .clear:hover { background: #f1f5f9; color: var(--ink); }

.btn-select {
  height: 42px; padding: 0 12px;
  border: 1px solid var(--line); background: #fff; border-radius: 8px;
  display: inline-flex; align-items: center; gap: 8px;
  font: 600 14px/1 "Source Sans 3", sans-serif;
  color: var(--ink);
  cursor: pointer; white-space: nowrap;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.btn-select:hover { background: #fafbfc; }
.btn-select.is-open,
.btn-select:focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(44,43,128,.18);
}
.btn-select .count {
  background: var(--primary); color: #fff;
  font: 700 11px/1 "Source Sans 3", sans-serif;
  border-radius: 999px; padding: 3px 7px;
}
.btn-select .chev { color: var(--muted); transition: transform .15s; }
.btn-select.is-open .chev { transform: rotate(180deg); }

.ddwrap { position: relative; }
.menu {
  position: absolute; top: calc(100% + 6px); left: 0;
  min-width: 280px;
  background: #fff; border: 1px solid var(--line);
  border-radius: 10px; box-shadow: var(--shadow-pop);
  padding: 6px; z-index: 30;
}
.menu.right { left: auto; right: 0; }
.menu .menu-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 6px;
  font: 400 14px/1.2 "Source Sans 3", sans-serif; color: var(--ink);
  cursor: pointer;
}
.menu .menu-item:hover { background: var(--surface-2); }
.menu .menu-item .check {
  width: 16px; height: 16px; border-radius: 4px;
  border: 1.5px solid #cbd5e1;
  display: inline-flex; align-items: center; justify-content: center;
  background: #fff; color: #fff; flex: 0 0 auto;
}
.menu .menu-item .check svg { display: none; }
.menu .menu-item.is-on .check { background: var(--primary); border-color: var(--primary); }
.menu .menu-item.is-on .check svg { display: block; }
.menu .menu-divider { height: 1px; background: var(--line-2); margin: 6px 4px; }
.menu .menu-foot { display: flex; justify-content: space-between; padding: 6px 6px 4px; }
.menu .linkbtn {
  border: 0; background: transparent; cursor: pointer;
  color: var(--primary); font: 600 13px/1 "Source Sans 3", sans-serif;
  padding: 6px 8px; border-radius: 6px;
}
.menu .linkbtn:hover { background: rgba(44,43,128,.08); }
.menu .radio-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 6px; cursor: pointer;
  font: 400 14px/1.2 "Source Sans 3", sans-serif;
}
.menu .radio-row:hover { background: var(--surface-2); }
.menu .radio {
  width: 16px; height: 16px; border-radius: 50%;
  border: 1.5px solid #cbd5e1; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center; background: #fff;
}
.menu .radio-row.is-on .radio { border-color: var(--primary); }
.menu .radio-row.is-on .radio::after {
  content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--primary);
}

.cbgroup {
  display: inline-flex; align-items: center; gap: 14px;
  padding: 0 4px;
  flex-wrap: wrap; row-gap: 8px;
}
.cb {
  display: inline-flex; align-items: center; gap: 8px;
  cursor: pointer; user-select: none;
  font: 400 14px/1 "Source Sans 3", sans-serif; color: var(--ink);
  position: relative;
}
.cb input { position: absolute; opacity: 0; pointer-events: none; }
.cb .box {
  width: 18px; height: 18px; border-radius: 4px;
  border: 1.5px solid #cbd5e1; background: #fff;
  display: inline-flex; align-items: center; justify-content: center; color: #fff;
  transition: background .12s, border-color .12s, box-shadow .12s;
}
.cb .box svg { display: none; }
.cb input:focus-visible + .box {
  box-shadow: 0 0 0 3px rgba(44,43,128,.22); border-color: var(--primary);
}
.cb input:checked + .box { background: var(--primary); border-color: var(--primary); }
.cb input:checked + .box svg { display: block; }

.pill-btn {
  height: 34px; padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line); background: #fff;
  font: 600 13px/1 "Source Sans 3", sans-serif;
  color: var(--ink); cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
}
.pill-btn:hover { background: #fafbfc; }
.pill-btn.is-on {
  background: var(--primary); border-color: var(--primary); color: #fff;
}

.vsep { width: 1px; height: 22px; background: var(--line); margin: 0 4px; }

.date-field {
  display: inline-flex; align-items: center; gap: 8px;
  height: 34px; padding: 0 10px 0 12px;
  border: 1px solid var(--line); border-radius: 8px; background: #fff;
}
.date-field label {
  font: 600 12px/1 "Source Sans 3", sans-serif; color: var(--muted);
  letter-spacing: .04em; text-transform: uppercase;
}
.date-field input {
  border: 0; outline: none; background: transparent;
  font: 400 14px/1 "Source Sans 3", sans-serif; color: var(--ink);
  width: 130px;
}
.date-field:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(44,43,128,.18);
}

/* ===== Trefferanzahl + Reset ========================================= */
.results-meta {
  margin: 16px 4px 12px;
  font: 400 14px/1.2 "Source Sans 3", sans-serif;
  color: #6b7280;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
}
.results-meta strong { color: var(--ink); font-weight: 700; }
.results-meta .sort-hint { color: var(--muted-2); font-size: 13px; }
.reset-btn {
  border: 0; background: transparent; cursor: pointer;
  color: var(--primary); font: 600 13px/1 "Source Sans 3", sans-serif;
  padding: 6px 8px; border-radius: 6px;
  display: inline-flex; align-items: center; gap: 6px;
}
.reset-btn:hover { background: rgba(44,43,128,.08); }

/* ===== Card (Schulungsart) =========================================== */
.grid { display: grid; grid-template-columns: 1fr; gap: 14px; }

.card {
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .18s ease, border-color .18s ease;
  overflow: hidden;
}
.card:hover {
  box-shadow: var(--shadow-md);
  border-color: #dfe3ea;
}
.card-body { padding: 22px 24px; }
.card-head { display: flex; flex-direction: column; gap: 4px; margin-bottom: 18px; }
.card-title {
  color: var(--primary);
  font: 600 20px/1.25 "Source Sans 3", sans-serif;
  margin: 0; letter-spacing: -.005em;
}
.card-sub {
  color: #6b7280; font: 400 14px/1.45 "Source Sans 3", sans-serif; margin: 0;
}

.card-mid {
  display: flex; align-items: center; gap: 24px; justify-content: space-between;
}
.price-block { display: flex; align-items: flex-end; gap: 18px; }
.price-col { display: flex; flex-direction: column; gap: 2px; }
.price-col .amount {
  font: 700 22px/1.1 "Source Sans 3", sans-serif;
  color: var(--ink); letter-spacing: -.01em;
}
.price-col .label {
  font: 600 11px/1 "Source Sans 3", sans-serif;
  color: var(--muted-2); text-transform: uppercase; letter-spacing: .08em;
}
.price-col .amount.unavailable { color: #94a3b8; font-weight: 600; font-size: 16px; }

.btn-cta {
  border: 0; cursor: pointer;
  background: var(--primary); color: #fff;
  height: 44px; min-width: 160px; padding: 0 16px;
  border-radius: 8px;
  font: 700 14px/1 "Source Sans 3", sans-serif;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: background .15s, box-shadow .15s, transform .05s;
  flex: 0 0 auto;
  white-space: nowrap;
}
.btn-cta:hover { background: var(--primary-700); }
.btn-cta:active { transform: translateY(1px); }
.btn-cta:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(44,43,128,.35);
}
.btn-cta .chev { transition: transform .2s ease; }
.btn-cta.is-open .chev { transform: rotate(180deg); }
.btn-cta.is-disabled,
.btn-cta:disabled {
  background: #fff; color: var(--primary);
  border: 1.5px solid var(--primary);
  cursor: not-allowed;
}
.btn-cta.is-disabled:hover { background: #f4f4fb; }

/* Tags-Leiste (unten) */
.tags {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-top: 18px; padding-top: 18px;
  border-top: 1px dashed var(--line);
}
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--pill); color: var(--pill-ink);
  border-radius: 999px;
  padding: 5px 10px 5px 8px;
  font: 600 12px/1 "Source Sans 3", sans-serif;
}
.tag svg { color: #475569; }
.tag .tag-key { color: #475569; font-weight: 600; }
.tag .tag-val { color: var(--ink); font-weight: 700; }

/* Single-Termin-Zeile direkt in der Card (Variante 3) */
.single-termin {
  margin-top: 14px;
  font: 400 13px/1.4 "Source Sans 3", sans-serif;
  color: #334155;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.single-termin::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--primary); flex: 0 0 auto;
}
.single-termin .sep { color: var(--muted-2); }
.single-termin .free { color: var(--free); font-weight: 700; }

/* Muted-Zustand (keine Termine verfügbar) */
.card.is-muted .card-title { color: #64748b; }
.card.is-muted .card-sub { color: #94a3b8; }
.card.is-muted .price-col .amount { color: #64748b; }
.card.is-muted .tag { background: #f1f5f9; color: #64748b; }
.card.is-muted .tag .tag-val { color: #475569; }
.card.is-muted .tag svg { color: #94a3b8; }

/* ===== Akkordeon mit Termin-Reihen =================================== */
.accordion {
  border-top: 1px solid var(--line);
  background: #fff;
  padding: 14px 24px 22px;
  display: none;
}
.accordion.is-open { display: block; }
.acc-head {
  font: 700 12px/1 "Source Sans 3", sans-serif; color: var(--muted);
  text-transform: uppercase; letter-spacing: .08em;
  margin: 8px 2px 12px;
}
.term {
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex; align-items: center; gap: 18px; justify-content: space-between;
  margin-bottom: 8px;
}
.term:last-child { margin-bottom: 0; }
.term.is-soldout { background: #fafafc; }
.term-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.term-line1 {
  font: 700 15px/1.2 "Source Sans 3", sans-serif; color: var(--ink);
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.term-line1 .sep { color: var(--muted-2); font-weight: 400; }
.term-line2 {
  font: 400 14px/1.3 "Source Sans 3", sans-serif; color: #334155;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.term-line2 .pin { display: inline-flex; align-items: center; gap: 4px; }
.term-line2 .pin svg { color: var(--muted); }
.term-line2 .sep { color: var(--muted-2); }
.term-line2 .price { color: var(--ink); font-weight: 700; }
.term-line2 .free { color: var(--free); font-weight: 600; }
.term-line2 .soldout { color: var(--accent); font-weight: 700; }
.term-line3 {
  font: 400 12px/1.2 "Source Sans 3", sans-serif; color: var(--muted-2);
  display: inline-flex; align-items: center; gap: 6px;
}
.term-line3 svg { color: var(--muted-2); }
.btn-mini {
  flex: 0 0 auto;
  border: 0; cursor: pointer;
  background: var(--primary); color: #fff;
  height: 36px; padding: 0 16px;
  border-radius: 8px;
  font: 700 13px/1 "Source Sans 3", sans-serif;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  white-space: nowrap;
  text-decoration: none;
  transition: background .15s;
}
.btn-mini:hover { background: var(--primary-700); }
.btn-mini.is-disabled,
.btn-mini:disabled {
  background: #e5e7eb; color: #94a3b8; cursor: not-allowed;
}
.btn-mini.is-disabled:hover { background: #e5e7eb; }

/* ===== Termin-Tile (standalone, Einzel-Iframe) ======================= */
.tile {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px 18px;
  display: flex; align-items: center; gap: 24px; justify-content: space-between;
  box-shadow: var(--shadow-sm);
}
.tile + .tile { margin-top: 12px; }
.tile.is-muted { background: #fafafc; }
.tile-info { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1 1 auto; }
.row-date {
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
  font: 400 14px/1.2 "Source Sans 3", sans-serif; color: var(--muted);
}
.row-date .date { font: 700 16px/1.2 "Source Sans 3", sans-serif; color: var(--primary); }
.row-date .sep { color: var(--muted-2); }
.row-meta {
  display: flex; align-items: center; gap: 8px;
  font: 400 14px/1.35 "Source Sans 3", sans-serif; color: #374151;
}
.row-meta.muted-line { color: #4b5563; }
.row-meta svg { color: var(--muted); flex: 0 0 auto; }
.row-meta .sep { color: var(--muted-2); }
.row-meta .free { color: var(--free); font-weight: 600; }
.row-meta .soldout { color: var(--accent); font-weight: 700; }
.row-meta .price { color: var(--ink); font-weight: 700; }

.btn-action {
  flex: 0 0 auto;
  height: 42px; padding: 0 20px;
  border: 0; border-radius: 8px;
  background: var(--primary); color: #fff;
  font: 600 14px/1 "Source Sans 3", sans-serif;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  cursor: pointer; white-space: nowrap;
  text-decoration: none;
  transition: background .15s;
}
.btn-action:hover { background: var(--primary-700); }
.btn-action.is-disabled,
.btn-action:disabled {
  background: #f3f4f6; color: #9ca3af; cursor: not-allowed;
}
.btn-action.is-disabled:hover { background: #f3f4f6; }

/* ===== Empty-State =================================================== */
.empty-card {
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow-sm);
  padding: 64px 32px 72px;
  display: flex; flex-direction: column; align-items: center;
  text-align: center;
}
/* HTML-hidden respektieren (Spezifizitaet schlaegt sonst .empty-card). */
.empty-card[hidden] { display: none; }
.empty-icon {
  width: 96px; height: 96px;
  background: var(--surface-2);
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: #cbd5e1; margin-bottom: 28px;
}
.empty-icon-search { margin-bottom: 36px; }
.empty-title {
  font: 600 18px/1.4 "Source Sans 3", sans-serif;
  color: #374151; margin: 0 0 10px; max-width: 520px;
}
.empty-text {
  margin: 0 0 28px; max-width: 480px;
  color: var(--muted); font: 400 14px/1.6 "Source Sans 3", sans-serif;
}
.btn-reset {
  height: 42px; padding: 0 20px;
  border: 1.5px solid var(--primary); background: #fff;
  color: var(--primary); border-radius: 8px;
  font: 600 14px/1 "Source Sans 3", sans-serif;
  display: inline-flex; align-items: center; gap: 10px;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.btn-reset:hover { background: var(--primary); color: #fff; }
.btn-reset svg { color: var(--primary); transition: color .15s; }
.btn-reset:hover svg { color: #fff; }

/* ===== Mobile Filter-Toggle-Bar (≤ 640 px) =========================== */
.filterbar-mobile { display: none; }
.m-filter-btn,
.m-sort-btn {
  height: 46px;
  border-radius: 10px;
  font: 700 15px/1 "Source Sans 3", sans-serif;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  transition: background .15s, border-color .15s;
}
.m-filter-btn {
  flex: 1 1 auto;
  border: 1.5px solid var(--primary);
  background: #fff; color: var(--primary);
}
.m-filter-btn:hover { background: var(--primary-50); }
.m-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 22px; padding: 0 7px;
  background: var(--primary); color: #fff;
  border-radius: 999px;
  font: 700 12px/1 "Source Sans 3", sans-serif;
}
.m-sort-btn {
  width: 46px; flex: 0 0 auto;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
}
.m-sort-btn:hover { background: var(--surface-2); }

/* ===== Drawer-Host =================================================== */
.drawer-host { position: fixed; inset: 0; z-index: 90; }
.drawer-host[hidden] { display: none; }
.drawer-scrim {
  position: absolute; inset: 0;
  background: rgba(15, 23, 42, .45);
  animation: drawer-fade .18s ease-out;
}
.drawer {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: #fff;
  border-top-left-radius: 18px; border-top-right-radius: 18px;
  box-shadow: 0 -8px 32px rgba(15, 23, 42, .18);
  max-height: 88vh;
  display: flex; flex-direction: column;
  overflow: hidden;
  animation: drawer-slide .22s cubic-bezier(.2, .8, .2, 1);
}
@keyframes drawer-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes drawer-slide { from { transform: translateY(100%); } to { transform: translateY(0); } }
.drawer-handle {
  display: flex; justify-content: center; padding: 8px 0 4px;
}
.drawer-handle::before {
  content: ""; width: 40px; height: 4px;
  border-radius: 999px; background: #cbd5e1;
}
.drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 16px 12px;
  border-bottom: 1px solid var(--line);
}
.drawer-head h3 {
  margin: 0; font: 700 18px/1.2 "Source Sans 3", sans-serif; color: var(--ink);
}
.drawer-close {
  width: 32px; height: 32px; border-radius: 8px;
  border: 0; background: var(--surface-2); color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.drawer-close:hover { background: #e5e7eb; color: var(--ink); }
.drawer-body {
  flex: 1; overflow-y: auto;
  padding: 6px 16px 16px;
  -webkit-overflow-scrolling: touch;
}
.drawer-section { padding: 14px 0; border-bottom: 1px solid var(--line-2); }
.drawer-section:last-child { border-bottom: 0; }
.drawer-h {
  font: 700 12px/1 "Source Sans 3", sans-serif; color: var(--muted);
  text-transform: uppercase; letter-spacing: .08em; margin: 0 0 12px;
}
.drawer-section .search { width: 100%; }
.drawer-section .search input { height: 42px; }

.topic-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
.topic-grid .chip {
  display: inline-flex; align-items: center; gap: 8px;
  height: 42px; padding: 0 12px;
  border: 1px solid var(--line); background: #fff; border-radius: 10px;
  font: 600 13px/1.2 "Source Sans 3", sans-serif; color: var(--ink);
  cursor: pointer; user-select: none;
  transition: background .12s, border-color .12s, color .12s;
}
.topic-grid .chip:focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(44, 43, 128, .18);
}
.topic-grid .chip-check {
  width: 16px; height: 16px; border-radius: 4px;
  border: 1.5px solid #cbd5e1; background: #fff; color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  flex: 0 0 auto;
}
.topic-grid .chip-check svg { display: none; }
.topic-grid .chip-label {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  min-width: 0;
}
.topic-grid .chip.is-on {
  background: var(--primary-50);
  border-color: var(--primary);
  color: var(--primary);
}
.topic-grid .chip.is-on .chip-check {
  background: var(--primary); border-color: var(--primary);
}
.topic-grid .chip.is-on .chip-check svg { display: block; }

.m-pill-row { display: flex; gap: 8px; }
.m-pill {
  flex: 1; height: 38px; border-radius: 999px;
  border: 1px solid var(--line); background: #fff;
  font: 600 13px/1 "Source Sans 3", sans-serif; color: var(--ink);
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.m-pill.is-on { background: var(--primary); border-color: var(--primary); color: #fff; }

.m-date-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.m-date-field {
  border: 1px solid var(--line); border-radius: 10px; background: #fff;
  padding: 8px 12px;
  display: flex; flex-direction: column; gap: 2px;
}
.m-date-field label {
  font: 600 11px/1 "Source Sans 3", sans-serif; color: var(--muted);
  text-transform: uppercase; letter-spacing: .06em;
}
.m-date-field input {
  border: 0; outline: none; background: transparent;
  font: 400 14px/1.2 "Source Sans 3", sans-serif; color: var(--ink);
  padding: 2px 0; min-width: 0; width: 100%;
}

.m-cb-stack { display: flex; flex-direction: column; gap: 12px; }
.m-cb {
  display: flex; align-items: center; gap: 10px; cursor: pointer;
  font: 400 14px/1.2 "Source Sans 3", sans-serif; color: var(--ink);
  position: relative;
}
.m-cb input { position: absolute; opacity: 0; pointer-events: none; }
.m-cb .box {
  width: 20px; height: 20px; border-radius: 5px;
  border: 1.5px solid #cbd5e1; background: #fff;
  display: inline-flex; align-items: center; justify-content: center; color: #fff;
  flex: 0 0 auto;
  transition: background .12s, border-color .12s;
}
.m-cb .box svg { display: none; }
.m-cb input:checked + .box { background: var(--primary); border-color: var(--primary); }
.m-cb input:checked + .box svg { display: block; }
.m-cb input:focus-visible + .box {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(44, 43, 128, .22);
}

.m-sort-list { display: flex; flex-direction: column; gap: 4px; }
.m-sort-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 4px; border-radius: 8px; cursor: pointer;
  font: 400 14px/1.2 "Source Sans 3", sans-serif; color: var(--ink);
}
.m-sort-row:hover { background: var(--surface-2); }
.m-sort-row:focus-visible { outline: none; background: var(--surface-2); box-shadow: 0 0 0 2px rgba(44, 43, 128, .25); }
.m-radio {
  width: 18px; height: 18px; border-radius: 50%;
  border: 1.5px solid #cbd5e1; background: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  flex: 0 0 auto;
}
.m-sort-row.is-on .m-radio { border-color: var(--primary); }
.m-sort-row.is-on .m-radio::after {
  content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--primary);
}

.drawer-foot {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: #fff;
}
.m-reset {
  border: 0; background: transparent; cursor: pointer;
  color: var(--primary); font: 700 14px/1 "Source Sans 3", sans-serif;
  padding: 10px 12px; border-radius: 8px; flex: 0 0 auto;
}
.m-reset:hover { background: var(--primary-50); }
.m-apply {
  flex: 1; height: 46px; border: 0; border-radius: 10px;
  background: var(--primary); color: #fff;
  font: 700 15px/1 "Source Sans 3", sans-serif; cursor: pointer;
  transition: background .15s;
}
.m-apply:hover { background: var(--primary-700); }

body.drawer-open { overflow: hidden; }

/* ===== Einzel-Iframe (Ref #630) ====================================== */
/* Iframe-Modus: WordPress-Seite drumherum liefert den Rahmen, Body wird
   transparent, Container schmaler. Spezifizitaet (0,1,1) > body (0,0,1). */
body.is-einzel {
  background: transparent;
}
body.is-einzel .widget {
  width: 1000px;
  padding: 16px 12px 32px;
}

.count-line {
  color: #6b7280; font: 400 13px/1.2 "Source Sans 3", sans-serif;
  margin: 0 4px 14px;
}
.count-line strong { color: var(--ink); font-weight: 700; }

/* Empty-State im Iframe-Modus (Mockup A6 Variante B) -- kompaktere
   Variante als die grosse .empty-card aus dem Sammelkalender. */
.tiles-empty {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 48px 24px;
  text-align: center;
  color: #6b7280;
  font: 400 14px/1.6 "Source Sans 3", sans-serif;
}
.tiles-empty-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--primary-50); color: var(--primary);
  margin-bottom: 14px;
}
.tiles-empty p {
  margin: 0; max-width: 480px; margin-inline: auto;
}
.tiles-empty.has-action p { margin-bottom: 22px; }

/* Outline-Button "Zurueck zur Schulungsuebersicht" auf 404-Seite (Ref #634).
   Eigene Klasse statt Reuse von .btn-reset, weil semantisch anders und
   .btn-reset das X-Icon-spezifische Layout bedient. */
.btn-back {
  display: inline-flex; align-items: center; gap: 8px;
  height: 42px; padding: 0 20px;
  border: 1.5px solid var(--primary);
  background: #fff; color: var(--primary);
  border-radius: 8px;
  font: 600 14px/1 "Source Sans 3", sans-serif;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.btn-back:hover { background: var(--primary); color: #fff; }

/* ===== Mobile (≤ 640 px) ============================================ */
@media (max-width: 640px) {
  .widget { padding: 14px 12px 40px; }
  body.is-einzel .widget { padding: 12px 8px 24px; }

  /* Desktop-Filterbar weg, Mobile-Toggle-Bar rein. */
  .filterbar { display: none; }
  .filterbar-mobile {
    display: flex; gap: 10px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    padding: 10px 12px;
    margin-bottom: 14px;
  }

  /* Empty-State Padding etwas knapper. */
  .empty-card { padding: 48px 20px 56px; }
  .empty-icon { width: 80px; height: 80px; margin-bottom: 24px; }
  .empty-icon svg { width: 56px; height: 56px; }

  .card-body { padding: 18px 16px; }
  .card-mid { flex-direction: column; align-items: stretch; gap: 14px; }
  .price-block { justify-content: space-between; }
  .btn-cta { width: 100%; }

  .term { flex-direction: column; align-items: stretch; gap: 12px; }
  .btn-mini { width: 100%; height: 42px; }

  .tile { flex-direction: column; align-items: stretch; gap: 14px; }
  .btn-action { width: 100%; height: 46px; }

  .accordion { padding: 14px 16px 18px; }
}
