/* =========================================================================
   PORCHLYTE FORM TOOLS — SHARED DESIGN SYSTEM
   -------------------------------------------------------------------------
   This stylesheet is the cohesive base for every form tool in the suite.
   The shared base below is identical across the suite. Tool-specific rules
   for Commission Strategy Planner live in the clearly marked block at the
   bottom and only build on the tokens above; they never change them.

   Palette: white + cream surfaces, dark brown type, rust as an accent only.
   Type:    Chapza (display, falls back to Playfair Display) + Inter (body/UI).
   ========================================================================= */

:root {
  /* Brand palette */
  --cream: #efeae3;      /* page + section backgrounds */
  --white: #ffffff;      /* cards, tool surfaces, form fields */
  --tan: #d7c8ba;        /* secondary panels, hover, dividers, pills */
  --brown: #2b1f1b;      /* body text + headings, dark modules */
  --rust: #80441e;       /* accent only: buttons, active state, underlines */

  --text: var(--brown);
  --text-soft: #6f6157;  /* muted brown for sub text */
  --border: #e4dacd;     /* soft warm border */
  --error: #80441e;

  /* Money-flow accents (used only in the visual breakdown) */
  --flow-net: #4f7a3f;
  --flow-taxes: #80441e;
  --flow-brokerage: #a9743f;
  --flow-team: #6f6157;
  --flow-referral: #c08a5a;
  --flow-expenses: #b3a596;

  --font-display: "Chapza", "Playfair Display", Georgia, "Times New Roman", serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --radius-pill: 999px;

  --shadow-card: 0 1px 2px rgba(43, 31, 27, 0.04), 0 6px 20px rgba(43, 31, 27, 0.05);

  --content-width: 760px;

  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

* { box-sizing: border-box; }

/* The hidden attribute must always win, even over display rules like flex/grid. */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--cream);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.app {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 40px 24px 96px;
}

.screen { display: none; }
.screen.active {
  display: block;
  animation: fadein 0.35s var(--ease);
}
@keyframes fadein {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===== TOOL HEADER (reusable shell — same on every form) ===== */
.tool-header {
  text-align: center;
  margin: 0 0 32px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.tool-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(34px, 5vw, 52px);
  line-height: 1.05;
  letter-spacing: -0.01em;
  color: var(--brown);
  margin: 0 0 12px;
}
.tool-tagline {
  margin: 0 auto;
  max-width: 540px;
  color: var(--text-soft);
  font-size: 16px;
}

/* ===== BUTTONS ===== */
.btn-primary {
  background: var(--rust);
  color: #fff;
  border: 1px solid var(--rust);
  padding: 14px 28px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  letter-spacing: 0.01em;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: transform 0.12s var(--ease), background 0.2s var(--ease), box-shadow 0.2s var(--ease);
  box-shadow: 0 2px 8px rgba(128, 68, 30, 0.18);
}
.btn-primary:hover {
  background: #6c3818;
  transform: translateY(-1px);
  box-shadow: 0 5px 14px rgba(128, 68, 30, 0.24);
}
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-secondary {
  background: var(--brown);
  color: #fff;
  border: 1px solid var(--brown);
  padding: 13px 26px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: transform 0.12s var(--ease), background 0.2s var(--ease);
}
.btn-secondary:hover { background: #1c1512; transform: translateY(-1px); }

/* Quiet Copy button — tan pill */
.btn-copy {
  background: var(--tan);
  color: var(--brown);
  border: 1px solid transparent;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.18s var(--ease), color 0.18s var(--ease);
}
.btn-copy:hover { background: #cbb9a8; }
.btn-copy.is-copied { background: var(--rust); color: #fff; }

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

/* ===== FORM ===== */
#form, #loading, #results {
  margin: 0 auto;
}
.form-note {
  background: var(--white);
  border: 1px solid var(--border);
  border-left: 3px solid var(--rust);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin: 0 0 28px;
  color: var(--text-soft);
  font-size: 14.5px;
}
.form-grid {
  display: flex;
  flex-direction: column;
  gap: 32px;
}
.form-section {
  display: flex;
  flex-direction: column;
  gap: 18px;
  scroll-margin-top: 96px;
}
.form-section-title {
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--rust);
  margin: 0;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.field-row {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.field.span-2 { grid-column: span 2; }
.field > span,
.field > legend {
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--text-soft);
  text-align: left;
  padding-left: 2px;
}
.field > span em {
  font-style: normal;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
  color: var(--tan);
  margin-left: 6px;
}
.field input,
.field select,
.field textarea {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--white);
  font: inherit;
  color: inherit;
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--rust);
  box-shadow: 0 0 0 3px rgba(128, 68, 30, 0.15);
}

.form-actions {
  display: inline-flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  margin-top: 4px;
}
.form-actions .microcopy { text-align: center; }
.microcopy {
  font-size: 13px;
  color: var(--text-soft);
  margin: 0;
}
.form-error {
  color: var(--error);
  font-size: 14px;
  margin: 8px 0 0;
  font-weight: 500;
  background: #fbf1ea;
  border: 1px solid #e7c9b6;
  border-left: 3px solid var(--rust);
  border-radius: var(--radius-md);
  padding: 12px 16px;
}

/* ===== SCREEN HEADERS (used on the results screen) ===== */
.screen-header {
  text-align: left;
  margin: 8px 0 28px;
}
.screen-header.center { text-align: center; }
.screen-header h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(30px, 4.5vw, 46px);
  line-height: 1.05;
  color: var(--brown);
  margin: 0 0 12px;
}
.screen-header.center h2.underline { display: inline-block; }
.screen-header.center h2.underline::after {
  content: "";
  display: block;
  width: 64px;
  height: 3px;
  background: var(--rust);
  border-radius: 2px;
  margin: 14px auto 0;
}
.screen-sub {
  margin: 0;
  color: var(--text-soft);
  font-size: 16px;
}

