/* ============================================================
   MAGNA BUREAU — COMPONENT LIBRARY v1.0
   All states: default / hover / focus / active / disabled /
   loading / error. Mobile-first. Dark default; light via tokens.
   ============================================================ */

/* ================= 1. LENS TRIAD ================= */
.triad{ display: inline-block; vertical-align: middle; flex: none; }
.triad .dot-west{ fill: var(--lens-west); }
.triad .dot-east{ fill: var(--lens-east); }
.triad .dot-south{ fill: var(--lens-south); }
.triad-12{ width: 12px; height: 12px; }
.triad-16{ width: 16px; height: 16px; }
.triad-24{ width: 24px; height: 24px; }
.triad-48{ width: 48px; height: 48px; }

.triad-with-label{ display: inline-flex; align-items: center; gap: var(--sp-2); }
.triad-label{
  font-size: var(--text-xs); font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--text-secondary);
}

/* Animated explainer triad: cycles AGREE → PARTIAL → SPLIT (6s).
   Swaps <use> href via CSS is impossible — JS toggles the symbol.
   Static under prefers-reduced-motion (handled in base). */
.triad-explainer{ width: 48px; height: 48px; }

/* ================= 2. BUTTONS ================= */
.btn{
  display: inline-flex; align-items: center; justify-content: center;
  gap: var(--sp-2);
  font-family: var(--font-sans); font-weight: 600; font-size: var(--text-sm);
  line-height: 1; padding: 12px 20px; border-radius: var(--radius-sm);
  border: 1px solid transparent; cursor: pointer; min-height: 44px;
  transition: background var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out),
              transform var(--dur-fast) var(--ease-out);
  text-decoration: none;
}
.btn:hover{ text-decoration: none; }
.btn:active{ transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"]{
  opacity: 0.45; cursor: not-allowed; transform: none;
}
.btn-primary{ background: var(--gold); color: var(--gold-ink); border-color: var(--gold); }
.btn-primary:hover{ background: var(--gold-hover); border-color: var(--gold-hover); color: var(--gold-ink); }
.btn-secondary{ background: transparent; color: var(--text-primary); border-color: var(--border-strong); }
.btn-secondary:hover{ border-color: var(--gold); color: var(--gold); }
.btn-ghost{ background: transparent; color: var(--text-secondary); border-color: transparent; padding: 12px 12px; }
.btn-ghost:hover{ color: var(--text-primary); background: var(--surface-2); }
.btn-sm{ padding: 8px 14px; min-height: 36px; font-size: var(--text-xs); }
.btn-lg{ padding: 16px 28px; min-height: 52px; font-size: var(--text-base); }

/* Loading state: calm skeleton shimmer on the button itself */
.btn.is-loading{ position: relative; color: transparent; pointer-events: none; }
.btn.is-loading::after{
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,0.18) 50%, transparent 70%);
  background-size: 200% 100%; animation: shimmer 1.2s linear infinite;
}
@keyframes shimmer{ to { background-position: -200% 0; } }

/* ================= 3. CHIPS & TAGS ================= */
.chip{
  display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--text-xs); font-weight: 600; letter-spacing: 0.04em;
  padding: 6px 12px; border-radius: var(--radius-full);
  background: var(--surface-2); color: var(--text-secondary);
  border: 1px solid var(--border); white-space: nowrap;
}
.chip-gold{ background: var(--gold-soft); color: var(--gold); border-color: transparent; }

/* Topic-based section tag — NEVER a default tag */
.section-tag{
  display: inline-block; font-size: var(--text-xs); font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold);
  border-bottom: 2px solid var(--gold); padding-bottom: 2px;
}

/* Lens tag: which lens a fact/source belongs to */
.lens-tag{
  display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--text-xs); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
}
.lens-tag .swatch{ width: 8px; height: 8px; border-radius: 50%; flex: none; }
.lens-tag-west{ color: var(--lens-west); }  .lens-tag-west .swatch{ background: var(--lens-west); }
.lens-tag-east{ color: var(--lens-east); }  .lens-tag-east .swatch{ background: var(--lens-east); }
.lens-tag-south{ color: var(--lens-south); } .lens-tag-south .swatch{ background: var(--lens-south); }

/* Byline label: Desk / Analysis / Opinion — mandatory on every article */
.byline-label{
  display: inline-block; font-size: var(--text-xs); font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  padding: 4px 10px; border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--text-secondary); border: 1px solid var(--border);
}
.byline-label.is-analysis{ color: var(--lens-west); border-color: var(--lens-west); background: transparent; }
.byline-label.is-opinion{ color: var(--gold); border-color: var(--gold); background: transparent; }

/* ================= 4. RATING CHIPS =================
   Color is NEVER the only signal: icon shape + text label always. */
.rating-chip{
  display: inline-flex; align-items: center; gap: 8px;
  font-size: var(--text-xs); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 6px 12px; border-radius: var(--radius-full); white-space: nowrap;
}
.rating-chip svg{ width: 12px; height: 12px; flex: none; }
.rating-critical{ background: var(--rating-critical-bg); color: var(--rating-critical); }
.rating-tense{ background: var(--rating-tense-bg);    color: var(--rating-tense); }
.rating-calm{ background: var(--rating-calm-bg);     color: var(--rating-calm); }
.rating-neutral{ background: var(--surface-2);                  color: var(--text-secondary); }

