@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}
.timespace-history-timeline {
  position: absolute;
  left: 50%;
  bottom: 72px;
  z-index: 1001;
  width: min(1240px, calc(100% - 180px));
  min-width: 420px;
  transform: translateX(-50%);
  padding: 10px 12px;
  border: 1px solid rgba(34, 211, 238, 0.34);
  border-radius: 8px;
  background: rgba(8, 20, 36, 0.82);
  box-shadow: 0 14px 42px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(12px);
  color: #e2e8f0;
  overscroll-behavior: contain;
  pointer-events: auto;
  cursor: grab;
  touch-action: none;
}
.timespace-history-timeline[data-drag-active="true"],
.tsp-measure-panel[data-drag-active="true"] {
  cursor: grabbing;
}
.timespace-history-timeline button,
.timespace-history-timeline input,
.timespace-history-timeline select {
  cursor: pointer;
  touch-action: auto;
}
.timespace-history-head {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
}
.timespace-history-title {
  display: flex;
  flex-direction: column;
  min-width: 150px;
}
.timespace-history-title strong {
  font-size: 13px;
  color: #67e8f9;
  line-height: 1.1;
}
.timespace-history-title span,
.timespace-history-note {
  font-size: 10px;
  color: #94a3b8;
  line-height: 1.35;
}
.timespace-history-active {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #cffafe;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}
.timespace-history-active button {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: #0f2a3f;
  color: #e0f2fe;
  border: 1px solid rgba(148, 163, 184, 0.22);
}
.timespace-history-active button:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}
.timespace-history-source-select {
  width: 130px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.9);
  color: #e2e8f0;
  font-size: 12px;
  padding: 5px 7px;
}
.timespace-history-source-select option {
  color: #0f172a;
  background: #ffffff;
}
.timespace-history-source-select option:disabled {
  color: #64748b;
}
.timespace-history-close {
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 6px;
  background: #0f2a3f;
  color: #e0f2fe;
  font-size: 18px;
  line-height: 1;
}
.timespace-history-close:hover {
  border-color: rgba(103, 232, 249, 0.62);
  background: #16415f;
}
.timespace-history-selects {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.timespace-history-selects .timespace-history-source-select {
  width: 122px;
  min-width: 0;
}
.timespace-history-source-select-panel {
  width: 100% !important;
  min-height: 38px;
  color: #e6f7ff !important;
  background: rgba(15, 23, 42, 0.96) !important;
  border-color: rgba(103, 232, 249, 0.34) !important;
}
.timespace-history-source-select-panel option {
  color: #0f172a !important;
  background: #ffffff !important;
}
.timespace-evidence-raster-image {
  outline: 1px solid rgba(34, 211, 238, 0.25);
  backface-visibility: hidden;
  image-rendering: auto;
  transition: none !important;
}
.timespace-evidence-raster-editing {
  cursor: move;
  outline: 2px solid rgba(34, 211, 238, 0.72);
  filter: drop-shadow(0 0 10px rgba(34, 211, 238, 0.42));
}
.leaflet-tile.leaflet-tile-loaded {
  opacity: 1 !important;
}
.leaflet-tile.timespace-province-history-tile:not(.leaflet-tile-loaded) {
  visibility: hidden !important;
  opacity: 0 !important;
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
}
.leaflet-tile.timespace-province-history-tile.leaflet-tile-loaded {
  visibility: visible !important;
  opacity: 1 !important;
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
}
.leaflet-tile.timespace-province-history-tile.tsp-province-tile-size-256 {
  width: 257px !important;
  height: 257px !important;
  max-width: none !important;
  max-height: none !important;
}
.leaflet-tile.timespace-province-history-tile.tsp-province-tile-size-512 {
  width: 513px !important;
  height: 513px !important;
  max-width: none !important;
  max-height: none !important;
}
.leaflet-container {
  width: 100% !important;
  height: 100% !important;
}
.timespace-evidence-edit-handle {
  background: transparent;
  border: 0;
}
.timespace-evidence-edit-handle-core {
  display: block;
  width: 18px;
  height: 18px;
  border: 2px solid #ffffff;
  border-radius: 999px;
  background: #06b6d4;
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.35), 0 0 18px rgba(6, 182, 212, 0.7);
}
.timespace-feedback-qr {
  background: #fff;
}
.timespace-feedback-panel {
  background: rgba(8, 18, 33, 0.98) !important;
  color: #e6f7ff !important;
  border-color: rgba(103, 232, 249, 0.65) !important;
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.55), 0 0 36px rgba(6, 182, 212, 0.28) !important;
}
.timespace-feedback-panel p,
.timespace-feedback-panel span {
  color: inherit;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}
