/*!
 * PiG Agent Widget — Reduced CSS for current v2 templates/pages only
 */

#chatbotPanelWidget,
#btnSupportFloating {
  --pig-color-text: #212529;
  --pig-color-subtext: #6c757d;
  --pig-color-bg: #ffffff;
  --pig-color-border: #e7e7e7;
  --pig-color-bg-lighter: #f1f1ef;
  --pig-color-bg-subtle: #f8f9fa;
  --pig-color-hover-bg: #ffffff;
  --pig-color-primary: #1e1d2f;
  --pig-color-primary-rgb: 30, 29, 47;
  --pig-color-text-muted: #adb5bd;
  --pig-send-button-bg: var(--pig-color-primary);
  --pig-send-button-color: #ffffff;
  --pig-send-button-hover-bg: var(--pig-color-primary);
  --pig-send-button-size: 32px;
  --pig-send-button-icon-size: 18px;
  --pig-figure-atlas: url('./assets/pig_figure.png');
}

html[data-theme="dark"] #chatbotPanelWidget,
html[data-theme="dark"] #btnSupportFloating {
  --pig-color-text: #e1e1e1;
  --pig-color-subtext: #a1a1a1;
  --pig-color-bg: #131314;
  --pig-color-border: #3e3e42;
  --pig-color-bg-lighter: #222221;
  --pig-color-bg-subtle: #252526;
  --pig-color-hover-bg: #3a3a3a;
  --pig-color-primary: #f0f0ea;
  --pig-color-primary-rgb: 240, 240, 234;
  --pig-color-text-muted: #888888;
  --pig-send-button-bg: var(--pig-color-primary);
  --pig-send-button-color: var(--pig-color-bg);
  --pig-send-button-hover-bg: var(--pig-color-primary);
}

@keyframes pig-agent-breath {

  0%,
  100% {
    transform: translateY(var(--breath-y-0, 0)) scale(var(--breath-scale-0, 1));
  }

  50% {
    transform: translateY(var(--breath-y-50, -3px)) scale(var(--breath-scale-50, 1.03));
  }
}

@keyframes pig-feedback-toast-in {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

#chatbotPanelWidget .btn-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--pig-send-button-size);
  height: var(--pig-send-button-size);
  flex: 0 0 var(--pig-send-button-size);
  border: none;
  border-radius: 50%;
  padding: 0;
  outline: none;
  box-shadow: none;
  font: inherit;
  background-color: var(--pig-send-button-bg);
  color: var(--pig-send-button-color);
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
}

#chatbotPanelWidget .btn-submit:hover,
#chatbotPanelWidget .btn-submit:focus {
  background-color: var(--pig-send-button-hover-bg);
  transform: translateY(-1px);
}

#chatbotPanelWidget .btn-submit:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
}

#chatbotPanelWidget .btn-submit svg {
  width: var(--pig-send-button-icon-size);
  height: var(--pig-send-button-icon-size);
}

.chatbot-panel {
  display: flex;
  flex-direction: column;
}

.chatbot-panel-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.28);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s ease;
  z-index: 9998;
}

.chatbot-panel-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.chatbot-panel.widget {
  position: fixed;
  top: 50%;
  left: 50%;
  width: min(1120px, calc(100vw - 48px));
  height: min(780px, calc(100vh - 48px));
  min-width: 320px;
  min-height: 620px;
  background: var(--pig-color-bg);
  color: var(--pig-color-text);
  border: 1px solid var(--pig-color-border);
  border-radius: 24px;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.18);
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, calc(-50% + 12px));
  transition: opacity 0.24s ease, transform 0.24s ease;
  z-index: 9999;
}

.chatbot-panel.widget.active {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%);
}

.chatbot-panel .chatbot-workspace {
  height: 100%;
  display: flex;
  min-height: 0;
}

.chatbot-panel .agent-sidebar {
  width: 290px;
  flex: 0 0 290px;
  background: rgba(var(--pig-color-primary-rgb), 0.04);
  border-right: 1px solid var(--pig-color-border);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chatbot-panel .agent-sidebar-header {
  display: flex;
  align-items: center;
  padding: 18px 12px 0;
  gap: 10px;
}

.chatbot-panel .sidebar-conts {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  padding: 0px 8px 0;
}

.chatbot-panel .agent-sidebar-close {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--pig-color-subtext);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 34px;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.16s ease, background-color 0.16s ease, color 0.16s ease;
}

.chatbot-panel .agent-sidebar-close:hover,
.chatbot-panel .agent-sidebar-close:focus-visible {
  background: rgba(var(--pig-color-primary-rgb), 0.08);
  color: var(--pig-color-text);
  opacity: .75;
}

