/**
 * ProLive Chat — Widget CSS
 * Modern, animated, glassmorphism-inspired chat widget
 */

/* ── Reset & Variables ─────────────────────────────────────────────────── */
#plc-widget-root *,
#plc-widget-root *::before,
#plc-widget-root *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: inherit;
  line-height: inherit;
  letter-spacing: normal;
  text-transform: none;
}

#plc-widget-root {
  all: initial;
  --plc-primary: #6366f1;
  --plc-primary-dark: #4f46e5;
  --plc-primary-light: #e0e7ff;
  --plc-text: #1e293b;
  --plc-text-muted: #64748b;
  --plc-bg: #ffffff;
  --plc-bg-alt: #f8fafc;
  --plc-border: #e2e8f0;
  --plc-shadow: 0 20px 60px rgba(0,0,0,0.15), 0 4px 20px rgba(0,0,0,0.08);
  --plc-radius: 20px;
  --plc-radius-sm: 12px;
  --plc-radius-xs: 8px;
  --plc-transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --plc-font-size: 14px;
  --plc-widget-width: 380px;
  --plc-widget-height: 580px;
  --plc-z: 999999;

  position: fixed;
  z-index: var(--plc-z);
  display: block;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Inter', sans-serif;
  font-size: var(--plc-font-size);
  line-height: 1.5;
  letter-spacing: normal;
  text-transform: none;
  text-align: left;
  color: var(--plc-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  isolation: isolate;
}

#plc-widget-root button,
#plc-widget-root input,
#plc-widget-root textarea,
#plc-widget-root select {
  font-family: inherit;
  font-size: inherit;
  font-style: inherit;
  font-weight: inherit;
  line-height: inherit;
  letter-spacing: inherit;
}

#plc-widget-root svg {
  flex-shrink: 0;
}

#plc-widget-root img {
  max-width: none;
}

#plc-widget-root,
#plc-widget-root * {
  word-spacing: normal;
}

#plc-widget-root button {
  appearance: none;
  -webkit-appearance: none;
  text-transform: none;
}

#plc-widget-root p,
#plc-widget-root span,
#plc-widget-root div,
#plc-widget-root label,
#plc-widget-root small,
#plc-widget-root strong,
#plc-widget-root em,
#plc-widget-root a {
  line-height: inherit;
  letter-spacing: normal;
}

#plc-widget-root a {
  color: inherit;
}


/* ── Positioning ───────────────────────────────────────────────────────── */
#plc-widget-root.plc-pos-right {
  right: 20px;
  bottom: 20px;
}

#plc-widget-root.plc-pos-left {
  left: 20px;
  bottom: 20px;
}

/* ── Backdrop ─────────────────────────────────────────────────────────── */
#plc-widget-root #plc-widget-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.24);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
}

#plc-widget-root #plc-widget-backdrop.plc-is-visible {
  opacity: 1;
  pointer-events: auto;
}

#plc-widget-root.plc-widget-open #plc-widget-backdrop {
  opacity: 1;
}

/* ── Launcher Button ───────────────────────────────────────────────────── */
#plc-widget-root .plc-launcher-shell {
  position: relative;
  display: inline-flex;
  align-items: flex-end;
  gap: 12px;
  z-index: 2;
}

#plc-widget-root.plc-pos-right .plc-launcher-shell {
  flex-direction: row-reverse;
}

#plc-widget-root.plc-pos-left .plc-launcher-shell {
  flex-direction: row;
}

#plc-widget-root .plc-launcher-dock {
  width: min(248px, calc(100vw - 110px));
  background: rgba(255,255,255,0.96);
  border: 1px solid rgba(148,163,184,0.22);
  border-radius: 18px;
  box-shadow: 0 16px 40px rgba(15,23,42,0.12);
  padding: 12px 14px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: opacity 0.28s ease, transform 0.32s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
  transform: translateY(4px);
}

#plc-widget-root .plc-launcher-shell.is-open .plc-launcher-dock {
  opacity: 0;
  transform: translateY(10px) scale(0.96);
  pointer-events: none;
}

#plc-widget-root .plc-launcher-dock-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

#plc-widget-root .plc-launcher-presence {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 800;
  color: var(--plc-text);
  text-transform: uppercase;
  letter-spacing: .04em;
}

#plc-widget-root .plc-launcher-presence-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #f59e0b;
  box-shadow: 0 0 0 6px rgba(245,158,11,0.16);
  transition: background 0.25s ease, box-shadow 0.25s ease;
}

#plc-widget-root .plc-launcher-shell.is-online .plc-launcher-presence-dot {
  background: #10b981;
  box-shadow: 0 0 0 6px rgba(16,185,129,0.16);
}

#plc-widget-root .plc-launcher-shell.is-typing .plc-launcher-presence-dot {
  background: var(--plc-primary);
  box-shadow: 0 0 0 6px rgba(99,102,241,0.16);
}

#plc-widget-root .plc-launcher-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(99,102,241,0.1);
  color: var(--plc-primary);
  font-size: 10.5px;
  font-weight: 800;
}

#plc-widget-root .plc-launcher-shell.has-unread .plc-launcher-chip {
  background: rgba(239,68,68,0.10);
  color: #dc2626;
}

#plc-widget-root .plc-launcher-dock-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--plc-text);
  line-height: 1.35;
}

#plc-widget-root .plc-launcher-dock-meta {
  margin-top: 4px;
  color: var(--plc-text-muted);
  font-size: 12px;
  line-height: 1.5;
}

#plc-widget-root #plc-launcher {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 28% 28%, rgba(255,255,255,0.28) 0%, rgba(255,255,255,0) 40%),
    linear-gradient(180deg, var(--plc-primary) 0%, var(--plc-primary-dark) 100%);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 26px rgba(99,102,241,0.38), 0 0 0 0 rgba(99,102,241,0.26);
  transition: transform 0.24s ease, box-shadow 0.28s ease, filter 0.28s ease;
  position: relative;
  overflow: hidden;
  animation: plc-pulse-ring 2.7s infinite;
}

#plc-widget-root #plc-launcher::before {
  content: '';
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255,255,255,0.22), rgba(255,255,255,0));
  pointer-events: none;
}

#plc-widget-root #plc-launcher .plc-launcher-orb {
  position: absolute;
  inset: auto auto 8px 8px;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: #10b981;
  box-shadow: 0 0 0 5px rgba(16,185,129,0.16);
  z-index: 1;
  transition: background 0.24s ease, box-shadow 0.24s ease, transform 0.24s ease;
}

#plc-widget-root.plc-is-offline #plc-launcher .plc-launcher-orb {
  background: #f59e0b;
  box-shadow: 0 0 0 5px rgba(245,158,11,0.16);
}

#plc-widget-root.plc-is-typing #plc-launcher .plc-launcher-orb {
  background: var(--plc-primary-light);
  box-shadow: 0 0 0 5px rgba(224,231,255,0.24);
}

#plc-widget-root #plc-launcher:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 14px 34px rgba(99,102,241,0.44);
  filter: saturate(1.04);
}

#plc-widget-root #plc-launcher:active {
  transform: scale(0.96);
}

#plc-widget-root #plc-launcher.plc-is-nudging {
  animation: plc-pulse-ring 2.7s infinite, plc-launcher-nudge 0.75s cubic-bezier(0.22, 1, 0.36, 1);
}

#plc-widget-root #plc-launcher .plc-launcher-icon {
  transition: var(--plc-transition);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  position: relative;
  z-index: 1;
}

#plc-widget-root #plc-launcher .plc-launcher-icon-open {
  position: absolute;
  opacity: 0;
  transform: rotate(90deg) scale(0.5);
  transition: var(--plc-transition);
  color: white;
  z-index: 1;
}

#plc-widget-root #plc-launcher.is-open .plc-launcher-icon {
  opacity: 0;
  transform: rotate(-90deg) scale(0.5);
}

#plc-widget-root #plc-launcher.is-open .plc-launcher-icon-open {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

#plc-widget-root .plc-launcher-shell.is-open #plc-launcher {
  box-shadow: 0 12px 32px rgba(15,23,42,0.22);
  animation: none;
}
/* Unread badge */
#plc-widget-root #plc-launcher-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 20px;
  height: 20px;
  background: #ef4444;
  color: white;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  border: 2px solid white;
  animation: plc-badge-pop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  transition: var(--plc-transition);
}

#plc-widget-root #plc-launcher-badge.plc-is-hidden {
  opacity: 0;
  transform: scale(0);
  pointer-events: none;
}

@keyframes plc-pulse-ring {
  0% { box-shadow: 0 10px 26px rgba(99,102,241,0.38), 0 0 0 0 rgba(99,102,241,0.22); }
  70% { box-shadow: 0 10px 26px rgba(99,102,241,0.38), 0 0 0 14px rgba(99,102,241,0); }
  100% { box-shadow: 0 10px 26px rgba(99,102,241,0.38), 0 0 0 0 rgba(99,102,241,0); }
}

@keyframes plc-launcher-nudge {
  0%, 100% { transform: translateX(0) scale(1); }
  20% { transform: translateX(-2px) scale(1.03); }
  45% { transform: translateX(3px) scale(1.03); }
  70% { transform: translateX(-2px) scale(1.02); }
}

@keyframes plc-badge-pop {
  0% { transform: scale(0); }
  80% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* ── Proactive Bubble ──────────────────────────────────────────────────── */
#plc-widget-root #plc-proactive-bubble {
  position: absolute;
  bottom: 72px;
  right: 0;
  background: white;
  border-radius: 16px 16px 4px 16px;
  padding: 12px 16px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.12);
  width: 240px;
  max-width: calc(100vw - 24px);
  font-size: 13.5px;
  color: var(--plc-text);
  line-height: 1.5;
  animation: plc-bubble-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: pointer;
  border: 1px solid var(--plc-border);
}

