:root {
  --bg: #FAF7F2;
  --white: #FFF;
  --card: #F0EBE3;
  --border: #E8E2DA;
  --text: #2C2418;
  --body: #5A5040;
  --muted: #8A7F70;
  --accent: #C49A5C;
  --accent-bg: #FBF5EB;
  --danger: #C45C5C;
  --ekb: #C49A5C;
  --niz: #7A9AB0;
  --ukt: #9A7AB0;
  --dark: #1A1814;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  height: 100vh;
  overflow: hidden;
}

/* НАВИГАЦИЯ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 12px;
  z-index: 2000;
}

.nav-logo {
  width: 36px;
  height: 36px;
  background: var(--accent);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-weight: 700;
  font-size: 18px;
  font-family: Georgia, serif;
  flex-shrink: 0;
}

.nav-title {
  font-family: Georgia, serif;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
}

.nav-items {
  display: flex;
  gap: 4px;
  margin-left: 30px;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4px 10px;
  cursor: pointer;
  border-radius: 6px;
  color: var(--muted);
  font-size: 10px;
  transition: .15s;
  text-decoration: none;
  white-space: nowrap;
}

.nav-item:hover {
  background: var(--card);
}

.nav-item.active {
  color: var(--accent);
  font-weight: 600;
}

.nav-item.active::after {
  content: '';
  display: block;
  width: 20px;
  height: 2.5px;
  background: var(--accent);
  border-radius: 2px;
  margin-top: 1px;
}

.nav-item svg {
  width: 22px;
  height: 22px;
  margin-bottom: 1px;
}

.nav-counter {
  margin-left: auto;
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}

.nav-counter b {
  font-size: 16px;
  color: var(--accent);
  font-family: Consolas, monospace;
}

/* БУРГЕР-МЕНЮ (мобильная версия) */
.burger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.burger svg {
  width: 28px;
  height: 28px;
  color: var(--text);
}

.mobile-menu {
  display: none;
  position: fixed;
  top: 56px;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--white);
  z-index: 1999;
  flex-direction: column;
  padding: 20px;
  gap: 8px;
  overflow-y: auto;
}

.mobile-menu.show {
  display: flex;
}

.mobile-menu .nav-item {
  flex-direction: row;
  gap: 10px;
  padding: 12px;
  font-size: 14px;
  justify-content: flex-start;
}

.mobile-menu .nav-item svg {
  width: 24px;
  height: 24px;
  margin-bottom: 0;
}

/* СТРАНИЦЫ */
.page {
  display: none;
  position: absolute;
  top: 56px;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
}

.page.active {
  display: flex;
}

.page-scroll {
  display: block;
  overflow-y: auto;
  height: 100%;
  width: 100%;
  padding: 40px 140px 60px;
  background: var(--bg);
}

/* СТРАНИЦА КАРТЫ */
.map-page {
  display: flex;
}

.map-page .sidebar {
  width: 340px;
  background: var(--white);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  flex-shrink: 0;
}

.map-page .sidebar::-webkit-scrollbar {
  width: 5px;
}

.map-page .sidebar::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.map-page .map-area {
  flex: 1;
  position: relative;
}

#map {
  width: 100%;
  height: 100%;
  background: var(--bg);
}

.leaflet-container {
  font-family: inherit !important;
}

.leaflet-attribution-flag {
  display: none !important;
}

/* Кнопка сайдбара (мобильная версия) */
.sidebar-toggle {
  display: none;
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 1001;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .1);
}

/* Компоненты сайдбара */
.search-box {
  padding: 8px 12px;
  position: relative;
}

.search-box input {
  width: 100%;
  padding: 9px 12px 9px 36px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  background: var(--bg);
  outline: none;
  font-family: inherit;
}

.search-box input:focus {
  border-color: var(--accent);
}

.search-svg {
  position: absolute;
  left: 24px;
  top: 50%;
  transform: translateY(-50%);
}

.active-bar {
  padding: 4px 12px 8px;
  display: none;
}

.active-bar.show {
  display: block;
}

.active-bar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.active-bar-label {
  font-size: 9px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 1.5px;
}

.clear-btn {
  font-size: 9px;
  color: var(--danger);
  cursor: pointer;
  background: none;
  border: none;
  font-family: inherit;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.tag {
  font-size: 9px;
  padding: 3px 8px;
  background: var(--card);
  border-radius: 12px;
  color: var(--body);
  cursor: pointer;
}

.filter-section {
  padding: 8px 12px;
  border-top: 1px solid var(--border);
}

.filter-title {
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
}

.filter-count {
  font-size: 9px;
  color: var(--accent);
  background: var(--accent-bg);
  padding: 1px 6px;
  border-radius: 3px;
  font-family: Consolas, monospace;
}

.filter-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  color: var(--body);
  transition: .1s;
}