.chatbot-panel .agent-sidebar-close-icon,
.chatbot-panel .agent-sidebar-close-icon .icon {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chatbot-panel .agent-sidebar-title {
  font-size: 1rem;
  line-height: 1.25;
}

.chatbot-panel .agent-primary-action {
  width: 100%;
  border-radius: 8px;
  padding: 6px 12px;
  color: var(--pig-color-text);
  font-size: 0.9rem;
  cursor: pointer;
  text-align: left;
  border: 0;
  background-color: transparent;
  display: flex;
  align-items: center;
  gap: 8px;

}

.chatbot-panel .agent-primary-action:hover,
.chatbot-panel .agent-chat-group:has(.agent-row-compose-btn:hover) .agent-chat-group-row,
.chatbot-panel .agent-chat-group:has(.agent-row-compose-btn:focus-visible) .agent-chat-group-row {
  background: rgba(var(--pig-color-primary-rgb), 0.04);
}

.chatbot-panel .agent-primary-action.active {
  background: rgba(var(--pig-color-primary-rgb), 0.075);
}

.chatbot-panel .agent-primary-action span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chatbot-panel .agent-action-icon,
.chatbot-panel .agent-action-icon .icon {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 16px;
  color: var(--pig-color-subtext);
}

.chatbot-panel .agent-sidebar-section {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
}

.chatbot-panel .agent-sidebar-footer {
  margin-top: auto;
  padding: 12px 0 10px;
}


.chatbot-panel .agent-nav-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.chatbot-panel .agent-chat-group {
  display: flex;
  flex-direction: column;
  position: relative;
}

.chatbot-panel .agent-chat-group-row-label {
  min-width: 0;
  flex: 1;
  padding-right: 32px;
}

.chatbot-panel .agent-chat-group-row-label span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chatbot-panel .agent-row-compose-btn {
  position: absolute;
  top: 3px;
  right: 4px;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--pig-color-subtext);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
}

.chatbot-panel .agent-chat-group-row:hover+.agent-row-compose-btn,
.chatbot-panel .agent-chat-group-row:focus-visible+.agent-row-compose-btn,
.chatbot-panel .agent-row-compose-btn:hover,
.chatbot-panel .agent-row-compose-btn:focus-visible {
  opacity: 1;
  pointer-events: auto;
}

.chatbot-panel .agent-row-compose-btn:hover,
.chatbot-panel .agent-row-compose-btn:focus-visible {
  background: rgba(var(--pig-color-primary-rgb), 0.08);
  color: var(--pig-color-text);
}

.chatbot-panel .agent-row-compose-icon,
.chatbot-panel .agent-row-compose-icon .icon {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.chatbot-panel .agent-chat-session-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}

.chatbot-panel .agent-chat-group.is-expanded .agent-chat-session-list {
  overflow: visible;
}

.chatbot-panel .agent-chat-empty {
  display: flex;
  align-items: center;
  padding: 0px 8px 10px 36px;
  color: var(--pig-color-subtext);
  font-size: 0.85rem;
  opacity: 0.55;
}

.chatbot-panel .agent-chat-session {
  width: 100%;
  min-height: 30px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--pig-color-subtext);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px 6px 36px;
  font-size: 0.9rem;
  text-align: left;
  cursor: pointer;
}

.chatbot-panel .agent-chat-session:hover,
.chatbot-panel .agent-chat-session.active {
  background: rgba(var(--pig-color-primary-rgb), 0.04);
  color: var(--pig-color-text);
}

.chatbot-panel .agent-chat-session-title {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chatbot-panel .agent-chat-session-time {
  flex: 0 0 auto;
  color: var(--pig-color-subtext);
  font-size: 0.82rem;
  opacity: 0.82;
  white-space: nowrap;
}

.chatbot-panel .agent-chat-session:hover .agent-chat-session-time,
.chatbot-panel .agent-chat-session.active .agent-chat-session-time {
  color: var(--pig-color-subtext);
}

.chatbot-panel .agent-chat-more {
  width: 100%;
  min-height: 30px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--pig-color-subtext);
  display: flex;
  align-items: center;
  padding: 6px 8px 6px 36px;
  font-size: 0.875rem;
  text-align: left;
  cursor: pointer;
  opacity: 0.82;
}

.chatbot-panel .agent-chat-more:hover,
.chatbot-panel .agent-chat-more:focus-visible {
  background: rgba(var(--pig-color-primary-rgb), 0.04);
  color: var(--pig-color-text);
}

