/* ════════════════════════════════════════════════════════════════════════
   public/css/formats/detailed-one-pager.css
   Plan #2 — Detailed 1-Pager.

   Visual approach: white page with light brand-driven washes for alternating
   sections. Story block + footer use brand-primary directly. Accent details
   (period after plan name, bullets, segment labels, NW bar) use brand-secondary.

   All rules scoped under .plan-detailed-one-pager so they don't leak.
══════════════════════════════════════════════════════════════════════════ */

.plan-detailed-one-pager {
  /* Neutrals */
  --d1p-page-bg:    #ffffff;
  --d1p-card-bg:    #ffffff;
  --d1p-ink:        #1a1a1a;
  --d1p-ink-muted:  #555;
  --d1p-ink-faint:  #999;
  --d1p-rule:       #e8e8e6;
  --d1p-rule-soft:  #f0f0ee;
  /* Follow the luminance-aware on-brand colors (set by applyBrandVars):
     light brand primaries flip band text to ink instead of white. */
  --d1p-on-dark:    var(--on-brand-primary, #ffffff);
  --d1p-on-dark-faint: var(--on-brand-primary-muted, rgba(255,255,255,0.7));
  --d1p-status-on:  #4a7c5f;
  --d1p-status-mid: #c9863a;
  --d1p-status-off: #a05050;

  /* Brand colors come from the firm's settings (set inline by renderer) */
  --brand-primary:   #1a2332;
  --brand-secondary: #c9a861;

  width: 1080px;
  /* Letter aspect (8.5 × 11): 1080 wide × 1397 tall. Render the full
     page shape from the start so an empty plan still looks page-sized. */
  min-height: 1397px;
  background: var(--d1p-page-bg);
  color: var(--d1p-ink);
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 12px;
  line-height: 1.5;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08); /* page edge shadow */
}
/* Footer always pinned to bottom of the letter page; content stacks above */
.plan-detailed-one-pager .d1p-footer { margin-top: auto; }

/* ─── Section heads (microlabel + italic-em headline) ────────────────── */
.plan-detailed-one-pager .d1p-microlabel {
  font-size: 8.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.22em;
  color: var(--d1p-ink-faint);
  display: inline-flex; align-items: center; gap: 8px;
}
.plan-detailed-one-pager .d1p-microlabel::before {
  content: ''; width: 14px; height: 1px; background: var(--d1p-ink-faint);
}
.plan-detailed-one-pager .d1p-microlabel.on-dark { color: var(--d1p-on-dark-faint); }
.plan-detailed-one-pager .d1p-microlabel.on-dark::before { background: var(--d1p-on-dark-faint); }
.plan-detailed-one-pager .d1p-headline {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 22px; line-height: 1.05; letter-spacing: -0.4px;
  font-weight: 400; margin-top: 5px; color: var(--d1p-ink);
}
.plan-detailed-one-pager .d1p-headline em { font-style: italic; color: var(--brand-secondary); }
.plan-detailed-one-pager .d1p-headline.on-dark { color: var(--d1p-on-dark); }
.plan-detailed-one-pager .d1p-headline.on-dark em { color: var(--brand-secondary); }
.plan-detailed-one-pager .d1p-section-head { margin-bottom: 14px; }

/* ─── Header ─── */
.plan-detailed-one-pager .d1p-header {
  background: var(--d1p-page-bg);
  padding: 24px 44px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--d1p-rule);
}
.plan-detailed-one-pager .d1p-header-left { min-width: 0; }
.plan-detailed-one-pager .d1p-plan-title {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 36px; line-height: 1.1;
  letter-spacing: -0.5px; margin-bottom: 6px;
  color: var(--d1p-ink);
}
.plan-detailed-one-pager .d1p-plan-subline {
  font-size: 11px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--d1p-ink-faint);
}
.plan-detailed-one-pager .d1p-header-right {
  display: flex; align-items: center; gap: 10px;
  color: var(--brand-primary);
  font-family: 'DM Serif Display', serif;
  font-size: 16px;
}
.plan-detailed-one-pager .d1p-firm-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  background: var(--brand-primary);
  color: var(--on-brand-primary, #fff);
  font-family: 'DM Serif Display', serif;
  font-size: 16px; font-weight: 400;
  border-radius: 3px;
}
.plan-detailed-one-pager .d1p-header-right img {
  max-height: 40px; max-width: 160px;
  object-fit: contain;
}

