/* ==========================================================================
   БАЗА ЗНАНИЙ «АРХИВЫ ЦИТАДЕЛИ» (RUSTDEEP / ГЛУБИНА)
   Основная таблица стилей интерфейса интерактивной энциклопедии (web/wiki.css)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. ИМПОРТ ШРИФТОВ И ГЛОБАЛЬНЫЕ CSS-ПЕРЕМЕННЫЕ
   -------------------------------------------------------------------------- */
@import url("https://fonts.googleapis.com/css2?family=Inter:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&family=Share+Tech+Mono&display=swap");

:root {
  /* Палитра фона: глубокие индустриальные оттенки подземного мега-комплекса */
  --bg-dark: #0a0d14;
  --bg-body: #07090e;
  --bg-panel: #0f1523;
  --bg-panel-translucent: rgba(15, 21, 35, 0.88);
  --bg-card: #0f1523;
  --bg-card-hover: #141d30;
  --bg-card-active: #19233a;
  --bg-input: #080b12;

  /* Границы и разделители */
  --border: #1e293b;
  --border-color: #1e293b;
  --border-subtle: #162032;
  --border-bright: #334155;
  --border-focus: #f59e0b;

  /* Типографика и цвета текста */
  --text-main: #e2e8f0;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --text-bright: #ffffff;

  /* Акцентная палитра игры RUSTDEEP */
  --amber: #f59e0b;
  --amber-bright: #fbbf24;
  --amber-glow: rgba(245, 158, 11, 0.4);
  --amber-dim: rgba(245, 158, 11, 0.12);

  --green: #10b981;
  --green-bright: #34d399;
  --green-glow: rgba(16, 185, 129, 0.4);
  --green-dim: rgba(16, 185, 129, 0.12);

  --cyan: #06b6d4;
  --cyan-bright: #22d3ee;
  --cyan-glow: rgba(6, 182, 212, 0.4);
  --cyan-dim: rgba(6, 182, 212, 0.12);

  --purple: #a855f7;
  --purple-bright: #c084fc;
  --purple-glow: rgba(168, 85, 247, 0.4);
  --purple-dim: rgba(168, 85, 247, 0.12);

  --red: #ef4444;
  --red-bright: #f87171;
  --red-glow: rgba(239, 68, 68, 0.4);
  --red-dim: rgba(239, 68, 68, 0.12);

  /* Семейства шрифтов */
  --font-mono: "Share Tech Mono", "JetBrains Mono", "Courier New", monospace;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* Геометрия интерфейса */
  --header-height: 64px;
  --sidebar-width: 290px;
  --toc-width: 240px;
  --content-max-width: 900px;
  --radius-sm: 3px;
  --radius-md: 6px;
  --radius-lg: 10px;

  /* Скорость анимаций и переходов */
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --------------------------------------------------------------------------
   2. БАЗОВЫЙ СБРОС И ТИПОГРАФИКА
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  background-color: var(--bg-body);
  color: var(--text-main);
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  font-family: var(--font-sans);
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
}

/* Стилизация полосы прокрутки в индустриальном стиле */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
  background: var(--border-bright);
  border-radius: var(--radius-sm);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--amber);
}

/* Ссылки и кнопки по умолчанию */
a {
  color: var(--cyan);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--cyan-bright);
}

button {
  font-family: var(--font-mono);
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
  transition: all var(--transition-fast);
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   3. CRT-ЭФФЕКТЫ (СКАНИРУЮЩИЕ ЛИНИИ И ВИНЬЕТКА)
   -------------------------------------------------------------------------- */
.crt-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 9999;
  background: linear-gradient(
      rgba(18, 16, 16, 0) 50%,
      rgba(0, 0, 0, 0.22) 50%
    ),
    linear-gradient(
      90deg,
      rgba(255, 0, 0, 0.02),
      rgba(0, 255, 0, 0.01),
      rgba(0, 0, 255, 0.02)
    );
  background-size: 100% 3px, 6px 100%;
}

.crt-vignette {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 9998;
  box-shadow: inset 0 0 130px rgba(0, 0, 0, 0.88);
}

/* --------------------------------------------------------------------------
   4. ВЕРХНЯЯ НАВИГАЦИОННАЯ ПАНЕЛЬ (.wiki-header)
   -------------------------------------------------------------------------- */
