/* Erweiterung 2: Investitionen. Only colour variables of app.css (documented contrast pairs >= 4.5:1). Mobile first:
   sections stack; from 64rem two columns. No fixed widths -> no horizontal scrolling at 390 px. */

.inv-cards .inv-card { display: flex; flex-direction: column; gap: .25rem; }
.inv-card-title { margin: 0; font-size: 1.1rem; }
.inv-card .inv-facts { margin: .25rem 0; }

.inv-back { margin: 0 0 .5rem; }
.inv-back a { display: inline-flex; align-items: center; min-height: var(--tap); }

.inv-detail { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 1rem; align-items: start; }
.inv-detail > * { min-width: 0; }
@media (min-width: 64rem) {
  .inv-detail { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .inv-detail > .inv-log { grid-column: 1 / -1; }
}

/* facts: label/value pairs, stacked on small screens */
.inv-facts { display: grid; grid-template-columns: minmax(0, 1fr); gap: .1rem .75rem; margin: .5rem 0; }
.inv-facts dt { color: var(--c-muted); font-weight: 600; }
.inv-facts dd { margin: 0 0 .35rem; overflow-wrap: anywhere; }
@media (min-width: 30rem) {
  .inv-facts { grid-template-columns: minmax(8rem, 40%) minmax(0, 1fr); }
  .inv-facts dd { margin: 0; }
}
.inv-text { white-space: pre-wrap; overflow-wrap: anywhere; margin: .25rem 0; }
.inv-report { border-left: 4px solid var(--c-border); padding: .25rem .75rem; background: var(--c-subtle); border-radius: 6px; }

/* rows (costs, quotes, contributions, attachments, comments) instead of wide tables */
.inv-rows { list-style: none; padding: 0; margin: .5rem 0; }
.inv-row { border-bottom: 1px solid var(--c-subtle); padding: .5rem 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: .15rem; }
.inv-row:last-child { border-bottom: 0; }
.inv-row .actions { margin-top: .25rem; }
.inv-row-amount { font-variant-numeric: tabular-nums; font-weight: 600; }
.inv-row-amount .inv-facts { font-weight: 400; margin: 0; }
.inv-row-inactive { color: var(--c-muted); }
@media (min-width: 40rem) {
  .inv-row { grid-template-columns: minmax(0, 1fr) auto; }
  .inv-row-amount { text-align: right; }
  .inv-row > :not(.inv-row-main):not(.inv-row-amount) { grid-column: 1 / -1; }
}

/* funding progress */
.inv-progress { display: flex; flex-direction: column; gap: .25rem; margin: .5rem 0; }
.inv-progress progress { width: 100%; height: 1rem; accent-color: var(--c-primary); }
.inv-progress-text { font-weight: 600; }
.inv-paid-hint { font-weight: 400; }
.inv-warnings { margin: .5rem 0; padding: .5rem .75rem .5rem 1.75rem; background: var(--c-warn-bg); color: var(--c-text); border-radius: var(--radius); }

/* decision and funding shown side by side but separately */
.inv-split { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); gap: .5rem; margin: .75rem 0 .25rem; }
.inv-split-box { border: 1px solid var(--c-border); border-radius: var(--radius); padding: .5rem .75rem; }
.inv-split-box p { margin: 0; }
.inv-split-label { color: var(--c-muted); font-weight: 600; }

/* flow steps: wrap instead of scrolling; state is also given as text (not colour only) */
.inv-flow { list-style: none; padding: 0; margin: .5rem 0; display: flex; flex-wrap: wrap; gap: .35rem; counter-reset: invstep; }
.inv-step { border: 1px solid var(--c-border); border-radius: 999px; padding: .2rem .7rem; background: var(--c-surface); color: var(--c-muted); font-size: .92rem; }
.inv-step-done { color: var(--c-text); background: var(--c-subtle); }
.inv-step-done::before { content: "✓ "; }
.inv-step-current { background: var(--c-primary); color: var(--c-on-primary); border-color: var(--c-primary); font-weight: 700; }
.inv-step-alt { border-style: dashed; }
.inv-step-or { font-style: italic; }
.inv-step-current .inv-step-or { color: var(--c-on-primary); }

/* category chips: real checkboxes with large labels (>= 44 px) */
.inv-chips { display: flex; flex-wrap: wrap; gap: .4rem; margin: .25rem 0 .5rem; }
.inv-chip { position: relative; }
.inv-chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.inv-chip label { display: inline-flex; align-items: center; min-height: var(--tap); padding: .35rem .85rem; border: 1px solid var(--c-muted); border-radius: 999px; cursor: pointer; font-weight: 400; background: var(--c-surface); color: var(--c-text); }
.inv-chip input:checked + label { background: var(--c-primary); color: var(--c-on-primary); border-color: var(--c-primary); font-weight: 600; }
.inv-chip input:checked + label::before { content: "✓ "; white-space: pre; }
.inv-chip input:focus-visible + label { outline: 3px solid var(--c-focus); outline-offset: 2px; }
.inv-custom-cat { display: flex; flex-wrap: wrap; gap: .5rem; align-items: flex-end; }
.inv-custom-cat .field { flex: 1 1 14rem; }

.inv-grid2, .inv-grid3 { display: grid; gap: .75rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 30rem) {
  .inv-grid2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .inv-grid3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 44rem) { .inv-grid3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.inv-mode-hint.inv-mode-error { color: var(--c-danger); font-weight: 600; }
.inv-alt { border-top: 1px solid var(--c-subtle); padding-top: .5rem; margin-top: .5rem; }
.inv-alt h4 { margin: 0 0 .25rem; }
.inv-fu + .inv-fu { margin-top: .75rem; }
.inv-ext { overflow-wrap: anywhere; word-break: break-word; display: inline-block; min-height: var(--tap); padding: .6rem 0; }
.inv-source-text { overflow-wrap: anywhere; }
.inv-comment-form { margin-top: .75rem; }

.inv-log summary { cursor: pointer; font-weight: 700; min-height: var(--tap); display: flex; align-items: center; }
