/* Pixel — Pixelent's on-site AI agent widget */
.px-root {
  --px-ink: #0c0e13; --px-ink-2: #12151c; --px-ink-3: #1a1e27;
  --px-line: rgba(237,234,227,0.1); --px-line-2: rgba(237,234,227,0.18);
  --px-text: #edeae3; --px-text-2: #b8b5ae; --px-muted: #8a8990;
  --px-accent: #ff5b2e; --px-accent-2: #ff8a5c; --px-ok: #3ddc97;
  font-family: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--px-text);
  -webkit-font-smoothing: antialiased;
}
.px-root *, .px-root *::before, .px-root *::after { box-sizing: border-box; }
.px-root .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Launcher */
.px-launcher {
  position: fixed; right: 22px; bottom: 22px; z-index: 900;
  display: inline-flex; align-items: center; gap: 12px; height: 58px; padding: 0 20px 0 9px;
  border-radius: 999px; border: 1px solid var(--px-line-2); background: rgba(18,21,28,0.92);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  color: var(--px-text); font: inherit; font-size: 15px; font-weight: 500; cursor: pointer;
  box-shadow: 0 18px 40px -12px rgba(0,0,0,.7);
  transition: transform .3s cubic-bezier(.2,.7,.2,1), opacity .3s, border-color .3s;
}
.px-launcher:hover { transform: translateY(-2px); border-color: rgba(255,91,46,.6); }
.px-launcher:focus-visible { outline: 2px solid var(--px-accent); outline-offset: 3px; }
.px-launcher .px-av { width: 40px; height: 40px; }
.px-launcher .px-live { width: 8px; height: 8px; border-radius: 50%; background: var(--px-ok); box-shadow: 0 0 0 3px rgba(61,220,151,.18); }
.px-open .px-launcher { opacity: 0; pointer-events: none; transform: translateY(10px); }

.px-av { flex: none; border-radius: 12px; background: var(--px-accent); display: grid; place-items: center; position: relative; }
.px-av svg { width: 55%; height: 55%; }
.px-av::after { content: ""; position: absolute; inset: -4px; border-radius: 15px; border: 1px solid rgba(255,91,46,.5); animation: pxPulse 2.6s infinite; }
@keyframes pxPulse { 0% { opacity: .9; transform: scale(.94); } 70%, 100% { opacity: 0; transform: scale(1.18); } }

/* Nudge */
.px-nudge {
  position: fixed; right: 22px; bottom: 92px; z-index: 899; width: 290px; padding: 16px 40px 16px 16px;
  border-radius: 16px; background: var(--px-ink-2); border: 1px solid var(--px-line-2);
  box-shadow: 0 24px 50px -16px rgba(0,0,0,.75); font-size: 14.5px; line-height: 1.5; color: var(--px-text-2);
  opacity: 0; transform: translateY(8px); transition: all .35s cubic-bezier(.2,.7,.2,1); pointer-events: none;
}
.px-nudge.is-on { opacity: 1; transform: none; pointer-events: auto; }
.px-nudge strong { color: var(--px-text); font-weight: 500; }
.px-nudge button.px-nudge-go { display: block; margin-top: 10px; background: none; border: 0; padding: 0; color: var(--px-accent); font: inherit; font-weight: 500; cursor: pointer; }
.px-nudge button.px-nudge-x { position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; border-radius: 8px; border: 0; background: none; color: var(--px-muted); cursor: pointer; font-size: 18px; line-height: 1; }
.px-nudge button.px-nudge-x:hover { color: var(--px-text); background: var(--px-ink-3); }
.px-open .px-nudge { display: none; }

/* Panel */
.px-panel {
  position: fixed; right: 22px; bottom: 22px; z-index: 901; width: 404px; height: min(680px, calc(100vh - 44px));
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--px-ink); border: 1px solid var(--px-line-2); border-radius: 22px;
  box-shadow: 0 50px 100px -30px rgba(0,0,0,.85), 0 0 0 1px rgba(255,255,255,.02) inset;
  opacity: 0; visibility: hidden; transform: translateY(14px) scale(.985); transform-origin: bottom right;
  transition: opacity .3s cubic-bezier(.2,.7,.2,1), transform .3s cubic-bezier(.2,.7,.2,1), visibility .3s;
}
.px-open .px-panel { opacity: 1; visibility: visible; transform: none; }
.px-head { display: flex; align-items: center; gap: 12px; padding: 16px 14px 16px 18px; border-bottom: 1px solid var(--px-line); background: linear-gradient(180deg, var(--px-ink-2), var(--px-ink)); }
.px-head .px-av { width: 40px; height: 40px; }
.px-head .px-who { flex: 1; min-width: 0; }
.px-head strong { display: block; font-weight: 500; font-size: 15.5px; }
.px-head small { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--px-muted); }
.px-head small::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--px-ok); }
.px-icon-btn { width: 36px; height: 36px; border-radius: 10px; border: 0; background: none; color: var(--px-text-2); display: grid; place-items: center; cursor: pointer; }
.px-icon-btn:hover { background: var(--px-ink-3); color: var(--px-text); }
.px-icon-btn:focus-visible { outline: 2px solid var(--px-accent); outline-offset: 1px; }
.px-icon-btn svg { width: 18px; height: 18px; }