.wiki-header {
  position: sticky;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height);
  background: var(--bg-panel-translucent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  z-index: 1000;
  display: flex;
  align-items: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.wiki-header-inner {
  width: 100%;
  max-width: 1720px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

/* Левый брендинг */
.wiki-brand-group {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}

/* Кнопка-гамбургер для мобильных экранов */
.btn-mobile-menu {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: var(--bg-card);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-sm);
  color: var(--amber-bright);
  font-size: 1.25rem;
}

.btn-mobile-menu:hover {
  background: var(--bg-card-hover);
  border-color: var(--amber);
  box-shadow: 0 0 10px var(--amber-glow);
}

.wiki-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.brand-icon {
  font-size: 1.3rem;
  line-height: 1;
}

.brand-title-wrap {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--amber-bright);
  text-shadow: 0 0 12px var(--amber-glow);
  line-height: 1.2;
}

.brand-subtitle {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.brand-badge {
  background: var(--amber-dim);
  color: var(--amber-bright);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--amber);
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* Ссылка возврата на лендинг */
.btn-back-landing {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(15, 21, 35, 0.6);
  transition: all var(--transition-fast);
}

.btn-back-landing:hover {
  color: var(--amber-bright);
  border-color: var(--amber);
  background: var(--amber-dim);
  text-shadow: 0 0 8px var(--amber-glow);
}

/* Центральный блок живого поиска */
.wiki-header-search {
  flex: 1;
  max-width: 520px;
  position: relative;
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.search-icon {
  position: absolute;
  left: 0.9rem;
  color: var(--text-dim);
  font-size: 0.9rem;
  pointer-events: none;
  transition: color var(--transition-fast);
}

.wiki-search-input {
  width: 100%;
  height: 38px;
  padding: 0 5rem 0 2.4rem;
  background: var(--bg-input);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  transition: all var(--transition-fast);
}

.wiki-search-input::placeholder {
  color: var(--text-dim);
  font-family: var(--font-mono);
}

.wiki-search-input:focus {
  border-color: var(--amber);
  background: #0d121c;
  box-shadow: 0 0 14px var(--amber-glow);
  outline: none;
}

.wiki-search-input:focus + .search-icon {
  color: var(--amber-bright);
}

/* Хоткей-бейдж '/' и счетчик результатов в строке поиска */
.search-input-meta {
  position: absolute;
  right: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  pointer-events: none;
}

.search-hotkey-badge {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  background: var(--border-color);
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-bright);
  line-height: 1.2;
}

.search-results-counter {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--amber-bright);
  background: var(--amber-dim);
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--amber);
  display: none;
}

.search-results-counter.visible {
  display: inline-block;
}

/* Кнопка сброса поискового запроса */
.btn-clear-search {
  display: none;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 0.75rem;
  padding: 0 0.25rem;
  cursor: pointer;
  pointer-events: auto;
  transition: color var(--transition-fast);
}

.btn-clear-search:hover {
  color: var(--amber-bright);
}

/* Правые контролы шапки: тумблер звука и переключатель языка */
.wiki-header-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.btn-control-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  padding: 0 0.65rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.85rem;
  gap: 0.4rem;
}

.btn-control-icon:hover {
  color: var(--text-bright);
  border-color: var(--border-bright);
  background: var(--bg-card-hover);
}

.btn-control-icon.active {
  color: var(--green-bright);
  border-color: var(--green);
  background: var(--green-dim);
  box-shadow: 0 0 10px var(--green-glow);
}

.lang-switch-group {
  display: flex;
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 2px;
}

.btn-lang {
  padding: 0.25rem 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
  border-radius: 2px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.btn-lang:hover {
  color: var(--text-main);
}

.btn-lang.active {
  background: var(--amber-dim);
  color: var(--amber-bright);
  border: 1px solid var(--amber);
  box-shadow: 0 0 8px var(--amber-glow);
}

/* --------------------------------------------------------------------------
   5. ТРЕХКОЛОНОЧНАЯ СЕТКА ЛЕЙАУТА (.wiki-layout)
   -------------------------------------------------------------------------- */
.wiki-layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr) var(--toc-width);
  gap: 2rem;
  max-width: 1720px;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 4rem 1.5rem;
  min-height: calc(100vh - var(--header-height));
  position: relative;
}

