
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

.report-detail {
  background: var(--apr-bg);
  color: var(--apr-text);

  /* ── Design token fallbacks (ensure these resolve without atlas-shell-global.css) ── */
  --apr-navy: #2c3e50;
  --apr-border: #d9e2ec;
  --apr-surface: #ffffff;
  --apr-radius: 8px;
  --apr-shadow: 0 1px 6px rgba(0,0,0,0.08);
  --apr-focus: #3b82f6;

  /* ── Table typography tokens (PR #249) ─────────────────────────────────
     Single source of truth for all report table styling.
     Override these variables in a @media block to change mobile behavior.
     No !important chains needed.
  ─────────────────────────────────────────────────────────────────────── */
  --apr-table-font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --apr-table-header-font-size: 0.82rem;
  --apr-table-header-font-weight: 700;
  --apr-table-header-letter-spacing: 0.03em;
  --apr-table-cell-font-size: 0.875rem;
  --apr-table-cell-line-height: 1.45;
  --apr-table-cell-font-weight: 400;
  --apr-table-label-font-weight: 600;
  --apr-table-cell-padding-y: 7px;
  --apr-table-cell-padding-x: 12px;
}

.report-detail .report-body-card {
  margin-top: 16px;
  padding: 24px;
  background: var(--apr-surface);
  border: 1px solid var(--apr-border);
  border-radius: var(--apr-radius);
  box-shadow: var(--apr-shadow);
}

.report-detail .report-body-card > :first-child {
  margin-top: 0;
}

.report-detail h1,
.report-detail h2,
.report-detail h3 {
  color: var(--apr-text);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.report-detail h1 {
  margin: 0 0 18px;
  font-size: 26px;
  font-weight: 800;
}

.report-detail h2 {
  margin: 32px 0 14px;
  font-size: 18px;
  font-weight: 700;
  scroll-margin-top: 100px;
}

.report-detail h3 {
  margin: 22px 0 12px;
  font-size: 15px;
  font-weight: 600;
  scroll-margin-top: 100px;
}

.report-detail p,
.report-detail li,
.report-detail blockquote {
  color: var(--apr-text);
  font-size: 1rem;
  line-height: 1.72;
}

.report-detail p,
.report-detail ul,
.report-detail ol,
.report-detail blockquote,
.report-detail pre,
.report-detail table,
.report-detail figure {
  /* margin: 0 0 16px; */
}

.report-detail ul,
.report-detail ol {
  /* padding-left: 1.3rem; */
}

.report-detail blockquote {
  margin-left: 0;
  padding: 12px 16px;
  border-left: 4px solid #c5d5e5;
  background: #f8fbff;
  border-radius: 0 10px 10px 0;
}

.report-detail pre,
.report-detail code {
  font-family:
    ui-monospace,
    SFMono-Regular,
    Menlo,
    Monaco,
    Consolas,
    "Liberation Mono",
    monospace;
}

.report-detail pre {
  overflow-x: auto;
  padding: 14px 16px;
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 12px;
}

.report-detail hr {
  margin: 26px 0;
  border: 0;
  border-top: 1px solid var(--apr-border);
}

.report-detail .report-meta {
  display: flex;
  gap: 8px 10px;
  align-items: center;
  flex-wrap: wrap;
  color: var(--apr-muted);
  font-size: 0.94rem;
}

.report-detail .summary-box,
.report-detail .sources-box,
.report-detail .callout-box {
  margin: 16px 0;
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid var(--apr-border);
  background: #f8fbff;
}

.report-detail .sources-box {
  border-color: #cce8d5;
  background: #f4fbf6;
}

.report-detail .meta {
  color: var(--apr-muted);
  font-size: 0.92rem;
}

.report-detail .positive {
  color: #15803d;
  font-weight: 700;
}

.report-detail .negative {
  color: #b91c1c;
  font-weight: 700;
}

.report-detail .signal-bullish {
  color: #15803d;
  font-weight: 700;
}

.report-detail .signal-bearish {
  color: #b91c1c;
  font-weight: 700;
}

.report-detail .signal-neutral {
  color: #64748b;
  font-weight: 700;
}

.report-detail .table-wrapper {
  position: relative;
  width: 100%;
  margin: 16px 0;
  overflow-x: auto;
  overflow-y: visible;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable both-edges;
  border: 1px solid var(--apr-border);
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.10);
}

.report-detail .table-wrapper:focus {
  outline: 2px solid var(--apr-focus);
  outline-offset: 2px;
}

.report-detail table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

.report-detail caption {
  padding: 12px 14px 0;
  color: var(--apr-muted);
  text-align: left;
  font-size: 0.9rem;
  font-weight: 600;
  caption-side: top;
}

