@sciflow/editor-start 0.0.1-beta → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/README.md +83 -2
  2. package/THIRD_PARTY_LICENSES +9 -0
  3. package/bin/extract-translations.mjs +54 -0
  4. package/dist/bundle/sciflow-editor.css +1 -1
  5. package/dist/bundle/sciflow-editor.js +10590 -15324
  6. package/dist/index.d.ts +7 -2
  7. package/dist/index.d.ts.map +1 -1
  8. package/dist/index.js +6 -3
  9. package/dist/lib/citation-source-adapter.d.ts +22 -2
  10. package/dist/lib/citation-source-adapter.d.ts.map +1 -1
  11. package/dist/lib/citation-source-adapter.js +104 -48
  12. package/dist/lib/drag-preview.d.ts +13 -0
  13. package/dist/lib/drag-preview.d.ts.map +1 -0
  14. package/dist/lib/drag-preview.js +43 -0
  15. package/dist/lib/editor-element.d.ts +30 -4
  16. package/dist/lib/editor-element.d.ts.map +1 -1
  17. package/dist/lib/editor-element.js +131 -30
  18. package/dist/lib/format-bar.d.ts +26 -2
  19. package/dist/lib/format-bar.d.ts.map +1 -1
  20. package/dist/lib/format-bar.js +369 -56
  21. package/dist/lib/ghost-cursor.d.ts +10 -0
  22. package/dist/lib/ghost-cursor.d.ts.map +1 -0
  23. package/dist/lib/ghost-cursor.js +59 -0
  24. package/dist/lib/icons-generated.d.ts +14 -0
  25. package/dist/lib/icons-generated.d.ts.map +1 -0
  26. package/dist/lib/icons-generated.js +60 -0
  27. package/dist/lib/outline.d.ts +18 -10
  28. package/dist/lib/outline.d.ts.map +1 -1
  29. package/dist/lib/outline.js +184 -28
  30. package/dist/lib/reference-list.d.ts +10 -2
  31. package/dist/lib/reference-list.d.ts.map +1 -1
  32. package/dist/lib/reference-list.js +47 -9
  33. package/dist/lib/selection-editor.d.ts +83 -5
  34. package/dist/lib/selection-editor.d.ts.map +1 -1
  35. package/dist/lib/selection-editor.js +1225 -147
  36. package/dist/lib/selection-transform-registry.d.ts +16 -0
  37. package/dist/lib/selection-transform-registry.d.ts.map +1 -0
  38. package/dist/lib/selection-transform-registry.js +24 -0
  39. package/dist/lib/selection-ui-renderer.d.ts +22 -0
  40. package/dist/lib/selection-ui-renderer.d.ts.map +1 -0
  41. package/dist/lib/selection-ui-renderer.js +244 -0
  42. package/dist/lib/selection-widget-host.d.ts +67 -0
  43. package/dist/lib/selection-widget-host.d.ts.map +1 -0
  44. package/dist/lib/selection-widget-host.js +151 -0
  45. package/dist/lib/selection-widget-registry.d.ts +16 -0
  46. package/dist/lib/selection-widget-registry.d.ts.map +1 -0
  47. package/dist/lib/selection-widget-registry.js +30 -0
  48. package/dist/lib/test-fixtures/soak-documents.d.ts +13 -0
  49. package/dist/lib/test-fixtures/soak-documents.d.ts.map +1 -0
  50. package/dist/lib/test-fixtures/soak-documents.js +69 -0
  51. package/dist/tsconfig.lib.tsbuildinfo +1 -1
  52. package/package.json +22 -13
  53. package/dist/demo/demo.js +0 -56
  54. package/dist/demo/index.html +0 -169
  55. package/dist/lib/citation-drop.d.ts +0 -25
  56. package/dist/lib/citation-drop.d.ts.map +0 -1
  57. package/dist/lib/citation-drop.js +0 -53
package/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # @sciflow/editor-start
2
2
 
