/* CFPilot browser tools (13-week cash flow, rate rise check). Layout: the answer, then the chart, then the blocks you fill in. */
.cf { padding: 28px 0 64px; }
.cf .wrap { max-width: 1040px; display: flex; flex-direction: column; gap: 16px; }
.cf h1 { font: 700 clamp(30px, 5vw, 40px)/1.1 var(--display); margin: 0; }
.cf-top { display: flex; flex-direction: column; gap: 6px; }
.cf-top p, .cf-meta, .cf small { color: var(--muted); font-size: 14px; margin: 0; }
.cf-note { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border: 1px dashed var(--accent); border-radius: 14px; background: var(--surface); font-size: 15px; }
.cf-callout { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; border-radius: 16px; }
.cf-callout strong { font-size: 18px; line-height: 1.3; }
.cf-callout span { font-size: 15px; line-height: 1.45; }
.cf-callout.warn { background: #FFF3D6; color: #5C3A00; }
.cf-callout.good { background: #DDF7F1; color: #0A5247; }
.cf-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.cf-card > header { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 12px; }
.cf-card h2 { font: 600 17px/1.3 var(--body); margin: 0; }
.cf-chart { position: relative; display: flex; gap: 5px; }
.cf-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cf-col span { font-size: 11px; color: var(--muted); text-align: center; padding-top: 4px; }
.cf-up { display: flex; align-items: flex-end; border-bottom: 1px solid var(--fg); }
.cf-up i, .cf-down i { display: block; width: 100%; }
.cf-up i { border-radius: 4px 4px 0 0; } .cf-down i { border-radius: 0 0 4px 4px; }
.cf i.ok { background: var(--accent); } .cf i.below { background: var(--gold); } .cf i.overdrawn { background: #D2483D; }
.cf-buffer { position: absolute; left: 0; right: 0; border-top: 2px dashed var(--gold); pointer-events: none; }
.cf-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--muted); }
.cf-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cf-legend i { width: 10px; height: 10px; border-radius: 2px; }
.cf-legend i.line { width: 16px; height: 0; border-top: 2px dashed var(--gold); border-radius: 0; }
.cf-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.cf-stat { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cf-stat span { font-size: 12px; color: var(--muted); }
.cf-stat b { font: 700 clamp(18px, 4.6vw, 24px)/1.2 var(--display); font-variant-numeric: tabular-nums; }
.cf-stat b.bad, .cf td.neg { color: #C2362B; }
.cf-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 16px; align-items: start; }
.cf-fields { display: flex; flex-direction: column; }
.cf-fields label { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; border-top: 1px solid var(--sunk); font-size: 15px; }
.cf input[type="text"], .cf input[type="email"], .cf input[type="number"], .cf input[type="date"], .cf select, .cf textarea { font: inherit; font-size: 16px; color: var(--fg); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; min-height: 44px; padding: 6px 10px; box-sizing: border-box; }
.cf-fields input:not([type="checkbox"]) { width: 160px; text-align: right; font-weight: 600; }
.cf input[type="checkbox"] { width: 22px; height: 22px; accent-color: var(--accent); }
.cf-list { list-style: none; margin: 0; padding: 0; }
.cf-row { width: 100%; min-height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; background: none; border: 0; border-top: 1px solid var(--sunk); color: var(--fg); font: inherit; text-align: left; cursor: pointer; }
.cf-row span { display: flex; flex-direction: column; min-width: 0; }
.cf-row b { font-weight: 500; font-size: 15px; overflow-wrap: anywhere; }
.cf-row strong { font-variant-numeric: tabular-nums; white-space: nowrap; }
.cf-row:hover b { color: var(--accent); }
.cf-empty { color: var(--muted); font-size: 14px; padding: 12px 0; border-top: 1px solid var(--sunk); }
.cf-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.cf-btn { flex: 1 1 auto; min-height: 44px; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); font: 600 14px/1.2 var(--body); cursor: pointer; }
.cf-btn.paste { flex-basis: 100%; border: 1.5px dashed var(--accent); color: var(--accent); min-height: 48px; }
.cf-btn.dark { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.cf-btn.danger { color: #C2362B; }
.cf-btn:focus-visible, .cf-row:focus-visible, .cf input:focus-visible, .cf select:focus-visible, .cf textarea:focus-visible { outline: 3px solid var(--accent-b); outline-offset: 2px; }
.cf-range { display: flex; flex-direction: column; gap: 8px; font-size: 15px; }
.cf-range span { display: flex; justify-content: space-between; }
.cf-range input { width: 100%; min-height: 32px; accent-color: var(--accent); }
.cf-scroll { overflow-x: auto; }
.cf table { border-collapse: collapse; width: 100%; font-size: 14px; font-variant-numeric: tabular-nums; }
.cf th, .cf td { padding: 8px 10px; text-align: right; white-space: nowrap; border-top: 1px solid var(--sunk); font-weight: 400; }
.cf thead th { color: var(--muted); border-top: 0; }
.cf th:first-child { text-align: left; padding-left: 0; position: sticky; left: 0; background: var(--surface); }
.cf tr.sum th, .cf tr.sum td { font-weight: 600; }
.cf tr.strong td, .cf tr.strong th { border-top: 2px solid var(--fg); }
.cf-pill { font-style: normal; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 99px; }
.cf-pill.ok { background: #DDF7F1; color: #0B6B5C; } .cf-pill.below { background: #FFF3D6; color: #6B4400; } .cf-pill.overdrawn { background: #FBDAD6; color: #8C1D14; }
.cf-leftout { margin: 0; padding: 12px 16px 12px 32px; border-radius: 14px; background: var(--surface); border: 1px solid var(--gold); font-size: 14px; }
.cf-status { min-height: 20px; font-size: 14px; color: var(--muted); margin: 0; }
.cf dialog { width: min(440px, calc(100vw - 32px)); border: 1px solid var(--line); border-radius: 18px; padding: 20px; background: var(--surface); color: var(--fg); }
.cf dialog::backdrop { background: rgba(6, 17, 39, .55); }
.cf dialog h2 { font: 700 22px/1.2 var(--display); margin: 0 0 12px; }
.cf dialog form { display: flex; flex-direction: column; gap: 12px; }
.cf dialog label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--muted); }
.cf dialog label.cf-check { flex-direction: row; align-items: center; gap: 10px; color: var(--fg); font-size: 15px; min-height: 44px; }
.cf dialog textarea { min-height: 150px; font-size: 14px; }
.cf dialog p { margin: 0; font-size: 15px; color: var(--muted); }
@media (min-width: 900px) { .cf-up, .cf-down { } .cf-chart { gap: 10px; } }
.cf-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.cf-step { min-height: 64px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--fg); font: inherit; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 6px; }
.cf-step b { font: 700 18px/1.1 var(--display); } .cf-step small { font-size: 12px; }
.cf-step[aria-pressed="true"] { border: 2px solid var(--accent); background: var(--sunk); }
.cf-step:focus-visible { outline: 3px solid var(--accent-b); outline-offset: 2px; }
.cf-link { color: var(--accent); font-weight: 600; }
.cf table.fit { font-size: 13px; }
.cf table.fit th, .cf table.fit td { white-space: normal; padding: 8px 6px; vertical-align: top; }
.cf table.fit th:first-child { padding-left: 0; }
.cf-fields select { width: 160px; }
.cf [hidden] { display: none !important; }
.cf-scn { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; padding: 10px 0; border-top: 1px solid var(--sunk); }
.cf-scn > span:first-child { display: flex; flex-direction: column; min-width: 0; }
.cf-scn .cf-btn { flex: 0 0 auto; }
.cf input:disabled { opacity: .45; }
.cf-plan { display: flex; align-items: flex-start; gap: 10px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); font-size: 14px; line-height: 1.45; }
.cf-plan b { flex: 0 0 auto; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 99px; background: var(--sunk); color: var(--fg); white-space: nowrap; }
.cf-plan.on { border-color: var(--accent); }
.cf-plan.on b { background: var(--accent); color: #fff; }
.cf-lock { opacity: .6; }
.cf-top p.cf-who { font-weight: 600; color: var(--fg); }

/* value on each bar, the period switch, and a week table that fits a desktop page */
.cf-up { position: relative; }
.cf-up b { position: absolute; left: -6px; right: -6px; top: 0; text-align: center; font: 600 10px/14px var(--body, inherit); font-variant-numeric: tabular-nums; color: var(--muted); white-space: nowrap; overflow: hidden; }
.cf-up b.neg { color: #C2362B; }
.cf-seg { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 14px; }
.cf-seg button { font: inherit; font-size: 14px; font-weight: 600; padding: 8px 14px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); cursor: pointer; }
.cf-seg button[aria-pressed="true"] { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.cf-seg button:focus-visible { outline: 3px solid var(--accent-b); outline-offset: 2px; }
@media (min-width: 900px) { .cf th, .cf td { padding: 8px 6px; font-size: 13px; } .cf-up b { font-size: 11px; } }
@media (min-width: 900px) { .cf #table th, .cf #table td { padding: 8px 4px; font-size: 12.5px; } }
.cf-col span { line-height: 1.25; }
.cf-col.many { min-width: 0; } .cf-col.many .cf-up b { display: none; } .cf-col.many span { font-size: 9px; }
.cf-chart:has(.cf-col.many) { gap: 2px; }
@media (max-width: 700px) { .cf-col.many span { visibility: hidden; } .cf-col.many:nth-child(6n+1) span { visibility: visible; overflow: visible; white-space: nowrap; } }
@media (max-width: 700px) { .cf-up b { display: none; } .cf-col.key .cf-up b { display: block; left: -14px; right: -14px; } .cf-col.many.key .cf-up b { display: none; } }

/* weekly roll forward, BAS set-aside, and the printed report */
.cf-bas { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.cf-bas .cf-stat small { display: block; margin-top: 6px; font-size: 13px; color: var(--muted); }
.cf-bas .cf-stat small b { font-size: inherit; color: var(--ink, inherit); }
.cf-check { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; cursor: pointer; }
.cf-check input { width: 22px; height: 22px; margin-top: 2px; flex: none; }
.cf-check small { display: block; color: var(--muted); font-size: 13px; }
.cf-print-head { display: none; }
@media print {
  .site-head, footer, #planBar, #exampleBar, .cf-top, .cf-grid, #bkCard, #status, #leftOut, .cf-btns, .cf-seg, .cf-fields, dialog, #basFields, #ifBar, section[aria-labelledby="moreTitle"], #scnCard, #outNote, .ws-main > p.cf-meta, .cf > .wrap > p.cf-meta { display: none !important; }
  body, .cf { background: #fff !important; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .ws-menu, .ws-title { display: none !important; } .ws-shell { display: block; }
  .cf-print-head { display: block; margin-bottom: 8px; } .cf-print-head h1 { margin: 0 0 4px; font-size: 24px; } .cf-print-head p { margin: 0; font-size: 12px; color: #444; }
  .cf-card, .cf-callout, .cf-stat { break-inside: avoid; box-shadow: none !important; }
  .cf .wrap { max-width: none; gap: 10px; } .cf-scroll { overflow: visible; }
  .cf th, .cf td { padding: 4px 3px; font-size: 9.5px; } .cf th:first-child { position: static; }
  @page { size: A4 landscape; margin: 12mm; }
}

/* the workspace: a menu beside the page on a computer, a strip of links on a phone */
.ws-shell { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; align-items: start; }
.ws-menu { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 10px; }
.ws-menu a { padding: 9px 12px; border-radius: 10px; text-decoration: none; color: inherit; font-size: 15px; }
.ws-menu a:hover, .ws-menu a.on { background: var(--line); font-weight: 600; }
.ws-sep { padding: 12px 12px 4px; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.cf.ws .wrap { max-width: 1280px; }
.ws-title { margin: 4px 0 0; font-size: 20px; }
@media screen { .ws-off { display: none !important; } }
.ws-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.ws-tools { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: 10px; }
.ws-tool { display: flex; flex-direction: column; gap: 4px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; text-decoration: none; color: inherit; }
.ws-tool:hover { border-color: currentColor; } .ws-tool span { font-size: 14px; color: var(--muted); }
a.cf-row { text-decoration: none; color: inherit; }
@media (max-width: 860px) {
  .ws-shell { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .ws-menu { position: static; flex-direction: row; overflow-x: auto; padding: 6px; border-radius: 12px; } .ws-menu a { white-space: nowrap; padding: 8px 12px; } .ws-sep { display: none; }
  #tiles.cf-stats { grid-template-columns: minmax(0, 1fr); }
  .ws .cf-stats { gap: 8px; } .ws .cf-stat { padding: 12px 10px; } .ws .cf-stat b { font-size: 20px; } .ws .cf-stat span { font-size: 12px; }
}

.ws-new .cf-row strong { font-weight: 500; color: var(--muted); font-size: 13px; }
.cf-row small { color: var(--muted); font-size: 13.5px; }

/* comparing saved versions: narrow columns so three fit on a phone without scrolling */
.cf #scnTable { min-width: 0; width: 100%; }
.cf #scnTable th, .cf #scnTable td { padding: 9px 4px; font-size: 12.5px; white-space: normal; vertical-align: top; }
.cf #scnTable thead th { font-weight: 700; color: inherit; text-align: right; }
.cf #scnTable th:first-child { width: 28%; min-width: 80px; }
.cf #scnTable td { min-width: 66px; }
.cf #scnTable tbody tr:last-child td { font-size: 12px; color: var(--muted); }

/* cards that fold: the heading stays, the body goes */
.ws-foldhead { cursor: pointer; position: relative; padding-right: 34px; }
.ws-fold { position: absolute; right: 0; top: 50%; width: 30px; height: 30px; margin-top: -15px; border: 0; background: none; border-radius: 8px; cursor: pointer; color: inherit; }
.ws-fold::before { content: ""; position: absolute; left: 10px; top: 8px; width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-135deg); transition: transform .15s; opacity: .6; }
.cf-card.closed .ws-fold::before { transform: rotate(45deg); top: 6px; }
@media screen { .cf-card.closed > :not(header) { display: none !important; } .cf-card.closed > header { margin-bottom: 0; padding-bottom: 0; border-bottom: 0; } }
@media print { .ws-fold { display: none; } }

/* actions under a row in Who to chase */
.cf-acts { display: flex; gap: 8px; padding: 0 0 12px; } .cf-acts .cf-btn { flex: 1 1 0; min-height: 38px; padding: 6px 10px; font-size: 14px; }
#remText { width: 100%; font: inherit; line-height: 1.45; }

/* the first-run guide */
.cf dialog.cf-guide { width: min(520px, calc(100vw - 24px)); }
.cf-guide h2 { margin: 2px 0 8px; } .cf-guide [data-step] { display: flex; flex-direction: column; gap: 10px; } .cf-guide [data-step][hidden] { display: none; }
.cf-ghead, .cf-grow { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1.25fr); gap: 6px; align-items: center; }
.cf-ghead { font-size: 12.5px; color: var(--muted); margin-top: 4px; } .cf-grow.two > span { font-size: 14.5px; }
.cf-grow input, .cf-grow select { min-width: 0; width: 100%; }
.cf-grow.two { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) minmax(0, 1.4fr); } .cf-grow select { padding-left: 8px; padding-right: 4px; font-size: 14px; }
.cf-linkbtn { border: 0; background: none; color: inherit; font: inherit; font-size: 14px; text-decoration: underline; cursor: pointer; padding: 6px; }

/* feedback */
#fbDlg textarea, #fbDlg input[type=email] { width: 100%; font: inherit; }
#fbDlg .cf-seg { margin: 4px 0 10px; } #fbDlg .cf-seg button[aria-pressed="true"] { background: var(--fg); color: var(--surface); }
@media print { #askBar, #staleBar { display: none !important; } }

.ws-back { align-self: flex-start; font-size: 14px; color: var(--muted); text-decoration: none; padding: 2px 0; } .ws-back:hover { text-decoration: underline; }
@media print { .ws-back { display: none; } }

/* landing on a card from a link: leave room for the header that stays at the top */
.cf-card, .cf-card h2 { scroll-margin-top: 92px; }

.cf-ghead.g4, .cf-grow.g4 { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1.15fr) minmax(0, 1.15fr) minmax(0, .8fr); }
.cf-grow[hidden] { display: none; }
@media (max-width: 480px) { .cf-ghead.g4 { display: none; } .cf-grow.g4 { grid-template-columns: 1fr 1fr; padding-top: 8px; border-top: 1px solid var(--sunk); } }

/* the inputs view: three numbered steps */
.ws-lead { margin: 0; font-size: 15.5px; color: var(--muted); }
.ws-step { display: flex; align-items: center; gap: 10px; margin: 10px 0 0; font-size: 18px; }
.ws-step span { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--fg); color: var(--surface); display: grid; place-items: center; font-size: 14px; font-weight: 700; }
.cf-grid > .ws-step.wide { grid-column: 1 / -1; }
.ws-steps { display: flex; flex-direction: column; gap: 6px; }

.cf-plan[hidden], .cf-note[hidden] { display: none !important; }
.cf-top.own .cf-who { display: none; }
@media (max-width: 860px) { .cf-top.own h1 { font-size: 22px; margin: 0; } .cf-top.own #range { font-size: 13px; margin: 2px 0 0; } }

.cf-grid > .cf-note.wide { grid-column: 1 / -1; }
/* Accounting connection: what will be read, and what changed since last time */
.cf-xlist { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; }
dialog .cf-xlist label, dialog .cf-xup label.pick { display: flex; flex-direction: row; gap: 10px; align-items: flex-start; font-weight: 400; font-size: 15px; margin: 0; }
dialog .cf-xlist input, dialog .cf-xup label.pick input { width: auto; min-width: 20px; height: 20px; margin: 3px 0 0; flex: 0 0 auto; }
.cf-xup h3 { font-size: 15px; margin: 14px 0 4px; }
.cf-xup ul { list-style: none; margin: 0; padding: 0; max-height: 26vh; overflow: auto; border: 1px solid var(--line, #d9dee5); border-radius: 10px; }
.cf-xup li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 10px; font-size: 14px; border-top: 1px solid var(--line, #d9dee5); }
.cf-xup li:first-child { border-top: 0; }
.cf-xup li span:last-child { white-space: nowrap; font-variant-numeric: tabular-nums; }
.cf-xup .none { color: var(--muted, #5b6573); font-size: 14px; margin: 4px 0; }
.cf-xup label.pick { margin-top: 12px !important; }
/* Something the forecast cannot do without is still missing */
.cf-need { margin: 10px 0 0; padding: 10px 12px; border-radius: 10px; background: #FFF3D6; color: #5C3A00; font-size: 14.5px; line-height: 1.45; }
.cf-need[hidden] { display: none; }
.cf input.cf-miss { border-color: #C77700; box-shadow: 0 0 0 2px rgba(199,119,0,.25); }
.cf-neg { color: #C2362B; font-weight: 600; white-space: nowrap; }
/* What the connection brings in, and what still has to be typed */
.cf-two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 12px; font-size: 14px; }
.cf-two > div { border: 1px solid var(--line, #d9dee5); border-radius: 10px; padding: 10px 12px; }
.cf-two > div:last-child { background: #FFF3D6; color: #5C3A00; border-color: transparent; }
.cf-two ul { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 3px; }
.cf-src { font-size: 14px; color: var(--muted, #5b6573); }
/* Pricing page: two plans side by side, and a tick table */
.cf-plans { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cf-planbox { border: 1px solid var(--line, #d9dee5); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 6px; }
.cf-planbox.pick { border: 2px solid var(--accent); }
.cf-planbox h3 { margin: 0; font-size: 16px; }
.cf-planbox p { margin: 0; font-size: 14.5px; line-height: 1.45; }
.cf-planbox .price { font-size: 15px; } .cf-planbox .price b { font-size: 26px; }
.cf-planbox .cf-btn { margin-top: auto; width: 100%; }
@media (max-width: 520px) { .cf-plans { grid-template-columns: 1fr; } }
.cf table.cf-ticks th[scope=row] { text-align: left; font-weight: 400; }
.cf table.cf-ticks td, .cf table.cf-ticks thead th { text-align: center; width: 20%; }
.cf table.cf-ticks thead th:first-child { width: 40%; }
.cf table.cf-ticks td.y { color: #0B6B5C; font-weight: 700; font-size: 16px; }
.cf table.cf-ticks td.n { color: var(--muted, #8a93a0); }
