/* ─────────────────────────────────────────────────────────────────────────
   RTS section-demos — shared styles
   Design tokens mirror RTS Presentation.zip (Manrope / JetBrains Mono,
   bone palette, coral/sun accents). Magenta is reserved for placeholder
   values shown in lieu of confirmed inputs.
   ───────────────────────────────────────────────────────────────────── */

:root {
  --bone:        #F3EFE6;
  --bone-2:      #EAE4D6;
  --paper:       #FBF8F1;
  --ink:         #1B1D20;
  --ink-2:       #2A2D32;
  --ink-soft:    #3C4046;
  --pebble:      #6C6256;
  --pebble-2:    #968A78;
  --hairline:    rgba(27, 29, 32, 0.16);
  --hairline-soft: rgba(27, 29, 32, 0.08);
  --coral:       #C84A3A;
  --sun:         #E5B935;
  --moss:        #8A8E3C;
  --sky:         #6FA5A7;
  --accent:      var(--coral);

  /* Placeholder color — used for any value derived from unconfirmed inputs.
     Distinct from coral so placeholder ≠ accent. */
  --placeholder: #d6336c;
  --placeholder-soft: rgba(214, 51, 108, 0.08);

  --font-display: "Manrope", "Helvetica Neue", system-ui, sans-serif;
  --font-body:    "Manrope", "Helvetica Neue", system-ui, sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bone);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; }

/* ─── Layout shell ────────────────────────────────────────────────────── */

.page {
  width: min(1480px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 64px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--pebble);
}

.topbar a {
  text-decoration: none;
  border-bottom: 1px solid var(--hairline);
}

/* ─── Typography ─────────────────────────────────────────────────────── */

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--pebble);
}

.display-h1 {
  margin: 6px 0 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(36px, 4.4vw, 64px);
  line-height: 1.02;
  letter-spacing: -0.025em;
}

.display-h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(22px, 2.4vw, 36px);
  line-height: 1.1;
  letter-spacing: -0.015em;
}

.mono { font-family: var(--font-mono); font-feature-settings: "tnum"; }
.num  { font-family: var(--font-display); font-weight: 700; font-feature-settings: "tnum"; letter-spacing: -0.015em; }

/* The Knot brand — formal name kept on one line. Use:
   <span class="knot-brand">The Knot — Climbing Gym</span> */
.knot-brand { white-space: nowrap; }

/* ─── Page section: 07 financial model summary ────────────────────────── */

.financial-model-root {
  display: grid;
  gap: 28px;
}

.fm-hero {
  border-top: 2px solid var(--ink);
  padding-top: 22px;
  display: grid;
  gap: 18px;
}

.fm-lede {
  margin: 0;
  max-width: 920px;
  font-size: clamp(16px, 1.5vw, 19px);
  line-height: 1.42;
  color: var(--ink-2);
}

.fm-snapshot {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
}

.fm-snap-cell {
  padding: 18px 18px 18px 0;
  border-right: 1px solid var(--hairline-soft);
  display: grid;
  align-content: space-between;
  gap: 14px;
  min-height: 140px;
}

.fm-snap-cell + .fm-snap-cell { padding-left: 18px; }

.fm-snap-cell:nth-child(4n) { border-right: 0; }

.fm-snap-cell:nth-child(n + 5) {
  border-top: 1px solid var(--hairline-soft);
}

.fm-snap-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--pebble);
}

.fm-snap-value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(26px, 3.2vw, 44px);
  letter-spacing: -0.02em;
  line-height: 0.98;
  font-variant-numeric: tabular-nums;
}

.fm-snap-caption {
  font-size: 13px;
  color: var(--pebble);
  line-height: 1.35;
}

.fm-block {
  display: grid;
  gap: 14px;
}

.fm-block-head {
  margin: 0;
  padding-top: 18px;
  border-top: 1px solid var(--hairline);
}

.fm-block-lede {
  margin: 0;
  max-width: 980px;
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink-soft);
}

