:root{
  --bg:#09070a;--bg2:#110b10;--surface:#171117;--surface-2:#211721;--text:#fff7fb;--muted:#ac9da6;
  --line:rgba(255,255,255,.12);--line-strong:rgba(255,255,255,.22);--accent:#ff3d98;--accent2:#ff6db4;
  --surface-solid:#171117;--glass-bg:rgba(23,17,23,.88);--control-bg:rgba(255,255,255,.045);--control-strong:rgba(0,0,0,.16);--hero-card-bg:rgba(11,8,11,.72);
  --shadow:0 24px 70px rgba(0,0,0,.34);--radius:32px;--nav-h:74px;--app-height:100svh;
}
html[data-theme="light"]{
  --bg:#fff8fb;--bg2:#f7edf3;--surface:#fffafd;--surface-2:#f2e6ed;--text:#251720;--muted:#74666f;
  --line:rgba(54,32,46,.11);--line-strong:rgba(54,32,46,.20);--surface-solid:#fffafd;--glass-bg:rgba(255,250,253,.90);--control-bg:rgba(54,32,46,.045);--control-strong:rgba(255,255,255,.78);--hero-card-bg:rgba(255,250,253,.90);
  --shadow:0 22px 58px rgba(126,76,103,.13)
}
*{box-sizing:border-box}
html{background:var(--bg);scroll-behavior:smooth}
body{margin:0;min-width:280px;min-height:var(--app-height);background:linear-gradient(150deg,var(--bg),var(--bg2));color:var(--text);font-family:Manrope,system-ui,sans-serif;font-weight:600;overflow-x:hidden;padding-bottom:calc(var(--nav-h) + 42px + env(safe-area-inset-bottom));transition:background .35s ease,color .35s ease}
button,input{font:inherit}.tap{-webkit-tap-highlight-color:transparent;touch-action:manipulation}.tap:active{scale:.975}
button{color:inherit}.ambient{position:fixed;pointer-events:none;border-radius:999px;filter:blur(90px);opacity:.14;z-index:0;animation:ambientMove 12s ease-in-out infinite alternate}.ambient-a{width:360px;height:360px;background:var(--accent);top:-170px;left:-100px}.ambient-b{width:300px;height:300px;background:#9c2dff;right:-130px;bottom:5%;animation-delay:-4s}@keyframes ambientMove{to{translate:28px 35px;scale:1.16}}
.glass{background:var(--glass-bg);border:1px solid var(--line-strong);box-shadow:var(--shadow);backdrop-filter:blur(22px);-webkit-backdrop-filter:blur(22px)}
.topbar{position:sticky;top:max(10px,env(safe-area-inset-top));z-index:30;max-width:1180px;margin:14px auto 0;border-radius:26px;padding:10px 12px 10px 22px;display:flex;align-items:center;justify-content:space-between;min-height:64px;transition:background .3s,border-color .3s,box-shadow .3s}
.brand{border:0;background:transparent;padding:8px 0;font-weight:800;font-size:18px;letter-spacing:-.7px}.brand .accent{color:var(--accent)}.top-actions{display:flex;align-items:center;gap:10px}.menu-word{font-size:10px;letter-spacing:.18em;color:var(--muted);font-weight:800}.icon-btn{width:46px;height:42px;border-radius:16px;border:1px solid var(--line);background:var(--control-strong);display:grid;grid-template-columns:1fr 1fr;align-items:center;padding:4px;transition:.25s ease}.icon-btn span{display:grid;place-items:center;height:32px;border-radius:11px;font-size:15px;transition:.25s}.icon-btn .sun,.icon-btn .moon{background:transparent;color:var(--muted)}.icon-btn .moon{background:var(--text);color:var(--accent)}html[data-theme="light"] .icon-btn .moon{background:transparent;color:var(--muted)}html[data-theme="light"] .icon-btn .sun{background:var(--text);color:var(--accent)}
.app-shell{position:relative;z-index:1;max-width:1180px;margin:28px auto 0;padding:0 14px}.view{display:none;opacity:0;translate:0 12px}.view.is-active{display:block;animation:viewIn .34s ease forwards}@keyframes viewIn{to{opacity:1;translate:0 0}}
.surface{border:1px solid var(--line);border-radius:var(--radius);background:linear-gradient(145deg,color-mix(in srgb,var(--surface) 94%,transparent),color-mix(in srgb,var(--surface-2) 72%,transparent));box-shadow:var(--shadow);transition:border-color .28s ease,background .28s ease,box-shadow .28s ease,translate .28s ease}
.reveal{animation:reveal .55s cubic-bezier(.2,.7,.2,1) both}.delay-1{animation-delay:.08s}.delay-2{animation-delay:.16s}@keyframes reveal{from{opacity:0;translate:0 18px}to{opacity:1;translate:0 0}}
.hero{min-height:470px;padding:58px 52px;display:grid;grid-template-columns:minmax(0,1.25fr) minmax(260px,.75fr);overflow:hidden;position:relative}.hero:before{content:"";position:absolute;inset:0;background:radial-gradient(circle at 76% 28%,color-mix(in srgb,var(--accent) 24%,transparent),transparent 34%),linear-gradient(115deg,transparent 44%,rgba(255,255,255,.035) 44% 55%,transparent 55%)}.hero-copy{position:relative;z-index:2;align-self:center}.eyebrow{color:var(--accent);font-size:10px;font-weight:800;letter-spacing:.2em;margin-bottom:20px}.hero h1,.page-head h1,.section-block h2{font-family:"Playfair Display",Georgia,serif;margin:0;letter-spacing:-.04em;line-height:.94;white-space:pre-line}.hero h1{font-size:clamp(54px,8vw,98px);max-width:760px}.lead{font-size:15px;line-height:1.7;color:var(--muted);max-width:720px;margin:24px 0 0}.hero-actions{display:flex;gap:12px;flex-wrap:wrap;margin-top:34px}.btn{border:1px solid var(--line);border-radius:18px;padding:14px 20px;font-weight:800;cursor:pointer;transition:translate .25s ease,background .25s ease,border-color .25s ease,box-shadow .25s ease,scale .12s}.btn:hover{translate:0 -2px}.btn-primary{background:var(--accent);border-color:var(--accent);color:white;box-shadow:0 12px 28px color-mix(in srgb,var(--accent) 25%,transparent)}.btn-primary:hover{box-shadow:0 16px 38px color-mix(in srgb,var(--accent) 35%,transparent)}.btn-ghost{background:var(--control-bg)}
.hero-orbit{min-height:330px;position:relative;align-self:center}.orbit-ring{position:absolute;border:1px solid color-mix(in srgb,var(--accent) 25%,var(--line));border-radius:50%;animation:spin 15s linear infinite}.ring-1{width:270px;height:270px;right:10px;top:10px}.ring-2{width:185px;height:185px;right:52px;top:52px;animation-direction:reverse;animation-duration:11s}@keyframes spin{to{rotate:360deg}}.orbit-dot{position:absolute;width:9px;height:9px;border-radius:50%;background:var(--accent);box-shadow:0 0 24px var(--accent);animation:pulse 2.2s ease-in-out infinite}.d1{right:70px;top:22px}.d2{right:210px;bottom:62px;animation-delay:-1s}@keyframes pulse{50%{scale:1.5;opacity:.5}}.hero-card{position:absolute;right:0;bottom:46px;width:220px;height:94px;border:1px solid color-mix(in srgb,var(--accent) 26%,var(--line));border-radius:24px;background:var(--hero-card-bg);backdrop-filter:blur(12px);display:flex;flex-direction:column;justify-content:center;padding:20px;box-shadow:var(--shadow)}.hero-card span{font-size:10px;color:var(--muted);letter-spacing:.12em}.hero-card strong{margin-top:8px}.floating{animation:float 4s ease-in-out infinite}@keyframes float{50%{translate:0 -8px}}
.micro-stats{display:grid;grid-template-columns:repeat(3,1fr);padding:12px;margin-top:18px}.micro-stats article{min-height:86px;display:flex;align-items:center;gap:20px;padding:16px 22px;border-right:1px solid var(--line)}.micro-stats article:last-child{border:0}.micro-stats b{font-family:"Playfair Display";color:var(--accent);font-size:18px}.micro-stats strong,.micro-stats span{display:block}.micro-stats strong{font-size:12px}.micro-stats span{font-size:10px;color:var(--muted);margin-top:6px}
.section-block{padding:74px 0 10px}.section-block h2{font-size:clamp(42px,6vw,72px);max-width:950px}.section-desc{color:var(--muted);margin:16px 0 28px}.feature-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:14px}.feature-card{min-height:220px;text-align:left;padding:28px;border-color:var(--line);cursor:pointer;position:relative;color:var(--text)}.feature-card:hover{translate:0 -5px;border-color:color-mix(in srgb,var(--accent) 52%,var(--line))}.feature-number{position:absolute;right:24px;top:20px;font-family:"Playfair Display";font-size:24px;color:var(--line-strong)}.feature-icon{width:58px;height:58px;display:grid;place-items:center;border:1px solid color-mix(in srgb,var(--accent) 40%,var(--line));border-radius:18px;color:var(--accent);font-size:23px;margin-bottom:26px;background:color-mix(in srgb,var(--accent) 9%,transparent)}.feature-card strong{display:block;font-family:"Playfair Display";font-size:26px}.feature-card small{display:block;color:var(--muted);margin-top:8px}.feature-card i{position:absolute;right:26px;bottom:23px;color:var(--accent);font-style:normal;font-size:20px;transition:translate .25s}.feature-card:hover i{translate:5px 0}
.page-head{padding:54px 8px 30px}.page-head h1{font-size:clamp(56px,8vw,96px)}.catalog-controls{padding:20px;margin-bottom:18px}.segmented{display:flex;gap:8px;flex-wrap:wrap}.segmented+.segmented{margin-top:10px}.seg-btn{border:1px solid var(--line);background:var(--control-bg);padding:12px 18px;border-radius:15px;cursor:pointer;font-weight:800;transition:.25s}.seg-btn:hover{border-color:var(--line-strong);translate:0 -1px}.seg-btn.is-active{background:var(--accent);border-color:var(--accent);color:white;box-shadow:0 8px 25px color-mix(in srgb,var(--accent) 22%,transparent)}.mini .seg-btn{padding:10px 15px;font-size:13px}.filters{margin-top:16px;display:grid;grid-template-columns:repeat(4,minmax(0,1fr)) auto;gap:9px}.filters label{display:block}.filters label span{display:block;font-size:10px;color:var(--muted);margin:0 0 6px 5px}.field{width:100%;min-height:46px;border:1px solid var(--line);border-radius:14px;background:var(--control-bg);color:var(--text);padding:0 13px;outline:none;font-weight:700;transition:border-color .25s,box-shadow .25s,background .25s}.field:focus{border-color:var(--accent);box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 13%,transparent)}.reset-btn{align-self:end;min-height:46px;padding:10px 16px}.pack-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:14px}.pack-card{padding:24px;min-height:300px;position:relative;overflow:hidden;cursor:pointer}.pack-card:after{content:"";position:absolute;width:140px;height:140px;border-radius:50%;right:-50px;bottom:-55px;border:1px solid color-mix(in srgb,var(--accent) 25%,transparent);box-shadow:0 0 70px color-mix(in srgb,var(--accent) 11%,transparent)}.pack-card:hover{translate:0 -5px;border-color:color-mix(in srgb,var(--accent) 44%,var(--line))}.pack-top{display:flex;align-items:center;justify-content:space-between;gap:8px}.pack-id{font-size:10px;color:var(--muted);letter-spacing:.16em}.badge{font-size:9px;border:1px solid color-mix(in srgb,var(--accent) 50%,var(--line));color:var(--accent);padding:6px 9px;border-radius:99px;min-height:28px}.pack-card h3{font-family:"Playfair Display";font-size:31px;margin:34px 0 6px}.pack-card p{color:var(--muted);font-size:12px;line-height:1.6;min-height:58px}.media-row{display:flex;gap:7px;flex-wrap:wrap;margin-top:18px}.media-chip{font-size:10px;padding:7px 9px;border-radius:10px;background:var(--control-bg);border:1px solid var(--line)}.pack-bottom{position:absolute;left:24px;right:24px;bottom:22px;display:flex;justify-content:space-between;align-items:flex-end}.price{font-size:24px;font-weight:800}.stock{font-size:12px;color:var(--muted);text-align:right}.stock strong{display:block;color:var(--text);font-size:16px}.stock.low strong{color:var(--accent)}.empty{padding:60px;text-align:center;margin-top:16px}.empty .spark{font-size:34px;color:var(--accent);animation:pulse 2s infinite}.empty h3{font-family:"Playfair Display";font-size:32px;margin:10px}.empty p{color:var(--muted)}
.instruction-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:14px}.instruction-card{padding:30px;min-height:200px}.instruction-card:hover{translate:0 -3px;border-color:var(--line-strong)}.instruction-card b{font-family:"Playfair Display";color:var(--accent);font-size:18px}.instruction-card h3{font-family:"Playfair Display";font-size:30px;margin:22px 0 10px}.instruction-card p{color:var(--muted);line-height:1.7;font-size:13px}
.profile-shell{min-height:340px;padding:26px}.profile-loading{min-height:285px;display:flex;align-items:center;justify-content:center;gap:13px;color:var(--muted)}.spinner{width:28px;height:28px;border-radius:50%;border:3px solid var(--line);border-top-color:var(--accent);animation:spin .8s linear infinite}.profile-main-row{display:flex;align-items:center;gap:16px}.avatar{width:70px;height:70px;display:grid;place-items:center;border-radius:24px;background:linear-gradient(140deg,var(--accent),#9a4cff);font-weight:800;font-size:24px;color:white;box-shadow:0 12px 34px color-mix(in srgb,var(--accent) 24%,transparent)}.profile-id{flex:1}.profile-id strong{display:block;font-size:21px}.profile-id span{display:block;color:var(--muted);font-size:12px;margin-top:4px}.profile-stats{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;margin-top:24px}.profile-stats article{border:1px solid var(--line);border-radius:18px;padding:18px;background:var(--control-bg);transition:.25s}.profile-stats article:hover{translate:0 -2px;border-color:var(--line-strong)}.profile-stats span{display:block;color:var(--muted);font-size:10px}.profile-stats strong{display:block;font-size:24px;margin-top:7px}.profile-section-title{display:flex;justify-content:space-between;align-items:end;margin:28px 0 12px}.profile-section-title span{color:var(--muted);font-size:10px}.purchase-list{display:grid;gap:8px}.purchase-item{display:flex;justify-content:space-between;align-items:center;padding:14px 16px;border:1px solid var(--line);border-radius:14px;background:var(--control-bg);animation:reveal .35s both}.purchase-item small{display:block;color:var(--muted);margin-top:3px}.purchase-item .purchase-price{font-weight:800;color:var(--accent)}.purchase-empty{color:var(--muted);font-size:12px;padding:18px;border:1px dashed var(--line);border-radius:14px;text-align:center}
.bottom-nav{position:fixed;z-index:60;left:12px;right:12px;bottom:max(12px,env(safe-area-inset-bottom));margin-inline:auto;max-width:620px;height:var(--nav-h);padding:7px;display:grid;grid-template-columns:repeat(4,1fr);gap:5px;border-radius:26px;transition:background .28s,border-color .28s,box-shadow .28s}.nav-item{border:1px solid transparent;background:transparent;border-radius:19px;color:var(--muted);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;cursor:pointer;transition:background .25s,color .25s,border-color .25s,scale .12s}.nav-item span{font-size:20px;transition:scale .25s}.nav-item small{font-size:9px;font-weight:800}.nav-item.is-active{color:var(--accent);background:color-mix(in srgb,var(--accent) 11%,transparent);border-color:color-mix(in srgb,var(--accent) 30%,var(--line))}.nav-item.is-active span{scale:1.08}.nav-item:hover{color:var(--text)}
.modal-backdrop{position:fixed;inset:0;z-index:100;background:rgba(0,0,0,.62);backdrop-filter:blur(12px);display:grid;place-items:center;padding:18px;animation:fadeIn .2s ease}.modal-backdrop[hidden]{display:none}@keyframes fadeIn{from{opacity:0}to{opacity:1}}.modal{position:relative;width:min(560px,100%);max-height:min(760px,calc(100svh - 36px));overflow:auto;padding:30px;border-radius:30px;animation:modalIn .25s cubic-bezier(.2,.8,.2,1)}@keyframes modalIn{from{opacity:0;translate:0 18px;scale:.98}}.modal-close{position:sticky;z-index:2;top:0;float:right;width:38px;height:38px;border-radius:13px;border:1px solid var(--line);background:color-mix(in srgb,var(--surface) 90%,transparent);font-size:24px;cursor:pointer}.modal h2{font-family:"Playfair Display";font-size:42px;line-height:1;margin:16px 0}.modal p{color:var(--muted);line-height:1.65}.payment-providers{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:20px 0}.provider{border:1px solid var(--line);border-radius:20px;padding:18px;background:var(--control-bg);cursor:pointer;text-align:left;transition:.25s}.provider:hover,.provider.is-active{border-color:var(--accent);translate:0 -2px;box-shadow:0 10px 28px color-mix(in srgb,var(--accent) 12%,transparent)}.provider img{width:54px;height:54px;border-radius:16px;display:block;object-fit:cover;margin-bottom:12px}.provider strong,.provider small{display:block}.provider small{color:var(--muted);margin-top:4px}.amount-wrap{position:relative}.amount-wrap:before{content:"$";position:absolute;left:16px;top:50%;translate:0 -50%;font-weight:800}.amount-wrap .field{padding-left:34px;height:54px;font-size:18px}.quick-amounts{display:flex;gap:7px;flex-wrap:wrap;margin:10px 0 20px}.quick-amounts button{border:1px solid var(--line);background:var(--control-bg);color:var(--text);padding:8px 11px;border-radius:12px;cursor:pointer;transition:.2s}.quick-amounts button:hover{border-color:var(--accent);color:var(--accent)}.modal-actions{display:flex;gap:9px;margin-top:22px}.modal-actions .btn{flex:1}.pack-modal-meta{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin:16px 0}.pack-modal-meta div{border:1px solid var(--line);border-radius:15px;padding:13px}.pack-modal-meta small,.pack-modal-meta strong{display:block}.pack-modal-meta small{color:var(--muted);font-size:9px}.pack-modal-meta strong{margin-top:5px}.payment-status{margin-top:14px;padding:12px;border:1px solid var(--line);border-radius:13px;color:var(--muted);font-size:12px}
.toast{position:fixed;z-index:200;left:50%;bottom:calc(var(--nav-h) + 28px + env(safe-area-inset-bottom));translate:-50% 18px;opacity:0;pointer-events:none;max-width:min(500px,calc(100% - 28px));padding:13px 17px;border:1px solid var(--line-strong);border-radius:15px;background:color-mix(in srgb,var(--surface) 94%,transparent);box-shadow:var(--shadow);backdrop-filter:blur(18px);font-size:12px;font-weight:800;transition:opacity .22s,translate .22s}.toast.show{opacity:1;translate:-50% 0}
@media(max-width:900px){.hero{grid-template-columns:1fr;min-height:auto;padding:44px 32px}.hero-orbit{display:none}.feature-grid{grid-template-columns:1fr 1fr}.pack-grid{grid-template-columns:1fr 1fr}.filters{grid-template-columns:1fr 1fr}.reset-btn{grid-column:span 2}.profile-stats{grid-template-columns:1fr 1fr}}
@media(max-width:620px){:root{--radius:23px;--nav-h:68px}.topbar{margin:8px 8px 0;padding:7px 8px 7px 16px;border-radius:20px;min-height:56px;top:max(6px,env(safe-area-inset-top))}.brand{font-size:15px}.menu-word{display:none}.icon-btn{width:43px;height:40px}.app-shell{margin-top:14px;padding:0 8px}.hero{padding:32px 22px;border-radius:26px}.hero h1{font-size:clamp(46px,15vw,70px)}.lead{font-size:13px;margin-top:18px}.hero-actions{margin-top:24px}.hero-actions .btn{width:100%}.micro-stats{grid-template-columns:1fr;padding:8px;border-radius:22px}.micro-stats article{min-height:72px;border-right:0;border-bottom:1px solid var(--line);padding:12px 14px}.section-block{padding-top:48px}.section-block h2{font-size:42px}.feature-grid{grid-template-columns:1fr}.feature-card{min-height:168px}.page-head{padding:40px 4px 24px}.page-head h1{font-size:58px}.catalog-controls{padding:14px}.segmented{display:grid;grid-template-columns:1fr 1fr}.mini{grid-template-columns:repeat(3,1fr)}.seg-btn{padding:11px 10px;font-size:12px}.mini .seg-btn{padding:9px 5px;font-size:10px}.filters{grid-template-columns:1fr 1fr}.pack-grid{grid-template-columns:1fr}.pack-card{min-height:280px}.instruction-grid{grid-template-columns:1fr}.instruction-card{min-height:175px;padding:24px}.profile-shell{padding:18px}.profile-main-row{align-items:flex-start;flex-wrap:wrap}.profile-main-row .btn{margin-left:auto}.avatar{width:58px;height:58px;border-radius:19px}.profile-stats{grid-template-columns:1fr 1fr}.profile-stats article{padding:14px}.profile-stats strong{font-size:20px}.bottom-nav{left:8px;right:8px;bottom:max(8px,env(safe-area-inset-bottom));border-radius:22px;padding:6px}.nav-item{border-radius:16px}.nav-item span{font-size:18px}.nav-item small{font-size:8px}.modal{padding:22px;border-radius:24px}.modal h2{font-size:36px}.payment-providers{grid-template-columns:1fr 1fr}.provider{padding:13px}.provider img{width:45px;height:45px}.pack-modal-meta{grid-template-columns:1fr 1fr}.toast{bottom:calc(var(--nav-h) + 21px + env(safe-area-inset-bottom))}}
@media(max-width:360px){.filters{grid-template-columns:1fr}.reset-btn{grid-column:auto}.profile-stats{grid-template-columns:1fr}.payment-providers{grid-template-columns:1fr}.nav-item small{font-size:7px}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation-duration:.001ms!important;animation-iteration-count:1!important;scroll-behavior:auto!important;transition-duration:.001ms!important}}

/* Theme switch hardening: true light/dark surfaces without washed-out overlays. */
html{color-scheme:dark}
html[data-theme="light"]{color-scheme:light}
html[data-theme="light"] .ambient{opacity:.08}
html[data-theme="light"] .hero:before{background:radial-gradient(circle at 76% 28%,color-mix(in srgb,var(--accent) 16%,transparent),transparent 36%),linear-gradient(115deg,transparent 44%,rgba(70,40,58,.025) 44% 55%,transparent 55%)}
html[data-theme="light"] .surface{background:linear-gradient(145deg,rgba(255,252,254,.98),rgba(247,237,243,.94))}
html[data-theme="light"] .glass{background:rgba(255,250,253,.92)}
html[data-theme="light"] .hero-card{box-shadow:0 20px 54px rgba(126,76,103,.16)}
html[data-theme="light"] .field::placeholder{color:#9a8993}
body,.glass,.surface,.field,.btn,.seg-btn,.provider,.profile-stats article,.purchase-item,.media-chip,.quick-amounts button,.hero-card{transition-property:background-color,background,border-color,color,box-shadow,translate,scale;transition-duration:.32s;transition-timing-function:ease}


/* ===== v1.4 dark-pink default / premium switch / global motion ===== */
:root{
  --ease-premium:cubic-bezier(.16,1,.3,1);
  --motion-fast:180ms;
  --motion-mid:340ms;
  --motion-slow:620ms;
}

/* Красивый slider-переключатель темы */
.theme-switch{
  width:76px;height:42px;padding:0;position:relative;overflow:hidden;isolation:isolate;
  border:1px solid color-mix(in srgb,var(--accent) 28%,var(--line));
  border-radius:16px;background:color-mix(in srgb,var(--surface-2) 86%,transparent);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.05),0 10px 26px rgba(0,0,0,.22);
  cursor:pointer;
  transition:transform var(--motion-fast) var(--ease-premium),border-color var(--motion-mid) var(--ease-premium),box-shadow var(--motion-mid) var(--ease-premium),background var(--motion-mid) var(--ease-premium)
}
.theme-switch:hover{transform:translateY(-1px);border-color:color-mix(in srgb,var(--accent) 60%,var(--line));box-shadow:0 14px 34px color-mix(in srgb,var(--accent) 15%,rgba(0,0,0,.28))}
.theme-switch:active{transform:scale(.975)}
.theme-switch-track{position:absolute;inset:4px;display:grid;grid-template-columns:1fr 1fr;align-items:center;border-radius:12px}
.theme-switch-thumb{
  position:absolute;top:0;right:0;width:34px;height:34px;border-radius:11px;z-index:0;
  background:linear-gradient(145deg,#2a1b25,#120c11);
  border:1px solid color-mix(in srgb,var(--accent) 52%,rgba(255,255,255,.1));
  box-shadow:0 8px 22px rgba(0,0,0,.34),0 0 24px color-mix(in srgb,var(--accent) 20%,transparent),inset 0 1px 0 rgba(255,255,255,.08);
  transition:transform var(--motion-mid) var(--ease-premium),background var(--motion-mid) var(--ease-premium),border-color var(--motion-mid) var(--ease-premium),box-shadow var(--motion-mid) var(--ease-premium)
}
.theme-icon{
  width:34px;height:34px;display:grid;place-items:center;position:relative;z-index:1;
  font-size:15px;color:var(--muted);opacity:.55;transform:scale(.88);
  transition:color var(--motion-mid) var(--ease-premium),opacity var(--motion-mid) var(--ease-premium),transform var(--motion-mid) var(--ease-premium),filter var(--motion-mid) var(--ease-premium)
}
.theme-switch .moon{color:var(--accent);opacity:1;transform:scale(1);filter:drop-shadow(0 0 8px color-mix(in srgb,var(--accent) 55%,transparent))}
html[data-theme="light"] .theme-switch{background:rgba(65,42,56,.055);border-color:rgba(65,42,56,.13)}
html[data-theme="light"] .theme-switch-thumb{
  transform:translateX(-34px);background:linear-gradient(145deg,#fff,#f8edf3);border-color:rgba(62,38,52,.12);
  box-shadow:0 7px 18px rgba(126,76,103,.16),0 0 18px rgba(255,61,152,.09),inset 0 1px 0 rgba(255,255,255,.9)
}
html[data-theme="light"] .theme-switch .moon{color:var(--muted);opacity:.5;transform:scale(.88);filter:none}
html[data-theme="light"] .theme-switch .sun{color:var(--accent);opacity:1;transform:scale(1.04) rotate(12deg);filter:drop-shadow(0 0 7px color-mix(in srgb,var(--accent) 35%,transparent))}

/* Смена темы без резкого моргания */
html.theme-changing *,html.theme-changing *::before,html.theme-changing *::after{
  transition:color var(--motion-mid) var(--ease-premium),background-color var(--motion-mid) var(--ease-premium),background var(--motion-mid) var(--ease-premium),border-color var(--motion-mid) var(--ease-premium),box-shadow var(--motion-mid) var(--ease-premium),fill var(--motion-mid) var(--ease-premium),stroke var(--motion-mid) var(--ease-premium)!important
}
::view-transition-old(root),::view-transition-new(root){animation-duration:460ms;animation-timing-function:var(--ease-premium)}
::view-transition-old(root){animation-name:theme-out}
::view-transition-new(root){animation-name:theme-in}
@keyframes theme-out{to{opacity:.15;filter:blur(2px)}}
@keyframes theme-in{from{opacity:.15;filter:blur(2px)}}

/* Плавность во всём интерфейсе */
:where(button,a,input,.surface,.glass,.btn,.seg-btn,.provider,.nav-item,.feature-card,.pack-card,.instruction-card,.profile-stats article,.purchase-item,.media-chip,.quick-amounts button,.modal,.modal-close,.hero-card,.field){
  transition:color var(--motion-mid) var(--ease-premium),background-color var(--motion-mid) var(--ease-premium),background var(--motion-mid) var(--ease-premium),border-color var(--motion-mid) var(--ease-premium),box-shadow var(--motion-mid) var(--ease-premium),opacity var(--motion-mid) var(--ease-premium),transform var(--motion-mid) var(--ease-premium),translate var(--motion-mid) var(--ease-premium),scale var(--motion-fast) var(--ease-premium),filter var(--motion-mid) var(--ease-premium)
}
.surface,.feature-card,.pack-card,.provider{position:relative;overflow:hidden}
.glass{overflow:hidden}
.surface::after,.glass::after,.feature-card::after,.pack-card::after,.provider::after{
  content:"";position:absolute;inset:0;border-radius:inherit;pointer-events:none;opacity:0;
  background:radial-gradient(240px circle at var(--mx,50%) var(--my,50%),color-mix(in srgb,var(--accent) 12%,transparent),transparent 70%);
  transition:opacity var(--motion-mid) var(--ease-premium)
}
.surface:hover::after,.glass:hover::after,.feature-card:hover::after,.pack-card:hover::after,.provider:hover::after{opacity:1}
button:not(:disabled):active{scale:.975}
button:focus-visible,input:focus-visible{outline:2px solid color-mix(in srgb,var(--accent) 72%,white);outline-offset:3px}
button:disabled{opacity:.48;cursor:not-allowed;filter:saturate(.6)}
.brand:hover{transform:translateY(-1px)}
.brand .accent{display:inline-block;animation:accent-breathe 3.6s ease-in-out infinite}
@keyframes accent-breathe{50%{filter:drop-shadow(0 0 9px color-mix(in srgb,var(--accent) 45%,transparent))}}
.topbar{animation:topbar-enter .58s var(--ease-premium) both}
@keyframes topbar-enter{from{opacity:0;transform:translateY(-14px);filter:blur(4px)}}
.hero-copy>*{animation:hero-enter .62s var(--ease-premium) both}
.hero-copy>*:nth-child(2){animation-delay:.06s}.hero-copy>*:nth-child(3){animation-delay:.12s}.hero-copy>*:nth-child(4){animation-delay:.18s}
@keyframes hero-enter{from{opacity:0;transform:translateY(16px);filter:blur(4px)}}
.micro-stats article:hover{background:color-mix(in srgb,var(--accent) 5%,transparent);transform:translateY(-2px)}
.feature-card:hover .feature-icon{transform:translateY(-3px) rotate(-2deg) scale(1.04);box-shadow:0 10px 28px color-mix(in srgb,var(--accent) 13%,transparent)}
.pack-card:hover{transform:translateY(-5px)}
.field:focus{border-color:color-mix(in srgb,var(--accent) 64%,var(--line));box-shadow:0 0 0 4px color-mix(in srgb,var(--accent) 10%,transparent);transform:translateY(-1px)}
.provider:hover img,.provider.is-active img{transform:scale(1.05) rotate(-1deg);filter:saturate(1.08)}
.provider img{transition:transform var(--motion-mid) var(--ease-premium),filter var(--motion-mid) var(--ease-premium)}
.nav-item:hover span{transform:translateY(-2px) scale(1.06)}
.nav-item.is-active span{animation:nav-pop .34s var(--ease-premium)}
@keyframes nav-pop{0%{transform:scale(.82)}70%{transform:scale(1.13)}100%{transform:scale(1.08)}}
.modal{animation:modal-premium .42s var(--ease-premium) both}
@keyframes modal-premium{from{opacity:0;transform:translateY(22px) scale(.965);filter:blur(5px)}}
.modal-close:hover{transform:rotate(5deg) scale(1.04);border-color:color-mix(in srgb,var(--accent) 45%,var(--line))}
.toast.show{animation:toast-pop .36s var(--ease-premium)}
@keyframes toast-pop{0%{transform:translate(-50%,10px) scale(.96)}100%{transform:translate(-50%,0) scale(1)}}

/* Появление элементов при прокрутке, без изменения layout */
.motion-ready{opacity:0;transform:translateY(14px)}
.motion-ready.motion-visible{opacity:1;transform:translateY(0);transition:opacity var(--motion-slow) var(--ease-premium),transform var(--motion-slow) var(--ease-premium),border-color var(--motion-mid) var(--ease-premium),box-shadow var(--motion-mid) var(--ease-premium),background var(--motion-mid) var(--ease-premium)}

@media(hover:none){
  .surface:hover::after,.glass:hover::after,.feature-card:hover::after,.pack-card:hover::after,.provider:hover::after{opacity:0}
  .feature-card:hover,.pack-card:hover,.btn:hover,.seg-btn:hover,.provider:hover{transform:none;translate:0 0}
}
@media(max-width:620px){
  .theme-switch{width:70px;height:40px;border-radius:15px}
  .theme-switch-thumb,.theme-icon{width:32px;height:32px}
  html[data-theme="light"] .theme-switch-thumb{transform:translateX(-30px)}
}
@media(prefers-reduced-motion:reduce){
  ::view-transition-old(root),::view-transition-new(root){animation:none!important}
  .brand .accent,.hero-copy>*,.topbar,.nav-item.is-active span{animation:none!important}
  .motion-ready{opacity:1!important;transform:none!important}
}

/* ===== v1.5 fixed nav / mobile Telegram WebApp / voice coming soon ===== */
:root{
  --tg-safe-top:0px;
  --tg-safe-bottom:0px;
  --tg-content-safe-top:0px;
  --tg-content-safe-bottom:0px;
  --nav-edge:12px;
}

/* Brand words are intentionally separated. */
.brand{
  display:inline-flex;
  align-items:baseline;
  gap:.34em;
  white-space:nowrap;
}
.brand .accent{margin-left:0}

/* v1.4 used .glass { position:relative }, which overrode fixed navigation.
   Keep glass effects without changing component positioning. */
.surface,.feature-card,.pack-card,.provider{position:relative;overflow:hidden}
.glass{overflow:hidden}

.bottom-nav{
  position:fixed !important;
  z-index:1000;
  left:50% !important;
  right:auto !important;
  top:auto !important;
  bottom:max(var(--nav-edge), env(safe-area-inset-bottom, 0px), var(--tg-safe-bottom), var(--tg-content-safe-bottom)) !important;
  width:min(620px, calc(100vw - 24px));
  max-width:none;
  margin:0 !important;
  transform:translate3d(-50%,0,0) !important;
  translate:none !important;
  scale:1 !important;
  isolation:isolate;
  contain:layout paint style;
  will-change:auto;
  backface-visibility:hidden;
  -webkit-transform:translate3d(-50%,0,0) !important;
}
.bottom-nav::after{z-index:-1}
.bottom-nav:hover,.bottom-nav:active{transform:translate3d(-50%,0,0) !important}
.nav-item{min-width:0;min-height:56px;padding:5px 4px}
.nav-item small{max-width:100%;line-height:1.05;text-align:center;white-space:normal;text-wrap:balance}

body{
  min-height:var(--app-height);
  padding-bottom:calc(var(--nav-h) + 34px + max(env(safe-area-inset-bottom, 0px), var(--tg-safe-bottom), var(--tg-content-safe-bottom)));
  overscroll-behavior-y:none;
}
.app-shell{padding-bottom:16px}

/* Voice creation placeholder */
.coming-soon{
  min-height:390px;
  margin-bottom:22px;
  padding:44px 28px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  text-align:center;
  overflow:hidden;
}
.coming-soon h2{
  margin:0;
  font-family:"Playfair Display",Georgia,serif;
  font-size:clamp(58px,10vw,106px);
  line-height:.92;
  letter-spacing:-.045em;
}
.coming-soon p{margin:18px 0 0;color:var(--muted);font-size:15px}
.voice-pulse{
  height:74px;
  display:flex;
  align-items:center;
  gap:7px;
  margin-bottom:24px;
}
.voice-pulse span{
  width:7px;
  height:24px;
  border-radius:999px;
  background:linear-gradient(180deg,var(--accent2),var(--accent));
  box-shadow:0 0 24px color-mix(in srgb,var(--accent) 30%,transparent);
  transform-origin:center;
  animation:voice-wave 1.15s ease-in-out infinite;
}
.voice-pulse span:nth-child(2),.voice-pulse span:nth-child(4){animation-delay:-.25s;height:42px}
.voice-pulse span:nth-child(3){animation-delay:-.5s;height:62px}
.voice-pulse span:nth-child(5){animation-delay:-.7s}
@keyframes voice-wave{0%,100%{transform:scaleY(.48);opacity:.52}50%{transform:scaleY(1);opacity:1}}

/* Telegram Mini App / phone layout */
@media(max-width:620px){
  :root{--nav-h:76px;--nav-edge:6px}
  html,body{width:100%;max-width:100%;overflow-x:hidden}
  body{padding-bottom:calc(var(--nav-h) + 22px + max(env(safe-area-inset-bottom, 0px), var(--tg-safe-bottom), var(--tg-content-safe-bottom)))}
  .topbar{
    width:calc(100% - 12px);
    margin:6px auto 0;
    top:max(5px, env(safe-area-inset-top, 0px), var(--tg-content-safe-top));
    padding:7px 7px 7px 13px;
    min-height:54px;
  }
  .brand{font-size:13px;gap:.28em;letter-spacing:-.4px}
  .theme-switch{width:64px;height:38px}
  .theme-switch-thumb,.theme-icon{width:30px;height:30px}
  html[data-theme="light"] .theme-switch-thumb{transform:translateX(-26px)}
  .app-shell{width:100%;margin-top:10px;padding:0 7px 10px}
  .hero{padding:28px 18px;min-height:0}
  .hero h1{font-size:clamp(42px,14vw,62px);line-height:.93}
  .lead{font-size:12.5px;line-height:1.58;margin-top:16px}
  .hero-actions{gap:8px;margin-top:22px}
  .btn{min-height:46px;border-radius:15px;padding:12px 15px}
  .micro-stats{margin-top:10px}
  .section-block{padding-top:38px}
  .section-block h2{font-size:clamp(36px,11.5vw,52px);line-height:.96}
  .section-desc{font-size:12px;line-height:1.55;margin:12px 0 20px}
  .feature-grid{gap:9px}
  .feature-card{min-height:142px;padding:20px}
  .feature-icon{width:48px;height:48px;border-radius:15px;margin-bottom:18px;font-size:19px}
  .feature-card strong{font-size:23px;line-height:1.02}
  .feature-card small{font-size:10px;line-height:1.35;max-width:82%}
  .page-head{padding:32px 4px 18px}
  .page-head h1{font-size:clamp(44px,14vw,64px);overflow-wrap:anywhere}
  .catalog-controls{padding:11px;border-radius:20px}
  .segmented{gap:6px}.segmented+.segmented{margin-top:7px}
  .seg-btn{min-height:42px;padding:9px 8px;border-radius:12px;font-size:11px}
  .mini .seg-btn{font-size:9.5px;padding:8px 3px}
  .filters{grid-template-columns:1fr;gap:8px;margin-top:12px}
  .reset-btn{grid-column:auto;width:100%}
  .field{min-height:44px}
  .pack-grid{gap:9px}
  .pack-card{min-height:250px;padding:19px;border-radius:22px}
  .pack-card h3{font-size:27px;line-height:1.02}
  .profile-shell{padding:14px;border-radius:22px}
  .profile-main-row{gap:10px}
  .profile-main-row .btn{width:100%;margin-left:0}
  .profile-id{min-width:0}.profile-id strong,.profile-id span{overflow-wrap:anywhere}
  .profile-stats{gap:7px}
  .profile-stats article{min-width:0;padding:12px}
  .purchase-item{gap:8px;align-items:flex-start}
  .purchase-item>div{min-width:0}.purchase-item strong,.purchase-item small{overflow-wrap:anywhere}
  .coming-soon{min-height:calc(min(430px, var(--app-height) - 180px));padding:34px 18px;border-radius:24px}
  .coming-soon h2{font-size:clamp(54px,18vw,78px)}
  .voice-pulse{height:62px;margin-bottom:18px}
  .voice-pulse span{width:6px}
  .bottom-nav{
    width:calc(100vw - 12px);
    height:var(--nav-h);
    padding:5px;
    gap:3px;
    border-radius:22px;
  }
  .nav-item{min-height:64px;border-radius:17px;gap:3px;padding:5px 2px}
  .nav-item span{font-size:17px;line-height:1}
  .nav-item small{font-size:7.5px;font-weight:800;letter-spacing:-.02em}
  .modal-backdrop{padding:8px;padding-top:max(8px, env(safe-area-inset-top, 0px), var(--tg-safe-top))}
  .modal{
    width:100%;max-height:calc(var(--app-height) - 18px - max(env(safe-area-inset-top,0px), var(--tg-safe-top)) - max(env(safe-area-inset-bottom,0px), var(--tg-safe-bottom)));
    overflow-y:auto;overscroll-behavior:contain;
    padding:20px 16px calc(18px + max(env(safe-area-inset-bottom,0px), var(--tg-safe-bottom)));
  }
  .modal h2{font-size:clamp(32px,10vw,42px)}
  .payment-providers{grid-template-columns:1fr;gap:8px}
  .provider{min-height:72px;display:grid;grid-template-columns:48px 1fr;grid-template-rows:auto auto;column-gap:12px;text-align:left}
  .provider img{grid-row:1/3;margin:0;width:44px;height:44px}.provider strong,.provider small{align-self:end}.provider small{align-self:start}
  .quick-amounts{grid-template-columns:repeat(5,1fr);gap:5px}.quick-amounts button{padding:9px 2px;font-size:10px}
  .modal-actions{display:grid;grid-template-columns:1fr 1fr;gap:7px}
  .toast{width:calc(100% - 24px);max-width:420px;bottom:calc(var(--nav-h) + 14px + max(env(safe-area-inset-bottom,0px), var(--tg-safe-bottom), var(--tg-content-safe-bottom)))}
}

@media(max-width:390px){
  .brand{font-size:12px}
  .theme-switch{width:60px}
  .nav-item small{font-size:7px}
  .feature-card strong{font-size:21px}
  .profile-stats{grid-template-columns:1fr 1fr}
}

@media(max-width:340px){
  :root{--nav-h:72px}
  .topbar{padding-left:10px}.brand{font-size:11px;gap:.22em}
  .theme-switch{width:56px;height:36px}.theme-switch-thumb,.theme-icon{width:28px;height:28px}
  html[data-theme="light"] .theme-switch-thumb{transform:translateX(-24px)}
  .nav-item{min-height:60px}.nav-item small{font-size:6.4px}
  .hero{padding-inline:14px}.feature-card{padding:17px}
}

@media(prefers-reduced-motion:reduce){.voice-pulse span{animation:none}}


/* ===== v1.6 ultra-smooth motion =====
   Общая идея: никаких "ударов", резких scale и коротких 120–250ms скачков.
   Все интерактивные состояния используют один мягкий easing. */
:root{
  --ease-soft:cubic-bezier(.22,.78,.22,1);
  --ease-soft-out:cubic-bezier(.16,1,.3,1);
  --motion-fast:300ms;
  --motion-mid:520ms;
  --motion-slow:820ms;
  --motion-page:620ms;
}

/* Плавные состояния для всех основных интерактивных и визуальных блоков. */
body,
.topbar,
.glass,
.surface,
.btn,
.seg-btn,
.provider,
.field,
.feature-card,
.pack-card,
.profile-stats article,
.purchase-item,
.media-chip,
.quick-amounts button,
.hero-card,
.theme-switch,
.theme-switch-thumb,
.theme-icon,
.nav-item,
.nav-item span,
.modal-close,
.toast{
  transition-duration:var(--motion-mid) !important;
  transition-timing-function:var(--ease-soft) !important;
}

/* Нажатия — почти незаметные, без резкого "провала". */
.tap:active,
button:not(:disabled):active{
  scale:.992;
}
.theme-switch:active{transform:scale(.992)}
.btn:hover{translate:0 -1px}
.feature-card:hover{translate:0 -2px}
.pack-card:hover{transform:translateY(-2px)}
.seg-btn:hover{translate:0 0}
.provider:hover,.provider.is-active{translate:0 -1px}
.micro-stats article:hover{transform:translateY(-1px)}
.field:focus{transform:none}
.feature-card:hover .feature-icon{transform:translateY(-1px) scale(1.018)}
.provider:hover img,.provider.is-active img{transform:scale(1.018)}
.nav-item:hover span{transform:translateY(-1px) scale(1.02)}
.modal-close:hover{transform:scale(1.02)}

/* Переходы между разделами: сначала мягкий fade-out, затем fade-in. */
.view{
  display:none;
  opacity:0;
  transform:translateY(10px);
  translate:none;
  filter:blur(2px);
  will-change:opacity,transform,filter;
}
.view.is-active{
  display:block;
  animation:view-soft-in var(--motion-page) var(--ease-soft-out) both;
}
.view.is-active.is-leaving{
  display:block;
  animation:view-soft-out 320ms var(--ease-soft) both;
  pointer-events:none;
}
@keyframes view-soft-in{
  from{opacity:0;transform:translateY(10px);filter:blur(2px)}
  to{opacity:1;transform:translateY(0);filter:blur(0)}
}
@keyframes view-soft-out{
  from{opacity:1;transform:translateY(0);filter:blur(0)}
  to{opacity:0;transform:translateY(-4px);filter:blur(1px)}
}

/* Появление блоков и карточек — медленнее и без bounce. */
.reveal{
  animation-duration:760ms !important;
  animation-timing-function:var(--ease-soft-out) !important;
}
@keyframes reveal{
  from{opacity:0;translate:0 10px}
  to{opacity:1;translate:0 0}
}
.motion-ready{opacity:0;transform:translateY(10px)}
.motion-ready.motion-visible{
  transition-duration:var(--motion-slow) !important;
  transition-timing-function:var(--ease-soft-out) !important;
}

.topbar{animation-duration:780ms !important;animation-timing-function:var(--ease-soft-out) !important}
@keyframes topbar-enter{
  from{opacity:0;transform:translateY(-7px);filter:blur(2px)}
  to{opacity:1;transform:translateY(0);filter:blur(0)}
}
.hero-copy>*{
  animation-duration:820ms !important;
  animation-timing-function:var(--ease-soft-out) !important;
}
.hero-copy>*:nth-child(2){animation-delay:90ms}
.hero-copy>*:nth-child(3){animation-delay:170ms}
.hero-copy>*:nth-child(4){animation-delay:250ms}
@keyframes hero-enter{
  from{opacity:0;transform:translateY(10px);filter:blur(2px)}
  to{opacity:1;transform:translateY(0);filter:blur(0)}
}

/* Активная кнопка меню больше не "пружинит". */
.nav-item.is-active span{animation:nav-soft 520ms var(--ease-soft-out)}
@keyframes nav-soft{
  0%{transform:scale(.96);opacity:.7}
  55%{transform:scale(1.025);opacity:1}
  100%{transform:scale(1.00);opacity:1}
}

/* Модалки: плавно и открываются, и закрываются. */
.modal-backdrop{
  animation:backdrop-soft-in 520ms var(--ease-soft-out) both !important;
}
.modal{
  animation:modal-soft-in 560ms var(--ease-soft-out) both !important;
}
.modal-backdrop.is-closing{
  animation:backdrop-soft-out 380ms var(--ease-soft) both !important;
  pointer-events:none;
}
.modal-backdrop.is-closing .modal{
  animation:modal-soft-out 380ms var(--ease-soft) both !important;
}
@keyframes backdrop-soft-in{from{opacity:0}to{opacity:1}}
@keyframes backdrop-soft-out{from{opacity:1}to{opacity:0}}
@keyframes modal-soft-in{
  from{opacity:0;transform:translateY(12px) scale(.992);filter:blur(2px)}
  to{opacity:1;transform:translateY(0) scale(1);filter:blur(0)}
}
@keyframes modal-soft-out{
  from{opacity:1;transform:translateY(0) scale(1);filter:blur(0)}
  to{opacity:0;transform:translateY(6px) scale(.996);filter:blur(1px)}
}

/* Toast без "попа". */
.toast.show{animation:none !important}
.toast{
  transition:opacity 480ms var(--ease-soft),translate 480ms var(--ease-soft),background 520ms var(--ease-soft),border-color 520ms var(--ease-soft) !important;
}

/* Декоративные циклические анимации становятся спокойнее. */
.ambient{animation-duration:20s !important;animation-timing-function:ease-in-out !important}
.orbit-ring{animation-duration:28s !important}
.ring-2{animation-duration:22s !important}
.orbit-dot{animation-duration:3.8s !important}
.floating{animation-duration:7s !important}
.brand .accent{animation-duration:5.8s !important}
.spinner{animation-duration:1.35s !important}
.voice-pulse span{animation-duration:1.8s !important}

@keyframes pulse{
  0%,100%{scale:1;opacity:.82}
  50%{scale:1.18;opacity:.58}
}
@keyframes float{
  0%,100%{translate:0 0}
  50%{translate:0 -4px}
}
@keyframes voice-wave{
  0%,100%{transform:scaleY(.62);opacity:.66}
  50%{transform:scaleY(1);opacity:1}
}

/* Смена темы тоже без резкого flash. */
html.theme-changing *,html.theme-changing *::before,html.theme-changing *::after{
  transition-duration:620ms !important;
  transition-timing-function:var(--ease-soft) !important;
}
::view-transition-old(root),::view-transition-new(root){
  animation-duration:620ms !important;
  animation-timing-function:var(--ease-soft) !important;
}
@keyframes theme-out{to{opacity:.38;filter:blur(1px)}}
@keyframes theme-in{from{opacity:.38;filter:blur(1px)}}

/* На телефоне убираем hover-движения полностью — остаются только fade/color. */
@media(hover:none),(pointer:coarse){
  .btn:hover,.feature-card:hover,.pack-card:hover,.seg-btn:hover,.provider:hover,
  .micro-stats article:hover,.field:focus,.nav-item:hover span,.modal-close:hover{
    transform:none !important;
    translate:0 0 !important;
  }
}

@media(prefers-reduced-motion:reduce){
  .view.is-active,.view.is-active.is-leaving,.modal-backdrop,.modal,
  .modal-backdrop.is-closing,.modal-backdrop.is-closing .modal{
    animation:none !important;
  }
}


/* ===== v1.7 stability / Telegram WebApp audit fixes ===== */
:root{--visual-height:100svh}
html{background:var(--bg);overscroll-behavior:none}
body{min-height:max(var(--app-height),100svh);text-rendering:optimizeLegibility;-webkit-tap-highlight-color:transparent}

/* Fixed bottom navigation must never inherit decorative transforms. */
.bottom-nav{
  position:fixed !important;
  transform:translate3d(-50%,0,0) !important;
  translate:none !important;
  animation:none !important;
  transition:background var(--motion-mid) var(--ease-soft),border-color var(--motion-mid) var(--ease-soft),box-shadow var(--motion-mid) var(--ease-soft),color var(--motion-mid) var(--ease-soft) !important;
  will-change:auto;
}
.bottom-nav.motion-ready,.bottom-nav.motion-visible{opacity:1 !important;transform:translate3d(-50%,0,0) !important}

/* Modal tracks the actually visible viewport when the keyboard is open. */
.modal-backdrop{min-height:var(--visual-height);overscroll-behavior:contain}
.modal{max-height:calc(var(--visual-height) - 36px);overscroll-behavior:contain;-webkit-overflow-scrolling:touch}
body.modal-open{overscroll-behavior:none}

/* Long labels must not break narrow Telegram WebViews. */
.nav-item{min-width:0;overflow:hidden}
.nav-item small{display:grid;place-items:center;width:100%;min-height:2.1em;overflow:visible;text-overflow:clip;white-space:normal;line-height:1.05;padding-inline:2px;text-wrap:balance}
.brand{min-width:0}.brand span{white-space:nowrap}
.pack-card h3,.pack-card p,.purchase-item strong{overflow-wrap:anywhere}

/* No accidental hover motion on touch screens. */
@media(hover:none),(pointer:coarse){
  .surface:hover,.glass:hover,.feature-card:hover,.pack-card:hover,.provider:hover,.btn:hover,.nav-item:hover{transform:none;translate:none}
}

/* Graceful fallback when blur/color-mix is limited. */
@supports not ((backdrop-filter:blur(1px)) or (-webkit-backdrop-filter:blur(1px))){
  .glass,.surface,.bottom-nav,.modal{background:var(--surface-solid)}
}

@media(max-width:620px){
  .modal{max-height:calc(var(--visual-height) - 18px - max(env(safe-area-inset-top,0px),var(--tg-safe-top)) - max(env(safe-area-inset-bottom,0px),var(--tg-safe-bottom)))}
  .filters .field{font-size:16px} /* prevents iOS input zoom */
}

/* ===== v1.9.1 WebApp-only mobile hotfix ===== */
:root{
  --switch-w:72px;
  --switch-h:40px;
  --switch-pad:4px;
}

/* Telegram/iOS/Android: the document itself owns vertical scrolling. */
html{
  min-height:100%;
  height:auto;
  overflow-x:hidden;
  overflow-y:auto;
  overscroll-behavior-y:auto;
  -webkit-text-size-adjust:100%;
}
body{
  min-height:max(var(--app-height),100svh);
  height:auto;
  overflow-x:hidden !important;
  overflow-y:auto !important;
  overscroll-behavior-y:auto !important;
  touch-action:pan-y;
  -webkit-overflow-scrolling:touch;
}
body.modal-open{
  overflow:hidden !important;
  touch-action:none;
}
.app-shell{
  min-height:calc(var(--app-height) - 90px);
  overflow:visible;
  touch-action:pan-y;
}
.view.is-active{overflow:visible;touch-action:pan-y}

/* Keep fixed UI from intercepting swipe gestures outside its own controls. */
.topbar,.bottom-nav{touch-action:pan-y}
.topbar button,.bottom-nav button{touch-action:manipulation}

/* Responsive theme switch: the thumb always occupies exactly one half.
   No hard-coded translate values = no broken thumb on narrow phones. */
.theme-switch{
  width:var(--switch-w) !important;
  height:var(--switch-h) !important;
  min-width:var(--switch-w);
  flex:0 0 var(--switch-w);
  padding:0 !important;
  border-radius:16px;
  appearance:none;
  -webkit-appearance:none;
}
.theme-switch-track{
  inset:var(--switch-pad) !important;
  grid-template-columns:1fr 1fr;
  border-radius:12px;
}
.theme-switch-thumb{
  left:0 !important;
  right:auto !important;
  top:0 !important;
  width:50% !important;
  height:100% !important;
  border-radius:10px !important;
  transform:translateX(100%) !important;
}
html[data-theme="light"] .theme-switch-thumb{
  transform:translateX(0) !important;
}
.theme-icon{
  width:100% !important;
  height:100% !important;
  min-width:0;
}

/* Telegram avatar */
.avatar{
  position:relative;
  overflow:hidden;
  isolation:isolate;
  flex:0 0 auto;
}
.avatar img{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  object-fit:cover;
  border-radius:inherit;
  z-index:2;
  background:var(--surface-2);
}
.avatar span{position:relative;z-index:1}

/* Profile must never reserve a giant loader area after Telegram user data is available. */
.profile-loading{min-height:220px}
#profile-content:not([hidden]){display:block}

/* More forgiving phone layout + keyboard safety. */
@media(max-width:620px){
  :root{--switch-w:62px;--switch-h:36px;--switch-pad:3px}
  .topbar{overflow:visible}
  .top-actions{gap:6px;min-width:0;flex:0 0 auto}
  .brand{max-width:calc(100% - 78px);overflow:hidden;text-overflow:ellipsis}
  .theme-switch{border-radius:14px}
  .theme-switch-track{border-radius:11px}
  .theme-switch-thumb{border-radius:9px !important}
  .profile-shell{min-height:0}
  .profile-loading{min-height:180px}
  .profile-main-row{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center}
  .profile-main-row .btn{grid-column:1/-1}
  .profile-id{min-width:0}
  .profile-id strong,.profile-id span{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .bottom-nav{transform:translate3d(-50%,0,0) !important}
  .nav-item{touch-action:manipulation}
}

@media(max-width:360px){
  :root{--switch-w:58px;--switch-h:34px;--switch-pad:3px}
  .brand{max-width:calc(100% - 72px)}
}

@media(prefers-reduced-motion:reduce){
  html{scroll-behavior:auto}
}

/* Native hidden must always win over component display rules (fixes profile loader). */
[hidden]{display:none !important}


/* ===== v1.9.2 top-up modal UX patch ===== */
.topup-flow{display:flex;flex-direction:column;min-height:0}
.topup-amount-label{display:block;margin:4px 0 8px;color:var(--muted);font-size:11px;font-weight:800;letter-spacing:.06em;text-transform:uppercase}
.quick-amounts{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:8px;margin:10px 0 16px}
.quick-amounts button{
  min-height:44px;padding:10px 8px;border-radius:14px;border:1px solid var(--line);
  background:var(--control-bg);color:var(--text);font-size:13px;font-weight:800;cursor:pointer;
  -webkit-tap-highlight-color:transparent;touch-action:manipulation;
}
.quick-amounts button.is-active{
  color:var(--accent);border-color:var(--accent);
  background:color-mix(in srgb,var(--accent) 12%,var(--control-bg));
  box-shadow:0 0 0 2px color-mix(in srgb,var(--accent) 18%,transparent) inset,0 8px 22px color-mix(in srgb,var(--accent) 10%,transparent)
}
.topup-footer{
  position:sticky;bottom:-1px;z-index:5;display:grid;grid-template-columns:minmax(92px,.38fr) minmax(0,1fr);gap:8px;
  margin:8px -4px -4px;padding:12px 4px 4px;
  background:linear-gradient(to bottom,transparent 0%,color-mix(in srgb,var(--surface-solid) 94%,transparent) 24%,var(--surface-solid) 55%);
  backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px)
}
.topup-footer .btn{min-height:54px;border-radius:17px}
.topup-submit{display:flex!important;align-items:center;justify-content:center;gap:8px;font-size:14px;font-weight:800}
.topup-submit strong{font-size:15px;color:inherit}
.topup-cancel{font-size:12px}

@media(max-width:620px){
  .modal:has(.topup-flow){padding-bottom:max(10px,env(safe-area-inset-bottom),var(--tg-safe-bottom))}
  .quick-amounts{grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;margin-bottom:8px}
  .quick-amounts button{min-height:46px;padding:10px 6px;font-size:12px;border-radius:14px}
  .quick-amounts button:nth-child(4),.quick-amounts button:nth-child(5){min-height:46px}
  .topup-footer{
    grid-template-columns:86px minmax(0,1fr);gap:7px;margin-top:6px;
    padding-bottom:max(5px,env(safe-area-inset-bottom),var(--tg-safe-bottom))
  }
  .topup-footer .btn{min-height:56px}
  .topup-submit{font-size:14px}
}
@media(max-width:350px){
  .quick-amounts{grid-template-columns:repeat(2,minmax(0,1fr))}
  .quick-amounts button:last-child{grid-column:1/-1}
  .topup-footer{grid-template-columns:74px minmax(0,1fr)}
}

/* ===== v1.9.4 Telegram mobile top-up modal fix =====
   Important: this is real CSS (v1.9.3 was accidentally written with literal "\n"). */

/* When a top-up modal is open, the app navigation must not compete for viewport space. */
body.topup-modal-open #bottom-nav{
  display:none !important;
}

/* Keep the overlay inside the CURRENT visible Telegram viewport. */
body.topup-modal-open .modal-backdrop{
  position:fixed !important;
  z-index:10000 !important;
  left:0 !important;
  right:0 !important;
  top:0 !important;
  bottom:auto !important;
  width:100% !important;
  height:var(--visual-height,100dvh) !important;
  min-height:0 !important;
  box-sizing:border-box;
  padding:
    max(8px,var(--tg-content-safe-top),env(safe-area-inset-top))
    8px
    max(8px,var(--tg-content-safe-bottom),env(safe-area-inset-bottom)) !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  overflow:hidden !important;
  overscroll-behavior:none !important;
}
body.topup-modal-open .modal-backdrop[hidden]{
  display:none !important;
}

/* The modal itself never scrolls. Only .topup-scroll does.
   This guarantees that the payment button remains visible. */
body.topup-modal-open .modal{
  position:relative !important;
  width:min(560px,100%) !important;
  height:min(760px,100%) !important;
  max-height:100% !important;
  min-height:0 !important;
  padding:0 !important;
  overflow:hidden !important;
  display:flex !important;
  flex-direction:column !important;
  border-radius:26px;
}

body.topup-modal-open .modal-close{
  position:absolute !important;
  z-index:30 !important;
  top:14px !important;
  right:14px !important;
  float:none !important;
  width:44px !important;
  height:44px !important;
  border-radius:15px !important;
}

body.topup-modal-open #modal-body{
  width:100%;
  height:100%;
  min-height:0;
  display:flex;
}

.topup-flow{
  width:100%;
  height:100%;
  min-height:0;
  display:flex;
  flex-direction:column;
}

.topup-scroll{
  flex:1 1 auto;
  min-height:0;
  overflow-x:hidden;
  overflow-y:auto;
  -webkit-overflow-scrolling:touch;
  overscroll-behavior:contain;
  touch-action:pan-y;
  padding:24px 22px 18px;
  scrollbar-width:thin;
}

.topup-scroll .eyebrow,
.topup-scroll h2{
  padding-right:54px;
}

.topup-footer{
  position:relative !important;
  inset:auto !important;
  z-index:20 !important;
  flex:0 0 auto;
  display:grid !important;
  grid-template-columns:104px minmax(0,1fr) !important;
  gap:9px !important;
  width:100%;
  margin:0 !important;
  padding:
    12px
    14px
    max(12px,var(--tg-content-safe-bottom),var(--tg-safe-bottom),env(safe-area-inset-bottom)) !important;
  border-top:1px solid var(--line);
  background:color-mix(in srgb,var(--surface-solid) 98%,transparent) !important;
  box-shadow:0 -14px 32px rgba(0,0,0,.18);
  backdrop-filter:blur(18px);
  -webkit-backdrop-filter:blur(18px);
}

.topup-footer .btn{
  min-width:0;
  min-height:56px !important;
  border-radius:17px !important;
}

.topup-submit{
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  gap:7px !important;
  width:100% !important;
  font-size:15px !important;
  font-weight:850 !important;
}
.topup-submit strong{
  font-size:15px !important;
  color:inherit !important;
}

.quick-amounts{
  display:grid !important;
  grid-template-columns:repeat(5,minmax(0,1fr)) !important;
  gap:8px !important;
  margin:10px 0 8px !important;
}
.quick-amounts button{
  min-width:0 !important;
  min-height:48px !important;
  padding:10px 6px !important;
  border-radius:15px !important;
  font-size:12px !important;
}

/* Telegram mobile layout */
@media(max-width:620px){
  body.topup-modal-open .modal-backdrop{
    padding:0 !important;
    align-items:stretch !important;
    justify-content:stretch !important;
  }

  body.topup-modal-open .modal{
    width:100% !important;
    height:100% !important;
    max-height:none !important;
    border-radius:0 !important;
    border-left:0 !important;
    border-right:0 !important;
  }

  body.topup-modal-open .modal-close{
    top:12px !important;
    right:12px !important;
  }

  .topup-scroll{
    padding:
      max(18px,var(--tg-content-safe-top),env(safe-area-inset-top))
      18px
      14px !important;
  }

  .topup-scroll .eyebrow{
    margin-top:2px;
  }

  .topup-scroll h2{
    margin:10px 0 18px !important;
    font-size:clamp(34px,11vw,48px) !important;
    line-height:.94 !important;
  }

  .topup-scroll p{
    margin:0 0 14px;
    font-size:14px;
    line-height:1.52;
  }

  .payment-providers{
    grid-template-columns:1fr !important;
    gap:9px !important;
    margin:14px 0 20px !important;
  }

  .provider{
    display:grid !important;
    grid-template-columns:54px minmax(0,1fr) !important;
    grid-template-rows:auto auto !important;
    column-gap:13px !important;
    align-items:center !important;
    min-height:78px !important;
    padding:11px 13px !important;
    border-radius:19px !important;
  }
  .provider img{
    grid-row:1/3 !important;
    width:54px !important;
    height:54px !important;
    margin:0 !important;
    border-radius:16px !important;
  }
  .provider strong{
    align-self:end !important;
    font-size:15px;
  }
  .provider small{
    align-self:start !important;
    margin-top:3px !important;
    font-size:11px;
  }

  .topup-amount-label{
    margin-top:0;
  }

  .amount-wrap .field{
    height:54px;
    font-size:18px;
  }

  .quick-amounts{
    grid-template-columns:repeat(3,minmax(0,1fr)) !important;
    gap:8px !important;
    margin-bottom:4px !important;
  }

  .topup-footer{
    grid-template-columns:92px minmax(0,1fr) !important;
    padding:
      10px
      10px
      max(10px,var(--tg-content-safe-bottom),var(--tg-safe-bottom),env(safe-area-inset-bottom)) !important;
  }
  .topup-footer .btn{
    min-height:54px !important;
  }
}

/* Very short Telegram viewports: compact the content, never the action button. */
@media(max-width:620px) and (max-height:720px){
  .topup-scroll{
    padding-top:14px !important;
  }
  .topup-scroll h2{
    font-size:34px !important;
    margin-bottom:12px !important;
  }
  .topup-scroll p{
    font-size:12px;
    margin-bottom:10px;
  }
  .payment-providers{
    margin:10px 0 14px !important;
    gap:7px !important;
  }
  .provider{
    min-height:66px !important;
    grid-template-columns:46px minmax(0,1fr) !important;
    padding:8px 10px !important;
  }
  .provider img{
    width:46px !important;
    height:46px !important;
  }
  .quick-amounts button{
    min-height:44px !important;
  }
}

@media(max-width:350px){
  .topup-scroll{
    padding-left:14px !important;
    padding-right:14px !important;
  }
  .quick-amounts{
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  }
  .quick-amounts button:last-child{
    grid-column:1/-1;
  }
  .topup-footer{
    grid-template-columns:80px minmax(0,1fr) !important;
  }
}

/* ===== v1.9.5 compact top-up + smooth nav return ===== */

/* Do not force the top-up sheet to fill the whole viewport.
   The scrolling area shrinks only when content really does not fit. */
body.topup-modal-open .modal{
  height:auto !important;
  max-height:calc(var(--visual-height, 100dvh) - 16px) !important;
}

body.topup-modal-open #modal-body{
  height:auto !important;
  max-height:100% !important;
}