/* ─── Story Block (overview + NW history chart) — brand-primary band ─── */
.plan-detailed-one-pager .d1p-story-block {
  background: var(--brand-primary);
  color: var(--d1p-on-dark);
  padding: 22px 44px 24px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
  align-items: start;
}
.plan-detailed-one-pager .d1p-story-block.has-chart {
  grid-template-columns: 1.4fr 1fr;
}
.plan-detailed-one-pager .d1p-story-block .text-col p {
  font-family: 'DM Serif Display', serif;
  font-style: italic;
  font-size: 14px; line-height: 1.5;
  color: var(--d1p-on-dark);
  margin: 8px 0 0;
}
.plan-detailed-one-pager .d1p-story-block .d1p-nw-chart-card {
  display: flex;
  flex-direction: column;
}
.plan-detailed-one-pager .d1p-story-block .d1p-nw-chart-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(255,255,255,0.18);
}
.plan-detailed-one-pager .d1p-story-block .d1p-nw-chart-title {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.75);
}
.plan-detailed-one-pager .d1p-story-block .d1p-nw-chart-meta {
  font-size: 9px;
  color: rgba(255,255,255,0.5);
  font-style: italic;
}
.plan-detailed-one-pager .d1p-story-block .d1p-nw-chart-wrap {
  position: relative;
  width: 100%;
  height: 110px;
}
.plan-detailed-one-pager .d1p-story-block .d1p-nw-chart-wrap canvas { display: block; }

/* ─── Brand-color header mode (firm setup: header style = "brand color") ─────
   Flip the header + story block as a pair so we never end up with a dark
   header sitting on top of an equally-dark story block. Header takes the
   brand color; the story block becomes a light secondary wash with dark text.
   The KPI strip already uses --d1p-wash-primary (a fainter tint), which gives
   us natural separation between the now-light story block and the KPI band. */
