/* iOS Safari (браузер): нижние панели видны полностью, ровные и одинаковые. 14.10.2026 */
:root{--sab:env(safe-area-inset-bottom,0px);--vvh:100dvh}
@supports not (height:100dvh){:root{--vvh:100vh}}
html,body{min-height:100svh}
@media (max-width:860px){
  /* высота приложения = видимая область Safari (visualViewport, иначе dvh), а не 100vh */
  .shell{height:var(--app-height,var(--vvh))!important;max-height:var(--app-height,var(--vvh))}
  /* нижнее меню: равные колонки, иконка+подпись по центру, без переносов и обрезки */
  .shell .rail{padding:4px max(2px,env(safe-area-inset-left)) calc(4px + var(--sab)) max(2px,env(safe-area-inset-right))!important;box-sizing:border-box;flex:none}
  .shell .rail .rail-items{display:grid!important;grid-auto-flow:column;grid-auto-columns:minmax(0,1fr);align-items:stretch;justify-content:stretch;gap:0;width:100%;overflow:hidden}
  .shell .rail .rail-items>*{min-width:0!important;max-width:none!important;flex:none!important;margin:0!important}
  .shell .rail .rail-item{display:flex!important;flex-direction:column;align-items:center;justify-content:center;gap:2px;min-height:50px;padding:4px 0 2px!important;position:relative;text-align:center}
  .shell .rail .rail-item svg,.shell .rail .stv-nav-ico{width:22px;height:22px;flex:none;margin:0 auto}
  .shell .rail .stv-nav-ico svg{width:22px;height:22px}
  .shell .rail .rail-item .rail-label{display:block!important;width:100%;max-width:100%;font-size:clamp(9px,2.75vw,11px)!important;line-height:1.15;letter-spacing:-.01em;white-space:nowrap;overflow:visible!important;text-overflow:clip!important;text-align:center}
  .shell .rail .stv-lbl-d{display:none!important}.shell .rail .stv-lbl-m{display:inline!important}
  /* единый порядок: Чаты · Контакты · Лента · Файлы · Стримы · Камеры (· Настройки) */
  .shell .rail [data-nav=chats]{order:1}.shell .rail [data-nav=calls]{order:2}.shell .rail [data-nav=contacts]{order:3}
  .shell .rail #rd-feed-nav{order:4}.shell .rail [data-nav=files]{order:5}.shell .rail [data-nav=streams]{order:6}.shell .rail [data-nav=cams]{order:7}
  .shell .rail [data-nav=saved]{order:8}.shell .rail [data-nav=settings]{order:9}
  .shell .rail .m-hide{display:none!important}
  .shell .rail .rail-badge{top:1px;right:calc(50% - 22px);left:auto}
  /* поле ввода чата — над полосой жестов */
  .composer{padding-bottom:calc(8px + var(--sab))!important}
}
@media (max-width:359px){
  .shell .rail .rail-item svg,.shell .rail .stv-nav-ico,.shell .rail .stv-nav-ico svg{width:20px;height:20px}
  .shell .rail .rail-item .rail-label{font-size:9px!important;letter-spacing:-.03em}
}
/* полноэкранные просмотрщики: по видимой области, а не 100vh */
.stv,.mv{top:var(--vv-top,0px)!important;bottom:auto!important;height:var(--app-height,var(--vvh))!important}
.mv-strip{padding-bottom:calc(8px + var(--sab))!important}
.stv-side{padding-bottom:var(--sab)!important}
.stv-ov.bottom{padding-bottom:max(12px,var(--sab))!important}
.stv-wrap.stv-win{height:var(--app-height,var(--vvh))!important}
.stv-sheet{max-height:calc(var(--app-height,var(--vvh)) - 24px)!important;padding-bottom:calc(20px + var(--sab))!important}