/* --------------------------------------------------------------------------
   6. ЛЕВЫЙ САЙДБАР (.wiki-sidebar)
   -------------------------------------------------------------------------- */
.wiki-sidebar {
  position: sticky;
  top: calc(var(--header-height) + 1.5rem);
  height: calc(100vh - var(--header-height) - 3rem);
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Шапка мобильного сайдбара (по умолчанию скрыта на широких экранах) */
.sidebar-mobile-header {
  display: none;
}

/* Блок фильтров по статусам */
.wiki-filter-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.filter-section-title {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 1.5px;
  color: var(--text-dim);
  text-transform: uppercase;
}

.status-pills-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.status-pill {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 0.25rem 0.55rem;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all var(--transition-fast);
}

.status-pill:hover {
  background: var(--bg-card-hover);
  color: var(--text-bright);
  border-color: var(--border-bright);
}

.status-pill.active {
  background: var(--bg-card-active);
  color: var(--text-bright);
  border-color: var(--border-bright);
}

/* Цветовые стили активных кнопок-пилюль фильтрации */
.status-pill[data-status="all"].active {
  border-color: var(--amber);
  color: var(--amber-bright);
  box-shadow: 0 0 8px var(--amber-glow);
}

.status-pill[data-status="live"].active {
  border-color: var(--green);
  color: var(--green-bright);
  box-shadow: 0 0 8px var(--green-glow);
}

.status-pill[data-status="in_dev"].active {
  border-color: var(--amber);
  color: var(--amber-bright);
  box-shadow: 0 0 8px var(--amber-glow);
}

.status-pill[data-status="concept"].active {
  border-color: var(--purple);
  color: var(--purple-bright);
  box-shadow: 0 0 8px var(--purple-glow);
}

/* Дерево навигации по категориям и статьям */
.wiki-nav-tree {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.wiki-category-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.wiki-category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-muted);
  text-transform: uppercase;
  border-bottom: 1px solid var(--border-subtle);
}

.category-header-title {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.category-article-count {
  font-size: 0.68rem;
  color: var(--text-dim);
  background: var(--bg-card);
  padding: 0.05rem 0.35rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

/* Список статей внутри категории */
.wiki-article-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.wiki-nav-item {
  display: block;
}

.wiki-nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0.65rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-muted);
  border: 1px solid transparent;
  transition: all var(--transition-fast);
  text-decoration: none;
  gap: 0.5rem;
}

.wiki-nav-link:hover {
  background: var(--bg-card-hover);
  color: var(--text-bright);
  border-color: var(--border-subtle);
}

.wiki-nav-link.active {
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.16) 0%, rgba(15, 21, 35, 0.9) 100%);
  color: var(--amber-bright);
  border-color: var(--amber);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.2);
  border-left-width: 3px;
}

.nav-link-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

/* Иконки статусов статей в сайдбаре */
.status-icon {
  font-size: 0.65rem;
  flex-shrink: 0;
  line-height: 1;
}

.status-icon.status-live {
  color: var(--green-bright);
  text-shadow: 0 0 6px var(--green-glow);
}

.status-icon.status-dev {
  color: var(--amber-bright);
  text-shadow: 0 0 6px var(--amber-glow);
}

.status-icon.status-concept {
  color: var(--purple-bright);
  text-shadow: 0 0 6px var(--purple-glow);
}

/* Состояние пустой выдачи при поиске */
.sidebar-empty-state {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-dim);
  text-align: center;
  padding: 2rem 1rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  background: rgba(15, 21, 35, 0.4);
}

/* Подсветка искомого фрагмента текста */
.search-highlight {
  background: rgba(245, 158, 11, 0.35);
  color: var(--amber-bright);
  padding: 0.1rem 0.25rem;
  border-radius: 2px;
  font-weight: bold;
}

/* --------------------------------------------------------------------------
   7. ЦЕНТРАЛЬНАЯ КОЛОНКА И СТАТЬЯ (.wiki-main, .wiki-article)
   -------------------------------------------------------------------------- */
.wiki-main {
  min-width: 0; /* Предотвращает распирание grid-колонки flex/grid дочерними элементами */
  display: flex;
  flex-direction: column;
  align-items: center;
}

.wiki-article-container {
  width: 100%;
  max-width: var(--content-max-width);
}

/* Контейнер статьи */
.wiki-article {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  animation: articleFadeIn 0.3s ease-out;
}

