:root {
  color-scheme: light;
  --ink: #17202a;
  --muted: #657186;
  --line: rgba(23, 32, 42, 0.14);
  --paper: #fbfaf4;
  --soft: #f0ede3;
  --teal: #0b8f8a;
  --orange: #c46a16;
  --indigo: #5662d6;
  --green: #4f7d5a;
}

/* Clean corporate visual refresh */
:root {
  --ink: #111827;
  --muted: #667085;
  --line: #e6e8ef;
  --paper: #ffffff;
  --soft: #f6f8fb;
  --teal: #147a7e;
  --orange: #b85b16;
  --indigo: #3b5bdb;
  --green: #2f7d55;
}

body {
  background: #ffffff;
  color: var(--ink);
}

.topbar {
  padding: 16px clamp(20px, 4vw, 56px);
  background: rgba(255, 255, 255, 0.94);
  border-bottom-color: #edf0f5;
  box-shadow: 0 1px 0 rgba(17, 24, 39, 0.03);
}

.topbar h1 {
  font-size: clamp(18px, 1.5vw, 24px);
  font-weight: 760;
  line-height: 1.15;
}

.eyebrow {
  color: var(--teal);
  font-size: 11px;
  font-weight: 760;
  letter-spacing: 0.02em;
}

.nav {
  gap: 4px;
}

.nav a {
  padding: 7px 10px;
  color: #475467;
  font-weight: 650;
}

.nav a:hover,
.nav a.active:hover {
  background: #f4f7fb !important;
  color: var(--ink) !important;
}

.nav a.active {
  background: #eef6f6;
  color: var(--teal) !important;
}

main {
  width: min(1240px, 100%);
  padding-top: 28px;
}

.summary {
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.42fr);
  gap: 28px;
  align-items: start;
  padding: 44px 0 30px;
  border-bottom: 1px solid #e9edf3;
}

.summary h2 {
  max-width: 860px;
  font-size: clamp(28px, 2.35vw, 38px);
  font-weight: 800;
  line-height: 1.18;
}

.summary p:not(.eyebrow) {
  max-width: 760px;
  margin-top: 18px;
  color: #4b5565;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.75;
}

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

.metrics div {
  min-height: 88px;
  padding: 16px;
  border-color: #e8ebf1;
  background: #fbfcfe;
  box-shadow: none;
}

.metrics span {
  color: var(--ink);
  font-size: clamp(20px, 1.45vw, 24px);
  font-weight: 800;
}

.metrics small {
  color: #667085;
  font-weight: 560;
}

.toolbar {
  align-items: center;
  padding: 22px 0;
}

.toolbar-controls {
  flex-wrap: wrap;
}

.search {
  font-weight: 620;
}

.search input {
  height: 42px;
  border-color: #dfe3ea;
  border-radius: 6px;
  background: #ffffff;
  font-weight: 520;
}

.search input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(20, 122, 126, 0.12);
}

.segmented {
  gap: 2px;
  padding: 3px;
  border-color: #dfe3ea;
  border-radius: 6px;
  background: #f6f8fb;
}

.segmented button {
  min-width: 70px;
  height: 34px;
  border-radius: 5px;
  color: #4b5565;
  font-size: 13px;
  font-weight: 650;
}

.segmented button.active {
  background: #ffffff;
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(17, 24, 39, 0.08);
}

.section-head {
  margin: 22px 0 14px;
}

.section-head h2 {
  font-size: clamp(20px, 1.55vw, 26px);
  font-weight: 780;
}

.section-actions p {
  color: #667085;
  font-weight: 560;
}

.export-btn {
  min-height: 34px;
  border-color: #d8dde6;
  border-radius: 6px;
  color: #344054;
  font-weight: 650;
}

.export-btn:hover {
  border-color: var(--teal);
  background: #eef6f6;
  color: var(--teal);
}

.rank-list,
.mini-list,
.ecosystem-card {
  border-color: #e6e8ef;
  border-radius: 6px;
  box-shadow: none;
}

.rank-header {
  background: #f8fafc;
  color: #667085;
  font-weight: 680;
}

.rank-item {
  min-height: 68px;
  border-left-width: 3px;
  background: #ffffff;
}

.rank-item:hover,
.mini-row:hover,
.ecosystem-row:hover {
  background: #fbfcfe;
}

.rank-num {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: #f0f4f8;
  color: #253041;
  font-size: 15px;
  font-weight: 760;
}

.rank-item .rank-num {
  background: var(--ink);
  color: #ffffff;
}

