/* Alex Finanz-Flussdiagramm – scoped styles */
.alex-ffd {
  --ffd-ink: #172b3a;
  --ffd-muted: #617383;
  --ffd-line: #dce5eb;
  --ffd-soft: #f5f8fa;
  --ffd-accent: #147d70;
  --ffd-accent-dark: #0e6258;
  --ffd-warn: #a45b12;
  color: var(--ffd-ink);
  font: inherit;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.alex-ffd *, .alex-ffd *::before, .alex-ffd *::after { box-sizing: border-box; }
.alex-ffd__intro { margin: 0 0 22px; }
.alex-ffd__eyebrow { color: var(--ffd-accent); font-size: 12px; font-weight: 800; letter-spacing: .09em; margin: 0 0 7px; }
.alex-ffd__intro h2 { font-size: clamp(23px, 3vw, 32px); line-height: 1.2; margin: 0 0 9px; color: var(--ffd-ink); }
.alex-ffd__intro p:last-child { color: var(--ffd-muted); margin: 0; max-width: 760px; line-height: 1.55; }
.alex-ffd__toolbar { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; margin: 20px 0 14px; }
.alex-ffd__period { display:inline-flex; background:#edf2f4; padding:4px; border-radius:10px; gap:3px; }
.alex-ffd button { cursor:pointer; font:inherit; }
.alex-ffd__period button { border:0; background:transparent; color:var(--ffd-muted); border-radius:7px; padding:8px 18px; font-weight:700; }
.alex-ffd__period button.is-active { background:#fff; color:var(--ffd-ink); box-shadow:0 1px 4px #1730471a; }
.alex-ffd__reset { border:1px solid var(--ffd-line); background:#fff; color:var(--ffd-muted); border-radius:8px; padding:9px 12px; font-size:13px; }
.alex-ffd__summary { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; margin-bottom:12px; }
.alex-ffd__metric { background:var(--ffd-soft); border:1px solid var(--ffd-line); border-radius:12px; padding:15px 17px; min-width:0; }
.alex-ffd__metric span { display:block; color:var(--ffd-muted); font-size:13px; margin-bottom:7px; }
.alex-ffd__metric strong { display:block; font-size:clamp(19px,2.3vw,25px); line-height:1.2; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
.alex-ffd__metric--balance { background:#eef7f4; border-color:#cce5dc; }
.alex-ffd__metric--balance.is-negative { background:#fff5ee; border-color:#f0d6c2; }
.alex-ffd__notice { min-height:0; margin:0 0 12px; color:var(--ffd-warn); font-size:13px; line-height:1.45; }
.alex-ffd__editors { display:grid; grid-template-columns:minmax(0,.9fr) minmax(0,1.1fr); gap:15px; align-items:start; }
.alex-ffd__panel, .alex-ffd__chart-panel, .alex-ffd__table-wrap { border:1px solid var(--ffd-line); border-radius:14px; background:#fff; padding:17px; min-width:0; }
.alex-ffd__panel-head, .alex-ffd__chart-head { display:flex; justify-content:space-between; align-items:flex-start; gap:12px; margin-bottom:14px; }
.alex-ffd__panel h3, .alex-ffd__chart-panel h3, .alex-ffd__table-wrap h3 { color:var(--ffd-ink); font-size:18px; margin:0 0 4px; }
.alex-ffd__panel-head p, .alex-ffd__chart-head p { color:var(--ffd-muted); font-size:12px; line-height:1.4; margin:0; }
.alex-ffd__add, .alex-ffd__export { border:1px solid #b9d9d2; color:var(--ffd-accent-dark); background:#f3faf8; border-radius:8px; padding:8px 10px; font-size:12px; font-weight:750; white-space:nowrap; }
.alex-ffd__rows, .alex-ffd__categories { display:grid; gap:9px; }
.alex-ffd__entry { display:grid; grid-template-columns:minmax(0,1fr) minmax(90px,125px) 32px; gap:7px; align-items:center; }
.alex-ffd__entry input, .alex-ffd__category-name, .alex-ffd__child input { width:100%; min-width:0; border:1px solid var(--ffd-line); border-radius:7px; padding:9px 10px; background:#fff; color:var(--ffd-ink); font:inherit; font-size:13px; }
.alex-ffd__entry input:focus, .alex-ffd__category-name:focus, .alex-ffd__child input:focus { outline:2px solid #9ed1c7; outline-offset:1px; }
.alex-ffd__entry .alex-ffd__amount, .alex-ffd__child .alex-ffd__amount { text-align:right; font-variant-numeric:tabular-nums; }
.alex-ffd__remove { border:0; background:transparent; color:#8b9aa4; border-radius:6px; font-size:20px; line-height:1; padding:4px; }
.alex-ffd__remove:hover { color:#a23d3d; background:#fff1f1; }
.alex-ffd__category { border:1px solid var(--ffd-line); border-radius:10px; padding:11px; background:#fbfcfd; }
.alex-ffd__category-top { display:grid; grid-template-columns:minmax(0,1fr) 32px; gap:7px; align-items:center; margin-bottom:8px; }
.alex-ffd__category-name { font-weight:750; background:#fff; }
.alex-ffd__child-list { display:grid; gap:7px; padding-left:10px; border-left:2px solid #dcebe7; margin-left:4px; }
.alex-ffd__child { display:grid; grid-template-columns:minmax(0,1fr) minmax(90px,125px) 28px; gap:6px; align-items:center; }
.alex-ffd__child input:first-child { background:#fff; }
.alex-ffd__add-child { border:0; background:transparent; color:var(--ffd-accent-dark); font-size:12px; font-weight:700; padding:8px 0 0 13px; text-align:left; }
.alex-ffd__category-total { color:var(--ffd-muted); font-size:11px; text-align:right; margin-top:7px; font-variant-numeric:tabular-nums; }
.alex-ffd__chart-panel { margin-top:15px; }
.alex-ffd__chart-wrap { width:100%; overflow-x:auto; background:linear-gradient(180deg,#fbfdfd,#fff); border:1px solid #edf1f3; border-radius:10px; }
.alex-ffd__chart { display:block; width:100%; min-width:560px; height:auto; }
.alex-ffd__chart text { font-family:inherit; }
.alex-ffd__privacy { color:var(--ffd-muted); font-size:11px; line-height:1.45; margin:10px 0 0; }
.alex-ffd__table-wrap { margin-top:15px; }
.alex-ffd__table { border-collapse:collapse; width:100%; font-size:13px; }
.alex-ffd__table th, .alex-ffd__table td { text-align:left; padding:10px 8px; border-bottom:1px solid #edf1f3; }
.alex-ffd__table th:last-child, .alex-ffd__table td:last-child { text-align:right; font-variant-numeric:tabular-nums; }
.alex-ffd__table thead th { color:var(--ffd-muted); font-size:11px; text-transform:uppercase; letter-spacing:.04em; }
.alex-ffd__table tfoot td { font-weight:800; border-bottom:0; }
.alex-ffd__empty { color:var(--ffd-muted); padding:18px; text-align:center; font-size:13px; }
@media (max-width:760px) {
  .alex-ffd__editors { grid-template-columns:1fr; }
  .alex-ffd__summary { grid-template-columns:1fr; gap:8px; }
  .alex-ffd__metric { padding:12px 14px; }
  .alex-ffd__chart-head { flex-direction:column; }
}
@media (max-width:420px) {
  .alex-ffd__panel, .alex-ffd__chart-panel, .alex-ffd__table-wrap { padding:12px; }
  .alex-ffd__entry { grid-template-columns:minmax(0,1fr) 92px 25px; gap:5px; }
  .alex-ffd__child { grid-template-columns:minmax(0,1fr) 92px 24px; gap:4px; }
  .alex-ffd__toolbar { align-items:stretch; }
  .alex-ffd__reset { font-size:12px; }
}
