/* AINN design v2 (design system 1.0, tokens.json). Everything is scoped under
   .av2, so importing this file changes nothing outside a v2 page. Dark follows
   the existing mechanism: html.dark-mode (set by THEME_BOOT / useApplyTheme).
   Per-site accent: --ainn-accent (default Cars red); --ainn-accent-text-dark
   comes from deriveAccentTextDark() server-side. */
.av2 {
  --page: #F6F5F2; --surface: #FFFFFF; --surface-sunken: #EFEDE8; --surface-selected: #E9E7E1; --media: #E3E0D8;
  --text: #14161A; --text-2: #3B4048; --text-nav: #4A505A; --muted: #5B616B;
  --border: #E4E2DC; --border-subtle: #ECEAE4; --border-strong: #878C95; --border-outline: #CFCBC0;
  --inverse: #14161A; --on-inverse: #FFFFFF; --border-on-inverse: #767C87; --disabled-bg: #6B7280; --disabled-text: #FFFFFF;
  --live: #1F8F4E; --focus: #14161A;
  --accent: var(--ainn-accent, #D1202B); --on-accent: #FFFFFF; --accent-text: var(--accent);
  --ease: cubic-bezier(.2, 0, 0, 1);
  --cat-0: #2F5FA8; --cat-1: #6A4FB0; --cat-2: #0E7C66; --cat-3: #B4391F; --cat-4: #8A5A12; --cat-5: #4A505A;
  font-family: var(--font-inter), 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--page); color: var(--text); font-size: 15px; line-height: 1.5;
  min-height: 100vh;
}
html.dark-mode .av2 {
  --page: #121316; --surface: #1B1D21; --surface-sunken: #262930; --surface-selected: #2B2E36; --media: #2B2E36;
  --text: #F3F4F6; --text-2: #D1D5DB; --text-nav: #B4B9C2; --muted: #9AA0AA;
  --border: #2E3138; --border-subtle: #262930; --border-strong: #767C87; --border-outline: #454952;
  --inverse: #F3F4F6; --on-inverse: #14161A; --border-on-inverse: #767C87; --disabled-bg: #6B7280; --disabled-text: #FFFFFF;
  --live: #4BD07F; --focus: #F3F4F6;
  --accent-text: var(--ainn-accent-text-dark, color-mix(in srgb, var(--accent) 60%, white));
  --cat-0: #5B7FBF; --cat-1: #8A74C4; --cat-2: #2F9C85; --cat-3: #C96A57; --cat-4: #A5803E; --cat-5: #7A808A;
}
.av2 *, .av2 *::before, .av2 *::after { box-sizing: border-box; }
.av2 :where(a) { color: inherit; text-decoration: none; }
.av2 :focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.av2-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Header */
.av2-header { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; padding: 16px 40px; max-width: 1440px; margin: 0 auto; }
.av2-brand { display: inline-flex; align-items: center; gap: 14px; min-height: 56px; }
.av2-logo { display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 6px; background: var(--accent); color: var(--on-accent); font-weight: 800; font-size: 17px; letter-spacing: .2px; }
.av2-sitename { font-size: 22px; font-weight: 800; letter-spacing: -.3px; }
.av2-nav { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 5px; margin: 0 auto; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; }
.av2-nav-item { display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border-radius: 999px; font-size: 15px; font-weight: 600; color: var(--text-nav); transition: background-color .12s var(--ease); }
.av2-nav-item:hover { background: var(--surface-sunken); }
.av2-nav-item[aria-current='page'] { background: var(--inverse); color: var(--on-inverse); }
.av2-actions { display: inline-flex; align-items: center; gap: 12px; margin-left: auto; }

/* Desktop-width header on a narrow desktop (901-1440px, e.g. "Request Desktop Site" at 980): ONE row, nothing clipped.
   Tighter gaps and padding, slightly smaller nav labels, a compact API button; the brand name may shrink
   (the name ellipsizes; the nav never shrinks, so no item is clipped) so a long site name can never push the actions to a second row. Width queries only. */
@media (min-width: 901px) and (max-width: 1440px) {
  .av2-header { flex-wrap: nowrap; gap: 12px; padding: 16px 20px; }
  .av2-brand { gap: 10px; min-width: 0; flex: 0 1 auto; }
  .av2-logo { flex: none; }
  .av2-sitename { font-size: 18px; min-width: 6ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .av2-nav { flex-wrap: nowrap; gap: 2px; padding: 4px; flex: none; }
  .av2-nav-item { padding: 0 10px; font-size: 14px; white-space: nowrap; }
  .av2-actions { flex: none; gap: 8px; }
}
/* Above 1440 the header is capped at 1440 wide, so a long name must still stay on one row: same no-wrap, ellipsized name (never under 6ch). */
@media (min-width: 1441px) {
  .av2-header { flex-wrap: nowrap; }
  .av2-brand { min-width: 0; flex: 0 1 auto; }
  .av2-logo { flex: none; }
  .av2-sitename { min-width: 6ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .av2-nav { flex-wrap: nowrap; flex: none; }
  .av2-nav-item { white-space: nowrap; }
  .av2-actions { flex: none; }
}
@media (min-width: 901px) and (max-width: 1000px) {
  .av2-header { gap: 8px; padding: 16px 16px; }
  .av2-nav-item { padding: 0 8px; }
  .av2-sitename { font-size: 17px; }
}

/* Theme switch: three icon segments (Light, System, Dark). Each segment is 28x24 and its click area IS the visual box
   (the owner's 24px control rule, the WCAG 2.5.8 minimum): no invisible padding, no pseudo-element hit area.
   The focus ring (outline-offset 2px) sits outside the box, never clipped. The source chips and the Expanded/Compact
   options are 24px tall with 11px/600 type for the same reason. */
.av2-theme-switch { display: inline-flex; flex: none; gap: 2px; padding: 2px; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--surface); }
.av2-theme-opt { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 24px; padding: 0; border: 0; border-radius: 999px; background: transparent; color: var(--muted); cursor: pointer; }
.av2-theme-opt:hover { color: var(--text); }
.av2-theme-opt[aria-checked='true'] { background: var(--inverse); color: var(--on-inverse); }
.av2-theme-opt svg { width: 16px; height: 16px; pointer-events: none; }

/* The API link is not live yet: grayed (about 50% opacity), no href, never focusable. */
.av2-api-soon { display: inline-flex; align-items: center; min-height: 24px; font-size: 14px; font-weight: 600; color: var(--muted); opacity: .7; cursor: not-allowed; user-select: none; }
.av2-nav-item.av2-api-soon:hover { background: none; }

@property --av2-fl { syntax: '<length>'; inherits: false; initial-value: 0px; }
@property --av2-fr { syntax: '<length>'; inherits: false; initial-value: 0px; }
@keyframes av2-nav-cue { 0% { --av2-fl: 0px; --av2-fr: 28px; } 8% { --av2-fl: 0px; --av2-fr: 28px; } 92% { --av2-fl: 28px; --av2-fr: 28px; } 100% { --av2-fl: 28px; --av2-fr: 0px; } }

/* Stats strip (under the page title): four count pills. */
.av2-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: -6px 0 20px; padding: 0; list-style: none; }
.av2-strip-pill { display: inline-flex; align-items: baseline; gap: 6px; min-height: 24px; padding: 3px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); font-size: 13px; color: var(--muted); }
.av2-strip-pill b { font-size: 14px; color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; }