.company h3,
.mini-main h3,
.ecosystem-card-head h3 {
  font-weight: 760;
}

.company p,
.mini-main p,
.mini-meta span,
.mini-value span,
.ecosystem-row span,
.ecosystem-row p,
.value-block span {
  color: #667085;
  font-weight: 520;
}

.chip {
  min-height: 24px;
  border: 1px solid #e6e8ef;
  border-radius: 5px;
  background: #f8fafc;
  color: #475467;
  font-weight: 620;
}

.chip.basis {
  border-color: transparent;
  background: #eef6f6;
  color: var(--teal);
}

.value-block strong,
.mini-value strong,
.ecosystem-value strong {
  color: #9a4f17;
  font-weight: 800;
}

.bar {
  height: 4px;
  background: #edf1f5;
}

.bar i {
  background: var(--accent);
}

.feature-section,
.ecosystem,
.sources {
  margin-top: 48px;
}

.group-tabs button {
  border-color: #dfe3ea;
  border-radius: 6px;
  color: #475467;
  font-weight: 650;
}

.group-tabs button.active {
  border-color: var(--teal);
  background: #eef6f6;
  color: var(--teal);
}

.mini-row {
  min-height: 66px;
}

.ecosystem-card-head {
  background: #f8fafc;
}

.ecosystem-card-head h3 {
  font-size: 18px;
}

.ecosystem-row strong b {
  border-radius: 5px;
  background: #eef2f7;
  color: #475467;
}

.sources {
  border-top: 1px solid #e9edf3;
}

.sources p,
.ecosystem-intro {
  color: #4b5565;
  font-weight: 500;
  line-height: 1.7;
}

.method-note {
  border: 1px solid #e6e8ef;
  border-left: 3px solid var(--teal);
  background: #fbfcfe;
}

.source-grid a {
  border-color: #e6e8ef;
  border-radius: 6px;
  color: #344054;
  font-weight: 620;
}

.source-grid a:hover {
  background: #f8fafc;
}

