/* Окно «iPhone: на экран Домой» (02.12, public/js/ios-guide.js). Телефон нарисован CSS, всё внутри экрана в cqw
   (ширина экрана = 100), чтобы макет одинаково сжимался на телефоне и компьютере. Движутся только transform и opacity.
   Цвета внутри телефона системные цвета тёмной iOS, снаружи по STYLE.md. */

.lp-dlg.iosdlg { width: min(820px, calc(100vw - 32px)); max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); overflow-y: auto; overscroll-behavior: contain; }
.iosg-lead { max-width: 62ch; }
.iosg-lead:focus { outline: none; }
.iosg { position: relative; isolation: isolate; margin-top: 16px; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 28px; align-items: center; }

/* ---------- телефон ---------- */
.iosg-ph { position: relative; width: 250px; }
.iosg-ph::before { content: ''; position: absolute; inset: -6% -28%; z-index: -1; background: radial-gradient(closest-side, rgba(var(--rgb), 0.24), transparent); pointer-events: none; }
.ip-frame { padding: 8px; border-radius: 44px; background: linear-gradient(150deg, #474c52, #16191c 38%, #24282c 70%, #3c4146); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 26px 50px -22px rgba(0, 0, 0, 0.9); }
.ip-scr {
  position: relative; container-type: inline-size; aspect-ratio: 390 / 844; border-radius: 36px; overflow: hidden; isolation: isolate;
  --ipf: -apple-system, BlinkMacSystemFont, 'SF Pro Text', system-ui, 'Montserrat', sans-serif; background: #000; color: #fff; font-family: var(--ipf); user-select: none; -webkit-user-select: none;
}
.ip-scr > * { position: absolute; }
.ip-scr.now, .ip-scr.now * { transition: none !important; animation: none !important; }
.ip-i { width: 5.4cqw; height: 5.4cqw; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.ip-i.fill { fill: currentColor; stroke: none; }

/* страница сайта: свежий скриншот приложения, под шторкой отъезжает назад */
.ip-page { inset: 0; background: #0b1012; transform-origin: 50% 0; transition: transform 0.55s var(--glide), opacity 0.5s; }
.ip-page img { position: absolute; left: 0; top: 12cqw; width: 100%; height: calc(100% - 12cqw); object-fit: cover; object-position: top; }
.ip-scr:is([data-v='sheet'], [data-v='add']) .ip-page { transform: scale(0.93) translateY(4cqw); opacity: 0.65; border-radius: 8cqw; overflow: hidden; }
.ip-dim { inset: 0; z-index: 3; background: rgba(0, 0, 0, 0.5); opacity: 0; transition: opacity 0.4s; }
.ip-scr[data-v='menu'] .ip-dim { opacity: 0.4; }
.ip-scr:is([data-v='sheet'], [data-v='add']) .ip-dim { opacity: 1; }

/* строка статуса, «остров», полоска внизу */
.ip-sb { left: 0; right: 0; top: 0; height: 12cqw; z-index: 8; display: flex; align-items: center; justify-content: space-between; padding: 1.4cqw 7.5cqw 0 11cqw; font: 600 4.1cqw/1 var(--ipf); }
.ip-sb b { font-weight: 650; letter-spacing: 0.02em; }
.ip-sbi { display: flex; align-items: center; gap: 1.4cqw; }
.ip-sbi svg { fill: #fff; }
.ip-sig { width: 4.6cqw; } .ip-wifi { width: 4.3cqw; } .ip-bat { width: 6.6cqw; }
.ip-island { top: 2.8cqw; left: 35cqw; width: 30cqw; height: 8.6cqw; border-radius: 99px; background: #000; z-index: 9; }
.ip-hbar { bottom: 1.8cqw; left: 32cqw; width: 36cqw; height: 1.3cqw; border-radius: 9px; background: rgba(255, 255, 255, 0.78); z-index: 9; }

/* нижняя панель Safari iOS 26: назад, адрес, ⋯ (меню страницы) */
.ip-bar { left: 4cqw; right: 4cqw; bottom: 5cqw; height: 13cqw; z-index: 2; display: flex; align-items: center; gap: 3cqw; }
.ip-b, .ip-url { background: linear-gradient(180deg, rgba(72, 74, 80, 0.97), rgba(36, 38, 42, 0.97)); box-shadow: inset 0 0.3cqw 0 rgba(255, 255, 255, 0.14), inset 0 0 0 0.25cqw rgba(255, 255, 255, 0.07), 0 2cqw 5cqw rgba(0, 0, 0, 0.5); }
.ip-b { width: 13cqw; height: 13cqw; flex: none; border-radius: 50%; display: grid; place-items: center; }
.ip-url { position: relative; flex: 1; min-width: 0; height: 13cqw; border-radius: 99px; display: flex; align-items: center; justify-content: center; padding: 0 7.5cqw 0 3cqw; font: 600 3.25cqw/1 var(--ipf); letter-spacing: -0.01em; }
.ip-url span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ip-url .ip-i { position: absolute; right: 3.6cqw; width: 4.2cqw; height: 4.2cqw; opacity: 0.85; }
.ip-b.hit, .ip-mi.hit, .ip-ln.hit { background: rgba(120, 120, 128, 0.6); }

/* меню страницы: «Поделиться» первым */
.ip-menu {
  right: 4cqw; bottom: 21cqw; width: 64cqw; z-index: 4; padding: 1.6cqw; border-radius: 7cqw; display: flex; flex-direction: column;
  background: rgba(40, 41, 45, 0.98); box-shadow: inset 0 0.3cqw 0 rgba(255, 255, 255, 0.1), 0 4cqw 10cqw rgba(0, 0, 0, 0.6);
  opacity: 0; transform: scale(0.35); transform-origin: 88% 112%; transition: opacity 0.22s, transform 0.42s var(--pop);
}
.ip-scr[data-v='menu'] .ip-menu { opacity: 1; transform: none; }
.ip-mi { height: 11cqw; display: flex; align-items: center; gap: 3cqw; padding: 0 3.4cqw; border-radius: 4.6cqw; font: 500 3.7cqw/1 var(--ipf); white-space: nowrap; overflow: hidden; }

/* лист «Поделиться» */
.ip-sheet { left: 0; right: 0; top: 58cqw; bottom: 0; z-index: 5; border-radius: 9cqw 9cqw 0 0; overflow: hidden; background: #1c1c1e; transform: translateY(105%); transition: transform 0.55s var(--glide); }
.ip-scr[data-v='sheet'] .ip-sheet { transform: none; }
.ip-sh-h { position: absolute; left: 4.5cqw; right: 4cqw; top: 3.5cqw; height: 13cqw; display: flex; align-items: center; gap: 3cqw; }
.ip-app { width: 11cqw; height: 11cqw; flex: none; border-radius: 2.6cqw; overflow: hidden; background: #0b1012; }
.ip-app img, .ip-new-i img { width: 100%; height: 100%; object-fit: cover; }
.ip-app.big { width: 16cqw; height: 16cqw; border-radius: 3.8cqw; }
.ip-sh-t { min-width: 0; display: flex; flex-direction: column; gap: 1.2cqw; }
.ip-sh-t b { font: 600 3.8cqw/1.1 var(--ipf); }
.ip-sh-t small, .ip-add-n small { font-size: 3cqw; color: #8e8e93; }
.ip-x { margin-left: auto; width: 8cqw; height: 8cqw; flex: none; border-radius: 50%; display: grid; place-items: center; background: #3a3a3c; color: #aeaeb2; }
.ip-x .ip-i { width: 4.4cqw; height: 4.4cqw; }
.ip-sh-clip { position: absolute; left: 0; right: 0; top: 19cqw; bottom: 0; overflow: hidden; }
.ip-scroll { padding-top: 2cqw; transition: transform 0.95s cubic-bezier(0.4, 0, 0.3, 1); }
.ip-scr[data-scroll='1'] .ip-scroll { transform: translateY(-52cqw); }
.ip-ppl, .ip-apps { height: 25cqw; display: grid; grid-template-columns: repeat(5, 1fr); padding: 0 2cqw; }
.ip-ppl span, .ip-apps span { display: flex; flex-direction: column; align-items: center; gap: 2.4cqw; padding-top: 1cqw; }
.ip-ppl i, .ip-apps i { width: 13.5cqw; height: 13.5cqw; border-radius: 50%; background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.35), transparent 60%), var(--c); }
.ip-apps i { border-radius: 3.3cqw; }
.ip-ppl em, .ip-apps em { width: 10cqw; height: 1.5cqw; border-radius: 9px; background: #48484a; }
.ip-list { margin: 4cqw 3.5cqw 0; border-radius: 4.6cqw; overflow: hidden; background: #2c2c2e; }
.ip-ln { height: 12cqw; display: flex; align-items: center; justify-content: space-between; gap: 3cqw; padding: 0 4cqw; border-top: 0.25cqw solid #3a3a3c; font: 500 3.6cqw/1 var(--ipf); }
.ip-ln:first-child { border-top: 0; }
.ip-ln span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* лист «На экран Домой»: имя, «Открыть как веб-приложение», клавиатура */
.ip-addv { left: 0; right: 0; top: 14cqw; bottom: 0; z-index: 5; border-radius: 9cqw 9cqw 0 0; overflow: hidden; background: #1c1c1e; transform: translateY(105%); transition: transform 0.55s var(--glide); }
.ip-scr[data-v='add'] .ip-addv { transform: none; }
.ip-add-h { position: absolute; left: 5cqw; right: 5cqw; top: 4cqw; height: 9cqw; display: flex; align-items: center; justify-content: space-between; gap: 2cqw; font: 400 3.7cqw/1 var(--ipf); white-space: nowrap; }
.ip-add-h span, .ip-add-ok { color: #0a84ff; }
.ip-add-h b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.ip-add-ok { font-weight: 700; padding: 2cqw 1cqw; border-radius: 3cqw; transition: opacity 0.2s; }
.ip-add-ok.hit { opacity: 0.4; }
.ip-add-card { position: absolute; left: 4cqw; right: 4cqw; top: 17cqw; height: 26cqw; border-radius: 4.6cqw; background: #2c2c2e; display: flex; align-items: center; gap: 4cqw; padding: 0 4cqw; }
.ip-add-n { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2.2cqw; }
.ip-add-n b { font: 500 4cqw/1.2 var(--ipf); padding-bottom: 2.2cqw; border-bottom: 0.25cqw solid #48484a; white-space: nowrap; }
.ip-caret { display: inline-block; width: 0.5cqw; height: 4.4cqw; margin-left: 0.4cqw; vertical-align: -0.8cqw; background: #0a84ff; animation: blink 1s steps(1) infinite; }
.ip-add-tog { position: absolute; left: 4cqw; right: 4cqw; top: 47cqw; height: 12cqw; border-radius: 4.6cqw; background: #2c2c2e; display: flex; align-items: center; justify-content: space-between; gap: 3cqw; padding: 0 3.5cqw 0 4cqw; font: 500 3.5cqw/1 var(--ipf); }
.ip-add-tog span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ip-tog { position: relative; width: 13cqw; height: 7.8cqw; flex: none; border-radius: 99px; background: #30d158; }
.ip-tog i { position: absolute; right: 0.8cqw; top: 0.8cqw; width: 6.2cqw; height: 6.2cqw; border-radius: 50%; background: #fff; box-shadow: 0 0.5cqw 1.2cqw rgba(0, 0, 0, 0.3); }
.ip-tog::after { content: ''; position: absolute; inset: -1.6cqw; border-radius: 99px; border: 0.6cqw solid rgba(48, 209, 88, 0.95); opacity: 0; }
.ip-tog.ping::after { animation: ipPing 0.85s ease-out 2; }
@keyframes ipPing { from { opacity: 1; transform: scale(0.85); } to { opacity: 0; transform: scale(1.45); } }
.ip-kb { position: absolute; left: 0; right: 0; bottom: 0; height: 72cqw; padding: 2.6cqw 1cqw 9cqw; display: flex; flex-direction: column; gap: 2.6cqw; background: #2a2a2d; }
.ip-kr { display: flex; justify-content: center; gap: 1.3cqw; }
.ip-k { flex: 1 1 0; max-width: 8.4cqw; height: 10.5cqw; border-radius: 1.6cqw; background: #5c5c60; box-shadow: 0 0.35cqw 0 rgba(0, 0, 0, 0.45); font: 400 4.4cqw/10.5cqw var(--ipf); font-style: normal; text-align: center; }
.ip-k.wide { flex: 0 0 11.5cqw; max-width: none; background: #3f3f42; font-size: 3.2cqw; }
.ip-k.space { flex: 1 1 auto; max-width: none; }

/* рабочий стол: цветные квадраты, новый значок появляется со светом */
.ip-home {
  inset: 0; z-index: 6; opacity: 0; transform: scale(1.12); transition: opacity 0.55s, transform 0.75s var(--glide);
  background: radial-gradient(75% 42% at 12% 10%, rgba(var(--rgb), 0.55), transparent 70%), radial-gradient(85% 50% at 92% 88%, rgba(155, 140, 255, 0.5), transparent 70%),
    radial-gradient(60% 34% at 74% 42%, rgba(255, 95, 168, 0.22), transparent 70%), linear-gradient(165deg, #14252f, #06080d);
}
.ip-scr[data-v='home'] .ip-home { opacity: 1; transform: none; }
.ip-grid { position: absolute; left: 4cqw; right: 4cqw; top: 19cqw; display: grid; grid-template-columns: repeat(4, 1fr); row-gap: 6cqw; justify-items: center; }
.ip-hi { position: relative; display: flex; flex-direction: column; align-items: center; gap: 1.8cqw; }
.ip-hi > i { width: 15.5cqw; height: 15.5cqw; border-radius: 3.8cqw; display: grid; place-items: center; background: linear-gradient(160deg, var(--c1), var(--c2)); box-shadow: inset 0 0.3cqw 0 rgba(255, 255, 255, 0.25); }
.ip-g { width: 8cqw; height: 8cqw; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ip-hi em { width: 11cqw; height: 1.5cqw; border-radius: 9px; background: rgba(255, 255, 255, 0.4); }
.ip-new-i { width: 15.5cqw; height: 15.5cqw; border-radius: 3.8cqw; overflow: hidden; background: #0b1012; box-shadow: 0 0 0 0.3cqw rgba(255, 255, 255, 0.22), 0 0 7cqw 1cqw rgba(var(--rgb), 0.6); }
.ip-new b { font: 600 2.9cqw/1 var(--ipf); white-space: nowrap; text-shadow: 0 0 2cqw rgba(0, 0, 0, 0.7); }
.ip-new-i, .ip-new b { opacity: 0; transform: scale(0.2); transition: opacity 0.3s, transform 0.75s var(--pop2); }
.ip-scr[data-icon='1'] .ip-new-i, .ip-scr[data-icon='1'] .ip-new b { opacity: 1; transform: none; }
.ip-ring { position: absolute; left: 50%; top: 0; width: 15.5cqw; height: 15.5cqw; margin-left: -7.75cqw; border-radius: 30%; border: 0.6cqw solid rgba(var(--rgb), 0.95); opacity: 0; text-decoration: none; }
.ip-scr[data-icon='1'] .ip-ring { animation: ipRing 1.1s 0.2s ease-out both; }
@keyframes ipRing { from { opacity: 0.95; transform: scale(0.6); } to { opacity: 0; transform: scale(2.3); } }
.ip-spark { position: absolute; left: 50%; top: 7.75cqw; font-size: 3.6cqw; line-height: 1; color: #fff; text-decoration: none; opacity: 0; text-shadow: 0 0 2cqw rgb(var(--rgb)); }
.ip-scr[data-icon='1'] .ip-spark { animation: ipSpark 1.2s 0.3s var(--glide) both; }
@keyframes ipSpark {
  0% { opacity: 0; transform: translate(-50%, -50%) rotate(var(--ang)) translateY(-3cqw) scale(0.4); }
  25% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -50%) rotate(var(--ang)) translateY(-16cqw) scale(1); }
}
.ip-dots { position: absolute; left: 0; right: 0; bottom: 28cqw; display: flex; justify-content: center; gap: 1.8cqw; }
.ip-dots i { width: 1.8cqw; height: 1.8cqw; border-radius: 50%; background: rgba(255, 255, 255, 0.35); }
.ip-dots i.on { background: #fff; }
.ip-dock { position: absolute; left: 3.5cqw; right: 3.5cqw; bottom: 4.5cqw; height: 21cqw; border-radius: 8cqw; display: flex; justify-content: space-around; align-items: center; padding: 0 2cqw; background: rgba(255, 255, 255, 0.14); box-shadow: inset 0 0.3cqw 0 rgba(255, 255, 255, 0.16); }

/* палец: светлая точка, на нажатие сжимается и пускает кольцо */
.ip-fing { left: 0; top: 0; width: 12cqw; height: 12cqw; margin: -6cqw 0 0 -6cqw; z-index: 10; pointer-events: none; opacity: 0;
  transform: translate(calc(var(--x, 54) * 1cqw), calc(var(--y, 176) * 1cqw)); transition: transform 0.7s var(--glide), opacity 0.3s; }
.ip-fing.on { opacity: 1; }
.ip-fing.slow { transition: transform 0.95s cubic-bezier(0.4, 0, 0.3, 1), opacity 0.3s; }
.ip-fing b { position: absolute; inset: 0; border-radius: 50%; transition: transform 0.16s;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.95) 0 27%, rgba(255, 255, 255, 0.55) 40%, rgba(255, 255, 255, 0.14) 58%, transparent 71%); }
.ip-fing.down b { transform: scale(0.78); }
.ip-fing i { position: absolute; inset: 0; border-radius: 50%; border: 0.5cqw solid rgba(255, 255, 255, 0.9); opacity: 0; }
.ip-fing.tap i { animation: ipTap 0.55s ease-out; }
@keyframes ipTap { from { opacity: 0.9; transform: scale(0.5); } to { opacity: 0; transform: scale(2.1); } }

/* ---------- шаги ---------- */
.iosg-side { min-width: 0; }
.iosg-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.iosg-st { position: relative; border-radius: 14px; overflow: hidden; transition: background 0.3s; }
.iosg-st button { appearance: none; border: 0; background: none; cursor: pointer; width: 100%; display: flex; gap: 12px; align-items: flex-start; padding: 11px 12px 12px; text-align: left; color: var(--mut); font: 600 14px/1.45 var(--mono); }
.iosg-st button b { flex: none; width: 26px; height: 26px; margin-top: -2px; border-radius: 50%; display: grid; place-items: center; font: 800 13px/1 var(--num); color: var(--mut); background: var(--card-hi); border: 1px solid var(--line-hi); transition: background 0.3s, color 0.3s; }
.iosg-st button:hover { color: var(--fg); }
.iosg-st.on { background: var(--card-hi); }
.iosg-st.on button { color: #fff; }
.iosg-st.on button b { background: rgb(var(--rgb)); border-color: transparent; color: #061215; }
.iosg-st.past button b { color: rgb(var(--rgb)); border-color: rgba(var(--rgb), 0.45); }
.iosg-bar { position: absolute; left: 12px; right: 12px; bottom: 0; height: 2px; border-radius: 2px; overflow: hidden; background: rgba(255, 255, 255, 0.06); opacity: 0; }
.iosg-st.on .iosg-bar { opacity: 1; }
.iosg-bar i { display: block; height: 100%; background: rgb(var(--rgb)); transform: scaleX(0); transform-origin: 0 50%; }
.iosg-st.run .iosg-bar i { animation: iosgBar var(--dur) linear forwards; }
@keyframes iosgBar { to { transform: scaleX(1); } }
.iosg-dots { display: none; }
.iosg-old { margin: 14px 0 0; padding: 10px 12px; border-radius: 12px; border: 1px dashed var(--line-hi); color: var(--mut); font-size: 12.5px; line-height: 1.5; }
.iosg-foot { margin-top: 18px; }
.iosg-go { width: 100%; background: rgb(var(--rgb)); color: #061215; }
.iosg-go:hover { background: rgb(var(--rgb)); filter: brightness(1.08); }
.iosg-addr { margin: 0; padding: 12px 14px; border-radius: 14px; background: var(--card-hi); border: 1px solid var(--line-hi); display: flex; flex-wrap: wrap; align-items: baseline; justify-content: center; gap: 4px 10px; color: var(--mut); font-size: 13px; text-align: center; }
.iosg-addr b { font: 800 17px/1.25 var(--mono); color: #fff; overflow-wrap: anywhere; }

/* телефон: шторка снизу, макет меньше, виден только текущий шаг, кнопка внизу под пальцем */
@media (max-width: 640px) {
  dialog.lp-dlg.iosdlg { margin: auto auto 0; width: 100%; max-width: 100%; border-radius: 22px 22px 0 0; padding: 16px 16px max(18px, env(safe-area-inset-bottom)); }
  .iosg-lead { font-size: 12.5px !important; }
  .iosg { grid-template-columns: 1fr; gap: 10px; justify-items: center; margin-top: 10px; }
  .iosg-ph { width: clamp(150px, calc((100vh - 360px) / 2.3), 210px); width: clamp(150px, calc((100svh - 360px) / 2.3), 210px); }
  .iosg-side { width: 100%; }
  .iosg-st:not(.on) { display: none; }
  .iosg-st button { min-height: 86px; align-items: center; }
  .iosg-st button b { margin-top: 0; }
  .iosg-dots { display: flex; justify-content: center; gap: 6px; margin-top: 8px; }
  .iosg-dots button { appearance: none; border: 0; padding: 0; width: 8px; height: 8px; border-radius: 9px; background: var(--line-hi); cursor: pointer; transition: width 0.3s, background 0.3s; }
  .iosg-dots button.on { width: 22px; background: rgb(var(--rgb)); }
  .iosg-old { margin-top: 8px; font-size: 11.5px; padding: 8px 10px; }
  .iosg-foot { margin-top: 12px; }
}

/* ---------- значки платформ на кнопках «Скачать» ---------- */
.btn .pi { width: 18px; height: 18px; flex: none; fill: currentColor; }
.btn .pi.st { fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.gc-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.gc-row > .btn:only-child { grid-column: 1 / -1; }
.app-btns .gc-row { display: contents; }
