/* Nix in the Extreme HQ: the mascot bottom right and the panel that springs
   from him. HQ tokens only; the one literal is #fff on the red send circle,
   the same as the demo's red button. z-index 50 sits above the phone bottom
   nav (40) so the sheet can cover it. */

#nixDock{
  position:fixed;z-index:50;
  right:calc(24px + env(safe-area-inset-right,0px));
  bottom:calc(24px + env(safe-area-inset-bottom,0px));
  display:flex;flex-direction:column;align-items:flex-end;gap:10px;
  --nx-size:76px;pointer-events:none;
}
#nixDock>*{pointer-events:auto}
#nixDock[hidden]{display:none}
#nixDock,#nixDock *{scrollbar-width:none;-ms-overflow-style:none}
#nixDock::-webkit-scrollbar,#nixDock *::-webkit-scrollbar{display:none;width:0;height:0}

/* the canvas is decoration, never the hit target: nix-mascot.js moves it
   every frame and a moving touch target drops taps on Android */
.nx-mascot{position:relative;display:block;width:var(--nx-size);height:var(--nx-size);background:none;border:0;padding:0;cursor:pointer;touch-action:pan-y}
.nx-mascot canvas{display:block;width:100%;height:100%;pointer-events:none}
.nx-mascot:focus-visible{outline:2px solid var(--red-hot);outline-offset:4px;border-radius:4px}
.nx-fallback{position:absolute;inset:18%;border-radius:50%;background:var(--red);border:1px solid var(--line)}
.nx-fallback[hidden]{display:none}

/* ---------- the panel ---------- */
.nx-panel{
  width:384px;max-width:calc(100vw - 32px);max-height:calc(100dvh - 120px);
  display:flex;flex-direction:column;overflow:hidden;
  background:var(--panel);border:1px solid var(--line);border-radius:4px;box-shadow:0 24px 60px rgba(0,0,0,.55);
  color:var(--txt);transform-origin:100% 100%;overscroll-behavior:contain;font-family:Archivo,system-ui,sans-serif;
}
#nixDock[data-open="false"] .nx-panel{display:none}
#nixDock[data-open="true"] .nx-panel{animation:nx-spring .22s var(--ease-out)}
@keyframes nx-spring{0%{opacity:0;transform:translateY(8px) scale(.96)}60%{transform:translateY(-2px) scale(1.01)}100%{opacity:1;transform:none}}

