/* =====================================================================
   Strata Doc Review — buyer-facing editorial report stylesheet.

   Everything is scoped under `.strata-report` so the dark navy + gold
   editorial palette never bleeds into the rest of BrokerPilot. Loaded
   only on the /strata/[slug] route via direct import in page.tsx.
   ===================================================================== */

.strata-report {
  /* User-customisable upstream tokens. Overridden via inline style on the
     wrapper when the signed-in realtor has primary_color / secondary_color
     set on their profile. Defaults match the brand-wide REALTOR defaults
     (near-black ink, brass accent). */
  /* Navy + gold theme — aligns the report with the app's navy/yellow brand on a
     light, print-friendly document surface. Navy ink, brass-gold accent (legible
     on white; the cockpit's brighter aviation gold #f0c419 is reserved for dark
     surfaces where it has contrast). */
  --brand-ink: #0E1217;      /* near-black — matches CMA globals --ink */
  --brand-accent: #0D9488;   /* Vantage teal — CMA default accent; overridden per-realtor via inline --brand-accent (Report.tsx) */

  /* Surfaces — cool-white paper + white cards, identical to the CMA report */
  --bg: #f5f7fa;            /* page background (app --paper) */
  --bg-2: #ffffff;          /* card background (app --card) */
  --bg-3: #eef2f7;          /* faint wash — heatmap empty cells, hover wash (app --paper-2) */
  --paper: #0E1217;         /* inverse surface — tooltips, dark hover-cards */
  --on-fill: #ffffff;       /* readable text/strokes shown ON a saturated brand-colour fill */

  /* Text — matched to the CMA/app ink ramp (globals --ink / --ink-2 / --ink-3) */
  --ink: var(--brand-ink);
  --ink-dim: #1b232c;       /* body / lede / dim text (app --ink-2) */
  --ink-mute: #5b6775;      /* meta / mono labels (app --ink-3) */

  /* Rules / dividers — neutral dark at low alpha for visibility on white */
  --rule: rgba(14, 18, 23, 0.10);
  --rule-strong: rgba(14, 18, 23, 0.20);

  /* Accents — --gold is the brass-gold brand accent (acts as the primary
     highlight throughout). Other semantic colours stay fixed so red still means
     red, green still means green, no matter who's logged in. */
  --gold: var(--brand-accent);
  --gold-dim: color-mix(in srgb, var(--brand-accent) 80%, #0E1217 20%);
  --steel: #2f5d8c;
  --steel-2: #4a7eb8;
  --rust: #b04a25;
  --rust-2: #c75d3a;
  --moss: #4d7d5b;
  --moss-2: #6b9e7a;
  --amber: #c98a35;
  --crimson: #9b2f2f;

  --font-serif: var(--font-newsreader), system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-sans: var(--font-dm-sans), system-ui, -apple-system, sans-serif;
  --font-mono: var(--font-dm-sans), system-ui, -apple-system, sans-serif;

  --maxw: 1280px;
  --gap: 24px;

  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}

.strata-report * { box-sizing: border-box; }

/* ============ TYPOGRAPHY ============ */
.strata-report .serif { font-family: var(--font-serif); font-weight: 400; }
.strata-report .mono  { font-family: var(--font-mono); }
.strata-report .italic { font-style: italic; }

.strata-report h1, .strata-report h2, .strata-report h3, .strata-report h4 { margin: 0; font-weight: 500; }
.strata-report h1.display {
  font-family: var(--font-serif);
  font-size: clamp(40px, 5.4vw, 76px);
  line-height: 0.98;
  letter-spacing: -0.02em;
  /* Heavier weight + full-ink color so the hero reads with enough contrast
     (was 500, which looked thin/washed-out at display size). */
  font-weight: 600;
  color: var(--ink);
}
.strata-report h2.section-title {
  font-family: var(--font-serif);
  font-size: 40px;
  line-height: 1.02;
  letter-spacing: -0.015em;
  font-weight: 600;
  color: var(--ink);
}
.strata-report h3.card-title {
  font-family: var(--font-serif);
  font-size: 22px;
  line-height: 1.15;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--ink);
}

.strata-report .eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.strata-report .kicker {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
}
.strata-report .lead {
  font-family: var(--font-serif);
  font-size: 21px;
  line-height: 1.5;
  color: var(--ink-dim);
  /* 500 (was 400): the large light-weight serif lede read washed-out even after
     the --ink-dim darkening; the extra weight makes the contrast unmistakable. */
  font-weight: 500;
  text-wrap: pretty;
}

/* ---- App-skin immunity -------------------------------------------------
   The report is a fixed evergreen-LIGHT, client-facing surface. bp.css sets
   global typography colours — `.lead`/`.body`/`.small`/… — at specificity
   (0,2,0) via `.bp .lead`, which ties `.strata-report .lead` (0,2,0) and then
   wins on source order. Re-assert the report's own token colours at (0,3,0) so
   they always win. Keep in sync with the evergreen --ink* tokens above.

   The `.bp.bp-night` halves of these selectors were removed with the 2026-08-09
   theme unification — the app no longer carries that class, so they were dead.
   (Historically the night skin's (0,3,0) `.bp.bp-night .lead` beat the report
   and rendered the lede near-white on the light cover: light-on-light.) */
