/* EU Parliament Monitor - Styles
 * SPDX-FileCopyrightText: 2024-2026 Hack23 AB
 * SPDX-License-Identifier: Apache-2.0
 */

/* ─── Design Tokens ──────────────────────────────────────────────── */
:root {
  --primary: #003399;
  --primary-dark: #002266;
  --primary-light: #e8edf5;
  /* Focus ring token — always contrasts with page background */
  --focus-ring: #001a66;
  --secondary: #e6b800;
  --secondary-dark: #996600;
  /* Text on secondary (yellow) backgrounds — always dark for contrast */
  --on-secondary: #1a1a2e;
  --accent: #0066cc;
  --accent-light: #e6f0ff;

  --text: #1a1a2e;
  --text-secondary: #4a4f60;
  --text-muted: #686d7c;
  --bg: #f0f2f5;
  --bg-card: #ffffff;
  --border: #dde1e6;
  --border-light: #eef0f3;
  --hero-glow-accent: rgba(255, 214, 51, 0.18);
  --hero-surface-strong: rgba(255, 255, 255, 0.12);
  --hero-surface-soft: rgba(255, 255, 255, 0.06);
  --hero-surface-border: rgba(255, 255, 255, 0.14);

  --success: #28a745;
  --warning: #e6a817;
  --danger: #dc3545;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.1), 0 4px 8px rgba(0, 0, 0, 0.04);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;

  --font-sans:
    -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-serif: Georgia, 'Times New Roman', serif;

  --max-width: 1440px;
  --transition: 0.25s ease;

  /* Generic surface and text tokens */
  --surface-alt: #ffffff;
  --surface-muted: #f8f9fa;
  --text-primary: #1a1a2e;

  /* Chart/Dashboard tokens */
  --metric-gradient-start: #003399;
  --metric-gradient-end: #1565c0;
  --chart-row-hover: rgba(0, 51, 153, 0.03);
}

/* ─── Skip Navigation ────────────────────────────────────────────── */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  z-index: 200;
  padding: 12px 24px;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  border-radius: 0 0 var(--radius-sm) 0;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 0;
  outline: 3px solid var(--secondary);
  outline-offset: 2px;
}

/* Screen-reader-only utility – hides element visually while keeping it
   accessible to assistive technologies (WCAG technique C7 / H39). */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ─── Reset & Base ───────────────────────────────────────────────── */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  color-scheme: light dark;
}

html[data-theme='light'] {
  color-scheme: light;
}

html[data-theme='dark'] {
  color-scheme: dark;
}

body {
  font-family: var(--font-sans);
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--primary);
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
}

/* ─── Theme Toggle ───────────────────────────────────────────────── */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.1rem;
  cursor: pointer;
  transition:
    background var(--transition),
    transform var(--transition);
  flex-shrink: 0;
  line-height: 1;
  font-family: var(--font-sans);
}

.theme-toggle:hover {
  background: rgba(255, 255, 255, 0.22);
  transform: scale(1.08);
}

.theme-toggle:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

.theme-toggle__icon--light,
.theme-toggle__icon--dark {
  display: none;
}

/* Show moon (switch-to-dark) when in light mode */
html:not([data-theme='dark']) .theme-toggle__icon--light {
  display: inline;
}
html[data-theme='dark'] .theme-toggle__icon--dark {
  display: inline;
}
@media (prefers-color-scheme: dark) {
  html:not([data-theme='light']) .theme-toggle__icon--light {
    display: none;
  }
  html:not([data-theme='light']) .theme-toggle__icon--dark {
    display: inline;
  }
}
html[data-theme='light'] .theme-toggle__icon--light {
  display: inline;
}
html[data-theme='light'] .theme-toggle__icon--dark {
  display: none;
}

/* ─── Site Header ────────────────────────────────────────────────── */
.site-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.site-header__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 24px;
  gap: 12px;
  min-width: 0;
}

.site-header__inner--stacked {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  padding-top: 12px;
  padding-bottom: 12px;
}

.site-header__inner--stacked .site-header__brand {
  flex: 1 1 320px;
  min-width: 0;
}

.site-header__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #fff;
  min-width: 0;
}

.site-header__brand:hover {
  text-decoration: none;
  color: var(--secondary);
}

.site-header__flag {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  font-size: 1.2em;
  flex-shrink: 0;
}

.site-header__logo-picture {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
}

.site-header__logo {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: contain;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.15);
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.25),
    0 2px 8px rgba(0, 0, 0, 0.3);
}

.site-header__logo--banner {
  width: 240px;
  height: 80px;
  border-radius: 4px;
  object-fit: cover;
  object-position: center;
  flex-shrink: 0;
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.2),
    0 2px 8px rgba(0, 0, 0, 0.3);
}

.site-header__brand-text {
  display: block;
  min-width: 0;
}

.site-header__title {
  display: block;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.site-header__subtitle {
  display: block;
  font-size: 0.72rem;
  font-weight: 400;
  opacity: 0.8;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.site-header__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex: 0 0 auto;
  flex-wrap: wrap;
  max-width: min(100%, 720px);
}

.site-header__cta {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.95);
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transition:
    background var(--transition),
    border-color var(--transition),
    color var(--transition),
    transform var(--transition);
}

.site-header__cta:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.38);
  color: #fff;
  text-decoration: none;
  transform: translateY(-1px);
}

.site-header__cta:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

.site-header__cta--sponsor {
  background: linear-gradient(135deg, #db2777, #be123c);
  border-color: rgba(255, 255, 255, 0.32);
}

.site-header__cta--security {
  background: rgba(230, 184, 0, 0.18);
  border-color: rgba(230, 184, 0, 0.48);
}

/* Language switcher — inline in header, single row */
.site-header__langs {
  display: flex;
  align-items: center;
  gap: 2px;
  overflow-x: auto;
  flex-shrink: 1;
  min-width: 0;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.site-header__inner--stacked .site-header__langs {
  justify-content: center;
  flex-wrap: wrap;
  width: 100%;
  flex-basis: 100%;
  overflow: visible;
  /* Base padding for wrapped language rows; reduced on mobile for compactness. */
  padding-top: 10px;
  border-top: 1px solid var(--hero-surface-border);
}

.site-header__langs::-webkit-scrollbar {
  display: none;
}

.lang-link {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 4px 7px;
  min-height: 32px;
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  transition:
    background var(--transition),
    color var(--transition);
  white-space: nowrap;
  flex-shrink: 0;
}

.lang-link:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  text-decoration: none;
}

.lang-link.active {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
}

.lang-link.active:hover {
  background: rgba(255, 255, 255, 0.35);
}

/* Legacy standalone .language-switcher — only hide when the new
   .site-header__langs nav is also present (so legacy articles remain
   navigable until they are regenerated). */
.site-header__langs ~ .language-switcher,
.site-header:has(.site-header__langs) ~ .language-switcher {
  display: none;
}

/* Style legacy .language-switcher to match the header aesthetic when it IS
   the only language nav (articles not yet migrated). */
.language-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 8px 24px;
  background: var(--primary-dark);
  justify-content: center;
}

/* ─── Hero Section (Index pages) ─────────────────────────────────── */
.hero {
  position: relative;
  border-bottom: 3px solid var(--secondary);
  overflow: hidden;
  background: linear-gradient(160deg, var(--primary) 0%, var(--primary-dark) 100%);
  padding: 28px 0 0;
}

.hero__inner {
  display: flex;
  flex-direction: column;
  gap: 24px;
  align-items: stretch;
}

.hero__banner {
  display: block;
  width: 100vw;
  max-width: none;
  /* Break out of the centered content container so the banner spans the viewport. */
  margin-inline: calc(50% - 50vw);
  overflow: hidden;
}

.hero__banner-img {
  display: block;
  width: 100%;
  height: clamp(180px, 32vw, 360px);
  object-fit: cover;
  object-position: center;
}

/* ─── Page Banner (non-index pages) ─────────────────────────────── */
.page-banner {
  display: block;
  width: 100vw;
  max-width: none;
  margin-inline: calc(50% - 50vw);
  overflow: hidden;
  border-bottom: 3px solid var(--secondary);
  line-height: 0;
}

.page-banner__img {
  display: block;
  width: 100%;
  height: clamp(120px, 26vw, 320px);
  object-fit: cover;
  object-position: center;
}

.hero__content {
  width: min(calc(100% - 48px), var(--max-width));
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  padding: 0 0 4px;
  color: #fff;
}

.hero__kicker {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--hero-surface-strong);
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero__title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

.hero__description {
  font-size: 1.08rem;
  color: rgba(255, 255, 255, 0.95);
  max-width: 40rem;
  margin: 0;
  line-height: 1.55;
}

/* ─── AI Intelligence Section ────────────────────────────────────── */
.ai-intelligence {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 28px 28px 24px;
  background: linear-gradient(135deg, var(--primary) 0%, #0044aa 60%, #0055cc 100%);
  border-radius: var(--radius-lg);
  margin-top: 0;
  margin-bottom: 32px;
  color: #fff;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.ai-intelligence::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(255, 204, 0, 0.12) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.ai-intelligence h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 16px;
  letter-spacing: -0.01em;
}

.ai-intelligence p {
  font-size: 0.97rem;
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.65;
  margin-bottom: 12px;
}

.ai-intelligence__quote {
  font-style: italic;
  color: #fff;
  border-left: 3px solid var(--secondary);
  padding: 14px 20px;
  margin: 0 0 20px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  line-height: 1.6;
  font-size: 1.05rem;
  backdrop-filter: blur(4px);
}

.ai-intelligence__features {
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.ai-intelligence__features li {
  font-size: 0.93rem;
  color: #fff;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  line-height: 1.5;
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(4px);
  transition:
    background var(--transition),
    transform var(--transition);
}

.ai-intelligence__features li:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.ai-intelligence__features li strong {
  color: #ffd740;
}

@media (min-width: 768px) {
  .ai-intelligence__features {
    grid-template-columns: 1fr 1fr;
  }
}

/* ─── Footer Disclaimer ──────────────────────────────────────────── */
.footer-disclaimer {
  margin-top: 8px;
  font-size: 0.8rem;
  color: inherit;
}

/* ─── Main Content ───────────────────────────────────────────────── */
.site-main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 24px 24px 28px;
}

.section-heading {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-heading__icon {
  font-size: 1.2em;
}

/* ─── Filter Toolbar ─────────────────────────────────────────────── */
.filter-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 58px;
  z-index: 90;
}

.filter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1;
}

.filter-btn {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 100px;
  background: var(--bg);
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition:
    background var(--transition),
    color var(--transition),
    border-color var(--transition);
  font-family: var(--font-sans);
  white-space: nowrap;
}

.filter-btn:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}

.filter-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(0, 51, 153, 0.25);
}

.filter-btn__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  margin-left: 6px;
  border-radius: 100px;
  font-size: 0.7rem;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.1);
  line-height: 1;
}

.filter-btn.active .filter-btn__count {
  background: rgba(255, 255, 255, 0.3);
}

.filter-search {
  flex: 0 1 240px;
  min-width: 160px;
}

.filter-search__input {
  width: 100%;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  transition: border-color var(--transition);
}

.filter-search__input:focus {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
  border-color: var(--primary);
}

/* ─── News Card Grid ─────────────────────────────────────────────── */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr));
  gap: 20px;
  list-style: none;
}

.news-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition:
    transform var(--transition),
    box-shadow var(--transition),
    border-color var(--transition);
  border: 1px solid var(--border-light);
  border-left: 4px solid var(--primary);
}

.news-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-left-color: var(--accent);
}

.news-card__link {
  display: flex;
  flex-direction: column;
  height: 100%;
  text-decoration: none;
  color: inherit;
}

.news-card__link:hover {
  text-decoration: none;
}

/* Top accent bar — hidden by default (using left border instead) */
.news-card__accent {
  height: 0;
  background: transparent;
}

/* Category-specific left border colors via parent */
.news-card:has(.news-card__accent--week-ahead) {
  border-left-color: var(--accent);
}

.news-card:has(.news-card__accent--committee-reports) {
  border-left-color: var(--success);
}

.news-card:has(.news-card__accent--motions) {
  border-left-color: var(--warning);
}

.news-card:has(.news-card__accent--propositions) {
  border-left-color: #8b5cf6;
}

.news-card:has(.news-card__accent--breaking) {
  border-left-color: var(--danger);
}

.news-card:has(.news-card__accent--month-ahead) {
  border-left-color: #0088cc;
}

.news-card:has(.news-card__accent--week-in-review) {
  border-left-color: #e67e22;
}

.news-card:has(.news-card__accent--month-in-review) {
  border-left-color: #2ecc71;
}

.news-card__body {
  padding: 16px 20px 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.news-card__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.news-card__badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.news-card__badge--week-ahead {
  background: var(--accent-light);
  color: var(--accent);
}

.news-card__badge--committee-reports {
  background: #e8f5e9;
  color: #1b5e20;
}

.news-card__badge--motions {
  background: #fff8e1;
  color: #8d6e00;
}

.news-card__badge--propositions {
  background: #f3e8ff;
  color: #6d28d9;
}

.news-card__badge--breaking {
  background: #fde8e8;
  color: #b91c1c;
}

.news-card__badge--month-ahead {
  background: #e0f2fe;
  color: #0369a1;
}

.news-card__badge--week-in-review {
  background: #fef3c7;
  color: #92400e;
}

.news-card__badge--month-in-review {
  background: #dcfce7;
  color: #166534;
}

.news-card__date {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
}

.news-card__title {
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
  margin-bottom: 8px;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-card__link:hover .news-card__title {
  color: var(--accent);
}

.news-card__excerpt {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ─── Empty State ────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 80px 24px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 2px dashed var(--border);
}

.empty-state__icon {
  font-size: 3rem;
  margin-bottom: 16px;
}

.empty-state__text {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 420px;
  margin: 0 auto;
  line-height: 1.55;
}

/* ─── Site Footer (Hack23 AB multi-section) ──────────────────────── */
.site-footer {
  background: var(--primary-dark);
  color: rgba(255, 255, 255, 0.85);
  padding: 0;
  font-size: 0.9rem;
}

.footer-content {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(240px, 1.15fr) minmax(260px, 1.25fr) minmax(240px, 1fr) minmax(
      220px,
      0.9fr
    );
  gap: 28px;
  padding: 40px 24px 32px;
}

.footer-section h3 {
  color: var(--secondary);
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 12px;
  letter-spacing: 0.02em;
}

.footer-section p {
  line-height: 1.55;
  margin-bottom: 8px;
}

.footer-section ul {
  list-style: none;
  padding: 0;
}

.footer-section ul li {
  margin: 6px 0;
}

.footer-section ul li a {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  transition: color var(--transition);
  overflow-wrap: anywhere;
}

.footer-section ul li a:hover {
  color: var(--secondary);
  text-decoration: underline;
}

.footer-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 12px;
}

.footer-badges a {
  display: inline-flex;
  align-items: center;
  padding: 3px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition:
    background var(--transition),
    transform var(--transition);
}

.footer-badges a:hover {
  background: rgba(255, 255, 255, 0.16);
  transform: translateY(-1px);
}

.footer-badges img {
  display: block;
  height: 20px;
  width: auto;
}

.footer-stats {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.7);
  font-style: italic;
  margin-top: 8px;
  padding: 4px 12px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 100px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.footer-company-summary {
  color: rgba(255, 255, 255, 0.72);
  border-left: 3px solid var(--secondary);
  padding-left: 10px;
  margin-top: 12px;
}

[dir='rtl'] .footer-company-summary {
  border-left: none;
  border-right: 3px solid var(--secondary);
  padding-left: 0;
  padding-right: 10px;
}

.language-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.language-grid a {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  font-size: 0.82rem;
  padding: 3px 6px;
  border-radius: var(--radius-sm);
  transition:
    background var(--transition),
    color var(--transition);
  white-space: nowrap;
  text-align: center;
}

.language-grid a:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--secondary);
  text-decoration: none;
}

.language-grid a.active {
  color: var(--secondary);
  font-weight: 700;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  text-align: center;
  padding: 16px 24px;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.6);
}

.footer-bottom a {
  color: var(--secondary);
  text-decoration: underline;
}

.footer-bottom a:hover {
  text-decoration: underline;
}

/* ─── Article Top Navigation ─────────────────────────────────────── */
.article-top-nav {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 12px 24px;
}

.article-top-nav .back-to-news {
  display: inline-flex;
  align-items: center;
  padding: 8px 20px;
  background: var(--primary);
  color: white;
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.88rem;
  transition:
    background var(--transition),
    transform var(--transition);
}

.article-top-nav .back-to-news:hover {
  background: var(--accent);
  transform: translateY(-1px);
  text-decoration: none;
  color: white;
}

/* ─── Article Page ───────────────────────────────────────────────── */
.news-article {
  max-width: var(--article-max-width, 100%);
  margin: 0 auto;
  background: var(--bg-card);
  padding: 40px 44px;
  box-shadow: var(--shadow-sm);
  border-radius: var(--radius-md);
  border-top: 4px solid var(--primary);
}

.article-header {
  border-bottom: 2px solid var(--border-light);
  padding-bottom: 24px;
  margin-bottom: 28px;
}

.article-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 0.88em;
  color: var(--text-muted);
  margin-bottom: 18px;
}