.fm-two-col {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 28px;
  align-items: start;
}

.fm-card {
  border-top: 1px solid var(--ink);
  padding-top: 12px;
  background: transparent;
}

.fm-card-title {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--pebble);
  margin-bottom: 10px;
}

.fm-t {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 13px;
}

.fm-t th, .fm-t td {
  padding: 9px 12px 9px 0;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--hairline-soft);
}

.fm-t th {
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--pebble);
  font-weight: 500;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 10px;
}

.fm-t td.num, .fm-t th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.fm-t .fm-total td {
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  padding-top: 10px;
  padding-bottom: 10px;
}

.fm-t .fm-gap td {
  padding-top: 8px;
  padding-bottom: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--pebble);
  border-bottom: 0;
}

.fm-t .fm-gap td.num {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  color: var(--pebble);
}

.fm-t .fm-gap-shortfall, .fm-t td.fm-gap-shortfall {
  color: var(--coral);
}

.fm-t .fm-gap-surplus, .fm-t td.fm-gap-surplus {
  color: var(--moss);
}

.fm-returns-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
}

.fm-return-cell {
  padding: 18px 18px 18px 0;
  border-right: 1px solid var(--hairline-soft);
  display: grid;
  align-content: space-between;
  gap: 12px;
  min-height: 130px;
}

.fm-return-cell + .fm-return-cell { padding-left: 18px; }
.fm-return-cell:nth-child(3n) { border-right: 0; }
.fm-return-cell:nth-child(n + 4) { border-top: 1px solid var(--hairline-soft); }

.fm-return-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--pebble);
}

.fm-return-value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(28px, 3.2vw, 44px);
  letter-spacing: -0.02em;
  line-height: 0.98;
  font-variant-numeric: tabular-nums;
}

.fm-return-caption {
  font-size: 13px;
  color: var(--pebble);
  line-height: 1.35;
}

.fm-cta {
  display: inline-block;
  margin-top: 6px;
  padding: 12px 22px;
  border: 1.5px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
}

.fm-cta:hover {
  background: var(--coral);
  border-color: var(--coral);
}

/* ─── Placeholder treatment ──────────────────────────────────────────── */

.ph-placeholder .fm-snap-value,
.ph-placeholder .fm-return-value,
.fm-snap-cell.ph-placeholder .fm-snap-value,
.fm-return-cell.ph-placeholder .fm-return-value,
.ph-cell {
  color: var(--placeholder);
}

.ph-legend {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--pebble);
  letter-spacing: 0.02em;
}

.ph-swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  background: var(--placeholder);
  border-radius: 2px;
}

/* ─── Inputs drawer (used on 07 and 04) ──────────────────────────────── */

.ph-drawer {
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  padding: 0;
  margin-top: 8px;
}

.ph-drawer > summary {
  list-style: none;
  cursor: pointer;
  padding: 16px 4px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink);
  letter-spacing: 0.02em;
}

.ph-drawer > summary::-webkit-details-marker { display: none; }

.ph-drawer-icon {
  display: inline-block;
  width: 18px;
  text-align: center;
  font-size: 14px;
  color: var(--pebble);
  transition: transform 140ms ease;
}

.ph-drawer[open] .ph-drawer-icon {
  transform: rotate(180deg);
}

.ph-drawer > summary strong {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--ink);
}

.ph-drawer-body {
  padding: 8px 0 22px;
  display: grid;
  gap: 22px;
}

.ph-drawer-group-head {
  margin: 4px 0 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--pebble);
}

.ph-drawer-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 12.5px;
}

.ph-drawer-table th, .ph-drawer-table td {
  padding: 9px 14px 9px 0;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--hairline-soft);
}

.ph-drawer-table th {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--pebble);
  font-weight: 500;
  border-bottom: 1px solid var(--ink);
}

.ph-input-label { color: var(--ink); }
.ph-input-unit, .ph-input-val, .ph-input-drives { color: var(--ink-soft); }
.ph-input-val { color: var(--placeholder); }

