/*
 * Cardstop market report V63 — collision-safe mobile layout
 * Loaded after the shared News and V62 report stylesheets.
 */

.market-report-page {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

.market-report-page,
.market-report-page *,
.market-report-page *::before,
.market-report-page *::after {
  box-sizing: border-box;
}

@media (max-width: 720px) {
  .market-report-page .report-section h2,
  .market-report-page .market-report-body h3,
  .market-report-page .report-table td,
  .market-report-page .timeline-item strong,
  .market-report-page .timeline-item p,
  .market-report-page .report-sources a {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  /* A true one-column mobile timeline. The report-scoped selectors prevent
     the legacy News .timeline grid from restoring two columns on Safari. */
  .market-report-page .timeline {
    position: relative;
    display: block !important;
    width: 100% !important;
    margin: 20px 0 28px !important;
    padding: 0 0 0 26px !important;
    border: 0 !important;
    grid-template-columns: 1fr !important;
    gap: 0 !important;
  }

  .market-report-page .timeline::before {
    content: "";
    position: absolute;
    z-index: 0;
    top: 8px;
    bottom: 8px;
    left: 7px;
    width: 2px;
    border-radius: 2px;
    background: #d9d9d9;
  }

  .market-report-page .timeline > .timeline-item {
    position: relative !important;
    z-index: 1;
    display: block !important;
    width: 100% !important;
    min-height: 0 !important;
    margin: 0 0 12px !important;
    padding: 15px 16px 16px !important;
    border: 1px solid var(--report-line) !important;
    border-left: 3px solid var(--report-red) !important;
    border-radius: 14px !important;
    background: #fff !important;
    box-shadow: 0 3px 12px rgba(0, 0, 0, .035);
  }

  .market-report-page .timeline > .timeline-item:last-child {
    margin-bottom: 0 !important;
  }

  .market-report-page .timeline > .timeline-item::before {
    content: "";
    position: absolute;
    top: 18px;
    left: -24px;
    width: 12px;
    height: 12px;
    border: 3px solid #fff;
    border-radius: 50%;
    background: var(--report-red);
    box-shadow: 0 0 0 1px var(--report-red);
  }

  .market-report-page .timeline > .timeline-item time {
    display: inline-block !important;
    width: auto !important;
    max-width: 100%;
    min-height: 0;
    margin: 0 0 8px;
    padding: 5px 8px;
    border-radius: 7px;
    border: 1px solid rgba(224, 29, 38, .22);
    color: var(--report-red);
    background: #fff2f1;
    font: 800 10.5px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
    letter-spacing: .06em;
  }

  .market-report-page .timeline > .timeline-item strong {
    display: block !important;
    margin: 0 !important;
    color: #171717 !important;
    font-size: 15.5px !important;
    line-height: 1.4 !important;
  }

  .market-report-page .timeline > .timeline-item p {
    margin: 7px 0 0 !important;
    color: #5a5a5a !important;
    font-size: 12.5px !important;
    line-height: 1.65 !important;
  }

  /* Safari-safe table cards. Using block rows plus an absolutely positioned
     number avoids the inconsistent table/grid layout visible in V62. */
  .market-report-page .report-table-wrap {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 18px 0 24px !important;
    overflow: visible !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
  }

  .market-report-page table.report-table,
  .market-report-page .report-table tbody,
  .market-report-page .report-table tr,
  .market-report-page .report-table td {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  .market-report-page table.report-table {
    margin: 0 !important;
    border: 0 !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    table-layout: auto !important;
    background: transparent !important;
  }

  .market-report-page .report-table thead {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    margin: -1px !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    clip-path: inset(50%) !important;
    white-space: nowrap !important;
    border: 0 !important;
  }

  .market-report-page .report-table tbody {
    margin: 0 !important;
    padding: 0 !important;
  }

  .market-report-page .report-table tbody > tr {
    position: relative !important;
    min-height: 78px !important;
    margin: 0 0 10px !important;
    padding: 15px 15px 15px 66px !important;
    overflow: hidden !important;
    border: 1px solid var(--report-line) !important;
    border-radius: 15px !important;
    background: #fff !important;
    box-shadow: 0 3px 12px rgba(0, 0, 0, .025);
  }

  .market-report-page .report-table tbody > tr:last-child {
    margin-bottom: 0 !important;
  }

  .market-report-page .report-table tbody > tr > td,
  .market-report-page .report-table tbody > tr:nth-child(even) > td,
  .market-report-page .report-table tbody > tr:last-child > td {
    position: static !important;
    height: auto !important;
    margin: 3px 0 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    color: #626262 !important;
    background: transparent !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    line-height: 1.48 !important;
    text-align: left !important;
    white-space: normal !important;
    grid-column: auto !important;
    grid-row: auto !important;
  }

  .market-report-page .report-table tbody > tr > td:nth-child(2) {
    margin-top: 0 !important;
    color: #171717 !important;
    font-size: 14px !important;
    font-weight: 800 !important;
    line-height: 1.38 !important;
  }

  .market-report-page .report-table tbody > tr > td.code {
    color: #6b6b6b !important;
    font: 700 10.5px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace !important;
  }

  .market-report-page .report-table tbody > tr > td.price {
    margin-top: 7px !important;
    color: #111 !important;
    font-size: 13px !important;
    font-weight: 850 !important;
  }

  .market-report-page .report-table tbody > tr > td.rank,
  .market-report-page .report-table tbody > tr:nth-child(even) > td.rank {
    position: absolute !important;
    top: 15px !important;
    left: 15px !important;
    display: block !important;
    width: 36px !important;
    max-width: 36px !important;
    min-width: 36px !important;
    height: 36px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 10px !important;
    color: #fff !important;
    background: var(--report-red) !important;
    font: 900 13px/36px ui-monospace, SFMono-Regular, Menlo, monospace !important;
    letter-spacing: 0 !important;
  }

  /* Other dense mobile visuals */
  .market-report-page .report-chart,
  .market-report-page .report-panel,
  .market-report-page .driver-card,
  .market-report-page .risk-card,
  .market-report-page .signal-card {
    max-width: 100%;
    overflow: hidden;
  }

  .market-report-page .report-subvisual,
  .market-report-page .composition-chart,
  .market-report-page .driver-grid,
  .market-report-page .risk-matrix,
  .market-report-page .signal-grid,
  .market-report-page .report-kpis {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 10px !important;
  }

  .market-report-page .report-panel > *,
  .market-report-page .driver-card > *,
  .market-report-page .risk-card > *,
  .market-report-page .signal-card > * {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .market-report-page .hbar-row {
    grid-template-columns: minmax(0, 1fr) auto !important;
    gap: 6px 10px !important;
  }

  .market-report-page .hbar-track {
    grid-column: 1 / -1 !important;
    grid-row: 2 !important;
  }

  .market-report-page .report-source-note,
  .market-report-page .report-sources li,
  .market-report-page .report-data-download {
    overflow-wrap: anywhere;
    word-break: normal;
  }
}

@media (max-width: 380px) {
  .market-report-page .report-table tbody > tr {
    min-height: 72px !important;
    padding: 13px 13px 13px 59px !important;
  }

  .market-report-page .report-table tbody > tr > td.rank,
  .market-report-page .report-table tbody > tr:nth-child(even) > td.rank {
    top: 13px !important;
    left: 13px !important;
    width: 32px !important;
    max-width: 32px !important;
    min-width: 32px !important;
    height: 32px !important;
    border-radius: 9px !important;
    font-size: 12px !important;
    line-height: 32px !important;
  }

  .market-report-page .timeline {
    padding-left: 23px !important;
  }

  .market-report-page .timeline::before {
    left: 6px;
  }

  .market-report-page .timeline > .timeline-item {
    padding: 14px !important;
  }

  .market-report-page .timeline > .timeline-item::before {
    left: -21px;
  }
}
