:root {
  color-scheme: light;
  --ink: #14202b;
  --muted: #52606d;
  --line: #d5dce3;
  --paper: #fff;
  --wash: #f3f6f8;
  --focus: #155eef;
  --valor: #b42318;
  --mystic: #175cd3;
  --instinct: #8a6100;
  --open: #475467;
  --nav-bg: #ffffff;
  --nav-active-bg: #eaf1ff;
  --nav-active: #155eef;
  --nav-line: #b7c9f4;
}

* { box-sizing: border-box; }

html {
  touch-action: pan-x pan-y;
  overscroll-behavior: none;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--wash);
  color: var(--ink);
  font-family: "Segoe UI", "Microsoft JhengHei", Arial, sans-serif;
  letter-spacing: 0;
  overflow: hidden;
  touch-action: pan-x pan-y;
  overscroll-behavior: none;
  -webkit-text-size-adjust: 100%;
}

#map,
.leaflet-container {
  touch-action: none;
}

main {
  width: min(1280px, calc(100vw - 32px));
  height: 100vh;
  margin: 0 auto;
  padding: 10px 0 58px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.toolbar,
.filters,
.settings-card,
.summary {
  border: 1px solid var(--line);
  background: var(--paper);
}

.toolbar {
  position: relative;
  padding: 9px 12px;
  overflow: visible;
}

.pull-refresh-indicator {
  position: fixed;
  left: 50%;
  top: max(8px, env(safe-area-inset-top));
  z-index: 90;
  min-width: 188px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  overflow: hidden;
  border: 1px solid #b7c9f4;
  border-radius: 999px;
  background: rgba(255, 255, 255, .98);
  color: var(--nav-active);
  font-size: 14px;
  font-weight: 700;
  pointer-events: none;
  opacity: 0;
  box-shadow: 0 8px 24px rgba(20, 32, 43, .22);
  transform: translate3d(-50%, calc(-62px + var(--pull-distance, 0px)), 0);
  transition: opacity .16s ease, transform .18s ease, border-color .16s ease;
}

.pull-refresh-indicator::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    120deg,
    rgba(21, 94, 239, .05) 0,
    rgba(21, 94, 239, .05) 7px,
    transparent 7px,
    transparent 14px
  );
  transform: translateX(-16px);
}

body.pull-active .pull-refresh-indicator,
body.pull-refreshing .pull-refresh-indicator {
  opacity: 1;
}

body.pull-ready .pull-refresh-indicator,
body.pull-refreshing .pull-refresh-indicator {
  border-color: var(--nav-active);
}

body.pull-refreshing .pull-refresh-indicator {
  transform: translate3d(-50%, 14px, 0);
}

.pull-refresh-indicator > span {
  position: relative;
  z-index: 1;
}

.pull-spinner {
  width: 19px;
  height: 19px;
  border: 2px solid #bfd2ff;
  border-top-color: var(--nav-active);
  border-radius: 999px;
  transform: rotate(calc(var(--pull-distance, 0px) * 2deg));
}

body.pull-refreshing .pull-spinner {
  animation: pull-spin .72s linear infinite;
}

.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 9500;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: max(12px, env(safe-area-inset-top));
  background: rgba(20, 32, 43, .22);
  pointer-events: auto;
}

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

.search-overlay-indicator {
  min-width: 132px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid #9bb6f5;
  border-radius: 999px;
  background: rgba(255, 255, 255, .98);
  color: var(--nav-active);
  font-size: 14px;
  font-weight: 800;
  box-shadow: 0 10px 28px rgba(20, 32, 43, .24);
}

.search-spinner {
  width: 19px;
  height: 19px;
  border: 2px solid #bfd2ff;
  border-top-color: var(--nav-active);
  border-radius: 999px;
  animation: pull-spin .72s linear infinite;
}

@keyframes pull-spin {
  to { transform: rotate(360deg); }
}

.toolbar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.toolbar-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.app-view[hidden] {
  display: none;
}

.app-view {
  min-height: 0;
}

.list-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.settings-view,
.flyer-view {
  overflow: auto;
  padding-bottom: 10px;
}

