* { box-sizing: border-box; }
body { margin:0; background:#0a0a0a; overflow:hidden; font-family: 'Courier New', monospace; color:#CC5500; }
canvas { display:block; cursor: crosshair; }

/* 🎨 Полосы прокрутки — тёмно-серые, в тон окон (не белые) */
* { scrollbar-width: thin; scrollbar-color: #3a3f4a rgba(20,22,28,0.9); }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: rgba(20,22,28,0.9); }
*::-webkit-scrollbar-thumb { background: #3a3f4a; border-radius: 4px; border: 1px solid #282828; }
*::-webkit-scrollbar-thumb:hover { background: #4a5060; }
*::-webkit-scrollbar-corner { background: rgba(20,22,28,0.9); }

#ui { position:fixed; top:10px; left:10px; pointer-events:none; text-shadow:0 0 4px #000; font-size:12px; background: rgba(10,10,10,0.9); padding: 10px; border-left: 4px solid #8B4513; min-width: 220px; z-index: 100; }
.res { color:#B8860B; margin: 2px 0; }
.mod { color:#B8860B; margin: 2px 0; }
.crew { color:#A0522D; font-weight: bold; margin: 2px 0; }
.warning { color: #CC5500; animation: blink 0.8s infinite; font-weight: bold; }
.pirate { color: #A0522D; animation: blink 0.5s infinite; font-weight: bold; }
.xp-bar { background: #1a1a1a; height: 6px; margin: 4px 0; border: 1px solid #8B4513; }
.xp-fill { background: linear-gradient(90deg, #8B4513, #B8860B); height: 100%; transition: width 0.3s; }
@keyframes blink { 50% { opacity: 0.4; } }

/* Нижняя панель-подсказка удалена (инфо и управление теперь в окне [I]) */

#modal { position:fixed; inset:0; background: rgba(0, 0, 0, 0.7); display:none; align-items:center; justify-content:center; z-index:3000; }
#modal .box { background:#0a0a0a; border:2px solid #8B4513; padding:20px; min-width:500px; max-width:95vw; max-height:95vh; overflow:auto; box-shadow: 0 0 30px rgba(139, 69, 19, 0.3); border-radius: 8px; position: relative; box-sizing: border-box;}
#modal h2 { color:#FF8C00; margin-top:0; text-transform: uppercase; letter-spacing: 2px; border-bottom: 2px dashed #2a2a2a; padding-bottom: 8px; }
#modal button { background:#1a1a1a; color:#FF8C00; border:1px solid #8B4513; padding:8px 16px; margin:4px; cursor:pointer; font-family:inherit; font-weight:bold; text-transform: uppercase; transition: 0.2s; }
#modal button:hover { background:#8B4513; color:#0a0a0a; box-shadow: 0 0 10px #8B4513; }
#modal button:disabled { opacity:0.3; cursor:not-allowed; border-color:#333; color:#555; }
#modal input[type="text"], #modal input[type="number"] { background:#1a1a1a; border:2px solid #8B4513; color:#FF8C00; padding:12px; font-family:inherit; font-size:16px; width:100%; margin:10px 0; }

.recipe { background:#111; padding:10px; margin:6px 0; border-left: 3px solid #8B4513; display:flex; justify-content:space-between; align-items:center; }

#msg { position:fixed; top:20%; left:50%; transform:translate(-50%,-50%); color:#FF8C00; font-size:22px; font-weight:bold; text-shadow:0 0 15px #000; pointer-events:none; opacity:0; transition:opacity 0.3s; text-align:center; z-index: 200; }

#quest-log { position:fixed; top:10px; right:10px; background:rgba(10,10,10,0.9); border-right: 4px solid #A0522D; padding:10px; font-size:11px; max-width: 260px; z-index: 100; color:#c0c0c0; }
/* Журнал/почта обёрнуты в общий блок справа сверху — прижаты к правой стенке */
#quest-log {
  position: static;
  width: 260px;
  text-align: right;
  background: rgba(10, 10, 10, 0.72);
  border-right: 3px solid #A0522D;
  border-radius: 0 4px 4px 0;
  padding: 8px 12px;
  line-height: 1.55;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
}
#quest-log b, #quest-log span { text-shadow: 0 1px 2px #000; }

/* Миникарта + координаты под ней (без рамки и названия) */
.ap-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #8a8e98;
  font-size: 11px;
  font-family: monospace;
  padding: 22px;
  justify-content: center;
}
.ap-spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255, 152, 0, 0.25);
  border-top-color: #ff9800;
  animation: dcSpin 0.8s linear infinite;
  flex-shrink: 0;
}
#minimap-wrap {
  position: fixed;
  bottom: 10px;
  right: 10px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  z-index: 100;
}
#minimap {
  border: 2px solid #8B4513;
  background: rgba(10,10,10,0.8);
  display: block;
  box-shadow: 0 0 12px rgba(139, 69, 19, 0.35);
}
#minimap-info {
  background: transparent;
  border: none;
  padding: 0;
  color: #888;
  font-family: 'Courier New', monospace;
  font-size: 10px;
  text-align: center;
  text-shadow: 0 1px 3px #000;
}
#minimap-info .mm-coords { color: #888; font-size: 10px; margin-top: 0; }

/* Панель назначения экипажа (СЛЕВА внизу, справа от модульного состояния корабля) */
#crew-panel {
  position: fixed;
  left: 110px;
  right: auto;
  bottom: 14px;
  min-width: 215px;
  max-width: 280px;
  /* ✅ ВЫШЕ всех HUD-окон и канваса: клик по кнопкам −/+ всегда попадает в панель
     (ниже модалок/journal: 3000/900, но выше миникарты/сканера/тулбара: 101) */
  z-index: 800;
  background: rgba(10, 13, 18, 0.6);
  border: 1px solid rgba(255, 152, 0, 0.25);
  border-radius: 10px;
  padding: 8px 10px;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  color: #cfd4dc;
  box-shadow: 0 0 14px rgba(0, 0, 0, 0.4);
  pointer-events: auto;
}
#crew-panel .cp-head {
  color: #FFB347;
  font-size: 11px;
  font-weight: bold;
  border-bottom: 1px solid rgba(255, 152, 0, 0.2);
  padding-bottom: 4px;
  margin-bottom: 5px;
  text-align: center;
  text-shadow: 0 1px 2px #000;
}
#crew-panel .cp-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 2px 0;
  pointer-events: auto;
}
#crew-panel .cp-row .cp-name {
  flex: 0 0 auto;
  color: #aab;
}
#crew-panel .cp-row .cp-count {
  flex: 1 1 auto;
  text-align: center;
  color: #fff;
}
#crew-panel .cp-row.cp-ok .cp-count { color: #7CE38B; }
#crew-panel .cp-row.cp-off .cp-count { color: #E3534A; }
#crew-panel .cp-mods {
  color: #8a8890;
  font-size: 8.5px;
  line-height: 1.35;
  padding: 0 2px 2px 8px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
#crew-panel .cp-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 152, 0, 0.3);
  color: #FFB347;
  width: 18px;
  height: 18px;
  line-height: 1;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  font-weight: bold;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
#crew-panel .cp-btn:hover { background: rgba(255, 152, 0, 0.2); }
#crew-panel .cp-btn:disabled { opacity: 0.3; cursor: default; }

/* Мини-блюпринт корабля (состояние модулей) — снизу слева */
#ship-mini-wrap {
  position: fixed;
  bottom: 12px;
  left: 12px;
  padding: 6px;
  background: rgba(8, 10, 14, 0.55);
  border: 1px solid rgba(255, 152, 0, 0.25);
  border-radius: 6px;
  z-index: 100;
  box-shadow: 0 0 14px rgba(0, 0, 0, 0.5);
}
#ship-mini {
  display: block;
  image-rendering: pixelated;
}

