.story-studio{max-width:1100px;margin:auto;padding-bottom:32px}.story-studio[hidden]{display:none!important}.story-heading{padding:32px 0 24px}.story-heading>span{color:#bc8752;font-size:13px}.story-heading h1{font-size:clamp(24px,4vw,36px);margin:8px 0}.story-heading p,.story-billing-note{line-height:1.9;opacity:.75}.story-package{display:inline-flex;gap:12px;flex-wrap:wrap;padding:10px 18px;border:1px solid #bb976b44;border-radius:30px}.story-tabs{display:flex;gap:8px;flex-wrap:wrap;margin:16px 0}.story-tabs button{font:inherit;background:transparent;color:inherit;border:1px solid #8884;padding:11px 18px;border-radius:14px;cursor:pointer}.story-tabs button.active{background:#b77b41;color:white;border-color:#b77b41}.story-catalog{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px;margin:24px 0}.story-catalog[hidden]{display:none}.story-card{display:flex;flex-direction:column;text-align:right;padding:0;border:1px solid #8884;border-radius:22px;overflow:hidden;background:var(--surface,#242426);color:inherit;cursor:pointer;font:inherit;transition:transform .15s,border-color .15s}.story-card:hover{transform:translateY(-3px)}.story-card.selected{border:2px solid #c89452}.story-card img{width:100%;aspect-ratio:3/2;object-fit:cover;background:#ede0c7}.story-card>span{padding:18px;display:grid;gap:10px}.story-card strong{font-size:20px}.story-card small{font-size:11px;opacity:.7}.story-card em{font-size:13px;font-style:normal;line-height:1.9;opacity:.8}.story-card b{font-size:13px;color:#d0a16a}.story-form,.story-project{padding:24px;border:1px solid #8883;border-radius:22px;margin:22px 0}.story-form label,.story-project label{display:grid;gap:8px}.story-form textarea,.story-form input,.story-form select,.story-project textarea,.story-project select{box-sizing:border-box;width:100%;font:inherit;background:var(--workspace-field,#141414);color:inherit;border:1px solid #8885;border-radius:12px;padding:12px}.story-form textarea,.story-project textarea{resize:vertical;line-height:2}.story-options{display:grid;grid-template-columns:220px 1fr;align-items:center;gap:24px;margin:18px 0}.story-options p{font-size:13px;line-height:1.9;opacity:.7}.story-personalization{border-block:1px solid #8883;padding:18px 0;margin:18px 0}.story-personalization summary{cursor:pointer;font-weight:700}.story-child{display:grid;grid-template-columns:1fr 1fr 1fr 40px;gap:12px;margin:16px 0;align-items:end}.story-child button{border:0;background:transparent;font:inherit;color:inherit;padding:12px;cursor:pointer}.story-estimate,[data-render-cost],[data-cont-cost]{line-height:2;padding:12px 0;color:#c89559}.story-error,.story-action-error{color:#e58b83;line-height:1.9}.story-output-heading{display:flex;align-items:center;justify-content:space-between;gap:16px}.story-output-heading span{font-size:13px}.story-cast{display:flex;gap:10px;flex-wrap:wrap;margin:20px 0}.story-cast span{border:1px solid #8883;border-radius:25px;padding:8px 15px;font-size:12px}.story-script{display:grid;gap:16px}.story-script label>span{font-size:12px;opacity:.75}.story-final-text{white-space:pre-wrap;line-height:2.2;padding:16px 0}.story-project details{margin:16px 0}.story-project a{color:#c89559}.story-finished{display:grid;grid-template-columns:minmax(180px,40%) 1fr;gap:24px;align-items:center}.story-finished img{width:100%;border-radius:18px}.story-finished audio{width:100%}.story-recent>div{display:grid;gap:10px}.story-recent button{font:inherit;color:inherit;background:transparent;border:1px solid #8883;border-radius:14px;padding:16px;display:flex;justify-content:space-between;text-align:right;cursor:pointer}.story-recent span{font-size:12px;opacity:.7}.story-matches{display:grid;gap:12px}.story-matches label{padding:18px;border:1px solid #8884;border-radius:16px;line-height:1.9}.story-cancel{margin-top:20px}.story-studio button:focus-visible{outline:3px solid #dca970;outline-offset:3px}.story-studio button:disabled{opacity:.5;cursor:wait}html[data-podly-theme=light] .story-card{background:#fff} @media(max-width:700px){.story-catalog{grid-template-columns:1fr}.story-card{display:grid;grid-template-columns:120px 1fr}.story-card img{height:100%;aspect-ratio:auto}.story-card strong{font-size:17px}.story-card>span{padding:14px}.story-options{grid-template-columns:1fr;gap:4px}.story-child{grid-template-columns:1fr 1fr}.story-form,.story-project{padding:16px}.story-finished{grid-template-columns:1fr}.story-output-heading{align-items:start;flex-direction:column}.story-package{font-size:12px}.story-tabs button{flex:1 1 40%;padding:10px}.story-recent button{gap:10px;flex-wrap:wrap}}@media(prefers-reduced-motion:reduce){.story-card{transition:none}.story-card:hover{transform:none}}

#adminStories .story-admin-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}#adminStories label{display:grid;gap:8px;margin-bottom:16px}#adminStories input,#adminStories textarea,#adminStories select{font:inherit;box-sizing:border-box;width:100%;padding:12px;border:1px solid #8885;border-radius:10px;background:transparent;color:inherit}#adminStories .story-admin-list{display:grid;gap:12px;margin:20px 0}#adminStories article{border:1px solid #8884;border-radius:16px;padding:18px;display:grid;gap:10px}#adminStories article button{font:inherit;margin-inline-end:12px;padding:8px 12px;cursor:pointer}#adminStories p{line-height:1.9}#adminStories [role=status]{color:#bd8c4f}@media(max-width:650px){#adminStories .story-admin-grid{grid-template-columns:1fr}}

/* Story fields follow the dashboard charcoal palette, including review and names. */
body.dashboard-page #create #childrenStory {
  --story-field: var(--workspace-field, #141414);
  --story-field-text: #f4f4f4;
  --story-field-border: #464646;
  --story-field-muted: #929292;
  --story-field-focus: #a3a3a3;
  --story-field-ring: #ffffff18;
}
body.dashboard-page #create #childrenStory :is(input:not([type=checkbox]):not([type=radio]),select,textarea) {
  background: var(--story-field) !important;
  border-color: var(--story-field-border) !important;
  color: var(--story-field-text) !important;
  box-shadow: none !important;
  color-scheme: dark;
}
body.dashboard-page #create #childrenStory :is(input,textarea)::placeholder {
  color: var(--story-field-muted);
  opacity: 1;
}
body.dashboard-page #create #childrenStory :is(input,select,textarea):focus {
  border-color: var(--story-field-focus) !important;
  outline: 2px solid var(--story-field-focus) !important;
  outline-offset: 2px;
  box-shadow: 0 0 0 3px var(--story-field-ring) !important;
}
body.dashboard-page #create #childrenStory :is(input[type=checkbox],input[type=radio]) {
  accent-color: var(--story-field-focus);
}
body.dashboard-page #create #childrenStory option {
  background: var(--story-field);
  color: var(--story-field-text);
}
html[data-podly-theme=light] body.dashboard-page #create #childrenStory {
  --story-field: #fff;
  --story-field-text: #24313a;
  --story-field-border: #cbd5dc;
  --story-field-muted: #63717b;
  --story-field-focus: #637b89;
  --story-field-ring: #637b8926;
}
html[data-podly-theme=light] body.dashboard-page #create #childrenStory :is(input,select,textarea) {
  color-scheme: light;
}