.bp .strata-report .lead   { color: var(--ink-dim); }
.bp .strata-report .body   { color: var(--ink-dim); }
.bp .strata-report .small,
.bp .strata-report .micro,
.bp .strata-report .soft,
.bp .strata-report .faint  { color: var(--ink-mute); }

.strata-report .num {
  font-family: var(--font-serif);
  font-feature-settings: "tnum" 1, "lnum" 1;
  letter-spacing: -0.01em;
}
.strata-report .num-sans {
  font-family: var(--font-sans);
  font-feature-settings: "tnum" 1, "lnum" 1;
}
.strata-report a { color: inherit; text-decoration: none; }
.strata-report hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 0;
}

/* ============ LAYOUT ============ */
.strata-report .wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 32px;
}
.strata-report .report-inner { position: relative; }

/* ============ STICKY NAV ============ */
.strata-report .topbar {
  /* globals.css owns a generic `.topbar` (the legacy realtor-tools header) and
     sets display:flex on it at (0,1,0). That made THIS .topbar a flex container
     and .topbar-inner a flex ITEM, so the inner box shrink-to-fit and .wrap's
     `margin: 0 auto` then centred it — the action bar drifted to the middle of
     the page instead of sitting right, and it got worse as the bar lost
     children. Block flow is what .wrap's max-width + auto margins assume. */
  display: block;
  position: sticky;
  /* Park below the job-progress strip when one is showing. JobBanner publishes
     its measured height as --sjb-h and clears it when the bar goes away, so
     this is plain top:0 on every report without a job running. */
  top: var(--sjb-h, 0px);
  z-index: 50;
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  background: rgba(255, 255, 255, 0.82);
  border-bottom: 1px solid var(--rule);
}

/* Embedded in the CxP: match the portal's warm-cream ground (#faf7f1) instead
   of the standalone report's cool gray, so strata / CMA / search all read as
   one brand. Cards stay white. */
