:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --ink: #17202a;
  --muted: #647080;
  --line: #d9dee6;
  --accent: #0f766e;
  --accent-strong: #115e59;
  --warn: #b45309;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.45;
}

a {
  color: inherit;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 32px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.brand {
  font-weight: 700;
  text-decoration: none;
}

nav {
  display: flex;
  gap: 18px;
  color: var(--muted);
  font-size: 14px;
}

nav a {
  text-decoration: none;
}

main {
  width: min(1880px, calc(100% - 32px));
  margin: 0 auto;
  padding: 36px 0 56px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 32px;
  align-items: stretch;
}

.hero-copy h1,
.page-head h1,
.detail-grid h1 {
  margin: 0 0 14px;
  font-size: 42px;
  line-height: 1.08;
}

.hero-copy p {
  max-width: 680px;
  color: var(--muted);
  font-size: 18px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent-strong);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 12px;
}

.manufacturer-kicker {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 18px;
  font-weight: 700;
}

.searchbar,
.filters {
  display: flex;
  gap: 10px;
  margin-top: 24px;
}

input {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  font: inherit;
  background: var(--surface);
}

select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 36px 0 12px;
  font: inherit;
  background: var(--surface);
}

.searchbar input {
  min-width: 0;
}

.searchbar .short-code-input {
  width: 96px;
  text-transform: uppercase;
}

.searchbar .model-search-input {
  width: min(420px, 100%);
  flex: 1 1 280px;
}

button,
.button-link {
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  padding: 10px 14px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}

.secondary-button {
  border: 1px solid var(--line);
  background: #f8fafc;
  color: var(--ink);
}

.chart-export-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 10px 0 12px;
}

.chart-export-toolbar label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 9px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.chart-export-toolbar input {
  min-height: 0;
}

.chart-export-toolbar button {
  min-height: 34px;
  border: 1px solid var(--line);
  padding: 6px 10px;
  background: #ffffff;
  color: var(--ink);
  font-size: 13px;
}

.chart-export-toolbar span {
  color: var(--muted);
  font-size: 12px;
}

.hero-panel,
.chart-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
}

.hero-panel > span {
  display: block;
  color: var(--muted);
  font-size: 14px;
}

.hero-panel > strong {
  display: block;
  margin: 4px 0 22px;
  font-size: 56px;
  line-height: 1;
}

.overview-panel > strong {
  font-size: 32px;
}

.overview-metrics {
  display: grid;
  gap: 16px;
}

