:root {
  color-scheme: dark;
  --bg: #08111f;
  --panel: #101b2e;
  --text: #e8eefc;
  --muted: #aebbd4;
  --line: #2d3d59;
  --best: #57d68d;
  --usable: #9cc7ff;
  --excluded: #ff6b6b;
  --accent: #8ab4ff;
  --warn: #ffd166;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: Segoe UI, Roboto, Arial, sans-serif;
  background:
    linear-gradient(rgba(4, 9, 20, .35), rgba(4, 9, 20, .62)),
    url("/static/starfield.webp") center / cover fixed,
    var(--bg);
  color: var(--text);
}

body.modal-open {
  overflow: hidden;
}

.wrap {
  max-width: 980px;
  margin: 0 auto;
  padding: 36px 20px;
}

.report-wrap {
  max-width: 1200px;
  padding-bottom: 56px;
}

.error-wrap {
  max-width: 760px;
}

.content-wrap {
  max-width: 760px;
}

.intro-copy p {
  margin: 8px 0 0;
}

.panel,
.hero {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(16, 27, 46, .80);
  padding: 28px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, .35);
}

.hero {
  background: linear-gradient(135deg, rgba(138, 180, 255, .18), rgba(16, 27, 46, .95));
}

.report-heading {
  display: block;
}

.report-title-row {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  justify-content: space-between;
}

.report-heading .button {
  flex: 0 0 auto;
  padding: 9px 12px;
  font-size: 14px;
}

.report-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  margin: 0 0 0 18px;
}

.report-actions .button {
  padding: 9px 12px;
  font-size: 14px;
}

.report-actions button.icon-button.subtle {
  width: 34px;
  height: 34px;
  min-width: 34px;
}

.report-actions button.icon-button.subtle svg,
.report-actions summary.icon-button.subtle svg {
  width: 18px;
  height: 18px;
}

.report-menu {
  position: relative;
  display: none;
}

.report-menu summary {
  list-style: none;
}

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

.report-actions-menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + 8px);
  right: 0;
  min-width: 190px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101b2e;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .35);
}

.report-actions-menu a,
.report-actions-menu button {
  display: flex;
  width: 100%;
  min-height: 40px;
  align-items: center;
  box-sizing: border-box;
  padding: 9px 10px;
  color: var(--text);
  background: transparent;
  border: 0;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
  text-align: left;
  text-decoration: none;
}

.report-actions-menu a:hover,
.report-actions-menu button:hover,
.report-actions-menu a:focus,
.report-actions-menu button:focus {
  background: rgba(138, 180, 255, .12);
  outline: none;
}

h1 {
  margin: 0 0 8px;
  font-size: 32px;
  letter-spacing: 0;
}

h2 {
  margin-top: 34px;
  font-size: 22px;
}

p,
.summary {
  color: var(--muted);
  line-height: 1.5;
}

.summary {
  margin: 0;
  font-size: 14px;
}

form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 24px;
}

label {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 6px;
}

input,
select {
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  padding: 11px 12px;
  color: var(--text);
  background: #0b1526;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 15px;
}

input[type="date"],
input[type="time"] {
  min-width: 0;
  max-width: 100%;
  min-height: 43px;
  line-height: normal;
  text-align: left;
  -webkit-appearance: none;
  appearance: none;
}

input[type="date"]::-webkit-date-and-time-value,
input[type="time"]::-webkit-date-and-time-value {
  display: block;
  width: 100%;
  min-height: 1.2em;
  text-align: left;
}

.planning-window {
  min-width: 0;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(8, 17, 31, .24);
}

.planning-window legend {
  color: var(--muted);
  font-size: 13px;
  padding: 0 6px;
}

.planning-window-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

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

.field-disabled {
  opacity: .62;
}

.field-disabled input {
  cursor: not-allowed;
}

.option-row label {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 0;
  color: var(--text);
}

.option-row input {
  width: auto;
}

.day-picker {
  margin: 0;
  padding: 0;
  border: 0;
}

