:root{color-scheme:light;font-family:system-ui,-apple-system,'Hiragino Kaku Gothic ProN',sans-serif;color:#2a2328;background:#fff;--accent:#b94f7c}*{box-sizing:border-box}body{margin:0;min-height:100svh;min-height:100dvh;display:flex;flex-direction:column;-webkit-tap-highlight-color:transparent}button,a{touch-action:manipulation}button{font:inherit;font-size:13px;border:0;border-radius:8px;background:#f3f4f6;color:#2a2328;min-height:44px;padding:7px 10px}button:focus-visible,a:focus-visible{outline:3px solid var(--accent);outline-offset:2px}[hidden]{display:none!important}.mini-shell{width:100%;max-width:450px;margin:0 auto;flex:1;display:flex;flex-direction:column;padding:0 6px max(6px,env(safe-area-inset-bottom));gap:5px}.companion{display:flex;align-items:center;gap:6px;min-height:58px}.companion>img{width:56px;height:56px;object-fit:contain}.companion>div{flex:1;min-width:0}#cast-name{font-size:11px;color:#6e626a}#speech{font-size:12px;line-height:1.5;margin:2px 0;padding:4px 8px;border:1px solid #eadde2;border-radius:5px 12px 12px}#pause{width:44px;flex:none}.stage{position:relative;flex:1;min-height:300px;height:clamp(300px,52dvh,520px);border:1px solid #e8e2e5;border-radius:16px;overflow:hidden;background:#fbf5f5}canvas{display:block;width:100%;height:100%;position:absolute;inset:0;touch-action:none}.hud{position:absolute;top:8px;left:10px;right:10px;display:flex;justify-content:space-between;gap:4px;font-size:12px;pointer-events:none}.hud span{background:#fffefaed;border-radius:8px;padding:5px 7px}#clock{font-variant-numeric:tabular-nums}.overlay{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:safe center;padding:14px;background:#fffdfbf5;text-align:center;overflow-y:auto;overscroll-behavior:contain}.overlay h1{font-size:20px;margin:5px 0}.overlay p{font-size:12px;line-height:1.6;margin:6px 0;max-width:320px}.label{color:#6e626a}.cast-options{display:flex;justify-content:center;gap:10px}.cast-options button{width:66px;height:68px;padding:3px;border:2px solid transparent}.cast-options img{width:100%;height:100%;object-fit:contain}.choices{display:flex;gap:5px;justify-content:center}.choices button{flex:1;padding:5px 4px}.choices button[aria-pressed=true],.cast-options button[aria-pressed=true]{outline:2px solid var(--accent);outline-offset:-2px;background:#eef0f3}.choices button[aria-pressed=true]::after,.cast-options button[aria-pressed=true]::after{content:' ✓';font-weight:bold}.cast-options button{position:relative}.cast-options button::after{position:absolute;right:1px;bottom:0;background:white;border-radius:50%;color:var(--accent)}.primary{background:#b94f7c;color:#fff}.controls{display:flex;flex-direction:column;gap:5px;padding:1px 2px}.controls p{font-size:12px;margin:0;line-height:1.5;min-height:18px}.palette button{display:flex;align-items:center;justify-content:center;gap:3px;font-size:11px}.swatch{width:16px;height:16px;display:inline-block;border-radius:50%;flex:none;border:1px solid #0001}.actions{display:flex;gap:6px}.actions button{flex:1}#result{padding:7px 4px}#result h2{font-size:16px;margin:0 0 4px}#result p{font-size:12px;margin:0 0 7px;line-height:1.6}.save-note{margin:0;font-size:11px;color:#6e626a}#album{color:#6e626a}@media(max-height:700px){.companion{min-height:48px}.companion>img{height:48px;width:48px}.stage{height:max(300px,40dvh);min-height:300px}.overlay{padding:8px}.overlay h1{font-size:17px}.overlay p{margin:4px 0}.cast-options button{width:56px;height:52px}.controls{gap:3px}.mini-shell{gap:3px}}@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important}}

button:disabled{background:#eef0f3;color:#766b72}#progress{display:block;width:100%;height:5px;accent-color:var(--accent);border:0;border-radius:4px;overflow:hidden}#progress::-webkit-progress-bar{background:#eef0f3}#progress::-webkit-progress-value{background:var(--accent)}

#request{display:flex;align-items:center;gap:5px}#request strong{font-weight:600}#paint-status{font-size:11px;color:#6e626a}

.overlay>*{flex-shrink:0}.choices button,.actions button{min-width:0;overflow-wrap:anywhere}#result-detail{overflow-wrap:anywhere}.overlay #go{margin:6px 0;min-width:160px}.hud #clock{flex:none}
/* Keep shade names intact even on a 320px phone; the check never takes label space. */
.choices button{position:relative}
.choices button[aria-pressed=true]::after{position:absolute;right:3px;top:2px;font-size:10px;line-height:1}
.palette button{flex-direction:column;gap:1px;padding:4px 0;white-space:nowrap}