/* Gentle 2s pulse on Critical markers only */
@keyframes pulse-critical{
  0%, 100% { opacity: 1; } 50% { opacity: 0.55; }
}
.pulse-critical{ animation: pulse-critical 2s ease-in-out infinite; }

/* ================= 5. HEADER ================= */
.site-header{
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg-base) 92%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow var(--dur-med) var(--ease-out);
}
.site-header.is-compact{ box-shadow: var(--shadow-sm); }
.site-header-inner{
  display: flex; align-items: center; gap: var(--sp-4);
  height: var(--header-h); max-width: var(--measure-wide);
  margin-inline: auto; padding-inline: var(--sp-4);
}
.brand{ display: inline-flex; align-items: center; gap: var(--sp-3); flex: none; }
.brand:hover{ text-decoration: none; }
.brand-seal{ width: 36px; height: 36px; border-radius: 50%; }
.brand-wordmark{
  font-family: var(--font-serif); font-weight: 600; font-size: var(--text-lg);
  letter-spacing: 0.02em; color: var(--text-primary);
}
.site-header.is-compact .brand-seal{ width: 28px; height: 28px; }
.site-header.is-compact .brand-wordmark{ font-size: var(--text-base); }

.site-nav{ display: none; align-items: center; gap: var(--sp-1); margin-inline: auto; }
@media (min-width: 1024px) { .site-nav{ display: flex; } }
.site-nav a{
  color: var(--text-secondary); font-size: var(--text-sm); font-weight: 600;
  padding: 10px 12px; border-radius: var(--radius-sm); white-space: nowrap;
}
.site-nav a:hover{ color: var(--text-primary); text-decoration: none; background: var(--surface-1); }
.site-nav a[aria-current="page"]{ color: var(--text-primary); position: relative; }
.site-nav a[aria-current="page"]::after{
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 4px;
  height: 2px; background: var(--text-primary); border-radius: 1px;
}

.header-actions{ display: flex; align-items: center; gap: var(--sp-2); margin-left: auto; }
@media (min-width: 1024px) { .header-actions{ margin-left: 0; } }

.lang-switch{
  display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius-full);
  overflow: hidden; font-size: var(--text-xs); font-weight: 700;
}
.lang-switch a{ padding: 8px 12px; color: var(--text-tertiary); min-height: 44px; display: inline-flex; align-items: center; }
.lang-switch a[aria-current="true"]{ background: var(--surface-2); color: var(--text-primary); }
.lang-switch a:hover{ text-decoration: none; color: var(--text-primary); }
/* Language switcher must never shrink or clip (Boss photo fix, 2026-10-25) */
.lang-switch{ flex: 0 0 auto; white-space: nowrap; }
.lang-switch a{ flex: 0 0 auto; white-space: nowrap; }
@media (max-width: 700px) {
  .header-actions{ gap: 6px; }
  .lang-switch a{ padding: 8px 9px; }
  /* On narrow phones the sign-out label is what crowds the row out; the avatar
     stays as the logged-in indicator, and sign-out remains on desktop widths. */
  #magna-auth-chip .m-signout{ display: none; }
}

.icon-btn{
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: var(--radius-full);
  background: transparent; border: 1px solid transparent; color: var(--text-secondary);
  cursor: pointer;
}
.icon-btn:hover{ background: var(--surface-1); color: var(--text-primary); }
.icon-btn svg{ width: 20px; height: 20px; stroke-width: 1.5; }
/* Search icon sizing (Boss 2026-10-20): compact on mobile, standard on desktop */
@media (max-width: 1023px){
  .icon-btn { width: 36px; height: 36px; }
  .icon-btn svg { width: 16px; height: 16px; }
}

.updated-stamp{
  display: none; font-size: var(--text-xs); color: var(--text-tertiary);
  align-items: center; gap: 6px; white-space: nowrap;
}
.updated-stamp .live-dot{ width: 7px; height: 7px; border-radius: 50%; background: var(--lens-south); }
@media (min-width: 768px) { .updated-stamp{ display: inline-flex; } }

/* Mobile nav drawer trigger */
.nav-toggle{ display: inline-flex; }
@media (min-width: 1024px) { .nav-toggle{ display: none; } }

/* ================= 6. FOOTER ================= */
.site-footer{ border-top: 1px solid var(--border); margin-top: var(--sp-24); background: var(--surface-1); }
.footer-inner{ max-width: var(--measure-wide); margin-inline: auto; padding: var(--sp-8) var(--sp-4) var(--sp-5); }
.footer-grid{ display: grid; gap: var(--sp-8); grid-template-columns: 1fr; }
@media (min-width: 768px) { .footer-grid{ grid-template-columns: 2fr 1fr 1fr 1fr; } }
.footer-brand p{ color: var(--text-secondary); font-size: var(--text-sm); margin-top: var(--sp-3); max-width: 32ch; }
.footer-col h4{ font-family: var(--font-sans); font-size: var(--text-xs); font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-tertiary); margin-bottom: var(--sp-3); }
.footer-col ul{ list-style: none; display: grid; gap: var(--sp-1); }
.footer-col a{ color: var(--text-secondary); font-size: var(--text-sm); }
.footer-col a:hover{ color: var(--text-primary); }
.footer-base{
  display: flex; flex-wrap: wrap; gap: var(--sp-4); align-items: center; justify-content: space-between;
  border-top: 1px solid var(--border); margin-top: var(--sp-10); padding-top: var(--sp-6);
  font-size: var(--text-xs); color: var(--text-tertiary);
}
.cookie-settings-btn{
  background: none; border: 0; color: var(--text-secondary); font-size: var(--text-xs);
  text-decoration: underline; cursor: pointer; padding: 8px 4px;
}
.cookie-settings-btn:hover{ color: var(--text-primary); }