/* ─── 04 worksheet page styles ───────────────────────────────────────── */

.pf-header {
  border-top: 2px solid var(--ink);
  padding-top: 22px;
  margin-bottom: 22px;
  display: grid;
  gap: 18px;
}

.pf-lede {
  margin: 0;
  max-width: 1080px;
  font-size: clamp(15px, 1.4vw, 18px);
  line-height: 1.42;
  color: var(--ink-2);
}

.pf-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  border-top: 1px solid var(--hairline);
  border-bottom: 1.5px solid var(--ink);
  margin-top: 4px;
}

.pf-tab {
  appearance: none;
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 14px 18px 12px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.005em;
  color: var(--pebble);
  cursor: pointer;
  white-space: nowrap;
  margin-bottom: -1.5px;
}

.pf-tab:hover { color: var(--ink); }

.pf-tab[aria-selected="true"] {
  color: var(--ink);
  border-bottom-color: var(--coral);
}

/* Horizon switcher: Annual 10Y vs Monthly 1Y / 3Y / 10Y */
.pf-view-switch-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  padding: 14px 0 18px;
  border-bottom: 1px solid var(--hairline);
}

.pf-view-switch-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--pebble);
}

.pf-view-switch {
  display: inline-flex;
  border: 1px solid var(--ink);
  border-radius: 2px;
  overflow: hidden;
}

.pf-view-btn {
  appearance: none;
  background: transparent;
  border: 0;
  border-right: 1px solid var(--hairline);
  padding: 8px 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease;
}

.pf-view-btn:last-child { border-right: 0; }
.pf-view-btn:hover { background: var(--bone-2); color: var(--ink); }

.pf-view-btn[aria-pressed="true"] {
  background: var(--ink);
  color: var(--bone);
}

.pf-view-hint {
  font-size: 11px;
  color: var(--pebble);
  letter-spacing: 0.01em;
  margin-left: 18px;
}

@media (max-width: 700px) {
  .pf-view-hint { margin-left: 0; flex-basis: 100%; }
}

/* ─── Renderings gallery ──────────────────────────────────────────────── */

.gx-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.gx-cell {
  position: relative;
  margin: 0;
  background: var(--bone-2);
  overflow: hidden;
  border: 1px solid var(--hairline);
  aspect-ratio: 16 / 10;
}

.gx-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 240ms ease;
}

.gx-cell:hover .gx-img { transform: scale(1.02); }

.gx-cap {
  position: absolute;
  left: 8px;
  bottom: 8px;
  right: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  background: rgba(27, 29, 32, 0.78);
  color: var(--bone);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}

.gx-ix {
  font-weight: 600;
  color: var(--sun);
}

.gx-cap-text {
  flex: 1 1 auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gx-cap-tag {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(243, 239, 230, 0.7);
  white-space: nowrap;
}

.gx-count {
  display: inline-block;
  margin-left: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  color: var(--pebble);
  letter-spacing: 0.05em;
  text-transform: none;
}

.gx-cell a {
  display: block;
  width: 100%;
  height: 100%;
  text-decoration: none;
  color: inherit;
}

.gx-pdf-link {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--coral);
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.gx-pdf-link:hover { color: var(--ink); }

@media (max-width: 880px) {
  .gx-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .gx-grid { grid-template-columns: 1fr; }
}

/* ─── Executive Summary beats ─────────────────────────────────────────── */

.exec-beats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}

.exec-beat {
  padding: 22px 22px 24px 0;
  border-right: 1px solid var(--hairline-soft);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.exec-beat + .exec-beat { padding-left: 22px; }
.exec-beat:last-child { border-right: 0; }

.exec-beat-ix {
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--pebble);
}

.exec-beat-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(20px, 2.1vw, 28px);
  line-height: 1.1;
  letter-spacing: -0.015em;
}

.exec-beat-copy {
  margin: 0;
  color: var(--ink-2);
  font-size: 15px;
  line-height: 1.45;
}