.ship-builder { display: flex; gap: 20px; flex-wrap: wrap; }
.ship-grid-container { flex: 1; min-width: 400px; }
.modules-panel { width: 300px; }

.ship-grid { display:grid; gap:3px; margin:10px auto; background:#1a1a1a; padding:15px; border:2px solid #2a2a2a; max-width: fit-content; }

.grid-cell { width:70px; height:70px; background:#0a0a0a; border:2px solid #2a2a2a; cursor:pointer; position: relative; transition: all 0.2s; display: flex; align-items: center; justify-content: center; }
.grid-cell:hover { border-color: #FF8C00; background:#1a1a1a; }
.grid-cell.occupied { border-color: #CC5500; background:#1a1510; }
.grid-cell canvas { image-rendering: pixelated; }

.module-item { padding: 10px; margin: 6px 0; background: #1a1a1a; border: 2px solid #8B4513; cursor: grab; display: flex; align-items: center; gap: 10px; transition: all 0.2s; }
.module-item:hover { background: #222; border-color: #FF8C00; }
.module-item:active { cursor: grabbing; }
.module-item.dragging { opacity: 0.5; }
.module-item canvas { image-rendering: pixelated; }

.energy-bar { background: #1a1a1a; height: 24px; border: 2px solid #8B4513; margin: 10px 0; position: relative; }
.energy-fill { background: linear-gradient(90deg, #8B4513, #CC5500); height: 100%; transition: width 0.3s; }
.energy-text { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 13px; font-weight: bold; color: #c0c0c0; text-shadow: 1px 1px 2px #000; }

.settings-btn { position: fixed; top: 10px; left: 50%; transform: translateX(-50%); background: #1a1a1a; border: 2px solid #8B4513; color: #FF8C00; padding: 8px 16px; cursor: pointer; font-family: inherit; font-weight: bold; z-index: 100; }
.settings-btn:hover { background: #8B4513; color: #0a0a0a; }

.craft-section { margin-top: 20px; padding-top: 20px; border-top: 2px dashed #2a2a2a; }

.tooltip { position: fixed; background: rgba(10, 10, 10, 0.95); border: 2px solid #8B4513; padding: 10px; font-size: 11px; pointer-events: none; z-index: 300; max-width: 250px; display: none; color:#c0c0c0; }
.tooltip-title { color: #FF8C00; font-weight: bold; margin-bottom: 5px; }
.tooltip-desc { color: #888; margin-bottom: 5px; }
.tooltip-stats { color: #B8860B; }

#sector-map { position:fixed; inset:0; background:rgba(10,10,10,0.95); display:none; align-items:center; justify-content:center; z-index:250; }
#sector-map .map-container { background:#0a0a0a; border:2px solid #8B4513; padding:20px; width:90vw; height:90vh; position:relative; }
#sector-map canvas { border:1px solid #2a2a2a; cursor: crosshair; }
.sector-info { position:absolute; top:20px; right:20px; background:rgba(10,10,10,0.9); padding:15px; border:1px solid #8B4513; min-width:250px; color:#c0c0c0; }

.grid-cell.locked {
  background: #050505;
  border-color: #222;
  cursor: not-allowed;
  opacity: 0.4;
}
.grid-cell.locked:hover {
  background: #050505;
  border-color: #222;
}

/* Локальный сканер */
#local-scanner {
  position: fixed;
  bottom: 60px;
  left: 10px;
  background: rgba(0, 0, 0, 0);
  border-radius: 3px;
  color: #c0c0c0;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  pointer-events: none;
  z-index: 100;
  min-width: 180px;
  max-height: 600px;
}
#local-scanner .scanner-title {
  color: #FF8C00;
  font-weight: bold;
  margin-bottom: 5px;
  font-size: 13px;
  border-bottom: 1px dashed #8B4513;
  padding-bottom: 4px;
}
#local-scanner .scanner-players {
  color: #B8860B;
  margin-top: 5px;
  line-height: 1.4;
}
#local-scanner .scanner-count {
  color: #888;
  font-size: 11px;
}



/* Модалка информации о схеме корабля */
#modal[data-mode="ship-info"] .box {
  min-width: 700px !important;
  max-width: 90vw !important;
  max-height: 90vh !important;
  overflow-y: auto;
}

#modal[data-mode="ship-info"] img {
  max-width: 100%;
  height: auto;
}


















/* Тулбар */
#combat-toolbar {
  position: fixed; bottom: 60px; left: 210px;
  background: rgba(10, 10, 10, 0.9); border: 1px solid #8B4513;
  border-radius: 4px; padding: 10px; color: #c0c0c0; font-family: 'Courier New', monospace;
  font-size: 12px; pointer-events: none; z-index: 100; min-width: 150px;
}
.toolbar-section { margin-bottom: 8px; }
.toolbar-label { color: #FF8C00; font-size: 11px; margin-bottom: 3px; }
.toolbar-bar { background: rgba(26, 26, 26, 0.8); border: 1px solid #2a2a2a; border-radius: 2px; height: 20px; position: relative; overflow: hidden; }
.toolbar-fill { height: 100%; transition: width 0.3s; }
.hp-fill { background: linear-gradient(90deg, #A0522D, #CC5500); }
.shield-fill { background: linear-gradient(90deg, #8B4513, #FF8C00); }
.toolbar-text { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 10px; color: #c0c0c0; text-shadow: 1px 1px 2px #000; }
.toolbar-icon { display: flex; align-items: center; gap: 8px; background: rgba(26, 26, 26, 0.8); border: 1px solid #2a2a2a; border-radius: 2px; padding: 5px 10px; }
.icon-rocket, .icon-mine { font-size: 18px; }
.icon-count { color: #FF8C00; font-weight: bold; font-size: 14px; }
.xp-fill {
  background: linear-gradient(90deg, #B8860B, #CC5500);
}
.energy-fill {
  background: linear-gradient(90deg, #8B4513, #CC5500);
}
.cargo-fill {
  background: linear-gradient(90deg, #8B4513, #B8860B);
}

/* Модальное окно - полупрозрачный фон */
#modal {
  background: rgba(0, 0, 0, 0.7);
}

/* Окно модалки */
#modal .box, #modalBox {
  border-radius: 8px;
  background: rgba(10, 10, 10, 0.95);
  border: 1px solid #8B4513;
}

/* Все кнопки - закругленные */
button {
  border-radius: 6px;
  transition: all 0.2s ease;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.1);
}

button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Базовые цвета кнопок */
button {
  background: rgba(139, 69, 19, 0.2);
  color: #FF8C00;
  border: 1px solid #8B4513;
  font-weight: 500;
  padding: 8px 16px;
}

button:hover:not(:disabled) {
  background: rgba(139, 69, 19, 0.4);
  border-color: #FF8C00;
}

/* Специфичные кнопки */
button[style*="background:#4f8"],
button[style*="background:#4cf"],
button[style*="background:#fa4"],
button[style*="background:#f33c40"],
button[style*="background:#a8f"] {
  border-radius: 6px;
  border: none;
  font-weight: 600;
}

/* Заголовки колонок */
h3 {
  color: #FF8C00;
  font-size: 14px;
  margin: 0 0 10px 0;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Блоки ресурсов */
div[style*="background:#1a1a1a"] {
  background: rgba(26, 26, 26, 0.8) !important;
  border-radius: 6px;
  border: 1px solid #2a2a2a;
}

/* Инвентарь квадраты */
div[style*="width:18px"] {
  border-radius: 3px;
}

/* Верхняя панель чипов */
div[style*="background:#1a1a1a"][style*="border:1px solid #fa4"] {
  background: rgba(26, 26, 26, 0.9) !important;
  border-radius: 6px;
}

/* Кнопка вылета */
.exit-button {
  background: rgba(160, 82, 45, 0.2);
  color: #A0522D;
  border: 1px solid rgba(160, 82, 45, 0.5);
  border-radius: 6px;
  padding: 8px 20px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.exit-button:hover {
  background: rgba(160, 82, 45, 0.4);
  border-color: #A0522D;
  transform: translateY(-1px);
}




/* Фиксированный минимальный размер модалок */
#modal .box {
  min-width: 800px !important;
  min-height: 500px !important;
  max-width: 95vw !important;
  max-height: 90vh !important;
}

#modal[data-mode="station-crafting"] .box,
#modal[data-mode="station"] .box {
  width: min(1400px, 96vw) !important;
  height: min(880px, 92vh) !important;
  min-width: 0 !important;  min-height: 0 !important;
  max-width: 96vw !important;
  max-height: 92vh !important;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
}

/* Окно трюма корабля [T] — фиксированный размер, контент прокручивается */
#modal[data-mode="cargo"] .box {
  width: min(900px, 94vw) !important;
  height: min(700px, 92vh) !important;
  min-width: 0 !important;
  min-height: 0 !important;
  max-width: 94vw !important;
  max-height: 92vh !important;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
}

/* Минимальный размер для конструктора */
#modal[data-mode="craft"] .box {
  width: min(1600px, 99vw) !important;
  height: min(980px, 99vh) !important;
  max-width: 99vw !important;
  max-height: 99vh !important;
}

/* 🖥️ ВЕРФЬ/КОНСТРУКТОР/ПРОИЗВОДСТВО/ТРЮМ — НА ВЕСЬ ЭКРАН */
#modal[data-mode="craft"] .box,
#modal[data-mode="station"] .box,
#modal[data-mode="station-crafting"] .box,
#modal[data-mode="cargo"] .box,
#modal[data-mode="inventory"] .box,
#modal[data-mode="info"] .box {
  width: 98vw !important;
  height: 97vh !important;
  min-height: 94vh !important;
  max-width: 98vw !important;
  max-height: 97vh !important;
  padding: 16px 18px;
  overflow: auto;
  border-radius: 10px;
}
#modal[data-mode="craft"] .box > *,
#modal[data-mode="station"] .box > *,
#modal[data-mode="station-crafting"] .box > * {
  max-width: 100% !important;
}

/* 🖥️ ВЕРФЬ (СВОЯ СТАНЦИЯ) — ПОЛНЫЙ ЭКРАН */
#modal[data-mode="station"] .box,
#modal[data-mode="station-crafting"] .box {
  width: 100vw !important;
  height: 100vh !important;
  min-height: 100vh !important;
  max-width: 100vw !important;
  max-height: 100vh !important;
  border-radius: 0 !important;
  border: none !important;
}
#modal[data-mode="station"] {
  background: rgba(4, 6, 10, 0.92) !important;
}
.ship-builder {
  grid-template-columns: minmax(0, 1fr) minmax(360px, 430px) !important;
  gap: 20px !important;
}

/* Сетка конструктора */
.ship-builder {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

/* Сетка корабля */
.ship-grid {
  display: grid;
  gap: 3px;
  padding: 15px;
  background: rgba(26, 26, 26, 0.8);
  border: 2px solid #333;
  border-radius: 8px;
}

/* Ячейки сетки */
.grid-cell {
  width: 70px;
  height: 70px;
  background: #0a0a0a;
  border: 2px solid #333;
  cursor: pointer;
  position: relative;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ✅ В КОНСТРУКТОРЕ сетка наложена на картинку — ячейки занимают трек целиком */
#ship-grid .grid-cell {
  width: 100% !important;
  height: 100% !important;
  padding: 0;
  margin: 0;
  transition: none;
}

.grid-cell:hover {
  border-color: #FF8C00;
  background: #1a1a1a;
}

.grid-cell.occupied {
  border-color: #B8860B;
  background: #1a1510;
}

/* Модули в конструкторе: компактные плитки в сетке */
.module-item.builder-module {
  padding: 10px;
  margin: 6px 0;
  background: rgba(26, 26, 26, 0.9);
  border: 1px solid #8B4513;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 4px;
  transition: all 0.2s;
}

.module-item.builder-module.tile {
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  margin: 0;
  padding: 8px 6px 8px 6px;
  gap: 4px;
  text-align: center;
  border-radius: 8px;
  min-height: 112px;
  width: 116px;
  max-width: 116px;
  box-sizing: border-box;
  user-select: none;
  -webkit-user-select: none;
}

.module-item.builder-module.tile canvas {
  display: block;
}

.module-item.builder-module.tile:hover {
  border-color: #FF8C00;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 140, 0, 0.25);
}

/* Сетка модулей конструктора (блоки по группам) */
.builder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(116px, 1fr));
  gap: 9px;
  min-height: 120px;
  padding-right: 4px;
}

.module-item.builder-module:hover {
  background: rgba(42, 42, 42, 0.9);
  border-color: #FF8C00;
  transform: translateX(3px);
}

.module-item.builder-module.tile:hover {
  transform: translateY(-2px);
}

/* Поиск модулей */
#module-search {
  width: 100%;
  padding: 7px;
  background: rgba(26, 26, 26, 0.9);
  border: 1px solid #8B4513;
  color: #FF8C00;
  font-family: monospace;
  border-radius: 4px;
  box-sizing: border-box;
}

/* Скролл для списка модулей */
#modules-list.builder-grid {
  max-height: calc(100vh - 290px);
  overflow-y: auto;
}

#craft-body .builder-grid {
  max-height: calc(100vh - 380px);
}

#modules-list::-webkit-scrollbar {
  width: 6px;
}

#modules-list::-webkit-scrollbar-track {
  background: rgba(26, 26, 26, 0.5);
  border-radius: 3px;
}

#modules-list::-webkit-scrollbar-thumb {
  background: #8B4513;
  border-radius: 3px;
}

#modules-list::-webkit-scrollbar-thumb:hover {
  background: #FF8C00;
}

/* ==========================================
   📬 ПОЧТА / ЖУРНАЛ ПИЛОТА [J]
   ========================================== */
#mail-box {
  position: relative;
  background: rgba(10, 10, 10, 0.72);
  border-right: 3px solid #A0522D;
  border-radius: 0 4px 4px 0;
  padding: 8px 12px 8px 10px;
  font-size: 16px;
  cursor: pointer;
  z-index: 101;
  line-height: 1;
  user-select: none;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
}
#mail-box:hover { background: #1a1a1a; }
#mail-box #mail-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: #f33c40;
  color: #fff;
  font-size: 10px;
  font-weight: bold;
  border-radius: 10px;
  padding: 2px 6px;
  line-height: 1;
  min-width: 16px;
  text-align: center;
  box-shadow: 0 0 8px rgba(243, 60, 64, 0.8);
}

#journal {
  position: fixed;
  z-index: 930;
  display: flex;
  flex-direction: column;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  color: #c8d0da;
  background: rgba(10, 12, 18, 0.96);
  border: 1px solid #282828;
  border-radius: 10px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.65);
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  min-width: 420px;
  min-height: 300px;
}
#journal .journal-wrap {
  width: min(720px, 94vw);
  max-height: 86vh;
  background: #0a0a0a;
  border: 2px solid #8B4513;
  box-shadow: 0 0 30px rgba(76, 204, 255, 0.15);
  display: flex;
  flex-direction: column;
}
#journal .journal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px dashed #2a2a2a;
  background: rgba(26, 26, 26, 0.6);
}
#journal .journal-tabs {
  display: flex;
  gap: 4px;
  padding: 10px 18px 0 18px;
}
#journal .journal-tab {
  background: #111;
  border: 1px solid #333;
  color: #888;
  padding: 8px 16px;
  cursor: pointer;
  font-family: inherit;
  font-weight: bold;
  font-size: 12px;
}
#journal .journal-tab.active {
  background: #1a1a1a;
  border-color: #FF9800;
  color: #FF9800;
}
#journal .journal-mail-count { color: #4f8; }
#journal .journal-panel {
  padding: 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 260px;
  max-height: max-content;
}
#journal .journal-panel.hidden { display: none; }
#journal .journal-card {
  background: #111;
  border: 1px solid #2a2a2a;
  border-left: 3px solid #8B4513;
  padding: 12px 14px;
}
#journal .journal-card.active { border-left-color: #4f8; }
#journal .journal-card.unread { border-left-color: #FF9800; background: #16130d; }
#journal .unread-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #FF9800;
  flex-shrink: 0;
  box-shadow: 0 0 6px #FF9800;
}
#journal .journal-btn {
  background: #1a1a1a;
  color: #FF8C00;
  border: 1px solid #8B4513;
  padding: 6px 12px;
  cursor: pointer;
  font-family: inherit;
  font-weight: bold;
  font-size: 11px;
}
#journal .journal-btn.primary { background: #B8860B; color: #000; }
#journal .journal-btn.primary:hover { background: #FF8C00; color: #000; }
#journal .journal-btn:hover { background: #8B4513; color: #0a0a0a; }
#journal .journal-panel {
  scrollbar-width: thin;
  scrollbar-color: #B8860B rgba(20, 22, 28, 0.95);
  scrollbar-gutter: stable;
}
#journal .journal-panel::-webkit-scrollbar { width: 10px; }
#journal .journal-panel::-webkit-scrollbar-track { background: rgba(20, 22, 28, 0.95); border-radius: 5px; }
#journal .journal-panel::-webkit-scrollbar-thumb { background: #B8860B; border-radius: 5px; border: 1px solid #5a3a08; }
#journal .journal-panel::-webkit-scrollbar-thumb:hover { background: #FF8C00; }
#journal .journal-panel::-webkit-scrollbar-corner { background: rgba(20, 22, 28, 0.95); }

