/* Keep note management inside each card at every viewport width. */
#noteGrid .note-card{min-width:0;}
#noteGrid .note-card-menu{min-width:0;max-width:100%;box-sizing:border-box;}
#noteGrid .note-card-menu>summary{min-height:36px;gap:6px;font-weight:600;}
#noteGrid .note-card-menu>summary:focus-visible{outline:2px solid var(--accent);outline-offset:3px;border-radius:6px;}
#noteGrid .note-card-menu .note-card-footer{display:flex;flex-direction:column;align-items:stretch;gap:12px;padding:12px;box-sizing:border-box;min-width:0;max-width:100%;border:1px solid var(--border-color);border-radius:14px;background:var(--panel-bg);box-shadow:var(--surface-shadow);}
#noteGrid .note-card-footer .library-category-row{flex:none;width:100%;min-width:0;}
#noteGrid .note-card-footer .library-category-row select{width:100%;max-width:none;height:38px;font-size:13px;padding:7px 10px;border:1px solid var(--border-color);border-radius:9px;background:var(--panel-bg-soft);}
#noteGrid .note-card-footer .note-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));width:100%;min-width:0;padding:0;gap:8px;}
#noteGrid .note-card-footer .note-actions button{display:flex;align-items:center;justify-content:center;gap:6px;min-width:0;max-width:100%;min-height:42px;padding:9px 10px;font-size:13px;line-height:1.45;white-space:normal;overflow-wrap:anywhere;border:1px solid var(--border-color);border-radius:10px;box-sizing:border-box;cursor:pointer;}
#noteGrid .note-card-footer .note-actions button::before{flex-shrink:0;margin:0;}
#noteGrid .note-card-footer .note-share{background:var(--accent);color:#fff;border-color:var(--accent);font-weight:650;}
#noteGrid .note-card-footer .note-open{background:var(--accent-soft);color:var(--accent);font-weight:650;}
#noteGrid .note-card-footer .note-cloud-upload,#noteGrid .note-card-footer .note-drive-upload{grid-column:1/-1;background:var(--panel-bg-soft);color:var(--text-color);justify-content:flex-start;}
#noteGrid .note-card-footer .note-delete{grid-column:1/-1;width:100%;font-size:12px!important;min-height:36px;margin-top:4px;padding-top:10px;border:0;border-top:1px solid var(--border-color);border-radius:0;background:transparent;color:var(--danger-text);}
#noteGrid .note-card-footer .note-delete:hover{background:var(--danger-bg);}
#noteGrid .note-card-footer .note-actions button:focus-visible{outline:2px solid var(--accent);outline-offset:2px;}
#noteGrid .note-card-footer .note-actions button:hover{filter:brightness(.97);}
@media(max-width:420px){#noteGrid .note-card-menu .note-card-footer{padding:10px;}#noteGrid .note-card-footer .note-actions button{font-size:12px;padding:9px 7px;}}
