/* ============================================================================
   utilities.css — geteilte, wiederverwendbare Bausteine
   ----------------------------------------------------------------------------
   Klassen, die von mehreren Komponenten benutzt werden und deshalb NICHT in
   eine scoped .razor.css gehören. Prefix: `.w4l-`.

   Aktuell:
   - Geteilte Toggle-Pill-Bar (.w4l-pill*) — genutzt von OwnerPillBar,
     ActionPlanFilterBar.
   ============================================================================ */

/* ── Objekt-Level-Deep-Link Flash ──────────────────────────────────────────
   Kurzes Hervorheben eines per ?focus=<guid> angesprungenen Objekts (id="obj-<guid>").
   Global, weil das Ziel auf beliebigen Seiten liegt (Mirror von .ap-group-flash). */
.w4l-nav-flash { animation: w4lNavFlash 1.6s ease; }
@keyframes w4lNavFlash {
    0% { box-shadow: 0 0 0 2px var(--accent-fill-rest); }
    100% { box-shadow: 0 0 0 2px transparent; }
}

/* ── Preview reveal flash (spec 2026-10-12 §4.5) ─────────────────────────────
   Added by window.w4lRevealAndFlash to the revealed concern block / finding rows: a short
   tint that fades out — no side line, no filter, all blocks stay visible. Global because the
   JS helper targets two components. Off under prefers-reduced-motion (the helper skips it too). */
.w4l-preview-flash { animation: w4lPreviewFlash 2s ease-out; border-radius: 4px; }
@keyframes w4lPreviewFlash {
    0%, 30% { background-color: color-mix(in srgb, var(--accent-fill-rest) 16%, transparent); }
    100% { background-color: transparent; }
}
@media (prefers-reduced-motion: reduce) {
    .w4l-preview-flash { animation: none; }
}

/* -- Concern status dot (spec 2026-10-12 D9) --------------------------------
   One look for the plan view, the selector and the journey panel head.
   Colour via the semantic tokens; the status is always spelled out next to it. */
.w4l-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    display: inline-block;
    background: var(--neutral-stroke-strong-rest);
}
.w4l-status-dot.red { background: var(--w4l-negative); }
.w4l-status-dot.amber { background: var(--w4l-warning); }
.w4l-status-dot.green { background: var(--w4l-positive); }

/* ── Toggle-Pill-Bar ───────────────────────────────────────────────────────
   Farbcodierte An/Aus-Pills. Die Identitäts-/Kategoriefarbe wird pro Pill inline
   als `--pill-color` gesetzt. Komponenten-spezifische Extras (Combine-/Reset-
   Buttons, Spacer, nicht-schrumpfender Container) bleiben in der jeweiligen
   scoped .razor.css. */
.w4l-pillbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.w4l-pill {
    --pill-color: var(--neutral-stroke-rest);
    --pill-border: var(--pill-color);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 11px;
    border-radius: 999px;
    border: 1.5px solid var(--pill-border);
    background: transparent;
    color: var(--neutral-foreground-rest);
    white-space: nowrap;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.4;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

/* On: filled tint of the identity colour. */
.w4l-pill--on {
    background: color-mix(in srgb, var(--pill-color) 18%, transparent);
}

/* Off: dashed border and hollow dot; the text keeps its colour (R2). */
.w4l-pill--off {
    border-style: dashed;
    border-color: color-mix(in srgb, var(--pill-border) 55%, transparent);
    background: transparent;
}

.w4l-pill:hover {
    background: color-mix(in srgb, var(--pill-color) 28%, transparent);
}

.w4l-pill--off:hover {
    background: color-mix(in srgb, var(--pill-color) 12%, transparent);
    border-color: var(--pill-border);
}

.w4l-pill:focus-visible {
    outline: 2px solid var(--accent-fill-rest);
    outline-offset: 2px;
}

@media (pointer: coarse) {
    .w4l-pill {
        min-height: 44px;
    }
}

.w4l-pill-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--pill-color);
    flex-shrink: 0;
}

/* Hohler Punkt, wenn ausgeblendet. */
.w4l-pill--off .w4l-pill-dot {
    background: transparent;
    border: 1.5px solid var(--pill-color);
}

/* Last pill rule: same specificity as the dot rules above, later wins. */
@media (forced-colors: active) {
    .w4l-pill {
        border: 2px solid ButtonText;
        color: ButtonText;
    }

    .w4l-pill--off {
        border: 1px dashed ButtonText;
    }

    .w4l-pill--off:hover {
        border-color: ButtonText;
    }

    .w4l-pill-dot {
        forced-color-adjust: none;
        background: CanvasText;
    }

    .w4l-pill--off .w4l-pill-dot {
        background: transparent;
        border: 1.5px solid CanvasText;
    }

    .w4l-pill:focus-visible {
        outline: 2px solid Highlight;
    }
}

/* Section show/hide switch (rule R3): a native checkbox styled as a toggle, FAST-free. Display-only: it hides or shows a
   section and writes nothing to the scenario, except the Economy feature switches, which write data and are disabled on
   read-only examples instead. Markup contract (text before the input, so `input + track` works):
   <label class="w4l-switch [w4l-view-switch]"><span class="w4l-switch__text">..</span><input type="checkbox" role="switch" aria-label=".." />
   <span class="w4l-switch__track" aria-hidden="true"></span></label>
   .w4l-switch is deliberately NOT in the read-only :is() block (further down): that block would dim the whole label (text)
   to 0.75. View-only switches carry the marker .w4l-view-switch; data-writing ones bind disabled. */
.w4l-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: none;
    min-height: 24px;
    cursor: pointer;
    font-size: 0.8125rem;
    font-weight: 400;
    color: var(--neutral-foreground-rest);
    white-space: nowrap;
}

.w4l-switch input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    margin: 0;
    cursor: inherit;
}

.w4l-switch__track {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
    flex: none;
    border-radius: 11px;
    background: var(--neutral-stroke-strong-rest);
    transition: background 0.15s ease;
    pointer-events: none;
}

.w4l-switch__track::before {
    content: "";
    position: absolute;
    left: 2px;
    top: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    transition: transform 0.15s ease;
}

.w4l-switch input:checked + .w4l-switch__track { background: var(--accent-fill-rest); }
.w4l-switch input:checked + .w4l-switch__track::before { transform: translateX(18px); }
.w4l-switch input:focus-visible + .w4l-switch__track { outline: 2px solid var(--accent-fill-rest); outline-offset: 2px; }

/* Disabled dims only the track, never the text. */
.w4l-switch input:disabled + .w4l-switch__track { opacity: 0.4; }
.w4l-switch:has(input:disabled) { cursor: not-allowed; }

@media (pointer: coarse) { .w4l-switch { min-height: 44px; } }

/* Last switch rule: state shows as knob position + filled track. */
@media (forced-colors: active) {
    .w4l-switch__track {
        border: 1px solid ButtonText;
        background: Canvas;
        forced-color-adjust: none;
    }

    .w4l-switch__track::before { background: ButtonText; }
    .w4l-switch input:checked + .w4l-switch__track { background: Highlight; }
    .w4l-switch input:checked + .w4l-switch__track::before { background: Canvas; }
    .w4l-switch input:disabled + .w4l-switch__track { opacity: 1; }
    .w4l-switch input:disabled + .w4l-switch__track { border-color: GrayText; }
    .w4l-switch input:disabled + .w4l-switch__track::before { background: GrayText; }
    .w4l-switch input:focus-visible + .w4l-switch__track { outline-color: Highlight; }
}

.w4l-pill-divider {
    width: 1px;
    align-self: stretch;
    margin: 2px 4px;
    background: var(--neutral-stroke-divider-rest);
}

/* Base label of a layered view (plain text, R2, owner O2): same metrics as a pill so the row's baseline does not jump,
   rest colour because it is the anchor. Dot solid, no ring. */
.layer-base {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 4px 3px 0;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--neutral-foreground-rest);
    white-space: nowrap;
}

/* Read-only legend (colour key + text, no state). Square swatches: dots belong to pills. */
.w4l-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 20px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.w4l-legend-entry {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--neutral-foreground-rest);
    font-variant-numeric: tabular-nums;
}

.w4l-legend-swatch {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 2px;
    background: var(--swatch);
    outline: 1px solid color-mix(in srgb, var(--neutral-foreground-rest) 40%, transparent);
    outline-offset: -1px;
    flex: none;
}

.w4l-legend-heading {
    font-size: 12px;
    font-weight: 600;
    color: var(--neutral-foreground-hint);
    margin-bottom: 6px;
}

/* ── Admin-Tabellen ────────────────────────────────────────────────────────
   Schlichte HTML-Tabellen auf den internen Admin-Seiten (NewsletterAdmin,
   UserManager). Ersetzt die früher pro Zelle wiederholten Inline-Styles. Die
   Rahmenfarben sind theme-aware via FluentUI-Tokens (die alten #ddd/#eee waren
   nicht dark-mode-tauglich). */
.w4l-table-scroll {
    overflow-x: auto;
}

/* Scroll affordance: a soft edge shadow appears on the side that has more content (background-attachment trick). */
.w4l-scroll-shadow {
    overflow-x: auto;
    background:
        linear-gradient(to right, var(--neutral-layer-1) 30%, transparent) left / 28px 100% no-repeat local,
        linear-gradient(to left, var(--neutral-layer-1) 30%, transparent) right / 28px 100% no-repeat local,
        radial-gradient(farthest-side at 0 50%, color-mix(in srgb, var(--neutral-foreground-rest) 28%, transparent), transparent) left / 10px 100% no-repeat scroll,
        radial-gradient(farthest-side at 100% 50%, color-mix(in srgb, var(--neutral-foreground-rest) 28%, transparent), transparent) right / 10px 100% no-repeat scroll;
}

.w4l-admin-table {
    width: 100%;
    border-collapse: collapse;
}

.w4l-admin-table thead tr {
    border-bottom: 1px solid var(--neutral-stroke-rest);
}

.w4l-admin-table tbody tr {
    border-bottom: 1px solid var(--neutral-stroke-divider-rest);
}

.w4l-admin-table th {
    text-align: left;
    padding: 8px;
}

.w4l-admin-table td {
    padding: 8px;
}

/* Zellen, die reine Zahlen/Zeitstempel tragen — gleiche Ziffernbreite, damit
   Spalten untereinander fluchten. */
.w4l-admin-table .num {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* Filterleiste über einer Admin-Liste: Suchfeld + Selects + Zähler. Sitzt direkt
   unter dem sticky IconTitle-Header, deshalb kein eigener Rahmen — nur Abstand. */
.w4l-admin-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 0.75rem;
}

.w4l-admin-filters .grow {
    flex: 1 1 220px;
    min-width: 180px;
}

.w4l-admin-filters .w4l-select {
    width: auto;
    min-width: 150px;
}

/* Two-column key/value list for detail cards. */
.w4l-kv {
    display: grid;
    grid-template-columns: max-content 1fr;
    column-gap: 16px;
    row-gap: 6px;
    margin: 0;
}
.w4l-kv dt { color: var(--neutral-foreground-hint); font-size: 12px; }
.w4l-kv dd { margin: 0; }

.w4l-admin-count {
    font-size: 12px;
    color: var(--neutral-foreground-hint);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* Status-Pille in Admin-Tabellen. Ersetzt den früher pro Seite kopierten
   Inline-<style>-Block (AdvisorApplications). Farben ausschliesslich über
   Tokens — kein Hex, damit Dark Mode trägt. */
.w4l-admin-status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    white-space: nowrap;
    background: var(--neutral-fill-secondary-rest);
    color: var(--neutral-foreground-rest);
}

.w4l-admin-status.is-positive {
    background: color-mix(in srgb, var(--w4l-positive) 18%, transparent);
    color: var(--w4l-positive);
}

.w4l-admin-status.is-pending {
    background: color-mix(in srgb, var(--w4l-warning) 18%, transparent);
    color: var(--w4l-warning);
}

.w4l-admin-status.is-negative {
    background: color-mix(in srgb, var(--w4l-negative) 18%, transparent);
    color: var(--w4l-negative);
}

/* Aktionszelle: Buttons ohne Umbruch, rechtsbündig am Zeilenende. */
.w4l-admin-actions {
    display: flex;
    gap: 4px;
    justify-content: flex-end;
    white-space: nowrap;
}

/* Textlink in einer Aktionszelle — optisch auf der Höhe der XS-Buttons daneben. */
.w4l-admin-link {
    display: inline-flex;
    align-items: center;
    padding: 0 6px;
    font-size: 12px;
    color: var(--accent-fill-rest);
    text-decoration: none;
    white-space: nowrap;
}

.w4l-admin-link:hover {
    text-decoration: underline;
}

