.dak-chatbot-root,
.dak-chatbot-root * {
  box-sizing: border-box;
}

.dak-chatbot-root {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 999999;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Host pages often set `button { font: … }`; keep widget typography consistent (embed + WP). */
.dak-chatbot-root button,
.dak-chatbot-root input,
.dak-chatbot-root textarea {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.dak-chatbot-root button {
  -webkit-appearance: none;
  appearance: none;
}

.dak-chatbot-root.dak-embed-attached {
  position: relative;
  right: auto;
  bottom: auto;
  z-index: auto;
  color-scheme: light;
  color: #0f172a;
}

#dak-embed-root {
  color-scheme: light;
  isolation: isolate;
}

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

button.dak-chatbot-toggle {
  width: 58px;
  height: 58px;
  border-radius: 999px;
  border: 0;
  padding: 0;
  overflow: hidden;
  background: var(--dak-brand, #16a34a);
  background-image: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, rgba(0,0,0,0.1) 100%);
  color: #fff;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
}

button.dak-chatbot-toggle .dak-chat-icon {
  flex-shrink: 0;
}

button.dak-chatbot-toggle svg.dak-chat-icon {
  display: block;
}

button.dak-chatbot-toggle img.dak-chat-avatar {
  display: block;
  width: 34px;
  height: 34px;
  margin: 0;
  object-fit: cover;
  object-position: center;
  border-radius: 50%;
  pointer-events: none;
  flex-shrink: 0;
}

button.dak-chatbot-toggle:hover {
  background: var(--dak-brand-hover, #15803d);
  background-image: linear-gradient(135deg, rgba(255, 255, 255, 0.12) 0%, rgba(0, 0, 0, 0.12) 100%);
  transform: scale(1.05) translateY(-2px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25);
}

.dak-chatbot-window {
  position: absolute;
  right: 0;
  bottom: 76px;
  width: 380px;
  max-width: calc(100vw - 28px);
  height: 570px;
  max-height: calc(100vh - 110px);
  border-radius: 22px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 24px 70px rgba(17, 24, 39, 0.15), inset 0 1px 0 rgba(255, 255, 255, 1);
  display: flex;
  flex-direction: column;
}

.dak-chatbot-root [hidden]:not(.is-active) { display: none !important; }

.dak-chatbot-header {
  flex-shrink: 0;
  background: var(--dak-brand, #16a34a);
  background-image: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(0,0,0,0.05) 100%);
  color: #fff;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.dak-chatbot-header-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  min-height: 48px;
}

button.dak-header-back {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 0;
  padding: 0;
  margin: 0;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 24px;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, color 0.2s ease;
}

button.dak-header-back:hover {
  background: var(--dak-brand-hover, #15803d);
  color: #fff;
}

.dak-header-title {
  flex: 1;
  font-size: 17px;
  font-weight: 700;
  text-align: center;
  margin: 0;
  line-height: 1.2;
}

.dak-chatbot-header-inner .dak-header-title {
  text-align: left;
}

.dak-chatbot-window[data-dak-view="help"] .dak-chatbot-header-inner .dak-header-title.dak-title-centered {
  text-align: center;
}

.dak-header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

button.dak-chatbot-close {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 0;
  padding: 0;
  margin: 0;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease;
}

button.dak-chatbot-close:hover {
  background: var(--dak-brand-hover, #15803d);
  color: #fff;
}

button.dak-chatbot-close:active {
  background: var(--dak-brand-hover, #15803d);
  filter: brightness(0.95);
}

.dak-header-external {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 0;
  padding: 0;
  margin: 0;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease;
}

.dak-header-external:hover {
  background: var(--dak-brand-hover, #15803d);
  color: #fff;
}

.dak-help-search-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px 12px;
  position: relative;
}

.dak-help-search-icon {
  position: absolute;
  left: 26px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.75);
  font-size: 14px;
  pointer-events: none;
}

input.dak-help-search {
  width: 100%;
  border: 0;
  border-radius: 999px;
  padding: 11px 14px 11px 38px;
  font-size: 14px;
  outline: none;
  background: #fff;
  color: #0f172a;
}

input.dak-help-search::placeholder {
  color: #94a3b8;
}

.dak-chatbot-body {
  flex: 1;
  min-height: 0;
  position: relative;
  display: flex;
  flex-direction: column;
}

.dak-chatbot-panel {
  flex: 1;
  min-height: 0;
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.dak-chatbot-panel.is-active {
  display: flex;
}

.dak-panel-chat .dak-chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: rgba(248, 250, 252, 0.6);
}

.dak-chatbot-input-row {
  display: flex;
  gap: 8px;
  padding: 12px;
  background: #fff;
  border-top: 1px solid rgba(17, 24, 39, 0.08);
  flex-shrink: 0;
}

input.dak-chatbot-input {
  flex: 1;
  width: 100%;
  border: 1px solid rgba(17, 24, 39, 0.14);
  border-radius: 999px;
  padding: 12px 16px;
  outline: none;
  font-size: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input.dak-chatbot-input:focus {
  border-color: var(--dak-brand, #16a34a);
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.15);
}

button.dak-chatbot-send,
.dak-lead-form button {
  border: 0;
  border-radius: 999px;
  background: var(--dak-brand, #16a34a);
  color: #fff;
  padding: 0 16px;
  min-height: 42px;
  cursor: pointer;
  font-weight: 700;
  transition: background 0.2s ease, opacity 0.2s ease;
}

button.dak-chatbot-send:hover:not(:disabled),
.dak-lead-form button:hover:not(:disabled) {
  background: var(--dak-brand-hover, #15803d);
}

button.dak-chatbot-send:active:not(:disabled),
.dak-lead-form button:active:not(:disabled) {
  background: var(--dak-brand-hover, #15803d);
  filter: brightness(0.95);
}

button.dak-chatbot-send:disabled,
.dak-lead-form button:disabled,
input.dak-chatbot-input:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.dak-message {
  display: flex;
  flex-direction: column;
  margin-bottom: 14px;
  align-items: flex-start;
}

.dak-message-user {
  align-items: flex-end;
}

.dak-message-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  width: 100%;
  max-width: 92%;
}

.dak-message-user .dak-message-meta {
  display: none;
}

.dak-msg-avatar {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  object-fit: cover;
  flex-shrink: 0;
  background: #e2e8f0;
}

.dak-msg-avatar[hidden] {
  display: none;
}

.dak-msg-name {
  font-weight: 700;
  font-size: 14px;
  color: #0f172a;
}

.dak-online-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #22c55e;
  flex-shrink: 0;
}

.dak-msg-time {
  margin-left: auto;
  font-size: 12px;
  color: #94a3b8;
}

.dak-message-bubble {
  max-width: 88%;
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.5;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
}

.dak-message-user .dak-message-bubble {
  background: var(--dak-brand, #16a34a);
  background-image: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(0,0,0,0.05) 100%);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.dak-message-bot .dak-message-bubble {
  background: #fff;
  color: #111827;
  border-bottom-left-radius: 4px;
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.dak-typing .dak-message-bubble {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  min-width: 56px;
  padding: 12px 18px;
}

/* Only animate dots inside the bubble — not .dak-message-meta spans */
.dak-typing .dak-message-bubble > span {
  display: block;
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #64748b;
  animation: dakBlink 1.2s infinite ease-in-out;
}

.dak-typing .dak-message-bubble > span:nth-child(2) {
  animation-delay: 0.2s;
}

.dak-typing .dak-message-bubble > span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes dakBlink {
  0%, 80%, 100% { transform: scale(0.8); opacity: 0.45; }
  40% { transform: scale(1); opacity: 1; }
}

.dak-lead-form-wrap {
  background: #fff;
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: 16px;
  padding: 12px;
  margin: 4px 0 14px;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
}

.dak-lead-form {
  display: grid;
  gap: 9px;
}

.dak-lead-form input {
  border: 1px solid rgba(17, 24, 39, 0.14);
  border-radius: 12px;
  padding: 11px 12px;
  font-size: 14px;
}

.dak-hp {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
}

.dak-privacy-note {
  margin: 0;
  font-size: 11px;
  line-height: 1.35;
  color: #64748b;
}

.dak-sources {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  font-size: 12px;
  color: #475569;
}

.dak-sources a {
  color: var(--dak-brand, #16a34a);
  text-decoration: underline;
}

.dak-whatsapp {
  display: block;
  margin-top: 10px;
  padding: 11px 12px;
  border-radius: 999px;
  text-align: center;
  background: #ecfdf5;
  color: #065f46;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid rgba(6, 95, 70, 0.14);
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.dak-whatsapp:hover {
  background: #d1fae5;
  color: var(--dak-brand-hover, #15803d);
  border-color: rgba(22, 163, 74, 0.28);
}

.dak-help-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px 16px;
  background: #fff;
}

.dak-help-section-title {
  margin: 16px 0 10px;
  font-size: 15px;
  font-weight: 700;
  color: #1e293b;
}

.dak-help-section-title:first-child {
  margin-top: 4px;
}

.dak-help-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.dak-help-list li {
  margin: 0;
  padding: 0;
}

button.dak-help-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  padding: 11px 4px;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  border-radius: 12px;
  font: inherit;
  color: inherit;
}

button.dak-help-row:hover {
  background: #f1f5f9;
}

.dak-help-row-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  margin-top: 2px;
  opacity: 0.45;
  font-size: 16px;
}

.dak-help-row-main {
  flex: 1;
  min-width: 0;
}

.dak-help-row-title {
  font-weight: 700;
  font-size: 14px;
  color: #0f172a;
  line-height: 1.35;
}

.dak-help-row-sub {
  font-size: 12px;
  color: #64748b;
  margin-top: 2px;
  margin-left: 8px;
}

.dak-help-row-chevron {
  color: var(--dak-brand, #16a34a);
  font-weight: 700;
  flex-shrink: 0;
  align-self: center;
}

.dak-article-breadcrumb {
  font-size: 13px;
  color: #2563eb;
  margin-bottom: 10px;
}

.dak-article-breadcrumb a {
  color: inherit;
  text-decoration: none;
}

.dak-article-breadcrumb a:hover {
  text-decoration: underline;
}

.dak-article-title {
  margin: 0 0 12px;
  font-size: 20px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.25;
}

.dak-article-body {
  font-size: 14px;
  line-height: 1.55;
  color: #334155;
}

.dak-article-body img {
  max-width: 100%;
  height: auto;
}

/* Help navigation after article — visually distinct from article body */
.dak-article-categories-aside {
  margin-top: 1.75rem;
  padding: 14px 14px 12px 15px;
  border-radius: 14px;
  background: linear-gradient(165deg, #f1f5f9 0%, #f8fafc 55%, #eef2ff 100%);
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-left: 3px solid var(--dak-brand, #16a34a);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

.dak-article-aside-kicker {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #64748b;
  line-height: 1.3;
}

.dak-article-categories-aside .dak-help-section-title {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 800;
  color: #0f172a;
}

.dak-article-categories-aside .dak-help-list {
  margin-top: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dak-article-categories-aside button.dak-help-row {
  padding-left: 10px;
  padding-right: 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(15, 23, 42, 0.06);
}

.dak-article-categories-aside button.dak-help-row:hover {
  background: #fff;
  border-color: rgba(22, 163, 74, 0.22);
}

.dak-article-categories-aside .dak-help-empty {
  padding: 10px 12px;
  font-size: 13px;
  color: #64748b;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 10px;
  border: 1px dashed rgba(15, 23, 42, 0.12);
}

.dak-chatbot-tabs {
  flex-shrink: 0;
  display: flex;
  gap: 6px;
  padding: 10px 12px 12px;
  background: #fff;
  border-top: 1px solid rgba(17, 24, 39, 0.08);
}

button.dak-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 12px;
  border-radius: 999px;
  border: 0;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  background: #e2e8f0;
  color: var(--dak-brand, #16a34a);
  transition: background 0.2s ease, color 0.2s ease;
}

button.dak-tab.is-active {
  background: var(--dak-brand, #16a34a);
  color: #fff;
}

button.dak-tab.is-active:hover {
  background: var(--dak-brand-hover, #15803d);
  color: #fff;
}

button.dak-tab:not(.is-active):hover {
  color: var(--dak-brand-hover, #15803d);
  background: #f1f5f9;
}

.dak-tab-icon-chat {
  width: 16px;
  height: 14px;
  border: 2px solid currentColor;
  border-radius: 6px 6px 6px 2px;
}

button.dak-tab.dak-tab-help .dak-tab-icon-help {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 2px solid currentColor;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

button.dak-tab.is-active .dak-tab-icon-chat,
button.dak-tab.is-active .dak-tab-icon-help {
  border-color: #fff;
}

.dak-help-empty {
  padding: 12px;
  color: #64748b;
  font-size: 14px;
}

@media (max-width: 480px) {
  .dak-chatbot-root {
    right: 14px;
    bottom: 14px;
  }
  .dak-chatbot-window {
    width: calc(100vw - 28px);
    height: min(620px, calc(100vh - 96px));
    bottom: 72px;
  }
  .dak-message-bubble {
    max-width: 92%;
  }
}
