/* Telegram Mini App look (html.tg-app: set before paint by context-gate.js, only inside Telegram).
   Native, not branded: the page follows the user's Telegram theme (light or dark) through the
   --tg-theme-* variables Telegram provides, laid out like Telegram's own grouped lists, with
   Верни pink kept as the one accent. iPhone Safari and the web landing are not affected.

   How: Telegram colours are mapped onto the variables the catalog already uses (--v-* from
   site.css, --black/--surface/... from style.css), then the few hardcoded whites are replaced.
   Loaded after site.css/download.css; selectors match their specificity (+ html.tg-app). */

html.tg-app{
  --tg-bg:var(--tg-theme-bg-color,#ffffff);
  --tg-text:var(--tg-theme-text-color,#000000);
  --tg-hint:var(--tg-theme-hint-color,#8e8e93);
  --tg-link:var(--tg-theme-link-color,#d0106f);
  --tg-page:var(--tg-theme-secondary-bg-color,#efeff4);
  --tg-card:var(--tg-theme-section-bg-color,var(--tg-theme-bg-color,#ffffff));
  --tg-sep:var(--tg-theme-section-separator-color,rgba(128,128,128,.24));
  --tg-head:var(--tg-theme-section-header-text-color,var(--tg-theme-hint-color,#6d6d72));
  --tg-danger:var(--tg-theme-destructive-text-color,#e5383b);
  --tg-accent:#d0106f;
  --tg-accent-soft:rgba(208,16,111,.12);
  --tg-fill:rgba(118,118,128,.12);

  /* site.css (Верни) variables */
  --v-bg:var(--tg-page);--v-bg-2:var(--tg-fill);--v-card:var(--tg-card);
  --v-ink:var(--tg-text);--v-ink-2:var(--tg-text);--v-muted:var(--tg-hint);--v-faint:var(--tg-hint);
  --v-line:var(--tg-sep);--v-line-2:var(--tg-sep);--v-lav:var(--tg-fill);
  --v-accent:var(--tg-accent);--v-accent-d:var(--tg-accent);--v-accent-soft:var(--tg-accent-soft);
  --v-err:var(--tg-danger);
  --v-shadow:none;--v-shadow-lg:0 8px 28px rgba(0,0,0,.14);
  --v-font:-apple-system,BlinkMacSystemFont,"SF Pro Text","Roboto","Segoe UI",system-ui,sans-serif;
  background:var(--tg-page);
}
html.tg-app.tg-dark{--tg-accent:#ff3d97;--tg-accent-soft:rgba(255,61,151,.16);--tg-fill:rgba(118,118,128,.24);--v-shadow-lg:0 10px 30px rgba(0,0,0,.5);color-scheme:dark}
/* style.css (catalog) variables; same selector weight as site.css's repaint, loaded later */
html.tg-app.app-context.v-catalog-moved{
  --black:var(--tg-page);--surface:var(--tg-card);--surface-raised:var(--tg-fill);--line:var(--tg-sep);
  --white:var(--tg-text);--muted:var(--tg-hint);--green:var(--tg-accent);--accent:var(--tg-accent);--blue:var(--tg-accent);
}
html.tg-app.tg-dark.app-context.v-catalog-moved{color-scheme:dark}
html.tg-app body{background:var(--tg-page)!important;color:var(--tg-text);font-family:var(--v-font)!important;-webkit-tap-highlight-color:transparent;overscroll-behavior-y:none}

/* ---------- app, not a landing: only the catalog section, tabs and sheets ---------- */
html.tg-app body>header.nav,
html.tg-app main[data-k-page]>section:not(#online),
html.tg-app body>footer[data-k-page],
html.tg-app .v-mbar,
html.tg-app #online .section-head>p{display:none!important}
html.tg-app main[data-k-page]{padding:0!important;margin:0!important}
html.tg-app #online{padding:0 0 calc(96px + env(safe-area-inset-bottom))!important;margin:0!important;min-height:100vh;background:var(--tg-page)}
html.tg-app #online{display:block!important}
/* The chip rows scroll sideways; without min-width:0 their min-content widened the page past the screen. */
html.tg-app #online .wrap{display:block!important;width:100%!important;min-width:0;max-width:560px;margin:0 auto;padding:0 16px!important;box-sizing:border-box}
html.tg-app .v-catalog,html.tg-app .v-catalog .workspace{min-width:0;max-width:100%}
html.tg-app body{overflow-x:hidden}
html.tg-app #online .section-head{margin:0 0 14px!important;padding:0 4px}
html.tg-app #online .section-head h2{margin:0;font-size:30px;line-height:1.1;letter-spacing:-.02em;font-weight:760;color:var(--tg-text)}
html.tg-app .v-catalog{background:none!important;border:0!important;box-shadow:none!important;padding:0!important;border-radius:0!important}

/* ---------- catalog: Telegram grouped-list cards ---------- */
html.tg-app.app-context.v-catalog-moved .account-panel{background:var(--tg-card)!important;border:0!important;border-radius:14px!important;box-shadow:none!important;color:var(--tg-text)}
html.tg-app.app-context.v-catalog-moved .account-panel strong{color:var(--tg-text)}
html.tg-app.app-context.v-catalog-moved .account-panel span{color:var(--tg-hint)}
html.tg-app.app-context.v-catalog-moved .account-button{color:var(--tg-accent)!important;background:var(--tg-accent-soft)!important;border-radius:999px!important;padding:8px 14px!important;border:0!important}
html.tg-app.app-context.v-catalog-moved .searchbox{background:var(--tg-fill)!important;border:0!important;border-radius:12px!important;min-height:44px}
html.tg-app.app-context.v-catalog-moved .searchbox input{color:var(--tg-text)!important;background:transparent!important}
html.tg-app.app-context.v-catalog-moved .searchbox input::placeholder{color:var(--tg-hint)}
html.tg-app.app-context.v-catalog-moved .searchbox svg{stroke:var(--tg-hint)}
html.tg-app.app-context.v-catalog-moved .search-submit{border-radius:12px!important;box-shadow:none!important;background:var(--tg-accent)!important;color:#fff!important}
html.tg-app.app-context.v-catalog-moved .popular-section h2,
html.tg-app.app-context.v-catalog-moved .library-heading h2{color:var(--tg-head)!important;font-size:13px!important;font-weight:600!important;letter-spacing:.02em;text-transform:uppercase;margin:18px 4px 8px!important}
html.tg-app.app-context.v-catalog-moved .popular-card,
html.tg-app.app-context.v-catalog-moved .category-chip{background:var(--tg-card)!important;border:0!important;color:var(--tg-text)!important;box-shadow:none!important}
html.tg-app.app-context.v-catalog-moved .category-chip[aria-pressed="true"]{background:var(--tg-accent)!important;color:#fff!important}
html.tg-app.app-context.v-catalog-moved .category-chip span,html.tg-app.app-context.v-catalog-moved .category-chip small{color:inherit;opacity:.7}
html.tg-app.app-context.v-catalog-moved .catalog-update,
html.tg-app.app-context.v-catalog-moved .library-footnote,
html.tg-app.app-context.v-catalog-moved .count{color:var(--tg-hint)!important}
html.tg-app.app-context.v-catalog-moved .app-grid{background:none!important;border:0!important;padding:0!important;gap:10px!important}
html.tg-app.app-context.v-catalog-moved #appGrid .app-card,html.tg-app.app-context.v-catalog-moved #appGrid>.app-family{background:var(--tg-card)!important;border:0!important;border-radius:16px!important;box-shadow:none!important}
html.tg-app.app-context.v-catalog-moved .app-card .app-icon{border-radius:14px}
html.tg-app.app-context.v-catalog-moved .app-name,
html.tg-app.app-context.v-catalog-moved .app-family-name,
html.tg-app.app-context.v-catalog-moved .app-family-toggle{color:var(--tg-text)!important}
html.tg-app.app-context.v-catalog-moved .app-select{border:0!important;background:var(--tg-accent-soft)!important;color:var(--tg-accent)!important;border-radius:999px!important;font-weight:700}
html.tg-app.app-context.v-catalog-moved .selected .app-select{background:var(--tg-accent)!important;color:#fff!important}
html.tg-app.app-context.v-catalog-moved .load-more{background:var(--tg-card)!important;color:var(--tg-accent)!important;border:0!important;border-radius:12px!important}
html.tg-app.app-context.v-catalog-moved .selection-bar{background:var(--tg-card)!important;border:0!important;border-radius:16px!important;color:var(--tg-text)}
html.tg-app.app-context.v-catalog-moved .empty-state strong{color:var(--tg-text)}
html.tg-app.app-context.v-catalog-moved .inline-error{border-radius:12px!important}

/* ---------- sheets (sign-in, app details, download window) ---------- */
html.tg-app.app-context.v-catalog-moved .modal-backdrop{background:rgba(0,0,0,.4)!important;backdrop-filter:none!important}
html.tg-app.app-context.v-catalog-moved .modal-card{background:var(--tg-bg)!important;color:var(--tg-text)!important;border-radius:16px 16px 0 0!important;box-shadow:var(--v-shadow-lg)!important}
html.tg-app.app-context.v-catalog-moved .modal-card h2,html.tg-app.app-context.v-catalog-moved .modal-card strong{color:var(--tg-text)!important}
html.tg-app.app-context.v-catalog-moved .modal-card p,html.tg-app.app-context.v-catalog-moved .login-intro,html.tg-app.app-context.v-catalog-moved .eyebrow{color:var(--tg-hint)!important}
/* Compact prepare/login stepper on the Telegram theme (caption readable in light + dark). */
html.tg-app.app-context.v-catalog-moved .dl-steps-now{color:var(--tg-text)!important}
html.tg-app.app-context.v-catalog-moved .dl-steps-count{color:var(--tg-hint)!important}
html.tg-app.app-context.v-catalog-moved .dl-seg{background:var(--tg-fill)!important}
html.tg-app.app-context.v-catalog-moved .dl-seg.is-done,html.tg-app.app-context.v-catalog-moved .dl-seg.is-active{background:var(--tg-accent)!important}
html.tg-app.app-context.v-catalog-moved .modal-close{background:var(--tg-fill)!important;color:var(--tg-hint)!important;border:0!important;border-radius:999px!important;width:32px!important;height:32px!important;min-height:0!important;font-size:20px!important;line-height:1!important}
html.tg-app.app-context.v-catalog-moved .form-label{color:var(--tg-hint)!important;font-size:13px}
html.tg-app.app-context.v-catalog-moved .form-label input{background:var(--tg-fill)!important;color:var(--tg-text)!important;border:0!important;border-radius:12px!important}
html.tg-app.app-context.v-catalog-moved .credential-notice{background:var(--tg-page)!important;color:var(--tg-hint)!important;border-radius:12px!important}
html.tg-app.app-context.v-catalog-moved .credential-notice p{color:var(--tg-hint)!important}
html.tg-app.app-context.v-catalog-moved .consent-check{color:var(--tg-text)}
html.tg-app.app-context.v-catalog-moved .consent-check a{color:var(--tg-link)}
html.tg-app.app-context.v-catalog-moved .login-submit,
html.tg-app.app-context.v-catalog-moved .primary-button,
html.tg-app.app-context.v-catalog-moved .continue-button{background:var(--tg-accent)!important;color:#fff!important;border-radius:12px!important;box-shadow:none!important}
html.tg-app.app-context.v-catalog-moved .logout-button{color:var(--tg-danger)!important}
html.tg-app.app-context.v-catalog-moved .toast{background:var(--tg-text)!important;color:var(--tg-bg)!important}
html.tg-app .login-card .modal-icon{background:var(--tg-accent-soft)!important;color:var(--tg-accent)!important}

/* ---------- tabs, views, install dock ---------- */
html.tg-app .app-tabs{background:var(--tg-bg)!important;border-top:.5px solid var(--tg-sep)!important;box-shadow:none!important;backdrop-filter:none!important;max-width:none!important}
html.tg-app .app-tabs button{color:var(--tg-hint)!important;font-weight:600}
html.tg-app .app-tabs button[aria-current="page"]{color:var(--tg-accent)!important}
html.tg-app .app-view{background:var(--tg-page)!important;color:var(--tg-text)!important;font-family:var(--v-font)!important;padding-top:calc(14px + var(--verni-tg-top,0px))!important}
html.tg-app .app-view-head h2{font-size:30px;font-weight:760;letter-spacing:-.02em;color:var(--tg-text)}
html.tg-app .app-view-head p{color:var(--tg-hint)!important}
html.tg-app .dv-subtitle{color:var(--tg-head);font-size:13px;font-weight:600;letter-spacing:.02em;text-transform:uppercase;margin:24px 4px 8px}
html.tg-app .dv-row,html.tg-app .av-card{background:var(--tg-card)!important;border:0!important;border-radius:14px!important;color:var(--tg-text)}
html.tg-app .av-card *{color:inherit}
html.tg-app .av-card p,html.tg-app .av-card span,html.tg-app .av-card small{color:var(--tg-hint)}
html.tg-app .av-balance{background:var(--tg-card)!important;background-image:none!important}
html.tg-app .dv-line,html.tg-app .dv-copy time,html.tg-app .dv-empty,html.tg-app .dv-status{color:var(--tg-hint)!important}
html.tg-app .dv-action,html.tg-app .av-card button{background:var(--tg-accent-soft)!important;color:var(--tg-accent)!important;border:0!important;border-radius:999px!important}
html.tg-app .dv-action.is-primary,html.tg-app .av-card .is-primary{background:var(--tg-accent)!important;color:#fff!important}
/* The account actions (app.js renderAccountView) are <a class="av-link">, not <button>, so the
   secondary one slips past the `.av-card button` rule above and falls back to download.css's
   `.av-link{background:#fff;color:var(--v-ink)}` — a white pill whose text is --tg-text (near-white)
   in a dark theme, i.e. invisible. This hits both the web Mini App on iPhone Safari /online
   (html.tg-app.tg-web dark) and the real Telegram Mini App in a dark Telegram theme (html.tg-app
   .tg-dark / OS dark), so the rule is scoped to html.tg-app to cover both. Give it the same
   soft-accent fill as the other secondary buttons (readable in light and dark). The primary
   `.av-link.is-primary` already turns pink via the `.av-card .is-primary` rule above, so it is
   untouched. */
html.tg-app .av-card .av-link:not(.is-primary){background:var(--tg-accent-soft)!important;color:var(--tg-accent)!important;border:0!important}
html.tg-app .dv-more{background:var(--tg-card)!important;color:var(--tg-accent)!important;border:0!important;border-radius:12px!important}
html.tg-app .install-dock{background:var(--tg-card)!important;color:var(--tg-text)!important;border:0!important;border-radius:16px!important;box-shadow:var(--v-shadow-lg)!important}

/* The cookie notice: same content, Telegram colours. */
html.tg-app .cookie-notice{background:var(--tg-card);color:var(--tg-text);border:.5px solid var(--tg-sep);box-shadow:var(--v-shadow-lg);bottom:calc(76px + env(safe-area-inset-bottom))}
html.tg-app .cookie-notice a{color:var(--tg-link)}
html.tg-app .cookie-notice button{background:var(--tg-accent);color:#fff}

/* =====================================================================
   Home (telegram-app.js builds the top bar, promo carousel, offer bar):
   Telegram-app layout in Верни's design — brand pill, pink banners with
   real app icons, icon chips, a 4-column icon grid, floating tab pill.
   ===================================================================== */
html.tg-app{--tg-display:"Manrope",var(--v-font)}
html.tg-app #online{padding-top:0!important}
html.tg-app #online .section-head{margin:22px 0 12px!important;padding:0 2px}
html.tg-app #online .section-head h2{font-family:var(--tg-display);font-size:26px;font-weight:800;letter-spacing:-.02em}
html.tg-app.app-context.v-catalog-moved .popular-section,
html.tg-app.app-context.v-catalog-moved .catalog-update,
html.tg-app.app-context.v-catalog-moved .library-heading,
html.tg-app.app-context.v-catalog-moved .library-footnote,
html.tg-app.app-context.v-catalog-moved .chip-count{display:none!important}

/* top bar */
html.tg-app .tg-top{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:calc(16px + var(--verni-tg-top,0px)) 0 12px}
html.tg-app .tg-brand{display:inline-flex;align-items:center;gap:9px;height:44px;padding:0 16px 0 8px;border:0;border-radius:999px;background:var(--tg-card);color:var(--tg-text);font:800 19px/1 var(--tg-display);letter-spacing:-.02em;cursor:pointer}
html.tg-app .tg-brand img{width:28px;height:28px;border-radius:9px}
html.tg-app .tg-top-actions{display:flex;gap:8px}
html.tg-app .tg-round{display:grid;place-items:center;width:44px;height:44px;border:0;border-radius:50%;font:800 18px/1 var(--tg-display);cursor:pointer}
html.tg-app .tg-help{background:var(--tg-card);color:var(--tg-accent)}
html.tg-app .tg-avatar{background:linear-gradient(140deg,#ff5fa8,#d0106f);color:#fff}
html.tg-app .tg-avatar.is-empty::before{content:"";width:18px;height:18px;background:#fff;-webkit-mask:var(--tg-i-user) center/contain no-repeat;mask:var(--tg-i-user) center/contain no-repeat}

/* promo carousel */
html.tg-app .tg-promo{margin:0 -16px}
html.tg-app .tg-track{display:flex;gap:10px;overflow-x:auto;scroll-snap-type:x mandatory;padding:0 16px;scrollbar-width:none;overscroll-behavior-x:contain}
html.tg-app .tg-track::-webkit-scrollbar{display:none}
html.tg-app .tg-slide{position:relative;flex:0 0 100%;scroll-snap-align:center;min-height:178px;display:flex;overflow:hidden;border-radius:24px;padding:20px;color:#fff;isolation:isolate}
html.tg-app .tg-slide--pink{background:radial-gradient(120% 90% at 100% 0%,#ff66ad 0%,transparent 55%),linear-gradient(135deg,#d0106f 0%,#8f0a4c 100%)}
html.tg-app .tg-slide--ink{background:radial-gradient(90% 90% at 90% 20%,rgba(208,16,111,.85) 0%,transparent 60%),linear-gradient(135deg,#1d1d22 0%,#0d0d10 100%)}
html.tg-app .tg-slide--soft{background:radial-gradient(100% 100% at 100% 100%,#ff9ccb 0%,transparent 60%),linear-gradient(135deg,#ffe3ef 0%,#ffd0e5 100%);color:#2a0717}
html.tg-app .tg-slide-copy{position:relative;z-index:2;display:flex;flex-direction:column;align-items:flex-start;max-width:62%}
html.tg-app .tg-slide h3{margin:0;font:800 23px/1.08 var(--tg-display);letter-spacing:-.025em}
html.tg-app .tg-slide p{margin:8px 0 14px;font-size:13.5px;line-height:1.35;opacity:.86}
html.tg-app .tg-slide-cta{margin-top:auto;min-height:38px;padding:0 18px;border:0;border-radius:999px;background:#fff;color:#14070e;font:700 14.5px/1 var(--v-font);cursor:pointer;box-shadow:0 6px 18px rgba(0,0,0,.18)}
html.tg-app .tg-slide--soft .tg-slide-cta{background:#d0106f;color:#fff}
html.tg-app .tg-slide-art{position:absolute;z-index:1;right:-8px;top:50%;transform:translateY(-50%);width:44%;height:150px}
html.tg-app .tg-slide-art img{position:absolute;width:56px;height:56px;border-radius:15px;box-shadow:0 10px 22px rgba(0,0,0,.28);
  left:calc(var(--i) * 13% + 2%);top:calc(var(--i) * 6px + (var(--i) - 2.5) * (var(--i) - 2.5) * 3px);transform:rotate(calc((var(--i) - 2.5) * 6deg))}
html.tg-app .tg-slide-art img:nth-child(even){top:auto;bottom:calc(var(--i) * 3px)}
html.tg-app .tg-slide-art--text{display:grid;place-items:center end;padding-right:22px;font:900 64px/1 var(--tg-display);letter-spacing:-.05em;color:rgba(255,255,255,.95);text-shadow:0 8px 30px rgba(0,0,0,.25)}
html.tg-app .tg-slide--soft .tg-slide-art--text{color:#d0106f;text-shadow:none}
html.tg-app .tg-dots{display:flex;justify-content:center;gap:6px;margin:10px 0 2px}
html.tg-app .tg-dots button{width:6px;height:6px;padding:0;border:0;border-radius:999px;background:var(--tg-hint);opacity:.4;transition:width .2s,opacity .2s;cursor:pointer}
html.tg-app .tg-dots button[aria-current="true"]{width:18px;opacity:1;background:var(--tg-accent)}

/* account card: one compact row */
html.tg-app.app-context.v-catalog-moved .account-panel{padding:10px 10px 10px 14px!important;min-height:0!important;margin-bottom:10px}
html.tg-app.app-context.v-catalog-moved .account-panel .account-symbol{display:none}
html.tg-app.app-context.v-catalog-moved .account-panel strong{font-size:15px}
html.tg-app.app-context.v-catalog-moved .account-panel span{font-size:12.5px}

/* chips with icons */
html.tg-app{
  --tg-i-all:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'%3E%3Crect x='4' y='4' width='6.5' height='6.5' rx='1.5'/%3E%3Crect x='13.5' y='4' width='6.5' height='6.5' rx='1.5'/%3E%3Crect x='4' y='13.5' width='6.5' height='6.5' rx='1.5'/%3E%3Crect x='13.5' y='13.5' width='6.5' height='6.5' rx='1.5'/%3E%3C/svg%3E");
  --tg-i-banks:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 10 12 4l9 6M5 10v8M9.5 10v8M14.5 10v8M19 10v8M3 20h18'/%3E%3C/svg%3E");
  --tg-i-finance:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3 17 6-6 4 4 8-8M15 7h6v6'/%3E%3C/svg%3E");
  --tg-i-messengers:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='M4 5h16v11H9l-5 4z'/%3E%3C/svg%3E");
  --tg-i-social:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='9' cy='8' r='3.5'/%3E%3Cpath d='M2.5 20c.8-3.6 3.4-5.5 6.5-5.5s5.7 1.9 6.5 5.5'/%3E%3Ccircle cx='17' cy='9' r='2.5'/%3E%3Cpath d='M17.5 14.5c2.2.3 3.6 1.9 4 4.5'/%3E%3C/svg%3E");
  --tg-i-media:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M10 8.5v7l6-3.5z'/%3E%3C/svg%3E");
  --tg-i-shopping:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 8h14l-1 12H6zM9 8V6.5a3 3 0 0 1 6 0V8'/%3E%3C/svg%3E");
  --tg-i-travel:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 16V11l2-5h10l2 5v5zM5 16v3M19 16v3M5 11h14'/%3E%3Ccircle cx='8.5' cy='13.5' r='.5'/%3E%3Ccircle cx='15.5' cy='13.5' r='.5'/%3E%3C/svg%3E");
  --tg-i-tools:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14.5 6.5a4 4 0 0 0 5 5L12 19a2.1 2.1 0 0 1-3-3l7.5-7.5a4 4 0 0 0-2-2z'/%3E%3C/svg%3E");
  --tg-i-games:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='7' width='18' height='11' rx='5'/%3E%3Cpath d='M8 11v3M6.5 12.5h3M15 12h.01M17.5 13.5h.01'/%3E%3C/svg%3E");
  --tg-i-other:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'%3E%3Ccircle cx='5.5' cy='12' r='2'/%3E%3Ccircle cx='12' cy='12' r='2'/%3E%3Ccircle cx='18.5' cy='12' r='2'/%3E%3C/svg%3E");
  --tg-i-user:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'%3E%3Ccircle cx='12' cy='8' r='4.5'/%3E%3Cpath d='M3.5 21c.9-4.3 4.2-6.5 8.5-6.5s7.6 2.2 8.5 6.5z'/%3E%3C/svg%3E");
}
html.tg-app.app-context.v-catalog-moved .catalog-categories{display:flex!important;gap:8px;overflow-x:auto;scrollbar-width:none;margin:12px -16px 14px!important;padding:0 16px!important;flex-wrap:nowrap!important}
html.tg-app.app-context.v-catalog-moved .catalog-categories::-webkit-scrollbar{display:none}
html.tg-app.app-context.v-catalog-moved .category-chip{flex:none;display:inline-flex!important;align-items:center;gap:7px;min-height:40px;padding:0 15px 0 12px!important;border-radius:999px!important;font-size:14.5px!important;font-weight:650!important}
html.tg-app.app-context.v-catalog-moved .category-chip::before{content:"";width:18px;height:18px;flex:none;background:var(--tg-accent);-webkit-mask:var(--tg-chip-icon,var(--tg-i-other)) center/contain no-repeat;mask:var(--tg-chip-icon,var(--tg-i-other)) center/contain no-repeat}
html.tg-app.app-context.v-catalog-moved .category-chip[aria-pressed="true"]::before{background:#fff}
html.tg-app .category-chip[data-category="all"]{--tg-chip-icon:var(--tg-i-all)}
html.tg-app .category-chip[data-category="banks"]{--tg-chip-icon:var(--tg-i-banks)}
html.tg-app .category-chip[data-category="finance"]{--tg-chip-icon:var(--tg-i-finance)}
html.tg-app .category-chip[data-category="messengers"]{--tg-chip-icon:var(--tg-i-messengers)}
html.tg-app .category-chip[data-category="social"]{--tg-chip-icon:var(--tg-i-social)}
html.tg-app .category-chip[data-category="media"]{--tg-chip-icon:var(--tg-i-media)}
html.tg-app .category-chip[data-category="shopping"]{--tg-chip-icon:var(--tg-i-shopping)}
html.tg-app .category-chip[data-category="travel"]{--tg-chip-icon:var(--tg-i-travel)}
html.tg-app .category-chip[data-category="tools"]{--tg-chip-icon:var(--tg-i-tools)}
html.tg-app .category-chip[data-category="games"]{--tg-chip-icon:var(--tg-i-games)}

/* app grid: home-screen tiles (icon + name), the whole tile opens the app sheet. A family is a
   single folder tile — the primary app's icon with a soft stacked layer behind it and a count chip —
   the same size as any app tile; tapping it opens the folder overlay (#folderModal). */
html.tg-app.app-context.v-catalog-moved #appGrid{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:18px 8px!important}
html.tg-app.app-context.v-catalog-moved #appGrid .app-card,
html.tg-app.app-context.v-catalog-moved #appGrid>.app-family{background:none!important;border:0!important;border-radius:0!important;padding:0!important;min-height:0!important;display:block!important}
html.tg-app.app-context.v-catalog-moved #appGrid .app-info,
html.tg-app.app-context.v-catalog-moved #appGrid .app-family-toggle{display:flex!important;flex-direction:column;align-items:center;gap:7px;width:100%;padding:0!important;border:0!important;background:none!important;text-align:center;min-height:0!important}
html.tg-app.app-context.v-catalog-moved #appGrid .app-icon{width:62px!important;height:62px!important;border-radius:16px!important;margin:0!important;box-shadow:0 6px 16px -8px rgba(0,0,0,.35)!important}
html.tg-app.app-context.v-catalog-moved #appGrid .app-icon img{width:100%;height:100%;border-radius:inherit}
/* The quiet hover-lift / tap-press is one system across the whole grid — see #appGrid>.app-card,
   #appGrid>.app-family in site.css (it lifts the grid tile, so single tiles and folders match and the
   lift never doubles with the inner button). */
/* Folder tile: stacked layer behind the primary icon + corner count chip (same footprint as an app icon). */
html.tg-app.app-context.v-catalog-moved #appGrid .app-folder-stack{position:relative}
html.tg-app.app-context.v-catalog-moved #appGrid .app-folder-stack::before{content:"";position:absolute;inset:0;border-radius:16px;background:var(--tg-card);box-shadow:inset 0 0 0 1px rgba(127,127,127,.2);transform:translate(5px,4px) scale(.92);z-index:0}
html.tg-app.app-context.v-catalog-moved #appGrid .app-folder-stack>.app-icon{position:relative;z-index:1}
html.tg-app.app-context.v-catalog-moved #appGrid .app-folder-count{position:absolute;z-index:2;top:-5px;right:-5px;min-width:19px;height:19px;padding:0 5px;display:grid;place-items:center;border-radius:999px;background:var(--tg-accent);color:#fff;font-size:11px;font-weight:800;line-height:1;font-variant-numeric:tabular-nums;box-shadow:0 2px 6px rgba(0,0,0,.35)}
html.tg-app.app-context.v-catalog-moved #appGrid .app-copy{display:block;width:100%;min-width:0}
html.tg-app.app-context.v-catalog-moved #appGrid .app-name{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;font-size:12px!important;font-weight:600!important;line-height:1.25!important;letter-spacing:0}
html.tg-app.app-context.v-catalog-moved #appGrid .app-category,
html.tg-app.app-context.v-catalog-moved #appGrid .app-get{display:none!important}
html.tg-app.app-context.v-catalog-moved #appGrid .app-access{display:inline-block;margin-top:3px;font-size:10.5px;font-weight:700}
/* Folder overlay variants: the same centred home-screen tiles, in the panel's grid. */
html.tg-app.app-context.v-catalog-moved #folderVariants{grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:16px 8px!important}
/* Families with long variant names get a roomier 2-up grid so names aren't chopped. */
html.tg-app.app-context.v-catalog-moved #folderVariants.folder-long{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:16px 10px!important}
html.tg-app.app-context.v-catalog-moved #folderVariants .app-card{border-bottom:0!important;min-height:0!important}
html.tg-app.app-context.v-catalog-moved #folderVariants .app-info{flex-direction:column;align-items:center;gap:7px;text-align:center}
html.tg-app.app-context.v-catalog-moved #folderVariants .app-icon{width:60px!important;height:60px!important;border-radius:15px!important}
html.tg-app.app-context.v-catalog-moved #folderVariants .app-name{font-size:12px!important;line-height:1.25!important;-webkit-line-clamp:3!important;white-space:normal!important}
html.tg-app.app-context.v-catalog-moved #folderVariants .app-category,
html.tg-app.app-context.v-catalog-moved #folderVariants .app-get{display:none!important}

/* floating tab bar */
html.tg-app .app-tabs{left:12px!important;right:12px!important;transform:none!important;width:auto!important;bottom:max(10px,env(safe-area-inset-bottom))!important;padding:6px!important;border:.5px solid var(--tg-sep)!important;border-radius:30px!important;
  background:color-mix(in srgb,var(--tg-card) 88%,transparent)!important;backdrop-filter:blur(18px) saturate(160%)!important;-webkit-backdrop-filter:blur(18px) saturate(160%)!important;box-shadow:0 10px 30px rgba(0,0,0,.18)!important}
html.tg-app .app-tabs button{flex:1;min-width:0!important;border-radius:24px!important;min-height:54px!important}
html.tg-app .app-tabs button[aria-current="page"]{background:var(--tg-accent-soft)!important}
html.tg-app #online{padding-bottom:calc(170px + env(safe-area-inset-bottom))!important}
html.tg-app .install-dock{bottom:calc(84px + max(10px,env(safe-area-inset-bottom)))!important}

/* offer bar (live best pack) */
html.tg-app .tg-offer{position:fixed;z-index:71;left:12px;right:12px;bottom:calc(84px + max(10px,env(safe-area-inset-bottom)));display:flex;align-items:center;gap:8px;padding:8px 8px 8px 8px;border-radius:24px;
  background:color-mix(in srgb,var(--tg-card) 92%,transparent);backdrop-filter:blur(18px) saturate(160%);-webkit-backdrop-filter:blur(18px) saturate(160%);border:.5px solid var(--tg-sep);box-shadow:0 10px 30px rgba(0,0,0,.2);color:var(--tg-text)}
html.tg-app .tg-offer[hidden],html.tg-app body.sheet-open .tg-offer{display:none}
html.tg-app .tg-offer-badge{flex:none;display:grid;place-items:center;width:40px;height:40px;border-radius:50%;background:linear-gradient(140deg,#ff5fa8,#d0106f);color:#fff;font:800 13px/1 var(--tg-display)}
html.tg-app .tg-offer-copy{flex:1;min-width:0;display:grid;gap:2px}
html.tg-app .tg-offer-copy strong{font:800 14px/1.2 var(--tg-display);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
html.tg-app .tg-offer-copy span{font-size:12px;color:var(--tg-hint);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
html.tg-app .tg-offer-close{flex:none;display:grid;place-items:center;width:28px;height:28px;padding:0;border:0;border-radius:50%;background:var(--tg-fill);color:var(--tg-hint);font-size:18px;line-height:1;cursor:pointer}
html.tg-app .tg-offer-buy{flex:none;min-height:42px;padding:0 15px;border:0;border-radius:999px;background:var(--tg-accent);color:#fff;font:700 15px/1 var(--v-font);cursor:pointer}

/* sheets built by telegram-app.js (help, payment in the browser) */
html.tg-app .tg-sheet-card{position:relative;padding:26px 20px calc(22px + env(safe-area-inset-bottom))!important}
html.tg-app .tg-sheet-card h2{margin:0 0 10px;font:800 22px/1.15 var(--tg-display);color:var(--tg-text)}
html.tg-app .tg-sheet .modal-close{position:absolute;top:12px;right:12px}
html.tg-app .tg-sheet-icon{display:grid;place-items:center;width:60px;height:60px;margin:0 0 14px;border-radius:18px;background:var(--tg-accent-soft);color:var(--tg-accent);font-size:28px;font-weight:700}
html.tg-app .tg-sheet-text{margin:0 0 6px;color:var(--tg-hint);font-size:15px;line-height:1.45}
html.tg-app .tg-sheet-status{margin:6px 0 12px;color:var(--tg-danger)!important;font-size:14px}
html.tg-app .tg-sheet-status:empty{margin:0 0 12px}
html.tg-app .tg-sheet-action{width:100%;min-height:50px;border:0;font-size:16px;font-weight:700;cursor:pointer;margin-top:8px}
html.tg-app .tg-sheet-action:disabled{opacity:.6;cursor:progress}
html.tg-app .tg-steps{list-style:none;counter-reset:s;margin:6px 0 14px;padding:0;display:grid;gap:12px}
html.tg-app .tg-steps li{counter-increment:s;display:grid;grid-template-columns:34px 1fr;column-gap:12px;align-items:start}
html.tg-app .tg-steps li::before{content:counter(s);grid-row:span 2;display:grid;place-items:center;width:34px;height:34px;border-radius:11px;background:var(--tg-accent-soft);color:var(--tg-accent);font:800 15px/1 var(--tg-display)}
html.tg-app .tg-steps strong{font-size:15.5px;color:var(--tg-text)}
html.tg-app .tg-steps span{font-size:13.5px;line-height:1.4;color:var(--tg-hint)}
html.tg-app .tg-sheet-card{text-align:left!important}
html.tg-app .tg-sheet-secondary{width:100%;min-height:46px;margin-top:8px;border:0;border-radius:12px;background:var(--tg-fill);color:var(--tg-accent);font:700 15px/1 var(--v-font);cursor:pointer}
html.tg-app .tg-sheet-secondary[hidden]{display:none}
/* The cookie notice (first visit) sits above the floating tab pill; the offer bar waits until it is gone. */
html.tg-app .cookie-notice{bottom:calc(84px + max(10px,env(safe-area-inset-bottom)))!important}
html.tg-app body:has(#cookie-notice) .tg-offer{display:none}

/* =====================================================================
   Web skin (html.tg-app.tg-web): /online opened in a plain browser, no
   Telegram. Everything above is reused as-is; here we only (1) supply the
   colours Telegram would otherwise provide through --tg-theme-* (there are
   none outside Telegram, so the rules above would fall back to bare
   white/grey), with an OS-driven dark variant, and (2) centre the
   phone-width app on a wide desktop. The real Telegram Mini App never has
   .tg-web, so its look is byte-for-byte unchanged. Still scoped to
   html.tg-app, so telegram.css keeps styling nothing else.
   ===================================================================== */
html.tg-app.tg-web{
  --tg-theme-bg-color:#ffffff;
  --tg-theme-text-color:#15181b;
  --tg-theme-hint-color:#7b8793;
  --tg-theme-link-color:#d0106f;
  --tg-theme-secondary-bg-color:#f0f1f4;
  --tg-theme-section-bg-color:#ffffff;
  --tg-theme-section-separator-color:rgba(60,60,67,.13);
  --tg-theme-section-header-text-color:#6d6d72;
  --tg-theme-destructive-text-color:#e5383b;
  /* Paint the ROOT with the app's own page colour. On /online the <html> element also carries
     app-context + v-catalog-moved, and landing.css's `html.app-context.v-catalog-moved{background:
     var(--p-bg)}` (a light #f7f7f5) outweighs the base `html.tg-app{background:var(--tg-page)}`, so
     the root stayed light even in dark mode. Wherever the body does not cover the whole root — the
     ≥600px centred phone-width column, or any edge the body leaves — that light root showed as a
     white "frame" around the dark app. Match the root to var(--tg-page) (the same colour the body
     and #online use) so the backdrop is seamless in both themes. tg-web only, so the real Telegram
     Mini App is untouched; telegram.css loads after landing.css, so this wins at equal specificity. */
  background:var(--tg-page);
}
@media (prefers-color-scheme: dark){
  html.tg-app.tg-web{
    --tg-theme-bg-color:#1d1e23;
    --tg-theme-text-color:#f3f4f6;
    --tg-theme-hint-color:#949ba3;
    --tg-theme-link-color:#ff6fb0;
    --tg-theme-secondary-bg-color:#101114;
    --tg-theme-section-bg-color:#26282f;
    --tg-theme-section-separator-color:rgba(255,255,255,.1);
    --tg-theme-section-header-text-color:#8d8d94;
    --tg-theme-destructive-text-color:#ff5c5c;
    /* same accent lift as .tg-dark, applied straight from the OS preference */
    --tg-accent:#ff3d97;--tg-accent-soft:rgba(255,61,151,.16);--tg-fill:rgba(118,118,128,.24);
    --v-shadow-lg:0 10px 30px rgba(0,0,0,.5);
    color-scheme:dark;
  }
}

/* Wide desktop: keep the app a centred phone-width column (like a web Mini App) instead of a
   stretched full-width layout. The content column is already capped at 560px above; here the fixed
   floating pieces (tab pill, offer bar, install dock, cookie notice) are pulled to the same centre. */
@media (min-width: 600px){
  /* The content column is capped at 560px above; the kit lays <html> out as a grid and parks <body>
     in a left-hand column, so the app would hug the left edge. For the web app we undo that grid and
     let the 560px column centre in the viewport, under the centred floating pieces below. Scoped to
     tg-web + desktop, so the real Telegram app, iPhone Safari and the phone layout are untouched. */
  html.tg-app.tg-web{display:block!important;padding-left:0!important;padding-right:0!important}
  html.tg-app.tg-web body{width:100%!important;max-width:none!important;margin:0!important}
  html.tg-app.tg-web main[data-k-page]{max-width:none!important;margin:0!important;padding:0!important}
  html.tg-app.tg-web #online{max-width:none!important}
  html.tg-app.tg-web #online .wrap{margin-left:auto!important;margin-right:auto!important}
  html.tg-app.tg-web .app-tabs,
  html.tg-app.tg-web .tg-offer,
  html.tg-app.tg-web .install-dock,
  html.tg-app.tg-web .cookie-notice{
    left:50%!important;right:auto!important;transform:translateX(-50%)!important;
    width:min(528px,calc(100vw - 24px))!important;max-width:none!important;box-sizing:border-box;
  }
}
