#sidebar {
  z-index: 1100;
  display: flex;
  width: 384px;
  max-width: 42vw;
  flex: none;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: var(--surface);
}
.sidebar-head {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 15px 18px 13px;
  border-bottom: 1px solid var(--line);
}
.sidebar-eyebrow {
  color: var(--brand);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.sidebar-title { margin-top: 3px; font-size: 17px; font-weight: 770; line-height: 1.2; }
#sidebar-close { display: none; }
.sidebar-body {
  flex: 1;
  overflow-y: auto;
  padding-bottom: 20px;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.panel-intro {
  display: none;
  gap: 12px;
  margin: 14px 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--tint);
}
#verdict[hidden] + .panel-intro { display: flex; }
.panel-intro svg {
  width: 26px;
  height: 26px;
  flex: none;
  margin-top: 2px;
  fill: none;
  stroke: var(--brand);
  stroke-width: 1.7;
}
.panel-intro-title { font-size: 13.5px; font-weight: 740; }
.panel-intro p { margin-top: 3px; color: var(--muted); font-size: 12.5px; line-height: 1.5; }

.panel-section { padding: 0 18px 4px; border-bottom: 1px solid var(--line); }
.panel-section > summary,
.panel-section > .section-title {
  display: flex;
  min-height: 50px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 -18px;
  padding: 13px 18px;
  font-size: 13.5px;
  font-weight: 720;
}
.panel-section > summary {
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.section-icon { display: none; }
.panel-section > summary::-webkit-details-marker { display: none; }
.panel-section > summary::after {
  width: 8px;
  height: 8px;
  flex: none;
  margin: -4px 3px 0 0;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  content: "";
  transform: rotate(45deg);
  transition: transform .16s ease;
}
.panel-section[open] > summary::after { margin-top: 4px; transform: rotate(225deg); }
.panel-section > summary:hover { background: var(--tint); }
.section-hint { margin: -6px 0 10px; color: var(--muted); font-size: 12px; }

#coordinate-form,
#operation-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
#coordinate-form label,
#operation-form label { color: var(--ink-soft); font-size: 11.5px; font-weight: 650; }
#coordinate-form input,
#operation-form input:not([type="checkbox"]),
#operation-form select {
  width: 100%;
  min-height: 38px;
  margin-top: 4px;
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  font-weight: 400;
}
#coordinate-form input:hover,
#operation-form input:not([type="checkbox"]):hover,
#operation-form select:hover { border-color: var(--line-strong); }
#coordinate-form input { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
#coordinate-form button,
#operation-form button {
  min-height: 40px;
  grid-column: 1 / -1;
  margin-top: 2px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--accent-bg);
  color: var(--accent-ink);
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 680;
}
#coordinate-form button:hover,
#operation-form button:hover { background: var(--accent-bg-hover); }
#coordinates-section { padding-bottom: 14px; }
.coordinate-status { margin-top: 6px; color: var(--warn); font-size: 12px; }
.coordinate-status:empty { display: none; }

#operation-form .operation-check {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  gap: 8px;
  min-height: 24px;
  font-size: 13px;
  color: var(--ink);
  cursor: pointer;
}
#operation-form .operation-check input {
  width: 17px;
  height: 17px;
  accent-color: var(--brand);
  cursor: pointer;
}