.px-log { flex: 1; overflow-y: auto; padding: 18px 16px 8px; display: flex; flex-direction: column; gap: 10px; scroll-behavior: smooth; }
.px-log::-webkit-scrollbar { width: 6px; } .px-log::-webkit-scrollbar-thumb { background: var(--px-line-2); border-radius: 6px; }
.px-msg { max-width: 88%; padding: 11px 14px; border-radius: 16px; font-size: 14.5px; line-height: 1.55; word-wrap: break-word; animation: pxIn .35s cubic-bezier(.2,.7,.2,1); }
.px-msg p { margin: 0; } .px-msg p + p { margin-top: 8px; }
.px-msg a { color: var(--px-accent-2); text-decoration: underline; text-underline-offset: 2px; }
.px-msg strong { font-weight: 600; color: var(--px-text); }
.px-msg--bot { align-self: flex-start; background: var(--px-ink-2); border: 1px solid var(--px-line); border-bottom-left-radius: 5px; color: var(--px-text-2); }
.px-msg--user { align-self: flex-end; background: var(--px-accent); color: #0b0c10; border-bottom-right-radius: 5px; font-weight: 450; }
.px-msg--note { align-self: center; max-width: 100%; background: none; padding: 4px 10px; font-family: "Geist Mono", ui-monospace, monospace; font-size: 11.5px; color: var(--px-muted); border: 1px dashed var(--px-line-2); border-radius: 999px; text-align: center; }
.px-msg--card { align-self: stretch; max-width: 100%; background: linear-gradient(160deg, #1c120f, var(--px-ink-2)); border: 1px solid rgba(255,91,46,.3); border-radius: 16px; padding: 16px; }
.px-msg--card .px-k { font-family: "Geist Mono", ui-monospace, monospace; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--px-muted); margin-bottom: 6px; }
.px-msg--card .px-big { font-family: "Instrument Serif", Georgia, serif; font-size: 40px; line-height: 1; color: var(--px-accent); }
.px-msg--card .px-row { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--px-text-2); padding-top: 8px; margin-top: 10px; border-top: 1px solid var(--px-line); }
.px-msg--card .px-row b { font-family: "Geist Mono", ui-monospace, monospace; font-weight: 500; color: var(--px-text); }
@keyframes pxIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.px-typing { align-self: flex-start; display: inline-flex; gap: 4px; padding: 13px 14px; border-radius: 16px; border-bottom-left-radius: 5px; background: var(--px-ink-2); border: 1px solid var(--px-line); }
.px-typing i { width: 6px; height: 6px; border-radius: 2px; background: var(--px-accent); animation: pxBlink 1s infinite ease-in-out; }
.px-typing i:nth-child(2) { animation-delay: .15s; } .px-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes pxBlink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

.px-chips { display: flex; flex-wrap: wrap; gap: 7px; padding: 4px 0 6px; animation: pxIn .35s cubic-bezier(.2,.7,.2,1); }
.px-chip {
  min-height: 36px; padding: 7px 13px; border-radius: 999px; border: 1px solid var(--px-line-2); background: transparent;
  color: var(--px-text); font: inherit; font-size: 13.5px; cursor: pointer; text-align: left; line-height: 1.35;
  transition: border-color .2s, background-color .2s, color .2s;
}
.px-chip:hover { border-color: var(--px-accent); background: rgba(255,91,46,.08); }
.px-chip:focus-visible { outline: 2px solid var(--px-accent); outline-offset: 2px; }
.px-chip--primary { background: var(--px-accent); border-color: var(--px-accent); color: #0b0c10; font-weight: 500; }
.px-chip--primary:hover { background: var(--px-accent-2); border-color: var(--px-accent-2); }
a.px-chip { text-decoration: none; display: inline-flex; align-items: center; }

.px-compose { display: flex; align-items: flex-end; gap: 8px; padding: 12px 12px 10px; border-top: 1px solid var(--px-line); background: var(--px-ink); }
.px-compose textarea {
  flex: 1; min-height: 44px; max-height: 120px; resize: none; padding: 11px 14px; border-radius: 14px;
  border: 1px solid var(--px-line-2); background: var(--px-ink-2); color: var(--px-text); font: inherit; font-size: 15px; line-height: 1.4;
}
.px-compose textarea::placeholder { color: var(--px-muted); }
.px-compose textarea:focus { outline: none; border-color: rgba(255,91,46,.7); }
.px-send { width: 44px; height: 44px; flex: none; border-radius: 14px; border: 0; background: var(--px-accent); color: #0b0c10; display: grid; place-items: center; cursor: pointer; transition: background-color .2s, opacity .2s; }
.px-send:hover { background: var(--px-accent-2); }
.px-send:disabled { opacity: .4; cursor: default; }
.px-send svg { width: 18px; height: 18px; }
.px-disclose { padding: 0 16px 12px; font-size: 11.5px; color: var(--px-muted); line-height: 1.45; background: var(--px-ink); }

@media (max-width: 560px) {
  .px-launcher { right: 14px; bottom: 14px; height: 56px; padding: 0 8px; }
  .px-launcher .px-label, .px-launcher .px-live { display: none; }
  .px-nudge { right: 14px; bottom: 82px; width: calc(100vw - 28px); max-width: 320px; }
  .px-panel { right: 0; bottom: 0; width: 100%; height: 100%; height: 100dvh; border-radius: 0; border: 0; }
  .px-compose textarea { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .px-root *, .px-root *::before, .px-root *::after { animation: none !important; transition-duration: .001ms !important; }
}
.px-human { height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--px-line-2); background: none; color: var(--px-text); font: inherit; font-size: 12.5px; font-weight: 500; cursor: pointer; white-space: nowrap; transition: border-color .2s, background-color .2s; }
.px-human:hover { border-color: var(--px-accent); background: rgba(255,91,46,.08); }
.px-human:focus-visible { outline: 2px solid var(--px-accent); outline-offset: 2px; }
.px-disclose a { color: var(--px-text-2); text-decoration: underline; text-underline-offset: 2px; }
@media (max-width: 380px) { .px-head small { display: none; } }
.px-head strong, .px-head small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.px-head small { display: block; }
.px-head small::before { display: inline-block; margin-right: 6px; vertical-align: 1px; }
