/* ======================================================================
   «ВАУ»-СЛОЙ. Подключается после glass.css, поведение — в extras.js.
   Время суток, полноэкранный режим, остров, свайпы, стопка документов, орбиты семьи,
   потянуть-для-обновления, сторис с итогами недели, голосовой шар.
   ====================================================================== */

/* ---------- фон по времени суток (день — палитра из glass.css) ---------- */
:root[data-daypart="morning"] { --bg: #FFF3EC; --blob1: #FFB38A; --blob2: #FFD27A; --blob3: #FF9EC0; --blob4: #8FD3FF; }
:root[data-daypart="evening"] { --bg: #FCEEF3; --blob1: #FF9A6B; --blob2: #C07BFF; --blob3: #FF7FAE; --blob4: #FFBE70; }
:root[data-daypart="night"]   { --bg: #E9EBFB; --blob1: #8C9BFF; --blob2: #A58BFF; --blob3: #8E9BD8; --blob4: #7FC3EE; }
:root[data-theme="dark"][data-daypart="morning"] { --bg: #0B0708; --blob1: #7C2D12; --blob2: #713F12; --blob3: #831843; --blob4: #0C4A6E; }
:root[data-theme="dark"][data-daypart="evening"] { --bg: #0A0609; --blob1: #7C2D12; --blob2: #581C87; --blob3: #9D174D; --blob4: #78350F; }
:root[data-theme="dark"][data-daypart="night"]   { --bg: #04040A; --blob1: #0B1B4A; --blob2: #1E1B4B; --blob3: #312E81; --blob4: #0C2A3A; }
body { transition: background-color 1.2s var(--ease); }

/* ночью в тёмной теме — звёзды */
:root[data-theme="dark"][data-daypart="night"] body::after {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    radial-gradient(1.4px 1.4px at 12% 18%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 28% 42%, #fff 50%, transparent 51%),
    radial-gradient(1.6px 1.6px at 47% 12%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 63% 33%, #fff 50%, transparent 51%),
    radial-gradient(1.3px 1.3px at 81% 9%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 90% 48%, #fff 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 8% 64%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 38% 78%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 72% 70%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 55% 92%, #fff 50%, transparent 51%);
  opacity: .55; animation: twinkle 6s ease-in-out infinite alternate;
}
@keyframes twinkle { from { opacity: .3; } to { opacity: .65; } }

/* вечером и ночью логотип в шапке светится, как окно дома */
:root[data-daypart="evening"] .brandline img { animation: homeGlow 4s ease-in-out infinite alternate; }
:root[data-daypart="night"] .brandline img { animation: homeGlowNight 5s ease-in-out infinite alternate; }
@keyframes homeGlow { from { filter: drop-shadow(0 0 3px rgba(255, 176, 96, .55)); } to { filter: drop-shadow(0 0 10px rgba(255, 176, 96, .95)); } }
@keyframes homeGlowNight { from { filter: drop-shadow(0 0 3px rgba(150, 170, 255, .5)); } to { filter: drop-shadow(0 0 10px rgba(255, 214, 140, .9)); } }

/* ---------- полноэкранный режим Telegram: отступ под системную шапку ---------- */
.app { padding-top: calc(var(--s4) + var(--tg-safe-area-inset-top, 0px) + var(--tg-content-safe-area-inset-top, 0px)); }
.home-hint { display: flex; align-items: center; gap: var(--s3); padding: var(--s3); margin-top: var(--s3); border-radius: var(--r-lg); }
.home-hint img { border-radius: 12px; flex: none; }
.home-hint .body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: var(--fs-sm); }

/* ---------- «остров»: ближайшее дело с обратным отсчётом ---------- */
.island {
  position: fixed; z-index: 60; left: 50%; transform: translateX(-50%);
  top: max(8px, calc(var(--tg-safe-area-inset-top, 0px) + (var(--tg-content-safe-area-inset-top, 0px) - 36px) / 2));
  background: #0B0B10; color: #fff; border-radius: 22px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .28), inset 0 1px 0 rgba(255, 255, 255, .08);
  width: auto; max-width: min(220px, calc(100vw - 150px));
  transition: max-width .45s var(--spring), border-radius .45s var(--spring), padding .45s var(--spring);
  animation: islandIn .5s var(--spring);
}
.island[hidden] { display: none; }
html:not(.tg-fs) body.has-island .app { padding-top: calc(var(--s4) + 48px); }
@keyframes islandIn { from { opacity: 0; transform: translateX(-50%) scale(.6); } to { opacity: 1; transform: translateX(-50%) scale(1); } }
.is-pill {
  display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px 0 12px; max-width: 100%;
  background: none; border: 0; color: inherit; font: 600 13px var(--font); cursor: pointer; border-radius: 22px;
}
.is-pill { background: #0B0B10; }
.is-pill:hover { background: #1A1A22; }
.is-pill:focus-visible, .is-btn:focus-visible { outline: 2px solid #8B7CFF; outline-offset: 2px; }
.is-pill:active { transform: scale(.96); }
.is-when { color: #FFD60A; white-space: nowrap; font-variant-numeric: tabular-nums; }
.is-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: rgba(255, 255, 255, .9); }
.is-dot { width: 8px; height: 8px; border-radius: 50%; background: #8B7CFF; flex: none; box-shadow: 0 0 8px currentColor; animation: isPulse 1.6s ease-in-out infinite; }
.is-dot.k-event { background: #409CFF; color: #409CFF; }
.is-dot.k-task { background: #30D158; color: #30D158; }
.is-dot.k-remind { background: #FFD60A; color: #FFD60A; }
.is-dot.k-payment { background: #FF6482; color: #FF6482; }
@keyframes isPulse { 50% { opacity: .45; } }
.island.open { max-width: min(380px, calc(100vw - 24px)); width: calc(100vw - 24px); border-radius: 28px; padding: 14px 16px; }
.is-row { display: flex; align-items: center; gap: 10px; font: 700 16px/1.25 var(--font-display); }
.is-row b { font-weight: 700; }
.is-sub { color: rgba(255, 255, 255, .72); font-size: var(--fs-sm); margin: 4px 0 12px 18px; }
.is-actions { display: flex; gap: 8px; }
.is-btn { flex: 1; min-height: 40px; border-radius: 14px; border: 0; background: rgba(255, 255, 255, .12); color: #fff; font: 600 14px var(--font); cursor: pointer; }
.is-btn:hover { background: rgba(255, 255, 255, .18); }
.is-btn:active { transform: scale(.97); }
.is-btn:disabled { opacity: .5; cursor: default; }
.is-btn.ok { background: #30D158; color: #04200D; }
.is-btn.ok:hover { background: #3EDC66; }

/* ---------- свайпы по делам ---------- */
.swipe { position: relative; border-radius: var(--r-md); }
.swipe .item { position: relative; z-index: 1; touch-action: pan-y; transition: transform .35s var(--spring); }
.swipe.dragging .item { transition: none; }
.swipe.dragging .item, .swipe.gone .item, .swipe.peek .item { background: #FFFFFF; }
:root[data-theme="dark"] :is(.swipe.dragging, .swipe.gone, .swipe.peek) .item { background: #1C1C26; }
.swipe.gone .item { transition: transform .28s var(--ease); }
.swipe-under {
  position: absolute; inset: 0; border-radius: var(--r-md); display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--s5); color: #fff; font: 700 15px var(--font); opacity: 0; visibility: hidden; transition: opacity .15s;
}
.swipe-under span { display: inline-flex; align-items: center; gap: 6px; opacity: .7; transition: transform .25s var(--spring), opacity .2s; }
.swipe-under svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 3; }
.swipe.dir-right .swipe-under, .swipe.peek .swipe-under { opacity: 1; visibility: visible; background: #146C35; }
.swipe.dir-left .swipe-under { opacity: 1; visibility: visible; background: #0052CC; }
.swipe.dir-right .su-later, .swipe.peek .su-later { visibility: hidden; }
.swipe.dir-left .su-done { visibility: hidden; }
.swipe.armed .swipe-under span { opacity: 1; transform: scale(1.12); }
.swipe.peek .item { animation: peek 1.2s var(--ease); }
@keyframes peek { 0%, 100% { transform: none; } 35%, 60% { transform: translateX(72px); } }
.swipe.leaving { animation: leave .42s var(--ease) forwards; pointer-events: none; overflow: hidden; }
.swipe.gone { animation: collapse .3s .2s var(--ease) forwards; overflow: hidden; }
@keyframes collapse { from { max-height: 200px; } to { max-height: 0; margin-top: -8px; opacity: 0; } }

/* ---------- стопка документов как в Wallet ---------- */
.wallet { display: flex; flex-direction: column; padding-bottom: var(--s1); }
.wcard {
  position: relative; min-height: 168px; padding: var(--s4) var(--s5); border-radius: 20px; color: #fff;
  display: flex; flex-direction: column; gap: 6px;
  box-shadow: 0 -2px 0 rgba(255, 255, 255, .12) inset, 0 10px 24px rgba(20, 16, 60, .22);
  background: linear-gradient(145deg, var(--c1), var(--c2));
  transition: margin .5s var(--spring), transform .3s var(--ease);
  overflow: hidden; cursor: default;
}
.wcard::after { /* блик стекла по краю карты */
  content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background: linear-gradient(115deg, rgba(255, 255, 255, .22) 0%, transparent 38%);
}
.wallet:not(.open) .wcard { cursor: pointer; }
.wallet:not(.open) .wcard + .wcard { margin-top: -120px; }
.wallet:not(.open) .wcard:hover { transform: translateY(-4px); }
.wallet:not(.open) .wcard:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.wallet:not(.open) .wcard:active { transform: translateY(-2px) scale(.99); }
.wallet.open .wcard + .wcard { margin-top: var(--s3); }
.wallet.open .wcard { animation: rise .45s var(--spring) both; animation-delay: calc(var(--i) * 50ms); }
.wtop { display: flex; justify-content: space-between; align-items: center; gap: var(--s2); }
.wtype { font: 700 12px var(--font); letter-spacing: .08em; text-transform: uppercase; opacity: .92; flex: none; }
/* в свёрнутой стопке видна только верхняя полоска карты — в ней и название */
.wname { flex: 1; min-width: 0; font: 700 15px var(--font); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: none; }
.wallet:not(.open) .wcard:not(:last-child) .wname { display: block; }
.wcard:nth-child(even) { filter: brightness(1.1) saturate(1.05); }
.wbadge { background: rgba(255, 255, 255, .95); color: #7A0010; font: 700 12px var(--font); padding: 3px 9px; border-radius: 999px; }
.wtitle { font: 800 22px/1.15 var(--font-display); letter-spacing: -.02em; margin-top: auto; }
.wbottom { display: flex; justify-content: space-between; gap: var(--s3); font-size: var(--fs-sm); opacity: .92; }
.wmore { position: relative; z-index: 1; border-top: 1px solid rgba(255, 255, 255, .22); margin-top: var(--s2); padding-top: var(--s3); display: flex; flex-direction: column; gap: var(--s2); font-size: var(--fs-sm); }
.wnum { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); font: 600 16px ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .06em; }
.wnotes { opacity: .92; line-height: 1.4; }
.wactions { display: flex; gap: var(--s2); flex-wrap: wrap; }
.wbtn { min-height: 34px; padding: 0 12px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, .35); background: rgba(255, 255, 255, .14); color: #fff; font: 600 13px var(--font); cursor: pointer; }
.wbtn:hover { background: rgba(255, 255, 255, .24); }
.wbtn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.wbtn:active { transform: scale(.96); }
.wbtn:disabled { opacity: .5; cursor: default; }
.wbtn.danger { background: rgba(255, 255, 255, .95); color: #B00012; border-color: transparent; }
.wbtn.danger:hover { background: #fff; }
.t-passport  { --c1: #8E1B34; --c2: #4E0D1C; }
.t-residence, .t-visa { --c1: #0B5A7A; --c2: #06334A; }
.t-insurance { --c1: #0F6B52; --c2: #073B2E; }
.t-license   { --c1: #3E43AE; --c2: #232769; }
.t-vehicle   { --c1: #374151; --c2: #161B24; }
.t-contract  { --c1: #6340A0; --c2: #36205E; }
.t-medical   { --c1: #9A2C7A; --c2: #551446; }
.t-warranty  { --c1: #8A5300; --c2: #4D2E00; }
.t-other     { --c1: #44445C; --c2: #22222F; }

/* ---------- семья на орбитах вокруг дома ---------- */
.orbit-wrap { margin: 0 0 var(--s2); }
.orbit-wrap > .muted { margin-top: var(--s5) !important; }
.orbit { position: relative; width: min(320px, 86vw); aspect-ratio: 1; margin: 0 auto; --r: 41%; }
.orbit-ring { position: absolute; inset: 9%; border-radius: 50%; border: 1.5px dashed color-mix(in srgb, var(--brand) 35%, transparent); }
.orbit-ring.inner { inset: 30%; border-style: solid; border-color: color-mix(in srgb, var(--brand) 14%, transparent); }
.orbit-center { position: absolute; inset: 36%; display: grid; place-items: center; }
.orbit-center img { width: 100%; height: 100%; border-radius: 26%; box-shadow: 0 14px 36px rgba(59, 130, 246, .38); animation: breathe 5s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.05); } }
.orbit-spin { position: absolute; inset: 0; animation: orbit 120s linear infinite; }
.planet {
  position: absolute; left: 50%; top: 50%; width: 68px; height: 68px; margin: -34px 0 0 -34px; padding: 0;
  background: none; border: 0; color: inherit; cursor: pointer; border-radius: 50%;
  transform: rotate(var(--a)) translateY(calc(min(320px, 86vw) * -.41)) rotate(calc(-1 * var(--a)));
}
.pl-inner { position: relative; display: block; width: 100%; height: 100%; animation: orbit 120s linear infinite reverse; }
.planet svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.pl-bg { fill: var(--glass); stroke: var(--tint); stroke-width: 4; }
.pl-fg { fill: none; stroke: var(--task); stroke-width: 4; stroke-linecap: round; transition: stroke-dasharray .8s var(--ease); }
.pl-av { position: absolute; inset: 11px; border-radius: 50%; display: grid; place-items: center; color: #fff; font: 800 18px var(--font-display); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35); transition: transform .3s var(--spring); }
.pl-name { position: absolute; left: 50%; top: 100%; transform: translateX(-50%); margin-top: 2px; white-space: nowrap; font: 600 12px var(--font); color: var(--ink); background: var(--glass); padding: 1px 7px; border-radius: 999px; }
.planet:hover .pl-av { transform: scale(1.08); }
.planet:active .pl-av { transform: scale(.94); }
.planet:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
@keyframes orbit { to { transform: rotate(360deg); } }
.orbit:hover .orbit-spin, .orbit:hover .pl-inner, .orbit:focus-within .orbit-spin, .orbit:focus-within .pl-inner { animation-play-state: paused; }

/* нижняя шторка с делами человека */
.sheet { position: fixed; inset: 0; z-index: 90; background: rgba(8, 8, 20, 0); transition: background .28s var(--ease); display: flex; align-items: flex-end; justify-content: center; }
.sheet.on { background: rgba(8, 8, 20, .42); }
.sh-panel {
  box-sizing: border-box; width: 100%; max-width: 560px; max-height: 82vh; overflow: auto; padding: var(--s3) var(--s4) calc(var(--s5) + env(safe-area-inset-bottom));
  background: var(--bg); border-radius: 28px 28px 0 0; box-shadow: 0 -12px 40px rgba(0, 0, 0, .2);
  transform: translateY(100%); transition: transform .4s var(--spring);
}
.sheet.on .sh-panel { transform: none; }
.sh-grip { display: block; width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto var(--s3); }

/* ---------- потянуть вниз — обновить ---------- */
.ptr {
  position: fixed; left: 50%; top: calc(var(--tg-safe-area-inset-top, 0px) + var(--tg-content-safe-area-inset-top, 0px));
  width: 40px; height: 40px; margin-top: 0; z-index: 55; border-radius: 50%; padding: 2px;
  background: var(--glass); border: 1px solid var(--glass-border); box-shadow: var(--glass-shadow), var(--glass-edge);
  transform: translate(-50%, -60px); opacity: 0; transition: transform .35s var(--spring), opacity .2s; pointer-events: none; --p: 0;
}
html:not(.lite) .ptr { -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); }
.ptr.show { opacity: 1; transition: opacity .2s; }
.ptr svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ptr-bg { fill: none; stroke: var(--tint); stroke-width: 4; }
.ptr-fg { fill: none; stroke: var(--brand); stroke-width: 4; stroke-linecap: round; stroke-dasharray: 81.7; stroke-dashoffset: calc(81.7 * (1 - var(--p))); }
.ptr.spin { opacity: 1; transition: transform .35s var(--spring); }
.ptr.spin svg { animation: ptrSpin .8s linear infinite; }
.ptr.spin .ptr-fg { stroke-dashoffset: 55; }
@keyframes ptrSpin { from { transform: rotate(-90deg); } to { transform: rotate(270deg); } }

/* ---------- сторис с итогами недели ---------- */
.stories {
  position: fixed; inset: 0; z-index: 100; color: #fff; overflow: hidden;
  background:
    radial-gradient(60% 40% at 15% 10%, rgba(14, 116, 144, .55), transparent 70%),
    radial-gradient(60% 45% at 95% 60%, rgba(157, 23, 77, .45), transparent 70%),
    linear-gradient(165deg, #1D4ED8 0%, #4C1D95 55%, #6D28D9 100%);
  animation: storiesIn .4s var(--spring);
  padding: calc(var(--tg-safe-area-inset-top, 0px) + var(--tg-content-safe-area-inset-top, 0px) + 14px) var(--s5) calc(env(safe-area-inset-bottom) + var(--s5));
}
.stories.closing { animation: storiesOut .25s var(--ease) forwards; }
@keyframes storiesIn { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }
@keyframes storiesOut { to { opacity: 0; transform: scale(.96); } }
.st-bars-top { display: flex; gap: 4px; position: relative; z-index: 4; }
.st-bars-top i { flex: 1; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, .3); overflow: hidden; }
.st-bars-top i b { display: block; height: 100%; width: 0; background: #fff; }
.st-bars-top i.done b { width: 100%; }
.st-bars-top i.run b { animation: stFill var(--dur, 5.5s) linear forwards; }
.stories.paused .st-bars-top i.run b { animation-play-state: paused; }
@keyframes stFill { to { width: 100%; } }
.st-x { position: absolute; z-index: 5; right: var(--s3); top: calc(var(--tg-safe-area-inset-top, 0px) + var(--tg-content-safe-area-inset-top, 0px) + 24px);
  width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .16); color: #fff; display: grid; place-items: center; cursor: pointer; }
.st-x:hover { background: rgba(255, 255, 255, .26); }
.st-x:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.st-x svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2.4; }
.st-stage { position: absolute; inset: 0; }
.st-slide {
  position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; gap: var(--s4);
  padding: 90px var(--s6) 60px; max-width: 560px; margin: 0 auto;
  opacity: 0; transform: translateX(24px); transition: opacity .35s var(--ease), transform .45s var(--spring); pointer-events: none;
}
.st-slide.on { opacity: 1; transform: none; }
.st-eyebrow { margin: 0; font: 700 13px var(--font); letter-spacing: .1em; text-transform: uppercase; color: rgba(255, 255, 255, .85); }
.st-big { margin: 0; font: 800 clamp(28px, 9.4vw, 44px)/1.05 var(--font-display); letter-spacing: -.03em; overflow-wrap: anywhere; }
.st-mid { margin: 0; font: 800 28px/1.1 var(--font-display); letter-spacing: -.02em; }
.st-card { background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .28); border-radius: 28px; padding: var(--s5); display: flex; flex-direction: column; gap: 2px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3); }
.st-card span { font-size: var(--fs-md); color: rgba(255, 255, 255, .9); }
.st-num { font: 900 120px/1 var(--font-display); letter-spacing: -.05em; font-variant-numeric: tabular-nums; }
.st-card.sm b { font: 800 26px/1.15 var(--font-display); }
.st-note { margin: 0; color: rgba(255, 255, 255, .88); font-size: var(--fs-md); }
.st-bars { display: flex; flex-direction: column; gap: var(--s3); }
.st-bar { display: grid; grid-template-columns: 96px 1fr 36px; align-items: center; gap: var(--s2); font-weight: 600; }
.st-bar span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-bar i { height: 14px; border-radius: 7px; background: rgba(255, 255, 255, .16); position: relative; overflow: hidden; }
.st-bar i::after { content: ""; position: absolute; inset: 0 auto 0 0; width: 0; border-radius: inherit; background: linear-gradient(90deg, #7CF29C, #5CE1E6); }
.st-slide.on .st-bar i::after { width: var(--w); transition: width 1s .15s var(--ease); }
.st-bar b { text-align: right; font-variant-numeric: tabular-nums; }
.st-kids { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: var(--s3); }
.st-kid { background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .28); border-radius: 22px; padding: var(--s4); display: flex; flex-direction: column; }
.st-kid b { font: 900 48px/1 var(--font-display); color: #FFD60A; font-variant-numeric: tabular-nums; }
.st-kid span { font-weight: 700; margin-top: 6px; }
.st-kid em { font-style: normal; color: rgba(255, 255, 255, .85); font-size: var(--fs-sm); }
.st-grid { display: flex; flex-direction: column; gap: var(--s3); }
.st-preview { width: min(46vw, 210px); aspect-ratio: 9 / 16; object-fit: cover; border-radius: 18px; align-self: center; box-shadow: 0 18px 40px rgba(0, 0, 0, .35); }
.st-share { display: flex; flex-direction: column; gap: var(--s2); position: relative; z-index: 3; }
.st-slide.on .st-share, .st-slide.on .st-preview { pointer-events: auto; }
.stories .btn.ghost { background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .3); color: #fff; }
.stories .btn.brand { background: #fff; color: #3A1FA8; box-shadow: 0 10px 26px rgba(0, 0, 0, .25); }
.st-tap { position: absolute; top: 0; bottom: 0; z-index: 2; background: none; border: 0; padding: 0; cursor: pointer; }
.st-tap.prev { left: 0; width: 30%; }
.st-tap.next { right: 0; width: 70%; }
.st-tap:focus-visible { outline: 2px solid rgba(255, 255, 255, .7); outline-offset: -6px; }

/* ---------- голосовой шар ---------- */
.mic-fab {
  position: fixed; z-index: 20; right: max(16px, calc(50vw - 264px)); bottom: calc(92px + env(safe-area-inset-bottom));
  width: 56px; height: 56px; border-radius: 50%; border: 0; cursor: pointer; color: #fff; display: grid; place-items: center;
  background: linear-gradient(135deg, #2563EB, #6D28D9);
  box-shadow: 0 10px 26px rgba(91, 75, 245, .45), inset 0 1px 0 rgba(255, 255, 255, .35);
  transition: transform .25s var(--spring), box-shadow .2s, filter .2s; animation: pop .45s var(--spring);
}
.mic-fab[hidden] { display: none; }
.mic-fab svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.mic-fab:hover { filter: brightness(1.08); transform: translateY(-2px); }
.mic-fab:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.mic-fab:active { transform: scale(.92); }
.mic-fab:disabled { opacity: .5; cursor: default; }

.voice {
  position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s3);
  padding: var(--s6) var(--s6) calc(env(safe-area-inset-bottom) + var(--s6)); text-align: center; color: #fff;
  background: rgba(6, 6, 16, .8); opacity: 0; transition: opacity .28s var(--ease); --lvl: 0;
}
html:not(.lite) .voice { -webkit-backdrop-filter: blur(22px) saturate(160%); backdrop-filter: blur(22px) saturate(160%); }
.voice.on { opacity: 1; }
.v-orb { position: relative; width: 180px; height: 180px; margin-bottom: var(--s5); border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, #312E81 0, #1E1B4B 70%);
  box-shadow: 0 0 60px rgba(109, 74, 255, .55), 0 0 120px rgba(56, 189, 248, .25);
  transform: scale(calc(1 + var(--lvl) * .35)); transition: transform .08s linear; overflow: hidden; }
.v-orb i { position: absolute; inset: -10%; border-radius: 50%; filter: blur(12px); opacity: .95; }
.v-orb i:nth-child(1) { background: radial-gradient(circle at 30% 32%, #67E8F9 0, #2563EB 30%, transparent 58%); animation: orbA 5s linear infinite; }
.v-orb i:nth-child(2) { background: radial-gradient(circle at 70% 38%, #F9A8D4 0, #A21CAF 30%, transparent 58%); animation: orbB 7s linear infinite; }
.v-orb i:nth-child(3) { background: radial-gradient(circle at 48% 74%, #86EFAC 0, #0891B2 30%, transparent 58%); animation: orbC 6s linear infinite; }
@keyframes orbA { from { transform: rotate(0) translateX(6px) scale(1); } 50% { transform: rotate(180deg) translateX(10px) scale(1.06); } to { transform: rotate(360deg) translateX(6px) scale(1); } }
@keyframes orbB { from { transform: rotate(360deg) translateY(8px); } to { transform: rotate(0) translateY(8px); } }
@keyframes orbC { 0%, 100% { transform: scale(.9) translate(-6px, 4px); } 50% { transform: scale(1.08) translate(6px, -4px); } }
.voice[data-state="busy"] .v-orb i { animation-duration: 1.4s, 1.4s, 1.4s; }
.voice[data-state="busy"] .v-orb { animation: breathe 1.2s ease-in-out infinite; }
.voice[data-state="done"] .v-orb i:nth-child(2) { background: radial-gradient(circle at 60% 40%, #86EFAC 0, #16A34A 30%, transparent 58%); }
.voice[data-state="error"] .v-orb { filter: grayscale(.8) brightness(.7); }
.voice[data-state="error"] .v-time { display: none; }
.v-state { margin: 0; font: 700 22px/1.3 var(--font-display); max-width: 440px; }
.v-hint { margin: 0; color: rgba(255, 255, 255, .8); font-size: var(--fs-md); max-width: 400px; line-height: 1.45; white-space: pre-line; }
.v-time { margin: 0; color: rgba(255, 255, 255, .7); font: 600 14px var(--font); font-variant-numeric: tabular-nums; min-height: 18px; }
.v-actions { display: flex; flex-direction: column; gap: var(--s2); width: min(320px, 100%); margin-top: var(--s4); }
.voice .btn.ghost { background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .25); color: #fff; }

/* меньше движения — без полётов, орбит и мерцаний */
@media (prefers-reduced-motion: reduce) {
  .orbit-spin, .pl-inner, .orbit-center img, .v-orb i, .v-orb, .is-dot, .brandline img, body::after { animation: none !important; }
  .swipe.peek .item { animation: none; }
}
html.lite .orbit-spin, html.lite .pl-inner, html.lite .v-orb i { animation: none; }

/* тост не должен наезжать на кнопку микрофона */
body:has(.mic-fab:not([hidden])) .toast { bottom: calc(160px + env(safe-area-inset-bottom)); }
.toast { max-width: calc(100vw - 48px); }
:root[data-theme="dark"] .island { border: 1px solid rgba(255, 255, 255, .14); }