.chatbot-panel .chatbot-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.chatbot-panel .chatbot-main-view {
  display: none;
  flex: 1;
  min-height: 0;
}

.chatbot-panel .chatbot-main-view.is-active {
  display: flex;
  flex-direction: column;
}

.chatbot-panel .chatbot-page {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.chatbot-panel .chatbot-page.is-intro .view-header {
  visibility: hidden;
}

.chatbot-panel .chatbot-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.chatbot-panel .chatbot-scroll-container {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

.chatbot-panel .chatbot-messages {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 22px 22px 18px;
  align-items: flex-start;
  width: 100%;
  box-sizing: border-box;
  flex-grow: 1;
}

.chatbot-panel .chatbot-page.is-intro .chatbot-messages {
  justify-content: center;
  align-items: center;
  padding: 22px 34px 42px;
}

.chatbot-panel .welcome-content {
  width: 100%;
  height: 100%;
  display: flex;
  flex: 1;
  min-height: 100%;
  align-items: stretch;
  justify-content: center;
  padding: 4px 0 0;
}

.chatbot-panel .chatbot-page.is-intro .welcome-content {
  max-width: 980px;
  min-height: 100%;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 34px;
  padding: 0;
}

.chatbot-panel .empty-state-view {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  width: 100%;
  min-height: 100%;
  gap: 18px;
}

.chatbot-panel .chatbot-page.is-intro .empty-state-view {
  flex: 0 0 auto;
  min-height: 0;
  align-items: center;
  justify-content: center;
  gap: 0;
}

.chatbot-panel .chatbot-intro-heading {
  width: 100%;
  text-align: center;
}

.chatbot-panel .chatbot-intro-title {
  margin: 0;
  font-size: 1.5rem;
  line-height: 1.2;
  font-weight: 500;
}

.chatbot-panel .chatbot-intro-input-slot {
  display: contents;
}

.chatbot-panel .chatbot-page.is-intro .chatbot-intro-input-slot {
  display: block;
  width: 100%;
}

.chatbot-panel .chatbot-quick-actions {
  display: none;
}

.chatbot-panel .chatbot-page.is-intro .chatbot-quick-actions {
  display: block;
  width: 100%;
  max-width: 860px;
}

.chatbot-panel .chatbot-quick-action-list {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.chatbot-panel .chatbot-quick-action {
  width: 100%;
  min-height: 44px;
  border: 0;
  border-bottom: 1px solid rgba(var(--pig-color-primary-rgb), 0.08);
  background: transparent;
  color: var(--pig-color-subtext);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 24px;
  font: inherit;
  font-size: 0.95rem;
  line-height: 1.4;
  text-align: left;
  cursor: pointer;
}

.chatbot-panel .chatbot-quick-action:last-child {
  border-bottom: 0;
}

.chatbot-panel .chatbot-quick-action:hover,
.chatbot-panel .chatbot-quick-action:focus-visible {
  color: var(--pig-color-text);
  background: transparent;
}

.chatbot-panel .chat-message {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 14px;
}

.chatbot-panel .chat-message:first-child {
  margin-top: auto;
}

.chatbot-panel .chat-message.is-user {
  align-items: flex-end;
}

.chatbot-panel .chat-message.is-assistant {
  align-items: flex-start;
}

.chatbot-panel .chat-message-bubble {
  max-width: 780px;
  border-radius: 16px;
  padding: 12px 14px;
  font-size: 0.94rem;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}

.chatbot-panel .chat-message.is-user .chat-message-bubble {
  background: var(--pig-color-bg-subtle);
  border-bottom-right-radius: 0px;
}

.chatbot-panel .chat-message.is-assistant .chat-message-bubble {}

.chatbot-panel .chat-message-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.chatbot-panel .chat-message-attachment {
  max-width: 220px;
  border-radius: 8px;
  background: rgba(var(--pig-color-primary-rgb), 0.08);
  color: var(--pig-color-text);
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  font-size: 0.78rem;
  line-height: 1.5;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chatbot-panel .chat-message.is-pending .chat-message-bubble {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 54px;
  min-height: 42px;
}

.chatbot-panel .chat-typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--pig-color-subtext);
  opacity: 0.45;
  animation: chat-typing-pulse 1s ease-in-out infinite;
}

.chatbot-panel .chat-typing-dot:nth-child(2) {
  animation-delay: 0.12s;
}

.chatbot-panel .chat-typing-dot:nth-child(3) {
  animation-delay: 0.24s;
}

@keyframes chat-typing-pulse {

  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.35;
  }

  40% {
    transform: translateY(-3px);
    opacity: 0.9;
  }
}

.chatbot-panel .chatbot-input {
  padding: 0 22px 22px;
}

.chatbot-panel .chatbot-page.is-intro .chatbot-input {
  width: 100%;
  max-width: 920px;
  padding: 0;
}

.chatbot-panel .chatbot-input-wrapper {
  position: relative;
  border-radius: 16px;
  background-color: var(--pig-color-bg);
  border: 1px solid var(--pig-color-border);
  box-shadow: 0 14px 32px rgba(var(--pig-color-primary-rgb), 0.06);
}

.chatbot-panel .chatbot-page.is-intro .chatbot-input-wrapper {
  border-radius: 16px;
}

.chatbot-panel .chatbot-textarea {
  width: 100%;
  resize: none;
  border: 0;
  padding: 12px 16px 0;
  font-family: 'Pretendard', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  font-size: 1rem;
  line-height: 1.7;
  min-height: 2rem;
  max-height: 150px;
  overflow-y: auto;
  background-color: transparent;
  color: var(--pig-color-text);
}

.chatbot-panel .chatbot-textarea::placeholder {
  color: var(--pig-color-subtext);
  opacity: 0.7;
}

.chatbot-panel .chatbot-textarea:focus {
  outline: none;
}

.chatbot-panel .chatbot-footer {
  padding: 8px 10px 8px;
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
}

.chatbot-panel .chatbot-footer-tools {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.chatbot-panel .chatbot-add-menu-wrap {
  position: relative;
  flex: 0 0 auto;
}

.chatbot-panel .chatbot-add-button {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--pig-color-subtext);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
}

.chatbot-panel .chatbot-add-button:hover,
.chatbot-panel .chatbot-add-button:focus-visible,
.chatbot-panel .chatbot-add-menu-wrap.is-open .chatbot-add-button {
  background: var(--pig-color-bg-lighter);
  color: var(--pig-color-text);
  outline: none;
}

.chatbot-panel .chatbot-add-button-icon,
.chatbot-panel .chatbot-add-button-icon .icon {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chatbot-panel .chatbot-add-menu {
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  width: 152px;
  padding: 6px;
  border: 1px solid var(--pig-color-border);
  border-radius: 8px;
  background: var(--pig-color-bg);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.14);
  display: none;
  z-index: 5;
}

.chatbot-panel .chatbot-add-menu-wrap.is-open .chatbot-add-menu {
  display: block;
}

.chatbot-panel .chatbot-add-menu-item {
  width: 100%;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--pig-color-text);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  font: inherit;
  font-size: 0.88rem;
  text-align: left;
  cursor: pointer;
}