body.topup-modal-open .topup-flow{
  height:auto !important;
  max-height:100% !important;
}

body.topup-modal-open .topup-scroll{
  flex:0 1 auto !important;
  min-height:0 !important;
  max-height:calc(var(--visual-height, 100dvh) - 92px) !important;
}

/* v1.9.4 hid the navigation with display:none, which cannot animate.
   Keep it rendered underneath the modal and animate it back after close. */
#bottom-nav{
  opacity:1 !important;
  visibility:visible;
  transform:translate3d(-50%,0,0) !important;
  transition:
    opacity 520ms var(--ease-soft-out),
    transform 620ms var(--ease-soft-out),
    background var(--motion-mid) var(--ease-soft),
    border-color var(--motion-mid) var(--ease-soft),
    box-shadow var(--motion-mid) var(--ease-soft) !important;
}

body.topup-modal-open #bottom-nav{
  display:grid !important;
  opacity:0 !important;
  visibility:hidden;
  pointer-events:none !important;
  transform:translate3d(-50%,calc(100% + 28px),0) !important;
  transition:
    opacity 320ms var(--ease-soft),
    transform 420ms var(--ease-soft),
    visibility 0s linear 420ms !important;
}

/* On mobile keep the modal compact and centered instead of stretching it
   from top to bottom, while preserving a fixed footer with the pay button. */
