:root {
  color-scheme: dark;
  --bg: #040b18;
  --bg-soft: #071427;
  --panel: rgba(8, 27, 50, 0.86);
  --panel-strong: rgba(7, 32, 59, 0.96);
  --line: rgba(57, 154, 219, 0.34);
  --line-soft: rgba(116, 192, 236, 0.14);
  --text: #edf8ff;
  --muted: #8eabc2;
  --cyan: #22d3ee;
  --cyan-bright: #71f1ff;
  --blue: #3495ff;
  --gold: #ffd666;
  --orange: #ffad41;
  --magenta: #ff4fa3;
  --danger: #ff667d;
  --success: #27e6a3;
  --shadow-cyan: 0 0 26px rgba(34, 211, 238, 0.15);
  --radius: 10px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--text);
  background:
    linear-gradient(rgba(32, 115, 176, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(32, 115, 176, 0.035) 1px, transparent 1px),
    radial-gradient(circle at 50% -10%, rgba(23, 113, 184, 0.22), transparent 35rem),
    var(--bg);
  background-size: 30px 30px, 30px 30px, auto, auto;
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.ambient {
  position: fixed;
  z-index: -1;
  width: 26rem;
  height: 26rem;
  border-radius: 50%;
  filter: blur(110px);
  opacity: 0.12;
  pointer-events: none;
}

.ambient-one {
  top: 16%;
  left: -15rem;
  background: var(--cyan);
}

.ambient-two {
  right: -13rem;
  bottom: 4%;
  background: var(--blue);
}

.command-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 102px;
  padding: 20px clamp(20px, 3vw, 52px);
  border-bottom: 1px solid rgba(62, 162, 229, 0.5);
  background:
    linear-gradient(90deg, rgba(11, 43, 80, 0.4), rgba(21, 77, 132, 0.72) 50%, rgba(11, 43, 80, 0.4)),
    rgba(4, 14, 30, 0.9);
  box-shadow: 0 9px 32px rgba(0, 91, 176, 0.14), inset 0 -1px 20px rgba(40, 151, 232, 0.12);
}

.command-header::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -8px;
  width: min(40vw, 560px);
  height: 8px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, var(--blue) 18%, var(--cyan) 50%, var(--blue) 82%, transparent);
  clip-path: polygon(0 0, 100% 0, 94% 100%, 6% 100%);
  opacity: 0.82;
}

.brand-block,
.header-status,
.toolbar,
.toolbar-copy,
.toolbar-actions,
.search-control,
.select-control,
.panel-heading,
.detail-nav,
.selected-title-row,
.legend,
.metric-label,
.metric-value-line,
.weight-top,
.mobile-card-top,
.mobile-card-bottom {
  display: flex;
  align-items: center;
}

.brand-block {
  gap: 16px;
}

.brand-mark {
  display: grid;
  gap: 3px;
  width: 34px;
  transform: skewX(-12deg);
}

.brand-mark span {
  height: 7px;
  background: linear-gradient(90deg, var(--cyan), rgba(52, 149, 255, 0.15));
  box-shadow: 0 0 12px rgba(34, 211, 238, 0.5);
}

.brand-mark span:nth-child(2) {
  width: 78%;
}

.brand-mark span:nth-child(3) {
  width: 52%;
}

.eyebrow,
.section-kicker {
  margin: 0;
  color: var(--cyan-bright);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(1.5rem, 2.7vw, 2.35rem);
  line-height: 1.15;
  letter-spacing: 0.08em;
  text-shadow: 0 0 22px rgba(83, 192, 255, 0.33);
}

.header-status {
  gap: 24px;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 11px;
  border: 1px solid rgba(39, 230, 163, 0.28);
  border-radius: 999px;
  color: #a8f5d8;
  background: rgba(39, 230, 163, 0.08);
  font-size: 0.875rem;
}

.status-chip i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 9px var(--success);
}

.update-time {
  display: grid;
  gap: 2px;
  text-align: right;
}

.update-time span {
  color: var(--muted);
  font-size: 0.8125rem;
  letter-spacing: 0.12em;
}

.update-time strong {
  color: #dff6ff;
  font-size: 1.0625rem;
  letter-spacing: 0.05em;
}

.dashboard-shell {
  width: min(1760px, 100%);
  margin: 0 auto;
  padding: 22px clamp(14px, 2vw, 32px) 34px;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  justify-content: space-between;
  gap: 20px;
  min-height: 48px;
  margin-bottom: 12px;
}

.toolbar-copy,
.toolbar-actions {
  gap: 10px;
}

.toolbar-copy {
  color: var(--muted);
  font-size: 0.9375rem;
}

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

.live-badge {
  padding: 4px 8px;
  border: 1px solid rgba(255, 214, 102, 0.34);
  border-radius: 4px;
  color: var(--gold);
  background: rgba(255, 214, 102, 0.08);
  font-weight: 700;
}

.source-trigger,
.formula-button,
.detail-nav button {
  border: 1px solid var(--line);
  color: #bfeaff;
  background: rgba(25, 91, 139, 0.16);
  transition: 160ms ease;
}

.source-trigger,
.formula-button {
  min-height: 36px;
  padding: 7px 12px;
  border-radius: 6px;
}

.source-trigger:hover,
.source-trigger:focus-visible,
.formula-button:hover,
.formula-button:focus-visible,
.detail-nav button:hover,
.detail-nav button:focus-visible {
  border-color: var(--cyan);
  outline: none;
  background: rgba(34, 211, 238, 0.13);
  box-shadow: 0 0 14px rgba(34, 211, 238, 0.12);
}

.search-control,
.select-control {
  min-height: 42px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: rgba(4, 17, 33, 0.8);
}

.search-control {
  width: min(280px, 32vw);
  padding: 0 12px;
}

.search-control:focus-within,
.select-control:focus-within {
  border-color: rgba(34, 211, 238, 0.6);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.07);
}

.search-control svg {
  width: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.8;
}

.search-control input {
  width: 100%;
  padding: 9px;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
  font-size: 0.9375rem;
}

.search-control input::placeholder {
  color: #5f7a91;
}

.select-control span {
  padding-left: 12px;
  color: var(--muted);
  font-size: 0.875rem;
}

.select-control select {
  min-height: 40px;
  padding: 0 30px 0 8px;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
  font-size: 0.9375rem;
}

.sort-chips {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-width: 0;
  margin: -4px 0 0;
  padding: 0;
  border: 0;
}

.sort-chips legend {
  padding: 0;
  color: #7897ad;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.sort-chip-list {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 8px;
}

.sort-chip-list label {
  --chip: #22d3ee;
  position: relative;
  flex: 1 1 108px;
  min-width: max-content;
}

