:root {
  --ink: #17201d;
  --muted: #64706b;
  --faint: #8b9590;
  --canvas: #f4f6f5;
  --surface: #ffffff;
  --line: #d8dfdc;
  --line-strong: #bdc9c4;
  --sidebar: #16231f;
  --sidebar-muted: #9fb0aa;
  --green: #117565;
  --green-dark: #0b5d50;
  --green-soft: #e3f1ed;
  --blue: #476a80;
  --blue-soft: #e7eef2;
  --amber: #b96e16;
  --amber-soft: #f8ecd9;
  --red: #aa443d;
  --red-soft: #f6e5e3;
  --shadow: 0 10px 28px rgba(22, 35, 31, 0.08);
  --radius: 6px;
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", Arial, sans-serif;
  color: var(--ink);
  background: var(--canvas);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--canvas);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--canvas);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
  letter-spacing: 0;
}

button,
select {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(17, 117, 101, 0.2);
  outline-offset: 2px;
}

svg {
  display: block;
}

.app-shell {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  color: #f6fbf9;
  background: var(--sidebar);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 44px;
  padding: 0 8px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 5px;
  background: #246c5e;
  color: #ffffff;
  font-weight: 700;
}

.brand strong,
.brand span {
  display: block;
  letter-spacing: 0;
}

.brand strong {
  font-size: 15px;
}

.brand span {
  margin-top: 1px;
  color: var(--sidebar-muted);
  font-size: 11px;
}

.nav-list {
  display: grid;
  gap: 6px;
  margin-top: 36px;
}

.nav-item {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 5px;
  color: var(--sidebar-muted);
  background: transparent;
  text-align: left;
}

.nav-item svg {
  width: 18px;
  height: 18px;
}

.nav-item:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
}

.nav-item.active {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.08);
  background: #244139;
}

.nav-count {
  display: grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 11px;
  color: #ffffff;
  background: var(--amber);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.sidebar-note {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: auto;
  padding: 13px 10px 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  color: var(--sidebar-muted);
  font-size: 11px;
}

.sidebar-note p {
  margin: 0;
}

.signal-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: #5fc4a8;
  box-shadow: 0 0 0 4px rgba(95, 196, 168, 0.12);
}

.main-content {
  width: min(100%, 1540px);
  min-width: 0;
  margin: 0 auto;
  padding: 0 36px 52px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 98px;
  border-bottom: 1px solid var(--line);
}

.topbar h1,
.section-heading h2,
.panel h3,
.firm-detail h2,
.firm-detail h3,
.policy-reading h3,
.modal h2 {
  margin: 0;
  line-height: 1.25;
  letter-spacing: 0;
}

.topbar h1 {
  margin-top: 5px;
  font-size: 23px;
  font-weight: 700;
}

