/* ==========================================================================
   Wayfinder Partners — Cash Confidence Planner (page styles)
   Extends css/site.css. Journey accent: Cash = --j-cash (cyan).
   Brand cyan #08CCFC fails text contrast on white, so text/labels use
   --accent-ink (#066E99, 5.7:1 on white); pure cyan stays decorative.
   Grid-first worksheet UX (client decision 2026-07-30): the 13-week grid is
   the primary surface, live KPIs sit under it, and the contact gate unlocks
   the full report. Dense financial data always sits on light surfaces.
   ========================================================================== */

.cp-page { --accent: var(--j-cash); --accent-ink: #066E99; }

.cp-app [hidden] { display: none !important; }

/* ---------- Compact dark hero ---------- */
.cp-hero {
  position: relative;
  background: var(--navy-2);
  color: #fff;
  overflow: hidden;
}
.cp-hero__bg {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center 62%;
  opacity: .26;
}
.cp-hero__bg::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(8,15,30,.6) 0%, rgba(8,15,30,.35) 45%, #080F1E 100%);
}
.cp-hero .container {
  position: relative;
  max-width: var(--w-narrow);
  text-align: center;
  padding-top: calc(var(--header-h) + clamp(44px, 6vw, 72px));
  padding-bottom: clamp(40px, 5vw, 64px);
}
.cp-hero .eyebrow { justify-content: center; color: var(--dark-faint); }
.cp-hero .rule { margin-left: auto; margin-right: auto; }
.cp-hero .lede { margin-left: auto; margin-right: auto; }
.cp-hero__facts {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px 36px;
  margin-top: 30px;
  padding-top: 22px;
  border-top: 1px solid var(--line-dark);
  font-size: 13.5px;
  color: var(--dark-faint);
}
.cp-hero__facts strong {
  display: block;
  font-family: var(--font-display);
  font-size: 16.5px; font-weight: 600;
  color: #fff;
}
.cp-hero__note {
  margin-top: 22px;
  font-size: 13.5px;
  color: var(--dark-faint);
}
.cp-hero__start { margin-top: clamp(30px, 4vw, 44px); }
.cp-start {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.cp-start__label {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: #fff;
  transition: color .2s;
}
.cp-start__circle {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,.38);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color .22s var(--ease-out), color .22s, transform .22s var(--ease-out);
}
.cp-start__circle svg { animation: cpStartBob 2.6s ease-in-out infinite; }
.cp-start:hover .cp-start__label,
.cp-start:focus-visible .cp-start__label { color: var(--cyan); }
.cp-start:hover .cp-start__circle,
.cp-start:focus-visible .cp-start__circle {
  border-color: var(--cyan);
  color: var(--cyan);
  transform: translateY(3px);
}
@keyframes cpStartBob {
  0%, 100% { transform: translateY(-2px); }
  50%      { transform: translateY(3px); }
}
@media (prefers-reduced-motion: reduce) {
  .cp-start__circle svg { animation: none; }
  .cp-start:hover .cp-start__circle { transform: none; }
}

