/* Claw — the draggable 3D lobster that hands thinking jobs to the user's own OpenClaw (claw.js). Prefix lc-.
   Tokens come from studio.css (--panel, --ink, --muted, --energy, --display, --ease …). The root IS the lobster's box (92 px, 72 px on
   phones; physical LTR so sides are plain left/right); the bubble and the toast hang off it absolutely, so opening, re-rendering or
   resizing the bubble never moves the lobster. .lc-flip = bubble on the left, .lc-low = bubble below (more room there). */
.lc-claw { position: fixed; right: 14px; bottom: 12px; z-index: 60; width: 92px; height: 92px; pointer-events: none; direction: ltr; font-family: var(--latin); font-size: 13px; line-height: 1.5; color: var(--ink); }
[dir="rtl"] .lc-claw { right: auto; left: 14px; font-family: var(--arabic), var(--latin); }
.lc-claw[hidden] { display: none; }

/* ------------------------------------------------------------------ the lobster */
.lc-btn { pointer-events: auto; display: block; position: relative; width: 100%; height: 100%; padding: 0; border: 0; background: none; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; filter: drop-shadow(0 10px 16px rgba(0, 0, 0, .5)); transition: transform .25s var(--ease), filter .25s; animation: lc-bob 4.5s ease-in-out infinite; }
.lc-btn::before { content: ""; position: absolute; left: 20%; right: 20%; bottom: 1px; height: 10px; border-radius: 50%; background: radial-gradient(rgba(0, 0, 0, .45), transparent 70%); z-index: -1; }
.lc-btn:hover, .lc-btn:focus-visible, .lc-open .lc-btn { transform: translateY(-3px) scale(1.04); filter: drop-shadow(0 14px 20px rgba(0, 0, 0, .55)) drop-shadow(0 0 14px rgba(139, 92, 246, .35)); }
.lc-btn:focus-visible { outline: 2px solid #a78bfa; outline-offset: 4px; border-radius: 24px; }
.lc-btn img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; opacity: 0; transition: opacity .16s linear; pointer-events: none; -webkit-user-drag: none; }
.lc-btn img.lc-on { opacity: 1; }
.lc-btn video.lc-clip { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.lc-btn.lc-playing img { opacity: 0 !important; transition: none; }
.lc-dragging .lc-btn { cursor: grabbing; animation: none; transform: scale(1.08); }
.lc-badge { position: absolute; top: 2px; right: 4px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; display: grid; place-items: center; font: 600 12px/1 var(--display); color: #fff; background: linear-gradient(180deg, #1d1d2b, #12121a); box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .16), 0 4px 10px rgba(0, 0, 0, .45); z-index: 2; pointer-events: none; }
.lc-badge[hidden] { display: none; }
.lc-mood-waiting .lc-badge { color: var(--amber); }
.lc-mood-working .lc-badge { color: var(--cyan); animation: lc-pulse 1.2s ease-in-out infinite; letter-spacing: .1em; }
.lc-mood-done .lc-badge { background: var(--energy); box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .25), 0 0 14px rgba(217, 70, 239, .6); }
.lc-toast { position: absolute; bottom: calc(100% + 6px); right: 0; max-width: min(260px, calc(100vw - 40px)); padding: 7px 11px; border-radius: 12px; background: rgba(18, 18, 26, .92); color: var(--ink); font: 600 12px/1.35 var(--display); border: 1px solid rgba(255, 255, 255, .14); box-shadow: 0 10px 24px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .08); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; animation: lc-pop .22s var(--ease); z-index: 3; }
.lc-toast::before { content: "✓ "; color: var(--cyan); }
.lc-claw:not(.lc-flip) .lc-toast { right: auto; left: 0; }
[dir="rtl"] .lc-toast { direction: rtl; }