.sort-chip-list label[data-sort-key="score"] { --chip: #ffd666; flex-grow: 1.22; }
.sort-chip-list label[data-sort-key="signingRate"] { --chip: #ff6f91; }
.sort-chip-list label[data-sort-key="opportunityReach"] { --chip: #ffb451; }
.sort-chip-list label[data-sort-key="libraryReach"] { --chip: #25d8ff; }
.sort-chip-list label[data-sort-key="platformConversion"] { --chip: #ad92ff; }
.sort-chip-list label[data-sort-key="databaseCompletion"] { --chip: #52e3a0; }
.sort-chip-list label[data-sort-key="entryQualification"] { --chip: #62a0ff; }

.sort-chip-list input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.sort-chip-list span {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 12px;
  border: 1px solid color-mix(in srgb, var(--chip) 42%, transparent);
  border-radius: 6px;
  color: color-mix(in srgb, var(--chip) 84%, white);
  background: color-mix(in srgb, var(--chip) 7%, rgba(4, 17, 33, 0.9));
  font-size: 0.875rem;
  font-weight: 700;
  white-space: nowrap;
  transition: 150ms ease;
}

.sort-chip-list span b {
  padding: 2px 5px;
  border: 1px solid rgba(255, 214, 102, 0.5);
  border-radius: 3px;
  color: #fff0ad;
  background: rgba(255, 214, 102, 0.09);
  font-size: 0.625rem;
  letter-spacing: 0.06em;
}

.sort-chip-list input:checked + span {
  border-color: var(--chip);
  color: #fff;
  background: linear-gradient(135deg, color-mix(in srgb, var(--chip) 28%, #071b37), color-mix(in srgb, var(--chip) 11%, #041121));
  box-shadow: inset 0 -3px var(--chip), 0 0 16px color-mix(in srgb, var(--chip) 18%, transparent);
}

.sort-chip-list input:checked + span::before {
  content: "✓";
  color: var(--chip);
  font-weight: 900;
}

.sort-chip-list label:hover span {
  border-color: color-mix(in srgb, var(--chip) 78%, transparent);
}

.sort-chip-list input:focus-visible + span {
  outline: 2px solid #ecfbff;
  outline-offset: 2px;
}

.source-note {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 24px;
  margin: 0 0 16px;
  padding: 14px 18px;
  border: 1px solid rgba(255, 214, 102, 0.24);
  border-left: 3px solid var(--gold);
  border-radius: 6px;
  background: rgba(255, 214, 102, 0.06);
}

.scenario-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 12px;
  padding: 11px 14px;
  border: 1px solid rgba(255, 214, 102, 0.42);
  border-radius: 6px;
  color: #d7eaff;
  background: linear-gradient(90deg, rgba(255, 214, 102, 0.13), rgba(29, 101, 154, 0.08));
  box-shadow: inset 4px 0 var(--gold), 0 0 18px rgba(255, 214, 102, 0.06);
}

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

.scenario-banner div {
  display: flex;
  min-width: 0;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 5px 12px;
}

.scenario-banner strong {
  color: #ffe18a;
  font-size: 0.9375rem;
}

.scenario-banner span {
  color: #8faabe;
  font-size: 0.8125rem;
}

.scenario-banner button {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 6px 11px;
  border: 1px solid rgba(255, 214, 102, 0.42);
  border-radius: 5px;
  color: #ffe29a;
  background: rgba(255, 214, 102, 0.07);
}

.scenario-banner button:hover,
.scenario-banner button:focus-visible {
  border-color: var(--gold);
  outline: 0;
  background: rgba(255, 214, 102, 0.13);
}

.source-note[hidden],
.formula-note[hidden] {
  display: none;
}

.source-note strong {
  color: var(--gold);
}

.source-note p {
  margin: 4px 0 0;
  color: #b7c8d5;
  font-size: 0.875rem;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.summary-grid.summary-leaders {
  grid-template-columns: minmax(200px, 0.9fr) minmax(0, 3.1fr);
}

.summary-card,
.panel {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(44, 139, 200, 0.08), transparent 40%),
    var(--panel);
  box-shadow: inset 0 1px rgba(175, 226, 255, 0.035), 0 16px 36px rgba(0, 0, 0, 0.14);
}

.summary-card::before,
.panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 42%;
  height: 1px;
  background: linear-gradient(90deg, var(--cyan), transparent);
  opacity: 0.72;
}

.summary-card {
  min-height: 142px;
  padding: 17px 18px 15px;
}

.summary-card::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 34px;
  height: 34px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  opacity: 0.36;
}

.summary-card.cyan { color: var(--cyan); }
.summary-card.blue { color: #60a9ff; }
.summary-card.gold { color: var(--gold); }
.summary-card.magenta { color: var(--magenta); }
.summary-card.silver { color: #c5e7f7; }

#topOwner {
  color: #fff0b3;
  font-size: 0.9375rem;
  font-weight: 750;
}

.summary-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.summary-label span {
  color: #d7e8f4;
  font-weight: 650;
}

.summary-label small {
  color: #547188;
  font-size: 0.75rem;
  letter-spacing: 0.11em;
}

.summary-value {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-top: 9px;
}

.summary-value strong {
  color: currentColor;
  font-size: clamp(2rem, 3vw, 2.8rem);
  font-variant-numeric: tabular-nums;
  line-height: 1;
  text-shadow: 0 0 18px currentColor;
}

.summary-value.word strong {
  overflow: hidden;
  max-width: 100%;
  font-size: clamp(1.5rem, 2.3vw, 2.15rem);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.summary-value em {
  color: #9bb5c9;
  font-size: 0.875rem;
  font-style: normal;
}

.mini-track {
  height: 3px;
  margin: 12px 0 9px;
  overflow: hidden;
  border-radius: 9px;
  background: rgba(131, 187, 220, 0.12);
}

.mini-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: currentColor;
  box-shadow: 0 0 9px currentColor;
  transition: width 500ms ease;
}

.summary-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.875rem;
}

.summary-card p b {
  color: currentColor;
  font-size: inherit;
}

.primary-grid {
  display: grid;
  grid-template-columns: minmax(330px, 0.78fr) minmax(580px, 1.72fr);
  gap: 12px;
  margin-bottom: 12px;
}

.ranking-column {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  min-height: 0;
  align-self: stretch;
}

.ranking-column > .panel {
  width: 100%;
  flex: 0 0 auto;
}

.top-three-panel {
  isolation: isolate;
  margin-bottom: 12px;
  padding: 22px 24px 24px;
  overflow: hidden;
  border-color: rgba(255, 214, 102, 0.22);
  background:
    radial-gradient(circle at 50% 5%, rgba(255, 208, 95, 0.13), transparent 31%),
    linear-gradient(100deg, rgba(255, 214, 102, 0.045), transparent 28%),
    linear-gradient(135deg, rgba(44, 139, 200, 0.09), transparent 42%),
    var(--panel);
}

.top-three-panel::before {
  left: 50%;
  width: min(680px, 72%);
  transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.top-three-panel::after {
  content: "";
  position: absolute;
  z-index: -1;
  left: 8%;
  right: 8%;
  bottom: 24px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 214, 102, 0.46), transparent);
  box-shadow: 0 -82px 80px rgba(37, 141, 209, 0.08);
}

.top-three-panel .panel-heading {
  position: relative;
  justify-content: center;
  margin-bottom: 10px;
  text-align: center;
}

.top-three-panel .panel-heading h2 {
  color: #fff1bd;
  font-size: 1.45rem;
  letter-spacing: 0.12em;
}

.top-three-note {
  position: absolute;
  right: 0;
  color: #7895aa;
  font-size: 0.8125rem;
}

.podium-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr) minmax(0, 0.92fr);
  align-items: end;
  gap: clamp(12px, 2vw, 28px);
  margin: 0;
  padding: 66px clamp(0px, 3vw, 48px) 8px;
  list-style: none;
}

.podium-slot {
  display: flex;
  min-width: 0;
  align-items: flex-end;
}

.podium-slot-1 {
  grid-column: 2;
  grid-row: 1;
}

.podium-slot-2 {
  grid-column: 1;
  grid-row: 1;
}

.podium-slot-3 {
  grid-column: 3;
  grid-row: 1;
}

.podium-card {
  --podium-color: #c7d8e6;
  --podium-dark: #657b8f;
  --podium-soft: rgba(199, 216, 230, 0.13);
  --podium-lift: 0px;
  position: relative;
  display: grid;
  grid-template-rows: auto auto auto auto;
  justify-items: center;
  align-content: start;
  gap: 11px;
  width: 100%;
  min-width: 0;
  min-height: 326px;
  padding: 58px 22px 22px;
  overflow: visible;
  border: 2px solid var(--podium-color);
  border-radius: 18px 18px 7px 7px;
  color: var(--podium-color);
  background:
    linear-gradient(180deg, var(--podium-soft), transparent 32%),
    linear-gradient(145deg, rgba(13, 48, 83, 0.98), rgba(4, 18, 36, 0.98));
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.045) inset,
    0 16px 36px rgba(0, 0, 0, 0.26),
    0 0 20px color-mix(in srgb, var(--podium-color) 12%, transparent);
  text-align: center;
  transform: translateY(var(--podium-lift));
  transition: 160ms ease;
}

.podium-card::before {
  content: "";
  position: absolute;
  inset: 7px;
  z-index: -1;
  border: 1px solid color-mix(in srgb, var(--podium-color) 46%, transparent);
  border-radius: 13px 13px 4px 4px;
  pointer-events: none;
}

.podium-card::after {
  content: "";
  position: absolute;
  right: 16%;
  bottom: 11px;
  left: 16%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--podium-color), transparent);
  opacity: 0.55;
}

.podium-card:hover,
.podium-card:focus-visible,
.podium-card.active {
  border-color: var(--podium-color);
  outline: 0;
  box-shadow:
    0 0 0 2px color-mix(in srgb, var(--podium-color) 18%, transparent),
    0 18px 42px rgba(0, 0, 0, 0.3),
    0 0 26px color-mix(in srgb, var(--podium-color) 18%, transparent);
  transform: translateY(calc(var(--podium-lift) - 3px));
}

.podium-rank-1 {
  --podium-color: #ffd66d;
  --podium-dark: #8b5d11;
  --podium-soft: rgba(255, 214, 109, 0.17);
  --podium-lift: -30px;
  z-index: 2;
  min-height: 368px;
  padding-top: 64px;
}

.podium-rank-2 {
  --podium-color: #c7d8e6;
  --podium-dark: #5c7186;
  --podium-soft: rgba(199, 216, 230, 0.13);
}

.podium-rank-3 {
  --podium-color: #d79259;
  --podium-dark: #75411f;
  --podium-soft: rgba(215, 146, 89, 0.14);
}

.champion-mark {
  position: absolute;
  top: -66px;
  color: #ffe79c;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-shadow: 0 0 12px rgba(255, 214, 109, 0.6);
}

.champion-mark::before,
.champion-mark::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 38px;
  height: 1px;
  background: linear-gradient(90deg, transparent, #ffd66d);
}

.champion-mark::before {
  right: calc(100% + 9px);
}

.champion-mark::after {
  left: calc(100% + 9px);
  transform: scaleX(-1);
}

.podium-medal {
  position: absolute;
  top: -37px;
  display: grid;
  width: 74px;
  height: 74px;
  place-items: center;
  align-content: center;
  border: 3px solid var(--podium-color);
  border-radius: 50%;
  color: #fff9e8;
  background:
    radial-gradient(circle at 35% 28%, rgba(255, 255, 255, 0.38), transparent 23%),
    linear-gradient(145deg, var(--podium-color), var(--podium-dark));
  box-shadow:
    0 0 0 5px rgba(3, 17, 35, 0.9),
    0 0 0 7px color-mix(in srgb, var(--podium-color) 62%, transparent),
    0 0 22px color-mix(in srgb, var(--podium-color) 38%, transparent);
  line-height: 1;
}

.podium-rank-1 .podium-medal {
  top: -46px;
  width: 90px;
  height: 90px;
}

.podium-medal small {
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.5625rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.podium-medal strong {
  font-size: 2.15rem;
  font-weight: 900;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.36);
}

.podium-avatar {
  display: grid;
  width: 132px;
  height: 132px;
  place-items: center;
  padding: 7px;
  border: 2px solid var(--podium-color);
  border-radius: 50%;
  background:
    conic-gradient(from 205deg, transparent, var(--podium-color), transparent 52%),
    rgba(4, 17, 34, 0.94);
  box-shadow:
    0 0 0 4px rgba(4, 17, 34, 0.92),
    0 0 24px color-mix(in srgb, var(--podium-color) 22%, transparent);
}

.podium-rank-1 .podium-avatar {
  width: 152px;
  height: 152px;
}

.podium-avatar > span {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--podium-color) 55%, transparent);
  border-radius: 50%;
  color: #effaff;
  background:
    radial-gradient(circle at 50% 32%, color-mix(in srgb, var(--podium-color) 22%, transparent), transparent 46%),
    linear-gradient(145deg, rgba(22, 72, 111, 0.88), rgba(5, 24, 46, 0.95));
  font-size: 3.1rem;
  font-weight: 800;
  text-shadow: 0 0 18px color-mix(in srgb, var(--podium-color) 52%, transparent);
}

