/* ============================================================================
   ocellio — Puls v3 (a41, Spec 2026-09-29 §4–§5.1): Kopfzeile mit Filter-
   Dropdowns, Neu-seit-dir-Zähler, Projekt-Kacheln mit Sparkline, Ein-Projekt-
   Feed mit Aufklappern, rechte Spalte. Nur Tokens (tokens.css), keine Hex-
   Literale außer den Weiß/Schatten-Werten der Spec. Datengetriebene Maße über
   die Stufen-Klassen h-N/conf-N/w-N und die Projektfarbe über pjb-N →
   --pj-cur (components.css), nie per Inline-Style (CSP).
   Lädt vor layout.css/components.css; alle Klassen hier sind eigene (pv-,
   tile, ctr-, fx-, nb-), damit keine Regel dort überschrieben wird.
   Mobil (< 768 px) einspaltig, Touch-Ziele ≥ 44 px; prefers-reduced-motion
   ohne Puls-Animation und ohne Übergänge.
   ============================================================================ */

/* ---- Rahmen: Kopfzeile, Sektions-Label, Karte --------------------------- */
.pv-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 14px;
  margin: 24px 0 18px; }
.pv-head h1 { margin: 0; }
.pv-since { margin: 0; font-size: 13px; color: var(--muted); }
.pv-since b { color: var(--fg); font-weight: 600; }
.pv-filters { position: relative; margin-left: auto; display: flex; gap: 6px; }
.pv-label { display: flex; align-items: center; gap: 8px; margin: 0 0 8px;
  font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.pv-label-link { margin-left: auto; font-size: 12px; font-weight: 600;
  text-transform: none; letter-spacing: 0; color: var(--link); }
.pv-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); }

/* ---- Filter-Dropdowns (no-JS: <details>) -------------------------------- */
.pv-dd { position: static; }
.pv-pill { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--panel);
  color: var(--muted); font-size: 12px; cursor: pointer; list-style: none;
  white-space: nowrap; transition: border-color .15s; }
.pv-pill::-webkit-details-marker { display: none; }
.pv-pill:hover { border-color: var(--faint2); }
.pv-pill.is-on { color: var(--fg); border-color: var(--accent-border); background: var(--accent-soft); }
.pv-dd[open] > .pv-pill { border-color: var(--faint2); }
/* Panel hängt an .pv-filters (rechtsbündig zur Seitenkante), nicht an der
   Pille — so ragt es auch mobil nie links aus dem Viewport. */
.pv-dd-panel { position: absolute; right: 0; top: calc(100% + 6px); z-index: 45;
  width: 260px; max-width: calc(100vw - 32px); max-height: 60vh; overflow-y: auto;
  padding: 6px; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--r); box-shadow: var(--shadow); }
.pv-dd-item { display: block; padding: 7px 10px; border-radius: 8px; font-size: 13px;
  color: var(--fg); text-decoration: none; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; }
.pv-dd-item:hover { background: var(--raised); color: var(--fg); }
.pv-dd-item.is-active { background: var(--accent-soft); color: var(--link); font-weight: 600; }

/* ---- Neu-seit-dir-Zähler ------------------------------------------------ */
.pv-counters { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px; margin: 0 0 22px; }
.ctr { position: relative; overflow: hidden; display: flex; flex-direction: column;
  gap: 2px; min-width: 0; padding: 14px 16px; background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--r); color: var(--fg);
  text-decoration: none; transition: border-color .15s; }
.ctr::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: var(--ctr-c); }
.ctr-created { --ctr-c: var(--ev-created); }
.ctr-linked { --ctr-c: var(--ev-linked); }
.ctr-accent { --ctr-c: var(--accent); }
.ctr-project { --ctr-c: var(--pj-cur, var(--faint2)); }
a.ctr:hover { border-color: var(--faint2); color: var(--fg); }
.ctr-n { font-family: var(--font-display); font-weight: 700; font-size: 28px; line-height: 1;
  letter-spacing: -.02em; color: var(--ctr-c); margin-bottom: 4px; }
.ctr.is-zero .ctr-n { color: var(--faint2); }
.ctr-label { font-size: 13px; font-weight: 600; line-height: 1.35; }
.ctr-sub { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; }

/* ---- Projekt-Kacheln ---------------------------------------------------- */
.pv-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px; margin: 0 0 24px; }
.tile { display: flex; flex-direction: column; gap: 8px; min-width: 0;
  padding: 12px 14px 10px; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--r); color: var(--fg); text-decoration: none;
  transition: border-color .15s; }