#plc-widget-root.plc-pos-left #plc-proactive-bubble {
  right: auto;
  left: 0;
  border-radius: 16px 16px 16px 4px;
}

#plc-widget-root #plc-proactive-bubble:hover {
  box-shadow: 0 12px 40px rgba(0,0,0,0.15);
}

#plc-widget-root #plc-proactive-close {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 22px;
  height: 22px;
  background: #64748b;
  color: white;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

@keyframes plc-bubble-in {
  from { opacity: 0; transform: scale(0.8) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* ── Widget Window ─────────────────────────────────────────────────────── */
#plc-widget-root #plc-widget-window {
  position: absolute;
  bottom: 76px;
  right: 0;
  width: var(--plc-widget-width);
  height: var(--plc-widget-height);
  background: var(--plc-bg);
  border-radius: var(--plc-radius);
  box-shadow: var(--plc-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform-origin: bottom right;
  transition: opacity 0.3s ease, transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  border: 1px solid rgba(0,0,0,0.06);
}

#plc-widget-root.plc-pos-left #plc-widget-window {
  right: auto;
  left: 0;
  transform-origin: bottom left;
}

#plc-widget-root #plc-widget-window.plc-is-hidden {
  opacity: 0;
  transform: scale(0.85) translateY(20px);
  pointer-events: none;
}

#plc-widget-root #plc-widget-window.plc-is-visible {
  opacity: 1;
  transform: scale(1) translateY(0);
}

/* ── Widget Header ─────────────────────────────────────────────────────── */
#plc-widget-root #plc-widget-header {
  background: var(--plc-primary);
  padding: 16px 16px 20px;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

#plc-widget-root #plc-widget-header::before {
  content: '';
  position: absolute;
  top: -30px;
  right: -30px;
  width: 120px;
  height: 120px;
  background: rgba(255,255,255,0.08);
  border-radius: 50%;
}

#plc-widget-root #plc-widget-header::after {
  content: '';
  position: absolute;
  bottom: -40px;
  left: -20px;
  width: 100px;
  height: 100px;
  background: rgba(255,255,255,0.05);
  border-radius: 50%;
}

#plc-widget-root .plc-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  position: relative;
  z-index: 1;
}

#plc-widget-root .plc-header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

#plc-widget-root .plc-header-logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  overflow: hidden;
}

#plc-widget-root .plc-header-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#plc-widget-root .plc-header-title {
  color: white;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.2px;
}

#plc-widget-root .plc-header-subtitle {
  color: rgba(255,255,255,0.8);
  font-size: 11.5px;
  margin-top: 1px;
}

#plc-widget-root .plc-header-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  transition: background 0.2s;
  flex-shrink: 0;
}

#plc-widget-root .plc-header-close:hover {
  background: rgba(255,255,255,0.25);
}

/* Agent avatars row */
#plc-widget-root .plc-header-agents {
  display: flex;
  align-items: center;
  gap: 4px;
  position: relative;
  z-index: 1;
}

#plc-widget-root .plc-header-agent-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.5);
  object-fit: cover;
  margin-left: -6px;
  background: rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: white;
  overflow: hidden;
}

#plc-widget-root .plc-header-agent-avatar:first-child {
  margin-left: 0;
}

#plc-widget-root .plc-header-online-text {
  color: rgba(255,255,255,0.9);
  font-size: 12px;
  margin-left: 8px;
}

#plc-widget-root .plc-header-online-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  background: #4ade80;
  border-radius: 50%;
  margin-right: 4px;
  animation: plc-blink 2s infinite;
}

#plc-widget-root .plc-header-online-dot.plc-is-away {
  background: #f59e0b;
}

@keyframes plc-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ── Widget Screens ────────────────────────────────────────────────────── */
#plc-widget-root .plc-screen {
  display: none !important;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

#plc-widget-root .plc-screen.plc-is-active {
  display: flex !important;
}

/* ── Home Screen ───────────────────────────────────────────────────────── */
#plc-widget-root #plc-screen-home {
  overflow-y: auto;
}

#plc-widget-root .plc-home-content {
  padding: 20px 16px;
  flex: 1;
}

#plc-widget-root .plc-home-welcome {
  font-size: 22px;
  font-weight: 800;
  color: var(--plc-text);
  margin-bottom: 6px;
  letter-spacing: -0.5px;
}

#plc-widget-root .plc-home-desc {
  color: var(--plc-text-muted);
  font-size: 13.5px;
  line-height: 1.6;
  margin-bottom: 24px;
}

#plc-widget-root .plc-home-start-btn {
  width: 100%;
  padding: 14px 20px;
  background: var(--plc-primary);
  color: white;
  border: none;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--plc-transition);
  box-shadow: 0 4px 15px rgba(99,102,241,0.3);
  margin-bottom: 16px;
}

#plc-widget-root .plc-home-start-btn:hover {
  background: var(--plc-primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(99,102,241,0.4);
}

#plc-widget-root .plc-home-start-btn:active {
  transform: translateY(0);
}

#plc-widget-root .plc-home-offline-msg {
  background: #fef3c7;
  border: 1px solid #fde68a;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 13px;
  color: #92400e;
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

#plc-widget-root .plc-home-prev-convs {
  margin-top: 20px;
}

#plc-widget-root .plc-home-prev-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--plc-text-muted);
  margin-bottom: 10px;
}

#plc-widget-root .plc-prev-conv-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.15s;
  border: 1px solid var(--plc-border);
  margin-bottom: 6px;
}

#plc-widget-root .plc-prev-conv-item:hover {
  background: var(--plc-bg-alt);
}

#plc-widget-root .plc-prev-conv-preview {
  flex: 1;
  min-width: 0;
}

#plc-widget-root .plc-prev-conv-subject {
  font-size: 13px;
  font-weight: 600;
  color: var(--plc-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#plc-widget-root .plc-prev-conv-meta {
  font-size: 11.5px;
  color: var(--plc-text-muted);
  margin-top: 2px;
}

#plc-widget-root .plc-prev-conv-arrow {
  color: var(--plc-text-muted);
  flex-shrink: 0;
}

/* ── Pre-chat Form ─────────────────────────────────────────────────────── */
#plc-widget-root #plc-screen-prechat {
  overflow-y: auto;
}

#plc-widget-root .plc-prechat-content {
  padding: 20px 16px;
  flex: 1;
}

#plc-widget-root .plc-prechat-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--plc-text);
  margin-bottom: 4px;
}

#plc-widget-root .plc-prechat-desc {
  color: var(--plc-text-muted);
  font-size: 13px;
  margin-bottom: 20px;
}

#plc-widget-root .plc-form-group {
  margin-bottom: 14px;
}

#plc-widget-root .plc-form-label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--plc-text);
  margin-bottom: 5px;
}

#plc-widget-root .plc-form-label .plc-required {
  color: #ef4444;
  margin-left: 2px;
}

#plc-widget-root .plc-input,
#plc-widget-root .plc-textarea,
#plc-widget-root .plc-select {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--plc-border);
  border-radius: 10px;
  font-size: 13.5px;
  color: var(--plc-text);
  background: white;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  -webkit-appearance: none;
}

#plc-widget-root .plc-input:focus,
#plc-widget-root .plc-textarea:focus,
#plc-widget-root .plc-select:focus {
  border-color: var(--plc-primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}

#plc-widget-root .plc-input.plc-is-error,
#plc-widget-root .plc-textarea.plc-is-error {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239,68,68,0.1);
}

#plc-widget-root .plc-textarea {
  resize: none;
  min-height: 80px;
}

#plc-widget-root .plc-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 32px;
  cursor: pointer;
}

#plc-widget-root .plc-submit-btn {
  width: 100%;
  padding: 13px 20px;
  background: var(--plc-primary);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--plc-transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
}

#plc-widget-root .plc-submit-btn:hover {
  background: var(--plc-primary-dark);
  transform: translateY(-1px);
}

#plc-widget-root .plc-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* ── Chat Screen ───────────────────────────────────────────────────────── */
#plc-widget-root #plc-screen-chat {
  display: none !important;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

#plc-widget-root #plc-screen-chat.plc-is-active {
  display: flex !important;
}

/* Chat sub-header */
#plc-widget-root .plc-chat-subheader {
  padding: 12px 14px 10px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border-bottom: 1px solid var(--plc-border);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

#plc-widget-root .plc-chat-agent-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--plc-primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--plc-primary);
  overflow: hidden;
  flex-shrink: 0;
}

#plc-widget-root .plc-chat-agent-info {
  flex: 1;
  min-width: 0;
}

#plc-widget-root .plc-chat-agent-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--plc-text);
}

#plc-widget-root .plc-chat-agent-status {
  font-size: 11.5px;
  color: var(--plc-text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

#plc-widget-root .plc-chat-agent-status .plc-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  display: inline-block;
}

#plc-widget-root .plc-chat-agent-status .dot.plc-is-away,
#plc-widget-root .plc-chat-agent-status .plc-dot.plc-is-away {
  background: #f59e0b;
}

#plc-widget-root .plc-chat-agent-status .dot.plc-is-typing,
#plc-widget-root .plc-chat-agent-status .plc-dot.plc-is-typing {
  background: var(--plc-primary);
}

#plc-widget-root .plc-end-chat-btn {
  margin-left: auto;
  min-height: 34px;
  border-radius: 999px;
  border: 1px solid var(--plc-border);
  background: #fff;
  color: var(--plc-text);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--plc-transition);
}

#plc-widget-root .plc-end-chat-btn:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}

#plc-widget-root .plc-end-chat-btn.plc-is-muted,
#plc-widget-root .plc-end-chat-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

#plc-widget-root .plc-chat-context-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 14px 10px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border-bottom: 1px solid var(--plc-border);
}

