:root {
  --page: #f3f7fa;
  --surface: #ffffff;
  --ink: #16374c;
  --muted: #5f7482;
  --line: #cfdee7;
  --brand-blue: #0085d0;
  --accent: #0078bb;
  --accent-soft: #dff1fb;
  --success: #147fae;
  --warning: #9b6a21;
  --danger: #a4433f;
  --radius: 10px;
  --shadow: 0 18px 50px rgba(0, 70, 110, 0.09);
  --max: 1360px;
  color-scheme: light;
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100dvh;
  background: var(--page);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.62;
  text-rendering: optimizeLegibility;
}

button,
input,
select {
  font: inherit;
}

button,
a,
input,
select {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 68%, white);
  outline-offset: 3px;
}

button:active,
.button:active,
.direction-link:active {
  transform: scale(0.98);
}

a {
  color: inherit;
  text-decoration: none;
}

p,
h1,
h2,
h3 {
  margin-top: 0;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 100;
  padding: 8px 12px;
  background: var(--accent);
  color: white;
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--page) 94%, transparent);
  backdrop-filter: blur(12px);
}

.header-inner {
  width: min(calc(100% - 48px), var(--max));
  min-height: 68px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 30px;
}

.header-inner.no-actions {
  grid-template-columns: auto 1fr;
}

.brand {
  color: var(--brand-blue);
  font-weight: 760;
  letter-spacing: -0.04em;
  white-space: nowrap;
  font-size: 20px;
}

