/* ============================================================
   ALBERTA REFERENDUM — WEBSITE STYLESHEET
   Type system follows the CMTD style guide (docs/STYLEGUIDE.md):
   Rethink Sans for headings, IBM Plex Sans for body/UI text,
   IBM Plex Sans Condensed for captions/labels. Dark background and
   the pro/anti/neutral stance colors are kept as-is (this is a data
   dashboard, and the stance colors must match the report's charts).
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Rethink+Sans:ital,wght@0,400..800;1,400..800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&display=swap');
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Condensed:wght@400;500;600;700&display=swap');

:root {
  --color-background:  #14181c;
  --color-surface:      #1c2228;
  --color-primary:      #2cc84d; /* CMTD accent green — links, active states, emphasis */
  --color-primary-hover: #36b050;
  --color-accent-pro:   #db6b30; /* pro-independence — report STANCE_COLS orange */
  --color-accent-anti:  #3a5dae; /* anti-independence — report STANCE_COLS blue */
  --color-accent-neutral: #a6a7a9; /* no side taken — report STANCE_COLS cool_gray */
  --color-accent-5:     #58e37a;
  --color-text:         #f2f4f6;

  --font-family-heading: 'Rethink Sans', sans-serif;
  --font-family-base:  'IBM Plex Sans', sans-serif;
  --font-family-condensed: 'IBM Plex Sans Condensed', sans-serif;
  --font-weight-light:   300;
  --font-weight-regular: 400;
  --font-weight-medium:  500;
  --font-weight-semibold: 600;
  --font-weight-bold:    700;
  --font-weight-extrabold: 800;

  --font-size-xs:   0.75rem;
  --font-size-sm:   0.875rem;
  --font-size-base: 1rem;
  --font-size-md:   1.125rem;
  --font-size-lg:   1.25rem;
  --font-size-xl:   1.5rem;
  --font-size-2xl:  2rem;
  --font-size-3xl:  2.5rem;
  --font-size-4xl:  3rem;

  --space-xs:   0.25rem;
  --space-sm:   0.5rem;
  --space-md:   1rem;
  --space-lg:   1.5rem;
  --space-xl:   2rem;
  --space-2xl:  3rem;
  --space-3xl:  4rem;

  --radius-sm:   4px;
  --radius-md:   8px;
  --radius-lg:   16px;
  --radius-full: 9999px;

  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
  background-color: var(--color-background);
  color: var(--color-text);
  font-family: var(--font-family-base);
  font-weight: var(--font-weight-regular);
  font-size: var(--font-size-base);
  line-height: 1.625;
  -webkit-font-smoothing: antialiased;
}

img, video { max-width: 100%; display: block; }

/* CMTD link/emphasis accent (green) — unaffected background rule per style guide */
a { color: var(--color-primary); text-decoration: none; transition: color var(--transition-fast); }
a:hover, a:focus { color: var(--color-accent-5); text-decoration: underline; }

ul, ol { list-style: none; }

/* Headings — white on this site's dark background (CMTD color rule), Rethink Sans */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-family-heading);
  font-weight: var(--font-weight-bold);
  color: var(--color-text);
  line-height: 1.2;
  margin-bottom: var(--space-md);
}

/* H1 — Page title: Rethink Sans, extra bold, tight tracking */
h1 {
  font-size: var(--font-size-4xl);
  font-weight: var(--font-weight-extrabold);
  letter-spacing: -0.01em;
}

/* H2 — Section heading: Rethink Sans bold, uppercase, tracked */
h2 {
  font-size: 24px;
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* H3 — Subsection/card title: Rethink Sans semibold, normal case */
h3 {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
  letter-spacing: normal;
  text-transform: none;
}

/* H4 and smaller — inline sub-labels, not part of the heading tier system;
   read as body text (IBM Plex Sans) rather than the Rethink Sans headline face */
h4, h5, h6 {
  font-family: var(--font-family-base);
  font-weight: var(--font-weight-semibold);
}

p { margin-bottom: var(--space-md); color: var(--color-text); }

.container { width: 100%; max-width: 1200px; margin-inline: auto; padding-inline: var(--space-lg); }
.container--narrow { max-width: 800px; }

.page-header .report-link {
  max-width: 720px;
  margin: var(--space-md) 0 0;
  text-align: left;
  font-size: var(--font-size-md);
}
.page-header .report-link a {
  color: var(--color-primary);
  text-decoration: underline;
}

.accent-bar {
  display: block;
  width: 64px;
  height: 4px;
  background: var(--color-primary);
  border-radius: var(--radius-full);
  margin-block: var(--space-md);
}

.intro-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-lg);
}
.intro-text { flex: 1 1 auto; min-width: 0; }
.report-thumb {
  flex: 0 0 279px;
  width: 279px;
  aspect-ratio: 612 / 792;
  display: block;
  transition: box-shadow var(--transition-fast), transform var(--transition-fast);
}
.report-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.report-thumb:hover,
.report-thumb:focus-visible {
  box-shadow: 0 0 0 2px var(--color-primary);
  transform: translateY(-2px);
}