@keyframes articleFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Шапка статьи */
.article-header {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
  position: relative;
}

/* Хлебные крошки и дата Цитадели */
.article-meta-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.wiki-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.breadcrumb-separator {
  color: var(--border-bright);
}

.breadcrumb-current {
  color: var(--amber);
}

.wiki-date-stamp {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--cyan);
  background: var(--cyan-dim);
  border: 1px solid rgba(6, 182, 212, 0.35);
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  letter-spacing: 1px;
  box-shadow: 0 0 8px var(--cyan-glow);
}

/* Заголовок статьи */
.wiki-title {
  font-family: var(--font-mono);
  font-size: 2.35rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 1.5px;
  color: var(--text-bright);
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.15);
}

/* Бейджи статуса и тегов */
.article-badges-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.status-badge {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.status-badge.status-live {
  background: var(--green-dim);
  color: var(--green-bright);
  border: 1px solid var(--green);
  box-shadow: 0 0 10px var(--green-glow);
}

.status-badge.status-dev {
  background: var(--amber-dim);
  color: var(--amber-bright);
  border: 1px solid var(--amber);
  box-shadow: 0 0 10px var(--amber-glow);
}

.status-badge.status-concept {
  background: var(--purple-dim);
  color: var(--purple-bright);
  border: 1px solid var(--purple);
  box-shadow: 0 0 10px var(--purple-glow);
}

.category-badge {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border-bright);
  color: var(--text-muted);
}

.article-tags-wrap {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.tag-badge {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-dim);
  background: rgba(15, 21, 35, 0.6);
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

/* Вводная плашка (Summary lead-in) */
.wiki-summary {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--text-main);
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.08) 0%, rgba(15, 21, 35, 0.7) 100%);
  border-left: 4px solid var(--amber);
  padding: 1.15rem 1.4rem;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.4);
}

/* Блок цитаты с портретом и стилизацией радиограммы (.wiki-quote) */
.wiki-quote {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-bright);
  border-left: 4px solid var(--cyan);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}

.wiki-quote::before {
  content: "РАДИОГРАММА // ПЕРЕХВАТ ЦИТАДЕЛИ";
  position: absolute;
  top: 0.4rem;
  right: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 1.5px;
  color: var(--text-dim);
  opacity: 0.7;
}

.quote-avatar-wrap {
  width: 58px;
  height: 58px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--cyan);
  box-shadow: 0 0 12px var(--cyan-glow);
  overflow: hidden;
  background: #000;
}

.quote-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.quote-avatar-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  background: var(--cyan-dim);
  color: var(--cyan-bright);
}

.quote-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding-top: 0.2rem;
}

.quote-text {
  font-style: italic;
  font-size: 0.98rem;
  line-height: 1.6;
  color: var(--text-bright);
}

.quote-author {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--cyan-bright);
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.quote-author::before {
  content: "—";
  color: var(--cyan);
}

/* Галерея ассетов (.wiki-asset-grid) */
.wiki-asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin: 0.5rem 0;
}

.wiki-asset-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all var(--transition-normal);
}

.wiki-asset-card:hover {
  border-color: var(--amber);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6), 0 0 12px var(--amber-glow);
  transform: translateY(-2px);
}

.asset-img-wrap {
  width: 100%;
  height: 200px;
  background: #07090e;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--border-subtle);
}

.asset-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: transform var(--transition-normal);
}

.wiki-asset-card:hover .asset-img {
  transform: scale(1.04);
}

.asset-caption {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--text-muted);
  padding: 0.75rem 1rem;
  background: rgba(10, 13, 20, 0.85);
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.asset-caption::before {
  content: "◈";
  color: var(--amber-bright);
  font-size: 0.75rem;
  line-height: 1.4;
}

/* Секции статьи (.wiki-section) */
.wiki-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  scroll-margin-top: calc(var(--header-height) + 2rem);
  padding-top: 0.5rem;
}

.section-title {
  font-family: var(--font-mono);
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--amber-bright);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.section-title::before {
  content: "//";
  color: var(--amber);
  opacity: 0.6;
}

.section-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  font-size: 0.98rem;
  line-height: 1.75;
  color: var(--text-main);
}

.section-body p {
  margin: 0;
}

.section-body strong {
  color: var(--text-bright);
  font-weight: 600;
}