.plan-detailed-one-pager.d1p-brand-header .d1p-header {
  background: var(--brand-primary);
  border-bottom: none;
}
.plan-detailed-one-pager.d1p-brand-header .d1p-header .d1p-plan-title {
  color: var(--on-brand-primary, #fff);
}
.plan-detailed-one-pager.d1p-brand-header .d1p-header .d1p-plan-subline {
  color: rgba(255,255,255,0.55);
}
.plan-detailed-one-pager.d1p-brand-header .d1p-header-right {
  color: #fff;
}

/* Story block goes plain white in brand-header mode — the brand-color
   header above is now the anchor, so the overview should read as clean
   editorial space, not compete with the header for attention. The KPI
   strip's --d1p-wash-primary tint then provides the next band of
   visual rhythm (white → tinted band → white body), matching how the
   Standard plan handles the same flow. Border-bottom uses a stronger
   brand-tinted rule to keep the section break unmistakable. */
.plan-detailed-one-pager.d1p-brand-header .d1p-story-block {
  background: #fff;
  color: var(--d1p-ink);
  border-bottom: 2px solid var(--d1p-wash-secondary);
}
.plan-detailed-one-pager.d1p-brand-header .d1p-story-block .text-col p {
  color: var(--d1p-ink);
}
/* on-dark microlabel needs to read on light — flip both the text color
   AND the leading dash (::before pseudo) which was tinted white for the
   dark-story default. */
.plan-detailed-one-pager.d1p-brand-header .d1p-story-block .d1p-microlabel.on-dark {
  color: var(--brand-primary);
}
.plan-detailed-one-pager.d1p-brand-header .d1p-story-block .d1p-microlabel.on-dark::before {
  background: var(--brand-primary);
}
/* NW chart card in light story: switch divider + label colors */
.plan-detailed-one-pager.d1p-brand-header .d1p-story-block .d1p-nw-chart-head {
  border-bottom: 1px solid rgba(0,0,0,0.12);
}
.plan-detailed-one-pager.d1p-brand-header .d1p-story-block .d1p-nw-chart-title {
  color: var(--d1p-ink-muted);
}
.plan-detailed-one-pager.d1p-brand-header .d1p-story-block .d1p-nw-chart-meta {
  color: var(--d1p-ink-faint);
}

/* ─── KPI Section (light wash of brand-primary) ─── */
.plan-detailed-one-pager .d1p-kpi-section {
  background: var(--d1p-wash-primary, #f6f6f7);
  padding: 14px 44px;
  border-bottom: 1px solid var(--d1p-rule);
}
.plan-detailed-one-pager .d1p-kpi-strip {
  display: grid; grid-template-columns: repeat(5, 1fr);
  gap: 0;
}
.plan-detailed-one-pager .d1p-kpi-cell {
  padding: 6px 14px;
  /* Slightly darker than --d1p-rule (#e8e8e6) so the separators have a
     bit more presence between cells without dominating. */
  border-right: 1px solid #d0d0cd;
  text-align: center;
}
.plan-detailed-one-pager .d1p-kpi-cell:last-child { border-right: none; }
.plan-detailed-one-pager .d1p-kpi-value {
  font-family: 'DM Serif Display', serif;
  font-size: 22px; line-height: 1;
  color: var(--d1p-ink); margin-bottom: 3px;
}
.plan-detailed-one-pager .d1p-kpi-label {
  font-size: 9px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.14em; color: var(--d1p-ink-faint);
}

/* ─── Direction Row (Goals + Values) — vertical divider, white band ─── */
.plan-detailed-one-pager .d1p-direction-row {
  display: grid; grid-template-columns: 1.6fr 1fr;
  gap: 0; padding: 22px 44px;
  background: #fff;
  border-bottom: 1px solid var(--d1p-rule);
}
.plan-detailed-one-pager .d1p-direction-row > div:first-child {
  padding-right: 32px;
  border-right: 1px solid var(--d1p-rule);
}
.plan-detailed-one-pager .d1p-direction-row > div:last-child {
  padding-left: 32px;
}

/* Goals — bordered cards with brand-secondary left accent */
.plan-detailed-one-pager .d1p-goals-list { display: grid; gap: 7px; }
.plan-detailed-one-pager .d1p-goal-row {
  border: 1px solid var(--d1p-rule);
  border-left: 3px solid var(--brand-secondary);
  background: var(--d1p-card-bg);
  padding: 10px 13px;
  display: grid; grid-template-columns: 1fr auto;
  gap: 12px; align-items: start;
}
.plan-detailed-one-pager .d1p-goal-tier {
  font-size: 8px; font-weight: 700;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--d1p-ink-faint); margin-bottom: 3px;
}
.plan-detailed-one-pager .d1p-goal-text {
  font-size: 11.5px; font-weight: 600; color: var(--d1p-ink);
  margin-bottom: 3px; line-height: 1.3;
}
.plan-detailed-one-pager .d1p-goal-status {
  font-size: 8px; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; padding: 3px 7px;
  border-radius: 2px; white-space: nowrap; align-self: center;
}
.plan-detailed-one-pager .d1p-goal-status.on-track   { background: rgba(74,124,95,0.15);  color: var(--d1p-status-on); }
.plan-detailed-one-pager .d1p-goal-status.needs-work { background: rgba(201,134,58,0.15); color: var(--d1p-status-mid); }
.plan-detailed-one-pager .d1p-goal-status.off-target { background: rgba(160,80,80,0.15);  color: var(--d1p-status-off); }

/* Values — editorial italic serif with numbered prefix + brand divider */
.plan-detailed-one-pager .d1p-values-list {
  list-style: none; padding: 0; margin: 0;
  display: grid; gap: 0;
  counter-reset: value-counter;
}
.plan-detailed-one-pager .d1p-values-list li {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 10px;
  align-items: baseline;
  padding: 8px 0;
  border-bottom: 1px dashed var(--d1p-rule-values, #f4eedb);
  color: var(--d1p-ink);
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 16px; line-height: 1.2;
}
.plan-detailed-one-pager .d1p-values-list li:last-child { border-bottom: none; }
.plan-detailed-one-pager .d1p-values-list li::before {
  content: counter(value-counter, decimal-leading-zero);
  counter-increment: value-counter;
  font-family: 'DM Sans', sans-serif;
  font-size: 9px; font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--brand-secondary);
  align-self: center;
}

/* ─── Snapshot Section (NW bar + cash flow + 2 charts) ─── */
.plan-detailed-one-pager .d1p-snapshot-section {
  background: var(--d1p-wash-secondary, #fcf4dd);
  padding: 22px 44px;
  border-bottom: 1px solid var(--d1p-rule);
}

/* NW breakdown — full-width bar with in-segment labels */
.plan-detailed-one-pager .d1p-nw-breakdown {
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--d1p-rule);
}
.plan-detailed-one-pager .d1p-nw-breakdown .nw-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 10px;
}
/* Match .d1p-snap-head treatment as a peer subhead within Snapshot. */
.plan-detailed-one-pager .d1p-nw-breakdown .nw-title {
  font-size: 8.5px; font-weight: 700;
  letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--brand-primary);
}
.plan-detailed-one-pager .d1p-nw-breakdown .nw-total {
  font-family: 'DM Serif Display', serif;
  font-size: 18px; color: var(--d1p-ink);
}
.plan-detailed-one-pager .d1p-nw-bar {
  display: flex; height: 36px; border-radius: 3px; overflow: hidden;
  background: var(--d1p-rule);
  margin-bottom: 10px;
}
.plan-detailed-one-pager .d1p-nw-bar > .seg {
  height: 100%;
  display: flex; align-items: center; justify-content: center;
  flex-direction: column;
  color: #fff;
  font-size: 10.5px;
  line-height: 1.1;
  overflow: hidden;
  padding: 0 4px;
  text-align: center;
  box-sizing: border-box;
}
.plan-detailed-one-pager .d1p-nw-bar > .seg .seg-amt {
  font-family: 'DM Serif Display', serif;
  font-size: 12px;
}
.plan-detailed-one-pager .d1p-nw-bar > .seg .seg-pct {
  font-size: 9px;
  opacity: 0.85;
  letter-spacing: 0.08em;
}
.plan-detailed-one-pager .d1p-nw-bar > .seg.on-light { color: var(--d1p-ink); }
.plan-detailed-one-pager .d1p-nw-bar > .seg.narrow .seg-amt { font-size: 9.5px; }
.plan-detailed-one-pager .d1p-nw-bar > .seg.narrow .seg-pct { font-size: 8px; }
.plan-detailed-one-pager .d1p-nw-legend {
  display: flex; flex-wrap: wrap; gap: 14px;
  font-size: 10px;
}
.plan-detailed-one-pager .d1p-nw-legend .leg-row {
  display: flex; align-items: center; gap: 6px;
}
.plan-detailed-one-pager .d1p-nw-legend .leg-dot {
  display: inline-block; width: 9px; height: 9px;
  border-radius: 2px; flex-shrink: 0;
}
.plan-detailed-one-pager .d1p-nw-legend .leg-name {
  color: var(--d1p-ink-muted);
}