@media (max-width: 980px) {
  .summary {
    gap: 22px;
    padding-top: 30px;
  }

  .toolbar-controls {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .summary h2 {
    max-width: 720px;
  }
}

@media (max-width: 620px) {
  main {
    padding: 18px 14px 48px;
  }

  .topbar {
    padding: 14px;
  }

  .topbar h1 {
    font-size: 20px;
  }

  .summary {
    padding: 24px 0 20px;
  }

  .summary h2 {
    font-size: 25px;
    line-height: 1.2;
  }

  .metrics div {
    min-height: 70px;
  }

  .toolbar {
    gap: 14px;
  }

  .rank-item {
    border-left-width: 3px;
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: auto;
}

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", Arial, sans-serif;
}

a {
  color: inherit;
}

.source-link {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  color: var(--teal);
  font-size: 11px;
  font-weight: 900;
  text-decoration: none;
  white-space: nowrap;
}

.source-link:hover {
  text-decoration: underline;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(20px, 4vw, 48px);
  background: rgba(251, 250, 244, 0.9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.topbar h1,
.summary h2,
.section-head h2 {
  margin: 0;
  letter-spacing: 0;
}

.topbar h1 {
  font-size: clamp(18px, 1.8vw, 26px);
  line-height: 1;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav a {
  min-width: 56px;
  padding: 7px 11px;
  border-radius: 8px;
  color: #344054;
  font-size: 13px;
  font-weight: 750;
  text-align: center;
  text-decoration: none;
}

.nav a:hover {
  background: #ffffff;
}

.nav a.active {
  background: var(--ink);
  color: #ffffff !important;
}

.nav a.active:hover {
  background: #243244 !important;
}

main {
  width: min(1280px, 100%);
  margin: 0 auto;
  padding: 20px clamp(16px, 4vw, 48px) 64px;
}

section {
  scroll-margin-top: 92px;
}

.summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(430px, 0.65fr);
  gap: 28px;
  align-items: end;
  padding: clamp(22px, 4vw, 42px) 0 26px;
  border-bottom: 3px solid var(--ink);
}

.summary-copy {
  min-width: 0;
}

.summary h2 {
  max-width: 820px;
  font-size: clamp(26px, 3vw, 40px);
  line-height: 1.04;
  overflow-wrap: anywhere;
}

.summary p:not(.eyebrow) {
  max-width: 760px;
  margin: 16px 0 0;
  color: #475467;
  font-size: clamp(13px, 1.05vw, 15px);
  font-weight: 650;
  line-height: 1.55;
}

.metrics {
  display: grid;
  grid-template-columns: 0.72fr 1.28fr 0.8fr;
  gap: 10px;
  min-width: 0;
}

.metrics div {
  min-width: 0;
  min-height: 76px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.metrics span {
  display: block;
  max-width: 100%;
  white-space: nowrap;
  color: var(--orange);
  font-size: clamp(16px, 1.3vw, 19px);
  font-weight: 950;
  line-height: 1;
}

.metrics small {
  display: block;
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 0;
}

.ranking-toolbar {
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.toolbar-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}

.control-group {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.control-group > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.filter-menu {
  position: relative;
  min-width: 0;
}

.filter-menu summary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 36px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: #667085;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  list-style: none;
  white-space: nowrap;
}

.filter-menu summary::-webkit-details-marker {
  display: none;
}

.filter-menu summary b {
  color: var(--ink);
  font-size: 13px;
}

.filter-menu[open] summary {
  border-color: #cfe7e6;
  background: #eef7f7;
  color: #126b70;
}

.filter-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  display: grid;
  min-width: 132px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 14px 32px rgba(17, 24, 39, 0.14);
}

.filter-popover button {
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #344054;
  font: inherit;
  font-size: 13px;
  font-weight: 760;
  text-align: left;
  cursor: pointer;
}

.filter-popover button.active {
  background: #eef7f7;
  color: #126b70;
}

.search {
  display: grid;
  gap: 8px;
  width: min(440px, 100%);
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.search input {
  width: 100%;
  height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  outline: none;
}

.search input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(11, 143, 138, 0.14);
}

.segmented {
  display: flex;
  min-width: 0;
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.segmented button {
  min-width: 68px;
  height: 32px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #475467;
  font: inherit;
  font-weight: 850;
  cursor: pointer;
}

.segmented button.active {
  background: var(--ink);
  color: #ffffff;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin: 14px 0 14px;
}

.section-head h2 {
  font-size: clamp(18px, 1.7vw, 24px);
}

.section-head > p {
  margin: 0;
  color: var(--muted);
  font-weight: 780;
}

.section-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}

.section-actions p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 780;
  white-space: nowrap;
}

.export-btn {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--ink);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
  white-space: nowrap;
}

.export-btn:hover {
  background: var(--ink);
  color: #ffffff;
}

.export-btn:disabled {
  border-color: var(--line);
  background: var(--soft);
  color: var(--muted);
  cursor: wait;
}

.rank-list {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.rank-header,
.rank-item {
  display: grid;
  grid-template-columns: 68px minmax(280px, 1fr) minmax(245px, 0.43fr) minmax(190px, 0.32fr);
  gap: 14px;
  align-items: center;
  padding: 8px 13px;
}

.rank-header {
  border-bottom: 1px solid var(--line);
  background: #f7f5ee;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.rank-item {
  min-height: 62px;
  border-left: 6px solid var(--accent);
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}

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

.rank-num {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--ink);
  color: #ffffff;
  font-size: 16px;
  font-weight: 950;
}

.company h3 {
  margin: 0;
  font-size: clamp(14px, 1.1vw, 17px);
  line-height: 1.15;
}

.company p {
  margin: 5px 0 0;
  color: #475467;
  font-size: 12px;
  font-weight: 680;
  line-height: 1.35;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 0;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--soft);
  color: #344054;
  font-size: 11px;
  font-weight: 850;
}

.chip.basis {
  background: var(--accent);
  color: #ffffff;
}

.value-block {
  text-align: right;
}

.value-block strong {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--orange);
  font-size: clamp(14px, 1.15vw, 17px);
  line-height: 1;
}

.value-block.negative strong {
  color: #9b1c1c;
}

.value-block span {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 730;
  line-height: 1.35;
}

.bar {
  height: 6px;
  margin-top: 9px;
  border-radius: 999px;
  background: #e5e0d2;
  overflow: hidden;
}

.bar i {
  display: block;
  width: var(--w);
  min-width: 18px;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--ink));
}

.feature-section,
.ecosystem,
.sources {
  margin-top: 42px;
}

.feature-section {
  padding-top: 4px;
}

.group-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.group-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.group-tabs button {
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: #344054;
  font: inherit;
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
}

.group-tabs button.active {
  border-color: var(--ink);
  background: var(--ink);
  color: #ffffff;
}

.group-tabs span {
  margin-left: 6px;
  color: inherit;
  opacity: 0.72;
  font-size: 11px;
}

.segmented.compact button {
  min-width: 82px;
}