/* ================= 7. STORY CARDS ================= */
.story-card{
  display: flex; flex-direction: column; background: var(--surface-1);
  border: 1px solid var(--border); border-radius: var(--radius-md);
  overflow: hidden; transition: transform var(--dur-med) var(--ease-out), box-shadow var(--dur-med) var(--ease-out), border-color var(--dur-fast);
}
.story-card:hover{ transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.story-card:hover .story-card-title{ text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: 3px; }
.story-card-media{ position: relative; aspect-ratio: 16/9; overflow: hidden; background: var(--surface-2); }
.story-card-media img{ width: 100%; height: 100%; object-fit: cover; }
.story-card-body{ display: flex; flex-direction: column; gap: var(--sp-2); padding: var(--sp-4); flex: 1; }
.story-card-title{ font-size: var(--text-xl); line-height: var(--leading-snug); color: var(--text-primary); }
.story-card-dek{ font-size: var(--text-sm); color: var(--text-secondary); line-height: var(--leading-snug); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.story-card-meta{
  display: flex; align-items: center; gap: var(--sp-3); margin-top: auto; padding-top: var(--sp-2);
  font-size: var(--text-xs); color: var(--text-tertiary);
}
.story-card-meta .triad-with-label{ margin-left: auto; }

.card-grid{ display: grid; gap: var(--sp-4); grid-template-columns: 1fr; }
@media (min-width: 768px) { .card-grid{ grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .card-grid{ grid-template-columns: repeat(3, 1fr); } }

/* Skeleton cards replace "Loading the News Feed..." */
.skeleton-card{ background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.skeleton{ background: var(--skeleton); border-radius: var(--radius-sm); position: relative; overflow: hidden; }
.skeleton::after{
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 30%, var(--skeleton-shine) 50%, transparent 70%);
  background-size: 200% 100%; animation: shimmer 1.4s linear infinite;
}

/* ================= 8. TABS ================= */
.tabs{ border-bottom: 1px solid var(--border); }
.tabs-list{ display: flex; gap: var(--sp-1); overflow-x: auto; scrollbar-width: none; }
.tabs-list::-webkit-scrollbar{ display: none; }
.tab-btn{
  background: none; border: 0; cursor: pointer; white-space: nowrap;
  font-size: var(--text-sm); font-weight: 600; color: var(--text-secondary);
  padding: 12px 16px; min-height: 44px; border-bottom: 2px solid transparent; margin-bottom: -1px;
  display: inline-flex; align-items: center; gap: var(--sp-2);
}
.tab-btn:hover{ color: var(--text-primary); }
.tab-btn[aria-selected="true"]{ color: var(--gold); border-bottom-color: var(--gold); }
.tab-panel{ padding: var(--sp-6) 0; }
.tab-panel[hidden]{ display: none; }

/* ================= 9. ACCORDIONS (FAQ) ================= */
.accordion{ border-top: 1px solid var(--border); }
.accordion-item{ border-bottom: 1px solid var(--border); }
.accordion-item summary{
  list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-4); padding: var(--sp-4) var(--sp-2); min-height: 56px;
  font-weight: 600; font-size: var(--text-base); color: var(--text-primary);
}
.accordion-item summary::-webkit-details-marker{ display: none; }
.accordion-item summary:hover{ color: var(--gold); }
.accordion-item summary .acc-icon{ flex: none; width: 20px; height: 20px; color: var(--text-tertiary); transition: transform var(--dur-fast) var(--ease-out); }
.accordion-item[open] summary .acc-icon{ transform: rotate(45deg); color: var(--gold); }
.accordion-item .acc-body{ padding: 0 var(--sp-2) var(--sp-5); color: var(--text-secondary); line-height: var(--leading-body); max-width: 70ch; }

/* ================= 10. TOOLTIP / TOAST / EMPTY / ERROR ================= */
.tooltip{ position: relative; }
.tooltip .tooltip-text{
  position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%) translateY(4px);
  background: var(--surface-3); color: var(--text-primary); font-size: var(--text-xs);
  padding: 8px 12px; border-radius: var(--radius-sm); white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
  box-shadow: var(--shadow-md); z-index: 50;
}
.tooltip:hover .tooltip-text, .tooltip:focus-within .tooltip-text{ opacity: 1; transform: translateX(-50%) translateY(0); }

.toast-region{ position: fixed; bottom: var(--sp-6); left: 50%; transform: translateX(-50%); z-index: 300; display: grid; gap: var(--sp-2); width: min(420px, calc(100vw - 32px)); }
.toast{
  background: var(--surface-3); color: var(--text-primary); border: 1px solid var(--border-strong);
  border-radius: var(--radius-md); padding: var(--sp-3) var(--sp-4); font-size: var(--text-sm);
  box-shadow: var(--shadow-md); display: flex; align-items: center; gap: var(--sp-3);
}

.empty-state, .error-state{
  text-align: center; padding: var(--sp-16) var(--sp-4); color: var(--text-secondary);
  border: 1px dashed var(--border-strong); border-radius: var(--radius-md); background: var(--surface-1);
}
.empty-state h3, .error-state h3{ margin-bottom: var(--sp-2); color: var(--text-primary); }
.empty-state p, .error-state p{ font-size: var(--text-sm); max-width: 46ch; margin: 0 auto var(--sp-4); }

/* ================= 11. CONSENSUS LEDGER =================
   Five rows with icons: Agree / Split / Known / Unknown / Expect. */
.consensus{
  background: var(--surface-1); border: 1px solid var(--border);
  border-radius: var(--radius-md); overflow: hidden; margin: var(--sp-8) 0;
}
.consensus-head{
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5); border-bottom: 1px solid var(--border);
}
.consensus-head h2, .consensus-head h3{ font-size: var(--text-xl); }
.consensus-row{
  display: grid; grid-template-columns: 40px 140px 1fr; gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5); border-bottom: 1px solid var(--border); align-items: start;
}
.consensus-row:last-child{ border-bottom: 0; }
@media (max-width: 767px) { .consensus-row{ grid-template-columns: 32px 1fr; } .consensus-row .c-label{ grid-column: 2; } }
.consensus-icon{ width: 24px; height: 24px; margin-top: 2px; }
.c-label{ font-size: var(--text-xs); font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-secondary); padding-top: 4px; }
.c-body{ color: var(--text-primary); font-size: var(--text-sm); line-height: var(--leading-body); }
.c-body p + p{ margin-top: var(--sp-2); }
.split-chips{ display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: var(--sp-2); }

