/* Finance Integrity – interaktive Demo */
.demo-steps { position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,0.96); border-bottom: 1px solid var(--line); backdrop-filter: blur(6px); }
.demo-steps .wrap { display: flex; gap: 6px; overflow-x: auto; padding-block: 10px; scrollbar-width: none; }
.demo-steps a { flex: none; display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; color: var(--ink-2); text-decoration: none; font-size: 0.92rem; border: 1px solid transparent; }
.demo-steps a b { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--green-soft); color: var(--green-dark); font-size: 0.78rem; }
.demo-steps a.active { border-color: var(--green); color: var(--ink); }
.demo-steps a.active b { background: var(--green); color: #fff; }

.demo-sec { padding-block: 64px; scroll-margin-top: 64px; }
.demo-sec:nth-of-type(even) { background: var(--surface); }
.demo-sec h2 { margin-bottom: 10px; }
.demo-sec .sub { color: var(--ink-2); max-width: 70ch; margin: 0 0 28px; }
.step-no { font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.08em; color: var(--green); text-transform: uppercase; margin-bottom: 8px; display: block; }

.facts4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 28px; }
.fact4 { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.demo-sec:nth-of-type(even) .fact4 { background: var(--paper); }
.fact4 b { display: block; font-family: var(--display); font-size: 2rem; line-height: 1.1; color: var(--navy); }
.fact4 span { color: var(--ink-2); font-size: 0.92rem; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 22px; }
.demo-sec:nth-of-type(even) .panel { background: var(--paper); }
.grid-2 { display: grid; grid-template-columns: 1.25fr 1fr; gap: 22px; align-items: start; }
.grid-2b { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: start; }
.panel h3 { font-size: 1.1rem; margin: 0 0 12px; }
.muted-s { color: var(--ink-3); font-size: 0.85rem; }

/* Eingang */
.timeline { display: grid; grid-template-columns: repeat(10, 1fr); gap: 6px; align-items: end; height: 150px; margin: 8px 0 6px; }
.tl-col { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 3px; height: 100%; }
.tl-dot { width: 100%; max-width: 34px; height: 14px; border-radius: 3px; background: var(--green); opacity: .85; }
.tl-dot.late { background: #b7791f; }
.tl-lab { display: grid; grid-template-columns: repeat(10, 1fr); gap: 6px; font-family: var(--mono); font-size: 0.75rem; color: var(--ink-3); text-align: center; }
.tl-phase { display: grid; grid-template-columns: repeat(10, 1fr); gap: 6px; margin-top: 10px; font-size: 0.78rem; }
.tl-phase span { border-radius: 4px; padding: 4px 6px; text-align: center; }
.ph-in { grid-column: 2 / 7; background: var(--green-soft); color: var(--green-dark); }
.ph-pr { grid-column: 6 / 10; background: #fff4e0; color: #8a5a12; }
.ph-out { grid-column: 10 / 11; background: var(--navy); color: #fff; }

.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.tabs button { font: inherit; font-size: 0.88rem; border: 1px solid var(--line); background: var(--surface); padding: 6px 12px; border-radius: 999px; cursor: pointer; color: var(--ink-2); }
.tabs button[aria-selected="true"] { border-color: var(--green); color: var(--ink); background: var(--green-soft); }
.rawhead { font-family: var(--mono); font-size: 0.78rem; color: var(--ink-3); margin-bottom: 6px; }
table.raw { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: 0.8rem; }
table.raw th, table.raw td { border-bottom: 1px solid var(--line); padding: 5px 8px; text-align: left; white-space: nowrap; }
table.raw td.n, table.raw th.n { text-align: right; }
table.raw tr.hl td { background: #fdecea; }
table.raw tr.key td:first-child { color: var(--green-dark); font-weight: 700; }
.issues { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.issues li { padding-left: 28px; position: relative; color: var(--ink-2); font-size: 0.95rem; }
.issues li::before { content: "!"; position: absolute; left: 0; top: 1px; width: 19px; height: 19px; border-radius: 50%; background: #fdecea; color: #b03a2e; font-weight: 700; font-size: 0.75rem; display: grid; place-items: center; }

/* Prüfung */
.status { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; font-weight: 700; font-size: 0.9rem; letter-spacing: 0.02em; transition: background .4s, color .4s; }
.status.bad { background: #fdecea; color: #b03a2e; }
.status.good { background: #def2ee; color: #146c64; }
.checks { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 8px; }
.checks li { display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: start; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); transition: border-color .4s, background .4s; }
.checks li .nr { font-family: var(--mono); font-weight: 700; color: var(--ink-3); }
.checks li .t { font-size: 0.95rem; }
.checks li .r { color: var(--ink-3); font-size: 0.85rem; margin-top: 2px; }
.checks li .fix { display: none; margin-top: 6px; font-size: 0.86rem; color: #146c64; }
.checks li.fixed .fix { display: block; }
.pill { font-size: 0.75rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.pill.OK { background: #def2ee; color: #146c64; }
.pill.FEHLER { background: #fdecea; color: #b03a2e; }
.pill.HINWEIS { background: #fff4e0; color: #8a5a12; }
.pill.INFO, .pill.OFFEN { background: #eef1f5; color: var(--ink-2); }
.checks li.flag { border-color: #f1b8b1; }
.impact { display: grid; gap: 12px; }
.impact .row { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px dashed var(--line); padding-bottom: 8px; font-size: 0.95rem; }
.impact .row b { font-family: var(--display); font-size: 1.15rem; white-space: nowrap; }
.btn-run { margin-top: 18px; }

/* Bericht */
.seg-toggle { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; margin-bottom: 16px; }
.seg-toggle button { font: inherit; font-size: 0.88rem; border: 0; background: var(--surface); padding: 6px 14px; cursor: pointer; color: var(--ink-2); }
.seg-toggle button[aria-pressed="true"] { background: var(--navy); color: #fff; }
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; }
.demo-sec:nth-of-type(even) .tile { background: var(--paper); }
.tile .k { font-size: 0.82rem; color: var(--ink-3); }
.tile .v { font-family: var(--display); font-size: 1.7rem; color: var(--navy); line-height: 1.2; }
.tile .d { font-size: 0.85rem; margin-top: 2px; }
.pos { color: #146c64; } .neg { color: #b03a2e; }
.chart { width: 100%; height: auto; display: block; }
.chart text { font-family: var(--body); font-size: 12.5px; fill: var(--ink-3); }
.chart .grid { stroke: #e8edf3; stroke-width: 1; }
.chart .l-ist { fill: none; stroke: var(--green); stroke-width: 2.2; }
.chart .l-plan { fill: none; stroke: #8a98aa; stroke-width: 1.6; stroke-dasharray: 5 4; }
.chart .dot { fill: var(--green); stroke: #fff; stroke-width: 2; }
.chart .xh { stroke: var(--ink-3); stroke-width: 1; stroke-dasharray: 2 3; }
.legend { display: flex; gap: 16px; font-size: 0.82rem; color: var(--ink-2); margin-bottom: 6px; flex-wrap: wrap; }
.legend i { display: inline-block; width: 18px; height: 0; border-top: 2.2px solid var(--green); vertical-align: middle; margin-right: 6px; }
.legend i.plan { border-top: 2px dashed #8a98aa; }
.tip { position: absolute; pointer-events: none; background: var(--navy); color: #fff; font-size: 0.8rem; padding: 6px 9px; border-radius: 6px; white-space: nowrap; transform: translate(-50%, -110%); opacity: 0; transition: opacity .12s; }
.chartbox { position: relative; }
table.rep { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
table.rep th { text-align: right; font-weight: 600; color: var(--ink-3); font-size: 0.8rem; border-bottom: 1px solid var(--line); padding: 7px 8px; }
table.rep th:first-child, table.rep td:first-child { text-align: left; }
table.rep td { text-align: right; padding: 7px 8px; border-bottom: 1px solid #eef2f6; white-space: nowrap; }
table.rep tr.sum td { font-weight: 700; border-top: 1px solid var(--ink-3); }
table.rep tbody tr.click { cursor: pointer; }
table.rep td.nm { white-space: normal; min-width: 180px; }
.ent-grid { display: grid; grid-template-columns: 1.45fr 1fr; gap: 22px; align-items: start; }
.stack { display: grid; gap: 22px; }
table.rep tbody tr.click:hover td { background: var(--green-soft); }
table.rep tbody tr.sel td { background: #def2ee; }
.bar { display: inline-block; height: 8px; border-radius: 4px; vertical-align: middle; margin-left: 8px; }
.comments { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.comments li { border-left: 3px solid var(--green); padding: 4px 0 4px 14px; font-size: 0.93rem; color: var(--ink-2); }
.comments li b { color: var(--ink); display: block; font-size: 0.92rem; }

/* Gesellschaften */
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.chips button { font: inherit; font-size: 0.85rem; border: 1px solid var(--line); background: var(--surface); padding: 5px 12px; border-radius: 999px; cursor: pointer; color: var(--ink-2); }
.chips button[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.ampel { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.ampel.g { background: #2a9d8f; } .ampel.y { background: #d69e2e; } .ampel.r { background: #c0392b; }
.detail h3 { margin-bottom: 2px; }
.detail .meta { color: var(--ink-3); font-size: 0.85rem; margin-bottom: 12px; }
.tbl-scroll { overflow-x: auto; }

/* Zukäufe */
.acq { display: grid; gap: 18px; }
.acq-row { display: grid; grid-template-columns: 220px 1fr; gap: 16px; align-items: center; }
.acq-row .nm b { display: block; font-size: 0.95rem; }
.acq-row .nm span { font-size: 0.82rem; color: var(--ink-3); }
.months { display: grid; grid-template-columns: repeat(9, 1fr); gap: 4px; align-items: end; height: 70px; }
.months div { background: #e8edf3; border-radius: 3px 3px 0 0; position: relative; }
.months div.on { background: var(--green); }
.months div.first { background: var(--navy); }
.mlab { display: grid; grid-template-columns: repeat(9, 1fr); gap: 4px; font-size: 0.72rem; color: var(--ink-3); text-align: center; margin-top: 4px; }

.demo-note { font-size: 0.82rem; color: var(--ink-3); margin-top: 18px; }

@media (max-width: 900px) {
  .grid-2, .grid-2b, .ent-grid { grid-template-columns: 1fr; }
  .facts4, .tiles { grid-template-columns: repeat(2, 1fr); }
  .acq-row { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { .status, .checks li { transition: none; } }
.grid-2 > *, .grid-2b > *, .ent-grid > *, .stack > *, .acq-row > * { min-width: 0; }
@media (max-width: 600px) {
  #ent-table th:nth-child(2), #ent-table td:nth-child(2) { display: none; }
  .panel { padding: 16px; }
  table.rep td, table.rep th { padding: 6px 5px; }
  .checks li { grid-template-columns: 30px 1fr; }
  .checks li .pill { grid-column: 2; justify-self: start; }
}
.tl-dot { cursor: pointer; }
.tl-dot.sel, .tl-dot:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }
.tl-info { font-size: 0.82rem; color: var(--ink-2); margin-top: 8px; min-height: 1.3em; }
@media (max-width: 640px) {
  .tbl-scroll.scrolls::before { content: "Tabelle seitlich wischen \2192"; display: block; font-size: 0.75rem; color: var(--ink-3); margin-bottom: 6px; }
}
