.map-demo {
  border: 1px solid #c7ced8;
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
  margin: 16px 0;
  position: relative;
}
.demo-toolbar,
.demo-query {
  padding: 11px 14px;
  display: flex;
  gap: 10px 16px;
  align-items: center;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}
.demo-toolbar fieldset {
  border: 0;
  padding: 0;
  margin: 0;
  display: flex;
  gap: 6px;
  align-items: center;
}
.demo-toolbar legend {
  float: left;
  margin-right: 14px;
}
.demo-reset {
  margin-left: auto;
}
.demo-query label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 12px;
}
.demo-query input {
  width: 115px;
}
.demo-query select {
  max-width: 180px;
}
.demo-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  min-height: 470px;
}
.demo-canvas {
  height: 480px;
  min-width: 0;
  position: relative;
  background: #f0f3f5;
}
.demo-stage {
  position: relative;
  min-width: 0;
}
.demo-side {
  border-left: 1px solid var(--line);
  padding: 16px;
  max-height: 480px;
  overflow: auto;
  font-size: 12px;
}
.demo-side h2,
.demo-side h3,
.demo-tool-content h2,
.demo-tool-content h3 {
  font-size: 14px;
  margin: 0 0 12px;
  letter-spacing: 0;
}
.demo-side label,
.demo-layer-controls label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  margin: 8px 0;
}
.demo-layer-controls input[type="range"] {
  width: 130px;
}
.demo-result {
  margin: 18px 0;
  border-block: 1px solid var(--line);
  padding: 14px 0;
  min-height: 100px;
  overflow-wrap: anywhere;
}
.demo-result table {
  font-size: 11px;
  table-layout: fixed;
}
.demo-result td {
  padding: 5px 0;
  overflow-wrap: anywhere;
}
.demo-result th {
  background: none;
  white-space: normal;
  padding: 5px 8px 5px 0;
  width: 42%;
  color: var(--mut);
  font-weight: 400;
}
.demo-result strong {
  font:
    600 16px/1.4 system-ui,
    sans-serif;
  display: block;
}
.demo-result dl {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 5px 8px;
  font-size: 11px;
}
.demo-result dd {
  margin: 0;
}
.demo-result dt {
  color: var(--mut);
}
.demo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0;
}
.demo-actions button {
  font-size: 11px;
  padding: 6px 8px;
}
.demo-status {
  padding: 9px 14px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--mut);
  min-height: 38px;
}
.demo-tools {
  position: absolute;
  z-index: 3;
  top: 10px;
  left: 10px;
  width: min(280px, calc(100% - 64px));
  border: 1px solid #bdc6d2;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 3px 14px #18263824;
  font-size: 12px;
}
.demo-tools summary {
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 10px 12px;
  color: var(--acc);
}
.demo-tools[open] > summary {
  border-bottom: 1px solid var(--line);
}
.demo-tool-content {
  max-height: 410px;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 0 12px 12px;
}
.demo-refinement {
  padding: 12px 14px;
  border-bottom: 1px solid #ddc6a4;
  background: #fff8ec;
  font-size: 12px;
}
.demo-refinement label {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  cursor: pointer;
  margin: 0;
}
.demo-refinement label strong {
  font-size: 14px;
}
.demo-refinement .note {
  margin-bottom: 0;
}
.demo-result-notice {
  padding: 10px;
  background: #fff8ec;
  border-left: 3px solid #b66a17;
  font-size: 12px;
}
.map-demo .panel,
.map-demo .coverpanel {
  position: static;
  width: auto;
  padding: 12px 0;
  border: 0;
  background: none;
  box-shadow: none;
  max-height: none;
  overflow: visible;
}
.map-demo .phead,
.map-demo .coverhead {
  display: none;
}
.map-demo .row {
  margin: 12px 0;
}
.map-demo .row > label {
  font-weight: 600;
}
.map-demo .seg,
.map-demo .btns,
.presets {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}
.map-demo .seg button,
.map-demo .btns button,
.presets button {
  font-size: 11px;
  padding: 5px 8px;
}
.map-demo .note {
  font-size: 11px;
  margin: 7px 0;
}
.map-demo .filelabel {
  cursor: pointer;
  border: 1px solid #bdc6d2;
  padding: 6px 8px;
  border-radius: 4px;
}
.map-demo .legend {
  font-size: 11px;
  margin: 12px 0;
  line-height: 1.8;
}
.legend i {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 7px;
}
.legend-row {
  display: grid;
  grid-template-columns: 13px 25px 1fr;
  gap: 7px;
  align-items: center;
  margin: 4px 0;
}
.swatch {
  width: 13px;
  height: 13px;
}
.map-demo .status {
  padding: 8px 0;
  font-size: 11px;
}
.coveractions {
  display: flex;
  gap: 5px;
}
.coverhint,
.coverstats {
  font-size: 11px;
  margin: 8px 0;
}
.coverout {
  max-height: 160px;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 10px;
  padding: 10px;
}
.coverrange {
  display: flex;
  gap: 8px;
  align-items: center;
}
.coverrange input {
  min-width: 0;
  width: 120px;
}
.demo-batch {
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.demo-batch summary {
  cursor: pointer;
  font-weight: 600;
}
.demo-batch input {
  width: 100%;
  font-size: 11px;
}
.demo-batch p {
  font-size: 11px;
}
#loading {
  position: absolute;
  top: 120px;
  left: 20px;
  background: #fff;
  padding: 8px;
  z-index: 2;
  font-size: 12px;
  pointer-events: none;
}
.maplibregl-popup-content {
  font:
    12px/1.6 system-ui,
    sans-serif;
  max-width: 290px;
}
.maplibregl-ctrl-attrib {
  font-size: 10px;
}
.maplibregl-canvas:focus-visible {
  outline-offset: -3px;
}
.demo-marker {
  width: 16px;
  height: 16px;
  background: var(--acc);
  border: 3px solid white;
  border-radius: 50%;
  box-shadow: 0 0 0 1px #374151;
}
@media (max-width: 1100px) {
  .demo-body {
    grid-template-columns: minmax(0, 1fr) 260px;
  }
  .demo-side {
    padding: 12px;
  }
  .demo-query {
    gap: 8px;
  }
  .demo-query input {
    width: 100px;
  }
}
@media (max-width: 850px) {
  .demo-body {
    grid-template-columns: 1fr;
  }
  .demo-canvas {
    height: 360px;
  }
  .demo-side {
    border-left: 0;
    border-top: 1px solid var(--line);
    max-height: none;
  }
  .demo-query label {
    flex: 1;
    min-width: 110px;
    justify-content: space-between;
  }
  .demo-query input {
    width: 100%;
    min-width: 0;
  }
  .demo-query label:has(input) {
    display: block;
  }
  .demo-toolbar {
    gap: 8px;
    padding: 10px;
  }
  .demo-toolbar legend {
    margin-right: 6px;
  }
  .demo-toolbar button {
    font-size: 11px;
    padding: 6px 8px;
  }
  .demo-reset {
    margin-left: 0;
  }
  .demo-query {
    padding: 10px;
  }
  .demo-result {
    margin-top: 12px;
  }
  .demo-tool-content {
    max-height: 290px;
  }
  .demo-side .demo-actions {
    margin-bottom: 0;
  }
}
@media (max-width: 390px) {
  .demo-canvas {
    height: 300px;
  }
  .demo-tool-content {
    max-height: 230px;
  }
  .demo-toolbar fieldset {
    flex-wrap: wrap;
  }
  .demo-toolbar legend {
    width: 100%;
    margin-bottom: 5px;
  }
  .demo-query label {
    min-width: 100px;
  }
  .demo-query select {
    max-width: 160px;
  }
}