/* ================= 12. SOURCES ================= */
.sources-block{ margin: var(--sp-10) 0; }
.sources-block h2{ font-size: var(--text-2xl); margin-bottom: var(--sp-4); }
.source-item{
  display: grid; grid-template-columns: 1fr auto; gap: var(--sp-2) var(--sp-4);
  padding: var(--sp-3) 0; border-bottom: 1px solid var(--border); align-items: center;
}
.source-item:last-child{ border-bottom: 0; }
.source-name{ font-weight: 600; font-size: var(--text-sm); color: var(--text-primary); }
.source-meta{ display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: 4px; }
.source-type{
  font-size: var(--text-xs); font-weight: 600; padding: 2px 8px; border-radius: var(--radius-full);
  background: var(--surface-2); color: var(--text-secondary); border: 1px solid var(--border);
}
.source-link{
  font-size: var(--text-sm); font-weight: 600; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px;
}
.source-link svg{ width: 14px; height: 14px; }

/* Source chip (inline, key facts) */
.source-chip{
  display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--text-xs); font-weight: 600; color: var(--link);
  border: 1px solid var(--border-strong); border-radius: var(--radius-full);
  padding: 4px 10px; white-space: nowrap;
}
.source-chip:hover{ border-color: var(--link); text-decoration: none; }
.source-chip svg{ width: 12px; height: 12px; }

/* ================= 13. SHARE BAR ================= */
.share-bar{ display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
.share-bar .share-label{ font-size: var(--text-xs); font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-tertiary); margin-right: var(--sp-2); }

/* ================= 14. ARTICLE SCAFFOLD ================= */
/* Reading progress */
.reading-progress{
  position: fixed; top: 0; left: 0; height: 3px; width: 100%; z-index: 120;
  background: transparent; pointer-events: none;
}
.reading-progress span{ display: block; height: 100%; width: 0; background: #1D3FA0; }

/* 30-second summary card */
.summary-card{
  background: var(--surface-1); border: 1px solid var(--border);
  border-left: 3px solid var(--gold); border-radius: var(--radius-md);
  padding: var(--sp-5); margin: var(--sp-8) 0;
}
.summary-card h2{ font-size: var(--text-lg); font-family: var(--font-sans); font-weight: 700; margin-bottom: var(--sp-3); display: flex; align-items: center; gap: var(--sp-2); }
.summary-card ul{ list-style: none; display: grid; gap: var(--sp-2); }
.summary-card li{ display: flex; gap: var(--sp-3); font-size: var(--text-sm); line-height: var(--leading-body); color: var(--text-primary); }
.summary-card li::before{ content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); margin-top: 8px; }
.summary-card .split-line{ color: var(--text-secondary); }
.summary-card .split-line strong{ color: var(--text-primary); }

/* Key facts */
.key-facts{ margin: var(--sp-8) 0; border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.key-facts h2{ font-size: var(--text-lg); font-family: var(--font-sans); padding: var(--sp-4) var(--sp-5); background: var(--surface-1); border-bottom: 1px solid var(--border); }
.key-fact{ display: flex; gap: var(--sp-3); padding: var(--sp-4) var(--sp-5); border-bottom: 1px solid var(--border); align-items: flex-start; }
.key-fact:last-child{ border-bottom: 0; }
.key-fact .kf-marker{ flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); margin-top: 7px; }
.key-fact p{ font-size: var(--text-sm); line-height: var(--leading-body); flex: 1; }
.key-fact .source-chip{ margin-top: var(--sp-2); }

