/* ============================================================================
   ocellio — Wissen v3 (a45, Spec 2026-09-29 §5.2): Suchfeld, Schnellfilter,
   „Neu & geändert nach Projekt", Zuletzt angesehen, Gut vernetzt, Skills,
   Treffer mit Aufklapper und Relevanzbalken, Facetten innerhalb der Treffer.
   Nur Tokens (tokens.css); datengetriebene Maße über w-N, Projektfarbe über
   pjb-N → --pj-cur, Kind-Farbe über k-{slug} — nie per Inline-Style (CSP).
   Lädt vor layout.css/components.css; die Klassen hier sind eigene (wx-),
   geteilte Bausteine (.pv-label/.pv-card, .fx-nbs/.nb-chip, .new-dot) kommen
   aus puls.css, Chips/Kontext-Auswahl/Tokens aus components.css.
   Mobil (< 768 px) einspaltig, Touch-Ziele ≥ 44 px; prefers-reduced-motion
   ohne Übergänge.
   ============================================================================ */

/* ---- Runde Kind-Badges (Spec §4.3): .kb aus explorer.css, eine Quelle seit
   a44 (lädt auf jeder Seite); hier nur die Größen. Initialen ≥ 12 px wie
   überall (vorher 11/10/9 px); 18 wird zum .kb-Standard 20 px. --------- */
.kb.wx-kb26 { width: 26px; height: 26px; font-size: 13px; }
.kb.wx-kb22 { width: 22px; height: 22px; font-size: 12px; }
.kb.wx-kb18 { width: 20px; height: 20px; font-size: 12px; }

/* ---- Suchfeld (Pill, Spec §5.2) ------------------------------------------ */
.wx-search { margin: 0 0 14px; }
.wx-field { display: flex; align-items: center; gap: 10px; min-width: 0;
  padding: 12px 18px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 999px; cursor: text; transition: border-color .15s, box-shadow .15s; }
.wx-search.is-active .wx-field { padding: 10px 16px; }
.wx-field:focus-within, .wx-search.is-active .wx-field {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--glow); }
.wx-ico { flex: none; color: var(--muted); }
.wx-input { flex: 1 1 auto; min-width: 0; padding: 0; border: 0; border-radius: 0;
  background: transparent; color: var(--fg); font: inherit; font-size: 16px; }
.wx-input:focus { outline: none; box-shadow: none; }
.wx-input::-webkit-search-cancel-button { display: none; }
.wx-clear { flex: none; display: grid; place-items: center; width: 28px; height: 28px;
  margin: -4px 0; border-radius: 50%; color: var(--muted); font-size: 18px; line-height: 1; }
.wx-clear:hover { background: var(--raised); color: var(--fg); }
.wx-hint { flex: none; font-size: 12px; color: var(--muted); white-space: nowrap; }

/* ---- Schnellfilter (Startansicht) --------------------------------------- */
.wx-quick { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px;
  margin: 0 0 22px; }
.wx-quick-label { font-size: 12px; color: var(--muted); }
.wx-chips { flex: 0 1 auto; gap: 6px; }
.wx-chips .chip { padding: 4px 11px; font-size: 12.5px; background: var(--panel);
  border-color: var(--line); color: var(--fg); }
.wx-chips .chip:hover { border-color: var(--faint2); }
.chip-n { color: var(--muted); font-variant-numeric: tabular-nums; }
.chip.is-active .chip-n { color: inherit; }
.chip .kdot { vertical-align: middle; margin-right: 6px; }
.wx-chips .kdot { width: 8px; height: 8px; }
.wx-quick .sel-btn { min-height: 0; padding: 4px 11px; font-size: 12.5px; font-weight: 500;
  background: var(--panel); border-color: var(--line); }
/* Kontext-Auswahl zweispaltig: Name | Zähler am rechten Rand (die Puls-Auswahl
   hat vier Spalten: Frische-Punkt, Name, Zähler, Zeit). */
.wx-quick .wx-ctx-panel .sel-item { grid-template-columns: minmax(0, 1fr) auto; }

/* ---- Zweispalter --------------------------------------------------------- */
.wx-cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; }
@media (min-width: 768px) {
  .wx-cols { grid-template-columns: minmax(0, 1fr) minmax(260px, 340px); }
  .wx-cols-search { grid-template-columns: minmax(0, 1fr) minmax(240px, 300px); }
}
.wx-col-main, .wx-col-side { min-width: 0; }
.wx-col-side, .wx-facets { display: flex; flex-direction: column; gap: 14px; }