/* Layout rules must not reveal inactive prompts or review panels. */
#childrenStory [hidden] { display: none !important; }

/* Keep long Persian text, controls and source URLs inside small dialogs. */
#childrenStory :is(.story-form,.story-project,.story-options>*,.story-child>*,.story-catalog>*){min-width:0}
#childrenStory :is(p,a,strong,.story-final-text){overflow-wrap:anywhere}
#childrenStory .story-matches input[type=radio]{width:auto;justify-self:start}
#childrenStory .story-cancel{display:block}
#childrenStory .story-project audio{max-width:100%}
#childrenStory .story-recent button{width:100%;gap:12px}
#adminStories{--story-admin-field:#171717;color:#f4f4f4;background:#1a1a1a;border-color:#363636}
#adminStories :is(input,textarea,select){background:var(--story-admin-field);border-color:#464646;color:inherit;min-height:44px}
#adminStories :is(input,textarea,select):focus{outline:2px solid #a3a3a3;outline-offset:2px;box-shadow:none}
#adminStories button{font:inherit;min-height:44px;padding:10px 16px;border:1px solid #555;border-radius:10px;background:#303030;color:#f4f4f4;cursor:pointer}
#adminStories button:disabled{opacity:.5;cursor:wait}
#adminStories article{background:#222;border-color:#444;overflow-wrap:anywhere}
#adminStories .story-admin-preview{width:160px;max-width:100%;aspect-ratio:3/2;object-fit:cover;border-radius:12px}
#adminStories .story-voice-test audio{display:block;max-width:100%;margin-top:12px}
#adminStories [hidden]{display:none!important}
#adminStories .story-admin-grid>*{min-width:0}
html[data-podly-theme=light] #adminStories{--story-admin-field:#fff;background:#fff;color:#24313a;border-color:#cbd5dc}
html[data-podly-theme=light] #adminStories article{background:#f4f4f4;border-color:#cbd5dc}