.strata-report.is-embedded { --bg: #faf7f1; min-height: auto; }

/* In the signed-in app (/strata/<slug> inside AppShell): same creme ground as
   the CxP, for the same reason and one more. The app itself is creme
   (--bp-paper: #faf7f1, app/bp.css), so the cool-gray #f5f7fa made the report
   read as a different product the moment it opened — a grey slab butting
   against the creme shell. Cards stay white; the report's own typography and
   the realtor's accent are deliberately left alone, because this document is
   also what the buyer sees when it's shared and printed.
   min-height drops too: inside the shell the report is a panel, not the page,
   so a forced 100vh left dead space under short reports. */
.strata-report.in-app { --bg: #faf7f1; min-height: auto; }

/* The sticky bar is translucent over whatever it scrolls above — creme here,
   not the cool white it assumed. */
.strata-report.in-app .topbar { background: rgba(250, 247, 241, 0.86); }

/* Embedded in the CxP: the portal's own top bar owns the sticky top slot and
   supplies the brand, so this bar goes static + brandless — just a right-
   aligned One-pager / Print action row. */
.strata-report .topbar-embedded {
  position: static;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  background: transparent;
  border-bottom: none;
}
.strata-report .topbar-embedded .topbar-inner {
  justify-content: flex-end;
  height: 52px;
}
.strata-report .topbar-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  /* min-height, not height: the realtor action bar (.sr-actions) stacks the
     attached-contact row above the Publish/Send/More row, so the bar has to be
     able to grow past one row. */
  min-height: 60px;
}
/* Agent-brand masthead identity — mirrors the shared ReportMasthead left
   cluster used by the CMA / dev-report / tour client headers: mark (uploaded
   logo, else accent dot) + agent name + brokerage. */
.strata-report .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}
.strata-report .brand-logo {
  height: 30px;
  width: auto;
  max-width: 168px;
  object-fit: contain;
  display: block;
  flex: none;
}
.strata-report .brand-dot {
  width: 9px;
  height: 9px;
  border-radius: 2px;
  background: var(--gold);
  flex: none;
}
.strata-report .brand-id {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.strata-report .brand-name {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.12;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.strata-report .brand-id small {
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-mute);
  font-weight: 400;
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.strata-report .nav-action {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 9px 14px;
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  flex-shrink: 0;
}
.strata-report .nav-action:hover { background: rgba(26,22,19,0.04); border-color: var(--gold); color: var(--gold); }
/* Filled variant — the CMA header's "accent" button (the one action the
   realtor is most likely to want next). */
.strata-report .nav-action.sr-primary {
  background: var(--ink);
  color: var(--on-fill);
  border-color: var(--ink);
}
.strata-report .nav-action.sr-primary:hover { background: #000; border-color: #000; color: var(--on-fill); }

/* ============ REPORT ACTION BAR (realtor view) ============ */
/* Mirrors the CMA tool's header: attached-contact row on its own line, then a
   right-aligned Publish / Send / More button row under it. */
/* Single right-aligned row, mirroring the CMA's .header-actions
   (display:flex; align-items:center; gap:8px; flex-wrap:wrap). It used to be a
   column that stacked the attached-contact row above the buttons. */
.strata-report .sr-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  position: relative;
  margin-left: auto;
  padding: 10px 0;
}
.strata-report .sr-buttons { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

/* ── The action bar is the CMA report header, not a second dialect of it ──
   The buttons used to be .nav-action: uppercase 10.5px mono in a 999px pill on
   a transparent ground, hovering to gold. The CMA header two clicks away uses
   the global .btn: 13px sentence case, 4px radius, white card on a hairline
   border. Same bar, same job, two different-looking sets of controls — which
   is what made the strata review read as a different site.
   ReportActions now emits .btn / .btn-accent, exactly as
   app/cma/(tool)/[id]/CmaEditor.tsx does. Everything below only matches the
   geometry the CMA sets around those buttons; the buttons themselves inherit
   from globals.css, so the two can no longer drift apart.

   The one rule the CMA declares locally (in its styled-jsx, so it does not
   reach here) is the accent fill. Repeated verbatim rather than referenced,
   because a styled-jsx block is scoped to that component and cannot be
   imported. --accent is the app/tenant accent in both places, NOT the report's
   per-realtor --gold: this is app chrome, and it should match the shell the
   realtor is looking at. */
/* THE ACTUAL SPEC, and why it is restated rather than referenced.
   The CMA header does NOT use the globals.css .btn. CmaEditor declares its own
   .btn inside a styled-jsx block, which overrides globals for everything except
   the background: 8px radius (--r-m), 14px/600, 10px 18px padding, and a
   TRANSPARENT 1px border — so the buttons read as white cards with no visible
   outline. globals .btn alone gives 4px radius, 13px/normal, 9px 14px and a
   visible #e7e1d6 border, which is what this bar had after the first pass and
   why it still didn't match.
   styled-jsx is component-scoped and cannot be imported, so the values are
   copied here. If the CMA header ever changes, this block has to change with
   it — there is no way to share it short of lifting the CMA's block into a
   real stylesheet, which is the better fix when someone next touches both. */
.strata-report .btn,
.sr-send-modal .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 18px; border-radius: var(--r-m);
  font-weight: 600; font-size: 14px; border: 1px solid transparent;
  cursor: pointer; text-decoration: none;
}
.strata-report .sr-buttons .btn { min-width: 84px; text-align: center; }
.strata-report .btn-accent,
.sr-send-modal .btn-accent { background: var(--accent); color: #fff; border-color: transparent; }
.strata-report .btn-accent:hover,
.sr-send-modal .btn-accent:hover { background: var(--accent-ink); }
.strata-report .btn-accent:disabled,
.sr-send-modal .btn-accent:disabled { opacity: 0.7; cursor: wait; }
/* NOTE the name. This was `.sr-chip`, which collides with the Sale-readiness
   section's filter chips — those declare `.strata-report .sr-chip` in a
   styled-jsx block (components/strata-report/sections.tsx) at the SAME
   specificity and later source order, so they won: the attached-contact pill
   rendered as a tall white column box with the tick, name and ✕ stacked.
   Renamed rather than fought with specificity, because two unrelated controls
   sharing a class name is the actual bug. */
.strata-report .sr-attach-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--ink);
  background: var(--bg-3); border: 1px solid var(--rule);
  border-radius: 999px; padding: 4px 10px;
}
.strata-report .sr-attach-chip-tick { color: var(--gold); }
.strata-report .sr-attach-chip-name { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.strata-report .sr-attach-chip-x {
  border: 0; background: transparent; cursor: pointer;
  color: var(--ink-mute); font-size: 13px; line-height: 1; padding: 0;
}
.strata-report .sr-status-tag {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 4px 9px; border-radius: 4px; background: var(--bg-3); color: var(--ink-mute); font-weight: 600;
}
.strata-report .sr-notice { font-size: 12px; color: var(--ink-mute); }
.strata-report .sr-picker {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 60; width: 280px;
  background: var(--bg-2); border: 1px solid var(--rule); border-radius: 10px; padding: 8px;
  box-shadow: 0 12px 32px rgba(10,27,51,.18);
}
.strata-report .sr-picker-cancel {
  margin-top: 6px; border: 0; background: transparent; color: var(--ink-mute); font-size: 12px; cursor: pointer;
}
/* Overflow menu — the CMA's .more-menu / .more-item, value for value
   (radius var(--r-m) = 8px, min-width 190px, 6px padding; items 9px/12px,
   14px, weight 500). */
.strata-report .sr-more-wrap { position: relative; display: inline-flex; }
.strata-report .sr-more-menu {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 60;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-m);
  box-shadow: var(--shadow-2, 0 12px 32px rgba(10,27,51,.18)); min-width: 190px; padding: 6px;
  display: flex; flex-direction: column;
}
.strata-report .sr-more-item {
  display: block; width: 100%; text-align: left; background: none; border: none;
  padding: 9px 12px; border-radius: 8px; font-size: 14px; font-weight: 500;
  color: var(--ink); cursor: pointer; white-space: nowrap;
}
.strata-report .sr-more-item:hover { background: var(--paper-2); }

@media (max-width: 860px) {
  .strata-report .print-only-desktop { display: none !important; }
  .strata-report .brand-id { max-width: 46vw; }
  .strata-report .sr-buttons .btn { min-width: 0; padding: 8px 11px; }
  .strata-report .sr-attach-chip-name { max-width: 110px; }
}

/* ============ SEND-TO-CLIENT DIALOG ============ */
/* Portalled to <body> (see ReportActions.tsx) — the sticky topbar's
   backdrop-filter would otherwise become the containing block for these fixed
   elements and clip the dialog under the nav. */
.sr-send-backdrop {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(10,27,51,.42);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.sr-send-modal {
  width: 420px; max-width: 100%;
  background: #fff; color: #1a1613;
  border-radius: 14px; padding: 22px;
  box-shadow: 0 24px 60px rgba(10,27,51,.3);
  max-height: calc(100vh - 40px); overflow-y: auto;
}
.sr-send-modal h3 { margin: 0 0 4px; font-size: 18px; }
.sr-send-modal > p { margin: 0 0 16px; font-size: 13px; color: #6b625b; }
.sr-send-modal label { display: block; font-size: 12px; color: #6b625b; margin: 12px 0 4px; }
.sr-send-modal label:first-of-type { margin-top: 0; }
.sr-send-modal input,
.sr-send-modal textarea {
  width: 100%; padding: 9px 11px; border-radius: 8px; border: 1px solid #d8d2c9;
  background: #fff; color: #1a1613; font-size: 14px; outline: none; font-family: inherit;
}
.sr-send-modal textarea { resize: vertical; }
.sr-send-foot { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.sr-send-result { font-size: 12.5px; margin-right: auto; color: #6b625b; }
.sr-send-result.ok { color: #3f7d5e; }
/* The dialog lives outside .strata-report once portalled, so it needs its own
   copy of the button styling rather than inheriting the report scope's. */
/* The dialog is portalled to <body>, so it sits OUTSIDE .strata-report and the
   scoped .btn-accent rule above cannot reach it. Its buttons now use the same
   global .btn as the action bar; only the accent fill has to be restated here,
   at this selector's reach. */
.sr-send-modal .btn { flex-shrink: 0; }
.sr-send-modal .btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Phone layout: stop the maintenance/water rows and the contacts table from
   forcing horizontal scroll — stack each field on its own line. */
@media (max-width: 560px) {
  /* Water & Moisture + Maintenance open-issue rows: title, date, description,
     and outcome each on their own line instead of a wrapping flex row. */
  .strata-report .mt-item-head { flex-direction: column; align-items: flex-start; gap: 6px; }
  .strata-report .mt-meta { flex-direction: row; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
  .strata-report .mt-title, .strata-report .mt-detail { overflow-wrap: anywhere; }

  /* Contacts: the min-width:480 table side-scrolls on a phone — restack it into
     labelled cards (data-label on each cell supplies the row heading). */
  .strata-report .contacts-wrap { overflow-x: visible !important; }
  .strata-report .contacts-table { min-width: 0 !important; }
  .strata-report .contacts-table thead { display: none; }
  .strata-report .contacts-table,
  .strata-report .contacts-table tbody,
  .strata-report .contacts-table tr,
  .strata-report .contacts-table td { display: block; width: 100%; }
  .strata-report .contacts-table tr { border: 1px solid var(--rule); border-radius: 8px; padding: 4px 12px; margin-bottom: 10px; }
  .strata-report .contacts-table td { border: 0 !important; padding: 6px 0 !important; display: flex; justify-content: space-between; gap: 14px; align-items: baseline; overflow-wrap: anywhere; }
  .strata-report .contacts-table td::before { content: attr(data-label); font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-mute); flex: 0 0 auto; }
}

/* ============ TITLE & CHARGES (08b) ============ */
/* Identity block from the title search print. auto-fit so four facts sit in a
   row on desktop and stack cleanly on a phone without a second media query. */
.strata-report .ti-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 16px 24px;
  margin-bottom: 16px;
}
.strata-report .ti-fact { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.strata-report .ti-fact-v { font-size: 14.5px; color: var(--ink); overflow-wrap: anywhere; }
/* The legal description is a transcription — monospace so it reads as quoted
   from the document rather than as our own prose. */
.strata-report .ti-legal {
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--ink-dim);
  background: var(--bg-3);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 12px 14px;
  overflow-wrap: anywhere;
}
.strata-report .ti-regno {
  margin-left: 10px;
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: var(--ink-mute);
}
.strata-report .ti-k {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-right: 6px;
}
.strata-report .ti-remarks { color: var(--ink-mute); }
.strata-report .ti-repeat { color: var(--ink-mute); font-style: italic; }
.strata-report .ti-remark-note { font-style: italic; }

/* ============ SECTION FAB (floating section navigator) ============ */
.strata-report .fab-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  width: 44px;
  height: 44px;
  border-radius: 22px;
  background: var(--ink);
  color: var(--bg);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 14px rgba(0,0,0,0.28);
  transition: background 0.15s;
}
.strata-report .fab-btn:hover { background: var(--gold); }
.strata-report .fab-btn.open { background: var(--gold); }
.strata-report .fab-backdrop {
  position: fixed;
  inset: 0;
  z-index: 999;
}
.strata-report .fab-panel {
  position: fixed;
  bottom: 78px;
  right: 16px;
  z-index: 1000;
  background: #fff;
  border: 1px solid var(--rule-strong);
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(14,18,23,0.18);
  min-width: 160px;
  padding: 4px;
  display: none;
}
.strata-report .fab-panel.open { display: block; }
.strata-report .fab-panel-head {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-mute);
  padding: 8px 10px 4px;
}
.strata-report .fab-panel-item {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
  padding: 7px 10px;
  font-size: 13px;
  font-family: var(--font-sans);
  color: var(--ink-dim);
  border-radius: 6px;
  transition: background 0.1s, color 0.1s;
}
.strata-report .fab-panel-item:hover { background: var(--bg-3); color: var(--ink); }
.strata-report .fab-panel-item.active { color: var(--gold); font-weight: 500; }

/* ============ COVER ============ */
.strata-report .cover {
  padding: 80px 0 56px;
  border-bottom: 1px solid var(--rule);
  position: relative;
}
.strata-report .cover-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 64px;
  align-items: end;
}
.strata-report .cover-meta {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
}
.strata-report .cover-meta div { display: flex; flex-direction: column; gap: 4px; }
.strata-report .cover-meta .v { font-family: var(--font-serif); font-size: 18px; color: var(--ink); }

/* ============ SECTION ============ */
.strata-report section.report-section {
  padding: 72px 0 24px;
  border-bottom: 1px solid var(--rule);
  scroll-margin-top: 80px;
}
.strata-report section.report-section:last-of-type { border-bottom: 0; }
.strata-report .section-head {
  display: block;
  margin-bottom: 40px;
}
.strata-report .section-num {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--ink-mute);
  text-transform: uppercase;
  padding-top: 14px;
  border-top: 2px solid var(--gold);
  display: inline-block;
}
.strata-report .section-head .body { max-width: 720px; }
.strata-report .section-head .body p {
  color: var(--ink-dim);
  font-family: var(--font-serif);
  font-size: 18px;
  line-height: 1.5;
  margin: 16px 0 0;
}
/* "What this document is" explainer — a notch smaller than a lede so it reads
   as background rather than a finding. */
.strata-report .section-intro {
  font-size: 15.5px !important;
  line-height: 1.62 !important;
  color: var(--ink-dim);
  max-width: 68ch;
}

/* ============ CARDS ============ */
.strata-report .card {
  background: var(--bg-2);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 24px;
  position: relative;
}
.strata-report .card.elevated {
  background: linear-gradient(180deg, var(--bg), var(--bg-2));
  box-shadow: 0 1px 0 rgba(255,255,255,0.6) inset, 0 18px 36px -22px rgba(26,22,19,0.18);
}
.strata-report .card-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 20px;
}
.strata-report .card-head .sub {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

.strata-report .grid { display: grid; gap: var(--gap); }
.strata-report .g-2 { grid-template-columns: repeat(2, 1fr); }
.strata-report .g-3 { grid-template-columns: repeat(3, 1fr); }
.strata-report .g-4 { grid-template-columns: repeat(4, 1fr); }
.strata-report .g-12 { grid-template-columns: 1fr 2fr; }
.strata-report .g-21 { grid-template-columns: 2fr 1fr; }

/* ============ BADGES & PILLS ============ */
.strata-report .badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 4px 9px;
  border-radius: 3px;
  border: 1px solid currentColor;
  background: transparent;
}
.strata-report .badge.dot::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.strata-report .badge.green { color: var(--moss-2); }
.strata-report .badge.amber { color: var(--amber); }
.strata-report .badge.red { color: var(--rust-2); }
.strata-report .badge.gold { color: var(--gold); }
.strata-report .badge.slate { color: var(--ink-mute); }
.strata-report .badge.solid.green { background: rgba(77, 125, 91, 0.14); border-color: transparent; }
.strata-report .badge.solid.amber { background: rgba(201, 138, 53, 0.14); border-color: transparent; }
.strata-report .badge.solid.red   { background: rgba(176, 74, 37, 0.14);  border-color: transparent; }
.strata-report .badge.solid.gold  { background: rgba(184, 135, 40, 0.14); border-color: transparent; }

/* ============ STAT BLOCKS ============ */
.strata-report .stat .label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  color: var(--ink-mute);
  text-transform: uppercase;
}
.strata-report .stat .value {
  font-family: var(--font-serif);
  font-size: 36px;
  font-weight: 500;
  line-height: 1.05;
  margin-top: 6px;
  letter-spacing: -0.01em;
  font-feature-settings: "tnum" 1, "lnum" 1;
}
.strata-report .stat .value.small { font-size: 26px; }
.strata-report .stat .delta {
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--ink-mute);
}
.strata-report .stat .delta.up { color: var(--moss-2); }
.strata-report .stat .delta.down { color: var(--rust-2); }

