/* Inzichten vertelt eerst het financiële verhaal. Belasting en doelen blijven
   beschikbaar als rustige disclosures wanneer de gebruiker ze nodig heeft. */
#moneyView #moneyPanelProfit { padding: 28px; }

#moneyView #moneyPanelProfit .visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

#moneyView #moneyPanelProfit .money-buddy-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 0 0 22px;
  padding: 0;
  border: 0;
}

#moneyView #moneyPanelProfit .money-buddy-head h2 {
  margin: 0;
  font: 400 34px/1.15 var(--font-display);
  letter-spacing: -.035em;
}

#moneyView #moneyPanelProfit .money-month-navigation {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
}

#moneyView #moneyPanelProfit .money-month-navigation button {
  display: grid;
  place-items: center;
  width: 42px;
  min-width: 42px;
  min-height: 44px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
}

#moneyView #moneyPanelProfit .money-month-navigation button:hover {
  background: var(--hover);
  color: var(--ink);
}

#moneyView #moneyPanelProfit .money-month-navigation button:disabled { opacity: .35; }
#moneyView #moneyPanelProfit .money-month-navigation .summa-icon { width: 17px; height: 17px; }

#moneyView #moneyPanelProfit #moneyMonth {
  width: auto;
  min-width: 150px;
  max-width: 205px;
  min-height: 44px;
  padding: 8px 28px 8px 12px;
  border: 0;
  border-radius: 0;
  background-color: transparent;
  font-size: 14px;
}

#moneyView #moneyPanelProfit .money-month-summary {
  display: block;
  overflow: hidden;
  margin: 0 0 30px;
  padding: 10px 22px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
}

#moneyView #moneyPanelProfit .money-month-summary > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  min-width: 0;
  padding: 13px 0;
  border: 0;
}

#moneyView #moneyPanelProfit .money-month-summary > .is-profit {
  margin-top: 2px;
  padding-top: 17px;
  border-top: 1px solid var(--line);
}

#moneyView #moneyPanelProfit .money-month-summary span,
#moneyView #moneyPanelProfit .money-month-summary strong { display: block; }

#moneyView #moneyPanelProfit .money-month-summary span {
  color: var(--ink);
  font-size: 15px;
}

#moneyView #moneyPanelProfit .money-month-summary strong {
  margin: 0;
  color: var(--ink);
  font: 400 25px/1.2 var(--font-display);
  font-variant-numeric: lining-nums tabular-nums;
  letter-spacing: -.025em;
  text-align: right;
  white-space: nowrap;
}

#moneyView #moneyPanelProfit .money-month-summary .is-profit span { font-weight: 650; }
#moneyView #moneyPanelProfit .money-month-summary .is-profit strong { font-weight: 500; }
#moneyView #moneyPanelProfit .money-month-summary .is-negative strong { color: var(--danger); }

#moneyView #moneyPanelProfit .money-profit-chart-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin: 0;
  padding: 0;
  border: 0;
}

#moneyView #moneyPanelProfit .money-profit-chart-head h3 {
  margin: 0;
  font: 400 28px/1.15 var(--font-display);
  letter-spacing: -.03em;
}

#moneyView #moneyPanelProfit .money-profit-chart-head > div:last-child { text-align: right; }
#moneyView #moneyPanelProfit .money-profit-chart-head > div:last-child span,
#moneyView #moneyPanelProfit .money-profit-chart-head > div:last-child strong { display: block; }

#moneyView #moneyPanelProfit .money-profit-chart-head > div:last-child span {
  color: var(--muted);
  font-size: 12px;
}

#moneyView #moneyPanelProfit .money-profit-chart-head > div:last-child strong {
  margin-top: 3px;
  font-size: 18px;
}

#moneyView #moneyPanelProfit #moneyChart {
  height: 156px;
  margin: 18px 0 30px;
  gap: 8px;
}

/* Empty chart: one balanced panel instead of a line at the chart baseline. */
#moneyView #moneyPanelProfit #moneyChart.is-empty {
  height: auto;
  display: block;
}

#moneyView #moneyPanelProfit #moneyChart.is-empty > .empty {
  display: grid;
  place-items: center;
  min-height: 112px;
  margin: 0;
  padding: 28px 24px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
  text-align: center;
  text-wrap: balance;
}