.chatbot-panel .chatbot-add-menu-item:hover,
.chatbot-panel .chatbot-add-menu-item:focus-visible {
  background: var(--pig-color-bg-lighter);
  outline: none;
}

.chatbot-panel .chatbot-add-menu-icon,
.chatbot-panel .chatbot-add-menu-icon .icon {
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--pig-color-subtext);
}

.chatbot-panel .chatbot-file-input {
  display: none;
}

.chatbot-panel .chatbot-attachment-list {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
}

.chatbot-panel .chatbot-attachment-chip {
  max-width: 180px;
  height: 28px;
  border-radius: 8px;
  background: var(--pig-color-bg-lighter);
  color: var(--pig-color-text);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 4px 0 10px;
  font-size: 0.78rem;
}

.chatbot-panel .chatbot-attachment-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chatbot-panel .chatbot-attachment-remove {
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--pig-color-subtext);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}

.chatbot-panel .chatbot-attachment-remove:hover,
.chatbot-panel .chatbot-attachment-remove:focus-visible {
  background: rgba(var(--pig-color-primary-rgb), 0.1);
  color: var(--pig-color-text);
  outline: none;
}

.chatbot-panel .view-shell {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.chatbot-panel .view-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 12px 20px 32px;
  flex: 0 0 auto;
  z-index: 1;
  isolation: isolate;
  height: 70px;
}

.chatbot-panel .view-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-left: auto;
}

.chatbot-panel .view-header-actions-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chatbot-panel .view-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 22px 22px 22px 32px;
}

.chatbot-panel .view-breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
}

.chatbot-panel .view-breadcrumb-root {
  border: 0;
  padding: 0;
  font-size: 0.95rem;
  line-height: 1.2;
  color: var(--pig-color-subtext);
  cursor: pointer;
  background-color: transparent;
}