/* Snapshot 3-cell row (Allocation pie | Cash Flow | Location donut) */
.plan-detailed-one-pager .d1p-snapshot-row {
  display: grid; grid-template-columns: 1fr 1.2fr 1fr;
  gap: 22px;
  align-items: stretch;
}
.plan-detailed-one-pager .d1p-snap-cell { display: flex; flex-direction: column; }
.plan-detailed-one-pager .d1p-snap-head {
  font-size: 8.5px; font-weight: 700;
  letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--brand-primary); margin-bottom: 10px;
}

/* Cash flow */
.plan-detailed-one-pager .d1p-cf-block {
  background: var(--d1p-wash-cf, #faecc6);
  padding: 14px 18px;
  border-left: 3px solid var(--brand-secondary);
  flex: 1;
}
.plan-detailed-one-pager .d1p-cf-rows { display: grid; gap: 4px; }
.plan-detailed-one-pager .d1p-cf-row {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 11px; color: var(--d1p-ink-muted); padding: 3px 0;
}
.plan-detailed-one-pager .d1p-cf-row .cf-label { font-weight: 500; }
.plan-detailed-one-pager .d1p-cf-row .cf-value {
  font-family: 'DM Serif Display', serif;
  font-size: 13px; color: var(--d1p-ink);
}
.plan-detailed-one-pager .d1p-cf-row.minus .cf-value { color: var(--d1p-ink-muted); }
/* Intermediate sum (Surplus, before planned savings) — quieter than the
   final Extra Surplus row so the eye lands on the bottom line. */
.plan-detailed-one-pager .d1p-cf-row.subtotal {
  border-top: 1px solid var(--d1p-rule-cf-surplus, #e3d3a3);
  margin-top: 3px; padding-top: 6px;
}
.plan-detailed-one-pager .d1p-cf-row.subtotal .cf-label {
  font-size: 8px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.16em;
  color: var(--d1p-ink-muted);
}
.plan-detailed-one-pager .d1p-cf-row.subtotal .cf-value {
  font-size: 14px; color: var(--d1p-ink);
}
/* Final bottom-line (Remaining Surplus) — biggest serif treatment, brand green. */
.plan-detailed-one-pager .d1p-cf-row.surplus {
  border-top: 1px solid var(--d1p-rule-cf-surplus, #e3d3a3);
  margin-top: 4px; padding-top: 8px;
}
.plan-detailed-one-pager .d1p-cf-row.surplus .cf-label {
  font-size: 8.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.18em;
  color: var(--d1p-ink);
}
.plan-detailed-one-pager .d1p-cf-row.surplus .cf-value {
  font-size: 20px; color: var(--d1p-status-on);
}

/* Donut/pie cells — fixed chart size, legend bottom-anchored 2-col */
.plan-detailed-one-pager .d1p-donut-cell {
  background: var(--d1p-card-bg);
  border: 1px solid var(--d1p-rule);
  padding: 12px 14px;
  display: flex; flex-direction: column;
  flex: 1;
}
.plan-detailed-one-pager .d1p-donut-cell .canvas-wrap {
  position: relative;
  width: 120px; height: 120px;
  margin: 0 auto;
  flex-shrink: 0;
}
.plan-detailed-one-pager .d1p-donut-cell canvas { display: block; }
.plan-detailed-one-pager .d1p-donut-cell .donut-legend {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 14px;
  margin-top: auto;
  padding-top: 12px;
  font-size: 10px;
  color: var(--d1p-ink-muted);
}
.plan-detailed-one-pager .d1p-donut-cell .legend-row {
  display: flex; align-items: center;
}
.plan-detailed-one-pager .d1p-donut-cell .legend-name {
  display: flex; align-items: center; gap: 6px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.plan-detailed-one-pager .d1p-legend-dot {
  display: inline-block; width: 8px; height: 8px;
  border-radius: 2px; flex-shrink: 0;
}

/* ─── Action (Recommendations) — white ─── */
.plan-detailed-one-pager .d1p-recs-section {
  padding: 22px 44px;
  background: #fff;
  border-bottom: 1px solid var(--d1p-rule);
}
/* True masonry: cards are absolutely positioned by fitRecsGrid() in
   detailed-one-pager.js using a shortest-column algorithm. The container
   gets position:relative + an explicit height; cards get position:absolute
   + left/top set by JS. CSS just provides the card chrome — no grid,
   no columns. This is the only layout model that achieves zero-gap
   Pinterest-style packing when card heights vary. */
.plan-detailed-one-pager .d1p-recs-mosaic {
  position: relative; /* anchor for absolutely-positioned cards */
  /* height + child positions set by JS */
}
/* Combined-mode wrapper — no positioning, just lets the .d1p-rec-combined
   inside do its own 2-col flex layout. */
.plan-detailed-one-pager .d1p-recs-list {
  display: block;
}
/* Boxed cards: white bg, thin border, brand-secondary left accent. JS sets
   position/left/top/width inline; everything else lives here. */
.plan-detailed-one-pager .d1p-rec-card {
  background: var(--d1p-card-bg);
  border: 1px solid var(--d1p-rule);
  border-left: 3px solid var(--brand-secondary);
  padding: 9px 12px 8px;
  display: block;
}
/* Title sits flush against bullets — the brand-color left accent and the
   serif weight of the title give enough separation without an extra rule. */
.plan-detailed-one-pager .d1p-rec-title {
  font-family: 'DM Serif Display', serif;
  font-size: 13.5px;
  line-height: 1.1;
  color: var(--d1p-ink);
  letter-spacing: -0.2px;
  margin-bottom: 6px;
}
.plan-detailed-one-pager .d1p-rec-list {
  list-style: none; display: grid; gap: 3px; padding: 0; margin: 0;
}
.plan-detailed-one-pager .d1p-rec-list li {
  font-size: 10.5px; line-height: 1.4; color: var(--d1p-ink);
  padding-left: 12px; position: relative;
}
.plan-detailed-one-pager .d1p-rec-list li::before {
  content: '→'; position: absolute; left: 0; top: 0;
  color: var(--brand-secondary); font-weight: 700; font-size: 11px;
}
/* Subsection heading inside a rec card: rendered when the textarea uses
   '## Subhead' lines to split bullets into logical sub-groups. Sits
   between bullets, not above. Same treatment as the Two-Pager subhead. */
.plan-detailed-one-pager .d1p-rec-subhead {
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--d1p-ink-muted, #555);
  padding-top: 4px;
  margin-top: 2px;
  border-top: 1px solid var(--d1p-rule, #e8e8e6);
}
/* First subhead (no bullets above) sits flush under the card title. */
.plan-detailed-one-pager .d1p-rec-subhead:first-of-type {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}
.plan-detailed-one-pager .d1p-rec-list-sub { margin-top: -2px; }
/* Sub-bullets nested under a main bullet (Tab indentation in textarea) */
.plan-detailed-one-pager .d1p-rec-list-subs {
  list-style: none;
  display: grid;
  gap: 2px;
  padding: 3px 0 0 12px;
  margin: 2px 0 3px 0;
}
.plan-detailed-one-pager .d1p-rec-list-subs li {
  font-size: 10px;
  line-height: 1.4;
  color: var(--d1p-ink-muted, #555);
  padding-left: 11px;
  position: relative;
}
.plan-detailed-one-pager .d1p-rec-list-subs li::before {
  content: '·';
  position: absolute;
  left: 0; top: -3px;
  color: var(--brand-secondary);
  font-weight: 700;
  font-size: 16px;
  line-height: 1;
}
/* Combined recs: 2-column flat list (no area cards). Bullets get the same
   → arrow + brand-secondary styling as in area cards (same .d1p-rec-list
   class), so the visual character stays consistent across both layouts. */
.plan-detailed-one-pager .d1p-rec-combined {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 36px;
  row-gap: 0;
}
.plan-detailed-one-pager .d1p-rec-combined .d1p-rec-list {
  gap: 5px;  /* slightly looser than the in-card version since there's no
                title pulling the eye into each card */
}
.plan-detailed-one-pager .d1p-rec-combined .d1p-rec-list li {
  font-size: 11px;
  line-height: 1.45;
  padding-left: 14px;
}
.plan-detailed-one-pager .d1p-rec-combined .d1p-rec-list li::before {
  font-size: 11.5px;
}
.plan-detailed-one-pager .d1p-rec-combined .d1p-rec-list li {
  font-size: 11px; line-height: 1.5;
  padding: 4px 0 4px 14px;
  border-bottom: 1px solid var(--d1p-rule);
}
.plan-detailed-one-pager .d1p-rec-combined .d1p-rec-list li:last-child { border-bottom: none; }

/* ─── Completed Last Year — items are pill-cards that fill the band ─── */
.plan-detailed-one-pager .d1p-completed-section {
  padding: 22px 44px;
  background: var(--d1p-wash-primary, #f6f6f7);
  border-bottom: 1px solid var(--d1p-rule);
}
/* Completed items deliberately do NOT use the card chrome that the recs
   above use (white box + brand-secondary left accent). That would make
   the two sections feel like the same thing twice. Instead these are a
   tidy multi-column list: green checkmark, subtle strikethrough, no
   borders or backgrounds. Reads as a "wins list," visually distinct
   from the "action items" above. */
.plan-detailed-one-pager .d1p-completed-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* JS auto-fits 1-4 cols */
  column-gap: 28px;
  row-gap: 6px;
}
.plan-detailed-one-pager .d1p-completed-grid .item {
  font-size: 11.5px;
  line-height: 1.4;
  color: var(--d1p-ink-muted);
  padding: 4px 0 4px 20px;
  position: relative;
  display: flex;
  align-items: center;
  /* very subtle strikethrough — barely visible but signals "done" */
  text-decoration: line-through;
  text-decoration-color: rgba(0, 0, 0, 0.18);
  text-decoration-thickness: 1px;
}
.plan-detailed-one-pager .d1p-completed-grid .item + .item {
  /* No row separator — the strikethrough + checkmark is enough. */
}
.plan-detailed-one-pager .d1p-completed-grid .item::before {
  content: '✓';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  color: var(--d1p-status-on);
  font-weight: 700;
  font-size: 12px;
  text-decoration: none;
}

/* ─── Disclosure (only renders when 'Include compliance disclosure' is on) ─── */
.plan-detailed-one-pager .d1p-disclosure-section {
  padding: 14px 44px 18px;
  background: #fff;
  border-bottom: 1px solid var(--d1p-rule);
}
.plan-detailed-one-pager .d1p-disclosure-label {
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--d1p-ink-faint);
  margin-bottom: 6px;
}
.plan-detailed-one-pager .d1p-disclosure-body {
  font-size: 9.5px;
  line-height: 1.6;
  color: var(--d1p-ink-muted);
}

/* ─── Footer — brand-primary band ─── */
.plan-detailed-one-pager .d1p-footer {
  background: var(--brand-primary);
  padding: 14px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}
.plan-detailed-one-pager .d1p-footer .footer-firm     { color: var(--on-brand-primary-muted, rgba(255,255,255,0.65)); }
.plan-detailed-one-pager .d1p-footer .footer-prepared { color: var(--on-brand-primary-muted, rgba(255,255,255,0.5)); }

/* ════════════════════════════════════════════════════════════════════════
   FORM-FIELD VISIBILITY (toggled by body class set in setOpFormat)
══════════════════════════════════════════════════════════════════════════ */
body.format-one-pager       .d1p-form-only,
body.format-detailed-one-pager .d1p-not-in-detailed,
body.format-two-pager       .d1p-not-in-detailed,
body.format-comprehensive   .d1p-not-in-detailed,
body.format-one-pager       .tp-form-only,
body.format-detailed-one-pager .tp-form-only,
body.format-one-pager       .comp-form-only,
body.format-detailed-one-pager .comp-form-only,
body.format-two-pager       .comp-form-only { display: none; }
body.format-detailed-one-pager .d1p-form-only,
body.format-two-pager       .d1p-form-only,
body.format-two-pager       .tp-form-only,
body.format-comprehensive   .d1p-form-only,
body.format-comprehensive   .tp-form-only,
body.format-comprehensive   .comp-form-only { display: block; }
body.format-detailed-one-pager .d1p-form-only.row,
body.format-two-pager       .d1p-form-only.row,
body.format-two-pager       .tp-form-only.row,
body.format-comprehensive   .d1p-form-only.row,
body.format-comprehensive   .tp-form-only.row { display: grid; }
/* d1p-detailed-only: shown only when the active format is Detailed.
   Selector specificity here (body.cls + 2 classes) beats the more general
   d1p-form-only show rule above (body.cls + 1 class). */
body.format-one-pager       .d1p-detailed-only,
body.format-two-pager       .d1p-form-only.d1p-detailed-only,
body.format-two-pager       .d1p-detailed-only,
body.format-comprehensive   .d1p-form-only.d1p-detailed-only,
body.format-comprehensive   .d1p-detailed-only { display: none; }

/* Format selector. Two visual zones with no labels:
   - .format-pill-group on the left: Standard, Detailed, Two-Pager
     (segmented toggle in a grey track — share this builder, instant swap)
   - .format-pill-nav on the right: Full Plan (no track, outlined,
     trailing arrow → signals it routes to a different builder screen)
   The bar itself is just the row layout. */
.format-pill-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}
.format-pill-group {
  flex: 1;
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--grey, #f5f5f3);
  border-radius: 8px;
  min-width: 0;
}
.format-pill-group .format-pill { flex: 1; }
.format-pill {
  padding: 9px 12px;
  border: none;
  background: transparent;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #888;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: all 0.15s;
}
.format-pill:hover { color: #333; }
.format-pill.active {
  background: var(--app-navy, #0e0e0e);
  color: white;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}
/* Full Plan — visually distinct from the segmented group, signals it
   takes you to a different builder screen, not just a format swap. */
.format-pill-nav {
  flex-shrink: 0;
  padding: 9px 16px;
  background: transparent;
  border: 1px solid #d0d0cd;
  border-radius: 8px;
  color: var(--app-slate, #555);
}
.format-pill-nav:hover {
  border-color: var(--app-navy, #0e0e0e);
  color: var(--app-navy, #0e0e0e);
}
.format-pill-nav.active {
  background: var(--app-navy, #0e0e0e);
  border-color: var(--app-navy, #0e0e0e);
  color: #fff;
}
.format-pill-nav span {
  margin-left: 4px;
  opacity: 0.7;
  font-weight: 400;
}