/* Three simple phases; the initial form stays together. */
#childrenStory .story-stepper{margin:8px 0 20px}
#childrenStory .story-stepper ol{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));list-style:none;gap:8px;padding:0;margin:0}
#childrenStory .story-stepper li{display:flex;align-items:center;justify-content:center;gap:8px;min-height:52px;padding:8px;border:1px solid #414141;border-radius:12px;background:#222;color:#aaa;font-size:13px}
#childrenStory .story-stepper li>span{display:grid;place-items:center;flex:none;width:26px;height:26px;border-radius:50%;background:#363636}
#childrenStory .story-stepper li[aria-current=step]{background:#303030;border-color:#aaa;color:#f4f4f4}
#childrenStory .story-stepper li.is-complete{color:#ddd}
#childrenStory .story-review-text{white-space:pre-wrap;line-height:2.2;font-size:16px;margin-block:20px}
#childrenStory .story-edit{padding:14px;border:1px solid #414141;border-radius:12px}
#childrenStory .story-edit summary{cursor:pointer}
#childrenStory .story-new-request{min-height:44px;margin-block:8px}
html[data-podly-theme=light] #childrenStory .story-stepper li{background:#f4f4f4;border-color:#cbd5dc;color:#63717b}
html[data-podly-theme=light] #childrenStory .story-stepper li[aria-current=step]{background:#e7ecef;color:#24313a;border-color:#637b89}
@media(max-width:600px){#childrenStory .story-stepper li{flex-direction:column;gap:6px;font-size:12px;text-align:center}#childrenStory .story-review-text{font-size:15px}}
#childrenStory .story-media-status{font-size:13px;line-height:1.8;color:var(--story-field-muted,#aaa)}
#childrenStory .story-finished button{min-height:44px;margin-block:8px}

#childrenStory .story-card-art{position:relative;aspect-ratio:3/2;background:#292929;display:grid;place-items:center;overflow:hidden}
#childrenStory .story-card-art img{display:block;width:100%;height:100%;object-fit:cover}
#childrenStory .story-card-art small{padding:16px;line-height:1.8;color:#bbb}
@media(max-width:700px){#childrenStory .story-card-art{aspect-ratio:auto;min-height:120px}#childrenStory .story-card-art img{position:absolute;inset:0}}

/* Dashboard charcoal actions; compact secondary controls stay away from submit. */
#childrenStory .primary-btn{background:#e5e5e5!important;color:#191919!important;border:1px solid #e5e5e5!important;box-shadow:none!important;min-height:44px;padding:11px 20px;border-radius:12px;font-weight:700}
#childrenStory .secondary-btn{background:#292929!important;color:#eee!important;border:1px solid #484848!important;box-shadow:none!important;border-radius:12px;padding:10px 16px}
#childrenStory .primary-btn:hover:not(:disabled){background:#fff!important}
#childrenStory .secondary-btn:hover:not(:disabled){background:#363636!important}
#childrenStory button:disabled{opacity:.5;cursor:wait}
#childrenStory .story-icon-button{display:inline-grid!important;place-items:center!important;flex:0 0 34px!important;width:34px!important;height:34px!important;min-height:34px!important;padding:7px!important;border:1px solid #444!important;border-radius:9px!important;background:#242424!important;color:#aaa!important;box-shadow:none!important;font-size:19px!important}
#childrenStory .story-icon-button:hover:not(:disabled){background:#333!important;color:#eee!important}
#childrenStory .story-icon-button svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.7}
#childrenStory .story-cancel{margin-inline-start:16px;align-self:flex-start}
#childrenStory .story-new-request{display:block!important;margin-inline-start:auto;margin-block:0 18px}
#childrenStory [hidden]{display:none!important}
#childrenStory button:focus-visible{outline:2px solid #bbb;outline-offset:3px}
#childrenStory .story-reference{border-block-start:1px solid #363636;margin-block:20px;padding-block-start:18px}
#childrenStory .story-reference>label{font-weight:700}
#childrenStory .story-reference p{color:#aaa;font-size:13px;line-height:1.9}
#childrenStory .story-reference-preview{display:flex;align-items:flex-start;gap:12px;margin-block:12px}
#childrenStory .story-reference-preview img{width:96px;height:96px;object-fit:cover;border-radius:12px}
#childrenStory [data-photo-status]{display:block;margin-block-start:10px;line-height:1.8;color:#bbb}
html[data-podly-theme=light] #childrenStory .primary-btn{background:#292929!important;border-color:#292929!important;color:#fff!important}
html[data-podly-theme=light] #childrenStory .secondary-btn,html[data-podly-theme=light] #childrenStory .story-icon-button{background:#f3f3f3!important;border-color:#ccc!important;color:#333!important}
html[data-podly-theme=light] #childrenStory .story-reference p,html[data-podly-theme=light] #childrenStory [data-photo-status]{color:#555}
#childrenStory .story-tabs button.active{background:#3c3c3c;color:#fff;border-color:#888}
#childrenStory .story-card.selected{border-color:#ccc}
#childrenStory .story-card b{color:#ddd}
html[data-podly-theme=light] #childrenStory .story-tabs button.active{background:#ddd;color:#222;border-color:#999}
html[data-podly-theme=light] #childrenStory .story-card b{color:#444}

/* Reserve a real header row for dismissing the dialog. */
body.dashboard-page #create #childrenStory > .creation-modal-close{position:relative!important;inset:auto!important;margin:0 0 14px auto!important;flex:none;background:#292929;border-color:#505050;color:#ddd}
body.dashboard-page #create #childrenStory > .creation-modal-close:hover{background:#383838;border-color:#888;color:#fff}
#childrenStory .story-heading{padding-top:0}
#childrenStory .story-child{padding:16px;border:1px solid #3c3c3c;border-radius:14px}
#childrenStory .story-child-photo{grid-column:1/-1;border-top:1px solid #363636;padding-top:12px}
#childrenStory .story-character-target{grid-column:1/-1}
#childrenStory .story-child-photo>p{margin:0 0 10px;font-size:13px;color:#bbb}
html[data-podly-theme=light] #childrenStory .story-child{border-color:#ccc}
html[data-podly-theme=light] #childrenStory .story-child-photo>p{color:#555}

/* The finished story is a listening card, with a fully downloaded audio file. */
#childrenStory .story-finished{grid-template-columns:minmax(0,1fr) minmax(0,1.2fr);gap:24px;align-items:stretch;margin-block:24px}
#childrenStory .story-cover{position:relative;min-width:0;min-height:260px;margin:0;overflow:hidden;border-radius:20px;background:#252525;border:1px solid #414141;display:grid;place-items:center}
#childrenStory .story-cover img{width:100%;height:100%;object-fit:contain;aspect-ratio:1/1;border-radius:0}
#childrenStory .story-cover figcaption{position:absolute;bottom:0;inset-inline:0;padding:40px 18px 16px;background:linear-gradient(transparent,#000b);color:#fff;font-size:13px;pointer-events:none}
#childrenStory .story-cover-placeholder{padding:24px;color:#aaa;text-align:center;line-height:2}
#childrenStory .story-listening{display:flex;flex-direction:column;justify-content:center;min-width:0;gap:16px}
#childrenStory .story-player{--player-muted:#aaa;background:#222;border:1px solid #3d3d3d;border-radius:20px;padding:22px;color:#eee}
#childrenStory .story-player-label{display:grid;gap:8px}
#childrenStory .story-player-label>span{display:flex;align-items:center;gap:10px;font-weight:700;font-size:16px}
#childrenStory .story-player svg,#childrenStory .story-downloads svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0}
#childrenStory .story-player-label small{color:var(--player-muted);font-size:12px;line-height:1.9;min-height:24px}
#childrenStory .story-sound-bars{height:58px;display:flex;align-items:center;justify-content:space-between;gap:3px;margin-block:20px 16px;opacity:.45}
#childrenStory .story-sound-bars i{display:block;height:var(--bar);width:4px;border-radius:4px;background:#b5b5b5}
#childrenStory .story-player.is-playing .story-sound-bars{opacity:1}
#childrenStory .story-transfer{height:6px;margin-block:0 16px}
#childrenStory .story-transfer progress{display:block;width:100%;height:4px;accent-color:#ddd;border:0;border-radius:8px;overflow:hidden}
#childrenStory .story-transfer progress::-webkit-progress-bar{background:#444}
#childrenStory .story-transfer progress::-webkit-progress-value{background:#ccc;border-radius:8px}
#childrenStory .story-player-timeline input{appearance:none;display:block;width:100%;height:5px;border:0;border-radius:10px;padding:0;margin:10px 0;background:linear-gradient(to right,#ddd var(--played,0%),#494949 var(--played,0%));cursor:pointer;accent-color:#eee}
#childrenStory .story-player-timeline input::-webkit-slider-thumb{appearance:none;width:13px;height:13px;border-radius:50%;background:#eee}
#childrenStory .story-player-timeline input::-moz-range-thumb{width:13px;height:13px;border:0;border-radius:50%;background:#eee}
#childrenStory .story-player-timeline>div{display:flex;justify-content:space-between;color:var(--player-muted);font-size:12px;font-variant-numeric:tabular-nums}
#childrenStory .story-player-controls{display:flex;direction:ltr;justify-content:center;align-items:center;gap:14px;margin-top:18px;position:relative;padding-right:48px}
#childrenStory .story-player-controls button{position:relative;display:grid;place-items:center;width:38px;height:38px;min-height:38px;padding:0;margin:0;border:1px solid transparent;border-radius:50%;background:transparent;color:inherit;cursor:pointer;font:inherit;box-shadow:none}
#childrenStory .story-player-controls button:hover:not(:disabled){background:#383838}
#childrenStory .story-player-controls button:disabled{cursor:default;opacity:.35}
#childrenStory .story-player-controls .story-play{width:56px;height:56px;min-height:56px;background:#e5e5e5;color:#202020}
#childrenStory .story-player-controls .story-play:hover:not(:disabled){background:#fff}
#childrenStory .story-player-controls .story-play svg{width:26px;height:26px}
#childrenStory .story-player-controls [data-back] svg,#childrenStory .story-player-controls [data-forward] svg{width:31px;height:31px}
#childrenStory .story-player-controls b{position:absolute;inset:0;display:grid;place-items:center;font-size:10px;padding-top:2px}
#childrenStory .story-player-controls [data-speed]{position:absolute;right:0;width:42px;border-radius:9px;border-color:#494949;font-size:12px}
#childrenStory .story-downloads{display:flex;gap:10px;flex-wrap:wrap}
#childrenStory .story-downloads>div{flex:1;min-width:130px}
#childrenStory .story-downloads a{display:flex;justify-content:center;align-items:center;gap:8px;min-height:44px;padding:6px 12px;border:1px solid #444;border-radius:12px;color:#ddd;background:#272727;text-decoration:none;font-size:12px;box-sizing:border-box}
#childrenStory .story-downloads a:hover{background:#343434;border-color:#666}
#childrenStory .story-downloads .story-media-status:empty{display:none}
#childrenStory .story-transcript{border:1px solid #3d3d3d;border-radius:14px;padding:16px 18px}
#childrenStory .story-transcript summary{cursor:pointer;font-size:14px}
html[data-podly-theme=light] #childrenStory .story-player{--player-muted:#666;background:#f4f4f4;border-color:#ccc;color:#222}
html[data-podly-theme=light] #childrenStory .story-player-controls button:hover:not(:disabled){background:#ddd}
html[data-podly-theme=light] #childrenStory .story-player-controls .story-play{background:#333;color:#fff}
html[data-podly-theme=light] #childrenStory .story-player-controls [data-speed],html[data-podly-theme=light] #childrenStory .story-transcript{border-color:#ccc}
html[data-podly-theme=light] #childrenStory .story-downloads a{background:#eee;color:#333;border-color:#ccc}
html[data-podly-theme=light] #childrenStory .story-cover{background:#eee;border-color:#ccc}
@media(max-width:700px){#childrenStory .story-finished{grid-template-columns:1fr;gap:16px}#childrenStory .story-cover{min-height:200px;max-height:360px}#childrenStory .story-cover img{aspect-ratio:4/3}#childrenStory .story-player{padding:18px}}

#childrenStory .story-circle-publish{display:inline-flex;align-items:center;justify-content:center;gap:9px;margin:16px 0 4px;padding:11px 16px}
#childrenStory .story-circle-publish svg{width:21px;height:21px;flex:none}

/* Story creation: charcoal surfaces, clear steps and visible asynchronous work. */
#childrenStory .story-heading{padding-bottom:8px}
#childrenStory .story-heading h1{font-size:clamp(25px,3vw,36px);letter-spacing:-.7px;margin-block:12px}
#childrenStory .story-form{padding:26px;background:linear-gradient(145deg,#202020,#1a1a1a);border-color:#383838}
#childrenStory .story-section-title{display:flex;gap:12px;align-items:center;margin:4px 0 22px}
#childrenStory .story-section-title>span{display:grid;place-items:center;flex:none;width:36px;height:36px;border-radius:12px;border:1px solid #555;background:#303030;color:#eee}
#childrenStory .story-section-title h2{font-size:18px;margin:0 0 5px}
#childrenStory .story-section-title p{font-size:12px;color:#aaa;margin:0}
#childrenStory .story-catalog{margin-bottom:30px}
#childrenStory .story-card{box-shadow:0 6px 18px #0002;transition:transform .18s,border-color .18s,box-shadow .18s}
#childrenStory .story-card.selected{border-color:#cfa46d;box-shadow:0 0 0 2px #cfa46d33,0 10px 25px #0003}
#childrenStory .story-options{padding:18px;background:#191919;border:1px solid #383838;border-radius:16px}
#childrenStory .story-personalization{border:1px solid #3b3b3b;border-radius:16px;padding:18px;background:#1b1b1b}
#childrenStory .story-estimate{display:flex;align-items:center;justify-content:space-between;gap:18px;min-height:82px;margin-top:24px;padding:18px 20px;border:1px solid #4e473d;border-radius:16px;background:linear-gradient(110deg,#29251f,#232323);color:#ece8e0;box-sizing:border-box}
#childrenStory .story-estimate strong{display:block;font-size:28px;line-height:1.5;color:#e5c18e;font-variant-numeric:tabular-nums}
#childrenStory .story-estimate strong span{font-size:13px;font-weight:400}
#childrenStory .story-estimate small,#childrenStory .story-estimate-hint{font-size:12px;color:#bbb}
#childrenStory .story-estimate p{font-size:12px;margin:0;line-height:1.9}
#childrenStory .story-form>.primary-btn{width:100%;min-height:52px;display:flex;align-items:center;justify-content:center;gap:12px;border-radius:14px;background:linear-gradient(#e0e0e0,#bfbfbf)!important;border:1px solid #ddd!important;color:#202020!important;box-shadow:0 6px 18px #0003;font-weight:800}
#childrenStory .story-form>.primary-btn:hover:not(:disabled){background:#f2f2f2!important;transform:translateY(-1px)}
#childrenStory .story-form>.primary-btn:disabled{background:#333!important;border-color:#444!important;color:#999!important;box-shadow:none;cursor:default;opacity:1}
#childrenStory .story-billing-note{font-size:11px;color:#aaa;line-height:1.9}
#childrenStory .story-estimate-retry{font:inherit;font-size:12px;padding:8px 12px;border-radius:10px;border:1px solid #666;background:#343434;color:#eee;cursor:pointer}
#childrenStory .story-spinner{display:inline-block;flex:none;width:18px;height:18px;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;animation:story-spin .8s linear infinite;opacity:.8}
#childrenStory .story-project{background:linear-gradient(145deg,#222,#191919);padding:28px;border-color:#424242}
#childrenStory .story-output-heading{padding-bottom:16px;border-bottom:1px solid #ffffff12}
#childrenStory .story-output-heading h2{font-size:22px;margin:0}
#childrenStory .story-output-heading>span{font-size:11px;color:#ccc;padding:7px 10px;border:1px solid #494949;border-radius:20px;background:#2b2b2b}
#childrenStory .story-project>p:empty{display:none}
#childrenStory .story-production-hero{display:flex;align-items:center;gap:26px;padding:32px 8px}
#childrenStory .story-production-hero small{color:#bba88f;font-size:12px}
#childrenStory .story-production-hero h3{font-size:27px;margin:9px 0}
#childrenStory .story-production-hero p{font-size:13px;color:#bbb;margin:0;display:flex;align-items:center;gap:12px}
#childrenStory .story-orbit{width:104px;height:104px;border:1px solid #806c50;border-radius:50%;display:grid;place-items:center;position:relative;background:radial-gradient(circle,#51412a55,#222);box-shadow:0 0 0 10px #cba77208;flex:none}
#childrenStory .story-orbit>svg{width:42px;height:42px;color:#e3c190}
#childrenStory .story-orbit-dot{position:absolute;inset:-1px;animation:story-spin 4s linear infinite}
#childrenStory .story-orbit-dot:before{content:'';position:absolute;top:-3px;left:50%;width:7px;height:7px;border-radius:50%;background:#e5bc7c;box-shadow:0 0 12px #d1a76e}
#childrenStory .story-production-track{height:5px;background:#3c3c3c;overflow:hidden;border-radius:5px;margin:4px 0 28px}
#childrenStory .story-production-track>span{display:block;height:100%;border-radius:5px;background:linear-gradient(90deg,#c29962,#ecd1a7);transition:width .5s ease}
#childrenStory .story-production-stages{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
#childrenStory .story-production-step{padding:18px 12px;border-radius:16px;border:1px solid #393939;background:#1b1b1b;display:flex;flex-direction:column;align-items:center;text-align:center;gap:10px;color:#929292}
#childrenStory .story-stage-icon{display:grid;place-items:center;width:43px;height:43px;background:#292929;border-radius:13px}
#childrenStory .story-stage-icon svg{width:25px;height:25px}
#childrenStory .story-production-step strong{font-size:13px}
#childrenStory .story-production-step small{font-size:10px;line-height:1.8}
#childrenStory .story-production-step b{font-size:10px;font-weight:400;margin-top:auto;padding-top:5px}
#childrenStory .story-production-step.is-active{border-color:#ae8c5e;background:linear-gradient(145deg,#403526,#29251f);color:#f3dec0;box-shadow:0 6px 20px #0002}
#childrenStory .story-production-step.is-active .story-stage-icon{background:#d1aa6a25}
#childrenStory .story-production-step.is-done{color:#c9d8c6;border-color:#485044;background:#232721}
#childrenStory .story-background-note{font-size:12px;line-height:2;text-align:center;margin:24px 0 0;color:#aaa}
#childrenStory .story-loading-dots{display:inline-flex;gap:4px}
#childrenStory .story-loading-dots i{height:4px;width:4px;background:currentColor;border-radius:50%;animation:story-pulse 1.2s infinite}
#childrenStory .story-loading-dots i:nth-child(2){animation-delay:.2s}#childrenStory .story-loading-dots i:nth-child(3){animation-delay:.4s}
@keyframes story-spin{to{transform:rotate(360deg)}}@keyframes story-pulse{50%{opacity:.2;transform:translateY(-3px)}}
@media(max-width:600px){#childrenStory .story-form,#childrenStory .story-project{padding:18px 14px}#childrenStory .story-production-stages{grid-template-columns:repeat(2,minmax(0,1fr))}#childrenStory .story-production-hero{gap:18px;padding:28px 0}#childrenStory .story-orbit{width:76px;height:76px}#childrenStory .story-orbit>svg{width:30px;height:30px}#childrenStory .story-production-hero h3{font-size:22px}#childrenStory .story-estimate{flex-wrap:wrap;gap:10px}#childrenStory .story-stepper li{padding:10px 5px!important}#childrenStory .story-stepper b{font-size:11px}}
@media(prefers-reduced-motion:reduce){#childrenStory .story-spinner,#childrenStory .story-orbit-dot,#childrenStory .story-loading-dots i{animation:none}#childrenStory .story-card,#childrenStory .story-production-track>span{transition:none}}
#childrenStory .story-failure{text-align:center;padding:30px 18px 22px;line-height:2}
#childrenStory .story-failure-icon{display:grid;place-items:center;width:66px;height:66px;margin:0 auto 12px;border-radius:22px;background:#402f30;border:1px solid #694449;color:#eca9ad;font-size:36px}
#childrenStory .story-failure h3{margin:12px 0;font-size:21px}#childrenStory .story-failure p{color:#dbb7b7;font-size:13px}#childrenStory .story-failure small{color:#aaa;font-size:11px}
#childrenStory .story-resume-button{display:block;margin:0 auto 12px;border:1px solid #666!important;background:#383838!important;color:#eee!important;border-radius:12px;padding:12px 22px}
#childrenStory[aria-busy=true] .story-project button:disabled::before{content:'';display:inline-block;width:12px;height:12px;margin-inline-end:8px;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;animation:story-spin .8s linear infinite}
@media(prefers-reduced-motion:reduce){#childrenStory[aria-busy=true] .story-project button:disabled::before{animation:none}}
#childrenStory .story-catalog-loader{grid-column:1/-1;min-height:150px;display:flex;align-items:center;justify-content:center;gap:12px;border:1px dashed #454545;border-radius:16px;color:#aaa;background:linear-gradient(120deg,#242424,#1a1a1a)}

#childrenStory .story-image-recovery .story-failure-icon{background:#312743;border-color:#675184;color:#cebcf7}
#childrenStory .story-image-scenes{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,190px),1fr));gap:12px;margin:18px 0}
#childrenStory .story-image-scenes button{display:flex;flex-direction:column;align-items:flex-start;text-align:right;padding:18px;gap:8px;white-space:normal;line-height:1.9}
#childrenStory .story-image-scenes strong{font-size:14px}#childrenStory .story-image-scenes span{font-size:12px;color:#bdb2cc}
#childrenStory .story-scene-field{display:grid;gap:10px;margin:20px 0;font-size:13px}#childrenStory .story-scene-field textarea{width:100%;min-height:100px;padding:15px;border:1px solid #514563;border-radius:16px;background:#141119;color:#f5efff;font:inherit;resize:vertical}
#childrenStory .story-saved-audio{display:grid;gap:14px;margin-top:28px;padding-top:22px;border-top:1px solid #514563}#childrenStory .story-saved-audio>a{width:fit-content;color:#c9b8ff;text-decoration:underline}
.story-image-options{border:1px solid var(--border-color,#3c3e46);border-radius:18px;padding:20px;margin:20px 0;display:grid;gap:14px;min-width:0;background:rgba(128,128,128,.04)}
.story-image-options legend{font-weight:700;padding:0 10px}
.story-image-options label{display:grid;gap:8px}
.story-image-options p,.story-image-options small,.story-image-budget-note{font-size:.85rem;line-height:1.9;color:var(--text-secondary,#a8aab8);margin:0}
.story-image-options [data-sequence-options]{display:grid;gap:12px}
.story-image-options [hidden]{display:none!important}
.story-image-options input,.story-image-options select{width:100%;min-height:48px;box-sizing:border-box;border:1px solid var(--border-color,#454752);border-radius:12px;padding:12px 14px;background:var(--bg-input,#252630);color:inherit;font:inherit}
.story-image-options input:focus-visible,.story-image-options select:focus-visible{outline:2px solid var(--accent-color,#a897ff);outline-offset:3px}
.story-frame-enter{animation:story-frame-reveal .3s ease-out}
@keyframes story-frame-reveal{from{opacity:.3}to{opacity:1}}
@media(prefers-reduced-motion:reduce){.story-frame-enter{animation:none}}

#adminStories .story-writer-settings{min-width:0;margin:0 0 24px;padding:20px;border:1px solid #a78bfa66;border-radius:16px}
#adminStories .story-writer-settings legend{padding:0 8px;font-weight:700}
