/* Library gestures stay separate from the editor's own paper zoom. */
html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
.app-layout,.library-drawer{touch-action:pan-y;overscroll-behavior-x:none}
.app-layout,.library-main{min-width:0;max-width:100%;overflow-x:clip}
.library-close{display:none}
dialog.library-drawer{position:fixed;inset:0;width:100vw;max-width:none;height:100dvh;max-height:none;margin:0;padding:0;border:0;border-radius:0;background:transparent;box-shadow:none;overflow:hidden;color:var(--ink)}
dialog.library-drawer[open]{display:block}
dialog.library-drawer>.sidebar{display:flex;position:absolute;inset:0 auto 0 0;width:min(300px,calc(100vw - 44px));height:100%;overflow-y:auto;overscroll-behavior:contain;padding-top:max(16px,env(safe-area-inset-top));padding-bottom:max(16px,env(safe-area-inset-bottom));box-shadow:16px 0 60px #0003}
.library-drawer .library-close{display:inline-grid;width:44px;height:44px;flex:none;margin-left:auto}
.library-drawer .brand{padding:0 0 18px;gap:8px}
.library-drawer .brand-icon{flex:none}
.library-drawer .nav-item{min-height:48px;font-size:14px}
.library-drawer .workspace-label{margin-bottom:16px}
.library-drawer .workspace-label>span{min-width:0;overflow-wrap:anywhere}
.library-drawer .sidebar-bottom{padding-top:24px}
.dock-recovery{display:none;position:absolute;bottom:max(12px,env(safe-area-inset-bottom));left:max(12px,env(safe-area-inset-left));z-index:25;align-items:center;gap:7px;min-height:44px;padding:8px 14px;border:1px solid var(--line);border-radius:24px;background:var(--panel);color:var(--ink);box-shadow:0 3px 18px #0002;touch-action:manipulation;font-size:13px}
.floating-toolbar[data-near-system-edge="true"]~.dock-recovery{display:inline-flex}
@media(max-width:900px){
 .app-layout{display:block;min-height:100dvh}
 .app-layout>.sidebar{display:none}
 .library-main{padding:max(16px,env(safe-area-inset-top)) max(16px,env(safe-area-inset-right)) max(30px,env(safe-area-inset-bottom)) max(16px,env(safe-area-inset-left));margin:0}
 .topbar{gap:10px;margin-bottom:28px;width:100%}
 .topbar .mobile-menu{display:inline-grid;flex:0 0 44px;width:44px;height:44px;background:var(--panel);border:1px solid var(--line)}
 .topbar .breadcrumb,.keyboard-hint{display:none}
 .topbar-right{flex:1;min-width:0;gap:10px}
 .topbar .search-box{flex:1;min-width:0;width:auto;max-width:none;min-height:44px;padding:10px}
 .topbar .search-box input{font-size:16px;width:0;min-width:0}
 .topbar .profile.account-button{display:grid;flex:0 0 44px;width:44px;height:44px}
 .welcome-head{align-items:stretch;gap:20px}
 .welcome-head>div{min-width:0}
 .welcome-head h1{font-size:clamp(30px,5.5vw,42px);line-height:1.12;letter-spacing:-1px;overflow-wrap:break-word}
 .welcome-head p{font-size:13px;line-height:1.6}
 .welcome-head .action-group .btn{font-size:14px;min-height:46px}
 .section-bar{flex-wrap:wrap;gap:10px}
 .section-bar h2{font-size:16px;min-width:0;overflow-wrap:anywhere}
 .section-bar .sort-select{font-size:16px;min-height:44px;max-width:145px}
 .card-title-row .icon-btn{width:40px;height:40px;flex:none}
 .card-title{font-size:13px}
 .notes-grid.list .note-card{grid-template-columns:55px minmax(0,1fr)}
 .notes-grid.list .card-meta{grid-column:2}
 .library-foot{text-align:center;line-height:1.5}
}
@media(max-width:480px){
 .welcome-head .action-group{width:100%}
 .welcome-head .action-group .btn{flex:1;padding:0 10px}
 .quick-actions{grid-template-columns:minmax(0,1fr);gap:10px;margin-bottom:24px}
 .quick-card{min-height:102px;padding:20px;padding-right:52px}
 .quick-card h3{font-size:22px;max-width:none}
 .quick-card p{font-size:12px;max-width:none}
 .quick-card .circle-button{width:30px;height:30px;bottom:18px;right:16px}
 .notes-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:16px 12px}
 .note-cover,.new-note-card{height:180px}
 .card-meta{flex-wrap:wrap;gap:4px;font-size:10px}
 .section-spacer{display:none}
 .sort-select{margin-left:auto}
}
@media(max-width:350px){
 .library-main{padding-left:12px;padding-right:12px}
 .topbar,.topbar-right{gap:6px}
 .welcome-head h1{font-size:29px}
 .note-cover{padding:14px 12px 0}
 .section-bar h2{font-size:14px}
 .section-bar .sort-select{max-width:124px;font-size:16px}
}
@media(pointer:coarse),(max-width:900px){
 input:not([type=range]):not([type=color]):not([type=checkbox]):not([type=radio]),select,textarea{font-size:16px}
}