.timespace-feedback-arrow {
  background: rgba(8, 18, 33, 0.98) !important;
  border-color: rgba(103, 232, 249, 0.65) !important;
}
.timespace-compliance-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px 9px;
  color: rgba(203, 213, 225, 0.82);
  font-size: 12px;
  line-height: 1.7;
  text-align: center;
}
.timespace-compliance-footer a {
  color: rgba(165, 243, 252, 0.92);
  text-decoration: none;
}
.timespace-compliance-footer a:hover {
  color: #ffffff;
  text-decoration: underline;
}
.timespace-compliance-separator {
  width: 1px;
  height: 12px;
  background: rgba(148, 163, 184, 0.42);
  flex: 0 0 auto;
}
.timespace-compliance-badge {
  border: 1px solid rgba(148, 163, 184, 0.5);
  border-radius: 4px;
  padding: 0 4px;
  color: rgba(226, 232, 240, 0.9);
}
.timespace-history-range {
  width: 100%;
  margin-top: 7px;
  accent-color: #06b6d4;
}
.timespace-history-ticks {
  display: grid;
  gap: 4px;
  margin-top: 4px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}
.timespace-history-ticks::-webkit-scrollbar {
  display: none;
}
.timespace-history-ticks button {
  min-width: 44px;
  height: 22px;
  border-radius: 5px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(15, 23, 42, 0.78);
  color: #94a3b8;
  font-size: 10px;
  line-height: 1;
  white-space: nowrap;
}
.timespace-history-ticks button[aria-pressed="true"] {
  border-color: #67e8f9;
  background: #0891b2;
  color: #fff;
  box-shadow: 0 0 16px rgba(6, 182, 212, 0.36);
}
.timespace-history-note {
  margin-top: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.timespace-convert-panel textarea,
.timespace-convert-panel input,
.timespace-convert-panel select,
textarea[class*="bg-slate-900/60"],
input[class*="bg-slate-900/60"],
select[class*="bg-slate-900/60"] {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid rgba(103, 232, 249, 0.34) !important;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.96) !important;
  color: #e6f7ff !important;
  caret-color: #67e8f9;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.timespace-convert-panel textarea {
  min-height: 72px;
  resize: vertical;
}
textarea[class*="bg-slate-900/60"] {
  resize: vertical;
}
.timespace-convert-panel input,
.timespace-convert-panel select,
input[class*="bg-slate-900/60"],
select[class*="bg-slate-900/60"] {
  min-height: 44px;
}
.timespace-convert-panel textarea::placeholder,
.timespace-convert-panel input::placeholder,
textarea[class*="bg-slate-900/60"]::placeholder,
input[class*="bg-slate-900/60"]::placeholder {
  color: #7dd3fc;
  opacity: 0.76;
}
.timespace-convert-panel textarea:focus,
.timespace-convert-panel input:focus,
.timespace-convert-panel select:focus,
textarea[class*="bg-slate-900/60"]:focus,
input[class*="bg-slate-900/60"]:focus,
select[class*="bg-slate-900/60"]:focus {
  border-color: #67e8f9 !important;
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.18);
}
.timespace-convert-panel select option,
select[class*="bg-slate-900/60"] option {
  background: #0f172a;
  color: #e6f7ff;
}
@media (max-width: 900px) {
  .timespace-history-timeline {
    left: 12px;
    right: 12px;
    bottom: 68px;
    width: auto;
    min-width: 0;
    transform: none;
  }
  .timespace-history-head {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .timespace-history-source-select {
    width: 100%;
  }
  .timespace-history-selects {
    flex: 1 1 100%;
    flex-wrap: wrap;
  }
  .timespace-history-selects .timespace-history-source-select {
    flex: 1 1 120px;
    width: auto;
  }
  .timespace-history-note {
    white-space: normal;
  }
}
.tsp-measure-panel {
  box-sizing: border-box;
  max-width: calc(100vw - 16px);
  overflow-x: hidden !important;
}
.tsp-measure-panel-header {
  cursor: grab;
  touch-action: none;
}
.tsp-measure-panel button,
.tsp-measure-panel input,
.tsp-measure-panel select {
  cursor: pointer;
  touch-action: auto;
}
.tsp-measure-panel .tsp-measure-current-result,
.tsp-measure-panel .tsp-measure-current-value,
.tsp-measure-panel .tsp-measure-record > div:first-child {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.tsp-measure-record {
  flex-wrap: wrap;
  overflow: hidden;
}
.tsp-measure-record-actions {
  flex: 0 0 auto;
  flex-wrap: wrap;
  margin-left: auto;
}
.measure-label {
  width: auto !important;
  height: auto !important;
}
.measure-label > div {
  box-sizing: border-box;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (min-width: 641px) {
  .tsp-app-shell:has(.tsp-map-layer-panel) .timespace-history-timeline {
    left: 12px;
    right: 380px;
    width: auto;
    max-width: 1240px;
    min-width: 0;
    transform: none;
  }
}

@media (max-width: 640px) {
  .tsp-app-shell:has(.tsp-map-layer-panel) .timespace-history-timeline {
    left: 12px;
    right: 12px;
    width: auto;
    max-width: none;
    min-width: 0;
    transform: none;
  }

  .tsp-app-shell:has(.timespace-history-timeline) div:has(> .tsp-map-layer-panel) {
    right: 12px !important;
    bottom: 300px !important;
  }

  .tsp-app-shell:has(.timespace-history-timeline) .tsp-map-layer-panel {
    width: min(288px, calc(100vw - 24px)) !important;
    max-height: calc(100vh - 360px) !important;
  }
}

.tsp-site-header-left {
  flex: 0 0 220px;
  min-width: 180px;
}

.tsp-site-header-title {
  min-width: 0;
  padding-inline: 8px;
}

.tsp-site-header-title h1 {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.timespace-history-ticks button span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (min-width: 768px) {
  .tsp-site-header-title {
    position: absolute !important;
    left: 50%;
    width: min(58vw, 720px);
    transform: translateX(-50%);
    pointer-events: none;
  }
}

.tsp-site-header-actions {
  flex: 0 0 auto;
  min-width: 410px;
}

.tsp-site-header-actions #tsp-user-launcher-slot {
  display: flex;
  min-width: 108px;
  max-width: 160px;
  justify-content: flex-end;
}

.tsp-mobile-data-launcher {
  top: 68px;
  left: 8px;
}

.tsp-mobile-data-drawer {
  width: min(92vw, 420px);
}

.tsp-map-toolbar,
.tsp-map-toolbar-collapsed {
  top: 80px;
  right: 16px;
}

.tsp-map-toolbar {
  max-height: calc(100% - 96px);
  overflow-y: auto;
}

.tsp-map-tool-panel {
  top: 80px;
  left: 16px;
  right: auto;
  width: 320px;
  max-height: calc(100% - 96px);
  overflow-y: auto;
}

.tsp-map-tool-panel-wide {
  width: 384px;
}

.tsp-mobile-footer {
  min-height: 26px;
  height: 26px;
  flex: 0 0 auto;
  padding: 2px 3px !important;
}

.tsp-mobile-footer-row {
  justify-content: space-between;
  gap: 2px;
  overflow: hidden;
  white-space: nowrap;
  line-height: 1;
}

.tsp-mobile-footer-weather,
.tsp-mobile-footer-coordinates {
  flex: 0 0 auto;
  gap: 1px;
  padding: 1px 2px;
  font-size: clamp(6px, 1.8vw, 8px);
}

.tsp-mobile-footer-weather svg {
  width: 8px;
  height: 8px;
}

.tsp-mobile-footer-filing,
.tsp-mobile-footer-separator {
  flex: 0 0 auto;
  font-size: clamp(6px, 1.8vw, 8px);
}

@media (max-width: 1023px) {
  .tsp-site-header-actions {
    flex: 0 1 auto;
    min-width: 0;
  }

  .tsp-site-header-actions #tsp-user-launcher-slot {
    min-width: 0;
    max-width: 150px;
  }

  .tsp-mobile-data-drawer {
    width: min(92vw, 420px) !important;
    max-width: 420px !important;
    background: #020617 !important;
  }

  .tsp-map-toolbar,
  .tsp-map-toolbar-collapsed {
    top: 64px;
    right: 8px;
  }

  .tsp-map-toolbar {
    max-height: calc(100% - 72px);
    padding: 4px !important;
    gap: 2px !important;
    background: rgba(2, 6, 23, 0.98) !important;
  }

  .tsp-map-toolbar button {
    width: 36px !important;
    height: 36px !important;
    min-height: 36px;
  }

  .tsp-map-tool-panel,
  .tsp-map-tool-panel-wide {
    top: 56px;
    left: 8px;
    right: 58px;
    width: auto;
    max-height: calc(100% - 66px);
    padding: 12px !important;
    background: rgba(2, 6, 23, 0.98) !important;
  }
}

@media (max-width: 640px) {
  .tsp-site-header-title {
    padding-inline: 4px;
  }

  .tsp-site-header-actions #tsp-user-launcher-slot {
    max-width: 128px;
  }
}

@media (max-width: 1023px) and (orientation: landscape) {
  .tsp-mobile-data-launcher {
    top: 58px;
  }
}
