/* ============================================================================
   ocellio — Knowledge v3 (a45, spec 2026-09-29 §5.2): search field, quick filter,
   „Neu & geändert nach Projekt", Zuletzt angesehen, Gut vernetzt, Skills,
   hits with expander and relevance bar, facets within the hits.
   Tokens only (tokens.css); data-driven sizes via w-N, project colour via
   pjb-N → --pj-cur, kind colour via k-{slug} — never inline style (CSP).
   Loads before layout.css/components.css; the classes here are their own (wx-),
   shared building blocks (.pv-label/.pv-card, .fx-nbs/.nb-chip, .new-dot) come
   from pulse.css, chips/context select/tokens from components.css.
   Mobile (< 768 px) single column, touch targets ≥ 44 px; prefers-reduced-motion
   without transitions.
   ============================================================================ */

/* ---- Round kind badges (spec §4.3): .kb from explorer.css, one source since
   a44 (loads on every page); only the sizes here. Initials ≥ 12 px as
   everywhere (previously 11/10/9 px); 18 becomes the .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; }

/* ---- Search field (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; }

/* ---- Quick filter (start view) --------------------------------------- */
.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); }
/* Context select in two columns: name | counter at the right edge (the Puls select
   has four columns: freshness dot, name, counter, time). */
.wx-quick .wx-ctx-panel .sel-item { grid-template-columns: minmax(0, 1fr) auto; }

/* ---- Two-column layout --------------------------------------------------------- */
.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; }

/* ---- Start view: project cards „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; }

/* Start view row: link, grid badge | title/meta | time. */
.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; }
/* Accent text on --accent-soft (NEU, active tokens, skills link): in dark,
   --accent on the tint reaches only 3.4:1 over --panel and 2.9:1 under the
   row hover — the mix of --accent-hi and --fg is at 6.9:1 and
   5.9:1 respectively (≥ 4.5:1, a41 lesson). In light --accent stays (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)); }

/* ---- Right column: 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; }

/* ---- Search: active row -------------------------------------------------- */
.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; }

/* ---- Hits: row = <details>, expander 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; }
/* Relevance bar: --teal instead of --teal-vivid — on the light track
   --teal-vivid reached only 1.6:1, the bar needs 3:1 (graphics contrast). */
.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); }

/* ---- Facets within the hits -------------------------------------- */
.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; }
/* Only the project facet carries the number as a pill; the kind facet shows it
   freely next to the share bar, also when active. */
.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; }

/* ---- Focus (keyboard) ---------------------------------------------------- */
.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; }

/* ---- Narrow two-column layouts (768–1023 px) and mobile: titles may wrap onto two
   lines instead of being swallowed by the ellipsis (a41 lesson) — also in
   „Zuletzt angesehen" and „Gut vernetzt" (a tooltip does not help on a phone). ---- */
@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; }
  /* Quick filter in one swipeable row instead of three rows (label, chips,
     context), so the list starts earlier; the page itself never scrolls
     sideways. The context select comes first. */
  .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;
    /* The fade at the right edge shows: more kinds follow there. */
    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; }
}

/* ---- Mobile (< 768 px): single column, touch targets ≥ 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 ▸" was 34 px */
  .wx-glink { padding: 0 10px; }
  .wx-gmore { display: flex; }
  /* Start view row on two lines: title across the full width, below it
     meta and time (the wrapper .wx-main steps back for this). */
  .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; }
  /* Hits: title across the full width, below it meta (may wrap) and
     on the right relevance above the time — the title column stays wide. */
  .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 raises .fa-token to 44 px on mobile, but the later base rule
     (32 px) overrides that again. */
  .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; }
  /* On mobile the search term is already in the field and as a token above it. */
  .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; }
}

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