.day-picker legend {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 8px;
}

.day-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.day-options label {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  min-height: 34px;
  padding: 0 10px;
  color: var(--text);
  background: #0b1526;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 0;
  cursor: pointer;
}

.day-options input {
  width: auto;
}

.hint.warn {
  color: var(--warn);
}

.field-explanation {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.full {
  grid-column: 1 / -1;
}

.form-separator {
  grid-column: 1 / -1;
  height: 1px;
  background: var(--line);
}

.hint,
.page-footer,
.data-attribution {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.page-footer,
.data-attribution {
  margin: 12px 0 0;
  text-align: center;
  opacity: .72;
}

.data-attribution {
  margin-top: 4px;
  font-size: 11px;
  opacity: .55;
}

.page-footer a {
  color: var(--muted);
}

.page-footer a:hover {
  color: var(--text);
}

button,
.button {
  border: 0;
  color: #06101f;
  background: var(--accent);
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 750;
  cursor: pointer;
  text-decoration: none;
}

button.secondary {
  color: var(--text);
  background: #16253d;
  border: 1px solid var(--line);
}

.secondary-link {
  color: var(--text);
  background: #16253d;
  border: 1px solid var(--line);
}

button.icon-text-button,
button.icon-button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

button.icon-text-button {
  gap: 8px;
}

button.icon-button,
.icon-button {
  width: 43px;
  height: 43px;
  padding: 0;
  color: #06101f;
  background: var(--accent);
  border: 0;
}

button.icon-button.subtle,
.icon-button.subtle {
  width: 34px;
  height: 34px;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
}

button.icon-button.subtle:hover,
.icon-button.subtle:hover {
  color: var(--text);
  background: rgba(138, 180, 255, .10);
}

button svg,
.icon-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mobile-label {
  display: none;
}

button.icon-button svg,
.icon-button svg {
  width: 43px;
  height: 43px;
  stroke-width: 2;
}

button.icon-button.subtle svg,
.icon-button.subtle svg {
  width: 18px;
  height: 18px;
}

button:disabled {
  opacity: .65;
  cursor: not-allowed;
}

code {
  background: #0b1526;
  padding: 2px 5px;
  border-radius: 6px;
}

.lookup {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: end;
}

.lookup button {
  height: 43px;
  white-space: nowrap;
}

.location-row {
  grid-template-columns: minmax(220px, 1fr) auto auto auto;
}

.location-picker {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(8, 17, 31, .34);
}

.location-row button {
  height: 43px;
  padding: 0 14px;
  font-size: 15px;
  font-weight: 750;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.error-panel {
  margin-top: 8vh;
}

.error-panel .label {
  margin: 0 0 10px;
}

.content-panel p {
  font-size: 15px;
}

.content-panel a:not(.button) {
  color: var(--accent);
}

.error-detail {
  margin-top: 22px;
  padding: 16px;
  border: 1px solid rgba(255, 209, 102, .35);
  border-radius: 8px;
  background: rgba(255, 209, 102, .08);
}

.error-detail p {
  margin: 8px 0 0;
  color: var(--text);
}

.status {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  min-height: 18px;
}

.status.ok {
  color: var(--best);
}

.status.warn {
  color: var(--warn);
}

.results {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.result-button {
  text-align: left;
  color: var(--text);
  background: #0b1526;
  border: 1px solid var(--line);
}

.result-button strong,
.result-button span {
  display: block;
}

.result-button span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, .72);
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop.open {
  display: flex;
}

.modal {
  width: min(1000px, 96vw);
  height: min(760px, 92vh);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101b2e;
  box-shadow: 0 24px 90px rgba(0, 0, 0, .55);
  overflow: hidden;
}

.modal-header,
.modal-footer {
  display: flex;
  flex: 0 0 auto;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.modal-footer {
  border-top: 1px solid var(--line);
  border-bottom: 0;
}

.modal-title {
  font-size: 18px;
  font-weight: 800;
}

.modal-body {
  display: flex;
  padding: 16px;
  flex: 1 1 auto;
  min-height: 0;
}

.map-card {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #0b1526;
}

#map {
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
  width: 100%;
  position: relative;
  background: #d7e2c8;
}

.map-help {
  flex: 0 0 auto;
  padding: 10px 12px;
  color: var(--muted);
  font-size: 13px;
  border-top: 1px solid var(--line);
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-top: 22px;
}

.card {
  background: rgba(16, 27, 46, .85);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.label {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.value {
  margin-top: 6px;
  font-size: 20px;
  font-weight: 650;
}

.report-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.report-counts > div {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  min-height: 32px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(8, 17, 31, .42);
  color: var(--muted);
  font-size: 13px;
}

.count {
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
}

.best-count {
  color: var(--best);
}

.usable-count {
  color: var(--usable);
}

.excluded-count {
  color: var(--excluded);
}

.report-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-top: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.report-meta > div {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 10px;
  align-items: baseline;
  min-height: 38px;
  padding: 9px 12px;
  background: rgba(16, 27, 46, .9);
}

.report-meta .label {
  font-size: 11px;
  letter-spacing: .04em;
}

.report-meta .value {
  min-width: 0;
  margin: 0;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.25;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(16, 27, 46, .72);
}

.mobile-report-list {
  display: none;
}

.print-only {
  display: none;
}

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

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

th {
  color: var(--muted);
  background: rgba(21, 35, 58, .95);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .06em;
}

th:nth-child(1),
td:nth-child(1),
th:nth-child(2),
td:nth-child(2) {
  white-space: nowrap;
}

.desktop-report-table th:nth-child(1),
.desktop-report-table td:nth-child(1) {
  width: 6%;
}

.desktop-report-table th:nth-child(2),
.desktop-report-table td:nth-child(2) {
  width: 8%;
}

.desktop-report-table th:nth-child(3),
.desktop-report-table td:nth-child(3) {
  width: 7%;
}

.desktop-report-table th:nth-child(4),
.desktop-report-table td:nth-child(4),
.desktop-report-table th:nth-child(5),
.desktop-report-table td:nth-child(5) {
  width: 8%;
}

.desktop-report-table th:nth-child(6),
.desktop-report-table td:nth-child(6),
.desktop-report-table th:nth-child(7),
.desktop-report-table td:nth-child(7) {
  width: 6%;
}

.desktop-report-table th:nth-child(8),
.desktop-report-table td:nth-child(8),
.desktop-report-table th:nth-child(9),
.desktop-report-table td:nth-child(9) {
  width: 7.5%;
}

.desktop-report-table th:nth-child(4),
.desktop-report-table td:nth-child(4),
.desktop-report-table th:nth-child(5),
.desktop-report-table td:nth-child(5),
.desktop-report-table th:nth-child(8),
.desktop-report-table td:nth-child(8),
.desktop-report-table th:nth-child(9),
.desktop-report-table td:nth-child(9) {
  white-space: nowrap;
}

.desktop-report-table th:nth-child(10),
.desktop-report-table td:nth-child(10) {
  width: 37%;
}

.desktop-report-table th,
.desktop-report-table td {
  padding-left: 10px;
  padding-right: 10px;
}

.desktop-report-table .print-only {
  display: block;
}

.badge {
  display: inline-block;
  min-width: 58px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.1;
  text-align: center;
  white-space: nowrap;
}

.best {
  color: #062915;
  background: var(--best);
}

.usable {
  color: #101827;
  background: var(--usable);
}

.excluded {
  color: #350909;
  background: var(--excluded);
}

.empty {
  color: var(--muted);
  text-align: center;
  padding: 24px;
}

/* Essential Leaflet layout fallback for cases where the CDN stylesheet is unavailable. */
.leaflet-pane,
.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow,
.leaflet-tile-container,
.leaflet-pane > svg,
.leaflet-pane > canvas,
.leaflet-zoom-box,
.leaflet-image-layer,
.leaflet-layer {
  position: absolute;
  left: 0;
  top: 0;
}

.leaflet-container {
  overflow: hidden;
  background: #d7e2c8;
}

.leaflet-container a {
  -webkit-tap-highlight-color: rgba(51, 181, 229, .4);
}

.leaflet-container img,
.leaflet-tile {
  max-width: none !important;
  max-height: none !important;
}

.leaflet-control {
  position: relative;
  z-index: 800;
  pointer-events: auto;
}

.leaflet-top,
.leaflet-bottom {
  position: absolute;
  z-index: 1000;
  pointer-events: none;
}

.leaflet-top {
  top: 0;
}

.leaflet-right {
  right: 0;
}

.leaflet-bottom {
  bottom: 0;
}

.leaflet-left {
  left: 0;
}

.leaflet-control {
  float: left;
  clear: both;
}

.leaflet-right .leaflet-control {
  float: right;
}

.leaflet-top .leaflet-control {
  margin-top: 10px;
}

.leaflet-bottom .leaflet-control {
  margin-bottom: 10px;
}

.leaflet-left .leaflet-control {
  margin-left: 10px;
}

.leaflet-right .leaflet-control {
  margin-right: 10px;
}

.leaflet-control-zoom {
  border: 2px solid rgba(0, 0, 0, .2);
  border-radius: 4px;
  overflow: hidden;
}

.leaflet-control-zoom a {
  display: block;
  width: 30px;
  height: 30px;
  line-height: 30px;
  text-align: center;
  text-decoration: none;
  background: #fff;
  color: #000;
  border-bottom: 1px solid #ccc;
}

.leaflet-control-zoom a:last-child {
  border-bottom: 0;
}

.leaflet-control-attribution {
  background: rgba(255, 255, 255, .8);
  padding: 0 5px;
  color: #111;
  font-size: 11px;
}

.leaflet-control-attribution a {
  color: #0078a8;
}

.leaflet-control-layers {
  background: #fff;
  border: 2px solid rgba(0, 0, 0, .2);
  border-radius: 8px;
  padding: 8px 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .18);
  color: #111;
  font-size: 13px;
}

.leaflet-control-layers:not(.leaflet-control-layers-expanded),
.layers-click-control:not(.layers-click-open) {
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.leaflet-control-layers:not(.leaflet-control-layers-expanded) .leaflet-control-layers-list,
.layers-click-control:not(.layers-click-open) .leaflet-control-layers-list {
  display: none;
}

.layers-click-control .leaflet-control-layers-list {
  display: none;
}

.layers-click-control:not(.layers-click-open) .leaflet-control-layers-toggle {
  display: block;
}

.layers-click-control.layers-click-open {
  padding: 8px 10px;
  background: #fff;
  border: 2px solid rgba(0, 0, 0, .2);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .18);
}

.layers-click-control.layers-click-open .leaflet-control-layers-list {
  display: block;
}

.layers-click-control.layers-click-open .leaflet-control-layers-toggle {
  display: none;
}

.leaflet-control-layers-toggle {
  display: block;
  width: 38px;
  height: 38px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, .25);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .25);
  position: relative;
  overflow: hidden;
}

.leaflet-control-layers-toggle::before,
.leaflet-control-layers-toggle::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 12px;
  left: 10px;
  border: 2px solid #334155;
  border-radius: 3px;
  box-sizing: border-box;
  transform: rotate(-18deg);
}

.leaflet-control-layers-toggle::before {
  top: 10px;
  background: #dbeafe;
}

.leaflet-control-layers-toggle::after {
  top: 16px;
  background: #bfdbfe;
}

.leaflet-control-layers-expanded .leaflet-control-layers-toggle {
  display: none;
}

.leaflet-control-layers label {
  display: block;
  margin: 4px 0;
  color: #111;
  cursor: pointer;
}

.leaflet-control-layers input {
  width: auto;
  margin-right: 6px;
}

.leaflet-control-layers-separator {
  height: 0;
  border-top: 1px solid #ddd;
  margin: 6px -10px;
}

.custom-map-marker-icon {
  background: transparent !important;
  border: 0 !important;
}

.custom-map-marker-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #2f6bff;
  border: 3px solid white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .45);
  box-sizing: border-box;
}