@media (max-width: 760px) {
  .exec-beats { grid-template-columns: 1fr; }
  .exec-beat, .exec-beat + .exec-beat {
    padding-left: 0;
    padding-right: 0;
    border-right: 0;
    border-bottom: 1px solid var(--hairline-soft);
  }
  .exec-beat:last-child { border-bottom: 0; }
}

/* ─── Timeline Gantt + milestone list (ported from design zip) ────────── */

.gantt {
  position: relative;
  margin-top: 4px;
  padding: 12px 0 28px;
}
.gantt-bars {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  z-index: 2;
}
.gantt-row {
  display: grid;
  grid-template-columns: minmax(140px, 220px) 1fr;
  gap: 16px;
  align-items: center;
}
.gantt-row-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--pebble);
}
.gantt-row-track {
  position: relative;
  height: 28px;
  background:
    linear-gradient(to right, var(--hairline-soft) 1px, transparent 1px) 0 0 / calc(100% / 12) 100%;
}
.gantt-bar {
  position: absolute;
  top: 5px;
  height: 18px;
  border-radius: 2px;
  display: flex;
  align-items: center;
  padding: 0 10px;
  color: var(--ink);
  min-width: 8px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gantt-anchors {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 56px;
  margin-left: calc(140px + 16px);
  pointer-events: none;
  z-index: 1;
}
@media (min-width: 760px) {
  .gantt-anchors { margin-left: calc(220px + 16px); }
}
.gantt-anchor {
  position: absolute;
  top: 0;
  bottom: 0;
  transform: translateX(-50%);
  width: 1px;
  background: repeating-linear-gradient(to bottom, var(--coral) 0 4px, transparent 4px 8px);
  opacity: 0.55;
}
.gantt-anchor::before {
  content: "";
  position: absolute;
  top: -7px;
  left: 50%;
  width: 11px;
  height: 11px;
  background: var(--coral);
  transform: translateX(-50%) rotate(45deg);
}
.gantt-axis {
  position: relative;
  height: 20px;
  margin-left: calc(140px + 16px);
  margin-top: 24px;
  border-top: 1px solid var(--ink);
}
@media (min-width: 760px) {
  .gantt-axis { margin-left: calc(220px + 16px); }
}
.gantt-year {
  position: absolute;
  top: 6px;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--pebble);
  letter-spacing: 0.07em;
}
.gantt-year::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -8px;
  width: 1px;
  height: 6px;
  background: var(--ink);
}

.gantt-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--hairline-soft);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--pebble);
  letter-spacing: 0.04em;
}
.gantt-legend-key {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.gantt-legend-swatch {
  display: inline-block;
  width: 14px;
  height: 8px;
  border-radius: 2px;
}

/* Milestone list */
.milestones {
  display: flex;
  flex-direction: column;
}
.milestones .ms-row {
  display: grid;
  grid-template-columns: 130px 24px 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 13px 0;
  border-bottom: 1px solid var(--hairline-soft);
}
.milestones .ms-row:last-child { border-bottom: 0; }
.milestones .ms-date {
  color: var(--pebble);
  font-family: var(--font-mono);
  font-size: 13px;
}
.milestones .ms-marker {
  display: flex;
  justify-content: center;
}
.milestones .ms-dot {
  width: 6px;
  height: 6px;
  background: var(--pebble-2);
  border-radius: 999px;
  display: inline-block;
}
.milestones .ms-diamond {
  width: 10px;
  height: 10px;
  background: var(--coral);
  display: inline-block;
  transform: rotate(45deg);
}
.milestones .ms-label {
  font-size: 15px;
  color: var(--ink);
}
.milestones .ms-note {
  margin-left: 10px;
  font-size: 12px;
  color: var(--pebble);
}
.milestones .ms-phase {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--pebble);
}
.milestones .ms-row.ms-anchor .ms-date {
  color: var(--coral);
  font-weight: 600;
}
.milestones .ms-row.ms-anchor .ms-label { font-weight: 700; }