.section-body ul,
.section-body ol {
  margin-left: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.section-body li {
  padding-left: 0.35rem;
}

.section-body li::marker {
  color: var(--amber);
}

/* Кодовые сниппеты и формулы */
.section-body code,
.wiki-article code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: rgba(15, 21, 35, 0.95);
  border: 1px solid var(--border-bright);
  color: var(--cyan-bright);
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-sm);
}

.section-body pre,
.wiki-article pre {
  background: #080b12;
  border: 1px solid var(--border);
  border-left: 3px solid var(--amber);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--text-main);
  box-shadow: inset 0 0 16px rgba(0, 0, 0, 0.6);
}

.section-body pre code {
  background: transparent;
  border: none;
  padding: 0;
  color: inherit;
}

/* Сетка технических характеристик и параметров (.wiki-stats-grid) */
.wiki-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin: 0.75rem 0;
}

.stat-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-top: 3px solid var(--cyan);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  transition: all var(--transition-fast);
}

.stat-box:hover {
  border-color: var(--cyan-bright);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5), 0 0 12px var(--cyan-glow);
}

.stat-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 1px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.stat-value {
  font-family: var(--font-mono);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--cyan-bright);
  text-shadow: 0 0 10px var(--cyan-glow);
  line-height: 1.2;
}

/* Навигация между статьями внизу страницы (.wiki-article-nav) */
.wiki-article-nav {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 1.5rem;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.article-nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: all var(--transition-normal);
}

.article-nav-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--amber);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4), 0 0 10px var(--amber-glow);
  transform: translateY(-2px);
}

.nav-btn-sub {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 1px;
  color: var(--text-dim);
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.nav-btn-title {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-bright);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.article-nav-btn.nav-prev {
  text-align: left;
}

.article-nav-btn.nav-next {
  text-align: right;
  align-items: flex-end;
}

.article-nav-btn.hidden {
  visibility: hidden;
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   8. ПРАВОЕ ОГЛАВЛЕНИЕ СТАТЬИ (.wiki-toc)
   -------------------------------------------------------------------------- */
.wiki-toc {
  position: sticky;
  top: calc(var(--header-height) + 1.5rem);
  height: calc(100vh - var(--header-height) - 3rem);
  overflow-y: auto;
  padding-left: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.toc-header {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 1.5px;
  color: var(--text-dim);
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border-subtle);
}

.toc-header::before {
  content: "§";
  color: var(--amber);
}

.toc-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.toc-item {
  display: block;
}

.toc-link {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
  padding: 0.35rem 0.5rem 0.35rem 0.85rem;
  border-left: 2px solid var(--border-subtle);
  transition: all var(--transition-fast);
  line-height: 1.4;
  text-decoration: none;
}

.toc-link:hover {
  color: var(--text-bright);
  border-left-color: var(--border-bright);
}

.toc-link.active {
  color: var(--amber-bright);
  border-left-color: var(--amber);
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.1) 0%, transparent 100%);
  text-shadow: 0 0 8px var(--amber-glow);
  padding-left: 1.1rem;
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   9. ЗАТЕМНЕНИЕ И ШТОРКА МОБИЛЬНОГО МЕНЮ (DRAWER)
   -------------------------------------------------------------------------- */
.drawer-backdrop,
.wiki-drawer-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1050;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

.drawer-backdrop.active,
.wiki-drawer-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

/* --------------------------------------------------------------------------
   10. АДАПТИВНОСТЬ И МЕДИАЗАПРОСЫ
   -------------------------------------------------------------------------- */

/* Планшеты и компактные мониторы (< 1200px): скрываем правый TOC */
@media (max-width: 1200px) {
  .wiki-layout {
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    gap: 1.5rem;
  }

  .wiki-toc {
    display: none;
  }
}

/* Мобильные экраны и планшеты в портрете (< 860px): сайдбар превращается в drawer */
@media (max-width: 860px) {
  .wiki-layout {
    grid-template-columns: 1fr;
    padding: 1rem 1rem 3rem 1rem;
  }

  /* Показываем кнопку-бургер в шапке */
  .btn-mobile-menu {
    display: inline-flex;
  }

  /* Ссылка возврата на лендинг прячет длинный текст */
  .btn-back-landing .btn-back-text {
    display: none;
  }

  /* Сайдбар трансформируется в выездную панель */
  .wiki-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 310px;
    max-width: 85vw;
    height: 100vh;
    background: var(--bg-panel);
    border-right: 1px solid var(--border-bright);
    z-index: 1100;
    padding: 1.5rem;
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.8);
    transform: translateX(-100%);
    transition: transform var(--transition-normal);
  }

  .wiki-sidebar.open {
    transform: translateX(0);
  }

  .drawer-backdrop,
  .wiki-drawer-backdrop {
    display: block;
  }

  /* Заголовок мобильного сайдбара с кнопкой закрытия */
  .sidebar-mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 1rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
  }

  .sidebar-mobile-title {
    font-family: var(--font-mono);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--amber-bright);
    letter-spacing: 1px;
  }

  .btn-close-sidebar {
    font-size: 1.25rem;
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
  }

  .btn-close-sidebar:hover {
    color: var(--amber-bright);
    border-color: var(--amber);
  }

  /* Адаптация типографики статьи */
  .wiki-title {
    font-size: 1.85rem;
  }

  .wiki-quote {
    flex-direction: column;
    gap: 0.75rem;
  }

  .quote-avatar-wrap {
    width: 48px;
    height: 48px;
  }

  .wiki-article-nav {
    flex-direction: column;
    gap: 1rem;
  }

  .article-nav-btn.nav-next {
    align-items: flex-start;
    text-align: left;
  }
}

