/* 13-week cash view (Cash Flow Forecast on IQ Books ledgers). House tokens only. */

.cal-hero .liq-hero-chart-card { min-width: 0; display: flex; flex-direction: column; }
.cal-hero .cal-chart { flex: 1; min-height: 320px; }

.cal-banner { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 16px; padding: 12px 16px; border-radius: 10px;
    background: rgba(197, 137, 31, 0.1); border: 1px solid rgba(197, 137, 31, 0.35); color: #5e430d; font-size: 13.5px; line-height: 1.5; }
.cal-banner svg { flex: 0 0 auto; margin-top: 2px; color: #9a6b12; }

.cal-levers, .cal-sheet-card, .cal-dates-card, .cal-basis-card { margin-top: 18px; }
.cal-lever-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 24px; padding: 6px 2px 2px; }
.cal-lever .liq-lever-scale span:nth-child(2) { text-align: center; }
.cal-buffer-input { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-family: var(--liq-font-mono); font-size: 14px; color: var(--liq-text-secondary, #4b5854); }
.cal-buffer-input input { width: 100%; max-width: 180px; padding: 7px 10px; border: 1px solid var(--liq-border, #dfe6e2); border-radius: 8px; font: inherit; color: var(--liq-text, #1a2420); background: #fff; }
.cal-buffer-input input:focus-visible { outline: 2px solid var(--liq-accent, #4a9080); outline-offset: 1px; }
.cal-lever-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 2px 0; margin-top: 10px; border-top: 1px solid var(--liq-border, #dfe6e2); }
.cal-lever-result { font-size: 13px; color: var(--liq-text-secondary, #4b5854); }

/* The treasurer's sheet */
.cal-sheet-wrap { overflow-x: auto; border: 1px solid var(--liq-border, #dfe6e2); border-radius: 8px; }
.cal-sheet { width: 100%; min-width: 1080px; border-collapse: separate; border-spacing: 0; font-size: 12.5px; }
.cal-sheet th, .cal-sheet td { padding: 7px 8px; border-bottom: 1px solid var(--liq-border, #dfe6e2); white-space: nowrap; }
.cal-sheet thead th { position: sticky; top: 0; background: var(--liq-surface, #fff); font-family: var(--liq-font-mono); font-size: 10.5px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--liq-text-muted, #6b7a74); font-weight: 600; }
.cal-sheet tbody th[scope="row"], .cal-sheet thead .cal-corner { position: sticky; left: 0; z-index: 1; background: var(--liq-surface, #fff); text-align: left; font-weight: 500; min-width: 250px; max-width: 290px; white-space: normal; border-right: 1px solid var(--liq-border, #dfe6e2); }
.cal-sheet .num { text-align: right; font-family: var(--liq-font-mono); font-variant-numeric: tabular-nums; }
.cal-sheet .cal-total { background: rgba(31, 92, 77, 0.04); font-weight: 600; border-left: 1px solid var(--liq-border, #dfe6e2); }
.cal-sheet .cal-nil { color: var(--liq-text-muted, #9aa6a1); }
.cal-sheet .cal-group th { background: var(--liq-bg, #f6f8f7); font-family: var(--liq-font-mono); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--liq-text-secondary, #4b5854); text-align: left; padding-top: 10px; }
.cal-sheet .cal-row { cursor: pointer; }
.cal-sheet .cal-row:hover td, .cal-sheet .cal-row:hover th, .cal-sheet .cal-row.is-open td, .cal-sheet .cal-row.is-open th { background: var(--liq-bg, #f6f8f7); }
.cal-sheet .cal-row:focus-visible { outline: 2px solid var(--liq-accent, #4a9080); outline-offset: -2px; }
.cal-sheet .cal-row th::before { content: '\25B8'; display: inline-block; width: 12px; color: var(--liq-text-muted, #6b7a74); transition: transform 0.15s; }
.cal-sheet .cal-row.is-open th::before { transform: rotate(90deg); }
.cal-cat-name { color: var(--liq-text, #1a2420); }
.cal-kind { display: inline-block; margin-left: 4px; font-size: 10px; font-weight: 600; padding: 1px 7px; border-radius: 999px; vertical-align: 1px; white-space: nowrap; }
.cal-kind.expected { background: rgba(31, 92, 77, 0.1); color: #1f5c4d; }
.cal-kind.known { background: rgba(31, 92, 77, 0.18); color: #173f35; }
.cal-kind.rate { background: rgba(197, 137, 31, 0.13); color: #7f5a12; }
.cal-kind.pattern { background: rgba(91, 110, 174, 0.12); color: #3f4f86; }
.cal-kind.typical { background: rgba(107, 122, 116, 0.13); color: #4b5854; }
.cal-sheet .cal-subtotal th, .cal-sheet .cal-subtotal td { font-weight: 600; border-top: 1px solid #c9d3cf; }
.cal-sheet .cal-net th, .cal-sheet .cal-net td { font-weight: 600; background: rgba(31, 92, 77, 0.03); }
.cal-sheet .cal-opening th, .cal-sheet .cal-opening td { color: var(--liq-text-secondary, #4b5854); }
.cal-sheet .cal-closing th, .cal-sheet .cal-closing td { font-weight: 700; font-size: 13px; border-top: 2px solid #4b5854; border-bottom: 3px double #4b5854; }
.cal-sheet .cal-closing td.cal-neg { color: #8a2f25; background: rgba(176, 101, 90, 0.14); }
.cal-sheet .cal-closing td.cal-low { color: #7f5a12; background: rgba(197, 137, 31, 0.12); }
.cal-sheet .cal-range td { font-size: 11px; line-height: 1.35; color: var(--liq-text-muted, #6b7a74); }
.cal-sheet .cal-range th, .cal-sheet .cal-nonew th { color: var(--liq-text-secondary, #4b5854); font-weight: 500; }
.cal-sheet .cal-nonew td { color: #8a4338; font-style: italic; }
.cal-sheet .cal-detail > td { background: var(--liq-bg, #f6f8f7); padding: 6px 14px 12px 22px; white-space: normal; }
.cal-sheet .cal-detail > td > * { position: sticky; left: 22px; }
.cal-detail-text { margin: 4px 0; max-width: 820px; font-size: 13px; line-height: 1.55; color: var(--liq-text-secondary, #4b5854); }
.cal-items { border-collapse: collapse; font-size: 12.5px; min-width: 560px; max-width: 900px; }
.cal-items th { text-align: left; font-family: var(--liq-font-mono); font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--liq-text-muted, #6b7a74); font-weight: 600; padding: 6px 10px; border-bottom: 1px solid var(--liq-border, #dfe6e2); }
.cal-items td { padding: 5px 10px; border-bottom: 1px dashed var(--liq-border, #dfe6e2); white-space: normal; }
.cal-items .num { text-align: right; font-family: var(--liq-font-mono); white-space: nowrap; }

/* Dates to know */
.cal-table-wrap { overflow-x: auto; }
.cal-dates { width: 100%; border-collapse: collapse; font-size: 13px; }
.cal-dates th { text-align: left; font-family: var(--liq-font-mono); font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--liq-text-muted, #6b7a74); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--liq-border, #dfe6e2); }
.cal-dates td { padding: 9px 10px; border-bottom: 1px solid var(--liq-border, #dfe6e2); vertical-align: top; }
.cal-dates td:first-child { white-space: nowrap; font-family: var(--liq-font-mono); font-size: 12px; color: var(--liq-text-secondary, #4b5854); }
.cal-dates .num { text-align: right; font-family: var(--liq-font-mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cal-dates .cal-out { color: #8a4338; }
.cal-dates .cal-in { color: #1f5c4d; }
.cal-dates .cal-more { display: none; }
.cal-show-all .cal-dates .cal-more { display: table-row; }
.cal-show-more { margin: 12px 0 2px; }
.cal-muted { color: var(--liq-text-muted, #6b7a74); font-size: 12px; }

/* How this is built */
.cal-basis { margin: 4px 0 0; padding-left: 18px; font-size: 13.5px; line-height: 1.6; color: var(--liq-text-secondary, #4b5854); }
.cal-basis li { margin: 6px 0; }
.cal-basis strong { color: var(--liq-text, #1a2420); }

.cal-loading, .cal-empty { padding: 36px 18px; text-align: center; color: var(--liq-text-secondary, #4b5854); font-size: 14px; }
.cal-spinner { display: inline-block; width: 14px; height: 14px; margin-right: 10px; vertical-align: -2px; border: 2px solid var(--liq-border, #dfe6e2); border-top-color: var(--liq-accent, #4a9080); border-radius: 50%; animation: cal-spin 0.8s linear infinite; }
@keyframes cal-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .cal-spinner { animation: none; } .cal-sheet .cal-row th::before { transition: none; } }

@media (max-width: 900px) {
    .cal-lever-grid { grid-template-columns: 1fr; }
    .cal-sheet tbody th[scope="row"], .cal-sheet thead .cal-corner { min-width: 170px; }
}

/* The runway, moved into the Overview tab on IQ Books ledgers */
.cf-overview-hero { margin-bottom: 18px; }
