/**
 * Report Document Styles
 *
 * Renders MD→HTML as a professional report document.
 * Scoped to .report-document — does not leak into site styles.
 *
 * Brand palette:
 *   Ink:      #002a41    Paper:    #FEFDFB    Gold:     #FFCC33
 *   GoldDark: #9E7700    Steel:    #374151    Sand:     #F7F4F0
 *   Concrete: #E8E4DC    Slate:    #536171    Grey:     #222222
 *   Signal:   #6048a0    Scan:     #8d2b8d    Solutions:#3468b6
 */

/* ============================================
   REPORT VIEWER PANEL
   The container that holds the report document.
   Desktop: side panel. Mobile: full-screen overlay.
   ============================================ */

.report-viewer {
  background: #111518;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.report-viewer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(254, 253, 251, 0.1);
  flex-shrink: 0;
  background: #111518;
}

.report-viewer-title {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  color: rgba(254, 253, 251, 0.7);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.report-viewer-close {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: rgba(254, 253, 251, 0.5);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: color 0.15s, background-color 0.15s;
}

.report-viewer-close:hover {
  color: #FEFDFB;
  background: rgba(254, 253, 251, 0.1);
}

/* Tab bar for toggling Day 0 / Day 60 */
.report-viewer-tabs {
  display: flex;
  gap: 2px;
  padding: 8px 16px;
  border-bottom: 1px solid rgba(254, 253, 251, 0.08);
  flex-shrink: 0;
  background: #111518;
}

.report-viewer-tab {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  color: rgba(254, 253, 251, 0.5);
  background: transparent;
  transition: color 0.15s, background-color 0.15s;
}

.report-viewer-tab:hover {
  color: rgba(254, 253, 251, 0.8);
  background: rgba(254, 253, 251, 0.05);
}

.report-viewer-tab.active {
  color: #FEFDFB;
  background: rgba(254, 253, 251, 0.1);
  box-shadow: inset 0 -2px 0 #FFCC33;
}

/* Mobile: larger close button with label */
@media (max-width: 1023px) {
  .report-viewer-close {
    width: auto;
    height: auto;
    padding: 6px 12px;
    font-size: 0.8125rem;
    font-weight: 600;
    gap: 4px;
    border-radius: 6px;
    background: rgba(254, 253, 251, 0.08);
  }

  .report-viewer-close:hover {
    background: rgba(254, 253, 251, 0.15);
  }
}

/* Scrollable content area */
.report-viewer-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px 20px;
  overscroll-behavior: contain;
}

/* Scrollbar in report viewer */
.report-viewer-content::-webkit-scrollbar {
  width: 6px;
}

.report-viewer-content::-webkit-scrollbar-track {
  background: transparent;
}

.report-viewer-content::-webkit-scrollbar-thumb {
  background: rgba(254, 253, 251, 0.12);
  border-radius: 3px;
}

.report-viewer-content::-webkit-scrollbar-thumb:hover {
  background: rgba(254, 253, 251, 0.2);
}


/* ============================================
   REPORT DOCUMENT
   The rendered report itself — a white "page"
   floating on the dark viewer background.
   ============================================ */

.report-document {
  background: #FEFDFB;
  color: #002a41;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.7;
  border-radius: 8px;
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.12),
    0 4px 12px rgba(0, 0, 0, 0.08);
  padding: 40px 36px;
  max-width: 720px;
  margin: 0 auto;
  /* Prevent content from leaking outside the document boundary */
  overflow: hidden;
}

/* Tighter padding on small viewports */
@media (max-width: 640px) {
  .report-document {
    padding: 28px 20px;
    border-radius: 6px;
    font-size: 14px;
  }
}

/* Tighter padding when report lives in a side panel (not fullscreen) */
@media (min-width: 1024px) {
  .rv-report-column .report-document {
    padding: 32px 24px;
  }

  .rv-report-column .report-viewer-content {
    padding: 20px 16px;
  }
}


/* ============================================
   REPORT HEADER
   Brand bar at top of each report page.
   ============================================ */

.report-document .report-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding-bottom: 20px;
  margin-bottom: 28px;
  border-bottom: 2px solid #002a41;
}

.report-document .report-header-brand {
  font-family: 'Arial Black', 'Helvetica Neue', sans-serif;
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #536171;
}

.report-document .report-header-meta {
  text-align: right;
  font-size: 0.75rem;
  color: #536171;
  line-height: 1.5;
}


/* ============================================
   HEADINGS
   Arial Black, all caps, weight 900
   ============================================ */

.report-document h1 {
  font-family: 'Arial Black', 'Helvetica Neue', sans-serif;
  font-size: 1.5rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: #002a41;
  margin: 0 0 16px;
}

