@import"https://fonts.googleapis.com/css2?family=DM+Sans:ital,wght@0,300;0,400;0,500;0,600;1,400&family=JetBrains+Mono:wght@400;500&display=swap";*,*:before,*:after{box-sizing:border-box;margin:10;padding:0}:root{--bg: #F7F6F3;--surface: #FFFFFF;--border: #E2E0DA;--border-light: #EDEBE6;--text: #1A1917;--text-secondary: #6B6860;--text-muted: #9B9890;--accent: #2D6CDF;--accent-light: #EEF3FC;--danger: #DC3545;--success: #198754;--toolbar-height: 50px;--radius: 8px}body{font-family:DM Sans,system-ui,sans-serif;background:var(--bg);color:var(--text);min-height:100vh;font-size:16px;line-height:1.6;-webkit-font-smoothing:antialiased}.app{display:flex;flex-direction:column;min-height:100vh}.app-header{background:var(--surface);border-bottom:1px solid var(--border);padding:0 24px;height:52px;display:flex;align-items:center;position:sticky;top:0;z-index:100}.app-header-inner{display:flex;align-items:baseline;gap:12px}.app-logo{font-weight:600;font-size:15px;letter-spacing:-.3px}.app-subtitle{font-size:12px;color:var(--text-muted)}.app-main{flex:1;display:flex;justify-content:center;padding:32px 16px 64px}.document-wrapper{width:100%;max-width:860px;background:var(--surface);border:1px solid var(--border);border-radius:12px;overflow:hidden;box-shadow:0 1px 4px #0000000f,0 8px 32px #0000000a}.toolbar{display:flex;align-items:center;justify-content:space-between;padding:0 12px;height:var(--toolbar-height);border-bottom:1px solid var(--border);background:var(--surface);gap:4px;position:sticky;top:52px;z-index:50}.toolbar-left{display:flex;align-items:center;gap:2px;flex:1}.toolbar-right{display:flex;align-items:center}.toolbar-btn{display:flex;align-items:center;justify-content:center;gap:4px;padding:5px 8px;min-width:32px;height:30px;border:1px solid transparent;border-radius:5px;background:transparent;color:var(--text-secondary);font-family:inherit;font-size:13px;font-weight:500;cursor:pointer;transition:all .12s;white-space:nowrap}.toolbar-btn:hover{background:var(--bg);border-color:var(--border);color:var(--text)}.toolbar-btn-active{background:var(--accent-light)!important;color:var(--accent)!important;border-color:#c5d9f7!important}.toolbar-btn:disabled{opacity:.4;cursor:not-allowed}.toolbar-select{height:30px;padding:0 8px;border:1px solid var(--border);border-radius:5px;background:transparent;font-family:inherit;font-size:13px;color:var(--text);cursor:pointer}.toolbar-select:focus{outline:none;border-color:var(--accent)}.toolbar-divider{width:1px;height:20px;background:var(--border);margin:0 6px;flex-shrink:0}.save-status{font-size:11px;padding:3px 8px;border-radius:20px;white-space:nowrap}.save-status.saving{color:var(--text-muted)}.save-status.saved{color:var(--success)}.editor-container{position:relative}.editor-content{min-height:70vh;padding:40px 56px;outline:none;font-size:16px;line-height:1.75;color:var(--text)}.editor-placeholder{position:absolute;top:55px;left:56px;color:var(--text-muted);pointer-events:none;font-size:16px}.editor-content .editor-h1{font-size:2em;font-weight:700;margin:1em 0 .4em;letter-spacing:-.5px;line-height:1.2}.editor-content .editor-h2{font-size:1.5em;font-weight:600;margin:1em 0 .4em;letter-spacing:-.3px}.editor-content .editor-h3{font-size:1.2em;font-weight:600;margin:.8em 0 .3em}.editor-bold{font-weight:700}.editor-italic{font-style:italic}.editor-underline{text-decoration:underline}.editor-code-inline{font-family:JetBrains Mono,monospace;font-size:.88em;background:#f3f2ef;border:1px solid var(--border);border-radius:4px;padding:1px 5px;color:#d6336c}.editor-table{width:100%;border-collapse:collapse;margin:20px 0;font-size:14px}.editor-table-cell,.editor-table-cell-header{border:1px solid var(--border);padding:8px 12px;min-width:80px;vertical-align:top;position:relative}.editor-table-cell-header{background:var(--bg);font-weight:600;text-align:left}.editor-table-cell:focus,.editor-table-cell-header:focus{outline:2px solid var(--accent);outline-offset:-2px}.math-node{cursor:pointer}.math-rendered{display:inline}.math-rendered.block{display:block;text-align:center;margin:16px 0;padding:8px;border-radius:6px;background:#fafaf8;border:1px solid var(--border-light)}.math-rendered.selected{outline:2px solid var(--accent);border-radius:4px}.math-rendered:hover{background:var(--accent-light);border-radius:4px}.math-edit-container{display:inline-block}.math-edit-container.block{display:block}.math-edit-inner{display:flex;flex-direction:column;gap:8px;background:var(--surface);border:2px solid var(--accent);border-radius:8px;padding:12px;margin:8px 0}.math-textarea{font-family:JetBrains Mono,monospace;font-size:13px;padding:8px;border:1px solid var(--border);border-radius:6px;resize:vertical;width:100%;background:var(--bg);color:var(--text)}.math-textarea:focus{outline:none;border-color:var(--accent)}.math-preview{padding:8px;background:var(--bg);border-radius:6px;text-align:center}.math-edit-actions{display:flex;gap:6px;justify-content:flex-end}.math-btn{padding:5px 12px;border-radius:5px;font-size:12px;cursor:pointer;border:1px solid var(--border);font-family:inherit}.math-btn-save{background:var(--accent);color:#fff;border-color:var(--accent)}.math-btn-cancel{background:transparent;color:var(--text-secondary)}.modal-overlay{position:fixed;top:0;right:0;bottom:0;left:0;background:#0000004d;display:flex;align-items:center;justify-content:center;z-index:1000;-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px)}.modal-box{background:var(--surface);border-radius:12px;width:90%;max-width:480px;box-shadow:0 20px 60px #00000026;overflow:hidden}.modal-box-sm{max-width:340px}.modal-header{display:flex;align-items:center;justify-content:space-between;padding:16px 20px;border-bottom:1px solid var(--border)}.modal-header h3{font-size:15px;font-weight:600}.modal-close{background:none;border:none;font-size:16px;cursor:pointer;color:var(--text-muted);padding:4px;line-height:1}.modal-body{padding:20px;display:flex;flex-direction:column;gap:14px}.modal-label{display:flex;flex-direction:column;gap:6px;font-size:12px;font-weight:600;color:var(--text-secondary);text-transform:uppercase;letter-spacing:.5px}.modal-textarea{font-family:JetBrains Mono,monospace;font-size:13px;padding:10px;border:1px solid var(--border);border-radius:6px;background:var(--bg);color:var(--text);resize:vertical;width:100%}.modal-textarea:focus{outline:none;border-color:var(--accent)}.modal-input{padding:7px 10px;border:1px solid var(--border);border-radius:6px;width:80px;font-family:inherit;font-size:14px;background:var(--bg);color:var(--text)}.modal-input:focus{outline:none;border-color:var(--accent)}.modal-toggle label{display:flex;align-items:center;gap:8px;font-size:13px;cursor:pointer;color:var(--text-secondary)}.modal-preview{display:flex;flex-direction:column;gap:8px}.preview-output{background:var(--bg);border:1px solid var(--border);border-radius:6px;padding:12px;text-align:center;min-height:48px}.modal-examples{display:flex;flex-direction:column;gap:6px}.example-chips{display:flex;flex-wrap:wrap;gap:6px}.example-chip{padding:4px 10px;border:1px solid var(--border);border-radius:20px;background:var(--bg);font-size:12px;cursor:pointer;font-family:inherit;color:var(--text-secondary);transition:all .1s}.example-chip:hover{background:var(--accent-light);border-color:var(--accent);color:var(--accent)}.modal-footer{display:flex;justify-content:flex-end;gap:8px;padding:14px 20px;border-top:1px solid var(--border);background:var(--bg)}.table-grid-picker{display:grid;grid-template-columns:repeat(8,28px);gap:3px}.grid-cell{width:28px;height:28px;border:1px solid var(--border);border-radius:3px;cursor:pointer;transition:all .1s;background:var(--bg)}.grid-cell-active{background:var(--accent-light);border-color:var(--accent)}.table-grid-label{font-size:13px;color:var(--text-secondary);text-align:center;font-weight:500}.modal-inputs{display:flex;gap:16px}.btn{padding:7px 16px;border-radius:6px;font-size:13px;font-weight:500;cursor:pointer;font-family:inherit;transition:all .12s;border:1px solid transparent}.btn-primary{background:var(--accent);color:#fff}.btn-primary:hover{background:#2260cb}.btn-ghost{background:transparent;border-color:var(--border);color:var(--text-secondary)}.btn-ghost:hover{background:var(--bg);color:var(--text)}