.eyebrow {
  margin: 0;
  color: var(--green-dark);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.data-date {
  color: var(--muted);
  font-size: 12px;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  color: var(--ink);
  background: var(--surface);
}

.icon-button:hover {
  border-color: var(--green);
  color: var(--green-dark);
}

.icon-button svg {
  width: 17px;
  height: 17px;
}

.icon-button.subtle {
  border-color: transparent;
  background: var(--canvas);
}

.view {
  padding-top: 26px;
}

.metrics-band {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 34px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.metric {
  min-width: 0;
  padding: 21px 24px 19px;
}

.metric + .metric {
  border-left: 1px solid var(--line);
}

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

.metric span {
  font-size: 12px;
}

.metric strong {
  display: block;
  margin: 4px 0 1px;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 29px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.metric small {
  font-size: 11px;
}

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

.section-heading.compact {
  margin-top: 34px;
}

.section-heading h2 {
  margin-top: 4px;
  font-size: 19px;
}

.scope-chip,
.status-badge,
.evidence-tag,
.policy-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  border-radius: 4px;
  white-space: nowrap;
}

.scope-chip {
  min-height: 28px;
  padding: 4px 10px;
  color: var(--green-dark);
  background: var(--green-soft);
  font-size: 11px;
  font-weight: 700;
}

.scope-chip.neutral {
  color: var(--blue);
  background: var(--blue-soft);
}

.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(340px, 0.8fr);
  gap: 16px;
}

.panel {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 15px;
}

.panel-header h3 {
  font-size: 15px;
}

.panel-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.chart-wrap {
  min-height: 228px;
}

.chart-wrap.large {
  min-height: 360px;
}

.chart-wrap svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.chart-label {
  fill: var(--muted);
  font-size: 11px;
}

.chart-value {
  fill: var(--ink);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.interpretation-strip {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 13px -20px -20px;
  padding: 12px 20px;
  border-top: 1px solid var(--line);
  color: #4c5f57;
  background: #f7faf8;
  font-size: 12px;
}

.interpretation-strip svg {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  margin-top: 1px;
  color: var(--green);
}

.interpretation-strip p {
  margin: 0;
}

.coverage-list {
  display: grid;
  gap: 13px;
}

.coverage-row {
  display: grid;
  grid-template-columns: minmax(90px, 1fr) minmax(120px, 1.4fr) auto;
  align-items: center;
  gap: 11px;
}

.coverage-row strong {
  font-size: 12px;
  font-weight: 600;
}

.coverage-bar {
  position: relative;
  height: 7px;
  overflow: hidden;
  border-radius: 4px;
  background: #e8ecea;
}

.coverage-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.coverage-row:nth-child(2) .coverage-bar span,
.coverage-row:nth-child(5) .coverage-bar span {
  background: var(--blue);
}

.coverage-row:nth-child(3) .coverage-bar span {
  background: var(--amber);
}

.coverage-row span:last-child {
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.text-button,
.command-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 36px;
  border-radius: 5px;
  font-weight: 700;
}

.text-button {
  padding: 0;
  border: 0;
  color: var(--green-dark);
  background: transparent;
  font-size: 12px;
}

.text-button svg,
.command-button svg {
  width: 16px;
  height: 16px;
}

.command-button {
  min-width: 110px;
  padding: 0 14px;
  border: 1px solid var(--green-dark);
  color: #ffffff;
  background: var(--green-dark);
}

.command-button:hover {
  background: #084a40;
}

.command-button.secondary {
  color: var(--green-dark);
  background: var(--surface);
}

.command-button.secondary:hover {
  background: var(--green-soft);
}

.command-button.danger {
  min-width: 38px;
  border-color: var(--line-strong);
  color: var(--red);
  background: var(--surface);
}

.table-shell {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
  table-layout: fixed;
}

th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  overflow-wrap: anywhere;
}

th {
  color: #52605a;
  background: #f7f9f8;
  font-size: 11px;
  font-weight: 700;
}

td {
  font-size: 12px;
}

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

tbody tr[data-firm-id] {
  cursor: pointer;
}

tbody tr[data-firm-id]:hover,
tbody tr[data-firm-id].selected {
  background: #f1f7f5;
}

.company-cell strong,
.company-cell span {
  display: block;
}

.company-cell span,
.muted-cell {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.numeric {
  font-family: "Segoe UI", Arial, sans-serif;
  font-variant-numeric: tabular-nums;
}

.status-badge {
  min-height: 26px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 700;
}

.status-badge.needs_review {
  color: #87342f;
  background: var(--red-soft);
}

.status-badge.insufficient_evidence {
  color: #89510f;
  background: var(--amber-soft);
}

.status-badge.relatively_consistent {
  color: var(--green-dark);
  background: var(--green-soft);
}

.policy-pill {
  min-height: 23px;
  margin: 2px 4px 2px 0;
  padding: 2px 7px;
  color: var(--blue);
  background: var(--blue-soft);
  font-size: 10px;
  font-weight: 700;
}

.row-action {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  color: var(--muted);
  background: transparent;
}

.row-action:hover {
  color: var(--green-dark);
  background: var(--green-soft);
}

.row-action svg {
  width: 16px;
  height: 16px;
}

.filter-bar {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 14px;
}

.search-field {
  position: relative;
  display: block;
  width: min(360px, 38vw);
}

.search-field svg {
  position: absolute;
  top: 50%;
  left: 12px;
  width: 17px;
  height: 17px;
  color: var(--muted);
  transform: translateY(-50%);
  pointer-events: none;
}

.search-field input,
.select-field select {
  height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  color: var(--ink);
  background: var(--surface);
}

.search-field input {
  width: 100%;
  padding: 0 12px 0 38px;
}

.search-field input::placeholder {
  color: #8b9590;
}

.select-field {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 10px;
}

.select-field select {
  min-width: 145px;
  padding: 0 30px 0 10px;
}

.result-count {
  margin: 0 0 10px auto;
  color: var(--muted);
  font-size: 11px;
}

.firm-workspace {
  display: grid;
  grid-template-columns: minmax(500px, 0.95fr) minmax(400px, 1.05fr);
  gap: 15px;
  align-items: start;
}

.firm-list-shell table {
  min-width: 650px;
}

.firm-detail {
  min-width: 0;
  min-height: 620px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.detail-placeholder,
.empty-state {
  display: grid;
  place-items: center;
  align-content: center;
  color: var(--muted);
  text-align: center;
}

.detail-placeholder {
  min-height: 575px;
}

.detail-placeholder svg,
.empty-state svg {
  width: 27px;
  height: 27px;
  margin-bottom: 8px;
  color: #9aa5a0;
}

.detail-placeholder p,
.empty-state p {
  margin: 0;
  font-size: 12px;
}

.detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--line);
}

.detail-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
}