/* ⛔ БАННЕР «ЭКИПАЖ 0 — СВЯЗЬ С КОРАБЛЁМ ПОТЕРЯНА» (в стиле отключения, красный) */#crew-dead-banner {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2900;
  font-family: 'Courier New', monospace;
}
#crew-dead-banner .dc-banner-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(180deg, rgba(56, 10, 10, 0.97), rgba(22, 5, 5, 0.97));
  border: 1px solid #c83a3a;
  border-radius: 8px;
  padding: 10px 16px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.6), 0 0 16px rgba(220, 50, 50, 0.35);
}
#crew-dead-banner .dc-spinner {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 3px solid rgba(243, 60, 64, 0.25);
  border-top-color: #f33c40;
  flex-shrink: 0;
  background: radial-gradient(circle, rgba(243, 60, 64, 0.9) 0%, transparent 72%);
  animation: dcSpin 1.2s linear infinite;
}
#crew-dead-banner .dc-title {
  color: #f55;
  font-weight: bold;
  font-size: 14px;
  letter-spacing: 1px;
}
#crew-dead-banner .dc-sub {
  color: #f2cccc;
  font-size: 11px;
  line-height: 1.5;
}

/* ==========================================
   🔗 БАННЕР «СВЯЗЬ ПОТЕРЯНА» (верх по центру, ненавязчивый)
   ========================================== */