.chatbot-panel .view-breadcrumb-root:hover,
.chatbot-panel .view-breadcrumb-root:focus-visible {
  color: var(--pig-color-text);
}

.chatbot-panel .view-breadcrumb-item {
  font-size: 0.95rem;
  line-height: 1.2;
  color: var(--pig-color-subtext);
}

.chatbot-panel .view-breadcrumb-item.is-current {
  line-height: 1.2;
  color: var(--pig-color-text);
}

.chatbot-panel .view-breadcrumb-separator {
  color: var(--pig-color-border-strong, #c2c8d0);
  font-size: 0.95rem;
  line-height: 1;
}

.chatbot-panel .view-breadcrumb-separator::before {
  content: "/";
}

.chatbot-panel .view-subtitle {
  margin: 8px 0 0;
  color: var(--pig-color-subtext);
  font-size: 0.92rem;
  line-height: 1.6;
}

.chatbot-panel .view-primary-action {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 999px;
  padding: 8px 16px;
  background: var(--pig-color-primary);
  color: var(--pig-color-hover-bg);
  cursor: pointer;
}

.chatbot-panel .view-outline-action {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--pig-color-border);
  border-radius: 999px;
  padding: 12px 16px;
  background: var(--pig-color-bg);
  color: var(--pig-color-text);
  font-weight: 600;
  cursor: pointer;
}

.chatbot-panel .view-primary-action-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.chatbot-panel .view-primary-action-label {
  display: inline-block;
}

.chatbot-panel .view-primary-action .icon {
  width: 18px;
  height: 18px;
}

.chatbot-panel .view-icon-action {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--pig-color-subtext);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.chatbot-panel .view-icon-action:hover {
  background: var(--pig-color-bg-subtle);
}

.chatbot-panel .view-icon-action-glyph,
.chatbot-panel .view-icon-action-glyph .icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}


.chatbot-panel .section-caption {
  font-size: 0.95rem;
  color: var(--pig-color-subtext);
  font-weight: 500;
}

.chatbot-panel .content-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.chatbot-panel .section-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 15px;
}


.chatbot-panel .empty-state-card {
  margin-top: 15px;
}

.chatbot-panel .empty-state-template-list {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.chatbot-panel .empty-state-template {
  border: 1px solid var(--pig-color-border);
  border-radius: 14px;
  padding: 16px;
  background: var(--pig-color-bg);
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.chatbot-panel .empty-state-template-title {
  font-size: 0.95rem;
}

.chatbot-panel .empty-state-template-text {
  font-size: 0.84rem;
  line-height: 1.6;
  color: var(--pig-color-subtext);
}

.chatbot-panel .empty-state-title {
  font-size: 1rem;
  font-weight: 500;
  color: var(--pig-color-text);
}

.chatbot-panel .empty-state-text {
  margin-top: 4px;
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--pig-color-subtext);
}

.chatbot-panel .form-view {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 100%;
}

.chatbot-panel .form-group {
  margin-bottom: 18px;
}

.chatbot-panel .form-group.form-group-emphasis {
  padding: 16px;
  border-radius: 16px;
  background: var(--pig-color-bg-subtle);
}

.chatbot-panel .form-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 0;
  align-items: stretch;
  flex: 1;
  min-height: 100%;
}

.chatbot-panel .form-layout-main,
.chatbot-panel .form-layout-side {
  min-width: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.chatbot-panel .form-layout-main {
  padding: 0px 36px 24px 0;
}

.chatbot-panel .form-layout-side {
  border-left: 1px solid var(--pig-color-border);
  padding: 0px 0 24px 36px;
}

.chatbot-panel .form-label {
  font-size: 0.85rem;
  margin-bottom: 2px;
  display: block;
  color: var(--pig-color-subtext);
}

.chatbot-panel .form-control {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--pig-color-border);
  border-radius: 14px;
  padding: 12px 14px;
  background: #fff;
  color: var(--pig-color-text);
  font-size: 0.94rem;
  line-height: 1.5;
}

.chatbot-panel .form-control:focus {
  outline: none;
  border-color: #8bb8ff;
  box-shadow: 0 0 0 3px rgba(139, 184, 255, 0.18);
}

.chatbot-panel select.form-control {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 44px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5.5 7.5 10 12l4.5-4.5' fill='none' stroke='%23212529' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 16px 16px;
}

html[data-theme="dark"] .chatbot-panel .form-control:focus {
  border-color: #7aa8f5;
  box-shadow: 0 0 0 3px rgba(122, 168, 245, 0.22);
}

