/* App chrome only. Ancillary pages opt in during packaging; never applied to exports. */
body.lb-ancillary {background:var(--lb-bg)!important;color:var(--lb-text)!important;}
.lb-ancillary :where(header,main,aside,section,article,nav,footer,details,summary,form,dialog,.card,.panel,.step,.note,.badge,.tag,.hero,.callout,.box) {background-color:var(--lb-surface)!important;color:var(--lb-text)!important;border-color:var(--lb-border)!important;box-shadow:none!important;}
.lb-ancillary :where(h1,h2,h3,h4,p,li,strong,small,label,a,span,code,pre,td,th) {color:var(--lb-text)!important;border-color:var(--lb-border)!important;}
.lb-ancillary :where(.badge,.tag,code,pre,.note,.callout) {background:var(--lb-surface-raised)!important;}
.lb-ancillary :where(button,input,textarea,select,.button,.btn) {background:var(--lb-surface-raised)!important;color:var(--lb-text)!important;border-color:var(--lb-border-strong)!important;}
.lb-ancillary :where(p,li,small,label,a,span,button,input,select,summary,code) {font-size:max(13px,1em);}
.lb-ancillary :where(button,summary,.button,.btn,nav a,header a,footer a) {min-height:var(--lb-control-h,44px);box-sizing:border-box;display:inline-flex;align-items:center;}
.lb-ancillary :where(main,section,article,header,footer) {max-width:100%;box-sizing:border-box;overflow-wrap:anywhere;}
.lb-ancillary [data-liubai-theme-toggle] {margin:var(--lb-space-4,16px);}
body :where(select):not(.lb-user-content select) {appearance:none;-webkit-appearance:none;min-height:var(--lb-control-h,44px);padding-block:var(--lb-space-3,12px);padding-right:var(--lb-space-6,24px);background-image:linear-gradient(45deg,transparent 50%,currentColor 50%),linear-gradient(135deg,currentColor 50%,transparent 50%);background-position:calc(100% - 16px) 50%,calc(100% - 11px) 50%;background-size:5px 5px;background-repeat:no-repeat;}
form .liubai-auth-modes button[aria-pressed="true"] {background:var(--lb-selected-fill)!important;color:var(--lb-selected-text)!important;border-color:var(--lb-border-strong)!important;}
dialog :where(form,div[data-login]) {gap:var(--lb-space-3,12px);}
dialog :where(label) {display:block;margin-block:var(--lb-space-2,8px);}
dialog :where(input,select,button) {min-height:var(--lb-control-h,44px);}
dialog :where(.dialog-head) {display:flex;align-items:center;justify-content:space-between;gap:var(--lb-space-3,12px);}
#restore-banner {position:relative;inset:auto;margin-block:var(--lb-space-4,16px);}
@media(max-width:600px){
 .app-header .header-actions {display:flex;flex-wrap:wrap;gap:var(--lb-space-2,8px);}
 .app-header #save-status {flex-basis:100%;}
 .app-header .wordmark {white-space:nowrap;}
 .app-header :where(button,.file-button) {min-height:var(--lb-control-h,44px);}
}
/* Sticky article actions must not cover form inputs/restore controls on small screens. */
@media(max-width:600px){
 #articleTaskActions {position:static!important;inset:auto!important;}
}
/* Findings from Claude's actual-page sweep; no changes to teaching/policy copy. */
.lb-ancillary :where(.notice,.num,.mobile-flow,.mock,.screen,.flow,.flow-node,.step-number) {background:var(--lb-surface-raised)!important;color:var(--lb-text)!important;border-color:var(--lb-border)!important;}
.lb-ancillary :where(.mobile-flow li,.num) {color:var(--lb-text)!important;}
body #pubStepOne,body #pubStepTwo,body #pubStepThree {color:var(--lb-text)!important;background:var(--lb-surface-raised)!important;}
body a.lb-tutorial-link {color:var(--lb-text)!important;background:var(--lb-surface)!important;border-color:var(--lb-border)!important;}
body :where(select):not(.lb-user-content select),body #pubOpen {min-height:var(--lb-control-h,44px)!important;}
body :is(a[href="privacy.html"],a[href="terms.html"],a[href="deletion.html"],a[href="/privacy.html"],a[href="/terms.html"],a[href="/deletion.html"],.skip-link) {display:inline-flex;align-items:center;min-height:var(--lb-control-h,44px);}
@media(max-width:600px){.savebar #undo:disabled,.savebar #redo:disabled {display:none;}}
.lb-ancillary :where(.comparison,.file-map,.progress-panel,.hero-note,.grid>a,section>a) {background:var(--lb-surface-raised)!important;color:var(--lb-text)!important;border-color:var(--lb-border)!important;}
.lb-ancillary figcaption {color:var(--lb-text)!important;}
.lb-ancillary :where(.eyebrow,.flow,.source-note,small,label,button,a,span) {font-size:max(13px,1em)!important;}
.lb-ancillary :where(a,button,summary) {min-width:44px!important;min-height:44px!important;box-sizing:border-box;display:inline-flex;align-items:center;}
body a.skip {min-height:44px;display:inline-flex;align-items:center;}

.lb-ancillary section>a:has(h2) {display:block;}
/* Preserve existing actions; repair hierarchy and spacing without artwork selectors. */
.workspace>.ux-design {padding:var(--lb-space-6,24px);}
.ux-design>button:first-child {position:static;margin-bottom:var(--lb-space-4,16px);}
html[data-ai-product=article] body>header {display:flex;flex-wrap:wrap;gap:var(--lb-space-3,12px);align-items:center;}
html[data-ai-product=article] body>header>.logo {order:-2;}
html[data-ai-product=article] body>header>[data-liubai-theme-toggle] {order:-1;}
html[data-ai-product=article] #accountButton {border:1px solid var(--lb-border-strong);background:var(--lb-surface-raised);color:var(--lb-text);min-height:44px;padding:var(--lb-space-3,12px);}
@media(max-width:600px){
 .app-header .header-actions {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));width:100%;}
 .app-header #save-status {grid-column:1/-1;}
 .app-header .header-actions>* {min-width:0;max-width:100%;}
}
.lb-ancillary .checks label {background:var(--lb-surface-raised)!important;}
body .workspace-avatar,body a.lb-usage-help {background:var(--lb-surface)!important;color:var(--lb-text)!important;border-color:var(--lb-border)!important;}
/* Relocated recovery bar must also drop the original fixed-position translation. */
#restore-banner {transform:none;max-width:100%;flex-wrap:wrap;}
/* Round 2: application chrome. Never select canvas, artwork, exported documents. */
body {background-color:var(--lb-bg);color:var(--lb-text);}
dialog button+button {margin-inline-start:var(--lb-space-2,8px);}
dialog :is(.actions,.row,.liubai-auth-modes) {gap:var(--lb-space-2,8px);}
body:has(#richBody)>header>.logo {order:-5!important;white-space:nowrap;}
body:has(#batchFiles) .brand {white-space:nowrap;display:flex;flex-direction:row;gap:var(--lb-space-2,8px);}
body:has(#batchFiles) #save {position:fixed;bottom:var(--lb-space-4,16px);right:var(--lb-space-4,16px);z-index:40;box-shadow:0 2px 8px #0005;}
@media(max-width:600px){
 .app-header {display:flex;flex-wrap:wrap;gap:8px;padding-block:8px;}
 .app-header .header-actions {display:flex!important;flex-wrap:wrap;width:auto;gap:8px;}
 .app-header #save-status {font-size:13px;flex-basis:auto!important;}
 body:has(#publisher) [data-liubai-theme-toggle] {width:auto!important;min-width:44px;justify-self:start;}
}
#question-status[role=alert],#status[role=alert] {border:1px solid var(--lb-border-strong);padding:var(--lb-space-3,12px);border-radius:var(--lb-radius-sm,8px);}
@media(max-width:600px){
 body .app-header:has(.wordmark) {display:grid!important;grid-template-columns:1fr auto!important;padding:8px 12px!important;gap:8px!important;}
 body .app-header:has(.wordmark) .header-actions {grid-column:1/-1;grid-row:2;display:flex!important;justify-content:flex-start!important;gap:8px!important;}
 body .app-header:has(.wordmark) #save-status {font-size:13px;line-height:1.3;}
 body .app-header:has(.wordmark) #open-onboarding {grid-column:2;grid-row:1;}
 body .app-header:has(.sidebar-channels)>[data-liubai-theme-toggle] {width:max-content!important;max-width:130px!important;}
}
body:has(#batchFiles) #save {position:fixed!important;bottom:16px!important;right:16px!important;top:auto!important;}
body:has(#batchFiles) aside .brand {display:flex!important;white-space:nowrap!important;flex-direction:row!important;}
body:has(#batchFiles) aside .brand span {display:inline!important;}
body>header>.logo {order:-10!important;}

#question-flow-status[role=alert],#workflow-status[role=alert],#generation-status[role=alert] {border:1px solid var(--lb-border-strong);background:var(--lb-surface-raised);padding:12px;}

#question-input-error:not(:empty) {border:1px solid var(--lb-border-strong);padding:var(--lb-space-3,12px);background:var(--lb-surface-raised);}
#sidebarNew.button.lime {color:var(--lb-selected-text)!important;background:var(--lb-selected-fill)!important;border-color:var(--lb-border-strong)!important;}
@media(max-width:600px){
 body .app-header:has(.wordmark) .header-actions {display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr));width:100%;}
 body .app-header:has(.wordmark) #save-status {grid-column:1/-1;grid-row:2;font-size:13px;}
 body .app-header:has(.wordmark) .header-actions :is(button,label) {padding:8px 4px!important;min-width:0;}
}

body[data-mode=edit] #batchPanel {padding-block:var(--lb-space-3,12px);}
body[data-mode=edit] #batchPanel :is(.eyebrow,.hint) {margin-block:var(--lb-space-2,8px);}
body[data-mode=edit] .edit-quick-help {margin-block:var(--lb-space-2,8px);}
body[data-mode=edit] .edit-quick-help summary {min-height:44px;display:flex;align-items:center;cursor:pointer;}
@media(max-width:600px){body[data-mode=edit] main>header {padding-block:8px;}body[data-mode=edit] #videoWorkflow {padding:8px;margin-block:8px;}body[data-mode=edit] #modeIntro {margin-block:8px;} }

body a.lb-usage-help {color:var(--lb-text)!important;border-color:var(--lb-border-strong)!important;background:var(--lb-surface)!important;}