.filter-option:hover {
  background: var(--card);
}

.filter-option.active {
  background: var(--accent-bg);
  color: var(--text);
}

.filter-option.disabled {
  opacity: .35;
  pointer-events: none;
}

.cb {
  width: 14px;
  height: 14px;
  border: 1.5px solid var(--border);
  border-radius: 3px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  color: var(--white);
}

.filter-option.active .cb {
  background: var(--accent);
  border-color: var(--accent);
}

.filter-swatch {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.18);
  flex-shrink: 0;
}

.fb {
  margin-left: auto;
  font-size: 10px;
  color: var(--muted);
  font-family: Consolas, monospace;
}

.filter-expand {
  font-size: 10px;
  color: var(--accent);
  cursor: pointer;
  padding: 4px 6px;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
}

.selected-section {
  padding: 8px 12px;
  border-top: 1px solid var(--border);
}

.selected-card {
  background: var(--white);
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 12px;
}

.selected-title {
  font-family: Georgia, serif;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 2px;
}

.selected-owner {
  font-size: 12px;
  color: var(--body);
  margin-bottom: 8px;
}

.sf {
  display: flex;
  gap: 6px;
  font-size: 11px;
  margin-bottom: 3px;
}

.sl {
  color: var(--muted);
  min-width: 80px;
}

.sv {
  color: var(--text);
}

.scan-block {
  margin-top: 8px;
  padding: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  display: flex;
  gap: 10px;
  align-items: center;
}

.scan-icon {
  width: 36px;
  height: 36px;
  background: var(--card);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.scan-icon svg {
  width: 20px;
  height: 20px;
}

.scan-text {
  font-size: 10px;
  color: var(--accent);
}

.scan-text a {
  color: var(--accent);
}

.cross-badge {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  background: var(--white);
  border: 1px solid var(--accent);
  border-radius: 20px;
  padding: 5px 16px;
  font-size: 11px;
  color: var(--accent);
  display: none;
  align-items: center;
  gap: 6px;
}

.cross-badge.show {
  display: flex;
}

.cross-dot {
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: .4;
  }
}

.leaflet-control-container {
  z-index: 5 !important;
}

.custom-popup .leaflet-popup-content-wrapper {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, .15);
}

.custom-popup .leaflet-popup-tip {
  background: var(--white);
}

.custom-popup .leaflet-popup-content {
  margin: 0;
  min-width: 240px;
}

.popup-inner {
  padding: 12px;
}

.popup-title {
  font-family: Georgia, serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 6px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.popup-row {
  display: flex;
  gap: 6px;
  font-size: 11px;
  margin-bottom: 3px;
}

.popup-lbl {
  color: var(--muted);
  min-width: 75px;
}

/* Управление наложением плана */
.overlay-control {
  position: absolute;
  bottom: 30px;
  right: 10px;
  z-index: 1000;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .1);
  font-size: 11px;
}

.overlay-control label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  margin-bottom: 4px;
}

.overlay-control input[type=range] {
  width: 80px;
}

/* СТРАНИЦЫ С КОНТЕНТОМ */
.page-title {
  font-family: Georgia, serif;
  font-size: 34px;
  font-weight: 700;
  margin-bottom: 8px;
}

.page-sub {
  font-size: 14px;
  color: var(--body);
  margin-bottom: 24px;
}

.section-title {
  font-family: Georgia, serif;
  font-size: 20px;
  font-weight: 700;
  margin: 32px 0 12px;
}

.accent-bar {
  width: 4px;
  background: var(--accent);
  border-radius: 2px;
  margin-right: 12px;
  flex-shrink: 0;
}

.content-card {
  background: var(--white);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 16px;
}

.hero-dark {
  background: var(--dark);
  color: #E8E0D4;
  padding: 40px 140px;
  margin: -40px -140px 32px;
}

.hero-dark .page-title {
  color: #E8E0D4;
}

.hero-dark .page-sub {
  color: #B8AD9E;
}

.hero-label {
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 4px;
  margin-bottom: 12px;
}

