/* TPO AIN Scope of Work: Word document-like viewer with TPO visual patterns */

:root {
  --color-primary: #171c8f;
  --color-primary-light: #0072ce;
  --color-green: #27b093;
  --color-bg: #f4f4f4;
  --color-surface: #ffffff;
  --color-border: #d0d0d0;
  --color-line: #b1b3b3;
  --color-text: #464b4b;
  --color-text-muted: #94a3b8;
  --color-ink: #2d2d2d;
  --color-muted: #58595b;
  --color-info: #eef5ff;
  --color-info-border: #5d93cd;
  --color-success: #eef8f6;
  --color-success-border: #27b093;
  --doc-width: 210mm;
  --doc-padding: 22mm;
  --sidebar-width: 260px;
  --doc-chrome-height: var(--portal-chrome-height, 60px);
  --font-sans: "Segoe UI", Arial, Helvetica, sans-serif;
  /* Chapter divider overlay (matches landing hero neutrals) */
  --chapter-overlay-start: rgba(70, 75, 75, 0.78); /* --fm-outer-space */
  --chapter-overlay-end: rgba(37, 40, 42, 0.68); /* --fm-dark-space */
  --chapter-bg-fallback: #25282a; /* --fm-dark-space solid */
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; -webkit-font-smoothing: antialiased; }

body {
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.55;
  overflow: hidden;
}

body.doc-has-menubar:not(.has-announcement-bar) { padding-top: var(--doc-chrome-height); }
body.doc-has-menubar:not(.has-announcement-bar) .portal-breadcrumb { top: 0; }
body.doc-has-menubar:not(.has-announcement-bar) .deck-menubar { top: var(--breadcrumb-height, 28px); }
body.doc-has-menubar:not(.has-announcement-bar) .app-container { height: calc(100vh - var(--doc-chrome-height)); }

.app-container {
  display: flex;
  height: 100vh;
  height: 100dvh;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.doc-sidebar {
  width: var(--sidebar-width);
  background: #f4f4f4;
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  font-size: 12px;
}

.doc-sidebar-header { padding: 12px; flex-shrink: 0; }
.doc-sidebar-title {
  font-size: 13px;
  font-weight: 700;
  color: #2d2d2d;
  line-height: 1.35;
}

.doc-sidebar-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0 8px 12px;
}

.doc-sidebar-section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  padding: 8px 8px 4px;
}