/* About page (the hub's network-wide "How AINN News Works"). */
.av2-about { max-width: 720px; margin: 0 auto; padding: 8px 0 56px; }
.av2-about-kicker { margin: 12px 0 0; font-size: 12px; letter-spacing: 1.2px; text-transform: uppercase; font-weight: 700; color: var(--muted); }
.av2-about-h1 { margin: 6px 0 10px; font-size: 44px; line-height: 1.1; letter-spacing: -1.2px; font-weight: 800; }
.av2-about-lede { margin: 0 0 28px; font-size: 19px; color: var(--text-2); }
.av2-about h2 { margin: 32px 0 10px; font-size: 22px; letter-spacing: -.3px; }
.av2-about p { margin: 0 0 14px; font-size: 16.5px; line-height: 1.7; color: var(--text-2); }
.av2-about-steps { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; }
.av2-about-steps li { display: flex; gap: 14px; padding: 16px 18px; }
.av2-about-n { flex: 0 0 32px; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: var(--surface-sunken); font-weight: 700; font-size: 14px; }
.av2-about-steps h3 { margin: 0 0 2px; font-size: 16px; }
.av2-about-steps p { margin: 0; font-size: 14.5px; }
.av2-about-defs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 14px; }
.av2-about-defs > div { padding: 14px 16px; }
.av2-about-defs dt { font-size: 14.5px; font-weight: 700; }
.av2-about-defs dd { margin: 0; font-size: 14px; color: var(--muted); }
.av2-about-back { margin: 0; }
.av2-about-back-top { display: flex; align-items: center; height: 32px; margin: 4px 0 0; }
.av2-about-back-bottom { margin: 28px 0 0; }
.av2-backlink { display: inline-flex; align-items: center; gap: 6px; min-height: 24px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--surface); color: var(--text); font-size: 14px; font-weight: 600; }
.av2-backlink:hover { background: var(--surface-sunken); }
@media (max-width: 560px) {
  .av2-about { padding-bottom: 40px; }
  .av2-about-h1 { font-size: 32px; }
  .av2-about-lede { font-size: 17px; }
  .av2-about-defs { grid-template-columns: 1fr; }
}