.nx-head{display:flex;align-items:center;gap:10px;padding:10px 10px 10px 14px;border-bottom:1px solid var(--line-soft)}
.nx-mini{width:24px;height:24px;flex:none}
.nx-who{display:flex;align-items:baseline;gap:8px;flex:1;min-width:0}
.nx-who b{font-weight:700;font-size:14px;letter-spacing:-.02em}
.nx-who span{font-family:var(--mono);font-size:.58rem;letter-spacing:.16em;text-transform:uppercase;color:var(--mut);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.nx-ic{width:30px;height:30px;display:grid;place-items:center;background:none;border:0;padding:0;color:var(--mut);border-radius:2px;cursor:pointer}
.nx-ic:hover{color:var(--txt);background:rgba(255,255,255,.05)}
.nx-ic svg{width:15px;height:15px}
.nx-ic[aria-pressed="true"]{color:var(--txt)}

.nx-hist{border-bottom:1px solid var(--line-soft);max-height:220px;overflow:auto;padding:6px 8px}
.nx-hist[hidden]{display:none}
.nx-hist-r{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px;width:100%;text-align:left;background:none;border:0;padding:9px 8px;border-radius:2px;color:var(--txt);font-size:12.5px;cursor:pointer;align-items:center}
.nx-hist-r:hover{background:rgba(255,255,255,.05)}
.nx-hist-r .t{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.nx-hist-r .w{font-family:var(--mono);font-size:.58rem;letter-spacing:.1em;text-transform:uppercase;color:var(--mut)}
.nx-hist-r[aria-current="true"] .t{font-weight:600}
.nx-hist-r.nx-hist-new{color:var(--mut)}
.nx-hist-empty{padding:10px 8px;color:var(--mut);font-size:12px}

.nx-msgs{flex:1;min-height:120px;max-height:420px;overflow:auto;padding:14px 14px 10px;display:flex;flex-direction:column;gap:12px;overscroll-behavior:contain}
.nx-you{align-self:flex-end;max-width:82%;background:var(--panel-2);border:1px solid var(--line-soft);padding:8px 11px;border-radius:4px 4px 1px 4px;font-size:13.5px;line-height:1.45;white-space:pre-wrap;overflow-wrap:anywhere}
.nx-turn{display:flex;flex-direction:column;gap:9px;max-width:100%}
.nx-said{font-size:13.5px;line-height:1.55;white-space:pre-wrap;overflow-wrap:anywhere}
.nx-said:empty{display:none}
.nx-text-segment{display:contents}
.nx-said strong{font-weight:600}
.nx-li{position:relative;padding-left:14px;margin:3px 0}
.nx-li::before{content:"";position:absolute;left:1px;top:9px;width:5px;height:5px;background:var(--red);transform:rotate(45deg) skewX(-8deg)}
.nx-cursor{display:inline-block;width:6px;height:13px;margin-left:2px;vertical-align:-2px;background:var(--red);border-radius:1px;animation:nx-caret 1.15s var(--ease) infinite}
.nx-cursor[hidden]{display:none}
@keyframes nx-caret{0%,40%{opacity:1}68%{opacity:.1}100%{opacity:1}}

/* thinking dots: the same wave he morphs into, in miniature */
.nx-think{display:inline-flex;align-items:center;gap:5px;height:20px;padding:0 1px}
.nx-think i{width:6px;height:6px;border-radius:50%;background:var(--red);animation:nx-think-wave 1400ms var(--ease) infinite}
.nx-think i:nth-child(2){animation-duration:1530ms;animation-delay:160ms}
.nx-think i:nth-child(3){animation-duration:1320ms;animation-delay:310ms}
@keyframes nx-think-wave{0%{transform:translateY(0) scale(.7);opacity:.32}20%{transform:translateY(-3.5px) scale(1.14);opacity:1}58%{transform:translateY(0) scale(.86);opacity:.62}100%{transform:translateY(0) scale(.7);opacity:.32}}
.nx-think[data-out="true"]{animation:nx-think-out 150ms var(--ease) forwards}
.nx-think[data-out="true"] i{animation-play-state:paused}
@keyframes nx-think-out{to{opacity:0;transform:scale(.82)}}
.nx-empty{color:var(--mut);font-size:12.5px;line-height:1.6}
/* what a turn costs: the estimate while he works, the actual once done */
.nx-cost{font-family:var(--mono);font-size:.58rem;letter-spacing:.14em;text-transform:uppercase;color:var(--mut);font-variant-numeric:tabular-nums}
.nx-fail{color:var(--txt);font-size:12.5px;line-height:1.55;border-left:2px solid var(--red);padding-left:9px}
.nx-said-br{display:block;height:7px}

/* ---------- job card ---------- */
.nx-job{display:flex;flex-direction:column;gap:7px;padding:9px 10px;border:1px solid var(--line);background:var(--ink)}
.nx-job-h{display:flex;align-items:center;gap:8px}
.nx-job-t{flex:1;min-width:0;font-family:var(--mono);font-size:.62rem;letter-spacing:.16em;text-transform:uppercase;color:var(--txt)}
.nx-job[data-shell="true"] .nx-job-t{color:var(--mut)}
.nx-job[data-shell="true"]{gap:0}
.nx-stop{background:none;border:0;padding:0;cursor:pointer;color:var(--red-hot);font:inherit;font-size:11.5px;font-weight:600}
.nx-stop:hover{color:var(--txt)}
.nx-job-s{display:flex;flex-direction:column;gap:6px}
.nx-job-s:empty{display:none}
.nx-narr{font-size:11.5px;color:var(--mut);font-style:italic}
.nx-narr[hidden]{display:none}
.nx-step{display:flex;align-items:center;gap:8px;font-size:12px;color:var(--mut);min-width:0}
.nx-step .l{min-width:0;overflow-wrap:anywhere;flex:1}
.nx-step a.v{flex:none;color:var(--txt);font-size:11px;font-weight:600;text-decoration:none;border-bottom:1px solid var(--red)}
.nx-step .mark{width:13px;height:13px;flex:none;display:grid;place-items:center}
.nx-step .dot{width:6px;height:6px;border-radius:50%;background:var(--dim)}
.nx-step .ring{width:12px;height:12px;border-radius:50%;border:1.5px solid rgba(255,255,255,.14);border-top-color:var(--txt);animation:nx-spin 720ms linear infinite}
.nx-step svg{width:12px;height:12px;color:var(--txt)}
.nx-step[data-status="done"]{color:var(--txt)}
.nx-step[data-status="fail"]{color:var(--txt)}
.nx-step[data-status="fail"] .dot{background:var(--red)}
.nx-step[data-status="wait"]{color:var(--dim)}
@keyframes nx-spin{to{transform:rotate(360deg)}}

/* ---------- action card, confirm chip ---------- */
.nx-act{display:flex;align-items:center;gap:9px;padding:8px 10px;border:1px solid var(--line);background:var(--ink);font-size:12.5px;min-width:0}
.nx-act .st{flex:1;min-width:0;white-space:normal;color:var(--txt);font-size:12.5px}
.nx-act a{color:var(--txt);font-size:11.5px;font-weight:600;text-decoration:none;border-bottom:1px solid var(--red);white-space:nowrap}
.nx-chip{display:flex;flex-wrap:wrap;align-items:center;gap:8px;padding:10px;border:1px solid var(--line);border-left:2px solid var(--red);background:var(--ink)}
.nx-chip .s{flex:1;min-width:150px;font-size:12.5px;line-height:1.45}
.nx-chip .s .q{display:block;margin-top:3px;color:var(--mut);font-size:11px}
.nx-chip .btn{padding:6px 11px;font-size:11.5px}
.nx-chip-done{font-size:12px;color:var(--mut)}
.nx-foot{font-family:var(--mono);font-size:.56rem;letter-spacing:.14em;text-transform:uppercase;color:var(--dim)}

/* ---------- credits line, queue, composer ---------- */
.nx-credit{padding:8px 14px;border-top:1px solid var(--line-soft);font-family:var(--mono);font-size:.6rem;letter-spacing:.1em;text-transform:uppercase;color:var(--mut);line-height:1.6}
.nx-credit[hidden]{display:none}
.nx-credit[data-level="hard"]{color:var(--txt)}
.nx-queue-box{display:flex;flex-direction:column;gap:4px;padding:7px 10px;border-top:1px solid var(--line-soft)}
.nx-queue-box[hidden]{display:none}
.nx-queue{display:flex;align-items:center;gap:8px;min-width:0;font-size:12px;color:var(--mut)}
.nx-queue .k{font-family:var(--mono);font-size:.56rem;letter-spacing:.12em;text-transform:uppercase;flex:none}
.nx-queue .t{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.nx-queue-x{background:none;border:0;padding:4px;color:var(--mut);cursor:pointer;display:grid;place-items:center}
.nx-queue-x svg{width:12px;height:12px}
.nx-comp{display:flex;align-items:flex-end;gap:8px;padding:9px 10px 10px 14px;border-top:1px solid var(--line-soft)}
.nx-input{flex:1;min-width:0;display:block;background:none;border:0;outline:0;resize:none;color:var(--txt);font:inherit;font-size:13.5px;line-height:20px;padding:5px 0;max-height:120px}
.nx-input::placeholder{color:var(--dim)}
.nx-send{width:30px;height:30px;flex:none;display:grid;place-items:center;border-radius:50%;background:var(--red);color:#fff;border:0;cursor:pointer;transition:background .2s}
.nx-send:hover{background:var(--red-hot)}
.nx-send[disabled]{opacity:.42;cursor:default}
.nx-send[data-queue="true"]{opacity:.72}
.nx-send svg{width:14px;height:14px}
.nx-mic{width:30px;height:30px;flex:none;display:grid;place-items:center;background:none;border:1px solid var(--line);border-radius:50%;color:var(--mut);cursor:pointer}
.nx-mic[data-on="true"]{border-color:var(--red);color:var(--red-hot)}
.nx-mic svg{width:14px;height:14px}
.nx-mic[hidden]{display:none}
.nx-plus{width:30px;height:30px;flex:none;display:grid;place-items:center;background:none;border:1px solid var(--line);border-radius:50%;color:var(--mut);cursor:pointer;padding:0;transition:color .2s,border-color .2s}
.nx-plus:hover{color:var(--txt);border-color:var(--txt)}
.nx-plus svg{width:14px;height:14px}
/* in the flow, off the screen: a detached file input never fires change in some engines */
.nx-file{position:absolute;width:1px;height:1px;opacity:0;pointer-events:none}
/* a photo dragged over the panel: a hairline turns, nothing floods */
.nx-panel[data-drop="true"]{border-color:var(--txt)}
.nx-panel[data-drop="true"] .nx-comp{border-top-color:var(--txt)}

/* ---------- attachments: chips above the composer ---------- */
.nx-attach{display:flex;flex-wrap:wrap;gap:6px;padding:8px 14px 0;border-top:1px solid var(--line-soft)}
.nx-attach[hidden]{display:none}
.nx-att{display:flex;align-items:center;gap:8px;padding:3px 4px;border:1px solid var(--line);background:var(--ink);max-width:100%;min-width:0}
.nx-att img{width:40px;height:40px;object-fit:cover;display:block;flex:none;background:var(--panel-2)}
.nx-att .doc{width:40px;height:40px;flex:none;display:grid;place-items:center;color:var(--mut);background:var(--panel-2)}
.nx-att .doc svg{width:18px;height:18px}
.nx-att .w{display:flex;flex-direction:column;gap:2px;min-width:0;padding-right:2px}
.nx-att .n{font-size:12px;line-height:1.2;max-width:150px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.nx-att .s{font-family:var(--mono);font-size:.56rem;letter-spacing:.1em;text-transform:uppercase;color:var(--mut);font-variant-numeric:tabular-nums}
.nx-att-x{background:none;border:0;padding:4px;color:var(--mut);cursor:pointer;display:grid;place-items:center;flex:none}
.nx-att-x:hover{color:var(--txt)}
.nx-att-x svg{width:12px;height:12px}
.nx-attach-note{padding:6px 14px 0;font-size:12px;color:var(--mut)}
.nx-attach-note[hidden]{display:none}
.nx-attach[hidden]+.nx-attach-note{border-top:1px solid var(--line-soft)}

/* what the owner sent, above the words of the bubble */
.nx-you-att{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:6px}
.nx-you-att:last-child{margin-bottom:0}
.nx-you-att img{width:96px;height:96px;object-fit:cover;display:block;border:1px solid var(--line-soft);background:var(--ink)}
.nx-you-doc{display:inline-flex;align-items:center;gap:6px;max-width:100%;min-width:0;padding:6px 8px;border:1px solid var(--line-soft);background:var(--ink);font-size:12px;color:var(--txt)}
.nx-you-doc svg{width:13px;height:13px;flex:none;color:var(--mut)}
.nx-you-doc .n{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.nx-you-files{display:flex;flex-direction:column;gap:2px;margin-bottom:5px}
.nx-you-files:last-child{margin-bottom:0}
.nx-you-f{display:flex;align-items:baseline;gap:8px;min-width:0;font-size:12px;color:var(--mut)}
.nx-you-f .w{font-family:var(--mono);font-size:.56rem;letter-spacing:.12em;text-transform:uppercase;flex:none}
.nx-you-f .n{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.nx-queue .c{display:inline-flex;align-items:center;gap:3px;flex:none;font-family:var(--mono);font-size:.6rem;color:var(--mut);font-variant-numeric:tabular-nums}
.nx-queue .c svg{width:11px;height:11px}

/* ---------- phone: a bottom sheet over the nav ---------- */
@media (max-width:899.98px){
  #nixDock{--nx-size:60px;right:calc(16px + env(safe-area-inset-right,0px));bottom:calc(var(--bottomnav-h) + 12px + env(safe-area-inset-bottom,0px))}
  #nixDock[data-open="true"]{left:0;right:0;bottom:var(--nx-kb,0px);gap:0;align-items:stretch}
  #nixDock[data-open="true"] .nx-panel{width:auto;max-width:none;max-height:calc(100dvh - 40px);border-radius:14px 14px 0 0;border-bottom:0;box-shadow:0 -20px 60px rgba(0,0,0,.6)}
  #nixDock[data-open="true"] .nx-mascot{position:absolute;right:calc(16px + env(safe-area-inset-right,0px));top:0;transform:translateY(-70%)}
  #nixDock[data-open="true"] .nx-msgs{max-height:var(--nx-msgs-max,min(48vh,420px))}
  #nixDock[data-open="true"] .nx-head,#nixDock[data-open="true"] .nx-msgs,#nixDock[data-open="true"] .nx-hist{padding-left:calc(14px + env(safe-area-inset-left,0px));padding-right:calc(14px + env(safe-area-inset-right,0px))}
  #nixDock[data-open="true"] .nx-comp{padding-left:calc(14px + env(safe-area-inset-left,0px));padding-right:calc(12px + env(safe-area-inset-right,0px));padding-bottom:calc(10px + var(--nx-sab,env(safe-area-inset-bottom,0px)))}
  #nixDock[data-open="true"] .nx-ic{width:44px;height:44px}
  #nixDock[data-open="true"] .nx-send,#nixDock[data-open="true"] .nx-mic,#nixDock[data-open="true"] .nx-plus{width:44px;height:44px}
  #nixDock[data-open="true"] .nx-att-x{min-width:44px;min-height:44px}
  #nixDock[data-open="true"] .nx-attach,#nixDock[data-open="true"] .nx-attach-note{padding-left:calc(14px + env(safe-area-inset-left,0px));padding-right:calc(14px + env(safe-area-inset-right,0px))}
  #nixDock[data-open="true"] .nx-input{min-height:44px;font-size:16px;line-height:22px;padding:11px 0}
  #nixDock[data-open="true"] .nx-stop,#nixDock[data-open="true"] .nx-act a,#nixDock[data-open="true"] .nx-step a.v{min-width:44px;min-height:44px;display:inline-flex;align-items:center;justify-content:center;padding:0 6px}
  #nixDock[data-open="true"] .nx-chip .btn{min-height:44px;padding:6px 14px}
  #nixDock[data-open="true"] .nx-hist-r{min-height:44px}
  html[data-nix-sheet="true"] body{overflow:hidden}
}
@media (prefers-reduced-motion:reduce){.nx-cursor,.nx-think i,.nx-step .ring{animation:none}}

/* Conversation refinement: plain answers, stable status and an unsent queue. */
.nx-msgs{padding:18px;gap:16px}
.nx-you,.nx-said{font-size:16px;line-height:1.5}
.nx-turn{gap:12px}
.nx-turn>.nxw-result,.nx-turn>.nxw-evidence,.nx-turn>.nxw-source{margin:0}
.nx-turn>.nxw-result>.nxw-values{margin:10px 0 0}
.nx-turn>.nxw-result>:last-child{margin-bottom:0}
.nx-turn+.nx-you{margin-top:16px}
.nx-turn-status{order:-1;color:var(--mut);font-size:12px;line-height:1.5}
.nx-turn[data-state="failed"]>.nx-turn-status{color:var(--red)}
.nx-queue-box{padding:8px 18px;gap:8px;max-height:184px;overflow-y:auto;flex-shrink:0}
.nx-queue{border:0;border-top:1px solid var(--line);background:none;padding:8px 0 0}
.nx-queue .k{font-family:inherit;font-size:12px;letter-spacing:0;text-transform:none}
.nx-queue .t{font-size:12px}
.nx-queue-x{width:auto;min-width:60px;min-height:44px;padding:0 8px;font-size:12px;border:1px solid var(--line);border-radius:2px}
.nx-jumpbar { position: relative; width: 100%; height: 0; min-height: 0; flex: 0 0 0; padding: 0; margin: 0; border: 0; z-index: 3; overflow: visible; pointer-events: none; }
.nx-jumpbar[hidden]{display:none}
.nx-jump { position: absolute; left: 50%; bottom: 12px; display: grid; place-items: center; width: 44px; height: 44px; min-width: 44px; min-height: 44px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--txt); cursor: pointer; pointer-events: auto; transform: translateX(-50%); animation: nx-jump-enter 140ms ease-out; -webkit-tap-highlight-color: transparent; }
.nx-jump::before { content: ""; position: absolute; inset: 4px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel); box-shadow: 0 2px 8px #00000020; transition: background 140ms, box-shadow 140ms, transform 140ms; }
.nx-jump svg { position: relative; width: 18px; height: 18px; transition: transform 140ms; }
@media (hover: hover) { .nx-jump:hover::before { background: var(--panel-2); box-shadow: 0 3px 12px #00000028; } .nx-jump:hover svg { transform: translateY(1px); } }
.nx-jump:active::before { transform: scale(.94); }
@keyframes nx-jump-enter { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .nx-jump { animation: none; } .nx-jump::before, .nx-jump svg { transition: none; } }
.nx-jump:focus-visible,.nx-queue-x:focus-visible{outline:2px solid var(--red);outline-offset:2px}
.nx-input:focus-visible{outline:2px solid var(--red-hot);outline-offset:2px;border-radius:3px}
@media (prefers-reduced-motion:reduce){.nx-think[data-out="true"]{animation:none}}

/* Credit receipts remain readable beside the answer and retain an explicit review action. */
.nx-cost{font-family:inherit;font-size:12px;line-height:1.55;letter-spacing:0;text-transform:none;display:flex;flex-direction:column;align-items:flex-start;gap:8px;overflow-wrap:anywhere}
.nx-credit-detail{min-height:44px;padding:0 12px;border:1px solid var(--line);border-radius:2px;background:var(--panel-2);color:var(--txt);font:inherit;cursor:pointer}
.nx-credit-detail:focus-visible{outline:2px solid var(--red);outline-offset:2px}

/* The owner HQ uses the same softened surfaces as the rest of the work area. */
.nx-panel{border-radius:20px;border-color:var(--line-soft)}
.nx-ic,.nx-hist-r,.nx-queue-x,.nx-credit-detail,.nx-stop{border-radius:10px}
.nx-you{border-radius:16px 16px 6px 16px;padding:12px 14px;border-color:var(--line-soft)}
.nx-chip,.nx-act,.nx-you-doc,.nx-you-att img{border-radius:12px}
.nx-input:focus-visible{border-radius:12px}
.nx-mascot:focus-visible{border-radius:16px}
@media(max-width:899.98px){
  #nixDock[data-open="true"] .nx-panel{border-radius:20px 20px 0 0}
  #nixDock[data-open="true"] .nx-head,#nixDock[data-open="true"] .nx-msgs,#nixDock[data-open="true"] .nx-hist{padding-left:calc(18px + env(safe-area-inset-left,0px));padding-right:calc(18px + env(safe-area-inset-right,0px))}
  #nixDock[data-open="false"]{right:calc(6px + env(safe-area-inset-right,0px));bottom:env(safe-area-inset-bottom,0px)}
}

/* The dashboard hosts this same conversation DOM; no overlay or duplicate composer. */
#nixDock[data-mode="embedded"][data-open="true"]{position:relative;inset:auto;z-index:auto;display:flex;align-items:stretch;gap:0;width:100%;height:100%;min-height:0;pointer-events:auto}
#nixDock[data-mode="embedded"][hidden]{display:none}
#nixDock[data-mode="embedded"][data-open="true"] .nx-panel{position:relative;width:100%;height:100%;max-width:none;max-height:none;min-height:0;border:0;border-radius:0;background:transparent;box-shadow:none;animation:none;transform:none}
#nixDock[data-mode="embedded"] .nx-head,#nixDock[data-mode="embedded"] .nx-hist{display:none}
#nixDock[data-mode="embedded"][data-open="true"] .nx-msgs{flex:1 1 auto;min-height:0;max-height:none;padding:24px max(18px,calc((100% - 760px)/2));gap:24px;scroll-padding:24px}
#nixDock[data-mode="embedded"] .nx-said{font-size:16px;line-height:1.65}
#nixDock[data-mode="embedded"] .nx-msgs:focus-visible{outline:none;box-shadow:inset 2px 0 0 var(--line)}
#nixDock[data-mode="embedded"] .nx-input:focus-visible{outline:none}
#nixDock[data-mode="embedded"] .nx-comp:focus-within{border-color:#ffffff38;box-shadow:0 0 0 1px #ffffff12}
#nixDock[data-mode="embedded"] .nx-you{max-width:min(85%,620px);padding:12px 16px;border:0;border-radius:20px;font-size:16px;line-height:1.55;background:var(--panel-2)}
#nixDock[data-mode="embedded"] .nx-turn{gap:12px}
#nixDock[data-mode="embedded"][data-open="true"] .nx-comp{display:grid;grid-template-columns:44px minmax(0,1fr) 44px 44px;grid-template-rows:auto 44px;flex-shrink:0;width:calc(100% - 36px);max-width:760px;align-self:center;margin:0 18px max(18px,env(safe-area-inset-bottom,0px));padding:12px;border:1px solid var(--line-soft);border-radius:28px;background:var(--panel-2);box-shadow:0 4px 18px #00000012}
#nixDock[data-mode="embedded"] .nx-input{grid-column:1/-1;grid-row:1;width:100%;min-height:44px;font-size:16px;line-height:24px;padding:8px 6px;max-height:120px}
#nixDock[data-mode="embedded"] .nx-plus{grid-column:1;grid-row:2}
#nixDock[data-mode="embedded"] .nx-mic{grid-column:3;grid-row:2}
#nixDock[data-mode="embedded"] .nx-send{grid-column:4;grid-row:2}
#nixDock[data-mode="embedded"] .nx-plus,#nixDock[data-mode="embedded"] .nx-send,#nixDock[data-mode="embedded"] .nx-mic{width:44px;height:44px}
#nixDock[data-mode="embedded"] .nx-plus{border:0;background:transparent}
#nixDock[data-mode="embedded"] .nx-plus svg,#nixDock[data-mode="embedded"] .nx-send svg{width:18px;height:18px}
#nixDock[data-mode="embedded"] .nx-queue-box,#nixDock[data-mode="embedded"] .nx-attach,#nixDock[data-mode="embedded"] .nx-attach-note,#nixDock[data-mode="embedded"] .nx-credit{width:calc(100% - 36px);max-width:760px;align-self:center;flex-shrink:0}
#nixDock[data-mode="embedded"] .nx-queue-box{max-height:18dvh;margin-bottom:8px}
#nixDock[data-mode="embedded"] .nx-attach{border:0;padding:8px 0}
#nixDock[data-mode="embedded"]>.nx-mascot{position:absolute;left:calc(50% - 44px);top:calc(45% - 134px);width:88px;height:88px;pointer-events:none;cursor:default;visibility:hidden;transform:none}
#nixDock[data-mode="embedded"][data-empty="true"] .nx-panel{justify-content:center}
#nixDock[data-mode="embedded"][data-empty="true"] .nx-msgs{flex:0 1 auto;padding:0 18px 24px;justify-content:center;overflow:visible}
#nixDock[data-mode="embedded"][data-empty="true"] .nx-comp{margin-bottom:0}
#nixDock[data-mode="embedded"] .nx-welcome{align-items:center;text-align:center;gap:12px}
#nixDock[data-mode="embedded"] .nx-welcome>.nx-mascot{position:relative;inset:auto;transform:none;order:-2;width:88px;height:88px;margin-bottom:8px;visibility:visible;pointer-events:none;cursor:default}
#nixDock[data-mode="embedded"] .nx-welcome-title{order:-1;margin:0;font-size:clamp(25px,2.6vw,34px);line-height:1.2;font-weight:600;letter-spacing:-.035em}
#nixDock[data-mode="embedded"] .nx-welcome .nx-said{color:var(--mut);max-width:460px;font-size:15px}
#nixDock[data-mode="embedded"][data-empty="false"] .nx-welcome{display:none}
#nixDock[data-mode="embedded"] .nx-stop,#nixDock[data-mode="embedded"] .nx-chip button{min-width:44px;min-height:44px}
@media(max-width:540px){#nixDock[data-mode="embedded"][data-open="true"] .nx-msgs{padding-left:18px;padding-right:18px}#nixDock[data-mode="embedded"][data-open="true"] .nx-comp{border-radius:24px;padding:9px;gap:6px}#nixDock[data-mode="embedded"] .nx-you{max-width:90%}#nixDock[data-mode="embedded"] .nx-welcome-title{font-size:27px}#nixDock[data-mode="embedded"] .nx-welcome .nx-said{font-size:14px}}

/* Nix owns streaming scroll position, including the final layout pass. */
.nx-msgs { overflow-anchor: none; scroll-behavior: auto; }
.nx-msgs > * { flex-shrink: 0; }
