/* 3D-модель ИАС: тёмное стекло поверх сцены. */

#ias3d {
  position: relative; width: 100%; height: min(78vh, 820px); min-height: 520px; overflow: hidden; border-radius: 18px;
  border: 1px solid rgba(150, 190, 240, 0.14);
  background: radial-gradient(ellipse at 50% 30%, #071624 0%, #02060b 70%);
  color: #d8ecf5; font-family: 'Onest', system-ui, sans-serif;
  user-select: none;
}
#ias3d canvas { display: block; }
.m3-labels-layer { position: absolute; inset: 0; pointer-events: none; }

.m3-panel {
  position: absolute; z-index: 10; background: rgba(6, 16, 26, .72);
  border: 1px solid rgba(110, 200, 255, .16); border-radius: 12px;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 10px 40px rgba(0, 0, 0, .45); padding: 14px 16px;
}
.m3-top { left: 16px; top: 16px; width: 290px; }
.m3-title { font-size: 22px; font-weight: 700; letter-spacing: .04em; color: #eaf8ff; }
.m3-title span { color: #46e0ff; text-shadow: 0 0 14px rgba(70, 224, 255, .7); }
.m3-sub { font-size: 11.5px; color: #7fa3b5; margin: 2px 0 10px; line-height: 1.35; }
.m3-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; font-size: 12.5px; color: #9cc0d0; }
.m3-seg { display: inline-flex; border: 1px solid rgba(110, 200, 255, .25); border-radius: 8px; overflow: hidden; }
.m3-seg button, .m3-play {
  background: transparent; color: #bfe3f2; border: 0; padding: 6px 12px; font: inherit; font-size: 13px; cursor: pointer;
}
.m3-seg button + button { border-left: 1px solid rgba(110, 200, 255, .25); }
.m3-seg button.on { background: rgba(70, 224, 255, .18); color: #fff; box-shadow: inset 0 0 12px rgba(70, 224, 255, .25); }
.m3-seg button:hover, .m3-play:hover { color: #fff; }
.m3-play { border: 1px solid rgba(255, 179, 71, .45); border-radius: 8px; color: #ffcf8a; }
.m3-toggles { display: grid; grid-template-columns: 1fr 1fr; gap: 3px 10px; font-size: 12.5px; color: #9cc0d0; margin: 4px 0 8px; }
.m3-toggles input, .m3-colorby input { accent-color: #46e0ff; vertical-align: -2px; }
.m3-colorby label { margin-right: 6px; }
.m3-search {
  width: 100%; margin-top: 2px; background: rgba(0, 0, 0, .35); border: 1px solid rgba(110, 200, 255, .22);
  color: #e8f6ff; border-radius: 8px; padding: 7px 10px; font: inherit; font-size: 13px;
}
.m3-search::placeholder { color: #5f8394; }

.m3-stats { right: 16px; top: 16px; min-width: 210px; font-size: 12.5px; color: #9cc0d0; }
.m3-stats b { color: #eaf8ff; font-size: 20px; font-weight: 700; }
.m3-stats .big { display: flex; gap: 16px; margin-bottom: 4px; }
.m3-stats .big div span { display: block; font-size: 11px; color: #6f95a6; }
.m3-stats .ed { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #46e0ff; margin-bottom: 6px; }

.m3-legend { left: 16px; bottom: 40px; font-size: 12px; color: #a9cad8; max-width: 290px; padding: 10px 14px; }
.m3-legend .it { display: flex; align-items: center; gap: 8px; margin: 2px 0; cursor: default; }
.m3-legend .dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.m3-legend .n { margin-left: auto; color: #e8f6ff; font-variant-numeric: tabular-nums; }
.m3-legend .head { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #6f95a6; margin-bottom: 4px; }
.m3-legend .sep { height: 1px; background: rgba(110, 200, 255, .15); margin: 6px 0; }

.m3-side { right: 16px; top: 150px; width: 340px; max-height: calc(100% - 210px); overflow: auto; font-size: 13px; }
.m3-side h3 { margin: 0 0 2px; font-size: 16px; color: #eaf8ff; }
.m3-side .code { color: #6f95a6; font-size: 12px; }
.m3-side .close { position: absolute; right: 10px; top: 8px; background: none; border: 0; color: #7fa3b5; font-size: 18px; cursor: pointer; }
.m3-side table { width: 100%; border-collapse: collapse; margin-top: 8px; background: none; }
.m3-side td { padding: 4px 4px; border-bottom: 1px solid rgba(110, 200, 255, .08); vertical-align: top; color: #cfe6f0; background: none; }
.m3-side td.r { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.m3-side .who { color: #8fb6c7; font-size: 12px; }
.m3-side .vac { color: #ff9ecf; }
.m3-side a { color: #46e0ff; }
.m3-side .kv { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; margin-top: 8px; }
.m3-side .kv span { color: #6f95a6; }
.m3-side .pill { display: inline-block; padding: 2px 9px; border-radius: 10px; font-size: 12px; font-weight: 600; margin-top: 6px; }
.m3-side .nums { display: flex; gap: 14px; margin: 8px 0 2px; }
.m3-side .nums div { font-size: 11px; color: #6f95a6; }
.m3-side .nums b { display: block; font-size: 18px; color: #eaf8ff; }

.m3-tip {
  position: absolute; z-index: 20; pointer-events: none; background: rgba(4, 12, 20, .9); color: #e8f6ff;
  border: 1px solid rgba(110, 200, 255, .3); border-radius: 8px; padding: 7px 10px; font-size: 12.5px; max-width: 340px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .5); line-height: 1.4;
}
.m3-tip .t { font-weight: 600; }
.m3-tip .s { color: #8fb6c7; font-size: 11.5px; }

.m3-hint { position: absolute; right: 16px; bottom: 10px; font-size: 11.5px; color: #557688; z-index: 10; }
.m3-hint a { color: #46e0ff; }

.m3-lbl {
  color: #e8f6ff; font-size: 12px; font-weight: 600; white-space: nowrap; text-shadow: 0 0 6px #000, 0 0 2px #000;
  transform: translateY(-16px); transition: opacity .3s; max-width: 220px; overflow: hidden; text-overflow: ellipsis;
}
.m3-lbl.base { font-size: 15px; letter-spacing: .02em; }
.m3-lbl.base small { display: block; font-size: 11px; font-weight: 400; color: #9cc0d0; text-align: center; }
.m3-lbl.root { font-size: 15px; color: #fff3c4; }
.m3-lbl.l2 { font-size: 11px; font-weight: 500; color: #bfe3f2; }

.m3-loading { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 14px; align-items: center; justify-content: center;
  color: #7fa3b5; font-size: 14px; z-index: 40; background: #02060b; transition: opacity .8s; }
.m3-spinner { width: 42px; height: 42px; border-radius: 50%; border: 2px solid rgba(70, 224, 255, .15); border-top-color: #46e0ff; animation: m3spin 1s linear infinite; }
@keyframes m3spin { to { transform: rotate(360deg); } }

.m3-legend .toggle { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #8fb6c7; cursor: pointer; }
.m3-legend .toggle span { float: right; color: #46e0ff; }
.m3-legend .body { margin-top: 6px; max-height: calc(100vh - 520px); min-height: 120px; overflow: auto; }
.m3-legend.collapsed .body { display: none; }
@media (max-height: 760px) {
  .m3-top { padding: 10px 12px; width: 270px; }
  .m3-sub { display: none; }
  .m3-side { top: 110px; max-height: calc(100% - 150px); }
}

/* Версия для сайта: подсказка «щёлкните, чтобы приблизить», на телефоне — меньше панелей. */
.m3-arm { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 12; pointer-events: none;
  font-size: 12.5px; color: #cfe6f0; background: rgba(6, 16, 26, .78); border: 1px solid rgba(110, 200, 255, .25);
  border-radius: 999px; padding: 6px 14px; transition: opacity .3s; }
#ias3d.is-armed .m3-arm { opacity: 0; }
@media (max-width: 760px) {
  #ias3d { height: 82vh; min-height: 560px; }
  .m3-top { left: 10px; right: 10px; top: 10px; width: auto; padding: 10px 12px; }
  .m3-top .m3-toggles, .m3-top .m3-colorby, .m3-top .m3-search, .m3-sub, .m3-stats, .m3-legend, .m3-hint { display: none; }
  .m3-side { left: 10px; right: 10px; top: auto; bottom: 10px; width: auto; max-height: 45%; }
}