/* Lens section: tabs + compare */
.lens-tabs{ margin: var(--sp-10) 0; }
.lens-panel{ display: grid; gap: var(--sp-4); }
.lens-outlet{
  background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: var(--sp-4) var(--sp-5);
}
.lens-outlet-head{ display: flex; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-2); flex-wrap: wrap; }
.lens-outlet-name{ font-weight: 700; font-size: var(--text-sm); }
.region-badge{
  font-size: var(--text-xs); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text-tertiary); border: 1px solid var(--border); border-radius: var(--radius-full); padding: 3px 10px;
}
.lens-outlet .claim{ font-size: var(--text-sm); color: var(--text-secondary); line-height: var(--leading-body); }
.lens-outlet .claim strong{ color: var(--text-primary); font-weight: 600; }
.lens-empty{
  border: 1px dashed var(--border-strong); border-radius: var(--radius-md);
  padding: var(--sp-6); text-align: center; color: var(--text-tertiary); font-size: var(--text-sm);
}
/* Desktop side-by-side compare */
@media (min-width: 1024px){
  .lens-compare { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-4); }
  .lens-compare-col h3 { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--text-lg); font-family: var(--font-sans); margin-bottom: var(--sp-3); }
}

/* Pull quote */
.pull-quote{
  margin: var(--sp-10) auto; max-width: 560px; text-align: center;
  font-family: var(--font-serif); font-size: var(--text-2xl); line-height: var(--leading-snug);
  color: var(--text-primary); position: relative; padding: var(--sp-6) var(--sp-4);
}
.pull-quote::before, .pull-quote::after{
  content: ""; display: block; width: 48px; height: 2px; background: var(--gold); margin: 0 auto var(--sp-4);
}
.pull-quote::after{ margin: var(--sp-4) auto 0; }
.pull-quote cite{ display: block; margin-top: var(--sp-3); font-family: var(--font-sans); font-style: normal; font-size: var(--text-xs); color: var(--text-tertiary); letter-spacing: 0.08em; text-transform: uppercase; }

/* Hero figure with visible credit */
.hero-figure{ margin: 0 0 var(--sp-8); }
.hero-figure img{ width: 100%; border-radius: var(--radius-md); }
.hero-figure figcaption{
  display: flex; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap;
  font-size: var(--text-xs); color: var(--text-tertiary); padding-top: var(--sp-2);
}
.photo-credit{ font-weight: 600; }

/* Sticky article TOC (desktop) */
.article-layout{ display: grid; gap: var(--sp-8); grid-template-columns: 1fr; }
@media (min-width: 1024px) {
  .article-layout{ grid-template-columns: 220px minmax(0, var(--measure-article)); justify-content: center; }
}
.toc{ display: none; }
@media (min-width: 1024px) {
  .toc{ display: block; position: sticky; top: calc(var(--header-h) + var(--sp-6)); align-self: start; max-height: 70vh; overflow: auto; }
  .toc h2{ font-family: var(--font-sans); font-size: var(--text-xs); font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-tertiary); margin-bottom: var(--sp-3); }
  .toc ol{ list-style: none; display: grid; gap: 2px; }
  .toc a{ display: block; font-size: var(--text-sm); color: var(--text-secondary); padding: 6px 0 6px var(--sp-3); border-left: 2px solid var(--border); }
  .toc a:hover{ color: var(--text-primary); text-decoration: none; }
  .toc a[aria-current="true"]{ color: var(--gold); border-left-color: var(--gold); }
}

/* ================= 15. WORLD BAROMETER ================= */
.barometer-summary{
  display: grid; gap: var(--sp-4); grid-template-columns: 1fr;
  background: var(--surface-1); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: var(--sp-6); margin: var(--sp-8) 0;
}
@media (min-width: 768px) { .barometer-summary{ grid-template-columns: auto 1fr auto; align-items: center; } }
.rating-counts{ display: flex; gap: var(--sp-6); }
.rating-count{ text-align: center; }
.rating-count .n{ font-family: var(--font-serif); font-size: var(--text-4xl); font-weight: 600; line-height: 1; }
.rating-count .t{ font-size: var(--text-xs); font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-tertiary); margin-top: 4px; }
.rating-count.critical .n{ color: var(--rating-critical); }
.rating-count.tense .n{ color: var(--rating-tense); }
.rating-count.calm .n{ color: var(--rating-calm); }

/* Heat strip: one segment per item, sorted by severity */
.heat-strip{ display: flex; gap: 3px; height: 28px; border-radius: var(--radius-sm); overflow: hidden; }
.heat-strip span{ flex: 1; min-width: 4px; border-radius: 2px; }
.heat-strip .hs-critical{ background: var(--rating-critical); }
.heat-strip .hs-tense{ background: var(--rating-tense); }
.heat-strip .hs-calm{ background: var(--rating-calm); opacity: 0.55; }

