/* Scribe maps its existing workspace layout to the shared neutral interface tokens. */
html[data-ui-mode] {
 --bg-primary:var(--ui-bg);--bg-secondary:var(--ui-surface);--bg-panel:var(--ui-surface);--bg-card:var(--ui-surface);--bg-input:var(--ui-surface);
 --text-primary:var(--ui-fg);--text-secondary:var(--ui-muted);--text-muted:var(--ui-muted);
 --accent:var(--ui-primary);--accent-hover:var(--ui-primary);--accent-blue:var(--ui-fg);--accent-green:var(--ui-fg);
 --border:var(--ui-border);--border-light:var(--ui-border);--success:var(--ui-fg);--warning:var(--ui-muted);
 color-scheme:inherit;
}
html[data-ui-mode] :is(.nova-app,.shell,.auth,.guest-home,.platform-main,.platform-content,.platform-sidebar,.sidebar,.platform-topbar) {background:var(--ui-bg);color:var(--ui-fg)}
html[data-ui-mode] :is(.surface,.panel,.modal,.winbox,.workspace-switch,.sidebar-energy,.story-card,.story-cover,.stat-card,.welcome-hero,.character-card,.writer-canvas,.permanent-composer,.composer-context,.inline-notice,.bound-resources,.energy-plan,.wallet-balance,.market-symbol,.market-card,.settings-title,.instruction-preview-content article,.notebook-surface,.profile-avatar,.topbar-avatar,.avatar,.mode-badge,.platform-toast,.chapter-block,.chapter-block-header,.auth-story,.energy-card,.notice) {background:var(--ui-surface)!important;color:var(--ui-fg)!important;border-color:var(--ui-border)!important;background-image:none!important;box-shadow:none!important;border-radius:8px!important}
html[data-ui-mode] :is(.nova-app,.auth,.guest-home,.shell) :is(h1,h2,h3,p,small,label,span,strong,a,button,div) {color:inherit;border-color:var(--ui-border)}
html[data-ui-mode] :is(.muted,.overline,.nav-label,.breadcrumbs,.page-title-row p,.brand small,.quiet-footer,.billing-note) {color:var(--ui-muted)!important}
html[data-ui-mode] :is(.n-button.primary,.primary,.btn-primary,nav button.active,.filter-tabs .selected) {background:var(--ui-primary)!important;color:var(--ui-primary-ink)!important;border-color:var(--ui-primary)!important}
html[data-ui-mode] :is(.hero-illustration,.cover-orbit) {display:none}
html[data-ui-mode] .hero-copy {max-width:100%}
html[data-ui-mode] .icon-button {width:44px;min-width:44px;height:44px;padding:0}
html[data-ui-mode] .interface-mode-toggle svg {width:20px;height:20px}
html[data-ui-mode] .toggle-switch {background:var(--ui-border)}
html[data-ui-mode] .toggle-switch:after {background:var(--ui-fg)}
html[data-ui-mode] .switch-label input:checked+.toggle-switch {background:var(--ui-primary)}
html[data-ui-mode] .switch-label input:checked+.toggle-switch:after {background:var(--ui-primary-ink)}
.scribe-preferences {display:flex;align-items:center;gap:8px;flex-shrink:0}
.scribe-preferences label {margin:0}
.scribe-preferences select {width:auto;max-width:130px}
.sr-only {position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.public-topbar {display:flex;justify-content:space-between;align-items:center;gap:12px;min-height:64px;padding:10px clamp(12px,4vw,48px);border-bottom:1px solid var(--ui-border);background:var(--ui-bg)}
.public-topbar .logo {font-size:20px;text-decoration:none;color:var(--ui-fg)}
.public-topbar .scribe-preferences {margin-left:auto}
.market-load-more,.catalog-load-more {display:flex;margin:20px auto;justify-content:center}
.market-card h2,.market-card p,.market-author {overflow-wrap:anywhere;min-width:0}
.story-cover h2 {overflow-wrap:anywhere}
.auth {min-height:calc(100dvh - 85px)}
html[data-ui-mode] .guest-home {min-height:calc(100dvh - 85px)}
@media(max-width:700px){
 .market-page .page-title-row{flex-direction:column;align-items:stretch;gap:16px}
 .market-page .page-title-row>div{min-width:0}
 .market-page .page-title-row>button{width:100%}
 .market-card-footer{flex-direction:column;align-items:stretch;gap:12px}
 .market-card-footer .n-button{width:100%}
 .platform-topbar{padding:8px 12px;gap:8px;height:auto;min-height:64px;flex-wrap:wrap}
 .topbar-actions{gap:8px;margin-left:auto;max-width:100%}
 .topbar-search,.topbar-avatar,.topbar-actions .mode-badge{display:none}
 .breadcrumbs{min-width:0;white-space:normal}
 .scribe-preferences select{max-width:112px}
 .platform-content{padding:20px 12px}
 .platform-topbar .breadcrumbs>span{display:none}
}
@media(max-width:600px){
 .collection-grid{grid-template-columns:minmax(0,1fr)}
 .story-card-bottom{gap:12px;font-size:12px}
 .story-card-bottom button,.manage-articles{font-size:13px;white-space:nowrap}
}
