/* ═══════════════════════════════════════════════════════════════════════════
   LAYOUT.CSS — Report layout system
   All class names match the sim exactly.
   rpt-* aliases provided for template compatibility.
   ═══════════════════════════════════════════════════════════════════════════ */


/* ── GRID PRIMITIVES ── */

.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 32px; }
.two-col-r { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: start; }
.two-col-wide-narrow { display: grid; grid-template-columns: 3fr 2fr; gap: 28px; }
.three-col { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.intel-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.char-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.geo-three { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }


/* ═══════════════════════════════════════════════════════════════════════════
   LAYOUT 1 — SECTION LEAD CHART
   sim: .section-lead-chart   alias: .rpt-lead-chart
   ═══════════════════════════════════════════════════════════════════════════ */

.section-lead-chart,
.rpt-lead-chart {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.section-lead-chart .slc-lead,
.rpt-lead-chart .rpt-standfirst { margin-bottom: 0; }

.slc-stats-analysis,
.rpt-lead-chart.stats-analysis {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}

.slc-stats-analysis .stat-cards,
.rpt-lead-chart .rpt-stat-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  width: 100%;
}

.slc-intro-row,
.rpt-lead-chart.intro-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
}

.slc-intro-row .slc-lead { margin: 0; }

.slc-analysis-col { display: flex; flex-direction: column; }

.section-lead-chart .slc-chart.two-col,
.section-lead-chart .slc-analysis.two-col,
.rpt-lead-chart .rpt-chart-row.two-col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 32px;
  align-items: start;
}


/* ═══════════════════════════════════════════════════════════════════════════
   LAYOUT 2 — KEY FINDINGS + SIDEBAR
   sim: .s2-layout / .s2-main / .s2-sidebar   alias: .rpt-main-sidebar etc.
   ═══════════════════════════════════════════════════════════════════════════ */

.s2-layout,
.rpt-main-sidebar { position: relative; }

.s2-main,
.rpt-main-col { min-width: 0; }

.s2-sidebar,
.rpt-sidebar-col {
  position: absolute;
  top: -30px;
  right: -120px;
  width: 250px;
}

.sidebar-rule,
.rpt-sidebar-rule {
  border-top: 1px solid var(--ink-2);
  margin-bottom: 20px;
}

.sidebar-heading,
.rpt-sidebar-heading {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--report-ink);
  margin-bottom: 10px;
}

.sidebar-toggle,
.rpt-sidebar-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  padding: 10px 0 0 0;
  cursor: pointer;
  font-size: 14px;
  font-weight: 400;
  color: var(--cyan);
  font-family: var(--font-family);
}

.sidebar-arrow,
.rpt-sidebar-arrow {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.sidebar-arrow.open,
.rpt-sidebar-arrow.open { transform: rotate(180deg); }

.sidebar-toc,
.rpt-sidebar-toc {
  display: none;
  flex-direction: column;
  gap: 0;
  margin-top: 12px;
  background: var(--report-white);
  border: 1px solid var(--report-border);
  border-radius: 6px;
  padding: 4px 0;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  position: relative;
  z-index: 10;
}

.sidebar-toc.open,
.rpt-sidebar-toc.open { display: flex; }

.sidebar-toc-item,
.rpt-sidebar-toc-item {
  font-size: var(--t-small);
  color: var(--report-ink);
  text-decoration: none;
  padding: 7px 14px;
  line-height: 1.4;
  transition: color 0.12s, background 0.12s;
}

.sidebar-toc-item:last-child,
.rpt-sidebar-toc-item:last-child { border-bottom: none; }

.sidebar-toc-item:hover,
.rpt-sidebar-toc-item:hover { color: var(--report-ink); background: var(--report-bg-page); }


/* ═══════════════════════════════════════════════════════════════════════════
   LAYOUT 3 — PARA CHART
   sim: .para-chart   alias: .rpt-para-chart
   ═══════════════════════════════════════════════════════════════════════════ */

.para-chart,
.rpt-para-chart {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.para-chart-body,
.rpt-para-body {
  font-size: var(--t-body);
  font-weight: var(--t-body-wt);
  line-height: var(--t-body-lh);
  color: var(--report-ink);
  /* Body-paragraph gap increased to --spacing-6 (24px) for more breathing room
     throughout the document. Was: --spacing-4 (16px). Christine, 4 Jun 2026. */
  margin: 0 0 var(--spacing-6);
}
.para-chart-body:last-child,
.rpt-para-body:last-child { margin-bottom: 0; }

/* Inline <strong> in the research-report narrative body matches the body
   text weight — the bolded source / citation names (laws, agencies, study
   refs) should sit at the same 300 weight as the prose around them rather
   than reading as semibold. Colour already inherits --report-ink from
   .report-paginated strong, so this just neutralises the weight. Equal
   specificity to .report-paginated strong (frame.css); layout.css loads
   later, so this wins. Analyst notes / standfirst keep their own weight.
   Christine, 1 June 2026. */
.para-chart-body strong,
.rpt-para-body strong {
  font-weight: var(--t-body-wt);
}

.para-chart-figure,
.rpt-para-figure {
  width: 100%;
  border-top: 1px solid var(--report-border);
  border-bottom: 1px solid var(--report-border);
  padding: 30px 0;
}

.para-chart-title,
.rpt-para-figure-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--report-ink);
  margin-bottom: 0;
  line-height: 1.3;
}

