.obligation-editor .form-field { min-width: 0; gap: var(--form-label-gap); }
.obligation-editor .form-field > label:not(.checkbox-label) { display: block; margin: 0; color: var(--muted); font-size: 10px; font-weight: 400; letter-spacing: .065em; line-height: 1.2; text-transform: uppercase; }
:root {
  color-scheme: light;
  --bg: #f3f5f8;
  --surface: #ffffff;
  --surface-2: #f7f8fa;
  --surface-3: #e9edf2;
  --editor-section-bg: color-mix(in srgb, var(--surface-3) 65%, white);
  --dialog-section-bg: var(--editor-section-bg);
  --table-header-font-size: 11px;
  --table-body-font-size: 13px;
  --form-label-gap: 4px;
  --form-row-gap: 12px;
  --form-section-gap: 16px;
  --dialog-field-row-gap: var(--form-row-gap);
  --ink: #142033;
  --muted: #697586;
  --field-disabled-color: #8b97a8;
  --line: #d8dee7;
  --line-strong: #c5ccd7;
  --navy: #0b1f3a;
  --navy-2: #132b4f;
  --navy-3: #284d73;
  --blue: #315f87;
  --blue-soft: #e7eef5;
  --chart-hover-cursor: pointer;
  --silver: #aeb8c6;
  /* Original income-chart palette; darker text tones keep small labels readable. */
  --green: #5f916d;
  --terracotta: #cf896f;
  --positive: color-mix(in srgb, var(--green) 72%, black);
  --positive-bg: color-mix(in srgb, var(--green) 14%, white);
  --danger: color-mix(in srgb, var(--terracotta) 65%, black);
  --danger-bg: color-mix(in srgb, var(--terracotta) 14%, white);
  --flow-in: var(--green);
  --flow-out: var(--terracotta);
  --positive-soft: color-mix(in srgb, var(--green) 50%, white);
  --positive-strong: #153f2f;
  --danger-chart: color-mix(in srgb, var(--terracotta) 82%, black);
  --danger-soft: color-mix(in srgb, var(--terracotta) 65%, white);
  --danger-disabled: color-mix(in srgb, var(--danger) 45%, white);
  /* Badge palette extends the tax-table status colours with a true red. */
  --red: #a4423d;
  --red-bg: #f8e9e7;
  --badge-neutral: var(--muted);
  --badge-neutral-bg: var(--surface-3);
  --badge-info: var(--navy-3);
  --badge-info-bg: var(--blue-soft);
  --badge-positive: var(--positive);
  --badge-positive-bg: var(--positive-bg);
  --badge-warning: var(--warning);
  --badge-warning-bg: var(--warning-bg);
  --badge-negative: var(--red);
  --badge-negative-bg: var(--red-bg);
  --badge-radius: 999px;
  --badge-font-size: 11px;
  --badge-line-height: 1.48;
  --badge-padding: 5px 9px;
  --warning: #8b611c;
  --warning-bg: #fbf1dd;
  --sidebar: 250px;
  --radius: 8px;
  --shadow: 0 2px 9px rgba(12, 30, 53, .045);
  --tab-font-weight: 500;
  --metric-value-font-weight: 620;
  --button-height: 40px;
  --field-height: 40px;
  --field-padding-x: 13px;
  --chart-axis-font-size: 12.5px;
  --chart-axis-font-weight: 450;
  --chart-category-font-size: 12px;
  --chart-category-font-weight: 600;
  --chart-value-font-size: 13px;
  --chart-value-font-weight: 600;
  --safe-area-top: env(safe-area-inset-top, 0px);
  --safe-area-bottom: env(safe-area-inset-bottom, 0px);
  --safe-area-left: env(safe-area-inset-left, 0px);
  --safe-area-right: env(safe-area-inset-right, 0px);
  --dialog-viewport-height: 100vh;
  --dialog-viewport-width: 100vw;
  --dialog-viewport-top: 0px;
  --dialog-viewport-left: 0px;
  --dialog-edge: 18px;
  --dialog-available-height: calc(var(--dialog-viewport-height) - var(--safe-area-top) - var(--safe-area-bottom) - 2 * var(--dialog-edge));
  --dialog-available-width: calc(var(--dialog-viewport-width) - var(--safe-area-left) - var(--safe-area-right) - 2 * var(--dialog-edge));
  font-family: "Avenir Next", Avenir, "Helvetica Neue", "Segoe UI", sans-serif;
}
@supports (height: 100dvh) { :root { --dialog-viewport-height: 100dvh; } }
* { box-sizing: border-box; }
html { overflow-x: clip; min-height: 100%; background: var(--bg); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; overscroll-behavior-y: none; scrollbar-width: none; }
/* Safari's classic page scrollbars reserve white tracks at the window edges.
   Hide only the outer tracks; scrolling and inner table scrollbars stay available. */
html::-webkit-scrollbar, body::-webkit-scrollbar { display: none; width: 0; height: 0; }
body { margin: 0; width: 100%; background: var(--bg); color: var(--ink); min-height: 100vh; min-height: 100dvh; font-size: 16px; line-height: 1.48; }
html:has(dialog:modal), html:has(body.sidebar-open) { overflow: hidden; overscroll-behavior: none; }
body:has(dialog:modal) { overscroll-behavior: none; }
dialog:modal { overscroll-behavior: contain; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; color: var(--navy); font-size: clamp(42px, 4vw, 64px); font-weight: 450; letter-spacing: -3px; line-height: 1.02; }
h2 { margin-bottom: 0; color: var(--navy-2); font-size: var(--text-panel-size); font-weight: var(--text-panel-weight); letter-spacing: var(--text-panel-spacing); line-height: var(--text-panel-line); }
.back-link { display: inline-block; margin-bottom: 9px; color: var(--blue); font-size: 13px; font-weight: 650; }
.lead { color: var(--muted); line-height: 1.62; }

