/* Help center + floating support widget */

.kb-help-body {
  background: #f8fafc;
}

.kb-help-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid #e2e8f0;
  padding: 0.85rem 0;
}

.kb-help-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.kb-help-nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.kb-help-nav a {
  color: #475569;
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
}

.kb-help-nav a:hover {
  color: #0f172a;
}

.kb-help-wa-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: #059669 !important;
}

.kb-help-main {
  padding: 2.5rem 0 5rem;
}

.kb-help-hero {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 2.5rem;
}

.kb-help-title {
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 800;
  color: #0f172a;
  margin: 0.75rem 0;
}

.kb-help-lead {
  color: #64748b;
  margin-bottom: 1.5rem;
}

.kb-help-search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  padding: 0.35rem 0.35rem 0.35rem 1rem;
  box-shadow: 0 8px 30px rgba(15, 23, 42, 0.06);
}

.kb-help-search i {
  color: #94a3b8;
}

.kb-help-search input {
  flex: 1;
  border: 0;
  outline: none;
  background: transparent;
  font-size: 1rem;
  min-width: 0;
}

.kb-help-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1rem;
}

.kb-help-chip {
  display: inline-flex;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: #eef2ff;
  color: #4338ca;
  font-size: 0.82rem;
  text-decoration: none;
  font-weight: 500;
}

.kb-help-chip:hover {
  background: #e0e7ff;
}

.kb-help-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.5rem;
  align-items: start;
}

.kb-help-sidebar h2,
.kb-help-content h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 1rem;
}