@media(max-width:620px){
  body.topup-modal-open .modal-backdrop{
    padding:
      max(6px,var(--tg-content-safe-top),env(safe-area-inset-top))
      6px
      max(6px,var(--tg-content-safe-bottom),env(safe-area-inset-bottom)) !important;
    align-items:center !important;
    justify-content:center !important;
  }

  body.topup-modal-open .modal{
    width:100% !important;
    height:auto !important;
    max-height:calc(var(--visual-height, 100dvh) - 12px) !important;
    border-radius:24px !important;
    border-left:1px solid var(--line) !important;
    border-right:1px solid var(--line) !important;
  }

  body.topup-modal-open #modal-body,
  body.topup-modal-open .topup-flow{
    height:auto !important;
    max-height:calc(var(--visual-height, 100dvh) - 12px) !important;
  }

  body.topup-modal-open .topup-scroll{
    flex:0 1 auto !important;
    max-height:calc(var(--visual-height, 100dvh) - 82px) !important;
  }
}

/* If the viewport is very short, the content becomes scrollable;
   there is still no artificial empty flex area above the footer. */
@media(max-width:620px) and (max-height:720px){
  body.topup-modal-open .topup-scroll{
    max-height:calc(var(--visual-height, 100dvh) - 78px) !important;
  }
}

@media(prefers-reduced-motion:reduce){
  #bottom-nav,
  body.topup-modal-open #bottom-nav{
    transition:none !important;
  }
}



/* ===== v1.9.7 smaller hero title ===== */
.hero h1{
  font-size:clamp(46px,6.4vw,78px);
  line-height:.95;
  max-width:720px;
  text-wrap:balance;
}

@media(max-width:620px){
  .hero h1{
    font-size:clamp(30px,9.5vw,40px) !important;
    line-height:.97 !important;
    letter-spacing:-.035em;
    max-width:100%;
    overflow-wrap:normal;
    word-break:normal;
  }
}

@media(max-width:380px){
  .hero h1{
    font-size:clamp(28px,9.1vw,35px) !important;
  }
}