/* ---------- App shell ---------- */
.cp-shell { background: var(--mist); scroll-margin-top: calc(var(--header-h) + 16px); }
.cp-shell .container { max-width: 1420px; }
.cp-app {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: clamp(20px, 3vw, 36px);
}
.cp-app__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 20px;
}
.cp-app__title {
  font-size: 12px; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent-ink);
}
.cp-restart {
  font-size: 13.5px;
  color: var(--ink-faint);
  padding: 6px;
  text-align: right;
}
.cp-restart:hover { color: #C0392B; text-decoration: underline; }

/* ---------- Setup strip ---------- */
.cp-setup {
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) minmax(150px, 1fr) minmax(140px, 1fr) minmax(140px, 1fr);
  gap: 12px 14px;
  margin-bottom: 10px;
}
@media (max-width: 900px) { .cp-setup { grid-template-columns: 1fr 1fr; } }
@media (max-width: 540px) { .cp-setup { grid-template-columns: 1fr; } }
.cp-field label {
  display: block;
  font-size: 12.5px; font-weight: 700;
  margin-bottom: 6px;
}
.cp-field .hint { font-weight: 500; color: var(--ink-faint); }
.cp-input, .cp-select {
  width: 100%;
  font: inherit;
  font-size: 15.5px;
  padding: 11px 13px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: var(--mist);
  color: var(--ink);
  transition: border-color .16s, background .16s;
}
.cp-input:focus, .cp-select:focus { outline: none; border-color: var(--accent-ink); background: #fff; }
.cp-input[aria-invalid="true"] { border-color: #C0392B; }
.cp-select { appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236B7A94' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  padding-right: 38px;
}
input[type="date"].cp-input { min-height: 46px; }
.cp-money { position: relative; }
.cp-money .cur {
  position: absolute;
  left: 13px; top: 50%;
  transform: translateY(-50%);
  color: var(--ink-faint);
  font-weight: 600;
  pointer-events: none;
}
.cp-money .cp-input { padding-left: 30px; }
.cp-setup-note {
  font-size: 12.5px;
  color: var(--ink-faint);
  margin: 2px 0 18px;
}
/* Two-column field layout used by the guided setup and small forms */
.cp-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
@media (max-width: 560px) { .cp-grid-2 { grid-template-columns: 1fr; } }
.cp-setup-note strong { color: var(--ink); }
.cp-error {
  display: flex; gap: 8px;
  font-size: 13.5px; font-weight: 600;
  color: #C0392B;
  margin-top: 6px;
}
.cp-warn {
  display: flex; gap: 10px;
  align-items: flex-start;
  font-size: 14px;
  color: #8A5A00;
  background: rgba(232,163,61,.12);
  border-left: 3px solid #E8A33D;
  border-radius: 0 8px 8px 0;
  padding: 11px 15px;
  margin: 10px 0 14px;
  max-width: 720px;
}

/* ---------- Guided setup (intake) ---------- */
.cp-intake { max-width: 720px; margin: 0 auto; }
.cp-intake__meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.cp-intake__dots { display: inline-flex; gap: 6px; }
.cp-intake__dots i {
  width: 22px; height: 5px;
  border-radius: 3px;
  background: var(--line);
}
.cp-intake__dots i.on { background: var(--grad); }
.cp-intake__dots i.past { background: var(--accent-ink); opacity: .45; }
.cp-intake__count { font-size: 12.5px; font-weight: 600; color: var(--ink-faint); }
.cp-intake h2 { font-size: clamp(21px, 2.6vw, 26px); letter-spacing: -0.015em; margin-bottom: 10px; }
.cp-intake .cp-support { font-size: 15.5px; color: var(--ink-soft); max-width: 620px; margin-bottom: 22px; }

.cp-checklist { display: grid; gap: 8px; }
.cp-check {
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 4px 14px;
  transition: border-color .15s, background .15s;
}
.cp-check.is-on { border-color: var(--accent-ink); background: color-mix(in srgb, var(--cyan) 4%, #fff); }
.cp-check__main {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 0;
  cursor: pointer;
}
.cp-check__main input[type="checkbox"] {
  width: 18px; height: 18px;
  accent-color: var(--accent-ink);
  flex: none;
}
.cp-check__name { font-size: 15px; font-weight: 600; }
.cp-check__name .hint { font-weight: 500; font-size: 13.5px; color: var(--ink-faint); }
.cp-check__opts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 2px 0 12px 29px;
}
.cp-check__opts .cp-select {
  width: auto;
  font-size: 13.5px;
  padding: 8px 32px 8px 11px;
  background-color: #fff;
}
.cp-check__opts .cp-money { position: relative; }
.cp-check__opts .cp-input {
  width: 230px;
  font-size: 13.5px;
  padding: 8px 11px 8px 26px;
  background-color: #fff;
}
.cp-check__opts .cur { left: 11px; font-size: 13px; }
@media (max-width: 560px) {
  .cp-check__opts { padding-left: 0; }
  .cp-check__opts .cp-input { width: 100%; }
}
.cp-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.cp-controls .btn { padding: 15px 26px; }
.cp-back {
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 6px;
}
.cp-back:hover { color: var(--ink); }

/* ---------- The worksheet grid ---------- */
.cp-gridbar {
  display: flex;
  justify-content: flex-end;
  margin: 0 0 10px;
}
.cp-expand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-ink);
  border: 1.5px solid var(--line);
  border-radius: 8px;
  padding: 8px 14px;
}
.cp-expand:hover { background: var(--mist); border-color: var(--accent-ink); }

/* Full-screen worksheet mode: the grid becomes a fixed overlay. A CSS overlay
   (not the Fullscreen API) so it works everywhere, including iOS Safari.
   z-index sits above the fixed site header (z 100); the doubled class beats
   the base .cp-gridwrap max-height at equal cascade position. */
body.cp-fs { overflow: hidden; }
.cp-gridwrap.cp-gridwrap--fs {
  position: fixed;
  inset: 0;
  z-index: 300;
  max-height: none;
  height: 100dvh;
  border-radius: 0;
  border: none;
  background: #fff;
  padding-top: 54px; /* room for the exit bar */
}
.cp-fs-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 301;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 9px 18px;
  background: var(--navy-2);
  color: #fff;
}
.cp-fs-bar .t {
  font-size: 12px; font-weight: 700;
  letter-spacing: .13em; text-transform: uppercase;
  color: var(--dark-faint);
}
.cp-fs-bar button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 13.5px;
  font-weight: 600;
  color: #fff;
  border: 1.5px solid var(--line-dark);
  border-radius: 8px;
  padding: 7px 14px;
}
.cp-fs-bar button:hover { border-color: var(--cyan); color: var(--cyan); }
@media (max-width: 620px) {
  .cp-fs-bar .t { display: none; } /* keep the bar one line; the exit button is what matters */
  .cp-fs-bar { justify-content: flex-end; }
}