.tile:hover { border-color: var(--faint2); color: var(--fg); }
.tile.is-sel { border-color: var(--pj-cur, var(--faint2));
  box-shadow: 0 0 0 2px color-mix(in oklab, var(--pj-cur, var(--faint2)) 20%, transparent),
              0 8px 24px -14px rgba(16, 42, 67, .4); }
.tile-head { display: flex; align-items: center; gap: 6px; min-width: 0; }
.pj-pt { flex: none; width: 8px; height: 8px; border-radius: 50%;
  background: var(--pj-cur, var(--faint2)); }
.tile-title { min-width: 0; font-size: 13.5px; font-weight: 700; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.new-badge { flex: none; margin-left: auto; padding: 2px 6px; border-radius: 999px;
  background: var(--accent); color: var(--on-accent); font-family: var(--font-display);
  font-weight: 700; font-size: 10px; line-height: 1.3; animation: pulse 2s infinite; }
@keyframes pulse {
  from { box-shadow: 0 0 0 0 color-mix(in oklab, var(--accent) 45%, transparent); }
  to { box-shadow: 0 0 0 10px color-mix(in oklab, var(--accent) 0%, transparent); }
}
.tile-last { display: flex; gap: 4px; min-width: 0; font-size: 11.5px; line-height: 1.35;
  color: var(--muted); white-space: nowrap; }
.tile-last-t { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.tile-last-rel { flex: none; }
.tile-tasks { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 11px;
  color: var(--muted); }
.tile-segbar { flex: none; display: inline-flex; gap: 1px; width: 56px; height: 6px;
  border-radius: 3px; overflow: hidden; background: var(--line2); }
.tile-segbar .segbar-seg { height: 100%; }
.tile-tasks-txt { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-tags { display: flex; flex-wrap: wrap; gap: 6px; font-size: 10.5px; color: var(--muted); }
.mini-tag { max-width: 100%; padding: 0 4px; border: 1px solid var(--line); border-radius: 4px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* „Ohne Projekt": gedämpft, ohne Farbe, ohne GitHub/Tasks (Spec §5.1 Nr. 3). */
.tile-orphan { border-style: dashed; }
.tile-orphan .tile-title { color: var(--muted); font-weight: 600; }
.tile-quiet { display: flex; flex-direction: column; justify-content: center; gap: 2px;
  min-height: 44px; padding: 12px 14px; border: 1px dashed var(--line); border-radius: var(--r);
  color: var(--muted); font-size: 13px; font-weight: 600; text-decoration: none;
  transition: border-color .15s; }
.tile-quiet span { font-size: 12px; color: var(--link); }
.tile-quiet:hover { border-color: var(--faint2); color: var(--fg); }

/* Sparkline (§4.3): 14 Balken, Höhe h-N, mindestens 2 px; die letzten zwei
   Tage in Akzentfarbe, die gewählte Kachel sonst in Projektfarbe. */
.spark { display: flex; align-items: flex-end; gap: 2px; height: 26px; }
.spark-bar { flex: 1; min-height: 2px; border-radius: 1px 1px 0 0; background: var(--spark-idle); }
.spark-bar.is-recent { background: var(--accent); }
.tile.is-sel .spark-bar:not(.is-recent) { background: var(--pj-cur, var(--spark-idle)); }

/* ---- Zweispalter -------------------------------------------------------- */
.pv-cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; }
@media (min-width: 768px) {
  .pv-cols { grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); }
}
.pv-main { min-width: 0; scroll-margin-top: calc(var(--topnav-h, 56px) + 12px); }
.pv-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }

/* ---- Feed: Zeile = <details>, Aufklapp-Panel ---------------------------- */
.pv-feed { padding: 6px 8px; }
.fx-day { margin: 12px 8px 2px; font-size: 11px; text-transform: uppercase;
  letter-spacing: .05em; color: var(--faint); }
.fx-day:first-child { margin-top: 4px; }
.feed-x { border-radius: 8px; }
.fx-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 12px;
  align-items: center; min-height: 44px; padding: 8px; border-radius: 8px;
  cursor: pointer; list-style: none; }
.fx-row::-webkit-details-marker { display: none; }
.fx-row:hover { background: var(--raised); }
.ev-ico { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px;
  font-size: 14px; color: var(--fg); background: var(--ev-other-soft); }