/* Компактные мобильные экраны (< 540px) */
@media (max-width: 540px) {
  .wiki-header-inner {
    padding: 0 0.75rem;
  }

  .brand-title {
    font-size: 0.98rem;
    letter-spacing: 1px;
  }

  .brand-subtitle,
  .brand-badge {
    display: none;
  }

  .wiki-search-input {
    font-size: 0.78rem;
    height: 34px;
    padding: 0 2rem 0 2rem;
  }

  .search-hotkey-badge {
    display: none;
  }

  .wiki-title {
    font-size: 1.5rem;
  }

  .wiki-summary {
    font-size: 0.95rem;
    padding: 1rem;
  }

  .wiki-stats-grid {
    grid-template-columns: 1fr;
  }

  .wiki-asset-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   ИНТЕРАКТИВНЫЕ ВИДЖЕТЫ ЭНЦИКЛОПЕДИИ (WIDGETS & TOOLS)
   ========================================================================== */

/* 1. Интерактивный Терминал CITADEL-OS */
.interactive-terminal {
  background: #05080f;
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-md);
  margin: 1.5rem 0;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6), inset 0 0 16px rgba(16, 185, 129, 0.05);
  overflow: hidden;
  font-family: var(--font-mono);
}

.terminal-header {
  background: #0d1322;
  border-bottom: 1px solid var(--border);
  padding: 0.5rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.terminal-title {
  color: var(--green);
  font-size: 0.85rem;
  font-weight: bold;
  letter-spacing: 1px;
}

.terminal-badge {
  background: rgba(16, 185, 129, 0.15);
  color: var(--green-bright);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  border: 1px solid var(--green);
}

.terminal-body {
  padding: 1rem;
  max-height: 320px;
  overflow-y: auto;
  font-size: 0.88rem;
  line-height: 1.5;
  color: #a7f3d0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.terminal-line {
  word-break: break-word;
}

.terminal-line.cmd {
  color: var(--amber-bright);
}

.terminal-line.success {
  color: #34d399;
}

.terminal-line.danger {
  color: #f87171;
}

.terminal-line.census {
  color: var(--cyan-bright);
  border-left: 2px solid var(--cyan);
  padding-left: 0.5rem;
  background: rgba(6, 182, 212, 0.05);
}

.terminal-controls {
  background: #090e1a;
  border-top: 1px solid var(--border);
  padding: 0.6rem 1rem;
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.terminal-prompt {
  color: var(--green);
  font-weight: bold;
}

.terminal-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.9rem;
}

.terminal-quick-bar {
  background: #090e1a;
  border-top: 1px dashed var(--border-subtle);
  padding: 0.4rem 1rem;
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  align-items: center;
}

.terminal-quick-label {
  font-size: 0.72rem;
  color: var(--text-dim);
}

.terminal-quick-btn {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: var(--amber-bright);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.terminal-quick-btn:hover {
  background: rgba(245, 158, 11, 0.25);
  border-color: var(--amber-bright);
}

/* 2. Интерактивный Калькулятор Форпостов и Idle-Математики */
.interactive-calc {
  background: #0c1220;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin: 1.5rem 0;
  font-family: var(--font-mono);
}

.calc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 0.75rem;
  margin-bottom: 1rem;
}

.calc-title {
  color: var(--amber-bright);
  font-size: 1.05rem;
  font-weight: bold;
}

.calc-tier-selector {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.calc-tier-btn {
  flex: 1;
  min-width: 100px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.6rem 0.5rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-align: center;
  transition: all 0.2s ease;
}

.calc-tier-btn:hover {
  border-color: var(--amber);
  color: var(--text-main);
}

.calc-tier-btn.active {
  background: rgba(245, 158, 11, 0.15);
  border-color: var(--amber-bright);
  color: var(--amber-bright);
  font-weight: bold;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.2);
}

.calc-controls-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

@media (max-width: 640px) {
  .calc-controls-grid {
    grid-template-columns: 1fr;
  }
}

.calc-control-group {
  background: rgba(0, 0, 0, 0.3);
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.calc-label-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.calc-val-badge {
  color: var(--cyan-bright);
  font-weight: bold;
}

.calc-slider {
  width: 100%;
  accent-color: var(--amber);
  cursor: pointer;
}

.calc-results-panel {
  background: #070a12;
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-sm);
  padding: 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.75rem;
}

.calc-metric-box {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.calc-metric-label {
  font-size: 0.7rem;
  color: var(--text-dim);
  text-transform: uppercase;
}

.calc-metric-val {
  font-size: 1.1rem;
  font-weight: bold;
  color: #fff;
}

.calc-metric-val.highlight {
  color: var(--green-bright);
}

.calc-metric-val.warning {
  color: var(--amber-bright);
}

/* 3. Интерактивный Селектор Директив Совета */
.interactive-quests {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin: 1.5rem 0;
}

.quests-acts-bar {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
}

.act-tab-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s;
}

.act-tab-btn:hover {
  color: var(--text-main);
  border-color: var(--text-dim);
}

.act-tab-btn.active {
  background: rgba(6, 182, 212, 0.15);
  border-color: var(--cyan);
  color: var(--cyan-bright);
  font-weight: bold;
}

.quest-card {
  background: #090e18;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 0.75rem;
  overflow: hidden;
  transition: border-color 0.2s;
}

.quest-card:hover {
  border-color: var(--border-bright);
}

.quest-card-header {
  padding: 0.75rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
}

.quest-card-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: bold;
  color: var(--text-main);
}