@media (max-width: 640px) {
  .intro-row { flex-direction: column; align-items: stretch; }
  .report-thumb { flex: 0 0 auto; width: 100%; }
}

/* ── Page layout ── */
.page-header {
  padding-block: var(--space-3xl) var(--space-xl);
  text-align: left;
}
/* P1 — Lede/hero intro: plain white text per the CMTD color rule
   (green is reserved for inline emphasis, not a base text color) */
.page-header .subtitle {
  color: var(--color-text);
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-regular);
  margin-top: calc(-1 * var(--space-sm));
}

/* ── Section wrappers ── */
.viz-section {
  padding-block: var(--space-2xl);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.viz-section:first-of-type { border-top: none; }
.viz-section__header { margin-bottom: var(--space-lg); }
.viz-section__header h2 { margin-bottom: var(--space-xs); }
.viz-section__header p { color: rgba(255, 255, 255, 0.65); font-size: var(--font-size-sm); margin: 0 0 var(--space-sm); }

.subsection { margin-top: var(--space-2xl); }
.subsection:first-of-type { margin-top: 0; }
.subsection h3 { font-size: var(--font-size-lg); margin-bottom: var(--space-xs); }
.viz-section__eyebrow {
  display: block;
  color: var(--color-accent-5);
  font-size: var(--font-size-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: var(--space-xs);
}
.section-note {
  color: rgba(255, 255, 255, 0.5);
  font-size: var(--font-size-sm);
}

/* ── Placeholder (sections not yet built) ── */
.placeholder {
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl);
  text-align: center;
  color: rgba(255, 255, 255, 0.45);
}

/* ── iframes ── */
.viz-frame {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0;
  background: var(--color-surface);
  display: block;
}
.viz-frame--topics { height: clamp(480px, 75vh, 850px); }

.topics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
}
.topics-grid--single { grid-template-columns: 1fr; }
.topics-grid--single .viz-frame--topics { height: clamp(600px, 85vh, 1100px); }
.topics-grid h4 { font-size: var(--font-size-md); margin-top: 0; }
.topics-grid__title--pro { color: var(--color-accent-pro); }
.topics-grid__title--anti { color: var(--color-accent-anti); }
@media (max-width: 900px) {
  .topics-grid { grid-template-columns: 1fr; }
}

.mobile-notice { display: none; }
@media (max-width: 768px) {
  .desktop-only { display: none; }
  .mobile-notice {
    display: block;
    padding: var(--space-2xl);
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    color: rgba(255, 255, 255, 0.5);
    font-size: var(--font-size-sm);
  }
}