#plc-widget-root .plc-chat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  border-radius: 999px;
  border: 1px solid var(--plc-border);
  background: #fff;
  color: var(--plc-text);
  padding: 0 10px;
  font-size: 11.5px;
  font-weight: 700;
}

#plc-widget-root .plc-chat-pill-live {
  background: #ecfdf5;
  color: #047857;
  border-color: #a7f3d0;
}

#plc-widget-root .plc-chat-pill-away {
  background: #fff7ed;
  color: #c2410c;
  border-color: #fdba74;
}

#plc-widget-root .plc-chat-pill-typing {
  background: var(--plc-primary-light);
  color: var(--plc-primary-dark);
  border-color: #c7d2fe;
}

#plc-widget-root .plc-chat-meta {
  font-size: 12px;
  color: var(--plc-text-muted);
  min-width: 0;
}

#plc-widget-root .plc-chat-empty-state {
  padding: 28px 18px;
  text-align: center;
  border: 1px dashed #dbe4f0;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border-radius: 16px;
  color: var(--plc-text-muted);
}

#plc-widget-root .plc-chat-empty-icon {
  font-size: 30px;
  margin-bottom: 8px;
}

#plc-widget-root .plc-chat-empty-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--plc-text);
  margin-bottom: 4px;
}

#plc-widget-root .plc-chat-empty-text {
  font-size: 12.5px;
  line-height: 1.6;
}

#plc-widget-root #plc-messages-area.plc-is-dragover {
  background: linear-gradient(180deg, #eef2ff 0%, #f8fafc 100%);
}

#plc-widget-root .plc-composer-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px 0;
  font-size: 11.5px;
  color: var(--plc-text-muted);
}

#plc-widget-root .plc-composer-meta.plc-is-muted {
  color: #94a3b8;
}

#plc-widget-root .plc-composer-meta-title {
  font-weight: 700;
  color: var(--plc-text);
}

#plc-widget-root .plc-composer-meta-hint {
  text-align: right;
}

#plc-widget-root .plc-visitor-quick-actions {
  display: none;
  padding: 8px 12px 0;
  flex: 0 0 auto;
}

#plc-widget-root .plc-visitor-quick-actions.plc-is-visible {
  display: block;
}

#plc-widget-root .plc-quick-actions-shell {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,0.98) 0%, rgba(248,250,252,0.98) 100%);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}

#plc-widget-root .plc-quick-actions-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

#plc-widget-root .plc-quick-actions-title-wrap {
  min-width: 0;
  display: grid;
  gap: 3px;
}

#plc-widget-root .plc-quick-actions-kicker {
  font-size: 11px;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--plc-primary-dark);
}

#plc-widget-root .plc-quick-actions-subtitle {
  font-size: 11.5px;
  line-height: 1.3;
  color: var(--plc-text-muted);
}

#plc-widget-root .plc-quick-actions-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}

#plc-widget-root .plc-quick-action-chip {
  appearance: none;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: #fff;
  color: var(--plc-text);
  border-radius: 13px;
  padding: 10px 11px;
  font-size: 12.5px;
  line-height: 1.3;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  white-space: normal;
  transition: var(--plc-transition);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.65) inset;
}

#plc-widget-root .plc-quick-action-chip:hover,
#plc-widget-root .plc-quick-action-chip:focus-visible {
  border-color: rgba(99, 102, 241, 0.38);
  color: var(--plc-primary-dark);
  background: #eef2ff;
  transform: translateY(-1px);
  outline: none;
}

#plc-widget-root .plc-quick-action-chip:active {
  transform: translateY(0);
}

#plc-widget-root .plc-quick-action-icon {
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: linear-gradient(180deg, #eef2ff 0%, #e0e7ff 100%);
  box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.12);
  font-size: 13px;
}

#plc-widget-root .plc-quick-action-text {
  min-width: 0;
  display: block;
}

@media (min-width: 420px) {
  #plc-widget-root .plc-quick-actions-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 359px) {
  #plc-widget-root .plc-visitor-quick-actions {
    padding-left: 10px;
    padding-right: 10px;
  }

  #plc-widget-root .plc-quick-actions-shell {
    padding: 10px;
    border-radius: 16px;
  }

  #plc-widget-root .plc-quick-action-chip {
    min-height: 44px;
    padding: 10px 11px;
    font-size: 12.5px;
  }
}

@media (min-width: 768px) {
  #plc-widget-root .plc-visitor-quick-actions {
    padding-top: 12px;
  }

  #plc-widget-root .plc-quick-actions-shell {
    gap: 12px;
  }

  #plc-widget-root .plc-quick-actions-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
}

/* Messages area */
#plc-widget-root #plc-messages-area {
  flex: 1;
  overflow-y: auto;
  padding: 14px 14px 8px;
  scroll-behavior: smooth;
  background: var(--plc-bg);
}

#plc-widget-root #plc-messages-area::-webkit-scrollbar {
  width: 4px;
}

#plc-widget-root #plc-messages-area::-webkit-scrollbar-track {
  background: transparent;
}

#plc-widget-root #plc-messages-area::-webkit-scrollbar-thumb {
  background: #e2e8f0;
  border-radius: 2px;
}

/* Message groups */
#plc-widget-root .plc-msg-group {
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
}

#plc-widget-root .plc-msg-group.plc-msg-group-visitor {
  align-items: flex-end;
}

#plc-widget-root .plc-msg-group.plc-msg-group-agent {
  align-items: flex-start;
}

#plc-widget-root .plc-msg-group.plc-msg-group-system {
  align-items: center;
}

/* Sender row */
#plc-widget-root .plc-msg-sender-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

#plc-widget-root .plc-msg-group.plc-msg-group-visitor .plc-msg-sender-row {
  flex-direction: row-reverse;
}

#plc-widget-root .plc-msg-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

#plc-widget-root .plc-msg-avatar-placeholder {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--plc-primary);
  color: white;
  font-size: 9px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

#plc-widget-root .plc-msg-sender-name {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--plc-text-muted);
}

#plc-widget-root .plc-msg-role-pill {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:18px;
  padding:0 6px;
  border-radius:999px;
  font-size:9px;
  font-weight:800;
  letter-spacing:.02em;
  text-transform:uppercase;
}

#plc-widget-root .plc-msg-role-agent { background:#eef2ff; color:#4338ca; border:1px solid #c7d2fe; }
#plc-widget-root .plc-msg-role-visitor { background:#ecfeff; color:#0f766e; border:1px solid #a5f3fc; }

#plc-widget-root .plc-msg-time {
  font-size: 10.5px;
  color: #94a3b8;
}

/* Bubbles */
#plc-widget-root .plc-msg-bubble {
  max-width: 82%;
  padding: 10px 13px;
  border-radius: 16px;
  font-size: 13.5px;
  line-height: 1.55;
  word-break: break-word;
  animation: plc-msg-in 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  margin-bottom: 2px;
}

@keyframes plc-msg-in {
  from { opacity: 0; transform: scale(0.85) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

#plc-widget-root .plc-msg-group.plc-msg-group-visitor .plc-msg-bubble {
  background: var(--plc-primary);
  color: white;
  border-radius: 16px 16px 4px 16px;
}

#plc-widget-root .plc-msg-group.plc-msg-group-agent .plc-msg-bubble {
  background: var(--plc-bg-alt);
  color: var(--plc-text);
  border: 1px solid var(--plc-border);
  border-radius: 16px 16px 16px 4px;
}

#plc-widget-root .plc-msg-group.plc-msg-group-system .plc-msg-bubble {
  background: transparent;
  color: var(--plc-text-muted);
  font-size: 12px;
  padding: 4px 12px;
  border: none;
  text-align: center;
}

/* Message status */
#plc-widget-root .plc-msg-status {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-top: 2px;
  gap: 4px;
}

#plc-widget-root .plc-msg-status-icon + .plc-msg-status-icon {
  margin-left: -4px;
}

#plc-widget-root .plc-msg-status-icon {
  width: 12px;
  height: 12px;
  color: #94a3b8;
}

#plc-widget-root .plc-msg-status-icon.plc-is-read {
  color: #6366f1;
}

#plc-widget-root .plc-msg-status-text {
  font-size: 10px;
  font-weight: 700;
  color: #94a3b8;
}

/* Attachments */
#plc-widget-root .plc-msg-image {
  max-width: 220px;
  max-height: 200px;
  border-radius: 10px;
  cursor: pointer;
  display: block;
  object-fit: cover;
  transition: opacity 0.2s;
}

#plc-widget-root .plc-msg-image:hover {
  opacity: 0.9;
}

#plc-widget-root .plc-msg-file {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(255,255,255,0.15);
  border-radius: 10px;
  color: inherit;
  text-decoration: none;
  font-size: 13px;
  transition: background 0.2s;
}

#plc-widget-root .plc-msg-group.plc-msg-group-agent .plc-msg-file {
  background: white;
  border: 1px solid var(--plc-border);
  color: var(--plc-text);
}

#plc-widget-root .plc-msg-file:hover {
  background: rgba(255,255,255,0.25);
}

#plc-widget-root .plc-msg-file-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* Typing indicator */
#plc-widget-root .plc-typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 14px;
  background: var(--plc-bg-alt);
  border: 1px solid var(--plc-border);
  border-radius: 16px 16px 16px 4px;
  width: fit-content;
}

#plc-widget-root .plc-typing-dot {
  width: 7px;
  height: 7px;
  background: #94a3b8;
  border-radius: 50%;
  animation: plc-typing-bounce 1.2s infinite;
}

#plc-widget-root .plc-typing-dot:nth-child(2) { animation-delay: 0.2s; }
#plc-widget-root .plc-typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes plc-typing-bounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-6px); }
}

