@rubytech/create-maxy 1.0.477 → 1.0.479

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/package.json +1 -1
  2. package/payload/platform/neo4j/schema.cypher +34 -6
  3. package/payload/platform/plugins/admin/PLUGIN.md +4 -1
  4. package/payload/platform/plugins/admin/mcp/dist/index.js +221 -1
  5. package/payload/platform/plugins/admin/mcp/dist/index.js.map +1 -1
  6. package/payload/platform/plugins/anthropic/PLUGIN.md +3 -2
  7. package/payload/platform/plugins/anthropic/references/console-api.md +186 -0
  8. package/payload/platform/plugins/anthropic/references/setup-guide.md +3 -3
  9. package/payload/platform/plugins/anthropic/skills/get-api-key/SKILL.md +89 -20
  10. package/payload/platform/plugins/memory/mcp/dist/index.js +13 -2
  11. package/payload/platform/plugins/memory/mcp/dist/index.js.map +1 -1
  12. package/payload/platform/plugins/memory/mcp/dist/tools/profile-delete.d.ts +1 -0
  13. package/payload/platform/plugins/memory/mcp/dist/tools/profile-delete.d.ts.map +1 -1
  14. package/payload/platform/plugins/memory/mcp/dist/tools/profile-delete.js +3 -3
  15. package/payload/platform/plugins/memory/mcp/dist/tools/profile-delete.js.map +1 -1
  16. package/payload/platform/plugins/memory/mcp/dist/tools/profile-read.d.ts +1 -0
  17. package/payload/platform/plugins/memory/mcp/dist/tools/profile-read.d.ts.map +1 -1
  18. package/payload/platform/plugins/memory/mcp/dist/tools/profile-read.js +3 -2
  19. package/payload/platform/plugins/memory/mcp/dist/tools/profile-read.js.map +1 -1
  20. package/payload/platform/plugins/memory/mcp/dist/tools/profile-update.d.ts +1 -0
  21. package/payload/platform/plugins/memory/mcp/dist/tools/profile-update.d.ts.map +1 -1
  22. package/payload/platform/plugins/memory/mcp/dist/tools/profile-update.js +14 -11
  23. package/payload/platform/plugins/memory/mcp/dist/tools/profile-update.js.map +1 -1
  24. package/payload/platform/scripts/seed-neo4j.sh +101 -0
  25. package/payload/platform/templates/account.json +2 -1
  26. package/payload/platform/templates/agents/admin/IDENTITY.md +10 -0
  27. package/payload/server/public/assets/ChatInput-D_Am-NZI.css +1 -0
  28. package/payload/server/public/assets/{admin-DpmnCxNk.js → admin-ZfkvBfx_.js} +60 -60
  29. package/payload/server/public/assets/{public-BBxDqQvQ.js → public-C0LOoku3.js} +1 -1
  30. package/payload/server/public/index.html +3 -3
  31. package/payload/server/public/public.html +3 -3
  32. package/payload/server/server.js +252 -126
  33. package/payload/server/public/assets/ChatInput-sDYraTun.css +0 -1
  34. /package/payload/server/public/assets/{ChatInput-DZ0j0Gdp.js → ChatInput-B2MUVSm4.js} +0 -0
@@ -3,11 +3,11 @@ import { getSession } from "../lib/neo4j.js";
3
3
  const INJECTION_THRESHOLD = 0.4;
4
4
  const MAX_SUMMARY_PREFERENCES = 30;