@media (max-width: 700px) {
  .wrap {
    padding: 20px 12px;
  }

  .panel {
    padding: 20px 16px;
  }

  form,
  .planning-window-grid {
    grid-template-columns: 1fr;
  }

  .location-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 43px;
    gap: 8px;
  }

  .location-row input {
    grid-column: 1 / -1;
  }

  .location-row button {
    min-width: 0;
    padding: 0 10px;
    font-size: 14px;
  }

  .desktop-label {
    display: none;
  }

  .mobile-label {
    display: inline;
  }

  .report-heading {
    display: block;
  }

  .report-title-row {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    justify-content: space-between;
  }

  .report-title-row h1 {
    flex: 1 1 auto;
    min-width: 0;
  }

  .report-heading h1 {
    font-size: 22px;
    line-height: 1.1;
    white-space: nowrap;
  }

  .report-actions {
    flex: 0 0 auto;
    display: block;
    margin: 0;
  }

  .report-actions .report-direct-action {
    display: none;
  }

  .report-menu {
    display: block;
  }

  .report-menu summary.icon-button.subtle {
    display: inline-flex;
    width: 38px;
    height: 38px;
    min-width: 38px;
    align-items: center;
    justify-content: center;
    transform: translateY(-10px);
  }

  .report-actions-menu {
    min-width: 205px;
  }

  .report-meta {
    grid-template-columns: 1fr;
  }

  .desktop-report-table {
    display: none;
  }

  .mobile-report-list {
    display: grid;
    gap: 12px;
  }

  .mobile-report-card,
  .mobile-empty {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(16, 27, 46, .82);
    padding: 14px;
  }

  .mobile-card-topline {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    justify-content: space-between;
  }

  .mobile-card-day {
    font-size: 15px;
    font-weight: 750;
  }

  .mobile-card-date {
    margin-top: 2px;
    color: var(--muted);
    font-size: 13px;
  }

  .mobile-card-facts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 12px;
    margin: 14px 0 0;
  }

  .mobile-card-facts div {
    min-width: 0;
  }

  .mobile-card-facts dt {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
  }

  .mobile-card-facts dd {
    margin: 3px 0 0;
    font-size: 13px;
    line-height: 1.25;
  }

  .mobile-card-reason {
    margin: 12px 0 0;
    padding-top: 10px;
    border-top: 1px solid var(--line);
    color: var(--text);
    font-size: 13px;
    line-height: 1.35;
  }

  .mobile-empty {
    color: var(--muted);
    text-align: center;
  }

  .modal-backdrop {
    align-items: stretch;
    justify-content: stretch;
    padding: 0;
  }

  .modal {
    width: 100vw;
    max-height: none;
    height: 100vh;
    height: 100dvh;
    border: 0;
    border-radius: 0;
  }

  .modal-header,
  .modal-footer {
    flex: 0 0 auto;
    padding: 12px max(12px, env(safe-area-inset-right)) 12px max(12px, env(safe-area-inset-left));
  }

  .modal-title {
    font-size: 16px;
  }

  .modal-body {
    display: flex;
    min-height: 0;
    padding: 10px max(10px, env(safe-area-inset-right)) 10px max(10px, env(safe-area-inset-left));
  }

  .map-card {
    display: flex;
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    flex-direction: column;
  }

  #map {
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
  }

  .map-help {
    flex: 0 0 auto;
    padding: 8px 10px;
    font-size: 12px;
  }

  .modal-footer {
    flex-direction: column;
    align-items: stretch;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }
}

