/**
 * Knowledge Guide Widget
 * Three-state widget: card (compact), mini (medium), expanded (full)
 */

/* ═══════════════════════════════════════════════════════════════════════════
   FLOATING WRAPPER (Header button triggered)
   ═══════════════════════════════════════════════════════════════════════════ */
.kg-floating-wrapper {
  /* Container for the floating widget - does NOT cover viewport */
  /* Child .kg-widget uses position: fixed so no need for full coverage */
  position: fixed;
  top: 0;
  right: 0;
  width: 0;
  height: 0;
  z-index: 9999;
  pointer-events: none;
  overflow: visible;
}

.kg-floating-wrapper .kg-widget {
  position: fixed;
  top: 50px;
  right: 16px;
  left: auto;
  margin-top: 0;
  max-height: calc(100vh - 70px);
  pointer-events: auto;
}

.kg-floating-wrapper .kg-widget--mini {
  max-width: 420px;
  width: 420px;
}

.kg-floating-wrapper .kg-widget--expanded {
  width: min(1100px, calc(100vw - 32px));
  max-height: calc(100vh - 70px);
  overflow: hidden;
}

.kg-floating-wrapper .kg-widget--expanded .kg-body {
  max-height: calc(100vh - 120px);
  overflow: hidden;
}

.kg-floating-wrapper .kg-widget--expanded .kg-expanded {
  height: calc(100vh - 150px);
  max-height: 600px;
}

.kg-floating-wrapper .kg-body {
  max-height: calc(100vh - 140px);
  overflow-y: auto;
}

@media (max-width: 480px) {
  /* Mobile: wrapper stays 0x0, widget positions itself */
  .kg-floating-wrapper .kg-widget {
    top: 44px;
    right: 8px;
    left: 8px;
  }

  .kg-floating-wrapper .kg-widget--mini {
    width: 100%;
    max-width: none;
  }
}


/* ═══════════════════════════════════════════════════════════════════════════
   CSS CUSTOM PROPERTIES
   ═══════════════════════════════════════════════════════════════════════════ */
:root {
  --kg-accent: #059669;
  --kg-accent-dark: #047857;
  --kg-accent-glow: rgba(5, 150, 105, 0.3);

  --kg-bg: linear-gradient(180deg, rgba(26, 29, 36, 0.95) 0%, rgba(18, 21, 26, 0.98) 100%);
  --kg-bg-solid: #1a1d24;
  --kg-border: rgba(255, 255, 255, 0.04);
  --kg-border-hover: rgba(255, 255, 255, 0.08);

  --kg-text: #e5e7eb;
  --kg-text-muted: #9ca3af;
  --kg-text-dim: #6b7280;

  --kg-input-bg: rgba(0, 0, 0, 0.3);
  --kg-input-border: rgba(255, 255, 255, 0.1);

  --kg-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
  --kg-shadow-glow: 0 0 40px var(--kg-accent-glow);

  --kg-radius: 14px;
  --kg-radius-sm: 8px;
  --kg-radius-xs: 6px;

  --kg-transition: 0.15s ease;
}

/* Light mode overrides */
.light-mode {
  --kg-bg: linear-gradient(180deg, #ffffff 0%, #f9fafb 100%);
  --kg-bg-solid: #ffffff;
  --kg-border: rgba(0, 0, 0, 0.08);
  --kg-border-hover: rgba(0, 0, 0, 0.12);
  --kg-text: #1f2937;
  --kg-text-muted: #6b7280;
  --kg-text-dim: #9ca3af;
  --kg-input-bg: rgba(0, 0, 0, 0.04);
  --kg-input-border: rgba(0, 0, 0, 0.1);
  --kg-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
}


/* ═══════════════════════════════════════════════════════════════════════════
   WIDGET CONTAINER
   ═══════════════════════════════════════════════════════════════════════════ */
.kg-widget {
  background: var(--kg-bg);
  border-radius: var(--kg-radius);
  border: 1px solid var(--kg-border);
  box-shadow: var(--kg-shadow), var(--kg-shadow-glow);
  position: relative;
  margin-top: 16px;
  transition: all var(--kg-transition);
  overflow: visible; /* Allow handle to extend above */
}

.kg-widget:hover {
  border-color: var(--kg-border-hover);
}

/* Size variants */
.kg-widget--card {
  max-width: 320px;
}

.kg-widget--mini {
  max-width: 420px;
}

.kg-widget--expanded {
  max-width: 100%;
}


/* ═══════════════════════════════════════════════════════════════════════════
   WIDGET HANDLE (Top Tab)
   ═══════════════════════════════════════════════════════════════════════════ */
.kg-handle {
  position: absolute;
  top: -10px;
  left: 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 8px;
  border-radius: var(--kg-radius);
  background: linear-gradient(135deg, var(--kg-accent) 0%, var(--kg-accent-dark) 100%);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4), 0 0 20px var(--kg-accent-glow);
  cursor: grab;
  z-index: 10;
  transition: all var(--kg-transition);
  width: fit-content;
  max-width: calc(100% - 32px);
}