.barometer-card{
  background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius-md);
  overflow: hidden; margin-bottom: var(--sp-3);
}
.barometer-card-head{
  width: 100%; background: none; border: 0; cursor: pointer; text-align: left;
  display: grid; grid-template-columns: 1fr auto; gap: var(--sp-2) var(--sp-4); align-items: center;
  padding: var(--sp-4) var(--sp-5); min-height: 72px; color: var(--text-primary);
}
.barometer-card-head:hover{ background: var(--surface-2); }
.bc-name{ font-family: var(--font-serif); font-size: var(--text-lg); font-weight: 600; }
.bc-assessment{ font-size: var(--text-sm); color: var(--text-secondary); margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.bc-side{ display: flex; align-items: center; gap: var(--sp-3); }
.bc-reviewed{ font-size: var(--text-xs); color: var(--text-tertiary); white-space: nowrap; }
.bc-change{ font-size: var(--text-xs); font-weight: 700; white-space: nowrap; }
.bc-change.up{ color: var(--rating-critical); }
.bc-change.down{ color: var(--lens-south); }
.bc-change.same{ color: var(--text-tertiary); }
.sparkline{ width: 96px; height: 28px; flex: none; }
.barometer-card-body{ border-top: 1px solid var(--border); padding: var(--sp-5); display: grid; gap: var(--sp-4); }
.barometer-card-body[hidden]{ display: none; }
.bc-detail h4{ font-family: var(--font-sans); font-size: var(--text-xs); font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-tertiary); margin-bottom: var(--sp-2); }
.bc-detail p, .bc-detail li{ font-size: var(--text-sm); color: var(--text-secondary); line-height: var(--leading-body); }
.bc-detail ul{ padding-left: var(--sp-4); }
.evidence-date{ font-size: var(--text-xs); color: var(--text-tertiary); font-style: italic; }

.filter-chips{ display: flex; gap: var(--sp-2); overflow-x: auto; padding-bottom: var(--sp-2); scrollbar-width: thin; }
.filter-chip{
  flex: none; font-size: var(--text-sm); font-weight: 600; padding: 10px 16px; min-height: 44px;
  border-radius: var(--radius-full); border: 1px solid var(--border-strong);
  background: transparent; color: var(--text-secondary); cursor: pointer;
}
.filter-chip:hover{ border-color: var(--gold); color: var(--text-primary); }

/* Barometer mobile fix (Boss 2026-10-20): stack card head vertically, no overflow */
@media (max-width: 767px){
  .barometer-card-head {
    grid-template-columns: 1fr;
    gap: var(--sp-2);
    padding: var(--sp-3) var(--sp-4);
    min-height: 0;
  }
  .bc-side {
    flex-wrap: wrap;
    gap: var(--sp-2);
  }
  .bc-reviewed {
    white-space: normal;
  }
  .sparkline {
    width: 100%;
    max-width: 200px;
  }
  .bc-assessment {
    -webkit-line-clamp: 2;
  }
}
.filter-chip[aria-pressed="true"]{ background: var(--gold); border-color: var(--gold); color: var(--gold-ink); }

/* Mobile bottom sheet for barometer detail */
@media (max-width: 767px){
  .barometer-card.expanded { position: fixed; inset: auto 0 0 0; z-index: 200; max-height: 85vh; border-radius: var(--radius-md) var(--radius-md) 0 0; box-shadow: var(--shadow-md); }
  .barometer-card.expanded .barometer-card-body { overflow-y: auto; }
  .sheet-scrim { position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 190; }
}

/* What changed this week */
.change-feed{ list-style: none; display: grid; gap: 0; border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.change-feed li{ display: flex; gap: var(--sp-3); align-items: baseline; padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--border); font-size: var(--text-sm); }
.change-feed li:last-child{ border-bottom: 0; }
.change-feed time{ color: var(--text-tertiary); font-size: var(--text-xs); white-space: nowrap; }

/* ================= 16. RANKINGS ================= */
.rankings-tabs{ margin-bottom: var(--sp-6); }

.podium{ display: grid; gap: var(--sp-3); grid-template-columns: 1fr; margin: var(--sp-8) 0; }
@media (min-width: 768px) { .podium{ grid-template-columns: repeat(3, 1fr); } }
.podium-card{
  background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: var(--sp-5); text-align: center; position: relative;
}
.podium-card.rank-1{ border-color: var(--gold); }
.podium-rank{ font-family: var(--font-serif); font-size: var(--text-5xl); color: var(--gold); line-height: 1; }
.podium-country{ font-family: var(--font-serif); font-size: var(--text-2xl); margin: var(--sp-2) 0; }
.podium-score{ font-size: var(--text-lg); color: var(--text-secondary); }

/* Compact table (desktop) / card list (mobile) */
.rank-table-wrap{ overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-md); }
table.rank-table{ width: 100%; border-collapse: collapse; font-size: var(--text-sm); min-width: 640px; }
.rank-table th{
  text-align: left; font-size: var(--text-xs); letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-tertiary); padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--border);
  background: var(--surface-1); position: sticky; top: 0;
}
.rank-table td{ padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--border); }
.rank-table tr:last-child td{ border-bottom: 0; }
.rank-table tbody tr:hover{ background: var(--surface-1); }
.rank-table .r-rank{ font-weight: 700; color: var(--gold); width: 56px; }
.rank-table .r-country{ font-weight: 600; }
.rank-table .r-score{ font-weight: 700; }
.component-bar{ display: flex; height: 8px; border-radius: var(--radius-full); overflow: hidden; min-width: 120px; background: var(--surface-2); }
.component-bar span{ height: 100%; }

