/* iApps Maintenance Mode — orbit icons (mock «Деплой new») */
#iapps-maint {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: none;
  flex-direction: column;
  box-sizing: border-box;
  margin: 0;
  min-height: 100svh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #18233a;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  isolation: isolate;
  background: #f3f7ff;
}
#iapps-maint *,
#iapps-maint *::before,
#iapps-maint *::after { box-sizing: border-box; }
#iapps-maint.on { display: flex !important; }

html.iapps-maint-lock,
html.iapps-maint-lock body {
  overflow: hidden !important;
  touch-action: none;
  background: #f3f7ff !important;
}

/* Ambient */
#iapps-maint .m-ambient {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 3% 8%, #c8e5ff99 0, transparent 49%),
    radial-gradient(ellipse at 100% 83%, #d8ceff88 0, transparent 52%),
    linear-gradient(160deg, #f2f8ff 0%, #f9fbff 49%, #eef0ff 100%);
}
#iapps-maint .m-ambient::before {
  content: "";
  position: absolute;
  left: -55%;
  top: -32%;
  width: 140%;
  height: 85%;
  border-radius: 45%;
  background: linear-gradient(135deg, #ffffff08, #c6e0ff30);
  border: 1px solid #ffffffb3;
  box-shadow: 0 24px 60px #8ab9f00a;
  transform: rotate(-27deg);
}
#iapps-maint .m-ambient::after {
  content: "";
  position: absolute;
  right: -55%;
  bottom: -35%;
  width: 145%;
  height: 77%;
  border-radius: 44%;
  background: linear-gradient(140deg, #dce5ff33, #b9c8ff22);
  border: 1px solid #ffffffbf;
  box-shadow: 0 -20px 80px #b2b6f510;
  transform: rotate(-25deg);
}
#iapps-maint .m-ambient-wave {
  position: absolute;
  width: 150%;
  height: 70%;
  left: -83%;
  top: 32%;
  border: 1px solid #fff9;
  border-radius: 47%;
  transform: rotate(24deg);
  background: linear-gradient(130deg, #d9edff22, transparent 75%);
}
#iapps-maint .m-ambient-glow {
  position: absolute;
  width: 90vw;
  height: 90vw;
  max-width: 650px;
  max-height: 650px;
  left: 30%;
  top: 20%;
  border-radius: 50%;
  background: radial-gradient(circle, #dce3ff55, transparent 67%);
  animation: mAmbientDrift 18s ease-in-out infinite alternate;
}

#iapps-maint .m-top {
  position: relative;
  z-index: 1;
  padding: calc(18px + env(safe-area-inset-top)) 24px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 22px;
  font-weight: 750;
  letter-spacing: -0.8px;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  flex: 0 0 auto;
}
#iapps-maint .m-mark {
  width: 29px;
  height: 29px;
  border-radius: 9px;
  background: #287cf6;
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 21px;
  font-weight: 700;
  line-height: 1;
}
#iapps-maint .m-word {
  font-size: 22px;
  font-weight: 750;
  letter-spacing: -0.8px;
  line-height: 1;
}

#iapps-maint .m-mid {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  width: 100%;
  display: grid;
  place-items: center;
  padding: 8px 20px max(20px, env(safe-area-inset-bottom));
  min-height: 0;
}
#iapps-maint .m-content {
  width: 100%;
  max-width: 370px;
  text-align: center;
}

/* Orbit illustration */
#iapps-maint .m-illustration {
  position: relative;
  display: grid;
  place-items: center;
  width: min(100%, 330px);
  aspect-ratio: 1.12;
  margin: 0 auto 23px;
  isolation: isolate;
  overflow: hidden;
  perspective: 720px;
  perspective-origin: 50% 45%;
}
#iapps-maint .m-halo {
  position: absolute;
  width: 65%;
  height: 70%;
  background: #d9e6ff;
  filter: blur(34px);
  border-radius: 50%;
  z-index: -1;
  opacity: 0.42;
}
#iapps-maint .m-orbit {
  position: absolute;
  width: 88%;
  height: 89%;
  border: 1px solid #cad8f080;
  border-radius: 50%;
}
#iapps-maint .m-orbit.inner {
  width: 61%;
  height: 65%;
  border-color: #d1dcf280;
}