/* Buttons */
.av2-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 22px; border-radius: 999px; border: 1px solid transparent; font: 700 15px/1 inherit; font-family: inherit; cursor: pointer; }
.av2-btn-primary { background: var(--inverse); color: var(--on-inverse); }
.av2-btn-accent { background: var(--accent); color: var(--on-accent); }
.av2-btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.av2-btn-primary:hover { background: color-mix(in srgb, var(--inverse) 82%, var(--page)); }
.av2-btn-accent:hover { background: color-mix(in srgb, var(--accent) 86%, #000); }
.av2-btn-secondary:hover { background: var(--surface-sunken); }
.av2-btn-disabled { flex-direction: column; gap: 2px; padding: 5px 22px; background: var(--disabled-bg); color: var(--disabled-text); border-color: var(--disabled-bg); cursor: not-allowed; }
.av2-btn-l { display: inline-flex; align-items: center; gap: 8px; line-height: 1.15; }
.av2-btn-soon { font-size: 11px; font-weight: 600; line-height: 1.1; letter-spacing: .2px; }

/* Cards and type */
.av2-card { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 18px; position: relative; }
.av2-overline { font-size: 12px; line-height: 1.2; letter-spacing: 1.2px; text-transform: uppercase; font-weight: 700; color: var(--muted); }
.av2-h2 { font-size: 34px; line-height: 1.15; letter-spacing: -.8px; font-weight: 800; margin: 8px 0; }
.av2-h3 { font-size: 22px; line-height: 1.25; letter-spacing: -.3px; font-weight: 700; margin: 6px 0; }
.av2-body { font-size: 15px; color: var(--text-2); margin: 8px 0; }
.av2-meta { font-size: 13px; line-height: 1.4; color: var(--muted); margin: 4px 0; }
.av2-muted { color: var(--muted); font-size: 13px; }
.av2-cat { color: var(--accent-text); font-weight: 700; }
.av2-link { display: inline-flex; align-items: center; min-height: 44px; color: var(--accent-text); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.av2-link:hover, .av2-quiet:hover { text-decoration-thickness: 2px; }
.av2-quiet { display: inline-flex; align-items: center; min-height: 44px; color: var(--muted); font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }
.av2-pill { display: inline-flex; align-items: center; min-height: 20px; padding: 0 8px; border-radius: 999px; background: var(--surface-sunken); color: var(--text-2); font-size: 12.5px; font-weight: 700; }
.av2-stretch::after { content: ''; position: absolute; inset: 0; border-radius: 20px; }
.av2-stretch:hover { text-decoration: underline; text-underline-offset: 3px; }
/* The focus ring wraps the whole card the link covers, not just the headline text. */
.av2-stretch:focus-visible { outline: none; }
.av2-stretch:focus-visible::after { outline: 2px solid var(--focus); outline-offset: -4px; }
/* Long unbroken strings (URLs) wrap instead of scrolling the page sideways (WCAG 1.4.10). */
.av2-story, .av2-body, .av2-more, .av2-h2, .av2-h3, .av2-meta, .av2-signal-title, .av2-ad-msg, .av2-row-title, .av2-signal-card, .av2-cat-item, .av2-overline,
.av2-article, .av2-lede, .av2-article-meta, .av2-tag, .av2-back, .av2-prose, .av2-article-h,
.av2-hero, .av2-hero-sub, .av2-hero-meta, .av2-bigstory-line, .av2-sec, .av2-sec-item, .av2-apicard, .av2-resource-list li, .av2-footer p, .av2-showing, .av2-date, .av2-live, .av2-muted, .av2-link, .av2-quiet { overflow-wrap: anywhere; }
.av2-card:hover { box-shadow: 0 1px 2px rgba(20, 22, 26, .06); }
.av2-story:hover { border-color: var(--border-strong); box-shadow: 0 2px 6px rgba(20, 22, 26, .08); }

/* Sponsor */
.av2-sponsor { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.av2-adlogo { width: 96px; height: 96px; border-radius: 12px; background: var(--surface-sunken); display: grid; place-items: center; overflow: hidden; }
.av2-adlogo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.av2-adslot { width: 100%; min-width: 0; }
/* The box is reserved before the ad loads: fixed minimum height, capped so a tall ad cannot push the page, and
   clipped so a wide one can never grow the sidebar. The calm fill shows while empty; an ad covers it. */
.av2-adslot-box { position: relative; box-sizing: border-box; width: 100%; min-width: 0; max-width: 100%; min-height: 250px; max-height: 600px; overflow: hidden; display: flex; justify-content: center; align-items: flex-start; background: var(--surface-sunken); border-radius: 12px; }
.av2-adslot-box:empty::after { content: "Advertisement"; align-self: center; color: var(--muted); font-size: 13px; }
/* Desktop only, and only on a page whose sidebar carries the ad: reserve room for a 320px ad (320 + 2 x 18 padding + 2 border = 358) at layout time. */
@media (min-width: 901px) { .av2-side.av2-side-ad { flex: 0 0 358px; } }
.av2-ad-msg { margin: 0; font-size: 15px; line-height: 1.45; }

/* Signals */
.av2-signals { padding: 10px; }
.av2-card-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 8px 4px; }
.av2-list { list-style: none; margin: 0; padding: 0; }
.av2-list li + li { border-top: 1px solid var(--border-subtle); }
.av2-signal-row { display: flex; flex-direction: column; gap: 4px; min-height: 44px; padding: 10px 8px; border-radius: 12px; }
.av2-signal-row:hover { background: var(--surface-sunken); }
.av2-signal-top { display: flex; align-items: center; gap: 8px; }
.av2-score { margin-left: auto; font-weight: 700; }
.av2-signal-title { font-size: 14.5px; font-weight: 600; line-height: 1.35; }
.av2-signal-card { padding: 22px 26px; }
.av2-signal-card:hover { border-color: var(--border-strong); }

/* Story rows and cards */
.av2-row { display: grid; grid-template-columns: 52px 96px minmax(0, 1fr) 130px auto; align-items: center; gap: 12px; min-height: 56px; padding: 8px 22px; border-bottom: 1px solid var(--border-subtle); }
.av2-row:hover { background: var(--surface-sunken); box-shadow: inset 4px 0 0 var(--accent); }
.av2-row-time, .av2-row-src, .av2-row-count { font-size: 13px; color: var(--muted); }
.av2-row-cat { font-size: 13px; font-weight: 700; color: var(--accent-text); }
.av2-row-title { font-size: 16px; font-weight: 600; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.av2-row-src { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 800px) {
  .av2-row { grid-template-columns: 52px 1fr; }
  .av2-row-title { grid-column: 1 / -1; white-space: normal; }
  .av2-row-src, .av2-row-count { grid-column: 1 / -1; }
  .av2-header { padding: 12px 16px; }
}
.av2-story-foot { display: flex; gap: 12px; }
.av2-story-lead { padding: 26px 30px; }
.av2-showmore:hover { text-decoration: underline; text-underline-offset: 3px; }
.av2-showmore { position: relative; z-index: 1; min-height: 44px; margin-top: 8px; padding: 0 4px; border: 0; background: none; color: var(--accent-text); font: 700 14px/1 inherit; font-family: inherit; cursor: pointer; }
.av2-more { font-size: 15px; color: var(--text-2); margin-top: 8px; }
.av2-more[hidden] { display: none; }

/* Story images (expanded cards only; compact rows never carry one). Decorative, hotlinked, fixed 16:9 box so
   nothing shifts when the image arrives. The card's stretched link covers the image (no extra tab stop).
   Dark theme keeps the image colours; the 1px token border stops a light image bleeding into the card. */
.av2-media { margin: 0; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 12px; background: var(--media); border: 1px solid var(--border); }
.av2-media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.av2-media[hidden] { display: none; }
/* Large slot, normal-width card: stacked, full width, above the meta line. */
.av2-img-large > .av2-media { margin: 0 0 14px; }
/* Large slot, lead card (wide screens): text left, image right. */
@media (min-width: 901px) {
  .av2-story-lead.av2-img-large { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 400px); column-gap: 28px; align-content: start; }
  .av2-story-lead.av2-img-large > * { grid-column: 1; }
  .av2-story-lead.av2-img-large > .av2-media { grid-column: 2; grid-row: 1 / span 6; margin: 4px 0 0; align-self: start; }
  .av2-story-lead.av2-img-large:has(> .av2-media[hidden]) { display: block; }
}
/* Small slot: stacked at every width, full card width above the text, 2:1 and at most 220px tall (a shorter box than
   the large slot's 16:9, same width), top-weighted crop keeps heads in portrait shots. A 160 x 90 thumbnail goes beside
   the text ONLY in the single-column tablet layout (601-900px, text column 355px+); every two-column desktop card
   (1280, 1440, 1920 and wider) stacks, so the image is never a small thumbnail there. */
.av2-grid { container: av2g / inline-size; }
.av2-media-small img { object-position: 50% 25%; }
.av2-img-small > .av2-media { width: 100%; aspect-ratio: 2 / 1; max-height: 220px; margin: 0 0 12px; }
.av2-img-small > .av2-showmore { justify-self: start; }
@media (min-width: 601px) and (max-width: 900px) {
  .av2-img-small { display: grid; grid-template-columns: minmax(0, 1fr) 160px; column-gap: 16px; align-content: start; }
  .av2-img-small > * { grid-column: 1; }
  .av2-img-small > .av2-media { grid-column: 2; grid-row: 1 / span 6; align-self: start; width: auto; aspect-ratio: 16 / 9; max-height: none; margin: 4px 0 0; }
  .av2-img-small:has(> .av2-media[hidden]) { display: block; }
}

/* Filter chips and view toggle */
.av2-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.av2-chips { display: inline-flex; flex-wrap: wrap; gap: 8px; }
.av2-chip-btn { position: relative; height: 24px; padding: 0 9px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2); font-family: inherit; font-size: 11px; font-weight: 600; line-height: 1; cursor: pointer; }
.av2-chip-btn:not([aria-pressed='true']):hover { background: var(--surface-sunken); }
.av2-chip-btn[aria-pressed='true'] { background: var(--inverse); color: var(--on-inverse); border-color: var(--inverse); }
.av2-seg { display: inline-flex; padding: 2px; gap: 2px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 999px; }
.av2-seg-opt { position: relative; height: 24px; padding: 0 9px; border: 0; border-radius: 999px; background: transparent; color: var(--text-nav); font-family: inherit; font-size: 11px; font-weight: 600; line-height: 1; cursor: pointer; }
.av2-seg-opt:not([aria-pressed='true']):hover { background: var(--surface-sunken); }
.av2-seg-opt[aria-pressed='true'] { background: var(--inverse); color: var(--on-inverse); }

/* View mode: M3 marks its two lists .av2-view-expanded / .av2-view-compact */
.av2-view-compact { display: none; }
html[data-view='compact'] .av2-view-compact { display: block; }
html[data-view='compact'] .av2-view-expanded { display: none; }

/* No JS: V2Root emits a <noscript> style that hides .av2-needs-js controls */

/* LIVE dot (used from M3) */
.av2-live-dot { flex: none; margin-top: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--live); animation: av2-pulse 2s infinite; }
/* Stale data (more than two update intervals): the dot goes muted and stops pulsing. */
.av2-live-stale .av2-live-dot { background: var(--muted); animation: none; }
@keyframes av2-pulse { 50% { opacity: .4; } }

@media (prefers-reduced-motion: reduce) {
  .av2 *, .av2 *::before, .av2 *::after { transition: none !important; transition-duration: 0s !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
  .av2-live-dot { animation: none; opacity: 1; }
}

/* Home page layout (M3) */
.av2-skip { position: absolute; left: -9999px; top: 8px; z-index: 10; padding: 12px 18px; border-radius: 999px; background: var(--inverse); color: var(--on-inverse); font-weight: 700; font-size: 15px; }
.av2-skip:focus { left: 16px; }
.av2-page { max-width: 1440px; margin: 0 auto; padding: 0 40px 56px; }
.av2-top { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; padding: 10px 0 22px; }
.av2-h1 { margin: 0; font-size: 40px; font-weight: 800; letter-spacing: -1px; line-height: 1.1; }
.av2-date { font-size: 17px; font-weight: 500; color: var(--muted); }
.av2-live { display: inline-flex; align-items: flex-start; gap: 8px; max-width: 100%; font-size: 14px; font-weight: 600; color: var(--text-2); }
/* Site list cards (hub sidebar): the same card, label and 44px row as the sites' category list; the marker is neutral (grey disc, the network's one red dot), never a per-site colour. */
.av2-navcard { padding: 10px; min-width: 0; }
.av2-navcard .av2-plain { min-width: 0; }
.av2-navcard .av2-card-head { margin: 0; }
.av2-card-sub { font-size: 11px; line-height: 1.2; color: var(--muted); white-space: nowrap; }
.av2-navrow { min-width: 0; display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: 12px; font-size: 15px; font-weight: 500; }
.av2-navrow:hover { background: var(--surface-sunken); }
.av2-mark { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-selected); color: var(--text); font-size: 13px; font-weight: 800; }
.av2-mark-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.av2-navtxt { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; line-height: 1.15; }
.av2-navtxt > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.av2-navtxt small { font-size: 11px; font-weight: 400; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.av2-textlink { display: inline-flex; align-items: center; min-height: 44px; font-size: 14px; font-weight: 700; color: var(--accent-text); }
.av2-textlink:hover { text-decoration: underline; text-underline-offset: 3px; }
.av2-top-end { margin-left: auto; }
.av2-cols { display: flex; flex-wrap: wrap; gap: 28px; align-items: flex-start; }
.av2-side { flex: 0 0 272px; min-width: 0; max-width: 100%; display: flex; flex-direction: column; gap: 20px; }
.av2-side > .av2-btn { width: 100%; font-size: 14px; font-weight: 600; }
.av2-side > .av2-btn-disabled { width: 100%; font-size: 14px; font-weight: 600; }
.av2-main { flex: 999 1 560px; min-width: 0; }
.av2-feed { display: flex; flex-direction: column; gap: 24px; }
.av2-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin-top: 24px; }
.av2-rows { padding: 0; overflow: hidden; }
.av2-rows .av2-row:last-child { border-bottom: 0; }
.av2-empty { margin: 0; padding: 24px 0; text-align: center; color: var(--muted); }
.av2-dim { opacity: .55; }
/* Infinite scroll (feed.tsx): a fixed-height strip after the list. Its text changes, its size never does, so a
   loading line, Retry, the Show more button or the end note never move the footer by themselves. No animation. */
.av2-feed-more { position: relative; min-height: 104px; margin-top: 24px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; }
.av2-feed-more[hidden] { display: none; }
/* New stories go BELOW what the reader sees, so they keep reading down: the strip and the footer must never be the
   scroll anchor (that would pin them and push the new page above the viewport). The stories themselves stay
   eligible, so an image or a Show more above the reader still does not move what they are reading. */
.av2-feed-more, .av2-feed-more *, .av2-footer, .av2-footer * { overflow-anchor: none; }
.av2-feed-more-note { margin: 0; font-size: 14px; color: var(--muted); }
.av2-sentinel { position: absolute; top: 0; left: 0; width: 1px; height: 1px; pointer-events: none; }
.av2-skip-inline:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.av2-skip-inline:focus { display: inline-flex; align-items: center; min-height: 44px; margin: 8px 0; font-size: 14px; font-weight: 700; color: var(--accent-text); }
.av2-cats { padding: 10px; }
.av2-cat-item { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: 12px; font-size: 15px; font-weight: 500; }
.av2-cat-item:hover { background: var(--surface-sunken); }
.av2-cat-item[aria-current='true'] { background: var(--surface-selected); }
.av2-cat-all { font-weight: 700; }
.av2-count { flex: none; margin-left: auto; white-space: nowrap; font-size: 13px; color: var(--muted); }
.av2-cat-dot { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; }
.av2-cat-dot::after { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #fff; }
.av2-cat-c0 { background: var(--cat-0); } .av2-cat-c1 { background: var(--cat-1); } .av2-cat-c2 { background: var(--cat-2); }
.av2-cat-c3 { background: var(--cat-3); } .av2-cat-c4 { background: var(--cat-4); } .av2-cat-c5 { background: var(--cat-5); }
.av2-footer { margin-top: 48px; padding-top: 28px; border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; align-items: center; gap: 12px 32px; }
.av2-footer p { margin: 0; flex: 1 1 360px; font-size: 14px; line-height: 1.55; color: var(--text-nav); }
.av2-footer nav { display: flex; flex-wrap: wrap; gap: 4px 8px; }
.av2-footer nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 8px; font-size: 14px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.av2-footer nav a:hover { text-decoration-thickness: 2px; }
@media (max-width: 900px) {
  .av2-page { padding: 0 16px 40px; }
  .av2-cols { gap: 20px; }
  .av2-side { flex: 1 1 100%; order: 2; }
  .av2-main { flex-basis: 100%; order: 1; }
  /* Home on a phone: the sidebar's children join the page flow so Categories become a chip row above the feed. */
  .av2-cols > .av2-side-flat { display: contents; }
  .av2-side-flat > * { order: 2; flex: 1 1 100%; min-width: 0; }
  .av2-side-flat > .av2-cats { order: 0; flex: 1 1 100%; display: flex; flex-wrap: nowrap; gap: 8px; overflow-x: auto; padding: 2px 2px 6px; background: none; border: 0; border-radius: 0; }
  .av2-side-flat > .av2-cats:hover { box-shadow: none; }
  .av2-cats .av2-cat-item { flex: none; gap: 8px; padding: 0 16px; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--surface); white-space: nowrap; font-size: 14px; font-weight: 600; }
  .av2-cats .av2-cat-item:hover { background: var(--surface-sunken); }
  .av2-cats .av2-cat-item[aria-current='true'] { background: var(--inverse); color: var(--on-inverse); border-color: var(--inverse); }
  .av2-cats .av2-cat-item[aria-current='true'] .av2-count { color: inherit; }
  .av2-cats .av2-count { margin-left: 0; }
  .av2-cats .av2-cat-dot { display: none; }
  .av2-nav { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; margin: 0; border-radius: 999px; }
  /* Scroll cue: an edge fade on the side that has more nav items. A scroll-driven animation (no JS) moves --av2-fl / --av2-fr
     between 0 and 28px with the scroll position; when the nav fits there is no scroll range, the animation is inactive and
     both stay 0, so nothing fades. A mask only changes paint: text, focus scrolling and click areas are untouched. */
  .av2-nav { --av2-fl: 0px; --av2-fr: 0px; -webkit-mask-image: linear-gradient(to right, transparent 0, #000 var(--av2-fl), #000 calc(100% - var(--av2-fr)), transparent 100%); mask-image: linear-gradient(to right, transparent 0, #000 var(--av2-fl), #000 calc(100% - var(--av2-fr)), transparent 100%); }
  @supports (animation-timeline: scroll()) {
    .av2-nav { animation: av2-nav-cue linear both; animation-timeline: scroll(self inline); }
  }
  .av2-nav-item { white-space: nowrap; }
  .av2-actions { margin-left: 0; }
  .av2-grid { grid-template-columns: minmax(0, 1fr); }
  .av2-h1 { font-size: 32px; }
  .av2-top-end { margin-left: 0; }
  .av2-story-lead { padding: 20px 18px 22px; }
  .av2-story-lead .av2-h2 { font-size: 26px; letter-spacing: -.5px; }
}

/* Inner pages (M4): story, signals, reports, resources */
.av2-cols-top { margin-top: 10px; }
.av2-stack { display: flex; flex-direction: column; gap: 22px; }
.av2-back { display: inline-flex; align-items: center; min-height: 44px; font-size: 15px; font-weight: 600; color: var(--text-2); }
.av2-back:hover { text-decoration: underline; text-underline-offset: 3px; }
.av2-article { padding: 36px 44px 44px; margin-top: 8px; }
.av2-article-meta { margin: 0; font-size: 14px; color: var(--muted); }
.av2-article-h { margin: 14px 0 18px; font-size: 44px; line-height: 1.12; letter-spacing: -1.2px; font-weight: 800; max-width: 900px; overflow-wrap: anywhere; }
.av2-lede { margin: 0 0 26px; font-size: 20px; line-height: 1.55; color: var(--text-2); max-width: 820px; }
.av2-prose { max-width: 760px; font-size: 18px; line-height: 1.7; overflow-wrap: anywhere; }
.av2-prose p { margin: 0 0 18px; }
.av2-prose img, .av2-prose figure { max-width: 100%; height: auto; border-radius: 14px; }
.av2-prose a { color: var(--accent-text); text-decoration: underline; text-underline-offset: 3px; }
.av2-prose h2, .av2-prose h3, .av2-prose h4 { line-height: 1.25; margin: 26px 0 12px; }
.av2-prose blockquote { margin: 0 0 18px; padding-left: 18px; border-left: 3px solid var(--border-strong); color: var(--text-2); }
.av2-prose ul, .av2-prose ol { padding-left: 24px; margin: 0 0 18px; }
.av2-tags { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 20px 0 26px; padding: 0; }
.av2-tag { display: inline-flex; align-items: center; min-height: 28px; padding: 0 12px; border-radius: 999px; background: var(--surface-sunken); color: var(--text-2); font-size: 13px; font-weight: 600; }
.av2-article-cta { min-height: 48px; padding: 0 26px; font-size: 16px; }
.av2-section-h { margin: 26px 0 12px; }
.av2-pagechips { margin: 0 0 24px; }
.av2-chip-btn { display: inline-flex; align-items: center; }
.av2-chip-btn[aria-current='true'] { background: var(--inverse); color: var(--on-inverse); border-color: var(--inverse); }
.av2-cardgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
/* RSS links beside a feed name: 44 px wide target. */
.av2-resource-list .av2-quiet { min-width: 44px; justify-content: center; }
.av2-plain { list-style: none; margin: 0; padding: 0; }
.av2-resource-list { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.av2-resource-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 0 4px; overflow-wrap: anywhere; }

/* Report */
.av2-hero { margin-top: 8px; padding: 48px 52px; border-radius: 32px; background: var(--inverse); color: var(--on-inverse); }
.av2-hero-kicker { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 13px; letter-spacing: 1.6px; font-weight: 700; opacity: .8; }
.av2-hero-h { margin: 16px 0 14px; font-size: 56px; line-height: 1.05; letter-spacing: -1.8px; font-weight: 800; max-width: 900px; overflow-wrap: anywhere; }
.av2-hero-sub { margin: 0; font-size: 19px; line-height: 1.55; opacity: .85; max-width: 760px; }
.av2-hero-meta { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 26px 0 0; font-size: 15px; opacity: .85; }
.av2-hero-meta strong { font-weight: 600; opacity: 1; }
.av2-hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 28px 0 0; }
.av2-hero-btn { display: inline-flex; align-items: center; min-height: 44px; padding: 0 20px; border-radius: 999px; border: 1px solid var(--border-on-inverse); font-weight: 600; font-size: 15px; }
.av2-hero-btn-solid { background: var(--on-inverse); color: var(--inverse); border-color: var(--on-inverse); font-weight: 700; }
.av2-bigstory { padding: 22px 28px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; }
.av2-accent-text { color: var(--accent-text); letter-spacing: 1.4px; }
.av2-bigstory-line { flex: 1 1 320px; margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -.3px; }
.av2-sec { padding: 0; overflow: hidden; }
.av2-sec-bar { height: 6px; background: var(--accent); }
.av2-sec-head { display: flex; align-items: center; gap: 14px; padding: 26px 30px 8px; }
.av2-sec-h { margin: 0; font-size: 30px; font-weight: 800; letter-spacing: -.6px; }
.av2-sec-head .av2-pill { margin-left: auto; min-height: 32px; padding: 0 12px; font-size: 14px; }
.av2-sec-list { list-style: none; margin: 0; padding: 0 30px 14px; }
.av2-sec-item { display: flex; gap: 18px; padding: 22px 0; border-top: 1px solid var(--border-subtle); }
.av2-sec-n { flex: 0 0 36px; height: 36px; border-radius: 50%; background: var(--surface-sunken); display: grid; place-items: center; font-weight: 700; font-size: 15px; }
.av2-sec-item .av2-h3 { margin: 6px 0 8px; font-size: 22px; }
.av2-sec-item .av2-h3 a:hover { text-decoration: underline; text-underline-offset: 3px; }
.av2-apicard { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; padding: 26px 30px; }
.av2-apicard > div { flex: 1 1 300px; }
.av2-cats-head { display: block; padding: 10px 12px 6px; }
@media (max-width: 900px) {
  .av2-article { padding: 22px 18px 26px; }
  .av2-article-h { font-size: 30px; letter-spacing: -.6px; }
  .av2-lede { font-size: 17px; }
  .av2-prose { font-size: 17px; }
  .av2-hero { padding: 28px 20px; border-radius: 24px; }
  .av2-hero-h { font-size: 34px; letter-spacing: -.8px; }
  .av2-sec-head, .av2-sec-list, .av2-apicard { padding-left: 18px; padding-right: 18px; }
  .av2-sec-h { font-size: 24px; }
  .av2-sec-item { gap: 12px; }
  .av2-cardgrid, .av2-hubgrid { grid-template-columns: minmax(0, 1fr); }
}

/* Hub */
/* Story-photo cards: image on top (fixed 16:9 box, no layout shift), then domain, headline (3 lines), tagline. */
.av2-photo-card { padding: 0; overflow: hidden; height: 100%; display: flex; flex-direction: column; border-color: var(--border-strong); }
.av2-photo-card:hover { border-color: var(--accent); }
.av2-photo-box { position: relative; aspect-ratio: 16 / 9; overflow: hidden; flex: none; background: var(--surface-sunken); display: flex; align-items: center; justify-content: center; }
/* The image never sizes the box: it is taken out of flow and cropped to cover, so any source ratio (portrait or very wide) fills exactly 16:9. */
.av2-photo-box img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: center 30%; display: block; }
/* Hub-only grid (the sites keep .av2-cardgrid): denser, equal-height rows, text top-aligned under the photo. */
.av2-hubgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; align-items: stretch; }
.av2-hubgrid > li { display: flex; min-width: 0; }
.av2-hubgrid > li > .av2-card { flex: 1 1 auto; }
.av2-photo-body { flex: 1 1 auto; align-self: stretch; }
.av2-photo-none { font-size: 13px; color: var(--muted); }
.av2-ph-b { position: absolute; inset: 0; box-sizing: border-box; padding: 14px 16px 14px 20px; display: flex; align-items: flex-start; font-size: 19px; font-weight: 700; line-height: 1.25; color: var(--text); background: var(--surface-sunken); border-left: 6px solid var(--accent-text); overflow: hidden; }
.av2-ph-b-text { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 5; line-clamp: 5; overflow: hidden; overflow-wrap: anywhere; min-width: 0; }
@media (max-width: 520px) { .av2-ph-b-text { -webkit-line-clamp: 4; line-clamp: 4; } }
.av2-ph-chip { position: absolute; left: 8px; bottom: 8px; padding: 2px 8px; border-radius: 4px; font-size: 12px; font-weight: 600; line-height: 1.5; color: #fff; background: rgba(0, 0, 0, 0.78); letter-spacing: 0.01em; }
.av2-photo-box:has(.av2-ph-b) + .av2-photo-body .av2-photo-head { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.av2-photo-body { padding: 14px 16px 16px; }
.av2-photo-domain { margin: 0 0 4px; font-size: 12px; }
.av2-photo-head { margin: 0 0 6px; font-size: 16px; font-weight: 650; line-height: 1.3; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.av2-photo-plain { font-size: 18px; }
.av2-photo-tag { margin: 0; font-size: 13px; }
.av2-showing { margin: 0 0 20px; font-size: 14px; color: var(--muted); }

/* Hub filter + sort (apps/hub hub-filter.tsx). One line on desktop, stacked at 560px and below. 32px controls, equal heights. */
.av2-hf { display: flex; flex-wrap: nowrap; align-items: center; gap: 12px; margin: 0 0 20px; }
.av2-hf-field { position: relative; flex: 1 1 260px; min-width: 260px; }
.av2-hf-input, .av2-hf-select { height: 32px; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--surface); color: var(--text); font: inherit; font-size: 14px; line-height: 1; }
.av2-hf-input { width: 100%; padding: 0 36px 0 14px; }
.av2-hf-input::placeholder { color: var(--muted); }
.av2-hf-select { padding: 0 12px; color-scheme: light; min-width: 120px; max-width: 100%; flex: 1 1 auto; }
html.dark-mode .av2 .av2-hf-select { color-scheme: dark; }
.av2-hf-clear { position: absolute; right: 4px; top: 4px; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 50%; background: var(--surface-sunken); color: var(--text); font-size: 16px; line-height: 1; cursor: pointer; }
.av2-hf-clear[hidden] { display: none; }
.av2-hf-hint { position: absolute; left: 14px; top: 35px; font-size: 12px; line-height: 1.2; color: var(--muted); white-space: nowrap; }
.av2-hf[data-ready='false'] { visibility: hidden; } /* with JavaScript off the controls would do nothing, so they stay invisible (the space is kept) */
.av2-hf-sort { flex: 0 1 auto; min-width: 0; display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.av2-hf-empty { border: 1px dashed var(--border-strong); border-radius: 12px; padding: 28px; text-align: center; color: var(--muted); background: var(--surface); }
.av2-hf-empty[hidden], .av2-hf-chip[hidden] { display: none; }
.av2-hf-chip { display: inline-block; margin: 0 0 6px; padding: 1px 8px; border-radius: 999px; background: var(--surface-sunken); color: var(--text); font-size: 11px; font-weight: 600; }
.av2-photo-src { margin: 4px 0 0; font-size: 12px; }
@media (max-width: 900px) { .av2-hf-input, .av2-hf-select { font-size: 16px; } }
@media (max-width: 700px) {
  .av2-hf { flex-wrap: wrap; }
  .av2-hf-field { flex-basis: 100%; min-width: 0; }
  .av2-hf-sort { flex: 1 1 100%; }
  .av2-hf-select { flex: 1; min-width: 0; width: 100%; }
}
.av2-hubintro { flex-direction: column; align-items: flex-start; padding-bottom: 26px; }
.av2-hub-h1 { font-size: 52px; letter-spacing: -1.6px; max-width: 900px; }
.av2-hubintro .av2-date { max-width: 760px; line-height: 1.55; }
@media (max-width: 900px) { .av2-hub-h1 { font-size: 34px; letter-spacing: -.8px; } }

/* Phone header: ONE row (logo, site name, theme switch), the nav (API last, scrolls sideways) on its own row below. The name takes the
   leftover width and ellipsizes (never under 6ch). */
@media (max-width: 560px) {
  .av2-header { gap: 10px; flex-wrap: wrap; }
  .av2-brand { flex: 1 1 0; min-width: 0; gap: 10px; }
  .av2-logo { flex: none; }
  .av2-sitename { min-width: 6ch; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .av2-actions { flex: none; margin-left: auto; gap: 6px; }
  .av2-nav { order: 3; flex: 1 1 100%; }
  .av2-strip-pill { flex: 1 1 auto; justify-content: center; white-space: nowrap; }
}

/* Phone-width sidebar (<= 900px, where the sidebar stacks): ONE sticky strip of chips under the header, dropdowns that overlay
   the page (absolute: nothing below moves), the two sponsors as slim labelled rows. Above 900px none of this renders and the
   sidebar is exactly as before. Mirrors the approved mockup (variant A). Chips and rows are 44px tall; the header is untouched. */
.av2-ms, .av2-ms-spon { display: none; }
@media (max-width: 900px) {
  /* The cards the strip replaces (Popular now, Signals, the old category chip row and the newsletter button, the two house sponsors). The ad container stays. */
  .av2-side-ms > .av2-navcard, .av2-side-ms > .av2-signals[aria-label="Signals"], .av2-side-ms > .av2-cats,
  .av2-side-ms > .av2-btn-disabled, .av2-side-ms > .av2-sponsor:not(.av2-adslot) { display: none; }
  .av2-side-ms:not(.av2-side-flat) { display: contents; }
  .av2-side-ms > * { order: 2; flex: 1 1 100%; min-width: 0; }
  .av2-side-ms > .av2-ms, .av2-side-ms > .av2-ms-spon { order: 0; }
  .av2-ms { display: block; position: sticky; top: 0; z-index: 30; margin: 0 -16px; background: var(--page); }
  .av2-ms-strip { display: flex; gap: 8px; overflow-x: auto; padding: 3px 16px 6px; scrollbar-width: none; }
  .av2-ms-strip::-webkit-scrollbar { display: none; }
  .av2-ms-chip { flex: none; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--surface); color: var(--text); font: inherit; font-size: 14px; font-weight: 600; line-height: 1; white-space: nowrap; cursor: pointer; }
  .av2-ms-chip:hover { background: var(--surface-sunken); }
  .av2-ms-chip[aria-expanded='true'], .av2-ms-chip[aria-current='true'] { background: var(--inverse); color: var(--on-inverse); border-color: var(--inverse); }
  .av2-ms-chip .av2-count { margin: 0; color: inherit; opacity: .75; }
  .av2-ms-chev { width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-2px); }
  .av2-ms-chip[aria-expanded='true'] .av2-ms-chev { transform: rotate(225deg) translateY(0); }
  .av2-ms-soon { color: var(--muted); border-style: dashed; cursor: not-allowed; }
  .av2-ms-soon:hover { background: var(--surface); }
  .av2-ms-tag { font-size: 11px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; }
  .av2-ms-sheet { position: absolute; left: 16px; right: 16px; top: 100%; margin: 0; padding: 6px; max-height: min(70vh, 480px); overflow-y: auto; box-shadow: 0 8px 24px rgba(0, 0, 0, .14); }
  .av2-ms-sheet[hidden] { display: none; }
  .av2-ms-more { display: flex; align-items: center; justify-content: center; min-height: 44px; font-size: 14px; font-weight: 700; color: var(--accent-text); }
  .av2-ms-spon { display: flex; flex-direction: column; margin: 0 0 4px; padding: 0; overflow: hidden; }
  .av2-ms-spon a { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 14px; font-size: 14px; border-top: 1px solid var(--border-subtle); }
  .av2-ms-spon a:first-child { border-top: 0; }
  .av2-ms-spon-tag { flex: none; font-size: 11px; letter-spacing: 1px; text-transform: uppercase; font-weight: 700; color: var(--muted); border: 1px solid var(--border-strong); border-radius: 6px; padding: 2px 6px; }
  .av2-ms-spon-txt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .av2-ms-spon-go { flex: none; font-weight: 700; color: var(--accent-text); }
}

/* Desktop (>= 901px), the v2 sites' home and inner pages (the hub keeps its own sidebar and grid): a narrower sidebar with smaller
   sidebar type, so the feed gets the room. Sidebar 272 -> 216px; a page with a real 320px ad slot keeps its wide ad sidebar (.av2-side-ad).
   Rows stay 36px+ (Popular now rows 44px: the count sits under the site name so names are not cut at 216px). Sponsored blocks stay labelled. */
@media (min-width: 901px) {
  .av2-side-ms { flex-basis: 216px; gap: 14px; }
  .av2-side-ms > .av2-btn { font-size: 12.5px; min-height: 40px; padding: 4px 12px; }
  .av2-side-ms .av2-btn-soon { font-size: 10.5px; }
  .av2-side-ms .av2-cats, .av2-side-ms .av2-navcard, .av2-side-ms .av2-signals { padding: 6px; }
  .av2-side-ms .av2-sponsor { padding: 14px; gap: 6px; }
  .av2-side-ms .av2-cat-item, .av2-side-ms .av2-navrow { font-size: 13.5px; min-height: 36px; padding: 0 8px; gap: 9px; line-height: 1.3; }
  .av2-side-ms .av2-count { font-size: 12px; }
  .av2-side-ms .av2-cat-dot, .av2-side-ms .av2-mark { width: 22px; height: 22px; }
  .av2-side-ms .av2-cat-dot::after { width: 6px; height: 6px; }
  .av2-side-ms .av2-overline { font-size: 11px; letter-spacing: 1px; }
  .av2-side-ms .av2-card-sub { font-size: 10.5px; }
  .av2-side-ms .av2-navtxt small { font-size: 11px; }
  .av2-side-ms .av2-signal-title { font-size: 13px; }
  .av2-side-ms .av2-signal-row { padding: 8px 6px; }
  .av2-side-ms .av2-meta { font-size: 12px; }
  .av2-side-ms .av2-ad-msg { font-size: 13px; line-height: 1.4; }
  .av2-side-ms .av2-sponsor .av2-link { font-size: 13px; }
  .av2-side-ms .av2-navrow { display: grid; grid-template-columns: 22px minmax(0, 1fr); column-gap: 9px; align-items: center; padding: 6px 8px; min-height: 44px; }
  .av2-side-ms .av2-navrow .av2-mark { grid-row: 1 / span 2; }
  .av2-side-ms .av2-navrow .av2-navtxt { grid-column: 2; }
  .av2-side-ms .av2-navrow .av2-count { grid-column: 2; margin: 0; font-size: 11.5px; }
}
/* Home feed columns: 1 at <= 919px, 2 up to 1439px (1280 keeps two wide columns at the original card type), 3 from 1440px
   (about 360px each). A page with the wide ad sidebar gets its third column from 1582px (same main width). */
@media (max-width: 919px) { .av2-grid { grid-template-columns: minmax(0, 1fr); } }
@media (min-width: 1440px) {
  .av2-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
}
@media (min-width: 1440px) and (max-width: 1581px) {
  .av2-cols:has(> .av2-side-ad) .av2-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
}
/* Page cap 1440 -> 1600 on the home page (above 1600px viewports the extra width goes to the feed). */
@media (min-width: 1441px) {
  .av2:has(.av2-grid) .av2-page, .av2:has(.av2-grid) .av2-header { max-width: 1600px; }
}

/* Desktop sidebar: sticky (StickySide sets --av2-side-top; no JS, no stickiness), with the footer links at its bottom. */
.av2-sidefoot { display: none; }
@media (min-width: 901px) {
  .av2-side-ms[data-stick] { position: sticky; top: var(--av2-side-top, 16px); }
  .av2-sidefoot { display: block; padding: 2px 8px 6px; }
  .av2-sidefoot nav { display: flex; flex-wrap: wrap; gap: 0 10px; }
  .av2-sidefoot nav a { display: inline-flex; align-items: center; min-height: 28px; font-size: 12px; font-weight: 600; color: var(--text-nav); text-decoration: underline; text-underline-offset: 3px; }
  .av2-sidefoot nav a:hover { text-decoration-thickness: 2px; }
  .av2-sidefoot p { margin: 4px 0 0; font-size: 11px; line-height: 1.45; color: var(--muted); }
}
@media (max-width: 900px) {
  .av2-ms-link { display: flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 12px; font-size: 15px; font-weight: 600; }
  .av2-ms-link:hover { background: var(--surface-sunken); }
  .av2-ms-note { margin: 4px 12px 8px; font-size: 12px; line-height: 1.45; color: var(--muted); }
}