.report-detail colgroup,
.report-detail col {
  display: table-column-group;
}

.report-detail thead th {
  padding: var(--apr-table-cell-padding-y) var(--apr-table-cell-padding-x);
  border: 1px solid #cbd5e1;
  background: var(--apr-navy);
  color: #fff;
  font-family: var(--apr-table-font-family);
  font-size: var(--apr-table-header-font-size);
  font-weight: var(--apr-table-header-font-weight);
  letter-spacing: var(--apr-table-header-letter-spacing);
  text-transform: uppercase;
  line-height: 1.35;
  text-align: center;
  vertical-align: middle;
  white-space: normal;
  overflow-wrap: anywhere;
}

.report-detail tbody td,
.report-detail tfoot td,
.report-detail tbody th,
.report-detail tfoot th {
  padding: var(--apr-table-cell-padding-y) var(--apr-table-cell-padding-x);
  border: 1px solid #cbd5e1;
  font-family: var(--apr-table-font-family);
  font-size: var(--apr-table-cell-font-size);
  font-weight: var(--apr-table-cell-font-weight);
  line-height: var(--apr-table-cell-line-height);
  vertical-align: top;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  background: #fff;
  font-variant-numeric: tabular-nums;
}

.report-detail tbody td:first-child,
.report-detail tbody th:first-child {
  background: #f8fafc;
  font-weight: var(--apr-table-label-font-weight);
  text-align: left;
}

.report-detail tfoot td,
.report-detail tfoot th {
  font-weight: 700;
  border-top: 2px solid #1a252f;
  background: #f1f5f9;
}

@media (max-width: 900px) {
  .report-detail .report-body-card {
    padding: 20px;
  }
}

@media (max-width: 640px) {
  .report-detail .report-body-card {
    margin-top: 12px;
    padding: 14px;
    border-radius: 16px;
  }

  .report-detail p,
  .report-detail li,
  .report-detail blockquote {
    font-size: 0.98rem;
    line-height: 1.66;
  }
}