.toolbar-meta {
  flex: 0 0 auto;
  margin-top: 8px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  background: var(--paper);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.toolbar-meta.meta-highlight {
  border-color: #b42318;
  background: #fff1f0;
  color: #7a271a;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.3;
  white-space: normal;
  box-shadow: 0 0 0 2px rgba(180, 35, 24, .12) inset;
}

.title-settings,
.title-flyer,
.toolbar-info-button {
  display: none;
}

body[data-view="settings"] .title-list,
body[data-view="settings"] .title-flyer,
body[data-view="settings"] #locate-current,
body[data-view="settings"] .toolbar-actions,
body[data-view="flyer"] .title-list,
body[data-view="flyer"] .title-settings,
body[data-view="flyer"] #locate-current,
body[data-view="flyer"] .toolbar-actions {
  display: none;
}

body[data-view="settings"] .title-settings {
  display: inline;
}

body[data-view="flyer"] .title-flyer {
  display: inline;
}

body[data-view="flyer"] .toolbar-info-button {
  display: inline-flex;
}

h1 {
  margin: 0 0 1px;
  font-size: 21px;
  font-weight: 650;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

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

button,
input,
select {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  color: inherit;
  font: inherit;
}

button {
  min-height: 34px;
  padding: 0 10px;
  cursor: pointer;
}

#refresh,
#locate-current {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

#refresh {
  border-color: #9bb6f5;
  background: #eef4ff;
}

#locate-current {
  border-color: #b7c0cc;
  background: #f7f9fb;
}

#refresh span,
#locate-current span { font-size: 20px; line-height: 1; }

#refresh:disabled,
#locate-current:disabled { cursor: wait; opacity: .62; }

.filters {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 9px;
  align-items: end;
  margin-top: 8px;
  padding: 8px 10px;
}

.settings-card {
  margin-top: 8px;
}

.flyer-control-card {
  margin-top: 0;
}

.settings-card h2 {
  margin: 0;
  padding: 9px 10px;
  border-bottom: 1px solid #e5eaf0;
  background: #f7f9fb;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
}

