/* Phase 5 — Knowledge base & digital interaction */

.kb-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 14px;
}

.kb-search {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 16px;
}

.kb-search input[type="search"] {
  flex: 1;
  min-width: 200px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-family: inherit;
}

.kb-search select {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-family: inherit;
  min-width: 160px;
}

.kb-layout {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 16px;
}

.kb-section-title {
  font-size: 1.05rem;
  color: var(--purple-deep);
  margin: 0 0 10px;
}

.kb-card p {
  margin: 8px 0;
  font-size: 13px;
  line-height: 1.6;
  color: #555;
}

.kb-card-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.kb-cat-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.kb-cat-list li {
  margin: 0 0 8px;
  font-size: 13px;
  line-height: 1.6;
}

.kb-cat-list a {
  color: var(--purple-deep);
  text-decoration: none;
}

.kb-cat-list a.active,
.kb-cat-list a:hover {
  font-weight: 700;
  text-decoration: underline;
}

.kb-detail-layout {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 16px;
}

.kb-summary {
  font-weight: 600;
  color: var(--purple-deep);
  margin-bottom: 14px;
}

.kb-body {
  font-size: 14px;
  line-height: 1.85;
}

.kb-body ol,
.kb-body ul {
  padding-right: 22px;
}

.faq-item {
  border-bottom: 1px dashed #e8dff0;
  padding: 10px 0;
}

.faq-item:last-child { border-bottom: 0; }

.faq-item summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--purple-deep);
}

.faq-item p {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.7;
  color: #444;
}

.chatbot-layout {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 16px;
}

.chatbot-panel {
  display: flex;
  flex-direction: column;
  min-height: 480px;
}

.chatbot-thread {
  flex: 1;
  overflow-y: auto;
  max-height: 420px;
  padding: 8px 4px;
  background: #faf7fc;
  border-radius: 12px;
  border: 1px solid #eee3f5;
  margin-bottom: 10px;
}

.chat-intro {
  padding: 16px;
  text-align: center;
  color: #666;
  font-size: 13px;
  line-height: 1.7;
}

.chat-intro strong {
  display: block;
  color: var(--purple-deep);
  margin-bottom: 6px;
  font-size: 15px;
}

.chat-msg {
  display: flex;
  margin: 8px 10px;
}

.chat-msg.user { justify-content: flex-start; }
.chat-msg.bot { justify-content: flex-end; }

.chat-msg .bubble {
  max-width: 85%;
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.7;
  white-space: normal;
}

.chat-msg.user .bubble {
  background: #fff;
  border: 1px solid #e4d7ef;
}

.chat-msg.bot .bubble {
  background: var(--purple-deep);
  color: #fff;
}

.chatbot-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.chip-btn {
  border: 1px solid #e4d7ef;
  background: #fbf8fd;
  color: var(--purple-deep);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
}

.chip-btn:hover { border-color: var(--purple-mid); }

.chatbot-form {
  display: flex;
  gap: 8px;
}

.chatbot-form input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-family: inherit;
}

@media (max-width: 900px) {
  .kb-layout,
  .kb-detail-layout,
  .chatbot-layout,
  .kb-metrics {
    grid-template-columns: 1fr;
  }
}