/* Таймлайн */
.timeline {
  position: relative;
  padding-left: 40px;
  margin: 16px 0;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 14px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

.tl-step {
  position: relative;
  margin-bottom: 20px;
  display: flex;
  gap: 12px;
}

.tl-num {
  position: absolute;
  left: -40px;
  width: 28px;
  height: 28px;
  background: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--dark);
  font-size: 11px;
  font-weight: 700;
}

.tl-title {
  font-family: Georgia, serif;
  font-size: 14px;
  font-weight: 700;
}

.tl-desc {
  font-size: 12px;
  color: var(--body);
  margin-top: 2px;
  line-height: 1.6;
}

.tl-gif {
  width: 100%;
  max-width: 600px;
  height: 200px;
  background: var(--card);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--muted);
  margin-top: 8px;
  border: 1px dashed var(--border);
}

/* Глоссарий */
.gl-search {
  width: 100%;
  max-width: 500px;
  padding: 10px 14px 10px 40px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  background: var(--white);
  margin-bottom: 16px;
  font-family: inherit;
  outline: none;
}

.gl-search:focus {
  border-color: var(--accent);
}

.gl-modes {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.gl-mode {
  padding: 8px 20px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--body);
}

.gl-mode.active {
  background: var(--accent);
  color: var(--white);
  border-color: var(--accent);
  font-weight: 600;
}

.gl-letter {
  font-family: Georgia, serif;
  font-size: 26px;
  font-weight: 700;
  color: var(--accent);
  margin: 20px 0 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}

.gl-entry {
  display: flex;
  gap: 12px;
  background: var(--white);
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 8px;
}

.gl-cat {
  width: 52px;
  height: 52px;
  background: var(--accent-bg);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  color: var(--accent);
  flex-shrink: 0;
  text-align: center;
  padding: 4px;
}

.gl-term {
  font-family: Georgia, serif;
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 2px;
}

.gl-desc {
  font-size: 12px;
  color: var(--body);
  line-height: 1.5;
}

.gl-cats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}

.gl-cat-btn {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  text-align: center;
  cursor: pointer;
  transition: .15s;
}

.gl-cat-btn:hover {
  border-color: var(--accent);
  background: var(--accent-bg);
}

.gl-cat-btn.active {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--white);
}

.gl-cat-btn .gl-cat-icon {
  font-size: 20px;
  margin-bottom: 6px;
}

.gl-cat-btn .gl-cat-name {
  font-size: 12px;
  font-weight: 600;
}

/* Инфографика */
.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.info-card {
  background: var(--white);
  border-radius: 10px;
  padding: 24px;
}

.info-card h3 {
  font-family: Georgia, serif;
  font-size: 16px;
  margin-bottom: 16px;
}

.bar-row {
  margin-bottom: 10px;
}

.bar-label {
  font-size: 11px;
  color: var(--body);
  margin-bottom: 3px;
}

.bar-track {
  height: 16px;
  background: var(--card);
  border-radius: 3px;
  position: relative;
}

.bar-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--accent);
}

.bar-val {
  position: absolute;
  right: 6px;
  top: 1px;
  font-size: 10px;
  font-family: Consolas, monospace;
  color: var(--body);
}

.stat-row {
  display: flex;
  justify-content: space-around;
  background: var(--white);
  border-radius: 10px;
  padding: 20px;
  text-align: center;
}

.stat-num {
  font-family: Georgia, serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--accent);
}

.stat-lbl {
  font-size: 11px;
  color: var(--body);
  margin-top: 4px;
}

.fact-box {
  background: var(--accent-bg);
  border-radius: 8px;
  padding: 20px;
}

.fact-num {
  font-family: Georgia, serif;
  font-size: 32px;
  font-weight: 700;
  color: var(--accent);
}

.fact-title {
  font-size: 14px;
  font-weight: 600;
  margin: 8px 0 4px;
}

.fact-desc {
  font-size: 12px;
  color: var(--body);
}

.fact-btn {
  display: inline-block;
  margin-top: 12px;
  padding: 10px 24px;
  background: var(--accent);
  color: var(--dark);
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

/* Датасеты */
.ds-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.ds-card {
  background: var(--white);
  border-radius: 8px;
  padding: 16px;
  display: flex;
  gap: 12px;
  align-items: center;
}

.ds-icon {
  width: 48px;
  height: 48px;
  background: var(--card);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ds-icon svg {
  width: 28px;
  height: 28px;
}

.ds-title {
  font-family: Georgia, serif;
  font-size: 14px;
  font-weight: 700;
}

.ds-meta {
  font-size: 11px;
  color: var(--body);
  margin-top: 2px;
}

.ds-btn {
  margin-left: auto;
  padding: 8px 16px;
  background: var(--accent);
  color: var(--dark);
  border: none;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
}

.ds-btn:hover {
  opacity: .85;
}

.ds-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.ds-table th {
  text-align: left;
  padding: 8px;
  background: var(--card);
  position: sticky;
  top: 0;
  z-index: 1;
  font-size: 10px;
  font-weight: 700;
  color: var(--body);
}

.ds-table td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
}

/* Команда */
.team-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.team-card {
  background: var(--white);
  border-radius: 8px;
  padding: 16px;
  text-align: center;
}

.team-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--card);
  margin: 0 auto 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.team-avatar svg {
  width: 28px;
  height: 28px;
  color: var(--muted);
}

