/* «Всё известное»: панели, карточка объекта, карта трассы, подписи поверх WebGL. */
:root { color-scheme: dark; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #05070d; }
body { font: 13px/1.45 system-ui, sans-serif; color: #dfe6f5; }
#view { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.panel {
  position: fixed; background: rgba(12, 17, 30, 0.9); border: 1px solid #243150; border-radius: 10px;
  padding: 10px 12px; backdrop-filter: blur(4px);
}
#side { left: 10px; top: 10px; bottom: 10px; width: 330px; display: flex; flex-direction: column; gap: 8px; }
#side h1 { margin: 0; font-size: 15px; font-weight: 600; display: flex; justify-content: space-between; align-items: center; }
.home { color: #8fa3c8; text-decoration: none; font-size: 12px; margin-bottom: -4px; }
.home:hover { color: #dfe6f5; }
#data-info { color: #8fa3c8; font-size: 12px; }
#data-info b { color: #dfe6f5; font-weight: 500; }
/* Фоновая загрузка астероидов (src/known/ui/loading.ts): строка с полосой под сводкой */
#ast-load { padding: 7px 9px 5px; border: 1px solid #243150; border-radius: 6px; background: rgba(74, 144, 226, 0.08); color: #c8d2e6; font-size: 12px; }
#ast-load[hidden] { display: none; }
#ast-load .load-text { margin-bottom: 6px; }
#ast-load .load-bar { max-width: none; }
#ast-load .load-num { margin-top: 4px; min-height: 15px; font-size: 11px; }
#search {
  width: 100%; padding: 5px 8px; background: #0f1524; color: #dfe6f5; border: 1px solid #2b3a5c; border-radius: 6px; font: inherit;
}
#results:empty { display: none; }
#results { max-height: 200px; overflow: auto; border: 1px solid #243150; border-radius: 6px; }
.res { padding: 3px 8px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.res:hover { background: #18223a; }
.res.none { color: #8fa3c8; cursor: default; }
.tools { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; color: #8fa3c8; font-size: 12px; }
.tools span { flex: 1; }
button {
  background: #16203a; color: #dfe6f5; border: 1px solid #2b3a5c; border-radius: 6px; padding: 3px 9px; font: inherit; cursor: pointer;
}
button:hover { border-color: #4a90e2; }
button.on { background: #1f3a6b; border-color: #4a90e2; }
#groups { overflow: auto; flex: 1; margin: 0 -4px; padding: 0 4px; }
.grp { display: flex; align-items: center; gap: 7px; padding: 3px 4px; border-radius: 5px; cursor: pointer; }
.grp:hover { background: #151e33; }
.grp.hl { background: #1c2a4a; }
.grp input { margin: 0; cursor: pointer; }
.gn { flex: 1; min-width: 0; }
.gc { color: #8fa3c8; font-variant-numeric: tabular-nums; }
.eye { padding: 0 4px; border: 0; background: none; font-size: 13px; line-height: 1; opacity: 0.25; filter: grayscale(1); }
.eye:hover { opacity: 0.7; }
.eye.on { opacity: 1; filter: none; }
.eye.off { opacity: 0.1; cursor: not-allowed; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex: none; margin-right: 2px; vertical-align: 0; }
.sep { margin: 8px 4px 4px; color: #8fa3c8; font-size: 11px; line-height: 1.35; border-top: 1px solid #243150; padding-top: 8px; }
.hint { color: #5d6d8e; font-size: 11px; }
#top { left: 50%; transform: translateX(-50%); top: 10px; display: flex; gap: 10px; align-items: center; padding: 6px 10px; }
#clock { font-family: ui-monospace, Consolas, monospace; font-size: 12px; min-width: 150px; cursor: pointer; border-radius: 4px; padding: 2px 4px; }
#clock:hover { background: #1a2440; }
/* Выбор даты — под часами */
#date-pop { position: absolute; top: calc(100% + 6px); left: 10px; display: flex; gap: 6px; align-items: center; padding: 6px 8px; border-radius: 6px; background: #0d1424; border: 1px solid #2c3a5c; z-index: 6; }
#date-pop[hidden] { display: none; }
#date-pop input { background: #111a30; color: #d6e2fb; border: 1px solid #2c3a5c; border-radius: 4px; padding: 3px 6px; font: 12px ui-monospace, Consolas, monospace; color-scheme: dark; }
#date-pop .utc { color: #8fa3c8; font-size: 11px; }
#speeds { display: flex; gap: 8px; align-items: center; }
/* Время — ползунок ‹‹‹‹‹ ‖ ›››››: шевроны под прозрачным range, на тех же местах, что и ползунок
   (--th — его ширина); горят от середины до ползунка */
.tsl { --th: 16px; position: relative; width: 300px; height: 26px; }
.tsl .marks { position: absolute; inset: 0; pointer-events: none; font: 700 14px/1 system-ui, sans-serif; color: #2f3c5e; }
.tsl .marks span { position: absolute; top: 50%; transform: translate(-50%, -52%); }
.tsl .marks .p { color: #6c7ea8; }
.tsl .marks .lit { color: #6fa8ff; }
.tsl .marks .back.lit { color: #ffb36f; }
.tsl .marks .on { color: #e6f0ff; }
.tsl .marks .back.on { color: #fff0e0; }
.tsl .marks .hov { color: #e6f0ff; }
.tslider { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; background: transparent; appearance: none; -webkit-appearance: none; cursor: pointer; }
.tslider:focus { outline: none; }
.tslider::-webkit-slider-runnable-track { height: 26px; background: transparent; }
.tslider::-moz-range-track { height: 26px; background: transparent; }
.tslider::-webkit-slider-thumb { -webkit-appearance: none; box-sizing: border-box; width: var(--th); height: 22px; margin-top: 2px; border-radius: 5px; background: rgba(111, 168, 255, 0.14); border: 1.5px solid #cfe2ff; }
.tslider::-moz-range-thumb { box-sizing: border-box; width: var(--th); height: 22px; border-radius: 5px; background: rgba(111, 168, 255, 0.14); border: 1.5px solid #cfe2ff; }
.tsl .tip { position: absolute; top: calc(100% + 6px); transform: translateX(-50%); white-space: nowrap; padding: 3px 7px; border-radius: 4px; background: #0d1424; border: 1px solid #2c3a5c; color: #d6e2fb; font-size: 11px; pointer-events: none; opacity: 0; transition: opacity 0.15s; z-index: 5; }
.tsl:hover .tip, .tslider:active + .tip, .tslider:focus-visible + .tip { opacity: 1; }
#card { right: 10px; top: 10px; width: 330px; max-height: calc(100% - 20px); overflow: auto; }
#card h3 { margin: 0 0 6px; font-size: 14px; word-break: break-word; }
.row { padding-left: 12px; text-indent: -12px; }
.row b { color: #8fa3c8; font-weight: 500; margin-right: 6px; }
.note { margin-top: 6px; color: #e8c07a; font-size: 12px; }
.btns { display: flex; gap: 6px; margin-top: 8px; }
#track { margin-top: 8px; cursor: zoom-in; }
#track canvas { width: 100%; display: block; border-radius: 6px; border: 1px solid #243150; }
#track-info { color: #9fb0d0; font-size: 11px; margin-top: 3px; }
#track.big { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(92vw, 1200px); z-index: 20;
  background: rgba(12,17,30,0.96); padding: 10px; border: 1px solid #2b3a5c; border-radius: 10px; cursor: zoom-out; }
#status { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); color: #8fa3c8; font-size: 14px; pointer-events: none; }
#status:empty { display: none; }
/* Индикатор загрузки (src/known/ui/loading.ts) */
#status { text-align: center; width: min(600px, 88vw); }
.load-text { margin-bottom: 10px; }
.load-bar { position: relative; max-width: 320px; margin: 0 auto; height: 4px; border-radius: 2px; background: #1a2440; overflow: hidden; }
.load-bar[hidden] { display: none; }
.load-fill { height: 100%; width: 0; border-radius: 2px; background: #4a90e2; transition: width 0.2s linear; }
.load-bar::after { content: ''; position: absolute; inset: 0; width: 30%; background: linear-gradient(90deg, transparent, rgba(160, 200, 255, 0.55), transparent);
  animation: load-run 1.4s linear infinite; }
.load-bar.busy .load-fill { width: 0 !important; }
@keyframes load-run { from { transform: translateX(-100%); } to { transform: translateX(340%); } }
.load-num { margin-top: 8px; min-height: 16px; font-size: 12px; color: #6f83a8; font-variant-numeric: tabular-nums; }
/* Пока грузимся, панель и полоса времени спрятаны (body.loading стоит в known.html, снимает loadingEnd) */
#side, #top { transition: opacity 0.4s; }
body.loading #side, body.loading #top { opacity: 0; pointer-events: none; }
/* Фон на время загрузки — Млечный Путь (та же текстура, что небо сцены), медленно плывёт; после загрузки растворяется */
/* Старт — центр Галактики посреди экрана (середина картинки шириной 340vh); за круг картинка сдвигается ровно на свою ширину */
#load-bg { position: fixed; inset: 0; pointer-events: none; opacity: 0; visibility: hidden; transition: opacity 0.9s, visibility 0s 0.9s;
  background: url(../textures/2k_stars_milky_way.jpg) calc(50vw - 170vh) 50% / auto 170% repeat-x #05070d;
  filter: brightness(1.7) saturate(1.25);
  animation: load-drift 240s linear infinite; }
/* Виньетка: края темнее, подпись в центре читается */
#load-bg::after { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at center, rgba(5, 7, 13, 0.45) 0%, rgba(5, 7, 13, 0.1) 45%, rgba(5, 7, 13, 0.6) 100%); }
body.loading #load-bg { opacity: 1; visibility: visible; transition: none; }
body:not(.loading) #load-bg { animation-play-state: paused; }
body.loading #labels { visibility: hidden; }
@keyframes load-drift { from { background-position: calc(50vw - 170vh) 50%; } to { background-position: calc(50vw - 510vh) 50%; } }
@media (prefers-reduced-motion: reduce) { #load-bg { animation: none; } }
#status { text-shadow: 0 1px 6px #05070d, 0 0 2px #05070d; }
body.loading .load-text { color: #dfe6f5; }
body.loading .load-num { color: #a9b8d6; }
#labels { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.lbl { position: absolute; font-size: 11px; white-space: nowrap; padding: 0 3px; background: rgba(5, 7, 13, 0.6); border-radius: 3px; }
.lbl.st { color: #ffd166; }
.lbl.sel { color: #fff; font-weight: 600; }
.lbl.pl { color: #c8d2e6; }
.lbl.mn { color: #9aa6bd; }
.lbl.cr { color: #ffd166; }
.lbl.hel { color: #9cc4ff; }
.warn { position: absolute; left: calc(50% + 170px); bottom: 16px; transform: translateX(-50%); max-width: min(760px, calc(100% - 380px)); color: #e8c07a; background: rgba(12,17,30,0.85); padding: 4px 10px; border-radius: 6px; font-size: 12px; line-height: 1.5; }
.folder { margin-bottom: 4px; }
.fh { display: flex; align-items: center; gap: 6px; padding: 4px; border-radius: 5px; cursor: pointer; font-weight: 600; }
.fh:hover { background: #151e33; }
.fh input { margin: 0; cursor: pointer; }
.fn { flex: 1; min-width: 0; }
.chev { width: 10px; color: #8fa3c8; }
.folder .fb { display: none; padding-left: 14px; }
.folder.open .fb { display: block; }
.res .sub { color: #8fa3c8; }
.row.sub { color: #9fb0d0; text-indent: 0; padding-left: 0; }
/* Апсиды (Ap / Pe) на орбите выбранного */
.aps { position: absolute; width: 7px; height: 7px; margin: -4px 0 0 -4px; border: 1.5px solid #fff; border-radius: 50%; background: rgba(5, 7, 13, 0.6); }
.lbl.aps { color: #e8eefc; }
/* Узлы (AN / DN) — ромбик; линия узлов через центр — пунктиром */
.nod { position: absolute; width: 7px; height: 7px; margin: -4px 0 0 -4px; border: 1.5px solid #8fd0ff; background: rgba(5, 7, 13, 0.6); transform: rotate(45deg); }
.lbl.nod { color: #a9dcff; }
.node-line { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.node-line line { stroke: #8fd0ff; stroke-opacity: 0.55; stroke-width: 1; stroke-dasharray: 4 4; }
/* За телом (орбита выбранного просвечивает) — бледнее */
.behind { opacity: 0.5; }
/* Стрелки направления движения на орбите выбранного */
.orbit-arrows { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.orbit-arrows path { fill: none; stroke: currentColor; stroke-opacity: 0.95; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.ring { position: absolute; width: 16px; height: 16px; margin: -8px 0 0 -8px; border: 2px solid #fff; border-radius: 50%; }
#hover {
  position: fixed; pointer-events: none; background: rgba(12, 17, 30, 0.95); border: 1px solid #2b3a5c;
  border-radius: 6px; padding: 3px 8px; white-space: nowrap; font-size: 12px;
}
#hover .sub, #track-tip .sub { color: #8fa3c8; }
#refresh-note[hidden] { display: none; }
#refresh-note { left: 50%; top: 58px; transform: translateX(-50%); padding: 6px 10px; display: flex; gap: 8px; align-items: center; color: #9cc4ff; }
#track-tip { position: fixed; pointer-events: none; z-index: 30; background: rgba(12, 17, 30, 0.95); border: 1px solid #2b3a5c; border-radius: 6px; padding: 3px 8px; white-space: nowrap; font-size: 12px; }
@media (max-width: 760px) {
  #side { width: auto; right: 10px; bottom: auto; max-height: 45%; }
  #top { top: auto; bottom: 10px; }
  #card { top: auto; bottom: 60px; left: 10px; right: 10px; width: auto; max-height: 40%; }
}
/* Переключатель языка RU | EN — в заголовке панели, справа */
.lang-switch { display: flex; gap: 0; }
.lang-switch button { font: 11px system-ui, sans-serif; font-weight: 400; color: #8fa3c8; background: transparent; border: 1px solid #243150; border-radius: 0; padding: 1px 7px; cursor: pointer; }
.lang-switch button:first-child { border-radius: 6px 0 0 6px; }
.lang-switch button:last-child { border-radius: 0 6px 6px 0; }
.lang-switch button:hover { color: #dfe6f5; }
.lang-switch button.on { color: #dfe6f5; border-color: #4a90e2; background: rgba(74, 144, 226, 0.15); }