/* ------------------------------------------------------------------ bubble */
.lc-bubble { pointer-events: auto; position: absolute; bottom: 52px; left: calc(100% + 8px); width: min(330px, calc(100vw - 122px)); max-height: min(74vh, 660px); display: flex; flex-direction: column; color: var(--ink); background: linear-gradient(160deg, rgba(31, 31, 46, .84), rgba(16, 16, 24, .8)); backdrop-filter: blur(18px) saturate(1.3); -webkit-backdrop-filter: blur(18px) saturate(1.3); border: 1px solid rgba(255, 255, 255, .12); border-radius: 18px; box-shadow: 0 18px 44px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .08), 0 0 0 1px rgba(139, 92, 246, .16); animation: lc-pop .22s var(--ease); direction: ltr; }
[dir="rtl"] .lc-bubble { direction: rtl; }
.lc-bubble::before { content: ""; position: absolute; left: 14px; right: 14px; top: -1px; height: 1px; background: linear-gradient(90deg, transparent, rgba(139, 92, 246, .8) 25%, rgba(217, 70, 239, .6) 55%, rgba(34, 211, 238, .55) 80%, transparent); pointer-events: none; }
.lc-bubble::after { content: ""; position: absolute; bottom: 16px; left: -7px; width: 14px; height: 14px; background: rgba(24, 24, 36, .92); border-left: 1px solid rgba(255, 255, 255, .14); border-bottom: 1px solid rgba(255, 255, 255, .14); transform: rotate(45deg); border-radius: 0 0 0 4px; }
.lc-flip .lc-bubble { left: auto; right: calc(100% + 8px); }
.lc-flip .lc-bubble::after { left: auto; right: -7px; transform: rotate(-135deg); }
.lc-low .lc-bubble { bottom: auto; top: 44px; }
.lc-low .lc-bubble::after { bottom: auto; top: 16px; }
.lc-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px 8px; }
.lc-head h4 { margin: 0; flex: 1; font: 700 14px/1.2 var(--display); letter-spacing: -.01em; background: linear-gradient(90deg, #fff, #c9c3ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
[dir="rtl"] .lc-head h4 { font-family: var(--arabic); }
.lc-x { width: 28px; height: 28px; border-radius: 9px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, .04); color: var(--muted); font-size: 15px; line-height: 1; display: grid; place-items: center; cursor: pointer; }
.lc-x:hover { color: var(--ink); border-color: rgba(255, 255, 255, .25); }
.lc-conn { margin: 0 14px 8px; font: 500 11.5px/1.5 var(--latin); color: var(--muted); }
.lc-conn::before { content: ""; display: inline-block; vertical-align: middle; width: 7px; height: 7px; border-radius: 50%; margin-inline-end: 6px; background: #74748c; box-shadow: 0 0 0 2px rgba(116, 116, 140, .25); }
.lc-conn.lc-on::before { background: #34d399; box-shadow: 0 0 0 2px rgba(52, 211, 153, .25), 0 0 8px rgba(52, 211, 153, .6); }
.lc-conn.lc-stale::before { background: var(--amber); box-shadow: 0 0 0 2px rgba(245, 176, 65, .25); }
.lc-link { background: none; border: 0; padding: 0; color: var(--accent-2); font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.lc-link:hover { color: #fff; }
.lc-body { flex: 1; min-height: 0; overflow: auto; padding: 0 14px 12px; display: flex; flex-direction: column; gap: 10px; overscroll-behavior: contain; }
.lc-body > .lc-link { align-self: flex-start; }
.lc-sec { margin: 0; font: 600 10px/1 var(--display); letter-spacing: .14em; text-transform: uppercase; color: var(--dim); display: flex; align-items: baseline; gap: 6px; }
.lc-sec b { font-weight: 600; color: var(--muted); letter-spacing: 0; text-transform: none; font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60%; }
.lc-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.lc-chip { font-family: var(--display); font-weight: 600; font-size: 11.5px; padding: 6px 10px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--muted); background: linear-gradient(180deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, .015)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05); cursor: pointer; transition: color var(--t), border-color var(--t), transform var(--t) var(--ease); }
[dir="rtl"] .lc-chip { font-family: var(--arabic); }
.lc-chip:hover { color: #e8dfff; border-color: rgba(168, 85, 247, .7); transform: translateY(-1px); }
.lc-chip:disabled { opacity: .45; cursor: progress; transform: none; }
.lc-ask { display: flex; gap: 6px; }
.lc-ask input { flex: 1; min-width: 0; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line-2); background: rgba(0, 0, 0, .3); color: var(--ink); font: inherit; font-size: 12.5px; }
.lc-ask input:focus { outline: none; border-color: rgba(139, 92, 246, .7); box-shadow: 0 0 0 3px rgba(139, 92, 246, .18); }
.lc-send { border: 0; border-radius: 10px; padding: 0 12px; background: var(--active); color: #fff; font: 700 11.5px var(--display); letter-spacing: .04em; cursor: pointer; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 6px 16px rgba(139, 92, 246, .35); }
.lc-send:disabled { opacity: .5; cursor: progress; }
.lc-err { margin: 0; padding: 7px 10px; border-radius: 10px; font-size: 12px; color: #ffd7d7; background: rgba(239, 68, 68, .14); border: 1px solid rgba(239, 68, 68, .35); }
.lc-note { margin: 0; font-size: 12px; color: var(--muted); }
.lc-result { padding: 10px 12px; border-radius: 12px; background: rgba(0, 0, 0, .28); border: 1px solid var(--line); font-size: 12.5px; line-height: 1.55; word-break: break-word; }
.lc-result[lang="ar"] { font-family: var(--arabic), var(--latin); }
.lc-result h1, .lc-result h2, .lc-result h3, .lc-result h4 { margin: 8px 0 4px; font: 700 13px/1.3 var(--display); color: #e8dfff; }
[dir="rtl"] .lc-result h1, [dir="rtl"] .lc-result h2, [dir="rtl"] .lc-result h3, [dir="rtl"] .lc-result h4 { font-family: var(--arabic); }
.lc-result h1:first-child, .lc-result h2:first-child, .lc-result h3:first-child, .lc-result p:first-child { margin-top: 0; }
.lc-result p { margin: 4px 0; }
.lc-result ul, .lc-result ol { margin: 4px 0; padding-inline-start: 18px; }
.lc-result li { margin: 2px 0; }
.lc-result code { font-family: var(--mono); font-size: 11px; background: rgba(255, 255, 255, .08); padding: 1px 4px; border-radius: 4px; }
.lc-result a { color: var(--cyan); }
.lc-result b { color: #fff; }
.lc-by { margin: 0; font: 500 11px/1.3 var(--latin); color: var(--dim); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.lc-by i { font-style: normal; color: var(--accent-2); }
.lc-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding-top: 4px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--muted); }
.lc-list { display: flex; flex-direction: column; gap: 4px; }
.lc-row { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255, 255, 255, .025); cursor: pointer; text-align: start; color: inherit; font: inherit; width: 100%; }
.lc-row:hover { border-color: rgba(255, 255, 255, .2); background: rgba(255, 255, 255, .05); }
.lc-row[aria-current="true"] { border-color: rgba(168, 85, 247, .6); }
.lc-row-st { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; background: rgba(255, 255, 255, .06); }
.lc-row-st.done { background: var(--energy); color: #fff; }
.lc-row-st.queued { color: var(--amber); }
.lc-row-st.claimed { color: var(--cyan); animation: lc-pulse 1.2s ease-in-out infinite; }
.lc-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.lc-row-main b { font-weight: 600; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lc-row-main span { font-size: 11px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lc-del { flex: none; width: 26px; height: 26px; border-radius: 8px; border: 1px solid transparent; background: none; color: var(--dim); font-size: 14px; cursor: pointer; }
.lc-del:hover { color: #ffb4b4; border-color: rgba(239, 68, 68, .4); background: rgba(239, 68, 68, .1); }
.lc-setup ol { margin: 0; padding-inline-start: 18px; display: flex; flex-direction: column; gap: 8px; font-size: 12.5px; }
.lc-setup li > p { margin: 2px 0 4px; color: var(--muted); font-size: 12px; }
.lc-code { position: relative; margin: 0; padding: 8px 34px 8px 10px; border-radius: 10px; background: rgba(0, 0, 0, .45); border: 1px solid var(--line-2); font-family: var(--mono); font-size: 10.5px; line-height: 1.45; color: #d8d4f0; white-space: pre-wrap; word-break: break-all; direction: ltr; text-align: left; }
.lc-copy { position: absolute; top: 5px; right: 5px; width: 24px; height: 24px; border-radius: 7px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, .05); color: var(--muted); font-size: 12px; cursor: pointer; display: grid; place-items: center; }
.lc-copy:hover, .lc-copy.lc-ok { color: #fff; border-color: rgba(168, 85, 247, .7); }
.lc-key-note { margin: 4px 0 0; font-size: 11px; color: var(--amber); }
.lc-primary { align-self: flex-start; border: 0; border-radius: 10px; padding: 8px 14px; background: var(--active); color: #fff; font: 700 11.5px var(--display); letter-spacing: .04em; cursor: pointer; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 6px 16px rgba(139, 92, 246, .35); }
.lc-primary:disabled { opacity: .5; cursor: progress; }

/* ------------------------------------------------------------------ "Send to" + task links (🔗 Claude · ChatGPT) */
.lc-engine { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lc-engine-l { font: 600 10px/1 var(--display); letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
[dir="rtl"] .lc-engine-l { font-family: var(--arabic); letter-spacing: 0; font-size: 11px; }
.lc-seg { display: inline-flex; padding: 2px; border-radius: 999px; border: 1px solid var(--line-2); background: rgba(0, 0, 0, .3); }
.lc-seg-b { border: 0; border-radius: 999px; padding: 5px 10px; background: none; color: var(--muted); font: 600 11px/1.3 var(--display); white-space: nowrap; cursor: pointer; transition: color var(--t), background var(--t); }
[dir="rtl"] .lc-seg-b { font-family: var(--arabic); }
.lc-seg-b:hover { color: #e8dfff; }
.lc-seg-b[aria-checked="true"] { background: var(--active); color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 4px 12px rgba(139, 92, 246, .35); }
.lc-seg-b:focus-visible { outline: 2px solid #a78bfa; outline-offset: 1px; }
.lc-hint { margin: -4px 0 0; font-size: 11.5px; line-height: 1.45; color: var(--muted); }
.lc-linkcard { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border-radius: 14px; background: linear-gradient(160deg, rgba(139, 92, 246, .16), rgba(34, 211, 238, .06)); border: 1px solid rgba(139, 92, 246, .45); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08); }
.lc-linkcard .lc-sec { color: #e8dfff; }
.lc-linkcard .lc-note { margin-top: -4px; }
.lc-linkin { width: 100%; box-sizing: border-box; padding: 7px 9px; border-radius: 9px; border: 1px solid var(--line-2); background: rgba(0, 0, 0, .35); color: var(--ink); font: 11px/1.4 var(--mono); direction: ltr; text-align: left; text-overflow: ellipsis; }
.lc-linkin:focus { outline: none; border-color: rgba(139, 92, 246, .7); box-shadow: 0 0 0 3px rgba(139, 92, 246, .18); }
.lc-go { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.lc-goa { display: flex; align-items: center; justify-content: center; gap: 4px; min-height: 32px; padding: 6px 8px; border-radius: 10px; border: 1px solid var(--line-2); background: linear-gradient(180deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .02)); color: var(--ink); font: 600 11.5px var(--display); text-decoration: none; white-space: nowrap; transition: border-color var(--t), transform var(--t) var(--ease), color var(--t); }
.lc-goa:hover, .lc-goa:focus-visible { color: #fff; border-color: rgba(168, 85, 247, .8); transform: translateY(-1px); outline: none; }
.lc-row2 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lc-row2 small { font-size: 10.5px; line-height: 1.3; color: var(--dim); }
.lc-ghost { border: 1px solid var(--line-2); border-radius: 10px; padding: 6px 10px; background: rgba(255, 255, 255, .04); color: var(--muted); font: 600 11.5px var(--display); cursor: pointer; transition: color var(--t), border-color var(--t); }
[dir="rtl"] .lc-ghost { font-family: var(--arabic); }
.lc-ghost:hover, .lc-ghost.lc-ok { color: #fff; border-color: rgba(168, 85, 247, .7); }
.lc-paste { width: 100%; box-sizing: border-box; min-height: 64px; resize: vertical; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line-2); background: rgba(0, 0, 0, .3); color: var(--ink); font: inherit; font-size: 12.5px; line-height: 1.45; }
.lc-paste:focus { outline: none; border-color: rgba(139, 92, 246, .7); box-shadow: 0 0 0 3px rgba(139, 92, 246, .18); }
.lc-linkcard .lc-primary { align-self: auto; }
.lc-offline { padding: 7px 10px; border-radius: 10px; color: #ffe2b4; background: rgba(245, 176, 65, .1); border: 1px solid rgba(245, 176, 65, .35); }
.lc-offline .lc-link { color: #ffe2b4; }
.lc-row-st.link { color: var(--accent-2); }

@keyframes lc-bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -4px; } }
@keyframes lc-pop { from { opacity: 0; transform: translateY(6px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes lc-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
@media (max-width: 480px) {
  .lc-claw { width: 72px; height: 72px; }
  .lc-bubble { width: min(300px, calc(100vw - 100px)); bottom: 40px; max-height: 70vh; }
  .lc-low .lc-bubble { top: 34px; }
  .lc-chip, .lc-send, .lc-x, .lc-seg-b, .lc-goa, .lc-ghost { min-height: 36px; }
}
@media (prefers-reduced-motion: reduce) {
  .lc-btn, .lc-bubble, .lc-toast, .lc-badge, .lc-row-st { animation: none !important; }
  .lc-btn img { transition: none; }
}
