@import url('./public-tokens.css?v=20260716-public-system1');

:root {
  --accent-primary: var(--accent);
  --surface-raised: var(--panel-bg);
  --surface-muted: var(--bg-grey);
  --border-light: var(--border);
  --border-subtle: var(--hairline-soft);
  --shadow-sm: var(--shadow);
  --shadow-md: var(--liquid-shadow-hover);
  --text-muted: var(--text-secondary);
}

.topics-shell,
.topic-detail-shell {
  max-width: 1240px;
}

.topics-hero {
  padding-bottom: 38px;
}

.topics-hero h1 {
  max-width: 860px;
  letter-spacing: -0.055em;
}

.topics-hero .lead {
  max-width: 790px;
}

.topics-method {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 26px;
  margin-top: 28px;
  color: var(--text-secondary);
  font-size: .85rem;
  font-weight: 650;
}

.topics-method span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.topics-method i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-secondary);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent-secondary) 15%, transparent);
}

.topics-content {
  max-width: none;
}

.topics-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 12px;
  margin-bottom: 14px;
}

.topics-toolbar input,
.topics-toolbar select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--border-light);
  border-radius: 13px;
  padding: 0 15px;
  color: var(--text-primary);
  background: var(--surface-raised);
  font: inherit;
  box-shadow: var(--shadow-sm);
}

.topic-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin: 26px 0 68px;
  padding: 0;
  list-style: none;
}

.topic-card-wrap[hidden] {
  display: none;
}

.topic-card {
  display: flex;
  min-height: 100%;
  flex-direction: column;
  padding: 26px;
  border: 1px solid var(--border-light);
  border-radius: 20px;
  color: inherit;
  background:
    radial-gradient(circle at 93% 3%, color-mix(in srgb, var(--accent-secondary) 11%, transparent), transparent 34%),
    var(--surface-raised);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.topic-card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--accent-primary) 35%, var(--border-light));
  box-shadow: var(--shadow-md);
}

.topic-card-top,
.topic-title-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
}

.topic-card-top {
  justify-content: space-between;
  margin-bottom: 22px;
}

.topic-category,
.topic-state,
.topic-change-badge {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  border-radius: 999px;
  padding: 0 10px;
  font-size: .69rem;
  font-weight: 800;
  letter-spacing: .055em;
  text-transform: uppercase;
}

.topic-category {
  color: var(--accent-primary);
  background: color-mix(in srgb, var(--accent-primary) 10%, transparent);
}

.topic-state {
  gap: 6px;
  color: #17775f;
  background: color-mix(in srgb, var(--accent-secondary) 16%, transparent);
}

.topic-state::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-secondary);
}

