/* Pikfox Phase 4.1.1 — Website Chat Widget Stable Seal */
#pf-chat-widget-root,
#pf-chat-widget-root * {
  box-sizing: border-box;
}

#pf-chat-widget-root {
  --pf-chat-accent: #2563eb;
  --pf-chat-accent-rgb: 37, 99, 235;
  --pf-chat-accent-text: #ffffff;
  --pf-chat-bottom: 24px;
  --pf-chat-side: 24px;
  --pf-chat-z: 2147482000;
  --pf-chat-panel-width: 380px;
  --pf-chat-panel-height: 610px;
  position: fixed;
  inset: auto var(--pf-chat-side) var(--pf-chat-bottom) auto;
  z-index: var(--pf-chat-z);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #172033;
  line-height: 1.45;
  text-align: left;
  pointer-events: none;
}

#pf-chat-widget-root[data-position="left"] {
  inset: auto auto var(--pf-chat-bottom) var(--pf-chat-side);
}

#pf-chat-widget-root[data-hidden="true"] {
  display: none !important;
}

.pf-chat-launcher,
.pf-chat-panel {
  pointer-events: auto;
}

.pf-chat-launcher {
  appearance: none;
  border: 0;
  min-width: 58px;
  min-height: 58px;
  padding: 0 18px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-left: auto;
  background: var(--pf-chat-accent);
  color: var(--pf-chat-accent-text);
  font: inherit;
  font-size: 14px;
  font-weight: 750;
  letter-spacing: -.01em;
  box-shadow: 0 14px 38px rgba(var(--pf-chat-accent-rgb), .34), 0 4px 14px rgba(15, 23, 42, .18);
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, opacity .2s ease;
}

#pf-chat-widget-root[data-position="left"] .pf-chat-launcher {
  margin-left: 0;
  margin-right: auto;
}

.pf-chat-launcher:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 44px rgba(var(--pf-chat-accent-rgb), .4), 0 6px 18px rgba(15, 23, 42, .2);
}

.pf-chat-launcher:focus-visible,
.pf-chat-icon-button:focus-visible,
.pf-chat-primary:focus-visible,
.pf-chat-secondary:focus-visible,
.pf-chat-textarea:focus-visible,
.pf-chat-input:focus-visible,
.pf-chat-checkbox:focus-visible {
  outline: 3px solid rgba(var(--pf-chat-accent-rgb), .25);
  outline-offset: 2px;
}

.pf-chat-launcher-icon {
  width: 24px;
  height: 24px;
  display: inline-flex;
  flex: 0 0 auto;
}

.pf-chat-launcher-icon svg,
.pf-chat-icon-button svg,
.pf-chat-send-icon svg {
  width: 100%;
  height: 100%;
  display: block;
  fill: currentColor;
}

.pf-chat-launcher-label {
  white-space: nowrap;
}

.pf-chat-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border: 2px solid #fff;
  border-radius: 999px;
  display: none;
  align-items: center;
  justify-content: center;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  box-shadow: 0 4px 10px rgba(15, 23, 42, .2);
}

.pf-chat-badge[data-visible="true"] {
  display: inline-flex;
}

.pf-chat-launcher-wrap {
  position: relative;
  display: flex;
  justify-content: flex-end;
}

#pf-chat-widget-root[data-position="left"] .pf-chat-launcher-wrap {
  justify-content: flex-start;
}

.pf-chat-panel {
  width: min(var(--pf-chat-panel-width), calc(100vw - 24px));
  height: min(var(--pf-chat-panel-height), calc(100vh - var(--pf-chat-bottom) - 82px));
  min-height: 430px;
  margin-bottom: 14px;
  display: none;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, .08);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(15, 23, 42, .24), 0 8px 24px rgba(15, 23, 42, .12);
  transform-origin: bottom right;
}

#pf-chat-widget-root[data-position="left"] .pf-chat-panel {
  transform-origin: bottom left;
}