.quest-card-badge {
  font-size: 0.68rem;
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.quest-card-body {
  padding: 1rem;
  border-top: 1px solid var(--border-subtle);
  background: rgba(0, 0, 0, 0.2);
  font-size: 0.88rem;
  line-height: 1.5;
}

.quest-briefing {
  border-left: 2px solid var(--amber);
  padding-left: 0.75rem;
  margin-bottom: 1rem;
  color: #cbd5e1;
  font-style: italic;
}

.quest-choice-box {
  background: rgba(15, 23, 42, 0.6);
  border: 1px dashed var(--border-bright);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  margin-top: 0.75rem;
}

.quest-choice-title {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--amber-bright);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
}

.quest-choices-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.quest-choice-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s;
}

.quest-choice-btn:hover {
  background: rgba(245, 158, 11, 0.1);
  border-color: var(--amber);
}

.quest-choice-btn.selected {
  background: rgba(16, 185, 129, 0.15);
  border-color: var(--green);
  color: var(--green-bright);
  font-weight: bold;
}

.quest-outcome {
  margin-top: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: #34d399;
  padding: 0.35rem 0.5rem;
  background: rgba(16, 185, 129, 0.08);
  border-radius: var(--radius-sm);
}

/* 4. Интерактивный Радиосканер */
.interactive-radio {
  background: #090d16;
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin: 1.5rem 0;
  font-family: var(--font-mono);
}

.radio-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
}