#iapps-maint .m-tile {
  position: absolute;
  width: 56px;
  height: 56px;
  max-width: 19%;
  max-height: 19%;
  border-radius: 24%;
  display: grid;
  place-items: center;
  background: transparent;
  overflow: hidden;
  box-shadow: none;
  /* slight lean toward camera; spin axis stays vertical (local Y) */
  transform: rotateX(14deg) translateZ(0);
  transform-style: preserve-3d;
}

#iapps-maint .m-coin {
  position: absolute;
  inset: 0;
  transform-origin: center center;
  transform-style: preserve-3d;
  will-change: transform;
  animation: mCoinTurn var(--speed, 18s) linear infinite;
  animation-delay: var(--phase, 0s);
}
#iapps-maint .m-face,
#iapps-maint .m-edge {
  position: absolute;
  inset: 0;
  border-radius: 24%;
  display: grid;
  place-items: center;
  background: var(--surface);
  transform-style: preserve-3d;
}
#iapps-maint .m-face {
  overflow: hidden;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  box-shadow: inset 0 0 0 1px #ffffff44;
}
#iapps-maint .m-face.front { transform: translateZ(1px); }
#iapps-maint .m-face.back { transform: translateZ(-9px) rotateY(180deg); }
#iapps-maint .m-edge {
  background: var(--edge);
  transform: translateZ(calc(var(--depth) * -1px));
  box-shadow: inset 0 0 0 1px #ffffff15;
}
#iapps-maint .m-face::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, #ffffff17, transparent 48%, #00000008);
  pointer-events: none;
}
#iapps-maint .m-face img {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: cover;
  display: block;
  border: 0;
}

#iapps-maint .m-tile.vk { top: 6%; left: 19%; --surface: #0077ff; --edge: #0861cd; --phase: -1s; --speed: 19s; }
#iapps-maint .m-tile.max { top: 6%; right: 19%; --surface: #fff; --edge: #d9d6ee; --phase: -4s; --speed: 21s; }
#iapps-maint .m-tile.tbank { top: 43%; left: 0; --surface: #ffdd2d; --edge: #d6b326; --phase: -7s; --speed: 20s; }
#iapps-maint .m-tile.sber { top: 43%; right: 0; --surface: #37c85c; --edge: #199b45; --phase: -12s; --speed: 22s; }
#iapps-maint .m-tile.chatgpt { bottom: 0; left: 19%; --surface: #10a37f; --edge: #0d8a6a; --phase: -15s; --speed: 23s; }
#iapps-maint .m-tile.vkmusic { bottom: 0; right: 19%; --surface: #7358f6; --edge: #6244bd; --phase: -5s; --speed: 18s; }

#iapps-maint .m-app {
  position: relative;
  width: 31%;
  aspect-ratio: 1;
  border-radius: 28%;
  background: #fff;
  box-shadow: 0 12px 30px #426bb417;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  z-index: 2;
}
#iapps-maint .m-app-word {
  font-size: 29px;
  letter-spacing: -1.5px;
  font-weight: 750;
  line-height: 1;
}
#iapps-maint .m-word-dot { color: #347df6; }
#iapps-maint .m-app-sub {
  font-size: 8px;
  color: #9aa6b8;
  line-height: 1;
}
#iapps-maint .m-update-mini {
  position: absolute;
  bottom: -7px;
  right: -6px;
  width: 30px;
  height: 30px;
  border: 3px solid #f4f7ff;
  border-radius: 50%;
  background: #397ff5;
  display: grid;
  place-items: center;
  color: #fff;
}
#iapps-maint .m-update-mini svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  animation: mRotate 6s linear infinite;
}
#iapps-maint .m-star {
  position: absolute;
  color: #b1c7f2;
  font-size: 18px;
  line-height: 1;
}
#iapps-maint .m-star.one { left: 3%; top: 20%; }
#iapps-maint .m-star.two { right: 7%; bottom: 18%; font-size: 12px; color: #bcb4ea; }
#iapps-maint .m-speck {
  position: absolute;
  width: 4px;
  height: 4px;
  top: 0;
  left: 50%;
  background: #9cbaf0;
  border-radius: 50%;
}

