/* The shared heading action follows Roast Me, or sits directly below a title with no score. */
.stock-heading-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .65rem; min-width: 0; margin: .2rem 0 0; }
.stock-heading-actions .stock-page-rating { margin: 0; min-width: 0; }
.stock-heading-actions .stock-page-rating[hidden] { display: none; }
.stock-heading-actions .preferred-source { display: inline-block; box-sizing: border-box; max-width: 100%; padding: .3rem .5rem; border: 1px solid #b7c9d7; border-radius: 2px; background: #fff; color: #1765a5; font: 600 .75rem/1.35 system-ui, sans-serif; text-decoration: none; white-space: normal; overflow-wrap: anywhere; }
.stock-heading-actions .preferred-source:hover { background: #eef5fa; text-decoration: underline; }
.stock-heading-actions .preferred-source:focus-visible { outline: 2px solid #1765a5; outline-offset: 2px; }
@media (max-width: 420px) { .stock-heading-actions .roast-stars { flex-wrap: wrap; white-space: normal; gap: .2rem .35rem; } }

@media (max-width: 420px) {
  .stock-heading-actions:has(.stock-page-rating:not([hidden])) { flex-wrap: nowrap; }
  .stock-heading-actions:has(.stock-page-rating:not([hidden])) .stock-page-rating { flex: 1 1 0; font-size: .85rem; }
  .stock-heading-actions:has(.stock-page-rating:not([hidden])) .preferred-source { flex: 0 1 44%; font-size: .7rem; }
}

/* Screeners keep their full desktop layout and page zoom; the complete label fits on one line below the count. */
.screener-heading { flex-direction: column; align-items: flex-start; justify-content: center; gap: 8px; }
.screener-heading h1 { flex: none; min-width: 0; width: 100%; }
.screener-heading .stock-heading-actions { flex: none; width: 100%; margin: 0; }
.screener-heading .preferred-source { font-size: 11px; line-height: 1.35; padding: 5px 6px; white-space: nowrap; overflow-wrap: normal; }
