:root{color:#172033;background:#f6f7f9;--page: #f6f7f9;--panel: #ffffff;--panel-soft: #fbfcfe;--ink: #172033;--muted: #6b7280;--line: #e5e7eb;--sidebar: #111827;--sidebar-active: #263244;--accent: #facc15;font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif;font-synthesis:none;text-rendering:optimizeLegibility}:root[data-theme=dark]{color:#e5e7eb;background:#050505;--page: #0a0a0a;--panel: #141414;--panel-soft: #1f1f1f;--ink: #f8fafc;--muted: #a3a3a3;--line: #333333;--sidebar: #050505;--sidebar-active: #242424;--accent: #eab308}*{box-sizing:border-box}body{margin:0;min-width:320px;min-height:100vh}button,input,textarea,.rich-editor{font:inherit}button{border:0;cursor:pointer}button:disabled{cursor:not-allowed;opacity:.45}.app-shell{display:grid;grid-template-columns:1fr;min-height:100vh}.sidebar{display:flex;flex-direction:column;gap:18px;min-height:auto;max-height:36vh;padding:14px;color:#f8fafc;background:var(--sidebar)}.brand{display:flex;align-items:center;gap:12px}.brand-mark{display:grid;place-items:center;width:38px;height:38px;border-radius:8px;color:#111827;background:var(--accent);font-weight:800}.brand strong,.brand span{display:block}.brand span{margin-top:2px;color:#9ca3af;font-size:13px}.new-note{display:flex;align-items:center;justify-content:center;gap:8px;width:100%;min-height:42px;border-radius:8px;color:#111827;background:#f8fafc;font-weight:700}.note-list{display:flex;flex:1;flex-direction:column;gap:8px;overflow-x:auto;overflow-y:hidden;flex-direction:row}.note-item{display:grid;grid-template-columns:28px 1fr;gap:10px;width:210px;flex:0 0 210px;padding:12px;border-radius:8px;color:#d1d5db;background:transparent;text-align:left}.note-item.active,.note-item:hover{background:var(--sidebar-active)}.note-item strong,.note-item small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.note-item small,.muted{margin-top:4px;color:#9ca3af;font-size:12px}.identity{display:grid;gap:8px}.identity label{color:#9ca3af;font-size:12px;font-weight:700;text-transform:uppercase}.identity input{width:100%;min-height:38px;border:1px solid #374151;border-radius:8px;padding:0 10px;color:#f8fafc;background:#1f2937}.workspace{display:grid;grid-template-rows:auto auto auto 1fr;min-width:0;min-height:64vh;background:var(--page)}.toast-stack{position:fixed;right:14px;top:14px;z-index:30;display:grid;gap:8px;width:min(360px,calc(100vw - 28px))}.toast{border:1px solid var(--line);border-radius:8px;padding:11px 12px;color:var(--ink);background:var(--panel);box-shadow:0 14px 40px #0000002e;font-size:13px;font-weight:750;animation:toast-in .22s ease-out,toast-out .26s ease-in 3.94s forwards}@keyframes toast-in{0%{opacity:0;transform:translateY(-8px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}@keyframes toast-out{to{opacity:0;transform:translateY(-8px) scale(.98)}}.landing-panel{display:grid;place-items:center;align-content:center;gap:14px;min-height:64vh;padding:24px;color:var(--ink);text-align:center}.landing-panel h1,.landing-panel p{margin:0}.landing-panel p{max-width:430px;color:var(--muted)}.landing-mark{display:grid;place-items:center;width:64px;height:64px;border-radius:16px;color:#111827;background:var(--accent);font-size:30px;font-weight:900}.landing-panel button,.load-note button{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:42px;border-radius:8px;padding:0 14px;color:#111827;background:var(--accent);font-weight:850}.load-note{display:grid;gap:8px;width:min(100%,420px)}.load-note input{height:42px;border:1px solid var(--line);border-radius:8px;padding:0 12px;color:var(--ink);background:var(--panel)}.topbar{display:flex;align-items:flex-start;justify-content:space-between;flex-direction:column;gap:16px;padding:16px 20px;border-bottom:1px solid var(--line);background:var(--panel)}.title-block{min-width:0}.title-input{width:100%;border:0;outline:0;color:var(--ink);background:transparent;font-size:25px;font-weight:800}.status-line{display:flex;align-items:center;gap:10px;color:var(--muted);font-size:13px;flex-wrap:wrap}.status-dot{width:8px;height:8px;border-radius:50%;background:#9ca3af}.status-dot.online{background:#16a34a}.status-dot.connecting{background:#f59e0b}.top-actions,.toolbar{display:flex;align-items:center;gap:8px;width:100%;overflow-x:auto}.top-actions button,.toolbar button{display:grid;place-items:center;width:38px;height:38px;border:1px solid var(--line);border-radius:8px;color:var(--ink);background:var(--panel)}.top-actions button:hover,.toolbar button:hover{background:color-mix(in srgb,var(--accent),transparent 82%)}.presence{display:flex;align-items:center}.presence span{display:grid;place-items:center;width:30px;height:30px;margin-left:-7px;border:2px solid #ffffff;border-radius:50%;color:#fff;font-size:12px;font-weight:800}.presence span:first-child{margin-left:0}.toolbar{min-height:58px;padding:10px 20px;border-bottom:1px solid var(--line);background:var(--panel-soft);scrollbar-width:none}.toolbar-presence{display:flex;align-items:center;gap:8px;min-width:0;margin-left:0;color:var(--muted);font-size:13px;white-space:nowrap}.upload-button{display:grid;place-items:center;flex:0 0 auto;width:38px;height:38px;border:1px solid var(--line);border-radius:8px;color:var(--ink);background:var(--panel);cursor:pointer}.upload-button input{display:none}.editor-grid{display:grid;grid-template-columns:minmax(0,1fr);min-height:0}.editor-grid.single,.editor-grid.with-history{grid-template-columns:1fr}.editor-grid.wysiwyg{background:linear-gradient(90deg,transparent 0 28px,color-mix(in srgb,var(--line),transparent 60%) 28px 29px,transparent 29px),var(--page)}.editor{width:100%;min-height:0;border:0;border-right:1px solid var(--line);outline:0;resize:none;padding:28px;color:var(--ink);background:var(--panel);font-family:SFMono-Regular,Consolas,Liberation Mono,monospace;font-size:15px;line-height:1.7}.preview{overflow-y:auto;padding:28px;color:var(--ink);background:var(--page);line-height:1.7}.preview h1,.preview h2,.preview h3{color:var(--ink);line-height:1.2}.preview h1{font-size:32px}.preview a{color:#2563eb}.preview code{border-radius:6px;padding:2px 5px;background:#e5e7eb}.preview pre{overflow-x:auto;border-radius:8px;padding:16px;color:#f8fafc;background:#111827}.preview pre code{padding:0;background:transparent}.preview table{width:100%;border-collapse:collapse}.preview th,.preview td{border:1px solid #d1d5db;padding:8px 10px}.preview blockquote{margin-left:0;border-left:4px solid #facc15;padding-left:14px;color:#4b5563}.canvas-wrap{position:relative;overflow-y:auto;min-width:0;min-height:0;padding:16px}.canvas-wrap.with-lines{display:grid;grid-template-columns:34px minmax(0,900px);justify-content:center;gap:8px}.line-numbers{display:grid;align-content:start;gap:0;grid-column:1;grid-row:1;width:34px;padding-top:24px;color:var(--muted);font-family:SFMono-Regular,Consolas,monospace;font-size:12px;line-height:1.72;text-align:right;-webkit-user-select:none;user-select:none}.rich-editor{grid-column:1;grid-row:1;width:min(100%,900px);min-height:calc(100vh - 360px);margin:0 auto;border:1px solid var(--line);border-radius:8px;outline:0;padding:24px 18px;color:var(--ink);background:var(--panel);box-shadow:0 18px 60px #0f172a14;font-size:17px;line-height:1.72}.canvas-wrap.with-lines .rich-editor{grid-column:2}.rich-editor img{max-width:100%;height:auto;border-radius:8px}.rich-editor input[type=checkbox],.history-reader input[type=checkbox]{width:18px;height:18px;margin-right:8px;accent-color:var(--accent);vertical-align:middle}.rich-editor:focus{border-color:color-mix(in srgb,var(--accent),var(--line) 35%);box-shadow:0 20px 70px #0f172a1f}.rich-editor:empty:before{content:"Start writing...";color:var(--muted)}.rich-editor h1,.rich-editor h2,.rich-editor h3,.history-reader h1,.history-reader h2,.history-reader h3{color:var(--ink);line-height:1.2}.rich-editor h1,.history-reader h1{margin:0 0 18px;font-size:38px}.rich-editor h2,.history-reader h2{margin-top:30px;font-size:24px}.rich-editor p,.rich-editor ul,.rich-editor ol,.rich-editor blockquote,.rich-editor pre,.history-reader p,.history-reader ul,.history-reader ol,.history-reader blockquote,.history-reader pre{margin:0 0 16px}.rich-editor a,.history-reader a{color:#2563eb}.rich-editor blockquote,.history-reader blockquote{border-left:4px solid var(--accent);padding:8px 0 8px 16px;color:var(--muted)}.rich-editor pre,.history-reader pre{overflow-x:auto;border-radius:8px;padding:16px;color:#f8fafc;background:#111827}.rich-editor code,.history-reader code{border-radius:6px;padding:2px 5px;background:color-mix(in srgb,var(--line),transparent 35%)}.rich-editor pre code,.history-reader pre code{padding:0;background:transparent}.todo-box{color:var(--accent);font-weight:900}.error{margin:12px 20px 0;border-radius:8px;padding:12px;color:#991b1b;background:#fee2e2}.settings-row{display:grid;grid-template-columns:minmax(220px,1.3fr) minmax(180px,.9fr) auto auto;gap:10px;align-items:end;padding:12px 20px;border-bottom:1px solid var(--line);background:var(--panel)}.settings-row label{display:grid;gap:6px;color:var(--muted);font-size:12px;font-weight:800;text-transform:uppercase}.settings-row label span{display:flex;align-items:center;overflow:hidden;border:1px solid var(--line);border-radius:8px;padding-left:10px;color:var(--muted);background:var(--panel-soft);text-transform:none}.settings-row input{min-width:0;width:100%;height:38px;border:1px solid var(--line);border-radius:8px;padding:0 10px;color:var(--ink);background:var(--panel-soft)}.settings-row label span input{border:0;background:transparent}.settings-row button,.lock-panel button,.history-panel button{min-height:38px;border-radius:8px;padding:0 12px;color:var(--ink);background:color-mix(in srgb,var(--accent),white 55%);font-weight:800}.lock-panel{display:grid;place-items:center;align-content:center;gap:14px;min-height:70vh;padding:28px;color:var(--ink);text-align:center}.lock-panel h2,.lock-panel p{margin:0}.lock-panel p{max-width:420px;color:var(--muted)}.lock-panel input{width:min(100%,360px);height:42px;border:1px solid var(--line);border-radius:8px;padding:0 12px;color:var(--ink);background:var(--panel)}.history-panel{overflow-y:auto;border-left:1px solid var(--line);border-top:1px solid var(--line);padding:14px;background:var(--panel)}.history-reader{max-height:240px;overflow:auto;margin-bottom:12px;border:1px solid var(--line);border-radius:8px;padding:14px;color:var(--ink);background:var(--panel-soft);font-size:14px;line-height:1.6}.file-panel{display:grid;align-content:start;gap:10px}.file-row{display:grid;grid-template-columns:1fr 38px 38px;gap:8px}.file-row>button:first-child{display:grid;grid-template-columns:18px 1fr auto;gap:8px;align-items:center;min-width:0;border:1px solid var(--line);background:var(--panel-soft)}.file-row span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.file-preview{display:grid;gap:10px;border:1px solid var(--line);border-radius:8px;padding:10px;background:var(--panel-soft)}.file-preview header{display:flex;align-items:center;justify-content:space-between;gap:8px}.file-preview img,.file-preview video,.file-preview iframe{width:100%;max-height:320px;border:0;border-radius:8px;object-fit:contain;background:var(--panel)}.file-preview audio{width:100%}.download-link,.delete-box button{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:38px;border-radius:8px;color:var(--ink);background:color-mix(in srgb,var(--accent),white 55%);font-weight:800;text-decoration:none}.delete-box{display:grid;gap:8px;margin-top:8px;border-top:1px solid var(--line);padding-top:14px}.delete-box p{margin:0;color:var(--muted);font-size:13px}.delete-box input{width:100%;height:38px;border:1px solid var(--line);border-radius:8px;padding:0 10px;color:var(--ink);background:var(--panel-soft)}.history-panel header{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:12px}.ai-panel header strong{display:inline-flex;align-items:center;gap:6px}.ai-limit{margin-bottom:12px;border:1px solid var(--line);border-radius:8px;padding:10px;color:var(--muted);background:var(--panel-soft);font-size:12px;line-height:1.45}.ai-messages{display:grid;gap:10px;max-height:42vh;overflow-y:auto;padding-bottom:10px}.ai-message{border:1px solid var(--line);border-radius:8px;padding:10px;color:var(--ink);background:var(--panel-soft)}.ai-message.user{border-color:color-mix(in srgb,var(--accent),var(--line) 35%);background:color-mix(in srgb,var(--accent),transparent 85%)}.ai-message strong{display:block;margin-bottom:6px;font-size:12px}.ai-message p{margin:0;white-space:pre-wrap}.ai-input{display:grid;gap:8px;border-top:1px solid var(--line);padding-top:12px}.ai-input textarea{width:100%;min-height:86px;border:1px solid var(--line);border-radius:8px;padding:10px;color:var(--ink);background:var(--panel-soft);resize:vertical}.ai-input button{display:inline-flex;align-items:center;justify-content:center;gap:8px}.history-panel>button:not(header button){display:grid;gap:5px;width:100%;height:auto;margin-bottom:8px;padding:10px;border:1px solid var(--line);color:var(--ink);background:var(--panel-soft);text-align:left}.history-panel>button.active{border-color:var(--accent)}.history-panel small{overflow:hidden;color:var(--muted);text-overflow:ellipsis;white-space:nowrap}@media(max-width:900px){.app-shell{grid-template-columns:1fr}.sidebar{min-height:auto}.note-list{max-height:190px}.topbar{align-items:flex-start;flex-direction:column}.title-input{width:100%}.editor-grid,.editor-grid.with-history,.settings-row{grid-template-columns:1fr}.preview{min-height:45vh}.toolbar{overflow-x:auto}}@media(min-width:901px){.app-shell{grid-template-columns:300px minmax(0,1fr)}.sidebar{min-height:100vh;max-height:none;padding:18px}.note-list{flex-direction:column;overflow-x:hidden;overflow-y:auto}.note-item{width:100%;flex-basis:auto}.workspace{min-height:100vh}.topbar{align-items:center;flex-direction:row}.title-input{width:min(620px,64vw)}.top-actions,.toolbar{width:auto}.toolbar-presence{margin-left:auto}.editor-grid.with-history{grid-template-columns:minmax(0,1fr) 320px}.canvas-wrap{padding:34px clamp(18px,5vw,70px)}.canvas-wrap.with-lines{grid-template-columns:42px minmax(0,900px)}.rich-editor{min-height:calc(100vh - 230px);padding:clamp(28px,5vw,58px)}.history-panel{border-top:0}}