/* Date separator */
#plc-widget-root .plc-date-separator {
  text-align: center;
  margin: 12px 0;
  position: relative;
}

#plc-widget-root .plc-date-separator::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--plc-border);
}

#plc-widget-root .plc-date-separator span {
  background: white;
  padding: 0 10px;
  font-size: 11px;
  color: var(--plc-text-muted);
  position: relative;
  z-index: 1;
}

/* ── Chat Input Area ───────────────────────────────────────────────────── */
#plc-widget-root #plc-input-area {
  border-top: 1px solid var(--plc-border);
  background: white;
  flex-shrink: 0;
}

/* Canned suggestions */
#plc-widget-root #plc-canned-suggestions {
  border-bottom: 1px solid var(--plc-border);
  max-height: 180px;
  overflow-y: auto;
  display: none;
  background: #fff;
}

#plc-widget-root #plc-canned-suggestions.plc-is-open {
  display: block !important;
}

#plc-widget-root .plc-canned-suggestion-item {
  padding: 9px 14px;
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid #f8fafc;
}

#plc-widget-root .plc-canned-suggestion-item:hover {
  background: var(--plc-bg-alt);
}

#plc-widget-root .plc-canned-suggestion-shortcut {
  font-size: 11px;
  font-weight: 700;
  color: var(--plc-primary);
  margin-bottom: 2px;
}

#plc-widget-root .plc-canned-suggestion-preview {
  font-size: 12.5px;
  color: var(--plc-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* File preview */
#plc-widget-root #plc-file-preview-area {
  padding: 8px 12px 0;
  display: none;
}

#plc-widget-root #plc-file-preview-area.plc-has-files {
  display: flex !important;
  flex-wrap: wrap;
  gap: 6px;
}

#plc-widget-root .plc-file-preview-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid var(--plc-border);
  border-radius: 12px;
  padding: 7px 9px;
  font-size: 12px;
  max-width: 220px;
  box-shadow: 0 4px 14px rgba(15,23,42,0.04);
}

#plc-widget-root .plc-file-preview-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #eef2ff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}

#plc-widget-root .plc-file-preview-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1;
}

#plc-widget-root .plc-file-preview-name {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--plc-text);
  font-weight: 700;
}

#plc-widget-root .plc-file-preview-size {
  font-size: 11px;
  color: var(--plc-text-muted);
}

#plc-widget-root .plc-file-preview-remove {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: none;
  border: none;
  cursor: pointer;
  color: #94a3b8;
  font-size: 16px;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
}

#plc-widget-root .plc-file-preview-remove:hover {
  background: #eef2ff;
  color: var(--plc-primary-dark);
}

/* Input row */
#plc-widget-root .plc-input-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 12px;
}

#plc-widget-root #plc-message-input {
  flex: 1;
  border: 1.5px solid var(--plc-border);
  border-radius: 12px;
  padding: 9px 12px;
  font-size: 13.5px;
  color: var(--plc-text);
  background: var(--plc-bg-alt);
  resize: none;
  outline: none;
  min-height: 40px;
  max-height: 120px;
  overflow-y: auto;
  transition: border-color 0.2s, box-shadow 0.2s;
  line-height: 1.5;
  font-family: inherit;
}

#plc-widget-root #plc-message-input:focus {
  border-color: var(--plc-primary);
  background: white;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.08);
}

#plc-widget-root #plc-message-input::placeholder {
  color: #94a3b8;
}

#plc-widget-root .plc-input-tools {
  display: flex;
  align-items: center;
  gap: 4px;
}

#plc-widget-root .plc-tool-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--plc-text-muted);
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
  font-size: 16px;
}

#plc-widget-root .plc-tool-btn:hover {
  background: var(--plc-bg-alt);
  color: var(--plc-primary);
}

#plc-widget-root .plc-send-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--plc-primary);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  transition: var(--plc-transition);
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(99,102,241,0.3);
}

#plc-widget-root .plc-send-btn:hover {
  background: var(--plc-primary-dark);
  transform: scale(1.05);
}

#plc-widget-root .plc-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Branding */
#plc-widget-root .plc-widget-branding {
  text-align: center;
  padding: 4px 0 8px;
  font-size: 10.5px;
  color: #94a3b8;
}

#plc-widget-root .plc-widget-branding a {
  color: #94a3b8;
  text-decoration: none;
}

#plc-widget-root .plc-widget-branding a:hover {
  color: var(--plc-primary);
}

/* ── Ticket / Offline Screen ───────────────────────────────────────────── */
#plc-widget-root #plc-screen-ticket {
  overflow-y: auto;
}

#plc-widget-root .plc-ticket-content {
  padding: 20px 16px;
}

#plc-widget-root .plc-ticket-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--plc-text);
  margin-bottom: 4px;
}

#plc-widget-root .plc-ticket-desc {
  color: var(--plc-text-muted);
  font-size: 13px;
  margin-bottom: 20px;
  line-height: 1.6;
}

/* ── CSAT Screen ───────────────────────────────────────────────────────── */
#plc-widget-root #plc-screen-csat {
  overflow-y: auto;
}

#plc-widget-root .plc-csat-content {
  padding: 30px 20px;
  text-align: center;
}

#plc-widget-root .plc-csat-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

#plc-widget-root .plc-csat-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--plc-text);
  margin-bottom: 8px;
}

#plc-widget-root .plc-csat-desc {
  color: var(--plc-text-muted);
  font-size: 13.5px;
  margin-bottom: 24px;
}

#plc-widget-root .plc-csat-stars {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 20px;
}

#plc-widget-root .plc-csat-star {
  font-size: 36px;
  cursor: pointer;
  transition: transform 0.15s;
  filter: grayscale(1) opacity(0.4);
  background: none;
  border: none;
  padding: 0;
  line-height: 1;
}

#plc-widget-root .plc-csat-star:hover,
#plc-widget-root .plc-csat-star.plc-is-selected,
#plc-widget-root .plc-csat-star.plc-is-hovered {
  filter: none;
  transform: scale(1.15);
}

#plc-widget-root .plc-csat-comment {
  margin-bottom: 16px;
}

/* ── Success Screen ────────────────────────────────────────────────────── */
#plc-widget-root #plc-screen-success {
  overflow-y: auto;
}

#plc-widget-root .plc-success-content {
  padding: 40px 20px;
  text-align: center;
}

#plc-widget-root .plc-success-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #d1fae5;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  margin: 0 auto 20px;
  animation: plc-success-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes plc-success-pop {
  from { transform: scale(0); }
  to { transform: scale(1); }
}

#plc-widget-root .plc-success-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--plc-text);
  margin-bottom: 8px;
}

#plc-widget-root .plc-success-desc {
  color: var(--plc-text-muted);
  font-size: 14px;
  line-height: 1.6;
}

/* ── Emoji Picker ──────────────────────────────────────────────────────── */
#plc-widget-root #plc-emoji-picker {
  position: absolute;
  bottom: 60px;
  right: 12px;
  background: white;
  border: 1px solid var(--plc-border);
  border-radius: 14px;
  padding: 10px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.12);
  display: none;
  flex-wrap: wrap;
  gap: 4px;
  width: 240px;
  z-index: 10;
  animation: plc-bubble-in 0.2s ease;
}

#plc-widget-root #plc-emoji-picker.plc-is-open {
  display: flex !important;
}

#plc-widget-root .plc-emoji-btn {
  width: 32px;
  height: 32px;
  font-size: 20px;
  background: none;
  border: none;
  cursor: pointer;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

#plc-widget-root .plc-emoji-btn:hover {
  background: var(--plc-bg-alt);
}

/* ── Image Lightbox ────────────────────────────────────────────────────── */
#plc-widget-root #plc-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 9999999;
  display: none;
  align-items: center;
  justify-content: center;
  animation: plc-fade-in 0.2s ease;
}

#plc-widget-root #plc-lightbox.plc-is-open {
  display: flex !important;
}

@keyframes plc-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

#plc-widget-root #plc-lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 12px;
  object-fit: contain;
}

#plc-widget-root #plc-lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  background: rgba(255,255,255,0.15);
  border: none;
  border-radius: 50%;
  color: white;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Sound notification ────────────────────────────────────────────────── */
/* Handled via JS Audio API */

/* ── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  #plc-widget-root #plc-widget-window {
    width: 100vw !important;
    height: 100dvh !important;
    bottom: 0 !important;
    right: 0 !important;
    left: 0 !important;
    border-radius: 0 !important;
    position: fixed !important;
  }

  #plc-widget-root.plc-pos-right #plc-widget-window,
  #plc-widget-root.plc-pos-left #plc-widget-window {
    bottom: 0;
    right: 0;
    left: 0;
    transform-origin: bottom center;
  }

  #plc-widget-root #plc-launcher {
    width: 54px;
    height: 54px;
  }

  #plc-widget-root .plc-launcher-dock {
    display: none;
  }

  #plc-widget-root.plc-widget-open .plc-launcher-shell {
    display: none !important;
  }

  #plc-widget-root .plc-header-close {
    position: relative;
    z-index: 3;
  }
}

/* ── Utility ───────────────────────────────────────────────────────────── */
#plc-widget-root .plc-hidden { display: none !important; }
#plc-widget-root .plc-sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

#plc-widget-root .plc-msg-bubble a {
  color: inherit;
  text-decoration: underline;
}

#plc-widget-root .plc-home-welcome,
#plc-widget-root .plc-prechat-title,
#plc-widget-root .plc-ticket-title,
#plc-widget-root .plc-csat-title,
#plc-widget-root .plc-success-title {
  line-height: 1.25;
}

#plc-widget-root .plc-home-desc,
#plc-widget-root .plc-prechat-desc,
#plc-widget-root .plc-ticket-desc,
#plc-widget-root .plc-csat-desc,
#plc-widget-root .plc-success-desc,
#plc-widget-root .plc-msg-bubble {
  letter-spacing: normal;
}


