#topbar {
  z-index: 1200;
  display: grid;
  grid-template-columns: auto minmax(260px, 680px) auto;
  align-items: center;
  gap: 18px;
  min-height: 66px;
  padding: calc(10px + env(safe-area-inset-top)) 18px 10px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(120deg, var(--header-from), var(--header-to));
  color: var(--ink);
  box-shadow: 0 2px 14px rgb(23 37 58 / 6%);
}

.brand-block { min-width: 205px; }
#brand {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  font-size: 17px;
  font-weight: 760;
  line-height: 1.1;
  white-space: nowrap;
}
#brand img { flex: none; }
.brand-caption {
  display: block;
  margin: 4px 0 0 37px;
  color: var(--muted);
  font-size: 10.5px;
  letter-spacing: .025em;
}

#searchbox { position: relative; min-width: 0; }
#search-form {
  display: flex;
  min-height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface);
  transition: border-color .2s, box-shadow .2s;
}
#search-form:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgb(33 102 209 / 12%);
}
#search {
  min-width: 0;
  flex: 1;
  padding: 9px 12px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}
#search::placeholder { color: var(--muted); }
#search-submit {
  min-width: 76px;
  border: 0;
  border-radius: 0 11px 11px 0;
  background: var(--accent-bg);
  color: var(--accent-ink);
  cursor: pointer;
  font-weight: 680;
}
#search-submit:hover { background: var(--accent-bg-hover); }
.search-submit-icon { display: none; }
#search-results {
  position: absolute;
  z-index: 1300;
  top: 49px;
  right: 0;
  left: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-lg);
}
#search-results button {
  display: block;
  width: 100%;
  padding: 11px 13px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  color: inherit;
  cursor: pointer;
  text-align: left;
}
#search-results button:last-child { border-bottom: 0; }
#search-results button:hover { background: var(--tint); }

#topbtns { display: flex; gap: 8px; }
#topbtns button {
  min-height: 42px;
  padding: 8px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: var(--surface);
  color: var(--ink-soft);
  cursor: pointer;
  font-weight: 650;
  white-space: nowrap;
}
#topbtns button:hover { border-color: var(--brand); background: var(--tint); color: var(--brand-hover); }
#topbtns #btn-locate { background: var(--accent-bg); border-color: transparent; color: var(--accent-ink); }
#topbtns #btn-locate:hover { background: var(--accent-bg-hover); color: var(--accent-ink); }

#wrap { position: relative; display: flex; flex: 1; min-height: 0; overflow: hidden; }
#map { z-index: 0; flex: 1; min-width: 0; background: var(--map-bg); }
#map .leaflet-control-layers-toggle {
  background-image: url("../icon-layers.svg") !important;
  background-size: 25px 25px;
}

#sidebar-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-md);
  cursor: pointer;
}
#mobile-actions { display: none; }
#sidebar-toggle svg,
#mobile-map svg,
#mobile-locate svg,
#mobile-rules svg,
#search-submit svg,
#sidebar-close svg,
#mobile-result-close svg,
#modal-close svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 2;
}
#sidebar-backdrop {
  position: absolute;
  z-index: 1200;
  inset: 0;
  background: rgb(7 20 33 / 48%);
  backdrop-filter: blur(2px);
}
#sidebar-backdrop[hidden] { display: none; }

#map-hint {
  position: absolute;
  z-index: 1000;
  top: 14px;
  left: 50%;
  max-width: calc(100% - 80px);
  padding: 9px 14px;
  transform: translateX(-50%);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgb(255 255 255 / 94%);
  color: var(--ink-soft);
  box-shadow: var(--shadow-sm);
  font-size: 12.5px;
  font-weight: 650;
  pointer-events: none;
  white-space: nowrap;
}

#map .metro-tooltip {
  padding: 5px 8px;
  border: 1px solid rgb(20 71 126 / 28%);
  border-radius: 7px;
  box-shadow: 0 4px 12px rgb(20 40 70 / 18%);
  color: var(--ink);
  font-size: 12px;
  font-weight: 750;
}