.pf-chat-panel[data-open="true"] {
  display: flex;
  animation: pf-chat-enter .22s ease-out;
}

@keyframes pf-chat-enter {
  from { opacity: 0; transform: translateY(10px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.pf-chat-header {
  min-height: 76px;
  padding: 15px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--pf-chat-accent);
  background: linear-gradient(135deg, var(--pf-chat-accent), color-mix(in srgb, var(--pf-chat-accent) 78%, #111827));
  color: var(--pf-chat-accent-text);
}

.pf-chat-avatar {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  background: color-mix(in srgb, var(--pf-chat-accent-text) 18%, transparent);
  border: 1px solid color-mix(in srgb, var(--pf-chat-accent-text) 24%, transparent);
  font-weight: 800;
  font-size: 16px;
  backdrop-filter: blur(6px);
  overflow: hidden;
}

.pf-chat-avatar-image{width:100%;height:100%;display:block;object-fit:contain;padding:5px}.pf-chat-avatar-image[hidden],.pf-chat-avatar-fallback[hidden]{display:none!important}

.pf-chat-header-copy {
  min-width: 0;
  flex: 1;
}

.pf-chat-title {
  margin: 0;
  color: inherit;
  font-size: 16px;
  line-height: 1.25;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pf-chat-status-line {
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: inherit;
  opacity: .84;
  font-size: 12px;
}

.pf-chat-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #86efac;
  box-shadow: 0 0 0 3px rgba(134,239,172,.18);
}

.pf-chat-status-dot[data-state="offline"] {
  background: #fde68a;
  box-shadow: 0 0 0 3px rgba(253,230,138,.18);
}

.pf-chat-icon-button {
  appearance: none;
  border: 0;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  background: color-mix(in srgb, var(--pf-chat-accent-text) 12%, transparent);
  color: inherit;
  cursor: pointer;
  transition: background .18s ease;
}

.pf-chat-icon-button:hover {
  background: color-mix(in srgb, var(--pf-chat-accent-text) 22%, transparent);
}

.pf-chat-body {
  position: relative;
  min-height: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #f7f8fb;
}

.pf-chat-screen {
  min-height: 0;
  flex: 1;
  display: none;
  flex-direction: column;
}

.pf-chat-screen[data-active="true"] {
  display: flex;
}

.pf-chat-start {
  overflow-y: auto;
  padding: 22px 18px 18px;
}

.pf-chat-welcome {
  margin: 0 0 18px;
  color: #334155;
  font-size: 14px;
  white-space: pre-wrap;
}

.pf-chat-form {
  display: grid;
  gap: 12px;
}

.pf-chat-field {
  display: grid;
  gap: 6px;
}

.pf-chat-field[data-hidden="true"] {
  display: none;
}

.pf-chat-label {
  color: #334155;
  font-size: 12px;
  font-weight: 700;
}

.pf-chat-required {
  color: #dc2626;
}

.pf-chat-input,
.pf-chat-textarea {
  width: 100%;
  border: 1px solid #dbe1ea;
  border-radius: 12px;
  background: #fff;
  color: #172033;
  font: inherit;
  font-size: 14px;
  transition: border-color .18s ease, box-shadow .18s ease;
}

.pf-chat-input {
  min-height: 44px;
  padding: 10px 12px;
}

.pf-chat-textarea {
  min-height: 96px;
  max-height: 180px;
  padding: 11px 12px;
  resize: vertical;
}

.pf-chat-input:hover,
.pf-chat-textarea:hover {
  border-color: #c2cad7;
}

.pf-chat-consent {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: #475569;
  font-size: 12px;
  line-height: 1.5;
}

.pf-chat-consent[data-hidden="true"] {
  display: none;
}

.pf-chat-checkbox {
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
  accent-color: var(--pf-chat-accent);
  flex: 0 0 auto;
}

.pf-chat-consent a {
  color: var(--pf-chat-accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.pf-chat-primary,
.pf-chat-secondary {
  appearance: none;
  border-radius: 12px;
  min-height: 44px;
  padding: 10px 14px;
  font: inherit;
  font-size: 14px;
  font-weight: 750;
  cursor: pointer;
  transition: opacity .18s ease, transform .18s ease, background .18s ease;
}

.pf-chat-primary {
  border: 1px solid var(--pf-chat-accent);
  background: var(--pf-chat-accent);
  color: var(--pf-chat-accent-text);
}

.pf-chat-secondary {
  border: 1px solid #dbe1ea;
  background: #fff;
  color: #334155;
}

.pf-chat-primary:hover,
.pf-chat-secondary:hover {
  transform: translateY(-1px);
}

.pf-chat-primary:disabled,
.pf-chat-secondary:disabled,
.pf-chat-send:disabled {
  opacity: .58;
  cursor: not-allowed;
  transform: none;
}

.pf-chat-error,
.pf-chat-info {
  display: none;
  border-radius: 11px;
  padding: 9px 11px;
  font-size: 12px;
  line-height: 1.45;
}

.pf-chat-error[data-visible="true"] {
  display: block;
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.pf-chat-info[data-visible="true"] {
  display: block;
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.pf-chat-loading {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 30px;
  color: #64748b;
  text-align: center;
  font-size: 13px;
}

.pf-chat-spinner {
  width: 26px;
  height: 26px;
  margin: 0 auto 10px;
  border: 3px solid #dbe4f0;
  border-top-color: var(--pf-chat-accent);
  border-radius: 999px;
  animation: pf-chat-spin .75s linear infinite;
}

@keyframes pf-chat-spin { to { transform: rotate(360deg); } }

.pf-chat-thread {
  min-height: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.pf-chat-history {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px 14px 12px;
  scroll-behavior: smooth;
}

.pf-chat-load-older {
  display: none;
  margin: 0 auto 12px;
  border: 0;
  background: transparent;
  color: var(--pf-chat-accent);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.pf-chat-load-older[data-visible="true"] { display: block; }

.pf-chat-message-row {
  display: flex;
  margin: 8px 0;
}

.pf-chat-message-row[data-sender="guest"] {
  justify-content: flex-end;
}

.pf-chat-message-row[data-sender="staff"] {
  justify-content: flex-start;
}

.pf-chat-message {
  max-width: 82%;
}

.pf-chat-bubble {
  padding: 10px 12px;
  border-radius: 15px;
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.pf-chat-message-row[data-sender="guest"] .pf-chat-bubble {
  border-bottom-right-radius: 5px;
  background: var(--pf-chat-accent);
  color: var(--pf-chat-accent-text);
}

.pf-chat-message-row[data-sender="staff"] .pf-chat-bubble {
  border-bottom-left-radius: 5px;
  background: #fff;
  color: #243047;
  border: 1px solid #e3e8ef;
  box-shadow: 0 2px 8px rgba(15,23,42,.05);
}

.pf-chat-message-time {
  margin-top: 4px;
  color: #94a3b8;
  font-size: 10px;
}

.pf-chat-message-row[data-sender="guest"] .pf-chat-message-time {
  text-align: right;
}

.pf-chat-system-note {
  margin: 10px 14px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
  font-size: 12px;
  text-align: center;
}

.pf-chat-composer {
  padding: 11px 12px 12px;
  border-top: 1px solid #e7ebf1;
  background: #fff;
}

.pf-chat-composer-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.pf-chat-composer .pf-chat-textarea {
  min-height: 44px;
  max-height: 118px;
  resize: none;
  padding: 10px 12px;
}

.pf-chat-send {
  appearance: none;
  border: 0;
  width: 44px;
  height: 44px;
  border-radius: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  background: var(--pf-chat-accent);
  color: var(--pf-chat-accent-text);
  cursor: pointer;
}

.pf-chat-send-icon {
  width: 20px;
  height: 20px;
  display: block;
}

.pf-chat-char-count {
  margin-top: 5px;
  color: #94a3b8;
  font-size: 10px;
  text-align: right;
}

.pf-chat-closed-actions {
  padding: 12px;
  border-top: 1px solid #e7ebf1;
  background: #fff;
}

.pf-chat-closed-actions .pf-chat-primary {
  width: 100%;
}

.pf-chat-powered {
  padding: 7px 12px;
  background: #fff;
  color: #94a3b8;
  font-size: 10px;
  text-align: center;
  border-top: 1px solid #f0f2f5;
}

.pf-chat-powered strong { color: #64748b; }

.pf-chat-sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.pf-chat-honeypot {
  position: absolute !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

@media (max-width: 640px) {
  #pf-chat-widget-root {
    --pf-chat-bottom: 12px;
    --pf-chat-side: 12px;
  }

  .pf-chat-panel {
    width: calc(100vw - 16px);
    height: calc(100dvh - 82px);
    max-height: 720px;
    min-height: 0;
    margin-bottom: 10px;
    border-radius: 20px;
  }

  .pf-chat-launcher {
    min-width: 56px;
    min-height: 56px;
    padding: 0 16px;
  }

  .pf-chat-launcher-label {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pf-chat-panel[data-open="true"],
  .pf-chat-spinner {
    animation: none;
  }
  .pf-chat-launcher,
  .pf-chat-primary,
  .pf-chat-secondary {
    transition: none;
  }
  .pf-chat-history { scroll-behavior: auto; }
}

/* Phase 4.0.6.1 — authenticated customer greeting */
.pf-chat-auth-banner{display:flex;align-items:center;gap:9px;margin:0 0 10px;padding:10px 12px;border:1px solid rgba(var(--pf-chat-accent-rgb),.2);border-radius:13px;background:rgba(var(--pf-chat-accent-rgb),.08);color:#172033;font-size:14px;font-weight:750;line-height:1.35}
.pf-chat-auth-banner[hidden]{display:none!important}.pf-chat-auth-check{display:inline-flex;align-items:center;justify-content:center;width:22px;height:22px;flex:0 0 22px;border-radius:999px;background:var(--pf-chat-accent);color:var(--pf-chat-accent-text);font-size:13px;font-weight:900}.pf-chat-auth-greeting{min-width:0;overflow-wrap:anywhere}

/* Phase 4.1 — Rule-based Chat Bot */
.pf-chat-message-row[data-sender="bot"]{justify-content:flex-start}
.pf-chat-message-row[data-sender="bot"] .pf-chat-message{max-width:88%}
.pf-chat-message-row[data-sender="bot"] .pf-chat-bubble{border-bottom-left-radius:5px;background:rgba(var(--pf-chat-accent-rgb),.08);color:#1e293b;border:1px solid rgba(var(--pf-chat-accent-rgb),.22);box-shadow:0 2px 8px rgba(15,23,42,.04)}
.pf-chat-bot-label{display:flex;align-items:center;gap:6px;margin:0 0 5px 4px;color:var(--pf-chat-accent);font-size:11px;font-weight:800}
.pf-chat-bot-label::before{content:"✦";display:inline-grid;place-items:center;width:16px;height:16px;border-radius:999px;background:rgba(var(--pf-chat-accent-rgb),.12);font-size:10px}
.pf-chat-message-actions{display:flex;flex-wrap:wrap;gap:7px;margin-top:8px}
.pf-chat-action-button{appearance:none;border:1px solid rgba(var(--pf-chat-accent-rgb),.34);background:#fff;color:var(--pf-chat-accent);border-radius:999px;padding:7px 11px;font:inherit;font-size:12px;font-weight:750;line-height:1.2;cursor:pointer;transition:background .15s ease,border-color .15s ease,transform .15s ease}
.pf-chat-action-button:hover{background:rgba(var(--pf-chat-accent-rgb),.08);border-color:var(--pf-chat-accent);transform:translateY(-1px)}
.pf-chat-action-button:focus-visible{outline:3px solid rgba(var(--pf-chat-accent-rgb),.2);outline-offset:2px}