#disconnect-banner {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, top 0.25s ease;
}
#disconnect-banner.visible {
  opacity: 1;
  pointer-events: auto;
}
#disconnect-banner .dc-banner-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(180deg, rgba(40, 12, 12, 0.97), rgba(20, 6, 6, 0.97));
  border: 1px solid #a32c2c;
  border-radius: 8px;
  padding: 10px 16px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.6), 0 0 14px rgba(200, 40, 40, 0.25);
  font-family: 'Courier New', monospace;
  max-width: 480px;
}
#disconnect-banner .dc-spinner {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 3px solid rgba(243, 60, 64, 0.25);
  border-top-color: #f33c40;
  animation: dcSpin 1s linear infinite;
  flex-shrink: 0;
}
@keyframes dcSpin { to { transform: rotate(360deg); } }
#disconnect-banner .dc-title {
  color: #f33c40;
  font-weight: bold;
  font-size: 14px;
  letter-spacing: 1px;
}
#disconnect-banner .dc-sub {
  color: #d8c8a0;
  font-size: 12px;
  margin-top: 2px;
}
#disconnect-banner .dc-btn {
  background: #a32c2c;
  color: #fff;
  border: 1px solid #f33c40;
  border-radius: 5px;
  padding: 8px 12px;
  font-family: inherit;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s;
}
#disconnect-banner .dc-btn:hover {
  background: #f33c40;
  color: #000;
}