@media (max-width: 720px) {
  .milestones .ms-row { grid-template-columns: 100px 18px 1fr; }
  .milestones .ms-phase { display: none; }
  .gantt-row { grid-template-columns: 110px 1fr; gap: 12px; }
  .gantt-anchors, .gantt-axis { margin-left: calc(110px + 12px); }
}

/* Mode toggle (Interactive ⇄ Print view).
   Hidden by default — the canonical PDF path is `npm run pdf`, which programmatically
   toggles print mode under headless Chromium. Setting display:none keeps the JS
   wiring (click handler, render functions) intact for the print script. */
.pf-mode-toggle { display: none; margin-left: auto; }

.pf-mode-btn {
  appearance: none;
  background: var(--ink);
  color: var(--bone);
  border: 1.5px solid var(--ink);
  padding: 9px 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
}

.pf-mode-btn:hover {
  background: var(--coral);
  border-color: var(--coral);
}

.pf-mode-btn[aria-pressed="true"] {
  background: var(--coral);
  border-color: var(--coral);
}

/* ─── Print preview (screen view of the print layout) ─────────────────── */

.pf-print-shell {
  display: grid;
  gap: 28px;
  margin-top: 18px;
}

.pf-print-shell[hidden] { display: none; }

.pf-print-section {
  background: var(--paper);
  border: 1px solid var(--hairline);
  padding: 0.45in;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
}

/* Screen approximation of letter landscape (11" × 8.5") and tabloid landscape (17" × 11") */
.pf-print-section.pf-paper-letter  { aspect-ratio: 11 / 8.5; }
.pf-print-section.pf-paper-tabloid { aspect-ratio: 17 / 11; }

.pf-print-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: end;
  border-bottom: 1.5px solid var(--ink);
  padding-bottom: 12px;
  margin-bottom: 18px;
}

.pf-print-title {
  margin: 4px 0 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 24px;
  letter-spacing: -0.015em;
  line-height: 1.05;
}

.pf-print-meta {
  margin-top: 4px;
  font-size: 11px;
  color: var(--pebble);
  letter-spacing: 0.04em;
}

.pf-print-head-right {
  text-align: right;
  font-size: 11px;
  color: var(--pebble);
}

.pf-print-pageno { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }
.pf-print-date   { font-size: 11px; margin-top: 4px; }

.pf-print-table-wrap {
  overflow-x: auto;
}

.pf-print-table {
  font-size: 10px;
}

.pf-print-table th { font-size: 9.5px; padding: 6px 7px; }
.pf-print-table td { padding: 5px 7px; font-size: 10px; }
.pf-print-section.pf-paper-tabloid .pf-print-table { font-size: 9.5px; }
.pf-print-section.pf-paper-tabloid .pf-print-table td { padding: 4px 5px; }
.pf-print-section.pf-paper-tabloid .pf-print-table th { padding: 5px 5px; font-size: 9px; }

.pf-print-appendix-group + .pf-print-appendix-group { margin-top: 22px; }

.pf-print-appendix-head {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -0.01em;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 4px;
}

.pf-print-appendix .ph-drawer-table { font-size: 11px; }

/* ─── @media print: actual paper output ───────────────────────────────── */

/* Named page rules — mixed letter + tabloid in one PDF.
   Modern Chromium honors per-section paper size when "Default" is selected
   in the print dialog. Other browsers may collapse to a single size. */
@page letter-page  { size: letter landscape;   margin: 0.5in; }
@page tabloid-page { size: 11in 17in landscape; margin: 0.5in; }