.basemap-status { margin: -4px 0 10px; color: var(--muted); font-size: 12px; }
.layer-presets { display: flex; gap: 6px; margin-bottom: 10px; }
.layer-presets button {
  min-height: 32px;
  flex: 1;
  padding: 5px 6px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 12px;
  font-weight: 650;
}
.layer-presets button:hover { border-color: var(--brand); background: var(--tint); color: var(--brand-hover); }
.layer-safety-note {
  margin-bottom: 8px;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  background: var(--tint);
  color: var(--ink-soft);
  font-size: 11.5px;
  line-height: 1.45;
}
.layer-row {
  display: flex;
  min-height: 36px;
  align-items: center;
  gap: 9px;
  margin: 0 -8px;
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  user-select: none;
}
.layer-row:hover { background: var(--tint); }
.layer-row input {
  width: 16px;
  height: 16px;
  flex: none;
  accent-color: var(--brand);
  cursor: pointer;
}
.layer-symbol {
  /* Значение подставляется инлайном из цвета слоя; здесь только запасной вариант. */
  --layer-color: var(--ink-soft);
  /* Ширина по содержимому, а не фиксированная: пятибуквенные коды NOTAM, HERIT
     и DRONE не помещались в 30px и текст вылезал за рамку значка. */
  min-width: 30px;
  min-height: 20px;
  flex: none;
  padding-inline: 3px;
  border: 2px solid var(--layer-color);
  border-radius: 5px;
  background-color: color-mix(in srgb, var(--layer-color) 38%, white);
  color: #fff;
  font-size: 8.5px;
  font-weight: 850;
  line-height: 16px;
  text-align: center;
  text-shadow: 0 1px 2px #000;
}
.layer-symbol.pattern-diagonal {
  background-image: repeating-linear-gradient(135deg, transparent 0 4px, var(--layer-color) 4px 6px);
}
.layer-symbol.pattern-cross {
  background-image:
    repeating-linear-gradient(45deg, transparent 0 5px, var(--layer-color) 5px 6px),
    repeating-linear-gradient(135deg, transparent 0 5px, var(--layer-color) 5px 6px);
}
.layer-symbol.pattern-dots {
  background-image: radial-gradient(var(--layer-color) 1.5px, transparent 1.7px);
  background-size: 6px 6px;
}
.layer-symbol.pattern-grid {
  background-image:
    linear-gradient(var(--layer-color) 1px, transparent 1px),
    linear-gradient(90deg, var(--layer-color) 1px, transparent 1px);
  background-size: 6px 6px;
}
.layer-name { flex: 1; font-size: 13px; }
.layer-count { color: var(--muted); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.layer-hint { margin: -3px 0 6px 55px; color: var(--muted); font-size: 11.5px; }

#sources-section { padding-bottom: 14px; }
.freshness-card dl { display: grid; gap: 12px; }
.freshness-card dt { color: var(--ink-soft); font-size: 12px; font-weight: 720; }
.freshness-card dd {
  position: relative;
  margin-top: 3px;
  padding-left: 15px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}
.freshness-card dd::before {
  position: absolute;
  top: 5px;
  left: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
  content: "";
}
.freshness-card dd[data-state="fresh"]::before { background: var(--marker-ok); }
.freshness-card dd[data-state="partial"]::before { background: var(--marker-part); }
.freshness-card dd[data-state="stale"]::before,
.freshness-card dd[data-state="error"]::before { background: var(--marker-miss); }

.source-notes { border-bottom: 0; }
.source-notes-body { padding-bottom: 12px; color: var(--muted); font-size: 12px; line-height: 1.55; }

.reference-layer-row {
  display: flex;
  min-height: 36px;
  align-items: center;
  gap: 9px;
  margin: 0 -8px;
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  user-select: none;
}
.reference-layer-row:hover { background: var(--tint); }
.reference-layer-row:has(input:disabled) { cursor: progress; opacity: .68; }
.reference-layer-row input {
  width: 16px;
  height: 16px;
  flex: none;
  accent-color: var(--brand);
  cursor: pointer;
}
.metro-symbol {
  /* Цвет используется только для легенды транспорта, а не как UI-токен. */
  width: 26px;
  height: 26px;
  flex: none;
  border: 3px solid #0052a4;
  border-radius: 50%;
  background: var(--surface);
  color: #0052a4;
  font-size: 12px;
  font-weight: 900;
  line-height: 20px;
  text-align: center;
}
.metro-hint { margin-left: 51px; }
