
:root {
  --swiss-black: #000000;
  --swiss-white: #ffffff;
  --swiss-red: #ff0000;
  /* Pure red on white is 4.0:1, under the 4.5:1 that text needs. Bars keep --swiss-red; anything read uses this (5.3:1). */
  --swiss-red-text: #d90000;
  --swiss-gray-100: #f8f8f8;
  --swiss-gray-200: #e8e8e8;
  --swiss-gray-300: #d0d0d0;
  /* muted text: the lightest grey that still passes 4.5:1 on white with room to spare (5.7:1) */
  --swiss-gray-500: #666666;
  --swiss-gray-600: #595959;
  --swiss-gray-700: #404040;
  --swiss-gray-800: #2a2a2a;
  --swiss-gray-900: #1a1a1a;
  /* Neutral bars in the charts, and the off state of a switch: 3:1 against white, which --swiss-gray-300 (1.5:1) is not. */
  --swiss-neutral-bar: #8c8c8c;

  --grid-unit: 24px;
  --font-size-xs: 11px;
  --font-size-sm: 13px;
  --font-size-base: 16px;
  --font-size-lg: 20px;
  --font-size-xl: 24px;
  --font-size-2xl: 32px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Helvetica Neue", Arial, sans-serif;
}

/* In the accessibility tree, not on screen: what a chart or a grid of bare numbers says in words. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

body {
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: var(--font-size-base);
  line-height: 1.4;
  color: var(--swiss-black);
  background: var(--swiss-white);
}

.app {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
}

/* Subject page header: way home, and the headline that doubles as the subject switcher */
.subject-header {
  width: 100%;
  max-width: 1296px;
  margin: 0 auto;
  padding: calc(var(--grid-unit) * 2) var(--grid-unit) 0;
}

.subject-masthead {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  /* wraps below ~380px (and at 400% zoom) instead of pushing the page sideways */
  flex-wrap: wrap;
  gap: 4px var(--grid-unit);
  padding-bottom: 16px;
  border-bottom: 2px solid var(--swiss-black);
  font-size: var(--font-size-sm);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.subject-masthead a {
  color: var(--swiss-black);
  text-decoration: none;
  white-space: nowrap;
}

.subject-masthead a:hover {
  color: var(--swiss-red-text);
}

.subject-home {
  font-weight: 700;
}

.subject-headline {
  max-width: 1100px;
  padding-top: 56px;
  font-size: clamp(36px, 5.6vw, 72px);
  line-height: 1.06;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.subject-picker {
  position: relative;
  display: inline-block;
  border-bottom: 0.07em solid var(--swiss-red);
  white-space: nowrap;
}

.subject-picker select {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  font-size: 16px;
  cursor: pointer;
}

.subject-picker:hover {
  color: var(--swiss-red-text);
}

.subject-picker:focus-within {
  outline: 2px solid var(--swiss-black);
  outline-offset: 4px;
}

.subject-sub {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--grid-unit);
  padding-top: var(--grid-unit);
  color: var(--swiss-gray-700);
}

.subject-watermark {
  font-size: var(--font-size-xs);
  letter-spacing: 0.5px;
  color: var(--swiss-gray-500);
}

@media (max-width: 640px) {
  .subject-headline {
    padding-top: 32px;
  }

  /* A long name has to wrap, and an inline-block cannot wrap mid-headline. The name goes inline
     and the invisible select covers the whole headline instead: tap anywhere on it to switch. */
  .subject-headline {
    position: relative;
  }

  .subject-picker {
    position: static;
    display: inline;
    border-bottom: none;
    white-space: normal;
    text-decoration: underline;
    text-decoration-color: var(--swiss-red);
    text-decoration-thickness: 0.07em;
    text-underline-offset: 0.12em;
  }

  .subject-sub {
    flex-direction: column;
    gap: 8px;
  }
}

.main-content {
  padding: calc(var(--grid-unit) * 2) var(--grid-unit);
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  overflow-x: hidden;
  box-sizing: border-box;
}

.country-dashboard {
  max-width: 100%;
  overflow-x: hidden;
}

.country-dashboard h1 {
  font-size: var(--font-size-2xl);
  font-weight: 300;
  margin-bottom: calc(var(--grid-unit) * 2);
  text-align: center;
  color: var(--swiss-black);
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1px;
  background: var(--swiss-gray-200);
  margin-bottom: calc(var(--grid-unit) * 2);
}

.metric-card {
  background: var(--swiss-white);
  padding: var(--grid-unit);
  text-align: center;
}

.metric-label {
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--swiss-gray-700);
  margin-bottom: calc(var(--grid-unit) / 4);
}

.metric-value {
  font-size: var(--font-size-2xl);
  font-weight: 300;
  color: var(--swiss-black);
  line-height: 1;
}

.chart-section {
  margin-bottom: calc(var(--grid-unit) * 2);
  background: var(--swiss-white);
  border: 1px solid var(--swiss-gray-200);
}