/* ---- Startansicht: Projekt-Karten „Neu & geändert" ----------------------- */
.wx-groups { display: flex; flex-direction: column; gap: 10px; }
.wx-group { overflow: hidden; }
.wx-ghead { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 8px;
  padding: 9px 14px; border-bottom: 1px solid var(--line2);
  border-left: 3px solid var(--pj-cur, var(--line)); }
.wx-gtitle { min-width: 0; font-size: 13.5px; font-weight: 700; overflow-wrap: anywhere; }
.wx-group.is-orphan .wx-gtitle { color: var(--muted); font-weight: 600; }
.wx-gsub { font-size: 12px; color: var(--muted); white-space: nowrap; }
.wx-glink { margin-left: auto; font-size: 12px; font-weight: 600; white-space: nowrap; }
.wx-gmore { display: block; padding: 8px 14px; font-size: 12px; font-weight: 600; }
.wx-gmore-projects { display: block; padding: 2px 4px; font-size: 12px; font-weight: 600; }
.wx-list { padding: 6px 8px; }

/* Zeile der Startansicht: Link, grid Badge | Titel/Meta | Zeit. */
.wx-srow { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 12px;
  align-items: center; min-height: 44px; padding: 8px 14px; color: var(--fg); }
.wx-group .wx-srow + .wx-srow, .wx-group .wx-srow + .wx-gmore { border-top: 1px solid var(--line2); }
.wx-list .wx-srow { padding: 8px; border-radius: 8px; }
.wx-srow:hover { background: var(--raised); color: var(--fg); }
.wx-main { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.wx-title { min-width: 0; font-size: 14px; font-weight: 600; line-height: 1.35;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wx-title mark { padding: 0 1px; border-radius: 2px; background: var(--accent-soft); color: inherit; }
.wx-meta { min-width: 0; font-size: 11.5px; color: var(--muted); overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.wx-when { font-size: 12px; color: var(--muted); white-space: nowrap; }
.wx-new { display: inline-block; margin-right: 6px; padding: 1px 5px; border-radius: 3px;
  background: var(--accent-soft); color: var(--accent); font-family: var(--font-display);
  font-size: 9.5px; font-weight: 700; line-height: 1.3; vertical-align: 1px; }
/* Akzent-Text auf --accent-soft (NEU, Aktiv-Tokens, Skills-Link): dunkel
   erreicht --accent auf der Tönung nur 3,4:1 über --panel und 2,9:1 unter dem
   Zeilen-Hover — die Mischung aus --accent-hi und --fg liegt bei 6,9:1 bzw.
   5,9:1 (≥ 4,5:1, a41-Lehre). Hell bleibt --accent (4,7:1). */
:where(:root[data-theme="dark"]) .wx-new, :where(:root[data-theme="dark"]) .wx .fa-token,
:where(:root[data-theme="dark"]) .wx-skills a {
  color: color-mix(in oklab, var(--accent-hi) 60%, var(--fg)); }

/* ---- Rechte Spalte: Zuletzt angesehen, Gut vernetzt, Skills ------------- */
.wx-mini-list { padding: 6px; }
.wx-mini { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 10px;
  align-items: center; min-height: 44px; padding: 4px 8px; border-radius: 7px;
  color: var(--fg); font-size: 13px; }
.wx-mini:hover { background: var(--raised); color: var(--fg); }
.wx-mini-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wx-mini-right { font-size: 11px; color: var(--muted); white-space: nowrap; }
.wx-skills { margin: 0; padding: 10px 12px; background: var(--accent-soft);
  border: 1px solid var(--accent-border); border-radius: var(--r); font-size: 13px;
  line-height: 1.5; color: var(--fg); }
.wx-skills a { font-size: 12px; font-weight: 600; }

/* ---- Suche: Aktiv-Zeile -------------------------------------------------- */
.filter-active.wx-active { margin: 0 0 16px; gap: 8px; }
.wx-resultline { flex: 1 1 auto; margin: 0 0 0 auto; font-size: 12px; color: var(--muted);
  text-align: right; }
.wx-resultline b { color: var(--fg); font-weight: 600; }
.wx-resultline a, .wx-resultline b[aria-current] { white-space: nowrap; }
.wx-jump { display: none; }

/* ---- Treffer: Zeile = <details>, Aufklapp-Panel ------------------------- */
.wx-hits { padding: 6px 8px; }
.wx-hit { border-radius: 8px; }
.wx-hit[open] > .wx-row { background: var(--raised); }
.wx-row { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 12px;
  align-items: center; min-height: 44px; padding: 9px 8px; border-radius: 8px;
  cursor: pointer; list-style: none; }
.wx-row::-webkit-details-marker { display: none; }
.wx-row:hover { background: var(--raised); }
.wx-row .wx-title { font-size: 14.5px; }
.wx-row .pj-dot { margin-right: 0; }
.wx-side-info { display: flex; align-items: center; gap: 12px; }
/* Relevanzbalken: --teal statt --teal-vivid — auf der hellen Spur erreichte
   --teal-vivid nur 1,6:1, der Balken braucht 3:1 (Grafik-Kontrast). */
.wx-rbar { position: relative; display: block; flex: none; width: 54px; height: 4px;
  border-radius: 2px; background: var(--line2); overflow: hidden; }
.wx-rfill { display: block; height: 100%; border-radius: 2px; background: var(--teal); }
.wx-hit[open] .fx-chev { transform: rotate(180deg); }
.wx-panel { display: flex; flex-direction: column; gap: 8px; margin: 0 8px 10px 46px;
  padding: 10px 12px; border-left: 2px solid var(--pj-cur, var(--faint2));
  border-radius: 0 8px 8px 0; background: var(--raised); font-size: 13px; }
.wx-excerpt { margin: 0; color: var(--muted); line-height: 1.5; overflow-wrap: anywhere; }
.wx-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin: 0;
  font-size: 12px; }
.wx-open { font-weight: 600; }
.wx-who { margin-left: auto; color: var(--muted); }

.wx-pager { display: flex; align-items: center; justify-content: center; gap: 12px;
  margin: 16px 0; }
.wx-pageno { font-size: 13px; color: var(--muted); }
.wx-pg-off { opacity: .45; pointer-events: none; }
.wx-empty { margin: 0; padding: 14px 16px; font-size: 13px; color: var(--muted); }

/* ---- Facetten innerhalb der Treffer -------------------------------------- */
.wx-flist { display: flex; flex-direction: column; padding: 6px; }
.wx-frow { display: grid; gap: 8px; align-items: center; min-height: 34px; padding: 6px 8px;
  border-radius: 7px; color: var(--fg); font-size: 13px; }
.wx-frow:hover { background: var(--raised); color: var(--fg); }
.wx-frow.is-active { background: var(--accent-soft); font-weight: 600; }
.wx-fproj { grid-template-columns: 8px minmax(0, 1fr) auto; }
.pj-pt.is-none { background: transparent; border: 1px solid var(--faint2); }
.wx-fkind { grid-template-columns: 18px minmax(0, 1fr) 50px auto; }
.wx-fname { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wx-fn { padding: 0 7px; border-radius: 9px; background: var(--raised); color: var(--muted);
  font-size: 11px; font-weight: 400; font-variant-numeric: tabular-nums; }
/* Nur die Projekt-Facette trägt die Zahl als Pill; die Art-Facette zeigt sie
   frei neben dem Anteilsbalken, auch aktiv. */
.wx-fproj.is-active .wx-fn { background: var(--panel); }
.wx-fkind .wx-fn { padding: 0; background: none; }
.wx-kbar { display: block; height: 4px; border-radius: 2px; background: var(--line2); overflow: hidden; }
.wx-kbar > .kdot { display: block; height: 100%; border-radius: 2px; }
.wx-ctx { display: flex; flex-wrap: wrap; gap: 6px; }
.wx-cpill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--panel);
  color: var(--fg); font-size: 12.5px; }
.wx-cpill:hover { border-color: var(--faint2); color: var(--fg); }
.wx-cpill.is-active { background: var(--fg); border-color: var(--fg); color: var(--panel); }
.wx-cn { opacity: .7; font-variant-numeric: tabular-nums; }

/* ---- Fokus (Tastatur) ---------------------------------------------------- */
.wx a:focus-visible, .wx-row:focus-visible, .wx-input:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px; }
.wx-row:focus-visible, .wx-srow:focus-visible, .wx-mini:focus-visible,
.wx-frow:focus-visible { outline-offset: -2px; }