.kg-handle:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), 0 0 30px var(--kg-accent-glow);
}

.kg-handle__icon {
  width: 14px;
  height: 14px;
  color: white;
}

.kg-handle__label {
  font-size: 10px;
  font-weight: 600;
  color: white;
  letter-spacing: 0.3px;
}

.kg-handle__divider {
  width: 1px;
  height: 12px;
  background: rgba(255, 255, 255, 0.3);
  margin: 0 4px;
}

.kg-handle__size-btn {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  transition: all var(--kg-transition);
}

.kg-handle__size-btn:hover,
.kg-handle__size-btn.active {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

.kg-handle__size-btn svg {
  width: 10px;
  height: 10px;
  stroke: currentColor;
  stroke-width: 1.5;
  fill: none;
}

.kg-handle__close {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: rgba(255, 255, 255, 0.4);
  font-size: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 4px;
  transition: all var(--kg-transition);
}

.kg-handle__close:hover {
  background: rgba(255, 90, 90, 0.8);
  color: white;
}


/* ═══════════════════════════════════════════════════════════════════════════
   WIDGET BODY
   ═══════════════════════════════════════════════════════════════════════════ */
.kg-body {
  padding: 24px 14px 14px;
  color: var(--kg-text);
  overflow: hidden; /* Contain content overflow */
  border-radius: var(--kg-radius);
}

.kg-widget--card .kg-body {
  padding: 20px 12px 12px;
}


/* ═══════════════════════════════════════════════════════════════════════════
   SEARCH
   ═══════════════════════════════════════════════════════════════════════════ */
.kg-search {
  position: relative;
  margin-bottom: 12px;
}

.kg-search__icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: var(--kg-text-dim);
  pointer-events: none;
}

.kg-search__input {
  width: 100%;
  padding: 8px 12px 8px 32px;
  border-radius: var(--kg-radius-sm);
  border: 1px solid var(--kg-input-border);
  background: var(--kg-input-bg);
  color: var(--kg-text);
  font-size: 12px;
  outline: none;
  transition: all var(--kg-transition);
}

.kg-search__input:focus {
  border-color: var(--kg-accent);
  box-shadow: 0 0 0 2px rgba(5, 150, 105, 0.2);
}

.kg-search__input::placeholder {
  color: var(--kg-text-dim);
}


/* ═══════════════════════════════════════════════════════════════════════════
   CATEGORY TABS
   ═══════════════════════════════════════════════════════════════════════════ */
.kg-categories {
  display: flex;
  gap: 2px;
  background: var(--kg-input-bg);
  padding: 3px;
  border-radius: var(--kg-radius-sm);
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.kg-category {
  flex: 1;
  min-width: fit-content;
  padding: 6px 8px;
  font-size: 10px;
  font-weight: 500;
  color: var(--kg-text-muted);
  background: transparent;
  border: none;
  border-radius: var(--kg-radius-xs);
  cursor: pointer;
  transition: all var(--kg-transition);
  white-space: nowrap;
}

.kg-category:hover {
  color: var(--kg-text);
}

.kg-category.active {
  background: var(--kg-accent);
  color: white;
}

.kg-category__count {
  font-size: 9px;
  opacity: 0.7;
  margin-left: 4px;
}


/* ═══════════════════════════════════════════════════════════════════════════
   ARTICLE LIST
   ═══════════════════════════════════════════════════════════════════════════ */
.kg-articles {
  max-height: 300px;
  overflow-y: auto;
  margin: 0 -4px;
  padding: 0 4px 50px; /* Bottom padding for FAB overlap */
}

.kg-widget--card .kg-articles {
  max-height: 200px;
}

.kg-article {
  padding: 10px 12px;
  border-radius: var(--kg-radius-sm);
  cursor: pointer;
  transition: all var(--kg-transition);
  border-left: 2px solid transparent;
  margin-bottom: 2px;
}

.kg-article:hover {
  background: rgba(255, 255, 255, 0.05);
  border-left-color: var(--kg-accent);
}

.kg-article.active {
  background: rgba(5, 150, 105, 0.1);
  border-left-color: var(--kg-accent);
}

.kg-article__title {
  font-size: 12px;
  font-weight: 500;
  color: var(--kg-text);
  margin-bottom: 2px;
  line-height: 1.3;
  /* Line clamp to 2 lines */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.kg-article__meta {
  font-size: 10px;
  color: var(--kg-text-dim);
}

.kg-article__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.kg-article__tag {
  font-size: 9px;
  padding: 2px 6px;
  background: rgba(5, 150, 105, 0.15);
  color: #10b981;
  border-radius: 4px;
}

/* Empty state */
.kg-empty {
  text-align: center;
  padding: 24px 16px;
  color: var(--kg-text-dim);
}

.kg-empty__icon {
  font-size: 32px;
  margin-bottom: 8px;
}

.kg-empty__text {
  font-size: 12px;
}


/* ═══════════════════════════════════════════════════════════════════════════
   AI CHAT BUTTON
   ═══════════════════════════════════════════════════════════════════════════ */
.kg-ai-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  background: linear-gradient(135deg, var(--kg-accent) 0%, var(--kg-accent-dark) 100%);
  border: none;
  border-radius: var(--kg-radius-sm);
  color: white;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  width: 100%;
  margin-top: 12px;
  transition: all var(--kg-transition);
}

.kg-ai-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--kg-accent-glow);
}