.overview-metrics section {
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.overview-metrics h2 {
  margin: 0 0 8px;
  font-size: 15px;
  line-height: 1.25;
}

dl {
  margin: 0;
}

.overview-panel dl div,
.facts div {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.overview-panel dl div {
  border-top: 0;
  padding: 5px 0;
}

dt {
  color: var(--muted);
}

dd {
  margin: 0;
  font-weight: 700;
}

.facts dd {
  text-align: right;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 34px;
}

.quick-grid a {
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  text-decoration: none;
  font-weight: 700;
}

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

.stat-tile {
  min-height: 128px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: var(--surface);
}

.stat-tile span {
  display: block;
  color: var(--muted);
  font-size: 14px;
}

.stat-tile strong {
  display: block;
  margin-top: 12px;
  font-size: 42px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.page-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.subtle {
  color: var(--muted);
  margin: 0;
}

.wide-head {
  align-items: flex-start;
}

.data-year {
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  white-space: nowrap;
}

.data-year strong {
  color: var(--ink);
}

.data-year span {
  display: inline-block;
  margin-top: 4px;
  font-size: 12px;
}

.filters {
  margin-top: 0;
  align-items: end;
}

.filters label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.table-wrap {
  overflow-x: auto;
  overflow-y: visible;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}

th {
  color: #334155;
  background: #f3f6f8;
  font-size: 13px;
  font-weight: 700;
}

.filter-row th {
  background: #eef2f5;
  padding: 8px;
  vertical-align: middle;
}

.filter-row input {
  width: 100%;
  min-height: 34px;
  font-size: 14px;
}

.range-inputs {
  display: flex;
  gap: 6px;
  min-width: 0;
}

.range-inputs input {
  min-width: 0;
  padding: 0 8px;
}

.filter-submit-button {
  width: 100%;
  justify-content: center;
}

.clickable-row {
  cursor: pointer;
}

.clickable-row:hover td {
  background: #f0fdfa;
}

.secondary-button {
  background: #e7f4f2;
  color: var(--accent-strong);
  border: 1px solid #b8d9d5;
  justify-content: center;
  width: 100%;
}

.secondary-button.is-active {
  background: #fff7ed;
  color: #9a3412;
  border-color: #fed7aa;
}

.source-pill {
  display: inline-flex;
  min-width: 54px;
  justify-content: center;
  border-radius: 999px;
  padding: 3px 8px;
  background: #eef2f5;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
}

.sort-link {
  display: inline-flex;
  gap: 4px;
  color: inherit;
  text-decoration: none;
}

.sort-link:hover {
  color: var(--accent-strong);
  text-decoration: underline;
}

.table-sort-button {
  display: block;
  width: 100%;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  text-align: right;
}

.table-sort-button:hover {
  color: var(--accent-strong);
  text-decoration: underline;
}

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

.cell-share {
  display: inline-block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
}

.cell-trend {
  display: inline-block;
  margin-top: 1px;
  font-size: 12px;
  line-height: 1.2;
  font-weight: 700;
}

.trend-positive {
  color: #15803d;
}

.trend-negative {
  color: #b91c1c;
}

.trend-neutral {
  color: var(--muted);
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 1fr);
  gap: 28px;
  margin-bottom: 32px;
}

.chart-card h2,
.columns h2,
.full-section h2 {
  margin: 0 0 14px;
  color: #0f172a;
  font-size: 24px;
  line-height: 1.2;
}

.prominent-chart h2 {
  font-size: 26px;
}

.stock-chart {
  width: 100%;
  height: 430px;
  min-height: 380px;
}

.fact-note {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.chart-range-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
  margin: 0 0 8px;
}

.chart-range-form label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
}

.chart-range-form input {
  width: 92px;
  min-height: 34px;
}

.chart-range-form button {
  min-height: 34px;
  padding: 7px 12px;
}

.chart-range-hint {
  margin-bottom: 8px;
  font-size: 12px;
}

.line-chart {
  display: block;
  width: 100%;
  min-height: 260px;
}

.line-chart line {
  stroke: var(--line);
  stroke-width: 2;
}

.line-chart .grid-line {
  stroke: #edf1f5;
  stroke-width: 1;
}

.line-chart polyline {
  fill: none;
  stroke: var(--accent);
  stroke-width: 4;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.line-chart circle {
  fill: var(--surface);
  stroke: var(--accent-strong);
  stroke-width: 3;
}

.line-chart text {
  fill: var(--muted);
  font-size: 12px;
}

.line-chart .axis-label {
  text-anchor: end;
  dominant-baseline: middle;
  font-size: 13px;
}

.chart-year {
  text-anchor: middle;
}

.full-section {
  margin-top: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: baseline;
  margin-bottom: 14px;
}

.compact-head {
  display: block;
}

.compact-head h3 {
  margin: 0 0 4px;
  color: #0f172a;
  font-size: 18px;
  line-height: 1.2;
}

.state-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(300px, 0.95fr);
  gap: 24px;
  align-items: stretch;
}

.search-table table {
  min-width: 1540px;
  table-layout: fixed;
}

.search-table {
  overflow: visible;
}

.search-table .col-hsn {
  width: 96px;
}

.search-table .col-manufacturer {
  width: 180px;
}

.search-table .col-trade {
  width: 190px;
}

.search-table .col-tsn {
  width: 72px;
}

.search-table .col-fuel {
  width: 210px;
}

.search-table .col-kw,
.search-table .col-ccm {
  width: 130px;
}

.search-table .col-count {
  width: 130px;
}

.search-table .col-first {
  width: 132px;
}

.search-table .col-action {
  width: 230px;
}

.code-filter-input {
  width: 100%;
  min-width: 0;
  text-transform: uppercase;
}

input[name="hsn"].code-filter-input,
.year-filter-input {
  min-width: 68px;
}

input[name="type_code"].code-filter-input {
  min-width: 56px;
}

.year-filter-input {
  width: 100%;
}

.fuel-cell {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fuel-filter-cell {
  position: relative;
  z-index: 5;
}

.checkbox-dropdown {
  position: relative;
  width: 100%;
}

.checkbox-dropdown summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 10px;
  background: var(--surface);
  cursor: pointer;
  font-size: 14px;
  font-weight: 400;
  list-style: none;
}

.checkbox-dropdown summary::-webkit-details-marker {
  display: none;
}

.checkbox-dropdown summary::after {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg) translateY(-2px);
}