.para-chart-caption {
  font-size: var(--t-small);
  font-weight: 500;
  color: var(--report-ink);
  letter-spacing: 0.8px;
  margin-bottom: 8px;
}

.para-chart-analysis { display: flex; flex-direction: column; gap: 0; width: 100%; }

.para-chart-source,
.rpt-para-figure-source {
  font-size: var(--t-small);
  color: var(--report-ink);
  line-height: 1.3;
  margin-top: 0;
  padding-top: 10px;
}

.rpt-para-figure-sub {
  font-size: var(--t-body);
  font-weight: 300;
  color: var(--report-ink);
  margin-bottom: 20px;
}


/* ═══════════════════════════════════════════════════════════════════════════
   LAYOUT 4 — ABOUT FLOAT (expandable methodology card)
   sim: .about-float-wrap / .about-bar / .about-body
   alias: .rpt-about-float / .rpt-about-bar etc.
   ═══════════════════════════════════════════════════════════════════════════ */

.about-wrap-grid,
.rpt-about-float { display: block; }

.about-float-wrap,
.rpt-about-float-wrap {
  float: left;
  width: 280px;
  margin: 0 32px 16px 0;
}

.about-wrap-grid.open .about-float-wrap,
.about-wrap-grid.open .rpt-about-float-wrap,
.rpt-about-float.open .rpt-about-float-wrap {
  width: 100%;
  float: none;
  margin-right: 0;
}

.about-wrap-grid > .body { margin-top: 14px; }
.about-wrap-grid.open .about-intro-text,
.rpt-about-float.open .rpt-drop-cap-para { margin-top: 24px; clear: both; }

/* clearfix */
.about-wrap-grid::after,
.rpt-about-float::after { content: ''; display: table; clear: both; }

.about-bar,
.rpt-about-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  background: var(--report-bg-page);
  padding: 14px 20px;
  border-radius: 6px;
  cursor: pointer;
  width: 280px;
  height: 120px;
  transition: width 0.25s ease, border-radius 0.25s ease;
}

.about-bar.open,
.rpt-about-bar.open {
  width: 100%;
  max-width: 100%;
  border-radius: 6px 6px 0 0;
}

.about-bar-label,
.rpt-about-bar-label {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 0;
}

.about-bar-label-top,
.rpt-about-bar-label-top {
  font-size: var(--t-small);
  font-weight: 300;
  color: var(--report-ink);
}

.about-bar-label-bottom,
.rpt-about-bar-label-bottom {
  font-size: 20px;
  font-weight: 400;
  color: var(--report-ink);
}

.about-bar.open .about-bar-label-bottom,
.rpt-about-bar.open .rpt-about-bar-label-bottom {
  font-size: 22px;
  font-weight: 600;
}

.about-bar-toggle,
.rpt-about-bar-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--report-ink);
  border: none;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s;
}

.about-bar-toggle:hover,
.rpt-about-bar-toggle:hover { background: var(--cyan); }