html[data-theme="dark"] .chatbot-panel select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5.5 7.5 10 12l4.5-4.5' fill='none' stroke='%23e1e1e1' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.chatbot-panel select.form-control::-ms-expand {
  display: none;
}

.chatbot-panel .form-control.is-textarea {
  min-height: 120px;
  resize: vertical;
}


.chatbot-panel .form-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  color: var(--pig-color-text);
}

html[data-theme="dark"] .chatbot-panel .form-group.form-group-emphasis {
  background: var(--pig-color-bg-lighter);
}

.chatbot-panel .list-item-card {
  border-radius: 18px;
  background: var(--pig-color-bg);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 12px;
  position: relative;
}


.chatbot-panel .list-item-card.has-leading {
  margin-left: -20px;
}

.chatbot-panel .list-item-card.is-running {}

.chatbot-panel .list-item-card.is-selected {
  border-color: rgba(var(--pig-color-primary-rgb), 0.22);
  background: var(--pig-color-bg-subtle);
}

.chatbot-panel .list-item-card:hover,
.chatbot-panel .list-item-card:focus-within {
  border-color: rgba(var(--pig-color-primary-rgb), 0.18);
  background: var(--pig-color-bg-subtle);
}

.chatbot-panel .list-item-state-btn {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  flex: 0 0 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.chatbot-panel .list-item-state-icon {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  color: var(--pig-color-text-muted);
}

.chatbot-panel .list-item-state-glyph {
  position: absolute;
  inset: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.12s ease;
}

.chatbot-panel .list-item-state-glyph.is-hover {
  opacity: 0;
}

.chatbot-panel .list-item-state-btn:hover .list-item-state-glyph.is-current,
.chatbot-panel .list-item-state-btn:focus-visible .list-item-state-glyph.is-current {
  opacity: 0;
}

.chatbot-panel .list-item-state-btn:hover .list-item-state-glyph.is-hover,
.chatbot-panel .list-item-state-btn:focus-visible .list-item-state-glyph.is-hover {
  opacity: 1;
}

.chatbot-panel .list-item-state-icon .icon {
  width: 18px;
  height: 18px;
  stroke-width: 2.2;
}

.chatbot-panel .list-item-main {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 0;
  text-align: left;
  color: inherit;
  cursor: pointer;
}

.chatbot-panel .list-item-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chatbot-panel .list-item-title {
  display: block;
  font-size: 0.95rem;
  color: var(--pig-color-text);
}

.chatbot-panel .list-item-meta {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  color: var(--pig-color-subtext);
  margin-left: auto;
  min-width: 120px;
}

.chatbot-panel .list-item-caption {
  font-size: 0.92rem;
  white-space: nowrap;
  transition: opacity 0.12s ease;
}

.chatbot-panel .list-item-actions {
  position: absolute;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease;
}

.chatbot-panel .list-item-meta:hover .list-item-caption,
.chatbot-panel .list-item-meta:focus-within .list-item-caption {
  opacity: 0;
}

.chatbot-panel .list-item-meta:hover .list-item-actions,
.chatbot-panel .list-item-meta:focus-within .list-item-actions {
  opacity: 1;
  pointer-events: auto;
}

.chatbot-panel .list-item-action-btn {
  width: 28px;
  height: 28px;
  border: 0;
  background: transparent;
  color: var(--pig-color-subtext);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.chatbot-panel .list-item-action-btn:hover,
.chatbot-panel .list-item-action-btn:focus-visible {
  color: var(--pig-color-primary);
}

.chatbot-panel .list-item-action-icon,
.chatbot-panel .list-item-action-icon .icon {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chatbot-panel .detail-view {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 0;
  min-height: 100%;
  margin-top: 10px;
}

.chatbot-panel .feedback-banner {
  position: absolute;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  z-index: 24;
  width: min(480px, calc(100% - 32px));
  border-radius: 18px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: 0 14px 40px rgba(15, 23, 42, 0.16);
  background: var(--pig-color-primary);
  border: 1px solid var(--pig-color-primary);
  color: var(--pig-color-bg);
  animation: pig-feedback-toast-in 0.22s ease;
}

.chatbot-panel .feedback-copy {
  font-size: 0.9rem;
  line-height: 1.5;
  min-width: 0;
}

.chatbot-panel .feedback-close {
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  flex: 0 0 auto;
}

.chatbot-panel .detail-main-section+.detail-main-section {
  margin-top: 48px;
}

.chatbot-panel .detail-hero-title {
  margin: 0;
  font-size: 1.5rem;
  line-height: 1.08;
  font-weight: 500;
  color: var(--pig-color-text);
}

.chatbot-panel .detail-hero-copy {
  margin-top: 18px;
  font-size: 0.95rem;
  line-height: 1.72;
  color: var(--pig-color-text);
}

.chatbot-panel .detail-side-group:not(:last-child) {
  margin-bottom: 32px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chatbot-panel .detail-side-group.is-muted {
  color: var(--pig-color-subtext);
}

.chatbot-panel .data-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.chatbot-panel .data-label {
  font-size: 0.85rem;
  color: var(--pig-color-text);
}

.chatbot-panel .data-value {
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--pig-color-text);
  text-align: right;
}

.chatbot-panel .badge-pill-dim {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0px 8px;
  border-radius: 999px;
  background: var(--pig-color-bg-subtle);
  color: var(--pig-color-text);
  font-size: 0.8rem;
}

.chatbot-panel .badge-pill-dim::before {
  content: '';
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: rgba(var(--pig-color-primary-rgb), 0.42);
}

.chatbot-panel .badge-pill-dim.is-success::before {
  background: #22c55e;
}

.chatbot-panel .detail-side-empty {
  font-size: 0.92rem;
  color: var(--pig-color-subtext);
}

.chatbot-panel .history-list {
  padding-top: 6px;
}

.chatbot-panel .history-item {
  position: relative;
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr);
  gap: 8px;
  padding: 0 0 24px;
}

.chatbot-panel .history-item+.history-item {
  margin-top: 0;
}

.chatbot-panel .history-item::before {
  content: "";
  position: absolute;
  top: 5px;
  bottom: -12px;
  left: 5.5px;
  width: 2px;
  background: var(--pig-color-border);
}

.chatbot-panel .history-item:last-child {
  padding-bottom: 0;
}

.chatbot-panel .history-item:last-child::before {
  bottom: auto;
  height: 14px;
}

.chatbot-panel .history-item-marker {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  padding-top: 7px;
}

.chatbot-panel .history-item-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--pig-color-text-muted);
  box-shadow: 0 0 0 4px var(--pig-color-bg);
}