.checkbox-dropdown[open] summary::after {
  transform: rotate(225deg) translate(-2px, -1px);
}

.checkbox-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 30;
  display: grid;
  gap: 4px;
  width: max(100%, 260px);
  max-height: 190px;
  overflow-y: auto;
  margin-top: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.checkbox-menu label {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-height: 26px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 400;
}

.checkbox-menu input {
  width: 16px;
  min-height: 16px;
  margin: 0;
  padding: 0;
}

.checkbox-menu span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.matrix-wrap {
  max-height: 540px;
}

.matrix-table {
  min-width: 1320px;
}

.state-comparison-layout {
  display: grid;
  grid-template-columns: minmax(980px, 1fr) 360px;
  gap: 18px;
  align-items: start;
}

.state-table-wrap {
  max-height: none;
  overflow: visible;
}

.state-table-wrap .matrix-table {
  min-width: 0;
  table-layout: fixed;
}

.state-table-wrap .matrix-table th,
.state-table-wrap .matrix-table td {
  padding: 8px 6px;
  font-size: 13px;
}

.state-table-wrap .matrix-table th:first-child,
.state-table-wrap .matrix-table td:first-child {
  width: 68px;
}

.state-year-button {
  min-height: 0;
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 3px 6px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.state-year-button:hover,
.state-year-button.is-active {
  border-color: #a7d2cf;
  background: #dcefee;
  color: #115e59;
}

.state-year-button:disabled {
  cursor: default;
  color: #94a3b8;
  border-color: transparent;
  background: transparent;
}

.state-heatmap-panel {
  min-width: 0;
}

.state-heatmap-panel .notice-box {
  margin-bottom: 0;
}

.state-heatmap-panel .echarts-layout {
  overflow: hidden;
}

.state-heatmap-panel .echarts-heatmap {
  height: 720px;
  min-height: 680px;
}

.matrix-table th,
.matrix-table td {
  text-align: right;
  white-space: nowrap;
}

.matrix-table th:first-child,
.matrix-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  text-align: left;
  background: var(--surface);
  font-weight: 700;
}

.matrix-table th:first-child .table-sort-button,
.annual-table th:first-child .table-sort-button {
  text-align: left;
}

.matrix-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
}

.annual-table {
  min-width: 860px;
  table-layout: fixed;
}

.annual-table th,
.annual-table td {
  text-align: right;
  white-space: nowrap;
}

.annual-table th:first-child,
.annual-table td:first-child {
  width: 280px;
  text-align: left;
  white-space: normal;
  font-weight: 700;
}

.source-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -4px 0 12px;
  color: var(--muted);
  font-size: 12px;
}

.source-legend span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 9px;
}

.legend-fz6,
.source-fz6 {
  background: #ecfdf5;
}