/* Report title — largest heading, with gold accent bar */
.report-document h1:first-of-type {
  padding-bottom: 16px;
  margin-bottom: 24px;
  border-bottom: 3px solid #FFCC33;
}

.report-document h2 {
  font-family: 'Arial Black', 'Helvetica Neue', sans-serif;
  font-size: 1.1rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: #002a41;
  margin: 32px 0 12px;
}

.report-document h3 {
  font-family: 'Arial Black', 'Helvetica Neue', sans-serif;
  font-size: 0.95rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  line-height: 1.2;
  color: #002a41;
  margin: 24px 0 8px;
}

.report-document h4 {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  color: #002a41;
  margin: 20px 0 6px;
}

/* Remove top margin from first heading after report header */
.report-document .report-header + h1,
.report-document .report-header + h2,
.report-document > h1:first-child,
.report-document > h2:first-child {
  margin-top: 0;
}


/* ============================================
   BODY TEXT
   ============================================ */

.report-document p {
  margin: 0 0 12px;
  color: #002a41;
}

.report-document p:last-child {
  margin-bottom: 0;
}

.report-document strong {
  font-weight: 700;
  color: #002a41;
}

.report-document em {
  font-style: italic;
  color: #374151;
}

.report-document a {
  color: #3468b6;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.report-document a:hover {
  color: #002a41;
}


/* ============================================
   HIGHLIGHT / KEY METRIC CALLOUTS
   For key numbers like "0% visibility" or "67%"
   ============================================ */

.report-document .metric-highlight {
  display: inline-block;
  background: linear-gradient(135deg, #8d2b8d, #6048a0, #3468b6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-family: 'Arial Black', 'Helvetica Neue', sans-serif;
  font-weight: 900;
  font-size: 2rem;
  line-height: 1;
}

/* Callout box for key findings */
.report-document blockquote {
  margin: 20px 0;
  padding: 16px 20px;
  background: #F7F4F0;
  border-left: 4px solid #FFCC33;
  border-radius: 0 6px 6px 0;
  color: #002a41;
  font-size: 0.95rem;
}

.report-document blockquote p {
  margin: 0 0 8px;
  color: inherit;
}

.report-document blockquote p:last-child {
  margin-bottom: 0;
}

.report-document blockquote strong {
  color: #002a41;
}


/* ============================================
   TABLES
   Platform breakdowns, persona data, etc.
   ============================================ */

.report-document table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 0.875rem;
  line-height: 1.5;
  /* Always allow horizontal scroll when table exceeds container */
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.report-document thead th {
  font-family: 'Arial Black', 'Helvetica Neue', sans-serif;
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #536171;
  text-align: left;
  padding: 8px 12px;
  border-bottom: 2px solid #002a41;
  white-space: nowrap;
}

.report-document tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid #E8E4DC;
  color: #002a41;
  vertical-align: top;
}

.report-document tbody tr:last-child td {
  border-bottom: none;
}

/* Alternating row background */
.report-document tbody tr:nth-child(even) {
  background: #F7F4F0;
}

/* Hover state */
.report-document tbody tr:hover {
  background: rgba(255, 204, 51, 0.08);
}

/* Table footer / totals row */
.report-document tfoot td {
  font-weight: 700;
  padding: 10px 12px;
  border-top: 2px solid #002a41;
  color: #002a41;
}

/* Tighter table cells on small screens */
@media (max-width: 640px) {
  .report-document thead th,
  .report-document tbody td {
    padding: 8px 10px;
    font-size: 0.8125rem;
  }
}


/* ============================================
   LISTS
   ============================================ */

.report-document ul,
.report-document ol {
  margin: 12px 0;
  padding-left: 24px;
}

.report-document li {
  margin: 6px 0;
  color: #002a41;
}

.report-document li::marker {
  color: #9E7700;
}

.report-document ul li {
  list-style-type: disc;
}

.report-document ol li {
  list-style-type: decimal;
}

/* Nested lists */
.report-document ul ul,
.report-document ol ol,
.report-document ul ol,
.report-document ol ul {
  margin: 4px 0;
}


/* ============================================
   HORIZONTAL RULES
   Section dividers
   ============================================ */

.report-document hr {
  border: none;
  height: 1px;
  background: #E8E4DC;
  margin: 32px 0;
}


/* ============================================
   CODE / METHODOLOGY
   For technical details, confidence intervals
   ============================================ */

.report-document code {
  font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
  font-size: 0.85em;
  background: #F7F4F0;
  padding: 2px 6px;
  border-radius: 3px;
  color: #6048a0;
}