/* ============ RISK STRIP ============ */
.strata-report .score-strip {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  margin-top: 32px;
}
.strata-report .score-strip > div {
  padding: 18px 16px;
  border-left: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.strata-report .score-strip > div:first-child { border-left: 0; }
.strata-report .score-strip .cat {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.strata-report .score-strip .grade {
  font-family: var(--font-serif);
  font-size: 32px;
  font-weight: 500;
  line-height: 1;
}
.strata-report .score-strip .meter {
  height: 3px;
  background: var(--rule);
  position: relative;
  overflow: hidden;
}
.strata-report .score-strip .meter .fill {
  position: absolute;
  inset: 0 auto 0 0;
  background: currentColor;
}
.strata-report .gA { color: var(--moss); }
.strata-report .gB { color: var(--moss); }
.strata-report .gC { color: var(--gold); }
.strata-report .gD { color: var(--amber); }
.strata-report .gF { color: var(--rust); }

/* ============ CALLOUTS / CITES ============ */
.strata-report .callout {
  border-left: 2px solid var(--gold);
  background: rgba(184, 135, 40, 0.06);
  padding: 14px 18px;
  border-radius: 0 4px 4px 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
}
.strata-report .callout-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.strata-report .callout-title { font-family: var(--font-serif); font-size: 16px; font-weight: 500; color: var(--ink); }
.strata-report .callout-body { margin: 0; font-family: var(--font-serif); font-size: 14.5px; color: var(--ink-dim); line-height: 1.55; }
.strata-report .callout.red   { border-color: var(--rust-2); background: rgba(176, 74, 37, 0.07); }
.strata-report .callout.amber { border-color: var(--amber);  background: rgba(201, 138, 53, 0.07); }
.strata-report .callout.green { border-color: var(--moss-2); background: rgba(77, 125, 91, 0.07); }

/* ===== Maintenance / Water list (status filters + stacked items) ===== */
.strata-report .mt-filters { display: grid; gap: 8px; margin: 12px 0 4px; }
.strata-report .mt-filter {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 12px 6px; border: 1px solid var(--rule); border-radius: 10px;
  background: var(--bg-2); cursor: pointer; transition: border-color 0.12s, background 0.12s;
}
.strata-report .mt-filter:hover { border-color: var(--rule-strong); }
.strata-report .mt-filter.active { border-color: var(--gold); background: rgba(31, 107, 94, 0.08); }
.strata-report .mt-filter .mt-filter-n { font-family: var(--font-serif); font-size: 22px; line-height: 1; color: var(--ink); }
.strata-report .mt-filter .mt-filter-s { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.07em; text-transform: uppercase; color: var(--ink-mute); }
.strata-report .mt-filter.amber .mt-filter-n { color: var(--amber); }
.strata-report .mt-filter.gold  .mt-filter-n { color: var(--gold-dim); }
.strata-report .mt-filter.green .mt-filter-n { color: var(--moss); }
.strata-report .mt-filter.red   .mt-filter-n { color: var(--rust-2); }
.strata-report .mt-filter.slate .mt-filter-n { color: var(--ink-mute); }
.strata-report .mt-list { display: flex; flex-direction: column; margin-top: 14px; }
.strata-report .mt-item { padding: 16px 0; border-top: 1px solid var(--rule); }
.strata-report .mt-item:first-child { border-top: none; }
.strata-report .mt-item-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.strata-report .mt-meta { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; flex-shrink: 0; }
.strata-report .mt-date { font-family: var(--font-mono); font-size: 11px; color: var(--ink-mute); }
.strata-report .mt-unit { font-family: var(--font-serif); font-size: 14px; font-weight: 600; color: var(--ink); }
.strata-report .mt-title { font-family: var(--font-serif); font-size: 15px; font-weight: 500; color: var(--ink); flex: 1; min-width: 0; }
.strata-report .mt-detail { margin: 8px 0 0; font-family: var(--font-serif); font-size: 13.5px; color: var(--ink-dim); line-height: 1.55; }

/* Minutes — per-meeting itemised list (parity with Vantage's minutes accordion) */
.strata-report .mn-meeting { border-top: 1px solid var(--rule); padding: 14px 0; }
.strata-report .mn-meeting:first-child { border-top: none; }
.strata-report .mn-sum { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; cursor: pointer; list-style: none; }
.strata-report .mn-sum::-webkit-details-marker { display: none; }
.strata-report .mn-title { font-family: var(--font-serif); font-size: 16px; font-weight: 600; color: var(--ink); }
.strata-report .mn-meeting[open] .mn-title { color: var(--gold-dim); }
.strata-report .mn-count { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-mute); flex-shrink: 0; }
.strata-report .mn-items { margin-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.strata-report .mn-item { display: grid; grid-template-columns: 132px 1fr; gap: 14px; align-items: baseline; }
.strata-report .mn-cat { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.07em; text-transform: uppercase; color: var(--gold); }
.strata-report .mn-txt { font-family: var(--font-serif); font-size: 14.5px; color: var(--ink-dim); line-height: 1.5; overflow-wrap: anywhere; }
@media (max-width: 560px) {
  .strata-report .mn-item { grid-template-columns: 1fr; gap: 3px; }
}

.strata-report .cite {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--ink-mute);
  border-bottom: 1px dashed var(--rule-strong);
  padding-bottom: 1px;
  cursor: help;
  position: relative;
  text-transform: uppercase;
}
.strata-report .cite:hover { color: var(--gold); border-color: var(--gold); }
.strata-report .cite-tip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  background: var(--paper);
  color: #f5f1e8;
  padding: 10px 12px;
  border-radius: 4px;
  width: 280px;
  font-family: var(--font-serif);
  font-size: 13px;
  line-height: 1.4;
  letter-spacing: 0;
  text-transform: none;
  z-index: 30;
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 0.15s, transform 0.15s;
  box-shadow: 0 12px 36px rgba(26,22,19,0.22);
}
.strata-report .cite-tip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 16px;
  border: 6px solid transparent;
  border-top-color: var(--paper);
}
.strata-report .cite-tip strong {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--gold);
  margin-bottom: 4px;
  text-transform: uppercase;
}
.strata-report .cite:hover .cite-tip { opacity: 1; pointer-events: auto; transform: translateY(0); }