.team-name {
  font-family: Georgia, serif;
  font-size: 14px;
  font-weight: 700;
}

.team-role {
  font-size: 11px;
  color: var(--accent);
  margin-top: 2px;
}

.team-info {
  font-size: 10px;
  color: var(--muted);
  margin-top: 4px;
}

.partner-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 60px;
}

.partner-card {
  background: var(--white);
  border-radius: 8px;
  padding: 16px;
  display: flex;
  gap: 12px;
  align-items: center;
}

.partner-logo {
  width: 56px;
  height: 56px;
  background: var(--card);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  color: var(--muted);
  flex-shrink: 0;
}

.partner-name {
  font-family: Georgia, serif;
  font-size: 14px;
  font-weight: 700;
}

.footer {
  background: var(--dark);
  padding: 20px 140px;
  color: var(--muted);
  font-size: 11px;
  display: flex;
  justify-content: space-between;
  margin: 40px -140px 0;
}

.footer a {
  color: var(--accent);
  text-decoration: none;
}

blockquote {
  background: var(--card);
  border-left: 4px solid var(--accent);
  padding: 16px 20px;
  border-radius: 0 6px 6px 0;
  margin: 16px 0;
  font-family: Georgia, serif;
  font-style: italic;
  color: var(--body);
  font-size: 14px;
}

/* Стили лонгрида */
.lr-section {
  margin-bottom: 32px;
}

.lr-text {
  font-size: 14px;
  color: var(--body);
  line-height: 1.8;
  margin-bottom: 16px;
}

.lr-img-placeholder {
  width: 100%;
  height: 300px;
  background: var(--card);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--muted);
  border: 1px dashed var(--border);
  margin: 16px 0;
}

.lr-caption {
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  margin-top: 4px;
  font-style: italic;
}

.lr-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin: 16px 0;
}

.lr-highlight {
  background: var(--accent-bg);
  border-radius: 10px;
  padding: 20px;
  margin: 16px 0;
}

.lr-highlight-num {
  font-family: Georgia, serif;
  font-size: 36px;
  font-weight: 700;
  color: var(--accent);
}

.lr-highlight-text {
  font-size: 13px;
  color: var(--body);
  margin-top: 4px;
}

/* Кнопка очистки поиска */
.search-clear {
  position: absolute;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 16px;
  color: var(--muted);
  cursor: pointer;
  display: none;
  padding: 2px 4px;
}

.search-clear.show {
  display: block;
}

.search-clear:hover {
  color: var(--danger);
}

/* Выпадающий список результатов поиска */
.search-results {
  display: none;
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 8px 8px;
  background: var(--white);
  margin: -2px 12px 8px;
}

.search-results.show {
  display: block;
}

.search-result {
  padding: 6px 12px;
  font-size: 12px;
  color: var(--body);
  cursor: pointer;
  border-bottom: 1px solid var(--border);
}

.search-result:hover {
  background: var(--accent-bg);
  color: var(--accent);
}

.search-result:last-child {
  border-bottom: none;
}

.search-result b {
  color: var(--accent);
}

.search-back {
  padding: 6px 12px;
  font-size: 10px;
  color: var(--accent);
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
}

.search-back:hover {
  background: var(--accent-bg);
}

/* Приветственная панель */
.welcome-panel {
  padding: 12px;
  background: var(--accent-bg);
  border-bottom: 1px solid var(--border);
}

.welcome-title {
  font-family: Georgia, serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 4px;
}

.welcome-text {
  font-size: 11px;
  color: var(--body);
  line-height: 1.5;
}

.welcome-close {
  float: right;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
}

/* Алфавитная навигация глоссария */
.gl-alpha {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 16px;
}

.gl-alpha-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: Georgia, serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  cursor: pointer;
  background: var(--white);
  transition: .15s;
}