.article-type {
  background: var(--primary);
  color: white;
  padding: 3px 12px;
  border-radius: 100px;
  font-weight: 700;
  font-size: 0.78em;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.article-date {
  padding: 3px 0;
}

.article-read-time {
  padding: 3px 0;
}

.article-lang {
  padding: 3px 12px;
  background: var(--secondary);
  border-radius: 100px;
  font-weight: 700;
  font-size: 0.78em;
  color: var(--on-secondary);
}

.article-header h1 {
  font-size: 2.1em;
  line-height: 1.2;
  margin-bottom: 12px;
  color: var(--primary);
  letter-spacing: -0.02em;
}

.article-subtitle {
  font-size: 1.2em;
  color: var(--text-secondary);
  font-weight: 300;
  line-height: 1.45;
}

/* Article content */
.article-content {
  margin: 28px 0;
}

.article-content h2 {
  font-size: 1.65em;
  margin: 36px 0 16px;
  color: var(--primary);
  letter-spacing: -0.01em;
}

.article-content h3 {
  font-size: 1.3em;
  margin: 28px 0 12px;
  color: var(--accent);
}

.article-content p {
  margin: 16px 0;
  line-height: var(--article-line-height);
}

.article-content ul,
.article-content ol {
  margin: 14px 0;
  padding-left: 28px;
}

.article-content li {
  margin: 6px 0;
}

/* Lead paragraph (lede) */
.lede {
  font-family: var(--font-serif);
  font-size: 1.18em;
  line-height: 1.7;
  border-left: 4px solid var(--secondary);
  padding-left: 20px;
  margin: 28px 0;
  color: var(--text-secondary);
}

/* Context section */
.context {
  background: var(--primary-light);
  padding: 20px 24px;
  border-radius: var(--radius-sm);
  margin: 24px 0;
  border-left: 4px solid var(--primary);
}

/* Event calendar */
.event-calendar {
  margin: 28px 0;
}

.event-item {
  display: flex;
  gap: 18px;
  padding: 16px;
  border-left: 3px solid var(--primary);
  margin: 12px 0;
  background: var(--primary-light);
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}

.event-item:hover {
  background: var(--accent-light);
}

.event-date {
  font-weight: 700;
  color: var(--primary);
  min-width: 100px;
  font-size: 0.92em;
}

.event-details h3 {
  margin: 0 0 6px 0;
  font-size: 1.05em;
}

.event-type {
  display: inline-block;
  background: var(--accent);
  color: white;
  padding: 2px 8px;
  border-radius: 100px;
  font-size: 0.78em;
  font-weight: 600;
  margin: 4px 0;
}

/* Article footer */
.article-footer {
  border-top: 2px solid var(--border);
  padding-top: 28px;
  margin-top: 36px;
}

.article-sources h2 {
  font-size: 1.2em;
  margin-bottom: 14px;
  color: var(--primary);
}

.article-sources ul {
  list-style: none;
  padding: 0;
}

.article-sources li {
  margin: 8px 0;
  padding-left: 20px;
  position: relative;
  font-size: 0.92em;
}

.article-sources li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--accent);
}

.article-sources a {
  color: var(--accent);
  text-decoration: none;
}

.article-sources a:hover {
  text-decoration: underline;
}

/* Article navigation */
.article-nav {
  margin-top: 36px;
  text-align: center;
}

.back-to-news {
  display: inline-block;
  padding: 12px 28px;
  background: var(--primary);
  color: white;
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  transition:
    background var(--transition),
    transform var(--transition);
}

.back-to-news:hover {
  background: var(--accent);
  transform: translateY(-1px);
  text-decoration: none;
  color: white;
}

/* ─── Language Indicator Compat ───────────────────────────────────── */
.language-indicator {
  background: var(--secondary);
  color: var(--on-secondary);
  display: inline-block;
  padding: 4px 14px;
  border-radius: 100px;
  font-weight: 700;
  font-size: 0.82em;
  margin-top: 8px;
}

/* ─── RTL Support ────────────────────────────────────────────────── */
[dir='rtl'] {
  direction: rtl;
}

[dir='rtl'] .skip-link {
  left: auto;
  right: 0;
  border-radius: 0 0 0 var(--radius-sm);
}

[dir='rtl'] .article-content ul,
[dir='rtl'] .article-content ol {
  padding-right: 28px;
  padding-left: 0;
}

[dir='rtl'] .lede {
  border-left: none;
  border-right: 4px solid var(--secondary);
  padding-left: 0;
  padding-right: 20px;
}

[dir='rtl'] .event-item {
  border-left: none;
  border-right: 3px solid var(--primary);
}

[dir='rtl'] .context {
  border-left: none;
  border-right: 4px solid var(--primary);
}

[dir='rtl'] .ai-intelligence__quote {
  border-left: none;
  border-right: 3px solid var(--secondary);
}

[dir='rtl'] .article-sources li {
  padding-left: 0;
  padding-right: 20px;
}

[dir='rtl'] .article-sources li::before {
  left: auto;
  right: 0;
}

[dir='rtl'] .news-card {
  border-left: 1px solid var(--border-light);
  border-right: 4px solid var(--primary);
}

[dir='rtl'] .news-card:hover {
  border-right-color: var(--accent);
}

[dir='rtl'] .news-card:has(.news-card__accent--week-ahead) {
  border-right-color: var(--accent);
}

[dir='rtl'] .news-card:has(.news-card__accent--committee-reports) {
  border-right-color: var(--success);
}

[dir='rtl'] .news-card:has(.news-card__accent--motions) {
  border-right-color: var(--warning);
}

[dir='rtl'] .news-card:has(.news-card__accent--propositions) {
  border-right-color: #8b5cf6;
}

[dir='rtl'] .news-card:has(.news-card__accent--breaking) {
  border-right-color: var(--danger);
}

[dir='rtl'] .news-card:has(.news-card__accent--month-ahead) {
  border-right-color: #0088cc;
}

[dir='rtl'] .news-card:has(.news-card__accent--week-in-review) {
  border-right-color: #e67e22;
}

[dir='rtl'] .news-card:has(.news-card__accent--month-in-review) {
  border-right-color: #2ecc71;
}

/* ─── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .site-header__inner {
    flex-wrap: wrap;
    padding: 10px 12px;
    gap: 6px;
  }

  .site-header__brand {
    flex: 1;
  }

  .site-header__actions {
    flex: 1 1 100%;
    justify-content: flex-start;
    order: 1;
  }

  .site-header__cta {
    min-height: 30px;
    padding: 5px 8px;
    font-size: 0.68rem;
  }

  .site-header__langs {
    flex-basis: 100%;
    order: 2;
    padding-bottom: 4px;
  }

  .site-header__inner--stacked .site-header__langs {
    /* Tighten the stacked header on smaller screens to keep the top bar compact. */
    padding-top: 8px;
  }

  .lang-link {
    padding: 5px 8px;
    font-size: 0.72rem;
  }

  .hero {
    padding: 20px 0 0;
  }

  .hero__inner {
    gap: 16px;
  }

  .hero__content {
    width: min(calc(100% - 28px), var(--max-width));
  }

  .hero__title {
    font-size: 1.5rem;
  }

  .hero__description {
    font-size: 0.92rem;
    max-width: 32rem;
  }

  .hero__banner-img {
    min-height: 160px;
  }

  .page-banner__img {
    min-height: 100px;
  }

  .site-main {
    padding: 18px 16px 24px;
  }

  .news-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .filter-toolbar {
    flex-direction: column;
    padding: 10px 12px;
    gap: 8px;
  }

  .filter-search {
    flex: 1 1 100%;
    min-width: 0;
    width: 100%;
  }

  .filter-buttons {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
    scrollbar-width: none;
    position: relative;
    padding-inline-end: 32px;
  }

  .filter-buttons::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 32px;
    height: 100%;
    pointer-events: none;
    background: linear-gradient(to right, transparent, var(--bg-card));
  }

  [dir='rtl'] .filter-buttons::after {
    right: auto;
    left: 0;
    background: linear-gradient(to left, transparent, var(--bg-card));
  }

  .filter-buttons::-webkit-scrollbar {
    display: none;
  }

  .filter-btn {
    font-size: 0.76rem;
    padding: 5px 10px;
    flex-shrink: 0;
  }

  .news-article {
    padding: 24px 18px;
  }

  .article-top-nav {
    padding: 8px 12px;
  }

  .article-header h1 {
    font-size: 1.6em;
  }

  .article-subtitle {
    font-size: 1em;
  }

  .article-meta {
    font-size: 0.82em;
  }

  .event-item {
    flex-direction: column;
    gap: 8px;
  }

  .event-date {
    min-width: auto;
  }

  .section-heading {
    font-size: 1.25rem;
  }

  .footer-content {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 24px 16px;
  }

  .language-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .ai-intelligence {
    margin: 0 14px 24px;
    padding: 22px 18px 18px;
  }

  .ai-intelligence h2 {
    font-size: 1.2rem;
  }

  .ai-intelligence__quote {
    font-size: 0.92rem;
    padding: 10px 14px;
  }
}

@media (max-width: 480px) {
  .lang-link {
    padding: 4px 7px;
    font-size: 0.68rem;
  }

  .hero__content {
    width: min(calc(100% - 24px), var(--max-width));
  }

  .hero__kicker {
    font-size: 0.68rem;
  }

  .news-card__body {
    padding: 14px 14px 16px;
  }

  .language-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .site-header__logo--banner {
    width: 160px;
    height: 54px;
  }
}

/* ─── Print ──────────────────────────────────────────────────────── */
@media print {
  .site-header,
  .site-footer,
  .article-nav,
  .article-top-nav,
  .language-switcher,
  .site-header__langs,
  .filter-toolbar,
  .hero,
  .ai-intelligence,
  .reading-progress,
  .skip-link,
  .footer-disclaimer {
    display: none !important;
  }

  .news-article {
    box-shadow: none;
    padding: 0;
    border: none;
    max-width: 100%;
  }

  body {
    background: #fff;
    color: #000;
    font-size: 11pt;
  }

  .news-card {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ccc;
  }
}

/* ─── Accessibility: Focus ───────────────────────────────────────── */
a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

/* Primary-background interactive elements need a contrasting focus ring.
 * var(--bg) is light on dark primary (#003399) and dark on light primary
 * (#4da3ff in dark mode), giving high contrast in both colour schemes. */
.back-to-news:focus-visible,
.lang-link.active:focus-visible,
.lang-link:hover:focus-visible,
.skip-link:focus-visible {
  outline-color: var(--bg);
}

/* ─── Reduced Motion ─────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ─── Extended Design Tokens ──────────────────────────────────── */
:root {
  /* Typography Scale */
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 1.875rem;
  --font-size-4xl: 2.25rem;

  /* Article Reading Tokens */
  --article-max-width: 100%;
  --article-line-height: 1.75;
  --article-paragraph-spacing: 1.5em;

  /* Political Group Colors */
  --group-epp: #0055a4;
  --group-sd: #e2001a;
  --group-re: #ffd700;
  --group-greens: #00993e;
  --group-ecr: #009edb;
  --group-id: #002b7f;
  --group-left: #8b0000;
}

/* ─── Dark Mode ──────────────────────────────────────────────── */
/* System-preference dark mode: applies when no explicit data-theme is set */
@media (prefers-color-scheme: dark) {
  html:not([data-theme='light']) {
    --bg: #0f1219;
    --bg-card: #1a1f2e;
    --text: #e8eaf0;
    --text-secondary: #b4b8c8;
    --text-muted: #8a8fa0;
    --border: #2d3348;
    --border-light: #252a3a;

    /* Dark mode brand/foreground colors */
    --primary: #4da3ff;
    --primary-dark: #1a4a80;
    --primary-light: #1a2540;
    /* Focus ring — light so it contrasts on dark backgrounds */
    --focus-ring: #cce5ff;
    --accent: #5cb8ff;
    --accent-light: #1a2d4a;
    --secondary: #ffd633;
    --secondary-dark: #e6b800;
    /* on-secondary stays dark — #0f1219 on #FFD633 gives ~12:1 contrast */
    --on-secondary: #0f1219;

    --success: #34d058;
    --warning: #f0b429;
    --danger: #f85149;

    --shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.3), 0 0 1px rgba(77, 163, 255, 0.06);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.35), 0 0 2px rgba(77, 163, 255, 0.08);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 4px rgba(77, 163, 255, 0.1);
    --shadow-hover-glow: 0 6px 24px rgba(0, 0, 0, 0.4), 0 0 8px rgba(77, 163, 255, 0.12);

    --hero-surface-strong: rgba(255, 255, 255, 0.1);
    --hero-surface-soft: rgba(255, 255, 255, 0.04);
    --hero-surface-border: rgba(255, 255, 255, 0.1);

    /* Surface tokens */
    --surface-alt: #1a1f2e;
    --surface-muted: #161b22;
    --text-primary: #e8eaf0;

    /* Chart/Dashboard dark tokens */
    --metric-gradient-start: #4da3ff;
    --metric-gradient-end: #80bfff;
    --chart-row-hover: rgba(77, 163, 255, 0.06);

    /* Dark mode political group colors — lighter for visibility on dark cards.
     * All colors achieve ≥4.5:1 contrast against dark text (var(--bg) = #0f1219)
     * as required by WCAG 2.1 AA for small text.
     */
    --group-epp: #4a9fe6;
    --group-sd: #ff6b6b;
    --group-re: #ffd93d;
    --group-greens: #3dc464;
    --group-ecr: #33bbee;
    --group-id: #7088d8;
    --group-left: #d46060;
  }

  /* Smoother header-to-body gradient in dark mode */
  html:not([data-theme='light']) .site-header {
    background: linear-gradient(135deg, #0d2a5c 0%, #0a1a38 100%);
    box-shadow:
      0 1px 8px rgba(0, 0, 0, 0.5),
      0 0 1px rgba(77, 163, 255, 0.15);
  }
}

/* Explicit dark mode toggle: applies when user manually selects dark theme */
html[data-theme='dark'] {
  --bg: #0f1219;
  --bg-card: #1a1f2e;
  --text: #e8eaf0;
  --text-secondary: #b4b8c8;
  --text-muted: #8a8fa0;
  --border: #2d3348;
  --border-light: #252a3a;
  --primary: #4da3ff;
  --primary-dark: #1a4a80;
  --primary-light: #1a2540;
  --focus-ring: #cce5ff;
  --accent: #5cb8ff;
  --accent-light: #1a2d4a;
  --secondary: #ffd633;
  --secondary-dark: #e6b800;
  --on-secondary: #0f1219;
  --success: #34d058;
  --warning: #f0b429;
  --danger: #f85149;
  --shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.3), 0 0 1px rgba(77, 163, 255, 0.06);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.35), 0 0 2px rgba(77, 163, 255, 0.08);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 4px rgba(77, 163, 255, 0.1);
  --shadow-hover-glow: 0 6px 24px rgba(0, 0, 0, 0.4), 0 0 8px rgba(77, 163, 255, 0.12);
  --hero-surface-strong: rgba(255, 255, 255, 0.1);
  --hero-surface-soft: rgba(255, 255, 255, 0.04);
  --hero-surface-border: rgba(255, 255, 255, 0.1);
  /* Surface tokens */
  --surface-alt: #1a1f2e;
  --surface-muted: #161b22;
  --text-primary: #e8eaf0;
  /* Chart/Dashboard dark tokens */
  --metric-gradient-start: #4da3ff;
  --metric-gradient-end: #80bfff;
  --chart-row-hover: rgba(77, 163, 255, 0.06);
  --group-epp: #4a9fe6;
  --group-sd: #ff6b6b;
  --group-re: #ffd93d;
  --group-greens: #3dc464;
  --group-ecr: #33bbee;
  --group-id: #7088d8;
  --group-left: #d46060;
}