/* 🧭 РЕЖИМ РЕДАКТИРОВАНИЯ ОКОН UI */
body.ui-edit-mode { cursor: move; }
#ui-edit-banner {
  position: fixed;
  top: 58px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3500;
  font-family: 'Courier New', monospace;
}
#ui-edit-banner .dc-banner-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 8px;
  padding: 10px 14px;
  max-width: 760px;
}
#ui-edit-banner .dc-spinner { width: 18px; height: 18px; flex-shrink: 0; }
#ui-edit-banner .dc-title { font-size: 13px; }
#ui-edit-banner button { font-size: 11px; white-space: nowrap; }
.ui-edit-overlay {
  position: fixed;
  z-index: 3200;
  box-sizing: border-box;
  background: rgba(70, 224, 168, 0.10);
  border: 1px dashed rgba(70, 224, 168, 0.55);
  border-radius: 6px;
  cursor: move;
  pointer-events: auto;
  touch-action: none;
  user-select: none;
}
.ui-edit-resize {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 14px;
  height: 14px;
  cursor: nwse-resize;
  z-index: 3201;
  pointer-events: auto;
  background: linear-gradient(135deg, transparent 50%, #46e0a8 50%);
  border-bottom-right-radius: inherit;
}

/* ==========================================
   🌈 ЦВЕТОВЫЕ СХЕМЫ ИНТЕРФЕЙСА
   body.scheme-voidbound — по умолчанию (индиго-войд)
   body.scheme-gray     — черно-серая (строгая)
   Управляется setColorScheme() (вкладка Графика → ЦВЕТОВАЯ СХЕМА).
   Плавающие OS-окна красятся инлайн-стилями — перебиваем CSS'ом с !important.
   ========================================== */

/* === ЧЁРНО-СЕРАЯ (КЛАССИЧЕСКАЯ): точно как трюм корабля [T] до voidbound.
   Палитра cargo-win: окно rgba(10,12,18,.96)+#282828, панели rgba(16,19,24,.9),
   рамки rgba(255,255,255,.09), текст #cfd2da/#8a8e98, голубовато-стальные акценты,
   оранжевый #FF9800 — только у заголовков (как «📦 ТРЮМ КОРАБЛЯ»). === */
body.scheme-gray #ui,
body.scheme-gray #ui-topright,
body.scheme-gray #local-scanner,
body.scheme-gray #ship-mini-wrap,
body.scheme-gray #minimap-wrap,
body.scheme-gray #crew-panel,
body.scheme-gray #combat-toolbar,
body.scheme-gray #ap-panel {
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.6) !important;
}
body.scheme-gray #minimap {
  border-color: #3a3a3a !important;
}

/* === ПЛАВАЮЩИЕ ОКНА: как трюм === */
body.scheme-gray #settings-win,
body.scheme-gray #info-win,
body.scheme-gray #craft-win,
body.scheme-gray #journal,
body.scheme-gray #cargo-win,
body.scheme-gray #corp-win,
body.scheme-gray #ap-picker-win,
body.scheme-gray #map-win {
  background: rgba(10, 12, 18, 0.96) !important;
  border: 1px solid #282828 !important;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.65) !important;
  color: #c8d0da !important;
}

/* шапка окна: как трюм (rgba(22,26,34,.98), подчёркивание rgba(255,255,255,.12)) */
body.scheme-gray #settings-win #ap-win-bar,
body.scheme-gray #info-win #ap-win-bar,
body.scheme-gray #craft-win #ap-win-bar,
body.scheme-gray #journal #ap-win-bar,
body.scheme-gray #cargo-win #ap-win-bar,
body.scheme-gray #corp-win #ap-win-bar,
body.scheme-gray #ap-picker-win #ap-win-bar,
body.scheme-gray #map-win #ap-win-bar {
  background: rgba(22, 26, 34, 0.98) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12) !important;
  box-shadow: none !important;
}
body.scheme-gray #settings-win #ap-win-bar > div > div,
body.scheme-gray #info-win #ap-win-bar > div > div,
body.scheme-gray #craft-win #ap-win-bar > div > div {
  color: #FF9800 !important;   /* как «📦 ТРЮМ КОРАБЛЯ» */
  text-shadow: none !important;
}
body.scheme-gray #settings-win > div:nth-child(2),
body.scheme-gray #info-win > div:nth-child(2),
body.scheme-gray #craft-win > div:nth-child(2) {
  background: rgba(255, 255, 255, 0.08) !important;
  box-shadow: none !important;
}

/* заголовки секций: оранжевый как у трюма, подчёркивание rgba(255,152,0,.35) */
body.scheme-gray #settings-win h3,
body.scheme-gray #info-win h3,
body.scheme-gray #craft-win h3,
body.scheme-gray #journal h3,
body.scheme-gray #cargo-win h3 {
  color: #FF9800 !important;
  text-shadow: none !important;
  border-bottom-color: rgba(255, 152, 0, 0.35) !important;
}

/* вкладки НАСТРОЕК: активная — голубовато-стальная (как ячейки/прогресс трюма), неактивная тёмно-серая */
body.scheme-gray #settings-win #settings-tabs .st-tab {
  background: #1a1d26 !important;
  color: #8a8e98 !important;
}
body.scheme-gray #settings-win #settings-tabs .st-tab-on {
  background: #5f6f8f !important;
  color: #f2f4f8 !important;
}