.report-document pre {
  background: #F7F4F0;
  border: 1px solid #E8E4DC;
  border-radius: 6px;
  padding: 16px;
  margin: 16px 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.report-document pre code {
  background: none;
  padding: 0;
  font-size: 0.8125rem;
  line-height: 1.6;
  color: #002a41;
}


/* ============================================
   IMAGES
   Charts, diagrams embedded in reports
   ============================================ */

.report-document img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  margin: 16px 0;
}


/* ============================================
   REPORT FOOTER
   Confidentiality, page info
   ============================================ */

.report-document .report-footer {
  margin-top: 40px;
  padding-top: 16px;
  border-top: 1px solid #E8E4DC;
  font-size: 0.7rem;
  color: #536171;
  line-height: 1.6;
  text-align: center;
}


/* ============================================
   METHODOLOGY APPENDIX
   Slightly different styling for the appendix
   section — tighter, more technical
   ============================================ */

.report-document .appendix {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 2px solid #E8E4DC;
}

.report-document .appendix p {
  font-size: 0.875rem;
  color: #374151;
  line-height: 1.65;
}

.report-document .appendix table {
  font-size: 0.8125rem;
}

.report-document .appendix blockquote {
  font-size: 0.875rem;
  background: rgba(96, 72, 160, 0.06);
  border-left-color: #6048a0;
}


/* ============================================
   CONFIDENCE BADGES
   For inline confidence indicators like [High] [Medium]
   ============================================ */

.report-document .badge {
  display: inline-block;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: 4px;
  vertical-align: middle;
}

.report-document .badge-high {
  background: rgba(52, 104, 182, 0.12);
  color: #3468b6;
}

.report-document .badge-medium {
  background: rgba(158, 119, 0, 0.12);
  color: #9E7700;
}

.report-document .badge-low {
  background: rgba(141, 43, 141, 0.12);
  color: #8d2b8d;
}


/* ============================================
   PLATFORM STATUS INDICATORS
   Colored dots/labels for platform visibility
   ============================================ */

.report-document .platform-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8125rem;
}

.report-document .platform-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.report-document .platform-dot.visible {
  background: #3468b6;
}

.report-document .platform-dot.partial {
  background: #FFCC33;
}

.report-document .platform-dot.invisible {
  background: #E8E4DC;
}


/* ============================================
   SCORE DISPLAY
   Large visibility percentage in context
   ============================================ */

.report-document .score-block {
  text-align: center;
  padding: 24px;
  margin: 24px 0;
  background: #F7F4F0;
  border-radius: 8px;
}

.report-document .score-number {
  font-family: 'Arial Black', 'Helvetica Neue', sans-serif;
  font-weight: 900;
  font-size: 3rem;
  line-height: 1;
  color: #002a41;
}

.report-document .score-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #536171;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 8px;
}


/* ============================================
   EASY-READ MODE — Report viewer chrome overrides
   Light theme for the viewer panel surrounding
   the report document.
   ============================================ */

body.easy-read-mode .report-viewer {
  background: #FEFDFB;
}

body.easy-read-mode .report-viewer-header {
  background: #FEFDFB;
  border-bottom-color: #CBD5E1;
}

body.easy-read-mode .report-viewer-title {
  color: #374151;
}

body.easy-read-mode .report-viewer-close {
  color: #6B7280;
}

body.easy-read-mode .report-viewer-close:hover {
  color: #002a41;
  background: rgba(0, 42, 65, 0.05);
}

body.easy-read-mode .report-viewer-tabs {
  background: #FEFDFB;
  border-bottom-color: #CBD5E1;
}

body.easy-read-mode .report-viewer-tab {
  color: #6B7280;
}

body.easy-read-mode .report-viewer-tab:hover {
  color: #374151;
  background: rgba(0, 42, 65, 0.05);
}

body.easy-read-mode .report-viewer-tab.active {
  color: #002a41;
  background: #F5F3F0;
  box-shadow: inset 0 -2px 0 #9E7700;
}

body.easy-read-mode .report-viewer-content::-webkit-scrollbar-thumb {
  background: rgba(0, 42, 65, 0.15);
}

body.easy-read-mode .report-viewer-content::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 42, 65, 0.25);
}

/* Report document — softer shadow on light background */
body.easy-read-mode .report-document {
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.08),
    0 4px 12px rgba(0, 0, 0, 0.05);
  border: 1px solid #E8E4DC;
}


/* ============================================
   PRINT STYLES
   Clean up when someone prints the report
   ============================================ */

@media print {
  .report-viewer-header,
  .report-viewer-tabs,
  .report-viewer-close {
    display: none;
  }

  .report-document {
    box-shadow: none;
    border-radius: 0;
    padding: 0;
    max-width: none;
  }
}