.gl-alpha-btn:hover {
  background: var(--accent);
  color: var(--white);
}

/* Фильтр и вкладки онлайн-таблицы */
.ds-filter-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.ds-filter {
  flex: 1;
  min-width: 200px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  background: var(--bg);
  outline: none;
  font-family: inherit;
}

.ds-filter:focus {
  border-color: var(--accent);
}

.ds-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
}

.ds-tab {
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 11px;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--body);
  font-family: inherit;
}

.ds-tab.active {
  background: var(--accent);
  color: var(--white);
  border-color: var(--accent);
  font-weight: 600;
}

/* Предупреждение о повороте экрана */
.landscape-hint {
  display: none;
  position: fixed;
  top: 56px;
  left: 0;
  right: 0;
  background: var(--accent-bg);
  border-bottom: 1px solid var(--accent);
  padding: 8px 16px;
  font-size: 11px;
  color: var(--accent);
  text-align: center;
  z-index: 1998;
}

@media (max-width:768px) {
  .landscape-hint.show {
    display: block;
  }
}

/* Ручка шторки сайдбара (мобильная) */
.sidebar-handle {
  display: none;
  justify-content: center;
  padding: 10px 0 6px;
  cursor: pointer;
  background: var(--white);
  border-radius: 16px 16px 0 0;
  position: sticky;
  top: 0;
  z-index: 2;
}

.sidebar-handle-bar {
  width: 36px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
}

.sidebar-handle-label {
  font-size: 10px;
  color: var(--muted);
  margin-top: 4px;
}

/* ===== АДАПТИВНОСТЬ ===== */
@media (max-width:1024px) {
  .page-scroll {
    padding: 24px 40px 40px;
  }

  .hero-dark {
    padding: 24px 40px;
    margin: -24px -40px 24px;
  }

  .footer {
    padding: 20px 40px;
    margin: -40px -40px 0;
  }

  .info-grid {
    grid-template-columns: 1fr;
  }

  .ds-grid {
    grid-template-columns: 1fr;
  }

  .team-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .partner-grid {
    grid-template-columns: 1fr;
  }

  .lr-columns {
    grid-template-columns: 1fr;
  }
}

@media (max-width:768px) {

  /* Навигация: компактная полоска иконок вместо бургера */
  .nav-items {
    display: flex !important;
    margin-left: 8px;
    gap: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .nav-items::-webkit-scrollbar {
    display: none;
  }

  .nav-item {
    padding: 2px 8px;
    font-size: 8px;
    min-width: auto;
    flex-shrink: 0;
  }

  .nav-item svg {
    width: 18px;
    height: 18px;
  }

  .nav-counter {
    display: none !important;
  }

  .nav-title {
    display: none;
  }

  .burger {
    display: none !important;
  }

  .mobile-menu {
    display: none !important;
  }

  .page-scroll {
    padding: 16px 16px 32px;
  }

  .hero-dark {
    padding: 20px 16px;
    margin: -16px -16px 20px;
  }

  .footer {
    padding: 16px;
    margin: 40px -16px 0;
    flex-direction: column;
    gap: 8px;
  }

  /* Сайдбар: выезжает снизу как шторка */
  .map-page .sidebar {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    width: 100%;
    height: 55vh;
    z-index: 1100;
    transform: translateY(calc(100% - 44px));
    transition: transform .3s ease;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, .15);
    overflow: hidden;
  }

  .map-page .sidebar.show {
    transform: translateY(0);
  }

  .sidebar-toggle {
    display: none !important;
  }

  /* Ручка шторки */
  .sidebar-handle {
    display: flex !important;
  }

  .page-title {
    font-size: 24px;
  }

  .section-title {
    font-size: 17px;
  }

  .team-grid {
    grid-template-columns: 1fr;
  }

  .ds-grid {
    grid-template-columns: 1fr;
  }

  .info-grid {
    grid-template-columns: 1fr;
  }

  .lr-columns {
    grid-template-columns: 1fr;
  }

  .overlay-control {
    bottom: 60px;
    right: 10px;
    font-size: 10px;
    padding: 6px;
  }
}

/* Тёмная тема */
body.dark-theme {
  --bg: #1a1a1a;
  --white: #2d2d2d;
  --card: #3d3d3d;
  --border: #4a4a4a;
  --text: #e0e0e0;
  --body: #b0b0b0;
  --muted: #888888;
  --accent: #C49A5C;
  --accent-bg: #3a2e1f;
  --dark: #0d0d0d;
}