/* ============ CHART TOOLTIP ============ */
.strata-report-tooltip {
  position: fixed;
  background: #1a1613;
  color: #f5f1e8;
  padding: 10px 12px;
  border-radius: 3px;
  font-family: var(--font-dm-sans), system-ui, -apple-system, sans-serif;
  font-size: 11px;
  line-height: 1.4;
  pointer-events: none;
  z-index: 100;
  box-shadow: 0 8px 24px rgba(26,22,19,0.24);
  white-space: nowrap;
}
.strata-report-tooltip .t-label {
  font-family: var(--font-newsreader), "Newsreader", Georgia, serif;
  font-size: 13px;
  font-weight: 500;
  display: block;
  letter-spacing: 0;
}
.strata-report-tooltip .t-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 3px;
}
.strata-report-tooltip .t-row .sw {
  width: 8px; height: 8px;
  border-radius: 1px;
}

/* ============ FILTER PILLS ============ */
.strata-report .filter-row {
  display: flex;
  gap: 6px;
  align-items: center;
}
.strata-report .pill {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid var(--rule-strong);
  background: transparent;
  color: var(--ink-dim);
  cursor: pointer;
  transition: all 0.15s;
}
.strata-report .pill:hover { color: var(--ink); border-color: var(--gold); }
.strata-report .pill.active { color: var(--on-fill); background: var(--gold); border-color: var(--gold); }