.chatbot-panel .history-item-dot.is-success {
  background: var(--pig-color-primary);
}

.chatbot-panel .history-item-dot.is-failed {
  background: var(--pig-color-text-muted);
}

.chatbot-panel .history-item-body {
  min-width: 0;
}

.chatbot-panel .history-item-row {
  display: flex;
  align-items: baseline;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 6px;
}

.chatbot-panel .history-item-time {
  font-size: 0.85rem;
}

.chatbot-panel .history-item-text {
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--pig-color-subtext);
}

.chatbot-panel .popup-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.18);
  backdrop-filter: blur(1px);
  -webkit-backdrop-filter: blur(1px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10020;
}

.chatbot-panel .modal-card {
  width: min(420px, calc(100% - 32px));
  border-radius: 18px;
  background: var(--pig-color-bg);
  border: 1px solid var(--pig-color-border);
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.18);
  padding: 22px;
}

.chatbot-panel .modal-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--pig-color-text);
}

.chatbot-panel .modal-text {
  margin-top: 10px;
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--pig-color-subtext);
}

.chatbot-panel .modal-actions {
  margin-top: 18px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.chatbot-panel .modal-btn {
  min-height: 42px;
  border: 1px solid var(--pig-color-border);
  border-radius: 12px;
  padding: 0 16px;
  background: var(--pig-color-bg);
  color: var(--pig-color-text);
  font-weight: 600;
  cursor: pointer;
}

.chatbot-panel .modal-btn.is-danger {
  background: #17171c;
  border-color: #17171c;
  color: #fff;
}

.chatbot-panel.widget.active~#btnSupportFloating {
  opacity: 0 !important;
  pointer-events: none !important;
}

#btnSupportFloating {
  position: fixed;
  bottom: 40px;
  right: 30px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 99999 !important;
  transition: right 0.3s ease, bottom 0.3s ease, opacity 0.3s ease;
  touch-action: none;
  user-select: none;
}

#btnSupportFloating.is-dragging,
#btnSupportFloating.is-restoring-position {
  transition: none;
}

#btnSupportFloating.is-dragging {
  cursor: grabbing;
}

#btnSupportFloating .floating-action-btn {
  width: 60px;
  height: 60px;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

#btnSupportFloating.is-dragging .floating-action-btn {
  cursor: grabbing;
}

#btnSupportFloating .floating-action-btn.btn-support {
  appearance: none;
  -webkit-appearance: none;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  width: 112px;
  height: 140px;
  position: relative;
  overflow: hidden;
  background-color: transparent;
  animation: pig-agent-breath 3s ease-in-out infinite;
  --idle-opacity: 1;
  --pig-figure-idle-x: 0px;
  --pig-figure-expression-x: -112px;
}

