:root {
  --bg: #f5f6f3;
  --surface: #ffffff;
  --surface-muted: #eef0ec;
  --ink: #1d2522;
  --muted: #68716d;
  --line: #d9ddd8;
  --line-strong: #bfc6c0;
  --green: #2f6b52;
  --green-soft: #e5efe9;
  --red: #9f392e;
  --gold: #8a6a29;
  --focus: #1d67a8;
  --radius: 6px;
  --shadow: 0 10px 30px rgba(28, 38, 33, 0.14);
  --font-sans: "Microsoft YaHei UI", "PingFang SC", "Noto Sans CJK SC", "Microsoft YaHei", system-ui, sans-serif;
  --font-serif: "Source Han Serif SC", "Noto Serif CJK SC", "Songti SC", "STSong", "SimSun", serif;
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--bg);
  letter-spacing: 0;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-width: 320px;
  max-width: 100%;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

button,
select,
input[type="checkbox"] {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--focus) 35%, transparent);
  outline-offset: 2px;
}

.app-header {
  min-height: 88px;
  padding: 18px clamp(20px, 4vw, 64px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  color: #fff;
  background: #202b27;
  border-bottom: 4px solid var(--red);
}

.app-header h1 {
  margin: 2px 0 0;
  font-family: var(--font-serif);
  font-size: 31px;
  font-weight: 700;
  line-height: 1.1;
}

.eyebrow {
  margin: 0;
  color: #c7d1cc;
  font-size: 12px;
  line-height: 1.4;
  font-weight: 500;
}

.header-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.view-nav {
  display: flex;
  gap: 8px;
}

.data-menu {
  position: relative;
}

.data-menu summary {
  min-width: 74px;
  list-style: none;
  cursor: pointer;
}

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

.data-menu summary::after {
  content: "▾";
  margin-left: 7px;
  font-size: 10px;
}

.data-menu[open] summary::after {
  content: "▴";
}

.data-menu-popover {
  width: 184px;
  padding: 6px;
  position: absolute;
  z-index: 20;
  top: calc(100% + 8px);
  right: 0;
  display: grid;
  gap: 2px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.data-menu-popover button {
  min-height: 38px;
  padding: 7px 10px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.data-menu-popover button:hover {
  background: var(--surface-muted);
  color: var(--green);
}

.button {
  min-height: 36px;
  padding: 7px 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-weight: 600;
  line-height: 1.4;
  text-decoration: none;
  white-space: nowrap;
}

.button.primary {
  background: var(--red);
  color: #fff;
}

.button.primary:hover {
  background: #852e26;
}

.button.secondary {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line);
}

.button.secondary:hover {
  background: var(--surface-muted);
}

.app-header .button.secondary {
  background: transparent;
  color: #fff;
  border-color: #68736e;
}

.app-header .button.secondary:hover {
  background: #33413b;
}

.app-header .view-nav .button.active {
  color: #202b27;
  background: #fff;
  border-color: #fff;
}

.stats-band {
  padding: 0 clamp(20px, 4vw, 64px);
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.stat {
  min-height: 92px;
  padding: 18px 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-right: 1px solid var(--line);
}

.stat:first-child {
  border-left: 1px solid var(--line);
}

.stat-label {
  color: var(--muted);
  font-size: 12px;
}

.stat strong {
  margin-top: 4px;
  font-size: 25px;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  font-family: "Bahnschrift", "Segoe UI", var(--font-sans);
  font-weight: 650;
}

.control-band {
  padding: 14px clamp(20px, 4vw, 64px);
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto auto;
  align-items: end;
  gap: 14px;
  background: #fafbf9;
  border-bottom: 1px solid var(--line);
}

.search-field,
.field-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

input[type="search"],
input[type="text"],
select,
textarea {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 7px 10px;
}

textarea {
  resize: vertical;
}

.segmented {
  width: 100%;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}

.segmented button {
  min-height: 36px;
  padding: 6px 11px;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  white-space: nowrap;
}

.segmented button:last-child {
  border-right: 0;
}

.segmented button.active {
  background: var(--green);
  color: #fff;
}

.segmented.compact {
  grid-auto-columns: minmax(58px, 1fr);
}

.segmented.compact button {
  min-height: 30px;
  padding: 4px 9px;
  font-size: 12px;
}

.analytics-band {
  padding: 22px clamp(20px, 4vw, 64px) 26px;
  background: #eef1ed;
  border-bottom: 1px solid var(--line);
}

.statistics-provinces {
  padding: 24px clamp(20px, 4vw, 64px) 48px;
  background: var(--surface);
}

.statistics-provinces .province-progress-grid {
  width: min(1480px, 100%);
  margin: 0 auto;
  padding-bottom: 0;
}

.analytics-heading {
  width: min(1480px, 100%);
  margin: 0 auto 14px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
}

.analytics-heading .eyebrow {
  color: var(--muted);
}

.analytics-heading h2 {
  margin: 2px 0 0;
  font-family: var(--font-serif);
  font-size: 21px;
  line-height: 1.25;
}

.analytics-summary {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.analytics-grid {
  width: min(1480px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(360px, 1.35fr) minmax(300px, 1fr) minmax(300px, 1fr);
  gap: 12px;
}

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

.chart-heading {
  min-height: 32px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.chart-heading h3 {
  margin: 4px 0 0;
  font-family: var(--font-serif);
  font-size: 15px;
  line-height: 1.3;
}

.chart-scroll {
  width: 100%;
  overflow-x: auto;
  scrollbar-color: var(--line-strong) transparent;
}

.timeline-chart {
  width: max(100%, calc(var(--point-count, 1) * 62px));
  height: 218px;
  padding: 18px 10px 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  gap: 12px;
  border-bottom: 1px solid var(--line-strong);
}

.timeline-point {
  width: 48px;
  height: 190px;
  flex: 0 0 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
}

.timeline-point strong {
  margin-bottom: 5px;
  font-family: "Bahnschrift", "Segoe UI", var(--font-sans);
  font-size: 12px;
  font-weight: 650;
}

.timeline-bar {
  width: 28px;
  flex: 0 0 auto;
  background: var(--green);
  border-radius: 3px 3px 0 0;
}

.timeline-point span {
  min-height: 26px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.horizontal-chart {
  min-height: 218px;
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 7px;
}

.horizontal-row {
  min-height: 19px;
  display: grid;
  grid-template-columns: 50px minmax(60px, 1fr) 70px;
  align-items: center;
  gap: 8px;
}

.horizontal-row.category-row {
  grid-template-columns: minmax(86px, 132px) minmax(60px, 1fr) 32px;
}

.horizontal-label {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-track {
  height: 8px;
  overflow: hidden;
  background: #e7ebe7;
  border-radius: 2px;
}

.bar-fill {
  height: 100%;
  display: block;
  background: var(--green);
  border-radius: 2px;
}

.bar-fill.category-fill {
  background: var(--red);
}

.horizontal-row strong {
  color: var(--ink);
  font-family: "Bahnschrift", "Segoe UI", var(--font-sans);
  font-size: 11px;
  font-weight: 650;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.horizontal-row strong small {
  color: var(--muted);
  font: inherit;
  font-weight: 400;
}

.chart-empty {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 12px;
}

.chart-empty.compact-empty {
  min-height: 210px;
}

.workspace {
  width: min(1600px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  align-items: start;
}

.filters {
  position: sticky;
  top: 0;
  min-height: calc(100vh - 80px);
  padding: 22px 20px 32px;
  background: #ecefe9;
  border-right: 1px solid var(--line);
}

.filter-section {
  margin-bottom: 24px;
}

.filter-heading {
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

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

.text-button:hover {
  text-decoration: underline;
}

.text-button.danger {
  color: var(--red);
}

.batch-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(38px, 1fr));
  gap: 6px;
}

.batch-filter {
  min-height: 36px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  font-variant-numeric: tabular-nums;
}

.batch-filter.active {
  background: #28352f;
  color: #fff;
  border-color: #28352f;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.toggle-row span {
  display: flex;
  flex-direction: column;
  color: var(--ink);
}

.toggle-row small {
  margin-top: 2px;
  color: var(--muted);
  font-weight: 400;
}

input[role="switch"] {
  width: 38px;
  height: 22px;
  appearance: none;
  position: relative;
  flex: 0 0 auto;
  border-radius: 12px;
  background: #aeb6b0;
  transition: background 120ms ease;
}

input[role="switch"]::after {
  content: "";
  width: 16px;
  height: 16px;
  position: absolute;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: #fff;
  transition: transform 120ms ease;
}

input[role="switch"]:checked {
  background: var(--green);
}

input[role="switch"]:checked::after {
  transform: translateX(16px);
}

.full-width {
  width: 100%;
}

.results {
  min-width: 0;
  padding: 22px clamp(16px, 3vw, 38px) 56px;
}

.province-progress {
  margin-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.province-progress summary {
  padding: 0 0 12px;
  cursor: pointer;
  font-weight: 700;
  font-family: var(--font-serif);
  font-size: 15px;
}

.province-progress-grid {
  padding: 0 0 18px;
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 1px 16px;
}

.province-progress-button {
  min-height: 40px;
  padding: 7px 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
}

.province-progress-button:hover,
.province-progress-button.active {
  color: var(--green);
}

.province-progress-button span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.province-progress-button small {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.result-toolbar {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.result-toolbar p {
  margin: 0;
  color: var(--muted);
}

.result-page-tools label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  white-space: nowrap;
}

.result-page-tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.result-page-tools select {
  width: 78px;
}

.result-footer {
  margin-top: 24px;
  padding-top: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-top: 1px solid var(--line);
}

.page-step {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font-family: "Segoe UI Symbol", var(--font-sans);
  font-size: 23px;
  line-height: 1;
}

.page-step:hover:not(:disabled) {
  color: #fff;
  background: var(--green);
  border-color: var(--green);
}

.page-step:disabled {
  cursor: default;
  opacity: 0.42;
}

.page-indicator {
  min-width: 58px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.result-page-tools .page-jump {
  margin-left: 6px;
  gap: 5px;
}

.page-jump input {
  width: 58px;
  min-height: 34px;
  padding: 5px 6px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.page-jump-button {
  min-height: 34px;
  padding: 5px 10px;
  font-size: 12px;
}

.result-group {
  margin-top: 16px;
}

.group-heading {
  min-height: 40px;
  margin: 0;
  padding: 9px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: #28352f;
  color: #fff;
  font-size: 15px;
  line-height: 1.3;
  font-family: var(--font-serif);
}

.group-heading small {
  color: #c9d2cd;
  font-size: 12px;
  font-weight: 400;
  white-space: nowrap;
  font-family: var(--font-sans);
}

.table-wrap {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 0;
}

.heritage-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  table-layout: fixed;
}

.heritage-table th {
  padding: 9px 10px;
  color: var(--muted);
  background: #f5f7f4;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  text-align: left;
  font-weight: 650;
}

.heritage-table td {
  padding: 10px 10px;
  border-bottom: 1px solid #e6e9e5;
  vertical-align: middle;
  overflow-wrap: anywhere;
}

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

.heritage-table tbody tr:hover {
  background: #f8faf7;
}

.heritage-table tbody tr.visited-row {
  box-shadow: inset 3px 0 0 var(--green);
}

.col-check {
  width: 46px;
  text-align: center !important;
}

.col-name {
  width: 23%;
}

.col-batch {
  width: 82px;
}

.col-category {
  width: 17%;
}

.col-location {
  width: 25%;
}

.location-current {
  display: block;
  margin-bottom: 3px;
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
}

.col-time {
  width: 160px;
}

.col-actions {
  width: 62px;
}

.visit-checkbox {
  width: 18px;
  height: 18px;
  accent-color: var(--green);
}

.unit-name-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
  font-weight: 700;
  line-height: 1.45;
  font-family: var(--font-serif);
  font-size: 15px;
}

.unit-name-button:hover {
  color: var(--green);
}

.unit-alias {
  margin-left: 3px;
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
}

.unit-code,
.merged-label {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.period-label {
  display: inline-flex;
  min-height: 20px;
  margin-top: 5px;
  padding: 1px 6px;
  align-items: center;
  border: 1px solid #d7c9a8;
  border-radius: 3px;
  color: #71571e;
  background: #f7f1e3;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.3;
}

.merged-label {
  color: var(--gold);
  font-weight: 700;
}

.batch-badge {
  display: inline-flex;
  min-width: 34px;
  height: 24px;
  align-items: center;
  justify-content: center;
  border: 1px solid #b9c8c0;
  border-radius: 4px;
  color: var(--green);
  background: var(--green-soft);
  font-weight: 700;
}

.visit-time-input {
  min-height: 32px !important;
  padding: 5px 7px !important;
  font-size: 12px;
}

.read-only .visit-checkbox,
.read-only .visit-time-input {
  cursor: default;
}

.read-only .visit-time-input {
  color: var(--ink);
  background: #f4f6f3;
}

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

.note-button.has-note::after {
  content: "";
  width: 6px;
  height: 6px;
  display: inline-block;
  margin-left: 4px;
  border-radius: 50%;
  background: var(--red);
  vertical-align: top;
}

.empty-state {
  padding: 64px 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--muted);
  text-align: center;
}

.browse-empty {
  min-height: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.browse-empty strong {
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 18px;
}

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

.pagination {
  min-height: 36px;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.pagination button {
  min-width: 36px;
  min-height: 36px;
  padding: 6px 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
}

.pagination button.active {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
}

.pagination button:disabled {
  cursor: default;
  opacity: 0.45;
}

.detail-dialog {
  width: min(620px, calc(100% - 32px));
  max-height: calc(100vh - 32px);
  padding: 0;
  border: 0;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.detail-dialog::backdrop {
  background: rgba(18, 25, 22, 0.55);
}

.detail-dialog form {
  padding: 24px;
}

.dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.dialog-header h2 {
  margin: 3px 0 0;
  font-size: 21px;
  line-height: 1.35;
  overflow-wrap: anywhere;
  font-family: var(--font-serif);
}

.dialog-header .eyebrow {
  color: var(--muted);
}

.close-button {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  font-size: 24px;
  line-height: 1;
}

.dialog-facts {
  margin: 20px 0;
  padding: 14px 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 20px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.dialog-fact {
  min-width: 0;
}

.dialog-fact span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.dialog-fact strong {
  display: block;
  margin-top: 3px;
  font-size: 13px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.dialog-fact.wide {
  grid-column: 1 / -1;
}

.dialog-visited,
.detail-dialog .field-label {
  margin-top: 16px;
}

.dialog-actions {
  margin-top: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.source-link {
  color: var(--green);
  font-size: 12px;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 20;
  max-width: min(360px, calc(100% - 48px));
  padding: 10px 14px;
  border-radius: var(--radius);
  background: #202b27;
  color: #fff;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

footer {
  min-height: 58px;
  padding: 16px clamp(20px, 4vw, 64px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  background: #e8ebe6;
  border-top: 1px solid var(--line);
  font-size: 12px;
}

.save-status {
  margin-left: auto;
  color: var(--green);
  font-variant-numeric: tabular-nums;
}

@media (max-width: 1100px) {
  .analytics-grid {
    grid-template-columns: 1fr 1fr;
  }

  .timeline-panel {
    grid-column: 1 / -1;
  }

  .province-progress-grid {
    grid-template-columns: repeat(3, minmax(120px, 1fr));
  }
}

@media (max-width: 820px) {
  .app-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .header-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .view-nav {
    width: 100%;
  }

  .view-nav .button {
    flex: 1;
  }

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

  .stat:nth-child(3) {
    border-left: 1px solid var(--line);
  }

  .stat {
    min-height: 76px;
    padding: 13px 16px;
    border-bottom: 1px solid var(--line);
  }

  .control-band {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

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

  .timeline-panel {
    grid-column: auto;
  }

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

  .filters {
    position: static;
    min-height: 0;
    padding: 16px 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .filter-section {
    margin: 0;
  }

  .filters .full-width {
    align-self: end;
  }
}

@media (max-width: 620px) {
  .app-header,
  .stats-band,
  .control-band,
  .analytics-band,
  .statistics-provinces,
  footer {
    padding-left: 14px;
    padding-right: 14px;
  }

  .analytics-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .analytics-summary {
    text-align: left;
  }

  .chart-panel {
    min-height: 270px;
    padding: 14px;
  }

  .header-actions .button {
    width: 100%;
    min-width: 0;
  }

  .header-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .view-nav {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .data-menu {
    grid-column: 1 / -1;
  }

  #blogHomeLink {
    grid-column: 1 / -1;
  }

  .data-menu summary {
    width: 100%;
  }

  .data-menu-popover {
    width: 100%;
  }

  .filters {
    grid-template-columns: 1fr;
    padding: 16px 14px;
  }

  .segmented,
  .segmented button,
  .batch-grid,
  .batch-filter {
    min-width: 0;
  }

  .segmented button {
    padding-left: 5px;
    padding-right: 5px;
    white-space: normal;
  }

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

  .results {
    padding: 18px 14px 44px;
  }

  .province-progress-grid {
    grid-template-columns: repeat(2, minmax(110px, 1fr));
    gap: 1px 12px;
  }

  .result-page-tools {
    width: 100%;
  }

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

  .result-page-tools label {
    margin-right: 0;
  }

  .result-page-tools > label:first-child {
    margin-right: auto;
  }

  .result-page-tools .page-jump {
    margin-left: 0;
  }

  .dialog-facts {
    grid-template-columns: 1fr;
  }

  .dialog-fact.wide {
    grid-column: auto;
  }

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

  .detail-dialog form {
    padding: 18px;
  }

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

  .save-status {
    margin-left: 0;
  }
}
