:root{--bg:#0f172a;--surface:#fff;--surface-muted:#f8fafc;--border:#e2e8f0;--border-strong:#cbd5f5;--text:#0f172a;--text-muted:#475569;--accent:#2563eb;--accent-hover:#1d4ed8;--danger:#b91c1c;--danger-bg:#fee2e2;--shadow:0 1px 2px #0f172a0f, 0 1px 3px #0f172a0f;color:var(--text);background:var(--bg);font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif;line-height:1.5}*{box-sizing:border-box}html,body,#app{height:100%;margin:0}body{min-height:100vh}.app{background:var(--bg);grid-template-rows:auto 1fr;height:100vh;display:grid}.toolbar{color:#f8fafc;background:#1e293b;border-bottom:1px solid #0f172a;justify-content:space-between;align-items:center;gap:24px;padding:16px 24px;display:flex}.title{letter-spacing:.01em;margin:0;font-size:16px;font-weight:600}.actions{gap:8px;display:flex}.actions button,.stream-actions button{appearance:none;background:var(--accent);color:#fff;cursor:pointer;border:1px solid #0000;border-radius:6px;padding:8px 14px;font-size:14px;font-weight:500;transition:background .15s,border-color .15s}.actions button:hover,.stream-actions button:hover{background:var(--accent-hover)}.actions button[disabled],.stream-actions button[disabled]{opacity:.5;cursor:not-allowed}.stream-actions button.stop{background:var(--surface);border-color:var(--border-strong);color:var(--text)}.stream-actions button.stop:hover{background:var(--surface-muted)}.layout{background:var(--bg);grid-template-columns:minmax(0,1fr) minmax(320px,420px);gap:24px;padding:24px;display:grid;overflow:hidden}.editor,.side-panel{background:var(--surface);box-shadow:var(--shadow);border-radius:10px;flex-direction:column;display:flex;overflow:hidden}.editor-surface{flex:1;padding:24px 32px;overflow:auto}.editor-surface .ProseMirror{outline:none;min-height:100%;font-size:16px;line-height:1.6}.editor-surface .ProseMirror :first-child{margin-top:0}.editor-surface .ProseMirror h1{margin-top:0;font-size:22px}.editor-surface .ProseMirror h2{font-size:18px}.editor-surface .ProseMirror p{margin:.6em 0}.panel{flex-direction:column;height:100%;display:flex}.panel-head{border-bottom:1px solid var(--border);justify-content:space-between;align-items:center;gap:12px;padding:16px 20px;display:flex}.panel-head h2{text-transform:uppercase;letter-spacing:.08em;color:var(--text-muted);margin:0;font-size:13px}.ghost-indicator{color:var(--text-muted);background:var(--surface-muted);border:1px solid var(--border);border-radius:999px;align-items:center;gap:6px;padding:3px 8px;font-size:11px;display:inline-flex}.ghost-dot{background:#888;border-radius:50%;width:6px;height:6px;animation:1.4s ease-in-out infinite ghost-pulse;display:inline-block}@keyframes ghost-pulse{0%,to{opacity:.4}50%{opacity:1}}.panel-body{flex-direction:column;flex:1;gap:16px;padding:16px 20px;display:flex;overflow-y:auto}.panel-section{flex-direction:column;gap:6px;display:flex}.panel-section h4{text-transform:uppercase;letter-spacing:.05em;color:var(--text-muted);margin:0;font-size:11px}.action-btn{appearance:none;text-align:left;background:var(--surface);border:1px solid var(--border);width:100%;color:var(--text);cursor:pointer;border-radius:6px;padding:7px 12px;font-family:inherit;font-size:13px;transition:background .12s,border-color .12s;display:block}.action-btn:hover:not(:disabled){background:var(--surface-muted);border-color:var(--border-strong)}.action-btn:disabled{opacity:.5;cursor:not-allowed}.section-head-row{flex-wrap:wrap;justify-content:space-between;align-items:center;gap:8px;display:flex}.bulk-actions{gap:4px;display:flex}.bulk{appearance:none;border:1px solid var(--border);background:var(--surface);color:var(--text);cursor:pointer;border-radius:4px;padding:3px 8px;font-family:inherit;font-size:11px}.bulk.accept:hover{color:#047857;background:#ecfdf5;border-color:#10b981}.bulk.reject:hover{color:#991b1b;background:#fef2f2;border-color:#ef4444}.diff-list{flex-direction:column;gap:8px;margin:0;padding:0;list-style:none;display:flex}.diff-bar{border:1px solid var(--border);background:var(--surface-muted);border-radius:6px;padding:8px 10px;font-size:12.5px}.diff-preview{color:var(--text);word-break:break-word;margin-bottom:6px;font-style:italic}.diff-actions{gap:6px;display:flex}.diff-actions button{appearance:none;cursor:pointer;border-radius:3px;padding:3px 10px;font-family:inherit;font-size:11px}.diff-actions .accept{color:#047857;background:#d1fae5;border:1px solid #10b981}.diff-actions .accept:hover{background:#a7f3d0}.diff-actions .reject{color:#991b1b;background:#fee2e2;border:1px solid #ef4444}.diff-actions .reject:hover{background:#fecaca}.spell-dot{vertical-align:middle;background:#10b981;border-radius:50%;width:8px;height:8px;margin-right:6px;display:inline-block}.status-section{border:1px solid var(--border);background:var(--surface-muted);border-radius:6px;padding:10px 12px}.panel-empty{color:var(--text-muted);border:1px dashed var(--border);background:var(--surface-muted);text-align:center;border-radius:6px;padding:16px;font-size:13px;line-height:1.5}.panel-loading{color:var(--text-muted);align-items:center;gap:10px;font-size:13px;display:flex}.spinner{border:2px solid var(--border-strong);border-top-color:var(--accent);border-radius:50%;width:16px;height:16px;animation:.7s linear infinite spin}@keyframes spin{to{transform:rotate(360deg)}}.panel-stream{flex-direction:column;gap:16px;display:flex}.stream-text{white-space:pre-wrap;word-break:break-word;background:var(--surface);border:1px solid var(--border);border-radius:4px;max-height:180px;margin:0;padding:8px;font-family:inherit;font-size:13px;line-height:1.5;overflow-y:auto}.caret{background:var(--accent);vertical-align:text-bottom;width:1px;height:1.1em;margin-left:1px;animation:.8s step-end infinite blink;display:inline-block}@keyframes blink{50%{opacity:0}}.stream-actions{gap:8px;display:flex}.result-head{color:var(--text-muted);justify-content:space-between;margin-bottom:12px;font-size:13px;display:flex}.result-head .scope{font-variant:small-caps}.result-empty{color:var(--text-muted);margin:0;font-size:14px}.match-list{flex-direction:column;gap:12px;margin:0;padding:0;list-style:none;display:flex}.match-card{border:1px solid var(--border);background:var(--surface-muted);border-radius:8px;padding:12px;font-size:13px}.match-card>div+div{margin-top:6px}.match-card code{border:1px solid var(--border);background:#fff;border-radius:4px;padding:1px 6px;font-size:12.5px}.match-message{color:var(--text)}.match-rule{color:var(--text-muted);font-size:12px}.more{color:var(--text-muted);margin-left:6px}.match-suggestions{flex-wrap:wrap;align-items:center;gap:6px;display:flex}.match-suggestions strong{margin-right:2px}.suggestion-btn{border:1px solid var(--border);background:var(--surface-muted);color:var(--text);cursor:pointer;border-radius:999px;padding:3px 10px;font-family:inherit;font-size:13px;transition:background .12s,border-color .12s,color .12s}.suggestion-btn:hover{background:var(--accent);border-color:var(--accent);color:var(--surface)}.suggestion-btn:active{transform:translateY(1px)}.panel-error{color:var(--danger);background:var(--danger-bg);border:1px solid #fecaca;border-radius:6px;padding:10px 12px;font-size:13px}.panel-error strong{text-transform:uppercase;letter-spacing:.08em;margin-bottom:6px;font-size:12px;display:block}.panel-error p{margin:0}.extra-toggle{cursor:pointer;-webkit-user-select:none;user-select:none;align-items:center;gap:4px;display:flex}.extra-chevron{text-align:center;width:12px;color:var(--text-muted);font-size:10px}.extra-active-badge{text-transform:uppercase;letter-spacing:.06em;color:var(--accent);background:#2563eb1a;border-radius:9px;margin-left:auto;padding:1px 6px;font-size:9px;font-weight:600}.extra-input-wrap{flex-direction:column;gap:4px;display:flex}.extra-textarea{border:1px solid var(--border);background:var(--surface);width:100%;color:var(--text);resize:vertical;border-radius:6px;padding:8px 10px;font-family:inherit;font-size:13px;line-height:1.4}.extra-textarea:focus{border-color:var(--accent);outline:none;box-shadow:0 0 0 2px #2563eb26}.extra-textarea:disabled{opacity:.5;cursor:not-allowed}.extra-textarea::placeholder{color:var(--text-muted);opacity:.6}.extra-footer{justify-content:space-between;align-items:center;display:flex}.extra-counter{color:var(--text-muted);opacity:.6;font-size:11px}.extra-clear{appearance:none;color:var(--danger);cursor:pointer;background:0 0;border:none;padding:0;font-size:11px}.extra-clear:hover{text-decoration:underline}.workshop{border-top:1px solid var(--border);flex-direction:column;gap:10px;margin-top:16px;padding-top:16px;display:flex}.workshop-toggle{cursor:pointer;-webkit-user-select:none;user-select:none;align-items:center;gap:4px;margin:0;font-size:13px;display:flex}.workshop-demo-badge{text-transform:uppercase;letter-spacing:.06em;color:#b45309;background:#d977061f;border-radius:9px;padding:1px 6px;font-size:9px;font-weight:600}.workshop-body{flex-direction:column;gap:8px;display:flex}.workshop-label{text-transform:uppercase;letter-spacing:.06em;color:var(--text-muted);font-size:11px}.workshop-select{border:1px solid var(--border);background:var(--surface);width:100%;color:var(--text);border-radius:6px;padding:6px 8px;font-family:inherit;font-size:13px}.workshop-toggle-row{color:var(--text);cursor:pointer;align-items:center;gap:8px;font-size:13px;display:flex}.workshop-textarea{border:1px solid var(--border);background:var(--surface);width:100%;color:var(--text);resize:vertical;border-radius:6px;padding:8px 10px;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:12px;line-height:1.5}.workshop-textarea:focus{border-color:var(--accent);outline:none;box-shadow:0 0 0 2px #2563eb26}.workshop-textarea.is-readonly{background:var(--bg,#00000005);color:var(--text-muted);cursor:default}.workshop-footer{justify-content:space-between;align-items:flex-start;gap:12px;display:flex}.workshop-hint{color:var(--text-muted);font-size:11px;line-height:1.4}.workshop-error{color:var(--danger);font-size:12px}.extra-desc,.workshop-intro{color:var(--text-muted);margin:0 0 2px;font-size:11px;line-height:1.45}.extra-desc strong{color:var(--text);font-weight:600}