.kg-ai-btn svg {
  width: 14px;
  height: 14px;
}

/* Floating AI Button (for card/mini modes) */
.kg-ai-fab {
  position: absolute;
  bottom: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--kg-accent) 0%, var(--kg-accent-dark) 100%);
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), 0 0 20px var(--kg-accent-glow);
  transition: all var(--kg-transition);
  z-index: 5;
}

.kg-ai-fab:hover {
  transform: scale(1.1);
}

.kg-ai-fab svg {
  width: 18px;
  height: 18px;
}


/* ═══════════════════════════════════════════════════════════════════════════
   EXPANDED LAYOUT
   ═══════════════════════════════════════════════════════════════════════════ */
.kg-expanded {
  display: grid;
  grid-template-columns: 180px 1fr 260px;
  gap: 12px;
  min-height: 400px;
  height: 100%;
  max-height: calc(100vh - 160px);
  overflow: hidden;
}

.kg-sidebar {
  border-right: 1px solid var(--kg-border);
  padding-right: 12px;
  overflow-y: auto;
  max-height: 100%;
}

.kg-sidebar__section {
  margin-bottom: 16px;
}

.kg-sidebar__title {
  font-size: 10px;
  font-weight: 700;
  color: var(--kg-text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.kg-sidebar__item {
  padding: 6px 10px;
  font-size: 11px;
  color: var(--kg-text-muted);
  border-radius: var(--kg-radius-xs);
  cursor: pointer;
  transition: all var(--kg-transition);
  display: flex;
  align-items: center;
  gap: 6px;
}

.kg-sidebar__item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--kg-text);
}

.kg-sidebar__item.active {
  background: rgba(5, 150, 105, 0.2);
  color: #10b981;
}

.kg-sidebar__item-icon {
  font-size: 12px;
}


/* ═══════════════════════════════════════════════════════════════════════════
   TABLE OF CONTENTS (Hierarchical Tree)
   ═══════════════════════════════════════════════════════════════════════════ */
.kg-toc {
  font-size: 11px;
}

.kg-toc__section {
  margin-bottom: 2px;
}

.kg-toc__subsection {
  margin-bottom: 1px;
}

.kg-toc__item {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 8px;
  border-radius: var(--kg-radius-xs);
  cursor: pointer;
  transition: all var(--kg-transition);
  color: var(--kg-text-muted);
}

.kg-toc__item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--kg-text);
}

.kg-toc__item.active {
  background: rgba(5, 150, 105, 0.2);
  color: #10b981;
}

.kg-toc__item--level1 {
  font-weight: 600;
  color: var(--kg-text);
  padding: 6px 8px;
}

.kg-toc__item--level2 {
  padding-left: 20px;
  font-weight: 500;
}

.kg-toc__item--level3 {
  padding-left: 36px;
  font-size: 10px;
}

.kg-toc__toggle {
  font-size: 8px;
  width: 12px;
  color: var(--kg-text-dim);
  transition: transform var(--kg-transition);
  flex-shrink: 0;
}

.kg-toc__toggle.open {
  transform: rotate(90deg);
}