/* ── Who's who table ── */
.whoswho-controls {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
  margin-bottom: var(--space-md);
}
.filter-btn {
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: transparent;
  color: var(--color-text);
  font-family: var(--font-family-base);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.filter-btn:hover { border-color: var(--color-primary); color: var(--color-primary); }
/* Active state matches CMTD's Button 3 dark-bg pattern: green fill, black text */
.filter-btn.active { background: var(--color-primary); border-color: var(--color-primary); color: #000000; }

.stance-pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
}
.stance-pro     { background: rgba(219, 107, 48, 0.18); color: var(--color-accent-pro); }
.stance-anti    { background: rgba(58, 93, 174, 0.18);  color: var(--color-accent-anti); }
.stance-neutral { background: rgba(166, 167, 169, 0.18); color: var(--color-accent-neutral); }
.stance-none    { background: rgba(255, 255, 255, 0.08); color: rgba(255,255,255,0.5); }

.confidence-pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.65);
}
.confidence-pill--high { border-color: rgba(48, 155, 66, 0.4); color: #4bc264; }
.confidence-pill--medium { border-color: rgba(242, 199, 92, 0.4); color: #f2c75c; }
.confidence-pill--low { border-color: rgba(186, 12, 47, 0.4); color: #e0546f; }

/* ── Who's who: cards ── */
.card-grid-scroll {
  max-height: 600px;
  overflow-y: auto;
  padding-right: var(--space-sm);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: var(--space-md);
}
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-md);
  align-content: start;
}
.card-grid[hidden] { display: none; }
.account-card {
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0;
  background: var(--color-surface);
  padding: var(--space-sm) var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  cursor: pointer;
  transition: border-color var(--transition-fast), transform var(--transition-fast);
}
.account-card:hover,
.account-card:focus-visible {
  border-color: var(--color-primary);
}
.account-card:focus-visible { outline: none; }
.account-card--active {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 1px var(--color-primary);
  background: rgba(44, 200, 77, 0.28);
}
.account-card__platform {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-md);
  display: inline-flex;
  color: rgba(255, 255, 255, 0.55);
}
.account-card__platform img { display: block; }
.account-card__header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}
.account-card__avatar {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  object-fit: cover;
}
.account-card__avatar--fallback {
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent-5));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-sm);
  letter-spacing: 0.02em;
}
.account-card__id { min-width: 0; padding-right: 34px; }
.account-card__name {
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-sm);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.account-card__handle {
  font-size: var(--font-size-xs);
  color: rgba(255, 255, 255, 0.5);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.account-card__meta {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  flex-wrap: wrap;
  font-size: var(--font-size-xs);
  color: rgba(255, 255, 255, 0.6);
}
.account-card__stats {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--font-size-xs);
  color: rgba(255, 255, 255, 0.55);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: var(--space-sm);
  margin-top: auto;
}
.account-card__stats strong { color: var(--color-text); font-weight: var(--font-weight-semibold); }

/* ── Influencer post sampler ── */
#influencer-stance-filter { margin-bottom: var(--space-md); }
.influencer-account-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}
.influencer-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-md) var(--space-xs) var(--space-xs);
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: transparent;
  color: var(--color-text);
  font-family: var(--font-family-base);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.influencer-chip:hover { border-color: var(--color-primary); color: var(--color-primary); }
.influencer-chip.active { background: var(--color-primary); border-color: var(--color-primary); color: #000000; }
.influencer-chip__avatar {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  object-fit: cover;
  flex: none;
}
.influencer-posts-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}
.tweet-grid {
  display: flex;
  gap: var(--space-md);
  align-items: start;
  overflow-x: auto;
  padding-bottom: var(--space-sm);
  scroll-snap-type: x proximity;
}
.tweet-embed {
  flex: none;
  width: 260px;
  max-height: 60vh;
  overflow-y: auto;
  scroll-snap-align: start;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* old Edge/IE */
}
.tweet-embed::-webkit-scrollbar { display: none; } /* Chrome/Safari */

/* Fully local, X-styled tweet card (post_carousel.js + tweet_embeds_cache.js) —
   every image is a local file, no widgets.js, no runtime calls to X. */
.tweet-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0;
  background: var(--color-surface);
  padding: var(--space-md);
  cursor: pointer;
  transition: border-color var(--transition-fast), background-color var(--transition-fast);
}
.tweet-card:hover,
.tweet-card:focus-visible {
  border-color: var(--color-primary);
}
.tweet-card:focus-visible { outline: none; }
.tweet-card__platform {
  flex: none;
  width: 16px;
  height: 16px;
  margin-left: auto;
  opacity: 0.7;
}
.tweet-card__header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}
.tweet-card__avatar {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  object-fit: cover;
}
.tweet-card__avatar--fallback {
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent-5));
}
.tweet-card__avatar--sm { width: 24px; height: 24px; }
.tweet-card__id { min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.tweet-card__name {
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-sm);
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tweet-card__handle {
  font-family: var(--font-family-condensed);
  font-size: var(--font-size-xs);
  color: rgba(255, 255, 255, 0.5);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tweet-card__text {
  font-size: var(--font-size-sm);
  line-height: 1.45;
  color: var(--color-text);
  margin: 0;
}
.tweet-card__text a { color: var(--color-primary); }
.tweet-card__media {
  width: 100%;
  border-radius: 0; /* images stay square-cornered, matching the site's card/image rule */
  object-fit: cover;
  max-height: 220px;
}
/* The original post being quoted — a nested, smaller card matching X's own
   quote-tweet layout. Its own header/text/media reuse the same classes as
   the outer card at a slightly smaller scale (via --sm avatar). */
.tweet-card__quoted {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0;
  padding: var(--space-sm);
}
.tweet-card__quoted .tweet-card__text { font-size: var(--font-size-xs); }
.tweet-card__date {
  font-family: var(--font-family-condensed);
  font-size: var(--font-size-xs);
  color: rgba(255, 255, 255, 0.5);
}
.tweet-card__date strong { color: var(--color-text); font-weight: var(--font-weight-semibold); }
/* Likes/replies only — no share/retweet count is available from the free
   syndication API this data comes from (see fetch_tweet_embeds.mjs). */
.tweet-card__stats {
  display: flex;
  gap: var(--space-md);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: var(--space-sm);
}
.tweet-card__stat {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-family-condensed);
  font-size: var(--font-size-xs);
  color: rgba(255, 255, 255, 0.6);
}
.tweet-card__stat svg { flex: none; }
.tweet-card__link {
  font-family: var(--font-family-condensed);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-primary);
}
.tweet-card__link:hover { text-decoration: underline; }
.tweet-card--missing {
  align-items: flex-start;
  color: rgba(255, 255, 255, 0.6);
}

