.state-designer{width:min(640px,calc(100vw - 24px));max-width:calc(100vw - 24px);max-height:94dvh;margin:auto;overscroll-behavior:contain}
.state-designer .state-preview-header{position:sticky;top:0;min-height:0;padding:14px 18px}
.state-design-options{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;padding:14px 14px 8px}
.state-design-options button{min-width:0;display:flex;flex-direction:column;align-items:center;gap:6px;border:2px solid transparent;border-radius:12px;padding:7px 4px;background:var(--surface);color:var(--ink);cursor:pointer;font:inherit;font-size:12px;line-height:1.25}
.state-design-options button[aria-pressed=true]{border-color:var(--primary);background:var(--primary-soft)}
.state-design-options img{display:block;width:100%;max-width:81px;height:auto;aspect-ratio:9/16;object-fit:cover;border-radius:6px}
.state-design-options span{text-align:center;overflow-wrap:anywhere;min-height:2.5em}
.state-designer button:focus-visible,.state-designer a:focus-visible{outline:3px solid var(--primary);outline-offset:3px}
.state-status{padding:7px 16px;margin:0;color:var(--muted);font-size:13px;line-height:1.5;min-height:34px}
.state-image-wrap{min-height:100px;background:var(--surface);display:flex;justify-content:center}
.state-image-wrap[aria-busy=true]{background:linear-gradient(120deg,var(--surface),var(--primary-soft),var(--surface));min-height:140px}
.state-export{display:block;width:100%;height:auto;max-width:540px;object-fit:contain;align-self:flex-start}
.state-export[hidden],.state-parts[hidden],.state-retry[hidden]{display:none!important}
.state-parts{display:flex;flex-wrap:nowrap;overflow-x:auto;gap:6px;padding:6px 14px;scrollbar-width:thin;max-height:54px}
.state-parts button{flex:none;white-space:nowrap;border:1px solid var(--outline);border-radius:20px;padding:7px 10px;background:var(--surface);color:var(--ink);font:inherit;font-size:12px;cursor:pointer}
.state-parts button[aria-pressed=true]{background:var(--primary);color:var(--on-primary)}
.state-designer .state-preview-actions{flex-wrap:wrap;padding:12px;gap:8px}
.state-designer .state-preview-actions .button{font-size:13px;padding:12px 15px}
.state-designer [aria-disabled=true],.state-designer button:disabled{opacity:.5;cursor:wait;pointer-events:none}
@media(max-width:380px){.state-design-options{gap:3px;padding:10px 6px 4px}.state-design-options button{font-size:11px;padding:5px 2px}.state-preview-header h2{font-size:18px}}