/* ============ CHECKLIST ============ */
.strata-report .checklist { display: flex; flex-direction: column; }
.strata-report .checklist .item {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px 0;
  border-top: 1px solid var(--rule);
}
.strata-report .checklist .item:first-child { border-top: 0; padding-top: 0; }
.strata-report .checklist .item:last-child { padding-bottom: 0; }
.strata-report .checklist .box {
  width: 18px;
  height: 18px;
  border-radius: 3px;
  border: 1.5px solid var(--rule-strong);
  display: grid;
  place-items: center;
}
.strata-report .checklist .item.done .box { background: var(--moss); border-color: var(--moss); }
.strata-report .checklist .item.done .box::after { content: '✓'; color: var(--on-fill); font-size: 11px; font-weight: 700; }
.strata-report .checklist .item.flag .box { background: var(--rust); border-color: var(--rust); }
.strata-report .checklist .item.flag .box::after { content: '!'; color: var(--on-fill); font-size: 11px; font-weight: 700; font-family: var(--font-serif); }
.strata-report .checklist .item.pending .box::after { content: '?'; color: var(--ink-mute); font-size: 11px; font-family: var(--font-serif); font-weight: 600; }
.strata-report .checklist .item .label { font-size: 14px; }
.strata-report .checklist .item .label small {
  display: block;
  color: var(--ink-mute);
  font-size: 12px;
  margin-top: 2px;
}