/* ---- Schmale Zweispalter (768–1023 px) und Mobil: Titel dürfen zweizeilig
   werden, statt vom Ellipsis verschluckt zu werden (a41-Lehre) — auch in
   „Zuletzt angesehen" und „Gut vernetzt" (am Handy hilft kein Tooltip). ---- */
@media (max-width: 1023px) {
  .wx-title, .wx-mini-title { display: -webkit-box; -webkit-box-orient: vertical;
    -webkit-line-clamp: 2; white-space: normal; overflow-wrap: anywhere; }
  /* Schnellfilter in einer wischbaren Zeile statt drei Zeilen (Label, Chips,
     Kontext), damit die Liste früher beginnt; die Seite selbst scrollt nie
     quer. Die Kontext-Auswahl steht vorn. */
  .wx-quick { flex-wrap: nowrap; gap: 8px; }
  .wx-quick-label { display: none; }
  .wx-quick .wx-chips { flex: 1 1 auto; flex-wrap: nowrap; min-width: 0; overflow-x: auto;
    scrollbar-width: none;
    /* Ausblenden am rechten Rand zeigt: da kommen weitere Arten. */
    mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); }
  .wx-chips::-webkit-scrollbar { display: none; }
  .wx-chips .chip { flex: none; }
  .wx-quick .filterbar-sel { flex: none; order: -1; }
}