/* Pager unter einer Liste. */
.w4l-admin-pager {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 0.75rem;
}

/* Gestapelte Kleinliste in einer Zelle (Qualifikationen, Dokument-Links). */
.w4l-admin-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.85rem;
}

.w4l-admin-list a {
    color: var(--accent-fill-rest);
    text-decoration: none;
}

.w4l-admin-list a:hover {
    text-decoration: underline;
}

/* Freitext-Notiz in einer Zelle (Bewerber-Notiz, Review-Begründung). */
.w4l-admin-note {
    margin-top: 6px;
    font-size: 0.8rem;
    color: var(--neutral-foreground-hint);
    max-width: 320px;
    white-space: pre-wrap;
}

/* Zweitzeile unter einem Primärwert in einer Zelle (E-Mail unter dem Namen). */
.w4l-admin-sub {
    font-size: 0.82rem;
    color: var(--neutral-foreground-hint);
}

/* Bereichs-Kacheln der /Admin-Übersicht. Native <button>, kein FAST-Element —
   die Übersicht wird bei jedem Wechsel in den Admin-Modus neu gemountet. */
.w4l-admin-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 10px;
}

.w4l-admin-tile {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 14px 16px;
    border: 1px solid var(--neutral-stroke-rest);
    border-radius: 6px;
    background: var(--neutral-layer-1);
    color: var(--neutral-foreground-rest);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.w4l-admin-tile:hover {
    background: var(--neutral-fill-stealth-hover);
    border-color: var(--neutral-stroke-hover);
}

.w4l-admin-tile-title {
    font-weight: 600;
}

.w4l-admin-tile-meta {
    font-size: 12px;
    color: var(--neutral-foreground-hint);
    font-variant-numeric: tabular-nums;
}

/* Empty-State einer Admin-Liste (trägt einen Zustand, kein Hilfstext). */
.w4l-admin-empty {
    padding: 2rem 1rem;
    text-align: center;
    color: var(--neutral-foreground-hint);
}

/* ── Native <select> — Fluent-styled Ersatz (vermeidet fluent-option FAST-Leaks)
   + schlichte Kennzahl-Tabelle. Verschoben aus components.css. ─────────────── */
.w4l-select-label {
    display: block;
    font-size: var(--type-ramp-minus-1-font-size, 12px);
    color: var(--neutral-foreground-rest, #242424);
    margin-bottom: 4px;
}

/* ── Dashed "ghost add" button — the generic add-row affordance (Sharing tree,
   blackout list, …). Was previously .fm-tree-add, defined only in Sharing's page
   <style>, so components rendering it outside /Sharing fell back to browser
   default chrome. ─────────────────────────────────────────────────────────────── */
.w4l-add-dashed {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    padding: 5px 8px;
    border-radius: 6px;
    border: 1px dashed var(--neutral-stroke-rest);
    background: transparent;
    color: var(--neutral-foreground-hint);
    font: inherit;
    font-size: 0.8rem;
    cursor: pointer;
}

.w4l-add-dashed:hover {
    border-color: var(--accent-fill-rest);
    color: var(--neutral-foreground-rest);
}

.w4l-neb-table {
    /* Volle Panel-Breite: die Tabelle führt die NEB-Karte an, die Kacheln fassen sie darunter
       zusammen — eine auf 520px geklemmte Tabelle liess das Panel rechts leer wirken. */
    width: 100%;
    border-collapse: collapse;
    font-size: var(--type-ramp-base-font-size, 14px);
}

.w4l-neb-table th,
.w4l-neb-table td {
    padding: 4px 8px;
    border-bottom: 1px solid var(--neutral-stroke-divider-rest, #e0e0e0);
}

.w4l-neb-table tfoot td {
    border-bottom: none;
    border-top: 2px solid var(--neutral-stroke-rest, #d1d1d1);
}

.w4l-select {
    font-family: var(--body-font, "Segoe UI", sans-serif);
    font-size: var(--type-ramp-base-font-size, 14px);
    height: 32px;
    width: 100%;
    box-sizing: border-box;
    padding: 0 8px;
    border: calc(var(--stroke-width, 1) * 1px) solid var(--neutral-stroke-rest, #d1d1d1);
    border-radius: calc(var(--control-corner-radius, 4) * 1px);
    background-color: var(--neutral-fill-input-rest, #fafafa);
    color: var(--neutral-foreground-rest, #242424);
    outline: none;
    cursor: pointer;
}

.w4l-select:hover {
    border-color: var(--neutral-stroke-hover, #a1a1a1);
}

.w4l-select:focus {
    border-color: var(--accent-fill-rest, #0078d4);
    box-shadow: 0 0 0 1px var(--accent-fill-rest, #0078d4);
}

/* ── Generisches 2-Spalten-Seiten-Layout (Contact, Account/Forgot/Reset/Confirm…)
   Verschoben aus components.css (inkl. der gekoppelten Media-Overrides). ────── */
.two-col-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 60px;
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
    align-items: start;
}

.hint-box {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 1.25rem;
    background: var(--neutral-layer-2);
    border-radius: 12px;
    border-left: 3px solid var(--accent-fill-rest);
    margin-bottom: 1rem;
}

/* Two fields side by side (e.g. Name+Email, Password+Confirm) */
.form-row-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* Tablet: context on top, form below */
@media (max-width: 899px) {
    .two-col-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .two-col-context {
        max-width: 600px;
    }
}

/* Mobile: side-by-side fields stacked again */
@media (max-width: 639px) {
    .form-row-2col {
        grid-template-columns: 1fr;
    }
}

/* ── Allocation board (shared: divorce custody grid, asset-takeover board on
      Relationship AND LastWill). Extracted from DivorceCustodyGrid.razor so the
      board renders on any page. Column accent via --col-accent custom property. ── */
.w4l-alloc-board {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
    align-items: start;
}

.w4l-alloc-board--two {
    grid-template-columns: 1fr 1fr;
}

.w4l-alloc-col {
    --col-accent: var(--neutral-stroke-strong-rest);
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px;
    border-radius: 8px;
    /* Subtle identity tint: keep-columns lean toward their person's color. */
    background: color-mix(in srgb, var(--col-accent) 6%, var(--neutral-layer-2));
    border-top: 3px solid var(--col-accent);
    min-height: 64px;
}

.w4l-alloc-col--tray {
    background: var(--neutral-layer-1);
    border-top-style: dashed;
}

.w4l-alloc-col-head {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    /* Neutraler Text — die Identität trägt der Akzent (Top-Border/Tint), nicht die Schrift. */
    color: var(--neutral-foreground-rest);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.w4l-alloc-col-head .w4l-alloc-col-count {
    opacity: 0.6;
    font-weight: 600;
}

.w4l-alloc-col-empty {
    font-size: 0.8rem;
    opacity: 0.45;
    padding: 6px 0;
}

.w4l-alloc-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px 10px;
    border-radius: 6px;
    background: color-mix(in srgb, var(--col-accent) 4%, var(--neutral-fill-rest));
    border: 1px solid var(--neutral-stroke-rest);
    border-left: 3px solid var(--col-accent);
}

.w4l-alloc-card-title {
    font-weight: 600;
    font-size: 0.92rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Drag handle of a card whose body holds inputs (divorce custody board): only this row is draggable,
   so it has to read as grabbable — larger title, visible grip, hover fill. */
.w4l-alloc-card-handle {
    margin: -4px -6px 0;
    padding: 2px 6px;
    border-radius: 4px;
    cursor: grab;
}

.w4l-alloc-card-handle:hover {
    background: var(--neutral-fill-stealth-hover);
}

.w4l-alloc-card-handle:active {
    cursor: grabbing;
}

.w4l-alloc-card-handle .w4l-alloc-card-title {
    font-size: 1.05rem;
}

.w4l-alloc-card-handle .w4l-alloc-card-grip {
    margin-right: 4px;
    opacity: 0.75;
}

.w4l-alloc-card-facts {
    font-size: 0.8rem;
    opacity: 0.7;
    font-variant-numeric: tabular-nums;
}

.w4l-alloc-card-hint {
    font-size: 0.75rem;
    opacity: 0.6;
    font-style: italic;
}

/* A hint that carries a STATE (split caption, "Annahme: ..." line, purchase hint) must stay readable: full contrast,
   no italics (UI review M2). The faint italic class above stays for the plain "-> zahlt ..." hints. */
.w4l-alloc-card-hint--state {
    opacity: 1;
    font-style: normal;
    color: var(--neutral-foreground-rest);
}

/* Per-child decree editor (native <details> — FAST-leak-safe, no Fluent accordion). */
.w4l-alloc-card-details {
    margin-top: 6px;
    font-size: 0.8rem;
}

.w4l-alloc-card-details summary {
    cursor: pointer;
    font-weight: 600;
    opacity: 0.8;
}

/* Assumed custody chip on the divorce custody board (read-time default, spec 2026-09-14). The text carries
   the meaning; the warning tint only rhymes with finding F7's Amber. */
.w4l-alloc-card-assumed-row {
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
    margin: 2px 0 0;
}
.w4l-alloc-card-assumed {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 1px 8px;
    border: 1px solid color-mix(in srgb, var(--w4l-warning) 45%, transparent);
    background: color-mix(in srgb, var(--w4l-warning) 10%, transparent);
    border-radius: 999px;
    font-size: 0.74rem; font-weight: 600;
    color: var(--neutral-foreground-rest);
    width: fit-content;
}

/* Alternating-custody toggle + care-share slider (Slice 2 Task 8b) — a secondary control on the
   custody board card, own flex row with a real touch target, not the compact 0.75-0.8rem text rows
   around it. draggable="false" (set on the wrapper in the markup) keeps the card's own native drag
   from starting inside this subtree. Greyed via opacity (not display:none) while the custody is
   only assumed — the user should see the assumption before confirming it. */
.w4l-alloc-card-alt {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 2px 0;
}
.w4l-alloc-card-alt label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
}
.w4l-alloc-card-alt input[type="range"] {
    width: 100%;
    height: 24px;
}
.w4l-alloc-card-alt--assumed {
    opacity: 0.6;
}
@media (pointer: coarse) {
    .w4l-alloc-card-alt input[type="range"] { height: 32px; }
}

.w4l-decree-row {
    /* One maintenance phase in the ~380px card: title + delete / period / total | of which care.
       A hairline separates stacked phases — only between phases, not under the title. */
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: end;
    gap: 6px 12px;
    margin: 8px 0;
}

.w4l-decree-row + .w4l-decree-row {
    padding-top: 8px;
    border-top: 1px solid var(--neutral-stroke-divider-rest);
}

.w4l-decree-head,
.w4l-decree-period {
    grid-column: 1 / -1;
}

.w4l-decree-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
}

/* Decree block under the card facts: small icon title with the add icon, phases below. */
.w4l-decree {
    margin-top: 6px;
    font-size: 0.8rem;
}

.w4l-alloc-col-foot {
    margin-top: 2px;
    padding-top: 6px;
    border-top: 1px dashed var(--neutral-stroke-divider-rest);
    font-size: 0.78rem;
    font-weight: 600;
    opacity: 0.75;
    font-variant-numeric: tabular-nums;
}

/* Ergebnis-Streifen unter dem Board (Buy-out / Erben-Ausgleich), drei Zustände:
   neutral (Zahlung), balanced, .w4l-alloc-summary--warn (Kinder würden schulden). */
.w4l-alloc-summary {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    padding: 8px 12px;
    border-radius: 6px;
    background: var(--neutral-layer-2);
    font-size: 0.82rem;
    font-variant-numeric: tabular-nums;
}

.w4l-alloc-summary--warn {
    border-left: 3px solid var(--w4l-warning);
    background: color-mix(in srgb, var(--w4l-warning) 8%, var(--neutral-layer-2));
}

@media (max-width: 639px) {
    .w4l-alloc-board,
    .w4l-alloc-board--two { grid-template-columns: 1fr; }
}

/* ─────────────────────────────────────────────────────────────────────────────
   Divorce settlement — shared, page-level styling for the three topic sections
   (Vermögen / Vorsorge / Unterhalt) and their result idioms. Consolidated here
   (formerly inline <style> in MatrimonialSettlementSummaryCard) so every split
   settlement component + DivorceSupportSummary shares ONE definition, independent
   of which component renders. Colours are tokens only (Docs/Css.md).
   ───────────────────────────────────────────────────────────────────────────── */

/* Directional money flows render via the shared SettlementFlow component
   (P1 fixed left, P2 fixed right — scoped CSS in SettlementFlow.razor.css). */

/* Parallel result-row treatment, shared by all divorce settlement results. */
.w4l-divorce-result {
    border-top: 1px solid var(--neutral-stroke-rest);
    margin-top: 16px;
    padding-top: 14px;
}
.w4l-divorce-result--first {
    border-top: none;
    margin-top: 0;
    padding-top: 0;
}
.w4l-divorce-result-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
}
.w4l-divorce-result-label {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    opacity: 0.7;
}
.w4l-divorce-result-cite {
    font-size: 0.75rem;
    opacity: 0.55;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.w4l-divorce-result-sub {
    font-weight: 600;
    font-size: 0.95rem;
    font-variant-numeric: tabular-nums;
    margin: 2px 0;
}
.w4l-divorce-result-sub .w4l-divorce-result-sublabel {
    font-weight: 400;
    opacity: 0.7;
    margin-right: 6px;
}
.w4l-divorce-result-foot {
    opacity: 0.6;
    font-size: 0.8rem;
    margin-top: 6px;
}

/* Pension-equalization booking-gap note (UX spec 2026-09-28) — a fact + finding pointer, not a
   valuation: no --error-/--warning- token, no bold, no uppercase tracking. */
.w4l-divorce-result-note {
    font-size: 0.75rem;
    opacity: 0.7;
    margin-top: 6px;
    line-height: 1.4;
}

/* Small chart caption inside a divorce result card (labels the chart below it). */
.w4l-divorce-result-sublabel-line {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    opacity: 0.55;
    margin-top: 14px;
}

/* ==========================================================================
   Side-panel dock chrome (SidePanelHost + BotPanel / ChatDock / HelpCenterPanel)
   Ersetzt FluentDialogHeader/FluentDialogBody der früheren DialogService-Panels:
   fixer Header oben, scrollender Body darunter. Der Host (.w4l-sidepanel,
   scoped in SidePanelHost.razor.css) ist eine fixe Flex-Spalte rechts.
   ========================================================================== */
.w4l-dock-header {
    flex: 0 0 auto;
    padding: 12px 16px 8px 16px;
    border-bottom: 1px solid var(--neutral-stroke-divider-rest);
}

.w4l-dock-body {
    flex: 1 1 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 8px 16px 12px 16px;
    box-sizing: border-box;
    overflow-y: auto;
}

/* ==========================================================================
   Arbeitsbereich-Struktur (Pilot: /Income)
   --------------------------------------------------------------------------
   Zwei Ebenen statt überall gleicher Karten:

   .w4l-section     — gliedert NUR durch Überschrift + Weissraum. Keine Fläche,
                      kein Rand, kein Radius: liegt direkt auf dem Seitengrund.
   .w4l-edit-panel  — das kontextuelle Panel zum selektierten Objekt. Leicht gefüllte,
                      inset liegende Fläche (Radius + Padding), die es vom Seitengrund
                      abhebt — dieselbe Farbe wie die Folder-Spalten auf /Sharing.

   Bewusst NICHT gemacht: ein farbiger Herkunftsbalken (Personenfarbe) am Panel.
   Waagrecht las er sich nur als weiterer Divider, senkrecht hätte er eine zusätzliche
   vertikale Linie in einen Bereich gebracht, der bereits von den Regionslinien
   (Nav/Preview) strukturiert wird — verworfen 2026-07-14.
   ========================================================================== */

.w4l-section {
    display: block;
    /* .w4l-page-body setzt gap:10px — zusammen ergibt das den Sektionsabstand,
       der die weggefallenen Kartenränder als Gliederung ersetzt. */
    margin-bottom: 1.25rem;
}

/* Das Panel ist eine leicht gefüllte, INSET liegende Fläche (Radius + rundum-Padding),
   die das selektierte Objekt vom Seitengrund abhebt. Hintergrundfarbe = dieselbe wie
   die Folder-Spalten auf /Sharing (--fm-panel-bg), theme-neutral: --neutral-fill-
   secondary flippt selbst mit Light/Dark, deshalb kein prefers-color-scheme nötig.

   Historie: früher ein rahmenloses BAND mit zwei 2px-Begrenzern (keine Fläche). Die
   Fläche liest sich ruhiger und trennt zwei gestapelte Panels (z.B. AutoBudget) besser
   als die reine Linie. Bewusst KEIN Schatten (als „schlecht" verworfen 2026-07-15) und
   KEINE volle Breite: die Fläche liegt durch das rundum-Padding im Inhaltsfluss, endet
   also weit vor der scrollenden Preview-Kante — die alte Scrollbar-Clipping-Sorge (eine
   randlose Vollfüllung bricht ein paar Pixel vor der Kante ab) trifft die inset Fläche
   nicht. Verschachtelung wäre das einzige Risiko (Fläche in Fläche), kommt aber nicht
   vor: kein Panel-Formular bettet ein anderes ein. */
.w4l-edit-panel {
    display: block;
    box-sizing: border-box;
    background: color-mix(in srgb, var(--neutral-fill-secondary-rest) 50%, transparent);
    border-radius: 8px;
    padding: 1.25rem 1.25rem 1.5rem 1.25rem;
}

/* Verschachteltes Edit-Panel (Panel im Panel — z. B. Tranche im Home-Panel, Domizil-Segment im
   Residence-Panel): die EINE erlaubte Verschachtelungsebene bekommt statt einer zweiten,
   dunkler gestapelten Füllung den BASIS-Seitengrund — das Inset hebt sich HELL vom gefüllten
   Eltern-Panel ab (Sichttest-Entscheid 2026-07-16, Tranche/Mortgage in HomeForm; als Regel
   verallgemeinert 2026-07-17). Zusatzklasse ZU .w4l-edit-panel, überschreibt nur die Füllung. */
.w4l-edit-panel-nested {
    background: var(--fill-color);
}

/* Wiederholte Listen-Zeile INNERHALB des Panels (Hypotheken, wertvermehrende
   Investitionen, Tranchen …). Früher je eine <FluentCard Style="padding:.5rem">.

   Auch hier gilt die Liniensprache: eine Zeile ist keine Karte. Gleichrangige,
   gestapelte Peers trennt eine Haarlinie ZWISCHEN ihnen (`+`-Selektor) — nicht ein
   Rahmen UM jede. Ein Kasten pro Zeile hätte in einem Panel, das selbst schon von
   zwei Begrenzern gehalten wird, ein drittes Rahmensystem eingeführt.

   Nebeneffekt: <fluent-card> im @foreach ist das dokumentierte Leak-Muster
   (eine $fastController-Retention PRO ZEILE, Docs/BlazorFastLeaks.md).

   Die Zeilen müssen dafür ADJAZENTE Geschwister sein — deshalb der eigene
   .w4l-rows-Container statt direkt im FluentStack (dessen gap sonst zusätzlich
   zwischen Linie und Inhalt stünde und die Trennlinie freistellen würde). */
.w4l-rows {
    display: block;
    width: 100%;
}

.w4l-row {
    display: block;
    box-sizing: border-box;
    padding: 0.5rem 0;
}

.w4l-row + .w4l-row {
    border-top: 1px solid var(--neutral-stroke-rest);
}

/* Key/value-Zeile (Label links, Wert rechts, tabellarische Ziffern); .w4l-row--sum macht sie zur fetten Ergebniszeile. */
.w4l-row--kv {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 0.875rem;
    font-variant-numeric: tabular-nums;
}

.w4l-row--sum {
    font-weight: 700;
}

/* Secondary key/value row (a derived share, a footnote figure): hint colour, same layout. */
.w4l-row--mute {
    color: var(--neutral-foreground-hint);
}

/* ── KPI-Kacheln ──────────────────────────────────────────────────────────────
   Reine ANZEIGE-Werte innerhalb eines Panels — Docs/DesignBacklog.md §2: berechnete
   Grössen werden als Kachel gerendert, NICHT als disabled Input-Feld (ein graues
   Eingabefeld lädt zum Tippen ein und verspricht Editierbarkeit, die es nicht gibt).

   Muster stammt aus <LiabilitiesKpiRow>; es war danach dreimal als scoped CSS kopiert
   (.lkr-*, .dus-*, .hf-afford-*). Hier einmal global, weil Blazor-Scoped-CSS sich nicht
   teilen lässt und die Kopien visuell auseinanderzulaufen begannen. Neue Kachel-Reihen
   verwenden diese Klassen; die verbleibenden Altkopien (.lkr-*, .hf-afford-*) ziehen
   separat nach. */
.w4l-kpi {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-content: flex-start;
}

.w4l-kpi-card {
    flex: 1 1 0;
    min-width: 130px;
    padding: 8px 10px;
    border: 1px solid var(--neutral-stroke-rest);
    border-radius: 6px;
    background: var(--neutral-layer-1);
}

/* Vier Kacheln in einer schmalen Arbeitsspalte (≈ 520 px): 2×2 statt 3+1-Waise (min-width 130 px + gap bräuchte 544 px).
   Misst die Breite des umgebenden Containers (container-type: inline-size am Elternelement), nicht den Viewport:
   die Arbeitsspalte ist bei 1280 px Viewport nur ≈ 520 px breit. Ab 561 px Container wieder eine Reihe. */
.w4l-kpi--quad > .w4l-kpi-card {
    flex: 1 1 calc(50% - 4px);
    min-width: 0;
}

@container (min-width: 561px) {
    .w4l-kpi--quad > .w4l-kpi-card {
        flex: 1 1 0;
        min-width: 130px;
    }
}

/* Drei Kacheln (3a-Jahrespanel): eine Spalte unter ca. 400 px Container (das Elternelement traegt container-type: inline-size), sonst drei. */
.w4l-kpi--tri > .w4l-kpi-card {
    display: flex;
    flex-direction: column;   /* D4 (3a Ausschoepfung): bars and buttons sit flush at the bottom via margin-top:auto; only this row */
    flex: 1 1 100%;
    min-width: 0;
}

@container (min-width: 400px) {
    .w4l-kpi--tri > .w4l-kpi-card {
        flex: 1 1 0;
    }
}

/* Schmaler Balken am Fuss einer Kachel (Farbe als Token am inneren span); der Prozentwert steht im Sub, der Balken ist aria-hidden. */
.w4l-kpi-bar {
    height: 6px;
    border-radius: 3px;
    background: var(--neutral-stroke-divider-rest);
    overflow: hidden;
}

.w4l-kpi-bar > span {
    display: block;
    height: 100%;
}

/* In der Drei-Kachel-Reihe (Flex-Spalte) sitzt der Balken am Fuss der Kachel. */
.w4l-kpi--tri > .w4l-kpi-card > .w4l-kpi-bar {
    margin-top: auto;
}

/* Für Kacheln mit langem Wert (z. B. eine Periode «03.2036 – 12.2037»). */
.w4l-kpi-card--wide {
    min-width: 175px;
}

/* Für Kacheln mit einer Aktion (z. B. «Übernehmen»-Button) unter Label/Wert/Sub-Zeile.
   Ohne dies klebt ein FluentButton links unter der Sub-Zeile, statt mit den übrigen
   Zeilen zentriert und abgesetzt zu sitzen. */
.w4l-kpi-card--action {
    text-align: center;
}

.w4l-kpi-card--action fluent-button {
    margin-top: 6px;
}

.w4l-kpi-label {
    font-size: 12px;
    color: var(--neutral-foreground-hint);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    text-align: center;
}

.w4l-kpi-value {
    font-size: 18px;
    font-weight: 700;
    margin-top: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.w4l-kpi-sub {
    font-size: 12px;
    color: var(--neutral-foreground-hint);
    text-align: center;
    margin-top: 2px;
    font-variant-numeric: tabular-nums;
}

/* Kleine Zwischenüberschrift, die den Eingabe- vom Resultatteil eines Panels trennt.
   Trägt den Trenner selbst (border-top) — kein zusätzliches Divider-Element nötig. */
.w4l-kpi-caption {
    border-top: 1px solid var(--neutral-stroke-divider-rest);
    padding-top: 0.75rem;
    margin-bottom: 0.5rem;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--neutral-foreground-hint);
}

/* ── Header-Aktions-Icons der Panel-Kopfzeile ─────────────────────────────────
   Gehört zu <PanelHeaderActions> (Components/Application/Shared) — die Komponente
   ist die einzige Stelle, die diese Klassen setzt; siehe Docs/DesignBacklog.md §3.

   Reihenfolge: [Toggles] [Extras] [Duplicate] [Delete] │ Haarlinie │ [X].
   Die Haarlinie trennt die Objekt-Aktionen von der Panel-Aktion (und schafft
   Abstand zwischen Delete und X gegen Fehlklicks).

   ≤639px (sm): die Objekt-Aktionen wandern ins Three-Dot-Menü, das X bleibt
   sichtbar. Umschalten per display:none statt @if — FAST-Komponenten dürfen nicht
   branch-getoggelt werden (Docs/BlazorFastLeaks.md). */
.w4l-header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.w4l-header-actions__desktop {
    display: flex;
    align-items: center;
    gap: 4px;
}

.w4l-header-actions__sep {
    width: 1px;
    height: 20px;
    background: var(--neutral-stroke-divider-rest);
    margin: 0 4px;
}

.w4l-header-actions .w4l-header-actions__mobile {
    display: none;
}

@media (max-width: 639px) {
    .w4l-header-actions__desktop { display: none; }
    .w4l-header-actions .w4l-header-actions__mobile { display: inline-flex; }
}

/* Delete ist ein Einzelklick (der Bestätigungsdialog des Hosts IST der Confirm-Schritt) —
   Rot ist nur ein Hover-Hinweis, kein Zustand, den ein Klick umschaltet. */
.w4l-header-actions__delete:hover svg,
.w4l-header-actions__delete:focus-visible svg {
    color: var(--error, #ef4444);
    fill: var(--error, #ef4444);
}

/* ── Vertikaler Formular-Stack ────────────────────────────────────────────────
   Container für gestapelte Formularblöcke INNERHALB einer (Sub-)Sektion: der
   Abstand kommt deklarativ aus `gap` statt aus <VerticalSpacer>-Ketten zwischen
   den Blöcken. Vorteile: der Rhythmus steht an EINER Stelle, und gap kollabiert
   nicht unter flex-shrink (die Spacer-Falle, siehe `.w4l-page-body > *` in
   components.css). Migration opportunistisch beim nächsten Anfassen einer Seite —
   kein Big-Bang (Docs/Css.md «Vertikale Abstände»).
   Abstände an STRUKTURGRENZEN (Divider-Titel, Section, Edit-Panel) gehören
   weiterhin der Struktur selbst — ein .w4l-stack endet an ihnen. */
.w4l-stack {
    display: flex;
    flex-direction: column;
    gap: var(--w4l-space-s, 16px);
    width: 100%;
}

.w4l-stack--tight {
    gap: var(--w4l-space-xs, 8px);
}

/* ── Titel-Spalte (IconTitle + IconTitleEdit) ─────────────────────────────────
   Titelzeile plus optionale Meta-Zeile darunter. Das ist der Ersatz für den
   verworfenen Farbbalken: die Zugehörigkeit des Panels wird über INHALT getragen
   (der Zeitraum spiegelt den selektierten Gantt-Balken), nicht über Rahmenwerk.

   Die Meta-Zeile ist optional; ohne sie rendert die Spalte identisch zum früheren
   Flach-Layout (ein einziges Kind → kein sichtbarer Unterschied). */

/* Äusserer Flex-Container der Titelzeile (Icon | Titel-Spalte | TitleBadge).
   WICHTIG: der PersonChip-Balken wird im TitleBadge-Slot deklariert, zieht sich aber per
   `order: -1` (PersonChip.razor.css) vor das Icon — er MUSS deshalb ein direktes Kind
   dieses Containers bleiben. Läge er in .w4l-title-col, wäre das ein anderer
   Flex-Container und `order` verschöbe ihn nur noch innerhalb der Titelzeile. */
.w4l-title-host {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 1;
    min-width: 0;
}

/* Mit Meta-Zeile ist der Titelblock zweizeilig. Icon (und Personen-Balken, sofern er nicht
   ohnehin `align-self: stretch` trägt) oben ausrichten statt gegen beide Zeilen zentrieren —
   zentriert schwebte das Icon sonst auf Höhe der Lücke zwischen Titel und Meta.
   Dieselbe Klasse trägt auch IconTitle.AllowTitleWrap: ein auf schmalen Viewports
   umbrechender Titel wird ebenfalls zweizeilig, das Icon soll dann genauso oben sitzen. */
.w4l-title-host--meta {
    align-items: flex-start;
}

/* Innenabstand der Preview-Inhalte. Pane, Card und die beiden Body-Wrapper sind bewusst
   padding-frei — nur so beginnt die Kopfzeile voll-bleed ganz oben UND kann das scrollende
   FindingsPanel bis an alle Kanten reichen (seine Scrollbar läuft dadurch von der
   Titel-Trennlinie bis zum unteren Rand, bündig rechts). Den Abstand tragen deshalb die
   Inhalts-Container selbst — dieser hier für Charts und Tabellen, das FindingsPanel bringt
   seinen eigenen mit. */
.w4l-preview-pad {
    padding: 1rem;
    box-sizing: border-box;
}

.w4l-title-col {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.w4l-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

/* Opt-in (IconTitle, only with a help badge on a meta/wrapped title): top-align so the badge sits on the first line. */
.w4l-title-row--top {
    align-items: flex-start;
}

/* Spiegelt, was der selektierte Gantt-Balken geometrisch zeigt (Typ · Zeitraum ·
   Pensum) — dadurch ist die Zuordnung überprüfbar statt bloss räumlich unterstellt.
   tabular-nums, damit die Datumszahlen nicht zappeln. */
.w4l-title-meta {
    font-size: var(--type-ramp-minus-1-font-size, 12px);
    line-height: 1.35;
    color: var(--neutral-foreground-hint);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.w4l-title-meta--wrap {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Meta line with a lead element (IconTitleEdit.MetaPrefix, e.g. a state badge): the lead keeps its width
   (.ym-badge is flex 0 0 auto), the text shrinks and ellipsises. min-width:0 on the text is required,
   a flex item's default min-width:auto would stop the ellipsis and push the row wider instead. */
.w4l-title-meta-row {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.w4l-title-meta-row > .w4l-title-meta {
    flex: 0 1 auto;
    min-width: 0;
}

/* ──────────────────────────────────────────────────────────────────────────
   Öffentlicher «Rechner»-Hub + /rechner/*-Rechner (SEO-Teaser, Free Tools).
   Linien-Sprache: Bänder statt Karten, Haarlinien zwischen Zeilen, keine Fläche.
   ────────────────────────────────────────────────────────────────────────── */
/* Rechner-Seiten laufen im App-Shell (ContentLayout → .layout-content trägt bereits
   Scroll + Padding). Kein eigenes max-width/margin/Padding mehr — der Content füllt die
   Arbeitsbreite wie jede andere App-Seite (vorher: stark eingerückt). */
.w4l-rechner {
    display: block;
    padding-bottom: 1.5rem;
}

/* Native, leak-freie Zahleneingabe — Optik parallel zu .w4l-select. */
.w4l-number-input {
    font-family: var(--body-font, "Segoe UI", sans-serif);
    font-size: var(--type-ramp-base-font-size, 14px);
    height: 32px;
    width: 100%;
    box-sizing: border-box;
    padding: 0 8px;
    border: calc(var(--stroke-width, 1) * 1px) solid var(--neutral-stroke-rest, #d1d1d1);
    border-radius: calc(var(--control-corner-radius, 4) * 1px);
    background-color: var(--neutral-fill-input-rest, #fafafa);
    color: var(--neutral-foreground-rest, #242424);
    outline: none;
}
.w4l-number-input:hover { border-color: var(--neutral-stroke-hover, #a1a1a1); }
.w4l-number-input:focus {
    border-color: var(--accent-fill-rest, #0078d4);
    box-shadow: 0 0 0 1px var(--accent-fill-rest, #0078d4);
}

/* Native, leak-freie Text-/Datum-/Zeit-Eingabe — Optik parallel zu .w4l-select / .w4l-number-input.
   Deckt <input type="text|date|time"> + <textarea> ab (u.a. Scheduler-Formen: Booking-Panel,
   Blockers, Availability-Header). BEWUSST OHNE width:100% — die Klasse sitzt sowohl in
   flex-column-Panels (dort streckt align-items:stretch die Felder ohnehin auf volle Breite) als
   auch in inline-Zeilen (Blockers, Wochenraster, Propose-Zeile), wo 100% das Layout brechen würde. */
.w4l-text-input {
    font-family: var(--body-font, "Segoe UI", sans-serif);
    font-size: var(--type-ramp-base-font-size, 14px);
    height: 32px;
    box-sizing: border-box;
    padding: 0 8px;
    border: calc(var(--stroke-width, 1) * 1px) solid var(--neutral-stroke-rest, #d1d1d1);
    border-radius: calc(var(--control-corner-radius, 4) * 1px);
    background-color: var(--neutral-fill-input-rest, #fafafa);
    color: var(--neutral-foreground-rest, #242424);
    outline: none;
}
textarea.w4l-text-input { height: auto; min-height: 52px; padding: 6px 8px; resize: vertical; line-height: 1.35; }
.w4l-text-input::placeholder { color: var(--neutral-foreground-hint, #616161); }
.w4l-text-input:hover { border-color: var(--neutral-stroke-hover, #a1a1a1); }
.w4l-text-input:focus {
    border-color: var(--accent-fill-rest, #0078d4);
    box-shadow: 0 0 0 1px var(--accent-fill-rest, #0078d4);
}
.w4l-text-input:disabled { opacity: 0.6; cursor: not-allowed; }

/* Zwei Spalten: Eingaben | Ergebnis. Stapelt unter 860px. */
.w4l-rechner-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: var(--w4l-space-m, 32px);
    align-items: start;
    margin-top: var(--w4l-space-m, 32px);
}
@media (max-width: 859px) {
    .w4l-rechner { padding-left: 20px; padding-right: 20px; }
    .w4l-rechner-grid { grid-template-columns: 1fr; }
}

/* Eingabe-/Ergebnisspalte als Band (border-top/-bottom, keine Karte). */
.w4l-rechner-panel {
    border-top: 2px solid var(--neutral-stroke-rest, #d1d1d1);
    padding-top: var(--w4l-space-s, 16px);
    display: flex;
    flex-direction: column;
    gap: var(--w4l-space-s, 16px);
}
.w4l-rechner-field { display: block; }
.w4l-rechner-hint {
    display: block;
    font-size: var(--type-ramp-minus-1-font-size, 12px);
    color: var(--neutral-foreground-hint);
    margin-top: 4px;
}
.w4l-rechner-checkline {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: var(--type-ramp-base-font-size, 14px);
}
.w4l-rechner-actions { margin-top: var(--w4l-space-xs, 8px); }
/* Inline text action under a field (e.g. "use maximum" on the pillar-3a calculator). */
.w4l-rechner-linkbtn {
    display: inline-block;
    margin-top: 4px;
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    font-size: var(--type-ramp-minus-1-font-size, 12px);
    color: var(--accent-fill-rest, #0078d4);
    cursor: pointer;
    text-align: left;
}
.w4l-rechner-linkbtn:hover:not(:disabled) { text-decoration: underline; }
.w4l-rechner-linkbtn:focus-visible { outline: 2px solid var(--accent-fill-rest, #0078d4); outline-offset: 2px; }
.w4l-rechner-linkbtn:disabled { color: var(--neutral-foreground-hint); cursor: default; }
.w4l-rechner-error {
    color: var(--w4l-negative, #ef4444);
    font-size: var(--type-ramp-minus-1-font-size, 12px);
}
/* Field-adjacent variant: the message sits under the offending input, not by the submit button. */
.w4l-rechner-field > .w4l-rechner-error { display: block; margin-top: 4px; }

/* Ergebnis: eine grosse Zahl (KPI) + Haarlinien-Aufschlüsselung. */
.w4l-rechner-kpi { display: block; margin-bottom: var(--w4l-space-s, 16px); }
.w4l-rechner-kpi-label {
    display: block;
    font-size: var(--type-ramp-minus-1-font-size, 12px);
    color: var(--neutral-foreground-hint);
    margin-bottom: 2px;
}
.w4l-rechner-kpi-value {
    display: block;
    font-size: clamp(1.8rem, 4vw, 2.4rem);
    font-weight: 700;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
    color: var(--neutral-foreground-rest, #242424);
}
.w4l-rechner-kpi-sub {
    display: block;
    font-size: var(--type-ramp-minus-1-font-size, 12px);
    color: var(--neutral-foreground-hint);
    margin-top: 2px;
}
.w4l-rechner-kpi-value.is-positive { color: var(--w4l-positive, #10b981); }
.w4l-rechner-kpi-value.is-negative { color: var(--w4l-negative, #ef4444); }

.w4l-rechner-breakdown { display: flex; flex-direction: column; }
.w4l-rechner-breakrow {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 8px 0;
    font-size: var(--type-ramp-base-font-size, 14px);
    font-variant-numeric: tabular-nums;
}
.w4l-rechner-breakrow + .w4l-rechner-breakrow {
    border-top: 1px solid var(--neutral-stroke-rest, #d1d1d1);
}
.w4l-rechner-breakrow .label { color: var(--neutral-foreground-hint); }
/* Mini-heading inside a breakdown: separates co-existing decompositions of the same total
   (e.g. by tax base vs by authority) so the numbers are not read as one chain. */
.w4l-rechner-breakhead {
    font-size: var(--type-ramp-minus-1-font-size, 12px);
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--neutral-foreground-hint);
    padding: 12px 0 4px;
}
.w4l-rechner-breakdown > .w4l-rechner-breakhead:first-child { padding-top: 0; }

.w4l-rechner-placeholder {
    color: var(--neutral-foreground-hint);
    font-size: var(--type-ramp-base-font-size, 14px);
    padding: var(--w4l-space-m, 32px) 0;
}
.w4l-rechner-note {
    font-size: var(--type-ramp-minus-1-font-size, 12px);
    color: var(--neutral-foreground-hint);
    line-height: 1.4;
}
.w4l-rechner-notes { margin: 8px 0 0 0; padding-left: 18px; }
.w4l-rechner-notes li { margin-bottom: 4px; }

/* Upgrade-Bridge (Momentaufnahme → Film) — dezentes Band, keine Karte. */
.w4l-rechner-bridge {
    margin-top: var(--w4l-space-xl, 48px);
    border-top: 2px solid var(--accent-fill-rest, #0078d4);
    padding-top: var(--w4l-space-m, 32px);
}
.w4l-rechner-bridge h2 {
    font-size: clamp(1.2rem, 2.5vw, 1.6rem);
    font-weight: 700;
    margin: 0 0 8px 0;
}
.w4l-rechner-bridge p {
    color: var(--neutral-foreground-hint);
    max-width: 640px;
    margin: 0 0 20px 0;
    line-height: 1.5;
}

/* Rechner result visuals - parts-of-a-whole in a sequential accent-tint ramp (one hue,
   strong to light). Identity is carried by the labeled breakdown rows + legend dots,
   never by hue alone, so the ramp also works decolored (white-label accents derive
   every step from --accent-fill-rest via color-mix; the plain line above each
   color-mix line is the pre-color-mix browser fallback). */
.w4l-rechner-seg-1 { background: var(--accent-fill-rest, #0078d4); }
.w4l-rechner-seg-2 { background: var(--accent-fill-rest, #0078d4); background: color-mix(in srgb, var(--accent-fill-rest, #0078d4) 72%, transparent); }
.w4l-rechner-seg-3 { background: var(--accent-fill-rest, #0078d4); background: color-mix(in srgb, var(--accent-fill-rest, #0078d4) 48%, transparent); }
.w4l-rechner-seg-4 { background: var(--accent-fill-rest, #0078d4); background: color-mix(in srgb, var(--accent-fill-rest, #0078d4) 28%, transparent); }
.w4l-rechner-seg-5 { background: var(--accent-fill-rest, #0078d4); background: color-mix(in srgb, var(--accent-fill-rest, #0078d4) 14%, transparent); }
.w4l-rechner-seg-pos { background: var(--w4l-positive, #10b981); }
.w4l-rechner-seg-rest { background: var(--neutral-fill-secondary-rest, #f0f0f0); }

/* Legend dot inside a breakdown-row label - ties the row to its bar segment. */
.w4l-rechner-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 2px;
    margin-right: 6px;
}

/* Horizontal parts-of-a-whole bar (RechnerResultBar). 2px surface gaps between fills. */
.w4l-rechner-bar {
    display: flex;
    gap: 2px;
    height: 28px;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: var(--w4l-space-s, 16px);
}
.w4l-rechner-bar > div { min-width: 2px; }

/* AHV pension scale strip: neutral track from minimum to maximum full pension,
   accent fill up to the computed pension. */
.w4l-ahvscale { margin-bottom: var(--w4l-space-s, 16px); }
.w4l-ahvscale-track {
    height: 12px;
    border-radius: 4px;
    background: var(--neutral-fill-secondary-rest, #f0f0f0);
    overflow: hidden;
}
.w4l-ahvscale-fill {
    height: 100%;
    background: var(--accent-fill-rest, #0078d4);
}
.w4l-ahvscale-ticks {
    display: flex;
    justify-content: space-between;
    margin-top: 4px;
    font-size: var(--type-ramp-minus-1-font-size, 12px);
    color: var(--neutral-foreground-hint);
    font-variant-numeric: tabular-nums;
}

/* Quiet scenario bridge link (the band itself is the existing .w4l-rechner-bridge). */
.w4l-rechner-bridge-link {
    font-weight: 600;
    color: var(--accent-fill-rest, #0078d4);
    text-decoration: none;
}
.w4l-rechner-bridge-link:hover { text-decoration: underline; }

/* Hub tile: icon row + decorative mini result preview. */
.w4l-rechner-tile-head {
    display: flex;
    align-items: center;
    gap: 8px;
}
.w4l-rechner-tile-mini {
    display: flex;
    gap: 2px;
    height: 10px;
    border-radius: 2px;
    overflow: hidden;
    margin-top: 6px;
}
.w4l-rechner-tile-mini > span { min-width: 2px; }

/* FIDLEG-Disclaimer. */
.w4l-rechner-disclaimer {
    margin-top: var(--w4l-space-m, 32px);
    font-size: var(--type-ramp-minus-1-font-size, 12px);
    color: var(--neutral-foreground-hint);
    line-height: 1.45;
    border-top: 1px solid var(--neutral-stroke-rest, #d1d1d1);
    padding-top: var(--w4l-space-s, 16px);
}

/* Hub-Kachelraster. */
.w4l-rechner-hubgrid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: var(--w4l-space-s, 16px);
    margin-top: var(--w4l-space-m, 32px);
}
.w4l-rechner-tile {
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-decoration: none;
    color: inherit;
    border: 1px solid var(--neutral-stroke-rest, #d1d1d1);
    border-radius: calc(var(--control-corner-radius, 4) * 1px);
    padding: 20px;
    transition: border-color 0.12s ease, transform 0.12s ease;
}
.w4l-rechner-tile:hover {
    border-color: var(--accent-fill-rest, #0078d4);
    transform: translateY(-1px);
}
.w4l-rechner-tile-title {
    font-size: var(--type-ramp-plus-1-font-size, 16px);
    font-weight: 700;
}
.w4l-rechner-tile-teaser {
    font-size: var(--type-ramp-minus-1-font-size, 12px);
    color: var(--neutral-foreground-hint);
    line-height: 1.4;
    flex: 1;
}
.w4l-rechner-tile-cta {
    font-size: var(--type-ramp-minus-1-font-size, 12px);
    font-weight: 600;
    color: var(--accent-fill-rest, #0078d4);
}

/* ── Checkbox ────────────────────────────────────────────────────────────────
   Shared look for the native <input type="checkbox">. Native on purpose: the
   FluentUI/FAST checkbox leaks its controller on every DOM removal, and these
   boxes live in repeatedly rebuilt lists (action-plan rows, recurring chips).
   Styling is therefore CSS-only — never swap this for a component. */
.w4l-check {
    appearance: none;
    -webkit-appearance: none;
    flex: 0 0 auto;
    width: 15px;
    height: 15px;
    margin: 0;
    display: inline-grid;
    place-content: center;
    border: 1px solid var(--neutral-stroke-strong-rest, #8a8a8a);
    border-radius: 3px;
    background: var(--neutral-fill-input-rest, transparent);
    cursor: pointer;
    transition: background-color 0.12s ease, border-color 0.12s ease;
}
.w4l-check:hover {
    border-color: var(--accent-fill-rest, #0078d4);
}
/* Checkmark drawn as a scaled-in glyph so the transition has something to animate. */
.w4l-check::before {
    content: "";
    width: 9px;
    height: 9px;
    transform: scale(0);
    transition: transform 0.12s ease-in-out;
    background: var(--foreground-on-accent-rest, #fff);
    clip-path: polygon(14% 47%, 0 61%, 39% 100%, 100% 22%, 85% 8%, 38% 71%);
}
.w4l-check:checked {
    background: var(--accent-fill-rest, #0078d4);
    border-color: var(--accent-fill-rest, #0078d4);
}
.w4l-check:checked::before {
    transform: scale(1);
}
/* Outline (not box-shadow) so the ring is never clipped by the rounded corners
   or by an ancestor's overflow. */
.w4l-check:focus-visible {
    outline: 2px solid var(--accent-fill-rest, #0078d4);
    outline-offset: 2px;
}
.w4l-check:disabled {
    cursor: default;
    opacity: 0.4;
}

/* ── Blog author UI (/Account/Manage/Blog) ────────────────────────────────
   Leak-free native buttons + state texts, shared by the post list and the
   editor page. Colours via tokens only. */
.w4l-blog-btn {
    font: inherit;
    font-size: var(--type-ramp-minus-1-font-size, 12px);
    padding: 5px 12px;
    border-radius: calc(var(--control-corner-radius, 4) * 1px);
    cursor: pointer;
    background: transparent;
    border: calc(var(--stroke-width, 1) * 1px) solid var(--neutral-stroke-rest, #d1d1d1);
    color: var(--neutral-foreground-rest, #242424);
}

.w4l-blog-btn:hover:not(:disabled) {
    border-color: var(--neutral-stroke-hover, #a1a1a1);
}

.w4l-blog-btn:disabled {
    opacity: 0.5;
    cursor: default;
}

.w4l-blog-btn.is-primary {
    border-color: var(--accent-fill-rest, #0078d4);
    color: var(--accent-fill-rest, #0078d4);
}

/* Rejection reason in plain text below the status pill. */
.w4l-blog-review-note {
    font-size: var(--type-ramp-minus-1-font-size, 12px);
    color: var(--neutral-foreground-hint);
    margin-top: 4px;
    white-space: pre-wrap;
}

.w4l-blog-error {
    font-size: var(--type-ramp-minus-1-font-size, 12px);
    color: var(--w4l-negative);
}

.w4l-blog-note {
    font-size: var(--type-ramp-minus-1-font-size, 12px);
    color: var(--neutral-foreground-hint);
}

/* blog prose (shared with public reading layout) — single source of truth for the
   article body. Used by the public page (/blog/{slug}), the author preview and the
   admin review preview; those two render outside CSS isolation, so these rules are
   global rather than scoped. Line length is capped near 70ch — the biggest single
   readability lever. */
.w4l-blog-prose {
    max-width: 70ch;
    margin: 0 auto;
    padding: 32px 16px 64px;
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--neutral-foreground-rest);
    /* Defensive: user-generated content can carry unbreakable runs (a long URL, or —
       as seen in pasted articles — non-breaking spaces between every word). "anywhere"
       forces such runs to wrap inside the column instead of overflowing past the layout,
       and keeps the min-content size from blowing out the grid track. */
    overflow-wrap: anywhere;
}

.w4l-blog-prose h1 {
    font-size: 2.1rem;
    line-height: 1.2;
    margin: 0 0 8px;
}

.w4l-blog-lead {
    font-size: 1.2rem;
    color: var(--neutral-foreground-hint);
    margin: 0 0 12px;
}

.w4l-blog-prose h2 { font-size: 1.5rem; margin: 1.6em 0 0.5em; line-height: 1.3; }
.w4l-blog-prose h3 { font-size: 1.2rem; margin: 1.4em 0 0.4em; line-height: 1.3; }
.w4l-blog-prose p { margin: 0 0 1em; }

.w4l-blog-prose ul,
.w4l-blog-prose ol { margin: 0 0 1em; padding-left: 1.4em; }

.w4l-blog-prose blockquote {
    margin: 1.2em 0;
    padding: 0.2em 0 0.2em 1em;
    border-left: 3px solid var(--accent-fill-rest);
    color: var(--neutral-foreground-hint);
}

.w4l-blog-prose img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    margin: 1.2em 0;
}

.w4l-blog-prose figcaption {
    font-size: 0.85rem;
    color: var(--neutral-foreground-hint);
    text-align: center;
    margin-top: -0.8em;
    margin-bottom: 1.2em;
}

.w4l-blog-prose pre {
    background: var(--neutral-fill-secondary-rest);
    padding: 12px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 0 0 1em;
}

.w4l-blog-prose code { font-family: monospace; font-size: 0.9em; }

.w4l-blog-prose table {
    border-collapse: collapse;
    width: 100%;
    margin: 0 0 1em;
}

.w4l-blog-prose th,
.w4l-blog-prose td {
    border: 1px solid var(--neutral-stroke-rest);
    padding: 6px 10px;
    text-align: left;
}

.w4l-blog-header {
    margin-bottom: 32px;
}

.w4l-blog-hero {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    border-radius: 8px;
    margin: 0 0 32px;
}

.w4l-blog-byline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
    color: var(--neutral-foreground-hint);
}

.w4l-blog-byline-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
}

.w4l-blog-attribution {
    margin-top: 48px;
    padding-top: 12px;
    border-top: 1px solid var(--neutral-stroke-rest);
    font-size: 0.85rem;
    color: var(--neutral-foreground-hint);
}

/* ── Derived estimates (B34/B5) ───────────────────────────────────────────
   Marks a prefilled value that is still the tool's estimate (it equals its
   persisted seed). Two surfaces, one visual language:
     .w4l-estimate-hint — the wizard's line under an estimate-bearing field
     .w4l-estimate-chip — the editor's inline chip, with an optional refresh
                          button when the driver has moved underneath
   Native span/button only: both appear and disappear per keystroke, and a
   FAST element toggled that way leaks a controller (Docs/BlazorFastLeaks.md). */

.w4l-estimate-hint {
    display: inline-block;
    margin-top: 2px;
    font-size: 0.78rem;
    color: var(--neutral-foreground-hint);
}

.w4l-estimate-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    color: var(--neutral-foreground-hint);
}

.w4l-estimate-chip__refresh {
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    color: var(--accent-foreground-rest);
    text-decoration: underline;
    cursor: pointer;
}

.w4l-estimate-chip__refresh:hover {
    color: var(--accent-foreground-hover);
}

/* ── Example-scenario read-only interaction block ────────────────────────────
   Sits on the .card of PreviewLayout.razor — the layout that hosts the scenario
   pages — whenever a system-owned example is loaded (ScenarioState.IsReadOnly).
   Deliberately NOT on WorkspaceLayout (Start, Mail, Clients, Schedule, ...): those
   pages edit their own data, never the scenario, and would be frozen along with it.
   Blocks pointer interaction on data-entry controls; ScenarioState additionally
   reverts anything that slips through (keyboard), and the repository write
   guard is the authoritative backstop. Navigation/links stay usable.
   .w4l-pillswitch__seg (PillSwitch's native radio segments, e.g. the risk-page policy rows' type/cause/shape pills)
   is a data-entry control like the others here, so the block covers it. A switch that only changes the view and
   writes nothing to the scenario opts out with the marker class .w4l-view-switch (PillSwitch ViewOnly="true", or the
   class on the wrapper of another native switch); the exemption rule after this block restores pointer events and
   opacity for it. The marker is allow-listed per file (ViewSwitchMarkerLintTests): never put it on a control that
   writes the DTO. The risk pages' what-if mode switch is such a data-entry PillSwitch: blocked here
   in examples, plus Disabled against keyboard (the block is pointer-only); its Disabled dimming is neutralised below; .death-mode-pill no longer exists. */
.w4l-example-readonly :is(input, select, textarea,
    fluent-text-field, fluent-number-field, fluent-text-area, fluent-select, fluent-combobox,
    fluent-checkbox, fluent-switch, fluent-slider, fluent-radio-group, fluent-radio,
    .w4l-pillswitch__seg) {
    pointer-events: none;
    opacity: 0.75;
}
/* View-only switches (marker .w4l-view-switch, see the comment above the block): the higher specificity (0,3,0 against 0,2,0 of the block) and the later position win. The visually hidden
   native radio keeps its inert, invisible state; only the segment and a real select get their interaction back. */
.w4l-example-readonly .w4l-view-switch :is(input, select, .w4l-pillswitch__seg) { pointer-events: auto; opacity: 1; }
.w4l-example-readonly .w4l-view-switch .w4l-pillswitch__input { pointer-events: none; opacity: 0; }
/* Both read-only rules above set opacity with higher specificity than .w4l-switch input and would un-hide the native checkbox over the label. */
.w4l-example-readonly .w4l-switch input[type="checkbox"] { opacity: 0; }
/* The risk pages' saving mode switch (DisabilityOnsetControls/DeathOnsetControls: a PillSwitch that is a direct child of .doc-root) is Disabled in examples.
   Its own 0.5 would stack with the 0.75 of the segments above (0.375, unreadable), so the root keeps full opacity there and the segments dim once.
   The lock stays: pointer events are off on the segments and the radios are disabled for the keyboard. Scoped on purpose: other Disabled
   PillSwitches (children, participations, employee share) are domain locks and keep their 0.5. */
.w4l-example-readonly .doc-root > .w4l-pillswitch--disabled { opacity: 1; }

/* A «+» FluentButton in a group title (benefit staircase, spec 2026-10-12 §5) writes the DTO too. The button sits in a native
   span with this class, because a fluent-button in the :is() list above would also block view-only buttons. */
.w4l-example-readonly .w4l-title-add { pointer-events: none; opacity: 0.75; }

/* Household person pair picker (native radios + swap button): scoped class names, so listed explicitly (spec 2026-11-09). */
.w4l-example-readonly .hpp-grid, .w4l-example-readonly .hpp-swap { pointer-events: none; opacity: 0.75; }

/* Base of that span (IconTitle's action slot already right-aligns it) and the touch target of its icon-only button:
   44 px on coarse pointers, like the policy trash (memo 2026-10-12 wave 2 §12 Touch, S3b ui-ux F-7). The host size
   of a fluent-button can be raised from outside; its own :host height is only the minimum. */
.w4l-title-add { display: inline-flex; align-items: center; flex-shrink: 0; }

@media (pointer: coarse) { .w4l-title-add fluent-button { min-width: 44px; min-height: 44px; } }

/* The policy trash (below) and the IconTitleEdit rename toggle write the DTO as well (S6-7 ui-ux F-06): without this a mouse
   click in an example scenario opened the delete confirmation / the rename field before the server bounced the edit. The
   title text keeps its full opacity (it is a heading, not a control); only its click is blocked. */
.w4l-example-readonly .dpf-remove { pointer-events: none; opacity: 0.75; }
/* Invest/withdraw panel on Vermoegen (Geldfluss S4): the edit controls of the three parts and the phase actions sit in .iwp-edit — native
   buttons and SegmentedAssign segments the :is() list above does not reach. Selection (year stepper, phase bands, tabs) stays usable. */
.w4l-example-readonly .iwp-edit { pointer-events: none; opacity: 0.75; }
/* Same edit block when the plan lacks the feature (AdvancedInvestments) or the scenario is read-only: dimmed like FeatureGate
   (Disable mode, 0.55) and inert, so a gated user never meets a live-looking control that does nothing. */
.iwp-edit--locked { pointer-events: none; opacity: 0.55; cursor: not-allowed; }
/* Both at once (an example of a plan without the feature): the stronger dimming wins, not the example rule above (specificity). */
.w4l-example-readonly .iwp-edit--locked { opacity: 0.55; }
.w4l-example-readonly :is(.ite-title-text, .ite-edit-badge) { pointer-events: none; }

/* ── Disability policy object panel (spec 2026-10-12 §9) ──────────────────────
   Shared by DisabilityPolicyForm (EU-Rente) and DailyAllowancePolicyForm (Taggeld): the two scoped stylesheets were
   byte-identical (S6-7 ui-ux F-12), so one rule set lives here. The grid is FluentGrid (viewport breakpoints, canon C8);
   labels of different line counts keep the inputs bottom-aligned per row (memo §9). Class names kept (.dpf*) so the
   markup of both forms is unchanged. */
.dpf {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.dpf .dpf-grid {
    align-items: flex-end;
}

/* The label hint reserves two lines in both row-3 fields: the long hint wraps in a narrow column, and a one-line premium hint would
   otherwise sit 16 px off the pension input (brief 2026-10-14). */
/* Only from the sm breakpoint (640 px) up: stacked fields on a phone need no reserve. */
@media (min-width: 640px) {
    .dpf .ym-label-hint { min-height: 32px; }
}

.dpf select.w4l-select {
    width: 100%;
}

/* A PillSwitch is an inline-flex bar of nowrap segments: in a narrow sm=4 cell the term-life form's shape and beneficiary
   pills painted past the cell, over the waiver label (which then took the click) and past the card edge (H9 F1). Inside a
   policy panel the bar stays within its cell: whole segments wrap first, a single too-long label wraps inside its segment.
   Inert where the bar fits (the disability forms). */
.dpf .w4l-pillswitch {
    max-width: 100%;
    box-sizing: border-box;
    flex-wrap: wrap;
    border-radius: 16px;
}

.dpf .w4l-pillswitch__seg {
    min-width: 0;
    white-space: normal;
}

/* Delete in IconTitleEdit's action slot: a native button (no FAST element in an un-keyed list). */
.dpf-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin-left: auto;
    padding: 0;
    border: 0;
    border-radius: 4px;
    background: transparent;
    cursor: pointer;
}

.dpf-remove:hover {
    background: var(--neutral-fill-stealth-hover);
}

.dpf-remove:focus-visible {
    outline: 2px solid var(--accent-fill-rest);
    outline-offset: 1px;
}

@media (pointer: coarse) { .dpf-remove { width: 44px; height: 44px; } }

.dpf-state {
    margin: 0;
    font-size: 0.875rem;
    color: var(--neutral-foreground-rest);
}

/* ── Selectable option cards (radio semantics on a surface) ──────────────────
   The matrimonial-property-regime picker (RelationshipForm), the household-cash cost allocation
   (HouseholdCash) and the document-type chooser (ScenarioReportsCard) all wear
   this look. They cannot share ONE component: the document chooser has to wrap
   a single card in <FeatureGate>, and a shared component renders its options in
   an internal loop with no per-card slot. So the markup is authored per caller
   and only the look is shared — which is what utilities.css is for (Docs/Css.md).
   Lived in a <style> block inside OptionCardGroup.razor before; a markup <style>
   is NOT scoped by Blazor (only *.razor.css is), so these rules were already
   global — now they say so. */
.w4l-optcards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
    width: 100%;
}
.w4l-optcards--disabled {
    opacity: 0.5;
    pointer-events: none;
}
.w4l-optcard {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 10px 12px;
    border: 1px solid var(--neutral-stroke-divider-rest);
    border-radius: 8px;
    background: var(--neutral-fill-stealth-rest);
    color: var(--neutral-foreground-rest);
    text-align: left;
    cursor: pointer;
    transition: border-color 0.12s ease, background-color 0.12s ease;
}
.w4l-optcard:hover {
    background: var(--neutral-fill-stealth-hover);
    border-color: var(--neutral-stroke-rest);
}
.w4l-optcard--selected {
    border-color: var(--accent-fill-rest);
    background: color-mix(in srgb, var(--accent-fill-rest) 10%, transparent);
    cursor: default;
}
.w4l-optcard--selected:hover {
    background: color-mix(in srgb, var(--accent-fill-rest) 10%, transparent);
    border-color: var(--accent-fill-rest);
}
.w4l-optcard__title {
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.3;
}
.w4l-optcard--selected .w4l-optcard__title {
    color: var(--accent-foreground-rest);
}
.w4l-optcard__desc {
    font-size: 0.75rem;
    color: var(--neutral-foreground-hint);
    line-height: 1.4;
}

/* Compact read-only-signalling tag (e.g. ChildrenForm residence/custody carried over from
   a single phase, or derived from a prior marriage). Native span, not FluentBadge, because
   it is toggled under @if — see Docs/BlazorFastLeaks.md, row "@if toggling FAST components". */
.w4l-inherited-tag {
    font-size: 0.72rem;
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--neutral-fill-secondary-rest);
    color: var(--neutral-foreground-hint);
    display: inline-block;
    margin-left: 6px;
}

/* Menu entry that is locked but stays focusable (never `Disabled`, so the reason stays reachable):
   dimmed, "not-allowed" cursor, and the reason as its own wrapped second line (MortgageSection «+» menu).
   Global on purpose: the fluent-menu-item host lives outside the scoped-CSS ancestor chain. */
.w4l-menu-item--locked {
    height: auto;           /* FAST fixes the item height; the reason line needs the room */
    min-height: 32px;
    padding-block: 4px;
    opacity: 0.75;
    cursor: not-allowed;
}

.w4l-menu-item-sub {
    display: block;
    max-width: 22rem;
    white-space: normal;
    font-size: var(--type-ramp-minus-1-font-size);
    color: var(--neutral-foreground-hint);
}

/* Menu entry carrying user text of any length (e.g. "Compare with <scenario name>"): FAST never wraps
   item content, so a long name ran past the menu edge. One line, cut with an ellipsis; the item's
   title attribute carries the full text. Global for the same reason as above. */
.w4l-menu-item-ellipsis {
    display: block;
    max-width: 18rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── ValueSlider (shared) ── */
/* Rules of ValueSlider.razor, shared with PensionCapitalBar and the components that borrow value-slider__* classes
   (CashLimitsControl, ContributionRateBar, P3FillBar, PersonShareControl, FinancingStructureChart, EquitySourceList).
   Moved verbatim from the inline <style> of ValueSlider.razor (memo pfcert v2 §3.0); scoped overrides
   (AllocationRiskBar, DisabilityOnsetControls) keep winning through their b- attribute. */
    .value-slider {
        display: flex;
        flex-direction: column;
        gap: 4px;
        user-select: none;
    }

    /* SegmentLabelsAbove: the label row moves above the track (the markup keeps its order). */
    .value-slider--labels-above .value-slider__segment-labels {
        order: -1;
    }

    .value-slider__header {
        display: flex;
        justify-content: space-between;
        align-items: baseline;
        gap: 0.75rem;
    }

    .value-slider__title {
        font-size: 0.9rem;
        font-weight: 600;
        color: var(--neutral-foreground-rest);
    }

    .value-slider__title-suffix {
        margin-left: 0.35em;
        font-weight: 400;
        color: var(--neutral-foreground-hint);
    }

    .value-slider__value {
        font-size: 0.9rem;
        font-weight: 700;
        color: var(--accent-foreground-rest);
        font-variant-numeric: tabular-nums;
        white-space: nowrap;
    }

    /* ── Tick labels (above the bar) ── */
    /* No horizontal margin here — the labels must use the exact same 0..100% mapping as the
       tick marks inside .value-slider__track-area, otherwise they drift apart toward the edges. */
    .value-slider__tick-labels {
        position: relative;
        height: 16px;
    }

    .value-slider__tick-label {
        position: absolute;
        bottom: 0;
        transform: translateX(-50%);
        font-size: 0.75rem;
        color: var(--neutral-foreground-hint);
        font-variant-numeric: tabular-nums;
        white-space: nowrap;
        line-height: 1;
    }

    .value-slider__tick-label--start {
        transform: none;
    }

    .value-slider__tick-label--end {
        transform: translateX(-100%);
    }

    /* ── Beschriftete Marker (z. B. Pflichtteil / gesetzlich) ── */
    .value-slider__marker-labels {
        position: relative;
        height: 14px;
    }

    .value-slider__marker-label {
        position: absolute;
        bottom: 0;
        transform: translateX(-50%);
        font-size: 0.68rem;
        font-weight: 600;
        color: var(--accent-foreground-rest);
        white-space: nowrap;
        line-height: 1;
        pointer-events: none;
    }

    .value-slider__marker {
        position: absolute;
        top: -4px;
        bottom: -4px;
        width: 0;
        border-left: 2px dashed var(--accent-fill-rest);
        opacity: 0.85;
        pointer-events: none;
        z-index: 1;
    }

    /* ── Segments (employment sections etc.) ──
       Tones are theme-token mixes (no hex, light + dark for free); "none" is hatched so it does not rely on colour alone. */
    .value-slider__segs {
        position: absolute;
        inset: 0;
        border-radius: 4px;
        overflow: hidden;
        pointer-events: none;
    }

    .value-slider__seg {
        position: absolute;
        top: 0;
        bottom: 0;
        box-sizing: border-box;
        border-left: 1px solid var(--neutral-layer-1);
        pointer-events: none;
    }

    .value-slider__seg--primary {
        background: color-mix(in srgb, var(--accent-fill-rest) 28%, transparent);
    }

    .value-slider__seg--secondary {
        background: color-mix(in srgb, var(--w4l-info) 32%, transparent);
    }

    .value-slider__seg--tertiary {
        background: color-mix(in srgb, var(--w4l-income-accent) 32%, transparent);
    }

    .value-slider__seg--none {
        background: repeating-linear-gradient(
            135deg,
            color-mix(in srgb, var(--neutral-foreground-hint) 24%, transparent),
            color-mix(in srgb, var(--neutral-foreground-hint) 24%, transparent) 4px,
            transparent 4px,
            transparent 8px);
    }

    .value-slider__seg--neutral {
        background: color-mix(in srgb, var(--neutral-foreground-hint) 18%, transparent);
    }

    /* The segment's own palette colour (--seg-color, resolved by the caller): full, pale, and desaturated for an empty step. */
    .value-slider__seg--colour {
        background: color-mix(in srgb, var(--seg-color, var(--accent-fill-rest)) 78%, transparent);
    }

    .value-slider__seg--colour-dim {
        background: color-mix(in srgb, var(--seg-color, var(--accent-fill-rest)) 16%, transparent);
    }

    /* An empty step: its colour with little saturation (mixed towards the neutral hint), lighter than an included step. */
    .value-slider__seg--colour-empty {
        background: color-mix(in srgb, color-mix(in srgb, var(--seg-color, var(--accent-fill-rest)) 35%, var(--neutral-foreground-hint)) 30%, transparent);
    }

    .value-slider__segment-labels {
        position: relative;
        height: 16px;
        pointer-events: none;
    }

    /* Segment-wide size container: see the container query below the label rules. */
    .value-slider__segment-label-box {
        position: absolute;
        top: 0;
        container: value-slider-segment-label / inline-size;
        pointer-events: none;
    }

    .value-slider__segment-label {
        display: block;
        box-sizing: border-box;
        padding-right: 4px;
        font-size: 0.75rem;
        line-height: 16px;
        font-weight: 400;
        color: var(--neutral-foreground-hint);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        pointer-events: none;
    }

    .value-slider__segment-label--active {
        font-weight: 700;
        color: var(--neutral-foreground-rest);
    }

    /* A segment narrower than ~4 characters (plus the ellipsis) shows no label rather than «o…» (W2-H H7 M6). */
    @container value-slider-segment-label (max-width: 33px) {
        .value-slider__segment-label { display: none; }
    }

    /* ── Track area (the rect the knob drag measures) ── */
    .value-slider__track-area {
        position: relative;
        height: 26px;
        touch-action: pan-y pinch-zoom;
    }

    .value-slider__track {
        position: absolute;
        inset: 0;
        border-radius: 4px;
        background: var(--neutral-fill-stealth-rest);
        border: 1px solid var(--neutral-stroke-divider-rest);
        box-sizing: border-box;
    }

    .value-slider__fill {
        position: absolute;
        top: 0;
        bottom: 0;
        left: 0;
        border-radius: 4px;
        background: color-mix(in srgb, var(--accent-fill-rest) 20%, transparent);
        border: 1.4px solid var(--accent-fill-rest);
        box-sizing: border-box;
        pointer-events: none;
    }

    .value-slider__tick {
        position: absolute;
        top: -6px;
        bottom: 0;
        width: 0;
        border-left: 1px solid var(--neutral-stroke-divider-rest);
        opacity: 0.55;
        pointer-events: none;
    }

    /* Offenes Potential: schraffiertes Band zwischen Wert und Decke. */
    .value-slider__potential {
        position: absolute;
        top: 0;
        bottom: 0;
        border-radius: 4px;
        pointer-events: none;
        background: repeating-linear-gradient(
            45deg,
            color-mix(in srgb, var(--accent-fill-rest) 16%, transparent),
            color-mix(in srgb, var(--accent-fill-rest) 16%, transparent) 5px,
            transparent 5px,
            transparent 10px);
        border: 1px dashed color-mix(in srgb, var(--accent-fill-rest) 55%, transparent);
        box-sizing: border-box;
    }

    /* ── Drag handle — round knob, styled like the GanttTimeline grip ── */
    /* 16px transparent hit area, 12px visible circle (matches .gantt-grip / .gantt-grip::before). */
    .value-slider__knob {
        position: absolute;
        top: 0;
        bottom: 0;
        width: 16px;
        margin-left: -8px;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: ew-resize;
        touch-action: none;
        z-index: 2;
    }

    .value-slider__knob::before {
        content: "";
        width: 12px;
        height: 12px;
        border-radius: 50%;
        background-color: var(--neutral-layer-1);
        border: 1.5px solid var(--neutral-foreground-rest);
        box-sizing: border-box;
        transition: transform 0.1s ease;
    }

    .value-slider__knob:hover::before,
    .value-slider__knob:focus-visible::before {
        transform: scale(1.18);
    }

    .value-slider__knob:focus-visible {
        outline: 2px solid var(--accent-fill-rest);
        outline-offset: -1px;
        border-radius: 50%;
    }

    /* Touch: breiterer Hit-Bereich + grösserer Knob (gilt global, contrib-bar/p3fill
       überstimmen mit ihren 0,2,0-Regeln weiterhin die Geometrie). */
    @media (pointer: coarse) {
        .value-slider__knob {
            width: 32px;
            margin-left: -16px;
        }

        .value-slider__knob::before {
            width: 16px;
            height: 16px;
        }
    }

    /* Touch hit area ≥ 44×44 px (WCAG 2.5.5), invisible and out of the layout. `any-pointer` too: a touchscreen
       laptop driven by a mouse reports pointer:fine. The track pans the page vertically; only the knob is
       touch-action:none, so a drag that starts on the knob still works (touch-action intersects up the tree). */
    @media (pointer: coarse), (any-pointer: coarse) {
        .value-slider__track-area .value-slider__knob::after {
            content: "";
            position: absolute;
            left: 50%;
            top: 50%;
            width: 44px;
            height: 44px;
            transform: translate(-50%, -50%);
        }
    }

    /* ── SmoothDrag (ValueSlider.SmoothDrag, valueSliderDrag.js data-smooth) ──
       Knob, fill and potential band carry their position as --pos instead of an inline left/width; at rest that is the
       same box. While dragging, the script writes --drag-dx (px) on the track area and data-dragging on it and on the
       knob: the knob follows the pointer between detents, fill and band follow the knob. On release it sets
       data-settling and zeroes --drag-dx — the glide onto the detent is a transition on left/width (custom properties
       do not animate), none for reduced motion. Scoped to .value-slider--smooth: every other user of these classes
       keeps its inline left. */
    .value-slider--smooth .value-slider__knob {
        left: var(--pos);
    }

    .value-slider--smooth .value-slider__fill {
        width: var(--pos);
    }

    .value-slider--smooth .value-slider__potential {
        left: var(--pos);
        width: calc(var(--ceil) - var(--pos));
    }

    .value-slider--smooth .value-slider__track-area[data-dragging] .value-slider__knob[data-dragging] {
        left: calc(var(--pos) + var(--drag-dx, 0px));
    }

    .value-slider--smooth .value-slider__track-area[data-dragging] .value-slider__fill {
        width: calc(var(--pos) + var(--drag-dx, 0px));
    }

    .value-slider--smooth .value-slider__track-area[data-dragging] .value-slider__potential {
        left: calc(var(--pos) + var(--drag-dx, 0px));
        width: calc(var(--ceil) - var(--pos) - var(--drag-dx, 0px));
    }

    @media (prefers-reduced-motion: no-preference) {
        .value-slider--smooth .value-slider__track-area[data-settling] .value-slider__knob[data-dragging],
        .value-slider--smooth .value-slider__track-area[data-settling] .value-slider__fill,
        .value-slider--smooth .value-slider__track-area[data-settling] .value-slider__potential {
            transition: left 110ms ease-out, width 110ms ease-out;
        }
    }

    .value-slider--disabled {
        opacity: 0.65;
        pointer-events: none;
    }

    .value-slider--disabled .value-slider__knob {
        cursor: default;
    }
/* ── end ValueSlider (shared) ── */

/* ── Jump link (DeepLink, Docs/Forms.md §4/§7, C22) ── */
.w4l-link { display: inline-flex; align-items: center; gap: 4px; padding: 0; margin: 0; border: 0; background: none;
    font: inherit; font-size: 14px; font-weight: 600; line-height: 1.4; color: var(--accent-foreground-rest);
    text-decoration: none; cursor: pointer; border-radius: 2px; text-align: start; }
.w4l-link::after { content: ""; flex: none; width: 14px; height: 14px; background: currentColor;
    -webkit-mask: var(--w4l-icon-arrow-right) center/contain no-repeat; mask: var(--w4l-icon-arrow-right) center/contain no-repeat;
    transition: transform .12s ease; }
.w4l-link:hover { color: var(--accent-foreground-hover); text-decoration: underline; text-underline-offset: 3px; }
.w4l-link:hover::after { transform: translateX(2px); }
.w4l-link:active { color: var(--accent-foreground-active); }
.w4l-link:focus-visible { outline: 2px solid var(--focus-stroke-outer, var(--accent-fill-rest)); outline-offset: 2px; }
.w4l-link[aria-disabled="true"] { color: var(--neutral-foreground-disabled); cursor: not-allowed; text-decoration: none; }
.w4l-link[aria-disabled="true"]::after { transform: none; }
.w4l-link--inline { display: inline; font-size: inherit; font-weight: inherit; text-decoration: underline; text-underline-offset: 2px; }
.w4l-link--inline::after { content: none; }
.w4l-links { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 8px; }
@media (pointer: coarse) { .w4l-link { min-height: 32px; } }
@media (prefers-reduced-motion: reduce) { .w4l-link::after { transition: none; } }
@media (forced-colors: active) { .w4l-link::after { background: LinkText; } }

/* Assumption/state line under a benefit-staircase group title (/Death, /Disability stage panels). Was defined five times in
   scoped sheets with identical declarations; global so every stage panel shares one rule. */
.dbs-state {
    margin: 0.25rem 0 0.75rem 0;
    font-size: 0.875rem;
    color: var(--neutral-foreground-rest);
    max-width: 60rem;
}

/* Own-event marker (action plan, slice 3): a hollow ring in the accent colour. One marker everywhere —
   spine sub-heading, collapsed-year chip, overview diamond. A solid dot would read as "modelled";
   a dashed ring is the draft-year dot (.aps-rail-dot--draft). Tokens only. */
.w4l-own-dot {
    display: inline-block;
    flex: 0 0 auto;
    box-sizing: border-box;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid var(--accent-fill-rest);
    background: transparent;
    align-self: center;
}

.w4l-own-dot--sm {
    width: 10px;
    height: 10px;
}

.w4l-own-dot--lg {
    width: 18px;
    height: 18px;
}

/* ── Admin building blocks (theme lab slice 4b, R-UX4b-28/-31/-32/-35): shared by the theme catalogue, the detail page and the
   editor, so they are written once here instead of per scoped sheet. ── */

/* Row action: a text button with a >= 28 px hit area (WCAG 2.2 AA 2.5.8 asks 24 px). Works on <a> and <button>. */
.w4l-row-btn {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 6px;
    font: inherit;
    font-size: 13px;
    border: 0;
    background: none;
    color: var(--accent-fill-rest);
    text-decoration: none;
    cursor: pointer;
}

.w4l-row-btn:hover:not([disabled]):not([aria-disabled="true"]) {
    text-decoration: underline;
}

.w4l-row-btn:focus-visible {
    outline: 2px solid var(--focus-stroke-outer, currentColor);
    outline-offset: 2px;
}

/* The quiet variant (delete): normal readable text, not the accent. */
.w4l-row-btn-quiet {
    color: var(--neutral-foreground-rest);
}

.w4l-row-btn[disabled],
.w4l-row-btn[aria-disabled="true"] {
    color: var(--neutral-foreground-hint);
    opacity: 0.6;
    cursor: not-allowed;
}

/* Small word badge (state words such as «Draft», «Customised»). */
.w4l-badge {
    display: inline-block;
    font-size: 0.75rem;
    line-height: 1.4;
    padding: 0 8px;
    border-radius: 999px;
    border: 1px solid var(--neutral-stroke-rest);
    background: var(--neutral-fill-secondary-rest);
    color: var(--neutral-foreground-rest);
}

.w4l-badge[hidden] {
    display: none;
}

.w4l-badge--accent {
    border-color: var(--accent-fill-rest);
    background: var(--accent-fill-rest);
    color: var(--foreground-on-accent-rest);
}

/* File chooser: the label is the visible button, the native input is invisible but stays focusable (ring on the label). */
.w4l-file-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border: 1px solid var(--neutral-stroke-rest);
    border-radius: 4px;
    background: transparent;
    color: var(--neutral-foreground-rest);
    font: inherit;
    font-size: 0.875rem;
    cursor: pointer;
}

.w4l-file-btn:focus-within {
    outline: 2px solid var(--accent-fill-rest);
    outline-offset: 1px;
}

.w4l-file-btn input[type="file"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.w4l-file-pick {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 12px;
}

/* The chosen file's name next to the chooser (a status line, announced when it changes). */
.w4l-file-name {
    overflow-wrap: anywhere;
    font-size: 0.875rem;
}

/* Visible text that may drop out below 600 px (the control keeps its aria-label). */
@media (max-width: 599.98px) {
    .w4l-hide-narrow {
        display: none;
    }
}

/* ── PillSwitch (Shared/PillSwitch.razor) ────────────────────────────────────
   A native radio group: each segment is a <label> around a visually hidden
   <input type="radio"> plus a .w4l-pillswitch__face carrying padding and content.
   Tint and ring sit on the label; the focus ring on the face. One tab stop, arrow
   keys and a per-instance name come from the browser. */
.w4l-pillswitch {
    /* Accent drives the selected tint, the wrap-mode border and the dot. Overridable
       per instance via the inline --pill-accent style (e.g. a Preview identity colour). */
    --pill-accent: var(--accent-fill-rest);
    display: inline-flex;
    border: 1px solid var(--neutral-stroke-divider-rest);
    border-radius: 999px;
    background: var(--neutral-fill-stealth-rest);
    padding: 2px;
    gap: 2px;
    width: fit-content;
}
/* Size scale (Medium = legacy default) */
.w4l-pillswitch--xs { --pill-font: 0.6875rem; --pill-pad: 1px 4px; --pill-gap: 4px; --pill-dot: 8px; --pill-line: 1.4; }
.w4l-pillswitch--sm { --pill-font: 0.75rem;  --pill-pad: 3px 11px; --pill-gap: 6px; --pill-dot: 9px;  --pill-line: 1.4; }
.w4l-pillswitch--md { --pill-font: 0.85rem;  --pill-pad: 5px 14px; --pill-gap: 6px; --pill-dot: 10px; --pill-line: 1.2; }
.w4l-pillswitch--lg { --pill-font: 0.95rem;  --pill-pad: 7px 18px; --pill-gap: 8px; --pill-dot: 12px; --pill-line: 1.2; }
/* Fill mode: full container width; segments share it and centre their content. */
.w4l-pillswitch--fill {
    display: flex;
    width: 100%;
}
.w4l-pillswitch--fill .w4l-pillswitch__seg {
    flex: 1 1 auto;
}
.w4l-pillswitch--fill .w4l-pillswitch__face {
    justify-content: center;
}
.w4l-pillswitch--disabled {
    opacity: 0.5;
    pointer-events: none;
}
/* Input-height mode: the whole bar matches the app's standard control height
   (.w4l-select / FluentUI text fields = 32px), segments stretch to fill it and
   centre their content vertically — glyphs/icons keep their size, nothing clips. */
.w4l-pillswitch--input-height {
    min-height: 32px;
    box-sizing: border-box;
    align-items: stretch;
}
.w4l-pillswitch--input-height .w4l-pillswitch__face {
    padding-top: 0;
    padding-bottom: 0;
}
/* Wrap mode: standalone pills that flow onto multiple rows (no unified bar) — for long
   option lists that don't fit one line. */
.w4l-pillswitch--wrap {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    border: none;
    background: transparent;
    padding: 0;
    gap: 6px;
}
.w4l-pillswitch--wrap .w4l-pillswitch__seg {
    border: 1px solid var(--neutral-stroke-divider-rest);
}
.w4l-pillswitch--wrap .w4l-pillswitch__seg--selected {
    border-color: var(--pill-accent);
}
.w4l-pillswitch__seg {
    position: relative;
    display: inline-flex;
    align-items: stretch;
    min-height: 24px;
    border: none;
    border-radius: 999px;
    background: transparent;
    /* Deselected label colour follows the Preview pills' "off" state: muted, not full. */
    color: color-mix(in srgb, var(--neutral-foreground-rest) 78%, var(--neutral-foreground-hint));
    font-size: var(--pill-font);
    line-height: var(--pill-line);
    cursor: pointer;
    transition: background-color 0.12s ease, color 0.12s ease;
    white-space: nowrap;
}
.w4l-pillswitch__face {
    display: inline-flex;
    flex: 1 1 auto;
    align-items: center;
    justify-content: center;
    gap: var(--pill-gap);
    padding: var(--pill-pad);
    border-radius: 999px;
}
/* The radio is visually hidden (not display:none) so it stays focusable and in the a11y tree. */
.w4l-pillswitch__input {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: 0;
    padding: 0;
    opacity: 0;
    overflow: hidden;
    clip-path: inset(50%);
    pointer-events: none;
}
.w4l-pillswitch__input:focus-visible + .w4l-pillswitch__face {
    outline: 2px solid var(--accent-fill-rest);
    outline-offset: 1px;
}
.w4l-pillswitch__seg:hover {
    background: var(--neutral-fill-stealth-hover);
}
.w4l-pillswitch__seg--selected {
    background: color-mix(in srgb, var(--pill-accent) 14%, transparent);
    /* Selected label stays in the normal foreground colour; the tint + dot carry the cue. */
    color: var(--neutral-foreground-rest);
    font-weight: 600;
    cursor: default;
}
.w4l-pillswitch__seg--selected:hover {
    background: color-mix(in srgb, var(--pill-accent) 14%, transparent);
}
/* A single locked option (Option.Disabled) — the switch itself stays usable. */
/* Scoped off the whole-switch lock, whose container opacity would compound with this one. */
.w4l-pillswitch:not(.w4l-pillswitch--disabled) .w4l-pillswitch__seg--locked {
    opacity: 0.45;
    cursor: not-allowed;
}
.w4l-pillswitch:not(.w4l-pillswitch--disabled) .w4l-pillswitch__seg--locked:hover {
    background: transparent;
}
/* Accent highlight: the selected segment carries an accent ring in addition to the tint,
   the counterpart of the wrap mode's accent border (solved there via border). */
.w4l-pillswitch:not(.w4l-pillswitch--wrap) .w4l-pillswitch__seg--selected {
    box-shadow: inset 0 0 0 1px var(--pill-accent);
}
/* Optional text glyph (e.g. ♂/♀) — rendered larger than the label without
   stretching the pill: line-height 1 keeps it inside the segment's box.
   Discreet by default: muted when deselected, accent when selected —
   an explicit GlyphColor (inline style) overrides both states. */
.w4l-pillswitch__glyph {
    /* ~20px at md — below that, symbol-font hinting visibly warps the ♂/♀ circles
       (the old gender toggle used 1.35rem ≈ 21.6px for the same reason). */
    font-size: 1.05em;
    line-height: 1;
    flex-shrink: 0;
    color: var(--neutral-foreground-hint);
    /* Symbol glyphs (♂/♀) live in fallback fonts without a bold cut — the selected
       segment's font-weight: 600 would synthesize a broken-looking bold. Pin normal. */
    font-weight: 400;
    /* Disable hinting-driven outline distortion at small sizes. */
    text-rendering: geometricPrecision;
}
.w4l-pillswitch__seg--selected .w4l-pillswitch__glyph {
    color: var(--pill-accent);
}
/* Reserve the bold width up-front so toggling font-weight: 600 on select never reflows
   the pill. A hidden bold copy of the label (height: 0) sets the column's max-content
   width; the visible label — normal or bold — always fits inside it. */
.w4l-pillswitch__label {
    display: inline-flex;
    flex-direction: column;
}
.w4l-pillswitch__label::after {
    content: attr(data-label);
    font-weight: 600;
    height: 0;
    overflow: hidden;
    visibility: hidden;
    pointer-events: none;
}
/* Optional leading dot (Preview-style): filled in the accent when selected, hollow
   outline otherwise. */
.w4l-pillswitch__dot {
    width: var(--pill-dot);
    height: var(--pill-dot);
    border-radius: 50%;
    background: transparent;
    border: 1.5px solid var(--pill-accent);
    flex-shrink: 0;
    box-sizing: border-box;
}
.w4l-pillswitch__seg--selected .w4l-pillswitch__dot {
    background: var(--pill-accent);
}
/* Per-option accent (Option.Accent): same look as the asset-class chips of SecurityForm (.asset-chip): the dot is
   ALWAYS filled in the colour, the border stays neutral until selected, then tint + coloured border. */
.w4l-pillswitch__seg--accent .w4l-pillswitch__dot {
    background: var(--pill-accent);
}
.w4l-pillswitch__seg--accent.w4l-pillswitch__seg--selected,
.w4l-pillswitch__seg--accent.w4l-pillswitch__seg--selected:hover {
    background: color-mix(in srgb, var(--pill-accent) 18%, transparent);
}
/* 44 px targets on touch screens (R7). */
@media (pointer: coarse) { .w4l-pillswitch__seg { min-height: 44px; } }
/* Forced colours drop the tint: the selected segment keeps a visible outline. */
@media (forced-colors: active) {
    .w4l-pillswitch__seg.w4l-pillswitch__seg--selected { outline: 2px solid Highlight; outline-offset: -2px; }
}

/* Text for assistive technology only (group labels, polite status lines). */
.w4l-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Wrapper of the wealth chart's breakdown switch: a positioning context that may shrink inside a flex row. */
.w4l-bd { position: relative; min-width: 0; }