.kb-help-topics {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.kb-help-topic {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 0.65rem 0.85rem;
}

.kb-help-topic summary {
  cursor: pointer;
  font-weight: 600;
  color: #334155;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.kb-help-topic summary::-webkit-details-marker {
  display: none;
}

.kb-help-topic summary span {
  font-size: 0.75rem;
  color: #94a3b8;
  font-weight: 500;
}

.kb-help-topic ul {
  list-style: none;
  padding: 0.65rem 0 0;
  margin: 0;
}

.kb-help-topic li + li {
  margin-top: 0.35rem;
}

.kb-help-topic a {
  color: #475569;
  text-decoration: none;
  font-size: 0.88rem;
  line-height: 1.4;
}

.kb-help-topic a:hover,
.kb-help-topic a.active {
  color: #2563eb;
}

.kb-help-support-card {
  margin-top: 1rem;
  background: linear-gradient(145deg, #ecfdf5, #f0fdf4);
  border: 1px solid #bbf7d0;
  border-radius: 16px;
  padding: 1rem;
}

.kb-help-support-card h3 {
  font-size: 0.95rem;
  margin: 0 0 0.35rem;
}

.kb-help-support-card p {
  font-size: 0.82rem;
  color: #64748b;
  margin: 0 0 0.75rem;
}

.kb-help-support-link {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: #334155;
  text-decoration: none;
  font-size: 0.85rem;
  margin-bottom: 0.35rem;
}

.kb-help-wa-btn {
  width: 100%;
  margin-top: 0.65rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
}

.kb-help-content {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  padding: 1.5rem;
  min-height: 420px;
}

.kb-article-cat,
.kb-result-cat {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6366f1;
  margin-bottom: 0.5rem;
}

.kb-article h2 {
  margin-top: 0;
}

.kb-article-meta {
  font-size: 0.82rem;
  color: #64748b;
  margin: 0.25rem 0 1rem;
}

.kb-help-freshness {
  font-size: 0.82rem;
  color: #64748b;
  margin: 0.35rem 0 0;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.kb-howto {
  margin-top: 1.75rem;
  padding: 1.15rem 1.2rem;
  background: linear-gradient(135deg, #eff6ff 0%, #f0fdf4 100%);
  border: 1px solid #dbeafe;
  border-radius: 14px;
}

.kb-howto h3 {
  font-size: 1.05rem;
  font-weight: 800;
  margin-bottom: 0.35rem;
}

.kb-howto-lead {
  font-size: 0.9rem;
  color: #475569;
  margin-bottom: 0.85rem;
}

.kb-howto-steps {
  margin: 0;
  padding-left: 1.15rem;
  display: grid;
  gap: 0.65rem;
}

.kb-howto-steps li {
  font-size: 0.88rem;
  line-height: 1.55;
  color: #334155;
}

.kb-howto-steps li strong {
  display: block;
  color: #0f172a;
  margin-bottom: 0.15rem;
}

.kb-article-body {
  color: #334155;
  line-height: 1.7;
  font-size: 0.95rem;
}

.kb-article-body p {
  margin: 0 0 0.85rem;
}

.kb-article-body p:last-child {
  margin-bottom: 0;
}

.kb-article-body ul,
.kb-article-body ol {
  margin: 0 0 1rem;
  padding-left: 1.35rem;
}

.kb-article-body li {
  margin-bottom: 0.4rem;
}

.kb-article-body li:last-child {
  margin-bottom: 0;
}

.kb-article-body strong {
  color: #0f172a;
  font-weight: 600;
}

.kb-article-body code {
  background: #f1f5f9;
  border-radius: 4px;
  padding: 0.1rem 0.35rem;
  font-size: 0.88em;
}

.kb-article-body a {
  color: #2563eb;
  text-decoration: none;
  font-weight: 500;
}

.kb-article-body a:hover {
  text-decoration: underline;
}

.kb-article-body h3,
.kb-article-body h4,
.kb-article-body h5,
.kb-article-body h6 {
  color: #0f172a;
  font-weight: 700;
  margin: 1.35rem 0 0.65rem;
  line-height: 1.35;
}

.kb-article-body h3 { font-size: 1.05rem; }
.kb-article-body h4 { font-size: 0.98rem; }

.kb-article-body pre.kb-code {
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 12px;
  padding: 1rem 1.1rem;
  overflow-x: auto;
  margin: 0 0 1rem;
  font-size: 0.82rem;
  line-height: 1.55;
}

.kb-article-body pre.kb-code code {
  background: transparent;
  padding: 0;
  font-size: inherit;
  color: inherit;
}

.kb-table-wrap {
  overflow-x: auto;
  margin: 0 0 1rem;
}

.kb-article-body .kb-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.kb-article-body .kb-table th,
.kb-article-body .kb-table td {
  border: 1px solid #e2e8f0;
  padding: 0.55rem 0.75rem;
  text-align: left;
  vertical-align: top;
}

.kb-article-body .kb-table th {
  background: #f8fafc;
  color: #0f172a;
  font-weight: 600;
}

.kb-article-body .kb-table tr:nth-child(even) td {
  background: #fafbfd;
}

.kb-article-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid #f1f5f9;
}

.kb-result-card {
  display: block;
  padding: 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  text-decoration: none;
  color: inherit;
  margin-bottom: 0.75rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.kb-result-card:hover {
  border-color: #c7d2fe;
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.08);
}

.kb-result-card h3 {
  font-size: 1rem;
  margin: 0.25rem 0;
  color: #0f172a;
}

.kb-result-card p {
  margin: 0;
  color: #64748b;
  font-size: 0.88rem;
}

.kb-browse-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.kb-browse-card {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 1rem;
}

.kb-browse-card h3 {
  font-size: 0.95rem;
  margin: 0 0 0.65rem;
}

.kb-browse-card ul {
  margin: 0;
  padding-left: 1rem;
}

.kb-browse-card li {
  margin-bottom: 0.35rem;
}

.kb-browse-card a {
  color: #475569;
  font-size: 0.86rem;
}

.kb-empty {
  color: #64748b;
}

/* Floating widget */
.kb-widget {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 9999;
  font-family: inherit;
}

.kb-widget-panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 0.75rem);
  width: min(400px, calc(100vw - 2rem));
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.16);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: min(580px, calc(100vh - 6rem));
}

.kb-widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1rem;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 100%);
  color: #fff;
}

.kb-widget-header strong {
  display: block;
  font-size: 0.98rem;
  letter-spacing: -0.01em;
}

.kb-widget-header span {
  font-size: 0.72rem;
  color: #94a3b8;
}

.kb-widget-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 0.85rem;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  min-height: 240px;
  scroll-behavior: smooth;
}

.kb-msg {
  display: flex;
  gap: 0.55rem;
  margin-bottom: 0.85rem;
  align-items: flex-start;
}

.kb-msg--user {
  justify-content: flex-end;
}

.kb-msg--user .kb-msg-content {
  display: flex;
  justify-content: flex-end;
}

.kb-msg-avatar {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 10px;
  background: linear-gradient(135deg, #6366f1, #2563eb);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  margin-top: 2px;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.kb-msg-content {
  flex: 1;
  min-width: 0;
  max-width: calc(100% - 36px);
}

.kb-msg--user .kb-msg-content {
  flex: 0 1 auto;
  max-width: 88%;
}

.kb-msg-bubble {
  display: inline-block;
  max-width: 100%;
  padding: 0.7rem 0.9rem;
  border-radius: 16px;
  font-size: 0.875rem;
  line-height: 1.55;
  word-wrap: break-word;
}

.kb-msg--user .kb-msg-bubble {
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  color: #fff;
  border-bottom-right-radius: 5px;
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.22);
}

