:root {
  color-scheme: dark;

  --bg: #111111;
  --panel: rgba(25, 25, 25, 0.97);
  --surface: #202020;
  --surface-hover: #2b2b2b;
  --border: #353535;

  --text: #f1f1f1;
  --muted: #999999;

  --accent: #2785df;
  --accent-hover: #3899f5;

  --danger: #a63b36;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
}

body {
  width: 100%;
  height: 100%;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  overflow: hidden;

  background: var(--bg);
  font-family: Inter, Arial, sans-serif;
  color: var(--text);
}

h2 {
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 12px;
  letter-spacing: 0.2px;
}

label,
p {
  color: var(--text);
}

#map {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.destMarker {
  filter: hue-rotate(120deg);
}


#controls {
  position: fixed;
  z-index: 1000;

  right: 24px;
  bottom: 24px;

  width: 560px;
  max-width: calc(100vw - 48px);

  height: calc(100vh - 48px);
  max-height: calc(100vh - 48px);

  padding: 24px;
  box-sizing: border-box;

  display: flex;
  flex-direction: column;
  gap: 20px;

  background: var(--panel);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 16px;

  box-shadow: 0 12px 45px rgba(0,0,0,0.45);
  backdrop-filter: blur(14px);

  overflow: hidden;
}

#inputAreas {
  flex-shrink: 0;

  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  align-items: start;
}

.input-group {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.input-container {
  position: relative;
  width: 100%;
  margin: 4px 0 12px;
}

.input-field {
  display: block;
  width: 100%;
  padding: 11px 2px;

  color: var(--text);
  background: transparent;

  border: none;
  border-bottom: 1px solid #484848;
  border-radius: 0;

  outline: none;
  font-size: 14px;

  transition: border-color 0.2s ease;
}

.input-field:focus {
  border-bottom: 2px solid var(--accent);
}

.input-field::placeholder {
  color: #777;
}

.results-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;

  width: 100%;
  max-height: 220px;

  z-index: 2000;

  display: none;
  flex-direction: column;
  gap: 4px;

  padding: 6px;

  background: #202020;
  border: 1px solid #3d3d3d;
  border-radius: 10px;

  box-shadow: 0 10px 30px rgba(0,0,0,0.55);

  overflow-y: auto;
  overflow-x: hidden;

  scrollbar-width: thin;
  scrollbar-color: #555 #202020;
}

.results-dropdown.visible {
  display: flex;
}

.results-dropdown::-webkit-scrollbar {
  width: 7px;
  background: #202020;
}

.results-dropdown::-webkit-scrollbar-track {
  background: #202020;
  border-radius: 10px;
}

.results-dropdown::-webkit-scrollbar-thumb {
  background: #505050;
  border-radius: 10px;
  border: 1px solid #202020;
}

.results-dropdown::-webkit-scrollbar-thumb:hover {
  background: #707070;
}

.result {
  display: block;
  flex-shrink: 0;

  width: 100%;
  padding: 10px 11px;

  color: #e5e5e5;
  background: #292929;

  border: none;
  border-radius: 7px;

  font-size: 13px;
  text-align: left;

  cursor: pointer;
  transition: background 0.15s ease;
}

.result:hover {
  background: #383838;
}

.result.history-result {
  background: #263747;
}

.result.history-result:hover {
  background: #304b63;
}

#controls > .row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

#actions {
  flex-shrink: 0;

  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;

  padding-top: 14px;
  border-top: 1px solid #353535;
}

#actions .btn-blue {
  flex: 1;
}

#actions .btn-red {
  flex: 0 0 auto;
}

.btn {
  padding: 12px 18px;

  border: none;
  border-radius: 9px;

  color: white;
  font-size: 13px;
  font-weight: 600;

  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
}

.btn-blue {
  flex: 1;
  background: var(--accent);
}

.btn-blue:hover {
  background: var(--accent-hover);
}

.btn-red {
  flex: 0 0 auto;

  padding: 9px 12px;

  color: #999;
  background: transparent;
  border: 1px solid #404040;
  font-size: 12px;
}

.btn-red:hover {
  color: #fff;
  background: #382322;
  border-color: #75413d;
}

.btn:active {
  transform: translateY(1px);
}

#overview {
  flex: 1;
  min-height: 0;
  width: 100%;

  display: flex;
  flex-direction: column;
  gap: 10px;

  padding: 12px;

  background: #181818;
  border: 1px solid #353535;
  border-radius: 11px;

  overflow-y: auto;
  overflow-x: hidden;

  scrollbar-width: thin;
  scrollbar-color: #505050 #181818;
}

#overview::-webkit-scrollbar {
  width: 6px;
}

#overview::-webkit-scrollbar-thumb {
  background: #505050;
  border-radius: 6px;
}

#overview .consultant-entry {
  flex-shrink: 0;
}

#overview .consultant-entry:hover {
  border-color: #505050;
}

#overview .result {
  padding: 0;

  color: #e5e5e5;
  background: transparent;

  font-size: 13px;
  line-height: 1.5;
}

#overview .result:hover {
  color: #ff9999;
  background: transparent;
}

#overview .consultant-settings {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 25px;
  flex-wrap: wrap;
}

#overview .setting-item {
  display: flex;
  align-items: center;
  gap: 9px;
}

#overview .setting-item label {
  color: #aaa;
  font-size: 12px;
  white-space: nowrap;
}

input,
button {
  font-family: inherit;
}

input[type="checkbox"] {
  width: 15px;
  height: 15px;
  margin: 0;

  accent-color: var(--accent);
  cursor: pointer;
}

#overview input[type="number"] {
  width: 65px;
  height: 30px;
  padding: 5px 8px;

  color: white;
  background: #171717;

  border: 1px solid #404040;
  border-radius: 6px;

  outline: none;
  font-size: 13px;

  transition: border-color 0.2s ease;
}

#overview input[type="number"]:focus {
  border-color: var(--accent);
}

input[type="range"] {
  appearance: none;
  -webkit-appearance: none;

  width: 100%;
  background: transparent;
  accent-color: #777;

  cursor: pointer;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  background: #383838;
  border: 1px solid #505050;
  border-radius: 5px;
}

input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;

  width: 16px;
  height: 16px;
  margin-top: -6px;

  background: #777;
  border: 1px solid #999;
  border-radius: 50%;
}

input[type="range"]::-moz-range-track {
  height: 6px;
  background: #383838;
  border: 1px solid #505050;
  border-radius: 5px;
}

input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;

  background: #777;
  border: 1px solid #999;
  border-radius: 50%;
}

* {
  scrollbar-width: thin;
  scrollbar-color: #505050 #202020;
}

*::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

*::-webkit-scrollbar-track {
  background: #202020;
}

*::-webkit-scrollbar-thumb {
  background: #505050;
  border-radius: 8px;
}

*::-webkit-scrollbar-thumb:hover {
  background: #707070;
}

@media (max-width: 700px) {
  #controls {
    right: 12px;
    bottom: 12px;

    width: calc(100vw - 24px);
    max-width: none;

    height: calc(100vh - 24px);
    max-height: calc(100vh - 24px);

    padding: 17px;
    gap: 15px;
  }

  #inputAreas {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}
