/* components.css — shared building blocks (spec §4): card, feed row, chips,
   inbox, section label. Reused by Pulse (S5-A), Project (S5-B). */
/* .card background/border come from app.css (theme-aware var(--panel)/var(--line));
   only override the radius/padding here so dark theme is not clobbered. */
.card { border-radius: 10px; padding: var(--sp-3) var(--sp-4); }
/* font-family: as an h2 (entity page) the label would otherwise inherit Sora (review RC). */
.sec-label { font-family: var(--font-sans); font-size: 11px; text-transform: uppercase;
  letter-spacing: .05em; color: var(--muted, #888); margin: var(--sp-4) 0 var(--sp-2); }
.chips { display: flex; gap: var(--sp-2); flex-wrap: wrap; }
.chip { display: inline-block; padding: var(--sp-1) var(--sp-3); min-height: 28px;
  border: 1px solid var(--border, #ccc); border-radius: 999px; font-size: 13px;
  text-decoration: none; color: inherit; max-width: 32ch; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.chip.is-active { background: var(--accent, #6b46ff); color: #fff;
  border-color: var(--accent, #6b46ff); }
/* Project color ladder (Pulse v2.2, idea 2): pjb-N sets ONE local variable
   --pj-cur (inherited by children) that the color edge + chip dot read together. This way
   the same class carries the 3px feed border AND the 2px selector bar. */
.pjb-0 { --pj-cur: var(--pj-0); } .pjb-1 { --pj-cur: var(--pj-1); }
.pjb-2 { --pj-cur: var(--pj-2); } .pjb-3 { --pj-cur: var(--pj-3); }
.pjb-4 { --pj-cur: var(--pj-4); }
/* Project chip stays neutral (no white text on color) + a colored dot
   in front; the color inherits via --pj-cur from the feed row. */
.pj-dot { color: var(--pj-cur, var(--muted, #888)); font-size: 9px; line-height: 1;
  margin-right: 3px; }
.btn-ok, .btn-no { min-width: 44px; min-height: 44px; border-radius: 8px;
  border: 0; font-weight: 700; cursor: pointer; }
.btn-ok { background: #dff3e9; color: #067a52; }
.btn-no { background: #fbe5e5; color: #b03030; }
.statsfoot { display: flex; flex-wrap: wrap; gap: var(--sp-4); justify-content: center;
  font-size: 12px; color: var(--muted, #888); padding: var(--sp-4) 0;
  border-top: 1px solid var(--border, #e2e0dc); margin-top: var(--sp-5); }
.inbox-empty { color: var(--muted, #888); font-size: 13px; margin-top: var(--sp-2); }
.filterbar { margin: var(--sp-4) 0; }
.filterbar .sec-label { margin: var(--sp-3) 0 var(--sp-1); }

/* Spec §5.5: touch targets ≥ 44 px on touch viewports. Chips are compact
   on desktop (28 px), but finger targets on mobile. */
@media (max-width: 767px) {
  /* 44px finger target WITHOUT inline-flex: a flex container cancels text-overflow:
     ellipsis (the ellipsis needs an inline/block context, not a
     flex item). So keep inline-block (from the base) and fill the height via
     line-height; the vertical padding is zeroed so the line sits
     centered and the ellipsis (base: overflow/white-space/text-overflow)
     still applies. */
  .chip { min-height: 44px; line-height: 44px; padding-top: 0; padding-bottom: 0; }
  /* The token stays a finger target (§5.5), even if it is more compact on desktop. */
  .fa-token { min-height: 44px; }
  /* Filter hint of the triage (?projekt=, sign-off a43): two text links in a
     sentence — only inline-flex turns them into 44 px targets (review a43). */
  .tri-filter a { display: inline-flex; align-items: center; min-height: 44px; }
}

/* ---- Pulse v2.1: project selector + active-filter tokens -------------------
   Selector modeled on .acct-menu (nav.js pattern): desktop absolute
   dropdown, mobile fixed bottom sheet (override in layout.css, next to .acct-menu).
   The filter bar is NOT in the sticky top nav → the panel carries its own
   z-index (> bottom nav 40), otherwise it would vanish behind the bar on mobile. */
.filterbar-sel { position: relative; display: inline-block; }
.sel-btn { display: inline-flex; align-items: center; gap: var(--sp-2);
  min-height: 44px; padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--border, #ccc); border-radius: 999px;
  background: var(--surface, #fff); color: inherit; font: inherit; font-size: 13px;
  font-weight: 600; cursor: pointer; }
.sel-chev { color: var(--muted, #888); flex: none; }
.sel-panel { position: absolute; left: 0; top: calc(100% + 6px); z-index: 45;
  width: 360px; max-width: calc(100vw - 2 * var(--sp-4)); max-height: 70vh;
  overflow-y: auto; padding: var(--sp-2); background: var(--panel, #fff);
  border: 1px solid var(--line, #e2e0dc); border-radius: 12px;
  box-shadow: var(--shadow, 0 4px 14px rgba(0,0,0,.12)); }
/* Row as a fixed grid: dot | title (ellipsis) | counter | time — columns
   line up across all rows (grid rule; time column fixed so counters form one
   column). .sel-name must NOT be flex: text-overflow only applies
   to block containers (same trap as the chip ellipsis fix). */
.sel-item, .sel-item:visited { display: grid;
  grid-template-columns: 14px minmax(0, 1fr) auto 72px;
  column-gap: var(--sp-2); align-items: center; min-height: 44px;
  padding: var(--sp-2) var(--sp-3); border-radius: 8px;
  text-decoration: none; color: inherit;
  /* Project color ladder (idea 2): narrow color bar on the left, color via pjb-N →
     --pj-cur; the freshness dot (sel-dot) is kept separately. */
  border-left: 2px solid var(--pj-cur, transparent); }
.sel-dot { text-align: center; font-size: 11px; line-height: 1; }
.sel-item:hover { background: var(--raised, #f3f2f0); }
.sel-item.is-active { background: var(--accent-soft, #efe7ff); font-weight: 600; }
.sel-name { display: block; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sel-cnt { justify-self: end; background: var(--raised, #eee); border-radius: 9px;
  padding: 0 var(--sp-2); font-size: 11px; color: var(--muted, #555); }
.sel-rel { justify-self: end; font-size: 11px; color: var(--muted, #888);
  white-space: nowrap; }

/* Active-filter row: removable tokens in the grid token style (--sp-* spacing). */
.filter-active { display: flex; align-items: center; flex-wrap: wrap;
  gap: var(--sp-2); margin: 0 0 var(--sp-4); }
.fa-label { font-size: 12px; color: var(--muted, #888); }
.fa-token { display: inline-flex; align-items: center; gap: var(--sp-2);
  min-height: 32px; padding: var(--sp-1) var(--sp-3); border-radius: 8px;
  background: var(--accent-soft, #efe7ff);
  border: 1px solid var(--accent-border, #c9b8ff);
  color: var(--link, #4a2fbf); text-decoration: none; font-size: 13px; }
.fa-token:hover { filter: brightness(.97); }

/* ---- S5-B: project header and freshness (board page; list and detail since a43
   in explorer.css) ---- */
.pj-head { display: flex; align-items: baseline; gap: var(--sp-2); flex-wrap: wrap; }
.dot-fresh { color: #067a52; } .dot-days { color: #b07500; } .dot-stale { color: var(--muted, #999); }
/* Badge scoped to the project surfaces: the global `.badge` (app.css) is reused
   by the entities browser via v1_badge — an unscoped override would regress it. */
.pj-head .badge { font-size: 11px; font-weight: 500; border: 1px solid var(--border, #ddd);
  border-radius: 4px; padding: 0 var(--sp-1); color: var(--muted, #666); letter-spacing: 0; }
.cta { display: inline-flex; align-items: center; gap: var(--sp-2); min-height: 44px;
  padding: var(--sp-2) var(--sp-4); margin: var(--sp-3) 0; border-radius: 8px;
  background: var(--accent, #4a5f6b); color: #fff; text-decoration: none; font-weight: 600; }
.kindtag { font-size: 11px; color: var(--muted, #888); margin-left: var(--sp-2); }

/* Rhythm (spec §5.1 feedback): page titles sit consistently on every page
   below the sticky top nav. The detail page carries its h1 in .pj-head (flex,
   baseline) instead of as a direct .shell>h1 — the same rhythm, without tipping the badges
   out of the baseline (margin on the h1, not on the flex container). */
.shell > h1, .shell > .pj-head > h1 { margin: var(--sp-5) 0 var(--sp-4); }

/* ---- S5-P2: /proposals triage — groups, confidence bars, bulk ---- */
.tri-group { margin: var(--sp-4) 0; }
.tri-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center;
  gap: var(--sp-3); background: var(--accent-soft, #efe7ff);
  border: 1px solid var(--accent-border, #c9b8ff); border-radius: 12px;
  padding: var(--sp-3) var(--sp-4); }
.tri-title { display: block; }
.tri-explain { margin: var(--sp-1) 0 0; font-size: 13px; color: var(--muted, #666); }
.tri-bulk { display: flex; gap: var(--sp-2); flex-wrap: wrap; justify-content: flex-end; }
.btn-bulk { min-width: auto; padding: 0 var(--sp-3); font-size: 13px; white-space: nowrap; }
.tri-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center;
  gap: var(--sp-3); background: var(--surface, #fff); border: 1px solid var(--border, #e2e0dc);
  border-radius: 8px; padding: var(--sp-2) var(--sp-3); margin-top: var(--sp-2); }
.tri-card form { display: inline; }
.tri-card-explain { grid-column: 1 / -1; margin: 0; }
.tri-card-conf { display: flex; align-items: center; gap: var(--sp-2); min-width: 0; }
.tri-conf { font-size: 12px; color: var(--muted, #666); }
.tri-by { font-size: 11px; color: var(--muted, #888); }
.tri-card-actions { display: flex; gap: var(--sp-2); flex-wrap: nowrap; justify-self: end; }
.conf-bar { width: 120px; max-width: 40vw; height: 6px; border-radius: 999px;
  background: var(--border, #e2e0dc); overflow: hidden; }
.conf-fill { display: block; height: 100%; border-radius: 999px; background: var(--accent, #6b46ff); }
.conf-0 { width: 0; } .conf-5 { width: 5%; } .conf-10 { width: 10%; } .conf-15 { width: 15%; }
.conf-20 { width: 20%; } .conf-25 { width: 25%; } .conf-30 { width: 30%; } .conf-35 { width: 35%; }
.conf-40 { width: 40%; } .conf-45 { width: 45%; } .conf-50 { width: 50%; } .conf-55 { width: 55%; }
.conf-60 { width: 60%; } .conf-65 { width: 65%; } .conf-70 { width: 70%; } .conf-75 { width: 75%; }
.conf-80 { width: 80%; } .conf-85 { width: 85%; } .conf-90 { width: 90%; } .conf-95 { width: 95%; }
.conf-100 { width: 100%; }

/* Pulse v2.1: project selector on mobile as a bottom sheet. Lives HERE (not in
   layout.css) because components.css loads last — otherwise the
   absolute dropdown base rule above wins the cascade and top+bottom squeeze the
   panel into a strip (found via Playwright DoD, 2026-08-01). */
@media (max-width: 767px) {
  .sel-panel { position: fixed; left: 0; right: 0; bottom: 0; top: auto;
    width: auto; max-width: none; max-height: 70vh; overflow: auto; z-index: 45;
    border-radius: 16px 16px 0 0; box-shadow: 0 -6px 24px rgba(0,0,0,.25); }
}

/* ============================================================================
   Pulse v2.2 — graphic system: percent-step utilities. The activity band
   (idea 1) was dropped with Pulse v3 (ADR N1), the daily summary bars (idea
   3) with a43; the sparklines live in pulse.css and use the h-N classes below.
   CSP: all heights/widths/positions via 5%-step classes, no inline style.
   ============================================================================ */

/* Segment of a task bar (tile, project list, project page). */
.segbar-seg { height: 100%; }

/* --- Percent-step utilities (steps of 5) — heights (sparklines), widths (bars),
   positions. Pattern like conf-N; separate properties per set. --- */
.h-0 { height: 0; } .h-5 { height: 5%; } .h-10 { height: 10%; } .h-15 { height: 15%; } .h-20 { height: 20%; }
.h-25 { height: 25%; } .h-30 { height: 30%; } .h-35 { height: 35%; } .h-40 { height: 40%; } .h-45 { height: 45%; }
.h-50 { height: 50%; } .h-55 { height: 55%; } .h-60 { height: 60%; } .h-65 { height: 65%; } .h-70 { height: 70%; }
.h-75 { height: 75%; } .h-80 { height: 80%; } .h-85 { height: 85%; } .h-90 { height: 90%; } .h-95 { height: 95%; }
.h-100 { height: 100%; }
.w-0 { width: 0; } .w-5 { width: 5%; } .w-10 { width: 10%; } .w-15 { width: 15%; } .w-20 { width: 20%; }
.w-25 { width: 25%; } .w-30 { width: 30%; } .w-35 { width: 35%; } .w-40 { width: 40%; } .w-45 { width: 45%; }
.w-50 { width: 50%; } .w-55 { width: 55%; } .w-60 { width: 60%; } .w-65 { width: 65%; } .w-70 { width: 70%; }
.w-75 { width: 75%; } .w-80 { width: 80%; } .w-85 { width: 85%; } .w-90 { width: 90%; } .w-95 { width: 95%; }
.w-100 { width: 100%; }
.pos-0 { left: 0; } .pos-5 { left: 5%; } .pos-10 { left: 10%; } .pos-15 { left: 15%; } .pos-20 { left: 20%; }
.pos-25 { left: 25%; } .pos-30 { left: 30%; } .pos-35 { left: 35%; } .pos-40 { left: 40%; } .pos-45 { left: 45%; }
.pos-50 { left: 50%; } .pos-55 { left: 55%; } .pos-60 { left: 60%; } .pos-65 { left: 65%; } .pos-70 { left: 70%; }
.pos-75 { left: 75%; } .pos-80 { left: 80%; } .pos-85 { left: 85%; } .pos-90 { left: 90%; } .pos-95 { left: 95%; }
.pos-100 { left: 100%; }

/* ── S5-C task 5: structured attributes + connection bottom sheet ──────── */

/* Attribute rows (dt/dd) replace the JSON <pre> dump. Label column fixed,
   value wraps. Raw keys (unknown) are monospace. */
.attr-list { display: grid; grid-template-columns: minmax(120px, max-content) 1fr;
  gap: var(--sp-1) var(--sp-4); margin: 0; align-items: baseline; }
.attr-key { font-size: 12px; font-weight: 600; color: var(--muted, #888); }
.attr-key-raw { font-family: var(--font-mono, monospace); font-weight: 500;
  text-transform: none; }
.attr-val { font-size: 13.5px; color: var(--fg); overflow-wrap: anywhere; margin: 0; }
@media (max-width: 767px) {
  .attr-list { grid-template-columns: 1fr; gap: 0; }
  .attr-key { margin-top: var(--sp-2); }
}

/* ⓘ button per connection row — 44px finger target, opens the bottom sheet. */
.sheet-trigger { flex: none; margin-left: auto; width: 44px; height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; color: var(--muted, #888); border: 1px solid transparent;
  border-radius: var(--r-sm, 7px); font-size: 15px; cursor: pointer; }
.sheet-trigger:hover { color: var(--link); border-color: var(--line);
  background: var(--accent-soft, #efe7ff); }

/* <dialog class="sheet">: centered on desktop, docked at the bottom on mobile. No
   padding on the dialog itself → a click that hits it is the backdrop
   (the .sheet-panel catches its own clicks). */
dialog.sheet { padding: 0; border: none; border-radius: var(--r, 12px);
  max-width: 460px; width: calc(100vw - 2 * var(--sp-4));
  background: var(--panel); color: var(--fg);
  box-shadow: 0 18px 48px rgba(0,0,0,.28); }
dialog.sheet::backdrop { background: rgba(8,19,32,.46); }
.sheet-panel { position: relative; padding: var(--sp-5) var(--sp-5) var(--sp-4); }
.sheet-close { position: absolute; top: var(--sp-2); right: var(--sp-2);
  width: 44px; height: 44px; display: inline-flex; align-items: center;
  justify-content: center; background: transparent; color: var(--muted, #888);
  border: none; border-radius: var(--r-sm, 7px); font-size: 22px; cursor: pointer; }
.sheet-close:hover { color: var(--fg); }
.sheet-title { font-size: 1.05rem; font-weight: 700; margin: 0 44px 0 0;
  line-height: 1.3; overflow-wrap: anywhere; }
.sheet-meta { font-size: 0.78rem; color: var(--faint, var(--muted));
  margin: var(--sp-2) 0 0; }
.sheet-excerpt { font-size: 0.9rem; color: var(--muted, #888); line-height: 1.5;
  margin: var(--sp-3) 0 0; overflow-wrap: anywhere; }
.sheet-loading, .sheet-error { font-size: 0.9rem; color: var(--muted, #888);
  margin: 0; }
.sheet-open { display: inline-block; margin-top: var(--sp-4); font-weight: 600; }

@media (max-width: 767px) {
  dialog.sheet { width: 100%; max-width: 100%; margin: 0 0 0 0;
    top: auto; bottom: 0; border-radius: var(--r, 12px) var(--r, 12px) 0 0; }
  .sheet-panel { padding-bottom: var(--sp-5); }
}

/* ── Ego graph (S5-C): radial, touch-first module; ego.js builds the SVG. ──────
   Kind colors from the shared kind_palette (--kc per .k-<kind>), project ring
   from the color wheel (pjb-N → --pj-cur). No inline styles (CSP). */
.ego { margin: var(--sp-2) 0 0; }
.ego > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center;
  font-family: var(--font-display); font-size: 13px; font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase; color: var(--muted, #888); }
.ego-body { padding-top: var(--sp-2); }
.ego-svg { display: block; width: 100%; max-width: 420px; height: auto;
  margin: 0 auto; touch-action: manipulation; }
/* Project desktop: the right column always keeps the neighborhood open. */
@media (min-width: 768px) {
  .ego-pin > summary { pointer-events: none; list-style: none; cursor: default; }
  .ego-pin > summary::-webkit-details-marker { display: none; }
}

/* Nodes: invisible 44px hit target, visible disc smaller (dataviz rule). */
.ego-node { cursor: pointer; }
.ego-node:focus { outline: none; }
.ego-hit { fill: transparent; }
/* Opaque, tinted surface (edges end beneath it instead of running through the initial);
   ring and initial in the darkened (light) or lightened
   (dark) kind color: initial ≥ 5:1 against the surface, ring ≥ 6:1 against the card. */
.ego-node { --ego-ink: color-mix(in oklab, var(--kc, var(--muted)) 70%, #000); }
:root[data-theme="dark"] .ego-node {
  --ego-ink: color-mix(in oklab, var(--kc, var(--muted)) 55%, #fff); }
.ego-disc { fill: color-mix(in oklab, var(--kc, var(--muted)) 20%, var(--panel));
  stroke: var(--ego-ink); stroke-width: 2; }
/* Initials legible (sign-off a43/a44, ≥ 12 px as rendered): the SVG (viewBox
   360) is 314–318 px wide on desktop, 15 units render there at ≥ 13 px;
   on a phone it is viewport − 98 to − 102 px wide, 17 units hold
   ≥ 12 px from 360 px. One rule for project and entity page (previously 11). */
.ego-initial { fill: var(--ego-ink); font-family: var(--font-display);
  font-weight: 700; font-size: 15px; }
@media (max-width: 767px) { .ego-initial { font-size: 17px; } }
.ego-node.is-focus .ego-disc { stroke-width: 3; }
.ego-node[data-selected="1"] .ego-disc,
.ego-node:focus-visible .ego-disc { stroke: var(--accent); stroke-width: 3; }
.ego-edge { stroke: var(--faint, #ccc); stroke-width: 1.2; stroke-opacity: .5; }
.ego-pj { fill: none; stroke: var(--pj-cur, var(--line)); stroke-width: 2; }
/* kind_palette (hex mirror of kind_palette.py; CSS cannot import it). */
.ego-node.k-concept{--kc:#4a7a9b}.ego-node.k-fact{--kc:#7a4a9b}
.ego-node.k-decision{--kc:#9b7a4a}.ego-node.k-template{--kc:#4a9b7a}
.ego-node.k-secret{--kc:#9b4a4a}.ego-node.k-config{--kc:#6b7a9b}
.ego-node.k-project{--kc:#4a7a4a}.ego-node.k-task{--kc:#9b9b4a}
.ego-node.k-document{--kc:#5a6a8a}.ego-node.k-note{--kc:#8a8a5a}
.ego-node.k-inbox_item{--kc:#7a8a9a}.ego-node.k-user{--kc:#9a7a7a}
.ego-node.k-tag{--kc:#7a9a8a}.ego-node.k-skill{--kc:#c97a3a}.ego-node.k-commit{--kc:#6a8a6a}

/* Info row below the SVG (tap = selection) + overflow/full-graph links. */
.ego-info { display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-2);
  min-height: 44px; margin: var(--sp-2) 0 0; font-size: 13px; color: var(--muted, #888); }
.ego-info-title { font-weight: 600; color: var(--fg); overflow-wrap: anywhere; }
.ego-info-kind { font-size: 11px; color: var(--faint, var(--muted)); }
.ego-info-open, .ego-more-link, .ego-full { display: inline-flex; align-items: center;
  min-height: 44px; color: var(--link); text-decoration: none; font-weight: 600; }
.ego-info-open { margin-left: auto; }
.ego-more { margin: var(--sp-1) 0 0; font-size: 12px; }
.ego-full { font-size: 12px; margin-top: var(--sp-1); }

/* ============================================================================
   S5-F board — read-only task board (project detail page) + list seg bar.
   Status colors as --st-* tokens (app.css, light+dark); edge on the left in the
   pjb pattern (--st-cur inherits to children). Color is never the sole carrier — the
   group headers carry the plain text.
   ============================================================================ */
.st-blocked { --st-cur: var(--st-blocked); }
.st-in_progress { --st-cur: var(--st-progress); }
.st-open { --st-cur: var(--st-open); }
.st-done { --st-cur: var(--st-done); }
.st-closed { --st-cur: var(--st-closed); }
.st-none { --st-cur: transparent; }
/* Segment colors of the task bars (task 3). */
.bs-blocked { background: var(--st-blocked); } .bs-in_progress { background: var(--st-progress); }
.bs-open { background: var(--st-open); } .bs-done { background: var(--st-done); }

/* ============================================================================
   S5-G board page (owner's sign-off finding 2026-08-17: "visualize more than a
   board"): real status columns on /projekte/{id}/board. The
   scroll container keeps the body free of horizontal scroll (house rule for wide content);
   on narrow viewports the area becomes a swipeable board (scroll-snap).
   The column carries the state (top edge via --st-cur), the cards stay
   calm surfaces; blocked cards keep the soft surface as escalation
   emphasis. The detail page now only links here via the summary card.
   ============================================================================ */
.boardp-scroll { overflow-x: auto; scroll-snap-type: x proximity;
  padding-bottom: var(--sp-3); }
.boardp { display: grid; grid-auto-flow: column;
  grid-auto-columns: minmax(250px, 1fr); gap: var(--sp-4); align-items: start; }
.boardp-col { border-top: 3px solid var(--st-cur, var(--border, #ddd));
  padding-top: var(--sp-2); scroll-snap-align: start; min-width: 0; }
.boardp-h { font-size: 12px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .04em; color: var(--muted, #888); margin: 0 0 var(--sp-2); }
.boardp-card { background: var(--surface, #fff); border-radius: 8px;
  padding: var(--sp-2) var(--sp-3); }
.boardp-card + .boardp-card { margin-top: var(--sp-2); }
.boardp-title { display: flex; align-items: center; min-height: 44px; }
.boardp-col.st-blocked .boardp-card { background: var(--st-blocked-soft); }
.boardp-empty { font-size: 12px; color: var(--muted, #888); margin: var(--sp-2) 0; }

/* ============================================================================
   S5-D: /einstellungen — one page, four sections (passkeys · sessions ·
   tokens · OAuth clients) with anchor navigation. No JS (plain #-anchors).
   Desktop: anchor row sticky below the top nav; mobile: stacked sections,
   anchor row horizontally scrollable. CSP: classes only, no inline styles.
   ============================================================================ */
.set-anchors { position: sticky; top: var(--topnav-h, 56px); z-index: 30;
  display: flex; gap: var(--sp-2); margin: var(--sp-4) 0; padding: var(--sp-2) 0;
  overflow-x: auto; background: var(--surface, #fff);
  border-bottom: 1px solid var(--border, #e2e0dc); }
.set-anchor, .set-anchor:visited { display: inline-flex; align-items: center;
  min-height: 44px; padding: var(--sp-2) var(--sp-3); border-radius: 999px;
  white-space: nowrap; text-decoration: none; color: inherit;
  border: 1px solid var(--border, #ccc); font-size: 13px; font-weight: 600; }
.set-anchor:hover { background: var(--raised, #f3f2f0); }
/* A jump target must not land beneath the top nav + sticky anchor row. */
.set-section { scroll-margin-top: calc(var(--topnav-h, 56px) + var(--sp-6) + var(--sp-6)); }
.set-section + .set-section { margin-top: var(--sp-5); }
.set-section > h2:first-child { margin-top: 0; }
/* §5.5: no table without a scroll container — the credential tables are
   wide and must not tear the page open horizontally on mobile. */
.set-tbl { overflow-x: auto; }
/* Tables in the scroll wrapper must not shrink below legibility:
   below 48rem the wrapper scrolls instead of columns breaking
   (finding screenshot 390px: sessions table unreadably squashed). */
.set-tbl table, .tbl-scroll table { min-width: 48rem; }
.set-tbl th, .tbl-scroll th { white-space: nowrap; }

/* ============================================================================
   S5-D task 3: admin tables responsive (spec §5.4/§5.5, audit finding
   "no table without a scroll container"). Lives at the end of the file — components.css
   loads last; no competing rules before these. CSP: classes only.
   ============================================================================ */

/* Scroll container around EVERY remaining admin table: the table scrolls in
   its wrapper, the body never tears open horizontally. Also used by shares.html (T2)
   (table in .card) — there the card carries border/radius, the wrapper
   only the scroll. Radius matching .card (10px). */
.tbl-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch;
  margin: var(--sp-3) 0; border-radius: 10px; }

/* Mobile card list as an alternative to the widest tables (users,
   webhooks): desktop shows the table, mobile the cards. BOTH are fed
   from the same Jinja row list (two loops over users/sources) — no
   handler-side duplication. Only the tables marked with .tbl-cards
   disappear on mobile; audit/auth_audit keep their scrollable table. */
.acard-list { display: none; list-style: none; margin: var(--sp-3) 0; padding: 0; }
.acard { border: 1px solid var(--border, #e2e0dc); border-radius: 10px;
  padding: var(--sp-3) var(--sp-4); margin-bottom: var(--sp-3);
  background: var(--surface, #fff); }
.acard.muted { opacity: .6; }
.acard-head { display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-2);
  font-weight: 600; margin-bottom: var(--sp-2); }
/* Label column fixed, value wraps (dt/dd — the same pattern as .attr-list). */
.acard-dl { display: grid; grid-template-columns: minmax(72px, max-content) 1fr;
  gap: var(--sp-1) var(--sp-3); margin: 0; align-items: baseline; }
.acard-dl dt { font-size: 12px; font-weight: 600; color: var(--muted, #888); }
.acard-dl dd { margin: 0; font-size: 13.5px; overflow-wrap: anywhere; }
.acard-actions { display: flex; flex-wrap: wrap; align-items: center;
  gap: var(--sp-2); margin-top: var(--sp-3); }
/* §5.5: actions in the card stay finger targets (≥44px). */
.acard-actions button, .acard-actions .btn { min-height: 44px; }
/* Card actions may be plain links (/webhooks: "GitHub App →"). */
.acard-actions a { min-height: 44px; display: inline-flex; align-items: center; }

@media (max-width: 767px) {
  .tbl-scroll.tbl-cards { display: none; }   /* hide the wide table on mobile */
  .acard-list { display: block; }            /* cards take over */
}

/* ============================================================================
   GitHub App admin page (/integrations/github, plan task 9): app header,
   owner checklist, assignment forms in table cells, foreign marker.
   CSP: classes only. Touch targets ≥ 44px (pattern .acard-actions).
   ============================================================================ */
.gh-head { display: flex; flex-wrap: wrap; align-items: center;
  gap: var(--sp-2) var(--sp-4); }
.gh-head h2 { margin: 0; }
.gh-ok { color: var(--ok, #168a7f); font-weight: 600; }
.gh-warn { color: #9b7a4a; font-weight: 600; }
.gh-check { list-style: none; margin: var(--sp-3) 0; padding: 0; }
.gh-check li { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2);
  min-height: 44px; padding: var(--sp-1) 0; border-bottom: 1px solid var(--line, #e2e0dc); }
.gh-check .btn { min-height: 44px; display: inline-flex; align-items: center; }
.gh-assign { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2);
  margin-right: var(--sp-2); }
.gh-assign select { min-height: 44px; max-width: 18rem; }
.gh-assign button { min-height: 44px; white-space: nowrap; }
.gh-manifest { margin: var(--sp-4) 0; }
.gh-manifest button { min-height: 44px; }
.gh-remove { margin-top: var(--sp-5); }
.gh-remove summary { cursor: pointer; min-height: 44px; display: flex; align-items: center;
  color: var(--muted, #888); }
/* §5.5: secret form and "remove app" are also finger targets (≥44px). */
.gh-secret button, .gh-remove form button { min-height: 44px; }
tr.is-foreign td { background: rgba(155, 122, 74, 0.08); }

/* ============================================================================
   Polish /einstellungen (owner 2026-11-23: "grid error … polish smoothly").
   Finding: the create forms were flex-wrap with align-items:flex-end —
   the checkbox fieldsets pulled every row to their height, fields slid
   down, large empty areas. Now a grid: fields on top, fieldsets full
   width with chips, button below on the left. Touch targets ≥ 44 px remain.
   ============================================================================ */
.set-anchors { margin: var(--sp-4) 0 var(--sp-5); padding: 6px;
  gap: 6px; border: 1px solid var(--line); border-radius: 999px;
  background: color-mix(in oklab, var(--panel) 82%, transparent);
  backdrop-filter: saturate(1.3) blur(10px); box-shadow: var(--shadow); }
.set-anchor, .set-anchor:visited { border-color: transparent; color: var(--muted);
  padding: 0 var(--sp-4); transition: background .15s, color .15s; }
.set-anchor:hover { background: var(--raised); color: var(--fg); }
.set-anchor { flex: none; }                       /* scroll on mobile instead of squeezing */
.set-section > .muted { max-width: 72ch; }
/* The sr-only label in the agent form is absolutely positioned: without
   a reference point it hung off the viewport and stretched the page to 501 px width on mobile
   (measurement 2026-11-23). The scroll container becomes its reference point. */
.set-tbl { position: relative; }

/* Create forms (agent, token): grid instead of flex-wrap. */
.set-section .token-create form { display: grid; align-items: start;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 14px 16px; }
.set-section .token-create form > fieldset,
.set-section .token-create form > button { grid-column: 1 / -1; }
.set-section .token-create form > button { justify-self: start; }
.set-section .token-create > h3 { margin: 0 0 14px; font-family: var(--font-display);
  font-size: 15px; font-weight: 600; }
.set-section .token-create fieldset { display: flex; flex-wrap: wrap; gap: 8px; margin: 0;
  min-width: 0; }
.set-section .token-create .chk { display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--raised); font-size: 0.85rem; cursor: pointer;
  transition: border-color .15s, background .15s; }
.set-section .token-create .chk:hover { border-color: var(--accent); }
.set-section .token-create .chk:has(input:checked) { border-color: var(--accent);
  background: color-mix(in oklab, var(--accent) 12%, var(--raised)); }
.set-section .token-create .chk input { min-height: 0; width: 16px; height: 16px; margin: 0;
  accent-color: var(--accent); }

/* Profile: two fields side by side, without a second card inside the card. */
.set-profile { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px; align-items: end; max-width: 48rem; margin-top: 14px; }
.set-profile label { display: flex; flex-direction: column; gap: 6px; font-size: 0.82rem;
  color: var(--muted); }
.set-profile button { grid-column: 1 / -1; justify-self: start; }

/* Tables: text and 44 px buttons on one line, actions on the right in one row. */
.set-section td { vertical-align: middle; }
.set-section td.nowrap { white-space: nowrap; font-variant-numeric: tabular-nums; }
.row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px;
  flex-wrap: wrap; }
.row-actions .inline-form { display: inline-flex; align-items: center; gap: 8px; }
.btn-danger { color: var(--danger); }
.btn-danger:hover { border-color: var(--danger);
  background: color-mix(in oklab, var(--danger) 8%, transparent); }

@media (max-width: 767px) {
  .set-anchors { border-radius: var(--r); }
  .set-profile { grid-template-columns: minmax(0, 1fr); }
  .row-actions { justify-content: flex-start; }
}

/* Settings: language choice (task 06b09311) — two pills, >= 44 px touch targets. */
.set-lang { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.set-lang a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px;
  border: 1px solid var(--line); border-radius: 999px; color: var(--fg); text-decoration: none; }
.set-lang a:hover { background: var(--raised); }
.set-lang a[aria-current="true"] { background: var(--accent-soft); border-color: var(--accent-border);
  color: var(--accent); font-weight: 600; }

/* Settings overview (task 06ad32b9): setup checklist + one card per area. */
.set-setup-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; }
.set-progress { height: 6px; border-radius: 3px; background: var(--raised); overflow: hidden; }
.set-progress > i { display: block; height: 100%; background: var(--brand-grad); }
.set-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.set-step { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center;
  gap: 12px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--raised); }
.set-step-num { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 700; font-size: 13px; border: 2px solid var(--accent); color: var(--accent); }
.set-step.is-done .set-step-num { background: var(--ok); border-color: var(--ok); color: var(--panel); }
.set-step.is-done strong { color: var(--muted); text-decoration: line-through; }
.set-step-body { display: grid; gap: 2px; min-width: 0; }
.set-step-go { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px;
  border-radius: 12px; border: 1px solid var(--line); color: var(--fg); text-decoration: none;
  font-weight: 600; white-space: nowrap; }
.set-step-go.is-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.set-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 16px; }
.set-card { display: grid; gap: 6px; align-content: start; text-decoration: none; color: var(--fg); }
.set-card:hover { border-color: var(--accent-border); }
.acct-menu .menu-group a { color: inherit; text-decoration: none; }
@media (max-width: 599px) {
  .set-step { grid-template-columns: 32px minmax(0, 1fr); }
  .set-step > :last-child { grid-column: 2; justify-self: start; }
}
/* Visual check 2026-11-27: account menu items were 37 px; the owner's rule is
   touch targets >= 44 px. Active settings pill gets the accent state. */
.acct-menu .menu-item { min-height: 44px; }
.set-anchor[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
/* Empty-state rows in the wide settings tables stay visible and wrap on
   phones instead of running off inside the scroll container (DE check). */
@media (max-width: 767px) {
  .set-tbl td[colspan] { position: sticky; left: 0; max-width: calc(100vw - 7rem); white-space: normal; }
}
/* Setup progress: three steps, width from data-done (no inline style, CSP). */
.set-progress > i { width: 0; }
.set-progress[data-done="1"] > i { width: 33.34%; }
.set-progress[data-done="2"] > i { width: 66.67%; }
.set-progress[data-done="3"] > i { width: 100%; }
/* Login language switch: >= 44 px touch target (the owner's rule). */
.login-lang { margin: 0; text-align: center; }
.login-lang a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; }