html[data-theme='dark'] .site-header {
  background: linear-gradient(135deg, #0d2a5c 0%, #0a1a38 100%);
  box-shadow:
    0 1px 8px rgba(0, 0, 0, 0.5),
    0 0 1px rgba(77, 163, 255, 0.15);
}

/* ─── Article Typography Enhancement ────────────────────────── */
/* Enhances direct paragraph children with improved reading metrics.
 * Coexists with the base .article-content p rule (line ~629) which
 * sets margin and text-align; these properties are additive.
 */
.article-content > p {
  line-height: var(--article-line-height);
  margin-bottom: var(--article-paragraph-spacing);
}

/* ─── Key Findings Box ───────────────────────────────────────── */
/*
 * Usage:
 * <aside class="key-findings">
 *   <p class="key-findings__title">🔑 Key Findings</p>
 *   <ul class="key-findings__list">
 *     <li>First key finding</li>
 *     <li>Second key finding</li>
 *   </ul>
 * </aside>
 */
.key-findings {
  background: #fffbea;
  border: 1px solid var(--secondary-dark);
  border-left: 5px solid var(--secondary);
  border-radius: var(--radius-sm);
  padding: 20px 24px;
  margin: 28px 0;
}

.key-findings__title {
  font-size: var(--font-size-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #7a5c00;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.key-findings__list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.key-findings__list li {
  padding: 6px 0 6px 22px;
  position: relative;
  line-height: 1.55;
  color: var(--text);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.key-findings__list li:last-child {
  border-bottom: none;
}

.key-findings__list li::before {
  content: '✦';
  position: absolute;
  left: 0;
  color: var(--secondary-dark);
  font-size: 0.75em;
  top: 9px;
}

/* ─── Pull Quote ─────────────────────────────────────────────── */
/*
 * Usage:
 * <blockquote class="pull-quote">
 *   "Quote text here."
 *   <cite>— MEP Name, Political Group</cite>
 * </blockquote>
 */
.pull-quote {
  border-left: 5px solid var(--primary);
  padding: 20px 28px;
  margin: 32px 0;
  font-family: var(--font-serif);
  font-size: var(--font-size-xl);
  font-style: italic;
  line-height: 1.6;
  color: var(--text-secondary);
  background: var(--primary-light);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.pull-quote cite {
  display: block;
  margin-top: 12px;
  font-size: var(--font-size-sm);
  font-style: normal;
  font-weight: 600;
  color: var(--primary);
  font-family: var(--font-sans);
}

/* ─── Data Card ──────────────────────────────────────────────── */
/*
 * Usage (replaces raw <pre> data dumps):
 * <div class="data-card">
 *   <p class="data-card__title">Legislative Data</p>
 *   <pre>Formatted data here</pre>
 * </div>
 */
.data-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 20px 22px;
  margin: 24px 0;
  overflow: auto;
  box-shadow: var(--shadow-sm);
}

.data-card__title {
  font-size: var(--font-size-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  margin-bottom: 12px;
}

.data-card pre,
.data-card code {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.88rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text);
  background: none;
}

/* ─── Status Badges ──────────────────────────────────────────── */
/*
 * Usage: <span class="status-badge status-badge--passed">Adopted</span>
 * Variants: status-badge--passed | status-badge--pending | status-badge--failed
 */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: 100px;
  font-size: var(--font-size-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  vertical-align: middle;
}

.status-badge--passed {
  background: #e8f5e9;
  color: #1b5e20;
}

.status-badge--pending {
  background: #fff8e1;
  color: #8d6e00;
}

.status-badge--failed {
  background: #fde8e8;
  color: #b91c1c;
}

/* ─── Political Group Badges ─────────────────────────────────── */
/*
 * Usage: <span class="group-badge group-badge--epp">EPP</span>
 * Variants: epp | sd | re | greens | ecr | id | left
 */
.group-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: var(--font-size-xs);
  font-weight: 700;
  color: white;
  vertical-align: middle;
}

.group-badge--epp {
  background: var(--group-epp);
}
.group-badge--sd {
  background: var(--group-sd);
}
.group-badge--re {
  background: var(--group-re);
  color: #333;
}
.group-badge--greens {
  background: var(--group-greens);
}
.group-badge--ecr {
  background: var(--group-ecr);
}
.group-badge--id {
  background: var(--group-id);
}
.group-badge--left {
  background: var(--group-left);
}

/* ─── Reading Progress Bar ───────────────────────────────────── */
/*
 * Shown on article pages only — a scroll listener updates width.
 * Hidden by default (display:none); the article-template inline script
 * sets display:block on page load so the bar appears only when JS runs.
 */
.reading-progress {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--secondary) 0%, var(--accent) 100%);
  z-index: 1000;
  transition: width 0.1s linear;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

/* ─── RTL Enhancements for New Components ───────────────────── */
[dir='rtl'] .key-findings {
  border-left: 1px solid var(--secondary-dark);
  border-right: 5px solid var(--secondary);
}

[dir='rtl'] .key-findings__list li {
  padding-left: 0;
  padding-right: 22px;
}

[dir='rtl'] .key-findings__list li::before {
  left: auto;
  right: 0;
}

[dir='rtl'] .pull-quote {
  border-left: none;
  border-right: 5px solid var(--primary);
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

[dir='rtl'] .data-card {
  border-left: 1px solid var(--border);
  border-right: 4px solid var(--accent);
}

/* ─── Dark Mode Component Overrides ─────────────────────────── */
/* System-preference dark mode component overrides */
@media (prefers-color-scheme: dark) {
  html:not([data-theme='light']) .key-findings {
    background: #1c1a08;
    border-color: #4a4400;
    border-left-color: var(--secondary);
  }

  html:not([data-theme='light']) .key-findings__title {
    color: #ccaa00;
  }

  html:not([data-theme='light']) .key-findings__list li {
    border-bottom-color: rgba(255, 255, 255, 0.06);
  }

  html:not([data-theme='light']) .pull-quote {
    background: #131d35;
  }

  html:not([data-theme='light']) .data-card {
    border-color: var(--border);
    border-left-color: var(--accent);
  }

  html:not([data-theme='light']) .status-badge--passed {
    background: #0d2818;
    color: #6ee7a0;
  }

  html:not([data-theme='light']) .status-badge--pending {
    background: #2a2000;
    color: #ffd860;
  }

  html:not([data-theme='light']) .status-badge--failed {
    background: #2a0808;
    color: #ff9090;
  }

  html:not([data-theme='light']) .group-badge {
    color: var(--bg);
  }

  html:not([data-theme='light']) .site-header__brand:hover {
    color: #fff;
  }

  html:not([data-theme='light']) .ai-intelligence {
    background: linear-gradient(135deg, #0a1628 0%, #0d1f3c 60%, #142850 100%);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  }

  html:not([data-theme='light']) .ai-intelligence__quote {
    background: rgba(255, 255, 255, 0.06);
    border-left-color: var(--secondary);
  }

  html:not([data-theme='light']) .ai-intelligence__features li {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.1);
  }

  html:not([data-theme='light']) .filter-toolbar {
    background: var(--bg-card);
    border-color: var(--border);
  }

  html:not([data-theme='light']) .filter-btn {
    background: var(--bg);
    border-color: var(--border);
    color: var(--text-secondary);
  }

  html:not([data-theme='light']) .filter-btn:hover {
    background: var(--primary-light);
    color: var(--primary);
  }

  html:not([data-theme='light']) .filter-btn.active {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 2px 12px rgba(77, 163, 255, 0.3);
  }

  html:not([data-theme='light']) .filter-search__input {
    background: var(--bg);
    border-color: var(--border);
    color: var(--text);
  }

  html:not([data-theme='light']) .filter-search__input::placeholder {
    color: var(--text-muted);
  }

  html:not([data-theme='light']) .news-card {
    border-top-color: var(--border);
    border-right-color: var(--border);
    border-bottom-color: var(--border);
    background: var(--bg-card);
    box-shadow: var(--shadow-sm);
  }

  html:not([data-theme='light']) .news-card:hover {
    box-shadow: var(--shadow-hover-glow);
    border-color: var(--accent);
  }

  html:not([data-theme='light']) .news-article {
    border-top-color: var(--primary);
    box-shadow: var(--shadow-md);
  }

  html:not([data-theme='light']) .news-card__badge--week-ahead {
    background: var(--accent-light);
    color: var(--accent);
  }

  html:not([data-theme='light']) .news-card__badge--committee-reports {
    background: #0d2818;
    color: #5ed08a;
  }

  html:not([data-theme='light']) .news-card__badge--motions {
    background: #2a2000;
    color: #f0c040;
  }

  html:not([data-theme='light']) .news-card__badge--propositions {
    background: #1e1040;
    color: #b07aff;
  }

  html:not([data-theme='light']) .news-card__badge--breaking {
    background: #2a0808;
    color: #ff7070;
  }

  html:not([data-theme='light']) .news-card__badge--month-ahead {
    background: #0a1e30;
    color: #4db8e8;
  }

  html:not([data-theme='light']) .news-card__badge--week-in-review {
    background: #2a1a08;
    color: #f0a050;
  }

  html:not([data-theme='light']) .news-card__badge--month-in-review {
    background: #0d2818;
    color: #5ed08a;
  }

  html:not([data-theme='light']) .context {
    background: var(--primary-light);
    border-left-color: var(--primary);
  }

  html:not([data-theme='light']) .event-item {
    background: var(--primary-light);
    border-left-color: var(--primary);
  }

  html:not([data-theme='light']) .event-item:hover {
    background: var(--accent-light);
  }

  html:not([data-theme='light']) .deep-analysis {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--bg-card) 100%);
  }

  html:not([data-theme='light']) .deep-analysis h2 {
    color: var(--primary);
  }

  html:not([data-theme='light']) .stakeholder-winner {
    background: #0d2818;
    border-color: var(--success);
  }

  html:not([data-theme='light']) .stakeholder-loser {
    background: #2a0808;
    border-color: var(--danger);
  }

  html:not([data-theme='light']) .stakeholder-neutral {
    background: #2a2000;
    border-color: var(--warning);
  }

  html:not([data-theme='light']) .severity-low {
    background: #0d2818;
    color: #5ed08a;
  }

  html:not([data-theme='light']) .severity-medium {
    background: #2a1a08;
    color: #f0a050;
  }

  html:not([data-theme='light']) .severity-high {
    background: #2a0808;
    color: #ff7070;
  }

  html:not([data-theme='light']) .severity-critical {
    background: #5a0a2a;
    color: #ff90b0;
  }

  html:not([data-theme='light']) .evidence-refs-block,
  html:not([data-theme='light']) .counter-args-block {
    background: rgba(255, 255, 255, 0.04);
  }

  html:not([data-theme='light']) .analysis-executive-summary {
    background: linear-gradient(135deg, var(--primary-light), var(--bg-card));
  }

  html:not([data-theme='light']) .mistake-card {
    background: #1a0a0a;
    border-left-color: var(--danger);
  }

  html:not([data-theme='light']) .mistake-actor {
    color: #ff7070;
  }

  html:not([data-theme='light']) .confidence-high {
    background: #0d2818;
    color: #5ed08a;
    border-color: var(--success);
  }

  html:not([data-theme='light']) .confidence-medium {
    background: #2a2000;
    color: #f0c040;
    border-color: #f0c040;
  }

  html:not([data-theme='light']) .confidence-low {
    background: #2a0808;
    color: #ff7070;
    border-color: var(--danger);
  }

  html:not([data-theme='light']) .empty-state {
    border-color: var(--border);
  }

  html:not([data-theme='light']) .section-heading {
    border-bottom-color: var(--border);
  }

  html:not([data-theme='light']) .site-footer {
    background: #070a10;
    border-top: 1px solid var(--border);
  }

  html:not([data-theme='light']) .footer-bottom {
    border-top-color: rgba(255, 255, 255, 0.08);
  }

  html:not([data-theme='light']) .consequences-table th {
    background: var(--primary-light);
    color: var(--text);
  }

  html:not([data-theme='light']) .consequences-table td {
    border-bottom-color: var(--border);
  }

  html:not([data-theme='light']) .consequences-table tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.03);
  }

  html:not([data-theme='light']) .impact-card {
    background: var(--bg-card);
    border-color: var(--border);
  }

  html:not([data-theme='light']) .analysis-what,
  html:not([data-theme='light']) .analysis-who,
  html:not([data-theme='light']) .analysis-when,
  html:not([data-theme='light']) .analysis-why,
  html:not([data-theme='light']) .analysis-outlook {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-light);
  }

  html:not([data-theme='light']) .hero {
    border-bottom-color: var(--secondary-dark);
  }

  html:not([data-theme='light']) .lede {
    border-left-color: var(--secondary);
  }

  html:not([data-theme='light']) .article-header {
    border-bottom-color: var(--border);
  }

  html:not([data-theme='light']) .article-footer {
    border-top-color: var(--border);
  }

  html:not([data-theme='light']) a {
    color: var(--accent);
  }

  html:not([data-theme='light']) a:hover {
    color: var(--primary);
  }

  /* Mindmap system dark */
  /* Mindmap — color-mix() overrides are in this block below */

  /* SWOT system dark */
  html:not([data-theme='light']) .swot-analysis {
    background: var(--bg-card);
  }

  html:not([data-theme='light']) .swot-quadrant {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--border);
  }

  html:not([data-theme='light']) .swot-quadrant:hover {
    background: rgba(255, 255, 255, 0.07);
  }

  html:not([data-theme='light']) .swot-item {
    border-bottom-color: var(--border-light);
  }

  html:not([data-theme='light']) .swot-strengths {
    border-left-color: var(--success);
  }

  html:not([data-theme='light']) .swot-weaknesses {
    border-left-color: var(--danger);
  }

  html:not([data-theme='light']) .swot-opportunities {
    border-left-color: var(--primary);
  }

  html:not([data-theme='light']) .swot-threats {
    border-left-color: var(--warning);
  }

  /* Dashboard system dark */
  html:not([data-theme='light']) .dashboard {
    background: var(--bg-card);
  }

  html:not([data-theme='light']) .dashboard-panel {
    background: var(--bg);
    border-color: var(--border);
  }

  html:not([data-theme='light']) .dashboard-panel:hover {
    border-color: var(--accent);
  }

  html:not([data-theme='light']) .pipeline-health-indicator {
    background: rgba(255, 255, 255, 0.04);
  }
  html:not([data-theme='light']) .pipeline-health-indicator.pipeline-healthy {
    background: rgba(40, 167, 69, 0.12);
  }
  html:not([data-theme='light']) .pipeline-health-indicator.pipeline-moderate {
    background: rgba(255, 193, 7, 0.12);
  }
  html:not([data-theme='light']) .pipeline-health-indicator.pipeline-critical {
    background: rgba(220, 53, 69, 0.12);
  }
  html:not([data-theme='light']) .pipeline-fallback-list li {
    background: var(--bg-card);
    border-color: var(--border);
  }

  html:not([data-theme='light']) .metric-card {
    background: linear-gradient(145deg, var(--bg-card), var(--bg));
    border-color: var(--border);
  }

  html:not([data-theme='light']) .metric-value {
    background: linear-gradient(135deg, var(--metric-gradient-start), var(--metric-gradient-end));
    -webkit-background-clip: text;
    background-clip: text;
  }

  html:not([data-theme='light']) .chart-container {
    background: var(--bg-card);
    border-color: var(--border);
  }

  html:not([data-theme='light']) .chart-title {
    color: var(--text-secondary);
  }

  html:not([data-theme='light']) .chart-fallback-table {
    border-color: var(--border);
  }

  html:not([data-theme='light']) .chart-fallback-table thead th {
    background: linear-gradient(135deg, var(--bg-card), var(--bg));
    color: var(--text-secondary);
  }

  html:not([data-theme='light']) .chart-fallback-table tbody tr:hover {
    background: var(--chart-row-hover);
  }

  /* Sankey */
  html:not([data-theme='light']) .sankey-summary {
    color: var(--text-secondary);
  }

  html:not([data-theme='light']) .sankey-fallback-table td {
    border-bottom-color: var(--border);
  }

  html:not([data-theme='light']) .sankey-section {
    background: linear-gradient(160deg, #14102a 0%, #0d1424 50%, #0a1628 100%);
    border-color: #9b59b6;
    box-shadow: 0 4px 16px rgba(155, 89, 182, 0.08);
  }

  html:not([data-theme='light']) .sankey-section h2 {
    border-bottom-color: #9b59b6;
  }

  html:not([data-theme='light']) .sankey-fallback-table thead th {
    background: linear-gradient(135deg, var(--bg-card), var(--bg));
    color: var(--text-secondary);
  }

  html:not([data-theme='light']) .sankey-chart-wrapper {
    background: var(--bg);
  }

  /* Analysis & methodology */
  html:not([data-theme='light']) .analysis-methodology {
    background: var(--bg-card);
    border-color: var(--border);
  }

  html:not([data-theme='light']) .iteration-item {
    background: var(--bg);
  }

  html:not([data-theme='light']) .reasoning-chain-card {
    background: var(--bg);
  }

  /* Scenario/wildcard */
  html:not([data-theme='light']) .scenario-wildcards {
    background: #2a2000;
    border-color: #6b5a00;
  }

  html:not([data-theme='light']) .scenario-severity-critical {
    color: #ff90b0;
  }

  html:not([data-theme='light']) .scenario-severity-medium {
    color: #f0c040;
  }

  /* SWOT quadrant headings & severity badges */
  html:not([data-theme='light']) .swot-analysis h2 {
    color: var(--text);
  }

  html:not([data-theme='light']) .swot-strengths {
    background: linear-gradient(135deg, #0d2818 0%, #122a1c 100%);
  }

  html:not([data-theme='light']) .swot-strengths .swot-quadrant-heading {
    color: #5ed08a;
  }

  html:not([data-theme='light']) .swot-strengths .swot-quadrant-heading::before {
    color: #34d058;
  }

  html:not([data-theme='light']) .swot-weaknesses {
    background: linear-gradient(135deg, #2a0808 0%, #2e0f0f 100%);
  }

  html:not([data-theme='light']) .swot-weaknesses .swot-quadrant-heading {
    color: #ff7070;
  }

  html:not([data-theme='light']) .swot-weaknesses .swot-quadrant-heading::before {
    color: #ff5050;
  }

  html:not([data-theme='light']) .swot-opportunities {
    background: linear-gradient(135deg, #0a1628 0%, #0d1f3c 100%);
  }

  html:not([data-theme='light']) .swot-opportunities .swot-quadrant-heading {
    color: #5cb8ff;
  }

  html:not([data-theme='light']) .swot-opportunities .swot-quadrant-heading::before {
    color: #4da3ff;
  }

  html:not([data-theme='light']) .swot-threats {
    background: linear-gradient(135deg, #2a1a08 0%, #2e1e0c 100%);
  }

  html:not([data-theme='light']) .swot-threats .swot-quadrant-heading {
    color: #f0a050;
  }

  html:not([data-theme='light']) .swot-threats .swot-quadrant-heading::before {
    color: #f0a050;
  }

  html:not([data-theme='light']) .swot-item:hover {
    background: rgba(255, 255, 255, 0.06);
  }

  html:not([data-theme='light']) .swot-severity-low .swot-severity-badge {
    background: #0d2818;
    color: #5ed08a;
  }

  html:not([data-theme='light']) .swot-severity-medium .swot-severity-badge {
    background: #2a2000;
    color: #f0c040;
  }

  html:not([data-theme='light']) .swot-severity-high .swot-severity-badge {
    background: #2a0808;
    color: #ff7070;
  }

  /* Multi-Dimensional SWOT panels */
  html:not([data-theme='light']) .swot-dimension {
    border-color: var(--border);
    background: var(--bg-card);
  }

  html:not([data-theme='light']) .swot-dimension-summary {
    background: rgba(77, 163, 255, 0.06);
  }

  html:not([data-theme='light']) .swot-dimension-summary:hover {
    background: rgba(77, 163, 255, 0.1);
  }

  html:not([data-theme='light']) .swot-stakeholder {
    border-color: var(--border);
    background: var(--bg-card);
  }

  html:not([data-theme='light']) .swot-stakeholder-summary {
    background: rgba(255, 255, 255, 0.04);
  }

  html:not([data-theme='light']) .swot-stakeholder-summary:hover {
    background: rgba(255, 255, 255, 0.08);
  }

  html:not([data-theme='light']) .swot-mini-grid {
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
  }

  /* Dashboard */
  html:not([data-theme='light']) .dashboard h2 {
    color: var(--text);
  }

  html:not([data-theme='light']) .panel-title {
    color: var(--text);
  }

  /* Mindmap */
  html:not([data-theme='light']) .mindmap-section {
    background: linear-gradient(160deg, #0a1628 0%, #0d1424 50%, #14102a 100%);
    border-color: var(--primary);
    box-shadow: 0 4px 16px rgba(77, 163, 255, 0.08);
  }

  html:not([data-theme='light']) .mindmap-center {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    border-color: var(--primary-dark);
  }

  html:not([data-theme='light']) .mindmap-branch {
    background: color-mix(in srgb, var(--branch-bg, #e3f2fd) 18%, var(--bg-card));
    border-color: color-mix(in srgb, var(--branch-border, #1565c0) 60%, var(--text));
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  }

  html:not([data-theme='light']) .mindmap-branch:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  }

  html:not([data-theme='light']) .mindmap-branch-label {
    color: color-mix(in srgb, var(--branch-text, #1565c0) 55%, var(--text));
    border-bottom-color: color-mix(in srgb, var(--branch-border, #1565c0) 35%, var(--border));
  }

  html:not([data-theme='light']) .mindmap-leaf-list {
    color: var(--text-secondary);
  }

  html:not([data-theme='light']) .mindmap-leaf-list li::before {
    color: color-mix(in srgb, var(--branch-border, #1565c0) 60%, var(--text));
  }

  /* Intelligence mindmap */
  html:not([data-theme='light']) .intelligence-mindmap {
    background: linear-gradient(160deg, #0a1628 0%, #0d1424 40%, #14102a 100%);
  }

  html:not([data-theme='light']) .mindmap-intel-node {
    background: color-mix(in srgb, var(--branch-bg, #e3f2fd) 18%, var(--bg-card));
    border-color: color-mix(in srgb, var(--branch-border, #1565c0) 60%, var(--text));
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  }

  html:not([data-theme='light']) .mindmap-intel-node:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  }

  html:not([data-theme='light']) .mindmap-intel-label {
    color: color-mix(in srgb, var(--branch-text, #1565c0) 55%, var(--text));
  }

  html:not([data-theme='light']) .mindmap-influence-bar {
    background: rgba(255, 255, 255, 0.08);
  }

  html:not([data-theme='light']) .mindmap-influence-fill {
    background: linear-gradient(
      90deg,
      color-mix(in srgb, var(--branch-border, #1565c0) 70%, var(--text)),
      color-mix(in srgb, var(--branch-text, #003399) 60%, var(--text))
    );
  }

  html:not([data-theme='light']) .mindmap-actor-toggle,
  html:not([data-theme='light']) .mindmap-connections-toggle,
  html:not([data-theme='light']) .mindmap-actor-network-toggle,
  html:not([data-theme='light']) .mindmap-stakeholder-toggle {
    color: var(--accent);
    background: var(--bg);
  }

  /* Stakeholder impact */
  html:not([data-theme='light']) .stakeholder-impact {
    background: var(--bg-card);
  }

  html:not([data-theme='light']) .stakeholder-impact h2 {
    color: var(--text);
  }

  html:not([data-theme='light']) .stakeholder-perspective-card {
    background: var(--bg-card);
    border-color: var(--border);
  }
}

/* ─── Explicit Dark Mode Component Overrides (toggle) ────────── */
/* Matches html[data-theme="dark"] for the manual theme toggle.
 * The system-preference block uses @media (prefers-color-scheme: dark)
 * with html:not([data-theme="light"]) above. */

html[data-theme='dark'] .key-findings {
  background: #1c1a08;
  border-color: #4a4400;
  border-left-color: var(--secondary);
}

html[data-theme='dark'] .key-findings__title {
  color: #ccaa00;
}

html[data-theme='dark'] .key-findings__list li {
  border-bottom-color: rgba(255, 255, 255, 0.06);
}

html[data-theme='dark'] .pull-quote {
  background: #131d35;
}

html[data-theme='dark'] .data-card {
  border-color: var(--border);
  border-left-color: var(--accent);
}

html[data-theme='dark'] .status-badge--passed {
  background: #0d2818;
  color: #6ee7a0;
}

html[data-theme='dark'] .status-badge--pending {
  background: #2a2000;
  color: #ffd860;
}

html[data-theme='dark'] .status-badge--failed {
  background: #2a0808;
  color: #ff9090;
}

html[data-theme='dark'] .group-badge {
  color: var(--bg);
}

html[data-theme='dark'] .site-header__brand:hover {
  color: #fff;
}

html[data-theme='dark'] .ai-intelligence {
  background: linear-gradient(135deg, #0a1628 0%, #0d1f3c 60%, #142850 100%);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

html[data-theme='dark'] .ai-intelligence__quote {
  background: rgba(255, 255, 255, 0.06);
  border-left-color: var(--secondary);
}

html[data-theme='dark'] .ai-intelligence__features li {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.1);
}

html[data-theme='dark'] .filter-toolbar {
  background: var(--bg-card);
  border-color: var(--border);
}

html[data-theme='dark'] .filter-btn {
  background: var(--bg);
  border-color: var(--border);
  color: var(--text-secondary);
}

html[data-theme='dark'] .filter-btn:hover {
  background: var(--primary-light);
  color: var(--primary);
}

html[data-theme='dark'] .filter-btn.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 12px rgba(77, 163, 255, 0.3);
}

html[data-theme='dark'] .filter-search__input {
  background: var(--bg);
  border-color: var(--border);
  color: var(--text);
}

html[data-theme='dark'] .filter-search__input::placeholder {
  color: var(--text-muted);
}

html[data-theme='dark'] .news-card {
  border-top-color: var(--border);
  border-right-color: var(--border);
  border-bottom-color: var(--border);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
}

html[data-theme='dark'] .news-card:hover {
  box-shadow: var(--shadow-hover-glow);
  border-color: var(--accent);
}

html[data-theme='dark'] .news-article {
  border-top-color: var(--primary);
  box-shadow: var(--shadow-md);
}

html[data-theme='dark'] .news-card__badge--week-ahead {
  background: var(--accent-light);
  color: var(--accent);
}

html[data-theme='dark'] .news-card__badge--committee-reports {
  background: #0d2818;
  color: #5ed08a;
}

html[data-theme='dark'] .news-card__badge--motions {
  background: #2a2000;
  color: #f0c040;
}

html[data-theme='dark'] .news-card__badge--propositions {
  background: #1e1040;
  color: #b07aff;
}

html[data-theme='dark'] .news-card__badge--breaking {
  background: #2a0808;
  color: #ff7070;
}

html[data-theme='dark'] .news-card__badge--month-ahead {
  background: #0a1e30;
  color: #4db8e8;
}

html[data-theme='dark'] .news-card__badge--week-in-review {
  background: #2a1a08;
  color: #f0a050;
}

html[data-theme='dark'] .news-card__badge--month-in-review {
  background: #0d2818;
  color: #5ed08a;
}

html[data-theme='dark'] .context {
  background: var(--primary-light);
  border-left-color: var(--primary);
}

html[data-theme='dark'] .event-item {
  background: var(--primary-light);
  border-left-color: var(--primary);
}

html[data-theme='dark'] .event-item:hover {
  background: var(--accent-light);
}

html[data-theme='dark'] .deep-analysis {
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--bg-card) 100%);
}

html[data-theme='dark'] .deep-analysis h2 {
  color: var(--primary);
}

html[data-theme='dark'] .stakeholder-winner {
  background: #0d2818;
  border-color: var(--success);
}

html[data-theme='dark'] .stakeholder-loser {
  background: #2a0808;
  border-color: var(--danger);
}

html[data-theme='dark'] .stakeholder-neutral {
  background: #2a2000;
  border-color: var(--warning);
}

html[data-theme='dark'] .severity-low {
  background: #0d2818;
  color: #5ed08a;
}

html[data-theme='dark'] .severity-medium {
  background: #2a1a08;
  color: #f0a050;
}

html[data-theme='dark'] .severity-high {
  background: #2a0808;
  color: #ff7070;
}

html[data-theme='dark'] .severity-critical {
  background: #5a0a2a;
  color: #ff90b0;
}

html[data-theme='dark'] .evidence-refs-block,
html[data-theme='dark'] .counter-args-block {
  background: rgba(255, 255, 255, 0.04);
}

html[data-theme='dark'] .analysis-executive-summary {
  background: linear-gradient(135deg, var(--primary-light), var(--bg-card));
}

html[data-theme='dark'] .mistake-card {
  background: #1a0a0a;
  border-left-color: var(--danger);
}

html[data-theme='dark'] .mistake-actor {
  color: #ff7070;
}

html[data-theme='dark'] .confidence-high {
  background: #0d2818;
  color: #5ed08a;
  border-color: var(--success);
}

html[data-theme='dark'] .confidence-medium {
  background: #2a2000;
  color: #f0c040;
  border-color: #f0c040;
}

html[data-theme='dark'] .confidence-low {
  background: #2a0808;
  color: #ff7070;
  border-color: var(--danger);
}

html[data-theme='dark'] .empty-state {
  border-color: var(--border);
}

html[data-theme='dark'] .section-heading {
  border-bottom-color: var(--border);
}

html[data-theme='dark'] .site-footer {
  background: #070a10;
  border-top: 1px solid var(--border);
}

html[data-theme='dark'] .footer-bottom {
  border-top-color: rgba(255, 255, 255, 0.08);
}

html[data-theme='dark'] .consequences-table th {
  background: var(--primary-light);
  color: var(--text);
}

html[data-theme='dark'] .consequences-table td {
  border-bottom-color: var(--border);
}

html[data-theme='dark'] .consequences-table tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.03);
}

html[data-theme='dark'] .impact-card {
  background: var(--bg-card);
  border-color: var(--border);
}

html[data-theme='dark'] .analysis-what,
html[data-theme='dark'] .analysis-who,
html[data-theme='dark'] .analysis-when,
html[data-theme='dark'] .analysis-why,
html[data-theme='dark'] .analysis-outlook {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-light);
}

html[data-theme='dark'] .hero {
  border-bottom-color: var(--secondary-dark);
}

html[data-theme='dark'] .lede {
  border-left-color: var(--secondary);
}

html[data-theme='dark'] .article-header {
  border-bottom-color: var(--border);
}

html[data-theme='dark'] .article-footer {
  border-top-color: var(--border);
}

html[data-theme='dark'] a {
  color: var(--accent);
}

html[data-theme='dark'] a:hover {
  color: var(--primary);
}

/* Mindmap dark mode */
/* Mindmap — color-mix() approach preserves per-branch hue */

/* SWOT dark mode */
html[data-theme='dark'] .swot-analysis {
  background: var(--bg-card);
}

html[data-theme='dark'] .swot-quadrant {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border);
}

html[data-theme='dark'] .swot-quadrant:hover {
  background: rgba(255, 255, 255, 0.07);
}

html[data-theme='dark'] .swot-item {
  border-bottom-color: var(--border-light);
}

html[data-theme='dark'] .swot-strengths {
  border-left-color: var(--success);
}

html[data-theme='dark'] .swot-weaknesses {
  border-left-color: var(--danger);
}

html[data-theme='dark'] .swot-opportunities {
  border-left-color: var(--primary);
}

html[data-theme='dark'] .swot-threats {
  border-left-color: var(--warning);
}

/* Dashboard dark mode */
html[data-theme='dark'] .dashboard {
  background: var(--bg-card);
}

html[data-theme='dark'] .dashboard-panel {
  background: var(--bg);
  border-color: var(--border);
}

html[data-theme='dark'] .dashboard-panel:hover {
  border-color: var(--accent);
}

html[data-theme='dark'] .chart-container {
  background: var(--bg-card);
  border-color: var(--border);
}

html[data-theme='dark'] .metric-card {
  background: linear-gradient(145deg, var(--bg-card), var(--bg));
  border-color: var(--border);
}

html[data-theme='dark'] .metric-value {
  background: linear-gradient(135deg, var(--metric-gradient-start), var(--metric-gradient-end));
  -webkit-background-clip: text;
  background-clip: text;
}

html[data-theme='dark'] .chart-title {
  color: var(--text-secondary);
}

html[data-theme='dark'] .chart-fallback-table {
  border-color: var(--border);
}

html[data-theme='dark'] .chart-fallback-table thead th {
  background: linear-gradient(135deg, var(--bg-card), var(--bg));
  color: var(--text-secondary);
}

html[data-theme='dark'] .chart-fallback-table tbody tr:hover {
  background: var(--chart-row-hover);
}

/* Sankey dark mode */
html[data-theme='dark'] .sankey-summary {
  color: var(--text-secondary);
}

html[data-theme='dark'] .sankey-fallback-table td {
  border-bottom-color: var(--border);
}

html[data-theme='dark'] .sankey-section {
  background: linear-gradient(160deg, #14102a 0%, #0d1424 50%, #0a1628 100%);
  border-color: #9b59b6;
  box-shadow: 0 4px 16px rgba(155, 89, 182, 0.08);
}

html[data-theme='dark'] .sankey-section h2 {
  color: var(--text);
  border-bottom-color: #9b59b6;
}

html[data-theme='dark'] .sankey-chart-wrapper {
  background: var(--bg);
}

html[data-theme='dark'] .sankey-fallback-table thead th {
  background: linear-gradient(135deg, var(--bg-card), var(--bg));
  color: var(--text-secondary);
}

/* Analysis & methodology dark mode */
html[data-theme='dark'] .analysis-methodology {
  background: var(--bg-card);
  border-color: var(--border);
}

html[data-theme='dark'] .iteration-item {
  background: var(--bg);
}

html[data-theme='dark'] .reasoning-chain-card {
  background: var(--bg);
}

/* Scenario & wildcard dark mode */
html[data-theme='dark'] .scenario-wildcards {
  background: #2a2000;
  border-color: #6b5a00;
}

html[data-theme='dark'] .scenario-severity-critical {
  color: #ff90b0;
}

html[data-theme='dark'] .scenario-severity-medium {
  color: #f0c040;
}

/* SWOT quadrant headings & severity badges dark mode */
html[data-theme='dark'] .swot-analysis h2 {
  color: var(--text);
}

html[data-theme='dark'] .swot-strengths {
  background: linear-gradient(135deg, #0d2818 0%, #122a1c 100%);
}

html[data-theme='dark'] .swot-strengths .swot-quadrant-heading {
  color: #5ed08a;
}

html[data-theme='dark'] .swot-strengths .swot-quadrant-heading::before {
  color: #34d058;
}

html[data-theme='dark'] .swot-weaknesses {
  background: linear-gradient(135deg, #2a0808 0%, #2e0f0f 100%);
}

html[data-theme='dark'] .swot-weaknesses .swot-quadrant-heading {
  color: #ff7070;
}

html[data-theme='dark'] .swot-weaknesses .swot-quadrant-heading::before {
  color: #ff5050;
}

html[data-theme='dark'] .swot-opportunities {
  background: linear-gradient(135deg, #0a1628 0%, #0d1f3c 100%);
}

html[data-theme='dark'] .swot-opportunities .swot-quadrant-heading {
  color: #5cb8ff;
}

html[data-theme='dark'] .swot-opportunities .swot-quadrant-heading::before {
  color: #4da3ff;
}

html[data-theme='dark'] .swot-threats {
  background: linear-gradient(135deg, #2a1a08 0%, #2e1e0c 100%);
}

html[data-theme='dark'] .swot-threats .swot-quadrant-heading {
  color: #f0a050;
}

html[data-theme='dark'] .swot-threats .swot-quadrant-heading::before {
  color: #f0a050;
}

html[data-theme='dark'] .swot-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

html[data-theme='dark'] .swot-severity-low .swot-severity-badge {
  background: #0d2818;
  color: #5ed08a;
}

html[data-theme='dark'] .swot-severity-medium .swot-severity-badge {
  background: #2a2000;
  color: #f0c040;
}

html[data-theme='dark'] .swot-severity-high .swot-severity-badge {
  background: #2a0808;
  color: #ff7070;
}

/* Multi-Dimensional SWOT panels dark mode */
html[data-theme='dark'] .swot-dimension {
  border-color: var(--border);
  background: var(--bg-card);
}

html[data-theme='dark'] .swot-dimension-summary {
  background: rgba(77, 163, 255, 0.06);
}

html[data-theme='dark'] .swot-dimension-summary:hover {
  background: rgba(77, 163, 255, 0.1);
}

html[data-theme='dark'] .swot-stakeholder {
  border-color: var(--border);
  background: var(--bg-card);
}

html[data-theme='dark'] .swot-stakeholder-summary {
  background: rgba(255, 255, 255, 0.04);
}

html[data-theme='dark'] .swot-stakeholder-summary:hover {
  background: rgba(255, 255, 255, 0.08);
}

html[data-theme='dark'] .swot-mini-grid {
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

/* Dashboard dark mode */
html[data-theme='dark'] .dashboard h2 {
  color: var(--text);
}

html[data-theme='dark'] .panel-title {
  color: var(--text);
}

/* Mindmap dark mode — color-mix() preserves per-branch hue */
html[data-theme='dark'] .mindmap-section {
  background: linear-gradient(160deg, #0a1628 0%, #0d1424 50%, #14102a 100%);
  border-color: var(--primary);
  box-shadow: 0 4px 16px rgba(77, 163, 255, 0.08);
}

html[data-theme='dark'] .mindmap-center {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  border-color: var(--primary-dark);
}

html[data-theme='dark'] .mindmap-branch {
  background: color-mix(in srgb, var(--branch-bg, #e3f2fd) 18%, var(--bg-card));
  border-color: color-mix(in srgb, var(--branch-border, #1565c0) 60%, var(--text));
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

html[data-theme='dark'] .mindmap-branch:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

html[data-theme='dark'] .mindmap-branch-label {
  color: color-mix(in srgb, var(--branch-text, #1565c0) 55%, var(--text));
  border-bottom-color: color-mix(in srgb, var(--branch-border, #1565c0) 35%, var(--border));
}

html[data-theme='dark'] .mindmap-leaf-list {
  color: var(--text-secondary);
}

html[data-theme='dark'] .mindmap-leaf-list li::before {
  color: color-mix(in srgb, var(--branch-border, #1565c0) 60%, var(--text));
}

/* Intelligence mindmap dark mode */
html[data-theme='dark'] .intelligence-mindmap {
  background: linear-gradient(160deg, #0a1628 0%, #0d1424 40%, #14102a 100%);
}

html[data-theme='dark'] .mindmap-intel-node {
  background: color-mix(in srgb, var(--branch-bg, #e3f2fd) 18%, var(--bg-card));
  border-color: color-mix(in srgb, var(--branch-border, #1565c0) 60%, var(--text));
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

html[data-theme='dark'] .mindmap-intel-node:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

html[data-theme='dark'] .mindmap-intel-label {
  color: color-mix(in srgb, var(--branch-text, #1565c0) 55%, var(--text));
}

html[data-theme='dark'] .mindmap-influence-bar {
  background: rgba(255, 255, 255, 0.08);
}

html[data-theme='dark'] .mindmap-influence-fill {
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--branch-border, #1565c0) 70%, var(--text)),
    color-mix(in srgb, var(--branch-text, #003399) 60%, var(--text))
  );
}

html[data-theme='dark'] .mindmap-actor-toggle,
html[data-theme='dark'] .mindmap-connections-toggle,
html[data-theme='dark'] .mindmap-actor-network-toggle,
html[data-theme='dark'] .mindmap-stakeholder-toggle {
  color: var(--accent);
  background: var(--bg);
}

html[data-theme='dark'] .mindmap-stakeholder-desc {
  color: var(--text-secondary);
}

/* Stakeholder impact dark mode */
html[data-theme='dark'] .stakeholder-impact {
  background: var(--bg-card);
}

html[data-theme='dark'] .stakeholder-impact h2 {
  color: var(--text);
}

html[data-theme='dark'] .stakeholder-perspective-card {
  background: var(--bg-card);
  border-color: var(--border);
}

/* ─── Dark Mode + RTL Combined Overrides ────────────────────── */
@media (prefers-color-scheme: dark) {
  html:not([data-theme='light']) [dir='rtl'] .key-findings {
    border-left-color: #4a4400;
    border-right-color: var(--secondary);
  }

  html:not([data-theme='light']) [dir='rtl'] .data-card {
    border-left-color: var(--border);
    border-right-color: var(--accent);
  }

  html:not([data-theme='light']) [dir='rtl'] .news-card {
    border-left-color: var(--border);
    border-right-color: var(--primary);
  }
}

html[data-theme='dark'] [dir='rtl'] .key-findings {
  border-left-color: #4a4400;
  border-right-color: var(--secondary);
}
html[data-theme='dark'] [dir='rtl'] .data-card {
  border-left-color: var(--border);
  border-right-color: var(--accent);
}
html[data-theme='dark'] [dir='rtl'] .news-card {
  border-left-color: var(--border);
  border-right-color: var(--primary);
}

/* ─── Tablet Breakpoint (769px – 1024px) ────────────────────────── */
@media (min-width: 769px) and (max-width: 1024px) {
  .news-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .news-article {
    padding: 36px 32px;
  }

  .footer-content {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ─── Sitemap Pages ──────────────────────────────────────────────── */
/* Hero block rendered at the top of every sitemap.html / sitemap_<lang>.html */
.sitemap-hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  padding: 2.5rem 2rem;
  border-radius: var(--radius-lg);
  margin: 1.5rem 0 2rem;
  box-shadow: var(--shadow-md);
}

.sitemap-hero h1 {
  color: #fff;
  margin: 0 0 0.5rem;
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
}

.sitemap-hero__subtitle {
  margin: 0 0 1rem;
  font-size: 1.1rem;
  opacity: 0.92;
  font-weight: 500;
}

.sitemap-hero__intro {
  margin: 0 0 1.5rem;
  font-size: 1rem;
  line-height: 1.6;
  max-width: 70ch;
  opacity: 0.95;
}

/* Stats panel inside the hero */
.sitemap-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin: 0;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  backdrop-filter: blur(4px);
}

.sitemap-stats__item {
  margin: 0;
  text-align: center;
}

.sitemap-stats__item dt {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.85;
  margin-bottom: 0.25rem;
}

.sitemap-stats__item dd {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* Breadcrumb navigation */
.breadcrumb {
  margin: 0 0 1.5rem;
  font-size: 0.9rem;
}

.breadcrumb ol {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.5rem;
}

.breadcrumb li + li::before {
  content: '›';
  margin-right: 0.5rem;
  color: var(--text-muted);
}

[dir='rtl'] .breadcrumb li + li::before {
  content: '‹';
  margin-right: 0;
  margin-left: 0.5rem;
}

.breadcrumb [aria-current='page'] {
  color: var(--text-muted);
  font-weight: 500;
}

/* Responsive two-column grid for sitemap sections on wider viewports */
.sitemap-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 900px) {
  .sitemap-grid {
    grid-template-columns: minmax(280px, 1fr) minmax(0, 2fr);
    align-items: start;
  }
  .sitemap-section--news {
    grid-column: 1 / -1;
  }
}

.sitemap-section {
  margin: 2rem 0;
  background: var(--bg-card);
  padding: 1.5rem 1.75rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.sitemap-section h2 {
  font-size: 1.4rem;
  color: var(--primary);
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border-light);
}

.section-description {
  margin: 0 0 1.25rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.55;
}

/* Category sub-groups inside the News Articles section */
.sitemap-category {
  margin: 1.5rem 0;
  padding-top: 0.25rem;
}

.sitemap-category__heading {
  font-size: 1.1rem;
  color: var(--primary-dark);
  margin: 0 0 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px dashed var(--border-light);
}

.sitemap-category__count {
  background: var(--primary-light);
  color: var(--primary-dark);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
}

.sitemap-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sitemap-list li {
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border-light);
}

.sitemap-list li:last-child {
  border-bottom: none;
}

.sitemap-list a {
  font-weight: 500;
}

/* Inline description for page links (e.g. language-specific landing pages) */
.link-description {
  display: block;
  margin-top: 0.15rem;
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.5;
}

.sitemap-date {
  display: inline-block;
  margin-left: 0.75rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

.sitemap-desc {
  margin: 0.25rem 0 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
}

[dir='rtl'] .sitemap-date {
  margin-left: 0;
  margin-right: 0.75rem;
}

/* ─── Political Intelligence page (political-intelligence_*.html) ───── */

.pi-hero h1 {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.pi-card-grid {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
  display: grid;
  gap: 0.9rem;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.pi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease,
    border-color 0.15s ease;
}

.pi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
  border-color: var(--primary);
}

.pi-card__link {
  display: flex;
  gap: 0.85rem;
  padding: 0.95rem 1rem;
  text-decoration: none;
  color: inherit;
  height: 100%;
}

.pi-card__link:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
  border-radius: 10px;
}

.pi-card__icon {
  flex: 0 0 auto;
  font-size: 1.6rem;
  line-height: 1.2;
  width: 2.3rem;
  height: 2.3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-light);
  color: var(--primary-dark);
  border-radius: 8px;
}

.pi-card__body {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
  flex: 1 1 auto;
}

.pi-card__title {
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
}

.pi-card__path {
  font-size: 0.78rem;
  color: var(--text-muted);
  overflow-wrap: anywhere;
}

.pi-card__path code {
  background: transparent;
  padding: 0;
  font-size: inherit;
}

.pi-card__desc {
  margin: 0.15rem 0 0;
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.5;
}

.pi-card__cta {
  margin-top: 0.35rem;
  font-size: 0.82rem;
  color: var(--primary);
  font-weight: 600;
}

/* Date-grouped daily-analysis section */

.pi-date-group {
  margin: 1.2rem 0;
  padding: 0.9rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 10px;
}

.pi-date-group__heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6rem;
  margin: 0 0 0.6rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px dashed var(--border-light);
  font-variant-numeric: tabular-nums;
}

.pi-date-group__count {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--primary-dark);
  background: var(--primary-light);
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
}

.pi-run-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.5rem;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.pi-run__link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  background: var(--bg);
  transition:
    border-color 0.15s ease,
    background 0.15s ease;
}

.pi-run__link:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.pi-run__link:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
  border-radius: 8px;
}

.pi-run__icon {
  flex: 0 0 auto;
  font-size: 1.2rem;
  line-height: 1.2;
}

.pi-run__body {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1 1 auto;
}

.pi-run__slug {
  font-family: var(
    --font-mono,
    ui-monospace,
    SFMono-Regular,
    'SF Mono',
    Menlo,
    Consolas,
    monospace
  );
  font-size: 0.85rem;
  color: var(--text);
  overflow-wrap: anywhere;
}

.pi-run__meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.pi-run__cta {
  color: var(--primary);
  font-weight: 700;
}

/* Expandable per-artifact file list inside a daily run.
   The <details> is rendered OUTSIDE the run <a> so the disclosure triangle
   stays keyboard-focusable independently of the run-folder link. */
.pi-run__artifacts {
  margin-top: 0.35rem;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  background: var(--bg);
  font-size: 0.8rem;
}

.pi-run__artifacts-toggle {
  cursor: pointer;
  color: var(--primary);
  font-weight: 600;
  list-style: revert;
  padding: 0.15rem 0;
}

.pi-run__artifacts-toggle:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
  border-radius: 4px;
}

.pi-run__artifacts[open] .pi-run__artifacts-toggle {
  margin-bottom: 0.35rem;
}

.pi-run__artifacts-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.6rem;
}

.pi-run__artifacts-list li {
  overflow-wrap: anywhere;
}

/* Run-card title + description + run-id badge — mirrors .pi-card quality
   so daily runs read as rich cards, not bare filename links. */
.pi-run__title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.45rem;
  font-weight: 600;
  color: var(--primary);
  font-size: 1rem;
  line-height: 1.3;
}

.pi-run__runid {
  display: inline-block;
  padding: 0.05rem 0.4rem;
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace);
  font-size: 0.72rem;
  color: var(--text-secondary);
  background: var(--bg-card-alt, var(--bg-card));
  border: 1px solid var(--border-light);
  border-radius: 999px;
  letter-spacing: 0.02em;
}

.pi-run__desc {
  display: block;
  margin-top: 0.25rem;
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.45;
}

.pi-run__slug code {
  background: transparent;
  padding: 0;
  font-size: inherit;
  color: var(--text-muted);
}

/* ── Per-artifact card inside an expanded run ─────────────────── */
.pi-artifact {
  margin: 0;
}

.pi-artifact__link {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.65rem 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  color: inherit;
  text-decoration: none;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.15s ease;
}

.pi-artifact__link:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
  transform: translateY(-1px);
  text-decoration: none;
  color: inherit;
}

.pi-artifact__link:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
  text-decoration: none;
}

.pi-artifact__icon {
  flex: 0 0 auto;
  font-size: 1.3rem;
  line-height: 1;
  width: 1.6rem;
  text-align: center;
  margin-top: 0.1rem;
}

.pi-artifact__body {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
  flex: 1 1 auto;
}

.pi-artifact__title {
  font-weight: 600;
  color: var(--primary);
  font-size: 0.95rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.pi-artifact__desc {
  margin: 0.1rem 0 0.2rem;
  color: var(--text-secondary);
  font-size: 0.82rem;
  line-height: 1.45;
}

.pi-artifact__path {
  font-size: 0.72rem;
  color: var(--text-muted);
  overflow-wrap: anywhere;
}

.pi-artifact__path code {
  background: transparent;
  padding: 0;
  font-size: inherit;
}

.pi-artifact__cta {
  color: var(--primary);
  font-size: 1rem;
  flex: 0 0 auto;
  margin-top: 0.1rem;
}

/* Legacy <a> fallback inside the list (kept so existing code-only links
   continue to render readably if any slip through). */
.pi-run__artifacts-list > li > a:not(.pi-artifact__link) {
  color: inherit;
  text-decoration: none;
}

.pi-run__artifacts-list > li > a:not(.pi-artifact__link):hover,
.pi-run__artifacts-list > li > a:not(.pi-artifact__link):focus-visible {
  text-decoration: underline;
  color: var(--primary);
}

.pi-run__artifacts-list code {
  background: transparent;
  padding: 0;
  font-size: inherit;
}

/* Localized "source materials are in English" notice shown on non-English
   political-intelligence pages just above the methodology sections. */
.pi-source-note {
  margin: 0.6rem auto 1rem;
  padding: 0.7rem 1rem;
  max-width: 960px;
  border: 1px dashed var(--border-light);
  border-inline-start: 3px solid var(--primary);
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
}

/* RTL flip: icon sits on the right, CTA arrow on the left */
[dir='rtl'] .pi-card__link,
[dir='rtl'] .pi-run__link,
[dir='rtl'] .pi-artifact__link {
  flex-direction: row-reverse;
}

/* ─── High Contrast Mode (prefers-contrast: more) ───────────────── */
@media (prefers-contrast: more) {
  :root {
    --primary: #001a66;
    --secondary: #ffd633;
    --secondary-dark: #996600;
    --text: #000000;
    --text-secondary: #111111;
    --text-muted: #333333;
    --bg: #ffffff;
    --bg-card: #ffffff;
    --border: #000000;
    --border-light: #333333;
    --accent: #0044aa;
    --focus-ring: #000000;
  }

  a:focus-visible,
  button:focus-visible {
    outline-width: 4px;
    outline-color: var(--focus-ring);
  }

  /* Two-tone focus indicator for primary-background controls: dark outline
   * + white inner shadow. Contrasts against both dark button and light page
   * background, meeting WCAG 2.2 SC 2.4.11 in high-contrast light mode. */
  .back-to-news:focus-visible,
  .lang-link.active:focus-visible,
  .lang-link:hover:focus-visible,
  .skip-link:focus-visible {
    outline-color: var(--focus-ring);
    outline-width: 3px;
    outline-offset: 3px;
    box-shadow:
      0 0 0 1px #ffffff,
      0 0 0 4px var(--focus-ring);
  }

  .group-badge {
    outline: 2px solid var(--border);
  }

  /* Reset .key-findings to use tokenized colors so the 1px border has
   * sufficient contrast against --bg (#ffffff). --secondary-dark (#996600)
   * gives ~4.5:1 on white (passes WCAG AA), but --border (#000000) at 21:1
   * is used here for maximum contrast in the high-contrast theme. */
  .key-findings {
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-left: 5px solid var(--secondary);
  }

  .key-findings__title {
    color: var(--text);
  }

  .key-findings__list li::before {
    color: var(--text);
  }
}

/* ─── High Contrast Dark Mode Combined Override ──────────────────── */
/* Defines a coherent high-contrast dark palette when both dark mode and
 * high contrast are active. Uses near-black backgrounds with pure-white
 * text and vivid accents so every component meets WCAG 2.1 AA (≥4.5:1).
 * Overrides tokens set by prefers-contrast: more (which forces --bg to
 * #ffffff) and component overrides with hardcoded dark hex backgrounds.
 */
@media (prefers-color-scheme: dark) and (prefers-contrast: more) {
  :root {
    --bg: #000000;
    --bg-card: #0d0d0d;
    --text: #ffffff;
    --text-secondary: #eeeeee;
    --text-muted: #cccccc;
    --border: #ffffff;
    --border-light: #aaaaaa;
    --primary: #0055cc;
    --primary-dark: #003399;
    --primary-light: #001a33;
    --accent: #80d4ff;
    --accent-light: #001f33;
    --secondary: #ffe066;
    --on-secondary: #000000;
    --focus-ring: #ffffff;
  }

  /* Reset hardcoded dark backgrounds to use tokens */
  .key-findings {
    background: var(--bg-card);
    border-color: var(--border);
    border-left-color: var(--secondary);
  }

  .key-findings__title {
    color: var(--secondary);
  }

  .pull-quote {
    background: var(--bg-card);
  }

  /* Use token-based borders; overrides hardcoded #444466 from dark-mode override */
  .data-card {
    border-color: var(--border);
    border-left-color: var(--accent);
  }

  /* RTL override: ensure token-based borders also win over dark-mode RTL
   * hardcoded #444466 in combined dark + high-contrast mode. Accent appears
   * on the inline-start edge (right in RTL). */
  [dir='rtl'] .data-card {
    border-color: var(--border);
    border-right-color: var(--accent);
    border-left-color: var(--border);
  }

  /* Badge text: use on-secondary (dark) to maintain contrast on light badge
   * backgrounds (e.g. yellow RE badge) in high-contrast dark mode */
  .group-badge {
    color: var(--on-secondary);
  }

  /* Brand hover: dark-mode override uses var(--bg) which becomes #000000 here
   * (dark on dark-blue #0055cc header — low contrast). Use var(--text)
   * (#ffffff) instead: 6.65:1 on #0055cc, meeting WCAG 2.1 AA. */
  .site-header__brand:hover {
    color: var(--text);
  }

  /* Two-tone focus indicator for primary-background controls in combined dark
   * + high-contrast mode. --focus-ring is #ffffff here, so the standard
   * prefers-contrast: more rule (both shadows become #ffffff) lacks contrast
   * against the dark-blue --primary (#0055cc) button background.
   * Override: dark inner ring + white outer ring (6.65:1 on #0055cc, 21:1 on
   * near-black --bg #000000), meeting WCAG 2.2 SC 2.4.11. */
  .back-to-news:focus-visible,
  .lang-link.active:focus-visible,
  .lang-link:hover:focus-visible,
  .skip-link:focus-visible {
    outline-color: #000000;
    outline-width: 3px;
    outline-offset: 3px;
    box-shadow:
      0 0 0 1px #000000,
      0 0 0 4px #ffffff;
  }
}

/* ─── Deep Political Analysis Section ────────────────────────────── */
.deep-analysis {
  margin: 2rem 0;
  padding: 1.5rem 2rem;
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--bg-card) 100%);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.deep-analysis h2 {
  color: var(--primary-dark);
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--primary);
}

.deep-analysis h3 {
  color: var(--primary);
  font-size: 1.15rem;
  margin: 1.25rem 0 0.5rem;
}

.deep-analysis p {
  line-height: 1.75;
  color: var(--text);
  margin-bottom: 0.75rem;
}

/* 5W Sub-sections */
.analysis-what,
.analysis-who,
.analysis-when,
.analysis-why,
.analysis-outlook {
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
}

.actor-list,
.timeline-list {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0;
}

.actor-list li {
  padding: 0.35rem 0.5rem;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.95rem;
}

.actor-list li:last-child {
  border-bottom: none;
}

.timeline-list {
  list-style: decimal inside;
}

.timeline-list li {
  padding: 0.35rem 0;
  font-size: 0.95rem;
  color: var(--text-secondary);
}

/* Stakeholder Winners / Losers / Neutral */
.analysis-stakeholders {
  margin-bottom: 1rem;
}

.stakeholder-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.35rem;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
}

.outcome-badge {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.stakeholder-winner {
  background: #e6f9ed;
  border: 1px solid var(--success);
}

.stakeholder-winner .stakeholder-badge {
  background: var(--success);
  color: #fff;
}

.stakeholder-loser {
  background: #fde8ea;
  border: 1px solid var(--danger);
}

.stakeholder-loser .stakeholder-badge {
  background: var(--danger);
  color: #fff;
}

.stakeholder-neutral {
  background: #fff8e1;
  border: 1px solid var(--warning);
}

.stakeholder-neutral .stakeholder-badge {
  background: var(--warning);
  color: var(--on-secondary);
}

.stakeholder-actor {
  font-weight: 600;
  min-width: 120px;
}

.stakeholder-reason {
  flex: 1;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* Multi-perspective Impact Grid */
.impact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem;
  margin: 0.75rem 0;
}

.impact-card {
  padding: 0.75rem 1rem;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
}

.impact-card h4 {
  color: var(--primary);
  font-size: 0.9rem;
  margin: 0 0 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.impact-card p {
  font-size: 0.9rem;
  line-height: 1.6;
  margin: 0;
}

/* Action → Consequences Table */
.consequences-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.75rem 0;
  font-size: 0.9rem;
}

.consequences-table th {
  background: var(--primary);
  color: #fff;
  padding: 0.6rem 0.75rem;
  text-align: left;
  font-weight: 600;
}

.consequences-table td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border-light);
  vertical-align: top;
}

.consequences-table tr:nth-child(even) {
  background: var(--primary-light);
}

/* Severity badges */
.severity-badge {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.severity-low {
  background: #e8f5e9;
  color: #2e7d32;
}

.severity-medium {
  background: #fff3e0;
  color: #e65100;
}

.severity-high {
  background: #fce4ec;
  color: #c62828;
}

.severity-critical {
  background: #880e4f;
  color: #fff;
}

/* Political Mistakes */
.mistake-card {
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
  background: #fff8f8;
  border-left: 3px solid var(--danger);
  border-radius: var(--radius-sm);
}

.mistake-actor {
  font-weight: 600;
  color: var(--danger);
  margin-bottom: 0.25rem;
}

.mistake-description {
  margin-bottom: 0.25rem;
  font-size: 0.95rem;
}

.mistake-alternative {
  font-style: italic;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ─── Enhanced Deep Analysis: Confidence Badges ─────────────────────────── */

.confidence-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.65rem;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.confidence-high {
  background: #e6f9ed;
  color: #157a3b;
  border: 1px solid var(--success, #28a745);
}

.confidence-medium {
  background: #fff8e1;
  color: #8a6d00;
  border: 1px solid #ffc107;
}

.confidence-low {
  background: #fde8e8;
  color: #b71c1c;
  border: 1px solid var(--danger, #dc3545);
}

/* ─── Enhanced Deep Analysis: Executive Summary ─────────────────────────── */

.analysis-executive-summary {
  margin-bottom: 1.25rem;
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, #eef2ff, var(--bg-card, #fff));
  border-radius: var(--radius-sm, 6px);
  border-left: 4px solid var(--primary, #003399);
}

.analysis-executive-summary .summary-header {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.analysis-executive-summary .summary-header p {
  flex: 1;
  min-width: 200px;
}

/* ─── Enhanced Deep Analysis: Reasoning Chains ──────────────────────────── */

.analysis-reasoning-chains {
  margin-bottom: 1.25rem;
}

.reasoning-chain-card {
  margin-bottom: 1rem;
  padding: 1rem 1.25rem;
  background: var(--bg-card, #fff);
  border-radius: var(--radius-sm, 6px);
  border: 1px solid var(--border-light, #dee2e6);
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.04));
}

.reasoning-chain-card .chain-conclusion {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-light, #dee2e6);
  font-weight: 500;
}

.evidence-refs-block,
.counter-args-block {
  margin: 0.5rem 0;
  padding: 0.5rem 0.75rem;
  background: #f8f9fa;
  border-radius: var(--radius-sm, 6px);
}

.evidence-refs-block h4,
.counter-args-block h4 {
  font-size: 0.85rem;
  color: var(--text-secondary, #6c757d);
  margin: 0 0 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.evidence-refs,
.counter-arguments {
  list-style: none;
  padding: 0;
  margin: 0;
}

.evidence-refs li,
.counter-arguments li {
  padding: 0.25rem 0;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border-light, #dee2e6);
}

.evidence-refs li:last-child,
.counter-arguments li:last-child {
  border-bottom: none;
}

.evidence-refs a {
  color: var(--primary, #003399);
  text-decoration: none;
}

.evidence-refs a:hover {
  text-decoration: underline;
}

/* ─── Enhanced Deep Analysis: Scenario Planning ─────────────────────────── */

.analysis-scenario-planning {
  margin-bottom: 1.25rem;
}

.scenario-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  margin-top: 0.75rem;
}

.scenario-card {
  padding: 1rem;
  border-radius: var(--radius-sm, 6px);
  border: 1px solid var(--border-light, #dee2e6);
  background: var(--bg-card, #fff);
}

.scenario-best {
  border-left: 4px solid var(--success, #28a745);
}

.scenario-likely {
  border-left: 4px solid #ffc107;
}

.scenario-worst {
  border-left: 4px solid var(--danger, #dc3545);
}

.scenario-probability {
  margin: 0.5rem 0;
  font-size: 0.85rem;
  color: var(--text-secondary, #6c757d);
}

.probability-bar {
  height: 6px;
  border-radius: 3px;
  background: var(--primary, #003399);
  margin-top: 0.25rem;
  transition: width 0.3s ease;
}

.scenario-best .probability-bar {
  background: var(--success, #28a745);
}

.scenario-likely .probability-bar {
  background: #ffc107;
}

.scenario-worst .probability-bar {
  background: var(--danger, #dc3545);
}

.scenario-triggers,
.scenario-impacts {
  margin-top: 0.5rem;
  font-size: 0.9rem;
}

.scenario-triggers summary,
.scenario-impacts summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-secondary, #6c757d);
}

.scenario-impact-list {
  list-style: none;
  padding: 0;
}

.scenario-impact {
  padding: 0.25rem 0;
  font-size: 0.9rem;
}

.scenario-severity-critical {
  color: #b71c1c;
}

.scenario-severity-high {
  color: var(--danger, #dc3545);
}

.scenario-severity-medium {
  color: #8a6d00;
}

.scenario-severity-low {
  color: var(--text-secondary, #6c757d);
}

.scenario-timeline {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-secondary, #6c757d);
}

.scenario-wildcards {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  background: #fff8e1;
  border-radius: var(--radius-sm, 6px);
  border: 1px dashed #ffc107;
}

.wildcard-list {
  list-style: disc inside;
  margin: 0.35rem 0 0;
  padding: 0;
  font-size: 0.9rem;
}

/* ─── Enhanced Deep Analysis: Methodology ───────────────────────────────── */

.analysis-methodology {
  margin-bottom: 1.25rem;
  padding: 1rem 1.25rem;
  background: #f8f9fa;
  border-radius: var(--radius-sm, 6px);
  border: 1px solid var(--border-light, #dee2e6);
}

.methodology-stats {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.35rem 1rem;
  margin: 0.5rem 0 1rem;
  font-size: 0.9rem;
}

.methodology-stats dt {
  font-weight: 600;
  color: var(--text-secondary, #6c757d);
}

.methodology-stats dd {
  margin: 0;
}

.iteration-timeline {
  margin-top: 0.75rem;
}

.iteration-item {
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.5rem;
  background: var(--bg-card, #fff);
  border-radius: var(--radius-sm, 6px);
  border-left: 3px solid var(--primary, #003399);
  font-size: 0.9rem;
}

.iteration-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.25rem;
}

.iteration-pass {
  font-weight: 700;
  color: var(--primary, #003399);
}

.iteration-type {
  color: var(--text-secondary, #6c757d);
  font-size: 0.85rem;
}

.iteration-findings,
.iteration-refinements {
  list-style: disc inside;
  margin: 0.25rem 0 0;
  padding: 0;
  font-size: 0.85rem;
  color: var(--text-secondary, #6c757d);
}

/* Responsive: stack impact grid on small screens */
@media (max-width: 600px) {
  .deep-analysis {
    padding: 1rem;
  }

  .impact-grid {
    grid-template-columns: 1fr;
  }

  .stakeholder-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .consequences-table {
    font-size: 0.8rem;
  }

  .scenario-grid {
    grid-template-columns: 1fr;
  }

  .methodology-stats {
    grid-template-columns: 1fr;
  }
}

/* ─── SWOT Analysis ──────────────────────────────────────────────────────── */

.swot-analysis {
  margin: 2rem 0;
  padding: 1.5rem;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.swot-analysis h2 {
  font-size: 1.4rem;
  margin-bottom: 1rem;
  color: var(--text-primary, #1a1a2e);
  letter-spacing: 0.02em;
}

.swot-matrix {
  position: relative;
}

.swot-axis-labels {
  display: flex;
  justify-content: space-around;
  margin-bottom: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted, #6c757d);
}

.swot-grid {
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: 2px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.swot-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
}

.swot-quadrant {
  padding: 1.25rem;
  min-height: 130px;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
}

.swot-quadrant::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.swot-quadrant:hover {
  transform: scale(1.01);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  z-index: 1;
}

.swot-quadrant-heading {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0 0 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.swot-quadrant-heading::before {
  display: inline-block;
  font-size: 1rem;
}

.swot-quadrant-desc {
  font-size: 0.7rem;
  color: var(--text-muted, #6c757d);
  margin: 0 0 0.75rem;
  font-style: italic;
}

.swot-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.swot-item {
  padding: 0.4rem 0.5rem;
  font-size: 0.85rem;
  line-height: 1.4;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  border-radius: 4px;
  transition: background 0.15s ease;
}

.swot-item:hover {
  background: rgba(255, 255, 255, 0.6);
}

.swot-item:last-child {
  border-bottom: none;
}

.swot-empty {
  color: var(--text-muted, #6c757d);
  font-style: italic;
}

.swot-severity-badge {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
  margin-left: 0.35rem;
  vertical-align: middle;
}

/* Quadrant colors — gradient backgrounds for a modern look */
.swot-strengths {
  background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
}

.swot-strengths .swot-quadrant-heading {
  color: #1b5e20;
}

.swot-strengths .swot-quadrant-heading::before {
  content: '✦';
  color: #2e7d32;
}

.swot-weaknesses {
  background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
}

.swot-weaknesses .swot-quadrant-heading {
  color: #b71c1c;
}

.swot-weaknesses .swot-quadrant-heading::before {
  content: '▼';
  color: #c62828;
}

.swot-opportunities {
  background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
}

.swot-opportunities .swot-quadrant-heading {
  color: #0d47a1;
}

.swot-opportunities .swot-quadrant-heading::before {
  content: '◆';
  color: #1565c0;
}

.swot-threats {
  background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
}

.swot-threats .swot-quadrant-heading {
  color: #bf360c;
}

.swot-threats .swot-quadrant-heading::before {
  content: '▲';
  color: #e65100;
}

/* Severity levels — pill badges */
.swot-severity-low .swot-severity-badge {
  background: linear-gradient(135deg, #c8e6c9, #a5d6a7);
  color: #1b5e20;
}

.swot-severity-medium .swot-severity-badge {
  background: linear-gradient(135deg, #fff9c4, #fff176);
  color: #f57f17;
}

.swot-severity-high .swot-severity-badge {
  background: linear-gradient(135deg, #ffcdd2, #ef9a9a);
  color: #b71c1c;
}

/* ─── Multi-Dimensional SWOT Extensions ──────────────────────────────────── */

.swot-multidimensional {
  /* Outer wrapper shares .swot-analysis styles; adds extra spacing below */
  padding-bottom: 2rem;
}

.swot-mini-grid {
  /* Compact grid used inside dimension / stakeholder / temporal panels */
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  margin-top: 0.5rem;
}

.swot-section-subheading {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 1.5rem 0 0.75rem;
  color: var(--text-primary, #1a1a2e);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  border-bottom: 2px solid rgba(0, 51, 153, 0.15);
  padding-bottom: 0.3rem;
}

/* ── Dimension drill-downs ─────────────────────────────────────────────── */

.swot-dimensions {
  margin-top: 1.5rem;
}

.swot-dimension {
  margin-bottom: 0.5rem;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: var(--surface-alt, #ffffff);
}

.swot-dimension-summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  background: rgba(0, 51, 153, 0.04);
  list-style: none;
  transition: background 0.15s ease;
}

.swot-dimension-summary::-webkit-details-marker {
  display: none;
}

.swot-dimension-summary::before {
  content: '▶';
  font-size: 0.65rem;
  color: var(--text-muted, #6c757d);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.swot-dimension[open] .swot-dimension-summary::before {
  transform: rotate(90deg);
}

.swot-dimension-summary:hover {
  background: rgba(0, 51, 153, 0.08);
}

.swot-dimension-content {
  padding: 0.75rem;
}

/* Dimension color accents */
.swot-dimension-political .swot-dimension-summary {
  border-left: 3px solid #003399;
}
.swot-dimension-economic .swot-dimension-summary {
  border-left: 3px solid #ffd700;
}
.swot-dimension-social .swot-dimension-summary {
  border-left: 3px solid #2e7d32;
}
.swot-dimension-legal .swot-dimension-summary {
  border-left: 3px solid #7b1fa2;
}
.swot-dimension-geopolitical .swot-dimension-summary {
  border-left: 3px solid #c62828;
}

/* ── Stakeholder perspectives ──────────────────────────────────────────── */

.swot-stakeholders {
  margin-top: 1.5rem;
}

.swot-stakeholder {
  margin-bottom: 0.5rem;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: var(--surface-alt, #ffffff);
}

.swot-stakeholder-summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.025);
  list-style: none;
  transition: background 0.15s ease;
}

.swot-stakeholder-summary::-webkit-details-marker {
  display: none;
}

.swot-stakeholder-summary::before {
  content: '▶';
  font-size: 0.65rem;
  color: var(--text-muted, #6c757d);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.swot-stakeholder[open] .swot-stakeholder-summary::before {
  transform: rotate(90deg);
}

.swot-stakeholder-summary:hover {
  background: rgba(0, 0, 0, 0.05);
}

.swot-stakeholder-content {
  padding: 0.75rem;
}

/* ── Temporal analysis ─────────────────────────────────────────────────── */

.swot-temporal {
  margin-top: 1.5rem;
}

.swot-temporal-period {
  margin-bottom: 0.5rem;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: var(--surface-alt, #ffffff);
}

.swot-temporal-summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  background: rgba(46, 125, 50, 0.05);
  list-style: none;
  transition: background 0.15s ease;
}

.swot-temporal-summary::-webkit-details-marker {
  display: none;
}

.swot-temporal-summary::before {
  content: '▶';
  font-size: 0.65rem;
  color: var(--text-muted, #6c757d);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.swot-temporal-period[open] .swot-temporal-summary::before {
  transform: rotate(90deg);
}

.swot-temporal-summary:hover {
  background: rgba(46, 125, 50, 0.1);
}

.swot-temporal-content {
  padding: 0.75rem;
}

/* ── Cross-references ──────────────────────────────────────────────────── */

.swot-cross-references {
  margin-top: 1.5rem;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.02);
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.04);
}

.swot-ref-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.swot-ref-item {
  padding: 0.5rem 0;
  font-size: 0.82rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  line-height: 1.5;
}

.swot-ref-item:last-child {
  border-bottom: none;
}

.swot-ref-evidence {
  font-weight: 500;
  color: var(--text-primary, #1a1a2e);
}

.swot-ref-link {
  color: #003399;
  text-decoration: none;
  font-family: monospace;
  font-size: 0.8rem;
}

.swot-ref-link:hover {
  text-decoration: underline;
}

.swot-ref-id {
  font-family: monospace;
  font-size: 0.8rem;
  color: var(--text-muted, #6c757d);
}

.swot-ref-title {
  color: var(--text-secondary, #495057);
  font-style: italic;
}

/* ── Responsive — stack quadrants on small screens ─────────────────────── */

@media (max-width: 600px) {
  .swot-mini-grid .swot-row {
    grid-template-columns: 1fr;
  }

  .swot-dimension-summary,
  .swot-stakeholder-summary,
  .swot-temporal-summary {
    font-size: 0.85rem;
  }
}

/* ─── Dashboard ──────────────────────────────────────────────────────────── */

.dashboard {
  margin: 2rem 0;
  padding: 1.5rem;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.dashboard h2 {
  font-size: 1.4rem;
  margin-bottom: 1.25rem;
  color: var(--text-primary, #1a1a2e);
  letter-spacing: 0.02em;
}

.dashboard-grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.dashboard-panel {
  background: var(--surface-alt, #ffffff);
  border-radius: 10px;
  padding: 1.25rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(0, 0, 0, 0.04);
  transition:
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.dashboard-panel:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}

.panel-title {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0 0 1rem;
  color: var(--text-primary, #1a1a2e);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.panel-title::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 1.1em;
  background: linear-gradient(180deg, #003399, #ffd700);
  border-radius: 2px;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.metric-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.85rem;
  background: linear-gradient(145deg, #ffffff, #f0f2f5);
  border-radius: 10px;
  text-align: center;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.metric-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 51, 153, 0.1);
}

.metric-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted, #6c757d);
  margin-bottom: 0.35rem;
}

.metric-value {
  font-size: 1.6rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--metric-gradient-start), var(--metric-gradient-end));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.2;
}

.metric-unit {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-muted, #6c757d);
}

.metric-trend-up {
  font-size: 0.8rem;
  font-weight: 700;
  color: #2e7d32;
}

.metric-trend-up::before {
  content: '▲ ';
  font-size: 0.65rem;
}

.metric-trend-down {
  font-size: 0.8rem;
  font-weight: 700;
  color: #c62828;
}

.metric-trend-down::before {
  content: '▼ ';
  font-size: 0.65rem;
}

.metric-trend-stable {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted, #6c757d);
}

.metric-trend-stable::before {
  content: '● ';
  font-size: 0.5rem;
}

/* ─── Pipeline / Coalition / Trend status classes ─────────────────── */

/* Panel accent borders */
.pipeline-panel {
  border-left: 4px solid #003399;
}
.coalition-panel {
  border-left: 4px solid #2a9d8f;
}
.trend-panel {
  border-left: 4px solid #6a4c93;
}

/* Pipeline health indicator bar */
.pipeline-health-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.5rem 0 0.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  background: rgba(0, 51, 153, 0.05);
  font-size: 0.85rem;
}
.pipeline-health-indicator.pipeline-healthy {
  background: rgba(40, 167, 69, 0.08);
  border-left: 3px solid #28a745;
}
.pipeline-health-indicator.pipeline-moderate {
  background: rgba(255, 193, 7, 0.12);
  border-left: 3px solid #ffc107;
}
.pipeline-health-indicator.pipeline-critical {
  background: rgba(220, 53, 69, 0.08);
  border-left: 3px solid #dc3545;
}

/* Pipeline status metric cards */
.pipeline-on-track {
  --metric-gradient-start: #28a745;
  --metric-gradient-end: #20c997;
}
.pipeline-delayed {
  --metric-gradient-start: #e6a817;
  --metric-gradient-end: #ffc107;
}
.pipeline-blocked {
  --metric-gradient-start: #dc3545;
  --metric-gradient-end: #e63946;
}
.pipeline-fast-tracked {
  --metric-gradient-start: #007bff;
  --metric-gradient-end: #4a90e2;
}

/* Coalition / trend cards */
.coalition-shift {
  --metric-gradient-start: #2a9d8f;
  --metric-gradient-end: #264653;
}
.trend-direction {
  --metric-gradient-start: #6a4c93;
  --metric-gradient-end: #457b9d;
}

/* Fallback list for pipeline noscript */
.pipeline-fallback-list {
  list-style: none;
  padding: 0.5rem 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-secondary, #495057);
}
.pipeline-fallback-list li {
  background: var(--surface-muted, #f8f9fa);
  border-radius: 4px;
  padding: 0.3rem 0.6rem;
  border: 1px solid var(--border-light, #dee2e6);
}

/* Dark-mode overrides */
html[data-theme='dark'] .pipeline-panel,
html[data-theme='dark'] .pipeline-health-indicator.pipeline-healthy,
html[data-theme='dark'] .pipeline-health-indicator.pipeline-moderate,
html[data-theme='dark'] .pipeline-health-indicator.pipeline-critical {
  border-left-color: inherit;
}
html[data-theme='dark'] .pipeline-health-indicator {
  background: rgba(255, 255, 255, 0.04);
}
html[data-theme='dark'] .pipeline-health-indicator.pipeline-healthy {
  background: rgba(40, 167, 69, 0.12);
}
html[data-theme='dark'] .pipeline-health-indicator.pipeline-moderate {
  background: rgba(255, 193, 7, 0.12);
}
html[data-theme='dark'] .pipeline-health-indicator.pipeline-critical {
  background: rgba(220, 53, 69, 0.12);
}
html[data-theme='dark'] .pipeline-fallback-list li {
  background: var(--bg-card);
  border-color: var(--border);
}

.chart-container {
  position: relative;
  margin-top: 0.75rem;
  padding: 0.75rem;
  background: var(--surface-alt, #ffffff);
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.04);
}

.chart-title {
  font-size: 0.9rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
  color: var(--text-secondary, #495057);
}

.dashboard-chart {
  max-width: 100%;
  height: auto;
  min-height: clamp(160px, 25vw, 260px);
}

.chart-fallback-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.8rem;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border-light, #dee2e6);
}

.chart-fallback-table th,
.chart-fallback-table td {
  padding: 0.5rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border-light, #dee2e6);
}

.chart-fallback-table thead th {
  background: linear-gradient(135deg, #f0f2f5, #e9ecef);
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary, #495057);
}

.chart-fallback-table tbody tr:hover {
  background: var(--chart-row-hover);
}

.chart-no-data {
  font-style: italic;
  color: var(--text-muted, #6c757d);
  text-align: center;
  padding: 2rem 1rem;
}

/* Responsive: stack SWOT quadrants on small screens */
@media (max-width: 600px) {
  .swot-row {
    grid-template-columns: 1fr;
  }

  .swot-axis-labels {
    display: none;
  }

  .metrics-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* ===================================================================
   Mindmap Section
   CSS-only mindmap with central topic node and colored branches.
   =================================================================== */

.mindmap-section {
  margin: 2rem 0;
  padding: 1.5rem;
  background: linear-gradient(160deg, #f0f4ff 0%, #e8eaf6 50%, #f3e5f5 100%);
  border: 2px solid var(--primary, #1565c0);
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(21, 101, 192, 0.1);
}

.mindmap-section h2 {
  font-size: 1.4rem;
  color: var(--primary, #1565c0);
  border-bottom: 2px solid var(--primary, #1565c0);
  padding-bottom: 0.75rem;
  margin: 0 0 1rem 0;
  letter-spacing: 0.02em;
}

.mindmap-summary {
  color: var(--text-muted, #6c757d);
  font-size: 0.95rem;
  margin: 0 0 1.5rem 0;
}

.mindmap-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.mindmap-center {
  background: linear-gradient(135deg, #003399, #1565c0);
  border: 3px solid #003399;
  border-radius: 16px;
  padding: 1rem 2rem;
  color: #ffffff;
  font-weight: 700;
  font-size: clamp(0.95rem, 0.85rem + 0.5vw, 1.15rem);
  text-align: center;
  box-shadow: 0 4px 16px rgba(0, 51, 153, 0.25);
  max-width: 280px;
  position: relative;
}

.mindmap-center::after {
  content: '';
  position: absolute;
  bottom: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 12px;
  background: var(--primary, #1565c0);
}

.mindmap-branches {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  width: 100%;
  list-style: none;
  margin: 0;
  padding: 0;
}

.mindmap-branch {
  background: var(--branch-bg, #e3f2fd);
  border: 2px solid var(--branch-border, #1565c0);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  min-width: 180px;
  max-width: 240px;
  flex: 1 1 180px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
  position: relative;
}

.mindmap-branch:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.mindmap-branch::before {
  content: '';
  position: absolute;
  top: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 0;
}

.mindmap-branch-label {
  color: var(--branch-text, #1565c0);
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--branch-border, #1565c0);
}

.mindmap-leaf-list {
  list-style: none;
  margin: 0;
  padding-left: 0;
  color: var(--text-secondary, #495057);
  font-size: 0.82rem;
  line-height: 1.5;
}

.mindmap-leaf-list li {
  margin-bottom: 0.2rem;
  padding-left: 1rem;
  position: relative;
}

.mindmap-leaf-list li::before {
  content: '›';
  position: absolute;
  left: 0;
  color: var(--branch-border, #1565c0);
  font-weight: 700;
}

@media (min-width: 768px) {
  .mindmap-container {
    flex-direction: row;
    align-items: flex-start;
  }

  .mindmap-center {
    flex: 0 0 auto;
    align-self: center;
  }

  .mindmap-center::after {
    display: none;
  }

  .mindmap-branches {
    width: auto;
    flex: 1;
  }
}

[dir='rtl'] .mindmap-section {
  direction: rtl;
  text-align: right;
}

[dir='rtl'] .mindmap-leaf-list li {
  padding-left: 0;
  padding-right: 1rem;
}

[dir='rtl'] .mindmap-leaf-list li::before {
  left: auto;
  right: 0;
}

/* ===================================================================
   Intelligence Mindmap — Multi-layer policy domain intelligence map
   with influence weighting and actor-network overlays.
   =================================================================== */

.intelligence-mindmap {
  background: linear-gradient(160deg, #f0f4ff 0%, #e8eaf6 40%, #f3e5f5 100%);
}

.intelligence-map {
  position: relative;
}

.mindmap-branches > li {
  flex: 1 1 160px;
  min-width: 160px;
  max-width: 260px;
}

.mindmap-intel-node {
  background: var(--branch-bg, #e3f2fd);
  border: 2px solid var(--branch-border, #1565c0);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
  transform: scale(calc(0.85 + var(--node-influence, 0.5) * 0.15));
}

.mindmap-intel-node:hover {
  transform: scale(calc(0.9 + var(--node-influence, 0.5) * 0.15));
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.mindmap-intel-label {
  color: var(--branch-text, #1565c0);
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
}

.mindmap-influence-bar {
  height: 6px;
  background: rgba(0, 0, 0, 0.08);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 0.3rem;
}

.mindmap-influence-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--branch-border, #1565c0), var(--branch-text, #003399));
  border-radius: 3px;
  transition: width 0.3s ease;
}

.mindmap-subnodes {
  list-style: none;
  padding: 0.5rem 0 0 0.75rem;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.mindmap-actor-overlay,
.mindmap-connections-overlay,
.mindmap-actor-network-overlay,
.mindmap-stakeholder-overlay {
  margin-top: 0.75rem;
  border: 1px solid var(--border-light, #dee2e6);
  border-radius: 8px;
  overflow: hidden;
}

.mindmap-actor-toggle,
.mindmap-connections-toggle,
.mindmap-actor-network-toggle,
.mindmap-stakeholder-toggle {
  cursor: pointer;
  padding: 0.5rem 0.75rem;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--primary, #1565c0);
  background: var(--surface-alt, #f8f9fa);
  list-style: none;
}

.mindmap-actor-toggle::-webkit-details-marker,
.mindmap-connections-toggle::-webkit-details-marker,
.mindmap-actor-network-toggle::-webkit-details-marker,
.mindmap-stakeholder-toggle::-webkit-details-marker {
  display: none;
}

.mindmap-actor-toggle::marker,
.mindmap-connections-toggle::marker,
.mindmap-actor-network-toggle::marker,
.mindmap-stakeholder-toggle::marker {
  content: '';
}

.mindmap-actor-toggle::before,
.mindmap-connections-toggle::before,
.mindmap-actor-network-toggle::before,
.mindmap-stakeholder-toggle::before {
  content: '▸ ';
}

details[open] > .mindmap-actor-toggle::before,
details[open] > .mindmap-connections-toggle::before,
details[open] > .mindmap-actor-network-toggle::before,
details[open] > .mindmap-stakeholder-toggle::before {
  content: '▾ ';
}

.mindmap-connections-list,
.mindmap-actor-network-list {
  list-style: none;
  margin: 0;
  padding: 0.5rem;
}

.mindmap-connection {
  padding: 0.35rem 0.5rem;
  font-size: 0.82rem;
  border-bottom: 1px solid var(--border-light, #dee2e6);
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  align-items: center;
}

.mindmap-connection:last-child {
  border-bottom: none;
}

.mindmap-connection-strong {
  border-left: 3px solid #2e7d32;
}

.mindmap-connection-moderate {
  border-left: 3px solid #f9a825;
}

.mindmap-connection-weak {
  border-left: 3px solid #bdbdbd;
}

.connection-from,
.connection-to {
  font-weight: 600;
  color: var(--primary, #1565c0);
}

.connection-arrow {
  color: var(--text-muted, #6c757d);
}

.connection-meta {
  font-size: 0.75rem;
  color: var(--text-muted, #6c757d);
}

.connection-evidence {
  font-size: 0.75rem;
  font-style: italic;
  color: var(--text-secondary, #495057);
}

.mindmap-actor {
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--border-light, #dee2e6);
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.mindmap-actor:last-child {
  border-bottom: none;
}

.actor-icon {
  font-size: 1.1rem;
}

.actor-name {
  font-weight: 600;
}

.actor-type-badge {
  font-size: 0.7rem;
  padding: 0.1rem 0.4rem;
  background: var(--surface-alt, #e8eaf6);
  border-radius: 4px;
  color: var(--text-muted, #6c757d);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.mindmap-stakeholder-panels {
  padding: 0.5rem;
}

.mindmap-stakeholder-panel {
  margin-bottom: 0.5rem;
  border: 1px solid var(--border-light, #dee2e6);
  border-radius: 6px;
}

.mindmap-stakeholder-panel > summary {
  cursor: pointer;
  padding: 0.4rem 0.6rem;
  font-weight: 600;
  font-size: 0.82rem;
  background: var(--surface-alt, #f8f9fa);
}

.mindmap-stakeholder-desc {
  padding: 0.4rem 0.6rem;
  font-size: 0.8rem;
  color: var(--text-secondary, #495057);
  margin: 0;
}

/* Node category semantic colors */
.mindmap-node-policy_domain {
  border-left: 4px solid var(--branch-border, #1565c0);
}

.mindmap-node-sub_topic {
  border-left: 4px solid var(--branch-border, #7b1fa2);
}

.mindmap-node-actor {
  border-left: 4px solid var(--branch-border, #2e7d32);
}

.mindmap-node-action {
  border-left: 4px solid var(--branch-border, #e65100);
}

.mindmap-node-outcome {
  border-left: 4px solid var(--branch-border, #283593);
}

/* RTL overrides for intelligence mindmap accents */
[dir='rtl'] .mindmap-connection-strong,
[dir='rtl'] .mindmap-connection-moderate,
[dir='rtl'] .mindmap-connection-weak {
  border-left: none;
}

[dir='rtl'] .mindmap-connection-strong {
  border-right: 3px solid #2e7d32;
}

[dir='rtl'] .mindmap-connection-moderate {
  border-right: 3px solid #f9a825;
}

[dir='rtl'] .mindmap-connection-weak {
  border-right: 3px solid #bdbdbd;
}

[dir='rtl'] .mindmap-node-policy_domain,
[dir='rtl'] .mindmap-node-sub_topic,
[dir='rtl'] .mindmap-node-actor,
[dir='rtl'] .mindmap-node-action,
[dir='rtl'] .mindmap-node-outcome {
  border-left: none;
}

[dir='rtl'] .mindmap-node-policy_domain {
  border-right: 4px solid var(--branch-border, #1565c0);
}

[dir='rtl'] .mindmap-node-sub_topic {
  border-right: 4px solid var(--branch-border, #7b1fa2);
}

[dir='rtl'] .mindmap-node-actor {
  border-right: 4px solid var(--branch-border, #2e7d32);
}

[dir='rtl'] .mindmap-node-action {
  border-right: 4px solid var(--branch-border, #e65100);
}

[dir='rtl'] .mindmap-node-outcome {
  border-right: 4px solid var(--branch-border, #283593);
}

@media print {
  .mindmap-actor-overlay,
  .mindmap-connections-overlay,
  .mindmap-actor-network-overlay,
  .mindmap-stakeholder-overlay {
    display: block;
  }

  .mindmap-actor-overlay > *,
  .mindmap-connections-overlay > *,
  .mindmap-actor-network-overlay > *,
  .mindmap-stakeholder-overlay > * {
    display: block !important;
  }

  .mindmap-actor-overlay[open],
  .mindmap-connections-overlay[open],
  .mindmap-actor-network-overlay[open],
  .mindmap-stakeholder-overlay[open] {
    display: block;
  }

  .mindmap-intel-node {
    transform: none !important;
    break-inside: avoid;
  }
}

/* ===================================================================
   Sankey Flow Chart Section
   Inline SVG Sankey with accessible fallback table.
   =================================================================== */

.sankey-section {
  margin: 2rem 0;
  padding: 1.5rem;
  background: linear-gradient(160deg, #faf5ff 0%, #f3e5f5 50%, #f0f4ff 100%);
  border: 2px solid #7b1fa2;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(123, 31, 162, 0.1);
}

.sankey-section h2 {
  font-size: 1.4rem;
  color: var(--text-primary, #1a1a2e);
  border-bottom: 2px solid #7b1fa2;
  padding-bottom: 0.75rem;
  margin: 0 0 1rem 0;
  letter-spacing: 0.02em;
}

.sankey-summary {
  color: var(--text-muted, #6c757d);
  font-size: 0.95rem;
  margin: 0 0 1.5rem 0;
}

.sankey-chart-wrapper {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0.5rem;
  background: var(--surface-alt, #ffffff);
  border-radius: 8px;
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.04);
}

.sankey-chart-wrapper svg {
  display: block;
  width: 100%;
  height: auto;
  max-width: 600px;
  margin: 0 auto;
}

.sankey-fallback-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.8rem;
  margin-top: 0.75rem;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border-light, #dee2e6);
}

.sankey-fallback-table th,
.sankey-fallback-table td {
  padding: 0.5rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border-light, #dee2e6);
}

.sankey-fallback-table thead th {
  background: linear-gradient(135deg, #f3e5f5, #e8eaf6);
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

[dir='rtl'] .sankey-section {
  direction: rtl;
  text-align: right;
}

@media (max-width: 600px) {
  .mindmap-branch {
    min-width: 140px;
    max-width: 100%;
  }
}

/* ─── Stakeholder Impact Analysis ─────────────────────────────────────────── */

.stakeholder-impact {
  margin: 2rem 0;
  padding: 1.5rem;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.stakeholder-impact h2 {
  font-size: 1.4rem;
  margin-bottom: 1rem;
  color: var(--text-primary, #1a1a2e);
  letter-spacing: 0.02em;
}

.political-temperature {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-weight: 600;
  font-size: 0.95rem;
}

.political-temperature .temp-label {
  color: var(--text-primary, #1a1a2e);
}

.political-temperature .temp-score {
  font-variant-numeric: tabular-nums;
}

.political-temperature .temp-descriptor {
  font-weight: 400;
  opacity: 0.85;
}

.temp-low {
  background: #e8f5e9;
  color: #2e7d32;
}

.temp-moderate {
  background: #fff3e0;
  color: #e65100;
}

.temp-high {
  background: #fbe9e7;
  color: #bf360c;
}

.temp-very-high {
  background: #ffebee;
  color: #b71c1c;
}

.stakeholder-matrix {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.9rem;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-light, #dee2e6);
}

.stakeholder-matrix th,
.stakeholder-matrix td {
  padding: 0.6rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid var(--border-light, #dee2e6);
}

.stakeholder-matrix thead th {
  background: linear-gradient(135deg, #e8eaf6, #f3e5f5);
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.impact-high {
  color: #b71c1c;
  font-weight: 700;
}

.impact-medium {
  color: #e65100;
  font-weight: 600;
}

.impact-low {
  color: #2e7d32;
  font-weight: 500;
}

[dir='rtl'] .stakeholder-impact {
  direction: rtl;
  text-align: right;
}

[dir='rtl'] .stakeholder-matrix th,
[dir='rtl'] .stakeholder-matrix td {
  text-align: right;
}

@media (max-width: 600px) {
  .political-temperature {
    flex-wrap: wrap;
    font-size: 0.85rem;
  }

  .stakeholder-matrix {
    font-size: 0.8rem;
  }

  .stakeholder-matrix th,
  .stakeholder-matrix td {
    padding: 0.4rem 0.5rem;
  }
}

/* ─── AI Analysis Pending Indicators ─────────────────────────────────────── */

/* Block-level pending container (div, section) */
div.ai-analysis-pending,
section.ai-analysis-pending {
  position: relative;
  opacity: 0.7;
  border-left: 3px solid var(--accent-warning, #fd7e14);
  padding-left: 0.75rem;
}

div.ai-analysis-pending::before,
section.ai-analysis-pending::before {
  content: '⏳';
  position: absolute;
  left: -1.5rem;
  top: 0.25rem;
  font-size: 0.9rem;
}

/* Inline pending notice (em.ai-analysis-pending inside paragraphs) */
em.ai-analysis-pending {
  color: var(--text-muted, #6c757d);
  font-style: italic;
  font-size: 0.9em;
}

/* Muted text inside block-level pending containers */
.ai-analysis-pending em {
  color: var(--text-muted, #6c757d);
  font-style: italic;
  font-size: 0.9em;
}

.impact-card.ai-analysis-pending {
  background: var(--surface-muted, #f8f9fa);
  border-style: dashed;
}

.stakeholder-perspective-card .ai-analysis-pending {
  font-size: 0.85em;
}

/* Dark mode overrides */
@media (prefers-color-scheme: dark) {
  div.ai-analysis-pending,
  section.ai-analysis-pending {
    border-left-color: var(--accent-warning-dark, #e08c00);
  }

  [dir='rtl'] div.ai-analysis-pending,
  [dir='rtl'] section.ai-analysis-pending {
    border-left-color: initial;
    border-right-color: var(--accent-warning-dark, #e08c00);
  }

  .ai-analysis-pending em,
  em.ai-analysis-pending {
    color: var(--text-muted-dark, #8b949e);
  }

  .impact-card.ai-analysis-pending {
    background: var(--surface-muted-dark, #161b22);
  }
}

/* RTL overrides for AI pending indicators */
[dir='rtl'] div.ai-analysis-pending,
[dir='rtl'] section.ai-analysis-pending {
  border-left: none;
  border-right-width: 3px;
  border-right-style: solid;
  border-right-color: var(--accent-warning, #fd7e14);
  padding-left: 0;
  padding-right: 0.75rem;
}

[dir='rtl'] div.ai-analysis-pending::before,
[dir='rtl'] section.ai-analysis-pending::before {
  left: auto;
  right: -1.5rem;
}

/* Dark mode + RTL override (must follow RTL rules to win the cascade) */
@media (prefers-color-scheme: dark) {
  [dir='rtl'] div.ai-analysis-pending,
  [dir='rtl'] section.ai-analysis-pending {
    border-right-color: var(--accent-warning-dark, #e08c00);
  }
}

/* Explicit dark theme overrides for AI pending indicators */
html[data-theme='dark'] div.ai-analysis-pending,
html[data-theme='dark'] section.ai-analysis-pending {
  border-left-color: var(--accent-warning-dark, #e08c00);
}

html[data-theme='dark'] .ai-analysis-pending em,
html[data-theme='dark'] em.ai-analysis-pending {
  color: var(--text-muted-dark, #8b949e);
}

html[data-theme='dark'] .impact-card.ai-analysis-pending {
  background: var(--surface-muted-dark, #161b22);
}

/* Explicit dark theme + RTL overrides for AI pending indicators */
html[data-theme='dark'] [dir='rtl'] div.ai-analysis-pending,
html[data-theme='dark'] [dir='rtl'] section.ai-analysis-pending {
  border-left-color: initial;
  border-right-color: var(--accent-warning-dark, #e08c00);
}

/* ─── D3/Chart.js Enhanced Visualization Styles ──────────────────────────── */

.d3-treemap-wrapper,
.d3-network-wrapper,
.d3-swot-chart-wrapper {
  margin-top: 1rem;
  border-radius: 8px;
  overflow: hidden;
}

.d3-treemap-wrapper svg,
.d3-network-wrapper svg,
.d3-swot-chart-wrapper svg {
  display: block;
  border-radius: 8px;
  background: var(--surface-muted, #f8f9fa);
}

@media (prefers-color-scheme: dark) {
  .d3-treemap-wrapper svg,
  .d3-network-wrapper svg,
  .d3-swot-chart-wrapper svg {
    background: var(--surface-muted-dark, #161b22);
  }

  .d3-treemap-wrapper text,
  .d3-swot-chart-wrapper text,
  .d3-network-wrapper text {
    fill: #c9d1d9 !important;
  }
}

/* Explicit dark theme overrides for D3 visualizations */
html[data-theme='dark'] .d3-treemap-wrapper svg,
html[data-theme='dark'] .d3-network-wrapper svg,
html[data-theme='dark'] .d3-swot-chart-wrapper svg {
  background: var(--surface-muted-dark, #161b22);
}

html[data-theme='dark'] .d3-treemap-wrapper text,
html[data-theme='dark'] .d3-swot-chart-wrapper text,
html[data-theme='dark'] .d3-network-wrapper text {
  fill: #c9d1d9 !important;
}

/* ─── Article Table of Contents (aggregator-driven articles) ─────── */
/*
 * Two-column article layout: TOC sidebar on the left, article body on
 * the right. On narrow viewports the `<details>` collapses the TOC into
 * a disclosure so the article body stays the primary focus.
 */
.article-main {
  display: grid;
  grid-template-columns: minmax(0, 280px) minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}

.article-toc-container {
  position: sticky;
  top: 24px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  padding: 16px 18px;
  background: var(--card-bg, #f6f8fa);
  border: 1px solid var(--border, #d0d7de);
  border-radius: 8px;
  font-size: 0.9rem;
  line-height: 1.45;
}

.article-toc-details[open] .article-toc-summary {
  margin-bottom: 12px;
}

.article-toc-summary {
  font-weight: 700;
  color: var(--primary, #003399);
  cursor: pointer;
  list-style: none;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border, #d0d7de);
}

.article-toc-summary::-webkit-details-marker {
  display: none;
}

.article-toc-list {
  list-style: decimal inside;
  margin: 0;
  padding: 0;
}

.article-toc-list li {
  margin: 6px 0;
  padding-left: 4px;
}

.article-toc-list a {
  color: var(--link, #0969da);
  text-decoration: none;
}

.article-toc-list a:hover,
.article-toc-list a:focus-visible {
  text-decoration: underline;
}

.article-toc-list a:focus-visible {
  outline: 2px solid var(--primary, #003399);
  outline-offset: 2px;
  border-radius: 2px;
}

.article-body {
  min-width: 0; /* prevent grid-child overflow on long code blocks */
  width: 100%;
  max-width: 960px;
  padding: 28px;
  background:
    radial-gradient(circle at top left, rgba(0, 51, 153, 0.06), transparent 30rem),
    radial-gradient(circle at top right, rgba(255, 204, 0, 0.12), transparent 24rem),
    var(--card-bg, #ffffff);
  border: 1px solid rgba(0, 51, 153, 0.16);
  border-radius: 14px;
  box-shadow:
    0 18px 46px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.65);
  overflow-wrap: anywhere;
}

.article-hero {
  margin: 0 0 28px;
  padding: 24px;
  border: 1px solid rgba(0, 51, 153, 0.24);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(0, 51, 153, 0.13), rgba(255, 204, 0, 0.17)),
    radial-gradient(circle at 85% 10%, rgba(42, 157, 143, 0.14), transparent 20rem),
    var(--surface, #ffffff);
  box-shadow: 0 14px 34px rgba(0, 51, 153, 0.12);
}

.article-kicker {
  display: inline-flex;
  align-items: center;
  margin: 0 0 12px;
  padding: 0.35rem 0.7rem;
  color: #001f5f;
  background: linear-gradient(135deg, rgba(255, 204, 0, 0.95), rgba(255, 229, 109, 0.9));
  border: 1px solid rgba(0, 51, 153, 0.18);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.article-hero h1 {
  margin: 0 0 12px;
  font-size: clamp(2rem, 5vw, 3.6rem);
  line-height: 1.05;
  letter-spacing: -0.035em;
}

.article-dek {
  max-width: 72ch;
  margin: 0 0 14px;
  color: var(--text-muted, #57606a);
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  line-height: 1.55;
}

.article-meta,
.article-source-md,
.artifact-source {
  color: var(--text-muted, #57606a);
  font-size: 0.9rem;
}

.article-body > h1 {
  margin: 1.1rem 0 1.6rem;
  padding: 0.75rem 1rem;
  border: 1px solid rgba(0, 51, 153, 0.16);
  border-inline-start: 6px solid #ffcc00;
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(255, 204, 0, 0.13), rgba(0, 51, 153, 0.07)),
    var(--surface, #ffffff);
  color: var(--heading, #24292f);
  font-size: clamp(1.55rem, 3vw, 2.15rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  box-shadow: 0 8px 22px rgba(0, 51, 153, 0.07);
}

.article-body h2 {
  margin-top: 2.5rem;
  padding: 0.75rem 1rem;
  border: 1px solid rgba(0, 51, 153, 0.16);
  border-left: 6px solid var(--primary, #003399);
  border-radius: 12px;
  background:
    linear-gradient(90deg, rgba(0, 51, 153, 0.1), rgba(255, 204, 0, 0.11)), var(--surface, #ffffff);
  color: var(--primary, #003399);
  box-shadow: 0 8px 22px rgba(0, 51, 153, 0.08);
}

.article-body h3 {
  margin-top: 1.75rem;
  padding-inline-start: 0.75rem;
  border-inline-start: 4px solid rgba(42, 157, 143, 0.85);
  color: var(--heading, #24292f);
}

.article-body p,
.article-body li {
  line-height: 1.72;
}

.article-body blockquote {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  border-left: 4px solid var(--primary, #003399);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(0, 51, 153, 0.08), rgba(42, 157, 143, 0.08)),
    var(--surface-muted, #f6f8fa);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.table-scroll {
  margin: 1.25rem 0;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  contain: inline-size;
  border: 1px solid rgba(0, 51, 153, 0.18);
  border-radius: 14px;
  background: var(--card-bg, #ffffff);
  box-shadow: 0 10px 28px rgba(0, 51, 153, 0.08);
}

.table-scroll table {
  margin: 0;
  min-width: 720px;
}

.article-intel-table {
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
}

.article-intel-table th {
  background: linear-gradient(135deg, #003399, #2a5bd7);
  color: #ffffff;
  font-size: 0.82rem;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.article-intel-table th,
.article-intel-table td {
  border-color: rgba(0, 51, 153, 0.14);
}

.article-intel-table tbody tr:nth-child(even) td {
  background: rgba(0, 51, 153, 0.035);
}

.article-intel-table tbody tr:hover td {
  background: rgba(255, 204, 0, 0.13);
}

.intel-tone-critical,
.intel-tone-high,
.intel-tone-medium,
.intel-tone-low,
.intel-tone-source {
  border-radius: 0.55rem;
}

p.intel-tone-critical,
li.intel-tone-critical,
blockquote.intel-tone-critical,
p.intel-tone-high,
li.intel-tone-high,
blockquote.intel-tone-high,
p.intel-tone-medium,
li.intel-tone-medium,
blockquote.intel-tone-medium,
p.intel-tone-low,
li.intel-tone-low,
blockquote.intel-tone-low,
p.intel-tone-source,
li.intel-tone-source,
blockquote.intel-tone-source {
  padding: 0.65rem 0.8rem;
  border-inline-start: 4px solid currentColor;
}

.intel-tone-critical {
  color: #8f1d22;
  background: rgba(220, 53, 69, 0.11);
}

.intel-tone-high {
  color: #995600;
  background: rgba(255, 152, 0, 0.13);
}

.intel-tone-medium {
  color: #7a6500;
  background: rgba(255, 204, 0, 0.14);
}

.intel-tone-low {
  color: #166534;
  background: rgba(40, 167, 69, 0.12);
}

.intel-tone-source {
  color: #164d84;
  background: rgba(9, 105, 218, 0.1);
}

td.intel-tone-critical,
th.intel-tone-critical,
td.intel-tone-high,
th.intel-tone-high,
td.intel-tone-medium,
th.intel-tone-medium,
td.intel-tone-low,
th.intel-tone-low,
td.intel-tone-source,
th.intel-tone-source {
  font-weight: 700;
  box-shadow: inset 4px 0 0 currentColor;
}

.article-body > table,
.article-body section > table,
.outcome-matrix-table {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  contain: inline-size;
}

.article-body pre,
.article-body code {
  max-width: 100%;
}

.article-body pre {
  overflow-x: auto;
}

.article-body pre code {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.mermaid-figure {
  margin: 1.75rem 0;
  padding: 1rem;
  overflow-x: auto;
  border: 1px solid var(--border, #d0d7de);
  border-radius: 12px;
  background: var(--surface-muted, #f6f8fa);
}

.mermaid-figure svg {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
}

pre.mermaid {
  white-space: pre;
}

pre.mermaid--error {
  color: #fff;
  background: #8b0000;
  border-radius: 8px;
  padding: 1rem;
}

/* Collapse to single column below wide-desktop breakpoint. */
@media (max-width: 960px) {
  .article-main {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }
  .article-toc-container {
    position: static;
    max-height: none;
  }
  .article-toc-details:not([open]) .article-toc-list {
    display: none;
  }
}

@media (max-width: 480px) {
  .article-toc-container {
    padding: 12px 14px;
    border-radius: 10px;
  }

  .article-toc-summary {
    padding-bottom: 0;
    border-bottom: 0;
    font-size: 0.95rem;
  }

  .article-toc-details[open] .article-toc-summary {
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border, #d0d7de);
  }

  .article-body {
    padding: 18px 14px;
    border-radius: 10px;
  }

  .article-hero {
    padding: 18px 14px;
  }

  .article-hero h1 {
    font-size: clamp(1.65rem, 8vw, 2.35rem);
    line-height: 1.08;
    letter-spacing: -0.025em;
  }

  .article-body > h1 {
    margin: 0.85rem 0 1.25rem;
    padding: 0.65rem 0.8rem;
    font-size: clamp(1.35rem, 6.5vw, 1.85rem);
    line-height: 1.18;
  }

  .article-dek {
    font-size: 1rem;
  }
}

/* Dark-mode overrides pick up palette tokens already defined upstream. */
html[data-theme='dark'] .article-toc-container {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.12);
}

html[data-theme='dark'] .article-body,
html[data-theme='dark'] .article-hero,
html[data-theme='dark'] .mermaid-figure {
  background:
    radial-gradient(circle at top left, rgba(79, 140, 255, 0.11), transparent 26rem),
    radial-gradient(circle at top right, rgba(255, 204, 0, 0.09), transparent 22rem),
    rgba(255, 255, 255, 0.035);
  border-color: rgba(255, 255, 255, 0.12);
}

html[data-theme='dark'] .article-hero {
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.36);
}

html[data-theme='dark'] .article-kicker {
  color: #0b1020;
}

html[data-theme='dark'] .article-body h2 {
  background:
    linear-gradient(90deg, rgba(79, 140, 255, 0.16), rgba(255, 204, 0, 0.1)),
    rgba(255, 255, 255, 0.035);
  border-color: rgba(255, 255, 255, 0.14);
  color: #9fc2ff;
}

html[data-theme='dark'] .article-body > h1 {
  background:
    linear-gradient(135deg, rgba(255, 204, 0, 0.13), rgba(79, 140, 255, 0.09)),
    rgba(255, 255, 255, 0.035);
  border-color: rgba(255, 255, 255, 0.14);
  border-inline-start-color: #ffcc00;
  color: #f0f6fc;
}

html[data-theme='dark'] .article-body h3 {
  color: #e6edf3;
}

html[data-theme='dark'] .table-scroll {
  background: rgba(255, 255, 255, 0.035);
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
}

html[data-theme='dark'] .article-intel-table th {
  background: linear-gradient(135deg, #153a88, #315fc7);
}

html[data-theme='dark'] .article-intel-table tbody tr:nth-child(even) td {
  background: rgba(79, 140, 255, 0.06);
}

html[data-theme='dark'] .article-intel-table tbody tr:hover td {
  background: rgba(255, 204, 0, 0.1);
}

html[data-theme='dark'] .intel-tone-critical {
  color: #ffb3b8;
  background: rgba(255, 99, 132, 0.15);
}

html[data-theme='dark'] .intel-tone-high {
  color: #ffd18a;
  background: rgba(255, 152, 0, 0.16);
}

html[data-theme='dark'] .intel-tone-medium {
  color: #ffe680;
  background: rgba(255, 204, 0, 0.13);
}

html[data-theme='dark'] .intel-tone-low {
  color: #9be7b0;
  background: rgba(40, 167, 69, 0.15);
}

html[data-theme='dark'] .intel-tone-source {
  color: #a8cfff;
  background: rgba(88, 166, 255, 0.14);
}

html[data-theme='dark'] .article-body blockquote {
  background: rgba(144, 202, 249, 0.08);
}

/* RTL alignment for the numbered TOC list. */
[dir='rtl'] .article-toc-list {
  list-style-position: inside;
  padding-right: 0;
}