.doc-sidebar-toc-link {
  display: block;
  padding: 5px 8px;
  color: #464b4b;
  text-decoration: none;
  border-radius: 3px;
  line-height: 1.3;
  font-size: 12px;
}
.doc-sidebar-toc-link.toc-h2 {
  font-weight: 700;
  color: var(--color-primary);
  margin-top: 8px;
}
.doc-sidebar-toc-link.toc-h3 {
  padding: 3px 8px 3px 22px;
  font-size: 11px;
  color: #6b7280;
}
.doc-sidebar-toc-link:hover { background: #e8e8e8; }
.doc-sidebar-toc-link.active { background: #dde8f7; color: var(--color-primary); font-weight: 600; }

.doc-sidebar-footer {
  padding: 8px 12px;
  border-top: 1px solid var(--color-border);
  font-size: 11px;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.doc-sidebar-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
}

.document-viewport {
  flex: 1;
  min-width: 0;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  touch-action: pan-y;
  padding: 28px 24px 48px;
  background: var(--color-bg);
}

.document-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  width: 100%;
  max-width: calc(var(--doc-width) + 48px);
  margin: 0 auto;
  transform-origin: top center;
}

.document-content {
  width: 100%;
  font-size: 11pt;
}

/* Discrete Word-like page sheets. Fixed A4 height: app.js paginates chapter
   content across sheets at load so every page is exactly one A4 like Word. */
.doc-page {
  width: var(--doc-width);
  height: 297mm;
  min-height: 297mm;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  box-shadow:
    0 1px 3px rgb(0 0 0 / 0.06),
    0 6px 20px rgb(0 0 0 / 0.1);
  position: relative;
  scroll-margin-top: 52px;
  page-break-after: always;
  break-after: page;
  overflow: hidden;
}

/* Escape hatch for a single block taller than one page (rare oversize table
   or diagram that cannot be split): the sheet grows instead of clipping. */
.doc-page-tall {
  height: auto;
}

/* Fallback if client-side pagination fails: sheets grow with their content. */
.doc-no-pagination .doc-page {
  height: auto;
}

.doc-page-body {
  padding: var(--doc-padding);
  padding-bottom: calc(var(--doc-padding) + 14mm);
}

.doc-page-footer {
  position: absolute;
  left: var(--doc-padding);
  right: var(--doc-padding);
  bottom: 14mm;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 8px;
  border-top: 1px solid #e8e8e8;
  font-size: 8.5pt;
  color: var(--color-text-muted);
  pointer-events: none;
}

.doc-page-brand {
  font-style: italic;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.doc-page-number {
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.doc-page-chapter .doc-page-body {
  padding-top: calc(var(--doc-padding) - 4mm);
}

.doc-page-chapter .doc-page-footer,
.doc-page-cover .doc-page-footer {
  border-top-color: transparent;
}

/* Cover */
.doc-page-cover .doc-cover {
  min-height: 297mm;
  display: flex;
  flex-direction: column;
  padding: 18mm var(--doc-padding) var(--doc-padding);
}

.doc-cover { page-break-after: always; }

/* Co-brand bar, top right (Forvis Mazars + TPO): same treatment and
   proportions as the executive deck cover cobranding (.cover-cobranding). */
.doc-cover-topbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}
.doc-cover-topbar .doc-cover-brand-img { height: 48px; width: auto; }
.doc-cover-cobrand-sep {
  font-size: 16px;
  color: #9a9a9a;
  font-weight: 300;
  line-height: 1;
}
.doc-cover-tpo-img { height: 80px; width: auto; }

.doc-cover-titleblock { margin-top: 52px; }
.doc-cover-version { font-size: 10.5pt; color: var(--color-muted); margin-top: 10px; }
.doc-cover-eyebrow {
  font-size: 10pt;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-primary-light);
}
.doc-cover h1 {
  font-size: 26pt;
  color: var(--color-primary);
  margin: 16px 0 8px;
  line-height: 1.15;
}
.doc-cover .doc-subtitle {
  font-size: 14pt;
  color: #58595b;
  margin-bottom: 24px;
}
.doc-cover-meta {
  margin-top: auto;
  padding-top: 12px;
  font-size: 10pt;
  color: #58595b;
}
.doc-cover-meta table { width: 100%; border-collapse: collapse; }
.doc-cover-meta td { padding: 4px 0; vertical-align: top; }
.doc-cover-meta td:first-child { width: 130px; font-weight: 600; color: #2d2d2d; }

/* Chapter dividers (TPO executive-deck pattern, document form) */
.doc-chapter {
  margin: 0;
  height: 180mm;
  min-height: 180mm;
  max-height: 180mm;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  background-color: var(--chapter-bg-fallback);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  scroll-margin-top: 52px;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
.doc-chapter::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    var(--chapter-overlay-start) 0%,
    var(--chapter-overlay-end) 100%
  );
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

/* Full-page chapter divider: its own A4 sheet, photo fills the page */
.doc-page-divider {
  overflow: hidden;
}
.doc-page-divider .doc-chapter {
  height: 297mm;
  min-height: 297mm;
  max-height: 297mm;
}
.doc-page-divider .doc-page-footer { display: none; }
.doc-chapter-overlay {
  position: relative;
  z-index: 1;
  padding: 48px 22mm 56px;
  color: #fff;
}
.doc-chapter-number {
  font-size: 48pt;
  font-weight: 700;
  line-height: 1;
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: 8px;
}
.doc-chapter-title {
  font-size: 22pt;
  font-weight: 700;
  line-height: 1.2;
}

/* Contents block: formal break after reference tables above */
.doc-contents-block {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 2px solid var(--color-border);
}
.doc-contents-block > h3 {
  margin-top: 0;
}

/* Contents table: same polish as Key terms / S1-S9, with column tweaks */
.doc-contents-table {
  margin-top: 10px;
}
.doc-contents-table td:first-child {
  width: 48px;
  text-align: center;
  font-weight: 700;
}
.doc-contents-table td.doc-contents-page {
  width: 56px;
  text-align: right;
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
}
.doc-contents-table a {
  text-decoration: none;
  color: inherit;
}
.doc-contents-table a:hover {
  color: var(--color-primary-light);
}

/* TPO deck typography within doc pages */
.doc-eyebrow {
  font-size: 9.5pt;
  color: var(--color-muted);
  margin: 0 0 6px;
}
.doc-hook {
  margin: 0 0 10px;
  color: var(--color-primary-light);
  font-size: 10.5pt;
  line-height: 1.35;
}
.doc-pill {
  display: inline-block;
  font-size: 7.5pt;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #ffffff;
  background: var(--color-primary-light);
  padding: 3px 8px;
  margin-bottom: 6px;
}
.doc-pill-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-bottom: 6px;
}
.doc-pill-stack iconify-icon {
  font-size: 22px;
  color: var(--color-text);
  margin-bottom: 2px;
}

/* Principle and deck cards */
.doc-principles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 14px 0 18px;
}
.doc-principles.doc-grid3 {
  grid-template-columns: repeat(3, 1fr);
}
.doc-principle-card {
  background: #fff;
  border: 1px solid var(--color-line);
  padding: 12px 14px;
  font-size: 10pt;
}
.doc-principle-card.info {
  background: var(--color-info);
  border-color: var(--color-info-border);
}
.doc-principle-card.success {
  background: var(--color-success);
  border-color: var(--color-success-border);
}
.doc-principle-card h4 {
  font-size: 10.5pt;
  color: var(--color-text);
  margin: 0 0 6px;
}
.doc-principle-card p { margin: 0; font-size: 10pt; color: var(--color-muted); }
.doc-phase-label {
  font-size: 8.5pt;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-primary);
  margin: 10px 0 2px !important;
}
.doc-principle-card ul {
  margin: 6px 0 0 16px;
  padding: 0;
}
.doc-principle-card li {
  font-size: 9.5pt;
  line-height: 1.35;
  margin-bottom: 4px;
  color: var(--color-muted);
}
.doc-card-wide {
  margin: 12px 0 16px;
  padding: 12px 14px;
  border: 1px solid var(--color-success-border);
  background: var(--color-success);
  font-size: 10pt;
}
.doc-card-wide p { margin: 0; }