.rank-cards{ display: none; }
@media (max-width: 767px) {
  .rank-table-wrap{ display: none; }
  .rank-cards{ display: grid; gap: var(--sp-3); }
  .rank-card{ background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius-md); padding: var(--sp-4); }
  .rank-card-top{ display: flex; align-items: baseline; gap: var(--sp-3); }
  .rank-card-top .r-rank{ font-family: var(--font-serif); font-size: var(--text-2xl); color: var(--gold); }
  .rank-card-top .r-country{ font-weight: 700; font-size: var(--text-base); }
  .rank-card-top .r-score{ margin-left: auto; font-weight: 700; }
  .rank-card .component-bar{ margin-top: var(--sp-3); }
}

.why-ranking{ margin-top: var(--sp-3); }
.strengths-drags{ display: grid; gap: var(--sp-4); grid-template-columns: 1fr; margin: var(--sp-4) 0; }
@media (min-width: 768px) { .strengths-drags{ grid-template-columns: 1fr 1fr; } }
.sd-col h4{ font-family: var(--font-sans); font-size: var(--text-xs); font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: var(--sp-2); }
.sd-col.strengths h4{ color: var(--lens-south); }
.sd-col.drags h4{ color: var(--rating-tense); }
.sd-col ul{ list-style: none; display: grid; gap: var(--sp-2); font-size: var(--text-sm); color: var(--text-secondary); }
.sd-col li{ display: flex; gap: var(--sp-2); }
.sd-col li::before{ content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; margin-top: 7px; }
.sd-col.strengths li::before{ background: var(--lens-south); }
.sd-col.drags li::before{ background: var(--rating-tense); }

.vintage-note{
  font-size: var(--text-xs); color: var(--text-tertiary); border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm); padding: var(--sp-3) var(--sp-4); margin: var(--sp-6) 0; line-height: var(--leading-body);
}

/* Country page: radar placeholder + compare */
.country-hero{ display: grid; gap: var(--sp-6); grid-template-columns: 1fr; margin: var(--sp-8) 0; }
@media (min-width: 768px) { .country-hero{ grid-template-columns: 1fr 1fr; align-items: center; } }
.country-score-big{ font-family: var(--font-serif); font-size: var(--text-5xl); font-weight: 600; }
.radar-chart{ width: 100%; max-width: 360px; margin-inline: auto; }

/* ================= 17. VOICES ================= */
.voice-card{
  display: flex; gap: var(--sp-4); background: var(--surface-1);
  border: 1px solid var(--border); border-radius: var(--radius-md); padding: var(--sp-5); align-items: flex-start;
}
.voice-portrait{ width: 72px; height: 72px; border-radius: 50%; object-fit: cover; flex: none; background: var(--surface-3); }
.voice-name{ font-family: var(--font-serif); font-size: var(--text-xl); }
.voice-role{ font-size: var(--text-xs); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gold); margin: var(--sp-1) 0; }
.voice-beat{ font-size: var(--text-sm); color: var(--text-secondary); }
.voice-links{ display: flex; gap: var(--sp-2); margin-top: var(--sp-3); }
.voice-links a{ font-size: var(--text-xs); font-weight: 600; }

/* ================= 18. NEWSLETTER / METER / ADS / MISC ================= */
.newsletter-box{
  background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: var(--sp-8) var(--sp-6); text-align: center; margin: var(--sp-12) 0;
}
.newsletter-box h2{ margin-bottom: var(--sp-2); }
.newsletter-box p{ color: var(--text-secondary); font-size: var(--text-sm); max-width: 52ch; margin: 0 auto var(--sp-4); }
.newsletter-form{ display: flex; gap: var(--sp-2); max-width: 440px; margin: 0 auto; flex-wrap: wrap; justify-content: center; }
.newsletter-form input[type="email"]{
  flex: 1; min-width: 220px; min-height: 48px; padding: 0 var(--sp-4);
  background: var(--bg-base); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  color: var(--text-primary); font-size: var(--text-base);
}
.newsletter-form input[type="email"]::placeholder{ color: var(--text-tertiary); }

.meter-card{
  background: var(--surface-1); border: 1px solid var(--gold); border-radius: var(--radius-md);
  padding: var(--sp-6); text-align: center; max-width: 480px; margin: var(--sp-8) auto;
}
.meter-card h2{ font-size: var(--text-2xl); margin-bottom: var(--sp-2); }
.meter-card p{ color: var(--text-secondary); font-size: var(--text-sm); margin-bottom: var(--sp-4); }
.meter-count{ font-family: var(--font-serif); font-size: var(--text-4xl); color: var(--gold); }

/* Ad slots: reserved, labelled, hidden until ads are live — never empty boxes */
.ad-slot{ display: none; }
.ad-slot.is-live{
  display: flex; align-items: center; justify-content: center;
  min-height: 250px; background: var(--surface-1); border: 1px solid var(--border);
  border-radius: var(--radius-sm); margin: var(--sp-8) auto; max-width: 970px;
}
.ad-slot.is-live::before{
  content: "Advertisement"; font-size: var(--text-xs); letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--text-tertiary);
}

