[hidden]{display:none!important}.connection-pill{display:flex;align-items:center;gap:8px;border:1px solid #cbd3bf;padding:9px 13px;border-radius:20px;color:#6d7d5f;font-size:11px;background:#fafcf3}.connection-pill>span:first-child{height:6px;width:6px;background:#b8b8a5;border-radius:50%}.connection-pill.connected>span:first-child{background:#789365;box-shadow:0 0 0 3px #78936518}.model-label{font-size:10px;letter-spacing:.3px;color:#7f8b72}.preview-stack{position:relative;height:510px;background:#faf7ed;overflow:hidden}.scene-frame{position:absolute;inset:0;width:100%;height:100%;border:0;background:#faf7ed}.scene-frame.staging{visibility:hidden;pointer-events:none}.scene-loading{position:absolute;inset:0;display:grid;place-items:center;font:25px var(--hand);color:#8b987a}.ai-story{padding:28px 30px 19px;border-top:1px solid #dce0d0;background:#fffef8}.ai-story h2{font-size:32px;margin:7px 0 8px}.ai-story>p{font-size:12px;line-height:1.7;color:#858b79;max-width:800px;margin:0}.ai-choices{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-top:23px}.ai-choice{background:#f5f7ee;border:1px solid #ccd5be;border-radius:6px 8px 5px 8px;color:#56694b;padding:17px;text-align:left;font-size:12px;line-height:1.5;display:flex;gap:11px;align-items:center;transition:background .2s,transform .2s}.ai-choice .choice-number{font:22px var(--hand);color:#91a37c}.ai-choice>span:last-child{font-size:17px;margin-left:auto;color:#899e77}.ai-choice:hover{background:#e9efde;transform:translateY(-2px)}.ai-choice:disabled{opacity:.55;transform:none}.choice-note{font-size:10px!important;margin-top:11px!important;color:#9a9f8c!important}.custom-story{padding:17px 30px 25px;background:#fffef8}.custom-story label{display:block;font:19px var(--hand);color:#7a8869;margin-bottom:9px}.prompt-row{display:flex;gap:10px;align-items:stretch}.prompt-row textarea{flex:1;min-width:0;resize:vertical;max-height:180px;border:1px solid #dce1d1;background:#fbfcf6;border-radius:6px;padding:12px 14px;font:12px/1.5 var(--sans);color:#4e6044}.prompt-row textarea::placeholder{color:#a2a794}.prompt-row .primary-button{min-width:170px;font-size:11px;gap:20px}.prompt-row .primary-button:disabled{opacity:.55;transform:none}.generation-status{display:flex;align-items:center;justify-content:space-between;gap:15px;border-top:1px solid #e2e5d9;border-bottom:1px solid #e2e5d9;background:#f0f3e7;padding:13px 24px;font-size:12px;line-height:1.5;color:#657952}.generation-status.error{background:#fbede5;color:#a36b56;border-color:#e6d3c6}.generation-status.busy #status-text:before{content:'✧';display:inline-block;margin-right:10px;animation:turn 3s linear infinite}#cancel-generate{font-size:11px;text-decoration:underline;padding:5px}.studio-toolbar{display:flex;justify-content:space-between;gap:12px;padding:14px 23px;border-top:1px dashed #dce2d0;background:#f8faf1}.history-buttons,.utility-buttons{display:flex;align-items:center;gap:14px}.studio-toolbar button{display:flex;align-items:center;gap:6px;font-size:16px;color:#748467;padding:5px 1px}.studio-toolbar button span{font:10px var(--sans)}.studio-toolbar button:disabled{opacity:.35}.save-status{font-size:9px;color:#97a288}.save-status.failure{color:#b1745a}.toolbar-separator{width:1px;height:15px;background:#dce2d0}.code-panel{border-top:1px solid #d9e0ce;background:#f0f3e8}.editor-top{display:flex;align-items:center;justify-content:space-between;padding:0 20px;border-bottom:1px solid #d9e0ce}.editor-tabs{display:flex;gap:20px}.editor-tabs button{padding:16px 1px 13px;font-size:11px;border-bottom:2px solid transparent}.editor-tabs button[aria-selected=true]{border-color:#788e64;color:#576b48}.editor-tabs button:not([aria-selected=true]){color:#929b87}#code-count{font-size:9px;color:#9aa48d}#code-editor{width:100%;height:340px;resize:vertical;display:block;padding:22px;border:0;background:#f9fbf4;font:12px/1.65 ui-monospace,SFMono-Regular,Menlo,monospace;color:#4e6043;tab-size:2;white-space:pre;overflow:auto}.editor-bottom{display:flex;justify-content:space-between;align-items:center;gap:15px;padding:14px 20px}.editor-bottom>div{display:flex;gap:15px;align-items:center}.editor-bottom button{font-size:11px}#draft-label{font-size:10px;color:#8c987c}.editor-bottom .primary-button{padding:11px 16px}.history-panel{background:#fafbf5;border-top:1px solid #dce2d0;padding:23px}.history-heading{display:flex;align-items:center;justify-content:space-between;gap:15px}.history-heading h3{font:23px var(--hand);margin:0}.history-heading>div{display:flex;gap:12px;font-size:10px;color:#7f8f6d}.import-label{cursor:pointer;padding:5px 0}.history-panel ol{display:flex;flex-direction:column;gap:5px;list-style:none;margin:17px 0;padding:0;max-height:300px;overflow:auto}.history-entry{width:100%;text-align:left;padding:11px 13px;border:1px solid transparent;border-radius:5px;display:flex;gap:13px;align-items:center;color:#89927d;font-size:11px}.history-entry.current{background:#edf3e3;border-color:#cbd8bc;color:#597447}.history-entry.future{opacity:.55}.history-entry>span:first-child{font:18px var(--hand);color:#9bac8a}.history-entry .entry-info{display:flex;flex-direction:column;gap:3px}.history-entry small{font-size:9px;font-weight:normal;color:#99a58b}.history-panel>p{font-size:10px;line-height:1.6;color:#929c86;margin:14px 0 0}.history-entry:hover{background:#f0f4e7}.connection-dialog{max-width:480px}#connection-form>label:not(.remember-key),.connection-details label{display:block;font-size:11px;color:#77876a;margin:16px 0 6px}#connection-form select,#connection-form input:not([type=checkbox]){width:100%;font:12px var(--sans);color:#526647;background:#fafcf3;border:1px solid #cfd9c2;border-radius:5px;padding:12px}.remember-key{display:flex;gap:8px;align-items:center;font-size:11px;line-height:1.4;color:#78896a;margin:14px 0 7px}.remember-key input{accent-color:#788e64}.key-note{font-size:10px!important;margin:8px 0 16px}.connection-details,.api-explanation{font-size:11px;color:#819174;padding:12px 0;border-top:1px dashed #d6dfc9}.connection-details summary,.api-explanation summary{cursor:pointer}.connection-details p,.api-explanation p{font-size:11px}.connection-buttons{display:flex;gap:15px;align-items:center;justify-content:space-between;margin:18px 0}.connection-buttons>button:first-child{font-size:10px;color:#a07e67}.connection-buttons .primary-button{font-size:11px;padding:13px 15px}.form-error{color:#aa6e59;font-size:11px}.api-explanation a{color:#71845f;font-size:11px}dialog{max-height:90vh;overflow:auto}.scene-origin{color:#8a9879}.intro{padding-top:31px;padding-bottom:31px}.site-header .brand-paw{font:30px var(--hand);line-height:1}.intro h1{font-size:71px}.under-book{gap:30px}.under-book>span{font-size:9px;text-align:right;max-width:390px;line-height:1.5}#help-dialog h2{font-size:30px}@keyframes turn{to{transform:rotate(360deg)}}
@media(min-width:1500px){.preview-stack{height:570px}}
@media(max-width:900px){.preview-stack{height:470px}.ai-choices{grid-template-columns:1fr}.ai-choice{padding:13px 16px}.ai-story{padding:23px 24px 15px}.custom-story{padding:13px 24px 23px}.intro h1{font-size:65px}.studio-toolbar{padding:12px 19px}.utility-buttons,.history-buttons{gap:12px}.save-status{display:none}.toolbar-separator{display:none}}
@media(max-width:550px){.preview-stack{height:470px}.ai-story{padding:22px 17px 14px}.ai-story h2{font-size:28px}.ai-story>p{font-size:11px}.ai-choices{gap:9px;margin-top:18px}.ai-choice{font-size:12px}.custom-story{padding:11px 17px 22px}.prompt-row{flex-direction:column}.prompt-row textarea{min-height:72px}.prompt-row .primary-button{padding:14px}.studio-toolbar{padding:11px 15px;flex-wrap:wrap;gap:5px}.studio-toolbar button span{font-size:9px}.utility-buttons{gap:12px}.history-buttons{gap:12px}.studio-toolbar button{font-size:18px}.utility-buttons button span{display:none}.model-label{font-size:8px}.episode-label{font-size:7px;letter-spacing:.5px}.book-topbar{padding:0 13px}.intro h1{font-size:60px}.intro .eyebrow{font-size:7px;letter-spacing:1.6px}.connection-pill{padding:8px 10px;font-size:9px;gap:6px}.header-actions{gap:10px}.text-button{font-size:0}.intro p{font-size:11px}.editor-tabs{gap:15px}.editor-top{padding:0 14px}#code-count{display:none}#code-editor{padding:16px;font-size:11px;height:320px}.editor-bottom{padding:13px 14px;align-items:flex-start;flex-direction:column}.editor-bottom>div{width:100%;justify-content:space-between}.editor-bottom button{font-size:10px}.history-panel{padding:18px 16px}.history-heading{align-items:flex-start;flex-direction:column;gap:10px}.history-heading h3{font-size:22px}.generation-status{padding:11px 15px;font-size:11px}.site-footer{line-height:1.6;text-align:center;font-size:8px}.connection-buttons{gap:10px}.connection-buttons .primary-button{padding:12px}.under-book p{font-size:15px;text-align:center}.brand{font-size:21px}}
@media(prefers-reduced-motion:reduce){.generation-status.busy #status-text:before{animation:none}}
.file-bar{display:flex;align-items:center;gap:12px;padding:12px 20px;background:#f4f7ed;border-bottom:1px solid #d9e0ce;font-size:10px;color:#82926e}.file-bar select{flex:1;min-width:0;max-width:430px;font:11px ui-monospace,monospace;border:1px solid #ced9bf;border-radius:4px;background:#fbfdf7;color:#566d45;padding:8px}.file-bar button{font-size:10px;white-space:nowrap}.file-bar button:disabled{opacity:.35}.newfile-form{display:flex;gap:10px;padding:12px 20px;border-bottom:1px solid #d9e0ce}.newfile-form input{min-width:0;flex:1;padding:10px;border:1px solid #ced9bf;border-radius:4px;font:12px monospace}.newfile-form .primary-button{padding:9px 20px;font-size:11px}@media(max-width:550px){.file-bar{padding:10px 14px;gap:8px}.file-bar label{display:none}.file-bar select{font-size:10px}.file-bar button{font-size:9px}.newfile-form{padding:10px 14px}}
@media(min-width:551px) and (max-width:900px){.preview-stack{height:510px}}
/* Bramka nie pobiera ilustracji ani czcionek sceny przed sprawdzeniem klucza. */
.is-locked{--hand:Georgia,'Times New Roman',serif;--sans:system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif}.is-locked .intro-note{display:none}.is-locked .intro h1{font-size:64px;font-weight:400;letter-spacing:-3px}.is-locked .site-header .brand{font-size:22px}.connection-gate{position:relative;max-width:740px;margin:8px auto 54px;padding:45px 56px 36px;text-align:center;border:1px solid #d8dfcb;border-radius:12px 16px 10px 18px;background:#fffdf6;box-shadow:0 6px 0 -3px #eeefe3,0 7px 0 -3px #d8dfcb,0 18px 35px #59633e09}.gate-paper-mark{width:68px;height:68px;display:grid;place-items:center;margin:0 auto 21px;border:1px dashed #bac9a6;border-radius:42% 48% 43% 47%;font:46px Georgia,serif;color:#8b9e74;transform:rotate(-7deg);background:#f3f5e9}.gate-eyebrow{display:block;font:9px var(--sans);letter-spacing:2px;color:#8b967c;margin-bottom:14px}.connection-gate h2{font:35px/1.2 Georgia,serif;color:#48573e;margin:0 0 17px;letter-spacing:-1px}.connection-gate>p{font:13px/1.8 var(--sans);max-width:530px;margin:0 auto 21px;color:#7c866e}.connection-gate .primary-button{margin:26px auto 23px;padding:16px 24px;min-width:190px;font:12px var(--sans);gap:20px}.connection-gate .primary-button:disabled{opacity:.7;cursor:wait;transform:none}.connection-gate .gate-status{font-size:11px;color:#7c8d69;min-height:20px;margin-bottom:17px}.connection-gate .gate-status.error{color:#a36550}.connection-gate .gate-status.checking:before{content:'✧';display:inline-block;margin-right:8px;animation:turn 2.5s linear infinite}.connection-gate .gate-note{border-top:1px dashed #dce2d0;padding-top:18px;margin-bottom:0;font-size:10px;line-height:1.7;color:#9aa18d}.connection-pill.verifying>span:first-child{background:#c6ad70}.connection-buttons .primary-button:disabled{opacity:.65;cursor:wait;transform:none}.is-locked .site-footer{margin-top:20px}
@media(max-width:550px){.connection-gate{margin:3px 0 34px;padding:30px 23px 25px}.connection-gate h2{font-size:28px}.connection-gate>p{font-size:12px}.gate-paper-mark{width:58px;height:58px;font-size:39px}.gate-eyebrow{font-size:8px;letter-spacing:1.5px}.is-locked .intro h1{font-size:51px}.is-locked .site-header .brand{font-size:18px}.connection-buttons{align-items:stretch;flex-direction:column-reverse}.connection-buttons .primary-button{width:100%}.connection-buttons>button:first-child{padding:7px}}
@media(prefers-reduced-motion:reduce){.connection-gate .gate-status.checking:before{animation:none}}

/* Duże pola dotyku i przewidywalny układ od telefonu po szeroki ekran. */
.connection-pill,.text-button,.close-dialog,.studio-toolbar button,.editor-tabs button,.file-bar button,.history-heading button,.import-label,.editor-bottom button,.connection-buttons button,.connection-details summary,.api-explanation summary,#cancel-generate{min-height:44px}.close-dialog{min-width:44px;display:grid;place-items:center;right:6px;top:5px}.connection-pill{padding-top:10px;padding-bottom:10px}.text-button{min-width:44px}.studio-toolbar button{min-width:44px;justify-content:center}.editor-tabs button{min-width:44px}.file-bar select{min-height:44px}.file-bar button{padding:8px}.history-heading button,.import-label{display:inline-flex;align-items:center;padding:8px 3px}.history-entry{min-height:54px}.editor-bottom button{padding:10px 5px}.connection-details summary,.api-explanation summary{display:flex;align-items:center}.ai-choice{min-height:64px}.file-bar,.editor-top,.editor-bottom,.history-heading,.studio-toolbar{min-width:0}.entry-info{min-width:0;overflow-wrap:anywhere}.gate-status,.form-error,#status-text{overflow-wrap:anywhere}.is-locked #connection-dialog h2{font-size:30px}.is-locked .connection-pill{font-size:11px}.connection-gate[aria-busy=true]{cursor:progress}
@media(min-width:1500px){.page{max-width:1460px}.connection-gate{max-width:790px;margin-top:20px;padding-top:54px;padding-bottom:42px}.preview-stack{height:610px}.ai-story{padding-left:36px;padding-right:36px}.custom-story{padding-left:36px;padding-right:36px}}
@media(min-width:551px) and (max-width:900px){.page{padding:0 28px}.connection-gate{padding:38px 35px}.ai-choices{grid-template-columns:1fr}.ai-choice{min-height:58px}.history-buttons,.utility-buttons{gap:8px}.studio-toolbar{flex-wrap:wrap}.editor-bottom{align-items:flex-start}.editor-bottom>div{gap:9px}.connection-buttons{gap:12px}.connection-buttons .primary-button{min-height:48px}}
@media(max-width:550px){.page{padding:0 16px}.site-header{height:78px}.header-actions{gap:5px}.brand{gap:5px}.brand-paw{width:22px}.connection-pill{min-height:44px;padding:8px 10px}.is-locked .connection-pill{font-size:10px}.is-locked .brand{letter-spacing:-.6px}.intro{padding-top:26px;padding-bottom:24px}.intro h1{font-size:54px}.title-spark.spark-left{left:-39px;font-size:32px;top:17px}.title-spark.spark-right{right:-30px;font-size:25px}.title-heart{right:-39px;font-size:28px;bottom:0}.connection-gate{padding:28px 20px 25px}.connection-gate .primary-button{width:100%;min-height:50px}.preview-stack{height:470px}.prompt-row textarea{font-size:16px}.prompt-row .primary-button{min-height:48px}.studio-toolbar{padding:8px 12px;gap:3px}.history-buttons{gap:5px;flex:1;justify-content:space-between}.utility-buttons{gap:5px;flex:1;justify-content:flex-end}.toolbar-separator{display:none}.editor-top{padding:0 12px}.editor-tabs{gap:9px;flex:1;justify-content:space-between}.editor-tabs button{font-size:10px}.file-bar{flex-wrap:wrap;gap:4px;padding:8px 12px}.file-bar select{flex-basis:100%;max-width:none;font-size:12px}.file-bar button{flex:1;font-size:11px}.newfile-form{flex-wrap:wrap;padding:10px 12px}.newfile-form input{font-size:16px;min-height:44px;flex-basis:calc(100% - 85px)}.newfile-form .primary-button{min-height:44px;padding:10px 15px}.editor-bottom{padding:11px 12px}.editor-bottom>div{gap:8px}.editor-bottom .primary-button{padding:12px 10px}.history-heading{width:100%}.history-heading>div{width:100%;justify-content:space-between;font-size:11px}.history-entry{padding:11px 8px}.history-panel>p{font-size:11px}.connection-buttons .primary-button{font-size:12px;min-height:48px}.connection-buttons>button:first-child{font-size:11px}.connection-buttons{margin-bottom:10px}#connection-form input:not([type=checkbox]),#connection-form select{font-size:16px;min-height:46px}#connection-form .remember-key{font-size:12px;min-height:44px}.remember-key input{width:19px;height:19px;flex-shrink:0}.connection-details summary,.api-explanation summary{font-size:12px;line-height:1.5}.connection-details p,.api-explanation p{font-size:12px}.key-note{font-size:11px!important}.form-error{font-size:12px}dialog{padding:33px 24px 24px;max-height:calc(100dvh - 32px)}.site-footer{gap:9px;flex-wrap:wrap;justify-content:center}.site-footer span:last-child{font-size:12px}.under-book{flex-direction:column;gap:9px;padding:22px 8px}.under-book>span{text-align:center}}

.is-locked #character-note{display:none}.is-locked .site-footer{justify-content:center}@media(max-width:550px){.is-locked .intro h1{font-size:clamp(32px,10vw,46px);letter-spacing:-1.5px}.is-locked .title-spark.spark-left{left:-31px;font-size:27px}.is-locked .title-spark.spark-right{right:-25px;font-size:23px}.is-locked .title-heart{right:-29px;font-size:23px}}

.model-preparation{padding:10px 24px;background:#f5f6ed;color:#738263;font-size:11px;line-height:1.5;border-top:1px solid #e2e5d9}.model-preparation[data-state=warming]:before{content:"✧";display:inline-block;margin-right:8px;animation:turn 3s linear infinite}.model-preparation[data-state=unavailable]{color:#8c7663}@media(prefers-reduced-motion:reduce){.model-preparation[data-state=warming]:before{animation:none}}
#cancel-generate {
  flex: 0 0 auto;
  min-width: 78px;
  border: 1px solid currentColor;
  border-radius: 6px;
  padding: 8px 12px;
  text-decoration: none;
  background: #fffef8;
}