#moneyView #moneyPanelProfit #moneyChart .bar-month { gap: 7px; }

#moneyView #moneyPanelProfit #moneyChart button.bar-month {
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  box-shadow: none;
  cursor: pointer;
  appearance: none;
}

#moneyView #moneyPanelProfit #moneyChart button.bar-month:hover .bar {
  background: color-mix(in srgb, var(--chart-revenue) 78%, var(--paper));
}

#moneyView #moneyPanelProfit #moneyChart button.bar-month:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 4px;
}

#moneyView #moneyPanelProfit #moneyChart .bar {
  border-radius: 5px 5px 0 0;
  background: color-mix(in srgb, var(--chart-revenue) 62%, var(--paper));
}

#moneyView #moneyPanelProfit #moneyChart .bar-month.is-selected .bar { background: var(--chart-revenue); }

#moneyView #moneyPanelProfit #moneyChart .bar-month.is-selected .label {
  color: var(--ink);
  font-weight: 700;
}

#moneyView #moneyPanelProfit #moneyChart .label {
  font-size: 12px;
  text-transform: lowercase;
}

#moneyView #moneyPanelProfit #moneyChart.has-negative .bar.is-negative { background: var(--danger); }

#moneyView #moneyPanelProfit .money-secondary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}

#moneyView #moneyPanelProfit .money-secondary-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
}

#moneyView #moneyPanelProfit .money-secondary-card[open] { grid-column: 1 / -1; }

#moneyView #moneyPanelProfit .money-secondary-grid:has(> .money-secondary-card[open]) > .money-secondary-card:not([open]) {
  display: none;
}

#moneyView #moneyPanelProfit .money-secondary-card > summary {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 13px;
  min-height: 104px;
  padding: 16px;
  cursor: pointer;
  list-style: none;
}

#moneyView #moneyPanelProfit .money-secondary-card > summary::-webkit-details-marker { display: none; }
#moneyView #moneyPanelProfit .money-secondary-card > summary:hover { background: var(--hover); }

#moneyView #moneyPanelProfit .money-secondary-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--surface-soft);
  color: var(--ink);
}

#moneyView #moneyPanelProfit .money-secondary-icon .summa-icon {
  width: 21px;
  height: 21px;
  stroke-width: 1.65;
}

#moneyView #moneyPanelProfit .money-secondary-copy { min-width: 0; }
#moneyView #moneyPanelProfit .money-secondary-copy > span,
#moneyView #moneyPanelProfit .money-secondary-copy > strong,
#moneyView #moneyPanelProfit .money-secondary-copy > small { display: block; }

#moneyView #moneyPanelProfit .money-secondary-copy > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

#moneyView #moneyPanelProfit .money-secondary-copy > strong {
  overflow: hidden;
  margin-top: 3px;
  color: var(--ink);
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#moneyView #moneyPanelProfit .money-secondary-copy > small {
  overflow: hidden;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#moneyView #moneyPanelProfit .money-secondary-chevron {
  width: 18px;
  height: 18px;
  color: var(--muted);
  transition: transform .18s ease;
}

#moneyView #moneyPanelProfit .money-secondary-card[open] > summary .money-secondary-chevron {
  transform: rotate(90deg);
}

#moneyView #moneyPanelProfit .money-secondary-card[open] > summary {
  min-height: 76px;
  border-bottom: 1px solid var(--line);
}

#moneyView #moneyPanelProfit #moneyPotCard,
#moneyView #moneyPanelProfit .money-buddy-goals {
  display: block;
  margin: 0;
  padding: 20px;
  border: 0;
  border-radius: 0;
  background: transparent;
}

#moneyView #moneyPanelProfit .money-pot-label {
  display: block;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}

#moneyView #moneyPanelProfit #moneyPotTitle {
  margin: 9px 0 4px;
  font: 600 16px/1.35 var(--font-sans, Figtree, sans-serif);
  letter-spacing: 0;
}

#moneyView #moneyPanelProfit .money-reserve-amount {
  display: block;
  margin-top: 8px;
  font: 400 32px/1.12 var(--font-display);
  letter-spacing: -.035em;
}