/* Stack and architecture diagrams */
.doc-diagram-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin: 14px 0 18px;
  align-items: start;
}
.doc-diagram-card {
  border: 1px solid var(--color-line);
  background: #fff;
  padding: 8px;
  min-height: 0;
}
.doc-diagram-svg {
  width: 100%;
  height: auto;
  display: block;
}
.doc-diagram-readout {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.doc-diagram-readout .doc-principle-card { margin: 0; }

.doc-architecture-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin: 14px 0 18px;
  align-items: start;
}
.doc-architecture-card {
  border: 1px solid var(--color-line);
  background: #fff;
  padding: 8px;
  min-height: 0;
}
.doc-architecture-svg {
  width: 100%;
  height: auto;
  display: block;
}
.doc-architecture-readout {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.doc-architecture-readout .doc-principle-card { margin: 0; }

/* Sovereignty spectrum */
.doc-spectrum-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin: 14px 0 18px;
  align-items: start;
}
.doc-spectrum-card {
  border: 1px solid var(--color-line);
  background: #fff;
  padding: 8px;
}

/* Logo / vendor grid */
.doc-logo-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 14px 0 18px;
}
.doc-logo-cell {
  border: 1px solid var(--color-line);
  background: #fff;
  padding: 8px 6px;
  min-height: 72px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.doc-logo-cell .doc-logo-label {
  font-size: 8pt;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.15;
}
.doc-logo-cell .doc-logo-sub {
  font-size: 7pt;
  color: var(--color-muted);
  margin-top: 2px;
  line-height: 1.1;
}

/* Phase / OODA track */
.doc-phase-track {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin: 14px 0 18px;
}
.doc-phase-card {
  border: 1px solid var(--color-line);
  background: #fff;
  padding: 10px 8px;
  min-height: 88px;
}
.doc-phase-card.info {
  background: var(--color-info);
  border-color: var(--color-info-border);
}
.doc-phase-card.success {
  background: var(--color-success);
  border-color: var(--color-success-border);
}
.doc-phase-card h4 {
  font-size: 9pt;
  color: var(--color-text);
  margin: 0 0 4px;
}
.doc-phase-card p {
  margin: 0;
  font-size: 8pt;
  line-height: 1.28;
  color: var(--color-muted);
}

/* Roadmap steps */
.doc-roadmap-steps {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 14px 0 18px;
}
.doc-roadmap-step {
  background: #fafafa;
  border: 1px solid #e2e8f0;
  border-top: 3px solid var(--color-primary-light);
  padding: 12px 14px;
}
.doc-roadmap-step-number {
  font-size: 18pt;
  font-weight: 700;
  color: var(--color-primary);
  opacity: 0.45;
  line-height: 1;
  margin-bottom: 6px;
}
.doc-roadmap-step h4 {
  font-size: 11pt;
  color: var(--color-primary);
  margin: 0 0 6px;
}
.doc-roadmap-step p {
  margin: 0;
  font-size: 10pt;
}

/* Alignment prompt cards */
.doc-prompt-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 14px 0 18px;
}
.doc-prompt-card {
  background: #f8fafc;
  border: 1px solid #dbe4ee;
  padding: 10px 12px;
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.doc-prompt-card iconify-icon {
  font-size: 20px;
  color: var(--color-primary-light);
  flex-shrink: 0;
  margin-top: 2px;
}
.doc-prompt-card h4 {
  font-size: 10.5pt;
  color: var(--color-primary);
  margin: 0 0 4px;
}
.doc-prompt-card p {
  margin: 0;
  font-size: 10pt;
  color: #58595b;
}

.doc-table-polish th {
  background: var(--color-primary);
}
.doc-table-polish tr:nth-child(even) td {
  background: #f0f4fa;
}
.doc-table-polish td strong {
  color: var(--color-primary);
}
.doc-table-polish td.doc-table-group,
.doc-table-polish tr:nth-child(even) td.doc-table-group {
  background: #e2eaf5;
  border-top: 2px solid var(--color-primary);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Appendix B AIN module tree: compact nested lists, normal (non-code) paths */
.doc-module-tree ul {
  margin: 0;
  padding-left: 1.2em;
}
.doc-module-tree li {
  margin-bottom: 0;
  line-height: 1.35;
}
.doc-module-tree ul ul {
  margin-top: 0;
  margin-bottom: 0;
}

/* Headings */
.document-content h2 {
  font-size: 16pt;
  color: var(--color-primary);
  margin: 28px 0 10px;
  page-break-after: avoid;
}
.document-content h2:first-of-type { margin-top: 0; }
.document-content h3 {
  font-size: 12pt;
  color: var(--color-primary-light);
  margin: 18px 0 8px;
  page-break-after: avoid;
}
.document-content h4 {
  font-size: 11pt;
  color: #2d2d2d;
  margin: 14px 0 6px;
}

.document-content p { margin: 0 0 10px; }
.document-content ul, .document-content ol { margin: 0 0 12px 20px; }
.document-content li { margin-bottom: 4px; }
.document-content a { color: var(--color-primary-light); }

.document-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0 16px;
  font-size: 10pt;
  page-break-inside: avoid;
}
.document-content th,
.document-content td {
  border: 1px solid #c8c8c8;
  padding: 6px 8px;
  vertical-align: top;
  text-align: left;
}
.document-content th {
  background: var(--color-primary);
  color: #fff;
  font-weight: 600;
}
.document-content tr:nth-child(even) td { background: #f0f4fa; }

.document-content pre,
.document-content code {
  font-family: Consolas, "Courier New", monospace;
  font-size: 9pt;
}
.document-content pre {
  background: #f6f8fa;
  border: 1px solid #e2e8f0;
  padding: 10px 12px;
  margin: 10px 0 14px;
  overflow-x: auto;
  white-space: pre-wrap;
  page-break-inside: avoid;
}

.document-content .checklist { list-style: none; margin-left: 0; }
.document-content .checklist li::before { content: "☐ "; color: var(--color-primary); }

.doc-section { page-break-inside: auto; }
.doc-page-break { page-break-before: always; break-before: page; }

.doc-note {
  background: #f0f7ff;
  border: 1px solid #dbe4ee;
  padding: 10px 12px;
  margin: 12px 0;
  font-size: 10pt;
}

.doc-end {
  margin-top: 32px;
  padding-top: 12px;
  border-top: 1px solid var(--color-border);
  font-style: italic;
  color: var(--color-text-muted);
  font-size: 10pt;
}

/* Print / Save as PDF (selectable, vector text). The page carries no margin;
   each A4 sheet fills the printed page, and content insets come from padding so
   the result is identical whatever "Margins" setting the print dialog uses. */
@page {
  size: A4 portrait;
  margin: 0;
}

@media print {
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  /* deck-export.css forces body width to 1280px for 16:9 slides; override it so
     this A4 document is not scaled down and pushed to the top-left corner. */
  html, body {
    background: #fff !important;
    width: 210mm !important;
    min-width: 0 !important;
    max-width: none !important;
    height: auto !important;
    overflow: visible;
  }
  .doc-sidebar, .portal-breadcrumb, .deck-menubar, #doc-export-container { display: none !important; }
  .app-container { display: block; height: auto; }
  .document-viewport {
    display: block;
    overflow: visible;
    padding: 0 !important;
    margin: 0 !important;
    background: #fff;
  }
  /* Was a centered flex column, which shrank each sheet to its content width.
     Make it a plain block so every sheet fills the A4 page. */
  .document-stack {
    display: block;
    gap: 0;
    max-width: none !important;
    width: 210mm !important;
    margin: 0 !important;
    transform: none !important;
    zoom: normal !important;
  }
  .document-content { width: 100% !important; }

  .doc-page {
    width: 210mm !important;
    height: auto;
    min-height: 297mm;
    margin: 0 !important;
    border: none !important;
    box-shadow: none !important;
    overflow: hidden;
    position: relative;
    page-break-after: always;
    break-after: page;
    box-sizing: border-box;
  }
  .doc-page:last-child { page-break-after: auto; break-after: auto; }
  .doc-page-body { padding: 16mm 15mm calc(16mm + 14mm) !important; }
  .doc-page-footer {
    display: flex !important;
    position: absolute;
    left: 15mm !important;
    right: 15mm !important;
    bottom: 14mm !important;
    border-top: 1px solid #e8e8e8;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .doc-page-cover .doc-page-footer,
  .doc-page-divider .doc-page-footer {
    display: none !important;
  }

  /* Cover and chapter dividers are exactly one full-bleed A4 page each. */
  .doc-page-cover,
  .doc-page-divider {
    width: 210mm !important;
    height: 297mm !important;
    min-height: 297mm !important;
    max-height: 297mm !important;
    padding: 0 !important;
    overflow: hidden;
  }
  .doc-page-cover .doc-cover,
  .doc-page-divider .doc-chapter {
    width: 100% !important;
    height: 100% !important;
    min-height: 100% !important;
    max-height: none !important;
    margin: 0 !important;
  }

  /* Keep tables, cards, and diagrams from splitting across a page break. */
  table, tr, .doc-principle-card, .doc-diagram-card, .doc-diagram-layout,
  .doc-architecture-layout, .doc-spectrum-layout, pre, svg, img { break-inside: avoid; }
  h1, h2, h3, h4 { break-after: avoid; }
}

@media screen and (max-width: 900px) {
  /* iOS Safari: abandon the fixed-height split layout and let the BODY scroll
     natively. Inner-div overflow scroll is unreliable on iOS Safari; the body
     must be the scroll container. The fixed announcement bar, breadcrumb, and
     menubar stay fixed, and body keeps its padding-top (from
     announcement-bar.css) so content is not hidden under the chrome. */
  html,
  body {
    overflow: auto !important;
    overflow-y: auto !important;
    height: auto !important;
    min-height: 100% !important;
    position: static !important;
  }
  .app-container {
    display: block !important;
    flex-direction: column !important;
    height: auto !important;
    min-height: 100% !important;
    max-height: none !important;
  }
  body.doc-has-menubar:not(.has-announcement-bar) .app-container,
  body.has-announcement-bar.doc-has-menubar .app-container {
    height: auto !important;
    max-height: none !important;
  }
  .document-viewport {
    overflow: visible !important;
    overflow-y: visible !important;
    height: auto !important;
    max-height: none !important;
    min-height: 0 !important;
    position: static !important;
    padding: 12px;
    -webkit-overflow-scrolling: auto;
    touch-action: auto;
  }
  .doc-sidebar-scroll {
    overflow: visible !important;
    height: auto !important;
  }
  .doc-sidebar { display: none; }
  .doc-principles,
  .doc-principles.doc-grid3 { grid-template-columns: 1fr; }
  .doc-roadmap-steps { grid-template-columns: 1fr; }
  .doc-prompt-grid { grid-template-columns: 1fr; }
  .doc-diagram-layout,
  .doc-spectrum-layout,
  .doc-architecture-layout { grid-template-columns: 1fr; }
  .doc-logo-grid { grid-template-columns: repeat(2, 1fr); }
  .doc-phase-track { grid-template-columns: 1fr 1fr; }
}

/* Appendix D: delivery team CVs (photo | profile tables) */
.doc-cv-table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0 22px;
  table-layout: fixed;
}

.doc-cv-table tr {
  border-bottom: none;
}

.doc-cv-table tr + tr .doc-cv-photo,
.doc-cv-table tr + tr .doc-cv-profile {
  padding-top: 20px;
}

.document-content .doc-cv-table tr td {
  background: #fff;
  border: none;
}

/* Platform screenshots (Nexus walkthrough) */
.doc-shot {
  margin: 18px 0 22px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  break-inside: avoid;
}
.doc-shot img {
  display: block;
  width: 100%;
  height: auto;
  border-bottom: 1px solid var(--color-border);
}
.doc-shot figcaption {
  padding: 10px 14px 12px;
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--color-text);
}
.doc-shot figcaption strong { color: var(--color-primary); }

.doc-cv-photo {
  width: 148px;
  vertical-align: top;
  padding: 12px 14px 12px 0;
}

.doc-cv-photo img {
  width: 128px;
  height: auto;
  display: block;
  border: 1px solid var(--color-border);
  background: #fff;
}

.doc-cv-photo-empty {
  width: 148px;
  padding: 12px 14px 12px 0;
}

.doc-cv-profile {
  vertical-align: top;
  padding: 12px 0 16px 8px;
}

.doc-cv-engagement {
  font-size: 9pt;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-primary);
  margin: 0 0 4px;
}

