castle-web-cli 0.4.227 → 0.4.229
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.
- package/dist/agent-prompts.d.ts +9 -3
- package/dist/agent-prompts.js +140 -48
- package/dist/agent.js +127 -14
- package/dist/api.d.ts +37 -0
- package/dist/api.js +29 -0
- package/dist/castle-host/host.d.ts +6 -0
- package/dist/castle-host/host.js +42 -3
- package/dist/castleJson.d.ts +15 -0
- package/dist/castleJson.js +136 -3
- package/dist/cloudGit.d.ts +27 -1
- package/dist/cloudGit.js +359 -24
- package/dist/cloudGitServe.js +9 -5
- package/dist/gitCollaborators.d.ts +16 -0
- package/dist/gitCollaborators.js +42 -0
- package/dist/gitIncoming.d.ts +17 -0
- package/dist/gitIncoming.js +113 -0
- package/dist/gitRemote.js +2 -2
- package/dist/imports.js +4 -2
- package/dist/index.js +5 -0
- package/dist/init.js +1 -1
- package/dist/native/playtest-browser.js +13 -1
- package/dist/platformDoc.js +1 -1
- package/dist/save-deck.js +3 -0
- package/dist/serve.js +17 -0
- package/dist/shell/assets/index-Cf61cNfT.css +1 -0
- package/dist/shell/assets/{index-D006JHww.js → index-D2tWM896.js} +71 -71
- package/dist/shell/index.html +2 -2
- package/dist/sourceLineage.d.ts +42 -0
- package/dist/sourceLineage.js +380 -0
- package/dist/webSourceSync.d.ts +9 -0
- package/dist/webSourceSync.js +24 -9
- package/kits/base/castle.json +1 -1
- package/kits/base/sdk/README.md +81 -0
- package/kits/base/sdk/castle.d.ts +1 -1
- package/kits/base/sdk/commands.d.ts +6 -0
- package/kits/base/sdk/multiplayer.d.ts +44 -6
- package/kits/base/sdk/multiplayer.js +62 -1
- package/kits/base/sdk/server/platformHandle.d.ts +9 -1
- package/kits/base/sdk/server/wrapper.d.ts +111 -4
- package/kits/base/sdk/server/wrapper.js +650 -24
- package/package.json +10 -2
- package/dist/shell/assets/index-BxDYy_-C.css +0 -1
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
const CASTLE_NOREPLY = /^([^+@]+)\+([^@]+)@users\.noreply\.castle\.xyz$/i;
|
|
2
|
+
export function castleIdentityFromEmail(email) {
|
|
3
|
+
const match = CASTLE_NOREPLY.exec(email.trim());
|
|
4
|
+
return match?.[1] && match[2] ? { userId: match[1], username: match[2] } : null;
|
|
5
|
+
}
|
|
6
|
+
export function castleUsernameFromEmail(email) {
|
|
7
|
+
return castleIdentityFromEmail(email)?.username ?? null;
|
|
8
|
+
}
|
|
9
|
+
/** The collaborator username for an incoming commit, or null for this user and laptop commits. */
|
|
10
|
+
export function collaboratorUsername(authorEmail, ownEmail) {
|
|
11
|
+
const author = castleIdentityFromEmail(authorEmail);
|
|
12
|
+
const own = ownEmail ? castleIdentityFromEmail(ownEmail) : null;
|
|
13
|
+
if (!author || !own || author.userId.toLowerCase() === own.userId.toLowerCase())
|
|
14
|
+
return null;
|
|
15
|
+
return author.username;
|
|
16
|
+
}
|
|
17
|
+
/** "a", "a and b", "a, b, and c". */
|
|
18
|
+
export function joinedNames(names) {
|
|
19
|
+
if (names.length <= 1)
|
|
20
|
+
return names[0] ?? '';
|
|
21
|
+
if (names.length === 2)
|
|
22
|
+
return `${names[0]} and ${names[1]}`;
|
|
23
|
+
return `${names.slice(0, -1).join(', ')}, and ${names[names.length - 1]}`;
|
|
24
|
+
}
|
|
25
|
+
/** The human-readable source of commits fetched from castle/main. */
|
|
26
|
+
export function otherSideLabel(authors, ownEmail) {
|
|
27
|
+
const own = ownEmail ? castleIdentityFromEmail(ownEmail) : null;
|
|
28
|
+
if (!own)
|
|
29
|
+
return 'another computer';
|
|
30
|
+
const others = new Set();
|
|
31
|
+
for (const author of authors) {
|
|
32
|
+
const identity = castleIdentityFromEmail(author.email);
|
|
33
|
+
if (!identity)
|
|
34
|
+
return 'another computer';
|
|
35
|
+
if (identity.userId.toLowerCase() !== own.userId.toLowerCase())
|
|
36
|
+
others.add(identity.username);
|
|
37
|
+
}
|
|
38
|
+
if (others.size === 0)
|
|
39
|
+
return 'your laptop';
|
|
40
|
+
const names = [...others];
|
|
41
|
+
return `${joinedNames(names)} (${names.length === 1 ? 'a collaborator' : 'collaborators'} on this deck)`;
|
|
42
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare const GIT_INCOMING_FILE: string;
|
|
2
|
+
export interface GitIncomingCommit {
|
|
3
|
+
sha: string;
|
|
4
|
+
author: string;
|
|
5
|
+
subject: string;
|
|
6
|
+
files: string[];
|
|
7
|
+
at: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function appendGitIncoming(deckDir: string, commits: GitIncomingCommit[]): void;
|
|
10
|
+
export declare function readGitIncoming(deckDir: string): GitIncomingCommit[];
|
|
11
|
+
export declare function formatGitIncomingNote(commits: GitIncomingCommit[]): string | null;
|
|
12
|
+
export declare function readGitIncomingNote(deckDir: string): {
|
|
13
|
+
note: string | null;
|
|
14
|
+
shas: string[];
|
|
15
|
+
};
|
|
16
|
+
/** Removes only commits covered by a completed turn, preserving anything appended while it ran. */
|
|
17
|
+
export declare function removeGitIncoming(deckDir: string, shas: string[]): void;
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import * as fs from 'fs';
|
|
2
|
+
import * as path from 'path';
|
|
3
|
+
import { joinedNames } from './gitCollaborators.js';
|
|
4
|
+
export const GIT_INCOMING_FILE = path.join('.castle', 'agent', 'git-incoming.json');
|
|
5
|
+
const LOCK_FILE = path.join('.castle', 'agent', 'git-incoming.lock');
|
|
6
|
+
const MAX_COMMITS = 50;
|
|
7
|
+
const LOCK_STALE_MS = 30_000;
|
|
8
|
+
function validCommit(value) {
|
|
9
|
+
if (!value || typeof value !== 'object')
|
|
10
|
+
return false;
|
|
11
|
+
const item = value;
|
|
12
|
+
return (typeof item.sha === 'string' &&
|
|
13
|
+
typeof item.author === 'string' &&
|
|
14
|
+
typeof item.subject === 'string' &&
|
|
15
|
+
Array.isArray(item.files) &&
|
|
16
|
+
item.files.every((file) => typeof file === 'string') &&
|
|
17
|
+
typeof item.at === 'string');
|
|
18
|
+
}
|
|
19
|
+
function readFile(file) {
|
|
20
|
+
try {
|
|
21
|
+
const parsed = JSON.parse(fs.readFileSync(file, 'utf-8'));
|
|
22
|
+
return Array.isArray(parsed) ? parsed.filter(validCommit) : [];
|
|
23
|
+
}
|
|
24
|
+
catch {
|
|
25
|
+
return [];
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
function withStoreLock(deckDir, fallback, fn) {
|
|
29
|
+
const lock = path.join(deckDir, LOCK_FILE);
|
|
30
|
+
fs.mkdirSync(path.dirname(lock), { recursive: true });
|
|
31
|
+
for (let attempt = 0; attempt < 50; attempt += 1) {
|
|
32
|
+
try {
|
|
33
|
+
const fd = fs.openSync(lock, 'wx');
|
|
34
|
+
try {
|
|
35
|
+
return fn();
|
|
36
|
+
}
|
|
37
|
+
finally {
|
|
38
|
+
fs.closeSync(fd);
|
|
39
|
+
fs.rmSync(lock, { force: true });
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
catch (err) {
|
|
43
|
+
if (err.code !== 'EEXIST')
|
|
44
|
+
throw err;
|
|
45
|
+
try {
|
|
46
|
+
if (Date.now() - fs.statSync(lock).mtimeMs > LOCK_STALE_MS) {
|
|
47
|
+
fs.rmSync(lock, { force: true });
|
|
48
|
+
continue;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
catch {
|
|
52
|
+
continue;
|
|
53
|
+
}
|
|
54
|
+
Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, 10);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return fallback;
|
|
58
|
+
}
|
|
59
|
+
function writeAtomic(file, commits) {
|
|
60
|
+
fs.mkdirSync(path.dirname(file), { recursive: true });
|
|
61
|
+
const temp = `${file}.${process.pid}.tmp`;
|
|
62
|
+
fs.writeFileSync(temp, JSON.stringify(commits, null, 2) + '\n');
|
|
63
|
+
fs.renameSync(temp, file);
|
|
64
|
+
}
|
|
65
|
+
export function appendGitIncoming(deckDir, commits) {
|
|
66
|
+
if (commits.length === 0)
|
|
67
|
+
return;
|
|
68
|
+
withStoreLock(deckDir, undefined, () => {
|
|
69
|
+
const file = path.join(deckDir, GIT_INCOMING_FILE);
|
|
70
|
+
const bySha = new Map(readFile(file).map((commit) => [commit.sha, commit]));
|
|
71
|
+
for (const commit of commits)
|
|
72
|
+
bySha.set(commit.sha, commit);
|
|
73
|
+
writeAtomic(file, [...bySha.values()].slice(-MAX_COMMITS));
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
export function readGitIncoming(deckDir) {
|
|
77
|
+
return withStoreLock(deckDir, [], () => readFile(path.join(deckDir, GIT_INCOMING_FILE)));
|
|
78
|
+
}
|
|
79
|
+
function namesFor(commits) {
|
|
80
|
+
const names = [...new Set(commits.map((commit) => commit.author).filter(Boolean))];
|
|
81
|
+
return names.length === 0 ? 'A collaborator' : joinedNames(names);
|
|
82
|
+
}
|
|
83
|
+
export function formatGitIncomingNote(commits) {
|
|
84
|
+
if (commits.length === 0)
|
|
85
|
+
return null;
|
|
86
|
+
const heading = `[Castle] Since your last turn, ${namesFor(commits)} landed these changes to this deck (already merged into the working tree):`;
|
|
87
|
+
const multipleAuthors = new Set(commits.map((commit) => commit.author)).size > 1;
|
|
88
|
+
const rows = commits.map((commit) => {
|
|
89
|
+
const shown = commit.files.slice(0, 6);
|
|
90
|
+
const files = shown.length > 0 ? `${shown.join(', ')}${commit.files.length > shown.length ? ', …' : ''}` : 'no files';
|
|
91
|
+
const author = multipleAuthors ? ` — ${commit.author}` : '';
|
|
92
|
+
return `- ${commit.sha.slice(0, 7)} ${commit.subject}${author} (${files})`;
|
|
93
|
+
});
|
|
94
|
+
return [heading, ...rows].join('\n');
|
|
95
|
+
}
|
|
96
|
+
export function readGitIncomingNote(deckDir) {
|
|
97
|
+
const commits = readGitIncoming(deckDir);
|
|
98
|
+
return { note: formatGitIncomingNote(commits), shas: commits.map((commit) => commit.sha) };
|
|
99
|
+
}
|
|
100
|
+
/** Removes only commits covered by a completed turn, preserving anything appended while it ran. */
|
|
101
|
+
export function removeGitIncoming(deckDir, shas) {
|
|
102
|
+
if (shas.length === 0)
|
|
103
|
+
return;
|
|
104
|
+
withStoreLock(deckDir, undefined, () => {
|
|
105
|
+
const file = path.join(deckDir, GIT_INCOMING_FILE);
|
|
106
|
+
const removed = new Set(shas);
|
|
107
|
+
const remaining = readFile(file).filter((commit) => !removed.has(commit.sha));
|
|
108
|
+
if (remaining.length > 0)
|
|
109
|
+
writeAtomic(file, remaining);
|
|
110
|
+
else
|
|
111
|
+
fs.rmSync(file, { force: true });
|
|
112
|
+
});
|
|
113
|
+
}
|
package/dist/gitRemote.js
CHANGED
|
@@ -485,7 +485,7 @@ function explainRemoteFailure(result, deckId, environment) {
|
|
|
485
485
|
if (/repository '[^']*' not found|error: 404/.test(why))
|
|
486
486
|
return noHistoryError(deckId, environment);
|
|
487
487
|
if (/error: 403/.test(why)) {
|
|
488
|
-
return new Error(`You don't have access to deck ${deckId}: only its owner can clone it.`);
|
|
488
|
+
return new Error(`You don't have access to deck ${deckId}: only its owner or a collaborator can clone it.`);
|
|
489
489
|
}
|
|
490
490
|
if (/error: 401|Authentication failed|could not read (Username|Password)/i.test(why)) {
|
|
491
491
|
return new Error('Castle did not accept your login. Run `castle-web login`, then retry.');
|
|
@@ -496,7 +496,7 @@ function noHistoryError(deckId, environment) {
|
|
|
496
496
|
const editor = environment === 'staging'
|
|
497
497
|
? `https://castle.xyz/create/${deckId}?sandbox=staging`
|
|
498
498
|
: `https://castle.xyz/create/${deckId}`;
|
|
499
|
-
return new Error(`Deck ${deckId} has no git history${environment === 'staging' ? ' on staging' : ''} yet (or doesn't exist).
|
|
499
|
+
return new Error(`Deck ${deckId} has no git history${environment === 'staging' ? ' on staging' : ''} yet (or doesn't exist). Its owner needs to open it in the cloud editor once with git on (${editor}), which starts its history; then clone again.`);
|
|
500
500
|
}
|
|
501
501
|
/** Clones a deck's Castle repo, with the remote named `castle` and the credential helper in the clone's config. */
|
|
502
502
|
export function gitClone(target, dirArg, opts, deps, cwd = process.cwd()) {
|
package/dist/imports.js
CHANGED
|
@@ -594,11 +594,13 @@ async function placeFetchedImport(targetDir, deckId, givenAlias) {
|
|
|
594
594
|
? await api.webDeckSource(canonicalDeckId)
|
|
595
595
|
: initialSource;
|
|
596
596
|
if (!source) {
|
|
597
|
-
|
|
597
|
+
// 'cauldron' is the new name for the 'experimentalWeb' card type.
|
|
598
|
+
const cardType = meta?.initialCard?.type;
|
|
599
|
+
if (meta && cardType !== 'cauldron' && cardType !== 'experimentalWeb') {
|
|
598
600
|
const title = meta.title?.trim();
|
|
599
601
|
const subject = title ? `"${title}"` : `Deck ${canonicalDeckId}`;
|
|
600
602
|
throw new ImportError('classic-deck', `${subject} is a classic Castle deck, made in the Castle app's editor. ` +
|
|
601
|
-
`Only
|
|
603
|
+
`Only Cauldron decks can be imported; a classic deck's scenes can't be.`);
|
|
602
604
|
}
|
|
603
605
|
throw new ImportError('no-source', `No source archive on the server for deck ${canonicalDeckId}. ` +
|
|
604
606
|
'Its owner needs to run `castle-web save-deck` before it can be imported.');
|
package/dist/index.js
CHANGED
|
@@ -442,6 +442,11 @@ async function cloudGitCommand(sub) {
|
|
|
442
442
|
throw new Error('Usage: castle-web git attach <dir> --remote <url>');
|
|
443
443
|
}
|
|
444
444
|
const outcome = await cloudGit.cloudAttach(dir, remote, deps);
|
|
445
|
+
if ('output' in outcome) {
|
|
446
|
+
// The attach ran in a child of its own; this is what it said.
|
|
447
|
+
process.stdout.write(outcome.output);
|
|
448
|
+
return;
|
|
449
|
+
}
|
|
445
450
|
console.log(`Attached ${path.resolve(dir)} to ${remote} (${outcome.repo} repo, ${outcome.outcome}).`);
|
|
446
451
|
if (outcome.backup)
|
|
447
452
|
console.log(`The cloud copy's differing files are saved in ${outcome.backup}.`);
|
package/dist/init.js
CHANGED
|
@@ -66,7 +66,7 @@ const BARE_SCAFFOLDS = [
|
|
|
66
66
|
// Registry version of castle-web-sdk to inject when scaffolding from a
|
|
67
67
|
// globally-installed castle-web (not from inside the workspace). Bumped
|
|
68
68
|
// alongside cli/sdk version bumps.
|
|
69
|
-
const PUBLISHED_SDK_VERSION = '0.4.
|
|
69
|
+
const PUBLISHED_SDK_VERSION = '0.4.45';
|
|
70
70
|
// Range, not a pin: `castle-web-fonts` is its own package precisely so a tenth
|
|
71
71
|
// face can ship without a cli release, and a caret range means an existing
|
|
72
72
|
// deck's next install picks it up. Nothing here has to move when it does.
|
|
@@ -13,6 +13,16 @@
|
|
|
13
13
|
// the package isn't installed at all. A missing package surfaces as a normal
|
|
14
14
|
// tool-error string instead.
|
|
15
15
|
//
|
|
16
|
+
// That absence is the NORMAL case for a published install: playwright-core is a
|
|
17
|
+
// devDependency, not a dependency, so `npm install -g castle-web-cli` does not
|
|
18
|
+
// ship it. Cloud sandboxes never want it -- every playtest and cover there goes
|
|
19
|
+
// to the shared browser service, and nothing in a sandbox can launch a local
|
|
20
|
+
// browser -- and shipping it to every install to serve the laptop case was the
|
|
21
|
+
// last of Playwright that reached the sandbox image. A repo checkout still gets
|
|
22
|
+
// it from devDependencies, so developing and testing this file is unchanged, and
|
|
23
|
+
// a laptop user who wants local playtest installs it beside the CLI. Only the
|
|
24
|
+
// type imports here are unconditional, and those are erased at compile time.
|
|
25
|
+
//
|
|
16
26
|
// Browser binaries are installed ON DEMAND, not at npm-install time: the dep
|
|
17
27
|
// is playwright-core (identical API to `playwright`, same pinned Chromium
|
|
18
28
|
// build per version, but NO postinstall browser download), and the first
|
|
@@ -42,7 +52,9 @@ const LAUNCH_ARGS = [
|
|
|
42
52
|
"--disable-backgrounding-occluded-windows",
|
|
43
53
|
"--disable-renderer-backgrounding",
|
|
44
54
|
];
|
|
45
|
-
const MISSING_PLAYWRIGHT_MESSAGE = "playwright-core is not installed
|
|
55
|
+
const MISSING_PLAYWRIGHT_MESSAGE = "playwright-core is not installed, so local playtest and cover capture are unavailable. " +
|
|
56
|
+
"Install it beside the CLI with `npm install -g playwright-core`, or run `npm install` " +
|
|
57
|
+
"from a repo checkout. Cloud sandboxes do not need it: they use the shared browser service.";
|
|
46
58
|
const MANUAL_INSTALL_HINT = "install manually with `npx playwright install chromium`";
|
|
47
59
|
const MANUAL_DEPS_HINT = "install manually with `npx playwright install-deps chromium` (needs root/apt)";
|
|
48
60
|
export const INSTALL_START_LABEL = "Downloading playtest browser (one-time, ~250MB)\u2026";
|
package/dist/platformDoc.js
CHANGED
|
@@ -239,7 +239,7 @@ const COMMON_SECTIONS = `## Imports are read-only
|
|
|
239
239
|
- **A fill deck has no fixed shape, and must look right at every shape in its range -- including 5:7, which it still gets from hosts that ignore the tag.** Lay out with flex/grid against the stage -- the element \`initCard()\` returns (its \`clientWidth\`/\`clientHeight\`), or \`var(--castle-card-w)\`/\`var(--castle-card-h)\` in CSS -- not against the window: the stage is smaller than the window whenever the host frame is outside the deck's range, and inside \`castle-web serve\`'s own page. Re-layout on \`resize\`; let the playfield use the extra room (a wider view of the world, a bigger board), and anchor HUD to the stage's edges and corners. Don't letterbox the game back into a 5:7 box inside a fill stage -- that just gives up the space.
|
|
240
240
|
- **A deck that lays itself out sizes HUD, buttons and text in the card unit, \`var(--castle-unit)\`, not \`vw\`, \`vh\` or \`cqw\`**: \`font-size: calc(5 * var(--castle-unit))\`. It is 1% of the width of the largest 5:7 card that fits in the stage -- the same as \`1vw\` on a card -- so a HUD keeps its card size on a wide stage, where anything in \`vw\` grows to fill a monitor. Canvas code gets the same px value from \`cardUnit(width, height)\` of the stage. A kit deck sizes things the way its kit guide says: a kit's scene editor draws the stage smaller inside the editor, where the unit follows the window instead.
|
|
241
241
|
- **A 3D camera keeps its framing across shapes with \`fovForAspect(fov, aspect)\`**: \`camera.fov = fovForAspect(50, width / height)\` on every resize. It keeps \`fov\` at 5:7 and wider and widens it on a stage taller than 5:7, so a tall phone doesn't crop the sides of the scene.
|
|
242
|
-
- **The Play panel shows a 5:7
|
|
242
|
+
- **The Play panel shows a card deck as a 5:7 card, and a fill deck at the shape picked under it**: Fit (the whole panel), Phone, Card or Landscape, each clamped into the deck's range the way a host would, with the frame's size beside the picker. A new or changed tag takes effect with the next run (Restart), like any other change to the deck. \`npm run screenshot\` captures whatever shape the open deck tab has. Those are a few shapes of many: make the layout's rules (anchors, the card unit, the camera) hold at any shape rather than tuning it pixel by pixel to what the Play panel shows. A fill deck's cover is taken at the card shape (the nearest one its range allows), since a cover is shown as a card.
|
|
243
243
|
- **Hand-rolled \`<canvas>\` elements must account for devicePixelRatio, or the game looks blurry on phones.** Size the backing store to the CSS layout size times \`devicePixelRatio\` (e.g. \`canvas.width = rect.width * dpr\`), keep the CSS width/height as the layout size, and scale the 2D context (\`ctx.scale(dpr, dpr)\`) so drawing code stays in CSS units — re-apply on resize. Kit decks don't need to do this by hand; the kit's engine already configures its canvas for DPR.
|
|
244
244
|
- Exception: deliberate pixel art wants a fixed low-resolution backing store with \`image-rendering: pixelated\` CSS instead — don't DPR-scale that; the crisp chunky look is the point.
|
|
245
245
|
- **A WebGL canvas must be created with \`preserveDrawingBuffer: true\`, or every in-page capture of the deck comes back blank** — the Play panel's Snap and \`npm run screenshot\` both read the canvas after the frame has been shown, and by then the browser has cleared it, so the image is just the card's background. Pass it through whatever library makes the canvas: \`new THREE.WebGLRenderer({ preserveDrawingBuffer: true })\`, PixiJS \`app.init({ preserveDrawingBuffer: true })\`, or \`canvas.getContext('webgl2', { preserveDrawingBuffer: true })\`. A 2D canvas needs nothing, and kit decks already set it.
|
package/dist/save-deck.js
CHANGED
|
@@ -272,6 +272,9 @@ async function publishServerBundle(projectDir, deckId) {
|
|
|
272
272
|
maxPlayers: serverConfig.maxPlayers,
|
|
273
273
|
voice: { enabled: serverConfig.voiceEnabled },
|
|
274
274
|
...(serverConfig.destinations ? { destinations: serverConfig.destinations } : {}),
|
|
275
|
+
...(serverConfig.worldNotifications
|
|
276
|
+
? { worldNotifications: serverConfig.worldNotifications }
|
|
277
|
+
: {}),
|
|
275
278
|
});
|
|
276
279
|
// The server hashes what it actually stored. A mismatch means the bytes that
|
|
277
280
|
// will run in sessions are not the bytes we bundled.
|
package/dist/serve.js
CHANGED
|
@@ -271,9 +271,26 @@ async function startLocalContentServers(bindHost, upstreamHost, upstreamPort, se
|
|
|
271
271
|
// shell via postMessage, where the builtin Play panel renders a logs drawer.
|
|
272
272
|
// Kit-agnostic: works on a bare `--kit none` deck with no editor framework.
|
|
273
273
|
// Never injected for the published feed (that path doesn't go through dev serve).
|
|
274
|
+
//
|
|
275
|
+
// It also reports the document's own castle-display tag, once the head has
|
|
276
|
+
// parsed, so the Play panel sizes its frame by exactly the declaration this
|
|
277
|
+
// document (and the SDK in it) loaded with, never by a newer save of the file.
|
|
274
278
|
const CONSOLE_CAPTURE = `<script>(function(){
|
|
275
279
|
try { if (new URLSearchParams(location.search).get('logs') !== '1') return; } catch (e) { return; }
|
|
276
280
|
if (window.parent === window) return;
|
|
281
|
+
var reportDisplay = function () {
|
|
282
|
+
try {
|
|
283
|
+
var meta = document.querySelector('meta[name="castle-display"]');
|
|
284
|
+
window.parent.postMessage({ type: 'castle-display', content: meta ? meta.getAttribute('content') : null }, '*');
|
|
285
|
+
} catch (e) {}
|
|
286
|
+
};
|
|
287
|
+
if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', reportDisplay);
|
|
288
|
+
else reportDisplay();
|
|
289
|
+
// Asked again once the frame has loaded, in case the first report beat the
|
|
290
|
+
// panel's listener.
|
|
291
|
+
window.addEventListener('message', function (event) {
|
|
292
|
+
if (event.source === window.parent && event.data && event.data.type === 'castle-display-request') reportDisplay();
|
|
293
|
+
});
|
|
277
294
|
var fmt = function (a) {
|
|
278
295
|
if (typeof a === 'string') return a;
|
|
279
296
|
if (a instanceof Error) return a.stack || a.message;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@font-face{font-display:swap;font-family:Balto;src:url(https://castle.xyz/Balto-Book.woff2)format("woff2"),url(https://castle.xyz/Balto-Book.woff)format("woff");font-weight:400}@font-face{font-display:swap;font-family:Balto;src:url(https://castle.xyz/Balto-Medium.woff2)format("woff2"),url(https://castle.xyz/Balto-Medium.woff)format("woff");font-weight:500}@font-face{font-display:swap;font-family:Basteleur;src:url(https://castle.xyz/Basteleur-Bold.woff2)format("woff2"),url(https://castle.xyz/Basteleur-Bold.woff)format("woff")}:root{--castle-font-body:baltomobile, Balto, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;--castle-font-display:Basteleur, Georgia, "Times New Roman", serif;--castle-font-mono:ui-monospace, SFMono-Regular, Menlo, monospace;--castle-text-size-small:11px;--castle-text-size-base:13px;--castle-text-size-large:15px;--castle-text-style-smallcaps-size:var(--castle-text-size-small);--castle-text-style-smallcaps-letter-spacing:.05em;--castle-text-style-smallcaps-transform:uppercase;--castle-text-primary:#e6e6e6;--castle-text-secondary:#b3b3b3;--castle-text-muted:#888;--castle-text-dim:#525252;--castle-text-dark:#111;--castle-surface-1:#000;--castle-surface-2:#0c0c0c;--castle-surface-3:#181818;--castle-surface-4:#242424;--castle-surface-5:#303030;--castle-surface-6:#3c3c3c;--castle-surface-light:#e6e6e6;--castle-border-1:#2a2a2a;--castle-border-2:#6a6a6a;--castle-border-3:#3a3a3a;--castle-border-4:#e6e6e6;--castle-accent:#793a80;--castle-danger-text:#e86a73;--castle-danger-surface:#73172d;--castle-danger-surface-hover:#b4202a;--castle-warn-text:#e8b25a;--castle-warn-surface:#5a3d0a;--castle-space-small:3px;--castle-space-base:6px;--castle-space-large:12px;--castle-radius-small:4px;--castle-radius-base:8px;--castle-radius-large:16px;--castle-radius-pill:999px;--castle-button-height:24px;--castle-button-icon-size:16px;--castle-button-height-large:36px;--castle-button-icon-size-large:24px;--castle-icon-size-inline:12px;--castle-panel-header-height:36px;--castle-panel-header-height-mobile:48px}.castle-text-style-smallcaps{font-size:var(--castle-text-style-smallcaps-size);letter-spacing:var(--castle-text-style-smallcaps-letter-spacing);text-transform:var(--castle-text-style-smallcaps-transform)}.castle-icon-inline{flex:0 0 var(--castle-icon-size-inline);width:var(--castle-icon-size-inline);height:var(--castle-icon-size-inline);font-size:var(--castle-icon-size-inline)}.castle-icon-slot{flex:0 0 var(--castle-button-icon-size);width:var(--castle-button-icon-size);height:var(--castle-button-icon-size);justify-content:center;align-items:center;display:flex}.castle-icon-cell{flex:0 0 var(--castle-button-height);width:var(--castle-button-height);height:var(--castle-button-height);color:var(--castle-text-dim);pointer-events:none;justify-content:center;align-items:center;display:inline-flex}.castle-icon-slot svg,.castle-icon-slot iconify-icon,.castle-icon-cell svg,.castle-icon-cell iconify-icon{flex:0 0 var(--castle-button-icon-size);width:var(--castle-button-icon-size);height:var(--castle-button-icon-size);font-size:var(--castle-button-icon-size)}.castle-button{justify-content:center;align-items:center;gap:var(--castle-space-base);max-width:100%;height:var(--castle-button-height);padding:0 var(--castle-space-base);border-radius:var(--castle-radius-small);background:var(--castle-surface-4);color:var(--castle-text-primary);font-family:var(--castle-font-body);font-size:var(--castle-text-size-base);white-space:nowrap;cursor:pointer;border:0;line-height:1.3;display:inline-flex}.castle-button:not(.castle-button-icon){min-width:0}.castle-button>span{text-overflow:ellipsis;white-space:nowrap;min-width:0;overflow:hidden}.castle-button:hover,.castle-button.is-hover{background:var(--castle-surface-5)}.castle-button:active,.castle-button.is-pressed{background:var(--castle-surface-3)}.castle-button:focus-visible,.castle-button.is-focus{outline:1px solid var(--castle-border-2);outline-offset:2px}.castle-button[aria-pressed=true],.castle-button[aria-pressed=true]:hover,.castle-button[aria-pressed=true]:active{background:var(--castle-surface-light);color:var(--castle-text-dark)}.castle-button:disabled{opacity:.4;cursor:default}.castle-button-icon{width:var(--castle-button-height);padding:0}.castle-button-icon-large{width:var(--castle-button-height-large);height:var(--castle-button-height-large)}.castle-button-danger{background:var(--castle-danger-surface);color:var(--castle-text-primary)}.castle-button-danger:hover,.castle-button-danger.is-hover{background:var(--castle-danger-surface-hover)}.castle-button-danger:active,.castle-button-danger.is-pressed{background:var(--castle-danger-surface)}.castle-button-quiet{color:var(--castle-text-dim);background:0 0}.castle-button-quiet:hover,.castle-button-quiet.is-hover{background:var(--castle-surface-5);color:var(--castle-text-primary)}.castle-button-quiet:active,.castle-button-quiet.is-pressed{background:var(--castle-surface-3)}.castle-button-quiet[aria-pressed=true],.castle-button-quiet[aria-pressed=true]:hover,.castle-button-quiet[aria-pressed=true]:active{background:var(--castle-surface-5);color:var(--castle-text-primary)}.castle-composer-action{border-radius:var(--castle-radius-pill);color:var(--castle-text-muted);box-shadow:inset 0 0 0 1px var(--castle-border-2);background:0 0}.castle-composer-action:disabled{opacity:1;color:var(--castle-text-muted);box-shadow:inset 0 0 0 1px var(--castle-border-1);background:0 0}.castle-composer-action:not(:disabled),.castle-composer-action:not(:disabled):hover,.castle-composer-action:not(:disabled):active,.castle-composer-action:not(:disabled).is-hover,.castle-composer-action:not(:disabled).is-pressed{background:var(--castle-surface-light);color:var(--castle-text-dark);box-shadow:none}.castle-button svg,.castle-button iconify-icon{width:var(--castle-button-icon-size);height:var(--castle-button-icon-size);font-size:var(--castle-button-icon-size)}.castle-button-icon-large svg,.castle-button-icon-large iconify-icon{width:var(--castle-button-icon-size-large);height:var(--castle-button-icon-size-large);font-size:var(--castle-button-icon-size-large)}.castle-button-badge{min-width:16px;height:16px;padding:0 var(--castle-space-small);border-radius:var(--castle-radius-pill);background:var(--castle-surface-5);color:var(--castle-text-secondary);font-size:var(--castle-text-size-small);font-variant-numeric:tabular-nums;text-align:center;text-overflow:clip;flex:none;line-height:16px;overflow:hidden}.castle-button>.castle-button-badge{text-overflow:clip;min-width:16px;overflow:hidden}.castle-button>.castle-button-keys{text-overflow:clip;overflow:visible}.castle-text-field{min-width:0;height:var(--castle-button-height);padding:0 var(--castle-space-base);border:1px solid var(--castle-border-3);border-radius:var(--castle-radius-small);background:var(--castle-surface-3);color:var(--castle-text-primary);font-family:var(--castle-font-body);font-size:var(--castle-text-size-base);cursor:text;outline:0}.castle-text-field::placeholder{color:var(--castle-text-muted)}.castle-text-field:hover,.castle-text-field.is-hover{background:var(--castle-surface-4)}.castle-text-field:focus,.castle-text-field:focus-visible,.castle-text-field.is-focus{outline:1px solid var(--castle-border-2);outline-offset:2px}.castle-text-field:disabled{opacity:.4;cursor:default}.castle-select{min-width:0;height:var(--castle-button-height);padding:0 var(--castle-space-base);border:1px solid var(--castle-border-3);border-radius:var(--castle-radius-small);background:var(--castle-surface-3);color:var(--castle-text-primary);font-family:var(--castle-font-body);font-size:var(--castle-text-size-base);cursor:pointer;outline:0}.castle-select:hover,.castle-select.is-hover{background:var(--castle-surface-4)}.castle-select:focus,.castle-select:focus-visible,.castle-select.is-focus{outline:1px solid var(--castle-border-2);outline-offset:2px}.castle-select:disabled{opacity:.4;cursor:default}.castle-dock-control{justify-content:center;align-items:center;gap:var(--castle-space-base);max-width:100%;height:var(--castle-panel-header-height);padding:0 var(--castle-space-large);border:1px solid var(--castle-border-1);border-radius:var(--castle-radius-base);background:var(--castle-surface-3);color:var(--castle-text-primary);font-family:var(--castle-font-body);font-size:var(--castle-text-size-base);white-space:nowrap;cursor:pointer;font-weight:600;line-height:1;display:inline-flex}.castle-dock-control:not(.castle-dock-control-icon){min-width:0}.castle-dock-control>span{text-overflow:ellipsis;white-space:nowrap;min-width:0;overflow:hidden}.castle-dock-control-icon{width:var(--castle-panel-header-height);padding:0}.castle-dock-control-quiet{background:0 0;border-color:#0000;justify-content:flex-start;min-width:0}.castle-dock-control-mark{background:var(--castle-surface-1)}.castle-dock-control-group{cursor:default;box-shadow:inset 0 0 0 1px var(--castle-border-1);border:none;justify-content:flex-start;align-items:stretch;gap:0;padding:0;overflow:hidden}button.castle-dock-control:hover,button.castle-dock-control.is-hover{background:var(--castle-surface-4);border-color:var(--castle-border-3)}button.castle-dock-control:active,button.castle-dock-control.is-pressed{background:var(--castle-surface-2)}button.castle-dock-control-quiet:active,button.castle-dock-control-quiet.is-pressed{background:var(--castle-surface-3)}button.castle-dock-control:focus-visible,button.castle-dock-control.is-focus{outline:1px solid var(--castle-border-2);outline-offset:2px}.castle-dock-control:disabled{opacity:.4;cursor:default}button.castle-dock-control:disabled:hover,button.castle-dock-control:disabled.is-hover{background:var(--castle-surface-3);border-color:var(--castle-border-1)}button.castle-dock-control-quiet:disabled:hover,button.castle-dock-control-quiet:disabled.is-hover{background:0 0;border-color:#0000}button.castle-dock-control-mark:disabled:hover,button.castle-dock-control-mark:disabled.is-hover{background:var(--castle-surface-1)}.castle-dock-control svg,.castle-dock-control iconify-icon{width:var(--castle-button-icon-size);height:var(--castle-button-icon-size);font-size:var(--castle-button-icon-size);flex-shrink:0}.castle-dock-control-mark svg,.castle-dock-control-mark img{width:20px;height:20px}.castle-dock-control-mark img{object-fit:contain;display:block}.castle-dock-segment{flex:0 0 var(--castle-panel-header-height);width:var(--castle-panel-header-height);height:var(--castle-panel-header-height);color:var(--castle-text-muted);cursor:pointer;background:0 0;border:none;border-radius:0;justify-content:center;align-items:center;padding:0;display:inline-flex}.castle-dock-segment iconify-icon,.castle-dock-segment svg{width:var(--castle-button-icon-size);height:var(--castle-button-icon-size);font-size:var(--castle-button-icon-size)}@media (hover:hover){.castle-dock-segment:hover:not(.is-active){color:var(--castle-text-primary);background:var(--castle-surface-5)}}.castle-dock-segment.is-hover:not(.is-active){color:var(--castle-text-primary);background:var(--castle-surface-5)}.castle-dock-segment.is-active{color:var(--castle-text-dark);background:var(--castle-surface-light)}.castle-dock-segment.is-drag-origin{opacity:0;pointer-events:none;flex:0 0 0;width:0;min-width:0;max-width:0;padding:0;overflow:hidden}.castle-dock-segment-slot{flex:0 0 var(--castle-panel-header-height);width:var(--castle-panel-header-height);height:var(--castle-panel-header-height);color:var(--castle-text-primary);background:var(--castle-surface-6);pointer-events:none;justify-content:center;align-items:center;display:inline-flex}.castle-dock-segment-slot iconify-icon,.castle-dock-segment-slot svg{width:var(--castle-button-icon-size);height:var(--castle-button-icon-size);font-size:var(--castle-button-icon-size)}.castle-dock-segment-ghost{border-radius:var(--castle-radius-small);pointer-events:none;box-shadow:0 8px 24px #00000073}.castle-dock-segment:has(.castle-dock-badge){position:relative}.castle-dock-segment .castle-dock-badge{top:var(--castle-space-small);right:var(--castle-space-small);z-index:1;background:var(--castle-surface-light);color:var(--castle-text-dark);pointer-events:none;transform-origin:50%;position:absolute}.castle-dock-segment .castle-dock-badge:not(.is-appearing){visibility:hidden;opacity:0;transform:scale(.45)}.castle-dock-segment .castle-dock-badge.is-appearing{visibility:visible;animation:.28s cubic-bezier(.2,.8,.2,1) both dock-badge-appear}@keyframes dock-badge-appear{0%{opacity:0;transform:scale(.45)}70%{opacity:1;transform:scale(1.08)}to{opacity:1;transform:scale(1)}}@media (prefers-reduced-motion:reduce){.castle-dock-segment .castle-dock-badge.is-appearing{animation:none}}.castle-menu{gap:var(--castle-space-small);width:max-content;min-width:144px;padding:var(--castle-space-small);border:1px solid var(--castle-border-3);border-radius:var(--castle-radius-base);background:var(--castle-surface-5);flex-direction:column;display:flex;box-shadow:0 8px 24px #0000008c}.castle-menu-item{align-items:center;gap:var(--castle-space-base);width:100%;height:26px;padding:0 var(--castle-space-base);border-radius:var(--castle-radius-small);color:var(--castle-text-primary);font-family:var(--castle-font-body);font-size:var(--castle-text-size-base);cursor:pointer;background:0 0;border:0;display:flex}.castle-menu-icon{flex:0 0 16px;width:16px;height:16px;font-size:16px}svg.castle-menu-icon,iconify-icon.castle-menu-icon{fill:none;stroke:currentColor;stroke-linecap:round;stroke-linejoin:round;stroke-width:1.5px}.castle-menu-icon svg,.castle-menu-icon iconify-icon{width:16px;height:16px;font-size:16px}.castle-menu-item:hover:not(:disabled),.castle-menu-item.is-hover:not(:disabled){background:var(--castle-surface-6)}.castle-menu-item:disabled{opacity:.4;cursor:default}.castle-menu-item-label{text-overflow:ellipsis;white-space:nowrap;text-align:left;flex:auto;min-width:0;overflow:hidden}.castle-menu-check{color:var(--castle-text-primary);flex:none}.castle-menu-keys,.castle-button-keys{color:var(--castle-text-muted);font-size:var(--castle-text-size-small);white-space:nowrap;flex:none}.castle-menu-keys{margin-left:var(--castle-space-large)}.castle-menu-item:disabled .castle-menu-keys,.castle-button:disabled .castle-button-keys{color:inherit}.castle-menu-item-danger{color:var(--castle-danger-text)}.castle-menu-separator{height:1px;margin:var(--castle-space-small) 0;background:var(--castle-border-3)}.castle-menu-header{padding:var(--castle-space-small) var(--castle-space-base);color:var(--castle-text-muted);font-size:var(--castle-text-size-small);letter-spacing:.04em;text-transform:uppercase}.castle-menu-confirm{gap:var(--castle-space-base);min-width:180px;padding:var(--castle-space-small) var(--castle-space-base);flex-direction:column;display:flex}.castle-menu-confirm-text{color:var(--castle-text-primary);font-size:var(--castle-text-size-base);margin:0}.castle-menu-confirm-actions{justify-content:flex-end;gap:var(--castle-space-base);display:flex}.castle-menu-error{padding:var(--castle-space-small) var(--castle-space-base);color:var(--castle-danger-text);font-size:var(--castle-text-size-small);margin:0}.castle-feedback-quiet{--castle-feedback-text:var(--castle-text-muted);--castle-feedback-surface:var(--castle-surface-3);--castle-feedback-border:var(--castle-border-3)}.castle-feedback-warn{--castle-feedback-text:var(--castle-warn-text);--castle-feedback-surface:var(--castle-warn-surface);--castle-feedback-surface-hover:color-mix(in srgb, var(--castle-warn-text) 35%, var(--castle-warn-surface));--castle-feedback-border:color-mix(in srgb, var(--castle-warn-text), var(--castle-warn-surface))}.castle-feedback-danger{--castle-feedback-text:var(--castle-danger-text);--castle-feedback-surface:var(--castle-danger-surface);--castle-feedback-surface-hover:var(--castle-danger-surface-hover);--castle-feedback-border:color-mix(in srgb, var(--castle-danger-text), var(--castle-danger-surface))}.castle-feedback-note{color:var(--castle-feedback-text);margin:0}.castle-feedback-banner{align-items:center;gap:var(--castle-space-base);min-height:var(--castle-panel-header-height);padding:var(--castle-space-base);border-bottom:1px solid var(--castle-feedback-border);background:var(--castle-feedback-surface);color:var(--castle-feedback-text);font-size:var(--castle-text-size-base);display:flex}.castle-feedback-banner>span:not(.castle-icon-cell){flex:auto;min-width:0}.castle-feedback-banner .castle-icon-cell{color:inherit}.castle-feedback-warn .castle-button,.castle-feedback-danger .castle-button{border:1px solid var(--castle-feedback-border);background:var(--castle-feedback-surface);color:var(--castle-text-primary)}.castle-feedback-warn .castle-button:hover,.castle-feedback-warn .castle-button.is-hover,.castle-feedback-danger .castle-button:hover,.castle-feedback-danger .castle-button.is-hover{background:var(--castle-feedback-surface-hover)}.castle-feedback-warn .castle-button:active,.castle-feedback-warn .castle-button.is-pressed,.castle-feedback-danger .castle-button:active,.castle-feedback-danger .castle-button.is-pressed{background:var(--castle-feedback-surface)}.castle-feedback-takeover{padding:calc(var(--castle-space-large) * 2);border:1px solid var(--castle-feedback-border);border-radius:var(--castle-radius-base);background:var(--castle-feedback-surface);color:var(--castle-feedback-text);font-size:var(--castle-text-size-base);text-align:center;justify-content:center;align-items:center;display:flex}.castle-panel{border:1px solid var(--castle-border-1);border-radius:var(--castle-radius-base);background:var(--castle-surface-2);color:var(--castle-text-primary);font-family:var(--castle-font-body);transition:border-color .12s;position:relative;overflow:hidden}@media (hover:hover){.castle-panel:hover{border-color:var(--castle-border-3)}}.castle-panel.is-hover{border-color:var(--castle-border-3)}.castle-panel.is-active,.castle-panel.is-active:hover,.castle-panel.is-active.is-hover{border-color:var(--castle-border-2)}.castle-panel.is-dragging,.castle-panel.is-dragging:hover,.castle-panel.is-dragging.is-hover,.castle-panel.is-dragging.is-active{border-color:var(--castle-border-4)}.castle-panel-header,.castle-panel-tabs-header{height:var(--castle-panel-header-height);padding:0 var(--castle-space-base);border-bottom:1px solid var(--castle-border-1);background:var(--castle-surface-3);align-items:center;display:flex}@media (hover:hover){.castle-panel-header:hover,.castle-panel-tabs-header:hover{background:var(--castle-surface-4);cursor:grab}}.castle-panel-header.is-hover,.castle-panel-tabs-header.is-hover{background:var(--castle-surface-4);cursor:grab}.castle-panel-header:active,.castle-panel-header.is-pressed,.castle-panel-tabs-header:active,.castle-panel-tabs-header.is-pressed{cursor:grabbing}.castle-panel-tabs-header{align-items:stretch;gap:var(--castle-space-base)}.castle-panel-title{align-items:center;gap:var(--castle-space-base);min-width:0;padding:0 var(--castle-space-base);color:var(--castle-text-primary);font-family:var(--castle-font-display);font-size:var(--castle-text-size-base);margin:0 auto 0 0;font-weight:700;line-height:1.5;display:inline-flex}.castle-panel-tabs-header .castle-panel-title{white-space:nowrap;flex-shrink:0;align-self:center;margin:0}.castle-panel-title svg,.castle-panel-title iconify-icon{width:var(--castle-button-icon-size);height:var(--castle-button-icon-size);font-size:var(--castle-button-icon-size);flex-shrink:0}.castle-panel-header-actions{align-items:center;gap:var(--castle-space-small);margin-left:auto;display:flex}.castle-panel-type-toggle{align-items:center;gap:var(--castle-space-base);min-width:0;max-width:100%;height:var(--castle-button-height);padding:0 var(--castle-space-base);border-radius:var(--castle-radius-small);color:var(--castle-text-primary);font-family:var(--castle-font-display);font-size:var(--castle-text-size-base);white-space:nowrap;cursor:pointer;background:0 0;border:0;align-self:center;font-weight:700;display:inline-flex}.castle-panel-type-toggle:hover,.castle-panel-type-toggle.is-hover,.castle-panel-type-toggle[aria-pressed=true]{background:var(--castle-surface-5)}.castle-panel-type-toggle svg,.castle-panel-type-toggle iconify-icon{width:var(--castle-button-icon-size);height:var(--castle-button-icon-size);font-size:var(--castle-button-icon-size);flex-shrink:0}.castle-panel-tabs{align-items:center;gap:var(--castle-space-base);flex:auto;min-width:0;display:flex}.castle-panel-tab{max-width:160px;height:var(--castle-button-height);padding:var(--castle-space-small) var(--castle-space-base);border-radius:var(--castle-radius-small);color:var(--castle-text-dim);font-family:var(--castle-font-body);font-size:var(--castle-text-size-base);white-space:nowrap;cursor:pointer;background:0 0;border:0;align-items:center;line-height:18px;display:flex;position:relative;overflow:hidden}.castle-panel-tab>span{text-overflow:ellipsis;min-width:0;overflow:hidden}.castle-panel-tab:hover,.castle-panel-tab.is-hover{background:var(--castle-surface-5);color:var(--castle-text-secondary)}.castle-panel-tab.is-active{background:var(--castle-surface-5);color:var(--castle-text-primary)}.castle-panel-tab:hover>span,.castle-panel-tab.is-hover>span{-webkit-mask-image:linear-gradient(to right, #000 calc(100% - (var(--castle-button-icon-size) + var(--castle-space-large))), transparent 100%);mask-image:linear-gradient(to right, #000 calc(100% - (var(--castle-button-icon-size) + var(--castle-space-large))), transparent 100%)}.castle-panel-tab.is-pinned{flex:none;max-width:none}.castle-panel-tab.is-pinned>span{text-overflow:clip;min-width:max-content;overflow:visible}.castle-panel-tab.is-pinned:hover>span,.castle-panel-tab.is-pinned.is-hover>span,.castle-panel-tab.is-narrow:not(.is-active):hover>span,.castle-panel-tab.is-narrow:not(.is-active).is-hover>span{-webkit-mask-image:none;mask-image:none}.castle-panel-tab-close{z-index:1;top:var(--castle-space-small);right:var(--castle-space-small);width:calc(var(--castle-button-icon-size) + var(--castle-space-large));height:var(--castle-button-icon-size);border-radius:var(--castle-radius-small);background:linear-gradient(to right, transparent, var(--castle-surface-3) 45%);color:currentColor;cursor:pointer;opacity:0;pointer-events:none;border:0;justify-content:flex-end;align-items:center;padding:0;display:inline-flex;position:absolute}.castle-panel-tab-close svg,.castle-panel-tab-close iconify-icon{width:var(--castle-button-icon-size);height:var(--castle-button-icon-size);font-size:var(--castle-button-icon-size)}.castle-panel-tab:hover .castle-panel-tab-close,.castle-panel-tab.is-hover .castle-panel-tab-close,.castle-panel-tab:focus-within .castle-panel-tab-close{opacity:1;pointer-events:auto;background:linear-gradient(to right, transparent, var(--castle-surface-5) 45%)}.castle-panel-tab.is-active .castle-panel-tab-close{background:linear-gradient(to right, transparent, var(--castle-surface-5) 45%)}.castle-panel-tab-close:hover,.castle-panel-tab-close.is-hover{background:linear-gradient(to right, transparent, var(--castle-surface-5) 45%);color:var(--castle-text-primary)}.castle-panel-tab.is-narrow:not(.is-active):hover .castle-panel-tab-close,.castle-panel-tab.is-narrow:not(.is-active).is-hover .castle-panel-tab-close{opacity:0;pointer-events:none}.castle-panel-tab.is-drag-origin{opacity:0;pointer-events:none;border:0;width:0;min-width:0;max-width:0;padding:0}.castle-panel-tab-insert{width:2px;height:var(--castle-button-height);border-radius:var(--castle-radius-pill);background:var(--castle-border-4);pointer-events:none;flex:0 0 2px}.castle-panel-tab-ghost{padding:var(--castle-space-base) var(--castle-space-large);border:1px solid var(--castle-border-1);border-radius:var(--castle-radius-small);background:var(--castle-surface-3);color:var(--castle-text-primary);font-size:var(--castle-text-size-base);pointer-events:none;box-shadow:0 8px 24px #00000073}.castle-panel-mobile-current{justify-content:center;align-self:center;align-items:center;gap:var(--castle-space-base);min-width:0;max-width:100%;height:var(--castle-button-height-large);padding:0 var(--castle-space-base);border-radius:var(--castle-radius-small);color:var(--castle-text-primary);font-family:var(--castle-font-body);font-size:var(--castle-text-size-base);cursor:pointer;background:0 0;border:0;display:inline-flex}.castle-panel-mobile-current:hover,.castle-panel-mobile-current.is-hover{background:var(--castle-surface-5)}.castle-panel-mobile-current-text{align-items:baseline;gap:var(--castle-space-small);min-width:0;display:flex}.castle-panel-mobile-current-label{text-overflow:ellipsis;white-space:nowrap;min-width:0;overflow:hidden}.castle-panel-mobile-current strong,.castle-panel-mobile-current-type{font-family:var(--castle-font-display);flex-shrink:0;font-weight:700}.castle-panel-mobile-current svg,.castle-panel-mobile-current iconify-icon{width:var(--castle-button-icon-size-large);height:var(--castle-button-icon-size-large);font-size:var(--castle-button-icon-size-large);flex:none}.castle-segmented{border-radius:var(--castle-radius-small);flex-wrap:wrap;align-items:stretch;display:flex;overflow:hidden}.castle-segmented>.castle-button{border-radius:0}.castle-feedback-banner.is-inset{border-radius:var(--castle-radius-small);border-bottom:none}.castle-feedback-banner.is-inset .castle-button{flex:none;width:auto}.castle-popover{width:max-content;max-width:calc(100vw - 24px);max-height:calc(100vh - 16px);padding:var(--castle-space-large);border:1px solid var(--castle-border-3);border-radius:var(--castle-radius-base);background:var(--castle-surface-4);color:var(--castle-text-primary);font-family:var(--castle-font-body);font-size:var(--castle-text-size-base);flex-direction:column;display:flex;overflow:auto;box-shadow:0 8px 24px #0000008c}.castle-popover .castle-button:not(.castle-button-quiet){background:var(--castle-surface-5)}.castle-popover .castle-button:not(.castle-button-quiet):hover,.castle-popover .castle-button:not(.castle-button-quiet).is-hover{background:var(--castle-surface-6)}.castle-popover .castle-button:not(.castle-button-quiet):active,.castle-popover .castle-button:not(.castle-button-quiet).is-pressed{background:var(--castle-surface-4)}.castle-popover .castle-button[aria-pressed=true],.castle-popover .castle-button[aria-pressed=true]:hover,.castle-popover .castle-button[aria-pressed=true]:active{background:var(--castle-surface-light);color:var(--castle-text-dark)}.castle-popover .castle-feedback-warn .castle-button:not(.castle-button-quiet),.castle-popover .castle-feedback-danger .castle-button:not(.castle-button-quiet){border:1px solid var(--castle-feedback-border);background:var(--castle-feedback-surface);color:var(--castle-text-primary)}.castle-popover .castle-feedback-warn .castle-button:not(.castle-button-quiet):hover,.castle-popover .castle-feedback-warn .castle-button:not(.castle-button-quiet).is-hover,.castle-popover .castle-feedback-danger .castle-button:not(.castle-button-quiet):hover,.castle-popover .castle-feedback-danger .castle-button:not(.castle-button-quiet).is-hover{background:var(--castle-feedback-surface-hover)}.castle-popover .castle-feedback-warn .castle-button:not(.castle-button-quiet):active,.castle-popover .castle-feedback-warn .castle-button:not(.castle-button-quiet).is-pressed,.castle-popover .castle-feedback-danger .castle-button:not(.castle-button-quiet):active,.castle-popover .castle-feedback-danger .castle-button:not(.castle-button-quiet).is-pressed{background:var(--castle-feedback-surface)}:root{--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark;--panel-gutter:10px;--panel-chrome-radius:8px}*{box-sizing:border-box}html,body,#root{height:100%;margin:0}body{color:var(--castle-text-primary);background:var(--castle-surface-2);font-family:baltomobile,Balto,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif;overflow:hidden}.panel-error{height:100%;color:var(--castle-text-muted);flex-direction:column;align-items:flex-start;gap:8px;padding:14px 16px;font-size:13px;display:flex;overflow:auto}.panel-error-title{color:var(--castle-text-primary)}.panel-error-msg{white-space:pre-wrap;word-break:break-word;max-width:100%;color:var(--castle-text-muted);margin:0;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px}.panel-error-retry{font:inherit;border:1px solid var(--castle-border-1);background:var(--castle-surface-3);color:var(--castle-text-primary);cursor:pointer;border-radius:4px;padding:3px 10px;font-size:12px}.panel-error-retry:hover{background:#1d1d1d}.editor-panel-root{flex-direction:column;width:100%;height:100%;min-height:0;display:flex}.editor-shell{flex:auto;min-height:0;display:flex}.editor-panel-body{flex-direction:column;flex:auto;min-width:0;min-height:0;display:flex}.editor-panel-view{flex:auto;min-width:0;min-height:0;position:relative}.editor-import-banner{background:var(--flow-surface,#181818);border-bottom:1px solid var(--castle-border-1);color:var(--castle-text-muted);flex:none;align-items:center;gap:8px;padding:8px;font:12px ui-sans-serif,system-ui,sans-serif;display:flex}.editor-import-chip{border:1px solid var(--castle-border-1);background:var(--castle-surface-3);color:var(--castle-text-muted);letter-spacing:.02em;border-radius:999px;flex:none;align-items:center;padding:2px 8px;font-size:12px;line-height:1.4;display:inline-flex}.editor-import-banner-text{text-overflow:ellipsis;white-space:nowrap;min-width:0;overflow:hidden}.editor-import-banner-action{border:1px solid var(--castle-border-1);background:var(--castle-surface-3);color:var(--castle-text-primary);font:inherit;cursor:pointer;border-radius:4px;flex:none;margin-left:auto;padding:2px 10px}.editor-import-banner-action:hover{border-color:var(--castle-text-muted)}.editor-import-chip.editor-fork-chip{color:var(--castle-text-primary)}.editor-fork-modal-scrim{z-index:40;background:#00000080;justify-content:center;align-items:center;display:flex;position:fixed;inset:0}.editor-fork-modal{border:1px solid var(--castle-border-1);background:var(--flow-surface,#181818);max-width:420px;color:var(--castle-text-primary);border-radius:6px;padding:16px;font:13px ui-sans-serif,system-ui,sans-serif}.editor-fork-modal-title{margin-bottom:8px;font-weight:600}.editor-fork-modal-body{color:var(--castle-text-muted);line-height:1.5}.editor-fork-modal-actions{justify-content:flex-end;gap:8px;margin-top:16px;display:flex}.editor-fork-modal-actions button{border:1px solid var(--castle-border-1);background:var(--castle-surface-3);color:var(--castle-text-primary);font:inherit;cursor:pointer;border-radius:4px;padding:4px 12px}.editor-fork-modal-actions button:hover{border-color:var(--castle-text-muted)}.editor-contextbar{background:var(--castle-surface-1);border-bottom:1px solid var(--castle-border-1);flex:none;align-items:center;gap:8px;padding:5px 8px;display:flex}.editor-drawer-toggle{width:26px;height:24px;color:var(--castle-text-muted);cursor:pointer;background:0 0;border:1px solid #0000;border-radius:6px;flex:none;justify-content:center;align-items:center;display:inline-flex}.editor-drawer-toggle:hover{color:var(--castle-text-primary);background:var(--castle-surface-2)}.editor-drawer-toggle.on{color:var(--castle-text-primary);background:var(--castle-surface-2);border-color:var(--castle-border-1)}.editor-drawer{background:var(--castle-surface-1);border-right:1px solid var(--castle-border-1);flex:none;width:190px;padding:6px 4px;overflow-y:auto}.editor-drawer-folder{letter-spacing:.03em;text-transform:uppercase;color:var(--castle-text-muted);padding:6px 8px 2px;font:10px ui-sans-serif,system-ui,sans-serif}.editor-drawer-item{width:100%;color:var(--castle-text-secondary);cursor:pointer;text-align:left;text-overflow:ellipsis;white-space:nowrap;background:0 0;border:none;border-radius:6px;padding:5px 8px;font:12px ui-sans-serif,system-ui,sans-serif;display:block;overflow:hidden}.editor-drawer-item:hover{background:var(--castle-surface-2);color:var(--castle-text-primary)}.editor-drawer-item.current{color:var(--castle-text-primary);background:#ffffff1a}.editor-drawer-empty{color:var(--castle-text-muted);padding:10px 8px;font-size:12px}.editor-view-picker{background:var(--castle-surface-2);color:var(--castle-text-primary);border:1px solid var(--castle-border-1);cursor:pointer;border-radius:6px;flex:none;padding:3px 6px;font:12px system-ui,sans-serif}.editor-contextbar-path{text-overflow:ellipsis;white-space:nowrap;color:var(--castle-text-muted);flex:auto;font:11px ui-monospace,SFMono-Regular,Menlo,monospace;overflow:hidden}.editor-contextbar-reload{width:22px;height:22px;color:var(--castle-text-muted);cursor:pointer;background:0 0;border:none;border-radius:5px;flex:none;justify-content:center;align-items:center;padding:0;display:inline-flex}.editor-contextbar-reload:hover{color:#fff;background:#ffffff14}.editor-contextbar-reload svg{width:13px;height:13px}.deck-panel{background:var(--castle-surface-2);width:100%;height:100%}.deck-frame{border:0;width:100%;height:100%;display:block}.play-panel{background:var(--castle-surface-2);flex-direction:column;width:100%;height:100%;display:flex}.play-scene-picker{justify-content:center;align-items:center;gap:var(--castle-space-base);padding:0 var(--castle-space-large) var(--castle-space-large);flex-wrap:wrap;flex:none;display:flex}.play-stage{min-height:0;padding:var(--castle-space-large);flex:auto;justify-content:center;align-items:center;display:flex;container-type:size}.play-stage:has(+.play-scene-picker){padding-bottom:var(--castle-space-base)}.play-frame-shell{aspect-ratio:5/7;border-radius:4%/2.85714%;width:min(100cqw,71.4286cqh);height:min(100cqh,140cqw);position:relative;overflow:hidden}.play-frame-shell.is-fill{aspect-ratio:auto;border-radius:var(--castle-radius-base)}.play-frame-size{color:var(--castle-text-secondary);font-size:var(--castle-text-size-small);font-variant-numeric:tabular-nums}.play-frame-shell .deck-frame{width:100%;height:100%}.play-panel.is-native-cover-capture .play-cover-anchor,.play-panel.is-native-cover-capture .play-leaderboard-overlay{visibility:hidden!important}.play-panel.is-native-cover-capture .play-frame-shell{border-radius:0}.play-cover-anchor{z-index:3;flex:0 0 0;height:0;position:relative}.play-cover-popover{right:var(--castle-space-base);bottom:var(--castle-space-base);width:min(260px, calc(100% - 2 * var(--castle-space-base)));gap:var(--castle-space-base);position:absolute}.play-cover-preview{object-fit:contain;width:100%;height:auto;max-height:min(40vh,320px);display:block}.play-cover-notice{align-items:center;gap:var(--castle-space-small);display:flex}.play-cover-actions{gap:var(--castle-space-small);flex-wrap:wrap;display:flex}.play-logs{border-top:1px solid var(--castle-border-1);background:var(--castle-surface-2);color:var(--castle-text-secondary);flex:none;position:relative}.play-logs.is-open{--play-logs-height:160px;flex:0 0 var(--play-logs-height);height:var(--play-logs-height);flex-direction:column;min-height:0;display:flex;overflow:hidden}.play-logs-resize{z-index:2;cursor:row-resize;touch-action:none;height:12px;display:none;position:absolute;top:-6px;left:0;right:0}.play-logs.is-open>.play-logs-resize{display:block}body.play-logs-resizing,body.play-logs-resizing *{cursor:row-resize!important;-webkit-user-select:none!important;user-select:none!important}.play-logs-header{min-height:calc(var(--castle-button-height) + 2 * var(--castle-space-base));padding:var(--castle-space-base);align-items:center;column-gap:var(--castle-space-base);cursor:pointer;flex:none;grid-template-columns:minmax(0,1fr) minmax(0,max-content) max-content;display:grid;position:relative}.play-logs-header.has-snap,.play-logs-header.has-cover{grid-template-columns:minmax(0,1fr) minmax(0,max-content) max-content max-content}.play-logs-header.has-snap.has-cover{grid-template-columns:minmax(0,1fr) minmax(0,max-content) max-content max-content max-content}.play-logs-header:hover{background:var(--castle-surface-3)}.play-logs-expand{z-index:0;cursor:pointer;background:0 0;border:0;padding:0;position:absolute;inset:0}.play-logs-expand:focus{outline:none}.play-logs-expand:focus-visible{outline:2px solid var(--castle-border-2);outline-offset:-2px}.play-logs-label{align-items:center;gap:var(--castle-space-base);min-width:0;color:var(--castle-text-dim);pointer-events:none;justify-self:start;display:inline-flex}.play-logs-header:hover .play-logs-label{color:var(--castle-text-primary)}.play-logs-label svg{flex:0 0 var(--castle-button-icon-size);width:var(--castle-button-icon-size);height:var(--castle-button-icon-size);font-size:var(--castle-button-icon-size)}.play-logs-pending{min-width:0;color:var(--castle-text-muted);font-size:var(--castle-text-size-small);text-overflow:ellipsis;white-space:nowrap;pointer-events:none;grid-column:2;margin:0;line-height:1.4;overflow:hidden}.play-logs-pending.is-error{white-space:normal;color:var(--castle-warn-text);grid-area:2/1/auto/-1}.play-logs-pending.is-note{white-space:normal;grid-area:3/1/auto/-1}.play-logs-pending.is-silent,.play-cover-notice.is-silent,#chat-host .composer-attach-note.is-silent{height:0;margin:0;padding:0;overflow:hidden}.play-logs-snap{z-index:1;grid-column:3;justify-self:end;min-width:max-content;position:relative}.play-logs-cover{z-index:1;grid-column:-3;justify-self:end;min-width:max-content;position:relative}.play-logs-restart{z-index:1;grid-column:-2;justify-self:end;min-width:max-content;position:relative}.play-logs-restart.is-pending,.play-logs-restart.is-pending:hover,.play-logs-restart.is-pending:active{color:var(--castle-warn-text)}.play-logs-restart-icon{line-height:1;display:inline-flex}.play-logs-restart-icon.is-spinning{animation:.6s linear infinite play-logs-spin}@keyframes play-logs-spin{to{transform:rotate(360deg)}}.play-logs-toolbar{align-items:center;gap:var(--castle-space-base);padding:var(--castle-space-base);border-top:1px solid var(--castle-border-1);flex-wrap:wrap;flex:none;display:flex}.play-logs-body{min-height:0;padding:var(--castle-space-base) var(--castle-space-large);border-top:1px solid var(--castle-border-1);font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:var(--castle-text-size-small);flex:auto;line-height:1.5;overflow-y:auto}.play-logs-line{white-space:pre-wrap;word-break:break-word}.play-logs-warn{color:var(--castle-warn-text)}.play-logs-error{color:var(--castle-danger-text)}.play-logs-empty{color:var(--castle-text-dim)}.flow-root.is-mobile .play-panel,.markup-sheet.is-mobile{--castle-text-size-small:14px;--castle-text-size-base:16px;--castle-text-style-smallcaps-size:var(--castle-text-size-small);--castle-button-height:var(--castle-button-height-large)}.flow-root.is-mobile .play-panel .castle-button:not(.castle-button-icon),.markup-sheet.is-mobile .castle-button:not(.castle-button-icon){padding-left:var(--castle-space-large);padding-right:var(--castle-space-large)}.flow-root.is-mobile .play-logs.is-open{--play-logs-height:200px}.flow-root.is-mobile .play-logs-header:hover{background:0 0}.flow-root.is-mobile .play-logs-header:hover .play-logs-label{color:var(--castle-text-dim)}.flow-root.is-mobile .play-stage{padding:var(--castle-space-small)}.term-panel{width:100%;height:100%;position:relative}.term-host{overscroll-behavior:contain;padding:6px;position:absolute;inset:0}.shell-root{--operator-pad:var(--castle-space-large);--operator-col-fit:min(var(--operator-col,400px), 100%);background:var(--castle-surface-2);height:100%;position:relative}#chat-host{width:var(--operator-col-fit);background:var(--castle-surface-2);color:var(--castle-text-primary);font-family:var(--castle-font-body);z-index:10;flex-direction:column;display:flex;position:absolute;top:0;bottom:0;left:0;overflow:hidden}.settings-popover{z-index:2147483000;width:390px;position:fixed}.settings-popover .settings-row{flex-wrap:wrap;justify-content:space-between;align-items:center;gap:6px 10px;display:flex}.settings-popover .settings-row+.settings-row{margin-top:8px}.settings-popover .settings-label{white-space:nowrap;flex:none}.settings-popover .settings-row-stack{flex-direction:column;align-items:stretch;gap:4px;display:flex}.settings-popover .settings-row-main{flex-wrap:wrap;justify-content:space-between;align-items:center;gap:6px 10px;display:flex}.settings-popover .settings-model-pickers{grid-template-columns:max-content minmax(0,1fr);column-gap:10px;display:grid}.settings-popover .settings-model-pickers>.settings-group{grid-template-columns:subgrid;column-gap:inherit;grid-column:1/-1;display:grid}.settings-popover .settings-model-picker{grid-template-columns:subgrid;column-gap:inherit;grid-column:1/-1;justify-content:normal;align-items:center;row-gap:8px;display:grid}.settings-popover .settings-model-picker>.settings-row-main{display:contents}.settings-popover .settings-model-picker .settings-model-family{grid-column:2;width:100%}.settings-popover .settings-model-picker .settings-label{grid-column:1}.settings-popover .settings-model-picker>.settings-warning{grid-column:1/-1}.settings-popover .settings-free-chip{border-radius:var(--castle-radius-small);background:var(--castle-surface-1);height:14px;color:var(--castle-text-primary);letter-spacing:.06em;text-transform:uppercase;flex:none;padding:0 4px;font-size:9px;font-weight:500;line-height:14px;overflow:visible}.settings-popover .settings-model-picker .settings-model-detail>.castle-segmented{grid-column:2;width:100%}.settings-popover .settings-model-picker .castle-segmented>.castle-button{flex:1 1 0}.settings-popover .settings-model-picker .settings-model-detail>.castle-text-field{grid-column:2;width:100%;min-width:0;max-width:none}.settings-popover .settings-text-warn{border-color:var(--castle-warn-text)}.settings-popover .settings-warning{color:var(--castle-warn-text);text-align:right;font-size:11px;line-height:1.35}.settings-popover .settings-warning-suggest{appearance:none;font:inherit;color:var(--castle-warn-text);cursor:pointer;background:0 0;border:none;margin:0;padding:0;text-decoration:underline}.settings-popover .settings-warning-suggest:hover{color:var(--castle-text-primary)}.settings-popover .settings-group+.settings-group,.settings-popover .settings-group+.settings-model-pickers{border-top:1px solid var(--castle-border-1);margin-top:12px;padding-top:12px}.settings-popover .settings-credits{margin-top:var(--castle-space-base);color:var(--castle-text-secondary);font-size:var(--castle-text-size-base)}.settings-popover .settings-usage-subtext{margin-top:var(--castle-space-small);color:var(--castle-text-muted);font-size:var(--castle-text-size-small)}.settings-popover .settings-usage-subtext.castle-feedback-note{color:var(--castle-feedback-text)}.settings-popover .settings-split{justify-content:space-between;align-items:center;gap:var(--castle-space-large);margin-top:var(--castle-space-base);display:flex}.settings-popover .settings-group>.settings-split:first-child{margin-top:0}.settings-popover .settings-split-copy,.settings-popover .settings-split>.settings-credits{flex:auto;min-width:0}.settings-popover .settings-split .settings-credits{margin-top:0}.settings-popover .settings-split .castle-button{flex:none;width:auto;margin-left:auto}.settings-popover .settings-group>.castle-feedback-banner.is-inset{margin-top:var(--castle-space-base)}.settings-popover .castle-text-field{flex:auto}.settings-popover .settings-usage-bar{height:4px;margin-top:var(--castle-space-base);background:var(--castle-surface-5);border-radius:2px;overflow:hidden}.settings-popover .settings-usage-fill{background:var(--castle-accent);height:100%}.settings-popover .settings-usage-fill.blocked{background:var(--castle-danger-text)}.castle-key-heading{margin-bottom:4px;font-weight:600}.castle-key-subtitle{color:#9a9a9a;margin-bottom:14px;font-size:12px;line-height:1.5}.castle-key-tabs{border:1px solid #3a3a3a;border-radius:4px;margin-bottom:12px;display:flex;overflow:hidden}.castle-key-tab{color:#9a9a9a;font:inherit;cursor:pointer;background:#2e2e2e;border:0;flex:1;padding:6px 10px;font-size:12px}.castle-key-tab+.castle-key-tab{border-left:1px solid #3a3a3a}.castle-key-tab:hover{color:#e8e8e8}.castle-key-tab.active{color:#e8e8e8;background:#3a3a3a}.castle-key-input{box-sizing:border-box;color:#e8e8e8;width:100%;font:inherit;background:#1b1b1b;border:1px solid #3a3a3a;border-radius:4px;outline:none;padding:7px 9px;font-size:12px;display:block}.castle-key-input:focus{border-color:#4a4a4a}.castle-key-input::placeholder{color:#6a6a6a}.castle-key-stored{color:#8a8a8a;margin-top:8px;font-size:11px}.castle-key-error{color:#e8705a;margin-top:8px;font-size:11px;line-height:1.4}.castle-key-row{color:#c8c8c8;justify-content:space-between;align-items:center;gap:10px;margin-bottom:12px;display:flex}.castle-key-row button{color:#e8e8e8;font:inherit;cursor:pointer;background:#2e2e2e;border:1px solid #3a3a3a;border-radius:4px;padding:5px 12px;font-size:12px}.castle-key-row button:hover{background:#383838}.castle-key-login{margin-bottom:12px}.castle-key-signin{color:#e8e8e8;width:100%;font:inherit;cursor:pointer;background:#2e2e2e;border:1px solid #3a3a3a;border-radius:4px;padding:9px 12px;font-size:13px;display:block}.castle-key-signin:hover{background:#383838}.castle-key-or{color:#7a7a7a;letter-spacing:.08em;text-transform:uppercase;align-items:center;gap:10px;margin:14px 0;font-size:11px;display:flex}.castle-key-or:before,.castle-key-or:after{content:"";background:#3a3a3a;flex:1;height:1px}.castle-key-field-label{color:#c8c8c8;margin-bottom:6px;font-size:12px}.castle-key-url{color:#7aa2f7;word-break:break-all;-webkit-user-select:all;user-select:all;background:#1b1b1b;border:1px solid #3a3a3a;border-radius:4px;padding:8px 9px;font-size:11px;line-height:1.4;display:block}#chat-messages{overflow-anchor:none;min-height:0;font-size:var(--castle-text-size-base);scrollbar-width:none;-ms-overflow-style:none;flex-direction:column;flex:1 1 0;padding:0;line-height:1.5;display:flex;overflow-y:auto}#chat-messages .chat-thread{gap:var(--castle-space-large);padding-bottom:var(--castle-space-large);opacity:0;flex-direction:column;transition:opacity .12s;display:flex}#chat-messages .chat-thread.ready{opacity:1}.shell-root.docked #chat-messages{padding:0}.shell-root.docked #chat-messages>:first-child{margin-top:auto}#chat-messages::-webkit-scrollbar{width:0;height:0}#chat-empty{color:var(--castle-text-muted)}#chat-host .msg{margin:0}#chat-host .msg.user{text-align:right}#chat-host .msg.user span:not(.msg-image){background:var(--castle-surface-light);color:var(--castle-text-dark);padding:var(--castle-space-base) var(--castle-space-large);border-radius:var(--castle-radius-large);text-align:left;white-space:pre-wrap;word-break:break-word;max-width:85%;display:inline-block}#chat-host .msg-image{border:1px solid var(--castle-border-1);border-radius:var(--castle-radius-base);max-width:220px;max-height:150px;margin:0 0 var(--castle-space-base) auto;display:block}#chat-host .assistant-turn{align-items:flex-start;gap:var(--castle-space-base);flex-direction:column;margin:0;display:flex}#chat-host .assistant-turn .castle-feedback-note{max-width:85%}#chat-host .msg.assistant{background:var(--castle-accent);width:fit-content;color:var(--castle-surface-light);padding:var(--castle-space-base) var(--castle-space-large);border-radius:var(--castle-radius-large);word-break:break-word;max-width:85%;margin:0}#chat-host .msg.assistant.errbubble{background:var(--castle-danger-surface);color:var(--castle-danger-text)}#chat-host .msg.assistant.streaming:after{content:"▌";opacity:.6;animation:1s step-end infinite chat-blink}@keyframes chat-blink{50%{opacity:0}}#chat-host .msg.toolline{color:var(--castle-text-muted);font-size:var(--castle-text-size-base);font-family:var(--castle-font-mono);word-break:break-word}#chat-host .msg-error-detail{font-size:var(--castle-text-size-base);color:var(--castle-text-muted)}#chat-host .msg-error-detail-body{padding:0 var(--castle-space-large) 0 calc(var(--castle-icon-size-inline) + var(--castle-space-base))}#chat-host .msg-error-detail-hint{margin:0 0 var(--castle-space-small);color:var(--castle-text-dim)}#chat-host .msg-error-detail pre{border-radius:var(--castle-radius-small);background:var(--castle-surface-1);max-height:160px;font-size:var(--castle-text-size-small);white-space:pre-wrap;word-break:break-word;margin:0;padding:0;overflow-y:auto}#chat-host .operator-line,#chat-host .msg-thinking{color:var(--castle-text-muted);font-size:var(--castle-text-size-base)}#chat-host .operator-line{align-items:center;gap:var(--castle-space-base);display:flex}#chat-host .operator-line .castle-icon-inline{flex:0 0 var(--castle-icon-size-inline)}#chat-host .operator-line .castle-icon-inline:not(:first-child){color:var(--castle-text-dim)}#chat-host .operator-line-link{color:inherit;font:inherit;text-underline-offset:2px;cursor:pointer;background:0 0;border:0;padding:0;text-decoration:underline}#chat-host .operator-line-link:hover{color:var(--castle-text-primary)}#chat-host .msg-thinking summary,#chat-host .msg-error-detail summary{cursor:pointer;-webkit-user-select:none;user-select:none;list-style:none}#chat-host .msg-thinking summary::-webkit-details-marker{display:none}#chat-host .msg-error-detail summary::-webkit-details-marker{display:none}#chat-host .msg-thinking .thinking-caret,#chat-host .msg-error-detail .thinking-caret{transform-origin:50%;transition:transform .12s}#chat-host .msg-thinking[open] .thinking-caret,#chat-host .msg-error-detail[open] .thinking-caret{transform:rotate(90deg)}#chat-host .msg-thinking.is-active .thinking-label{background-image:linear-gradient(90deg, var(--castle-text-muted) 20%, var(--castle-text-primary) 50%, var(--castle-text-muted) 80%);color:#0000;-webkit-text-fill-color:transparent;background-size:200% 100%;-webkit-background-clip:text;background-clip:text;animation:1.6s linear infinite thinking-shimmer;display:inline-block}@keyframes thinking-shimmer{0%{background-position:100% 0}to{background-position:-100% 0}}@media (prefers-reduced-motion:reduce){#chat-host .msg-thinking.is-active .thinking-label{color:var(--castle-text-muted);-webkit-text-fill-color:currentColor;background:0 0;animation:none}}#chat-host .msg-thinking-body{max-height:160px;padding:0 var(--castle-space-large) 0 calc(var(--castle-icon-size-inline) + var(--castle-space-base));border-radius:var(--castle-radius-small);background:var(--castle-surface-1);color:var(--castle-text-muted);font-size:var(--castle-text-size-base);overflow-y:auto}#chat-host .msg.md>:first-child,#chat-host .task-notes>:first-child{margin-top:0}#chat-host .msg.md>:last-child,#chat-host .task-notes>:last-child{margin-bottom:0}#chat-host .msg.md p:empty{display:none}#chat-host .msg.md p,#chat-host .task-notes p,#chat-host .task-account p{margin:.4em 0}#chat-host .msg.md ul,#chat-host .msg.md ol,#chat-host .task-notes ul,#chat-host .task-notes ol,#chat-host .task-account ul,#chat-host .task-account ol{margin:.4em 0;padding-left:1.3em}#chat-host .task-notes li,#chat-host .task-account li,#chat-host .msg.md li{margin:.1em 0}#chat-host .msg.md h1,#chat-host .msg.md h2,#chat-host .msg.md h3{margin:.5em 0 .3em;font-weight:700;line-height:1.25}#chat-host .msg.md h1{font-size:1.2em}#chat-host .msg.md h2{font-size:1.12em}#chat-host .msg.md h3{font-size:1.05em}#chat-host .msg.md a:not(.msg-link),#chat-host .msg-thinking-body a:not(.msg-link),#chat-host .task-notes a:not(.msg-link),#chat-host .task-account a:not(.msg-link),#chat-host .task-feed-msg a:not(.msg-link){color:var(--castle-surface-light);text-underline-offset:2px;text-decoration:underline}#chat-host .msg-link{border-radius:var(--castle-radius-small);color:inherit;font-family:var(--castle-font-mono);-webkit-text-decoration-color:color-mix(in srgb, currentColor 40%, transparent);text-decoration-color:color-mix(in srgb, currentColor 40%, transparent);text-underline-offset:2px;margin:0 -.35em;padding:.1em .35em}#chat-host .msg-link:hover{background:var(--castle-surface-4);color:var(--castle-text-primary);text-decoration-color:currentColor}#chat-host .msg.assistant .msg-link:hover{background:color-mix(in srgb, var(--castle-accent) 84%, #fff)}#chat-host .msg.md code{font-family:var(--castle-font-mono);font-size:var(--castle-text-size-small);background:color-mix(in srgb, var(--castle-accent) 78%, #000);border-radius:var(--castle-radius-small);padding:.1em .35em}#chat-host .msg.md pre{margin:var(--castle-space-base) 0;padding:var(--castle-space-base) var(--castle-space-large);background:color-mix(in srgb, var(--castle-accent) 72%, #000);border-radius:var(--castle-radius-small);white-space:pre-wrap;word-break:break-word;font-family:var(--castle-font-mono);font-size:var(--castle-text-size-small);line-height:1.4;overflow-x:auto}#chat-host .msg.md pre code{background:0 0;border-radius:0;padding:0}#chat-host .msg.md blockquote{margin:var(--castle-space-base) 0;padding-left:var(--castle-space-large);border-left:3px solid color-mix(in srgb, var(--castle-accent) 60%, #fff)}.shell-root.docked #chat-host .operator-inset{min-height:0;padding:0 var(--operator-pad);flex-direction:column;flex:1 1 0;display:flex;overflow:hidden}.shell-root.docked #chat-host .chat-divider{margin:0 calc(-1 * var(--operator-pad));background:var(--castle-border-1);flex:0 0 1px}.task-stack{gap:var(--castle-space-small);flex-direction:column;display:flex}#task-board{min-height:0;margin-inline:calc(-1 * var(--castle-space-base));padding-top:0;padding-bottom:var(--castle-space-base);scrollbar-width:thin;scrollbar-color:transparent transparent;flex-direction:column;flex:0 auto;max-height:40vh;display:flex;overflow:hidden auto}#task-board.scrolling{scrollbar-color:var(--castle-text-dim) transparent}#task-board::-webkit-scrollbar{width:6px}#task-board::-webkit-scrollbar-track{background:0 0}#task-board::-webkit-scrollbar-thumb{background:0 0;border-radius:3px;transition:background .25s}#task-board.scrolling::-webkit-scrollbar-thumb{background:var(--castle-text-dim)}#chat-host .task{border-radius:var(--castle-radius-small);cursor:pointer;transition:background .12s,box-shadow .12s}#chat-host .task.open{background:var(--castle-surface-3);box-shadow:inset 0 0 0 1px var(--castle-border-1)}#chat-host .task:hover{background:var(--castle-surface-3)}#chat-host .task-row{align-items:center;gap:var(--castle-space-large);padding:var(--castle-space-small) var(--castle-space-base);display:flex;position:relative}#chat-host .pie{background:conic-gradient(var(--castle-surface-light) calc(var(--pct,0) * 3.6deg), var(--castle-surface-5) 0deg);border-radius:50%;flex:0 0 32px;width:32px;height:32px;padding:2px;display:flex;position:relative}#chat-host .pie .avatar{background:var(--castle-surface-3);width:100%;height:100%;color:var(--castle-text-dark);border-radius:50%;justify-content:center;align-items:center;display:flex;overflow:hidden}#chat-host .pie .avatar .avatar-icon-wrap{justify-content:center;align-items:center;width:16px;height:16px;font-size:16px;display:flex}#chat-host .pie .avatar .avatar-icon-wrap svg{width:16px;height:16px;display:block}#chat-host .task-meta{flex:1;min-width:0}#chat-host .task-name{color:var(--castle-text-muted);font-size:var(--castle-text-size-base);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}#chat-host .task-name .tn{color:var(--castle-text-primary);font-weight:600}#chat-host .task-sub{color:var(--castle-text-muted);font-size:var(--castle-text-size-small);text-overflow:ellipsis;white-space:nowrap;font-variant-numeric:tabular-nums;overflow:hidden}#chat-host .task-actions{align-items:center;gap:var(--castle-space-small);visibility:hidden;flex:none;margin-left:auto;display:flex}#chat-host .task:hover .task-actions,#chat-host .task.open .task-actions{visibility:visible}#chat-host .task-board-header{z-index:1;justify-content:space-between;align-items:center;gap:var(--castle-space-base);margin-inline:calc(-1 * var(--castle-space-base));padding:var(--castle-space-base);background:var(--castle-surface-1);display:flex;position:sticky;top:0}#chat-host .task-body{padding:0 var(--castle-space-base) var(--castle-space-base) calc(var(--castle-space-base) + 32px + var(--castle-space-large));font-size:var(--castle-text-size-base);color:var(--castle-text-secondary);display:none}#chat-host .task.open .task-body{display:block}#chat-host .task-notes{margin-top:var(--castle-space-small);font-size:var(--castle-text-size-base);color:var(--castle-text-secondary);word-break:break-word}#chat-host .task-account{margin-top:var(--castle-space-large);padding-top:var(--castle-space-base);border-top:1px solid var(--castle-border-1);font-size:var(--castle-text-size-base);color:var(--castle-text-muted);word-break:break-word}#chat-host .task-account:first-child{border-top:0;margin-top:0;padding-top:0}#chat-host .task-notes p,#chat-host .task-notes li,#chat-host .task-account p,#chat-host .task-account li{line-height:1.15}#chat-host .task-account>div>:first-child{margin-top:0}#chat-host .task-account>div>:last-child{margin-bottom:0}#chat-host .task-body>.castle-feedback-note{margin-top:var(--castle-space-small)}#chat-host .task-notes code,#chat-host .task-account code{border-radius:var(--castle-radius-small);font-family:var(--castle-font-mono);padding:1px 4px;font-size:12px}#chat-host .task-playtest-frames{margin-top:var(--castle-space-base)}#chat-host .task-playtest-frames-label,#chat-host .task-account-label{font-size:var(--castle-text-size-small);color:var(--castle-text-muted);margin:0 0 var(--castle-space-small)}#chat-host .task-playtest-frames-row{gap:var(--castle-space-base);flex-wrap:wrap;display:flex}#chat-host .task-playtest-frame{object-fit:cover;border:1px solid var(--castle-border-1);background:var(--castle-text-dark);border-radius:4px;width:64px;height:90px;display:block}#chat-host .task-feed{margin-top:var(--castle-space-base);scrollbar-width:none;-ms-overflow-style:none;max-height:96px;font-size:var(--castle-text-size-base);color:var(--castle-text-secondary);cursor:default;word-break:break-word;line-height:1.5;overflow:hidden auto;-webkit-mask-image:linear-gradient(#0000,#000 8px 100%);mask-image:linear-gradient(#0000,#000 8px 100%)}#chat-host .task-feed::-webkit-scrollbar{width:0;height:0}#chat-host .task-feed-tool{padding-left:var(--castle-space-large);color:var(--castle-text-muted);font-family:var(--castle-font-mono);white-space:pre-wrap;font-size:12px}#chat-host .task-feed-msg{margin:0}#chat-host .task-feed-msg>:first-child{margin-top:0}#chat-host .task-feed-msg>:last-child{margin-bottom:0}#chat-host .task-feed-msg p{margin:0}#chat-host .task-feed-msg code{font-family:var(--castle-font-mono);font-size:var(--castle-text-size-base)}#chat-host .task-page{min-height:0;margin-inline:calc(-1 * var(--operator-pad));flex-direction:column;flex:1 1 0;display:flex}#chat-host .task-page-header{padding:var(--castle-space-large) var(--operator-pad);border-bottom:1px solid var(--castle-border-1);flex:none}#chat-host .task-page-header .task-row{padding:0}#chat-host .task-page-header .tn{color:var(--castle-text-primary)}#chat-host .task-page-body{min-height:0;padding:var(--castle-space-large) var(--operator-pad);flex:1 1 0;overflow:auto}#chat-host .task-page-body .task-feed{max-height:none;margin-top:0;overflow:visible;-webkit-mask-image:none;mask-image:none}#chat-host .task-page-body:not(.task-board-page) .task-notes{margin-top:var(--castle-space-large);padding-top:var(--castle-space-large);border-top:1px solid var(--castle-border-1)}#chat-host .task-page-body:not(.task-board-page) .task-notes:first-child{border-top:0;margin-top:0;padding-top:0}#chat-host .task-report-label{margin:0 0 var(--castle-space-small);color:var(--castle-text-primary);font-weight:700}#chat-host .task-page-empty{color:var(--castle-text-muted);margin:0}#chat-host .task-board-page{min-height:0;margin-inline:calc(-1 * var(--operator-pad));padding:var(--castle-space-large) var(--operator-pad);flex-direction:column;flex:1 1 0;display:flex;overflow:auto}#chat-host .task-archive{margin-top:var(--castle-space-base);padding-top:var(--castle-space-large);border-top:1px solid var(--castle-border-1)}#chat-host .task-archive:first-child{border-top:0;margin-top:0;padding-top:0}#chat-host .task-archive-heading{margin:0 0 var(--castle-space-large);color:var(--castle-text-muted)}#chat-host .operator-composer{flex-direction:column;flex:0 auto;min-height:0;max-height:50%;display:flex;overflow:auto}.chat-input{padding:0 var(--operator-pad) var(--operator-pad);flex:none;position:relative}#chat-host .chat-input .ta{width:100%;min-height:60px;padding:var(--castle-space-base) var(--castle-space-small);border:1px solid var(--castle-border-1);border-radius:var(--castle-radius-base);background:var(--castle-surface-3);cursor:text;flex-direction:column;display:flex;overflow:hidden}#chat-input{width:100%;min-height:32px;max-height:120px;padding:0 var(--castle-space-base);color:var(--castle-text-primary);font:inherit;font-size:var(--castle-text-size-base);resize:none;scrollbar-width:none;-ms-overflow-style:none;background:0 0;border:none;outline:none;line-height:1.5;display:block;overflow-y:auto}#chat-input::-webkit-scrollbar{width:0;height:0}#chat-input::placeholder{color:var(--castle-text-muted)}#chat-host .chat-input .ta-bottom{justify-content:space-between;align-items:center;gap:var(--castle-space-base);min-width:0;display:flex}#chat-host .composer-settings{align-items:center;gap:var(--castle-space-small);flex:auto;min-width:0;display:flex}#chat-host .composer-settings .castle-button{min-width:0;max-width:100%;font-size:var(--castle-text-size-small)}#chat-host .composer-settings .castle-button:not(.castle-button-icon){justify-content:flex-start}#chat-host .composer-settings .operator-usage-warn,#chat-host .composer-settings .operator-usage-warn:hover,#chat-host .composer-settings .operator-usage-warn[aria-pressed=true]{color:var(--castle-warn-text)}#chat-host .composer-settings .operator-usage-blocked,#chat-host .composer-settings .operator-usage-blocked:hover,#chat-host .composer-settings .operator-usage-blocked[aria-pressed=true]{color:var(--castle-danger-text)}#chat-host .queue-row .castle-button,#chat-host .ta-bottom .castle-button-icon{flex-shrink:0}#chat-host .castle-composer-action{margin-right:var(--castle-space-small)}#chat-host .composer-attach-input{opacity:0;pointer-events:none;width:1px;height:1px;position:absolute}#chat-host .composer-attach-note{padding:0 var(--operator-pad) var(--castle-space-base);color:var(--castle-text-muted);font-size:var(--castle-text-size-small);flex:none;margin:0;line-height:1.4}#chat-pending{gap:var(--castle-space-base);padding:0 var(--operator-pad) var(--castle-space-base);flex-wrap:wrap;flex:none;display:flex}#chat-pending .operator-thumb{object-fit:cover;border:1px solid var(--castle-border-1);border-radius:var(--castle-radius-small);cursor:pointer;width:64px;height:44px;margin:0;display:block}#chat-pending .operator-thumb-decoding{background:var(--castle-border-1);cursor:default}#chat-pending .operator-thumb-slot{flex:none;margin-top:6px;position:relative}#chat-pending .operator-thumb-open{border-radius:var(--castle-radius-small);cursor:pointer;background:0 0;border:0;padding:0;display:block}#chat-pending .operator-thumb-open:focus-visible{outline:1px solid var(--castle-border-2);outline-offset:2px}#chat-pending .operator-thumb-remove{border:1px solid var(--castle-border-2);border-radius:var(--castle-radius-pill);background:var(--castle-surface-4);width:20px;height:20px;color:var(--castle-text-primary);cursor:pointer;justify-content:center;align-items:center;padding:0;font-size:12px;display:flex;position:absolute;top:-6px;right:-6px}#chat-pending .operator-thumb-remove:hover{background:var(--castle-surface-5)}#chat-pending .operator-thumb-remove:before{content:"";position:absolute;inset:-8px}.markup-sheet{z-index:2147483100;flex-direction:column;display:flex;position:fixed;inset:0}.markup-sheet-bar{height:calc(var(--castle-panel-header-height) + env(safe-area-inset-top));padding-top:env(safe-area-inset-top);flex:none}.markup-sheet.is-mobile .markup-sheet-bar{height:calc(var(--castle-panel-header-height-mobile) + env(safe-area-inset-top))}.markup-sheet-tools{justify-content:space-between;align-items:center;gap:var(--castle-space-base);min-height:calc(var(--castle-button-height) + 2 * var(--castle-space-base) + env(safe-area-inset-bottom));padding:var(--castle-space-base);padding-bottom:calc(var(--castle-space-base) + env(safe-area-inset-bottom));flex-wrap:wrap;display:flex}.markup-sheet-stage{flex:auto;min-height:0;position:relative;overflow:hidden}.markup-sheet-canvas{touch-action:none;cursor:crosshair;display:block;position:absolute;inset:0}.markup-sheet-error{left:var(--castle-space-large);right:var(--castle-space-large);bottom:var(--castle-space-large);position:absolute}.markup-pin-popover{align-items:center;gap:var(--castle-space-base);flex-direction:row;position:absolute}.markup-pin-popover.is-docked{top:var(--castle-space-base);left:var(--castle-space-base);right:var(--castle-space-base);width:auto;max-width:none}.markup-pin-number{min-width:var(--castle-button-height);height:var(--castle-button-height);line-height:var(--castle-button-height)}.markup-pin-note{min-width:0;font-size:max(16px, var(--castle-text-size-base));flex:1 1 0}#chat-host .chat-input .chat-queue{gap:var(--castle-space-small);margin-bottom:var(--castle-space-base);flex-direction:column;display:flex}#chat-host .chat-input .queue-row{align-items:center;gap:var(--castle-space-base);padding:var(--castle-space-base) var(--castle-space-base) var(--castle-space-base) var(--castle-space-large);border:1px dashed var(--castle-border-1);border-radius:var(--castle-radius-base);background:var(--castle-surface-1);color:var(--castle-text-muted);font-size:var(--castle-text-size-base);display:flex}#chat-host .chat-input .queue-snippet{text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0;overflow:hidden}#chat-host .picker{gap:var(--castle-space-large);width:100%;padding:var(--castle-space-large);border:1px solid var(--castle-border-1);border-radius:var(--castle-radius-base);background:var(--castle-surface-3);flex-direction:column;align-self:stretch;margin:0;display:flex}#chat-host .picker-q{border:none;min-width:0;margin:0;padding:0;position:relative}#chat-host .picker-q-head{justify-content:space-between;align-items:baseline;gap:var(--castle-space-base);box-sizing:border-box;width:100%;margin:0 0 var(--castle-space-base);float:none;font-weight:inherit;padding:0;display:flex}#chat-host .picker-q-label{min-width:0;color:var(--castle-text-primary);font-size:var(--castle-text-size-base);font-weight:inherit;margin:0;padding:0}#chat-host .picker-skip{color:var(--castle-text-dim);cursor:pointer;white-space:nowrap;background:0 0;border:0;flex:none;margin:0;padding:0}#chat-host .picker:not(.picker-locked) .picker-skip:hover,#chat-host .picker-skip.is-on{color:var(--castle-text-primary)}#chat-host .picker-locked .picker-skip{cursor:default}#chat-host .picker-q.is-skipped .picker-options{opacity:.45}#chat-host .picker-options{gap:var(--castle-space-small);flex-direction:column;display:flex}#chat-host .picker-option{align-items:center;gap:var(--castle-space-base);padding:var(--castle-space-small) var(--castle-space-base);border-radius:var(--castle-radius-small);color:var(--castle-text-secondary);cursor:pointer;display:flex}#chat-host .picker-option input[type=radio],#chat-host .picker-option input[type=checkbox]{appearance:none;border:1px solid var(--castle-border-2);border-radius:var(--castle-radius-small);background:var(--castle-surface-3);width:12px;height:12px;cursor:inherit;flex:none;place-content:center;margin:0;display:grid}#chat-host .picker-option input[type=radio]{border-radius:var(--castle-radius-pill)}#chat-host .picker-option input[type=radio]:checked,#chat-host .picker-option input[type=checkbox]:checked{border-color:var(--castle-surface-light);background:var(--castle-surface-light)}#chat-host .picker-option input[type=radio]:before,#chat-host .picker-option input[type=checkbox]:before{content:"";display:block}#chat-host .picker-option input[type=radio]:checked:before{border-radius:var(--castle-radius-pill);background:var(--castle-text-dark);width:4px;height:4px}#chat-host .picker-option input[type=checkbox]:checked:before{border-left:1.5px solid var(--castle-text-dark);border-bottom:1.5px solid var(--castle-text-dark);width:6px;height:3px;margin-top:-2px;transform:rotate(-45deg)}#chat-host .picker-other-toggle{align-items:center;gap:var(--castle-space-base);min-width:0;cursor:inherit;flex:1;margin:0;display:flex}#chat-host .picker-option-other.is-checked .picker-other-toggle{flex:none}#chat-host .picker-other-label{display:block}#chat-host .picker-other-input{width:100%;min-width:0;color:inherit;font:inherit;cursor:text;background:0 0;border:0;outline:none;flex:1;margin:0;padding:0}#chat-host .picker-other-input:disabled{cursor:default}#chat-host .picker:not(.picker-locked) .picker-option:hover,#chat-host .picker-option.is-checked{background:var(--castle-surface-5);color:var(--castle-text-primary)}#chat-host .picker-option:has(input:checked){background:var(--castle-surface-5);color:var(--castle-text-primary)}#chat-host .picker-locked{opacity:.72}#chat-host .picker-locked .picker-option{cursor:default}#chat-host .picker-actions{justify-content:flex-end;display:flex}#chat-host .chips{justify-content:flex-end;align-self:flex-end;gap:var(--castle-space-base);max-width:85%;margin:var(--castle-space-small) 0 var(--castle-space-small);flex-wrap:wrap;display:flex}#chat-host .chip{padding:var(--castle-space-base) var(--castle-space-large);border:1px dotted var(--castle-surface-light);border-radius:var(--castle-radius-pill);color:var(--castle-surface-light);font:inherit;font-size:var(--castle-text-size-base);text-align:left;cursor:pointer;background:0 0;line-height:1.3}#chat-host .chips-inert .chip{border-color:var(--castle-text-dim);color:var(--castle-text-muted);cursor:default}#chat-host .chip.is-picked,#chat-host .chips-inert .chip.is-picked{border-style:solid;border-color:var(--castle-surface-light);background:var(--castle-surface-light);color:var(--castle-text-dark)}#chat-host .msg-file{color:inherit;font:inherit;text-underline-offset:2px;text-decoration:underline;-webkit-text-decoration-color:color-mix(in srgb, currentColor 40%, transparent);text-decoration-color:color-mix(in srgb, currentColor 40%, transparent);cursor:pointer;word-break:break-all;background:0 0;border:0;margin:0;padding:0;display:inline}#chat-host .msg-file:hover{text-decoration-color:currentColor}#chat-host .picker-skeleton{pointer-events:none}#chat-host .picker-skeleton-hint{color:var(--castle-text-muted);font-size:var(--castle-text-size-base)}#chat-host .picker-skeleton-line,#chat-host .picker-skeleton-chip{border-radius:var(--castle-radius-small);background:var(--castle-border-1);display:block}#chat-host .picker-skeleton-label{width:60%;height:11px;margin-bottom:0}#chat-host .picker-skeleton-skip{width:36px;height:11px}#chat-host .picker-skeleton-chip{height:24px}.xterm,.xterm-viewport,.xterm-screen,.xterm-helpers{background-color:#0000!important}.xterm{overscroll-behavior:contain}.xterm-viewport{overscroll-behavior:contain;scrollbar-width:none;-ms-overflow-style:none}.xterm-viewport::-webkit-scrollbar{width:0;height:0}.xterm .xterm-scrollable-element>.scrollbar,.xterm .xterm-scrollable-element>.scrollbar.visible,.xterm .xterm-scrollable-element>.visible.scrollbar,.xterm .xterm-scrollable-element>.invisible.scrollbar,.xterm .xterm-scrollable-element>.xterm-scrollbar{opacity:0!important;pointer-events:none!important;width:0!important;min-width:0!important;height:0!important;min-height:0!important;display:none!important}.xterm .xterm-scrollable-element>.scrollbar>.slider,.xterm .xterm-scrollable-element>.scrollbar>.scra,.xterm .xterm-scrollable-element>.xterm-scrollbar>.xterm-slider{width:0!important;height:0!important;display:none!important}.xterm .xterm-scrollable-element>.shadow{display:none!important}.quick-open-backdrop{z-index:2147483100;justify-content:center;align-items:flex-start;padding-top:12vh;display:flex;position:fixed;inset:0}.quick-open{background:#232323;border:1px solid #3a3a3a;border-radius:8px;flex-direction:column;width:min(600px,90vw);max-height:60vh;display:flex;overflow:hidden;box-shadow:0 16px 48px #0009}.quick-open-input{color:#f0f0f0;background:#161616;border:1px solid #4a4a4a;border-radius:5px;outline:none;flex:none;margin:8px;padding:8px 10px;font-size:14px}.quick-open-input:focus{border-color:#5a8bd6}.quick-open-list{flex:auto;padding:4px;overflow-y:auto}.quick-open-item{color:#e6e6e6;text-align:left;cursor:pointer;background:0 0;border:0;border-radius:4px;align-items:baseline;gap:8px;width:100%;padding:5px 8px;font-size:13px;display:flex}.quick-open-item.active{background:#37506f}.quick-open-name{white-space:nowrap;flex:none}.quick-open-dir{text-overflow:ellipsis;white-space:nowrap;color:#8a8a8a;flex:auto;min-width:0;font-size:12px;overflow:hidden}.quick-open-empty{color:#8a8a8a;text-align:center;padding:12px;font-size:13px}.quick-open-keys{color:#b0b0b0;white-space:nowrap;border:1px solid #4a4a4a;border-radius:4px;flex:none;margin-left:8px;padding:1px 6px;font-family:SFMono-Regular,Consolas,monospace;font-size:11px}.mention-picker{z-index:2147483100;background:#232323;border:1px solid #3a3a3a;border-radius:8px;width:min(360px,90vw);max-height:40vh;padding:4px;position:fixed;overflow-y:auto;box-shadow:0 16px 48px #0009}.mention-item{color:#e6e6e6;text-align:left;cursor:pointer;background:0 0;border:0;border-radius:4px;align-items:baseline;gap:8px;width:100%;padding:5px 8px;font-size:13px;display:flex}.mention-item.active{background:#37506f}.mention-name{white-space:nowrap;flex:none}.mention-dir{text-overflow:ellipsis;white-space:nowrap;color:#8a8a8a;flex:auto;min-width:0;font-size:12px;overflow:hidden}.chord-hint{z-index:2147483200;color:#c7c7c7;background:#232323;border:1px solid #3a3a3a;border-radius:8px;align-items:center;gap:8px;padding:6px 12px;font-size:12px;display:flex;position:fixed;bottom:24px;left:50%;transform:translate(-50%);box-shadow:0 8px 24px #0000008c}.chord-hint kbd{color:#f0f0f0;background:#333;border:1px solid #4a4a4a;border-radius:4px;padding:2px 7px;font-family:SFMono-Regular,Consolas,monospace;font-size:12px}@media (pointer:coarse){input,textarea,select,[contenteditable]:not(.cm-content){font-size:16px!important}}.cm-url,.cm-md-link{color:#82aaff;text-underline-offset:2px;cursor:pointer;text-decoration:underline;text-decoration-thickness:1px}.cm-url:hover,.cm-md-link:hover{color:#fff}._fieldRow_kedkb_4,._fieldDefault_kedkb_5{--field-override:#b388ff;--field-override-border:#5b4a80}._fieldRow_kedkb_4{grid-template-columns:minmax(82px,.5fr) minmax(0,1fr);align-items:center;gap:12px;min-height:28px;margin-bottom:0;padding-bottom:12px;display:grid}._fieldRow_kedkb_4:last-child{margin-bottom:0}._fieldLabel_kedkb_27{color:var(--castle-text-primary);overflow-wrap:anywhere;min-width:0;font-size:14px}._fieldLabelOverridden_kedkb_36{color:var(--field-override)}._fieldRowOverridden_kedkb_40{--field-border:var(--field-override-border)}._fieldOverride_kedkb_47{padding-bottom:12px}._fieldOverride_kedkb_47 ._fieldRow_kedkb_4{padding-bottom:4px}._fieldNote_kedkb_58{grid-template-columns:minmax(82px,.5fr) minmax(0,1fr);gap:12px;margin-top:-6px;padding-bottom:12px;display:grid}._fieldNoteInner_kedkb_66{min-width:0;color:var(--castle-text-muted);grid-column:2;font-size:12px;line-height:1.35}._fieldDefault_kedkb_5{grid-template-columns:minmax(82px,.5fr) minmax(0,1fr);gap:12px;display:grid}._fieldDefaultInner_kedkb_80{min-width:0;color:var(--castle-text-muted);grid-column:2;align-items:center;gap:8px;font-size:12px;display:flex}._fieldDefaultInner_kedkb_80>span{text-overflow:ellipsis;white-space:nowrap;min-width:0;overflow:hidden}._fieldResetBtn_kedkb_97{color:var(--field-override);cursor:pointer;background:0 0;border:0;margin-left:auto;padding:0;font-size:12px}._fieldResetBtn_kedkb_97:hover{color:var(--castle-text-primary)}._input_kedkb_40{border:1px solid var(--field-border,var(--castle-border-1));border-radius:var(--castle-radius-small);background:var(--castle-surface-3);width:100%;color:var(--castle-text-primary);font:inherit;outline:0;padding:5px 8px}._select_kedkb_41{appearance:none;text-overflow:ellipsis;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5L6 8l3.5-3.5' fill='none' stroke='%23888888' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");background-position:right 8px center;background-repeat:no-repeat;padding-right:26px}._numberField_kedkb_134{width:100%;position:relative}._numberInput_kedkb_139{appearance:textfield}._numberInput_kedkb_139::-webkit-inner-spin-button{appearance:none;margin:0}._numberInput_kedkb_139::-webkit-outer-spin-button{appearance:none;margin:0}._numberScrub_kedkb_155{cursor:ew-resize;-webkit-user-select:none;user-select:none;align-items:center;gap:6px;padding:5px 8px;display:flex;position:relative;overflow:hidden}._numberSlider_kedkb_167{cursor:pointer}._numberValue_kedkb_171{z-index:1;text-align:right;font-variant-numeric:tabular-nums;flex:auto;min-width:0;position:relative}._unitSuffix_kedkb_180{color:var(--castle-text-muted)}._scrubGrip_kedkb_184{z-index:1;color:var(--castle-text-muted);letter-spacing:-2px;opacity:.4;flex:none;font-size:12px;line-height:1;position:relative}._scrubBubble_kedkb_197{z-index:1001;border:1px solid var(--castle-border-1);color:var(--castle-text-primary);font-variant-numeric:tabular-nums;pointer-events:none;background:#14181ef5;border-radius:8px;padding:3px 10px;font-size:15px;position:fixed;transform:translate(-50%,-100%);box-shadow:0 2px 10px #00000073}._sliderFill_kedkb_212{pointer-events:none;z-index:0;background:#5a8cd24d;position:absolute;top:0;bottom:0;left:0}._sliderThumb_kedkb_222{pointer-events:none;z-index:1;background:#96bef0f2;border-radius:2px;width:3px;height:60%;position:absolute;top:50%;transform:translate(-50%,-50%)}._numpadBackdrop_kedkb_235{z-index:1000;background:#00000059;flex-direction:column;justify-content:flex-end;display:flex;position:fixed;inset:0}._numpadSheet_kedkb_245{background:var(--castle-surface-2);border-top:1px solid var(--castle-border-1);padding:10px 10px calc(10px + env(safe-area-inset-bottom,0px));border-radius:14px 14px 0 0;box-shadow:0 -8px 24px #0006}._numpadValueRow_kedkb_253{justify-content:space-between;align-items:baseline;gap:12px;padding:6px 8px 12px;display:flex}._numpadValueLabel_kedkb_264{color:var(--castle-text-primary);text-overflow:ellipsis;white-space:nowrap;min-width:0;font-size:22px;overflow:hidden}._numpadValueNum_kedkb_273{color:var(--castle-text-primary);font-variant-numeric:tabular-nums;flex:none;font-size:22px}._numpadGrid_kedkb_280{grid-template-columns:repeat(4,1fr);gap:8px;display:grid}._numpadKey_kedkb_286{border:1px solid var(--castle-border-1);background:var(--castle-surface-3);height:52px;color:var(--castle-text-primary);cursor:pointer;touch-action:manipulation;border-radius:10px;font-size:20px}._numpadKey_kedkb_286:active{background:var(--castle-border-1)}._numpadKeyZero_kedkb_301{grid-column:span 3}._numpadKeyDone_kedkb_305{color:#fff;background:#5a8cd2e6;border-color:#0000;font-size:16px}._colorInput_kedkb_312{border:1px solid var(--field-border,var(--castle-border-1));border-radius:var(--castle-radius-small);background:var(--castle-surface-3);cursor:pointer;outline:0;width:100%;height:28px;padding:2px}._checkbox_kedkb_323{border:1px solid var(--field-border,var(--castle-border-1));border-radius:var(--castle-radius-small);background:var(--castle-surface-3);cursor:pointer;width:20px;height:20px;box-shadow:none;color:var(--castle-text-primary);flex:none;justify-content:center;justify-self:end;align-items:center;padding:0;display:flex}._checkboxOn_kedkb_340{background:var(--castle-text-dark)}._checkboxMark_kedkb_344{width:12px;height:12px;display:none}._checkboxOn_kedkb_340 ._checkboxMark_kedkb_344{display:block}._fileField_kedkb_356{font:inherit;box-shadow:none;cursor:pointer;align-items:center;display:flex}._fileFieldLabel_kedkb_364{text-overflow:ellipsis;white-space:nowrap;min-width:0;overflow:hidden}._fileFieldEmpty_kedkb_371{color:var(--castle-text-muted)}._filePicker_kedkb_375{z-index:200;box-sizing:border-box;border:1px solid var(--castle-border-1);border-radius:var(--castle-radius-small);background:var(--castle-surface-2);max-height:min(240px,100vh - 16px);padding:4px;position:fixed;overflow:auto;box-shadow:0 8px 24px #00000047}._filePickerOption_kedkb_388{text-align:left;width:100%;color:var(--castle-text-primary);font:inherit;cursor:pointer;background:0 0;border:0;border-radius:3px;padding:6px 8px;font-size:13px;display:block;overflow:hidden}._filePickerPath_kedkb_403{white-space:nowrap;display:block;overflow:hidden}._filePickerOption_kedkb_388:hover,._filePickerOptionSelected_kedkb_410{background:var(--castle-surface-3)}.castle-file-panel{background:var(--castle-surface-2);flex-direction:column;height:100%;display:flex;overflow:hidden;transform:translateZ(0)}.castle-file-panel>.fileBrowserBare{flex:1 1 0;height:auto;min-height:0}.castle-file-toolbar{border-bottom:1px solid var(--castle-border-1);flex-wrap:wrap;flex:none;align-items:center;gap:6px;padding:6px 8px;display:flex}.castle-file-toolbar .castle-button-icon{margin-left:auto}.castle-file-toolbar .castle-button-icon+.castle-button-icon{margin-left:0}.castle-file-toolbar.versions-toolbar{padding-left:var(--castle-space-large);justify-content:space-between}.versions-toolbar-label{text-overflow:ellipsis;white-space:nowrap;min-width:0;color:var(--castle-text-muted);line-height:1;overflow:hidden}.castle-versions{flex-direction:column;flex:1 1 0;min-height:0;display:flex}.versions-error{align-items:flex-start}.versions-error>span:not(.castle-icon-cell){white-space:pre-line}.versions-save{align-items:center;gap:var(--castle-space-base);flex-wrap:wrap;padding:0;display:flex}.versions-save .castle-text-field{flex:130px;width:auto;min-width:0}.versions-save .castle-button{white-space:nowrap;flex:none}.versions-note{padding:var(--castle-space-large) var(--castle-space-large) 0;color:var(--castle-text-muted);font-size:var(--castle-text-size-base)}.versions-empty{padding:var(--castle-space-large);color:var(--castle-text-muted);font-size:var(--castle-text-size-base)}.castle-versions-list{flex:1 1 0;min-height:0;overflow-y:auto}.version{align-items:start;column-gap:var(--castle-space-base);padding:var(--castle-space-base) var(--castle-space-base) var(--castle-space-large);border-bottom:1px solid var(--castle-border-1);grid-template-columns:minmax(0,1fr) auto;display:grid}.version-toggle{grid-template-columns:var(--castle-button-height) minmax(0, 1fr);align-items:start;column-gap:var(--castle-space-base);min-width:0;color:inherit;font:inherit;text-align:left;cursor:pointer;background:0 0;border:0;grid-area:1/1/auto/-1;margin:0;padding:0;display:grid}.version.is-expanded:not(.version-new) .version-toggle{grid-column:1}.version-toggle:focus-visible{outline:1px solid var(--castle-border-2);outline-offset:2px}.version.later,.version.later .castle-icon-cell,.version.later .version-message,.version.later .version-nomessage,.version.later .version-meta,.version.later .version-summary{color:var(--castle-text-muted)}.version:hover{background:var(--castle-surface-3)}.version-main{gap:var(--castle-space-small);flex-direction:column;min-width:0;display:flex}.version-heading{align-items:center;gap:var(--castle-space-base);min-width:0;min-height:var(--castle-button-height);display:flex}.version-message{text-overflow:ellipsis;white-space:nowrap;min-width:0;color:var(--castle-text-primary);font-size:var(--castle-text-size-base);flex:auto;overflow:hidden}.version-nomessage{color:var(--castle-text-muted);font-style:italic}.version-meta{color:var(--castle-text-muted);font-size:var(--castle-text-size-small);margin:0;display:block}.version-actions{min-height:var(--castle-button-height);flex:none;grid-area:1/2;align-items:center;display:none}.version.is-expanded .version-actions{display:flex}.version-detail{padding-left:calc(var(--castle-button-height) + var(--castle-space-base));grid-column:1/-1;display:none}.version-new{flex:none}.version.is-expanded .version-detail{gap:var(--castle-space-small);flex-direction:column;display:flex}.version-summary{color:var(--castle-text-secondary);font-size:var(--castle-text-size-base);overflow-wrap:anywhere;margin:0}.files-feedback-banner{flex:none}.fileEditInput{border:1px solid var(--castle-border-3);background:var(--castle-surface-3);min-width:0;color:var(--castle-text-primary);font:inherit;border-radius:3px;flex:auto;padding:1px 4px;font-size:13px}.fileEditInput:focus{border-color:#5a8bd6;outline:none}.castle-file-menu{z-index:1000;min-width:168px;position:fixed}.castle-file-menu .castle-menu-keys{font-family:SFMono-Regular,Consolas,monospace}.castle-file-picker{gap:var(--castle-space-small);flex-direction:column;min-width:180px;display:flex}.castle-file-picker .castle-text-field{width:100%}.castle-file-picker-label{color:var(--castle-text-muted);margin:0}.castle-file-picker-list{gap:var(--castle-space-small);flex-direction:column;max-height:min(40vh,180px);display:flex;overflow-y:auto}.castle-file-picker-list[hidden]{display:none}.fileBrowserBare{flex-direction:column;min-width:0;height:100%;display:flex}.fileTree{min-height:0;padding:var(--castle-space-base);flex:1 1 0;overflow-y:auto}.fileBranch{min-width:0}.file-row,.file-row.folder-row{align-items:center;gap:var(--castle-space-base);width:100%;min-width:0;height:var(--castle-button-height);margin:0 0 var(--castle-space-small);padding:0 var(--castle-space-base);padding-left:calc(var(--castle-space-base) + var(--file-depth,0) * (var(--castle-button-icon-size) + var(--castle-space-base)));border-radius:var(--castle-radius-small);color:var(--castle-text-secondary);font-size:var(--castle-text-size-base);text-align:left;cursor:pointer;background:0 0;border:0;line-height:1;display:flex}.file-row.folder-row{color:var(--castle-text-muted)}.file-row>span:not(.castle-icon-slot):not(.castle-icon-inline):not(.castle-icon-cell){text-overflow:ellipsis;white-space:nowrap;min-width:0;overflow:hidden}.file-row:hover{background:var(--castle-surface-3);color:var(--castle-text-primary)}.file-row.imported-row{color:var(--castle-text-muted);font-style:italic}.file-row.forked-row{color:var(--castle-text-secondary);font-style:normal}.file-row.selected-row,.file-row.selected-row:hover{background:var(--castle-surface-4);color:var(--castle-text-primary)}.file-row.hidden-row{color:var(--castle-text-muted)}:is(.file-row:has(.castle-button-icon),.file-row:has(.castle-icon-cell)){padding-right:0}.file-row .castle-button-icon,.file-row .castle-icon-cell{margin-left:auto}.file-row.edit-row{height:auto;min-height:var(--castle-button-height);cursor:default;flex-wrap:wrap}.file-row.edit-row .castle-text-field{flex:auto;width:auto}.file-suffix{color:var(--castle-text-muted);flex:none}.file-row .file-edit-feedback{padding-left:calc(var(--castle-button-icon-size) + var(--castle-space-base));padding-bottom:var(--castle-space-small);font-size:var(--castle-text-size-small);white-space:normal;flex:1 0 100%;line-height:1.45;overflow:visible}.flow-root.is-mobile .castle-file-panel,.flow-mobile-switch{--castle-button-height:var(--castle-button-height-large)}.flow-mobile-switch{--castle-text-size-small:14px;--castle-text-size-base:16px;--castle-text-style-smallcaps-size:var(--castle-text-size-small)}.flow-root.is-mobile .castle-file-panel .castle-button:not(.castle-button-icon){padding-left:var(--castle-space-large);padding-right:var(--castle-space-large)}.flow-root.is-mobile .file-row,.flow-mobile-switch .file-row{margin-bottom:0}.flow-root.is-mobile .file-row>span:not(.castle-icon-slot):not(.castle-icon-inline):not(.castle-icon-cell),.flow-mobile-switch .file-row>span:not(.castle-icon-slot):not(.castle-icon-inline):not(.castle-icon-cell){line-height:var(--castle-button-height)}.flow-root.is-mobile .file-row:hover,.flow-mobile-switch .file-row:hover{color:var(--castle-text-secondary);background:0 0}.flow-root.is-mobile .file-row.folder-row:hover,.flow-root.is-mobile .file-row.imported-row:hover,.flow-mobile-switch .file-row.folder-row:hover,.flow-mobile-switch .file-row.imported-row:hover,.flow-root.is-mobile .file-row.hidden-row:hover,.flow-mobile-switch .file-row.hidden-row:hover{color:var(--castle-text-muted)}.flow-root.is-mobile .file-row.selected-row:hover,.flow-mobile-switch .file-row.selected-row:hover{background:var(--castle-surface-4);color:var(--castle-text-primary)}.flow-root.is-mobile .version:hover{background:0 0}.castle-code-panel{flex-direction:column;width:100%;height:100%;display:flex;position:relative}.mainEditor{background:var(--castle-surface-2);flex-direction:column;flex:1 1 0;width:100%;min-width:0;height:100%;min-height:0;display:flex}.editorBody{flex:1;min-height:0;display:flex;overflow:hidden;container:editor/inline-size}.codeEditor{background:var(--castle-surface-2);flex:1;grid-template-columns:1fr;min-width:0;min-height:0;display:grid}.codeMirrorHost{min-width:0;height:100%;min-height:0}.castle-code-overlay{color:var(--castle-text-muted);pointer-events:none;font-size:12px;position:absolute;top:10px;left:12px}.castle-code-overlay.castle-code-error{color:var(--castle-danger-text)}.castle-code-savebar{background:var(--castle-danger-surface);color:var(--castle-danger-text);padding:4px 10px;font-size:11px;position:absolute;bottom:0;left:0;right:0}.castle-tab-import{color:var(--castle-text-muted);font-style:italic}.castle-modal-scrim{z-index:1000;background:#00000080;justify-content:center;align-items:center;display:flex;position:fixed;inset:0}.castle-modal{color:#e8e8e8;background:#232323;border:1px solid #3a3a3a;border-radius:6px;min-width:260px;max-width:380px;padding:16px;font-size:13px;box-shadow:0 8px 24px #0000008c}.castle-modal-text{margin-bottom:14px}.castle-modal-actions{justify-content:flex-end;gap:8px;margin-top:16px;display:flex}.castle-modal-actions button,.castle-import-link-row button{color:#e8e8e8;cursor:pointer;background:#2e2e2e;border:1px solid #3a3a3a;border-radius:4px;padding:5px 12px;font-size:12px}.castle-modal-actions button:hover:not(:disabled),.castle-import-link-row button:hover:not(:disabled){background:#383838}.castle-modal-actions button:disabled,.castle-import-link-row button:disabled{opacity:.6;cursor:default}.castle-upload-modal{flex-direction:column;gap:10px;width:min(460px,100vw - 24px);max-width:none;max-height:calc(100vh - 32px);display:flex;overflow-y:auto}.castle-upload-modal>.castle-modal-text{margin-bottom:0}.castle-upload-modal>.castle-file-picker{width:100%;min-width:0}.castle-upload-input{opacity:0;pointer-events:none;width:1px;height:1px;position:absolute}.castle-upload-drop{justify-content:center;align-items:center;gap:var(--castle-space-small);width:100%;padding:calc(var(--castle-space-large) + var(--castle-space-base)) var(--castle-space-large);border:1px dashed var(--castle-border-3);border-radius:var(--castle-radius-small);background:var(--castle-surface-3);color:var(--castle-text-primary);font:inherit;cursor:pointer;flex-direction:column;display:flex}.castle-upload-drop:hover,.castle-upload-drop.over{border-color:var(--castle-border-2);background:var(--castle-surface-5)}.castle-upload-drop svg{font-size:var(--castle-button-icon-size)}.castle-upload-drop-label{font-size:var(--castle-text-size-base)}.castle-upload-drop-hint{color:var(--castle-text-muted);font-size:var(--castle-text-size-small)}.castle-upload-picked{flex-direction:column;max-height:132px;display:flex;overflow-y:auto}.castle-upload-picked-row{align-items:center;gap:var(--castle-space-base);min-height:var(--castle-button-height);padding:var(--castle-space-small) 0;display:flex}.castle-upload-picked-row+.castle-upload-picked-row{border-top:1px solid var(--castle-border-1)}.castle-upload-picked-name{min-width:0;font-size:var(--castle-text-size-base);flex-direction:column;flex:auto;justify-content:center;display:flex}.castle-upload-picked-label{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.castle-upload-picked-name .castle-text-field{width:100%}.castle-upload-picked-warning{color:var(--castle-warn-text);font-size:var(--castle-text-size-small);white-space:normal;margin-top:2px;display:block}.castle-upload-picked-size{color:var(--castle-text-muted);font-size:var(--castle-text-size-small);font-variant-numeric:tabular-nums;flex:none}.castle-upload-status{text-overflow:ellipsis;white-space:nowrap;opacity:.7;text-align:left;flex:auto;min-width:0;font-size:12px;overflow:hidden}@media (width<=520px){.castle-upload-modal{width:calc(100vw - 16px);min-width:0;padding:12px}.castle-upload-drop{padding:var(--castle-space-large) var(--castle-space-base)}.castle-upload-picked{max-height:104px}.castle-file-picker-list{max-height:132px}}.castle-import-modal{flex-direction:column;width:min(520px,100vw - 32px);max-width:none;height:min(560px,100vh - 64px);max-height:none;display:flex}.castle-import-modal>.castle-modal-text,.castle-import-modal>.castle-key-tabs,.castle-import-modal>.castle-import-select-bar,.castle-import-modal>.castle-import-filter,.castle-import-modal>.castle-import-note,.castle-import-modal>.castle-import-error,.castle-import-modal>.castle-modal-actions{flex:none}.castle-import-select-bar{align-items:center;gap:10px;margin-bottom:8px;display:flex}.castle-import-select-all{padding:4px 8px}.castle-import-update-row{align-items:center}.castle-import-tick{color:#1b1b1b;border:1px solid #5a5a5a;border-radius:3px;flex:none;justify-content:center;align-items:center;width:16px;height:16px;font-size:10px;display:flex}.castle-import-tick.checked{background:#8ab4f8;border-color:#8ab4f8}.castle-import-filter{margin-bottom:8px}.castle-import-empty{color:#9a9a9a;text-align:center;flex:auto;justify-content:center;align-items:center;min-height:0;padding:10px;font-size:11px;display:flex}.castle-import-tabs .castle-key-tab{min-height:34px}.castle-import-list{background:#1b1b1b;border:1px solid #3a3a3a;border-radius:4px;flex:auto;min-height:0;overflow-y:auto}.castle-import-row{color:#e8e8e8;width:100%;font:inherit;text-align:left;cursor:pointer;background:0 0;border:0;border-bottom:1px solid #2e2e2e;gap:10px;padding:8px;font-size:12px;display:flex}.castle-import-row:last-child{border-bottom:0}.castle-import-row:hover{background:#262626}.castle-import-row.selected{background:#3a3a3a}.castle-import-row.disabled{opacity:.5}.castle-import-thumb{object-fit:cover;background:#2e2e2e;border-radius:3px;flex:none;width:56px;height:79px}.castle-import-row-text{flex-direction:column;gap:3px;min-width:0;display:flex}.castle-import-row-title{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.castle-import-row-meta{color:#9a9a9a;font-size:11px}.castle-import-link{flex-direction:column;flex:auto;gap:8px;min-height:0;display:flex}.castle-import-link-row{gap:8px;display:flex}.castle-import-link-row button{white-space:nowrap}.castle-import-note{color:#9a9a9a;padding:10px 2px;font-size:11px}.castle-import-error{color:#ff8f8f;margin-top:8px;font-size:11px}.castle-code-params-strip{border:0;border-bottom:1px solid var(--castle-border-1);background:var(--castle-surface-3);width:100%;color:var(--castle-text-muted);font:inherit;text-align:left;cursor:pointer;align-items:center;gap:8px;padding:6px 12px;font-size:12px;display:flex}.castle-code-params-strip:hover{color:var(--castle-text-primary)}.castle-code-params-icon{flex:none;display:inline-flex}.castle-code-params-count{text-overflow:ellipsis;white-space:nowrap;min-width:0;overflow:hidden}.castle-code-params-action{color:var(--castle-text-primary);flex:none;margin-left:auto}.castle-code-selection-bar{z-index:2;position:absolute;bottom:12px;right:12px}.castle-params-panel{background:var(--castle-surface-2);height:100%;color:var(--castle-text-primary);-webkit-overflow-scrolling:touch;font-size:14px;overflow:hidden auto}.paramsFields{padding:10px 16px 24px}.paramsGroup+.paramsGroup{margin-top:6px}.paramsGroupTitle{color:var(--castle-text-muted);text-transform:uppercase;letter-spacing:.06em;overflow-wrap:anywhere;margin:0 0 10px;font-size:12px}.paramsGroup+.paramsGroup>.paramsGroupTitle{border-top:1px solid var(--castle-border-1);margin-top:10px;padding-top:10px}.paramsNotice{color:var(--castle-text-muted);padding:16px}.paramsSaveError{border-bottom:1px solid var(--castle-border-1);color:var(--castle-text-primary);background:#be464629;padding:8px 16px;font-size:13px}.paramsNoticeRow{align-items:center;gap:10px;display:flex}.paramsNoticeAction{border:1px solid var(--castle-border-1);border-radius:var(--castle-radius-small);background:var(--castle-surface-3);color:var(--castle-text-primary);font:inherit;cursor:pointer;flex:none;margin-left:auto;padding:2px 10px}.paramsNoticeAction:hover{border-color:var(--castle-text-muted)}.paramsScopeBar{z-index:2;border-bottom:1px solid var(--castle-border-1);background:var(--castle-surface-2);align-items:center;gap:8px;padding:6px 10px;display:flex;position:sticky;top:0}.paramsScopeButton{border:1px solid var(--castle-border-1);border-radius:var(--castle-radius-small);background:var(--castle-surface-3);min-width:0;color:var(--castle-text-primary);font:inherit;cursor:pointer;align-items:center;gap:6px;padding:4px 8px;font-size:13px;display:flex}.paramsScopeIcon,.paramsScopeChevron{flex:none;display:inline-flex}.paramsScopeLabel{text-overflow:ellipsis;white-space:nowrap;min-width:0;overflow:hidden}.paramsScopeSummary{color:var(--castle-text-muted);font-size:12px}.paramsScopeMenu{max-width:calc(100% - 16px);max-height:60vh;position:absolute;top:100%;left:8px;overflow-y:auto}.paramsScopeMenu .castle-menu-item-label{text-overflow:ellipsis;white-space:nowrap;text-align:left;direction:rtl;overflow:hidden}.paramsScopeDivider{color:var(--castle-text-muted);text-transform:uppercase;letter-spacing:.06em;padding:6px 10px 4px;font-size:11px}.paramsScopeCount,.paramsFileCount{color:var(--castle-text-muted);font-variant-numeric:tabular-nums;flex:none;margin-left:auto;padding-left:10px;font-size:12px}.paramsFile+.paramsFile{border-top:1px solid var(--castle-border-1)}.paramsFileHead{align-items:center;padding:0 6px 0 0;display:flex}.paramsFileHead~.paramsFields{padding-bottom:6px}.paramsFileToggle{min-width:0;color:var(--castle-text-primary);font:inherit;text-align:left;cursor:pointer;background:0 0;border:0;flex:1;align-items:center;gap:6px;padding:8px 4px 8px 10px;font-size:12px;display:flex}.paramsFileChevron{color:var(--castle-text-muted);flex:none;display:inline-flex}.paramsFilePath{text-overflow:ellipsis;white-space:nowrap;text-align:left;min-width:0;font-family:var(--castle-font-mono);direction:rtl;overflow:hidden}.paramsFileOpen{border-radius:var(--castle-radius-small);color:var(--castle-text-muted);cursor:pointer;background:0 0;border:0;flex:none;padding:4px 6px;display:inline-flex}.paramsFileOpen:hover{color:var(--castle-text-primary)}.paramsScopeActions{align-items:center;gap:2px;margin-left:auto;display:flex}.paramsEmpty{max-width:46em;padding:20px 16px}.paramsEmptyLead{color:var(--castle-text-primary);margin:0 0 10px;font-size:15px}.paramsEmptyBody{color:var(--castle-text-muted);margin:0 0 12px;line-height:1.5}.paramsEmpty code{font-family:var(--castle-font-mono);color:var(--castle-text-primary);font-size:13px}.paramsEmptyCode{border:1px solid var(--castle-border-1);border-radius:var(--castle-radius-small);background:var(--castle-surface-3);color:var(--castle-text-primary);font-family:var(--castle-font-mono);margin:0 0 14px;padding:10px 12px;font-size:13px;line-height:1.45;overflow-x:auto}.castle-params-panel .paramExpr,.castle-params-panel .paramFoldedSource{text-overflow:ellipsis;white-space:nowrap;border:1px dashed var(--castle-border-1);border-radius:var(--castle-radius-small);min-width:0;color:var(--castle-text-muted);font-family:var(--castle-font-mono);cursor:default;padding:5px 8px;font-size:13px;overflow:hidden}.castle-params-panel .paramFoldedSource{max-width:100%;margin-right:6px;padding:1px 5px;font-size:11px;display:inline-block}.castle-params-panel .paramExprLink{width:100%;font:inherit;font-family:var(--castle-font-mono);text-align:left;cursor:pointer;background:0 0;align-items:center;gap:6px;font-size:13px;display:flex}.castle-params-panel .paramExprSource{text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0;overflow:hidden}.castle-params-panel .paramExprLink:hover{color:var(--castle-text-primary);border-style:solid}.castle-params-panel [data-field-id].paramFieldRevealed{animation:1.4s ease-out paramFieldReveal}@keyframes paramFieldReveal{0%,60%{background:var(--castle-surface-3);box-shadow:0 0 0 4px var(--castle-surface-3)}to{background:0 0;box-shadow:0 0 0 4px #0000}}.xterm{cursor:text;-webkit-user-select:none;user-select:none;position:relative}.xterm.focus,.xterm:focus{outline:none}.xterm .xterm-helpers{z-index:5;position:absolute;top:0}.xterm .xterm-helper-textarea{opacity:0;z-index:-5;white-space:nowrap;resize:none;border:0;width:0;height:0;margin:0;padding:0;position:absolute;top:0;left:-9999em;overflow:hidden}.xterm .composition-view{color:#fff;white-space:nowrap;z-index:1;background:#000;display:none;position:absolute}.xterm .composition-view.active{display:block}.xterm .xterm-viewport{cursor:default;background-color:#000;position:absolute;inset:0;overflow-y:scroll}.xterm .xterm-screen{position:relative}.xterm .xterm-screen canvas{position:absolute;top:0;left:0}.xterm-char-measure-element{visibility:hidden;line-height:normal;display:inline-block;position:absolute;top:0;left:-9999em}.xterm.enable-mouse-events{cursor:default}.xterm.xterm-cursor-pointer,.xterm .xterm-cursor-pointer{cursor:pointer}.xterm.column-select.focus{cursor:crosshair}.xterm .xterm-accessibility:not(.debug),.xterm .xterm-message{z-index:10;color:#0000;pointer-events:none;position:absolute;inset:0}.xterm .xterm-accessibility-tree:not(.debug) ::selection{color:#0000}.xterm .xterm-accessibility-tree{-webkit-user-select:text;user-select:text;white-space:pre;font-family:monospace}.xterm .xterm-accessibility-tree>div{transform-origin:0;width:fit-content}.xterm .live-region{width:1px;height:1px;position:absolute;left:-9999px;overflow:hidden}.xterm-dim{opacity:1!important}.xterm-underline-1{text-decoration:underline}.xterm-underline-2{-webkit-text-decoration:underline double;text-decoration:underline double}.xterm-underline-3{-webkit-text-decoration:underline wavy;text-decoration:underline wavy}.xterm-underline-4{-webkit-text-decoration:underline dotted;text-decoration:underline dotted}.xterm-underline-5{-webkit-text-decoration:underline dashed;text-decoration:underline dashed}.xterm-overline{text-decoration:overline}.xterm-overline.xterm-underline-1{text-decoration:underline overline}.xterm-overline.xterm-underline-2{-webkit-text-decoration:overline double underline;text-decoration:overline double underline}.xterm-overline.xterm-underline-3{-webkit-text-decoration:overline wavy underline;text-decoration:overline wavy underline}.xterm-overline.xterm-underline-4{-webkit-text-decoration:overline dotted underline;text-decoration:overline dotted underline}.xterm-overline.xterm-underline-5{-webkit-text-decoration:overline dashed underline;text-decoration:overline dashed underline}.xterm-strikethrough{text-decoration:line-through}.xterm-screen .xterm-decoration-container .xterm-decoration{z-index:6;position:absolute}.xterm-screen .xterm-decoration-container .xterm-decoration.xterm-decoration-top-layer{z-index:7}.xterm-decoration-overview-ruler{z-index:8;pointer-events:none;position:absolute;top:0;right:0}.xterm-decoration-top{z-index:2;position:relative}.xterm .xterm-scrollable-element>.scrollbar{cursor:default}.xterm .xterm-scrollable-element>.scrollbar>.scra{cursor:pointer;font-size:11px!important}.xterm .xterm-scrollable-element>.visible{opacity:1;z-index:11;background:0 0;transition:opacity .1s linear}.xterm .xterm-scrollable-element>.invisible{opacity:0;pointer-events:none}.xterm .xterm-scrollable-element>.invisible.fade{transition:opacity .8s linear}.xterm .xterm-scrollable-element>.shadow{display:none;position:absolute}.xterm .xterm-scrollable-element>.shadow.top{width:100%;height:3px;box-shadow:var(--vscode-scrollbar-shadow,#000) 0 6px 6px -6px inset;display:block;top:0;left:3px}.xterm .xterm-scrollable-element>.shadow.left{width:3px;height:100%;box-shadow:var(--vscode-scrollbar-shadow,#000) 6px 0 6px -6px inset;display:block;top:3px;left:0}.xterm .xterm-scrollable-element>.shadow.top-left-corner{width:3px;height:3px;display:block;top:0;left:0}.xterm .xterm-scrollable-element>.shadow.top.left{box-shadow:var(--vscode-scrollbar-shadow,#000) 6px 0 6px -6px inset}.flow-root{--flow-gutter:#000;--flow-surface:#181818;--flow-chip:#282828;--flow-font-display:"Basteleur", Georgia, "Times New Roman", serif;--flow-fg:#e6e6e6;--flow-secondary:#b3b3b3;--flow-muted:#888;--flow-dim:#525252;--flow-border:#2a2a2a;--flow-border-active:#5a5a5a;--flow-gap:12px;--flow-dock-h:36px;--flow-rail-w:56px;--flow-tab-h:var(--castle-panel-header-height);--flow-icon-dock:var(--castle-button-icon-size);--flow-btn-sm:var(--castle-button-height);--flow-host-l:0px;--flow-host-r:0px;--flow-max-chips:6;--flow-chip-size:36px;--flow-chips-w:calc(var(--flow-max-chips) * var(--flow-chip-size));--flow-fade:22px;background:var(--flow-gutter);color:var(--flow-fg);flex-direction:column;font:13px ui-sans-serif,system-ui,-apple-system,sans-serif;display:flex;position:fixed;inset:0;overflow:hidden}.flow-root *{box-sizing:border-box}body.flow-reordering,body.flow-reordering *{touch-action:none;-webkit-user-select:none!important;user-select:none!important;cursor:grabbing!important}.flow-topbar{top:var(--flow-gap);left:var(--flow-gap);right:var(--flow-gap);height:var(--flow-dock-h);align-items:center;gap:var(--castle-space-base);z-index:40;pointer-events:none;padding-left:var(--flow-host-l);padding-right:var(--flow-host-r);grid-template-columns:minmax(0,1fr) minmax(0,auto) minmax(0,1fr);display:grid;position:absolute}.flow-topbar-leading{justify-self:start;align-items:center;gap:var(--castle-space-base);pointer-events:none;min-width:0;display:flex}.flow-topbar-leading>*{pointer-events:auto}.flow-castle-wrap{flex-shrink:0;position:relative}.flow-menu-backdrop{z-index:49;position:fixed;inset:0}.flow-castle-menu{top:calc(var(--flow-dock-h) + var(--castle-space-base));z-index:50;position:absolute;left:0}.flow-menu-narrow{display:none}.flow-deck-identity{max-width:260px}.flow-deck-vis{color:var(--flow-secondary);flex-shrink:0;font-size:14px;display:inline-flex}.flow-deck-vis svg{width:14px;height:14px}.flow-deck-name{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.flow-deck-caret{color:var(--flow-muted);flex-shrink:0;display:inline-flex}.flow-draft-status{color:var(--flow-muted);font-size:var(--castle-text-size-small);white-space:nowrap;flex-shrink:0}.flow-draft-status.is-error{color:var(--castle-danger-text)}.flow-draft-status:not(.is-compact){text-overflow:ellipsis;flex-shrink:1;min-width:0;overflow:hidden}.flow-draft-notice{z-index:35;margin:calc(var(--flow-dock-h) + var(--flow-gap) * 2) var(--flow-gap) calc(-1 * (var(--flow-dock-h) + var(--flow-gap)));overflow-wrap:anywhere;flex:none;max-height:min(30vh,12em);position:relative;overflow-y:auto}.flow-tabs-wrap{pointer-events:auto;justify-self:center;align-items:center;gap:var(--castle-space-base);min-width:0;max-width:100%;display:flex}.flow-tabs{min-width:0;max-width:var(--flow-chips-w);flex:0 auto;position:relative}.flow-tabs-scroll{scrollbar-width:none;align-items:stretch;gap:0;height:100%;padding:0;display:flex;overflow:auto hidden}.flow-tabs-scroll::-webkit-scrollbar{display:none}.flow-tabs.more-left{-webkit-mask-image:linear-gradient(to right, transparent, #000 var(--flow-fade));-webkit-mask-image:linear-gradient(to right, transparent, #000 var(--flow-fade));mask-image:linear-gradient(to right, transparent, #000 var(--flow-fade));border-top-left-radius:0;border-bottom-left-radius:0}.flow-tabs.more-right{-webkit-mask-image:linear-gradient(to left, transparent, #000 var(--flow-fade));-webkit-mask-image:linear-gradient(to left, transparent, #000 var(--flow-fade));mask-image:linear-gradient(to left, transparent, #000 var(--flow-fade));border-top-right-radius:0;border-bottom-right-radius:0}.flow-tabs.more-left.more-right{-webkit-mask-image:linear-gradient(to right, transparent, #000 var(--flow-fade), #000 calc(100% - var(--flow-fade)), transparent);-webkit-mask-image:linear-gradient(to right, transparent, #000 var(--flow-fade), #000 calc(100% - var(--flow-fade)), transparent);mask-image:linear-gradient(to right, transparent, #000 var(--flow-fade), #000 calc(100% - var(--flow-fade)), transparent)}.castle-button.flow-tabs-add,.castle-button.flow-layout-toggle{width:var(--castle-button-height-large);height:var(--castle-button-height-large);border-radius:var(--castle-radius-base);flex-shrink:0}.flow-chip-icon{font-size:var(--flow-icon-dock);display:inline-flex}.flow-chip-icon svg{width:var(--flow-icon-dock);height:var(--flow-icon-dock)}.flow-topbar-trailing{justify-self:end;align-items:center;gap:var(--castle-space-base);pointer-events:none;min-width:0;display:flex}.flow-presence-wrap{pointer-events:auto;flex-shrink:0;position:relative}.flow-presence-pill{align-items:center;gap:var(--castle-space-small);white-space:nowrap;display:flex}.flow-presence-avatars{padding-left:4px;display:flex}.flow-presence-avatar{border:1px solid var(--castle-border-1);border-radius:var(--castle-radius-pill);background:var(--castle-surface-4);width:22px;height:22px;color:var(--castle-text-primary);object-fit:cover;margin-left:-4px}.flow-presence-avatar.is-initial{font-size:var(--castle-text-size-small);justify-content:center;align-items:center;display:inline-flex}.flow-presence-menu{top:calc(var(--flow-dock-h) + var(--castle-space-base));z-index:50;min-width:220px;position:absolute;right:0}.flow-collaborator-row{align-items:center;gap:var(--castle-space-base);min-height:36px;padding:var(--castle-space-small) var(--castle-space-base);color:var(--castle-text-primary);grid-template-columns:auto minmax(0,1fr) auto;display:grid}.flow-collaborator-here{color:var(--castle-text-muted);font-size:var(--castle-text-size-small)}.flow-preview-btn{pointer-events:auto;flex-shrink:0}.flow-preview-btn-failed{color:var(--castle-danger-text);border-color:var(--castle-danger-text)}.flow-preview-label{justify-items:center;display:grid}.flow-preview-label>*{grid-area:1/1}.flow-preview-label-sizer{visibility:hidden;pointer-events:none}.flow-root.is-mobile{--flow-max-chips:4;--flow-gap:var(--castle-space-base);--castle-text-size-small:14px;--castle-text-size-base:16px;--castle-text-style-smallcaps-size:var(--castle-text-size-small);--flow-tab-h:var(--castle-panel-header-height-mobile);--flow-icon-dock:var(--castle-button-icon-size-large);--flow-btn-sm:var(--castle-button-height-large)}.flow-root.is-mobile .flow-deck-identity,.flow-root.is-mobile .flow-topbar-trailing{display:none}.flow-root.is-mobile .flow-topbar{grid-template-columns:auto minmax(0,1fr)}.flow-root.is-mobile .flow-tabs-wrap{justify-self:start}.flow-root.is-mobile .flow-draft-status.is-compact{border-radius:var(--castle-radius-pill);background:currentColor;flex-shrink:0;width:8px;height:8px;display:block}.flow-root.is-mobile .flow-draft-status.is-dirty{color:var(--castle-warn-text)}.flow-root.is-mobile .flow-topbar-leading:not(:has(.flow-castle-wrap)):not(:has(.flow-draft-status)):not(:has(.flow-host-back)){display:none}.flow-root.has-host-controls.is-mobile .flow-topbar-trailing{display:flex}.flow-root.has-host-controls.is-mobile .flow-topbar{grid-template-columns:auto minmax(0,1fr) auto}.flow-root.has-host-controls .flow-host-back,.flow-root.has-host-controls .flow-host-save{pointer-events:auto;flex-shrink:0}.flow-root.has-host-controls .flow-host-back{width:var(--flow-dock-h);height:var(--flow-dock-h);box-shadow:none;color:#fff;cursor:pointer;background:0 0;border:0;border-radius:0;justify-content:flex-start;align-items:center;margin:0;padding:0;display:flex}.flow-root.has-host-controls .flow-host-back svg{width:22px;height:22px}.flow-root.is-mobile .castle-menu-item.flow-menu-narrow{display:flex}.flow-root.is-mobile .castle-menu-separator.flow-menu-narrow{display:block}.flow-workbench{flex-direction:column;flex:auto;min-height:0;display:flex;position:relative;overflow:hidden}.flow-scroller{flex:auto;min-height:0;overflow:auto}.flow-pin-dock{left:var(--flow-gap);top:calc(var(--flow-dock-h) + var(--flow-gap) * 2);z-index:30;position:absolute}.flow-card-host,.flow-card-slot{display:contents}.flow-card-slot.is-docked{display:none}.flow-field{width:max-content;min-width:100%;min-height:100%}.flow-row{align-items:flex-start;gap:var(--flow-gap);width:max-content;min-height:100%;padding-top:calc(var(--flow-dock-h) + var(--flow-gap) * 2);padding-bottom:var(--flow-gap);padding-left:calc(var(--flow-gap) + var(--flow-pin-inset,0px));padding-right:calc(var(--flow-gap) + var(--flow-overscroll,0px));display:flex}.flow-group{flex-direction:column;min-width:200px;display:flex;overflow:clip}.flow-root.is-mobile .castle-panel:hover,.flow-root.is-mobile .castle-panel.is-hover,.flow-root.is-maximized .castle-panel:hover,.flow-root.is-maximized .castle-panel.is-hover,.markup-sheet.castle-panel:hover{border-color:var(--castle-border-1)}.flow-root.is-mobile .castle-panel-header:hover,.flow-root.is-mobile .castle-panel-tabs-header:hover,.markup-sheet .castle-panel-header:hover{background:var(--castle-surface-3);cursor:default}.operator-chrome{align-items:stretch;gap:var(--castle-space-base);flex:auto;min-width:0;display:flex}.operator-chrome .castle-panel-title{flex-shrink:0;margin:0}.flow-root.is-mobile .operator-chrome{display:contents}.flow-tab-icon{font-size:var(--flow-icon-dock);flex-shrink:0;justify-content:center;align-items:center;display:inline-flex}.flow-drop-indicator{background:var(--castle-border-4);z-index:60;pointer-events:none;border-radius:2px;width:3px;position:fixed;transform:translate(-50%)}.flow-panel-body{flex:auto;min-height:0;position:relative;overflow:hidden}.flow-panel-slot{width:100%;height:100%}.flow-resize-e{top:var(--flow-tab-h);cursor:col-resize;touch-action:none;z-index:20;width:16px;position:absolute;bottom:0;right:-8px}.flow-resize-s{cursor:row-resize;touch-action:none;z-index:20;height:16px;position:absolute;bottom:-8px;left:0;right:0}.flow-resize-se{cursor:nwse-resize;touch-action:none;z-index:21;width:22px;height:22px;position:absolute;bottom:-11px;right:-11px}.flow-placeholder{height:100%;color:var(--flow-muted);text-align:center;flex-direction:column;justify-content:center;align-items:center;gap:8px;padding:16px;display:flex}.flow-placeholder-icon :is(svg){width:34px;height:34px}.flow-placeholder-label{color:var(--flow-secondary);font-size:14px}.flow-placeholder-kind{color:var(--flow-muted);font:11px ui-monospace,SFMono-Regular,Menlo,monospace}.flow-placeholder.kind-play{background:repeating-linear-gradient(45deg,#101018,#101018 10px,#0d0d14 10px 20px)}.flow-picker{z-index:50;max-height:min(60vh,420px);position:fixed}.flow-picker-input{color:var(--flow-fg);background:var(--flow-surface);border:1px solid var(--flow-border);border-radius:var(--castle-radius-small);outline:none;flex:none;padding:7px 9px;font:13px ui-sans-serif,system-ui,sans-serif}.flow-picker-input:focus{border-color:var(--flow-border-active)}.flow-picker-list{flex:auto;min-height:0;overflow-y:auto}.flow-picker-empty{color:var(--flow-muted);padding:10px 8px;font-size:12px}.flow-operator-host{width:100%;height:100%}.flow-root.is-maximized .flow-scroller{overflow:hidden}.flow-root.is-maximized .flow-field,.flow-root.is-maximized .flow-row{width:100%;height:100%}.flow-root.is-maximized .flow-row{align-items:stretch}.flow-group.maximized,.flow-card.maximized{width:100%;height:100%}.flow-group.hidden,.flow-card.hidden{display:none}.flow-root.is-mobile .flow-scroller{position:relative;overflow:clip}.flow-root.is-mobile .flow-field{inset:calc(var(--flow-dock-h) + var(--flow-gap) * 2) 0 var(--flow-gap);width:auto;min-width:0;height:auto;min-height:0;position:absolute;overflow:clip}.flow-root.is-mobile .flow-row{width:100%;height:100%;transform:translateX(calc(var(--flow-page,0) * -100% + var(--flow-drag,0px)));will-change:transform;flex-wrap:nowrap;align-items:stretch;gap:0;padding:0;transition:transform .28s cubic-bezier(.22,.61,.36,1);display:flex}.flow-root.is-mobile.flow-dragging .flow-row{transition:none}.flow-root.is-mobile .flow-group{flex:0 0 100%;min-width:0;margin:0}.flow-root.is-mobile .flow-resize-e,.flow-root.is-mobile .flow-resize-s,.flow-root.is-mobile .flow-resize-se{display:none}@media (prefers-reduced-motion:reduce){.flow-root.is-mobile .flow-row{transition:none}}.flow-push-modal-backdrop{z-index:1000;-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px);pointer-events:auto;background:#0000008c;justify-content:center;align-items:center;padding:24px;display:flex;position:fixed;inset:0}.flow-push-modal{border:1px solid var(--flow-border);text-align:center;background:#141414;border-radius:18px;flex-direction:column;align-items:center;gap:10px;width:min(360px,100%);padding:28px 24px;display:flex;box-shadow:0 20px 60px #0009}.flow-push-spinner{border:3px solid #ffffff26;border-top-color:var(--flow-fg);border-radius:50%;width:34px;height:34px;animation:.8s linear infinite flow-push-spin}@keyframes flow-push-spin{to{transform:rotate(360deg)}}.flow-push-check{color:#fff;background:#2e7d32;border-radius:50%;justify-content:center;align-items:center;width:34px;height:34px;font-size:20px;font-weight:700;display:flex}.flow-push-check-failed{background:var(--castle-danger-surface)}.flow-push-title{color:var(--flow-fg);font-size:16px;font-weight:600}.flow-push-sub{color:var(--flow-secondary);font-size:12px}.flow-push-url{overflow-wrap:anywhere;color:#7aa2ff;max-width:100%;font:13px ui-monospace,SFMono-Regular,Menlo,monospace;text-decoration:none}.flow-push-url:hover{text-decoration:underline}.flow-push-done{background:var(--flow-fg);color:var(--flow-gutter);cursor:pointer;border:none;border-radius:999px;margin-top:8px;padding:9px 24px;font-size:14px;font-weight:600}.flow-tabstrip{height:var(--flow-tab-h);-webkit-user-select:none;user-select:none;touch-action:none;flex-shrink:0}.flow-tabs-row{position:relative;overflow:hidden}.flow-tabs-row .castle-panel-tab{flex:0 auto;min-width:0}.flow-tabs-row .castle-panel-tab.is-pinned{flex:none;min-width:auto;max-width:none}.flow-tab-icon svg{width:var(--flow-icon-dock);height:var(--flow-icon-dock);pointer-events:none;-webkit-user-drag:none}.castle-panel-title svg,.castle-panel-title iconify-icon{pointer-events:none;-webkit-user-drag:none}.flow-tabs-row .castle-panel-tab-insert{z-index:3;height:auto;position:absolute;top:0;bottom:0}.castle-panel-tab-ghost,.castle-dock-segment-ghost,.flow-card-ghost{z-index:80;position:fixed}.flow-card-ghost{align-items:center;gap:var(--castle-space-base);font-family:var(--castle-font-display);font-size:var(--castle-text-size-base);white-space:nowrap;font-weight:700;line-height:1.5;display:inline-flex}.flow-card-ghost-count{color:var(--castle-text-muted)}.flow-tabstrip .castle-button{flex-shrink:0;align-self:center}.flow-tab-body{position:absolute;inset:0}.flow-tab-body.inactive{display:none}.flow-class-drawer{background:var(--castle-surface-2);border-right:1px solid var(--flow-border);flex-direction:column;flex:none;width:220px;min-height:0;padding:2px 4px 6px;display:flex;overflow:hidden}.flow-class-files{flex:auto;min-height:0;overflow-y:auto}.flow-class-files .fileBrowserBare,.flow-class-files .fileTree{flex:none;height:auto;overflow:visible}.flow-class-recent{border-bottom:1px solid var(--castle-border-1);margin-bottom:10px;padding-bottom:10px}.flow-class-section{color:var(--castle-text-muted);padding:5px 9px;font-size:14px}.flow-class-drawer .flow-view-segments{margin:4px 2px 8px}.flow-class-drawer-empty{color:var(--flow-muted);padding:10px 8px;font-size:12px}.flow-empty-editor{flex:auto;height:100%;min-height:0;display:flex}.flow-empty-editor .flow-class-drawer{flex:0 0 220px}.flow-empty-editor-msg{color:var(--flow-muted);background:var(--castle-surface-2);flex:auto;justify-content:center;align-items:center;font-size:13px;display:flex}.flow-tabstrip-mobile{grid-template-columns:calc(var(--castle-button-height-large) * 2 + var(--castle-space-small)) minmax(0, 1fr) calc(var(--castle-button-height-large) * 2 + var(--castle-space-small));cursor:default;align-items:center;display:grid}.flow-tabstrip-mobile .castle-panel-mobile-current{overflow:hidden}.flow-mobile-strip-left,.flow-mobile-strip-right{align-items:center;min-width:min-content;display:flex}.flow-mobile-strip-left{justify-content:flex-start}.flow-mobile-strip-right{justify-content:flex-end}.flow-tabstrip-mobile .castle-panel-header-actions{margin-left:0}.castle-panel-mobile-current .flow-tab-icon,.castle-panel-mobile-current .flow-tab-icon svg{width:var(--castle-button-icon-size-large);height:var(--castle-button-icon-size-large)}.flow-mobile-chevron{width:var(--castle-button-icon-size-large);height:var(--castle-button-icon-size-large);opacity:.6;flex-shrink:0;justify-content:center;align-items:center;display:inline-flex}.flow-mobile-chevron svg{width:var(--castle-button-icon-size-large);height:var(--castle-button-icon-size-large);display:block}.flow-mobile-switch-backdrop{z-index:900;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);pointer-events:auto;background:#0000008c;align-items:flex-end;display:flex;position:fixed;inset:0}.flow-mobile-switch{border-top:1px solid var(--flow-border);background:#141414;border-radius:16px 16px 0 0;flex-direction:column;width:100%;max-height:70vh;display:flex;overflow:hidden}.flow-mobile-switch-header{border-bottom:1px solid var(--flow-border);justify-content:space-between;align-items:center;padding:14px 16px;font-weight:600;display:flex}.flow-mobile-switch-close{color:var(--flow-secondary);cursor:pointer;background:0 0;border:none;font-size:22px;line-height:1}.flow-view-segments{background:var(--castle-surface-2);border-radius:8px;flex:none;gap:2px;margin:10px 16px 6px;padding:2px;display:flex}.flow-view-segment{color:var(--flow-secondary);font:inherit;cursor:pointer;background:0 0;border:none;border-radius:6px;flex:1 1 0;padding:7px 10px;font-size:13px;font-weight:600}.flow-view-segment.on{color:var(--flow-text,#eee);background:#282828}.flow-mobile-switch-list{background:var(--castle-surface-2);flex-direction:column;flex:auto;min-height:0;display:flex;overflow:hidden}.flow-mobile-switch-list .flow-class-files{padding:4px 6px 10px}.flow-card{flex-direction:row;flex:none;align-items:stretch;min-width:200px;min-height:0;display:flex;position:relative}.flow-card.pinned{box-shadow:0 6px 24px #00000073}.flow-card>.flow-group{flex:auto;min-width:0;height:100%}.flow-card.is-stacked{background:var(--castle-surface-2);overflow:visible}.flow-card-stack{border-radius:inherit;flex-direction:row;flex:auto;align-items:stretch;min-width:0;height:100%;min-height:0;display:flex;overflow:hidden}.flow-card-stack>.flow-group{background:0 0;border:0;border-radius:0;flex:auto;min-width:0;height:100%;min-height:0}.flow-card.is-dragging{opacity:.45}.flow-card.is-drop-target>.flow-group,.flow-card.is-drop-target.is-stacked{outline:1px solid var(--castle-border-4);outline-offset:-1px}.flow-rail{flex:0 0 calc(var(--flow-rail-w) + 1px);width:calc(var(--flow-rail-w) + 1px);border-right:1px solid var(--castle-border-1);background:var(--castle-surface-3);border-radius:var(--castle-radius-base) 0 0 var(--castle-radius-base);overscroll-behavior:none;scrollbar-width:none;flex-direction:column;display:flex;overflow:auto}.flow-rail::-webkit-scrollbar{display:none}.flow-rail-btn{justify-content:center;align-items:center;gap:var(--castle-space-base);width:var(--flow-rail-w);height:var(--flow-rail-w);padding:0 var(--castle-space-small);color:var(--castle-text-muted);touch-action:none;font-family:var(--castle-font-body);font-size:var(--castle-text-size-small);cursor:pointer;background:0 0;border:0;flex-direction:column;flex-shrink:0;line-height:1.2;display:flex;position:relative}.flow-rail-btn:hover{background:var(--castle-surface-4);color:var(--castle-text-secondary)}.flow-rail-btn.is-active,.flow-rail-btn.is-active:hover{background:var(--castle-surface-5);color:var(--castle-text-primary)}.flow-rail-btn.is-drag-origin{opacity:0;pointer-events:none;flex:0 0 0;gap:0;height:0;min-height:0;max-height:0;padding:0;overflow:hidden}.flow-rail-slot{flex:0 0 var(--flow-rail-w);width:var(--flow-rail-w);height:var(--flow-rail-w);color:var(--castle-text-primary);background:var(--castle-surface-6);pointer-events:none;justify-content:center;align-items:center;display:flex}.flow-rail-icon{font-size:var(--castle-button-icon-size);flex-shrink:0;display:inline-flex}.flow-rail-icon svg{width:var(--castle-button-icon-size);height:var(--castle-button-icon-size)}.flow-rail-btn span{text-overflow:ellipsis;white-space:nowrap;min-width:0;max-width:100%;overflow:hidden}.flow-splitter{top:var(--flow-tab-h);cursor:col-resize;touch-action:none;z-index:20;width:16px;position:absolute;bottom:0;right:-8px}.flow-root.is-fit .flow-scroller{overflow:hidden}.flow-root.is-fit .flow-field{width:100%;min-width:0;height:100%}.flow-root.is-fit .flow-row{width:100%;min-width:0;height:100%;min-height:0;padding-right:var(--flow-gap);align-items:stretch}.flow-root.is-fit .flow-card{width:auto;height:auto;min-width:var(--flow-card-min,200px);flex:1 1 0}
|