/* Sized for embedding in another page (a WordPress post): the container brings
   its own height, and nothing here touches html or body -- that would take over
   the host page. map.html overrides --map-height and the box to fill the
   viewport instead. Override --map-height to make the embedded map taller. */
#__map_container {
  --map-height: 70vh;
  position: relative;
  width: 100%;
  height: var(--map-height);
  min-height: 420px;
}

.control-group {
  display: flex;
  flex-direction: row;
  gap: 8px;
  padding-top: 5px;
  pointer-events: auto;
}

.message-view {
  background-color: #c4e3f3;
  border-bottom-color: #5bc0de;
  border-bottom-style: solid;
  border-bottom-width: 1px;
  display: flex;
  flex-flow: row;
}

.tooltip {
  position: relative;
  display: inline;
  border-bottom: 1px dotted black;
}

.tooltip .tooltiptext {
  visibility: hidden;
  width: 231px;
  background-color: #555;
  color: #fff;
  text-align: start;
  padding: 5px 0;
  border-radius: 6px;
  position: absolute;
  z-index: 1;
  bottom: 125%;
  left: 50%;
  margin-left: -60px;
  opacity: 0;
  transition: opacity 0.3s;
}

.tooltip .tooltiptext::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: #555 transparent transparent transparent;
}

.tooltip:hover .tooltiptext {
  visibility: visible;
  opacity: 1;
}

.tooltip-table {
  width: inherit;
  max-width: 225px;
  white-space: wrap;
  table-layout: auto;
  border-collapse: collapse;
  margin: 3px;
  font-size: x-small;
}

table.tooltip-table tr {
  width: inherit;
  flex-direction: column;
}

table.tooltip-table td {
  white-space: wrap;
}

.maplibregl-popup-close-button {
  background-color: transparent;
  border-radius: 0 3px 0 0;
  cursor: pointer;
  position: absolute;
  right: 0;
  top: 0;
  width: 16px;
  height: 16px;
  color: black;
  padding: 0;
}

div.maplibregl-popup-content table tr th {
  color: black;
  padding: 4px 8px;
  white-space: nowrap;
  text-wrap: nowrap;
  background-color: #DDD;
}

div.maplibregl-popup-content table tr td {
  color: black;
  padding: 4px 8px;
  background-color: #EEE;
}

div.maplibregl-popup-content table td div.wrappable {
  width: 125px;
  font-family: Arial;
  font-weight: lighter;
  text-wrap: wrap;
}

div.maplibregl-popup-content table tr td:first-child,
div.maplibregl-popup-content table tr th:first-child {
  white-space: nowrap;
  border-left: none;
}

div.maplibregl-popup-content table tr:first-of-type td,
div.maplibregl-popup-content table tbodytr:first-of-type th {
  border-top: none;
  white-space: nowrap;
  text-align: center;
  background-color: #EEEEEE;
}

.in-circle {
  display: inline-block;
  background: #333;
  color: #fff;
  border-radius: 50%;
  width: 12px;
  height: 12px;
  line-height: 11px;
  text-align: center;
  font-size: 9px;
  font-family: Verdana;
  cursor: hand;
}

.tick-data {
  color: black;
}

.tick-larva {
  cursor: url("../res/infotick/tick_l.jpeg"), auto;
  width: 24px;
}

.tick-nymph {
  cursor: url("../res/infotick/tick_n.jpeg"), auto;
  width: 32px;
}

.tick-male {
  cursor: url("../res/infotick/tick_am.jpeg"), auto;
  width: 50px;
}

.tick-female {
  cursor: url("../res/infotick/tick_af.jpeg"), auto;
  width: 50px;
}

.selector-control.map-control-panel {
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 260px;
  max-width: 340px;
  /* The map is not always the whole window, so cap against the map itself. */
  max-height: calc(var(--map-height, 100vh) - 40px);
  /* The panel is capped, so it must scroll — otherwise flex compresses the
     sections past their content and they overlap. */
  overflow-y: auto;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.18);
  backdrop-filter: blur(10px);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.map-control-title {
  color: #162033;
  font-size: 14px;
  font-weight: 700;
}


.panel-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
}

.panel-tab-button {
  width: 92px;
  flex: 0 0 92px;
  border: 1px solid rgba(23, 35, 78, 0.12);
  border-radius: 10px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.5);
  color: rgba(21, 32, 51, 0.78);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
}

.panel-tab-button.is-disabled {
  background: rgba(226, 232, 240, 0.9);
  border-color: rgba(148, 163, 184, 0.5);
  color: rgba(100, 116, 139, 0.95);
  cursor: not-allowed;
}

.panel-tab-button:disabled {
  opacity: 1;
}

.panel-tab-button.is-active {
  background: #17234e;
  border-color: #17234e;
  color: #ffffff;
}

/* Sections keep their natural height; the panel scrolls instead. */
.selector-control.map-control-panel > * {
  flex-shrink: 0;
}