.about-bar-icon,
.rpt-about-bar-icon { width: 16px; height: 16px; color: #fff; }

.about-body,
.rpt-about-body {
  display: none;
  background: var(--report-bg-page);
  border-radius: 0 0 6px 6px;
  padding: 24px 44px;
  margin-top: -4px;
  width: 100%;
  max-width: 100%;
}

.about-body.open,
.rpt-about-body.open { display: block; }

.about-intro,
.rpt-about-para {
  font-size: var(--t-body);
  font-weight: var(--t-body-wt);
  line-height: var(--t-body-lh);
  color: var(--report-ink);
  margin-bottom: 12px;
}

.about-intro:last-child,
.rpt-about-para:last-child { margin-bottom: 0; }

.about-section-rule { width: 100%; max-width: 700px; height: 1px; background: var(--report-border); margin: 0 0 50px; }
.about-sections { display: flex; flex-direction: column; gap: 12px; margin-bottom: 24px; }
.about-section-item { padding-left: 12px; border-left: 1px solid var(--ink-2); }
.about-section-title { font-size: var(--t-body); font-weight: 600; color: var(--report-ink); margin-bottom: 2px; }
.about-section-body { font-size: var(--t-small); color: var(--report-ink); line-height: 1.6; }
.about-divider { border-top: 1px solid var(--report-border); margin: 20px 0; }
.about-confidence { display: flex; flex-direction: column; gap: 10px; margin-bottom: 4px; }
.about-confidence-title { font-size: var(--t-small); font-weight: 600; color: var(--report-ink); letter-spacing: 0.8px; margin-bottom: 4px; }
.about-confidence-item { display: flex; align-items: flex-start; gap: 10px; font-size: var(--t-small); line-height: 1.6; color: var(--report-ink); }
.about-confidence-item .conf-dot { margin-top: 5px; flex-shrink: 0; }
.about-data p { font-size: var(--t-small); line-height: 1.8; color: var(--report-ink); margin-top: 8px; }


/* ── DROP CAP ── */

/* Applied to .body.drop-cap or .rpt-drop-cap-para */
.drop-cap::first-letter,
.rpt-drop-cap-para::first-letter {
  float: left;
  font-size: 57px;
  line-height: 1;
  font-weight: 400;
  color: var(--report-ink);
  margin-right: 8px;
  margin-top: 2px;
}

.drop-lead,
.rpt-drop-lead { font-weight: 500; }

/* rpt-drop-cap-para wraps text in a span — target the span's first letter */
.rpt-drop-cap-para {
  font-size: var(--t-body);
  font-weight: var(--t-body-wt);
  line-height: var(--t-body-lh);
  color: var(--report-ink);
  margin-top: 12px;
}

.rpt-drop-cap-para > .rpt-drop-lead::first-letter {
  float: left;
  font-size: 57px;
  line-height: 1;
  font-weight: 400;
  color: var(--report-ink);
  margin-right: 8px;
  margin-top: 2px;
}


/* ═══════════════════════════════════════════════════════════════════════════
   LAYOUT 5 — CHART + INSIGHT
   sim: .section-chart-insight   alias: .rpt-chart-insight
   ═══════════════════════════════════════════════════════════════════════════ */

.section-chart-insight,
.rpt-chart-insight { display: grid; grid-template-columns: 3fr 2fr; gap: 32px; align-items: start; }

.section-chart-insight.equal,
.rpt-chart-insight.equal { grid-template-columns: 1fr 1fr; }

.section-chart-insight.chart-wide,
.rpt-chart-insight.chart-wide { grid-template-columns: 2fr 1fr; }

.rpt-chart-insight.reverse { grid-template-columns: 2fr 3fr; }

.section-chart-insight .sci-insight,
.rpt-ci-insight { display: flex; flex-direction: column; gap: 16px; }


/* ═══════════════════════════════════════════════════════════════════════════
   ACTION BAR
   sim: .action-bar   alias: .rpt-action-bar
   ═══════════════════════════════════════════════════════════════════════════ */

.action-bar,
.rpt-action-bar {
  padding: 0 0 25px;
  background: transparent;
  position: relative;
  overflow: visible;
}

/* Mobile-only: tighten the bottom padding so the action bar sits
   closer to the next section. Desktop and PDF export stay at 25px. */
@media (max-width: 768px) {
  .action-bar,
  .rpt-action-bar {
    padding-bottom: 15px;
  }
}

/* ────────────────────────────────────────────────────────────────────
   Shared cover wordmark row — single source of truth across all
   report engines (simulation, assessment, facilitator, …). The
   markup partial is `templates/reports/_cover_wordmark.html` and
   the relocate scripts in `templates/reports/base.html` and
   `templates/pages/app/ren-chat.html` drop `#action-bar` into
   `#rpt-cover-actions-slot`. Logo hides on-screen, shows in PDF;
   action bar is the inverse (Browserless emulates print media).
   ──────────────────────────────────────────────────────────────────── */
.rpt-cover-wordmark {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  margin: 25px 0 10px;
}
.rpt-cover-wordmark__logo { display: flex; align-items: center; }
.rpt-cover-wordmark__logo svg { display: block; }
.rpt-cover-actions-slot { display: flex; align-items: center; }
/* Slotted action-bar: shed only outer padding/background so the bar
   sits flush in the wordmark row; buttons keep their layout. */
.rpt-cover-actions-slot .rpt-action-bar {
  padding: 0; margin: 0; background: transparent;
}
.rpt-cover-actions-slot .rpt-action-bar-inner {
  max-width: none; padding: 0;
}
@media screen {
  .rpt-cover-wordmark__logo { display: none; }
}
@media print {
  .rpt-cover-actions-slot,
  #action-bar { display: none !important; }
  .rpt-cover-wordmark { width: 100%; }
  .rpt-cover-wordmark__logo { display: flex !important; margin-left: auto; margin-top: 20px; }
  /* +20% from 40px (Christine, 13 Jun 2026) — !important beats the inline style="height:36px" on the img */
  .rpt-cover-wordmark__logo img { height: 48px !important; }
  /* Footer wordmark: +20% from 18px. Higher specificity (.report-paginated added)
     overrides the baked .sim-v2 .sv-footer-mark rule (0,2,0 → beaten by 0,3,0). */
  .report-paginated.sim-v2 .sv-footer-mark { height: 22px; }
  .report-paginated.sim-v2 .sv-footer-mark img { height: 22px; }
}

.action-bar-inner,
.rpt-action-bar-inner {
  max-width: 800px;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 2px;
}

.action-btn,
.rpt-action-btn {
  /* Row layout (icon LEFT of label) — matches the canvas mockup
     header pattern (sim_v2.html etc.). Single source of truth for
     every report engine. */
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: none;
  background: transparent;
  color: var(--report-ink);
  cursor: pointer;
  border-radius: 6px;
  text-decoration: none;
  font-family: var(--font-family);
  font-size: 12.5px;
  line-height: 1;
  box-sizing: border-box;
  transition: background 0.15s, color 0.15s;
}

.action-btn:hover,
.rpt-action-btn:hover { background: var(--report-bg-page); color: var(--report-ink); }

.action-btn svg,
.rpt-action-btn svg { width: 16px; height: 16px; flex-shrink: 0; }

.action-btn span,
.rpt-action-btn span { font-size: 12.5px; font-weight: 500; line-height: 1; }

.action-btn.active,
.rpt-action-btn.active { background: var(--report-bg-page); color: var(--report-ink); }

.rpt-share-wrap { position: relative; display: flex; }

.rpt-share-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 180px;
  background: var(--report-white);
  border: 1px solid var(--gray-light);
  border-radius: 10px;
  padding: 6px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  z-index: 100;
  flex-direction: column;
}
.rpt-share-menu.open { display: flex; }