/* App-Rahmen nach der Grundlogik des Bauherren-Cockpits */
.app-shell { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); align-items: start; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 50; width: var(--sidebar); height: auto; min-height: 0; align-self: stretch; display: flex; flex-direction: column; padding: 25px 17px 22px; color: white; background: radial-gradient(circle at 25% 18%, rgba(68, 101, 143, .48), transparent 44%), linear-gradient(165deg, #132b4f 0%, #0b1f3a 55%, #09182c 100%); border-right: 1px solid rgba(255,255,255,.11); }
.brand { display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 0 11px; color: white; }
.brand-mark { flex: 0 0 45px; display: grid; place-items: center; width: 45px; height: 45px; border: 1px solid rgba(255,255,255,.35); border-radius: 50%; background: rgba(255,255,255,.1); }
.brand-mark svg { width: 25px; height: 25px; fill: none; stroke: #e9eef6; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.brand > span:last-child { display: flex; align-items: baseline; gap: 5px; }
.brand strong { font-size: 17px; font-weight: 650; letter-spacing: -.25px; }
.brand small { color: rgba(255,255,255,.63); font-size: 13px; }
.primary-nav { min-height: 0; display: grid; gap: 4px; margin-top: 34px; overflow-y: auto; overscroll-behavior-y: contain; }
.nav-group-label { margin: 22px 14px 6px; color: rgba(220,228,239,.48); font-size: 10px; font-weight: 400; letter-spacing: .12em; text-transform: uppercase; }
.nav-group-label:first-child { margin-top: 0; }
.nav-item { position: relative; display: flex; align-items: center; gap: 13px; min-height: 49px; padding: 12px 14px; border-radius: 6px; color: rgba(239,243,248,.78); font-size: 15px; font-weight: 450; transition: .18s ease; }
.nav-count { margin-left: auto; flex: 0 0 auto; }
.nav-item:hover { background: rgba(255,255,255,.08); color: white; }
.nav-item.active { background: rgba(255,255,255,.15); box-shadow: inset 0 0 0 1px rgba(255,255,255,.04); color: white; }
.nav-item.active::before { position: absolute; top: 4px; bottom: 4px; left: -5px; width: 4px; border-radius: 4px; background: #a9c9e7; content: ""; }
.nav-icon { display: grid; place-items: center; width: 25px; color: rgba(230,237,246,.8); }
.nav-icon svg, .icon-button svg { width: 21px; height: 21px;  fill: none; stroke: currentColor; stroke-width: 1.55; stroke-linecap: round; stroke-linejoin: round; }
.sidebar-footer { flex-shrink: 0; display: grid; gap: 14px; margin-top: auto; }
.account-link { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 10px; color: rgba(255,255,255,.86); font-size: 13px; }
.account-link form { margin: 0; }
.link-button { padding: 0; border: 0; background: none; color: rgba(255,255,255,.56); font-size: 12px; }
.workspace { grid-column: 2; min-width: 0; min-height: 100vh; min-height: 100dvh; background: radial-gradient(circle at 84% 10%, rgba(213,222,234,.58), transparent 29%), linear-gradient(180deg, #fafbfc 0%, var(--bg) 100%); }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; height: calc(95px + var(--safe-area-top));  border-bottom: 1px solid var(--line); background: rgba(250,251,252,.91); backdrop-filter: blur(18px); }
.topbar-title { display: grid; }
.topbar-eyebrow { color: var(--blue); font-size: 13px; font-weight: 400; }
.topbar-eyebrow:empty { display: none; }
.topbar-eyebrow a { color: inherit; }
.topbar-eyebrow a:hover { color: var(--navy-2); }
.topbar-back-link { display: inline-flex; align-items: center; gap: 5px; padding: 3px 0; }
.topbar-back-link svg { flex-shrink: 0; }
.topbar-title strong { margin-top: 1px; color: var(--navy); font-size: 22px; font-weight: var(--text-emphasis-weight); letter-spacing: -.45px; }
.topbar-meta { min-height: 17px; margin-top: 1px; color: var(--muted); font-size: 11px; line-height: 1.35; }
.topbar-meta:empty { display: none; }
.topbar-tabs { display: inline-flex; flex: 0 0 auto; gap: 3px; margin-left: 28px; padding: 3px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface-3); }
.topbar-tabs a { min-height: 40px; display: inline-flex; align-items: center; padding: 0 16px; border-radius: 4px; color: var(--muted); font-size: 16px; font-weight: var(--tab-font-weight); white-space: nowrap; }
.topbar-tabs a:hover { color: var(--navy-2); }
.topbar-tabs a.active { background: white; box-shadow: 0 1px 4px rgba(11,31,58,.1); color: var(--navy-2); }
.topbar-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; min-width: 0; margin-left: auto; }
.topbar-actions > .topbar-tabs { margin-left: 0; order: 3; }
.topbar-actions:empty { display: none; }
/* Die Hauptaktion folgt den Nebenaktionen, die Glocke bleibt ganz rechts. */
.topbar-actions > .primary-button { order: 1; }
.topbar-actions .primary-button, .topbar-actions .secondary-button { flex: 0 0 auto;   white-space: nowrap; }
.topbar-actions > form { flex: 0 0 auto; margin: 0; }
.topbar-actions .as-of { padding: 0 4px 0 0; white-space: nowrap; }
.topbar-actions .year-picker { margin: 0; }
.icon-button { position: relative; display: grid; place-items: center; width: 43px;   border: 1px solid var(--line-strong); border-radius: 5px; background: white; color: var(--navy-3); }
.mobile-menu { display: none; }
.notification-menu { position: relative; flex: 0 0 auto; }
.notification-menu > summary { list-style: none; }
.notification-menu > summary::-webkit-details-marker { display: none; }
.notification-menu[open] > summary { border-color: var(--navy-3); color: var(--navy-2); }
.badge-count {
  position: absolute; top: -6px; right: -6px;
  --badge-font-size: 13px; --badge-font-weight: 500;
  --badge-line-height: 1.3; --badge-padding: 2px 5px;
  --badge-min-width: 22px; --badge-min-height: 22px;
  --badge-negative: var(--surface); --badge-negative-bg: var(--red);
  outline: 2px solid var(--surface);
}
.topbar-actions .topbar-review-button { gap: 6px; padding-inline: 10px; }
.notification-popover { position: absolute; top: 51px; right: 0; z-index: 80; width: min(410px, calc(100vw - 28px)); padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: white; box-shadow: 0 20px 55px rgba(11,31,58,.2); }
.popover-header { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 8px 9px 13px; border-bottom: 1px solid var(--line); }
.popover-header span { color: var(--muted); font-size: 12px; }
.notification-items { display: grid; max-height: min(560px, calc(100vh - 180px)); overflow-y: auto; }
.notification-item { display: grid; gap: 4px; padding: 12px 9px; border-bottom: 1px solid var(--line); }
.notification-item:last-child { border-bottom: 0; }
.notification-item:hover { border-radius: 5px; background: var(--surface-2); }
.notification-item strong { color: var(--navy-2); font-size: 13px; }
.notification-item small { color: var(--muted); font-size: 12px; line-height: 1.45; }
.empty-compact { display: grid; gap: 4px; padding: 24px 10px; color: var(--muted); text-align: center; }
.empty-compact strong { color: var(--navy-2); }
.notification-more { margin: 8px 9px 2px; color: var(--muted); font-size: 11px; line-height: 1.4; }
.sidebar-backdrop { display: none; }
.page-shell { max-width: 1580px; margin: 0 auto;  }

/* Seiten und Kennzahlen */
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; margin-bottom: 30px; }
.as-of { padding-bottom: 6px; color: var(--muted); font-size: 14px; }
.metric-grid { display: grid;   margin-bottom: 18px; }
.cost-summary-grid .metric-card > span:not(.metric-info) { white-space: nowrap; }
.metric-card { position: relative; min-width: 0; min-height: 0; display: grid; grid-template-rows: 21px auto 18px; align-content: start; align-items: start; row-gap: 6px;  border: 1px solid var(--line);  background: var(--surface); box-shadow: var(--shadow); }
.metric-card > span, .metric-card small { color: var(--muted); }
.metric-card > span:not(.metric-info) { padding-right: 28px; font-size: 14px; line-height: 21px; }
.metric-card strong { color: var(--navy); font-size: clamp(25px, 2.35vw, 35px); font-weight: var(--metric-value-font-weight); letter-spacing: -1.25px; line-height: 1.2; white-space: nowrap; }
.metric-card :is(strong, small).positive { color: var(--positive); }
.metric-card :is(strong, small).negative { color: var(--danger); }
.metric-card small { font-size: 12px; }
.metric-card > small { display: -webkit-box; max-height: 2.9em; overflow: hidden; line-height: 1.45; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.metric-info { position: absolute; top: 15px; right: 15px; z-index: 8; }
.metric-info .metric-info__trigger { width: 22px; height: 22px; border: 0; background: transparent; color: #6a7c91; font-size: inherit; font-weight: 400; }
.metric-info .metric-info__trigger svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.metric-info .metric-info__content { top: 28px; right: 0; left: auto; width: min(340px, calc(100vw - 42px)); max-width: none; padding: 12px 13px; text-align: left;    }
:is(.metric-card, .metric-info--inline) .metric-info__content .metric-info__value { display: block; margin-top: 8px; color: var(--navy-2); font-size: 12px; font-weight: 600; letter-spacing: 0; white-space: normal; }
.metric-info .metric-info__content::before { right: 5px; left: auto; }
.metric-card:has(.metric-info:hover), .metric-card:has(.metric-info:focus-within), .metric-card:has(.metric-info__trigger[aria-expanded="true"]) { z-index: 12; }
.metric-card-value { display: grid; gap: 1px; }
.metric-card .metric-monthly { font-size: 13px; font-weight: var(--metric-value-font-weight); }
.metric-card--primary { border-color: var(--navy-2); background: linear-gradient(145deg, var(--navy-3), var(--navy)); }
.metric-card--primary > span, .metric-card--primary small { color: #c8d4e2; }
.metric-card--primary strong { color: white; }
.metric-card--primary .metric-info__trigger { color: rgba(255,255,255,.82); }
.metric-card--primary .metric-info__trigger:hover, .metric-card--primary .metric-info__trigger:focus-visible, .metric-card--primary .metric-info__trigger[aria-expanded="true"] { background: rgba(255,255,255,.14); color: white; }
.metric-card--primary .metric-info__content { color: var(--ink); }
.chart-grid { display: grid; grid-template-columns: minmax(0, 1fr);  margin-bottom: 18px; }
.chart-panel { min-width: 0; overflow: hidden; }
.chart-intro { max-width: none; margin: 7px 0 0;    }
.chart-settings-button { display: grid; width: 32px; height: 32px; place-items: center; padding: 0; border: 1px solid var(--line-strong); border-radius: 5px; background: white; color: var(--muted); cursor: pointer; }
.chart-settings-button:hover { border-color: var(--blue); background: var(--blue-soft); color: var(--navy-2); }
.chart-settings-button:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.chart-settings-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chart-canvas { position: relative; width: 100%; min-height: 315px; }
.chart-canvas svg { display: block; width: 100%; height: auto; min-height: 315px; overflow: visible; }
.chart-canvas--waterfall, .chart-canvas--waterfall svg { min-height: 0; }
.chart-grid-line { stroke: #dfe4eb; stroke-width: 1; }
.chart-axis-label { fill: #687586; font-size: var(--chart-axis-font-size); font-weight: var(--chart-axis-font-weight); }
.chart-axis-month { fill: #526174; font-size: var(--chart-category-font-size); font-weight: var(--chart-category-font-weight); }
.chart-axis-year { fill: #526174; font-size: var(--chart-category-font-size); font-weight: var(--chart-category-font-weight); letter-spacing: .015em; }
.chart-axis-year-tick { stroke: #dfe4eb; stroke-width: 1; }
.chart-axis-year-divider { stroke: #a6abb2; stroke-width: 1.5; }
.chart-axis-year-band { fill: #eceff2; }
.chart-axis-year-band--alternate { fill: #eceff2; }
.chart-axis-title { fill: #687586; font-size: 11px; font-weight: 400; letter-spacing: .05em; text-transform: uppercase; }
.waterfall-bar { rx: 3px; }
.waterfall-bar--positive { fill: #315f87; }
.waterfall-bar--negative { fill: var(--danger-chart); }
.waterfall-bar--total { fill: #0b1f3a; }
.waterfall-bar--subtotal { fill: var(--blue); }
.waterfall-bar--refund { fill: var(--positive-soft); }
:is(#wealth-waterfall, [data-distribution-chart]) .waterfall-bar--positive { fill: color-mix(in srgb, var(--blue) 55%, white); }
:is(#wealth-waterfall, [data-distribution-chart]) .waterfall-bar--negative { fill: var(--danger-soft); }
:is(#wealth-waterfall, [data-distribution-chart]) .waterfall-bar--total { fill: var(--navy); }
.waterfall-connector { stroke: #aeb8c6; stroke-width: 1; stroke-dasharray: 3 3; }
.waterfall-value { fill: #17263d; font-size: var(--chart-value-font-size); font-weight: var(--chart-value-font-weight); text-anchor: middle; }
.waterfall-label { fill: #687586; font-size: var(--chart-category-font-size); font-weight: var(--chart-category-font-weight); text-anchor: middle; }
.history-area { fill: url(#history-area-gradient); }
.history-line { fill: none; stroke: #173b63; stroke-width: 3.25; stroke-linecap: round; stroke-linejoin: round; }
.liquidity-area { stroke: none; }
.liquidity-area--private { fill: url(#liquidity-private-gradient); }
.liquidity-area--company { fill: url(#liquidity-company-gradient); }
.liquidity-boundary { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.liquidity-boundary--private { stroke: #7899b7; stroke-width: 2.25; }
.liquidity-private-point { fill: #7899b7; stroke: none; }
.liquidity-total-line { stroke: #173b63; stroke-width: 3.25; }
.history-preview-line { fill: none; stroke: #5f88ad; stroke-width: 2; stroke-dasharray: 6 6; }
.history-line--plan { stroke: #a9b3c1; stroke-width: 2; stroke-dasharray: 6 6; }
.history-point { fill: #173b63; stroke: none; }
.fx-hover-marker { pointer-events: none; }
.fx-hover-point { fill: var(--terracotta); stroke: var(--surface); stroke-width: 2; }
.fx-cursor-info { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 16px; min-height: 20px; margin-top: 6px; color: var(--muted); font-size: 12px; line-height: 20px; pointer-events: none; }
.fx-cursor-info__date { color: var(--muted); font-size: 12px; }
.fx-cursor-info__row { display: inline-flex; gap: 6px; }
.fx-cursor-info__row strong { color: var(--navy); font-variant-numeric: tabular-nums; }
.history-current-guide { stroke: #5f88ad; stroke-width: 1.5; stroke-dasharray: 4 5; }
.history-current-point { fill: #5f88ad; stroke: none; }
.history-current-label { fill: #173b63; font-size: var(--chart-value-font-size); font-weight: var(--chart-value-font-weight); text-anchor: end; }
.history-empty-label { fill: #687586; font-size: var(--chart-category-font-size); font-weight: var(--chart-category-font-weight); text-anchor: middle; }
.chart-heading-tools {  justify-items: end;  }
.chart-legend { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 13px; color: var(--muted); font-size: 12px; }
.chart-legend span { display: flex; align-items: center; gap: 6px; }
.chart-legend i { display: inline-block; width: 17px; height: 3px; border-radius: 3px; background: #173b63; }
.chart-legend .legend-plan { height: 2px; background: repeating-linear-gradient(90deg, #a9b3c1 0 5px, transparent 5px 8px); }
.chart-legend .legend-current { width: 8px; height: 8px; border-radius: 50%; background: #5f88ad; }
.chart-legend .legend-liquidity-private { background: #7899b7; }
.chart-legend .legend-liquidity-total { background: #173b63; }
.chart-note { margin: 12px 0 0; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; line-height: 1.5; }
.chart-tooltip { position: absolute; z-index: 4; min-width: 145px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 5px; background: rgba(255,255,255,.97); box-shadow: 0 8px 24px rgba(11,31,58,.13);   pointer-events: none; transform: translate(-50%, -115%); }
.chart-tooltip strong, .chart-tooltip span { display: block; }
.chart-tooltip span { margin-top: 2px; color: var(--muted); }
#wealth-history-tooltip { width: max-content; white-space: nowrap; }
.forecast-hit-point { fill: transparent; cursor: var(--chart-hover-cursor); pointer-events: all; }
.forecast-svg-tooltip { pointer-events: none; filter: drop-shadow(0 6px 12px rgba(11,31,58,.14)); }
.forecast-svg-tooltip rect { fill: rgba(255,255,255,.98); stroke: #dfe4eb; stroke-width: 1; }
.forecast-svg-tooltip__value { fill: #17263d; font-size: 13.5px; font-weight: 650; }
.forecast-svg-tooltip__line { fill: #5f6e81; font-size: 11.5px; }
.forecast-svg-tooltip__separator { stroke: #d8dee7; stroke-width: 1; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(340px, .75fr);  }
.dashboard-grid--summary { grid-template-columns: minmax(300px, 1fr) minmax(0, 2fr); }
.dashboard-grid--import { grid-template-columns: minmax(320px, .8fr) minmax(420px, 1.2fr); }
.panel {  border: 1px solid var(--line);  background: var(--surface); box-shadow: var(--shadow); }
.panel-heading {     margin-bottom: 20px; }
.panel-heading a { color: var(--blue); font-size: 13px; font-weight: var(--text-emphasis-weight); }
.panel-unit { flex: 0 0 auto; color: var(--muted); font-size: 11px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; }
.entity-row { padding: 18px 0; border-top: 1px solid var(--line); }
.entity-row:first-child { padding-top: 0; border-top: 0; }
.entity-title { display: flex; justify-content: space-between; gap: 16px; }
.entity-title span { color: var(--muted); font-size: 13px; }
.entity-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 17px 0 0; }
.entity-metrics div { padding: 12px; border-radius: 5px; background: var(--surface-2); }
.entity-metrics dt { color: var(--muted); font-size: 11px; }
.entity-metrics dd { margin: 4px 0 0; color: var(--navy-2); font-weight: 650; }
.due-list article, .import-list article { display: flex; justify-content: space-between; gap: 20px; padding: 15px 0; border-top: 1px solid var(--line); }
.due-list article:first-child, .import-list article:first-child { padding-top: 0; border-top: 0; }
.due-list span, .import-list span { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; }
.due-amount { text-align: right; white-space: nowrap; }
.dashboard-change-panel { display: flex; min-width: 0; flex-direction: column; overflow: hidden;  }
.dashboard-change-main { padding: 24px; }
.dashboard-change-heading { align-items: flex-start; margin-bottom: 24px; }
.dashboard-change-heading p { display: flex; align-items: baseline; gap: 8px; margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.dashboard-change-currency { padding-left: 8px; border-left: 1px solid var(--line-strong); font-size: 10px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; }
.dashboard-change-heading-value { flex: 0 0 auto; text-align: right; }
.dashboard-change-heading-value > span { display: block; margin-bottom: 4px; color: var(--muted); font-size: 11px; }
.dashboard-change-heading-value > div { display: flex; align-items: baseline; justify-content: flex-end; gap: 14px; }
.dashboard-change-heading-value strong { font-size: clamp(29px, 2.8vw, 42px); font-weight: 650; letter-spacing: -1.2px; line-height: 1; white-space: nowrap; }
.dashboard-change-heading-value small { font-size: 14px; font-weight: 650; white-space: nowrap; }
.dashboard-change-overview { display: block; }
.dashboard-change-breakdown h3, .dashboard-change-drivers-section h3 { margin: 0 0 10px; color: var(--muted); font-size: 12px; font-weight: var(--text-emphasis-weight); letter-spacing: .035em; text-transform: uppercase; }
.dashboard-change-components { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0; }
.dashboard-change-components > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 14px; padding: 12px 14px; border-radius: 5px; background: var(--surface-2); }
.dashboard-change-components dt { font-size: 13px; }
.dashboard-change-components dd { margin: 0; font-size: 15px; font-weight: var(--text-emphasis-weight); font-variant-numeric: tabular-nums; white-space: nowrap; }
.dashboard-change-drivers-section { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.dashboard-change-drivers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px 30px; margin: 0; padding: 0; list-style: none; }
.dashboard-change-drivers li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 16px; padding: 8px 0; }
.dashboard-change-drivers li > div { min-width: 0; }
.dashboard-change-drivers strong, .dashboard-change-drivers span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-change-drivers strong { color: var(--navy-2); font-size: 14px; font-weight: 650; }
.dashboard-change-drivers span { margin-top: 2px; color: var(--muted); font-size: 11px; }
.dashboard-change-drivers b { font-size: 15px; font-weight: var(--text-emphasis-weight); font-variant-numeric: tabular-nums; white-space: nowrap; }
.change-value--positive { color: var(--positive); }
.change-value--negative { color: var(--danger); }
.change-value--neutral { color: var(--navy-2); }
.dashboard-change-liquidity { display: flex; align-items: center; gap: 7px; margin: 9px 0 0; padding-top: 13px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.dashboard-change-liquidity svg { flex: 0 0 auto; width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.dashboard-change-liquidity strong { margin-left: auto; font-size: 12px; white-space: nowrap; }
.dashboard-change-note { margin: 15px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.dashboard-tax-coverage { margin-top: auto; padding: 19px 24px 21px; border-top: 1px solid var(--line); background: var(--surface-2); }
.dashboard-tax-coverage-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 18px; margin-bottom: 13px; }
.dashboard-tax-coverage-heading > div:first-child strong, .dashboard-tax-coverage-heading > div:first-child span, .dashboard-tax-coverage-heading > div:last-child strong, .dashboard-tax-coverage-heading > div:last-child span { display: block; }
.dashboard-tax-coverage-heading > div:first-child strong { color: var(--navy-2); font-size: 15px; }
.dashboard-tax-coverage-heading span { margin-top: 2px; color: var(--muted); font-size: 11px; }
.dashboard-tax-coverage-heading > div:last-child { text-align: right; white-space: nowrap; }
.dashboard-tax-coverage-heading > div:last-child strong { color: var(--danger); font-size: 17px; }
.dashboard-tax-coverage-track { display: flex; overflow: hidden; height: 8px; border-radius: 999px; background: var(--surface-3); }
.dashboard-tax-coverage-track span { border-radius: inherit; background: var(--positive); }
.dashboard-tax-coverage-labels { display: flex; justify-content: space-between; gap: 16px; margin-top: 7px; color: var(--muted); font-size: 11px; }
.dashboard-tax-coverage-heading--settled { margin-bottom: 0; }
.dashboard-tax-coverage-heading--settled > strong { color: var(--positive); font-size: 13px; }
.warning-panel { margin-top: 18px; }
.warning-panel { border-color: #e4d2af; background: #fffdf8; }
.warning-panel ul { margin-bottom: 0; padding-left: 20px; color: var(--warning); }
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr);  margin-bottom: 18px; }
.account-card { display: flex; flex-direction: column; gap: 7px;  border: 1px solid var(--line);  background: var(--surface); box-shadow: var(--shadow); }
.account-card > span, .account-card small { color: var(--muted); font-size: 12px; }
.account-card strong { margin-top: 12px; color: var(--navy); font-size: 25px; font-weight: var(--metric-value-font-weight); }
.account-card .text-action { margin-top: 8px; }
.asset-account-grid .account-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 18px;  }
.asset-account-grid .account-card > span, .asset-account-grid .account-card h2, .asset-account-grid .account-card small, .asset-account-grid .account-card .text-action { grid-column: 1; }
.asset-account-grid .account-card h2 { margin: 1px 0; font-size: 19px; }
.asset-account-grid .account-card strong { grid-column: 2; grid-row: 1 / span 3; align-self: center; margin: 0; font-size: 21px; }
.asset-account-grid .account-card .text-action { margin-top: 3px; }

/* Share-Bewertung und Verkauf */
.section-tabs { display: inline-flex; gap: 4px; margin-bottom: 25px; padding: 4px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-3); }
.section-tabs a { min-height: 40px; display: inline-flex; align-items: center; padding: 0 15px; border-radius: 5px; color: var(--muted); font-size: 13px; font-weight: var(--tab-font-weight); }
.section-tabs a:hover { color: var(--navy-2); }
.section-tabs a.active { background: white; box-shadow: 0 1px 4px rgba(11,31,58,.08); color: var(--navy-2); }
.share-summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--page-box-gap); margin-bottom: 18px; }
.share-warning-panel { margin-bottom: 20px; border-color: #e4d2af; background: #fffdf8; }
.share-warning-panel ul { margin: 0; padding-left: 20px; color: var(--warning); }
.share-growth-panel { margin-bottom: 26px; }
.share-growth-canvas, .share-growth-canvas svg { min-height: 260px; }
.share-growth-grid { stroke: #dfe4eb; stroke-width: 1; stroke-dasharray: 3 4; }
.share-growth-label { fill: var(--navy-2); font-size: var(--chart-category-font-size); font-weight: var(--chart-category-font-weight); }
.share-growth-bar--cost { fill: #aeb8c6; }
.share-growth-bar--current { fill: #173b63; }
.share-growth-bar--current:focus { outline: none; stroke: #6f9bc2; stroke-width: 3; }
.share-growth-delta { fill: var(--positive); font-size: var(--chart-value-font-size); font-weight: var(--chart-value-font-weight); }
.share-growth-legend .legend-cost { background: #aeb8c6; }
.share-growth-legend .legend-current-value { background: #173b63; }
.fc-investment-block { margin-top: 27px; }
.fc-investment-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 14px; }
.share-class-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));  }
.share-class-card, .share-sale-card { padding: 0; overflow: hidden; }
.share-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px;  border-bottom: 1px solid var(--line); }
.share-card-head h2 { font-size: var(--text-panel-size); }
.share-card-head p { margin: 5px 0 0;   }
.share-fact-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; border-bottom: 1px solid var(--line); }
.share-fact-grid > div { min-width: 0; padding: 18px 20px; border-left: 1px solid var(--line); }
.share-fact-grid > div:first-child { border-left: 0; }
.share-fact-grid dt { color: var(--muted); font-size: 11px; }
.share-fact-grid dd { margin: 6px 0 0; color: var(--navy-2); font-size: 18px; font-weight: 650; font-variant-numeric: tabular-nums; }
.share-fact-grid small { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.35; }
.share-fact-grid--compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.share-fact-grid--compact > div:nth-child(odd) { border-left: 0; }
.share-fact-grid--compact > div:nth-child(n+3) { border-top: 1px solid var(--line); }
.share-class-card .share-fact-grid { border-bottom: 0; }
.share-class-card .share-fact-grid > div { padding-inline: 24px; }
.share-holdings-section > .fc-investment-heading { padding-inline: 0; }
.share-installments { border-bottom: 1px solid var(--line); }
.share-installments table, .share-holder-table { min-width: 720px; }
.share-holder-table th, .share-holder-table td { padding: 12px 14px; }
.share-holder-table td small { display: block; margin-top: 2px; }
.share-sale-foot { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 18px 28px; padding: 16px 22px; background: var(--surface-2); color: var(--muted); font-size: 12px; }
.share-sale-foot strong { margin-left: 5px; color: var(--navy-2); font-size: 14px; }
.share-source { margin: 0; padding: 13px 22px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; line-height: 1.45; }
.investment-actions { flex-wrap: wrap; }
.investment-history-panel { margin-bottom: 26px; }
.investment-history-canvas { height: var(--investment-chart-height, 561px); min-height: var(--investment-chart-height, 561px); overflow: hidden; }
.investment-history-canvas svg { height: var(--investment-chart-height, 561px); min-height: 0; overflow: hidden; }
.investment-history-canvas .chart-tooltip { width: max-content; max-width: min(280px, calc(100% - 16px)); box-sizing: border-box; transform: none; }
.investment-chart-grid { stroke: #dfe4eb; stroke-width: 1; }
.investment-chart-value-axis { stroke: #8b929c; stroke-width: 1; }
.investment-chart-zero { stroke: #dfe4eb; stroke-width: 1; }
.investment-value-area { fill: url(#investment-value-gradient); }
.investment-value-line { fill: none; stroke: #173b63; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.investment-value-point { fill: white; stroke: #173b63; stroke-width: 4; cursor: var(--chart-hover-cursor); }
.investment-value-point:focus { outline: none; stroke: #6f9bc2; stroke-width: 6; }
.investment-gain-bar { fill: var(--flow-in); }
.investment-gain-bar--negative { fill: var(--danger-chart); }
.investment-fx-bar { fill: #d49a37; }
.investment-bar-hit { fill: transparent; pointer-events: all; cursor: var(--chart-hover-cursor); }
.investment-bar-hit:focus { outline: none; stroke: #6f9bc2; stroke-width: 2; stroke-dasharray: 3 2; }
.investment-annual-return { cursor: var(--chart-hover-cursor); }
.investment-annual-return-badge-host { display: flex; align-items: center; justify-content: center; height: 100%; }
.investment-annual-return:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.investment-annual-return-heading { fill: var(--muted); font-size: 11px; font-weight: 500; }
.investment-year-label { fill: #526174; font-size: var(--chart-category-font-size); font-weight: var(--chart-category-font-weight); }
.investment-event-line { stroke: #8b98a8; stroke-width: 1; stroke-dasharray: 2 3; }
.investment-event-label { font-size: var(--chart-category-font-size); font-weight: var(--chart-category-font-weight); }
.investment-event-label--purchase { fill: var(--positive); }
.investment-event-label--sale { fill: var(--danger); }
.investment-history-legend .legend-investment-value { background: #173b63; }
.investment-history-legend .legend-annual-gain { background: var(--flow-in); }
.investment-history-legend .legend-fx-effect { background: #d49a37; }
.investment-history-legend .legend-event { width: 2px; border-radius: 0; background: #8b98a8; }
.transaction-ledger-table { min-width: 1080px; table-layout: fixed; --table-action-width: 68px; }
.transaction-ledger-table col:nth-child(1) { width: 11%; }
.transaction-ledger-table col:nth-child(2) { width: 8%; }
.transaction-ledger-table col:nth-child(3) { width: 11%; }
.transaction-ledger-table col:nth-child(4) { width: 8%; }
.transaction-ledger-table col:nth-child(5) { width: 10%; }
.transaction-ledger-table col:nth-child(6) { width: 10%; }
.transaction-ledger-table col:nth-child(7), .transaction-ledger-table col:nth-child(8) { width: 9%; }
.transaction-ledger-table col:nth-child(9) { width: 12%; }
.transaction-ledger-table col:nth-child(10) { width: calc(var(--table-action-width) + 27px); }
.transaction-ledger-table th, .transaction-ledger-table td { padding-right: 10px; padding-left: 10px; }
.transaction-ledger-table thead th { height: 54px; vertical-align: middle; line-height: 1.15; }
.transaction-ledger-table thead th.numeric { white-space: normal; }
.transaction-ledger-table thead th:nth-child(n+7) .table-sort-button > span:first-child { max-width: 90px; white-space: normal; text-align: right; line-height: 1.15; }
.annual-investment-table { min-width: 1100px; table-layout: fixed; }
.annual-investment-table col:nth-child(1) { width: 7.5%; }
.annual-investment-table col:nth-child(2) { width: 8%; }
.annual-investment-table col:nth-child(3), .annual-investment-table col:nth-child(4), .annual-investment-table col:nth-child(5), .annual-investment-table col:nth-child(10), .annual-investment-table col:nth-child(11) { width: 6.5%; }
.annual-investment-table col:nth-child(6) { width: 5%; }
.annual-investment-table col:nth-child(7), .annual-investment-table col:nth-child(9) { width: 8%; }
.annual-investment-table col:nth-child(8) { width: 7.5%; }
.annual-investment-table col:nth-child(12), .annual-investment-table col:nth-child(13) { width: 7%; }
.annual-investment-table col:nth-child(14) { width: 9.5%; }
.annual-investment-table th, .annual-investment-table td { padding-inline: 7px; }
.annual-investment-table :is(th, td).numeric { padding-right: 19px; }
.annual-investment-table th:first-child, .annual-investment-table td:first-child { text-align: left; }
.annual-investment-table th:nth-child(2), .annual-investment-table td:nth-child(2) { text-align: center; }
.annual-investment-table th:last-child, .annual-investment-table td:last-child { text-align: right; }
.annual-investment-table thead th { height: 54px; padding-top: 7px; padding-bottom: 7px; vertical-align: middle; line-height: 1.15; }
.annual-investment-table .table-sort-button { min-height: 38px; display: inline-flex; align-items: center; justify-content: flex-end; gap: 4px; line-height: 1.15; }
.annual-investment-table th:not(.numeric) .table-sort-button { justify-content: center; }
.annual-investment-table th:first-child .table-sort-button { justify-content: flex-start; }
.annual-investment-table th:last-child .table-sort-button { width: 100%; max-width: 80px; margin-left: auto; justify-content: flex-start; }
.annual-investment-table .table-sort-button > span:first-child { width: auto; text-align: inherit; }
.annual-investment-table .table-sort-indicator { position: static; min-width: 8px; }
.annual-investment-table .numeric .table-sort-button { position: relative; }
.annual-investment-table .numeric .table-sort-indicator { min-width: 6px; font-size: 8px; }
.annual-investment-table .numeric .table-sort-indicator:not(:empty) { position: absolute; right: -7px; }
.annual-investment-table .table-action-button {       text-align: center; }
:is(.transaction-ledger-table, .annual-investment-table) :is(th, td):first-child { padding-left: 17px; }
:is(.transaction-ledger-table, .annual-investment-table) :is(th, td):last-child { padding-right: 17px; }
.annual-investment-unit { flex: 0 0 auto; color: var(--muted); font-size: 12px; font-weight: 650; white-space: nowrap; }
.share-class-table-tabs { width: max-content; display: inline-flex; gap: 3px; margin: 0; padding: 3px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface-3); }
.share-class-table-tabs a { min-height: 40px; display: inline-flex; align-items: center; padding: 0 16px; border-radius: 4px; color: var(--muted); font-size: 16px; font-weight: var(--tab-font-weight); white-space: nowrap; }
.share-class-table-tabs a:hover { color: var(--navy-2); }
.share-class-table-tabs a.active { background: white; box-shadow: 0 1px 4px rgba(11,31,58,.1); color: var(--navy-2); }
.share-history-panel[hidden], .form-field--hidden { display: none; }
.share-valuation-history-table { min-width: 680px; }
.transaction-ledger-table td small { display: block; margin-top: 3px; }
.transaction-ledger-table .currency-secondary { font-size: 11px; font-weight: 450; }
.investment-event { white-space: nowrap; }
.annual-row--sale { background: #fffafb; }
.investment-reconciliation-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));  }
.investment-reconciliation-card h2 { margin-bottom: 18px; }
.investment-reconciliation-card dl { margin: 0; }
.investment-reconciliation-card dl > div { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; padding: 12px 0; border-top: 1px solid var(--line); }
.investment-reconciliation-card dt { color: var(--muted); font-size: 12px; }
.investment-reconciliation-card dd { margin: 0; color: var(--navy-2); font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.investment-reconciliation-card .investment-reconciliation-total { margin-top: 4px; border-top-color: var(--navy-2); }
.investment-reconciliation-total dt, .investment-reconciliation-total dd { color: var(--navy-2); font-size: 16px; }
.calculation-formula { margin: 16px 0 0; padding: 12px 14px; border-radius: 5px; background: var(--surface-2); color: var(--muted); font-size: 11px; line-height: 1.5; }
.inline-actions { display: flex; flex-wrap: wrap; gap: 16px; }
.sale-details, .calculation-details { padding: 0; overflow: hidden; }
.sale-details summary, .calculation-details summary { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px 24px; cursor: pointer; list-style: none; }
.sale-details summary::-webkit-details-marker, .calculation-details summary::-webkit-details-marker { display: none; }
.sale-details summary strong, .calculation-details summary strong { display: block; color: var(--navy-2); font-size: 18px; }
.sale-details summary > span:last-child, .calculation-details summary > span:last-child { color: var(--blue); font-size: 12px; font-weight: var(--text-emphasis-weight); }
.sale-details summary .summary-action-button, .calculation-details summary .summary-action-button {  display: inline-flex; align-items: center; justify-content: center;  border: 1px solid var(--line-strong); border-radius: 5px; background: white; color: var(--blue); white-space: nowrap; }
.sale-details[open] summary, .calculation-details[open] summary { border-bottom: 1px solid var(--line); }
.sale-details-body, .calculation-details-body { padding: 22px 24px; }
.calculation-details-body p { margin: 0 0 12px; color: var(--muted); line-height: 1.55; }
.calculation-details-body p:last-child { margin-bottom: 0; }

@media (max-width: 1500px) {
  .holdings-table .holdings-valuation-status { display: none; }
  .holdings-table :is(th, td) { padding-inline: 12px; }
  .obligations-table { table-layout: fixed; }
  .obligations-table :is(th, td) { padding-inline: 10px; }
  .obligations-table .obligations-due-date,
  .obligations-table .obligations-confidence { display: none; }
  .obligations-table .obligations-status { width: 8%; }
  .obligations-table .obligations-entity { width: 11%; }
  .obligations-table .obligations-type { width: 15%; }
  .obligations-table .obligations-position { width: 24%; }
  .obligations-table .obligations-counterparty { width: 14%; }
  .obligations-table .obligations-amount { width: 15%; }
  .obligations-table .obligations-action { width: 13%; }
  .obligations-table .obligations-action .table-action-button {  display: inline-flex; align-items: center; justify-content: center; }
}

@media (min-width: 801px) and (max-width: 1500px) {
  .transaction-ledger-panel { max-width: 100%; contain: inline-size; }
  .transaction-ledger-panel .table-scroll { max-width: 100%; overflow-x: clip; overscroll-behavior-inline: none; touch-action: pan-y; }
  .transaction-ledger-table { width: 100%; min-width: 0; max-width: 100%; }
  .transaction-ledger-table th, .transaction-ledger-table td { padding-inline: 4px; }
  .transaction-ledger-table thead th { font-size: var(--table-header-font-size); letter-spacing: .025em; }
  .transaction-ledger-table tbody td { font-size: var(--table-body-font-size); }
  .annual-investment-panel { max-width: 100%; contain: inline-size; }
  .annual-investment-panel .table-scroll { max-width: 100%; overflow-x: clip; overscroll-behavior-inline: none; touch-action: pan-y; }
  .annual-investment-table { width: 100%; min-width: 0; max-width: 100%; }
  .annual-investment-table th, .annual-investment-table td { padding-inline: 4px; }
  .annual-investment-table :is(th, td).numeric { padding-right: 16px; }
  .annual-investment-table thead th { font-size: var(--table-header-font-size); letter-spacing: .025em; }
  .annual-investment-table tbody td { font-size: var(--table-body-font-size); }
  .annual-investment-table th:last-child .table-sort-button { max-width: 68px; }
  :is(.transaction-ledger-table, .annual-investment-table) :is(th, td):first-child { padding-left: 10px; }
  :is(.transaction-ledger-table, .annual-investment-table) :is(th, td):last-child { padding-right: 10px; }
}

/* Tabellen und Formulare */
.table-panel {  overflow: hidden; }
/* Contain absolutely positioned accessible text within wide tables.
   Otherwise its static position can enlarge the document in mobile Safari. */
.table-scroll { position: relative; overflow-x: auto; }
.liquidity-flow-panel .table-scroll { overflow-x: clip; }
.liquidity-flow-table { min-width: 0; table-layout: fixed; }
.liquidity-flow-table col { width: 10%; }
.liquidity-flow-table :is(th, td) { padding-inline: 10px; }
.liquidity-flow-table :is(th, td):first-child { padding-left: 17px; }
.liquidity-flow-table :is(th, td):last-child { padding-right: 17px; }
.liquidity-flow-table th { overflow-wrap: normal; line-height: 1.25; white-space: normal; word-break: normal; }
.liquidity-flow-table th.liquidity-header-lines { white-space: normal; }
.liquidity-header-lines .table-sort-button > span:first-child { display: block; line-height: 1.25; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 14px 17px; border-top: 1px solid var(--line); text-align: left; vertical-align: middle; }
th, .dividend-schedule-columns { border-bottom: 1px solid var(--line-strong); background: var(--surface-3); color: #526073; font-size: var(--table-header-font-size); font-weight: 400; letter-spacing: .045em; text-transform: uppercase; }
td { font-size: var(--table-body-font-size); }
td small { color: var(--muted); }
.numeric { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.currency-primary, .currency-secondary { display: block; }
.currency-secondary { min-height: 1.35em; margin-top: 2px; color: var(--muted); font-size: 11px; line-height: 1.35; white-space: nowrap; }
.currency-secondary--placeholder { display: none; }
.holdings-table tbody tr { height: 67px; }
.holdings-table .holdings-action { width: 1%; white-space: nowrap; }
.positive { color: var(--positive); }
.negative { color: var(--danger); }
.obligation-type-badge { gap: 6px; white-space: nowrap; }
.obligation-type-icon { display: inline-grid; width: 15px; height: 15px; flex: 0 0 15px; place-items: center; }
.obligation-type-icon svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.obligations-position strong, .obligations-position small { display: block; }
.obligations-position small { margin-top: 3px; }
.obligations-amount--receivable .currency-primary { color: var(--positive); }
.obligations-amount--payable .currency-primary { color: var(--danger); }
.empty-cell, .empty-state { padding: 30px; color: var(--muted); text-align: center; }
.empty-state p { margin: 7px 0 0; }
.status-warning { color: var(--warning); font-weight: 650; }
.primary-button, .secondary-button, .danger-button { display: inline-flex; align-items: center; justify-content: center;   border: 1px solid var(--navy-2); border-radius: 5px; font-weight: var(--text-emphasis-weight); }
.primary-button { background: var(--navy-2); color: white; }
.primary-button:hover { background: var(--navy); }
.secondary-button { background: white; color: var(--navy-2); border-color: var(--line-strong); }
.secondary-button:hover { background: var(--blue-soft); border-color: var(--navy-2); }
.danger-button { border-color: var(--danger); background: white; color: var(--danger); }
.danger-button:hover { background: var(--danger-bg); }
.form-delete-action { margin-left: auto; }
.delete-warning { display: grid; gap: 14px; }
.delete-warning p { margin: 0; line-height: 1.55; }
.delete-related-list { margin: 0; padding-left: 20px; color: var(--muted); }
.asset-editor.delete-confirmation-dialog { width: min(620px, calc(100vw - 36px)); }
.asset-editor.tax-reserve-editor { width: min(520px, calc(100vw - 36px)); }
.tax-reserve-recommendation { display: grid; gap: 5px; margin-bottom: 20px; padding: 15px 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); }
.tax-reserve-recommendation--action { border-color: #b8cde1; background: #f3f8fc; }
.tax-reserve-recommendation span { color: var(--muted); font-size: 11px; font-weight: 400; letter-spacing: .035em; text-transform: uppercase; }
.tax-reserve-recommendation strong { color: var(--navy-2); font-size: 19px; }
.tax-reserve-recommendation small { color: var(--muted); line-height: 1.45; }
.delete-confirmation-dialog .asset-editor__panel { overflow: visible; }
.delete-confirmation-dialog .asset-editor__actions { position: static; margin-top: 24px; }
.text-action, .table-action { color: var(--blue); font-size: 13px; font-weight: var(--text-emphasis-weight); }
.table-action { white-space: nowrap; }
.table-row-actions { display: flex; align-items: flex-end; flex-direction: column; gap: 5px; }
.table-action--secondary { color: var(--muted); font-size: 11px; font-weight: var(--text-emphasis-weight); }
.table-action-heading, .table-action-cell { width: 1%; white-space: nowrap; }
.table-action-heading .table-sort-button { justify-content: flex-start; }
.table-action-button { display: inline-flex; align-items: center; justify-content: center;  border: 1px solid var(--line-strong); border-radius: 4px; background: white; color: var(--blue); font: inherit;  font-weight: var(--text-emphasis-weight); line-height: 1.2; white-space: nowrap; cursor: pointer; }
.table-action-button:hover { border-color: var(--blue); background: var(--blue-soft); }
.tax-year-action-heading, .tax-year-action-cell { text-align: right; }
.tax-year-action-heading > span { display: inline-block; width: min(80px, 100%); text-align: left; }
.tax-year-action-cell .table-action-button {  text-align: center; }
.panel-heading .panel-heading-button { min-height: 36px; padding: 0 12px; color: var(--navy-2); font-size: 12px; white-space: nowrap; }
/* Center in the visible viewport without transforms, so fixed help tooltips keep their coordinates. */
.asset-editor { position: fixed; top: calc(var(--dialog-viewport-top) + var(--safe-area-top) + var(--dialog-edge)); bottom: calc(100% - var(--dialog-viewport-top) - var(--dialog-viewport-height) + var(--safe-area-bottom) + var(--dialog-edge)); left: calc(var(--dialog-viewport-left) + var(--safe-area-left) + var(--dialog-edge)); right: calc(100% - var(--dialog-viewport-left) - var(--dialog-viewport-width) + var(--safe-area-right) + var(--dialog-edge)); margin: auto;   max-height: var(--dialog-available-height); padding: 0; overflow: hidden; border: 0; border-radius: 10px; background: var(--surface); color: var(--navy-2); box-shadow: 0 24px 70px rgba(11,31,58,.28); }
.asset-editor::backdrop { background: rgba(11,31,58,.48); backdrop-filter: blur(2px); }
.asset-editor__shell { display: flex; min-height: 0; max-height: var(--dialog-available-height); flex-direction: column; }
.asset-editor__shell > :is(.asset-editor__header, .asset-editor__actions) { flex-shrink: 0; }
.asset-editor__shell > .asset-editor__panel { min-height: 0; }
.asset-editor:is([data-dialog-size-max], [data-dialog-size-first]) > .asset-editor__shell { height: var(--dialog-tab-height, auto); }
.asset-editor:is([data-dialog-size-max], [data-dialog-size-first]) > .asset-editor__shell > :is(.asset-editor__header, .asset-editor__actions) { flex-shrink: 0; }
.asset-editor:is([data-dialog-size-max], [data-dialog-size-first]) > .asset-editor__shell > .asset-editor__panel { flex: 1; min-height: 0; }
.asset-editor__header { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 24px 28px 18px; border-bottom: 1px solid var(--line); }
.dialog-context { margin: 0 0 var(--form-section-gap); color: var(--muted); font-size: 13px; line-height: 1.4; }
.asset-editor__header h2 { margin: 0; font-size: 25px; }
.asset-editor__header.asset-editor__header--compact { padding-bottom: 12px; }
.asset-editor__header--compact p { margin: 4px 0 0; }
.asset-editor__header-tools { display: flex; align-items: center; gap: 16px; flex-shrink: 0; }
.asset-editor__header-tools .metric-info { position: relative; top: auto; right: auto; }
.asset-editor__header-tools .metric-info__content p { margin: 0; font-size: inherit; line-height: inherit; }
.asset-editor__header-tools .metric-info__content p + p { margin-top: 10px; }
.asset-editor__header-tools .form-help__trigger[aria-expanded="false"] + .form-help__content { display: none; }
.asset-editor__close { width: 40px; height: 40px; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 50%; background: white; color: var(--muted); font-size: 25px; line-height: 1; cursor: pointer; }
.asset-editor__close:hover { background: var(--surface-3); color: var(--navy-2); }
.asset-editor__tabs { display: flex; gap: 5px; padding: 12px 28px 0; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.asset-editor__tabs button { min-height: 42px; padding: 0 18px; border: 0; border-bottom: 3px solid transparent; background: transparent; color: var(--muted); font: inherit; font-size: 13px; font-weight: var(--tab-font-weight); cursor: pointer; }
.asset-editor__tabs button { white-space: nowrap; }
.asset-editor__tabs button[aria-selected="true"] { border-bottom-color: var(--blue); color: var(--navy-2); }
.asset-editor__panel { padding: 24px 28px 28px; overflow-y: auto; overscroll-behavior-y: contain; }
.asset-editor__section + .asset-editor__section { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line); }
.asset-editor__section h3 { margin: 0 0 15px; font-size: 16px; }
.asset-editor__grid { gap: 17px 20px; }
.asset-editor__actions { position: sticky; bottom: -28px; display: flex; justify-content: flex-end; gap: 10px; margin: 26px -28px -28px; padding: 16px 28px; border-top: 1px solid var(--line); background: rgba(255,255,255,.96); }
.asset-editor__actions .form-delete-action { margin-right: auto; margin-left: 0; }
.wealth-chart-editor__intro { margin: 0 0 18px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.wealth-chart-config-list { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.wealth-chart-config-header, .wealth-chart-config-row { display: grid; grid-template-columns: 112px minmax(150px, .8fr) minmax(220px, 1.2fr) 83px; align-items: center; gap: 12px; }
.wealth-chart-config-header { min-height: 34px; padding: 7px 13px; background: var(--surface-2); color: var(--muted); font-size: 10px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.wealth-chart-config-row { min-height: 52px; padding: 7px 13px; border-top: 1px solid var(--line); background: white; }
.wealth-chart-config-kind { overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.wealth-chart-config-title { min-width: 0; overflow: hidden; color: var(--navy-2); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.wealth-chart-config-row label { min-width: 0; }
.wealth-chart-config-row input { width: 100%; height: 36px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 5px; color: var(--ink); font: inherit; font-size: 13px; }
.wealth-chart-config-order { display: flex; gap: 5px; }
.wealth-chart-config-order button { display: grid;   place-items: center;  border: 1px solid var(--line-strong); border-radius: 5px; background: white; color: var(--navy-3); cursor: pointer; }
.wealth-chart-config-order button:hover:not(:disabled) { border-color: var(--blue); background: var(--blue-soft); }
.wealth-chart-config-order button:disabled { opacity: .32; cursor: default; }
.wealth-chart-config-order svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.asset-editor__inline-actions { display: flex; justify-content: flex-end; margin-top: 18px; }
.asset-editor__empty { max-width: 620px; padding: 12px 0 20px; }
.asset-editor__empty h3 { margin: 0 0 8px; }
.asset-editor__empty p { margin: 0 0 20px; color: var(--muted); line-height: 1.55; }
.transaction-assignment-mode { margin: 22px 0 17px; padding: 0; border: 0; }
.transaction-assignment-mode legend { margin-bottom: 8px; color: var(--navy-2); font-size: 13px; font-weight: var(--text-emphasis-weight); }
.transaction-assignment-mode__options { display: inline-grid; grid-template-columns: repeat(2, minmax(150px, 1fr)); padding: 3px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-2); }
.transaction-assignment-mode__options label { position: relative; cursor: pointer; }
.transaction-assignment-mode__options input { position: absolute; opacity: 0; pointer-events: none; }
.transaction-assignment-mode__options span { display: flex; min-height: 38px; align-items: center; justify-content: center; padding: 0 16px; border-radius: 5px; color: var(--muted); font-size: 13px; font-weight: var(--tab-font-weight); }
.transaction-assignment-mode__options input:checked + span { background: white; color: var(--navy-2); box-shadow: 0 1px 4px rgba(11,31,58,.12); }
.transaction-assignment-mode__options input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 1px; }
.transaction-split-panel { margin-top: 4px; padding: 18px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); }
.transaction-split-footer { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 16px; }
.transaction-split-footer output { margin-left: auto; align-self: center; font-variant-numeric: tabular-nums; }
.transaction-split-columns { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(140px, .7fr) auto; gap: 12px; padding: 0 12px 7px; color: var(--navy-2); font-size: 12px; font-weight: var(--text-emphasis-weight); }
.transaction-split-field-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.transaction-split-rows { display: grid; gap: 10px; }
.transaction-split-row { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(140px, .7fr) auto; align-items: end; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 7px; background: white; }
.transaction-split-row.is-removed { display: none; }
.transaction-split-remove { display: flex; min-height: var(--field-height); align-items: center; gap: 7px; color: var(--muted); font-size: 12px; font-weight: 650; cursor: pointer; }
.transaction-split-remove input { width: 18px; height: 18px; accent-color: var(--danger); }
.transaction-split-add { margin: 0; }
.transaction-split-remember { min-height: 0; margin: 0; padding: 0; }
.transaction-split-remember .help-text { padding-left: 30px; }
.transaction-notes { margin-top: 18px; }
.valuation-editor-list { display: grid; gap: 10px; }
.valuation-editor { border: 1px solid var(--line); border-radius: 7px; background: white; }
.valuation-editor summary { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 15px 17px; cursor: pointer; list-style: none; }
.valuation-editor summary::-webkit-details-marker { display: none; }
.valuation-editor summary span:first-child { color: var(--navy-2); font-weight: var(--text-emphasis-weight); }
.valuation-editor summary span:last-child { color: var(--muted); font-size: 12px; }
.valuation-editor summary::after { margin-left: auto; color: var(--blue); content: ""; }
.valuation-editor[open] summary::after { content: ""; }
.valuation-editor__form { padding: 18px; border-top: 1px solid var(--line); background: var(--surface-2); }
.table-subline { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; font-weight: 600; }
.cost-amount-button { padding: 3px 0; border: 0; border-bottom: 1px solid transparent; background: transparent; color: var(--navy-2); font: inherit; font-variant-numeric: tabular-nums; cursor: pointer; }
.cost-amount-button:hover, .cost-amount-button:focus-visible { border-bottom-color: currentColor; color: var(--blue); }
.cost-amount-button::after { margin-left: 7px; color: var(--blue); font-size: 11px; content: ""; }
.cost-amount-button[aria-expanded="true"]::after { content: ""; }
.cost-month-detail > td { padding: 0; background: var(--surface-2); }
.cost-category-list { padding: 8px 18px 18px; }
.cost-category-drilldown { border-bottom: 1px solid var(--line); background: white; }
.cost-category-drilldown:first-child { border-top: 1px solid var(--line); }
.cost-category-drilldown summary { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 16px; cursor: pointer; list-style: none; }
.cost-category-drilldown summary::-webkit-details-marker { display: none; }
.cost-category-drilldown summary > span { display: grid; gap: 2px; }
.cost-category-drilldown summary > span:last-child { color: var(--navy-2); font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.cost-category-drilldown summary small { color: var(--muted); font-size: 11px; }
.cost-category-drilldown[open] summary { border-bottom: 1px solid var(--line); background: var(--blue-soft); }
.cost-transaction-table th { background: var(--surface-3); }
.cost-transaction-table td { font-size: var(--table-body-font-size); }
.heading-actions, .form-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.form-stack { display: grid; gap: var(--form-row-gap); }
.form-stack label { margin-top: 0; font-size: 13px; font-weight: 650; }

/* Einheitlicher Feldstandard für Anmeldung, Import und Datenpflege. */
:where(.form-stack, .form-field) input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]),
:where(.form-stack, .form-field, .dividend-schedule-row) select {
  width: 100%;
  height: var(--field-height);
  min-height: var(--field-height);
  margin: 0;
  padding: 0 var(--field-padding-x);
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background-color: white;
  color: var(--ink);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.25;
}
:where(.form-stack, .form-field) textarea {
  width: 100%;
  min-height: calc(var(--field-height) * 2.5);
  margin: 0;
  padding: 11px var(--field-padding-x);
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background-color: white;
  color: var(--ink);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.45;
  resize: vertical;
}
:where(.form-stack, .form-field, .dividend-schedule-row) select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 44px;
  background-image: var(--select-chevron-image);
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px 16px;
}
:where(.form-stack, .form-field) input[type="date"]::-webkit-calendar-picker-indicator {
  margin: 0;
  padding: 8px 0 8px 8px;
  cursor: pointer;
}
/* Native Datumsauswahl auch auf iPad/iPhone erhalten. */
input[type="date"] {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  inline-size: 100%;
  min-inline-size: 0;
  box-sizing: border-box;
  text-align: left;
}
input[type="date"] {
  color: var(--ink);
  -webkit-text-fill-color: var(--ink);
}
:root input[type="date"].date-field--empty,
:root input[type="date"].date-field--empty::-webkit-date-and-time-value {
  color: var(--muted);
  -webkit-text-fill-color: var(--muted);
}
:where(.form-stack, .form-field) input::placeholder,
:where(.form-stack, .form-field) textarea::placeholder {
  color: var(--muted);
  opacity: 1;
}
/* WebKit 301648: iOS date + padding can exceed width:100%.
   The shell owns all decoration; the real, focusable date control has no padding. */
.ios-date-shell {
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  height: var(--field-height);
  box-sizing: border-box;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: white;
}
.ios-date-display {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 var(--field-padding-x);
  color: var(--ink);
  font-size: 16px;
  font-weight: 400;
  pointer-events: none;
}
.ios-date-shell.date-field--empty .ios-date-display { color: var(--muted); }
.ios-date-shell:focus-within { outline: 2px solid var(--navy-2); outline-offset: 1px; }
:root .ios-date-shell input[type="date"] {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  /* Native iOS overlay invariants must win over generic dialog/disabled fields.
     Only the shell paints the field; the real date control remains interactive. */
  height: 100% !important;
  min-height: 0 !important;
  margin: 0;
  padding: 0 !important;
  border: 0 !important;
  opacity: 0 !important;
  cursor: pointer;
}
.ios-date-shell:has(> input:disabled) {
  background: var(--surface-3); border-color: var(--line); cursor: default;
}
.ios-date-shell:has(> input:disabled) > .ios-date-display {
  color: var(--field-disabled-color); -webkit-text-fill-color: var(--field-disabled-color);
}
input[type="number"] { -moz-appearance: textfield; }
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button { margin: 0; -webkit-appearance: none; }
:where(.form-stack, .form-field) input[type="file"]:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]) {
  overflow: hidden;
}
:where(.form-stack, .form-field) input[type="file"]::file-selector-button {
  margin: 0 11px 0 0;
  padding: 0 12px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface-3);
  color: var(--navy-2);
  font: inherit;
  font-size: 14px;
  font-weight: var(--text-emphasis-weight);
  cursor: pointer;
}
:where(.form-stack, .form-field) input[type="file"]::file-selector-button:hover { background: var(--blue-soft); }
:where(.form-stack, .form-field) :is(input, select, textarea):focus {
  outline: 3px solid rgba(49,95,135,.13);
  border-color: var(--blue);
}
:where(.form-stack, .form-field) :is(input, textarea)::placeholder { color: var(--muted); opacity: 1; }
:where(.form-stack, .form-field) :is(input, select, textarea):disabled {
  background-color: var(--surface-2);
  color: var(--muted);
  cursor: not-allowed;
}
.form-error { color: var(--danger); font-size: 13px; }
.form-error--block { margin-bottom: 18px; padding: 13px 15px; border-radius: 5px; background: var(--danger-bg); }
.asset-editor .form-error--block { font-size: 16px; line-height: 1.5; }
.asset-editor .errorlist { margin: 0; padding: 0; list-style: none; color: var(--danger); font-size: 16px; line-height: 1.5; }
.asset-editor .errorlist > li + li { margin-top: 8px; }

/* Integrierte Datenpflege */
.data-lead { max-width: 780px; margin: 13px 0 0; }
.data-section-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));  }
.data-section-card { min-height: 245px; display: flex; flex-direction: column;  border: 1px solid var(--line);  background: var(--surface); box-shadow: var(--shadow); }
.data-section-card__head span { display: block; margin-bottom: 8px; color: var(--blue); font-size: 11px; font-weight: 400; letter-spacing: .05em; text-transform: uppercase; }
.data-section-card p { margin: 15px 0 22px; color: var(--muted); font-size: 13px; line-height: 1.58; }
.data-section-card__actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; }
.data-integrity-note { display: grid; grid-template-columns: minmax(230px, .55fr) minmax(0, 1.45fr); align-items: center; gap: 35px; margin-top: 18px; }
.data-integrity-note p:last-child { margin: 0; color: var(--muted); }
.data-list-panel {  overflow: hidden; }
.data-list-row { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 82px; padding: 17px 22px; border-top: 1px solid var(--line); transition: background .16s ease; }
.data-list-row:first-child { border-top: 0; }
.data-list-row:hover { background: var(--surface-2); }
.data-list-row > span:first-child { min-width: 0; }
.data-list-row strong, .data-list-row small { display: block; }
.data-list-row strong { color: var(--navy-2); font-weight: 620; }
.data-list-row small { margin-top: 4px; color: var(--muted); font-size: 12px; }
.data-list-row__action { flex: 0 0 auto; color: var(--blue); font-size: 13px; font-weight: var(--text-emphasis-weight); }
.data-list-row__amount { flex: 0 0 auto; color: var(--navy-2); font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.data-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));  }
.data-card { min-width: 0; min-height: 76px; display: flex; align-items: stretch; justify-content: center; flex-direction: column;  border: 1px solid var(--line);  background: var(--surface); box-shadow: var(--shadow); color: var(--navy-2); font: inherit; text-align: left; cursor: pointer; transition: border-color .16s ease, background .16s ease, box-shadow .16s ease, transform .16s ease; }
.data-card:hover { border-color: #aebed0; background: var(--blue-soft); box-shadow: 0 10px 24px rgba(11,31,58,.11); transform: translateY(-2px); }
.data-card:focus-visible { outline: 3px solid rgba(35,94,153,.25); outline-offset: 2px; border-color: var(--blue); background: var(--blue-soft); }
.data-card__heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.data-card__heading strong { min-width: 0; overflow-wrap: anywhere; font-size: 16px; font-weight: var(--text-emphasis-weight); line-height: 1.3; }
.data-card__status { flex: 0 0 auto; }
.data-card__tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; padding-top: 4px; }
.data-card__meta { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 4px; }
.data-card small { display: block; min-width: 0; color: var(--muted); font-size: 12px; line-height: 1.4; }
.data-card__action { flex: 0 0 auto; color: var(--blue); font-size: 21px; line-height: .7; transition: transform .16s ease; }
.data-card:hover .data-card__action { transform: translateX(3px); }
.data-card-empty { grid-column: 1 / -1; }
.data-editor-dialog { width: min(820px, calc(100vw - 36px)); }
.table-tools { margin: 0; padding: 14px 16px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; box-shadow: none; background: var(--surface-2); }
.table-tools--collapsible { padding: 0; }
.table-tools-summary { display: flex; align-items: center; justify-content: space-between; min-height: 48px; padding: 0 16px; cursor: pointer; list-style: none; color: var(--blue); font-size: 13px; font-weight: var(--text-emphasis-weight); }
.table-tools-summary::-webkit-details-marker { display: none; }
.table-tools-summary::after { content: ""; }
.table-tools--collapsible[open] .table-tools-summary { border-bottom: 1px solid var(--line); }
.table-tools--collapsible[open] .table-tools-summary::after { content: ""; }
.table-tools-summary-label--open { display: none; }
.table-tools--collapsible[open] .table-tools-summary-label--closed { display: none; }
.table-tools--collapsible[open] .table-tools-summary-label--open { display: inline; }
.table-tools-form { padding: 14px 16px; }
.table-tools input[aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 2px color-mix(in srgb, var(--danger) 10%, transparent); }
.table-tools[hidden] { display: none; }
.table-sort-button { display: inline-flex; align-items: center; gap: 4px; width: 100%; padding: 0; border: 0; background: none; color: inherit; font: inherit; font-weight: inherit; letter-spacing: inherit; text-align: inherit; text-transform: inherit; }
.numeric .table-sort-button { justify-content: flex-end; }
.table-sort-indicator { min-width: 10px; color: var(--blue); font-size: 12px; }
.table-sort-indicator:empty { display: none; }
.table-sort-indicator svg { display: block; width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.table-filter-empty { padding: 26px 18px; color: var(--muted); text-align: center; }
.transaction-table-panel { max-width: 100%; contain: inline-size; }
.transaction-table-panel .table-scroll { max-width: 100%; overflow-x: clip; overscroll-behavior-inline: contain; }
.transaction-source-legend { display: flex; justify-content: flex-end; gap: 16px; padding: 8px 13px; border-bottom: 1px solid var(--line); background: var(--surface-2); color: var(--muted); font-size: 11px; }
.transaction-source-legend > span { display: inline-flex; align-items: center; gap: 7px; }
.transaction-review-table { min-width: 0; table-layout: fixed; }
.transaction-review-table th a { display: inline-flex; align-items: center; gap: 5px; }
.transaction-review-table th a:hover { color: var(--navy-2); }
.transaction-review-table th, .transaction-review-table td { padding: 9px 12px; }
.transaction-review-table th:nth-child(1) { width: 9%; }
.transaction-review-table th:nth-child(2) { width: 10%; }
.transaction-review-table th:nth-child(3) { width: 19%; }
.transaction-review-table th:nth-child(4) { width: 11%; }
.transaction-review-table th:nth-child(5) { width: 5%; }
.transaction-review-table th:nth-child(6) { width: 20%; }
.transaction-review-table th:nth-child(7) { width: 6%; }
.transaction-review-table th:nth-child(8) { width: 10%; }
.transaction-review-table th:nth-child(9) { width: 10%; }
.transaction-review-table :is(th, td):first-child { padding-left: 16px; }
.transaction-review-table :is(th, td):last-child { padding-right: 17px; }
.transaction-review-table td { height: 54px; line-height: 1.3; }
.transaction-review-table td > strong { color: var(--navy-2); font-weight: var(--text-emphasis-weight); }
.transaction-description-cell { min-width: 0; }
.transaction-description-cell strong { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.transaction-details-heading, .transaction-details-cell, .transaction-source-heading, .transaction-source-cell { text-align: center; }
.transaction-action-heading { text-align: right; }
.transaction-action-label { display: inline-block; width: min(80px, 100%); text-align: left; }
.transaction-action-cell { text-align: right; }
.transaction-action-cell .table-action-button {    text-align: center; }
.transaction-source-badge { display: inline-grid; width: 26px; height: 26px; place-items: center; padding: 0; border: 1px solid transparent; border-radius: 50%; font: inherit; font-size: 11px; font-weight: 600; line-height: 1; box-shadow: inset 0 1px 0 rgba(255,255,255,.7); }
.transaction-payment-info.metric-info { position: relative; top: auto; right: auto; vertical-align: middle; }
.transaction-payment-info.metric-info .form-help__content.is-viewport-positioned { position: fixed; top: var(--tooltip-top); left: var(--tooltip-left); right: auto; z-index: 50; }
.transaction-payment-info:has(.form-help__trigger[aria-expanded="true"]), .transaction-payment-info:hover, .transaction-payment-info:focus-within { z-index: 60; }
.transaction-payment-details { display: grid; grid-template-columns: minmax(0, 1fr); gap: 9px; margin: 0; }
.transaction-payment-details div { min-width: 0; }
.transaction-payment-details dt { margin-bottom: 2px; color: var(--muted); font-size: 10px; font-weight: 400; letter-spacing: .035em; text-transform: uppercase; }
.transaction-payment-details dd { margin: 0; overflow-wrap: anywhere; color: var(--ink); font: inherit; }
.transaction-payment-details__wide { grid-column: 1 / -1; }
.transaction-allocation-details { margin-top: 3px; padding-top: 10px; border-top: 1px solid var(--line); }
.transaction-allocation-details dd { display: grid; gap: 5px; }
.transaction-allocation-details dd > span { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; }
.transaction-allocation-details dd strong { color: var(--navy-2); font-weight: var(--text-emphasis-weight); }
.transaction-allocation-details dd span span { flex: 0 0 auto; font-variant-numeric: tabular-nums; }
.transaction-source-empty { color: var(--muted); }
.transaction-category-form { min-width: 170px; }
.transaction-category-form select {
  width: 100%;
  height: 32px;
  padding: 0 38px 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  appearance: none;
  background: white var(--select-chevron-image) no-repeat right 11px center / 16px;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
}
.transaction-category-form select:focus { outline: 3px solid rgba(49,95,135,.13); border-color: var(--blue); }
.transaction-category-form--multiple select:disabled { border-color: var(--line); background-color: var(--surface-2); color: var(--navy-2); font-weight: 400; opacity: 1; cursor: default; }
.classification-suggestion { margin-top: 8px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--blue-soft); }
.classification-suggestion > div:first-child { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.classification-suggestion strong { color: var(--navy-2); font-size: 13px; }
.classification-suggestion small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.35; }
.confidence-badge { flex: 0 0 auto; }
.suggestion-actions { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 16px 0; }
.pagination > span { color: var(--muted); font-size: 13px; }
.pagination > div { display: flex; gap: 8px; }
.income-source-table { min-width: 980px; }
.income-source-table th:first-child { width: 25%; }
.income-source-table th:last-child { width: 1%; }
.income-source-table .income-dividend-estimate { display: block; margin-top: 3px; font-size: 11px; line-height: 1.35; }
.income-source-table td strong { color: var(--navy-2); font-weight: 650; }
.editor-panel { max-width: 1050px; }
.form-automation-note { margin: 0 0 22px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 6px; background: var(--blue-soft); color: var(--navy-3); font-size: 13px; line-height: 1.5; }
.data-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 18px; }
.form-field { min-width: 0; display: flex; flex-direction: column; gap: var(--form-label-gap); }
.form-field > label { color: var(--navy-2); font-size: 13px; font-weight: var(--text-emphasis-weight); }
.form-field--checkbox { justify-content: flex-end; min-height: var(--field-height); padding-bottom: 10px; }
.account-editor .form-field--checkbox { justify-content: center; padding-bottom: 0; }
.forecast-form-section { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line); }
.forecast-form-section:first-of-type { margin-top: 0; padding-top: 0; border-top: 0; }
.forecast-form-section h3 { margin: 0 0 7px; color: var(--navy-2); font-size: 17px; }
.forecast-form-section > p, .forecast-section-heading p { margin: 0 0 18px; }
.forecast-section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.payroll-summary { display: flex; flex: 0 0 auto; gap: 22px; margin: 0; }
.payroll-summary div { display: grid; gap: 3px; text-align: right; }
.payroll-summary dt { color: var(--muted); font-size: 11px; }
.payroll-summary dd { margin: 0; color: var(--navy-2); font-weight: var(--text-strong-weight); }
.payroll-rule-grid { margin-bottom: 18px; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; }
.payroll-rule-row { display: grid; grid-template-columns: minmax(230px, 1.5fr) minmax(150px, .55fr) minmax(220px, .8fr); gap: 18px; align-items: center; min-height: 78px; padding: 12px 16px; border-top: 1px solid var(--line); background: var(--surface); }
.payroll-rule-row:first-child { border-top: 0; }
.payroll-rule-row > div:first-child { display: grid; gap: 4px; }
.payroll-rule-row > div:first-child strong { color: var(--navy-2); }
.payroll-rule-row > div:first-child span { color: var(--muted); font-size: 12px; }
.compact-number-field { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.compact-number-field input { width: 100%; min-width: 90px; height: var(--field-height); padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 5px; background: white; color: var(--ink); font: inherit; font-size: 15px; }
.compact-number-field input:focus { outline: 3px solid rgba(74,110,153,.14); border-color: var(--blue); }
.compact-number-field--money { justify-self: stretch; }
.payroll-calculation-table { margin-top: 18px; }
.payroll-calculation-table table { min-width: 680px; }
.payroll-calculation-table td:first-child small { display: block; margin-top: 3px; color: var(--muted); }
.dividend-installment-preview { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0 0 20px; }
.dividend-installment-preview > div { display: grid; gap: 5px; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--blue-soft); }
.dividend-installment-preview span { color: var(--muted); font-size: 12px; }
.forecast-warnings { margin: 0 0 18px; color: var(--warning); }
.checkbox-label { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.checkbox-label input { width: 20px; height: 20px; accent-color: var(--navy-3); }
.help-text { color: var(--muted); font-size: 11px; line-height: 1.45; }
.category-data-form .data-form-grid { align-items: stretch; }
.category-data-form .form-field--checkbox { position: relative; min-height: 62px; justify-content: center; padding: 13px 14px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-2); }
.category-data-form .form-field--checkbox:last-child { min-height: 54px; grid-column: 1 / -1; }
.checkbox-field-heading { display: flex; align-items: center; gap: 8px; }
.checkbox-field-heading .checkbox-label { min-width: 0; color: var(--navy-2); font-size: 13px; font-weight: 650; line-height: 1.35; }
.form-help { display: inline-flex; flex: 0 0 auto; }
.form-help__trigger { display: inline-grid; width: 21px; height: 21px; padding: 0; place-items: center; border: 1.5px solid #688078; border-radius: 50%; background: transparent; color: #58726a; font: inherit; font-size: 13px; font-weight: 700; line-height: 1; cursor: pointer; }
.form-help__trigger:hover, .form-help__trigger:focus-visible, .form-help__trigger[aria-expanded="true"] { border-color: var(--blue); background: var(--blue-soft); color: var(--blue); outline: 0; }
.form-help__content { position: absolute; z-index: 30; top: calc(100% + 8px); right: 0; left: 0; display: none; padding: 13px 14px; border: 1px solid var(--line-strong); border-radius: 8px; background: white; box-shadow: 0 12px 30px rgba(11,31,58,.18);     }
.form-help__content::before { position: absolute; top: -6px; left: 22px; width: 10px; height: 10px; border-top: 1px solid var(--line-strong); border-left: 1px solid var(--line-strong); background: white; content: ""; transform: rotate(45deg); }
.form-help:hover .form-help__content, .form-help:focus-within .form-help__content, .form-help__trigger[aria-expanded="true"] + .form-help__content { display: block; }
.form-help__content.is-viewport-positioned { position: fixed; right: auto; bottom: auto; left: var(--tooltip-left); top: var(--tooltip-top); width: min(340px, calc(100vw - 24px)); max-width: calc(100vw - 24px); max-height: calc(100dvh - 24px); box-sizing: border-box; overflow-x: hidden; overflow-y: auto; overflow-wrap: anywhere; white-space: normal; }
.form-help__content.is-viewport-positioned::before { right: auto; left: var(--tooltip-arrow-left); }
.form-actions { margin-top: 27px; padding-top: 21px; border-top: 1px solid var(--line); }
.calculated-values { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line); }
.transaction-source-details { margin: 0 0 24px; }
.calculated-values h2 { margin-bottom: 16px; font-size: 20px; }
.calculated-values .share-fact-grid { border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.messages { display: grid; gap: 8px; margin-bottom: 18px; }
.message { padding: 13px 16px; border-radius: 6px; background: var(--blue-soft); color: var(--navy-3); }
.message.error { background: var(--danger-bg); color: var(--danger); }
.message.warning { background: var(--warning-bg); color: var(--warning); }
.import-alert-panel { margin-bottom: 20px; border-color: color-mix(in srgb, var(--warning) 35%, var(--line)); }
.import-alert-actions { align-items: flex-start; }
.import-alert-actions .table-action { margin-top: 5px; }
.import-alert-summary { align-items: center; margin-bottom: 0; }
.import-alert-summary .primary-button { color: white; }
.import-resolution-step { padding: 22px 0; border-top: 1px solid var(--line); }
.import-resolution-step:last-child { padding-bottom: 0; }
.import-resolution-step__heading { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 14px; }
.import-resolution-step__heading h3 { margin: 1px 0 5px; color: var(--navy-2); font-size: 17px; }
.import-resolution-step__heading p { max-width: 980px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.import-step-number { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 50%; background: var(--navy-3); color: white; font-size: 13px; font-weight: var(--text-strong-weight); }
.import-resolution-step--waiting { opacity: .82; }
.import-resolution-step--diagnostic .import-resolution-step__heading { grid-template-columns: 1fr; }
.import-requirements { margin: 16px 0 0 44px; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; background: white; }
.import-requirements article { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; padding: 13px 15px; border-top: 1px solid var(--line); }
.import-requirements article:first-child { border-top: 0; }
.import-requirements article > div:last-child { text-align: right; }
.import-requirements strong, .import-requirements span { display: block; }
.import-requirements span { margin-top: 3px; color: var(--muted); font-size: 12px; }
.import-delivery-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; margin: 16px 0 0 44px; }
.import-delivery-actions code { padding: 10px 12px; border-radius: 5px; background: var(--surface-2); color: var(--muted); font-size: 12px; }
.import-resolution-list { display: grid; gap: 12px; margin: 16px 0 0 44px; }
.import-resolution-list > article { padding: 16px; border: 1px solid var(--line); border-radius: 7px; background: white; }
.import-resolution-list--balances { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.import-balance-card__heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.import-balance-card__heading span { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }
.import-reconciliation { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 22px; margin: 16px 0 0; }
.import-reconciliation > div { display: flex; justify-content: space-between; gap: 14px; padding: 8px 0; border-top: 1px solid var(--line); }
.import-reconciliation dt { color: var(--muted); font-size: 12px; }
.import-reconciliation dd { margin: 0; color: var(--navy-2); font-size: 12px; font-weight: 700; text-align: right; white-space: nowrap; }
.import-reconciliation__difference { grid-column: 1 / -1; }
.import-resolution-hint { margin: 13px 0 0;    }
.import-balance-card__actions { margin-top: 14px; }
.import-overview-grid { margin-top: 20px; }
.form-hint { margin: 16px 0 0;    }

/* Einkommen, Liquidität und Steuern */
.forecast-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.forecast-waterfall { overflow-x: auto; }
.forecast-balance { overflow: visible; }
.forecast-waterfall svg { min-width: 980px; }
.forecast-balance svg { min-width: 720px; }
.income-waterfall-section .waterfall-bar--positive { fill: var(--flow-in); }
.income-waterfall-section .waterfall-bar--negative { fill: var(--flow-out); }
.income-waterfall-section .waterfall-bar--total { fill: var(--positive-strong); }
.income-waterfall-section .waterfall-connector { stroke: #7f9188; }
.income-waterfall-section .forecast-waterfall svg { min-width: 900px; }
.waterfall-legend i { width: 12px; height: 12px; border-radius: 3px; }
.waterfall-legend .legend-inflow { background: var(--flow-in); }
.waterfall-legend .legend-deduction { background: var(--danger-chart); }
.waterfall-legend .legend-result { background: var(--positive-strong); }
.forecast-detail-grid { margin-bottom: 18px; }
.forecast-breakdown { margin: 0; }
.forecast-breakdown > div { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; padding: 13px 0; border-top: 1px solid var(--line); }
.forecast-breakdown > div:first-child { border-top: 0; }
.forecast-breakdown dt { color: var(--muted); font-size: 13px; }
.forecast-breakdown dd { margin: 0; color: var(--navy-2); font-weight: 700; }
.forecast-settings { margin-top: 18px; }
.liquidity-account-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 14px 0 18px; }
.liquidity-account-grid .account-card { display: grid; grid-template-columns: minmax(0, 1fr) 32px; min-width: 0; gap: 3px 8px;  }
.liquidity-account-grid .account-card > :is(header, h2) { grid-column: 1 / -1; }
.liquidity-account-grid .account-card__header { display: flex; align-items: center; gap: 6px; min-width: 0; }
.liquidity-account-grid .account-card__header > span { flex: 1 1 auto; min-width: 0; overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.liquidity-account-grid .account-card h2 { margin: 0; font-size: 18px; font-weight: var(--text-emphasis-weight); line-height: 1.2; }
.liquidity-account-grid .account-card strong { margin: 5px 0 2px; font-size: 21px; line-height: 1.15; }
.liquidity-account-grid .account-card .account-liquidity-status { flex: 0 0 auto; margin: 0 0 0 auto; white-space: nowrap; }
.liquidity-account-grid .account-card .table-action-button {   margin-top: 5px;  }
.account-liquidity-status { margin-top: 3px; }
.liquidity-warning { margin: 0 0 18px; }
.liquidity-warning p { margin: 7px 0 0; color: var(--warning); }
.cost-analysis-grid { align-items: start; margin-bottom: 18px; }
.cost-category-panel { margin-bottom: 24px; }
.cost-category-panel .panel-heading { margin-bottom: 16px; }
.cost-composition-heading-tools { display: flex; align-items: center; justify-content: flex-end; gap: 12px; flex-wrap: wrap; }
.cost-composition-legend { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 11px; }
.cost-composition-legend span { display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.cost-legend-swatch { width: 18px; height: 6px; display: inline-block; flex: 0 0 auto; border-radius: 999px; background: linear-gradient(90deg, var(--navy-3), var(--blue)); }
.cost-legend-swatch--special { background: var(--flow-out); }
.summary-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0 0 16px; border: 1px solid var(--line);  background: var(--surface-2); }
.summary-facts > div { min-width: 0; padding: 10px 13px; border-left: 1px solid var(--line); }
.summary-facts > div:first-child { border-left: 0; }
.summary-facts dt { color: var(--muted); font-size: 10px; font-weight: 400; letter-spacing: .035em; text-transform: uppercase; }
.summary-facts dd { margin: 4px 0 0; color: var(--navy-2); font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.cost-category-chart + .cost-category-chart { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--line); }
.cost-chart-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 13px; color: var(--muted); font-size: 12px; }
.cost-chart-heading strong { color: var(--navy-3); font-size: 13px; letter-spacing: .06em; }
.cost-chart-rows { display: grid; grid-template-columns: minmax(180px, 1.05fr) minmax(220px, 3fr) max-content max-content max-content; gap: 3px 24px; }
.cost-chart-row { min-height: 36px; display: grid; grid-column: 1 / -1; grid-template-columns: subgrid; align-items: center; column-gap: 24px; }
.cost-chart-row[id] { scroll-margin-block: 110px; }
.cost-chart-label { min-width: 0; overflow: hidden; color: var(--ink); font-size: 13px; font-weight: var(--text-emphasis-weight); line-height: 1.2; }
.cost-chart-label a { color: inherit; text-decoration-color: color-mix(in srgb, var(--blue) 45%, transparent); text-underline-offset: 3px; }
.cost-chart-label a:hover, .cost-chart-label a:focus-visible { color: var(--blue); }
.cost-chart-track { height: 10px; overflow: hidden; border-radius: 999px; background: var(--surface-3); }
.cost-chart-track i { display: block; min-width: 2px; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--navy-3), var(--blue)); }
.cost-chart-row.is-special-expense .cost-chart-track i { background: var(--flow-out); }
.cost-chart-value { display: contents; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cost-chart-value strong { grid-column: 3; color: var(--navy-2); font-size: 13px; font-weight: 600; text-align: right; }
.cost-chart-value > span { grid-column: 4; color: var(--muted); font-size: 11px; text-align: right; }
.cost-chart-value small { grid-column: 5; color: var(--muted); font-size: 11px; text-align: right; }
.cost-chart-more-summary { grid-column: 1 / -1; width: 100%; min-height: 34px; display: flex; align-items: center; gap: 10px; padding: 0; border: 0; border-top: 1px solid var(--line); background: transparent; color: var(--muted); font-size: 11px; font-weight: 400; letter-spacing: .065em; text-align: left; text-transform: uppercase; }
.cost-chart-more-summary::after { width: 7px; height: 7px; margin: -4px 4px 0 auto; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; content: ""; transform: rotate(45deg); transition: transform .16s ease; }
.cost-chart-more-summary[aria-expanded="true"]::after { margin-top: 4px; transform: rotate(225deg); }
.cost-chart-more-summary > strong { color: inherit; font-size: 11px; font-weight: 400; }
.cost-chart-additional { display: contents; }
.cost-chart-additional[hidden] { display: none; }
.cost-savings-table { min-width: 820px; }
.savings-history-panel { margin-top: 18px; }
.savings-rate-cell { min-width: 210px; display: flex; align-items: center; gap: 12px; }
.savings-rate-track { flex: 1 1 auto; height: 8px; overflow: hidden; border-radius: 999px; background: var(--surface-3); }
.savings-rate-track i { display: block; height: 100%; border-radius: inherit; background: var(--positive); }
.savings-rate-cell strong { flex: 0 0 58px; text-align: right; }
/* Ausgaben und Sparen keeps its original non-green palette.
   All green values and soft savings fills inherit the income-based app standard. */
.cost-monthly-panel {
  --danger: #a4423d;
  --danger-bg: #f8e9e7;
  --flow-out: #cf896f;
  margin-bottom: 24px;
}
.cost-monthly-panel .panel-heading {  margin-bottom: 14px; }
.cost-monthly-panel-heading { justify-content: space-between; }
.cost-stack-swatch { --cost-stack-color: #17365f; width: 9px; height: 9px; display: inline-block; flex: 0 0 auto; border-radius: 2px; background: var(--cost-stack-color); }
.cost-stack-color-0 { --cost-stack-color: #a77558; fill: var(--cost-stack-color); background: var(--cost-stack-color); }
.cost-stack-color-1 { --cost-stack-color: #e0c2a8; fill: var(--cost-stack-color); background: var(--cost-stack-color); }
.cost-stack-color-2 { --cost-stack-color: #c39777; fill: var(--cost-stack-color); background: var(--cost-stack-color); }
.cost-stack-color-3 { --cost-stack-color: #cfa687; fill: var(--cost-stack-color); background: var(--cost-stack-color); }
.cost-stack-color-4 { --cost-stack-color: #d8b597; fill: var(--cost-stack-color); background: var(--cost-stack-color); }
.cost-stack-color-5 { --cost-stack-color: #e0c2a8; fill: var(--cost-stack-color); background: var(--cost-stack-color); }
.cost-stack-color-6 { --cost-stack-color: #e7cfb9; fill: var(--cost-stack-color); background: var(--cost-stack-color); }
.cost-stack-color-7 { --cost-stack-color: #eedbc9; fill: var(--cost-stack-color); background: var(--cost-stack-color); }
.cost-stack-color-8 { --cost-stack-color: #f2e4d6; fill: var(--cost-stack-color); background: var(--cost-stack-color); }
.cost-stack-color-9 { --cost-stack-color: #f7eee5; fill: var(--cost-stack-color); background: var(--cost-stack-color); }
.cost-stack-color-10 { --cost-stack-color: #d9c3ae; fill: var(--cost-stack-color); background: var(--cost-stack-color); }
.cost-stack-swatch--savings, .cost-stack-savings-segment { fill: var(--positive-soft); background: var(--positive-soft); }
.cost-stack-line-swatch { width: 13px; height: 3px; display: inline-block; flex: 0 0 auto; border-radius: 1px; background: var(--ink); box-shadow: 0 0 0 1px white; }
.cost-stack-chart-shell { position: relative; }
.cost-stack-chart { width: 100%; min-height: 430px; }
.cost-stack-chart > svg { width: 100%; height: auto; display: block; overflow: visible; }
.cost-stack-grid { stroke: var(--line); stroke-width: 1; }
.cost-stack-grid--zero { stroke: var(--muted); stroke-opacity: .65; stroke-width: 1.25; }
.cost-stack-axis { fill: var(--muted); font-size: var(--chart-axis-font-size); font-weight: var(--chart-axis-font-weight); }
.cost-stack-segment { stroke: white; stroke-width: 1; cursor: var(--chart-hover-cursor); transition: filter .12s ease, opacity .12s ease; }
.cost-stack-segment:hover, .cost-stack-segment:focus-visible, .cost-stack-segment.is-selected { filter: brightness(.94) saturate(1.12); outline: none; }
.cost-stack-highlight { opacity: 0; pointer-events: none; transition: opacity .12s ease; }
.cost-stack-highlight.is-visible { opacity: 1; }
.cost-stack-highlight rect { fill: none; vector-effect: non-scaling-stroke; }
.cost-stack-highlight__halo { stroke: rgba(255,255,255,.96); stroke-width: 6; }
.cost-stack-highlight__outline { stroke: var(--flow-out); stroke-width: 3; }
.cost-stack-income-marker-bg { stroke: white; stroke-width: 6; pointer-events: none; }
.cost-stack-income-marker { stroke: var(--ink); stroke-width: 3; pointer-events: none; }
.cost-stack-month-grid { display: grid; grid-template-columns: repeat(var(--cost-month-count), minmax(0, 1fr)); }
.cost-stack-month-summary { min-width: 0; display: grid; justify-items: center; align-content: start; padding: 13px 3px 0; text-align: center; }
.cost-stack-month-summary > span { color: var(--muted); font-size: 15px; }
.cost-stack-month-summary > strong { max-width: 100%; margin-top: 7px; overflow: hidden; color: var(--positive); font-size: 17px; font-variant-numeric: tabular-nums; text-overflow: ellipsis; white-space: nowrap; }
.cost-stack-month-summary > b { margin-top: 7px; font-variant-numeric: tabular-nums; }
.cost-stack-month-summary, .investment-annual-return {
  --badge-font-size: 13px;
  --badge-font-weight: 500;
  --badge-line-height: 1.35;
  --badge-padding: 4px 9px;
}
.cost-stack-savings-negative { fill: var(--danger-soft); background: var(--danger-soft); }
.cost-stack-month-summary.is-negative > strong { color: var(--danger); }
.cost-stack-month-summary.is-current > strong { color: var(--muted); }
.cost-stack-more-button { min-height: 40px; margin-top: 11px; padding: 7px 11px; border: 1px solid var(--line-strong); border-radius: 5px; background: white; color: var(--navy-2); font-size: 14px; font-weight: 450; line-height: 1.15; cursor: pointer; }
.cost-stack-more-button:hover, .cost-stack-more-button:focus-visible { border-color: var(--blue); color: var(--blue); }
.cost-stack-more-button:disabled { cursor: default; opacity: .45; }
.cost-stack-tooltip { position: absolute; z-index: 4; width: 380px; max-width: calc(100vw - 32px); box-sizing: border-box; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; background: rgba(255,255,255,.98); box-shadow: 0 9px 28px rgba(11,31,58,.16);   pointer-events: none; }
.cost-stack-tooltip-header { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; margin-bottom: 7px; }
.cost-stack-tooltip-header > small {   white-space: nowrap; }
.cost-stack-tooltip-header > span {    letter-spacing: .06em; }
.cost-stack-tooltip > span { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; align-items: center; gap: 7px; line-height: 1.7; }
.cost-stack-tooltip > span.is-active { margin-inline: -5px; padding-inline: 5px; border-radius: 3px; background: var(--blue-soft); color: var(--navy-2); font-weight: 700; }
.cost-stack-tooltip em { overflow: hidden; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }
.cost-stack-tooltip b {  font-variant-numeric: tabular-nums; white-space: nowrap; }
.cost-stack-details:empty { display: none; }
.cost-stack-detail { margin: 20px -24px -24px; border-top: 1px solid var(--line); background: var(--surface-2); }
.cost-stack-detail-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 16px 24px; }
.cost-stack-detail-heading > div { display: grid; gap: 3px; }
.cost-stack-detail-heading strong { color: var(--navy-2); font-size: 14px; }
.cost-stack-detail-heading span { color: var(--muted); font-size: 13px; }
.cost-stack-detail .table-scroll { border-top: 1px solid var(--line); background: white; }
.cost-savings-formula { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; border-top: 1px solid var(--line); background: white; }
.cost-savings-formula div { padding: 16px 24px; }
.cost-savings-formula div + div { border-left: 1px solid var(--line); }
.cost-savings-formula dt { color: var(--muted); font-size: 11px; }
.cost-savings-formula dd { margin: 5px 0 0; color: var(--navy-2); font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.cost-savings-formula dd.negative { color: var(--danger); }
.cost-stack-mobile-list { display: grid; }
.cost-stack-mobile-month { padding: 13px 0; border-top: 1px solid var(--line); }
.cost-stack-mobile-month:first-child { border-top: 0; }
.cost-stack-mobile-month .cost-stack-month-summary { grid-template-columns: minmax(70px, 1fr) auto auto auto; align-items: center; justify-items: start; gap: 8px 12px; padding: 0; border-top: 0; text-align: left; }
.cost-stack-mobile-month .cost-stack-month-summary > span { font-size: 14px; font-weight: 700; }
.cost-stack-mobile-month .cost-stack-month-summary > :is(strong, b) { margin-top: 0; font-size: 14px; }
.cost-stack-mobile-month .cost-stack-more-button { min-height: 42px; margin-top: 0; padding-inline: 10px; }
.cost-stack-mobile-scale { margin-top: 9px; background: var(--surface-3); }
.cost-stack-mobile-bar { min-width: 2px; height: 18px; display: flex; position: relative; }
.cost-stack-mobile-segment { min-width: 3px; height: 18px; padding: 0; border: 0; border-right: 1px solid white; cursor: var(--chart-hover-cursor); }
.cost-stack-mobile-segment:last-child { border-right: 0; }
.cost-stack-mobile-segment:focus-visible, .cost-stack-mobile-segment.is-selected { z-index: 1; outline: 3px solid var(--flow-out); outline-offset: 2px; }
.cost-stack-mobile-income-marker { position: absolute; top: -4px; bottom: -4px; width: 3px; margin-left: -2px; background: var(--ink); box-shadow: 0 0 0 1px white; pointer-events: none; }
.metric-card a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.year-picker { min-width: 145px; display: grid; gap: 6px; }
.year-picker label { color: var(--muted); font-size: 11px; font-weight: 650; }
.year-picker select { height: 42px; padding: 0 38px 0 12px; border: 1px solid var(--line-strong); border-radius: 5px; background: white; color: var(--navy-2); font-weight: 650; }
.tax-status { margin-bottom: 18px; }
.tax-year-overview, .tax-proposal { margin-bottom: 18px; }
.tax-page-heading { align-items: center; }
.tax-review-button { display: inline-flex; align-items: center; gap: 9px; flex: 0 0 auto; }
.tax-year-overview td small { display: block; margin-top: 4px; color: var(--muted); }
.tax-year-overview tr.is-selected td { background: var(--surface-2); }
.tax-proposal { margin-top: 20px; padding: 20px; border: 1px solid var(--line); border-radius: 8px; background: white; }
.tax-proposal > .panel-heading {  margin-bottom: 0; }
.tax-proposal form { margin-top: 18px; }
.tax-current-forecast { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 18px; }
.tax-current-forecast div { padding: 16px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-2); }
.tax-current-forecast span { display: block; margin-bottom: 5px; color: var(--muted); font-size: 12px; }
.tax-current-forecast strong { font-size: 21px; }
.tax-unallocated-row td { background: #fff9ec; }
.tax-unallocated-row small { display: block; margin-top: 3px; color: var(--warning); }
.tax-unallocated-payment-warning { margin: 0 0 18px; }
.tax-year-editor { width: min(1120px, calc(100vw - 36px)); }
.tax-payment-editor { width: min(1280px, calc(100vw - 36px)); }
.tax-year-editor__panel { padding-top: 0; }
.tax-dialog-tabs { margin: 0 -28px 26px; padding-inline: 28px; overflow-x: auto; scrollbar-width: thin; }
.tax-dialog-tabs button { flex: 0 0 auto; white-space: nowrap; }
.asset-editor__tabs .tab-count, [data-dialog-tab-panel][hidden] { display: none; }
.tax-dialog-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); }
.tax-dialog-summary div { padding: 15px 17px; }
.tax-dialog-summary div + div { border-left: 1px solid var(--line); }
.tax-dialog-summary dt { margin-bottom: 5px; color: var(--muted); font-size: 11px; font-weight: 400; text-transform: uppercase; }
.tax-dialog-summary dd { margin: 0; color: var(--navy-2); font-size: 18px; font-weight: var(--text-strong-weight); font-variant-numeric: tabular-nums; }
.tax-section-heading { display: flex; justify-content: space-between; gap: 18px; margin-bottom: 15px; }
.tax-section-heading h3, .tax-proposal h3 { margin: 0 0 4px; }
.tax-section-heading p, .tax-proposal p { margin: 0;    }
.tax-component-edit-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 18px; }
.tax-component-edit { padding: 20px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); }
.tax-component-edit h4 { margin: 0 0 18px; color: var(--navy-2); font-size: 16px; }
.tax-component-fields { display: grid; gap: 16px; }
.tax-component-edit .form-field { min-width: 0; }
.tax-estv-note { margin: 18px 0 0; }
.tax-dialog-actions { gap: 10px; }
.tax-dialog-payments { margin-top: 20px; }
.tax-dialog-payments :is(input, select) { width: 100%; min-width: 130px; height: 39px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 4px; background: white; color: var(--ink); }
.tax-dialog-payments td:first-child input { min-width: 145px; }
.tax-dialog-payments td:first-child small { display: block; max-width: 260px; margin-top: 5px; }
.tax-review-payments table { min-width: 1050px; }
.tax-payment-identifiers { display: flex; flex-wrap: wrap; gap: 6px 12px; margin: -4px 0 14px; color: var(--muted); font-size: 11px; }
.tax-payment-source { min-width: 280px; vertical-align: top; }
.tax-payment-details { margin-top: 7px; }
.tax-payment-details summary { width: max-content; cursor: pointer; color: var(--blue); font-size: 12px; font-weight: 700; text-underline-offset: 3px; }
.tax-payment-details summary:hover { text-decoration: underline; }
.tax-payment-details dl { width: min(520px, 70vw); margin: 9px 0 0; padding: 11px 12px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px 16px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2); }
.tax-payment-details dl div { min-width: 0; }
.tax-payment-details dt { margin-bottom: 2px; color: var(--muted); font-size: 10px; font-weight: 400; text-transform: uppercase; }
.tax-payment-details dd { margin: 0; overflow-wrap: anywhere; color: var(--navy-2); font-size: 12px; line-height: 1.4; }
.tax-payment-details__wide { grid-column: 1 / -1; }
.tax-year-overview__intro { max-width: none; white-space: nowrap; }
.tax-status-track { height: 16px; display: flex; overflow: hidden; border-radius: 999px; background: var(--surface-3); }
.tax-status-track span { display: block; min-width: 0; }
.tax-status-paid { width: min(100%, calc(var(--value) / var(--total) * 100%)); background: #315f87; }
.tax-status-reserved { width: min(100%, calc(var(--value) / var(--total) * 100%)); background: #8fb8d8; }
.tax-status .chart-legend { margin-top: 13px; }
.chart-legend .legend-tax-paid { height: 8px; background: #315f87; }
.chart-legend .legend-tax-reserved { height: 8px; background: #8fb8d8; }
.chart-legend .legend-tax-open { height: 8px; background: var(--surface-3); border: 1px solid var(--line-strong); }
.tax-grid { align-items: start; margin-bottom: 18px; }
.tax-payments :is(input, select) { width: 100%; min-width: 130px; height: 39px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 4px; background: white; color: var(--ink); }
.tax-payments td:first-child input { min-width: 145px; }
.tax-payments td:first-child small { max-width: 260px; display: block; margin-top: 5px; }
.tax-limit-note { margin-top: 18px; }

/* Anmeldung */
.login-page { background: var(--navy); }
.login-shell { min-height: 100vh; padding: 0; }
.login-card { min-height: 100vh; display: grid; grid-template-columns: 1.1fr .9fr; align-items: center; background: var(--surface); }
.login-card > div { align-self: stretch; display: flex; flex-direction: column; justify-content: center; padding: clamp(40px, 7vw, 112px); color: white; background: radial-gradient(circle at 24% 20%, rgba(74,110,153,.55), transparent 43%), linear-gradient(155deg, #17365f, #0b1f3a 62%, #081629); }
.login-card > .login-hero { align-items: center; gap: 38px; text-align: center; }
.login-brand { display: flex; align-items: center; justify-content: center; gap: clamp(22px, 2.3vw, 36px); color: white; }
.login-brand-mark { display: grid; width: clamp(96px, 9vw, 132px); height: clamp(96px, 9vw, 132px); flex: 0 0 auto; place-items: center; border: 1px solid rgba(255,255,255,.38); border-radius: 50%; background: rgba(255,255,255,.1); box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 22px 48px rgba(3,15,31,.2); }
.login-brand-mark svg { width: 58%; height: 58%; fill: none; stroke: #fff; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.login-brand h1 { margin: 0; color: white; font-size: clamp(52px, 6vw, 86px); font-weight: 400; letter-spacing: -.045em; line-height: .9; text-align: left; }
.login-feature-list { gap: 9px; }
.login-feature-list span { padding: 7px 12px; border: 1px solid rgba(255,255,255,.2); border-radius: 999px; color: rgba(255,255,255,.88); font-size: 12px; font-weight: var(--text-emphasis-weight); }
.login-card .form-stack { width: min(440px, calc(100% - 48px)); margin: 0 auto; padding: 34px; border: 1px solid var(--line); border-radius: 8px; background: white; box-shadow: 0 22px 60px rgba(11,31,58,.11); }

@media (min-width: 901px) and (max-width: 1366px) {
  .dashboard-entity-panel .entity-metrics { grid-template-columns: 1fr; }
  .dashboard-entity-panel .entity-metrics > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 16px; }
  .dashboard-entity-panel .entity-metrics dd { margin: 0; }
}
@media (max-width: 1366px) {
  .dashboard-change-overview { display: block; }
}
@media (max-width: 1100px) {
  :root { --sidebar: 290px; }
  .app-shell { display: block; }
  .workspace { max-width: 100%; overflow-x: clip; }
  .workspace { margin-left: 0; }
  .sidebar { position: fixed; inset: 0 auto 0 0; height: auto; transform: translateX(-105%); visibility: hidden; transition: transform .22s ease, visibility .22s; box-shadow: 30px 0 70px rgba(4,15,29,.25); }
  .sidebar-open .sidebar { transform: translateX(0); visibility: visible; }
  .sidebar-backdrop { position: fixed; inset: 0; z-index: 40; width: 100%; height: 100%; border: 0; background: rgba(6,17,32,.45); }
  .sidebar-open .sidebar-backdrop { display: block; }
  .mobile-menu { display: grid; }
  .topbar { justify-content: flex-start; gap: 12px;  }
  .topbar-title { flex: 0 0 auto; }
  .topbar-actions { justify-content: flex-start; overflow-x: auto; padding: 8px 8px 2px 0; scrollbar-width: thin; }
 .card-grid { grid-template-columns: repeat(2, 1fr); }
  .summary-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .summary-facts > div:nth-child(3) { border-top: 1px solid var(--line); border-left: 0; }
  .summary-facts > div:nth-child(4) { border-top: 1px solid var(--line); }
  .cost-chart-rows { grid-template-columns: minmax(230px, 1.15fr) minmax(200px, 3fr) max-content max-content max-content; }
  .cost-chart-label { line-height: 1.25; white-space: normal; }
  .chart-grid { grid-template-columns: 1fr; }
  .dashboard-grid, .dashboard-grid--import { grid-template-columns: 1fr; }
  .data-section-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .payroll-rule-row { grid-template-columns: minmax(210px, 1.2fr) minmax(140px, .6fr) minmax(210px, .8fr); }
  .share-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .share-class-grid { grid-template-columns: 1fr; }
  .investment-reconciliation-grid { grid-template-columns: 1fr; }
  .import-resolution-list--balances { grid-template-columns: 1fr; }
}
@media (max-width: 1500px) and (min-width: 901px) {
  .transaction-review-table { min-width: 0; }
  .transaction-review-table th, .transaction-review-table td { padding-right: 8px; padding-left: 8px; }
  .transaction-payment-method-column { display: none; }
  .transaction-category-form { min-width: 150px; }
  .transaction-review-table th:nth-child(1) { width: 12%; }
  .transaction-review-table th:nth-child(2) { width: 10%; }
  .transaction-review-table th:nth-child(3) { width: 18%; }
  .transaction-review-table th:nth-child(5) { width: 8%; }
  .transaction-review-table th:nth-child(6) { width: 22%; }
  .transaction-review-table th:nth-child(7) { width: 7%; }
  .transaction-review-table th:nth-child(8) { width: 12%; }
  .transaction-review-table th:nth-child(9) { width: 11%; }
  .transaction-review-table :is(.transaction-action-heading, .transaction-action-cell) { padding-right: 8px; padding-left: 8px; }
}
@media (max-width: 1500px) and (min-width: 1250px) {
  .transaction-review-table th:nth-child(1) { width: 10%; }
  .transaction-review-table th:nth-child(2) { width: 10%; }
  .transaction-review-table th:nth-child(3) { width: 24%; }
  .transaction-review-table th:nth-child(5) { width: 6%; }
  .transaction-review-table th:nth-child(6) { width: 22%; }
  .transaction-review-table th:nth-child(7) { width: 6%; }
  .transaction-review-table th:nth-child(8) { width: 10%; }
  .transaction-review-table th:nth-child(9) { width: 12%; }
}
@media (max-width: 900px) {
  .entity-metrics { grid-template-columns: 1fr; }
  .topbar-tabs { margin-left: 22px; }
  .topbar-tabs a { min-height: 38px; padding-inline: 14px; font-size: 13px; }
  .topbar { align-content: center; flex-wrap: wrap; height: auto; min-height: calc(78px + var(--safe-area-top));   }
  .topbar-actions { order: 3; width: 100%; padding: 8px 8px 2px 0; }
  .topbar-actions:empty { display: none; }
  .transaction-review-table { min-width: 0; }
  .transaction-review-table thead { display: none; }
  .transaction-review-table, .transaction-review-table tbody, .transaction-review-table tr, .transaction-review-table td { display: block; width: 100%; }
  .transaction-review-table tr { position: relative; padding: 12px 16px; border-top: 1px solid var(--line); }
  .transaction-review-table tbody tr:first-child { border-top: 0; }
  .transaction-review-table td { height: auto; }
  .transaction-review-table td, .transaction-review-table td:nth-child(3), .transaction-review-table td:nth-child(4) { display: grid; grid-template-columns: minmax(88px, 28%) minmax(0, 1fr); min-width: 0; max-width: none; align-items: center; gap: 12px; padding: 5px 0; border: 0; text-align: left; white-space: normal; }
  .transaction-review-table :is(td, td:first-child, td:last-child) { padding-right: 0; padding-left: 0; }
  .transaction-review-table td.transaction-payment-method-column { display: none; }
  .transaction-review-table td::before { color: var(--muted); font-size: 10px; font-weight: 400; letter-spacing: .045em; text-transform: uppercase; content: attr(data-label); }
  .transaction-review-table td > :is(strong, small, span, a) { grid-column: 2; }
  .transaction-review-table td > :is(.transaction-category-form, .classification-suggestion, .transaction-payment-info, .transaction-source-badge, .transaction-source-empty) { grid-column: 2; min-width: 0; justify-self: start; }
  .transaction-review-table td > strong + small, .transaction-review-table td > small + small { margin-top: -8px; }
  .transaction-review-table td.transaction-details-cell, .transaction-review-table td.transaction-source-cell { position: absolute; top: 11px; display: block; width: 28px; padding: 0; }
  .transaction-review-table td.transaction-details-cell { right: 16px; }
  .transaction-review-table td.transaction-source-cell { right: 54px; }
  .transaction-review-table :is(.transaction-details-cell, .transaction-source-cell)::before { display: none; }
  .transaction-review-table td:first-child { padding-right: 82px; }
  .obligations-table { min-width: 0; table-layout: auto; }
  .obligations-table thead { display: none; }
  .obligations-table, .obligations-table tbody, .obligations-table .obligation-data-row, .obligations-table td { display: block; width: 100%; }
  .obligations-table .obligation-data-row { padding: 11px 16px; border-top: 1px solid var(--line); }
  .obligations-table .obligation-data-row td { display: grid; width: 100%; grid-template-columns: minmax(94px, 27%) minmax(0, 1fr); min-width: 0; max-width: none; align-items: center; gap: 12px; padding: 6px 0; border: 0; text-align: left; white-space: normal; }
  .obligations-table .obligation-data-row td::before { color: var(--muted); font-size: 10px; font-weight: 400; letter-spacing: .045em; text-transform: uppercase; content: attr(data-label); }
  .obligations-table .obligation-data-row td > * { grid-column: 2; justify-self: start; }
  .obligations-table .obligations-due-date, .obligations-table .obligations-confidence { display: grid; }
  .obligations-table .obligations-amount .currency-primary { white-space: nowrap; }
  .obligations-table .obligations-action .table-action-button {  justify-self: start; }
}
@media (max-width: 760px) {
  .dashboard-change-drivers { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .dashboard-change-heading-value { width: 100%; text-align: left; }
  .dashboard-change-heading-value > div { justify-content: flex-start; }
  .dashboard-change-heading-value strong { font-size: 31px; }
  .dashboard-change-components { grid-template-columns: 1fr; }
  .dashboard-change-liquidity { align-items: flex-start; flex-wrap: wrap; }
  .dashboard-change-liquidity strong { width: 100%; margin-left: 24px; }
  .dashboard-tax-coverage-heading { align-items: flex-start; flex-direction: column; gap: 9px; }
  .dashboard-tax-coverage-heading > div:last-child { text-align: left; }
  .dashboard-tax-coverage-heading--settled > strong { align-self: flex-start; }
  .wealth-chart-config-header { display: none; }
  .wealth-chart-config-row { grid-template-columns: minmax(0, 1fr) auto; gap: 11px; padding: 14px; }
  .wealth-chart-config-kind { grid-column: 1; grid-row: 1; }
  .wealth-chart-config-title { grid-column: 1; grid-row: 2; }
  .wealth-chart-config-row label { grid-column: 1; }
  .wealth-chart-config-order { grid-column: 2; grid-row: 2 / 4; align-self: end; }
  .liquidity-flow-panel .panel-heading { padding: 19px 19px 17px; }
  .liquidity-flow-panel .table-scroll { overflow: visible; }
  .liquidity-flow-table colgroup, .liquidity-flow-table thead { display: none; }
  .liquidity-flow-table, .liquidity-flow-table tbody, .liquidity-flow-table tr, .liquidity-flow-table td { display: block; width: 100%; }
  .liquidity-flow-table tr { padding: 13px 19px; border-top: 1px solid var(--line); }
  .liquidity-flow-table td,
  .liquidity-flow-table :is(td, td:first-child, td:last-child) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
    padding: 5px 0;
    border: 0;
    text-align: right;
  }
  .liquidity-flow-table td::before { color: var(--muted); font-size: 10px; font-weight: 400; letter-spacing: .045em; text-align: left; text-transform: uppercase; content: attr(data-label); }
  .liquidity-flow-table td:first-child { margin-bottom: 6px; padding-bottom: 10px; border-bottom: 1px solid var(--line); color: var(--navy-2); font-weight: 700; }
  .liquidity-flow-table td:first-child::before { font-weight: 650; }
  .liquidity-flow-table td:last-child { margin-top: 6px; padding-top: 10px; border-top: 1px solid var(--line); color: var(--navy-2); }
  .tax-year-overview__intro { white-space: normal; }
  .forecast-balance { overflow-x: auto; }
  .chart-canvas--waterfall { overflow-x: auto; scrollbar-width: thin; }
  .chart-canvas--waterfall svg { width: 640px; min-width: 640px; height: 400px; }
  h1 { font-size: 39px; letter-spacing: -2.2px; }
  h2 { font-size: var(--text-panel-size); }
  .topbar { align-content: center; flex-wrap: wrap; height: auto; min-height: calc(78px + var(--safe-area-top));  }
  .topbar-eyebrow { font-size: 11px; }
  .topbar-title strong { font-size: 17px; }
  .topbar-tabs { margin-left: auto; }
  .topbar-tabs a { min-height: 36px; padding-inline: 11px; font-size: 12px; }
  .topbar-actions { order: 3; width: 100%; padding: 8px 8px 2px 0; justify-content: flex-start; }
  .topbar-actions:empty { display: none; }
  .topbar-actions .as-of { display: none; }
  .topbar-actions { flex-wrap: wrap; overflow-x: visible; }
  .topbar-actions .primary-button, .topbar-actions .secondary-button { flex: 1 1 auto;   font-size: 13px; }
  .share-class-table-tabs { width: 100%; margin: 0; }
  .share-class-table-tabs a { min-height: 36px; flex: 1 1 0; justify-content: center; padding-inline: 11px; font-size: 12px; }
  .page-heading { align-items: flex-start; flex-direction: column; gap: 14px; }
  .heading-actions { width: 100%; }
  .heading-actions a { flex: 1 1 auto; }
 .card-grid { grid-template-columns: 1fr; }
  .summary-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .summary-facts > div { border-top: 0; border-left: 1px solid var(--line); }
  .summary-facts > div:nth-child(odd) { border-left: 0; }
  .summary-facts > div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .cost-composition-heading-tools { width: 100%; justify-content: flex-start; }
  .import-alert-summary { align-items: stretch; flex-direction: column; }
  
  .import-requirements, .import-delivery-actions, .import-resolution-list { margin-left: 0; }
  .import-requirements article, .import-balance-card__heading { flex-direction: column; gap: 8px; }
  .import-requirements article > div:last-child { text-align: left; }
  .import-reconciliation { grid-template-columns: 1fr; }
  .import-reconciliation__difference { grid-column: auto; }
  .cost-chart-rows { grid-template-columns: 1fr; gap: 3px; }
  .cost-chart-row { min-height: 50px; grid-column: auto; grid-template-columns: minmax(0, 1fr) 118px; gap: 3px 10px; }
  .cost-chart-label { font-size: 13px; }
  .cost-chart-bar { grid-column: 1 / -1; grid-row: 2; }
  .cost-chart-track { height: 8px; }
  .cost-chart-value { display: grid; grid-column: 2; grid-row: 1; grid-template-columns: minmax(68px, 1fr) 36px; gap: 1px 6px; }
  .cost-chart-value > strong { grid-column: 1; grid-row: 1; }
  .cost-chart-value > small { grid-column: 2; grid-row: 1; }
  .cost-chart-value > span { grid-column: 1 / -1; grid-row: 2; font-size: 10px; }
  .cost-stack-chart { min-height: 0; }
  .cost-stack-detail { margin: 18px -19px -19px; }
  .cost-stack-detail-heading { align-items: flex-start; padding: 15px 19px; }
  .cost-savings-formula { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cost-savings-formula div { padding: 14px 16px; }
  .cost-savings-formula div:nth-child(3) { border-top: 1px solid var(--line); border-left: 0; }
  .cost-savings-formula div:nth-child(4) { border-top: 1px solid var(--line); }
  .chart-heading-tools {  justify-items: start; }
  .chart-legend { justify-content: flex-start; }
  .chart-canvas, .chart-canvas svg { min-height: 275px; }
  .dashboard-change-main { padding: 19px; }
  .tax-page-heading { align-items: stretch; }
  .tax-current-forecast { grid-template-columns: 1fr; }
  .tax-component-edit-grid { grid-template-columns: 1fr; }
  .login-card { grid-template-columns: 1fr; }
  .login-card > div { min-height: 42vh; padding: 42px 28px; }
  .login-card > .login-hero { gap: 24px; }
  .login-brand { gap: 18px; }
  .login-brand-mark { width: 74px; height: 74px; }
  .login-brand h1 { font-size: 45px; letter-spacing: -2px; }
  .login-feature-list { gap: 6px; }
  .login-feature-list span { padding: 5px 8px; font-size: 10px; }
  .login-card .form-stack { margin: 40px auto; }
  th, td { padding: 13px 14px; }
  .data-section-grid, .data-form-grid, .data-integrity-note { grid-template-columns: 1fr; }
  .forecast-section-heading { display: grid; }
  .payroll-summary { justify-content: space-between; }
  .payroll-summary div { text-align: left; }
  .payroll-rule-row, .dividend-installment-preview { grid-template-columns: 1fr; gap: 10px; }
  .compact-number-field--money { justify-self: auto; }
  .data-section-card { min-height: 220px; }
  .data-integrity-note { gap: 14px; }
  .data-list-row { align-items: flex-start; gap: 15px; padding: 16px; }
  .data-card-grid { grid-template-columns: 1fr; }
  .transaction-payment-details dl { grid-template-columns: 1fr; }
  .transaction-payment-details__wide { grid-column: auto; }
  .asset-account-grid .account-card { grid-template-columns: minmax(0, 1fr) auto; }
  .pagination { align-items: stretch; flex-direction: column; }
  .pagination > div { display: grid; grid-template-columns: repeat(2, 1fr); }
  .editor-panel { padding: 18px; }
  :root { --dialog-edge: 9px; }
  .asset-editor__header { padding: 18px 18px 14px; }
  .asset-editor__header h2 { font-size: 20px; }
  .asset-editor__tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 8px 18px; overflow: visible; }
  .asset-editor__tabs button { width: 100%; min-width: 0; padding: 5px 8px; white-space: normal; }
  .asset-editor__panel { padding: 20px 18px 22px; }
  .tax-year-editor__panel { padding-top: 0; }
  .tax-dialog-tabs { margin: 0 -18px 22px; padding-inline: 18px; }
  .asset-editor__grid { grid-template-columns: 1fr; }
  .category-data-form .form-field--checkbox:last-child { grid-column: auto; }
  .asset-editor__actions { bottom: -22px; align-items: stretch; flex-direction: column; margin: 24px -18px -22px; padding: 14px 18px; }
  .asset-editor__actions .form-delete-action { margin-right: 0; }
  .asset-editor__inline-actions { justify-content: stretch; }
  .asset-editor__inline-actions > * { width: 100%; }
  .transaction-assignment-mode__options { display: grid; grid-template-columns: 1fr 1fr; }
  .transaction-split-panel { padding: 14px; }
  .transaction-split-columns { display: none; }
  .transaction-split-row { grid-template-columns: 1fr; align-items: stretch; }
  .transaction-split-field-label { position: static; width: auto; height: auto; overflow: visible; clip: auto; clip-path: none; white-space: normal; }
  .transaction-split-remove { min-height: 32px; }
  .transaction-split-add { grid-row: 1; grid-column: 2; }
  .valuation-editor summary { align-items: flex-start; flex-direction: column; gap: 4px; }
  .form-actions { align-items: stretch; flex-direction: column; }
  .section-tabs { display: flex; width: 100%; }
  .section-tabs a { flex: 1; justify-content: center; padding: 9px 10px; line-height: 1.25; text-align: center; }
  .share-summary-grid { grid-template-columns: 1fr; }
  .tax-dialog-summary { grid-template-columns: 1fr 1fr; }
  .tax-dialog-summary div:nth-child(3) { border-top: 1px solid var(--line); border-left: 0; }
  .tax-dialog-summary div:nth-child(4) { border-top: 1px solid var(--line); }
  .tax-dialog-actions { align-items: stretch; flex-direction: column; }
  .tax-dialog-actions > * { width: 100%; }
  .year-picker { width: 100%; }
  .fc-investment-heading { align-items: flex-start; flex-direction: column; gap: 9px; padding-inline: 19px; }
  .share-class-card .share-fact-grid > div { padding-inline: 18px; }
  .share-holdings-section > .fc-investment-heading { padding-inline: 0; }
  .share-fact-grid, .share-fact-grid--compact { grid-template-columns: 1fr; }
  .share-fact-grid > div { border-top: 1px solid var(--line); border-left: 0; }
  .share-fact-grid > div:first-child { border-top: 0; }
  .share-fact-grid--compact > div:nth-child(3), .share-fact-grid--compact > div:nth-child(4) { border-left: 0; }
  .share-sale-foot { align-items: flex-start; flex-direction: column; gap: 8px; }
  .liquidity-flow-panel .table-scroll { overflow-x: auto; }
  .transaction-review-table { display: table; width: 100%; min-width: 1100px; table-layout: fixed; }
  .obligations-table { display: table; width: 100%; min-width: 1315px; table-layout: fixed; }
  .obligations-table .obligations-status { width: 90px; }
  .obligations-table .obligations-entity { width: 125px; }
  .obligations-table .obligations-type { width: 165px; }
  .obligations-table .obligations-position { width: 230px; }
  .obligations-table .obligations-counterparty { width: 160px; }
  .obligations-table .obligations-due-date { width: 120px; }
  .obligations-table .obligations-amount { width: 165px; }
  .obligations-table .obligations-confidence { width: 110px; }
  .obligations-table .obligations-action { width: 150px; }
  .liquidity-flow-table { display: table; width: 100%; min-width: 960px; table-layout: fixed; }
  :is(.transaction-review-table, .obligations-table, .liquidity-flow-table) thead { display: table-header-group; }
  :is(.transaction-review-table, .obligations-table, .liquidity-flow-table) tbody { display: table-row-group; }
  :is(.transaction-review-table, .obligations-table, .liquidity-flow-table) tr,
  .obligations-table .obligation-data-row { position: static; display: table-row; width: auto; padding: 0; }
  :is(.transaction-review-table, .obligations-table, .liquidity-flow-table) :is(th, td),
  .transaction-review-table :is(td, td:nth-child(3), td:nth-child(4)),
  .obligations-table .obligation-data-row td,
  .obligations-table :is(.obligations-due-date, .obligations-confidence) {
    position: static;
    display: table-cell;
    width: auto;
    min-width: 0;
    max-width: none;
    height: auto;
    padding: 13px 14px;
    border-top: 1px solid var(--line);
    text-align: left;
    white-space: normal;
  }
  :is(.transaction-review-table, .obligations-table, .liquidity-flow-table) td.numeric { text-align: right; white-space: nowrap; }
  :is(.transaction-review-table, .obligations-table, .liquidity-flow-table) td::before { display: none; }
  .transaction-review-table :is(td, td:first-child, td:last-child) { padding: 13px 14px; }
  .transaction-review-table td.transaction-payment-method-column { display: table-cell; }
  .transaction-review-table td.transaction-details-cell,
  .transaction-review-table td.transaction-source-cell { position: static; display: table-cell; width: auto; padding: 13px 14px; }
  .transaction-review-table td:first-child { padding-right: 14px; }
  .transaction-review-table td > :is(strong, small, span, a),
  .transaction-review-table td > :is(.transaction-category-form, .classification-suggestion, .transaction-payment-info, .transaction-source-badge, .transaction-source-empty),
  .obligations-table .obligation-data-row td > * { grid-column: auto; justify-self: auto; }
  .transaction-review-table td > strong + small, .transaction-review-table td > small + small { margin-top: 0; }
  .liquidity-flow-table td:first-child, .liquidity-flow-table td:last-child { margin: 0; padding: 13px 14px; border-top: 1px solid var(--line); color: inherit; font-weight: inherit; }
  .liquidity-flow-table td,
  .liquidity-flow-table :is(td, td:first-child, td:last-child) {
    display: table-cell;
    width: auto;
    grid-template-columns: none;
    gap: normal;
    padding: 13px 14px;
    border-top: 1px solid var(--line);
    text-align: left;
    white-space: normal;
  }
  .liquidity-flow-table td.numeric { text-align: right; white-space: nowrap; }
  .investment-history-canvas { height: var(--investment-chart-height, 595px); min-height: var(--investment-chart-height, 595px); overflow-x: auto; overflow-y: hidden; }
  .investment-history-canvas svg { height: var(--investment-chart-height, 595px); min-width: 720px; min-height: 0; }
  .investment-year-label { font-size: 12px; font-weight: 600; }
  .sale-details summary, .calculation-details summary { align-items: flex-start; padding: 18px; }
  .sale-details summary > span:last-child, .calculation-details summary > span:last-child { display: none; }
  .sale-details summary .summary-action-button, .calculation-details summary .summary-action-button { display: inline-flex; }
  .sale-details-body, .calculation-details-body { padding: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}

/* Receivable ledger */
.loan-heading { display: flex; justify-content: space-between; align-items: center; gap: 24px;  }
.loan-heading h1 { margin: 7px 0; font-size: 25px; letter-spacing: -.5px; }
.loan-heading p, .loan-eyebrow, .loan-balance span, .loan-balance small { color: var(--muted); }
.loan-heading p { margin: 0; }
.loan-eyebrow { font-size: 12px; }
.loan-balance { display: grid; gap: 7px; text-align: right; flex-shrink: 0; }
.loan-balance strong { font-size: 28px; color: var(--navy); font-variant-numeric: tabular-nums; }
.loan-summary { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-radius: 8px; background: white; margin: 18px 0 24px; }
.loan-summary > div { padding: 19px 26px; display: grid; gap: 8px; }
.loan-summary > div + div { border-left: 1px solid var(--line); }
.loan-summary span { color: var(--muted); font-size: 12px; }
.loan-summary strong { font-size: 19px; font-variant-numeric: tabular-nums; }
.loan-entries { overflow: hidden; }
.loan-notice { margin: 0 24px 18px; padding: 12px 15px; background: var(--surface-3); color: var(--muted); font-size: 12px; line-height: 1.6; border-radius: 5px; }
.loan-table { width: 100%; }
.loan-table .loan-description { min-width: 220px; max-width: 340px; white-space: normal; overflow-wrap: anywhere; }
.loan-description strong, .loan-description > small { display: block; }
.loan-description > small, .loan-bank-link { font-size: 11px; margin-top: 5px; }
.loan-bank-link { display: inline-block; }
.loan-repayment { color: var(--flow-in); }
.loan-documents { display: grid; gap: 7px; max-width: 200px; font-size: 12px; overflow-wrap: anywhere; white-space: normal; }
.loan-note { font-size: 12px; margin-top: 6px; color: var(--muted); }
.loan-note summary, .loan-context summary { cursor: pointer; }
.loan-note p { white-space: normal; line-height: 1.6; }
.loan-context { margin-top: 20px; padding: 20px 24px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.loan-field-wide { grid-column: 1 / -1; }
.loan-entry-editor { width: min(760px, calc(100vw - 28px)); }
.loan-bank-search { padding: 16px; background: var(--surface-3); border-radius: 6px; margin-bottom: 20px; }
.loan-bank-search > label { display: block; margin-bottom: 8px; font-weight: var(--text-emphasis-weight); }
.loan-bank-search > div { display: flex; gap: 8px; }
.loan-bank-search input { min-width: 0; flex: 1; }
.loan-bank-search small { display: block; margin-top: 8px; }
.loan-entry-form select { max-width: 100%; text-overflow: ellipsis; }
.loan-entry-form input[type=file] { max-width: 100%; }
.loan-existing-docs { display: grid; gap: 10px; margin-top: 18px; font-size: 13px; }
.loan-existing-docs > div { display: flex; justify-content: space-between; gap: 16px; }
.loan-existing-docs a { overflow-wrap: anywhere; min-width: 0; }
@media (max-width: 700px) {
  .loan-heading {  align-items: flex-start; flex-direction: column; gap: 18px; }
  .loan-balance { text-align: left; }
  .loan-heading h1 { font-size: 22px; }
  .loan-summary > div { padding: 14px 10px; }
  .loan-summary strong { font-size: 14px; }
  .loan-summary span { font-size: 10px; }
  .loan-table { min-width: 840px; }
  .loan-bank-search { padding: 12px; }
}

.loan-pdf-dialog { width: min(1100px, calc(100vw - 28px)); }
.loan-pdf-dialog .asset-editor__shell { height: min(900px, calc(100dvh - 36px)); }
.loan-pdf-dialog .asset-editor__header h2 { overflow-wrap: anywhere; }
.loan-pdf-frame { flex: 1; min-height: 0; width: 100%; border: 0; background: #eef1f5; overflow: auto; padding: 16px; text-align: center; }
.loan-pdf-dialog .asset-editor__actions { position: static; margin: 0; flex-shrink: 0; padding: 16px 24px; }
.loan-pdf-dialog .asset-editor__header { flex-shrink: 0; }

.loan-pdf-frame canvas { display: block; height: auto; margin: 0 auto 16px; background: white; box-shadow: 0 1px 5px #0002; }

.forecast-expense-heading { display: flex; align-items: center; gap: 10px; }
.forecast-expense-heading .metric-info { position: relative; inset: auto; }
.forecast-expense-columns, .forecast-expense-row { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) 83px 110px; gap: 16px; }
.forecast-expense-columns { margin: 8px 0 10px; font-size: 13px; font-weight: 600; color: var(--muted); }
.forecast-expense-row { align-items: start; margin-bottom: 12px; }
.forecast-expense-row .form-field { min-width: 0; }
.forecast-expense-row input:not([type="hidden"]):not([type="checkbox"]), .forecast-expense-row select, .forecast-expense-delete button { height: 42px; min-height: 42px; box-sizing: border-box; }
.forecast-expense-delete { display: flex; align-items: center; min-height: 42px; }
.forecast-expense-fallback { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--line); }
@media (max-width: 600px) {
  .forecast-expense-columns, .forecast-expense-row { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) 72px 84px; gap: 8px; }
  .forecast-expense-columns { font-size: 11px; }
  .forecast-expense-delete button {  font-size: 12px; }
}

/* Keep expense navigation and actions in normal flow, including narrow desktop widths. */
.cost-settings { position: relative; flex: 0 0 auto; }
.cost-settings > summary { list-style: none; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.cost-settings > summary::-webkit-details-marker { display: none; }
.cost-settings[open] > summary { background: var(--blue-soft); }
.cost-settings__panel { position: absolute; top: calc(100% + 8px); right: 0; z-index: 50; display: grid; width: max-content; min-width: 100%; max-width: calc(100vw - 28px); padding: 6px; border: 1px solid var(--line-strong); border-radius: 8px; background: white; box-shadow: 0 12px 30px rgba(11,31,58,.18); }
.cost-settings__panel > a, .cost-settings__panel > button { display: block; width: 100%; padding: 12px; border: 0; border-radius: 5px; background: transparent; color: var(--navy); font: inherit; font-size: 14px; line-height: 1.4; text-align: left; text-decoration: none; cursor: pointer; }
.cost-settings__panel > a:hover, .cost-settings__panel > button:hover, .cost-settings__panel > :focus-visible { background: var(--blue-soft); outline: 2px solid var(--blue); outline-offset: -2px; }
@media (max-width: 900px) { .cost-settings__panel { right: auto; left: 0; } }

.cost-settings__chevron { flex: 0 0 auto; transform-origin: center; transition: transform 180ms ease; }
.cost-settings[open] .cost-settings__chevron { transform: rotate(90deg); }
@media (prefers-reduced-motion: reduce) { .cost-settings__chevron { transition: none; } }

/* Dialog autofocus must not disclose the forecast explanation automatically. */
#forecast-expense-editor .form-help__trigger[aria-expanded="false"] + .form-help__content { display: none; }

.topbar-actions .cost-settings > summary.secondary-button {  gap: 3px; }

/* Align header controls independently of inline text baselines. */
.topbar-actions .primary-button, .topbar-actions .secondary-button {   line-height: 1.25; box-sizing: border-box; }
.topbar-actions .cost-settings > summary { display: flex; }
.cost-settings__chevron, .notification-trigger > svg { display: block; }

.settings-overview-dialog { width: min(1480px, calc(100vw - 48px)); }
.settings-overview-dialog .settings-dialog-toolbar { display: flex; justify-content: flex-end; margin-bottom: 18px; }
.settings-overview-dialog .data-card-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr)); }

@media (min-width: 641px) {
  .chart-panel--waterfall > .chart-canvas, .chart-panel--history > .chart-canvas { height: 390px; min-height: 390px; }
  #wealth-waterfall, #wealth-history { height: 390px; min-height: 390px; }
}

.forecast-expense-order { align-items: center; min-height: 42px; }
@media (max-width: 600px) {
  .forecast-expense-columns { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .forecast-expense-columns > span:nth-child(n+3) { display: none; }
  .forecast-expense-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding-bottom: 16px; border-bottom: 1px solid var(--line); }
  .forecast-expense-delete { justify-self: end; }
}

.income-waterfall-section .waterfall-bar--salary { fill: var(--flow-in); }
.income-waterfall-section .waterfall-bar--other-income { fill: var(--positive-soft); }
.income-waterfall-section .waterfall-bar--deduction { fill: var(--danger-chart); }
.income-waterfall-section .waterfall-bar--expense { fill: var(--danger-soft); }
.waterfall-legend .legend-salary { background: var(--flow-in); }
.waterfall-legend .legend-other-income { background: var(--positive-soft); }
.waterfall-legend .legend-expense { background: var(--danger-soft); }

/* Shared metric labels and touch-scrollable booking table. */
.dashboard-grid--summary { align-items: stretch; }
.dashboard-entity-panel { align-self: stretch; }
.entity-comparison { width: 100%; min-width: 0; border-collapse: separate; border-spacing: 0 8px; }
.entity-comparison :is(th, td) { padding: 10px 8px; border: 0; }
.entity-comparison thead th { background: transparent; color: var(--navy-2); font-size: var(--table-header-font-size); font-weight: 700; text-transform: none; letter-spacing: normal; text-align: right; white-space: normal; }
.entity-comparison tbody th { background: var(--surface-2); color: var(--ink); font-size: var(--table-body-font-size); font-weight: 400; text-transform: none; letter-spacing: normal; text-align: left; border-radius: 5px 0 0 5px; }
.entity-comparison td { background: var(--surface-2); color: var(--navy-2); font-size: var(--table-body-font-size); font-weight: var(--text-emphasis-weight); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.entity-comparison td:last-child { border-radius: 0 5px 5px 0; }
.transaction-table-panel .table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; touch-action: pan-x pan-y; }
@media (min-width: 1101px) { .dashboard-grid--summary { grid-template-columns: minmax(420px, 1fr) minmax(0, 2fr); } }
@media (max-width: 620px) {
  .entity-comparison :is(th, td) { padding: 9px 5px; }
  .entity-comparison td { font-size: var(--table-body-font-size); }
  .entity-comparison thead th { font-size: var(--table-header-font-size); }
}

/* Two compact status panels beside the change analysis. */
.dashboard-grid--summary { grid-template-columns: minmax(0, 45fr) minmax(0, 55fr); grid-template-rows: auto auto; }
.dashboard-grid--summary .dashboard-entity-panel { grid-column: 1; grid-row: 1; }
.dashboard-grid--summary .dashboard-tax-panel { grid-column: 1; grid-row: 2;  }
.dashboard-grid--summary .dashboard-change-panel { grid-column: 2; grid-row: 1 / span 2; }
.dashboard-tax-panel .dashboard-tax-coverage { padding: 0; border: 0; background: var(--surface); }
@media (max-width: 1100px) {
  .dashboard-grid--summary { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; }
  .dashboard-grid--summary :is(.dashboard-entity-panel, .dashboard-tax-panel, .dashboard-change-panel) { grid-column: 1; grid-row: auto; }
  .dashboard-grid--summary .dashboard-tax-panel { order: 1; }
  .dashboard-grid--summary .dashboard-change-panel { order: 2; }
}

/* Consistent standalone panel headings and compact table spacing. */
.dashboard-entity-panel > .panel-heading { margin-bottom: 8px; }
.entity-comparison thead th { padding-top: 4px; padding-bottom: 6px; }
.dashboard-tax-panel .dashboard-tax-coverage-heading { align-items: flex-start; margin-bottom: 20px; }
.dashboard-tax-panel .dashboard-tax-coverage-heading h2 { margin: 0; }
.dashboard-tax-panel .dashboard-tax-coverage-heading > div:first-child > span { margin-top: 6px; }
@media (max-width: 620px) { .dashboard-grid--summary .dashboard-tax-panel {  } }

.financial-status-heading { display: flex; align-items: center; gap: 10px; }
.financial-status-heading .metric-info { position: relative; top: auto; right: auto; flex: 0 0 auto; }

:is(.metric-card, .account-card) .metric-currency { font-size: .48em; font-weight: 400; letter-spacing: normal; }
.cost-summary-grid .metric-card > small { display: block; max-height: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.metric-card .metric-monthly .metric-currency { font-size: inherit; font-weight: inherit; }

.income-settings-editor .forecast-form-section { margin: 0; padding: 0; border: 0; }
.income-settings-editor .asset-editor__tabs { margin-bottom: 22px; }
.income-settings-editor [data-dialog-tab-panel][hidden] { display: none; }

.dividend-simple-summary { margin: 0 0 16px; color: var(--muted); font-size: 13px; }
.dividend-simple-summary strong { color: var(--navy-2); }
.dividend-schedule { border: 1px solid var(--line); border-radius: 7px; }
.dividend-schedule-row { display: grid; grid-template-columns: 70px minmax(120px, 1fr) minmax(110px, auto); align-items: center; gap: 16px; padding: 10px 14px; }
.dividend-schedule-row + .dividend-schedule-row { border-top: 1px solid var(--line); }
.dividend-schedule-row > label { font-weight: 400; font-size: var(--table-body-font-size); }
.dividend-schedule-row > span { text-align: right; font-size: var(--table-body-font-size); white-space: nowrap; font-variant-numeric: tabular-nums; }
.dividend-schedule-row select { width: 100%; }
.dividend-tax-choice { margin-top: 18px; max-width: 300px; }
.dividend-allocation { margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--line); }
.dividend-allocation summary { cursor: pointer; color: var(--blue); font-size: 13px; }
.dividend-allocation .data-form-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dividend-forecast-section .metric-currency { font-weight: 400; font-size: inherit; }
@media (max-width: 620px) { .dividend-schedule-row { grid-template-columns: 45px minmax(0, 1fr); gap: 8px; } .dividend-schedule-row > span { grid-column: 2; } .dividend-allocation .data-form-grid { grid-template-columns: 1fr; } }

.dividend-schedule-row select { min-height: 40px; padding: 7px 10px; border: 1px solid var(--line-strong); border-radius: 5px; background-color: var(--surface); color: var(--ink); font: inherit; font-size: 13px; }

.income-settings-editor { height: min(780px, calc(100dvh - 36px)); }
.income-settings-editor .asset-editor__surface { height: 100%; display: flex; flex-direction: column; }
.income-settings-editor .asset-editor__header { flex: 0 0 auto; }
.income-settings-editor .asset-editor__panel { flex: 1; min-height: 0; }
.income-settings-editor .asset-editor__panel > form { min-height: 100%; display: flex; flex-direction: column; }
.income-settings-editor .asset-editor__actions { margin-top: auto; padding-top: 24px; }
.dividend-schedule-columns, .dividend-schedule-row { display: grid; grid-template-columns: 55px minmax(120px, 160px) minmax(100px, 1fr) 110px 100px; gap: 14px; align-items: center; padding: 14px 17px; }
.dividend-schedule-columns { border-radius: 7px 7px 0 0; }
.dividend-schedule-columns > span:nth-child(3) { text-align: right; }
.dividend-percent { display: flex; align-items: center; gap: 5px; }
.dividend-percent input { width: 85px; min-width: 0; padding: 8px; border: 1px solid var(--line-strong); border-radius: 5px; font: inherit; font-size: 13px; }
.dividend-tax-check { display: flex; justify-content: center; }
.dividend-tax-check input { width: 18px; height: 18px; accent-color: var(--blue); }
.dividend-tax-mobile-label { display: none; }
@media (max-width: 620px) {
  .dividend-schedule-columns { display: none; }
  .dividend-schedule-row { grid-template-columns: 45px minmax(0, 1fr) 95px; gap: 8px; }
  .dividend-schedule-row > span { grid-column: 3; grid-row: auto; }
  .dividend-percent { grid-column: 2; }
  .dividend-tax-check { grid-column: 3; justify-content: flex-start; gap: 5px; font-size: 11px; }
  .dividend-tax-mobile-label { display: inline; }
}

/* Shared segmented tabs across pages and dialogs. */
:is(.topbar-tabs, .section-tabs, .share-class-table-tabs, .asset-editor__tabs) {
  display: inline-flex; width: max-content; max-width: 100%; box-sizing: border-box;
  gap: 3px; padding: 3px; border: 1px solid var(--line-strong);
  border-radius: 6px; background: var(--surface-3); overflow-x: auto;
}
:is(.topbar-tabs, .section-tabs, .share-class-table-tabs, .asset-editor__tabs) > :is(a, button) {
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
  min-height: 40px; padding: 0 16px; border: 0; border-radius: 4px;
  background: transparent; color: var(--muted); font: inherit;
  font-size: 14px; font-weight: var(--tab-font-weight); white-space: nowrap; text-align: center;
}
:is(.topbar-tabs, .section-tabs, .share-class-table-tabs, .asset-editor__tabs) > :is(a, button):hover { color: var(--navy-2); }
:is(.topbar-tabs, .section-tabs, .share-class-table-tabs, .asset-editor__tabs) > :is(.active, [aria-selected="true"]) {
  background: white; box-shadow: 0 1px 4px rgba(11,31,58,.1); color: var(--navy-2);
}
.asset-editor__surface > .asset-editor__tabs { margin: 12px 28px 0; max-width: calc(100% - 56px); }
.asset-editor__panel .asset-editor__tabs { margin-left: 0; margin-right: 0; }
.tax-dialog-tabs { margin: 0 0 26px; }
@media (max-width: 620px) {
  :is(.topbar-tabs, .section-tabs, .share-class-table-tabs, .asset-editor__tabs) > :is(a, button) { min-height: 36px; padding: 0 11px; font-size: 12px; width: auto; }
  .asset-editor__surface > .asset-editor__tabs { margin: 10px 18px 0; max-width: calc(100% - 36px); }
  .tax-dialog-tabs { margin: 0 0 22px; }
}

.dividend-schedule-columns, .dividend-schedule-row, .dividend-schedule-total {
  grid-template-columns: 55px minmax(150px, 1.25fr) minmax(110px, 1fr) minmax(110px, .8fr) 95px;
  gap: 20px;
}
.dividend-schedule-row select { height: var(--field-height); min-height: var(--field-height); padding: 0 44px 0 var(--field-padding-x); }
.dividend-percent input { height: var(--field-height); box-sizing: border-box; }
.dividend-schedule-columns > span:last-child { text-align: center; }
.dividend-schedule-total { display: grid; align-items: center; padding: 14px 17px; border-top: 1px solid var(--line); background: var(--editor-section-bg); border-radius: 0 0 7px 7px; font-size: var(--table-body-font-size); }
.dividend-schedule-total > strong:first-child { grid-column: 1 / span 2; }
.dividend-schedule-total > strong:last-child { grid-column: 3; text-align: right; white-space: nowrap; }
@media (max-width: 620px) {
  .dividend-schedule-row, .dividend-schedule-total { grid-template-columns: 45px minmax(0, 1fr) 95px; gap: 8px; }
  .dividend-schedule-total > strong:first-child { font-size: 12px; }
  .dividend-schedule-total > strong:last-child { font-size: 13px; }
}

.dividend-forecast-section .dividend-schedule + div + .help-text { margin-top: 18px; }

#income-settings-dates { font-size: 14px; }
#income-settings-dates h3 { font-size: 16px; margin: 0 0 14px; }
#income-settings-dates .form-field label, .dividend-schedule-row > label { font-size: 13px; }
#income-settings-dates select, #income-settings-dates input { font-size: 16px; }
#income-settings-dates .forecast-form-section:first-child .data-form-grid { grid-template-columns: minmax(150px, 270px); }
.income-settings-editor #income-settings-dates .dividend-forecast-section { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }

#income-settings-dates select, #income-settings-dates .dividend-percent input { height: var(--field-height); min-height: var(--field-height); box-sizing: border-box; }

#income-settings-dates h3 label { font-size: inherit; font-weight: inherit; color: inherit; margin: 0; }

#income-settings-dates .form-field > h3 { margin-bottom: 6px; }

#income-settings-dates .form-field > h3 > label { font-size: inherit; font-weight: inherit; line-height: inherit; color: var(--navy-2); }

.payroll-rule-row > .compact-number-field:nth-child(2) input { width: 144px; min-width: 0; flex: 0 0 144px; }
.payroll-bvg-field { grid-column: 2 / span 2; }
@media (max-width: 620px) { .payroll-bvg-field { grid-column: auto; } }

@media (max-width: 620px) {
  .payroll-rule-row { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 10px; }
  .payroll-rule-row > div:first-child, .payroll-rule-row > .form-error { grid-column: 1 / -1; }
  .payroll-rule-row > .compact-number-field { min-width: 0; }
  .payroll-rule-row > .compact-number-field input,
  .payroll-rule-row > .compact-number-field:nth-child(2) input { width: 0; min-width: 0; flex: 1 1 0; box-sizing: border-box; padding: 0 8px; }
  .payroll-rule-row > .payroll-bvg-field { grid-column: 1 / -1; }
}

.asset-editor__shell > .asset-editor__tabs { margin: 16px 28px 0; max-width: calc(100% - 56px); }
@media (max-width: 620px) {
  .asset-editor__shell > .asset-editor__tabs { margin: 16px 18px 0; max-width: calc(100% - 36px); }
}

.tax-payment-info.metric-info { position: relative; top: auto; right: auto; margin-top: 6px; }
.tax-payment-info .tax-payment-details { margin: 0; }

.asset-editor__header--tabs { display: flex; align-items: center; gap: 22px; }
.asset-editor__header--tabs > div:first-child { flex: 0 1 auto; }
.asset-editor__header--tabs > .asset-editor__tabs { margin: 0; flex: 0 1 auto; min-width: 0; }
.asset-editor .asset-editor__header--tabs > .asset-editor__tabs { margin-left: auto; }
.asset-editor__header--tabs > .asset-editor__close { margin-left: auto; flex: 0 0 auto; }
@media (max-width: 760px) {
  .asset-editor__header--tabs { flex-wrap: wrap; gap: 14px; }
  .asset-editor__header--tabs > .asset-editor__tabs { order: 3; max-width: 100%; }
  .asset-editor__header--tabs > .asset-editor__close { order: 2; }
}

.tax-review-payments table { table-layout: fixed; }
.tax-review-payments :is(th, td) { padding: 10px 12px; }
.tax-review-payments .tax-payment-source { position: relative; min-width: 0; padding-right: 38px; vertical-align: middle; }
.tax-review-payments .tax-payment-source > small { max-width: none; margin-top: 3px; }
.tax-review-payments .tax-payment-info { position: absolute; top: 9px; right: 10px; margin: 0; }
.tax-review-payments :is(input, select) { min-width: 0; box-sizing: border-box; }

.tax-review-payments :is(th, td) { padding-block: 7px; }
.tax-review-payments .tax-payment-source > small { max-width: none; }
.tax-review-payments .tax-payment-source small { max-width: none; }
.tax-review-payments .tax-payment-info { top: 50%; transform: translateY(-50%); }
.tax-dialog-payments.tax-review-payments td.tax-payment-source:first-child > small { max-width: none; }

.tax-dialog-payments.tax-review-payments td.tax-payment-source:first-child > small { margin-top: 1px; }
.tax-review-payments .tax-payment-info { top: calc(50% - 11px); transform: none; }
.tax-payment-info.metric-info .form-help__content.is-viewport-positioned { position: fixed; left: var(--tooltip-left); top: var(--tooltip-top); right: auto; z-index: 50; }

.tax-payment-info:has(.form-help__trigger[aria-expanded="true"]), .tax-payment-info:hover, .tax-payment-info:focus-within { z-index: 60; }

.tax-payment-info .tooltip-opens-sideways::before { display: none; }

:is(.metric-card, .account-card) small .metric-currency { font-size: inherit; font-weight: inherit; }
.metric-card > .metric-subtitle--single-line { display: block; white-space: nowrap; max-height: none; font-size: clamp(10px, .85vw, 12px); }


.tax-metrics .metric-card { container-type: inline-size; }
.tax-metrics .metric-subtitle--single-line { font-size: 12px; }

/* Shared layout for all settings tabs. */
.settings-navigation { position: sticky; top: var(--app-toolbar-height); z-index: 25;  border-bottom: 1px solid var(--line); background: var(--surface); }
.settings-page { width: 100%; }
.settings-page {
  --settings-content-size: 16px;
  --settings-column-size: 11px;
  --settings-help-size: 12px;
  --settings-label-size: 10px;
}
/* Keep short tabs within the visible viewport, without clipping longer forms. */
.settings-panel {  overflow: hidden; }
.settings-form { display: grid; gap: 24px; margin: 0; }
.settings-form-section + .settings-form-section { border-top: 1px solid var(--line); padding-top: 24px; }
.settings-form-section h3 { margin: 0 0 15px; color: var(--navy-2); font-size: 16px; }
.settings-section-note { color: var(--muted); font-size: 13px; margin: 0 0 16px; }
.settings-single-field { max-width: 540px; }
.settings-info { display: grid; gap: 7px;  border: 1px solid var(--line);  background: var(--surface-2); }
.settings-info > span, .settings-info > small { color: var(--muted); font-size: 12px; }
.settings-info > strong { color: var(--navy-2); font-size: 19px; font-variant-numeric: tabular-nums; }
.settings-form .forecast-form-section { margin: 0; padding: 0; border: 0; }
.settings-form .forecast-form-section + .forecast-form-section { padding-top: 24px; }
.settings-form .payroll-calculation-table { margin-top: 24px; }
.settings-form .forecast-expense-columns { margin: 0 0 8px; }
.settings-form .forecast-expense-fallback { padding-top: 24px; border-top: 1px solid var(--line); }
.settings-form > p:first-of-type { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
@media (max-width: 760px) {
  .settings-form .data-form-grid { grid-template-columns: minmax(0, 1fr); }
}

.settings-save-status { color: var(--muted); font-size: 13px; }
[data-settings-retry][hidden] { display: none; }

/* Settings forms must shrink independently of horizontally scrollable results. */
.settings-section-body > *, .settings-form > *, .settings-form section { min-width: 0; }
.settings-mobile-select { display: none; }
.forecast-expense-label { display: none; }
@media (max-width: 620px) {
  .settings-save-status:empty { display: none; }
  .settings-form { gap: 20px; }
  .settings-form input:not([type=checkbox]):not([type=hidden]), .settings-form select { font-size: 16px; max-width: 100%; box-sizing: border-box; }
  .settings-form .payroll-rule-row { grid-template-columns: minmax(0, 1fr); padding: 14px 12px; gap: 12px; }
  .settings-form .payroll-rule-row > div, .settings-form .payroll-rule-row > .payroll-bvg-field { grid-column: 1; min-width: 0; }
  .settings-form .compact-number-field input { height: 44px; }
  .settings-form .payroll-rule-row > .compact-number-field:nth-child(2) input { flex: 0 1 120px; width: 120px; }
  .settings-form .compact-number-field--money input, .settings-form .payroll-bvg-field input { flex: 1 1 0; width: 0; min-width: 0; }
  .settings-form .payroll-calculation-table { max-width: 100%; overflow-x: auto; }
  .settings-form .forecast-expense-columns { display: none; }
  .settings-form .forecast-expense-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; padding-bottom: 16px; margin-bottom: 16px; }
  .settings-form .forecast-expense-row > .form-field { grid-column: 1 / -1; }
  .settings-form .forecast-expense-label { display: block; margin-bottom: 6px; }
  .settings-form .forecast-expense-row select, .settings-form .forecast-expense-row input:not([type=hidden]):not([type=checkbox]) { height: 44px; }
  .settings-form .forecast-expense-order { grid-column: 1; grid-row: 3; align-self: center; }
  .settings-form .forecast-expense-delete { grid-column: 2; grid-row: 3; align-self: center; justify-self: end; }
  .settings-form .forecast-expense-delete button {  font-size: 13px;  }
  .settings-form .forecast-expense-fallback { margin-top: 0; padding-top: 20px; }
  #income-settings-dates .forecast-form-section:first-child .data-form-grid { grid-template-columns: minmax(0, 1fr); }
  .settings-form .dividend-schedule-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; padding: 14px 12px; }
  .settings-form .dividend-schedule-row > label:not(.dividend-tax-check) { grid-column: 1; grid-row: 1; }
  .settings-form .dividend-schedule-row > span { grid-column: 2; grid-row: 1; }
  .settings-form .dividend-schedule-row > div:nth-child(2) { grid-column: 1 / -1; grid-row: 2; min-width: 0; }
  .settings-form .dividend-percent { grid-column: 1; grid-row: 3; min-width: 0; }
  .settings-form .dividend-percent input { flex: 1 1 0; width: 0; min-width: 0; }
  .settings-form .dividend-schedule-row > .dividend-tax-check { grid-column: 2; grid-row: 3; min-width: 0; font-size: 12px; }
  .settings-form .dividend-tax-check input { flex: 0 0 18px; }
  .settings-form .dividend-schedule-total { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .settings-form .dividend-schedule-total > strong:first-child, .settings-form .dividend-schedule-total > strong:last-child { grid-column: 1; }
}

@media (max-width: 620px) {
  .settings-form .payroll-rule-row > .payroll-bvg-field:nth-child(2) input { flex: 1 1 0; width: 0; }
  .settings-form .payroll-calculation-table table { min-width: 0; width: 100%; }
  .settings-form .payroll-calculation-table thead { display: none; }
  .settings-form .payroll-calculation-table tbody, .settings-form .payroll-calculation-table tr { display: block; }
  .settings-form .payroll-calculation-table tr { padding: 12px 0; border-bottom: 1px solid var(--line); }
  .settings-form .payroll-calculation-table td { display: block; padding: 6px 0; border: 0; white-space: normal; }
  .settings-form .payroll-calculation-table td:first-child { min-width: 0; }
  .settings-form .payroll-calculation-table td.numeric { display: flex; justify-content: space-between; gap: 12px; }
  .settings-form .payroll-calculation-table td.numeric::before { content: attr(data-label); color: var(--muted); font-size: 12px; }
}

.forecast-expense-remove-icon { display: none; }
@media (max-width: 620px) {
  .settings-form .forecast-expense-row { grid-template-columns: minmax(80px, 1fr) repeat(3, 44px); column-gap: 6px; }
  .settings-form .forecast-expense-row > .form-field:has(input) { display: contents; }
  .settings-form .forecast-expense-row > .form-field:has(input) > label { grid-column: 1 / -1; grid-row: 2; margin-bottom: 0; }
  .settings-form .forecast-expense-row > .form-field:has(input) > input { grid-column: 1; grid-row: 3; width: 100%; min-width: 0; padding-inline: 8px; }
  .settings-form .forecast-expense-row > .form-field:has(input) > .errorlist { grid-column: 1 / -1; }
  .settings-form .forecast-expense-order { display: contents; }
  .settings-form .forecast-expense-order button { grid-row: 3;   box-sizing: border-box; }
  .settings-form .forecast-expense-order button[data-expense-move="up"] { grid-column: 2; }
  .settings-form .forecast-expense-order button[data-expense-move="down"] { grid-column: 3; }
  .settings-form .forecast-expense-delete { grid-column: 4; grid-row: 3; }
  .settings-form .forecast-expense-delete button > span { display: none; }
  .settings-form .forecast-expense-remove-icon { display: block; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
}

@media (max-width: 620px) {
  .settings-form .payroll-rule-row:has(.compact-number-field--money) { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); column-gap: 8px; }
  .settings-form .payroll-rule-row:has(.compact-number-field--money) > div:first-child { grid-column: 1 / -1; }
  .settings-form .payroll-rule-row:has(.compact-number-field--money) > .compact-number-field:nth-child(2) { grid-column: 1; }
  .settings-form .payroll-rule-row:has(.compact-number-field--money) > .compact-number-field--money { grid-column: 2; }
  .settings-form .payroll-rule-row:has(.compact-number-field--money) > .compact-number-field:nth-child(2) input { flex: 1 1 0; width: 0; min-width: 0; }
  .settings-form .payroll-rule-row:has(.compact-number-field--money) .compact-number-field { gap: 5px; }
}

/* Responsive row layouts must preserve the table filter visibility state. */
.settings-form .payroll-calculation-table tr[hidden] { display: none; }

.settings-form .dividend-schedule-row > .dividend-tax-check { font-weight: 400; align-items: center; }
@media (max-width: 620px) {
  .settings-form .dividend-schedule-row > .dividend-tax-check { justify-content: flex-end; justify-self: stretch; gap: 6px; margin: 0; text-align: right; }
  .settings-form .dividend-tax-check input { margin: 0; }
  .settings-form .dividend-tax-mobile-label { font-weight: 400; line-height: 1.2; }
}

/* Shared destructive actions retain their confirmation and save behaviour. */
.danger-button { gap: 7px; }
.delete-action-icon { flex: 0 0 18px; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.document-remove-action { min-height: 40px; padding-inline: 10px; font-size: 13px; }
.transaction-split-remove, .delete-checkbox { color: var(--danger); }
.delete-checkbox input { accent-color: var(--danger); }
.forecast-expense-delete > label { color: var(--danger); }
.forecast-expense-delete > label input { accent-color: var(--danger); }
.forecast-expense-delete .danger-button { gap: 7px; }
@media (min-width: 621px) {
  .forecast-expense-remove-icon { display: block; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
}
@media (min-width: 621px) {
  .forecast-expense-columns, .forecast-expense-row { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) 83px 130px; }
}

.transaction-split-remove[hidden], .delete-checkbox[hidden], .split-removal-note[hidden] { display: none; }
.transaction-split-row.is-removed { display: flex; align-items: center; justify-content: space-between; }
.transaction-split-row.is-removed > .form-field { display: none; }
.split-removal-note { color: var(--muted); font-size: 13px; }
.transaction-split-row > [data-split-remove-button].danger-button { justify-self: end; }

@media (min-width: 621px) {
  .forecast-expense-columns, .forecast-expense-row { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) 83px 44px; }
  
}

.topbar-actions .cost-view > summary.secondary-button {  gap: 6px; }
.cost-view__panel { width: 270px; padding: 8px; }
.cost-view__panel fieldset { min-width: 0; margin: 0; padding: 8px 0; border: 0; }
.cost-view__panel fieldset + fieldset { border-top: 1px solid var(--line); }
.cost-view__panel legend { padding: 8px 10px 4px; color: var(--muted); font-size: 10px; font-weight: 400; letter-spacing: .12em; text-transform: uppercase; }
.cost-view__panel label { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 6px; color: var(--navy); cursor: pointer; font-size: 14px; font-weight: var(--tab-font-weight); }
.cost-view__panel label:hover, .cost-view__panel label:focus-within { background: var(--blue-soft); }
.cost-view__panel label:has(input:checked) { background: var(--blue-soft); }
.cost-view__panel label { position: relative; }
.cost-view__panel input { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); }
.cost-view__check { flex: 0 0 18px; color: var(--blue); visibility: hidden; }
.cost-view__panel input:checked + .cost-view__check { visibility: visible; }
.cost-view__panel label:has(input:focus-visible) { outline: 2px solid var(--blue); outline-offset: -2px; }
.cost-view__panel small { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; font-weight: 400; }

.cost-stack-month-grid .cost-stack-more-button { width: calc(100% - 10px); max-width: 98px; padding-inline: 5px; }
.cost-stack-year-grid { display: grid; grid-template-columns: repeat(var(--cost-month-count), minmax(0, 1fr)); margin-top: 12px; }
.cost-stack-year-grid > span { margin: 0 5px; padding: 4px 8px; border-radius: 3px; background: #eceff2; color: #526174; text-align: center; font-size: 13px; font-weight: 500; }

.cost-stack-more-button, .cost-stack-month-grid .cost-stack-more-button, .cost-stack-mobile-month .cost-stack-more-button { display: inline-flex; align-items: center; justify-content: center; gap: 5px; width: auto; min-height: 28px; padding: 4px 7px; font-size: 12px; line-height: 1; }
.cost-stack-more-button:disabled { visibility: hidden; }


.metric-card .metric-info__content--comparison .metric-info__value { font-weight: 400; }

.category-create-editor { width: min(480px, calc(100vw - 24px)); }
.category-create-link { padding: 6px 0; border: 0; background: transparent; color: var(--blue); text-align: left; font-size: 13px; }
.category-create-editor .form-field + .form-field { margin-top: 16px; }

.cost-monthly-panel .chart-legend .cost-stack-swatch { width: 12px; height: 12px; border-radius: 3px; background: var(--cost-stack-color); }
.cost-monthly-panel .chart-legend .cost-stack-swatch--savings { background: var(--positive-soft); }

.cost-stack-color-100 { --cost-stack-color: #17365f; fill: var(--cost-stack-color); background: var(--cost-stack-color); }
.cost-stack-color-101 { --cost-stack-color: #1e4776; fill: var(--cost-stack-color); background: var(--cost-stack-color); }
.cost-stack-color-102 { --cost-stack-color: #26578c; fill: var(--cost-stack-color); background: var(--cost-stack-color); }
.cost-stack-color-103 { --cost-stack-color: #30659a; fill: var(--cost-stack-color); background: var(--cost-stack-color); }
.cost-stack-color-104 { --cost-stack-color: #3b72a8; fill: var(--cost-stack-color); background: var(--cost-stack-color); }
.cost-stack-color-105 { --cost-stack-color: #477fb2; fill: var(--cost-stack-color); background: var(--cost-stack-color); }
.cost-stack-color-106 { --cost-stack-color: #548cba; fill: var(--cost-stack-color); background: var(--cost-stack-color); }
.cost-stack-color-107 { --cost-stack-color: #6399c1; fill: var(--cost-stack-color); background: var(--cost-stack-color); }
.cost-stack-color-108 { --cost-stack-color: #71a4c7; fill: var(--cost-stack-color); background: var(--cost-stack-color); }
.cost-stack-color-109 { --cost-stack-color: #7faecc; fill: var(--cost-stack-color); background: var(--cost-stack-color); }
.cost-stack-color-110 { --cost-stack-color: #8db8d2; fill: var(--cost-stack-color); background: var(--cost-stack-color); }
.cost-stack-color-111 { --cost-stack-color: #9bc2d8; fill: var(--cost-stack-color); background: var(--cost-stack-color); }
.cost-stack-color-112 { --cost-stack-color: #a9cbdd; fill: var(--cost-stack-color); background: var(--cost-stack-color); }
.cost-stack-color-113 { --cost-stack-color: #b8d4e2; fill: var(--cost-stack-color); background: var(--cost-stack-color); }
.cost-stack-color-114 { --cost-stack-color: #c9dfea; fill: var(--cost-stack-color); background: var(--cost-stack-color); }
.cost-stack-color-115 { --cost-stack-color: #dbeaf1; fill: var(--cost-stack-color); background: var(--cost-stack-color); }
.cost-stack-color-200 { --cost-stack-color: #747474; fill: var(--cost-stack-color); background: var(--cost-stack-color); }
.cost-stack-color-201 { --cost-stack-color: #9a9a9a; fill: var(--cost-stack-color); background: var(--cost-stack-color); }
.cost-stack-color-202 { --cost-stack-color: #bdbdbd; fill: var(--cost-stack-color); background: var(--cost-stack-color); }
.cost-stack-color-203 { --cost-stack-color: #dedede; fill: var(--cost-stack-color); background: var(--cost-stack-color); }
.cost-stack-color-204 { --cost-stack-color: #dedede; fill: var(--cost-stack-color); background: var(--cost-stack-color); }
.cost-stack-color-205 { --cost-stack-color: #dedede; fill: var(--cost-stack-color); background: var(--cost-stack-color); }
.cost-stack-color-206 { --cost-stack-color: #dedede; fill: var(--cost-stack-color); background: var(--cost-stack-color); }
.cost-stack-color-207 { --cost-stack-color: #dedede; fill: var(--cost-stack-color); background: var(--cost-stack-color); }
.cost-stack-color-208 { --cost-stack-color: #dedede; fill: var(--cost-stack-color); background: var(--cost-stack-color); }
.cost-stack-color-209 { --cost-stack-color: #dedede; fill: var(--cost-stack-color); background: var(--cost-stack-color); }
.cost-stack-color-210 { --cost-stack-color: #dedede; fill: var(--cost-stack-color); background: var(--cost-stack-color); }
.cost-stack-color-211 { --cost-stack-color: #dedede; fill: var(--cost-stack-color); background: var(--cost-stack-color); }
.cost-stack-color-212 { --cost-stack-color: #dedede; fill: var(--cost-stack-color); background: var(--cost-stack-color); }
.cost-stack-color-213 { --cost-stack-color: #dedede; fill: var(--cost-stack-color); background: var(--cost-stack-color); }
.cost-stack-color-214 { --cost-stack-color: #dedede; fill: var(--cost-stack-color); background: var(--cost-stack-color); }
.cost-stack-color-215 { --cost-stack-color: #dedede; fill: var(--cost-stack-color); background: var(--cost-stack-color); }
.cost-stack-color-300 { --cost-stack-color: #f4e6ca; fill: var(--cost-stack-color); background: var(--cost-stack-color); }
.cost-stack-color-301 { --cost-stack-color: #e2c58f; fill: var(--cost-stack-color); background: var(--cost-stack-color); }
.cost-stack-color-302 { --cost-stack-color: #f4e6ca; fill: var(--cost-stack-color); background: var(--cost-stack-color); }
.cost-stack-color-303 { --cost-stack-color: #e2c58f; fill: var(--cost-stack-color); background: var(--cost-stack-color); }
.cost-stack-color-304 { --cost-stack-color: #f4e6ca; fill: var(--cost-stack-color); background: var(--cost-stack-color); }
.cost-stack-color-305 { --cost-stack-color: #e2c58f; fill: var(--cost-stack-color); background: var(--cost-stack-color); }
.cost-stack-color-306 { --cost-stack-color: #f4e6ca; fill: var(--cost-stack-color); background: var(--cost-stack-color); }
.cost-stack-color-307 { --cost-stack-color: #e2c58f; fill: var(--cost-stack-color); background: var(--cost-stack-color); }
.cost-stack-color-308 { --cost-stack-color: #f4e6ca; fill: var(--cost-stack-color); background: var(--cost-stack-color); }
.cost-stack-color-309 { --cost-stack-color: #e2c58f; fill: var(--cost-stack-color); background: var(--cost-stack-color); }
.cost-stack-color-310 { --cost-stack-color: #f4e6ca; fill: var(--cost-stack-color); background: var(--cost-stack-color); }
.cost-stack-color-311 { --cost-stack-color: #e2c58f; fill: var(--cost-stack-color); background: var(--cost-stack-color); }
.cost-stack-color-312 { --cost-stack-color: #f4e6ca; fill: var(--cost-stack-color); background: var(--cost-stack-color); }
.cost-stack-color-313 { --cost-stack-color: #e2c58f; fill: var(--cost-stack-color); background: var(--cost-stack-color); }
.cost-stack-color-314 { --cost-stack-color: #f4e6ca; fill: var(--cost-stack-color); background: var(--cost-stack-color); }
.cost-stack-color-315 { --cost-stack-color: #e2c58f; fill: var(--cost-stack-color); background: var(--cost-stack-color); }
.cost-chart-row .cost-chart-track i.cost-category-color { background: var(--cost-stack-color); }

.cost-stack-tooltip-group { display: flex; justify-content: space-between; align-items: baseline; gap: 12px;  letter-spacing: .12em; text-transform: uppercase; margin: 9px 0 3px; padding-top: 6px; border-top: 1px solid var(--line);   }

.cost-chart-bar { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cost-category-dot { width: 10px; height: 10px; flex: 0 0 10px; border-radius: 50%; background: var(--cost-stack-color); box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); }
.cost-chart-bar .cost-chart-track { flex: 1; min-width: 0; }
.cost-chart-row .cost-chart-track i.cost-category-bar { background: var(--cost-stack-color); }

/* Uniform expense-group colours in the composition chart, including cached markup. */
.cost-category-panel .cost-chart-bar:is(.cost-stack-color-100, :has(.cost-category-dot[class*="cost-stack-color-1"])) { --cost-stack-color: #17365f; }
.cost-category-panel .cost-chart-bar:is(.cost-stack-color-200, :has(.cost-category-dot[class*="cost-stack-color-2"])) { --cost-stack-color: #bdbdbd; }
.cost-category-panel .cost-chart-bar:is(.cost-stack-color-300, :has(.cost-category-dot[class*="cost-stack-color-3"])) { --cost-stack-color: #e2c58f; }
.cost-category-panel .cost-chart-bar .cost-category-dot { --cost-stack-color: inherit; }

.cost-category-panel .cost-category-dot { display: none; }
.cost-category-panel .cost-composition-legend .cost-stack-color-200 { --cost-stack-color: #bdbdbd; }


.cost-category-panel .cost-chart-bar { background: transparent; }

.cost-category-panel .cost-composition-legend .cost-stack-color-300 { --cost-stack-color: #e2c58f; }

#savings-progress-chart { overflow-x: auto; margin-top: 18px; }
#savings-progress-chart > svg { display: block; width: 100%; min-width: 620px; }
.savings-progress-gradient-stop { stop-color: var(--flow-in); }
.savings-progress-line { fill: none; stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.savings-progress-line--planned { stroke: var(--navy-2); }
.savings-progress-line--actual { stroke: var(--flow-in); }
.savings-progress-point--planned { fill: var(--navy-2); }
.savings-progress-point--actual { fill: var(--flow-in); }
.savings-progress-zero { stroke: var(--line-strong); stroke-width: 1.5; }
.savings-progress-plan-swatch, .savings-progress-actual-swatch { display: inline-block; width: 18px; height: 3px; margin-right: 6px; vertical-align: middle; background: var(--blue); }
.savings-progress-actual-swatch { background: var(--flow-in); }
.savings-progress-values { margin-top: 10px; }
.savings-progress-values > summary { display: flex; align-items: center; gap: 2px; list-style: none; color: var(--muted); font-size: 12px; cursor: pointer; }
.savings-progress-values > summary::-webkit-details-marker { display: none; }
.savings-progress-values[open] > .table-scroll { margin-top: 16px; }
.savings-progress-panel .chart-legend i.savings-progress-plan-swatch { width: 18px; height: 0; border-top: 3px solid var(--navy-2); border-radius: 0; background: transparent; }
.savings-progress-panel .chart-legend i.savings-progress-actual-swatch { width: 18px; height: 3px; border-radius: 0; background: var(--flow-in); }

.savings-progress-hit { fill: transparent; cursor: var(--chart-hover-cursor); }
.savings-progress-hit:focus-visible { outline: none; stroke: var(--navy-2); stroke-width: 2; }
.savings-progress-tooltip { position: fixed; z-index: 100; width: max-content; max-width: calc(100vw - 16px); padding: 12px 14px; border: 1px solid var(--line); border-radius: 6px; background: white; box-shadow: 0 6px 22px rgba(11,31,58,.15);   pointer-events: none; box-sizing: border-box; }
.savings-progress-tooltip[hidden] { display: none; }
.savings-progress-tooltip > strong { display: block; margin-bottom: 8px;  }
.savings-progress-tooltip > div { display: flex; justify-content: space-between; gap: 18px; padding: 3px 0; }
.savings-progress-tooltip b {  font-variant-numeric: tabular-nums; text-align: right; }

.savings-progress-panel .summary-facts { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.savings-progress-panel .summary-facts > div { border-top: 0; border-left: 1px solid var(--line); }
.savings-progress-panel .summary-facts > div:first-child { border-left: 0; }
.savings-progress-panel .summary-facts dd { white-space: normal; overflow-wrap: anywhere; }

.savings-progress-panel { margin-bottom: 24px; }

.savings-progress-panel .chart-legend { display: flex; flex-direction: row; align-items: center; justify-content: flex-start; flex-wrap: wrap; gap: 8px 16px; line-height: 1.4; }
.savings-progress-panel .chart-legend > span { justify-content: flex-start; white-space: nowrap; }
.savings-progress-panel .chart-legend i { flex: 0 0 18px; margin-right: 0; }

.savings-progress-panel .chart-legend > .chart-unit { order: 1; margin-left: auto; margin-bottom: 0; }

/* Shared Lucide chevron for content disclosures, including generated table filters. */
details:not(.notification-menu):not(.cost-settings) > summary {
  display: flex; align-items: center; justify-content: flex-start; gap: 2px; list-style: none;
}
details:not(.notification-menu):not(.cost-settings) > summary::-webkit-details-marker { display: none; }
details:not(.notification-menu):not(.cost-settings) > summary::before,
.cost-chart-more-summary::before {
  content: ""; display: block; flex: 0 0 16px; width: 16px; height: 16px; background: currentColor;
  -webkit-mask: url("disclosure-chevron.2ed122888b7c.svg") center / contain no-repeat;
  mask: url("disclosure-chevron.2ed122888b7c.svg") center / contain no-repeat;
  transition: transform .15s ease;
}
details:not(.notification-menu):not(.cost-settings)[open] > summary::before,
.cost-chart-more-summary[aria-expanded="true"]::before { transform: rotate(90deg); }
.valuation-editor > summary::after, .valuation-editor[open] > summary::after,
.table-tools-summary::after, .table-tools--collapsible[open] .table-tools-summary::after,
.cost-chart-more-summary::after { content: none; }
:is(.valuation-editor, .sale-details, .calculation-details) > summary > span:last-child { margin-left: auto; }
.valuation-editor > summary > span:first-child { color: var(--navy-2); font-weight: var(--text-emphasis-weight); }
.cost-chart-more-summary { gap: 2px; }

.savings-progress-values td.savings-progress-delta { font-weight: 700; }

 .savings-target-table { width: 100%; min-width: 680px; table-layout: fixed; }
.savings-target-table .savings-target-month { width: 16%; }
.savings-target-table .savings-target-value { width: 14%; }
.savings-target-table th, .savings-target-table td { padding-left: 16px; padding-right: 16px; }
.savings-target-table th.numeric, .savings-target-table td.numeric { text-align: center; font-variant-numeric: tabular-nums; white-space: nowrap; }
.savings-target-table caption { text-align: left; padding: 0 0 12px; }
.savings-target-table thead .savings-target-group { text-align: center; font-weight: 600; border-left: 1px solid var(--line); border-bottom: 0; padding-top: 8px; padding-bottom: 3px; }
.savings-target-table thead tr:nth-child(2) th { border-top: 0; padding-top: 3px; padding-bottom: 8px; }
.savings-target-table .savings-target-start,
.savings-target-table tbody td:nth-child(2),
.savings-target-table tbody td:nth-child(4),
.savings-target-table tbody td:nth-child(6) { border-left: 1px solid var(--line); }

.savings-target-table thead th, .savings-target-table tbody td:first-child { text-align: center; }
.savings-target-table caption { text-align: center; }

@media (max-width: 600px) {
  .savings-progress-panel .summary-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .savings-progress-panel .summary-facts > div:nth-child(odd) { border-left: 0; }
  .savings-progress-panel .summary-facts > div:nth-child(n+3) { border-top: 1px solid var(--line); }
}

/* Einheitliche äussere Seiten- und Boxabstände. */
main.page-shell {
  --page-box-gap: 24px;
  display: flex; flex-direction: column; gap: var(--page-box-gap);
  
  
}
main.page-shell > :not(dialog):not(script):not(style) { margin-top: 0 !important; margin-bottom: 0 !important; }
.page-stack { display: flex; flex-direction: column; gap: var(--page-box-gap); min-width: 0; }
.page-stack > :not(dialog):not(script):not(style) { margin-top: 0; margin-bottom: 0; }
main.page-shell :is(.metric-grid, .card-grid, .chart-grid, .dashboard-grid, .tax-grid) { gap: var(--page-box-gap); }
main.page-shell :is(.chart-grid, .dashboard-grid, .tax-grid) > .panel { margin-top: 0; margin-bottom: 0; }
@media (max-width: 600px) {
  main.page-shell { --page-box-gap: 16px; }
}
.dashboard-grid--summary .dashboard-change-panel { grid-column: 1 / -1; grid-row: 1;  }
@media (max-width: 640px) {
}
.change-value--positive { color: var(--positive); }
.dashboard-grid--summary .dashboard-entity-panel { grid-column: 1; grid-row: 2; }
.dashboard-grid--summary .dashboard-tax-panel { grid-column: 2; grid-row: 2; }
:is(.change-period-tools select, .chart-category-select) {   height: 34px; padding: 4px 26px 4px 10px; border: 1px solid var(--line); border-radius: 6px; -webkit-appearance: none; appearance: none; background: var(--surface) var(--select-chevron-image) no-repeat right 8px center / 14px 14px; color: var(--navy-2); font-size: 14px; line-height: 1.4; }
.change-period-result > span { color: var(--muted); font-size: 14px; line-height: 1.4; }
.change-period-result > span.change-value--positive { color: var(--positive-soft); }
.change-period-result > span.negative { color: var(--danger-soft); }
.change-waterfall-scroll { overflow-x: auto; }
#change-waterfall { display: block; width: 100%; min-width: 820px; }
.change-grid { stroke: var(--line); stroke-width: 1; }
.change-zero { stroke: var(--line-strong); stroke-width: 1.5; }
.change-axis { fill: var(--muted); font-size: var(--chart-axis-font-size); }
.change-value { fill: var(--navy-2); font-size: var(--chart-value-font-size); font-weight: var(--chart-value-font-weight); }
.change-bar-positive { fill: var(--positive-soft); }
.change-bar-negative { fill: var(--danger-soft); }
.change-bar-total { fill: var(--navy-2); }
.change-bar-zero { fill: var(--line-strong); }
.change-connector { stroke: var(--line-strong); stroke-dasharray: 3 3; }
.dashboard-tax-accrual { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.dashboard-tax-accrual .dashboard-tax-coverage-track span { background: var(--navy-3); }
@media (max-width: 1100px) {
 .dashboard-grid--summary .dashboard-change-panel { grid-column: 1; grid-row: 1; order: 0; }
 .dashboard-grid--summary .dashboard-entity-panel { grid-column: 1; grid-row: 2; order: 1; }
 .dashboard-grid--summary .dashboard-tax-panel { grid-column: 1; grid-row: 3; order: 2; }
}

/* Shared KPI size and aligned tax progress rows. */
.dashboard-tax-panel .dashboard-tax-coverage-heading > div:last-child strong { font-size: 24px; line-height: 1.2; font-weight: 700; font-variant-numeric: tabular-nums; }
.dashboard-tax-panel .dashboard-tax-coverage-heading { align-items: flex-start; margin-bottom: 16px; }
.dashboard-tax-progress-title { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 8px; color: var(--muted); font-size: 11px; }
.dashboard-tax-progress-title strong { flex-shrink: 0; font-weight: 700; }
.dashboard-tax-panel .dashboard-tax-coverage-labels { margin-top: 8px; }
.dashboard-tax-panel .dashboard-tax-accrual { margin-top: 24px; padding-top: 20px; }
.dashboard-tax-panel .dashboard-tax-coverage-heading span,
.dashboard-tax-panel .dashboard-tax-progress-title,
.dashboard-tax-panel .dashboard-tax-coverage-labels { font-size: 13px; line-height: 1.45; }
.dashboard-entity-panel { display: flex; flex-direction: column; }
.dashboard-entity-panel > .panel-heading { flex-shrink: 0; margin-bottom: 16px; }
/* The table fills only the space remaining below the heading. A 100%
   height also counts the heading and makes the last row overflow the panel. */
.dashboard-entity-panel .entity-comparison { flex: 1 0 auto; height: auto; margin: 0; border-spacing: 0 10px; }
.dashboard-entity-panel .entity-comparison thead { height: 32px; }
.dashboard-entity-panel .entity-comparison tbody :is(th, td) { padding: 14px 10px; vertical-align: middle; }
.dashboard-entity-panel .entity-comparison tbody tr:last-child :is(th, td) { background: var(--surface-3); }
@media (max-width: 1100px) {
  .dashboard-entity-panel .entity-comparison { height: auto; }
}

:is(.secondary-button, .icon-button, .chart-settings-button):hover,
:is(.secondary-button, .icon-button, .chart-settings-button):focus-visible { border-color: var(--navy-2); }
:is(.secondary-button, .icon-button, .chart-settings-button):focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
:is(.secondary-button, .icon-button, .chart-settings-button):hover,
:is(.secondary-button, .icon-button, .chart-settings-button):focus-visible { background: var(--blue-soft); border-color: var(--navy-2); }

/* Compact summary cards: natural content height and fixed spacing. */
@media (min-width: 1101px) {
  .dashboard-grid--summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.dashboard-grid--summary :is(.dashboard-entity-panel, .dashboard-tax-panel) { display: block; align-self: start; padding: 24px; }
.dashboard-entity-panel > .panel-heading {  margin-bottom: 16px; }
.summary-panel-subtitle { margin: 6px 0 0;    }
.dashboard-entity-panel .entity-comparison { height: auto; margin: 0; border-spacing: 0 8px; }
.dashboard-entity-panel .entity-comparison thead { height: auto; }
.dashboard-entity-panel .entity-comparison tbody :is(th, td) { padding: 10px; }
.dashboard-tax-panel .dashboard-tax-coverage { display: block; height: auto; margin: 0; }
.dashboard-tax-panel .dashboard-tax-coverage-heading { margin-bottom: 16px; }
.dashboard-tax-panel .dashboard-tax-accrual { margin-top: 24px; padding-top: 20px; }
@media (max-width: 620px) {
  .dashboard-grid--summary :is(.dashboard-entity-panel, .dashboard-tax-panel) { padding: 19px; }
}

/* One shared badge for extracted currency units in chart and panel headings. */
.currency-badge { flex: 0 0 auto; align-self: flex-start; }

.panel-heading :has(> .currency-badge) > .chart-range-switch { order: 1; margin-left: auto; }
.panel-heading :has(> .chart-range-switch) > .currency-badge { order: 0; }
.savings-progress-values > summary { display: flex; align-items: center; gap: 10px; }
.property-settings, .property-proposal { margin-top: 20px; }
.property-settings > summary, .property-proposal > summary { cursor: pointer; color: var(--navy-2); font-weight: 650; }
.property-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 24px; margin-top: 20px; }
.property-proposal { padding-top: 16px; border-top: 1px solid var(--line); }
.property-proposal form { margin-top: 16px; }
.property-settings .form-stack { max-width: 680px; margin-top: 20px; }
@media (max-width: 900px) {
 .property-form-grid { grid-template-columns: 1fr; } }

.property-setup-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 24px; }
.property-setup-form > p { margin: 0; }
.property-setup-form > button { justify-self: start; grid-column: 1 / -1; }
@media (max-width: 700px) { .property-setup-form { grid-template-columns: 1fr; } }

.property-form-grid > .form-stack { align-content: start; margin-top: 0; }
.property-form-grid > .form-stack > button { justify-self: start; align-self: start; }
.property-form-grid .property-category-options { max-height: 280px; overflow-y: auto; padding: 12px; border: 1px solid var(--line); border-radius: 6px; }
.property-form-grid .property-category-options label { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 400; }
.property-form-grid .property-category-options > div + div { margin-top: 8px; }

.expense-plan-items { margin: 16px 0 24px; }
.expense-plan-items summary.cost-chart-row { grid-template-columns: minmax(150px, 1fr) minmax(100px, 2fr) max-content; column-gap: 24px; cursor: pointer; padding: 7px 0; }
.expense-plan-items .cost-chart-label { white-space: normal; overflow: visible; }
.expense-plan-origin { padding: 12px 0 20px; }
.expense-plan-origin table td { white-space: normal; }
@media (max-width: 600px) { .expense-plan-items summary.cost-chart-row { grid-template-columns: minmax(0, 1fr) max-content; gap: 6px 12px; } .expense-plan-items .cost-chart-value strong { grid-column: 2; grid-row: 1; } }

/* Expense planning uses one fixed column grid and unpainted bar wrappers. */
.expense-plan-header-tools { display: flex; align-items: center; gap: 16px; }
.expense-plan-header-tools .currency-badge { align-self: center; }
.expense-plan-totals { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; margin-bottom: 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2); }
.expense-plan-totals > div { display: grid; gap: 3px; padding: 9px 13px; line-height: 1.2; }
.expense-plan-totals > div + div { border-left: 1px solid var(--line); }
.expense-plan-totals span { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .025em; }
.expense-plan-totals strong { color: var(--navy-2); font-size: 21px; font-variant-numeric: tabular-nums; }
.expense-plan-items { display: grid; gap: 0; }
.expense-plan-row { display: grid; grid-template-columns: minmax(150px, 26%) minmax(0, 1fr) 80px; align-items: center; gap: 14px; min-height: 29px; padding: 3px 0; cursor: pointer; list-style: none; }
.expense-plan-row::-webkit-details-marker { display: none; }
.expense-plan-label { color: var(--ink); font-size: 14px; font-weight: 400; line-height: 1.3; }
.expense-plan-track { display: block; width: 100%; height: 10px; border-radius: 999px; overflow: hidden; background: var(--surface-3); }
.expense-plan-track i { display: block; height: 100%; min-width: 2px; border-radius: 999px; background: var(--navy-3); }
.expense-plan-amount { text-align: right; color: var(--navy-2); font-size: 14px; font-weight: 450; font-variant-numeric: tabular-nums; }
.expense-plan-row:hover .expense-plan-label, .expense-plan-items details[open] .expense-plan-label { color: var(--blue); }
.expense-plan-row:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 4px; }
@media (max-width: 600px) { .expense-plan-row { grid-template-columns: minmax(0, 1fr) 96px; gap: 8px 16px; } .expense-plan-track { grid-column: 1 / -1; grid-row: 2; } .expense-plan-amount { grid-column: 2; grid-row: 1; } .expense-plan-totals { gap: 0; } .expense-plan-totals strong { font-size: 21px; } }

.expense-breakdown-dialog .asset-editor__header { padding: 16px 22px; }
.expense-breakdown-dialog .asset-editor__panel { padding: 16px 22px 20px; }
.expense-breakdown-dialog .asset-editor__panel > .help-text { margin-bottom: 8px; }

.expense-breakdown-dialog { width: min(820px, calc(100vw - 36px)); }

.expense-plan-header-tools .expense-plan-info { position: relative; top: auto; right: auto; }

.expense-plan-row { grid-template-columns: minmax(220px, max-content) minmax(80px, 1fr) 80px; }
.expense-plan-label { white-space: nowrap; }
@media (max-width: 600px) { .expense-plan-row { grid-template-columns: minmax(0, 1fr) 80px; } .expense-plan-label { font-size: 13px; } }

.wealth-chart-config-header, .wealth-chart-config-row { grid-template-columns: 120px minmax(140px, 1fr) minmax(180px, 1.5fr) 42px 88px; }
.chart-visibility-button { display:flex; align-items:center; justify-content:center; border:1px solid var(--line); border-radius:5px; cursor:pointer; }
.chart-visibility-button .visibility-icon-off { display:none; }
input:checked + .chart-visibility-button .visibility-icon-on, .chart-visibility-button[aria-pressed="true"] .visibility-icon-on { display:none; }
input:checked + .chart-visibility-button .visibility-icon-off, .chart-visibility-button[aria-pressed="true"] .visibility-icon-off { display:block; }
input:checked + .chart-visibility-button { color:var(--muted); background:var(--surface-2); }
input:focus-visible + .chart-visibility-button { outline:2px solid var(--accent); }

@media (max-width: 900px) { .wealth-chart-config-header { display:none; } .wealth-chart-config-row { grid-template-columns: minmax(0,1fr) 42px 88px; } .wealth-chart-config-kind, .wealth-chart-config-title, .wealth-chart-config-row > label { grid-column:1; } .wealth-chart-config-row > .wealth-chart-config-order { grid-row:3; } }

.property-journal-table { min-width: 900px; width:100%; table-layout:fixed; }
.property-journal-table th:nth-child(1) { width:12%; }
.property-journal-table th:nth-child(2) { width:27%; }
.property-journal-table th:nth-child(3) { width:14%; }
.property-journal-table th:nth-child(4) { width:11%; }
.property-journal-table th:nth-child(5) { width:14%; }
.property-journal-table th:nth-child(6) { width:13%; }
.property-journal-table th:nth-child(7) { width:9%; }
.property-journal-table :is(th,td) { padding:12px 10px;  line-height:1.45; }
.property-journal-table th { font-size: var(--table-header-font-size); white-space:nowrap; }
.property-journal-table td { vertical-align:top; }
.property-journal-table td small { display:block; margin-top:3px; color:var(--muted); font-size:11px; }
.property-journal-date, .property-journal-table .numeric { white-space:nowrap; }
.property-journal-title { display:block; font-weight:500; }
.property-journal-value { font-weight:600; }
.property-journal-evidence { margin-top:4px; }
.property-journal-evidence summary, .property-journal-reverse summary { cursor:pointer; color:var(--accent); font-size:12px; white-space:nowrap; }
.property-journal-evidence-body { margin-top:8px; padding:10px; border-radius:5px; background:var(--surface-2); color:var(--muted); font-size:12px; overflow-wrap:anywhere; }
.property-journal-evidence-body p { margin:6px 0 0; }
.property-journal-reverse form { margin-top:8px; }

.dashboard-change-panel .change-period-tools {  flex-shrink:0; }


.property-page, .property-page > *, .property-summary-pair > * { min-width: 0; max-width: 100%; }
.property-page .table-scroll { min-width: 0; max-width: 100%; overscroll-behavior-x: contain; }
.property-overview-section .panel-heading { margin-bottom:18px; }
.property-facts { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:24px; }
.property-facts > div { display:flex; flex-direction:column; gap:5px; }
.property-facts span { color:var(--muted); font-size:12px; }
.property-facts strong { font-size:25px; font-weight:600; color:var(--navy-2); line-height:1.3; }
.property-facts small { color:var(--muted); font-size:11px; }
.property-facts .money-kpi__currency { font-size:12px; }
.property-investment-total { display:flex; align-items:center; gap:20px; flex-shrink:0; }
.property-investment-total > strong { font-size:25px; color:var(--navy-2); font-weight:600; }
.property-journal-heading { font-size:14px; margin:20px 0 10px; font-weight:500; }
.property-dialog h3 { margin-top:24px; font-size:16px; }
.property-dialog .table-scroll { margin-top:12px; }
@media (max-width:700px) { .property-facts { grid-template-columns:1fr; gap:18px; } .property-investment-total { flex-wrap:wrap; gap:12px; } }

.property-evidence-button { border:0; background:none; padding:0; margin-top:4px; color:var(--accent); font:inherit; font-size:12px; cursor:pointer; }

.property-journal-table .property-journal-reverse { margin:0; }
.property-evidence-meta { margin:18px 0; }
.property-evidence-meta > div { display:grid; grid-template-columns:100px minmax(0,1fr); gap:12px; margin:10px 0; font-size:13px; }
.property-evidence-meta dt { color:var(--muted); }
.property-evidence-meta dd { margin:0; }
.property-evidence-note { border-top:1px solid var(--line); padding-top:14px; }
.property-evidence-note h3 { margin:0 0 6px; font-size:13px; font-weight:500; }
.property-evidence-note p { margin:0; }


/* Compact investment ledger with room for evidence and actions. */
.property-journal-table { min-width:980px; }
.property-journal-table th:nth-child(1) { width:11%; }
.property-journal-table th:nth-child(2) { width:25%; }
.property-journal-table th:nth-child(3) { width:12%; }
.property-journal-table th:nth-child(4) { width:10%; }
.property-journal-table th:nth-child(5) { width:14%; }
.property-journal-table th:nth-child(6) { width:17%; }
.property-journal-table th:nth-child(7) { width:11%; }
:is(.property-journal-table, .valuation-table) :is(th,td) { padding:8px 10px;  line-height:1.3; }
.property-journal-table td { vertical-align:middle; }
.property-journal-table td small { margin-top:2px; line-height:1.3; }
.property-journal-table td:nth-child(6) small { white-space:nowrap; }
.property-journal-table .property-evidence-button { margin-top:2px; line-height:1.3; }
.property-journal-table .table-action-button {     white-space:nowrap; }
.property-investments-section .property-journal-heading { margin:14px 0 8px; }
.property-dialog > .asset-editor__shell > .asset-editor__actions { position:static; bottom:auto; margin:0; padding:16px 24px; flex-shrink:0; }


.property-investment-edit .property-fields { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px 20px; }
.property-investment-edit .form-field { min-width:0; }
.property-investment-edit .form-field label { font-size:12px; font-weight:500; }
.property-investment-edit .form-field :is(input,select,textarea) { width:100%; box-sizing:border-box; }
.property-investment-edit .property-field--description, .property-investment-edit .property-field--note { grid-column:1 / -1; }
.property-investment-edit .asset-editor__actions { margin:0; padding:16px 24px; }
.property-investment-edit .asset-editor__actions form { margin-right:auto; }
@media(max-width:480px) { .property-investment-edit .property-fields { grid-template-columns:1fr; } }

.property-summary-pair { display:grid; grid-template-columns:repeat(2,minmax(0,1fr));  align-items:stretch; }
.property-summary-pair .property-overview-section .panel-heading {     margin-bottom:16px; }
.property-summary-pair .chart-intro { margin-top:4px;   }
.property-summary-pair .property-section-actions { display:flex; align-items:center; gap:10px; }
.property-summary-icon { display:flex; align-items:center; justify-content:center; flex-shrink:0; width:56px; height:56px; color:var(--blue); }
.property-summary-icon svg { width:36px; height:36px; }
.property-summary-tiles { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px 16px; }
.property-summary-tile { display:grid; align-content:start; gap:4px; min-width:0; }
.property-summary-tile > span:not(.property-summary-icon) { color:var(--muted); font-size:12px; line-height:1.5; }
.property-summary-tile > strong { color:var(--navy-2); font-size:19px; font-weight:var(--metric-value-font-weight); line-height:1.25; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
.property-summary-tile > small { color:var(--muted); font-size:11px; line-height:1.5; }
.property-summary-tile--main { grid-column:1 / -1; padding-bottom:14px; border-bottom:1px solid var(--line); }
.property-summary-tiles--value { --property-summary-accent:var(--green); }
.property-summary-tiles--debt { --property-summary-accent:var(--danger-chart); }
.property-summary-tile--main > strong { font-size:28px; letter-spacing:-.025em; color:var(--property-summary-accent, var(--blue)); }
.property-summary-tile--main > .property-summary-icon { color:var(--property-summary-accent, var(--blue)); }
.property-summary-tile:not(.property-summary-tile--main) > :is(strong,.property-summary-icon) { color:color-mix(in srgb, var(--property-summary-accent, var(--blue)) 65%, white); }
.property-summary-tile:has(> .property-summary-icon) { grid-template-columns:56px minmax(0,1fr); column-gap:12px; }
.property-summary-tile > .property-summary-icon { grid-column:1; grid-row:1 / 3; align-self:center; }
.property-summary-tile:has(> .property-summary-icon) > span:not(.property-summary-icon) { grid-column:2; align-self:center; }
.property-summary-tile > :is(strong,small) { grid-column:1 / -1; }
.property-summary-tile:has(> .property-summary-icon) > :is(strong,small) { grid-column:2; }
/* The main icon spans the actual label/value rows, including text resizing. */
.property-summary-tile--main > .property-summary-icon { position:relative; height:auto; min-height:0; align-self:stretch; }
.property-summary-tile--main .property-summary-icon svg { position:absolute; inset:0; width:100%; height:100%; }
@media(max-width:760px) { .property-summary-pair { grid-template-columns:1fr; } }
@media(max-width:480px) { .property-summary-tiles { grid-template-columns:1fr; gap:12px; } }
@media(max-width:420px) {
  .property-summary-tile > strong { font-size:18px; }
  .property-summary-tile--main > strong { font-size:26px; }
}

/* Shared cursor convention for controls and chart tooltip targets. */
a[href], summary, select:not(:disabled), input:is([type="checkbox"], [type="radio"], [type="range"]):not(:disabled),
[role="button"]:not([aria-disabled="true"]), [role="tab"]:not([aria-disabled="true"]), svg [tabindex="0"] { cursor: pointer; }
svg [tabindex="0"] { cursor: var(--chart-hover-cursor); }
button:disabled, input:disabled, select:disabled, textarea:disabled, [aria-disabled="true"] { cursor: default; }

.property-journal-table { table-layout:fixed; min-width:880px; }
.property-journal-table th:nth-child(1) { width:11%; }
.property-journal-table th:nth-child(2) { width:21%; }
.property-journal-table th:nth-child(3) { width:12%; }
.property-journal-table th:nth-child(4) { width:10%; }
.property-journal-table th:nth-child(5) { width:14%; }
.property-journal-table th:nth-child(6) { width:15%; }
.property-journal-table th:nth-child(7) { width:17%; }
.property-journal-table th, .property-journal-table th button { white-space:normal; overflow-wrap:normal; hyphens:auto; }
.property-journal-table .property-journal-description { overflow-wrap:anywhere; }
.property-journal-table td:nth-child(6) small { white-space:normal; }
.property-journal-actions { display:flex; align-items:center; justify-content:flex-end; gap:6px; }
.property-journal-actions .property-evidence-icon { flex:0 0 30px; width:30px; height:30px; padding:5px; }
.property-evidence-icon svg { display:block; }

.property-evidence-dialog > .asset-editor__shell > .asset-editor__actions { margin:0; padding:16px 24px; flex-shrink:0; }
.property-evidence-dialog .property-evidence-meta a { display:inline-flex; align-items:center; gap:7px; color:var(--blue); font-weight:600; text-decoration:underline; text-underline-offset:3px; }
.property-evidence-dialog .property-evidence-meta a:hover { color:var(--navy-2); }

.property-journal-table th:last-child { text-align:left; }
.property-journal-table th:last-child button { justify-content:flex-start; text-align:left; }

.property-journal-actions { justify-content:flex-start; }

/* Anchor the fixed action group to the right cell inset at every width. */
.property-journal-table { --property-action-width:118px; }
.property-journal-table th:last-child, .property-journal-table td:last-child { padding-right:10px; }
.property-journal-table th:last-child button,
.property-journal-actions { width:var(--property-action-width); max-width:none; margin-left:auto; }
.property-journal-table th:last-child button { display:flex; justify-content:flex-start; }
.property-journal-actions { justify-content:flex-end; }


/* All disclosures use the shared Lucide asset; icon-only menus retain their icon. */
summary { list-style: none; cursor: pointer; }
summary::-webkit-details-marker { display: none; }
summary::marker { content: ""; }
.cost-amount-button::after {
  content: ""; display: inline-block; width: 16px; height: 16px; vertical-align: middle;
  background: currentColor; -webkit-mask: url("disclosure-chevron.2ed122888b7c.svg") center / contain no-repeat;
  mask: url("disclosure-chevron.2ed122888b7c.svg") center / contain no-repeat; transform: rotate(90deg);
}
.cost-amount-button[aria-expanded="true"]::after { transform: rotate(-90deg); }
.property-change-history { margin-top: 20px; }
.property-change-history > summary { gap: 6px; min-height: 36px; color: var(--blue); }
.property-change-history[open] > summary { margin-bottom: 12px; }
@media (prefers-reduced-motion: reduce) {
  details > summary::before, .cost-amount-button::after { transition: none; }
}
.cost-currency-panel > .panel-heading > .chart-intro {   margin: 0; }
.cost-currency-panel .cost-heading-tools > .chart-unit, .cost-currency-panel .cost-heading-tools > span { order: 0; margin: 0; white-space: nowrap; }
.cost-currency-panel .cost-composition-legend { flex-wrap: nowrap; white-space: nowrap; }


#cost-composition { scroll-margin-top: 110px; }
#cost-composition .expense-plan-row { display: grid; grid-template-columns: minmax(220px, 26%) minmax(80px, 1fr) 80px; gap: 14px; list-style: none; }
#cost-composition .expense-plan-row::before, #cost-composition .expense-plan-row::after { display: none; }
#cost-composition .expense-plan-origin { max-height: 420px; overflow: auto; }
#cost-composition .expense-plan-calculation { margin-top: 18px; }
@media (max-width: 600px) { #cost-composition .expense-plan-row { grid-template-columns: minmax(0, 1fr) 80px; } }

#cost-composition .expense-plan-track.cost-stack-color-100 { --cost-stack-color: #17365f; background: var(--surface-3); }
#cost-composition .expense-plan-track.cost-stack-color-200 { --cost-stack-color: #bdbdbd; background: var(--surface-3); }
#cost-composition .expense-plan-track i { background: var(--cost-stack-color); }


.expense-plan-chart-item { display: contents; }
.expense-plan-chart-item > summary.cost-chart-row { display: grid; grid-template-columns: subgrid; cursor: pointer; list-style: none; padding: 0; }
.expense-plan-chart-item > summary.cost-chart-row::before, .expense-plan-chart-item > summary.cost-chart-row::after { display: none; }
.expense-plan-chart-item > summary::-webkit-details-marker { display: none; }
.expense-plan-chart-item > .expense-plan-origin { grid-column: 1 / -1; }
#cost-composition .expense-plan-chart-item > summary.cost-chart-row { display: grid; grid-template-columns: subgrid; padding: 0; }
#cost-composition .expense-plan-chart-item > summary.cost-chart-row::before, #cost-composition .expense-plan-chart-item > summary.cost-chart-row::after { display: none; }
#cost-composition .expense-plan-chart-item > summary.cost-chart-row { column-gap: 24px; min-height: 36px; }

:is(.topbar-tabs, .section-tabs, .share-class-table-tabs, .asset-editor__tabs) > :is(a, button) { min-height: 32px; padding: 0 12px; }
#cost-composition .cost-composition-title-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
#cost-composition .cost-composition-title-row .section-tabs { margin: 0; flex: 0 0 auto; width: max-content; }
#cost-composition .cost-chart-rows { row-gap: 2px; }
#cost-composition .cost-chart-row, #cost-composition .expense-plan-chart-item > summary.cost-chart-row { min-height: 28px; }
@media (max-width: 700px) {
 #cost-composition .cost-composition-title-row { gap: 10px; }
 #cost-composition .cost-chart-row, #cost-composition .expense-plan-chart-item > summary.cost-chart-row { min-height: 44px; grid-template-columns: minmax(0, 1fr) 118px; gap: 3px 10px; }
 #cost-composition .cost-composition-legend { flex-wrap: wrap; white-space: normal; }
}
@media (max-width: 700px) { #cost-composition { scroll-margin-top: 190px; } }
#cost-composition .cost-heading-tools .chart-range-switch { margin: 0; }
#cost-composition > .cost-composition-legend { justify-content: flex-end; margin: 0 0 12px; }


/* Expandable planning categories share a full-width detail surface. */
#cost-composition .expense-plan-chart-item { display: grid; grid-column: 1 / -1; grid-template-columns: subgrid; }
#cost-composition .expense-plan-chart-item > summary { grid-column: 1 / -1; border-radius: 6px; transition: background-color .15s ease; }
#cost-composition .expense-plan-chart-item > summary:hover { background: #faf3e6; }
#cost-composition .expense-plan-chart-item > summary:focus-visible { outline: 2px solid var(--primary, #17365e); outline-offset: 2px; }
#cost-composition .expense-plan-chart-item[open] > summary { background: #faf3e6; box-shadow: inset 3px 0 #17365e; }
#cost-composition .expense-plan-chart-item .cost-chart-label { display: flex; align-items: center; gap: 9px; padding-left: 16px; }
#cost-composition .expense-plan-origin { grid-column: 1 / -1; max-height: none; overflow: visible; margin: 5px 0 10px; padding: 16px 18px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2, #f5f7fa); }
#cost-composition .expense-plan-chart-item:not([open]) > .expense-plan-origin { display: none; }
.expense-plan-origin-heading { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; }
.expense-plan-source { font-size: 12px; color: var(--muted); }
.expense-plan-origin-facts { display: flex; flex-wrap: wrap; gap: 12px 32px; margin: 14px 0; }
.expense-plan-origin-facts dt { font-size: 11px; color: var(--muted); }
.expense-plan-origin-facts dd { margin: 3px 0 0; font-size: 18px; font-weight: 600; }
#cost-composition .expense-plan-origin p { max-width: none; margin: 8px 0; font-size: 13px; line-height: 1.5; }
.expense-plan-origin .table-scroll { max-height: 320px; overflow: auto; margin-top: 14px; background: white; border: 1px solid var(--border); border-radius: 6px; }
.expense-plan-origin table { margin: 0; width: 100%; }
.expense-plan-origin thead th { position: sticky; top: 0; background: var(--surface-3); z-index: 1; }
@media (max-width: 700px) {
 #cost-composition .expense-plan-chart-item { grid-template-columns: minmax(0, 1fr); }
 #cost-composition .expense-plan-origin { padding: 12px; }
 .expense-plan-origin-facts { gap: 12px 24px; }
}
#cost-composition .expense-plan-chart-item { display: block; }
#cost-composition .expense-plan-chart-item > summary.cost-chart-row { grid-template-columns: minmax(180px, 1.05fr) minmax(220px, 3fr) max-content max-content max-content; }
@media (max-width: 700px) {
 #cost-composition .expense-plan-chart-item > summary.cost-chart-row { grid-template-columns: minmax(0, 1fr) 118px; }
}

/* One app-wide height for action controls, including links and disclosures. */
:root body :is(.primary-button, .secondary-button, .danger-button, .icon-button, .summary-action-button):not(.mobile-menu) {
  
  
  box-sizing: border-box;
  
  line-height: 1.25;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
:root body .icon-button { width: var(--button-height); }

/* The segmented navigation occupies the same height as adjacent actions. */
:root body .topbar-tabs { height: var(--button-height); }
:root body .topbar-tabs > a { height: calc(var(--button-height) - 8px); min-height: calc(var(--button-height) - 8px); }
@media (min-width: 701px) {
 #cost-composition .expense-plan-chart-item > summary.cost-chart-row { grid-template-columns: minmax(180px, 1.05fr) minmax(220px, 3fr) 64px 56px 24px; }
}

:is(.expense-plan-info, .planning-info) .metric-info__content { width: min(440px, calc(100vw - 42px)); max-height: min(560px, 70vh); overflow-y: auto; }
:is(.expense-plan-info, .planning-info) .metric-info__content p { margin: 9px 0 0;   }
/* Keep category names readable; the bar gives up space before the label. */
#cost-composition .cost-chart-label { white-space: nowrap; overflow: visible; }
@media (min-width: 701px) {
 #cost-composition .cost-chart-rows,
 #cost-composition .expense-plan-chart-item > summary.cost-chart-row {
  grid-template-columns: 270px minmax(0, 1fr) 64px 56px 24px;
  column-gap: 18px;
 }
}
@media (max-width: 700px) {
 #cost-composition .cost-chart-label { grid-column: 1 / -1; grid-row: 1; }
 #cost-composition .cost-chart-value { grid-column: 1 / -1; grid-row: 2; display: flex; justify-content: flex-end; gap: 12px; }
 #cost-composition .cost-chart-bar { grid-row: 3; }
}

/* Table actions remain compact independently of page-level buttons. */
:root body .table-action-button,
:root body td :is(.primary-button, .secondary-button, .danger-button, .icon-button, .summary-action-button) {
   box-sizing: border-box;  line-height: 1.2; font-weight: 500;
}

:root body .property-evidence-icon svg { width: 18px; height: 18px; flex-shrink: 0; }
/* Account tiles retain their original compact spacing. */

.liquidity-forecast-panel { scroll-margin-top: 110px; }
.liquidity-forecast-tools { display: flex; flex-direction: column; align-items: flex-end; gap: 12px; flex-shrink: 0; }
@media (max-width: 760px) {
  .liquidity-forecast-tools { width: 100%; flex-direction: row; align-items: center; justify-content: space-between; flex-wrap: wrap; }
}
@media (min-width: 641px) and (max-width: 1366px) and (orientation: landscape) {
  .card-grid.liquidity-account-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Planning details fit narrow screens without hiding amounts or actions. */
@media (max-width: 700px) {
 #cost-composition .cost-chart-rows.expense-plan-chart { grid-template-columns: minmax(0, 1fr); }
 #cost-composition .expense-plan-chart-item { min-width: 0; }
 #cost-composition .expense-plan-chart-item > summary.cost-chart-row { grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 12px; }
 #cost-composition .expense-plan-chart-item .cost-chart-label { grid-column: 1; grid-row: 1; white-space: normal; padding-left: 0; overflow-wrap: anywhere; }
 #cost-composition .expense-plan-chart-item .cost-chart-value { grid-column: 1; grid-row: 2; flex-wrap: wrap; justify-content: flex-start; padding-left: 0; }
 #cost-composition .expense-plan-chart-item .cost-chart-bar { grid-column: 1; grid-row: 3; }
 .expense-plan-origin { min-width: 0; overflow-wrap: anywhere; }
 .expense-plan-origin .table-scroll { min-width: 0; max-width: 100%; }
 .expense-plan-origin table { min-width: 0; table-layout: fixed; }
 .expense-plan-origin thead { display: none; }
 .expense-plan-origin tbody, .expense-plan-origin tr { display: block; width: 100%; }
 .expense-plan-origin tr { padding: 10px; border-bottom: 1px solid var(--line); }
 .expense-plan-origin td { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 10px; width: 100%; padding: 4px 0; border: 0; text-align: left; white-space: normal; overflow-wrap: anywhere; }
 .expense-plan-origin td::before { content: attr(data-label); color: var(--muted); font-size: 11px; font-weight: 400; }
 .expense-plan-origin td.table-action-cell .table-action-button { justify-self: start;  }
}

/* Hidden states must survive component and responsive display overrides. */
[hidden] { display: none !important; }
.import-overview-grid > .panel { min-width: 0; }
.import-list article > div { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 620px) {
  .import-list article { flex-direction: column; gap: 8px; }
}
/* Short landscape viewports need room for content and unobstructed click targets. */
@media (max-height: 600px) {
  .topbar, .settings-navigation { position: static; }
}

/* Keep the four category filters readable at desktop and tablet widths. */

/* Chart configuration: category order separately from element assignment. */
.wealth-chart-editor .wealth-chart-element-list :is(.wealth-chart-config-header, .wealth-chart-config-row) { grid-template-columns: 110px minmax(140px, 1fr) minmax(180px, 1.3fr) 42px; }
.wealth-chart-category-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 52px; padding: 8px 13px; border-top: 1px solid var(--line); }
.wealth-chart-category-row:first-child { border-top: 0; }
.wealth-chart-category-row > strong { color: var(--navy-2); font-size: 13px; }
.wealth-chart-editor [role="tabpanel"][hidden] { display: none; }
@media (max-width: 900px) {
  .wealth-chart-editor .wealth-chart-element-list .wealth-chart-config-row { grid-template-columns: minmax(0, 1fr) 42px; }
  .wealth-chart-editor .wealth-chart-element-list .wealth-chart-config-order { grid-column: 2; grid-row: 2 / 4; align-self: center; }
}
.wealth-chart-editor .wealth-chart-config-row select, .wealth-chart-editor .wealth-category-name input { width: 100%; height: var(--field-height); padding: 0 var(--field-padding-x); border: 1px solid var(--line-strong); border-radius: 5px; background: white; color: var(--ink); font: inherit; font-size: 16px; font-weight: 400; }
.sortable-order-row, .wealth-chart-editor :is(.wealth-chart-category-row, .wealth-chart-config-row) { background: var(--editor-section-bg); }
.wealth-chart-category-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) 28px auto; gap: 12px; }
.sortable-order-row { grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; }
.wealth-category-name { flex: 1; min-width: 0; }
.wealth-category-count { flex: 0 0 28px; box-sizing: border-box; }
.wealth-category-drag { display: grid; width: 28px; height: 36px; place-items: center; flex: 0 0 28px; padding: 0; border: 0; background: transparent; color: var(--muted); cursor: grab; touch-action: none; }
.wealth-category-drag svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; }
.wealth-chart-category-row.is-dragging { background: var(--blue-soft); outline: 2px solid var(--blue); outline-offset: -2px; }
.wealth-chart-category-row.is-dragging .wealth-category-drag { cursor: grabbing; }
.wealth-category-add { margin-top: 14px; }
@media (max-width: 620px) { .wealth-chart-category-row { flex-wrap: wrap; gap: 8px; } .wealth-chart-category-row .wealth-chart-config-order { margin-left: auto; } }

/* Destructive actions always retain the shared red treatment in every layout. */
:root body button.danger-button, :root body a.danger-button { color: var(--danger); border-color: var(--danger); }
:root body button.danger-button:hover:not(:disabled), :root body a.danger-button:hover { color: var(--danger); border-color: var(--danger); background: var(--danger-bg); }

.wealth-category-count.is-empty { visibility: hidden; }

.history-legend-row { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.history-legend-row > .currency-badge { align-self: center; }

.wealth-chart-element-list .chart-visibility-button { background: white; }

:root body .wealth-chart-category-list button.danger-button { background: white; }
:root body .wealth-chart-category-list button.danger-button:disabled { opacity: 1; color: var(--danger-disabled); border-color: var(--danger-disabled); }

.property-journal-table th:nth-child(1) { width: 13%; }
.property-journal-table th:nth-child(2) { width: 26%; }
.property-journal-table th:nth-child(3) { width: 16%; }
.property-journal-table th:nth-child(4) { width: 14%; }
.property-journal-table th:nth-child(5) { width: 14%; }
.property-journal-table th:nth-child(6) { width: 17%; }
.property-journal-actions a.property-evidence-icon { display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; }

:root body td button.property-evidence-icon:disabled { color: #a5afbc; border-color: var(--line); background: var(--surface-2); cursor: default; opacity: 1; }

.property-journal-table th:nth-child(5), .property-journal-table td.property-journal-value { text-align: center; }
.property-journal-table th:nth-child(5) button { justify-content: center; }

:is(.property-journal-table, .valuation-table) :is(th, td) { padding-left: 12px; padding-right: 12px; }
:is(.property-journal-table, .valuation-table) :is(th, td):first-child { padding-left: 14px; }
:is(.property-journal-table, .valuation-table) :is(th, td):last-child { padding-right: 14px; }
.property-journal-table th:last-child { text-align: right; }
.property-journal-table td:nth-child(1), .property-journal-table td:nth-child(3) { white-space: nowrap; }

.table-tools-summary-count { margin-left: auto; color: var(--muted); font-size: 13px; font-weight: 400; }

.property-journal-table .property-action-heading-label { display: block; width: var(--property-action-width); margin-left: auto; text-align: left; }


.property-review-dialog { width: min(820px, calc(100vw - 32px)); }
.property-review-dialog .asset-editor__panel { display: grid; gap: 16px; }
.property-review-intro { margin: 0; color: var(--muted); line-height: 1.5; }
.property-review-card { padding: 20px; border: 1px solid var(--line); border-radius: 8px; background: var(--editor-section-bg); }
.property-review-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.property-review-heading > div { min-width: 0; }
.property-review-heading h3 { margin: 6px 0; color: var(--navy-2); font-size: 18px; overflow-wrap: anywhere; }
.property-review-heading p { margin: 0; }
.property-review-heading > strong { color: var(--navy-2); font-size: 22px; white-space: nowrap; }
.property-review-options { margin: 0; padding: 0; border: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.property-review-options legend { margin-bottom: 8px; color: var(--muted); font-size: 13px; }
.property-review-options label { margin: 0; padding: 14px; display: flex; align-items: center; gap: 10px; border: 1px solid var(--line-strong); border-radius: 6px; background: white; cursor: pointer; }
.property-review-options label:has(input:checked) { border-color: var(--blue); background: var(--blue-soft); box-shadow: inset 0 0 0 1px var(--blue); }
.property-review-options input { margin: 0; accent-color: var(--blue); width: 18px; height: 18px; flex: 0 0 18px; }
.property-review-options strong { display: block; font-size: 14px; color: var(--navy-2); }
.property-review-options small { display: block; margin-top: 4px; font-size: 12px; font-weight: 400; color: var(--muted); }
.property-review-partial { margin-top: 4px; font-size: 13px; }
.property-review-partial summary { color: var(--blue); cursor: pointer; padding: 6px 0; }
.property-review-partial .form-field { max-width: 340px; margin-top: 10px; }
.property-review-partial .form-field small { color: var(--muted); line-height: 1.5; }
.property-review-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 10px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.property-review-actions > a { margin-right: auto; }
.property-review-actions form { margin: 0; }
@media (max-width: 600px) {
 .property-review-card { padding: 14px; }
 .property-review-heading { flex-wrap: wrap; gap: 10px; }
 .property-review-options { grid-template-columns: 1fr; }
 .property-review-actions > a { flex-basis: 100%; margin-bottom: 4px; }
}
.action-count-badge { margin-left: 8px; }
.asset-editor__tabs .tab-badge { margin-inline-start: 6px; }

/* Shared badge component, modelled on the tax-table status pills. */
:root body :is(.badge, .status, .obligation-type-badge, .investment-event,
  .data-card__status, .confidence-badge, .account-liquidity-status,
  .currency-badge, .chart-unit, .nav-count, .badge-count, .topbar-review-badge,
  .tax-review-badge, .action-count-badge, .tab-count, .tab-badge,
  .wealth-category-count, .transaction-source-badge, .transaction-split-footer output,
  .cost-stack-month-summary > b) {
  display: inline-flex; flex-shrink: 0; align-items: center; justify-content: center;
  gap: 6px; width: auto; min-width: var(--badge-min-width, 26px);
  height: auto; min-height: var(--badge-min-height, 0);
  padding: var(--badge-padding); border: 0; border-radius: var(--badge-radius);
  background: var(--badge-bg, var(--badge-neutral-bg));
  color: var(--badge-color, var(--badge-neutral));
  font-size: var(--badge-font-size); font-weight: var(--badge-font-weight, 400);
  line-height: var(--badge-line-height); letter-spacing: normal;
  white-space: nowrap; vertical-align: middle; box-shadow: none;
}
/* Table badges use larger, slightly stronger text while retaining compact rows. */
:is(table, [role="table"], [role="grid"]) {
  --badge-font-size: 13px;
  --badge-font-weight: 500;
  --badge-line-height: 1.35;
  --badge-padding: 4px 9px;
}
:is(.badge--info, .status--tax-partial, .investment-event--current,
  .confidence-badge, .tab-count, .wealth-category-count, .nav-count,
  .account-liquidity-status) {
  --badge-color: var(--badge-info); --badge-bg: var(--badge-info-bg);
}
:is(.badge--positive, .status--positive, .status--settled, .status--tax-settled,
  .data-card__status, .investment-event--purchase, .obligation-type-badge--receivable,
  .transaction-split-footer output.is-balanced,
  .cost-stack-month-summary > b.is-positive-rate) {
  --badge-color: var(--badge-positive); --badge-bg: var(--badge-positive-bg);
}
:is(.badge--warning, .status--open, .status--expected, .status--tax-open,
  .tab-badge, .tax-review-badge, .topbar-review-badge, .action-count-badge,
  .transaction-split-footer output:not(.is-balanced)) {
  --badge-color: var(--badge-warning); --badge-bg: var(--badge-warning-bg);
}
:is(.badge--negative, .status--negative, .status--error, .status--written_off, .badge-count,
  .investment-event--sale, .obligation-type-badge--payable,
  .cost-stack-month-summary > b.is-negative-rate) {
  --badge-color: var(--badge-negative); --badge-bg: var(--badge-negative-bg);
}
/* Open work uses the same red counter contract as the notification bell. */
:root body :is(.badge-count,.topbar-review-badge,.tax-review-badge,.action-count-badge,.nav-count,.tab-badge) {
  --badge-color:var(--surface); --badge-bg:var(--red);
  --badge-font-size:13px; --badge-font-weight:500;
  --badge-line-height:1.3; --badge-padding:2px 5px;
  --badge-min-width:22px; --badge-min-height:22px;
}
:is(.badge--neutral, .status--tax-missing, .data-card__status--inactive,
  .account-liquidity-status--excluded,
  .cost-stack-month-summary > b.is-neutral) {
  --badge-color: var(--badge-neutral); --badge-bg: var(--badge-neutral-bg);
}
/* Category origin uses two shades of the existing ochre palette. */
.transaction-source-badge--manual {
  --badge-color: var(--surface); --badge-bg: color-mix(in srgb, var(--badge-warning) 80%, white);
}
.transaction-source-badge--automatic {
  --badge-color: var(--badge-warning); --badge-bg: var(--badge-warning-bg);
}
.account-liquidity-status {
  --badge-color: var(--badge-positive); --badge-bg: var(--badge-positive-bg);
}
.account-liquidity-status--excluded {
  --badge-color: var(--badge-neutral); --badge-bg: var(--badge-neutral-bg);
}

/* Obligation details are explicit actions alongside editing. */
.obligation-row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.obligation-detail-button svg { display: block; width: 18px; height: 18px; }
@media (min-width: 801px) and (max-width: 1500px) {
  .obligations-table .obligations-position { width: 21%; }
  .obligations-table .obligations-action { width: 16%; }
}

/* Action headings align with right-anchored buttons or button groups. */
table { --table-action-width: 80px; --table-action-edge: 17px; }
.expense-detail-table { --table-action-width: 120px; }
.property-journal-table { --table-action-width: var(--property-action-width); }
.obligations-table { --table-action-width: 116px; }
:root body th.table-action-heading,
:root body td.table-action-cell { text-align: right; }
:root body th.table-action-heading:last-child,
:root body td.table-action-cell:last-child,
:root body .tax-dialog-payments tbody tr > td:last-child:not([colspan]) {
  padding-right: var(--table-action-edge);
}
:root body th.table-action-heading > .table-action-label {
  display: block; width: var(--table-action-width); max-width: 100%;
  margin-left: auto; text-align: left;
}
:root body td.table-action-cell > .table-action-button,
:root body .tax-dialog-payments tbody tr > td:last-child > :is(.primary-button, .secondary-button) {
     margin-left: auto;
}
:root body .tax-dialog-payments tbody tr > td:last-child:not([colspan]) { text-align: right; }
.annual-investment-table col:last-child { width: calc(var(--table-action-width) + 27px); }
@media (min-width: 801px) and (max-width: 1500px) {
  .annual-investment-table { --table-action-width: 68px; }
}

@media (min-width: 801px) and (max-width: 1100px) {
  .tax-overview-table :is(th, td) { padding-left: 10px; padding-right: 10px; }
  .tax-overview-table td { font-size: var(--table-body-font-size); }
}

@media (min-width: 801px) and (max-width: 1100px) {
  .property-journal-table { min-width: 0; }
  .property-journal-table :is(th, td):last-child { width: calc(var(--table-action-width) + 29px); }
}

.investment-fx-bar--negative, .investment-gain-bar--negative { fill: var(--red); }
.investment-period-hit { fill: transparent; pointer-events: all; }
.investment-history-canvas :is(.investment-year-label, .investment-event-label) { font-size: 13px; font-weight: 500; }
@media (max-width: 640px) {
  .investment-history-canvas :is(.investment-year-label, .investment-event-label) { font-size: var(--chart-category-font-size); }
}
.investment-history-canvas .chart-tooltip {  padding: 12px 14px; max-width: min(340px, calc(100% - 16px)); }
.investment-history-canvas .chart-tooltip span.negative { color: var(--red); }
.investment-history-canvas .chart-tooltip span.positive { color: var(--positive); }
.investment-history-legend { font-size: 13px; }
.investment-history-legend .legend-negative { background: var(--red); }

/* Dividend payments use the freed account/net columns for readable labels. */
.dividend-table { table-layout: fixed; min-width: 720px; }
.dividend-table th:nth-child(1), .dividend-table th:nth-child(2) { width: 18%; }
.dividend-table th:nth-child(3) { width: 16%; }
.dividend-table th:nth-child(4) { width: 13%; }
.dividend-table th:nth-child(5) { width: 18%; }
.dividend-table th:nth-child(6) { width: 17%; }
.dividend-table :is(th, td) { white-space: nowrap; }
@media (min-width: 801px) and (max-width: 1100px) {
  .dividend-table :is(th, td) { padding-inline: 10px; }
}

.chart-title-with-info { display: flex; align-items: center; gap: 10px; }
.chart-title-with-info .metric-info { position: relative; inset: auto; flex: 0 0 auto; }
.tax-year-overview__intro { white-space: normal; }
.tax-overview-table :is(th, td) { padding-inline: 10px; }
.tax-overview-table :is(th, td):first-child { padding-left: 17px; }
.tax-overview-table th { white-space: normal; }
@media (min-width: 701px) and (max-width: 1100px) {
  .tax-overview-table :is(th, td) { padding-inline: 6px; }
  .tax-overview-table td { font-size: var(--table-body-font-size); }
  .tax-overview-table td small { white-space: normal; }
}
.property-metrics {  margin-bottom: 0; }
.property-metrics .metric-card > span:not(.metric-info) { padding-right: 0; }


:root body .obligations-table button.obligation-detail-button:disabled {
  color: #a5afbc; border-color: var(--line); background: var(--surface-2); cursor: default; opacity: 1;
}

.cost-monthly-panel > .chart-legend { justify-content: flex-start; }

/* Compact, shared KPI rows; long dynamic labels stay on one line. */
.metric-card > span:not(.metric-info), .metric-card > small { display: block; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.metric-card > small { max-height: none; line-height: 18px; font-size: 12px; }
.obligation-position-grid, .obligation-conditions-grid, .obligation-notes-grid { clear: both; display: grid; gap: 12px; }
.obligation-position-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.obligation-position-grid > .form-field { grid-column: span 2; }
.obligation-position-grid > :is(.obligation-field--counterparty, .obligation-field--title) { grid-column: span 3; }
.obligation-conditions-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.obligation-conditions-grid > .form-field { grid-column: span 2; }
.obligation-conditions-grid:not(:has(.obligation-field--original_amount)) > :is(.obligation-field--outstanding_amount, .obligation-field--currency) { grid-column: span 3; }
.obligation-conditions-grid .obligation-field--due_date { grid-column: 1 / span 2; }
.obligation-editor :is(.obligation-field--is_secured, .obligation-field--included_in_running_costs) { grid-column: 1 / -1; justify-content: center; padding: 0; min-height: 26px; }
.obligation-notes-grid { grid-template-columns: minmax(0, 1fr); }
.obligation-editor .obligation-field--notes textarea { height: 64px; min-height: 64px; }
@media (max-width: 620px) {
  .obligation-position-grid, .obligation-conditions-grid { grid-template-columns: minmax(0, 1fr); }
  .obligation-position-grid > .form-field, .obligation-position-grid > :is(.obligation-field--counterparty, .obligation-field--title) { grid-column: 1; }
}


@media (max-width: 620px) {
  .obligation-conditions-grid > .form-field,
  .obligation-conditions-grid .obligation-field--due_date,
  .obligation-conditions-grid:not(:has(.obligation-field--original_amount)) > :is(.obligation-field--outstanding_amount, .obligation-field--currency) { grid-column: 1; }
}
.share-transactions-management-table { min-width: 1020px; }
.share-transactions-management-table :is(th, td) { white-space: nowrap; }
.fx-settings-editor .dialog-field--bank_spread .dialog-input-with-help { width: 160px; max-width: 100%; }
.dialog-standard .asset-editor__close { display: grid; place-items: center; padding: 0; }
.dialog-standard .asset-editor__close svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.dialog-form-sections { display: grid; gap: 16px; }
.dialog-form-section, .dialog-standard .asset-editor__section { min-width: 0; margin: 0; padding: 12px 16px 14px; border: 0; border-radius: 8px; background: var(--dialog-section-bg); }
.dialog-standard .asset-editor__section + .asset-editor__section { margin-top: 16px; }
.dialog-form-section legend { float: left; width: 100%; padding: 0; }
.dialog-form-section legend, .dialog-form-section > h3, .dialog-standard .asset-editor__section h3 { margin: 0 0 10px; color: var(--navy-2); font-size: 16px; font-weight: 600; line-height: 1.4; }
.dialog-form-grid { clear: both; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--dialog-field-row-gap) 12px; }
.dialog-form-grid > .form-field { grid-column: auto; min-width: 0; }
.dialog-form-grid > .dialog-field--wide { grid-column: 1 / -1; }
.dialog-form-grid > :is(.dialog-field--notes, .dialog-field--note, .dialog-field--source_reference, .dialog-field--documents, .form-field--checkbox) { grid-column: 1 / -1; }
.dialog-form-extras > summary { min-height: 24px; color: var(--navy-2); font-size: 16px; font-weight: 600; cursor: pointer; }
.dialog-form-extras > summary:hover { color: var(--blue); }
.dialog-form-extras > summary:focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; border-radius: 3px; }
.dialog-form-extras > :is(.dialog-form-grid, .obligation-notes-grid) { margin-top: 14px; }
.dialog-standard .asset-editor__grid { gap: 12px; }
/* Shared fields; domain-specific groups retain only their content layout. */
:is(.dialog-standard) .form-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
:is(.dialog-standard) .form-field > label:not(.checkbox-label), .dialog-standard .form-field-label-row > label { color: var(--muted); font-size: 10px; font-weight: 400; line-height: 1.2; letter-spacing: .065em; text-transform: uppercase; }
:is(.dialog-standard) .form-field :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]):not([type=file]), select),
:is(.dialog-standard) .form-field textarea { box-sizing: border-box; width: 100%; min-width: 0; height: var(--field-height); padding: 0 var(--dialog-field-padding-right, var(--field-padding-x)) 0 var(--field-padding-x); border: 1px solid var(--line-strong); border-radius: 5px; background-color: white; color: var(--ink); font: inherit; font-size: 16px; font-weight: 400; }
:is(.dialog-standard) .form-field textarea { height: 72px; min-height: 64px; padding-top: 10px; padding-bottom: 10px; resize: vertical; }
.dialog-standard .form-field--checkbox { padding: 0; min-height: 26px; justify-content: center; }
.dialog-standard .checkbox-label { text-transform: none; letter-spacing: normal; font-size: 13px; font-weight: 600; }
.dialog-standard .form-field .help-text { margin: 2px 0 0; }
.dialog-input-with-help { position: relative; }
.dialog-input-with-help { --dialog-field-padding-right: 44px; }
.dialog-input-info.metric-info { top: calc((var(--field-height) - 22px) / 2); right: 10px; }
.dialog-standard .transaction-assignment-mode { min-width: 0; border: 0; border-radius: 8px; background: var(--dialog-section-bg); padding: 12px 16px 14px; margin: 16px 0; }
.dialog-standard .transaction-assignment-mode legend { font-size: 16px; font-weight: 600; }
.dialog-standard .transaction-split-panel { border-radius: 8px; background: var(--dialog-section-bg); }
.dialog-standard .category-create-link svg, .dialog-standard [data-expense-add] svg {  height: 16px; vertical-align: middle; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
@media (max-width: 620px) {
  .dialog-form-grid { grid-template-columns: minmax(0, 1fr); }
  .dialog-form-grid > .form-field { grid-column: 1; }
}
.dialog-form-grid--three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dialog-standard .dialog-input-with-help--select .dialog-input-info { right: 34px; }
.dialog-input-with-help--select { --dialog-field-padding-right: 64px; }
@media (max-width: 620px) { .dialog-form-grid, .dialog-form-grid--three { grid-template-columns: minmax(0, 1fr); } }
.dialog-standard .dialog-form-sections--compact { gap: var(--dialog-field-row-gap); }
.dialog-standard .dialog-form-sections--compact .dialog-form-section { padding: 0; }
.dialog-standard .dialog-form-sections--compact .dialog-form-extras > summary { font-size: 14px; }
.dialog-checkbox-with-help { display: flex; align-items: center; gap: 8px; }
.dialog-checkbox-with-help > .metric-info { position: relative; top: auto; right: auto; flex: 0 0 22px; }
.dialog-form-grid--long-labels > .form-field > label:not(.checkbox-label) { min-height: 0; }
.dialog-standard .dialog-form-section > .asset-editor__grid { clear: both; }
.dialog-standard .dialog-form-extras > .transaction-notes { margin-top: 14px; }
@media (max-width: 620px) { .dialog-form-grid--long-labels > .form-field > label:not(.checkbox-label) { min-height: 0; } }
.dialog-standard .tax-year-editor__panel { padding-top: 24px; }
.dialog-standard .tax-section-heading h3, .dialog-standard .tax-proposal h3 { font-size: 16px; font-weight: 600; }
.dialog-standard .property-evidence-meta a::after { content: "";  height: 14px; background: currentColor; mask: url("external-link.d3515287f2f7.svg") center / contain no-repeat; -webkit-mask: url("external-link.d3515287f2f7.svg") center / contain no-repeat; }
.dialog-standard .asset-editor__actions { z-index: 20; background: white; }
.dialog-standard .metric-info:is(:hover, :focus-within, :has(.form-help__trigger[aria-expanded="true"])) { z-index: 40; }
.dialog-standard .tax-component-edit { border: 0; border-radius: 8px; padding: 12px 16px 14px; background: var(--dialog-section-bg); }
.dialog-standard .tax-component-edit h4 { margin: 0 0 10px; font-size: 16px; font-weight: 600; }
:is(.dialog-standard) .form-field :is(input, select, textarea):disabled { color: var(--field-disabled-color); background-color: var(--surface-2); cursor: default; }
.dialog-standard .dialog-forecast-fallback { margin-top: 16px; }
.dialog-standard .dialog-form-section .forecast-expense-columns { clear: both; }
.dialog-standard .dialog-forecast-fallback .forecast-expense-fallback { clear: both; margin-top: 0; }
.dialog-form-grid--account > .dialog-field--wide { grid-column: auto; }
.dialog-standard .transaction-assignment-mode legend { float: left;  margin-bottom: 10px; padding: 0; }
.dialog-standard .transaction-assignment-mode__options { clear: both; margin-bottom: 16px; }
.dialog-standard .transaction-assignment-mode .transaction-split-panel { padding: 0; border: 0; }

/* Shared compact custom editors and aligned multiline labels. */
.dialog-standard .tax-component-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }

.dialog-standard .tax-component-edit > .form-field { max-width: 220px; }
.dialog-standard .forecast-expense-fallback { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: center; }
.dialog-standard .dialog-form-grid--long-labels > .form-field { justify-content: flex-end; }
@media (min-width: 621px) {
  .dialog-standard.transaction-editor .asset-editor__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dialog-standard.tax-payment-editor .asset-editor__grid { grid-template-columns: repeat(8, minmax(0, 1fr)); }
  .dialog-standard.tax-payment-editor .asset-editor__grid > .form-field { grid-column: span 2; }
  .dialog-standard.tax-payment-editor .asset-editor__grid > .dialog-field--tax_year { grid-column: span 1; }
  .dialog-standard.tax-payment-editor .asset-editor__grid > .dialog-field--tax_type { grid-column: span 3; }
  .dialog-standard.tax-payment-editor .asset-editor__grid > .dialog-field--note { grid-column: span 6; }
}
@media (max-width: 620px) {
  .dialog-standard .tax-component-fields { grid-template-columns: minmax(0, 1fr); }
}

.liquidity-account-grid .account-card .account-card__edit { grid-column: 2; grid-row: 3; align-self: center; margin-top: 0; }
.account-card__edit svg { display: block; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.asset-create-editor .dialog-form-extras > .form-field { margin-top: 14px; }

.asset-create-editor .asset-editor__form > .dialog-form-extras { margin-top: 16px; }

/* Calendar controls keep their own slot beside the field information. */
.dialog-input-with-help:has(> input:is([type="date"], [type="datetime-local"])) { --dialog-field-padding-right: var(--field-padding-x); }
.dialog-standard .dialog-input-with-help:has(> input:is([type="date"], [type="datetime-local"])) .dialog-input-info { right: 40px; }

@media (min-width: 621px) {
  .dialog-standard .dialog-form-grid:has(> .dialog-field--include_in_liquidity) > :is(.dialog-field--include_in_liquidity, .dialog-field--is_active) { grid-column: span 2; }
  .dialog-standard .dialog-form-grid:has(> .dialog-field--include_in_liquidity) > .dialog-field--last_reconciled_at { grid-column: 1 / span 2; }
}

/* Balanced dialog grids: the dialog and its rows share the available width. */
.dialog-standard .dialog-form-grid--balanced-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dialog-standard .dialog-form-grid--balanced-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dialog-standard .dialog-form-grid[class*="dialog-form-grid--balanced-"] > .form-field { grid-column: auto; }
.dialog-standard .dialog-form-grid[class*="dialog-form-grid--balanced-"] > :is(.dialog-field-size--full, .dialog-field--cantonal_child_deduction) { grid-column: auto; }
.dialog-standard .dialog-form-grid[class*="dialog-form-grid--balanced-"] > .dialog-field-size--full,
.dialog-standard .dialog-form-grid--single > .form-field { grid-column: 1 / -1; }
.dialog-standard .dialog-form-type--AssetForm .dialog-field--name { grid-column: 1 / -1 !important; }
.dialog-standard .dialog-form-type--FinancialAccountForm .dialog-field--iban { grid-column: 1 / -1 !important; }
.dialog-standard .dialog-form-type--FinancialAccountForm .dialog-form-grid:has(> .dialog-field--include_in_liquidity) > :is(.dialog-field--include_in_liquidity, .dialog-field--is_active) { grid-column: auto; }
.dialog-standard .dialog-form-type--FinancialAccountForm .dialog-form-grid:has(> .dialog-field--include_in_liquidity) > .dialog-field--last_reconciled_at { grid-column: 1; }
.dialog-standard .dialog-form-type--MortgageForm .dialog-field--bank { grid-column: 1 / -1 !important; }
.dialog-standard .dialog-form-grid--household { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dialog-standard .dialog-form-grid--household > .form-field { grid-column: auto; }
.dialog-standard .dialog-form-grid--household > .dialog-field--children_birth_dates_text { grid-column: span 2; }
.dialog-standard .dialog-form-grid--household > .dialog-field-size--full { grid-column: 1 / -1; }
@media (max-width: 620px) {
  .dialog-standard .dialog-form-grid[class*="dialog-form-grid--balanced-"],
  .dialog-standard .dialog-form-grid--household { grid-template-columns: minmax(0, 1fr); }
  .dialog-standard .dialog-form-grid[class*="dialog-form-grid--balanced-"] > .form-field,
  .dialog-standard .dialog-form-type--FinancialAccountForm .dialog-form-grid > .form-field { grid-column: 1 / -1; }
}

.dialog-standard .dialog-form-grid.dialog-form-grid--single > .form-field,
.dialog-standard .dialog-form-type--WealthHistoryPointForm .dialog-form-grid > .dialog-field--source_reference,
.dialog-standard .dialog-form-type--InvestmentTransactionForm .dialog-form-grid > .dialog-field--buyer { grid-column: 1 / -1; }
@media (min-width: 621px) {
  .dialog-standard .dialog-form-type--FinancialAccountForm .dialog-form-grid:has(> .dialog-field--iban) { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .dialog-standard .dialog-form-type--FinancialAccountForm .dialog-form-grid:has(> .dialog-field--iban) > .form-field { grid-column: span 6; }
  .dialog-standard .dialog-form-type--FinancialAccountForm .dialog-form-grid > .dialog-field--iban { grid-column: span 9 !important; }
  .dialog-standard .dialog-form-type--FinancialAccountForm .dialog-form-grid:has(> .dialog-field--iban) > .dialog-field--currency { grid-column: span 3; }
  .dialog-standard .dialog-form-grid--balanced-3:has(> .dialog-field-size--short:nth-child(3)) { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 110px; }
  .dialog-standard .dialog-form-grid--balanced-3:has(> .dialog-field-size--short:nth-child(2)) { grid-template-columns: minmax(0, 1fr) 110px minmax(0, 1fr); }
}

/* Required references and paired valuation fields finish the row. */
.dialog-standard .dialog-form-type--WealthHistoryPointForm .dialog-form-grid[class*="dialog-form-grid--balanced-"] > .dialog-field--source_reference { grid-column: 1 / -1; }

.dialog-standard .dialog-form-type--ValuationForm .dialog-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dialog-standard .dialog-form-type--ValuationForm .dialog-form-grid[class*="dialog-form-grid--balanced-"] > .dialog-field--expected_dividend_per_unit { grid-column: 1 / -1; }

.dialog-standard .dialog-form-type--InvestmentAnnualSnapshotForm .dialog-form-grid[class*="dialog-form-grid--balanced-"] > .dialog-field--asset,
.dialog-standard .dialog-form-type--EntityForm .dialog-form-grid[class*="dialog-form-grid--balanced-"] > .dialog-field--name { grid-column: 1 / -1; }

.dialog-standard .dialog-form-grid > .form-field { margin: 0; }

@media (max-width: 620px) {
  .dialog-standard .dialog-form-sections .dialog-form-grid { grid-template-columns: minmax(0, 1fr); }
  .dialog-standard .dialog-form-sections .dialog-form-grid > .form-field { grid-column: 1 / -1 !important; }
}

@media (min-width: 621px) {
  .dialog-standard .dialog-form-type--AssetForm .dialog-form-grid { grid-template-columns: minmax(0, 1fr) 110px; }
  .dialog-standard .dialog-form-type--ImportRuleForm .dialog-form-grid:has(> .dialog-field--priority) { grid-template-columns: minmax(0, 1fr) 110px; }
  .dialog-standard .dialog-form-type--ValuationForm .dialog-form-grid { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .dialog-standard .dialog-form-type--ValuationForm .dialog-form-grid[class*="dialog-form-grid--balanced-"] > .form-field { grid-column: span 6; }
  .dialog-standard .dialog-form-type--ValuationForm .dialog-form-grid[class*="dialog-form-grid--balanced-"] > .dialog-field--currency { grid-column: span 3; }
  .dialog-standard .dialog-form-type--ValuationForm .dialog-form-grid[class*="dialog-form-grid--balanced-"] > .dialog-field--source_kind { grid-column: span 9; }
  .dialog-standard .dialog-form-type--ValuationForm .dialog-form-grid[class*="dialog-form-grid--balanced-"] > :is(.dialog-field--expected_dividend_per_unit, .dialog-field-size--full) { grid-column: 1 / -1; }
}
.dialog-standard .dialog-form-type--SetupForm .dialog-form-grid[class*="dialog-form-grid--balanced-"] > .dialog-field--name { grid-column: 1 / -1; }
@media (max-width: 620px) { .dialog-standard .forecast-expense-fallback { grid-template-columns: minmax(0, 1fr); } }

.dialog-standard .tax-component-fields > .form-field:is(:first-child, :last-child) { grid-column: 1 / -1; }

/* Payment explanations stay with the payment instead of taking a separate column. */
.tax-year-editor .tax-dialog-payments table { table-layout: fixed; }
.tax-year-editor .tax-dialog-payments :is(th, td) { padding: 12px 10px; }
.tax-year-editor .tax-dialog-payments .tax-payment-source { min-width: 0; }
.tax-year-editor .tax-dialog-payments :is(input, select) { min-width: 0; box-sizing: border-box; }
.tax-year-editor .tax-dialog-payments th:nth-child(1) { width: 25%; }
.tax-year-editor .tax-dialog-payments th:nth-child(2) { width: 25%; }
.tax-year-editor .tax-dialog-payments th:nth-child(3) { width: 17%; }
.tax-year-editor .tax-dialog-payments th:nth-child(4) { width: 18%; }
.tax-year-editor .tax-dialog-payments th:nth-child(5) { width: 15%; }
.tax-year-editor .tax-payment-details dl { width: 100%; box-sizing: border-box; grid-template-columns: minmax(0, 1fr); }

/* Category options share one aligned list inside the section. */
.dialog-standard .category-data-form .form-field--checkbox,
.dialog-standard .category-data-form .form-field--checkbox:last-child {
  min-height: 32px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  justify-content: center;
}
.dialog-standard .category-data-form .dialog-checkbox-with-help {
  display: grid;
  grid-template-columns: minmax(0, max-content) 22px;
  align-items: center;
  justify-content: start;
  gap: 8px;
}
.dialog-standard .category-data-form .checkbox-label {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  font-weight: 500;
  line-height: 1.4;
}
.dialog-standard .category-data-form .checkbox-label input { margin: 0; }

.dialog-standard .category-data-form .dialog-form-grid:has(> .dialog-field--exclude_from_running_costs) { row-gap: 4px; }

.settings-single-field input[name="reserve-monthly_tax_reserve"] { max-width: 220px; }
.dialog-form-sections { gap: var(--form-section-gap); }
.dialog-standard .dialog-form-sections--compact { gap: var(--form-row-gap); }
.dialog-standard .asset-editor__section + .asset-editor__section { margin-top: var(--form-section-gap); }
.settings-form { gap: var(--form-section-gap); }
.settings-form-section + .settings-form-section,
.settings-form .forecast-form-section + .forecast-form-section { padding-top: var(--form-section-gap); }
.settings-form-section h3 { margin-bottom: 10px; }
.dialog-standard .asset-editor__inline-actions { margin-top: var(--form-section-gap); }
.dialog-standard .dialog-form-extras > :is(.dialog-form-grid, .obligation-notes-grid, .transaction-notes, .form-field) { margin-top: var(--form-row-gap); }
.dialog-standard .category-data-form .dialog-form-grid:has(> .dialog-field--exclude_from_running_costs) { row-gap: 4px; }

.form-stack > button[type="submit"] { margin-top: 4px; }
.form-actions { margin-top: var(--form-section-gap); padding-top: var(--form-section-gap); }
.forecast-form-section { margin-top: var(--form-section-gap); padding-top: var(--form-section-gap); }
.forecast-form-section:first-of-type { margin-top: 0; padding-top: 0; }
.forecast-expense-fallback { margin-top: var(--form-section-gap); padding-top: var(--form-section-gap); }
.settings-form .forecast-expense-fallback { padding-top: var(--form-section-gap); }
.dialog-standard .dialog-forecast-fallback .forecast-expense-fallback { margin-top: 0; padding-top: 0; }
.settings-form .forecast-form-section,
.income-settings-editor .forecast-form-section { margin: 0; padding: 0; }
.settings-form .forecast-form-section + .forecast-form-section { padding-top: var(--form-section-gap); }
.dialog-standard .property-review-partial .form-field { margin-top: var(--form-row-gap); }

.income-settings-editor #income-settings-dates .dividend-forecast-section { margin-top: var(--form-section-gap); padding-top: var(--form-section-gap); }

.category-create-editor .asset-editor__shell > .asset-editor__actions { position: static; bottom: auto; margin: 0; flex-shrink: 0; }

/* Read-only asset valuation history with separate form dialogs. */
.valuation-table-scroll { overflow-x: auto; }
.valuation-table { --table-action-edge: 14px; width: 100%; min-width: 560px; }
.valuation-table :is(th, td) { vertical-align: middle; }
.valuation-history-actions { text-align: right; white-space: nowrap; }
.valuation-history-action-group { display: flex; justify-content: flex-end; gap: 6px; }
.valuation-history-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.holding-valuation-editor.dialog-standard .dialog-form-grid[class*="dialog-form-grid--balanced-"] > .dialog-field--source_kind { grid-column: 1 / -1; }


/* All filter sections share the journal layout, including server-side forms. */
.table-tools-summary { gap: 4px; }
.table-tools-summary-count { text-align: right; }

/* One filter component for tables and server-filtered lists. */
.table-filter-block { margin-bottom: 18px; }
.table-filter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: var(--form-row-gap); align-items: end; }
.table-filter-grid .form-field { min-width: 0; gap: var(--form-label-gap); }
.table-filter-grid .form-field label { display: block; margin: 0; color: var(--muted); font-size: 10px; font-weight: 400; letter-spacing: .065em; line-height: 1.2; text-transform: uppercase; }
.table-filter-actions { grid-column: -2 / -1; justify-self: end; align-self: end; display: flex; justify-content: flex-end; align-items: center; flex-wrap: nowrap; gap: 10px; margin: 0; }
@media (max-width: 600px) {
  .table-filter-grid { grid-template-columns: minmax(0, 1fr); }
  .table-filter-actions { grid-column: 1 / -1; }
}

/* Ausgabenplan follows the approved chart category list without changing it. */
.settings-form.forecast-settings-form .forecast-expense-columns,
.settings-form.forecast-settings-form .forecast-expense-row {
  grid-template-columns: 28px minmax(0, 1fr) 190px 77px 44px;
  gap: 12px;
  padding: 8px 13px;
}
.settings-form.forecast-settings-form .forecast-expense-columns { margin: 0; padding-top: 0; font-size: 13px; }
.settings-form.forecast-settings-form .forecast-expense-row { margin: 0; align-items: center; border-top: 1px solid var(--line); background: var(--editor-section-bg); }
.settings-form.forecast-settings-form .forecast-expense-row:first-child { border-top: 0; }
.settings-form.forecast-settings-form .forecast-expense-row .form-field { display: block; grid-column: auto; }
.settings-form.forecast-settings-form .forecast-expense-row :is(select, input:not([type=hidden]):not([type=checkbox])) { height: 40px; min-height: 40px; width: 100%; font-size: 16px; background: white; }
.settings-form.forecast-settings-form .forecast-expense-order { display: flex; grid-column: auto; grid-row: auto; min-height: 40px; }
.settings-form.forecast-settings-form .forecast-expense-order button {   grid-column: auto; grid-row: auto; }
.settings-form.forecast-settings-form .forecast-expense-delete { grid-column: auto; grid-row: auto; }
.settings-form.forecast-settings-form .forecast-expense-row.is-dragging { background: var(--blue-soft); outline: 2px solid var(--blue); outline-offset: -2px; }
.settings-form.forecast-settings-form .is-dragging .wealth-category-drag { cursor: grabbing; }
.forecast-settings-form .forecast-expense-fallback { background: var(--editor-section-bg); border: 0; border-radius: 8px; padding: 16px; }
.forecast-fallback-amount { display: flex; align-items: center; gap: 10px; }
.forecast-fallback-amount input { flex: 0 0 140px; width: 140px; min-width: 0; }
.forecast-fallback-amount span { color: var(--muted); }
.forecast-settings-form .forecast-expense-fallback .help-text { display: block; max-width: 620px; }
@media (max-width: 700px) {
  .settings-form.forecast-settings-form .forecast-expense-columns { display: none; }
  .settings-form.forecast-settings-form .forecast-expense-row { grid-template-columns: 20px minmax(0, 1fr) auto; }
  .settings-form.forecast-settings-form .forecast-expense-row > .form-field { grid-column: 2 / -1; }
  .settings-form.forecast-settings-form .forecast-expense-row > .wealth-category-drag { grid-column: 1; grid-row: 1 / 3; }
  .settings-form.forecast-settings-form .forecast-expense-row > .form-field:has(input) { display: block; grid-column: 2 / -1; grid-row: 2; }
  .settings-form.forecast-settings-form .forecast-expense-row > .form-field:has(input) > :is(label, input) { grid-column: auto; grid-row: auto; }
  .settings-form.forecast-settings-form .forecast-expense-label { display: block; }
  .settings-form.forecast-settings-form .forecast-expense-order { grid-column: 2; grid-row: 3; justify-self: end; }
  .settings-form.forecast-settings-form .forecast-expense-delete { grid-column: 3; grid-row: 3; }
}

/* Amount expressions use one regular filter column. */
.transaction-table-panel .transaction-amount-filter { grid-column: auto; }
.filter-input-with-help { position: relative; min-width: 0; }
.table-filter-grid .filter-input-with-help > input[type="text"] { width: 100%; padding-right: 44px; }
.filter-input-info.metric-info { top: calc((var(--field-height) - 22px) / 2); right: 10px; }
.amount-filter-examples { display: grid; gap: 4px; margin-top: 8px; }
.amount-filter-note { display: block; margin-top: 10px; }

/* Calm, solid colour in the shared dialog chrome. */
:root {
  --dialog-segment-background: white;
  --dialog-segment-active-background: var(--navy-2);
  --dialog-segment-active-text: white;
}
.asset-editor { --dialog-chrome-bg: var(--editor-section-bg); }
.asset-editor :is(.asset-editor__header, .asset-editor__actions) { background: var(--dialog-chrome-bg); }

.asset-editor .asset-editor__header .asset-editor__tabs,
.dialog-standard .transaction-assignment-mode__options { background: var(--dialog-segment-background); }
.asset-editor .asset-editor__header .asset-editor__tabs > button:is([aria-selected="true"], [aria-pressed="true"]),
.dialog-standard .transaction-assignment-mode__options input:checked + span { background: var(--dialog-segment-active-background); color: var(--dialog-segment-active-text); box-shadow: none; }

/* Three distinct areas in the expense-plan settings. */
.forecast-settings-form { gap: var(--form-section-gap); }
.forecast-settings-section { min-width: 0; padding: 18px; border-radius: var(--radius); background: var(--dialog-section-bg); }
.forecast-settings-section h3 { margin: 0 0 12px; color: var(--navy-2); font-size: 16px; font-weight: 600; }
.forecast-settings-assumptions { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: var(--form-section-gap); align-items: stretch; }
.forecast-settings-note { margin: 10px 0 0;    }
.forecast-settings-assumptions .form-field { display: grid; gap: var(--form-label-gap); }
.forecast-settings-assumptions .form-field > label { color: var(--muted); font-size: 10px; font-weight: 400; letter-spacing: .065em; text-transform: uppercase; }
.forecast-settings-assumptions .form-field > input { width: min(240px, 100%); height: var(--field-height); min-height: var(--field-height); background: var(--surface); }
.forecast-settings-assumptions .help-text { margin-top: 4px; font-size: 12px; line-height: 1.5; }
.forecast-settings-recommendation { display: grid; gap: 6px; margin-top: 14px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.forecast-settings-recommendation strong { color: var(--navy-2); font-size: 16px; font-weight: 600; }
.forecast-settings-recommendation-label { color: var(--muted); font-size: 10px; letter-spacing: .065em; text-transform: uppercase; }
.forecast-settings-recommendation small { font-size: 12px; }
.forecast-settings-recommendation button { justify-self: start; margin-top: 4px; }
@media (max-width: 760px) { .forecast-settings-assumptions { grid-template-columns: minmax(0, 1fr); } }

/* Planning form content; the shared settings surface is owned by app-layout.css. */
.liquidity-planning-settings { display: grid; }
.liquidity-planning-settings #payments-form { gap: 12px; }
.planning-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.planning-section-heading h3 { margin: 0; }
.liquidity-planning-settings #income-settings-dates { display: grid; gap: 16px; }
.liquidity-planning-settings #income-settings-dates .forecast-form-section { padding-top: 0; }
.liquidity-planning-settings #income-settings-dates .form-field > label { color: var(--muted); font-size: 10px; font-weight: 400; text-transform: uppercase; letter-spacing: .065em; }
.liquidity-planning-settings #id_bonus_month { max-width: 240px; }

.liquidity-planning-settings #income-settings-dates :is(select, input:not([type=checkbox]):not([type=hidden])) { height: var(--field-height); min-height: var(--field-height); }

.planning-section-title { display: flex; align-items: center; gap: 6px; margin-bottom: 12px; }
.planning-section-title h3 { margin: 0; }
.planning-section-title .planning-expense-add { margin-left: auto; }
.planning-section-heading .planning-section-title { margin-bottom: 0; }
.planning-section-title .metric-info { position: relative; top: auto; right: auto; }
.forecast-settings-assumptions .form-field > select { height: var(--field-height); min-height: var(--field-height); background: var(--surface); }

/* Forecast recommendation uses the shared field/readout contract. */
.forecast-settings-assumptions #id_bonus_month { width: 180px; max-width: 100%; }
.forecast-settings-recommendation-label, .forecast-settings-recommendation small { line-height: 1.45; }
.forecast-reserve-source { white-space: nowrap; }
.forecast-recommendation-value .metric-info { position: relative; top: auto; right: auto; }

/* Settings typography: identical roles use identical sizes across tabs.
   Scope to page components so shared editors and dashboard dialogs stay independent. */
.settings-page :is(.settings-form-section, .forecast-settings-section) h3 {
  font-size: var(--settings-content-size);
  font-weight: 600;
  line-height: 1.4;
}
.settings-page .data-card strong,
.settings-page .settings-form .payroll-rule-row > div:first-child strong,
.settings-page .settings-form :is(td, .dividend-schedule-row, .dividend-schedule-total),
.settings-page .settings-form .dividend-schedule-row > :is(label, span),
.settings-page .settings-form .dividend-schedule-total > strong,
.settings-page .forecast-tax-layout .forecast-recommendation-value > strong {
  font-size: var(--settings-content-size);
}
.settings-page .settings-form :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]), select, textarea) {
  font-size: var(--settings-content-size);
  font-weight: 400;
}
.settings-page .settings-form #income-settings-dates :is(select, .dividend-percent input) {
  font-size: var(--settings-content-size);
}
.settings-page .settings-form :is(th, .dividend-schedule-columns, .forecast-expense-columns) {
  font-size: var(--settings-column-size);
}
.settings-page .settings-form :is(.form-field > label:not(.checkbox-label), .forecast-settings-recommendation-label) {
  font-size: var(--settings-label-size);
  font-weight: 400;
  letter-spacing: .065em;
  text-transform: uppercase;
}
.settings-page .data-card small,
.settings-page .table-tools-summary-count,
.settings-page .settings-form :is(td small, .help-text, .settings-section-note, .forecast-settings-note, .forecast-reserve-source, .compact-number-field, .dividend-percent > span),
.settings-page .settings-form .payroll-rule-row > div:first-child span,
.settings-page .settings-form .dividend-tax-mobile-label,
.settings-page .settings-form .dividend-schedule-row > .dividend-tax-check {
  font-size: var(--settings-help-size);
  line-height: 1.5;
}
.settings-page .settings-form .payroll-calculation-table td strong { font-size: inherit; }

/* Shared column-label standard for tables and editable table grids. */
:root body :is(thead th, .forecast-expense-columns, .dividend-schedule-columns, .transaction-split-columns, .wealth-chart-config-header) {
  font-size: 11px;
  font-weight: 400;
  letter-spacing: .045em;
  text-transform: uppercase;
  color: #526073;
}

/* Compact inline table actions use the same medium text weight. */
:root body td :is(.table-action, .suggestion-actions button) { font-weight: 500; }

#property-panel-settings > [data-property-form-fields] + [data-property-form-fields] { margin-top: var(--form-section-gap); }

/* Generic deletion previews keep long dependency lists inside the scroll panel. */
[data-delete-confirmation] .asset-editor__header { flex-shrink: 0; }
[data-delete-confirmation] .asset-editor__panel { min-height: 0; overflow-y: auto; }
[data-delete-confirmation] .asset-editor__actions { margin: 0; flex-shrink: 0; }

/* Fixed tab editors keep actions at the bottom of the reserved content area. */
.asset-editor:is([data-dialog-size-max], [data-dialog-size-first])[style*="--dialog-tab-height"] > .asset-editor__shell > .asset-editor__panel:not([hidden]) { display: flex; flex-direction: column; }
.asset-editor:is([data-dialog-size-max], [data-dialog-size-first])[style*="--dialog-tab-height"] > .asset-editor__shell > .asset-editor__panel[data-editor-panel] > form { display: flex; flex: 1; flex-direction: column; }
.asset-editor:is([data-dialog-size-max], [data-dialog-size-first])[style*="--dialog-tab-height"] > .asset-editor__shell > .asset-editor__panel > .asset-editor__actions,
.asset-editor:is([data-dialog-size-max], [data-dialog-size-first])[style*="--dialog-tab-height"] > .asset-editor__shell > .asset-editor__panel[data-editor-panel] > form > .asset-editor__actions { margin-top: auto; }
.wealth-chart-editor > .asset-editor__shell > .asset-editor__actions { position: static; margin: 0; flex-shrink: 0; }

/* Read-only facts and KPIs share the Sparziel component; dialog tokens remain standard. */
.summary-facts dd.negative { color: var(--danger); }
.dialog-standard .summary-facts {  background: var(--dialog-section-bg); margin-bottom: var(--form-section-gap); }
.dialog-standard .summary-facts dt { font-size: 10px; font-weight: 400; letter-spacing: .065em; line-height: 1.2; }
.summary-facts--three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.summary-facts--two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.summary-facts--three > div { border-top: 0; border-left: 1px solid var(--line); }
.summary-facts--three > div:first-child { border-left: 0; }
@media (max-width: 620px) {
  .summary-facts--three { grid-template-columns: 1fr; }
  .summary-facts--three > div { border-left: 0; border-top: 1px solid var(--line); }
  .summary-facts--three > div:first-child { border-top: 0; }
}

/* Fussleisten ausserhalb des Inhalts brauchen keine negativen Inhaltsränder. */
.dialog-standard > .asset-editor__shell > .asset-editor__actions { position: static; bottom: auto; margin: 0; flex-shrink: 0; }

/* Shared primary action for standalone Lucide plus buttons. */
:root body .add-button { width: var(--button-height); min-width: var(--button-height); padding: 0; flex-shrink: 0; background: var(--navy-2); border-color: var(--navy-2); color: white; }
:root body .add-button:hover { background: var(--navy); border-color: var(--navy); }
:root body .add-button:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.add-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.summary-facts dt .form-help__content { text-transform: none; letter-spacing: normal; font-weight: 400; }

/* Transaction task hierarchy: assignment first, optional details below. */
.transaction-editor .transaction-assignment-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.transaction-editor .transaction-assignment-heading h3 { margin: 0; font-size: 16px; font-weight: 600; }
.transaction-editor .transaction-assignment-heading .transaction-assignment-mode__options { margin: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.transaction-editor .transaction-assignment-mode > legend.visually-hidden { float: none; width: 1px; margin: -1px; }
.transaction-editor .transaction-assignment-mode { margin: 0 0 16px; }
.transaction-editor .asset-editor__form > .dialog-form-extras { margin-bottom: 16px; }
.transaction-editor .dialog-form-extras > .summary-facts { margin: 14px 0 0; }
.transaction-editor .dialog-field--description { grid-column: 1 / -1; }
.transaction-editor .transaction-display-name-remember { grid-column: 2; }
@media (min-width: 621px) {
  .transaction-editor .bank-source-summary { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .transaction-editor .bank-source-summary > div { border-top: 0; border-left: 1px solid var(--line); }
  .transaction-editor .bank-source-summary > div:first-child { border-left: 0; }
}
@media (max-width: 620px) {
  .transaction-editor .transaction-display-name-remember { grid-column: 1; }
  .transaction-editor .transaction-assignment-heading { align-items: flex-start; flex-direction: column; gap: 10px; }
  .transaction-editor .transaction-assignment-heading .transaction-assignment-mode__options { width: 100%; }
}

.transaction-editor .dialog-field--counterparty { grid-column: auto; }

.transaction-editor .dialog-form-extras > .summary-facts { background: white; }

.transaction-editor .transaction-single-assignment { grid-template-columns: minmax(0, 1fr); }
.form-field-label-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.form-field-label-row label { margin: 0; }
.transaction-editor .form-field-label-row .category-create-link { padding: 0; line-height: 1.2; }
.transaction-editor .transaction-single-assignment .form-field--checkbox { align-items: flex-start; }

.transaction-editor .transaction-display-section { margin-bottom: var(--form-section-gap); }

.transaction-assignment-actions { display: flex; align-items: center; gap: 12px; }
.transaction-assignment-actions .transaction-split-add { flex-shrink: 0; }


/* Sales installments use one shared list across share classes. */
.share-sale-rates-table { min-width: 940px; }
.share-sale-rates-table td:nth-child(3) { max-width: 170px; white-space: normal; overflow-wrap: anywhere; }
.share-sale-rates-table :is(td:nth-child(1), td:nth-child(2), td:nth-child(4), td:nth-child(5), td:nth-child(6), td.numeric) { white-space: nowrap; }
.share-sale-rates-table :is(th, td) { padding-inline: 10px; }
.share-sale-rates-table thead th { white-space: normal; }
.share-sale-rates-table .numeric { font-variant-numeric: tabular-nums; }


/* Steuerdeckung: Ist-Reserve, geplante Zuführung und verbleibende Lücke. */
.dashboard-tax-accrued-track { height: 10px; }
.dashboard-tax-accrued-track span { background: var(--navy-3); }
.dashboard-tax-projection { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.dashboard-tax-projection-track { height: 10px; }
.dashboard-tax-projection-track span { border-radius: 0; }
.dashboard-tax-projection .tax-segment-current { background: var(--flow-in); }
.dashboard-tax-projection .tax-segment-planned { background: var(--positive-soft); }
.dashboard-tax-projection .tax-segment-uncovered { background: var(--danger-soft); }
.dashboard-tax-projection-legend { display: flex; align-items: baseline; flex-wrap: wrap; column-gap: 20px; row-gap: 8px; margin-top: 8px; }
.dashboard-tax-projection-legend > div { display: flex; align-items: baseline; gap: 8px; flex-shrink: 0; white-space: nowrap; }
.dashboard-tax-projection-legend span { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.dashboard-tax-projection-legend i { width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; }
.dashboard-tax-projection-legend strong { flex-shrink: 0; text-align: right; font-size: 14px; color: var(--navy-2); font-variant-numeric: tabular-nums; }

@media (min-width: 1101px) and (max-width: 1366px) {
  .dashboard-tax-projection-legend { column-gap: 12px; }
  .dashboard-tax-projection-legend > div { gap: 4px; }
  .dashboard-tax-projection-legend span { gap: 4px; font-size: 12px; }
  .dashboard-tax-projection-legend strong { font-size: 13px; }
}


.dashboard-tax-panel .dashboard-tax-main-kpi strong.dashboard-tax-main-kpi--covered { color: var(--positive); }

.dashboard-tax-main-kpi-value { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.dashboard-tax-panel .dashboard-tax-coverage-heading .dashboard-tax-main-kpi-value > .currency-badge { align-self: center; margin-top: 0; font-size: var(--badge-font-size); }

@media (min-width: 1101px) {
  .dashboard-grid--summary :is(.dashboard-entity-panel, .dashboard-tax-panel) { align-self: stretch; }
  .dashboard-grid--summary .dashboard-entity-panel { display: flex; flex-direction: column; gap: 12px; }
  :root body .dashboard-grid--summary .ui-panel-heading--compact { margin-bottom: 0; }
  .dashboard-grid--summary .dashboard-tax-panel { display: flex; flex-direction: column; }
  .dashboard-tax-panel .dashboard-tax-coverage { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto auto; gap: 12px; align-content: start; }
  .dashboard-tax-panel .dashboard-tax-coverage-heading { grid-row: 1; margin-bottom: 0; }
  .dashboard-tax-panel .dashboard-tax-progress-block { grid-row: 2; }
  .dashboard-tax-panel .dashboard-tax-projection { grid-row: 3; margin-top: 0; padding-top: 12px; }
  .dashboard-entity-panel > .panel-heading { margin-bottom: 12px; }
  .dashboard-entity-panel .entity-comparison { flex: 0 0 auto; border-spacing: 0 4px; }
  .dashboard-entity-panel .entity-comparison thead { height: 24px; }
  .dashboard-entity-panel .entity-comparison tbody :is(th, td) { padding: 4px 10px; }
}
.cost-monthly-panel .chart-category-select { max-width: 100%; }
.cost-monthly-panel .chart-legend[hidden] { display: none; }

#cost-stack-chart.is-category-focus .cost-stack-month-summary > strong { color: var(--navy-2); font-size: var(--chart-value-font-size); font-weight: var(--chart-value-font-weight); }

/* Shared compact segmented controls for charts and valuation views. */
.chart-range-switch.chart-range-switch { display: inline-flex; width: max-content; gap: 0; margin: 0; padding: 2px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface-3); }
.chart-range-switch > :is(button, a) { display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; min-height: 28px; height: auto; padding: 0 12px; border: 0; border-radius: 4px; background: transparent; color: var(--muted); font-size: 12px; font-weight: var(--tab-font-weight); line-height: 1.25; white-space: nowrap; }
.chart-range-switch > :is(button, a):hover { color: var(--navy-2); }
.chart-range-switch > :is(.active, [aria-pressed="true"], [aria-selected="true"]) { background: white; box-shadow: 0 1px 4px rgba(11,31,58,.12); color: var(--navy-2); }
.chart-range-switch > :is(button, a):focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }
.chart-range-label--compact { display: none; }
@media (max-width: 760px) {
  .chart-range-switch.chart-range-switch { width: 100%; max-width: 100%; min-width: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chart-range-switch:has(> :nth-child(3)):not(:has(> :nth-child(4))) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .chart-range-switch:has(> :nth-child(4)):not(:has(> :nth-child(5))) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .chart-range-switch:has(> :nth-child(5)) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .chart-range-switch > :is(button, a) { min-width: 0; min-height: 36px; padding: 4px 6px; white-space: normal; overflow-wrap: normal; }
  .chart-range-label--full { display: none; }
  .chart-range-label--compact { display: inline; }
  .dividend-overview-actions.dividend-overview-actions { width: 100%; flex-wrap: wrap; }
}
@media (max-width: 360px) {
  .chart-range-switch:has(> :nth-child(4)):not(:has(> :nth-child(5))) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* One colour contract for page segmented controls, based on Analyse / Buchungen. */
:root {
  --segment-background: var(--surface-3);
  --segment-border: var(--line-strong);
  --segment-text: var(--muted);
  --segment-active-background: white;
  --segment-active-text: var(--navy-2);
  --segment-active-shadow: 0 1px 4px rgba(11,31,58,.1);
}
:root body :is(.topbar-tabs, .section-tabs, .share-class-table-tabs, .chart-range-switch) {
  background: var(--segment-background); border-color: var(--segment-border); border-radius: 6px;
}
:root body :is(.topbar-tabs, .section-tabs, .share-class-table-tabs, .chart-range-switch) > :is(a, button) {
  background: transparent; color: var(--segment-text); border-radius: 4px;
}
:root body :is(.topbar-tabs, .section-tabs, .share-class-table-tabs, .chart-range-switch) > :is(a, button):not(:is(.active, [aria-selected="true"], [aria-pressed="true"])):hover {
  color: var(--segment-hover-text, var(--segment-active-text));
}
:root body :is(.topbar-tabs, .section-tabs, .share-class-table-tabs, .chart-range-switch) > :is(.active, [aria-selected="true"], [aria-pressed="true"]) {
  background: var(--segment-active-background); color: var(--segment-active-text); box-shadow: var(--segment-active-shadow);
}
:root body :is(.topbar-tabs, .section-tabs, .share-class-table-tabs, .chart-range-switch) > :is(a, button):focus-visible {
  outline: 2px solid var(--blue); outline-offset: 1px;
}
.topbar-tabs--global {
  --segment-hover-text: var(--navy-2);
  --segment-background: var(--dialog-segment-background);
  --segment-active-background: var(--dialog-segment-active-background);
  --segment-active-text: var(--dialog-segment-active-text);
  --segment-active-shadow: none;
}
.topbar-actions:has(> .topbar-tabs--global) {
  --topbar-control-font-size: 14px;
}
:root body .topbar-actions:has(> .topbar-tabs--global) :is(.primary-button, .secondary-button, .topbar-tabs > a) {
  font-size: var(--topbar-control-font-size);
  font-weight: var(--tab-font-weight);
}
.dividend-rates-table :is(th, td) { white-space: nowrap; }

.dividend-amount { display: inline-flex; flex-direction: column; align-items: flex-end; line-height: 1.4; vertical-align: middle; }
.dividend-amount small { color: var(--muted); font-size: 11px; font-weight: 400; }

.forecast-svg-tooltip rect.forecast-svg-tooltip__badge { fill: #e8edf3; stroke: none; }
.forecast-svg-tooltip rect.forecast-svg-tooltip__badge--company { fill: #173b63; }
.forecast-svg-tooltip__badge-text { fill: #526579; font-size: 9px; font-weight: 400; }

.forecast-svg-tooltip__badge-text--company { fill: #fff; }

/* Changes use the same label/value layout as the liquidity tooltip. */
.change-tooltip { min-width: 245px;   }
.change-tooltip > small { display: block; margin-bottom: 10px;  }
.change-tooltip > div { gap: 24px; }
.change-tooltip > div > :last-child { flex-shrink: 0; text-align: right; font-variant-numeric: tabular-nums; }
.change-tooltip hr { margin: 9px 0; border: 0; border-top: 1px solid #d8dee7; }

/* Annual dividend overview: progress follows the claim currency. */
.dividend-progress-cell { min-width: 240px; }
.dividend-progress-label { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.dividend-progress { display: block; width: 100%; height: 8px; margin: 7px 0; border: 0; border-radius: 6px; overflow: hidden; appearance: none; background: var(--surface-3); }
.dividend-progress::-webkit-progress-bar { background: var(--surface-3); border-radius: 6px; }
.dividend-progress::-webkit-progress-value { background: var(--green); border-radius: 6px; }
.dividend-progress::-moz-progress-bar { background: var(--green); border-radius: 6px; }
.dividend-year-table .dividend-amount { white-space: nowrap; }
.dividend-progress-cell .currency-secondary { white-space: normal; }
.dividend-rates-table :is(th, td) { padding-inline: 8px; }
@media (max-width: 1100px) {
  .dividend-rates-table :is(th, td) { white-space: normal; }
}
.dividend-rates-table .dividend-amount,
.dividend-rates-table :is(.danger-button, .table-action-button) { white-space: nowrap; overflow-wrap: normal; }

/* Dividend actions follow the shared right-edge and heading contract. */
.dividend-year-table, .dividend-rates-table, .dividend-receipts-table { --table-action-width: 140px; }
.dividend-rates-table :is(th.table-action-heading, td.table-action-cell) { padding-left: 17px; }
.dividend-receipts-table :is(td, .currency-secondary) { white-space: normal; overflow-wrap: anywhere; }
.dividend-receipts-table .table-action-button { white-space: nowrap; overflow-wrap: normal; }
.dividend-manual-history { margin-top: 16px; }

.dividend-confirmation-cell .badge { margin: 2px 0; }
/* Keep the action visible when a narrow dialog requires table scrolling. */
.dividend-rates-table :is(th.table-action-heading, td.table-action-cell) { position: sticky; right: 0; z-index: 1; background: var(--surface); }
.dividend-rates-table th.table-action-heading { background: var(--surface-3); }

.dividend-overview-actions { flex: 0 0 auto; flex-wrap: nowrap; align-items: center; }
.dividend-overview-actions .secondary-button { white-space: nowrap; }

.dividend-header-balance { text-align: right; font-size: 16px; line-height: 1.4; }
.dividend-header-balance--open, .dividend-header-balance--open .dividend-amount small { color: var(--danger); }

:root body .dividend-header-currency { --badge-bg: white; background: white; }

/* Header links styled as buttons retain the shared button text weight. */
.panel-heading a.secondary-button { font-weight: 500; }
.dividend-overview-actions > .currency-badge { align-self: center; }

.dividend-rates-table .dividend-rate-group { background: var(--dialog-section-bg); color: var(--navy-2); text-align: center; font-size: var(--table-body-font-size); font-weight: 500; letter-spacing: normal; text-transform: none; vertical-align: middle; }

/* One selected currency throughout the dividend rate preview. */
[data-dividend-currency="DKK"] [data-amount-currency="CHF"],
[data-dividend-currency="CHF"] [data-amount-currency="DKK"] { display: none; }

.dividend-rates-table .dividend-rate-group { font-weight: 700; }

/* Monetary values inside KPI tooltips are body text, including currency. */
.metric-info .metric-info__content .metric-currency { font-size: inherit; font-weight: inherit; color: inherit; letter-spacing: inherit; }

/* The final grouped rate has no closing line, including multi-row groups. */
.dividend-rates-table tbody tr:not(:has(~ tr .dividend-rate-group)) > .dividend-rate-group { border-bottom: 0; }

/* Property equity planning uses the shared cards, forms and dialog shell. */
.equity-page-heading { margin-bottom:0; }
.equity-chart-wrap { width:100%; min-width:0; }
#equity-chart { width:100%; height:520px; display:block; }
.equity-chart-line { fill:none; stroke-width:2.5; stroke-linejoin:round; }
.equity-chart-line--cash { stroke:var(--blue); }
.equity-chart-line--total { stroke:var(--positive); }
.equity-chart-line--need { stroke:var(--warning); stroke-dasharray:5 5; }
.equity-chart-point--cash { fill:var(--blue); }
.equity-chart-point--total { fill:var(--positive); }
.equity-chart-point--need { fill:var(--warning); }
.equity-chart-guide { stroke:var(--muted); opacity:.35; stroke-width:1; }
.equity-chart-hit { cursor:pointer; }
.equity-chart-legend { justify-content:flex-start; flex-wrap:wrap; margin-bottom:12px; }
.equity-chart-legend i { width:18px; height:3px; border-radius:0; }
.equity-legend-cash { background:var(--blue); }
.equity-legend-total { background:var(--positive); }
.equity-legend-need { background:var(--warning); }
.equity-month-range { appearance:none; -webkit-appearance:none; display:block; height:24px; min-height:0; padding:0; border:0; border-radius:0; background:transparent; margin:8px 0 0; cursor:pointer; }
.equity-month-range::-webkit-slider-runnable-track { height:6px; border:1px solid var(--line-strong); border-radius:4px; background:linear-gradient(to right,var(--navy) 0 var(--equity-range-progress,0%),var(--surface-3) var(--equity-range-progress,0%) 100%); }
.equity-month-range::-webkit-slider-thumb { appearance:none; -webkit-appearance:none; width:20px; height:20px; border:0; border-radius:50%; background:var(--navy); margin-top:-8px; }
.equity-month-range::-moz-range-track { height:4px; border:1px solid var(--line-strong); border-radius:4px; background:var(--surface-3); }
.equity-month-range::-moz-range-progress { height:4px; border-radius:4px; background:var(--navy); }
.equity-month-range::-moz-range-thumb { width:20px; height:20px; border:0; border-radius:50%; background:var(--navy); }
.equity-month-range:focus-visible { outline:2px solid var(--blue); outline-offset:3px; }
.equity-gap-row { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:10px; padding-top:16px; margin-top:12px; border-top:1px solid var(--line); font-size:13px; }
.equity-company-summary { margin-top:20px; grid-template-columns:repeat(2,minmax(0,1fr)); }
.equity-footnote { margin-top:12px; }
.equity-owner { display:block; margin-top:3px; color:var(--muted); font-size:11px; }
.equity-page-title { display:flex; align-items:center; gap:8px; }
.equity-page-title .metric-info { position:relative; inset:auto; }
.equity-payment-entry { margin-bottom:16px; }
.equity-payment-delete { margin-top:8px; width:max-content; }
@media(max-width:760px) { .equity-page-heading { align-items:flex-start; flex-wrap:wrap; } .equity-editor .asset-editor__header { flex-wrap:wrap; gap:14px; } }
.equity-payment-entry[data-delete="true"] .dialog-form-sections { opacity:.5; }
.equity-payment-delete svg { width:16px; height:16px; }
.equity-chart-legend .equity-legend-cash { background:var(--blue); }
.equity-chart-legend .equity-legend-total { background:var(--positive); }
.equity-chart-legend .equity-legend-need { background:var(--warning); }
.equity-planning .metric-card--primary:has(strong.negative) { background:var(--danger-bg); border-color:var(--danger); }
.equity-planning .metric-card--primary:has(strong.negative) :is(span,small) { color:var(--danger); }

/* Reusable table selection: native checkbox semantics, shared Lucide check. */
.table-selection-control { display:inline-grid; place-items:center; width:40px; height:38px; vertical-align:middle; cursor:pointer; }
:root body .table-selection-control .table-selection-checkbox { appearance:none; -webkit-appearance:none; grid-area:1 / 1; box-sizing:border-box; width:22px; height:22px; min-height:0; padding:0; margin:0; border:1.5px solid var(--line-strong); border-radius:5px; background:var(--surface); cursor:inherit; transition:background .12s,border-color .12s; }
.table-selection-control .table-selection-check { grid-area:1 / 1; width:16px; height:16px; color:var(--surface); pointer-events:none; visibility:hidden; }
:root body .table-selection-control .table-selection-checkbox:checked { background:var(--navy-2); border-color:var(--navy-2); }
.table-selection-checkbox:checked + .table-selection-check { visibility:visible; }
:root body .table-selection-control:hover .table-selection-checkbox:not(:disabled) { border-color:var(--navy-3); }
:root body .table-selection-control .table-selection-checkbox:focus-visible { outline:2px solid var(--blue); outline-offset:3px; }
.table-selection-control:has(:disabled) { opacity:.5; cursor:wait; }
.equity-source-table { --table-action-width:96px; }
.equity-source-table tbody td { padding-block:3px; vertical-align:middle; }
.equity-source-table td:nth-child(4) { padding-left:7px; }
@media(pointer:coarse) { .table-selection-control { width:44px; height:44px; } }
@media(prefers-reduced-motion:reduce) { :root body .table-selection-control .table-selection-checkbox { transition:none; } }

.equity-source-group th { padding-block:6px; background:var(--surface-2); color:var(--navy-2); }
.equity-source-table .table-selection-control { height:34px; }
@media(pointer:coarse) { .equity-source-table .table-selection-control { height:44px; } }
.equity-chart-panel { position:relative; }
.equity-component-legend { display:flex; flex-wrap:wrap; justify-content:flex-start; gap:8px 18px; margin:12px 0 18px; font-size:12px; }
.equity-component-legend > span { display:inline-flex; gap:6px; align-items:center; }
.equity-component-legend i { width:12px; height:12px; flex-shrink:0; border-radius:2px; }
.equity-chart-line--net { stroke:var(--navy); stroke-width:2.5; }
.equity-chart-point--net { fill:var(--navy); }
.equity-chart-zero { stroke:var(--muted); stroke-width:1; }
.equity-chart-tooltip { position:absolute; z-index:5; pointer-events:none; width:min(380px,calc(100% - 16px)); padding:12px 14px; background:var(--surface);  border:1px solid var(--line); border-radius:8px; box-shadow:var(--shadow);  }
.equity-chart-tooltip > div { display:flex; align-items:baseline; justify-content:space-between; gap:14px; margin-top:6px; }
.equity-chart-tooltip > div strong { white-space:nowrap;  }
.equity-tooltip-total { padding-top:8px; border-top:1px solid var(--line); }


/* Explicit disabled rendering also covers Safari text painting. */
:root body :is(.dialog-standard) .form-field :is(input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]), select, textarea):disabled { color:var(--field-disabled-color); -webkit-text-fill-color:var(--field-disabled-color); opacity:1; background-color:var(--surface-3); border-color:var(--line); }

/* Four equity cards share one row on tablet and desktop. */
.equity-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.equity-metrics .metric-card > span:not(.metric-info) { white-space: nowrap; }

@media (max-width: 599px) {
  .equity-metrics { gap: 10px; }
          .equity-component-legend { gap: 10px; }
  .equity-legend-group { flex-basis: 100%; }
}


.equity-component-info.metric-info { position:relative; inset:auto; margin-left:6px; vertical-align:middle; }
.equity-component-info-line { display:block; margin-top:5px; }

.equity-component-info:hover, .equity-component-info:focus-within, .equity-component-info:has(.form-help__trigger[aria-expanded="true"]) { z-index:60; }


.equity-component-legend { align-items:flex-start; }
.equity-legend-group { flex:1 1 220px; }
.equity-legend-group > strong { display:block; margin-bottom:6px; font-size:11px; font-weight:600; color:var(--muted); }
.equity-legend-items { display:flex; flex-wrap:wrap; gap:6px 14px; }
.equity-legend-items > span { display:inline-flex; align-items:center; gap:6px; }
.equity-component-legend > .equity-legend-net { flex-basis:100%; }
:is(.equity-legend-option, .chart-legend-toggle) { border:1px solid transparent; border-radius:4px; background:transparent; color:var(--muted); font:inherit; cursor:pointer; text-align:left; }
:is(.equity-legend-option, .chart-legend-toggle):hover, :is(.equity-legend-option, .chart-legend-toggle)[aria-pressed="true"] { color:var(--ink); background:var(--surface-2); border-color:var(--line-strong); }
:is(.equity-legend-option, .chart-legend-toggle):focus-visible { outline:2px solid var(--blue); outline-offset:2px; }
.chart-legend-toggle[aria-pressed="false"] i { opacity:.35; }
.equity-legend-net { display:flex; align-items:center; flex-wrap:wrap; justify-content:space-between; gap:8px; }
.equity-component-detail { max-width:520px; margin:16px 0; padding:14px; background:var(--surface-2); border-radius:8px; font-size:12px; }
.equity-component-detail > div { display:flex; justify-content:space-between; align-items:baseline; gap:14px; margin-top:6px; }
.equity-component-detail > div strong { white-space:nowrap; font-variant-numeric:tabular-nums; }
.equity-component-detail > p, .equity-chart-tooltip > p { margin:8px 0; }

.investment-tooltip-section { margin-top: 10px; padding-top: 9px; border-top: 1px solid var(--line); }
.investment-history-canvas .chart-tooltip .investment-tooltip-metric { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-top: 4px; }
.investment-history-canvas .chart-tooltip .investment-tooltip-metric > span { margin-top: 0; }
.investment-tooltip-metric > span:last-child { white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums; }
.investment-history-canvas .chart-tooltip { max-width: min(390px, calc(100% - 16px)); }

.investment-history-canvas .chart-tooltip .investment-tooltip-metric > span.positive { color: var(--positive); }
.investment-history-canvas .chart-tooltip .investment-tooltip-metric > span.negative { color: var(--red); }

/* Annual tax comparison: shared chart typography, palette and tooltip. */
.tax-year-chart-legend { justify-content: flex-start; margin-bottom: 16px; }
.tax-year-chart-legend span[hidden] { display: none; }
.tax-year-chart-legend i.tax-year-swatch { width: 12px; height: 12px; border-radius: 3px; }
.tax-year-chart-legend i.tax-year-swatch--cantonal { background: #315f87; }
.tax-year-chart-legend i.tax-year-swatch--federal { background: #659e9b; }
.tax-year-chart-legend i.tax-year-swatch--unallocated { background: #7e8794; }
.tax-year-chart-legend i.tax-year-swatch--forecast { background: #b8cddd; }
.tax-year-chart-shell { position: relative; }
.tax-year-chart-scroll { overflow-x: auto; }
#tax-year-chart > svg { display: block; width: 100%; height: 320px; }
.tax-year-chart-hit { fill: transparent; pointer-events: all; }
.tax-year-chart-column { cursor: var(--chart-hover-cursor); }
.tax-year-chart-column:focus { outline: none; }
.tax-year-chart-column:hover .tax-year-chart-hit, .tax-year-chart-column:focus-visible .tax-year-chart-hit { fill: #315f87; fill-opacity: .07; stroke: #315f87; stroke-opacity: .4; }
.tax-year-chart-tooltip { width: 360px; max-width: 100%; }
.tax-year-chart-tooltip > small { display: block; margin-top: 8px; color: var(--muted); }

.tax-year-chart-legend[hidden] { display: none; }
.tax-year-chart-legend i.tax-year-swatch--paid { background: var(--blue); }
.tax-year-chart-legend i.tax-year-swatch--reserved { background: var(--flow-in); }
.tax-year-chart-legend i.tax-year-swatch--uncovered { background: var(--danger-soft); }

/* Equity source controls remain visible together on a phone. */
@media (max-width: 599px) {
  .equity-editor .asset-editor__tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
  .equity-editor .asset-editor__tabs [role="tab"] { min-width: 0; white-space: normal; }
  .equity-editor .equity-source-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .equity-editor .equity-source-table tbody { display: block; }
  .equity-editor .equity-source-table tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 3px 6px; padding: 10px 0; border-top: 1px solid var(--line); }
  .equity-editor .equity-source-table tbody :is(th, td) { border: 0; padding: 0; }
  .equity-editor .equity-source-table tbody td:first-child { grid-column: 1; grid-row: 1; overflow-wrap: anywhere; }
  .equity-editor .equity-source-table tbody td:nth-child(2) { grid-column: 1; grid-row: 2; font-size: 11px; color: var(--muted); overflow-wrap: anywhere; }
  .equity-editor .equity-source-table tbody td:nth-child(3) { grid-column: 1; grid-row: 3; text-align: left; }
  .equity-editor .equity-source-table tbody td:nth-child(4) { grid-column: 2; grid-row: 1 / 4; }
  .equity-editor .equity-source-table tbody td:nth-child(5) { grid-column: 3; grid-row: 1 / 4; }
  .equity-editor .equity-source-table tbody .equity-source-group { display: block; padding: 8px; background: var(--surface-2); }
}

/* Equity tables fit their container; help must escape its edges in Safari too. */
.equity-chart-panel { overflow: visible; }
@media (min-width: 600px) and (max-width: 900px) {
}

/* Company distribution is a sequential calculation, not a sortable ledger. */
.company-distribution-note { margin: 0; padding: 16px 24px 20px; }
.company-distribution-panel .table-total { background: var(--surface-3); }
.company-distribution-panel .table-total td { font-weight: 600; }
@media (max-width: 620px) { .company-distribution-note { padding: 12px 18px 16px; } }

.holdings-value-amount { display: inline-flex; justify-content: flex-end; align-items: center; gap: 6px; }

.metric-info.metric-info--inline { position: relative; inset: auto; flex: 0 0 auto; }
.metric-info--inline .metric-info__content.is-viewport-positioned { position: fixed; top: var(--tooltip-top); left: var(--tooltip-left); right: auto; z-index: 50; }

.metric-info--inline:is(:hover, :focus-within, :has(.form-help__trigger[aria-expanded="true"])) { z-index: 60; }

.distribution-waterfall { padding: 0 24px; }
.distribution-waterfall svg { display: block; width: 100%; height: 320px; }
.distribution-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; padding: 0 24px 16px; }
.distribution-summary > div { display: grid; gap: 6px; padding: 12px 16px; background: var(--surface-3); border-radius: 8px; }
.distribution-summary span { color: var(--muted); font-size: 12px; }
.distribution-summary strong { color: var(--navy); font-size: 20px; }
@media (max-width: 640px) {
  .distribution-waterfall { padding: 0 18px; }
  .distribution-waterfall svg { width: 640px; min-width: 640px; height: 320px; }
  .distribution-summary { grid-template-columns: 1fr; gap: 8px; padding: 0 18px 12px; }
  .distribution-summary > div { grid-template-columns: 1fr auto; align-items: center; }
}

.share-icon-label { display: flex; align-items: center; gap: 8px; }
.share-fact-icon { width: 16px; height: 16px; flex: 0 0 auto; color: var(--blue); }
.share-holdings-section > .fc-investment-heading .share-fact-icon { width: 22px; height: 22px; }

.share-class-card .share-fact-grid > div { position: relative; padding-right: 68px; }
.share-class-card .share-fact-grid .share-icon-label { display: block; }
.share-class-card .share-fact-grid .share-fact-icon { position: absolute; right: 22px; top: 50%; transform: translateY(-50%); width: 30px; height: 30px; opacity: .6; }
@media (max-width: 620px) {
  .share-class-card .share-fact-grid .share-fact-icon { right: 18px; }
}

.sidebar-fx { display: grid; gap: 1px; margin-inline: 10px; padding: 11px 0; border-top: 1px solid rgba(255,255,255,.13); border-bottom: 1px solid rgba(255,255,255,.13); color: rgba(255,255,255,.88); text-decoration: none; }
.sidebar-fx__caption, .sidebar-fx__date { color: rgba(255,255,255,.58); font-size: 10px; }
.sidebar-fx__value { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; }
.sidebar-fx strong { font-size: 14px; font-variant-numeric: tabular-nums; color: #fff; }
.sidebar-fx:hover strong, .sidebar-fx:focus-visible strong { color: #c9e1f5; }

/* FX charts reuse the liquidity chart components and shared typography. */
.fx-settings {display:grid;gap:var(--page-box-gap, 24px);min-width:0}
.fx-settings > *, .fx-settings-container {min-width:0}
.fx-settings > .panel, .fx-settings form > .panel {margin:0}
.fx-chart-note {margin:8px 0 0}
.fx-settings svg[hidden] {display:none}

.company-distribution-panel > .panel-heading > .chart-heading-tools {
  
  
  
  
  flex-shrink: 0;
  
  
  margin-left: auto;
}
.company-distribution-panel > .panel-heading > .chart-heading-tools > .currency-badge {
  margin: 0;
}

.company-distribution-panel > .panel-heading { margin-bottom: 8px; }

.chart-legend .legend-fx-reference { background: radial-gradient(circle, #7899b7 1px, transparent 1.2px) 0 center / 5px 3px repeat-x; }


@media (max-width: 760px) {
  .sidebar { padding-top: 18px; padding-bottom: 16px; }
  .sidebar .primary-nav { margin-top: 18px; gap: 2px; align-content: start; }
  .sidebar .nav-group-label { margin-top: 8px; margin-bottom: 3px; }
  .sidebar .nav-group-label:first-child { margin-top: 0; }
  .sidebar .nav-item { min-height: 44px; padding-top: 9px; padding-bottom: 9px; }
  .sidebar-footer { gap: 10px; }
}

/* Heading words wrap at spaces or language-aware hyphenation, never arbitrary letters. */
:root body table thead :is(th, .table-sort-button) { overflow-wrap: normal; word-break: normal; hyphens: auto; }
.table-header-word { white-space: nowrap; hyphens: none; }
@media (max-width: 599px) {
}

:root body :is(.data-card__heading strong, .loan-pdf-dialog .asset-editor__header h2, .property-review-heading h3, .cost-chart-label) { overflow-wrap: normal; word-break: normal; hyphens: auto; }
@media (max-width: 360px) {
}

/* Dialog footer actions stay together and align to the right at every width. */
:root body dialog :is(.asset-editor__actions, .tax-dialog-actions, .form-actions) {
  display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: flex-end;
}
:root body dialog :is(.asset-editor__actions, .tax-dialog-actions, .form-actions) > * {
  flex: 0 0 auto; width: auto; margin-left: 0; margin-right: 0;
}
:root body dialog :is(.asset-editor__actions, .tax-dialog-actions, .form-actions) > .secondary-button { order: 1; }
:root body dialog :is(.asset-editor__actions, .tax-dialog-actions, .form-actions) > .primary-button { order: 2; }
:root body dialog:is([data-delete-confirmation], .delete-confirmation-dialog, .valuation-delete-editor) .asset-editor__actions > .danger-button { order: 2; }

.waterfall-tooltip { position: fixed; z-index: 1200; width: 390px; max-width: calc(100vw - 16px); max-height: calc(100dvh - 16px); overflow: auto; box-sizing: border-box; padding: 14px; background: #fff; border: 1px solid #dfe4eb; border-radius: 6px; box-shadow: 0 6px 18px rgba(11,31,58,.16);    }
.waterfall-tooltip[hidden] { display: none; }
.waterfall-tooltip p { margin: 8px 0 12px; }
.waterfall-tooltip__row { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-top: 6px; }
.waterfall-tooltip__row strong { white-space: nowrap;  font-variant-numeric: tabular-nums; }
.waterfall-tooltip__result { border-top: 1px solid #d8dee7; padding-top: 8px; margin-top: 10px; }
.waterfall-bar[role="button"] { cursor: var(--chart-hover-cursor); }
.waterfall-bar:focus-visible { outline: 2px solid #315f87; outline-offset: 3px; }
.income-waterfall-heading > .chart-intro {  margin: 0; }



/* Shared tooltip viewport contract. Top-layer placement preserves ancestor styles. */
.viewport-chart-tooltip {
  position: fixed !important; inset: auto !important; margin: 0 !important;
  left: var(--chart-tooltip-left, 12px) !important;
  top: var(--chart-tooltip-top, 12px) !important;
  transform: none !important; box-sizing: border-box;
  min-width: 0 !important;
  max-width: var(--chart-tooltip-width) !important;
  max-height: var(--chart-tooltip-height) !important;
  overflow: auto; overflow-wrap: anywhere; pointer-events: auto;
}
.viewport-chart-tooltip[hidden] { display: none !important; }
.viewport-chart-tooltip.is-pointer-pass-through { pointer-events: none !important; }
:is(.form-help__trigger, svg [aria-describedby], [role="button"][aria-describedby], [data-tooltip]) { cursor: var(--chart-hover-cursor); }

.form-help__content.is-viewport-positioned[popover] { margin: 0; bottom: auto; }

.liquidity-cashflow-tooltip .waterfall-tooltip__row > b { flex-shrink: 0;  }
.liquidity-tooltip-scope { display: inline-block; min-width: 40px; margin-right: 8px; padding: 1px 5px; border-radius: 8px; background: #e8edf3; color: #526579; text-align: center; font-size: 9px; }
.liquidity-tooltip-scope--company { background: #173b63; color: #fff; }



[data-theme-toggle] [data-theme-icon] { display: grid; place-items: center; line-height: 0; }
[data-theme-toggle] [data-theme-icon][hidden] { display: none; }

.appearance-options { display: flex; flex-wrap: wrap; gap: 8px; }
:root body .appearance-options > .secondary-button:not(.mobile-menu) { flex: 1 1 0; }
:root body .appearance-options .secondary-button[aria-pressed="true"] { background: #426d94; border-color: #426d94; color: white; }

.appearance-dialog-panel { display: grid; gap: var(--form-row-gap); }
.appearance-dialog-panel > .help-text { margin: 0; }