.panel-tab-content {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.panel-tab-panel {
  display: none;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
}

.panel-tab-panel.is-active {
  display: flex;
}

.is-hidden {
  display: none !important;
}

.auth-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.auth-meta {
  color: rgba(21, 32, 51, 0.68);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  word-break: break-word;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.auth-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.auth-status {
  min-height: 18px;
  color: rgba(21, 32, 51, 0.72);
  font-size: 12px;
}

.auth-status.is-success {
  color: #166534;
}

.auth-status.is-error {
  color: #b42318;
}

.auth-logged-in {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.auth-card,
.auth-list-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  border: 1px solid rgba(23, 35, 78, 0.08);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.5);
}

.auth-card-label {
  color: rgba(22, 32, 51, 0.72);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.auth-card-value {
  color: #17234e;
  font-size: 13px;
  font-weight: 700;
  word-break: break-word;
}

.auth-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.auth-chip {
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(23, 35, 78, 0.08);
  color: #17234e;
  font-size: 11px;
  font-weight: 600;
  word-break: break-word;
}

.auth-list-empty {
  color: rgba(21, 32, 51, 0.6);
  font-size: 12px;
}

.map-control-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.map-control-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px;
  border: 1px solid rgba(23, 35, 78, 0.08);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.5);
}

.map-control-stat-label,
.map-control-label {
  color: rgba(22, 32, 51, 0.72);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.map-control-stat-value {
  color: #17234e;
  font-size: 15px;
  font-weight: 700;
}

.map-control-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.map-control-field-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.map-control-input,
.map-control-range {
  width: 100%;
  box-sizing: border-box;
}

.map-control-input {
  pointer-events: auto;
  padding: 8px 10px;
  border: 1px solid rgba(23, 35, 78, 0.16);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.84);
  color: #152033;
  font-size: 13px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.map-control-input:focus,
.map-control-range:focus {
  outline: 2px solid rgba(23, 35, 78, 0.16);
  outline-offset: 1px;
}

.map-control-input option {
  color: #152033;
}

.map-control-time.is-hidden {
  display: none;
}

.map-control-range {
  accent-color: #17234e;
}

/* Dual-handle month range: two sliders stacked on one shared track. */
.map-control-range-group {
  position: relative;
  height: 24px;
  pointer-events: auto;
}

.map-control-range-track,
.map-control-range-fill {
  position: absolute;
  top: 50%;
  height: 4px;
  border-radius: 999px;
  transform: translateY(-50%);
  pointer-events: none;
}

.map-control-range-track {
  left: 0;
  right: 0;
  background: rgba(23, 35, 78, 0.18);
}

.map-control-range-fill {
  background: #17234e;
}

.map-control-range-group input[type='range'] {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 24px;
  margin: 0;
  padding: 0;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  /* Only the handles are grabbable, so the lower slider stays reachable. */
  pointer-events: none;
}

.map-control-range-group .map-control-range-from {
  z-index: 2;
}

.map-control-range-group .map-control-range-to {
  z-index: 3;
}

.map-control-range-group input[type='range']::-webkit-slider-runnable-track {
  height: 24px;
  background: transparent;
  border: none;
}

.map-control-range-group input[type='range']::-moz-range-track {
  height: 24px;
  background: transparent;
  border: none;
}

.map-control-range-group input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  pointer-events: auto;
  width: 16px;
  height: 16px;
  margin-top: 4px;
  border-radius: 50%;
  border: 2px solid #17234e;
  background: #ffffff;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(23, 35, 78, 0.35);
}

.map-control-range-group input[type='range']::-moz-range-thumb {
  pointer-events: auto;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid #17234e;
  background: #ffffff;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(23, 35, 78, 0.35);
}

.map-control-range-group input[type='range']:focus-visible::-webkit-slider-thumb {
  outline: 2px solid rgba(23, 35, 78, 0.45);
  outline-offset: 1px;
}

.map-control-range-group input[type='range']:focus-visible::-moz-range-thumb {
  outline: 2px solid rgba(23, 35, 78, 0.45);
  outline-offset: 1px;
}

.map-control-range-values {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.map-control-range-value {
  color: #17234e;
  font-size: 12px;
  font-weight: 600;
}

.map-control-range-separator {
  color: rgba(23, 35, 78, 0.55);
  font-size: 12px;
}

.map-control-range-bounds {
  display: flex;
  justify-content: space-between;
  color: rgba(23, 35, 78, 0.55);
  font-size: 11px;
}

.map-control-button {
  pointer-events: auto;
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #17234e;
  border-radius: 10px;
  background: #17234e;
  color: #ffffff;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.map-control-button:hover {
  background: #1f2f66;
}

.map-control-button:focus-visible {
  outline: 2px solid rgba(23, 35, 78, 0.45);
  outline-offset: 2px;
}

.map-control-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #17234e;
  font-size: 13px;
  font-weight: 500;
}

.map-control-toggle input {
  margin: 0;
  accent-color: #17234e;
}

.map-control-toggle.is-disabled {
  opacity: 0.55;
}

.admin-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 4px;
  min-height: 0;
}

.admin-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
}

.admin-service-field {
  padding: 10px;
  border: 1px solid rgba(23, 35, 78, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.42);
}

.admin-service-field .admin-input {
  background: rgba(255, 255, 255, 0.9);
}

