:root{color-scheme:dark;--page:#090b12;--surface:#12151f;--panel:#181c28;--line:#282d3d;--text:#f0f1f8;--muted:#959bb2;--green:#bafa68;--purple:#a58aff;font-family:Arial,Helvetica,sans-serif;color:var(--text);background:var(--page);font-synthesis:none}*{box-sizing:border-box}body{margin:0;background:radial-gradient(ellipse 550px 360px at 50% 210px,#3526512e,transparent),var(--page)}button,input,select,textarea{font:inherit}button{cursor:pointer}button:disabled{cursor:not-allowed;opacity:.5}button,a,input,textarea,select{outline-offset:4px}button:focus-visible,a:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible{outline:2px solid var(--green)}a{color:inherit}fieldset{border:0;padding:0;margin:0;min-width:0}[hidden]{display:none!important}.topbar{display:flex;justify-content:space-between;align-items:center;gap:20px;max-width:1400px;margin:auto;padding:24px 42px;border-bottom:1px solid #202332}.wordmark{text-decoration:none;font-size:25px;font-weight:750;letter-spacing:-1px;white-space:nowrap}.wordmark>span{color:var(--green)}.wordmark i{font-size:25px;font-style:normal;color:var(--purple);margin-left:9px}.header-tools{display:flex;align-items:center;gap:18px}.badge{border:1px solid #343042;background:#1a1728;color:#b9a7d9;padding:7px 11px;border-radius:20px;font-size:.75rem;white-space:nowrap}.badge.verified{background:#18251b;color:#bde19a;border-color:#314b2a}.quiet-button{padding:7px 0;border:0;background:none;color:var(--muted);font-size:.875rem}.quiet-button:hover{color:var(--green)}select{background:#141822;color:#d5d8e5;border:1px solid var(--line);border-radius:9px;padding:8px 11px;font-size:.875rem;max-width:150px}main{max-width:1180px;margin:auto;padding:0 36px}.intro{text-align:center;padding:38px 0 15px}.eyebrow{display:block;font-size:.75rem;font-weight:500;color:#9ca0b6;letter-spacing:2px}.intro h1{font-size:clamp(68px,8vw,102px);font-weight:760;letter-spacing:-7px;line-height:1.03;margin:19px 0 16px;position:relative;display:inline-block}.intro h1>span:first-child{color:var(--green);text-shadow:0 0 40px #bafa681b}.hero-spark{position:absolute;right:-40px;top:0;font-size:38px;color:var(--purple);letter-spacing:0;transform:rotate(10deg)}.intro h2{font-size:clamp(21px,2.2vw,29px);font-weight:500;letter-spacing:-.7px;margin:0 0 10px}.intro p{font-size:1rem;line-height:1.6;color:var(--muted);margin:0}.preview-section{max-width:970px;margin:8px auto 25px}.gallery{min-height:270px;display:flex;align-items:center;justify-content:center;gap:19px;padding:27px 24px 31px;overflow-x:auto;scroll-snap-type:x mandatory;scrollbar-color:#55506f transparent;scrollbar-width:thin}.gallery.generated{justify-content:flex-start}.gallery-card{flex:0 0 26%;min-width:173px;max-width:244px;background:none;border:0;padding:0;scroll-snap-align:center;position:relative;filter:drop-shadow(0 10px 20px #0006);transition:transform .2s}.gallery-card:first-child{transform:rotate(-4deg)}.gallery-card:nth-child(3){transform:rotate(4deg)}.gallery.generated .gallery-card{transform:none}.gallery-card:hover{transform:translateY(-6px)!important}.gallery-card img{display:block;width:100%;height:auto;aspect-ratio:4/5;border-radius:10px;border:1px solid #ffffff16}.gallery-footer{display:flex;justify-content:space-between;align-items:center;gap:15px;padding:0 20px;font-size:.75rem;color:var(--muted);min-height:30px}.preview-hint{color:#878da5}.preview-status{font-size:.75rem;text-align:center;color:#b8a1e1;min-height:15px;margin:8px 0}.download{padding:10px 14px;background:#202d1b;border:1px solid #52653a;border-radius:9px;text-decoration:none;color:#d1efa9;font-size:.875rem;white-space:nowrap}.download[aria-disabled=true]{opacity:.5;cursor:wait}.composer{background:linear-gradient(145deg,#151822,#10131d);border:1px solid var(--line);border-radius:22px;padding:29px 32px 22px;box-shadow:0 12px 60px #0003;max-width:1040px;margin:auto}.composer-heading{display:flex;justify-content:space-between;align-items:center;gap:20px;margin-bottom:19px}.section-number{font-size:.75rem;color:#9096ad;letter-spacing:1px}.composer-heading h2{font-size:25px;font-weight:550;letter-spacing:-.6px;margin:9px 0 8px}.composer-heading p{margin:0;color:#858da6;font-size:.875rem}.example-button{border:1px solid #353b4e;border-radius:8px;padding:9px 13px;white-space:nowrap}textarea{width:100%;display:block;min-height:142px;max-height:430px;resize:vertical;border:1px solid #30364a;background:#0b0f19;color:#e0e4f0;border-radius:12px;padding:17px 19px;font-size:1rem;line-height:1.65}textarea::placeholder{color:#737c95}.text-meta{display:flex;justify-content:space-between;gap:20px;font-size:.75rem;color:#858da3;line-height:1.6;margin-top:10px}#character-count{white-space:nowrap}.customize-heading{margin-top:25px;padding-top:23px;border-top:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;gap:16px}.mode-tabs{display:flex;padding:4px;gap:3px;background:#0b0f19;border:1px solid #292f42;border-radius:10px}.mode-tabs button{border:0;background:none;color:#8d96af;border-radius:7px;padding:9px 15px;font-size:.875rem;display:flex;gap:7px;align-items:center;transition:background .15s,color .15s}.mode-tabs button[aria-selected=true]{background:#272d3e;color:#eff4fa;box-shadow:0 2px 6px #0005}.mode-tabs button[aria-selected=true]>span:first-child{color:var(--green)}.panel-hint{font-size:.875rem;color:#9098ae;margin:17px 0}.preset-options{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:15px}.preset{cursor:pointer;position:relative;min-width:0}.preset input,.font-options input,.decoration-options input{position:absolute;opacity:0;width:1px;height:1px}.preset-surface{display:flex;flex-direction:column;position:relative;background:#181d2a;border:1px solid #343b50;border-radius:13px;padding:11px 13px 14px;transition:border .2s,background .2s}.preset input:checked+.preset-surface{border-color:#93c951;background:#1b251c;box-shadow:0 0 0 1px #bbf76617}.preset input:focus-visible+.preset-surface,.font-options input:focus-visible+span,.decoration-options input:focus-visible+span{outline:2px solid var(--green);outline-offset:3px}.preset-art{height:80px;display:flex;align-items:center;position:relative;overflow:hidden;border-radius:8px;background:#171925;color:#bbf766;padding:10px 16px;margin-bottom:13px}.art-tag{font-size:40px;font-weight:650;letter-spacing:-2px;z-index:1}.art-orbit{position:absolute;width:110px;height:110px;border:1px solid #bbf76625;border-radius:50%;right:-30px;top:5px;box-shadow:0 0 0 16px #bbf7660b,0 0 0 34px #bbf76608}.preset-check{position:absolute;top:8px;right:8px;width:20px;height:20px;display:grid;place-items:center;font-size:12px;background:var(--green);color:#142008;border-radius:50%;opacity:0}.preset input:checked+span .preset-check{opacity:1}.peach .preset-art{background:#ffe4d3;color:#302339}.peach .art-tag{font-family:Georgia,serif}.blue .preset-art{background-color:#182d72;background-image:linear-gradient(#80dcff14 1px,transparent 1px),linear-gradient(90deg,#80dcff14 1px,transparent 1px);background-size:15px 15px;color:#80dcff}.preset-title{font-size:.875rem;font-weight:550;color:#e1e5ef;line-height:1.4}.preset-description{font-size:.75rem;color:#8b96af;margin-top:5px;line-height:1.5;min-height:36px}.palette-dots{display:flex;gap:5px;margin-top:10px}.palette-dots i{width:10px;height:10px;border-radius:50%;background:#171925;border:1px solid #ffffff20}.palette-dots i:nth-child(2){background:#f4f5fb}.palette-dots i:nth-child(3){background:#bbf766}.peach .palette-dots i:first-child{background:#ffe4d3}.peach .palette-dots i:nth-child(2){background:#302339}.peach .palette-dots i:nth-child(3){background:#d64e79}.blue .palette-dots i:first-child{background:#182d72}.blue .palette-dots i:nth-child(2){background:#f0f5ff}.blue .palette-dots i:nth-child(3){background:#80dcff}.advanced-grid{display:grid;grid-template-columns:1.2fr 1fr;gap:24px}.advanced-group legend{font-size:.875rem;color:#b0b8cc;margin-bottom:12px}.font-options{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}.font-options label,.decoration-options label{position:relative;cursor:pointer;min-width:0}.font-options label>span{display:flex;flex-direction:column;align-items:center;gap:9px;padding:12px 6px;border:1px solid #343b50;border-radius:9px;background:#171c29}.font-options b{font-size:26px;color:#d5c4ff}.font-options small,.decoration-options small{font-size:.75rem;color:#9ba7c1;text-align:center;line-height:1.4}.serif-sample{font-family:Georgia,serif}.mono-sample{font-family:Consolas,monospace}.font-options input:checked+span,.decoration-options input:checked+span{border-color:#a98fed;background:#272039}.color-options{display:flex;gap:20px;justify-content:space-between;padding:8px 0}.color-options label{display:flex;flex-direction:column;align-items:center;gap:10px;font-size:.75rem;color:#9ba7c1;cursor:pointer;min-width:0;text-align:center}.color-options input{height:42px;width:42px;padding:4px;border:1px solid #515971;border-radius:50%;background:#141926;cursor:pointer}.color-options input::-webkit-color-swatch-wrapper{padding:0}.color-options input::-webkit-color-swatch{border:0;border-radius:50%}.decoration-group{grid-column:1/-1}.decoration-options{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:9px}.decoration-options label>span{display:flex;align-items:center;gap:10px;border:1px solid #343b50;border-radius:9px;padding:10px;background:#171c29}.pattern{display:block;width:35px;height:30px;flex-shrink:0;border-radius:5px;background:#252d43}.grid-pattern{background-image:linear-gradient(#7b89ae44 1px,transparent 1px),linear-gradient(90deg,#7b89ae44 1px,transparent 1px);background-size:8px 8px}.dots-pattern{background-image:radial-gradient(#a38ace88 1px,transparent 1px);background-size:6px 6px}.rings-pattern{background:repeating-radial-gradient(circle at right,#252d43 0 5px,#7b89ae55 6px 7px,#252d43 8px 12px)}.bottom-controls{display:flex;gap:24px;align-items:flex-end;border-top:1px solid var(--line);padding-top:21px;margin-top:24px}.author-field{flex:1;max-width:310px}.author-field label{display:flex;justify-content:space-between;align-items:baseline;gap:10px;font-size:.875rem;color:#9fa9c0;margin-bottom:9px}.author-field small{font-size:.75rem;color:#76829d}.author-field input{height:43px;width:100%;border:1px solid #30384d;border-radius:8px;background:#0c111b;color:#e1e7f5;padding:0 13px;font-size:.875rem}.author-field input::placeholder{color:#76819a}.format-note{display:flex;flex-direction:column;gap:6px;font-size:.75rem;color:#7f8aa3;padding-bottom:6px}.format-note strong{font-weight:normal;color:#a0aac0}.generate{margin-left:auto;display:flex;align-items:center;justify-content:space-between;gap:21px;padding:13px 22px;background:var(--green);border:1px solid #bafa68;color:#14200c;font-size:.875rem;font-weight:600;border-radius:10px;min-height:48px;box-shadow:0 0 22px #bafa6810;white-space:nowrap}.generate:hover:not(:disabled){background:#d1ff95;box-shadow:0 0 22px #bafa6826}.generate>span:last-child{font-size:22px}.feedback{font-size:.875rem;text-align:center;color:#b1d496;line-height:1.6;margin:15px 0 0}.feedback:empty{display:none}.feedback.error{color:#ffaaaa}.privacy-note{font-size:.75rem;color:#7f8aa3;line-height:1.6;text-align:center;margin:12px 0 0}.generation-progress{display:flex;align-items:center;justify-content:center;gap:11px;margin-top:18px;color:#c6b4e4;font-size:.875rem}.spinner{width:18px;height:18px;border:2px solid #3e344e;border-top-color:var(--purple);border-radius:50%;animation:spin 1s linear infinite}.footer{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:35px 3px;font-size:.75rem;color:#6e7890}.footer .wordmark{font-size:21px;color:#9da9c2}.footer>span:last-child{letter-spacing:1px}dialog{background:#131925;border:1px solid #38425c;color:#c9d5ef;border-radius:17px;padding:16px;max-width:min(570px,94vw);max-height:95vh;box-shadow:0 20px 100px #0009}dialog::backdrop{background:#040610cf;backdrop-filter:blur(8px)}.dialog-top,.dialog-bottom{display:flex;align-items:center;justify-content:space-between;gap:15px}.dialog-top{margin-bottom:12px}.dialog-top h2{font-size:.875rem;font-weight:500;margin:0}.dialog-bottom{margin-top:12px}.icon-button{width:34px;height:34px;border:1px solid #3a4866;background:#1c2537;border-radius:50%;font-size:19px;color:#b0c4ec}#main-slide{display:block;width:auto;height:auto;max-width:100%;max-height:72vh;margin:auto;border-radius:7px}#slide-position{font-size:.875rem}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}@keyframes spin{to{transform:rotate(360deg)}}
@media(max-width:1000px){.topbar{padding:20px 27px}.composer{padding:25px}.format-note{display:none}.gallery-card{flex-basis:29%}.preset-description{min-height:54px}.text-meta{gap:12px}.header-tools{gap:12px}}
@media(max-width:650px){.topbar{padding:17px 18px;gap:13px;flex-wrap:wrap}.header-tools{gap:10px;flex-wrap:wrap;margin-left:auto}.badge{display:none}.wordmark{font-size:22px}.wordmark i{display:none}select{font-size:.75rem;padding:7px 8px;max-width:122px}.quiet-button{font-size:.75rem}main{padding:0 16px}.intro{padding-top:30px}.intro h1{font-size:76px;letter-spacing:-5px}.hero-spark{font-size:29px;right:-28px}.eyebrow{font-size:.75rem;letter-spacing:1px}.intro h2{font-size:22px;line-height:1.35}.intro p{font-size:.875rem;max-width:340px;margin:auto}.gallery{justify-content:flex-start;gap:13px;padding:24px 12px;min-height:245px}.gallery-card{flex-basis:48%;min-width:155px}.gallery-footer{padding:0 6px;flex-wrap:wrap}.preview-hint{display:none}.composer{padding:22px 16px;border-radius:17px}.composer-heading{gap:12px;align-items:flex-start}.composer-heading h2{font-size:23px;line-height:1.3}.composer-heading p{font-size:.875rem;line-height:1.5}.example-button{white-space:normal;max-width:115px;padding:8px 10px;font-size:.75rem}textarea{min-height:164px;padding:15px}.text-meta{flex-direction:column;gap:4px}.customize-heading{align-items:flex-start;flex-direction:column;gap:14px}.mode-tabs{width:100%}.mode-tabs button{flex:1;justify-content:center}.preset-options{gap:8px}.preset-surface{padding:7px 7px 10px}.preset-art{height:65px;padding:9px;margin-bottom:10px}.art-tag{font-size:30px}.preset-title{font-size:.875rem}.preset-description{display:none}.palette-dots{margin-top:11px}.advanced-grid{grid-template-columns:1fr;gap:24px}.decoration-group{grid-column:auto}.decoration-options{grid-template-columns:repeat(2,minmax(0,1fr))}.color-options{justify-content:flex-start;gap:35px}.bottom-controls{flex-direction:column;align-items:stretch;gap:17px}.author-field{max-width:none}.generate{width:100%;min-height:52px}.footer{flex-wrap:wrap;gap:12px;padding:28px 4px}.footer>span:nth-child(2){max-width:215px;line-height:1.6;text-align:right}.footer>span:last-child{display:none}.section-number{letter-spacing:.5px}}
.speaking-selector{margin-top:22px;padding:20px 0;border-bottom:1px solid var(--line)}.speaking-selector legend{font-size:.875rem;color:#d4dcef;padding:0}.speaking-selector .panel-hint{margin:0 0 13px}.speaking-options{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:10px}.speaking-card{position:relative;cursor:pointer;min-width:0}.speaking-card input{position:absolute;width:1px;height:1px;opacity:0}.speaking-surface{height:100%;display:grid;grid-template-columns:24px 1fr;gap:7px 10px;border:1px solid #343b50;border-radius:11px;background:#171c29;padding:14px;transition:border-color .18s,background .18s,box-shadow .18s}.speaking-icon{grid-row:1/3;color:var(--purple);font-size:22px}.speaking-surface strong{font-size:.875rem;font-weight:550;color:#dce4f4}.speaking-surface small{font-size:.75rem;line-height:1.5;color:#9ba7c1}.speaking-card input:checked+.speaking-surface{border-color:#a7d764;background:#202b20;box-shadow:0 0 16px #bafa6809}.speaking-card input:checked+.speaking-surface .speaking-icon{color:var(--green)}.speaking-card input:focus-visible+.speaking-surface{outline:2px solid var(--green);outline-offset:3px}.speaking-notice{font-size:.75rem;line-height:1.6;color:#c1ace4;margin:12px 0 0}.speaking-notice:empty{display:none}@media(max-width:650px){.speaking-options{grid-template-columns:repeat(2,minmax(0,1fr))}.speaking-surface{padding:11px;grid-template-columns:1fr}.speaking-icon{grid-row:auto}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}}

.layout-mini{display:block;position:relative;width:54px;height:65px;border:1px solid #777;border-radius:5px;margin-bottom:8px}
.layout-mini b,.layout-mini i{position:absolute;background:var(--accent,#c5ff60);height:16px;width:36px;left:8px;top:10px;border-radius:2px}
.layout-mini i{top:34px;height:20px;opacity:.4}
.layout-mini.centered b{width:28px;left:12px;top:15px}.layout-mini.centered i{width:28px;left:12px;top:38px}


.layout-mini.poster b{top:38px;height:19px}.layout-mini.poster i{top:8px;left:22px;width:22px}

.layout-mini.steps i{width:25px;left:22px}.layout-mini.steps b{width:38px;left:5px}

/* Перегляд залишається поруч із редактором; верхня галерея зберігається. */
.editor-workspace{display:grid;grid-template-columns:minmax(0,1fr) 230px;gap:26px;align-items:start}
.editor-workspace>form{grid-column:1;grid-row:1;min-width:0}
.live-preview{grid-column:2;grid-row:1;position:sticky;top:16px;align-self:start;background:#111722;border:1px solid var(--line);border-radius:14px;padding:12px;z-index:3}
.live-toolbar,.live-navigation{display:flex;align-items:center;justify-content:space-between;gap:8px}
.live-toolbar{margin-bottom:10px}.live-toolbar strong{font-size:.8rem}.live-toolbar button{font-size:.7rem}
.live-image-button{display:block;width:100%;padding:0;border:0;border-radius:8px;overflow:hidden;background:transparent}
#live-image{display:block;width:100%;height:auto;max-height:52vh;object-fit:contain;line-height:1.2}
.live-navigation{margin-top:10px;font-size:.8rem}#live-status{font-size:.75rem;line-height:1.3;color:var(--muted);margin:8px 0 0}#live-status:empty{display:none}
.preset-title,.preset-description,.speaking-surface strong,.speaking-surface small{line-height:1.2}
.diagonal-pattern{background:repeating-linear-gradient(45deg,#252d43 0 6px,#7b89ae55 7px 8px)}
.waves-pattern{background:repeating-radial-gradient(ellipse at top,#252d43 0 5px,#7b89ae55 6px 7px,#252d43 8px 12px)}
.crosses-pattern{background-color:#252d43;background-image:linear-gradient(90deg,transparent 40%,#7b89ae55 40% 60%,transparent 60%),linear-gradient(transparent 40%,#7b89ae55 40% 60%,transparent 60%);background-size:10px 10px}
.grain-pattern{background-color:#252d43;background-image:radial-gradient(#b4c0db88 .6px,transparent .8px),radial-gradient(#b4c0db55 .6px,transparent .8px);background-size:3px 5px,7px 3px;background-position:0 0,2px 1px}
@media(min-width:901px){.editor-workspace .advanced-grid{grid-template-columns:1fr}.editor-workspace .decoration-options{grid-template-columns:repeat(2,minmax(0,1fr))}.editor-workspace .bottom-controls{flex-wrap:wrap}.editor-workspace .generate{white-space:normal}}
@media(max-width:900px){.editor-workspace{display:flex;flex-direction:column;gap:18px}.editor-workspace>form{width:100%}.live-preview{width:100%;top:8px;padding:8px 12px;box-shadow:0 8px 22px #0007}.live-toolbar{margin-bottom:5px}#live-body{display:grid;grid-template-columns:84px 1fr;gap:8px 16px;align-items:center}.live-image-button{grid-row:1/3}#live-image{max-height:105px}.live-navigation{justify-content:center;margin:0}#live-status{margin:0}.live-preview:has(#live-body[hidden]) .live-toolbar{margin-bottom:0}}

.layout-mini.minimal b{left:8px;top:23px;width:36px;height:12px}.layout-mini.minimal i{left:8px;top:41px;width:30px;height:10px}
.preset-title,.speaking-surface strong{line-height:1.1}.preset-description,.speaking-surface small{line-height:1.3}
.header-tools{gap:12px;flex-wrap:wrap;justify-content:flex-end}
.account-button,.upload-button{display:inline-flex;align-items:center;justify-content:center;min-height:40px;padding:10px 15px;border:1px solid var(--line);border-radius:10px;background:var(--panel);color:var(--text);font-size:.8125rem;font-weight:600;transition:background .15s,border-color .15s}
.account-button:hover,.upload-button:hover{background:#222839;border-color:#596344;color:var(--green)}
#google-login{order:2;background:var(--green);border-color:var(--green);color:var(--page)}
.admin-tools{display:flex;align-items:center;gap:10px}
.profile{position:relative;order:3}
.profile summary{display:flex;align-items:center;gap:7px;padding:3px;border-radius:24px;cursor:pointer;list-style:none}
.profile summary::-webkit-details-marker{display:none}
.profile summary:focus-visible,.upload-button:focus-within{outline:2px solid var(--green);outline-offset:4px}
.avatar{display:grid;place-items:center;width:36px;height:36px;border:1px solid #64517d;border-radius:50%;background:#30243f;color:#dfccff;font-weight:700}
.profile-chevron{color:var(--muted);font-size:14px}
.profile-menu{position:absolute;right:0;top:calc(100% + 12px);z-index:20;display:grid;gap:8px;width:min(280px,calc(100vw - 32px));padding:18px;border:1px solid var(--line);border-radius:14px;background:var(--surface);box-shadow:0 16px 40px #0007}
.profile-menu strong,.profile-menu>span{overflow-wrap:anywhere}
.profile-menu>span{color:var(--muted);font-size:.8125rem}
.profile-menu button{margin-top:8px;width:100%}
.footer{flex-wrap:wrap;gap:16px}
.footer .language-picker{margin-left:auto}
.footer select{background:transparent;color:var(--muted);font-size:.75rem}
.background-upload{margin:20px 0;padding:18px;border:1px solid var(--line);border-radius:14px;background:var(--surface)}
.background-upload strong{font-size:.875rem;font-weight:600}
.background-upload p{margin:6px 0 14px;color:var(--muted);font-size:.75rem}
.upload-actions{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.upload-button{position:relative;overflow:hidden;cursor:pointer}
.upload-button input{position:absolute;inset:0;width:100%;height:100%;opacity:0;cursor:pointer}
.photo-name{flex:1;min-width:100px;overflow-wrap:anywhere;color:var(--muted);font-size:.75rem}
.account-status{color:#ffb5bd;font-size:.8125rem;line-height:1.5}
.account-status:empty{display:none}
@media(max-width:600px){.topbar{padding:16px;gap:10px}.header-tools{gap:8px}.account-button{padding:9px 11px}.admin-tools{flex-wrap:wrap;justify-content:flex-end}.footer .language-picker{margin-left:0}.upload-actions{align-items:stretch}.photo-name{flex-basis:100%;order:3}}
.generation-action{display:flex;flex-direction:column;align-items:stretch;gap:10px;flex:1;min-width:220px}


.bottom-controls{align-items:flex-end;flex-wrap:wrap}
.bottom-controls .author-field{flex:0 1 180px;min-width:120px}
.author-field input{width:100%;min-width:0}
.auth-status{max-width:1180px;margin:12px auto;padding:0 36px;color:#ffb5bd;font-size:.8125rem}


@media(max-width:600px){.generation-action{flex-basis:100%;min-width:0}.bottom-controls .author-field{flex:1}.auth-status{padding:0 16px}}
.purchase-dialog{width:min(1000px,calc(100vw - 32px));max-height:85vh;padding:28px;border:1px solid var(--line);border-radius:20px;background:var(--surface);color:var(--text);box-shadow:0 28px 100px #0008;overflow:auto}
.purchase-dialog::backdrop{background:#050710bf;backdrop-filter:blur(6px)}
.purchase-dialog.auth-dialog{width:min(440px,calc(100vw - 32px))}
.modal-heading{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:14px}
.modal-heading h2{margin:0;font-size:1.4rem;letter-spacing:-.03em}
.auth-dialog>p,.pricing-note{color:var(--muted);font-size:.875rem;line-height:1.6}
#modal-google-login{width:100%;margin:16px 0;background:var(--green);color:var(--page);border-color:var(--green)}
.pricing-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(155px,1fr));gap:12px;margin:22px 0}
.pricing-card{display:flex;flex-direction:column;gap:16px;min-width:0;padding:20px 16px;border:1px solid var(--line);border-radius:14px;background:linear-gradient(145deg,var(--panel),var(--surface));transition:border-color .15s}
.pricing-card:hover{border-color:var(--green)}
.pricing-card h3{margin:0;font-size:.875rem;line-height:1.5;font-weight:600;overflow-wrap:anywhere}
.package-price{margin:0;color:var(--green);font-size:1.75rem;font-weight:700;letter-spacing:-.04em}
.pricing-card button{margin-top:auto}
#toggle-packages{color:var(--muted);background:transparent}
@media(max-width:480px){.purchase-dialog{padding:20px}.pricing-grid{grid-template-columns:1fr 1fr}.pricing-card{padding:14px 10px}.pricing-card button{padding:10px 6px}}
/* Мініатюра й підпис займають окремі рядки без накладання. */
#layout-options .speaking-surface {
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:flex-start;
  gap:12px;
  text-align:center;
}
#layout-options .layout-mini { flex:0 0 65px; margin:0; }
#layout-options .speaking-surface>strong { width:100%; min-width:0; line-height:1.4; overflow-wrap:anywhere; }

/* Основний акцент тарифу — кількість генерацій. */
.purchase-dialog { text-align:center; }
.purchase-dialog .modal-heading { position:relative; justify-content:center; padding:0 40px; min-height:40px; }
.purchase-dialog .modal-heading .icon-button { position:absolute; right:0; top:0; }
.pricing-card h3 { display:flex; flex-direction:column; align-items:center; gap:8px; }
.package-amount { font-size:2rem; line-height:1.15; font-weight:800; color:var(--text); font-variant-numeric:tabular-nums; }
.package-unit { font-size:.8125rem; line-height:1.4; font-weight:500; color:var(--muted); }
.pricing-card .package-price { font-size:1rem; line-height:1.5; font-weight:500; letter-spacing:0; color:var(--muted); }
#large-packages { grid-template-columns:repeat(auto-fit,minmax(min(100%,220px),1fr)); }

/* Прибираємо розтягування палітри на всю ширину контейнера. */
.color-options { justify-content:flex-start; gap:14px; }
.color-options label { flex:0 0 60px; }

@media(max-width:650px) {
  /* Однакова геометрія для всіх трьох шрифтових зразків. */
  .font-options { align-items:stretch; }
  .font-options label { display:flex; }
  .font-options label>span { width:100%; height:100%; padding:12px 6px; gap:9px; align-items:center; justify-content:flex-start; }
  .font-options b { display:flex; align-items:center; justify-content:center; width:100%; height:32px; flex:0 0 32px; margin:0; padding:0; font-size:26px; line-height:1; text-align:center; }
  .font-options small { display:flex; align-items:center; justify-content:center; width:100%; min-height:2.8em; line-height:1.4; text-align:center; }
}
/* Послідовні секції займають повну ширину сітки налаштувань. */
.advanced-grid>.background-upload,
.advanced-grid>.decoration-group,
.advanced-grid>.export-quantity-group { grid-column:1 / -1; }
.advanced-grid>.background-upload { margin:0; }
.export-quantity-group { display:flex; align-items:center; gap:12px; flex-wrap:wrap; }
.export-quantity-group label { font-size:.875rem; color:var(--muted); }

@media(max-width:650px) {
  /* Спільна висота визначається найдовшим підписом без обрізання тексту. */
  .preset-options { align-items:stretch; grid-auto-rows:1fr; }
  .preset { display:flex; }
  .preset-surface { width:100%; height:100%; padding:7px 7px 10px; }
  .preset-art { flex:0 0 65px; }
  .preset-title { line-height:1.3; min-height:2.6em; overflow-wrap:anywhere; }
  .preset-surface .palette-dots { margin-top:auto; padding-top:11px; }

  /* Скидаємо десктопні flex-розміри, які розтягують мобільну колонку. */
  .bottom-controls {
    display:flex;
    flex-direction:column;
    flex-wrap:nowrap;
    justify-content:center;
    align-items:center;
    width:100%;
    margin-inline:auto;
    text-align:center;
  }
  .bottom-controls .author-field,
  .bottom-controls .generation-action {
    flex:0 0 auto;
    width:100%;
    max-width:360px;
    min-width:0;
    margin-inline:auto;
  }
  .bottom-controls .author-field label { justify-content:center; flex-wrap:wrap; }
  .bottom-controls .author-field input { text-align:center; }
}
/* Платний баланс залишається візуально узгодженим із кнопкою покупки. */


#paid-balance { color:var(--green); font-weight:600; }
/* Однакове оформлення активного Basic і лічильника. */
.mode-tabs button { padding:12px 20px; font-size:1rem; font-weight:700; }
.mode-tabs button[aria-selected="true"],
.clean-counter.mode-label { background:#202b20; color:var(--green); border:1px solid #536b37; border-radius:9px; }
.clean-counter.mode-label { display:inline-flex; justify-content:center; align-items:center; align-self:flex-end; padding:8px 14px; font-size:1rem; font-weight:700; line-height:1.25; font-variant-numeric:tabular-nums; animation:none; box-shadow:none; }
/* Приховуємо початковий текст лише до застосування перекладів. */
html.locale-pending body { visibility:hidden; }
@media(max-width:650px){.mode-tabs button{padding:12px 16px}.bottom-controls .clean-counter{align-self:center}}
/* SVG успадковує колір тексту й не зміщує рядок балансу. */
.profile-balances{display:flex;flex-wrap:wrap;align-items:center;gap:8px 14px}
.coin-balance{display:inline-flex;align-items:center;gap:6px;color:var(--green);font-weight:600}
.coin-icon{width:18px;height:18px;flex:0 0 18px;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
/* Ціна помітна, але кількість коінів залишається головним елементом. */
.pricing-card .package-price{align-self:center;padding:6px 12px;border:1px solid #536b37;border-radius:999px;background:#bafa6810;color:var(--green);font-size:1.125rem;font-weight:750;line-height:1.3}
.plan-comparison{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin:20px 0;padding:18px;border:1px solid #3b354e;border-radius:14px;background:#a58aff0b}
.plan-comparison strong{color:var(--text);font-size:.9375rem}
.plan-comparison p{margin:8px 0 0;color:var(--muted);font-size:.8125rem;line-height:1.6}
@media(max-width:600px){.plan-comparison{grid-template-columns:1fr}.plan-comparison>div+div{border-top:1px solid var(--line);padding-top:16px}}
/* Шрифтові зразки відповідають родинам, доступним у PNG. */
.font-montserrat{font-family:'Montserrat',sans-serif}.font-roboto{font-family:'Roboto',sans-serif}.font-opensans{font-family:'Open Sans',sans-serif}.font-notosans{font-family:'Noto Sans',sans-serif}.font-nunito{font-family:'Nunito',sans-serif}.font-raleway{font-family:'Raleway',sans-serif}.font-ubuntu{font-family:'Ubuntu',sans-serif}.font-playfairdisplay{font-family:'Playfair Display',serif}.font-merriweather{font-family:'Merriweather',serif}
.font-options label>span{height:100%}.font-options small{overflow-wrap:anywhere}
.preset-surface{height:100%}
.noir .preset-art{background:#15141b;color:#c5a46d;font-family:'Playfair Display',serif;border:1px solid #c5a46d55}
.citrus .preset-art{background:radial-gradient(circle at 80% 25%,#7553dc 0 23%,transparent 24%),#ecff70;color:#202338;font-family:'Montserrat',sans-serif}
.paper .preset-art{background:#f7f5ef;color:#26312f;font-family:'Noto Sans',sans-serif;border-bottom:4px solid #558576}
.noir .palette-dots i{background:#15141b}.noir .palette-dots i:nth-child(2){background:#f7f0df}.noir .palette-dots i:nth-child(3){background:#c5a46d}
.citrus .palette-dots i{background:#ecff70}.citrus .palette-dots i:nth-child(2){background:#202338}.citrus .palette-dots i:nth-child(3){background:#7553dc}
.paper .palette-dots i{background:#f7f5ef}.paper .palette-dots i:nth-child(2){background:#26312f}.paper .palette-dots i:nth-child(3){background:#558576}
/* Зберігаємо місце галереї, доки не отримано зображення потрібною мовою. */
/* Каркас зберігає висоту без порожнього миготіння під час завантаження. */
.gallery-pending:empty::before {
 content:""; display:block; width:min(100%,740px); height:240px; border-radius:12px;
 background:linear-gradient(110deg,var(--surface),var(--panel),var(--surface));
}
/* Єдина геометрія зразків для початкових і доданих шрифтів. */
.font-options label>span { display:flex; flex-direction:column; align-items:center; height:100%; padding:12px 6px; gap:9px; }
.font-options b { display:flex; align-items:center; justify-content:center; width:100%; height:32px; flex:0 0 32px; margin:0; padding:0; font-size:26px; line-height:1; }
.font-options small { display:flex; align-items:center; justify-content:center; min-height:2.8em; text-align:center; line-height:1.4; }
/* Кількість PNG — окрема секція поза сіткою пресетів. */
.quantity-section{display:flex;width:100%;grid-column:1/-1;justify-content:space-between;align-items:center;gap:16px;margin-top:24px;padding:18px 20px;border:1px solid var(--line);border-radius:14px;background:var(--surface)}
.quantity-section label{font-weight:600;color:var(--text)}
.quantity-section select{min-width:90px;margin:0}
.layout-mini.glass{background:#ffffff18;border-color:#ffffff88;border-radius:9px;box-shadow:inset 0 0 12px #ffffff10}
.layout-mini.brutalism{border:3px solid var(--text);border-radius:0;box-shadow:4px 4px 0 var(--green)}
.layout-mini.neon{border-color:var(--green);box-shadow:0 0 8px #bafa6870}

.decorative-lines-toggle{display:flex;align-items:center;gap:10px;grid-column:1/-1;color:var(--text);font-size:.875rem}
/* Чіткий стан перемикача без використання прихованого checkbox. */
.decorative-lines-toggle{display:block}
.decorative-lines-toggle legend{margin-bottom:12px;color:var(--text)}
.decorative-lines-toggle .mode-tabs{display:inline-flex;width:auto}
.decorative-lines-toggle button[aria-pressed="true"]{background:#202b20;color:var(--green);box-shadow:inset 0 0 0 1px #536b37}

/* Фіксована геометрія круглих кнопок, зокрема в Safari. */
.icon-button {width:32px!important;height:32px!important;min-width:32px;min-height:32px;padding:0!important;flex:0 0 32px;display:inline-flex;align-items:center;justify-content:center;border-radius:50%;aspect-ratio:1/1;line-height:1;}
.clean-counter {gap:8px;flex-wrap:wrap;}
.clean-counter svg {width:20px;height:20px;flex:0 0 20px;}
.counter-buy {border:0;border-radius:6px;padding:4px 10px;background:var(--green);color:var(--page);font-weight:700;}
#advanced-presets {margin-bottom:24px;}
@media(max-width:1024px){.editor-workspace,.mode-panel{min-width:0}.live-preview{width:100%;}}
@media(max-width:768px){
 /* Видно дві картки; решта доступні горизонтальним прокручуванням. */
 .preset-options,#layout-options {display:grid;grid-template-columns:none;grid-auto-flow:column;grid-auto-columns:calc((100% - 10px) / 2);gap:10px;padding:4px 0 12px;max-width:100%;overflow-x:auto;scroll-snap-type:x mandatory;overscroll-behavior-x:contain;scrollbar-width:thin;scrollbar-color:#55506f transparent;}
 .preset-options>.preset,#layout-options>.speaking-card {min-width:0;max-width:100%;scroll-snap-align:start;}
 /* Компактні відступи та перенесення довгих підписів без переповнення. */
 .preset-options .preset-surface {width:100%;}
 .preset-surface,.speaking-surface {padding:10px;min-width:0;}
 .speaking-surface {grid-template-columns:minmax(0,1fr);}
 .speaking-icon {grid-row:auto;}
 .preset-title,.speaking-surface strong {font-size:.8125rem;overflow-wrap:anywhere;}
 .preset-description,.speaking-surface small {font-size:.75rem;overflow-wrap:anywhere;}
 .preset-art {height:65px;padding:9px;margin-bottom:10px;}
 .art-tag {font-size:30px;}
}

/* Обмежуємо розміри сітки, щоб стрічки прокручувалися всередині сторінки. */
.editor-workspace > *, #controls, .speaking-selector {min-width:0;max-width:100%;}
/* Достатня площа натискання допомагає керувати переглядом на телефоні. */
.icon-button {min-width:44px;min-height:44px;box-sizing:border-box;-webkit-appearance:none;}

/* Довгі переклади не розтягують сітку та не перекривають сусідні дії. */
.gallery-footer, .quantity-section, .text-meta { flex-wrap:wrap; }
.quantity-section label, .clean-counter, .modal-heading h2 { min-width:0; overflow-wrap:anywhere; }
.profile summary, button, .download { touch-action:manipulation; }
button:not(:disabled):active, .download:not([aria-disabled="true"]):active { filter:brightness(.92); }
.live-image-button { min-height:105px; background:var(--surface); }
#live-image { transition:opacity .18s ease; }
@media(max-width:480px) {
 .topbar { gap:12px; flex-wrap:wrap; }
 .header-tools { flex:1 1 auto; min-width:0; }
 .quantity-section { padding:14px; gap:10px; }
 .clean-counter.mode-label { max-width:100%; text-align:center; }
}
/* Системне побажання поширюємо також на нові ефекти станів. */
@media(prefers-reduced-motion:reduce) {
 *, *::before, *::after { animation:none!important; transition:none!important; scroll-behavior:auto!important; }
}

/* Спільні правила зберігають однакову геометрію карток Basic і Advanced. */
/* Місце панелі зберігається навіть після її закріплення над сторінкою. */
.live-preview-slot {grid-column:2;grid-row:1;min-width:0;align-self:start;}
.live-preview {position:static;}
.live-preview.is-docked {position:fixed;top:0;left:var(--live-left);width:var(--live-width);z-index:30;max-height:85dvh;overflow-y:auto;box-shadow:0 8px 22px #0007;}
.live-toolbar {gap:12px;}
.live-toolbar strong {min-width:0;overflow-wrap:anywhere;}
.live-toolbar button {flex-shrink:0;}
@media(max-width:900px){.live-preview-slot{width:100%;}}

.preset-options { align-items:stretch; }
/* Налаштування Basic повторюють доступні зразки Advanced. */
.basic-design-options {display:grid;gap:24px;margin-top:24px;min-width:0;}
.basic-design-options .decoration-options {grid-template-columns:repeat(2,minmax(0,1fr));}
.preset-surface { width:100%; height:100%; }
.preset-art { flex-shrink:0; }
.preset-title { line-height:1.4; overflow-wrap:anywhere; }
.preset-description { display:block; line-height:1.5; overflow-wrap:anywhere; }
.preset-surface .palette-dots { margin-top:auto; padding-top:12px; }
@media(hover:hover) {
 .preset input:not(:disabled):not(:checked) + .preset-surface:hover {
  border-color:#697654; background:#1e2430;
 }
}
/* Підзаголовок залишається видимим і в мобільній стрічці обох режимів. */
@media(max-width:650px) {
 .preset-description { display:block; min-height:3em; }
}

/* Однакова компактна геометрія всіх пакетів, включно з акційним. */
#standard-packages {grid-template-columns:repeat(3,minmax(0,1fr));grid-auto-rows:1fr;gap:12px;}
.pricing-card {position:relative;gap:12px;padding:26px 12px 14px;}
.pricing-card h3 {gap:4px;}
.pricing-card .package-price {display:flex;justify-content:center;align-items:baseline;gap:6px;flex-wrap:nowrap;margin:0;padding:6px 0;width:100%;border:0;border-radius:0;background:none;white-space:nowrap;font-size:1.125rem;}
.pricing-card .account-button {width:100%;padding:10px 6px;line-height:1.3;}
/* Позначка не займає окремий рядок і не збільшує висоту картки. */
.pricing-card-featured {border-color:var(--green);background:linear-gradient(145deg,#202a20,var(--surface));box-shadow:none;}
.package-badge {position:absolute;top:-9px;right:10px;padding:3px 8px;border-radius:999px;background:var(--green);color:#142008;font-size:.6875rem;font-weight:700;line-height:1.2;}
.package-original-price {font-size:.75rem;font-weight:400;color:var(--muted);}
.pricing-card-featured .account-button {border-color:#536b37;color:var(--green);}
@media(max-width:480px){
 #standard-packages {grid-template-columns:repeat(2,minmax(0,1fr));gap:12px 10px;}
 .pricing-card {padding:22px 8px 12px;gap:10px;}
 .pricing-card .package-price {font-size:1rem;gap:5px;}
}
