/* Brand rankings v1.7.2 compact mobile header. Load after the existing style-popular.css.
   Only /populartire opts into this scope; counts and legacy size pages are unchanged. */
#atc-popular.atc-pop--cards-v17 .atc-pop__ranking-tabs { display:flex; flex-wrap:wrap; align-items:stretch; gap:4px; margin:16px 0 20px; border-bottom:1px solid #dde2e9; }
#atc-popular.atc-pop--cards-v17 .atc-pop__ranking-tabs a { display:block; min-height:48px; padding:12px 14px; border-bottom:3px solid transparent; color:#596474; font-size:14px; text-decoration:none; }
#atc-popular.atc-pop--cards-v17 .atc-pop__ranking-tabs a[aria-current] { color:#18202d; border-bottom-color:#f5a30a; font-weight:600; }
#atc-popular.atc-pop--cards-v17 .atc-pop__ranking-tabs a:hover { background:#eceff3; }
#atc-popular.atc-pop--cards-v17 .atc-pop__layout { grid-template-columns:minmax(0,1fr) 300px; }
#atc-popular.atc-pop--cards-v17 .atc-pop__content { grid-column:1; grid-row:1; }
#atc-popular.atc-pop--cards-v17 .atc-pop__aside { grid-column:2; grid-row:1; }
#atc-popular.atc-pop--cards-v17 .atc-pop__list { gap:10px; }
#atc-popular.atc-pop--cards-v17 .atc-pop__brand { border-radius:12px; }
#atc-popular.atc-pop--cards-v17 .atc-pop__brand--first { border-color:#dbc9a0; }
#atc-popular.atc-pop--cards-v17 .atc-pop__brand[open] { border-color:#b7c6d8; }
#atc-popular.atc-pop--cards-v17 .atc-pop__summary { display:grid; grid-template-columns:42px minmax(150px,1fr) minmax(190px,1.1fr) minmax(150px,.85fr); align-items:center; gap:8px 14px; padding:14px 16px; cursor:default; }
#atc-popular.atc-pop--cards-v17 .atc-pop__summary:hover { background:transparent; }
#atc-popular.atc-pop--cards-v17 .atc-pop__rank { grid-column:1; grid-row:1; align-self:start; display:block; width:auto; min-height:0; margin:0; padding:0; border:0; background:transparent; text-align:center; color:#334255; }
#atc-popular.atc-pop--cards-v17 .atc-pop__rank strong { display:flex; align-items:center; justify-content:center; min-height:44px; padding:4px 2px; border-radius:9px; background:#eff2f6; font-size:22px; font-weight:600; line-height:1.2; }
#atc-popular.atc-pop--cards-v17 .atc-pop__brand--first .atc-pop__rank strong { color:#75530c; background:#fff3d5; }
#atc-popular.atc-pop--cards-v17 .atc-pop__rank-change { display:block; margin-top:5px; color:#315d87; font-size:12px; line-height:1.4; font-weight:400; }
#atc-popular.atc-pop--cards-v17 .atc-pop__rank-change[data-direction=down] { color:#855226; }
#atc-popular.atc-pop--cards-v17 .atc-pop__identity { grid-column:2; grid-row:1; gap:3px; min-width:0; }
#atc-popular.atc-pop--cards-v17 .atc-pop__logo { display:block; width:128px; height:30px; max-width:100%; object-fit:contain; object-position:left center; }
#atc-popular.atc-pop--cards-v17 .atc-pop__brand-name { display:block; margin-top:3px; color:#18202d; font-size:17px; font-weight:600; line-height:1.4; text-decoration:none; overflow-wrap:anywhere; }
#atc-popular.atc-pop--cards-v17 .atc-pop__brand-name:hover { color:#365a8c; text-decoration:underline; text-underline-offset:3px; }
#atc-popular.atc-pop--cards-v17 .atc-pop__detail-arrow { color:#596474; font-size:12px; font-weight:400; white-space:nowrap; }
#atc-popular.atc-pop--cards-v17 .atc-pop__identity .atc-pop__country { display:block; color:#596474; font-size:12px; line-height:1.5; overflow-wrap:anywhere; }
#atc-popular.atc-pop--cards-v17 .atc-pop__identity .atc-pop__movement { display:block; color:#596474; font-size:12px; line-height:1.5; }
/* Views and graph use their own columns, keeping the data near the brand. */
#atc-popular.atc-pop--cards-v17 .atc-pop__analytics { display:contents; }
#atc-popular.atc-pop--cards-v17 .atc-pop__views { grid-column:3; grid-row:1; display:flex; flex-direction:column; align-items:flex-start; gap:2px; min-width:0; text-align:left; }
#atc-popular.atc-pop--cards-v17 .atc-pop__views > .atc-pop__metric-label { display:block; grid-column:1/-1; grid-row:auto; align-self:start; text-align:left; font-size:12px; line-height:1.4; color:#596474; }
#atc-popular.atc-pop--cards-v17 .atc-pop__views strong { grid-column:auto; grid-row:auto; color:#1b2738; font-size:24px; font-weight:600; line-height:1.3; text-align:left; white-space:normal; overflow-wrap:anywhere; }
#atc-popular.atc-pop--cards-v17 .atc-pop__views strong > span { display:inline; margin:0; font-size:12px; font-weight:400; white-space:nowrap; }
#atc-popular.atc-pop--cards-v17 .atc-pop__views > .atc-pop__range-note { display:block; margin:0; font-size:12px; color:#596474; line-height:1.5; }
#atc-popular.atc-pop--cards-v17 .atc-pop__views .atc-pop__delta { grid-column:auto; grid-row:auto; justify-self:start; max-width:100%; margin:0; padding:0; border:0; border-radius:0; background:transparent; color:#315d87; font-size:12px; font-weight:500; line-height:1.5; text-align:left; overflow-wrap:anywhere; }
#atc-popular.atc-pop--cards-v17 .atc-pop__views .atc-pop__delta[data-direction=down] { color:#855226; background:transparent; }
#atc-popular.atc-pop--cards-v17 .atc-pop__views .atc-pop__delta[data-direction=neutral] { color:#596474; background:transparent; }
#atc-popular.atc-pop--cards-v17 .atc-pop__summary-action { grid-column:4; grid-row:1; display:block; min-width:0; min-height:62px; padding:3px 0; border:0; border-radius:5px; color:#596474; background:transparent; font-size:12px; font-weight:400; white-space:normal; cursor:pointer; }
#atc-popular.atc-pop--cards-v17 .atc-pop__summary-action:hover { background:#f5f8fc; }
#atc-popular.atc-pop--cards-v17 .atc-pop__summary-action::after { content:none; }
#atc-popular.atc-pop--cards-v17 .atc-pop__spark-heading { display:flex; align-items:center; justify-content:space-between; gap:6px; font-size:12px; line-height:1.4; }
#atc-popular.atc-pop--cards-v17 .atc-pop__chevron { display:inline-block; font-size:16px; line-height:1; }
#atc-popular.atc-pop--cards-v17 .atc-pop__brand[open] .atc-pop__chevron { transform:rotate(180deg); }
#atc-popular.atc-pop--cards-v17 .atc-pop__spark { display:block; min-width:0; height:44px; margin-top:3px; }
#atc-popular.atc-pop--cards-v17 .atc-pop__spark svg { display:block; width:100%; height:100%; }
#atc-popular.atc-pop--cards-v17 .atc-pop__spark > span { display:block; padding-top:8px; color:#596474; font-size:12px; line-height:1.4; }
#atc-popular.atc-pop--cards-v17 .atc-pop__sr-only { position:absolute; width:1px; height:1px; padding:0; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
@media (max-width:1180px) and (min-width:1051px) {
 #atc-popular.atc-pop--cards-v17 .atc-pop__summary { grid-template-columns:38px minmax(140px,1fr) minmax(170px,1.1fr) minmax(150px,.85fr); gap:8px 10px; padding:14px; }
}
@media (max-width:1050px) {
 #atc-popular.atc-pop--cards-v17 .atc-pop__layout { grid-template-columns:minmax(0,1fr); }
 #atc-popular.atc-pop--cards-v17 .atc-pop__aside { grid-column:1; grid-row:2; }
}
@media (max-width:760px) {
 #atc-popular.atc-pop--cards-v17 .atc-pop__summary { grid-template-columns:34px minmax(100px,1fr) minmax(155px,1.1fr) minmax(128px,.85fr); gap:8px 10px; padding:12px; }
}
@media (max-width:600px) {
 #atc-popular.atc-pop--cards-v17 .atc-pop__ranking-tabs { margin:12px 0 16px; gap:0; }
 #atc-popular.atc-pop--cards-v17 .atc-pop__ranking-tabs a { min-height:44px; padding:10px 9px; font-size:13px; }
 #atc-popular.atc-pop--cards-v17 .atc-pop__summary { grid-template-columns:32px minmax(0,1fr) 118px; gap:6px 10px; padding:12px; }
 #atc-popular.atc-pop--cards-v17 .atc-pop__rank strong { min-height:40px; font-size:20px; }
 #atc-popular.atc-pop--cards-v17 .atc-pop__logo { width:110px; height:28px; }
 #atc-popular.atc-pop--cards-v17 .atc-pop__identity .atc-pop__movement { display:none; }
 #atc-popular.atc-pop--cards-v17 .atc-pop__analytics { display:contents; }
 #atc-popular.atc-pop--cards-v17 .atc-pop__views { grid-column:3; grid-row:1; display:flex; flex-direction:column; align-items:flex-end; gap:0; text-align:right; }
 #atc-popular.atc-pop--cards-v17 .atc-pop__views > .atc-pop__metric-label { align-self:flex-end; text-align:right; }
 #atc-popular.atc-pop--cards-v17 .atc-pop__views > .atc-pop__range-note { display:none; }
 #atc-popular.atc-pop--cards-v17 .atc-pop__summary-action { grid-column:2/-1; grid-row:2; padding:5px 0 0; border-top:1px solid #e5eaf0; }
 #atc-popular.atc-pop--cards-v17 .atc-pop__views strong { align-self:flex-end; max-width:100%; font-size:25px; text-align:right; }
 #atc-popular.atc-pop--cards-v17 .atc-pop__views .atc-pop__delta { text-align:right; }
 #atc-popular.atc-pop--cards-v17 .atc-pop__spark { height:42px; }
 #atc-popular.atc-pop--cards-v17 .atc-pop__spark-heading { font-size:11px; }
}
@media (max-width:359px) {
 #atc-popular.atc-pop--cards-v17 .atc-pop__summary { grid-template-columns:28px minmax(0,1fr) 100px; column-gap:8px; padding:10px; }
 #atc-popular.atc-pop--cards-v17 .atc-pop__views > .atc-pop__metric-label { font-size:11px; }
 #atc-popular.atc-pop--cards-v17 .atc-pop__views strong { font-size:22px; }
}
@media (pointer:coarse) {
 #atc-popular.atc-pop--cards-v17 .atc-pop__brand-name { padding:2px 0 6px; }
}

/* ================================================================
   ATC Popular Brand CWV Phase 2 — offscreen rendering containment
   2026-10-27
   Performance-only: preserves card markup, dimensions, interactions,
   ranking data and visual styles. Open cards always render normally.
   ================================================================ */
@supports (content-visibility: auto) {
  #atc-popular.atc-pop--cards-v17
  .atc-pop__list > .atc-pop__brand:not([open]):nth-child(n+7) {
    content-visibility: auto;
    contain-intrinsic-size: auto 150px;
  }

  #atc-popular.atc-pop--cards-v17 .atc-pop__method,
  #atc-popular.atc-pop--cards-v17 .atc-pop__related {
    content-visibility: auto;
    contain-intrinsic-size: auto 260px;
  }
}

@media (max-width: 600px) {
  @supports (content-visibility: auto) {
    #atc-popular.atc-pop--cards-v17
    .atc-pop__list > .atc-pop__brand:not([open]):nth-child(n+7) {
      contain-intrinsic-size: auto 190px;
    }

    #atc-popular.atc-pop--cards-v17 .atc-pop__method,
    #atc-popular.atc-pop--cards-v17 .atc-pop__related {
      contain-intrinsic-size: auto 320px;
    }
  }
}

