.skac-container {
  --skac-accent: var(--wp--preset--color--primary, #0f766e);
  --skac-bg: #ffffff;
  --skac-text: #0f172a;
  --skac-radius: 16px;
  --skac-font: var(--wp--preset--font-family--system, "Manrope", "Helvetica Neue", Arial, sans-serif);
  font-family: var(--skac-font);
  color: var(--skac-text);
}

.skac-widget-root {
  position: fixed;
  bottom: 24px;
  z-index: 9999;
}

.skac-widget-root[data-position="left"] {
  left: 24px;
}

.skac-widget-root[data-position="right"] {
  right: 24px;
}

.skac-chat-widget {
  position: relative;
}

.skac-chat-toggle {
  background: var(--skac-accent);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 14px 40px rgba(15, 23, 42, 0.18);
}

.skac-dot {
  width: 10px;
  height: 10px;
  background: #fff;
  border-radius: 50%;
  display: inline-block;
}

.skac-chat-panel {
  width: 360px;
  height: 640px;
  background: var(--skac-bg);
  border-radius: var(--skac-radius);
  box-shadow: 0 28px 60px rgba(15, 23, 42, 0.18);
  overflow: hidden;
  display: none;
  flex-direction: column;
  position: absolute;
  bottom: 60px;
  right: 0;
}

.skac-widget-root[data-position="left"] .skac-chat-panel {
  left: 0;
  right: auto;
}

.skac-chat-panel-open {
  display: flex;
}

.skac-chat-header {
  padding: 16px 18px;
  background: linear-gradient(135deg, var(--skac-accent), #0c5d53);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.skac-title {
  font-size: 16px;
  font-weight: 700;
}

.skac-subtitle {
  font-size: 12px;
  opacity: 0.85;
}

.skac-chat-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: #fff;
  font-size: 18px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
}

.skac-chat-body {
  padding: 16px;
  overflow-y: auto;
  flex: 1 1 70%;
  min-height: 55%;
  background: #f8fafc;
  position: relative;
}

.skac-msg {
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  max-width: 80%;
  line-height: 1.4;
  font-size: 14px;
}

.skac-user {
  background: var(--skac-accent);
  color: #fff;
  margin-left: auto;
}

.skac-assistant {
  background: #fff;
  color: var(--skac-text);
  border: 1px solid #e2e8f0;
}

.skac-typing {
  font-size: 12px;
  color: #64748b;
  padding: 6px 10px;
}

.skac-chat-actions {
  padding: 8px 16px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: #fff;
}

.skac-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 10px;
  background: var(--skac-accent);
  color: #fff;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 600;
  font-size: 13px;
  align-self: flex-start;
}

.skac-lead-toggle {
  background: transparent;
  border: 1px dashed var(--skac-accent);
  color: var(--skac-accent);
  padding: 7px 10px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
  align-self: flex-start;
}

.skac-lead-panel {
  display: none;
  max-height: 320px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-right: 4px;
}

.skac-lead-open {
  display: block;
}

.skac-lead-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.skac-lead-back {
  background: transparent;
  border: 1px solid #e2e8f0;
  color: #64748b;
  padding: 6px 10px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 12px;
}

.skac-lead-form {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.skac-lead-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
}

.skac-lead-form input,
.skac-lead-form textarea {
  width: 100%;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  font-family: var(--skac-font);
  font-size: 12px;
  text-transform: none;
}

.skac-lead-form button {
  background: var(--skac-accent);
  border: none;
  color: #fff;
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
}

.skac-lead-status {
  font-size: 12px;
  color: #64748b;
}

.skac-chat-form {
  display: flex;
  gap: 8px;
  padding: 8px 16px 12px;
  background: #fff;
  border-top: 1px solid #e2e8f0;
  align-items: flex-end;
}

.skac-chat-input {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 12px;
  font-family: var(--skac-font);
  min-height: 64px;
  resize: vertical;
  text-transform: none;
}

.skac-chat-input::placeholder {
  text-transform: none;
  letter-spacing: normal;
  font-weight: 500;
}

.skac-chat-send {
  background: var(--skac-accent);
  color: #fff;
  border: none;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.skac-send-icon {
  display: inline-flex;
  width: 18px;
  height: 18px;
}

.skac-send-icon svg {
  width: 18px;
  height: 18px;
}

.skac-whatsapp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 12px;
  background: #25d366;
  color: #fff;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 600;
}

.skac-prechat-legal {
  margin-top: 10px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.skac-prechat-legal a {
  font-size: 11px;
  color: #64748b;
  text-decoration: none;
}

.skac-lead-panel .skac-prechat-legal {
  margin-top: 8px;
  justify-content: flex-start;
}

.skac-consent {
  display: grid;
  grid-template-columns: 16px 1fr;
  gap: 8px;
  text-align: left;
  font-size: 12px;
  color: #475569;
  align-items: start;
}

.skac-consent input {
  margin-top: 2px;
}
.skac-reset {
  background: transparent;
  border: 1px solid #e2e8f0;
  color: #64748b;
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
}

.skac-actions-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.skac-reset-lead {
  background: transparent;
  border: 1px dashed #e2e8f0;
  color: #64748b;
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
}

.skac-reset,
.skac-reset-lead {
  font-size: 12px;
  padding: 6px 8px;
}

.skac-prechat {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(248, 250, 252, 0.96);
  padding: 16px;
  z-index: 2;
}

.skac-prechat-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 16px;
  width: 100%;
  max-width: 320px;
  text-align: center;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12);
}

.skac-prechat-card h4 {
  margin: 0 0 8px;
  font-size: 16px;
}

.skac-prechat-card p {
  margin: 0 0 12px;
  font-size: 13px;
  color: #64748b;
}

.skac-prechat-form {
  display: grid;
  gap: 8px;
}

.skac-prechat-form input {
  width: 100%;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  font-size: 12px;
  font-family: var(--skac-font);
  text-transform: none;
}

.skac-prechat-form button {
  background: var(--skac-accent);
  border: none;
  color: #fff;
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
}

.skac-prechat-status {
  font-size: 12px;
  color: #64748b;
}

.skac-prechat-active .skac-prechat {
  display: flex;
}

.skac-prechat-active .skac-chat-actions,
.skac-prechat-active .skac-chat-form {
  opacity: 0.3;
  pointer-events: none;
}

.skac-page-gdpr {
  padding: 10px 16px;
  font-size: 12px;
  color: #64748b;
  border-top: 1px solid #e2e8f0;
  background: #fff;
}

.skac-powered {
  text-align: center;
  font-size: 11px;
  color: #94a3b8;
  padding: 6px 10px 12px;
}

.skac-embed {
  width: 100%;
  min-height: 620px;
}

.skac-embed .skac-chat-panel {
  position: static;
  width: 100%;
  height: 100%;
  min-height: 620px;
  display: flex;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.12);
}

.skac-embed .skac-chat-panel-open {
  display: flex;
}

@media (max-width: 600px) {
  .skac-chat-panel {
    width: 92vw;
    height: 80vh;
  }

  .skac-widget-root {
    left: 12px;
    right: 12px;
    bottom: 16px;
  }

  .skac-widget-root[data-position="left"],
  .skac-widget-root[data-position="right"] {
    left: 12px;
    right: 12px;
  }

  .skac-lead-panel {
    max-height: 45vh;
  }
}