.legend-fz2,
.source-fz2 {
  background: #eff6ff;
}

.legend-manual,
.source-manual {
  background: #fef3c7;
}

.source-missing {
  background: #f8fafc;
  color: #64748b;
}

.suppressed-cell {
  color: #7c2d12;
  background: #fff7ed;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
}

.notice-box {
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  background: #fff7ed;
  color: #7c2d12;
  font-size: 14px;
}

.compact-notice {
  margin-top: 16px;
  margin-bottom: 0;
}

.source-section {
  margin-top: 0;
  margin-bottom: 28px;
}

.source-list div {
  display: grid;
  grid-template-columns: minmax(180px, 0.35fr) minmax(0, 1fr);
  gap: 18px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.source-list dd {
  font-weight: 400;
}

.compare-search-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 16px;
  border: 1px solid #b8d9d5;
  border-radius: 8px;
  padding: 14px 16px;
  background: #eef9f7;
}

.compare-search-status[hidden] {
  display: none;
}

.compare-search-status strong {
  display: block;
  color: var(--accent-strong);
}

.compare-search-status p {
  margin: 2px 0 0;
}

.compare-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.overview-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.overview-list a {
  display: grid;
  gap: 6px;
  min-height: 112px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: var(--surface);
  text-decoration: none;
}

.overview-list strong {
  font-size: 18px;
}

.overview-list span,
.overview-list small {
  color: var(--muted);
}

.overview-group-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface);
}

.overview-group-controls label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  padding: 6px 10px;
  background: #f8fafc;
  color: #334155;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.overview-group-controls input {
  width: 16px;
  min-height: 16px;
  margin: 0;
}

.overview-group-controls small {
  min-width: 22px;
  border-radius: 999px;
  padding: 1px 6px;
  background: #e7f4f2;
  color: var(--accent-strong);
  text-align: center;
  font-size: 12px;
}

.compare-chip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  min-height: 42px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--series-color);
  border-radius: 8px;
  padding: 7px 9px;
  background: var(--surface);
}

.compare-chip span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}

.compare-chip a,
.compare-chip button {
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 8px;
  background: #f8fafc;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.compare-chart-card {
  margin-bottom: 28px;
}

.compare-chart-controls {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr)) auto auto;
  gap: 10px;
  align-items: end;
  margin: 12px 0 16px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.compare-chart-controls label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.compare-chart-controls input {
  width: 100%;
  min-height: 38px;
}

.compare-chart-controls button {
  min-height: 38px;
}

.compare-stock-chart {
  width: 100%;
  height: 460px;
  min-height: 380px;
}

.compare-facts-table,
.compare-year-table {
  min-width: 980px;
  table-layout: fixed;
}

.compare-facts-table th:first-child,
.compare-facts-table td:first-child,
.compare-year-table th:first-child,
.compare-year-table td:first-child {
  width: 210px;
  text-align: left;
  font-weight: 700;
}

.compare-facts-table th:not(:first-child),
.compare-year-table th:not(:first-child) {
  border-top: 4px solid var(--series-color);
}

.compare-facts-table td,
.compare-year-table td {
  vertical-align: middle;
}

.compare-facts-table td:not(:first-child) {
  text-align: right;
}

.compare-facts-table th:not(:first-child) {
  text-align: right;
}

.compare-empty {
  display: grid;
  gap: 16px;
}

.compare-empty-loading {
  border-color: #b8d9d5;
  background: #eef9f7;
}

.ranking-head {
  align-items: flex-end;
}

.ranking-dashboard {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  align-items: start;
  margin: 22px 0;
}

.ranking-generator,
.ranking-highlights {
  margin: 22px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 18px;
}

.ranking-generator-wide {
  margin-top: 18px;
}

.ranking-generator h2,
.ranking-highlights h2 {
  margin: 0;
  font-size: 20px;
}

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