.ev-created { background: var(--ev-created-soft); }
.ev-updated { background: var(--ev-updated-soft); }
.ev-linked { background: var(--ev-linked-soft); }
.ev-pushed { background: var(--ev-pushed-soft); }
.fx-text { min-width: 0; font-size: 14px; line-height: 1.4; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.fx-first { color: var(--link); }
.fx-more { color: var(--muted); }
.new-dot { display: inline-block; width: 6px; height: 6px; margin-right: 6px;
  border-radius: 50%; background: var(--accent); vertical-align: middle; }
.fx-rel { font-size: 12px; color: var(--muted); white-space: nowrap; }
.fx-chev { display: inline-block; color: var(--faint); transition: transform .15s; }
.feed-x[open] .fx-chev { transform: rotate(180deg); }
.fx-panel { display: flex; flex-direction: column; gap: 8px; margin: 0 8px 8px 48px;
  padding: 10px 12px; border-left: 2px solid var(--pj-cur, var(--faint2));
  border-radius: 0 8px 8px 0; background: var(--raised); font-size: 13px; }
.fx-src { margin: 0; font-size: 11px; color: var(--muted); }
.fx-item { display: flex; flex-direction: column; gap: 6px; }
.fx-item-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px;
  align-items: center; }
.fx-item-title { min-width: 0; overflow-wrap: anywhere; }
.kpill { margin-left: 4px; padding: 0 6px; border: 1px solid var(--line); border-radius: 999px;
  font-family: var(--font-mono); font-size: 11px; color: var(--muted); white-space: nowrap; }
.fx-edges { font-size: 12px; color: var(--muted); white-space: nowrap; }
.fx-nbs { display: flex; flex-wrap: wrap; gap: 6px; padding-left: 12px; }
.fx-nbs:empty { display: none; }
.nb-chip { position: relative; display: inline-flex; align-items: center; gap: 5px;
  max-width: 100%; min-width: 0; padding: 2px 8px; border: 1px solid var(--line);
  border-radius: 6px; background: var(--panel); font-size: 12px; }
