/* Комсомольск растёт: стили страницы с 3D-картой. Всё под префиксом .kg3d, чтобы не пересекаться с темой. */
.kg3d { --k-bg: #0a111d; --k-panel: rgba(16, 25, 40, .86); --k-line: #2a3a55; --k-fg: #e8eef8; --k-muted: #93a4bf; --k-accent: #ffb85c; --k-ink: #1b1204; margin: 0 0 18px; }
.kg3d *, .kg3d *::before, .kg3d *::after { box-sizing: border-box; }
.kg3d__stage {
  position: relative; width: 100%; height: min(76vh, 820px); min-height: 480px; overflow: hidden; border-radius: 12px;
  background: var(--k-bg); color: var(--k-fg); font-size: 14px; line-height: 1.45; outline-offset: 2px;
}
.kg3d__stage:fullscreen { height: 100vh; border-radius: 0; }
.kg3d__stage:-webkit-full-screen { height: 100vh; border-radius: 0; }
.kg3d__stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
.kg3d__stage canvas:active { cursor: grabbing; }
.kg3d__loading { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; text-align: center; color: var(--k-muted); font-size: 15px; pointer-events: none; }
.kg3d__loading[hidden], .kg3d__note[hidden], .kg3d__lm[hidden], .kg3d [hidden] { display: none !important; }

.kg3d__tools { position: absolute; top: 10px; right: 10px; display: flex; gap: 8px; }
.kg3d button { font: inherit; line-height: 1; margin: 0; text-transform: none; letter-spacing: normal; }
.kg3d__chip {
  border: 1px solid var(--k-line); background: var(--k-panel); color: var(--k-muted); font-size: 12px; font-weight: 500;
  padding: 8px 10px; border-radius: 8px; cursor: pointer; backdrop-filter: blur(8px); box-shadow: none;
}
.kg3d__chip:hover, .kg3d__chip[aria-expanded="true"] { color: var(--k-fg); border-color: #3d5278; background: var(--k-panel); }
.kg3d__note {
  position: absolute; right: 10px; top: 50px; width: min(360px, calc(100% - 20px)); max-height: calc(100% - 200px); overflow: auto;
  background: var(--k-panel); border: 1px solid var(--k-line); border-radius: 10px; padding: 12px 14px; font-size: 13px; color: var(--k-muted); backdrop-filter: blur(10px);
}
.kg3d__note b { color: var(--k-fg); font-weight: 600; }
.kg3d__note p { margin: 0 0 8px; } .kg3d__note p:last-child { margin: 0; }

.kg3d__panel {
  position: absolute; left: 10px; right: 10px; bottom: 10px; background: var(--k-panel); border: 1px solid var(--k-line); border-radius: 12px;
  padding: 12px 14px 10px; backdrop-filter: blur(12px); display: grid; gap: 8px 16px; grid-template-columns: auto 1fr auto; align-items: center;
}
.kg3d__panel > * { min-width: 0; }
.kg3d__year { font-size: clamp(28px, 6vw, 42px); font-weight: 700; line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; min-width: 4ch; }
.kg3d__year small { display: block; font-size: 12px; font-weight: 500; line-height: 1.3; color: var(--k-muted); letter-spacing: 0; margin-top: 6px; }
.kg3d input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 26px; margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.kg3d input[type=range]::-webkit-slider-runnable-track { height: 4px; background: #2f4166; border-radius: 2px; }
.kg3d input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: var(--k-accent); border: 0; margin-top: -7px; }
.kg3d input[type=range]::-moz-range-track { height: 4px; background: #2f4166; border-radius: 2px; border: 0; }
.kg3d input[type=range]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--k-accent); border: 0; }
.kg3d__more { display: none; }
.kg3d--nopanel .kg3d__panel { display: none; }
.kg3d__ticks { display: flex; justify-content: space-between; color: var(--k-muted); font-size: 11px; font-variant-numeric: tabular-nums; padding: 0 2px; }
.kg3d__ctl { display: flex; gap: 8px; align-items: center; }
.kg3d__play { border: 0; background: var(--k-accent); color: var(--k-ink); font-weight: 600; font-size: 14px; padding: 12px 16px; border-radius: 10px; cursor: pointer; white-space: nowrap; box-shadow: none; }
.kg3d__play:hover { filter: brightness(1.08); background: var(--k-accent); color: var(--k-ink); }
.kg3d__speed { display: inline-flex; border: 1px solid var(--k-line); border-radius: 8px; overflow: hidden; }
.kg3d__speed button { background: transparent; color: var(--k-muted); border: 0; padding: 9px 10px; font-size: 12px; font-weight: 500; cursor: pointer; box-shadow: none; border-radius: 0; }
.kg3d__speed button[aria-pressed="true"] { background: #243452; color: var(--k-fg); }
.kg3d__legend { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--k-muted); font-size: 12px; align-items: center; }
.kg3d__legend span { display: inline-flex; align-items: center; gap: 6px; }
.kg3d__legend i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.kg3d__opt { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; color: var(--k-fg); margin: 0; font-weight: 400; }
.kg3d__opt input { accent-color: var(--k-accent); margin: 0; width: auto; height: auto; }
.kg3d__count { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--k-fg); }
.kg3d button:focus-visible, .kg3d input:focus-visible, .kg3d__stage:focus-visible { outline: 2px solid var(--k-accent); outline-offset: 2px; }

.kg3d__lm {
  position: absolute; left: 0; top: 0; pointer-events: none; white-space: nowrap; background: rgba(10, 17, 29, .88); border: 1px solid #4a3a1f;
  color: var(--k-fg); font-size: 12px; padding: 4px 8px; border-radius: 6px; will-change: transform;
}
.kg3d__lm b { color: var(--k-accent); font-weight: 600; font-variant-numeric: tabular-nums; margin-left: 6px; }

.kg3d-intro { max-width: 70ch; margin: 0 0 14px; }
.kg3d-foot { max-width: 80ch; font-size: 13px; opacity: .75; margin: 12px 0 0; }

@media (max-width: 640px) {
  .kg3d__stage { height: 72vh; min-height: 440px; }
  .kg3d__panel { grid-template-columns: auto 1fr; gap: 4px 10px; padding: 8px 10px 6px; left: 6px; right: 6px; bottom: 6px; }
  .kg3d__year { grid-row: 1; grid-column: 1; font-size: 26px; min-width: 3.6ch; }
  .kg3d__year small { font-size: 11px; margin-top: 3px; }
  .kg3d__ctl { grid-row: 1; grid-column: 2; justify-content: flex-end; }
  .kg3d__speed { display: none; }
  .kg3d__more { display: inline-block; padding: 9px 10px; }
  .kg3d__slider { grid-row: 2; grid-column: 1 / -1; }
  .kg3d__ticks { font-size: 10px; }
  .kg3d__play { padding: 10px 12px; font-size: 13px; }
  .kg3d__legend { display: none; font-size: 11px; gap: 4px 12px; }
  .kg3d--more .kg3d__legend { display: flex; }
  .kg3d__count { margin-left: 0; }
  .kg3d__chip { padding: 7px 9px; }
}
@media (prefers-reduced-motion: reduce) { .kg3d * { transition: none !important; } }