.kg-toc__title {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kg-toc__link-icon {
  font-size: 10px;
  color: var(--kg-accent);
  opacity: 0.7;
  margin-left: 4px;
  flex-shrink: 0;
}

.kg-toc__children {
  margin-top: 2px;
}

/* Light mode adjustments for TOC */
.light-mode .kg-toc__item--level1 {
  color: var(--kg-text);
}

.light-mode .kg-toc__item:hover {
  background: rgba(0, 0, 0, 0.04);
}

.light-mode .kg-toc__item.active {
  background: rgba(5, 150, 105, 0.15);
}


/* ═══════════════════════════════════════════════════════════════════════════
   ARTICLE VIEWER (Expanded Mode)
   ═══════════════════════════════════════════════════════════════════════════ */
.kg-viewer {
  overflow-y: auto;
  padding: 0 12px;
  max-height: 100%;
}

.kg-viewer__header {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--kg-border);
}

.kg-viewer__title {
  font-size: 18px;
  font-weight: 600;
  color: var(--kg-text);
  margin-bottom: 4px;
}

.kg-viewer__meta {
  font-size: 11px;
  color: var(--kg-text-dim);
}

.kg-viewer__content {
  font-size: 13px;
  line-height: 1.6;
  color: var(--kg-text);
}

.kg-viewer__content p {
  margin-bottom: 12px;
}

.kg-viewer__content h1,
.kg-viewer__content h2,
.kg-viewer__content h3 {
  color: var(--kg-text);
  margin: 20px 0 12px;
  font-weight: 600;
}

.kg-viewer__content h1 { font-size: 20px; }
.kg-viewer__content h2 { font-size: 16px; }
.kg-viewer__content h3 { font-size: 14px; }

.kg-viewer__content ul,
.kg-viewer__content ol {
  margin: 12px 0;
  padding-left: 24px;
}

.kg-viewer__content li {
  margin-bottom: 6px;
}

/* Feedback bar */
.kg-feedback {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--kg-border);
}

.kg-feedback__label {
  font-size: 11px;
  color: var(--kg-text-dim);
}

.kg-feedback__btn {
  padding: 6px 12px;
  font-size: 11px;
  border-radius: var(--kg-radius-xs);
  border: 1px solid var(--kg-input-border);
  background: transparent;
  color: var(--kg-text-muted);
  cursor: pointer;
  transition: all var(--kg-transition);
  display: flex;
  align-items: center;
  gap: 4px;
}

.kg-feedback__btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--kg-text);
}

.kg-feedback__btn--positive:hover {
  border-color: #10b981;
  color: #10b981;
}

.kg-feedback__btn--negative:hover {
  border-color: #f59e0b;
  color: #f59e0b;
}


/* ═══════════════════════════════════════════════════════════════════════════
   AI CHAT PANEL (Expanded Mode)
   ═══════════════════════════════════════════════════════════════════════════ */
.kg-chat {
  border-left: 1px solid var(--kg-border);
  padding-left: 16px;
  display: flex;
  flex-direction: column;
}

.kg-chat__header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--kg-border);
}

.kg-chat__icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--kg-accent) 0%, var(--kg-accent-dark) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.kg-chat__icon svg {
  width: 12px;
  height: 12px;
}

.kg-chat__title {
  font-size: 12px;
  font-weight: 600;
  color: var(--kg-text);
}

.kg-chat__messages {
  flex: 1;
  overflow-y: auto;
  margin-bottom: 12px;
}

.kg-chat__message {
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: var(--kg-radius-sm);
  font-size: 12px;
  line-height: 1.5;
}

.kg-chat__message--user {
  background: rgba(5, 150, 105, 0.15);
  color: var(--kg-text);
  margin-left: 24px;
}

.kg-chat__message--ai {
  background: var(--kg-input-bg);
  color: var(--kg-text);
  margin-right: 24px;
}

.kg-chat__input-wrap {
  display: flex;
  gap: 8px;
}

.kg-chat__input {
  flex: 1;
  padding: 10px 12px;
  border-radius: var(--kg-radius-sm);
  border: 1px solid var(--kg-input-border);
  background: var(--kg-input-bg);
  color: var(--kg-text);
  font-size: 12px;
  outline: none;
  resize: none;
}

.kg-chat__input:focus {
  border-color: var(--kg-accent);
}

.kg-chat__send {
  padding: 10px 14px;
  border-radius: var(--kg-radius-sm);
  background: var(--kg-accent);
  border: none;
  color: white;
  cursor: pointer;
  transition: all var(--kg-transition);
}

.kg-chat__send:hover {
  background: var(--kg-accent-dark);
}