/* ---- Mobil (< 768 px): einspaltig, Touch-Ziele ≥ 44 px ------------------ */
@media (max-width: 767px) {
  .wx-hint { display: none; }
  .wx-clear { width: 44px; height: 44px; margin: -12px -10px -12px 0; }
  .wx-quick { margin-bottom: 18px; }
  .wx-quick .sel-btn { min-height: 44px; padding: 0 12px; }
  .wx-ghead { align-items: center; padding: 4px 4px 4px 12px; }
  .wx-glink, .wx-gmore, .wx-gmore-projects, .wx-foot a, .wx-resultline a, .wx-empty a,
  .wx-skills a { display: inline-flex; align-items: center; min-height: 44px; }
  .wx-foot .fx-peek { min-width: 44px; justify-content: center; }   /* „Peek ▸" war 34 px */
  .wx-glink { padding: 0 10px; }
  .wx-gmore { display: flex; }
  /* Zeile der Startansicht zweizeilig: Titel über die volle Breite, darunter
     Meta und Zeit (die Hülle .wx-main tritt dafür zurück). */
  .wx-srow { gap: 2px 10px; align-items: start; padding: 10px 12px; }
  .wx-srow .wx-main { display: contents; }
  .wx-srow .kb { grid-row: span 2; }
  .wx-srow .wx-title { grid-column: 2 / -1; }
  .wx-srow .wx-when { font-size: 11.5px; }
  /* Treffer: Titel über die volle Breite, darunter Meta (darf umbrechen) und
     rechts Relevanz über der Zeit — die Titel-Spalte bleibt breit. */
  .wx-row { gap: 4px 10px; align-items: start; padding: 10px 4px; }
  .wx-row .wx-main { display: contents; }
  .wx-row .kb { grid-row: 1 / span 2; }
  .wx-row .wx-title { grid-column: 2 / -1; }
  .wx-row .wx-meta { grid-column: 2; white-space: normal; overflow-wrap: anywhere; }
  .wx-side-info { grid-column: 3; grid-row: 2; flex-direction: column; align-items: flex-end;
    gap: 6px; padding-top: 3px; }
  .wx-panel { margin: 0 4px 10px; }
  .wx-who { margin-left: 0; flex-basis: 100%; }
  /* components.css hebt .fa-token mobil auf 44 px, die spätere Basisregel
     (32 px) überschreibt das dort aber wieder. */
  .wx-active .fa-token { min-height: 44px; }
  .wx-resultline { display: flex; flex-wrap: wrap; align-items: center; column-gap: 12px;
    flex-basis: 100%; margin: 0; text-align: left; }
  .wx-jump { display: inline-flex; align-items: center; min-height: 44px; margin-left: auto;
    font-size: 12px; font-weight: 600; }
  /* Der Suchbegriff steht mobil schon im Feld und als Token darüber. */
  .wx-rl-q { display: none; }
  .wx-frow { min-height: 44px; }
  .wx-cpill { min-height: 44px; padding: 0 14px; }
  .wx-pager .btn { display: inline-flex; align-items: center; min-height: 44px; }
}

/* ---- Reduzierte Bewegung ------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .wx-field, .fx-chev { transition: none; }
}