.chart-header {
  background: var(--swiss-gray-100);
  padding: var(--grid-unit);
  border-bottom: 1px solid var(--swiss-gray-200);
}

.chart-header h3 {
  font-size: var(--font-size-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--swiss-black);
}

.chart-content {
  padding: var(--grid-unit);
}

.articles-section {
  margin-top: calc(var(--grid-unit) * 2);
}

.section-header {
  background: var(--swiss-black);
  color: var(--swiss-white);
  padding: var(--grid-unit);
  margin-bottom: 1px;
}

.section-header h3 {
  font-size: var(--font-size-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.articles-grid {
  display: grid;
  gap: 1px;
  background: var(--swiss-gray-200);
}

.article-item {
  background: var(--swiss-white);
  padding: var(--grid-unit);
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: var(--grid-unit);
  align-items: start;
}

.sentiment-indicator {
  width: 12px;
  height: 12px;
  border-radius: 0;
  margin-top: 4px;
}

.sentiment-indicator.positive {
  background: var(--swiss-black);
}
.sentiment-indicator.neutral {
  background: var(--swiss-gray-300);
}
.sentiment-indicator.negative {
  background: var(--swiss-red);
}
.sentiment-indicator.very_negative {
  background: var(--swiss-red);
}

.article-content h4 {
  font-size: var(--font-size-base);
  font-weight: 500;
  margin-bottom: calc(var(--grid-unit) / 4);
  line-height: 1.3;
}

.article-content p {
  font-size: var(--font-size-sm);
  color: var(--swiss-gray-700);
  line-height: 1.4;
}

.article-meta {
  text-align: right;
  font-size: var(--font-size-xs);
  color: var(--swiss-gray-700);
}

.article-date {
  margin-bottom: calc(var(--grid-unit) / 4);
}

.article-link {
  color: var(--swiss-black);
  text-decoration: none;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.article-link:hover {
  color: var(--swiss-red-text);
}

.news-grid {
  display: grid;
  gap: 1px;
  background: var(--swiss-gray-200);
}

.news-item {
  background: var(--swiss-white);
  padding: var(--grid-unit);
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: var(--grid-unit);
  align-items: start;
}

.site-indicator {
  width: 8px;
  height: 8px;
  background: var(--swiss-black);
  margin-top: 6px;
}

.news-content h2 {
  font-size: var(--font-size-base);
  font-weight: 500;
  margin-bottom: calc(var(--grid-unit) / 4);
  line-height: 1.3;
}

.news-content p {
  font-size: var(--font-size-sm);
  color: var(--swiss-gray-700);
  line-height: 1.4;
  margin-bottom: calc(var(--grid-unit) / 2);
}

.news-authors {
  font-size: var(--font-size-xs);
  color: var(--swiss-gray-700);
}

.news-meta {
  text-align: right;
  font-size: var(--font-size-xs);
  color: var(--swiss-gray-700);
}

.news-date {
  margin-bottom: calc(var(--grid-unit) / 4);
}

.news-link {
  color: var(--swiss-black);
  text-decoration: none;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.news-link:hover {
  color: var(--swiss-red-text);
}

.loading,
.error {
  text-align: center;
  padding: calc(var(--grid-unit) * 2);
  font-size: var(--font-size-sm);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.error {
  color: var(--swiss-red-text);
}

.load-more-container {
  text-align: center;
  margin-top: calc(var(--grid-unit) * 2);
}

.load-more-btn {
  background: var(--swiss-black);
  color: var(--swiss-white);
  border: none;
  padding: var(--grid-unit) calc(var(--grid-unit) * 2);
  font-size: var(--font-size-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
}

.load-more-btn:hover:not(:disabled) {
  background: var(--swiss-red);
}

.load-more-btn:disabled {
  background: var(--swiss-gray-300);
  cursor: not-allowed;
}

.news-stats {
  text-align: center;
  margin-top: var(--grid-unit);
  font-size: var(--font-size-xs);
  color: var(--swiss-gray-700);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Dashboard Improvements */
.header-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--swiss-gray-200);
}

.quick-stat {
  background: var(--swiss-white);
  padding: var(--grid-unit);
  text-align: center;
}

.stat-value {
  display: block;
  font-size: var(--font-size-xl);
  font-weight: 300;
  color: var(--swiss-black);
  margin-bottom: calc(var(--grid-unit) / 4);
}

.stat-value.trending-up {
  color: var(--swiss-black);
}

.stat-value.trending-down {
  color: var(--swiss-red-text);
}

.stat-label {
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--swiss-gray-700);
}

/* Section Styling */
.sentiment-overview,
.trends-section,
.articles-section {
  margin-bottom: calc(var(--grid-unit) * 3);
  max-width: 100%;
  overflow: hidden;
}

.section-title {
  margin-bottom: var(--grid-unit);
  text-align: center;
}

.section-title h2 {
  font-size: var(--font-size-lg);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: calc(var(--grid-unit) / 4);
  color: var(--swiss-black);
}

.section-title p {
  font-size: var(--font-size-sm);
  color: var(--swiss-gray-700);
}

.publications-link {
  padding: 0;
  background: none;
  border: none;
  font: inherit;
  color: inherit;
  text-decoration: underline;
  text-decoration-style: dotted;
  cursor: pointer;
  transition: all 0.2s ease;
}

.publications-link:hover {
  text-decoration-style: solid;
  color: var(--swiss-red-text);
}

/* Modals: a native <dialog> (components/Modal.tsx). The universal reset above removes the margin that centres it. */
.modal {
  margin: auto;
  width: calc(100% - 32px);
  max-width: 500px;
  /* never taller than the screen: the box scrolls instead */
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--swiss-white);
  color: var(--swiss-black);
  border: 1px solid var(--swiss-gray-300);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.modal::backdrop {
  background: rgba(0, 0, 0, 0.5);
}

/* The page behind an open dialog is inert but would still scroll. */
html:has(dialog[open]) {
  overflow: hidden;
}

.modal-content {
  padding: calc(var(--grid-unit) * 2);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--grid-unit);
  margin-bottom: var(--grid-unit);
}

.modal-header h3 {
  font-size: var(--font-size-lg);
}

.modal-close {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  margin: -10px -10px -10px 0;
  background: none;
  border: none;
  font-size: 24px;
  color: var(--swiss-gray-700);
  cursor: pointer;
}

.modal-close:hover {
  color: var(--swiss-black);
}

.modal :focus-visible,
.publications-link:focus-visible {
  outline: 2px solid var(--swiss-black);
  outline-offset: 2px;
}

@media (max-width: 640px) {
  .modal-content {
    padding: var(--grid-unit);
  }
}

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

.publications-list li {
  padding: calc(var(--grid-unit) / 2) 0;
  border-bottom: 1px solid var(--swiss-gray-200);
  font-size: var(--font-size-base);
}

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

/* Sentiment Bars */
.sentiment-bars {
  background: var(--swiss-gray-200);
  margin-bottom: var(--grid-unit);
}

.sentiment-bar-row {
  background: var(--swiss-white);
  padding: calc(var(--grid-unit) / 2) var(--grid-unit);
  display: grid;
  grid-template-columns: 140px 1fr 80px;
  gap: var(--grid-unit);
  align-items: center;
  border-bottom: 1px solid var(--swiss-gray-200);
}

.sentiment-bar-row:last-child {
  border-bottom: none;
}

.sentiment-label {
  display: flex;
  align-items: center;
  gap: calc(var(--grid-unit) / 2);
  font-size: var(--font-size-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.sentiment-dot {
  width: 8px;
  height: 8px;
  border-radius: 0;
}

.sentiment-dot.friendly {
  background: var(--swiss-black);
}

.sentiment-dot.neutral {
  background: var(--swiss-neutral-bar);
}

.sentiment-dot.hostile {
  background: var(--swiss-red);
}

.sentiment-bar-container {
  background: var(--swiss-gray-100);
  height: 16px;
  position: relative;
}

.sentiment-bar {
  height: 100%;
  transition: width 0.3s ease;
}

.sentiment-bar.friendly {
  background: var(--swiss-black);
}

.sentiment-bar.neutral {
  background: var(--swiss-neutral-bar);
}

.sentiment-bar.hostile {
  background: var(--swiss-red);
}

.sentiment-stats {
  display: flex;
  gap: calc(var(--grid-unit) / 2);
  justify-content: flex-end;
  font-size: var(--font-size-xs);
}

.sentiment-stats .count {
  font-weight: 600;
  color: var(--swiss-black);
}

.sentiment-stats .percentage {
  color: var(--swiss-gray-700);
}

/* Sentiment Summary */
.sentiment-note {
  font-size: var(--font-size-xs);
  color: var(--swiss-gray-700);
  margin-bottom: var(--grid-unit);
}

/* Sides: one stacked bar, the figures in a list under it. Neutral is a light fill so the two sides that say something
   carry the picture; its outline is what keeps the segment 3:1 against the page. */
.side-bar {
  display: flex;
  gap: 2px;
  height: 56px;
  margin-bottom: var(--grid-unit);
}

/* no mentions this week: an empty track rather than nothing */
.side-bar:empty {
  background: var(--swiss-gray-100);
}

.side-bar-seg {
  flex: 0 1 0;
  min-width: 2px;
}

.side-bar-seg.hostile,
.day-row-seg.hostile {
  background: var(--swiss-red);
}

.side-bar-seg.neutral,
.day-row-seg.neutral {
  background: var(--swiss-gray-200);
  box-shadow: inset 0 0 0 1px var(--swiss-neutral-bar);
}

.side-bar-seg.friendly,
.day-row-seg.friendly {
  background: var(--swiss-black);
}

.side-legend {
  list-style: none;
  display: flex;
  align-items: flex-start;
  margin-bottom: var(--grid-unit);
}

.side-legend-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: max-content;
}

/* as wide as the hostile segment, so "Neutral" starts under its own; gives way when the text needs the room */
.side-legend-item.hostile {
  flex: 0 1 calc(var(--share) + 2px);
  padding-right: var(--grid-unit);
}

.side-legend-item.neutral {
  flex: 1 0 auto;
  padding-right: var(--grid-unit);
}

.side-legend-item.friendly {
  flex: 0 0 auto;
  align-items: flex-end;
  text-align: right;
}

.side-legend-value {
  font-size: 48px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
}

.side-legend-item.hostile .side-legend-value {
  color: var(--swiss-red-text);
}

.side-legend-item.neutral .side-legend-value {
  font-weight: 300;
  color: var(--swiss-gray-500);
}

.side-legend-label,
.stat-label,
.day-row-date {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  line-height: 18px;
}

.side-legend-count,
.stat-note {
  font-size: var(--font-size-sm);
  line-height: 18px;
  color: var(--swiss-gray-700);
}

/* Three figures, or one for a subject that gets no side: equal columns for however many there are. */
.stat-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: calc(var(--grid-unit) * 4 / 3);
  margin-top: calc(var(--grid-unit) * 2);
}

.stat {
  display: flex;
  flex-direction: column;
  gap: calc(var(--grid-unit) / 2);
  min-width: 0;
  padding-top: calc(var(--grid-unit) * 2 / 3);
  border-top: 2px solid var(--swiss-black);
}

.stat-value {
  font-size: clamp(48px, 6.25vw, 72px);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
}

.info-indicator {
  color: var(--swiss-gray-500);
  font-size: var(--font-size-xs);
  cursor: help;
  display: inline-block;
  margin-left: 4px;
}

/* Daily activity: a row per day, newest first */
.day-rows {
  border-top: 2px solid var(--swiss-black);
}

.day-row {
  /* holds the row's visually hidden sentence */
  position: relative;
  display: grid;
  grid-template-columns: 132px 1fr 56px;
  column-gap: var(--grid-unit);
  align-items: center;
  min-height: 44px;
  border-bottom: 1px solid var(--swiss-gray-200);
}

.day-rows.sided .day-row {
  grid-template-columns: 132px 1fr 56px 128px;
}

.day-row-track {
  display: flex;
  height: 16px;
  min-width: 0;
}

.day-row-seg {
  min-width: 2px;
}

.day-row-total,
.day-row-side {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.day-row-total {
  font-size: var(--font-size-base);
  font-weight: 700;
}

.day-row-side {
  font-size: var(--font-size-sm);
}

.day-row-side.hostile {
  color: var(--swiss-red-text);
}

/* The legend and the day rows have four things side by side: too many for a phone. */
@media (max-width: 640px) {
  .side-bar {
    height: 40px;
  }

  .side-legend {
    flex-direction: column;
    align-items: stretch;
  }

  .side-legend-item,
  .side-legend-item.friendly {
    display: grid;
    grid-template-columns: 88px 1fr;
    column-gap: calc(var(--grid-unit) / 2);
    align-items: center;
    flex: none;
    min-width: 0;
    padding: calc(var(--grid-unit) / 3) 0;
    border-top: 1px solid var(--swiss-gray-200);
    text-align: left;
  }

  .side-legend-value {
    grid-row: 1 / span 2;
    font-size: var(--font-size-2xl);
  }

  .stat-row {
    grid-auto-flow: row;
    grid-template-columns: 1fr;
    gap: var(--grid-unit);
  }

  .day-row,
  .day-rows.sided .day-row {
    grid-template-columns: 1fr auto;
    grid-template-areas: "date total" "track track";
    column-gap: calc(var(--grid-unit) / 2);
    row-gap: 6px;
    padding: 10px 0;
  }

  .day-rows.sided .day-row {
    grid-template-columns: 1fr auto auto;
    grid-template-areas: "date total side" "track track track";
  }

  .day-row-date {
    grid-area: date;
  }

  .day-row-track {
    grid-area: track;
  }

  .day-row-total {
    grid-area: total;
  }

  .day-row-side {
    grid-area: side;
  }
}

/* Articles List */
.articles-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1px;
  background: var(--swiss-gray-200);
}

.article-card {
  background: var(--swiss-white);
  padding: var(--grid-unit);
  display: flex;
  flex-direction: column;
  gap: calc(var(--grid-unit) / 2);
  /* grid items default to min-width: auto and grow past their column instead of wrapping */
  min-width: 0;
}

.article-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: calc(var(--grid-unit) / 4) calc(var(--grid-unit) / 2);
  margin-bottom: calc(var(--grid-unit) / 4);
}

.sentiment-badge {
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  font-weight: 600;
  padding: 2px 6px;
  background: var(--swiss-gray-100);
  color: var(--swiss-gray-700);
}

.sentiment-badge.friendly {
  background: var(--swiss-black);
  color: var(--swiss-white);
}

.sentiment-badge.hostile {
  background: var(--swiss-red-text);
  color: var(--swiss-white);
}

.article-date {
  font-size: var(--font-size-xs);
  color: var(--swiss-gray-700);
  white-space: nowrap;
}

/* Own line always: sharing a row with the chips put it right on some cards and underneath on others. */
.article-header .article-date {
  flex-basis: 100%;
}

.article-title {
  font-size: var(--font-size-base);
  font-weight: 500;
  line-height: 1.3;
  color: var(--swiss-black);
  margin-bottom: calc(var(--grid-unit) / 4);
}

.article-excerpt {
  font-size: var(--font-size-sm);
  line-height: 1.4;
  color: var(--swiss-gray-700);
  flex: 1;
}

.article-footer {
  margin-top: auto;
}

.article-link {
  display: inline-block;
  padding: 6px 0;
  font-size: var(--font-size-xs);
  color: var(--swiss-black);
  text-decoration: none;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.article-link:hover {
  color: var(--swiss-red-text);
}

/* News Header */
.news-header {
  text-align: center;
  margin-bottom: calc(var(--grid-unit) * 2);
}

.news-header h2 {
  font-size: var(--font-size-xl);
  font-weight: 300;
  color: var(--swiss-black);
  margin-bottom: calc(var(--grid-unit) / 4);
}

.news-header p {
  font-size: var(--font-size-sm);
  color: var(--swiss-gray-700);
}

@media (max-width: 768px) {
  .masthead {
    text-align: center;
  }

  .masthead h1 {
    font-size: var(--font-size-lg);
  }

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

  .sentiment-bar-row {
    grid-template-columns: 110px 1fr 50px;
    gap: calc(var(--grid-unit) / 2);
    padding: calc(var(--grid-unit) / 2);
  }

  .sentiment-label {
    font-size: 10px;
  }

  .sentiment-stats {
    font-size: 10px;
  }

  .sentiment-stats .count {
    font-size: 11px;
  }

  .articles-list {
    grid-template-columns: 1fr;
  }

  .article-item,
  .news-item {
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
  }

  .article-meta,
  .news-meta {
    grid-column: 2;
    text-align: left;
    margin-top: calc(var(--grid-unit) / 2);
  }
}

@media (max-width: 480px) {
  .sentiment-overview {
    padding: 0;
  }

  .trends-section {
    max-width: 100%;
    overflow: hidden;
  }

  .sentiment-bar-row {
    grid-template-columns: 1fr;
    gap: calc(var(--grid-unit) / 4);
  }

  .sentiment-label {
    justify-content: flex-start;
    margin-bottom: calc(var(--grid-unit) / 4);
  }

  .sentiment-bar-container {
    height: 20px;
  }

  .sentiment-stats {
    justify-content: flex-start;
    margin-top: calc(var(--grid-unit) / 4);
  }

}

/* Sentiment Filter */
/* Controls above the article list: title and language, side segments with counts, frame select, main-subject check. */
.articles-controls {
  max-width: 560px;
  margin: 0 auto var(--grid-unit);
  padding-bottom: var(--grid-unit);
  border-bottom: 2px solid var(--swiss-black);
}

.articles-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--grid-unit);
  margin-bottom: var(--grid-unit);
}

.articles-head h2 {
  font-size: var(--font-size-lg);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.articles-head p {
  font-size: var(--font-size-sm);
  color: var(--swiss-gray-700);
}

.lang-toggle {
  display: flex;
  gap: 10px;
}

.lang-toggle button {
  min-width: 24px;
  min-height: 24px;
  padding: 0 0 2px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--swiss-gray-500);
  cursor: pointer;
}

.lang-toggle button.active {
  color: var(--swiss-black);
  border-bottom-color: var(--swiss-black);
}

.side-segments {
  display: flex;
}

.side-seg {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px;
  background: var(--swiss-white);
  color: var(--swiss-black);
  border: 1px solid var(--swiss-gray-300);
  border-left-width: 0;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.side-seg:first-child {
  border-left-width: 1px;
}

.side-seg-count {
  font-size: 20px;
  font-weight: 700;
  line-height: 24px;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.side-seg-label {
  font-size: 10px;
  font-weight: 700;
  line-height: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.side-seg.hostile .side-seg-count {
  color: var(--swiss-red-text);
}

.side-seg:hover:not(:disabled):not(.active) {
  background: var(--swiss-gray-100);
}

.side-seg.active,
.side-seg.active .side-seg-count {
  background: var(--swiss-black);
  border-color: var(--swiss-black);
  color: var(--swiss-white);
}

.side-seg:disabled,
.side-seg:disabled .side-seg-count {
  color: #bbb;
  cursor: default;
}

.filter-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.frame-select,
.salient-check {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  min-height: 42px;
  border: 1px solid var(--swiss-gray-300);
  cursor: pointer;
}

.frame-select {
  flex: 1;
  min-width: 0;
}

.frame-select span {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #666;
}

.frame-select select {
  flex: 1;
  min-width: 0;
  padding: 10px 0;
  background: none;
  border: none;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  color: var(--swiss-black);
  cursor: pointer;
}

.salient-check {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.salient-check input {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: var(--swiss-black);
}

.frame-select:focus-within,
.salient-check:focus-within,
.side-seg:focus-visible,
.lang-toggle button:focus-visible {
  outline: 2px solid var(--swiss-black);
  outline-offset: 2px;
}

/* Sentiment Container */
.sentiment-container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: calc(var(--grid-unit) / 4) calc(var(--grid-unit) / 2);
  min-width: 0;
}

.correction-link {
  background: none;
  border: none;
  color: var(--swiss-gray-600);
  font-size: var(--font-size-xs);
  font-weight: 500;
  letter-spacing: 0.5px;
  cursor: pointer;
  padding: 6px 4px;
  transition: color 0.2s;
  text-decoration: underline;
}

.correction-link:hover {
  color: var(--swiss-black);
}

/* Correction dialog */
.correction-sent:focus {
  outline: none;
}

.correction-modal-body {
  margin-bottom: calc(var(--grid-unit) * 1.5);
}

.correction-modal-body p,
.correction-modal-body legend {
  margin-bottom: 12px;
  color: var(--swiss-gray-900);
}

.correction-modal-body fieldset {
  border: none;
}

.correction-error {
  margin-bottom: var(--grid-unit);
  color: var(--swiss-red-text);
  font-size: var(--font-size-sm);
}

.correction-options {
  display: flex;
  flex-direction: column;
  gap: calc(var(--grid-unit) / 2);
}

.correction-option {
  display: flex;
  align-items: center;
  gap: calc(var(--grid-unit) / 2);
  padding: calc(var(--grid-unit) / 2);
  cursor: pointer;
}

.correction-option:hover {
  background: var(--swiss-gray-100);
}

.correction-option input[type="radio"] {
  margin: 0;
}

.correction-option span {
  font-size: var(--font-size-sm);
  color: var(--swiss-gray-800);
}

.correction-modal-footer {
  display: flex;
  gap: var(--grid-unit);
  justify-content: flex-end;
}

.correction-submit,
.correction-cancel {
  padding: calc(var(--grid-unit) / 2) var(--grid-unit);
  border: 1px solid var(--swiss-gray-300);
  background: var(--swiss-white);
  color: var(--swiss-black);
  font-size: var(--font-size-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.correction-submit {
  background: var(--swiss-black);
  color: var(--swiss-white);
  border-color: var(--swiss-black);
}

.correction-submit:hover:not(:disabled) {
  background: var(--swiss-gray-800);
}

.correction-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.correction-cancel:hover {
  background: var(--swiss-gray-100);
}

/* Home page: league table of every subject */
.league-page {
  max-width: 1296px;
  margin: 0 auto;
  padding: calc(var(--grid-unit) * 2.5) var(--grid-unit) calc(var(--grid-unit) * 3);
  background: var(--swiss-white);
}

.league-masthead {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--grid-unit);
  padding-bottom: 16px;
  border-bottom: 2px solid var(--swiss-black);
  font-size: var(--font-size-sm);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.league-brand {
  font-weight: 700;
}

.league-meta {
  color: #666;
  text-align: right;
}

.league-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: calc(var(--grid-unit) * 2);
  padding: 56px 0 40px;
}

.league-hero h1 {
  max-width: 820px;
  font-size: clamp(40px, 5.6vw, 72px);
  line-height: 1;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.league-hero p {
  max-width: 320px;
  line-height: 1.5;
  color: var(--swiss-gray-700);
}

.league-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px var(--grid-unit);
  padding-bottom: var(--grid-unit);
}

.league-filters {
  display: flex;
  flex-wrap: wrap;
}

.league-filter {
  padding: 8px 16px;
  background: var(--swiss-white);
  color: var(--swiss-black);
  border: 1px solid var(--swiss-gray-300);
  margin-right: -1px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.league-filter.active {
  background: var(--swiss-black);
  border-color: var(--swiss-black);
  color: var(--swiss-white);
}

.league-salient {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.league-row {
  display: grid;
  grid-template-columns: 48px minmax(160px, 1.4fr) 96px minmax(160px, 2fr) 84px 84px 172px 120px;
  align-items: center;
  column-gap: 16px;
  min-height: 56px;
  border-bottom: 1px solid var(--swiss-gray-200);
  color: var(--swiss-black);
  text-decoration: none;
}

a.league-row:hover {
  background: var(--swiss-black);
  color: var(--swiss-white);
}

a.league-row:hover .league-rank,
a.league-row:hover .league-hot {
  color: inherit;
}

.league-collapsed {
  display: none;
}

.league-head {
  min-height: 40px;
  align-items: end;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--swiss-black);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.league-sort {
  padding: 0;
  background: none;
  border: none;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
}

.league-sort:hover,
.league-sort.active {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.league-sort.league-subject {
  font-size: inherit;
  text-align: left;
}

.league-rank {
  padding-left: 4px;
  font-size: var(--font-size-sm);
  color: var(--swiss-gray-500);
}

.league-subject {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.league-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.league-mentions {
  font-weight: 700;
}

.league-hot {
  color: var(--swiss-red-text);
  font-weight: 700;
}

/* A row without a side: one lane across the bar and both share columns. */
.league-roles {
  grid-column: span 3;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
  color: var(--swiss-gray-700);
}

.league-roles strong,
.league-tag {
  color: var(--swiss-black);
}

.league-tag {
  flex-shrink: 0;
  padding: 3px 6px;
  border: 1px solid currentColor;
  font-size: 10px;
  font-weight: 700;
  line-height: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.league-dot {
  color: #bbb;
}

a.league-row:hover .league-roles {
  color: #ccc;
}

a.league-row:hover .league-roles strong,
a.league-row:hover .league-tag {
  color: var(--swiss-white);
}

.league-bar {
  display: flex;
  justify-content: space-between;
  height: 10px;
  background: #d9d9d9;
}

.league-bar-hostile {
  background: var(--swiss-red);
}

.league-bar-friendly {
  background: var(--swiss-black);
}

a.league-row:hover .league-bar-friendly {
  background: var(--swiss-white);
}

a.league-row:hover .league-bar {
  background: #555;
}

.league-spark-cell {
  text-align: center;
}

.league-spark {
  width: 140px;
  height: 28px;
  vertical-align: middle;
}

.league-frame {
  padding-right: 4px;
  text-align: right;
  font-size: var(--font-size-sm);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.league-head .league-frame {
  font-size: inherit;
  letter-spacing: inherit;
}

.league-empty {
  color: var(--swiss-gray-500);
}

/* Sorted by share: where the ranking stops and the rows with too few mentions to rank begin */
.league-divider {
  padding: calc(var(--grid-unit) * 1.5) 0 12px;
  border-bottom: 2px solid var(--swiss-black);
  font-size: var(--font-size-sm);
  color: var(--swiss-gray-700);
}

/* Their percentages are printed but carry no weight: not bold, not red */
.league-unranked .league-num:not(.league-mentions),
.league-unranked .league-sentence .league-hot,
.league-unranked .league-num.league-hot {
  color: var(--swiss-gray-500);
  font-weight: 400;
}

.league-status {
  padding: calc(var(--grid-unit) * 2) 0;
  color: var(--swiss-gray-700);
}

.league-more {
  display: block;
  width: 100%;
  padding: var(--grid-unit) 0;
  background: none;
  border: none;
  border-bottom: 2px solid var(--swiss-black);
  color: var(--swiss-black);
  font-size: var(--font-size-sm);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: left;
  cursor: pointer;
}

.league-more:hover {
  color: var(--swiss-red-text);
}

.league-footer {
  padding-top: calc(var(--grid-unit) * 2);
  font-size: var(--font-size-xs);
  color: #666;
}

.league-sortselect,
.league-short {
  display: none;
}

/* At desktop width the row is a grid of bare numbers under column headings that nothing ties them to. The sentence
   says the same in words, so it stays in the accessibility tree and the cells are aria-hidden. */
@media (min-width: 1025px) {
  .league-sentence {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}

/* Below desktop width the columns collapse into a sentence per row; nothing but the sparkline is dropped. */
@media (max-width: 1024px) {
  .league-head,
  .league-row > .league-num,
  .league-row > .league-roles,
  .league-spark-cell,
  .league-frame {
    display: none;
  }

  /* Controls: underlined text tabs, then one line with the sort select and the main-subject switch */
  .league-controls {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding-bottom: 0;
  }

  .league-filters {
    /* one line on a phone; at 320px the four tabs do not fit and take a second line rather than scroll the page */
    flex-wrap: wrap;
    gap: 12px 20px;
    border-bottom: 1px solid var(--swiss-gray-200);
  }

  .league-filter,
  .league-filter.active {
    padding: 0 0 10px;
    margin: 0 0 -1px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--swiss-gray-500);
    font-size: 13px;
    letter-spacing: 0.06em;
  }

  .league-filter.active {
    border-bottom-color: var(--swiss-black);
    color: var(--swiss-black);
  }

  .league-utility {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 2px solid var(--swiss-black);
    font-size: 13px;
  }

  .league-sortselect {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #666;
  }

  .league-sortselect select {
    padding: 0 0 1px;
    background: none;
    border: none;
    border-bottom: 1px solid var(--swiss-black);
    border-radius: 0;
    color: var(--swiss-black);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
  }

  .league-salient {
    flex-direction: row-reverse;
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 0;
    text-transform: none;
  }

  .league-salient input {
    appearance: none;
    -webkit-appearance: none;
    position: relative;
    flex-shrink: 0;
    width: 34px;
    height: 20px;
    border-radius: 10px;
    background: var(--swiss-neutral-bar);
    cursor: pointer;
    transition: background 0.15s;
  }

  .league-salient input::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--swiss-white);
    transition: transform 0.15s;
  }

  .league-salient input:checked {
    background: var(--swiss-black);
  }

  .league-salient input:checked::after {
    transform: translateX(14px);
  }

  .league-salient input:focus-visible {
    outline: 2px solid var(--swiss-black);
    outline-offset: 2px;
  }

  .league-row {
    grid-template-columns: 24px minmax(0, 1fr);
    align-items: baseline;
    column-gap: 10px;
    row-gap: 10px;
    padding: 20px 0;
  }

  .league-rank {
    padding-left: 0;
    font-size: 12px;
  }

  .league-subject {
    font-size: 30px;
    line-height: 1;
    letter-spacing: -0.03em;
  }

  .league-sentence,
  .league-bar-cell {
    grid-column: 1 / -1;
  }

  .league-sentence {
    display: block;
    font-size: 15px;
    line-height: 22px;
  }

  .league-bar {
    height: 8px;
  }

  .league-empty .league-bar-cell {
    display: none;
  }
}

@media (max-width: 640px) {
  .league-long {
    display: none;
  }

  .league-short {
    display: inline;
  }

  .league-masthead,
  .league-hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .league-meta {
    text-align: left;
  }

  .league-hero {
    padding: 32px 0 24px;
  }

  .league-subject {
    font-size: 26px;
  }
}

/* Load More Button */
.load-more-container {
  display: flex;
  justify-content: center;
  margin: calc(var(--grid-unit) * 2) 0;
}

.load-more-btn {
  padding: calc(var(--grid-unit) / 2) calc(var(--grid-unit) * 2);
  background: var(--swiss-white);
  color: var(--swiss-black);
  border: 2px solid var(--swiss-black);
  font-size: var(--font-size-base);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.load-more-btn:hover:not(:disabled) {
  background: var(--swiss-black);
  color: var(--swiss-white);
}

.load-more-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.no-articles {
  text-align: center;
  padding: calc(var(--grid-unit) * 3);
  color: var(--swiss-gray-700);
  font-size: var(--font-size-lg);
}

.meta-chip {
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid currentColor;
  opacity: 0.65;
  white-space: nowrap;
}

/* The page's numbers in words, under the headline. Also the text of the meta description. */
.subject-lede {
  max-width: 820px;
  padding-top: var(--grid-unit);
  font-size: var(--font-size-lg);
  line-height: 1.45;
}

.subject-lede a {
  color: var(--swiss-black);
}

.site-footer {
  width: 100%;
  max-width: 1296px;
  margin: 0 auto;
  padding: calc(var(--grid-unit) * 2) var(--grid-unit) calc(var(--grid-unit) * 3);
  font-size: var(--font-size-sm);
  color: var(--swiss-gray-700);
}

.site-footer p {
  max-width: 820px;
  padding-top: var(--grid-unit);
  border-top: 1px solid var(--swiss-gray-300);
}

.site-footer a {
  color: var(--swiss-black);
}

/* Text pages (methodology) */
.prose-page {
  width: 100%;
  max-width: 1296px;
  margin: 0 auto;
  padding: 56px var(--grid-unit) calc(var(--grid-unit) * 2);
  line-height: 1.6;
}

.prose-page > * {
  max-width: 720px;
}

.prose-page h1 {
  max-width: 1100px;
  font-size: clamp(36px, 5.6vw, 72px);
  line-height: 1.06;
  letter-spacing: -0.04em;
}

.prose-page h2 {
  margin-top: calc(var(--grid-unit) * 2);
  padding-top: 12px;
  border-top: 2px solid var(--swiss-black);
  font-size: var(--font-size-xl);
  letter-spacing: -0.02em;
}

.prose-page p,
.prose-page ul,
.prose-page table {
  margin-top: 16px;
}

.prose-page .prose-lede {
  margin-top: var(--grid-unit);
  font-size: var(--font-size-lg);
  line-height: 1.45;
}

.prose-page ul {
  padding-left: 20px;
}

.prose-page li + li {
  margin-top: 8px;
}

.prose-page table {
  width: 100%;
  border-collapse: collapse;
}

.prose-page th,
.prose-page td {
  padding: 8px 0;
  border-bottom: 1px solid var(--swiss-gray-300);
  text-align: left;
  font-weight: 400;
}

.prose-page td {
  text-align: right;
  font-weight: 700;
  white-space: nowrap;
}

/* "98% precision, 96% recall" on one line is 10px wider than a 320px screen (or a desktop at 400% zoom) */
@media (max-width: 360px) {
  .prose-page td {
    white-space: normal;
  }
}

.prose-page code {
  font-family: ui-monospace, Menlo, monospace;
  font-size: 0.9em;
}

@media (max-width: 640px) {
  .subject-lede,
  .prose-page .prose-lede {
    font-size: var(--font-size-base);
  }

  .prose-page {
    padding-top: 32px;
  }
}

/* Machine-written coverage brief on a subject page */
.brief-section {
  margin-bottom: calc(var(--grid-unit) * 3);
}

.brief-section .section-title p {
  max-width: 640px;
  margin: 0 auto;
}

.brief-section .section-title a {
  color: inherit;
}

.brief-text {
  max-width: 720px;
  margin: 0 auto;
  line-height: 1.6;
}

.brief-text p + p {
  margin-top: 16px;
}