.topic-state.is-paused {
  color: #96620a;
  background: color-mix(in srgb, #e2a329 15%, transparent);
}

.topic-state.is-paused::before {
  background: #e2a329;
}

.topic-card-title {
  margin-bottom: 10px;
  color: var(--text-primary);
  font-size: clamp(1.4rem, 2.2vw, 1.82rem);
  font-weight: 780;
  letter-spacing: -.035em;
}

.topic-card-question {
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.48;
}

.topic-card-summary {
  margin-top: 10px;
  color: var(--text-secondary);
  font-size: .88rem;
  line-height: 1.55;
}

.topic-card-data {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin: 28px 0 18px;
  padding-top: 20px;
  border-top: 1px solid var(--border-subtle);
}

.topic-score {
  display: flex;
  align-items: baseline;
  gap: 5px;
}

.topic-score strong {
  font-size: 2rem;
  letter-spacing: -.06em;
}

.topic-score small,
.topic-run-meta small {
  color: var(--text-muted);
  font-size: .72rem;
}

.topic-score.is-high strong { color: #168768; }
.topic-score.is-mid strong { color: #bb7811; }
.topic-score.is-low strong { color: #c14b56; }

.topic-run-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: right;
}

.topic-run-meta strong {
  font-size: .8rem;
}

.topic-change {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
  min-height: 42px;
  color: var(--text-secondary);
  font-size: .78rem;
  line-height: 1.45;
}

.topic-change i {
  width: 8px;
  height: 8px;
  margin-top: 3px;
  border-radius: 50%;
  background: var(--text-muted);
}

.topic-change.is-minor i { background: #e2a329; }
.topic-change.is-major i { background: #d84b5d; }
.topic-change.is-stable i { background: var(--accent-secondary); }

.topic-card-link {
  display: flex;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 19px;
  color: var(--accent-primary);
  font-size: .8rem;
  font-weight: 750;
}

.topic-explainer {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 60px;
  padding: 42px;
  border-radius: 22px;
  color: #f8f9fb;
  background: #171b25;
}

.topic-explainer h2 {
  max-width: 560px;
  margin: 8px 0 0;
  color: #fff;
  font-size: clamp(1.6rem, 3vw, 2.5rem);
  letter-spacing: -.04em;
}

.topic-explainer .eyebrow {
  color: #75d4bb;
}

.topic-explainer-copy {
  align-self: end;
}

.topic-explainer-copy p {
  margin-top: 0;
  color: #b9c0cf;
  line-height: 1.65;
}

.topic-explainer-copy a {
  color: #fff;
  font-weight: 700;
}

/* Detail */
.topic-detail-header {
  padding: 54px 0 34px;
}

.topic-breadcrumb {
  display: flex;
  gap: 9px;
  margin-bottom: 30px;
  color: var(--text-muted);
  font-size: .78rem;
  font-weight: 650;
}

.topic-breadcrumb a {
  color: var(--accent-primary);
}

.topic-title-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 160px;
  gap: 45px;
  align-items: end;
}

.topic-title-meta {
  color: var(--text-muted);
  font-size: .74rem;
  font-weight: 650;
}

.topic-title-meta > span:not(.topic-state)::before {
  content: "·";
  margin-right: 9px;
}

.topic-detail-header h1 {
  max-width: 850px;
  margin: 18px 0 10px;
  font-size: clamp(2.7rem, 7vw, 5.5rem);
  line-height: .98;
  letter-spacing: -.065em;
}

.topic-lead-question {
  max-width: 820px;
  margin: 0;
  color: var(--text-primary);
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  font-weight: 600;
  line-height: 1.5;
}

.topic-summary {
  max-width: 780px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.topic-current-score {
  display: flex;
  aspect-ratio: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-light);
  border-radius: 50%;
  background: var(--surface-raised);
  box-shadow: var(--shadow-md);
}

.topic-current-score span,
.topic-current-score small {
  color: var(--text-muted);
  font-size: .67rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.topic-current-score strong {
  font-size: 3.2rem;
  line-height: 1;
  letter-spacing: -.07em;
}

.topic-current-score.is-high strong { color: #168768; }
.topic-current-score.is-mid strong { color: #bb7811; }
.topic-current-score.is-low strong { color: #c14b56; }

.topic-version-notice {
  margin-top: 28px;
  border-left: 3px solid #e2a329;
  border-radius: 0 10px 10px 0;
  padding: 12px 16px;
  color: var(--text-secondary);
  background: color-mix(in srgb, #e2a329 10%, transparent);
  font-size: .83rem;
}

.topic-version-notice a {
  margin-left: 8px;
  font-weight: 700;
}

.topic-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 350px;
  gap: 24px;
  align-items: start;
  padding-bottom: 70px;
}

.topic-main-column,
.topic-side-column {
  display: grid;
  gap: 20px;
}

.topic-side-column {
  position: sticky;
  top: 18px;
}

.topic-panel,
.topic-follow-card,
.topic-timeline-card,
.topic-side-link-card {
  border: 1px solid var(--border-light);
  border-radius: 20px;
  background: var(--surface-raised);
  box-shadow: var(--shadow-sm);
}

.topic-panel {
  padding: clamp(24px, 4vw, 42px);
}

.topic-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}

.topic-panel-head h2 {
  margin: 3px 0 0;
  font-size: 1.45rem;
  letter-spacing: -.03em;
}

.topic-change-badge {
  color: var(--text-secondary);
  background: var(--surface-muted);
}

.topic-change-badge.is-minor {
  color: #96620a;
  background: color-mix(in srgb, #e2a329 14%, transparent);
}

.topic-change-badge.is-major {
  color: #b43647;
  background: color-mix(in srgb, #d84b5d 13%, transparent);
}

.topic-change-summary {
  margin-bottom: 28px;
  border-left: 3px solid var(--accent-secondary);
  border-radius: 0 12px 12px 0;
  padding: 15px 18px;
  background: color-mix(in srgb, var(--accent-secondary) 8%, transparent);
}

.topic-change-summary.is-minor {
  border-left-color: #e2a329;
  background: color-mix(in srgb, #e2a329 8%, transparent);
}

.topic-change-summary.is-major {
  border-left-color: #d84b5d;
  background: color-mix(in srgb, #d84b5d 8%, transparent);
}

.topic-change-summary span {
  color: var(--text-muted);
  font-size: .67rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.topic-change-summary p {
  margin: 5px 0 0;
  font-size: .88rem;
  line-height: 1.55;
}

.topic-consensus {
  color: var(--text-primary);
  font-size: .96rem;
  line-height: 1.72;
}

.topic-consensus > :first-child { margin-top: 0; }
.topic-consensus > :last-child { margin-bottom: 0; }
.topic-consensus h2 { margin-top: 1.8em; font-size: 1.28rem; }
.topic-consensus h3 { margin-top: 1.5em; font-size: 1.05rem; }
.topic-consensus a { color: var(--accent-primary); }
.topic-consensus table { width: 100%; border-collapse: collapse; }
.topic-consensus th, .topic-consensus td { border: 1px solid var(--border-light); padding: 9px; text-align: left; }

.topic-models {
  margin-top: 32px;
  padding-top: 22px;
  border-top: 1px solid var(--border-subtle);
}

.topic-models > span {
  color: var(--text-muted);
  font-size: .7rem;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.topic-models div {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.topic-models div span {
  border: 1px solid var(--border-light);
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--text-secondary);
  background: var(--surface-muted);
  font-size: .7rem;
}

.opinion-change-list {
  display: grid;
  gap: 12px;
}

.opinion-change {
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 18px;
  background: var(--surface-muted);
}

.opinion-change-model {
  margin-bottom: 12px;
  font-size: .76rem;
  font-weight: 800;
}

.opinion-direction {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 10px;
  align-items: center;
  margin-bottom: 13px;
  color: var(--text-secondary);
  font-size: .73rem;
}

.opinion-direction span {
  padding: 8px 10px;
  border-radius: 9px;
  background: var(--surface-raised);
}

.opinion-direction span:last-child {
  color: var(--text-primary);
  font-weight: 650;
}

.opinion-change .prose {
  color: var(--text-secondary);
  font-size: .82rem;
  line-height: 1.55;
}

.opinion-change .prose p {
  margin: 0;
}

.evidence-run-list {
  display: grid;
  gap: 28px;
}

.evidence-run {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 18px;
}

.evidence-run-date {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 4px;
}

.evidence-run-date span {
  font-size: .75rem;
  font-weight: 750;
}

.evidence-run-date small {
  color: var(--text-muted);
  font-size: .68rem;
}

.evidence-cards {
  display: grid;
  gap: 10px;
}

.evidence-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px 14px;
  border: 1px solid var(--border-subtle);
  border-radius: 13px;
  padding: 15px;
  color: inherit;
  background: var(--surface-muted);
  text-decoration: none;
  transition: border-color .15s ease, background .15s ease;
}

.evidence-card:hover {
  border-color: color-mix(in srgb, var(--accent-primary) 35%, var(--border-light));
  background: var(--surface-raised);
}

.evidence-card .evidence-type {
  grid-column: 1 / -1;
  color: var(--accent-primary);
  font-size: .63rem;
  font-weight: 850;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.evidence-card strong {
  font-size: .85rem;
}

.evidence-card > span:not(.evidence-type) {
  color: var(--text-muted);
  font-size: .67rem;
}

.evidence-card p {
  grid-column: 1 / -1;
  margin: 6px 0 0;
  color: var(--text-secondary);
  font-size: .75rem;
  line-height: 1.5;
}

.evidence-card b {
  grid-column: 2;
  grid-row: 2 / span 2;
  align-self: center;
  color: var(--accent-primary);
  font-size: .67rem;
}

.evidence-x .evidence-type { color: var(--text-primary); }
.evidence-official .evidence-type { color: #168768; }
.evidence-github .evidence-type { color: #7b61c8; }
.evidence-press .evidence-type { color: #bb7811; }

.topic-follow-card,
.topic-timeline-card,
.topic-side-link-card {
  padding: 22px;
}

.topic-follow-card {
  color: #f7f8fb;
  background: #171b25;
  border-color: #171b25;
}

.topic-follow-card .eyebrow {
  color: #75d4bb;
}

.topic-follow-card h2 {
  margin: 7px 0 8px;
  color: #fff;
  font-size: 1.3rem;
  letter-spacing: -.035em;
}

.topic-follow-card > p:not(.eyebrow):not(.topic-follow-status) {
  color: #b9c0cf;
  font-size: .79rem;
  line-height: 1.55;
}

.topic-follow-card form {
  display: grid;
  gap: 8px;
  margin-top: 17px;
}

.topic-follow-card input,
.topic-follow-card button {
  min-height: 44px;
  border-radius: 10px;
  font: inherit;
}

.topic-follow-card input {
  border: 1px solid #424857;
  padding: 0 12px;
  color: #fff;
  background: #222733;
}

.topic-follow-card button {
  border: 0;
  color: #102019;
  background: #75d4bb;
  font-size: .8rem;
  font-weight: 800;
  cursor: pointer;
}

.topic-follow-card button:disabled {
  opacity: .6;
}

.topic-follow-status {
  min-height: 18px;
  margin: 10px 0 0;
  color: #aab2c1;
  font-size: .7rem;
  line-height: 1.45;
}

.topic-follow-status.is-error {
  color: #ff9eaa;
}

.topic-timeline-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topic-timeline-head > span {
  color: var(--text-muted);
  font-size: .65rem;
  font-weight: 750;
  text-transform: uppercase;
}

.topic-timeline {
  position: relative;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.topic-timeline::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 10px;
  bottom: 18px;
  width: 1px;
  background: var(--border-light);
}

.topic-timeline li {
  position: relative;
}

.topic-timeline a {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) 54px;
  gap: 10px;
  padding: 9px 0 13px;
  color: inherit;
  text-decoration: none;
}

.timeline-dot {
  z-index: 1;
  width: 11px;
  height: 11px;
  margin-top: 3px;
  border: 3px solid var(--surface-raised);
  border-radius: 50%;
  background: var(--accent-secondary);
  box-shadow: 0 0 0 1px var(--border-light);
}

.topic-timeline .is-minor .timeline-dot { background: #e2a329; }
.topic-timeline .is-major .timeline-dot { background: #d84b5d; }
.topic-timeline .is-selected .timeline-dot { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-primary) 18%, transparent); }

.timeline-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.timeline-copy strong {
  font-size: .75rem;
}

.timeline-copy small {
  overflow: hidden;
  color: var(--text-muted);
  font-size: .65rem;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timeline-copy em {
  color: var(--accent-primary);
  font-size: .61rem;
  font-style: normal;
}

.timeline-score {
  text-align: right;
}

.timeline-score strong {
  font-size: .8rem;
}

.timeline-score i {
  display: block;
  height: 3px;
  margin-top: 6px;
  border-radius: 9px;
  background: var(--border-subtle);
}

.timeline-score b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent-primary);
}

.topic-side-link-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.topic-side-link-card span {
  color: var(--text-muted);
  font-size: .69rem;
}

.topic-side-link-card strong {
  font-size: .9rem;
}

.topic-side-link-card a {
  margin-top: 8px;
  color: var(--accent-primary);
  font-size: .75rem;
  font-weight: 750;
}

@media (max-width: 980px) {
  .topic-detail-layout {
    grid-template-columns: 1fr;
  }

  .topic-side-column {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topic-timeline-card {
    grid-row: span 2;
  }
}

@media (max-width: 760px) {
  .topics-toolbar,
  .topic-grid,
  .topic-explainer,
  .topic-title-row,
  .topic-side-column {
    grid-template-columns: 1fr;
  }

  .topic-current-score {
    width: 130px;
  }

  .topic-explainer {
    gap: 25px;
    padding: 28px;
  }

  .evidence-run {
    grid-template-columns: 1fr;
    gap: 9px;
  }

  .evidence-run-date {
    flex-direction: row;
    align-items: center;
  }

  .topic-detail-header h1 {
    font-size: clamp(2.7rem, 14vw, 4.2rem);
  }
}

@media (max-width: 520px) {
  .topic-card {
    padding: 20px;
  }

  .topic-card-data {
    align-items: flex-start;
    flex-direction: column;
  }

  .topic-run-meta {
    text-align: left;
  }

  .topic-panel {
    border-radius: 16px;
    padding: 21px;
  }

  .opinion-direction {
    grid-template-columns: 1fr;
  }

  .opinion-direction b {
    transform: rotate(90deg);
    text-align: center;
  }

  .evidence-card {
    grid-template-columns: 1fr;
  }

  .evidence-card b {
    grid-column: 1;
    grid-row: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .topic-card {
    transition: none;
  }
}
