
#taipei-district-crash-change { scroll-margin-block-start: 6rem; }
.taipei-crash-change figure { margin-inline: 0; }
.taipei-crash-plot { list-style: none; padding: 0; margin: 0; max-width: 42rem; }
.taipei-crash-plot li {
  display: grid; grid-template-columns: 4.4em minmax(0, 1fr) minmax(0, 1fr) 5ch;
  align-items: center; column-gap: .3em; margin-block: .65em;
}
.taipei-crash-plot .down { border-inline-end: 1px solid #798a97; padding-inline-end: .12em; }
.taipei-crash-plot .up { padding-inline-start: .12em; }
.taipei-crash-plot progress { display: block; width: 100%; height: .65em; accent-color: #9d442d; }
.taipei-crash-plot .down progress { direction: rtl; accent-color: #235879; }
.taipei-crash-plot progress[value="0"] { visibility: hidden; }
.taipei-crash-plot strong { text-align: end; font-variant-numeric: tabular-nums; }
.taipei-crash-change th { white-space: normal; }
.taipei-crash-change :is(th[scope="row"], th:first-child) { white-space: nowrap; }
.taipei-crash-change td { white-space: nowrap; }
.taipei-crash-change summary { cursor: pointer; }
@media (max-width: 860px) {
  html:has(.taipei-crash-change) .site-header { position: static; }
  html:has(.taipei-crash-change) .brand { white-space: normal; min-width: 0; }
  #taipei-district-crash-change { scroll-margin-block-start: 1rem; }
  html:has(.taipei-crash-change) .dist-grid { grid-template-columns: minmax(0, 1fr); }
  html:has(.taipei-crash-change) .controls label { max-width: 100%; }
  html:has(.taipei-crash-change) [data-year-switch] { min-width: 0; width: min(11rem, 100%); }
}
@media (max-width: 420px) {
  html:has(.taipei-crash-change) .stats { grid-template-columns: minmax(0, 1fr); }
  html:has(.taipei-crash-change) .bar-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: .25rem .6rem;
  }
  html:has(.taipei-crash-change) .bar-row span:last-child { grid-column: 2; grid-row: 1; }
  html:has(.taipei-crash-change) .bar-row progress { grid-column: 1 / -1; grid-row: 2; }
}
@media (prefers-reduced-motion: reduce) {
  html:has(.taipei-crash-change) { scroll-behavior: auto; }
}
