:root {
  --bs-font-sans-serif: "Montserrat", system-ui, sans-serif;
  --app-border: rgba(255, 255, 255, .1);
  --app-panel: rgba(24, 28, 33, .94);
  --app-control-height: 44px;
  --app-action-width: 5.75rem;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 85% 0%, rgba(13, 110, 253, .16), transparent 32rem),
    #0b0d10;
}

.navbar {
  min-height: 64px;
  border-bottom: 1px solid var(--app-border);
  background: rgba(11, 13, 16, .86);
  backdrop-filter: blur(16px);
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: .65rem;
  background: linear-gradient(135deg, var(--bs-primary), #59d4ff);
  color: #07111f;
  font-weight: 800;
  letter-spacing: -.08em;
}

.tracking-wide { letter-spacing: .13em; }
.caption-xs { font-size: .6rem; }
.caption-sm { font-size: .7rem; }

.control-panel,
.viewer-card {
  border: 1px solid var(--app-border);
  background: var(--app-panel);
  box-shadow: 0 1.5rem 4rem rgba(0, 0, 0, .22);
}

.section-label {
  color: var(--bs-secondary-color);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.place-search-results {
  display: none;
  position: absolute;
  top: calc(100% + .4rem);
  right: 0;
  left: 0;
  z-index: 1100;
  max-height: 18rem;
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: .65rem;
  background: #15191e;
  box-shadow: 0 1rem 2.5rem rgba(0, 0, 0, .45);
}

.place-search-results.open { display: block; }

.place-search-result,
.place-search-empty {
  padding: .7rem .85rem;
  color: var(--bs-body-color);
  font-size: .75rem;
  line-height: 1.4;
}

.place-search-result {
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.place-search-result:last-child { border-bottom: 0; }

.place-search-result:hover,
.place-search-result:focus {
  outline: 0;
  background: rgba(13, 110, 253, .18);
}

.place-search-empty { color: var(--bs-secondary-color); }

.form-control,
.form-select,
.input-group-text {
  height: var(--app-control-height);
  min-height: var(--app-control-height);
  border-color: rgba(255, 255, 255, .13);
  background-color: rgba(0, 0, 0, .2);
}

.btn {
  height: var(--app-control-height);
  min-height: var(--app-control-height);
  padding-top: 0;
  padding-bottom: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.input-group-action {
  flex: 0 0 var(--app-action-width);
  width: var(--app-action-width);
  padding-right: .75rem !important;
  padding-left: .75rem !important;
}

.form-control:focus,
.form-select:focus {
  border-color: rgba(110, 168, 254, .85);
  box-shadow: 0 0 0 .2rem rgba(13, 110, 253, .18);
}

.form-select {
  color: #f8f9fa;
  color-scheme: dark;
  background-color: #15191e;
}

.form-select option {
  color: #f8f9fa;
  background-color: #15191e;
}

.form-select option:checked {
  color: #fff;
  background-color: #0d6efd;
}

.model-note {
  min-height: 38px;
  color: var(--bs-secondary-color);
  font-size: .75rem;
  line-height: 1.45;
}

.coordinate-label {
  display: block;
  margin: 0 0 .3rem .15rem;
  color: var(--bs-secondary-color);
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.coordinate-input {
  min-width: 0;
  padding-inline: .6rem;
  font-size: .78rem;
  font-variant-numeric: tabular-nums;
}

.file-input {
  height: var(--app-control-height);
  min-height: var(--app-control-height);
  padding: 0 .75rem 0 0;
  line-height: calc(var(--app-control-height) - 2px);
  overflow: hidden;
}

.file-input::file-selector-button {
  height: calc(var(--app-control-height) - 2px);
  margin: 0 .75rem 0 0;
  padding: 0 .9rem;
  border: 0;
  border-right: 1px solid rgba(255, 255, 255, .13);
  line-height: calc(var(--app-control-height) - 2px);
}

.viewer-card {
  min-height: calc(100vh - 104px);
  overflow: hidden;
}

.viewer-toolbar {
  min-height: 54px;
  border-bottom: 1px solid var(--app-border);
}

.canvas-stage {
  position: relative;
  isolation: isolate;
  min-height: calc(100vh - 160px);
  display: grid;
  place-items: center;
  overflow: auto;
  padding: 0;
  background-color: #090b0d;
  background-image:
    linear-gradient(45deg, #101419 25%, transparent 25%),
    linear-gradient(-45deg, #101419 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #101419 75%),
    linear-gradient(-45deg, transparent 75%, #101419 75%);
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  background-size: 16px 16px;
}

.canvas-stage.image-mode { padding: 1.25rem; }

#ontarioMap {
  position: relative;
  z-index: 1;
  width: 100%;
  height: calc(100vh - 160px);
  min-height: 540px;
  background: #090b0d;
}

#placeLabelsMap {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: transparent;
}

#placeLabelsMap .maplibregl-canvas,
#placeLabelsMap .maplibregl-canvas-container {
  background: transparent;
}

.leaflet-container {
  font-family: "Montserrat", system-ui, sans-serif;
}

.imagery-info {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 3;
  max-width: calc(100% - 24px);
  color: #fff;
  text-shadow:
    0 1px 2px rgba(0, 0, 0, .85),
    0 0 4px rgba(0, 0, 0, .55);
  pointer-events: none;
}

.imagery-name {
  display: block;
  font-size: .7rem;
  line-height: 1.35;
  font-weight: 400;
  overflow-wrap: anywhere;
}

.imagery-info.muted { opacity: .72; }

canvas {
  max-width: 100%;
  height: auto;
  border-radius: .5rem;
  background: #0c0f12;
  box-shadow: 0 1rem 3rem rgba(0, 0, 0, .4);
}

#status {
  min-height: 68px;
  margin-bottom: 0;
  white-space: pre-line;
  font-size: .78rem;
  line-height: 1.5;
}

#download { display: none; }

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--bs-success);
  box-shadow: 0 0 0 .25rem rgba(25, 135, 84, .13);
}

@media (min-width: 1200px) {
  .control-panel {
    position: sticky;
    top: 84px;
    min-height: calc(100vh - 104px);
  }

  .control-panel .card-body {
    display: flex;
    flex-direction: column;
  }

  .location-search-section {
    margin-bottom: auto;
    padding-bottom: 1.5rem;
  }
}

@media (max-width: 1199.98px) {
  .location-search-section { margin-bottom: 1.5rem; }
  .viewer-card { min-height: 65vh; }
  .canvas-stage { min-height: 58vh; }
  #ontarioMap {
    height: 58vh;
    min-height: 420px;
  }
}