/* ── AI audit ── */
.ai-instability-controls {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-lg);
  margin-bottom: var(--space-lg);
}
.ai-question-sentence {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-xs);
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-medium);
  color: #fff;
}
.ai-inline-select {
  font: inherit;
  font-weight: var(--font-weight-medium);
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  padding: var(--space-xs) var(--space-sm);
  max-width: 100%;
}
.ai-bars {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}
.ai-bar-row {
  display: grid;
  grid-template-columns: 100px 1fr 160px;
  align-items: center;
  gap: var(--space-md);
}
.ai-bar-row__label { font-size: var(--font-size-sm); font-weight: var(--font-weight-medium); }
.ai-bar-track {
  display: flex;
  height: 20px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
}
.ai-bar-seg { height: 100%; }
.ai-bar-row__counts { font-size: var(--font-size-xs); color: rgba(255, 255, 255, 0.55); white-space: nowrap; }

.ai-snippets {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: var(--space-md);
}
.ai-full-answers {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: var(--space-md);
  margin-top: var(--space-md);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
  align-items: start;
}
@media (max-width: 800px) {
  .ai-full-answers { grid-template-columns: 1fr; }
}
.ai-answer-col__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  margin-bottom: var(--space-xs);
}
.ai-answer-col__header h4 { margin: 0; font-size: var(--font-size-base); }
.ai-answer-nav { display: flex; gap: var(--space-xs); }
.ai-answer-prev,
.ai-answer-next {
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: transparent;
  color: var(--color-text);
  font-family: var(--font-family-base);
  font-size: var(--font-size-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}
.ai-answer-prev:hover,
.ai-answer-next:hover { border-color: var(--color-primary); color: var(--color-primary); }
.ai-answer-card {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0;
  background: var(--color-surface);
  padding: var(--space-md);
  max-height: 420px;
  overflow-y: auto;
}
.ai-answer-card p {
  font-size: var(--font-size-sm);
  color: rgba(255, 255, 255, 0.85);
  margin: 0;
}
.ai-snippet-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  font-size: var(--font-size-sm);
  color: rgba(255, 255, 255, 0.8);
}
.ai-verdict-pill {
  display: inline-block;
  padding: 1px 8px;
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  margin-right: var(--space-xs);
}
.ai-verdict-pill--deny { background: rgba(186, 12, 47, 0.18); color: #e0546f; }
.ai-verdict-pill--mixed { background: rgba(242, 199, 92, 0.18); color: #f2c75c; }
.ai-verdict-pill--affirm { background: rgba(48, 155, 66, 0.18); color: #4bc264; }

.ai-domains-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(200px, 1fr));
  column-gap: var(--space-lg);
  row-gap: var(--space-xs);
}
.ai-domain-col-header { font-size: var(--font-size-base); margin-bottom: var(--space-sm); }
.ai-domain-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-sm);
  border-radius: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: var(--font-size-sm);
}
.ai-domain-item--sketchy { border-color: rgba(186, 12, 47, 0.4); background: rgba(186, 12, 47, 0.08); }
.ai-domain-item__row {
  display: flex;
  align-items: baseline;
  gap: var(--space-sm);
  width: 100%;
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-align: left;
}
.ai-domain-item--active {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 1px var(--color-primary);
  background: rgba(44, 200, 77, 0.28);
}
.ai-domain-item__domain { font-weight: var(--font-weight-semibold); }
.ai-domain-item__category { color: rgba(255, 255, 255, 0.5); font-size: var(--font-size-xs); flex: 1; }
.ai-domain-item__share { color: rgba(255, 255, 255, 0.7); font-size: var(--font-size-xs); }