/* Breadcrumbs */
.breadcrumbs{ display: flex; flex-wrap: wrap; gap: var(--sp-2); font-size: var(--text-xs); color: var(--text-tertiary); margin: var(--sp-4) 0; }
.breadcrumbs a{ color: var(--text-secondary); }
.breadcrumbs [aria-current="page"]{ color: var(--text-primary); font-weight: 600; }
.breadcrumbs li{ display: inline-flex; align-items: center; gap: var(--sp-2); list-style: none; }
.breadcrumbs li + li::before{ content: "/"; color: var(--border-strong); }

/* "How we read a story" explainer — 2026-10-19 alignment fix: uniform structure
   (static icon + number-inline title + description), numbers next to titles */
.method-strip{
  display: grid; gap: var(--sp-6); grid-template-columns: 1fr; text-align: center;
  padding: var(--sp-10) 0; align-items: start;
}
@media (min-width: 768px) { .method-strip{ grid-template-columns: repeat(3, 1fr); } }
.method-step{ display: flex; flex-direction: column; align-items: center; }
.method-step .method-icon{
  width: 48px; height: 48px; color: var(--gold); margin-bottom: var(--sp-3);
  flex-shrink: 0;
}
.method-step h3{
  display: flex; align-items: center; justify-content: center; gap: .5rem;
  font-size: var(--text-lg); font-family: var(--font-sans); margin: 0 0 var(--sp-2);
}
.method-step .step-n{
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.75rem; height: 1.75rem; border-radius: 50%; border: 1.5px solid var(--gold);
  color: var(--gold); font-weight: 700; font-size: .85rem; flex-shrink: 0;
}
.method-step p{ font-size: var(--text-sm); color: var(--text-secondary); margin: 0; }

/* Trust page long-form */
.trust-body{ max-width: var(--measure-article); }
.trust-body h2{ margin: var(--sp-10) 0 var(--sp-4); font-size: var(--text-3xl); }
.trust-body h3{ margin: var(--sp-8) 0 var(--sp-3); }
.trust-body p, .trust-body li{ color: var(--text-secondary); line-height: var(--leading-body); margin-bottom: var(--sp-3); }
.trust-body ul, .trust-body ol{ padding-left: var(--sp-5); }
.last-updated{ font-size: var(--text-xs); color: var(--text-tertiary); display: inline-flex; align-items: center; gap: 6px; }

/* Boss 2026-10-16: lens swatch dots removed — color-coded text is enough */
.lens-tag .swatch{display:none!important}

/* Boss 2026-10-16: lens labels ALWAYS in their color code, everywhere uniform */
.lens-west strong, .lens-west > strong:first-child,
p.lens-west strong, .where-split.lens-west strong{ color: var(--lens-west) !important; }
.lens-east strong, .lens-east > strong:first-child,
p.lens-east strong, .where-split.lens-east strong{ color: var(--lens-east) !important; }
.lens-south strong, .lens-south > strong:first-child,
p.lens-south strong, .where-split.lens-south strong{ color: var(--lens-south) !important; }
/* Lens tab buttons keep their color-coded text */
.lens-tag-west{ color: var(--lens-west) !important; }
.lens-tag-east{ color: var(--lens-east) !important; }
.lens-tag-south{ color: var(--lens-south) !important; }

/* Mobile nav open state (Boss 2026-10-16: hamburger menu must work) */
@media (max-width: 1023px){
  .site-nav.is-open {
    display: flex !important;
    position: fixed;
    top: 0; left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    background: var(--bg-base);
    border-bottom: 1px solid var(--border);
    padding: 72px 24px 24px;
    gap: 4px;
    z-index: 90;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  }
  /* Keep hamburger clickable above the open menu */
  .site-header:has(.site-nav.is-open) .nav-toggle {
    position: relative;
    z-index: 95;
  }
  .site-nav.is-open a {
    padding: 12px 16px;
    font-size: 18px;
    border-radius: 8px;
  }
}

/* READABILITY LAW (Boss 2026-10-16): everything readable on dark, everywhere */
/* Force light text on dark backgrounds for old content */
body{ color: var(--text-primary) !important; }
p, li, td, th, dd, dt, figcaption{ color: var(--text-primary); }
/* Headings */
h1, h2, h3, h4, h5, h6{ color: var(--text-primary) !important; }
/* Links */
a{ color: #1D3FA0; }
a:hover{ color: #234BB5; }
/* Old dark-text classes that break on dark bg */
.dark-text, .text-dark, [style*="color:#000"], [style*="color: #000"],
[style*="color:black"], [style*="color: black"]{ color: var(--text-primary) !important; }
/* Ensure cards have proper contrast */
.card, .article-card, .voice-card, .investigation-card{
  background: var(--surface-1) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border) !important;
}
.card p, .article-card p, .voice-card p, .investigation-card p{
  color: var(--text-secondary) !important;
}
.card h3, .article-card h3, .voice-card h3, .investigation-card h3{
  color: var(--text-primary) !important;
}
/* White cards from old UI - keep them readable */
.hist-card, .timeline-card, .collection-card{
  background: #FBFBFC !important;
  color: #171C2B !important;
}
.hist-card h3, .timeline-card h3, .collection-card h3,
.hist-card p, .timeline-card p, .collection-card p{
  color: #171C2B !important;
}