.cp-gridwrap {
  overflow: auto;
  max-height: min(74vh, 860px);
  border: 1px solid var(--line);
  border-radius: 12px;
  overscroll-behavior-x: contain;
}
table.cp-grid {
  border-collapse: separate;
  border-spacing: 0;
  width: max-content;
  min-width: 100%;
  font-size: 13px;
}
.cp-grid th, .cp-grid td {
  border-bottom: 1px solid var(--line);
  padding: 0;
  white-space: nowrap;
}
.cp-grid td { border-left: 1px solid #EEF3F8; }
.cp-grid td:first-child, .cp-grid th:first-child { border-left: none; }

/* Sticky header + sticky label column */
.cp-grid thead th {
  position: sticky; top: 0;
  z-index: 3;
  background: var(--navy);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .05em;
  padding: 9px 10px;
  text-align: right;
  border-bottom: none;
}
.cp-grid thead th:first-child {
  left: 0;
  z-index: 4;
  text-align: left;
  min-width: 200px;
}
/* The Total column stays pinned right so the horizontal scroll never hides it */
.cp-grid thead th:last-child,
.cp-grid td.rowtotal,
.cp-grid td.calc[data-calc$="-total"] {
  position: sticky;
  right: 0;
  z-index: 1;
  box-shadow: -6px 0 8px -6px rgba(10, 25, 49, .18);
}
.cp-grid thead th:last-child { z-index: 3; }
.cp-grid tr.endrow td.calc[data-calc$="-total"] { bottom: 0; z-index: 2; }
.cp-grid thead th .whdate {
  display: block;
  font-weight: 500;
  color: var(--dark-faint);
  letter-spacing: .02em;
}
.cp-grid tbody th,
.cp-grid td.rowlabel {
  position: sticky; left: 0;
  z-index: 2;
  background: #fff;
  text-align: left;
  font-weight: 500;
}

/* Section divider rows */
.cp-grid tr.sec th {
  background: var(--mist);
  color: var(--ink-faint);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: 8px 12px;
}
.cp-grid tr.sec th:first-child { z-index: 2; }
.cp-grid tr.sec td { background: var(--mist); }

/* Row label cell: editable label + hover actions */
.cp-rowlabel {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 6px 0 12px;
  min-width: 200px;
  max-width: 224px;
}
.cp-rowlabel input {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  border: none;
  background: none;
  padding: 9px 4px;
  border-radius: 6px;
  text-overflow: ellipsis;
}
.cp-rowlabel input:hover { background: var(--mist); }
.cp-rowlabel input:focus { outline: none; background: var(--mist); box-shadow: inset 0 0 0 1.5px var(--accent-ink); }
.cp-rowact {
  display: flex;
  gap: 1px;
  opacity: 0;
  transition: opacity .14s;
}
.cp-rowlabel:hover .cp-rowact,
.cp-grid tr:focus-within .cp-rowact { opacity: 1; }
/* Touch screens have no hover: keep the row actions visible */
@media (hover: none) { .cp-rowact { opacity: 1; } }
.cp-rowact button {
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px;
  color: var(--ink-faint);
}
.cp-rowact button:hover { background: var(--mist); color: var(--accent-ink); }
.cp-rowact button.danger:hover, .cp-rowact button[data-armed="1"] { color: #C0392B; background: rgba(192,57,43,.08); }

/* Value cells */
.cp-cell {
  width: 78px;
  min-width: 78px;
}
/* Small screens: slimmer pinned label column so week cells keep real space */
@media (max-width: 700px) {
  .cp-grid thead th:first-child { min-width: 132px; }
  .cp-rowlabel { min-width: 132px; max-width: 148px; padding-left: 8px; }
  .cp-rowlabel input { font-size: 12px; }
  .cp-grid tbody th, .cp-grid td.rowlabel { font-size: 12px; }
}
.cp-cell input {
  width: 100%;
  font: inherit;
  font-size: 13px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  border: none;
  background: none;
  color: var(--ink);
  padding: 9px 10px;
}
.cp-cell input::placeholder { color: #C3CEDC; }
.cp-cell input:hover { background: var(--mist); }
.cp-cell input:focus { outline: none; background: #fff; box-shadow: inset 0 0 0 1.8px var(--accent-ink); position: relative; }
.cp-cell input[aria-invalid="true"] { box-shadow: inset 0 0 0 1.8px #C0392B; background: rgba(192,57,43,.05); }

/* Calculated cells & rows */
.cp-grid td.calc {
  text-align: right;
  font-variant-numeric: tabular-nums;
  padding: 9px 10px;
  color: var(--ink-soft);
  background: #EFF4F9; /* clearly distinct from editable white cells */
}
.cp-grid tr.calcrow th, .cp-grid tr.calcrow td.rowlabel { font-weight: 700; }
.cp-grid tr.calcrow td.calc { font-weight: 600; background: var(--mist); color: var(--ink); }
.cp-grid tr.subtot td.calc { background: #EFF4F9; font-weight: 600; }
.cp-grid td.rowtotal { background: #EFF4F9; font-weight: 600; color: var(--ink); text-align: right; padding: 9px 10px; font-variant-numeric: tabular-nums; }

/* The ending row: pinned to the bottom of the scroll area, always visible */
.cp-grid tr.endrow th, .cp-grid tr.endrow td {
  position: sticky; bottom: 0;
  background: var(--navy);
  color: #fff;
  border-bottom: none;
  z-index: 2;
}
.cp-grid tr.endrow th:first-child, .cp-grid tr.endrow td.rowlabel {
  z-index: 3;
  background: var(--navy);
  color: #fff;
  font-weight: 700;
  padding: 10px 12px;
}
.cp-grid tr.endrow td.calc { background: var(--navy); color: #fff; font-weight: 700; }
.cp-grid tr.endrow td.calc.risk-low { color: #FFC96B; }
.cp-grid tr.endrow td.calc.risk-neg { color: #FF8A7A; }

/* Risk tints for calculated cells in light rows */
.cp-grid td.calc.risk-low { color: #8A5A00; background: rgba(232,163,61,.14); font-weight: 700; }
.cp-grid td.calc.risk-neg { color: #C0392B; background: rgba(192,57,43,.10); font-weight: 700; }
.cp-grid td.calc.pos { color: #056B62; }
.cp-grid td.calc.neg { color: #C0392B; }

/* Net cash flow row: green highlight for positive weeks, red for negative */
.cp-grid td.calc[data-calc^="net"].pos { background: #E3F4EC; color: #0B6B4F; font-weight: 700; }
.cp-grid td.calc[data-calc^="net"].neg { background: #FBE9E7; color: #B03A2E; font-weight: 700; }

/* Add-row control row */
.cp-grid tr.addrow td {
  background: #fff;
  padding: 7px 12px;
  border-bottom: none;
}
.cp-addrow {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  position: sticky; /* stays visible while the grid scrolls horizontally */
  left: 12px;
}
.cp-addrow .cp-select {
  width: auto;
  font-size: 13px;
  padding: 7px 32px 7px 10px;
  background-color: #fff;
}
.cp-addrow button {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-ink);
  padding: 7px 10px;
  border-radius: 8px;
  border: 1.5px solid var(--line);
}
.cp-addrow button:hover { background: var(--mist); border-color: var(--accent-ink); }

/* Fill-across editor row */
.cp-grid tr.fillrow > td {
  background: #F2FBFE;
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
}
.cp-fill {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-size: 13px;
  color: var(--ink-soft);
  position: sticky; /* stays visible while the grid scrolls horizontally */
  left: 12px;
  max-width: min(920px, calc(100vw - 80px));
}
.cp-fill .cp-input, .cp-fill .cp-select {
  width: auto;
  font-size: 13.5px;
  padding: 8px 10px;
  background-color: #fff;
}
.cp-fill .cp-select { padding-right: 34px; }
.cp-fill .cp-money .cp-input { padding-left: 28px; width: 110px; }
.cp-fill-apply {
  font-family: var(--font-display);
  font-size: 13px; font-weight: 600;
  color: #fff;
  background: var(--navy);
  border-radius: 8px;
  padding: 8px 14px;
}
.cp-fill-apply:hover { background: #14304f; }
.cp-fill-cancel { color: var(--ink-faint); font-size: 13px; padding: 6px 8px; }
.cp-fill-cancel:hover { color: var(--ink); }

/* Grid footnotes / legend */
.cp-gridfoot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  font-size: 12.5px;
  color: var(--ink-faint);
  margin-top: 10px;
}
.cp-gridfoot i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* ---------- Live KPI dashboard ---------- */
.cp-kpis { margin-top: 28px; }
.cp-sec-label {
  font-size: 12.5px;
  font-family: var(--font-body);
  font-weight: 700;
  letter-spacing: .13em; text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 14px;
}
.cp-stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
@media (max-width: 1000px) { .cp-stats { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px) { .cp-stats { grid-template-columns: repeat(2, 1fr); } }
.cp-stat {
  background: var(--mist);
  border-radius: 12px;
  padding: 15px 16px 13px;
}
.cp-stat .k { font-size: 12px; font-weight: 600; color: var(--ink-faint); margin-bottom: 5px; line-height: 1.35; }
.cp-stat .v { font-family: var(--font-display); font-weight: 700; font-size: clamp(16px, 1.9vw, 20px); letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.cp-stat .s { font-size: 12px; color: var(--ink-faint); margin-top: 3px; }
.cp-stat--bad .v { color: #C0392B; }
.cp-stat--warn .v { color: #8A5A00; }
.cp-stat--good .v { color: #056B62; }

/* ---------- Report gate ---------- */
.cp-gatecard {
  margin-top: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(120% 180% at 100% 0%, rgba(8,204,252,.07), transparent 55%),
    var(--mist);
  padding: clamp(22px, 3vw, 34px);
}
.cp-gatecard h3 { font-size: clamp(19px, 2.2vw, 24px); margin-bottom: 8px; }
.cp-gatecard > p { font-size: 15px; color: var(--ink-soft); max-width: 640px; margin-bottom: 20px; }
.cp-gate-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; max-width: 680px; }
@media (max-width: 560px) { .cp-gate-grid { grid-template-columns: 1fr; } }
.cp-gate-grid .cp-field--full { grid-column: 1 / -1; }
.cp-gate-actions { margin-top: 18px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.cp-privacy { font-size: 12.5px; color: var(--ink-faint); max-width: 680px; margin-top: 12px; }

/* ---------- Report ---------- */
.cp-report { margin-top: 36px; padding-top: 8px; }
.cp-results .cp-state {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent-ink);
  margin-bottom: 12px;
}
.cp-state .cp-ok { display: inline-flex; align-items: center; gap: 8px; color: var(--teal); }
.cp-state .cp-flag-warn { color: #8A5A00; }
.cp-state .cp-flag-bad { color: #C0392B; }
.cp-results h2 { font-size: clamp(22px, 2.7vw, 28px); margin-bottom: 12px; letter-spacing: -0.018em; }
.cp-results .cp-summary { color: var(--ink-soft); font-size: 15.5px; max-width: 680px; }
.cp-disclaimer {
  font-size: 13px;
  color: var(--ink-faint);
  max-width: 680px;
  margin-top: 12px;
}
.cp-results h3.cp-sec {
  font-size: 13px;
  font-family: var(--font-body);
  font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-faint);
  margin: 38px 0 18px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}
.cp-results .cp-stats { grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 760px) { .cp-results .cp-stats { grid-template-columns: repeat(2, 1fr); } }
.cp-caution {
  display: flex; gap: 12px; align-items: flex-start;
  font-size: 14.5px;
  color: #8A5A00;
  background: rgba(232,163,61,.12);
  border: 1px solid rgba(232,163,61,.4);
  border-radius: 12px;
  padding: 14px 18px;
  margin-top: 18px;
  max-width: 680px;
}
.cp-caution strong { display: block; margin-bottom: 2px; }

/* Chart */
.cp-chart { max-width: 820px; }
.cp-chart svg { width: 100%; height: auto; display: block; }
.cp-chart .axis { stroke: var(--line); stroke-width: 1; }
.cp-chart .gridline { stroke: var(--line); stroke-width: 1; stroke-dasharray: 2 4; }
.cp-chart .zero { stroke: #C0392B; stroke-width: 1.2; stroke-dasharray: 5 4; opacity: .75; }
.cp-chart .reserve { stroke: #8A5A00; stroke-width: 1.4; stroke-dasharray: 6 4; }
.cp-chart .area { fill: rgba(8,204,252,.14); }
.cp-chart .line { fill: none; stroke: var(--accent-ink); stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
.cp-chart .dot { fill: var(--accent-ink); }
.cp-chart .dot--low { fill: #C0392B; }
.cp-chart .ylab, .cp-chart .xlab {
  font-family: var(--font-body);
  font-size: 11px;
  fill: var(--ink-faint);
}
.cp-chart .linelab { font-family: var(--font-body); font-size: 10.5px; font-weight: 700; }
.cp-chart .linelab--reserve { fill: #8A5A00; }
.cp-chart .linelab--zero { fill: #C0392B; }

/* Drivers */
.cp-drivers { display: grid; gap: 10px; max-width: 760px; }
.cp-driver {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 15px 18px;
}
.cp-driver .ic {
  width: 34px; height: 34px;
  border-radius: 9px;
  background: var(--mist);
  color: var(--accent-ink);
  display: flex; align-items: center; justify-content: center;
}
.cp-driver p { font-size: 14.5px; color: var(--ink-soft); }
.cp-driver p strong { color: var(--ink); }

/* Go beyond list */
.cp-beyond { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; max-width: 760px; }
@media (max-width: 620px) { .cp-beyond { grid-template-columns: 1fr; } }
.cp-beyond li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 14.5px;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 15px;
}
.cp-beyond li::before {
  content: '';
  flex: none;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent-ink);
  margin-top: 7px;
}

/* Results CTA band */
.cp-next {
  margin-top: 38px;
  background: var(--navy-2);
  color: #fff;
  border-radius: var(--radius);
  padding: clamp(28px, 4vw, 40px);
}
.cp-next h3 { font-size: clamp(20px, 2.4vw, 25px); margin-bottom: 10px; }
.cp-next p { color: var(--dark-body); font-size: 15.5px; max-width: 580px; margin-bottom: 24px; }
.cp-next .actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

/* App footer */
.cp-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
}
.cp-foot .cp-saved { font-size: 12.5px; color: var(--ink-faint); }

/* ---------- Print (the "PDF" until a real pipeline exists) ----------
   Prints the worksheet, KPIs, and (if unlocked) the report. */
@page { margin: 0.25in; }
@media print {
  .site-header, .site-footer, .cp-hero, .cp-explainer, .cta-band,
  .cp-gatecard, .cp-next .actions, .cp-foot, .cp-rowact, .cp-addrow,
  .cp-gridbar, .cp-restart, .cp-print-hide { display: none !important; }
  .cp-shell { background: #fff; }
  .cp-shell .container { max-width: none; padding: 0; }
  .cp-app { border: none; box-shadow: none; padding: 0; }
  .cp-print-head { display: flex !important; }
  .cp-gridwrap { max-height: none; overflow: visible; border-radius: 0; }
  table.cp-grid { font-size: 8.5px; min-width: 0; width: 100%; table-layout: fixed; }
  .cp-grid thead th, .cp-grid tr.endrow th, .cp-grid tr.endrow td {
    position: static;
    background: #fff !important;
    color: var(--ink) !important;
    border-bottom: 1.5px solid var(--ink);
  }
  /* Compress columns so all 13 weeks + Total fit inside the page margins,
     with headroom for seven-figure weekly amounts */
  .cp-grid thead th { padding: 4px 2px; font-size: 7px; letter-spacing: 0; }
  .cp-grid thead th:first-child, .cp-grid td.rowlabel { min-width: 0; width: 90px; }
  .cp-rowlabel { min-width: 0; max-width: none; padding: 0 2px; }
  .cp-rowlabel input { font-size: 8px; font-weight: 600; padding: 3px 2px; }
  .cp-cell { width: auto; min-width: 0; }
  .cp-cell input { padding: 3px 2px; font-size: 8px; }
  .cp-grid td.calc, .cp-grid td.rowtotal { padding: 3px 2px; font-size: 8px; }
  /* The pinned Total column and sticky label column print in normal flow */
  .cp-grid thead th:last-child, .cp-grid td.rowtotal,
  .cp-grid td.calc[data-calc$="-total"],
  .cp-grid tbody th, .cp-grid td.rowlabel { position: static; box-shadow: none; }
  .cp-kpis { break-inside: avoid; }
  /* Keep the net-row highlights when printed */
  .cp-grid td.calc[data-calc^="net"] { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .cp-next { background: none; color: var(--ink); border: 1px solid var(--line); padding: 18px; }
  .cp-next p { color: var(--ink-soft); margin-bottom: 0; }
  .cp-results h3.cp-sec { break-after: avoid; }
  .cp-stat, .cp-driver, .cp-chart { break-inside: avoid; }
  a[href]::after { content: none !important; }
}
.cp-print-head {
  display: none;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-bottom: 14px;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--ink);
}
.cp-print-head img { height: 30px; width: auto; }
.cp-print-head .meta { text-align: right; font-size: 12px; color: var(--ink-soft); }