.doc-cv-echelon {
  font-size: 9pt;
  color: var(--color-muted);
  margin: 0 0 6px;
  font-style: italic;
}

.doc-cv-profile h4 {
  font-size: 13pt;
  color: var(--color-ink);
  margin: 0 0 2px;
}

.doc-cv-title {
  font-size: 10pt;
  color: var(--color-muted);
  margin: 0 0 8px;
  font-style: italic;
}

.doc-cv-profile p { margin: 0 0 8px; font-size: 10pt; }

.doc-cv-profile ul {
  margin: 0 0 8px 18px;
  font-size: 9.5pt;
}

.doc-cv-profile li { margin-bottom: 3px; }

.doc-cv-meta {
  font-size: 9pt;
  color: var(--color-text-muted);
  margin: 0 !important;
  padding-top: 0;
}

.doc-cv-meta a { color: var(--color-primary-light); }

@media (max-width: 700px) {
  .doc-cv-table,
  .doc-cv-table tbody,
  .doc-cv-table tr,
  .doc-cv-table td { display: block; width: 100%; }
  .doc-cv-photo { padding: 0 0 10px; }
  .doc-cv-photo img { margin: 0 auto; }
  .doc-cv-profile { padding-left: 0; }
}

@media print {
  .doc-cv-table tr { break-inside: avoid; }
}