.rpt-share-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: none;
  background: transparent;
  color: var(--report-ink);
  font-family: var(--font-family);
  font-size: var(--t-small);
  font-weight: 450;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.12s;
  width: 100%;
  text-align: left;
}
.rpt-share-item:hover { background: var(--report-bg-page); }
.rpt-share-item svg { width: 18px; height: 18px; flex-shrink: 0; }

.rpt-share-divider {
  height: 1px;
  background: var(--gray-light);
  margin: 4px 8px;
}

.rpt-download-tooltip {
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--report-ink);
  color: var(--report-white);
  font-family: var(--font-family);
  font-size: 12px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 100;
}
.rpt-download-tooltip.show { opacity: 1; }
.rpt-download-wrap { position: relative; display: flex; }

/* ── TOC dropdown — navmenu-style menu (mirrors .rpt-share-menu),
   anchored under the TOC button. Right-aligned because the TOC button
   sits at the right end of the action bar. ── */
.rpt-toc-wrap { position: relative; display: flex; }

.rpt-toc-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 220px;
  max-width: 320px;
  max-height: 70vh;
  overflow-y: auto;
  background: var(--report-white);
  border: 1px solid var(--gray-light);
  border-radius: 10px;
  padding: 6px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  z-index: 100;
  flex-direction: column;
}
.rpt-toc-menu.open { display: flex; }