#plc-widget-root .plc-msg-bubble p,
#plc-widget-root .plc-msg-bubble span,
#plc-widget-root .plc-msg-bubble strong,
#plc-widget-root .plc-msg-bubble em,
#plc-widget-root .plc-msg-bubble small {
  color: inherit;
  font: inherit;
}

#plc-widget-root .plc-input,
#plc-widget-root .plc-textarea,
#plc-widget-root .plc-select,
#plc-widget-root #plc-message-input {
  appearance: none;
  -webkit-appearance: none;
}

#plc-widget-root .plc-home-start-btn,
#plc-widget-root .plc-submit-btn,
#plc-widget-root .plc-send-btn,
#plc-widget-root .plc-tool-btn,
#plc-widget-root .plc-header-close,
#plc-widget-root #plc-proactive-close,
#plc-widget-root #plc-launcher,
#plc-widget-root #plc-lightbox-close,
#plc-widget-root .plc-csat-star,
#plc-widget-root .plc-file-preview-remove,
#plc-widget-root .plc-emoji-btn {
  font-family: inherit;
  text-align: center;
}


#plc-widget-root button:focus-visible,
#plc-widget-root input:focus-visible,
#plc-widget-root textarea:focus-visible,
#plc-widget-root select:focus-visible,
#plc-widget-root a:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.18), 0 0 0 1px rgba(99,102,241,0.32);
}

#plc-widget-root .plc-home-start-btn,
#plc-widget-root .plc-submit-btn,
#plc-widget-root .plc-send-btn,
#plc-widget-root .plc-tool-btn,
#plc-widget-root .plc-home-intent-chip,
#plc-widget-root .plc-prechat-intent-card,
#plc-widget-root .plc-prechat-back-btn,
#plc-widget-root .plc-csat-star,
#plc-widget-root .plc-prev-conv-item {
  transition: transform 0.22s ease, box-shadow 0.24s ease, border-color 0.24s ease, background 0.24s ease;
}

#plc-widget-root .plc-home-start-btn:hover,
#plc-widget-root .plc-submit-btn:hover,
#plc-widget-root .plc-send-btn:hover,
#plc-widget-root .plc-tool-btn:hover,
#plc-widget-root .plc-csat-star:hover {
  transform: translateY(-1px);
}
/* ── Landing surfaces premium ─────────────────────────────────────────── */
#plc-widget-root .plc-home-hero-card,
#plc-widget-root .plc-prechat-summary-card {
  background: linear-gradient(180deg, rgba(99,102,241,0.12) 0%, rgba(255,255,255,0.98) 100%);
  border: 1px solid rgba(99,102,241,0.16);
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 12px 30px rgba(15,23,42,0.08);
  margin-bottom: 16px;
}

#plc-widget-root .plc-home-hero-topline,
#plc-widget-root .plc-prechat-summary-topline,
#plc-widget-root .plc-prechat-helper-line,
#plc-widget-root .plc-prev-conv-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

#plc-widget-root .plc-home-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .02em;
  text-transform: uppercase;
  background: rgba(15,23,42,0.08);
  color: var(--plc-text);
}

#plc-widget-root .plc-home-hero-badge.is-online {
  background: rgba(16,185,129,0.12);
  color: #047857;
}

#plc-widget-root .plc-home-hero-badge.is-offline {
  background: rgba(245,158,11,0.16);
  color: #b45309;
}

#plc-widget-root .plc-home-hero-trust,
#plc-widget-root .plc-prechat-summary-note {
  font-size: 12px;
  color: var(--plc-text-muted);
}

#plc-widget-root .plc-home-hero-title,
#plc-widget-root .plc-prechat-summary-title {
  font-size: 17px;
  line-height: 1.3;
  font-weight: 800;
  color: var(--plc-text);
  margin: 10px 0 6px;
}

#plc-widget-root .plc-home-hero-subtitle,
#plc-widget-root .plc-prechat-summary-desc,
#plc-widget-root .plc-prechat-section-desc {
  color: var(--plc-text-muted);
  font-size: 12.8px;
  line-height: 1.6;
}

#plc-widget-root .plc-home-hero-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

#plc-widget-root .plc-home-stat {
  border-radius: 14px;
  background: rgba(255,255,255,0.78);
  border: 1px solid rgba(148,163,184,0.16);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

#plc-widget-root .plc-home-stat strong {
  font-size: 13px;
  font-weight: 800;
  color: var(--plc-text);
}

#plc-widget-root .plc-home-stat span,
#plc-widget-root .plc-home-hero-trustline span,
#plc-widget-root .plc-prechat-helper-line span {
  font-size: 11.5px;
  color: var(--plc-text-muted);
}

#plc-widget-root .plc-home-hero-trustline,
#plc-widget-root .plc-prechat-helper-line {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

#plc-widget-root .plc-home-section-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 800;
  color: var(--plc-text-muted);
}

#plc-widget-root .plc-home-intents,
#plc-widget-root .plc-prechat-intents {
  margin: 18px 0 16px;
}

#plc-widget-root .plc-home-intent-list,
#plc-widget-root .plc-prechat-intent-list {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

#plc-widget-root .plc-home-intent-chip,
#plc-widget-root .plc-prechat-intent-card,
#plc-widget-root .plc-prechat-back-btn {
  border: 1px solid rgba(148,163,184,0.18);
  background: #fff;
  color: var(--plc-text);
  cursor: pointer;
  transition: var(--plc-transition);
}

#plc-widget-root .plc-home-intent-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-start;
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 6px 18px rgba(15,23,42,0.04);
}

#plc-widget-root .plc-home-intent-icon,
#plc-widget-root .plc-prechat-intent-icon {
  font-size: 16px;
  flex-shrink: 0;
}

#plc-widget-root .plc-prechat-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 14px;
}

#plc-widget-root .plc-prechat-intent-card {
  width: 100%;
  border-radius: 16px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  box-shadow: 0 8px 20px rgba(15,23,42,0.04);
}

#plc-widget-root .plc-prechat-intent-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

#plc-widget-root .plc-prechat-intent-copy strong {
  font-size: 13px;
  font-weight: 800;
  color: var(--plc-text);
}

#plc-widget-root .plc-prechat-intent-copy small {
  font-size: 11.5px;
  color: var(--plc-text-muted);
}

#plc-widget-root [data-prechat-intent].is-active,
#plc-widget-root .plc-home-intent-chip:hover,
#plc-widget-root .plc-prechat-intent-card:hover,
#plc-widget-root .plc-prechat-back-btn:hover {
  border-color: rgba(99,102,241,0.35);
  box-shadow: 0 10px 24px rgba(99,102,241,0.12);
  transform: translateY(-1px);
}

#plc-widget-root .plc-prechat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

#plc-widget-root .plc-field-error {
  margin-top: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #dc2626;
}

#plc-widget-root .plc-prechat-helper-line {
  padding-top: 8px;
  border-top: 1px solid rgba(148,163,184,0.16);
}

#plc-widget-root .plc-prev-conv-item {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  box-shadow: 0 8px 22px rgba(15,23,42,0.04);
}

#plc-widget-root .plc-prev-conv-status {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 8px;
  background: rgba(99,102,241,0.1);
  color: var(--plc-primary);
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
}


@media (max-width: 640px) {
  #plc-widget-root .plc-chat-context-bar,
  #plc-widget-root .plc-composer-meta {
    gap: 6px;
  }

  #plc-widget-root .plc-composer-meta {
    flex-direction: column;
    align-items: flex-start;
  }

  #plc-widget-root .plc-composer-meta-hint {
    text-align: left;
  }

  #plc-widget-root .plc-end-chat-btn span {
    display: none;
  }

  #plc-widget-root .plc-home-hero-stats,
  #plc-widget-root .plc-prechat-grid {
    grid-template-columns: 1fr;
  }

  #plc-widget-root .plc-home-hero-topline,
  #plc-widget-root .plc-prechat-summary-topline,
  #plc-widget-root .plc-prev-conv-topline {
    align-items: flex-start;
  }
}


/* ── Ticket / CSAT / Success premium surfaces ─────────────────────────── */
#plc-widget-root .plc-ticket-summary-card,
#plc-widget-root .plc-csat-surface,
#plc-widget-root .plc-success-surface {
  background: linear-gradient(180deg, rgba(99,102,241,0.10) 0%, rgba(255,255,255,0.98) 100%);
  border: 1px solid rgba(99,102,241,0.16);
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 12px 30px rgba(15,23,42,0.08);
  margin-bottom: 16px;
}

#plc-widget-root .plc-ticket-summary-topline,
#plc-widget-root .plc-csat-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

#plc-widget-root .plc-ticket-summary-note,
#plc-widget-root .plc-success-meta {
  font-size: 12px;
  color: var(--plc-text-muted);
}

#plc-widget-root .plc-ticket-summary-title {
  font-size: 17px;
  font-weight: 800;
  line-height: 1.3;
  color: var(--plc-text);
  margin: 10px 0 6px;
}

#plc-widget-root .plc-ticket-summary-desc,
#plc-widget-root .plc-csat-feedback {
  color: var(--plc-text-muted);
  font-size: 12.8px;
  line-height: 1.6;
}

#plc-widget-root .plc-ticket-summary-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

#plc-widget-root .plc-ticket-stat {
  border-radius: 14px;
  background: rgba(255,255,255,0.78);
  border: 1px solid rgba(148,163,184,0.16);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

#plc-widget-root .plc-ticket-stat strong {
  font-size: 13px;
  font-weight: 800;
  color: var(--plc-text);
}