.flyer-export-title {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.info-button {
  width: 24px;
  min-width: 24px;
  height: 24px;
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 999px;
  border-color: #b7c9f4;
  background: #eaf1ff;
  color: var(--nav-active);
  line-height: 0;
}

.info-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.toolbar-info-button {
  width: 22px;
  min-width: 22px;
  height: 22px;
  min-height: 22px;
  font-size: 14px;
  transform: translateY(0);
}

.toolbar-title .toolbar-info-button {
  display: none;
}

body[data-view="flyer"] .toolbar-title .toolbar-info-button {
  display: inline-flex;
}

.title-action {
  min-height: 28px;
  padding: 0 9px;
  border-color: #a8bfdd;
  background: #f2f7fc;
  color: var(--nav-active);
  font-size: 13px;
  font-weight: 800;
}

.setting-note {
  padding: 8px 10px 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.settings-controls {
  display: grid;
  grid-template-columns: repeat(4, minmax(96px, 1fr)) minmax(150px, 220px);
  gap: 10px;
  align-items: end;
  padding: 10px;
}

.segments { display: flex; flex-wrap: wrap; gap: 6px; }
.segments button[data-team="Valor"] { color: var(--valor); }
.segments button[data-team="Mystic"] { color: var(--mystic); }
.segments button[data-team="Instinct"] { color: var(--instinct); }
.segments button[data-team="Uncontested"],
.segments button[data-team="all"] { color: var(--open); }
.segments button.active {
  border-color: currentColor;
  background: var(--paper);
  font-weight: 750;
}
label {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 12px;
}

input,
select {
  width: 100%;
  min-height: 34px;
  padding: 0 10px;
  color: var(--ink);
}

.summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border: 0;
  margin-top: 0;
}

.summary div {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border-right: 1px solid var(--line);
}

.summary div:last-child { border-right: 0; }
.summary strong { font-size: 20px; font-weight: 650; }
.summary span { color: var(--muted); }

.workspace {
  flex: 1;
  min-height: 0;
  margin-top: 8px;
  display: grid;
  grid-template-columns: minmax(360px, 44%) minmax(420px, 1fr);
  gap: 8px;
}

.map-panel,
.results {
  border: 1px solid var(--line);
  background: var(--paper);
  min-height: 0;
}

.map-panel {
  display: grid;
  grid-template-rows: 31px minmax(0, 1fr);
  position: relative;
  overflow: hidden;
}

.map-title {
  display: flex;
  align-items: center;
  padding: 0 10px;
  border-bottom: 1px solid #e5eaf0;
  background: #e9eef3;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

#map {
  min-height: 0;
  width: 100%;
  height: 100%;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

#map .leaflet-container,
.leaflet-container {
  cursor: crosshair;
}

.leaflet-popup-content {
  margin: 10px 12px;
  line-height: 1.45;
}

.map-confirm-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.map-confirm-actions button {
  min-height: 30px;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 700;
}

.map-confirm-actions button:first-child {
  border-color: #9bb6f5;
  background: #eef4ff;
  color: var(--nav-active);
}

.results {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.results-head {
  flex: 0 0 auto;
}

.results-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

.result-tools {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  border-bottom: 1px solid #e5eaf0;
  background: var(--paper);
}

.settings-tools {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
}

.flyer-controls {
  display: grid;
  grid-template-columns: auto minmax(130px, 180px) auto auto;
  gap: 10px;
  align-items: end;
  padding: 10px;
}

.flyer-controls button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 700;
}

.flyer-map-panel {
  margin-top: 8px;
  border: 1px solid var(--line);
  background: var(--paper);
  overflow: hidden;
}

.flyer-status-card {
  margin-top: 8px;
  border: 1px solid var(--line);
  background: var(--paper);
}

.flyer-status-card h2 {
  margin: 0;
  padding: 8px 10px;
  border-bottom: 1px solid #e5eaf0;
  background: #fff7ed;
  color: #7a2e0e;
  font-size: 14px;
  font-weight: 800;
}

#flyer-map {
  width: 100%;
  height: min(52vh, 460px);
  min-height: 320px;
}

.flyer-meta {
  padding: 8px 10px;
  background: #fffbf5;
  color: #7a2e0e;
  font-size: 14px;
  font-weight: 750;
  line-height: 1.45;
}

.message-dialog {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(20, 32, 43, .38);
}

.message-dialog[hidden] {
  display: none;
}

.message-dialog-box {
  position: relative;
  z-index: 10001;
  width: min(420px, 100%);
  max-height: min(78dvh, 560px);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 18px 44px rgba(20, 32, 43, .24);
}

.message-dialog-box h2 {
  margin: 0;
  padding: 12px 14px;
  border-bottom: 1px solid #e5eaf0;
  font-size: 17px;
}

.message-dialog-box p {
  flex: 0 0 auto;
  padding: 0 14px;
  margin-top: 10px;
  color: var(--ink);
  line-height: 1.55;
}

.message-dialog-box p:first-of-type {
  margin-top: 14px;
}

.message-dialog-box button {
  flex: 0 0 auto;
  display: block;
  width: calc(100% - 28px);
  margin: 14px;
  border-color: #9bb6f5;
  background: #eef4ff;
  color: var(--nav-active);
  font-weight: 800;
}

.export-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.export-buttons button {
  min-height: 32px;
  padding: 0 8px;
  border-color: #a8bfdd;
  background: #f2f7fc;
  font-size: 13px;
  font-weight: 600;
}

.export-buttons button:disabled {
  cursor: not-allowed;
  opacity: .48;
}

.flyer-export-card .export-buttons {
  width: 100%;
}

.export-origin-settings {
  display: flex;
  flex: 1 1 100%;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.export-origin-settings h3 {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
  font-weight: 850;
}

.export-origin-settings .setting-note {
  margin: 0;
}

.export-origin-settings label {
  width: 100%;
}

.export-origin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
}

.flyer-export-card .export-buttons button {
  flex: 1 1 calc(50% - 3px);
  min-height: 42px;
  font-size: 15px;
  font-weight: 800;
}

.download-status {
  flex: 1 1 100%;
  margin-top: 8px;
  padding: 8px 10px;
  border: 1px solid #b7c9f4;
  border-radius: 6px;
  background: #eef4ff;
  color: var(--nav-active);
  font-size: 13px;
  font-weight: 750;
  line-height: 1.4;
}

.result-tools label {
  width: 150px;
}

.settings-tools label {
  width: 150px;
}

.bottom-tabs {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  width: 100vw;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  padding: 0 0 env(safe-area-inset-bottom);
  border-top: 1px solid var(--nav-line);
  background: var(--nav-bg);
  box-shadow: 0 -2px 14px rgba(20, 32, 43, .12);
}

.bottom-tabs button {
  min-height: 52px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.bottom-tabs button.active {
  background: var(--nav-active-bg);
  color: var(--nav-active);
}

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

th,
td {
  padding: 8px 10px;
  border-bottom: 1px solid #e5eaf0;
  border-right: 1px solid #e5eaf0;
  text-align: left;
  vertical-align: middle;
}

th:last-child,
td:last-child {
  border-right: 0;
}

th {
  background: #e9eef3;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  font-weight: 700;
  white-space: nowrap;
}

th:nth-child(2), td:nth-child(2) {
  width: 62px;
  text-align: center;
}
th:nth-child(3), td:nth-child(3) {
  width: 96px;
  text-align: center;
}

.team {
  display: inline-flex;
  min-width: 62px;
  min-height: 0;
  justify-content: center;
  align-items: center;
  padding: 3px 7px;
  border: 1px solid currentColor;
  border-radius: 6px;
  font-weight: 600;
  line-height: 1.35;
}

.team-button {
  background: var(--paper);
  cursor: copy;
}

.team-button:hover {
  background: #fff1f0;
}

.Valor { color: var(--valor); }
.Mystic { color: var(--mystic); }
.Instinct { color: var(--instinct); }
.Uncontested { color: var(--open); }
.selected-row td { background: #eef4ff; }
.results tbody tr:not(.empty) { cursor: pointer; }
.empty td { height: 56px; color: var(--muted); text-align: center; }
.stop {
  display: inline-flex;
  width: 24px;
  height: 24px;
  align-items: center;
  justify-content: center;
  margin-right: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  font-weight: 600;
}

@media (max-width: 760px) {
  :root {
    --mobile-toolbar-height: 48px;
    --mobile-settings-toolbar-height: 48px;
    --mobile-filters-height: 48px;
    --mobile-map-height: clamp(220px, 38dvh, 320px);
    --mobile-tabs-height: calc(58px + env(safe-area-inset-bottom));
    --mobile-status-height: 52px;
    --mobile-table-head-height: 43px;
    --mobile-page-gutter: 8px;
  }

  html,
  body {
    height: 100%;
    min-height: 100%;
    overflow-x: clip;
    overflow-y: hidden;
  }

  main {
    display: block;
    width: 100vw;
    height: 100dvh;
    min-height: 100dvh;
    padding: calc(var(--mobile-toolbar-height) + var(--mobile-filters-height) + var(--mobile-map-height)) 0 calc(var(--mobile-tabs-height) + var(--mobile-status-height));
    overflow: hidden;
  }

  body[data-view="settings"] main {
    padding-top: calc(var(--mobile-settings-toolbar-height) + 8px);
  }

  body[data-view="flyer"] main {
    padding: var(--mobile-settings-toolbar-height) 0 var(--mobile-tabs-height);
  }

  .settings-view,
  .flyer-view {
    height: calc(100dvh - var(--mobile-settings-toolbar-height) - var(--mobile-tabs-height));
    padding: 0 var(--mobile-page-gutter) 10px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .toolbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 40;
    width: 100vw;
    min-height: var(--mobile-toolbar-height);
    transform: none;
    padding: 8px 10px;
    border-left: 0;
    border-right: 0;
    box-shadow: none;
    touch-action: pan-y;
  }
  body[data-view="settings"] .toolbar,
  body[data-view="flyer"] .toolbar {
    min-height: var(--mobile-settings-toolbar-height);
  }
  .toolbar-top {
    display: grid;
    grid-template-columns: minmax(104px, 1fr) auto minmax(104px, 1fr);
    align-items: center;
    gap: 6px;
  }
  .toolbar-title {
    display: contents;
  }
  .toolbar-title h1 {
    grid-column: 2;
    grid-row: 1;
    justify-self: center;
    text-align: center;
    white-space: nowrap;
  }
  #locate-current {
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
  }
  .toolbar-actions {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
  }
  body[data-view="settings"] .toolbar-top {
    grid-template-columns: 1fr;
  }
  body[data-view="flyer"] .toolbar-top {
    grid-template-columns: 1fr;
  }
  body[data-view="settings"] .toolbar-title h1,
  body[data-view="flyer"] .toolbar-title h1 {
    grid-column: 1;
    grid-row: 1;
  }
  .toolbar-meta {
    position: fixed;
    left: var(--mobile-page-gutter);
    right: var(--mobile-page-gutter);
    bottom: var(--mobile-tabs-height);
    z-index: 45;
    width: auto;
    height: var(--mobile-status-height);
    margin-top: 0;
    padding: 7px 10px;
    font-size: 12px;
    box-shadow: 0 -2px 10px rgba(20, 32, 43, .1);
  }
  .toolbar-meta.meta-highlight {
    display: flex;
    align-items: center;
    font-size: 13px;
  }
  .toolbar-actions {
    gap: 6px;
  }
  .toolbar-actions button {
    min-height: 32px;
    padding: 0 8px;
  }
  h1 { font-size: 20px; }
  .filters {
    position: fixed;
    top: var(--mobile-toolbar-height);
    left: var(--mobile-page-gutter);
    right: var(--mobile-page-gutter);
    z-index: 35;
    width: auto;
    height: var(--mobile-filters-height);
    min-height: var(--mobile-filters-height);
    transform: none;
    margin-top: 0;
    grid-template-columns: minmax(0, 1fr);
    gap: 7px;
    padding: 6px 8px;
    box-shadow: 0 2px 12px rgba(20, 32, 43, .12);
  }
  .segments {
    grid-column: 1 / -1;
    flex-wrap: nowrap;
    overflow-x: auto;
  }
  .segments button {
    flex: 0 0 auto;
    padding-inline: 8px;
  }
  .filters label:last-child { grid-column: auto; }
  .settings-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    padding: 10px 8px;
  }
  .settings-card {
    margin-top: 8px;
  }
  .flyer-control-card {
    margin-top: 0;
  }
  .settings-card h2 {
    padding: 9px 10px;
    font-size: 14px;
  }
  input,
  select {
    min-height: 32px;
    padding: 0 8px;
  }
  .workspace {
    display: block;
    margin-top: 0;
  }

  .map-panel {
    position: fixed;
    top: calc(var(--mobile-toolbar-height) + var(--mobile-filters-height));
    left: var(--mobile-page-gutter);
    right: var(--mobile-page-gutter);
    z-index: 30;
    width: auto;
    height: var(--mobile-map-height);
    min-height: 0;
    max-height: none;
    transform: none;
    box-shadow: 0 2px 12px rgba(20, 32, 43, .18);
  }

  body[data-view="settings"] .filters,
  body[data-view="settings"] .map-panel,
  body[data-view="settings"] .results,
  body[data-view="flyer"] .filters,
  body[data-view="flyer"] .map-panel,
  body[data-view="flyer"] .results,
  body[data-view="flyer"] .toolbar-meta {
    display: none;
  }

  .flyer-controls {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;
    padding: 10px 8px;
  }

  .flyer-controls label {
    grid-column: 1 / -1;
  }

  #flyer-map {
    height: clamp(280px, 45dvh, 420px);
    min-height: 260px;
  }

  .flyer-meta {
    margin-bottom: 8px;
  }

  .results {
    position: fixed;
    top: calc(var(--mobile-toolbar-height) + var(--mobile-filters-height) + var(--mobile-map-height));
    left: var(--mobile-page-gutter);
    right: var(--mobile-page-gutter);
    z-index: 20;
    width: auto;
    height: calc(100dvh - var(--mobile-toolbar-height) - var(--mobile-filters-height) - var(--mobile-map-height) - var(--mobile-tabs-height) - var(--mobile-status-height));
    margin-top: 0;
    overflow: hidden;
    -webkit-overflow-scrolling: touch;
  }

  .results-body {
    flex: 1 1 auto;
    min-height: 0;
    height: calc(100dvh - var(--mobile-toolbar-height) - var(--mobile-filters-height) - var(--mobile-map-height) - var(--mobile-tabs-height) - var(--mobile-status-height) - var(--mobile-table-head-height));
    max-height: calc(100dvh - var(--mobile-toolbar-height) - var(--mobile-filters-height) - var(--mobile-map-height) - var(--mobile-tabs-height) - var(--mobile-status-height) - var(--mobile-table-head-height));
    overflow-x: auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .result-tools {
    position: sticky;
    top: 0;
    width: 100%;
    min-width: 0;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .settings-tools {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    align-items: stretch;
  }

  .export-buttons {
    flex: 1 1 100%;
  }

  .export-buttons button {
    flex: 1 1 94px;
  }

  .result-tools label {
    width: 128px;
  }

  .settings-tools label { width: 100%; }

  table {
    width: 100%;
    min-width: 0;
  }

  .summary { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .summary div {
    min-height: 38px;
    gap: 4px;
    padding: 5px 6px;
  }
  .summary div:nth-child(2n) { border-right: 1px solid var(--line); }
  .summary div:last-child { border-right: 0; }
  .summary strong { font-size: 18px; }
  .summary span { font-size: 12px; }
  th:nth-child(2), td:nth-child(2) { width: 50px; }
  th:nth-child(3), td:nth-child(3) { width: 58px; }
  th, td { padding: 9px 8px; }
  .team {
    min-width: 46px;
    padding-inline: 3px;
  }
  .stop {
    width: 20px;
    height: 20px;
    margin-right: 5px;
  }
  .empty td { height: 56px; }

}