.rpt-toc-menu .rpt-sidebar-toc-item {
  display: block;
  padding: 9px 12px;
  color: var(--report-ink);
  font-family: var(--font-family);
  font-size: var(--t-small);
  font-weight: 450;
  text-decoration: none;
  border-radius: 6px;
  transition: background 0.12s;
}
.rpt-toc-menu .rpt-sidebar-toc-item:hover { background: var(--report-bg-page); }


/* ═══════════════════════════════════════════════════════════════════════════
   TOC DRAWER
   sim: .toc-drawer   alias: .rpt-toc-drawer
   ═══════════════════════════════════════════════════════════════════════════ */

.toc-drawer,
.rpt-toc-drawer {
  background: var(--report-white);
  border-bottom: 1px solid var(--report-border);
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease, padding 0.25s ease;
  padding: 0 var(--report-pad);
}

.toc-drawer.open,
.rpt-toc-drawer.open {
  max-height: 700px;
  padding: 20px var(--report-pad) 24px;
}

.toc-nav,
.rpt-toc-nav {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

.toc-item,
.rpt-toc-item {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 5px;
  text-decoration: none;
  color: var(--report-ink);
  font-size: var(--t-body);
  transition: background 0.12s, color 0.12s;
}

.toc-item:hover,
.rpt-toc-item:hover { background: var(--report-bg-page); color: var(--report-ink); }

.toc-num,
.rpt-toc-num {
  font-size: var(--t-small);
  font-weight: 700;
  color: var(--report-ink);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
  width: 18px;
}

.toc-label,
.rpt-toc-label { font-weight: 500; }

.meta-icons { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.meta-icon-btn { display: flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 6px; border: none; background: transparent; color: var(--report-ink); cursor: pointer; text-decoration: none; transition: background 0.15s, color 0.15s; }
.meta-icon-btn:hover, .meta-icon-btn.active { background: var(--report-bg-page); color: var(--report-ink); }
.meta-icon-btn svg { width: 15px; height: 15px; flex-shrink: 0; }


/* ═══════════════════════════════════════════════════════════════════════════
   SPLIT-SCREEN CONTEXT OVERRIDES
   ═══════════════════════════════════════════════════════════════════════════ */

.report-container .action-bar { max-width: 800px; margin: 0; }

.report-container .toc-drawer { max-width: 100%; }

.report-container .s2-sidebar { display: none; }

.report-container .about-float-wrap { margin-left: 0; }


/* ═══════════════════════════════════════════════════════════════════════════
   PRINT
   ═══════════════════════════════════════════════════════════════════════════ */

@media print {
  .toc-drawer, .rpt-toc-drawer {
    max-height: none !important;
    padding: 20px var(--report-pad) 24px !important;
    display: block !important;
  }

  .action-btn, .rpt-action-btn { display: none; }
  .rpt-mob-menu-btn { display: none !important; }

  .s2-sidebar, .rpt-sidebar-col { display: none; }

  .about-float-wrap, .rpt-about-float-wrap {
    float: none;
    width: 100%;
    margin: 0 0 16px 0;
  }

  .about-body, .rpt-about-body { display: block !important; }
}


/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 800px) {
  .slc-stats-analysis, .rpt-lead-chart.stats-analysis,
  .slc-intro-row, .rpt-lead-chart.intro-row {
    grid-template-columns: 1fr;
  }

  .section-chart-insight, .rpt-chart-insight,
  .section-chart-insight.equal, .rpt-chart-insight.equal,
  .rpt-chart-insight.reverse, .rpt-chart-insight.chart-wide {
    grid-template-columns: 1fr;
  }

  .s2-sidebar, .rpt-sidebar-col { display: none; }

  .about-float-wrap, .rpt-about-float-wrap {
    float: none !important;
    width: 100% !important;
    margin: 0 0 16px 0 !important;
  }

  .about-bar, .rpt-about-bar { width: 100% !important; height: auto !important; }
  .about-body, .rpt-about-body { max-width: 100% !important; }

  .two-col, .intel-grid, .three-col { grid-template-columns: 1fr; }
  .reg-row { grid-template-columns: 1fr; }
}

/* ── Mobile-only grid collapses + report action menu (≤ 767px) ─────────────
   Desktop and iPad (≥ 768px) are completely untouched.                      */
@media (max-width: 767px) {
  /* Step 4 — Collapse two-col-r and two-col-wide-narrow to single column */
  .two-col-r,
  .two-col-wide-narrow {
    grid-template-columns: 1fr;
  }

  /* Hide the horizontal action bar — the mobile drawer replaces it */
  .rpt-action-bar,
  #action-bar {
    display: none !important;
  }

  /* Collapse the empty wordmark row + oversized rule gap.
     On mobile the logo is display:none (screen rule above) and the
     action bar is also hidden, so .rpt-cover-wordmark has zero visible
     content but still contributes margin: 25px 0 10px = 35px of dead
     space. The .sv-cover-rule adds another 32px bottom margin.
     Together they create a ~70px+ gap below the navbar before the
     cover kicker squares appear. Reduce both to give ~20-30px total.
     Print/desktop untouched — these rules are inside @media (max-width:767px). */
  .rpt-cover-wordmark {
    margin-top: -70px;
    margin-bottom: 0;
  }
  .sv-cover-rule {
    margin-bottom: 8px !important;
  }

  /* Kicker row: 3-column grid.
     Col 1 (max-content): colored squares
     Col 2 (1fr):         spacer
     Col 3 (max-content): hamburger — far right, same row as squares.
     Row 2 spans all 3 cols so the eyebrow label always sits below.
     !important on display + gap beats the inline <style> from
     _sim_v2_styles.html which sets display:flex flex-direction:column gap:12px */
  .sv-cover-kicker-row {
    display: grid !important;
    grid-template-columns: max-content 1fr max-content;
    grid-template-rows: auto auto;
    align-items: center !important;
    gap: 2px !important;
  }
  .sv-cover-kicker {
    grid-column: 1;
    grid-row: 1;
    align-self: center;
  }
  .sv-cover-eyebrow {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  /* ── Hamburger button — kicker-11 purple ── */
  .rpt-mob-menu-btn {
    grid-column: 3;
    grid-row: 1;
    align-self: center;
    justify-self: end;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--navy);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .rpt-mob-menu-btn:active {
    background: color-mix(in srgb, var(--navy) 10%, transparent);
  }
  .rpt-mob-menu-btn svg {
    width: 20px;
    height: 16px;
    display: block;
  }

  /* ── Semi-transparent overlay ── */
  .rpt-mob-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: #151515;
    opacity: 0;
    visibility: hidden;
    z-index: 99998;
    transition: opacity 0.3s ease, visibility 0.3s ease;
  }
  .rpt-mob-overlay--open {
    opacity: 0.5;
    visibility: visible;
  }

  /* ── Slide-in drawer ── */
  .rpt-mob-drawer {
    display: flex;
    flex-direction: column;
    position: fixed;
    right: 0;
    top: 0;
    width: 280px;
    max-width: 85vw;
    height: 100%;
    background: #fff;
    border-left: 2px solid var(--navy);
    transform: translateX(calc(100% + 4px));
    transition: transform 0.35s ease-in-out;
    z-index: 99999;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .rpt-mob-drawer::-webkit-scrollbar { display: none; }
  .rpt-mob-drawer--open {
    transform: translateX(0);
  }

  /* Top row: Renatus symbol on the right — justify-content:flex-end
     matches .v2-nav .nav-panel-header exactly; overlay tap closes */
  .rpt-mob-drawer-top {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 16px 20px 8px;
    flex-shrink: 0;
  }
  /* Renatus colour symbol — same size as nav panels (28px) */
  .rpt-mob-drawer-top .nav-panel-symbol img {
    height: 28px;
    width: auto;
    display: block;
  }

  /* Wrapper — matches offcanvas__wrapper padding */
  .rpt-mob-drawer-wrapper {
    padding: 0 24px 32px;
    flex: 1;
  }

  /* Nav items — matches offcanvas__nav a typography */
  .rpt-mob-drawer-nav {
    display: flex;
    flex-direction: column;
  }
  .rpt-mob-drawer-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    font-size: var(--text-base);
    font-weight: var(--font-normal);
    line-height: var(--lh-nav);
    font-family: inherit;
    color: var(--navy);
    text-decoration: none;
    background: transparent;
    border: none;
    cursor: pointer;
    text-align: left;
    width: 100%;
    -webkit-tap-highlight-color: transparent;
  }
  .rpt-mob-drawer-item:active { color: var(--v2-theme, var(--pink)); }
  .rpt-mob-drawer-item svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    display: block;
    opacity: 0.6;
  }

  /* Divider — matches offcanvas__divider */
  .rpt-mob-drawer-divider {
    height: 1px;
    background: var(--v2-border, #e8ecf2);
    margin: 12px 0;
  }

  /* TOC section */
  .rpt-mob-drawer-toc-label {
    padding: 4px 0 8px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--cyan);
  }
  .rpt-mob-drawer-toc { display: flex; flex-direction: column; }
  .rpt-mob-drawer-toc-item {
    display: grid;
    grid-template-columns: 16px 1fr;
    gap: 12px;
    align-items: center;
    padding: 10px 0;
    font-size: var(--text-base);
    font-weight: var(--font-normal);
    line-height: var(--lh-nav);
    color: var(--navy);
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
  }
  .rpt-mob-drawer-toc-item:active { color: var(--v2-theme, var(--pink)); }
  .rpt-mob-toc-num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    color: var(--navy);
    font-size: 11px;
    line-height: 1;
  }

  /* All stat/intel grids — single-column stacking on mobile.
     mi-stat-callout-grid: carousel at 600px looks broken in full-page view.
     mi-stat-cards: no mobile rule at all (stays 3-col on phones).
     mi-intel-grid: only collapses at 600px, not 767px.
     Force all to 1-col here for the full mobile range. */
  .mi-stat-callout-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    overflow: visible !important;
    flex-wrap: unset !important;
    scroll-snap-type: unset !important;
  }
  .mi-stat-callout-grid > .mi-stat-callout {
    flex: unset !important;
    min-width: unset !important;
    scroll-snap-align: unset !important;
  }
  .mi-stat-cards {
    grid-template-columns: 1fr !important;
  }
  .mi-intel-grid {
    grid-template-columns: 1fr !important;
  }

  /* Hero stat (hardcoded in research-report.html) — stack vertically on mobile.
     Desktop: flex row (value left, note right with left border).
     Mobile: flex column, border moves to top of note. */
  .mi-stat-hero {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: var(--spacing-3) !important;
  }
  .mi-stat-hero-note {
    padding-left: 0 !important;
    border-left: none !important;
    border-top: 3px solid var(--navy) !important;
    padding-top: var(--spacing-3) !important;
    width: 100%;
  }

  /* Data-table: horizontal scroll on mobile via wrapper div.
     The existing stacking rule uses @container report-panel which only fires
     in the split-panel context. In standalone mobile view the container is
     absent so the table overflows. The wrapper lets the table keep its natural
     column widths while the container scrolls. */
  .data-table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
  }

  /* Key-findings section: keep padding:0 on mobile.
     The mobile Step-2 rule in components.css adds padding-left/right:16px to
     all .mi-section:not(#p-cover), which incorrectly insets the floating
     finding cards. Reset here (layout.css loads after components.css,
     so same-specificity source order wins). */
  .sim-v2.rpt-card-stack > .mi-section#p-findings {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  /* Simulation report container — strip the 50px desktop L/R padding to 24px.
     !important required: value is set inline in _sim_v2_styles.html (0,1,0). */
  .sim-v2 {
    padding-left: 24px !important;
    padding-right: 24px !important;
  }

  /* Cover title — smaller on mobile; !important beats inline <style> in _sim_v2_styles.html */
  .sv-cover-title {
    font-size: 28px !important;
  }

  /* Section eyebrow + heading — reduced on mobile */
  .mi-eyebrow {
    font-size: 16px !important;
  }
  .section-title,
  .mi-title {
    font-size: 20px !important;
    margin-bottom: var(--spacing-8) !important;
  }

  /* Cover title — suppress the desktop forced break (em-dash split / midpoint
     break) so the title wraps naturally at the mobile viewport width instead
     of stranding the em-dash on its own line. Applies to ALL report types. */
  .sv-cover-title br { display: none; }
}

/* Ensure the overlay and drawer are hidden at all sizes above mobile */
@media (min-width: 768px) {
  .rpt-mob-overlay,
  .rpt-mob-drawer {
    display: none !important;
  }
}