.nb-chip a { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nb-skel { width: 60px; height: 20px; border-radius: 6px; background: var(--line2); }
.rel-label { font-family: var(--font-mono); font-size: 10px; text-transform: uppercase;
  color: var(--muted); }
/* Das Label behält seine Breite; kürzen darf nur der Titel (app.css setzt
   min-width: 0 für alle Kinder, sonst liefe „MENTIONS" in den Link). */
.nb-chip .rel-label { flex: none; }
/* Weiß auf abgedunkelter Projektfarbe: auf --pj-0/1/4 selbst erreichte Weiß
   nur 3,2–3,8:1 (Spec §6 verlangt 4,5:1); 82 % + Schwarz ergibt ≥ 5:1. */
.xbadge { flex: none; padding: 0 5px; border-radius: 3px;
  background: color-mix(in oklab, var(--pj-cur, var(--faint2)) 82%, #000);
  color: #fff; font-size: 10px; font-weight: 700; white-space: nowrap; }
.xbadge.pjb-3 { background: var(--pj-cur); color: var(--navy); }   /* Spec §4.3: 4,8:1 */
.fx-more-link { font-size: 12px; }
.fx-more-txt { font-size: 12px; color: var(--muted); }
.fx-foot { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0; font-size: 12px; }
.fx-explorer { font-weight: 600; }
.fx-older { margin: 6px 8px 4px; font-size: 12px; color: var(--muted); }
.pv-empty { margin: 8px; font-size: 13px; color: var(--muted); }

/* ---- Rechte Spalte ------------------------------------------------------ */
.pv-decide { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px;
  background: var(--accent-soft); border: 1px solid var(--accent-border);
  border-radius: var(--r); font-size: 13px; }
.dec-row { display: grid; grid-template-columns: minmax(0, 1fr) 60px; gap: 8px; align-items: center; }
.dec-txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dec-bar { height: 6px; border-radius: 999px; background: var(--panel); overflow: hidden; }
.dec-fill { display: block; height: 100%; border-radius: 999px; background: var(--accent); }
.pv-cta { font-size: 12px; font-weight: 600; }
.pv-empty-side { margin: 0; color: var(--muted); }
.pv-between { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; }
.btw-row { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px;
  align-items: center; font-size: 12.5px; }
.btw-glyph { display: flex; align-items: center; gap: 3px; }
.btw-line { width: 14px; height: 1px; background: var(--faint2); }
.btw-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.btw-txt, .btw-meta { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btw-meta { font-size: 11.5px; color: var(--muted); }
.pv-stats { padding: 4px 4px 0; font-size: 12px; line-height: 1.6; color: var(--muted); }
.pv-stat { white-space: nowrap; }

/* ---- Fokus (Tastatur) ---------------------------------------------------- */
.pv a:focus-visible, .pv-pill:focus-visible, .fx-row:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px; }
.fx-row:focus-visible { outline-offset: -2px; }

/* ---- Mobil (< 768 px): einspaltig, Touch-Ziele ≥ 44 px ------------------ */
@media (max-width: 767px) {
  .pv-head { margin-top: 16px; }
  .pv-filters { margin-left: 0; width: 100%; }
  .pv-pill { min-height: 44px; padding: 0 14px; font-size: 13px; }
  .pv-dd-item { display: flex; align-items: center; min-height: 44px; }
  .pv-counters { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .ctr { padding: 12px 14px; }
  .ctr-n { font-size: 24px; }
  /* Zweizeilig statt Ellipsis: Zähler 2 nennt hier sein Ziel („davon 4 bei
     Puls-Dashboard", Abnahme a43) — gekürzt verschwände genau der Name. */
  .ctr-sub { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
    white-space: normal; }
  .pv-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  /* Kompakte Kachel wie die Mobil-Skizze (Ideen 1e): Titel + Badge,
     Sparkline, Task-Balken über die volle Breite. „Was zuletzt" und die Tags
     entfallen (bei 153 px ohnehin abgeschnitten), die Task-Kurzzeile bleibt
     für Screenreader — so beginnt der Verlauf eine Bildschirmhöhe früher. */
  .tile { gap: 7px; padding: 10px 12px; }
  .tile-last, .tile-tags { display: none; }
  .tile-segbar { flex: 1; width: auto; }
  .tile-tasks-txt { position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap; }
  /* Zwei Spalten sind schmal: der Kachel-Titel darf zweizeilig werden,
     sonst verschluckt die Ellipsis genau den Namen, um den es geht. */
  .tile-head { align-items: flex-start; }
  .tile-title { display: -webkit-box; -webkit-box-orient: vertical;
    -webkit-line-clamp: 2; white-space: normal; }
  .tile-head .pj-pt { margin-top: 5px; }
  /* Feed-Zeile dreizeilig wie die Mobil-Skizze (Ideen 1e): „Akteur Verb",
     darunter der Titel (höchstens zwei Zeilen), darunter klein die Zeit —
     die Zeit-Spalte rechts ließ dem Titel sonst kaum Platz. */
  .fx-row { grid-template-columns: 28px minmax(0, 1fr); gap: 2px 10px;
    align-items: start; padding: 8px 4px; }
  .fx-row .ev-ico { grid-row: span 2; }
  .fx-text { white-space: normal; }
  .fx-dash { display: none; }
  .fx-what { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
    overflow: hidden; }
  .fx-rel { grid-column: 2; font-size: 11.5px; }
  .fx-panel { margin-left: 4px; margin-right: 0; }
  .fx-foot a, .fx-more-link, .pv-cta, .pv-label-link, .fx-item-title a, .fx-older a,
  .pv-empty a {
    display: inline-flex; align-items: center; min-height: 44px; }
  /* „Peek ▸“ ist schmaler als 44 px (Review RC). */
  .fx-foot .fx-peek { min-width: 44px; justify-content: center; }
  /* „Zwischen Projekten": die zwei Titel-Links einer Zeile dürfen umbrechen,
     jeder ist selbst 44 px hoch — die Zeilenhöhe allein half dem Link nicht. */
  .btw-row { min-height: 44px; }
  .btw-txt { display: flex; flex-wrap: wrap; align-items: center; column-gap: 5px;
    white-space: normal; }
  .btw-txt a { display: inline-flex; align-items: center; min-height: 44px; }
  /* Chips 32 px hoch mit 12 px Zeilenabstand; die Trefferfläche wächst
     unsichtbar um je 6 px auf 44 px — gestapelte Chips berühren sich, ihre
     Flächen überlappen nie (inset rechnet ab der Padding-Box, 1 px Rand). */
  .fx-nbs { gap: 12px 6px; }
  .nb-chip { min-height: 32px; }
  .nb-chip a::after { content: ""; position: absolute; inset: -7px 0; }
}

/* ---- Reduzierte Bewegung ------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .new-badge { animation: none; }
  .fx-chev, .tile, .ctr, .pv-pill, .tile-quiet { transition: none; }
}