5
5
  export async function profileRead(params) {
6
- const { accountId, detail } = params;
6
+ const { accountId, userId, detail } = params;
7
7
  const session = getSession();
8
8
  try {
9
9
  const result = await session.run(`
10
- OPTIONAL MATCH (up:UserProfile {accountId: $accountId})
10
+ OPTIONAL MATCH (up:UserProfile {accountId: $accountId, userId: $userId})
11
11
  OPTIONAL MATCH (up)-[:HAS_PREFERENCE]->(pref:Preference)
12
12
  WHERE pref.confidence >= $threshold
13
13
  WITH up, pref
@@ -17,6 +17,7 @@ export async function profileRead(params) {
17
17
  RETURN up, prefs
18
18
  `, {
19
19
  accountId,
20
+ userId,
20
21
  threshold: INJECTION_THRESHOLD,
21
22
  limit: MAX_SUMMARY_PREFERENCES,
22
23
  });
@@ -1 +1 @@
1
- {"version":3,"file":"profile-read.js","sourceRoot":"","sources":["../../src/tools/profile-read.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,kEAAkE;AAClE,MAAM,mBAAmB,GAAG,GAAG,CAAC;AAChC,MAAM,uBAAuB,GAAG,EAAE,CAAC;AA6CnC,MAAM,CAAC,KAAK,UAAU,WAAW,CAC/B,M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B,CAAC;AAED,SAAS,eAAe,CAAC,UAAkB;IACzC,IAAI,UAAU,IAAI,GAAG;QAAE,OAAO,QAAQ,CAAC;IACvC,IAAI,UAAU,IAAI,GAAG;QAAE,OAAO,UAAU,CAAC;IACzC,IAAI,UAAU,IAAI,GAAG;QAAE,OAAO,QAAQ,CAAC;IACvC,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -1,5 +1,6 @@
1
1
  interface ProfileUpdateParams {
2
2
  accountId: string;
3
+ userId: string;
3
4
  category: string;
4
5
  key: string;
5
6
  value: string;
@@ -1 +1 @@
1
- {"version":3,"file":"profile-update.d.ts","sourceRoot":"","sources":["../../src/tools/profile-update.ts"],"names":[],"mappings":"AAoBA,UAAU,mBAAmB;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,UAAU,GAAG,aAAa,CAAC;IACpC,IAAI,CAAC,EAAE,WAAW,GAAG,QAAQ,GAAG,YAAY,GAAG,OAAO,CAAC;IACvD,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACxC,iFAAiF;IACjF,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;CAC3B;AAED,UAAU,mBAAmB;IAC3B,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,SAAS,GAAG,YAAY,GAAG,SAAS,GAAG,cAAc,GAAG,QAAQ,CAAC;IACzE,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,wBAAsB,aAAa,CACjC,MAAM,EAAE,mBAAmB,GAC1B,OAAO,CAAC,mBAAmB,CAAC,CAkN9B"}
1
+ {"version":3,"file":"profile-update.d.ts","sourceRoot":"","sources":["../../src/tools/profile-update.ts"],"names":[],"mappings":"AAoBA,UAAU,mBAAmB;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,UAAU,GAAG,aAAa,CAAC;IACpC,IAAI,CAAC,EAAE,WAAW,GAAG,QAAQ,GAAG,YAAY,GAAG,OAAO,CAAC;IACvD,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACxC,iFAAiF;IACjF,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;CAC3B;AAED,UAAU,mBAAmB;IAC3B,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,SAAS,GAAG,YAAY,GAAG,SAAS,GAAG,cAAc,GAAG,QAAQ,CAAC;IACzE,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,wBAAsB,aAAa,CACjC,MAAM,EAAE,mBAAmB,GAC1B,OAAO,CAAC,mBAAmB,CAAC,CAsN9B"}
@@ -15,7 +15,7 @@ const VALID_CATEGORIES = new Set([
15
15
  ]);
16
16
  const VALID_MODES = new Set(["reinforce", "update", "contradict", "merge"]);
17
17
  export async function profileUpdate(params) {
18
- const { accountId, category, key, value, source = "behavioural", mode = "reinforce", conversationId, profileFields, mergeSourceIds, } = params;
18
+ const { accountId, userId, category, key, value, source = "behavioural", mode = "reinforce", conversationId, profileFields, mergeSourceIds, } = params;
19
19
  if (!VALID_CATEGORIES.has(category)) {
20
20
  throw new Error(`Invalid category "${category}". Must be one of: ${[...VALID_CATEGORIES].join(", ")}`);
21
21
  }
@@ -45,6 +45,7 @@ export async function profileUpdate(params) {
45
45
  if (profileFields && Object.keys(profileFields).length > 0) {
46
46
  const restricted = new Set([
47
47
  "accountId",
48
+ "userId",
48
49
  "embedding",
49
50
  "createdAt",
50
51
  "profileVersion",
@@ -56,20 +57,20 @@ export async function profileUpdate(params) {
56
57
  }
57
58
  if (Object.keys(safeFields).length > 0) {
58
59
  await session.run(`
59
- MATCH (up:UserProfile {accountId: $accountId})
60
+ MATCH (up:UserProfile {accountId: $accountId, userId: $userId})
60
61
  SET up += $fields, up.updatedAt = $now
61
- `, { accountId, fields: safeFields, now });
62
+ `, { accountId, userId, fields: safeFields, now });
62
63
  }
63
64
  }
64
65
  // Handle merge mode — combines multiple preferences into one
65
66
  if (mode === "merge") {
66
- return await executeMerge(session, accountId, category, key, value, source, embedding, mergeSourceIds, now);
67
+ return await executeMerge(session, accountId, userId, category, key, value, source, embedding, mergeSourceIds, now);
67
68
  }
68
69
  // Check if preference already exists for this account+category+key
69
70
  const existingResult = await session.run(`
70
- MATCH (up:UserProfile {accountId: $accountId})-[:HAS_PREFERENCE]->(pref:Preference {category: $category, key: $key})
71
+ MATCH (up:UserProfile {accountId: $accountId, userId: $userId})-[:HAS_PREFERENCE]->(pref:Preference {category: $category, key: $key})
71
72
  RETURN pref.preferenceId AS preferenceId, pref.confidence AS confidence
72
- `, { accountId, category, key });
73
+ `, { accountId, userId, category, key });
73
74
  if (existingResult.records.length > 0) {
74
75
  // Existing preference — apply mode
75
76
  const existingId = existingResult.records[0].get("preferenceId");
@@ -129,6 +130,7 @@ export async function profileUpdate(params) {
129
130
  const createProps = {
130
131
  preferenceId,
131
132
  accountId,
133
+ userId,
132
134
  category,
133
135
  key,
134
136
  value,
@@ -142,10 +144,10 @@ export async function profileUpdate(params) {
142
144
  if (embedding)
143
145
  createProps.embedding = embedding;
144
146
  await session.run(`
145
- MATCH (up:UserProfile {accountId: $accountId})
147
+ MATCH (up:UserProfile {accountId: $accountId, userId: $userId})
146
148
  CREATE (pref:Preference $props)
147
149
  CREATE (up)-[:HAS_PREFERENCE]->(pref)
148
- `, { accountId, props: createProps });
150
+ `, { accountId, userId, props: createProps });
149
151
  // Add evidence link if conversationId provided
150
152
  if (conversationId) {
151
153
  await session.run(`
@@ -164,7 +166,7 @@ export async function profileUpdate(params) {
164
166
  await session.close();
165
167
  }
166
168
  }
167
- async function executeMerge(session, accountId, category, key, value, source, embedding, mergeSourceIds, now) {
169
+ async function executeMerge(session, accountId, userId, category, key, value, source, embedding, mergeSourceIds, now) {
168
170
  const txc = session.beginTransaction();
169
171
  try {
170
172
  // Collect evidence links and max confidence from source preferences
@@ -188,6 +190,7 @@ async function executeMerge(session, accountId, category, key, value, source, em
188
190
  const mergedProps = {
189
191
  preferenceId,
190
192
  accountId,
193
+ userId,
191
194
  category,
192
195
  key,
193
196
  value,
@@ -201,10 +204,10 @@ async function executeMerge(session, accountId, category, key, value, source, em
201
204
  if (embedding)
202
205
  mergedProps.embedding = embedding;
203
206
  await txc.run(`
204
- MATCH (up:UserProfile {accountId: $accountId})
207
+ MATCH (up:UserProfile {accountId: $accountId, userId: $userId})
205
208
  CREATE (pref:Preference $props)
206
209
  CREATE (up)-[:HAS_PREFERENCE]->(pref)
207
- `, { accountId, props: mergedProps });
210
+ `, { accountId, userId, props: mergedProps });
208
211
  // Transfer evidence links to the merged preference
209
212
  for (const convId of allConvIds) {
210
213
  await txc.run(`
@@ -1 +1 @@
1
- {"version":3,"file":"profile-update.js","sourceRoot":"","sources":["../../src/tools/profile-update.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,kEAAkE;AAClE,MAAM,kBAAkB,GAAG,GAAG,CAAC;AAC/B,MAAM,uBAAuB,GAAG,IAAI,CAAC;AACrC,MAAM,uBAAuB,GAAG,GAAG,CAAC;AAEpC,MAAM,gBAAgB,GAAG,IAAI,GAAG,CAAC;IAC/B,eAAe;IACf,YAAY;IACZ,UAAU;IACV,UAAU;IACV,SA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,CAAC,GAAG,CACX;;;;OAIC,EACD,EAAE,SAAS,EAAE,cAAc,EAAE,SAAS,EAAE,CACzC,CAAC;QAEF,MAAM,GAAG,CAAC,MAAM,EAAE,CAAC;QAEnB,OAAO;YACL,YAAY;YACZ,MAAM,EAAE,QAAQ;YAChB,UAAU,EAAE,aAAa;YACzB,WAAW,EAAE,aAAa,CAAC,OAAO,CAAC,MAAM;SAC1C,CAAC;IACJ,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,MAAM,GAAG,CAAC,QAAQ,EAAE,CAAC;QACrB,MAAM,GAAG,CAAC;IACZ,CAAC;AACH,CAAC"}
@@ -222,6 +222,75 @@ fi
222
222
 
223
223
  echo " Account $ACCOUNT_ID at $ACCOUNT_DIR"
224
224
 
225
+ # ------------------------------------------------------------------
226
+ # 1b. Create first admin user (migration from .admin-pin)
227
+ # ------------------------------------------------------------------
228
+
229
+ CONFIG_DIR="$PROJECT_DIR/config"
230
+ USERS_FILE="$CONFIG_DIR/users.json"
231
+
232
+ # Resolve the brand-specific config directory for .admin-pin location.
233
+ # Mirrors the logic in platform/ui/app/lib/paths.ts.
234
+ _CONFIG_DIR_NAME=".maxy"
235
+ if [ -f "$CONFIG_DIR/brand.json" ]; then
236
+ _BRAND_CFG_DIR=$(python3 -c "import json; print(json.load(open('$CONFIG_DIR/brand.json')).get('configDir',''))" 2>/dev/null || true)
237
+ [ -n "$_BRAND_CFG_DIR" ] && _CONFIG_DIR_NAME="$_BRAND_CFG_DIR"
238
+ fi
239
+ ADMIN_PIN_FILE="$HOME/$_CONFIG_DIR_NAME/.admin-pin"
240
+
241
+ # Only create users.json if it doesn't exist AND .admin-pin exists (migration case).
242
+ # Fresh installs: no .admin-pin yet (set during onboarding). The session route falls
243
+ # back to .admin-pin when users.json is absent — no migration needed until next seed.
244
+ if [ ! -f "$USERS_FILE" ] && [ -f "$ADMIN_PIN_FILE" ]; then
245
+ USER_ID="$(cat /proc/sys/kernel/random/uuid 2>/dev/null || python3 -c 'import uuid; print(uuid.uuid4())')"
246
+ PIN_HASH="$(cat "$ADMIN_PIN_FILE")"
247
+
248
+ # Create users.json with the first user entry.
249
+ # PINs are stored as SHA-256 hashes — same format as .admin-pin.
250
+ cat > "$USERS_FILE" << USERS_EOF
251
+ [{"userId":"$USER_ID","name":"Owner","pin":"$PIN_HASH"}]
252
+ USERS_EOF
253
+ echo " [seed] created initial user: userId=$USER_ID"
254
+
255
+ # Add the user to account.json's admins array.
256
+ # The template includes "admins": [] — populate it with the owner entry.
257
+ if [ -f "$ACCOUNT_DIR/account.json" ]; then
258
+ python3 -c "
259
+ import json, sys
260
+ with open('$ACCOUNT_DIR/account.json', 'r') as f:
261
+ config = json.load(f)
262
+ config.setdefault('admins', [])
263
+ if not any(a.get('userId') == '$USER_ID' for a in config['admins']):
264
+ config['admins'].append({'userId': '$USER_ID', 'role': 'owner'})
265
+ with open('$ACCOUNT_DIR/account.json', 'w') as f:
266
+ json.dump(config, f, indent=2)
267
+ f.write('\n')
268
+ "
269
+ echo " Added userId=$USER_ID as owner to account.json admins"
270
+ fi
271
+ elif [ -f "$USERS_FILE" ]; then
272
+ # Re-run: users.json exists. Read the first user's ID for Neo4j seeding.
273
+ USER_ID=$(python3 -c "import json; print(json.load(open('$USERS_FILE'))[0]['userId'])" 2>/dev/null || true)
274
+ [ -n "$USER_ID" ] && echo " Existing users.json found, userId=$USER_ID"
275
+
276
+ # Backfill admins in account.json if missing (existing accounts pre-Task 248).
277
+ if [ -f "$ACCOUNT_DIR/account.json" ] && ! grep -q '"admins"' "$ACCOUNT_DIR/account.json"; then
278
+ python3 -c "
279
+ import json
280
+ with open('$ACCOUNT_DIR/account.json', 'r') as f:
281
+ config = json.load(f)
282
+ config['admins'] = [{'userId': '$USER_ID', 'role': 'owner'}]
283
+ with open('$ACCOUNT_DIR/account.json', 'w') as f:
284
+ json.dump(config, f, indent=2)
285
+ f.write('\n')
286
+ "
287
+ echo " Backfilled admins array in account.json"
288
+ fi
289
+ else
290
+ echo " No .admin-pin found — skipping users.json creation (fresh install)"
291
+ USER_ID=""
292
+ fi
293
+
225
294
  # ------------------------------------------------------------------
226
295
  # 2. Apply Neo4j schema (constraints + indexes only)
227
296
  # ------------------------------------------------------------------
@@ -232,8 +301,40 @@ fi
232
301
 
233
302
  echo "==> Connecting to Neo4j at $NEO4J_URI as $NEO4J_USER"
234
303
 
304
+ # Migration: drop single-key UserProfile constraint (replaced by composite
305
+ # (accountId, userId) in Task 249). Also drop the old preference_category
306
+ # index — replaced by (accountId, userId, category) composite.
307
+ echo "==> Migrating schema: dropping single-key UserProfile constraint..."
308
+ "$CYPHER_SHELL" -u "$NEO4J_USER" -p "$NEO4J_PASSWORD" -a "$NEO4J_URI" << 'MIGRATE_EOF'
309
+ DROP CONSTRAINT user_profile_account_unique IF EXISTS;
310
+ DROP INDEX preference_category IF EXISTS;
311
+ MIGRATE_EOF
312
+
235
313
  echo "==> Applying schema (constraints, indexes, vector indexes)..."
236
314
  "$CYPHER_SHELL" -u "$NEO4J_USER" -p "$NEO4J_PASSWORD" -a "$NEO4J_URI" \
237
315
  -f "$NEO4J_DIR/schema.cypher"
238
316
 
317
+ # ------------------------------------------------------------------
318
+ # 3. Create AdminUser node + ADMIN_OF relationship
319
+ # ------------------------------------------------------------------
320
+
321
+ if [ -n "${USER_ID:-}" ]; then
322
+ # Escape single quotes for Cypher string interpolation (e.g. O'Brien → O''Brien).
323
+ USER_NAME=$(python3 -c "import json; n=json.load(open('$USERS_FILE'))[0]['name']; print(n.replace(\"'\",\"''\"))" 2>/dev/null || echo "Owner")
324
+ CREATED_AT=$(date -u +%Y-%m-%dT%H:%M:%SZ)
325
+
326
+ echo "==> Creating AdminUser node for userId=$USER_ID"
327
+ "$CYPHER_SHELL" -u "$NEO4J_USER" -p "$NEO4J_PASSWORD" -a "$NEO4J_URI" << CYPHER_EOF
328
+ MERGE (au:AdminUser {userId: '$USER_ID'})
329
+ ON CREATE SET au.name = '$USER_NAME', au.createdAt = '$CREATED_AT'
330
+ ON MATCH SET au.name = '$USER_NAME'
331
+ WITH au
332
+ MATCH (b:LocalBusiness {accountId: '$ACCOUNT_ID'})
333
+ MERGE (au)-[r:ADMIN_OF]->(b)
334
+ ON CREATE SET r.role = 'owner', r.grantedAt = '$CREATED_AT'
335
+ RETURN au.userId, b.accountId;
336
+ CYPHER_EOF
337
+ echo " AdminUser node created/updated"
338
+ fi
339
+
239
340
  echo " Done."
@@ -9,5 +9,6 @@
9
9
  "contextMode": "claude-code",
10
10
  "enabledPlugins": [],
11
11
  "purchasedPlugins": [],
12
- "defaultAgent": ""
12
+ "defaultAgent": "",
13
+ "admins": []
13
14
  }
@@ -78,6 +78,16 @@ After onboarding, check for purchased premium plugins that have not yet been del
78
78
 
79
79
  Any request to create, edit, clone, list, preview, or delete a public agent must go through the public agent management skill. Load it via `plugin-read` (find its path in the manifest under `admin`). Do not duplicate or improvise agent operations outside the skill. Public agents are optional — the platform works without any.
80
80
 
81
+ ## Admin User Management
82
+
83
+ The owner can manage who has admin access to this account through conversation. Three tools are available:
84
+
85
+ - **`admin-add`** — Add a new admin to this account. Requires a name; optionally accepts a specific PIN. If no PIN is provided, a unique 4-digit PIN is generated. The tool returns the PIN so the owner can share it with the new admin. PINs must be unique across all users on the device.
86
+ - **`admin-remove`** — Remove an admin from this account. Requires the userId (use `admin-list` to find it). The last admin on the account cannot be removed. The user's device-level entry is retained — they may still administer other accounts.
87
+ - **`admin-list`** — List all admins for this account with their names and roles.
88
+
89
+ Only the owner (or any current admin) can manage admins. Role is a label only — "owner" marks the original creator, "admin" marks subsequent additions. No capability differences are enforced.
90
+
81
91
  ## Plugin and Account Management
82
92
 
83
93
  Plugin installation, removal, and account settings changes are managed via conversation. Load the relevant skill via `plugin-read` (find its path in the manifest under `admin`).
@@ -0,0 +1 @@
1
+ @font-face{font-family:Cormorant;font-style:normal;font-display:swap;font-weight:300;src:url(/assets/cormorant-cyrillic-ext-300-normal-BXl3lXsi.woff2)format("woff2"),url(/assets/cormorant-cyrillic-ext-300-normal-DmxSOTe3.woff)format("woff");unicode-range:U+460-52F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:Cormorant;font-style:normal;font-display:swap;font-weight:300;src:url(/assets/cormorant-cyrillic-300-normal-DFUoTmrg.woff2)format("woff2"),url(/assets/cormorant-cyrillic-300-normal-CzPHYadL.woff)format("woff");unicode-range:U+301,U+400-45F,U+490-491,U+4B0-4B1,U+2116}@font-face{font-family:Cormorant;font-style:normal;font-display:swap;font-weight:300;src:url(/assets/cormorant-vietnamese-300-normal-BVqIp_mg.woff2)format("woff2"),url(/assets/cormorant-vietnamese-300-normal-CEMS9Pw-.woff)format("woff");unicode-range:U+102-103,U+110-111,U+128-129,U+168-169,U+1A0-1A1,U+1AF-1B0,U+300-301,U+303-304,U+308-309,U+323,U+329,U+1EA0-1EF9,U+20AB}@font-face{font-family:Cormorant;font-style:normal;font-display:swap;font-weight:300;src:url(/assets/cormorant-latin-ext-300-normal-De3D72RL.woff2)format("woff2"),url(/assets/cormorant-latin-ext-300-normal-CkiUx0UG.woff)format("woff");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Cormorant;font-style:normal;font-display:swap;font-weight:300;src:url(/assets/cormorant-latin-300-normal-CJ5dfen0.woff2)format("woff2"),url(/assets/cormorant-latin-300-normal-DQZObO_3.woff)format("woff");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Cormorant;font-style:normal;font-display:swap;font-weight:400;src:url(/assets/cormorant-cyrillic-ext-400-normal-BlcaxZtM.woff2)format("woff2"),url(/assets/cormorant-cyrillic-ext-400-normal-Bgrpe4p1.woff)format("woff");unicode-range:U+460-52F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:Cormorant;font-style:normal;font-display:swap;font-weight:400;src:url(/assets/cormorant-cyrillic-400-normal-C8QS47vb.woff2)format("woff2"),url(/assets/cormorant-cyrillic-400-normal-D3EsxgFc.woff)format("woff");unicode-range:U+301,U+400-45F,U+490-491,U+4B0-4B1,U+2116}@font-face{font-family:Cormorant;font-style:normal;font-display:swap;font-weight:400;src:url(/assets/cormorant-vietnamese-400-normal-C-RiYxEf.woff2)format("woff2"),url(/assets/cormorant-vietnamese-400-normal-DmUuA7Y2.woff)format("woff");unicode-range:U+102-103,U+110-111,U+128-129,U+168-169,U+1A0-1A1,U+1AF-1B0,U+300-301,U+303-304,U+308-309,U+323,U+329,U+1EA0-1EF9,U+20AB}@font-face{font-family:Cormorant;font-style:normal;font-display:swap;font-weight:400;src:url(/assets/cormorant-latin-ext-400-normal-DuQ88yz3.woff2)format("woff2"),url(/assets/cormorant-latin-ext-400-normal-DuXFa1Dr.woff)format("woff");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Cormorant;font-style:normal;font-display:swap;font-weight:400;src:url(/assets/cormorant-latin-400-normal-BGH8Vunh.woff2)format("woff2"),url(/assets/cormorant-latin-400-normal-C3_-2Ua-.woff)format("woff");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Cormorant;font-style:normal;font-display:swap;font-weight:500;src:url(/assets/cormorant-cyrillic-ext-500-normal-pZw22qtS.woff2)format("woff2"),url(/assets/cormorant-cyrillic-ext-500-normal-CdQuyvtc.woff)format("woff");unicode-range:U+460-52F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:Cormorant;font-style:normal;font-display:swap;font-weight:500;src:url(/assets/cormorant-cyrillic-500-normal-BLlg2W5x.woff2)format("woff2"),url(/assets/cormorant-cyrillic-500-normal-B7dJQtg-.woff)format("woff");unicode-range:U+301,U+400-45F,U+490-491,U+4B0-4B1,U+2116}@font-face{font-family:Cormorant;font-style:normal;font-display:swap;font-weight:500;src:url(/assets/cormorant-vietnamese-500-normal-DsPuwQHi.woff2)format("woff2"),url(/assets/cormorant-vietnamese-500-normal-tGBW_mI7.woff)format("woff");unicode-range:U+102-103,U+110-111,U+128-129,U+168-169,U+1A0-1A1,U+1AF-1B0,U+300-301,U+303-304,U+308-309,U+323,U+329,U+1EA0-1EF9,U+20AB}@font-face{font-family:Cormorant;font-style:normal;font-display:swap;font-weight:500;src:url(/assets/cormorant-latin-ext-500-normal-AH9qog1s.woff2)format("woff2"),url(/assets/cormorant-latin-ext-500-normal-DAuUCO41.woff)format("woff");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Cormorant;font-style:normal;font-display:swap;font-weight:500;src:url(/assets/cormorant-latin-500-normal-EBdSCOD3.woff2)format("woff2"),url(/assets/cormorant-latin-500-normal-Dj3SQ6fR.woff)format("woff");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:DM Sans;font-style:normal;font-display:swap;font-weight:400;src:url(/assets/dm-sans-latin-ext-400-normal-BtiwyxMk.woff2)format("woff2"),url(/assets/dm-sans-latin-ext-400-normal-BjWJ59Pq.woff)format("woff");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:DM Sans;font-style:normal;font-display:swap;font-weight:400;src:url(/assets/dm-sans-latin-400-normal-CW0RaeGs.woff2)format("woff2"),url(/assets/dm-sans-latin-400-normal-BwCSEQnW.woff)format("woff");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:DM Sans;font-style:normal;font-display:swap;font-weight:500;src:url(/assets/dm-sans-latin-ext-500-normal-BJfUCQsA.woff2)format("woff2"),url(/assets/dm-sans-latin-ext-500-normal-DR84L5F-.woff)format("woff");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:DM Sans;font-style:normal;font-display:swap;font-weight:500;src:url(/assets/dm-sans-latin-500-normal-B9HHJjqV.woff2)format("woff2"),url(/assets/dm-sans-latin-500-normal-Dr3UlScf.woff)format("woff");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}*,:before,:after{box-sizing:border-box;margin:0;padding:0}:root{--bg:#fafaf8;--bg-chat:#fff;--surface:#f5f2ed;--surface-cool:#eef1f4;--text:#1a1a1a;--text-secondary:#6b6b6b;--text-tertiary:#9a9a9a;--border:#0000000f;--border-strong:#0000001a;--sage:#7c8c72;--sage-hover:#6a7a62;--sage-subtle:#7c8c7214;--sage-glow:#7c8c7226;--maxy-bubble:#f5f2ed;--visitor-bubble:#e8ecf0;--shadow-sm:0 1px 2px #0000000a;--shadow-md:0 2px 8px #0000000f;--shadow-lg:0 4px 16px #00000014;--radius-sm:6px;--radius-md:12px;--radius-lg:20px;--radius-full:9999px;--danger:#b44;--danger-hover:#c44;--accent:#e8e8e8;--surface-hover:#ffffff0d;--font-display:"Cormorant", Georgia, serif;--font-body:"DM Sans", -apple-system, BlinkMacSystemFont, sans-serif}html{scroll-behavior:smooth;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}body{font-family:var(--font-body);color:var(--text);background:var(--bg);font-size:16px;line-height:1.6;overflow-x:hidden}a{color:var(--sage);text-decoration:none;transition:color .2s}a:hover{color:var(--sage-hover)}.chat-page{flex-direction:column;max-width:800px;height:100dvh;margin:0 auto;padding:0 20px;display:flex}.chat-header{text-align:center;flex-shrink:0;padding:48px 0 24px;position:relative}.chat-header-select{color:var(--text-tertiary);cursor:pointer;border-radius:var(--radius-sm);background:0 0;border:none;padding:6px;transition:color .15s,background .15s;position:absolute;top:16px;right:16px}.chat-header-select:hover{color:var(--text);background:var(--hover)}.chat-logo{object-fit:contain;width:auto;height:64px;margin-bottom:16px}.chat-logo--circle{object-fit:cover;border-radius:50%;width:64px;height:64px}.chat-logo--rounded{object-fit:cover;border-radius:12px}.chat-tagline{font-family:var(--font-display);color:var(--text);letter-spacing:-.01em;margin-bottom:12px;font-size:clamp(28px,5vw,42px);font-weight:300;line-height:1.2}.chat-intro{color:var(--text-secondary);margin:0 0 12px;font-size:15px;line-height:1.6}.chat-trust{color:var(--text-tertiary);justify-content:center;align-items:center;gap:8px;font-size:13px;display:flex}.chat-trust-sep{opacity:.4}.chat-messages-wrap{flex:1;min-height:0;position:relative}@keyframes scrollBounce{0%,to{transform:translate(-50%)translateY(0)}40%{transform:translate(-50%)translateY(4px)}}.scroll-to-bottom{background:var(--bg);border:1px solid var(--border-strong);cursor:pointer;width:32px;height:32px;color:var(--text-secondary);opacity:.5;z-index:10;border-radius:50%;justify-content:center;align-items:center;transition:opacity .15s,color .15s,box-shadow .15s;animation:1.4s ease-in-out infinite scrollBounce;display:flex;position:absolute;bottom:12px;left:50%;transform:translate(-50%)}.scroll-to-bottom:hover{color:var(--sage);opacity:1;animation:none;box-shadow:0 2px 8px #00000014}.chat-messages{scrollbar-width:thin;scrollbar-color:var(--border-strong) transparent;flex-direction:column;gap:12px;height:100%;padding:16px 0;display:flex;overflow-y:auto}.chat-messages::-webkit-scrollbar{width:4px}.chat-messages::-webkit-scrollbar-track{background:0 0}.chat-messages::-webkit-scrollbar-thumb{background:var(--border-strong);border-radius:var(--radius-full)}.session-error{text-align:center;color:var(--text-secondary);flex:1;justify-content:center;align-items:center;padding:2rem;font-size:.95rem;line-height:1.5;display:flex}.idle-tips{flex-direction:column;justify-content:center;align-items:center;gap:16px;height:100%;padding:2rem;animation:.3s ease-out idle-tips-in;display:flex}@keyframes idle-tips-in{0%{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}.idle-tips-hint{color:var(--text-secondary);font-size:.95rem}.idle-tips-chips{flex-wrap:wrap;justify-content:center;gap:8px;display:flex}.idle-tip-chip{font-family:var(--font-body);border:1px solid var(--border-strong);border-radius:var(--radius-full);color:var(--text-secondary);cursor:pointer;background:0 0;padding:8px 16px;font-size:.85rem;transition:border-color .15s,color .15s,background .15s}.idle-tip-chip:hover,.idle-tip-chip:focus-visible{border-color:var(--sage);color:var(--sage);background:var(--sage-subtle)}.message-historical{opacity:.6}.resume-divider{color:var(--text-secondary);text-transform:uppercase;letter-spacing:.05em;align-items:center;gap:12px;padding:12px 16px;font-size:.75rem;display:flex}.resume-divider:before,.resume-divider:after{content:"";background:var(--border-default);flex:1;height:1px}body[data-drag-popout-active] .chat-messages{outline:2px dashed var(--sage);outline-offset:-2px;border-radius:8px;transition:outline-color .15s}.message{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;touch-action:manipulation;animation:.3s ease-out messageIn;display:flex;position:relative}.admin-page .message,.chat-page .message{-webkit-user-select:text;user-select:text;-webkit-touch-callout:default}.message.maxy{flex-direction:column;align-items:flex-start}.message.visitor{justify-content:flex-end}.bubble{border-radius:var(--radius-lg);word-wrap:break-word;white-space:pre-wrap;max-width:85%;padding:12px 16px;font-size:15px;line-height:1.55;position:relative}.maxy-content-wrap{width:100%;min-width:0;position:relative}.message.maxy .bubble{background:var(--maxy-bubble);color:var(--text);border-bottom-left-radius:var(--radius-sm)}.message.visitor .bubble{background:var(--visitor-bubble);color:var(--text);border-bottom-right-radius:var(--radius-sm)}.bubble-content{position:relative}.bubble-content.clamped{max-height:4.65em;overflow:hidden}.bubble-content.clamped.overflowing:after{content:"";background:linear-gradient(to bottom, transparent, var(--visitor-bubble));pointer-events:none;height:1.55em;position:absolute;bottom:0;left:0;right:0}.bubble-expand{justify-content:center;padding-top:4px;display:flex}.bubble-expand .btn{transition:background .15s,opacity .15s,color .15s,transform .2s}.bubble-expand .btn.expanded{transform:rotate(180deg)}.typing-indicator{align-items:center;gap:4px;padding:14px 18px;display:flex}.typing-dot{background:var(--text-tertiary);border-radius:50%;width:6px;height:6px;animation:1.4s ease-in-out infinite typingPulse}.typing-dot:nth-child(2){animation-delay:.2s}.typing-dot:nth-child(3){animation-delay:.4s}.chat-suggestions{flex-wrap:wrap;gap:8px;padding:4px 0 8px;animation:.3s ease-out messageIn;display:flex}.chat-input-area{flex-shrink:0;padding:16px 0 24px}.chat-actions{align-items:center;gap:16px;padding:8px 4px 0;display:flex;position:relative}.chat-action{font-family:var(--font-body);color:var(--text-tertiary);cursor:pointer;background:0 0;border:none;align-items:center;gap:6px;padding:0;font-size:12px;transition:color .15s;display:inline-flex}.chat-action:hover{color:var(--text-secondary)}.burger-trigger{color:var(--text-tertiary);cursor:pointer;background:0 0;border:none;padding:2px;transition:color .15s;display:none}.burger-trigger:hover{color:var(--text-secondary)}.actions-menu-items{display:contents}.chat-resize-handle{cursor:row-resize;touch-action:none;-webkit-user-select:none;user-select:none;justify-content:center;align-items:center;height:12px;display:flex}.chat-resize-handle-bar{background:var(--border-strong);opacity:0;border-radius:2px;width:36px;height:3px;transition:opacity .15s}.chat-resize-handle:hover .chat-resize-handle-bar{opacity:1}.chat-form{background:var(--bg-chat);border:1px solid var(--border-strong);border-radius:var(--radius-full);align-items:end;gap:8px;padding:6px 6px 6px 20px;transition:border-color .2s,box-shadow .2s,border-radius .2s;display:flex}.chat-form[data-expanded=true]{border-radius:var(--radius-lg)}.chat-form>.btn--icon{margin:10px 0}.chat-form:focus-within{box-shadow:0 0 0 3px var(--sage-subtle);border-color:#7c8c724d}.chat-input{min-width:0;font-family:var(--font-body);color:var(--text);resize:none;word-wrap:break-word;background:0 0;border:none;outline:none;flex:1;padding-block:8px;font-size:15px;line-height:1.4;overflow-y:hidden}.chat-input::placeholder{color:var(--text-tertiary)}.chat-footer{text-align:center;flex-shrink:0;padding:0 0 20px}.chat-footer a{color:var(--text-tertiary);font-size:13px;transition:color .2s}.chat-footer a:hover{color:var(--sage)}.auth-retry-link{font-family:var(--font-body);color:var(--text-tertiary);margin-top:12px;font-size:13px;text-decoration:none}.auth-retry-link:hover{color:var(--sage)}.gate-wrap{flex-direction:column;flex:1;justify-content:center;align-items:center;min-height:0;padding:0 20px 40px;display:flex}.gate-card{text-align:center;width:100%;max-width:400px}.gate-title{font-family:var(--font-display);color:var(--text);letter-spacing:-.01em;margin-bottom:8px;font-size:clamp(22px,4vw,30px);font-weight:300;line-height:1.3}.gate-subtitle{color:var(--text-secondary);margin-bottom:24px;font-size:15px;line-height:1.5}.gate-expiry-badge{color:var(--sage);background:var(--sage-subtle);border-radius:var(--radius-full);margin-bottom:20px;padding:4px 10px;font-size:12px;display:inline-block}.gate-form{text-align:left}.gate-field{margin-bottom:14px}.gate-field label{color:var(--text-secondary);margin-bottom:6px;font-size:13px;font-weight:500;display:block}.gate-field input{border:1px solid var(--border-strong);width:100%;font-family:var(--font-body);color:var(--text);background:var(--bg);border-radius:8px;outline:none;padding:10px 12px;font-size:15px;transition:border-color .15s,box-shadow .15s}.gate-field input:focus{border-color:var(--sage);box-shadow:0 0 0 2px var(--sage-glow)}.gate-field input::placeholder{color:var(--text-tertiary)}.gate-pw-row{position:relative}.gate-pw-toggle{position:absolute;top:0;right:0}.gate-strength{color:var(--text-tertiary);flex-direction:column;gap:4px;margin-top:8px;font-size:12px;display:flex}.gate-strength-item{align-items:center;gap:6px;display:flex}.gate-strength-item.met{color:var(--sage)}.gate-submit{margin-top:20px}.gate-submit .btn{border-radius:10px;width:100%;padding:12px;font-size:15px;font-weight:500}.gate-error{color:var(--danger);text-align:center;margin-top:8px;font-size:13px}.gate-success{color:var(--sage);text-align:center;margin-top:8px;font-size:13px}.gate-link{color:var(--text-tertiary);cursor:pointer;font-size:13px;font-family:var(--font-body);text-underline-offset:2px;background:0 0;border:none;padding:0;text-decoration:underline;display:inline}.gate-link:hover{color:var(--sage)}.gate-hint{color:var(--text-tertiary);text-align:center;margin-top:16px;font-size:13px}.gate-actions{text-align:center;margin-top:16px}.gate-actions .btn{min-width:200px}.gate-icon{margin-bottom:12px;font-size:36px}.gate-otp-field{justify-content:center;align-items:center;gap:10px;margin:20px 0;display:flex}.gate-otp-field .pin-box{border-radius:8px;width:42px;height:48px;font-size:20px}.gate-otp-field .pin-box:focus{border-color:var(--sage);box-shadow:0 0 0 2px var(--sage-glow)}.gate-otp-field .pin-box-filled{border-color:var(--border-strong)}.gate-resend{text-align:center;margin-top:4px}.gate-divider{color:var(--text-tertiary);align-items:center;gap:12px;margin:16px 0;font-size:13px;display:flex}.gate-divider:before,.gate-divider:after{content:"";background:var(--border);flex:1;height:1px}.gate-loading{color:var(--text-tertiary);justify-content:center;align-items:center;gap:8px;padding:20px 0;font-size:14px;display:flex}.gate-loading .spinner{border:2px solid var(--border);border-top-color:var(--sage);border-radius:50%;width:16px;height:16px;animation:.6s linear infinite spin}@keyframes spin{to{transform:rotate(360deg)}}.admin-page .chat-header{text-align:left;border-bottom:1px solid var(--border);flex-direction:row;justify-content:space-between;align-items:center;gap:12px;padding:12px 0;display:flex}.admin-page .chat-logo{flex-shrink:0;width:36px;height:36px;margin-bottom:0}.admin-page .chat-header>div:not(.chat-burger-wrap){flex-direction:column;flex:1;gap:2px;display:flex}.chat-burger-wrap{flex:none;position:relative}.chat-burger{cursor:pointer;color:var(--text-secondary);background:0 0;border:none;border-radius:6px;align-items:center;padding:6px;transition:color .15s;animation:2.4s ease-in-out 3 iconHeartbeat;display:flex}.chat-burger:hover{color:var(--sage);animation:none}.chat-menu{background:var(--bg);border:1px solid var(--border);z-index:100;border-radius:8px;min-width:160px;position:absolute;top:calc(100% + 6px);right:0;overflow:hidden;box-shadow:0 4px 12px #00000014}.chat-menu-item{width:100%;color:var(--text-secondary);cursor:pointer;text-align:left;box-sizing:border-box;background:0 0;border:none;align-items:center;gap:8px;padding:9px 12px;font-size:13px;text-decoration:none;transition:background .12s,color .12s;display:flex}.chat-menu-item:hover{background:var(--surface);color:var(--text)}.chat-menu-divider{background:var(--border);height:1px;margin:2px 0}.chat-menu-agents{border-top:1px solid var(--border);max-height:264px;padding:4px 0;overflow-y:auto}.chat-menu .chat-menu-agent-item{align-items:flex-start;padding-left:20px}.chat-menu-agent-item .agent-status-dot{background:var(--text-tertiary);border-radius:50%;flex-shrink:0;width:6px;height:6px;margin-top:6px}.chat-menu-agent-item .agent-status-dot.active{background:#22c55e}.chat-menu-agent-item .agent-text{flex-direction:column;flex:1;min-width:0;display:flex}.chat-menu-agent-item .agent-display-name{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.chat-menu-agent-item .agent-slug{opacity:.5;font-size:11px}.chat-menu-agent-empty,.chat-menu-agent-error{color:var(--text-tertiary);padding:9px 20px;font-size:12px;display:block}.chat-menu-agent-error{color:var(--danger)}.agent-actions{flex-shrink:0;align-items:center;gap:2px;margin-left:auto;display:flex}.agent-action-btn{width:22px;height:22px;color:var(--text-tertiary);cursor:pointer;background:0 0;border:none;border-radius:4px;justify-content:center;align-items:center;padding:0;text-decoration:none;display:flex}.agent-action-btn:hover{background:var(--surface);color:var(--text)}.agent-delete-btn:hover,.agent-confirm-yes{color:var(--danger)}.agent-confirm-yes:hover{background:var(--danger);color:#fff}.agent-confirm-no:hover{color:var(--text)}.chat-menu-version{width:100%;color:var(--text-tertiary);cursor:pointer;text-align:left;box-sizing:border-box;background:0 0;border:none;align-items:center;gap:8px;padding:9px 12px;font-size:12px;transition:background .12s,color .12s;display:flex}.chat-menu-version:hover{background:var(--surface);color:var(--text-secondary)}.chat-menu-version-passive{cursor:default}.chat-menu-version-passive:hover{color:var(--text-tertiary);background:0 0}.version-installed{font-variant-numeric:tabular-nums;align-items:center;gap:5px;display:inline-flex}.version-update-dot{background:var(--accent);border-radius:50%;flex-shrink:0;width:6px;height:6px}.version-uptodate-dot{background:#22c55e;border-radius:50%;flex-shrink:0;width:6px;height:6px}.update-modal{min-width:240px;max-width:280px}.update-modal-body{padding:12px 0}.update-modal-versions{margin-bottom:12px}.update-version-new{color:var(--sage);font-weight:500}.update-modal-btn{background:var(--sage);color:#fff;cursor:pointer;border:none;border-radius:6px;width:calc(100% - 28px);margin:0 14px;padding:8px 0;font-size:12px;font-weight:500;transition:background .12s}.update-modal-btn:hover{background:var(--sage-hover)}.update-modal-progress-wrap{flex-direction:column;gap:8px;padding:0 14px;display:flex}.update-modal-progress-bar{background:var(--surface);border-radius:2px;width:100%;height:4px;overflow:hidden}.update-modal-progress-fill{background:var(--sage);border-radius:2px;height:100%;transition:width 1s linear}.update-modal-phase{color:var(--text-secondary);align-items:center;gap:6px;font-size:11px;display:flex}.update-modal-result{align-items:center;gap:8px;padding:0 14px;font-size:12px;display:flex}.update-success-icon{color:var(--sage);flex-shrink:0}.update-error-icon{color:var(--danger);flex-shrink:0}.admin-page .chat-tagline{margin:0;font-size:16px;line-height:1.2}.admin-page .chat-intro{margin:0;font-size:12px;line-height:1.3}.admin-activity{flex-direction:column;gap:6px;max-width:100%;display:flex}.spin{animation:1s linear infinite spin}.tl-spinner{animation:1.2s linear infinite spin}.star-loader{color:var(--text-tertiary)}.star-frame-0{opacity:.5;transform:scale(.85)}.star-frame-1{opacity:.8;transform:scale(1)}.star-frame-2{opacity:1;transform:scale(1.15)}.star-frame-3{opacity:.9;transform:scale(1.05)}.tl-loading{color:var(--text-tertiary);align-items:center;gap:6px;padding:2px 0 4px;display:flex}.tl-elapsed{color:var(--text-tertiary);font-variant-numeric:tabular-nums;font-size:12px}.tl-thinking-typewriter{min-width:8.5em;font-size:12px;display:inline-block}.tl-steps{flex-direction:column;display:flex}.tl-step{align-items:stretch;gap:0;display:flex;position:relative}.tl-col{flex-direction:column;flex-shrink:0;align-items:center;width:20px;display:flex}.tl-line{background:var(--border-strong);flex-shrink:0;width:1px;min-height:6px}.tl-line-grow{flex:1}.tl-icon{flex-shrink:0;justify-content:center;align-items:center;width:20px;height:20px;display:flex}.tl-icon.tl-pending{color:var(--sage)}.tl-icon.tl-done{color:var(--text-tertiary)}.tl-icon.tl-success{color:#4d8c63}.tl-icon.tl-error{color:#c44}.tl-icon.tl-dim{color:#c87533;opacity:.8}.tl-body{flex:1;min-width:0;padding:0 0 0 6px}.tl-row{align-items:center;gap:6px;min-height:22px;padding:2px 0;display:flex}.tl-summary{color:var(--text-secondary);text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0;font-size:12px;line-height:1.4;overflow:hidden}.tl-thinking-label{color:var(--text-tertiary);font-style:italic}.tl-step-tokens{color:var(--text-tertiary);font-variant-numeric:tabular-nums;opacity:.7;flex-shrink:0;align-items:center;gap:2px;font-size:11px;display:inline-flex}.tl-step-elapsed{color:var(--text-tertiary);font-variant-numeric:tabular-nums;flex-shrink:0;font-size:11px}.tl-chevron{color:var(--text-tertiary);flex-shrink:0;align-items:center;display:flex}.tl-summary-row{cursor:pointer}.tl-summary-row .tl-summary{color:var(--text-tertiary);font-size:11px}.tl-summary-row .tl-icon{color:var(--text-tertiary)}.tl-detail{white-space:pre-wrap;word-break:break-word;color:var(--text-secondary);background:#00000008;border-radius:4px;margin:2px 0 6px;padding:7px 9px;font-family:SF Mono,Fira Code,Consolas,monospace;font-size:11.5px;line-height:1.5;overflow-x:auto}.tl-row.tl-row-top{align-items:flex-start}.tl-thinking-col{flex-direction:column;flex:1;min-width:0;display:flex}.tl-thinking-body{color:var(--text-tertiary);word-break:break-word;border:1px solid #7c8c7240;border-radius:6px;max-height:90px;margin:0 0 4px;padding:4px 8px;font-size:12px;font-style:italic;line-height:1.5;overflow-y:auto}.tl-status{color:var(--text-tertiary);text-align:center;padding:2px 0 2px 4px;font-size:11px;font-style:italic}.tl-post-components{flex-direction:column;gap:12px;margin-top:12px;display:flex}.tl-footer{color:var(--text-tertiary);font-variant-numeric:tabular-nums;flex-wrap:wrap;align-items:center;gap:6px;padding:6px 0 2px;font-size:11px;display:flex}.tl-footer-sep{opacity:.5}.tl-footer-icon-stat{align-items:center;gap:3px;display:inline-flex}.tl-footer-est{opacity:.6}.tl-ctx-pct{font-variant-numeric:tabular-nums}.tl-ctx-pct.tl-ctx-mid{color:var(--warning,#b8860b)}.tl-ctx-pct.tl-ctx-high{color:var(--error,#c33)}.tl-ctx-compacted{opacity:.45;font-style:italic}.tl-footer-status{align-items:center;gap:4px;margin-left:6px;display:inline-flex}.expand-toggle{cursor:pointer;-webkit-backdrop-filter:blur(8px);border:1px solid var(--border-strong);z-index:10;background:#fafaf8bf;border-radius:50%;justify-content:center;align-items:center;width:32px;height:32px;transition:background .15s;animation:2.4s ease-in-out .4s 3 iconHeartbeat;display:flex;position:absolute;bottom:12px;right:12px;box-shadow:0 2px 8px #00000014}.expand-toggle-default{color:#c87533}.expand-toggle-default:hover{color:#a05e22;background:#c8753314;animation:none}.expand-toggle-all{color:#4a8fc4}.expand-toggle-all:hover{color:#2e6fa0;background:#4a8fc414;animation:none}.expand-toggle-off{color:var(--text-tertiary)}.expand-toggle-off:hover{color:var(--text-secondary);background:var(--surface);animation:none}.select-toggle{color:var(--text-tertiary);animation:none;right:52px}.select-toggle:hover{color:var(--text-secondary);background:var(--surface)}.markdown-message{color:var(--text);word-wrap:break-word;background:var(--maxy-bubble);border-radius:var(--radius-lg);border-bottom-left-radius:var(--radius-sm);max-width:85%;padding:12px 16px;font-size:15px;line-height:1.65;position:relative}.bubble>.markdown-message{white-space:normal;background:0 0;border-radius:0;max-width:none;padding:0}.markdown-message .md-p{margin:0 0 10px}.markdown-message .md-p:last-child{margin-bottom:0}.markdown-message .md-heading{font-family:var(--font-body);color:var(--text);margin:14px 0 5px;font-weight:500;line-height:1.3}.markdown-message h1.md-heading{font-size:17px}.markdown-message h2.md-heading{font-size:15.5px}.markdown-message h3.md-heading{font-size:14.5px}.markdown-message .md-pre{border:1px solid var(--border);background:#0000000a;border-radius:5px;margin:8px 0;padding:10px 12px;overflow-x:auto}.markdown-message .md-pre code{white-space:pre;color:var(--text-secondary);background:0 0;border:none;border-radius:0;padding:0;font-family:SF Mono,Fira Code,Consolas,monospace;font-size:12px;line-height:1.5;display:block}.markdown-message .md-code{background:#0000000f;border-radius:3px;padding:1px 5px;font-family:SF Mono,Fira Code,Consolas,monospace;font-size:13px}.markdown-message .md-list{margin:4px 0 10px;padding-left:20px}.markdown-message .md-list-ordered{list-style-type:decimal}.markdown-message .md-list-item{margin-bottom:3px;font-size:15px;line-height:1.6}.markdown-message .md-list-item .md-p{margin:0}.markdown-message .md-hr{border:none;border-top:1px solid var(--border-strong);margin:12px 0}.markdown-message .md-strong{font-weight:500}.markdown-message .md-link{color:var(--sage);text-underline-offset:2px;-webkit-text-decoration:underline #7c8c7266;text-decoration:underline #7c8c7266}.markdown-message .md-img{object-fit:contain;cursor:pointer;border-radius:6px;max-width:100%;max-height:400px;margin:8px 0;display:block}.markdown-message .md-video{border-radius:6px;max-width:100%;margin:8px 0;display:block}.markdown-message .md-video-iframe{border-radius:6px;width:100%;margin:8px 0;padding-bottom:56.25%;position:relative;overflow:hidden}.markdown-message .md-video-iframe iframe{border:0;width:100%;height:100%;position:absolute;top:0;left:0}.markdown-message .md-table{border-collapse:collapse;width:100%;margin:10px 0;font-size:13px}.markdown-message .md-th,.markdown-message .md-td{border:1px solid var(--border-strong);text-align:left;padding:6px 10px}.markdown-message .md-thead .md-th{background:var(--sage-subtle);color:var(--text-secondary);font-size:12px;font-weight:600}.markdown-message .md-tr:nth-child(2n) td{background:#00000005}.message-meta{color:var(--text-tertiary);font-variant-numeric:tabular-nums;margin-top:6px;font-size:11px}@keyframes iconHeartbeat{0%,to{opacity:.55}50%{opacity:1}}@keyframes iconHeartbeatSubtle{0%,to{opacity:.7}50%{opacity:1}}.powered-by{color:var(--text-tertiary);cursor:pointer;-webkit-user-select:none;user-select:none;opacity:.7;align-items:center;gap:5px;margin-left:auto;font-size:10px;transition:opacity .15s;animation:2.4s ease-in-out .8s 3 iconHeartbeatSubtle;display:flex}.powered-by:hover{opacity:1;animation:none}.powered-by-icon{object-fit:contain;width:14px;height:14px}.claude-info-overlay{z-index:200;background:#00000073;justify-content:flex-end;align-items:flex-end;padding:0 0 56px;display:flex;position:fixed;inset:0}.claude-info-modal{background:var(--surface);border:1px solid var(--border);border-radius:10px;width:300px;max-width:calc(100% - 28px);margin-right:max(14px,50vw - 386px);overflow:hidden;box-shadow:0 8px 32px #0006}.claude-info-header{border-bottom:1px solid var(--border);color:var(--text-secondary);align-items:center;gap:8px;padding:12px 14px;font-size:12px;font-weight:500;display:flex}.claude-info-header img{object-fit:contain;width:14px;height:14px}.claude-info-close{color:var(--text-tertiary);cursor:pointer;background:0 0;border:none;margin-left:auto;padding:2px 4px;font-size:11px;line-height:1}.claude-info-close:hover{color:var(--text)}.claude-info-section{border-bottom:1px solid var(--border);padding:8px 0}.claude-info-section:last-child{border-bottom:none}.claude-info-row{justify-content:space-between;align-items:baseline;gap:12px;padding:4px 14px;font-size:11px;display:flex}.claude-info-label{color:var(--text-tertiary);flex-shrink:0}.claude-info-value{color:var(--text-secondary);font-family:var(--font-mono,monospace);text-align:right;text-overflow:ellipsis;white-space:nowrap;font-size:10.5px;overflow:hidden}.claude-info-toggle{cursor:pointer;transition:color .15s}.claude-info-toggle:hover,.claude-info-toggle:focus-visible{color:var(--text);text-decoration:underline}.claude-info-icon{object-fit:contain;width:14px;height:14px}.sessions-modal{flex-direction:column;max-height:90vh;display:flex}.sessions-list{flex:1;overflow-y:auto}.sessions-empty{color:var(--text-tertiary);justify-content:center;align-items:center;gap:6px;padding:24px 14px;font-size:12px;display:flex}.sessions-error{color:var(--error,#e55)}.sessions-row{border-bottom:1px solid var(--border);justify-content:space-between;align-items:center;gap:8px;padding:8px 14px;transition:background .12s;display:flex}.sessions-row:last-child{border-bottom:none}.sessions-row:hover{background:var(--surface)}.sessions-row-info{flex-direction:column;flex:1;gap:2px;min-width:0;display:flex}.sessions-row-name{color:var(--text);white-space:nowrap;text-overflow:ellipsis;font-size:12px;overflow:hidden}.sessions-row-meta{align-items:center;gap:6px;display:flex}.sessions-row-id{color:var(--text-tertiary);opacity:.7;font-family:monospace;font-size:10px}.sessions-row-time{color:var(--text-tertiary);align-items:center;gap:4px;font-size:10px;display:flex}.sessions-row-actions{flex-shrink:0;align-items:center;gap:4px;display:flex}.sessions-action{width:28px;height:28px;color:var(--text-tertiary);cursor:pointer;background:0 0;border:none;border-radius:6px;justify-content:center;align-items:center;transition:background .12s,color .12s;display:flex}.sessions-play:hover{background:var(--sage-faint,#88b0941f);color:var(--sage)}.sessions-rename:hover{background:var(--sage-faint,#88b0941f);color:var(--text)}.sessions-delete:hover{color:var(--error,#e55);background:#e555551a}.sessions-edit-loading{color:var(--text-tertiary);align-items:center;gap:6px;font-style:italic;display:flex}.sessions-edit-inline{flex:1;align-items:center;gap:4px;min-width:0;display:flex}.sessions-edit-input{min-width:0;color:var(--text);background:var(--surface);border:1px solid var(--border);border-radius:4px;outline:none;flex:1;padding:3px 8px;font-family:inherit;font-size:12px;transition:border-color .12s}.sessions-edit-input:focus{border-color:var(--sage,#88b094)}.sessions-edit-error{color:var(--error,#e55);white-space:nowrap;text-overflow:ellipsis;flex:1;min-width:0;font-size:11px;overflow:hidden}.sessions-confirm:not(:disabled):hover{background:var(--sage-faint,#88b0941f);color:var(--sage)}.sessions-confirm:disabled{opacity:.3;cursor:default}.sessions-cancel:hover{color:var(--error,#e55);background:#e555551a}.sessions-retry:hover{background:var(--sage-faint,#88b0941f);color:var(--text)}.pin-input-row{align-items:center;gap:8px;display:flex}.pin-field{border:1px solid var(--border-strong);background:var(--bg);border-radius:26px;flex:1;align-items:center;gap:8px;height:52px;padding:0 16px;transition:border-color .15s;display:flex}.pin-field:focus-within{border-color:var(--sage)}.pin-box{border:1.5px solid var(--border);text-align:center;width:28px;height:32px;color:var(--text-primary);caret-color:#0000;background:0 0;border-radius:6px;outline:none;flex-shrink:0;padding:0;font-size:10px;transition:border-color .15s,box-shadow .15s}.pin-box:focus{border-color:var(--sage);box-shadow:0 0 0 2px var(--sage-glow)}.pin-box-filled{border-color:var(--border-strong)}.pin-options{justify-content:space-between;align-items:center;display:flex}.admin-pin-error{color:#c44;white-space:pre-wrap;word-break:break-word;font-size:13px;font-family:var(--font-body);text-align:left;max-height:200px;overflow-y:auto}.account-picker-list{flex-direction:column;gap:8px;width:100%;max-width:340px;display:flex}.account-picker-card{background:var(--bg-secondary);border:1px solid var(--border);cursor:pointer;text-align:left;font-family:var(--font-body);border-radius:10px;align-items:center;gap:12px;padding:14px 16px;transition:border-color .15s,background .15s;display:flex}.account-picker-card:hover:not(:disabled){border-color:var(--text-tertiary);background:var(--bg-hover)}.account-picker-card:disabled{opacity:.6;cursor:default}.account-picker-name{color:var(--text);flex:1;font-size:15px;font-weight:500}.account-picker-role{color:var(--text-tertiary);text-transform:capitalize;font-size:12px}.account-picker-spinner{color:var(--text-tertiary);animation:1s linear infinite spin}.connect-page{background:var(--bg);justify-content:center;align-items:center;min-height:100dvh;padding:40px 20px;display:flex}.connect-content{flex-direction:column;align-items:center;gap:24px;width:100%;max-width:420px;display:flex}.connect-logos{align-items:center;gap:28px;display:flex}.connect-logo-wrap{flex-direction:column;align-items:center;gap:10px;display:flex}.connect-logo{object-fit:contain;width:88px;height:88px}.connect-logo--maxy{width:110px;height:110px;margin:-11px}.connect-logo-label{font-family:var(--font-body);color:var(--text-secondary);letter-spacing:.02em;font-size:13px}.connect-arrow{width:48px;height:24px;color:var(--text-tertiary);flex-shrink:0;margin-bottom:22px}.connect-title{font-family:var(--font-display);color:var(--text);text-align:center;letter-spacing:-.01em;font-size:clamp(22px,4vw,28px);font-weight:300;line-height:1.3}.connect-subtitle{color:var(--text-secondary);text-align:center;margin-top:-8px;font-size:15px;line-height:1.5}.connect-content .btn--primary{min-width:200px}.connect-pin-form{flex-direction:column;gap:8px;width:100%;max-width:300px;display:flex}@keyframes messageIn{0%{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}@keyframes typingPulse{0%,60%,to{opacity:.3;transform:scale(.8)}30%{opacity:1;transform:scale(1)}}.attachment-strip{flex-wrap:wrap;gap:6px;padding:0 0 8px;display:flex}.attachment-chip{background:var(--surface);border:1px solid var(--border-strong);border-radius:var(--radius-full);color:var(--text-secondary);align-items:center;gap:5px;max-width:200px;padding:4px 8px;font-size:12px;display:inline-flex}.attachment-chip-thumb{object-fit:cover;border-radius:3px;flex-shrink:0;width:20px;height:20px}.attachment-chip-name{text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0;overflow:hidden}.attachment-chip-remove{cursor:pointer;color:var(--text-tertiary);background:0 0;border:none;flex-shrink:0;align-items:center;padding:0 0 0 2px;font-size:13px;line-height:1;display:flex}.attachment-chip-remove:hover{color:var(--text)}.message-attachments{flex-wrap:wrap;gap:5px;margin-top:8px;display:flex}.message-attachment-chip{border-radius:var(--radius-full);color:var(--text-secondary);cursor:pointer;background:#0000000f;border:none;align-items:center;gap:4px;padding:3px 10px;font-family:inherit;font-size:11px;display:inline-flex}.message-attachment-chip:hover{color:var(--text);background:#0000001a}.message-attachment-chip.no-action{cursor:default}.message-attachment-chip.no-action:hover{color:var(--text-secondary);background:#0000000f}.chat-form.drag-over{outline:2px dashed var(--sage);outline-offset:6px;border-radius:var(--radius-sm)}.attachment-lightbox{z-index:1000;background:#000000d9;justify-content:center;align-items:center;display:flex;position:fixed;inset:0}.attachment-lightbox img{object-fit:contain;border-radius:var(--radius-md);max-width:90vw;max-height:90vh}.attachment-lightbox-close{color:#ffffffb3;cursor:pointer;background:0 0;border:none;padding:4px;font-size:20px;line-height:1;position:absolute;top:20px;right:20px}.attachment-lightbox-close:hover{color:#fff}.attach-error{color:#e05252;margin:0 0 4px;padding:0 4px;font-size:12px}@media (width<=640px){.chat-header{padding:32px 0 16px}.chat-page:not(.admin-page) .chat-header{text-align:left;border-bottom:1px solid var(--border);flex-direction:row;align-items:center;gap:12px;padding:12px 0;display:flex}.chat-page:not(.admin-page) .chat-logo{flex-shrink:0;width:40px;height:40px;margin-bottom:0}.chat-page:not(.admin-page) .chat-logo--circle{width:40px;height:40px}.chat-page:not(.admin-page) .chat-tagline{margin-bottom:0;font-size:16px;font-weight:400;line-height:1.3}.chat-page:not(.admin-page) .chat-intro{margin:0;font-size:12px;line-height:1.3}.chat-page:not(.admin-page) .chat-header-text{flex-direction:column;flex:1;gap:2px;min-width:0;display:flex}.chat-page:not(.admin-page) .chat-header-select{flex-shrink:0;margin-left:auto;position:static}.bubble,.public-components{max-width:90%}.burger-trigger{align-items:center;display:flex}.actions-menu-items{background:var(--surface);border:1px solid var(--border-strong);border-radius:var(--radius-sm,6px);opacity:0;visibility:hidden;pointer-events:none;flex-direction:column;gap:2px;min-width:170px;padding:4px 0;transition:opacity .15s,transform .15s,visibility .15s;display:flex;position:absolute;bottom:calc(100% + 6px);left:0;transform:translateY(4px);box-shadow:0 2px 8px #00000026}.actions-menu-items.actions-menu-open{opacity:1;visibility:visible;pointer-events:auto;transform:translateY(0)}.actions-menu-items .chat-action{width:100%;padding:8px 12px;font-size:13px}.actions-menu-items .chat-action:hover{background:var(--hover)}.actions-menu-items .action-label{display:inline}}.message-queue-list{flex-direction:column;gap:2px;padding:0 0 6px;display:flex}.queued-message-row{color:var(--text-secondary);background:var(--surface);border:1px solid var(--border-strong);border-radius:var(--radius-sm,4px);justify-content:space-between;align-items:center;padding:3px 8px;font-size:12px;display:flex}.queued-message-text{text-overflow:ellipsis;white-space:nowrap;max-width:calc(100% - 24px);overflow:hidden}.queued-message-row button{cursor:pointer;color:var(--text-secondary);background:0 0;border:none;flex-shrink:0;padding:0 4px;font-size:1rem;line-height:1}.queued-message-row button:hover{color:var(--text-primary,#fff)}.message-timestamp{color:var(--text-tertiary,#555);text-align:right;-webkit-user-select:none;user-select:none;margin-top:4px;font-size:10px;display:block}.tl-msg-timestamp{color:var(--text-tertiary,#555);text-align:right;-webkit-user-select:none;user-select:none;margin-top:4px;padding-right:2px;font-size:10px;display:block}.bubble-queued{padding-right:28px;position:relative}.queued-bubble-delete{cursor:pointer;color:var(--text-secondary,#888);background:0 0;border:none;padding:0 2px;font-size:1rem;line-height:1;position:absolute;top:6px;right:6px}.queued-bubble-delete:hover{color:var(--danger)}.maxy-checkbox{cursor:pointer;-webkit-user-select:none;user-select:none;align-items:center;gap:6px;display:flex;position:relative}.maxy-checkbox--disabled{opacity:.4;pointer-events:none}.maxy-checkbox input{opacity:0;pointer-events:none;width:0;height:0;position:absolute}.maxy-checkbox__box{border:1px solid var(--border-strong);color:#0000;border-radius:3px;flex-shrink:0;justify-content:center;align-items:center;width:14px;height:14px;font-size:10px;transition:border-color .15s,color .15s;display:flex}.maxy-checkbox input:checked+.maxy-checkbox__box{border-color:var(--sage);color:var(--sage)}.maxy-checkbox__label{font-family:var(--font-body);color:var(--text-secondary);font-size:13px}.selection-overlay-band{background:color-mix(in srgb, var(--bg) 85%, transparent);-webkit-backdrop-filter:blur(4px);border-left:1px solid var(--border-strong);z-index:10;pointer-events:none;width:64px;position:absolute;top:0;bottom:0;right:0}.tl-text-block{position:relative}.message-select-check,.tl-select-check{z-index:11;position:absolute;top:50%;right:10px;transform:translateY(-50%)}.message.selected .bubble,.message.selected .admin-activity{background:#7c8c7214}.selection-bar{justify-content:space-between;align-items:center;gap:12px;padding:12px 16px;display:flex}.selection-cancel{font-family:var(--font-body);color:var(--text-secondary);cursor:pointer;background:0 0;border:none;font-size:14px}.selection-count{font-family:var(--font-body);color:var(--text);font-size:14px;font-weight:500}.selection-copy-wrap{position:relative}.selection-copy{color:var(--sage);font-family:var(--font-body);cursor:pointer;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;touch-action:manipulation;background:0 0;border:none;flex-direction:column;align-items:center;gap:2px;padding:0;font-size:11px;display:flex}.copy-menu{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-md);box-shadow:var(--shadow-md);z-index:20;white-space:nowrap;animation:.15s ease-out messageIn;position:absolute;bottom:calc(100% + 8px);right:50%;overflow:hidden;transform:translate(50%)}.copy-menu-item{width:100%;font-family:var(--font-body);color:var(--text);text-align:left;cursor:pointer;background:0 0;border:none;padding:10px 16px;font-size:13px;display:block}.copy-menu-item:not(:last-child){border-bottom:1px solid var(--border)}.copy-menu-item:active{background:var(--hover)}.copy-toast{background:var(--text);color:var(--bg);font-family:var(--font-body);border-radius:var(--radius-full);z-index:100;pointer-events:none;padding:6px 16px;font-size:13px;animation:.2s ease-out messageIn;position:fixed;bottom:80px;left:50%;transform:translate(-50%)}.copy-toast-failed{background:var(--error,#c00);color:#fff}.component-card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-md);box-shadow:var(--shadow-sm);width:fit-content;max-width:100%;padding:14px 16px}.component-card--submitted{opacity:.6;pointer-events:none}.component-card__actions{justify-content:flex-end;align-items:center;gap:8px;padding-top:10px;display:flex}.component-card__done-label{font-family:var(--font-body);color:var(--text-secondary);font-size:12px;font-style:italic}.output-style-selector{flex-direction:column;gap:0;max-width:320px;display:flex}.output-style-selector__row{border-radius:var(--radius-sm);cursor:pointer;-webkit-user-select:none;user-select:none;align-items:flex-start;gap:10px;padding:10px 8px;transition:background .15s;display:flex}.output-style-selector__row:hover,.output-style-selector__row--selected{background:var(--sage-subtle)}.output-style-selector__radio{border:2px solid var(--text-secondary);border-radius:50%;flex-shrink:0;width:16px;height:16px;margin-top:1px;transition:border-color .15s,box-shadow .15s}.output-style-selector__radio--checked{border-color:var(--text);box-shadow:inset 0 0 0 3px var(--surface), inset 0 0 0 8px var(--text)}.output-style-selector__info{flex-direction:column;flex:1;gap:2px;min-width:0;display:flex}.output-style-selector__label{font-family:var(--font-body);color:var(--text);font-size:13px;font-weight:500;line-height:1.3}.output-style-selector__desc{font-family:var(--font-body);color:var(--text-secondary);font-size:12px;line-height:1.4}.thinking-view-selector{flex-direction:column;gap:0;max-width:320px;display:flex}.thinking-view-selector__row{border-radius:var(--radius-sm);cursor:pointer;-webkit-user-select:none;user-select:none;align-items:flex-start;gap:10px;padding:10px 8px;transition:background .15s;display:flex}.thinking-view-selector__row:hover,.thinking-view-selector__row--selected{background:var(--sage-subtle)}.thinking-view-selector__radio{border:2px solid var(--text-secondary);border-radius:50%;flex-shrink:0;width:16px;height:16px;margin-top:1px;transition:border-color .15s,box-shadow .15s}.thinking-view-selector__radio--checked{border-color:var(--text);box-shadow:inset 0 0 0 3px var(--surface), inset 0 0 0 8px var(--text)}.thinking-view-selector__info{flex-direction:column;flex:1;gap:2px;min-width:0;display:flex}.thinking-view-selector__label{font-family:var(--font-body);color:var(--text);font-size:13px;font-weight:500;line-height:1.3}.thinking-view-selector__desc{font-family:var(--font-body);color:var(--text-secondary);font-size:12px;line-height:1.4}.plugin-selector{flex-direction:column;gap:10px;max-width:420px;display:flex}.plugin-selector__header{border-bottom:1px solid var(--border);padding-bottom:6px}.plugin-selector__list{flex-direction:column;gap:0;max-height:400px;display:flex;overflow-y:auto}.plugin-selector__row{border-radius:var(--radius-sm);cursor:pointer;-webkit-user-select:none;user-select:none;align-items:flex-start;gap:10px;padding:8px 6px;transition:background .15s;display:flex}.plugin-selector__row:hover{background:var(--sage-subtle)}.plugin-selector__info{flex-direction:column;flex:1;gap:2px;min-width:0;display:flex}.plugin-selector__name{font-family:var(--font-body);color:var(--text);font-size:13px;font-weight:500;line-height:1.3}.plugin-selector__recommended{font-family:var(--font-body);color:var(--sage);margin-left:6px;font-size:10px;font-weight:500}.plugin-selector__desc{font-family:var(--font-body);color:var(--text-secondary);font-size:12px;line-height:1.4}.single-select{flex-direction:column;gap:0;display:flex}.single-select__title{font-family:var(--font-body);color:var(--text);padding:0 8px 6px;font-size:13px;font-weight:600}.single-select__row{border-radius:var(--radius-sm);cursor:pointer;-webkit-user-select:none;user-select:none;align-items:flex-start;gap:10px;padding:10px 8px;transition:background .15s;display:flex}.single-select__row:hover,.single-select__row--selected{background:var(--sage-subtle)}.single-select__radio{border:2px solid var(--text-secondary);border-radius:50%;flex-shrink:0;width:16px;height:16px;margin-top:1px;transition:border-color .15s,box-shadow .15s}.single-select__radio--checked{border-color:var(--text);box-shadow:inset 0 0 0 3px var(--surface), inset 0 0 0 8px var(--text)}.single-select__info{flex-direction:column;flex:1;gap:2px;min-width:0;display:flex}.single-select__icon{margin-right:6px}.single-select__label{font-family:var(--font-body);color:var(--text);font-size:13px;font-weight:500;line-height:1.3}.single-select__desc{font-family:var(--font-body);color:var(--text-secondary);font-size:12px;line-height:1.4}.multi-select{flex-direction:column;gap:10px;display:flex}.multi-select__title{font-family:var(--font-body);color:var(--text);font-size:13px;font-weight:600}.multi-select__header{border-bottom:1px solid var(--border);padding-bottom:6px}.multi-select__list{flex-direction:column;gap:0;max-height:400px;display:flex;overflow-y:auto}.multi-select__row{border-radius:var(--radius-sm);cursor:pointer;-webkit-user-select:none;user-select:none;align-items:flex-start;gap:10px;padding:8px 6px;transition:background .15s;display:flex}.multi-select__row:hover{background:var(--sage-subtle)}.multi-select__info{flex-direction:column;flex:1;gap:2px;min-width:0;display:flex}.multi-select__label{font-family:var(--font-body);color:var(--text);font-size:13px;font-weight:500;line-height:1.3}.multi-select__badge{font-family:var(--font-body);color:var(--sage);margin-left:6px;font-size:10px;font-weight:500}.multi-select__desc{font-family:var(--font-body);color:var(--text-secondary);font-size:12px;line-height:1.4}.multi-select__group-header{font-family:var(--font-body);color:var(--text-secondary);text-transform:uppercase;letter-spacing:.04em;padding:10px 6px 4px;font-size:11px;font-weight:600}.multi-select__group-header:first-child{padding-top:0}.multi-select__row--locked{opacity:.6;cursor:default}.multi-select__row--locked:hover,.multi-select__row--locked:focus{background:0 0;outline:none}.public-components{flex-direction:column;gap:12px;max-width:85%;margin-top:8px;display:flex}@keyframes component-enter{0%{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}.public-component-enter{animation:.2s ease-out both component-enter}.single-select__row,.multi-select__row{min-height:44px}.single-select__row:focus,.multi-select__row:focus{outline:2px solid var(--accent,#7c9a82);outline-offset:-2px;border-radius:8px}@media (width<=480px){.component-card{border-radius:12px;width:100%}.multi-select__list{max-height:60vh}.browser-viewer__iframe{aspect-ratio:4/3;min-height:300px}}.confirm{flex-direction:column;gap:8px;max-width:380px;display:flex}.confirm__title{font-family:var(--font-body);color:var(--text);font-size:13px;font-weight:600;line-height:1.3}.confirm__desc{font-family:var(--font-body);color:var(--text-secondary);font-size:12px;line-height:1.4}.confirm__items{border-top:1px solid var(--border);flex-direction:column;gap:4px;padding:8px 0;display:flex}.confirm__item{justify-content:space-between;align-items:baseline;gap:12px;padding:2px 0;display:flex}.confirm__item-label{font-family:var(--font-body);color:var(--text-secondary);font-size:12px}.confirm__item-value{font-family:var(--font-body);color:var(--text);text-align:right;font-size:12px;font-weight:500}.info-card{flex-direction:column;gap:10px;max-width:380px;display:flex}.info-card__header{flex-direction:column;gap:2px;display:flex}.info-card__title{font-family:var(--font-body);color:var(--text);font-size:13px;font-weight:600;line-height:1.3}.info-card__subtitle{font-family:var(--font-body);color:var(--text-secondary);font-size:12px;line-height:1.4}.info-card__fields{flex-direction:column;gap:6px;display:flex}.info-card__field{border-bottom:1px solid var(--border);justify-content:space-between;align-items:baseline;gap:12px;padding:3px 0;display:flex}.info-card__field:last-child{border-bottom:none}.info-card__field-label{font-family:var(--font-body);color:var(--text-secondary);flex-shrink:0;font-size:12px}.info-card__field-value{font-family:var(--font-body);color:var(--text);text-align:right;font-size:12px;font-weight:500}.info-card__field-value--status{color:var(--sage)}.info-card__field-value a{color:var(--sage);text-decoration:none}.info-card__field-value a:hover{text-decoration:underline}.qr-code{flex-direction:column;align-items:center;gap:12px;padding:8px 0;display:flex}.qr-code--error{font-family:var(--font-body);color:var(--text-secondary);text-align:center;font-size:12px}.qr-code__canvas{color:#000;background:#fff;border-radius:12px;padding:16px}.qr-code__label{font-family:var(--font-body);color:var(--text-secondary);text-align:center;max-width:280px;font-size:12px;line-height:1.4}.action-list{flex-direction:column;gap:8px;max-width:460px;display:flex}.action-list__title{font-family:var(--font-body);color:var(--text);font-size:13px;font-weight:600}.action-list__items{flex-direction:column;gap:0;display:flex}.action-list__item{border-radius:var(--radius-sm);justify-content:space-between;align-items:center;gap:12px;padding:8px 6px;transition:background .15s;display:flex}.action-list__item:hover{background:var(--sage-subtle)}.action-list__item--acted{opacity:.5}.action-list__item-info{flex-direction:column;flex:1;gap:2px;min-width:0;display:flex}.action-list__item-label{font-family:var(--font-body);color:var(--text);font-size:13px;font-weight:500;line-height:1.3}.action-list__item-desc{font-family:var(--font-body);color:var(--text-secondary);font-size:12px;line-height:1.4}.action-list__item-right{flex-shrink:0;align-items:center;gap:8px;display:flex}.action-list__item-status{font-family:var(--font-body);color:var(--sage);white-space:nowrap;font-size:10px;font-weight:500}.action-list__item-actions{gap:4px;display:flex}.form-input{flex-direction:column;gap:10px;max-width:360px;display:flex}.form-input__title{font-family:var(--font-body);color:var(--text);font-size:13px;font-weight:600}.form-input__desc{font-family:var(--font-body);color:var(--text-secondary);font-size:12px;line-height:1.4}.form-input__fields{flex-direction:column;gap:12px;display:flex}.form-input__field{flex-direction:column;gap:4px;display:flex}.form-input__label{font-family:var(--font-body);color:var(--text);font-size:12px;font-weight:500}.form-input__required{color:var(--sage);margin-left:2px}.form-input__input,.form-input__textarea,.form-input__select{font-family:var(--font-body);color:var(--text);background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-sm);outline:none;padding:8px 10px;font-size:13px;transition:border-color .15s}.form-input__input:focus,.form-input__textarea:focus,.form-input__select:focus{border-color:var(--sage)}.form-input__input:disabled,.form-input__textarea:disabled,.form-input__select:disabled{opacity:.6;cursor:not-allowed}.form-input__textarea{resize:vertical;min-height:60px}.form-input__select{cursor:pointer}.form-input__field-desc{font-family:var(--font-body);color:var(--text-secondary);margin-top:-1px;font-size:11px;line-height:1.4}.form-input__list{flex-direction:column;gap:4px;display:flex}.form-input__list-item{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-sm);justify-content:space-between;align-items:center;gap:8px;padding:6px 10px;display:flex}.form-input__list-item-text{font-family:var(--font-body);color:var(--text);text-overflow:ellipsis;white-space:nowrap;min-width:0;font-size:13px;overflow:hidden}.form-input__list-item-remove{color:var(--text-secondary);cursor:pointer;border-radius:var(--radius-sm);background:0 0;border:none;flex-shrink:0;padding:0 4px;font-size:16px;line-height:1;transition:color .15s}.form-input__list-item-remove:hover:not(:disabled){color:var(--text)}.form-input__list-item-remove:disabled{opacity:.6;cursor:not-allowed}.form-input__list-add{gap:6px;margin-top:2px;display:flex}.form-input__list-add .form-input__input{flex:1;min-width:0}.form-input__list-add-btn{font-family:var(--font-body);color:var(--text);background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-sm);cursor:pointer;flex-shrink:0;padding:8px 12px;font-size:12px;font-weight:500;transition:border-color .15s}.form-input__list-add-btn:hover:not(:disabled){border-color:var(--sage)}.form-input__list-add-btn:disabled{opacity:.6;cursor:not-allowed}.progress-tracker{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-md);max-width:380px;box-shadow:var(--shadow-sm);width:fit-content;padding:14px 16px}.progress-tracker--submitted{opacity:.6;pointer-events:none}.progress-tracker__title{font-family:var(--font-body);color:var(--text);padding-bottom:10px;font-size:13px;font-weight:600}.progress-tracker__steps{flex-direction:column;gap:2px;display:flex}.progress-tracker__step{border-radius:var(--radius-sm);align-items:flex-start;gap:10px;padding:6px 4px;display:flex}.progress-tracker__icon{text-align:center;flex-shrink:0;width:18px;font-size:13px;line-height:1.3}.progress-tracker__step--completed .progress-tracker__icon{color:var(--sage)}.progress-tracker__step--failed .progress-tracker__icon{color:#c44}.progress-tracker__step--active .progress-tracker__icon{color:var(--text);font-weight:700}.progress-tracker__step--pending .progress-tracker__icon,.progress-tracker__step--skipped .progress-tracker__icon{color:var(--text-tertiary)}.progress-tracker__step-info{flex-direction:column;flex:1;gap:2px;min-width:0;display:flex}.progress-tracker__step-label{font-family:var(--font-body);color:var(--text);font-size:13px;line-height:1.3}.progress-tracker__step--pending .progress-tracker__step-label{color:var(--text-tertiary)}.progress-tracker__step--skipped .progress-tracker__step-label{color:var(--text-tertiary);text-decoration:line-through}.progress-tracker__step-desc{font-family:var(--font-body);color:var(--text-secondary);font-size:12px;line-height:1.4}.editor-base{background:var(--surface);border:1px solid var(--border);border-radius:10px;flex-direction:column;gap:10px;padding:12px;display:flex}.editor-base__bar{justify-content:space-between;align-items:center;padding:0 0 4px;display:flex}.editor-base__bar[draggable=true]{cursor:grab}.editor-base__bar[draggable=true] .editor-base__actions{cursor:default}.editor-base__icon{width:14px;height:14px;color:var(--text-secondary);flex-shrink:0;margin-right:6px}.editor-base__title{font-family:var(--font-body);color:var(--text);font-size:13px;font-weight:500}.editor-base__actions{align-items:center;gap:4px;margin-left:auto;display:flex}.editor-base__status{font-family:var(--font-body);color:var(--text-tertiary);padding:2px 6px;font-size:12px}.editor-base--minimised{cursor:pointer;gap:0;padding:10px 14px}.editor-base--popout{padding:10px 14px}.editor-base-fullscreen{z-index:1000;background:var(--bg-chat);flex-direction:column;display:flex;position:fixed;inset:0}.editor-base-fullscreen__bar{border-bottom:1px solid var(--border);background:var(--surface);flex-shrink:0;justify-content:space-between;align-items:center;padding:8px 16px;display:flex}.editor-base-fullscreen__title{font-family:var(--font-body);color:var(--text);font-size:13px;font-weight:500}.editor-base-fullscreen__body{flex:1;width:100%;max-width:800px;margin:0 auto;padding:24px;position:relative;overflow-y:auto}.doc-editor__body{background:var(--bg-chat);border:1px solid var(--border);border-radius:6px;max-height:500px;position:relative;overflow-y:auto}.doc-editor__content{font-family:var(--font-body);color:var(--text);outline:none;min-height:60px;padding:12px;font-size:15px;line-height:1.6}.doc-editor__content h1,.doc-editor__content h2,.doc-editor__content h3{margin-top:1.2em;margin-bottom:.4em;font-weight:600}.doc-editor__content h1{font-size:1.5em}.doc-editor__content h2{font-size:1.25em}.doc-editor__content h3{font-size:1.1em}.doc-editor__content p{margin:.4em 0}.doc-editor__content ul,.doc-editor__content ol{margin:.4em 0;padding-left:1.5em}.doc-editor__content code{background:var(--surface);border-radius:3px;padding:1px 4px;font-size:.9em}.doc-editor__content pre{background:var(--surface);border-radius:6px;margin:.6em 0;padding:12px;overflow-x:auto}.doc-editor__content pre code{background:0 0;padding:0}.doc-editor__content blockquote{border-left:3px solid var(--border-strong);color:var(--text-secondary);margin:.6em 0;padding-left:12px}.doc-editor__content a{color:var(--sage);text-decoration:underline}.doc-editor__content hr{border:none;border-top:1px solid var(--border);margin:1em 0}.doc-editor__content p.is-editor-empty:first-child:before{content:"Start typing or wait for content...";color:var(--text-tertiary);float:left;pointer-events:none;height:0;font-style:italic}.doc-editor__bubble-menu{background:var(--surface);border:1px solid var(--border);box-shadow:var(--shadow-sm);border-radius:8px;align-items:center;gap:4px;padding:6px;display:flex}.doc-editor__bubble-divider{background:var(--border-strong);width:1px;height:20px;margin:0 2px}.doc-editor__comment-highlight{background:var(--sage-glow);cursor:help;border-radius:2px}.doc-editor__comment-popover{z-index:10;background:var(--bg-chat);border:1px solid var(--border-strong);box-shadow:var(--shadow-md);border-radius:8px;flex-direction:column;gap:6px;max-width:280px;padding:8px;display:flex;position:absolute;top:8px;right:8px}.doc-editor__comment-input{font-family:var(--font-body);border:1px solid var(--border);background:var(--bg);color:var(--text);border-radius:6px;outline:none;width:100%;padding:6px 8px;font-size:13px}.doc-editor__comment-input:focus{border-color:var(--sage)}.doc-editor__comment-actions{justify-content:flex-end;gap:4px;display:flex}.doc-editor__fallback,.rich-editor__fallback{font-family:var(--font-body);color:var(--text);padding:12px;font-size:15px;line-height:1.6}.doc-editor__fallback ul,.doc-editor__fallback ol{margin:.4em 0;padding-left:1.5em}.doc-editor__preview{cursor:text;border-radius:6px;transition:background .15s}.doc-editor__preview:hover{background:#00000005}.rich-editor__body{background:var(--bg-chat);border:1px solid var(--border);border-radius:6px;max-height:500px;position:relative;overflow-y:auto}.rich-editor__content{font-family:var(--font-body);color:var(--text);outline:none;min-height:60px;padding:12px;font-size:15px;line-height:1.6}.rich-editor__content h1,.rich-editor__content h2,.rich-editor__content h3{margin-top:1.2em;margin-bottom:.4em;font-weight:600}.rich-editor__content h1{font-size:1.5em}.rich-editor__content h2{font-size:1.25em}.rich-editor__content h3{font-size:1.1em}.rich-editor__content p{margin:.4em 0}.rich-editor__content ul,.rich-editor__content ol{margin:.4em 0;padding-left:1.5em}.rich-editor__content img{cursor:pointer;border-radius:6px;max-width:100%;height:auto;transition:opacity .15s}.rich-editor__content img:hover{opacity:.85}.rich-editor__content a{color:var(--sage);text-decoration:underline}.rich-editor__content blockquote{border-left:3px solid var(--border-strong);color:var(--text-secondary);margin:.6em 0;padding-left:12px}.rich-editor__content p.is-editor-empty:first-child:before{content:"Start typing or wait for content...";color:var(--text-tertiary);float:left;pointer-events:none;height:0;font-style:italic}.grid-editor__body{background:var(--bg-chat);border:1px solid var(--border);border-radius:6px;max-height:500px;position:relative;overflow:auto}.grid-editor__table-wrap{min-width:100%;position:relative}.grid-editor__table{border-collapse:collapse;width:100%;font-family:var(--font-body);color:var(--text);font-size:13px}.grid-editor__col-header{background:var(--surface);text-align:left;border:1px solid var(--border);white-space:nowrap;-webkit-user-select:none;user-select:none;padding:6px 10px;font-size:12px;font-weight:600;position:relative}.grid-editor__row-header{background:var(--surface);border:1px solid var(--border);text-align:center;width:40px;min-width:40px;padding:4px;position:relative}.grid-editor__row-num{color:var(--text-tertiary);font-size:11px}.grid-editor__row-delete{color:var(--text-tertiary);cursor:pointer;background:0 0;border:none;border-radius:3px;padding:2px;display:none;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.grid-editor__row-header:hover .grid-editor__row-num{display:none}.grid-editor__row-header:hover .grid-editor__row-delete{display:block}.grid-editor__row-delete:hover{color:var(--text);background:var(--sage-subtle)}.grid-editor__cell{border:1px solid var(--border);cursor:text;padding:0;position:relative}.grid-editor__cell--active{outline:2px solid var(--sage);outline-offset:-1px;z-index:1}.grid-editor__cell-text{white-space:nowrap;text-overflow:ellipsis;min-height:28px;padding:4px 8px;display:block;overflow:hidden}.grid-editor__cell-input{background:var(--bg-chat);width:100%;height:100%;min-height:28px;font-family:var(--font-body);color:var(--text);border:none;outline:none;padding:4px 8px;font-size:13px}.grid-editor__resize-handle{cursor:col-resize;z-index:2;width:5px;height:100%;position:absolute;top:0;right:-2px}.grid-editor__resize-handle:hover{background:var(--sage-glow)}.grid-editor__add-row{color:var(--text-tertiary);font-family:var(--font-body);cursor:pointer;background:0 0;border:none;align-items:center;gap:6px;width:100%;padding:6px 10px;font-size:12px;display:flex}.grid-editor__add-row:hover{background:var(--sage-subtle);color:var(--sage)}.grid-editor__comment-popover{z-index:10;background:var(--bg-chat);border:1px solid var(--border-strong);box-shadow:var(--shadow-md);border-radius:8px;flex-direction:column;gap:6px;max-width:280px;padding:8px;display:flex;position:absolute;top:8px;right:8px}.browser-viewer{background:var(--surface);border:1px solid var(--border);border-radius:10px;flex-direction:column;gap:10px;padding:12px;display:flex}.browser-viewer--submitted{opacity:.6;pointer-events:none;padding:10px 14px}.browser-viewer__bar{justify-content:space-between;align-items:center;padding:0 0 4px;display:flex}.browser-viewer__bar[draggable=true]{cursor:grab}.browser-viewer__bar[draggable=true] .browser-viewer__actions{cursor:default}.browser-viewer__icon{width:14px;height:14px;color:var(--text-secondary);flex-shrink:0;margin-right:6px}.browser-viewer__title{font-family:var(--font-body);color:var(--text);font-size:13px;font-weight:500}.browser-viewer__actions{gap:4px;margin-left:auto;display:flex}.browser-viewer__iframe{border:1px solid var(--border);background:#111;border-radius:6px;width:100%;min-height:500px;display:block}.browser-viewer--minimised{cursor:pointer;border-left:3px solid var(--sage);background:var(--sage-subtle);gap:0;padding:10px 14px}.browser-viewer--minimised .browser-viewer__iframe{display:none}.browser-viewer--popout{border-left:3px solid var(--sage);background:var(--sage-subtle);padding:10px 14px}.browser-viewer__popout-label{font-family:var(--font-body);color:var(--text-tertiary);padding:2px 0;font-size:12px}.browser-viewer-fullscreen{z-index:1000;background:var(--surface,#111);flex-direction:column;display:flex;position:fixed;inset:0}.browser-viewer-fullscreen__bar{border-bottom:1px solid var(--border);background:var(--surface);flex-shrink:0;justify-content:space-between;align-items:center;padding:8px 12px;display:flex}.browser-viewer-fullscreen__title{font-family:var(--font-body);color:var(--text);font-size:13px;font-weight:500}.browser-viewer-fullscreen__actions{gap:4px;display:flex}.browser-viewer-fullscreen__iframe{background:#111;border:none;flex:1;width:100%}.browser-overlay-popout{z-index:1000;background:var(--surface);border:1px solid var(--border);border-radius:10px;align-items:center;gap:8px;padding:8px 14px;display:flex;position:fixed;bottom:16px;left:50%;transform:translate(-50%);box-shadow:0 2px 12px #00000026}.btn{font-family:var(--font-body);white-space:nowrap;cursor:pointer;-webkit-font-smoothing:antialiased;background:0 0;border:none;flex-shrink:0;justify-content:center;align-items:center;padding:10px 16px;font-size:14px;font-weight:400;line-height:1;transition:background .15s,opacity .15s,color .15s;display:inline-flex;position:relative}.btn:disabled{opacity:.4;cursor:not-allowed}.btn__content{align-items:center;gap:6px;display:flex}.btn__spinner{justify-content:center;align-items:center;font-size:14px;animation:1.2s linear infinite spin;display:flex;position:absolute;inset:0}.btn--sm .btn__spinner{font-size:11px}.btn--lg .btn__spinner{font-size:17px}.btn--primary{background:var(--sage);color:#fff;border-radius:var(--radius-full)}.btn--primary:hover:not(:disabled){background:var(--sage-hover)}.btn--secondary{color:var(--text-secondary);border:1px solid var(--border-strong);border-radius:var(--radius-full);background:0 0}.btn--secondary:hover:not(:disabled){border-color:var(--sage)}.btn--ghost{color:var(--text-secondary);background:0 0;border:none;padding:0 2px}.btn--ghost:hover:not(:disabled){color:var(--sage)}.btn--danger{background:var(--danger);color:#fff;border-radius:var(--radius-full)}.btn--danger:hover:not(:disabled){background:var(--danger-hover)}.btn--send{background:var(--sage);color:#fff;border-radius:50%}.btn--send:hover:not(:disabled){background:var(--sage-hover)}.btn--send:active:not(:disabled){transform:scale(.95)}.btn--send svg{width:16px;height:16px}.btn--icon{color:var(--text-tertiary);background:0 0;border:none;padding:2px}.btn--icon:hover:not(:disabled){color:var(--text-secondary)}.btn--suggestion{color:var(--text-secondary);border:1px solid var(--border-strong);border-radius:var(--radius-full);background:0 0;font-size:13px}.btn--suggestion:hover:not(:disabled){border-color:var(--sage)}.btn--sm{padding:6px 10px;font-size:12px}.btn--lg{padding:12px 24px;font-size:15px}.btn--full{width:100%}.file-attachment{align-items:center;gap:10px;max-width:380px;display:flex}.file-attachment__icon{color:var(--text-secondary);flex-shrink:0}.file-attachment__info{flex:1;min-width:0}.file-attachment__name{font-family:var(--font-body);color:var(--text);text-overflow:ellipsis;white-space:nowrap;font-size:13px;font-weight:600;line-height:1.3;overflow:hidden}.file-attachment__meta{font-family:var(--font-body);color:var(--text-secondary);font-size:11px;line-height:1.4}.file-attachment__download{border:1px solid var(--border);width:32px;height:32px;color:var(--text-secondary);cursor:pointer;background:0 0;border-radius:6px;flex-shrink:0;justify-content:center;align-items:center;transition:background .15s,color .15s;display:flex}.file-attachment__download:hover:not(:disabled){background:var(--bg-hover);color:var(--text)}.file-attachment__download:disabled{opacity:.4;cursor:not-allowed}