/* ============================================================
   u flow – Paket 3B: private Finanzerfassung
   ============================================================ */
body.finance-offen { overflow: hidden; }

.finance-overlay {
  position: fixed;
  inset: 0;
  z-index: 16000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(58, 48, 36, 0.22);
  backdrop-filter: blur(5px);
  animation: setup-fade 0.16s ease;
}
.finance-overlay[hidden] { display: none; }
.finance-overlay.finance-inspection {
  z-index: 9000;
  background: rgba(58, 48, 36, 0.14);
  backdrop-filter: blur(2px);
}
.finance-overlay.finance-inspection .finance-card { box-shadow: 0 16px 44px rgba(40, 39, 37, 0.13); }
.finance-card {
  width: min(760px, calc(100vw - 48px));
  max-height: calc(100dvh - 48px);
  overflow: auto;
  box-sizing: border-box;
  padding: 28px 30px 24px;
  color: var(--text-stark);
  background: var(--karte-bg-fest);
  border: 1px solid var(--karte-rand);
  border-radius: 24px;
  box-shadow: var(--schatten-drag);
  animation: setup-ein 0.2s cubic-bezier(0.2, 0.7, 0.3, 1);
}
.finance-editor { width: min(820px, calc(100vw - 48px)); }
.finance-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}
.finance-head h2 {
  margin: 3px 0 5px;
  font-size: 25px;
  font-weight: 650;
  line-height: 1.2;
}
.finance-head p {
  max-width: 560px;
  margin: 0;
  color: var(--text-leise);
  font-size: 13px;
  line-height: 1.5;
}
.finance-eyebrow {
  color: var(--akzent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.finance-close {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  padding: 0 0 2px;
  border: 1px solid var(--karte-rand);
  border-radius: 12px;
  color: var(--text-leise);
  background: transparent;
  font: 300 25px/1 inherit;
  cursor: pointer;
}
.finance-close:hover { color: var(--text-stark); background: rgba(40, 39, 37, 0.06); }

.finance-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 20px;
}
.finance-section {
  margin-top: 18px;
  padding: 15px;
  border: 1px solid var(--karte-rand);
  border-radius: 17px;
  background: rgba(40, 39, 37, 0.018);
}
.finance-section:first-of-type { margin-top: 0; }
.finance-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
}
.finance-section-head > div { display: flex; flex-direction: column; gap: 2px; }
.finance-section-head strong { color: var(--text-stark); font-size: 14px; }
.finance-section-head span { color: var(--text-leise); font-size: 10.5px; }
.finance-section-head > b { color: var(--text-mittel); font-size: 13px; white-space: nowrap; }
.finance-section-head .finance-action {
  min-height: 34px;
  padding: 6px 11px;
  font-size: 11.5px;
}
.finance-action {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 48px;
  border: 1px solid var(--karte-rand);
  border-radius: 14px;
  color: var(--text-mittel);
  background: rgba(40, 39, 37, 0.025);
  font: 650 14px/1 inherit;
  cursor: pointer;
}
.finance-action span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 15px;
}
.finance-action.income span { color: #40784c; background: rgba(87, 146, 96, 0.14); }
.finance-action.expense span { color: #a5574c; background: rgba(188, 91, 77, 0.13); }
.finance-action:hover { color: var(--text-stark); background: rgba(40, 39, 37, 0.055); }

.finance-list,
.finance-project-list { display: flex; flex-direction: column; gap: 6px; }
.finance-list { max-height: min(52dvh, 480px); overflow-y: auto; padding-right: 2px; }
.finance-row {
  width: 100%;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto 14px;
  align-items: center;
  gap: 11px;
  min-height: 62px;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 14px;
  color: inherit;
  background: transparent;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
}
.finance-row:hover {
  border-color: var(--karte-rand);
  background: rgba(40, 39, 37, 0.035);
}
.finance-kind {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  font-size: 16px;
}
.finance-kind.income { color: #40784c; background: rgba(87, 146, 96, 0.13); }
.finance-kind.expense { color: #a5574c; background: rgba(188, 91, 77, 0.12); }
.finance-row-main,
.finance-row-side { display: flex; flex-direction: column; min-width: 0; }
.finance-row-title {
  overflow: hidden;
  color: var(--text-stark);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.finance-row-meta {
  overflow: hidden;
  margin-top: 3px;
  color: var(--text-leise);
  font-size: 11.5px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.finance-row-side { align-items: flex-end; gap: 4px; }
.finance-row-amount {
  color: var(--text-stark);
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
}
.finance-row-chips { display: flex; justify-content: flex-end; gap: 4px; }
.finance-chip {
  display: inline-flex;
  align-items: center;
  min-height: 19px;
  padding: 1px 7px;
  border-radius: 999px;
  color: var(--text-leise);
  background: rgba(40, 39, 37, 0.055);
  font-size: 10px;
  font-weight: 650;
  white-space: nowrap;
}
.finance-chip.overdue { color: #a84d42; background: rgba(188, 91, 77, 0.13); }
.finance-chip.forecast { color: #4d7098; background: rgba(99, 139, 184, 0.14); }
.finance-row-arrow { color: var(--text-leise); font-size: 20px; font-weight: 300; }
.finance-empty {
  display: grid;
  justify-items: center;
  padding: 42px 20px 38px;
  color: var(--text-leise);
  text-align: center;
  border: 1px dashed var(--karte-rand);
  border-radius: 16px;
}
.finance-empty > span { margin-bottom: 8px; font-size: 28px; }
.finance-empty strong { color: var(--text-mittel); font-size: 14px; }
.finance-empty p { margin: 6px 0 0; font-size: 12px; }
.finance-empty.klein { padding: 22px 16px; }
.finance-legacy {
  margin-top: 16px;
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--text-leise);
  background: rgba(40, 39, 37, 0.035);
  font-size: 11px;
}
.finance-legacy strong { color: var(--text-mittel); }
.finance-legacy p { margin: 3px 0 0; }
.finance-scope-note {
  margin: 16px 0 0;
  color: var(--text-leise);
  font-size: 11px;
  text-align: center;
}

.finance-overview { width: min(1120px, calc(100vw - 48px)); }
.finance-head-actions { display: flex; align-items: center; gap: 9px; }
.finance-head-actions .finance-action { min-height: 38px; padding: 6px 12px; font-size: 12px; }
.finance-head-menu {
  display: inline-flex; align-items: center; gap: 2px; padding: 3px;
  border: 1px solid var(--karte-rand); border-radius: 12px;
  background: rgba(40, 39, 37, 0.025);
}
.finance-head-menu button {
  min-height: 32px; padding: 6px 10px; border: 0; border-radius: 9px;
  color: var(--text-leise); background: transparent;
  font: 650 10.5px/1 inherit; white-space: nowrap; cursor: pointer;
}
.finance-head-menu button:hover,
.finance-head-menu button:focus-visible { color: var(--text-stark); background: rgba(255, 255, 255, 0.72); }
.finance-head-menu button.active {
  color: var(--text-stark); background: var(--karte-bg-fest);
  box-shadow: 0 1px 5px rgba(40, 39, 37, 0.08);
}
.finance-head-menu .finance-head-expense {
  display: inline-flex; align-items: center; gap: 4px; color: #a5574c;
}
.finance-head-menu .finance-head-expense span {
  display: inline-grid; place-items: center; width: 19px; height: 19px;
  border-radius: 50%; background: rgba(188, 91, 77, 0.12); font-size: 12px;
}
.finance-period {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-bottom: 12px;
}
.finance-period-nav,
.finance-scope-switch {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px; border: 1px solid var(--karte-rand); border-radius: 12px;
  background: rgba(40, 39, 37, 0.025);
}
.finance-period-nav strong {
  min-width: 132px; color: var(--text-stark); font-size: 13px; font-weight: 650; text-align: center;
}
.finance-period-nav button,
.finance-scope-switch button {
  min-width: 34px; min-height: 32px; padding: 6px 10px; border: 0; border-radius: 9px;
  color: var(--text-leise); background: transparent; font: 650 12px/1 inherit; cursor: pointer;
}
.finance-period-nav button { font-size: 20px; font-weight: 400; }
.finance-period-nav button:hover,
.finance-scope-switch button:hover { color: var(--text-stark); background: rgba(255, 255, 255, 0.72); }
.finance-scope-switch button.active {
  color: var(--text-stark); background: var(--karte-bg-fest); box-shadow: 0 1px 5px rgba(40, 39, 37, 0.08);
}
.finance-kpis {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 9px; margin-bottom: 12px;
}
.finance-kpis > div {
  display: flex; flex-direction: column; min-width: 0; padding: 13px 14px;
  border: 1px solid var(--karte-rand); border-radius: 14px; background: rgba(40, 39, 37, 0.018);
}
.finance-kpis span {
  color: var(--text-leise); font-size: 10px; font-weight: 700; letter-spacing: 0.055em; text-transform: uppercase;
}
.finance-kpis strong {
  overflow: hidden; margin-top: 6px; color: var(--text-stark); font-size: 20px;
  font-weight: 650; line-height: 1.15; text-overflow: ellipsis; white-space: nowrap;
}
.finance-kpis small { margin-top: 4px; color: var(--text-leise); font-size: 10px; }
.finance-kpis .positive strong { color: #40784c; }
.finance-kpis .plan strong { color: #9a6a3f; }
.finance-kpis .negative strong,
.finance-kpis .warning strong { color: #a5574c; }
.finance-chart-section { margin-top: 0; padding-bottom: 9px; }
.finance-chart-wrap { min-width: 0; overflow: visible; }
.finance-chart-legend {
  display: flex; justify-content: flex-end; gap: 14px; margin: -23px 3px 2px 0;
  color: var(--text-leise); font-size: 9.5px;
}
.finance-chart-legend span::before {
  content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 2px;
}
.finance-chart-legend .plan::before { background: #638bb8; }
.finance-chart-legend .income::before { background: #6e9f76; }
.finance-chart-legend .expense::before { background: #c37a70; }
.finance-chart-legend .result::before {
  width: 11px; height: 2px; margin-bottom: 3px; border-radius: 999px; background: #8a7565;
}
.finance-chart-stage { position: relative; min-width: 0; overflow-x: auto; padding-top: 2px; }
.finance-chart { display: block; min-width: 690px; width: 100%; height: 172px; overflow: visible; }
.finance-chart text { fill: var(--text-leise); font: 10px/1 inherit; pointer-events: none; }
.finance-chart-zero { stroke: var(--karte-rand); stroke-width: 1; }
.finance-chart-grid { stroke: rgba(40, 39, 37, 0.075); stroke-width: 1; stroke-dasharray: 2 6; }
.finance-chart-axis { stroke: rgba(40, 39, 37, 0.15); stroke-width: 1.2; }
.finance-chart-hit { fill: transparent; transition: fill 0.14s ease; }
.finance-chart-month.selected .finance-chart-hit { fill: rgba(176, 117, 77, 0.075); }
.finance-chart-bar { stroke: rgba(255, 255, 255, 0.54); stroke-width: 0.8; transition: filter 0.14s ease, opacity 0.14s ease; }
.finance-chart-bar.plan { fill: #638bb8; }
.finance-chart-bar.income { fill: #6e9f76; }
.finance-chart-bar.expense { fill: #c37a70; }
.finance-chart-result {
  fill: none; stroke: #8a7565; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; pointer-events: none;
}
.finance-chart-result-dot {
  fill: #8a7565; stroke: var(--karte-bg-fest); stroke-width: 1.5; pointer-events: none;
}
.finance-chart-result-dot.positive { fill: #5f9168; }
.finance-chart-result-dot.negative { fill: #bc6f65; }
.finance-chart-result-dot.zero { fill: #8a8178; }
.finance-chart-month { cursor: pointer; outline: none; }
.finance-chart-month:focus .finance-chart-hit,
.finance-chart-month:hover .finance-chart-hit { fill: rgba(176, 117, 77, 0.12); }
.finance-chart-month:focus .finance-chart-bar,
.finance-chart-month:hover .finance-chart-bar { filter: saturate(1.12) brightness(0.98); }
.finance-chart-tooltip {
  position: absolute; z-index: 3; top: 7px; width: max-content; max-width: min(360px, calc(100vw - 36px));
  padding: 9px 11px; border: 1px solid rgba(40, 39, 37, 0.11); border-radius: 11px;
  color: var(--text-mittel); background: var(--karte-bg-fest); box-shadow: 0 8px 24px rgba(40, 39, 37, 0.13);
  transform: translateX(-50%); pointer-events: none;
}
.finance-chart-tooltip strong { display: block; margin-bottom: 6px; color: var(--text-stark); font-size: 11px; }
.finance-chart-tooltip > div { display: flex; flex-wrap: wrap; gap: 7px 12px; }
.finance-chart-tooltip span { color: var(--text-leise); font-size: 9px; white-space: nowrap; }
.finance-chart-tooltip b { display: block; margin-top: 2px; color: var(--text-stark); font-size: 10.5px; font-weight: 700; }
.finance-chart-tooltip b.positive { color: #40784c; }
.finance-chart-tooltip b.negative { color: #a5574c; }
.finance-chip.plan { color: #8c613d; background: rgba(176, 117, 77, 0.12); }
.finance-overview-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.finance-overview-grid .finance-section { min-width: 0; margin-top: 12px; }
.finance-list-short { max-height: 330px; }
.finance-ranking-switch {
  display: inline-flex; flex: 0 0 auto; gap: 2px; padding: 3px;
  border: 1px solid var(--karte-rand); border-radius: 11px;
  background: rgba(124, 116, 105, 0.07);
}
.finance-ranking-switch button {
  min-height: 27px; padding: 4px 9px; border: 0; border-radius: 8px;
  color: var(--text-leise); background: transparent;
  font: 700 9.5px/1 inherit; cursor: pointer;
}
.finance-ranking-switch button:hover,
.finance-ranking-switch button:focus-visible { color: var(--text-stark); background: rgba(255, 255, 255, 0.56); }
.finance-ranking-switch button.active {
  color: var(--text-stark); background: var(--karte-bg-fest);
  box-shadow: 0 1px 5px rgba(40, 39, 37, 0.09);
}
.finance-ranking-row { min-height: 76px; }
.finance-ranking-row .finance-row-main { align-self: center; }
.finance-ranking-row .finance-row-side { min-width: 138px; gap: 3px; }
.finance-ranking-primary {
  display: flex; align-items: baseline; justify-content: flex-end; gap: 5px;
  color: var(--text-stark); font-size: 12px; font-weight: 750;
}
.finance-ranking-primary small {
  color: var(--text-leise); font-size: 8px; font-weight: 750; letter-spacing: 0.08em; text-transform: uppercase;
}
.finance-ranking-values {
  display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 2px 9px;
  color: var(--text-leise); font-size: 8.5px;
}
.finance-ranking-values span { white-space: nowrap; }
.finance-ranking-values b { color: var(--text-mittel); font-weight: 700; }
.finance-ranking-track {
  display: block; width: 100%; height: 3px; margin-top: 7px;
  overflow: hidden; border-radius: 999px; background: rgba(124, 116, 105, 0.1);
}
.finance-ranking-track i {
  display: block; width: var(--finance-ranking-share); height: 100%;
  border-radius: inherit; background: #638bb8;
}
.finance-ranking-row .finance-kind.expense ~ .finance-row-main .finance-ranking-track i { background: #c37a70; }
.finance-ranking-summary {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 14px 2px; color: var(--text-leise); font-size: 9.5px; line-height: 1.35;
}
.finance-ranking-summary button {
  flex: 0 0 auto; padding: 2px 0; border: 0; color: var(--akzent);
  background: transparent; font: 700 9.5px/1.2 inherit; cursor: pointer;
}
.finance-ranking-summary button:hover,
.finance-ranking-summary button:focus-visible { text-decoration: underline; text-underline-offset: 3px; }
.finance-timeline-row.problem { background: rgba(188, 91, 77, 0.035); }
.finance-problem-line {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: stretch; gap: 4px;
  border-radius: 14px; background: rgba(188, 91, 77, 0.035);
}
.finance-problem-line .finance-timeline-row.problem {
  min-width: 0; grid-template-columns: 32px minmax(0, 1fr) 14px; background: transparent;
}
.finance-problem-line .finance-row-side {
  grid-column: 2; align-items: flex-start; flex-direction: row; flex-wrap: wrap; gap: 5px;
}
.finance-problem-line .finance-row-chips { justify-content: flex-start; }
.finance-problem-line .finance-row-arrow { grid-column: 3; grid-row: 1 / span 2; }
.finance-project-jump {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-width: 50px; margin: 5px; padding: 5px 6px; border: 1px solid var(--karte-rand); border-radius: 11px;
  color: var(--text-leise); background: rgba(255, 255, 255, 0.48); font: 650 9.5px/1 inherit; cursor: pointer;
}
.finance-project-jump b { color: var(--akzent); font-size: 14px; font-weight: 500; }
.finance-project-jump:hover,
.finance-project-jump:focus-visible { color: var(--text-stark); border-color: rgba(176, 117, 77, 0.38); background: var(--karte-bg-fest); }
.finance-overview-footer {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 14px;
}
.finance-overview-footer p { margin: 0; color: var(--text-leise); font-size: 10.5px; line-height: 1.4; }
.finance-overview-footer .finance-primary { white-space: nowrap; }

.finance-detail {
  width: min(1480px, calc(100vw - 32px));
  height: calc(100dvh - 32px);
  max-height: calc(100dvh - 32px);
  padding: 22px 24px;
}
.finance-detail-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 15px;
}
.finance-detail-head > div:first-child {
  display: grid; grid-template-columns: auto 1fr; column-gap: 13px; align-items: center;
}
.finance-detail-head .finance-detail-back { grid-row: 1 / span 2; }
.finance-detail-head h2 { margin: 2px 0 0; font-size: 24px; line-height: 1.2; }
.finance-detail-back {
  min-height: 36px; padding: 7px 10px; border: 1px solid var(--karte-rand); border-radius: 10px;
  color: var(--text-mittel); background: transparent; font: 650 11px/1 inherit; cursor: pointer;
}
.finance-detail-back:hover { color: var(--text-stark); background: rgba(40, 39, 37, 0.045); }
.finance-planning-toolbar {
  display: grid; grid-template-columns: minmax(150px, 0.65fr) minmax(220px, 1.2fr) minmax(220px, 1.2fr);
  gap: 10px; align-items: end; margin-bottom: 10px; padding: 12px;
  border: 1px solid var(--karte-rand); border-radius: 15px; background: rgba(40, 39, 37, 0.02);
}
.finance-planning-toolbar label { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.finance-planning-toolbar label > span {
  color: var(--text-leise); font-size: 9.5px; font-weight: 700;
  letter-spacing: 0.05em; text-transform: uppercase;
}
.finance-planning-toolbar select {
  width: 100%; min-width: 0; min-height: 38px; box-sizing: border-box; padding: 7px 9px;
  border: 1px solid var(--karte-rand); border-radius: 10px; outline: 0;
  color: var(--text-stark); background: rgba(255, 255, 255, 0.68); font: 11px/1.2 inherit;
}
.finance-planning-toolbar select:focus { border-color: rgba(176, 117, 77, 0.68); }
.finance-planning-year {
  display: grid; grid-template-columns: 36px minmax(70px, 1fr) 36px; align-items: center;
  min-height: 36px; padding: 2px; border: 1px solid var(--karte-rand);
  border-radius: 10px; background: rgba(255, 255, 255, 0.55);
}
.finance-planning-year strong { text-align: center; font-size: 14px; font-weight: 700; }
.finance-planning-year button {
  height: 32px; border: 0; border-radius: 8px; color: var(--text-leise);
  background: transparent; font: 400 19px/1 inherit; cursor: pointer;
}
.finance-planning-year button:hover { color: var(--text-stark); background: rgba(40, 39, 37, 0.05); }
.finance-planning-hero {
  display: grid; grid-template-columns: minmax(190px, 0.85fr) minmax(220px, 1.35fr) minmax(170px, 0.8fr);
  align-items: center; gap: 28px; margin-bottom: 14px; padding: 20px 22px;
  border: 1px solid var(--karte-rand); border-radius: 17px; background: rgba(40, 39, 37, 0.018);
}
.finance-planning-hero-main,
.finance-planning-hero-status { display: flex; flex-direction: column; min-width: 0; }
.finance-planning-hero-main > span {
  color: var(--text-leise); font-size: 9.5px; font-weight: 750; letter-spacing: 0.08em; text-transform: uppercase;
}
.finance-planning-hero-main > strong {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 5px; margin-top: 7px;
  color: var(--text-stark); font-size: clamp(25px, 2.35vw, 36px); font-weight: 680; line-height: 1.05;
}
.finance-planning-hero-main > strong small { color: var(--text-mittel); font-size: 13px; font-weight: 650; white-space: nowrap; }
.finance-planning-hero-main > p { margin: 6px 0 0; color: var(--text-leise); font-size: 11.5px; }
.finance-planning-progress { min-width: 0; }
.finance-planning-progress-track {
  position: relative; height: 12px; border-radius: 999px; background: rgba(40, 39, 37, 0.075);
}
.finance-planning-progress-track > i {
  position: absolute; inset: 0 auto 0 0; width: var(--finance-actual-width);
  border-radius: inherit; background: #6e9f76;
}
.finance-planning-progress-track > b {
  position: absolute; top: -6px; bottom: -6px; left: var(--finance-plan-position); width: 2px;
  border-radius: 2px; background: #526f91; transform: translateX(-1px);
}
.finance-planning-progress-track > b::after {
  content: ""; position: absolute; top: -2px; left: 50%; width: 7px; height: 7px;
  border: 2px solid #526f91; border-radius: 50%; background: var(--karte-bg-fest); transform: translate(-50%, -100%);
}
.finance-planning-progress-labels {
  display: flex; justify-content: space-between; margin-top: 10px; color: var(--text-leise);
  font-size: 9px; font-weight: 650;
}
.finance-planning-progress-labels span:last-child { color: #526f91; }
.finance-planning-hero-status { align-items: flex-start; padding-left: 18px; border-left: 1px solid var(--karte-rand); }
.finance-planning-hero-status > strong { color: var(--text-stark); font-size: 17px; line-height: 1.2; }
.finance-planning-hero-status.positive > strong { color: #40784c; }
.finance-planning-hero-status.negative > strong { color: #a5574c; }
.finance-planning-hero-status > span { margin-top: 5px; color: var(--text-mittel); font-size: 11px; }
.finance-planning-hero-status > small {
  margin-top: 9px; padding: 5px 8px; border-radius: 999px;
  color: #526f91; background: rgba(99, 139, 184, 0.09); font-size: 9px; font-weight: 650;
}
.finance-planning-chart {
  margin-bottom: 14px; padding: 8px 4px 2px;
}
.finance-planning-chart-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 0 8px 4px;
}
.finance-planning-chart-head > div:first-child { display: flex; flex-direction: column; gap: 3px; }
.finance-planning-chart-head strong { color: var(--text-stark); font-size: 14px; }
.finance-planning-chart-head span { color: var(--text-leise); font-size: 9.5px; }
.finance-planning-legend { display: flex; align-items: center; gap: 13px; }
.finance-planning-legend span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.finance-planning-legend span::before {
  content: ""; width: 10px; height: 10px; box-sizing: border-box; border-radius: 3px;
}
.finance-planning-legend .plan::before { background: #638bb8; }
.finance-planning-legend .actual::before { background: #6e9f76; }
.finance-planning-legend .forecast::before {
  border: 1px dashed #638bb8; background: rgba(99, 139, 184, 0.13);
}
.finance-planning-quarters { display: none; }
.finance-year-plot { position: relative; min-height: 190px; margin-top: 4px; }
.finance-year-guides {
  position: absolute; inset: 10px 0 27px; display: flex; flex-direction: column; justify-content: space-between;
  pointer-events: none;
}
.finance-year-guides i { display: block; border-top: 1px solid rgba(40, 39, 37, 0.075); }
.finance-year-months {
  position: relative; display: grid; grid-template-columns: repeat(12, minmax(42px, 1fr));
  gap: 4px; min-height: 190px;
}
.finance-year-month {
  position: relative; display: grid; grid-template-rows: minmax(0, 1fr) 24px; min-width: 0; min-height: 190px;
  padding: 10px 5px 0; border: 0; border-radius: 12px; outline: 0;
  color: var(--text-mittel); background: transparent; font-family: inherit; cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease;
}
.finance-year-month:hover,
.finance-year-month:focus-visible { color: var(--text-stark); background: rgba(99, 139, 184, 0.045); }
.finance-year-month.selected { color: var(--text-stark); background: rgba(176, 117, 77, 0.075); }
.finance-year-month.current:not(.selected)::before {
  content: ""; position: absolute; inset: 4px 4px 25px; border: 1px solid rgba(99, 139, 184, 0.28); border-radius: 10px;
}
.finance-year-bars {
  position: relative; display: flex; align-items: flex-end; justify-content: center; gap: 5px;
  min-height: 0; padding: 0 4px 7px; border-bottom: 1px solid rgba(40, 39, 37, 0.13);
}
.finance-year-bars.empty::after {
  content: ""; position: absolute; bottom: 5px; left: 50%; width: 4px; height: 4px;
  border-radius: 50%; background: rgba(40, 39, 37, 0.23); transform: translateX(-50%);
}
.finance-year-bar {
  display: flex; flex-direction: column-reverse; justify-content: flex-start;
  width: min(18px, 34%); height: 100%;
}
.finance-year-bar > b {
  display: block; flex: 0 0 var(--finance-bar-height); min-height: 0; box-sizing: border-box;
}
.finance-year-bar.plan > .confirmed { background: #638bb8; border-radius: 4px 4px 0 0; }
.finance-year-bar.plan > .forecast {
  border: 1px dashed #638bb8; border-bottom: 0; border-radius: 4px 4px 0 0; background: rgba(99, 139, 184, 0.13);
}
.finance-year-bar.plan > .forecast + .confirmed,
.finance-year-bar.plan > .confirmed:has(+ .forecast) { border-radius: 0; }
.finance-year-bar.actual > b { border-radius: 4px 4px 0 0; background: #6e9f76; }
.finance-year-month-label {
  align-self: center; overflow: hidden; font-size: 10px; font-weight: 650; text-align: center;
  text-overflow: ellipsis; white-space: nowrap;
}
.finance-year-month.selected .finance-year-month-label { color: var(--akzent); font-weight: 750; }
.finance-planning-focus { margin-top: 0; }
.finance-planning-focus .finance-section-head .finance-secondary {
  min-height: 34px; padding: 6px 10px; font-size: 10.5px; white-space: nowrap;
}
.finance-planning-focus-summary {
  display: grid; grid-template-columns: auto minmax(180px, auto) 1fr; align-items: baseline;
  gap: 7px 14px; margin-bottom: 14px; padding: 12px 14px;
  border-radius: 12px; background: rgba(40, 39, 37, 0.028);
}
.finance-planning-focus-summary > span {
  color: var(--text-leise); font-size: 8.5px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
}
.finance-planning-focus-summary > strong { color: var(--text-stark); font-size: 21px; line-height: 1.1; }
.finance-planning-focus-summary > p { margin: 0; color: var(--text-mittel); font-size: 11px; }
.finance-planning-rankings {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.finance-planning-rankings > div { min-width: 0; }
.finance-planning-rankings h3 {
  margin: 0 0 6px; color: var(--text-mittel); font-size: 11px; font-weight: 700;
}
.finance-planning-rankings .finance-list { max-height: 250px; }
.finance-detail-toolbar {
  display: grid;
  grid-template-columns: minmax(105px, 0.7fr) minmax(190px, 1.25fr) minmax(105px, 0.75fr)
    minmax(135px, 1fr) minmax(135px, 1fr) minmax(125px, 0.8fr) minmax(145px, 0.9fr)
    minmax(180px, 1.2fr) auto auto;
  gap: 8px; align-items: end; padding: 12px;
  border: 1px solid var(--karte-rand); border-radius: 15px; background: rgba(40, 39, 37, 0.02);
}
.finance-detail-toolbar label { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.finance-detail-toolbar label > span,
.finance-custom-range label > span {
  color: var(--text-leise); font-size: 9.5px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
}
.finance-detail-toolbar select,
.finance-detail-toolbar input[type="search"],
.finance-custom-range input {
  width: 100%; min-width: 0; min-height: 36px; box-sizing: border-box; padding: 7px 8px;
  border: 1px solid var(--karte-rand); border-radius: 9px; outline: 0;
  color: var(--text-stark); background: rgba(255, 255, 255, 0.68); font: 11px/1.2 inherit;
}
.finance-detail-toolbar select:focus,
.finance-detail-toolbar input:focus { border-color: rgba(176, 117, 77, 0.68); }
.finance-detail-period-nav {
  display: grid; grid-template-columns: 32px minmax(120px, 1fr) 32px; align-items: center;
  min-height: 34px; border: 1px solid var(--karte-rand); border-radius: 9px;
  background: rgba(255, 255, 255, 0.55);
}
.finance-detail-period-nav strong {
  overflow: hidden; font-size: 11px; font-weight: 650; text-align: center; text-overflow: ellipsis; white-space: nowrap;
}
.finance-detail-period-nav button {
  height: 32px; border: 0; border-radius: 8px; color: var(--text-leise); background: transparent;
  font: 400 18px/1 inherit; cursor: pointer;
}
.finance-detail-period-nav button:hover:not(:disabled) { color: var(--text-stark); background: rgba(40, 39, 37, 0.05); }
.finance-detail-period-nav button:disabled { opacity: 0.35; cursor: default; }
.finance-custom-range {
  grid-column: 1 / span 2; display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
.finance-custom-range[hidden] { display: none; }
.finance-detail-check {
  flex-direction: row !important; align-items: center; gap: 6px !important;
  min-height: 36px; padding: 0 8px; border: 1px solid var(--karte-rand); border-radius: 9px;
  color: var(--text-mittel); background: rgba(255, 255, 255, 0.48); font-size: 10.5px; cursor: pointer;
}
.finance-detail-check input { accent-color: var(--akzent); }
.finance-detail-check span { letter-spacing: 0 !important; text-transform: none !important; }
.finance-detail-toolbar > .finance-secondary { min-height: 36px; padding: 7px 10px; font-size: 10.5px; white-space: nowrap; }
.finance-detail-kpis { margin: 10px 0; }
.finance-detail-chart-section { margin-top: 0; }
.finance-detail-chart { overflow-x: auto; }
.finance-detail-chart > p {
  margin: 0 0 5px; color: var(--text-leise); font-size: 9.5px; text-align: right;
}
.finance-detail-chart .finance-chart { min-width: 760px; height: 150px; }
.finance-detail-legend { margin: 0 3px 2px 0; }
.finance-detail-table-section { margin-top: 10px; }
.finance-table-wrap {
  max-height: min(42dvh, 500px); overflow: auto; border: 1px solid var(--karte-rand); border-radius: 12px;
}
.finance-table { width: 100%; min-width: 980px; border-collapse: separate; border-spacing: 0; }
.finance-table th {
  position: sticky; top: 0; z-index: 1; padding: 9px 10px;
  border-bottom: 1px solid var(--karte-rand); color: var(--text-leise); background: var(--karte-bg-fest);
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.05em; text-align: left; text-transform: uppercase;
}
.finance-table td {
  padding: 9px 10px; border-bottom: 1px solid rgba(40, 39, 37, 0.055);
  color: var(--text-mittel); font-size: 11px; vertical-align: middle;
}
.finance-table tbody tr { cursor: pointer; outline: 0; }
.finance-table tbody tr:hover,
.finance-table tbody tr:focus { background: rgba(40, 39, 37, 0.035); }
.finance-table tbody tr:last-child td { border-bottom: 0; }
.finance-table td strong,
.finance-table td small { display: block; max-width: 250px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.finance-table td strong { color: var(--text-stark); font-size: 11.5px; }
.finance-table td small { margin-top: 2px; color: var(--text-leise); font-size: 9.5px; }
.finance-table td.amount { color: var(--text-stark); font-weight: 650; text-align: right; white-space: nowrap; }
.finance-table td.amount strong,
.finance-table td.amount small { max-width: none; text-align: right; }
.finance-table-kind {
  display: inline-flex; padding: 3px 6px; border-radius: 999px; font-size: 9.5px; font-weight: 650;
}
.finance-table-kind.income { color: #40784c; background: rgba(87, 146, 96, 0.12); }
.finance-table-kind.expense { color: #a5574c; background: rgba(188, 91, 77, 0.12); }
.finance-pagination {
  display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 9px;
  color: var(--text-leise); font-size: 10.5px;
}
.finance-pagination button {
  min-height: 32px; padding: 6px 9px; border: 1px solid var(--karte-rand); border-radius: 9px;
  color: var(--text-mittel); background: transparent; font: 650 10.5px/1 inherit; cursor: pointer;
}
.finance-pagination button:disabled { opacity: 0.35; cursor: default; }

.finance-form { display: flex; flex-direction: column; gap: 18px; }
.finance-kind-choice {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
}
.finance-kind-choice legend {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}
.finance-kind-choice input { position: absolute; opacity: 0; pointer-events: none; }
.finance-kind-choice span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid var(--karte-rand);
  border-radius: 12px;
  color: var(--text-leise);
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}
.finance-kind-choice input:checked + span {
  color: var(--text-stark);
  border-color: rgba(176, 117, 77, 0.48);
  background: rgba(176, 117, 77, 0.1);
  box-shadow: inset 0 0 0 1px rgba(176, 117, 77, 0.12);
}
.finance-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.finance-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.finance-field[hidden] { display: none; }
.finance-field > span:first-child,
.finance-section-title strong {
  color: var(--text-leise);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}
.finance-field > span:first-child small { font-size: 9px; font-weight: 600; text-transform: none; }
.finance-field input,
.finance-field select,
.finance-field textarea {
  width: 100%;
  box-sizing: border-box;
  min-height: 43px;
  padding: 10px 12px;
  border: 1px solid var(--karte-rand);
  border-radius: 11px;
  outline: none;
  color: var(--text-stark);
  background: rgba(255, 255, 255, 0.66);
  font: 14px/1.35 inherit;
}
.finance-field textarea { min-height: 78px; resize: vertical; }
.finance-date-button {
  position: relative;
  width: 100%;
  min-height: 43px;
  box-sizing: border-box;
  padding: 10px 40px 10px 12px;
  border: 1px solid var(--karte-rand);
  border-radius: 11px;
  outline: none;
  color: var(--text-stark);
  background: rgba(255, 255, 255, 0.66);
  font: 14px/1.35 inherit;
  text-align: left;
  cursor: pointer;
}
.finance-date-button::before,
.finance-date-button::after {
  content: "";
  position: absolute;
  right: 14px;
  pointer-events: none;
}
.finance-date-button::before {
  top: 13px;
  width: 13px;
  height: 12px;
  border: 1.5px solid currentColor;
  border-radius: 3px;
  opacity: 0.62;
}
.finance-date-button::after {
  top: 17px;
  width: 13px;
  border-top: 1.5px solid currentColor;
  opacity: 0.62;
}
.finance-date-button.empty { color: var(--text-leise); }
.finance-date-button:hover { background: rgba(255, 255, 255, 0.9); }
.finance-date-button:focus {
  border-color: rgba(176, 117, 77, 0.68);
  box-shadow: 0 0 0 3px rgba(176, 117, 77, 0.11);
}
.finance-field input:focus,
.finance-field select:focus,
.finance-field textarea:focus {
  border-color: rgba(176, 117, 77, 0.68);
  box-shadow: 0 0 0 3px rgba(176, 117, 77, 0.11);
}
.finance-field .finance-invalid {
  border-color: #bc5b4d;
  box-shadow: 0 0 0 3px rgba(188, 91, 77, 0.11);
}
.finance-field-wide { width: 100%; }
.finance-amounts {
  padding: 16px;
  border: 1px solid var(--karte-rand);
  border-radius: 15px;
  background: rgba(40, 39, 37, 0.018);
}
.finance-section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.finance-section-title span { color: var(--text-leise); font-size: 11px; }
.finance-money-input { position: relative; display: block; }
.finance-money-input input { padding-right: 32px; }
.finance-money-input b {
  position: absolute;
  top: 50%;
  right: 12px;
  color: var(--text-leise);
  font-size: 13px;
  font-weight: 600;
  transform: translateY(-50%);
  pointer-events: none;
}
.finance-suggestion {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  min-height: 30px;
  margin-top: -6px;
  padding: 6px 9px;
  border-radius: 10px;
  color: var(--text-leise);
  background: rgba(40, 39, 37, 0.035);
  font-size: 11px;
}
.finance-suggestion[hidden] { display: none; }
.finance-suggestion button {
  margin-left: auto;
  padding: 4px 8px;
  border: 0;
  border-radius: 8px;
  color: var(--akzent);
  background: rgba(176, 117, 77, 0.1);
  font: 650 11px/1 inherit;
  cursor: pointer;
}
.finance-more {
  border-top: 1px solid var(--karte-rand);
  border-bottom: 1px solid var(--karte-rand);
}
.finance-more summary {
  padding: 13px 2px;
  color: var(--text-mittel);
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}
.finance-more[open] { padding-bottom: 16px; }
.finance-more .finance-date-grid { margin-bottom: 12px; }
.finance-error {
  margin: -6px 0 0;
  padding: 9px 11px;
  border-radius: 10px;
  color: #a3483e;
  background: rgba(188, 91, 77, 0.11);
  font-size: 12px;
}
.finance-error[hidden] { display: none; }
.finance-payment-hint {
  margin: -5px 0 0;
  color: var(--text-leise);
  font-size: 11px;
  line-height: 1.4;
}
.finance-series-end {
  justify-self: start; margin-top: -8px; padding: 6px 9px;
  border: 1px solid rgba(176,117,77,.22); border-radius: 9px;
  background: rgba(176,117,77,.07); color: var(--akzent);
  cursor: pointer; font: 650 11px/1.2 var(--font);
}
.finance-series-end:hover { background: rgba(176,117,77,.13); }
.finance-form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-top: 2px;
}
.finance-form-footer > div { display: flex; gap: 8px; }
.finance-primary,
.finance-secondary,
.finance-delete {
  min-height: 42px;
  padding: 9px 17px;
  border: 1px solid var(--karte-rand);
  border-radius: 11px;
  font: 650 13px/1 inherit;
  cursor: pointer;
}
.finance-primary { color: #fff; border-color: var(--akzent); background: var(--akzent); }
.finance-primary:hover { background: #9d6c48; }
.finance-primary:disabled { opacity: 0.55; cursor: wait; }
.finance-secondary { color: var(--text-mittel); background: transparent; }
.finance-secondary:hover { color: var(--text-stark); background: rgba(40, 39, 37, 0.05); }
.finance-delete { padding-inline: 10px; color: var(--text-leise); background: transparent; }
.finance-delete:hover,
.finance-delete.confirm { color: #a3483e; border-color: rgba(188, 91, 77, 0.28); background: rgba(188, 91, 77, 0.08); }

.panel-finance-host {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--karte-rand);
}
.finance-project > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 3px 2px;
  list-style: none;
  cursor: pointer;
}
.finance-project > summary::-webkit-details-marker { display: none; }
.finance-project > summary > span:first-child {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.finance-project > summary strong {
  color: var(--text-leise);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.finance-project > summary small {
  color: var(--akzent);
  font-size: 10px;
  font-weight: 650;
}
.finance-project > summary::after {
  content: "⌄";
  order: 2;
  color: var(--text-leise);
  font-size: 13px;
}
.finance-project[open] > summary::after { transform: rotate(180deg); }
.finance-project-count {
  margin-left: auto;
  min-width: 22px;
  padding: 2px 6px;
  border-radius: 999px;
  color: var(--text-leise);
  background: rgba(40, 39, 37, 0.055);
  font-size: 10px;
  font-weight: 700;
  text-align: center;
}
.finance-project-body { padding-top: 12px; }
.finance-project-actions { display: flex; gap: 7px; margin-bottom: 8px; }
.finance-project-actions button {
  padding: 6px 9px;
  border: 1px solid var(--karte-rand);
  border-radius: 9px;
  color: var(--text-mittel);
  background: transparent;
  font: 650 11px/1 inherit;
  cursor: pointer;
}
.finance-project-actions button:hover { color: var(--text-stark); background: rgba(40, 39, 37, 0.045); }
.finance-row.kompakt {
  grid-template-columns: 27px minmax(0, 1fr) auto 10px;
  min-height: 50px;
  padding: 6px;
}
.finance-row.kompakt .finance-kind { width: 25px; height: 25px; border-radius: 8px; font-size: 13px; }
.finance-row.kompakt .finance-row-meta { display: none; }
.finance-row.kompakt .finance-row-title { font-size: 12.5px; }
.finance-row.kompakt .finance-row-amount { font-size: 11.5px; }
.finance-row.kompakt .finance-chip { font-size: 9px; }
.finance-project-empty {
  margin: 8px 2px 2px;
  color: var(--text-leise);
  font-size: 12px;
}

body.mobil .finance-overlay { align-items: flex-end; padding: 0; }
body.mobil .finance-card {
  width: 100%;
  max-width: none;
  max-height: 92dvh;
  padding: 18px 18px calc(22px + env(safe-area-inset-bottom));
  border-radius: 22px 22px 0 0;
  border-bottom: 0;
  animation: sheet-hoch 0.26s cubic-bezier(0.2, 0.7, 0.3, 1);
}
body.mobil .finance-card::before {
  content: "";
  display: block;
  width: 40px;
  height: 4px;
  margin: -6px auto 12px;
  border-radius: 2px;
  background: var(--karte-rand);
}
body.mobil .finance-grid,
body.mobil .finance-money-grid { grid-template-columns: 1fr; }
body.mobil .finance-date-grid { grid-template-columns: 1fr 1fr; }
body.mobil .finance-field input,
body.mobil .finance-field select,
body.mobil .finance-field textarea,
body.mobil .finance-date-button { font-size: 16px; }
body.mobil .finance-list { max-height: none; overflow: visible; }
body.mobil .finance-row { grid-template-columns: 30px minmax(0, 1fr) 12px; }
body.mobil .finance-row-side { grid-column: 2; align-items: flex-start; flex-direction: row; flex-wrap: wrap; }
body.mobil .finance-row-arrow { grid-column: 3; grid-row: 1 / span 2; }
body.mobil .finance-form-footer { position: sticky; bottom: 0; padding-top: 12px; background: var(--karte-bg-fest); }
body.mobil .finance-form-footer > div { margin-left: auto; }
body.mobil .finance-section-title { align-items: flex-start; flex-direction: column; gap: 3px; }
body.mobil .finance-section { padding: 11px; }
body.mobil .finance-head { flex-direction: column; gap: 12px; }
body.mobil .finance-head-actions {
  flex: 0 0 auto;
  align-self: flex-start;
  width: 100%;
  gap: 6px;
}
body.mobil .finance-head-menu {
  display: grid; grid-template-columns: 1.12fr 1fr 0.78fr; flex: 1 1 auto; min-width: 0;
}
body.mobil .finance-head-menu button {
  min-width: 0; min-height: 40px; padding-inline: 5px; font-size: 9.5px;
}
body.mobil .finance-head-menu .finance-head-expense { justify-content: center; }
body.mobil .finance-head-actions .finance-action {
  display: inline-flex;
  min-height: 40px;
  padding: 6px 10px;
  gap: 6px;
  white-space: nowrap;
}
body.mobil .finance-head-actions .finance-action span {
  width: 22px;
  height: 22px;
}
body.mobil .finance-head-actions .finance-close {
  width: 40px;
  height: 40px;
}
body.mobil .finance-period { align-items: stretch; flex-direction: column; }
body.mobil .finance-period-nav { justify-content: space-between; }
body.mobil .finance-scope-switch { align-self: flex-start; }
body.mobil .finance-kpis { grid-template-columns: 1fr 1fr; }
body.mobil .finance-kpis > .finance-kpi-review { grid-column: 1 / -1; }
body.mobil .finance-kpis strong { font-size: 17px; }
body.mobil .finance-chart-legend { margin: 0 0 3px; justify-content: flex-start; }
body.mobil .finance-overview-grid { grid-template-columns: 1fr; }
body.mobil .finance-ranking-section .finance-section-head {
  align-items: stretch; flex-direction: column; gap: 9px;
}
body.mobil .finance-ranking-switch { width: 100%; box-sizing: border-box; }
body.mobil .finance-ranking-switch button { flex: 1 1 0; min-width: 0; min-height: 32px; }
body.mobil .finance-ranking-row {
  grid-template-columns: 32px minmax(0, 1fr) 14px;
  align-items: center; row-gap: 5px;
}
body.mobil .finance-ranking-row .finance-row-side {
  grid-column: 2; align-items: flex-start; min-width: 0;
}
body.mobil .finance-ranking-primary,
body.mobil .finance-ranking-values { justify-content: flex-start; }
body.mobil .finance-ranking-row .finance-row-arrow { grid-column: 3; grid-row: 1 / span 2; }
body.mobil .finance-ranking-summary { align-items: flex-start; flex-direction: column; gap: 6px; }
body.mobil .finance-overview-footer { align-items: stretch; flex-direction: column; }
body.mobil .finance-overview-footer .finance-primary { width: 100%; }
body.mobil .finance-detail {
  height: 100dvh; max-height: 100dvh; padding: 16px 14px calc(18px + env(safe-area-inset-bottom)); border-radius: 0;
}
body.mobil .finance-detail::before { display: none; }
body.mobil .finance-detail-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
}
body.mobil .finance-detail-head > div:first-child {
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 9px;
}
body.mobil .finance-detail-head h2 { font-size: 20px; }
body.mobil .finance-detail-head .finance-head-actions { grid-column: 1 / -1; }
body.mobil .finance-detail-head .finance-head-actions .finance-close { display: block; }
body.mobil .finance-planning-toolbar { grid-template-columns: 1fr; }
body.mobil .finance-planning-toolbar select { font-size: 16px; }
body.mobil .finance-planning-hero {
  grid-template-columns: 1fr; gap: 15px; padding: 17px;
}
body.mobil .finance-planning-hero-main > strong { font-size: 27px; }
body.mobil .finance-planning-hero-status {
  padding: 13px 0 0; border-top: 1px solid var(--karte-rand); border-left: 0;
}
body.mobil .finance-planning-chart { padding-inline: 0; }
body.mobil .finance-planning-chart-head { align-items: stretch; flex-direction: column; gap: 8px; padding-inline: 2px; }
body.mobil .finance-planning-legend { justify-content: flex-start; }
body.mobil .finance-planning-quarters {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px;
  margin: 9px 0 4px; padding: 3px; border-radius: 10px; background: rgba(40, 39, 37, 0.045);
}
body.mobil .finance-planning-quarters button {
  min-height: 36px; border: 0; border-radius: 8px; color: var(--text-leise);
  background: transparent; font: 650 11px/1 inherit; cursor: pointer;
}
body.mobil .finance-planning-quarters button.active {
  color: var(--text-stark); background: var(--karte-bg-fest); box-shadow: 0 1px 4px rgba(40, 39, 37, 0.09);
}
body.mobil .finance-year-months { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
body.mobil .finance-year-month { min-height: 184px; padding-inline: 7px; }
body.mobil .finance-planning-chart[data-active-quarter="1"] .finance-year-month:not([data-planning-quarter="1"]),
body.mobil .finance-planning-chart[data-active-quarter="2"] .finance-year-month:not([data-planning-quarter="2"]),
body.mobil .finance-planning-chart[data-active-quarter="3"] .finance-year-month:not([data-planning-quarter="3"]),
body.mobil .finance-planning-chart[data-active-quarter="4"] .finance-year-month:not([data-planning-quarter="4"]) { display: none; }
body.mobil .finance-planning-focus-summary {
  grid-template-columns: auto 1fr; align-items: center;
}
body.mobil .finance-planning-focus-summary > p { grid-column: 1 / -1; }
body.mobil .finance-planning-rankings { grid-template-columns: 1fr; }
body.mobil .finance-planning-focus .finance-section-head {
  align-items: stretch; flex-direction: column; gap: 8px;
}
body.mobil .finance-planning-focus .finance-section-head .finance-secondary { width: 100%; }
body.mobil .finance-detail-toolbar { grid-template-columns: 1fr; }
body.mobil .finance-detail-period-nav,
body.mobil .finance-custom-range { grid-column: 1; }
body.mobil .finance-detail-toolbar select,
body.mobil .finance-detail-toolbar input { font-size: 16px; }
body.mobil .finance-detail-check { min-height: 44px; }
body.mobil .finance-detail-kpis { grid-template-columns: 1fr 1fr; }
body.mobil .finance-table-wrap { max-height: 48dvh; }

@media (max-width: 1180px) and (min-width: 701px) {
  .finance-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .finance-kpis > .finance-kpi-review { grid-column: span 2; }
  .finance-planning-hero { gap: 18px; padding-inline: 18px; }
  .finance-planning-hero-status { padding-left: 14px; }
  .finance-detail-toolbar { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .finance-detail-period-nav { grid-column: span 2; }
  .finance-detail-search { grid-column: span 2; }
  .finance-detail-check { align-self: end; }
  .finance-table { min-width: 620px; table-layout: fixed; }
  .finance-table th:nth-child(1) { width: 12%; }
  .finance-table th:nth-child(2) { width: 11%; }
  .finance-table th:nth-child(3) { width: 20%; }
  .finance-table th:nth-child(4) { width: 25%; }
  .finance-table th:nth-child(5) { width: 13%; }
  .finance-table th:nth-child(6) { width: 16%; }
  .finance-table th:nth-child(7) { width: 3%; }
}
@media (max-width: 520px) {
  .finance-date-grid { grid-template-columns: 1fr; }
  .finance-form-footer { align-items: stretch; flex-direction: column-reverse; }
  .finance-form-footer > div { width: 100%; }
  .finance-form-footer > div > button { flex: 1; }
  .finance-delete { align-self: flex-start; }
  .finance-kpis { grid-template-columns: 1fr 1fr; }
  .finance-overview-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .finance-overlay,
  .finance-card { animation: none; }
}