#iapps-maint h1 {
  font-size: clamp(34px, 10.3vw, 42px);
  line-height: 1.08;
  letter-spacing: -1.5px;
  margin: 0 0 16px;
  font-weight: 730;
}
#iapps-maint .m-blue { color: #3b7ef0; }
#iapps-maint .m-lead {
  font-size: 13px;
  line-height: 1.65;
  color: #77859e;
  margin: 0;
  font-weight: 500;
}

#iapps-maint .m-waiting {
  margin: 24px auto 0;
}
#iapps-maint .m-waiting-title {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 500;
  color: #7184a1;
}
#iapps-maint .m-dots {
  display: flex;
  gap: 3px;
}
#iapps-maint .m-dots i {
  width: 4px;
  height: 4px;
  background: #79a3eb;
  border-radius: 50%;
  animation: mPulseDot 1.5s infinite;
}
#iapps-maint .m-dots i:nth-child(2) { animation-delay: 0.2s; }
#iapps-maint .m-dots i:nth-child(3) { animation-delay: 0.4s; }

#iapps-maint .m-check {
  font: inherit;
  min-height: 44px;
  background: none;
  border: 0;
  color: #8a9bb4;
  font-size: 11px;
  padding: 12px 16px;
  cursor: pointer;
  border-radius: 12px;
  margin-top: 8px;
}
#iapps-maint .m-check:hover { background: #edf3ff; }
#iapps-maint .m-check:disabled { opacity: 0.6; cursor: default; }
#iapps-maint .m-check:focus-visible {
  outline: 3px solid #a2c2ff;
  outline-offset: 2px;
}

#iapps-maint .m-sr {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

@keyframes mRotate { to { transform: rotate(360deg); } }
@keyframes mPulseDot {
  0%, 80%, 100% { opacity: 0.3; }
  40% { opacity: 1; }
}
/* Coin flip around vertical axis only (no Z skew) */
@keyframes mCoinTurn {
  from { transform: rotateY(0deg); }
  to { transform: rotateY(360deg); }
}
@keyframes mAmbientDrift {
  from { transform: translate(-8%, -4%); }
  to { transform: translate(5%, 9%); }
}

@media (max-height: 740px) {
  #iapps-maint .m-illustration { width: min(100%, 280px); margin-bottom: 18px; }
  #iapps-maint h1 { font-size: 36px; }
  #iapps-maint .m-waiting { margin-top: 20px; }
  #iapps-maint .m-mid { padding-top: 0; padding-bottom: 10px; }
}
@media (max-height: 620px) {
  #iapps-maint .m-illustration { width: min(100%, 230px); margin-bottom: 14px; }
  #iapps-maint .m-app-word { font-size: 23px; }
  #iapps-maint .m-app-sub { font-size: 6px; }
  #iapps-maint h1 { font-size: 31px; margin-bottom: 12px; }
  #iapps-maint .m-waiting { margin-top: 16px; }
  #iapps-maint .m-top { padding-top: 14px; }
  #iapps-maint .m-lead { font-size: 12px; }
}
@media (min-width: 600px) {
  #iapps-maint .m-mid { padding: 24px 20px 32px; }
  #iapps-maint .m-illustration { width: 330px; }
  #iapps-maint .m-top { max-width: 1050px; padding: 28px 32px; }
  #iapps-maint .m-content { max-width: 390px; }
}