.podium-org {
  max-width: 100%;
  overflow: hidden;
  color: #e8f8ff;
  font-size: 1.08rem;
  letter-spacing: 0.04em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.podium-ribbon {
  display: flex;
  width: calc(100% + 18px);
  min-height: 51px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 8px 25px;
  color: #071326;
  background: linear-gradient(90deg, var(--podium-dark), var(--podium-color) 23%, #f4f8fb 50%, var(--podium-color) 77%, var(--podium-dark));
  clip-path: polygon(0 12%, 10% 12%, 10% 0, 90% 0, 90% 12%, 100% 12%, 94% 50%, 100% 88%, 90% 88%, 90% 100%, 10% 100%, 10% 88%, 0 88%, 6% 50%);
  filter: drop-shadow(0 5px 8px rgba(0, 0, 0, 0.25));
}

.podium-ribbon small {
  color: rgba(6, 20, 38, 0.64);
  font-size: 0.6875rem;
  font-weight: 700;
}

.podium-ribbon strong {
  color: #071326;
  font-size: 1.18rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.podium-score {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 5px;
  color: var(--podium-color);
}

.podium-score small {
  color: #8ca7ba;
  font-size: 0.75rem;
}

.podium-score strong {
  font-size: 1.62rem;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.podium-score em {
  color: #8ca7ba;
  font-size: 0.75rem;
  font-style: normal;
}

/* 横向前三名榜：保留金银铜识别，恢复更紧凑的数据卡形式。 */
.top-three-panel .panel-heading {
  justify-content: space-between;
  margin-bottom: 18px;
  text-align: left;
}

.top-three-panel .panel-heading h2 {
  color: #e9f8ff;
  font-size: 1.35rem;
  letter-spacing: 0.06em;
}

.top-three-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.top-three-entry {
  min-width: 0;
}

.top-three-card {
  --rank-color: #c7d8e6;
  --rank-rgb: 199, 216, 230;
  position: relative;
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr) 128px;
  grid-template-areas:
    "rank identity score"
    "progress progress progress";
  align-items: center;
  gap: 10px 18px;
  width: 100%;
  min-width: 0;
  min-height: 116px;
  padding: 16px 20px;
  overflow: hidden;
  border: 1px solid rgba(var(--rank-rgb), 0.42);
  border-left: 4px solid var(--rank-color);
  border-radius: 8px;
  color: #e8f7ff;
  background:
    radial-gradient(circle at 0 50%, rgba(var(--rank-rgb), 0.13), transparent 24%),
    linear-gradient(90deg, rgba(var(--rank-rgb), 0.06), rgba(4, 20, 40, 0.82) 52%, rgba(5, 24, 47, 0.92));
  text-align: left;
  transition: 150ms ease;
}

.top-three-card::after {
  content: "";
  position: absolute;
  top: -42px;
  right: -26px;
  width: 86px;
  height: 86px;
  border: 1px solid rgba(var(--rank-rgb), 0.14);
  border-radius: 50%;
}

.top-three-card:hover,
.top-three-card:focus-visible,
.top-three-card.active {
  border-color: var(--rank-color);
  outline: 0;
  background:
    radial-gradient(circle at 0 50%, rgba(var(--rank-rgb), 0.19), transparent 26%),
    linear-gradient(90deg, rgba(var(--rank-rgb), 0.1), rgba(4, 20, 40, 0.86) 52%, rgba(5, 24, 47, 0.96));
  box-shadow: 0 0 0 2px rgba(var(--rank-rgb), 0.08), 0 0 18px rgba(var(--rank-rgb), 0.1);
}

.top-three-card.rank-1 {
  --rank-color: #ffd666;
  --rank-rgb: 255, 214, 102;
  min-height: 128px;
}

.top-three-card.rank-2 {
  --rank-color: #c7d8e6;
  --rank-rgb: 199, 216, 230;
}

.top-three-card.rank-3 {
  --rank-color: #df9659;
  --rank-rgb: 223, 150, 89;
}

.top-three-rank {
  grid-area: rank;
  display: grid;
  align-content: center;
  justify-items: start;
  color: var(--rank-color);
  line-height: 1;
}

.top-three-rank small {
  margin-bottom: 5px;
  font-size: 0.8125rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.top-three-rank strong {
  font-size: 2.25rem;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 15px rgba(var(--rank-rgb), 0.46);
}

.top-three-identity {
  grid-area: identity;
  min-width: 0;
}

.top-three-identity > strong,
.top-three-identity > span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top-three-identity > strong {
  color: #eefaff;
  font-size: 1.32rem;
  letter-spacing: 0.04em;
}

.top-three-identity > span {
  margin-top: 7px;
  color: #7895aa;
  font-size: 0.875rem;
}

.top-three-identity b {
  margin-left: 7px;
  color: #dff7ff;
  font-size: 1.02rem;
}

.top-three-score {
  grid-area: score;
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  color: var(--rank-color);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.top-three-score strong {
  font-size: 2.45rem;
  line-height: 1;
}

.top-three-score em {
  margin-left: 5px;
  color: #7794aa;
  font-size: 0.8125rem;
  font-style: normal;
}

.top-three-progress {
  grid-area: progress;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px 14px;
}

.top-three-progress > i {
  grid-column: 1 / -1;
  display: block;
  height: 8px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(74, 144, 188, 0.12);
}

.top-three-progress > i b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--rank-color), color-mix(in srgb, var(--rank-color) 42%, #22d3ee));
  box-shadow: 0 0 12px rgba(var(--rank-rgb), 0.35);
}

.top-three-progress span {
  color: #66859b;
  font-size: 0.8125rem;
}

.top-three-progress span:last-child {
  color: #7899af;
  text-align: right;
}

.panel {
  padding: 18px;
}

.panel-heading {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.panel-heading h2 {
  margin: 3px 0 0;
  font-size: 1.18rem;
  letter-spacing: 0.04em;
}

.panel-count {
  color: var(--muted);
  font-size: 0.875rem;
}

.leaderboard-panel {
  display: flex;
  flex-direction: column;
  align-self: start;
}

.leaderboard-panel.compact {
  align-self: start;
}

.leaderboard {
  display: grid;
  grid-auto-rows: auto;
  flex: none;
  gap: 8px;
  max-height: 548px;
  padding-right: 4px;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  scrollbar-color: rgba(63, 157, 216, 0.38) transparent;
  scrollbar-width: thin;
}

.leaderboard-panel:not(.compact) .leaderboard {
  grid-auto-rows: max-content;
  align-content: start;
  flex: none;
  max-height: none;
}

.rank-row {
  position: relative;
  display: grid;
  grid-template-columns: 48px minmax(118px, 1.3fr) minmax(94px, 1fr) 58px;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: inherit;
  background: rgba(61, 129, 175, 0.065);
  text-align: left;
}

.rank-row.top-rank {
  min-height: 66px;
  border-color: rgba(87, 187, 237, 0.25);
  background: linear-gradient(90deg, rgba(37, 117, 173, 0.2), rgba(11, 39, 69, 0.22));
}

.rank-row.top-rank.rank-1 {
  border-color: rgba(255, 214, 102, 0.48);
  background: linear-gradient(90deg, rgba(157, 111, 23, 0.22), rgba(11, 39, 69, 0.2));
}

.rank-row.top-rank.rank-2 { border-color: rgba(121, 220, 255, 0.38); }
.rank-row.top-rank.rank-3 { border-color: rgba(255, 171, 107, 0.34); }

.rank-row:hover,
.rank-row:focus-visible,
.rank-row.active {
  border-color: rgba(34, 211, 238, 0.34);
  outline: none;
  background: linear-gradient(90deg, rgba(34, 211, 238, 0.12), rgba(24, 87, 143, 0.08));
}

.rank-number {
  color: #7d9bb2;
  font-size: 0.9375rem;
  font-weight: 800;
  text-align: center;
}

.rank-row.top-rank .rank-number {
  color: var(--gold);
  text-shadow: 0 0 10px rgba(255, 214, 102, 0.5);
}

.rank-row.top-rank.rank-2 .rank-number,
.rank-row.top-rank.rank-2 .rank-score {
  color: #c7d8e6;
  text-shadow: none;
}

.rank-row.top-rank.rank-3 .rank-number,
.rank-row.top-rank.rank-3 .rank-score {
  color: #cf925e;
  text-shadow: none;
}

.rank-row.top-rank.rank-1 .rank-score {
  color: var(--gold);
}

.rank-name {
  min-width: 0;
}

.rank-name strong,
.rank-name small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-name strong {
  color: #e9f8ff;
  font-size: 1rem;
  line-height: 1.3;
}

.rank-name small {
  display: flex;
  align-items: baseline;
  gap: 5px;
  color: #d4f4ff;
  font-size: 0.875rem;
  font-weight: 750;
  line-height: 1.35;
}

.rank-name small span {
  color: #6f8ba0;
  font-size: 0.75rem;
  font-weight: 500;
}

.rank-track {
  height: 8px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(99, 162, 202, 0.1);
}

.rank-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--cyan));
  box-shadow: 0 0 9px rgba(34, 211, 238, 0.42);
}

.rank-score {
  color: var(--cyan-bright);
  font-size: 1.08rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.empty-state {
  padding: 48px 18px;
  color: var(--muted);
  text-align: center;
}

.panel-hint {
  margin: 12px 0 0;
  color: #607f97;
  font-size: 0.8125rem;
  text-align: center;
}

.detail-nav {
  gap: 6px;
}

.detail-nav button {
  display: grid;
  width: 36px;
  height: 34px;
  place-items: center;
  border-radius: 5px;
  font-size: 1.3rem;
  line-height: 1;
}

.detail-hero {
  display: grid;
  grid-template-columns: 180px 1fr;
  align-items: center;
  gap: clamp(22px, 4vw, 50px);
  min-height: 208px;
  padding: 12px clamp(10px, 2vw, 24px) 22px;
  border-bottom: 1px solid var(--line-soft);
}

.score-orbit {
  --score-angle: 0deg;
  position: relative;
  display: grid;
  width: 164px;
  height: 164px;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #071528 0 48%, transparent 49%),
    conic-gradient(var(--cyan) var(--score-angle), rgba(51, 129, 181, 0.13) 0);
  box-shadow: 0 0 40px rgba(34, 211, 238, 0.14), inset 0 0 25px rgba(14, 98, 159, 0.4);
}

.score-orbit::before,
.score-orbit::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.score-orbit::before {
  inset: -7px;
  border: 1px solid rgba(34, 211, 238, 0.26);
  border-right-color: transparent;
  transform: rotate(28deg);
}

.score-orbit::after {
  inset: 17px;
  border: 1px dashed rgba(102, 195, 244, 0.2);
}

.orbit-core {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: baseline;
  justify-content: center;
  flex-wrap: wrap;
  width: 102px;
  text-align: center;
}

.orbit-core span {
  width: 100%;
  color: var(--muted);
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
}

.orbit-core strong {
  color: var(--cyan-bright);
  font-size: 2.7rem;
  line-height: 1;
  text-shadow: 0 0 18px rgba(34, 211, 238, 0.52);
}

.orbit-core small {
  margin-left: 3px;
  color: #65849d;
  font-size: 0.75rem;
}

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

.selected-title-row {
  justify-content: space-between;
  gap: 18px;
}

.selected-title-row p {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.8125rem;
}

.selected-title-row h3 {
  margin: 0;
  font-size: clamp(1.45rem, 3vw, 2.1rem);
  letter-spacing: 0.04em;
}

.grade-badge {
  flex: 0 0 auto;
  padding: 6px 10px;
  border: 1px solid currentColor;
  border-radius: 4px;
  color: var(--cyan);
  background: rgba(34, 211, 238, 0.08);
  font-size: 0.875rem;
  font-weight: 800;
}

.grade-badge.watch {
  color: var(--gold);
  background: rgba(255, 214, 102, 0.07);
}

.grade-badge.risk {
  color: var(--danger);
  background: rgba(255, 102, 125, 0.07);
}

.selected-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 22px 0 0;
}

.selected-meta div {
  min-width: 0;
  padding: 10px 11px;
  border-left: 2px solid rgba(34, 211, 238, 0.4);
  background: rgba(37, 106, 154, 0.08);
}

.selected-meta dt {
  color: var(--muted);
  font-size: 0.75rem;
}

.selected-meta dd {
  overflow: hidden;
  margin: 2px 0 0;
  color: #dff6ff;
  font-size: 1rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selected-meta div:first-child {
  border-left-color: var(--gold);
  background: rgba(255, 214, 102, 0.07);
}

.selected-meta div:first-child dd {
  color: #fff0b3;
  font-size: 1.08rem;
}

.metric-breakdown {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px 18px;
  padding-top: 18px;
}

.metric-item {
  min-width: 0;
  padding: 14px;
  border: 1px solid #315875;
  border-radius: 9px;
  background: #0b2034;
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.18);
}

.metric-label,
.metric-value-line {
  justify-content: space-between;
  gap: 10px;
}

.metric-label h3 {
  min-width: 0;
  margin: 0;
  color: #f0f8ff;
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.5;
}

.metric-label small {
  flex: 0 0 auto;
  color: #5f7f98;
  font-size: 0.75rem;
}

.metric-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin: 11px 0 10px;
}

.metric-facts > div {
  min-width: 0;
  padding: 8px 9px;
  border-left: 2px solid rgba(34, 211, 238, 0.34);
  background: rgba(4, 22, 41, 0.52);
}

.metric-facts span,
.metric-facts strong {
  display: block;
}

.metric-facts span {
  margin-bottom: 2px;
  color: #708da3;
  font-size: 0.6875rem;
}

.metric-facts strong {
  overflow: hidden;
  color: var(--cyan-bright);
  font-size: 1.08rem;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-facts strong small {
  color: #7893a7;
  font-size: 0.6875rem;
}

.metric-value-line {
  margin: 5px 0;
}

.metric-value-line strong {
  color: var(--cyan-bright);
  font-size: 0.9375rem;
  font-variant-numeric: tabular-nums;
}

.metric-value-line em {
  color: var(--muted);
  font-size: 0.75rem;
  font-style: normal;
}

.metric-track {
  position: relative;
  height: 10px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(104, 176, 220, 0.1);
}

.metric-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2274e5, var(--cyan));
  box-shadow: 0 0 9px rgba(34, 211, 238, 0.38);
}

