:root{--bg: #ffffff;--panel: #fbfbfa;--text: #37352f;--muted: #787774;--border: #e9e9e7;--accent: #2563eb;--accent-soft: #eff6ff;--danger: #dc2626;--radius: 8px}*,*:before,*:after{box-sizing:border-box;margin:0}html,body,#root{height:100%}body{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,system-ui,Roboto,Helvetica Neue,Arial,sans-serif;font-size:15px;line-height:1.5;color:var(--text);background:var(--bg);-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility}img,svg,video{display:block;max-width:100%}button,input,textarea,select{font:inherit;color:inherit}a{color:var(--accent)}button:focus-visible,a:focus-visible{outline:2px solid var(--accent);outline-offset:2px}.btn,.btn-primary,.btn-danger,.btn-ghost{display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:6px 12px;border:1px solid var(--border);border-radius:6px;background:var(--bg);color:var(--text);font-size:14px;font-weight:500;line-height:1.4;cursor:pointer;-webkit-user-select:none;user-select:none;white-space:nowrap;transition:background .12s ease,border-color .12s ease,color .12s ease,box-shadow .12s ease}.btn:hover{background:var(--panel);border-color:#dcdcda}.btn:disabled,.btn-primary:disabled,.btn-danger:disabled,.btn-ghost:disabled{opacity:.55;cursor:not-allowed}.btn-primary{background:var(--accent);border-color:var(--accent);color:#fff}.btn-primary:hover:not(:disabled){background:#1d4ed8;border-color:#1d4ed8}.btn-danger{background:var(--danger);border-color:var(--danger);color:#fff}.btn-danger:hover:not(:disabled){background:#b91c1c;border-color:#b91c1c}.btn-ghost{background:transparent;border-color:transparent;color:var(--muted)}.btn-ghost:hover:not(:disabled){background:#0000000d;color:var(--text)}.input{display:block;width:100%;padding:7px 10px;border:1px solid var(--border);border-radius:6px;background:var(--bg);color:var(--text);font-size:14px;line-height:1.4;outline:none;transition:border-color .12s ease,box-shadow .12s ease}.input::placeholder{color:var(--muted);opacity:.8}.input:focus{border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-soft)}.input:disabled{background:var(--panel);color:var(--muted);cursor:not-allowed}textarea.input{resize:vertical;min-height:72px}.modal-overlay{position:fixed;top:0;right:0;bottom:0;left:0;z-index:200;display:flex;align-items:center;justify-content:center;padding:20px;background:#0f0f0f73;animation:fade-in .12s ease}.modal{width:100%;max-width:480px;max-height:calc(100vh - 40px);overflow-y:auto;padding:20px;background:var(--bg);border-radius:var(--radius);box-shadow:0 16px 48px #00000038,0 0 0 1px #0000000a;animation:pop-in .14s ease}.toast{position:fixed;bottom:24px;left:50%;z-index:300;transform:translate(-50%);max-width:min(90vw,480px);padding:9px 16px;border-radius:999px;background:#37352f;color:#fff;font-size:14px;text-align:center;box-shadow:0 6px 20px #00000040;animation:toast-in .18s ease;pointer-events:none}.app{display:flex;height:100%;overflow:hidden}.main{position:relative;flex:1;min-width:0;overflow-y:auto;background:var(--bg)}.boot-screen{display:flex;align-items:center;justify-content:center;height:100%}.spinner{width:28px;height:28px;border:3px solid var(--border);border-top-color:var(--accent);border-radius:50%;animation:spin .8s linear infinite}.sidebar-container{width:250px;flex-shrink:0;height:100%}.sidebar{display:flex;flex-direction:column;width:100%;height:100%;background:var(--panel);border-right:1px solid var(--border)}.sidebar-head{padding:16px 14px 10px}.sidebar-title{font-size:15px;font-weight:600}.sidebar-dates{margin-top:2px;font-size:12.5px;color:var(--muted)}.sidebar-nav{flex:1;overflow-y:auto;padding:6px 8px 12px}.nav-item{display:flex;align-items:center;gap:8px;width:100%;padding:5px 8px;border:none;border-radius:6px;background:none;color:var(--text);font-size:14px;text-align:left;cursor:pointer;transition:background .1s ease}.nav-item:hover{background:#0000000b}.nav-item.active{background:#0000000f;font-weight:600}.nav-icon{flex-shrink:0;width:20px;text-align:center}.nav-label{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.nav-new{color:var(--muted)}.nav-new:hover{color:var(--text)}.sidebar-section{margin:14px 0 4px;padding:0 8px;font-size:11.5px;font-weight:600;letter-spacing:.04em;text-transform:uppercase;color:var(--muted)}.sidebar-foot{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:10px 14px;border-top:1px solid var(--border)}.sidebar-user{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13.5px;font-weight:500}.sidebar-signout{flex-shrink:0;padding:4px 8px;font-size:13px}.hamburger{display:none;position:fixed;top:12px;left:12px;z-index:60;width:36px;height:36px;align-items:center;justify-content:center;padding:0;border:1px solid var(--border);border-radius:6px;background:var(--bg);font-size:16px;cursor:pointer;box-shadow:0 1px 4px #00000014}.sidebar-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:40;background:#0f0f0f4d;animation:fade-in .15s ease}@media (max-width: 800px){.hamburger{display:flex}.sidebar-container{position:fixed;top:0;bottom:0;left:0;z-index:50;width:270px;transform:translate(-100%);transition:transform .2s ease}.sidebar-container.open{transform:translate(0);box-shadow:0 0 40px #0003}.sidebar-head{padding-top:58px}}@media (min-width: 801px){.hamburger,.sidebar-backdrop{display:none}}.auth-screen{display:flex;align-items:center;justify-content:center;min-height:100%;padding:24px;background:var(--panel)}.auth-card{width:100%;max-width:380px;padding:32px 28px;background:var(--bg);border:1px solid var(--border);border-radius:12px;box-shadow:0 8px 30px #0000000f}.auth-brand{margin-bottom:22px;text-align:center}.auth-globe{font-size:34px;line-height:1}.auth-title{margin-top:8px;font-size:22px;font-weight:700;line-height:1.2}.auth-subtitle{margin-top:3px;font-size:13.5px;color:var(--muted)}.auth-tabs{display:flex;margin-bottom:18px;padding:3px;background:var(--panel);border:1px solid var(--border);border-radius:8px}.auth-tab{flex:1;padding:6px 0;border:none;border-radius:6px;background:none;font-size:13.5px;font-weight:500;color:var(--muted);cursor:pointer;transition:background .12s ease,color .12s ease}.auth-tab.active{background:var(--bg);color:var(--text);box-shadow:0 1px 3px #00000014}.auth-form{display:flex;flex-direction:column;gap:12px}.auth-field{display:block}.field-label{display:block;margin-bottom:4px;font-size:12.5px;font-weight:600;color:var(--muted)}.field-hint{display:block;margin-top:4px;font-size:12px;color:var(--muted)}.auth-error{padding:8px 10px;border:1px solid #fecaca;border-radius:6px;background:#fef2f2;color:var(--danger);font-size:13px}.auth-submit{width:100%;margin-top:4px;padding:9px 12px;font-size:14.5px}@keyframes spin{to{transform:rotate(360deg)}}@keyframes fade-in{0%{opacity:0}to{opacity:1}}@keyframes pop-in{0%{opacity:0;transform:scale(.97)}to{opacity:1;transform:scale(1)}}@keyframes toast-in{0%{opacity:0;transform:translate(-50%,8px)}to{opacity:1;transform:translate(-50%)}}.calendar-view{display:flex;flex-direction:column;height:100%;min-height:0;padding:16px 20px 20px;gap:12px}.cal-main{flex:1;min-height:0}.cal-topbar{display:flex;align-items:center;gap:16px;flex-wrap:wrap}.cal-legend{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin-left:auto}.cal-legend-item{display:inline-flex;align-items:center;gap:5px;font-size:12px;color:var(--muted, #6b7280);white-space:nowrap}.cal-legend-dot{width:8px;height:8px;border-radius:50%;flex:none}.calendar-view .fc{--fc-border-color: var(--border, #e5e7eb);--fc-today-bg-color: #fffbeb;--fc-page-bg-color: #ffffff;--fc-button-text-color: #374151;--fc-button-bg-color: #ffffff;--fc-button-border-color: var(--border, #d1d5db);--fc-button-hover-bg-color: #f3f4f6;--fc-button-hover-border-color: #d1d5db;--fc-button-active-bg-color: #e5e7eb;--fc-button-active-border-color: #d1d5db;--fc-small-font-size: 12px;font-size:14px}.calendar-view .fc .fc-toolbar.fc-header-toolbar{margin-bottom:12px;gap:8px}.calendar-view .fc .fc-toolbar-title{font-size:1.1em;font-weight:600}.calendar-view .fc .fc-button{font-size:13px;font-weight:500;padding:5px 10px;border-radius:6px;box-shadow:none;text-transform:capitalize}.calendar-view .fc .fc-button:focus,.calendar-view .fc .fc-button:focus-visible{box-shadow:none;outline:2px solid #93c5fd;outline-offset:1px}.calendar-view .fc .fc-button-primary:not(:disabled).fc-button-active:focus,.calendar-view .fc .fc-button-primary:not(:disabled):active:focus{box-shadow:none}.calendar-view .fc .fc-event{border-radius:4px;font-size:12px;cursor:pointer}.calendar-view .fc .fc-v-event .fc-event-main{padding:1px 4px}.calendar-view .fc .fc-daygrid-event{padding:0 3px}.calendar-view .fc .fc-col-header-cell-cushion,.calendar-view .fc .fc-daygrid-day-number{color:inherit;text-decoration:none}.calendar-view .fc .fc-list-event:hover td{background:#f9fafb}.event-modal-title{font-size:16px;font-weight:600;margin:0 0 14px}.event-form{display:flex;flex-direction:column;gap:12px}.event-form .form-row{display:flex;align-items:flex-end;gap:12px}.event-form .form-row>.form-field{flex:1;min-width:0}.event-form .form-field{display:flex;flex-direction:column;gap:4px}.event-form .form-field label{font-size:12px;font-weight:500;color:var(--muted, #6b7280)}.event-form .form-check{display:flex;align-items:center;gap:6px;font-size:13px;padding-bottom:7px;white-space:nowrap;cursor:pointer}.event-form textarea.input{resize:vertical;min-height:60px;font:inherit}.event-form .form-error{color:#dc2626;font-size:13px}.event-form .form-actions{display:flex;align-items:center;gap:8px;margin-top:4px}.event-form .form-actions-spacer{flex:1}@media (max-width: 700px){.calendar-view{padding:10px 12px 12px}.calendar-view .fc .fc-toolbar.fc-header-toolbar{flex-wrap:wrap;justify-content:center;row-gap:8px}.calendar-view .fc .fc-toolbar-chunk{display:flex;justify-content:center}.event-form .form-row{flex-direction:column;align-items:stretch}.event-form .form-check{padding-bottom:0}}.page-view{max-width:760px;margin:0 auto;padding:20px 40px 120px}.page-toolbar{display:flex;align-items:center;justify-content:flex-end;gap:8px;min-height:28px}.page-save-indicator{font-size:12px;color:var(--muted, #8a8f98);-webkit-user-select:none;user-select:none}.page-save-indicator.is-error{color:#dc2626}.page-delete-btn{display:inline-flex;align-items:center;justify-content:center;padding:5px;border:none;border-radius:6px;background:transparent;color:var(--muted, #8a8f98);cursor:pointer}.page-delete-btn:hover{background:#fee2e2;color:#dc2626}.page-error{margin:8px 0;padding:8px 12px;border-radius:6px;background:#fef2f2;border:1px solid #fecaca;color:#b91c1c;font-size:13px}.page-loading,.page-load-error{padding:64px 0;color:var(--muted, #8a8f98);font-size:14px}.page-load-error p{margin:0 0 12px;color:#b91c1c}.page-load-error-actions{display:flex;gap:8px}.page-load-error-actions button{padding:6px 12px;border:1px solid var(--border, #e5e7eb);border-radius:6px;background:#fff;font-size:13px;cursor:pointer}.page-load-error-actions button:hover{background:#f9fafb}.page-title-row{display:flex;align-items:center;gap:12px;margin:10px 0 4px}.page-icon{font-size:30px;line-height:1;-webkit-user-select:none;user-select:none}.page-title-input{flex:1;min-width:0;padding:0;border:none;outline:none;background:transparent;font-family:inherit;font-size:30px;font-weight:700;letter-spacing:-.01em;color:inherit}.page-title-input::placeholder{color:var(--muted, #8a8f98);opacity:.6}.page-editor{margin-top:8px}.ProseMirror{outline:none;line-height:1.6;font-size:15px;min-height:280px;word-wrap:break-word;white-space:pre-wrap}.ProseMirror p{margin:.35em 0}.ProseMirror h1{font-size:1.7em;font-weight:700;line-height:1.25;margin:1.1em 0 .35em;letter-spacing:-.01em}.ProseMirror h2{font-size:1.35em;font-weight:650;line-height:1.3;margin:1em 0 .3em}.ProseMirror h3{font-size:1.15em;font-weight:600;line-height:1.3;margin:.9em 0 .25em}.ProseMirror h1:first-child,.ProseMirror h2:first-child,.ProseMirror h3:first-child{margin-top:.25em}.ProseMirror ul,.ProseMirror ol{margin:.35em 0;padding-left:1.5em}.ProseMirror li{margin:.15em 0}.ProseMirror li>p{margin:.15em 0}.ProseMirror li::marker{color:var(--muted, #8a8f98)}.ProseMirror blockquote{margin:.6em 0;padding:.1em 0 .1em .9em;border-left:3px solid #d1d5db;color:#4b5563}.ProseMirror blockquote p{margin:.25em 0}.ProseMirror code{background:#f1f3f5;color:#d14;border-radius:4px;padding:.15em .4em;font-size:.85em;font-family:ui-monospace,SFMono-Regular,SF Mono,Menlo,Consolas,Liberation Mono,monospace}.ProseMirror pre{background:#1e293b;color:#e2e8f0;border-radius:8px;padding:12px 16px;margin:.7em 0;overflow-x:auto}.ProseMirror pre code{background:transparent;color:inherit;padding:0;font-size:.85em}.ProseMirror hr{border:none;border-top:1px solid var(--border, #e5e7eb);margin:1.4em 0}.ProseMirror a{color:#2563eb;text-decoration:underline;text-underline-offset:2px;cursor:pointer}.ProseMirror ul[data-type=taskList]{list-style:none;margin:.35em 0;padding-left:.1em}.ProseMirror ul[data-type=taskList] li{display:flex;align-items:flex-start;gap:.55em}.ProseMirror ul[data-type=taskList] li>label{flex:0 0 auto;margin-top:.32em;-webkit-user-select:none;user-select:none}.ProseMirror ul[data-type=taskList] li>label input[type=checkbox]{width:15px;height:15px;margin:0;cursor:pointer;accent-color:#2563eb}.ProseMirror ul[data-type=taskList] li>div{flex:1 1 auto;min-width:0}.ProseMirror ul[data-type=taskList] li>div>p{margin:.15em 0}.ProseMirror ul[data-type=taskList] li[data-checked=true]>div{text-decoration:line-through;color:var(--muted, #9ca3af)}.ProseMirror ul[data-type=taskList] ul[data-type=taskList]{padding-left:1.6em}.ProseMirror p.is-editor-empty:first-child:before{content:attr(data-placeholder);color:var(--muted, #9ca3af);float:left;height:0;pointer-events:none}.slash-menu{position:absolute;z-index:1000;min-width:250px;max-width:320px;max-height:320px;overflow-y:auto;background:#fff;border:1px solid var(--border, #e5e7eb);border-radius:10px;box-shadow:0 10px 30px #0f172a1f,0 2px 8px #0f172a0f;padding:5px}.slash-item{padding:6px 10px;border-radius:6px;cursor:pointer}.slash-item-title{font-size:14px;font-weight:500;line-height:1.35}.slash-item-hint{font-size:12px;color:var(--muted, #8a8f98);line-height:1.3;margin-top:1px}.slash-item.active{background:var(--accent-soft, #e8f0fe)}.slash-empty{padding:10px 12px;font-size:13px;color:var(--muted, #8a8f98)}.ProseMirror table{border-collapse:collapse;margin:.75em 0;width:100%;font-size:.92em;overflow-x:auto;display:block}.ProseMirror table tbody{display:table;width:100%}.ProseMirror th,.ProseMirror td{border:1px solid var(--border);padding:6px 10px;text-align:left;vertical-align:top;min-width:60px}.ProseMirror th{background:var(--panel);font-weight:600}.ProseMirror .selectedCell{background:var(--accent-soft)}.chat-panel{display:flex;flex-direction:column;flex:0 0 340px;width:340px;height:100%;min-height:0;border-left:1px solid var(--border, #e6e4e1);background:#fff}.chat-header{flex:none;display:flex;align-items:center;justify-content:space-between;gap:8px;padding:10px 14px;border-bottom:1px solid var(--border, #e6e4e1)}.chat-header-title{font-size:14px;font-weight:600}.chat-close{width:26px;height:26px;border:none;background:transparent;border-radius:6px;font-size:18px;line-height:1;color:var(--muted, #6b7280);cursor:pointer;display:grid;place-items:center}.chat-close:hover{background:var(--panel, #f1f0ee);color:var(--text, #37352f)}.chat-messages{flex:1;min-height:0;overflow-y:auto;scrollbar-width:thin;padding:14px 12px;display:flex;flex-direction:column;gap:10px}.chat-msg{display:flex;flex-direction:column;max-width:100%}.chat-msg.user{align-items:flex-end}.chat-msg.assistant{align-items:flex-start}.chat-author{font-size:11px;color:var(--muted, #6b7280);margin:0 2px 2px}.chat-bubble{max-width:85%;border-radius:10px;padding:8px 11px;font-size:13.5px;line-height:1.45;overflow-wrap:anywhere}.chat-bubble.user{background:var(--accent-soft, #e8f0fe);white-space:pre-wrap}.chat-bubble.assistant{background:var(--panel, #f7f7f5);border:1px solid var(--border, #e6e4e1)}.chat-plain{white-space:pre-wrap}.chat-md>:first-child{margin-top:0}.chat-md>:last-child{margin-bottom:0}.chat-md p{margin:.4em 0}.chat-md ul,.chat-md ol{margin:.4em 0;padding-left:1.25em}.chat-md li{margin:.15em 0}.chat-md li>p{margin:0}.chat-md h1,.chat-md h2,.chat-md h3,.chat-md h4,.chat-md h5,.chat-md h6{margin:.6em 0 .3em;line-height:1.3}.chat-md h1{font-size:1.15em}.chat-md h2{font-size:1.1em}.chat-md h3,.chat-md h4,.chat-md h5,.chat-md h6{font-size:1em}.chat-md code{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:.88em;background:#0000000f;border-radius:4px;padding:1px 4px}.chat-md pre{margin:.5em 0;padding:8px 10px;background:#0000000d;border-radius:8px;overflow-x:auto;scrollbar-width:thin}.chat-md pre code{background:none;padding:0;font-size:.85em}.chat-md blockquote{margin:.4em 0;padding-left:10px;border-left:3px solid var(--border, #d9d6d1);color:var(--muted, #6b7280)}.chat-md a{color:var(--accent, #2563eb)}.chat-md hr{border:none;border-top:1px solid var(--border, #e6e4e1);margin:.6em 0}.chat-md table{display:block;max-width:100%;overflow-x:auto;scrollbar-width:thin;border-collapse:collapse;margin:.5em 0;font-size:.95em}.chat-md th,.chat-md td{border:1px solid var(--border, #e6e4e1);padding:3px 7px;text-align:left}.chat-md img{max-width:100%;border-radius:6px}.chat-md input[type=checkbox]{margin-right:5px}.chat-typing{display:inline-flex;align-items:center;gap:4px;padding:12px}.chat-typing span{width:6px;height:6px;border-radius:50%;background:var(--muted, #9ca3af);animation:chat-dot 1.2s ease-in-out infinite}.chat-typing span:nth-child(2){animation-delay:.15s}.chat-typing span:nth-child(3){animation-delay:.3s}@keyframes chat-dot{0%,60%,to{transform:translateY(0);opacity:.4}30%{transform:translateY(-4px);opacity:1}}.chat-empty{display:flex;flex-direction:column;align-items:flex-start;gap:8px;margin-top:8px}.chat-empty-intro{font-size:13px;color:var(--muted, #6b7280);margin:0 0 2px}.chat-chip{text-align:left;font-size:12.5px;padding:7px 12px;border:1px solid var(--border, #e6e4e1);border-radius:999px;background:#fff;color:var(--text, #37352f);cursor:pointer;transition:background .12s ease,border-color .12s ease}.chat-chip:hover{background:var(--panel, #f7f7f5);border-color:var(--muted, #d3d0cb)}.chat-input-row{flex:none;display:flex;align-items:flex-end;gap:8px;padding:10px 12px;border-top:1px solid var(--border, #e6e4e1)}.chat-input{flex:1;resize:none;min-height:34px;max-height:132px;overflow-y:auto;scrollbar-width:thin;padding:7px 10px;border:1px solid var(--border, #e6e4e1);border-radius:8px;font:inherit;font-size:13.5px;line-height:1.4;background:#fff;color:inherit}.chat-input:focus{outline:none;border-color:var(--accent, #2563eb);box-shadow:0 0 0 2px var(--accent-soft, #e8f0fe)}.chat-input:disabled{background:var(--panel, #f7f7f5);color:var(--muted, #6b7280)}.chat-send{flex:none;width:34px;height:34px;padding:0;border-radius:8px;font-size:16px;line-height:1;display:grid;place-items:center}.chat-send:disabled{opacity:.5;cursor:not-allowed}.chat-fab{position:fixed;right:18px;bottom:18px;z-index:80;width:48px;height:48px;border-radius:50%;border:1px solid var(--border, #e6e4e1);background:#fff;font-size:20px;cursor:pointer;display:grid;place-items:center;box-shadow:0 4px 14px #00000029;transition:transform .12s ease,box-shadow .12s ease}.chat-fab:hover{transform:translateY(-1px);box-shadow:0 6px 18px #0003}.chat-scrim{display:none}@media (max-width: 899px){.chat-scrim{display:block;position:fixed;top:0;right:0;bottom:0;left:0;z-index:90;background:#0f0f0f59;animation:chat-fade-in .15s ease}.chat-panel{position:fixed;top:0;right:0;bottom:0;z-index:91;width:min(340px,92vw);height:auto;box-shadow:-8px 0 24px #0000002e;animation:chat-slide-in .18s ease}}@keyframes chat-fade-in{0%{opacity:0}to{opacity:1}}@keyframes chat-slide-in{0%{transform:translate(24px);opacity:.6}to{transform:translate(0);opacity:1}}