html[data-theme="dark"] #btnSupportFloating .floating-action-btn.btn-support {
  filter: brightness(0.9) contrast(1.05);
}

#btnSupportFloating .floating-action-btn.btn-support:hover,
#btnSupportFloating .floating-action-btn.btn-support.active {
  --breath-y-0: -4px;
  --breath-scale-0: 1.04;
  --breath-y-50: -10px;
  --breath-scale-50: 1.09;
  --expression-opacity: 1;
  --idle-opacity: 0;
}

#btnSupportFloating .floating-action-btn.btn-support::before,
#btnSupportFloating .floating-action-btn.btn-support::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: var(--pig-figure-atlas);
  background-size: 448px 140px;
  background-position-y: 0;
  background-repeat: no-repeat;
  transition: opacity 0.3s ease-in-out;
  pointer-events: none;
}

#btnSupportFloating .floating-action-btn.btn-support::before {
  background-position-x: var(--pig-figure-idle-x);
  opacity: var(--idle-opacity);
  z-index: 1;
}

#btnSupportFloating .floating-action-btn.btn-support::after {
  background-position-x: var(--pig-figure-expression-x);
  opacity: var(--expression-opacity, 0);
  z-index: 2;
}

#btnSupportFloating .floating-action-btn.btn-support.active {
  --pig-figure-expression-x: -224px;
}

#btnSupportFloating .pig-speech-bubble {
  position: absolute;
  top: 0;
  left: calc(100% - 10px);
  transform: translateY(-50%);
  background: rgba(33, 37, 41, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px 20px 20px 4px;
  padding: 12px 16px;
  box-shadow: 10px 0 30px rgba(0, 0, 0, 0.2);
  max-width: 210px;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.6s ease-out, visibility 0.6s ease-out, left 0.6s ease-out;
}

#btnSupportFloating.is-on-right .pig-speech-bubble {
  left: auto;
  right: calc(100% - 10px);
  border-radius: 20px 20px 4px 20px;
}

#btnSupportFloating .pig-speech-bubble .bubble-content {
  color: #ffffff;
  font-size: 14px;
  line-height: 1.7;
}

html[data-theme="dark"] #btnSupportFloating .pig-speech-bubble {
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 10px 0 30px rgba(0, 0, 0, 0.3);
}

html[data-theme="dark"] #btnSupportFloating .pig-speech-bubble .bubble-content {
  color: #212529;
}

@media (max-width: 1180px) {
  .chatbot-panel.widget {
    width: calc(100vw - 24px);
    height: calc(100vh - 24px);
    top: 50%;
    left: 50%;
  }
}

@media (max-width: 860px) {
  .chatbot-panel .chatbot-workspace {
    flex-direction: column;
  }

  .chatbot-panel .agent-sidebar {
    width: 100%;
    flex: 0 0 auto;
    border-right: 0;
  }

  .chatbot-panel .empty-state-template-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .chatbot-panel.widget {
    width: 100vw;
    height: 100vh;
    inset: 0;
    border-radius: 0;
  }

  .chatbot-panel .chatbot-messages {
    padding: 16px 14px 12px;
  }

  .chatbot-panel .chatbot-input,
  .chatbot-panel #viewScreenMount {
    padding: 14px;
  }

  .chatbot-panel .chatbot-page.is-intro .chatbot-input {
    padding: 0;
  }

  .chatbot-panel .chatbot-page.is-intro .chatbot-messages {
    padding: 16px 14px 32px;
  }

  .chatbot-panel .chatbot-quick-action {
    padding: 10px 8px;
  }

  .chatbot-panel .view-header {
    padding: 14px;
  }

  .chatbot-panel .view-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .chatbot-panel .detail-view .form-layout-side {
    padding: 24px 0 0;
  }

}

@media (max-width: 640px) {

  .chatbot-panel .view-header-actions,
  .chatbot-panel .view-header-actions-group {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .chatbot-panel .form-layout {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .chatbot-panel .form-layout-main {
    padding: 0 0 18px;
  }

  .chatbot-panel .form-layout-side {
    border-left: 0;
    border-top: 1px solid var(--pig-color-border);
    padding: 18px 0 0;
  }

  .chatbot-panel .feedback-banner {
    bottom: 16px;
    width: min(100%, calc(100% - 24px));
    padding: 13px 16px;
  }

  .chatbot-panel .view-primary-action {
    width: 100%;
    justify-content: center;
  }
}