body.dark-theme .nav,
body.dark-theme .sidebar,
body.dark-theme .search-box input,
body.dark-theme .gl-entry,
body.dark-theme .content-card,
body.dark-theme .info-card,
body.dark-theme .ds-card,
body.dark-theme .team-card,
body.dark-theme .partner-card,
body.dark-theme .selected-card,
body.dark-theme .filter-option,
body.dark-theme .gl-cat-btn,
body.dark-theme .gl-mode {
  background: var(--white);
}

/* Активные кнопки глоссария: правило выше по специфичности перетирало
   золотой фон на тёмный, текст сливался. Возвращаем заливку акцентом. */
body.dark-theme .gl-mode.active,
body.dark-theme .gl-cat-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #1a1a1a;
}
body.dark-theme .gl-cat-btn.active .gl-cat-name,
body.dark-theme .gl-cat-btn.active .gl-cat-icon {
  color: #1a1a1a;
}

body.dark-theme .leaflet-popup-content-wrapper {
  background: var(--white);
  color: var(--text);
}

body.dark-theme .welcome-panel {
  background: var(--accent-bg);
}

/* Переключатель темы */
.theme-toggle {
  transition: all 0.2s ease;
}

.theme-toggle:hover {
  background: var(--border);
}


/* Плавающая кнопка переключения темы */
.theme-toggle.floating {
  position: fixed;
  top: 70px;
  right: 20px;
  z-index: 2001;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--white);
  border: 1.5px solid var(--border);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  transition: all 0.25s ease;
  backdrop-filter: blur(4px);
  background: rgba(255, 255, 255, 0.85);
}

body.dark-theme .theme-toggle.floating {
  background: rgba(45, 45, 45, 0.85);
  border-color: var(--border);
}

.theme-toggle.floating:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.95);
}

body.dark-theme .theme-toggle.floating:hover {
  background: rgba(45, 45, 45, 0.95);
}

/* Иконки не меняют цвет при наведении */
.theme-toggle.floating:hover .theme-icon-light,
.theme-toggle.floating:hover .theme-icon-dark {
  stroke: var(--text);
}

.theme-toggle.floating .theme-icon-light,
.theme-toggle.floating .theme-icon-dark {
  width: 20px;
  height: 20px;
  transition: transform 0.4s cubic-bezier(0.2, 0.9, 0.4, 1.1);
  flex-shrink: 0;
}


.theme-toggle.floating:hover .theme-icon-light {
  transform: rotate(25deg);
}


.theme-toggle.floating:hover .theme-icon-dark {
  transform: rotate(35deg);
}

/* Анимация появления кнопки при загрузке */
.theme-toggle.floating {
  animation: floatIn 0.4s ease-out;
}

@keyframes floatIn {
  from {
    opacity: 0;
    transform: translateY(-10px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Для мобильных устройств */
@media (max-width: 768px) {
  .theme-toggle.floating {
    top: auto;
    bottom: 20px;
    right: 16px;
    width: 40px;
    height: 40px;
  }
  
  .theme-toggle.floating .theme-icon-light,
  .theme-toggle.floating .theme-icon-dark {
    width: 18px;
    height: 18px;
  }
}

/* Тёмная тема для карты */
body.dark-theme .leaflet-tile-pane {
  filter: brightness(0.7) contrast(1.2);
}

body.dark-theme .leaflet-popup-content-wrapper {
  background: var(--white);
  color: var(--text);
}

body.dark-theme .leaflet-popup-tip {
  background: var(--white);
}

/* Glossary button color states from Volya */
.gl-mode {
  background-color: transparent !important;
  color: #C49A5C !important;
  border: 1px solid #E8E2DA !important;
}

.gl-mode.active {
  background-color: #FFFFFF !important;
  color: #C49A5C !important;
  border-color: #C49A5C !important;
}

.gl-mode:hover,
.gl-mode.active:hover {
  background-color: #FBF5EB !important;
  color: #C49A5C !important;
  border-color: #C49A5C !important;
}

body.dark-theme .gl-mode {
  background-color: transparent !important;
  color: #C49A5C !important;
  border: 1px solid #4a4a4a !important;
}

body.dark-theme .gl-mode.active,
body.dark-theme .gl-mode.active:hover {
  background-color: #2d2d2d !important;
  color: #C49A5C !important;
  border-color: #C49A5C !important;
}

body.dark-theme .gl-mode:hover {
  background-color: #3a2e1f !important;
  color: #C49A5C !important;
  border-color: #C49A5C !important;
}