.detail-header h2 {
  font-size: 20px;
}

.detail-meta {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.detail-actions {
  display: flex;
  gap: 8px;
}

.detail-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 16px 0 20px;
  border: 1px solid var(--line);
}

.detail-summary div {
  padding: 11px 12px;
}

.detail-summary div + div {
  border-left: 1px solid var(--line);
}

.detail-summary span,
.detail-summary strong {
  display: block;
}

.detail-summary span {
  color: var(--muted);
  font-size: 10px;
}

.detail-summary strong {
  margin-top: 3px;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

.detail-section + .detail-section {
  margin-top: 22px;
}

.detail-section h3 {
  margin-bottom: 10px;
  font-size: 14px;
}

.trend-chart {
  height: 224px;
  padding: 8px 0 0;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 10px;
}

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

.legend-line {
  display: inline-block;
  width: 16px;
  height: 2px;
  background: var(--green);
}

.legend-line.action {
  background: var(--blue);
}

.legend-line.gap {
  height: 6px;
  background: var(--amber);
  opacity: 0.7;
}

.evidence-list {
  border-top: 1px solid var(--line);
}

.evidence-item {
  display: grid;
  grid-template-columns: 25px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  width: 100%;
  padding: 12px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  background: transparent;
  text-align: left;
}

.evidence-item:hover {
  color: var(--green-dark);
}

.evidence-item > svg:first-child {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  color: var(--muted);
}

.evidence-item > svg:last-child {
  width: 15px;
  height: 15px;
  margin-top: 3px;
  color: var(--faint);
}

.evidence-main strong,
.evidence-main span {
  display: block;
}

.evidence-main strong {
  font-size: 12px;
}

.evidence-main span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.evidence-tag {
  min-height: 21px;
  margin-left: 6px;
  padding: 2px 6px;
  font-size: 9px;
}

.evidence-tag.verified {
  color: var(--green-dark);
  background: var(--green-soft);
}

.evidence-tag.candidate {
  color: #89510f;
  background: var(--amber-soft);
}

.evidence-tag.not_covered {
  color: #68736e;
  background: #edf0ef;
}

.shap-chart {
  display: grid;
  gap: 8px;
}

.shap-row {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr) 45px;
  align-items: center;
  gap: 8px;
  font-size: 10px;
}

.shap-track {
  position: relative;
  height: 9px;
  border-radius: 2px;
  background: #eef1f0;
}

.shap-track::after {
  position: absolute;
  top: -3px;
  bottom: -3px;
  left: 50%;
  width: 1px;
  content: "";
  background: var(--line-strong);
}

.shap-bar {
  position: absolute;
  top: 1px;
  height: 7px;
  border-radius: 2px;
}

.shap-bar.positive {
  left: 50%;
  background: var(--red);
}

.shap-bar.negative {
  right: 50%;
  background: var(--blue);
}

.model-note,
.boundary-note {
  margin: 10px 0 0;
  padding: 10px 11px;
  border-left: 3px solid var(--blue);
  color: #52605a;
  background: #f4f7f8;
  font-size: 10px;
}

.boundary-note {
  border-left-color: var(--amber);
  background: #fcf8f1;
}

.policy-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 16px;
}

.policy-reading {
  min-width: 0;
  padding: 21px;
  border-top: 3px solid var(--green);
  background: var(--surface);
}

.policy-reading h3 {
  font-size: 15px;
}

.finding-list {
  margin: 15px 0 0;
}

.finding-list div {
  padding: 13px 0;
  border-top: 1px solid var(--line);
}

.finding-list dt {
  font-size: 12px;
  font-weight: 700;
}

