:root {
  --bg: #f5f5f7;
  --card: #ffffff;
  --text: #313942;
  --muted: #7a8693;
  --line: #e6e8eb;
  --accent: #4c8bf7;
  --accent-soft: #eaf2ff;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 8px 24px rgba(16, 24, 40, 0.04);
  --radius: 12px;
  font-family: "PT Sans", "Segoe UI", Tahoma, sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}
.kb-app {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 20px 48px;
}
.kb-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-end;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.kb-eyebrow {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
}
.kb-tabs {
  display: flex;
  gap: 8px;
  background: #eceff3;
  padding: 4px;
  border-radius: 10px;
}
.kb-tab {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
}
.kb-tab.is-active {
  background: #fff;
  color: var(--text);
  box-shadow: var(--shadow);
}
.kb-lead {
  color: var(--muted);
  margin: 0 0 16px;
}
.kb-panel { display: none; }
.kb-panel.is-active { display: block; }
.kb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 14px;
}
.kb-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}
.kb-card h3 {
  margin: 0 0 8px;
  font-size: 18px;
}
.kb-card p {
  margin: 0 0 12px;
  color: var(--muted);
  line-height: 1.45;
  min-height: 44px;
}
.kb-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}
.kb-tag {
  background: var(--accent-soft);
  color: #2f6fd6;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 12px;
}
.kb-card audio {
  width: 100%;
  margin-top: 4px;
}
.sheet-block {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 14px;
  overflow: auto;
}
.sheet-block h3 { margin: 0 0 12px; }
table.kb-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
table.kb-table th,
table.kb-table td {
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}
table.kb-table th {
  background: #f8fafc;
  color: var(--muted);
  font-weight: 600;
}
.kb-error {
  color: #b42318;
  background: #fff1f0;
  border: 1px solid #ffd1ce;
  border-radius: 8px;
  padding: 10px 12px;
}

/* Map tab */
.kb-app.is-map {
  max-width: 1400px;
}
.map-layout {
  display: grid;
  grid-template-columns: 280px 1fr 340px;
  gap: 14px;
  min-height: 620px;
}
@media (max-width: 1100px) {
  .map-layout {
    grid-template-columns: 1fr;
  }
}
.map-sidebar,
.map-details-pane {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px;
  overflow: auto;
  max-height: 70vh;
}
#map-search {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
  margin-bottom: 10px;
}
.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 12px;
  color: var(--muted);
}
.map-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.map-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex: 0 0 auto;
}
.map-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.map-list-item {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  text-align: left;
  border: 1px solid transparent;
  background: #f8fafc;
  border-radius: 8px;
  padding: 8px;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.map-list-item:hover,
.map-list-item.is-active {
  border-color: #c7d7f5;
  background: var(--accent-soft);
}
.map-list-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.map-list-text strong {
  font-size: 13px;
  line-height: 1.25;
}
.map-list-text small {
  color: var(--muted);
  font-size: 11px;
}
#russia-map {
  height: 70vh;
  min-height: 480px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  background: #e8eef5;
  overflow: hidden;
  position: relative;
}
#russia-map .ol-zoom {
  top: 12px;
  left: 12px;
}
#russia-map .ol-zoomslider {
  top: 80px;
  left: 14px;
  height: 140px;
}
.map-details-empty {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
  padding: 8px;
}
.map-details-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 12px;
}
.map-details-head h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.25;
}
.map-status {
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
  padding: 4px 8px;
  white-space: nowrap;
}
.map-kv {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}
.map-kv div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 6px;
  font-size: 13px;
}
.map-kv span { color: var(--muted); }
.map-kv b { text-align: right; font-weight: 700; }
.map-benefits h4,
.map-siblings h4 {
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.map-benefits p {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-wrap;
}
.map-siblings {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.map-chip {
  border: 1px solid var(--line);
  background: #f8fafc;
  border-radius: 999px;
  padding: 5px 10px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.map-notes {
  margin-top: 14px;
  display: grid;
  gap: 8px;
}
.map-note {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
}
.map-note summary {
  cursor: pointer;
  font-weight: 700;
}
.map-note div {
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text);
  white-space: pre-wrap;
}
