/* Modul Vermögen (Family Office) – Stile (siehe docs/FAMILY-OFFICE.md §4). Präfix vm-. Nur Tokens aus theme.css. Mobile first. */

/* ------------------------------------------------------------------ Allgemein */
.vm-page { gap: 14px; }
.vm-count {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  background: var(--surface-3); color: var(--text-muted); font-size: var(--fs-xs); font-weight: 650; font-variant-numeric: tabular-nums; line-height: 1;
}
.chip.is-active .vm-count { background: var(--brand); color: var(--brand-contrast); }
.vm-empty-line { margin: 0; }
.vm-note { margin: 8px 0 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.vm-pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.vm-inline { display: inline-flex; align-items: center; gap: 4px; min-width: 0; overflow-wrap: anywhere; }
.vm-tone-warning { color: var(--warning); font-weight: 600; }
.vm-tone-danger .stat-value { color: var(--danger); }
.nowrap { white-space: nowrap; }
.vm-num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.vm-code { font-weight: 650; letter-spacing: .02em; }
.vm-more-link { display: inline-flex; align-items: center; gap: 2px; min-height: 32px; margin-top: 8px; font-size: var(--fs-sm); font-weight: 600; }
@media (max-width: 899px) { .vm-hide-mobile { display: none !important; } }

/* ------------------------------------------------------------------ Unter-Navigation */
.vm-nav {
  position: sticky; top: calc(var(--topbar-h) + env(safe-area-inset-top)); z-index: 20;
  display: flex; gap: 2px; margin: -16px -14px 0; padding: 4px 10px;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.vm-nav-link {
  flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: var(--tap); padding: 0 14px; border-radius: 999px;
  color: var(--text-muted); font-size: var(--fs-sm); font-weight: 600; white-space: nowrap; text-decoration: none !important;
}
.vm-nav-link .icon { color: var(--text-faint); }
.vm-nav-link:hover { background: var(--surface-2); color: var(--text); }
.vm-nav-link.is-active { background: var(--brand-soft); color: var(--brand-strong); }
.vm-nav-link.is-active .icon { color: var(--brand); }
@media (min-width: 900px) {
  .vm-nav { position: static; margin: -6px 0 0; padding: 0 0 10px; background: none; border-bottom: 0; }
  .vm-nav-link { min-height: 36px; padding: 0 12px 0 10px; font-size: var(--fs); }
}

/* ------------------------------------------------------------------ Mandate (Übersicht) */
.vm-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 16px; }
.vm-group { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.vm-group-title, .vm-pos-group-title {
  display: flex; align-items: center; gap: 7px; margin: 4px 0 0; font-size: var(--fs-xs); font-weight: 650;
  text-transform: uppercase; letter-spacing: .05em; color: var(--text-faint);
}
.vm-cards { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
@media (min-width: 640px) { .vm-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .vm-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.vm-card {
  display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; min-width: 0;
  color: var(--text); text-decoration: none !important; transition: border-color .12s, box-shadow .12s;
}
.vm-card:hover { border-color: var(--brand); box-shadow: var(--shadow); }
.vm-card.is-private { border-left: 3px solid var(--brand); }
.vm-card.is-archived { border-style: dashed; background: var(--surface-2); } /* ohne Deckkraft: Kontrast bleibt ≥ 4.5:1 */
.vm-card.is-archived .vm-card-amount { color: var(--text-muted); }
.vm-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; min-width: 0; }
.vm-card-title { display: flex; align-items: center; gap: 7px; min-width: 0; font-size: var(--fs-lg); font-weight: 650; line-height: 1.3; overflow-wrap: anywhere; }
.vm-card-title .icon { color: var(--brand); }
.vm-card-sub { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; min-width: 0; font-size: var(--fs-sm); color: var(--text-muted); }
.vm-card-value { display: flex; flex-direction: column; gap: 1px; }
.vm-card-label { font-size: var(--fs-xs); color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.vm-card-amount { font-size: var(--fs-xl); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.vm-card-empty { font-size: var(--fs-sm); padding: 4px 0 3px; }
.vm-card-amount.is-negative { color: var(--danger); }
.vm-card-foot { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 10px; }

/* Beträge, die sich der Breite anpassen (--vm-len = Zeichenzahl, gesetzt im Markup): immer auf einer Zeile, nie mitten
   in der Zahl umbrochen; Schrift = Breite des Behälters / (Zeichen × 0.62), zwischen Mindest- und Normalgrösse.
   Ohne Container-Abfragen (alte Browser) gilt die normale Schriftgrösse. */
.vm-card, .vm-value-card { container-type: inline-size; }
.vm-card-amount.vm-fit-text { font-size: clamp(16px, calc(100cqi / (var(--vm-len, 14) * 0.62)), var(--fs-xl)); }
.vm-empty-card .empty strong { color: var(--text); }

/* Hinweis-Badges */
.vm-flags { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.vm-flag { gap: 3px; }
.vm-flag-unvalued { background: var(--surface-3); color: var(--text-muted); }
.vm-flag-stale { background: var(--warning-soft); color: var(--warning); }
.vm-flag-fx { background: var(--danger-soft); color: var(--danger); }
.vm-lock { background: var(--brand-soft); color: var(--brand-strong); gap: 4px; }
.vm-lock-btn { border: 0; font: inherit; font-size: var(--fs-xs); font-weight: 600; cursor: pointer; }
.vm-lock-btn:hover { box-shadow: inset 0 0 0 1px var(--brand); }

/* ------------------------------------------------------------------ Detailseiten (Kopf) */
.vm-head-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.vm-head-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: -10px; min-width: 0; }
@media (max-width: 899px) {
  .vm-detail-page .page-actions { width: 100%; }
  .vm-head-actions { width: 100%; justify-content: flex-end; }
  /* Nur lesen (archiviert, Leser): am Handy bleibt nur das ⋮-Menü – rechts neben dem Titel statt auf eigener Zeile */
  .vm-detail-page .page-actions:has(.vm-menu-only) { width: auto; margin-left: auto; }
  .vm-head-actions.vm-menu-only { width: auto; }
  .vm-head-actions > .btn { flex: 1 1 0; min-width: 0; }
  .vm-lock-btn { min-height: var(--tap); padding: 0 12px; }
  .vm-head-badges a.vm-inline { min-height: var(--tap); }
}

/* Datenschutz */
.vm-privacy { align-items: flex-start; flex-wrap: wrap; }
.vm-privacy-text { flex: 1 1 240px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.vm-privacy-text strong { color: inherit; }
.vm-privacy .btn { flex: none; }
.vm-privacy-modal p { display: block; }
.vm-privacy-modal .icon { color: var(--brand); vertical-align: -2px; }
.vm-2fa-tip { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; font-weight: 600; }
.vm-2fa-tip a { color: inherit; text-decoration: underline; }
@media (max-width: 899px), (pointer: coarse) { .vm-2fa-tip a { display: inline-flex; align-items: center; min-height: var(--tap); } }

/* Archiviert */
.vm-archived { align-items: center; flex-wrap: wrap; }
.vm-archived-text { flex: 1 1 200px; min-width: 0; }
.vm-archived .btn { flex: none; }

/* Stichtag */
.vm-stichtag { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.vm-stichtag-field { display: flex; align-items: center; gap: 10px; flex: 1 1 260px; min-width: 0; max-width: 340px; }
.vm-stichtag-label { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: var(--fs-sm); color: var(--text-muted); white-space: nowrap; }
.vm-stichtag-label .icon { color: var(--text-faint); }
.vm-stichtag .input { flex: 1 1 auto; min-width: 0; }
.vm-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.vm-chips .chip { flex: none; font-variant-numeric: tabular-nums; }
@media (max-width: 899px) {
  .vm-stichtag-field { max-width: none; flex-basis: 100%; }
  .vm-chips-scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -14px; padding: 0 14px; }
  .vm-chips-scroll::-webkit-scrollbar { display: none; }
}

/* Kennzahlen: Beträge immer auf einer Zeile (geschütztes Leerzeichen nach dem Code, kein Umbruch in der Zahl) */
.vm-kpis .stat { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.vm-kpi .stat-value { font-size: 18px; line-height: 1.25; white-space: nowrap; }
.vm-kpi-strong { border-color: var(--brand); background: var(--brand-soft); }
.vm-kpi-strong .stat-label { color: var(--brand-strong); }
.vm-kpi-strong .stat-value { color: var(--brand-strong); }
/* Mittlere Breiten (Tablet, Laptop mit Seitenleiste): 2 × 2 Kacheln, damit auch 13-stellige Beträge Platz haben */
@media (min-width: 560px) and (max-width: 1199px) { .vm-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* Ab 560 px: Schrift nach Länge des Betrags und Kachelbreite (siehe .vm-fit-text oben), höchstens 18 bzw. 22 px */
@media (min-width: 560px) {
  .vm-kpis .stat { container-type: inline-size; }
  .vm-kpi .stat-value.vm-fit-text { font-size: clamp(13px, calc(100cqi / (var(--vm-len, 14) * 0.62)), var(--vm-kpi-max, 18px)); }
}
@media (min-width: 1100px) { .vm-kpis { --vm-kpi-max: var(--fs-xl); } }
/* Schmale Handys: Kennzahlen als Zeilen (Bezeichnung links, Betrag rechts). Passen beide nicht nebeneinander, rückt der
   Betrag unter die Bezeichnung – nie übereinander. Das Nettovermögen (grösste Schrift) steht immer untereinander. */
@media (max-width: 559px) {
  .vm-kpis { grid-template-columns: minmax(0, 1fr); gap: 0; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
  .vm-kpis .stat {
    flex-direction: row; flex-wrap: wrap; align-items: baseline; align-content: center; justify-content: space-between;
    gap: 0 12px; border: 0; border-radius: 0; border-top: 1px solid var(--border); padding: 10px 14px; min-height: 56px;
  }
  .vm-kpis .stat:first-child { border-top: 0; }
  .vm-kpis .stat-label { flex: 1 1 auto; line-height: 1.3; }
  .vm-kpis .stat-value { flex: none; font-size: var(--fs-lg); margin: 0 0 0 auto; text-align: right; }
  .vm-kpis .stat-sub { flex: 1 0 100%; font-size: var(--fs-xs); }
  .vm-kpis .vm-kpi-strong { flex-direction: column; align-items: flex-start; }
  .vm-kpis .vm-kpi-strong .stat-value { font-size: var(--fs-xl); margin: 2px 0 0; text-align: left; }
}

/* Hinweise */
.vm-notices { display: flex; flex-direction: column; gap: 8px; }
.vm-notice { flex-wrap: wrap; }
.vm-notice-text { flex: 1 1 260px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.vm-notice-list { margin: 2px 0; padding-left: 18px; }
.vm-notice-list li { overflow-wrap: anywhere; }
.vm-notice-list a { color: inherit; text-decoration: underline; font-weight: 600; }
.vm-notice-list .vm-num { margin-left: 6px; }
.vm-notice-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.vm-notice-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 0; }

/* Aufteilung (Balken, Werte beschriftet) */
.vm-split { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; align-items: start; }
@media (min-width: 900px) { .vm-split:not(.vm-split-single) { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.vm-sub-title { margin: 0 0 8px; font-size: var(--fs-xs); font-weight: 650; text-transform: uppercase; letter-spacing: .05em; color: var(--text-faint); }
.vm-bars + .vm-sub-title { margin-top: 16px; }
.vm-bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.vm-bar-label { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 5px; font-size: var(--fs-sm); min-width: 0; }
.vm-bar-name { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.vm-bar-sub { margin-left: 6px; font-weight: 500; color: var(--text-faint); font-size: var(--fs-xs); }
.vm-bar-num { flex: none; display: inline-flex; align-items: baseline; gap: 8px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.vm-bar-value { font-weight: 650; }
.vm-bar-pct { min-width: 3.2em; text-align: right; color: var(--text-muted); font-size: var(--fs-xs); }
.vm-bar-track { height: 10px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.vm-bar-track > span { display: block; height: 100%; border-radius: 4px; background: var(--brand); transition: width .3s; }
.vm-bars-liability .vm-bar-track > span { background: var(--accent); }
.vm-bars-neutral .vm-bar-track > span { background: var(--sage); }
@media (max-width: 419px) {
  .vm-bar-label { flex-wrap: wrap; row-gap: 2px; }
  .vm-bar-num { margin-left: auto; }
}

/* ------------------------------------------------------------------ Positionen */
.vm-positions { overflow: hidden; }
.vm-pos-head { display: none; }
.vm-pos-group + .vm-pos-group { border-top: 1px solid var(--border); }
.vm-pos-group-title { margin: 0; padding: 12px 14px 6px; }
.vm-pos-group-title .icon { color: var(--text-faint); }
.vm-pos-group-sum { margin-left: auto; font-size: var(--fs-sm); color: var(--text-muted); text-transform: none; letter-spacing: 0; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.vm-pos-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: start;
  min-height: 60px; padding: 10px 14px; border-top: 1px solid var(--border); color: var(--text); text-decoration: none !important;
}
.vm-pos-group-title + .vm-pos-row { border-top: 0; }
.vm-pos-row:hover { background: var(--surface-2); }
/* Zählt am Stichtag nicht: nur der Betrag gedämpft (keine Deckkraft – Bezeichnungen und Badges behalten ihren Kontrast) */
.vm-pos-amount.is-muted { color: var(--text-muted); font-weight: 600; }
.vm-pos-nocount { font-size: var(--fs-xs); color: var(--text-muted); white-space: nowrap; }
.vm-pos-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.vm-pos-title { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; min-width: 0; }
.vm-pos-name { font-weight: 600; overflow-wrap: anywhere; }
@media (hover: hover) { .vm-pos-row:hover .vm-pos-name { text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 3px; } }
.vm-pos-sub { font-size: var(--fs-sm); color: var(--text-muted); overflow-wrap: anywhere; }
.vm-pos-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; font-size: var(--fs-sm); color: var(--text-muted); min-width: 0; }
.vm-pos-meta .mono { color: var(--text); }
.vm-pos-cell { min-width: 0; font-size: var(--fs-sm); }
/* Quelle: bis zwei Zeilen statt «…» nach wenigen Zeichen (Datum in der Quelle bleibt lesbar), voller Text im title */
.vm-pos-src, .vm-pos-src-m { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; }
.vm-pos-src-m { min-width: 0; }
.vm-pos-base { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.vm-pos-amount { font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.vm-pos-amount.is-negative { color: var(--danger); }
.vm-pos-amount.is-negative.is-muted { color: var(--text-muted); }
.vm-pos-fx { font-size: var(--fs-xs); color: var(--text-muted); text-align: right; font-variant-numeric: tabular-nums; }
.vm-date.is-stale { color: var(--warning); font-weight: 600; }
@media (max-width: 419px) {
  .vm-pos-row { grid-template-columns: minmax(0, 1fr); }
  .vm-pos-base { align-items: flex-start; flex-direction: row; flex-wrap: wrap; gap: 2px 8px; }
  .vm-pos-fx { text-align: left; }
}
@media (min-width: 900px) {
  .vm-pos-head, .vm-pos-row { grid-template-columns: minmax(0, 1.6fr) minmax(140px, 1fr) 96px minmax(0, 1.4fr) minmax(150px, 1fr); }
  .vm-pos-head {
    display: grid; gap: 12px; align-items: center; padding: 8px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border);
    font-size: var(--fs-xs); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted);
  }
  .vm-pos-head .num { text-align: right; }
  .vm-pos-row { gap: 12px; align-items: center; min-height: 56px; }
  .vm-pos-cell { display: block; }
  .vm-pos-cell.vm-pos-src { display: -webkit-box; }
}

/* Verwendete Kurse, Zugriff */
.vm-mini-list { list-style: none; margin: 0; padding: 0; }
.vm-mini-list li { display: grid; grid-template-columns: auto auto minmax(0, 1fr); gap: 4px 10px; padding: 7px 0; border-top: 1px solid var(--border); font-size: var(--fs-sm); align-items: baseline; }
.vm-mini-src { overflow-wrap: anywhere; } /* Quelle umbricht statt abgeschnitten zu werden */
.vm-mini-list li:first-child { border-top: 0; padding-top: 0; }
.vm-access-mini { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.vm-access-mini li { display: flex; align-items: center; gap: 8px; min-width: 0; }
.vm-access-mini .ellipsis { flex: 0 1 auto; font-weight: 600; }

/* ------------------------------------------------------------------ Position (Detail) */
/* Zwei Spalten, die unabhängig voneinander stapeln (links Wert/Stammdaten/Verknüpft, rechts Verlauf/Dokumente);
   darunter eine Spalte in derselben Reihenfolge (.vm-pos-col fällt weg) */
.vm-pos-detail { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; align-items: start; }
.vm-pos-col { display: contents; }
@media (min-width: 1100px) {
  .vm-pos-detail { grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); }
  .vm-pos-col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
}
.vm-value-card { display: flex; flex-direction: column; gap: 6px; }
.vm-value-label { font-size: var(--fs-xs); color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.vm-value-amount { font-size: var(--fs-xxl); font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.15; white-space: nowrap; }
.vm-value-amount.vm-fit-text { font-size: clamp(18px, calc(100cqi / (var(--vm-len, 14) * 0.62)), var(--fs-xxl)); }
.vm-value-card.is-inactive .vm-value-amount { color: var(--text-muted); }
.vm-value-sublabel { font-size: var(--fs-sm); color: var(--text-muted); }
.vm-value-meta { display: flex; flex-wrap: wrap; gap: 2px 12px; font-size: var(--fs-sm); color: var(--text-muted); }
.vm-value-src { color: var(--text); font-weight: 600; overflow-wrap: anywhere; }
.vm-value-base { font-size: var(--fs-sm); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.vm-value-hint { margin: 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.vm-value-card .btn { align-self: flex-start; }

.vm-info { margin: 0; display: grid; grid-template-columns: fit-content(170px) minmax(0, 1fr); }
.vm-info-row { display: contents; }
.vm-info dt, .vm-info dd { padding: 8px 0; border-top: 1px solid var(--border); min-width: 0; }
.vm-info-row:first-child > * { border-top: 0; padding-top: 0; }
.vm-info-row:last-child > * { padding-bottom: 0; }
.vm-info dt { font-size: var(--fs-sm); color: var(--text-muted); padding-right: 14px; line-height: 1.35; padding-top: 10px; }
.vm-info-row:first-child > dt { padding-top: 2px; }
.vm-info dd { margin: 0; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }

.vm-links { list-style: none; margin: -4px -16px -16px; padding: 0; }
.vm-link-row { display: flex; align-items: center; gap: 12px; min-height: 54px; padding: 8px 16px; border-top: 1px solid var(--border); color: var(--text); text-decoration: none !important; }
.vm-links li:first-child .vm-link-row { border-top: 0; }
.vm-link-row:hover { background: var(--surface-2); }
.vm-link-row > .icon:first-child { color: var(--brand); }
.vm-link-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.vm-link-name { font-weight: 600; overflow-wrap: anywhere; }

/* Bewertungen */
.vm-val-table { margin: 4px -16px -16px; }
.vm-val-table .table th:first-child, .vm-val-table .table td:first-child { padding-left: 16px; }
.vm-val-table .table th:last-child, .vm-val-table .table td:last-child { padding-right: 12px; }
.vm-val-table .table td { vertical-align: middle; }
.vm-val-table tr.is-current td { background: var(--brand-soft); }
.vm-cell-wrap { overflow-wrap: anywhere; min-width: 120px; }
.vm-cell-menu { width: 48px; text-align: right; }
.vm-cell-note { margin-top: 2px; overflow-wrap: anywhere; }
.vm-val-table .badge { margin-top: 3px; }
.vm-val-list { list-style: none; margin: 4px -16px -16px; padding: 0; }
.vm-val { display: flex; align-items: flex-start; gap: 4px; padding: 10px 8px 10px 16px; border-top: 1px solid var(--border); }
.vm-val.is-current { background: var(--brand-soft); }
.vm-val-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.vm-val-top { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; }
.vm-val-amount { font-weight: 700; font-size: var(--fs-lg); }
.vm-val-meta { display: flex; flex-wrap: wrap; gap: 2px 12px; font-size: var(--fs-sm); color: var(--text-muted); }
.vm-val-src { font-size: var(--fs-sm); font-weight: 600; overflow-wrap: anywhere; }
.vm-val-note { overflow-wrap: anywhere; }

/* Verlauf (Linie) */
.vm-chart { position: relative; margin: 0 0 12px; min-width: 0; touch-action: pan-y; }
.vm-chart svg { display: block; max-width: 100%; overflow: visible; }
.vm-chart-grid { stroke: var(--border); stroke-width: 1; }
.vm-chart-axis { fill: var(--text-muted); font-size: 11px; font-family: var(--font); font-variant-numeric: tabular-nums; }
.vm-chart-line { fill: none; stroke: var(--brand); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.vm-chart-dot { fill: var(--brand); stroke: var(--surface); stroke-width: 2; }
.vm-chart-dot.is-active { fill: var(--brand-strong); }
.vm-chart-cross { stroke: var(--border-strong); stroke-width: 1; stroke-dasharray: 3 3; }
.vm-chart-tip {
  position: absolute; top: 0; transform: translateX(-50%); z-index: 2; pointer-events: none;
  display: flex; flex-direction: column; gap: 1px; max-width: 200px; padding: 6px 9px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); font-size: var(--fs-xs); color: var(--text-muted);
}
.vm-chart-tip strong { color: var(--text); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; white-space: nowrap; }
.vm-chart-tip-src { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vm-chart figcaption { margin-top: 4px; }

/* Dokumente */
.vm-files { display: flex; flex-direction: column; gap: 12px; }
.vm-file-list { list-style: none; margin: -4px -16px 0; padding: 0; }
.vm-file { display: flex; align-items: center; gap: 2px; padding: 0 8px 0 0; border-top: 1px solid var(--border); }
.vm-file:first-child { border-top: 0; }
.vm-file-main { flex: 1 1 auto; display: flex; align-items: center; gap: 10px; min-width: 0; min-height: 56px; padding: 6px 8px 6px 16px; color: var(--text); text-decoration: none !important; }
.vm-file-main:hover { background: var(--surface-2); }
.vm-file-icon { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: var(--radius-sm); background: var(--brand-soft); color: var(--brand); }
.vm-file-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.vm-file-name { font-weight: 600; overflow-wrap: anywhere; }
.vm-file-dl { color: var(--text-faint); }
.vm-file-busy { display: grid; place-items: center; width: var(--tap); height: var(--tap); }
.vm-file-add { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }

/* ------------------------------------------------------------------ Kurse */
.vm-fx-groups { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; align-items: start; }
@media (min-width: 900px) { .vm-fx-groups { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.vm-fx-card { overflow: hidden; }
.vm-fx-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 8px 8px 16px; }
.vm-fx-head .card-title { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.vm-fx-list { list-style: none; margin: 0; padding: 0; }
.vm-fx-row { display: grid; grid-template-columns: 6.2em 5.5em minmax(0, 1fr) auto; align-items: center; gap: 4px 12px; min-height: 52px; padding: 4px 8px 4px 16px; border-top: 1px solid var(--border); font-size: var(--fs-sm); }
.vm-fx-row.is-latest { background: var(--brand-soft); }
.vm-fx-date { font-variant-numeric: tabular-nums; }
.vm-fx-rate { font-weight: 650; text-align: right; }
.vm-fx-src { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }

/* ------------------------------------------------------------------ Formulare */
.vm-modal-lead { margin: 0 0 4px; }
.vm-form-alert { margin-bottom: 2px; }
.vm-form-note { align-items: flex-start; }
.vm-form-kind { margin: 0; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.vm-form-cat { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius); background: var(--surface-2); font-size: var(--fs-sm); }
.vm-fieldset { display: flex; flex-direction: column; gap: 12px; min-width: 0; margin: 2px 0 0; padding: 10px 12px 12px; border: 1px dashed var(--border-strong); border-radius: var(--radius); }
.vm-fieldset legend { padding: 0 6px; font-size: var(--fs-sm); font-weight: 600; color: var(--text-muted); }
.vm-detail-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
@media (min-width: 600px) {
  .vm-detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .vm-detail-grid .vm-wide { grid-column: 1 / -1; }
}
.vm-row-amount > .field:first-child { flex: 2 1 0; }
.vm-field-currency { flex: 1 1 0; }
@media (min-width: 600px) { .vm-field-currency { max-width: 150px; } }

.vm-affix { display: flex; align-items: stretch; min-width: 0; }
.vm-affix .input { flex: 1 1 auto; min-width: 0; }
.vm-affix-pre, .vm-affix-post {
  display: inline-flex; align-items: center; padding: 0 10px; border: 1px solid var(--border-strong); background: var(--surface-2);
  color: var(--text-muted); font-size: var(--fs-sm); font-weight: 600; font-family: var(--font-mono); white-space: nowrap;
}
.vm-affix-pre { border-right: 0; border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.vm-affix-post { border-left: 0; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.vm-affix-pre + .input { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.vm-affix .input:has(+ .vm-affix-post) { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.vm-currency-custom { display: flex; gap: 6px; align-items: center; }
.vm-currency-custom .input { flex: 1 1 auto; min-width: 0; text-transform: uppercase; }

.vm-choices { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
@media (min-width: 520px) { .vm-choices-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.vm-choice {
  display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 10px 12px; min-width: 0;
  border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface);
  font: inherit; color: var(--text); text-align: left; cursor: pointer; transition: border-color .12s, background .12s;
}
.vm-choice:hover { border-color: var(--brand); }
.vm-choice.is-active { border-color: var(--brand); background: var(--brand-soft); box-shadow: inset 0 0 0 1px var(--brand); }
.vm-choice-icon { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); }
.vm-choice.is-active .vm-choice-icon { background: var(--brand); color: var(--brand-contrast); }
.vm-choice-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.vm-choice-label { font-weight: 650; }
.vm-choice-hint { font-size: var(--fs-sm); color: var(--text-muted); line-height: 1.3; }

/* Zugriffe */
.vm-access-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.vm-access-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--border); min-width: 0; }
.vm-access-row:first-child { border-top: 0; }
.vm-access-name { flex: 1 1 auto; display: flex; flex-direction: column; min-width: 0; }
.vm-access-name .ellipsis { font-weight: 600; }
.vm-role-select { width: auto; flex: none; max-width: 150px; }
.vm-access-add { display: flex; flex-direction: column; gap: 10px; }
@media (min-width: 600px) {
  .vm-access-add { flex-direction: row; align-items: flex-end; }
  .vm-access-add > .btn { flex: none; }
}

/* ------------------------------------------------------------------ Touch-Ziele ≥ 44 px (Handy, Touch) */
@media (max-width: 899px), (pointer: coarse) {
  /* app.css setzt .input erst nach der Touch-Regel auf 42 px – hier für alle Vermögensseiten samt ihrer Modals */
  .vm-page .input, .vm-modal .input { min-height: var(--tap); }
  .vm-page .segmented-item, .vm-modal .segmented-item { min-height: var(--tap); padding-left: 12px; padding-right: 12px; }
  .vm-page .toggle { min-height: var(--tap); }
  .vm-more-link { min-height: var(--tap); }
  .vm-notice-list a { display: inline-flex; align-items: center; min-height: var(--tap); }
  .vm-currency-custom .btn { min-height: var(--tap); }
}

/* ------------------------------------------------------------------ Druck */
@media print {
  .vm-nav, .vm-head-actions, .vm-stichtag .vm-chips, .vm-file-add { display: none !important; }
}