.kb-msg--bot .kb-msg-bubble {
  background: #fff;
  color: #334155;
  border: 1px solid #e2e8f0;
  border-bottom-left-radius: 5px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
}

.kb-msg-bubble strong {
  color: #0f172a;
  font-weight: 600;
}

.kb-msg-bubble a {
  color: #2563eb;
  font-weight: 500;
  text-decoration: none;
}

.kb-msg-bubble a:hover {
  text-decoration: underline;
}

.kb-msg-sources {
  margin-top: 0.5rem;
  padding: 0.55rem 0.65rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
}

.kb-msg-sources-label {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #94a3b8;
  margin-bottom: 0.4rem;
}

.kb-msg-source-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.kb-msg-source-pill {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 500;
  color: #4338ca !important;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  text-decoration: none !important;
  line-height: 1.35;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kb-msg-source-pill:hover {
  background: #e0e7ff;
  border-color: #a5b4fc;
}

.kb-msg--typing .kb-msg-bubble {
  display: flex;
  gap: 4px;
  padding: 0.85rem 1rem;
  min-width: 52px;
}

.kb-widget-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.5rem 0.85rem 0.65rem;
  background: #f8fafc;
  border-top: 1px solid #eef2f7;
}

.kb-widget-suggestions[hidden] {
  display: none !important;
}

.kb-suggest-chip {
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #475569;
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  font-size: 0.74rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  line-height: 1.3;
  text-align: left;
}

.kb-suggest-chip:hover {
  border-color: #a5b4fc;
  background: #eef2ff;
  color: #4338ca;
}

.kb-widget-form {
  display: flex;
  gap: 0.45rem;
  padding: 0.75rem 0.85rem;
  border-top: 1px solid #e2e8f0;
  background: #fff;
}

.kb-widget-form input {
  flex: 1;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  padding: 0.6rem 0.95rem;
  font-size: 0.88rem;
  outline: none;
  background: #f8fafc;
  transition: border-color 0.15s, background 0.15s;
}

.kb-widget-form input:focus {
  border-color: #6366f1;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.kb-widget-form button {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  color: #fff;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.28);
}

.kb-widget-form button:hover {
  transform: scale(1.04);
}

.kb-widget-panel[hidden] {
  display: none !important;
}

.kb-widget-close {
  border: 0;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
}

.kb-widget-close:hover {
  background: rgba(255, 255, 255, 0.18);
}

.kb-msg--typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #94a3b8;
  animation: kb-typing 1.2s infinite;
}

.kb-msg--typing span:nth-child(2) { animation-delay: 0.15s; }
.kb-msg--typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes kb-typing {
  0%, 80%, 100% { opacity: 0.3; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-3px); }
}

.kb-widget-footer {
  padding: 0.65rem 0.75rem 0.85rem;
  background: #fff;
  border-top: 1px solid #f1f5f9;
}

.kb-widget-wa {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.75rem;
  border-radius: 12px;
  background: #ecfdf5;
  border: 1px solid #bbf7d0;
  text-decoration: none;
  color: #065f46;
  margin-bottom: 0.5rem;
}

.kb-widget-wa i {
  font-size: 1.35rem;
}

.kb-widget-wa strong {
  display: block;
  font-size: 0.85rem;
}

.kb-widget-wa small {
  color: #047857;
  font-size: 0.72rem;
}

.kb-widget-help-link {
  display: block;
  text-align: center;
  font-size: 0.78rem;
  color: #64748b;
  text-decoration: none;
}

.kb-widget-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border: 0;
  border-radius: 999px;
  padding: 0.85rem 1.1rem;
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 12px 32px rgba(37, 99, 235, 0.35);
  cursor: pointer;
}

.kb-widget-toggle.is-open {
  background: #334155;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.25);
}

.kb-widget-icon--close,
.kb-widget-toggle.is-open .kb-widget-icon--open {
  display: none;
}

.kb-widget-toggle.is-open .kb-widget-icon--close {
  display: inline;
}

@media (max-width: 900px) {
  .kb-help-layout {
    grid-template-columns: 1fr;
  }

  .kb-help-sidebar {
    order: 2;
  }

  .kb-browse-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .kb-help-nav a:not(.kb-help-wa-link) {
    display: none;
  }

  .kb-help-search {
    flex-wrap: wrap;
    border-radius: 16px;
    padding: 0.75rem;
  }

  .kb-help-search .lp-btn {
    width: 100%;
  }

  .kb-widget {
    right: 0.75rem;
    bottom: 0.75rem;
  }

  .kb-widget-toggle-label {
    display: none;
  }
}