/* ============ ACCORDION ============ */
.strata-report .accord { border-top: 1px solid var(--rule); }
.strata-report .accord-row { border-bottom: 1px solid var(--rule); }
.strata-report .accord-head {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 16px;
  align-items: center;
  padding: 16px 0;
  cursor: pointer;
  user-select: none;
}
.strata-report .accord-head:hover .accord-title { color: var(--gold); }
.strata-report .accord-title {
  font-family: var(--font-serif);
  font-size: 17px;
  transition: color 0.15s;
}
.strata-report .accord-meta {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.strata-report .accord-caret {
  font-family: var(--font-mono);
  color: var(--ink-mute);
  font-size: 11px;
  transition: transform 0.2s;
}
.strata-report .accord-row.open .accord-caret { transform: rotate(90deg); color: var(--gold); }
.strata-report .accord-body {
  display: none;
  padding: 4px 0 22px;
  color: var(--ink-dim);
  font-family: var(--font-serif);
  font-size: 15.5px;
  line-height: 1.55;
  max-width: 760px;
}
.strata-report .accord-row.open .accord-body { display: block; }

/* ============ EMPTY STATE ============ */
.strata-report .empty-card {
  background: rgba(26, 22, 19, 0.025);
  border: 1px dashed var(--rule-strong);
  border-radius: 6px;
  padding: 32px;
  text-align: center;
  color: var(--ink-mute);
}
.strata-report .empty-card .empty-title {
  font-family: var(--font-serif);
  font-size: 20px;
  color: var(--ink-dim);
  margin-bottom: 6px;
}
.strata-report .empty-card .empty-body {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

/* ============ MISC ============ */
.strata-report .divider { border: 0; border-top: 1px solid var(--rule); margin: 0; }
.strata-report .spacer-l { height: 56px; }
.strata-report .spacer-m { height: 32px; }
.strata-report .legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: var(--ink-dim);
  text-transform: uppercase;
}
.strata-report .legend span { display: flex; align-items: center; gap: 6px; }
.strata-report .legend i {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 2px;
  font-style: normal;
}
.strata-report .tabular { font-feature-settings: "tnum" 1, "lnum" 1; }
.strata-report .footer {
  padding: 48px 0 60px;
  border-top: 1px solid var(--rule);
  color: var(--ink-mute);
  font-size: 12px;
  font-family: var(--font-mono);
  letter-spacing: 0.06em;
}
.strata-report .footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; }

