/* =========================================================================
   Chat de www.getpuente.com (Ronno). Sistema v2: tarjeta oscura de vidrio,
   píldora blanca, Geist Mono para rótulos. Todo bajo .pc.
   ========================================================================= */
.pc { position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); z-index: 80; font-family: var(--font-body); }

.pc-launch {
  display: inline-flex; align-items: center; gap: 9px;
  height: 44px; padding: 0 18px 0 14px;
  border: 0; border-radius: var(--r-pill); cursor: pointer;
  background: #fff; color: #0e0d0c; font-size: 14px; font-weight: 500;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2), 0 18px 40px -12px rgba(0, 0, 0, 0.7);
  transition: transform .2s var(--ease), background .2s var(--ease);
}
.pc-launch:hover { background: var(--lila-claro); }
.pc-launch:active { transform: scale(0.98); }
.pc-launch__ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; }
.pc-launch__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px rgba(62, 207, 142, 0.22); }
.pc[data-open="true"] .pc-launch { display: none; }

.pc-panel {
  width: min(380px, calc(100vw - 32px));
  height: min(560px, calc(100dvh - 32px));
  display: flex; flex-direction: column;
  background: #1b1a1f; color: var(--ink);
  border-radius: var(--r-lg);
  box-shadow: 0 0 0 1px var(--line-2), 0 40px 80px -30px rgba(0, 0, 0, 0.85);
  overflow: hidden;
}
.pc-panel[hidden] { display: none; }

.pc-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 14px 12px 16px; border-bottom: 1px solid var(--line); }
.pc-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.pc-iso { flex: none; }
.pc-title { margin: 0; font-size: 14px; font-weight: 500; }
.pc-sub { margin: 2px 0 0; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .04em; color: var(--muted); }
.pc-close { flex: none; width: 32px; height: 32px; border: 0; border-radius: 50%; background: var(--glass); color: var(--ink-2); font-size: 20px; line-height: 1; cursor: pointer; }
.pc-close:hover { background: var(--glass-2); color: var(--ink); }

.pc-list { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; scroll-behavior: smooth; }
.pc-msg { max-width: 86%; padding: 10px 13px; border-radius: 14px; font-size: 14px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.pc-msg--them { align-self: flex-start; background: var(--glass); box-shadow: inset 0 0 0 1px var(--line); border-bottom-left-radius: 4px; color: var(--ink-2); }
.pc-msg--me { align-self: flex-end; background: #fff; color: #0e0d0c; border-bottom-right-radius: 4px; }
.pc-msg__who { display: block; margin-bottom: 3px; font-family: var(--font-mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--lila-claro); }
.pc-typing { display: inline-flex; gap: 4px; padding: 13px 14px; }
.pc-typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: pc-dot 1s infinite ease-in-out; }
.pc-typing i:nth-child(2) { animation-delay: .15s; }
.pc-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes pc-dot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

.pc-ident { padding: 12px 16px 4px; display: grid; gap: 10px; border-top: 1px solid var(--line); }
.pc-ident[hidden] { display: none; }
.pc-ident__txt { margin: 0; font-size: 13px; color: var(--ink-2); }
.pc-field { display: grid; gap: 5px; font-size: 12px; color: var(--muted); }
.pc-field input, .pc-input {
  width: 100%; font: inherit; font-size: 14px; color: var(--ink);
  background: rgba(0, 0, 0, 0.28); border: 0; border-radius: var(--r-md);
  box-shadow: inset 0 0 0 1px var(--line-2); padding: 10px 12px;
}
.pc-field input:focus, .pc-input:focus { outline: 0; box-shadow: inset 0 0 0 1px var(--lila-claro), 0 0 0 3px rgba(201, 189, 230, 0.16); }
.pc-err { margin: 0; font-size: 12.5px; color: #f2a3a3; }

.pc-form { display: flex; align-items: flex-end; gap: 8px; padding: 12px 12px 8px 16px; border-top: 1px solid var(--line); position: relative; }
.pc-input { resize: none; min-height: 42px; max-height: 120px; line-height: 1.45; }
.pc-input::placeholder { color: var(--muted-2); }
.pc-send { flex: none; width: 42px; height: 42px; border: 0; border-radius: 50%; background: #fff; color: #0e0d0c; cursor: pointer; display: grid; place-items: center; }
.pc-send:hover { background: var(--lila-claro); }
.pc-send[disabled] { opacity: .6; cursor: progress; }
.pc-send svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pc-hp { position: absolute; left: -10000px; width: 1px; height: 1px; opacity: 0; }
.pc-foot { margin: 0; padding: 0 16px 12px; font-size: 11.5px; color: var(--muted-2); }

@media (max-width: 480px) {
  .pc-launch__txt { display: none; }
  .pc-launch { width: 48px; height: 48px; padding: 0; justify-content: center; }
  .pc-launch__dot { position: absolute; top: 4px; right: 4px; }
  .pc-launch { position: relative; }
  .pc-panel { width: calc(100vw - 24px); height: calc(100dvh - 24px); }
  .pc { right: 12px; bottom: 12px; }
}
@media (prefers-reduced-motion: reduce) { .pc-typing i { animation: none; } .pc-list { scroll-behavior: auto; } }