/* карточки-панели вкладок: панели трюма rgba(16,19,24,.9) + рамка rgba(255,255,255,.09) */
body.scheme-gray #settings-win .st-card {
  background: rgba(16, 19, 24, 0.9) !important;
  border: 1px solid rgba(255, 255, 255, 0.09) !important;
  box-shadow: none !important;
}

/* инпуты: тёмно-серые */
body.scheme-gray #settings-win input[type="text"],
body.scheme-gray #settings-win input[type="password"] {
  background: #1a1d26 !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  color: #cfd2da !important;
}
body.scheme-gray #settings-win input[type="range"] { accent-color: #5f6f8f !important; }

/* описания/подписи/статусы: #8a8e98 (как статистика трюма) */
body.scheme-gray #settings-win p { color: #8a8e98 !important; }
body.scheme-gray #settings-win label { color: #cfd2da !important; }
body.scheme-gray #settings-win #pass-change-status { color: #8a8e98 !important; }

/* слайдерные подписи/значения: #8a8e98 (как статистика трюма) */
body.scheme-gray #settings-win #bgm-vol-val,
body.scheme-gray #settings-win #sfx-vol-val,
body.scheme-gray #settings-win #ui-scale-val {
  color: #8a8e98 !important;
}

/* главные кнопки: стальные — фон #2a2d35, текст #cfd2da, рамка rgba(255,255,255,.12) */
body.scheme-gray #settings-win button {
  background: #2a2d35 !important;
  color: #cfd2da !important;
  border-color: rgba(255, 255, 255, 0.14) !important;
  text-shadow: none !important;
  box-shadow: none !important;
}

/* переключатели графики/схем: НЕактивная кнопка — тёмно-серая */
body.scheme-gray #settings-win button.st-toggle:not(.st-on) {
  background: #1a1d26 !important;
  color: #8a8e98 !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}

/* переключатели графики/схем: АКТИВНАЯ кнопка — голубовато-стальная #5f6f8f */
body.scheme-gray #settings-win button.st-toggle.st-on {
  background: #5f6f8f !important;
  color: #f2f4f8 !important;
  border-color: #7d8db1 !important;
}

/* блок «АДМИНИСТРАТОР» — оставить тёплым для опасности, чуть приглушить */
body.scheme-gray #settings-win .st-admin {
  border-color: rgba(200, 90, 60, 0.5) !important;
  background: rgba(70, 30, 20, 0.2) !important;
}
body.scheme-gray #settings-win .st-admin h3 { color: #d08770 !important; }

/* === gray: остальные плавающие OS-окна (Корпорации/Инфо/Трюм/Маршруты/Журнал/Сборщик/Админ) ===
   Окна и карточки — как трюм cargo-win: панели rgba(16,19,24,.9), рамки rgba(255,255,255,.09),
   вкладки/переключатели стальные #5f6f8f, текст #cfd2da/#8a8e98. */
body.scheme-gray #info-win input[type="text"],
body.scheme-gray #info-win input[type="password"],
body.scheme-gray #info-win select,
body.scheme-gray #info-win textarea,
body.scheme-gray #cargo-win input[type="text"],
body.scheme-gray #cargo-win select,
body.scheme-gray #cargo-win textarea,
body.scheme-gray #ap-picker-win input[type="text"],
body.scheme-gray #corp-win input[type="text"],
body.scheme-gray #craft-win input[type="text"],
body.scheme-gray #admin-win input[type="text"],
body.scheme-gray #admin-win input[type="password"],
body.scheme-gray #admin-win select,
body.scheme-gray #admin-win textarea {
  background: #1a1d26 !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  color: #cfd2da !important;
}
body.scheme-gray #info-win input[type="range"],
body.scheme-gray #cargo-win input[type="range"],
body.scheme-gray #admin-win input[type="range"] { accent-color: #5f6f8f !important; }

/* вкладки ИНФО/МАРШРУТОВ/АДМИНА: активная — стальная #5f6f8f, неактивная #1a1d26 */
body.scheme-gray #info-win .st-tab,
body.scheme-gray #ap-picker-win .st-tab,
body.scheme-gray #admin-win .admtab,
body.scheme-gray #admin-win .st-tab {
  background: #1a1d26 !important;
  color: #8a8e98 !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}
body.scheme-gray #info-win .st-tab-on,
body.scheme-gray #ap-picker-win .st-tab-on,
body.scheme-gray #admin-win .st-tab-on {
  background: #5f6f8f !important;
  color: #f2f4f8 !important;
  border-color: #7d8db1 !important;
}

/* Карточки-панели ИНФО (досье/корабль/управление/навыки) */
body.scheme-gray #info-win #info-tab-pilot > div:not(:last-child),
body.scheme-gray #info-win #info-tab-skills > div {
  background: rgba(16, 19, 24, 0.9) !important;
  border: 1px solid rgba(255, 255, 255, 0.09) !important;
}
/* Карточки ТРЮМА (вместимость/ресурсы/модули) */
body.scheme-gray #cargo-win #cargo-cap > div,
body.scheme-gray #cargo-win #cargo-body > div {
  background: rgba(16, 19, 24, 0.9) !important;
  border: 1px solid rgba(255, 255, 255, 0.09) !important;
}
body.scheme-gray #cargo-win .cargo-res-row,
body.scheme-gray #cargo-win .cargo-mod-row {
  background: rgba(16, 19, 24, 0.9) !important;
  border-color: rgba(255, 255, 255, 0.09) !important;
}
/* Карточки КОРПОРАЦИЙ (список/создание) */
body.scheme-gray #corp-win [data-corp] {
  background: rgba(16, 19, 24, 0.9) !important;
  border: 1px solid rgba(255, 255, 255, 0.09) !important;
}
body.scheme-gray #corp-win #corp-flag-editor {
  background: rgba(16, 19, 24, 0.9) !important;
}
/* Карточки МАРШРУТОВ (станции/места) */
body.scheme-gray #ap-picker-win #ap-pick-body > div > div,
body.scheme-gray #ap-picker-win #ap-pick-body > div {
  background: rgba(16, 19, 24, 0.9) !important;
  border-color: rgba(255, 255, 255, 0.09) !important;
}

/* === СХЕМА voidbound: остальные плавающие OS-окна (Корпорации/Инфо/Трюм/Маршруты/Журнал/Сборщик/Админ) ===
   По умолчанию окна имеют инлайн-стили старого «cargo» вида — перекрашиваем в индиго-войд
   через КЛАССЫ/структурные селекторы (attribute-[style*=] не использовать — нормализация rgb()).
   Рамки/шапки/заголовки — индиго #a599e8, панели rgba(16,16,30,.85), рамки rgba(138,125,214,.35). */
