:root{--bar-h:44px;--app-header-h:64px;--tabbar-h:76px;--sticky-h:calc(clamp(120px,19vh,150px) + var(--bar-h) + 8px + 32px + 2px);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",system-ui,"Noto Sans Arabic",sans-serif;color:var(--tg-theme-text-color,#201c28);background:var(--tg-theme-bg-color,#f7f5fb);color-scheme:light dark;--surface:var(--tg-theme-secondary-bg-color,#fff);--hint:var(--tg-theme-hint-color,#817b8d);--accent:linear-gradient(120deg,#7657ef,#ec4d9b);--line:color-mix(in srgb,var(--tg-theme-hint-color,#817b8d) 19%,transparent);--shadow:0 10px 30px #30204a12}*{box-sizing:border-box}body{margin:0;min-height:100vh;padding:max(12px,env(safe-area-inset-top)) 18px calc(var(--tabbar-h) + 54px + env(safe-area-inset-bottom))}body:has(#gallery .browse-header){scroll-padding-top:calc(var(--app-header-h) + 50px + env(safe-area-inset-top))}body:has(.editor-v2:not([hidden])){scroll-padding-top:var(--sticky-h);scroll-padding-bottom:calc(var(--tabbar-h) + 54px + env(safe-area-inset-bottom))}.topbar{position:sticky;top:0;z-index:4;display:flex;align-items:center;justify-content:space-between;max-width:720px;margin:auto;padding:8px 0 14px;background:color-mix(in srgb,var(--tg-theme-bg-color,#f7f5fb) 88%,transparent);backdrop-filter:blur(18px)}.header-actions{display:flex;align-items:center;gap:8px}.language{display:flex;align-items:center;gap:5px;padding:8px 11px;border:1px solid var(--line);border-radius:14px;background:var(--surface);color:inherit;font:inherit}.language [aria-pressed=true]{font-weight:700;color:#8656e9}.brand{display:flex;align-items:center;gap:11px}.brand strong{display:block;font-size:16px}.brand small{color:var(--hint);font-size:12px}.logo{width:42px;height:42px;border-radius:14px;background:var(--accent);display:grid;place-items:center;box-shadow:var(--shadow)}svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.logo svg{width:25px;height:25px;stroke:white}.back{width:44px;height:44px;border:1px solid var(--line);border-radius:14px;background:var(--surface);color:inherit}main{max-width:720px;margin:8px auto}h1{font-size:26px;letter-spacing:-.5px;margin:10px 0 18px}h2{font-size:18px;margin:0 0 12px}p{line-height:1.5}.muted,.hint{color:var(--hint);font-size:14px}.tabs{position:fixed;z-index:5;height:var(--tabbar-h);bottom:0;left:0;right:0;display:flex;justify-content:center;gap:8px;padding:9px 12px calc(9px + env(safe-area-inset-bottom));background:color-mix(in srgb,var(--tg-theme-bg-color,#f7f5fb) 82%,transparent);backdrop-filter:blur(24px);border-top:1px solid var(--line)}.tabs button{position:relative;min-width:90px;min-height:58px;border:0;background:transparent;color:var(--hint);font:inherit;font-size:11px;display:grid;justify-items:center;align-content:center;gap:3px;border-radius:15px}.tabs button svg{width:21px;height:21px}.tabs button[aria-current=page]{color:#8656e9;font-weight:650}.tabs button[aria-current=page]:after{content:"";position:absolute;bottom:2px;width:19px;height:3px;border-radius:4px;background:var(--accent)}.tabs b{position:absolute;top:1px;inset-inline-start:calc(50% + 9px);font-size:9px;min-width:15px;padding:2px 4px;border-radius:9px;color:white;background:#ee4d9b}#gallery{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.hero{grid-column:1/-1;padding:18px 18px 4px}.hero p{margin:4px 0 12px;color:var(--hint)}.card,.panel,.pack-card,.destination{border:1px solid var(--line);border-radius:19px;background:var(--surface);color:inherit;box-shadow:var(--shadow)}.card{padding:12px;text-align:start;font:inherit;cursor:pointer;min-width:0;transition:transform .2s,box-shadow .2s}.card:active,button:active{transform:scale(.97)}.card h2{font-size:14px;margin:8px 0}.emoji{display:inline-grid;place-items:center;width:32px;height:32px;border-radius:11px;background:#f2eafa;font-size:20px}.card-preview{height:110px;border-radius:13px;background:linear-gradient(135deg,#f5f0ff,#fff0f6);overflow:hidden}.skeleton{height:150px;border-radius:18px;background:linear-gradient(100deg,#eeeaf4 30%,#faf8fc 45%,#eeeaf4 60%);background-size:200% 100%;animation:shimmer 1.2s infinite}@keyframes shimmer{to{background-position:-200% 0}}.preview{width:min(100%,340px);height:290px;margin:14px auto;background:radial-gradient(circle at 50% 40%,#fff 0,#f5efff 63%,#f7eaf3);border-radius:22px;overflow:hidden;animation:breath 3s ease-in-out infinite alternate}@keyframes breath{to{filter:saturate(1.12)}}.field{position:relative;margin:15px 0}.field label{display:block;font-size:13px;color:var(--hint);margin:0 0 7px}.field input{width:100%;min-height:52px;padding:12px 44px 12px 14px;border-radius:15px;border:1px solid var(--line);background:var(--surface);color:inherit;font:inherit;font-size:17px}.clear{position:absolute;inset-inline-end:7px;bottom:5px;width:42px;height:42px;border:0;background:transparent;color:var(--hint);font-size:21px}.counter{text-align:end;unicode-bidi:isolate;direction:ltr;font-size:12px;color:var(--hint);margin-top:4px}.segmented{position:relative;display:grid;grid-template-columns:1fr 1fr;padding:4px;border-radius:16px;background:color-mix(in srgb,var(--hint) 12%,var(--surface));margin:15px 0 8px}.segment-highlight{position:absolute;top:4px;bottom:4px;width:calc(50% - 4px);inset-inline-start:4px;border-radius:12px;background:var(--accent);transition:transform .2s}.segmented[data-kind=sticker] .segment-highlight{transform:translateX(100%)}[dir=rtl] .segmented[data-kind=sticker] .segment-highlight{transform:translateX(-100%)}.segmented button{z-index:1;min-height:44px;border:0;background:transparent;color:inherit;font:inherit;border-radius:12px}.segmented button[aria-pressed=true]{color:white;font-weight:650}.segmented button span{margin-inline-end:5px}.destinations{display:grid;grid-template-columns:1fr 1fr;gap:9px;margin:10px 0}.destination{min-height:74px;padding:12px;text-align:start;font:inherit;display:flex;align-items:center;gap:9px}.destination[aria-pressed=true]{border:2px solid #9b62e8;background:color-mix(in srgb,#a662e8 9%,var(--surface))}.radio{width:18px;height:18px;border:2px solid var(--hint);border-radius:50%;flex:none}.destination[aria-pressed=true] .radio{border:5px solid #9b62e8}.pack-select{width:100%;min-height:48px;margin:0 0 12px;border-radius:14px;padding:10px;border:1px solid var(--line);background:var(--surface);color:inherit;font:inherit}.primary,.action{display:block;width:100%;min-height:50px;padding:12px 16px;border:0;border-radius:16px;background:var(--accent);color:white;font:inherit;font-weight:650;box-shadow:0 8px 18px #9d48ca35;transition:transform .18s,opacity .18s}.primary:disabled{opacity:.5;box-shadow:none}.primary.loading:before{content:"";display:inline-block;vertical-align:middle;width:15px;height:15px;margin-inline-end:9px;border:2px solid #ffffff60;border-top-color:#fff;border-radius:50%;animation:spin .7s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}.secondary{min-height:46px;padding:10px 14px;border-radius:14px;border:1px solid var(--line);background:var(--surface);color:inherit;font:inherit}.editor-actions{position:sticky;bottom:78px;padding-top:10px;background:linear-gradient(transparent,var(--tg-theme-bg-color,#f7f5fb) 25%)}.success{text-align:center;padding:28px 10px}.check{margin:8px auto 20px;width:72px;height:72px;border-radius:50%;display:grid;place-items:center;background:linear-gradient(130deg,#8b6af0,#e95aa1);color:white;font-size:36px;animation:pop .35s ease-out}@keyframes pop{from{transform:scale(.75)}to{transform:scale(1)}}.success .action,.success .secondary{margin-top:10px}a{color:var(--tg-theme-link-color,#8059d9);overflow-wrap:anywhere}.pack-card{padding:16px;margin:10px 0}.pack-head{display:flex;align-items:center;gap:12px}.pack-head .emoji{flex:none}.pack-title{font-weight:650;flex:1}.progress{height:5px;background:color-mix(in srgb,var(--hint) 18%,transparent);border-radius:5px;margin:13px 0 5px;overflow:hidden}.progress span{display:block;height:100%;background:var(--accent);border-radius:5px}.pack-buttons{display:flex;gap:8px;margin-top:12px}.pack-buttons button{flex:1}.empty{text-align:center;padding:28px 18px;border:1px dashed var(--line);border-radius:20px;color:var(--hint)}.empty svg{width:58px;height:58px;color:#a77be8;margin-bottom:10px}.help-step,.empty,.browser-hint{padding:16px;margin:10px 0;border-radius:17px;background:var(--surface);border:1px solid var(--line)}#toast{position:sticky;top:65px;z-index:3;margin:0 0 8px;padding:0}#toast:not(:empty){padding:11px 14px;border-radius:13px;background:#332545;color:#fff;box-shadow:var(--shadow)}:focus-visible{outline:3px solid #9864ed;outline-offset:3px}[hidden]{display:none!important}@media(max-width:380px){body{padding-inline:12px}.tabs button{min-width:78px}.preview{height:245px}}@media(prefers-reduced-motion:reduce){*,*:before,*:after{scroll-behavior:auto!important;animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}}
.font-section{margin:12px 0}.font-section h2{font-size:14px;margin-bottom:8px}.font-chips{display:flex;gap:8px;overflow-x:auto;padding:3px 3px 9px;scrollbar-width:thin}.font-chip{display:inline-flex;align-items:center;gap:7px;flex:none;min-height:42px;padding:8px 12px;border:1px solid var(--line);border-radius:14px;background:var(--surface);color:inherit;font:inherit;white-space:nowrap}.font-chip[aria-pressed=true]{border-color:#9b62e8;background:color-mix(in srgb,#a662e8 18%,var(--surface));box-shadow:0 0 0 2px #9b62e8;color:#7544c1;font-weight:700}.font-chip[aria-pressed=true] span:first-child{display:grid;place-items:center;width:18px;height:18px;border-radius:50%;background:var(--accent);color:white;font-size:12px}.font-auto{padding:2px 6px;border-radius:8px;background:#eee6ff;color:#7045bb;font-size:10px}.font-section .hint{margin:4px 0;font-size:12px}.font-status{margin:0}
.font-family{color:var(--hint);font-size:11px}

/* Category browsing */
#gallery:has(.category-card){grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.category-card{position:relative;display:block;width:100%;aspect-ratio:4/3;overflow:hidden;padding:0;border:0;border-radius:20px;background:var(--category-gradient);color:#fff;text-align:start;box-shadow:var(--shadow);cursor:pointer;transition:transform .18s,box-shadow .18s}
.category-card:active{transform:scale(.97)}
.category-card:focus-visible,.browse-back:focus-visible{outline:3px solid #9864ed;outline-offset:3px}
.category-media{position:absolute;inset:0;display:grid;place-items:center;background:var(--category-gradient);overflow:hidden}
.category-media:before{content:"";position:absolute;inset:0;background:linear-gradient(100deg,#ffffff08 30%,#ffffff35 45%,#ffffff08 60%);background-size:200% 100%;animation:shimmer 1.2s infinite}
.category-media:not(.has-image):before{opacity:.25}
.category-image{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;aspect-ratio:4/3;opacity:0;transition:opacity .2s}
.category-image.loaded{opacity:1}
.category-icon{position:relative;font-size:clamp(38px,12vw,64px);filter:drop-shadow(0 4px 12px #0003)}
.category-scrim{position:absolute;inset:auto 0 0;display:grid;gap:5px;padding:30px 12px 11px;background:linear-gradient(transparent,#100b1edb);color:white}
.category-title{font-size:14px;font-weight:700;line-height:1.25}
.category-count{justify-self:start;padding:3px 8px;border:1px solid #ffffff55;border-radius:999px;background:#ffffff26;font-size:10px;line-height:1.35;white-space:nowrap}
.browse-header{position:sticky;top:calc(var(--app-header-h) + env(safe-area-inset-top));z-index:3;grid-column:1/-1;display:flex;align-items:center;gap:10px;min-height:50px;padding:5px 8px;background:var(--tg-theme-bg-color,#f7f5fb);border:0;border-bottom:1px solid var(--line);border-radius:0;box-shadow:var(--shadow)}
.browse-back{width:40px;height:40px;flex:none;border:0;border-radius:12px;background:var(--surface);color:inherit;font:inherit;font-size:28px;line-height:1;cursor:pointer}
.browse-header strong{min-width:0;flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.browse-count{color:var(--hint);font-size:12px;white-space:nowrap}
.template-grid{grid-column:1/-1;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.template-search{grid-column:1/-1;width:100%;min-height:46px;padding:10px 14px;border:1px solid var(--line);border-radius:15px;background:var(--surface);color:inherit;font:inherit}
.category-empty{grid-column:1/-1}.empty-art{font-size:48px;color:#a77be8}
.error-chip{grid-column:1/-1;display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 12px;border:1px solid #dc656544;border-radius:13px;color:#c44;background:color-mix(in srgb,#dc6565 8%,var(--surface))}
@media(prefers-reduced-motion:reduce){.category-card,.category-image{transition:none}.category-media:before{animation:none}}

.font-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.font-card{position:relative;min-width:0;padding:9px;border:1px solid var(--line);border-radius:15px;background:var(--surface);color:inherit;font:inherit;text-align:start}.font-card[aria-pressed=true]{border:2px solid #9b62e8;box-shadow:0 0 0 2px #9b62e8}.font-preview{display:block;width:100%;height:54px;object-fit:contain;color:#201c28;border-radius:9px;background:color-mix(in srgb,var(--hint) 8%,var(--surface))}.font-name{display:block;margin-top:6px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:inherit}.font-check{position:absolute;z-index:1;inset-block-start:5px;inset-inline-end:5px;width:21px;height:21px;display:none;place-items:center;border-radius:50%;background:var(--accent);color:white;font-size:12px}.font-card[aria-pressed=true] .font-check{display:grid}.font-preview-fallback{display:grid;place-items:center;text-align:center;padding:4px;overflow:hidden;color:var(--hint);font-size:12px}.font-grid:not(.expanded) .font-card:nth-child(n+7){display:none}.font-more{width:100%;min-height:38px;margin:8px 0;padding:7px}.font-section .hint{margin:4px 0;font-size:12px}@media(min-width:600px){.font-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}

/* Layer editor */
/* Editor contract: preview + 44px layers row fits --sticky-h; focus/scroll space and fixed bars use these shared heights. */
.editor-v2{padding-bottom:calc(var(--tabbar-h) + 54px + env(safe-area-inset-bottom));scroll-padding-top:var(--sticky-h)}.preview-card{position:sticky;top:64px;z-index:2;padding:8px;margin:0 0 10px;overflow:hidden}.preview-stage{position:relative;width:100%;height:min(40vh,320px);min-height:210px;margin:0;border-radius:16px;overflow:hidden}.preview-card[data-background=checker] .preview-stage{background-color:#ddd;background-image:linear-gradient(45deg,#bbb 25%,transparent 25%),linear-gradient(-45deg,#bbb 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#bbb 75%),linear-gradient(-45deg,transparent 75%,#bbb 75%);background-size:20px 20px;background-position:0 0,0 10px,10px -10px,-10px 0}.preview-card[data-background=dark] .preview-stage{background:#17151b}.preview-card[data-background=light] .preview-stage{background:#fff}.preview-toolbar{display:flex;align-items:center;gap:8px;padding:6px 0 0}.preview-toolbar button{min-width:44px;min-height:44px}.preview-toolbar input{flex:1;min-width:40px}.time-label{font-size:11px;white-space:nowrap;direction:ltr}.preview-loading{position:absolute;z-index:2;top:8px;inset-inline:8px;height:3px;background:#9a62e8;animation:loading 1s ease-in-out infinite alternate}.preview-progress{height:2px}.preview-progress.active{background:linear-gradient(90deg,transparent,#8b5ce8,transparent);background-size:200% 100%;animation:shimmer 1s infinite}.layers-bar{display:flex;align-items:center;gap:6px;overflow-x:auto;padding:6px 2px 12px;scrollbar-width:thin}.layer-chip{display:flex;align-items:center;gap:7px;flex:none;min-height:44px;max-width:150px;padding:7px 10px;border:1px solid var(--line);border-radius:14px;background:var(--surface);color:inherit}.layer-chip[aria-pressed=true]{border:2px solid #8e5be4;box-shadow:0 0 0 2px color-mix(in srgb,#8e5be4 25%,transparent)}.layer-chip.empty-layer{border-style:dashed}.layer-dot{width:12px;height:12px;border-radius:50%;border:1px solid #0003;flex:none}.layer-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px}.layer-eye{width:42px;height:44px;flex:none;border:0;background:transparent;color:inherit}.controls{padding:12px;margin-bottom:12px}.editor-tabs{display:grid;grid-template-columns:repeat(3,1fr);gap:4px;padding:4px;border-radius:14px;background:color-mix(in srgb,var(--hint) 12%,var(--surface))}.editor-tab{min-height:44px;border:0;border-radius:11px;background:transparent;color:inherit;font:inherit}.editor-tab[aria-selected=true]{background:var(--surface);box-shadow:var(--shadow);font-weight:650}.tab-content{padding:14px 2px 4px}.control-field{display:grid;gap:7px;margin:8px 0}.field-label,.range-label{font-size:13px;color:var(--hint)}.control-field input[type=text]{width:100%;min-height:50px;padding:10px 12px;border:1px solid var(--line);border-radius:13px;background:var(--surface);color:inherit;font:inherit}.counter{text-align:end;direction:ltr;color:var(--hint)}.font-row{display:flex;align-items:center;justify-content:space-between;margin-top:12px;padding:8px 0;border-top:1px solid var(--line)}.swatches{display:flex;flex-wrap:wrap;gap:9px;margin:8px 0 16px}.swatch{display:grid;place-items:center;width:38px;height:38px;border-radius:50%;border:1px solid #7777;color:#333;font-weight:800}.swatch[aria-pressed=true]{outline:3px solid #8b5ce8;outline-offset:2px}.custom-color{width:40px;height:40px;padding:0;border:0;border-radius:50%;overflow:hidden}.recent-colors{display:flex;gap:8px;flex-basis:100%}.outline-switch{min-height:44px;padding:0 14px;border-radius:22px;border:1px solid var(--line);background:var(--surface);color:inherit}.outline-switch[aria-checked=true]{background:#8758db;color:white}.range-wrap{margin:16px 0}.range-label{display:flex;align-items:center;justify-content:space-between;margin-bottom:6px}.range-wrap input{width:100%;accent-color:#8656e9}.value-pill{padding:4px 9px;border-radius:10px;background:color-mix(in srgb,#8656e9 14%,var(--surface));color:inherit}.rotation-dial{position:relative;width:142px;height:142px;margin:14px auto;border:0;border-radius:50%;touch-action:none;user-select:none;outline:none}.dial-ring{position:absolute;inset:7px;border:7px solid color-mix(in srgb,#8656e9 22%,var(--hint));border-radius:50%;box-shadow:inset 0 0 0 2px var(--surface)}.dial-knob{position:absolute;width:20px;height:20px;border:3px solid white;border-radius:50%;background:#8656e9;box-shadow:0 2px 8px #0004;transform:translate(-50%,-50%)}.dial-value{position:absolute;inset:0;display:grid;place-items:center;font-weight:700;pointer-events:none;direction:ltr}.quick-buttons{display:flex;justify-content:center;gap:6px;flex-wrap:wrap;margin:10px 0}.quick-buttons button{min-width:44px;min-height:42px}.position-controls{margin-top:12px}.kind-section{margin:12px 0}.kind-section .segmented button{min-height:44px}.kind-section .destination[aria-pressed=true]{border-color:#8656e9}.editor-footer{position:sticky;bottom:74px;z-index:3;display:flex;align-items:center;gap:10px;padding:8px 0;background:linear-gradient(transparent,var(--tg-theme-bg-color,#f7f5fb) 20%)}.editor-footer .primary{flex:1;width:auto}.size-meter{min-width:105px;max-width:42%;font-size:11px}.size-meter>span{display:block;width:0;height:4px;border-radius:5px;background:#13a878;transition:width .2s}.size-meter>span.amber{background:#eea323}.size-meter>span.red{background:#df4053}.inline-error{color:#c33;font-size:13px;margin:5px 0}.font-sheet-backdrop{position:fixed;z-index:10;inset:0;display:flex;align-items:flex-end;background:#0007}.font-sheet{width:min(100%,720px);max-height:78vh;overflow:auto;margin:auto auto 0;padding:18px;border-radius:22px 22px 0 0;background:var(--tg-theme-bg-color,#fff);color:var(--tg-theme-text-color,#201c28)}.font-sheet>button{float:inline-end}.font-sheet .font-grid{clear:both;padding-top:12px}.kind-section .destinations button[aria-pressed=true]{border:2px solid #9560e8}
@keyframes loading{from{opacity:.4}to{opacity:1}}
@media(max-width:420px){body{padding-inline:12px}.preview-stage{min-height:190px}.editor-footer{bottom:70px}.size-meter{min-width:86px}}
/* Sticky editor contract: topbar ~60px; preview 26vh (clamped 140–230px), toolbar 36px, layers 52px. The stack stays below the app header; collapse preview to 88px for long panels. */
/* Editor contract: preview + 44px layers row fits --sticky-h; focus/scroll space and fixed bars use these shared heights. */
.editor-v2{padding-bottom:calc(var(--tabbar-h) + 54px + env(safe-area-inset-bottom));scroll-padding-top:var(--sticky-h)}.preview-card{position:sticky;top:calc(60px + env(safe-area-inset-top));z-index:6;padding:6px;margin:0;border-radius:16px 16px 0 0;background:var(--tg-theme-bg-color,#f7f5fb);backdrop-filter:blur(16px);border:1px solid var(--line);box-shadow:var(--shadow)}.preview-stage{position:relative;width:100%;height:clamp(140px,26vh,230px);min-height:0;margin:0;border-radius:12px;overflow:hidden}.preview-player-next{position:absolute;inset:0}.preview-player-next svg,.preview-player svg{width:100%;height:100%}.preview-toolbar{position:absolute;z-index:3;inset-inline:8px;bottom:8px;height:36px;display:flex;align-items:center;gap:6px;padding:2px 6px;border-radius:12px;background:color-mix(in srgb,var(--tg-theme-bg-color,#fff) 88%,transparent);backdrop-filter:blur(10px)}.preview-toolbar button{width:32px;min-width:32px;height:32px;min-height:32px;padding:2px;border:0}.preview-toolbar input{flex:1;min-width:30px;margin:0}.time-label{font-size:10px;white-space:nowrap;direction:ltr}.preview-loading{position:absolute;z-index:4;top:6px;inset-inline:6px;height:3px;background:#9a62e8;animation:loading 1s ease-in-out infinite alternate}.preview-progress{height:2px}.preview-progress.active{background:#9a62e8}.preview-collapse{position:absolute;z-index:5;top:8px;inset-inline-end:8px;width:30px;height:30px;border:0;border-radius:50%;background:#fff9;color:#222}.preview-card.collapsed .preview-stage{height:88px}.preview-card.collapsed .preview-toolbar{height:30px}.layers-bar{position:sticky;top:calc(60px + env(safe-area-inset-top) + clamp(140px,26vh,230px) + 50px);z-index:6;display:flex;align-items:center;gap:5px;overflow-x:auto;padding:5px 4px;background:var(--tg-theme-bg-color,#f7f5fb);border-inline:1px solid var(--line);scrollbar-width:thin;scroll-snap-type:x mandatory}.layer-chip{display:flex;align-items:center;gap:5px;flex:none;min-height:38px;max-width:126px;padding:5px 7px;border:1px solid var(--line);border-radius:12px;background:var(--surface);color:inherit;scroll-snap-align:start}.layer-chip[aria-pressed=true]{border:2px solid #8e5be4;box-shadow:0 0 0 2px #8e5be455;font-weight:700}.layer-chip.empty-layer{border-style:dashed}.layer-dot{width:10px;height:10px;border-radius:50%;border:1px solid #0003;flex:none}.layer-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11px}.layer-eye{width:32px;height:38px;flex:none;border:0;background:transparent;color:inherit}.add-layer{position:sticky;inset-inline-end:0;z-index:2;flex:none;min-height:38px;padding:4px 8px;border:1px solid var(--line);border-radius:12px;background:var(--surface);white-space:nowrap}.controls{padding:10px;margin-bottom:8px}.editor-tabs{position:sticky;top:calc(60px + env(safe-area-inset-top) + 26vh + 100px);z-index:4}.tab-content{padding:8px 2px 4px}.control-field{position:relative;display:grid;gap:5px;margin:6px 0}.control-field input[type=text]{min-height:44px;padding:8px 42px 8px 11px}.control-field:has(input[type=text]) .field-label{display:none}.clear-inline{position:absolute;inset-inline-end:6px;top:4px;width:36px;height:36px;min-height:36px;padding:0;border:0;background:transparent;color:var(--hint);font-size:21px}.counter{display:block;text-align:right;direction:ltr;color:var(--hint);font-size:11px}.font-row{margin-top:7px;padding:5px 0}.font-row .secondary{min-height:34px;padding:5px 10px}.rotation-dial{width:128px;height:128px;margin:8px auto}.quick-buttons{gap:4px;margin:6px 0}.quick-buttons button{min-width:38px;min-height:36px;padding:5px 8px}.range-wrap{margin:9px 0}.range-label{gap:8px}.value-pill{white-space:nowrap;flex:none}.position-controls{margin-top:8px}.editor-footer{position:fixed;left:0;right:0;bottom:calc(70px + env(safe-area-inset-bottom));z-index:8;display:flex;align-items:center;justify-content:space-between;gap:10px;padding:8px 12px;background:var(--tg-theme-bg-color,#f7f5fb);backdrop-filter:blur(18px);border-top:1px solid var(--line)}.editor-footer .primary{flex:none;width:auto;min-width:112px;min-height:42px;padding:8px 14px}.size-meter{flex:1;min-width:100px;max-width:48%;font-size:11px}.size-meter>small{display:block;white-space:nowrap}.size-meter>span{display:block;width:0;height:4px;border-radius:5px;background:#13a878;transition:width .2s}.size-meter>span.amber{background:#eea323}.size-meter>span.red{background:#df4053}.editor-v2 .inline-error{margin:5px 0}.font-sheet-backdrop{position:fixed;z-index:10;inset:0}.kind-section{margin-bottom:120px}.rotation-dial:focus-visible{outline:3px solid #9864ed;outline-offset:3px}
@media(max-height:700px){.editor-tabs{top:calc(60px + env(safe-area-inset-top) + 150px)}.preview-card:not(.collapsed) .preview-stage{height:clamp(140px,26vh,180px)}.layers-bar{top:calc(60px + env(safe-area-inset-top) + clamp(140px,26vh,180px) + 50px)}}
`n
/* Compact editor layout */
.topbar:has(#back:not([hidden])){position:relative;top:auto;height:44px;min-height:44px;padding:0;backdrop-filter:none}
.topbar:has(#back:not([hidden])) .brand strong,.topbar:has(#back:not([hidden])) .brand small,#screen-title{display:none}
.topbar:has(#back:not([hidden])) .logo{width:30px;height:30px;border-radius:10px}
.topbar:has(#back:not([hidden])) .logo svg{width:19px;height:19px}
.topbar:has(#back:not([hidden])) .back,.topbar:has(#back:not([hidden])) .language{width:40px;height:40px;min-height:40px;padding:0;display:grid;place-items:center}
.topbar:has(#back:not([hidden])) .language{width:auto;min-width:76px;height:44px;min-height:44px;padding:0 8px;display:inline-flex;flex:none;align-items:center;justify-content:center;gap:5px;white-space:nowrap;overflow:visible}
.language [data-lang]{display:inline-flex;align-items:center;justify-content:center;min-width:19px;min-height:30px;padding:0 2px;white-space:nowrap}
.topbar:has(#back:not([hidden])):after{content:attr(data-template);font-size:13px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1;margin-inline:10px}
#app:has(.editor-v2:not([hidden])){margin-top:0}
.editor-sticky{position:sticky;top:env(safe-area-inset-top);z-index:6;background:var(--tg-theme-bg-color,#f7f5fb);border-bottom:1px solid var(--line);box-shadow:var(--shadow)}
.preview-card{position:relative;top:auto;z-index:auto;height:clamp(120px,19vh,150px);padding:4px;margin:0;border:0;border-radius:0;background:var(--tg-theme-bg-color,#f7f5fb);box-shadow:none;overflow:hidden}
.preview-stage{position:relative;width:min(100%,clamp(120px,19vh,150px));height:100%;min-height:0;margin:0 auto;border-radius:12px;overflow:hidden}
.preview-player-next,.preview-player{position:absolute;inset:0;width:100%;height:100%}.preview-player-next svg,.preview-player svg{width:100%;height:100%;object-fit:contain}
.preview-card.collapsed{height:72px}.preview-card.collapsed .preview-stage{height:64px;width:64px}
.preview-float{position:absolute;z-index:5;width:44px;height:44px;min-width:44px;min-height:44px;padding:6px;border:0;border-radius:50%;background:#ffffffd9;color:#241c2a;display:grid;place-items:center}
.preview-float svg{width:20px;height:20px}.preview-collapse{top:0;inset-inline-start:0}.preview-background-button{top:0;inset-inline-end:0}.preview-play-button{bottom:0;inset-inline-end:0}
.preview-loading{z-index:4;top:4px;inset-inline:4px}.preview-progress{display:none}
.scrub-row{height:32px;display:flex;align-items:center;gap:8px;padding:0 10px;background:var(--tg-theme-bg-color,#f7f5fb);border-bottom:1px solid var(--line)}
.preview-scrubber{height:24px;min-width:0;flex:1;accent-color:#8656e9}.time-label{font-size:10px;white-space:nowrap;direction:ltr}
.layers-bar{height:calc(var(--bar-h) + 8px);min-height:calc(var(--bar-h) + 8px);display:flex;align-items:center;gap:4px;overflow-x:auto;padding:0 4px;scrollbar-width:none;scroll-snap-type:x mandatory;direction:rtl}
.layers-bar::-webkit-scrollbar{display:none}.layer-chip{height:40px;min-height:40px;width:auto;min-width:76px;max-width:120px;gap:4px;padding:3px 5px;scroll-snap-align:start}.layer-name{min-width:0;flex:1;font-size:10px}.layer-eye{width:28px;height:28px;min-width:28px;min-height:28px;padding:4px}.layer-eye svg{width:17px;height:17px}
.add-layer,.layer-menu{position:sticky;inset-inline-start:0;z-index:3;flex:none;width:44px;height:44px;min-width:44px;min-height:44px;padding:9px;border:1px solid var(--line);border-radius:12px;background:var(--surface);color:inherit;display:grid;place-items:center}
.layers-bar .add-layer,.layers-bar .layer-menu{position:static;order:initial}
.layer-actions{position:fixed;z-index:9;top:calc(env(safe-area-inset-top) + var(--sticky-h));inset-inline-end:12px;padding:8px;border:1px solid var(--line);border-radius:12px;background:var(--surface);box-shadow:var(--shadow)}
.controls{padding:8px 10px;margin:0 0 8px;border-radius:0;box-shadow:none}.editor-tabs{position:sticky;top:calc(env(safe-area-inset-top) + var(--sticky-h));z-index:5}
.tab-content{padding:6px 2px 4px}.control-field input[type=text]{padding-inline:40px;min-height:44px}.clear-inline{inset-inline-end:0;top:0;width:40px;height:40px;min-height:40px;padding:4px}.counter{display:block;text-align:end;unicode-bidi:isolate;direction:ltr;margin-inline-start:auto}
.rotation-dial{width:120px;height:120px;margin:2px auto}.quick-buttons{flex-wrap:nowrap;gap:3px;margin:4px 0}.quick-buttons button{min-width:40px;min-height:40px;padding:4px}.range-wrap{margin:7px 0}.editor-footer{bottom:var(--tabbar-h);padding:6px 10px}.editor-footer .primary{min-height:42px}.kind-section{margin-bottom:12px}
.topbar:has(#back:not([hidden])) .brand .editor-title{display:block}
.timeline-toolbar{display:flex;gap:5px;overflow-x:auto;margin:0 0 9px}.timeline-toolbar button{flex:none;min-height:38px;padding:6px 9px;font-size:12px}.timeline-card{position:relative;direction:ltr;overflow:hidden;border:1px solid var(--line);border-radius:14px;background:var(--surface);padding:8px}.timeline-ruler{height:30px;position:relative;margin-left:75px;touch-action:none}.timeline-axis{position:absolute;inset:0;border-bottom:1px solid var(--line)}.timeline-tick{position:absolute;bottom:2px;transform:translateX(-50%);font-size:10px;color:var(--hint)}.timeline-tracks{position:relative}.timeline-row{display:grid;grid-template-columns:68px minmax(0,1fr);min-height:44px;align-items:center;gap:7px}.timeline-row.selected{background:color-mix(in srgb,#8656e9 7%,transparent)}.timeline-label{display:flex;align-items:center;gap:4px;min-width:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;border:0;background:none;color:inherit;font-size:10px;padding:2px}.timeline-label .layer-dot{width:8px;height:8px}.timeline-track{position:relative;height:36px;border-bottom:1px solid var(--line);background:repeating-linear-gradient(90deg,transparent 0,transparent calc(16.666% - 1px),var(--line) 16.666%)}.timeline-bar{position:absolute;top:7px;height:22px;min-width:8px;border:1px solid #1118;border-radius:6px;touch-action:none;cursor:grab;box-shadow:0 1px 3px #0002}.timeline-bar.disabled{opacity:.38;background-image:repeating-linear-gradient(135deg,#7775 0 3px,transparent 3px 7px)}.timeline-bar:focus-visible{outline:2px solid #8656e9;outline-offset:2px}.timeline-handle{position:absolute;top:-1px;width:14px;height:22px;border:1px solid #3338;background:#fff9;cursor:ew-resize}.timeline-handle:after{content:"‖";position:absolute;inset:1px 0;text-align:center;font-size:12px;color:#222}.timeline-handle.start{left:-1px;border-radius:5px 0 0 5px}.timeline-handle.end{right:-1px;border-radius:0 5px 5px 0}.timeline-playhead{position:absolute;z-index:3;top:0;bottom:0;left:0;width:2px;background:#ef456b;pointer-events:none}.timeline-playhead:before{content:"";position:absolute;top:-2px;left:-4px;width:10px;height:10px;border-radius:50%;background:#ef456b}.timeline-tooltip{position:absolute;z-index:4;top:2px;right:8px;padding:4px 7px;border-radius:7px;background:#25212b;color:#fff;font-size:11px}.timeline-tooltip[hidden]{display:none}.timeline-overlap-summary{margin:8px 0 0;font-size:11px;color:var(--hint)}.timeline-row.overlap .timeline-track{background-image:repeating-linear-gradient(135deg,#e84b6950 0 2px,transparent 2px 6px),repeating-linear-gradient(90deg,transparent 0,transparent calc(16.666% - 1px),var(--line) 16.666%)}.timeline-presets{grid-column:1/-1;display:flex;gap:4px;overflow:auto;padding-inline-start:68px}.timeline-preset{flex:none;min-height:30px;padding:3px 7px;font-size:10px}.anim-section{margin:8px 0 16px}.anim-section h3{margin:4px 0 7px}.anim-switch{min-height:36px;padding:5px 12px;border:1px solid var(--line);border-radius:18px;background:var(--surface);color:inherit}.anim-switch[aria-checked=true]{background:#8758db;color:white}.anim-options{display:flex;gap:8px;margin-top:8px}.anim-card{display:grid;justify-items:center;gap:4px;flex:1;min-height:74px;border:1px solid var(--line);border-radius:12px;background:var(--surface);color:inherit;font:inherit;font-size:11px}.anim-card[aria-pressed=true]{border:2px solid #8e5be4;background:color-mix(in srgb,#8656e9 10%,var(--surface))}.anim-icon{display:grid;place-items:center;width:34px;height:34px;border-radius:50%;background:#8656e922;color:#8656e9;animation:animPreview 1.2s ease-in-out infinite alternate}.anim-icon.fade{opacity:.35}.anim-icon.slide{transform:translateY(4px)}@keyframes animPreview{to{transform:scale(1.15);opacity:1}}.scrub-row{display:flex;align-items:center;gap:6px;min-height:42px;padding:2px 4px}.scrub-row .preview-scrubber{flex:1;min-width:20px}.scrub-row .icon-button{width:40px;height:40px;min-width:40px;min-height:40px;padding:7px}.editor-tabs{grid-template-columns:repeat(5,minmax(0,1fr))}.editor-tab{font-size:12px;padding:2px}.preview-stage{touch-action:none}

/* Editor drag affordances */
.timeline-bar,.timeline-handle{user-select:none;-webkit-user-select:none}.timeline-handle{cursor:ew-resize}.timeline-dragging{user-select:none;-webkit-user-select:none;cursor:grabbing}
.preview-stage .selection-box{position:absolute;width:12px;height:12px;border:1px dashed #ff4d6d;border-radius:50%;transform:translate(-50%,-50%);pointer-events:none;z-index:3}
.preview-stage .snap-guide{position:absolute;z-index:3;pointer-events:none;background:#ff4d6d99}.preview-stage .snap-guide.vertical{top:0;bottom:0;width:1px;left:50%}.preview-stage .snap-guide.horizontal{left:0;right:0;height:1px;top:50%}

/* Timeline controls and tracks */
.scrub-row .icon-button{width:44px;height:44px;min-width:44px;min-height:44px;border:1px solid var(--line);border-radius:12px;background:var(--surface);color:inherit;display:grid;place-items:center}
.scrub-row .icon-button:disabled{opacity:.4}.scrub-row .icon-button:hover:not(:disabled),.timeline-preset:hover{background:color-mix(in srgb,var(--hint) 10%,var(--surface))}
.scrub-row #undo svg{transform:scaleX(-1)}.scrub-row #redo svg{transform:scaleX(-1)}[dir="rtl"] .scrub-row #undo svg,[dir="rtl"] .scrub-row #redo svg{transform:none}
.timeline-toolbar .secondary{min-height:44px;border:1px solid var(--line);border-radius:12px;background:var(--surface);color:inherit}
.timeline-toolbar .secondary:disabled{opacity:.4}
.timeline-row{border-radius:8px}.timeline-row:nth-child(even){background-color:color-mix(in srgb,var(--hint) 3%,transparent)}
.timeline-row.selected{background-color:color-mix(in srgb,#8656e9 7%,transparent)}
.timeline-track{height:36px;border-radius:5px;background-color:color-mix(in srgb,var(--hint) 5%,var(--surface));background-image:repeating-linear-gradient(90deg,transparent 0,transparent calc(16.666% - 1px),var(--line) 16.666%)}
.timeline-row.disabled .timeline-track{opacity:.55}.timeline-bar{top:5px;height:26px;min-width:14px;border:1px solid #17202a88;border-radius:10px;box-shadow:0 1px 3px #0003;overflow:hidden}
.timeline-bar[tabindex="0"]{box-shadow:0 0 0 2px var(--surface),0 0 0 4px #8656e9}
.timeline-bar-label{display:block;overflow:hidden;padding:3px 17px;white-space:nowrap;text-overflow:ellipsis;font-size:10px;line-height:18px;color:#17141d;text-shadow:0 1px 1px #fff8;pointer-events:none}
.timeline-handle{top:0;width:14px;height:24px;border:1px solid #3b354488;background:#fffd;border-radius:6px}
.timeline-handle.start{left:0}.timeline-handle.end{right:0}.timeline-handle:after{inset:3px 0}
.timeline-playhead{top:-1px;bottom:-1px;width:2px;background:#e54169;pointer-events:auto}.timeline-playhead:before{top:-3px;left:-5px;width:12px;height:12px;background:#e54169}
.timeline-tracks{position:relative}.timeline-tracks:after{content:"";position:absolute;z-index:4;top:0;bottom:0;left:var(--playhead-x,0);width:24px;transform:translateX(-50%);cursor:ew-resize}
.timeline-overlap-band{position:absolute;z-index:1;top:0;bottom:0;pointer-events:none;background:repeating-linear-gradient(135deg,#e84b6940 0 2px,transparent 2px 6px);border-top:2px solid #e84b6970}
.timeline-row.overlap .timeline-track{background-image:repeating-linear-gradient(90deg,transparent 0,transparent calc(16.666% - 1px),var(--line) 16.666%)}
.timeline-preset{min-height:34px;border:1px solid var(--line);border-radius:18px;background:var(--surface);color:inherit}.timeline-preset[aria-pressed="true"]{border-color:#8656e9;background:#8656e9;color:white}
.timeline-overlap-summary{color:var(--hint)}.timeline-overlap-summary:not(.has-overlap){color:#198754}
.language{flex-wrap:nowrap;white-space:nowrap}.language [data-lang][aria-pressed="true"]{padding:0 4px;border-radius:7px;background:color-mix(in srgb,#8656e9 14%,var(--surface));color:#8656e9}
@media(prefers-color-scheme:dark){.timeline-bar-label{color:#17141d}.timeline-handle{background:#fff}.timeline-tooltip{background:#f2eff6;color:#201c28}.timeline-overlap-summary:not(.has-overlap){color:#63c99b}}

/* ---- v3: font sheet, layer tools, eye preview, review step, bigger preview ---- */
:root{--sticky-h:calc(clamp(160px,28vh,270px) + 44px + 16px + 36px)}
.editor-v2 .preview-card .preview-stage,.preview-card .preview-stage{height:clamp(160px,28vh,270px)!important;min-height:0!important}
.layers-bar{display:flex!important;align-items:center;gap:8px}
.layer-chips{display:flex;gap:8px;overflow-x:auto;flex:1;min-width:0;scrollbar-width:none;padding:2px;scroll-snap-type:x proximity}
.layer-chips::-webkit-scrollbar{display:none}
.layer-chips>.layer-chip{flex:none;scroll-snap-align:start}
.layer-tools{display:flex;gap:6px;flex:none}
.layer-tools .add-layer,.layer-tools .layer-menu{position:static!important;inset:auto!important}
.font-sheet-backdrop{position:fixed;inset:0;z-index:90;background:rgba(0,0,0,.45);display:flex;align-items:flex-end;justify-content:center}
.font-sheet{position:relative;width:min(560px,100%);max-height:78vh;overflow:auto;background:var(--tg-theme-bg-color,#f7f5fb);color:var(--tg-theme-text-color,#201c28);border-radius:22px 22px 0 0;padding:16px 14px calc(18px + env(safe-area-inset-bottom));box-shadow:0 -12px 40px rgba(0,0,0,.25)}
.font-sheet h2{margin:0 0 12px;font-size:17px}
.font-close{position:absolute;inset-block-start:10px;inset-inline-end:12px;width:40px;height:40px;border-radius:50%;border:0;background:var(--tg-theme-secondary-bg-color,#eee);color:inherit;font-size:22px;line-height:1}
.preview-focus-button{position:absolute;inset-block-start:8px;inset-inline-end:8px;z-index:3}
.focus-backdrop{position:fixed;inset:0;z-index:100;background:rgba(10,8,18,.9);display:grid;place-items:center}
.focus-stage{width:min(94vw,78vh);height:min(94vw,78vh);background:#fff;border-radius:22px;overflow:hidden}
.focus-close{position:absolute;inset-block-start:calc(14px + env(safe-area-inset-top));inset-inline-end:14px;width:46px;height:46px;border-radius:50%;border:0;background:#fff;color:#111;font-size:26px;line-height:1;box-shadow:0 4px 18px rgba(0,0,0,.35)}
.review-overlay{position:fixed;inset:0;z-index:70;display:flex;flex-direction:column;background:var(--tg-theme-bg-color,#f7f5fb);color:var(--tg-theme-text-color,#201c28);overflow:auto}
.review-overlay[hidden]{display:none!important}
.review-head{display:flex;align-items:center;gap:10px;padding:calc(10px + env(safe-area-inset-top)) 12px 6px}
.review-head h2{margin:0;font-size:18px}
.review-stage{width:min(70vw,34vh);height:min(70vw,34vh);margin:8px auto;border-radius:22px;background:var(--tg-theme-secondary-bg-color,#fff);overflow:hidden;flex:none}
.review-body{padding:6px 14px 10px}
.review-foot{position:sticky;bottom:0;margin-top:auto;padding:12px 14px calc(14px + env(safe-area-inset-bottom));background:var(--tg-theme-bg-color,#f7f5fb);border-top:1px solid var(--line,#e6e1f0)}
.review-foot .primary{width:100%}
.editor-footer .primary{flex:1}
/* v3 fixes */
.preview-card .preview-focus-button{inset-block-start:auto!important;inset-block-end:8px!important;inset-inline-end:auto!important;inset-inline-start:8px!important}
.review-head .icon-button{width:44px;height:44px;border-radius:14px;border:1px solid var(--line,#e6e1f0);background:var(--tg-theme-secondary-bg-color,#fff);color:inherit;display:grid;place-items:center;padding:0}
.review-head .icon-button svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
html[dir=rtl] .review-head .icon-button svg{transform:scaleX(-1)}

/* v4 fixes: preview never clipped, font previews follow theme */
.preview-card{height:auto!important}
.preview-card .preview-stage,.editor-v2 .preview-card .preview-stage{height:clamp(170px,30vh,280px)!important;width:auto!important;aspect-ratio:1/1;max-width:100%}
.preview-card.collapsed{height:72px!important}.preview-card.collapsed .preview-stage{height:64px!important;width:64px!important}
.font-preview{color:inherit}
.font-card{color:var(--tg-theme-text-color,inherit)}
@media(prefers-color-scheme:dark){.font-sheet{background:var(--tg-theme-bg-color,#1b1722);color:var(--tg-theme-text-color,#f2eff6)}.font-card{background:#26212f;border-color:#3a3445}.font-preview{background:#2f2938}}

/* Home, plans, premium */
#home{display:grid;gap:12px}#home[hidden]{display:none}
.help-btn{font-size:20px;font-weight:700;line-height:1;cursor:pointer}.help-btn[aria-pressed=true]{color:#8656e9;border-color:#8656e9}body.editor-open .help-btn{display:none}
.ad-banner{display:block;width:100%;padding:0;border:1px solid var(--line);border-radius:18px;overflow:hidden;background:var(--surface);cursor:pointer;box-shadow:var(--shadow)}.ad-banner img{display:block;width:100%;height:auto;max-height:22vh;object-fit:contain;margin:0 auto}
.profile-card{display:grid;grid-template-columns:auto 1fr;align-items:center;gap:12px;padding:16px;border:1px solid var(--line);border-radius:20px;background:var(--surface);box-shadow:var(--shadow)}.profile-card .subscribe{grid-column:1/-1;margin-top:2px}
.avatar{display:grid;place-items:center;width:58px;height:58px;border-radius:50%;overflow:hidden;color:#fff;font-size:24px;flex:none}.avatar img{width:100%;height:100%;object-fit:cover}.avatar b{font-weight:700}
.profile-info{min-width:0;display:grid;gap:6px}.profile-name{font-size:17px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.plan-row{display:flex;align-items:center;gap:8px;flex-wrap:wrap;font-size:12px}
.plan-badge{padding:3px 10px;border-radius:999px;background:var(--accent);color:#fff;font-size:12px;font-weight:650}
.widgets{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.widget{display:grid;gap:4px;padding:14px;border:1px solid var(--line);border-radius:18px;background:var(--surface);box-shadow:var(--shadow)}.widget strong{font-size:24px}.widget span{color:var(--hint);font-size:12px}.widget.wide{grid-column:1/-1}
.quick-actions{display:grid;gap:10px}.quick-actions .secondary{margin-top:0}
.plan-line{margin:0 0 4px}
.pack-icon{display:grid;place-items:center;flex:none;width:44px;height:44px;border-radius:13px;background:#f2eafa;font-size:24px;overflow:hidden}.pack-icon img{width:100%;height:100%;object-fit:contain}
.card.locked{position:relative}.card.locked .card-preview{opacity:.55}.lock-badge{position:absolute;top:8px;inset-inline-end:8px;z-index:1;display:grid;place-items:center;width:28px;height:28px;border-radius:50%;background:#332545;color:#fff;font-size:14px;box-shadow:0 2px 8px #0004}
.plan-sheet{display:grid;gap:10px}.plan-sheet .lock-art{font-size:38px;text-align:center}.plan-sheet h2{text-align:center;margin:0}.plan-sheet p{margin:0}.plan-sheet .muted,.plan-sheet .hint{text-align:center}.coupon-row{display:flex;gap:8px}.coupon-input{flex:1;min-width:0;min-height:46px;padding:10px 12px;border:1px solid var(--line);border-radius:14px;background:var(--surface);color:inherit;font:inherit;text-transform:uppercase;direction:ltr}.coupon-row .primary{flex:none;width:auto;min-width:92px}.coupon-msg{min-height:1.2em;color:#c44;font-size:13px}.coupon-msg.ok{color:#2f9e5b}
.plan-sheet .secondary{margin-top:0}.plan-sheet .font-close{position:absolute;top:8px;inset-inline-end:10px}
.help-step h3{margin:0 0 4px;font-size:15px}.help-step p{margin:0;font-size:13.5px;line-height:1.5}
.tabs button[data-tab=create]{min-width:96px}.tabs button[data-tab=create] svg{width:46px;height:46px;margin-top:-18px;padding:11px;border-radius:50%;background:var(--accent);stroke:#fff;fill:none;box-shadow:0 6px 16px #9d48ca55}.tabs button[data-tab=create][aria-current=page]:after{display:none}.tabs button[data-tab=create] span{margin-top:-2px}
@media(prefers-color-scheme:dark){.pack-icon,.emoji{background:#2f2938}.plan-sheet .coupon-input{background:#26212f}}
.widget{justify-items:start}.widget strong{direction:ltr}
@media(prefers-color-scheme:dark){.plan-sheet{--surface:#26212f}}
.ad-banner{aspect-ratio:3/1;position:relative}.ad-banner.loading{background:linear-gradient(90deg,var(--surface),var(--line),var(--surface));background-size:200% 100%;animation:adsk 1.2s linear infinite}.ad-banner img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;max-height:none}@keyframes adsk{to{background-position:-200% 0}}
.coupon-btn{width:100%;margin:10px 0 0}.coupon-btn+.quick-actions{margin-top:10px}
