/* Product UI only. Geometry, projection and clipping live in unchanged stage.css. */
:root{--green:#558777;--muted:#62716a;--border:#dce4db;--paper:#FAF8F4;--sub:#E9EFE8;--accent:#D8A58C;color:#303B37;background:var(--paper);font-family:"Yu Gothic UI","Hiragino Kaku Gothic ProN",Meiryo,system-ui,sans-serif;font-size:15px;color-scheme:light}
body{background:var(--paper);color:#303B37;line-height:1.65;-webkit-text-size-adjust:100%}
button,input,select,summary,a{-webkit-tap-highlight-color:transparent}
button,.file-button,summary{touch-action:manipulation}
button,.file-button{font-size:14px;font-weight:600;min-height:46px;line-height:1.5}
button:focus-visible,input:focus-visible,summary:focus-visible,a:focus-visible,label:focus-within{outline:3px solid #aa7358;outline-offset:3px}
button:disabled,input:disabled{opacity:.48}
.topbar{height:auto;min-height:86px;padding:10px 20px;border-bottom:1px solid var(--border);gap:16px;background:var(--paper)}
.brand{min-width:0;display:flex;align-items:center;gap:5px;text-decoration:none;flex-shrink:1}
.series-logo{display:block;width:280px;max-width:100%;flex-shrink:1}
.series-logo img{display:block;width:100%;height:auto}
.local-badge{font-size:13px;color:var(--muted);line-height:1.5;display:none;white-space:normal}
.local-badge i{background:var(--green);width:7px;height:7px;flex-shrink:0}
main{max-width:1280px;padding:22px 20px 0;margin:auto;min-width:0}
.intro{display:flex;flex-direction:column;align-items:stretch;gap:16px;margin-bottom:18px}
.intro h1{font-family:inherit;font-size:clamp(18px,4.8vw,22px);font-weight:700;line-height:1.55;letter-spacing:.01em;margin:0 0 6px;color:#303B37;overflow-wrap:anywhere}
.intro p:last-child{font-size:14px;color:var(--muted);line-height:1.75;margin:0}
.primary{border:1px solid var(--green);border-radius:11px;background:var(--green);color:#fff;padding:13px 16px;box-shadow:0 3px 8px #55877716}
.primary:hover{background:#477563;border-color:#477563}
.intro .enjoy-button{display:flex;align-items:center;justify-content:center;gap:10px;width:100%;min-height:48px;font-size:15px;letter-spacing:.03em;padding:13px 16px}
.enjoy-button svg{width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0}
.intro button span{margin-left:auto;font-size:19px;font-weight:400}
.enjoy-button svg{margin-left:auto}
.intro button span{margin-right:auto}
.workspace{display:grid;grid-template-columns:minmax(0,1fr);gap:18px;align-items:start;min-width:0}
.preview{width:100%;min-width:0;border:1px solid #d4dfd3;border-radius:16px;box-shadow:0 5px 22px #303b3707;background:#fff}
.stage-top,.stage-bottom{height:auto;min-height:54px;padding:10px 14px;gap:10px;line-height:1.5}
.stage-top>span:first-child{font-size:14px;letter-spacing:.02em;font-weight:700;color:#3f5b4f}
.stage-top>span:last-child{font-size:12px;color:#558777;letter-spacing:0;white-space:nowrap}
.stage-bottom{padding:8px 12px;background:#fff;font-size:12px;color:var(--muted);align-items:center}
#stageHint{min-width:0;line-height:1.65;flex:1}
.quiet{flex-shrink:0;font-size:13px;min-height:44px;padding:9px 11px;border:1px solid #e0e6db;border-radius:9px;background:#f7f9f4;color:#4d6c5d}
.scene-decoration{background:linear-gradient(#e9efe8,#faf4e6)}
.stage-caption{font-family:inherit;color:#60795f;font-size:13px;letter-spacing:.08em}
.panel{display:grid;gap:16px;min-width:0;width:100%;border:0;padding:0;background:transparent;border-radius:0}
.panel .control-section,.panel .control-section+.control-section{border:1px solid var(--border);border-radius:16px;background:#fff;padding:20px;margin:0;min-width:0;box-shadow:0 3px 16px #303b3704}
.section-title{display:flex;align-items:center;gap:10px;margin-bottom:8px;min-width:0}
.section-title h2{font-size:17px;line-height:1.5;font-weight:700;margin:0}
.step{display:inline-flex;align-items:center;justify-content:center;width:27px;height:27px;border-radius:9px;background:var(--sub);font-family:inherit;color:var(--green);font-size:13px;font-weight:700;flex-shrink:0}
.count{font-size:13px;line-height:1.5;color:#567160;background:var(--sub);padding:3px 10px;border-radius:20px;white-space:nowrap}
.section-description{font-size:14px;color:var(--muted);margin:0 0 16px;line-height:1.7}
.file-button{display:flex;align-items:center;justify-content:center;width:100%;position:relative;text-align:center;padding:13px 12px;white-space:normal;overflow-wrap:anywhere}
.secondary{border:1px solid #d5dfd3;border-radius:10px;background:#fbfcf8;color:#416954;margin-top:10px;padding:11px 13px;box-shadow:none}
.secondary:hover{background:var(--sub)}
.help{font-size:13px;color:var(--muted);line-height:1.8;margin:10px 0}
.characters{gap:9px;margin:16px 0 0}
.character-choice{display:flex;gap:12px;width:100%;padding:10px 12px;border-radius:11px;border:1px solid #e3e8df;background:#f8faf5;color:#303B37;font-size:14px;min-height:64px;line-height:1.5}
.character-choice.active{border:2px solid var(--green);padding:9px 11px;background:#eef4ed}
.character-choice img{width:34px;height:44px;object-fit:contain;flex-shrink:0}
.character-choice span{min-width:0;overflow-wrap:anywhere}
.character-choice small{font-size:12px;color:#557662;line-height:1.5;white-space:nowrap}
.placement-controls{border-top:1px solid var(--border);margin-top:18px;padding-top:18px}
.range-label{display:flex;align-items:center;justify-content:space-between;gap:10px;font-size:14px;line-height:1.5;font-weight:600;min-height:24px;margin:0}
.range-label output{font-size:14px;line-height:1.5;color:#426e5c;font-variant-numeric:tabular-nums;font-weight:700;flex-shrink:0}
input[type=range]{width:100%;height:44px;accent-color:var(--green);margin:4px 0 0;cursor:pointer}
.range-ends{font-size:12px;color:var(--muted);margin-top:-2px}
.deletion-controls{margin-top:16px}
.danger{color:#8c5b49;border-color:#e5d5ca;background:#fffaf7}
.deletion-controls .file-button{font-size:14px;min-height:46px}
.text-button{font-size:13px;min-height:44px;line-height:1.6;padding:9px 0;white-space:normal;overflow-wrap:anywhere;color:#47715d}
.sample-details{margin-top:18px;border-top:1px solid var(--border);padding-top:6px}
summary{font-size:14px;font-weight:600;line-height:1.7;min-height:44px;padding:10px 0;cursor:pointer;color:#4e6f5d}
.demo-actions{gap:10px;margin:0;display:flex;flex-wrap:wrap}
.demo-actions .secondary{margin:0}
.preset-label{font-size:13px;color:var(--muted);margin:18px 0 10px}
.backgrounds{gap:12px;flex-wrap:wrap}
.swatch{width:48px;height:44px;min-height:44px;border-radius:10px;border:4px solid white;box-shadow:0 0 0 1px #dce4d8}
.swatch.active{box-shadow:0 0 0 2px var(--green)}
.background-open{margin-top:0}
#backgroundAdjustment{border-top:1px solid var(--border);margin-top:16px;padding-top:6px}
.background-arrows{gap:8px;margin-top:10px}
.background-arrows button{min-height:46px;font-size:20px;background:var(--sub);color:#4b705e;border-radius:9px}
#status{font-size:14px;color:#536e5a;line-height:1.8;min-height:24px;margin:16px 0;overflow-wrap:anywhere}
#status.error{color:#a64437}
.save-notice{border:1px solid var(--border);background:#f0f4ec;border-radius:16px;padding:18px 20px;font-size:14px;min-width:0;color:#435b4b}
.save-heading{display:flex;align-items:center;gap:10px;margin-bottom:12px}
.save-heading h2{font-size:16px;line-height:1.5;margin:0}
.save-icon{width:26px;height:26px;display:inline-flex;align-items:center;justify-content:center;color:white;background:var(--green);border-radius:50%;font-size:14px;flex-shrink:0}
.save-notice p{margin:9px 0;line-height:1.8;overflow-wrap:anywhere}
#saveStatus{font-size:14px;font-weight:600}
.privacy{font-size:13px;line-height:1.9;color:var(--muted);border-top:1px solid #d9e2d3;padding-top:14px;margin:12px 0 0}
.help-details{border-top:1px solid #d9e2d3;margin-top:14px;padding-top:4px}
.help-details ul{padding-left:20px;margin:5px 0 16px;font-size:13px;line-height:1.9;color:var(--muted)}
.help-details li+li{margin-top:9px}
footer{display:flex;align-items:center;justify-content:space-between;gap:14px;font-size:12px;line-height:1.7;padding:20px 0 max(20px,env(safe-area-inset-bottom));margin-top:24px;border-color:var(--border);color:#677669}
footer>span:first-child{font-weight:600}
.footer-app{font-weight:400;margin-left:4px}
.view-control{background:#faf8f4e8;color:#365a48;font-size:14px;min-height:46px}
#fullscreenMessage{font-size:13px}
.viewing.save-error .save-notice{padding:12px 16px;font-size:13px;border-radius:12px}
.viewing.save-error .save-heading,.viewing.save-error .help-details,.viewing.save-error .privacy{display:none}
.viewing.save-error .save-notice .help{font-size:12px}
@media(min-width:651px){.topbar{padding:12px 24px}.series-logo{width:360px}.local-badge{display:flex;max-width:220px}.intro{flex-direction:row;align-items:center;justify-content:space-between;gap:24px;margin-bottom:24px}.enjoy-button{width:auto;min-width:210px}.intro button span{margin-left:8px;margin-right:0}.enjoy-button svg{margin-left:0}.intro h1{font-size:24px}.stage-top,.stage-bottom{padding-left:18px;padding-right:18px}}
@media(min-width:901px){main{padding-top:30px}.topbar{padding-left:5vw;padding-right:5vw}.workspace{grid-template-columns:minmax(0,1fr) 336px;gap:24px}.preview{align-self:start}.intro{margin-bottom:26px}.panel .control-section{padding:20px}.save-notice{padding:20px 24px}footer>span:last-child{display:inline}}
@media(max-width:350px){main{padding-left:16px;padding-right:16px}.topbar{padding-left:16px;padding-right:16px;gap:8px}.series-logo{width:260px}.intro h1{font-size:18px}.intro p:last-child{font-size:13px}.stage-top,.stage-bottom{gap:7px;padding-left:10px;padding-right:10px}.stage-top>span:last-child{font-size:12px}.quiet{padding:9px;font-size:12px}.panel .control-section,.panel .control-section+.control-section{padding:16px}.character-choice small{font-size:12px}.section-title h2{font-size:16px}}
@media(min-width:651px){.intro .enjoy-button{width:auto}}
@media(prefers-reduced-motion:reduce){button{transition:none}}

/* Selection and ordering: geometry and animation remain in stage.css. */
.stack-controls{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:12px}
.stack-controls button{min-height:46px;margin-top:0}
.character-choice{flex-wrap:wrap}
.character-choice small{white-space:normal;font-size:12px}

.collection-list{display:grid;gap:12px;max-height:420px;overflow:auto;overscroll-behavior:contain;padding:3px}
.collection-card{display:grid;grid-template-columns:48px minmax(0,1fr);gap:6px 12px;padding:12px;border:1px solid var(--border);border-radius:12px;background:#f8faf5;min-width:0}
.collection-card>img{width:48px;height:64px;object-fit:contain;grid-row:span 2}
.collection-card strong{font-size:14px;overflow-wrap:anywhere;line-height:1.6}
.collection-card small{font-size:12px;color:var(--muted)}
.collection-actions{grid-column:1/-1;display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.collection-actions .secondary{margin:0;min-width:72px}.collection-actions .text-button{padding:8px;min-height:44px}