body.scheme-voidbound #corp-win,
body.scheme-voidbound #info-win,
body.scheme-voidbound #cargo-win,
body.scheme-voidbound #ap-picker-win,
body.scheme-voidbound #journal,
body.scheme-voidbound #craft-win,
body.scheme-voidbound #admin-win,
body.scheme-voidbound #map-win {
  background: #10122a !important;
  border: 1px solid rgba(138, 125, 214, 0.45) !important;
  color: #cfc8ea !important;
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.05), inset 0 0 30px rgba(110, 95, 190, 0.12) !important;
}
body.scheme-voidbound #corp-win #ap-win-bar,
body.scheme-voidbound #info-win #ap-win-bar,
body.scheme-voidbound #cargo-win #ap-win-bar,
body.scheme-voidbound #ap-picker-win #ap-win-bar,
body.scheme-voidbound #journal #ap-win-bar,
body.scheme-voidbound #craft-win #ap-win-bar,
body.scheme-voidbound #admin-win #ap-win-bar,
body.scheme-voidbound #map-win #ap-win-bar {
  background: linear-gradient(180deg, rgba(38, 34, 66, 0.98), rgba(22, 20, 42, 0.98)) !important;
  border-bottom: 1px solid rgba(138, 125, 214, 0.45) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06) !important;
}
body.scheme-voidbound #corp-win #ap-win-bar > div > div,
body.scheme-voidbound #info-win #ap-win-bar > div > div,
body.scheme-voidbound #cargo-win #ap-win-bar > div > div,
body.scheme-voidbound #ap-picker-win #ap-win-bar > div > div,
body.scheme-voidbound #journal #ap-win-bar > div > div,
body.scheme-voidbound #craft-win #ap-win-bar > div > div,
body.scheme-voidbound #admin-win #ap-win-bar > div > div,
body.scheme-voidbound #map-win #ap-win-bar > div > div {
  color: #a599e8 !important;
  text-shadow: 0 0 14px rgba(128, 112, 208, 0.5);
}
body.scheme-voidbound #corp-win h3,
body.scheme-voidbound #info-win h3,
body.scheme-voidbound #cargo-win h3,
body.scheme-voidbound #ap-picker-win h3,
body.scheme-voidbound #journal h3,
body.scheme-voidbound #craft-win h3,
body.scheme-voidbound #admin-win h3 {
  color: #a599e8 !important;
  text-shadow: 0 0 10px rgba(128, 112, 208, 0.4);
  border-bottom-color: rgba(138, 125, 214, 0.35) !important;
}
body.scheme-voidbound #info-win input[type="text"],
body.scheme-voidbound #info-win input[type="password"],
body.scheme-voidbound #info-win select,
body.scheme-voidbound #info-win textarea,
body.scheme-voidbound #cargo-win input[type="text"],
body.scheme-voidbound #cargo-win select,
body.scheme-voidbound #cargo-win textarea,
body.scheme-voidbound #ap-picker-win input[type="text"],
body.scheme-voidbound #corp-win input[type="text"],
body.scheme-voidbound #corp-win input[type="password"],
body.scheme-voidbound #craft-win input[type="text"],
body.scheme-voidbound #admin-win input[type="text"],
body.scheme-voidbound #admin-win input[type="password"],
body.scheme-voidbound #admin-win select,
body.scheme-voidbound #admin-win textarea {
  background: rgba(12, 12, 20, 0.75) !important;
  border: 1px solid rgba(138, 125, 214, 0.55) !important;
  color: #dcd6ff !important;
}
body.scheme-voidbound #info-win input[type="range"],
body.scheme-voidbound #cargo-win input[type="range"],
body.scheme-voidbound #admin-win input[type="range"] { accent-color: #a599e8 !important; }

/* вкладки ИНФО/МАРШРУТОВ/АДМИНА в voidbound: активная — индиго-градиент, неактивная — тёмная */
body.scheme-voidbound #info-win .st-tab-on,
body.scheme-voidbound #ap-picker-win .st-tab-on,
body.scheme-voidbound #admin-win .st-tab-on {
  background: linear-gradient(135deg, #a599e8, #6a5cc8 60%, #4a3f9e) !important;
  color: #f4f1ff !important;
  border-color: #8a7dd6 !important;
}
body.scheme-voidbound #info-win .st-tab,
body.scheme-voidbound #ap-picker-win .st-tab,
body.scheme-voidbound #admin-win .st-tab {
  background: rgba(16, 16, 30, 0.85) !important;
  color: #a599e8 !important;
  border-color: rgba(138, 125, 214, 0.45) !important;
}

/* Карточки-панели ИНФО (досье/корабль/управление/навыки) */
body.scheme-voidbound #info-win #info-tab-pilot > div:not(:last-child),
body.scheme-voidbound #info-win #info-tab-skills > div {
  background: rgba(16, 16, 30, 0.85) !important;
  border: 1px solid rgba(138, 125, 214, 0.35) !important;
}
body.scheme-voidbound #info-win #info-tab-pilot > div:not(:last-child) b { text-shadow: 0 0 8px rgba(128, 112, 208, 0.3); }

/* Карточки ТРЮМА (вместимость/ресурсы/модули) + строки предметов */
body.scheme-voidbound #cargo-win #cargo-cap > div,
body.scheme-voidbound #cargo-win #cargo-body > div {
  background: rgba(16, 16, 30, 0.85) !important;
  border: 1px solid rgba(138, 125, 214, 0.35) !important;
}
body.scheme-voidbound #cargo-win .cargo-res-row,
body.scheme-voidbound #cargo-win .cargo-mod-row {
  background: rgba(16, 16, 30, 0.85) !important;
  border-color: rgba(138, 125, 214, 0.35) !important;
}
/* Карточки КОРПОРАЦИЙ (список/создание) */
body.scheme-voidbound #corp-win [data-corp] {
  background: rgba(16, 16, 30, 0.85) !important;
  border: 1px solid rgba(138, 125, 214, 0.35) !important;
}
/* Карточки МАРШРУТОВ (станции/места) */
body.scheme-voidbound #ap-picker-win #ap-pick-body > div > div,
body.scheme-voidbound #ap-picker-win #ap-pick-body > div {
  background: rgba(16, 16, 30, 0.85) !important;
  border-color: rgba(138, 125, 214, 0.35) !important;
}

/* === ЖУРНАЛ (вариант схемы) === */
body.scheme-gray #journal .journal-tab {
  background: #1a1d26 !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  color: #8a8e98 !important;
}
body.scheme-gray #journal .journal-tab.active {
  background: #5f6f8f !important;
  border-color: #7d8db1 !important;
  color: #f2f4f8 !important;
}
body.scheme-gray #journal .journal-card {
  background: rgba(16, 19, 24, 0.9) !important;
  border: 1px solid rgba(255, 255, 255, 0.09) !important;
  border-left: 3px solid rgba(255, 255, 255, 0.09) !important;
}
body.scheme-gray #journal .journal-btn {
  background: #2a2d35 !important;
  color: #cfd2da !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
}