.finding-list dd {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.policy-table-shell {
  margin-top: 16px;
}

.policy-table-shell table {
  min-width: 780px;
}

.conclusion-text {
  color: #42524c;
  font-size: 11px;
}

.review-summary {
  display: grid;
  grid-template-columns: 150px 150px 150px minmax(260px, 1fr);
  align-items: center;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.review-summary > div,
.review-summary > p {
  min-height: 72px;
  margin: 0;
  padding: 15px 17px;
}

.review-summary > div + div,
.review-summary > p {
  border-left: 1px solid var(--line);
}

.review-summary span,
.review-summary strong {
  display: block;
}

.review-summary span {
  color: var(--muted);
  font-size: 10px;
}

.review-summary strong {
  margin-top: 2px;
  font-size: 21px;
  font-variant-numeric: tabular-nums;
}

.review-summary p {
  display: flex;
  align-items: center;
  color: var(--muted);
  font-size: 11px;
}

.review-table-shell {
  position: relative;
  min-height: 260px;
}

.review-table-shell table {
  min-width: 940px;
}

.empty-state {
  min-height: 230px;
}

.firm-list-shell .empty-state {
  min-height: 320px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(10, 20, 17, 0.55);
}

.modal-backdrop[hidden],
.view[hidden],
.empty-state[hidden],
.toast[hidden] {
  display: none;
}

.modal {
  width: min(620px, 100%);
  max-height: min(760px, calc(100vh - 48px));
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.modal-header {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;
  padding: 19px 21px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.modal-header h2 {
  margin-top: 4px;
  font-size: 18px;
}

.modal-body {
  padding: 20px 21px 23px;
}

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

.evidence-metadata div {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.evidence-metadata dt {
  color: var(--muted);
  font-size: 10px;
}

.evidence-metadata dd {
  margin: 3px 0 0;
  font-size: 12px;
}

.evidence-observation {
  margin: 0;
  padding: 13px 14px;
  border-left: 3px solid var(--green);
  background: #f4f8f7;
}

.source-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  color: var(--green-dark);
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
}

.source-link svg {
  width: 14px;
  height: 14px;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 120;
  max-width: min(360px, calc(100vw - 48px));
  padding: 11px 14px;
  border: 1px solid #2f6f62;
  border-radius: 5px;
  color: #ffffff;
  background: #183c34;
  box-shadow: var(--shadow);
  font-size: 12px;
}

.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;
}

@media (max-width: 1120px) {
  .overview-grid,
  .policy-layout {
    grid-template-columns: 1fr;
  }

  .firm-workspace {
    grid-template-columns: 1fr;
  }

  .firm-detail {
    min-height: 520px;
  }

  .detail-placeholder {
    min-height: 470px;
  }

  .review-summary {
    grid-template-columns: repeat(3, 1fr);
  }

  .review-summary > p {
    grid-column: 1 / -1;
    min-height: 52px;
    border-top: 1px solid var(--line);
    border-left: 0;
  }
}

@media (max-width: 820px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: sticky;
    z-index: 50;
    width: 100%;
    height: auto;
    padding: 10px 14px 8px;
  }

  .brand {
    min-height: 37px;
  }

  .brand-mark {
    width: 31px;
    height: 31px;
    flex-basis: 31px;
  }

  .nav-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    margin-top: 8px;
  }

  .nav-item {
    grid-template-columns: 18px minmax(0, 1fr) auto;
    min-height: 38px;
    padding: 0 8px;
    font-size: 11px;
  }

  .nav-item svg {
    width: 16px;
    height: 16px;
  }

  .sidebar-note {
    display: none;
  }

  .main-content {
    padding: 0 20px 42px;
  }

  .topbar {
    min-height: 82px;
  }

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

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

  .metric:nth-child(3),
  .metric:nth-child(4) {
    border-top: 1px solid var(--line);
  }

  .metric:nth-child(3) {
    border-left: 0;
  }

  .filter-bar {
    flex-wrap: wrap;
  }

  .search-field {
    width: 100%;
  }

  .result-count {
    width: 100%;
    margin: 2px 0 0;
    text-align: right;
  }
}

@media (max-width: 620px) {
  .sidebar {
    padding-inline: 10px;
  }

  .brand span {
    display: none;
  }

  .nav-item {
    display: flex;
    justify-content: center;
    min-width: 0;
    padding-inline: 5px;
  }

  .nav-item span:not(.nav-count) {
    display: none;
  }

  .main-content {
    padding-inline: 14px;
  }

  .topbar {
    gap: 10px;
  }

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

  .topbar .data-date {
    display: none;
  }

  .metrics-band {
    margin-bottom: 27px;
  }

  .metric {
    padding: 16px;
  }

  .metric strong {
    font-size: 24px;
  }

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

  .section-heading h2 {
    font-size: 17px;
  }

  .scope-chip {
    white-space: normal;
    text-align: center;
  }

  .panel {
    padding: 16px;
  }

  .interpretation-strip {
    margin: 12px -16px -16px;
    padding-inline: 16px;
  }

  .coverage-row {
    grid-template-columns: 88px minmax(70px, 1fr) auto;
    gap: 8px;
  }

  .select-field {
    flex: 1 1 140px;
  }

  .select-field select {
    width: 100%;
    min-width: 0;
  }

  .firm-detail {
    min-height: 480px;
    padding: 16px;
  }

  .detail-header {
    display: grid;
  }

  .detail-actions {
    width: 100%;
  }

  .detail-actions .command-button {
    flex: 1;
  }

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

  .detail-summary div + div {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .shap-row {
    grid-template-columns: 92px minmax(0, 1fr) 40px;
  }

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

  .review-summary > div:nth-child(3) {
    grid-column: 1 / -1;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .review-summary > p {
    grid-column: 1 / -1;
  }

  .modal-backdrop {
    align-items: end;
    padding: 0;
  }

  .modal {
    width: 100%;
    max-height: 90vh;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 6px 6px 0 0;
  }

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

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