@media print {
  /* Strip page chrome */
  .topbar, .pf-header, .pf-view-switch-bar, #worksheet, #inputsDrawer,
  .pf-tabs, .pf-view-switch, .pf-mode-toggle, .pf-view-hint { display: none !important; }

  body {
    background: #fff !important;
    color: var(--ink);
  }

  main.page { width: auto; max-width: none; padding: 0; margin: 0; }

  .pf-print-shell { display: block !important; gap: 0; margin: 0; }
  .pf-print-shell[hidden] { display: block !important; } /* allow print even if toggle off */

  .pf-print-section {
    border: 0;
    box-shadow: none;
    background: #fff;
    padding: 0;
    margin: 0;
    aspect-ratio: auto;
    page-break-after: always;
    break-after: page;
  }

  .pf-print-section:last-child { page-break-after: auto; break-after: auto; }

  .pf-print-section.pf-paper-letter  { page: letter-page; }
  .pf-print-section.pf-paper-tabloid { page: tabloid-page; }

  /* Tighten table rendering for paper */
  .pf-print-table { font-size: 8.5pt; }
  .pf-print-section.pf-paper-tabloid .pf-print-table { font-size: 8pt; }
  .pf-print-table th, .pf-print-table td { padding: 3px 5px; }

  /* Backgrounds — keep magenta and NOI coral, drop bone */
  tr.pf-group td {
    background: var(--ink) !important;
    color: #fff !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  tr.pf-noi td {
    background: rgba(200, 74, 58, 0.08) !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .pf-cell-placeholder, .ph-cell, .ph-input-val,
  .ph-placeholder .fm-snap-value, .ph-placeholder .fm-return-value {
    color: #d6336c !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  /* Don't break individual sections internally if avoidable */
  .pf-print-table tr, .pf-print-appendix-group { break-inside: avoid; page-break-inside: avoid; }
}

/* While in screen print-mode, push the visible page width wider so it doesn't squash */
body.is-print-mode main.page { width: min(1640px, calc(100vw - 32px)); }
body.is-print-mode .pf-print-shell { margin-top: 6px; }

.pf-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid var(--hairline);
  margin-bottom: 18px;
}

.pf-meta-cell {
  padding: 14px 16px 14px 0;
  border-right: 1px solid var(--hairline-soft);
}

.pf-meta-cell + .pf-meta-cell { padding-left: 16px; }
.pf-meta-cell:last-child { border-right: 0; }

.pf-meta-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--pebble);
}

.pf-meta-value {
  margin-top: 5px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  line-height: 1.25;
}

.pf-table-shell {
  border-top: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
}

.pf-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  cursor: grab;
  scrollbar-width: thin;
  scrollbar-color: var(--ink) var(--bone-2);
}

.pf-scroll.is-grabbing {
  cursor: grabbing;
  user-select: none;
}

.pf-scroll.is-grabbing * { user-select: none; }

/* On-brand horizontal scrollbar — sits inside the bone palette */
.pf-scroll::-webkit-scrollbar {
  height: 12px;
  background: var(--bone-2);
}

.pf-scroll::-webkit-scrollbar-track {
  background: var(--bone-2);
  border-top: 1px solid var(--hairline-soft);
}

.pf-scroll::-webkit-scrollbar-thumb {
  background: var(--ink);
  border: 3px solid var(--bone-2);
  border-radius: 6px;
  min-width: 60px;
}

.pf-scroll::-webkit-scrollbar-thumb:hover {
  background: var(--coral);
}

.pf-scroll::-webkit-scrollbar-thumb:active {
  background: var(--coral);
}

table.pf-table {
  border-collapse: collapse;
  width: 100%;
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}

table.pf-table th, table.pf-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--hairline-soft);
  vertical-align: baseline;
  white-space: nowrap;
}

table.pf-table th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--pebble);
  text-align: left;
  font-weight: 500;
  background: var(--bone);
  position: sticky;
  top: 0;
  z-index: 2;
}

table.pf-table th.num { text-align: right; }

table.pf-table .pf-th-label { min-width: 280px; max-width: 360px; }
table.pf-table .pf-th-note  { min-width: 130px; max-width: 170px; }

table.pf-table .pf-label {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--bone);
  min-width: 280px;
  max-width: 360px;
  white-space: normal;
}

table.pf-table th:first-child { z-index: 3; }

table.pf-table td.num { text-align: right; }