@media print {
  @page {
    size: landscape;
    margin: .35in;
    background: white;
  }

  * {
    box-shadow: none !important;
    -webkit-print-color-adjust: economy;
    print-color-adjust: economy;
  }

  :root {
    color-scheme: light !important;
    background: white !important;
  }

  html {
    color-scheme: light !important;
    background: white !important;
  }

  body {
    color-scheme: light !important;
    background: white !important;
    color: black;
    font-size: 11px;
  }

  .wrap,
  .report-wrap {
    max-width: none;
    padding: 0;
  }

  .hero,
  .table-wrap {
    background: white;
    border-color: #bbb;
  }

  .hero {
    padding: 0 0 10px;
    border: 0;
  }

  h1 {
    margin-bottom: 4px;
    font-size: 21px;
  }

  h2 {
    margin: 12px 0 5px;
    font-size: 15px;
    break-after: avoid;
    page-break-after: avoid;
  }

  .report-table-section {
    break-inside: auto;
    page-break-inside: auto;
  }

  .summary,
  .label,
  th {
    color: #333;
  }

  .summary {
    max-width: none;
    font-size: 12px;
    line-height: 1.25;
  }

  .button,
  .actions,
  .report-actions,
  .report-heading .button,
  .page-footer,
  .data-attribution {
    display: none;
  }

  .report-heading {
    display: block;
  }

  .report-counts {
    gap: 5px;
    margin-top: 8px;
  }

  .report-counts > div {
    min-height: 0;
    padding: 3px 7px;
    border-color: #bbb;
    background: white;
    color: #333;
    font-size: 11px;
  }

  .count {
    font-size: 14px;
  }

  .report-meta {
    grid-template-columns: repeat(3, 1fr);
    margin-top: 8px;
    border-color: #bbb;
    background: #bbb;
  }

  .report-meta > div {
    grid-template-columns: 72px minmax(0, 1fr);
    min-height: 0;
    padding: 5px 7px;
    background: white;
  }

  .report-meta .label {
    font-size: 9px;
    letter-spacing: 0;
  }

  .report-meta .value {
    font-size: 12px;
  }

  .table-wrap {
    overflow: visible;
    border-radius: 0;
    break-before: avoid;
    page-break-before: avoid;
  }

  .desktop-report-table {
    display: block;
  }

  .mobile-report-list {
    display: none;
  }

  table {
    min-width: 0;
    width: 100%;
    table-layout: fixed;
    break-before: avoid;
    page-break-before: avoid;
  }

  thead {
    display: table-header-group;
  }

  tr {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  th,
  td {
    box-sizing: border-box;
    padding: 6px 5px;
    color: black;
    border-color: #ccc;
    font-size: 11px;
    line-height: 1.3;
  }

  th {
    background: #eee;
    font-size: 9.5px;
    letter-spacing: 0;
  }

  th:nth-child(1),
  td:nth-child(1) {
    width: 7%;
  }

  th:nth-child(2),
  td:nth-child(2) {
    width: 8%;
  }

  th:nth-child(3),
  td:nth-child(3) {
    width: 6%;
  }

  th:nth-child(4),
  td:nth-child(4) {
    width: 8%;
    padding-left: 14px;
  }

  th:nth-child(5),
  td:nth-child(5) {
    width: 8%;
  }

  th:nth-child(8),
  td:nth-child(8) {
    width: 6%;
  }

  th:nth-child(9),
  td:nth-child(9) {
    width: 8%;
  }

  th:nth-child(6),
  td:nth-child(6),
  th:nth-child(7),
  td:nth-child(7) {
    width: 6%;
  }

  th:nth-child(10),
  td:nth-child(10) {
    width: 37%;
  }

  .print-only {
    display: block;
  }

  .badge {
    min-width: 48px;
    padding: 2px 4px;
    font-size: 10px;
  }

  .best {
    color: #062915;
    background: var(--best);
    border: 1px solid #2d8b55;
  }

  .usable {
    color: #101827;
    background: var(--usable);
    border: 1px solid #4d85c9;
  }

  .excluded {
    color: #350909;
    background: var(--excluded);
    border: 1px solid #b43a3a;
  }
}