#moneyView #moneyPanelProfit #moneyPotMessage {
  margin: 7px 0 16px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

#moneyView #moneyPanelProfit #moneyPotCard.is-unavailable :is(
  .money-pot-label,
  #moneyPotTitle,
  .money-reserve-amount,
  #moneyPotGauge,
  .money-pot-values,
  .money-pot-actions,
  .money-pot-editor,
  .money-pot-note
) {
  display: none;
}

#moneyView #moneyPanelProfit #moneyPotCard.is-unavailable #moneyPotMessage {
  margin: 0;
}

#moneyView #moneyPanelProfit #moneyPotGauge {
  position: relative;
  display: block;
  width: 100%;
  height: auto;
  margin: 0 0 10px;
  padding-top: 14px;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
}

#moneyView #moneyPanelProfit #moneyPotGauge::before {
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  border-radius: 4px;
  background: linear-gradient(to right, var(--accent) var(--pot-fill, 0%), var(--surface-soft) var(--pot-fill, 0%));
  content: '';
}

#moneyView #moneyPanelProfit #moneyPotGauge::after { content: none; }

#moneyView #moneyPanelProfit #moneyPotGauge > div {
  display: flex;
  align-items: baseline;
  justify-content: flex-start;
  gap: 4px;
  width: 100%;
  height: auto;
  margin: 0;
  border-radius: 0;
  background: none;
  text-align: left;
}

#moneyView #moneyPanelProfit #moneyPotGauge :is(strong, span) {
  margin: 0;
  color: var(--muted);
  font: 400 12px/1.4 var(--font-sans, Figtree, sans-serif);
}

#moneyView #moneyPanelProfit .money-pot-values {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-soft);
}

#moneyView #moneyPanelProfit .money-pot-values > :is(div, button) {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  margin: 0;
  padding: 10px 12px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  font-weight: 400;
}

#moneyView #moneyPanelProfit .money-pot-values > :last-child { border-right: 0; }
#moneyView #moneyPanelProfit .money-pot-values span { color: var(--muted); font-size: 12px; }

#moneyView #moneyPanelProfit .money-pot-values strong {
  margin: 0;
  color: var(--ink);
  font: 400 18px/1.2 var(--font-display);
  text-align: right;
}

#moneyView #moneyPanelProfit #moneyPotSavedTrigger span {
  text-decoration: underline;
  text-underline-offset: 3px;
}

#moneyView #moneyPanelProfit .money-pot-actions { margin-top: 12px; }
#moneyView #moneyPanelProfit #moneyPotConfirmButton { width: 100%; min-height: 42px; }

#moneyView #moneyPanelProfit .money-pot-editor {
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

#moneyView #moneyPanelProfit .money-pot-editor label {
  grid-column: 1 / -1;
  min-width: 0;
}

#moneyView #moneyPanelProfit .money-pot-editor input { width: 100%; }

#moneyView #moneyPanelProfit .money-pot-note,
#moneyView #moneyPanelProfit .money-buddy-disclaimer {
  display: block;
  margin-top: 10px;
  padding: 0;
  border: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

#moneyView #moneyPanelProfit .money-buddy-goals-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0;
  border: 0;
}

#moneyView #moneyPanelProfit .money-buddy-goals-head h3 {
  margin: 0;
  font: 400 23px/1.2 var(--font-display);
  letter-spacing: -.025em;
}

#moneyView #moneyPanelProfit .money-buddy-goals-head small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

#moneyView #moneyPanelProfit #moneyBuddyAddButton {
  flex: 0 0 auto;
  min-height: 40px;
}

#moneyView #moneyPanelProfit .money-buddy-goals-summary {
  margin: 16px 0 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

#moneyView #moneyPanelProfit .money-buddy-goals-list:not(:has(.money-buddy-empty)) {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

#moneyView #moneyPanelProfit .money-buddy-goal-row {
  border: 1px solid var(--line);
  border-radius: 9px;
}

#moneyView #moneyPanelProfit .money-buddy-empty {
  display: block;
  padding: 14px 0 0;
  color: var(--muted);
  font-size: 13px;
}

#moneyView #moneyPanelProfit .money-buddy-goals:has(.money-buddy-empty) .money-buddy-disclaimer { display: none; }