table.pf-table .pf-note {
  color: var(--pebble);
  min-width: 130px;
  max-width: 170px;
  white-space: normal;
  font-size: 11px;
}

.pf-note-text { display: inline; color: var(--pebble); }
.pf-unit { color: var(--pebble); }

tr.pf-group td {
  background: var(--ink);
  color: var(--bone);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  padding-top: 9px;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--ink);
}

tr.pf-group td.pf-label,
tr.pf-group td:first-child {
  background: var(--ink);
  color: var(--bone);
}

tr.pf-driver td { color: var(--ink-soft); }

tr.pf-revenue td.num,
tr.pf-line td.num {
  font-family: var(--font-mono);
}

tr.pf-total td {
  border-top: 1.5px solid var(--ink);
  border-bottom: 1.5px solid var(--ink);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13.5px;
  letter-spacing: -0.005em;
  padding-top: 10px;
  padding-bottom: 10px;
}

tr.pf-total td:first-child {
  background: var(--bone);
}

tr.pf-noi td {
  border-top: 1.5px solid var(--coral);
  border-bottom: 1.5px solid var(--coral);
  background: rgba(200, 74, 58, 0.06);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  padding-top: 11px;
  padding-bottom: 11px;
}

tr.pf-noi td:first-child {
  background: rgba(200, 74, 58, 0.06);
}

tr.pf-expense td.num { color: var(--ink-soft); }

.pf-dash { color: rgba(27, 29, 32, 0.32); }

/* Placeholder cell coloring — applied via row class + cell class */
tr.pf-placeholder td.num.pf-cell-placeholder { color: var(--placeholder); }
tr.pf-placeholder.pf-noi td.num.pf-cell-placeholder { color: var(--placeholder); }
tr.pf-placeholder.pf-total td.num.pf-cell-placeholder { color: var(--placeholder); }

.error-text {
  color: var(--coral);
  font-family: var(--font-mono);
  padding: 14px 0;
}

/* ─── Index page / section-shell used by simple demos ────────────────── */

.section-shell {
  min-height: calc(100vh - 64px);
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 24px;
}

.section-header {
  border-top: 2px solid var(--ink);
  padding-top: 22px;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 0.55fr);
  gap: 32px;
  align-items: end;
}

.section-kicker {
  font-size: clamp(16px, 1.5vw, 22px);
  line-height: 1.2;
  font-weight: 600;
  color: var(--ink-2);
}

/* ─── Page section: 03 site & location ────────────────────────────────── */

.site-split {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 24px;
  align-items: stretch;
}

.parcel-map-h {
  margin: 4px 0 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(22px, 2.2vw, 30px);
  line-height: 1.04;
  letter-spacing: -0.018em;
}

.parcel-map-demo {
  min-height: 460px;
  padding: 18px;
  border: 1px solid var(--hairline);
  background: var(--paper);
  display: grid;
  grid-template-rows: auto minmax(280px, 1fr) auto auto;
  gap: 14px;
}

.parcel-map-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 16px;
}