.brand small {
  margin-left: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.main-nav,
.header-actions,
.filter-row,
.meta-line,
.inline-stats,
.state-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.main-nav {
  justify-content: center;
  gap: 24px;
}

.main-nav a {
  color: var(--muted);
  font-size: 14px;
}

.main-nav a[aria-current="page"],
.main-nav a:hover {
  color: var(--accent);
}

.header-actions {
  justify-content: flex-end;
}

.button,
button.button {
  min-height: 38px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  padding: 8px 15px;
  background: var(--accent);
  color: white;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, color 160ms ease;
}

.button.secondary {
  border-color: var(--line);
  background: transparent;
  color: var(--ink);
}

.button.secondary:hover {
  border-color: var(--ink);
}

.button.text {
  min-height: auto;
  border: 0;
  border-radius: 0;
  padding: 2px 0;
  background: transparent;
  color: var(--accent);
}

.page-shell {
  width: min(calc(100% - 48px), var(--max));
  margin: 0 auto;
  padding: 48px 0 80px;
}

.eyebrow {
  margin-bottom: 10px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 780;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.display-title {
  max-width: 900px;
  margin-bottom: 18px;
  font-size: clamp(42px, 6vw, 76px);
  line-height: 1.04;
  letter-spacing: -0.06em;
}

.lede {
  max-width: 65ch;
  color: var(--muted);
  font-size: 17px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.section-heading h2 {
  margin-bottom: 0;
  font-size: clamp(25px, 3vw, 36px);
  line-height: 1.16;
  letter-spacing: -0.04em;
}

.section-note {
  color: var(--muted);
  font-size: 13px;
}

.filter-row {
  flex-wrap: wrap;
  margin: 26px 0;
}

.filter-button {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 13px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.filter-button:hover,
.filter-button[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
}

.search-field {
  width: min(340px, 100%);
  min-height: 40px;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 7px 2px;
  background: transparent;
  color: var(--ink);
}

.search-field::placeholder {
  color: color-mix(in srgb, var(--muted) 75%, white);
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 9px;
  background: color-mix(in srgb, var(--line) 58%, transparent);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
}

.tag.accent {
  background: var(--accent-soft);
  color: var(--accent);
}

.tag.strong {
  background: var(--accent);
  color: white;
}

.meta-line {
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
}

.meta-line > * + *::before {
  content: "";
  display: inline-block;
  width: 3px;
  height: 3px;
  margin: 0 9px 3px 0;
  border-radius: 50%;
  background: currentColor;
  vertical-align: middle;
}

.status-region {
  margin: 22px 0;
}

.status-message {
  display: none;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 36px 0;
  color: var(--muted);
}

.status-message.is-visible {
  display: block;
}

.skeleton {
  height: 18px;
  margin: 10px 0;
  background: linear-gradient(90deg, var(--line), var(--surface), var(--line));
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}

.skeleton.short {
  width: 46%;
}

@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}

.prototype-note {
  margin: 48px 0 0;
  border-top: 1px solid var(--line);
  padding-top: 16px;
  color: var(--muted);
  font-size: 12px;
}

.prototype-note a {
  color: var(--accent);
}

/* Unified portal */
.theme-portal .page-shell {
  padding-top: 28px;
}

.theme-portal .site-header {
  background: color-mix(in srgb, var(--page) 95%, transparent);
}

.portal-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 48px;
  align-items: end;
  padding: 20px 0 32px;
  border-bottom: 3px double var(--ink);
}

.portal-hero .display-title {
  max-width: 860px;
  margin-bottom: 16px;
  font-size: clamp(44px, 5.2vw, 68px);
}

.portal-hero .lede {
  margin-bottom: 0;
}

.portal-date {
  border-left: 1px solid var(--line);
  padding-left: 30px;
}

.portal-date strong {
  display: block;
  font-family: "Songti SC", "STSong", serif;
  font-size: 44px;
  line-height: 1;
  letter-spacing: -0.05em;
}

.portal-date span,
.portal-date p {
  color: var(--muted);
  font-size: 13px;
}

.portal-date p {
  margin: 18px 0 0;
}

.topic-strip {
  display: flex;
  align-items: center;
  gap: 24px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
  white-space: nowrap;
}

.portal-digest {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
}

.portal-digest article {
  min-width: 0;
  border-right: 1px solid var(--line);
  padding: 18px 22px 18px 0;
}

.portal-digest article + article {
  padding-left: 22px;
}

.portal-digest article:last-child {
  border-right: 0;
}

.portal-digest strong,
.portal-digest span {
  display: block;
}

.portal-digest strong {
  margin-bottom: 2px;
  font-family: "Songti SC", "STSong", serif;
  font-size: 26px;
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.portal-digest span {
  color: var(--muted);
  font-size: 12px;
}

.topic-strip span {
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.topic-strip a {
  color: var(--muted);
  font-size: 13px;
}

.topic-strip a:hover {
  color: var(--ink);
}

[data-live-news][aria-busy="true"] {
  opacity: 0.64;
  transition: opacity 180ms ease;
}

.portal-feature-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 38px;
  padding: 34px 0 48px;
}

.portal-feature-main {
  display: grid;
  align-content: start;
  gap: 18px;
}

.portal-lead {
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  padding: 28px 30px;
  background: color-mix(in srgb, var(--surface) 76%, transparent);
}

.portal-lead h2 {
  max-width: 17ch;
  margin: 14px 0 16px;
  font-family: "Songti SC", "STSong", "Noto Serif CJK SC", serif;
  font-size: clamp(36px, 4.2vw, 54px);
  font-weight: 650;
  line-height: 1.08;
  letter-spacing: -0.045em;
}

.portal-lead-summary {
  max-width: 60ch;
  margin-bottom: 18px;
  color: #486778;
  font-size: 17px;
}

.portal-explainer {
  max-width: 68ch;
  border-left: 3px solid var(--accent);
  padding: 4px 0 4px 18px;
  color: var(--muted);
}

.portal-briefs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.portal-briefs a {
  min-height: 118px;
  border-right: 1px solid var(--line);
  padding: 15px 16px 14px 0;
  transition: color 160ms ease, background 160ms ease;
}

.portal-briefs a + a {
  padding-left: 16px;
}

.portal-briefs a:last-child {
  border-right: 0;
  padding-right: 0;
}

.portal-briefs a:hover {
  color: var(--accent);
  background: color-mix(in srgb, var(--surface) 44%, transparent);
}

.portal-briefs span,
.portal-briefs small {
  display: block;
  color: var(--muted);
}

.portal-briefs span {
  margin-bottom: 7px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.portal-briefs strong {
  display: block;
  font-size: 14px;
  line-height: 1.45;
}

.portal-briefs small {
  margin-top: 6px;
  font-size: 11px;
  line-height: 1.5;
}

.portal-rail {
  align-self: start;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}

.portal-rail-head {
  padding: 16px 0 8px;
}

.portal-rail-head h2 {
  margin-bottom: 0;
  font-size: 24px;
  letter-spacing: -0.04em;
}

.portal-rail-head > p:last-child {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.portal-rail-list[aria-busy="true"] {
  opacity: 0.62;
}

.portal-rail-item {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 15px 0;
  transition: color 160ms ease, padding-left 160ms ease;
}

.portal-rail-item:last-child {
  border-bottom: 0;
}

.portal-rail-item:hover {
  padding-left: 6px;
  color: var(--accent);
}

.portal-rail-item > span {
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
}

.portal-rail-item strong {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
  line-height: 1.42;
}

.portal-rail-item p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.portal-rail-item small {
  display: block;
  margin-top: 6px;
  color: color-mix(in srgb, var(--muted) 80%, white);
  font-size: 10px;
}

.portal-section {
  border-top: 1px solid var(--ink);
  padding: 42px 0 52px;
}

.portal-section-actions {
  display: flex;
  align-items: center;
  gap: 24px;
}

.section-link {
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.portal-feed .filter-row {
  margin: 18px 0 20px;
}

.theme-portal .story-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.theme-portal .story-row {
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 14px;
  border-right: 1px solid var(--line);
  padding: 20px 22px 20px 0;
}

.theme-portal .story-row:nth-child(even) {
  border-right: 0;
  padding-right: 0;
  padding-left: 22px;
}

.theme-portal .story-row h3 {
  font-size: 18px;
}

.theme-portal .story-signals {
  grid-column: 2;
  flex-direction: row;
  flex-wrap: wrap;
}

.trend-section {
  padding-bottom: 56px;
}

.trend-section .section-heading {
  align-items: end;
}

.trend-section .section-note {
  margin: 0;
}

.trend-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.trend-grid[aria-busy="true"] {
  opacity: 0.7;
}

.trend-card {
  --trend-accent: var(--ink);
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 1px solid var(--line);
  border-top: 3px solid var(--trend-accent);
  border-radius: 14px;
  padding: 18px;
  background: color-mix(in srgb, var(--surface) 84%, var(--page));
  color: var(--ink);
  box-shadow: 0 12px 28px rgba(0, 77, 121, 0.08);
}

.trend-card.is-github {
  --trend-accent: #2b5d78;
}

.trend-card.is-juejin {
  --trend-accent: var(--brand-blue);
}

.trend-card.is-hackernews {
  --trend-accent: #62b1dd;
}

.trend-card-head {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 18px;
}

.trend-logo {
  display: inline-grid;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--page);
  overflow: hidden;
}

.trend-logo img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.is-juejin .trend-logo {
  background: color-mix(in srgb, #1f80ff 10%, var(--surface));
}

.is-hackernews .trend-logo {
  border-radius: 50%;
  background: #ff6800;
}

.is-hackernews .trend-logo img {
  width: 100%;
  height: 100%;
}

.trend-card-head h3 {
  margin: 0;
  font-size: 23px;
  letter-spacing: -0.04em;
}

.trend-card-head p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.trend-label {
  display: inline-block;
  margin-left: 6px;
  border-radius: 6px;
  padding: 2px 6px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  vertical-align: 3px;
}

.trend-list {
  max-height: 342px;
  margin: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  background: color-mix(in srgb, var(--page) 72%, var(--surface));
  list-style: none;
  scrollbar-color: color-mix(in srgb, var(--muted) 48%, transparent) transparent;
  scrollbar-width: thin;
}

.trend-list::-webkit-scrollbar {
  width: 7px;
}

.trend-list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: color-mix(in srgb, var(--muted) 42%, transparent);
}

.trend-item {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  border-radius: 9px;
  padding: 8px 6px;
}

.trend-item:hover {
  background: var(--surface);
}

.trend-rank {
  display: grid;
  min-height: 30px;
  place-items: center;
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.trend-item a {
  display: block;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.4;
}

.trend-info {
  margin-left: 5px;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.portal-scenario-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line);
}

.scenario-teaser {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 18px;
  align-items: start;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  padding: 22px;
}

.scenario-teaser:nth-child(odd) {
  border-right: 1px solid var(--line);
}

.scenario-teaser:nth-child(even) {
  padding-left: 22px;
}

.scenario-teaser:nth-child(3n) {
  border-right: 0;
}

.scenario-teaser-index {
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
}

.scenario-teaser h3 {
  margin-bottom: 7px;
  font-size: 21px;
  letter-spacing: -0.03em;
}

.scenario-teaser p,
.scenario-teaser div > span {
  color: var(--muted);
  font-size: 13px;
}

.scenario-teaser p {
  margin-bottom: 3px;
  color: var(--accent);
  font-weight: 700;
}

.knowledge-band {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: 54px;
  margin: 6px 0 54px;
  padding: 42px;
  background: var(--ink);
  color: white;
}

.knowledge-band h2 {
  margin-bottom: 14px;
  font-family: "Songti SC", "STSong", serif;
  font-size: clamp(36px, 4vw, 54px);
  line-height: 1.1;
  letter-spacing: -0.045em;
}

.knowledge-band > div > p:not(.eyebrow) {
  max-width: 50ch;
  color: rgba(255, 255, 255, 0.7);
}

.button.light {
  border-color: white;
  background: white;
  color: var(--ink);
}

.knowledge-definitions {
  margin: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.28);
}

.knowledge-definitions div {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  padding: 18px 0;
}

.knowledge-definitions dt {
  font-weight: 700;
}

.knowledge-definitions dd {
  margin: 0;
  color: rgba(255, 255, 255, 0.68);
  font-size: 13px;
}

.case-list {
  border-top: 1px solid var(--ink);
}

.case-row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) auto;
  gap: 30px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 24px 0;
}

.case-row > div:first-child strong {
  display: block;
  color: var(--accent);
  font-size: 34px;
  line-height: 1;
  letter-spacing: -0.05em;
}

.case-row > div:first-child span {
  color: var(--muted);
  font-size: 11px;
}

.case-row h3 {
  display: inline;
  margin: 0 0 0 9px;
  font-size: 19px;
}

.case-row p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.portal-safety-grid {
  display: grid;
  grid-template-columns: 1fr;
  margin-top: 6px;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}

.safety-panel {
  min-height: 260px;
  padding: 36px 40px 36px 0;
}

.safety-panel {
  border-right: 0;
}

.safety-panel h2 {
  max-width: 18ch;
  margin-bottom: 16px;
  font-size: clamp(29px, 3.2vw, 42px);
  line-height: 1.16;
  letter-spacing: -0.045em;
}

.safety-panel > p:not(.eyebrow) {
  max-width: 58ch;
  color: var(--muted);
}

.safety-panel {
  background: var(--accent);
  color: white;
  box-shadow: -52px 0 0 var(--accent);
}

.safety-panel .eyebrow,
.safety-panel > p:not(.eyebrow) {
  color: rgba(255, 255, 255, 0.76);
}

.light-link {
  color: white;
}

/* Direction selector */
.selector-hero {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 64px;
  align-items: end;
  padding: 30px 0 60px;
  border-bottom: 1px solid var(--line);
}

.selector-hero .lede {
  margin-bottom: 0;
}

.direction-list {
  margin-top: 20px;
}

.direction-link {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 24px;
  align-items: start;
  border-bottom: 1px solid var(--line);
  padding: 34px 0;
  transition: transform 180ms ease, color 180ms ease;
}

.direction-link:hover {
  color: var(--accent);
  transform: translateX(6px);
}

.direction-index {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.12em;
}

.direction-link h2 {
  margin-bottom: 8px;
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1.06;
  letter-spacing: -0.05em;
}

.direction-link p {
  max-width: 62ch;
  margin: 0;
  color: var(--muted);
}

.direction-arrow {
  font-weight: 700;
}

.assumption-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-top: 64px;
  border-top: 1px solid var(--line);
}

.assumption {
  min-height: 160px;
  border-right: 1px solid var(--line);
  padding: 22px 24px 22px 0;
}

.assumption + .assumption {
  padding-left: 24px;
}

.assumption:last-child {
  border-right: 0;
}

.assumption strong {
  display: block;
  margin-bottom: 8px;
}

.assumption p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

/* Editorial direction */
.theme-editorial {
  --page: #f3f7fa;
  --surface: #ffffff;
  --ink: #16374c;
  --muted: #5f7482;
  --line: #cfdee7;
  --accent: #0078bb;
  --accent-soft: #dff1fb;
}

.theme-editorial .display-title,
.theme-editorial .lead-story h2,
.theme-editorial .section-heading h2 {
  font-family: "Songti SC", "STSong", "Noto Serif CJK SC", serif;
  font-weight: 650;
}

.editorial-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 56px;
  align-items: end;
  padding: 22px 0 42px;
  border-bottom: 3px double var(--ink);
}

