/* Закон 3: «Кассовый разрыв» — график кассы и прибыли по отчёту, календарь платежей.
   Подключается в уроке после course.css. Цвета — только переменные из course.css. */
.ks-screen, .ks-more, .ks-act { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; min-width: 0; }
.ks-screen > *, .ks-more > *, .ks-act > * { min-width: 0; }
.ks-act:empty, .ks-more:empty { display: none; }

.ks-facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ks-facts li { position: relative; padding-left: 20px; }
.ks-facts li::before { content: ""; position: absolute; left: 2px; top: 0.62em; width: 9px; height: 9px; border-radius: 3px; background: var(--accent); }

.ks-board { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 760px) { .ks-board { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); align-items: start; } }
.ks-plot, .ks-side { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; min-width: 0; align-content: start; }
.ks-side { gap: 12px; }
/* Касса и прибыль по отчёту — рядом и на телефоне */
.ks-side .stat { flex: 1 1 110px; min-width: 0; padding: 10px 12px; }
.ks-side .stat b { font-size: clamp(1rem, 4.4vw, 1.3rem); white-space: nowrap; }

.ks-chart { display: block; width: 100%; height: auto; }
.ks-chart text { font: 600 10px/1 var(--sans); fill: var(--muted); }
.ks-neg { fill: var(--bad-tint); }
.ks-grid { stroke: var(--line); stroke-width: 1; }
.ks-zero { stroke: var(--line-strong); stroke-width: 1.2; stroke-dasharray: 4 3; }
.ks-mark { stroke: var(--line-strong); stroke-width: 1; stroke-dasharray: 2 3; }
.ks-cash { fill: none; stroke: var(--p1); stroke-width: 2.6; stroke-linejoin: round; stroke-linecap: round; }
.ks-prof { fill: none; stroke: var(--good); stroke-width: 2; stroke-dasharray: 6 4; stroke-linejoin: round; }
.ks-dot { fill: var(--bad); stroke: var(--card); stroke-width: 2; }

.ks-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 0.85rem; }
.ks-key { display: inline-block; width: 18px; border-top: 3px solid var(--p1); vertical-align: middle; margin-right: 6px; }
.ks-key-prof { border-top-style: dashed; border-top-color: var(--good); }
.stat.ks-low b { color: var(--bad); }

.ks-cal { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.ks-cal-t { font-weight: 700; font-size: 0.9rem; }
.ks-cal ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; }
.ks-cal li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; align-items: baseline; padding: 6px 10px; border-radius: 10px; background: var(--paper); font-size: 0.88rem; line-height: 1.35; }
.ks-cal li span:first-child { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ks-cal li b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.ks-cal .ks-plus { color: var(--good); }
.ks-cal .ks-minus { color: var(--bad); }

.ks-mx { font-size: 0.86rem; }
.ks-mx th, .ks-mx td { white-space: normal; padding: 8px 6px; }
.ks-mx td { white-space: nowrap; }
.ks-mx tbody th { min-width: 6em; }
.mx tr.ks-mine th, .mx tr.ks-mine td { background: var(--tint); }