/* ============ ONE-PAGER MODAL (global — portalled outside .strata-report) ============ */
.opm-backdrop {
  position: fixed; inset: 0; z-index: 600;
  background: rgba(0,0,0,0.72);
  display: flex; align-items: flex-start; justify-content: center;
  overflow-y: auto; padding: 32px 16px;
}
.opm-root {
  background: #fff; border-radius: 8px; width: 100%;
  max-width: 820px; overflow: hidden;
  box-shadow: 0 24px 60px rgba(0,0,0,0.32);
}
.opm-toolbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 20px; background: #f4f8f6; border-bottom: 1px solid rgba(20,32,28,0.1);
}
.opm-btn {
  font-family: var(--font-dm-sans), system-ui, -apple-system, sans-serif; font-size: 10px; letter-spacing: 0.12em;
  text-transform: uppercase; padding: 7px 14px; border-radius: 999px;
  border: 1px solid rgba(20,32,28,0.22); background: transparent; color: #14201c;
  cursor: pointer; transition: background 0.15s;
}
.opm-btn:hover { background: rgba(20,32,28,0.06); }
.opm-close { border-color: transparent; }
.opm-paper { padding: 32px; }

/* When one-pager modal is open: print only the modal, hide everything else */
@media print {
  body.one-pager-open > * { display: none !important; }
  body.one-pager-open .opm-backdrop { display: block !important; position: static !important; background: none !important; padding: 0 !important; overflow: visible !important; }
  body.one-pager-open .opm-root { display: block !important; box-shadow: none !important; border-radius: 0 !important; max-width: 100% !important; }
  body.one-pager-open .opm-toolbar { display: none !important; }
  body.one-pager-open .opm-paper { display: block !important; padding: 0 !important; }
}

/* ============ PRINT ============ */
@media print {
  .strata-report { background: white; color: black; }
  .strata-report .topbar, .strata-report .nav-action { display: none !important; }
  .strata-report section.report-section { page-break-inside: avoid; }
}

/* ============ RESPONSIVE ============ */
@media (max-width: 900px) {
  .strata-report .cover-grid,
  .strata-report .section-head,
  .strata-report .g-2,
  .strata-report .g-3,
  .strata-report .g-4,
  .strata-report .g-12,
  .strata-report .g-21,
  .strata-report .footer-grid {
    grid-template-columns: 1fr;
  }
  .strata-report .wrap { padding: 0 20px; }
  .strata-report h1.display { font-size: 44px; }
}
