:root {
  --bg: #000000;
  --line: rgba(120, 200, 255, 0.28);
  --line-strong: rgba(140, 215, 255, 0.6);
  --cyan: #7fd7ff;
  --cyan-dim: rgba(127, 215, 255, 0.55);
  --gold: #f5c56b;
  --ochre: #e0a04a;   /* группа наблюдателя: горизонт, стороны света, «здесь» */
  --red: #ff6b6b;
  --green: #8ee6a5;
  --text: #dbe9f4;
  --muted: rgba(200, 225, 245, 0.55);
  --panel: rgba(3, 8, 16, 0.62);
  --font-ui: 'Jura', 'Segoe UI', 'Segoe UI Symbol', 'Apple Symbols', 'Noto Sans Symbols 2', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', Consolas, 'Segoe UI Symbol', 'Apple Symbols', monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 13px;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

#scene { position: fixed; inset: 0; z-index: 0; }
#scene canvas { display: block; }
#labels { position: fixed; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; }

/* ---------- loader ---------- */
#loader {
  position: fixed; inset: 0; z-index: 50;
  background: #000;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px;
  transition: opacity .8s ease;
}
#loader.hide { opacity: 0; pointer-events: none; }
.loader-ring {
  width: 96px; height: 96px; border-radius: 50%;
  border: 1px solid var(--line);
  border-top-color: var(--cyan);
  animation: spin 1.4s linear infinite;
  position: relative;
}
.loader-ring::after {
  content: ''; position: absolute; inset: 14px; border-radius: 50%;
  border: 1px dashed var(--line);
  animation: spin 3s linear infinite reverse;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loader-text { letter-spacing: .5em; font-weight: 300; font-size: 20px; text-align: center; color: var(--cyan); }
.loader-text span { display: block; margin-top: 10px; font-size: 11px; letter-spacing: .25em; color: var(--muted); }
.loader-err { max-width: 460px; margin: 0 16px; padding: 14px 16px; border: 1px solid rgba(255,107,107,.5); background: rgba(40,8,8,.5); color: var(--text); font-size: 13px; line-height: 1.5; text-align: center; }
.loader-err code { display: block; margin-top: 8px; font-family: var(--font-mono); font-size: 11px; color: var(--muted); word-break: break-word; }

/* ---------- HUD layout ---------- */
#hud {
  position: fixed; inset: 0; z-index: 2;
  pointer-events: none;
  display: grid;
  grid-template-columns: 340px 1fr 380px;
  grid-template-rows: 1fr auto;
  gap: 14px;
  padding: 14px;
}
#hud > * { pointer-events: auto; }
/* место под полосу прокрутки резервируется всегда: иначе её появление сужает
   панели на несколько пикселей и текст перескакивает по строкам */
.col { display: flex; flex-direction: column; gap: 12px; min-height: 0; overflow-y: auto; overflow-x: hidden; scrollbar-gutter: stable; padding-right: 2px; scrollbar-width: thin; scrollbar-color: rgba(127,215,255,.25) transparent; }
.col::-webkit-scrollbar { width: 5px; }
.col::-webkit-scrollbar-thumb { background: rgba(127,215,255,.25); border-radius: 3px; }
.col-left { grid-column: 1; grid-row: 1; }
.col-right { grid-column: 3; grid-row: 1; }
.timebar { grid-column: 1 / -1; grid-row: 2; justify-self: center; width: min(980px, 100%); }

/* ---------- panel ---------- */
.panel {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  backdrop-filter: blur(10px) saturate(120%);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
  flex-shrink: 0;
}
.panel::before, .panel::after {
  content: ''; position: absolute; width: 10px; height: 10px; pointer-events: none;
  border-color: var(--cyan); border-style: solid;
}
.panel::before { top: -1px; left: -1px; border-width: 1px 0 0 1px; }
.panel::after { bottom: -1px; right: -1px; border-width: 0 1px 1px 0; }

