*{box-sizing:border-box}body{margin:0;font-family:system-ui,-apple-system,Segoe UI,sans-serif;font-size:14px;color:#1e293b;background:#f8fafc;-webkit-text-size-adjust:100%}.app-root{min-height:100vh;min-height:100dvh;display:flex;flex-direction:column;padding-bottom:env(safe-area-inset-bottom,0)}.auth-panel{max-width:400px;margin:4rem auto;padding:2rem;background:#fff;border-radius:12px;box-shadow:0 4px 24px #0f172a14}.auth-panel h1{margin:0 0 1rem;font-size:1.25rem}.auth-panel input{width:100%;margin-bottom:.75rem;padding:.5rem .75rem;border:1px solid #cbd5e1;border-radius:8px}.auth-panel button{width:100%;padding:.6rem;border:none;border-radius:8px;background:#2563eb;color:#fff;font-weight:600;cursor:pointer}.auth-panel .tabs{display:flex;gap:.5rem;margin-bottom:1rem}.auth-panel .tabs button{background:#e2e8f0;color:#334155}.auth-panel .tabs button.active{background:#2563eb;color:#fff}.auth-panel .auth-otp-hint{margin:0 0 .75rem;font-size:.9rem;color:#64748b}.auth-panel .auth-otp-back{margin-top:.5rem;background:#e2e8f0;color:#334155}.main-layout{display:flex;flex:1;min-height:0}.sidebar{width:380px;flex-shrink:0;border-right:1px solid #e2e8f0;background:#fff;display:flex;flex-direction:column;min-height:0}.sidebar-toolbar-row{padding:.65rem .75rem;border-bottom:1px solid #e2e8f0}.sidebar-new-note-btn{width:100%}.sidebar-filters-bar{display:flex;flex-wrap:wrap;align-items:center;gap:.5rem;padding:.45rem .75rem;border-bottom:1px solid #e2e8f0;background:#fafafa}.sidebar-filters-toggle{flex:1 1 auto;min-width:0;text-align:left;padding:.4rem .5rem;border:1px solid #e2e8f0;border-radius:8px;background:#fff;font-size:13px;color:#475569;cursor:pointer}.sidebar-filters-toggle:hover{background:#f8fafc;border-color:#cbd5e1}.sidebar-filters-toggle--active{border-color:#93c5fd;background:#eff6ff;color:#1d4ed8}.sidebar-filters-badge{font-size:11px;font-weight:600;color:#1d4ed8;background:#dbeafe;padding:.2rem .45rem;border-radius:6px;white-space:nowrap}.sidebar-filters-panel{padding:.75rem;border-bottom:1px solid #e2e8f0;display:flex;flex-wrap:wrap;gap:.5rem;align-items:center}.sidebar-filters-panel input,.sidebar-filters-panel select{padding:.35rem .5rem;border:1px solid #cbd5e1;border-radius:6px;font-size:13px}.sidebar-trash-label{display:inline-flex;align-items:center;gap:.35rem;font-size:13px;color:#334155;cursor:pointer;-webkit-user-select:none;user-select:none}.note-list{flex:1;overflow-y:auto;list-style:none;margin:0;padding:0}.note-list li{display:flex;align-items:center;gap:.5rem;padding:.6rem .75rem;cursor:pointer;border-bottom:1px solid #f1f5f9}.note-list li:hover{background:#f8fafc}.note-list li.selected{background:#eff6ff;border-left:3px solid #2563eb}.note-list li.unsaved .title:after{content:" •";color:#ea580c;font-weight:700}.note-list .thumb{width:48px;height:48px;object-fit:cover;border-radius:4px;background:#e2e8f0;flex-shrink:0}.note-list .meta{flex:1;min-width:0}.note-list .title{font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.note-list .sub{font-size:12px;color:#64748b}.editor-pane{flex:1;display:flex;flex-direction:column;min-width:0;background:#fff}.editor-toolbar{padding:.5rem .75rem;border-bottom:1px solid #e2e8f0;display:flex;flex-wrap:wrap;gap:.5rem;align-items:center}.editor-pane .editor-toolbar{flex-wrap:nowrap;overflow-x:auto;-webkit-overflow-scrolling:touch;scrollbar-width:thin}.app-top-bar{position:relative;z-index:10;flex-shrink:0;background:#fff;box-shadow:0 1px 2px #0f172a0f}.app-top-bar-left{display:flex;flex-wrap:wrap;align-items:center;gap:.75rem 1rem;min-width:0}.idle-lock-countdown{font-size:12px;font-variant-numeric:tabular-nums;color:#64748b;white-space:nowrap}.app-top-bar .logout-btn{margin-left:.5rem}.editor-status{flex:0 1 auto;min-width:0;display:flex;flex-wrap:wrap;gap:.5rem 1rem;align-items:center;font-size:13px;min-height:1.35rem}.editor-status-dirty{color:#c2410c;font-weight:600}.editor-status-saving{color:#2563eb}.editor-status-ok{color:#15803d}.editor-status-idle{color:#64748b}.editor-status-error{color:#b91c1c;font-weight:500}.editor-hint{font-size:12px;color:#94a3b8;margin-left:auto;flex-shrink:0}.editor-toolbar button:disabled{opacity:.55;cursor:not-allowed}.editor-toolbar button{padding:.35rem .75rem;border-radius:6px;border:1px solid #cbd5e1;background:#fff;cursor:pointer;font-size:13px}.editor-toolbar button.primary{background:#2563eb;color:#fff;border-color:#2563eb}.editor-fields{padding:.75rem;display:flex;flex-direction:column;gap:.5rem}.editor-field{display:flex;flex-direction:column;gap:.2rem;width:100%}.editor-field-label{font-size:11px;font-weight:600;color:#64748b}.editor-fields input:not([type=file]),.editor-fields textarea{width:100%;padding:.5rem .65rem;border:1px solid #cbd5e1;border-radius:8px;font-family:inherit}.editor-fields textarea.body{min-height:200px;font-family:ui-monospace,monospace;font-size:13px}.tabs-editor{display:flex;gap:.25rem;margin-bottom:.5rem}.tabs-editor button{padding:.35rem .75rem;border:none;background:#e2e8f0;border-radius:6px 6px 0 0;cursor:pointer}.tabs-editor button.active{background:#fff;border:1px solid #e2e8f0;border-bottom:none}.preview-md{padding:.75rem;border:1px solid #e2e8f0;border-radius:8px;min-height:220px;overflow:auto;background:#fafafa;line-height:1.5}.preview-md a{color:#2563eb}.preview-md h1,.preview-md h2,.preview-md h3,.preview-md h4{margin:1rem 0 .5rem;font-weight:600;line-height:1.3}.preview-md h1{font-size:1.5rem}.preview-md h2{font-size:1.25rem}.preview-md h3{font-size:1.1rem}.preview-md h4{font-size:1rem}.preview-md p{margin:0 0 .75rem}.preview-md ul,.preview-md ol{margin:0 0 .75rem;padding-left:1.5rem}.preview-md li{margin:.25rem 0}.preview-md pre{margin:.75rem 0;padding:.75rem;overflow:auto;border-radius:8px;background:#f1f5f9;font-size:13px;font-family:ui-monospace,Cascadia Code,Source Code Pro,Menlo,monospace}.preview-md code{font-family:ui-monospace,Cascadia Code,Source Code Pro,Menlo,monospace;font-size:.92em;padding:.15em .35em;border-radius:4px;background:#f1f5f9}.preview-md pre code{padding:0;background:none}.preview-md blockquote{margin:.75rem 0;padding-left:1rem;border-left:4px solid #cbd5e1;color:#475569}.preview-md table{border-collapse:collapse;width:100%;margin:.75rem 0;font-size:13px}.preview-md th,.preview-md td{border:1px solid #e2e8f0;padding:.4rem .6rem}.preview-md th{background:#f1f5f9;font-weight:600}.preview-md img{max-width:100%;height:auto;border-radius:4px;vertical-align:middle}.preview-md hr{border:none;border-top:1px solid #e2e8f0;margin:1rem 0}.attach-drop-zone{margin-top:0;padding:.75rem;border:2px dashed #cbd5e1;border-radius:8px;background:#fafafa;transition:border-color .15s,background .15s}.attach-drop-zone.drag-hover{border-color:#2563eb;background:#eff6ff}.attach-drop-zone.uploading{opacity:.7;pointer-events:none}.attach-hint{margin:0 0 .5rem;font-size:12px;color:#64748b}.attach-file-pick{position:relative;display:inline-flex;align-items:center;margin-bottom:.5rem;padding:.4rem .85rem;border-radius:6px;background:#e2e8f0;color:#1e293b;font-size:13px;cursor:pointer;-webkit-user-select:none;user-select:none}.attach-file-pick:hover{background:#cbd5e1}.attach-file-pick:focus-within{outline:2px solid #2563eb;outline-offset:2px}.attach-file-pick:has(input:disabled),.attach-file-pick.attach-file-pick-disabled{opacity:.55;cursor:not-allowed;pointer-events:none}.attach-file-input-sr{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.attach-drop-zone h3{margin:0 0 .5rem;font-size:.9rem}.attach-thumb-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(118px,1fr));gap:.5rem}.attach-thumb-tile{border-radius:8px;overflow:hidden;background:#e2e8f0;cursor:pointer;outline:none}.attach-thumb-tile:focus-visible{outline:2px solid #2563eb;outline-offset:2px}.attach-thumb-tile-inner{position:relative;aspect-ratio:1;width:100%}.attach-thumb-img{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%;object-fit:cover;display:block}.attach-thumb-placeholder{position:absolute;top:0;right:0;bottom:0;left:0;background:#e8eef4;display:flex;align-items:center;justify-content:center}.attach-thumb-placeholder:after{content:"";width:44px;height:44px;flex-shrink:0;opacity:.55;background:center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpolyline points='14 2 14 8 20 8'/%3E%3C/svg%3E")}.attach-thumb-placeholder--image:after{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='18' height='18' rx='2' ry='2'/%3E%3Ccircle cx='8.5' cy='8.5' r='1.5'/%3E%3Cpolyline points='21 15 16 10 5 21'/%3E%3C/svg%3E")}.attach-thumb-filename{position:absolute;left:0;right:0;bottom:0;padding:1.1rem .35rem .35rem;font-size:10px;line-height:1.2;max-height:3.6em;overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;color:#fff;text-shadow:0 1px 2px rgba(0,0,0,.85);background:linear-gradient(to top,rgba(0,0,0,.55),transparent);word-break:break-all}.attach-thumb-delete{position:absolute;top:4px;right:4px;width:26px;height:26px;padding:0;border:none;border-radius:999px;background:#00000073;color:#fff;font-size:18px;line-height:1;cursor:pointer;display:flex;align-items:center;justify-content:center}.attach-thumb-delete:hover:not(:disabled){background:#000000a6}.attach-thumb-delete:disabled{opacity:.45;cursor:not-allowed}.attach-preview-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:9000;display:flex;align-items:center;justify-content:center;padding:1rem;background:#0f172abf;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px)}.attach-preview-panel{width:100%;max-width:min(92vw,960px);max-height:88vh;display:flex;flex-direction:column;border-radius:12px;background:#fff;box-shadow:0 20px 50px #0f172a59;overflow:hidden}.attach-preview-header{display:flex;flex-wrap:wrap;align-items:flex-start;justify-content:space-between;gap:.5rem 1rem;padding:.65rem .85rem;border-bottom:1px solid #e2e8f0}.attach-preview-title{margin:0;font-size:.95rem;font-weight:600;flex:1 1 12rem;min-width:0;word-break:break-all}.attach-preview-header-actions{display:flex;flex-wrap:wrap;align-items:center;gap:.35rem .65rem}.attach-preview-link{font-size:13px;color:#2563eb;text-decoration:none}.attach-preview-link:hover{text-decoration:underline}.attach-preview-close{padding:.35rem .65rem;border-radius:6px;border:1px solid #cbd5e1;background:#fff;font-size:13px;cursor:pointer}.attach-preview-body{padding:.85rem;overflow:auto}.attach-preview-body--image{padding:.5rem;display:flex;align-items:center;justify-content:center;min-height:200px;max-height:calc(88vh - 5rem);background:#0f172a}.attach-preview-img{max-width:100%;max-height:calc(88vh - 5.5rem);width:auto;height:auto;object-fit:contain}.attach-preview-meta{margin:0;font-size:14px;line-height:1.6;color:#334155}.error-msg{color:#b91c1c;font-size:13px;margin-top:.5rem}.error-msg-list{color:#b91c1c;font-size:13px;margin:.5rem 0 0;padding-left:1.25rem;list-style:disc}.error-msg-list li{margin-top:.25rem}.screen-lock-overlay{position:fixed;top:0;right:0;bottom:0;left:0;z-index:10000;display:flex;align-items:center;justify-content:center;padding:1.5rem;background:#0f172ae0;-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px)}.screen-lock-panel{width:100%;max-width:400px;padding:1.75rem;border-radius:12px;background:#fff;box-shadow:0 20px 50px #0f172a59}.screen-lock-panel h2{margin:0 0 .75rem;font-size:1.15rem}.screen-lock-desc{margin:0 0 .75rem;font-size:13px;color:#475569;line-height:1.5}.screen-lock-email{margin:0 0 .75rem;font-size:13px;font-weight:600;color:#1e293b;word-break:break-all}.screen-lock-input{width:100%;padding:.55rem .75rem;border:1px solid #cbd5e1;border-radius:8px;font-size:14px}.screen-lock-actions{display:flex;flex-direction:column;gap:.65rem;margin-top:1rem}.screen-lock-actions .primary{padding:.55rem 1rem;border-radius:8px;border:none;background:#2563eb;color:#fff;font-weight:600;cursor:pointer;font-size:14px}.screen-lock-actions .primary:disabled{opacity:.55;cursor:not-allowed}.screen-lock-logout{background:none;border:none;color:#64748b;font-size:13px;cursor:pointer;text-decoration:underline;padding:.25rem}.screen-lock-logout:disabled{opacity:.5;cursor:not-allowed}.app-top-bar-user{display:flex;flex-wrap:wrap;align-items:center;gap:.35rem .5rem;justify-content:flex-end;min-width:0;flex:1 1 auto}.app-top-bar-account-btn{max-width:min(100%,52vw);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:.25rem .5rem;border-radius:8px;border:1px solid transparent;background:transparent;font:inherit;font-weight:600;color:#1e293b;cursor:pointer;text-align:right}.app-top-bar-account-btn:hover{background:#f1f5f9;border-color:#e2e8f0}.account-dialog{width:100%;max-width:380px;padding:1.15rem 1.25rem;border-radius:12px;background:#fff;box-shadow:0 20px 50px #0f172a40}.account-dialog-title{margin:0 0 1rem;font-size:1.1rem;font-weight:600}.account-dialog-fields{margin:0}.account-dialog-fields>div{margin-bottom:.85rem}.account-dialog-fields dt{margin:0 0 .2rem;font-size:11px;font-weight:600;color:#64748b;text-transform:none}.account-dialog-fields dd{margin:0;font-size:14px;color:#1e293b;word-break:break-all}.account-dialog-email{font-variant-numeric:tabular-nums}.account-dialog-footer{margin-top:1rem;padding-top:.75rem;border-top:1px solid #e2e8f0;display:flex;justify-content:flex-end}.account-dialog-close{padding:.45rem 1rem;border-radius:8px;border:1px solid #cbd5e1;background:#fff;font-size:14px;cursor:pointer}.account-dialog-close:hover{background:#f8fafc}.mobile-back-to-list{padding:.45rem .7rem;border-radius:8px;border:1px solid #cbd5e1;background:#f1f5f9;font-size:14px;font-weight:600;cursor:pointer;flex-shrink:0;min-height:44px}.notebook-toolbar{display:flex;flex-direction:column;align-items:stretch;gap:.5rem;padding:.6rem .75rem;border-bottom:1px solid #e2e8f0;background:#f8fafc}.notebook-toolbar-label{display:flex;flex-direction:column;gap:.2rem;font-size:11px;font-weight:600;color:#64748b;width:100%;min-width:0}.notebook-toolbar-label select{padding:.35rem .5rem;border:1px solid #cbd5e1;border-radius:6px;font-size:13px;max-width:100%}.notebook-toolbar-settings-row{display:flex;justify-content:stretch}.notebook-toolbar-settings-btn{width:100%}.notebook-toolbar-btn{padding:.35rem .55rem;border-radius:6px;border:1px solid #cbd5e1;background:#fff;font-size:12px;cursor:pointer}.notebook-toolbar-btn:disabled{opacity:.5;cursor:not-allowed}.notebook-toolbar-btn.danger{border-color:#fecaca;color:#b91c1c;background:#fef2f2}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:8500;display:flex;align-items:center;justify-content:center;padding:1rem;background:#0f172a8c;-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px)}.notebook-settings-dialog{width:100%;max-width:440px;max-height:min(88vh,640px);overflow:auto;padding:1.15rem 1.25rem;border-radius:12px;background:#fff;box-shadow:0 20px 50px #0f172a40}.notebook-settings-title{margin:0 0 .5rem;font-size:1.1rem;font-weight:600}.notebook-settings-current{margin:0 0 1rem;font-size:13px;color:#64748b;line-height:1.45}.notebook-settings-actions{display:flex;flex-wrap:wrap;gap:.4rem;margin-bottom:1.25rem}.notebook-settings-section{margin-bottom:1rem;padding-top:.75rem;border-top:1px solid #e2e8f0}.notebook-settings-section-title{margin:0 0 .5rem;font-size:.85rem;font-weight:600;color:#64748b}.notebook-settings-footer{margin-top:.5rem;padding-top:.75rem;border-top:1px solid #e2e8f0;display:flex;justify-content:flex-end}.notebook-settings-close-btn{padding:.45rem 1rem;border-radius:8px;border:1px solid #cbd5e1;background:#fff;font-size:14px;cursor:pointer}.notebook-settings-close-btn:hover{background:#f8fafc}.members-list{list-style:none;margin:0 0 .5rem;padding:0}.members-list li{display:flex;flex-wrap:wrap;align-items:center;gap:.35rem;padding:.25rem 0;border-bottom:1px solid #f1f5f9}.members-remove{margin-left:auto;padding:.15rem .4rem;font-size:11px;border-radius:4px;border:1px solid #cbd5e1;background:#fff;cursor:pointer}.members-invite{display:flex;flex-wrap:wrap;gap:.35rem;align-items:center}.members-invite input{flex:1 1 160px;min-width:0;padding:.3rem .45rem;border:1px solid #cbd5e1;border-radius:6px}.members-invite select{padding:.3rem .45rem;border:1px solid #cbd5e1;border-radius:6px}.members-invite button{padding:.3rem .55rem;border-radius:6px;border:1px solid #2563eb;background:#2563eb;color:#fff;font-size:12px;cursor:pointer}.notebook-empty{padding:.5rem .75rem;margin:0;font-size:12px;color:#64748b}.editor-status-viewer{color:#b45309;font-weight:600;margin-right:.35rem}@media (max-width: 768px){.app-top-bar{flex-wrap:wrap;gap:.5rem;padding-left:max(.5rem,env(safe-area-inset-left));padding-right:max(.5rem,env(safe-area-inset-right));padding-top:max(.35rem,env(safe-area-inset-top))}.app-top-bar-account-btn{max-width:100%;text-align:left}.idle-lock-countdown{font-size:11px}.app-top-bar-left{flex:1;min-width:0}.auth-panel{margin:1rem auto;padding:1.25rem;max-width:none;width:calc(100% - 1.5rem)}.main-layout--mobile{flex-direction:column;flex:1;min-height:0}.main-layout--mobile.main-layout--show-list .editor-pane{display:none!important}.main-layout--mobile:not(.main-layout--show-list) .sidebar{display:none!important}.main-layout--mobile:not(.main-layout--show-list) .editor-pane{display:flex!important;flex:1;min-height:0}.main-layout--mobile.main-layout--show-list .sidebar{width:100%;border-right:none;flex:1;min-height:0}.sidebar-toolbar-row .primary,.sidebar-filters-panel button,.sidebar-filters-panel select,.sidebar-filters-toggle{min-height:44px}.sidebar-filters-panel input[type=text]{min-height:44px;font-size:16px}.note-list li{min-height:48px;padding:.65rem .75rem}.editor-toolbar{padding:.5rem;gap:.4rem}.editor-pane .editor-toolbar .editor-status{flex:1 1 auto;min-width:0}.editor-toolbar button{min-height:44px;padding:.4rem .65rem}.editor-hint-desktop{display:none}.editor-fields textarea.body{min-height:min(50vh,360px);font-size:16px}.editor-fields input:not([type=file]){font-size:16px;min-height:44px}.preview-md{min-height:min(50vh,360px)}.attach-file-pick{min-height:44px;align-items:center}.screen-lock-overlay{padding:max(1rem,env(safe-area-inset-top)) max(1rem,env(safe-area-inset-right)) max(1rem,env(safe-area-inset-bottom)) max(1rem,env(safe-area-inset-left))}}