@media (max-width: 640px) {
  .report-detail .report-meta {
    gap: 6px 8px;
    font-size: 0.9rem;
  }

  .report-detail .meta-pill,
  .report-detail .sector-pill {
    max-width: 100%;
    white-space: normal;
  }

  .report-detail .toc-wrap .toc-grid,
  .report-detail .toc-wrap [style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }

  .report-detail .table-wrapper {
    margin: 14px 0;
    border-radius: 6px;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
  }

  .report-detail .table-wrapper::after {
    content: "";
    position: sticky;
    top: 0;
    right: 0;
    float: right;
    width: 18px;
    height: 100%;
    pointer-events: none;
    background: linear-gradient(to right, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.95));
    opacity: 0;
    transition: opacity 120ms ease-in-out;
  }

  .report-detail .table-wrapper.has-overflow::after {
    opacity: 1;
  }

  .report-detail .table-wrapper.scrolled-end::after,
  .report-detail .table-wrapper:not(.has-overflow)::after {
    opacity: 0;
  }

  .report-detail .table-wrapper:not(.apr-table__scroll) > table,
  .report-detail .table-wrapper:not(.apr-table__scroll) > table[style] {
    display: table !important;
    width: max-content !important;
    inline-size: max-content !important;
    min-width: 100% !important;
    min-inline-size: 100% !important;
    max-width: none !important;
    table-layout: auto !important;
    margin-bottom: 0;
    border-collapse: collapse !important;
  }

  .report-detail .table-wrapper:not(.apr-table__scroll) > table colgroup,
  .report-detail .table-wrapper:not(.apr-table__scroll) > table col {
    width: auto !important;
  }

  .report-detail .table-wrapper:not(.apr-table__scroll) > table col[style],
  .report-detail .table-wrapper:not(.apr-table__scroll) > table th[style*="width"],
  .report-detail .table-wrapper:not(.apr-table__scroll) > table td[style*="width"] {
    width: auto !important;
    min-width: auto !important;
    max-width: none !important;
    inline-size: auto !important;
    min-inline-size: auto !important;
    max-inline-size: none !important;
  }

  .report-detail .table-wrapper:not(.apr-table__scroll) > table[style*="table-layout:fixed"],
  .report-detail .table-wrapper:not(.apr-table__scroll) > table[style*="table-layout: fixed"] {
    table-layout: auto !important;
  }

  .report-detail .table-wrapper:not(.apr-table__scroll) thead {
    display: table-header-group !important;
  }

  .report-detail .table-wrapper:not(.apr-table__scroll) tbody {
    display: table-row-group !important;
  }

  .report-detail .table-wrapper:not(.apr-table__scroll) tfoot {
    display: table-footer-group !important;
  }

  .report-detail .table-wrapper:not(.apr-table__scroll) tr {
    display: table-row !important;
  }

  .report-detail .table-wrapper:not(.apr-table__scroll) th,
  .report-detail .table-wrapper:not(.apr-table__scroll) td {
    display: table-cell !important;
    border: 1px solid #cbd5e1 !important;
    font-size: var(--apr-table-cell-font-size);
    line-height: var(--apr-table-cell-line-height);
    font-family: var(--apr-table-font-family);
    font-variant-numeric: tabular-nums;
    white-space: normal !important;
    overflow-wrap: break-word;
  }

  .report-detail .table-wrapper:not(.apr-table__scroll) td::before,
  .report-detail .table-wrapper:not(.apr-table__scroll) th::before {
    display: none !important;
    content: none !important;
  }

  /* ── Mobile table typography: reassign variables (single source of truth) ── */
  .report-detail {
    --apr-table-header-font-size: 0.75rem;    /* 12px — smaller than body */
    --apr-table-header-font-weight: 600;
    --apr-table-header-letter-spacing: 0.02em;
    --apr-table-cell-font-size: 0.8125rem;    /* 13px — uniform across ALL columns */
    --apr-table-cell-line-height: 1.35;       /* tighter than desktop 1.45 */
    --apr-table-label-font-weight: 600;
    --apr-table-cell-font-weight: 400;        /* normalize data columns */
    --apr-table-cell-padding-y: 6px;
    --apr-table-cell-padding-x: 8px;
  }

  .report-detail .table-wrapper:not(.apr-table__scroll) thead th {
    min-width: 84px;
    /* font-size, padding, font-weight from variables above */
  }

  /* Left-align data columns on mobile — td only, keep th centered */
  .report-detail .table-wrapper:not(.apr-table__scroll) td:not(:first-child) {
    text-align: left !important;
  }

  /* Zebra striping more visible on phone screens */
  .report-detail tbody tr:nth-child(even) td,
  .report-detail tbody tr:nth-child(even) th {
    background: #e8edf3;
  }

  /* More breathing room between tables */
  .report-detail .table-wrapper {
    margin-top: 24px !important;
    margin-bottom: 24px !important;
  }

  /* Reduce section heading sizes */
  .report-detail h2 { font-size: 16px; }
  .report-detail h3 { font-size: 14px; }

  .report-detail .table-wrapper:not(.apr-table__scroll)[data-sticky-first-col="true"] thead th:first-child {
    position: sticky;
    left: 0;
    z-index: 3;
    background: var(--apr-navy);
  }

  .report-detail .table-wrapper:not(.apr-table__scroll)[data-sticky-first-col="true"] tbody td:first-child,
  .report-detail .table-wrapper:not(.apr-table__scroll)[data-sticky-first-col="true"] tbody th:first-child,
  .report-detail .table-wrapper:not(.apr-table__scroll)[data-sticky-first-col="true"] tfoot td:first-child,
  .report-detail .table-wrapper:not(.apr-table__scroll)[data-sticky-first-col="true"] tfoot th:first-child {
    position: sticky;
    left: 0;
    z-index: 2;
    background: #f8fafc;
  }
}

/* ============================================================
   Atlas Peak Research — Report Formatting Standards
   Added by Uma to enforce consistent styling across all reports.
   These overrides ensure content-level inline styles and portal
   CSS produce the same visual output as the canonical TSEM report.
   See: EARNINGS_DEBRIEF_FORMAT_GUIDE.md
   ============================================================ */

/* Summary / intro blue box */
.report-detail .summary-box {
  background: #f0f4f8 !important;
  border-left: 4px solid #2c3e50 !important;
  border-right: none !important;
  border-top: none !important;
  border-bottom: none !important;
  border-radius: 0 !important;
  padding: 12px 16px !important;
  margin: 16px 0 !important;
}

/* Sources / footer green-gray box */
.report-detail .sources-styled,
.report-detail .sources-box {
  background: #f6f9f6 !important;
  border-left: 4px solid #7ba37b !important;
  border-right: none !important;
  border-top: none !important;
  border-bottom: none !important;
  border-radius: 0 !important;
  padding: 12px 16px !important;
  margin-top: 24px !important;
  font-size: 12px !important;
  color: #555 !important;
}

/* Meta / date line */
.report-detail .meta {
  font-size: 12px !important;
  color: #64748b !important;
  line-height: 1.45 !important;
  font-weight: 400 !important;
  margin-bottom: 20px !important;
}


