/* aelo.io — общий слой адаптации приложений (2026-11-09).
   Подключается в <head> каждого приложения: <link rel="stylesheet" href="/aelo-fit.css?v=N">.
   Только то, что не ломает бандлы: фон, safe-area, панели, Fold, шторка iOS. */

html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
html,body{background-color:var(--aelo-bg,inherit)}
html.aelo-bgfit,html.aelo-bgfit body,html.aelo-bgfit [data-aelo-fill]{background:var(--aelo-bg)!important}
button,a,[role=button],input,select,textarea,label,summary{touch-action:manipulation}
*{-webkit-tap-highlight-color:transparent}

/* iPhone/Android в ландшафте: контент не уходит под вырез (приложения без своих отступов) */
@media (orientation:landscape){
  html.aelo-ss body{padding-left:env(safe-area-inset-left,0px);padding-right:env(safe-area-inset-right,0px)}
}

/* нижняя панель навигации на широких экранах — в ширину колонки приложения, а не на весь монитор */
html.aelo-barfit [data-aelo-bar]{left:0!important;right:0!important;width:auto!important;max-width:var(--aelo-col)!important;margin-left:auto!important;margin-right:auto!important}
html.aelo-barfit [data-aelo-bar].aelo-bar-round{border-top-left-radius:16px;border-top-right-radius:16px}

/* раскладные телефоны в режиме «книги» с двумя сегментами: приложение не ложится на сгиб */
@media (horizontal-viewport-segments:2){
  #root{width:env(viewport-segment-width 0 0);max-width:env(viewport-segment-width 0 0)}
  [data-aelo-bar]{right:auto!important;width:env(viewport-segment-width 0 0)!important;max-width:none!important;margin:0!important}
  .aelo-sheet{left:env(viewport-segment-left 1 0)!important;right:0!important;width:auto!important}
  .aelo-pill{display:none!important}
}

/* ───── iOS-заготовка: голосование и перенос прогресса ───── */
.aelo-ios-root{--a-acc:#C2603F;--a-bg:#FBF8F4;--a-ink:#1E1A17;--a-mute:#6B625B;--a-line:rgba(30,26,23,.12);--a-soft:rgba(30,26,23,.05);
  font:400 15px/1.45 system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;color:var(--a-ink)}