.issue-stamp {
  border-left: 1px solid var(--line);
  padding-left: 28px;
}

.issue-stamp strong {
  display: block;
  font-family: "Songti SC", "STSong", serif;
  font-size: 36px;
  line-height: 1;
}

.issue-stamp span {
  color: var(--muted);
  font-size: 13px;
}

.editorial-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 56px;
  padding-top: 36px;
}

.lead-story {
  margin-bottom: 42px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 36px;
}

.lead-story h2 {
  max-width: 18ch;
  margin: 18px 0;
  font-size: clamp(34px, 4.8vw, 60px);
  line-height: 1.09;
  letter-spacing: -0.04em;
}

.lead-story .takeaway {
  max-width: 66ch;
  margin: 18px 0 22px;
  color: #486778;
  font-size: 17px;
}

.story-list {
  border-top: 1px solid var(--ink);
}

.story-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 150px;
  gap: 20px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}

.story-row[hidden] {
  display: none;
}

.story-number {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

.story-row h3 {
  margin-bottom: 7px;
  font-size: 20px;
  line-height: 1.35;
  letter-spacing: -0.025em;
}

.story-row p {
  max-width: 67ch;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.story-signals {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
}

.editorial-rail section {
  margin-bottom: 36px;
  border-top: 1px solid var(--ink);
  padding-top: 14px;
}

.editorial-rail h2 {
  margin-bottom: 14px;
  font-size: 15px;
  letter-spacing: 0.02em;
}

.brief-item {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.brief-item strong {
  display: block;
  margin-bottom: 5px;
  line-height: 1.35;
}

.brief-item p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.risk-block {
  background: var(--accent);
  color: white;
  padding: 24px;
}

.risk-block p {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
}

/* Scenario direction */
.theme-scenario {
  --page: #f3f7fa;
  --surface: #ffffff;
  --ink: #16374c;
  --muted: #5f7482;
  --line: #cfdee7;
  --accent: #0078bb;
  --accent-soft: #dff1fb;
}

.theme-scenario .site-header {
  background: rgba(243, 247, 250, 0.94);
}

.scenario-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
  gap: 54px;
  align-items: end;
  padding: 24px 0 42px;
  border-bottom: 1px solid var(--ink);
}

.scenario-hero .display-title {
  margin-bottom: 0;
}

.scenario-prompt {
  border-left: 3px solid var(--accent);
  padding: 8px 0 8px 22px;
}

.scenario-prompt strong {
  display: block;
  margin-bottom: 6px;
  font-size: 18px;
}

.scenario-prompt p {
  margin: 0;
  color: var(--muted);
}

.scenario-layout {
  display: grid;
  grid-template-columns: 235px minmax(0, 1fr);
  gap: 42px;
  padding-top: 34px;
}

.department-nav {
  position: sticky;
  top: 100px;
  align-self: start;
  border-top: 1px solid var(--ink);
}

.department-nav button {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
  background: transparent;
  color: var(--muted);
  text-align: left;
  cursor: pointer;
}

.department-nav button:hover,
.department-nav button[aria-pressed="true"] {
  color: var(--accent);
  font-weight: 700;
}

.scenario-topline {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: center;
  margin-bottom: 26px;
}

.scenario-board {
  border-top: 1px solid var(--ink);
}

.scenario-row {
  display: grid;
  grid-template-columns: 1.1fr 1.25fr 0.9fr 0.7fr;
  gap: 20px;
  align-items: start;
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}

.scenario-row[hidden] {
  display: none;
}

.scenario-row.header-row {
  padding: 11px 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.scenario-row h3 {
  margin: 0 0 6px;
  font-size: 18px;
  line-height: 1.35;
}

.scenario-row p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.scenario-capability {
  color: var(--accent);
  font-weight: 700;
}

.maturity-meter {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 3px;
  margin-top: 7px;
}

.maturity-meter span {
  height: 4px;
  background: var(--line);
}

.maturity-meter.level-2 span:nth-child(-n + 2),
.maturity-meter.level-3 span:nth-child(-n + 3),
.maturity-meter.level-4 span:nth-child(-n + 4) {
  background: var(--accent);
}

.scenario-insight {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin-top: 48px;
  border-top: 1px solid var(--ink);
  padding-top: 24px;
}

.insight-block {
  min-height: 190px;
  border-right: 1px solid var(--line);
  padding-right: 30px;
}

.insight-block:last-child {
  border-right: 0;
}

.insight-block p {
  color: var(--muted);
}

/* Evidence direction */
.theme-evidence {
  --page: #f3f7fa;
  --surface: #ffffff;
  --ink: #16374c;
  --muted: #5f7482;
  --line: #cfdee7;
  --accent: #0078bb;
  --accent-soft: #dff1fb;
}

.theme-evidence .site-header {
  background: rgba(18, 58, 82, 0.96);
  color: white;
  border-bottom-color: rgba(255,255,255,0.12);
}

.theme-evidence .main-nav a,
.theme-evidence .brand small {
  color: rgba(255,255,255,0.65);
}

.theme-evidence .main-nav a:hover,
.theme-evidence .main-nav a[aria-current="page"] {
  color: white;
}

.theme-evidence .site-header .button.secondary {
  border-color: rgba(255,255,255,0.28);
  color: white;
}

.evidence-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(340px, 0.8fr);
  gap: 70px;
  align-items: end;
  padding: 32px 0 42px;
  border-bottom: 1px solid var(--ink);
}

.evidence-score {
  border-left: 1px solid var(--line);
  padding-left: 36px;
}

.evidence-score strong {
  display: block;
  color: var(--accent);
  font-size: 72px;
  line-height: 0.9;
  letter-spacing: -0.07em;
}

.evidence-score p {
  margin: 12px 0 0;
  color: var(--muted);
}

.inline-stats {
  gap: 0;
  margin: 28px 0 38px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.inline-stat {
  min-width: 170px;
  padding: 17px 24px 17px 0;
  border-right: 1px solid var(--line);
}

.inline-stat + .inline-stat {
  padding-left: 24px;
}

.inline-stat strong {
  display: block;
  font-size: 24px;
  letter-spacing: -0.04em;
}

.inline-stat span {
  color: var(--muted);
  font-size: 12px;
}

.evidence-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 50px;
}

.evidence-table {
  width: 100%;
  border-collapse: collapse;
  border-top: 1px solid var(--ink);
}

.evidence-table th,
.evidence-table td {
  padding: 18px 14px 18px 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.evidence-table th {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.07em;
}

.evidence-table tr[hidden] {
  display: none;
}

.evidence-table h3 {
  min-width: 210px;
  margin-bottom: 5px;
  font-size: 17px;
  line-height: 1.35;
}

.evidence-table p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.proof-number {
  display: block;
  color: var(--accent);
  font-size: 26px;
  font-weight: 750;
  line-height: 1;
  white-space: nowrap;
}

.proof-note {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
}

.evidence-rail section {
  margin-bottom: 30px;
  border-top: 1px solid var(--ink);
  padding-top: 14px;
}

.evidence-rail h2 {
  font-size: 14px;
}

.evidence-rail ol,
.evidence-rail ul {
  margin: 0;
  padding-left: 19px;
  color: var(--muted);
}

.evidence-rail li {
  margin-bottom: 10px;
}

/* Dialog */
dialog {
  width: min(680px, calc(100% - 32px));
  max-height: calc(100dvh - 40px);
  border: 0;
  border-radius: 14px;
  padding: 0;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: rgba(18, 25, 22, 0.55);
  backdrop-filter: blur(3px);
}

.dialog-inner {
  padding: 34px;
}

.dialog-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
}

.dialog-head h2 {
  margin-bottom: 0;
  font-size: 28px;
  line-height: 1.25;
}

.dialog-close {
  align-self: flex-start;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 11px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

.dialog-section {
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}

.dialog-section h3 {
  margin-bottom: 8px;
  font-size: 14px;
}

.dialog-section p {
  margin: 0;
  color: var(--muted);
}

.save-button[aria-pressed="true"] {
  border-color: var(--success);
  background: var(--success);
  color: white;
}

@media (max-width: 980px) {
  .header-inner {
    grid-template-columns: 1fr auto;
  }

  .main-nav {
    display: none;
  }

  .selector-hero,
  .editorial-hero,
  .scenario-hero,
  .evidence-hero,
  .editorial-layout,
  .evidence-layout,
  .portal-hero,
  .portal-feature-grid,
  .knowledge-band {
    grid-template-columns: 1fr;
  }

  .editorial-layout,
  .evidence-layout {
    gap: 44px;
  }

  .issue-stamp,
  .evidence-score,
  .portal-date {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 20px 0 0;
  }

  .portal-feature-grid,
  .knowledge-band,
  .trend-grid {
    gap: 32px;
  }

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

  .portal-digest,
  .portal-scenario-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .portal-digest article:nth-child(2) {
    border-right: 0;
  }

  .portal-digest article:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }

  .portal-rail-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 22px;
  }

  .portal-rail-item:nth-child(odd) {
    border-right: 1px solid var(--line);
    padding-right: 22px;
  }

  .scenario-teaser,
  .scenario-teaser:nth-child(3n) {
    border-right: 1px solid var(--line);
  }

  .scenario-teaser:nth-child(even) {
    border-right: 0;
  }

  .theme-portal .story-list {
    grid-template-columns: 1fr;
  }

  .theme-portal .story-row,
  .theme-portal .story-row:nth-child(even) {
    border-right: 0;
    padding-right: 0;
    padding-left: 0;
  }

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

  .department-nav {
    position: static;
    display: flex;
    overflow-x: auto;
    border-bottom: 1px solid var(--line);
  }

  .department-nav button {
    width: auto;
    min-width: max-content;
    border-bottom: 0;
    padding-right: 20px;
  }

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

  .assumption:nth-child(2) {
    border-right: 0;
  }
}

@media (max-width: 720px) {
  .header-inner,
  .page-shell {
    width: min(calc(100% - 30px), var(--max));
  }

  .header-inner {
    min-height: 60px;
  }

  .header-actions .button.secondary,
  .brand small {
    display: none;
  }

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

  .display-title {
    font-size: 44px;
  }

  .direction-link {
    grid-template-columns: 44px 1fr;
  }

  .direction-arrow {
    display: none;
  }

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

  .assumption,
  .assumption + .assumption,
  .insight-block {
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 18px 0;
  }

  .story-row {
    grid-template-columns: 32px 1fr;
  }

  .story-signals {
    grid-column: 2;
    flex-direction: row;
    flex-wrap: wrap;
  }

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

  .scenario-board {
    overflow-x: auto;
  }

  .scenario-row {
    min-width: 720px;
  }

  .inline-stats {
    align-items: stretch;
    overflow-x: auto;
  }

  .evidence-table {
    min-width: 760px;
  }

  .evidence-table-wrap {
    overflow-x: auto;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .portal-section-actions {
    width: 100%;
    align-items: flex-start;
    flex-direction: column;
  }

  .portal-section-actions .search-field {
    width: 100%;
  }

  .portal-scenario-grid,
  .portal-safety-grid,
  .portal-rail {
    grid-template-columns: 1fr;
  }

  .portal-digest {
    grid-template-columns: 1fr 1fr;
  }

  .portal-digest article,
  .portal-digest article + article {
    padding: 15px 14px;
  }

  .portal-digest article:nth-child(odd) {
    padding-left: 0;
  }

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

  .portal-rail-item:nth-child(odd) {
    border-right: 0;
    padding-right: 0;
  }

  .portal-lead {
    padding: 24px 22px;
  }

  .portal-briefs {
    grid-template-columns: 1fr;
  }

  .portal-briefs a,
  .portal-briefs a + a,
  .portal-briefs a:last-child {
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 16px 0;
  }

  .portal-briefs a:last-child {
    border-bottom: 0;
  }

  .scenario-teaser,
  .scenario-teaser:nth-child(even),
  .scenario-teaser:nth-child(odd) {
    border-right: 0;
    padding: 22px 0;
  }

  .knowledge-band {
    margin-right: -15px;
    margin-left: -15px;
    padding: 36px 24px;
  }

  .knowledge-definitions div {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .case-row {
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 18px;
  }

  .case-row > .button {
    grid-column: 2;
    justify-self: start;
  }

  .safety-panel {
    min-height: auto;
    padding: 36px 0;
  }

  .safety-panel {
    border-right: 0;
    box-shadow: -15px 0 0 var(--accent), 15px 0 0 var(--accent);
  }

  .dialog-inner {
    padding: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