.mini-list {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.mini-row {
  display: grid;
  grid-template-columns: 50px minmax(260px, 1fr) minmax(220px, 0.48fr) minmax(260px, 0.55fr);
  gap: 14px;
  align-items: center;
  min-height: 60px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
}

.mini-row:last-child {
  border-bottom: 0;
}

.rank-num.small {
  width: 30px;
  height: 30px;
  font-size: 14px;
}

.mini-main h3 {
  margin: 0;
  font-size: 15px;
  line-height: 1.15;
}

.mini-main p,
.mini-meta span,
.mini-value span {
  display: block;
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 730;
  line-height: 1.35;
}

.mini-meta span:first-child {
  color: #344054;
  font-weight: 850;
}

.mini-value {
  text-align: right;
}

.mini-value strong {
  display: block;
  color: var(--orange);
  font-size: 16px;
  line-height: 1;
  white-space: nowrap;
}

.mini-value.negative strong {
  color: #9b1c1c;
}

.ecosystem-intro {
  max-width: 960px;
  margin: 0 0 16px;
  color: #475467;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.55;
}

.ecosystem-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.ecosystem-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
}

.ecosystem-card-head {
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--line);
  background: #f7f5ee;
}

.ecosystem-card-head h3 {
  margin: 0;
  font-size: 20px;
  line-height: 1.1;
}

.ecosystem-card-head p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.45;
}

.ecosystem-table {
  display: grid;
  gap: 0;
}

.ecosystem-row {
  display: grid;
  grid-template-columns: minmax(160px, 0.62fr) minmax(230px, 0.9fr) minmax(250px, 0.8fr) minmax(220px, 0.66fr);
  gap: 12px;
  align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
}

.ecosystem-row:last-child {
  border-bottom: 0;
}

.ecosystem-row strong {
  display: block;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.2;
}

.ecosystem-row strong b {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-right: 8px;
  border-radius: 6px;
  background: var(--soft);
  color: #344054;
  font-size: 11px;
}

.ecosystem-row span,
.ecosystem-row p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 720;
  line-height: 1.35;
}

.ecosystem-row p {
  color: #475467;
  font-size: 12px;
}

.ecosystem-holding,
.ecosystem-value {
  text-align: right;
}

.ecosystem-holding strong {
  color: #344054;
}

.ecosystem-value strong {
  color: var(--orange);
  white-space: nowrap;
}

.sources {
  padding-top: 18px;
  border-top: 2px solid var(--ink);
}

.sources p {
  max-width: 900px;
  color: #475467;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.55;
}

.method-note {
  padding: 16px 18px;
  border: 1px solid rgba(196, 106, 22, 0.24);
  border-left: 7px solid var(--orange);
  border-radius: 8px;
  background: #fff8ec;
}

.source-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.source-grid a {
  min-height: 46px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: #344054;
  font-size: 12px;
  font-weight: 760;
  text-decoration: none;
}

.source-grid a:hover {
  border-color: var(--teal);
}

.export-panel {
  width: min(1180px, calc(100% - 32px));
  margin: 24px auto 64px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 16px 40px rgba(17, 24, 39, 0.12);
}

.export-panel[hidden] {
  display: none;
}

.export-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.export-panel-head h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
}

.export-panel-head p:not(.eyebrow) {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.export-panel-close,
.export-preview-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid #d8dde6;
  border-radius: 6px;
  background: #ffffff;
  color: #344054;
  font-size: 13px;
  font-weight: 750;
  text-decoration: none;
}

.export-panel-close:hover,
.export-preview-actions a:hover {
  border-color: var(--teal);
  color: var(--teal);
}

.export-preview-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.export-preview-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.export-preview-meta {
  display: grid;
  gap: 4px;
  padding: 12px;
}

.export-preview-meta strong {
  color: var(--ink);
  font-size: 14px;
}

.export-preview-meta span {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.export-preview-card img {
  display: block;
  width: 100%;
  height: auto;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}

.export-preview-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 12px;
}

@media (max-width: 980px) {
  .topbar,
  .section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .section-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .export-btn {
    width: 100%;
  }

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

  .group-toolbar {
    grid-template-columns: 1fr;
  }

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

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

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

  .rank-header {
    display: none;
  }

  .rank-item {
    grid-template-columns: 58px 1fr;
    border-left-width: 7px;
  }

  .mini-row {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 8px 12px;
  }

  .mini-meta,
  .mini-value {
    grid-column: 2;
    text-align: left;
  }

  .rank-item > .chips,
  .value-block {
    grid-column: 2;
    text-align: left;
  }

  .ecosystem-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }

  .ecosystem-holding,
  .ecosystem-value {
    text-align: left;
  }

  .segmented {
    width: 100%;
    overflow-x: auto;
  }

  .segmented button {
    flex: 1 0 92px;
  }

  .export-panel {
    width: calc(100% - 28px);
  }
}