/* AIN chat panel: body.chat-open margin-right (chat-panel.js) shrinks layout; avoid 100vw here (double shrink + overflow). */

/* Narrow document area (chat panel open or small window): keep the fixed
   menubar's non-shrinking items (section select, search) from running past
   the menubar's right edge and under the chat panel. app.js toggles the
   class from the measured .app-container width. */
body.doc-narrow .deck-search-wrap { display: none; }
body.doc-narrow .deck-menubar-section-select { max-width: 150px; }
body.doc-narrow .doc-sidebar { display: none; }

/* Read aloud: floating control bar + current-block highlight (app.js DocReader) */
.doc-reader-bar {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  z-index: 99999; /* under the menubar (100000), above document + chat overlay */
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  background: #171c8f;
  color: #fff;
  border-radius: 999px;
  box-shadow: 0 6px 24px rgba(23, 28, 143, 0.35);
  font-family: inherit;
}

.doc-reader-bar[hidden] { display: none; }

.doc-reader-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0 6px 0 2px;
  opacity: 0.9;
}

.doc-reader-label svg { width: 14px; height: 14px; }

.doc-reader-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #fff;
  cursor: pointer;
  transition: background 0.15s ease;
}

.doc-reader-btn:hover { background: rgba(255, 255, 255, 0.18); }

.doc-reader-btn svg { width: 15px; height: 15px; }

.doc-reader-status {
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  opacity: 0.85;
  padding: 0 6px;
  min-width: 52px;
  max-width: 240px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  text-align: center;
}

.doc-reading-block {
  background: rgba(0, 114, 206, 0.08);
  box-shadow: 0 0 0 4px rgba(0, 114, 206, 0.08);
  border-radius: 2px;
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

@media print {
  .doc-reader-bar { display: none !important; }
  .doc-reading-block { background: none !important; box-shadow: none !important; }
}

@media screen and (max-width: 700px) {
  .doc-reader-bar { bottom: 12px; max-width: calc(100vw - 24px); }
  .doc-reader-label span { display: none; }
}

h2.sow-cite-highlight,
h3.sow-cite-highlight,
h4.sow-cite-highlight {
  outline: 2px solid #0072ce;
  outline-offset: 4px;
  background: rgba(0, 114, 206, 0.08);
  transition: background 0.35s ease, outline-color 0.35s ease;
}