.panel header {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  cursor: pointer; user-select: none;
}
.panel header h2 {
  margin: 0; font-size: 12px; font-weight: 600; letter-spacing: .22em; text-transform: uppercase; color: var(--cyan);
  white-space: nowrap;
}
.panel header .hint { margin-left: auto; font-size: 11px; color: var(--muted); font-family: var(--font-mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.panel header .chev { width: 7px; height: 7px; border-right: 1px solid var(--cyan-dim); border-bottom: 1px solid var(--cyan-dim); transform: rotate(45deg); transition: transform .25s; flex-shrink: 0; }
.panel.collapsed header { border-bottom-color: transparent; }
/* свёрнутые панели идут плотной стопкой: без зазоров и пониже */
.panel.collapsed header { padding-top: 5px; padding-bottom: 5px; }
.panel.collapsed + .panel.collapsed { margin-top: -13px; }
.panel.collapsed header .chev { transform: rotate(-45deg); }
.panel .body { padding: 10px 12px 12px; }
.panel.collapsed .body { display: none; }

/* brand + clock */
.brand-panel header { padding: 11px 14px 4px; border-bottom: 0; }
.brand-panel .body { padding: 0 14px 12px; }
.brand-panel header .hint { font-size: 13px; color: var(--text); opacity: 0; transition: opacity .2s; }
.brand-panel.collapsed header { padding: 6px 12px; }
.brand-panel.collapsed header .hint { opacity: 1; }
.brand-panel.collapsed .brand-name { font-size: 15px; letter-spacing: .3em; }
.brand-panel.collapsed .brand-sub { display: none; }
.brand-name { font-size: 22px; letter-spacing: .38em; font-weight: 300; color: #fff; }
.brand-name b { font-weight: 700; color: var(--cyan); }
.brand-sub { font-size: 10px; letter-spacing: .3em; text-transform: uppercase; color: var(--muted); margin-top: -2px; }
.clock { margin: 12px 0 8px; }
.clock-time { font-family: var(--font-mono); font-size: 34px; font-weight: 300; letter-spacing: .06em; line-height: 1; color: #fff; }
.clock-date { font-size: 13px; color: var(--cyan); margin-top: 6px; letter-spacing: .06em; }

.kv { display: grid; gap: 4px 12px; }
.kv > div { display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px dotted rgba(127,215,255,.14); padding: 3px 0; }
.kv > div span { color: var(--muted); font-size: 11px; letter-spacing: .04em; }
.kv > div b { font-family: var(--font-mono); font-weight: 400; font-size: 12px; text-align: right; white-space: nowrap; }
.kv.small > div b { font-size: 11px; }

.loc-btn {
  margin-top: 10px; width: 100%;
  display: flex; align-items: center; gap: 10px;
  background: rgba(127,215,255,.06); border: 1px solid var(--line);
  color: var(--text); font-family: inherit; padding: 8px 10px; cursor: pointer; text-align: left;
  transition: background .2s, border-color .2s;
}
.loc-btn:hover { background: rgba(127,215,255,.12); border-color: var(--line-strong); }
.loc-icon { color: var(--gold); font-size: 18px; }
.loc-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.loc-text b { font-weight: 600; font-size: 13px; letter-spacing: .04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.loc-text small { font-family: var(--font-mono); color: var(--muted); font-size: 10.5px; }
.loc-edit { font-size: 10px; letter-spacing: .15em; text-transform: uppercase; color: var(--cyan-dim); }

/* moon */
.moon-row { display: flex; gap: 12px; align-items: center; }
#moon-canvas { width: 104px; height: 104px; flex-shrink: 0; filter: drop-shadow(0 0 10px rgba(255,255,255,.25)); }
.moon-kv { flex: 1; }
.next-phases { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0 8px; }
.np { display: flex; gap: 8px; align-items: center; border: 1px solid var(--line); padding: 7px 9px; background: rgba(127,215,255,.04); }
.np-ico { font-size: 18px; line-height: 1; }
.np-new .np-ico { color: #556; }
.np-full .np-ico { color: #fff; text-shadow: 0 0 8px #fff; }
.np > div { display: flex; flex-direction: column; min-width: 0; }
.np span { font-size: 10px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.np b { font-family: var(--font-mono); font-weight: 500; font-size: 12px; white-space: nowrap; }
.np small { font-family: var(--font-mono); color: var(--gold); font-size: 10.5px; }

.list { list-style: none; margin: 6px 0 0; padding: 0; }
.list li { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; border-bottom: 1px dotted rgba(127,215,255,.14); font-size: 12px; }
.list li:last-child { border-bottom: 0; }
.list li .l { color: var(--text); display: flex; gap: 8px; align-items: center; min-width: 0; }
.list li .r { font-family: var(--font-mono); color: var(--muted); white-space: nowrap; font-size: 11.5px; text-align: right; }
.list li .r b { color: var(--text); font-weight: 400; }
.list li.now .r, .list li.now .l { color: var(--gold); }
.list li .l { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list li .r { flex-shrink: 0; display: flex; flex-direction: column; align-items: flex-end; line-height: 1.3; }
.list li .r small { color: var(--gold); font-size: 10.5px; }
.list li .r small + small { color: var(--muted); }
.retro-list li { flex-direction: column; gap: 2px; align-items: stretch; padding: 6px 0; }
.retro-list li .r { display: block; text-align: left; padding-left: 24px; white-space: normal; }
.list .tag { font-size: 10px; padding: 1px 5px; border: 1px solid var(--line); color: var(--cyan); letter-spacing: .08em; text-transform: uppercase; }
.list .tag.retro { color: var(--red); border-color: rgba(255,107,107,.5); }
.list .tag.direct { color: var(--green); border-color: rgba(142,230,165,.4); }
.list .tag.station { color: var(--gold); border-color: rgba(245,197,107,.5); }

#panel-situation .kv > div { flex-wrap: wrap; }
#panel-situation .kv > div b { white-space: normal; min-width: 0; }
#sit-hour small { margin-left: 5px; opacity: .65; font-size: 10.5px; }

/* толкование */
.reading-lead { font-size: 11.5px; letter-spacing: .04em; color: var(--cyan); margin-bottom: 6px; }
.reading-list li { display: block; padding: 6px 0; font-size: 12px; line-height: 1.5; color: var(--text); border-bottom: 1px dotted rgba(127,215,255,.12); }
.reading-list li:last-child { border-bottom: 0; }
.reading-list .qt { display: block; margin-top: 5px; padding-left: 8px; border-left: 1px solid rgba(224,160,74,.45); font-size: 11px; line-height: 1.45; font-style: italic; color: rgba(224,160,74,.85); }
.reading-list .qt-src { display: block; margin-top: 2px; font-style: normal; font-size: 9.5px; letter-spacing: .04em; color: var(--muted); }
.qt-tr { opacity: .75; }
.qt-tr::before { content: ' · '; }
.reading-list .qt-src a { color: inherit; text-decoration: none; border-bottom: 1px dotted currentColor; }
.reading-list .qt-src a:hover { color: var(--cyan); }
#reading-note { margin: 8px 0 0; font-size: 10.5px; line-height: 1.4; color: var(--muted); }
#panel-reading .body { max-height: 46vh; overflow-y: auto; scrollbar-gutter: stable; }

/* колонка дома и метка достоинства планеты */
table.planets td.hs { white-space: nowrap; font-family: var(--font-mono); font-size: 10.5px; }
table.planets td.hs .hn { color: var(--text); opacity: .85; }
table.planets td.hs .dg { margin-left: 4px; padding: 0 3px; border: 1px solid currentColor; border-radius: 2px; font-size: 9px; letter-spacing: .04em; opacity: .9; }
table.planets td.hs .dg.domicile, table.planets td.hs .dg.exalt { color: var(--green); }
table.planets td.hs .dg.detriment, table.planets td.hs .dg.fall { color: var(--red); }
@media (max-width: 560px) { table.planets td.hs .dg { display: none; } }

/* toolbar: справа место под кнопку «открыть/скрыть» */
.toolbar { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; margin-right: 38px; }

/* Кнопка «открыть/скрыть всё» и номер версии */
#btn-ui {
  position: fixed; top: 14px; right: 14px; z-index: 5; width: 30px; height: 30px;
  display: grid; place-items: center; padding: 0; cursor: pointer;
  background: var(--panel); border: 1px solid var(--line-strong); backdrop-filter: blur(8px);
  transition: border-color .2s, box-shadow .2s;
}
#btn-ui:hover { border-color: var(--cyan); box-shadow: inset 0 0 12px rgba(127,215,255,.15); }
/* Пока интерфейс свёрнут, кнопка медленно дышит: подсказка, что здесь есть что открыть */
@keyframes ui-breathe {
  0%, 100% { border-color: var(--line-strong); box-shadow: 0 0 0 rgba(127,215,255,0); }
  50% { border-color: var(--cyan); box-shadow: 0 0 12px rgba(127,215,255,.35), inset 0 0 12px rgba(127,215,255,.18); }
}
body:not(.ui-open) #btn-ui { animation: ui-breathe 3.2s ease-in-out infinite; }
body:not(.ui-open) #btn-ui:hover { animation: none; }
@media (prefers-reduced-motion: reduce) { body:not(.ui-open) #btn-ui { animation: none; } }
#btn-ui i {
  width: 9px; height: 9px; margin-top: -5px;
  border-right: 1.5px solid var(--cyan); border-bottom: 1.5px solid var(--cyan);
  transform: rotate(45deg); transition: transform .25s, margin .25s;
}
body.ui-open #btn-ui i { transform: rotate(-135deg); margin-top: 5px; }
#hud .col, #hud .timebar, #views { transition: opacity .25s, transform .25s; }
body:not(.ui-open) #hud .col, body:not(.ui-open) #hud .timebar, body:not(.ui-open) #views {
  opacity: 0; pointer-events: none; transform: translateY(-8px);
}
body:not(.ui-open) #hud .col * , body:not(.ui-open) #hud .timebar * { pointer-events: none; }
#version {
  position: fixed; left: 12px; bottom: 7px; z-index: 3;
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .06em;
  color: rgba(200, 225, 245, .34); pointer-events: none; user-select: none;
  text-shadow: 0 0 6px #000, 0 0 3px #000;
}
/* сворачивание полосы времени: остаётся одна строка кнопок */
.tbtn.fold { padding-left: 9px; padding-right: 9px; }
.tbtn.fold .chev { display: block; width: 7px; height: 7px; border-right: 1px solid var(--cyan-dim); border-bottom: 1px solid var(--cyan-dim); transform: rotate(-135deg); margin-top: 3px; transition: transform .25s, margin .25s; }
.timebar.collapsed .tbtn.fold .chev { transform: rotate(45deg); margin-top: -3px; }
.timebar.collapsed .slider-row { display: none; }
.tb {
  background: var(--panel); border: 1px solid var(--line); color: var(--muted);
  font-family: inherit; font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  padding: 6px 10px; cursor: pointer; backdrop-filter: blur(8px);
  transition: all .2s;
}
.tb:hover { border-color: var(--line-strong); color: var(--text); }
.tb.on { color: var(--cyan); border-color: var(--line-strong); box-shadow: inset 0 0 12px rgba(127,215,255,.12); }
select.tb { appearance: none; -webkit-appearance: none; padding-right: 18px; background-image: linear-gradient(45deg, transparent 50%, var(--cyan-dim) 50%), linear-gradient(135deg, var(--cyan-dim) 50%, transparent 50%); background-position: calc(100% - 10px) 50%, calc(100% - 6px) 50%; background-size: 4px 4px; background-repeat: no-repeat; color: var(--cyan); cursor: pointer; }
select.tb option { background: #061018; color: var(--text); }
.modal label > span { display: block; }

/* planets table */
table.planets { width: 100%; border-collapse: collapse; font-size: 12px; }
table.planets th { font-weight: 500; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); text-align: left; padding: 0 4px 6px; border-bottom: 1px solid var(--line); }
table.planets td { padding: 4px 4px; border-bottom: 1px dotted rgba(127,215,255,.12); white-space: nowrap; font-family: var(--font-mono); font-size: 11.5px; }
table.planets tr { cursor: pointer; transition: background .15s; }
table.planets tbody tr:hover, table.planets tbody tr.sel { background: rgba(127,215,255,.08); }
table.planets td.g { font-family: var(--font-ui); font-size: 16px; width: 22px; text-align: center; }
table.planets td.n { font-family: var(--font-ui); font-weight: 600; letter-spacing: .04em; }
table.planets td.n .rx { color: var(--red); font-weight: 700; margin-left: 4px; }
table.planets td.pos .sg { font-family: var(--font-ui); font-size: 14px; margin-right: 3px; }
table.planets tr.below td { opacity: .55; }
table.planets td.alt .up { color: var(--green); }
table.planets td.alt .dn { color: var(--muted); }
.planet-detail { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); font-size: 12px; display: none; }
.planet-detail.show { display: block; }
.planet-detail h3 { margin: 0 0 6px; font-size: 13px; font-weight: 600; letter-spacing: .08em; color: var(--gold); }
.planet-detail .kv > div span { font-size: 10.5px; }

.aspects-list li .l .asp { font-size: 15px; width: 20px; text-align: center; }
.aspects-list li .l .g { font-size: 15px; }

/* timebar */
.timebar { padding: 10px 14px 12px; }
.tb-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tbtn {
  background: transparent; border: 1px solid var(--line); color: var(--cyan);
  font-family: var(--font-mono); font-size: 12px; padding: 6px 10px; cursor: pointer; transition: all .15s;
}
.tbtn:hover { border-color: var(--line-strong); background: rgba(127,215,255,.08); }
.tbtn.play { min-width: 44px; font-size: 13px; color: #fff; border-color: var(--line-strong); }
.tbtn.play.playing { color: var(--gold); border-color: rgba(245,197,107,.6); box-shadow: inset 0 0 14px rgba(245,197,107,.12); }
.tbtn.now { letter-spacing: .1em; text-transform: uppercase; font-family: var(--font-ui); font-weight: 600; }
.tbtn.now.live { color: var(--green); border-color: rgba(142,230,165,.5); }
.timebar select, .timebar input[type=datetime-local], .modal select, .modal input {
  background: rgba(0,0,0,.4); border: 1px solid var(--line); color: var(--text);
  font-family: var(--font-mono); font-size: 12px; padding: 5px 8px; outline: none;
  color-scheme: dark;
}
.timebar select:focus, .timebar input:focus, .modal select:focus, .modal input:focus { border-color: var(--line-strong); }
#dt-input { margin-left: auto; }
.slider-row { margin-top: 8px; }
.slider-lbl { font-family: var(--font-mono); font-size: 10.5px; color: var(--muted); white-space: nowrap; min-width: 92px; }
.slider-lbl:last-child { text-align: right; }
#slider { flex: 1; -webkit-appearance: none; appearance: none; height: 18px; background: transparent; cursor: pointer; }
#slider::-webkit-slider-runnable-track { height: 1px; background: linear-gradient(90deg, transparent, var(--line-strong) 20%, var(--line-strong) 80%, transparent); }
#slider::-moz-range-track { height: 1px; background: var(--line-strong); }
#slider::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; margin-top: -6px; border-radius: 50%; background: #000; border: 1px solid var(--gold); box-shadow: 0 0 10px var(--gold); }
#slider::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: #000; border: 1px solid var(--gold); box-shadow: 0 0 10px var(--gold); }

/* modal */
.modal { position: fixed; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.45); }
.modal[hidden] { display: none; }
/* окно места: подложка пропускает клики к глобусу, само окно — над панелью времени */
#modal-location { pointer-events: none; background: transparent; justify-content: flex-start; align-items: center; padding-left: 368px; }
#modal-location .modal-box { pointer-events: auto; width: 330px; box-shadow: 0 0 40px rgba(0,0,0,.6); }
@media (max-width: 1180px) { #modal-location { padding-left: 328px; } }
@media (max-width: 900px) { #modal-location { justify-content: center; padding-left: 0; pointer-events: auto; background: rgba(0,0,0,.45); } }

/* окно места: режим выбора прямо на карте */
#modal-location:not(.map-mode) .only-map { display: none; }
#modal-location.map-mode .only-normal { display: none; }
#modal-location.map-mode { justify-content: center; align-items: flex-end; padding-left: 0; padding-bottom: 118px; }
#modal-location.map-mode .modal-box { width: 420px; }
.loc-live { font-family: var(--font-mono); font-size: 14px; color: var(--gold); text-align: center; padding: 2px 0 12px; }
.loc-live b { display: block; font-family: var(--font-ui); font-size: 13px; color: var(--text); font-weight: 600; }
@media (max-width: 900px) { #modal-location.map-mode { padding-bottom: 150px; } }

.modal-box { width: 380px; max-width: calc(100vw - 28px); max-height: calc(100vh - 28px); display: flex; flex-direction: column; }
.modal-box .body { overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; scrollbar-color: rgba(127,215,255,.3) transparent; }
.modal-box .body::-webkit-scrollbar { width: 6px; }
.modal-box .body::-webkit-scrollbar-thumb { background: rgba(127,215,255,.3); }
.modal-box.wide { width: 560px; }
.modal-box.welcome { width: 440px; }
.welcome .lead { margin: 0 0 10px; font-size: 13px; line-height: 1.5; }
.welcome .guess { margin: 0 0 14px; font-size: 13px; line-height: 1.5; color: var(--cyan); }
.welcome .guess b { color: var(--gold); font-weight: 600; }
.welcome .choices { display: grid; gap: 8px; }
.modal-box header { cursor: default; }
.modal-box .close { margin-left: auto; background: none; border: 0; color: var(--muted); font-size: 14px; cursor: pointer; }
.modal-box .close:hover { color: #fff; }
/* пока открыто окно, кнопка «открыть интерфейс» не должна перекрывать его крестик */
body:has(.modal:not([hidden])) #btn-ui { visibility: hidden; }
.modal label { display: flex; flex-direction: column; gap: 4px; font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.modal label input, .modal label select { width: 100%; font-size: 13px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn { background: rgba(127,215,255,.14); border: 1px solid var(--line-strong); color: #fff; font-family: inherit; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; font-size: 11px; padding: 9px 10px; cursor: pointer; }
.btn:hover { background: rgba(127,215,255,.24); }
.btn.ghost { background: transparent; color: var(--cyan); }
.note { font-size: 11px; color: var(--muted); margin: 12px 0 0; line-height: 1.5; }
.help p { margin: 0 0 9px; line-height: 1.55; font-size: 12.5px; }
.help b { color: var(--cyan); font-weight: 600; }
/* подпись автора и связь в конце справки */
.help-credit { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 0 12px 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.help-credit > span:first-child { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.help-credit b { color: var(--text); font-weight: 600; }
.help-credit { flex-wrap: wrap; }
.help-mail { display: flex; align-items: center; gap: 12px; }
.help-mail .mail { font-family: var(--font-mono); font-size: 12.5px; letter-spacing: .02em; text-transform: none; color: var(--text); text-decoration: none; user-select: all; }
.help-mail a.mail[href] { border-bottom: 1px dotted var(--muted); }
.help-credit .btn { padding: 7px 16px; min-width: 92px; }

/* 3D labels */
.lbl { font-family: var(--font-ui); pointer-events: none; white-space: nowrap; user-select: none; }
/* подпись висит под телом; сдвиг по вертикали ставится покадрово из сцены */
.lbl-planet {
  pointer-events: none;
  display: flex; align-items: center; gap: 6px;
  padding: 2px 8px 3px;
  border-top: 1px solid currentColor;
  background: rgba(0, 0, 0, .55);
  font-size: 12px; letter-spacing: .06em;
  transition: opacity .3s;
}
.lbl-planet .g { font-size: 15px; line-height: 1; }
.lbl-planet .nm { font-weight: 600; color: #fff; }
.lbl-planet .ps { font-family: var(--font-mono); font-size: 10.5px; color: var(--muted); }
.lbl-planet .rx { color: var(--red); font-weight: 700; }
.lbl-planet.below { opacity: .45; }
.lbl-planet.sel .nm { color: var(--gold); }
.lbl-planet.hover { background: rgba(0,0,0,.7); }
.lbl-zodiac { font-size: 18px; text-align: center; opacity: .95; }
.lbl-zodiac small { display: block; font-size: 9px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); text-shadow: none; }
.lbl-card { font-size: 12px; font-weight: 700; letter-spacing: .2em; color: var(--ochre); text-shadow: 0 0 8px rgba(224,160,74,.6); }
.lbl-star { font-size: 10px; letter-spacing: .1em; color: rgba(220,235,255,.65); transform: translate(8px, -10px); }
.lbl-const { font-size: 9px; letter-spacing: .2em; text-transform: uppercase; color: rgba(127,215,255,.38); text-shadow: 0 0 6px #000; }
.lbl-const.zod { font-size: 10px; color: rgba(191,234,255,.75); }
.lbl-trad { font-size: 11px; opacity: .55; text-shadow: 0 0 5px #000; }
.lbl-exalt { font-size: 10px; opacity: .8; text-shadow: 0 0 5px #000; }
.lbl-tiny { font-size: 9px; letter-spacing: .18em; text-transform: uppercase; color: var(--cyan-dim); }
.lbl-sun { font-size: 12px; letter-spacing: .1em; color: var(--gold); padding: 2px 8px 3px; border-top: 1px solid currentColor; background: rgba(0, 0, 0, .55); }
/* плашка местного времени над выбранным городом */
.lbl-citytime { display: flex; flex-direction: column; align-items: center; gap: 1px; transform: translateY(-9px);
  padding: 5px 10px 6px; background: rgba(4, 10, 18, .88); border: 1px solid rgba(224,160,74,.7);
  color: var(--text); white-space: nowrap; pointer-events: none; }
.lbl-citytime::after { content: ''; position: absolute; left: 50%; bottom: -5px; width: 8px; height: 8px; margin-left: -4px;
  background: rgba(4, 10, 18, .95); border-right: 1px solid rgba(224,160,74,.7); border-bottom: 1px solid rgba(224,160,74,.7); transform: rotate(45deg); }
.lbl-citytime b { font-size: 10px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--ochre); }
.lbl-citytime .ct-time { font-family: var(--font-mono); font-size: 20px; line-height: 1.1; color: #fff; }
.lbl-citytime small { font-family: var(--font-mono); font-size: 9.5px; color: var(--muted); }
.lbl-city { font-size: 9px; letter-spacing: .08em; color: rgba(245,197,107,.8); transform: translate(6px, -10px); text-shadow: 0 0 4px #000, 0 0 2px #000; }
.lbl-here { font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: var(--ochre); transform: translate(10px, -14px); }

#views {
  position: fixed; right: 12px; bottom: 7px; z-index: 3;
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .06em;
  color: rgba(200, 225, 245, .34); pointer-events: none; user-select: none;
  text-shadow: 0 0 6px #000, 0 0 3px #000;
}
#views b { font-weight: 400; color: var(--cyan-dim); }
/* на узких окнах угол занят панелью времени */
@media (max-width: 1100px) { #views { display: none; } }

#toast {
  position: fixed; left: 50%; bottom: 120px; transform: translateX(-50%);
  background: rgba(0,0,0,.8); border: 1px solid var(--line-strong); color: var(--text);
  padding: 8px 16px; font-size: 12px; letter-spacing: .06em; z-index: 40; pointer-events: none;
}

/* responsive */
@media (max-width: 1180px) {
  #hud { grid-template-columns: 300px 1fr 340px; }
}
@media (max-width: 900px) {
  /* Телефон: панели идут одной колонкой и прокручиваются целиком,
     а не каждая внутри себя. Кнопка открытия остаётся на месте. */
  #hud { display: block; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 8px 8px 16px; gap: 0; }
  body.ui-open #hud { pointer-events: auto; }
  .col, .col-left, .col-right { display: block; overflow: visible; max-height: none; padding-right: 0; }
  .col > .panel, .toolbar { margin-bottom: 8px; }
  .panel.collapsed + .panel.collapsed { margin-top: -9px; }
  .timebar { width: 100%; padding: 8px 10px 10px; }
  .toolbar { justify-content: flex-start; }
  #dt-input { margin-left: 0; }

  /* Компактная шапка: одна строка с часами и местом, чтобы глобус был виден */
  .brand-panel header { padding: 7px 46px 2px 10px; }   /* справа место под кнопку открытия */
  .brand-panel .body { padding: 0 10px 7px; }
  .brand-name { font-size: 15px; letter-spacing: .24em; }
  .brand-sub { display: none; }
  .brand-panel .body > .kv { display: none; }
  .toolbar { margin-right: 38px; }
  body.ui-open #version { display: none; }
  .clock { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 4px 0 0; }
  .clock-time { font-size: 20px; }
  .clock-date { font-size: 10.5px; margin: 0; }
  .loc-btn { margin-top: 6px; padding: 5px 8px; }
  .loc-text b { font-size: 12px; }
  .loc-edit { font-size: 9px; }

  .panel header { padding: 7px 10px; }
  .panel header h2 { font-size: 11px; letter-spacing: .16em; }
  .panel header .hint { font-size: 10px; }
  .panel .body { padding: 8px 10px 10px; max-height: none; overflow: visible; }
  #panel-reading .body { max-height: none; overflow: visible; }
  /* окна справки и выбора места — исключение: у них свой скролл внутри, подвал остаётся на экране */
  .modal-box .body { overflow-y: auto; min-height: 0; }
  .tb { padding: 5px 7px; font-size: 10px; letter-spacing: .06em; }
  .tbtn { padding: 6px 9px; }
  .timebar select, .timebar input[type=datetime-local] { font-size: 11px; padding: 4px 6px; }
  .slider-lbl { min-width: 0; font-size: 10px; }
  #moon-canvas { width: 78px; height: 78px; }
  table.planets td, table.planets th { font-size: 10.5px; padding: 3px 2px; }
  .modal-box, .modal-box.wide { width: calc(100vw - 20px); }
}
@media (max-width: 560px) {
  .col-right { max-height: none; }
  .panel .body { max-height: none; }    /* телефон: прокручивается вся колонка, а не панель */
  table.planets td.alt { display: none; }
  table.planets th:nth-child(4) { display: none; }
}