#plc-widget-root .plc-ticket-stat span,
#plc-widget-root .plc-ticket-footnote,
#plc-widget-root .plc-csat-scale span,
#plc-widget-root .plc-success-point {
  font-size: 11.5px;
  color: var(--plc-text-muted);
}

#plc-widget-root .plc-ticket-footnote {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(248,250,252,0.95);
  border: 1px dashed rgba(148,163,184,0.28);
  line-height: 1.55;
}

#plc-widget-root .plc-csat-content-premium,
#plc-widget-root .plc-success-content-premium {
  text-align: left;
}

#plc-widget-root .plc-csat-surface .plc-csat-icon,
#plc-widget-root .plc-success-surface .plc-success-icon {
  margin-left: 0;
  margin-right: 0;
}

#plc-widget-root .plc-csat-scale {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: -4px 0 14px;
}

#plc-widget-root .plc-csat-scale span {
  text-align: center;
}

#plc-widget-root .plc-csat-feedback {
  margin: 0 0 12px;
  min-height: 20px;
}

#plc-widget-root .plc-csat-actions {
  display: grid;
  gap: 10px;
}

#plc-widget-root .plc-csat-actions .plc-submit-btn,
#plc-widget-root .plc-csat-actions .plc-tool-btn,
#plc-widget-root .plc-success-surface .plc-submit-btn,
#plc-widget-root .plc-success-surface .plc-success-secondary-btn {
  width: 100%;
}

#plc-widget-root .plc-csat-actions .plc-tool-btn,
#plc-widget-root .plc-success-secondary-btn {
  justify-content: center;
  margin-top: 0;
}

#plc-widget-root .plc-success-meta {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(16,185,129,0.12);
  color: #047857;
  font-weight: 800;
  letter-spacing: .02em;
  text-transform: uppercase;
}

#plc-widget-root .plc-success-points {
  display: grid;
  gap: 8px;
  margin: 16px 0 18px;
}

#plc-widget-root .plc-success-point {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  line-height: 1.55;
}

#plc-widget-root .plc-success-point span:first-child {
  color: #10b981;
  font-weight: 900;
}

@media (max-width: 640px) {
  #plc-widget-root .plc-ticket-summary-topline,
  #plc-widget-root .plc-csat-topline {
    align-items: flex-start;
  }

  #plc-widget-root .plc-ticket-summary-stats,
  #plc-widget-root .plc-csat-scale {
    grid-template-columns: 1fr;
  }
}


/* Wizz / reminder pulse */
.plc-msg-bubble-wizz {
  border: 1px solid rgba(245,158,11,0.32);
  background: linear-gradient(135deg, rgba(255,247,237,0.98), rgba(255,237,213,0.96));
  color: #9a3412;
  box-shadow: 0 10px 24px rgba(245,158,11,0.12);
}
.plc-msg-wizz-head { display:flex; align-items:center; gap:8px; font-weight:700; margin-bottom:6px; }
.plc-msg-wizz-body { line-height:1.45; }
.plc-wizz-toast {
  position: fixed;
  right: 18px;
  bottom: 108px;
  z-index: 999999;
  max-width: 320px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(245,158,11,0.28);
  background: rgba(255,255,255,0.98);
  box-shadow: 0 18px 38px rgba(2,6,23,0.16);
  transform: translateY(16px) scale(.98);
  opacity: 0;
  transition: transform .28s ease, opacity .28s ease;
}
.plc-wizz-toast.is-visible { transform: translateY(0) scale(1); opacity: 1; }
.plc-wizz-toast-icon {
  width: 36px; height: 36px; border-radius: 999px; display:flex; align-items:center; justify-content:center;
  background: linear-gradient(135deg, #f59e0b, #fb7185); color:#fff; flex:0 0 36px;
  box-shadow: 0 10px 22px rgba(245,158,11,0.28);
}
.plc-wizz-toast strong, .plc-wizz-toast span { display:block; }
.plc-wizz-toast strong { color:#0f172a; font-size:13px; margin-bottom:2px; }
.plc-wizz-toast span:last-child { color:#475569; font-size:12px; line-height:1.45; }
.plc-widget-root.plc-wizzing .plc-widget-shell,
#plc-launcher.plc-wizzing {
  animation: plcWizzPulse 1.1s ease-in-out 2;
}
@keyframes plcWizzPulse {
  0%,100% { transform: translateX(0) scale(1); }
  12% { transform: translateX(-3px) scale(1.01); }
  24% { transform: translateX(4px) scale(1.015); }
  36% { transform: translateX(-5px) scale(1.02); }
  48% { transform: translateX(5px) scale(1.02); }
  60% { transform: translateX(-3px) scale(1.012); }
  72% { transform: translateX(2px) scale(1.008); }
}
@media (max-width: 640px) {
  .plc-wizz-toast { right: 12px; left: 12px; bottom: 96px; max-width: none; }
}


/* ── v34 Widget UI/UX polish + Zorro assistant ─────────────────────────── */
#plc-widget-root .plc-header-brand,
#plc-widget-root .plc-header-brand > div,
#plc-widget-root .plc-chat-subheader,
#plc-widget-root .plc-chat-agent-info,
#plc-widget-root .plc-msg-sender-row {
  min-width: 0;
}

#plc-widget-root .plc-header-close,
#plc-widget-root .plc-end-chat-btn,
#plc-widget-root .plc-tool-btn,
#plc-widget-root .plc-send-btn {
  flex-shrink: 0;
}

#plc-widget-root .plc-header-title,
#plc-widget-root .plc-header-subtitle,
#plc-widget-root .plc-chat-agent-name,
#plc-widget-root .plc-chat-agent-status,
#plc-widget-root .plc-msg-sender-name,
#plc-widget-root .plc-msg-file span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

#plc-widget-root .plc-header-title,
#plc-widget-root .plc-chat-agent-name,
#plc-widget-root .plc-msg-sender-name {
  white-space: nowrap;
}

#plc-widget-root .plc-header-subtitle,
#plc-widget-root .plc-chat-agent-status {
  white-space: nowrap;
}

#plc-widget-root .plc-header-agents {
  flex-wrap: wrap;
  row-gap: 6px;
  min-width: 0;
}

#plc-widget-root .plc-header-online-text {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  max-width: 100%;
}

#plc-widget-root #plc-messages-area {
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

#plc-widget-root #plc-input-area {
  background: linear-gradient(180deg, rgba(255,255,255,.98) 0%, #ffffff 100%);
  box-shadow: 0 -10px 30px rgba(15, 23, 42, 0.06);
}

#plc-widget-root .plc-input-row {
  align-items: flex-end;
  padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
}

#plc-widget-root #plc-message-input {
  min-width: 0;
  overflow-wrap: anywhere;
}

#plc-widget-root .plc-msg-bubble {
  overflow-wrap: anywhere;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
}

#plc-widget-root .plc-msg-image {
  width: auto;
  max-width: min(100%, 260px);
}

#plc-widget-root .plc-zorro-avatar-shell,
#plc-widget-root .plc-msg-avatar-zorro {
  background: radial-gradient(circle at 30% 30%, #334155 0%, #111827 70%);
  color: #f8fafc;
}

#plc-widget-root .plc-zorro-head-icon {
  width: 74%;
  height: 74%;
  display: block;
}

#plc-widget-root .plc-zorro-head-icon .plc-zorro-fill {
  fill: currentColor;
}

#plc-widget-root .plc-zorro-head-icon .plc-zorro-fill-soft {
  opacity: .82;
}

#plc-widget-root .plc-zorro-head-icon .plc-zorro-shadow {
  fill: rgba(15, 23, 42, 0.32);
}

#plc-widget-root .plc-zorro-head-icon .plc-zorro-eye {
  fill: #ffffff;
}

#plc-widget-root .plc-zorro-head-icon .plc-zorro-smile {
  stroke: rgba(255,255,255,.92);
  stroke-width: 2.2;
  fill: none;
  stroke-linecap: round;
}

#plc-widget-root .plc-chat-agent-avatar .plc-zorro-head-icon,
#plc-widget-root .plc-msg-avatar-zorro .plc-zorro-head-icon {
  width: 72%;
  height: 72%;
}

#plc-widget-root .plc-msg-avatar-zorro {
  color: #ffffff;
}

#plc-widget-root .plc-header-agent-avatar.plc-zorro-avatar-shell {
  border-color: rgba(255,255,255,0.45);
}

#plc-widget-root .plc-send-btn:hover,
#plc-widget-root .plc-tool-btn:hover,
#plc-widget-root .plc-end-chat-btn:hover,
#plc-widget-root .plc-header-close:hover {
  transform: translateY(-1px);
}

@media (max-width: 640px) {
  #plc-widget-root .plc-header-top {
    align-items: flex-start;
    gap: 10px;
  }

  #plc-widget-root .plc-header-agents {
    align-items: flex-start;
  }

  #plc-widget-root .plc-header-online-text {
    margin-left: 6px;
  }

  #plc-widget-root .plc-input-row {
    gap: 6px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #plc-widget-root *,
  #plc-widget-root *::before,
  #plc-widget-root *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ── v46 Phase 2 Sprint 2 : Widget product polish ─────────────────────── */
#plc-widget-root .plc-chat-subheader {
  padding: 10px 12px 8px;
  gap: 9px;
  background:
    radial-gradient(circle at top right, rgba(99,102,241,.10), transparent 30%),
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,250,252,.96));
}

#plc-widget-root .plc-chat-agent-avatar {
  width: 34px;
  height: 34px;
  box-shadow: 0 8px 18px rgba(15,23,42,.10);
}

#plc-widget-root .plc-chat-agent-name {
  font-size: 12.8px;
  letter-spacing: -.01em;
}

#plc-widget-root .plc-chat-agent-status {
  font-size: 11px;
}