.ai-domain-expand {
  grid-column: 1 / -1;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: var(--space-md);
  margin-top: var(--space-sm);
}
.ai-domain-expand[hidden] { display: none; }
.ai-citation-carousel {
  display: flex;
  gap: var(--space-md);
  align-items: start;
  overflow-x: auto;
  padding-top: var(--space-sm);
  padding-bottom: var(--space-sm);
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.ai-citation-carousel::-webkit-scrollbar { display: none; }
.ai-citation-card {
  flex: none;
  width: min(360px, 85vw);
  scroll-snap-align: start;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: var(--space-sm);
  font-size: var(--font-size-sm);
}
.ai-citation-card--verified {
  border-top-color: var(--color-primary);
  background: rgba(44, 200, 77, 0.06);
  border-radius: 0;
  padding: var(--space-sm);
}
.ai-citation-highlight {
  background: rgba(44, 200, 77, 0.28);
  color: inherit;
  border-radius: 2px;
  box-shadow: 0 0 0 2px rgba(44, 200, 77, 0.28);
}
.ai-citation-chip {
  display: inline-block;
  margin: 0 4px;
  padding: 0 6px;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  color: var(--color-primary);
  background: rgba(44, 200, 77, 0.16);
  border-radius: var(--radius-sm);
  text-decoration: none;
  white-space: nowrap;
  vertical-align: middle;
}
.ai-citation-chip:hover { background: rgba(44, 200, 77, 0.3); text-decoration: underline; }
.ai-citation-chip--other {
  color: rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.08);
}
.ai-citation-chip--other:hover { background: rgba(255, 255, 255, 0.16); color: rgba(255, 255, 255, 0.85); }
.ai-citation-example__prompt { color: rgba(255, 255, 255, 0.6); font-style: italic; margin-bottom: var(--space-xs); }
.ai-citation-example__text {
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-sm);
  padding: var(--space-sm);
  margin-bottom: var(--space-sm);
  max-height: 30vh;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.ai-citation-example__text::-webkit-scrollbar { display: none; }
.ai-citation-example__sources-label {
  font-size: var(--font-size-xs);
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: var(--space-xs);
}
.ai-citation-example__sources {
  font-size: var(--font-size-xs);
  color: rgba(255, 255, 255, 0.7);
  padding-left: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ai-citation-example__sources[hidden] { display: none; }
.ai-citation-example__sources[data-full] {
  max-height: 20vh;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.ai-citation-example__sources[data-full]::-webkit-scrollbar { display: none; }
.ai-citation-example__sources a { color: inherit; }
.ai-citation-example__source--target { color: #fff; font-weight: var(--font-weight-semibold); }
.ai-citation-example__toggle {
  margin-top: var(--space-xs);
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-size: var(--font-size-xs);
  color: rgba(255, 255, 255, 0.55);
  text-decoration: underline;
  cursor: pointer;
}
.ai-citation-example__toggle:hover { color: rgba(255, 255, 255, 0.85); }

/* ── Post-sample carousel (inline, expands within the card grid) ── */
.post-carousel-panel {
  grid-column: 1 / -1;
  background: var(--color-surface);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0;
  padding: var(--space-lg);
}
.post-carousel-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}
.post-carousel-panel__title { font-weight: var(--font-weight-semibold); }
.post-carousel-panel__close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 var(--space-xs);
}
.post-carousel-panel__close:hover { color: var(--color-text); }

/* ── Footer ── */
.page-footer {
  text-align: center;
  padding: var(--space-2xl) 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.35);
  font-size: var(--font-size-sm);
}

/* ═══════════════════════════════════════════════════════════
   P4 — CAPTION / META / LABEL (CMTD style guide)
   IBM Plex Sans Condensed at the smallest, most utility-register
   text on the page — timestamps, handles, counts, and pills.
   Plain values stay normal-case; badge/tag-style pills get the
   uppercase + tracked "label" treatment.
   ═══════════════════════════════════════════════════════════ */
.viz-section__eyebrow,
.account-card__handle,
.account-card__meta,
.account-card__stats,
.ai-bar-row__counts,
.ai-domain-item__category,
.ai-domain-item__share,
.ai-citation-chip,
.ai-citation-example__sources-label,
.ai-citation-example__sources,
.ai-citation-example__toggle,
.stance-pill,
.confidence-pill,
.ai-verdict-pill {
  font-family: var(--font-family-condensed);
  font-weight: var(--font-weight-medium);
}

/* Badge/tag-style pills — uppercase + tracked, matching CMTD's ".p4-style-label" */
.stance-pill,
.confidence-pill,
.ai-verdict-pill {
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