/* ===== LOADING ===== */
.loader {
  text-align: center;
  padding: 72px 0;
}
.loader h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(24px, 3.5vw, 32px);
  color: var(--brown);
  margin: 0 0 8px;
}

/* ===== RESULTS ===== */
.result-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.result-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--brown);
  color: #fff;
  padding: 12px 22px;
}
.result-num {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  color: var(--tan);
}
.result-label {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
  color: #fff;
}
.result-body { padding: 22px 22px 8px; }
.content-body {
  margin: 0;
  padding: 0;
  font-family: inherit;
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--brown);
  white-space: pre-wrap;
  word-wrap: break-word;
}
.result-card .card-actions { padding: 0 22px 20px; }

.results-again {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 32px;
}

.card-error-msg {
  margin: 0;
  color: var(--text-soft);
  font-size: 15px;
}

.result-card.just-arrived { animation: card-in 0.35s var(--ease); }
@keyframes card-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===== FOOTER ===== */
.site-footer {
  margin-top: 56px;
  padding: 26px 0 12px;
  border-top: 1px solid var(--border);
  text-align: center;
}
.footer-disclaimer {
  font-size: 12px;
  color: var(--text-soft);
  margin: 0 auto;
  max-width: 620px;
  opacity: 0.9;
  line-height: 1.55;
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ===== RESPONSIVE (shared) ===== */
@media (max-width: 520px) {
  .app { padding: 28px 18px 80px; }
  .result-bar { padding: 11px 18px; }
  .result-body { padding: 18px 18px 6px; }
  .result-card .card-actions { padding: 0 18px 18px; }
  .field.span-2 { grid-column: auto; }
}

/* ---- Header badge + supporting copy (shared suite pattern) ---- */
.tool-badge-cat {
  display: inline-block;
  background: var(--brown);
  color: var(--tan);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 5px 14px;
  border-radius: var(--radius-pill);
  margin-bottom: 16px;
}
.tool-subhead {
  margin: 0 auto;
  max-width: 560px;
  color: var(--rust);
  font-size: clamp(16px, 2.4vw, 19px);
  font-weight: 600;
}
.tool-support {
  margin: 12px auto 0;
  max-width: 560px;
  color: var(--text-soft);
  font-size: 14.5px;
  line-height: 1.6;
}
.tool-support em { font-style: italic; }
.tool-header-cta { margin-top: 22px; }

.help-text {
  font-size: 13.5px;
  color: var(--text-soft);
  margin: 0;
  line-height: 1.55;
}
.help-text strong { color: var(--brown); font-weight: 600; }

textarea { resize: vertical; min-height: 96px; line-height: 1.6; }

/* ---- Pill option groups (shared suite pattern) ---- */
.pill-group {
  border: 0; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: 10px;
}
.pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  cursor: pointer;
  font-size: 14.5px;
  color: var(--brown);
  transition: border-color 0.16s var(--ease), background 0.16s var(--ease), box-shadow 0.16s var(--ease);
  user-select: none;
}
.pill:hover { border-color: var(--tan); background: #faf7f2; }
.pill input { position: absolute; opacity: 0; width: 0; height: 0; }
.pill:has(input:focus-visible) {
  border-color: var(--rust);
  box-shadow: 0 0 0 3px rgba(128, 68, 30, 0.15);
}
.pill:has(input:checked) {
  background: var(--rust);
  border-color: var(--rust);
  color: #fff;
  box-shadow: 0 2px 8px rgba(128, 68, 30, 0.2);
}

/* ---- Results toolbar (shared suite pattern) ---- */
.results-toolbar {
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
  margin: 0 0 26px; padding-bottom: 22px; border-bottom: 1px solid var(--border);
}

/* ---- Progressive loading: shimmer + writing indicator ---- */
.result-card + .result-card,
#results > div[id^="card-"] + div[id^="card-"] .result-card { margin-top: 0; }
#results > div[id^="card-"] { margin-bottom: 16px; }
.result-card.is-pending { opacity: 0.9; }
.shimmer { display: flex; flex-direction: column; gap: 10px; padding: 10px 0 16px; }
.shimmer span {
  height: 12px; border-radius: 4px;
  background: linear-gradient(90deg, var(--cream) 25%, #e7ddd0 37%, var(--cream) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.3s ease-in-out infinite;
}
.shimmer span:nth-child(1) { width: 100%; }
.shimmer span:nth-child(2) { width: 92%; }
.shimmer span:nth-child(3) { width: 68%; }
@keyframes shimmer {
  0%   { background-position: 100% 0; }
  100% { background-position: 0 0; }
}
.results-writing {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  margin: 20px 0 0; color: var(--text-soft); font-size: 14px;
}
.writing-dot {
  width: 9px; height: 9px; border-radius: 50%; background: var(--rust);
  animation: writing-pulse 1s ease-in-out infinite;
}
@keyframes writing-pulse {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50%      { opacity: 1; transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .shimmer span, .writing-dot { animation: none; }
}

/* =========================================================================
   TOOL-SPECIFIC ADDITIONS (Commission Strategy Planner only)
   Builds on the shared system above and reuses its tokens. Nothing here
   changes the shared components; it only adds the pieces this tool needs.
   ========================================================================= */

/* ---- Currency + percent inputs ---- */
.money-input, .pct-input { position: relative; display: flex; align-items: stretch; }
.money-input .money-prefix {
  display: flex; align-items: center;
  padding: 0 4px 0 16px;
  border: 1px solid var(--border); border-right: 0;
  border-radius: var(--radius-md) 0 0 var(--radius-md);
  background: var(--white); color: var(--text-soft); font-weight: 600;
}
.money-input input {
  border-radius: 0 var(--radius-md) var(--radius-md) 0 !important;
  border-left: 0 !important; flex: 1; padding-left: 6px !important;
}
.pct-input input { flex: 1; border-radius: var(--radius-md) 0 0 var(--radius-md) !important; border-right: 0 !important; }
.pct-input .pct-suffix {
  display: flex; align-items: center;
  padding: 0 16px 0 6px;
  border: 1px solid var(--border); border-left: 0;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  background: var(--white); color: var(--text-soft); font-weight: 600;
}
.money-input:focus-within .money-prefix,
.money-input:focus-within input,
.pct-input:focus-within .pct-suffix,
.pct-input:focus-within input {
  border-color: var(--rust);
}
.money-input:focus-within, .pct-input:focus-within {
  border-radius: var(--radius-md);
  box-shadow: 0 0 0 3px rgba(128, 68, 30, 0.15);
}
.money-input:focus-within input, .pct-input:focus-within input { box-shadow: none; }

/* Hint appended to a conditional label */
.cond-hint { font-style: normal; text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--tan); margin-left: 6px; }
.field-group-label {
  font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  font-weight: 600; color: var(--text-soft); margin: 4px 0 -6px;
}

/* ---- Checkbox row ---- */
.check-row {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px; background: var(--white);
  border: 1px solid var(--border); border-radius: var(--radius-md);
  cursor: pointer; user-select: none;
}
.check-row input { position: absolute; opacity: 0; width: 0; height: 0; }
.check-face {
  flex: 0 0 auto; width: 22px; height: 22px; margin-top: 1px;
  border: 1.5px solid var(--tan); border-radius: 6px; background: var(--white);
  position: relative; transition: background 0.16s var(--ease), border-color 0.16s var(--ease);
}
.check-row:hover .check-face { border-color: var(--rust); }
.check-row:has(input:checked) .check-face { background: var(--rust); border-color: var(--rust); }
.check-row:has(input:checked) .check-face::after {
  content: ""; position: absolute; left: 7px; top: 3px;
  width: 6px; height: 11px; border: solid #fff; border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
}
.check-row:has(input:focus-visible) .check-face { box-shadow: 0 0 0 3px rgba(128, 68, 30, 0.15); }
.check-text { font-size: 14.5px; color: var(--brown); line-height: 1.5; }

/* ---- Repeatable fee / expense rows ---- */
.repeat-list { display: flex; flex-direction: column; gap: 10px; }
.repeat-row { display: grid; grid-template-columns: 1fr 150px auto; gap: 10px; align-items: stretch; }
.repeat-row input { padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--white); font: inherit; color: inherit; }
.repeat-row input:focus { outline: none; border-color: var(--rust); box-shadow: 0 0 0 3px rgba(128, 68, 30, 0.15); }
.repeat-row .money-input { grid-column: auto; }
.repeat-remove {
  flex: 0 0 auto; width: 40px; border: 1px solid var(--border); border-radius: var(--radius-md);
  background: var(--white); color: var(--text-soft); cursor: pointer; font-size: 18px; line-height: 1;
  transition: background 0.16s var(--ease), color 0.16s var(--ease), border-color 0.16s var(--ease);
}
.repeat-remove:hover { background: var(--rust); color: #fff; border-color: var(--rust); }
.btn-add {
  align-self: flex-start;
  background: none; border: 1px dashed var(--tan); color: var(--rust);
  padding: 10px 16px; border-radius: var(--radius-md); cursor: pointer;
  font: inherit; font-size: 14px; font-weight: 600;
  transition: background 0.16s var(--ease), border-color 0.16s var(--ease);
}
.btn-add:hover { background: #faf7f2; border-color: var(--rust); }

/* ---- Expense grid ---- */
.expense-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.expense-cell { display: flex; flex-direction: column; gap: 6px; }
.expense-cell > span {
  font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase;
  font-weight: 600; color: var(--text-soft); padding-left: 2px;
}

/* ---- Disclaimer note ---- */
.disclaimer-note {
  background: #f6efe7; border: 1px solid var(--border); border-left: 3px solid var(--tan);
  border-radius: var(--radius-md); padding: 12px 16px;
  font-size: 13px; color: var(--text-soft); line-height: 1.55; margin: 0;
}
.disclaimer-note strong { color: var(--brown); }

/* ---- Summary table (Card 1) ---- */
.sum-hero {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
  gap: 8px 20px; padding: 4px 0 18px; margin-bottom: 6px; border-bottom: 1px solid var(--border);
}
.sum-hero-label { font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 600; color: var(--text-soft); }
.sum-hero-value { font-family: var(--font-display); font-weight: 600; font-size: clamp(30px, 6vw, 44px); color: var(--rust); line-height: 1; }
.sum-hero-sub { width: 100%; font-size: 13.5px; color: var(--text-soft); margin: 2px 0 0; }

.sum-rows { display: flex; flex-direction: column; gap: 0; padding-bottom: 4px; }
.sum-row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 14px;
  padding: 11px 0; border-bottom: 1px solid var(--border);
}
.sum-row:last-child { border-bottom: none; }
.sum-row-main { display: flex; flex-direction: column; gap: 2px; }
.sum-row-label { font-size: 14.5px; color: var(--brown); font-weight: 500; }
.sum-row-note { font-size: 12.5px; color: var(--text-soft); line-height: 1.45; }
.sum-row-amt { font-family: var(--font-display); font-weight: 600; font-size: 16px; color: var(--brown); white-space: nowrap; }
.sum-row-amt.neg { color: var(--text-soft); }
.sum-row.is-total { border-top: 2px solid var(--brown); border-bottom: none; margin-top: 4px; padding-top: 14px; }
.sum-row.is-total .sum-row-label { font-weight: 700; font-size: 15.5px; }
.sum-row.is-total .sum-row-amt { color: var(--flow-net); font-size: 22px; }
.sum-row.is-subtotal .sum-row-label { font-weight: 600; }
.sum-row.is-subtotal .sum-row-amt { color: var(--brown); }
.gst-note {
  margin: 14px 0 0; padding: 12px 14px; background: var(--cream);
  border-radius: var(--radius-md); font-size: 13px; color: var(--text-soft); line-height: 1.5;
}
.gst-note strong { color: var(--brown); }

/* ---- Money-flow breakdown (Card 2) ---- */
.flow-bar {
  display: flex; height: 34px; border-radius: var(--radius-pill); overflow: hidden;
  margin: 2px 0 20px; border: 1px solid var(--border); background: var(--cream);
}
.flow-seg { height: 100%; min-width: 2px; transition: width 0.7s var(--ease); }
.flow-seg.net { background: var(--flow-net); }
.flow-seg.taxes { background: var(--flow-taxes); }
.flow-seg.brokerage { background: var(--flow-brokerage); }
.flow-seg.team { background: var(--flow-team); }
.flow-seg.referral { background: var(--flow-referral); }
.flow-seg.expenses { background: var(--flow-expenses); }

.flow-legend { display: flex; flex-direction: column; gap: 12px; padding-bottom: 4px; }
.flow-item { display: flex; align-items: center; gap: 12px; }
.flow-dot { flex: 0 0 auto; width: 12px; height: 12px; border-radius: 3px; }
.flow-dot.net { background: var(--flow-net); }
.flow-dot.taxes { background: var(--flow-taxes); }
.flow-dot.brokerage { background: var(--flow-brokerage); }
.flow-dot.team { background: var(--flow-team); }
.flow-dot.referral { background: var(--flow-referral); }
.flow-dot.expenses { background: var(--flow-expenses); }
.flow-item-label { flex: 1; font-size: 14.5px; color: var(--brown); }
.flow-item-pct { font-family: var(--font-display); font-weight: 600; font-size: 14px; color: var(--rust); min-width: 44px; text-align: right; }
.flow-item-amt { font-size: 14px; color: var(--text-soft); min-width: 84px; text-align: right; }

/* ---- Snapshot / plain-English lines (Card 3) ---- */
.snap-headline { font-family: var(--font-display); font-weight: 600; font-size: clamp(19px, 3vw, 24px); color: var(--brown); margin: 0 0 14px; line-height: 1.3; }
.snap-lines { display: flex; flex-direction: column; gap: 12px; padding-bottom: 4px; }
.snap-line {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 13px 16px; background: var(--cream); border-radius: var(--radius-md); border-left: 3px solid var(--rust);
}
.snap-line-dot { flex: 0 0 auto; color: var(--rust); font-weight: 700; margin-top: 1px; }
.snap-line-text { flex: 1; font-size: 15px; color: var(--brown); line-height: 1.55; }

/* ---- Profit plan (Card 4) ---- */
.plan-note { margin: 0 0 16px; font-size: 15px; color: var(--brown); line-height: 1.6; }
.plan-rows { display: flex; flex-direction: column; gap: 12px; padding-bottom: 4px; }
.plan-row { display: flex; flex-direction: column; gap: 6px; }
.plan-row-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.plan-row-label { font-size: 14.5px; font-weight: 600; color: var(--brown); }
.plan-row-nums { display: flex; align-items: baseline; gap: 10px; white-space: nowrap; }
.plan-row-pct { font-size: 13px; color: var(--text-soft); }
.plan-row-amt { font-family: var(--font-display); font-weight: 600; font-size: 15px; color: var(--rust); }
.plan-track { height: 9px; border-radius: var(--radius-pill); background: var(--cream); overflow: hidden; }
.plan-fill { height: 100%; border-radius: var(--radius-pill); background: var(--tan); transition: width 0.6s var(--ease); }
.plan-fill.owner { background: var(--flow-net); }
.plan-fill.taxes { background: var(--rust); }
.plan-row-note { font-size: 12.5px; color: var(--text-soft); line-height: 1.45; margin: 0; }

/* ---- Annual progress (Card 5) ---- */
.prog-hero { display: flex; align-items: center; gap: 20px; padding: 4px 0 18px; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.prog-ring {
  position: relative; flex: 0 0 auto; width: 104px; height: 104px; border-radius: 50%;
  display: grid; place-items: center;
  background: conic-gradient(var(--rust) calc(var(--pct) * 1%), var(--cream) 0);
}
.prog-ring::after { content: ""; position: absolute; inset: 10px; border-radius: 50%; background: var(--white); }
.prog-ring-inner { position: relative; z-index: 1; text-align: center; line-height: 1; }
.prog-ring-num { font-family: var(--font-display); font-weight: 600; font-size: 24px; color: var(--brown); }
.prog-ring-den { font-size: 11px; color: var(--text-soft); margin-top: 3px; letter-spacing: 0.04em; }
.prog-hero-copy { flex: 1; }
.prog-hero-copy p { margin: 0; font-size: 14.5px; color: var(--text-soft); line-height: 1.55; }
.prog-hero-copy .prog-earned { font-family: var(--font-display); font-weight: 600; font-size: 20px; color: var(--brown); margin-bottom: 4px; }

.prog-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; padding-bottom: 4px; }
.prog-stat { background: var(--cream); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 12px 14px; }
.prog-stat-value { font-family: var(--font-display); font-weight: 600; font-size: 19px; color: var(--brown); line-height: 1.1; }
.prog-stat-label { font-size: 12.5px; color: var(--text-soft); margin-top: 3px; line-height: 1.4; }
.prog-empty { margin: 0; font-size: 15px; color: var(--text-soft); line-height: 1.6; }

/* ---- Health points (Card 6) ---- */
.health-verdict { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.health-badge { font-family: var(--font-display); font-weight: 600; font-size: 20px; color: var(--brown); }
.health-summary { margin: 0 0 16px; font-size: 15px; color: var(--text-soft); line-height: 1.6; }
.health-points { display: flex; flex-direction: column; gap: 12px; padding-bottom: 4px; }
.health-point {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px; background: var(--cream); border-radius: var(--radius-md); border-left: 3px solid var(--tan);
}
.health-point.good { border-left-color: var(--flow-net); }
.health-point.watch { border-left-color: var(--flow-brokerage); }
.health-point.flag { border-left-color: var(--rust); }
.health-icon { flex: 0 0 auto; font-size: 16px; line-height: 1.3; }
.health-main { flex: 1; }
.health-label { margin: 0 0 3px; font-size: 15px; font-weight: 600; color: var(--brown); }
.health-text { margin: 0; font-size: 14px; color: var(--text-soft); line-height: 1.55; }

/* ---- Coach columns (Card 7) ---- */
.coach-cols { display: flex; flex-direction: column; gap: 14px; padding-bottom: 4px; }
.coach-col {
  padding: 16px 18px; background: var(--brown); color: #fff; border-radius: var(--radius-md);
}
/* Muted, on-brand trio: softened brown, softened rust, soft tan. */
.coach-col.keep { background: #4a3e36; }
.coach-col.keep .coach-kicker { color: var(--tan); }
.coach-col.improve { background: var(--white); border: 1px solid var(--border); }
.coach-col.improve .coach-kicker { color: var(--rust); }
.coach-col.improve .coach-col-title { color: var(--brown); }
.coach-col.improve .coach-col-text { color: #5f5349; }
/* Tan panel with dark brown text, so all three stay on-brand. */
.coach-col.opportunity { background: #ddd0c4; }
.coach-col.opportunity .coach-kicker { color: var(--rust); }
.coach-col.opportunity .coach-col-title { color: var(--brown); }
.coach-col.opportunity .coach-col-text { color: #5f5349; }
.coach-kicker {
  font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 700;
  color: rgba(255,255,255,0.75); margin: 0 0 6px;
}
.coach-col-title { margin: 0 0 6px; font-size: 16px; font-weight: 600; color: #fff; }
.coach-col-text { margin: 0; font-size: 14.5px; color: rgba(255,255,255,0.92); line-height: 1.55; }

/* ---- What this made possible (Card 8) ---- */
.possible-intro { margin: 0 0 16px; font-size: 15px; color: var(--brown); line-height: 1.6; }
.possible-list { display: flex; flex-direction: column; gap: 10px; padding-bottom: 4px; }
.possible-item {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 13px 16px; background: var(--cream); border-radius: var(--radius-md);
}
.possible-check { flex: 0 0 auto; color: var(--flow-net); font-weight: 700; margin-top: 1px; }
.possible-text { flex: 1; font-size: 15px; color: var(--brown); line-height: 1.5; }

/* ---- Future planning table (Card 9) ---- */
.future-intro { margin: 0 0 16px; font-size: 15px; color: var(--brown); line-height: 1.6; }
.future-table { display: flex; flex-direction: column; gap: 0; padding-bottom: 4px; }
.future-row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 13px 0; border-bottom: 1px solid var(--border);
}
.future-row:last-child { border-bottom: none; }
.future-tx { display: flex; align-items: baseline; gap: 10px; }
.future-tx-num { font-family: var(--font-display); font-weight: 600; font-size: 22px; color: var(--rust); min-width: 42px; }
.future-tx-label { font-size: 14px; color: var(--text-soft); }
.future-amt { font-family: var(--font-display); font-weight: 600; font-size: 18px; color: var(--brown); }
.future-note { margin: 14px 0 0; font-size: 12.5px; color: var(--text-soft); line-height: 1.5; }

/* ---- Smart suggestions (Card 10) ---- */
.sugg-list { display: flex; flex-direction: column; gap: 2px; padding: 2px 0 4px; }
.sugg-item { display: flex; gap: 14px; align-items: flex-start; padding: 14px 0; border-bottom: 1px solid var(--border); }
.sugg-item:last-child { border-bottom: none; }
.sugg-num { flex: 0 0 auto; width: 28px; height: 28px; border-radius: 50%; background: var(--rust); color: #fff; display: grid; place-items: center; font-family: var(--font-display); font-weight: 600; font-size: 14px; }
.sugg-main { flex: 1; }
.sugg-title { margin: 0 0 3px; font-size: 15.5px; font-weight: 600; color: var(--brown); }
.sugg-text { margin: 0; font-size: 14px; color: var(--text-soft); line-height: 1.55; }

/* ---- Net sheet (bonus) ---- */
.netsheet-toggle { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.ns-tab {
  background: var(--white); border: 1px solid var(--border); color: var(--brown);
  padding: 9px 18px; border-radius: var(--radius-pill); cursor: pointer; font: inherit;
  font-size: 13.5px; font-weight: 600; transition: background 0.16s var(--ease), color 0.16s var(--ease), border-color 0.16s var(--ease);
}
.ns-tab:hover { border-color: var(--tan); }
.ns-tab.active { background: var(--rust); border-color: var(--rust); color: #fff; }
.netsheet {
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 26px 28px; box-shadow: var(--shadow-card);
}
.ns-head { text-align: center; border-bottom: 2px solid var(--brown); padding-bottom: 16px; margin-bottom: 18px; }
.ns-title { font-family: var(--font-display); font-weight: 600; font-size: 24px; color: var(--brown); margin: 0 0 4px; }
.ns-sub { font-size: 13px; color: var(--text-soft); margin: 0; }
.ns-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; margin: 10px 0 0; font-size: 13px; color: var(--text-soft); }
.ns-rows { display: flex; flex-direction: column; }
.ns-row { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.ns-row-label { font-size: 14px; color: var(--brown); }
.ns-row-amt { font-variant-numeric: tabular-nums; font-size: 14px; color: var(--brown); white-space: nowrap; }
.ns-row.is-total { border-top: 2px solid var(--brown); border-bottom: none; margin-top: 6px; padding-top: 12px; }
.ns-row.is-total .ns-row-label { font-weight: 700; font-size: 15px; }
.ns-row.is-total .ns-row-amt { font-family: var(--font-display); font-weight: 600; font-size: 18px; color: var(--flow-net); }
.ns-foot { margin: 16px 0 0; font-size: 11.5px; color: var(--text-soft); line-height: 1.5; }
.ns-print-btn { margin-top: 14px; }

/* ---- Loader: house -> sold -> cheque -> calculator -> dashboard ---- */
.csp-loader { display: flex; justify-content: center; margin: 0 auto 32px; }
.csp-svg { width: 200px; height: auto; overflow: visible; }
.csp-stage { opacity: 0; transform-box: fill-box; transform-origin: center; }

.csp-roof { fill: var(--rust); }
.csp-wall { fill: var(--brown); }
.csp-door { fill: var(--tan); }
.csp-window { fill: var(--cream); }

.csp-post { stroke: var(--brown); stroke-width: 4; stroke-linecap: round; }
.csp-sign { fill: var(--rust); }
.csp-sold-text { fill: #fff; font-family: "Impact", var(--font-body); font-weight: 800; font-size: 26px; letter-spacing: 1.5px; }

.csp-cheque-body { fill: var(--white); stroke: var(--tan); stroke-width: 2.5; }
.csp-cheque-line { stroke: var(--border); stroke-width: 4; stroke-linecap: round; }
.csp-cheque-line.short { stroke: var(--tan); }
.csp-cheque-amt { fill: var(--flow-net); }

.csp-calc-body { fill: var(--brown); }
.csp-calc-screen { fill: #cfe0c6; }
.csp-calc-keys rect { fill: var(--tan); }
.csp-calc-keys .csp-key-eq { fill: var(--rust); }

.csp-dash-body { fill: var(--white); stroke: var(--tan); stroke-width: 2.5; }
.csp-dash-ring { fill: none; stroke: var(--cream); stroke-width: 7; }
.csp-dash-arc { fill: none; stroke: var(--rust); stroke-width: 7; stroke-linecap: round; }
.csp-dash-bar { fill: var(--tan); }
.csp-dash-bar.b3 { fill: var(--rust); }

/* One ~10s loop, five stages fading in and out in sequence. */
.csp-house { animation: csp-stage 10s ease-in-out infinite; animation-delay: 0s; }
.csp-sold  { animation: csp-stage 10s ease-in-out infinite; animation-delay: 2s; }
.csp-cheque{ animation: csp-stage 10s ease-in-out infinite; animation-delay: 4s; }
.csp-calc  { animation: csp-stage 10s ease-in-out infinite; animation-delay: 6s; }
.csp-dash  { animation: csp-stage 10s ease-in-out infinite; animation-delay: 8s; }
@keyframes csp-stage {
  0%   { opacity: 0; transform: scale(0.86) translateY(8px); }
  4%   { opacity: 1; transform: scale(1) translateY(0); }
  16%  { opacity: 1; transform: scale(1) translateY(0); }
  20%  { opacity: 0; transform: scale(0.96) translateY(-6px); }
  100% { opacity: 0; }
}
.csp-dash-arc { stroke-dasharray: 120; stroke-dashoffset: 120; animation: csp-arc 10s ease-in-out infinite; animation-delay: 8s; }
@keyframes csp-arc {
  0%, 4% { stroke-dashoffset: 120; }
  14%    { stroke-dashoffset: 30; }
  20%, 100% { stroke-dashoffset: 30; }
}
@media (prefers-reduced-motion: reduce) {
  .csp-stage, .csp-dash-arc { animation: none !important; }
  .csp-house { opacity: 1; }
  .csp-sold, .csp-cheque, .csp-calc, .csp-dash { opacity: 0; }
}

@media (max-width: 520px) {
  .repeat-row { grid-template-columns: 1fr 120px auto; }
  .coach-cols { gap: 12px; }
  .netsheet { padding: 20px 18px; }
}

/* =========================================================================
   PRINT / SAVE AS PDF
   ========================================================================= */
@media print {
  .tool-header-cta, .results-toolbar, .results-again,
  #form, #loading, .card-actions, .netsheet-toggle, .ns-print-btn,
  .btn-copy, .site-footer .footer-disclaimer { display: none !important; }
  body { background: #fff; }
  .app { padding: 0; max-width: 100%; }
  .result-card, .netsheet { box-shadow: none; break-inside: avoid; page-break-inside: avoid; }
  .result-bar, .coach-col, .flow-seg, .plan-fill, .prog-ring, .sugg-num {
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
  .screen { display: block !important; }
  #form, #loading { display: none !important; }
}

/* When printing just the net sheet, hide the rest of the results. */
body.printing-netsheet #results > div[id^="card-"]:not(#card-netsheet) { display: none !important; }
body.printing-netsheet .screen-header,
body.printing-netsheet .results-writing { display: none !important; }