.ranking-section-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.ranking-controls {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.ranking-generator .ranking-controls {
  display: grid;
  grid-template-columns: minmax(110px, 0.75fr) minmax(160px, 1fr) minmax(260px, 1.65fr) minmax(140px, 0.9fr) minmax(170px, 0.9fr);
  gap: 12px;
  align-items: end;
  padding: 14px;
  border: 1px solid var(--line);
  background: #f8fafc;
}

.ranking-controls label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.ranking-controls select {
  min-width: 180px;
  color: var(--ink);
  font-weight: 400;
}

.ranking-generator .ranking-controls select,
.ranking-generator .ranking-controls button {
  width: 100%;
}

.highlight-year-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.highlight-year-form select {
  min-width: 110px;
}

.compact-copy {
  margin: 12px 0 0;
  font-size: 13px;
}

.highlight-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 8px;
}

.highlight-item {
  display: grid;
  gap: 5px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  background: #fbfcfd;
}

.highlight-item div {
  display: grid;
  gap: 1px;
}

.highlight-item strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.highlight-item a,
.highlight-item p {
  overflow: hidden;
  margin: 0;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.highlight-item em {
  color: var(--ink);
  font-style: normal;
  font-weight: 700;
  text-align: right;
  font-size: 13px;
}

.ranking-result {
  margin-top: 22px;
}

.ranking-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0;
  color: var(--muted);
}

.ranking-summary strong {
  color: var(--ink);
  font-size: 18px;
}

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

.ranking-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.ranking-card header {
  min-height: 88px;
  padding: 18px 18px 10px;
  border-bottom: 1px solid var(--line);
}

.ranking-card-wide header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  min-height: 0;
}

.ranking-card h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
}

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

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

.ranking-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.ranking-table th,
.ranking-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.ranking-table th {
  color: #334155;
  background: #f8fafc;
  font-size: 12px;
}

.ranking-table .rank-col {
  width: 44px;
  color: var(--muted);
  font-weight: 700;
}

.ranking-table a {
  color: var(--accent-strong);
  font-weight: 700;
  text-decoration: none;
}

.ranking-table .empty-cell {
  color: var(--muted);
  text-align: center;
}

.embedded {
  border-radius: 6px;
}

.heatmap-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: #fbfcfd;
}

.heatmap-layout {
  display: block;
}

.echarts-layout {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.echarts-heatmap {
  width: 100%;
  height: 560px;
  min-height: 420px;
}

.heatmap-scale {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.scale-bar {
  height: 220px;
  width: 18px;
  border-radius: 999px;
  background: linear-gradient(180deg, #115e59, #1f8f87, #5ab5ad, #9fd5d0, #d9f0ef);
  border: 1px solid var(--line);
}

.legend {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.legend span {
  width: 90px;
  height: 10px;
  display: inline-block;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(15, 118, 110, 0.2), rgba(15, 118, 110, 1));
}

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

.placeholder-page {
  max-width: 760px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
}

.placeholder-page h1 {
  margin: 0 0 12px;
  font-size: 38px;
}

footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  padding: 22px 32px;
  font-size: 13px;
  background: var(--surface);
}

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

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

  .ranking-dashboard {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .topbar,
  .page-head {
    align-items: flex-start;
    flex-direction: column;
  }

  nav,
  .searchbar,
  .filters,
  .ranking-controls,
  .compare-chart-controls {
    flex-wrap: wrap;
  }

  .hero,
  .detail-grid,
  .columns,
  .quick-grid,
  .stats-grid,
  .state-layout,
  .state-comparison-layout,
  .ranking-grid {
    grid-template-columns: 1fr;
  }

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

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

  .ranking-generator .ranking-controls {
    grid-template-columns: 1fr;
  }

  .compare-chart-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ranking-card-wide header {
    display: block;
  }

  .hero-copy h1,
  .page-head h1,
  .detail-grid h1 {
    font-size: 32px;
  }
}
