/* The four-region frame. World canvases, documents and editor styles are untouched. */
:root{--atlas-shell-motion:180ms;--atlas-work-height:50dvh}
.atlas-symbol{display:inline-block;width:22px;height:22px;flex:0 0 22px;background:currentColor;mask:var(--atlas-symbol) center/contain no-repeat;-webkit-mask:var(--atlas-symbol) center/contain no-repeat}
.atlas-symbol[data-symbol=dashboard]{--atlas-symbol:url('/atlas-assets/icons/dashboard.svg')}
.atlas-symbol[data-symbol=edit_note]{--atlas-symbol:url('/atlas-assets/icons/edit_note.svg')}
.atlas-symbol[data-symbol=folder_open]{--atlas-symbol:url('/atlas-assets/icons/folder_open.svg')}
.atlas-symbol[data-symbol=menu_book]{--atlas-symbol:url('/atlas-assets/icons/menu_book.svg')}
.atlas-symbol[data-symbol=place]{--atlas-symbol:url('/atlas-assets/icons/place.svg')}
.atlas-symbol[data-symbol=vertical_align_top]{--atlas-symbol:url('/atlas-assets/icons/vertical_align_top.svg')}
#workspace-left #atlas-category-nav{display:flex;flex-wrap:wrap;gap:6px 10px;margin:0 0 22px;font:10px/1.6 var(--atlas-font)}
#workspace-left #atlas-category-nav>a{padding:4px 2px;border-radius:0;border-bottom:1px solid transparent;color:var(--atlas-text)}
#workspace-left #atlas-category-nav>a[aria-current=true]{border-bottom-color:var(--atlas-text-muted);background:transparent}
#atlas-category-nav .category-planned{display:flex;align-items:center;gap:4px;padding:4px 2px;color:var(--atlas-text-muted)}
#atlas-category-nav small{font-size:8px}
#workspace-left #atlas-related{padding-top:16px;border-top:1px solid var(--atlas-border);gap:5px;margin:0 0 20px}
#workspace-left #atlas-related>a{padding:5px 8px;border-color:var(--atlas-border);color:var(--atlas-text-muted);font-size:10px}