3
+ Documentation: [docs.sciflow.org](https://docs.sciflow.org)
4
+
3
5
  Lit-based wrapper around the SciFlow ProseMirror schema. It loads all the packages required to get started with a basic editor.
4
6
 
5
7
  ## Building
@@ -38,6 +40,10 @@ Companion elements for sidebars—`<sciflow-selection-editor>` and `<sciflow-ref
38
40
 
39
41
  `editor-change` events include `{ doc, operations, files, references }`, where `files` mirrors uploaded assets (full URLs plus optional previews) maintained by the figure feature.
40
42
 
43
+ ## Developer docs
44
+
45
+ - Selection editor internals (selection interaction, property editing, JSON schema): `docs/selection-editor.md`
46
+
41
47
  ### Custom shadow-root styles
42
48
 
43
49
  Inject CSS directly into the editor's shadow root to override the built-in ProseMirror styles without touching global stylesheets. Styles can be set before or after initialization:
@@ -111,12 +117,78 @@ refList.highlight(['ref-1', 'ref-2']); // optional highlighted ids
111
117
  ```
112
118
 
113
119
  Properties and behaviours:
114
- - `references`: array of objects with fields like `id`, `rawCitation`/`raw_citation`, `author`, `title`, `issued`, etc.
120
+ - `references`: array of objects with fields like `id`, `rawReference`/`raw_reference`, `author`, `title`, `issued`, etc.
115
121
  - `highlightedIds`: string array; can also call `highlight(ids)` to update them.
116
- - `id` and `rawCitation` are required. `rawCitation` can be any formatted bibliography string (including hand-written).
122
+ - `id` and `rawReference` are required. `rawReference` can be any formatted bibliography string (including hand-written).
117
123
  - `mimeType` should be set for anything besides CSL JSON; default is `application/vnd.citationstyles.csl+json`. Use `application/vnd.openalex+json` for OpenAlex or your own type for custom payloads.
118
124
  - Dragging an item sets `application/json`, `application/x-sciflow-reference`, and `text/plain` payloads for integrations.
119
125
 
126
+ ### Citation query helpers
127
+
128
+ Re-exported from `@sciflow/editor-core` for convenience:
129
+
130
+ ```ts
131
+ import { getCitedReferenceIds, validateDocumentResources } from '@sciflow/editor-start';
132
+ ```
133
+
134
+ - **`getCitedReferenceIds(doc, from?, to?)`** — extract cited reference IDs from the document (or a range within it). Useful for highlighting references that match the current selection.
135
+ - **`validateDocumentResources(doc, files, references)`** — validate that all figure sources and citation references in the document JSON exist in the snapshot. Returns `MissingResource[]`.
136
+
137
+ See the [`@sciflow/editor-core` README](../core/README.md) for details.
138
+
139
+ ### Translation extraction
140
+
141
+ Extract all built-in translation keys and their English defaults to create a template for a new language:
142
+
143
+ ```bash
144
+ npx @sciflow/editor-start extract-translations > en.json # JSON
145
+ npx @sciflow/editor-start extract-translations --csv > en.csv # CSV
146
+ ```
147
+
148
+ Translate the values in the output file, then register at runtime:
149
+
150
+ ```js
151
+ import { registerTranslations, setLocale } from '@sciflow/editor-start';
152
+ import fr from './fr.json' with { type: 'json' };
153
+
154
+ registerTranslations('fr', fr);
155
+ setLocale('fr');
156
+ ```
157
+
158
+ See the [Localization guide](https://docs.sciflow.org/user-guide/customization/localization/) for details.
159
+
160
+ ### Math (equations)
161
+
162
+ When the **math** feature is enabled (it is included in the default feature list), users can insert and edit TeX equations. Equations are rendered as SVG in the editor using MathJax 4.
163
+
164
+ - **Loading MathJax:** The host page must load the MathJax 4 `tex-svg` component before equations will render, e.g.
165
+ `<script defer src="https://cdn.jsdelivr.net/npm/mathjax@4/tex-svg.js"></script>`
166
+ If MathJax is not loaded, math nodes show a short message and the raw TeX; the document still saves and loads correctly.
167
+ - **Editing:** Select a math node in the editor; the selection sidebar shows a **math** panel with TeX source, inline/display style, optional label, live preview, and **Apply** / **Escape** (cancel). Use **Ctrl+Enter** (or **Cmd+Enter**) to apply changes and **Escape** to cancel.
168
+ - **Errors and warnings:** Invalid TeX shows an error message in the node view and in the sidebar preview. MathJax errors and warnings are always shown when they occur so users can fix equations.
169
+
170
+ The format bar shows an **Insert equation** button when the math feature is active.
171
+
172
+ ### Format bar coverage (v1)
173
+
174
+ The format bar exposes the most common authoring commands. Some schema-level marks and node types are intentionally **not** surfaced in v1:
175
+
176
+ | Type | Schema name | Reason |
177
+ |------|-------------|--------|
178
+ | Mark | `code` (inline code) | Planned for v2. Users can paste code or apply it programmatically. |
179
+ | Node | `code_block` | Planned for v2. No insert button yet. |
180
+ | Node | `horizontal_rule` | Planned for v2. No insert button yet. |
181
+ | Node | `image` (inline) | Inline images are in the schema but only figure-level images have UI. |
182
+ | Mark | `bdi` | Bidirectional isolate — niche; may be exposed when RTL support is prioritised. |
183
+ | Mark | `tags` | Semantic classification mark managed by the host application, not end users. |
184
+
185
+ ### Footnotes
186
+
187
+ The **footnote** feature is also included in the default feature list.
188
+
189
+ - The format bar shows an **Insert footnote** button when the feature is active.
190
+ - Running `insertFootnote` with a text selection moves the selected text into the new footnote body.
191
+
120
192
  ## Demo
121
193
 
122
194
  - `npx nx run @sciflow/editor-start:demo` &mdash; runs `vite build --watch` to keep the ES module bundle up to date **and** serves the demo via `vite dev`. The demo always loads `dist/bundle/sciflow-editor.js`, so the behaviour matches what you ship to consumers.
@@ -128,3 +200,12 @@ When you need to hand the demo to someone without repository access:
128
200
  1. Run `npx nx bundle @sciflow/editor-start` to refresh `dist/bundle/`.
129
201
  2. Zip `packages/editor/start/demo/` together with `packages/editor/start/dist/bundle/`.
130
202
  3. They can unpack the archive and open `demo/index.html` (or serve the folder with any static server) to explore the integration.
203
+
204
+ ## Production deployment notes (Lit)
205
+
206
+ When serving the demo or a host app in production, apply the same deployment hardening recommended by Lit:
207
+
208
+ - Enable text compression at the server/CDN layer (gzip or brotli).
209
+ - Use cache-busting/fingerprinted URLs where feasible in the host application.
210
+ - Keep JavaScript minification enabled (the Vite production build already does this).
211
+ - The bundle is built with Vite (esbuild minification).
@@ -0,0 +1,9 @@
1
+ Material Symbols (Rounded, weight 400)
2
+ =======================================
3
+ Copyright Google LLC
4
+ Licensed under the Apache License, Version 2.0
5
+
6
+ Icons sourced from @material-symbols/svg-400
7
+ https://github.com/google/material-design-icons
8
+
9
+ Full license text: https://www.apache.org/licenses/LICENSE-2.0
@@ -0,0 +1,54 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * Extract all built-in translation keys and their English defaults.
5
+ *
6
+ * Usage:
7
+ * npx @sciflow/editor-start extract-translations # JSON (default)
8
+ * npx @sciflow/editor-start extract-translations --json # JSON
9
+ * npx @sciflow/editor-start extract-translations --csv # CSV
10
+ *
11
+ * The output is a template you can translate and then feed to
12
+ * `registerTranslations(locale, dictionary)` at runtime.
13
+ *
14
+ * See: https://docs.sciflow.org/user-guide/customization/localization/
15
+ */
16
+
17
+ // Import from @sciflow/editor-core directly (no CSS/Lit dependencies)
18
+ // so the script runs in plain Node without a bundler.
19
+ import { defaultTranslations } from '@sciflow/editor-core';
20
+
21
+ const args = process.argv.slice(2);
22
+
23
+ if (args.includes('--help') || args.includes('-h')) {
24
+ console.log(`Usage: sciflow-extract-translations [--json | --csv]
25
+
26
+ Extract all built-in translation keys and their English defaults.
27
+
28
+ Options:
29
+ --json Output as JSON (default)
30
+ --csv Output as CSV (key, english)
31
+ --help Show this help message
32
+
33
+ The output serves as a template for translating the editor into a new
34
+ language. Fill in the values and register them at runtime:
35
+
36
+ import { registerTranslations, setLocale } from '@sciflow/editor-start';
37
+ import translations from './my-locale.json' with { type: 'json' };
38
+
39
+ registerTranslations('fr', translations);
40
+ setLocale('fr');`);
41
+ process.exit(0);
42
+ }
43
+
44
+ const format = args.includes('--csv') ? 'csv' : 'json';
45
+
46
+ if (format === 'csv') {
47
+ console.log('key,english');
48
+ for (const [key, value] of Object.entries(defaultTranslations)) {
49
+ const escaped = String(value).replace(/"/g, '""');
50
+ console.log(`"${key}","${escaped}"`);
51
+ }
52
+ } else {
53
+ console.log(JSON.stringify(defaultTranslations, null, 2));
54
+ }
@@ -1 +1 @@
1
- :host{display:block;color-scheme:light dark;font-family:var(--sciflow-editor-font-family, system-ui, sans-serif);color:var(--sciflow-editor-color, #0f172a);--sciflow-editor-background: #ffffff;--sciflow-editor-border: rgba(15, 23, 42, .14);--sciflow-editor-border-active: #2563eb;--sciflow-editor-focus-ring: rgba(37, 99, 235, .25);--sciflow-editor-citation-bg: rgba(15, 23, 42, .05);--sciflow-editor-citation-color: inherit}.editor{border:1px solid var(--sciflow-editor-border);border-radius:8px;padding:12px;min-height:200px;box-sizing:border-box;background:var(--sciflow-editor-background, #fff)}.editor:focus-within{border-color:var(--sciflow-editor-border-active);box-shadow:0 0 0 2px var(--sciflow-editor-focus-ring)}.ProseMirror{position:relative;word-wrap:break-word;white-space:pre-wrap;white-space:break-spaces;-webkit-font-variant-ligatures:none;font-variant-ligatures:none;font-feature-settings:"liga" 0;font-weight:lighter;outline:none;min-height:inherit;padding:.5rem 4rem .5rem 2.5rem;color:inherit}.ProseMirror{line-height:1.6}.ProseMirror p{margin:0 0 .75rem}.ProseMirror h1,.ProseMirror h2,.ProseMirror h3,.ProseMirror h4,.ProseMirror h5,.ProseMirror h6{margin:1.25rem 0 .5rem;line-height:1.2}.ProseMirror table{width:100%;border-collapse:collapse;border-spacing:0;margin:1rem 0}.ProseMirror th,.ProseMirror td{padding:.5rem .75rem;border:1px solid color-mix(in srgb,currentColor 18%,transparent);vertical-align:top}.ProseMirror p:only-child:last-child,.ProseMirror table p{margin:0}.ProseMirror img{max-width:100%;height:auto}.ProseMirror pre{white-space:pre-wrap}.ProseMirror cite{background:var(--sciflow-editor-citation-bg);color:var(--sciflow-editor-citation-color);padding:.1rem .35rem;border-radius:4px}.ProseMirror img{max-width:40vw}.ProseMirror h1:before{content:"h1";opacity:.5;font-size:.8rem;position:absolute;left:0;transform:translateY(50%);padding-right:.5rem}.ProseMirror h1{font-size:1.5rem;padding-top:1em;font-weight:400}.ProseMirror h2{font-size:1.3em}.ProseMirror h2:before{content:"h2";opacity:.5;font-size:.8rem;padding-right:.5rem;position:absolute;left:0;transform:translateY(50%)}.ProseMirror h3{font-size:1.15em}.ProseMirror h3:before{content:"h3";opacity:.5;font-size:.8rem;padding-right:.5rem;position:absolute;left:0;transform:translateY(50%)}.ProseMirror section{margin-top:2.5rem}.ProseMirror section:first-child{margin-top:.5rem}.ProseMirror h2{font-size:1.25rem;font-weight:400}.ProseMirror h3,.ProseMirror h4,.ProseMirror h5,.ProseMirror h6{font-weight:400;font-size:1.05rem}.ProseMirror li{position:relative}.ProseMirror-hideselection *::selection{background:transparent}.ProseMirror-hideselection *::-moz-selection{background:transparent}.ProseMirror-hideselection{caret-color:transparent}.ProseMirror [draggable][contenteditable=false]{-webkit-user-select:text;user-select:text}.ProseMirror-selectednode{outline:2px solid #8cf}li.ProseMirror-selectednode{outline:none}li.ProseMirror-selectednode:after{content:"";position:absolute;inset:-2px -2px -2px -32px;border:2px solid #8cf;pointer-events:none}img.ProseMirror-separator{display:inline!important;border:none!important;margin:0!important}@media (prefers-color-scheme: dark){:host{color:var(--sciflow-editor-color, #e2e8f0);--sciflow-editor-background: #0f172a;--sciflow-editor-border: rgba(148, 163, 184, .35);--sciflow-editor-border-active: #3b82f6;--sciflow-editor-focus-ring: rgba(59, 130, 246, .35);--sciflow-editor-citation-bg: rgba(148, 163, 184, .2);--sciflow-editor-citation-color: #e2e8f0}.ProseMirror h1,.ProseMirror h2,.ProseMirror h3,.ProseMirror h4,.ProseMirror h5,.ProseMirror h6{color:inherit}.ProseMirror-selectednode{outline-color:#60a5facc}}:host{display:inline-flex;gap:8px;align-items:flex-start;color-scheme:light dark;border:1px solid var(--sciflow-formatbar-border, rgba(15, 23, 42, .05));border-radius:8px;padding:4px;background:var(--sciflow-formatbar-background, #f8fafc);box-shadow:var(--sciflow-formatbar-shadow, none);font-family:inherit}.style-select{display:inline-flex;align-items:center;min-height:36px;border:none;border-radius:6px;background:var(--sciflow-formatbar-select-background, white);color:var(--sciflow-formatbar-select-color, #1f2937);font:inherit;padding:0 12px;cursor:pointer;transition:border-color .15s ease,box-shadow .15s ease}.style-select:focus-visible{outline:2px solid var(--sciflow-formatbar-select-focus, rgba(37, 99, 235, .4));outline-offset:1px}.style-select:disabled{cursor:not-allowed;color:var(--sciflow-formatbar-button-disabled, rgba(15, 23, 42, .38));border-color:var(--sciflow-formatbar-select-border-disabled, rgba(15, 23, 42, .12));background:var(--sciflow-formatbar-select-background-disabled, #f1f5f9)}button{appearance:none;border:none;background:transparent;border-radius:6px;padding:6px;font:inherit;line-height:1;cursor:pointer;color:var(--sciflow-formatbar-button-color, #1f2937);transition:background .15s ease,color .15s ease;display:inline-flex;align-items:center;justify-content:center;min-width:36px;min-height:36px}button:hover:not(:disabled),button:focus-visible:not(:disabled){background:var(--sciflow-formatbar-button-hover, rgba(37, 99, 235, .12));outline:none}button:disabled{cursor:not-allowed;color:var(--sciflow-formatbar-button-disabled, rgba(15, 23, 42, .38))}button.active{background:var(--sciflow-formatbar-button-active-background, rgba(37, 99, 235, .12));color:var(--sciflow-formatbar-button-active, #1d4ed8)}button[data-tooltip]{position:relative}button[data-tooltip]:after{content:attr(data-tooltip);position:absolute;bottom:calc(100% + 6px);left:50%;transform:translate(-50%);background:#0f172ae6;color:#fff;padding:6px 8px;border-radius:6px;font-size:12px;line-height:1.2;white-space:nowrap;opacity:0;pointer-events:none;transition:opacity .15s ease;z-index:2}button[data-tooltip]:hover:after,button[data-tooltip]:focus-visible:after{opacity:1}.material-symbols-rounded{font-family:Material Symbols Rounded;font-variation-settings:"FILL" var(--sciflow-formatbar-button-fill, 0),"wght" var(--sciflow-formatbar-button-weight, 400),"GRAD" 0,"opsz" 24;font-size:20px;line-height:1}.command-rows{display:flex;flex-direction:column;gap:4px}.command-row{display:flex;flex-wrap:wrap;gap:4px;align-items:center}.command-row.table-row{border-top:1px solid var(--sciflow-formatbar-border, rgba(15, 23, 42, .12));padding-top:4px;margin-top:2px}@media (prefers-color-scheme: dark){:host{--sciflow-formatbar-border: rgba(148, 163, 184, .3);--sciflow-formatbar-background: rgba(15, 23, 42, .65);--sciflow-formatbar-shadow: none;--sciflow-formatbar-select-background: rgba(30, 41, 59, .8);--sciflow-formatbar-select-color: #e2e8f0;--sciflow-formatbar-button-color: #e2e8f0;--sciflow-formatbar-button-hover: rgba(59, 130, 246, .25);--sciflow-formatbar-button-active-background: rgba(96, 165, 250, .2);--sciflow-formatbar-button-active: #93c5fd;--sciflow-formatbar-button-disabled: rgba(148, 163, 184, .45);--sciflow-formatbar-select-background-disabled: rgba(30, 41, 59, .6)}}:host{display:block;color:inherit;font:inherit}:host([hidden]){display:none}.outline-list{list-style:none;padding:0;margin:0;display:grid;gap:.6rem}.outline-item{padding:.35rem .5rem .35rem .75rem;border-left:2px solid rgba(37,99,235,.18);border-radius:8px;display:grid;gap:.15rem;transition:background .16s ease,border-color .16s ease,color .16s ease}.outline-item[role=button]{cursor:pointer}.outline-item[role=button]:hover{background:color-mix(in srgb,rgba(37,99,235,.12) 60%,transparent);border-left-color:#2563eb73}.outline-item:focus-visible{outline:2px solid #2563eb;outline-offset:2px}.outline-item--active{background:color-mix(in srgb,rgba(37,99,235,.14) 70%,transparent);border-left-color:#2563ebbf}.outline-text{font-weight:600;color:color-mix(in srgb,canvastext 85%,#0f172a 10%)}.outline-meta{font-size:.78rem;color:color-mix(in srgb,canvastext 60%,#0f172a 15%);display:inline-flex;align-items:center;gap:.35rem;flex-wrap:wrap}.outline-id{background:#2563eb14;color:inherit;border-radius:4px;padding:.12em .4em;font-size:.9em}.outline-item.level-2{padding-left:1.5rem;border-left-style:dotted}.outline-item.level-3{padding-left:2.25rem;border-left-style:dotted;border-left-color:#2563eb1f}.outline-placeholder{color:color-mix(in srgb,canvastext 60%,#0f172a 10%);padding-left:.25rem}:host{display:block;color-scheme:light dark;font-family:inherit}.reference-list{list-style:none;margin:0;padding:0;display:grid;gap:.6rem}.reference-item{display:grid;grid-template-columns:1fr auto;gap:.35rem;padding:.65rem .75rem;border:1px dashed color-mix(in srgb,canvastext 8%,transparent);border-radius:12px;background:color-mix(in srgb,canvas 96%,white 6%);box-shadow:0 6px 14px #0f172a0f;transition:transform .12s ease,box-shadow .12s ease,border-color .16s ease,background .16s ease;cursor:grab}.reference-item:active{cursor:grabbing}.reference-item:hover{transform:translateY(-1px);border-color:color-mix(in srgb,canvastext 16%,transparent);box-shadow:0 10px 24px #0f172a14}.reference-text{line-height:1.2;color:color-mix(in srgb,canvastext 90%,transparent);font-size:.8rem}.reference-meta{display:inline-flex;align-items:center;gap:.35rem}.reference-id{font-size:.8em;background:color-mix(in srgb,#2563eb 12%,transparent);border:1px solid color-mix(in srgb,#2563eb 18%,transparent);border-radius:999px;padding:.12em .55em;color:color-mix(in srgb,canvastext 80%,transparent);letter-spacing:.01em}.reference-drag{font-size:.7em;text-transform:uppercase;letter-spacing:.04em;color:color-mix(in srgb,canvastext 60%,transparent);background:color-mix(in srgb,canvas 92%,transparent);border:1px dashed color-mix(in srgb,canvastext 18%,transparent);border-radius:8px;padding:.2em .5em}.reference-highlight{border-color:color-mix(in srgb,#2563eb 45%,transparent);background:color-mix(in srgb,#eff6ff 70%,canvas 30%);box-shadow:0 10px 26px #2563eb26}.reference-empty{color:color-mix(in srgb,canvastext 70%,transparent);font-style:italic;border:1px dashed color-mix(in srgb,canvastext 14%,transparent);border-radius:10px;padding:.75rem;text-align:center}@media (prefers-color-scheme: dark){.reference-item{background:color-mix(in srgb,canvas 85%,#0f172a 20%);border-color:color-mix(in srgb,canvastext 22%,transparent);box-shadow:none}.reference-item:hover{border-color:color-mix(in srgb,canvastext 32%,transparent);box-shadow:0 8px 18px #0000004d}.reference-highlight{background:color-mix(in srgb,#1d4ed8 35%,canvas 65%)}.reference-id{background:color-mix(in srgb,#1d4ed8 22%,transparent);border-color:color-mix(in srgb,#1d4ed8 32%,transparent);color:color-mix(in srgb,canvastext 86%,transparent)}.reference-drag{background:color-mix(in srgb,canvas 75%,transparent);border-color:color-mix(in srgb,canvastext 24%,transparent)}}:host{display:block;color-scheme:light dark}.selection-editor-container{display:grid;gap:.75rem}.selection-editor-placeholder{margin:0;font-size:.85rem;color:color-mix(in srgb,canvastext 60%,transparent);font-style:italic}.selection-editor-field{display:grid;gap:.3rem}.selection-editor-label{font-size:.8rem;font-weight:600;color:color-mix(in srgb,canvastext 75%,transparent);text-transform:uppercase;letter-spacing:.03em}.selection-editor-value{font-family:SFMono-Regular,Consolas,Liberation Mono,Menlo,monospace;font-size:.85rem;background:#2563eb14;border-radius:4px;padding:.2rem .45rem;display:inline-block}.selection-editor-input{font-family:SFMono-Regular,Consolas,Liberation Mono,Menlo,monospace;font-size:.85rem;background:color-mix(in srgb,canvas 98%,white 2%);border:1px solid rgba(15,23,42,.16);border-radius:6px;padding:.4rem .6rem;max-width:calc(100% - .5rem);width:auto;min-width:0;color:color-mix(in srgb,canvastext 90%,transparent);transition:border-color .16s ease,background .16s ease}.selection-editor-input:focus{outline:none;border-color:#2563eb;background:color-mix(in srgb,canvas 99%,white 1%)}.selection-editor-input::placeholder{color:color-mix(in srgb,canvastext 50%,transparent);font-style:italic}.selection-editor-attrs{display:grid;gap:.6rem}.selection-editor-attr-field{display:grid;gap:.3rem}.selection-editor-attr-label{font-size:.75rem;font-weight:500;color:color-mix(in srgb,canvastext 70%,transparent);font-family:SFMono-Regular,Consolas,Liberation Mono,Menlo,monospace}.citation-source-adapter-root{display:flex;flex-direction:column;gap:.5rem}.citation-source-item{display:grid;grid-template-columns:minmax(9rem,1fr) minmax(9rem,1fr);gap:.35rem .75rem;padding:.5rem .6rem;margin-bottom:.5rem;background:color-mix(in srgb,canvas 96%,white 4%);border:1px solid rgba(15,23,42,.12);border-radius:6px;align-items:start}.citation-source-item:last-of-type{margin-bottom:0}.citation-source-field{display:flex;flex-direction:column;gap:.2rem;min-width:0}.citation-source-field .selection-editor-attr-label{font-size:.7rem}.citation-source-field .selection-editor-input{width:100%;padding:.25rem .4rem;font-size:.8rem;box-sizing:border-box}.citation-source-field input[type=checkbox]{width:auto;margin:0;align-self:flex-start}.citation-source-add,.citation-source-remove{font-size:.7rem;padding:.2rem .4rem;border-radius:4px;border:1px solid rgba(15,23,42,.2);background:color-mix(in srgb,canvas 95%,white 5%);cursor:pointer;margin-top:.15rem}.citation-source-add:hover,.citation-source-remove:hover{background:color-mix(in srgb,canvas 90%,white 10%)}.citation-source-add{margin-top:.25rem}
1
+ :host{--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light dark;font-family:var(--sciflow-editor-font-family,system-ui, sans-serif);color:var(--sciflow-editor-color,#0f172a);--sciflow-editor-background:#fff;--sciflow-editor-border:#0f172a24;--sciflow-editor-border-active:#2563eb;--sciflow-editor-focus-ring:#2563eb40;--sciflow-editor-citation-bg:#0f172a0d;--sciflow-editor-citation-color:inherit;--sciflow-editor-selectednode:#94a3b899;--sciflow-editor-footnote-bg:#0f172a0a;display:block}@media (prefers-color-scheme:dark){:host{--lightningcss-light: ;--lightningcss-dark:initial}}.editor{border:1px solid var(--sciflow-editor-border);box-sizing:border-box;background:var(--sciflow-editor-background,#fff);border-radius:0;min-height:200px;padding:12px}.editor:focus-within{border-color:var(--sciflow-editor-selectednode,var(--sciflow-editor-border-active));box-shadow:0 0 0 2px var(--sciflow-editor-selectednode,var(--sciflow-editor-focus-ring))}.ProseMirror{word-wrap:break-word;white-space:pre-wrap;white-space:break-spaces;-webkit-font-variant-ligatures:none;font-variant-ligatures:none;font-feature-settings:"liga" 0;min-height:inherit;color:inherit;counter-reset:sciflow-footnote;outline:none;padding:calc(.75rem + 1.5em) 4rem .5rem 3.5rem;font-size:1rem;font-weight:lighter;line-height:1.6;position:relative}.ProseMirror p{margin:0 0 .75rem}.ProseMirror h1,.ProseMirror h2,.ProseMirror h3,.ProseMirror h4,.ProseMirror h5,.ProseMirror h6{margin:1.25rem 0 .5rem;line-height:1.2;position:relative}.ProseMirror>h1:first-child,.ProseMirror>h2:first-child,.ProseMirror>h3:first-child,.ProseMirror>h4:first-child,.ProseMirror>h5:first-child,.ProseMirror>h6:first-child{margin-top:0}.ProseMirror table{border-collapse:collapse;border-spacing:0;width:100%;margin:1rem 0}.ProseMirror th,.ProseMirror td{border:1px solid color-mix(in srgb, currentColor 18%, transparent);vertical-align:top;box-sizing:border-box;padding:.5rem .75rem;position:relative}.ProseMirror .tableWrapper{overflow-x:auto}.ProseMirror td:not([data-colwidth]):not(.column-resize-dragging),.ProseMirror th:not([data-colwidth]):not(.column-resize-dragging){min-width:var(--default-cell-min-width,80px)}.ProseMirror .column-resize-handle{z-index:20;pointer-events:none;background-color:#adf;width:4px;position:absolute;top:0;bottom:0;right:-2px}.ProseMirror.resize-cursor{cursor:ew-resize;cursor:col-resize}.ProseMirror .selectedCell:after{z-index:2;content:"";pointer-events:none;background:#c8c8ff66;position:absolute;inset:0}.ProseMirror p:only-child:last-child,.ProseMirror table p{margin:0}.ProseMirror img{max-width:100%;height:auto}.ProseMirror pre{white-space:pre-wrap}.ProseMirror cite{background:var(--sciflow-editor-citation-bg);color:var(--sciflow-editor-citation-color);border-radius:4px;padding:.1rem .35rem}.ProseMirror a[data-type=xref]{background:var(--sciflow-editor-citation-bg);color:var(--sciflow-editor-citation-color);border-radius:4px;padding:.1rem .35rem;text-decoration:none}.ProseMirror a[data-type=xref]:hover{text-decoration:underline}.ProseMirror img{max-width:40vw}.ProseMirror h1:before{content:"#";opacity:.5;padding-right:.5rem;font-size:.8rem;position:absolute;top:60%;left:-2.5rem;transform:translateY(-50%)}.ProseMirror h1{padding-top:.35em;font-size:1.33em;font-weight:400}.ProseMirror h2{font-size:1.22em}.ProseMirror h2:before{content:"##";opacity:.5;padding-right:.5rem;font-size:.8rem;position:absolute;top:50%;left:-2.5rem;transform:translateY(-50%)}.ProseMirror h3:before{content:"###";opacity:.5;padding-right:.5rem;font-size:.8rem;position:absolute;top:50%;left:-2.5rem;transform:translateY(-50%)}.ProseMirror section{margin-top:2.5rem}.ProseMirror section:first-child{margin-top:.5rem}.ProseMirror h2{font-weight:400}.ProseMirror h3{font-size:1.17em;font-weight:400}.ProseMirror h4{font-size:1.11em;font-weight:400}.ProseMirror h5{font-size:1.06em;font-weight:400}.ProseMirror h6{font-size:1em;font-weight:700}.ProseMirror li{position:relative}.ProseMirror-hideselection ::selection{background:0 0}.ProseMirror-hideselection ::selection{background:0 0}.ProseMirror-hideselection{caret-color:#0000}.prosemirror-ghost-cursor{vertical-align:text-bottom;pointer-events:none;background:#2563eb;border-radius:2px;width:3px;height:1.25em;margin:0 -1px;animation:1.8s ease-in-out infinite ghost-cursor-pulse;display:inline-block;box-shadow:0 0 0 1.5px #2563eb4d}@keyframes ghost-cursor-pulse{0%,to{opacity:1}50%{opacity:.4}}.prosemirror-ghost-selection{background:#2563eb40;border-radius:2px;outline:1px solid #2563eb66}.ProseMirror [draggable][contenteditable=false]{-webkit-user-select:text;user-select:text}.ProseMirror-selectednode{outline:2px solid var(--sciflow-editor-selectednode,var(--sciflow-editor-border-active,#2563eb));outline-offset:1px}cite.ProseMirror-selectednode{box-shadow:0 0 0 2px var(--sciflow-editor-border-active,#2563eb);outline:none}span[data-type=footnote].ProseMirror-selectednode{box-shadow:none;outline:none}span[data-type=footnote].ProseMirror-selectednode .sciflow-footnote-body{border-color:var(--sciflow-editor-border-active,#2563eb)}a[data-type=xref].ProseMirror-selectednode{box-shadow:0 0 0 2px var(--sciflow-editor-selectednode,var(--sciflow-editor-border-active,#2563eb));outline:none}li.ProseMirror-selectednode{outline:none}li.ProseMirror-selectednode:after{content:"";border:2px solid var(--sciflow-editor-selectednode,var(--sciflow-editor-border-active,#2563eb));pointer-events:none;position:absolute;inset:-2px -2px -2px -32px}img.ProseMirror-separator{border:none!important;margin:0!important;display:inline!important}@media (prefers-color-scheme:dark){:host{color:var(--sciflow-editor-color,#e2e8f0);--sciflow-editor-background:#0f172a;--sciflow-editor-border:#94a3b859;--sciflow-editor-border-active:#3b82f6;--sciflow-editor-focus-ring:#3b82f659;--sciflow-editor-citation-bg:#94a3b833;--sciflow-editor-citation-color:#e2e8f0;--sciflow-editor-footnote-bg:#94a3b81f}.ProseMirror h1,.ProseMirror h2,.ProseMirror h3,.ProseMirror h4,.ProseMirror h5,.ProseMirror h6{color:inherit}:host{--sciflow-editor-selectednode:#94a3b899}.ProseMirror-selectednode{outline-color:var(--sciflow-editor-selectednode)}a[data-type=xref].ProseMirror-selectednode{box-shadow:0 0 0 2px var(--sciflow-editor-selectednode)}}:host{--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light dark;border:1px solid var(--sciflow-formatbar-border,#0f172a0d);background:var(--sciflow-formatbar-background,#f8fafc);box-shadow:var(--sciflow-formatbar-shadow,none);border-radius:6px;flex-wrap:wrap;justify-content:center;align-items:center;gap:0;padding:3px;font-family:inherit;font-size:.8rem;display:inline-flex;overflow:visible}@media (prefers-color-scheme:dark){:host{--lightningcss-light: ;--lightningcss-dark:initial}}.style-dropdown{display:inline-flex;position:relative}.style-dropdown-trigger{background:var(--sciflow-formatbar-select-background,white);min-height:30px;color:var(--sciflow-formatbar-select-color,#1f2937);font:inherit;cursor:pointer;border:none;border-radius:5px;align-items:center;gap:4px;padding:0 8px;transition:background .15s;display:inline-flex}.style-dropdown-trigger:hover{background:var(--sciflow-formatbar-button-hover,#2563eb1f)}.style-dropdown-trigger:disabled{cursor:not-allowed;color:var(--sciflow-formatbar-button-disabled,#0f172a61);background:var(--sciflow-formatbar-select-background-disabled,#f1f5f9)}.style-dropdown-trigger:focus-visible{outline:2px solid var(--sciflow-formatbar-select-focus,#2563eb66);outline-offset:1px}.dropdown-chevron{align-items:center;transition:transform .15s;display:inline-flex}.dropdown-chevron svg{width:12px;height:12px}.style-dropdown-menu{background:var(--sciflow-formatbar-select-background,white);border:1px solid var(--sciflow-formatbar-border,#0f172a1f);z-index:100;border-radius:6px;min-width:160px;padding:4px;position:absolute;top:calc(100% + 4px);left:0;overflow:hidden;box-shadow:0 4px 16px #0000001a,0 1px 4px #0000000f}.style-option{text-align:left;cursor:pointer;width:100%;color:var(--sciflow-formatbar-select-color,#1f2937);white-space:nowrap;background:0 0;border:none;border-radius:4px;justify-content:flex-start;align-items:center;gap:8px;min-width:0;min-height:0;padding:6px 10px;font-family:inherit;line-height:1.3;transition:background .1s;display:flex}.style-option-icon{flex-shrink:0;justify-content:center;align-items:center;width:16px;height:16px;display:inline-flex}.style-option:hover{background:var(--sciflow-formatbar-button-hover,#2563eb1f)}.style-option:disabled{cursor:not-allowed;color:var(--sciflow-formatbar-button-disabled,#0f172a61)}.style-option.active{background:var(--sciflow-formatbar-button-active-background,#2563eb1f);color:var(--sciflow-formatbar-button-active,#1d4ed8)}.style-option--paragraph{font-size:.8rem;font-weight:400}.style-option--h1{font-size:1.1rem;font-weight:700}.style-option--h2{font-size:.95rem;font-weight:600}.style-option--h3{font-size:.85rem;font-weight:600}.style-option--blockquote{font-size:.8rem;font-weight:400}.insert-dropdown{display:inline-flex;position:relative}.insert-dropdown-trigger{min-width:30px;min-height:30px;color:var(--sciflow-formatbar-button-color,#1f2937);font:inherit;cursor:pointer;background:0 0;border:none;border-radius:5px;align-items:center;gap:2px;padding:5px;transition:background .15s;display:inline-flex}.insert-dropdown-trigger:hover{background:var(--sciflow-formatbar-button-hover,#2563eb1f)}.insert-dropdown-trigger:focus-visible{outline:2px solid var(--sciflow-formatbar-select-focus,#2563eb66);outline-offset:1px}.insert-dropdown-menu{background:var(--sciflow-formatbar-select-background,white);border:1px solid var(--sciflow-formatbar-border,#0f172a1f);z-index:100;border-radius:6px;min-width:150px;padding:4px;position:absolute;top:calc(100% + 4px);left:0;overflow:hidden;box-shadow:0 4px 16px #0000001a,0 1px 4px #0000000f}.insert-menu-item{text-align:left;cursor:pointer;width:100%;color:var(--sciflow-formatbar-select-color,#1f2937);white-space:nowrap;background:0 0;border:none;border-radius:4px;justify-content:flex-start;align-items:center;gap:8px;min-width:0;min-height:0;padding:6px 10px;font-family:inherit;font-size:.8rem;line-height:1.3;transition:background .1s;display:flex}.insert-menu-item:hover{background:var(--sciflow-formatbar-button-hover,#2563eb1f)}.insert-menu-item:disabled{cursor:not-allowed;color:var(--sciflow-formatbar-button-disabled,#0f172a61)}.insert-menu-item .cmd-icon{width:16px;height:16px}.command-group{align-items:center;gap:1px;display:inline-flex}.command-group+.command-group{border-left:1px solid var(--sciflow-formatbar-border,#0f172a1f);margin-left:5px;padding-left:5px}button{appearance:none;font:inherit;cursor:pointer;color:var(--sciflow-formatbar-button-color,#1f2937);background:0 0;border:none;border-radius:5px;justify-content:center;align-items:center;min-width:30px;min-height:30px;padding:5px;line-height:1;transition:background .15s,color .15s;display:inline-flex}button:hover:not(:disabled),button:focus-visible:not(:disabled){background:var(--sciflow-formatbar-button-hover,#2563eb1f);outline:none}button:disabled{cursor:not-allowed;color:var(--sciflow-formatbar-button-disabled,#0f172a61)}button.active{background:var(--sciflow-formatbar-button-active-background,#2563eb1f);color:var(--sciflow-formatbar-button-active,#1d4ed8)}button[data-tooltip]{z-index:0;position:relative}button[data-tooltip]:hover,button[data-tooltip]:focus-visible{z-index:1}button[data-tooltip]:after{content:attr(data-tooltip);color:#fff;white-space:nowrap;opacity:0;pointer-events:none;z-index:10;background:#0f172ae6;border-radius:5px;padding:5px 6px;font-size:11px;line-height:1.2;transition:opacity .15s;position:absolute;top:calc(100% + 6px);left:50%;transform:translate(-50%)}button[data-tooltip]:hover:after,button[data-tooltip]:focus-visible:after{opacity:1}.cmd-icon{justify-content:center;align-items:center;width:18px;height:18px;display:inline-flex}.cmd-icon svg{width:100%;height:100%}.table-row{border-top:1px solid var(--sciflow-formatbar-border,#0f172a1f);flex-wrap:wrap;justify-content:center;align-items:center;gap:0;width:100%;margin-top:2px;padding-top:3px;animation:.22s ease-out format-bar-row-in;display:flex}.table-row-label{text-transform:uppercase;letter-spacing:.05em;color:var(--sciflow-formatbar-button-disabled,#0f172a61);border-right:1px solid var(--sciflow-formatbar-border,#0f172a1f);-webkit-user-select:none;user-select:none;margin-right:5px;padding:0 8px 0 2px;font-size:.65rem;font-weight:600;line-height:30px}.command-rows{flex-direction:column;align-items:center;gap:2px;display:flex}.command-row{flex-wrap:wrap;align-items:center;gap:2px;display:flex}.command-row--primary{justify-content:flex-start;width:100%}@keyframes format-bar-row-in{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}.table-commands{flex-wrap:wrap;align-items:center;gap:2px;display:inline-flex}.table-commands.table-tools-expanded{animation:.22s ease-out format-bar-row-in}.table-commands--with-separator{border-left:1px solid var(--sciflow-formatbar-border,#0f172a1f);margin-left:3px;padding-left:3px}.command-rows--table-expanded .command-row--primary,.command-row--table{justify-content:center}.command-row--table{width:100%}@media (prefers-color-scheme:dark){:host{--sciflow-formatbar-border:#94a3b84d;--sciflow-formatbar-background:#0f172aa6;--sciflow-formatbar-shadow:none;--sciflow-formatbar-select-background:#1e293bcc;--sciflow-formatbar-select-color:#e2e8f0;--sciflow-formatbar-button-color:#e2e8f0;--sciflow-formatbar-button-hover:#3b82f640;--sciflow-formatbar-button-active-background:#60a5fa33;--sciflow-formatbar-button-active:#93c5fd;--sciflow-formatbar-button-disabled:#94a3b873;--sciflow-formatbar-select-background-disabled:#1e293b99}.style-dropdown-menu,.insert-dropdown-menu{box-shadow:0 4px 16px #0000004d,0 1px 4px #00000026}}:host{color:inherit;font:inherit;display:block}:host([hidden]){display:none}.outline-list{flex-direction:column;gap:.15rem;margin:0;padding:0;list-style:none;display:flex}.outline-item{border-left:2px solid #2563eb2e;border-radius:6px;grid-template-rows:auto auto;grid-template-columns:auto 1fr;gap:.1rem .4rem;padding:.25rem .5rem .25rem .6rem;transition:background .14s,border-color .14s;display:grid}.outline-item[role=button]{cursor:pointer}.outline-item[role=button]:hover{background:#2563eb10;border-left-color:#2563eb66}.outline-item:focus-visible{outline-offset:2px;outline:2px solid #2563eb}.outline-item--active{background:#2563eb16;border-left-color:#2563ebb3}.outline-level{letter-spacing:.02em;text-align:center;color:#2563eb;background:#2563eb1a;border-radius:4px;grid-area:1/1/3;align-self:start;min-width:1.6em;margin-top:.2em;padding:.15em .4em;font-size:.62rem;font-weight:700;line-height:1}.outline-item.level-2 .outline-level{color:#7c3aed;background:#7c3aed1a}.outline-item.level-3 .outline-level{color:#0891b2;background:#0891b21a}.outline-level--figure{color:#16a34a;background:#16a34a1a;min-width:2em}.outline-text{color:color-mix(in srgb, canvastext 85%, #0f172a 10%);overflow-wrap:break-word;grid-area:1/2;font-size:.875rem;font-weight:500;line-height:1.3}.outline-item:not(.level-2):not(.level-3) .outline-text{font-weight:600}.outline-item.level-2{padding-left:1.1rem}.outline-item.level-2 .outline-text{font-size:.845rem}.outline-item.level-3{padding-left:1.6rem}.outline-item.level-3 .outline-text{font-size:.82rem}.outline-meta{flex-wrap:wrap;grid-area:2/2;align-items:center;gap:.2rem;display:flex}.outline-insert-btn,.outline-drag{opacity:.45;transition:opacity .12s}.outline-item:hover .outline-insert-btn,.outline-item:hover .outline-drag,.outline-item:focus-visible .outline-insert-btn,.outline-item:focus-within .outline-insert-btn{opacity:1}.outline-id{color:color-mix(in srgb, canvastext 70%, #0f172a 10%);white-space:nowrap;text-overflow:ellipsis;background:#2563eb14;border-radius:4px;max-width:10em;padding:.1em .35em;font-size:.68rem;overflow:hidden}.outline-insert-btn{letter-spacing:.03em;color:#2563ebe6;cursor:pointer;white-space:nowrap;background:#2563eb14;border:1px solid #2563eb47;border-radius:6px;padding:.18em .5em;font-family:inherit;font-size:.65rem;font-weight:600;line-height:1;transition:background .12s,border-color .12s,opacity .12s}.outline-insert-btn:hover:not(:disabled){background:#2563eb29;border-color:#2563eb73}.outline-insert-btn:disabled{opacity:.38;cursor:default}.outline-insert-btn:focus-visible{outline-offset:2px;outline:2px solid #2563eb}.outline-drag{letter-spacing:.03em;color:color-mix(in srgb, canvastext 40%, transparent);-webkit-user-select:none;user-select:none;font-size:.62rem;font-weight:500}.outline-item[draggable=true]{cursor:grab}.outline-item[draggable=true]:active{cursor:grabbing}.outline-item--figure{border-left-color:#22c55e40}.outline-item--figure:hover{background:#22c55e0c;border-left-color:#22c55e73}.outline-placeholder{color:color-mix(in srgb, canvastext 70%, #0f172a 10%);padding-left:.25rem;font-size:.875rem}:host{--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light dark;font-family:inherit;display:block}@media (prefers-color-scheme:dark){:host{--lightningcss-light: ;--lightningcss-dark:initial}}.reference-list{gap:.6rem;margin:0;padding:0;list-style:none;display:grid}.reference-item{border:1px dashed color-mix(in srgb, canvastext 8%, transparent);cursor:grab;border-radius:12px;flex-direction:column;gap:.35rem;padding:.65rem .75rem;transition:transform .12s,border-color .16s;display:flex}.reference-item:active{cursor:grabbing}.reference-item:hover{border-color:color-mix(in srgb, canvastext 16%, transparent);transform:translateY(-1px)}.reference-text{color:color-mix(in srgb, canvastext 90%, transparent);font-size:.8rem;line-height:1.2}.reference-meta{flex-wrap:wrap;align-items:center;gap:.35rem;display:flex}.reference-id{color:color-mix(in srgb, canvastext 80%, transparent);letter-spacing:.01em;background:#2563eb1f;border:1px solid #2563eb2e;border-radius:999px;padding:.12em .55em;font-size:.8em}.reference-cite-btn{text-transform:uppercase;letter-spacing:.04em;color:#2563ebe6;cursor:pointer;background:#2563eb14;border:1px solid #2563eb47;border-radius:8px;padding:.2em .5em;font-family:inherit;font-size:.7em;line-height:1;transition:background .12s,border-color .12s}.reference-cite-btn:hover:not(:disabled){background:#2563eb29;border-color:#2563eb73}.reference-cite-btn:disabled{opacity:.38;cursor:default}.reference-drag{text-transform:uppercase;letter-spacing:.04em;color:color-mix(in srgb, canvastext 60%, transparent);background:color-mix(in srgb, canvas 92%, transparent);border:1px dashed color-mix(in srgb, canvastext 18%, transparent);opacity:.25;border-radius:8px;padding:.2em .5em;font-size:.7em;transition:opacity .12s}.reference-item:hover .reference-drag{opacity:1}.reference-highlight{border-color:#2563eb73}.reference-empty{color:color-mix(in srgb, canvastext 70%, transparent);border:1px dashed color-mix(in srgb, canvastext 14%, transparent);text-align:center;border-radius:10px;padding:.75rem;font-style:italic}@media (prefers-color-scheme:dark){.reference-item{border-color:color-mix(in srgb, canvastext 22%, transparent)}.reference-item:hover{border-color:color-mix(in srgb, canvastext 32%, transparent)}.reference-id{color:color-mix(in srgb, canvastext 86%, transparent);background:#1d4ed838;border-color:#1d4ed852}.reference-drag{background:color-mix(in srgb, canvas 75%, transparent);border-color:color-mix(in srgb, canvastext 24%, transparent)}}:host{--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light dark;display:block}@media (prefers-color-scheme:dark){:host{--lightningcss-light: ;--lightningcss-dark:initial}}.selection-editor-container{gap:.75rem;display:grid}.selection-editor-section{gap:.25rem;display:grid}.selection-editor-section-label{color:color-mix(in srgb, canvastext 45%, transparent);text-transform:uppercase;letter-spacing:.06em;font-size:.7rem;font-weight:700}.selection-editor-element-row{justify-content:space-between;align-items:baseline;gap:.5rem;display:flex}.selection-editor-type-header{color:canvastext;margin:0;font-size:.88rem;font-weight:600}.selection-editor-insert-wrapper{flex-shrink:0}.selection-editor-insert-select{border:1px solid color-mix(in srgb, canvastext 18%, transparent);background:color-mix(in srgb, canvas 95%, white 5%);color:color-mix(in srgb, canvastext 70%, transparent);cursor:pointer;appearance:none;background-image:url("data:image/svg+xml,%3Csvg width='8' height='5' viewBox='0 0 8 5' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l3 3 3-3' stroke='%23666' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");background-position:right .35rem center;background-repeat:no-repeat;border-radius:5px;padding:.2rem 1.2rem .2rem .4rem;font-size:.78rem}.selection-editor-insert-select:hover{background-color:color-mix(in srgb, canvas 90%, white 10%);border-color:color-mix(in srgb, canvastext 25%, transparent)}.selection-editor-attr-default{color:canvastext;font-size:.85rem}.selection-editor-placeholder{color:color-mix(in srgb, canvastext 70%, transparent);margin:0;font-size:.85rem;font-style:italic}.selection-editor-field{gap:.3rem;display:grid}.selection-editor-controls{justify-content:flex-end;align-items:center;gap:.5rem;display:flex}.selection-editor-label{color:color-mix(in srgb, canvastext 75%, transparent);text-transform:uppercase;letter-spacing:.03em;font-size:.8rem;font-weight:600}.selection-editor-value{background:#2563eb14;border-radius:4px;padding:.2rem .45rem;font-family:SFMono-Regular,Consolas,Liberation Mono,Menlo,monospace;font-size:.85rem;display:inline-block}.selection-editor-input{background:color-mix(in srgb, canvas 98%, white 2%);width:auto;min-width:0;max-width:calc(100% - .5rem);color:color-mix(in srgb, canvastext 90%, transparent);border:1px solid #0f172a29;border-radius:6px;padding:.4rem .6rem;font-family:SFMono-Regular,Consolas,Liberation Mono,Menlo,monospace;font-size:.85rem;transition:border-color .16s,background .16s}.selection-editor-input:focus{background:color-mix(in srgb, canvas 99%, white 1%);border-color:#2563eb;outline:none}.selection-editor-input:has(.ProseMirror){border-width:2px;border-color:var(--lightningcss-light,#2563eb)var(--lightningcss-dark,#3b82f6)}.selection-editor-input::placeholder{color:color-mix(in srgb, canvastext 50%, transparent);font-style:italic}.selection-editor-attrs{gap:.6rem;display:grid}.selection-editor-details{border:none;margin-top:.5rem}.selection-editor-details-summary{cursor:pointer;-webkit-user-select:none;user-select:none;justify-content:space-between;align-items:center;list-style:none;display:flex}.selection-editor-details-summary::-webkit-details-marker{display:none}.selection-editor-details-chevron{color:color-mix(in srgb, canvastext 45%, transparent);flex-shrink:0;transition:transform .15s}.selection-editor-details[open] .selection-editor-details-chevron{transform:rotate(180deg)}.selection-editor-details-body{gap:.6rem;margin-top:.6rem;padding-left:.25rem;display:grid}.selection-editor-attr-field{gap:.3rem;display:grid}.selection-editor-attr-label{color:color-mix(in srgb, canvastext 60%, transparent);font-size:.8rem;font-weight:400}.citation-source-adapter-root{flex-direction:column;gap:.75rem;display:flex}.citation-source-item{background:color-mix(in srgb, canvas 96%, white 4%);border:1px solid #0f172a1f;border-radius:6px;flex-direction:column;gap:.75rem;margin-bottom:.5rem;padding:.75rem .85rem;display:flex}.citation-source-item:last-of-type{margin-bottom:0}.citation-source-details{border:none;margin-top:.25rem}.citation-source-details-summary{color:color-mix(in srgb, canvastext 65%, transparent);cursor:pointer;-webkit-user-select:none;user-select:none;font-size:.8rem;font-weight:500;list-style:none}.citation-source-details-summary::-webkit-details-marker{display:none}.citation-source-details-summary:before{content:"▸ ";margin-right:.25rem;transition:transform .15s;display:inline-block}.citation-source-details[open] .citation-source-details-summary:before{transform:rotate(90deg)}.citation-source-details-body{flex-direction:column;gap:.75rem;margin-top:.6rem;padding-left:.25rem;display:flex}.citation-source-field{flex-direction:column;gap:.35rem;min-width:0;display:flex}.citation-source-field--checkbox{flex-direction:row;align-items:center;gap:.5rem}.citation-source-field--checkbox .selection-editor-attr-label{flex:none}.citation-source-field .selection-editor-attr-label{white-space:nowrap;font-size:.8rem;overflow:visible}.citation-source-field .selection-editor-input{box-sizing:border-box;width:100%;min-height:2.25rem;padding:.45rem .65rem;font-size:.9rem}.citation-source-field--checkbox .selection-editor-input{flex-shrink:0;width:auto;min-height:auto;margin:0}.citation-source-field input[type=checkbox]{cursor:pointer;width:1.125rem;height:1.125rem;margin:0}.citation-source-add,.citation-source-remove{background:color-mix(in srgb, canvas 95%, white 5%);cursor:pointer;border:1px solid #0f172a33;border-radius:4px;margin-top:.15rem;padding:.2rem .4rem;font-size:.7rem}.citation-source-add:hover,.citation-source-remove:hover{background:color-mix(in srgb, canvas 90%, white 10%)}.citation-source-add{margin-top:.25rem}.selection-editor-textarea{background:color-mix(in srgb, canvas 98%, white 2%);resize:vertical;width:100%;min-height:5rem;color:color-mix(in srgb, canvastext 90%, transparent);box-sizing:border-box;border:1px solid #0f172a29;border-radius:6px;padding:.4rem .6rem;font-family:SFMono-Regular,Consolas,Liberation Mono,Menlo,monospace;font-size:.85rem}.selection-editor-textarea:focus{border-color:#2563eb;outline:none}.selection-editor-math-preview{background:color-mix(in srgb, canvas 96%, white 4%);border:1px solid #0f172a1f;border-radius:6px;min-height:2.5rem;padding:.5rem;overflow:auto}.selection-editor-math-preview:empty:before{content:"Preview updates as you type";color:color-mix(in srgb, canvastext 50%, transparent);font-style:italic}.selection-editor-math-error{color:#b91c1c;margin:.35rem 0 0;font-family:ui-monospace,monospace;font-size:.8rem}.selection-editor-math-warnings{color:color-mix(in srgb, canvastext 65%, transparent);margin:.35rem 0 0;font-size:.8rem}.selection-editor-math-actions{flex-wrap:wrap;align-items:center;gap:.5rem;display:flex}.selection-editor-button{background:color-mix(in srgb, canvas 95%, white 5%);cursor:pointer;color:inherit;border:1px solid #0f172a33;border-radius:6px;padding:.4rem .75rem;font-size:.85rem}.selection-editor-button--secondary{padding:.25rem .55rem;font-size:.75rem}.selection-editor-button:hover{background:color-mix(in srgb, canvas 90%, white 10%)}.selection-editor-button--primary{color:#fff;background:#2563eb;border-color:#2563eb}.selection-editor-button--primary:hover{background:#1d4ed8}.selection-editor-actions{flex-wrap:wrap;align-items:center;gap:.5rem;margin-top:.25rem;display:flex}.selection-editor-expand-btn{color:color-mix(in srgb, canvastext 50%, transparent);cursor:pointer;text-underline-offset:2px;background:0 0;border:none;align-self:start;padding:0;font-size:.75rem;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}.selection-editor-expand-btn:hover{color:color-mix(in srgb, canvastext 75%, transparent)}.selection-editor-hint,.selection-editor-math-hint{color:color-mix(in srgb, canvastext 55%, transparent);font-size:.75rem}.selection-editor-math-docs{margin:.5rem 0 0;font-size:.75rem}.selection-editor-math-docs-link{color:color-mix(in srgb, canvastext 60%, transparent);text-decoration:none}.selection-editor-math-docs-link:hover{text-decoration:underline}.selection-editor-citation .selection-editor-citation-content{box-sizing:border-box;width:100%}.selection-editor-citation .selection-editor-field{gap:.4rem}.selection-editor-citation-pm{min-height:2.75rem}.selection-editor-citation-pm .ProseMirror{outline:none;min-height:2.25rem;padding:.5rem .7rem;font-size:.9rem}.selection-editor-citation-pm .ProseMirror p{margin:0}.selection-editor-citation-actions{flex-wrap:wrap;align-items:center;gap:.5rem;display:flex}.selection-editor-citation-hint{color:color-mix(in srgb, canvastext 55%, transparent);font-size:.75rem}@media (prefers-color-scheme:dark){.selection-editor-value{background:#3b82f633}.selection-editor-input{background:color-mix(in srgb, canvas 94%, black 6%);border-color:#94a3b859}.selection-editor-input:focus{background:color-mix(in srgb, canvas 92%, black 8%)}.selection-editor-textarea{background:color-mix(in srgb, canvas 94%, black 6%);border-color:#94a3b859}.citation-source-item{background:color-mix(in srgb, canvas 94%, black 6%);border-color:#94a3b84d}.citation-source-add,.citation-source-remove,.selection-editor-button{background:color-mix(in srgb, canvas 90%, black 10%);border-color:#94a3b859}.citation-source-add:hover,.citation-source-remove:hover,.selection-editor-button:hover{background:color-mix(in srgb, canvas 85%, black 15%)}.selection-editor-math-preview{background:color-mix(in srgb, canvas 94%, black 6%);border-color:#94a3b84d}.selection-editor-math-error{color:#fca5a5}}