@media (prefers-color-scheme:dark){
  .aelo-ios-root{--a-bg:#1C1917;--a-ink:#F4EEE6;--a-mute:#A69C93;--a-line:rgba(244,238,230,.14);--a-soft:rgba(244,238,230,.06)}
}
.aelo-ios-root *{box-sizing:border-box}
.aelo-ios-root [hidden],.aelo-strip[hidden],.aelo-pill[hidden]{display:none!important}
.aelo-ios-root button{font:inherit;color:inherit;cursor:pointer}

.aelo-scrim{position:fixed;inset:0;z-index:2147482990;background:rgba(0,0,0,.42);opacity:0;transition:opacity .22s ease}
.aelo-sheet{position:fixed;left:0;right:0;bottom:0;z-index:2147482995;margin:0 auto;width:100%;max-width:440px;
  max-height:calc(100dvh - 24px);overflow:auto;overscroll-behavior:contain;
  background:var(--a-bg);border-radius:20px 20px 0 0;padding:10px 20px calc(18px + env(safe-area-inset-bottom,0px));
  box-shadow:0 -10px 40px rgba(0,0,0,.25);transform:translateY(104%);transition:transform .28s cubic-bezier(.2,.8,.2,1)}
/* закрита шторка не перехоплює дотики: невидимий шар поверх застосунку блокував кнопки (виправлено 09.11.2026) */
.aelo-ios-root .aelo-scrim,.aelo-ios-root .aelo-sheet{visibility:hidden;pointer-events:none}
.aelo-ios-root.on .aelo-scrim,.aelo-ios-root.on .aelo-sheet{visibility:visible;pointer-events:auto}
.aelo-ios-root.on .aelo-scrim{opacity:1}
.aelo-ios-root.on .aelo-sheet{transform:none}
@media (min-width:640px) and (min-height:560px){
  .aelo-sheet{bottom:auto;top:50%;border-radius:20px;transform:translateY(-46%) scale(.98);opacity:0;transition:transform .24s ease,opacity .2s ease;padding-bottom:20px}
  .aelo-ios-root.on .aelo-sheet{transform:translateY(-50%);opacity:1}
}
@media (prefers-reduced-motion:reduce){.aelo-scrim,.aelo-sheet{transition:none!important}}
.aelo-grab{width:36px;height:4px;border-radius:2px;background:var(--a-line);margin:0 auto 12px}
@media (min-width:640px) and (min-height:560px){.aelo-grab{display:none}}
.aelo-hd{display:flex;align-items:center;gap:12px;margin:0 0 10px}
.aelo-hd img{width:44px;height:44px;border-radius:11px;flex:none}
.aelo-hd h2{font:650 19px/1.2 system-ui,-apple-system,"Segoe UI",sans-serif;margin:0;letter-spacing:-.01em}
.aelo-hd p{margin:2px 0 0;color:var(--a-mute);font-size:13px}
.aelo-x{margin-left:auto;align-self:flex-start;width:36px;height:36px;border:0;border-radius:50%;background:var(--a-soft);font-size:20px!important;line-height:1!important;flex:none}
.aelo-lead{margin:0 0 14px;color:var(--a-ink)}
.aelo-vote{display:flex;align-items:center;justify-content:center;gap:8px;width:100%;min-height:50px;border:0;border-radius:14px;
  background:var(--a-acc);color:#fff!important;font-weight:600!important;font-size:16px!important}
.aelo-vote[disabled]{opacity:1;cursor:default;background:var(--a-soft);color:var(--a-ink)!important}
.aelo-vote svg{flex:none}
.aelo-count{margin:8px 0 0;text-align:center;color:var(--a-mute);font-size:13px;min-height:19px}
.aelo-sep{height:1px;background:var(--a-line);margin:16px 0 14px}
.aelo-row{display:flex;align-items:center;gap:12px}
.aelo-row .t{flex:1;min-width:0}
.aelo-row b{display:block;font-weight:600;font-size:15px}
.aelo-row span{display:block;color:var(--a-mute);font-size:13px}
.aelo-ghost{flex:none;min-height:40px;padding:0 14px;border:1px solid var(--a-line);border-radius:12px;background:transparent;font-weight:600!important;font-size:14px!important}
.aelo-msg{margin:10px 0 0;font-size:13px;color:var(--a-acc);min-height:0}
.aelo-foot{margin:14px 0 0;font-size:13px;color:var(--a-mute)}
.aelo-foot a{color:inherit;text-decoration:underline;text-underline-offset:2px}
.aelo-avail{display:block;text-align:center;margin:0 0 12px;padding:12px;border-radius:14px;background:var(--a-soft);color:var(--a-ink);font-weight:600;text-decoration:none}

/* постоянная кнопка на широких экранах — в свободном поле справа от колонки */
.aelo-pill{position:fixed;right:max(16px,env(safe-area-inset-right,0px));bottom:calc(16px + env(safe-area-inset-bottom,0px));z-index:2147482980;
  display:flex;align-items:center;gap:8px;min-height:40px;padding:0 14px 0 10px;border-radius:999px;border:1px solid var(--a-line);
  background:var(--a-bg);color:var(--a-ink);font:600 13px/1 system-ui,-apple-system,"Segoe UI",sans-serif;box-shadow:0 6px 20px rgba(0,0,0,.14);cursor:pointer}
.aelo-pill svg{flex:none}

/* полоска после приложения (телефоны, когда страница прокручивается) */
.aelo-strip{display:flex;align-items:center;justify-content:center;gap:10px;flex-wrap:wrap;padding:14px 16px calc(14px + var(--aelo-barh,0px));
  font:500 13px/1.35 system-ui,-apple-system,"Segoe UI",sans-serif;text-align:center;color:inherit;opacity:.82}
.aelo-strip button{min-height:36px;padding:0 14px;border-radius:999px;border:1px solid currentColor;background:transparent;color:inherit;font:600 13px/1 inherit;cursor:pointer;opacity:.95}
/* v3 (10.11.2026): підказка встановлення не закриває онбординг і дисклеймер, не показується в перший день і на компʼютері з мишею */
html.aelo-nohint .install-hint,html.aelo-nohint #aelo-install,
body:has(.onb-overlay) .install-hint,body:has(.disc-overlay) .install-hint,body:has(.onb-overlay) #aelo-install{display:none!important}
@media (hover:hover) and (pointer:fine){.install-hint,#aelo-install{display:none!important}}