.admin-service-field .admin-field-label {
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 11px;
}

.admin-toolbar .admin-button {
  min-height: 38px;
}

.admin-type-select {
  min-width: 0;
}

.admin-status {
  min-height: 18px;
  color: rgba(21, 32, 51, 0.72);
  font-size: 12px;
}

.admin-status.is-success {
  color: #166534;
}

.admin-status.is-error {
  color: #b42318;
}

.admin-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  max-height: 42vh;
  overflow-y: auto;
  padding-right: 4px;
}

.admin-empty {
  padding: 12px;
  border: 1px dashed rgba(23, 35, 78, 0.18);
  border-radius: 10px;
  color: rgba(21, 32, 51, 0.72);
  font-size: 12px;
  background: rgba(255, 255, 255, 0.42);
}

.admin-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.admin-summary-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 9px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(23, 35, 78, 0.08);
}

.admin-summary-item span {
  color: rgba(21, 32, 51, 0.72);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.admin-summary-item strong {
  color: #17234e;
  font-size: 12px;
  font-weight: 700;
  word-break: break-word;
}

.admin-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.admin-field-label {
  color: rgba(21, 32, 51, 0.78);
  font-size: 12px;
  font-weight: 600;
}

.admin-input {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  border: 1px solid rgba(23, 35, 78, 0.16);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.84);
  color: #152033;
  font-size: 13px;
  font-family: inherit;
}

.admin-input:focus {
  outline: 2px solid rgba(23, 35, 78, 0.16);
  outline-offset: 1px;
}

.admin-input:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

textarea.admin-input {
  resize: vertical;
  min-height: 72px;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-button {
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

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

.admin-button-primary {
  background: #17234e;
  color: #fff;
}

.admin-button-danger {
  background: rgba(180, 35, 24, 0.1);
  border-color: rgba(180, 35, 24, 0.15);
  color: #b42318;
}


.selector-point-icon {
  background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAALdJREFUOI1jYMAOFID4GxD/h+JvUDGiQAkQX8QifgkqhxdwAPETJP40KIaBJ1A1OMEeIGaFskFOF4Pi/1AxkNxufAbAFDoCcRySeAIQO6CpwWuABBAvQRJfCsTixBiAHHingfg+FJ9CEr+Az4AcILbCI28DxNn4DACBc3jkzhPSDAL4/IjX/zCQDMSxWMTjoHJEAWw2EWU7DOQCcToSPwMqRhL4j4NNNJAE4ttQLEGOASCwFIpxAgBU8ChLMbI4+AAAAABJRU5ErkJggg==") no-repeat center;
  padding-left:16px;
}
.selector-poly-icon {
  padding-left:16px;
  background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAA3lBMVEUAAAAzMzMUFBQzMzMzMzMmJiYTExMwMDAxMTEyMjIzMzMcHBwyMjIzMzMzMzMdHR0wMDAMDAwVFRUwMDAcHBwzMzMyMjImJiYfHx8jIyMnJycxMTEnJycMDAwODg4vLy8zMzMsLCwhISEWFhYQEBAdHR0JCQkxMTEuLi4KCgotLS0wMDAeHh4wMDAzMzMrKyszMzMZGRkoKCgyMjIUFBQUFBQeHh4bGxszMzMQEBATExMzMzMmJiYzMzMcHBwNDQ0sLCwyMjItLS0zMzMjIyMnJychISEcHBwUFBQzMzOy2E7gAAAASXRSTlMA2irU8lIXnsLc6UjN3OBIqAEXtS30vW1DUmG1YAQJnf18RhsJLQTEpgSdsk2u+4XJNmTTCx8zJvcIEt5W+iMEhc+J6kdjQTcXgxA5kQAAAJhJREFUeF5NjtUagzAMRtOtDBkw5u7u7u7r+7/QaGj5OBdJzn/zBzgRQhIQJMpYMhcPBAV9mjXtDFWEN422O1NpVhVBsY4rrzmel8wyIBX9hQ21DwgaVgsbYiBxNAU63V4fJANGAYYj8BlPVIDZ3PfFcuVOey19Y2z52u2FH4746el8Qb3e7g88KHuGOZasV+k7xPkS8uP+BxJpDX3y3etIAAAAAElFTkSuQmCC") no-repeat center;
}

.btn-active {
  border: #17234E solid thin;
  background: #17234E;
}

.btn-inactive {
  border: #FFFFFF solid thin;
}

.invisible {
  visibility: collapse;
}

.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.8);
}

.modal-content {
  display: block;
  margin: 10% auto;
  max-width: 90%;
  max-height: 80%;
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.close {
  position: absolute;
  top: 20px;
  right: 35px;
  color: #fff;
  font-size: 30px;
  font-weight: bold;
  cursor: pointer;
}

.record-counter {
  top: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.4);
  color: #000;
  padding: 8px 8px;
  border-radius: 10px;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  font-size: 16px;
  font-weight: 500;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  flex-direction: column;
}

.record-counter .label {
  opacity: 0.75;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.record-counter .count {
  font-size: 20px;
  font-weight: 600;
  color: #00ff99;
}
