:root{color-scheme:dark;--base:#141419;--panel:#1c1c23;--raised:#26262f;--edge:#33333f;--edge-strong:#44445a;--text:#eeeeF3;--muted:#a5a5b7;--quiet:#9393a5;--accent:#b5a1ff;--accent-ink:#1a1230;--selected:#332b49;--green:#91d5b1;--amber:#f2c879;--error:#ffb4c0;--shadow:0 18px 50px #0006;--card-alpha:rgba(28,28,35,.96);font:13px/1.5 'Avenir Next','Segoe UI',sans-serif}*{box-sizing:border-box}body{margin:0;background:var(--base);color:var(--text)}[hidden]{display:none!important}button,input,select,textarea{font:inherit}button{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:32px;padding:6px 12px;color:var(--text);background:transparent;border:1px solid transparent;border-radius:6px;cursor:pointer;white-space:nowrap;transition:background .12s,color .12s}button:hover{background:#30303b}button:disabled{opacity:.4;cursor:default}button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,summary:focus-visible,canvas:focus-visible,.file-button:focus-within,a:focus-visible{outline:2px solid var(--accent);outline-offset:3px}button:active:not(:disabled){transform:translateY(1px)}h2,h3,h4,p{margin:0}h2{font-size:13px;font-weight:650}h3{font-size:12px;font-weight:600}h4{font-size:12px;font-weight:600}svg.icon{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.65;stroke-linejoin:round;stroke-linecap:round;flex-shrink:0}.svg-library{position:absolute;width:0;height:0;overflow:hidden}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}
/* Stage shell: 56px top bar, 76px chapter rail, canvas hero, docked card column and 300px companion. */
.app-header{height:56px;display:flex;align-items:center;gap:10px;padding:0 14px;border-bottom:1px solid var(--edge);background:var(--panel)}.brand{display:flex;align-items:center;gap:9px;text-decoration:none;color:var(--text);flex-shrink:0}.project-name{display:flex;gap:8px;align-items:center;min-width:0;flex-shrink:0}.primary{background:var(--accent);color:var(--accent-ink);font-weight:650;padding:8px 14px;min-height:34px;border-radius:8px}.primary:hover{background:#c4b5ff}.project-menu{position:relative}.project-menu summary{display:flex;align-items:center;gap:6px;height:28px;padding:0 10px;border:1px solid var(--edge);border-radius:8px;background:var(--raised);cursor:pointer;list-style:none;font-size:12px;white-space:nowrap;max-width:220px}.project-menu summary::-webkit-details-marker{display:none}.project-menu summary strong{font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.project-menu .caret{opacity:.6;font-size:10px}.project-menu>div{position:absolute;top:calc(100% + 6px);left:0;z-index:50;width:230px;padding:5px;background:var(--panel);border:1px solid var(--edge);border-radius:10px;box-shadow:var(--shadow)}.project-menu .menu-heading{margin:6px 8px 2px;font-size:11px;color:var(--muted)}
.project-menu button,.file-button{width:100%;display:flex;justify-content:flex-start;text-align:left;font-size:12px;padding:8px;cursor:pointer;border-radius:6px}.file-button:hover{background:var(--raised)}.file-button input{position:absolute;width:1px;height:1px;opacity:0}
.chip{display:inline-block;line-height:26px;height:28px;padding:0 10px;border-radius:8px;border:1px solid var(--edge);color:var(--muted);font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:190px}.scene-row{display:inline-flex;align-items:center;gap:6px;height:28px;padding:0 10px;border:1px solid transparent;border-radius:8px;color:var(--muted);font-size:12px;white-space:nowrap}.scene-row>.icon{color:var(--accent);width:14px;height:14px}.scene-row[aria-pressed=true]{background:var(--selected);color:var(--accent)}/* arcade-1.3.0 scene switcher: one tab per scene and a menu of scene actions. */
.scene-bar{display:flex;align-items:center;gap:2px;min-width:0}.scene-bar>.scene-row{flex:0 1 auto;min-width:0;overflow:hidden}.scene-bar>.scene-menu,.scene-bar>#scene-select{flex-shrink:0}.scene-row>span{max-width:110px;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.scene-row[aria-current=true]{color:var(--text)}
.scene-menu{position:relative}.scene-menu summary{list-style:none;display:flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:8px;color:var(--muted);cursor:pointer}.scene-menu summary::-webkit-details-marker{display:none}.scene-menu summary:hover{background:#30303b}.scene-menu summary .icon{width:14px;height:14px}
.scene-menu>div{position:absolute;top:calc(100% + 6px);left:0;z-index:50;width:200px;padding:5px;background:var(--panel);border:1px solid var(--edge);border-radius:10px;box-shadow:var(--shadow);display:flex;flex-direction:column}
/* Levels sit in the stage column above the canvas tools (R1.5); their menu opens upward. */
/* Levels: tabs on the top edge of the screen, as wide as the screen (--screen-w is set with the fit). */
.canvas-area>.scene-bar{align-self:center;width:var(--screen-w,640px);max-width:calc(100% - 24px);margin:0 0 6px;padding:0;gap:2px;background:none;border:0;border-bottom:1px solid var(--edge);border-radius:0;flex-shrink:0}.canvas-area>.scene-bar>.scene-row{height:30px;margin-bottom:-1px;border:1px solid transparent;border-bottom:0;border-radius:8px 8px 0 0}.canvas-area>.scene-bar>.scene-row[aria-current=true]{background:var(--raised);border-color:var(--edge);color:var(--text);box-shadow:inset 0 -2px 0 var(--accent)}.canvas-area>.scene-bar>.scene-menu{margin-left:2px}.workspace .scene-menu>div{top:calc(100% + 6px);bottom:auto}
/* Compact desktops: the Rastlet overlay closes with its own button since the header toggle is gone (R1.5). */
.companion-close{display:none;margin-left:auto;width:28px;min-height:28px;padding:0;border-radius:7px;color:var(--muted);font-size:18px;line-height:1}
@media(min-width:1024px) and (max-width:1279px){body:not(.companion-rail) .companion-close{display:inline-flex;align-items:center;justify-content:center}}.scene-menu>div button{justify-content:flex-start;font-size:12px;padding:8px}
/* One saved indicator (R1.5): a chip that opens saving to the account. */
.saved-indicator{min-height:28px;max-height:28px;background:none;font-weight:400;cursor:pointer}.saved-indicator:hover,.saved-indicator[aria-expanded=true]{color:var(--text);border-color:var(--edge-strong)}.status{display:flex;flex-direction:column;align-items:flex-start;justify-content:center;gap:1px;height:34px;min-height:34px;padding:0 10px;border-radius:8px;border:1px solid var(--edge);background:var(--raised);text-align:left;min-width:92px;max-width:280px;overflow:hidden}.status strong{font-size:12px;font-weight:600;line-height:1.2;display:flex;align-items:center;gap:6px}.status small{font-size:10.5px;color:var(--muted);line-height:1.2;white-space:nowrap;max-width:min(250px,100%);overflow:hidden;text-overflow:ellipsis}.status .dot{width:7px;height:7px;border-radius:50%;background:var(--quiet);flex-shrink:0}.status[data-state=good] .dot{background:var(--green)}.status[data-state=bad] .dot{background:var(--error)}.status[data-state=busy] .dot{background:none;border:1.5px solid var(--accent);border-right-color:transparent;animation:status-spin .8s linear infinite}.status[data-state=busy]{border-color:var(--accent)}@keyframes status-spin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){.status[data-state=busy] .dot{animation:none}}
/* Play carries the build state (R1.5): Preparing… with a turning ring, Needs a fix in the error colors, Not ready plain. */
.header-tools>.play-button{width:auto;padding:0 16px;border:1px solid transparent;color:var(--accent-ink)}.play-button .ring{display:none;width:12px;height:12px;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;flex-shrink:0;animation:status-spin .8s linear infinite}.play-button.updating .icon{display:none}.play-button.updating .ring{display:inline-block}.header-tools>.play-button[data-state=bad],.header-tools>.play-button[data-state=bad]:hover{background:color-mix(in srgb,var(--error) 16%,var(--raised));border-color:var(--error);color:var(--error)}.header-tools>.play-button[data-state=unavailable],.header-tools>.play-button[data-state=unavailable]:hover{background:var(--raised);border-color:var(--edge-strong);color:var(--text)}.play-button[data-state=bad] .icon,.play-button[data-state=unavailable] .icon{display:none}
@media(prefers-reduced-motion:reduce){.play-button .ring{animation:none;border-right-color:currentColor;opacity:.6}}.play-button{display:flex;align-items:center;gap:6px;height:34px;min-height:34px;padding:0 16px;border-radius:8px;background:var(--accent);color:var(--accent-ink);font-size:13.5px;font-weight:700;border:1px solid transparent;flex-shrink:0}.play-button:hover{background:#c4b5ff}.play-button .icon{width:14px;height:14px;stroke-width:2.2}.play-button:disabled{opacity:.55}.pill{flex-direction:column;align-items:flex-start;justify-content:center;gap:1px;height:40px;min-height:40px;padding:0 12px;border-radius:10px;border:1px solid var(--edge);background:var(--raised);min-width:100px;text-align:left}.pill strong{font-size:12.5px;font-weight:600;line-height:1.2;display:flex;align-items:center;gap:6px}.pill small{font-size:10.5px;color:var(--muted);line-height:1.3;white-space:nowrap;max-width:170px;overflow:hidden;text-overflow:ellipsis}.pill.primary{background:var(--accent);border-color:transparent;color:var(--accent-ink)}.pill.primary:hover{background:#c4b5ff}.pill.primary small{color:var(--accent-ink);opacity:.85}.pill.primary .icon{width:14px;height:14px;stroke-width:2}.pill[aria-pressed=true]{background:var(--selected);border-color:var(--accent)}.pill .dot{width:7px;height:7px;border-radius:50%;background:var(--quiet);flex-shrink:0}.pill[data-state=good] .dot{background:var(--green)}.pill[data-state=bad] .dot{background:var(--error)}.pill-more{width:26px;min-height:40px;padding:0;margin-left:-4px;color:var(--muted);border-radius:8px}.pill-more .icon{width:14px;height:14px}.pill-more.flag{color:var(--error)}
.header-tools{display:flex;align-items:center;gap:8px;margin-left:auto;flex-shrink:0}.header-tools>button{width:32px;min-height:32px;padding:0;border:1px solid var(--edge);border-radius:8px;color:var(--muted)}.header-tools>button[aria-expanded=true]{color:var(--accent);background:var(--selected)}
.header-toolbar{display:flex;align-items:stretch;height:32px;border:1px solid var(--edge);border-radius:8px;overflow:hidden}.header-toolbar>button,.header-toolbar>a{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:0;height:100%;padding:0 11px;border:0;border-radius:0;font-size:12px;font-weight:600;color:var(--muted);text-decoration:none;background:transparent}.header-toolbar>:not(:last-child){box-shadow:inset -1px 0 var(--edge)}.header-toolbar>button:hover,.header-toolbar>a:hover{background:#30303b;color:var(--text)}[data-theme=bright] .header-toolbar>button:hover,[data-theme=bright] .header-toolbar>a:hover{background:#e4deef}.header-toolbar .icon{width:14px;height:14px}.header-toolbar>button:focus-visible,.header-toolbar>a:focus-visible{outline-offset:-2px}.header-toolbar>.export-button:not(:disabled){color:var(--accent)}.header-toolbar>.export-button:disabled{opacity:.6;cursor:default}.header-toolbar>.export-button:disabled:hover{background:transparent;color:var(--muted)}@media(max-width:1279px){.header-toolbar>button,.header-toolbar>a{width:34px;padding:0}.header-toolbar span{display:none}}
/* The help link costs 38px of header width; the account button gives way first and ellipsizes a long name. */
.app-header>.menu-anchor:last-child{min-width:0;flex-shrink:1}.app-header .account-status{flex-shrink:1;min-width:64px}
main{--card-col:var(--card-width,240px);--companion-col:var(--companion-width,300px);position:relative;height:calc(100dvh - 56px);min-height:640px;display:grid;grid-template-columns:76px minmax(360px,1fr) var(--card-col) var(--companion-col);grid-template-areas:"strip stage card companion"}body.card-closed main{--card-col:0px}
.chapters{grid-area:strip;background:var(--panel);border-right:1px solid var(--edge);display:flex;flex-direction:column;align-items:center;padding:8px 0;gap:3px;overflow:auto;overflow-x:hidden}.chapter .icon{color:var(--muted)}.chapter[aria-pressed=true] .icon{color:var(--accent)}
/* The object list heads the card for Hero and Enemies (R1.2): a wrapping grid of the same tiles, Add enemy in its header. */
.object-list{margin:0 14px 8px;padding-bottom:10px;border-bottom:1px solid var(--edge)}.object-list-head{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:6px}.object-list-head h3{font-size:11px;font-weight:600;color:var(--muted)}#object-tree{display:grid;grid-template-columns:repeat(auto-fill,minmax(60px,1fr));gap:4px}#object-tree .tree-button{width:auto}#object-tree .tree-button[aria-pressed=true]::before{display:none}.list-add{min-height:26px;padding:0 8px;gap:4px;font-size:11.5px;color:var(--muted);border:1px dashed var(--edge-strong);border-radius:7px}.list-add .icon{width:13px;height:13px}#edit-symbols{border:1px solid var(--edge);font-size:12px;margin:0 0 10px}
/* Version label: the commit this tab runs, at the foot of the strip; becomes an update button when a newer one is deployed. */
.strip .app-version{margin:auto 0 0;padding:10px 0 2px;display:flex;flex-direction:column;align-items:center;gap:1px;font-size:9.5px;line-height:1.25;color:var(--quiet);font-variant-numeric:tabular-nums;flex-shrink:0;cursor:default}
.app-version .version-number{font-weight:650;color:var(--muted)}
.strip .version-update{display:flex;flex-direction:column;gap:1px;min-height:0;width:60px;padding:5px 2px;border:1px solid var(--accent);border-radius:8px;color:var(--accent);font-size:9.5px;line-height:1.25}
.strip .version-update .version-number{color:var(--accent)}
.tree-button{width:60px;height:52px;min-height:52px;padding:4px 2px;border-radius:8px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;position:relative;color:var(--muted);font-size:9.5px;margin:0}.tree-button span{max-width:56px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:1}.tree-button small{display:none}.tree-button canvas{width:30px;height:26px;image-rendering:pixelated;object-fit:contain;flex-shrink:0}.tree-button .icon{width:20px;height:20px;color:var(--quiet);margin:3px 0}.chapter-count{position:absolute;top:4px;right:6px;font-size:9px;font-weight:600;color:var(--quiet)}.chapter-count:empty{display:none}.tree-button[aria-pressed=true]{background:var(--selected);color:var(--text)}.tree-button[aria-pressed=true]::before{content:"";position:absolute;left:-8px;top:10px;bottom:10px;width:2px;background:var(--accent);border-radius:2px}.chapters.dim .tree-button{opacity:.55}.chapters.dim .chapter-hood{opacity:1}
/* Under the hood at the foot of the chapter rail (R1.5, R1.2). */
.chapter-hood{margin-top:auto;height:auto;min-height:52px;padding:6px 2px;flex-shrink:0}.chapter-hood span{white-space:normal;text-align:center;line-height:1.15;max-width:60px}.chapter-hood .icon{color:var(--muted)}
.workspace{grid-area:stage;position:relative;min-width:0;display:flex;flex-direction:column;background:var(--base);overflow:hidden;background-image:radial-gradient(#45454c55 .65px,transparent .65px);background-size:16px 16px}.canvas-area{flex:1;min-height:0;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:12px 0 0}.stage{flex:0 1 auto;min-height:0;width:100%;display:flex;align-items:center;justify-content:safe center;overflow:auto;padding:2px}#canvas{display:block;width:640px;height:400px;flex-shrink:0;image-rendering:pixelated;touch-action:none;box-shadow:0 12px 45px #0005,0 0 0 1px #74709566;background:#2e2c9b}#canvas.playing{width:784px;height:auto}#canvas.playing:focus-visible{outline:none}
.canvas-caption{display:flex;gap:4px 10px;align-items:center;justify-content:center;flex-wrap:wrap;min-height:26px;margin:6px 16px 10px;color:var(--muted);font-size:11px;text-align:center}.canvas-caption>*+*::before{content:"·";margin-right:10px;color:var(--edge-strong)}#hint{color:var(--quiet)}#cell-status{color:var(--accent)}#cell-status:empty{display:none}.budget-status{font-size:11px;color:var(--quiet);margin:0}.budget-status[data-status=failed],.budget-status[data-status=unavailable]{color:var(--error)}.budget-status[data-status=passed]{color:var(--green)}
.canvas-toolbar{display:flex;align-items:center;gap:2px;height:44px;flex-shrink:0;align-self:center;margin:0 0 14px;padding:0 8px;background:var(--raised);border:1px solid var(--edge);border-radius:10px;box-shadow:var(--shadow);white-space:nowrap;max-width:calc(100% - 24px)}.tool-group{display:flex;align-items:center;gap:2px}.toolbar-divider{height:18px;width:1px;background:var(--edge);margin:0 6px}.canvas-toolbar button{height:32px;min-height:32px;padding:0 10px;border-radius:7px;font-size:12px;color:var(--muted)}.canvas-toolbar button:hover{color:var(--text)}.canvas-toolbar button[aria-pressed=true]{background:var(--selected);color:var(--text)}.canvas-toolbar button .icon{width:16px;height:16px}.zoom-label{display:flex;margin:0}.zoom-label select{width:76px;height:28px;min-height:28px;padding:0 6px;font-size:12px;background:var(--base);border-radius:6px}
.map-tools{display:flex;align-items:center;gap:2px;padding:2px;background:var(--base);border:1px solid var(--edge);border-radius:9px}.canvas-toolbar .map-tools button{height:28px;min-height:28px;padding:0 9px;gap:5px}.canvas-toolbar .map-tools button[aria-pressed=true]{background:var(--selected);color:var(--text);box-shadow:inset 0 0 0 1px var(--accent)}.map-options{display:flex;align-items:center;gap:6px;margin-left:8px}.map-options label{display:flex;align-items:center;gap:5px;margin:0;font-size:11px;color:var(--muted)}.map-options input,.map-options select{font-size:12px;height:28px;min-height:28px;padding:0 6px;background:var(--base);border-radius:6px}.map-options input[type=number]{width:60px}.map-options select{max-width:150px}.canvas-toolbar .back-to-design{color:var(--text);background:var(--selected)}.canvas-toolbar.compact .map-tools .tool-label{display:none}.canvas-toolbar.compact .map-tools button{padding:0 7px}
.sheet{position:relative;flex-shrink:0;max-height:62%;display:flex;flex-direction:column;background:var(--panel);border-top:1px solid var(--edge);border-radius:12px 12px 0 0;box-shadow:var(--shadow)}#source-sheet{max-height:88%}.sheet-head{display:flex;align-items:center;gap:12px;padding:8px 16px;border-bottom:1px solid var(--edge);flex-shrink:0}.sheet-head h2{font-size:13px}.sheet-close{width:28px;min-height:28px;padding:0;font-size:18px;color:var(--muted);border-radius:7px}.sheet-body{overflow:auto;padding:14px 20px 18px;min-height:0}@media(min-width:1024px){#details-sheet{position:fixed;z-index:60;top:var(--pop-top,64px);left:var(--pop-left,auto);width:min(560px,calc(100vw - 32px));max-height:min(72vh,640px);border:1px solid var(--edge);border-radius:12px}
/* The status word heads Under the hood (R1.5) on a row of its own, so the title and the reason are never cut. */
#details-sheet .sheet-head{flex-wrap:wrap}#details-sheet .sheet-head h2{white-space:nowrap}#details-sheet .sheet-head .status{order:3;flex:1 0 100%;max-width:none}#details-sheet .sheet-head .status small{max-width:100%}}.bottom-tabs{margin-left:auto}.bottom-tabs>div{display:flex;gap:6px}.bottom-tabs button{border-radius:7px;font-size:11px;color:var(--quiet);padding:4px 9px;min-height:26px}.bottom-tabs button[aria-pressed=true]{color:var(--text);background:var(--selected)}#problem-count{font-size:10px;padding:0 5px;border-radius:4px;background:var(--raised);color:var(--muted)}
.inspector{grid-area:card;background:var(--panel);border-left:1px solid var(--edge);overflow:auto;display:flex;flex-direction:column}
/* Contextual card: always docked as the card column (R1.3). */
.card-tools{margin-left:auto;display:flex;gap:2px;align-self:flex-start}.card-tools button{width:28px;min-height:28px;padding:0;color:var(--muted);border-radius:7px}.card-tools button[aria-pressed=true],.card-tools button[aria-expanded=true]{color:var(--accent);background:var(--selected)}.card-tools .icon{width:15px;height:15px}
.inspector .card-menu{right:0;width:190px}.card-actions{display:flex;gap:6px;position:sticky;bottom:0;z-index:1;margin:14px -14px 0;padding:10px 14px 12px;background:var(--panel);border-top:1px solid var(--edge)}.card-actions .apply-button{flex:1;margin:0}#revert-object{border:1px solid var(--edge);font-size:12px;color:var(--muted)}
.object-heading{display:flex;gap:10px;align-items:center;margin:12px 14px 10px}.object-heading>canvas{width:36px;height:32px;image-rendering:pixelated;object-fit:contain;padding:4px;background:#282632;border-radius:7px;box-sizing:content-box}.object-heading h2{font-size:14px;margin-bottom:2px}.object-heading span{font-size:11px;color:var(--quiet)}
#overview-content{padding:14px 14px 0}.overview-intro{display:flex;gap:10px;align-items:center;margin-bottom:12px}.overview-mark{display:flex;align-items:center;justify-content:center;width:30px;height:30px;border-radius:8px;background:#30283e;color:var(--accent);flex-shrink:0}.overview-intro h3{font-size:12px;margin-bottom:2px}.overview-intro p{font-size:11px;color:var(--quiet)}#rule-summary{display:flex;flex-direction:column;gap:8px}.rule-chip{min-width:0;display:flex;gap:8px;align-items:center;font-size:10px;color:var(--muted);border-left:2px solid #514164;padding-left:9px}.rule-chip strong{display:block;font-weight:500;color:#d1c6e9;font-size:11px}.rule-chip span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:block}.rule-chip>div{min-width:0}.rule-summary-more{align-self:flex-start;min-height:0;padding:2px 0 2px 11px;font-size:11px;color:var(--accent)}.rule-summary-more:hover{background:none;text-decoration:underline}
#properties{padding:0 14px}fieldset{padding:14px 0 2px;margin:0;border:0;border-bottom:1px solid #2b2b35}legend{float:left;width:100%;font-size:11px;font-weight:600;color:#d1d1df;margin-bottom:10px;padding:0}legend~*{clear:both}label{display:grid;gap:5px;font-size:11px;color:var(--muted);margin-bottom:10px}input,select,textarea{width:100%;border:1px solid #3e3e4b;border-radius:5px;padding:6px 9px;background:#23232d;color:var(--text);font-size:12px;min-height:30px}input:hover,select:hover,textarea:hover{border-color:#656576}.coordinates{display:grid;grid-template-columns:1fr 1fr;gap:10px}.coordinates label>span{display:flex;justify-content:space-between}.coordinates small{font-size:10px;color:var(--quiet)}.color-palette{display:grid;grid-template-columns:repeat(8,1fr);gap:4px;margin:0 0 12px}.swatch{padding:0;min-height:20px;height:20px;border:2px solid transparent;border-radius:4px;box-shadow:inset 0 0 0 1px #ffffff25}.swatch[aria-pressed=true]{outline:2px solid var(--accent);outline-offset:2px}.property-readout{display:flex;justify-content:space-between;gap:6px;font-size:11px;color:var(--quiet);margin:8px 0}.property-readout strong{font-weight:500;color:var(--muted);text-align:right}.apply-button{width:100%;margin:14px 0 0;background:#393144;color:#e2d7f4;border:1px solid #5a496d;font-size:12px}.apply-button:hover{background:#4c3b60}
.section-note{font-size:11px;line-height:1.7;color:var(--quiet)}#events-view{padding:0}.event-card{padding:14px 0;border-bottom:1px solid var(--edge)}.event-card h3{color:#d7c9f4;font-size:12px;margin-bottom:8px}.event-card ol{padding-left:18px;font-size:11px;color:var(--muted);margin:0}.event-card li{padding:3px 0}#report-content p,#problems-content p{font-size:12px;color:var(--muted);margin-bottom:10px}details summary{cursor:pointer;font-size:11px;color:var(--muted)}pre{font:11px/1.7 ui-monospace,SFMono-Regular,Consolas,monospace;white-space:pre-wrap;overflow-wrap:anywhere;color:var(--muted)}.message{color:var(--error);font-size:12px}.message:empty{display:none}#source-view{padding:16px 20px}#source-code{margin:0}
dialog{background:#22222b;border:1px solid #494453;border-radius:12px;padding:24px;color:var(--text);max-width:min(600px,90vw);box-shadow:0 24px 100px #0008}dialog::backdrop{background:#08080cb8;backdrop-filter:blur(5px)}.dialog-heading{display:flex;justify-content:space-between;gap:30px;margin-bottom:20px}.dialog-heading h2{font-size:20px;margin-top:4px}.dialog-heading button{font-size:24px}#asset-preview{image-rendering:pixelated;max-width:100%;background:#15151b;display:block;margin:20px auto}#asset-description{font-size:12px;color:var(--muted);margin:12px 0}
/* Companion: AI Builder composer, job state, proposal and guide. */
.companion{grid-area:companion;background:var(--panel);border-left:1px solid var(--edge);display:flex;flex-direction:column;overflow:hidden;min-width:0}/* Keep the heading and Activity disclosure outside the active task scroll area. */
.companion-body{display:flex;flex-direction:column;flex:1;min-height:0;overflow:hidden}.companion-top{flex:1 1 auto;min-height:0;overflow:auto;scroll-padding:12px}.rail{display:none;flex-direction:column;align-items:center;gap:12px;padding-top:10px}.rail button{width:36px;min-height:36px;padding:0;border-radius:9px;color:var(--muted)}.peeker{width:18px;height:18px;flex-shrink:0;display:block}.peeker.lg{width:28px;height:28px}.companion-head{flex-shrink:0;border-bottom:1px solid var(--edge);display:flex;align-items:center;gap:8px;padding:12px 14px 8px}.companion-head h2{font-size:13.5px;font-weight:600;line-height:1.1}.companion-head small{display:block;font-size:10.5px;color:var(--quiet);margin-top:2px}
.compose{padding:10px 14px 16px;display:flex;flex-direction:column;gap:10px;border-bottom:1px solid var(--edge);margin:0}
.compose-modes{display:flex;padding:3px;gap:3px;background:var(--base);border:1px solid var(--edge);border-radius:10px;margin-bottom:4px}
.compose-modes button{flex:1;min-width:0;min-height:34px;font-size:12px;background:transparent;border:0;color:var(--muted);border-radius:7px}
.compose-modes button[aria-pressed=true]{background:var(--selected);color:var(--text);box-shadow:inset 0 0 0 1px var(--accent);font-weight:600}
.compose .compose-label{font-size:14px;font-weight:600;color:var(--text);margin:0}
.compose textarea{width:100%;min-height:108px;font-size:13px;line-height:1.5;resize:vertical;padding:12px;background:var(--base);border:1px solid var(--edge);border-radius:10px}
.compose textarea:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
/* After New blank game the prompt is where Rastlet waits: an accent ring that breathes until the user types or leaves. */
.compose textarea.awaiting{border-color:var(--accent);box-shadow:0 0 0 4px color-mix(in srgb,var(--accent) 22%,transparent);animation:awaiting 1.6s ease-in-out 3}
@keyframes awaiting{50%{box-shadow:0 0 0 7px color-mix(in srgb,var(--accent) 10%,transparent)}}
@media (prefers-reduced-motion:reduce){.compose textarea.awaiting{animation:none}}
.compose p.ai-notice{font-size:11px;color:var(--quiet);margin:-2px 0 0}
.compose p{font-size:12px;color:var(--muted);line-height:1.5;margin:0}
.compose p.compose-hint{font-size:11.5px;color:var(--quiet)}
.compose p.compose-feedback{color:var(--error);font-size:11.5px;margin-top:8px}
.compose-actions{display:flex;flex-wrap:wrap;gap:8px}
/* The AI sparkle on every button that asks the AI (owner, 4 and 6 November 2026). */
.sparkle-button{display:inline-flex;align-items:center;justify-content:center;gap:7px}.sparkle-button .icon{width:15px;height:15px;stroke-width:1.8;flex-shrink:0}
.compose-actions button{flex:1 1 auto;min-height:38px;padding:8px 12px;font-size:12px;border-radius:8px;border:1px solid var(--edge)}
.compose .primary{border-radius:8px}
.compose .account-link{align-self:flex-start;margin:0}
.compose .chips{gap:5px}
/* Ideas (owner, 9 November 2026): one box under the send button. Its heading and ↻ (Other examples), the search, then
   the four example requests (full sentences, one per line, left aligned) or, under All ideas, every recipe that fits. */
.compose .ideas{display:flex;flex-direction:column;align-items:stretch;gap:6px;padding:8px;border:1px solid var(--edge);border-radius:10px;background:var(--panel)}
.compose .ideas[hidden],.compose .idea-picks[hidden]{display:none}
.compose .idea-picks{display:flex;flex-direction:column;gap:4px}
.compose .ideas-head{display:flex;align-items:center;gap:8px}
.compose .idea-button{display:block;width:100%;justify-content:flex-start;text-align:left;font-size:11.5px;line-height:1.4;padding:6px 10px;border-radius:8px;border:1px solid var(--edge);background:transparent;color:var(--muted);white-space:normal;cursor:pointer}
.compose .idea-button:hover,.compose .idea-button:focus-visible{color:var(--text);border-color:var(--edge-strong);background:var(--raised)}
.compose .idea-more{align-self:flex-start;padding:2px 0;font-size:11px;border:0;background:none;color:var(--accent);cursor:pointer;text-decoration:underline;text-underline-offset:2px}
/* Recipes (docs/plans/in-app-recipes.md): the full list inside Ideas. */
.compose .idea-other{margin-left:auto;padding:0 6px;font-size:14px;line-height:1.4;border:1px solid transparent;border-radius:6px;background:none;color:var(--muted);cursor:pointer}
.compose .idea-other:hover,.compose .idea-other:focus-visible{color:var(--text);border-color:var(--edge);background:var(--raised)}
.compose .ideas-title{margin:0;font-size:12.5px;font-weight:700;color:var(--text)}
.compose .recipes-panel{display:flex;flex-direction:column;gap:8px;max-height:min(52vh,460px);overflow:auto}
.compose .recipes-panel[hidden]{display:none}
/* New game's All ideas: each kind of game as a small heading over its ideas (game-ideas.mjs). */
#create-ideas-all{gap:4px}#create-ideas-all>*{flex-shrink:0}.compose .idea-kind{margin:6px 0 0;font-size:11px;font-weight:700;letter-spacing:.02em;color:var(--text)}.compose .idea-kind:first-child{margin-top:0}
.compose .recipe-search{width:100%;font-size:12px}
.compose .recipe-group h3{margin:4px 0;font-size:10.5px;font-weight:600;letter-spacing:.04em;text-transform:uppercase;color:var(--muted)}
.compose .recipe-item{border-top:1px solid var(--edge)}
.compose .recipe-item>summary{padding:6px 2px;font-size:12px;line-height:1.4;cursor:pointer;color:var(--text)}
.compose .recipe-item-body{display:flex;flex-direction:column;align-items:flex-start;gap:6px;padding:0 2px 10px;font-size:11.5px;line-height:1.5;color:var(--muted)}
.compose .recipe-say{margin:0;padding:6px 8px;border-radius:6px;background:var(--raised);color:var(--text)}
.compose .recipe-use{font-size:11.5px;padding:3px 12px;min-height:0;border:1px solid var(--accent);border-radius:6px;background:transparent;color:var(--accent);cursor:pointer}
.compose .recipe-use:hover,.compose .recipe-use:focus-visible{background:var(--accent);color:var(--accent-ink)}
.compose .recipe-label{margin:4px 0 0;font-weight:600;color:var(--text)}
.compose .recipe-steps{margin:0;padding-left:18px}
.compose .recipe-steps li{margin:2px 0}
.compose .recipe-control{display:inline;min-height:0;padding:0 5px;font-size:11px;line-height:1.5;border:1px solid var(--edge-strong);border-radius:5px;background:var(--raised);color:var(--text);cursor:pointer}
.compose .recipe-control:hover,.compose .recipe-control:focus-visible{border-color:var(--accent);color:var(--accent)}
.compose .recipe-ui{padding:0 4px;border:1px dashed var(--edge-strong);border-radius:5px;color:var(--text)}
.compose .recipe-guide{font-size:11px;color:var(--accent)}
.compose .recipe-empty{margin:0;font-size:11.5px;color:var(--muted)}
/* A control a recipe step points to: a ring that fades out. */
.recipe-spot{outline:3px solid var(--accent);outline-offset:2px;animation:recipe-spot 2.4s ease-out forwards}
@keyframes recipe-spot{0%,60%{outline-color:var(--accent)}100%{outline-color:transparent}}
@media(prefers-reduced-motion:reduce){.recipe-spot{animation:none}}
.compose .chip-button{font-size:11px}
.compose .ai-counter{padding-top:4px}

.thread{list-style:none;margin:0;padding:12px 14px 16px;display:flex;flex-direction:column;gap:10px}.turn{display:flex;gap:8px;align-items:flex-start}.turn.you{justify-content:flex-end}.turn.you .turn-body{max-width:88%;padding:8px 12px;border-radius:12px 12px 4px 12px;background:var(--selected);color:var(--text);font-size:12.5px;line-height:1.45}.turn.rastlet .peeker{width:18px;height:18px;flex-shrink:0;margin-top:3px}.turn.rastlet .turn-body{min-width:0;flex:1 1 auto;display:flex;flex-direction:column;gap:7px;font-size:12.5px;line-height:1.5;color:var(--muted)}.turn-body p{margin:0}.turn-lead{color:var(--text);font-weight:600}.turn-note{font-size:11px;color:var(--quiet)}.stale{color:#ffd27a}[data-theme=bright] .stale{color:#8a4b00}.unmet{margin:0;padding-left:16px;color:var(--text)}/* Focus on the active question; conversation history returns after choosing or changing the idea. */
.thread:has(.question-turn)>.turn:not(.question-turn){display:none}
/* Chat layout (owner, 11 November 2026): with a conversation, the thread scrolls and the composer docks under it. */
.companion-top.chatting{display:flex;flex-direction:column;overflow:hidden}
.companion-top.chatting>*{flex:none}
.companion-top.chatting>.thread{flex:1 1 0;min-height:0;overflow:auto;overscroll-behavior:contain}
.companion-top.chatting>.compose{flex:none;max-height:75%;overflow:auto;gap:8px;padding:10px 14px 12px;border-bottom:0;border-top:1px solid var(--edge)}
.chatting .compose .compose-label,.chatting .compose .compose-hint{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}
.chatting .compose-modes{margin-bottom:0;order:-2}.chatting .compose-modes button{min-height:28px}
.chatting .compose textarea{min-height:0;height:52px;max-height:160px;resize:none;padding:8px 10px}
.chatting .compose:not(.ideas-open) .ideas{display:none}.chatting .compose .ideas{order:-1}.chatting .compose .recipes-panel{max-height:min(36vh,320px)}
.compose-foot{display:flex;align-items:center;gap:8px}.compose-foot .ai-notice{flex:1;min-width:0}
.compose .ideas-toggle{display:none;min-height:0;padding:2px 9px;font-size:11px;border:1px solid var(--edge);border-radius:6px;color:var(--muted)}
.chatting .compose .ideas-toggle:not([hidden]){display:inline-flex}.compose .ideas-toggle[aria-expanded=true]{color:var(--text);border-color:var(--accent)}
/* A single, scoped choice card avoids the global full-width text-input rules. */
.turn.question-turn{display:block;max-width:560px;width:100%;margin-inline:auto}
.turn.question-turn>.peeker{display:none}
.turn.rastlet .turn-body.question-flow{gap:8px;color:var(--text)}
.question-intro{display:flex;flex-direction:column;gap:6px}
.question-intro>.turn-lead{font-size:15px}
.create-summary{font-size:11.5px;color:var(--muted)}
.create-summary>summary{padding:6px 0;cursor:pointer;color:var(--muted);line-height:1.5}
.create-summary .brief-words{margin:6px 0 8px;padding-left:18px;line-height:1.6}
.create-limits{padding:8px 10px;border-left:2px solid var(--amber);background:var(--base);font-size:11.5px}
.create-limits .unmet{margin:4px 0 0;padding-left:16px}
.question-navigation{display:flex;justify-content:space-between;align-items:center;gap:8px;border-top:1px solid var(--edge);padding-top:10px}
.question-navigation button{min-height:30px;font-size:12px;padding:4px 10px;border:1px solid var(--edge)}
.question-progress{font-size:11px;color:var(--muted)}
.question-flow .create-question{display:flex;flex-direction:column;gap:7px;border:0;padding:0;margin:0;min-width:0}
.create-question legend{float:none;width:auto;padding:0;margin:0 0 8px;font-size:13px;font-weight:600;line-height:1.45;color:var(--text);max-width:100%}
.create-question legend:focus{outline:none}
.create-question .create-option{clear:none;display:flex;align-items:center;gap:9px;min-height:38px;padding:8px 10px;margin:0;border:1px solid var(--edge);border-radius:8px;background:var(--base);font-size:12px;line-height:1.4;color:var(--muted);cursor:pointer}
.create-question .create-option:has(:checked){background:var(--selected);border-color:var(--accent);color:var(--text)}
.create-question .create-option:focus-within{outline:2px solid var(--accent);outline-offset:2px}
.create-question input[type=radio]{appearance:auto;flex:0 0 16px;width:16px;height:16px;min-height:16px;max-width:16px;padding:0;margin:0;accent-color:var(--accent)}
.create-option span{min-width:0;overflow-wrap:anywhere}
.create-looks .scenery-cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(130px,1fr));gap:8px}
.create-looks .scenery-card{position:relative;flex-direction:column;align-items:stretch;gap:6px;padding:6px}
.create-looks .scenery-card input[type=radio]{position:absolute;opacity:0;pointer-events:none}
.create-looks .scenery-card img{display:block;width:100%;height:auto;aspect-ratio:5/4;image-rendering:pixelated;border-radius:4px;background:#000}
.create-looks .scenery-card span{text-align:center}
.question-dock{flex:0 0 auto;display:flex;flex-direction:column;gap:8px;padding:10px 14px;border-top:1px solid var(--edge);background:var(--panel)}
.question-dock .question-navigation{padding:0;border:0}
.question-dock .turn-note{font-size:10.5px;line-height:1.4;color:var(--quiet)}
.question-dock .actions{display:flex;gap:8px}
.question-dock .actions button{min-height:36px;height:auto;flex:1;padding:7px 9px;white-space:normal;font-size:12px;border:1px solid var(--edge);border-radius:7px}
.idea-quote{margin:0 0 4px;overflow-wrap:anywhere}

.turn-body h4{display:flex;align-items:center;gap:7px;overflow-wrap:anywhere}.turn-body .steps{display:flex;flex-direction:column;gap:3px;font-size:11.5px;color:var(--quiet);margin:0;padding:0;list-style:none}.turn-body .steps li{display:flex;align-items:center;gap:7px}.turn-body .steps li.done{color:var(--muted)}.turn-body .steps li.now{color:var(--text);font-weight:600}.turn-body .steps li.stopped{color:var(--error)}.turn-body .steps .mark{width:12px;height:12px;display:grid;place-items:center;flex-shrink:0}.turn-body .steps .mark .icon{width:12px;height:12px}.turn-body .steps .mark .dot{width:7px;height:7px;border-radius:50%;background:var(--accent)}.turn-body .meta{font-size:11px;color:var(--quiet);display:flex;justify-content:space-between;gap:8px;flex-wrap:wrap}.turn-body .evidence{display:flex;flex-direction:column;gap:4px;font-size:11.5px}.turn-body .evidence span{display:flex;align-items:center;gap:6px}.turn-body .evidence .dot{width:7px;height:7px;border-radius:50%;background:var(--green);flex-shrink:0}.turn-body .actions{display:flex;flex-wrap:wrap;gap:6px}.turn-body .actions button{height:28px;min-height:28px;padding:0 10px;font-size:12px;border:1px solid var(--edge);border-radius:7px;margin:0}.turn-body .actions .primary{border-color:transparent;height:30px;min-height:30px}.turn-body>p{font-size:12px;color:var(--muted);line-height:1.5}.turn-body .link{align-self:flex-start;padding:0;min-height:0;color:var(--accent);background:none;border:0;font-size:11px;text-decoration:underline;text-underline-offset:3px}.ccard .stale{color:var(--amber)}.proposal-changes{max-height:220px;overflow:auto;border:1px solid var(--edge);border-radius:8px;padding:10px 12px;margin:0;list-style:none;display:flex;flex-direction:column;gap:6px;font-size:12px;line-height:1.5}.proposal-changes li{overflow-wrap:anywhere}.proposal-changes button{min-height:0;padding:0 2px;font-size:12px}.proposal-changes>div:last-child{margin-bottom:0}
/* Proposal frame: the stage shows a checked proposal beside the current design until Apply or Discard. Pins sit in canvas percentages so they survive rescaling. */
.artboard{position:relative;flex-shrink:0}
/* Loading screen: centred on the stage at the size of the Play frame (screen plus border), beneath the menus so editing continues during a build. */
.stage{position:relative}.c64-loader{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);z-index:4;image-rendering:pixelated;transition:opacity .25s;box-shadow:0 0 0 100vmax var(--base)}.c64-loader.out{opacity:0}
.pickup-tag{position:absolute;z-index:4;transform:translate(-50%,calc(-100% - 6px));padding:3px 8px;border-radius:6px;border:1px solid var(--accent);background:var(--panel);color:var(--text);font-size:11px;font-weight:600;white-space:nowrap;pointer-events:none}.pickup-tag.below{transform:translate(-50%,6px)}#canvas.playing~.pickup-tag{display:none}

.artboard.proposal{margin-top:36px}
.proposal-ui{position:absolute;inset:0;pointer-events:none}
.proposal-frame{position:absolute;inset:-8px;border:2px dashed var(--accent);border-radius:6px}
.proposal-tag{position:absolute;top:var(--pin-top,-34px);left:-8px;display:inline-flex;align-items:center;gap:6px;height:24px;padding:0 10px;border-radius:999px;background:var(--accent);color:var(--accent-ink);font-size:11px;font-weight:600;white-space:nowrap}
.proposal-tag .peeker{width:14px;height:14px;filter:brightness(0) saturate(0)}
.proposal-ui .compare{position:absolute;top:var(--pin-top,-34px);right:-8px;display:flex;gap:2px;padding:2px;border:1px solid var(--edge);border-radius:999px;background:var(--panel);pointer-events:auto}
.compare button{height:20px;min-height:20px;padding:0 10px;border-radius:999px;font-size:11px;color:var(--muted);margin:0}
.compare button[aria-checked=true]{background:var(--accent);color:var(--accent-ink);font-weight:600}
.pin{position:absolute;width:20px;height:20px;border-radius:50%;background:var(--accent);color:var(--accent-ink);font-size:11px;font-weight:700;display:grid;place-items:center;box-shadow:0 0 0 2px var(--base);transform:translate(-50%,-50%)}
.tree-button .flag{position:absolute;top:5px;right:7px;width:7px;height:7px;border-radius:50%;background:var(--accent)}
/* Activity: manual edits, AI applies, builds, checks and backups in one list, newest first. */
/* Activity is a header button (owner, 11 November 2026) whose list drops over the panel, so it never competes with the docked composer. */
.companion-head{position:relative}.activity{flex:none;margin-left:auto}.activity:not([hidden])+.companion-close{margin-left:4px}
.activity>summary{list-style:none;padding:3px 9px;font-size:11.5px;font-weight:500;color:var(--muted);border:1px solid var(--edge);border-radius:7px;cursor:pointer}.activity>summary::-webkit-details-marker{display:none}
.activity>summary:hover,.activity[open]>summary{color:var(--text);border-color:var(--edge-strong);background:var(--raised)}
.activity ul{display:flex;flex-direction:column;list-style:none;margin:0;position:absolute;left:8px;right:8px;top:calc(100% + 4px);z-index:20;max-height:min(60vh,420px);overflow:auto;padding:4px 12px 8px;background:var(--panel);border:1px solid var(--edge-strong);border-radius:10px;box-shadow:var(--shadow)}

.activity li{display:flex;gap:9px;align-items:flex-start;padding:7px 0;border-top:1px solid var(--edge);font-size:12px;color:var(--text)}
.activity li:first-child{border-top:0}
.activity li .icon{width:14px;height:14px;margin-top:2px;color:var(--quiet);flex-shrink:0}
.activity li .peeker{width:14px;height:14px;margin-top:2px;flex-shrink:0}
.activity li div{flex:1;min-width:0;overflow-wrap:anywhere;line-height:1.4}
.activity li small{display:block;color:var(--quiet);font-size:10.5px}
.activity li button{min-height:0;padding:0;font-size:11px;color:var(--accent);background:none;border:0;text-decoration:underline;text-underline-offset:3px;margin:0}
.tweak{padding:10px 14px 4px;display:flex;flex-direction:column;gap:8px}.tweak-row{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.tweak-label{width:46px;font-size:11px;color:var(--muted);flex-shrink:0}.choice-group{display:flex;flex-wrap:wrap;gap:4px;flex:1 1 auto;min-width:0}.choice-group button{flex:1 1 0;min-height:30px;padding:0 8px;font-size:12px;border:1px solid var(--edge);border-radius:7px;color:var(--muted);background:var(--base)}.choice-group button[aria-pressed=true]{color:var(--text);background:var(--selected);border-color:var(--accent)}.tweak-actions{justify-content:space-between}#change-look{min-height:30px;padding:0 10px;font-size:12px;border:1px solid var(--edge);border-radius:7px;color:var(--accent)}.tweak-note{font-size:10.5px;color:var(--quiet);flex:1 1 140px}.fine-tune{margin:4px 0 0}.fine-tune>summary{display:flex;align-items:center;gap:8px;padding:8px 14px;font-size:11.5px;font-weight:600;color:var(--muted);cursor:pointer;list-style:none;border-top:1px solid var(--edge)}.fine-tune>summary::-webkit-details-marker{display:none}.fine-tune>summary::before{content:"";width:0;height:0;border:4px solid transparent;border-left:5px solid var(--quiet);margin-left:2px;transition:transform 120ms}.fine-tune[open]>summary::before{transform:rotate(90deg)}.fine-tune>summary{white-space:nowrap}.fine-tune>summary small{font-weight:400;color:var(--quiet);overflow:hidden;text-overflow:ellipsis;min-width:0}.rule-sentence{margin:0 0 6px;font-size:13px;line-height:1.8;color:var(--text)}.rule-sentence .word{display:inline;padding:1px 6px;border-radius:5px;border:1px solid var(--edge);background:var(--raised);color:var(--accent);font:inherit;font-size:12.5px;cursor:pointer;min-height:0;line-height:1.5}.rule-sentence .word:hover{border-color:var(--accent)}.rule-editor{margin-top:6px}.rule-ask{display:flex;gap:6px;margin-top:12px;padding-top:12px;border-top:1px solid var(--edge)}.rule-ask input{flex:1 1 auto;min-width:0;height:32px}/* Coach card (R1.4): the first game's four steps at the top of Rastlet's column; folds to its heading when done. */
.coach{margin:12px 14px 0;padding:8px 10px 10px;border:1px solid var(--edge);border-radius:10px;background:var(--base);font-size:12px;color:var(--muted)}.coach-head{display:flex;align-items:center;gap:4px}.coach-toggle{flex:1;justify-content:flex-start;gap:8px;min-height:28px;padding:2px 4px;color:var(--text);font-size:12px;font-weight:600}.coach-count{font-weight:400;color:var(--muted);font-variant-numeric:tabular-nums}.coach-toggle .icon{width:14px;height:14px;margin-left:auto;color:var(--muted);transition:transform .15s}.coach-toggle[aria-expanded=false] .icon{transform:rotate(-90deg)}.coach-more{width:28px;min-height:28px;padding:0;color:var(--muted)}.coach .coach-menu{right:0;width:180px}.coach-steps{display:flex;flex-direction:column;align-items:stretch;gap:4px;margin-top:6px}.coach-steps button{justify-content:flex-start;white-space:normal;text-align:left;font-size:12px;min-height:30px;padding:4px 9px;color:var(--accent);border:1px solid var(--edge);border-radius:7px}.coach-steps button.done{color:var(--green);border-color:transparent}.coach-steps button.done::before{content:"\2713";margin-right:2px}
@media (prefers-reduced-motion:reduce){.coach-toggle .icon{transition:none}}
.details-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:12px 24px;margin:0}.details-grid>div{display:flex;flex-direction:column;gap:5px;min-width:0}.details-grid dt{font-size:11px;font-weight:600;color:var(--quiet);text-transform:uppercase;letter-spacing:.04em}.details-grid dd{margin:0;display:flex;flex-wrap:wrap;align-items:center;gap:6px 10px;font-size:12px;color:var(--muted)}.details-grid #build-caption,.details-grid #play-caption{color:var(--text)}.detail-link{font-size:12px;min-height:26px;padding:3px 8px;color:var(--accent);border:1px solid var(--edge);border-radius:7px;text-decoration:none;display:inline-flex;align-items:center}.detail-link.flag{color:var(--error);border-color:var(--error)}#details-limits{column-gap:16px}.details-version{margin:0;font-size:12px;color:var(--muted);display:flex;gap:6px}.details-version .version-number{font-weight:650;color:var(--muted)}.statusline{font-size:11px;color:var(--quiet);padding:10px 14px;margin-top:auto;border-top:1px solid var(--edge);flex-shrink:0}
/* Appearance affects editor chrome only. The game and asset pixels retain their palette. */
.theme-switch{display:flex;gap:2px;padding:3px;border:1px solid var(--edge);border-radius:8px;background:var(--base);flex-shrink:0}
.theme-switch button{font-size:11px;gap:6px;min-height:24px;padding:2px 7px;color:var(--muted)}
.theme-switch .icon{width:14px;height:14px}
.theme-switch button[aria-pressed=true]{background:var(--selected);color:var(--accent)}
:root[data-theme=bright]{color-scheme:light;--base:#eeedf4;--panel:#faf9fc;--raised:#f0eef5;--edge:#d5d1df;--edge-strong:#bdb7cc;--text:#282334;--muted:#61596e;--quiet:#6d657a;--accent:#6944bc;--accent-ink:#ffffff;--selected:#e9e1f8;--green:#28744e;--amber:#8a5a00;--error:#ad2548;--shadow:0 18px 50px #2a1f5a22;--card-alpha:rgba(250,249,252,.97)}
[data-theme=bright] button:hover{background:#e4deef}
[data-theme=bright] .app-header{background:#fff}
[data-theme=bright] .primary{background:var(--accent);color:#fff}
[data-theme=bright] .primary:hover,[data-theme=bright] .pill.primary:hover{background:#58349f}
[data-theme=bright] .pill.primary small{color:#fff}
[data-theme=bright] .project-menu>div,[data-theme=bright] dialog{background:#fff}
[data-theme=bright] .project-menu summary,[data-theme=bright] .tree-button,[data-theme=bright] legend{color:var(--text)}
[data-theme=bright] .tree-button[aria-pressed=true]{color:#4d2b8c}
[data-theme=bright] fieldset{border-color:var(--edge)}
[data-theme=bright] .workspace{background-image:radial-gradient(#bdb5ca66 .65px,transparent .65px)}
[data-theme=bright] #canvas{box-shadow:0 12px 40px #37304c24,0 0 0 1px #4b405d38}
[data-theme=bright] .overview-mark{background:var(--selected)}
[data-theme=bright] .rule-chip{border-color:#b3a0d0}
[data-theme=bright] .rule-chip strong,[data-theme=bright] .event-card h3{color:#63438d}
[data-theme=bright] input,[data-theme=bright] select,[data-theme=bright] textarea{background:#fff;border-color:#92869f;color:var(--text)}
[data-theme=bright] input:hover,[data-theme=bright] select:hover,[data-theme=bright] textarea:hover{border-color:#6944bc}
[data-theme=bright] .apply-button{background:var(--selected);color:#4d2b8c;border-color:#ac97cb}
[data-theme=bright] .apply-button:hover{background:#ddcff1}
[data-theme=bright] .object-heading>canvas{background:var(--selected)}
[data-theme=bright] dialog{border-color:#b5a9c7;box-shadow:0 24px 100px #22163140}
[data-theme=bright] dialog::backdrop{background:#26203470}
[data-theme=bright] .theme-switch button[aria-pressed=true]{background:#fff;color:#5c38a3;box-shadow:0 1px 4px #38204c20}
[data-theme=bright] .turn.you .turn-body,[data-theme=bright] .coach,[data-theme=bright] .ai-allowance{background:#fff}
/* M3 authoring retains the approved palette and compact workspace chrome. */
.compact-recovery{display:none}
.authoring-row{display:flex;flex-wrap:wrap;align-items:center;gap:5px;margin:8px 0}
.authoring-row>*{min-width:0}.authoring-row button{font-size:10px;padding:4px 7px;min-height:27px;border:1px solid var(--edge)}
.authoring-row select{flex:1;min-width:95px}.authoring-row strong{color:var(--accent);font-size:12px}
#scene-properties{padding:14px 14px}#scene-properties h3{margin-bottom:14px}
#events-view .event-card{padding:12px 0}#events-view .event-card:first-child{padding-top:0}#events-view .authoring-row select{min-width:120px;width:100%}#event-list{max-width:720px}
.action-editor{padding:9px;margin:8px 0;border:1px solid var(--edge);border-radius:6px;background:var(--base);display:grid;gap:6px}.action-editor .authoring-row{margin:0}.action-editor input,.action-editor select{font-size:11px}
#events-view>.authoring-row{position:sticky;bottom:-18px;background:var(--panel);padding:8px 0;margin-bottom:0;border-top:1px solid var(--edge)}#events-view .apply-button{margin:0;width:auto}
#problem-links{display:flex;flex-direction:column;align-items:start;gap:6px}#problem-links button{white-space:normal;text-align:left;font-size:11px;color:var(--accent);padding:4px 0}
.history-entry{padding:12px 0;border-bottom:1px solid var(--edge)}.history-entry p{margin:0!important}#build-history{margin-top:4px}
#authoring-dialog,#replace-dialog{min-width:min(430px,85vw)}#authoring-dialog>button{display:flex;margin:8px 0;width:100%;border:1px solid var(--edge)}
dialog{max-height:85dvh;overflow:auto}dialog h2{font-size:18px}dialog p{margin:12px 0}#export-dialog{max-width:580px}#export-info{font-size:12px}
/* Pixel editor, redesigned 10 November 2026 (docs/plans/look-and-pixel-editor.md): rail, grid, pens; the footer always shows Apply. */#asset-dialog{width:min(1120px,96vw);height:min(800px,94vh);max-width:none;padding:0;overflow:hidden}#asset-dialog[open]{display:flex;flex-direction:column}#asset-dialog .pixel-head{display:flex;align-items:center;gap:10px;margin:0;padding:16px 22px 12px;border-bottom:1px solid var(--edge)}#asset-dialog .pixel-head>div:first-child{flex:1;min-width:0}#asset-dialog .pixel-head h2{margin:0;font-size:20px;line-height:1.25}#asset-dialog .pixel-head .section-note{margin:0}#asset-dialog .pixel-head #pixel-undo{font-size:13px;min-height:38px;padding:0 14px;border:1px solid var(--edge-strong);border-radius:8px}.asset-body{flex:1;min-height:0;display:grid;grid-template-columns:200px minmax(0,1fr) 264px}#asset-dialog.symbols .asset-body{grid-template-columns:220px minmax(0,1fr)}.asset-panel{display:flex;flex-direction:column;gap:10px;min-width:0;min-height:0;padding:14px 16px}.asset-panel[hidden],.asset-panel [hidden]{display:none}.pixel-rail{border-right:1px solid var(--edge);overflow-y:auto}.pixel-side{border-left:1px solid var(--edge);overflow-y:auto}.rail-head{font-size:12px;font-weight:600;color:var(--muted)}.pixel-rail .section-note,.pixel-side .section-note{margin:0;font-size:12px}.view-rail,.symbol-rail{display:flex;flex-direction:column;gap:8px}.pixel-views{display:flex;flex-direction:column;gap:6px}.view-tile{display:flex;align-items:center;gap:10px;min-height:64px;padding:6px 8px;border:2px solid transparent;border-radius:10px;background:transparent;color:var(--text);text-align:left}.view-tile:hover{border-color:var(--edge-strong)}.view-tile[aria-pressed=true]{background:var(--selected);border-color:var(--accent)}.view-tile canvas{width:48px;height:42px;flex-shrink:0;border-radius:6px;image-rendering:pixelated;outline:1px dashed var(--edge-strong);outline-offset:-1px}.view-text{display:flex;flex-direction:column;min-width:0;overflow:hidden}.view-text strong{font-size:13px}.view-text small{font-size:11.5px;color:var(--quiet)}#glyph-sheet{display:block;width:100%;aspect-ratio:1;image-rendering:pixelated;border-radius:4px;cursor:crosshair}.glyph-list{width:100%;height:180px;padding:4px;margin:0}.pixel-centre{flex-direction:row;gap:14px;padding:12px 18px}.pixel-main{flex:1;min-width:0;min-height:0;display:flex;flex-direction:column;gap:10px}
/* The tools, an icon strip beside the grid (owner, 11 November 2026): one column, two when the window is short. Each name shows beside its button on hover or keyboard focus. */
.pixel-strip{--strip-cols:1;display:flex;flex-direction:column;gap:6px;flex-shrink:0}.strip-group{display:grid;grid-template-columns:repeat(var(--strip-cols),34px);gap:4px}.strip-group+.strip-group{padding-top:6px;border-top:1px solid var(--edge)}.strip-end{margin-top:auto}
.strip-tool{position:relative;display:flex;align-items:center;justify-content:center;width:34px;height:34px;min-height:0;padding:0;border:1px solid transparent;border-radius:8px;background:transparent;color:var(--text)}.strip-tool .icon{width:19px;height:19px}.strip-tool:hover{border-color:var(--edge-strong);background:var(--raised)}.strip-tool[aria-pressed=true]{background:var(--accent);border-color:var(--accent);color:var(--accent-ink)}
.strip-tool:disabled{opacity:1;border-color:transparent;background:transparent}.strip-tool:disabled .icon,.strip-select.off .icon{opacity:.35}
.strip-tool::after{content:attr(data-tip);position:absolute;left:calc(100% + 8px);top:50%;transform:translateY(-50%);z-index:5;padding:5px 9px;border-radius:6px;background:var(--text);color:var(--base);font-size:12px;font-weight:500;line-height:1.3;white-space:nowrap;pointer-events:none;opacity:0;visibility:hidden}.strip-tool:hover::after,.strip-tool:focus-visible::after,.strip-select:focus-within::after{opacity:1;visibility:visible;transition:opacity .1s .15s}
.strip-select select{position:absolute;inset:0;width:100%;height:100%;min-height:0;margin:0;padding:0;border:0;opacity:0;cursor:pointer}.strip-select select:disabled{cursor:default}.strip-select:focus-within{outline:2px solid var(--accent);outline-offset:3px}
@media (max-height:680px){.pixel-strip{--strip-cols:2}}
.start-row{display:flex;gap:8px}.start-row .start-from{min-height:36px;padding:0 12px;font-size:13px;border:1px solid var(--accent);border-radius:8px;background:var(--selected);color:var(--text)}.pixel-stage{flex:1;min-height:0;display:flex;align-items:center;justify-content:center}#pixel-canvas{display:block;width:auto;height:auto;max-width:100%;max-height:100%;image-rendering:pixelated;touch-action:none;border-radius:4px;cursor:crosshair}#pixel-canvas[aria-disabled=true]{opacity:.55}.frame-row{display:flex;flex-wrap:wrap;align-items:center;gap:8px}.frame-row-gap{flex:1}.frame-strip{display:flex;align-items:center;gap:8px}.frame-thumb{position:relative;display:flex;padding:3px;border:2px solid transparent;border-radius:8px;background:transparent}.frame-thumb[aria-pressed=true]{border-color:var(--accent)}.frame-thumb canvas{width:48px;height:42px;border-radius:5px;image-rendering:pixelated}.frame-thumb span{position:absolute;left:6px;bottom:3px;font-size:10.5px;color:#fff;text-shadow:0 1px 2px #000}.frame-add{width:54px;height:52px;min-height:0;border:1px dashed var(--edge-strong);border-radius:8px;background:transparent;color:var(--muted);font-size:22px}.pixel-pens{display:flex;flex-direction:column;gap:6px}.pen-row{display:flex;align-items:center;gap:6px;padding:4px 6px;border:2px solid transparent;border-radius:10px;background:var(--raised)}.pen-row.on{border-color:var(--accent);background:var(--selected)}.pen{flex:1;min-width:0;display:flex;align-items:center;gap:10px;min-height:44px;padding:0;border:0;background:transparent;color:var(--text);text-align:left}.pen-swatch{width:30px;height:30px;flex-shrink:0;border-radius:7px;box-shadow:inset 0 0 0 1px #ffffff40}.pen-text{display:flex;flex-direction:column;min-width:0;overflow:hidden}.pen-text strong,.pen-text small{white-space:normal;line-height:1.3}.pen-text strong{font-size:13px}.pen-text small{font-size:11.5px;color:var(--quiet)}.pen-change{min-height:28px;padding:0 8px;font-size:12px;border:1px solid var(--edge-strong);border-radius:6px}.pen-palette{display:grid;grid-template-columns:repeat(8,minmax(0,1fr));gap:4px;padding:8px;border-radius:8px;background:var(--base)}.pen-palette .swatch{width:auto;min-width:0;height:24px;min-height:0;padding:0;border-radius:5px;border:2px solid transparent}.pen-palette .swatch[aria-pressed=true]{border-color:#fff}.animation-stage{display:flex;align-items:center;justify-content:center;gap:24px;min-height:140px;border-radius:10px;background:var(--base)}#animation-preview{display:block;width:96px;height:84px;image-rendering:pixelated;border-radius:6px}#game-preview{display:block;width:48px;height:42px;image-rendering:pixelated;border-radius:4px}.asset-footer{display:flex;align-items:center;gap:12px;padding:12px 22px;border-top:1px solid var(--edge);background:var(--raised)}.pixel-foot-text{flex:1;min-width:0}.pixel-foot-text p{margin:0}#pixel-status{font-size:12.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#pixel-hint{font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.asset-footer #asset-error{margin:0}.asset-footer>button{min-height:42px;padding:0 16px;font-size:13px}.asset-footer .secondary{border:1px solid var(--edge-strong);border-radius:8px}.asset-footer .apply-button{width:auto;min-width:110px;margin:0;background:var(--accent);color:var(--accent-ink);border-color:var(--accent);font-weight:600}.asset-footer .apply-button:disabled{background:var(--edge);color:var(--quiet)}@media (max-width:820px){.asset-body{grid-template-columns:minmax(0,1fr);overflow-y:auto}.pixel-rail,.pixel-side{border:0}.pixel-stage{min-height:300px}}#asset-sharing{margin:4px 0 0;contain:inline-size}/* Hero views in the pixel editor (9 November 2026): tabs, then copy, mirror and flip; the turn previews under the animation. */
#pixel-status{flex:1;min-width:0;contain:inline-size;margin:0;font-size:11px}#asset-error:empty{display:none}@media(max-width:760px){}
/* The tile editor (docs/plans/tile-editor.md, 15 November 2026): the pixel editor's frame for a tile drawn whole in the game's colors. */
#tile-dialog{width:min(1040px,96vw);height:min(760px,94vh);max-width:none;padding:0;overflow:hidden}#tile-dialog[open]{display:flex;flex-direction:column}#tile-dialog .pixel-head{display:flex;align-items:center;gap:10px;margin:0;padding:16px 22px 12px;border-bottom:1px solid var(--edge)}#tile-dialog .pixel-head>div:first-child{flex:1;min-width:0}#tile-dialog .pixel-head h2{margin:0;font-size:20px;line-height:1.25}#tile-dialog .pixel-head .section-note{margin:0}#tile-dialog .pixel-head #tile-undo{font-size:13px;min-height:38px;padding:0 14px;border:1px solid var(--edge-strong);border-radius:8px}
#tile-dialog .pen,#tile-dialog .view-tile{justify-content:flex-start}#tile-dialog .view-text small{white-space:normal;line-height:1.3}#tile-dialog .view-tile canvas{width:40px;height:40px;object-fit:contain;outline:0;background:transparent}#tile-canvas{display:block;width:auto;height:auto;max-width:100%;max-height:100%;image-rendering:pixelated;touch-action:none;border-radius:4px;cursor:crosshair}
.tile-previews{display:flex;align-items:center;justify-content:center;gap:24px;min-height:150px;border-radius:10px;background:var(--base)}.tile-previews canvas{display:block;image-rendering:pixelated;border-radius:3px}
/* A field game's tile (21 November 2026): every symbol in the rail, the tile's color and wall on the right. */@media (min-width:821px){#tile-dialog.field .asset-body{grid-template-columns:248px minmax(0,1fr) 264px}}#tile-dialog.field .pixel-rail{overflow:hidden}#tile-dialog.field #tile-list{flex:1 1 0;min-height:110px;overflow-y:auto;padding-right:2px}#tile-dialog.field .view-tile{min-height:52px}.tile-sheet,.tile-field{display:flex;flex-direction:column;gap:8px}.tile-sheet{flex:none;margin-top:6px}#tile-symbols{display:block;width:100%;height:auto;aspect-ratio:256/240;image-rendering:pixelated;border-radius:4px;cursor:pointer}#tile-dialog .world-toggle{margin-top:4px}#tile-wall-note{margin:0}.world-more{align-self:flex-start;margin-top:6px;min-height:34px;padding:0 12px;font-size:12.5px;border:1px solid var(--edge-strong);border-radius:8px}
#tile-status{font-size:12.5px;margin:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#tile-hint{font-size:12px;margin:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#tile-error{margin:0}#tile-error:empty{display:none}

#canvas:fullscreen{width:100vw!important;height:100vh!important;object-fit:contain;background:#000}
.budget-details{margin:10px 0}.budget-details pre{max-height:240px;overflow:auto}
.focus-navigation{display:none}.has-problem{border-color:#dc6079!important;box-shadow:inset 3px 0 #dc6079}
/* Companion rail: hidden by the toggle at the reference width, the default on compact desktops. */
body.companion-rail main{--companion-col:56px}body.companion-rail .companion-body{display:none}body.companion-rail .rail{display:flex}
@media(min-width:1024px) and (max-width:1599px){.pill small{max-width:120px}.chip{max-width:150px}.project-menu summary{max-width:160px}.account-status{max-width:120px}.app-header{gap:8px}.app-header .brand .brand-logo{display:none}.app-header .brand .brand-icon{display:block}.app-header .brand{width:32px}}
@media(min-width:1024px) and (max-width:1279px){.app-header{gap:6px}.header-tools{gap:6px}.project-menu summary{max-width:120px}.chip{max-width:96px}.pill small{max-width:96px}.account-status{max-width:96px}main{--companion-col:56px}.companion{display:flex}body:not(.companion-rail) .companion{position:absolute;top:0;bottom:0;right:0;width:300px;z-index:8;box-shadow:var(--shadow)}body:not(.companion-rail) .rail{display:none}body.companion-rail .companion-body{display:none}body.companion-rail .rail{display:flex}.pill{min-width:0}.canvas-caption{font-size:10.5px}}
@media(min-width:1024px) and (max-width:1150px){.pill small{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}.pill{height:34px;min-height:34px;position:relative}.play-button{padding:0 14px}}
@media(max-width:1023px){main{display:flex;flex-direction:column;min-height:calc(100dvh - 56px);height:auto}.compact-recovery{display:block;padding:35px 24px}.compact-recovery h2{font-size:22px;margin-bottom:12px}.compact-recovery p{max-width:520px;color:var(--muted)}.chapters,.workspace,.inspector,.companion{display:none}.app-header{height:auto;min-height:56px;flex-wrap:wrap;padding:10px 12px;gap:8px}.brand{margin-right:0}.header-tools{margin-left:auto}.app-header #build,.app-header #export,.scene-row,.scene-bar{display:none}.project-menu button[id=new],.project-menu button[id=battery],.project-menu button[id=castle],.project-menu button[id=salvage],.file-button{display:none}}
@media(max-width:1023px){.focused-editor .compact-recovery{padding:8px 12px}.focused-editor .compact-recovery>h2,.focused-editor .compact-recovery>p,.focused-editor .compact-recovery>button:not(#focused-toggle){display:none}.focused-editor .focus-navigation{display:flex;gap:2px;flex-wrap:wrap}.focused-editor .focus-navigation button{flex:1;min-height:32px;border-radius:7px;font-size:12px;color:var(--muted);padding:0 6px}.focused-editor .focus-navigation button[aria-pressed=true]{background:var(--selected);color:var(--text);font-weight:600}.focused-editor .project-menu button[id=new],.focused-editor .project-menu button[id=battery],.focused-editor .project-menu button[id=castle],.focused-editor .project-menu button[id=salvage],.focused-editor .file-button{display:flex}.focused-editor .app-header #build{display:flex}.focused-editor .app-header #export{display:inline-flex}.focused-editor .pill{min-width:0;flex:1}
.focused-editor main[data-focus-panel=stage]>.workspace,.focused-editor main[data-focus-panel=rules]>.workspace,.focused-editor main[data-focus-panel=report]>.workspace{display:flex;min-height:560px;height:calc(100dvh - 190px)}.focused-editor main[data-focus-panel=rules] .canvas-area,.focused-editor main[data-focus-panel=report] .canvas-area{display:none}.focused-editor main[data-focus-panel=rules] .sheet,.focused-editor main[data-focus-panel=report] .sheet{position:static;max-height:none;flex:1;border-radius:0;box-shadow:none;border-top:0}.focused-editor main[data-focus-panel=stage] .sheet{display:none}
.focused-editor main[data-focus-panel=objects]>.chapters{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:center;border-right:0;padding:12px}.focused-editor main[data-focus-panel=objects] .chapter-hood{margin-top:0}
.focused-editor main[data-focus-panel=properties]>.inspector{display:flex;border-left:0}.focused-editor main[data-focus-panel=properties] #properties{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 20px}.focused-editor main[data-focus-panel=properties] #patrol,.focused-editor main[data-focus-panel=properties] #properties>.card-actions{grid-column:1 / -1}
.focused-editor main[data-focus-panel=builder]>.companion{display:flex;border-left:0;min-height:480px}.focused-editor main[data-focus-panel=builder] .rail{display:none}.focused-editor main[data-focus-panel=builder] .companion-body{display:flex}
.focused-editor .map-tools,.focused-editor .map-options{flex-wrap:wrap}.focused-editor .canvas-toolbar{height:auto;flex-wrap:wrap;padding:4px 8px;white-space:normal}.focused-editor .workspace{min-width:0}.focused-editor .canvas-caption{flex-wrap:wrap}}
/* Phones: the status pills take two rows, the panel buttons four columns, and the stage only the height of its canvas, so nothing is wider than the screen. */
@media(max-width:600px){.focused-editor .status{max-width:100%}.focused-editor .status small{max-width:100%}.focused-editor .focus-navigation{display:grid;grid-template-columns:repeat(4,minmax(0,1fr))}.focused-editor main[data-focus-panel=stage]>.workspace{height:auto;min-height:0}.focused-editor main[data-focus-panel=stage] .stage{flex:none;aspect-ratio:8/5}}
@media(max-width:1023px){.focused-editor #focused-toggle{min-height:28px;margin-bottom:6px;padding:4px 10px;font-size:12px;color:var(--muted);border-color:var(--edge)}}
@media(prefers-reduced-motion:reduce){*{transition:none!important;scroll-behavior:auto!important}button:active:not(:disabled){transform:none}}
/* M4 uses the same surface tokens in both approved themes. Account flows keep the dialog. */
.assistant-dialog{width:min(620px,90vw);max-height:85vh;overflow:auto;background:var(--panel,#171920);color:var(--text,#eee);border:1px solid var(--edge);border-radius:16px;padding:24px;box-shadow:0 24px 80px #0006}
.assistant-dialog::backdrop{background:#0008}.assistant-dialog h2{margin:0 0 20px}.assistant-dialog>button{position:absolute;right:20px;top:18px}.assistant-dialog p{line-height:1.6}.assistant-dialog input:not([type=checkbox]),.assistant-dialog textarea{box-sizing:border-box;width:100%;margin:6px 0 12px;padding:12px;border-radius:8px;background:var(--base);color:inherit;border:1px solid var(--edge);font:inherit}.assistant-dialog button{margin:8px 8px 8px 0;padding:9px 14px;border-radius:8px}.assistant-dialog label{display:block;line-height:1.5;font-size:12px}.assistant-status{color:var(--accent,#a99aff);min-height:24px}.assistant-dialog details{margin-top:24px} #backup{white-space:nowrap}
@media(max-width:700px){.app-header .saved-anchor{display:none}}
/* The header's Game space chip (Studio UX review, step 7): a quest's space meter, always in view; it opens Game health. */
.health-chip{display:inline-flex;align-items:center;gap:8px;min-height:28px;max-height:28px;max-width:none;background:none;font-weight:400;cursor:pointer;white-space:nowrap}.health-chip[hidden]{display:none}.health-chip:hover{color:var(--text);border-color:var(--edge-strong)}.health-chip .health-bar{width:44px;flex:none}.health-chip.near{border-color:var(--amber);color:var(--amber)}.health-chip.over{border-color:var(--error);color:var(--error)}
@media(max-width:1279px){.app-header .health-chip{display:none}}
/* Account and consent controls retain the workspace's dark/bright surface tokens. */
.account-status{max-width:110px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex-shrink:0}.account-verified{font-size:12px;color:var(--accent)}.account-link{display:inline-block;margin:14px 0;color:var(--accent)}
.account-page{display:grid;place-items:center;min-height:100dvh;height:auto;padding:24px}.account-card{width:min(440px,100%);padding:32px;background:var(--panel);border:1px solid var(--edge);border-radius:18px;box-shadow:0 20px 80px #0003}.account-card>img{width:44px;height:44px;margin-bottom:24px}.account-card h1{font-size:25px;margin-bottom:14px}.account-card p{line-height:1.6;color:var(--muted);margin:12px 0}.account-card label{display:block;margin:16px 0 6px}.account-card input{width:100%;padding:12px;margin:6px 0 12px}.account-card button{margin:12px 0}.account-card a{color:var(--accent)}.account-card [role=status]{color:var(--accent);overflow-wrap:anywhere}
.account-page>.account-card{display:block;min-height:0;height:auto;grid-template-columns:none}
/* Account menu, project backup menu and account dialog. */
.menu-anchor{position:relative;display:inline-flex}
.account-status{gap:8px;border:1px solid var(--edge);border-radius:999px;padding:2px 10px 2px 2px;max-width:160px;min-height:32px}
.account-status[data-signed-in=false]{padding:4px 12px}
.account-avatar{display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;flex:0 0 26px;border-radius:50%;background:var(--selected);color:var(--accent);font-weight:700}
.header-menu{position:absolute;top:calc(100% + 8px);z-index:50;width:290px;padding:6px;background:var(--panel);border:1px solid var(--edge);border-radius:12px;box-shadow:0 16px 40px #0007}
.account-menu{right:0}
.backup-menu{left:0}
.card-menu.from-strip{position:fixed;top:var(--menu-top);left:var(--menu-left);right:auto;width:190px}
/* Every row of a header menu sits on one grid: the same left edge, height, icon column and hover (21 November 2026). */
.header-menu [role=menuitem],.header-menu .menu-row{display:flex;align-items:center;gap:10px;width:100%;justify-content:flex-start;min-height:36px;margin:0;padding:6px 10px;border:0;border-radius:8px;color:var(--text);text-decoration:none;font-size:13px;font-weight:400;text-align:left}
.header-menu [role=menuitem]>.icon,.header-menu .menu-row>.icon{width:16px;height:16px;flex:0 0 16px;color:var(--muted)}
.header-menu [role=menuitem]:hover,.header-menu [role=menuitem]:focus-visible{background:#30303b}
.header-menu .menu-row .theme-switch{margin-left:auto}
.header-menu p{margin:6px 12px 8px;color:var(--muted);font-size:12px;line-height:1.5;white-space:normal}
/* The account card: avatar, name and plan, then the credits; it opens Credits and usage. */
.header-menu .menu-identity[role=menuitem]{display:grid;grid-template-columns:minmax(0,1fr);gap:10px;padding:10px;white-space:normal}
.menu-who{display:flex;align-items:center;gap:10px;min-width:0}.menu-who .account-avatar{width:32px;height:32px;flex-basis:32px}.menu-names{display:grid;gap:1px;min-width:0}.menu-names strong{font-size:13.5px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.menu-identity .account-verified{color:var(--muted)}.menu-identity .credit-meter{margin-top:0;width:100%}

.menu-separator{height:1px;margin:4px 0;background:var(--edge)}
.header-menu .menu-version{margin:4px 0 0;padding:8px 10px 4px;border-top:1px solid var(--edge);font-size:11px;color:var(--quiet);font-variant-numeric:tabular-nums}
.header-menu .menu-version .version-update[role=menuitem]{gap:6px;margin:0 -12px;width:calc(100% + 24px);color:var(--accent);font-weight:650}
.header-menu .menu-version .version-update .version-number{color:var(--accent)}
/* What's new beside the version is the link, the version itself is text (owner, 11 November 2026); a dot marks a release this device has not seen yet. */
.app-version .version-link{color:var(--accent);text-decoration:none;cursor:pointer}.app-version .version-link:hover,.app-version .version-link:focus-visible{text-decoration:underline}
.version-unseen .version-number::after{content:'';display:inline-block;width:6px;height:6px;margin-left:5px;border-radius:50%;background:var(--accent);vertical-align:middle}
.header-menu .menu-version:has(.version-link){display:flex;align-items:center;gap:6px;padding-top:4px}.header-menu .menu-version .version-link[role=menuitem]{align-items:center;width:auto;min-height:32px;margin:0 -8px 0 auto;padding:4px 8px;color:var(--muted);font-size:11px}
/* In the menu a New pill beside the link marks an unseen release, in place of the dot after the version. */
.header-menu .version-unseen .version-number::after{content:none}.header-menu .version-unseen .version-link::after{content:'New';margin-left:6px;padding:1px 6px;border-radius:999px;background:var(--selected);color:var(--accent);font-size:10px;font-weight:650}
:root[data-app-update] #account-status,:root[data-whats-new] #account-status{position:relative}
:root[data-app-update] #account-status::after,:root[data-whats-new] #account-status::after{content:'';position:absolute;top:3px;right:3px;width:7px;height:7px;border-radius:50%;background:var(--accent)}
.cloud-toast{position:fixed;left:50%;bottom:28px;transform:translateX(-50%);z-index:60;max-width:min(560px,calc(100vw - 32px));margin:0;padding:12px 16px;background:var(--raised);color:var(--text);border:1px solid var(--edge);border-radius:12px;box-shadow:0 12px 32px #0007}
.assistant-dialog .account-form{display:grid;gap:4px;margin:8px 0}
.assistant-dialog .account-form small{color:var(--quiet);margin:-8px 0 8px}
.assistant-dialog .account-form label>span{display:block;font-size:13px;color:var(--text)}
.assistant-dialog .account-check{display:flex;align-items:center;gap:10px;margin:4px 0 8px}
.assistant-dialog .account-check input{appearance:auto;width:18px;height:18px;margin:0;accent-color:var(--accent)}
.assistant-dialog .account-link{margin:4px 0;padding:6px 0;border:0;color:var(--accent);background:none}
.assistant-dialog .account-note{color:var(--quiet);font-size:12px}
.account-section{padding:16px 0;border-top:1px solid var(--edge)}
.account-section:first-child{border-top:0;padding-top:0}
.account-section h3{margin:0 0 4px;font-size:12px;letter-spacing:.06em;text-transform:uppercase;color:var(--quiet)}
.account-section>p{margin:0 0 8px;color:var(--muted)}
.account-profile{display:grid;grid-template-columns:100px minmax(0,1fr);gap:8px 12px;margin:8px 0 0}
.account-profile dt{color:var(--muted)}
.account-profile dd{margin:0;overflow-wrap:anywhere}
.rom-list dt{align-self:center}.rom-list dd{display:flex;flex-wrap:wrap;align-items:center;gap:6px 8px}.rom-list .rom-name{flex:1 1 140px;min-width:0}.rom-list button{margin:0}
.danger-zone h3{color:#ff9a9a}
.danger-zone ul{margin:0 0 8px;padding-left:20px;line-height:1.6}
.assistant-dialog .danger{background:#5a1f27;color:#ffe1e1;border:1px solid #8c3440;font-weight:650}
.assistant-dialog .danger:hover{background:#6e2530}
[data-theme=bright] .header-menu{background:#fff;box-shadow:0 16px 40px #22163130}
[data-theme=bright] .header-menu [role=menuitem]:hover,[data-theme=bright] .header-menu [role=menuitem]:focus-visible{background:#e4deef}
[data-theme=bright] .danger-zone h3{color:#a3222f}
[data-theme=bright] .assistant-dialog .danger{background:#a3222f;color:#fff;border-color:#a3222f}
[data-theme=bright] .assistant-dialog .danger:hover{background:#861b26}
[data-theme=bright] .cloud-toast{background:#fff;box-shadow:0 12px 32px #22163130}
.undo-toast{bottom:112px}.undo-toast:not([hidden]){display:flex;align-items:center;gap:14px}.undo-toast button{flex-shrink:0;color:var(--accent);font-weight:650}
.removal-rules{margin:0 0 16px;padding-left:20px;line-height:1.5}
.assistant-dialog .account-actions{display:flex;justify-content:flex-end;flex-wrap:wrap;gap:8px;margin-top:4px}
.assistant-dialog .account-actions button{margin:0}
.assistant-dialog .secondary{border:1px solid var(--edge)}
.assistant-dialog .danger-outline{color:#ff9a9a;border-color:#6e2530}
[data-theme=bright] .assistant-dialog .danger-outline{color:#a3222f;border-color:#d9a3a9}
.splitter{position:absolute;top:0;bottom:0;width:9px;margin-right:-4px;z-index:6;cursor:col-resize;touch-action:none;outline:0}.splitter::after{content:'';position:absolute;top:0;bottom:0;left:3px;width:3px;border-radius:2px;background:transparent;transition:background .12s}.splitter:hover::after,.splitter:focus-visible::after,.splitter.dragging::after{background:var(--accent)}#card-splitter{right:calc(var(--companion-col) + var(--card-col))}#companion-splitter{right:var(--companion-col)}body.card-closed #card-splitter,body.companion-rail #companion-splitter,.focused-editor .splitter{display:none}body.resizing{cursor:col-resize;user-select:none}
@media(max-width:1279px){#companion-splitter{display:none}}@media(max-width:1023px){.splitter{display:none}}
/* Sound sheet (arcade-1.2.0): one header bar; a library column beside an editor whose titled sections share a
   four-column grid with 30px controls, so labels, inputs and hints align across sections and tabs. */
/* The Sound editor is a modal like the pixel editor: a fixed size so switching tabs never resizes it, with the
   heading, bar and footer fixed and the editor between them scrolling. */
#sound-dialog{width:min(1120px,94vw);height:min(860px,90dvh);max-width:none;max-height:none;padding:20px 24px;overflow:hidden}
#sound-dialog[open]{display:flex;flex-direction:column}
#sound-dialog .dialog-heading{margin-bottom:16px;align-items:flex-start;flex-shrink:0}
#sound-dialog .dialog-heading h2{margin:2px 0 0}
#sound-dialog .sound-note{margin:4px 0 0}
#sound-body{container-type:inline-size;flex:1;min-height:0;overflow:auto;padding-top:16px}
#sound-footer{flex-shrink:0}
#sound-dialog input,#sound-dialog select{height:30px;min-height:30px;padding:0 9px}
#sound-dialog input[type=checkbox]{width:16px;height:16px;min-height:0;padding:0;margin:0;accent-color:var(--accent);flex-shrink:0}
#sound-dialog button.secondary{border-color:var(--edge);font-size:12px}
#sound-dialog button.small{min-height:28px;padding:4px 10px}
#sound-dialog .icon-button{width:28px;min-height:28px;padding:0;color:var(--muted);font-size:13px}
.sound-bar{display:flex;align-items:center;gap:16px;flex-wrap:wrap;flex-shrink:0;padding-bottom:16px;border-bottom:1px solid var(--edge)}
.sound-tabs{display:flex;gap:2px;padding:3px;border:1px solid var(--edge);border-radius:9px;background:var(--base)}
.sound-tabs button{font-size:12px;min-height:28px;padding:4px 12px;color:var(--muted)}
.sound-tabs button[aria-pressed=true]{background:var(--selected);color:var(--text)}
.sound-meter{display:flex;flex-direction:column;gap:4px;flex:1 1 120px;max-width:220px;min-width:120px;font-size:11px;color:var(--muted);white-space:nowrap;font-variant-numeric:tabular-nums}
.sound-meter .meter-bar{display:block;height:4px;border-radius:2px;background:var(--raised);overflow:hidden}
.sound-meter .meter-bar span{display:block;height:100%;background:var(--accent)}
.sound-meter[data-over=true]{color:var(--error)}
.sound-meter[data-over=true] .meter-bar span{background:var(--error)}
.sound-row{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.sound-bar>.sound-meter{margin-left:auto}
/* Sound sheet (docs/plans/sound-editor.md): what plays on the left, the picker on the right; each side scrolls by itself. */
.sound-bar:empty{display:none}.sound-bar>.section-note{margin:0 -8px 0 0}
#sound-body.sound-sheet{display:grid;grid-template-columns:minmax(260px,340px) minmax(0,1fr);overflow:hidden;padding-top:0}
.slot-list{display:flex;flex-direction:column;gap:6px;min-height:0;overflow:auto;padding:14px 16px 14px 0;border-right:1px solid var(--edge)}
.slot-list h4{margin:8px 0 2px;font-size:11px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--muted)}.slot-list h4:first-child{margin-top:0}
.slot-row,.sound-tile{display:flex;align-items:center;gap:10px;padding:8px 10px;border:1px solid var(--edge);border-radius:10px;background:var(--base);min-width:0;flex-shrink:0}
.slot-row[data-selected=true],.sound-tile[data-now=true]{border-color:var(--accent);background:var(--selected)}
#sound-dialog .slot-pick{flex:1;min-width:0;min-height:40px;display:flex;flex-direction:column;align-items:flex-start;justify-content:center;gap:1px;padding:0;border:0;background:transparent;color:var(--text);text-align:left;font-size:13px;white-space:normal}
.slot-label{font-size:12px;color:var(--muted)}.slot-name{font-size:14px;font-weight:600}.slot-name.none{color:var(--muted);font-weight:500}
#sound-dialog .play-button{width:36px;height:36px;min-height:36px;flex-shrink:0;padding:0;border:1px solid var(--edge-strong);border-radius:50%;background:var(--raised);color:var(--accent)}
.play-button svg{width:12px;height:12px;fill:currentColor}.play-button .icon-stop,.play-button[data-playing=true] .icon-play{display:none}.play-button[data-playing=true] .icon-stop{display:inline}
#sound-dialog .play-button[data-playing=true]{border-color:var(--accent);background:var(--selected)}#sound-dialog .play-button:disabled{color:var(--quiet)}
.sound-picker{display:flex;flex-direction:column;gap:12px;min-width:0;min-height:0;padding:14px 0 0 20px}
.picker-head{display:flex;align-items:flex-end;gap:16px}.picker-title{flex:1;min-width:0}.picker-title h3{margin:0;font-size:16px;font-weight:700}.picker-title p{margin:2px 0 0}
#sound-dialog #sound-search{width:220px;height:36px;min-height:36px;border-radius:8px}
.picker-tools,.picker-chips{display:flex;flex-wrap:wrap;gap:6px}
#sound-dialog .picker-chips .chip-button{min-height:32px;padding:4px 14px;font-size:12px;border-color:var(--edge-strong);border-radius:999px;color:var(--muted)}
#sound-dialog .picker-chips .chip-button[aria-pressed=true]{color:var(--text);background:var(--selected);border-color:var(--accent)}
.tile-grid{flex:1;min-height:0;overflow:auto;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;align-content:start;padding:0 4px 14px 0}.tile-grid>p{grid-column:1/-1;margin:4px 0}.tile-grid>.tile-shelf{grid-column:1/-1;margin:6px 0 0;font-size:11px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--muted)}
/* A quest's room music in Sound (Studio UX review, step 5): a row a tune, a button to start another group, and a button a room while its rooms are chosen. */
.slot-add{width:100%;min-height:40px;margin:4px 0 2px;padding:0 12px;border:1px dashed var(--edge-strong);border-radius:10px;background:transparent;color:var(--accent);text-align:left;font-size:13px}.slot-add:hover{background:var(--raised)}
.room-chips{display:flex;flex-wrap:wrap;gap:6px;flex:1 1 100%}#sound-dialog .room-chips .chip-button{min-height:32px;padding:4px 12px;font-size:12px;border-color:var(--edge-strong);border-radius:999px}#sound-dialog .room-chips .chip-button[aria-pressed=true]{background:var(--selected);border-color:var(--accent);color:var(--text);font-weight:600}
/* Moments count and fill (UX polish, 18 November 2026). */
.moments-head{display:flex;align-items:baseline;gap:8px}.moments-count{font-weight:500;letter-spacing:0;text-transform:none;color:var(--muted)}
/* Story sounds in a quest's Sound (docs/plans/story-step-sound.md, step 4): an effect, then the steps that play it as links into Story. */
.story-sound-steps{display:flex;flex-wrap:wrap;gap:2px 10px}
#sound-dialog .story-sound-steps .link-button{min-height:24px;padding:0;border:0;background:transparent;color:var(--accent);font-size:12px;text-align:left;text-decoration:underline;text-underline-offset:2px}
/* Rows in place of cards (Studio UX review, step 5): play, name, what it is like, then Use or In use. One column, so what a sound is like reads in full. */
.tile-grid{grid-template-columns:minmax(0,1fr);gap:0}
.sound-tile{min-height:44px;padding:4px 8px 4px 4px;border:0;border-bottom:1px solid var(--edge);border-radius:0;background:transparent}
.sound-tile[data-now=true]{border-radius:8px;border-bottom-color:transparent}
.tile-text{flex:1;min-width:0;display:flex;align-items:baseline;gap:10px}.tile-name{flex:0 0 168px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.tile-desc{flex:1;min-width:0;font-size:12px;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sound-tile .badge{flex-shrink:0;margin:0;border:0;font-size:10.5px;font-weight:700;line-height:18px;padding:0 9px;border-radius:999px;background:var(--accent);color:var(--accent-ink)}
#sound-dialog .tile-pick{flex:0 0 auto;min-height:30px;padding:0 12px;border:1px solid var(--edge-strong);border-radius:8px;font-weight:600}
#sound-dialog .tile-pick:hover{border-color:var(--accent);background:var(--selected)}
#sound-dialog .sound-tile .play-button{border-color:transparent;background:transparent}.play-gap{width:36px;flex-shrink:0}#open-studio{margin:0}#sound-footer #sound-done{margin:0 0 0 auto;min-width:96px}
@container (max-width:520px){.tile-text{flex-direction:column;align-items:stretch;gap:0}.tile-name{flex:none}}
/* The now-playing bar: Stop, what is previewing, how far it is, and Use for the row in hand. */
.now-playing{display:flex;align-items:center;gap:12px;min-width:0}.now-playing[hidden],.now-bar[hidden],#now-use[hidden],.sound-unsaved[hidden]{display:none}
.now-text{margin:0;display:flex;flex-direction:column;line-height:1.3;min-width:0;max-width:260px}.now-text small{font-size:11px;color:var(--muted)}.now-text strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.now-bar{display:block;width:clamp(80px,22vw,280px);height:6px;border-radius:3px;background:var(--edge);overflow:hidden}.now-bar span{display:block;width:0;height:100%;border-radius:3px;background:var(--accent)}
#sound-footer .play-button[data-playing=true]{background:var(--accent);border-color:var(--accent);color:var(--accent-ink)}
#sound-footer #now-use{max-width:300px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sound-unsaved{margin:0;color:var(--error)}
#sound-footer{min-height:67px;box-sizing:border-box}
.sound-history{display:flex;gap:2px;margin-left:auto}#sound-dialog .dialog-heading .sound-history button{font-size:13px}
@media(max-width:760px){#sound-body.sound-sheet{grid-template-columns:1fr;grid-auto-rows:max-content;overflow:auto}.slot-list{overflow:visible;border-right:0;padding-right:0}.sound-picker{padding-left:0}.tile-grid{overflow:visible;flex:none}#sound-dialog .dialog-heading{gap:8px}.now-bar{display:none}}
/* Change look, redesigned 10 November 2026 (docs/plans/look-and-pixel-editor.md): head, one filter line, a scrolling grid of tiles, a bar to use the pick. */#look-dialog{width:min(1040px,96vw);height:min(780px,92vh);max-width:none;padding:0;overflow:hidden}#look-dialog[open]{display:flex;flex-direction:column}#look-dialog .look-head{display:flex;align-items:center;gap:14px;margin:0;padding:18px 22px 12px}#look-dialog .look-head #look-pixels{font-size:13px;min-height:40px;padding:0 14px;border:1px solid var(--edge-strong);border-radius:8px}.look-current{width:64px;height:56px;border-radius:10px;image-rendering:pixelated;flex-shrink:0}.look-title{flex:1;min-width:0;display:flex;flex-direction:column}.look-title h2{margin:0;font-size:20px;line-height:1.25}.look-title .section-note{margin:0}.look-ask{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin:0;padding:0 22px 12px;border-bottom:1px solid var(--edge)}.look-ask input{flex:1 1 220px;min-width:0;min-height:38px}#look-dialog .look-theme{display:flex;align-items:center;gap:6px;margin:0;font-size:12px;color:var(--muted)}.look-theme select{min-height:38px;font-weight:600}.look-roles{display:flex;padding:3px;border:1px solid var(--edge-strong);border-radius:8px}.look-roles button{min-height:30px;padding:0 12px;border:0;border-radius:6px;background:transparent;color:var(--muted)}.look-roles button[aria-pressed=true]{background:var(--accent);color:var(--accent-ink);font-weight:600}.look-motion{min-height:38px}.look-motion[aria-pressed=true]{background:var(--selected);border-color:var(--accent)}.look-meta{display:flex;flex-wrap:wrap;justify-content:space-between;gap:4px 12px;padding:10px 22px 6px}.look-meta p{margin:0}.look-grid{flex:1;min-height:0;overflow-y:auto;display:grid;grid-template-columns:repeat(auto-fill,minmax(136px,1fr));align-content:start;gap:12px;padding:4px 22px 16px}.look-card{display:flex;flex-direction:column;align-items:stretch;gap:2px;padding:6px 6px 8px;border:2px solid transparent;border-radius:12px;background:var(--raised);color:var(--text);text-align:left;cursor:pointer}.look-card:hover{border-color:var(--edge-strong)}.look-card[aria-pressed=true]{border-color:var(--accent);background:var(--selected)}.look-art{position:relative;display:flex}.look-card canvas{width:100%;height:auto;aspect-ratio:48/42;border-radius:8px;image-rendering:pixelated}.look-now{position:absolute;top:6px;left:6px;padding:0 7px;border-radius:99px;background:#141419d9;color:#eeeef3;font-size:11px}.look-card strong{font-size:12.5px;padding:6px 2px 0}.look-card small{font-size:11px;color:var(--quiet);padding:0 2px}.look-bar{display:flex;align-items:center;gap:14px;padding:12px 22px;border-top:1px solid var(--edge);background:var(--raised)}.look-bar canvas{width:58px;height:51px;border-radius:8px;image-rendering:pixelated;flex-shrink:0}.look-bar-text{flex:1;min-width:0;display:flex;flex-direction:column}.look-bar-text .section-note{margin:0}.look-bar button{min-height:42px;padding:0 16px;font-size:13px}.look-bar .secondary{border:1px solid var(--edge-strong);border-radius:8px;color:var(--text)}#use-look{width:auto;margin:0;background:var(--accent);color:var(--accent-ink);border-color:var(--accent);font-weight:600;font-size:13px}#use-look:disabled{background:var(--edge);color:var(--quiet);border-color:var(--edge)}@media (max-width:640px){.look-bar{flex-wrap:wrap}.look-bar-text{flex-basis:calc(100% - 72px)}}
.sound-columns{display:grid;grid-template-columns:200px minmax(0,1fr);gap:24px;align-items:start}
.sound-main{min-width:0;padding-left:24px;border-left:1px solid var(--edge)}
.sound-empty{padding:8px 0 0 24px;border-left:1px solid var(--edge);min-height:120px}
/* Library */
.sound-library-head{display:flex;align-items:baseline;justify-content:space-between;margin-bottom:6px}
.sound-library-head h3{font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.06em;color:var(--quiet)}
.sound-library-head span{font-size:11px;color:var(--quiet);font-variant-numeric:tabular-nums}
.sound-list{display:flex;flex-direction:column;gap:2px;margin:0 0 10px;max-height:260px;overflow:auto}
.sound-item{width:100%;display:flex;align-items:center;gap:6px;justify-content:flex-start;text-align:left;font-size:12px;min-height:30px;padding:4px 10px}
.sound-item[aria-pressed=true]{background:var(--selected);color:var(--text)}
.sound-line{display:flex;align-items:center;gap:2px}.sound-line .sound-item{flex:1;min-width:0}
.sound-menu{width:200px}.sound-menu [role=menuitem]{min-height:34px}
.sound-item .badge,.sound-title .badge{margin-left:auto;font-size:10px;color:var(--accent);border:1px solid var(--accent);border-radius:999px;padding:0 7px;line-height:16px}
.sound-library>.sound-row{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
.sound-library>.sound-row button{width:100%;padding:4px 6px}
/* Editor heading: what is being edited, with its preview controls on the right. */
.sound-editor-head{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;padding-bottom:14px;border-bottom:1px solid var(--edge)}
.sound-title{display:flex;align-items:baseline;gap:8px;min-width:0}
.sound-title small{font-size:11px;color:var(--quiet)}
.sound-title h3{font-size:15px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sound-title .badge{margin-left:2px}
.sound-transport{display:flex;align-items:center;gap:8px}
.sound-transport select{width:auto}
/* Sections and the shared grid */
.sound-section{padding:14px 0 16px;border-bottom:1px solid var(--edge)}
.sound-section:last-child{border-bottom:0;padding-bottom:4px}
.sound-section>h4{font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.06em;color:var(--quiet);margin:0 0 10px}
.sound-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px 14px;align-items:start}
.sound-grid>label{margin:0;align-content:start}
.sound-grid input,.sound-grid select{width:100%}
.sound-grid small{font-size:10.5px;line-height:1.4}
.sound-grid .span-2{grid-column:span 2}
.sound-check{display:flex;align-items:center;gap:8px;height:30px;font-size:12px;color:var(--text)}
.sound-warning{font-size:11px;line-height:1.5;color:var(--amber);margin:0;align-self:center}
.envelope{display:block;width:100%;height:60px;margin-top:12px;background:var(--raised);border-radius:6px}
/* Toolbars: a labelled select and compact actions on one line, with a quiet count at the end. */
.sound-toolbar{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-top:10px}
.sound-toolbar>.section-note{margin-left:auto;line-height:1.4}
.inline-field{display:flex;align-items:center;gap:8px;margin:0;font-size:11px;color:var(--muted)}
.inline-field select{width:auto}
.sound-section>.sound-toolbar:first-of-type{margin-top:0}
/* Order list */
.sound-order{display:flex;flex-wrap:wrap;gap:6px;list-style:none;padding:0;margin:0}
.sound-order li{display:flex;align-items:center;gap:6px;height:36px;padding:0 2px 0 10px;border:1px solid var(--edge);border-radius:8px;font-size:11px;color:var(--quiet)}
.sound-order li select{width:auto;height:26px;min-height:26px}
.sound-order li.loop{border-color:var(--edge-strong)}
.sound-order li.playing{border-color:var(--accent);background:var(--selected)}
.sound-order .loop-mark{color:var(--accent);font-size:13px}
.step-number{font-variant-numeric:tabular-nums;color:var(--quiet);font-size:11px}
/* Note entry: the entry settings on the shared grid, then the keyboard-free cell form. */
.sound-entry{margin:14px 0 12px}
/* Effect steps: a table with headers; every row uses the same columns. */
.effect-steps{list-style:none;padding:0;margin:0;display:grid;gap:6px}
.effect-step{display:grid;grid-template-columns:28px minmax(0,1.3fr) minmax(0,1fr) minmax(0,1fr) 96px;gap:10px;align-items:center}
.effect-step.head{margin-bottom:6px;font-size:10.5px;font-weight:600;color:var(--quiet)}
.effect-step .step-tools{display:flex;justify-content:flex-end;gap:2px}
.effect-step input,.effect-step select{width:100%}
/* Tracker */
.tracker{font:12px/1.55 ui-monospace,'SF Mono',Menlo,Consolas,monospace;border:1px solid var(--edge);border-radius:8px;max-height:360px;overflow:auto}
.tracker:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.tracker-row{display:grid;grid-template-columns:40px repeat(3,minmax(104px,1fr))}
.tracker-row.head{position:sticky;top:0;z-index:1;background:var(--raised);font:600 10.5px/2 'Avenir Next','Segoe UI',sans-serif;color:var(--muted)}
.tracker-row.head span{padding:0 8px}
.tracker-row.beat{background:var(--raised)}
.tracker-row.playing{background:var(--selected)}
.tracker .row-number{padding:0 8px 0 0;text-align:right;color:var(--quiet)}
.tracker .cell{padding:0 8px;white-space:nowrap;cursor:pointer;border-radius:3px}
.tracker .cell.empty{color:var(--quiet)}
.tracker .cell[aria-selected=true]{outline:2px solid var(--accent);outline-offset:-2px}
/* Narrow sheets: the library stacks above the editor and the grid halves. */
@container (max-width:960px){.library-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@container (max-width:720px){.sound-columns{grid-template-columns:minmax(0,1fr)}.sound-main,.sound-empty{padding-left:0;border-left:0}.sound-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.sound-list{max-height:140px}}
@media (max-width:1023px){.sound-columns{grid-template-columns:minmax(0,1fr)}.sound-main,.sound-empty{padding-left:0;border-left:0}.tracker-row{grid-template-columns:32px repeat(3,minmax(84px,1fr))}}
/* The C64 moment (ADR 033): a boot screen in the C64 colours beside how to load the game and Share a link. */
#export-dialog.c64-moment{max-width:none;width:min(980px,94vw);padding:24px 28px}
.c64-moment .dialog-heading h2{font-size:22px;margin:0}
.c64-body{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:28px;margin-top:16px}
.c64-boot{display:block;width:100%;height:auto;aspect-ratio:320/72;image-rendering:pixelated;border:14px solid #706deb;border-radius:4px;margin-bottom:16px}
.c64-moment #download-prg{width:100%;min-height:44px;font-size:15px}
.c64-moment h3{font-size:14px;margin:0 0 8px}
.c64-steps{margin:0 0 20px;padding-left:20px;display:flex;flex-direction:column;gap:8px}.c64-steps li span{display:block;color:var(--muted);font-size:12.5px}
.c64-share,.c64-copy{border-top:1px solid var(--edge);padding-top:16px}.c64-copy{margin-top:16px}.c64-share #share-url{width:100%;margin-bottom:8px;font-size:12.5px}
.c64-more{display:flex;gap:14px;align-items:center;margin-top:16px;padding-top:12px;border-top:1px solid var(--edge)}.c64-more .link{font-size:12px}
@media(max-width:760px){.c64-body{grid-template-columns:1fr}}
/* Plans (monetization phase 4): the plan page, plan actions beside refusals, and deleting a project from the library. */
.plan-status h3{font-size:15px;text-transform:none;letter-spacing:0;color:var(--text)}.plan-early{color:var(--text)}.plan-offer small,.account-section>small{display:block;margin-top:6px;color:var(--quiet)}.plan-action{height:24px;min-height:24px;padding:0 10px;margin:4px 0 0;font-size:12px}.authoring-row .danger{background:#5a1f27;color:#ffe1e1;border:1px solid #8c3440}[data-theme=bright] .authoring-row .danger{background:#a3222f;color:#fff;border-color:#a3222f}.library-open{flex:1 1 auto;text-align:left}
/* While Rastlet works on a request the edit controls rest; the note says why (app.mjs setAiBusy). */
.busy-note{display:none;margin:10px 14px 0;font-size:11.5px;line-height:1.5;color:var(--muted)}body.ai-busy .busy-note{display:block}#sound-dialog .busy-note{margin:6px 0 0}body.ai-busy :is(#tweak,#properties){opacity:.5}
/* Credits and usage: the menu meter, the account sheet tabs and the 90-day history (assistant.mjs usagePage). */
.credit-meter{display:grid;gap:4px;margin-top:8px}.credit-words{font-size:12px;color:var(--text)}.credit-next{font-size:11px;color:var(--quiet)}
.credit-bar{display:block;height:4px;border-radius:2px;background:var(--edge);overflow:hidden}.credit-bar>span{display:block;height:100%;background:var(--accent)}.credit-meter.low .credit-bar>span{background:var(--amber)}
.credit-meter.pending{visibility:hidden}
.usage-summary .credit-meter{margin:0 0 4px;max-width:320px}
.page-tabs{display:flex;flex-wrap:wrap;gap:4px;margin:0 0 12px}.page-tab{min-height:30px;padding:0 12px;font-size:12px;border:1px solid var(--edge);border-radius:7px;color:var(--muted);background:var(--base)}.page-tab[aria-pressed=true]{color:var(--text);background:var(--selected);border-color:var(--accent)}
.usage-list{list-style:none;margin:4px 0 8px;padding:0}.usage-row{display:grid;grid-template-columns:84px minmax(0,1fr) auto;gap:10px;align-items:baseline;padding:8px 0;border-bottom:1px solid var(--edge);font-size:12px}
.usage-day{color:var(--quiet)}.usage-words{display:grid;gap:2px;min-width:0}.usage-words strong{font-weight:500;color:var(--text);overflow-wrap:anywhere}.usage-words span{color:var(--muted);font-size:11px}
.usage-amount{font-variant-numeric:tabular-nums;color:var(--muted);white-space:nowrap}.usage-amount.plus{color:var(--green)}
.usage-history small{display:block;margin-top:8px;color:var(--quiet)}
@media (max-width:480px){.usage-row{grid-template-columns:minmax(0,1fr) auto}.usage-day{grid-column:1/-1}}

.assistant-dialog.wide{width:min(920px,94vw);max-width:none;max-height:94vh}
.usage-layout{display:grid;grid-template-columns:minmax(240px,5fr) minmax(0,7fr);gap:28px;align-items:start}.usage-layout>.account-section{border-top:0;padding-top:0}
.usage-history .usage-list{max-height:min(58vh,560px);overflow:auto;overscroll-behavior:contain;padding-right:6px}
@media (max-width:720px){.usage-layout{grid-template-columns:minmax(0,1fr)}.usage-history .usage-list{max-height:none}}
/* Needs a fix (docs/plans/budget-fix.md): the chip reads as an error, also while its sheet is open; one pulse on entering it. */
.status[data-state=bad],.status[data-state=bad][aria-expanded=true]{border-color:var(--error);background:color-mix(in srgb,var(--error) 16%,var(--raised))}.status[data-state=bad] strong{color:var(--error)}.status[data-state=bad] small{color:var(--text)}
.status[data-state=bad] .dot{width:13px;height:13px;display:inline-grid;place-items:center;background:var(--error)}.status[data-state=bad] .dot::after{content:"!";color:var(--base);font-size:9.5px;font-weight:800;line-height:1}
@media(prefers-reduced-motion:no-preference){.play-button.alert[data-state=bad]{animation:status-alert 1s ease-out 1}}@keyframes status-alert{0%{box-shadow:0 0 0 0 color-mix(in srgb,var(--error) 75%,transparent)}100%{box-shadow:0 0 0 12px transparent}}
.tree-button.over-budget{box-shadow:inset 0 0 0 2px var(--error)}
.budget-note{margin-top:10px;padding:10px 12px;border:1px solid var(--error);border-radius:8px;background:color-mix(in srgb,var(--error) 10%,transparent)}.budget-note p{margin:0 0 8px;color:var(--error);font-size:12px}.budget-note-actions{display:flex;gap:8px;flex-wrap:wrap}
.budget-help:not([hidden]){display:grid;gap:8px;margin:6px 0 12px;max-width:680px}.budget-actions{display:flex;flex-wrap:wrap;gap:8px;align-items:center}.budget-help p{margin:0;font-size:12.5px;line-height:1.5}.budget-help .section-note{font-size:11.5px}.budget-fixes{display:flex;flex-wrap:wrap;gap:8px;align-items:center}.budget-fixes p{flex-basis:100%}.budget-flagged summary{cursor:pointer;color:var(--muted);font-size:11.5px}.budget-flagged #problem-links{margin-top:6px}
/* Cards save each change; only a small Revert remains, beside a note that says so. */
.card-actions.saves-on-change{align-items:center;justify-content:space-between}.card-actions.saves-on-change .section-note{margin:0}
.small-revert{flex:none;width:auto;min-height:28px;padding:3px 10px;font-size:12px;border:1px solid var(--edge);color:var(--muted)}.small-revert:disabled{opacity:.45;cursor:default}
/* Rules, the moments board (docs/plans/rules-board.md): three numbered lanes of moment cards, a ⋯ menu per rule, one floating editor with
   tiles, templates, a docked foot and the Advanced forms. */
#rules-sheet{width:min(1120px,96vw);height:min(880px,92dvh);max-width:none;max-height:none;padding:0;overflow:hidden}#rules-sheet[open]{display:flex;flex-direction:column}#rules-sheet .sheet-head{padding:14px 20px}#rules-sheet .sheet-head h2{font-size:15px;margin-right:auto}.rules-dialog-tools{display:flex;gap:4px}.rules-dialog-tools button{font-size:12px;color:var(--muted)}#rules-sheet .sheet-body{flex:1}#rules-sheet .power-card{position:static;margin-bottom:14px;box-shadow:none}
#event-list{max-width:none;display:grid;grid-template-columns:minmax(190px,.85fr) minmax(0,2fr) minmax(210px,1.05fr);gap:14px;margin-top:12px;counter-reset:lane}
.rule-group{display:flex;flex-direction:column;gap:10px;min-width:0;padding:12px;background:var(--panel);border:1px solid var(--edge);border-radius:12px}
.rule-group>h3{display:flex;align-items:center;gap:8px;margin:0;font-size:11px;font-weight:700;letter-spacing:.07em;text-transform:uppercase;color:var(--muted);counter-increment:lane}
.rule-group>h3::before{content:counter(lane);display:flex;align-items:center;justify-content:center;width:20px;height:20px;border-radius:50%;background:var(--selected);color:var(--accent);letter-spacing:0}
.lane-cards{display:grid;grid-template-columns:minmax(0,1fr);gap:10px;align-items:start}.rule-group[data-group=play] .lane-cards{grid-template-columns:repeat(2,minmax(0,1fr))}.ghost-note{margin:0}
#event-list .moment,#event-list .moment:first-child{position:relative;display:flex;flex-direction:column;gap:8px;min-width:0;padding:12px;background:var(--raised);border:1px solid var(--edge);border-radius:10px}
#event-list .moment.ghost{background:none;border-style:dashed;border-color:var(--edge-strong)}#event-list .moment:has(#rule-popover){border-style:solid;border-color:var(--accent)}
.moment-head{display:flex;align-items:center;gap:8px;min-width:0}.event-card .moment-head{padding-right:26px}
.moment-icon{display:flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:7px;background:var(--selected);color:var(--accent);flex-shrink:0}.moment-icon .icon{width:15px;height:15px;color:inherit}
.moment .rule-sentence{display:flex;flex-direction:column;gap:6px;margin:0;line-height:1.35}
.moment-title{min-width:0;font-size:13.5px;font-weight:650;line-height:1.35;color:var(--text);text-align:left}.cap{display:inline-block;min-width:0}.cap::first-letter{text-transform:uppercase}
#event-list .word.moment-title{display:block;margin-left:-5px;padding:2px 4px;border:1px solid transparent;border-radius:6px;background:none;color:var(--text);font-size:13.5px;font-weight:650;line-height:1.35;white-space:normal}.ghost .moment-title{font-weight:500;color:var(--muted)}
#event-list .word.rule-part{display:flex;align-items:center;justify-content:flex-start;gap:7px;width:100%;min-height:34px;padding:4px 10px;border:1px solid var(--edge-strong);border-radius:8px;background:var(--panel);color:var(--text);font-size:13px;line-height:1.3;text-align:left;white-space:normal}
#event-list .word:hover{border-color:var(--accent)}#event-list .word[aria-expanded=true]{border-color:var(--accent);background:var(--selected)}
.rule-part .icon,.rule-tile .icon{width:15px;height:15px;color:var(--accent)}[data-kind=addScore]>.icon{color:var(--amber)}[data-kind=playSound]>.icon,[data-kind=playEffect]>.icon,[data-kind=playMusic]>.icon,[data-kind=stopMusic]>.icon{color:var(--green)}[data-kind=addLife]>.icon{color:var(--error)}
.rule-empty{font-size:12px;color:var(--muted)}
.moment-add{align-self:flex-start;gap:6px;min-height:32px;padding:0 10px;border:1px dashed var(--edge-strong);border-radius:8px;color:var(--muted);font-size:12.5px}.moment-add:hover,.moment-add[aria-expanded=true]{border-color:var(--accent);color:var(--text)}.moment-add .icon{width:14px;height:14px;color:inherit}
#event-list .moment>.menu-anchor{position:absolute;top:10px;right:6px}.rule-more{width:28px;min-height:28px;padding:0;flex-shrink:0;color:var(--muted)}.rule-menu{width:200px}
.rule-builtin{display:flex;align-items:flex-start;gap:6px;margin:0;font-size:11.5px;line-height:1.5;color:var(--muted)}.rule-builtin .icon{width:13px;height:13px;margin-top:2px;color:inherit}.rule-held{margin:0}
.add-rule-anchor{display:flex}#add-rule{flex:1;gap:6px;min-height:40px;border:1px dashed var(--edge-strong);border-radius:10px;color:var(--text);font-size:13px}#add-rule:hover{border-color:var(--accent)}#add-rule .icon{width:15px;height:15px;color:inherit}
.rule-popover{position:fixed;z-index:70;box-sizing:border-box;width:min(440px,calc(100vw - 16px));max-height:calc(100dvh - 16px);overflow:auto;padding:12px;border:1px solid var(--accent);border-radius:10px;background:var(--panel);box-shadow:var(--shadow)}
/* arcade-1.28.0: the game's values above the rules, and a rule's tests in its sentence. */
#event-list .rule-values{grid-column:1/-1}#events-view .value-row input[type=checkbox]{width:16px;height:16px;min-width:0;padding:0;margin:0}
.rule-values{margin:0 0 14px;padding:10px 12px;border:1px solid var(--edge);border-radius:10px;background:var(--panel)}.rule-values summary{cursor:pointer;font-weight:700;font-size:13px}.rule-values .section-note{margin:6px 0 8px}
.value-row{display:flex;flex-wrap:wrap;align-items:center;gap:8px 12px;padding:8px 0;border-top:1px solid var(--edge)}#events-view .value-row input[type=text]{width:140px;min-width:0}#events-view .value-row input[type=number]{width:64px;min-width:0}.value-row label{display:flex;align-items:center;gap:6px;font-size:12px;color:var(--muted)}
.value-token{font-family:ui-monospace,Menlo,monospace;font-size:11.5px;color:var(--muted);margin-left:auto}
.rule-popover h4{margin:0 0 8px;font-size:11px;font-weight:700;letter-spacing:.07em;text-transform:uppercase;color:var(--muted)}
.rule-tiles{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
.rule-tile{justify-content:flex-start;gap:7px;min-height:36px;padding:4px 9px;border:1px solid var(--edge);border-radius:8px;background:var(--raised);color:var(--text);font-size:12.5px;line-height:1.25;text-align:left;white-space:normal}.rule-tile:hover{border-color:var(--accent)}
.rule-tile[aria-pressed=true]{border-color:var(--accent);background:var(--selected);font-weight:650}.rule-tile[aria-disabled=true]{border-style:dashed;color:var(--quiet);cursor:help}.rule-tile[aria-disabled=true] .icon{color:var(--quiet)}
.rule-popover .authoring-row{flex-wrap:wrap;gap:8px;margin:10px 0 0}#events-view .rule-popover select,#events-view .rule-popover input{width:auto;min-width:120px;max-width:100%}.rule-popover label{display:flex;align-items:center;gap:6px;font-size:12px;color:var(--muted)}
.rule-popover .authoring-row button{min-height:30px;padding:4px 10px;font-size:12px}.rule-presets{display:flex;gap:4px}.rule-popover .rule-presets button{min-width:42px;min-height:30px;font-size:12px}.rule-presets button[aria-pressed=true]{border-color:var(--accent);background:var(--selected);color:var(--text)}.rule-tile-note{margin:8px 0 0}
.rules-foot{display:flex;align-items:center;gap:12px;flex-shrink:0;padding:12px 20px;border-top:1px solid var(--edge);background:var(--panel)}.rules-foot .rule-ask{flex:1;align-items:center;gap:10px;min-width:0;margin:0;padding:0;border:0}.rules-foot .rule-ask input{height:36px}
.rule-ask label{display:flex;align-items:center;gap:6px;font-size:12px;color:var(--muted);white-space:nowrap}.rule-ask button{min-height:36px;padding:0 14px;border:1px solid var(--accent);border-radius:8px;color:var(--accent);font-weight:650}
.rule-count{padding:2px 10px;border:1px solid var(--edge-strong);border-radius:999px;font-size:11.5px;color:var(--muted);white-space:nowrap}
@media (max-width:900px){#event-list{grid-template-columns:minmax(0,1fr)}.rule-ask label span{display:none}}
@media (max-width:520px){.rule-group[data-group=play] .lane-cards{grid-template-columns:minmax(0,1fr)}.rule-tiles{grid-template-columns:repeat(2,minmax(0,1fr))}.rule-count{display:none}}
.rule-templates{width:330px;max-width:calc(100vw - 32px)}.rule-templates,.rule-menu{z-index:80}.rule-templates [role=menuitem]{flex-direction:column;align-items:flex-start;gap:2px;white-space:normal;text-align:left}.rule-templates [role=menuitem] span{font-size:12px;color:var(--muted)}.rule-templates hr{border:0;border-top:1px solid var(--edge);margin:4px 0}
.rules-advanced{margin-top:8px}.rules-advanced summary{cursor:pointer;color:var(--accent);font-size:12px;width:max-content}.rules-advanced[open]{padding:4px 0 10px;border-bottom:1px solid var(--edge)}.rule-form{padding:12px 0;border-bottom:1px solid var(--edge)}.rule-form .authoring-row select{min-width:120px}
/* Start (R1.1): My games, Start from a game, Describe a game, in place of the Studio's main area. */
.start{min-height:calc(100dvh - 56px);padding:28px 32px 48px;background:var(--base);overflow:auto}.start>*{max-width:1180px;margin-left:auto;margin-right:auto}
body.starting .project-name,body.starting #build,body.starting #export{display:none}
.start-head{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}.start-head h1{margin:0;font-size:24px;outline:none}.start-head #start-close{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.start-tabs{display:flex;gap:4px;margin-top:18px;border-bottom:1px solid var(--edge);overflow-x:auto}.start-tabs [role=tab]{padding:10px 14px;border:0;border-bottom:2px solid transparent;border-radius:0;color:var(--muted);font-size:14px;white-space:nowrap;background:none}.start-tabs [role=tab][aria-selected=true]{color:var(--text);border-bottom-color:var(--accent);font-weight:650}
.start-status:empty{display:none}.start-status{margin-top:14px;color:var(--error);font-size:13px}
.start-view{padding-top:18px}.start-toolbar{display:flex;flex-wrap:wrap;gap:8px;justify-content:flex-end;margin-bottom:14px}.start-toolbar .file-button{width:auto;position:relative;align-items:center;padding:6px 12px;border:1px solid var(--edge);border-radius:8px;font-size:13px;margin:0;color:var(--text)}.start-toolbar #start-sort{font-size:13px}
/* At most four games a row (owner, 6 November 2026): a column is at least a quarter of the row, and at least 220px. */
.start-grid{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(auto-fill,minmax(max(220px,calc((100% - 54px)/4)),1fr));gap:18px}
.start-card{display:flex;flex-direction:column;padding:12px;background:var(--panel);border:1px solid var(--edge);border-radius:12px;min-width:0}.start-card img,.start-card .game-thumb{display:block;width:100%;height:auto;aspect-ratio:16/10;object-fit:cover;border-radius:8px;border:1px solid var(--edge);image-rendering:pixelated;background:#000}
.start-card h3{margin:12px 0 0;font-size:15px;overflow-wrap:anywhere}.start-card p{margin:6px 0 0;font-size:13px;line-height:1.5;color:var(--muted)}.starter-note{color:var(--accent)!important}
.game-meta{display:flex;flex-wrap:wrap;gap:4px 10px}.game-meta .game-open-tag{color:var(--accent)}
.start-card-actions{display:flex;gap:8px;align-items:center;margin-top:auto;padding-top:12px}.start-card-actions .primary{flex:1}.start-card-actions .game-more{width:36px;padding:0;justify-content:center;font-size:16px}.game-menu{right:0;bottom:calc(100% + 6px);top:auto;width:210px}
.start-idea{display:flex;flex-direction:column;gap:12px;max-width:680px}.start-idea label{font-size:16px;font-weight:650}.start-idea textarea{width:100%;font:inherit;font-size:14px;padding:10px 12px;border:1px solid var(--edge);border-radius:10px;background:var(--panel);color:var(--text);resize:vertical}
.starter-filter{display:flex;flex-wrap:wrap;gap:6px;margin:0 0 16px}.starter-filter button{min-height:32px;padding:5px 12px;border:1px solid var(--edge);border-radius:16px;font-size:12px;color:var(--text)}.starter-filter button:hover{border-color:var(--accent);color:var(--accent)}.starter-filter button[aria-pressed=true]{border-color:var(--accent);background:var(--accent);color:var(--accent-ink)}.start-grid>li[hidden]{display:none}
.start-idea .idea-chips{display:flex;flex-wrap:wrap;gap:6px}.start-idea .idea-chips button{min-height:32px;padding:5px 12px;border:1px solid var(--edge);border-radius:16px;font-size:12px;color:var(--text)}.start-idea .idea-chips button:hover{border-color:var(--accent);color:var(--accent)}
.start-credits{margin:0;font-size:12px;color:var(--quiet)}/* Build my game and the empty screen side by side, both always visible (owner, 6 November 2026). */
.start-idea #start-build{padding:0 18px}.start-build-row{display:flex;flex-wrap:wrap;align-items:center;gap:10px}.start-build-row>button{min-height:40px}.start-or{color:var(--muted);font-size:13px}.start-empty-note{margin:0}
.start-play{width:min(560px,calc(100vw - 32px));padding:16px}.start-play canvas{display:block;width:100%;height:auto;image-rendering:pixelated;background:#000;border-radius:6px}.start-play .dialog-heading{display:flex;justify-content:space-between;align-items:center;margin-bottom:10px}.start-play .dialog-heading h2{margin:0;font-size:16px}
#rename-dialog .rename-form{display:flex;flex-direction:column;gap:10px;margin-top:10px}#rename-dialog input{font:inherit;padding:8px 10px;border:1px solid var(--edge);border-radius:8px;background:var(--panel);color:var(--text)}
/* My games Select mode: a checkbox per card, picked cards outlined, Open and the menu hidden until Done. */
.start-toolbar{align-items:center}.start-picked{margin-right:auto;font-size:13px;color:var(--muted)}.start-toolbar #start-select,.start-toolbar #start-select-all{font-size:13px;border:1px solid var(--edge)}.start #start-select[aria-pressed=true]{border-color:var(--accent);color:var(--accent)}
.start-toolbar .danger{font-size:13px;padding:6px 12px;background:#5a1f27;color:#ffe1e1;border:1px solid #8c3440;border-radius:8px;font-weight:650}.start-toolbar .danger:disabled{opacity:.45;cursor:default}[data-theme=bright] .start-toolbar .danger{background:#a3222f;color:#fff;border-color:#a3222f}
.start.selecting .game-card .start-card-actions{display:none}.start.selecting .game-card{position:relative;cursor:pointer}.start.selecting .game-card:has(input:disabled){cursor:default;opacity:.6}
.game-pick{position:absolute;top:18px;left:18px;z-index:1;display:flex;padding:4px;border-radius:6px;background:var(--panel)}.game-pick input{width:20px;height:20px;margin:0;accent-color:var(--accent);cursor:pointer}
.start.selecting .game-card.picked{border-color:var(--accent);box-shadow:0 0 0 1px var(--accent)}
@media(max-width:700px){.start{padding:18px 16px 40px}.start-grid{grid-template-columns:1fr 1fr;gap:12px}}
@media(max-width:440px){.start-grid{grid-template-columns:1fr}}
.start .secondary,.start .game-more,.start #start-sort,#rename-dialog .authoring-row button:not(.primary){border:1px solid var(--edge)}
/* C64 power (docs/plans/budget-guidance.md): the room left under the display, marks on edits that would not fit, and the make-room card. */
.c64-power{position:relative;width:var(--screen-w,640px);max-width:calc(100% - 24px);margin:8px auto 12px;display:grid;gap:6px;font-size:12px;color:var(--muted);flex-shrink:0}.c64-power[hidden]{display:none}.c64-power[data-stale]{opacity:.55}
.power-meter{display:flex;height:6px;border-radius:3px;background:var(--edge);overflow:hidden}.power-part{height:100%;background:var(--accent);box-shadow:inset -1px 0 0 var(--base)}.power-game{background:color-mix(in srgb,var(--text) 38%,transparent)}.power-rules{background:color-mix(in srgb,var(--text) 62%,transparent)}
.power-text,.power-hint{margin:0;padding:0;height:18px;min-height:0;line-height:18px;text-align:center;font:inherit;color:inherit;background:none;border:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.c64-power .power-text{display:block;cursor:pointer;border-radius:4px;background:none;border:0;box-shadow:none;width:100%}.c64-power .power-text:hover,.c64-power .power-text[aria-expanded=true]{color:var(--text);background:none}.power-hint{color:var(--quiet)}.c64-power:not([data-hint]) .power-hint,.c64-power[data-hint] .power-text{display:none}
/* The details and the make-room card float over the foot of the screen, so the row never changes height. */
.power-details,.power-card{position:absolute;left:0;right:0;bottom:calc(100% + 8px);z-index:6;box-shadow:var(--shadow)}.power-details[hidden],.power-card[hidden]{display:none}.power-details{border:1px solid var(--edge);background:var(--raised);border-radius:8px;padding:10px 12px;color:var(--text);text-align:left}.power-details p{margin:0 0 8px}.power-users{list-style:none;margin:0;padding:0;display:grid;gap:4px;color:var(--muted)}.power-users li{display:flex;align-items:center;gap:8px}.power-dot{width:10px;height:10px;border-radius:2px;flex-shrink:0;background:var(--accent)}.power-dot.power-game{background:color-mix(in srgb,var(--text) 38%,transparent)}.power-dot.power-rules{background:color-mix(in srgb,var(--text) 62%,transparent)}.power-text strong{color:var(--text);font-weight:600}.c64-power[data-level=near] .power-text strong,.c64-power[data-level=full] .power-text strong{color:var(--amber)}.c64-power[data-level=over] .power-text strong{color:var(--error)}
.power-card{border:1px solid var(--amber);background:var(--raised);border-radius:8px;padding:10px 12px;color:var(--text);text-align:left}.power-card p{margin:0 0 6px}.power-actions{display:flex;gap:8px;flex-wrap:wrap}
[data-power=over]{outline:1px dashed var(--amber);outline-offset:-1px}[data-power=over]::after{content:"!";display:inline-block;width:12px;height:12px;margin-left:4px;vertical-align:middle;border-radius:50%;background:var(--amber);color:#1b1b1f;font:700 9px/12px system-ui,sans-serif;text-align:center;pointer-events:none}
/* C64 power on the scene bar: a full level gets a small amber dot, a level that is over the same "!" as the controls. */
.scene-row[data-power-scene]::after{content:"";flex-shrink:0;width:6px;height:6px;border-radius:50%;background:var(--amber)}.scene-row[data-power-scene=over]::after{content:"!";width:12px;height:12px;color:#1b1b1f;font:700 9px/12px system-ui,sans-serif;text-align:center}
/* The score and lives row as an item list (3 November 2026): per value, a line with its name and arrows, then its word. */
.hud-items{list-style:none;padding:0;margin:6px 0 8px;display:grid;gap:8px}.hud-row [hidden]{display:none}
.hud-item{display:grid;grid-template-columns:auto minmax(0,1fr) auto auto;gap:4px 6px;align-items:center}.hud-item label{display:block;margin:0;font-size:11.5px;color:var(--text)}
.hud-item>input:not([type=checkbox]){grid-column:2/-1;min-width:0}.hud-item small{grid-column:2/-1;line-height:1.4}
.hud-item:has(input[type=checkbox]:not(:checked)) label{color:var(--muted)}.hud-item:has(input[type=checkbox]:not(:checked))>input:not([type=checkbox]){display:none}
.hud-move{min-height:24px;width:24px;padding:0;font-size:12px;border:1px solid var(--edge);color:var(--muted)}.hud-move:disabled{opacity:.35;cursor:default}
/* Property help (property-help.mjs): an (i) button beside each setting's label, and one popover shown on hover, focus or tap. */
.help-head{display:flex;align-items:center;gap:2px;min-width:0}.coordinates label>.help-head{justify-content:flex-start}.hud-item label>.help-head{display:inline-flex}legend.help-head{float:left}
.help-button{flex-shrink:0;width:24px;height:24px;min-height:24px;margin:-5px 0;padding:0;border-radius:50%;color:var(--quiet);background:transparent}.help-button .icon{width:15px;height:15px}
.help-button:hover,.help-button[aria-expanded=true]{color:var(--accent);background:var(--selected)}.help-button:focus-visible{outline:2px solid var(--accent);outline-offset:0}
/* Beside a quick setting the label takes its own width and the button overlaps the gaps, so the row still fits on one line. */
.tweak-label:has(+.help-button){width:auto}.tweak-row>.help-button{width:22px;margin:0 -8px}
.help-pop{position:fixed;z-index:1000;max-width:min(280px,calc(100vw - 16px));padding:9px 11px;border:1px solid var(--edge-strong);border-radius:8px;background:var(--raised);color:var(--text);font-size:12px;line-height:1.5;box-shadow:var(--shadow);white-space:normal}
/* Import a picture (picture-ui.mjs). */
#picture-dialog,#quest-picture-dialog{width:min(720px,94vw);max-width:94vw;padding:20px 24px}#picture-dialog .dialog-heading,#quest-picture-dialog .dialog-heading{display:flex;justify-content:space-between;align-items:flex-start;margin-bottom:12px}#picture-dialog .dialog-heading h2,#quest-picture-dialog .dialog-heading h2{margin:2px 0 0}
.picture-drop{border:2px dashed var(--line,#494453);border-radius:10px;padding:28px;text-align:center}.picture-drop.over{border-color:var(--accent,#8b7cf6)}
.picture-choose{display:inline-flex;align-items:center;cursor:pointer;padding:8px 14px;border-radius:8px;border:1px solid var(--line,#494453)}.picture-choose input{position:absolute;width:1px;height:1px;opacity:0}
.picture-stage{background:#000;border-radius:6px;overflow:hidden;margin-bottom:8px}.picture-preview{display:block;width:100%;height:auto;image-rendering:pixelated;cursor:grab;touch-action:none}
.picture-controls{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:8px 16px;margin:12px 0}.picture-controls label{display:flex;flex-direction:column;gap:4px;font-size:13px}.picture-controls .picture-check{flex-direction:row;align-items:center;gap:8px}.picture-controls .picture-check input{width:auto;height:auto;margin:0}
.picture-symbols{display:flex;flex-wrap:wrap;gap:4px;max-height:132px;overflow:auto;padding:2px}.picture-symbol{padding:2px;border-radius:4px;border:2px solid transparent;background:none;line-height:0}.picture-symbol canvas{width:24px;height:24px;image-rendering:pixelated}.picture-symbol[aria-pressed="true"]{border-color:#ff4040}
.picture-note{min-height:1.2em;font-size:13px}
/* Send feedback (ADR 045) lives in the header toolbar with Share and Guide: labelled from 1280 px, icons alone below. */
.feedback-dialog{width:min(520px,92vw)}.feedback-dialog .dialog-heading{margin-bottom:6px}.feedback-dialog h2{margin:0}
.feedback-form{display:flex;flex-direction:column;gap:12px}.feedback-kinds{display:flex;flex-wrap:wrap;gap:6px;border:0;margin:0;padding:0}
.feedback-kinds label{display:flex;align-items:center;gap:6px;padding:6px 10px;border:1px solid var(--edge);border-radius:8px;font-size:12.5px;cursor:pointer}.feedback-kinds label:has(input:checked){border-color:var(--accent);background:var(--selected);color:var(--accent)}
.feedback-message{display:flex;flex-direction:column;gap:6px;font-size:12.5px}.feedback-message textarea{width:100%;resize:vertical;min-height:110px;font:inherit;font-size:13px}
.feedback-attach{display:flex;align-items:center;gap:8px;font-size:12.5px}.feedback-dialog .feedback-note{margin:0;font-size:11.5px}
.feedback-actions,.feedback-done{display:flex;gap:8px;align-items:center}.feedback-done{flex-direction:column;align-items:flex-start;gap:12px}
.feedback-dialog input[type=radio],.feedback-dialog input[type=checkbox]{width:15px;height:15px;min-width:0;min-height:0;flex:none;margin:0;padding:0}.feedback-kinds label{white-space:nowrap}.feedback-attach{justify-content:flex-start}
/* arcade-1.14.0 level view (docs/plans/scrolling.md, step 2.3): meters above the stage, and a stage that scrolls through the
   whole level from the top (its end) to the bottom (its start) instead of centering one screen. */
.canvas-area>.scroll-meters:not([hidden]){align-self:center;width:var(--screen-w,640px);max-width:calc(100% - 24px);margin:0 0 6px;flex-shrink:0;display:flex;flex-wrap:wrap;gap:2px 14px;line-height:1.5}.scroll-meters .meter{font-variant-numeric:tabular-nums;white-space:nowrap}.scroll-meters .meter.over{color:var(--error);font-weight:600}
.stage.level{align-items:flex-start}
/* The level size meters are for editing; Play shows only the game. */
.canvas-area.playing>.scroll-meters:not([hidden]){display:none}
/* A scrolling level's score row, pinned to the top of the stage over the level (app.mjs drawLevelHud); -2px covers the stage padding. */
#level-hud{position:sticky;top:-2px;z-index:3;display:block;width:var(--screen-w,640px);height:auto;image-rendering:pixelated;background:#000}#level-hud[hidden]{display:none}
.hud-fix{margin:6px 0 8px;padding:8px 10px;border:1px solid var(--amber);border-radius:8px}.hud-fix p{margin:0 0 6px}.hud-fix[hidden]{display:none}.hud-nofit{color:var(--amber)}.hud-nofit[hidden]{display:none}
/* Scrolling step 2.4: the level's sections (end first, as on the stage) and an enemy kind's spawns. */
.scroll-level{padding:12px 14px;display:flex;flex-direction:column;gap:8px}.scroll-level h3{font-size:12px}.level-fold>summary{display:flex;align-items:baseline;gap:8px;list-style:none;font-size:12px;color:var(--text)}.level-fold>summary::-webkit-details-marker{display:none}.level-fold>summary::before{content:'▸';color:var(--muted);font-size:10px;transition:transform .12s}.level-fold[open]>summary::before{transform:rotate(90deg)}.level-fold-count{font-size:11px;color:var(--quiet)}.level-fold-body{display:flex;flex-direction:column;gap:8px;margin-top:8px}
.level-entries{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:2px}
.level-entry{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;column-gap:6px;padding:4px 0;border-bottom:1px solid var(--edge)}.level-tools{grid-column:1/-1;display:flex;gap:4px;justify-content:flex-end}.level-entry .section-note{white-space:nowrap;font-variant-numeric:tabular-nums}
.level-entry .level-name{justify-content:flex-start;text-align:left;background:none;border:0;padding:4px 2px;color:var(--text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.level-entry .level-name:hover{color:var(--accent)}
.level-entry .icon-only{min-width:26px;padding:2px 4px}.level-entry .secondary{padding:2px 8px;font-size:11px}
.level-add{flex-wrap:nowrap}.level-add select{flex:1 1 auto;min-width:0}.scroll-kind{padding:4px 14px 10px;display:flex;flex-direction:column;gap:6px}
/* Scrolling step 2.5: the Stamp tool's palette, the theme pack's stamps as small pictures. */
.stamp-options:not([hidden]){display:flex;gap:4px;overflow-x:auto;max-width:min(30vw,320px);padding:2px}.stamp-choice{padding:3px;min-height:36px;display:flex;align-items:center;justify-content:center;flex-shrink:0}.stamp-choice canvas{image-rendering:pixelated;display:block}.stamp-choice[aria-pressed=true]{outline:2px solid var(--accent);outline-offset:1px}
/* arcade-1.18.0 game screens (screens-ui.mjs): the preview on the left, the fields on the right; one column on a phone. */
/* The dialog stays put: the heading and the preview hold still and only the fields column scrolls (a phone scrolls the whole dialog). */
#screens-dialog{width:min(1040px,94vw);max-width:none;max-height:92dvh;overflow:hidden;padding:20px 24px}
#screens-dialog[open]{display:flex;flex-direction:column}
#screens-body{flex:1 1 auto;min-height:0;display:flex;flex-direction:column}
#screens-dialog .dialog-heading{margin-bottom:16px;align-items:flex-start}
#screens-dialog .dialog-heading h2{margin:2px 0 0}
#screens-dialog .dialog-heading p{margin:4px 0 0}
.screens-empty{display:flex;flex-direction:column;align-items:flex-start;gap:12px;max-width:560px}
.screens-empty[hidden],.screens-layout[hidden]{display:none}
.screens-layout{flex:1 1 auto;min-height:0;display:grid;grid-template-columns:minmax(0,640px) minmax(260px,1fr);grid-template-rows:minmax(0,1fr);gap:24px;align-items:start}
.screens-preview{display:flex;flex-direction:column;gap:8px;min-width:0}
.screens-canvas{width:100%;max-width:640px;aspect-ratio:320/200;image-rendering:pixelated;background:#000;border-radius:4px}
.screens-tabs{display:flex;flex-wrap:wrap;gap:6px}
.screens-tabs button{min-height:28px;padding:4px 10px;font-size:12px}
.screens-tabs button[aria-selected=true]{background:var(--accent);color:var(--accent-ink);border-color:var(--accent)}
.screens-caption{margin:0}
.screens-fields{display:flex;flex-direction:column;gap:6px;min-width:0;align-self:stretch;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:2px 10px 2px 2px}
.screens-fields h3{margin:10px 0 2px;font-size:13px}
.screens-fields h3:first-child{margin-top:0}
/* Each tab's own settings, then the screens switches (UX polish, 18 November 2026). */
.screens-part,.screens-switches{display:flex;flex-direction:column;gap:8px}.screens-part h3{margin-top:0}.screens-switches{margin-top:6px;padding-top:10px;border-top:1px solid var(--edge)}.screens-switches h3{margin-top:0}
.screens-field{display:flex;flex-direction:column;gap:4px;font-size:12px;font-weight:600}
.screens-field input,.screens-field select,.screens-ending input{height:30px;min-height:30px;padding:0 9px}
.screens-check{display:flex;align-items:center;gap:8px;font-size:13px}
.screens-check input{width:16px;height:16px;margin:0;accent-color:var(--accent)}
.screens-ending{display:flex;flex-direction:column;gap:6px;border:0;padding:0;margin:0}
.screens-ending legend{font-size:12px;font-weight:600;margin-bottom:4px}
.screens-fields .link{padding:0;min-height:0;height:auto;color:var(--accent);background:none;border:0;font-size:inherit;text-decoration:underline;text-underline-offset:3px}
.screens-problem{color:var(--error)}
.screens-actions{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:10px}
.screens-actions p{margin:0}
@media (max-width:760px){.screens-layout{grid-template-columns:1fr;grid-template-rows:none}#screens-dialog{padding:16px;overflow:auto}#screens-dialog[open]{display:block}.screens-fields{overflow:visible}}
.screens-levels{display:flex;flex-direction:column;gap:8px;margin-top:4px}.screens-levels[hidden]{display:none}
.screens-level{display:flex;flex-direction:column;gap:2px}
/* Your plan, not subscribed (assistant.mjs planPage): wide sheet, the reason that opened it and a one-row status; the cards are pricing.css. */
.assistant-dialog.wide .assistant-status:empty{display:none}
@media (max-height:860px){.assistant-dialog.wide{padding:18px 24px}.assistant-dialog.wide h2{margin-bottom:14px}.assistant-dialog.wide .page-tabs{margin-bottom:8px}}
.assistant-dialog.wide.for-plan{width:min(1120px,94vw)}
.plan-reason{margin:0 0 14px;padding:10px 12px;border:1px solid var(--accent);border-radius:8px;background:var(--selected);color:var(--text)}
.page-tabs{align-items:center}.page-tabs .plan-reason{flex:1;min-width:240px;margin:0 0 0 12px;padding:6px 12px;font-size:13px;line-height:1.4}
.plan-status .account-profile{grid-template-columns:repeat(3,auto minmax(0,1fr));gap:6px 12px}
@media (max-width:720px){.plan-status .account-profile{grid-template-columns:100px minmax(0,1fr)}}
.detail-link[hidden]{display:none}
/* arcade-1.26.0 side levels: the jump check's warning in the level card (P3.1). */
#side-reach.warn{color:var(--amber)}#side-reach button{margin-top:4px}
/* The side level's strip: as wide as the screen above it (--screen-w is set with the fit), so its frame sits under what it shows. */
.canvas-area>.side-strip{align-self:center;width:var(--screen-w,640px);max-width:calc(100% - 24px);flex-shrink:0}
/* The World editor (docs/plans/world-editor.md, W.1): a full screen editor in a dialog. Palette left, the level in the middle, checks right, the draft and Apply in the footer. */
#world-dialog{width:min(1480px,98vw);height:min(940px,96dvh);max-width:none;max-height:none;padding:0;overflow:hidden}
#world-dialog[open]{display:flex;flex-direction:column}
.world-head{display:flex;align-items:center;gap:16px;padding:10px 12px 0 20px;border-bottom:1px solid var(--edge);flex-wrap:wrap}
.world-title{padding-bottom:10px}.world-title h2{margin:0;font-size:18px}.world-title .section-note{margin:2px 0 0;font-size:12px}
.world-tabs{display:flex;flex:1;min-width:0;overflow-x:auto;align-self:stretch;align-items:stretch}.world-tabs[hidden]{display:none}
.world-tab{display:inline-flex;align-items:center;gap:8px;padding:0 14px;min-height:44px;border:0;border-bottom:2px solid transparent;border-radius:0;background:transparent;color:var(--muted);font-size:13px}
.world-tab:hover{color:var(--text)}.world-tab[aria-selected=true]{color:var(--text);border-bottom-color:var(--accent)}
.world-dot{width:7px;height:7px;border-radius:4px;background:var(--amber)}
.world-head-tools{display:flex;align-items:center;gap:4px;margin-left:auto;padding-bottom:8px}
.world-ghost{display:inline-flex;align-items:center;gap:6px;min-height:34px;padding:0 10px;border:1px solid transparent;border-radius:8px;background:transparent;color:var(--text);font-size:13px}
.world-ghost:hover{background:var(--raised)}.world-ghost:disabled{opacity:.45}
.world-close{font-size:24px;min-height:34px;width:38px;padding:0;background:transparent;border:0;color:var(--muted)}
.world-icon{fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0}
.world-body{flex:1;min-height:0;display:grid;grid-template-columns:272px minmax(0,1fr) 300px}
.world-left,.world-right{overflow-y:auto;padding:14px 12px;display:flex;flex-direction:column;gap:18px}
.world-left{border-right:1px solid var(--edge)}.world-right{border-left:1px solid var(--edge);padding:14px 16px}
.world-section{display:flex;flex-direction:column;gap:4px}
.world-section h3{margin:0 0 4px;padding:0 4px;font-size:11px;font-weight:600;letter-spacing:.06em;text-transform:uppercase;color:var(--muted)}
.world-item{display:flex;align-items:center;gap:10px;width:100%;min-height:44px;padding:5px 6px;border:1px solid transparent;border-radius:8px;background:transparent;color:var(--text);text-align:left}
.world-item:hover{background:var(--raised)}.world-item[aria-pressed=true]{background:var(--selected);border-color:var(--accent)}
.world-item-row{display:flex;align-items:center;gap:2px}.world-item-row>.world-item{flex:1;min-width:0}.world-item-edit{display:flex;align-items:center;justify-content:center;flex-shrink:0;width:32px;height:32px;min-height:0;padding:0;border:1px solid transparent;border-radius:8px;background:transparent;color:var(--muted);opacity:0}.world-item-row:hover .world-item-edit,.world-item-row.on .world-item-edit,.world-item-edit:focus-visible{opacity:1}.world-item-edit:hover{border-color:var(--edge-strong);background:var(--raised);color:var(--text)}@media(hover:none){.world-item-edit{opacity:1}}.world-item-spacer{visibility:hidden}
.world-item kbd{margin-left:auto;font:inherit;font-size:11px;color:var(--quiet);border:1px solid var(--edge-strong);border-radius:4px;padding:0 5px}
.world-thumb{width:32px;height:32px;flex-shrink:0;border-radius:4px;image-rendering:pixelated}
/* A quest room's tiles (quest games P3.1): a compact grid, most used first. */
.world-glyphs{display:grid;grid-template-columns:repeat(auto-fill,minmax(28px,1fr));gap:3px;max-height:220px;overflow-y:auto;padding:2px}.world-glyph{display:flex;align-items:center;justify-content:center;width:auto;min-width:0;height:28px;min-height:0;padding:0;margin:0;border:1px solid transparent;border-radius:5px;background:transparent}.world-glyph canvas{width:24px;height:24px;image-rendering:pixelated}.world-glyph[aria-pressed=true]{border-color:var(--accent);background:var(--selected)}
.world-add-thing{display:flex;flex-direction:column;gap:6px;margin-top:8px}.world-add-thing label{font-size:12.5px;font-weight:500}.world-add-thing input{width:100%;box-sizing:border-box;min-height:34px}.world-add-thing small{font-size:11.5px;margin:0}
.world-item-text{display:flex;flex-direction:column;flex:1;min-width:0}.world-item-text strong{font-size:13px;font-weight:500}.world-item-text small{font-size:11.5px;color:var(--quiet);line-height:1.35;white-space:normal}
.world-row{display:flex;align-items:center;gap:2px}.world-remove{width:30px;min-height:30px;padding:0;border:0;background:transparent;color:var(--muted);font-size:16px}
.world-symbols{display:block;width:100%;aspect-ratio:256/240;image-rendering:pixelated;border-radius:4px;cursor:pointer}
.world-symbol-controls{display:flex;flex-direction:column;gap:8px;margin-top:8px}.world-symbol-controls .secondary{min-height:32px;font-size:12.5px;border:1px solid var(--edge-strong);border-radius:7px}.world-symbol-controls .section-note{margin:0;font-size:12px}
.world-swatches{display:grid;grid-template-columns:repeat(8,minmax(0,1fr));gap:5px}.world-swatches .swatch{width:auto;min-width:0;height:24px;min-height:0;margin:0}
.world-toggle{display:inline-flex;flex-direction:row;align-items:center;gap:6px;margin:0;font-size:12.5px;color:var(--text)}
.world-toggle input[type=checkbox]{width:16px;height:16px;min-height:0;padding:0;margin:0;accent-color:var(--accent)}
.world-toggle select{width:auto;min-height:30px;padding:0 6px}
.world-centre{display:flex;flex-direction:column;min-width:0;min-height:0}
/* Describe a world (docs/plans/world-prompt.md; mockup approved 21 November 2026): the same fixed frame, the columns swap to
   the sentence, the chosen world's first screen with three worlds under it, and the reading. Nothing makes the dialog scroll. */
.world-describe-button[aria-pressed=true]{background:var(--selected);color:var(--accent)}
.world-describe-stage{flex:1;min-height:0;display:flex;flex-direction:column;gap:10px;padding:14px;background:var(--base)}
.world-describe-fit{flex:1;min-height:120px;container-type:size;display:flex;align-items:center;justify-content:center}
.world-describe-view{display:block;width:min(100cqw,calc(100cqh * 320 / 192));aspect-ratio:320/192;image-rendering:pixelated;border-radius:4px;box-shadow:0 0 0 1px var(--edge-strong)}
.world-describe-caption{margin:0;text-align:center;color:var(--muted);font-size:12.5px}.world-describe-caption strong{color:var(--text);font-weight:600}
.world-describe-worlds{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;flex-shrink:0;min-height:78px}
.world-describe-map{display:flex;align-items:center;gap:8px;flex-shrink:0;font-size:11px;color:var(--quiet);text-transform:uppercase;letter-spacing:.06em}
.world-describe-strip{flex:1;min-width:0;height:44px;border-radius:3px;box-shadow:0 0 0 1px var(--edge-strong)}
.world-describe-world{display:flex;flex-direction:column;justify-content:flex-start;gap:6px;align-items:stretch;min-width:0;padding:6px 8px 8px;border:1px solid var(--edge);border-radius:10px;background:var(--panel);text-align:left}
.world-describe-world:hover{border-color:var(--edge-strong)}.world-describe-world[aria-pressed=true]{border-color:var(--accent);background:var(--selected)}
.world-describe-world canvas{width:100%;height:26px;border-radius:3px;flex-shrink:0}.world-describe-world small{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
/* A cave (world prompt 4.2) is a whole picture, not a strip: shown small and uncropped, its long name cut short. */
.world-describe-worlds.whole canvas{height:64px;object-fit:contain}.world-describe-worlds.whole strong{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.world-describe-busy{grid-column:1/-1;margin:0;align-self:center;text-align:center;color:var(--muted)}
.world-describe-text{width:100%;box-sizing:border-box;min-height:96px;resize:none;padding:9px 11px;border-radius:9px;border:1px solid var(--edge-strong);background:var(--base);color:var(--text);font:inherit;font-size:13.5px;line-height:1.4}
.world-describe-ask{gap:8px}.world-describe-ask .apply-button{width:100%}
.world-describe-example{display:block;width:100%;height:auto;white-space:normal;min-height:30px;padding:6px 10px;margin-top:4px;border:1px solid var(--edge);border-radius:8px;background:transparent;color:var(--muted);font-size:12.5px;text-align:left;line-height:1.35}
.world-describe-example:hover{color:var(--text);border-color:var(--edge-strong)}
#world-describe-understood p,.world-describe-left-out p{margin:0 0 6px}.world-describe-left-out h3{color:var(--amber)}
.world-describe-actions{display:flex;flex-direction:column;gap:8px;margin-top:auto}.world-describe-actions button{width:100%}
.world-toolbar{display:flex;align-items:center;gap:6px;padding:8px 12px;border-bottom:1px solid var(--edge);flex-wrap:wrap}
.world-tools,.world-rect{display:flex;flex-wrap:wrap;max-width:100%;gap:2px;padding:3px;border:1px solid var(--edge);border-radius:10px;background:var(--base)}.world-rect[hidden]{display:none}
.world-tool{display:inline-flex;align-items:center;gap:6px;min-height:34px;padding:0 10px;border:1px solid transparent;border-radius:7px;background:transparent;color:var(--text);font-size:13px}
.world-tool:hover{background:var(--raised)}.world-tool[aria-pressed=true]{background:var(--selected);border-color:var(--accent)}
/* The view toggles sit in a Show menu beside the tools, with Zoom after it: one toolbar row in every job (owner, 18 November 2026). */
.world-view{display:flex;align-items:center;gap:12px}
.world-show{position:relative}.world-show summary{list-style:none;display:inline-flex;align-items:center;gap:6px;cursor:pointer;border:1px solid var(--edge);background:var(--base)}.world-show summary::-webkit-details-marker{display:none}
.world-show[open] summary .world-icon{transform:rotate(180deg)}
.world-show-list{position:absolute;top:calc(100% + 6px);left:0;z-index:50;min-width:160px;padding:8px 10px;background:var(--panel);border:1px solid var(--edge);border-radius:10px;box-shadow:var(--shadow);display:flex;flex-direction:column;gap:10px}
.world-stage{flex:1;min-height:280px;overflow:auto;display:flex;padding:12px;background:var(--base)}
#world-canvas{margin:auto;display:block;image-rendering:pixelated;touch-action:none;cursor:crosshair;border-radius:2px}
#world-canvas:focus-visible{outline:2px solid var(--accent);outline-offset:3px}
.world-statusbar{display:flex;gap:12px;padding:7px 14px;border-top:1px solid var(--edge);font-size:12.5px;flex-wrap:wrap}.world-hint{margin-left:auto;color:var(--quiet)}
.world-buttons{display:flex;flex-wrap:wrap;gap:6px}.world-buttons .secondary,.world-right>.secondary{min-height:30px;font-size:12px;border:1px solid var(--edge-strong);border-radius:7px}
.world-selection{padding:12px;border:1px solid var(--edge-strong);border-radius:10px;background:var(--raised);gap:8px}.world-selection .apply-button{margin:0}
.world-pen{display:flex;align-items:center;gap:10px}.world-pen .world-item-text{flex:1}.world-pen .secondary{min-height:28px;font-size:12px;border:1px solid var(--edge-strong);border-radius:6px}
.world-swatch{width:26px;height:26px;border-radius:6px;box-shadow:inset 0 0 0 1px #ffffff40;flex-shrink:0}
.world-right .section-note{margin:6px 0 0;font-size:12px}
.world-check{display:flex;align-items:flex-start;gap:10px;padding:8px 10px;border-radius:8px;border:1px solid var(--edge);background:var(--raised)}
.world-check .world-item-text{flex:1}.world-check .secondary{min-height:26px;font-size:12px;border:1px solid var(--edge-strong);border-radius:6px}
.world-check-mark{width:18px;text-align:center;font-weight:700;color:var(--green)}.world-check.bad{border-color:var(--error)}.world-check.bad .world-check-mark{color:var(--error)}
.world-foot{display:flex;align-items:center;gap:12px;padding:10px 16px 10px 20px;border-top:1px solid var(--edge);background:var(--raised);flex-wrap:wrap}
.world-foot-text{flex:1;min-width:200px;margin:0;font-size:12.5px;color:var(--muted)}.world-toast{margin:0;padding:7px 12px;border:1px solid var(--accent);border-radius:8px;background:var(--selected);color:var(--text);font-size:12.5px;max-width:520px}.world-toast[hidden]{display:none}
.world-block{margin:0;font-size:12.5px;color:var(--error)}.world-block.warn{color:var(--amber)}.world-block:empty{display:none}
.world-foot>button{min-height:40px;padding:0 16px;font-size:13px}.world-foot>button[hidden]{display:none}.world-foot .secondary{border:1px solid var(--edge-strong);border-radius:8px}
.world-foot .apply-button{width:auto;min-width:130px;margin:0;background:var(--accent);color:var(--accent-ink);border-color:var(--accent);font-weight:600}.world-foot .apply-button:disabled{background:var(--edge);color:var(--quiet)}
.world-discard{color:var(--error)!important}
@media (max-width:1100px){.world-body{grid-template-columns:240px minmax(0,1fr)}.world-right{grid-column:1/-1;border-left:0;border-top:1px solid var(--edge);max-height:260px}}
@media (max-width:760px){.world-head-tools:has(.world-describe-button:not([hidden])){flex-wrap:wrap}.world-describe-fit{flex:none;height:auto;container-type:inline-size}.world-describe-view{width:100%}.world-describe-worlds{grid-template-columns:1fr}.world-body{display:block;overflow-y:auto}.world-left,.world-right{overflow:visible;max-height:none;border:0}.world-centre{display:block;border-top:1px solid var(--edge);border-bottom:1px solid var(--edge)}.world-stage{min-height:0;overflow-x:auto}.world-head-tools{margin-left:0}}
/* One job at a time (Studio UX review, step 4): a mode's jobs under the head, a page picker in place of tabs, the
   room's settings as one line each, and the checks as a footer chip that opens the list. */
.world-jobs{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;padding:10px 20px;border-bottom:1px solid var(--edge);background:var(--base)}.world-jobs[hidden]{display:none}
.world-job{display:flex;align-items:center;gap:12px;min-height:52px;padding:6px 14px;border:1px solid var(--edge);border-radius:12px;background:transparent;color:var(--text);text-align:left}
.world-job:hover{background:var(--raised)}.world-job[aria-selected=true]{background:var(--selected);border-color:var(--accent)}
.world-job-n{display:flex;align-items:center;justify-content:center;flex:none;width:26px;height:26px;border-radius:50%;border:1px solid var(--edge-strong);font-weight:700;color:var(--muted)}
.world-job[aria-selected=true] .world-job-n{background:var(--accent);border-color:var(--accent);color:var(--accent-ink)}
.world-job-text{display:flex;flex-direction:column;min-width:0;line-height:1.3}.world-job-text strong{font-size:14px;font-weight:600}.world-job-text small{font-size:12px;color:var(--muted)}
@media (max-width:900px){.world-jobs{grid-template-columns:repeat(2,minmax(0,1fr));padding:8px 12px}.world-job-text small{display:none}.world-job{min-height:44px}}
.world-picker{display:flex;flex:1;min-width:0;align-items:center;gap:10px;padding-bottom:8px;flex-wrap:wrap}.world-picker[hidden]{display:none}
.world-picker-room{display:flex;align-items:center;gap:10px;padding:5px 10px 5px 6px;border:1px solid var(--edge-strong);border-radius:10px;background:var(--raised)}
.world-picker-thumb{width:64px;height:32px;border-radius:4px;image-rendering:pixelated;flex:none}.world-picker-text{display:flex;flex-direction:column;min-width:0}
.world-picker-text select{min-height:24px;max-width:220px;padding:0 22px 0 2px;border:0;background-color:transparent;color:var(--text);font-size:14px;font-weight:600}.world-picker-text small{padding-left:2px;font-size:11px;color:var(--muted)}
.world-map-button{min-height:44px;padding:0 14px;border:1px solid var(--edge);border-radius:10px;background:transparent;color:var(--text);font-size:13px}.world-map-button:hover{background:var(--raised)}.world-map-button[aria-pressed=true]{background:var(--selected);border-color:var(--accent)}
.world-tool[hidden]{display:none}
.world-why{margin:8px 0 0;padding:10px 12px;border:1px solid var(--edge);border-radius:10px;background:var(--base);font-size:12px;color:var(--muted)}.world-why strong{display:block;color:var(--text)}
.world-sumrow{display:flex;align-items:center;gap:8px;width:100%;min-height:44px;padding:0 10px;border:1px solid var(--edge);border-radius:10px;background:var(--raised);color:var(--text);text-align:left;font-size:13px}
.world-sumrow:hover{border-color:var(--edge-strong)}.world-sumrow[aria-expanded=true]{border-color:var(--accent)}.world-sumrow .world-icon{flex:none;color:var(--muted)}
.world-sumrow-label{flex:none;width:64px;color:var(--muted)}.world-sumrow-value{flex:1;min-width:0;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.world-color-strip{display:flex;gap:3px}.world-color-strip span{width:16px;height:16px;border-radius:4px;box-shadow:inset 0 0 0 1px #ffffff40}
.world-sumrow-body{display:flex;flex-direction:column;gap:6px;padding:4px 4px 10px}.world-sumrow-body input[type=text]{width:100%}
.world-chip{display:inline-flex;align-items:center;gap:8px;min-height:36px!important;padding:0 14px!important;border:1px solid var(--green);border-radius:999px;background:transparent;color:var(--green);font-size:13px;font-weight:600}
.world-chip[hidden]{display:none}.world-chip.warn{border-color:var(--amber);color:var(--amber)}.world-chip.bad{border-color:var(--error);color:var(--error)}.world-chip-mark{font-weight:700}
.world-checks-panel{position:absolute;left:16px;bottom:68px;z-index:2;width:min(360px,calc(100% - 32px));max-height:60%;overflow-y:auto;padding:14px;border:1px solid var(--edge-strong);border-radius:12px;background:var(--panel);box-shadow:var(--shadow)}.world-checks-panel[hidden]{display:none}
/* A quest's room card (quest games P3.1b): the map of rooms, the four exits, the room buttons. */
.quest-buttons{display:flex;flex-wrap:wrap;gap:6px;margin:6px 0}
.quest-map{margin:4px 0 8px;overflow:auto;max-height:240px}.quest-map-svg{display:block;flex:none}
.quest-map-link{stroke:var(--edge-strong);stroke-width:2}.quest-map-link.one-way{stroke-dasharray:4 3}
.quest-map-room{cursor:pointer}.quest-map-room rect{fill:var(--raised);stroke:var(--edge-strong);stroke-width:1.5}.quest-map-room text{fill:var(--text);font-size:10px;font-family:system-ui,sans-serif}
.quest-map-room.start rect{stroke:#ffe14d}.quest-map-room.shown rect{fill:var(--selected);stroke:var(--accent);stroke-width:2.5}.quest-map-room:focus-visible rect{stroke:var(--accent);stroke-width:3}
.quest-exits{display:flex;flex-direction:column;gap:6px;margin-bottom:8px}.quest-exit{display:grid;grid-template-columns:52px minmax(0,1fr) auto;align-items:center;gap:6px}.quest-exit label{margin:0;font-size:13px}.quest-exit select{min-width:0;width:100%;min-height:32px}.quest-exit .secondary{min-height:32px;padding:0 10px}
.quest-confirm{border:1px solid var(--edge-strong);border-radius:8px;padding:8px 10px;margin:6px 0}.quest-confirm p{margin:0 0 6px;font-size:13px}
/* The World editor's overview (a quest's map of rooms; Studio UX review step 3): the map has the stage to itself, with
   the selected room's card beside it and the legend under it. A canvas draws the rooms and links; a button lies over
   each room, and a plus handle on each free edge of the selected one. */
.world-overview{position:relative;flex:1;min-width:0;display:grid;grid-template-columns:minmax(0,1fr) 300px;grid-template-rows:minmax(0,1fr) auto;gap:8px 16px;align-items:start}.world-overview[hidden]{display:none}
.world-map{position:relative;grid-column:1;grid-row:1;max-width:100%;overflow:auto}
.world-map-room{position:absolute;padding:0;min-height:0;border-radius:6px;background:transparent;border:0}.world-overview .world-map-room:hover{background:transparent;outline:2px solid var(--muted);outline-offset:0}.world-overview .world-map-room:focus-visible{outline:3px solid var(--accent);outline-offset:0}
.world-overview .world-map-room.drop{outline:3px dashed var(--accent);outline-offset:0;background:rgba(181,161,255,.18)}
.world-map-plus{position:absolute;width:26px;height:26px;min-height:0;padding:0;display:flex;align-items:center;justify-content:center;border-radius:50%;background:var(--selected);border:2px solid var(--accent);color:var(--accent);cursor:grab;touch-action:none}
.world-map-plus:hover,.world-map-plus.dragging{background:var(--accent);color:var(--accent-ink)}.world-map-plus.dragging{cursor:grabbing}.world-map-plus .world-icon{stroke-width:2.5}
.world-map-wire{position:absolute;left:0;top:0;pointer-events:none}.world-map-wire line{stroke:var(--accent);stroke-width:3;stroke-linecap:round}
.world-map-card{grid-column:2;grid-row:1/3;max-height:100%;overflow-y:auto;box-sizing:border-box;display:flex;flex-direction:column;gap:10px;padding:14px;background:var(--panel);border:1px solid var(--edge-strong);border-radius:12px;font-size:13px}
.world-map-picture{width:100%;height:auto;display:block;border-radius:6px;image-rendering:pixelated}
.world-map-head{display:flex;align-items:baseline;gap:8px;flex-wrap:wrap}.world-map-head h3{margin:0;font-size:16px;font-weight:700}.world-map-head .section-note{margin:0 0 0 auto;font-size:12px}
.world-map-start{align-self:center;padding:1px 7px;border-radius:4px;background:#ffe14d;color:#111;font-size:11px;font-weight:700}
.world-map-says{margin:0;color:var(--muted)}
.world-map-facts{margin:0;display:grid;grid-template-columns:56px minmax(0,1fr);gap:6px 8px}.world-map-facts dt{color:var(--muted)}.world-map-facts dd{margin:0;display:flex;flex-direction:column;gap:2px}.world-map-facts .section-note{margin:0;font-size:13px}
.world-map-exit{display:flex;align-items:center;gap:6px}.world-map-exit>span{flex:1;min-width:0}.world-map-exit .world-remove{width:26px;min-height:26px;border:1px solid var(--edge-strong);border-radius:6px}
.world-map-card .apply-button{width:100%;min-height:40px;margin:0;background:var(--accent);color:var(--accent-ink);border-color:var(--accent);border-radius:8px;font-weight:600}
.world-map-card .world-buttons .secondary{flex:1 1 auto;min-height:34px}.world-map-card>.section-note{margin:0;font-size:12px}
.world-map-legend{grid-column:1;grid-row:2;display:flex;flex-wrap:wrap;align-items:center;gap:6px 18px;font-size:12px;color:var(--muted)}
.world-map-key{display:inline-flex;align-items:center;gap:7px}.world-map-sample{display:inline-block;width:28px;height:0;border-top:3px solid var(--muted)}
.world-map-sample.one{border-top:3px dashed var(--accent)}.world-map-sample.story{border-top:3px dotted var(--amber)}
.world-map-sample.alone{width:22px;height:12px;border:1.5px dashed var(--muted)}.world-map-sample.plus{width:14px;height:14px;box-sizing:border-box;border:2px solid var(--accent);border-radius:50%;background:var(--selected)}
.world-map-hint{flex-basis:100%;margin:0;min-height:18px;color:var(--text)}
/* A narrow stage: the card goes under the map and its legend. */
.world-overview.narrow{grid-template-columns:minmax(0,1fr)}.world-overview.narrow .world-map-card{grid-column:1;grid-row:3;max-height:none}
/* While the overview shows, the side panels are hidden and the stage takes the whole body. */
.world-body.overview{grid-template-columns:minmax(0,1fr)}.world-right[hidden],.world-left[hidden]{display:none}
/* A quest's story on the Rules board (quest games P3.2). */
.quest-thing{display:flex;flex-direction:column;gap:6px;padding:10px 12px;border:1px solid var(--edge);border-radius:10px;background:var(--panel)}
.quest-thing>h4{margin:0;font-size:13px;font-weight:650}.quest-thing>h4 small{font-weight:400}
.quest-step-adds{display:flex;flex-wrap:wrap;gap:6px}
.quest-message{width:100%;min-height:64px;font:inherit;resize:vertical}
.quest-preview{margin:6px 0 0;padding:8px 10px;background:#000;color:#eee;border-radius:6px;font:13px/1.35 ui-monospace,monospace;white-space:pre;min-height:3.9em;overflow-x:auto}.quest-preview.bad{outline:2px solid var(--error)}
/* Play a sound in a story step (docs/plans/story-step-sound.md, step 3): rows like Sound's, play, name, what it is like, Use or In use. */
.quest-sound-list{display:flex;flex-direction:column;max-height:280px;overflow:auto;margin:6px 0 0;border:1px solid var(--edge);border-radius:8px}
.quest-sound-shelf{margin:0;padding:8px 10px 2px;font-size:11px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--muted)}
.quest-sound-row{display:flex;align-items:center;gap:8px;min-height:40px;padding:3px 8px;border-bottom:1px solid var(--edge)}.quest-sound-row:last-child{border-bottom:0}
.quest-sound-row[data-now=true]{background:var(--selected)}.quest-sound-text{flex:1;min-width:0;display:flex;flex-direction:column}
.quest-sound-name{font-weight:600}.quest-sound-desc{font-size:12px;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.quest-sound-row .badge{flex-shrink:0;margin:0;font-size:10.5px;font-weight:700;line-height:18px;padding:0 9px;border-radius:999px;background:var(--accent);color:var(--accent-ink);border:0}
/* The story runs room by room down the sheet; each room's things sit in an even grid. */
#event-list.quest-story{display:flex;flex-direction:column;gap:14px}
#event-list.quest-story .lane-cards{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:10px;align-items:start}
/* The story's things flow in columns, each under the one above it, so a long thing leaves no gaps beside it. */
#event-list.quest-story .lane-cards{display:block;column-width:300px;column-gap:10px}
#event-list.quest-story .quest-thing{break-inside:avoid;margin:0 0 10px}
/* The view switch and the room chips, kept at the top while the story scrolls. */
.quest-story-bar{position:sticky;top:-14px;z-index:5;display:flex;flex-wrap:wrap;align-items:center;gap:10px;padding:8px 0;background:#22222b}:root[data-theme=bright] .quest-story-bar{background:#fff}
.quest-story-views{display:inline-flex;border:1px solid var(--edge-strong);border-radius:8px;overflow:hidden}.quest-view{border-radius:0;min-height:30px;padding:4px 12px}.quest-view[aria-pressed=true]{background:var(--selected);color:var(--accent)}
.quest-story-rooms{display:flex;flex-wrap:wrap;gap:6px}.quest-room-chip{min-height:28px;padding:2px 10px;border:1px solid var(--edge);border-radius:999px;font-size:12px}
/* A step on one line (Titles, Compact): a click opens it as a card. */
.quest-step-row{display:flex;flex-direction:column;align-items:flex-start;gap:2px;width:100%;padding:7px 10px;border:1px solid var(--edge);border-radius:8px;background:var(--raised);text-align:left;white-space:normal;font-size:13px;line-height:1.35}
.quest-step-row:hover{border-color:var(--accent)}.quest-step-rest,.quest-step-count{color:var(--muted);font-size:12px}
.quest-step-fold{margin-left:auto;min-height:30px;padding:0 10px;font-size:12px;color:var(--muted)}
/* Quest bag, flags, messages and space meter (docs/plans/quest-games.md, P3.3). */
.quest-space{display:inline-flex;align-items:center;gap:8px;margin-left:auto;font-size:12px}
.quest-space-bar{display:inline-block;width:110px;height:8px;border-radius:4px;background:var(--edge);overflow:hidden}
.quest-space-bar>span{display:block;height:100%;background:var(--accent)}.quest-space-bar.near>span{background:#d9a441}.quest-space-bar.over>span{background:#e0605a}
.quest-lists .quest-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:6px}
.quest-lists .quest-list>li{display:flex;flex-wrap:wrap;align-items:center;gap:6px 10px;padding:6px 10px;border:1px solid var(--edge);border-radius:8px;background:var(--panel)}
.quest-lists .quest-list>li>input{flex:0 1 180px}.quest-lists .quest-list-tools{display:inline-flex;gap:4px;margin-left:auto}
.quest-lists .quest-list-tools button{min-height:28px;padding:0 8px;font-size:12px}
.quest-lists .section-note.warn{color:#d9a441}
.quest-lists .quest-list.quest-messages{display:block;column-width:340px;column-gap:10px}
.quest-lists .quest-messages>li{padding:0;border:0;background:none;flex-direction:column;align-items:stretch;break-inside:avoid;margin:0 0 6px}
.quest-bag-preview{display:flex;flex-direction:column;gap:4px;max-width:340px}
.quest-lists>.authoring-row>input{flex:0 1 260px}
/* Can it be finished? (docs/plans/quest-games.md, P3.4). */
.quest-finish{display:flex;flex-direction:column;gap:8px;padding:12px 14px;border:1px solid var(--edge-strong);border-left:4px solid var(--edge-strong);border-radius:10px;background:var(--panel)}
.quest-finish[data-verdict=yes]{border-left-color:#5fbf7a}.quest-finish[data-verdict=stuck],.quest-finish[data-verdict=partial]{border-left-color:#d9a441}.quest-finish[data-verdict=no]{border-left-color:#e0605a}
.quest-finish-head{display:flex;align-items:center;gap:10px}.quest-finish-close{margin-left:auto;min-height:28px;padding:0 10px;font-size:12px}
.quest-finish-notes{margin:0;padding-left:18px;font-size:13px}
.quest-finish h4{margin:4px 0;font-size:13px}.quest-finish summary{cursor:pointer;font-size:13px}
.quest-finish-moves{margin:6px 0 0;padding-left:26px;column-width:280px;column-gap:24px;font-size:13px}.quest-finish-moves>li{break-inside:avoid;margin:0 0 4px}
.quest-finish-room{font-size:12px}
.quest-finish-move{min-height:0;padding:0;border:0;background:none;color:var(--accent);text-align:left;font-size:13px;text-decoration:underline dotted}
.quest-finish-open{min-height:30px;padding:4px 12px;border:1px solid var(--accent);border-radius:8px;color:var(--accent)}.quest-finish-open[aria-expanded=true]{background:var(--selected)}
/* The quest room card, redesigned 16 November 2026 (quest-room.mjs): one subject, the room. The entry line as the C64 prints it, things as numbered rows that match the stage's pins, exits, and one Game space meter. */
.quest-room{padding:12px 14px;display:flex;flex-direction:column;gap:8px}.quest-room-head{display:flex;align-items:baseline;gap:8px;flex-wrap:wrap}.quest-room-head h3{font-size:15px}.quest-start-chip{padding:1px 8px;border-radius:999px;background:var(--selected);color:var(--accent);font-size:11px;font-weight:600}
.quest-room h4{margin:6px 0 0;font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.05em;color:var(--quiet)}.quest-room-row{display:flex;align-items:center;justify-content:space-between;gap:8px}.quest-room-row h4{margin:0}.quest-room-link{min-height:28px;padding:2px 10px;border:1px solid var(--edge-strong);border-radius:7px;color:var(--accent);font-size:12px}
.quest-says{margin:0;padding:10px 12px;background:#000;color:#e8e8f0;border-radius:6px;font:600 12px/1.6 ui-monospace,SFMono-Regular,Consolas,monospace;letter-spacing:.03em}
.quest-things{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:6px}.quest-thing-row{display:flex;align-items:center;gap:10px;width:100%;min-height:44px;padding:6px 10px;background:var(--raised);border:1px solid var(--edge);border-radius:10px;text-align:left}.quest-thing-row:hover{border-color:var(--edge-strong)}.quest-things li.selected .quest-thing-row{border-color:var(--accent);background:var(--selected)}
.quest-thing-words{flex:1;min-width:0;display:flex;flex-direction:column;line-height:1.35}.quest-thing-words strong{font-size:13px}.quest-thing-words .section-note{line-height:1.35;white-space:normal;overflow-wrap:anywhere}.quest-thing-steps{white-space:nowrap}.quest-thing-row .icon{width:12px;height:12px;color:var(--quiet);transform:rotate(-90deg);flex-shrink:0}
.quest-pin{width:20px;height:20px;border-radius:50%;background:var(--accent);color:var(--accent-ink);font-size:11px;font-weight:700;display:flex;align-items:center;justify-content:center;flex-shrink:0}.quest-pin.trigger{background:var(--amber);color:var(--base)}
.quest-exits{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}.quest-exit{display:flex;flex-direction:column;align-items:flex-start;min-height:44px;padding:6px 10px;border:1px solid var(--edge);border-radius:10px;text-align:left;line-height:1.35}.quest-exit:hover{border-color:var(--edge-strong)}.quest-exit{min-width:0}.quest-exit strong{font-size:13px;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.quest-exits>p{grid-column:1/-1;margin:0}
.quest-space-button{display:flex;flex-direction:column;gap:6px;width:100%;margin-top:6px;padding:10px 12px;border:1px solid var(--edge);border-radius:10px;text-align:left}.quest-space-button:hover{border-color:var(--edge-strong)}.quest-space-top{display:flex;justify-content:space-between;align-items:baseline;gap:8px;width:100%}.quest-space-top strong{font-size:12px}
.health-bar{display:block;width:100%;height:6px;border-radius:3px;background:var(--edge);overflow:hidden}.health-bar>span{display:block;height:100%;background:var(--accent)}.health-bar.near>span,.health-meter.near .health-bar>span{background:#d9a441}.health-bar.over>span,.health-meter.over .health-bar>span{background:#e0605a}
.quest-thing.revealed{outline:2px solid var(--accent);outline-offset:4px;border-radius:8px}
/* Game health (the details sheet, once Under the hood): saved, built and checked as three steps, then the limits as bars. */
.health-steps{list-style:none;margin:0 0 14px;padding:0;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}.health-steps li{display:flex;gap:10px;align-items:flex-start;padding:10px;border:1px solid var(--edge);border-radius:10px;background:var(--raised);min-width:0}.health-steps li>div{display:flex;flex-direction:column;align-items:flex-start;gap:5px;min-width:0;font-size:12px;color:var(--muted)}.health-steps li>div>strong{font-size:13px;color:var(--text)}.health-steps .pill{height:auto;min-height:36px;min-width:0;max-width:100%;padding:4px 10px}.health-steps .pill small{white-space:normal}
.health-step-mark{width:22px;height:22px;border-radius:50%;border:2px solid var(--edge-strong);display:flex;align-items:center;justify-content:center;font-size:11px;font-weight:700;color:var(--muted);flex-shrink:0}.health-steps li[data-state=good] .health-step-mark{background:var(--green);border-color:var(--green);color:var(--base);font-size:0}.health-steps li[data-state=good] .health-step-mark::after{content:'✓';font-size:12px}.health-steps li[data-state=busy] .health-step-mark{border-color:var(--accent);color:var(--accent)}.health-steps li[data-state=old] .health-step-mark{border-color:var(--amber);color:var(--amber)}.health-steps li[data-state=bad] .health-step-mark{border-color:var(--error);color:var(--error)}
.health-meters{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px 24px;margin:8px 0 0}.health-meter{display:flex;flex-direction:column;gap:4px;min-width:0}.health-meter-head{display:flex;justify-content:space-between;gap:8px;font-size:12px}.health-meter dt{color:var(--text)}.health-meter dd{margin:0;color:var(--muted);white-space:nowrap}.health-meter.near dt,.health-meter.near dd{color:var(--amber)}.health-meter.over dt,.health-meter.over dd{color:var(--error)}
.health-quest,.health-limits{margin-top:14px;padding-top:12px;border-top:1px solid var(--edge)}.health-quest h3,.health-limits h3{font-size:13px;margin:0 0 8px}#health-space .health-bar{height:10px;border-radius:5px}#health-space-parts{margin:10px 0 0}#health-space-parts:empty{display:none}
.health-foot{display:flex;flex-wrap:wrap;gap:8px 10px;align-items:center;margin-top:14px;padding-top:12px;border-top:1px solid var(--edge)}.health-facts{margin-left:auto}.health-facts p{margin:6px 0 0}
@media(max-width:600px){.health-steps,.health-meters{grid-template-columns:minmax(0,1fr)}}
/* The Story board, one part at a time (16 November 2026): tabs for the parts, an outline of rooms beside the shown room's things. */
.quest-story-tabs{display:flex;flex-wrap:wrap;gap:4px}.quest-tab{display:inline-flex;align-items:center;gap:6px;min-height:36px;padding:4px 12px;border:1px solid transparent;border-radius:9px;color:var(--muted);font-size:13px}.quest-tab:hover{color:var(--text)}.quest-tab[aria-pressed=true]{background:var(--selected);border-color:var(--accent);color:var(--text);font-weight:600}.quest-tab-count{font-weight:400;font-size:12px;color:var(--muted)}
.quest-story-layout{display:grid;grid-template-columns:220px minmax(0,1fr);gap:16px;align-items:start}.quest-outline{position:sticky;top:84px;display:flex;flex-direction:column;gap:2px;max-height:calc(100dvh - 300px);overflow:auto;padding-right:4px}
.quest-outline button{display:flex;align-items:center;gap:8px;width:100%;min-height:32px;padding:4px 8px;border-radius:8px;text-align:left;font-size:13px}.quest-outline button:hover{background:var(--raised)}.quest-outline-room[aria-current=true]{background:var(--selected);font-weight:600}
.quest-outline-number{width:16px;flex-shrink:0;color:var(--quiet);font-size:12px;font-weight:400}.quest-outline-name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.quest-outline-count{color:var(--quiet);font-size:12px;font-weight:400}.quest-outline-thing{padding-left:32px!important;color:var(--muted)}
.quest-story-main{min-width:0;display:flex;flex-direction:column;gap:14px}
.quest-verb-group{display:flex;flex-direction:column;gap:6px;padding:8px 10px 10px;border:1px solid var(--edge);border-radius:10px;background:var(--base)}.quest-verb-title{margin:0;font-size:13.5px;font-weight:650;color:var(--text)}.quest-verb-group .quest-step-lead{text-transform:none;letter-spacing:0;font-size:12px;color:var(--muted)}
.quest-step-lead{margin:2px 0 -2px 2px;font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.05em;color:var(--quiet)}.quest-step-lead.warn{color:#d9a441;text-transform:none;letter-spacing:0;font-size:12px}
.quest-finish-open[data-verdict=yes]{border-color:#5fbf7a;color:var(--green)}.quest-finish-open[data-verdict=stuck],.quest-finish-open[data-verdict=partial]{border-color:#d9a441;color:var(--amber)}.quest-finish-open[data-verdict=no]{border-color:#e0605a;color:var(--error)}
/* Try it (Studio UX review, step 6): a third column beside a room's steps. */
.quest-story-layout.with-try{grid-template-columns:220px minmax(0,1fr) 300px}
.quest-try{position:sticky;top:84px;max-height:calc(100dvh - 300px);overflow:auto;display:flex;flex-direction:column;gap:10px;padding:12px 14px;border:1px solid var(--edge-strong);border-radius:12px;background:var(--panel)}
.quest-try-head{display:flex;align-items:center;justify-content:space-between}.quest-try-head h4{margin:0;font-size:14px}.quest-try>.section-note{margin:0}
.quest-try-field{display:grid;grid-template-columns:48px minmax(0,1fr);align-items:center;gap:8px;margin:0;font-size:13px}.quest-try-field select{min-width:0;width:100%;min-height:32px}
.quest-try-verbs{display:flex;flex-wrap:wrap;gap:6px}
.quest-try-result{display:flex;flex-direction:column;gap:6px;padding:10px;border:1px solid var(--edge);border-radius:10px;background:var(--base)}.quest-try-result .section-note{margin:0}.quest-try-result .quest-says{white-space:pre-line}
.quest-try-then{margin:0;padding-left:18px;font-size:13px}.quest-try-buttons{display:flex;flex-wrap:wrap;gap:6px;margin-top:4px}.quest-try-buttons .secondary{min-height:30px;font-size:12px;border:1px solid var(--edge-strong);border-radius:7px}
.quest-try-state{margin:0;padding:8px 10px;border:1px solid var(--edge);border-radius:10px;display:flex;flex-direction:column;gap:2px;min-width:0}.quest-try>*{flex-shrink:0}.quest-try-state legend{padding:0 4px;font-size:11px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--muted)}
.quest-try-state label{display:flex;align-items:center;gap:8px;margin:0;min-height:26px;font-size:13px}.quest-try-state input{width:16px;height:16px;min-height:0;margin:0;accent-color:var(--accent)}
.quest-story-main [data-step].revealed{outline:2px solid var(--accent);outline-offset:3px;border-radius:8px}
@media(max-width:1180px){.quest-story-layout.with-try{grid-template-columns:220px minmax(0,1fr)}.quest-try{grid-column:2;position:static;max-height:none}}
@media(max-width:760px){.quest-story-layout{grid-template-columns:minmax(0,1fr)}.quest-outline{position:static;max-height:none;flex-direction:row;flex-wrap:wrap}.quest-outline button{width:auto}.quest-outline-thing{padding-left:8px!important}}