/* Explicit rows avoid using the old reader/Memo ratio for the new support frame. */
body.atlas-shell-ready #workspace-right,
body.atlas-shell-ready.reader-fullscreen #workspace-right{grid-template-columns:minmax(0,1fr);grid-template-rows:auto auto minmax(0,1fr) auto;background:var(--atlas-bg);color:var(--atlas-text);font-family:var(--atlas-font)}
body.atlas-shell-ready.conversation-open #workspace-right,
body.atlas-shell-ready.reader-fullscreen.conversation-open #workspace-right{grid-template-rows:auto auto minmax(0,1fr) minmax(160px,34%)}
body.atlas-shell-ready #workspace-right>.reader{grid-column:1;grid-row:3;min-height:0;background:var(--atlas-panel)}
body.atlas-shell-ready #workspace-right>.conversation{grid-column:1;grid-row:4;background:var(--atlas-bg);border-top:1px solid var(--atlas-border)}
body.atlas-shell-ready #system-tools{grid-column:1;grid-row:1;display:flex;align-items:center;gap:6px;flex-wrap:wrap;margin:0;padding:10px 12px;border-bottom:1px solid var(--atlas-border)}
body.atlas-shell-ready:has(#central-world.atlas-hub.atlas-design-preview) #system-tools{margin:0;padding:10px 12px}
body.atlas-shell-ready #system-tools>span{color:var(--atlas-text-muted)}
body.atlas-shell-ready #system-tools>button{display:inline-flex;align-items:center;justify-content:center;background:transparent;color:var(--atlas-tool-color,var(--atlas-text));border-color:var(--atlas-border);border-radius:var(--atlas-control-radius);width:32px;height:32px}
#system-tools>button[aria-expanded=true]{border-color:var(--atlas-hover-border);background:var(--atlas-active-surface)}
#atlas-ai{grid-column:1;grid-row:2;padding:10px 12px;border-bottom:1px solid var(--atlas-border);font-size:11px}
.atlas-support-heading{display:flex;align-items:center;gap:10px;min-width:0}
.atlas-support-heading h2{font:400 15px/1.5 var(--atlas-font-display);margin:0 auto 0 0;letter-spacing:.035em}
.atlas-support-heading>button{flex-shrink:0;min-width:30px;min-height:30px;padding:4px 7px;border:1px solid var(--atlas-border);border-radius:var(--atlas-control-radius);background:transparent;color:var(--atlas-text);font-family:var(--atlas-font)}
#atlas-ai #tab-chat{padding:3px 0;border:0;border-radius:0;text-align:left;font-size:12px}
#atlas-ai #tab-chat[aria-expanded=true]{box-shadow:0 1px 0 var(--atlas-text-muted)}
#atlas-ai .atlas-pending-label{margin-left:auto;font-size:10px;color:var(--atlas-text-muted)}
#atlas-ai #chat-pane{max-height:18dvh;overflow:auto;color:var(--atlas-text-muted);font-size:11px;line-height:1.8}
#atlas-ai #chat-pane>p{margin:12px 0 2px}
body.atlas-shell-ready #notes-pane:not([hidden]){animation:atlas-open-up var(--atlas-shell-motion) ease-out}
body.atlas-shell-ready .conversation-tabs button{font-family:var(--atlas-font);color:var(--atlas-text);background:transparent;border-color:var(--atlas-border)}
body.atlas-shell-ready #tab-notes[aria-expanded=true]{border-color:var(--atlas-hover-border);background:var(--atlas-active-surface)}

/* Desk covers only the reader cell. Its iframe/editor nodes remain in place. */
#atlas-desk{grid-column:1;grid-row:3;z-index:3;min-height:0;padding:20px 18px;overflow:auto;background:var(--atlas-bg);border-inline-start:1px solid var(--atlas-border);animation:atlas-open-right var(--atlas-shell-motion) ease-out}
#atlas-desk>p{font-size:12px;line-height:1.8;color:var(--atlas-text-muted);margin:20px 0}
.atlas-desk-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.atlas-desk-grid>button{display:flex;flex-direction:column;align-items:flex-start;gap:14px;min-height:88px;padding:16px 12px;text-align:left;color:var(--atlas-text);background:var(--atlas-panel);border:1px solid var(--atlas-border);border-radius:var(--atlas-control-radius);font:400 12px/1.6 var(--atlas-font);overflow-wrap:anywhere}
.atlas-desk-grid .atlas-symbol{width:26px;height:26px;flex-basis:26px}
.atlas-desk-home{display:inline-block;margin-top:24px;font-size:12px;color:var(--atlas-text-muted);text-decoration:underline;text-underline-offset:4px}
body.atlas-desk-open .top-actions :is(#new-source,#reload-source,#share-source,#expand-reader,#toggle-code){display:none!important}

/* Full-width receiver. A single selected Workspace tool or Lab mounts here. */
#atlas-work-panel{position:fixed;left:0;right:0;bottom:0;height:var(--ui-bp-height,var(--atlas-work-height));z-index:120;min-width:0;display:flex;flex-direction:column;background:var(--atlas-bg);color:var(--atlas-text);font-family:var(--atlas-font);border:1px solid var(--atlas-border);border-bottom:0;border-radius:var(--atlas-radius) var(--atlas-radius) 0 0;padding:14px 18px;animation:atlas-open-up var(--atlas-shell-motion) ease-out}
/* Work and code drawers are mutually exclusive. Reuse the existing bottom
   reservation so all three columns and narrow-screen fixed panels stay above it. */
body.atlas-work-open{--drawer-height:var(--ui-bp-height,var(--atlas-work-height))}
/* Expanded Work can leave less height than Tools, AI and Memo need together. */
body.atlas-shell-ready.atlas-work-open #workspace-right{overflow-y:auto}
body.atlas-work-expanded{--atlas-work-height:100dvh}
body.atlas-work-expanded #atlas-work-panel{z-index:120;border-radius:0}
#work-panel-resizer{height:12px;flex:0 0 12px;margin:-12px -12px 4px;cursor:ns-resize;touch-action:none;display:grid;place-items:center}
#work-panel-resizer::after{content:'';width:56px;height:3px;border-radius:3px;background:var(--atlas-text-muted);opacity:.6}
#work-panel-resizer:focus-visible{outline:2px solid var(--atlas-accent-cyan);outline-offset:-2px}
body.atlas-work-resizing{cursor:ns-resize;user-select:none}
body.atlas-work-resizing iframe{pointer-events:none}
#atlas-work-panel{max-height:100dvh}
#work-panel-language{font:12px var(--atlas-font);background:var(--atlas-panel);color:var(--atlas-text);border:1px solid var(--atlas-border);padding:5px;border-radius:var(--atlas-control-radius)}
body.atlas-shell-ready #system-tools>button[data-work-tool]{width:36px;height:36px;padding:3px}
#system-tools [data-work-tool] svg{width:28px;height:28px;display:block}
#system-tools [data-work-tool][aria-pressed=true]{border-color:var(--atlas-accent-cyan);background:var(--atlas-active-surface)}
#system-tools>button[hidden],#work-open-workspace[hidden],#mode-workspace[hidden]{display:none!important}
#atlas-lab-host{flex:1;min-height:0;display:flex;margin-top:10px;border:1px solid var(--atlas-border);border-radius:var(--atlas-control-radius);overflow:hidden}
#atlas-lab-host iframe{width:100%;height:100%;flex:1;min-height:0;border:0;background:var(--atlas-bg)}
.atlas-work-intro{min-height:0;overflow:auto;padding:20px 4px;color:var(--atlas-text-muted);font-size:12px;line-height:1.9}
.atlas-work-intro>p{margin:10px 0}
.atlas-work-intro>p:last-child{font-size:11px}
#atlas-work-panel>.atlas-support-heading{flex-shrink:0}
#atlas-work-panel .atlas-work-intro[hidden]{display:none}
#atlas-authoring-host{position:relative;inset:auto;flex:1;min-height:0;min-width:0;overflow:auto;margin-top:10px;box-shadow:none;border:1px solid var(--atlas-border);border-radius:var(--atlas-control-radius);outline:none}
#atlas-authoring-host #mw-expand{display:none}
#atlas-authoring-host #mw-language{display:none}
#atlas-authoring-host[data-phase=setup] .mw-filebar,#atlas-authoring-host[data-phase=setup] .mw-modes,#atlas-authoring-host[data-phase=setup] .mw-recordbar{display:none}
#atlas-authoring-host[data-phase=setup] .mw-layout{grid-template-columns:minmax(0,1fr) minmax(180px,25%)}
#atlas-authoring-host[data-phase=setup] .mw-center{min-height:0}
#atlas-authoring-host[data-phase=setup] .mw-context>:not(label):not(#mw-new-project){display:none}
.mw-setup{padding:18px 24px;max-width:900px;margin:auto}
.mw-setup h2{font-size:24px;font-weight:400;margin:0 0 12px}
.mw-setup p{line-height:1.8}
#mw-setup-actions,#mw-setup-files{display:flex;flex-wrap:wrap;gap:10px;margin:16px 0}
@media(max-width:700px){#atlas-authoring-host[data-phase=setup] .mw-layout{grid-template-columns:minmax(0,1fr)}#atlas-authoring-host[data-phase=setup] .mw-context{max-height:130px}.mw-setup{padding:14px}}
#authoring-host-status{flex-shrink:0;margin:6px 0 0;font-size:12px;line-height:1.6;color:var(--atlas-text-muted)}
#authoring-host-status:empty{display:none}
#authoring-close-dialog{max-width:min(460px,calc(100vw - 32px));padding:24px;color:var(--atlas-text);background:var(--atlas-bg);border:1px solid var(--atlas-border);border-radius:var(--atlas-radius);font:14px/1.8 var(--atlas-font)}
#authoring-close-dialog::backdrop{background:rgba(8,12,20,.65)}
#authoring-close-dialog h2{font:400 18px/1.5 var(--atlas-font-display);margin:0 0 14px}
.authoring-close-actions{display:flex;justify-content:flex-end;flex-wrap:wrap;gap:10px;margin-top:20px}
:is(#work-open-workspace,.authoring-close-actions>button){padding:8px 12px;border:1px solid var(--atlas-border);border-radius:var(--atlas-control-radius);background:var(--atlas-panel);color:var(--atlas-text);font:inherit}
#authoring-save-close{border-color:var(--atlas-text-muted)}
#authoring-close-dialog button:disabled{opacity:.5;cursor:wait}
#atlas-desk[hidden],#atlas-work-panel[hidden]{display:none}
#atlas-desk button:hover,#atlas-work-panel button:hover,body.atlas-shell-ready #system-tools>button:not(:disabled):hover{border-color:var(--atlas-hover-border);box-shadow:var(--atlas-hover-shadow)}
:is(#atlas-category-nav,#atlas-desk,#atlas-ai,#atlas-work-panel,#system-tools) :is(a,button):focus-visible{outline:2px solid var(--atlas-accent-cyan);outline-offset:3px}
/* Quiet page shortcuts; these remain links, not a new Browser tab engine. */
body:has(#central-world.atlas-hub.atlas-design-preview) #header-shortcuts>a{padding:5px 0;border-bottom:1px solid transparent}
body:has(#central-world.atlas-hub.atlas-design-preview) #header-shortcuts>a[aria-current=page]{color:var(--atlas-text);border-bottom-color:var(--atlas-text-muted)}
@keyframes atlas-open-right{from{transform:translateX(100%)}to{transform:translateX(0)}}
@keyframes atlas-open-up{from{transform:translateY(100%)}to{transform:translateY(0)}}
@media(max-width:760px){#atlas-work-panel{padding:12px 14px}.atlas-desk-grid{gap:8px}}
@media(prefers-reduced-motion:reduce){:root{--atlas-shell-motion:0ms}}

/* Pack height never overrides the existing full-size workbench command. */
body.atlas-work-expanded{--ui-bp-height:100dvh!important}