#moneyView #moneyPanelProfit .money-buddy-goals:has(.money-buddy-empty) .money-buddy-goals-head > div,
#moneyView #moneyPanelProfit .money-buddy-goals:has(.money-buddy-empty) .money-buddy-empty {
  display: none;
}

#moneyView #moneyPanelProfit .money-buddy-goals:has(.money-buddy-empty) #moneyBuddyAddButton {
  width: 100%;
}

#moneyView #moneyPanelProfit .money-insights-footnote {
  margin: 16px 2px 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

@media (max-width: 850px) {
  #moneyView #moneyPanelProfit { padding: 22px; }
  #moneyView #moneyPanelProfit .money-buddy-goals-list:not(:has(.money-buddy-empty)) { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  #moneyView #moneyPanelProfit {
    overflow: visible;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  #moneyView #moneyPanelProfit .money-buddy-head {
    display: block;
    margin-bottom: 14px;
  }

  #moneyView #moneyPanelProfit .money-buddy-head h2 {
    margin-bottom: 13px;
    font-size: 31px;
  }

  #moneyView #moneyPanelProfit .money-month-navigation { width: min(100%, 286px); }

  #moneyView #moneyPanelProfit #moneyMonth {
    flex: 1;
    min-width: 0;
    max-width: none;
    font-size: 15px;
    text-align: center;
  }

  #moneyView #moneyPanelProfit .money-month-summary {
    margin-bottom: 28px;
    padding: 8px 16px;
  }

  #moneyView #moneyPanelProfit .money-month-summary > div { padding: 12px 0; }
  #moneyView #moneyPanelProfit .money-month-summary span { font-size: 14px; }
  #moneyView #moneyPanelProfit .money-month-summary strong { font-size: 23px; }
  #moneyView #moneyPanelProfit .money-profit-chart-head h3 { font-size: 27px; }
  #moneyView #moneyPanelProfit .money-profit-chart-head > div:last-child span { font-size: 12px; }
  #moneyView #moneyPanelProfit .money-profit-chart-head > div:last-child strong { font-size: 17px; }

  #moneyView #moneyPanelProfit #moneyChart {
    height: 142px;
    margin: 16px 0 26px;
    gap: 5px;
  }

  #moneyView #moneyPanelProfit .money-secondary-card > summary {
    grid-template-columns: 36px minmax(0, 1fr) 14px;
    gap: 9px;
    min-height: 116px;
    padding: 13px 11px;
  }

  #moneyView #moneyPanelProfit .money-secondary-card[open] > summary { min-height: 70px; }

  #moneyView #moneyPanelProfit .money-secondary-icon {
    width: 36px;
    height: 36px;
  }

  #moneyView #moneyPanelProfit .money-secondary-icon .summa-icon {
    width: 19px;
    height: 19px;
  }

  #moneyView #moneyPanelProfit .money-secondary-copy > strong { font-size: 13px; }
  #moneyView #moneyPanelProfit .money-secondary-copy > small { font-size: 12px; }

  #moneyView #moneyPanelProfit .money-secondary-chevron {
    width: 14px;
    height: 14px;
  }

  #moneyView #moneyPanelProfit #moneyPotCard,
  #moneyView #moneyPanelProfit .money-buddy-goals { padding: 16px; }

  #moneyView #moneyPanelProfit .money-pot-values { grid-template-columns: 1fr; }

  #moneyView #moneyPanelProfit .money-pot-values > :is(div, button) {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  #moneyView #moneyPanelProfit .money-pot-values > :last-child { border-bottom: 0; }

  #moneyView #moneyPanelProfit .money-buddy-goals-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  #moneyView #moneyPanelProfit .money-buddy-goals-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 390px) {
  #moneyView #moneyPanelProfit .money-secondary-grid { grid-template-columns: 1fr; }
  #moneyView #moneyPanelProfit .money-secondary-card[open] { grid-column: auto; }
  #moneyView #moneyPanelProfit .money-secondary-card > summary { min-height: 88px; }
}

@media (prefers-reduced-motion: reduce) {
  #moneyView #moneyPanelProfit .money-secondary-chevron { transition: none; }
}
