/* Reviewed research articles only. Authored text, evidence and interactions are untouched. */
@layer pd-quality {
  /* Keep long source names readable, including on narrow screens. */
  html[data-pd-family="article"][data-pd-case-components] body #main-content .pd-report-links a {
    align-content: start !important;
    padding-block: 18px !important;
    border-color: var(--pd-ui-line) !important;
    transition: color 180ms ease, background-color 180ms ease !important;
  }
  html[data-pd-family="article"][data-pd-case-components] body #main-content .pd-report-links a small {
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    overflow-wrap: anywhere !important;
    font-size: 11px !important;
    line-height: 1.65 !important;
  }
  html[data-pd-family="article"][data-pd-case-components] body #main-content .pd-report-links a:hover {
    background: rgb(var(--pd-ui-accent-rgb) / .045) !important;
    color: var(--pd-ui-action) !important;
  }
  html[data-pd-family="article"][data-pd-case-components] body #main-content .pd-reading-meta {
    row-gap: 10px !important;
    font-size: 12px !important;
    line-height: 1.6 !important;
  }

  /* A continuous reading rhythm, without stacking section and heading offsets. */
  html[data-pd-family="article"][data-pd-case-components] body #main-content .pd-report-metrics {
    margin-bottom: 32px !important;
    border-color: var(--pd-ui-line) !important;
  }
  html[data-pd-family="article"][data-pd-case-components] body #main-content > section.container.pb-6:has(> .pd-report-metrics) {
    padding-top: 0 !important;
    padding-bottom: 8px !important;
  }
  html[data-pd-family="article"][data-pd-case-components] body #main-content .article-container > .article-section:first-child {
    padding-top: 0 !important;
  }
  html[data-pd-family="article"][data-pd-case-components] body #main-content .article-container > .article-section:first-child > .pd-reading-prose:first-child > h2:first-child {
    margin-top: 24px !important;
  }
  html[data-page="buytrx-drainer-exposed"] body #main-content > .container > .article-section:first-child {
    padding-top: 0 !important;
  }
  html[data-page="buytrx-drainer-exposed"] body #main-content > .container > .article-section:first-child > .pd-reading-prose:first-child > h2:first-child {
    margin-top: 24px !important;
  }
  html[data-pd-family="article"][data-pd-case-components] body #main-content .pd-reading-prose > p {
    color: var(--pd-ui-secondary) !important;
    line-height: 1.8 !important;
    text-wrap: pretty;
  }
  html[data-pd-family="article"][data-pd-case-components] body #main-content .pd-reading-prose > :is(ul,ol) {
    line-height: 1.8 !important;
  }
  html[data-pd-family="article"][data-pd-case-components] body #main-content .pd-reading-prose > h2 {
    line-height: 1.3 !important;
    letter-spacing: -.025em !important;
    text-wrap: pretty;
  }
  html[data-pd-family="article"][data-pd-case-components] body #main-content .verdict-box > h2 {
    margin: 0 0 20px !important;
    padding: 0 !important;
    border: 0 !important;
  }
  html[data-pd-family="article"][data-pd-case-components] body #main-content .verdict-box {
    border-color: var(--pd-ui-line) !important;
    background: var(--pd-ui-surface) !important;
    border-radius: var(--pd-ui-radius-card) !important;
  }

  /* One frame per table. Every column remains available in its existing scroll region. */
  html[data-pd-family="article"][data-pd-case-components] body #main-content .pd-table-frame:has(> .pd-case-table) {
    padding: 0 !important;
    margin-block: 28px 36px !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }
  html[data-pd-family="article"][data-pd-case-components] body #main-content .pd-table-frame > .pd-case-table {
    margin-block: 0 !important;
  }
  html[data-pd-family="article"][data-pd-case-components] body #main-content .pd-table-frame > .pd-table-hint {
    position: static !important;
    display: block !important;
    width: auto !important;
    height: auto !important;
    margin: 0 0 8px !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    text-align: end !important;
    color: var(--pd-ui-muted) !important;
    transform: none !important;
  }
  html[data-pd-family="article"][data-pd-case-components] body #main-content .pd-case-table {
    border-color: var(--pd-ui-line) !important;
    border-radius: var(--pd-ui-radius-control) !important;
    background: var(--pd-ui-surface) !important;
    scrollbar-color: var(--pd-ui-control-line) var(--pd-ui-surface);
  }
  html[data-pd-family="article"][data-pd-case-components] body #main-content .pd-case-table th {
    background: var(--pd-ui-raised) !important;
    color: var(--pd-ui-text) !important;
  }
  html[data-pd-family="article"][data-pd-case-components] body #main-content .pd-case-table :is(th,td) {
    padding: 14px 16px !important;
  }
  html[data-pd-family="article"][data-pd-case-components] body #main-content .pd-case-table table:not(:has(tr > :nth-child(3))) {
    min-width: 0 !important;
    table-layout: auto !important;
  }
  html[data-pd-family="article"][data-pd-case-components] body #main-content .pd-case-table code {
    overflow-wrap: anywhere;
  }

  /* Captions belong to their evidence; the original images keep their full aspect ratio. */
  html[data-pd-family="article"][data-pd-case-components] body #main-content :is(.media-box,.inv-img-wrap,.pd-inline-figure) {
    border-color: var(--pd-ui-line) !important;
  }
  html[data-pd-family="article"][data-pd-case-components] body #main-content :is(figcaption,.inv-img-caption) {
    color: var(--pd-ui-secondary) !important;
    font-size: 13px !important;
    line-height: 1.7 !important;
    text-wrap: pretty;
  }
  html[data-pd-family="article"][data-pd-case-components] body #main-content :is(a,button,summary,[tabindex="0"]):focus-visible {
    outline: 2px solid var(--pd-ui-action) !important;
    outline-offset: 4px !important;
  }

  /* The case gallery retains its imagery, captions and original sequence. */
  html[data-page="gambler-panel"] body #main-content .design-thumb {
    border-color: var(--pd-ui-line) !important;
    border-radius: var(--pd-ui-radius-card) !important;
    background: var(--pd-ui-surface) !important;
    transition: border-color 180ms ease, background-color 180ms ease !important;
  }
  html[data-page="gambler-panel"] body #main-content .design-thumb:hover {
    border-color: var(--pd-ui-control-line) !important;
  }
  html[data-page="gambler-panel"] body #main-content .design-thumb-caption {
    padding: 16px !important;
  }
  html[data-page="gambler-panel"] body #main-content .design-thumb-caption p {
    font-size: 14px !important;
    line-height: 1.7 !important;
  }
  html[data-page="gambler-panel"] body #main-content .design-thumb-caption h3 {
    font-size: 16px !important;
    line-height: 1.4 !important;
  }

  @media (max-width:767px) {
    html[data-pd-family="article"][data-pd-case-components] body #main-content .pd-reading-meta {
      font-size: 11px !important;
    }
    html[data-pd-family="article"][data-pd-case-components] body #main-content .pd-report-links a {
      padding-block: 15px !important;
    }
    html[data-pd-family="article"][data-pd-case-components] body #main-content .pd-report-metrics {
      margin-bottom: 24px !important;
    }
    html[data-pd-family="article"][data-pd-case-components] body #main-content .pd-reading-prose > h2 {
      font-size: 27px !important;
      line-height: 1.3 !important;
    }
    html[data-pd-family="article"][data-pd-case-components] body #main-content :is(.case-card,.site-card,.verdict-box) {
      padding: 22px 20px !important;
    }
    html[data-page="moz-fake-extensions"] body #main-content.container {
      width: calc(100% - 32px) !important;
      max-width: none !important;
      margin-inline: 16px !important;
      padding-inline: 0 !important;
    }
  }
  @media (max-width:600px) {
    html[data-page="gambler-panel"] body #main-content .designs-grid {
      grid-template-columns: minmax(0,1fr) !important;
      gap: 18px !important;
    }
  }
  @media (prefers-reduced-motion:reduce) {
    html[data-page="gambler-panel"] body #main-content .design-thumb {
      transition: none !important;
    }
  }
}