/* баннер «Установите Искру» (iPhone Safari / Chrome iOS) */
.ib{position:fixed;left:10px;right:10px;bottom:calc(var(--ib-off,0px) + 10px + var(--sab));z-index:9500;max-width:460px;margin:0 auto;padding:14px 14px 12px;border-radius:18px;
  background:rgba(22,24,32,.94);-webkit-backdrop-filter:blur(18px) saturate(1.4);backdrop-filter:blur(18px) saturate(1.4);border:1px solid rgba(255,255,255,.1);
  box-shadow:0 18px 50px -12px rgba(0,0,0,.7);color:#eef0f6;font:14px/1.35 -apple-system,system-ui,"Segoe UI",sans-serif;transform:translateY(calc(100% + 40px));opacity:0;transition:transform .38s cubic-bezier(.2,.9,.25,1),opacity .3s}
.ib.on{transform:none;opacity:1}
.ib-row{display:flex;gap:12px;align-items:center}
.ib-row img{width:46px;height:46px;border-radius:12px;flex:none;background:#0b0d12;object-fit:contain;padding:4px;box-sizing:border-box}
.ib-t b{display:block;padding-right:26px;font-size:15px;font-weight:700}.ib-t small{display:block;margin-top:2px;color:#a9afbf;font-size:12.5px}
.ib-t small svg{width:15px;height:15px;vertical-align:-3px;color:#4ea1ff}
.ib-x{position:absolute;top:0;right:0;width:44px;height:44px;border:0;border-radius:50%;background:transparent;color:#8b91a1;font-size:18px;line-height:44px;cursor:pointer}
.ib-btns{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:12px}
.ib-btns button{min-height:44px;border-radius:12px;border:0;font:inherit;font-weight:700;cursor:pointer}
.ib-go{background:linear-gradient(135deg,#ffb547,#ff7a1a);color:#16110c}.ib-later{background:rgba(255,255,255,.08);color:#dfe3ec}
.ib-arrow{position:absolute;left:50%;bottom:-30px;transform:translateX(-50%);color:#4ea1ff;animation:ib-bob 1.4s ease-in-out infinite;pointer-events:none;filter:drop-shadow(0 2px 4px rgba(0,0,0,.6))}
.ib-arrow svg{width:26px;height:26px;display:block}
.ib.over-rail .ib-arrow{display:none}
@keyframes ib-bob{50%{transform:translate(-50%,6px)}}
@media (prefers-reduced-motion:reduce){.ib{transition:none}.ib-arrow{animation:none}}
@media (max-width:860px){
  .shell .rail .rail-label.d-only,.shell .rail .d-only{display:none!important}
  .shell .rail .m-cloud{display:flex!important;flex-direction:column;align-items:center;width:100%;position:static}
  .shell .rail .m-cloud .meter{position:absolute;left:50%;bottom:0;transform:translateX(-50%);width:44%!important;height:3px!important}
  .shell .rail .m-cloud small{display:none!important}
  /* «Лента» — та же высота, что и остальные пункты (акцентный кружок без выноса вверх) */
  .shell .rail .rd-feed-nav .rd-feed-ring{margin:0 auto!important;width:30px!important;height:30px!important;box-shadow:none!important;background:transparent!important}
  .shell .rail .rd-feed-nav .rd-feed-ico{width:30px!important;height:30px!important}
  .shell .rail .rd-feed-nav .rd-feed-ico svg{width:18px!important;height:18px!important}
  .shell .rail .rd-feed-nav .rail-label{margin-top:0!important}
  .shell .rail .rail-item{justify-content:flex-end}
  .shell .rail .rail-item>svg,.shell .rail .stv-nav-ico,.shell .rail .rd-feed-ring{margin-bottom:auto!important;margin-top:auto!important}
}
#iskra-ib.ib{background:rgba(22,24,32,.95)!important;color:#eef0f6!important}
#iskra-ib .ib-t b{color:#fff!important}#iskra-ib .ib-t small{color:#a9afbf!important}
#iskra-ib .ib-later{background:rgba(255,255,255,.1)!important;color:#e6e9f0!important}
#iskra-ib .ib-go{color:#16110c!important}
#iskra-ib .ib-x{color:#9aa0b0!important;background:transparent!important}

/* карточка «Включить уведомления» и панель статуса push */
.pc{position:fixed;left:10px;right:10px;top:calc(10px + env(safe-area-inset-top));z-index:9550;max-width:480px;margin:0 auto;display:grid;grid-template-columns:auto 1fr;gap:4px 12px;align-items:center;padding:14px;border-radius:18px;
  background:rgba(24,18,14,.95)!important;-webkit-backdrop-filter:blur(18px);backdrop-filter:blur(18px);border:1px solid rgba(255,181,71,.25);box-shadow:0 18px 50px -12px rgba(0,0,0,.7);color:#f3ebe4!important;
  font:14px/1.35 -apple-system,system-ui,"Segoe UI",sans-serif;transform:translateY(calc(-100% - 30px));opacity:0;transition:transform .35s cubic-bezier(.2,.9,.25,1),opacity .3s}
.pc.on{transform:none;opacity:1}
.pc-ico{font-size:26px}.pc-t b{display:block;font-size:15px;color:#fff!important}.pc-t small{display:block;margin-top:2px;color:#cbbfb3!important;font-size:12.5px}.pc-t small b{display:inline;font-size:12.5px;color:#ffb547!important}
.pc-btns{grid-column:1/-1;display:flex;gap:8px;margin-top:8px}
.pc-btns button,.pc-x{min-height:44px;border-radius:12px;border:0;font:inherit;font-weight:700;cursor:pointer;padding:0 14px}
.pc-go{flex:1;background:linear-gradient(135deg,#ffb547,#ff7a1a)!important;color:#16110c!important}.pc-later{background:rgba(255,255,255,.1)!important;color:#efe6dd!important}
.pc-sheet-wrap{position:fixed;inset:0;z-index:9650;display:flex;align-items:flex-end;justify-content:center;background:rgba(5,4,3,.55)}
.pc-sheet{position:relative;width:min(520px,100%);padding:22px 18px calc(18px + var(--sab,env(safe-area-inset-bottom)));border-radius:24px 24px 0 0;background:#18120e!important;color:#f3ebe4!important;font:15px/1.4 -apple-system,system-ui,sans-serif;max-height:calc(var(--app-height,100dvh) - 24px);overflow:auto}
.pc-sheet h3{margin:0 0 12px;font-size:18px;color:#fff}.pc-sheet dl{display:grid;grid-template-columns:auto 1fr;gap:8px 14px;margin:0}.pc-sheet dt{color:#a99b8f}.pc-sheet dd{margin:0;color:#fff}
.pc-res{min-height:1.4em;color:#ffb547;font-size:13.5px}.pc-x{position:absolute;top:6px;right:6px;width:44px;padding:0;background:transparent!important;color:#a99b8f!important}
@media (prefers-reduced-motion:reduce){.pc{transition:none}}
#iskra-pc.pc{background:rgba(24,18,14,.96)!important;color:#f3ebe4!important}
#iskra-pc .pc-t b{color:#fff!important}#iskra-pc .pc-t small{color:#d7cbbf!important}
#iskra-pc .pc-go{background:linear-gradient(135deg,#ffb547,#ff7a1a)!important;color:#16110c!important}
#iskra-pc .pc-later{background:rgba(255,255,255,.12)!important;color:#efe6dd!important}
#pc-sheet .pc-sheet{background:#18120e!important;color:#f3ebe4!important}
.pc-hint{margin:12px 0 4px;padding:12px 14px;border-radius:14px;background:rgba(255,181,71,.08);border:1px solid rgba(255,181,71,.22);font-size:13.5px;line-height:1.45;color:#efe3d6}
.pc-hint>b{display:block;margin-bottom:6px;color:#ffb547}.pc-hint ol{margin:0;padding-left:18px;display:grid;gap:5px}.pc-hint li b{color:#fff}
.pc-ov{position:fixed;inset:0;z-index:9800;display:grid;place-items:center;padding:24px;background:radial-gradient(600px 400px at 50% 20%,rgba(255,122,26,.28),transparent 70%),rgba(8,6,5,.92);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);opacity:0;transition:opacity .25s;color-scheme:dark}
.pc-ov.on{opacity:1}
.pc-ov-in{max-width:380px;text-align:center;color:#f3ebe4;font:16px/1.45 -apple-system,system-ui,sans-serif}
.pc-ov-bell{font-size:64px;filter:drop-shadow(0 8px 24px rgba(255,122,26,.6));animation:pc-ring 2.4s ease-in-out infinite}
@keyframes pc-ring{0%,60%,100%{transform:rotate(0)}10%,30%{transform:rotate(14deg)}20%,40%{transform:rotate(-14deg)}}
.pc-ov h2{margin:12px 0 8px;font-size:26px;color:#fff}.pc-ov p{margin:0 0 22px;color:#d8ccc0}
.pc-ov-go{display:block;width:100%;min-height:56px;border:0;border-radius:16px;font:inherit;font-size:18px;font-weight:800;color:#1a0f07;background:linear-gradient(135deg,#ffb547,#ff7a1a);box-shadow:0 14px 34px -12px rgba(255,122,26,.8);cursor:pointer}
.pc-ov-later{display:block;width:100%;min-height:48px;margin-top:8px;border:0;background:none;color:#b9ab9e;font:inherit;cursor:pointer}
.pc-ov small{display:block;margin-top:10px;color:#8f8277;font-size:12.5px}
.pc-np{display:flex!important;align-items:center;gap:10px;width:calc(100% - 24px);margin:10px 12px;min-height:52px;padding:0 14px;border-radius:14px;border:1px solid rgba(255,140,60,.35)!important;background:rgba(255,140,60,.08)!important;font-weight:700;cursor:pointer}
.pc-np span{flex:1;text-align:left}.pc-np em{font-style:normal;opacity:.6}
@media (prefers-reduced-motion:reduce){.pc-ov-bell{animation:none}}
#pc-ov.pc-ov{background:radial-gradient(600px 400px at 50% 20%,rgba(255,122,26,.28),transparent 70%),#0b0807!important;color:#f3ebe4!important}
#pc-ov h2{color:#fff!important}#pc-ov p{color:#d8ccc0!important}#pc-ov small{color:#8f8277!important}
#pc-ov .pc-ov-go{color:#1a0f07!important;background:linear-gradient(135deg,#ffb547,#ff7a1a)!important}
#pc-ov .pc-ov-later{color:#b9ab9e!important;background:none!important}
