/* ============================================================
   Mein Haushaltsbuch – „Alte Datenbank anschauen“ (budgetViewer.html)
   Zusätzlich zu style.css und budget.css. Farben und Formen folgen
   dem Farbschema „Korall“ der App (Karten-Radius 22, Padding 16).
   ============================================================ */

body.page-budget {
  --hbv-income: #1f7a43;
  --hbv-expense: #c93338;
  --hbv-transfer: #6f6661;
  --hbv-warn: #b77400;
  --hbv-radius: 22px;
}

/* Ladekreis (auch auf budgetUpgrade.html) */
.hbv-spinner { display: inline-block; width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--hb-line); border-top-color: var(--hb-coral); animation: hbv-spin .8s linear infinite; flex: none; }
@keyframes hbv-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .hbv-spinner { animation-duration: 2.4s; } }

/* Ablagefläche auf budgetUpgrade.html */
.hbv-drop { margin: 18px 0; padding: 26px 20px; border: 2px dashed var(--hb-line); border-radius: var(--hbv-radius); background: var(--hb-soft); text-align: center; transition: border-color .2s, background .2s; }
.hbv-drop.is-over { border-color: var(--hb-coral); background: var(--hb-soft-2); }
.hbv-drop.is-busy { opacity: .75; pointer-events: none; }
.hbv-drop p { margin: 0 0 12px; }
.hbv-filebtn { position: relative; cursor: pointer; }
.hbv-filebtn input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.hbv-filebtn:focus-within { outline: 3px solid var(--hb-coral); outline-offset: 3px; }
.hbv-drop-status { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 14px; font-weight: 600; text-align: left; }
.hbv-drop-status.is-error { color: #8f1f24; background: #fdecec; border: 1px solid #f3c6c8; border-radius: 14px; padding: 12px 14px; }
.hbv-drop-status[hidden] { display: none; }

/* Kasten „Lokale Ansicht der alten Datenbank“ */
.hbv-local { display: flex; gap: 14px; align-items: flex-start; margin: 0 0 18px; padding: 18px 20px; border-radius: var(--hbv-radius); background: #fff; border: 2px solid var(--hb-coral); box-shadow: var(--hb-shadow); }
.hbv-local svg { flex: none; width: 34px; height: 34px; color: var(--hb-coral); }
.hbv-local h2 { margin: 0 0 6px; font-size: 19px; }
.hbv-local p { margin: 0; color: var(--hb-ink); font-size: 15px; line-height: 1.5; }
.hbv-local p + p { margin-top: 6px; }

/* Rahmen der Ansicht */
.hbv-shell { background: var(--hb-soft); border: 1px solid var(--hb-line); border-radius: 26px; padding: 18px; box-shadow: var(--hb-shadow); min-height: 320px; }
.hbv-i { width: 20px; height: 20px; flex: none; }
.hbv-fine { font-size: 13px; color: var(--text-muted); margin: 8px 0 0; line-height: 1.45; }
.neg { color: var(--hbv-expense); }
.hbv-h { margin: 22px 0 10px; font-size: 17px; }

.hbv-loading { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 280px; font-weight: 600; color: var(--text-muted); }
.hbv-start { text-align: center; padding: 34px 18px; border: 2px dashed var(--hb-line); border-radius: var(--hbv-radius); background: #fff; }
.hbv-start.is-over { border-color: var(--hb-coral); background: var(--hb-soft-2); }
.hbv-start .big { width: 46px; height: 46px; color: var(--hb-coral); }
.hbv-start h2 { margin: 10px 0 8px; font-size: 22px; }
.hbv-start p { margin: 0 auto 14px; max-width: 560px; }
.hbv-start .hb-callout { text-align: left; max-width: 620px; margin: 14px auto; }

.hbv-file { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 4px 4px 14px; }
.hbv-file > svg { color: var(--hb-coral); }
.hbv-file span b { display: block; font-size: 14px; overflow-wrap: anywhere; }
.hbv-file span i { font-style: normal; font-size: 12.5px; color: var(--text-muted); }
.hbv-ro { font-size: 12px; font-weight: 700; letter-spacing: .3px; padding: 4px 10px; border-radius: 999px; background: var(--hb-soft-2); color: var(--hb-coral); border: 1px solid #f6d3c8; }
.hbv-file-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.hbv-file-actions .hb-btn { gap: 6px; background: #fff; }
.hbv-file-actions .hbv-i { width: 17px; height: 17px; }

/* Reiter */
.hbv-tabs { display: flex; gap: 4px; padding: 5px; overflow-x: auto; border-radius: 18px; background: #fff; border: 1px solid var(--hb-line); scrollbar-width: thin; }
.hbv-tab { flex: 1 0 auto; appearance: none; border: 0; background: transparent; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 84px; min-height: 56px; padding: 8px 10px; border-radius: 13px; font: inherit; font-size: 12.5px; font-weight: 700; color: var(--text-muted); position: relative; transition: background .2s, color .2s; }
.hbv-tab:hover { background: var(--hb-soft); }
.hbv-tab[aria-selected="true"] { background: var(--hb-soft-2); color: var(--hb-coral); }
.hbv-tab:focus-visible, .hbv-shell button:focus-visible, .hbv-shell select:focus-visible, .hbv-shell input:focus-visible { outline: 3px solid var(--hb-coral); outline-offset: 2px; }
.hbv-tab small { position: absolute; top: 5px; right: 12px; min-width: 18px; padding: 0 5px; border-radius: 999px; background: var(--hbv-warn); color: #fff; font-size: 11px; line-height: 18px; }

/* Zeitraum */
.hbv-period { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 14px 0 0; }
.hbv-period > button { appearance: none; border: 1px solid var(--hb-line); background: #fff; cursor: pointer; min-width: 44px; min-height: 44px; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; color: var(--hb-ink); font: inherit; }
.hbv-period > button:hover { border-color: var(--hb-coral); }
.hbv-period-title { flex-direction: column; padding: 6px 22px; min-width: min(300px, 60vw); }
.hbv-period-title b { font-size: 17px; }
.hbv-period-title i { font-style: normal; font-size: 12.5px; color: var(--text-muted); }
.hbv-picker { margin: 10px auto 0; max-width: 560px; padding: 14px; border-radius: var(--hbv-radius); background: #fff; border: 1px solid var(--hb-line); }
.hbv-picker-year { display: flex; align-items: center; justify-content: center; gap: 18px; margin-bottom: 10px; }
.hbv-picker-year b { font-size: 18px; min-width: 64px; text-align: center; }
.hbv-picker-year button { appearance: none; border: 1px solid var(--hb-line); background: var(--hb-soft); cursor: pointer; width: 44px; height: 44px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; color: var(--hb-ink); }
.hbv-tiles { display: grid; gap: 6px; margin-top: 6px; }
.hbv-tiles.is-12 { grid-template-columns: repeat(6, 1fr); }
.hbv-tiles.is-4 { grid-template-columns: repeat(4, 1fr); }
.hbv-tiles button { appearance: none; border: 1px solid var(--hb-line); background: var(--hb-soft); cursor: pointer; min-height: 44px; border-radius: 12px; font: inherit; font-size: 14px; font-weight: 600; color: var(--hb-ink); }
.hbv-tiles button[aria-pressed="true"] { background: var(--hb-coral); border-color: var(--hb-coral); color: #fff; }

.hbv-view { margin-top: 16px; }

/* Karten */
.hbv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 14px; margin-top: 14px; }
.hbv-card { background: #fff; border: 1px solid var(--hb-line); border-radius: var(--hbv-radius); padding: 16px; min-width: 0; margin-top: 14px; }
.hbv-grid .hbv-card { margin-top: 0; }
.hbv-card h3 { margin: 0 0 10px; font-size: 15px; }
.hbv-card h4 { margin: 18px 0 4px; font-size: 14.5px; }
.hbv-card.is-list { padding-bottom: 8px; }
.hbv-empty { text-align: center; padding: 22px 10px; color: var(--text-muted); }
.hbv-empty svg { width: 34px; height: 34px; opacity: .6; }
.hbv-empty b { display: block; margin-top: 6px; color: var(--hb-ink); }
.hbv-empty p { margin: 4px 0 0; font-size: 14px; }

/* Status */
.hbv-hero { text-align: center; padding: 20px 12px 16px; background: #fff; border: 1px solid var(--hb-line); border-radius: var(--hbv-radius); }
.hbv-hero i { display: block; font-style: normal; font-size: 13px; color: var(--text-muted); }
.hbv-hero-val { appearance: none; border: 0; background: none; cursor: pointer; font: inherit; font-size: clamp(30px, 6vw, 44px); font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; color: var(--hb-ink); padding: 2px 10px; border-radius: 12px; }
.hbv-hero-val.neg { color: var(--hbv-expense); }
.hbv-hero span { display: block; font-size: 13.5px; color: var(--text-muted); }
.hbv-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-top: 12px; }
.hbv-kpi { appearance: none; text-align: left; font: inherit; background: #fff; border: 1px solid var(--hb-line); border-radius: 16px; padding: 12px 14px; min-height: 64px; color: var(--hb-ink); }
button.hbv-kpi { cursor: pointer; }
button.hbv-kpi:hover { border-color: var(--hb-coral); }
.hbv-kpi i { display: block; font-style: normal; font-size: 12.5px; color: var(--text-muted); }
.hbv-kpi b { font-size: 17px; font-variant-numeric: tabular-nums; }
.hbv-budgetbar { margin-top: 12px; background: #fff; border: 1px solid var(--hb-line); border-radius: 16px; padding: 12px 14px; }
.hbv-budgetbar > div:first-child { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 13.5px; margin-bottom: 8px; }
.hbv-budgetbar span { color: var(--text-muted); font-variant-numeric: tabular-nums; }
.hbv-bar { height: 9px; border-radius: 999px; background: var(--hb-line); overflow: hidden; }
.hbv-bar i { display: block; height: 100%; border-radius: 999px; background: #2E9E5B; }
.hbv-bar.is-warn i { background: #F2A100; }
.hbv-bar.is-over i { background: #E5484D; }
.hbv-bar.is-plain i { background: var(--hb-coral-2); }
.hbv-line { appearance: none; width: 100%; font: inherit; color: var(--hb-ink); background: none; border: 0; border-top: 1px solid var(--hb-line); display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 44px; padding: 6px 2px; text-align: left; }
.hbv-line:first-of-type { border-top: 0; }
button.hbv-line { cursor: pointer; }
button.hbv-line:hover span { color: var(--hb-coral); }
.hbv-line b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.hbv-line.is-sum { border-top: 2px solid var(--hb-ink); font-weight: 700; }
.hbv-line em, .hbv-rank em { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; }

/* Buchungszeilen (Kassenbuch) */
.hbv-list { background: #fff; border: 1px solid var(--hb-line); border-radius: var(--hbv-radius); overflow: hidden; }
.hbv-list.is-plain, .hbv-card .hbv-list { border: 0; border-radius: 0; }
.hbv-month { padding: 10px 14px 6px; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; color: var(--text-muted); background: var(--hb-soft); border-top: 1px solid var(--hb-line); }
.hbv-month:first-child { border-top: 0; }
.hbv-tx { appearance: none; width: 100%; font: inherit; color: var(--hb-ink); background: #fff; border: 0; border-top: 1px solid var(--hb-line); cursor: pointer; display: grid; grid-template-columns: 46px 4px minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 9px 12px; min-height: 56px; text-align: left; }
.hbv-tx.is-compact { grid-template-columns: 4px minmax(0, 1fr) auto auto; padding-left: 4px; padding-right: 4px; }
.hbv-tx.is-first { border-top: 2px solid #d9cdc7; }
.hbv-list > .hbv-tx:first-child, .hbv-month + .hbv-tx, .hbv-card h3 + .hbv-tx { border-top: 0; }
.hbv-tx:hover { background: var(--hb-soft); }
.hbv-tx.is-future { opacity: .5; }
.hbv-day { display: flex; flex-direction: column; align-items: center; line-height: 1.1; }
.hbv-day b { font-size: 18px; }
.hbv-day i { font-style: normal; font-size: 11.5px; color: var(--text-muted); text-transform: uppercase; }
.hbv-day.is-today b { color: var(--hb-coral); }
.hbv-day.is-full { font-size: 11.5px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.hbv-stripe { width: 4px; align-self: stretch; border-radius: 4px; min-height: 34px; }
.hbv-tx-main { min-width: 0; }
.hbv-tx-main b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbv-tx-main i { display: block; font-style: normal; font-size: 12.5px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbv-marks { display: flex; gap: 4px; color: var(--text-muted); }
.hbv-marks .hbv-i { width: 16px; height: 16px; }
.hbv-marks .m-done { color: var(--hb-coral); }
.hbv-marks .m-flag { color: var(--hbv-warn); }
.hbv-tx-amt { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hbv-tx-amt b { display: block; font-weight: 500; }
.hbv-tx.is-income .hbv-tx-amt b { font-weight: 700; }
.hbv-tx.is-transfer .hbv-tx-amt b { color: var(--hbv-transfer); }
.hbv-tx-amt i { display: block; font-style: normal; font-size: 12px; color: var(--text-muted); }
.hbv-tx-amt i.neg { color: var(--hbv-expense); }

/* Werkzeugzeile */
.hbv-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 10px; }
.hbv-search { flex: 1 1 220px; display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px; border-radius: 14px; border: 1px solid var(--hb-line); background: #fff; color: var(--text-muted); }
.hbv-search input { flex: 1; min-width: 0; border: 0; background: none; font: inherit; font-size: 15px; color: var(--hb-ink); min-height: 40px; outline-offset: 6px; }
.hbv-shell .hb-seg button { background: #fff; }
.hbv-shell .hb-seg button[aria-pressed="true"] { background: var(--hb-ink); color: #fff; }
.hbv-seg { display: flex; flex-wrap: wrap; gap: 6px; }
.hbv-seg button { appearance: none; cursor: pointer; min-height: 44px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--hb-line); background: #fff; font: inherit; font-size: 14px; font-weight: 700; color: var(--text-muted); }
.hbv-seg button[aria-pressed="true"] { background: var(--hb-ink); border-color: var(--hb-ink); color: #fff; }
.hbv-seg button small { font-weight: 600; opacity: .75; margin-left: 2px; }
.hbv-setnav { margin-bottom: 12px; }
.hbv-select { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.hbv-select select { min-height: 44px; max-width: 100%; border-radius: 12px; border: 1px solid var(--hb-line); background: #fff; padding: 0 12px; font: inherit; font-size: 14.5px; color: var(--hb-ink); }
.hbv-count { margin: 0 2px 8px; font-size: 13.5px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.hbv-chipline { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 8px; }
.hbv-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 4px 4px 14px; border-radius: 999px; background: var(--hb-soft-2); border: 1px solid #f6d3c8; color: var(--hb-coral); font-weight: 700; font-size: 14px; }
.hbv-chip button { appearance: none; border: 0; background: none; cursor: pointer; width: 36px; height: 36px; border-radius: 50%; color: inherit; display: inline-flex; align-items: center; justify-content: center; }
.hbv-more { text-align: center; margin: 12px 0 0; }

/* Übersicht */
.hbv-ovlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; margin-top: 10px; }
.hbv-ov { appearance: none; font: inherit; color: var(--hb-ink); text-align: left; cursor: pointer; background: #fff; border: 1px solid var(--hb-line); border-radius: 18px; padding: 14px; display: grid; gap: 9px; }
.hbv-ov:hover { border-color: var(--hb-coral); }
.hbv-ov.is-anchor { border-color: var(--hb-coral); background: var(--hb-soft-2); }
.hbv-ov-top { display: flex; justify-content: space-between; gap: 10px; font-variant-numeric: tabular-nums; }
.hbv-ov-sub { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12.5px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.hbv-ov-sub i { font-style: normal; }

/* Statistik */
.hbv-donutwrap { position: relative; max-width: 220px; margin: 0 auto; }
.hbv-donut { width: 100%; display: block; transform: rotate(0deg); }
.hbv-donutwrap > div { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.hbv-donutwrap i { font-style: normal; font-size: 12.5px; color: var(--text-muted); }
.hbv-donutwrap b { font-size: 16px; font-variant-numeric: tabular-nums; }
.hbv-rank { appearance: none; width: 100%; font: inherit; color: var(--hb-ink); background: none; border: 0; border-top: 1px solid var(--hb-line); cursor: pointer; display: grid; grid-template-columns: 26px minmax(0, 1fr) auto auto; align-items: center; gap: 4px 10px; padding: 10px 2px; text-align: left; }
.hbv-rank:hover .nm { color: var(--hb-coral); }
.hbv-rank .n { color: var(--text-muted); font-size: 13px; text-align: center; }
.hbv-rank .nm small { display: block; font-size: 12px; color: var(--text-muted); margin-left: 18px; }
.hbv-rank .sh { font-size: 13px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.hbv-rank b { font-variant-numeric: tabular-nums; white-space: nowrap; min-width: 96px; text-align: right; }
.hbv-rank .hbv-bar { grid-column: 2 / -1; height: 6px; }
.hbv-rank.is-sub { padding: 6px 2px; font-size: 14px; border-top: 0; color: var(--text-muted); }
.hbv-rank.is-sub .nm { padding-left: 18px; }
.hbv-rank.is-sub b { font-weight: 500; }
.hbv-line-chart { width: 100%; height: auto; display: block; }
.hbv-axis { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; font-size: 12.5px; color: var(--text-muted); font-variant-numeric: tabular-nums; }

/* Ziele */
.hbv-goal-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.hbv-badge { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 12px; background: #e6f4ec; color: var(--hbv-income); white-space: nowrap; }
.hbv-badge.is-warn { background: #fdf1d7; color: #8a5800; }
.hbv-badge.is-over { background: #fdecec; color: #8f1f24; }
.hbv-goal-nums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px; }
.hbv-goal-nums i { display: block; font-style: normal; font-size: 12.5px; color: var(--text-muted); }
.hbv-goal-nums b { font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.hbv-goal p { margin-bottom: 0; }

/* Einstellungen und Prüfung */
.hbv-row { appearance: none; width: 100%; font: inherit; color: var(--hb-ink); background: #fff; border: 0; border-top: 1px solid var(--hb-line); display: flex; justify-content: space-between; align-items: center; gap: 14px; min-height: 52px; padding: 9px 14px; text-align: left; }
.hbv-list > .hbv-row:first-child { border-top: 0; }
.hbv-list.is-plain { border: 1px solid var(--hb-line); border-radius: 18px; }
button.hbv-row { cursor: pointer; }
button.hbv-row:hover { background: var(--hb-soft); }
.hbv-row span:first-child { min-width: 0; }
.hbv-row b { overflow-wrap: anywhere; }
.hbv-row i { display: block; font-style: normal; font-size: 12.5px; color: var(--text-muted); overflow-wrap: anywhere; }
.hbv-row i.why { color: var(--hb-ink); font-size: 13.5px; margin-top: 3px; }
.hbv-row .r { text-align: right; white-space: nowrap; font-size: 13.5px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.hbv-row .r b { color: var(--hb-ink); font-size: 15px; }
.hbv-row.is-main b { font-weight: 700; }
.hbv-row.is-child { padding-left: 38px; }
.hbv-row.is-child span:first-child b { font-weight: 500; }
.hbv-row.is-off { opacity: .55; }
.hbv-light { display: flex; gap: 14px; align-items: flex-start; padding: 16px; border-radius: var(--hbv-radius); background: #fff; border: 1px solid var(--hb-line); margin-bottom: 4px; }
.hbv-light > i { flex: none; width: 18px; height: 18px; border-radius: 50%; margin-top: 3px; background: #2E9E5B; }
.hbv-light.is-o > i { background: #F2A100; }
.hbv-light.is-r > i { background: #E5484D; }
.hbv-light p { margin: 2px 0 0; font-size: 14.5px; }
.hbv-notes { margin: 0; padding-left: 20px; font-size: 14.5px; }
.hbv-notes li { margin: 4px 0; }
.hbv-tablewrap { overflow-x: auto; }
.hbv-table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.hbv-table th, .hbv-table td { padding: 8px 10px; border-top: 1px solid var(--hb-line); text-align: right; white-space: nowrap; }
.hbv-table th:first-child, .hbv-table td:first-child { text-align: left; }
.hbv-table th { border-top: 0; font-size: 12.5px; color: var(--text-muted); font-weight: 600; }
.hbv-table.is-raw td { text-align: left; white-space: normal; overflow-wrap: anywhere; font-size: 13px; }
.hbv-table.is-raw td:first-child { color: var(--text-muted); white-space: nowrap; }

/* Fußleiste: Konto, Optionen, Summen */
.hbv-foot { position: sticky; bottom: 10px; z-index: 5; margin-top: 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; padding: 10px 14px; border-radius: 18px; background: rgba(255, 255, 255, .96); border: 1px solid var(--hb-line); box-shadow: 0 10px 30px -14px rgba(15, 23, 42, .45); backdrop-filter: blur(8px); }
.hbv-optbtn { display: none; }
.hbv-toggles { display: flex; flex-wrap: wrap; gap: 0 16px; }
.hbv-toggles .hb-toggle { font-size: 13.5px; }
.hbv-foot .hbv-select select { min-height: 44px; }
.hbv-foot { padding: 6px 14px; }
.hbv-toggles .hb-toggle.is-off { opacity: .5; }
.hbv-foot-sums { display: flex; gap: 16px; margin-left: auto; font-variant-numeric: tabular-nums; }
.hbv-foot-sums i { display: block; font-style: normal; font-size: 11.5px; color: var(--text-muted); }
.hbv-foot-sums b { font-size: 14.5px; white-space: nowrap; }

/* Detaildialog */
.hbv-dialog { width: min(620px, calc(100vw - 24px)); max-height: calc(100vh - 40px); border: 1px solid var(--hb-line); border-radius: 26px; padding: 22px; color: var(--hb-ink); background: #fff; box-shadow: 0 30px 80px -20px rgba(15, 23, 42, .5); }
.hbv-dialog::backdrop { background: rgba(21, 17, 15, .5); }
.hbv-dialog h3 { margin: 0 44px 12px 0; font-size: 20px; overflow-wrap: anywhere; }
.hbv-x { position: absolute; top: 12px; right: 12px; appearance: none; border: 1px solid var(--hb-line); background: var(--hb-soft); cursor: pointer; width: 44px; height: 44px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: var(--hb-ink); }
.hbv-dl { display: grid; grid-template-columns: minmax(110px, 34%) 1fr; margin: 0 0 12px; }
.hbv-dl dt, .hbv-dl dd { margin: 0; padding: 8px 0; border-top: 1px solid var(--hb-line); }
.hbv-dl dt { color: var(--text-muted); font-size: 14px; }
.hbv-dl dd { font-weight: 600; overflow-wrap: anywhere; }
.hbv-dialog details { margin-top: 10px; }
.hbv-dialog summary { cursor: pointer; font-weight: 700; min-height: 44px; display: flex; align-items: center; }
.hbv-dialog .hb-callout { margin: 0 0 12px; }

@media (max-width: 640px) {
  .hbv-shell { padding: 10px; border-radius: 20px; }
  .hbv-tab { min-width: 72px; }
  .hbv-tx { grid-template-columns: 34px 4px minmax(0, 1fr) auto; }
  .hbv-tx.is-compact { grid-template-columns: 4px minmax(0, 1fr) auto; }
  .hbv-marks { display: none; }
  .hbv-tiles.is-12 { grid-template-columns: repeat(4, 1fr); }
  .hbv-foot { bottom: 6px; gap: 6px 10px; }
  .hbv-foot .hbv-select span { display: none; }
  .hbv-foot .hbv-select { flex: 1 1 140px; min-width: 0; }
  .hbv-foot .hbv-select select { width: 100%; }
  .hbv-optbtn { display: inline-flex; align-items: center; gap: 6px; appearance: none; cursor: pointer; min-height: 44px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--hb-line); background: #fff; font: inherit; font-size: 14px; font-weight: 700; color: var(--hb-ink); }
  .hbv-toggles { display: none; width: 100%; order: 3; }
  .hbv-toggles.is-open { display: block; }
  .hbv-foot-sums { order: 4; }
  .hbv-foot-sums span:not(:last-child) { display: none; }
  .hbv-foot-sums span:last-child { display: flex; justify-content: space-between; align-items: baseline; width: 100%; }
  .hbv-foot-sums { margin-left: 0; width: 100%; }
  .hbv-file-actions { margin-left: 0; }
  .hbv-rank b { min-width: 0; }
}

@media print {
  .site-header, .site-footer, .hb-page-hero, .hbv-file-actions, .hbv-tabs, .hbv-foot .hbv-toggles, .hbv-tools, .hbv-more, .hbv-picker { display: none !important; }
  .hbv-shell { border: 0; box-shadow: none; padding: 0; background: #fff; }
  .hbv-foot { position: static; box-shadow: none; }
  .hbv-tx, .hbv-row, .hbv-card { break-inside: avoid; }
  .hb-page-body { margin-top: 0; }
}

/* Rechts-nach-links (Arabisch): Pfeile spiegeln, Beträge als eigene Links-nach-rechts-Einheit setzen,
   damit Vorzeichen und Währungszeichen an der richtigen Seite stehen. */
[dir="rtl"] .hbv-period > button:not(.hbv-period-title) .hbv-i, [dir="rtl"] .hbv-picker-year .hbv-i { transform: scaleX(-1); }
[dir="rtl"] .hbv-tx-amt b, [dir="rtl"] .hbv-tx-amt i, [dir="rtl"] .hbv-kpi b, [dir="rtl"] .hbv-line b, [dir="rtl"] .hbv-hero-val,
[dir="rtl"] .hbv-foot-sums b, [dir="rtl"] .hbv-rank b, [dir="rtl"] .hbv-goal-nums b, [dir="rtl"] .hbv-row .r b, [dir="rtl"] .hbv-table td { unicode-bidi: plaintext; }
[dir="rtl"] .hbv-tx-amt b, [dir="rtl"] .hbv-tx-amt i, [dir="rtl"] .hbv-rank b { text-align: left; }
[dir="rtl"] .hbv-tx, [dir="rtl"] .hbv-row, [dir="rtl"] .hbv-line, [dir="rtl"] .hbv-rank, [dir="rtl"] .hbv-kpi, [dir="rtl"] .hbv-ov { text-align: right; }
[dir="rtl"] .hbv-row .r, [dir="rtl"] .hbv-tx-amt { text-align: left; }
[dir="rtl"] .hbv-table th, [dir="rtl"] .hbv-table td { text-align: left; }
[dir="rtl"] .hbv-table th:first-child, [dir="rtl"] .hbv-table td:first-child { text-align: right; }
[dir="rtl"] .hbv-foot-sums, [dir="rtl"] .hbv-file-actions { margin-left: 0; margin-right: auto; }
[dir="rtl"] .hbv-line em, [dir="rtl"] .hbv-rank em { margin-right: 0; margin-left: 8px; }
[dir="rtl"] .hbv-row.is-child { padding-left: 14px; padding-right: 38px; }
[dir="rtl"] .hbv-dialog h3 { margin: 0 0 12px 44px; }
[dir="rtl"] .hbv-x { right: auto; left: 12px; }
