.palette-grid{display:grid;grid-template-columns:repeat(7,1fr);gap:10px}.palette-swatch{width:100%;aspect-ratio:1;max-width:45px;border-radius:50%;background:var(--swatch);border:1px solid #bec8b8}.palette-custom{display:flex;gap:15px;align-items:center}.palette-custom input[type=color]{width:55px;height:44px;border:0;background:none}.palette-wheel{width:19px;height:19px;border-radius:50%;background:conic-gradient(#b94d51,#d7ac4d,#77a477,#779ac3,#b994c5,#b94d51);border:2px solid white;box-shadow:0 0 0 1px #89927e}.paper-form{display:grid;grid-template-columns:1fr 1fr;gap:0 15px}.paper-form select{font-size:12px}.paper-form input[type=color]{display:block;width:100%;height:36px;border:0;background:none}.paper-form .range-value{display:flex;align-items:center;gap:8px;height:42px}.range-value input{width:70%;accent-color:var(--green)}.range-value output{white-space:nowrap;font-size:11px}.template-actions{display:flex;gap:8px;flex-wrap:wrap;margin:20px 0}.template-actions button{font-size:11px;padding:0 10px;flex:1}.template-list{display:grid;max-height:200px;overflow:auto}.template-item{display:flex;align-items:center;gap:10px;padding:12px 2px;border-top:1px solid var(--line);text-align:left}.template-item span{flex:1}.template-item small{font-size:10px;color:var(--muted)}
.brand-icon{position:relative;display:inline-block;overflow:hidden;flex:none;width:38px;height:38px;vertical-align:middle;border:0;background:none;padding:0}.brand-icon img{position:absolute;width:198%;height:198%;max-width:none;left:-49%;top:-52%;object-fit:contain}.brand .brand-icon{width:40px;height:40px}.brand{letter-spacing:-1px}.brand-icon.boot-logo{width:75px;height:75px}.editor-v2 .editor-logo.brand-icon{display:inline-block;width:27px;height:27px;border:0;padding:0}.workspace-label .avatar.brand-icon{width:31px;height:31px}.profile.brand-icon{width:30px;height:30px}@media(max-width:680px){.editor-v2 .editor-logo.brand-icon{display:none}}
.auth-shell{min-height:100dvh;display:grid;place-items:center;padding:32px 20px;background:#f2f0e9}.auth-card{width:min(100%,390px);padding:36px;background:#fffef9;border:1px solid #e1e1d7;border-radius:28px;box-shadow:0 18px 90px #343e3010;text-align:center}.brand-icon.auth-logo{width:82px;height:82px}.auth-card h1{margin:12px 0 28px;letter-spacing:-1.5px;font-size:32px}.auth-card h2{font-size:19px}.auth-card p{font-size:14px;line-height:1.6;color:#69705e}.auth-card form,.modal-body form{display:grid;gap:15px;text-align:left}.auth-card label,.modal-body form label{display:grid;gap:7px;font-size:13px}.auth-card .btn{justify-content:center}.auth-foot{display:block;margin-top:24px;color:#808573}.auth-error[role=alert]{color:#9d382b;white-space:pre-wrap;margin:0;min-height:0}.auth-error:empty{display:none}.account-user{display:flex;gap:9px;align-items:center;flex-wrap:wrap;padding:12px 0;border-bottom:1px solid #e4e5dc}.account-user span{flex:1;min-width:140px}.account-user small{display:block;font-size:12px;margin-top:5px}.account-user .btn{padding:8px;font-size:12px}.modal-body details{margin:18px 0}.modal-body summary{cursor:pointer;margin-bottom:14px}.profile.account-button{cursor:pointer}.auth-message{padding:18px;background:#f2f2eb;border-radius:12px}
.editor-v2 .editor-header-actions>[data-action="page-format"]{display:inline-grid}.sidebar .account-menu{width:100%;justify-content:flex-start;margin:6px 0 10px;font-size:12px}
@media(max-width:680px){.topbar-right .profile.account-button{display:inline-block}.topbar-right{gap:7px}.search-box{width:min(250px,64vw)}.editor-v2 .document-title{max-width:37vw}}

.theme-settings{display:grid;gap:18px}.theme-settings>label{display:grid;gap:8px}.theme-preview{height:110px;background:var(--workspace-bg,#e9eee6);border:1px solid var(--line);border-radius:12px;display:grid;place-items:center}.theme-preview-paper{width:80px;height:88px;padding:15px;color:#30392e;background:#fffefb;font-family:Georgia,serif;box-shadow:0 2px 8px #0002}.paper-presets{display:flex;gap:10px;margin-top:14px}.appearance-shortcut{margin:10px 0;font-size:12px}.theme-settings input[type=color]{width:100%;min-height:36px;border:1px solid var(--line);border-radius:8px;background:var(--panel)}
/* A fixed bottom inset can end above the visible bottom in iOS/PWA windows.
   Give the actual editor a viewport-unit height, independent of that inset. */
.editor.editor-fullpage{position:fixed;inset:0 0 auto;padding:0;width:auto;height:100vh;height:100dvh;max-height:var(--editor-keyboard-height,none)}
/* Installed apps have no browser toolbar. Include their translucent system
   areas in the paper; safe-area padding belongs only to the floating controls. */
.editor.editor-fullpage[data-standalone=true]{height:100vh;height:100lvh}
@media (display-mode:standalone),(display-mode:fullscreen){.editor.editor-fullpage{height:100vh;height:100lvh}}
.editor-fullpage .editor-body{height:100%;flex:1}
.editor-fullpage .canvas-viewport{padding:0;position:absolute;inset:0;width:100%;height:100%}
.editor-fullpage .page-stack{gap:8px;padding:0}
.editor-fullpage .paper-holder{border-radius:0;outline:0;box-shadow:0 3px 5px #0000001a,0 1px 1px #00000015}
.editor-fullpage .page-caption{display:none}
.editor-fullpage .floating-toolbar,.editor-fullpage .floating-toolbar.is-minimized{width:max-content;min-width:0;height:auto;padding:3px;border-radius:19px;display:block;--toolbar-safe-top:env(safe-area-inset-top,0px);--toolbar-safe-right:env(safe-area-inset-right,0px);--toolbar-safe-bottom:env(safe-area-inset-bottom,0px);--toolbar-safe-left:env(safe-area-inset-left,0px)}
.editor-fullpage .toolbar-triad{display:flex;align-items:center;gap:0;touch-action:none;border-radius:15px;cursor:grab;outline-offset:4px}
.editor-fullpage .toolbar-triad>button,.editor-fullpage .floating-toolbar.is-minimized [data-toolbar-toggle]{display:grid;place-items:center;width:43px;min-width:43px;height:42px;border-radius:13px;background:transparent;color:inherit;margin:0}
.editor-fullpage .toolbar-triad>button+button{border-left:1px solid #7e8d7326}
.editor-fullpage [data-toolbar-toggle] .icon{width:22px;height:22px}
.editor-fullpage .toolbar-triad>button[aria-expanded=true]{background:#dfe8d7;color:#345530}
.editor-fullpage .floating-toolbar-content{position:absolute;top:calc(100% + 8px);left:0;width:300px;max-width:calc(100vw - 24px);max-height:calc(100dvh - 100px);padding:10px;gap:9px;background:#fcfdf7f5;border:1px solid #d8dfcf;border-radius:18px;box-shadow:0 8px 28px #20302122;backdrop-filter:blur(18px);-webkit-backdrop-filter:blur(18px);overflow:auto;touch-action:pan-y;box-sizing:border-box}
.editor-fullpage .floating-toolbar-content .tool{height:40px;width:33px}
.editor-fullpage .floating-toolbar-content .tool-group{flex-wrap:wrap;justify-content:center;width:100%}
.editor-fullpage .floating-toolbar-content .toolbar-colors{margin-right:auto}
.editor-fullpage .selection-bar{bottom:max(12px,env(safe-area-inset-bottom,0px))}
.editor-fullpage .pages-panel{padding-top:max(18px,env(safe-area-inset-top,0px))}
.editor-settings-zoom{display:flex;gap:7px;align-items:center;margin:12px 0;padding-bottom:12px;border-bottom:1px solid #7e8d7330}
.editor-settings-zoom .btn{margin-left:auto}.editor-settings-zoom #settings-zoom{min-width:48px}
.paper-category-tabs{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:12px}.paper-category-tabs button{border:1px solid #7e8d7340;border-radius:20px;padding:7px 11px;font-size:12px}.paper-category-tabs .active{background:#dfe8d7;color:#345530}
.paper-preset-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:9px;margin-bottom:16px}.paper-preset-card{min-width:0;display:grid;gap:6px;text-align:center;font-size:11px}.paper-preset-card>span{display:block;height:62px;border:1px solid #7e8d7340;border-radius:8px;background:var(--paper-swatch);box-shadow:0 2px 3px #0001}.paper-preset-card.active>span{outline:2px solid #718f60;outline-offset:2px}.paper-preview-sample{height:82px;border:1px solid #7e8d7330;border-radius:10px;position:relative;overflow:hidden;margin:12px 0;box-shadow:0 2px 5px #0001}.paper-preview-sample canvas{width:100%;height:100%;display:block}
.paper-preset-card[data-texture=paperback]>span{background-image:repeating-linear-gradient(12deg,#80643b08 0 1px,transparent 1px 4px)}.paper-preset-card[data-texture=papyrus]>span{background-image:repeating-linear-gradient(0deg,#976c3212 0 1px,transparent 1px 4px),repeating-linear-gradient(90deg,#976c3208 0 1px,transparent 1px 8px)}

/* The first outside tap dismisses the panel without reaching the ink canvas. */
.editor-fullpage .properties-backdrop{position:absolute;inset:0;z-index:29;border:0;border-radius:0;background:transparent;padding:0;touch-action:none;cursor:default}
.editor-fullpage .properties-backdrop[hidden]{display:none}
.editor-fullpage .properties-panel{padding-top:max(20px,env(safe-area-inset-top,0px));padding-bottom:max(20px,env(safe-area-inset-bottom,0px))}

.modal-header .menu-back,.panel-heading .menu-back{flex:0 0 38px;margin-right:6px}.modal-header h2{flex:1;min-width:0}.input-mode-setting{width:100%;margin-bottom:16px;justify-content:center}.properties-panel .panel-heading>span{flex:1;min-width:0}

/* The official neoFILMS artwork has its own clear, uncropped space in the library. */
.sidebar .library-brand{position:relative;display:flex;justify-content:center;padding:0 0 24px;letter-spacing:0}.library-brand-art{display:grid;justify-items:center;gap:10px;width:150px;max-width:100%}.library-brand-art img{position:static;width:138px;height:134px;max-width:100%;object-fit:contain}.library-brand-art>span{font-size:18px;font-weight:600;letter-spacing:-.6px}.library-brand-art .neofilms-dark{display:none}:root[data-theme=dark] .library-brand-art .neofilms-dark{display:block}:root[data-theme=dark] .library-brand-art .neofilms-light{display:none}.library-drawer .library-brand{justify-content:center;padding:0 0 20px}.library-drawer .library-brand .library-close{position:absolute;top:0;right:0}.library-drawer .library-brand-art img{width:124px;height:121px}.sidebar{overflow-y:auto;overscroll-behavior:contain}.sidebar .workspace-label{flex-shrink:0}

/* Keep the shared dock usable above the paper/tools drawer. The paper stack
   retains its own isolation; native modal dialogs remain in the top layer. */
.editor-fullpage .drawing-area{isolation:auto}
.editor-fullpage .floating-toolbar{z-index:34}
.editor-fullpage .dock-recovery{z-index:33}

/* Official neospace artwork keeps its complete proportions in every brand slot. */
.brand-icon{display:inline-grid;place-items:center;background:#fff;border-radius:8px}
.brand-icon img{position:static;display:block;width:100%;height:100%;max-width:100%;object-fit:contain;left:auto;top:auto}
.brand-icon.boot-logo,.brand-icon.auth-logo{width:160px;height:82px;border-radius:12px}
.workspace-label .avatar.brand-icon{width:42px;height:32px}
.topbar .profile.brand-icon.account-button{display:inline-grid;width:72px;height:44px;flex:0 0 72px;border:1px solid var(--line);border-radius:10px}
.library-brand-art{width:190px}.library-brand-art img.neospace-logo,.library-drawer .library-brand-art img.neospace-logo{display:block;width:180px;height:88px;max-width:100%;padding:5px;background:#fff;border-radius:10px;object-fit:contain}
@media(max-width:900px){.topbar .profile.brand-icon.account-button{width:64px;flex-basis:64px}.library-drawer .library-brand-art{width:180px}}