.kg-chat__send svg {
  width: 14px;
  height: 14px;
}


/* ═══════════════════════════════════════════════════════════════════════════
   LOADING STATES
   ═══════════════════════════════════════════════════════════════════════════ */
.kg-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.kg-spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--kg-border);
  border-top-color: var(--kg-accent);
  border-radius: 50%;
  animation: kg-spin 0.8s linear infinite;
}

@keyframes kg-spin {
  to { transform: rotate(360deg); }
}


/* ═══════════════════════════════════════════════════════════════════════════
   SCROLLBAR STYLING
   ═══════════════════════════════════════════════════════════════════════════ */
.kg-widget ::-webkit-scrollbar {
  width: 6px;
}

.kg-widget ::-webkit-scrollbar-track {
  background: transparent;
}

.kg-widget ::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

.kg-widget ::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}


/* ═══════════════════════════════════════════════════════════════════════════
   NAVIGATION BAR (Home + Breadcrumb)
   ═══════════════════════════════════════════════════════════════════════════ */
.kg-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--kg-input-bg);
  border-radius: var(--kg-radius-sm);
  margin-bottom: 12px;
}

.kg-nav--expanded {
  background: transparent;
  padding: 0;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--kg-border);
}

.kg-nav__home {
  width: 28px;
  height: 28px;
  min-width: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--kg-radius-xs);
  background: transparent;
  border: 1px solid var(--kg-input-border);
  color: var(--kg-text-muted);
  cursor: pointer;
  transition: all var(--kg-transition);
}

.kg-nav__home:hover {
  background: var(--kg-accent);
  border-color: var(--kg-accent);
  color: white;
}

.kg-nav__home svg {
  width: 14px;
  height: 14px;
}

.kg-nav__source {
  margin-left: auto;
  width: 28px;
  height: 28px;
  min-width: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--kg-radius-xs);
  color: var(--kg-text-dim);
  text-decoration: none;
  transition: all var(--kg-transition);
}

.kg-nav__source:hover {
  color: var(--kg-accent);
  background: rgba(5, 150, 105, 0.1);
}

.kg-nav__source svg {
  width: 14px;
  height: 14px;
}


/* ═══════════════════════════════════════════════════════════════════════════
   BREADCRUMB
   ═══════════════════════════════════════════════════════════════════════════ */
.kg-breadcrumb {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--kg-text-dim);
  overflow: hidden;
  flex: 1;
  min-width: 0;
}

.kg-breadcrumb__item {
  color: var(--kg-text-muted);
  cursor: pointer;
  transition: color var(--kg-transition);
  white-space: nowrap;
}

.kg-breadcrumb__item:hover {
  color: var(--kg-accent);
}

.kg-breadcrumb__sep {
  color: var(--kg-text-dim);
  opacity: 0.5;
}

.kg-breadcrumb__current {
  color: var(--kg-text);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}


/* ═══════════════════════════════════════════════════════════════════════════
   ARTICLE VIEW (Card/Mini Mode)
   ═══════════════════════════════════════════════════════════════════════════ */
.kg-article-view {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.kg-article-content {
  flex: 1;
  overflow-y: auto;
  padding-right: 4px;
}

.kg-widget--card .kg-article-content {
  max-height: 280px;
}

.kg-widget--mini .kg-article-content {
  max-height: 380px;
}

.kg-article-content__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--kg-text);
  margin-bottom: 4px;
  line-height: 1.3;
}

.kg-article-content__meta {
  font-size: 10px;
  color: var(--kg-text-dim);
  margin-bottom: 12px;
}

.kg-article-content__body {
  font-size: 12px;
  line-height: 1.6;
  color: var(--kg-text);
}

.kg-article-content__body p {
  margin-bottom: 10px;
}


/* ═══════════════════════════════════════════════════════════════════════════
   COMPACT FEEDBACK (Card/Mini Mode)
   ═══════════════════════════════════════════════════════════════════════════ */
.kg-feedback--compact {
  padding-top: 10px;
  margin-top: 12px;
}

.kg-feedback--compact .kg-feedback__label {
  font-size: 10px;
}

.kg-feedback--compact .kg-feedback__btn {
  padding: 4px 8px;
  font-size: 10px;
  border: none;
  background: var(--kg-input-bg);
}


/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  .kg-expanded {
    grid-template-columns: 1fr;
  }

  .kg-sidebar {
    display: none;
  }

  .kg-chat {
    border-left: none;
    border-top: 1px solid var(--kg-border);
    padding-left: 0;
    padding-top: 16px;
  }
}