body.scheme-voidbound #journal .journal-tab {
  background: rgba(16, 16, 30, 0.85) !important;
  border: 1px solid rgba(138, 125, 214, 0.45) !important;
  color: #a599e8 !important;
}
body.scheme-voidbound #journal .journal-tab.active {
  background: linear-gradient(135deg, #a599e8, #6a5cc8 60%, #4a3f9e) !important;
  border-color: #8a7dd6 !important;
  color: #f4f1ff !important;
}
body.scheme-voidbound #journal .journal-card {
  background: rgba(16, 16, 30, 0.85) !important;
  border: 1px solid rgba(138, 125, 214, 0.35) !important;
  border-left: 3px solid rgba(138, 125, 214, 0.35) !important;
}
body.scheme-voidbound #journal .journal-btn {
  background: rgba(128, 112, 208, 0.14) !important;
  color: #dcd6ff !important;
  border: 1px solid rgba(138, 125, 214, 0.6) !important;
}

/* === HUD-панели: АВТОПИЛОТ (#ap-panel), ЛОКАЛ (#local-scanner), МИНИ КАРТА (#minimap),
   Экипаж (#crew-panel), Модули корабля (#ship-mini-wrap), Тактическая панель (#combat-toolbar).
   Схема gray (трюм): тёмно-серые подложки, оранжевые заголовки, стальные акценты. === */
body.scheme-gray #ap-panel {
  background: rgba(16, 19, 24, 0.96) !important;
  border-left: 4px solid #8B4513 !important;
  color: #cfd2da !important;
}
body.scheme-gray #ap-panel .ap-ttl {
  color: #FF9800 !important;
  border-bottom: 1px dashed rgba(255, 152, 0, 0.35) !important;
}
body.scheme-gray #ap-panel .ap-add-route {
  background: #2a2d35 !important;
  color: #cfd2da !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
}
body.scheme-gray #local-scanner > div {
  background: rgba(16, 19, 24, 0.96) !important;
}
body.scheme-gray #local-scanner > div > div:first-child {
  color: #FF9800 !important;
  border-bottom: 1px dashed rgba(255, 152, 0, 0.35) !important;
}
body.scheme-gray #local-scanner { color: #cfd2da !important; }
body.scheme-gray #minimap {
  border-color: #3a3a3a !important;
  background: rgba(10, 12, 18, 0.9) !important;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.5) !important;
}
body.scheme-gray #minimap-wrap { color: #cfd2da !important; }
body.scheme-gray #ship-mini-wrap {
  background: rgba(16, 19, 24, 0.92) !important;
  border: 1px solid rgba(255, 255, 255, 0.09) !important;
}
body.scheme-gray #crew-panel { background: rgba(16, 19, 24, 0.95) !important; }
body.scheme-gray #combat-toolbar { background: rgba(16, 19, 24, 0.95) !important; }

/* === СХЕМА gray: ПОЧТА/ЗАДАЧИ СПРАВА СВЕРХУ (ui-topright/mail-box/quest-log) — как трюм === */
body.scheme-gray #mail-box {
  background: rgba(16, 19, 24, 0.92) !important;
  border-right: 3px solid rgba(255, 255, 255, 0.2) !important;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.5) !important;
}
body.scheme-gray #mail-box:hover { background: #2a2d35 !important; }
body.scheme-gray #quest-log {
  background: rgba(16, 19, 24, 0.92) !important;
  border-right: 3px solid rgba(255, 255, 255, 0.2) !important;
  color: #cfd2da !important;
}
body.scheme-gray #quest-log b { text-shadow: none !important; }
body.scheme-gray #ui-topright { z-index: 101 !important; }

/* === HUD-панели: схема voidbound (индиго-войд) === */
body.scheme-voidbound #ap-panel {
  background: rgba(16, 16, 30, 0.96) !important;
  border-left: 4px solid #8a7dd6 !important;
  color: #cfc8ea !important;
}
body.scheme-voidbound #ap-panel .ap-ttl {
  color: #a599e8 !important;
  border-bottom: 1px dashed rgba(138, 125, 214, 0.35) !important;
  text-shadow: 0 0 10px rgba(128, 112, 208, 0.4);
}
body.scheme-voidbound #ap-panel .ap-add-route {
  background: rgba(16, 16, 30, 0.85) !important;
  color: #a599e8 !important;
  border: 1px solid rgba(138, 125, 214, 0.6) !important;
}
body.scheme-voidbound #local-scanner > div {
  background: rgba(16, 16, 30, 0.96) !important;
}
body.scheme-voidbound #local-scanner > div > div:first-child {
  color: #a599e8 !important;
  border-bottom: 1px dashed rgba(138, 125, 214, 0.35) !important;
  text-shadow: 0 0 10px rgba(128, 112, 208, 0.4);
}
body.scheme-voidbound #local-scanner { color: #cfc8ea !important; }
body.scheme-voidbound #minimap {
  border-color: rgba(138, 125, 214, 0.7) !important;
  background: rgba(10, 10, 24, 0.9) !important;
  box-shadow: 0 0 12px rgba(110, 95, 190, 0.35) !important;
}
body.scheme-voidbound #minimap-wrap { color: #cfc8ea !important; }
body.scheme-voidbound #ship-mini-wrap {
  background: rgba(16, 16, 30, 0.92) !important;
  border: 1px solid rgba(138, 125, 214, 0.35) !important;
}
body.scheme-voidbound #crew-panel { background: rgba(16, 16, 30, 0.95) !important; }
body.scheme-voidbound #combat-toolbar { background: rgba(16, 16, 30, 0.95) !important; }

/* === СХЕМА voidbound: ПОЧТА/ЗАДАЧИ СПРАВА СВЕРХУ (ui-topright/mail-box/quest-log) === */
body.scheme-voidbound #mail-box {
  background: rgba(16, 16, 30, 0.92) !important;
  border-right: 3px solid rgba(138, 125, 214, 0.6) !important;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.45) !important;
}
body.scheme-voidbound #mail-box:hover { background: rgba(30, 28, 52, 0.98) !important; }
body.scheme-voidbound #quest-log {
  background: rgba(16, 16, 30, 0.92) !important;
  border-right: 3px solid rgba(138, 125, 214, 0.6) !important;
  color: #cfc8ea !important;
}
body.scheme-voidbound #quest-log b { text-shadow: none !important; }
body.scheme-voidbound #ui-topright { z-index: 101 !important; }