@media (max-width: 620px) {
  .topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    gap: 8px;
    padding: 10px 10px 9px;
  }

  .toolbar-controls {
    width: 100%;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 5px;
  }

  .nav {
    width: 100%;
    gap: 3px;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .nav::-webkit-scrollbar {
    display: none;
  }

  .nav a {
    flex: 0 0 auto;
    min-width: 58px;
    padding: 7px 8px;
    font-size: 11px;
    white-space: nowrap;
  }

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

  .metrics div {
    min-height: 64px;
    padding: 10px 8px;
  }

  .metrics span {
    font-size: 16px;
  }

  .metrics small {
    margin-top: 8px;
    font-size: 11px;
    line-height: 1.2;
  }

  .ranking-toolbar {
    padding: 10px;
  }

  .filter-menu {
    flex: 1 1 0;
  }

  .filter-menu summary {
    width: 100%;
    padding-inline: 6px;
    font-size: 10.5px;
  }

  .filter-menu summary b {
    font-size: 11.5px;
  }

  .filter-popover {
    left: 0;
    right: auto;
    min-width: 100%;
  }

  .group-tabs button {
    flex: 1 0 calc(33.333% - 7px);
    padding-inline: 6px;
    font-size: 12px;
  }

  .segmented {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(64px, 1fr));
    gap: 4px;
    padding: 4px;
  }

  .segmented button {
    min-width: 0;
    width: 100%;
    font-size: 13px;
  }

  .summary h2 {
    font-size: 24px;
    line-height: 1.12;
    word-break: break-word;
  }

  .summary p:not(.eyebrow) {
    font-size: 14px;
  }

  .rank-item {
    grid-template-columns: 50px minmax(0, 1fr);
    gap: 10px 12px;
    padding: 14px 14px 14px 10px;
  }

  .rank-num {
    grid-column: 1;
    grid-row: 1 / span 3;
    width: 42px;
    height: 42px;
    font-size: 18px;
    align-self: start;
  }

  .rank-num.small {
    grid-row: 1 / span 3;
    width: 34px;
    height: 34px;
    font-size: 15px;
  }

  .company {
    grid-column: 2;
    min-width: 0;
  }

  .company h3,
  .company p,
  .value-block span,
  .mini-main h3,
  .mini-main p,
  .mini-meta span,
  .mini-value span,
  .ecosystem-row strong,
  .ecosystem-row p,
  .ecosystem-row span {
    overflow-wrap: anywhere;
  }

  .rank-item > .chips {
    grid-column: 2;
    min-width: 0;
  }

  .chip {
    max-width: 100%;
  }

  .value-block {
    grid-column: 2;
  }

  .export-panel {
    margin-top: 18px;
    padding: 14px;
  }

  .export-panel-head {
    flex-direction: column;
  }

  .export-panel-close {
    width: 100%;
  }

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

/* Final UI polish overrides */
.summary {
  border-bottom: 1px solid #e9edf3;
}

.sources {
  border-top: 1px solid #e9edf3;
}

.nav a.active,
.segmented button.active,
.group-tabs button.active {
  border-color: #d7eaea;
  background: #eef7f7 !important;
  color: #126b70 !important;
  box-shadow: none;
}

.nav a.active,
.nav a.active:hover {
  position: relative;
  background: #17202a !important;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(17, 24, 39, 0.12);
}

.nav a.active::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: -7px;
  height: 3px;
  border-radius: 999px;
  background: #147a7e;
}

.rank-item .rank-num {
  background: #17202a;
  color: #ffffff;
}

.rank-num.small {
  background: #eef2f7;
  color: #344054;
}

.summary h2 {
  font-size: clamp(26px, 2.15vw, 36px);
  line-height: 1.18;
}

.section-head h2 {
  font-size: clamp(20px, 1.45vw, 24px);
}

.method-note {
  border-left: 3px solid #147a7e;
}

@media (max-width: 620px) {
  .summary {
    border-bottom-color: #edf0f5;
  }

  .summary h2 {
    font-size: 24px;
    line-height: 1.22;
  }

  .segmented button.active {
    background: #eef7f7 !important;
    color: #126b70 !important;
  }
}