#plc-widget-root .plc-end-chat-btn {
  min-height: 32px;
  padding: 0 10px;
  border-radius: 12px;
  background: rgba(255,255,255,.92);
  box-shadow: 0 10px 18px rgba(15,23,42,.05);
}

#plc-widget-root .plc-chat-context-bar {
  gap: 6px;
  padding: 0 12px 9px;
}

#plc-widget-root .plc-chat-pill {
  min-height: 26px;
  padding: 0 9px;
  font-size: 11px;
}

#plc-widget-root .plc-chat-meta {
  font-size: 11.5px;
}

#plc-widget-root #plc-messages-area {
  padding: 12px 12px 8px;
  background: linear-gradient(180deg, #fbfcfe 0%, #f8fafc 100%);
}

#plc-widget-root .plc-msg-group {
  margin-bottom: 10px;
}

#plc-widget-root .plc-msg-bubble {
  max-width: min(84%, 296px);
  border-radius: 18px;
  padding: 10px 12px;
}

#plc-widget-root .plc-msg-group.plc-msg-group-visitor .plc-msg-bubble {
  border-radius: 18px 18px 6px 18px;
}

#plc-widget-root .plc-msg-group.plc-msg-group-agent .plc-msg-bubble {
  border-radius: 18px 18px 18px 6px;
}

#plc-widget-root .plc-composer-meta {
  gap: 8px;
  padding: 8px 12px 0;
}

#plc-widget-root .plc-composer-meta-title {
  font-size: 11.5px;
}

#plc-widget-root .plc-composer-meta-hint {
  font-size: 11px;
}

#plc-widget-root .plc-visitor-quick-actions {
  padding-top: 6px;
}

#plc-widget-root .plc-quick-actions-shell {
  gap: 10px;
  padding: 10px;
  border-radius: 16px;
  box-shadow: 0 12px 28px rgba(15,23,42,.06);
}

#plc-widget-root .plc-quick-actions-header {
  align-items: center;
}

#plc-widget-root .plc-quick-actions-subtitle {
  font-size: 11px;
}

#plc-widget-root .plc-quick-actions-grid {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

#plc-widget-root .plc-quick-actions-grid::-webkit-scrollbar {
  display: none;
}

#plc-widget-root .plc-quick-action-chip {
  width: auto;
  min-width: 168px;
  max-width: 220px;
  flex: 0 0 auto;
  min-height: 40px;
  padding: 9px 10px;
  border-radius: 14px;
  box-shadow: 0 8px 18px rgba(15,23,42,.04);
}

#plc-widget-root #plc-input-area {
  background:
    linear-gradient(180deg, rgba(255,255,255,.96) 0%, rgba(255,255,255,.99) 100%);
  border-top: 1px solid rgba(148,163,184,.12);
}

#plc-widget-root .plc-input-row {
  gap: 6px;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
}

#plc-widget-root .plc-input-tools {
  gap: 2px;
}

#plc-widget-root .plc-tool-btn {
  width: 32px;
  height: 32px;
  border-radius: 12px;
  background: rgba(248,250,252,.9);
  border: 1px solid rgba(148,163,184,.14);
}

#plc-widget-root #plc-message-input {
  min-height: 42px;
  border-radius: 14px;
  padding: 10px 12px;
  background: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.7);
}

#plc-widget-root .plc-send-btn {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  box-shadow: 0 10px 22px rgba(99,102,241,.24);
}

#plc-widget-root .plc-widget-branding {
  padding-top: 2px;
}

@media (min-width: 480px) {
  #plc-widget-root .plc-quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
  }

  #plc-widget-root .plc-quick-action-chip {
    width: 100%;
    min-width: 0;
    max-width: none;
  }
}

@media (max-width: 640px) {
  #plc-widget-root .plc-chat-subheader {
    padding: 9px 10px 7px;
  }

  #plc-widget-root .plc-chat-context-bar {
    padding: 0 10px 8px;
  }

  #plc-widget-root #plc-messages-area {
    padding-left: 10px;
    padding-right: 10px;
  }

  #plc-widget-root .plc-msg-bubble {
    max-width: min(88%, 270px);
  }

  #plc-widget-root .plc-quick-actions-shell {
    padding: 9px;
  }

  #plc-widget-root .plc-quick-action-chip {
    min-width: 150px;
  }

  #plc-widget-root .plc-input-row {
    padding-left: 10px;
    padding-right: 10px;
  }
}


/* ===== Phase 2 / Sprint 3 premium widget refinements ===== */
#plc-widget-root #plc-widget-panel {
  box-shadow: 0 28px 72px rgba(15,23,42,.22), 0 8px 24px rgba(15,23,42,.12);
}

#plc-widget-root #plc-widget-header {
  min-height: 74px;
  padding-bottom: 12px;
}

#plc-widget-root .plc-chat-subheader {
  padding: 10px 14px 8px;
  background: rgba(255,255,255,.82);
  backdrop-filter: blur(12px);
}

#plc-widget-root .plc-chat-context-bar {
  padding: 0 14px 10px;
}

#plc-widget-root .plc-chat-context-pill,
#plc-widget-root .plc-chat-status-pill {
  min-height: 28px;
  padding: 6px 10px;
  border-radius: 999px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.78);
}

#plc-widget-root #plc-messages-area {
  padding-top: 12px;
  padding-bottom: 12px;
}

#plc-widget-root .plc-msg-group {
  gap: 2px;
}

#plc-widget-root .plc-msg-group.plc-msg-group-visitor,
#plc-widget-root .plc-msg-group.plc-msg-group-agent {
  max-width: 100%;
}

#plc-widget-root .plc-msg-bubble {
  max-width: min(80%, 320px);
  box-shadow: 0 12px 24px rgba(15,23,42,.06);
}

#plc-widget-root .plc-msg-group.plc-msg-group-visitor .plc-msg-bubble {
  box-shadow: 0 12px 24px rgba(99,102,241,.18);
}

#plc-widget-root .plc-msg-image {
  max-width: min(100%, 240px);
  border-radius: 14px;
  box-shadow: 0 10px 22px rgba(15,23,42,.08);
}

#plc-widget-root .plc-msg-file {
  border-radius: 12px;
}

#plc-widget-root .plc-composer-meta {
  padding-top: 10px;
}

#plc-widget-root .plc-visitor-quick-actions {
  padding-top: 8px;
}

#plc-widget-root .plc-quick-actions-shell {
  border-radius: 20px;
}

#plc-widget-root .plc-quick-actions-grid {
  align-items: stretch;
}

#plc-widget-root .plc-quick-action-chip {
  border-radius: 15px;
}

#plc-widget-root #plc-file-preview-area.plc-has-files {
  padding-inline: 12px;
}

#plc-widget-root .plc-input-row {
  align-items: stretch;
  gap: 8px;
}

#plc-widget-root .plc-input-tools {
  align-self: flex-end;
  padding-bottom: 2px;
}

#plc-widget-root #plc-message-input {
  min-height: 44px;
}

#plc-widget-root .plc-send-btn {
  align-self: flex-end;
}

@media (max-width: 640px) {
  #plc-widget-root #plc-widget-header {
    min-height: 68px;
  }

  #plc-widget-root .plc-chat-subheader {
    padding: 9px 10px 7px;
  }

  #plc-widget-root .plc-chat-context-bar {
    padding: 0 10px 8px;
  }

  #plc-widget-root #plc-messages-area {
    padding-left: 10px;
    padding-right: 10px;
  }

  #plc-widget-root .plc-msg-bubble {
    max-width: min(86%, 272px);
    padding: 10px 11px;
  }

  #plc-widget-root .plc-visitor-quick-actions {
    padding-left: 10px;
    padding-right: 10px;
  }

  #plc-widget-root .plc-quick-actions-shell {
    border-radius: 18px;
    padding: 9px;
  }

  #plc-widget-root .plc-composer-meta {
    padding-left: 10px;
    padding-right: 10px;
  }

  #plc-widget-root .plc-input-row {
    padding-left: 10px;
    padding-right: 10px;
  }
}

@media (min-width: 768px) {
  #plc-widget-root #plc-widget-panel {
    border-radius: 24px;
  }

  #plc-widget-root .plc-msg-bubble {
    max-width: min(76%, 360px);
  }

  #plc-widget-root .plc-quick-actions-shell {
    padding: 12px;
  }
}