.radio-freq-selector {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.radio-freq-btn {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  text-align: center;
  transition: all 0.2s;
}

.radio-freq-btn.active {
  background: rgba(6, 182, 212, 0.15);
  border-color: var(--cyan);
  color: var(--cyan-bright);
  font-weight: bold;
}

.radio-feed-container {
  background: #04060a;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  height: 180px;
  overflow-y: auto;
  font-size: 0.82rem;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.radio-msg {
  border-left: 2px solid var(--border);
  padding-left: 0.5rem;
}

.radio-msg.author-arthur { border-color: var(--amber); color: #fde68a; }
.radio-msg.author-briggs { border-color: #f97316; color: #fed7aa; }
.radio-msg.author-ren { border-color: var(--green); color: #a7f3d0; }
.radio-msg.author-kai { border-color: var(--purple); color: #e9d5ff; }
.radio-msg.author-vega { border-color: var(--cyan); color: #a5f3fc; }
.radio-msg.author-census { border-color: var(--red); color: #fecaca; background: rgba(239, 68, 68, 0.08); }


/* ==========================================================================
   14. ИНТЕРАКТИВНАЯ КАРТА СКВАЖИНЫ (0–5000 МЕТРОВ) И МОДАЛЬНЫЙ ЛИФТ
   ========================================================================== */

.btn-shaft-toggle {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid var(--amber);
  color: var(--amber-bright);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.8rem;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all var(--transition-fast);
}

.btn-shaft-toggle:hover {
  background: var(--amber);
  color: #000;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.4);
}

/* Модальное окно вертикального среза */
.shaft-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

.shaft-modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.shaft-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  width: 92vw;
  max-width: 1080px;
  height: 88vh;
  max-height: 800px;
  background: var(--bg-panel);
  border: 1px solid var(--border-focus);
  border-radius: var(--radius-md);
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.9), 0 0 15px rgba(245, 158, 11, 0.2);
  z-index: 1001;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: all var(--transition-normal);
}

.shaft-modal.active {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.shaft-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: rgba(13, 19, 33, 0.95);
}

.shaft-modal-title {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--amber-bright);
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-close-shaft {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 1.25rem;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.btn-close-shaft:hover {
  border-color: var(--red);
  color: var(--red);
}

.shaft-modal-body {
  display: grid;
  grid-template-columns: 260px 1fr;
  flex: 1;
  overflow: hidden;
}

/* Вертикальная шахтная направляющая */
.shaft-track-col {
  background: #05080f;
  border-right: 1px solid var(--border);
  padding: 1rem 0.5rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  position: relative;
  overflow-y: auto;
}

.shaft-track-bar {
  width: 32px;
  height: 580px;
  background: linear-gradient(
    to bottom,
    #78350f 0%,     /* 0-500m Ржавый */
    #374151 16%,    /* 500-1500m Индустриальный */
    #991b1b 36%,    /* 1500-3000m Термальный */
    #065f46 64%,    /* 3000-4500m Биосфера */
    #3b0764 90%,    /* 4500-5000m Пустоты */
    #000000 100%
  );
  border: 2px solid var(--border);
  border-radius: 16px;
  position: relative;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.8);
  cursor: pointer;
  margin-left: 10px;
}

.shaft-carriage {
  position: absolute;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 22px;
  background: var(--amber);
  border: 2px solid #fff;
  border-radius: 4px;
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: bold;
  color: #000;
  pointer-events: none;
  transition: top 0.08s ease-out;
}

.shaft-hotspot-pin {
  position: absolute;
  left: 44px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  transition: color var(--transition-fast);
}

.shaft-hotspot-pin:hover,
.shaft-hotspot-pin.active {
  color: var(--amber-bright);
  font-weight: bold;
}

.shaft-hotspot-pin::before {
  content: "◆";
  color: var(--amber);
  font-size: 0.6rem;
}

/* Правая панель: телеметрия и досье горизонта */
.shaft-detail-col {
  padding: 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.shaft-telemetry-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.85rem;
}

.shaft-telemetry-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.shaft-telemetry-card .card-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.shaft-telemetry-card .card-val {
  font-family: var(--font-mono);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--amber-bright);
}

.shaft-horizon-dossier {
  background: rgba(13, 19, 33, 0.6);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.shaft-horizon-title {
  font-family: var(--font-mono);
  font-size: 1.2rem;
  color: var(--cyan-bright);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.shaft-action-bar {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.btn-shaft-jump {
  background: var(--amber);
  color: #000;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-shaft-jump:hover {
  background: var(--amber-bright);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.5);
}

@media (max-width: 860px) {
  .shaft-modal-body {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }
  .shaft-track-col {
    display: none;
  }
}