.metric-item.watch .metric-value-line strong { color: var(--gold); }
.metric-item.watch .metric-track i { background: linear-gradient(90deg, #dc7e25, var(--gold)); }
.metric-item.risk .metric-value-line strong { color: var(--danger); }
.metric-item.risk .metric-track i { background: linear-gradient(90deg, #a43466, var(--danger)); }
.metric-item.excellent .metric-track i { background: linear-gradient(90deg, #11956c, var(--success)); }
.metric-item.good .metric-track i { background: linear-gradient(90deg, #226fc6, #4db5ff); }
.metric-item.excellent .metric-facts strong { color: #8ff5d3; }
.metric-item.good .metric-facts strong { color: #9bddff; }
.metric-item.watch .metric-facts strong { color: var(--gold); }
.metric-item.risk .metric-facts strong { color: #ff91a5; }

.metric-foot {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 6px;
  color: #69869b;
  font-size: 0.6875rem;
}

.metric-context {
  overflow: hidden;
  margin: 7px 0 0;
  color: #8ca4b6;
  font-size: 0.75rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-item.library-scenario-active {
  border-color: rgba(255, 214, 102, 0.42);
  background: linear-gradient(145deg, rgba(255, 214, 102, 0.075), rgba(37, 103, 149, 0.055));
  box-shadow: inset 3px 0 rgba(255, 214, 102, 0.64);
}

.outside-scenario {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(89, 166, 214, 0.18);
}

.outside-scenario-head,
.scenario-toggle,
.scenario-counts {
  display: flex;
  align-items: center;
}

.outside-scenario-head {
  justify-content: space-between;
  gap: 12px;
}

.outside-scenario-title strong,
.outside-scenario-title small {
  display: block;
}

.outside-scenario-title strong {
  color: #dff6ff;
  font-size: 0.875rem;
}

.outside-scenario-title small {
  margin-top: 2px;
  color: #66849b;
  font-size: 0.6875rem;
}

.scenario-toggle {
  position: relative;
  flex: 0 0 auto;
  gap: 7px;
  color: #b8d5e6;
  font-size: 0.8125rem;
  font-weight: 700;
  cursor: pointer;
}

.scenario-toggle input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.scenario-switch {
  position: relative;
  display: block;
  width: 42px;
  height: 23px;
  border: 1px solid rgba(95, 163, 205, 0.44);
  border-radius: 99px;
  background: rgba(16, 52, 82, 0.86);
  transition: 150ms ease;
}

.scenario-switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #8caabd;
  transition: 150ms ease;
}

.scenario-toggle input:checked + .scenario-switch {
  border-color: var(--gold);
  background: rgba(255, 214, 102, 0.18);
  box-shadow: 0 0 12px rgba(255, 214, 102, 0.16);
}

.scenario-toggle input:checked + .scenario-switch::after {
  left: 22px;
  background: var(--gold);
}

.scenario-toggle input:focus-visible + .scenario-switch {
  outline: 2px solid #effcff;
  outline-offset: 2px;
}

.scenario-counts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 9px;
}

.scenario-counts span {
  min-width: 0;
  padding: 6px 7px;
  border: 1px solid rgba(70, 150, 202, 0.13);
  border-radius: 4px;
  color: #708da3;
  background: rgba(2, 18, 35, 0.4);
  font-size: 0.6875rem;
}

.scenario-counts strong {
  display: block;
  margin-top: 1px;
  overflow: hidden;
  color: #d8f5ff;
  font-size: 0.9375rem;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scenario-counts span:last-child strong {
  color: #ffe18d;
}

.scenario-result {
  margin: 8px 0 0;
  color: #8aa7ba;
  font-size: 0.75rem;
  line-height: 1.55;
}

.scenario-result strong {
  color: #ffe18d;
  font-size: 0.8125rem;
}

.scenario-disclaimer {
  margin: 5px 0 0;
  color: #5f7b90;
  font-size: 0.6875rem;
  line-height: 1.5;
}

.weights-panel,
.matrix-panel {
  margin-bottom: 12px;
}

.weights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 9px;
}

.weight-card {
  min-width: 0;
  padding: 13px;
  border: 1px solid rgba(72, 151, 203, 0.16);
  border-radius: 6px;
  background: rgba(45, 111, 159, 0.07);
}

.weight-card:first-child {
  border-color: rgba(255, 214, 102, 0.34);
  background: linear-gradient(135deg, rgba(255, 214, 102, 0.09), rgba(45, 111, 159, 0.05));
}

.weight-top {
  justify-content: space-between;
  gap: 8px;
}

.weight-priority {
  color: var(--muted);
  font-size: 0.75rem;
}

.weight-value {
  color: var(--cyan-bright);
  font-size: 1.35rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.weight-card:first-child .weight-value {
  color: var(--gold);
}

.weight-card h3 {
  min-height: 42px;
  margin: 8px 0 6px;
  color: #dbeaf4;
  font-size: 0.875rem;
  line-height: 1.35;
}

.weight-card p {
  margin: 0;
  color: #718da3;
  font-size: 0.8125rem;
}

.formula-note {
  display: grid;
  grid-template-columns: 1.25fr 1fr 1fr;
  gap: 16px;
  margin-top: 13px;
  padding: 13px 15px;
  border: 1px dashed rgba(81, 174, 228, 0.24);
  border-radius: 6px;
  background: rgba(29, 93, 137, 0.07);
}

.formula-note p {
  margin: 0;
  color: #91aabd;
  font-size: 0.875rem;
}

.formula-note strong {
  color: var(--cyan-bright);
}

.legend {
  gap: 13px;
  color: var(--muted);
  font-size: 0.8125rem;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.legend i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.legend i.excellent { background: var(--success); }
.legend i.good { background: var(--blue); }
.legend i.watch { background: var(--gold); }
.legend i.risk { background: var(--danger); }

.table-wrap {
  overflow-x: auto;
  border: 1px solid rgba(58, 128, 175, 0.14);
  border-radius: 7px;
}

table {
  width: 100%;
  min-width: 1620px;
  border-collapse: collapse;
  font-size: 0.875rem;
}

thead {
  background: rgba(17, 70, 113, 0.35);
}

thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #0a2948;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid rgba(71, 131, 168, 0.13);
  text-align: right;
  white-space: nowrap;
}

th {
  color: #88a8bd;
  font-size: 0.8125rem;
  font-weight: 600;
}

th small {
  display: block;
  margin-top: 3px;
  color: #58768c;
  font-size: 0.6875rem;
  font-weight: 500;
}

.scenario-table-tag {
  display: inline-block;
  margin-left: 5px;
  padding: 1px 4px;
  border: 1px solid rgba(255, 214, 102, 0.42);
  border-radius: 3px;
  color: #ffe18d;
  background: rgba(255, 214, 102, 0.08);
  font-size: 0.625rem;
  line-height: 1.35;
  vertical-align: 1px;
}

th:nth-child(1),
td:nth-child(1) {
  width: 66px;
  text-align: center;
}

th:nth-child(1),
td:nth-child(1) {
  position: sticky;
  left: 0;
  z-index: 2;
  background: #081c33;
}

th:nth-child(2),
td:nth-child(2) {
  min-width: 190px;
  text-align: left;
}

th:nth-child(2),
td:nth-child(2) {
  position: sticky;
  left: 66px;
  z-index: 2;
  background: #081c33;
  box-shadow: 9px 0 14px rgba(2, 9, 20, 0.24);
}

thead th:nth-child(1),
thead th:nth-child(2) {
  z-index: 4;
  background: #0a2948;
}

tbody tr.active td:nth-child(1),
tbody tr.active td:nth-child(2) {
  background: #0a3049;
}

tbody tr.top-three-row td:nth-child(1),
tbody tr.top-three-row td:nth-child(2) {
  background: #0b2940;
}

tbody tr.top-three-row.rank-1 td:nth-child(1),
tbody tr.top-three-row.rank-1 td:nth-child(2) {
  background: #2c2a24;
}

tbody tr {
  transition: 120ms ease;
}

tbody tr:hover,
tbody tr.active {
  background: rgba(34, 211, 238, 0.065);
}

tbody tr.top-three-row {
  background: linear-gradient(90deg, rgba(45, 126, 178, 0.1), transparent 52%);
}

tbody tr.top-three-row.rank-1 {
  background: linear-gradient(90deg, rgba(255, 214, 102, 0.105), transparent 58%);
}

tbody tr.top-three-row.rank-1 td:first-child { box-shadow: inset 4px 0 var(--gold); }
tbody tr.top-three-row.rank-2 td:first-child { box-shadow: inset 4px 0 #c7d8e6; }
tbody tr.top-three-row.rank-3 td:first-child { box-shadow: inset 4px 0 #cf925e; }

tbody tr:last-child td {
  border-bottom: 0;
}

.matrix-rank {
  color: #7191a8;
  font-weight: 800;
}

.matrix-rank.top {
  display: inline-flex;
  min-width: 52px;
  justify-content: center;
  padding: 4px 6px;
  border: 1px solid rgba(255, 214, 102, 0.32);
  border-radius: 4px;
  color: var(--gold);
  background: rgba(255, 214, 102, 0.07);
  font-size: 0.75rem;
}

.matrix-org {
  display: grid;
}

.matrix-org strong {
  color: #e8f7ff;
  font-size: 1rem;
}

.matrix-org small {
  margin-top: 2px;
  color: #7693a8;
  font-size: 0.8125rem;
}

.matrix-org small b {
  margin-left: 3px;
  color: #c7f3ff;
  font-size: 0.9375rem;
}

.matrix-meter {
  display: grid;
  min-width: 126px;
  gap: 6px;
  color: var(--blue);
}

.matrix-meter.excellent { color: var(--success); }
.matrix-meter.good { color: var(--blue); }
.matrix-meter.watch { color: var(--gold); }
.matrix-meter.risk { color: var(--magenta); }

.meter-reading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.meter-reading strong {
  color: #eaf9ff;
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
}

.meter-reading small {
  color: currentColor;
  font-size: 0.6875rem;
}

.meter-track {
  height: 9px;
  overflow: hidden;
  border-radius: 2px;
  background: repeating-linear-gradient(90deg, rgba(91, 154, 194, 0.14) 0 6px, transparent 6px 8px);
}

.meter-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: currentColor;
  box-shadow: 0 0 9px currentColor;
}

.heat-value {
  display: inline-flex;
  min-width: 54px;
  justify-content: flex-end;
  padding: 4px 7px;
  border: 1px solid transparent;
  border-radius: 4px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.heat-value.good {
  border-color: rgba(34, 211, 238, 0.16);
  color: #8beeff;
  background: rgba(34, 211, 238, 0.09);
}

.heat-value.excellent {
  border-color: rgba(39, 230, 163, 0.18);
  color: #98f5d6;
  background: rgba(39, 230, 163, 0.09);
}

.heat-value.watch {
  border-color: rgba(255, 214, 102, 0.16);
  color: #ffe293;
  background: rgba(255, 214, 102, 0.085);
}

.heat-value.risk {
  border-color: rgba(255, 102, 125, 0.14);
  color: #ff9bae;
  background: rgba(255, 102, 125, 0.07);
}

.matrix-score {
  color: var(--cyan-bright);
  font-size: 1.12rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.score-cell {
  display: grid;
  min-width: 82px;
  gap: 7px;
}

.score-cell > span {
  height: 7px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(66, 147, 198, 0.12);
}

.score-cell > span i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--cyan));
}

.mobile-org-list {
  display: none;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 3px 0;
  color: #547188;
  font-size: 0.8125rem;
}

footer p {
  margin: 0;
}

@media (max-width: 1180px) {
  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .primary-grid {
    grid-template-columns: minmax(290px, 0.78fr) minmax(500px, 1.5fr);
  }

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

  .weight-card h3 {
    min-height: auto;
  }
}

@media (max-width: 760px) {
  .top-three-panel {
    padding: 18px 13px 17px;
  }

  .top-three-panel .panel-heading {
    margin-bottom: 4px;
  }

  .top-three-panel .panel-heading h2 {
    font-size: 1.2rem;
  }

  .top-three-note {
    display: none;
  }

  .podium-grid {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 52px 0 0;
  }

  .podium-slot-1,
  .podium-slot-2,
  .podium-slot-3 {
    grid-column: 1;
  }

  .podium-slot-1 { grid-row: 1; }
  .podium-slot-2 { grid-row: 2; }
  .podium-slot-3 { grid-row: 3; }

  .podium-card,
  .podium-rank-1 {
    --podium-lift: 0px;
    grid-template-rows: auto auto auto;
    justify-items: start;
    align-content: center;
    min-height: 134px;
    padding: 16px 58px 16px 102px;
    border-radius: 12px 12px 6px 6px;
    text-align: left;
  }

  .podium-rank-1 {
    min-height: 166px;
    padding-left: 120px;
  }

  .champion-mark {
    top: -31px;
    right: 0;
    left: 0;
    text-align: center;
  }

  .podium-medal,
  .podium-rank-1 .podium-medal {
    top: 13px;
    right: 13px;
    left: auto;
    width: 48px;
    height: 48px;
    border-width: 2px;
    box-shadow:
      0 0 0 3px rgba(3, 17, 35, 0.9),
      0 0 0 4px color-mix(in srgb, var(--podium-color) 58%, transparent),
      0 0 14px color-mix(in srgb, var(--podium-color) 30%, transparent);
  }

  .podium-rank-1 .podium-medal {
    width: 56px;
    height: 56px;
  }

  .podium-medal small {
    font-size: 0.5rem;
  }

  .podium-medal strong {
    font-size: 1.42rem;
  }

  .podium-avatar,
  .podium-rank-1 .podium-avatar {
    position: absolute;
    top: 50%;
    left: 16px;
    width: 72px;
    height: 72px;
    padding: 5px;
    transform: translateY(-50%);
  }

  .podium-rank-1 .podium-avatar {
    width: 88px;
    height: 88px;
  }

  .podium-avatar > span {
    font-size: 2rem;
  }

  .podium-rank-1 .podium-avatar > span {
    font-size: 2.35rem;
  }

  .podium-org {
    padding-right: 4px;
    font-size: 1.08rem;
    white-space: normal;
  }

  .podium-ribbon {
    width: min(100%, 220px);
    min-height: 38px;
    justify-content: flex-start;
    gap: 7px;
    padding: 6px 22px;
    clip-path: polygon(0 14%, 8% 14%, 8% 0, 92% 0, 92% 14%, 100% 14%, 94% 50%, 100% 86%, 92% 86%, 92% 100%, 8% 100%, 8% 86%, 0 86%, 6% 50%);
  }

  .podium-ribbon small {
    font-size: 0.75rem;
  }

  .podium-ribbon strong {
    font-size: 1rem;
  }

  .podium-score {
    justify-content: flex-start;
  }

  .podium-score small,
  .podium-score em {
    font-size: 0.75rem;
  }

  .podium-score strong {
    font-size: 1.45rem;
  }

  .podium-rank-1 .podium-score strong {
    font-size: 1.75rem;
  }

  .top-three-panel .panel-heading {
    margin-bottom: 14px;
    text-align: left;
  }

  .top-three-list {
    gap: 10px;
  }

  .top-three-card,
  .top-three-card.rank-1 {
    grid-template-columns: 58px minmax(0, 1fr) auto;
    grid-template-areas:
      "rank identity score"
      "progress progress progress";
    gap: 9px 10px;
    min-height: 104px;
    padding: 13px 12px;
  }

  .top-three-card.rank-1 {
    min-height: 112px;
  }

  .top-three-rank small {
    font-size: 0.6875rem;
  }

  .top-three-rank strong {
    font-size: 1.65rem;
  }

  .top-three-identity > strong {
    font-size: 1.04rem;
  }

  .top-three-identity > span {
    margin-top: 4px;
    font-size: 0.75rem;
  }

  .top-three-identity b {
    margin-left: 4px;
    font-size: 0.9rem;
  }

  .top-three-score strong {
    font-size: 1.65rem;
  }

  .top-three-progress span {
    font-size: 0.75rem;
  }
}

@media (max-width: 880px) {
  .command-header {
    min-height: 88px;
  }

  .header-status {
    gap: 12px;
  }

  .status-chip {
    display: none;
  }

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

  .leaderboard {
    grid-auto-rows: auto;
    flex: none;
    max-height: clamp(320px, 56dvh, 440px);
    -webkit-overflow-scrolling: touch;
  }

  .leaderboard-panel,
  .leaderboard-panel.compact {
    align-self: auto;
  }

  .leaderboard-panel:not(.compact) .leaderboard {
    grid-auto-rows: auto;
    flex: none;
    max-height: clamp(320px, 56dvh, 440px);
  }

  .sort-chips {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .sort-chip-list {
    flex-wrap: nowrap;
    padding: 2px 2px 6px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scrollbar-color: rgba(63, 157, 216, 0.38) transparent;
    scrollbar-width: thin;
  }

  .sort-chip-list label {
    flex: 0 0 auto;
    scroll-snap-align: start;
  }

  .sort-chip-list span {
    min-height: 44px;
  }

  .source-note,
  .formula-note {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

@media (max-width: 680px) {
  body {
    background-size: 22px 22px, 22px 22px, auto, auto;
  }

  .command-header {
    align-items: flex-start;
    min-height: auto;
    padding: 16px 15px 15px;
  }

  .brand-block {
    gap: 10px;
  }

  .brand-mark {
    width: 24px;
    margin-top: 3px;
  }

  .brand-mark span {
    height: 5px;
  }

  .eyebrow {
    font-size: 0.75rem;
  }

  h1 {
    margin-top: 2px;
    font-size: 1.4rem;
    letter-spacing: 0.03em;
  }

  .update-time span {
    font-size: 0.75rem;
  }

  .update-time strong {
    font-size: 0.8125rem;
  }

  .dashboard-shell {
    padding: 15px 10px 26px;
  }

  .toolbar {
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 10px;
  }

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

  .toolbar-actions {
    grid-column: 1;
    width: 100%;
  }

  .search-control {
    width: 100%;
    flex: 1 1 auto;
  }

  .select-control span {
    display: none;
  }

  .select-control select {
    max-width: 128px;
    padding-left: 10px;
  }

  .scenario-banner {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  .scenario-banner button {
    align-self: flex-start;
  }

  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .summary-card {
    min-height: 126px;
    padding: 14px 13px;
  }

  .summary-label small {
    display: none;
  }

  .summary-value strong {
    font-size: 2rem;
  }

  .summary-value.word strong {
    font-size: 1.28rem;
  }

  .summary-card p {
    overflow: hidden;
    font-size: 0.8125rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .panel {
    padding: 15px 12px;
  }

  .panel-heading {
    margin-bottom: 13px;
  }

  .panel-heading h2 {
    font-size: 1.08rem;
  }

  .section-kicker {
    font-size: 0.75rem;
  }

  .rank-row {
    grid-template-columns: 47px minmax(104px, 1.2fr) minmax(62px, 0.8fr) 52px;
    padding-right: 8px;
  }

  .rank-name strong {
    font-size: 0.9375rem;
  }

  .rank-name small {
    font-size: 0.8125rem;
  }

  .rank-name small span {
    display: none;
  }

  .rank-score {
    font-size: 1rem;
  }

  .top-three-note {
    display: none;
  }

  .detail-hero {
    grid-template-columns: 112px 1fr;
    gap: 16px;
    min-height: auto;
    padding: 6px 0 18px;
  }

  .score-orbit {
    width: 108px;
    height: 108px;
  }

  .score-orbit::after {
    inset: 11px;
  }

  .orbit-core {
    width: 78px;
  }

  .orbit-core strong {
    font-size: 2rem;
  }

  .orbit-core span {
    font-size: 0.75rem;
  }

  .selected-title-row {
    align-items: flex-start;
  }

  .selected-title-row h3 {
    font-size: 1.3rem;
  }

  .grade-badge {
    padding: 4px 6px;
    font-size: 0.75rem;
  }

  .selected-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    margin-top: 12px;
  }

  .selected-meta div {
    padding: 7px 8px;
  }

  .selected-meta div:last-child {
    grid-column: 1 / -1;
  }

  .metric-breakdown {
    grid-template-columns: 1fr;
    gap: 13px;
  }

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

  .metric-facts > div {
    padding: 7px 6px;
  }

  .outside-scenario-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .metric-facts span {
    font-size: 0.75rem;
  }

  .metric-facts strong {
    font-size: 0.9375rem;
  }

  .metric-context,
  .metric-foot {
    font-size: 0.75rem;
  }

  .weights-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .weight-card {
    padding: 11px;
  }

  .weight-card h3 {
    min-height: 39px;
    font-size: 0.8125rem;
  }

  .weight-card p {
    font-size: 0.75rem;
  }

  .legend {
    display: none;
  }

  .table-wrap {
    display: none;
  }

  .mobile-org-list {
    display: grid;
    gap: 10px;
  }

  .mobile-org-card {
    padding: 14px;
    border: 1px solid rgba(68, 147, 196, 0.15);
    border-radius: 7px;
    background: rgba(44, 112, 158, 0.065);
  }

  .mobile-org-card.top-mobile {
    border-color: rgba(121, 220, 255, 0.4);
    background: linear-gradient(110deg, rgba(48, 129, 180, 0.15), rgba(18, 55, 87, 0.08));
  }

  .mobile-org-card.top-mobile.rank-1 {
    border-color: rgba(255, 214, 102, 0.5);
    background: linear-gradient(110deg, rgba(255, 214, 102, 0.11), rgba(18, 55, 87, 0.08));
  }

  .mobile-org-card.top-mobile.rank-3 {
    border-color: rgba(255, 171, 107, 0.42);
  }

  .mobile-org-card.active {
    border-color: rgba(34, 211, 238, 0.4);
    background: rgba(34, 211, 238, 0.08);
  }

  .mobile-card-top,
  .mobile-card-bottom {
    justify-content: space-between;
    gap: 12px;
  }

  .mobile-card-title {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 9px;
  }

  .mobile-card-title b {
    color: var(--gold);
    font-size: 0.8125rem;
  }

  .mobile-card-title strong,
  .mobile-card-title small {
    display: block;
  }

  .mobile-card-title strong {
    font-size: 1rem;
  }

  .mobile-card-title small {
    color: #819eb3;
    font-size: 0.8125rem;
  }

  .mobile-card-title small em {
    color: #d7f6ff;
    font-style: normal;
    font-weight: 700;
  }

  .mobile-score {
    color: var(--cyan-bright);
    font-size: 1.45rem;
    font-weight: 900;
  }

  .mobile-card-track {
    height: 5px;
    margin: 10px 0 9px;
    overflow: hidden;
    border-radius: 99px;
    background: rgba(94, 160, 202, 0.1);
  }

  .mobile-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 12px;
    margin: 13px 0;
    padding: 11px 0;
    border-top: 1px solid rgba(73, 145, 190, 0.13);
    border-bottom: 1px solid rgba(73, 145, 190, 0.13);
  }

  .mobile-metric {
    display: grid;
    gap: 5px;
    color: var(--blue);
  }

  .mobile-metric.excellent { color: var(--success); }
  .mobile-metric.good { color: var(--blue); }
  .mobile-metric.watch { color: var(--gold); }
  .mobile-metric.risk { color: var(--magenta); }

  .mobile-metric > div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 6px;
  }

  .mobile-metric span {
    overflow: hidden;
    color: #8da7b9;
    font-size: 0.75rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-metric strong {
    color: #ecfaff;
    font-size: 0.8125rem;
    font-variant-numeric: tabular-nums;
  }

  .mobile-metric > i {
    display: block;
    height: 6px;
    overflow: hidden;
    border-radius: 2px;
    background: rgba(88, 154, 196, 0.12);
  }

  .mobile-metric > i b {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: currentColor;
  }

  .mobile-card-track i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--blue), var(--cyan));
  }

  .mobile-card-bottom {
    align-items: flex-end;
  }

  .mobile-card-bottom p {
    margin: 0;
    color: #7f9aae;
    font-size: 0.8125rem;
  }

  .mobile-card-bottom p span {
    color: #ff9bae;
  }

  .mobile-card-bottom button {
    min-height: 42px;
    padding: 7px 10px;
    border: 1px solid rgba(34, 211, 238, 0.28);
    border-radius: 4px;
    color: #a9edff;
    background: rgba(34, 211, 238, 0.06);
    font-size: 0.8125rem;
  }

  footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }
}

/* Compact overview leaders and readable supporting text. */
.toolbar-overview {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  gap: 16px;
  min-width: 0;
}

.toolbar-overview .sort-chips {
  display: block;
  grid-column: auto;
  margin: 0;
}

.toolbar-overview .sort-chips legend {
  margin-bottom: 9px;
  font-size: 0.875rem;
}

.toolbar-overview .sort-chip-list {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 8px;
  padding: 0;
  overflow: visible;
}

.toolbar-overview .sort-chip-list label {
  min-width: 0;
}

.toolbar-overview .sort-chip-list span {
  min-height: 44px;
  gap: 4px;
  padding: 0 7px;
  font-size: 0.875rem;
}

.toolbar-overview .sort-chip-list span b {
  padding: 2px 4px;
  font-size: 0.6875rem;
}

.summary-leaders .compact-top-three {
  min-width: 0;
  margin: 0;
  padding: 12px;
  border-radius: 8px;
}

.summary-leaders .compact-top-three::after {
  display: none;
}

.compact-top-three .panel-heading {
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 9px;
  text-align: left;
}

.compact-top-three .panel-heading h2 {
  margin: 0;
  font-size: 1rem;
  letter-spacing: 0.03em;
}

.compact-top-three .top-three-note {
  position: static;
  display: block;
  font-size: 0.8125rem;
  white-space: nowrap;
}

.compact-top-three .top-three-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.compact-top-three .top-three-card {
  grid-template-columns: 34px minmax(0, 1fr);
  grid-template-areas: "rank score" "identity identity" "progress progress";
  gap: 8px 4px;
  min-height: 115px;
  padding: 10px;
  border-color: rgba(var(--rank-rgb), 0.74);
  border-left-width: 4px;
  border-radius: 6px;
  background:
    linear-gradient(115deg, rgba(var(--rank-rgb), 0.3), rgba(var(--rank-rgb), 0.09) 65%, rgba(4, 20, 40, 0.55)),
    #091a2c;
  box-shadow: inset 0 1px rgba(var(--rank-rgb), 0.2);
}

.compact-top-three .top-three-card.rank-1 {
  --rank-color: #ffda69;
  --rank-rgb: 255, 202, 64;
  --metal-dark: #9b6918;
}

.compact-top-three .top-three-card.rank-2 {
  --rank-color: #e1ebf5;
  --rank-rgb: 205, 222, 240;
  --metal-dark: #687f98;
}

.compact-top-three .top-three-card.rank-3 {
  --rank-color: #f2aa72;
  --rank-rgb: 231, 140, 75;
  --metal-dark: #91502d;
}

.compact-top-three .top-three-card:hover,
.compact-top-three .top-three-card:focus-visible,
.compact-top-three .top-three-card.active {
  border-color: var(--rank-color);
  box-shadow: inset 0 0 0 1px rgba(var(--rank-rgb), 0.3), 0 0 14px rgba(var(--rank-rgb), 0.13);
}

.compact-top-three .top-three-card:focus-visible {
  outline: 2px solid var(--rank-color);
  outline-offset: 2px;
}

.compact-top-three .top-three-card::after {
  display: none;
}

.compact-top-three .top-three-rank strong {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--rank-color);
  border-radius: 50%;
  color: #132237;
  background: linear-gradient(135deg, #fff8e4, var(--rank-color) 47%, var(--metal-dark));
  font-size: 1.0625rem;
  text-shadow: none;
}

.compact-top-three .top-three-identity > strong {
  overflow: visible;
  font-size: 1rem;
  line-height: 1.35;
  letter-spacing: 0;
  white-space: normal;
}

.compact-top-three .top-three-identity > span {
  overflow: visible;
  margin-top: 3px;
  font-size: 0.8125rem;
  color: #b8c8d5;
  white-space: normal;
}

.compact-top-three .top-three-identity b {
  margin-left: 5px;
  font-size: 0.9375rem;
  white-space: nowrap;
}

.compact-top-three .top-three-score strong {
  font-size: 1.75rem;
}

.compact-top-three .top-three-score em {
  margin-left: 3px;
  font-size: 0.8125rem;
}

.compact-top-three .top-three-progress {
  display: block;
}

.compact-top-three .top-three-progress > i {
  height: 5px;
  background: rgba(var(--rank-rgb), 0.15);
}

.compact-top-three .top-three-progress > i b {
  background: linear-gradient(90deg, var(--metal-dark), var(--rank-color), color-mix(in srgb, var(--rank-color) 65%, white));
  box-shadow: 0 0 10px rgba(var(--rank-rgb), 0.4);
}

.summary-value.word strong {
  line-height: 1.25;
  background: transparent;
  box-shadow: none;
  text-shadow: none;
}

.summary-label small,
.selected-meta dt,
.metric-label small,
.metric-facts span,
.metric-facts strong small,
.metric-foot,
.metric-context,
.outside-scenario-title small,
.scenario-counts span,
.scenario-result,
.scenario-disclaimer,
.weight-priority,
.weight-card p,
th small,
.matrix-org small,
.meter-reading small,
.rank-name small span,
.mobile-card-title small,
.mobile-metric span,
.mobile-card-bottom p,
footer {
  font-size: 0.875rem;
}

.panel-hint,
.summary-card p {
  font-size: 0.9375rem;
}

.metric-context,
.summary-card p,
.metric-facts strong {
  overflow: visible;
  white-space: normal;
}

.metric-label {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: center;
  gap: 3px 10px;
  margin: -14px -14px 14px;
  padding: 13px 14px;
  border-bottom: 1px solid #315875;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(110deg, #163c5c, #102d47);
}

.metric-label .metric-index {
  display: grid;
  place-items: center;
  grid-row: 1 / 3;
  width: 32px;
  height: 34px;
  border: 1px solid #508abb;
  border-radius: 5px;
  background: #1c4b70;
  color: #b9e2ff;
  font-size: 0.875rem;
  font-weight: 700;
}

.metric-label > small {
  grid-column: 2;
  color: #aecbdf;
}

.metric-selected {
  border-color: #7ac4ff;
  box-shadow: 0 0 0 1px rgba(122, 196, 255, 0.35);
}

.metric-selected .metric-label {
  background: linear-gradient(110deg, #20557e, #123650);
  border-bottom-color: #578cb3;
}

.signing-metric .metric-label {
  background: linear-gradient(110deg, #3a3b2a, #193047);
  border-bottom-color: #786c3a;
}

.signing-metric .metric-index {
  border-color: #b49a4f;
  background: #5a4d26;
  color: #ffe291;
}

.metric-foot {
  flex-wrap: wrap;
  gap: 3px 10px;
}

.search-control input {
  min-width: 0;
}

.rank-row {
  grid-template-columns: 44px minmax(0, 1fr) minmax(24px, 0.5fr) 54px;
  gap: 8px;
  padding: 8px;
}

@media (max-width: 1050px) {
  .toolbar {
    grid-template-columns: 1fr;
    gap: 14px;
  }

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

  .toolbar-actions {
    justify-content: flex-start;
    min-width: 0;
  }

  .search-control {
    flex: 1;
    min-width: 0;
    width: auto;
  }
}

@media (max-width: 900px) {
  .toolbar-overview {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

@media (max-width: 600px) {
  .rank-row {
    grid-template-columns: 38px minmax(0, 1fr) minmax(18px, 0.4fr) 48px;
    gap: 6px;
    padding: 8px 6px;
  }

  .compact-top-three .top-three-list {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .compact-top-three .top-three-card {
    grid-template-columns: 34px minmax(0, 1fr) auto;
    grid-template-areas: "rank identity score" "progress progress progress";
    min-height: 0;
    gap: 7px 8px;
    padding: 8px 10px;
  }

  .compact-top-three .top-three-identity > span {
    margin-top: 1px;
  }

  .compact-top-three .top-three-progress > i {
    height: 3px;
  }

  .metric-facts > div {
    padding: 8px 6px;
  }
}

@media (max-width: 380px) {
  .detail-hero {
    grid-template-columns: 1fr;
  }

  .score-orbit {
    justify-self: center;
  }
}

.signing-metric {
  grid-column: 1 / -1;
}

.signing-details {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid var(--line-soft);
}

.signing-channels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.signing-channel {
  --channel-color: #65deef;
  min-width: 0;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--channel-color) 25%, transparent);
  border-top: 2px solid var(--channel-color);
  border-radius: 6px;
  background: color-mix(in srgb, var(--channel-color) 4%, #06182c);
}

.signing-channel.mid {
  --channel-color: #bba0ff;
}

.signing-channel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 10px;
}

.signing-channel-head h4 {
  margin: 0;
  color: var(--channel-color);
  font-size: 1rem;
}

.signing-channel-head > span {
  color: #97aec1;
  font-size: 0.875rem;
}

.signing-channel-head b {
  margin-left: 3px;
  color: #ecf7ff;
  font-size: 1.125rem;
}

.signing-channel-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 10px;
  margin: 14px 0 0;
}

.signing-channel-stats > div {
  min-width: 0;
}

.signing-channel-stats dt {
  margin-bottom: 5px;
  color: #98b0c4;
  font-size: 0.875rem;
}

.signing-channel-stats dd {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px;
  margin: 0;
  color: #edf8ff;
  font-size: 1.5rem;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.signing-channel-stats dd small {
  color: #94aec2;
  font-size: 0.8125rem;
  font-weight: 400;
  white-space: nowrap;
}

.signing-average dd {
  color: var(--channel-color);
}

.signing-total {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 7px 18px;
  margin-top: 12px;
  padding: 11px 13px;
  border-radius: 5px;
  color: #9db4c7;
  background: rgba(83, 146, 192, 0.08);
  font-size: 0.875rem;
}

.signing-total > strong {
  color: #d9edfb;
}

.signing-total span {
  white-space: nowrap;
}

.signing-total b {
  color: #ffe291;
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
}

.signing-note {
  margin: 10px 0 0;
  color: #8fa9bf;
  font-size: 0.875rem;
  line-height: 1.65;
}

.signing-note strong {
  display: block;
  color: #e8be6f;
  font-weight: 500;
}

.rank-number {
  white-space: nowrap;
}

@media (max-width: 600px) {
  .signing-channels {
    grid-template-columns: 1fr;
  }

  .signing-channel {
    padding: 12px;
  }
}

/* The extra shortcut floats above the document and never changes its width. */
.floating-sort {
  position: fixed;
  top: 50%;
  left: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 6px;
  transform: translateY(-50%);
}

.floating-sort-toggle {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 8px;
  width: 38px;
  min-height: 120px;
  padding: 10px 4px;
  border: 1px solid #3b6697;
  border-left: 0;
  border-radius: 0 8px 8px 0;
  color: #c3dfff;
  background: #0c2847;
  box-shadow: 3px 0 14px rgba(0, 0, 0, 0.24);
}

.floating-sort-toggle span {
  writing-mode: vertical-rl;
  font-size: 0.875rem;
  letter-spacing: 0.12em;
}

.floating-sort-toggle b {
  font-size: 1.25rem;
  line-height: 1;
}

.floating-sort-toggle:hover,
.floating-sort-toggle[aria-expanded="true"] {
  color: #fff1b1;
  border-color: #bda04d;
}

.floating-sort-toggle:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.floating-sort-panel {
  width: 174px;
  max-height: calc(100dvh - 24px);
  padding: 12px 10px;
  overflow-y: auto;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #081a2e;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.38);
}

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

.floating-sort .sort-chips {
  display: block;
  margin: 0;
}

.floating-sort .sort-chips legend {
  margin: 0 0 12px 4px;
  font-size: 0.875rem;
  color: #a6c1d7;
}

.floating-sort .sort-chip-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 9px;
  padding: 0;
  overflow: visible;
}

.floating-sort .sort-chip-list label,
.toolbar-overview .sort-chip-list label {
  --chip: #62a8ff;
  min-width: 0;
}

.floating-sort .sort-chip-list label[data-sort-key="score"],
.toolbar-overview .sort-chip-list label[data-sort-key="score"] {
  --chip: #ffd666;
}

.floating-sort .sort-chip-list span {
  min-height: 48px;
  gap: 4px;
  padding: 0 6px;
  font-size: 0.875rem;
}

.floating-sort .sort-chip-list span b {
  padding: 1px 3px;
  font-size: 0.75rem;
  letter-spacing: 0;
}

.compact-top-three .top-three-identity > span {
  display: flex;
  flex-wrap: wrap;
  column-gap: 5px;
  font-size: 0.875rem;
}

.compact-top-three .top-three-identity b {
  margin-left: 0;
}

.metric-facts {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
}

.metric-facts > div {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 4px;
  padding: 8px 6px;
}

.metric-facts strong { font-size: 1.0625rem; white-space: nowrap; }

.metric-facts span {
  line-height: 1.45;
}

.scenario-counts small {
  display: block;
  margin-top: 4px;
  color: #a0b4c5;
  font-size: 0.8125rem;
  line-height: 1.45;
}

.scenario-equation {
  margin: 10px 0;
  padding: 10px;
  border-left: 2px solid #62a8ff;
  color: #bdd4e6;
  background: rgba(74, 140, 211, 0.08);
  font-size: 0.875rem;
  line-height: 1.6;
}

.scenario-equation strong {
  color: #edf8ff;
  white-space: nowrap;
}

.matrix-key {
  display: grid;
  gap: 5px;
}

.rank-color-note {
  margin: 0;
  color: #91a8bb;
  font-size: 0.8125rem;
}

.matrix-panel .legend {
  flex-wrap: wrap;
  font-size: 0.875rem;
}

.matrix-panel .rank-top { --rank-ink: #ffd666; color: var(--rank-ink); }
.matrix-panel .rank-bottom { --rank-ink: #62a8ff; color: var(--rank-ink); }
.matrix-panel .rank-middle { --rank-ink: #9aa7b5; color: var(--rank-ink); }
.matrix-panel .legend i { background: var(--rank-ink); }
.matrix-panel .meter-reading strong,
.matrix-panel .matrix-score,
.matrix-panel .mobile-score,
.matrix-panel .mobile-card-title > b,
.matrix-panel .mobile-metric strong { color: var(--rank-ink); }
.matrix-panel .meter-track i { box-shadow: none; }
.matrix-panel .score-cell > span i,
.matrix-panel .mobile-card-track i { background: var(--rank-ink); }
.matrix-panel .mobile-card-bottom p span { color: #acb9c7; }
.matrix-panel tbody tr.top-three-row { background: transparent; }
.matrix-panel tbody tr.top-three-row td:nth-child(1),
.matrix-panel tbody tr.top-three-row td:nth-child(2) { background: #081c33; box-shadow: none; }
.matrix-panel tbody tr.active td:nth-child(1),
.matrix-panel tbody tr.active td:nth-child(2) { background: #102b42; }

@media (max-width: 760px) {
  .summary-grid.summary-leaders {
    grid-template-columns: minmax(0, 1fr);
  }

  .summary-leaders > .summary-card {
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 4px 16px;
  }

  .summary-leaders .summary-label {
    grid-column: 1;
  }

  .summary-leaders .summary-value {
    grid-column: 2;
    grid-row: 1 / 3;
    margin: 0;
  }

  .summary-leaders .mini-track {
    grid-column: 1 / -1;
    grid-row: 3;
    margin: 7px 0 0;
  }

  .summary-leaders .summary-card p {
    grid-column: 1;
    grid-row: 2;
    margin: 0;
  }

  .floating-sort-toggle {
    width: 32px;
    min-height: 112px;
  }

  .detail-panel,
  .matrix-panel,
  .weights-panel {
    scroll-margin-top: 16px;
  }

  .matrix-panel .panel-heading {
    flex-wrap: wrap;
    gap: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* Updated source counts and the institution-level trainer scorecard. */
.score-basis {
  margin: -4px 0 16px;
  color: #a9c1d4;
  font-size: 0.875rem;
  line-height: 1.6;
}

.metric-counts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0 0;
}

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

.metric-counts > div {
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(70, 146, 198, 0.17);
  border-radius: 4px;
  background: rgba(3, 20, 35, 0.48);
}

.metric-counts dt {
  color: #96b1c7;
  font-size: 0.875rem;
  line-height: 1.5;
}

.metric-counts dd {
  margin: 5px 0 0;
  color: #dff5ff;
  font-size: 1.25rem;
  font-weight: 700;
}

.metric-counts small {
  font-size: 0.875rem;
  font-weight: 400;
}

.qualification-counts > div:first-child {
  border-color: rgba(255, 214, 102, 0.4);
  background: rgba(255, 214, 102, 0.07);
}

.qualification-counts > div:first-child dd { color: #ffd666; }

.metric-small-note,
.trainer-score-note {
  margin: 9px 0 0;
  color: #95afc2;
  font-size: 0.875rem;
  line-height: 1.6;
}

.metric-not-applicable .metric-facts strong { color: #a5b5c5; }
.metric-not-applicable .metric-track i { background: #a5b5c5; }

.trainer-panel,
.trainer-ranking-panel {
  border-color: rgba(98, 168, 255, 0.34);
}

.trainer-panel .panel-heading,
.trainer-ranking-panel .panel-heading {
  align-items: flex-start;
  gap: 10px;
}

.trainer-panel .panel-heading h2,
.trainer-ranking-panel .panel-heading h2 {
  font-size: 1.125rem;
  letter-spacing: 0;
}

.trainer-ranking-panel .panel-count {
  flex-shrink: 0;
}

.trainer-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(98, 168, 255, 0.24);
  border-left: 3px solid #62a8ff;
  border-radius: 5px;
  background: linear-gradient(120deg, rgba(54, 132, 223, 0.18), rgba(8, 29, 48, 0.7));
}

.trainer-hero > div:first-child { min-width: 0; }
.trainer-hero > div:first-child > span,
.trainer-hero small { display: block; color: #9fbbd0; font-size: 0.875rem; }
.trainer-hero > div:first-child > strong {
  display: block;
  margin: 5px 0;
  color: #ecf7ff;
  font-size: 1.125rem;
  line-height: 1.5;
}

.trainer-score { flex-shrink: 0; text-align: right; }
.trainer-score strong { display: block; color: #80c6ff; font-size: 1.875rem; line-height: 1.2; }
.trainer-score > span { color: #8fabbe; font-size: 0.875rem; }
.trainer-facts { margin-top: 14px; }
.trainer-facts-head,
.trainer-fact {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 76px 86px;
  align-items: center;
  gap: 6px;
  padding: 10px 0;
  font-size: 0.875rem;
}
.trainer-facts-head { padding-top: 0; color: #91acc3; }
.trainer-fact { border-top: 1px solid rgba(93, 151, 193, 0.14); color: #bed7e8; }
.trainer-facts-head > :not(:first-child),
.trainer-fact > :not(:first-child) { text-align: right; }
.trainer-fact > b { color: #e7f5ff; font-variant-numeric: tabular-nums; }
.trainer-fact > strong { color: #80c6ff; font-variant-numeric: tabular-nums; }
.trainer-fact small { color: #8aa8bf; font-size: 0.875rem; font-weight: 400; }
.trainer-ranking-heading { display: flex; justify-content: space-between; gap: 8px; align-items: center; margin-top: 0; }
.trainer-ranking-heading h3 { margin: 0; color: #e9f6ff; font-size: 1rem; }
.trainer-ranking-heading > span { flex-shrink: 0; color: #8faec3; font-size: 0.875rem; }
.ranking-column > .trainer-ranking-panel {
  display: flex;
  flex-direction: column;
  flex: 1 0 auto;
}
.trainer-ranking {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(var(--trainer-row-count, 7), max-content);
  grid-auto-flow: column;
  align-content: start;
  flex: 0 0 auto;
  min-height: 0;
  gap: 6px 8px;
  margin-top: 10px;
}
.trainer-ranking > .empty-state { grid-column: 1 / -1; }
.trainer-rank-row {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  gap: 3px 4px;
  align-items: center;
  min-width: 0;
  min-height: 48px;
  padding: 6px;
  border: 1px solid transparent;
  border-radius: 5px;
  color: #b1cde2;
  background: rgba(45, 111, 159, 0.08);
  text-align: left;
}
.trainer-rank-row:hover,
.trainer-rank-row.active { border-color: rgba(98, 168, 255, 0.65); background: rgba(54, 132, 223, 0.13); }
.trainer-rank-row:focus-visible { outline: 2px solid #80c6ff; outline-offset: -2px; }
.trainer-rank { grid-row: 1; grid-column: 1; font-size: 0.875rem; }
.trainer-rank-name { display: contents; }
.trainer-rank-name strong { grid-row: 1; grid-column: 2 / -1; min-width: 0; color: #e6f4ff; font-size: 0.875rem; line-height: 1.35; }
.trainer-rank-name > span { display: flex; flex-wrap: wrap; gap: 0 4px; grid-row: 2; grid-column: 1 / 3; min-width: 0; color: #b6d8ee; font-size: 0.875rem; line-height: 1.3; }
.trainer-person { white-space: nowrap; }
.trainer-rank-score { grid-row: 2; grid-column: 3; color: #80c6ff; font-size: 1rem; line-height: 1.2; text-align: right; white-space: nowrap; }
.trainer-top .trainer-rank,
.trainer-top .trainer-rank-score { color: #ffd666; }

/* Keep a signed debt and its unit together in every metric view. */
.rank-row:has(.scan-reading) { grid-template-columns: 44px minmax(0, 1fr) minmax(24px, 0.35fr) 72px; }
.scan-reading,
.metric-facts strong .scan-reading { display: inline; color: inherit; font: inherit; white-space: nowrap; }
.scan-unit,
.metric-facts strong .scan-unit,
.trainer-score strong .scan-unit {
  display: inline;
  margin: 0;
  color: inherit;
  font-size: 0.8125rem;
  font-weight: 400;
  line-height: 1.35;
  white-space: nowrap;
}

.signing-channel-head h4,
.outside-scenario-title strong,
.weight-card h3 {
  font-size: 1.0625rem;
  font-weight: 700;
}

@media (max-width: 1050px) {
  .qualification-counts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .qualification-counts > div:first-child { grid-column: 1 / -1; }
}

@media (max-width: 880px) {
  .ranking-column > .trainer-ranking-panel { flex: 0 0 auto; min-height: 0; }
  .trainer-ranking { flex: none; }
}

@media (max-width: 1180px) {
  .toolbar-overview .sort-chip-list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
  .toolbar-overview .sort-chip-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