.parcel-map-count {
  font-size: 12px;
  color: var(--pebble);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.parcel-map-canvas {
  min-height: 280px;
  border: 1px solid var(--hairline-soft);
  background: var(--bone-2);
  overflow: hidden;
}

.parcel-map-canvas svg {
  width: 100%;
  height: 100%;
  min-height: 280px;
  display: block;
}

.map-road {
  fill: none;
  stroke: rgba(27, 29, 32, 0.22);
  stroke-width: 15;
  stroke-linecap: round;
}

.map-road.major { stroke-width: 20; }

.map-road-label,
.map-place-label,
.parcel-label {
  font-family: var(--font-mono);
  font-size: 12px;
  fill: rgba(27, 29, 32, 0.58);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.map-place-label { font-size: 12px; fill: var(--ink); }
.map-place-label.muted { fill: var(--pebble); }

.parcel-shape {
  fill: rgba(200, 74, 58, 0.16);
  stroke: rgba(27, 29, 32, 0.48);
  stroke-width: 2;
  transition: fill 140ms ease, stroke 140ms ease, opacity 140ms ease;
}

.parcel-shape.is-selected {
  fill: rgba(200, 74, 58, 0.42);
  stroke: var(--coral);
  stroke-width: 3;
}

.parcel-label {
  fill: var(--ink);
  font-weight: 800;
  text-anchor: middle;
  dominant-baseline: middle;
  paint-order: stroke;
  stroke: rgba(251, 248, 241, 0.9);
  stroke-width: 4;
}

.map-pin circle:first-child { fill: var(--coral); opacity: 0.24; }
.map-pin circle:last-child  { fill: var(--coral); }

.parcel-map-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.parcel-map-button {
  appearance: none;
  border: 1px solid var(--hairline);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  line-height: 1;
  padding: 10px 11px;
  text-transform: uppercase;
}

.parcel-map-button:focus-visible {
  outline: 3px solid var(--sun);
  outline-offset: 2px;
}

.parcel-map-button[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.parcel-map-detail {
  display: grid;
  gap: 5px;
  border-top: 1px solid var(--hairline);
  padding-top: 12px;
  min-height: 56px;
}

.parcel-map-detail span {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--pebble);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.parcel-map-detail strong {
  font-size: 16px;
  line-height: 1.25;
}

.aerial-placeholder {
  min-height: 460px;
  padding: 18px;
  border: 1px solid var(--hairline);
  background:
    linear-gradient(135deg, rgba(27, 29, 32, 0.05) 0 25%, transparent 25% 50%, rgba(27, 29, 32, 0.05) 50% 75%, transparent 75%),
    var(--paper);
  background-size: 22px 22px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 18px;
}

.aerial-head { display: grid; gap: 4px; }

.aerial-body {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 18px;
  align-items: start;
}

.aerial-mark {
  width: 44px;
  height: 44px;
  border: 1px solid var(--hairline);
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--ink);
  background: var(--bone);
}

.aerial-caption {
  max-width: 38ch;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.45;
  align-self: end;
}

.aerial-foot {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--pebble);
  border-top: 1px solid var(--hairline);
  padding-top: 12px;
}

.ctx-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
}

.ctx-card {
  padding: 18px 18px 18px 0;
  border-right: 1px solid var(--hairline-soft);
  display: grid;
  gap: 10px;
  align-content: start;
}

.ctx-card + .ctx-card { padding-left: 18px; }
.ctx-card:nth-child(3n) { border-right: 0; }

.ctx-card p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-2);
}

/* ─── Responsive ─────────────────────────────────────────────────────── */

@media (max-width: 900px) {
  .fm-snapshot { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fm-snap-cell:nth-child(2n) { border-right: 0; padding-right: 0; }
  .fm-snap-cell:nth-child(2n+1) { border-right: 1px solid var(--hairline-soft); }
  .fm-two-col { grid-template-columns: 1fr; }
  .fm-returns-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pf-meta { grid-template-columns: 1fr; }
  .pf-meta-cell, .pf-meta-cell + .pf-meta-cell {
    padding-left: 0;
    border-right: 0;
    border-bottom: 1px solid var(--hairline-soft);
  }
  .pf-meta-cell:last-child { border-bottom: 0; }
  .site-split { grid-template-columns: 1fr; }
  .ctx-grid { grid-template-columns: 1fr; }
  .ctx-card, .ctx-card + .ctx-card {
    padding-left: 0;
    border-right: 0;
    border-bottom: 1px solid var(--hairline-soft);
  }
  .ctx-card:last-child { border-bottom: 0; }
}

@media (max-width: 600px) {
  .fm-snapshot, .fm-returns-grid { grid-template-columns: 1fr; }
  .fm-snap-cell, .fm-return-cell { border-right: 0; padding-right: 0; padding-left: 0; }
  .fm-snap-cell + .fm-snap-cell, .fm-return-cell + .fm-return-cell { padding-left: 0; }
}
