/* Page One Assistant — front-end service desk widget.
   Palette matches the Page One site: breaker black, red, voltage yellow. */

.p1-chat-avatar{
  position:fixed; right:22px; bottom:calc(22px + env(safe-area-inset-bottom,0px));
  width:62px; height:62px; border-radius:50%; cursor:pointer;
  /* must sit above the cold-open overlay and the emergency bar */
  z-index:2147483000;
  background:#0E1421; border:2px solid #CE1126; overflow:hidden;
  display:flex; align-items:center; justify-content:center;
  box-shadow:0 10px 30px rgba(0,0,0,.45);
  transition:transform .2s ease, box-shadow .2s ease;
}
.p1-chat-avatar:hover{ transform:translateY(-3px); box-shadow:0 14px 36px rgba(0,0,0,.55); }
.p1-chat-avatar img{ width:100%; height:100%; object-fit:contain; display:block; }

.p1-chat-panel{
  position:fixed; right:22px; bottom:calc(22px + env(safe-area-inset-bottom,0px));
  z-index:2147483001;
  width:378px; max-width:calc(100vw - 32px);
  height:560px; max-height:calc(100vh - 110px);
  background:#080B12; border:1px solid #27324A; border-radius:6px;
  display:none; flex-direction:column; overflow:hidden;
  box-shadow:0 26px 70px rgba(0,0,0,.65);
  font-family:'IBM Plex Sans',system-ui,-apple-system,sans-serif;
}

.p1-header{
  background:#0E1421; border-bottom:1px solid #27324A;
  padding:15px 18px; display:flex; align-items:center; justify-content:space-between;
  color:#F2F4F8; font-weight:600; font-size:14.5px; flex:0 0 auto;
}
.p1-close{
  background:none; border:0; color:#98A2B5; font-size:24px; line-height:1;
  cursor:pointer; padding:0 4px;
}
.p1-close:hover{ color:#F2F4F8; }

.p1-messages{
  flex:1 1 auto; overflow-y:auto; padding:18px;
  display:flex; flex-direction:column; gap:11px; background:#080B12;
}

.p1-message{ display:flex; }
.p1-bot{ justify-content:flex-start; }
.p1-user{ justify-content:flex-end; }

.p1-bubble{
  max-width:84%; padding:11px 14px; border-radius:4px;
  font-size:14px; line-height:1.5; word-wrap:break-word;
}
.p1-bot .p1-bubble{ background:#18202F; border:1px solid #27324A; color:#F2F4F8; }
.p1-user .p1-bubble{ background:#CE1126; color:#ffffff; font-weight:500; }

.p1-typing{
  font-family:'IBM Plex Mono',monospace; font-size:11.5px;
  color:#98A2B5; padding:4px 2px; letter-spacing:.03em;
}

/* emergency call-out inside the transcript */
.p1-urgent{
  display:block; text-align:center; text-decoration:none;
  background:#B23A2E; color:#fff; font-weight:700; font-size:14.5px;
  padding:13px; border-radius:4px; margin:4px 0;
  letter-spacing:.02em;
}
.p1-urgent:hover{ background:#C8483A; }

/* structured lead capture */
.p1-capture{
  background:#0E1421; border:1px solid #27324A; border-radius:4px;
  padding:15px; margin:4px 0; display:flex; flex-direction:column; gap:8px;
}
.p1-capture-t{
  font-family:'IBM Plex Mono',monospace; font-size:11px; letter-spacing:.08em;
  text-transform:uppercase; color:#98A2B5; margin-bottom:2px;
}
.p1-capture input{
  width:100%; background:#080B12; border:1px solid #27324A; color:#F2F4F8;
  padding:10px 11px; border-radius:2px; font-size:14px;
  font-family:'IBM Plex Sans',system-ui,sans-serif;
}
.p1-capture input:focus{ outline:none; border-color:#CE1126; }
.p1-capture input::placeholder{ color:#5A6478; }
.p1-f-send{
  background:#CE1126; color:#ffffff; border:0; padding:11px;
  border-radius:2px; cursor:pointer; font-weight:600; font-size:14px;
  font-family:'IBM Plex Sans',system-ui,sans-serif; margin-top:2px;
}
.p1-f-send:hover{ background:#E8323F; }
.p1-f-send:disabled{ opacity:.6; cursor:default; }
.p1-f-err{ color:#E8806F; font-size:12.5px; min-height:1px; }

.p1-input{
  display:flex; gap:9px; padding:13px; border-top:1px solid #27324A;
  background:#0E1421; flex:0 0 auto;
  padding-bottom:calc(13px + env(safe-area-inset-bottom,0px));
}
.p1-input-field{
  flex:1; background:#080B12; border:1px solid #27324A; color:#F2F4F8;
  padding:11px 13px; border-radius:2px; font-size:14.5px;
  font-family:'IBM Plex Sans',system-ui,sans-serif;
}
.p1-input-field:focus{ outline:none; border-color:#CE1126; }
.p1-input-field::placeholder{ color:#5A6478; }
.p1-send{
  background:#1B56A8; color:#ffffff; border:0; padding:11px 19px;
  border-radius:2px; cursor:pointer; font-weight:600; font-size:14px;
  font-family:'IBM Plex Sans',system-ui,sans-serif;
}
.p1-send:hover{ background:#2E78D6; }
.p1-send:disabled{ opacity:.55; cursor:default; }

@media (max-width:520px){
  .p1-chat-avatar{ width:56px; height:56px; }
  .p1-chat-panel{
    right:0; left:0; bottom:0; width:100%; max-width:100%;
    height:100%; max-height:100%; border-radius:0; border-left:0; border-right:0;
    padding-top:env(safe-area-inset-top,0px);
  }
  .p1-chat-avatar{ right:16px; bottom:calc(16px + env(safe-area-inset-bottom,0px)); }
}