/* === Phase 2 Sprint 4: premium widget polish === */
#plc-widget-root #plc-widget-window {
  border-radius: 26px;
  box-shadow: 0 30px 80px rgba(15, 23, 42, .24);
  overflow: hidden;
}
#plc-widget-root #plc-widget-header {
  padding-top: 16px;
  padding-bottom: 14px;
  min-height: 0;
}
#plc-widget-root .plc-header-top {
  align-items: center;
  gap: 12px;
}
#plc-widget-root .plc-header-brand {
  min-width: 0;
}
#plc-widget-root .plc-header-title {
  font-size: 16px;
  line-height: 1.15;
}
#plc-widget-root .plc-header-subtitle {
  margin-top: 3px;
  font-size: 12px;
}
#plc-widget-root .plc-chat-subheader {
  padding-top: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(226,232,240,.85);
}
#plc-widget-root .plc-context-pill,
#plc-widget-root .plc-chip,
#plc-widget-root .plc-status-chip {
  border-radius: 999px;
}
#plc-widget-root .plc-messages {
  padding-top: 14px;
  padding-bottom: 14px;
}
#plc-widget-root .plc-msg-group {
  gap: 8px;
}
#plc-widget-root .plc-msg-bubble {
  border-radius: 20px;
  box-shadow: 0 8px 18px rgba(15,23,42,.05);
}
#plc-widget-root .plc-msg-group.plc-msg-group-visitor .plc-msg-bubble {
  border-bottom-right-radius: 8px;
}
#plc-widget-root .plc-msg-group.plc-msg-group-agent .plc-msg-bubble {
  border-bottom-left-radius: 8px;
}
#plc-widget-root .plc-msg-file,
#plc-widget-root .plc-msg-attachment,
#plc-widget-root .plc-upload-preview-item {
  border-radius: 16px;
}
#plc-widget-root .plc-composer-meta {
  padding-top: 10px;
  padding-bottom: 10px;
}
#plc-widget-root .plc-visitor-quick-actions {
  margin-top: 10px;
  margin-bottom: 8px;
}
#plc-widget-root .plc-quick-actions-shell {
  border: 1px solid rgba(226,232,240,.88);
  border-radius: 20px;
  box-shadow: 0 8px 18px rgba(15,23,42,.04);
}
#plc-widget-root .plc-quick-actions-grid {
  gap: 10px;
}
#plc-widget-root .plc-quick-action-chip {
  min-height: 46px;
  border-radius: 16px;
  box-shadow: none;
}
#plc-widget-root .plc-composer,
#plc-widget-root .plc-input-row,
#plc-widget-root .plc-reply-box {
  border-top: 1px solid rgba(226,232,240,.82);
}
#plc-widget-root .plc-input-row {
  padding-top: 12px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
}
#plc-widget-root .plc-input {
  min-height: 46px;
  border-radius: 18px;
}
#plc-widget-root .plc-send-btn,
#plc-widget-root .plc-tool-btn {
  border-radius: 16px;
}
@media (max-width: 640px) {
  #plc-widget-root #plc-widget-window {
    border-radius: 22px 22px 0 0;
    box-shadow: 0 -14px 34px rgba(15,23,42,.18);
  }
  #plc-widget-root #plc-widget-header {
    padding-top: 14px;
    padding-bottom: 12px;
  }
  #plc-widget-root .plc-header-title {
    font-size: 15px;
  }
  #plc-widget-root .plc-chat-subheader {
    padding-top: 9px;
    padding-bottom: 9px;
  }
  #plc-widget-root .plc-messages {
    padding-top: 12px;
    padding-bottom: 12px;
  }
  #plc-widget-root .plc-quick-actions-shell {
    border-radius: 18px;
    padding: 12px;
  }
  #plc-widget-root .plc-quick-actions-grid {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    padding-bottom: 2px;
  }
  #plc-widget-root .plc-quick-action-chip {
    min-width: min(76vw, 240px);
    scroll-snap-align: start;
  }
  #plc-widget-root .plc-input-row {
    gap: 10px;
  }
}
@media (min-width: 641px) {
  #plc-widget-root .plc-quick-actions-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}


/* === Phase 2 Sprint 5: premium finishing pass === */
#plc-widget-root #plc-widget-window {
  border: 1px solid rgba(255,255,255,.65);
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,250,252,.98));
}
#plc-widget-root #plc-widget-header {
  gap: 12px;
}
#plc-widget-root .plc-header-top {
  justify-content: space-between;
}
#plc-widget-root .plc-header-main {
  min-width: 0;
}
#plc-widget-root .plc-header-title,
#plc-widget-root .plc-header-subtitle {
  text-wrap: balance;
}
#plc-widget-root .plc-chat-subheader {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
#plc-widget-root .plc-context-pill,
#plc-widget-root .plc-chip,
#plc-widget-root .plc-status-chip {
  min-height: 30px;
  padding-inline: 10px;
  border: 1px solid rgba(226,232,240,.92);
  background: rgba(255,255,255,.82);
}
#plc-widget-root .plc-messages {
  scrollbar-gutter: stable;
}
#plc-widget-root .plc-msg-group {
  width: 100%;
}
#plc-widget-root .plc-msg-bubble {
  max-width: min(82%, 42ch);
}
#plc-widget-root .plc-msg-meta {
  margin-top: 6px;
}
#plc-widget-root .plc-visitor-quick-actions {
  margin-top: 8px;
  margin-bottom: 6px;
}
#plc-widget-root .plc-quick-actions-shell {
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,250,252,.96));
}
#plc-widget-root .plc-quick-action-chip {
  align-items: flex-start;
  padding: 12px 14px;
}
#plc-widget-root .plc-input-row {
  align-items: flex-end;
  gap: 12px;
}
#plc-widget-root .plc-input {
  line-height: 1.45;
}
#plc-widget-root .plc-send-btn,
#plc-widget-root .plc-tool-btn {
  min-width: 46px;
  min-height: 46px;
}
@media (max-width: 640px) {
  #plc-widget-root #plc-widget-window {
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
  }
  #plc-widget-root #plc-widget-header {
    padding-top: 13px;
    padding-bottom: 11px;
  }
  #plc-widget-root .plc-chat-subheader {
    padding-left: 12px;
    padding-right: 12px;
  }
  #plc-widget-root .plc-msg-bubble {
    max-width: min(88%, 34ch);
  }
  #plc-widget-root .plc-quick-actions-shell {
    padding: 10px;
  }
  #plc-widget-root .plc-quick-action-chip {
    min-width: min(72vw, 228px);
  }
  #plc-widget-root .plc-input-row {
    padding-inline: 12px;
  }
}
@media (min-width: 641px) {
  #plc-widget-root .plc-quick-actions-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}


/* ==========================================================================
   Phase 2 — Sprint 6 (v50) Premium refinement overrides
   ========================================================================== */
#plc-widget-root #plc-widget-window {
  border: 1px solid rgba(148,163,184,0.18);
  box-shadow: 0 26px 60px rgba(15,23,42,0.18), 0 8px 28px rgba(15,23,42,0.08);
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,250,252,0.96));
}

#plc-widget-root #plc-widget-header {
  padding-bottom: 14px;
  background: linear-gradient(145deg, rgba(99,102,241,0.98), rgba(124,58,237,0.92));
  box-shadow: inset 0 -1px 0 rgba(255,255,255,0.12);
}

#plc-widget-root .plc-header-brand,
#plc-widget-root .plc-header-main {
  min-width: 0;
}

#plc-widget-root .plc-header-title {
  letter-spacing: -0.02em;
}

#plc-widget-root .plc-header-subtitle {
  opacity: 0.92;
}

#plc-widget-root .plc-context-pill,
#plc-widget-root .plc-launcher-chip {
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: 0 8px 20px -16px rgba(15,23,42,0.35);
}

#plc-widget-root #plc-messages-area {
  padding-bottom: 20px;
}

#plc-widget-root .plc-msg-group .plc-msg-bubble {
  box-shadow: 0 12px 28px -22px rgba(15,23,42,0.32);
}

#plc-widget-root .plc-msg-group.plc-msg-group-visitor .plc-msg-bubble {
  margin-right: clamp(8px, 2vw, 14px);
}

#plc-widget-root .plc-visitor-quick-actions {
  gap: 10px;
  padding: 10px 0 2px;
}

#plc-widget-root .plc-quick-action-chip {
  border-radius: 14px;
  box-shadow: 0 14px 24px -22px rgba(15,23,42,0.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

#plc-widget-root .plc-composer,
#plc-widget-root .plc-input-row {
  background: linear-gradient(180deg, rgba(255,255,255,0.95), rgba(248,250,252,0.98));
}

#plc-widget-root .plc-input-row {
  border: 1px solid rgba(148,163,184,0.18);
  box-shadow: 0 18px 32px -28px rgba(15,23,42,0.45);
}

#plc-widget-root .plc-input-row:focus-within {
  border-color: rgba(99,102,241,0.42);
  box-shadow: 0 0 0 4px rgba(99,102,241,0.10), 0 18px 32px -28px rgba(15,23,42,0.42);
}

#plc-widget-root .plc-tool-btn,
#plc-widget-root .plc-send-btn {
  box-shadow: 0 12px 24px -20px rgba(15,23,42,0.42);
}

@media (max-width: 640px) {
  #plc-widget-root #plc-widget-window {
    border-radius: 24px 24px 0 0;
  }

  #plc-widget-root #plc-widget-header {
    padding-top: 16px;
    padding-bottom: 12px;
  }

  #plc-widget-root .plc-visitor-quick-actions {
    gap: 8px;
    padding-top: 8px;
  }

  #plc-widget-root .plc-quick-action-chip {
    min-height: 42px;
    padding-inline: 12px;
  }
}

/* ======================================================================
   Phase 2 — Stable visual release (v52) final polish overrides
   ====================================================================== */
#plc-widget-root #plc-widget-window {
  border-radius: 28px;
}
#plc-widget-root #plc-widget-header {
  padding-bottom: 13px;
}
#plc-widget-root .plc-chat-subheader {
  padding-top: 10px;
  padding-bottom: 10px;
}
#plc-widget-root .plc-context-pill,
#plc-widget-root .plc-launcher-chip {
  border-radius: 999px;
}
#plc-widget-root .plc-msg-group .plc-msg-bubble {
  border-radius: 18px;
}
#plc-widget-root .plc-visitor-quick-actions {
  margin-top: 2px;
}
#plc-widget-root .plc-quick-action-chip {
  min-height: 40px;
  font-size: 13px;
}
#plc-widget-root .plc-composer {
  padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
}
#plc-widget-root .plc-input-row {
  border-radius: 18px;
}
@media (max-width: 640px) {
  #plc-widget-root #plc-widget-window {
    border-radius: 24px 24px 0 0;
  }
  #plc-widget-root #plc-widget-header {
    padding-top: 15px;
    padding-bottom: 11px;
  }
  #plc-widget-root .plc-chat-subheader {
    padding-top: 8px;
    padding-bottom: 8px;
  }
  #plc-widget-root .plc-quick-action-chip {
    min-width: min(74vw, 220px);
  }
}
@media (prefers-reduced-motion: reduce) {
  #plc-widget-root *,
  #plc-widget-root *::before,
  #plc-widget-root *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
